@progress/kendo-react-scheduler 16.3.0 → 16.4.0-develop.2

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.
Files changed (87) hide show
  1. package/Scheduler.d.ts +46 -0
  2. package/Scheduler.js +1 -1
  3. package/Scheduler.mjs +322 -297
  4. package/components/EventOverviewPopover.d.ts +36 -0
  5. package/components/EventOverviewPopover.js +8 -0
  6. package/components/EventOverviewPopover.mjs +137 -0
  7. package/components/MoreEventsPopover.js +1 -1
  8. package/components/MoreEventsPopover.mjs +42 -40
  9. package/components/SchedulerForm.js +1 -1
  10. package/components/SchedulerForm.mjs +137 -104
  11. package/components/SchedulerQuickCreateForm.d.ts +63 -0
  12. package/components/SchedulerQuickCreateForm.js +8 -0
  13. package/components/SchedulerQuickCreateForm.mjs +148 -0
  14. package/components/ShowMoreItemsButton.js +1 -1
  15. package/components/ShowMoreItemsButton.mjs +1 -1
  16. package/dist/cdn/js/kendo-react-scheduler.js +1 -1
  17. package/editors/DiscardChangesDialog.d.ts +17 -0
  18. package/editors/DiscardChangesDialog.js +8 -0
  19. package/editors/DiscardChangesDialog.mjs +34 -0
  20. package/editors/KeepResetCustomEventsDialog.d.ts +19 -0
  21. package/editors/KeepResetCustomEventsDialog.js +8 -0
  22. package/editors/KeepResetCustomEventsDialog.mjs +34 -0
  23. package/editors/SchedulerFormEditor.d.ts +18 -4
  24. package/editors/SchedulerFormEditor.js +1 -1
  25. package/editors/SchedulerFormEditor.mjs +273 -238
  26. package/editors/SchedulerRecurrenceDialog.js +1 -1
  27. package/editors/SchedulerRecurrenceDialog.mjs +142 -135
  28. package/editors/ZonedSplitDateTime.d.ts +30 -0
  29. package/editors/ZonedSplitDateTime.js +1 -1
  30. package/editors/ZonedSplitDateTime.mjs +58 -47
  31. package/hooks/index.d.ts +4 -0
  32. package/hooks/useCloseOnAnchorScrollOut.d.ts +18 -0
  33. package/hooks/useCloseOnAnchorScrollOut.js +8 -0
  34. package/hooks/useCloseOnAnchorScrollOut.mjs +51 -0
  35. package/hooks/useDeferredClick.d.ts +26 -0
  36. package/hooks/useDeferredClick.js +8 -0
  37. package/hooks/useDeferredClick.mjs +24 -0
  38. package/hooks/useEventOverviewPlacement.d.ts +23 -0
  39. package/hooks/useEventOverviewPlacement.js +8 -0
  40. package/hooks/useEventOverviewPlacement.mjs +14 -0
  41. package/hooks/useQuickCreatePlacement.d.ts +26 -0
  42. package/hooks/useQuickCreatePlacement.js +8 -0
  43. package/hooks/useQuickCreatePlacement.mjs +28 -0
  44. package/index.d.mts +4 -1
  45. package/index.d.ts +4 -1
  46. package/index.js +1 -1
  47. package/index.mjs +123 -116
  48. package/items/SchedulerEditItem.js +1 -1
  49. package/items/SchedulerEditItem.mjs +600 -509
  50. package/items/SchedulerItem.d.ts +2 -0
  51. package/items/SchedulerItem.js +1 -1
  52. package/items/SchedulerItem.mjs +137 -130
  53. package/items/SchedulerProportionalViewItem.js +1 -1
  54. package/items/SchedulerProportionalViewItem.mjs +95 -91
  55. package/items/SchedulerViewItem.js +1 -1
  56. package/items/SchedulerViewItem.mjs +168 -157
  57. package/items/hooks/use-drag-item.js +1 -1
  58. package/items/hooks/use-drag-item.mjs +46 -45
  59. package/items/hooks/use-resize-item.d.ts +1 -0
  60. package/items/hooks/use-resize-item.js +1 -1
  61. package/items/hooks/use-resize-item.mjs +84 -78
  62. package/messages/index.d.ts +45 -0
  63. package/messages/index.js +1 -1
  64. package/messages/index.mjs +174 -144
  65. package/package-metadata.js +1 -1
  66. package/package-metadata.mjs +2 -2
  67. package/package.json +12 -12
  68. package/recurrence/RecurrenceEditor.js +1 -1
  69. package/recurrence/RecurrenceEditor.mjs +64 -64
  70. package/recurrence/common.d.ts +10 -0
  71. package/recurrence/common.js +1 -1
  72. package/recurrence/common.mjs +48 -44
  73. package/services/itemsService.d.ts +5 -2
  74. package/services/itemsService.js +1 -1
  75. package/services/itemsService.mjs +36 -36
  76. package/slots/SchedulerEditSlot.d.ts +15 -0
  77. package/slots/SchedulerEditSlot.js +1 -1
  78. package/slots/SchedulerEditSlot.mjs +162 -92
  79. package/utils/index.d.ts +2 -0
  80. package/utils/index.js +1 -1
  81. package/utils/index.mjs +103 -99
  82. package/views/common/SchedulerDrag.js +1 -1
  83. package/views/common/SchedulerDrag.mjs +26 -23
  84. package/views/common/SchedulerResize.js +1 -1
  85. package/views/common/SchedulerResize.mjs +29 -26
  86. package/views/day/MultiDayView.js +1 -1
  87. package/views/day/MultiDayView.mjs +160 -152
@@ -12,4 +12,4 @@
12
12
  * Licensed under commercial license. See LICENSE.md in the package root for more information
13
13
  *-------------------------------------------------------------------------------------------
14
14
  */
15
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types"),require("@progress/kendo-date-math"),require("@progress/kendo-react-common"),require("@progress/kendo-data-query"),require("@progress/kendo-react-intl"),require("@progress/kendo-react-buttons"),require("react-dom"),require("@progress/kendo-react-dateinputs"),require("@progress/kendo-react-popup"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-form"),require("@progress/kendo-react-dialogs"),require("@progress/kendo-recurrence"),require("@progress/kendo-react-labels"),require("@progress/kendo-react-inputs"),require("@progress/kendo-react-dropdowns"),require("@progress/kendo-react-tooltip")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-date-math","@progress/kendo-react-common","@progress/kendo-data-query","@progress/kendo-react-intl","@progress/kendo-react-buttons","react-dom","@progress/kendo-react-dateinputs","@progress/kendo-react-popup","@progress/kendo-svg-icons","@progress/kendo-react-form","@progress/kendo-react-dialogs","@progress/kendo-recurrence","@progress/kendo-react-labels","@progress/kendo-react-inputs","@progress/kendo-react-dropdowns","@progress/kendo-react-tooltip"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactScheduler={},e.React,e.PropTypes,e.KendoDateMath,e.KendoReactCommon,e.KendoDataQuery,e.KendoReactIntl,e.KendoReactButtons,e.ReactDOM,e.KendoReactDateinputs,e.KendoReactPopup,e.KendoSvgIcons,e.KendoReactForm,e.KendoReactDialogs,e.KendoRecurrence,e.KendoReactLabels,e.KendoReactInputs,e.KendoReactDropdowns,e.KendoReactTooltip)}(this,function(e,t,r,a,n,l,o,s,c,i,u,d,m,p,g,E,v,h,y){"use strict";function f(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}var k=f(t),D=f(c);const b=(e,t=0,r=0,a=[])=>{if(e.length<=t)return[a];const n=[];return e[t].data.map(l=>{n.push(...b(e,t+1,r+1,[...a,{...l,field:e[t].field,valueField:e[t].valueField,colorField:e[t].colorField,multiple:e[t].multiple}]))}),n};function C(e,t){const r=[];if(!t||!t.length)return r;if(e&&e.resources&&e.resources.length){const a=e.resources;for(let e=0;e<a.length;e++){const n=t.find(t=>t.name===a[e]);r.push(n)}}return r}const S=(e,t=e.length-1)=>{const r=Math.max(0,t),a=[];e&&e.length||(e=[{}]);const n=(e[r].data||[]).map(t=>({...t,text:t[e[r].textField]}))||[],l=n.length;let o=1;for(let t=0;t<=r;t++)o*=(e[t].data||[]).length||1;for(let e=0;e<o;e++)n[e%l]&&a.push(n[e%l]);return a},w=e=>{if(!e)return{top:0,left:0,width:0,height:0,right:0};return{top:e.offsetTop,left:e.offsetLeft,right:e.offsetParent?e.offsetParent.offsetWidth-(e.offsetLeft+e.offsetWidth):0,width:e.offsetWidth,height:e.offsetHeight}},I=(e,t=!1)=>parseFloat(window.getComputedStyle(e)[t?"paddingLeft":"paddingTop"]||"0")+parseFloat(window.getComputedStyle(e)[t?"paddingRight":"paddingBottom"]||"0"),R=(e,t,r=!1)=>{e&&(void 0!==t.top&&(e.style.top=`${t.top}px`),void 0!==t.left&&(e.style.left=`${t.left}px`),void 0!==t.width&&(e.style.width=`${t.width}px`),void 0!==t.height&&!r&&(e.style.height="number"==typeof t.height?`${t.height}px`:t.height),r&&(e.style.minHeight=void 0!==t.height&&t.height>0?`${t.height}px`:""))},T=e=>e[0],x=e=>e[e.length-1],M=e=>{const t=new Set;return e.forEach(e=>{t.add(e.field)}),t.size===e.length};const N=(e,t,r,a=0)=>{if(a===r)return null;let n=null;const l=document.elementFromPoint(e,t);if(!l)return n;if("true"===l.getAttribute("data-slot"))return l;const o=l.style.pointerEvents;return l.style.pointerEvents="none",n=N(e,t,r,a+1),l.style.pointerEvents=o,n},A=(e,t)=>n.getter(t)(e),_=(e,t,r)=>{if(t)return n.setter(t)(e,r)},z=e=>null!=e;function L(e){return new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))}const O=(e,t,r)=>{const a=F(e,t)?A(e,t.id):A(e,t.recurrenceId);return r.find(e=>A(e,t.id)===a)},F=(e,t)=>{const r=A(e,t.id),a=A(e,t.recurrenceId),n=A(e,t.recurrenceRule);return null!=r&&!!n&&null==a},W=(e,t)=>Math.max(e.getTime(),t.getTime()),H=(e,t)=>Math.min(e.getTime(),t.getTime()),P=(e,t,r,a,n=!1)=>n?W(t,a)-H(e,r)<=t.getTime()-e.getTime()+(a.getTime()-r.getTime()):W(t,a)-H(e,r)<t.getTime()-e.getTime()+(a.getTime()-r.getTime()),$={id:"id",start:"start",startTimezone:"startTimezone",originalStart:"originalStart",end:"end",endTimezone:"endTimezone",isAllDay:"isAllDay",title:"title",description:"description",recurrenceRule:"recurrenceRule",recurrenceId:"recurrenceId",recurrenceExceptions:"recurrenceExceptions",readonly:"readonly"},K=(e,t,r)=>(t.getHours()<e.getHours()||t.getHours()===e.getHours()&&t.getMinutes()<=e.getMinutes())&&(e.getHours()<r.getHours()||r.getHours()===e.getHours()&&e.getMinutes()<r.getMinutes()),B=(e,t,r)=>t<r?t<=e&&e<=r:e<=r||t<=e,V=e=>{let t=0;const r=e.slice();return r.sort((e,t)=>e-t).forEach((e,a)=>{r[a]===a&&(t=a+1)}),t},G=(e,t,r=!1)=>{e.forEach(e=>{e.order=null}),t.forEach(e=>e.items.splice(0,e.items.length));const a=[...e].sort((e,t)=>e.start.getTime()-t.start.getTime());t.forEach(e=>{const t=[];a.forEach(a=>{if((r||a.isAllDay===e.isAllDay)&&a.range.index===e.range.index&&(void 0===a.range.isAllDay||void 0===e.range.isAllDay||a.range.isAllDay===e.range.isAllDay)&&a.group.index===e.group.index&&P(a.start,a.end,e.start,e.end)){if(null!==a.order&&void 0!==a.order)t.includes(a.order)||(t.push(a.order),t.sort((e,t)=>e-t));else{const e=V(t);a.order=e,t.push(e),t.sort((e,t)=>e-t)}e.items.push(a)}})})},U=(e,t,r=!1)=>{e.forEach(e=>e.slots.splice(0,e.slots.length)),e.forEach(e=>{t.forEach(t=>{(r||e.isAllDay===t.isAllDay)&&e.range.index===t.range.index&&(void 0===e.range.isAllDay||void 0===t.range.isAllDay||e.range.isAllDay===t.range.isAllDay)&&e.group.index===t.group.index&&P(e.start,e.end,t.start,t.end)&&e.slots.push(t)})})},Z=(...e)=>{},q=(e,t,r=!1,a=!1)=>{const n=e.current;if(!n||!t)return null;const o=t.filter(e=>null!==e.current&&null!==e.current.element),s=l.orderBy(o,[{field:"current.props.group.index",dir:"asc"},{field:"current.props.range.index",dir:"asc"},r?{field:""}:{field:"current.props.isAllDay",dir:"desc"},{field:"current.props.start",dir:"asc"}]),c=s.findIndex(e=>null!==e.current&&!(e.current.props.uid!==n.props.uid||void 0!==e.current.props.occurrenceId&&e.current.props.occurrenceId!==n.props.occurrenceId||e.current.props.group.index!==n.props.group.index||e.current.props.range.index!==n.props.range.index||!r&&e.current.props.isAllDay!==n.props.isAllDay));return s[c+(a?-1:1)]},Y=(e,t)=>(e.order||0)-(t.order||0),j=6e4,X=[{}],Q=new Date(1900,0,1),J=new Date(2099,11,31);a.ZonedDate.fromLocalDate(Q),a.ZonedDate.fromLocalDate(J);var ee=(e=>(e[e.create=0]="create",e[e.update=1]="update",e[e.remove=2]="remove",e))(ee||{});const te=k.createContext({current:null}),re=()=>k.useContext(te);te.displayName="SchedulerElementContext";const ae=k.createContext({}),ne=()=>k.useContext(ae);ae.displayName="SchedulerPropsContext";const le=k.createContext([]),oe=()=>k.useContext(le);le.displayName="SchedulerViewsContext";const se=k.createContext($),ce=()=>k.useContext(se);se.displayName="SchedulerFieldsContext";const ie=k.createContext({dateFormat:"{0:D}",shortDateFormat:"{0:d}"});ie.displayName="SchedulerDateFormatContext";const ue=k.createContext([{index:0,resources:[]}]),de=()=>k.useContext(ue);ue.displayName="SchedulerGroupsContext";const me=k.createContext({start:new Date,end:new Date,zonedStart:a.ZonedDate.fromLocalDate(new Date),zonedEnd:a.ZonedDate.fromLocalDate(new Date)}),pe=()=>k.useContext(me);me.displayName="SchedulerDateRangeContext";const ge=k.createContext(null),Ee=()=>k.useContext(ge);ge.displayName="SchedulerOrientationContext";const ve=k.createContext([new Date,Z]),he=()=>k.useContext(ve);ve.displayName="SchedulerDateContext";const ye=k.createContext([[],Z]),fe=()=>k.useContext(ye);ye.displayName="SchedulerDataContext";const ke=k.createContext(["day",Z]),De=()=>k.useContext(ke);ke.displayName="SchedulerActiveViewContext";const be=k.createContext([null,()=>{}]);be.displayName="SchedulerItemSelectionContext";const Ce=({children:e,element:t,props:r,views:a,fields:n,groups:l,dateRange:o,dateFormat:s,orientation:c,date:i,data:u,activeView:d,selection:m})=>k.createElement(te.Provider,{value:t},k.createElement(ae.Provider,{value:r},k.createElement(le.Provider,{value:a},k.createElement(se.Provider,{value:n},k.createElement(ie.Provider,{value:s},k.createElement(ue.Provider,{value:l},k.createElement(me.Provider,{value:o},k.createElement(ge.Provider,{value:c},k.createElement(ve.Provider,{value:i},k.createElement(ye.Provider,{value:u},k.createElement(ke.Provider,{value:d},k.createElement(be.Provider,{value:m},e)))))))))))),Se=(e,t,r)=>{const[a,n]=k.useState(t||e),l=k.useCallback((e,t)=>{n(e),r&&r.call(void 0,{...t,value:e})},[r,n]);return[void 0!==t?t:a,l]},we=k.forwardRef((e,t)=>{const{className:r,...a}=e,l=k.useRef(null),o=k.useRef(null);k.useImperativeHandle(o,()=>({element:l.current,props:e})),k.useImperativeHandle(t,()=>o.current);const c=k.useMemo(()=>n.classNames("k-scheduler-toolbar",r),[r]);return k.createElement(s.Toolbar,{id:e.id,ref:e=>{e&&(l.current=e.element)},className:c,...a},e.children)});we.displayName="KendoReactSchedulerHeader";const Ie=k.forwardRef((e,t)=>{const{className:r,...a}=e,l=k.useRef(null);return k.useImperativeHandle(t,()=>({element:l.current,props:e})),k.createElement(s.ToolbarItem,{ref:e=>{e&&(l.current=e.element)},className:n.classNames(r),...a},e.children)});Ie.displayName="KendoReactSchedulerSchedulerNavigation";const Re=k.forwardRef((e,t)=>{const{className:r,...a}=e,l=k.useRef(null);return k.useImperativeHandle(t,()=>({element:l.current,props:e})),k.createElement(s.ToolbarItem,{ref:e=>{e&&(l.current=e.element)},className:n.classNames("k-scheduler-views",r),...a},e.children)});Re.displayName="KendoReactSchedulerViewSelector";const Te=k.forwardRef((e,t)=>{const{className:r,style:a,...l}=e,o=k.useRef(null),c=k.useRef(null);k.useImperativeHandle(o,()=>({element:c.current,props:e})),k.useImperativeHandle(t,()=>o.current);const i=k.useMemo(()=>n.classNames("k-scheduler-footer",e.className),[e.className]);return k.createElement(s.Toolbar,{ref:e=>{e&&(c.current=e.element)},className:i,style:{boxShadow:"none",...a},...l},e.children)});Te.displayName="KendoReactSchedulerFooter";const xe="scheduler.allEvents",Me="scheduler.allDay",Ne="scheduler.today",Ae="scheduler.timelineViewTitle",_e="scheduler.weekViewTitle",ze="scheduler.workWeekViewTitle",Le="scheduler.agendaViewTitle",Oe="scheduler.dayViewTitle",Fe="scheduler.monthViewTitle",We="scheduler.deleteTitle",He="scheduler.previousTitle",Pe="scheduler.nextTitle",$e="scheduler.showFullDay",Ke="scheduler.showWorkDay",Be="scheduler.editOccurrence",Ve="scheduler.editSeries",Ge="scheduler.editRecurringConfirmation",Ue="scheduler.editRecurringDialogTitle",Ze="scheduler.editSave",qe="scheduler.editCancel",Ye="scheduler.editorTitle",je="scheduler.editorEventTitle",Xe="scheduler.editorEventStart",Qe="scheduler.editorEventStartTimeZone",Je="scheduler.editorEventEnd",et="scheduler.editorEventEndTimeZone",tt="scheduler.editorEventAllDay",rt="scheduler.editorEventDescription",at="scheduler.editorEventSeparateTimeZones",nt="scheduler.editorEventTimeZone",lt="scheduler.recurrenceEditorRepeat",ot="scheduler.recurrenceEditorDailyInterval",st="scheduler.recurrenceEditorDailyRepeatEvery",ct="scheduler.recurrenceEditorWeeklyInterval",it="scheduler.recurrenceEditorWeeklyRepeatEvery",ut="scheduler.recurrenceEditorWeeklyRepeatOn",dt="scheduler.recurrenceEditorMonthlyDay",mt="scheduler.recurrenceEditorMonthlyInterval",pt="scheduler.recurrenceEditorMonthlyRepeatEvery",gt="scheduler.recurrenceEditorMonthlyRepeatOn",Et="scheduler.recurrenceEditorYearlyOf",vt="scheduler.recurrenceEditorYearlyRepeatEvery",ht="scheduler.recurrenceEditorYearlyRepeatOn",yt="scheduler.recurrenceEditorYearlyInterval",ft="scheduler.recurrenceEditorFrequenciesDaily",kt="scheduler.recurrenceEditorFrequenciesMonthly",Dt="scheduler.recurrenceEditorFrequenciesNever",bt="scheduler.recurrenceEditorFrequenciesWeekly",Ct="scheduler.recurrenceEditorFrequenciesYearly",St="scheduler.recurrenceEditorOffsetPositionsFirst",wt="scheduler.recurrenceEditorOffsetPositionsSecond",It="scheduler.recurrenceEditorOffsetPositionsThird",Rt="scheduler.recurrenceEditorOffsetPositionsFourth",Tt="scheduler.recurrenceEditorOffsetPositionsLast",xt="scheduler.recurrenceEditorWeekdaysDay",Mt="scheduler.recurrenceEditorWeekdaysWeekday",Nt="scheduler.recurrenceEditorWeekdaysWeekendday",At="scheduler.recurrenceEditorEndAfter",_t="scheduler.recurrenceEditorEndOccurrence",zt="scheduler.recurrenceEditorEndLabel",Lt="scheduler.recurrenceEditorEndNever",Ot="scheduler.recurrenceEditorEndOn",Ft="scheduler.editorDelete",Wt="scheduler.deleteConfirmation",Ht="scheduler.deleteSeriesConfirmation",Pt="scheduler.deleteRecurringConfirmation",$t="scheduler.deleteOccurrence",Kt="scheduler.deleteSeries",Bt="scheduler.deleteDialogTitle",Vt="scheduler.deleteSeriesDialogTitle",Gt="scheduler.deleteRecurringDialogTitle",Ut="scheduler.dateTitle",Zt="scheduler.timeTitle",qt="scheduler.eventTitle",Yt="scheduler.editorValidationRequired",jt="scheduler.editorValidationStart",Xt="scheduler.editorValidationEnd",Qt="scheduler.noEvents",Jt="scheduler.popoverEvents",er="scheduler.moreEvents",tr="scheduler.resetTimezoneDialogTitle",rr="scheduler.resetTimezoneConfirmation",ar="scheduler.resetTimezoneNo",nr="scheduler.resetTimezoneYes",lr="scheduler.recurrenceEditorDialogTitle",or="scheduler.recurrenceEditorRemoveRecurrence",sr="scheduler.removeRecurrenceConfirmation",cr="scheduler.removeRecurrenceNo",ir="scheduler.removeRecurrenceYes",ur="scheduler.recurrenceEditorWeeklyRepeatOnDays",dr="scheduler.editorMakeRecurring",mr="scheduler.editorTimezoneButton",pr="scheduler.editorSetTimezoneTitle",gr="scheduler.editorResetTimezoneTitle",Er="scheduler.editorResetTimezoneAriaLabel",vr="scheduler.editorStartTimeAriaLabel",hr="scheduler.editorEndTimeAriaLabel",yr="scheduler.editorDateConnectorFrom",fr="scheduler.editorDateConnectorTo",kr="scheduler.editorNewEvent",Dr="scheduler.editorEditEvent",br="scheduler.toolbarLabel",Cr={[Yt]:"Field is required.",[jt]:"Start time must be before End time.",[Xt]:"End time must be after Start time.",[xe]:"All events",[Me]:"all day",[Ne]:"Today",[Oe]:"Day",[Fe]:"Month",[_e]:"Week",[ze]:"Work Week",[Ae]:"Timeline",[Le]:"Agenda",[We]:"Delete",[He]:"Previous",[Pe]:"Next",[$e]:"Show full day",[Ke]:"Show business hours",[Be]:"Edit current occurrence",[Ve]:"Edit the series",[Ge]:"Do you want to edit only this event occurrence or the whole series?",[Ue]:"Edit Recurring Item",[Ze]:"Save",[qe]:"Cancel",[Ft]:"Delete",[Ye]:"Event",[je]:"Title",[Xe]:"Start",[Qe]:"Start Time Zone",[Je]:"End",[et]:"End Time Zone",[tt]:"All Day",[rt]:"Description",[at]:"End in different Time Zone",[nt]:"Specify Time Zone",[lt]:"Repeats every",[ot]:"day(s)",[st]:"Repeats every",[ct]:"week(s)",[it]:"Repeats every",[ut]:"On",[dt]:"Day",[mt]:"month(s)",[pt]:"Repeats every",[gt]:"On",[Et]:"of",[vt]:"Repeats every",[ht]:"On",[yt]:"year(s)",[ft]:"Day",[kt]:"Month",[Dt]:"Never",[bt]:"Week",[Ct]:"Year",[St]:"First",[wt]:"Second",[It]:"Third",[Rt]:"Fourth",[Tt]:"Last",[xt]:"Day",[Mt]:"Weekday",[Nt]:"Weekend Day",[At]:"After",[_t]:"occurrence(s)",[zt]:"Ends",[Lt]:"Never",[Ot]:"On",[Wt]:"Are you sure you want to delete this event?",[Ht]:"Are you sure you want to delete this series?",[Pt]:"Do you want to delete only this event occurrence or the whole series?",[$t]:"Delete current occurrence",[Kt]:"Delete the series",[Bt]:"Delete Event",[Vt]:"Delete Series",[Gt]:"Delete Recurring Item",[Ut]:"Date",[Zt]:"Time",[qt]:"Event",[Qt]:"no events",[Jt]:"Events",[er]:"more",[tr]:"Reset time zone",[rr]:"Do you want to reset the time zone?",[ar]:"No",[nr]:"Yes",[lr]:"Recurrence",[or]:"Remove recurrence",[sr]:"Do you want to remove the recurrence?",[cr]:"No",[ir]:"Yes",[ur]:"Repeat on days",[dr]:"Make recurring",[mr]:"Time zone",[pr]:"Set Timezone",[gr]:"Reset Timezone",[Er]:"Reset timezone",[vr]:"Start time",[hr]:"End time",[yr]:"from",[fr]:"to",[kr]:"New event",[Dr]:"Edit event",[br]:"Toolbar"},Sr=k.forwardRef((e,t)=>{var r;const{level:l=0,...c}=e,m=k.useRef(null),p=k.useRef(null);k.useImperativeHandle(t,()=>m.current);const{timezone:g}=ne(),E=a.ZonedDate.fromLocalDate(c.value,g),v=a.getDate(E),[h,y]=k.useState(!1),[f,D]=k.useState(!1),b=o.useInternationalization(),{dateFormat:C,shortDateFormat:S}=k.useContext(ie),w=pe(),[I]=he(),R=w.end.getTime()-w.start.getTime()>23328e5,T=b.format(C,R?I:w.zonedStart,R?I:w.zonedEnd.addDays(-1)),x=b.format(S,R?I:w.zonedStart,R?I:w.zonedEnd.addDays(-1)),M=k.useCallback(()=>{y(!h)},[h]),N=k.useCallback(()=>{D(!0)},[]),A=k.useCallback(()=>{y(!1),D(!1)},[]),_=k.useCallback(e=>{if(c.onChange){const t=a.ZonedDate.fromUTCDate(L(e.value),g);c.onChange({...e,value:t})}y(!1)},[c,g]);k.useEffect(()=>{h&&f&&p.current&&p.current.focus()},[f,h]);const{onFocus:z,onBlur:O}=n.useAsyncFocusBlur({onFocus:N,onBlur:A});return k.createElement(k.Fragment,null,k.createElement(s.Button,{ref:m,onFocus:z,onBlur:O,fillMode:"flat",className:"k-nav-current k-toolbar-button",icon:"calendar",svgIcon:d.calendarIcon,"aria-live":"polite",tabIndex:-1,onClick:M},l>=2?x:T),k.createElement(u.Popup,{anchor:null==(r=m.current)?void 0:r.element,show:h},k.createElement(i.Calendar,{ref:p,onFocus:z,onBlur:O,onChange:_,value:v})))});Sr.displayName="KendoReactSchedulerNavigationDatePicker";const wr=k.forwardRef((e,t)=>{const r=e,{level:a=0}=r,l=oe(),[c,i]=De(),u=l.find(e=>e.props.name===c),m=o.useLocalization(),p=k.useCallback(e=>{i&&(e.syntheticEvent.preventDefault(),i(e.item.name))},[i]),g=k.useCallback(e=>{i&&i(e)},[i]),E=k.useMemo(()=>l.map(e=>({value:e.props.name,text:"function"==typeof e.props.title?e.props.title(m):e.props.title,tabIndex:-1})),[l,m]);return a>=1&&u?k.createElement(s.DropDownButton,{className:"k-toolbar-menu-button",fillMode:"flat",onItemClick:p,popupSettings:{popupClass:"k-scheduler-toolbar"},textField:"title",items:l.map(e=>({...e.props,selected:e.props.name===c,title:"function"==typeof e.props.title?e.props.title(m):e.props.title})),text:"function"==typeof u.props.title?u.props.title(m):u.props.title,endIcon:k.createElement("span",{className:"k-menu-button-arrow k-button-arrow"},k.createElement(n.SvgIcon,{icon:d.chevronDownIcon}))}):k.createElement(s.SegmentedControl,{className:"k-scheduler-views",role:"group",value:c,onChange:g,items:E})});wr.displayName="KendoReactSchedulerViewSelectorList";const Ir=e=>{const{onChange:t,data:r,validationMessage:a,visited:n,touched:o,modified:s,...c}=e,[i,u]=k.useState(r);k.useEffect(()=>{u(r)},[r]);const d=k.useCallback(e=>{t&&t({value:e.value})},[t]),m=k.useCallback(e=>{const t=e.filter;u(l.filterBy(r||[],t))},[r]);return k.createElement(h.DropDownList,{popupSettings:{width:360},data:i,onChange:d,filterable:!0,onFilterChange:m,...c})},Rr=e=>{const{value:t,data:r,onChange:a,...n}=e,l=k.useCallback(e=>{a&&a.call(void 0,e.currentTarget.dataset.value)},[a]);return k.createElement(s.ButtonGroup,{className:"k-scheduler-recurrence-repeat",width:"100%",...n},r.map(e=>k.createElement(s.Button,{type:"button",key:e.value,selected:e.value===t,onClick:l,"data-value":e.value,togglable:!0},e.text)))},Tr=e=>e.charAt(0).toUpperCase()+e.slice(1),xr=["first","second","third","fourth","last"],Mr=["never","daily","weekly","monthly","yearly"],Nr=[{day:0,offset:0},{day:1,offset:0},{day:2,offset:0},{day:3,offset:0},{day:4,offset:0},{day:5,offset:0},{day:6,offset:0}],Ar=[{day:1,offset:0},{day:2,offset:0},{day:3,offset:0},{day:4,offset:0},{day:5,offset:0}],_r=[{day:0,offset:0},{day:6,offset:0}],zr=e=>{switch(e){case"day":return Nr;case"weekday":return Ar;case"weekend":return _r}},Lr=e=>g.parseRule({recurrenceRule:e})||{},Or=e=>z(e)&&!(e=>(e=>null==e)(e)||e.trim&&0===e.trim().length)(e.freq)?e.freq:"never",Fr=e=>e.dateFormatNames({type:"months",nameType:"wide",standAlone:!0}).map((e,t)=>({text:e,value:t+1})),Wr=e=>{const t=e.firstDay(),r=e.dateFormatNames({type:"days",nameType:"abbreviated"}).map((e,t)=>({text:e,value:t}));return r.slice(t).concat(r.slice(0,t))},Hr=(e,t,r)=>{var a;let n;if(z(t.byWeekDay))switch(t.byWeekDay.length){case 7:n="day";break;case 5:n="weekday";break;case 2:n="weekend";break;case 1:n=t.byWeekDay[0].day;break;default:n=r.getDay()}else n=r.getDay();return null!=(a=e.find(e=>n===e.value))?a:e[0]},Pr=(e,t)=>{const r=e.firstDay(),a=e.dateFormatNames({type:"days",nameType:"wide"}).map((e,t)=>({text:e,value:t})),n=a.slice(r).concat(a.slice(0,r));return[{text:t("WeekdaysDay"),value:"day"},{text:t("WeekdaysWeekday"),value:"weekday"},{text:t("WeekdaysWeekendday"),value:"weekend"}].concat(n)},$r=(e,t)=>e.find(e=>e.value===(t.bySetPosition?t.bySetPosition[0]:t.byWeekDay&&t.byWeekDay[0]?t.byWeekDay[0].offset:1))||e[0],Kr=e=>{const t=[1,2,3,4,-1];return xr.map((r,a)=>({text:e("OffsetPositions"+Tr(r)),value:t[a]}))},Br=e=>z(e.count)?"count":z(e.until)?"until":"never",Vr=e=>z(e.byWeekDay)?"weekday":z(e.byMonthDay)?"monthday":void 0,Gr=(e,t)=>e.find(e=>(t.byMonth?t.byMonth[0]:null)===e.value)||e[0],Ur=(e,t)=>z(e.byMonthDay)&&e.byMonthDay.length>0?e.byMonthDay[0]:t.getDate(),Zr=e=>{const{value:t,data:r,onChange:a,...n}={...qr,...e},l=r=>{const a=Number(r.currentTarget.dataset.key);e.onChange&&e.onChange.call(void 0,t.some(e=>e===a)?t.filter(e=>e!==a):[...t,a])};return k.createElement(s.ButtonGroup,{width:"auto",...n},(e.data||qr.data).map(e=>k.createElement(s.Button,{type:"button",key:e.value,"data-key":e.value,selected:t.some(t=>t===e.value),togglable:!0,onClick:l},Tr(e.text))))},qr={data:[],value:[]},Yr=e=>{const t=o.useInternationalization(),r=o.useLocalization(),{timezone:n}=ne(),[l,s]=k.useState(1),[c,u]=k.useState(a.ZonedDate.fromUTCDate(e.start)),d=k.useCallback((e,t)=>{const a=t?e:"scheduler.recurrenceEditor"+e;return r.toLanguageString(a,Cr[a])},[r]),p=k.useMemo(()=>{var t;return Lr(null!=(t=e.value)?t:Xr.value)},[e.value]),y=k.useMemo(()=>(e=>Mr.map(t=>({value:t,text:e("Frequencies"+Tr(t))})))(d),[d]),f=k.useMemo(()=>Or(p),[p]),D=k.useMemo(()=>Pr(t,d),[t,d]),b=k.useMemo(()=>Hr(D,p,e.start),[D,p,e.start]),C=k.useMemo(()=>Fr(t),[t]),S=k.useMemo(()=>Gr(C,p),[C,p]),w=k.useMemo(()=>Kr(d),[d]),I=k.useMemo(()=>$r(w,p),[w,p]),R=k.useMemo(()=>Br(p),[p]),T=k.useMemo(()=>Ur(p,e.start),[p,e.start]),x=k.useMemo(()=>(e=>z(e.until)?a.toLocalDate(e.until):null)(p),[p.until]),M=k.useMemo(()=>Wr(t),[t]),N=k.useMemo(()=>Vr(p),[p.byWeekDay,p.byMonthDay]),A=k.useCallback(r=>{"never"===r.freq?e.onChange({value:null}):(void 0===r.weekStart&&(r.weekStart=t.firstDay()),e.onChange({value:g.serializeRule(r,e.timezone)}))},[e.onChange,e.timezone]),_=k.useCallback(t=>{const r={};r.freq=t,r.interval=1,"weekly"===t&&(r.byWeekDay=[{day:a.ZonedDate.fromLocalDate(e.start,n).getDay(),offset:0}]),("monthly"===t||"yearly"===t)&&(r.byMonthDay=[e.start.getDate()]),"yearly"===t&&(r.byMonth=[e.start.getMonth()+1]),A(r)},[A,e.start,n]),L=k.useCallback(e=>{const t=e.value;A(Object.assign({},p,{interval:t}))},[A,p]),O=k.useCallback(e=>{const t=e.value;A(Object.assign({},p,{count:t})),null!==t&&s(t)},[A,p]),F=k.useCallback(t=>{const r=t.value;if(!r)return;const n=a.ZonedDate.fromLocalDate(r,e.timezone);A(Object.assign({},p,{until:n})),u(n)},[A,p,e.timezone]),W=k.useCallback(e=>{A(Object.assign({},p,{byWeekDay:M.filter(t=>e.some(e=>e===t.value)).map(e=>({offset:0,day:e.value}))}))},[A,p,M]),H=k.useCallback(e=>{const t=Object.assign({},p),r=e.target.value;"string"==typeof r.value?(t.byWeekDay=zr(r.value),t.bySetPosition=[I.value]):(t.bySetPosition=void 0,t.byWeekDay=[{day:r.value,offset:I.value}]),A(t)},[I.value,A,p]),P=k.useCallback(e=>{A(Object.assign({},p,{byMonthDay:[e.value]}))},[A,p]),$=k.useCallback(e=>{const t=e.value;A(Object.assign({},p,{byMonth:[t.value]}))},[A,p]),K=k.useCallback(e=>{const t=e.value,r=Object.assign({},p);switch(t){case"never":r.until=void 0,r.count=void 0;break;case"count":r.until=void 0,r.count=l;break;case"until":r.until=c,r.count=void 0}A(r)},[A,p,e.timezone]),B=k.useCallback(e=>{const t=Object.assign({},p);"monthday"===e.value?(t.byWeekDay=void 0,t.bySetPosition=void 0,t.byMonthDay=[T]):"weekday"===e.value&&(t.byMonthDay=void 0,"string"==typeof b.value?(t.bySetPosition=[I.value],t.byWeekDay=zr(b.value)):t.byWeekDay=[{day:b.value,offset:I.value}]),A(t)},[A,p,T,b]),V=k.useCallback(e=>{const t=Object.assign({},p),r=e.value;if(t.byWeekDay)switch(t.byWeekDay.length){case 7:case 5:case 2:t.bySetPosition=[r.value];break;case 1:t.byWeekDay[0].offset=r.value}A(t)},[A,p]);return k.createElement(k.Fragment,null,k.createElement(m.FieldWrapper,null,k.createElement(E.Label,{className:"k-form-label"},r.toLanguageString(lt,Cr[lt])),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(Rr,{value:f,data:y,onChange:_}))),"never"!==f&&k.createElement(m.FieldWrapper,null,k.createElement(E.Label,{editorId:"interval-editor",className:"k-form-label"},d(Tr(f)+"RepeatEvery")),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(v.NumericTextBox,{min:1,step:1,defaultValue:1,value:p.interval,onChange:L,id:"interval-editor",className:"k-recur-interval"})," ",k.createElement(E.Label,{editorId:"interval-editor",className:"k-form-label"},d(Tr(f)+"Interval")))),"weekly"===f&&k.createElement(m.FieldWrapper,null,k.createElement(E.Label,{className:"k-form-label"},d(ut,!0)),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(Zr,{data:M,value:(p.byWeekDay||[]).map(({day:e})=>e),onChange:W}))),"monthly"===f&&k.createElement(m.FieldWrapper,null,k.createElement(E.Label,{key:"recurrence-repeat-on-monthly-label",className:"k-form-label"},d(gt,!0)),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(v.RadioGroup,{value:N,onChange:B,item:jr,className:"k-reset",data:[{value:"monthday",label:d(dt,!0),children:[k.createElement(k.Fragment,{key:"separator"}," "),k.createElement(v.NumericTextBox,{key:"weekday-day",min:1,max:31,disabled:"monthday"!==N,value:p&&p.byMonthDay&&p.byMonthDay[0],onChange:P,width:"auto"})]},{value:"weekday",label:" ",children:[k.createElement(h.DropDownList,{key:"weekday-offset",textField:"text",dataItemKey:"value",disabled:"weekday"!==N,data:w,value:I,onChange:V,style:{width:"auto"}}),k.createElement(k.Fragment,{key:"separator"}," "),k.createElement(h.DropDownList,{key:"weekday-value",disabled:"weekday"!==N,value:b,data:D,onChange:H,textField:"text",dataItemKey:"value",style:{width:"auto"}})]}]}))),"yearly"===f&&k.createElement(m.FieldWrapper,null,k.createElement(E.Label,null,d(ht,!0)),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(v.RadioGroup,{value:N,item:jr,onChange:B,className:"k-reset",data:[{value:"monthday",label:" ",children:[k.createElement(h.DropDownList,{key:"monthday-month",disabled:"monthday"!==N,value:S,data:C,textField:"text",dataItemKey:"value",onChange:$,style:{width:"auto"}}),k.createElement(k.Fragment,{key:"separator"}," "),k.createElement(v.NumericTextBox,{key:"monthday-day",min:1,max:31,disabled:"monthday"!==N,value:T,onChange:P,width:"auto"})]},{value:"weekday",label:" ",children:[k.createElement(h.DropDownList,{key:"yearly-weekday-offset",textField:"text",dataItemKey:"value",disabled:"weekday"!==N,data:w,value:I,onChange:V,style:{width:"auto"}}),k.createElement(k.Fragment,{key:"yearly-separator-1"}," "),k.createElement(h.DropDownList,{key:"yearly-weekday-day",textField:"text",dataItemKey:"value",disabled:"weekday"!==N,value:b,data:D,onChange:H,style:{width:"auto"}}),k.createElement(k.Fragment,{key:"yearly-separator-2"}," "),k.createElement("span",{key:"yearly-weekday-of-label"},d(Et,!0)),k.createElement(k.Fragment,{key:"yearly-separator-3"}," "),k.createElement(h.DropDownList,{key:"yearly-weekday-month",textField:"text",dataItemKey:"value",disabled:"weekday"!==N,value:S,data:C,onChange:$,style:{width:"auto"}})]}]}))),"never"!==f&&k.createElement("div",{className:"k-scheduler-recurrence-end-rule-editor"},k.createElement(m.FieldWrapper,null,k.createElement(E.Label,{className:"k-form-label"},d(zt,!0)),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(v.RadioGroup,{item:jr,value:R,onChange:K,data:[{value:"never",label:d(Lt,!0)},{value:"count",label:d(At,!0),children:[k.createElement(k.Fragment,{key:"separator-1"}," "),k.createElement(v.NumericTextBox,{key:"endrule-after-editor",id:"k-endrule-after",className:"k-recur-count",min:1,width:"auto",value:"count"===R?p.count:l,onChange:O,disabled:"count"!==R}),k.createElement(k.Fragment,{key:"separator-2"}," "),k.createElement(E.Label,{key:"endrule-after-label",className:"k-radio-label",editorId:"k-endrule-after"},d(_t,!0))]},{value:"until",label:d(Ot,!0),children:[k.createElement(k.Fragment,{key:"separator"}," "),k.createElement(i.DatePicker,{key:"k-endrule-until-editor",id:"k-endrule-until",disabled:"until"!==R,min:e.start,value:"until"===R?x:a.toLocalDate(c),onChange:F,width:"auto"})]}]})))))},jr=e=>k.createElement("li",{...e},e.children),Xr={value:""};Yr.displayName="KendoReactSchedulerRepeatEditor";const Qr=(e,t)=>{if(e){if(!t)return e;const r=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return r.setUTCFullYear(e.getFullYear()),a.ZonedDate.fromUTCDate(r,t).toLocalDate()}return e},Jr=e=>{const{value:t,onChange:r,isAllDay:n,connector:l,connectorElement:o,dateId:s,timeId:c,fieldError:u,ariaLabel:d,timeAriaLabel:m}=e,{timezone:p}=ne(),g=k.useMemo(()=>t?((e,t)=>{if(e){if(!t)return e;const r=a.toLocalDate(a.ZonedDate.fromLocalDate(e,t).toUTCDate());return r.setUTCFullYear(e.getFullYear()),r}return e})(t,p):null,[t,p]),E=k.useCallback(e=>{if(!e.value||!r)return;const t=new Date(e.value);g&&t.setHours(g.getHours(),g.getMinutes(),g.getSeconds()),r({value:Qr(t,p)})},[r,g,p]),v=k.useCallback(e=>{if(!e.value||!r)return;const t=new Date(g||new Date);t.setHours(e.value.getHours(),e.value.getMinutes(),0,0),r({value:Qr(t,p)})},[r,g,p]),h=!!u;return n?k.createElement(i.DatePicker,{id:s,value:g,onChange:E,valid:!h,ariaLabel:d}):k.createElement(k.Fragment,null,k.createElement(i.DatePicker,{id:s,value:g,onChange:E,valid:!h,ariaLabel:d}),o||l&&k.createElement("span",{className:"k-scheduler-datetime-label"},l),k.createElement(i.TimePicker,{id:c,value:g,onChange:v,valid:!h,ariaLabel:m}))};function ea(e,t,r,n){var l,o,s,c,i,u;if(!e)return"";const d=e=>n.toLanguageString(e,Cr[e]),m=(e,t)=>{const r=t?e:"scheduler.recurrenceEditor"+e;return n.toLanguageString(r,Cr[r])},p=Lr(e);if(!p.freq||"never"===p.freq)return"";const g=Wr(r),E=Pr(r,m),v=Hr(E,p,t),h=Fr(r),y=Gr(h,p),f=Kr(m),k=$r(f,p),D=Ur(p,t),b=Vr(p),C=p.interval||1,S=d(lt),w=d(ut).toLowerCase(),I=d(gt).toLowerCase(),R=d(ht).toLowerCase(),T=d(zt).toLowerCase();let x="";switch(p.freq){case"daily":x=`${S} ${C} ${d(ot)}`;break;case"weekly":{const e=(p.byWeekDay||[]).map(({day:e})=>{var t;return null==(t=g.find(t=>t.value===e))?void 0:t.text}).filter(Boolean).join(", ");x=`${S} ${C} ${d(ct)}`,e&&(x+=` ${w} ${e}`);break}case"monthly":{const e=`${S} ${C} ${d(mt)}`;if("weekday"===b&&null!=(l=p.byWeekDay)&&l.length){const t="string"==typeof v.value?v.text.toLowerCase():v.text;x=`${e} ${I} ${k.text.toLowerCase()} ${t}`}else{const t=null!=(s=null==(o=p.byMonthDay)?void 0:o[0])?s:D;x=`${e} ${I} ${d(dt).toLowerCase()} ${t}`}break}case"yearly":{const e=`${S} ${C} ${d(yt)}`;if("weekday"===b&&null!=(c=p.byWeekDay)&&c.length){const t="string"==typeof v.value?v.text.toLowerCase():v.text;x=`${e} ${R} ${k.text.toLowerCase()} ${t} ${d(Et)} ${y.text}`}else{const t=null!=(u=null==(i=p.byMonthDay)?void 0:i[0])?u:D;x=`${e} ${R} ${y.text} ${t}`}break}}return p.count?x+=` ${T} ${d(At).toLowerCase()} ${p.count} ${d(_t)}`:p.until&&(x+=` ${T} ${d(Ot).toLowerCase()} ${r.formatDate(a.toLocalDate(p.until),"D")}`),x}const ta=e=>{const{value:t,start:r,timezone:l,onSave:c,onCancel:u,onRemoveRecurrence:d,recurrenceSummaryTemplate:y,recurrenceEditor:f}=e,b=o.useInternationalization(),C=o.useLocalization(),S=ce(),w=k.useCallback((e,t)=>{const r=t?e:"scheduler.recurrenceEditor"+e;return C.toLanguageString(r,Cr[r])},[C]),[I,R]=k.useState(()=>{const e=Lr(null!=t?t:"");return e.freq?e:{freq:"daily",interval:1}}),[T,x]=k.useState(1),M=k.useRef(!1),[N,A]=k.useState(()=>a.ZonedDate.fromUTCDate(r)),[_]=k.useState(r),z=k.useRef(null),L=k.useMemo(()=>Or(I),[I]),O=k.useMemo(()=>Wr(b),[b]),F=k.useMemo(()=>Pr(b,w),[b,w]),W=k.useMemo(()=>Hr(F,I,_),[F,I,_]),H=k.useMemo(()=>Fr(b),[b]),P=k.useMemo(()=>Gr(H,I),[H,I]),$=k.useMemo(()=>Kr(w),[w]),K=k.useMemo(()=>$r($,I),[$,I]),B=k.useMemo(()=>Br(I),[I]),V=k.useMemo(()=>Ur(I,_),[I,_]),G=k.useMemo(()=>I.until?a.toLocalDate(I.until):null,[I.until]),U=k.useMemo(()=>Vr(I),[I.byWeekDay,I.byMonthDay]),Z=!!t,q=C.toLanguageString(Ze,Cr[Ze]),Y=C.toLanguageString(qe,Cr[qe]),j=k.useCallback(e=>{R({...e})},[]),X=k.useCallback(e=>{const t={};t.freq=e,t.interval=1,"weekly"===e&&(t.byWeekDay=[{day:a.ZonedDate.fromLocalDate(_,l).getDay(),offset:0}]),("monthly"===e||"yearly"===e)&&(t.byMonthDay=[_.getDate()]),"yearly"===e&&(t.byMonth=[_.getMonth()+1]),j(t)},[_,l,j]),Q=k.useCallback(e=>{var t;j({...I,interval:null!=(t=e.value)?t:1})},[I,j]),J=k.useCallback(e=>{const t=e.value;null!==t?(M.current=!1,j({...I,count:t}),x(t)):M.current=!0},[I,j]),ee=k.useCallback(()=>{M.current&&(M.current=!1,x(1),j({...I,count:1}))},[I,j]),te=k.useCallback(e=>{if(!e.value)return;const t=a.ZonedDate.fromLocalDate(e.value,l);j({...I,until:t}),A(t)},[I,l,j]),re=k.useCallback(e=>{j({...I,byWeekDay:O.filter(t=>e.some(e=>e===t.value)).map(e=>({offset:0,day:e.value}))})},[I,O,j]),ae=k.useCallback(e=>{const t={...I},r=e.target.value;"string"==typeof r.value?(t.byWeekDay=zr(r.value),t.bySetPosition=[K.value]):(t.bySetPosition=void 0,t.byWeekDay=[{day:r.value,offset:K.value}]),j(t)},[K.value,I,j]),ne=k.useCallback(e=>{var t;j({...I,byMonthDay:[null!=(t=e.value)?t:1]})},[I,j]),le=k.useCallback(e=>{j({...I,byMonth:[e.value.value]})},[I,j]),oe=k.useCallback(e=>{const t=e.value.value,r={...I};switch(t){case"never":r.until=void 0,r.count=void 0;break;case"count":r.until=void 0,r.count=T;break;case"until":r.until=N,r.count=void 0}j(r)},[I,T,N,j]),se=k.useCallback(e=>{const t={...I};"monthday"===e.value?(t.byWeekDay=void 0,t.bySetPosition=void 0,t.byMonthDay=[V]):"weekday"===e.value&&(t.byMonthDay=void 0,"string"==typeof W.value?(t.bySetPosition=[K.value],t.byWeekDay=zr(W.value)):t.byWeekDay=[{day:W.value,offset:K.value}]),j(t)},[I,V,W,K.value,j]),ie=k.useCallback(e=>{const t={...I},r=e.value;if(t.byWeekDay)switch(t.byWeekDay.length){case 7:case 5:case 2:t.bySetPosition=[r.value];break;case 1:t.byWeekDay[0].offset=r.value}j(t)},[I,j]),ue=k.useCallback(e=>{const t=e.value.value;X(t)},[X]),de=k.useMemo(()=>[{text:w(ft,!0),value:"daily"},{text:w(bt,!0),value:"weekly"},{text:w(kt,!0),value:"monthly"},{text:w(Ct,!0),value:"yearly"}],[w]),me=k.useMemo(()=>[{text:w(Lt,!0),value:"never"},{text:w(At,!0),value:"count"},{text:w(Ot,!0),value:"until"}],[w]),pe=k.useMemo(()=>de.find(e=>e.value===L)||de[0],[de,L]),ge=k.useMemo(()=>me.find(e=>e.value===B)||me[0],[me,B]),Ee=k.useMemo(()=>{const e=b.firstDay(),t=b.dateFormatNames({type:"days",nameType:"narrow"}),r=b.dateFormatNames({type:"days",nameType:"wide"}),a=t.map((e,t)=>({narrow:e,wide:r[t],value:t}));return a.slice(e).concat(a.slice(0,e))},[b]),ve=k.useMemo(()=>(I.byWeekDay||[]).map(({day:e})=>e),[I.byWeekDay]),he=k.useCallback(e=>{const t=ve.includes(e)?ve.filter(t=>t!==e):[...ve,e];re(t)},[ve,re]),ye=k.useCallback(()=>{var e;if(f){const t=(null==(e=z.current)?void 0:e.call(z,S.recurrenceRule))||null;c(t)}else"never"!==I.freq&&I.freq?(void 0===I.weekStart&&(I.weekStart=b.firstDay()),c(g.serializeRule(I,l))):c(null)},[f,I,l,b,c]),fe=k.useCallback(()=>{u()},[u]),ke=k.useMemo(()=>{if(!I.freq||"never"===I.freq)return"";return ea(g.serializeRule(I,l),_,b,C)},[I,l,_,b,C]),De=k.useMemo(()=>I.freq&&"never"!==I.freq?g.serializeRule(I,l):null,[I,l]),be=k.useMemo(()=>De?g.parseRule({recurrenceRule:De}):null,[De]),Ce=k.createElement(p.Dialog,{title:w(lr,!0),onClose:fe,width:540},f?k.createElement(m.Form,{initialValues:{[S.recurrenceRule]:t||""},render:e=>(z.current=e.valueGetter,k.createElement(m.FormElement,{horizontal:!0},k.createElement(m.Field,{name:S.recurrenceRule,field:S.recurrenceRule,component:f,start:_})))}):k.createElement(m.Form,{render:()=>{var e;return k.createElement(m.FormElement,{horizontal:!0},k.createElement(m.FieldWrapper,null,k.createElement(E.Label,{editorId:"recurrence-interval",className:"k-form-label"},w(lt,!0)),k.createElement("div",{className:"k-form-field-wrap"},k.createElement("div",{className:"k-scheduler-recurrence-fields"},"never"!==L&&k.createElement(v.NumericTextBox,{id:"recurrence-interval",min:1,step:1,defaultValue:1,value:I.interval,onChange:Q}),k.createElement(h.DropDownList,{data:de,textField:"text",dataItemKey:"value",value:pe,onChange:ue})))),"weekly"===L&&k.createElement(m.FieldWrapper,null,k.createElement(E.Label,{className:"k-form-label"},w(ut,!0)),k.createElement("div",{className:"k-form-field-wrap"},k.createElement("div",{className:"k-scheduler-weekday-picker",role:"group","aria-label":w(ur,!0)},Ee.map(e=>k.createElement(s.Button,{key:e.value,type:"button",themeColor:"primary",fillMode:"flat",rounded:"full",togglable:!0,selected:ve.includes(e.value),"aria-label":e.wide,"aria-pressed":ve.includes(e.value),onClick:()=>he(e.value)},e.narrow))))),"monthly"===L&&k.createElement(m.FieldWrapper,null,k.createElement(E.Label,{className:"k-form-label"},w(gt,!0)),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(v.RadioGroup,{value:U,onChange:se,className:"k-reset",data:[{value:"weekday",label:" ",children:[k.createElement("div",{key:"weekday-fields",className:"k-scheduler-recurrence-fields"},k.createElement(h.DropDownList,{textField:"text",dataItemKey:"value",disabled:"weekday"!==U,data:$,value:K,onChange:ie}),k.createElement(h.DropDownList,{disabled:"weekday"!==U,value:W,data:F,onChange:ae,textField:"text",dataItemKey:"value"}))]},{value:"monthday",label:" ",children:[k.createElement("div",{key:"monthday-fields",className:"k-scheduler-recurrence-fields"},k.createElement(v.NumericTextBox,{min:1,max:31,disabled:"monthday"!==U,value:V,onChange:ne,width:"auto"}))]}]}))),"yearly"===L&&k.createElement(m.FieldWrapper,null,k.createElement(E.Label,{className:"k-form-label"},w(ht,!0)),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(v.RadioGroup,{value:U,onChange:se,className:"k-reset",data:[{value:"monthday",label:" ",children:[k.createElement("div",{key:"monthday-fields",className:"k-scheduler-recurrence-fields"},k.createElement(h.DropDownList,{disabled:"monthday"!==U,value:P,data:H,textField:"text",dataItemKey:"value",onChange:le}),k.createElement(v.NumericTextBox,{min:1,max:31,disabled:"monthday"!==U,value:V,onChange:ne,width:"auto"}))]},{value:"weekday",label:" ",children:[k.createElement("div",{key:"weekday-fields",className:"k-scheduler-recurrence-fields"},k.createElement(h.DropDownList,{textField:"text",dataItemKey:"value",disabled:"weekday"!==U,data:$,value:K,onChange:ie}),k.createElement(h.DropDownList,{textField:"text",dataItemKey:"value",disabled:"weekday"!==U,value:W,data:F,onChange:ae}),k.createElement("span",{key:"of-row",className:"k-scheduler-edit-form-row"},k.createElement("span",null,w(Et,!0)),k.createElement(h.DropDownList,{textField:"text",dataItemKey:"value",disabled:"weekday"!==U,value:P,data:H,onChange:le})))]}]}))),"never"!==L&&k.createElement(m.FieldWrapper,null,k.createElement(E.Label,{className:"k-form-label"},w(zt,!0)),k.createElement("div",{className:"k-form-field-wrap"},k.createElement("div",{className:"k-scheduler-recurrence-fields"},k.createElement(h.DropDownList,{data:me,textField:"text",dataItemKey:"value",value:ge,onChange:oe}),"count"===B&&k.createElement(v.NumericTextBox,{min:1,width:"auto",value:null!=(e=I.count)?e:T,onChange:J,onBlur:ee,format:`0 '${w(_t,!0)}'`}),"until"===B&&k.createElement(i.DatePicker,{min:_,value:null!=G?G:a.toLocalDate(N),onChange:te,width:"auto"})))),"never"!==L&&(y&&De?k.createElement(m.FieldWrapper,null,k.createElement("div",{className:"k-form-field-wrap"},k.createElement("div",{className:"k-form-hint"},k.createElement(y,{recurrenceRule:De,text:ke||"",parsedRule:be})))):ke?k.createElement(m.FieldWrapper,null,k.createElement("div",{className:"k-form-field-wrap"},k.createElement("div",{className:"k-form-hint"},ke))):null))}}),k.createElement(p.DialogActionsBar,{layout:"end"},Z&&d&&k.createElement(s.Button,{fillMode:"flat",themeColor:"primary",onClick:d},w(or,!0)),k.createElement(s.Button,{onClick:fe},Y),k.createElement(s.Button,{themeColor:"primary",onClick:ye},q)));return n.canUseDOM?D.createPortal(Ce,document.body):null};ta.displayName="KendoReactSchedulerRecurrenceDialog";const ra=e=>{const{onConfirm:t,onCancel:r}=e,a=o.useLocalization(),l=a.toLanguageString(or,Cr[or]),c=a.toLanguageString(sr,Cr[sr]),i=a.toLanguageString(cr,Cr[cr]),u=a.toLanguageString(ir,Cr[ir]),d=k.createElement(p.Dialog,{title:l,onClose:r,width:400},k.createElement("p",null,c),k.createElement(p.DialogActionsBar,{layout:"end"},k.createElement(s.Button,{onClick:r},i),k.createElement(s.Button,{themeColor:"primary",onClick:t},u)));return n.canUseDOM?D.createPortal(d,document.body):null};ra.displayName="KendoReactRemoveRecurrenceConfirmDialog";const aa=k.forwardRef((e,t)=>{const r=k.useRef(null),l=k.useRef(null),c=a.timezoneNames(),i=o.useLocalization(),u=o.useInternationalization(),v=ce(),{resources:h,timezone:y}=ne();k.useImperativeHandle(l,()=>{var t;return{element:null!=(t=r.current)&&t.element?r.current.element:r.current,props:e}}),k.useImperativeHandle(t,()=>l.current);const{as:f=sa.as,...D}=e,{onChange:b,valueGetter:C}=e,{titleEditor:S=sa.titleEditor,startEditor:w=sa.startEditor,endEditor:I=sa.endEditor,startTimezoneEditor:R=sa.startTimezoneEditor,endTimezoneEditor:T=sa.endTimezoneEditor,startLabel:x=sa.startLabel,endLabel:M=sa.endLabel,allDayEditor:N=sa.allDayEditor,allDayLabel:A=sa.allDayLabel,recurrenceEditor:_,descriptionEditor:z=sa.descriptionEditor,resourceEditor:L=sa.resourceEditor}=e,O=k.useMemo(()=>C(v.start)||new Date,[C,v.start]),F=C(v.isAllDay)||!1,W=C(v.startTimezone)||y||"",H=C(v.recurrenceRule),P=!(null!=C(v.recurrenceId)),$=k.useMemo(()=>i.toLanguageString(tt,Cr[tt]),[i]),[K,B]=k.useState(!!C(v.startTimezone)),[V,G]=k.useState(!1),[U,Z]=k.useState(!1),[q,Y]=k.useState(!1),j=e.recurrenceButtonTextTemplate,X=e.recurrenceSummaryTemplate,Q=k.useMemo(()=>i.toLanguageString(dr,Cr[dr]),[i]),J=k.useMemo(()=>H&&ea(H,O,u,i)||Q,[H,O,u,i,Q]),ee=k.useMemo(()=>H?ea(H,O,u,i):null,[H,O,u,i]),te=k.useMemo(()=>H?g.parseRule({recurrenceRule:H}):null,[H]),re=k.useRef(W);k.useEffect(()=>{K&&W&&W!==re.current&&b(v.endTimezone,{value:W}),re.current=W},[W,K,b,v.endTimezone]);const ae=k.useCallback(e=>{e.preventDefault(),K?G(!0):B(!0)},[K]),le=k.useCallback(()=>{b(v.startTimezone,{value:null}),b(v.endTimezone,{value:null}),B(!1),G(!1)},[b,v.startTimezone,v.endTimezone]),oe=k.useCallback(()=>{G(!1)},[]),se=k.useCallback(()=>{Z(!0)},[]),ie=k.useCallback(e=>{b(v.recurrenceRule,{value:e}),Z(!1)},[b,v.recurrenceRule]),ue=k.useCallback(()=>{Z(!1)},[]),de=k.useCallback(()=>{Y(!0)},[]),me=k.useCallback(()=>{b(v.recurrenceRule,{value:null}),b(v.recurrenceExceptions,{value:null}),Y(!1),Z(!1)},[b,v.recurrenceRule,v.recurrenceExceptions]),pe=k.useCallback(()=>{Y(!1)},[]),ge=k.useMemo(()=>n.classNames("k-scheduler-edit-form",e.className),[e.className]);return k.createElement(k.Fragment,null,k.createElement(f,{ref:f===sa.as?r:void 0,horizontal:!0,...D,className:ge},k.createElement(k.Fragment,null,k.createElement(m.FieldWrapper,null,k.createElement(E.Label,{className:"k-form-label"},k.createElement(n.SvgIcon,{icon:d.rightDoubleQuotesIcon,size:"xlarge"})),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(m.Field,{id:"k-scheduler-editor-title",name:v.title,field:v.title,component:S,placeholder:i.toLanguageString(je,Cr[je]),"aria-label":i.toLanguageString(je,Cr[je])}))),k.createElement(m.FieldWrapper,null,k.createElement(E.Label,{className:"k-form-label"},k.createElement(n.SvgIcon,{icon:d.clockIcon,size:"xlarge"})),k.createElement("div",{className:"k-form-field-wrap"},k.createElement("div",{className:"k-scheduler-datetime-section"},k.createElement("div",{className:"k-scheduler-edit-form-row"},k.createElement(m.Field,{id:"k-is-allday-switch",name:v.isAllDay,component:N,onLabel:"",offLabel:"",ariaLabel:$}),k.createElement(m.Field,{name:v.isAllDay,field:v.isAllDay,editorId:"k-is-allday-switch",component:A},$)),k.createElement("div",{className:"k-scheduler-datetime-grid"},F?k.createElement("div",{className:"k-scheduler-edit-form-row"},k.createElement(m.Field,{name:v.start,component:w,isAllDay:F,fieldError:e.errors[v.start],ariaLabel:i.toLanguageString(Xe,Cr[Xe]),timezone:y}),k.createElement(m.Field,{name:v.end,component:M,editorId:"k-scheduler-editor-end",className:"k-scheduler-datetime-label"},i.toLanguageString(fr,Cr[fr])),k.createElement(m.Field,{name:v.end,component:I,isAllDay:F,dateId:"k-scheduler-editor-end",fieldError:e.errors[v.end],ariaLabel:i.toLanguageString(Je,Cr[Je]),timezone:y})):k.createElement(k.Fragment,null,k.createElement("div",{className:"k-scheduler-edit-form-row"},k.createElement(m.Field,{name:v.start,component:w,isAllDay:F,timeId:"k-scheduler-editor-start-time",connectorElement:k.createElement(m.Field,{name:v.start,component:x,editorId:"k-scheduler-editor-start-time",className:"k-scheduler-datetime-label"},i.toLanguageString(yr,Cr[yr])),fieldError:e.errors[v.start],ariaLabel:i.toLanguageString(Xe,Cr[Xe]),timeAriaLabel:i.toLanguageString(vr,Cr[vr]),timezone:y})),!K&&k.createElement(s.Button,{className:"k-col-span-2",fillMode:"flat",themeColor:"primary",title:i.toLanguageString(pr,Cr[pr]),onClick:ae,svgIcon:d.globeIcon},i.toLanguageString(mr,Cr[mr])),K&&k.createElement(k.Fragment,null,k.createElement(m.Field,{name:v.startTimezone,component:R,data:c,value:W,ariaLabel:i.toLanguageString(Qe,Cr[Qe])}),k.createElement(s.Button,{title:i.toLanguageString(gr,Cr[gr]),"aria-label":i.toLanguageString(Er,Cr[Er]),onClick:ae,svgIcon:d.globeIcon,fillMode:"flat",themeColor:"primary"})),k.createElement("div",{className:"k-scheduler-edit-form-row"},k.createElement(m.Field,{name:v.end,component:I,isAllDay:F,timeId:"k-scheduler-editor-end-time",connectorElement:k.createElement(m.Field,{name:v.end,component:M,editorId:"k-scheduler-editor-end-time",className:"k-scheduler-datetime-label"},i.toLanguageString(fr,Cr[fr])),fieldError:e.errors[v.end],ariaLabel:i.toLanguageString(Je,Cr[Je]),timeAriaLabel:i.toLanguageString(hr,Cr[hr]),timezone:y})),K&&k.createElement(m.Field,{name:v.endTimezone,component:T,data:c,value:C(v.endTimezone)||y||"",ariaLabel:i.toLanguageString(et,Cr[et])}))),P&&k.createElement("div",{className:"k-scheduler-edit-form-row"},k.createElement(s.Button,{className:"k-scheduler-recurrence-button",type:"button",fillMode:"flat",themeColor:"primary",svgIcon:d.arrowRotateCwIcon,onClick:se},j?k.createElement(j,{recurrenceRule:H,text:ee,parsedRule:te}):J))))),k.createElement(m.FieldWrapper,null,k.createElement(E.Label,{className:"k-form-label"},k.createElement(n.SvgIcon,{icon:d.commentIcon,size:"xlarge"})),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(m.Field,{component:z,name:v.description,id:"k-event-description",resizable:"vertical",placeholder:i.toLanguageString(rt,Cr[rt]),"aria-label":i.toLanguageString(rt,Cr[rt])}))),(h||[]).map(e=>k.createElement(m.FieldWrapper,{key:e.field},e.svgIcon&&k.createElement(E.Label,{className:"k-form-label"},k.createElement(n.SvgIcon,{icon:e.svgIcon,size:"xlarge"})),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(m.Field,{name:e.field,component:L,resource:e,multiple:e.multiple,data:e.data,textField:e.textField,valueField:e.valueField,colorField:e.colorField,ariaLabel:e.name||e.field})))))),U&&k.createElement(ta,{value:H,start:O,timezone:y||"",onSave:ie,onCancel:ue,onRemoveRecurrence:de,recurrenceSummaryTemplate:X,recurrenceEditor:_}),q&&k.createElement(ra,{onConfirm:me,onCancel:pe}),V&&k.createElement(p.Dialog,{title:i.toLanguageString(tr,Cr[tr]),onClose:oe},i.toLanguageString(rr,Cr[rr]),k.createElement(p.DialogActionsBar,null,k.createElement(s.Button,{onClick:oe},i.toLanguageString(ar,Cr[ar])),k.createElement(s.Button,{themeColor:"primary",onClick:le},i.toLanguageString(nr,Cr[nr])))))});aa.displayName="KendoReactSchedulerFormEditor";const na=k.forwardRef((e,t)=>k.createElement(m.FormElement,{ref:t,id:e.id,style:e.style,tabIndex:e.tabIndex,className:e.className,horizontal:e.horizontal,children:e.children}));na.displayName="SchedulerFormEditorDefaultElement";const la=e=>{const{value:t,onChange:r,valid:a,visited:n,touched:l,modified:o,name:s,validationMessage:c,...i}=e,u=k.useCallback(e=>{r&&r({value:e.value})},[r]);return k.createElement(v.Switch,{...i,checked:t||!1,onChange:u})};la.displayName="SwitchFieldAdapter";const oa=e=>k.createElement(E.Label,{...e,style:{marginBottom:0,...e.style}});oa.displayName="DefaultLabel";const sa={as:na,titleEditor:v.Input,startEditor:Jr,endEditor:Jr,startTimezoneEditor:Ir,endTimezoneEditor:Ir,startLabel:oa,endLabel:oa,allDayEditor:la,allDayLabel:oa,recurrenceEditor:Yr,descriptionEditor:v.TextArea,resourceEditor:e=>{const t=e.multiple?h.MultiSelect:h.DropDownList,r=k.useCallback(t=>{const r=t.target.props.dataItemKey,a=e.multiple?(t.target.value||[]).map(e=>e[r]):t.target.value[r];e.onChange.call(void 0,{value:a})},[e.multiple,e.onChange]),a=k.useCallback((t,r)=>{const a=k.createElement(k.Fragment,null,e.colorField&&k.createElement("span",{key:1,className:"k-scheduler-mark",style:{backgroundColor:r.dataItem[e.colorField],marginRight:z(r.dataItem[e.valueField])?"8px":"4px"}}," "),k.createElement("span",{key:2},"  ",t.props.children));return k.cloneElement(t,{...t.props},a)},[e.colorField,e.valueField]),n=k.useCallback((t,r)=>{const a=k.createElement(k.Fragment,null,e.colorField&&r&&k.createElement("span",{key:1,className:"k-scheduler-mark",style:{backgroundColor:r[e.colorField],marginRight:r[e.valueField]?"8px":"4px"}}," "),t.props.children);return k.cloneElement(t,{},a)},[e.colorField,e.valueField]),l=Array.isArray(e.value)?e.data.filter(t=>e.value.some(r=>t[e.valueField]===r)):e.data.find(t=>t[e.valueField]===e.value);return k.createElement(t,{value:l,onChange:r,data:e.data,textField:e.textField,dataItemKey:e.valueField,valid:e.valid,validationMessage:e.validationMessage,itemRender:a,valueRender:n,ariaLabel:e.ariaLabel})}},ca=k.forwardRef((e,t)=>{const{onCancel:r,onClose:a,onSubmit:l,onDelete:c,editor:i,dialog:u=ia.dialog,validator:g=ia.validator,...E}=e,v=k.useRef(null);k.useImperativeHandle(v,()=>({props:e})),k.useImperativeHandle(t,()=>v.current);const h=o.useLocalization(),y=ce(),f=!(!e.dataItem||!e.dataItem[y.id]),b=k.useMemo(()=>h.toLanguageString(Yt,Cr[Yt]),[h]),C=k.useMemo(()=>h.toLanguageString(Xt,Cr[Xt]),[h]),S=k.useMemo(()=>h.toLanguageString(Ze,Cr[Ze]),[h]),w=k.useMemo(()=>h.toLanguageString(qe,Cr[qe]),[h]),I=k.useMemo(()=>h.toLanguageString(Ft,Cr[Ft]),[h]),R=k.useMemo(()=>h.toLanguageString(jt,Cr[jt]),[h]),T=k.useMemo(()=>h.toLanguageString(kr,Cr[kr]),[h]),x=k.useMemo(()=>h.toLanguageString(Dr,Cr[Dr]),[h]),M=f?x:T,N=k.useCallback(e=>{r&&r({value:null,syntheticEvent:e,target:v.current})},[r]),A=k.useCallback(({syntheticEvent:e})=>{a&&a({value:null,syntheticEvent:e,target:v.current})},[a]),_=k.useCallback((e,t)=>{l&&l({value:e,syntheticEvent:t,target:v.current})},[l]),z=k.useCallback(t=>{c&&c({value:e.dataItem,syntheticEvent:t,target:v.current})},[c,e.dataItem]),L=k.useCallback((e,t)=>e&&t(y.end)&&e.getTime()>t(y.end).getTime()?R:void 0,[y,R]),O=k.useCallback((e,t)=>e&&t(y.start)&&e.getTime()<t(y.start).getTime()?C:void 0,[y,C]),F=k.useCallback(e=>e?void 0:b,[b]),W=k.useCallback((e,t)=>{const r={};r[y.start]=[F(t(y.start)),L(t(y.start),t)].filter(Boolean).reduce((e,t)=>e||t,""),r[y.end]=[F(t(y.start)),O(t(y.start),t)].filter(Boolean).reduce((e,t)=>e||t,"");const a=g(e,t);return{...r,...a}},[O,y.end,y.start,F,L,g]);return n.canUseDOM?D.createPortal(k.createElement(m.Form,{initialValues:e.dataItem,onSubmit:_,validator:W,render:e=>k.createElement(u,{title:M,width:650,onClose:A},k.createElement(aa,{...e,as:i}),k.createElement(p.DialogActionsBar,{layout:"end"},f&&c&&k.createElement(s.Button,{fillMode:"flat",themeColor:"primary",svgIcon:d.trashIcon,onClick:z},I),k.createElement(s.Button,{onClick:N},w),k.createElement(s.Button,{themeColor:"primary",disabled:!e.allowSubmit,onClick:e.onSubmit},S))),...E}),document&&document.body):null}),ia={dialog:p.Dialog,validator:()=>({})};ca.displayName="KendoReactSchedulerForm";const ua=k.createContext({});ua.displayName="SchedulerViewPropsContext";const da=k.createContext([]),ma=()=>k.useContext(da);da.displayName="SchedulerViewRangesContext";const pa=k.createContext([[],Z]),ga=()=>k.useContext(pa);pa.displayName="SchedulerViewSlotsContext";const Ea=k.createContext([[],Z]),va=()=>k.useContext(Ea);Ea.displayName="SchedulerViewItemsContext";const ha=k.createContext([[],Z]);ha.displayName="SchedulerViewSelectedSlotsContext";const ya=k.createContext([[],Z]),fa=()=>k.useContext(ya);ya.displayName="SchedulerViewSelectedItemsContext";const ka=k.createContext([[],Z]);ka.displayName="SchedulerViewFocusedItemsContext";const Da=k.createContext([[],Z]),ba=()=>k.useContext(Da);Da.displayName="SchedulerViewFocusedSlotsContext";const Ca=({children:e,props:t,ranges:r,slots:a,items:n,selectedSlots:l,selectedItems:o,focusedItems:s,focusedSlots:c})=>k.createElement(ua.Provider,{value:t},k.createElement(da.Provider,{value:r},k.createElement(pa.Provider,{value:a},k.createElement(Ea.Provider,{value:n},k.createElement(ha.Provider,{value:l},k.createElement(ya.Provider,{value:o},k.createElement(ka.Provider,{value:s},k.createElement(Da.Provider,{value:c},e))))))));var Sa=(e=>(e.select="ITEMS_SELECT_SELECT",e.selectNext="ITEMS_SELECT_SELECT_NEXT",e.selectPrev="ITEMS_SELECT_SELECT_PREV",e.reset="ITEMS_SELECT_RESET",e.add="ITEMS_SELECT_ADD",e.remove="ITEMS_SELECT_REMOVE",e))(Sa||{});var wa=(e=>(e.select="SLOTS_SELECT_SELECT",e.reset="SLOTS_SELECT_RESET",e.add="SLOTS_SELECT_ADD",e))(wa||{});const Ia=(e,t)=>{const{element:r}=e;n.useIsomorphicLayoutEffect(()=>{if(!r||!r.current)return;const t=[],a=[],n=[],l=r.current.querySelectorAll(e.selector);l.forEach(r=>{const l=r.getBoundingClientRect().width,o=e.explicitDepth&&void 0!==e.attribute?r.getAttribute(e.attribute):0,s=I(r,!0),c=((e,t=!1)=>parseFloat(window.getComputedStyle(e)[t?"borderLeftWidth":"borderTopWidth"]||"0")+parseFloat(window.getComputedStyle(e)[t?"borderRightWidth":"borderBottomWidth"]||"0"))(r,!0);null!==o&&((!n[o]||c>n[o])&&(n[o]=c),(!a[o]||s>a[o])&&(a[o]=s),(!t[o]||l>t[o])&&(t[o]=l))}),l.forEach(r=>{const l=e.explicitDepth?r.getAttribute(e.attribute):0;null!==l&&(r.style.minWidth=t[l]-a[l]-n[l]+"px")})},t)};var Ra=(e=>(e.up="SLOT_FOCUS_UP",e.down="SLOT_FOCUS_DOWN",e.left="SLOT_FOCUS_LEFT",e.right="SLOT_FOCUS_RIGHT",e))(Ra||{});const Ta=(e,t)=>t.find(t=>null!==t.current&&null!==e.current&&t.current.props.row===e.current.props.row-1&&t.current.props.col===e.current.props.col),xa=(e,t)=>t.find(t=>null!==t.current&&null!==e.current&&t.current.props.row===e.current.props.row&&t.current.props.col===e.current.props.col-1),Ma=(e,t)=>t.find(t=>null!==t.current&&null!==e.current&&t.current.props.row===e.current.props.row&&t.current.props.col===e.current.props.col+1),Na=(e,t)=>t.find(t=>null!==t.current&&null!==e.current&&t.current.props.row===e.current.props.row+1&&t.current.props.col===e.current.props.col);var Aa=(e=>(e.next="ITEMS_FOCUS_NEXT",e.prev="ITEMS_FOCUS_PREV",e))(Aa||{});const _a=k.forwardRef((e,t)=>{const r=k.useRef(null);k.useImperativeHandle(t,()=>r.current);const[a,l]=n.useCollection([]),[o,s]=n.useCollection([]),[c,i]=(e=>[[],(t,r)=>{switch(t.type){case"ITEMS_FOCUS_NEXT":{if(!t.item||!t.item.current||!e)return;const a=q(t.item,e,t.ignoreIsAllDay,!1);a&&a.current&&a.current.element&&(r.preventDefault(),a.current.element.focus());break}case"ITEMS_FOCUS_PREV":{if(!t.item||!t.item.current||!e)return;const a=q(t.item,e,t.ignoreIsAllDay,!0);a&&a.current&&a.current.element&&(r.preventDefault(),a.current.element.focus());break}}}])(a),[u,d]=(e=>[[],(t,r)=>{switch(t.type){case"SLOT_FOCUS_UP":{if(!t.slot.current||!e)return;const a=Ta(t.slot,e);a&&a.current&&a.current.element&&(r.preventDefault(),a.current.element.focus());break}case"SLOT_FOCUS_DOWN":{if(!t.slot||!e)return;const a=Na(t.slot,e);a&&a.current&&a.current.element&&(r.preventDefault(),a.current.element.focus());break}case"SLOT_FOCUS_LEFT":{if(!t.slot||!e)return;const a=xa(t.slot,e);a&&a.current&&a.current.element&&(r.preventDefault(),a.current.element.focus());break}case"SLOT_FOCUS_RIGHT":{if(!t.slot||!e)return;const a=Ma(t.slot,e);a&&a.current&&a.current.element&&(r.preventDefault(),a.current.element.focus());break}}}])(o),[m,p]=(e=>{const[t,r]=k.useState([]),a=k.useCallback((a,n)=>{switch(a.type){case"ITEMS_SELECT_SELECT":if(!a.item)return;r([a.item]);break;case"ITEMS_SELECT_SELECT_NEXT":{if(!a.item||!a.item.current||!e)return;const t=q(a.item,e,a.ignoreIsAllDay,!1);t&&(n.preventDefault(),r([t]));break}case"ITEMS_SELECT_SELECT_PREV":{if(!a.item||!a.item.current||!e)return;const t=q(a.item,e,a.ignoreIsAllDay,!0);t&&(n.preventDefault(),r([t]));break}case"ITEMS_SELECT_RESET":r([]);break;case"ITEMS_SELECT_ADD":if(!a.item)return;t.some(e=>e===a.item)||r([...t,a.item]);break;case"ITEMS_SELECT_REMOVE":if(!a.item)return;r([...t.filter(e=>e!==a.item)])}},[e,t]);return[t,a]})(a),[g,E]=(()=>{const[e,t]=k.useState([]),r=k.useCallback(r=>{switch(r.type){case"SLOTS_SELECT_SELECT":if(!r.slot)return;t([r.slot]);break;case"SLOTS_SELECT_RESET":t([]);break;case"SLOTS_SELECT_ADD":if(!r.slot)return;e.some(e=>e===r.slot)||t([...e,r.slot])}},[e]);return[e,r]})(),v=k.useCallback((e,t)=>{E({type:wa.reset}),p(e,t)},[p,E]),h=k.useCallback((e,t)=>{p({type:Sa.reset},t),E(e)},[p,E]),y=k.useMemo(()=>n.classNames("k-scheduler-layout k-scheduler-layout-flex",e.className),[e.className]);return Ia({element:r,selector:".k-group-cell",attribute:"data-depth-index",explicitDepth:!0}),Ia({element:r,selector:".k-side-cell",attribute:"data-depth-index",explicitDepth:!1}),k.createElement(Ca,{props:e.props,ranges:e.ranges,items:[a,l],slots:[o,s],selectedItems:[m,v],selectedSlots:[g,h],focusedItems:[c,i],focusedSlots:[u,d]},k.createElement("div",{ref:r,style:e.style,className:y,role:e.role||"none"},e.children))});_a.displayName="KendoReactSchedulerBaseView";const za=k.createContext({resource:{},groupIndex:0}),La=e=>{const{nested:t,children:r,rowContentProps:a}=e,n=e.rowContent||Wa,l=e.childRowContent||n,o=C(e.group,e.resources);return k.createElement("div",{className:"k-scheduler-group k-group-horizontal"},t?Oa({resources:o,children:r,nested:t,groupIndex:0,rowContent:n,rowContentProps:a,childRowContent:l}):Fa({resources:o,children:r,rowContentProps:a,childRowContent:l}))},Oa=e=>{const{resources:t,rowContent:r,nested:a,children:n,groupIndex:l,rowContentProps:o,childRowContent:s}=e;if(l===t.length)return Fa({resources:t,children:n,rowContentProps:o,childRowContent:s});const c=S(t,l),i=r;return k.createElement(k.Fragment,null,a?k.createElement("div",{className:"k-scheduler-row"},k.createElement(i,{resources:t,groupIndex:l,...o},c.map((e,t)=>k.createElement("div",{key:t,className:"k-scheduler-cell k-heading-cell"},e.text)))):k.createElement(i,{resources:t,groupIndex:l,...o},c.map((e,t)=>k.createElement("div",{key:t,className:"k-scheduler-cell k-heading-cell"},e.text))),Oa({resources:t,children:n,nested:a,rowContent:r,childRowContent:s,groupIndex:l+1}))},Fa=e=>{const{resources:t,childRowContent:r,children:a,rowContentProps:n}=e,l=S(t,t.length-1),o=r,s=t.length>0;return k.createElement("div",{className:"k-scheduler-row"},k.createElement(o,{resources:t,...n},(l.length?l:X).map((e,t)=>k.createElement("div",{key:t,className:"k-scheduler-cell k-group-cell"},k.createElement(za.Provider,{value:{resource:e,groupIndex:s?t:0}},a)))))};La.displayName="KendoReactSchedulerHorizontalResourceIterator";const Wa=e=>e.children,Ha=e=>k.createElement(k.Fragment,null,k.createElement("div",{className:"k-scheduler-cell k-side-cell","data-range-index":e.rangeIndex}),e.children),Pa=e=>{const{nested:t,wrapGroup:r,children:a,role:n}=e,l=e.cellContent||Za,o=C(e.group,e.resources);return k.createElement("div",{className:"k-scheduler-group",role:n},t?r?k.createElement("div",{className:"k-scheduler-row"},k.createElement("div",{className:"k-sticky-cell"},Ba({resources:o,children:a,cellContent:l,depth:0,groupIndex:0})),k.createElement("div",{className:"k-scheduler-cell k-group-content"},Ka({resources:o,children:a,cellContent:l,depth:0,groupIndex:0},!1))):Ka({resources:o,children:a,cellContent:l,depth:0,groupIndex:0},!0):r?k.createElement("div",{className:"k-scheduler-row"},k.createElement("div",{className:"k-sticky-cell"},$a({resources:o})),k.createElement("div",{className:"k-scheduler-cell k-group-content"},a)):Va({resources:o,children:a,cellContent:l,groupIndex:0,role:n}))},$a=e=>k.createElement("div",{className:"k-scheduler-row"},k.createElement("div",{className:"k-scheduler-row"},e.resources.map((e,t)=>k.createElement("div",{key:t,className:"k-scheduler-cell k-resource-cell k-heading-cell","data-depth-index":t})))),Ka=(e,t=!0)=>{const{resources:r,children:a,cellContent:n,groupIndex:l,depth:o}=e,s=r.length>0;if(o===r.length||!s)return k.createElement(za.Provider,{value:{resource:r[o],groupIndex:s?l:0}},a);const c=r[o].data.length;return r[o].data.map((e,s)=>k.createElement("div",{key:s,className:"k-scheduler-row"},t&&k.createElement("div",{className:"k-scheduler-cell k-group-cell k-heading-cell","data-depth-index":o},e[r[o].textField]),k.createElement("div",{className:"k-scheduler-cell k-group-content k-resource-row","data-depth-index":o,"data-resource-index":c*l+s},Ka({resources:r,children:a,cellContent:n,groupIndex:c*l+s,depth:o+1},t))))},Ba=e=>{const{resources:t,children:r,cellContent:a,groupIndex:n,depth:l}=e,o=t.length?t[l].data.length:0;return t[l]?t[l].data.map((e,s)=>k.createElement("div",{key:s,className:"k-scheduler-row"},k.createElement("div",{className:"k-scheduler-cell k-resource-cell k-resource-row k-heading-cell","data-depth-index":l,"data-resource-index":o*n+s},e[t[l].textField]),l+1!==t.length&&k.createElement("div",{className:"k-scheduler-cell k-resource-content"},Ba({resources:t,children:r,cellContent:a,groupIndex:o*n+s,depth:l+1})))):null},Va=e=>{const{resources:t,children:r,groupIndex:a,cellContent:n,role:l}=e;return k.createElement("div",{className:"k-scheduler-row",role:l},Ua(t),n,Ga(r,t,a,l))},Ga=(e,t,r,a)=>{const n=t.length>0;return k.createElement("div",{className:"k-scheduler-cell k-group-content",role:a},k.createElement(za.Provider,{value:{resource:t[r],groupIndex:n?r:void 0}},e))},Ua=e=>e.map((e,t)=>k.createElement("div",{key:t,className:"k-scheduler-cell k-group-cell k-heading-cell","data-depth-index":t}));Pa.displayName="KendoReactSchedulerVerticalResourceIterator";const Za=null,qa=e=>{const t=o.useLocalization();return k.createElement(k.Fragment,null,k.createElement("div",{className:"k-scheduler-cell k-heading-cell k-side-cell k-scheduler-times-all-day"},t.toLanguageString(Me,Cr[Me])),e.children)},Ya=k.forwardRef((e,t)=>{const{as:r=ja.as,...a}=e,l=k.useRef(null),s=k.useRef(null),c=o.useInternationalization(),i=k.useMemo(()=>n.classNames("k-scheduler-cell k-heading-cell",e.className),[e.className]);return k.useImperativeHandle(s,()=>({element:l.current&&l.current.element?l.current.element:l.current,props:e})),k.useImperativeHandle(t,()=>s.current),k.createElement(r,{ref:r!==ja.as?void 0:l,...a,className:i},c.formatDate(e.date,e.format?e.format:ja.format))}),ja={as:k.forwardRef(({as:e,format:t,start:r,end:a,...n},l)=>k.createElement("div",{...n,ref:l})),format:"t"};Ya.displayName="KendoReactSchedulerTimeHeaderCell";const Xa=e=>{const{slot:t,children:r}=e;return k.createElement(k.Fragment,null,e.isMaster?k.createElement(Ya,{as:e.timeHeaderCell,date:t.zonedStart,start:t.zonedStart,end:t.zonedEnd,className:n.classNames("k-side-cell",{"k-major-cell":!e.isLast})}):k.createElement("div",{className:"k-scheduler-cell k-heading-cell k-side-cell"}),r)},Qa=k.forwardRef((e,t)=>{const{onFocus:r,onBlur:a,onClick:l,onMouseEnter:o,onMouseLeave:s,onMouseOut:c,onMouseOver:i,onDoubleClick:u,onKeyDown:d,onKeyPress:m,onKeyUp:p}=e,{slot:g,element:E}=((e,t)=>{const{_ref:r}=e,a=k.useRef(null),l=k.useRef(null),[,o]=ga();return k.useImperativeHandle(a,()=>({element:l.current,props:e})),k.useImperativeHandle(t,()=>a.current),k.useImperativeHandle(r,()=>a.current),k.useLayoutEffect(()=>(o({type:n.COLLECTION_ACTION.add,item:a}),()=>{o({type:n.COLLECTION_ACTION.remove,item:a})})),{slot:a,element:l}})(e,t),v=void 0!==e.tabIndex?null===e.tabIndex?void 0:e.tabIndex:e.selected?0:-1,h=k.useMemo(()=>{var t,r;const a=null!=(t=e.isWorkHour)?t:Ja.isWorkHour,l=null!=(r=e.isWorkDay)?r:Ja.isWorkDay;return n.classNames("k-scheduler-cell",e.className,"k-slot-cell",{"k-nonwork-hour":!a||!l,"k-selected":e.selected})},[e.className,e.selected,e.isWorkHour,e.isWorkDay]),y=k.useMemo(()=>({userSelect:"none",...e.style}),[e.style]),f=k.useCallback(e=>{r&&r.call(void 0,{syntheticEvent:e,target:g.current})},[r,g]),D=k.useCallback(e=>{a&&a.call(void 0,{syntheticEvent:e,target:g.current})},[a,g]),b=k.useCallback(e=>{l&&l.call(void 0,{syntheticEvent:e,target:g.current})},[l,g]),C=k.useCallback(e=>{i&&i.call(void 0,{syntheticEvent:e,target:g.current})},[i,g]),S=k.useCallback(e=>{c&&c.call(void 0,{syntheticEvent:e,target:g.current})},[c,g]),w=k.useCallback(e=>{o&&o.call(void 0,{syntheticEvent:e,target:g.current})},[o,g]),I=k.useCallback(e=>{s&&s.call(void 0,{syntheticEvent:e,target:g.current})},[s,g]),R=k.useCallback(e=>{u&&u.call(void 0,{syntheticEvent:e,target:g.current})},[u,g]),T=k.useCallback(e=>{d&&d.call(void 0,{syntheticEvent:e,target:g.current})},[d,g]),x=k.useCallback(e=>{m&&m.call(void 0,{syntheticEvent:e,target:g.current})},[m,g]),M=k.useCallback(e=>{p&&p.call(void 0,{syntheticEvent:e,target:g.current})},[p,g]);return k.createElement("div",{ref:E,id:e.id,style:y,className:h,tabIndex:v,role:e.role,"aria-selected":e.selected||void 0,onFocus:f,onBlur:D,onClick:b,onMouseEnter:w,onMouseLeave:I,onMouseOver:C,onMouseOut:S,onDoubleClick:R,onKeyDown:T,onKeyPress:x,onKeyUp:M,"data-slot":!0,"data-slot-allday":e.isAllDay,"data-slot-start":e.start.getTime(),"data-slot-end":e.end.getTime(),"data-slot-group":e.group.index,"data-slot-range":e.range.index,"data-slot-index":e.index},e.children)}),Ja={isWorkHour:!0,isWorkDay:!0};Qa.displayName="KendoReactSchedulerSlot";const en=e=>{const t=new Map;Array.from(e.querySelectorAll(".k-resource-row")).filter(e=>!e.classList.contains("k-resource-cell")).forEach(e=>{var r;const a=e.getAttribute("data-depth-index"),n=e.getAttribute("data-resource-index");if(null===a||null===n)return;const l=`${a}:${n}`;t.set(l,Math.max(null!=(r=t.get(l))?r:0,e.clientHeight-1))});const r=[];Array.from(e.querySelectorAll(".k-resource-cell")).forEach(e=>{const a=e.getAttribute("data-depth-index"),n=e.getAttribute("data-resource-index");if(null===a||null===n)return;const l=t.get(`${a}:${n}`);if(void 0===l)return;const o=Math.round(l-I(e));r.push({cell:e,height:o,minHeight:o>0?`${o}px`:""})}),r.forEach(({cell:e,height:t,minHeight:r})=>{e.style.minHeight!==r&&R(e,{height:t},!0)})},tn=new Set;let rn;const an=e=>{tn.add(e),void 0===rn&&(rn=window.requestAnimationFrame(()=>{rn=void 0;const e=Array.from(tn);tn.clear();const t=new Set;e.map(e=>{try{return e()}catch{return}}).forEach(e=>{if(!e)return;const{element:r,minHeight:a}=e,n=a&&a>0?`${a}px`:"";if(r.style.minHeight!==n){R(r,{height:null!=a?a:0},!0);const e=r.closest(".k-scheduler-layout");e&&t.add(e)}}),t.forEach(en)}))},nn=(e,t,r,a)=>{const n=re(),l=!!t,o="object"==typeof t&&t.offsetTop?t.offsetTop:0,s="object"==typeof t&&t.offsetBottom?t.offsetBottom:0,c=null!=a?a:e.current&&e.current.props.items,i=c?JSON.stringify(c.map(e=>{var t,r;return[e.uid,e.isRecurring&&null!=(r=null==(t=e.originalStart)?void 0:t.getTime())?r:null]})):"",u=r?`${r.padding}|${r.paddingTop}|${r.paddingBottom}`:"",d=k.useCallback(()=>{if(!l||!e.current)return;const t=e.current.element,r=e.current.props;if(!t)return;const a=I(t),n=new Map;let c=!1;const i=r.items.filter(e=>e._ref.current);let u;if(i.forEach(e=>{var t,r,a,l,o;if(!e._ref.current)return;const{height:s}=w(e._ref.current.element),i=null!=(a=null!=(r=null==(t=e._ref.current)?void 0:t._order)?r:e.order)?a:-1;null!=(l=e._ref.current.element)&&l.style.top&&(c=!0),(null!=(o=n.get(i))?o:0)<s&&n.set(i,s)}),!c||0===n.size)return{element:t,minHeight:null};const d=Math.max(...Array.from(n.keys())),m=d+1,p=Math.max(...Array.from(n.values()));u=0;for(let e=0;e<=d;e++)u+=n.has(e)?n.get(e):p;const g=1*m*2+u-a+o+s;return{element:t,minHeight:i.length?g:null}},[l,s,o,e]),m=k.useCallback(()=>{an(d)},[d]);k.useEffect(()=>{var t;if(!l){const r=e.current;if(null!=r&&r.element){const e=null==(t=r.props.style)?void 0:t.minHeight;r.element.style.minHeight="number"==typeof e?`${e}px`:null!=e?e:""}return}return an(d),()=>(e=>{tn.delete(e),0===tn.size&&void 0!==rn&&(window.cancelAnimationFrame(rn),rn=void 0)})(d)},[d,l,e,i,u]),k.useEffect(()=>{if(!l||!e.current)return;const t=e.current.props.items.filter(e=>e._ref.current).map(e=>{if(!e._ref.current||!e._ref.current.element||!n.current)return;const t=window.ResizeObserver,r=t&&new t(m);r&&r.observe(e._ref.current.element);const a=new MutationObserver(m);return a.observe(e._ref.current.element,{attributes:!0,attributeFilter:["style"]}),()=>{r&&r.disconnect(),a.disconnect()}});return()=>{t.forEach(e=>e&&e())}},[l,m,n,e,i])},ln=k.forwardRef((e,t)=>{var r;const{slot:a,_ref:n,...l}=e,o=a||on.slot,s=k.useRef(null),c=k.useRef(null);return k.useImperativeHandle(s,()=>({props:e})),k.useImperativeHandle(n,()=>c.current),k.useImperativeHandle(t,()=>s.current),nn(c,null!=(r=e.expandable)?r:on.expandable,e.style,e.items),k.createElement(o,{...l,_ref:c})}),on={slot:Qa,expandable:!1};ln.displayName="KendoReactSchedulerViewSlot";const sn=k.createContext([null]);sn.displayName="SchedulerEditSlotPropsContext";const cn=k.createContext([null]);cn.displayName="SchedulerEditSlotFormItemContext";const un=({props:e,form:t,children:r})=>k.createElement(sn.Provider,{value:e},k.createElement(cn.Provider,{value:t},r)),dn=e=>{const t=k.useContext(ae),r=void 0!==e?e:t.editable||!1,a=!0===r||void 0!==r&&!1!==r&&!0===r.edit,n=!0===r||void 0!==r&&!1!==r&&!0===r.resize,l=!0===r||void 0!==r&&!1!==r&&!0===r.remove,o=!0===r||void 0!==r&&!1!==r&&!0===r.drag;return{add:!0===r||void 0!==r&&!1!==r&&!0===r.add,edit:a,drag:o,remove:l,resize:n,select:!0===r||void 0!==r&&!1!==r&&!0===r.select}},mn=k.forwardRef((e,t)=>{const{_ref:r,onDataAction:a,viewSlot:l,form:o,formItem:s,onFormItemChange:c,...i}=e,[u,d]=k.useState(e.tabIndex),m=k.useRef(null),p=k.useRef(null);k.useImperativeHandle(p,()=>({props:e})),k.useImperativeHandle(t,()=>p.current),k.useImperativeHandle(r,()=>m.current);const g=dn(e.editable),E=ce(),[v]=ga(),[h]=va(),[y,f]=k.useContext(ha),[,D]=ba(),b=o||pn.form,C=l||pn.viewSlot,[S,w]=Se(null,s,e.onFormItemChange),I=y.some(t=>!(!t.current||t.current.props.start.getTime()!==e.start.getTime()||t.current.props.end.getTime()!==e.end.getTime()||t.current.props.index!==e.index||t.current.props.group.index!==e.group.index||t.current.props.range.index!==e.range.index||t.current.props.isAllDay!==e.isAllDay)),R=k.useCallback(()=>{const t={};if(_(t,E.start,new Date(e.start.getTime())),_(t,E.end,new Date(e.end.getTime())),_(t,E.isAllDay,e.isAllDay),e.group.resources.length)for(let r=0;r<e.group.resources.length;r++){const a=e.group.resources[r];if(M(e.group.resources)){const n=A(e.group.resources[r],a.valueField);_(t,a.field,a.multiple?[n]:n)}else _(t,a.field,a.multiple?[]:void 0)}return t},[E.start,E.end,E.isAllDay,e.start,e.end,e.isAllDay,e.group.resources]),T=k.useCallback(t=>{g.select&&f({type:wa.select,slot:m},t.syntheticEvent),e.onFocus&&e.onFocus.call(void 0,t)},[f,g.select,e.onFocus]),x=k.useCallback(t=>{if(g.add){const e=R();w(e,t)}e.onDoubleClick&&e.onDoubleClick.call(void 0,t)},[R,g.add,e.onDoubleClick,w]),N=k.useCallback(e=>{let t;switch(e.syntheticEvent.keyCode){case n.Keys.left:if(!v)return;e.syntheticEvent.preventDefault(),D({type:Ra.left,slot:m},e.syntheticEvent);break;case n.Keys.right:if(!v)return;e.syntheticEvent.preventDefault(),D({type:Ra.right,slot:m},e.syntheticEvent);break;case n.Keys.up:if(!v)return;e.syntheticEvent.preventDefault(),D({type:Ra.up,slot:m},e.syntheticEvent);break;case n.Keys.down:if(!v)return;e.syntheticEvent.preventDefault(),D({type:Ra.down,slot:m},e.syntheticEvent);break;case n.Keys.enter:{if(!v||!g.add)return;const e=R();w(e);break}case n.Keys.tab:t=(e=>{const t=e.props.items.find(e=>0===e.order)||e.props.items[0];return t&&t._ref.current})(e.target)}t&&(e.syntheticEvent.preventDefault(),t.element&&t.element.focus())},[R,D,g.add,w,v]),z=k.useCallback(e=>{a&&a.call(void 0,{type:ee.create,series:!1,dataItem:e.value},e),w(null,e.syntheticEvent)},[a,w]),L=k.useCallback(e=>{w(null,e.syntheticEvent)},[w]),O=k.useCallback(e=>{w(null,e)},[w]),F=k.useCallback((e,t)=>{w&&w(e,t)},[w]);return k.useEffect(()=>{const t=v.length&&v[0].current===m.current;d(void 0!==e.tabIndex?null===e.tabIndex?void 0:e.tabIndex:0===y.length&&t&&0===h.length?0:void 0)},[h,e.tabIndex,y.length,v]),k.createElement(un,{props:e,form:[S,F]},k.createElement(C,{...i,_ref:m,selected:I,tabIndex:u,onFocus:T,onDoubleClick:x,onKeyDown:N}),S&&k.createElement(b,{dataItem:S,onSubmit:z,onClose:O,onCancel:L}))}),pn={viewSlot:ln,form:ca};mn.displayName="KendoReactSchedulerEditSlot";const gn=k.forwardRef((e,t)=>{const{isRemove:r,onClose:a,onSeriesClick:l,onOccurrenceClick:c}=e,i=k.useRef(null);k.useImperativeHandle(i,()=>({props:e})),k.useImperativeHandle(t,()=>i.current);const u=o.useLocalization(),d=e=>u.toLanguageString(e,Cr[e]),m=d(Be),g=d(Ve),E=d(Ge),v=d(Ue),h=d($t),y=d(Kt),f=d(Gt),b=d(Pt),C=r?f:v,S=r?b:E,w=r?h:m,I=r?y:g,R=k.useCallback(({syntheticEvent:e})=>{a&&a.call(void 0,{syntheticEvent:e,value:null,target:i.current})},[a]),T=k.useCallback(e=>{l&&l.call(void 0,{syntheticEvent:e,value:null,target:i.current})},[l]),x=k.useCallback(e=>{c&&c.call(void 0,{syntheticEvent:e,value:null,target:i.current})},[c]);return n.canUseDOM?D.createPortal(k.createElement(p.Dialog,{title:C,onClose:R},S,k.createElement(p.DialogActionsBar,null,k.createElement(s.Button,{onClick:x},w),k.createElement(s.Button,{onClick:T},I))),document&&document.body):null});gn.displayName="KendoReactSchedulerSchedulerOccurrenceDialog";const En=k.forwardRef((e,t)=>{const{onClose:r,onCancel:a,onConfirm:l,isSeries:c}=e,i=k.useRef(null);k.useImperativeHandle(i,()=>({props:e})),k.useImperativeHandle(t,()=>i.current);const u=o.useLocalization(),d=u.toLanguageString(qe,Cr[qe]),m=u.toLanguageString(Ft,Cr[Ft]),g=c?u.toLanguageString(Ht,Cr[Ht]):u.toLanguageString(Wt,Cr[Wt]),E=c?u.toLanguageString(Vt,Cr[Vt]):u.toLanguageString(Bt,Cr[Bt]),v=k.useCallback(({syntheticEvent:e})=>{if(!r)return;const t={syntheticEvent:e,value:null,target:i.current};r.call(void 0,t)},[r]),h=k.useCallback(e=>{a&&a.call(void 0,{syntheticEvent:e,value:null})},[a]),y=k.useCallback(e=>{l&&l.call(void 0,{syntheticEvent:e,value:null})},[l]);return n.canUseDOM?D.createPortal(k.createElement(p.Dialog,{title:E,onClose:v},g,k.createElement(p.DialogActionsBar,null,k.createElement(s.Button,{onClick:h},d),k.createElement(s.Button,{onClick:y},m))),document&&document.body):null});En.displayName="KendoReactSchedulerRemoveDialog";const vn=k.forwardRef((e,t)=>{const{onFocus:r,onBlur:a,onMouseDown:l,onClick:s,onMouseUp:c,onMouseOut:i,onMouseOver:u,onMouseEnter:d,onMouseLeave:m,onDoubleClick:p,onKeyUp:g,onKeyDown:E,onKeyPress:v,onPress:h,onDrag:y,onRelease:f,onResizePress:D,onResizeEndDrag:b,onResizeRelease:C,onResizeStartDrag:S}=e,{item:w,element:I}=((e,t)=>{const{_ref:r,itemRef:a,_maxSiblingsPerSlot:l,_siblings:o,_order:s}=e,c=k.useRef(null),i=k.useRef(null),[,u]=va();return k.useImperativeHandle(c,()=>({element:i.current,props:e,get _maxSiblingsPerSlot(){return null==l?void 0:l.current},set _maxSiblingsPerSlot(e){var t;null!=e&&void 0!==l&&void 0!==l.current&&(l.current=e,null==(t=null==o?void 0:o.current)||t.forEach(t=>{var r;!t||t._maxSiblingsPerSlot===e||e<(null!=(r=t._maxSiblingsPerSlot)?r:0)||(t._maxSiblingsPerSlot=e)}))},get _order(){return null==s?void 0:s.current},set _order(e){void 0!==e&&void 0!==s&&void 0!==s.current&&(s.current=e)}})),k.useImperativeHandle(t,()=>c.current),k.useImperativeHandle(r,()=>c.current),k.useImperativeHandle(a,()=>c.current),n.useIsomorphicLayoutEffect(()=>(u({type:n.COLLECTION_ACTION.add,item:c}),()=>{u({type:n.COLLECTION_ACTION.remove,item:c})})),{item:c,element:i}})(e,t),R=k.useRef(null),T=k.useRef(null),x=k.useRef(null),M=k.useRef(null),N=dn(e.editable),A=e.readonly?{resize:!1,select:N.select}:N,_=o.useInternationalization(),z=o.useLocalization().toLanguageString(Me,Cr[Me]),L=e.group.resources.find(e=>!(!e.colorField||""===e[e.colorField]||void 0===e[e.colorField])),O=L&&L.colorField&&L[L.colorField],F=void 0!==e.tabIndex?null===e.tabIndex?void 0:e.tabIndex:e.selected?0:-1,W=k.useMemo(()=>n.classNames({"k-event":!e.resizeHint,"k-selected":e.selected&&A.select,"k-readonly":!e.resizeHint&&!!e.readonly,"k-event-drag-hint":e.dragHint,"k-scheduler-marquee":e.resizeHint,"k-marquee":e.resizeHint,"k-first":e.resizeHint&&!e.tail,"k-last":e.resizeHint&&!e.head},e.className),[e.resizeHint,e.selected,e.readonly,e.dragHint,e.tail,e.head,e.className,A.select]),H=k.useMemo(()=>`${e.title}, ${function(e,t,r,a,n="all day"){const l={skeleton:"yMMMMEEEEdhm"},o={skeleton:"yMMMMEEEEd"},s=t.getFullYear()===r.getFullYear()&&t.getMonth()===r.getMonth()&&t.getDate()===r.getDate();if(a){const a=0===r.getHours()&&0===r.getMinutes()&&0===r.getSeconds()&&r.getTime()-t.getTime()===864e5;return s||a?`${e.formatDate(t,o)} (${n})`:`${e.formatDate(t,o)} to ${e.formatDate(r,o)} (${n})`}return s?`${e.formatDate(t,l)}–${e.formatDate(r,"t")}`:`${e.formatDate(t,l)}-${e.formatDate(r,l)}`}(_,e.zonedStart,e.zonedEnd,e.isAllDay,z)}`,[_,e.isAllDay,e.title,e.zonedEnd,e.zonedStart,z]),P=k.useMemo(()=>{var t;return{cursor:"pointer",userSelect:"none",borderColor:e.resizeHint?void 0:O,backgroundColor:e.resizeHint?void 0:O,touchAction:"none",...e.style,containerType:e.resizeHint?void 0:"auto"===(null==(t=e.style)?void 0:t.height)?"normal":"size"}},[O,e.style,e.resizeHint]),$=k.useCallback(e=>{r&&r.call(void 0,{syntheticEvent:e,target:w.current})},[r,w]),K=k.useCallback(e=>{a&&a.call(void 0,{syntheticEvent:e,target:w.current})},[a,w]),B=k.useCallback(e=>{l&&l.call(void 0,{syntheticEvent:e,target:w.current})},[l,w]),V=k.useCallback(e=>{s&&s.call(void 0,{syntheticEvent:e,target:w.current})},[s,w]),G=k.useCallback(e=>{c&&c.call(void 0,{syntheticEvent:e,target:w.current})},[c,w]),U=k.useCallback(e=>{u&&u.call(void 0,{syntheticEvent:e,target:w.current})},[u,w]),Z=k.useCallback(e=>{i&&i.call(void 0,{syntheticEvent:e,target:w.current})},[i,w]),q=k.useCallback(e=>{d&&d.call(void 0,{syntheticEvent:e,target:w.current})},[d,w]),Y=k.useCallback(e=>{m&&m.call(void 0,{syntheticEvent:e,target:w.current})},[m,w]),j=k.useCallback(t=>{!p||e.readonly||p.call(void 0,{syntheticEvent:t,target:w.current})},[p,w,e.readonly]),X=k.useCallback(e=>{E&&E.call(void 0,{syntheticEvent:e,target:w.current})},[E,w]),Q=k.useCallback(e=>{v&&v.call(void 0,{syntheticEvent:e,target:w.current})},[v,w]),J=k.useCallback(e=>{g&&g.call(void 0,{syntheticEvent:e,target:w.current})},[g,w]),ee=k.useCallback(t=>{!h||e.readonly||h.call(void 0,{dragEvent:t,target:w.current})},[h,w,e.readonly]),te=k.useCallback(t=>{!y||e.readonly||y.call(void 0,{dragEvent:t,target:w.current})},[y,w,e.readonly]),re=k.useCallback(t=>{!f||e.readonly||f.call(void 0,{dragEvent:t,target:w.current})},[f,w,e.readonly]),ae=k.useCallback(t=>{!D||e.readonly||D.call(void 0,{dragEvent:t,target:w.current})},[D,w,e.readonly]),ne=k.useCallback(e=>{S&&S.call(void 0,{dragEvent:e,target:w.current})},[S,w]),le=k.useCallback(e=>{b&&b.call(void 0,{dragEvent:e,target:w.current})},[b,w]),oe=k.useCallback(e=>{C&&C.call(void 0,{dragEvent:e,target:w.current})},[C,w]);return n.useDraggable(I,{onPress:ee,onDrag:te,onRelease:re}),n.useDraggable(R,{onPress:ae,onDrag:le,onRelease:oe}),n.useDraggable(T,{onPress:ae,onDrag:ne,onRelease:oe}),n.useDraggable(x,{onPress:ae,onDrag:ne,onRelease:oe}),n.useDraggable(M,{onPress:ae,onDrag:le,onRelease:oe}),k.createElement("div",{ref:I,id:e.id,style:P,tabIndex:F,className:W,role:"button","aria-label":H,onFocus:$,onBlur:K,onMouseUp:G,onMouseDown:B,onClick:V,onMouseOver:U,onMouseOut:Z,onMouseEnter:q,onMouseLeave:Y,onDoubleClick:j,onKeyDown:X,onKeyPress:Q,onKeyUp:J,"data-group-index":e.group.index,"data-range-index":e.range.index},e.children,A.resize&&e.vertical&&k.createElement(k.Fragment,null,k.createElement("span",{className:"k-resize-handle k-resize-n",ref:x}),k.createElement("span",{className:"k-resize-handle k-resize-s",ref:M})),A.resize&&!e.vertical&&k.createElement(k.Fragment,null,k.createElement("span",{className:"k-resize-handle k-resize-w",ref:T}),k.createElement("span",{className:"k-resize-handle k-resize-e",ref:R})),e.resizeHint&&k.createElement(k.Fragment,null,k.createElement("div",{className:"k-marquee-color",style:{borderColor:O,backgroundColor:O}}),k.createElement("div",{className:"k-marquee-text"},!e.tail&&k.createElement("div",{className:"k-label-top"},_.formatDate(e.zonedStart,e.format)),!e.head&&k.createElement("div",{className:"k-label-bottom"},_.formatDate(e.zonedEnd,e.format)))))});vn.displayName="KendoReactSchedulerItem";const hn=k.forwardRef((e,t)=>{const r=k.useMemo(()=>n.classNames("k-event-template",e.className),[e.className]);return k.createElement("div",{ref:t,...e,className:r})}),yn=(e,t)=>{const{element:r}=e;k.useEffect(()=>{if(!r||!e.syncHeight)return;const t=[[]];Array.from(r.querySelectorAll(e.selector)).filter(t=>!t.classList.contains((e=>e.slice(1,e.length))(e.applyTo))).forEach(r=>{const a=r.clientHeight,n=r.getAttribute(e.horizontalAttribute),l=r.getAttribute(e.verticalAttribute);null===n||null===l||(t[n]||(t[n]=[]),(!t[n][l]||a>t[n][l])&&(t[n][l]=a-1))}),Array.from(r.querySelectorAll(e.applyTo)).forEach(r=>{const a=r.getAttribute(e.horizontalAttribute),n=r.getAttribute(e.verticalAttribute);if(null===a||null===n)return;const l=I(r),o=Math.round(t[a][n]-l);R(r,{height:o},!0)})},t)},fn=k.forwardRef((e,t)=>{const{item:r,_ref:a,itemRef:l,...s}=e,c=k.useRef(void 0),i=k.useRef(void 0),u=k.useRef(null),m=k.useRef(null),p=k.useRef(null),g=dn(e.editable);k.useImperativeHandle(m,()=>({props:e,element:u.current&&u.current.element})),k.useImperativeHandle(t,()=>m.current),k.useImperativeHandle(a,()=>u.current),k.useImperativeHandle(l,()=>u.current);const E=r||kn.item,v=o.useInternationalization(),[h]=va(),[y]=ga(),f=re(),[D,b]=k.useState(!0),[C,S]=k.useState(!1),I=k.useRef(e.order),x=k.useRef(0),M=k.useRef(!1),N=n.useDir(f),A=k.useMemo(()=>{var t,r;return e.isAllDay?null!=(t=e.title)?t:"":`(${v.format("{0:t} - {1:t}",e.zonedStart,e.zonedEnd)}): ${null!=(r=e.title)?r:""}`},[v,e.isAllDay,e.title,e.zonedEnd,e.zonedStart]);let _;e.isRecurring&&!e.isException?_="recurring":!e.isRecurring&&e.isException&&(_="non-recurring");const z=k.useMemo(()=>v.format("{0:t} – {1:t}",e.zonedStart,e.zonedEnd),[v,e.zonedStart,e.zonedEnd]),L=(e,t)=>{let r=1;return e.forEach(e=>{const a=t.filter(t=>O(e.current.props,t.props));a.length>r&&(r=a.length)}),r},O=(t,r)=>P(t.start,t.end,r.start,r.end)&&t.group.index===r.group.index&&t.range.index===r.range.index&&(void 0===t.range.isAllDay||void 0===r.range.isAllDay||t.range.isAllDay===r.range.isAllDay)&&(e.ignoreIsAllDay||t.isAllDay===r.isAllDay),F=()=>{var t,r,a,n,l;const o=(y||[]).filter(t=>t.current&&O(t.current.props,e)),s=u.current&&u.current.element,c=T(o);if(0===o.length)return void b(!1);if(!c.current||!s)return;const i=w(c.current.element),d=[],m=[],p=[];(h||[]).forEach(e=>{e.current&&(e.current.props.dragHint?m.push(e.current):e.current.props.resizeHint?p.push(e.current):d.push(e.current))});const E=e.dragHint||e.resizeHint?((e,t,r,a=!1)=>{let n;return r.forEach(r=>{const l=[];t.sort((e,t)=>e.props.start.getTime()-t.props.start.getTime()).forEach(t=>{if((a||t.props.isAllDay===r.current.props.isAllDay)&&t.props.range.index===r.current.props.range.index&&t.props.group.index===r.current.props.group.index&&P(t.props.start,t.props.end,r.current.props.start,r.current.props.end)){const r=V(l);t===e&&void 0===n&&(n=r),l.splice(r,0,r)}})}),n})(u.current,e.dragHint?m:p,o,e.ignoreIsAllDay):null!=(t=e.order)?t:0;if(e.vertical||e.dragHint||e.resizeHint||null===e.order||void 0===e.order)I.current=E;else{const t=(e.ignoreIsAllDay?d:d.filter(e=>e.props.isAllDay)).filter(t=>t.props.group.index===e.group.index),a=null==(r=e.style)?void 0:r.height,n="number"==typeof a?a:parseFloat(a),l=null!=a&&Number.isNaN(n),o=!!e.ignoreIsAllDay,s=!!o||!l;I.current=((e,t,r,a=!1)=>{var n;const l=t.filter(e=>null!==e.props.order&&void 0!==e.props.order).map(e=>{let t=e.props.start,r=e.props.end;if(e.props.isAllDay||a){t=new Date(t.getFullYear(),t.getMonth(),t.getDate());const e=new Date(r.getFullYear(),r.getMonth(),r.getDate());r=e.getTime()<=t.getTime()?new Date(t.getFullYear(),t.getMonth(),t.getDate()+1):e}return{order:e.props.order,start:t,end:r}}),o=Array.from(new Set(l.map(e=>e.order))).sort((e,t)=>e-t),s=new Map;for(const e of l)s.has(e.order)||s.set(e.order,[]),s.get(e.order).push({start:e.start,end:e.end});const c=[],i=new Map;for(const e of o){const t=s.get(e);let a=-1,n=0;i.forEach((a,l)=>{if(l>=e)return;const o=s.get(l);o&&t.some(e=>o.some(t=>P(t.start,t.end,e.start,e.end,r)))&&a+1>n&&(n=a+1)});for(let e=n;e<c.length;e++)if(t.every(t=>c[e].every(e=>!P(e.start,e.end,t.start,t.end,r)))){a=e;break}-1===a&&(a=c.length,c.push([])),c[a].push(...t),i.set(e,a)}return null!=(n=i.get(e))?n:e})(e.order,t,s,o)}let v=e.dragHint||e.resizeHint?L(o,e.dragHint?m:p):L(o,d);const f=((e,t)=>e.map(e=>t.filter(t=>O(e.current.props,t.props))))(o,d);let k=0;const D=!e.vertical&&null!==I.current;if(f.forEach(e=>{let t=0;e.forEach(e=>{if(!D){const r=w(e.element);null!==e.props.order&&void 0!==e.props.order&&e.props.order<I.current&&(t=r.top+r.height-i.top-1*I.current+1)}}),t>k&&(k=t)}),D){const t=null==(a=e.style)?void 0:a.height,r="number"==typeof t?t:parseFloat(t);if(null==t)k=26*I.current;else if(Number.isNaN(r)){const t=(e.ignoreIsAllDay?d:d.filter(e=>e.props.isAllDay)).filter(t=>t.props.group.index===e.group.index&&t.element!==s&&(!e.ignoreIsAllDay||!c.current||P(t.props.start,t.props.end,c.current.props.start,c.current.props.end))),r=new Map;t.forEach(e=>{var t,a;const n=e._order;if(null==n||n>=I.current)return;const l=(null==(t=e.element)?void 0:t.offsetHeight)||25;r.set(n,Math.max(null!=(a=r.get(n))?a:0,l))}),k=Array.from(r.values()).reduce((e,t)=>e+t+1,0)}else k=I.current*(r+1)}if(0===o.length)return void b(!1);const C=g.add?20:0;i.width=e.vertical?i.width/v-1-C/v:i.width*o.length-1,e.vertical?i.height=i.height*o.length-1:(e.resizeHint||e.dragHint)&&v<=1||(i.height=null!=(l=null==(n=e.style)?void 0:n.height)?l:25),i.left=e.vertical?i.left+I.current*i.width+1*I.current:i.left;const N=!e.vertical&&e.slotHeaderOffset||0;i.top=e.vertical?i.top:i.top+k+1*I.current+N,x.current=v,R(s,i),(M.current||e.dragHint||e.resizeHint)&&S(!0),b(!0)},W=k.useCallback(e=>{const t=e&&e[0],r=p.current;void 0!==c.current&&window.cancelAnimationFrame(c.current),r&&t&&(r.width!==t.contentRect.width||r.height!==t.contentRect.height)&&(c.current=window.requestAnimationFrame(()=>{F()})),p.current={width:t.contentRect.width,height:t.contentRect.height}},[F]);k.useEffect(()=>(F(),void 0!==i.current&&window.cancelAnimationFrame(i.current),i.current=window.requestAnimationFrame(()=>{i.current=window.requestAnimationFrame(()=>{i.current=void 0,F(),M.current=!0,S(!0)})}),()=>{void 0!==i.current&&(window.cancelAnimationFrame(i.current),i.current=void 0)}));const H=u.current&&u.current.element?u.current.element.closest(".k-scheduler-layout"):null;return yn({element:H,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:e.isLast}),k.useEffect(()=>{if(!f.current)return;const e=window.ResizeObserver,t=e&&new e(W);return t&&t.observe(f.current),()=>{t&&t.disconnect()}},[W,f]),k.createElement(E,{...s,_ref:u,_maxSiblingsPerSlot:x,_order:I,itemRef:u,style:{visibility:C?void 0:"hidden",display:D?void 0:"none",...e.style}},!e.resizeHint&&k.createElement(k.Fragment,null,e.tail&&!e.vertical&&k.createElement("span",{className:"k-event-continuation"},k.createElement(n.IconWrap,{name:"rtl"===N?"chevron-right":"chevron-left",icon:"rtl"===N?d.chevronRightIcon:d.chevronLeftIcon})),k.createElement("div",{title:A},e.tail&&e.vertical&&k.createElement("span",{className:"k-event-continuation"},k.createElement(n.IconWrap,{name:"chevron-up",icon:d.chevronUpIcon})),k.createElement(hn,{className:"k-event-title"},e.title),k.createElement(hn,{className:"k-event-time"},"recurring"===_&&k.createElement("span",{className:"k-event-recurrence-icon"},k.createElement(n.IconWrap,{name:"arrow-rotate-cw",icon:d.arrowRotateCwIcon})),"non-recurring"===_&&k.createElement("span",{className:"k-event-recurrence-icon"},k.createElement(n.IconWrap,{name:"arrows-no-repeat",icon:d.arrowsNoRepeatIcon})),z),e.head&&e.vertical&&k.createElement("span",{className:"k-event-continuation"},k.createElement(n.IconWrap,{name:"chevron-down",icon:d.chevronDownIcon}))),_&&k.createElement("span",{className:"k-event-recurrence-icon"},k.createElement(n.IconWrap,{name:"recurring"===_?"arrow-rotate-cw":"arrows-no-repeat",icon:"recurring"===_?d.arrowRotateCwIcon:d.arrowsNoRepeatIcon})),e.head&&!e.vertical&&k.createElement("span",{className:"k-event-continuation"},k.createElement(n.IconWrap,{name:"rtl"===N?"chevron-left":"chevron-right",icon:"rtl"===N?d.chevronLeftIcon:d.chevronRightIcon}))))}),kn={item:vn};fn.displayName="KendoReactSchedulerViewItem";const Dn=(e,{dateRange:t,fields:r,timezone:a})=>{const l=n.getter(r.recurrenceId||"recurrenceId"),o=n.getter(r.recurrenceRule||"recurrenceRule"),s=new Set(e.filter(e=>null!=l(e)&&!!o(e)).map(l));return e.map(bn(r)).reduce(Cn(t,a,r,s),[]).filter(e=>!F(e.dataItem,r))},bn=e=>t=>{const r=n.getter(e.start||"start")(t),a=n.getter(e.originalStart||"originalStart")(t),l=n.getter(e.recurrenceId||"recurrenceId")(t),o=n.getter(e.recurrenceRule||"recurrenceRule")(t),s=null!=l&&!!o&&null==a,c=n.clone(t);return s&&_(c,e.originalStart||"originalStart",r),{uid:n.getter(e.id||"id")(t),start:r,startTimezone:n.getter(e.startTimezone||"startTimezone")(t),originalStart:s?r:a,end:n.getter(e.end||"end")(t),endTimezone:n.getter(e.endTimezone||"endTimezone")(t),isAllDay:n.getter(e.isAllDay||"isAllDay")(t),title:n.getter(e.title||"title")(t),description:n.getter(e.description||"description")(t),occurrenceId:n.getter("occurrenceId")(t),recurrenceRule:o,recurrenceExceptions:n.getter(e.recurrenceExceptions||"recurrenceExceptions")(t),recurrenceId:l,readonly:n.getter(e.readonly||"readonly")(t),dataItem:c}},Cn=(e,t,r,a)=>(n,l)=>[...n,...!l.recurrenceRule||null!==l.recurrenceId&&void 0!==l.recurrenceId||!F(l.dataItem,r)||a.has(l.uid)?[l]:[...Sn(l,{dateRange:e,timezone:t,fields:r})]],Sn=(e,{dateRange:t,timezone:r,fields:l})=>{const o=e.recurrenceRule,s=g.parseRule({recurrenceRule:o});if(!s)return[];s.start||(s.start=a.ZonedDate.fromLocalDate(e.start,r)),s.end||(s.end=a.ZonedDate.fromLocalDate(e.end,r));const c=e.recurrenceExceptions;c&&(s.exceptionDates=c.map(e=>a.ZonedDate.fromLocalDate(e,r)));const i=s.end.getTime()-s.start.getTime(),u=a.ZonedDate.fromLocalDate(new Date(t.zonedStart.toLocalDate().getTime()-i),r),d=t.zonedEnd,m=g.expand(s,{rangeStart:u,rangeEnd:d});if(!m.events.length)return[];const p=s.until,E=p&&s.bySetPosition?m.events.filter(e=>e.start.getTime()<=p.getTime()):m.events;return E.length?E.map((t,r)=>{const a=n.clone(e),o=n.clone(e.dataItem);return a.recurrenceId=a.uid,_(o,l.recurrenceId,e.uid),a.originalStart=t.start.toLocalDate(),_(o,l.originalStart,t.start.toLocalDate()),a.start=t.start.toLocalDate(),_(o,l.start,t.start.toLocalDate()),a.end=t.end.toLocalDate(),_(o,l.end,t.end.toLocalDate()),a.occurrenceId=String(r),_(o,"occurrenceId",String(r)),a.dataItem=o,a}):[]},wn=(e,{timezone:t},{groups:r,ranges:n})=>{const o=[];return l.orderBy(e,[{field:"start",dir:"asc"},{field:"end",dir:"desc"},{field:"isAllDay",dir:"desc"},{field:"title",dir:"asc"},{field:"uid",dir:"asc"}]).forEach(e=>{r.forEach(r=>{const l=!!r.isDefault,s=l?In(e,r):r;(l||Tn(e,s))&&n.forEach(r=>{var n;if(xn(e,r)){const l=k.createRef(),c=k.createRef(),i=r.end<e.end,u=e.start<r.start,d=a.ZonedDate.fromLocalDate(e.start,t),m=a.ZonedDate.fromLocalDate(e.end,t),p={...e,_ref:c,itemRef:l,head:i,tail:u,order:null,zonedStart:d,zonedEnd:m,group:s,range:r,slots:[],isRecurring:!!e.recurrenceRule,isException:!e.recurrenceRule&&null!==e.recurrenceId&&void 0!==e.recurrenceId,isAllDay:!!e.isAllDay,readonly:null!=(n=e.readonly)?n:void 0};o.push(p)}})})}),o},In=(e,t)=>({index:0,resources:t.resources.filter(t=>Rn(e,t))}),Rn=(e,t)=>t.multiple?(e.dataItem[t.field]||[]).some(e=>t[t.valueField]===e):e.dataItem[t.field]===t[t.valueField],Tn=(e,t)=>!t.resources.some(t=>t.multiple?!(e.dataItem[t.field]||[]).some(e=>t[t.valueField]===e):e.dataItem[t.field]!==t[t.valueField]),xn=(e,t)=>P(t.start,t.end,e.start,e.end)&&(void 0===t.isAllDay||!!e.isAllDay==!!t.isAllDay),Mn=e=>{const t=ma(),{timezone:r}=ne(),a=de(),n=ce(),l=pe(),[o]=ga(),s=e.viewItem||Nn.viewItem,c=k.useMemo(()=>Dn([e.dataItem],{dateRange:l,fields:n,timezone:r}),[e.dataItem,l,n,r]),i=k.useMemo(()=>wn(c,{timezone:r},{groups:a,ranges:t}),[c,r,a,t]),u=(o||[]).map(e=>e.current.props);return U(i,u),k.createElement(k.Fragment,null,i.map((t,r)=>k.createElement(s,{key:r,...t,item:e.item,dragHint:!0,vertical:e.vertical,ignoreIsAllDay:e.ignoreIsAllDay})))},Nn={viewItem:fn,item:vn};Mn.displayName="KendoReactSchedulerDrag";const An=e=>{const t=ma(),{timezone:r}=ne(),a=de(),n=ce(),l=pe(),[o]=ga(),s=e.viewItem||_n.viewItem,c=k.useMemo(()=>Dn([e.dataItem],{dateRange:l,fields:n,timezone:r}),[e.dataItem,l.start.getTime(),l.end.getTime(),n,r]),i=k.useMemo(()=>wn(c,{timezone:r},{groups:a,ranges:t}),[c,r,a,t]),u=(o||[]).map(e=>e.current.props);return U(i,u),k.createElement(k.Fragment,null,i.map((t,r)=>{var a;return k.createElement(s,{key:r,...t,format:e.format,item:null!=(a=e.item)?a:_n.item,resizeHint:!0,vertical:e.vertical,ignoreIsAllDay:e.ignoreIsAllDay})}))},_n={viewItem:fn,item:vn};An.displayName="KendoReactSchedulerResize";const zn=k.createContext([null]);zn.displayName="SchedulerEditItemPropsContext";const Ln=k.createContext([null,n.noop,n.noop]);Ln.displayName="SchedulerEditItemFormItemContext";const On=k.createContext([null,n.noop,n.noop]);On.displayName="SchedulerEditItemDragItemContext";const Fn=k.createContext([null,n.noop,n.noop]);Fn.displayName="SchedulerEditItemResizeItemContext";const Wn=k.createContext([null,n.noop,n.noop]);Wn.displayName="SchedulerEditItemRemoveItemContext";const Hn=k.createContext([!1,n.noop,n.noop]);Hn.displayName="SchedulerEditItemShowRemoveDialogContext";const Pn=k.createContext([!1,n.noop,n.noop]);Pn.displayName="SchedulerEditItemShowOccurrenceDialogContext";const $n=({props:e,form:t,drag:r,resize:a,remove:n,showRemoveDialog:l,showOccurrenceDialog:o,children:s})=>k.createElement(zn.Provider,{value:e},k.createElement(Ln.Provider,{value:t},k.createElement(On.Provider,{value:r},k.createElement(Fn.Provider,{value:a},k.createElement(Wn.Provider,{value:n},k.createElement(Hn.Provider,{value:l},k.createElement(Pn.Provider,{value:o},s)))))));var Kn=(e=>(e.set="FORM_ITEM_SET",e.setMaster="FORM_ITEM_SET_MASTER",e.reset="FORM_ITEM_RESET",e.complete="FORM_ITEM_COMPLETE",e))(Kn||{});var Bn=(e=>(e.set="SHOW_OCCURRENCE_DIALOG_SET",e.open="SHOW_OCCURRENCE_DIALOG_OPEN",e.close="SHOW_OCCURRENCE_DIALOG_CLOSE",e.reset="SHOW_OCCURRENCE_DIALOG_RESET",e.toggle="SHOW_OCCURRENCE_DIALOG_TOGGLE",e))(Bn||{});var Vn=(e=>(e.set="REMOVE_ITEM_SET",e.reset="REMOVE_ITEM_RESET",e.complete="REMOVE_ITEM_COMPLETE",e))(Vn||{});var Gn=(e=>(e.set="SHOW_REMOVE_DIALOG_SET",e.open="SHOW_REMOVE_DIALOG_OPEN",e.close="SHOW_REMOVE_DIALOG_CLOSE",e.reset="SHOW_REMOVE_DIALOG_RESET",e.toggle="SHOW_REMOVE_DIALOG_TOGGLE",e))(Gn||{});var Un=(e=>(e.set="DRAG_ITEM_SET",e.start="DRAG_ITEM_START",e.drag="DRAG_ITEM_DRAG",e.complete="DRAG_ITEM_COMPLETE",e.completeOccurrence="DRAG_ITEM_COMPLETE_OCCURRENCE",e.completeSeries="DRAG_ITEM_COMPLETE_SERIES",e.reset="DRAG_ITEM_RESET",e.dragSelected="DRAG_ITEM_DRAG_SELECTED",e))(Un||{});var Zn=(e=>(e.set="RESIZE_ITEM_SET",e.start="RESIZE_ITEM_START",e.startDrag="RESIZE_ITEM_START_DRAG",e.startDragSelected="RESIZE_ITEM_START_DRAG_SELECTED",e.endDrag="RESIZE_ITEM_END_DRAG",e.endDragSelected="RESIZE_ITEM_END_DRAG_SELECTED",e.complete="RESIZE_ITEM_COMPLETE",e.completeOccurrence="RESIZE_ITEM_COMPLETE_OCCURRENCE",e.completeSeries="RESIZE_ITEM_COMPLETE_SERIES",e.reset="RESIZE_ITEM_RESET",e))(Zn||{});var qn=(e=>(e.reset="SERIES_RESET",e.set="SERIES_SET",e.toggle="SERIES_TOGGLE",e))(qn||{});const Yn=(e,t,r)=>{const[a,n]=Se(e,t,r);return[a,n,e=>{const t=((e,t)=>{switch(t.type){case"SERIES_RESET":return null;case"SERIES_SET":return t.payload;case"SERIES_TOGGLE":return!e;default:return e}})(a,e);n(t)}]},jn=e=>!0===e||"object"==typeof e&&null!==e&&!0===e.drag,Xn=k.forwardRef((e,t)=>{const{_ref:r,itemRef:a,onDataAction:l,ignoreIsAllDay:o,viewItem:s,series:c,onSeriesChange:i,form:u,formItem:d,onFormItemChange:m,drag:p,dragItem:g,onDragItemChange:E,resize:v,resizeItem:h,onResizeItemChange:y,removeDialog:f,removeItem:D,onRemoveItemChange:b,occurrenceDialog:C,showOccurrenceDialog:S,onShowOccurrenceDialogChange:w,showRemoveDialog:I,onShowRemoveDialogChange:R,onFocus:T,onFocusAction:x,onMouseDown:M,onMouseDownAction:z,onMouseUp:L,onMouseUpAction:F,onClick:W,onClickAction:H,onDoubleClick:P,onDoubleClickAction:$,onRemoveClick:K,onRemoveClickAction:B,onPress:V,onPressAction:G,onDrag:U,onDragAction:Z,onRelease:q,onReleaseAction:Y,onResizePress:j,onResizePressAction:X,onResizeStartDrag:Q,onResizeStartDragAction:J,onResizeEndDrag:te,onResizeEndDragAction:re,onResizeRelease:ae,onResizeReleaseAction:ne,onOccurrenceClick:le,onOccurrenceClickAction:oe,onSeriesClick:se,onSeriesClickAction:ie,onKeyDown:ue,onKeyDownAction:me,onKeyUp:pe,onKeyUpAction:ge,onRemoveConfirm:Ee,onRemoveConfirmAction:ve,onFormSubmit:he,onFormSubmitAction:ye,onCancel:ke,onCancelAction:De}={...Qn,...e},[Ce,we]=k.useState(e.tabIndex),Ie=k.useRef(null),Re=k.useRef(null),Te=n.useId();k.useImperativeHandle(Ie,()=>({props:e,element:Re.current&&Re.current.element})),k.useImperativeHandle(t,()=>Ie.current),k.useImperativeHandle(r,()=>Re.current),k.useImperativeHandle(a,()=>Re.current);const xe=s||Qn.viewItem,Me=p||Qn.drag,Ne=v||Qn.resize,Ae=u||Qn.form,_e=C||Qn.occurrenceDialog,ze=f||Qn.removeDialog,Le=dn(e.editable),[Oe,Fe]=fa(),[We,,He]=Yn(null,c,i),[Pe,$e,Ke]=((e,t)=>{const[r,a]=Se(...t),l=ce(),[o]=fe();return[r,a,(t,s)=>{let c;switch(t.type){case"FORM_ITEM_SET":c=t.payload;break;case"FORM_ITEM_RESET":c=null;break;case"FORM_ITEM_SET_MASTER":c=n.clone(O(t.payload,l,o));break;case"FORM_ITEM_COMPLETE":e.onDataAction&&r&&(e.onDataAction.call(void 0,{type:ee.update,series:e.series,dataItem:t.payload}),c=null);break;default:c=r}a(c,s)}]})({series:We,onDataAction:l},[null,d,m]),[Be,Ve,Ge]=((e,t)=>{const r=k.useRef(0),a=k.useRef(0),l=k.useRef(0),o=k.useRef(null),[s,c]=Se(...t),[i]=fa(),u=ce(),d=de();return[s,c,t=>{switch(t.type){case"DRAG_ITEM_SET":c(t.payload);break;case"DRAG_ITEM_RESET":c(null);break;case"DRAG_ITEM_DRAG_SELECTED":{if(Math.abs(a.current-t.payload.x)<10&&Math.abs(l.current-t.payload.y)<10)return;const r=N(t.payload.x,t.payload.y,7);if(!r||r===o.current)return;const s=n.clone(e.dataItem),d=r.getAttribute("data-slot-start"),m="true"===r.getAttribute("data-slot-allday");if(!e.ignoreIsAllDay&&m!==e.isAllDay)return;const p=new Date(A(s,u.start)),g=Number(d)-p.getTime(),E=i.map(e=>{if(!e.current)return null;const t=n.clone(e.current.props.dataItem),r=new Date(e.current.props.start.getTime()+g),a=new Date(e.current.props.end.getTime()+g);return _(t,u.start,r),_(t,u.end,a),t}).filter(Boolean);o.current=r,c([...E]);break}case"DRAG_ITEM_START":{const o=t.payload.x,s=t.payload.y;a.current=o,l.current=s;const c=N(o,s,7);if(!c)return;const i=n.clone(e.dataItem),d=c.getAttribute("data-slot-start"),m=A(i,u.start);if(null===d)return;r.current=Number(d)-new Date(m).getTime();break}case"DRAG_ITEM_DRAG":{if(Math.abs(a.current-t.payload.x)<10&&Math.abs(l.current-t.payload.y)<10)return;const s=N(t.payload.x,t.payload.y,7);if(!s||s===o.current)return;const i=n.clone(e.dataItem),m=s.getAttribute("data-slot-start"),p=s.getAttribute("data-slot-group"),g="true"===s.getAttribute("data-slot-allday");if(!e.ignoreIsAllDay&&g!==e.isAllDay)return;const E=new Date(A(i,u.start)),v=new Date(A(i,u.end)).getTime()-E.getTime(),h=new Date(Number(m)-Number(r.current)),y=new Date(Number(m)-Number(r.current)+v),f=d.find(e=>e.index===Number(p));_(i,u.start,h),_(i,u.end,y),f&&d.length>1&&f.resources.forEach(e=>{e.multiple||_(i,e.field,e[e.valueField])}),o.current=s,i&&c(i);break}case"DRAG_ITEM_COMPLETE":c(null),e.onDataAction&&s&&e.onDataAction.call(void 0,{type:ee.update,series:!1,dataItem:s});break;case"DRAG_ITEM_COMPLETE_OCCURRENCE":{const t=Array.isArray(s)?s.slice():n.clone(s);c(null),e.onDataAction&&t&&e.onDataAction.call(void 0,{type:ee.update,series:!1,dataItem:t});break}case"DRAG_ITEM_COMPLETE_SERIES":{let t;if(Array.isArray(s))t=s.map(e=>{const t=n.clone(e);return _(t,u.start,A(e,u.start)),_(t,u.end,A(e,u.end)),t});else{const e=n.clone(s);_(e,u.start,A(s,u.start)),_(e,u.end,A(s,u.end)),t=e}c(null),e.onDataAction&&t&&e.onDataAction.call(void 0,{type:ee.update,series:!0,dataItem:t});break}default:c(s)}}]})({dataItem:e.dataItem,ignoreIsAllDay:e.ignoreIsAllDay,isAllDay:e.isAllDay,onDataAction:l},[null,g,E]),[Ue,Ze,qe]=((e,t)=>{const r=k.useRef(null),[a,l]=Se(...t),[o]=fa(),s=ce();return[a,l,(t,c)=>{let i=a;switch(t.type){case"RESIZE_ITEM_SET":i=t.payload;break;case"RESIZE_ITEM_RESET":default:i=null;break;case"RESIZE_ITEM_START":{if(c.stopPropagation(),!i)return;const a=t.payload.x,l=t.payload.y,o=N(a,l,7);if(!o||o===r.current)return;const u=o.getAttribute("data-slot-start"),d=new Date(Number(u)),m=n.clone(e.dataItem);if(d>=A(m,s.end))return;_(m,s.start,d),r.current=o,i=m;break}case"RESIZE_ITEM_START_DRAG_SELECTED":{c.stopPropagation();const a=t.payload.x,l=t.payload.y,u=n.clone(e.dataItem),d=N(a,l,7);if(!d||d===r.current)return;const m=d.getAttribute("data-slot-start"),p=new Date(A(u,s.start)),g=new Date(Number(m)).getTime()-p.getTime();let E=!1;const v=o.map(e=>{if(!e.current)return null;const t=n.clone(e.current.props.dataItem),r=new Date(e.current.props.start.getTime()+g);if(!(r>=A(t,s.end)))return _(t,s.start,r),t;E=!0}).filter(Boolean);E||(i=[...v]);break}case"RESIZE_ITEM_START_DRAG":{const a=t.payload.x,l=t.payload.y,o=N(a,l,7);if(!o||o===r.current)return;const c=o.getAttribute("data-slot-start"),u=new Date(Number(c)),d=n.clone(e.dataItem);if(u>=d.end)return;_(d,s.start,u),r.current=o,i=d;break}case"RESIZE_ITEM_END_DRAG":{const a=t.payload.x,l=t.payload.y,o=N(a,l,7);if(!o||o===r.current)return;const c=o.getAttribute("data-slot-end"),u=new Date(Number(c)),d=n.clone(e.dataItem);if(u<=d.start)return;_(d,s.end,u),r.current=o,i=d;break}case"RESIZE_ITEM_END_DRAG_SELECTED":{c.stopPropagation();const a=t.payload.x,l=t.payload.y,u=n.clone(e.dataItem),d=N(a,l,7);if(!d||d===r.current)return;const m=d.getAttribute("data-slot-start"),p=new Date(A(u,s.end)),g=new Date(Number(m)).getTime()-p.getTime();let E;const v=o.map(e=>{if(!e.current)return null;const t=n.clone(e.current.props.dataItem),r=new Date(e.current.props.end.getTime()+g);if(!(r<=A(t,s.start)))return _(t,s.end,r),t;E=!0}).filter(Boolean);E||(i=[...v]);break}case"RESIZE_ITEM_COMPLETE":case"RESIZE_ITEM_COMPLETE_OCCURRENCE":i=null,e.onDataAction&&a&&e.onDataAction.call(void 0,{type:ee.update,series:!1,dataItem:a});break;case"RESIZE_ITEM_COMPLETE_SERIES":{let t;if(i=null,Array.isArray(a))t=a.map(e=>{const t=n.clone(e);return _(t,s.start,A(e,s.start)),_(t,s.end,A(e,s.end)),t});else{const e=n.clone(a);_(e,s.start,A(a,s.start)),_(e,s.end,A(a,s.end)),t=e}e.onDataAction&&t&&e.onDataAction.call(void 0,{type:ee.update,series:!0,dataItem:t});break}}l(i)}]})({dataItem:e.dataItem,onDataAction:l},[null,h,y]),[Ye,je,Xe]=((e,t)=>{const[r,a]=Se(...t);return[r,a,t=>{let n;switch(t.type){case"REMOVE_ITEM_SET":n=t.payload;break;case"REMOVE_ITEM_RESET":n=null;break;case"REMOVE_ITEM_COMPLETE":e.onDataAction&&r&&e.onDataAction.call(void 0,{type:ee.remove,series:e.series,dataItem:r}),n=null;break;default:n=r}a(n)}]})({series:We,onDataAction:l},[null,D,b]),[Qe,Je,et]=((e,t,r)=>{const[a,n]=Se(e,t,r);return[a,n,e=>{const t=((e,t)=>{switch(t.type){case"SHOW_REMOVE_DIALOG_RESET":case"SHOW_REMOVE_DIALOG_CLOSE":return!1;case"SHOW_REMOVE_DIALOG_SET":return t.payload;case"SHOW_REMOVE_DIALOG_OPEN":return!0;case"SHOW_REMOVE_DIALOG_TOGGLE":return!e;default:return e}})(a,e);n(t)}]})(!1,I,R),[tt,rt,at]=((e,t,r)=>{const[a,n]=Se(e,t,r);return[a,n,e=>{const t=((e,t)=>{switch(t.type){case"SHOW_OCCURRENCE_DIALOG_RESET":case"SHOW_OCCURRENCE_DIALOG_CLOSE":return!1;case"SHOW_OCCURRENCE_DIALOG_SET":return t.payload;case"SHOW_OCCURRENCE_DIALOG_OPEN":return!0;case"SHOW_OCCURRENCE_DIALOG_TOGGLE":return!e;default:return e}})(a,e);n(t)}]})(!1,S,w),[nt]=va(),[,lt]=k.useContext(ka),[,ot]=ba(),st=!!(Re.current&&Oe&&Oe.some(e=>e.current===Re.current)),ct=k.useMemo(()=>({selected:st,series:We,formItem:Pe,dragItem:Be,resizeItem:Ue,removeItem:Ye,showRemoveDialog:Qe,showOccurrenceDialog:tt}),[Be,Pe,Ye,Ue,st,We,tt,Qe]),it=k.useMemo(()=>({[qn.set]:He,[qn.toggle]:He,[qn.reset]:He,[Sa.select]:Fe,[Sa.add]:Fe,[Sa.remove]:Fe,[Sa.reset]:Fe,[Sa.selectNext]:Fe,[Sa.selectPrev]:Fe,[Kn.set]:Ke,[Kn.setMaster]:Ke,[Kn.reset]:Ke,[Kn.complete]:Ke,[Vn.set]:Xe,[Vn.reset]:Xe,[Vn.complete]:Xe,[Bn.close]:at,[Bn.open]:at,[Bn.set]:at,[Bn.toggle]:at,[Bn.reset]:at,[Gn.close]:et,[Gn.open]:et,[Gn.set]:et,[Gn.toggle]:et,[Gn.reset]:et,[Un.start]:Ge,[Un.drag]:Ge,[Un.complete]:Ge,[Un.completeOccurrence]:Ge,[Un.completeSeries]:Ge,[Un.set]:Ge,[Un.reset]:Ge,[Un.dragSelected]:Ge,[Zn.start]:qe,[Zn.startDrag]:qe,[Zn.startDragSelected]:qe,[Zn.endDrag]:qe,[Zn.endDragSelected]:qe,[Zn.complete]:qe,[Zn.completeOccurrence]:qe,[Zn.completeSeries]:qe,[Zn.set]:qe,[Zn.reset]:qe,[Aa.next]:lt,[Aa.prev]:lt,[Ra.left]:ot,[Ra.right]:ot,[Ra.up]:ot,[Ra.down]:ot,null:()=>{}}),[Ge,Ke,Fe,Xe,qe,He,at,et,lt,ot]),ut=k.useCallback(t=>{if(x){const r=x(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t)):it[r.type]({...r,item:Re}))}T&&T.call(void 0,t)},[it,T,x,e,ct]),dt=k.useCallback(t=>{if(z){const r=z(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t)):it[r.type]({...r,item:Re}))}M&&M.call(void 0,t)},[it,M,z,e,ct]),mt=k.useCallback(t=>{if(F){const r=F(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t)):it[r.type]({...r,item:Re}))}L&&L.call(void 0,t)},[it,L,F,e,ct]),[,pt]=k.useContext(be),gt=k.useCallback(t=>{if(H){pt(Re.current);const r=H(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t)):it[r.type]({...r,item:Re}))}W&&W.call(void 0,t)},[it,W,H,e,ct]),Et=k.useCallback(t=>{if($){const r=$(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t)):it[r.type]({...r,item:Re}))}P&&P.call(void 0,t)},[$,P,e,it,ct]),vt=k.useCallback(t=>{if(B){const r=B(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t)):it[r.type]({...r,item:Re}))}K&&K.call(void 0,t)},[B,K,e,it,ct]),ht=k.useCallback(t=>{if(G){const r=G(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t)):it[r.type]({...r,item:Re},t))}V&&V.call(void 0,t)},[G,V,e,it,ct]),yt=k.useCallback(t=>{if(Z){const r=Z(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t.dragEvent.originalEvent)):it[r.type]({...r,item:Re},t.dragEvent.originalEvent))}U&&U.call(void 0,t)},[Z,U,e,it,ct]),ft=k.useCallback(t=>{if(Y){const r=Y(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t.dragEvent.originalEvent)):it[r.type]({...r,item:Re},t.dragEvent.originalEvent))}q&&q.call(void 0,t)},[Y,q,e,it,ct]),kt=k.useCallback(t=>{if(X){const r=X(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t.dragEvent.originalEvent)):it[r.type]({...r,item:Re},t.dragEvent.originalEvent))}j&&j.call(void 0,t)},[X,j,e,ct,it]),Dt=k.useCallback(t=>{if(J){const r=J(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t.dragEvent.originalEvent)):it[r.type]({...r,item:Re},t.dragEvent.originalEvent))}Q&&Q.call(void 0,t)},[Q,J,e,it,ct]),bt=k.useCallback(t=>{if(re){const r=re(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t.dragEvent.originalEvent)):it[r.type]({...r,item:Re},t.dragEvent.originalEvent))}te&&te.call(void 0,t)},[te,re,e,it,ct]),Ct=k.useCallback(t=>{if(ne){const r=ne(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t.dragEvent.originalEvent)):it[r.type]({...r,item:Re},t.dragEvent.originalEvent))}ae&&ae.call(void 0,t)},[ne,ae,e,it,ct]),St=k.useCallback(t=>{if(ye){const r=ye(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t)):it[r.type]({...r,item:Re},t))}he&&he.call(void 0,t)},[ye,he,e,ct,it]),wt=k.useCallback(t=>{if(De){const r=De(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t)):it[r.type]({...r,item:Re},t))}ke&&ke.call(void 0,t)},[De,ke,e,ct,it]),It=k.useCallback(t=>{if(oe){const r=oe(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t)):it[r.type]({...r,item:Re},t))}le&&le.call(void 0,t)},[oe,le,e,ct,it]),Rt=k.useCallback(t=>{if(ie){const r=ie(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t)):it[r.type]({...r,item:Re},t))}se&&se.call(void 0,t)},[ie,se,e,ct,it]),Tt=k.useCallback(t=>{if(me){const r=me(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t.syntheticEvent)):it[r.type]({...r,item:Re},t.syntheticEvent))}ue&&ue.call(void 0,t)},[me,ue,e,ct,it]),xt=k.useCallback(t=>{if(ge){const r=ge(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t.syntheticEvent)):it[r.type]({...r,item:Re},t.syntheticEvent))}pe&&pe.call(void 0,t)},[ge,pe,e,ct,it]),Mt=k.useCallback(e=>{Xe({type:Vn.set,payload:e.value||Pe}),et({type:Gn.open})},[Xe,et,Pe]),Nt=k.useCallback(t=>{if(ve){const r=ve(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&it[e.type]({...e,item:Re},t.syntheticEvent)):it[r.type]({...r,item:Re},t.syntheticEvent))}Ee&&Ee.call(void 0,t)},[ve,Ee,e,ct,it]),At=k.useCallback(e=>{Pe?(Xe({type:Vn.reset}),et({type:Gn.close})):wt(e)},[Pe,Xe,et,wt]);return k.useEffect(()=>{const t=nt.length&&nt[0].current===Re.current;we(void 0!==e.tabIndex?null===e.tabIndex?void 0:e.tabIndex:0===Oe.length&&t?0:void 0)},[nt,e.tabIndex,Oe.length]),k.createElement($n,{props:e,form:[Pe,$e,Ke],drag:[Be,Ve,Ge],resize:[Ue,Ze,qe],remove:[Ye,je,Xe],showRemoveDialog:[Qe,Je,et],showOccurrenceDialog:[tt,rt,at]},k.createElement(xe,{...e,_ref:Re,itemRef:Re,selected:st,tabIndex:Ce,id:Te,onKeyDown:Tt,onKeyUp:xt,onFocus:ut,onMouseUp:mt,onMouseDown:dt,onClick:gt,onDoubleClick:Et,onRemoveClick:vt,onPress:ht,onDrag:yt,onRelease:ft,onResizePress:kt,onResizeEndDrag:bt,onResizeStartDrag:Dt,onResizeRelease:Ct}),Be&&Le.drag&&(Array.isArray(Be)?Be.map((t,r)=>k.createElement(Me,{key:r,ignoreIsAllDay:o,dataItem:t,vertical:e.vertical,viewItem:xe,item:e.item})):k.createElement(Me,{ignoreIsAllDay:o,dataItem:Be,vertical:e.vertical,viewItem:xe,item:e.item})),Ue&&Le.resize&&(Array.isArray(Ue)?Ue.map((t,r)=>k.createElement(Ne,{key:r,format:e.format,ignoreIsAllDay:o,dataItem:t,viewItem:e.viewItem,item:e.item,vertical:e.vertical})):k.createElement(Ne,{format:e.format,ignoreIsAllDay:o,dataItem:Ue,viewItem:e.viewItem,item:e.item,vertical:e.vertical})),Pe&&!tt&&Le.edit&&k.createElement(Ae,{dataItem:Pe,onSubmit:St,onClose:wt,onCancel:wt,onDelete:Le.remove?Mt:void 0}),tt&&k.createElement(_e,{dataItem:Pe||Be||Ue||Ye,isRemove:null!==Ye,onClose:wt,onOccurrenceClick:It,onSeriesClick:Rt}),Qe&&Ye&&Le.remove&&k.createElement(ze,{dataItem:Ye,isSeries:!0===We,onClose:At,onCancel:At,onConfirm:Nt}))}),Qn={viewItem:fn,drag:Mn,resize:An,form:ca,occurrenceDialog:gn,removeDialog:En,onClickAction:(e,t,r)=>[{type:e.syntheticEvent.metaKey||e.syntheticEvent.ctrlKey?!r.selected||r.dragItem||r.resizeItem?Sa.add:Sa.remove:Sa.select}],onDoubleClickAction:(e,t)=>t.editable?[{type:Kn.set,payload:t.dataItem},t.isRecurring&&{type:Bn.open}].filter(Boolean):[],onRemoveClickAction:(e,t)=>t.editable?[{type:Vn.set,payload:t.dataItem},t.isRecurring?{type:Bn.open}:{type:Gn.open}]:[],onPressAction:(e,t)=>jn(t.editable)?{type:Un.start,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onDragAction:(e,t)=>jn(t.editable)?{type:e.dragEvent.originalEvent.metaKey||e.dragEvent.originalEvent.ctrlKey?Un.dragSelected:Un.drag,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onReleaseAction:(e,t,r)=>jn(t.editable)&&r.dragItem?t.isRecurring&&!t.isException&&null===r.series?{type:Bn.open}:{type:t.isRecurring?r.series?Un.completeSeries:Un.completeOccurrence:Un.complete,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onResizePressAction:(e,t)=>t.editable?{type:Zn.start,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onResizeStartDragAction:(e,t)=>t.editable?{type:e.dragEvent.originalEvent.metaKey||e.dragEvent.originalEvent.ctrlKey?Zn.startDragSelected:Zn.startDrag,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onResizeEndDragAction:(e,t)=>t.editable?{type:e.dragEvent.originalEvent.metaKey||e.dragEvent.originalEvent.ctrlKey?Zn.endDragSelected:Zn.endDrag,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onResizeReleaseAction:(e,t,r)=>t.editable&&r.resizeItem?t.isRecurring&&!t.isException&&null===r.series?{type:Bn.open}:{type:t.isRecurring?r.series?Zn.completeSeries:Zn.completeOccurrence:Zn.complete,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onOccurrenceClickAction:(e,t,r)=>r.dragItem?[{type:Un.completeOccurrence},{type:Bn.close}]:r.resizeItem?[{type:Zn.completeOccurrence},{type:Bn.close}]:r.formItem?[{type:qn.set,payload:!1},{type:Kn.set,payload:t.dataItem},{type:Bn.close}]:r.removeItem?[{type:qn.set,payload:!1},{type:Vn.set,payload:t.dataItem},{type:Gn.open},{type:Bn.close}]:[],onSeriesClickAction:(e,t,r)=>r.dragItem?[{type:Un.completeSeries},{type:Bn.close}]:r.resizeItem?[{type:Zn.completeSeries},{type:Bn.close}]:r.formItem?[{type:qn.set,payload:!0},{type:Kn.setMaster,payload:t.dataItem},{type:Bn.close}]:r.removeItem?[{type:qn.set,payload:!0},{type:Vn.set,payload:t.dataItem},{type:Gn.open},{type:Bn.close}]:[],onKeyDownAction:(e,t)=>{switch(e.syntheticEvent.keyCode){case n.Keys.enter:return t.editable&&!t.readonly?[{type:Kn.set,payload:t.dataItem},t.isRecurring&&{type:Bn.open}]:[];case n.Keys.tab:return[{type:e.syntheticEvent.shiftKey?Aa.prev:Aa.next,ignoreIsAllDay:t.ignoreIsAllDay},{type:e.syntheticEvent.shiftKey?Sa.selectPrev:Sa.selectNext,ignoreIsAllDay:t.ignoreIsAllDay}];case n.Keys.up:return[!(!t.slots.length||!t.slots[0]._ref.current)&&{type:Ra.up,slot:t.slots[0]._ref}];case n.Keys.right:return[!(!t.slots.length||!t.slots[0]._ref.current)&&{type:Ra.right,slot:t.slots[0]._ref}];case n.Keys.down:return[!(!t.slots.length||!t.slots[t.slots.length-1]._ref.current)&&{type:Ra.down,slot:t.slots[t.slots.length-1]._ref}];case n.Keys.left:return[!(!t.slots.length||!t.slots[0]._ref.current)&&{type:Ra.left,slot:t.slots[0]._ref}];default:return}},onFormSubmitAction:e=>[{type:Kn.complete,payload:e.value}],onRemoveConfirmAction:()=>[{type:Vn.complete},{type:Kn.reset},{type:Gn.close},{type:Bn.close}],onCancelAction:()=>[{type:qn.reset},{type:Vn.reset},{type:Kn.reset},{type:Un.reset},{type:Zn.reset},{type:Gn.reset},{type:Bn.reset}]};Xn.displayName="KendoReactSchedulerEditItem";const Jn=e=>{const[t,r]=k.useState(!1),l=re(),o=ne(),s=k.useRef(void 0),c=k.useRef(null),i=k.useRef(null),u=e.updateInterval||el.updateInterval,[,d]=k.useState(!1),m=n.useDir(i,!0===o.rtl?"rtl":void 0),[p]=ga(),g=k.useCallback(()=>{if(!p)return;const t=p.filter(t=>t.current&&(void 0===e.groupIndex||null===e.groupIndex||t.current.props.group.index===e.groupIndex)&&(e.vertical?P(new Date,new Date,t.current.props.start,t.current.props.end,!0):K(new Date,t.current.props.start,t.current.props.end))&&!t.current.props.isAllDay);if(t&&t.length&&c.current&&i.current){const n=T(t);if(!n.current)return;const l=e.vertical?(e=>{let t=0;return e.forEach(e=>{if(e.current){const r=w(e.current.element);t+=r.height}}),t})(t):(e=>{let t=0;return e.forEach(e=>{if(e.current){const r=w(e.current.element);t+=r.width}}),t})(t),o=w(n.current.element),s=w(c.current),u=(e.vertical?o.width:o.height)/(n.current.props.end.getTime()-n.current.props.start.getTime()),d=(Date.now()-((e,t)=>{const r=a.cloneDate(e);return r.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),r})(new Date,n.current.props.start).getTime())*u,p="rtl"===m,g=e.vertical?o.top:o.top+d-s.height/2,E=p?"right":"left",v=e.vertical?o[E]+d-s.width/2:o[E];e.vertical?c.current.style[E]=`${v}px`:c.current.style.top=`${g}px`,i.current.style[E]=`${v}px`,i.current.style.top=`${g}px`,i.current.style[e.vertical?"height":"width"]=l-1+"px",r(!0)}else c.current&&(c.current.style.top="",c.current.style.left="",c.current.style.right=""),i.current&&(i.current.style.top="",i.current.style.left="",i.current.style.right=""),r(!1)},[p,e.groupIndex,e.vertical,m]),E=k.useCallback(()=>{g(),d(e=>!e)},[g]);k.useEffect(()=>{if(!l.current||!window)return;clearInterval(s.current),s.current=window.setInterval(E,u);const e=window.ResizeObserver,t=e&&new e(E);return t&&t.observe(l.current),()=>{clearInterval(s.current),t&&t.disconnect()}},[g,E,l,u]),k.useEffect(g);const v=k.createElement("div",{ref:c,className:n.classNames("k-current-time",{"k-current-time-arrow-right":!e.vertical&&"rtl"!==m,"k-current-time-arrow-left":!e.vertical&&"rtl"===m,"k-current-time-arrow-down":e.vertical}),style:{transform:e.vertical?"rtl"===m?"translateX(50%)":"translateX(-50%)":"translateY(-50%)",visibility:t?void 0:"hidden"}});return k.createElement(k.Fragment,null,e.attachArrow&&e.attachArrow.current?D.createPortal(v,e.attachArrow.current):v,k.createElement("div",{className:"k-current-time",ref:i,style:{transform:e.vertical?"translateX(-50%)":"translateY(-50%)",[e.vertical?"width":"height"]:"1px",visibility:t?void 0:"hidden"}}))},el={updateInterval:6e4},tl=(e,t)=>{const[r,a]=((e,t)=>{const[r,a]=k.useState(t);return void 0!==e?[e,n.noop]:[r,a]})(e,t),l=k.useCallback(()=>{a(!r)},[r,a]);return[r,l]},rl=k.forwardRef((e,t)=>{var r;const{as:a=al.as,...l}=e,s=k.useRef(null),c=k.useRef(null),i=o.useInternationalization(),u=k.useMemo(()=>n.classNames("k-scheduler-cell k-heading-cell",e.className),[e.className]);k.useImperativeHandle(c,()=>({element:s.current&&s.current.element?s.current.element:s.current,props:e})),k.useImperativeHandle(t,()=>c.current);const d=null!=(r=e.format)?r:al.format,m="object"==typeof d&&"skeleton"in d&&"string"==typeof d.skeleton&&d.skeleton.includes("E")&&d.skeleton.includes("d");return k.createElement(a,{ref:a!==al.as?void 0:s,...l,className:u},m?k.createElement(k.Fragment,null,k.createElement("span",{className:"k-scheduler-date-day"},i.formatDate(e.date,"EEE")),k.createElement("span",{className:"k-link k-nav-day","aria-label":i.formatDate(e.date,{skeleton:"Ed"})},i.formatDate(e.date,{skeleton:"d"}))," "):k.createElement("span",{className:"k-link k-nav-day"},i.formatDate(e.date,d)))}),al={as:k.forwardRef(({as:e,format:t,start:r,end:a,...n},l)=>k.createElement("div",{...n,ref:l})),format:"d"};rl.displayName="KendoReactSchedulerDateHeaderCell";const nl=(e,{step:t,timezone:r})=>{const n=[],l=a.ZonedDate.fromLocalDate(e.start,r),o=a.ZonedDate.fromLocalDate(e.end,r);for(let e=l.clone(),r=0;e.getTime()<o.getTime();r++,e=e.addTime(t)){const a=e.clone(),l=a.clone().addTime(t),o=new Date(a.getTime()),s={index:r,end:new Date(l.getTime()),start:o,zonedStart:a,zonedEnd:l};n.push(s)}return n},ll=(e,{step:t},{groups:r,ranges:n})=>{const l=[];return r.forEach(e=>{n.forEach(r=>{const n=r.zonedStart,o=r.zonedEnd,s=o.timezoneOffset-n.timezoneOffset;for(let c=n.clone(),i=0,u=s<0?s*j*-1:0;c.getTime()<o.getTime();){const n=k.createRef(),o=c.clone(),s=c.addTime(t),d=(s.timezoneOffset-o.timezoneOffset)*j,m=t<=Math.abs(d);u&&m&&(u-=t,c=c.addTime(-t));const p=new Date(o.getTime()),g={_ref:n,index:i,end:new Date(s.getTime()),start:p,zonedStart:o,zonedEnd:s,range:r,group:e,items:[],isAllDay:a.MS_PER_DAY<=t};l.push(g),c=c.addTime(t),i++}})}),l},ol=k.createElement("div",{className:"k-scheduler-cell k-side-cell"}),sl=e=>{var t,r,l,s,c,i,u,d,m,p,g,E;const{group:v,timezone:h,resources:y}=ne(),f=o.useInternationalization(),D=e.editItem||Xn,b=e.editSlot||mn,[C]=tl(e.showWorkHours,null!=(t=e.defaultShowWorkHours)?t:cl.defaultShowWorkHours),S=null!=(r=e.numberOfDays)?r:cl.numberOfDays,w=null!=(l=e.slotDivisions)?l:cl.slotDivisions,I=null!=(s=e.slotDuration)?s:cl.slotDuration,R=null!=(c=e.workWeekStart)?c:cl.workWeekStart,M=null!=(i=e.workWeekEnd)?i:cl.workWeekEnd,N=!1!==e.currentTimeMarker&&cl.currentTimeMarker,A=f.parseDate(null!=(d=null!=(u=e.workDayStart)?u:e.isWorkDayStart)?d:cl.isWorkDayStart),_=f.parseDate(null!=(p=null!=(m=e.workDayEnd)?m:e.isWorkDayEnd)?p:cl.isWorkDayEnd),z=f.parseDate(null!=(g=e.startTime)?g:cl.startTime),L=f.parseDate(null!=(E=e.endTime)?E:cl.endTime),[O]=fe(),F=de(),W=Ee(),H=ce(),$=pe(),V=k.useMemo(()=>C?A:z,[C,A,z]),Z=k.useMemo(()=>C?_:L,[C,_,L]),q=k.useMemo(()=>nl($,{step:a.MS_PER_DAY*S,timezone:h}).map(e=>({...e,isAllDay:!0})),[$.start.getTime(),$.end.getTime(),S]),Y=k.useMemo(()=>nl($,{step:a.MS_PER_DAY,timezone:h}).map(e=>({...e,isAllDay:!1})),[$.start.getTime(),$.end.getTime(),h]),X=k.useMemo(()=>ll(0,{step:a.MS_PER_DAY},{groups:F,ranges:q}),[$.start.getTime(),$.end.getTime(),h,q,F]),Q=k.useMemo(()=>ll(0,{step:I*j/w},{groups:F,ranges:Y}).filter(e=>Z.getTime()===V.getTime()||K(e.zonedStart,V,Z)),[$.start.getTime(),$.end.getTime(),I,w,V.getTime(),Z.getTime(),F,Y]),J=k.useMemo(()=>Dn(O,{dateRange:$,fields:H,timezone:h}),[O,$.start.getTime(),$.end.getTime(),H,h]),ee=k.useMemo(()=>J.filter(e=>e.isAllDay),[J]),te=k.useMemo(()=>J.filter(e=>!e.isAllDay),[J]),re=k.useMemo(()=>wn(ee,{timezone:h},{groups:F,ranges:q}),[J,h,F,q]),ae=k.useMemo(()=>wn(te,{timezone:h},{groups:F,ranges:Y}).filter(e=>V.getTime()===Z.getTime()||K(e.zonedStart,V,Z)||K(e.zonedEnd,V,Z)||K(new Date(e.zonedEnd.getTime()-(e.zonedEnd.getTime()-e.zonedStart.getTime())/2),V,Z)),[J,h,F,Y,V.getTime(),Z.getTime()]);k.useMemo(()=>U(re,X,!1),[re,X]),k.useMemo(()=>G(re,X,!1),[re,X]),k.useMemo(()=>U(ae,Q,!1),[ae,Q]),k.useMemo(()=>G(ae,Q,!1),[ae,Q]);const le=k.createElement(za.Consumer,null,({groupIndex:t})=>k.createElement("div",{className:"k-scheduler-row",key:t},Y.map((t,r)=>k.createElement(rl,{as:e.dateHeaderCell,key:r,date:a.ZonedDate.fromLocalDate(new Date(t.zonedEnd.getTime()-(t.zonedEnd.getTime()-t.zonedStart.getTime())/2),h),start:t.start,end:t.end,format:{skeleton:"MEd"}})))),oe=k.createElement(za.Consumer,null,({groupIndex:t})=>k.createElement("div",{key:t,className:"k-scheduler-row"},q.map((r,a)=>X.filter(e=>e.group.index===t&&e.range.index===a).map((r,a,n)=>k.createElement(b,{...r,onDataAction:e.onDataAction,form:e.form,slot:e.slot,viewSlot:e.viewSlot,key:`${r.start.getTime()}:${r.group.index}`,row:0,col:"horizontal"===W?n.length*(t||0)+a:a,isWorkDay:0<=r.zonedStart.getDay()+(S-R)&&(r.zonedStart.getDay()+(S-R))%S<=M+(S-R),expandable:{offsetBottom:25}}))))),se=k.useMemo(()=>n.classNames("week"===e.name?"k-scheduler-weekview":"k-scheduler-dayview",e.className),[e.name,e.className]),ie=k.useCallback((t,r,a)=>Y.map((n,l)=>Q.filter(e=>e.index===t.index&&e.range.index===l&&e.group.index===a).map(t=>k.createElement(b,{key:`${t.start.getTime()}:${t.group.index}`,...t,onDataAction:e.onDataAction,slot:e.slot,viewSlot:e.viewSlot,form:e.form,row:r+1,col:Y.length*(a||0)+l,isWorkHour:K(t.zonedStart,A,_),isWorkDay:B(t.zonedEnd.getDay(),R,M),editable:e.editable}))),[Y,b,e.editable,e.form,e.onDataAction,e.slot,e.viewSlot,Q,_,A,M,R]),ue=k.useCallback((t,r,a)=>X.filter(e=>e.group.index===r&&e.range.index===a).map((a,n)=>k.createElement(b,{slot:e.slot,viewSlot:e.viewSlot,form:e.form,...a,onDataAction:e.onDataAction,key:`${a.start.getTime()}:${a.group.index}`,className:"k-scheduler-alldays-slot",row:t*(r||0)+1*(r||0),col:n,expandable:{offsetBottom:25}})),[b,X,e.form,e.onDataAction,e.slot,e.viewSlot]),me=k.useCallback((t,r,a,n)=>Y.map((l,o)=>Q.filter(e=>e.index===t.index&&e.group.index===a&&e.range.index===o).map(t=>k.createElement(b,{slot:e.slot,viewSlot:e.viewSlot,form:e.form,onDataAction:e.onDataAction,...t,key:`${t.start.getTime()}:${t.group.index}`,row:r.length*(a||0)+n+1*(a||0)+1,col:o,editable:e.editable,isWorkHour:K(t.zonedStart,A,_),isWorkDay:0<=t.zonedStart.getDay()+(S-R)&&(t.zonedStart.getDay()+(S-R))%S<=M+(S-R)}))),[b,S,e.editable,e.form,e.onDataAction,e.slot,e.viewSlot,Y,Q,_,A,M,R]);return k.createElement(_a,{id:e.id,props:e,style:e.style,className:se,ranges:[...q,...Y],slots:[...X,...Q]},k.createElement("div",{className:"k-scheduler-head"},"horizontal"===W?k.createElement(k.Fragment,null,k.createElement(La,{nested:!0,group:v,resources:y,rowContent:Ha,childRowContent:Ha},le),k.createElement(La,{group:v,resources:y,rowContent:qa,childRowContent:qa},oe),re.map(t=>k.createElement(D,{key:t.isRecurring?`${t.uid}:${t.group.index}:${t.range.index}:${t.originalStart}`:`${t.uid}:${t.group.index}:${t.range.index}`,...t,form:e.form,onDataAction:e.onDataAction,item:e.item,viewItem:e.viewItem,editable:e.editable,vertical:!1}))):k.createElement(Pa,{group:v,resources:y,cellContent:ol},le)),k.createElement("div",{className:"k-scheduler-body"},"horizontal"===W?k.createElement(k.Fragment,null,Q.filter(e=>0===e.group.index&&0===e.range.index).map((t,r)=>k.createElement(k.Fragment,{key:t.index},k.createElement(La,{nested:!1,group:v,resources:y,rowContent:Xa,rowContentProps:{timeHeaderCell:e.timeHeaderCell,isMaster:r%w===0,isLast:(r+1)%w===0,slot:t}},k.createElement(za.Consumer,null,({groupIndex:e})=>k.createElement("div",{className:n.classNames("k-scheduler-row",{"k-middle-row":(r+1)%w!==0})},ie(t,r,e)))))),!1!==N&&P(T(Y).start,x(Y).end,new Date,new Date,!0)&&k.createElement(Jn,null)):k.createElement(k.Fragment,null,k.createElement(Pa,{nested:!0,group:v,resources:y},k.createElement(za.Consumer,null,({groupIndex:t})=>k.createElement(k.Fragment,{key:t},k.createElement("div",{className:"k-scheduler-row"},k.createElement(qa,{groupIndex:t},q.map((e,r)=>{const a=Q.filter(e=>e.group.index===t&&0===e.range.index).length;return ue(a,t,r)}))),Q.filter(e=>e.group.index===t&&0===e.range.index).map((r,a,n)=>k.createElement("div",{className:"k-scheduler-row",key:r.index},k.createElement(Xa,{slot:r,isMaster:a%w===0,isLast:(a+1)%w===0,timeHeaderCell:e.timeHeaderCell},me(r,n,t,a)))),!1!==N&&P(T(Y).start,x(Y).end,new Date,new Date,!0)&&k.createElement(Jn,{groupIndex:t})))),re.map(t=>k.createElement(D,{key:t.isRecurring?`${t.uid}:${t.group.index}:${t.range.index}:${t.originalStart}`:`${t.uid}:${t.group.index}:${t.range.index}`,...t,onDataAction:e.onDataAction,viewItem:e.viewItem,item:e.item,form:e.form,editable:e.editable,vertical:!1}))),ae.map(t=>k.createElement(D,{key:t.isRecurring?`${t.uid}:${t.group.index}:${t.range.index}:${t.originalStart}`:`${t.uid}:${t.group.index}:${t.range.index}`,...t,format:"t",onDataAction:e.onDataAction,viewItem:e.viewItem,item:e.item,form:e.form,editable:e.editable,vertical:!0}))))},cl={name:"multi-day",title:"Multi Day",currentTimeMarker:!0,dateRange:({date:e,numberOfDays:t=1,timezone:r})=>{const n=a.ZonedDate.fromLocalDate(e,r),l=a.getDate(n),o=a.addDays(l,t),s=a.ZonedDate.fromUTCDate(L(l),r),c=a.ZonedDate.fromUTCDate(L(o),r);return{start:new Date(s.getTime()),end:new Date(c.getTime()),zonedStart:s,zonedEnd:c}},selectedDateFormat:"{0:M}",selectedShortDateFormat:"{0:m}",numberOfDays:1,startTime:"00:00",endTime:"23:59",isWorkDayStart:"08:00",isWorkDayEnd:"17:00",workWeekStart:a.Day.Monday,workWeekEnd:a.Day.Friday,slotDivisions:2,slotDuration:60,showCurrentTime:!0,defaultShowWorkHours:!0};sl.propTypes={currentTimeMarker:r.bool,name:r.string,numberOfDays:r.number,startTime:r.string,endTime:r.string,workDayStart:r.string,workDayEnd:r.string,workWeekStart:r.number,workWeekEnd:r.any,slotDivisions:r.number,slotDuration:r.number,showWorkHours:r.bool,selectedDateFormat:r.string,selectedShortDateFormat:r.string},sl.displayName="KendoReactSchedulerMultiDayView";const il=e=>k.createElement(sl,{...e}),ul={...cl,name:"day",title:e=>e.toLanguageString(Oe,Cr[Oe]),numberOfDays:1,slotDuration:60,slotDivisions:2,selectedDateFormat:"{0:M}",selectedShortDateFormat:"{0:m}"};il.displayName="KendoReactSchedulerDayView";const dl=Object.freeze({name:"@progress/kendo-react-scheduler",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:1607496606,version:"16.3.0",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui"}),ml=k.forwardRef((e,t)=>{const{_ref:r,onRemoveClick:a}=e,l=k.useRef(null),s=k.useRef(null);k.useImperativeHandle(l,()=>({props:e,element:s.current})),k.useImperativeHandle(t,()=>l.current),k.useImperativeHandle(r,()=>l.current);const c=dn(e.editable),i=e.readonly?{remove:!1}:c,u=o.useLocalization().toLanguageString(We,Cr[We]),m=e.group.resources.find(e=>!(!e.colorField||void 0===e[e.colorField])),p=m&&m.colorField&&m[m.colorField],g=k.useCallback(e=>{a&&a.call(void 0,{syntheticEvent:e,target:l.current})},[a,l]),E=k.useMemo(()=>n.classNames("k-task",e.className),[e.className]);return k.createElement("div",{id:e.id,ref:s,style:e.style,className:E,tabIndex:e.tabIndex||void 0},p&&k.createElement("span",{className:"k-scheduler-mark",style:{color:p,backgroundColor:p}}),e.isRecurring&&k.createElement(n.IconWrap,{name:"arrow-rotate-cw",icon:d.arrowRotateCwIcon}),e.isException&&k.createElement(n.IconWrap,{name:"arrows-no-repeat",icon:d.arrowsNoRepeatIcon}),k.createElement("span",{className:"k-scheduler-task-text"},e.title),i.remove&&k.createElement("a",{className:"k-link k-event-delete",title:u,"aria-label":u,onClick:g},k.createElement(n.IconWrap,{name:"x",icon:d.xIcon})))});ml.displayName="KendoReactSchedulerTask";const pl=k.forwardRef((e,t)=>{const{task:r,_ref:a,...n}=e,l=k.useRef(null),o=k.useRef(null);k.useImperativeHandle(o,()=>({props:e,element:l.current&&l.current.element})),k.useImperativeHandle(a,()=>l.current),k.useImperativeHandle(t,()=>o.current);const s=r||gl.task;return k.createElement(s,{...n,_ref:l})}),gl={task:ml};pl.displayName="KendoReactSchedulerViewTask";const El=k.createContext([null]),vl=k.createContext([!1]),hl=k.createContext([!1]),yl=e=>k.createElement(El.Provider,{value:e.remove},k.createElement(vl.Provider,{value:e.showRemoveDialog},k.createElement(hl.Provider,{value:e.showOccurrenceDialog},e.children))),fl=k.forwardRef((e,t)=>{const{_ref:r,onDataAction:a,viewTask:n,removeDialog:l,removeItem:o,onRemoveItemChange:s,occurrenceDialog:c,showOccurrenceDialog:i,onShowOccurrenceDialogChange:u,showRemoveDialog:d,onShowRemoveDialogChange:m,...p}=e,g=k.useRef(null);k.useImperativeHandle(g,()=>({props:e,element:g.current&&g.current.element})),k.useImperativeHandle(r,()=>g.current),k.useImperativeHandle(t,()=>g.current);const E=n||kl.viewTask,v=c||kl.occurrenceDialog,h=l||kl.removeDialog,y=dn(e.editable),f=ce(),[D,b]=fe(),[C,S]=k.useState(null),[w,I]=Se(null,o,s),[R,T]=Se(!1,d,m),[x,M]=Se(!1,i,u),N=k.useCallback(t=>{y.remove&&(I(e.dataItem,t),e.isRecurring?M(!0,t):T(!0,t))},[I,e.dataItem,e.isRecurring,M,T]),A=k.useCallback(e=>{S(null),I(null,e),T(!1,e),M(!1,e)},[S,I,T,M]),_=k.useCallback(e=>{a&&w&&a.call(void 0,{type:ee.remove,series:C,dataItem:w}),I(null,e),T(!1,e)},[w,b,T]),z=k.useCallback((e,t)=>{I&&I(e,t)},[I]),L=k.useCallback((e,t)=>{T&&T(e,t)},[T]),F=k.useCallback((e,t)=>{M&&M(e,t)},[M]),W=k.useCallback(t=>{w&&(S(!1),I(e.dataItem,t),T(!0,t)),M(!1,t)},[S,e.dataItem,w,I,T]),H=k.useCallback(e=>{if(w){S(!0);const t=O(w,f,D);I(t,e),T(!0,e)}M(!1,e)},[f,w,S,I,T,M]);return k.createElement(yl,{remove:[w,z],showRemoveDialog:[R,L],showOccurrenceDialog:[x,F]},k.createElement(E,{_ref:g,...p,onRemoveClick:N}),x&&k.createElement(v,{dataItem:w,isRemove:null!==w,onClose:A,onOccurrenceClick:W,onSeriesClick:H}),R&&k.createElement(h,{dataItem:w,onClose:A,onCancel:A,onConfirm:_}))}),kl={viewTask:pl,occurrenceDialog:gn,removeDialog:En};fl.displayName="KendoReactSchedulerEditTask";const Dl=e=>{const{group:t,timezone:r,resources:l}=ne(),s=e.editTask||fl,c=e.editSlot||mn,i=k.useRef(null),u=n.useDir(i),m=o.useInternationalization(),p=o.useLocalization(),[g]=fe(),E=de(),v=ce(),h=pe(),y=k.useMemo(()=>nl(h,{step:a.MS_PER_DAY,timezone:r}),[h.start.getTime(),h.end.getTime(),r]),f=k.useMemo(()=>ll(0,{step:a.MS_PER_DAY},{groups:E,ranges:y}),[h.start.getTime(),h.end.getTime(),r,E,y]),D=k.useMemo(()=>Dn(g,{dateRange:h,fields:v,timezone:r}),[g,h.start.getTime(),h.end.getTime(),v,r]),b=k.useMemo(()=>wn(D,{timezone:r},{groups:E,ranges:y}),[D,r,E,y]),C=k.useMemo(()=>n.classNames("k-scheduler-agendaview",e.className),[e.className]);return Ia({element:i,selector:".k-scheduler-datecolumn",explicitDepth:!1}),Ia({element:i,selector:".k-scheduler-timecolumn",explicitDepth:!1}),k.useMemo(()=>U(b,f,!0),[b,f]),k.useMemo(()=>G(b,f,!0),[b,f]),k.createElement(_a,{ref:i,id:e.id,style:e.style,className:C,props:e,slots:b,ranges:y,role:"grid"},k.createElement("div",{className:"k-scheduler-head",role:"rowgroup"},k.createElement(Pa,{resources:l,group:t,role:"presentation"},k.createElement(za.Consumer,null,({groupIndex:e})=>k.createElement("div",{className:"k-scheduler-row",role:"row",key:e},k.createElement("div",{className:"k-scheduler-cell k-heading-cell k-group-cell k-scheduler-datecolumn",role:"columnheader"},p.toLanguageString(Ut,Cr[Ut])),k.createElement("div",{className:"k-scheduler-cell k-heading-cell k-scheduler-timecolumn",role:"columnheader"},p.toLanguageString(Zt,Cr[Zt])),k.createElement("div",{className:"k-scheduler-cell k-heading-cell k-scheduler-eventcolumn",role:"columnheader"},p.toLanguageString(qt,Cr[qt])))))),k.createElement("div",{className:"k-scheduler-body",role:"rowgroup"},k.createElement(Pa,{resources:l,group:t,nested:!0,role:"presentation"},k.createElement(za.Consumer,null,({groupIndex:t})=>f.filter(e=>e.group.index===(t||0)).map((r,a,l)=>k.createElement("div",{className:"k-scheduler-row k-scheduler-content",role:"row",key:`${t}:${a}`},k.createElement(c,{...r,editable:e.editable,row:l.length*(t||0)+a,col:0,slot:e.slot,viewSlot:e.viewSlot,className:"k-scheduler-datecolumn k-group-cell",role:"rowheader"},k.createElement("div",null,k.createElement("strong",{className:"k-scheduler-agendaday"},m.formatDate(r.zonedStart,"dd")),k.createElement("em",{className:"k-scheduler-agendaweek"},m.formatDate(r.zonedStart,"EEEE")),k.createElement("span",{className:"k-scheduler-agendadate"},m.formatDate(r.zonedStart,"y")))),k.createElement("div",{className:"k-scheduler-cell k-group-content",role:"gridcell"},r.items.length?r.items.map((t,r)=>k.createElement("div",{className:"k-scheduler-row",key:r},k.createElement("div",{className:"k-scheduler-cell k-scheduler-timecolumn"},k.createElement("div",null,t.tail&&k.createElement(n.IconWrap,{name:"rtl"===u?"chevron-right":"chevron-left",icon:"rtl"===u?d.chevronRightIcon:d.chevronLeftIcon}),t.isAllDay?p.toLanguageString(Me,Cr[Me]):bl(m,t),t.head&&k.createElement(n.IconWrap,{name:"rtl"===u?"chevron-left":"chevron-right",icon:"rtl"===u?d.chevronLeftIcon:d.chevronRightIcon}))),k.createElement("div",{className:"k-scheduler-cell"},k.createElement(s,{key:`${a}:${r}`,...t,onDataAction:e.onDataAction,task:e.task,viewTask:e.viewTask,editable:e.editable})))):k.createElement("div",{className:"k-scheduler-cell k-heading-cell k-group-cell"},p.toLanguageString(Qt,Cr[Qt])))))))))},bl=(e,t)=>{if(t.head&&t.tail)return e.format("{0:t}-{1:t}",t.range.zonedStart,t.range.zonedEnd);let r="{0:t}-{1:t}";return t.head?r="{0:t}":t.tail&&(r="{1:t}"),e.format(r,t.zonedStart,t.zonedEnd)},Cl={name:"agenda",title:e=>e.toLanguageString(Le,Cr[Le]),dateRange:({intl:e,date:t,numberOfDays:r=1,timezone:n})=>{const l=a.ZonedDate.fromLocalDate(t,n),o=(e=>a.getDate(e))(7===r?a.firstDayInWeek(l,e.firstDay()):l),s=((e,t)=>a.getDate(a.addDays(e,t||1)))(o,r),c=a.ZonedDate.fromUTCDate(L(o),n),i=a.ZonedDate.fromUTCDate(L(s),n);return{start:new Date(c.getTime()),end:new Date(i.getTime()),zonedStart:c,zonedEnd:i}},selectedDateFormat:"{0:M} - {1:M}",selectedShortDateFormat:"{0:m} - {1:m}",slotDuration:1440,slotDivision:1,numberOfDays:7},Sl={title:r.any};Dl.propTypes=Sl,Dl.displayName="KendoReactSchedulerAgendaView";const wl=k.forwardRef((e,t)=>{const r=k.useRef(null),a=k.useRef(null),n=o.useLocalization();k.useImperativeHandle(r,()=>({element:a.current&&a.current.element,...e})),k.useImperativeHandle(t,()=>r.current);const l=k.useCallback(t=>{!e.onClick||!r.current||e.onClick.call(void 0,{target:r.current,syntheticEvent:t})},[r,e.slot,e.onClick]),c=k.useCallback(e=>{e.stopPropagation()},[]),i=k.useCallback(e=>{e.stopPropagation()},[]),u=n.toLanguageString(er,Cr[er]),d=void 0!==e.hiddenCount?`${String(e.hiddenCount)} ${u}`:u;return k.createElement(s.Button,{ref:a,tabIndex:-1,size:"xs",fillMode:"flat",themeColor:"primary",className:"k-more-events",onClick:l,onDoubleClick:i,onFocus:c,"aria-label":d},d)});wl.displayName="KendoReactSchedulerShowMoreItemsButton";const Il={skeleton:"MMM"},Rl={skeleton:"dd"},Tl=e=>{const{show:t,anchor:r,slot:a,itemsPerSlot:l,onDayClick:s,onItemDoubleClick:c,onClose:i}=e,u=o.useInternationalization(),d=o.useLocalization(),m=k.useMemo(()=>a?a.items.filter((e,t)=>t>=l):[],[a,l]),p=k.useCallback(e=>{a&&s&&s(a)},[a,s]);k.useEffect(()=>{if(!t)return;const e=e=>{const t=e.target,a=document.querySelector(".k-scheduler-popover");a&&!a.contains(t)&&r&&!r.contains(t)&&(null==i||i())};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[t,r,i]);const g=k.useCallback(e=>{"Escape"===e.key&&(null==i||i())},[i]);if(!a)return null;const E=new Date(a.zonedEnd.getTime()-(a.zonedEnd.getTime()-a.zonedStart.getTime())/2),v=u.formatDate(E,Il),h=u.formatDate(E,Rl),f=d.toLanguageString(Qt,Cr[Qt]),D=d.toLanguageString(Jt,Cr[Jt]),b=k.createElement(k.Fragment,null,k.createElement("div",{className:"k-month"},v),k.createElement("div",{className:"k-link k-day",onClick:p},h));return k.createElement(y.Popover,{anchor:r,show:t,popoverClass:"k-scheduler-popover",position:"right",collision:{horizontal:"flip",vertical:"flip"},callout:!0,title:b,style:{width:220},onKeyDown:g,animate:{openDuration:1,closeDuration:1}},m.length>0?k.createElement("div",{className:"k-popover-events",role:"list","aria-label":D},m.map((e,t)=>{var r,a;const l=null==(a=null==(r=e.group)?void 0:r.resources)?void 0:a.find(e=>!(!e.colorField||""===e[e.colorField]||void 0===e[e.colorField])),o=(null==l?void 0:l.colorField)&&l[l.colorField],s=o?{backgroundColor:o,borderColor:o}:void 0;return k.createElement("div",{key:e.uid||t,className:n.classNames("k-popover-event k-event",{"k-readonly":!!e.readonly}),role:"listitem",style:s,onDoubleClick:c?t=>c(e,t):void 0},k.createElement("div",{className:"k-event-title"},e.title||""),k.createElement("span",{className:"k-event-time"},u.formatDate(e.zonedStart,"t")))})):k.createElement("span",{className:"k-no-data"},f))};Tl.displayName="KendoReactSchedulerMoreEventsPopover";const xl={skeleton:"dd"},Ml={item:null,phase:"form",series:!1,removeItem:null};function Nl(e,t){switch(t.type){case"open":return{item:t.item,phase:t.isRecurring?"occurrence":"form",series:!1,removeItem:null};case"editOccurrence":return{...e,phase:"form",series:!1};case"editSeries":return{...e,item:t.item,phase:"form",series:!0};case"requestRemove":return{...e,removeItem:t.item};case"cancelRemove":return{...e,removeItem:null};case"reset":return Ml;default:return e}}const Al=e=>{const{group:t,timezone:r,resources:l}=ne(),{onDataAction:s}=e,c=e.editItem||Xn,i=e.editSlot||mn,[u]=fe(),[d,m]=he(),[,p]=De(),g=oe(),E=de(),v=Ee(),h=pe(),y=o.useInternationalization(),f=ce(),D=k.useRef(null),b=e.itemsPerSlot||_l.itemsPerSlot,w=k.useMemo(()=>nl(h,{step:7*a.MS_PER_DAY,timezone:r}),[h.start.getTime(),h.end.getTime(),r]),I=k.useMemo(()=>ll(0,{step:a.MS_PER_DAY},{groups:E,ranges:w}),[h.start.getTime(),h.end.getTime(),E,w]),R=k.useMemo(()=>Dn(u,{dateRange:h,fields:f,timezone:r}),[u,h.start.getTime(),h.end.getTime(),f,r]),T=k.useMemo(()=>wn(R,{timezone:r},{groups:E,ranges:w}),[R,r,E,w]),[x,M]=k.useState({show:!1,anchor:null,slot:null}),[N,A]=k.useReducer(Nl,Ml),_=dn(e.editable),z=e.form||ca,L=k.useCallback(e=>{M({show:!0,anchor:e.target.element,slot:e.target.slot||null})},[]),F=k.useCallback(()=>{M({show:!1,anchor:null,slot:null})},[]),W=k.useCallback(e=>{const t=g.find(e=>"day"===e.props.name);!p||!t||!t.props.name||(p(t.props.name),m(e.start),M({show:!1,anchor:null,slot:null}))},[p,m,g]),H=k.useCallback(e=>{!_.edit||e.readonly||(M({show:!1,anchor:null,slot:null}),A({type:"open",item:e.dataItem,isRecurring:!!e.isRecurring}))},[_.edit]),P=k.useCallback(e=>{e.value&&s&&s({type:ee.update,series:N.series,dataItem:e.value}),A({type:"reset"})},[s,N.series]),$=k.useCallback(()=>{A({type:"reset"})},[]),K=k.useCallback(()=>{A({type:"editOccurrence"})},[]),B=k.useCallback(()=>{if(!N.item)return;const e=O(N.item,f,u);A({type:"editSeries",item:e?n.clone(e):N.item})},[N.item,f,u]),V=k.useCallback(e=>{const t=e.value||N.item;t&&A({type:"requestRemove",item:t})},[N.item]),Z=k.useCallback(()=>{N.removeItem&&s&&s({type:ee.remove,series:N.series,dataItem:N.removeItem}),A({type:"reset"})},[s,N.series,N.removeItem]),q=k.useCallback(()=>{A({type:"cancelRemove"})},[]);k.useMemo(()=>U(T,I,!0),[T,I]),k.useMemo(()=>G(T,I,!0),[T,I]);const j=k.useMemo(()=>C(t,l),[t,l]),X=k.useMemo(()=>S(j,j.length-1),[j]),Q=j.length>0,J=k.createElement(za.Consumer,null,({groupIndex:t})=>k.createElement("div",{className:"k-scheduler-row",key:t},I.filter(e=>e.group.index===t&&0===e.range.index).map((t,n)=>k.createElement(rl,{as:e.dateHeaderCell,key:n,"data-dayslot-index":n,date:a.ZonedDate.fromLocalDate(new Date(t.zonedEnd.getTime()-(t.zonedEnd.getTime()-t.zonedStart.getTime())/2),r),start:t.start,end:t.end,format:{skeleton:"EEEE"}})))),te=k.createElement(za.Consumer,null,({groupIndex:t})=>w.map((r,a)=>k.createElement("div",{className:"k-scheduler-row",key:a},I.filter(e=>e.group.index===t&&e.range.index===a).map((r,l,o)=>k.createElement(i,{slot:e.slot,viewSlot:e.viewSlot,key:l,form:e.form,...r,expandable:{offsetTop:35,offsetBottom:26},onDataAction:e.onDataAction,col:"horizontal"===v?o.length*(t||0)+l:l,row:"horizontal"===v?a:w.length*(t||0)+a,editable:e.editable,className:n.classNames({"k-other-month":r.zonedStart.getMonth()!==d.getMonth()})},k.createElement("span",{className:"k-link k-nav-day"},y.formatDate(r.zonedStart,xl)),b<r.items.length&&k.createElement(wl,{slot:r,hiddenCount:r.items.length-b,onClick:L}))))));return k.createElement(_a,{props:e,slots:I,ranges:w,className:n.classNames("k-scheduler-monthview",e.className)},k.createElement("div",{className:"k-scheduler-head"},"horizontal"===v?k.createElement(La,{nested:!0,resources:l,group:t},J):k.createElement(Pa,{resources:l,group:t},J)),k.createElement("div",{className:"k-scheduler-body",ref:D},"horizontal"===v&&Q?w.map((t,r)=>k.createElement("div",{className:"k-scheduler-group k-group-horizontal",key:r},k.createElement("div",{className:"k-scheduler-row"},X.map((t,a)=>k.createElement("div",{key:a,className:"k-scheduler-cell k-group-cell"},k.createElement(za.Provider,{value:{resource:t,groupIndex:a}},k.createElement("div",{className:"k-scheduler-row"},I.filter(e=>e.group.index===a&&e.range.index===r).map((t,l,o)=>k.createElement(i,{slot:e.slot,viewSlot:e.viewSlot,key:l,form:e.form,...t,expandable:{offsetTop:35,offsetBottom:26},onDataAction:e.onDataAction,col:o.length*a+l,row:r,editable:e.editable,className:n.classNames({"k-other-month":t.zonedStart.getMonth()!==d.getMonth()})},k.createElement("span",{className:"k-link k-nav-day"},y.formatDate(t.zonedStart,xl)),b<t.items.length&&k.createElement(wl,{slot:t,hiddenCount:t.items.length-b,onClick:L})))))))))):"horizontal"===v?k.createElement(La,{resources:l,group:t},te):k.createElement(Pa,{nested:!0,resources:l,group:t},te),T.filter(e=>null===e.order||e.order<b).sort(Y).map(t=>k.createElement(c,{item:e.item,viewItem:e.viewItem,form:e.form,key:t.isRecurring?`${t.uid}:${t.group.index}:${t.range.index}:${t.originalStart}`:`${t.uid}:${t.group.index}:${t.range.index}`,...t,onDataAction:e.onDataAction,slotHeaderOffset:35,vertical:!1,editable:e.editable,ignoreIsAllDay:!0}))),k.createElement(Tl,{show:x.show,anchor:x.anchor,slot:x.slot,items:T,itemsPerSlot:b,onDayClick:W,onItemDoubleClick:H,onClose:F}),N.item&&"form"===N.phase&&_.edit&&k.createElement(z,{dataItem:N.item,onSubmit:P,onCancel:$,onClose:$,onDelete:_.remove?V:void 0}),N.item&&"occurrence"===N.phase&&k.createElement(gn,{dataItem:N.item,onClose:$,onOccurrenceClick:K,onSeriesClick:B}),N.removeItem&&_.remove&&k.createElement(En,{dataItem:N.removeItem,isSeries:N.series,onClose:q,onCancel:q,onConfirm:Z}))},_l={name:"month",dateRange:({intl:e,date:t,timezone:r})=>{const n=a.firstDayInWeek(a.firstDayOfMonth(a.getDate(t)),e.firstDay()),l=a.addDays(a.firstDayInWeek(a.lastDayOfMonth(a.getDate(t)),e.firstDay()),7),o=a.ZonedDate.fromUTCDate(L(n),r),s=a.ZonedDate.fromUTCDate(L(l),r);return{start:new Date(o.getTime()),end:new Date(s.getTime()),zonedStart:o,zonedEnd:s}},slotDuration:1440,slotDivision:1,itemsPerSlot:2,numberOfDays:31,title:e=>e.toLanguageString(Fe,Cr[Fe]),selectedDateFormat:"{0:Y}",selectedShortDateFormat:"{0:y}"},zl={itemsPerSlot:r.number};Al.propTypes=zl,Al.displayName="KendoReactSchedulerMonthView";const Ll=e=>k.createElement(sl,{...e,step:7,numberOfDays:7}),Ol={name:"week",slotDuration:60,slotDivisions:2,numberOfDays:7,dateRange:({intl:e,date:t,timezone:r})=>{const n=a.ZonedDate.fromLocalDate(t,r),l=(e=>a.getDate(e))(a.firstDayInWeek(n,e.firstDay())),o=((e,t)=>a.getDate(a.addDays(e,t)))(l,7),s=a.ZonedDate.fromUTCDate(L(l),r),c=a.ZonedDate.fromUTCDate(L(o),r);return{start:new Date(s.getTime()),end:new Date(c.getTime()),zonedStart:s,zonedEnd:c}},title:e=>e.toLanguageString(_e,Cr[_e]),selectedDateFormat:"{0:M} - {1:M}",selectedShortDateFormat:"{0:m} - {1:m}"};Ll.displayName="KendoReactSchedulerWeekView";const Fl=e=>{const t=pe(),r=Math.round((t.end.getTime()-t.start.getTime())/a.MS_PER_DAY);return k.createElement(sl,{...e,step:7,numberOfDays:r})},Wl={name:"work-week",slotDuration:60,slotDivisions:2,numberOfDays:7,dateRange:({intl:e,date:t,timezone:r,...n})=>{const l=a.ZonedDate.fromLocalDate(t,r),o=void 0!==n.workWeekStart?n.workWeekStart:a.Day.Monday,s=void 0!==n.workWeekEnd?n.workWeekEnd:a.Day.Friday,c=s<o?7+s-o+1:s-o+1,i=a.getDate(((e,t=a.Day.Sunday)=>{let r=e.clone();for(;r.getDay()!==t;)r=r.addDays(-1);return r})(l,o)),u=a.addDays(i,c),d=a.ZonedDate.fromUTCDate(L(i),r),m=a.ZonedDate.fromUTCDate(L(u),r);return{start:new Date(d.getTime()),end:new Date(m.getTime()),zonedStart:d,zonedEnd:m}},title:e=>e.toLanguageString(ze,Cr[ze]),workWeekStart:a.Day.Monday,workWeekEnd:a.Day.Friday,selectedDateFormat:"{0:M} - {1:M}",selectedShortDateFormat:"{0:m} - {1:m}"};Fl.displayName="KendoReactSchedulerWorkWeekView";const Hl=k.createElement("div",{className:"k-scheduler-cell k-side-cell"}),Pl=e=>k.createElement(k.Fragment,null,k.createElement("div",{className:"k-sticky-cell"},Hl),e.children),$l=e=>{const t=o.useLocalization();return k.createElement(k.Fragment,null,k.createElement("div",{className:"k-sticky-cell"},k.createElement("div",{className:"k-scheduler-cell k-heading-cell k-side-cell k-scheduler-times-all-day","data-range-index":0},t.toLanguageString(xe,Cr[xe]))),e.children)},Kl=e=>{var t;const{group:r,timezone:l,resources:s}=ne(),c=k.useRef(null),i=k.useRef(null),u=e.editItem||Xn,d=e.editSlot||mn,m=k.useRef(null),[p]=fe(),g=Ee(),E=de(),v=pe(),h=ce(),y=o.useInternationalization(),[f]=tl(e.showWorkHours,null!=(t=e.defaultShowWorkHours)?t:Bl.defaultShowWorkHours),D=e.slotDivisions||Bl.slotDivisions,b=e.slotDuration||Bl.slotDuration,C=e.workWeekStart||Bl.workWeekStart,S=e.workWeekEnd||Bl.workWeekEnd,w=y.parseDate(e.workDayStart||e.isWorkDayStart||Bl.isWorkDayStart),I=y.parseDate(e.workDayEnd||e.isWorkDayEnd||Bl.isWorkDayEnd),R=y.parseDate(e.startTime||Bl.startTime),M=y.parseDate(e.endTime||Bl.endTime),N=k.useMemo(()=>f?w:R,[f,w,R]),A=k.useMemo(()=>f?I:M,[f,I,M]),_=k.useMemo(()=>nl(v,{step:a.MS_PER_DAY,timezone:l}),[v.start.getTime(),v.end.getTime(),l]),z=k.useMemo(()=>ll(0,{step:b/D*a.MS_PER_MINUTE},{groups:E,ranges:_}).filter(e=>K(e.zonedStart,N,A)||N.getTime()===A.getTime()),[E,_,v.start.getTime(),v.end.getTime(),l,b,D,N.getTime(),A.getTime()]),O=k.useMemo(()=>Dn(p,{dateRange:v,fields:h,timezone:l}),[p,v.start.getTime(),v.end.getTime(),h,l]),F=k.useMemo(()=>wn(O,{timezone:l},{groups:E,ranges:_}).filter(e=>N.getTime()===A.getTime()||K(e.zonedStart,N,A)||K(e.zonedEnd,N,A)||K(new Date(e.zonedEnd.getTime()-(e.zonedEnd.getTime()-e.zonedStart.getTime())/2),N,A)),[O,l,E,_,N.getTime(),A.getTime()]);k.useMemo(()=>U(F,z,!0),[F,z]),k.useMemo(()=>G(F,z,!0),[F,z]);const W=("horizontal"===g?z.length:z.length/E.length)*((e.columnWidth||Bl.columnWidth)+1),H=k.createElement(za.Consumer,null,()=>k.createElement(k.Fragment,null,k.createElement("div",{className:"k-scheduler-row"},_.map((t,r)=>k.createElement(rl,{as:e.dateHeaderCell,key:r,date:t.zonedStart,start:t.start,end:t.end,format:"m"}))),k.createElement("div",{className:"k-scheduler-row",ref:c},_.map((t,r)=>z.filter(e=>0===e.group.index&&e.range.index===r).map(t=>t.zonedStart.getMinutes()%b===0?k.createElement(Ya,{key:t.index,as:e.timeHeaderCell,format:"t",date:t.zonedStart,start:t.zonedStart,end:t.zonedEnd}):null))))),$=k.createElement(za.Consumer,null,({groupIndex:t})=>k.createElement("div",{className:"k-scheduler-row"},_.map((r,n)=>z.filter(e=>e.group.index===t&&e.range.index===n).map((r,o,s)=>{const c=a.ZonedDate.fromUTCDate(L(r.zonedStart),l),i=B(c.getDay(),C,S);return k.createElement(d,{key:`${r.start.getTime()}:${r.group.index}`,slot:e.slot,viewSlot:e.viewSlot,...r,form:e.form,onDataAction:e.onDataAction,isWorkHour:K(r.zonedStart,w,I),isWorkDay:i,col:"horizontal"===g?n*s.length+o+s.length*_.length*(t||0):n*s.length+o,row:"horizontal"===g?0:t||0,expandable:{offsetBottom:25},editable:e.editable})})))),V=k.useMemo(()=>n.classNames("k-scheduler-timelineview",e.className),[e.className]);Ia({element:m,selector:".k-resource-cell",attribute:"data-depth-index",explicitDepth:!0});const Z=m.current?m.current.closest(".k-scheduler-layout"):null;return yn({element:Z,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:F&&!F.length}),k.createElement(_a,{ref:m,id:e.id,style:{...e.style},className:V,props:e,slots:z,ranges:_},k.createElement("div",{className:"k-scheduler-head",style:{width:W}},"horizontal"===g?k.createElement(La,{nested:!0,group:r,resources:s,rowContent:Pl},H):k.createElement(Pa,{wrapGroup:!0,group:r,resources:s},H)),k.createElement("div",{className:"k-scheduler-body",style:{width:W},ref:i},"horizontal"===g?k.createElement(La,{group:r,resources:s,rowContent:$l},$,k.createElement(za.Consumer,null,({groupIndex:t})=>e.currentTimeMarker&&P(T(_).start,x(_).end,new Date,new Date,!0)&&k.createElement(Jn,{groupIndex:t,attachArrow:c,vertical:!0}))):k.createElement(Pa,{nested:!0,wrapGroup:!0,group:r,resources:s},$),"vertical"===g&&e.currentTimeMarker&&P(T(_).start,x(_).end,new Date,new Date,!0)&&k.createElement(Jn,{attachArrow:c,vertical:!0}),F.sort(Y).map((t,r)=>k.createElement(u,{key:t.isRecurring?`${t.uid}:${t.group.index}:${t.range.index}:${t.originalStart}`:`${t.uid}:${t.group.index}:${t.range.index}`,...t,format:"t",form:e.form,onDataAction:e.onDataAction,item:e.item,viewItem:e.viewItem,editable:e.editable,ignoreIsAllDay:!0,vertical:!1,isLast:r===F.length-1}))))},Bl={name:"multi-day-timeline",title:"Multi Day Timeline",currentTimeMarker:!0,dateRange:({date:e,numberOfDays:t=1,timezone:r})=>{const n=a.ZonedDate.fromLocalDate(e,r),l=a.getDate(n),o=a.addDays(l,t),s=a.ZonedDate.fromUTCDate(L(l),r),c=a.ZonedDate.fromUTCDate(L(o),r);return{start:new Date(s.getTime()),end:new Date(c.getTime()),zonedStart:s,zonedEnd:c}},selectedDateFormat:"{0:M}",selectedShortDateFormat:"{0:m}",numberOfDays:1,startTime:"00:00",endTime:"00:00",isWorkDayStart:"8:00",isWorkDayEnd:"17:00",workWeekStart:a.Day.Monday,workWeekEnd:a.Day.Friday,slotDivisions:2,slotDuration:60,defaultShowWorkHours:!0,columnWidth:100},Vl=e=>k.createElement(Kl,{...e}),Gl={...Bl,name:"timeline",title:e=>e.toLanguageString(Ae,Cr[Ae]),slotDuration:60,slotDivisions:2,numberOfDays:1,selectedDateFormat:"{0:M}",selectedShortDateFormat:"{0:m}"};Vl.displayName="KendoReactSchedulerTimelineView";const Ul=new Map;Ul.set(Dl,Cl),Ul.set(il,ul),Ul.set(Al,_l),Ul.set(Ll,Ol),Ul.set(Fl,Wl),Ul.set(Vl,Gl);const Zl=k.forwardRef((e,t)=>{var r,l,i,u;const m=!n.validatePackage(dl,{component:"Scheduler"}),p=n.getLicenseMessage(dl),{timezone:g,onDataChange:E}=e,v=k.useRef(null),h=k.useRef(null);k.useImperativeHandle(h,()=>({props:e,element:v.current})),k.useImperativeHandle(t,()=>h.current),n.useWebMcpRegister("scheduler",h,e,e.webMcp);const y=n.useRtl(v),f=o.useInternationalization(),D=o.useLocalization(),{fields:S}=k.useMemo(()=>(e=>({fields:{...$,...e}}))(e.modelFields),[e.modelFields]),[w,I]=Se(e.defaultDate||ql.defaultDate,e.date,e.onDateChange),R=k.Children.toArray(e.children||[]).map(e=>{var t;return k.isValidElement(e)?k.cloneElement(e,{...Ul.get(e.type),...null!=(t=e.props)?t:{}}):e}),T=k.cloneElement(k.createElement(il,null),Ul.get(il)),[x,M]=Se(e.defaultView||R[0]&&R[0].props.name||"day",e.view,e.onViewChange),N=R.find(e=>e.props.name===x)||R[0]||T,z=N.props,[L,F]=Se(null==(r=z.defaultShowWorkHours)||r,z.showWorkHours),W=(null!=(l=e.data)?l:ql.data)||ql.data,H=((e,t)=>{const r=C(e,t),a=b(r);return 1===a.length&&0===a[0].length?[{index:0,isDefault:!0,resources:(t||[]).reduce((e,t)=>[...e,...t.data.map(e=>({...e,field:t.field,valueField:t.valueField,colorField:t.colorField,multiple:t.multiple}))],[])}]:a.map((e,t)=>({index:t,resources:e}))})(e.group,e.resources),P=e.group&&e.group.orientation?e.group.orientation:"horizontal",K=N.props.selectedDateFormat||"{0:D}",B=N.props.selectedShortDateFormat||"{0:d}",V=N.props.slotDuration,G=void 0!==N.props.dateRange?"function"==typeof N.props.dateRange?N.props.dateRange.call(void 0,{intl:f,date:w,timezone:g,numberOfDays:N.props.numberOfDays,workWeekStart:N.props.workWeekStart||f.firstDay(),workWeekEnd:N.props.workWeekEnd||(f.firstDay()+N.props.numberOfDays)%6}):N.props.dateRange:{start:ql.defaultDate,end:ql.defaultDate},U=k.useCallback(({created:e=[],updated:t=[],deleted:r=[]})=>{if(E){const a={created:e,updated:t,deleted:r};E.call(void 0,a)}},[E]),Z=k.useCallback(e=>{const t=[e.dataItem];U({created:t})},[U]),q=k.useCallback(e=>{const t=[],r=[];if(e.series)if(Array.isArray(e.dataItem)){const t=e.dataItem[0];if(null!==A(t,S.recurrenceId)&&void 0!==A(t,S.recurrenceId)){const e=n.clone(O(t,S,W)),a=new Date(A(t,S.originalStart)).getTime(),l=new Date(A(t,S.start)).getTime(),o=new Date(A(t,S.end)).getTime(),s=l-a,c=o-l,i=new Date(A(e,S.start)).getTime();_(e,S.start,new Date(i+s)),_(e,S.end,new Date(i+s+c));const u=A(e,S.recurrenceExceptions)||[];if(u.length>0&&0!==s){const t=u.map(e=>new Date(new Date(e).getTime()+s));_(e,S.recurrenceExceptions,t)}r.push(e)}else e.dataItem.forEach(e=>{const t=n.clone(O(e,S,W)),a=n.clone(e);_(a,S.originalStart,A(t,S.originalStart)),_(a,S.recurrenceId,A(t,S.recurrenceId));const l=A(t,S.recurrenceExceptions)||[],o=new Date(A(t,S.start)).getTime(),s=new Date(A(a,S.start)).getTime()-o;if(l.length>0&&0!==s){const e=l.map(e=>new Date(new Date(e).getTime()+s));_(a,S.recurrenceExceptions,e)}else _(a,S.recurrenceExceptions,l);r.push(a)})}else if(null!==A(e.dataItem,S.recurrenceId)&&void 0!==A(e.dataItem,S.recurrenceId)){const t=n.clone(O(e.dataItem,S,W)),a=new Date(A(e.dataItem,S.originalStart)).getTime(),l=new Date(A(e.dataItem,S.start)).getTime(),o=new Date(A(e.dataItem,S.end)).getTime(),s=l-a,c=o-l,i=new Date(A(t,S.start)).getTime();_(t,S.start,new Date(i+s)),_(t,S.end,new Date(i+s+c));const u=A(t,S.recurrenceExceptions)||[];if(u.length>0&&0!==s){const e=u.map(e=>new Date(new Date(e).getTime()+s));_(t,S.recurrenceExceptions,e)}r.push(t)}else{const t=n.clone(e.dataItem);if(A(t,S.recurrenceRule)){const r=n.clone(O(e.dataItem,S,W));_(t,S.originalStart,A(r,S.originalStart)),_(t,S.recurrenceId,A(r,S.recurrenceId));const a=A(r,S.recurrenceExceptions)||[],l=new Date(A(r,S.start)).getTime(),o=new Date(A(t,S.start)).getTime()-l;if(a.length>0&&0!==o){const e=a.map(e=>new Date(new Date(e).getTime()+o));_(t,S.recurrenceExceptions,e)}else _(t,S.recurrenceExceptions,a)}else _(t,S.recurrenceExceptions,null);r.push(t)}else if(Array.isArray(e.dataItem))e.dataItem.forEach(e=>{const a=null!==A(e,S.recurrenceRule)&&void 0!==A(e,S.recurrenceRule);if(null!==A(e,S.recurrenceId)&&void 0!==A(e,S.recurrenceId)&&a){const a=n.clone(O(e,S,W)),l=A(e,S.originalStart),o=A(a,S.recurrenceExceptions)||[];_(a,S.recurrenceExceptions,[...o,l]),_(e,S.recurrenceRule,null),r.push(a),t.push(e)}else r.push(e)});else{const a=null!==A(e.dataItem,S.recurrenceRule)&&void 0!==A(e.dataItem,S.recurrenceRule);if(null!==A(e.dataItem,S.recurrenceId)&&void 0!==A(e.dataItem,S.recurrenceId)&&a){const a=n.clone(O(e.dataItem,S,W)),l=A(e.dataItem,S.originalStart),o=A(a,S.recurrenceExceptions)||[];_(a,S.recurrenceExceptions,[...o,l]),_(e.dataItem,S.recurrenceRule,null),r.push(a),t.push(e.dataItem)}else r.push(e.dataItem)}U({updated:r,created:t})},[U,S,W]),Y=k.useCallback(e=>{const t=[],r=[];if(e.series){const t=n.clone(O(e.dataItem,S,W)),a=n.clone(e.dataItem);_(a,S.originalStart,A(t,S.originalStart)),_(a,S.recurrenceId,A(t,S.recurrenceId)),_(a,S.recurrenceRule,A(t,S.recurrenceRule)),_(a,S.recurrenceExceptions,A(t,S.recurrenceExceptions)),r.push(a)}else if(null===A(e.dataItem,S.recurrenceRule)||void 0===A(e.dataItem,S.recurrenceRule))r.push(e.dataItem);else{const r=n.clone(O(e.dataItem,S,W)),a=A(e.dataItem,S.originalStart),l=A(r,S.recurrenceExceptions)||[];_(r,S.recurrenceExceptions,[...l,a]),_(e.dataItem,S.recurrenceRule,null),t.push(r)}U({updated:t,deleted:r})},[U,S,W]),j=k.useCallback(e=>{switch(e.type){case ee.create:Z(e);break;case ee.update:q(e);break;case ee.remove:Y(e)}},[Z,Y,q]),X=k.useCallback((e,t)=>{M(e,{...t,target:h.current})},[M,h]),Q=k.useCallback((e,t)=>{I(e,{...t,target:h.current})},[I,h]),J=k.useCallback(e=>{e.value&&I(e.value,{...e,target:h.current,nativeEvent:e.nativeEvent})},[I,h]),te=k.useCallback(e=>{var t,r;e.preventDefault();const n=null!=(r=null!=(t=N.props.step)?t:N.props.numberOfDays)?r:1,l=n>27?a.addMonths(w,Math.round(n/27)):a.addDays(w,n);I(l,e)},[w,I,N.props.numberOfDays,N.props.step]),re=k.useCallback(e=>{var t,r;e.preventDefault();const n=null!=(r=null!=(t=N.props.step)?t:N.props.numberOfDays)?r:1,l=n>27?a.addMonths(w,-Math.round(n/27)):a.addDays(w,-n);I(l,e)},[w,I,N.props.numberOfDays,N.props.step]),ae=k.useCallback(e=>{e.preventDefault();const t=a.ZonedDate.fromLocalDate(new Date,g);I(new Date(t.getTime()),e)},[I,g]),ne=k.useCallback(()=>{F(!L)},[F,L]),le=k.useCallback(()=>{v.current&&(v.current.style.boxShadow="0 0.5px 0.5px 0.5px rgba(0, 0, 0, .12)")},[v]),oe=k.useCallback(()=>{v.current&&(v.current.style.boxShadow="")},[v]),se=k.useMemo(()=>{var t;return{...e.style,height:null!=(t=e.height)?t:ql.height}},[e.height,e.style]),ce=k.useMemo(()=>n.classNames({"k-rtl":void 0!==e.rtl?e.rtl:"rtl"===y},"k-scheduler",e.className),[e.className,e.rtl,y]),ie=D.toLanguageString(Ne,Cr[Ne]),ue=D.toLanguageString(He,Cr[He]),de=D.toLanguageString(Pe,Cr[Pe]),me=D.toLanguageString(kr,Cr[kr]),pe=D.toLanguageString(br,Cr[br]),ge=k.useRef(null),Ee=(e=>{const[t,r]=k.useState(0),a=k.useRef(0),n=k.useRef(!1);return k.useEffect(()=>{const t=e.current;if(!t||"undefined"==typeof ResizeObserver)return;const l={childList:!0,subtree:!0,characterData:!0},o=()=>{if(!n.current&&0!==t.offsetWidth){for(n.current=!0,i.disconnect();a.current>0;)if(a.current--,c.flushSync(()=>r(a.current)),t.scrollWidth>t.offsetWidth){a.current++,c.flushSync(()=>r(a.current));break}for(;t.scrollWidth>t.offsetWidth&&a.current<3;)a.current++,c.flushSync(()=>r(a.current));i.observe(t,l),n.current=!1}},s=new ResizeObserver(o);s.observe(t);const i=new MutationObserver(o);return i.observe(t,l),()=>{s.disconnect(),i.disconnect()}},[e]),t})(ge),ve=N.props.header||e.header||ql.header,he=N.props.footer||e.footer||ql.footer,ye=N.props.form||e.form||ca,[fe,ke]=k.useState(null),[De,be]=k.useState(null),we=k.useCallback(e=>{e.preventDefault();const t=new Date,r=V||30,a=60*r*1e3,n=t.getMinutes(),l=Math.ceil(n/r)*r;let o=new Date(t);o.setHours(t.getHours()+Math.floor(l/60),l%60,0,0);const s=(e,t)=>W.some(r=>{const a=A(r,S.start),n=A(r,S.end);return!(!a||!n)&&(a.getTime()<t.getTime()&&n.getTime()>e.getTime())});let c=new Date(o.getTime()+a);for(let e=0;e<48&&s(o,c);e++)o=new Date(o.getTime()+a),c=new Date(o.getTime()+a);const i={};_(i,S.start,o),_(i,S.end,c),_(i,S.isAllDay,!1),_(i,S.title,""),_(i,S.description,""),be(i)},[W,S,V]),Ie=k.useCallback(e=>{e.value&&U({created:[e.value]}),be(null)},[U]),Re=k.useCallback(e=>{be(null)},[]),Te=k.useCallback(e=>{be(null)},[]),xe="object"==typeof e.editable?e.editable.add:!!e.editable;return k.createElement(Ce,{element:v,props:e,views:R,fields:S,groups:H,dateRange:G,orientation:P,dateFormat:{dateFormat:K,shortDateFormat:B},date:[w,Q],activeView:[x,X],selection:[fe,ke],data:[W,j]},k.createElement("div",{ref:v,id:e.id,style:se,className:ce,tabIndex:null!=(i=e.tabIndex)?i:ql.tabIndex,dir:y,role:e.role||"application","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-activedescendant":fe&&fe.props.id||void 0,onFocus:le,onBlur:oe},k.createElement(ve,{ref:e=>{var t;ge.current=null!=(t=null==e?void 0:e.element)?t:null},ariaLabel:pe,style:{flexWrap:Ee<3?"nowrap":"wrap"}},xe&&k.createElement(s.Button,{className:"k-toolbar-button",themeColor:"primary",svgIcon:d.plusIcon,"aria-label":me,tabIndex:-1,onClick:we},Ee<2&&me),Ee<2&&k.createElement(s.Button,{className:"k-toolbar-button",fillMode:"flat",tabIndex:-1,onClick:ae},ie),Ee<3&&k.createElement(s.ButtonGroup,{className:"k-button-group-flat k-toolbar-button-group"},k.createElement(s.Button,{fillMode:"flat",tabIndex:-1,svgIcon:"rtl"===y?d.chevronRightIcon:d.chevronLeftIcon,"aria-label":ue,title:ue,onClick:re}),k.createElement(s.Button,{fillMode:"flat",tabIndex:-1,svgIcon:"rtl"===y?d.chevronLeftIcon:d.chevronRightIcon,"aria-label":de,title:de,onClick:te})),k.createElement(Sr,{value:w,onChange:J,level:Ee}),k.createElement(s.ToolbarSpacer,null),1===Ee&&k.createElement("span",{className:"k-separator"}),k.createElement(wr,{level:Ee})),N&&k.createElement(N.type,{editable:null!=(u=e.editable)?u:ql.editable,key:N.props.name,item:e.item,viewItem:e.viewItem,editItem:e.editItem,task:e.task,viewTask:e.viewTask,editTask:e.viewTask,slot:e.slot,viewSlot:e.viewSlot,editSlot:e.editSlot,form:e.form,onDataAction:j,showWorkHours:L,...N.props}),(N.props.footer||e.footer||"agenda"!==x&&"month"!==x)&&k.createElement(he,{ariaLabel:pe},"agenda"!==x&&"month"!==x&&V&&V<1440&&k.createElement(s.Button,{className:"k-toolbar-button k-scheduler-fullday",tabIndex:-1,onClick:ne,svgIcon:d.clockIcon},D.toLanguageString(L?$e:Ke,Cr[L?$e:Ke]))),m&&k.createElement(n.WatermarkOverlay,{message:p}),De&&k.createElement(ye,{dataItem:De,onSubmit:Ie,onCancel:Re,onClose:Te})))}),ql={data:[],height:600,tabIndex:-1,editable:!1,defaultDate:new Date,header:we,footer:Te,navigation:Ie,viewSelector:Re};Zl.propTypes={data:r.array,editable:r.oneOfType([r.bool,r.shape({add:r.bool,drag:r.bool,edit:r.bool,remove:r.bool,resize:r.bool})]),view:r.string,defaultView:r.string,date:r.any,defaultDate:r.any,rtl:r.bool,height:r.oneOfType([r.number,r.string]),children:r.any,timezone:r.string,group:r.any,resources:r.any,modelFields:r.shape({id:r.string,start:r.string,startTimezone:r.string,end:r.string,endTimezone:r.string,isAllDay:r.string,title:r.string,description:r.string,recurrenceRule:r.string,recurrenceId:r.string,recurrenceException:r.string})},Zl.displayName="KendoReactScheduler";const Yl=k.forwardRef((e,t)=>{const{item:r,_ref:a,itemRef:l,...s}=e,c=k.useRef(void 0),i=k.useRef(null),u=k.useRef(null),m=k.useRef(null);k.useImperativeHandle(u,()=>({props:e,element:i.current&&i.current.element})),k.useImperativeHandle(t,()=>u.current),k.useImperativeHandle(a,()=>i.current),k.useImperativeHandle(l,()=>i.current);const p=r||jl.item,g=o.useInternationalization(),[E]=va(),[v]=ga(),h=re(),[y,f]=k.useState(!0),[D,b]=k.useState(!1),C=k.useRef(0),S=k.useRef(null),I=k.useRef([]),M=n.useDir(h),N=k.useMemo(()=>{var t,r;return e.isAllDay?null!=(t=e.title)?t:"":`(${g.format("{0:t} - {1:t}",e.zonedStart,e.zonedEnd)}): ${null!=(r=e.title)?r:""}`},[g,e.isAllDay,e.title,e.zonedEnd,e.zonedStart]);let A;e.isRecurring&&!e.isException?A="recurring":!e.isRecurring&&e.isException&&(A="non-recurring");const _=k.useMemo(()=>g.format("{0:t} – {1:t}",e.zonedStart,e.zonedEnd),[g,e.zonedStart,e.zonedEnd]),z=()=>{var t,r,a,n,l;const o=v.filter(t=>t.current&&((t,r)=>t.group.index===r.group.index&&t.range.index===r.range.index&&(void 0===t.range.isAllDay||void 0===r.range.isAllDay||t.range.isAllDay===r.range.isAllDay)&&(e.ignoreIsAllDay||t.isAllDay===r.isAllDay))(t.current.props,e)).sort((e,t)=>e.current.props.start.getTime()-t.current.props.start.getTime()),s=o.filter(t=>P(t.current.props.start,t.current.props.end,e.start,e.end)),c=i.current&&i.current.element;if(!c||!s.length)return;const u=T(o),d=x(o),m=T(s),p=x(s);if(!(m.current&&i.current&&p.current&&u.current&&d.current))return;if(!P(m.current.props.start,p.current.props.end,e.start,e.end))return void f(!1);const g=[],h=[],y=[],k=w(m.current.element),D=(e.vertical?k.height:k.width)/(m.current.props.end.getTime()-m.current.props.start.getTime()),M=(e.vertical?12:8)/D,N=(Math.min(e.start.getTime(),p.current.props.end.getTime()-M)-m.current.props.start.getTime())*D,A=Math.floor(Math.min(e.end.getTime(),p.current.props.end.getTime())-Math.max(e.start.getTime(),m.current.props.start.getTime()))*D;(E||[]).forEach(e=>{e.current&&(e.current.props.dragHint?h.push(e.current):e.current.props.resizeHint?y.push(e.current):g.push(e.current))}),I.current=((t,r,a)=>{const[n,l]=r,o=new Date(Math.min(l.props.end.getTime()-a,Math.max(e.start.getTime(),n.props.start.getTime()))),s=new Date(Math.max(o.getTime()+a,Math.min(e.end.getTime(),l.props.end.getTime())));return t.filter(t=>{const r=Math.max(Math.min(l.props.end.getTime()-a,t.props.start.getTime()),n.props.start.getTime()),c=Math.min(Math.max(r+a,t.props.end.getTime()),l.props.end.getTime());return t.props.id!==e.id&&t.props.group.index===e.group.index&&t.props.range.index===e.range.index&&(e.ignoreIsAllDay||t.props.isAllDay===e.isAllDay)&&P(new Date(r),new Date(c),o,s)&&P(n.props.start,l.props.end,t.props.start,t.props.end)})})(g,[u.current,d.current],M),S.current=e.resizeHint||e.dragHint?0:((e,t)=>{const r=new Set;return t.forEach(e=>{void 0!==e._order&&null!==e._order&&r.add(e._order)}),V(Array.from(r))})(i.current,I.current);let _=1;e.resizeHint||e.dragHint||(_=((e,t)=>{var r;let a=null!=(r=e._order)?r:0;return t.forEach(e=>{void 0!==e._order&&null!==e._order&&a<e._order&&(a=e._order)}),a+1})(i.current,I.current));let z=0;const L=k;I.current.forEach(e=>{let t=0;void 0!==e._order&&null!==e._order&&e._order<S.current&&(t=w(e.element).top+w(e.element).height-L.top-1*S.current+1),t>z&&(z=t)});L.width=e.vertical?L.width/_-1-20/_:A-1,e.vertical?L.height=A-1:(e.resizeHint||e.dragHint)&&_<=1||(L.height=null!=(r=null==(t=e.style)?void 0:t.height)?r:12),L.left=e.vertical?L.left+(null!=(a=S.current)?a:0)+1*(null!=(n=S.current)?n:0)*L.width:L.left+(N<0?0:N),L.top=e.vertical?L.top+(N<0?0:N):L.top+z+1*(null!=(l=S.current)?l:0),C.current=_,R(c,L),b(!0),f(!0)},L=k.useCallback(e=>{const t=e&&e[0],r=m.current;void 0!==c.current&&window.cancelAnimationFrame(c.current),r&&t&&(r.width!==t.contentRect.width||r.height!==t.contentRect.height)&&(c.current=window.requestAnimationFrame(()=>{z()})),m.current={width:t.contentRect.width,height:t.contentRect.height}},[z]);k.useEffect(z);const O=i.current&&i.current.element?i.current.element.closest(".k-scheduler-layout"):null;return yn({element:O,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:e.isLast}),k.useEffect(()=>{if(!h.current)return;const e=window.ResizeObserver,t=e&&new e(L);return t&&t.observe(h.current),()=>{t&&t.disconnect()}},[L,h]),k.createElement(p,{...s,_ref:i,_order:S,_maxSiblingsPerSlot:C,_siblings:I,itemRef:i,style:{visibility:D?void 0:"hidden",display:y?void 0:"none",...e.style}},!e.resizeHint&&k.createElement(k.Fragment,null,e.tail&&!e.vertical&&k.createElement("span",{className:"k-event-continuation"},k.createElement(n.IconWrap,{name:"rtl"===M?"chevron-right":"chevron-left",icon:"rtl"===M?d.chevronRightIcon:d.chevronLeftIcon})),k.createElement("div",{title:N},e.tail&&e.vertical&&k.createElement("span",{className:"k-event-continuation"},k.createElement(n.IconWrap,{name:"chevron-up",icon:d.chevronUpIcon})),k.createElement(hn,{className:"k-event-title"},e.title),k.createElement(hn,{className:"k-event-time"},"recurring"===A&&k.createElement("span",{className:"k-event-recurrence-icon"},k.createElement(n.IconWrap,{name:"arrow-rotate-cw",icon:d.arrowRotateCwIcon})),"non-recurring"===A&&k.createElement("span",{className:"k-event-recurrence-icon"},k.createElement(n.IconWrap,{name:"arrows-no-repeat",icon:d.arrowsNoRepeatIcon})),_),e.head&&e.vertical&&k.createElement("span",{className:"k-event-continuation"},k.createElement(n.IconWrap,{name:"chevron-down",icon:d.chevronDownIcon}))),A&&k.createElement("span",{className:"k-event-recurrence-icon"},k.createElement(n.IconWrap,{name:"recurring"===A?"arrow-rotate-cw":"arrows-no-repeat",icon:"recurring"===A?d.arrowRotateCwIcon:d.arrowsNoRepeatIcon})),e.head&&!e.vertical&&k.createElement("span",{className:"k-event-continuation"},k.createElement(n.IconWrap,{name:"rtl"===M?"chevron-left":"chevron-right",icon:"rtl"===M?d.chevronLeftIcon:d.chevronRightIcon}))))}),jl={item:vn};Yl.displayName="KendoReactSchedulerProportionalViewItem",e.AgendaView=Dl,e.DATA_ACTION=ee,e.DRAG_ITEM_ACTION=Un,e.DateHeaderCell=rl,e.DayView=il,e.ITEMS_FOCUS_ACTION=Aa,e.ITEMS_SELECT_ACTION=Sa,e.MonthView=Al,e.REMOVE_ITEM_ACTION=Vn,e.RESIZE_ITEM_ACTION=Zn,e.RemoveRecurrenceConfirmDialog=ra,e.SERIES_ACTION=qn,e.SHOW_OCCURRENCE_DIALOG_ACTION=Bn,e.SHOW_REMOVE_DIALOG_ACTION=Gn,e.SLOTS_FOCUS_ACTION=Ra,e.SLOTS_SELECT_ACTION=wa,e.Scheduler=Zl,e.SchedulerActiveViewContext=ke,e.SchedulerDataContext=ye,e.SchedulerDateContext=ve,e.SchedulerDateRangeContext=me,e.SchedulerDrag=Mn,e.SchedulerEditItem=Xn,e.SchedulerEditItemDragItemContext=On,e.SchedulerEditItemFormItemContext=Ln,e.SchedulerEditItemPropsContext=zn,e.SchedulerEditItemRemoveItemContext=Wn,e.SchedulerEditItemResizeItemContext=Fn,e.SchedulerEditItemShowOccurrenceDialogContext=Pn,e.SchedulerEditItemShowRemoveDialogContext=Hn,e.SchedulerEditSlot=mn,e.SchedulerEditSlotFormItemContext=cn,e.SchedulerEditSlotPropsContext=sn,e.SchedulerEditTask=fl,e.SchedulerFieldsContext=se,e.SchedulerFooter=Te,e.SchedulerForm=ca,e.SchedulerFormEditor=aa,e.SchedulerGroupsContext=ue,e.SchedulerHeader=we,e.SchedulerItem=vn,e.SchedulerItemContent=hn,e.SchedulerOccurrenceDialog=gn,e.SchedulerOrientationContext=ge,e.SchedulerProportionalViewItem=Yl,e.SchedulerPropsContext=ae,e.SchedulerRecurrenceDialog=ta,e.SchedulerRemoveDialog=En,e.SchedulerResize=An,e.SchedulerSlot=Qa,e.SchedulerTask=ml,e.SchedulerViewItem=fn,e.SchedulerViewSlot=ln,e.SchedulerViewTask=pl,e.SchedulerViewsContext=le,e.TimeHeaderCell=Ya,e.TimelineView=Vl,e.WeekView=Ll,e.WorkWeekView=Fl,e.agendaViewDefaultProps=Cl,e.dateHeaderCellDefaultProps=al,e.dayViewDefaultProps=ul,e.monthViewDefaultProps=_l,e.schedulerDefaultProps=ql,e.schedulerDragDefaultProps=Nn,e.schedulerEditItemDefaultProps=Qn,e.schedulerEditSlotDefaultProps=pn,e.schedulerEditTaskDefaultProps=kl,e.schedulerFormDefaultProps=ia,e.schedulerFormEditorDefaultProps=sa,e.schedulerProportionalViewItemDefaultProps=jl,e.schedulerResizeDefaultProps=_n,e.schedulerSlotDefaultProps=Ja,e.schedulerViewItemDefaultProps=kn,e.schedulerViewSlotDefaultProps=on,e.schedulerViewTaskDefaultProps=gl,e.timeHeaderCellDefaultProps=ja,e.timeLineViewDefaultProps=Gl,e.useSchedulerActiveViewContext=De,e.useSchedulerDataContext=fe,e.useSchedulerDateContext=he,e.useSchedulerDateRangeContext=pe,e.useSchedulerEditItemDragItemContext=()=>k.useContext(On),e.useSchedulerEditItemFormItemContext=()=>k.useContext(Ln),e.useSchedulerEditItemPropsContext=()=>k.useContext(zn),e.useSchedulerEditItemRemoveItemContext=()=>k.useContext(Wn),e.useSchedulerEditItemResizeItemContext=()=>k.useContext(Fn),e.useSchedulerEditItemShowOccurrenceDialogContext=()=>k.useContext(Pn),e.useSchedulerEditItemShowRemoveDialogContext=()=>k.useContext(Hn),e.useSchedulerEditSlotFormItemContext=()=>k.useContext(cn),e.useSchedulerEditSlotPropsContext=()=>k.useContext(sn),e.useSchedulerFieldsContext=ce,e.useSchedulerGroupsContext=de,e.useSchedulerOrientationContext=Ee,e.useSchedulerPropsContext=ne,e.useSchedulerViewsContext=oe,e.weekViewDefaultProps=Ol,e.workWeekDefaultProps=Wl});
15
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types"),require("@progress/kendo-date-math"),require("@progress/kendo-react-common"),require("@progress/kendo-data-query"),require("@progress/kendo-react-intl"),require("@progress/kendo-react-buttons"),require("react-dom"),require("@progress/kendo-react-dateinputs"),require("@progress/kendo-react-popup"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-form"),require("@progress/kendo-react-dialogs"),require("@progress/kendo-recurrence"),require("@progress/kendo-react-labels"),require("@progress/kendo-react-inputs"),require("@progress/kendo-react-dropdowns"),require("@progress/kendo-react-tooltip")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-date-math","@progress/kendo-react-common","@progress/kendo-data-query","@progress/kendo-react-intl","@progress/kendo-react-buttons","react-dom","@progress/kendo-react-dateinputs","@progress/kendo-react-popup","@progress/kendo-svg-icons","@progress/kendo-react-form","@progress/kendo-react-dialogs","@progress/kendo-recurrence","@progress/kendo-react-labels","@progress/kendo-react-inputs","@progress/kendo-react-dropdowns","@progress/kendo-react-tooltip"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactScheduler={},e.React,e.PropTypes,e.KendoDateMath,e.KendoReactCommon,e.KendoDataQuery,e.KendoReactIntl,e.KendoReactButtons,e.ReactDOM,e.KendoReactDateinputs,e.KendoReactPopup,e.KendoSvgIcons,e.KendoReactForm,e.KendoReactDialogs,e.KendoRecurrence,e.KendoReactLabels,e.KendoReactInputs,e.KendoReactDropdowns,e.KendoReactTooltip)}(this,function(e,t,r,a,n,l,o,s,c,i,u,d,m,p,g,v,h,E,y){"use strict";function f(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}var k=f(t),D=f(c);const C=(e,t=0,r=0,a=[])=>{if(e.length<=t)return[a];const n=[];return e[t].data.map(l=>{n.push(...C(e,t+1,r+1,[...a,{...l,field:e[t].field,valueField:e[t].valueField,colorField:e[t].colorField,multiple:e[t].multiple}]))}),n};function b(e,t){const r=[];if(!t||!t.length)return r;if(e&&e.resources&&e.resources.length){const a=e.resources;for(let e=0;e<a.length;e++){const n=t.find(t=>t.name===a[e]);r.push(n)}}return r}const S=(e,t=e.length-1)=>{const r=Math.max(0,t),a=[];e&&e.length||(e=[{}]);const n=(e[r].data||[]).map(t=>({...t,text:t[e[r].textField]}))||[],l=n.length;let o=1;for(let t=0;t<=r;t++)o*=(e[t].data||[]).length||1;for(let e=0;e<o;e++)n[e%l]&&a.push(n[e%l]);return a},w=e=>{if(!e)return{top:0,left:0,width:0,height:0,right:0};return{top:e.offsetTop,left:e.offsetLeft,right:e.offsetParent?e.offsetParent.offsetWidth-(e.offsetLeft+e.offsetWidth):0,width:e.offsetWidth,height:e.offsetHeight}},I=(e,t=!1)=>parseFloat(window.getComputedStyle(e)[t?"paddingLeft":"paddingTop"]||"0")+parseFloat(window.getComputedStyle(e)[t?"paddingRight":"paddingBottom"]||"0"),R=(e,t,r=!1)=>{e&&(void 0!==t.top&&(e.style.top=`${t.top}px`),void 0!==t.left&&(e.style.left=`${t.left}px`),void 0!==t.width&&(e.style.width=`${t.width}px`),void 0!==t.height&&!r&&(e.style.height="number"==typeof t.height?`${t.height}px`:t.height),r&&(e.style.minHeight=void 0!==t.height&&t.height>0?`${t.height}px`:""))},T=e=>e[0],x=e=>e[e.length-1],A=(e,t,r)=>{const n=a.ZonedDate.fromLocalDate(e,r),l=a.ZonedDate.fromLocalDate(t,r),o=a.getDate(n).getTime(),s=a.getDate(l).getTime(),c=0===l.getHours()&&0===l.getMinutes()&&0===l.getSeconds()&&0===l.getMilliseconds()?s-1:s;return o!==a.getDate(new Date(c)).getTime()},M=e=>{const t=new Set;return e.forEach(e=>{t.add(e.field)}),t.size===e.length};const N=(e,t,r,a=0)=>{if(a===r)return null;let n=null;const l=document.elementFromPoint(e,t);if(!l)return n;if("true"===l.getAttribute("data-slot"))return l;const o=l.style.pointerEvents;return l.style.pointerEvents="none",n=N(e,t,r,a+1),l.style.pointerEvents=o,n},L=(e,t)=>n.getter(t)(e),z=(e,t,r)=>{if(t)return n.setter(t)(e,r)},_=e=>null!=e;function F(e){return new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))}const O=(e,t,r)=>{const a=W(e,t)?L(e,t.id):L(e,t.recurrenceId);return r.find(e=>L(e,t.id)===a)},W=(e,t)=>{const r=L(e,t.id),a=L(e,t.recurrenceId),n=L(e,t.recurrenceRule);return null!=r&&!!n&&null==a},P=(e,t)=>Math.max(e.getTime(),t.getTime()),H=(e,t)=>Math.min(e.getTime(),t.getTime()),$=(e,t,r,a,n=!1)=>n?P(t,a)-H(e,r)<=t.getTime()-e.getTime()+(a.getTime()-r.getTime()):P(t,a)-H(e,r)<t.getTime()-e.getTime()+(a.getTime()-r.getTime()),K={id:"id",start:"start",startTimezone:"startTimezone",originalStart:"originalStart",end:"end",endTimezone:"endTimezone",isAllDay:"isAllDay",title:"title",description:"description",recurrenceRule:"recurrenceRule",recurrenceId:"recurrenceId",recurrenceExceptions:"recurrenceExceptions",readonly:"readonly"},B=(e,t,r)=>(t.getHours()<e.getHours()||t.getHours()===e.getHours()&&t.getMinutes()<=e.getMinutes())&&(e.getHours()<r.getHours()||r.getHours()===e.getHours()&&e.getMinutes()<r.getMinutes()),V=(e,t,r)=>t<r?t<=e&&e<=r:e<=r||t<=e,G=e=>{let t=0;const r=e.slice();return r.sort((e,t)=>e-t).forEach((e,a)=>{r[a]===a&&(t=a+1)}),t},U=(e,t,r=!1)=>{e.forEach(e=>{e.order=null}),t.forEach(e=>e.items.splice(0,e.items.length));const a=[...e].sort((e,t)=>e.start.getTime()-t.start.getTime());t.forEach(e=>{const t=[];a.forEach(a=>{if((r||a.isAllDay===e.isAllDay)&&a.range.index===e.range.index&&(void 0===a.range.isAllDay||void 0===e.range.isAllDay||a.range.isAllDay===e.range.isAllDay)&&a.group.index===e.group.index&&$(a.start,a.end,e.start,e.end)){if(null!==a.order&&void 0!==a.order)t.includes(a.order)||(t.push(a.order),t.sort((e,t)=>e-t));else{const e=G(t);a.order=e,t.push(e),t.sort((e,t)=>e-t)}e.items.push(a)}})})},q=(e,t,r=!1)=>{e.forEach(e=>e.slots.splice(0,e.slots.length)),e.forEach(e=>{t.forEach(t=>{(r||e.isAllDay===t.isAllDay)&&e.range.index===t.range.index&&(void 0===e.range.isAllDay||void 0===t.range.isAllDay||e.range.isAllDay===t.range.isAllDay)&&e.group.index===t.group.index&&$(e.start,e.end,t.start,t.end)&&e.slots.push(t)})})},Z=(...e)=>{},Y=(e,t,r=!1,a=!1)=>{const n=e.current;if(!n||!t)return null;const o=t.filter(e=>null!==e.current&&null!==e.current.element),s=l.orderBy(o,[{field:"current.props.group.index",dir:"asc"},{field:"current.props.range.index",dir:"asc"},r?{field:""}:{field:"current.props.isAllDay",dir:"desc"},{field:"current.props.start",dir:"asc"}]),c=s.findIndex(e=>null!==e.current&&!(e.current.props.uid!==n.props.uid||void 0!==e.current.props.occurrenceId&&e.current.props.occurrenceId!==n.props.occurrenceId||e.current.props.group.index!==n.props.group.index||e.current.props.range.index!==n.props.range.index||!r&&e.current.props.isAllDay!==n.props.isAllDay));return s[c+(a?-1:1)]},j=(e,t)=>(e.order||0)-(t.order||0),X=6e4,Q=[{}],J=new Date(1900,0,1),ee=new Date(2099,11,31);a.ZonedDate.fromLocalDate(J),a.ZonedDate.fromLocalDate(ee);var te=(e=>(e[e.create=0]="create",e[e.update=1]="update",e[e.remove=2]="remove",e))(te||{});const re=k.createContext({current:null}),ae=()=>k.useContext(re);re.displayName="SchedulerElementContext";const ne=k.createContext({}),le=()=>k.useContext(ne);ne.displayName="SchedulerPropsContext";const oe=k.createContext([]),se=()=>k.useContext(oe);oe.displayName="SchedulerViewsContext";const ce=k.createContext(K),ie=()=>k.useContext(ce);ce.displayName="SchedulerFieldsContext";const ue=k.createContext({dateFormat:"{0:D}",shortDateFormat:"{0:d}"});ue.displayName="SchedulerDateFormatContext";const de=k.createContext([{index:0,resources:[]}]),me=()=>k.useContext(de);de.displayName="SchedulerGroupsContext";const pe=k.createContext({start:new Date,end:new Date,zonedStart:a.ZonedDate.fromLocalDate(new Date),zonedEnd:a.ZonedDate.fromLocalDate(new Date)}),ge=()=>k.useContext(pe);pe.displayName="SchedulerDateRangeContext";const ve=k.createContext(null),he=()=>k.useContext(ve);ve.displayName="SchedulerOrientationContext";const Ee=k.createContext([new Date,Z]),ye=()=>k.useContext(Ee);Ee.displayName="SchedulerDateContext";const fe=k.createContext([[],Z]),ke=()=>k.useContext(fe);fe.displayName="SchedulerDataContext";const De=k.createContext(["day",Z]),Ce=()=>k.useContext(De);De.displayName="SchedulerActiveViewContext";const be=k.createContext([null,()=>{}]);be.displayName="SchedulerItemSelectionContext";const Se=({children:e,element:t,props:r,views:a,fields:n,groups:l,dateRange:o,dateFormat:s,orientation:c,date:i,data:u,activeView:d,selection:m})=>k.createElement(re.Provider,{value:t},k.createElement(ne.Provider,{value:r},k.createElement(oe.Provider,{value:a},k.createElement(ce.Provider,{value:n},k.createElement(ue.Provider,{value:s},k.createElement(de.Provider,{value:l},k.createElement(pe.Provider,{value:o},k.createElement(ve.Provider,{value:c},k.createElement(Ee.Provider,{value:i},k.createElement(fe.Provider,{value:u},k.createElement(De.Provider,{value:d},k.createElement(be.Provider,{value:m},e)))))))))))),we=(e,t,r)=>{const[a,n]=k.useState(t||e),l=k.useCallback((e,t)=>{n(e),r&&r.call(void 0,{...t,value:e})},[r,n]);return[void 0!==t?t:a,l]},Ie=k.forwardRef((e,t)=>{const{className:r,...a}=e,l=k.useRef(null),o=k.useRef(null);k.useImperativeHandle(o,()=>({element:l.current,props:e})),k.useImperativeHandle(t,()=>o.current);const c=k.useMemo(()=>n.classNames("k-scheduler-toolbar",r),[r]);return k.createElement(s.Toolbar,{id:e.id,ref:e=>{e&&(l.current=e.element)},className:c,...a},e.children)});Ie.displayName="KendoReactSchedulerHeader";const Re=k.forwardRef((e,t)=>{const{className:r,...a}=e,l=k.useRef(null);return k.useImperativeHandle(t,()=>({element:l.current,props:e})),k.createElement(s.ToolbarItem,{ref:e=>{e&&(l.current=e.element)},className:n.classNames(r),...a},e.children)});Re.displayName="KendoReactSchedulerSchedulerNavigation";const Te=k.forwardRef((e,t)=>{const{className:r,...a}=e,l=k.useRef(null);return k.useImperativeHandle(t,()=>({element:l.current,props:e})),k.createElement(s.ToolbarItem,{ref:e=>{e&&(l.current=e.element)},className:n.classNames("k-scheduler-views",r),...a},e.children)});Te.displayName="KendoReactSchedulerViewSelector";const xe=k.forwardRef((e,t)=>{const{className:r,style:a,...l}=e,o=k.useRef(null),c=k.useRef(null);k.useImperativeHandle(o,()=>({element:c.current,props:e})),k.useImperativeHandle(t,()=>o.current);const i=k.useMemo(()=>n.classNames("k-scheduler-footer",e.className),[e.className]);return k.createElement(s.Toolbar,{ref:e=>{e&&(c.current=e.element)},className:i,style:{boxShadow:"none",...a},...l},e.children)});xe.displayName="KendoReactSchedulerFooter";const Ae="scheduler.allEvents",Me="scheduler.allDay",Ne="scheduler.today",Le="scheduler.timelineViewTitle",ze="scheduler.weekViewTitle",_e="scheduler.workWeekViewTitle",Fe="scheduler.agendaViewTitle",Oe="scheduler.dayViewTitle",We="scheduler.monthViewTitle",Pe="scheduler.deleteTitle",He="scheduler.previousTitle",$e="scheduler.nextTitle",Ke="scheduler.showFullDay",Be="scheduler.showWorkDay",Ve="scheduler.editOccurrence",Ge="scheduler.editSeries",Ue="scheduler.editRecurringConfirmation",qe="scheduler.editRecurringDialogTitle",Ze="scheduler.editSave",Ye="scheduler.editCancel",je="scheduler.editorTitle",Xe="scheduler.editorEventTitle",Qe="scheduler.editorEventStart",Je="scheduler.editorEventStartTimeZone",et="scheduler.editorEventEnd",tt="scheduler.editorEventEndTimeZone",rt="scheduler.editorEventAllDay",at="scheduler.editorEventDescription",nt="scheduler.editorEventSeparateTimeZones",lt="scheduler.editorEventTimeZone",ot="scheduler.recurrenceEditorRepeat",st="scheduler.recurrenceEditorDailyInterval",ct="scheduler.recurrenceEditorDailyRepeatEvery",it="scheduler.recurrenceEditorWeeklyInterval",ut="scheduler.recurrenceEditorWeeklyRepeatEvery",dt="scheduler.recurrenceEditorWeeklyRepeatOn",mt="scheduler.recurrenceEditorMonthlyDay",pt="scheduler.recurrenceEditorMonthlyInterval",gt="scheduler.recurrenceEditorMonthlyRepeatEvery",vt="scheduler.recurrenceEditorMonthlyRepeatOn",ht="scheduler.recurrenceEditorYearlyOf",Et="scheduler.recurrenceEditorYearlyRepeatEvery",yt="scheduler.recurrenceEditorYearlyRepeatOn",ft="scheduler.recurrenceEditorYearlyInterval",kt="scheduler.recurrenceEditorFrequenciesDaily",Dt="scheduler.recurrenceEditorFrequenciesMonthly",Ct="scheduler.recurrenceEditorFrequenciesNever",bt="scheduler.recurrenceEditorFrequenciesWeekly",St="scheduler.recurrenceEditorFrequenciesYearly",wt="scheduler.recurrenceEditorOffsetPositionsFirst",It="scheduler.recurrenceEditorOffsetPositionsSecond",Rt="scheduler.recurrenceEditorOffsetPositionsThird",Tt="scheduler.recurrenceEditorOffsetPositionsFourth",xt="scheduler.recurrenceEditorOffsetPositionsLast",At="scheduler.recurrenceEditorWeekdaysDay",Mt="scheduler.recurrenceEditorWeekdaysWeekday",Nt="scheduler.recurrenceEditorWeekdaysWeekendday",Lt="scheduler.recurrenceEditorEndAfter",zt="scheduler.recurrenceEditorEndOccurrence",_t="scheduler.recurrenceEditorEndLabel",Ft="scheduler.recurrenceEditorEndNever",Ot="scheduler.recurrenceEditorEndOn",Wt="scheduler.editorDelete",Pt="scheduler.deleteConfirmation",Ht="scheduler.deleteSeriesConfirmation",$t="scheduler.deleteRecurringConfirmation",Kt="scheduler.deleteOccurrence",Bt="scheduler.deleteSeries",Vt="scheduler.deleteDialogTitle",Gt="scheduler.deleteSeriesDialogTitle",Ut="scheduler.deleteRecurringDialogTitle",qt="scheduler.dateTitle",Zt="scheduler.timeTitle",Yt="scheduler.eventTitle",jt="scheduler.editorValidationRequired",Xt="scheduler.editorValidationStart",Qt="scheduler.editorValidationEnd",Jt="scheduler.noEvents",er="scheduler.popoverEvents",tr="scheduler.moreEvents",rr="scheduler.resetTimezoneDialogTitle",ar="scheduler.resetTimezoneConfirmation",nr="scheduler.resetTimezoneNo",lr="scheduler.resetTimezoneYes",or="scheduler.recurrenceEditorDialogTitle",sr="scheduler.recurrenceEditorRemoveRecurrence",cr="scheduler.removeRecurrenceConfirmation",ir="scheduler.removeRecurrenceNo",ur="scheduler.removeRecurrenceYes",dr="scheduler.recurrenceCustomEventsDialogTitle",mr="scheduler.recurrenceCustomEventsConfirmation",pr="scheduler.recurrenceCustomEventsKeep",gr="scheduler.recurrenceCustomEventsReset",vr="scheduler.recurrenceCustomEventsCancel",hr="scheduler.editorDiscardChangesDialogTitle",Er="scheduler.editorDiscardChangesConfirmation",yr="scheduler.editorDiscardChangesDiscard",fr="scheduler.editorDiscardChangesCancel",kr="scheduler.recurrenceEditorWeeklyRepeatOnDays",Dr="scheduler.editorMakeRecurring",Cr="scheduler.editorEditRecurrence",br="scheduler.editorTimezoneButton",Sr="scheduler.editorSetTimezoneTitle",wr="scheduler.editorResetTimezoneTitle",Ir="scheduler.editorResetTimezoneAriaLabel",Rr="scheduler.editorStartTimeAriaLabel",Tr="scheduler.editorEndTimeAriaLabel",xr="scheduler.editorDateConnectorFrom",Ar="scheduler.editorDateConnectorTo",Mr="scheduler.editorNewEvent",Nr="scheduler.editorEditEvent",Lr="scheduler.toolbarLabel",zr="scheduler.quickCreateSave",_r="scheduler.quickCreateMoreOptions",Fr="scheduler.quickCreateCancel",Or="scheduler.overviewPopoverEdit",Wr="scheduler.overviewPopoverDelete",Pr={[jt]:"Field is required.",[Xt]:"Start time must be before End time.",[Qt]:"End time must be after Start time.",[Ae]:"All events",[Me]:"all day",[Ne]:"Today",[Oe]:"Day",[We]:"Month",[ze]:"Week",[_e]:"Work Week",[Le]:"Timeline",[Fe]:"Agenda",[Pe]:"Delete",[He]:"Previous",[$e]:"Next",[Ke]:"Show full day",[Be]:"Show business hours",[Ve]:"Edit current occurrence",[Ge]:"Edit the series",[Ue]:"Do you want to edit only this event occurrence or the whole series?",[qe]:"Edit Recurring Item",[Ze]:"Save",[Ye]:"Cancel",[Wt]:"Delete",[je]:"Event",[Xe]:"Title",[Qe]:"Start",[Je]:"Start Time Zone",[et]:"End",[tt]:"End Time Zone",[rt]:"All Day",[at]:"Description",[nt]:"End in different Time Zone",[lt]:"Specify Time Zone",[ot]:"Repeats every",[st]:"day(s)",[ct]:"Repeats every",[it]:"week(s)",[ut]:"Repeats every",[dt]:"On",[mt]:"Day",[pt]:"month(s)",[gt]:"Repeats every",[vt]:"On",[ht]:"of",[Et]:"Repeats every",[yt]:"On",[ft]:"year(s)",[kt]:"Day",[Dt]:"Month",[Ct]:"Never",[bt]:"Week",[St]:"Year",[wt]:"First",[It]:"Second",[Rt]:"Third",[Tt]:"Fourth",[xt]:"Last",[At]:"Day",[Mt]:"Weekday",[Nt]:"Weekend Day",[Lt]:"After",[zt]:"occurrence(s)",[_t]:"Ends",[Ft]:"Never",[Ot]:"On",[Pt]:"Are you sure you want to delete this event?",[Ht]:"Are you sure you want to delete this series?",[$t]:"Do you want to delete only this event occurrence or the whole series?",[Kt]:"Delete current occurrence",[Bt]:"Delete the series",[Vt]:"Delete Event",[Gt]:"Delete Series",[Ut]:"Delete Recurring Item",[qt]:"Date",[Zt]:"Time",[Yt]:"Event",[Jt]:"no events",[er]:"Events",[tr]:"more",[rr]:"Reset time zone",[ar]:"Do you want to reset the time zone?",[nr]:"No",[lr]:"Yes",[or]:"Recurrence",[sr]:"Remove recurrence",[cr]:"Do you want to remove the recurrence?",[ir]:"No",[ur]:"Yes",[dr]:"Keep or reset custom events?",[mr]:"Some events in this series have been edited separately. Choose whether to keep those custom events, or reset them to match the updated series?",[pr]:"Keep custom events",[gr]:"Reset custom events",[vr]:"Cancel",[hr]:"Discard changes",[Er]:"Are you sure you want to discard the changes?",[yr]:"Discard changes",[fr]:"Cancel",[kr]:"Repeat on days",[Dr]:"Make recurring",[Cr]:"Edit recurrence",[br]:"Time zone",[Sr]:"Set Timezone",[wr]:"Reset Timezone",[Ir]:"Reset timezone",[Rr]:"Start time",[Tr]:"End time",[xr]:"from",[Ar]:"to",[Mr]:"New event",[Nr]:"Edit event",[Lr]:"Toolbar",[zr]:"Save",[_r]:"More options",[Fr]:"Cancel",[Or]:"Edit",[Wr]:"Delete"},Hr=k.forwardRef((e,t)=>{var r;const{level:l=0,...c}=e,m=k.useRef(null),p=k.useRef(null);k.useImperativeHandle(t,()=>m.current);const{timezone:g}=le(),v=a.ZonedDate.fromLocalDate(c.value,g),h=a.getDate(v),[E,y]=k.useState(!1),[f,D]=k.useState(!1),C=o.useInternationalization(),{dateFormat:b,shortDateFormat:S}=k.useContext(ue),w=ge(),[I]=ye(),R=w.end.getTime()-w.start.getTime()>23328e5,T=C.format(b,R?I:w.zonedStart,R?I:w.zonedEnd.addDays(-1)),x=C.format(S,R?I:w.zonedStart,R?I:w.zonedEnd.addDays(-1)),A=k.useCallback(()=>{y(!E)},[E]),M=k.useCallback(()=>{D(!0)},[]),N=k.useCallback(()=>{y(!1),D(!1)},[]),L=k.useCallback(e=>{if(c.onChange){const t=a.ZonedDate.fromUTCDate(F(e.value),g);c.onChange({...e,value:t})}y(!1)},[c,g]);k.useEffect(()=>{E&&f&&p.current&&p.current.focus()},[f,E]);const{onFocus:z,onBlur:_}=n.useAsyncFocusBlur({onFocus:M,onBlur:N});return k.createElement(k.Fragment,null,k.createElement(s.Button,{ref:m,onFocus:z,onBlur:_,fillMode:"flat",className:"k-nav-current k-toolbar-button",icon:"calendar",svgIcon:d.calendarIcon,"aria-live":"polite",tabIndex:-1,onClick:A},l>=2?x:T),k.createElement(u.Popup,{anchor:null==(r=m.current)?void 0:r.element,show:E},k.createElement(i.Calendar,{ref:p,onFocus:z,onBlur:_,onChange:L,value:h})))});Hr.displayName="KendoReactSchedulerNavigationDatePicker";const $r=k.forwardRef((e,t)=>{const r=e,{level:a=0}=r,l=se(),[c,i]=Ce(),u=l.find(e=>e.props.name===c),m=o.useLocalization(),p=k.useCallback(e=>{i&&(e.syntheticEvent.preventDefault(),i(e.item.name))},[i]),g=k.useCallback(e=>{i&&i(e)},[i]),v=k.useMemo(()=>l.map(e=>({value:e.props.name,text:"function"==typeof e.props.title?e.props.title(m):e.props.title,tabIndex:-1})),[l,m]);return a>=1&&u?k.createElement(s.DropDownButton,{className:"k-toolbar-menu-button",fillMode:"flat",onItemClick:p,popupSettings:{popupClass:"k-scheduler-toolbar"},textField:"title",items:l.map(e=>({...e.props,selected:e.props.name===c,title:"function"==typeof e.props.title?e.props.title(m):e.props.title})),text:"function"==typeof u.props.title?u.props.title(m):u.props.title,endIcon:k.createElement("span",{className:"k-menu-button-arrow k-button-arrow"},k.createElement(n.SvgIcon,{icon:d.chevronDownIcon}))}):k.createElement(s.SegmentedControl,{className:"k-scheduler-views",role:"group",value:c,onChange:g,items:v})});$r.displayName="KendoReactSchedulerViewSelectorList";const Kr=e=>{const{onChange:t,data:r,validationMessage:a,visited:n,touched:o,modified:s,...c}=e,[i,u]=k.useState(r);k.useEffect(()=>{u(r)},[r]);const d=k.useCallback(e=>{t&&t({value:e.value})},[t]),m=k.useCallback(e=>{const t=e.filter;u(l.filterBy(r||[],t))},[r]);return k.createElement(E.DropDownList,{popupSettings:{width:360},data:i,onChange:d,filterable:!0,onFilterChange:m,...c})},Br=e=>{const{value:t,data:r,onChange:a,...n}=e,l=k.useCallback(e=>{a&&a.call(void 0,e.currentTarget.dataset.value)},[a]);return k.createElement(s.ButtonGroup,{className:"k-scheduler-recurrence-repeat",width:"100%",...n},r.map(e=>k.createElement(s.Button,{type:"button",key:e.value,selected:e.value===t,onClick:l,"data-value":e.value,togglable:!0},e.text)))},Vr=e=>e.charAt(0).toUpperCase()+e.slice(1),Gr=["first","second","third","fourth","last"],Ur=["never","daily","weekly","monthly","yearly"],qr=[{day:0,offset:0},{day:1,offset:0},{day:2,offset:0},{day:3,offset:0},{day:4,offset:0},{day:5,offset:0},{day:6,offset:0}],Zr=[{day:1,offset:0},{day:2,offset:0},{day:3,offset:0},{day:4,offset:0},{day:5,offset:0}],Yr=[{day:0,offset:0},{day:6,offset:0}],jr=e=>{switch(e){case"day":return qr;case"weekday":return Zr;case"weekend":return Yr}},Xr=e=>g.parseRule({recurrenceRule:e})||{},Qr=e=>_(e)&&!(e=>(e=>null==e)(e)||e.trim&&0===e.trim().length)(e.freq)?e.freq:"never",Jr=e=>e.dateFormatNames({type:"months",nameType:"wide",standAlone:!0}).map((e,t)=>({text:e,value:t+1})),ea=e=>{const t=e.firstDay(),r=e.dateFormatNames({type:"days",nameType:"abbreviated"}).map((e,t)=>({text:e,value:t}));return r.slice(t).concat(r.slice(0,t))},ta=(e,t,r)=>{var a;let n;if(_(t.byWeekDay))switch(t.byWeekDay.length){case 7:n="day";break;case 5:n="weekday";break;case 2:n="weekend";break;case 1:n=t.byWeekDay[0].day;break;default:n=r.getDay()}else n=r.getDay();return null!=(a=e.find(e=>n===e.value))?a:e[0]},ra=(e,t)=>{const r=e.firstDay(),a=e.dateFormatNames({type:"days",nameType:"wide"}).map((e,t)=>({text:e,value:t})),n=a.slice(r).concat(a.slice(0,r));return[{text:t("WeekdaysDay"),value:"day"},{text:t("WeekdaysWeekday"),value:"weekday"},{text:t("WeekdaysWeekendday"),value:"weekend"}].concat(n)},aa=(e,t)=>e.find(e=>e.value===(t.bySetPosition?t.bySetPosition[0]:t.byWeekDay&&t.byWeekDay[0]?t.byWeekDay[0].offset:1))||e[0],na=e=>{const t=[1,2,3,4,-1];return Gr.map((r,a)=>({text:e("OffsetPositions"+Vr(r)),value:t[a]}))},la=e=>_(e.count)?"count":_(e.until)?"until":"never",oa=e=>_(e.byWeekDay)?"weekday":_(e.byMonthDay)?"monthday":void 0,sa=(e,t)=>e.find(e=>(t.byMonth?t.byMonth[0]:null)===e.value)||e[0],ca=(e,t)=>_(e.byMonthDay)&&e.byMonthDay.length>0?e.byMonthDay[0]:t.getDate(),ia=(e,t)=>a.ZonedDate.fromUTCDate(new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),23,59,59)),t),ua=e=>{const{value:t,data:r,onChange:a,...n}={...da,...e},l=r=>{const a=Number(r.currentTarget.dataset.key);e.onChange&&e.onChange.call(void 0,t.some(e=>e===a)?t.filter(e=>e!==a):[...t,a])};return k.createElement(s.ButtonGroup,{width:"auto",...n},(e.data||da.data).map(e=>k.createElement(s.Button,{type:"button",key:e.value,"data-key":e.value,selected:t.some(t=>t===e.value),togglable:!0,onClick:l},Vr(e.text))))},da={data:[],value:[]},ma=e=>{const t=o.useInternationalization(),r=o.useLocalization(),{timezone:n}=le(),[l,s]=k.useState(1),[c,u]=k.useState(ia(e.start,e.timezone)),d=k.useCallback((e,t)=>{const a=t?e:"scheduler.recurrenceEditor"+e;return r.toLanguageString(a,Pr[a])},[r]),p=k.useMemo(()=>{var t;return Xr(null!=(t=e.value)?t:ga.value)},[e.value]),y=k.useMemo(()=>(e=>Ur.map(t=>({value:t,text:e("Frequencies"+Vr(t))})))(d),[d]),f=k.useMemo(()=>Qr(p),[p]),D=k.useMemo(()=>ra(t,d),[t,d]),C=k.useMemo(()=>ta(D,p,e.start),[D,p,e.start]),b=k.useMemo(()=>Jr(t),[t]),S=k.useMemo(()=>sa(b,p),[b,p]),w=k.useMemo(()=>na(d),[d]),I=k.useMemo(()=>aa(w,p),[w,p]),R=k.useMemo(()=>la(p),[p]),T=k.useMemo(()=>ca(p,e.start),[p,e.start]),x=k.useMemo(()=>(e=>_(e.until)?a.toLocalDate(e.until):null)(p),[p.until]),A=k.useMemo(()=>ea(t),[t]),M=k.useMemo(()=>oa(p),[p.byWeekDay,p.byMonthDay]),N=k.useCallback(r=>{"never"===r.freq?e.onChange({value:null}):(void 0===r.weekStart&&(r.weekStart=t.firstDay()),e.onChange({value:g.serializeRule(r,e.timezone)}))},[e.onChange,e.timezone]),L=k.useCallback(t=>{const r={};r.freq=t,r.interval=1,"weekly"===t&&(r.byWeekDay=[{day:a.ZonedDate.fromLocalDate(e.start,n).getDay(),offset:0}]),("monthly"===t||"yearly"===t)&&(r.byMonthDay=[e.start.getDate()]),"yearly"===t&&(r.byMonth=[e.start.getMonth()+1]),N(r)},[N,e.start,n]),z=k.useCallback(e=>{const t=e.value;N(Object.assign({},p,{interval:t}))},[N,p]),F=k.useCallback(e=>{const t=e.value;N(Object.assign({},p,{count:t})),null!==t&&s(t)},[N,p]),O=k.useCallback(t=>{const r=t.value;if(!r)return;const a=ia(r,e.timezone);N(Object.assign({},p,{until:a})),u(a)},[N,p,e.timezone]),W=k.useCallback(e=>{N(Object.assign({},p,{byWeekDay:A.filter(t=>e.some(e=>e===t.value)).map(e=>({offset:0,day:e.value}))}))},[N,p,A]),P=k.useCallback(e=>{const t=Object.assign({},p),r=e.target.value;"string"==typeof r.value?(t.byWeekDay=jr(r.value),t.bySetPosition=[I.value]):(t.bySetPosition=void 0,t.byWeekDay=[{day:r.value,offset:I.value}]),N(t)},[I.value,N,p]),H=k.useCallback(e=>{N(Object.assign({},p,{byMonthDay:[e.value]}))},[N,p]),$=k.useCallback(e=>{const t=e.value;N(Object.assign({},p,{byMonth:[t.value]}))},[N,p]),K=k.useCallback(e=>{const t=e.value,r=Object.assign({},p);switch(t){case"never":r.until=void 0,r.count=void 0;break;case"count":r.until=void 0,r.count=l;break;case"until":r.until=c,r.count=void 0}N(r)},[N,p,e.timezone]),B=k.useCallback(e=>{const t=Object.assign({},p);"monthday"===e.value?(t.byWeekDay=void 0,t.bySetPosition=void 0,t.byMonthDay=[T]):"weekday"===e.value&&(t.byMonthDay=void 0,"string"==typeof C.value?(t.bySetPosition=[I.value],t.byWeekDay=jr(C.value)):t.byWeekDay=[{day:C.value,offset:I.value}]),N(t)},[N,p,T,C]),V=k.useCallback(e=>{const t=Object.assign({},p),r=e.value;if(t.byWeekDay)switch(t.byWeekDay.length){case 7:case 5:case 2:t.bySetPosition=[r.value];break;case 1:t.byWeekDay[0].offset=r.value}N(t)},[N,p]);return k.createElement(k.Fragment,null,k.createElement(m.FieldWrapper,null,k.createElement(v.Label,{className:"k-form-label"},r.toLanguageString(ot,Pr[ot])),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(Br,{value:f,data:y,onChange:L}))),"never"!==f&&k.createElement(m.FieldWrapper,null,k.createElement(v.Label,{editorId:"interval-editor",className:"k-form-label"},d(Vr(f)+"RepeatEvery")),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(h.NumericTextBox,{min:1,step:1,defaultValue:1,value:p.interval,onChange:z,id:"interval-editor",className:"k-recur-interval"})," ",k.createElement(v.Label,{editorId:"interval-editor",className:"k-form-label"},d(Vr(f)+"Interval")))),"weekly"===f&&k.createElement(m.FieldWrapper,null,k.createElement(v.Label,{className:"k-form-label"},d(dt,!0)),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(ua,{data:A,value:(p.byWeekDay||[]).map(({day:e})=>e),onChange:W}))),"monthly"===f&&k.createElement(m.FieldWrapper,null,k.createElement(v.Label,{key:"recurrence-repeat-on-monthly-label",className:"k-form-label"},d(vt,!0)),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(h.RadioGroup,{value:M,onChange:B,item:pa,className:"k-reset",data:[{value:"monthday",label:d(mt,!0),children:[k.createElement(k.Fragment,{key:"separator"}," "),k.createElement(h.NumericTextBox,{key:"weekday-day",min:1,max:31,disabled:"monthday"!==M,value:p&&p.byMonthDay&&p.byMonthDay[0],onChange:H,width:"auto"})]},{value:"weekday",label:" ",children:[k.createElement(E.DropDownList,{key:"weekday-offset",textField:"text",dataItemKey:"value",disabled:"weekday"!==M,data:w,value:I,onChange:V,style:{width:"auto"}}),k.createElement(k.Fragment,{key:"separator"}," "),k.createElement(E.DropDownList,{key:"weekday-value",disabled:"weekday"!==M,value:C,data:D,onChange:P,textField:"text",dataItemKey:"value",style:{width:"auto"}})]}]}))),"yearly"===f&&k.createElement(m.FieldWrapper,null,k.createElement(v.Label,null,d(yt,!0)),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(h.RadioGroup,{value:M,item:pa,onChange:B,className:"k-reset",data:[{value:"monthday",label:" ",children:[k.createElement(E.DropDownList,{key:"monthday-month",disabled:"monthday"!==M,value:S,data:b,textField:"text",dataItemKey:"value",onChange:$,style:{width:"auto"}}),k.createElement(k.Fragment,{key:"separator"}," "),k.createElement(h.NumericTextBox,{key:"monthday-day",min:1,max:31,disabled:"monthday"!==M,value:T,onChange:H,width:"auto"})]},{value:"weekday",label:" ",children:[k.createElement(E.DropDownList,{key:"yearly-weekday-offset",textField:"text",dataItemKey:"value",disabled:"weekday"!==M,data:w,value:I,onChange:V,style:{width:"auto"}}),k.createElement(k.Fragment,{key:"yearly-separator-1"}," "),k.createElement(E.DropDownList,{key:"yearly-weekday-day",textField:"text",dataItemKey:"value",disabled:"weekday"!==M,value:C,data:D,onChange:P,style:{width:"auto"}}),k.createElement(k.Fragment,{key:"yearly-separator-2"}," "),k.createElement("span",{key:"yearly-weekday-of-label"},d(ht,!0)),k.createElement(k.Fragment,{key:"yearly-separator-3"}," "),k.createElement(E.DropDownList,{key:"yearly-weekday-month",textField:"text",dataItemKey:"value",disabled:"weekday"!==M,value:S,data:b,onChange:$,style:{width:"auto"}})]}]}))),"never"!==f&&k.createElement("div",{className:"k-scheduler-recurrence-end-rule-editor"},k.createElement(m.FieldWrapper,null,k.createElement(v.Label,{className:"k-form-label"},d(_t,!0)),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(h.RadioGroup,{item:pa,value:R,onChange:K,data:[{value:"never",label:d(Ft,!0)},{value:"count",label:d(Lt,!0),children:[k.createElement(k.Fragment,{key:"separator-1"}," "),k.createElement(h.NumericTextBox,{key:"endrule-after-editor",id:"k-endrule-after",className:"k-recur-count",min:1,width:"auto",value:"count"===R?p.count:l,onChange:F,disabled:"count"!==R}),k.createElement(k.Fragment,{key:"separator-2"}," "),k.createElement(v.Label,{key:"endrule-after-label",className:"k-radio-label",editorId:"k-endrule-after"},d(zt,!0))]},{value:"until",label:d(Ot,!0),children:[k.createElement(k.Fragment,{key:"separator"}," "),k.createElement(i.DatePicker,{key:"k-endrule-until-editor",id:"k-endrule-until",disabled:"until"!==R,min:e.start,value:"until"===R?x:a.toLocalDate(c),onChange:O,width:"auto"})]}]})))))},pa=e=>k.createElement("li",{...e},e.children),ga={value:""};ma.displayName="KendoReactSchedulerRepeatEditor";const va=(e,t)=>{if(e){if(!t)return e;const r=a.toLocalDate(a.ZonedDate.fromLocalDate(e,t).toUTCDate());return r.setUTCFullYear(e.getFullYear()),r}return e},ha=(e,t)=>{if(e){if(!t)return e;const r=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return r.setUTCFullYear(e.getFullYear()),a.ZonedDate.fromUTCDate(r,t).toLocalDate()}return e},Ea={minute:15},ya=(e,t)=>!(!e||(null==t?void 0:t.getFullYear())!==e.getFullYear()||t.getMonth()!==e.getMonth()||t.getDate()!==e.getDate()),fa=e=>{const{value:t,onChange:r,isAllDay:a,connector:n,connectorElement:l,dateId:o,timeId:s,fieldError:c,ariaLabel:u,timeAriaLabel:d,min:m,max:p,steps:g=Ea}=e,{timezone:v}=le(),h=k.useMemo(()=>t?va(t,v):null,[t,v]),E=k.useMemo(()=>m?va(m,v):void 0,[m,v]),y=k.useMemo(()=>p?va(p,v):void 0,[p,v]),f=ya(h,E)?E:void 0,D=ya(h,y)?y:void 0,C=k.useCallback(e=>{if(!e.value||!r)return;const t=new Date(e.value);h&&t.setHours(h.getHours(),h.getMinutes(),h.getSeconds()),r({value:ha(t,v)})},[r,h,v]),b=k.useCallback(e=>{if(!e.value||!r)return;const t=new Date(h||new Date);t.setHours(e.value.getHours(),e.value.getMinutes(),0,0),r({value:ha(t,v)})},[r,h,v]),S=!!c;return a?k.createElement(i.DatePicker,{id:o,value:h,onChange:C,valid:!S,ariaLabel:u,min:E,max:y}):k.createElement(k.Fragment,null,k.createElement(i.DatePicker,{id:o,value:h,onChange:C,valid:!S,ariaLabel:u,min:E,max:y}),l||n&&k.createElement("span",{className:"k-scheduler-datetime-label"},n),k.createElement(i.TimePicker,{id:s,value:h,onChange:b,valid:!S,ariaLabel:d,min:f,max:D,steps:g}))};function ka(e,t,r,n){var l,o,s,c,i,u;if(!e)return"";const d=e=>n.toLanguageString(e,Pr[e]),m=(e,t)=>{const r=t?e:"scheduler.recurrenceEditor"+e;return n.toLanguageString(r,Pr[r])},p=Xr(e);if(!p.freq||"never"===p.freq)return"";const g=ea(r),v=ra(r,m),h=ta(v,p,t),E=Jr(r),y=sa(E,p),f=na(m),k=aa(f,p),D=ca(p,t),C=oa(p),b=p.interval||1,S=d(ot),w=d(dt).toLowerCase(),I=d(vt).toLowerCase(),R=d(yt).toLowerCase(),T=d(_t).toLowerCase();let x="";switch(p.freq){case"daily":x=`${S} ${b} ${d(st)}`;break;case"weekly":{const e=(p.byWeekDay||[]).map(({day:e})=>{var t;return null==(t=g.find(t=>t.value===e))?void 0:t.text}).filter(Boolean).join(", ");x=`${S} ${b} ${d(it)}`,e&&(x+=` ${w} ${e}`);break}case"monthly":{const e=`${S} ${b} ${d(pt)}`;if("weekday"===C&&null!=(l=p.byWeekDay)&&l.length){const t="string"==typeof h.value?h.text.toLowerCase():h.text;x=`${e} ${I} ${k.text.toLowerCase()} ${t}`}else{const t=null!=(s=null==(o=p.byMonthDay)?void 0:o[0])?s:D;x=`${e} ${I} ${d(mt).toLowerCase()} ${t}`}break}case"yearly":{const e=`${S} ${b} ${d(ft)}`;if("weekday"===C&&null!=(c=p.byWeekDay)&&c.length){const t="string"==typeof h.value?h.text.toLowerCase():h.text;x=`${e} ${R} ${k.text.toLowerCase()} ${t} ${d(ht)} ${y.text}`}else{const t=null!=(u=null==(i=p.byMonthDay)?void 0:i[0])?u:D;x=`${e} ${R} ${y.text} ${t}`}break}}return p.count?x+=` ${T} ${d(Lt).toLowerCase()} ${p.count} ${d(zt)}`:p.until&&(x+=` ${T} ${d(Ot).toLowerCase()} ${r.formatDate(a.toLocalDate(p.until),"D")}`),x}const Da=e=>{const{value:t,start:r,timezone:l,onSave:c,onCancel:u,onRemoveRecurrence:d,recurrenceSummaryTemplate:y,recurrenceEditor:f}=e,C=o.useInternationalization(),b=o.useLocalization(),S=ie(),w=k.useCallback((e,t)=>{const r=t?e:"scheduler.recurrenceEditor"+e;return b.toLanguageString(r,Pr[r])},[b]),[I,R]=k.useState(()=>{const e=Xr(null!=t?t:"");return e.freq?e:{freq:"daily",interval:1}}),[T,x]=k.useState(1),A=k.useRef(!1),[M,N]=k.useState(()=>ia(r,l)),[L]=k.useState(r),z=k.useRef(null),_=k.useMemo(()=>Qr(I),[I]),F=k.useMemo(()=>ea(C),[C]),O=k.useMemo(()=>ra(C,w),[C,w]),W=k.useMemo(()=>ta(O,I,L),[O,I,L]),P=k.useMemo(()=>Jr(C),[C]),H=k.useMemo(()=>sa(P,I),[P,I]),$=k.useMemo(()=>na(w),[w]),K=k.useMemo(()=>aa($,I),[$,I]),B=k.useMemo(()=>la(I),[I]),V=k.useMemo(()=>ca(I,L),[I,L]),G=k.useMemo(()=>I.until?a.toLocalDate(I.until):null,[I.until]),U=k.useMemo(()=>oa(I),[I.byWeekDay,I.byMonthDay]),q=!!t,Z=b.toLanguageString(Ze,Pr[Ze]),Y=b.toLanguageString(Ye,Pr[Ye]),j=k.useCallback(e=>{R({...e})},[]),X=k.useCallback(e=>{const t={};t.freq=e,t.interval=1,"weekly"===e&&(t.byWeekDay=[{day:a.ZonedDate.fromLocalDate(L,l).getDay(),offset:0}]),("monthly"===e||"yearly"===e)&&(t.byMonthDay=[L.getDate()]),"yearly"===e&&(t.byMonth=[L.getMonth()+1]),j(t)},[L,l,j]),Q=k.useCallback(e=>{var t;j({...I,interval:null!=(t=e.value)?t:1})},[I,j]),J=k.useCallback(e=>{const t=e.value;null!==t?(A.current=!1,j({...I,count:t}),x(t)):A.current=!0},[I,j]),ee=k.useCallback(()=>{A.current&&(A.current=!1,x(1),j({...I,count:1}))},[I,j]),te=k.useCallback(e=>{if(!e.value)return;const t=ia(e.value,l);j({...I,until:t}),N(t)},[I,l,j]),re=k.useCallback(e=>{j({...I,byWeekDay:F.filter(t=>e.some(e=>e===t.value)).map(e=>({offset:0,day:e.value}))})},[I,F,j]),ae=k.useCallback(e=>{const t={...I},r=e.target.value;"string"==typeof r.value?(t.byWeekDay=jr(r.value),t.bySetPosition=[K.value]):(t.bySetPosition=void 0,t.byWeekDay=[{day:r.value,offset:K.value}]),j(t)},[K.value,I,j]),ne=k.useCallback(e=>{var t;j({...I,byMonthDay:[null!=(t=e.value)?t:1]})},[I,j]),le=k.useCallback(e=>{j({...I,byMonth:[e.value.value]})},[I,j]),oe=k.useCallback(e=>{const t=e.value.value,r={...I};switch(t){case"never":r.until=void 0,r.count=void 0;break;case"count":r.until=void 0,r.count=T;break;case"until":r.until=M,r.count=void 0}j(r)},[I,T,M,j]),se=k.useCallback(e=>{const t={...I};"monthday"===e.value?(t.byWeekDay=void 0,t.bySetPosition=void 0,t.byMonthDay=[V]):"weekday"===e.value&&(t.byMonthDay=void 0,"string"==typeof W.value?(t.bySetPosition=[K.value],t.byWeekDay=jr(W.value)):t.byWeekDay=[{day:W.value,offset:K.value}]),j(t)},[I,V,W,K.value,j]),ce=k.useCallback(e=>{const t={...I},r=e.value;if(t.byWeekDay)switch(t.byWeekDay.length){case 7:case 5:case 2:t.bySetPosition=[r.value];break;case 1:t.byWeekDay[0].offset=r.value}j(t)},[I,j]),ue=k.useCallback(e=>{const t=e.value.value;X(t)},[X]),de=k.useMemo(()=>[{text:w(kt,!0),value:"daily"},{text:w(bt,!0),value:"weekly"},{text:w(Dt,!0),value:"monthly"},{text:w(St,!0),value:"yearly"}],[w]),me=k.useMemo(()=>[{text:w(Ft,!0),value:"never"},{text:w(Lt,!0),value:"count"},{text:w(Ot,!0),value:"until"}],[w]),pe=k.useMemo(()=>de.find(e=>e.value===_)||de[0],[de,_]),ge=k.useMemo(()=>me.find(e=>e.value===B)||me[0],[me,B]),ve=k.useMemo(()=>{const e=C.firstDay(),t=C.dateFormatNames({type:"days",nameType:"narrow"}),r=C.dateFormatNames({type:"days",nameType:"wide"}),a=t.map((e,t)=>({narrow:e,wide:r[t],value:t}));return a.slice(e).concat(a.slice(0,e))},[C]),he=k.useMemo(()=>(I.byWeekDay||[]).map(({day:e})=>e),[I.byWeekDay]),Ee=k.useCallback(e=>{const t=he.includes(e)?he.filter(t=>t!==e):[...he,e];re(t)},[he,re]),ye=k.useCallback(()=>{var e;if(f){const t=(null==(e=z.current)?void 0:e.call(z,S.recurrenceRule))||null;c(t)}else"never"!==I.freq&&I.freq?(void 0===I.weekStart&&(I.weekStart=C.firstDay()),c(g.serializeRule(I,l))):c(null)},[f,I,l,C,c]),fe=k.useCallback(()=>{u()},[u]),ke=k.useMemo(()=>{if(!I.freq||"never"===I.freq)return"";return ka(g.serializeRule(I,l),L,C,b)},[I,l,L,C,b]),De=k.useMemo(()=>I.freq&&"never"!==I.freq?g.serializeRule(I,l):null,[I,l]),Ce=k.useMemo(()=>De?g.parseRule({recurrenceRule:De}):null,[De]),be=k.createElement(p.Dialog,{title:w(or,!0),onClose:fe,width:540},f?k.createElement(m.Form,{initialValues:{[S.recurrenceRule]:t||""},render:e=>(z.current=e.valueGetter,k.createElement(m.FormElement,{horizontal:!0},k.createElement(m.Field,{name:S.recurrenceRule,field:S.recurrenceRule,component:f,start:L})))}):k.createElement(m.Form,{render:()=>{var e;return k.createElement(m.FormElement,{horizontal:!0},k.createElement(m.FieldWrapper,null,k.createElement(v.Label,{editorId:"recurrence-interval",className:"k-form-label"},w(ot,!0)),k.createElement("div",{className:"k-form-field-wrap"},k.createElement("div",{className:"k-scheduler-recurrence-fields"},"never"!==_&&k.createElement(h.NumericTextBox,{id:"recurrence-interval",min:1,step:1,defaultValue:1,value:I.interval,onChange:Q}),k.createElement(E.DropDownList,{data:de,textField:"text",dataItemKey:"value",value:pe,onChange:ue})))),"weekly"===_&&k.createElement(m.FieldWrapper,null,k.createElement(v.Label,{className:"k-form-label"},w(dt,!0)),k.createElement("div",{className:"k-form-field-wrap"},k.createElement("div",{className:"k-scheduler-weekday-picker",role:"group","aria-label":w(kr,!0)},ve.map(e=>k.createElement(s.Button,{key:e.value,type:"button",themeColor:"primary",fillMode:"flat",rounded:"full",togglable:!0,selected:he.includes(e.value),"aria-label":e.wide,"aria-pressed":he.includes(e.value),onClick:()=>Ee(e.value)},e.narrow))))),"monthly"===_&&k.createElement(m.FieldWrapper,null,k.createElement(v.Label,{className:"k-form-label"},w(vt,!0)),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(h.RadioGroup,{value:U,onChange:se,className:"k-reset",data:[{value:"weekday",label:" ",children:[k.createElement("div",{key:"weekday-fields",className:"k-scheduler-recurrence-fields"},k.createElement(E.DropDownList,{textField:"text",dataItemKey:"value",disabled:"weekday"!==U,data:$,value:K,onChange:ce}),k.createElement(E.DropDownList,{disabled:"weekday"!==U,value:W,data:O,onChange:ae,textField:"text",dataItemKey:"value"}))]},{value:"monthday",label:" ",children:[k.createElement("div",{key:"monthday-fields",className:"k-scheduler-recurrence-fields"},k.createElement(h.NumericTextBox,{min:1,max:31,disabled:"monthday"!==U,value:V,onChange:ne,width:"auto"}))]}]}))),"yearly"===_&&k.createElement(m.FieldWrapper,null,k.createElement(v.Label,{className:"k-form-label"},w(yt,!0)),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(h.RadioGroup,{value:U,onChange:se,className:"k-reset",data:[{value:"monthday",label:" ",children:[k.createElement("div",{key:"monthday-fields",className:"k-scheduler-recurrence-fields"},k.createElement(E.DropDownList,{disabled:"monthday"!==U,value:H,data:P,textField:"text",dataItemKey:"value",onChange:le}),k.createElement(h.NumericTextBox,{min:1,max:31,disabled:"monthday"!==U,value:V,onChange:ne,width:"auto"}))]},{value:"weekday",label:" ",children:[k.createElement("div",{key:"weekday-fields",className:"k-scheduler-recurrence-fields"},k.createElement(E.DropDownList,{textField:"text",dataItemKey:"value",disabled:"weekday"!==U,data:$,value:K,onChange:ce}),k.createElement(E.DropDownList,{textField:"text",dataItemKey:"value",disabled:"weekday"!==U,value:W,data:O,onChange:ae}),k.createElement("span",{key:"of-row",className:"k-scheduler-edit-form-row"},k.createElement("span",null,w(ht,!0)),k.createElement(E.DropDownList,{textField:"text",dataItemKey:"value",disabled:"weekday"!==U,value:H,data:P,onChange:le})))]}]}))),"never"!==_&&k.createElement(m.FieldWrapper,null,k.createElement(v.Label,{className:"k-form-label"},w(_t,!0)),k.createElement("div",{className:"k-form-field-wrap"},k.createElement("div",{className:"k-scheduler-recurrence-fields"},k.createElement(E.DropDownList,{data:me,textField:"text",dataItemKey:"value",value:ge,onChange:oe}),"count"===B&&k.createElement(h.NumericTextBox,{min:1,width:"auto",value:null!=(e=I.count)?e:T,onChange:J,onBlur:ee,format:`0 '${w(zt,!0)}'`}),"until"===B&&k.createElement(i.DatePicker,{min:L,value:null!=G?G:a.toLocalDate(M),onChange:te,width:"auto"})))),"never"!==_&&(y&&De?k.createElement(m.FieldWrapper,null,k.createElement("div",{className:"k-form-field-wrap"},k.createElement("div",{className:"k-form-hint k-scheduler-recurrence-summary",title:ke||void 0},k.createElement(y,{recurrenceRule:De,text:ke||"",parsedRule:Ce})))):ke?k.createElement(m.FieldWrapper,null,k.createElement("div",{className:"k-form-field-wrap"},k.createElement("div",{className:"k-form-hint k-scheduler-recurrence-summary",title:ke},ke))):null))}}),k.createElement(p.DialogActionsBar,{layout:"end"},q&&d&&k.createElement(s.Button,{fillMode:"flat",themeColor:"primary",onClick:d},w(sr,!0)),k.createElement(s.Button,{onClick:fe},Y),k.createElement(s.Button,{themeColor:"primary",onClick:ye},Z)));return n.canUseDOM?D.createPortal(be,document.body):null};Da.displayName="KendoReactSchedulerRecurrenceDialog";const Ca=e=>{const{onConfirm:t,onCancel:r}=e,a=o.useLocalization(),l=a.toLanguageString(sr,Pr[sr]),c=a.toLanguageString(cr,Pr[cr]),i=a.toLanguageString(ir,Pr[ir]),u=a.toLanguageString(ur,Pr[ur]),d=k.createElement(p.Dialog,{title:l,onClose:r,width:400},k.createElement("p",null,c),k.createElement(p.DialogActionsBar,{layout:"end"},k.createElement(s.Button,{onClick:r},i),k.createElement(s.Button,{themeColor:"primary",onClick:t},u)));return n.canUseDOM?D.createPortal(d,document.body):null};Ca.displayName="KendoReactRemoveRecurrenceConfirmDialog";const ba=k.forwardRef((e,t)=>{const r=k.useRef(null),l=k.useRef(null),c=a.timezoneNames(),i=o.useLocalization(),u=o.useInternationalization(),h=ie(),{resources:E,timezone:y}=le();k.useImperativeHandle(l,()=>{var t;return{element:null!=(t=r.current)&&t.element?r.current.element:r.current,props:e}}),k.useImperativeHandle(t,()=>l.current);const{as:f=Ta.as,...D}=e,{onChange:C,valueGetter:b}=e,{titleEditor:S=Ta.titleEditor,startEditor:w=Ta.startEditor,endEditor:I=Ta.endEditor,startTimezoneEditor:R=Ta.startTimezoneEditor,endTimezoneEditor:T=Ta.endTimezoneEditor,startLabel:x=Ta.startLabel,endLabel:A=Ta.endLabel,allDayEditor:M=Ta.allDayEditor,allDayLabel:N=Ta.allDayLabel,recurrenceEditor:L,descriptionEditor:z=Ta.descriptionEditor,resourceEditor:_=Ta.resourceEditor}=e,F=k.useMemo(()=>b(h.start)||new Date,[b,h.start]),O=b(h.start)||null,W=b(h.isAllDay)||!1,P=b(h.startTimezone)||y||"",H=b(h.recurrenceRule),$=!(null!=b(h.recurrenceId)),K=k.useMemo(()=>i.toLanguageString(rt,Pr[rt]),[i]),[B,V]=k.useState(!!b(h.startTimezone)),[G,U]=k.useState(!1),[q,Z]=k.useState(!1),[Y,j]=k.useState(!1),X=e.recurrenceSummaryTemplate,Q=k.useMemo(()=>i.toLanguageString(Dr,Pr[Dr]),[i]),J=k.useMemo(()=>i.toLanguageString(Cr,Pr[Cr]),[i]),ee=H?J:Q,te=k.useMemo(()=>H?ka(H,F,u,i):null,[H,F,u,i]),re=k.useId(),ae=k.useMemo(()=>H?g.parseRule({recurrenceRule:H}):null,[H]),ne=k.useRef(P);k.useEffect(()=>{B&&P&&P!==ne.current&&C(h.endTimezone,{value:P}),ne.current=P},[P,B,C,h.endTimezone]);const oe=k.useCallback(e=>{e.preventDefault(),B?U(!0):V(!0)},[B]),se=k.useCallback(()=>{C(h.startTimezone,{value:null}),C(h.endTimezone,{value:null}),V(!1),U(!1)},[C,h.startTimezone,h.endTimezone]),ce=k.useCallback(()=>{U(!1)},[]),ue=k.useCallback(()=>{Z(!0)},[]),de=k.useCallback(e=>{C(h.recurrenceRule,{value:e}),Z(!1)},[C,h.recurrenceRule]),me=k.useCallback(()=>{Z(!1)},[]),pe=k.useCallback(()=>{j(!0)},[]),ge=k.useCallback(()=>{C(h.recurrenceRule,{value:null}),C(h.recurrenceExceptions,{value:null}),j(!1),Z(!1)},[C,h.recurrenceRule,h.recurrenceExceptions]),ve=k.useCallback(()=>{j(!1)},[]),he=k.useCallback((e,t)=>{const r=b(h.start),a=b(h.end);if(t(e),e.value&&r&&a){const t=a.getTime()-r.getTime();C(h.end,{value:new Date(e.value.getTime()+t)})}},[b,C,h.start,h.end]),Ee=k.useMemo(()=>n.classNames("k-scheduler-edit-form",e.className),[e.className]);return k.createElement(k.Fragment,null,k.createElement(f,{ref:f===Ta.as?r:void 0,horizontal:!0,...D,className:Ee},k.createElement(k.Fragment,null,k.createElement(m.FieldWrapper,null,k.createElement(v.Label,{className:"k-form-label"},k.createElement(n.SvgIcon,{icon:d.rightDoubleQuotesIcon,size:"xlarge"})),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(m.Field,{id:"k-scheduler-editor-title",name:h.title,field:h.title,component:S,placeholder:i.toLanguageString(Xe,Pr[Xe]),"aria-label":i.toLanguageString(Xe,Pr[Xe])}))),k.createElement(m.FieldWrapper,null,k.createElement(v.Label,{className:"k-form-label"},k.createElement(n.SvgIcon,{icon:d.clockIcon,size:"xlarge"})),k.createElement("div",{className:"k-form-field-wrap"},k.createElement("div",{className:"k-scheduler-datetime-section"},k.createElement("div",{className:"k-scheduler-edit-form-row"},k.createElement(m.Field,{id:"k-is-allday-switch",name:h.isAllDay,component:M,onLabel:"",offLabel:"",ariaLabel:K}),k.createElement(m.Field,{name:h.isAllDay,field:h.isAllDay,editorId:"k-is-allday-switch",component:N},K)),k.createElement("div",{className:"k-scheduler-datetime-grid"},W?k.createElement("div",{className:"k-scheduler-edit-form-row"},k.createElement(m.Field,{name:h.start,component:Sa,baseEditor:w,onStartChange:he,isAllDay:W,fieldError:e.errors[h.start],ariaLabel:i.toLanguageString(Qe,Pr[Qe]),timezone:y}),k.createElement(m.Field,{name:h.end,component:A,editorId:"k-scheduler-editor-end",className:"k-scheduler-datetime-label"},i.toLanguageString(Ar,Pr[Ar])),k.createElement(m.Field,{name:h.end,component:I,isAllDay:W,dateId:"k-scheduler-editor-end",min:O,fieldError:e.errors[h.end],ariaLabel:i.toLanguageString(et,Pr[et]),timezone:y})):k.createElement(k.Fragment,null,k.createElement("div",{className:"k-scheduler-edit-form-row"},k.createElement(m.Field,{name:h.start,component:Sa,baseEditor:w,onStartChange:he,isAllDay:W,timeId:"k-scheduler-editor-start-time",connectorElement:k.createElement(m.Field,{name:h.start,component:x,editorId:"k-scheduler-editor-start-time",className:"k-scheduler-datetime-label"},i.toLanguageString(xr,Pr[xr])),fieldError:e.errors[h.start],ariaLabel:i.toLanguageString(Qe,Pr[Qe]),timeAriaLabel:i.toLanguageString(Rr,Pr[Rr]),timezone:y})),!B&&k.createElement(s.Button,{className:"k-col-span-2",fillMode:"flat",themeColor:"primary",title:i.toLanguageString(Sr,Pr[Sr]),onClick:oe,svgIcon:d.globeIcon},i.toLanguageString(br,Pr[br])),B&&k.createElement(k.Fragment,null,k.createElement(m.Field,{name:h.startTimezone,component:R,data:c,value:P,ariaLabel:i.toLanguageString(Je,Pr[Je])}),k.createElement(s.Button,{title:i.toLanguageString(wr,Pr[wr]),"aria-label":i.toLanguageString(Ir,Pr[Ir]),onClick:oe,svgIcon:d.globeIcon,fillMode:"flat",themeColor:"primary"})),k.createElement("div",{className:"k-scheduler-edit-form-row"},k.createElement(m.Field,{name:h.end,component:I,isAllDay:W,min:O,timeId:"k-scheduler-editor-end-time",connectorElement:k.createElement(m.Field,{name:h.end,component:A,editorId:"k-scheduler-editor-end-time",className:"k-scheduler-datetime-label"},i.toLanguageString(Ar,Pr[Ar])),fieldError:e.errors[h.end],ariaLabel:i.toLanguageString(et,Pr[et]),timeAriaLabel:i.toLanguageString(Tr,Pr[Tr]),timezone:y})),B&&k.createElement(m.Field,{name:h.endTimezone,component:T,data:c,value:b(h.endTimezone)||y||"",ariaLabel:i.toLanguageString(tt,Pr[tt])}))),$&&k.createElement("div",{className:"k-scheduler-edit-form-row"},k.createElement(s.Button,{className:"k-scheduler-recurrence-button",type:"button",fillMode:"flat",themeColor:"primary",svgIcon:d.arrowRotateCwIcon,onClick:ue,"aria-describedby":H?re:void 0},ee),H&&te&&k.createElement("div",{id:re,className:"k-scheduler-recurrence-summary k-form-hint",title:te},X&&ae?k.createElement(X,{recurrenceRule:H,text:te,parsedRule:ae}):te))))),k.createElement(m.FieldWrapper,null,k.createElement(v.Label,{className:"k-form-label"},k.createElement(n.SvgIcon,{icon:d.commentIcon,size:"xlarge"})),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(m.Field,{component:z,name:h.description,id:"k-event-description",resizable:"vertical",placeholder:i.toLanguageString(at,Pr[at]),"aria-label":i.toLanguageString(at,Pr[at])}))),(E||[]).map(e=>k.createElement(m.FieldWrapper,{key:e.field},e.svgIcon&&k.createElement(v.Label,{className:"k-form-label"},k.createElement(n.SvgIcon,{icon:e.svgIcon,size:"xlarge"})),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(m.Field,{name:e.field,component:_,resource:e,multiple:e.multiple,data:e.data,textField:e.textField,valueField:e.valueField,colorField:e.colorField,ariaLabel:e.name||e.field})))))),q&&k.createElement(Da,{value:H,start:F,timezone:y||"",onSave:de,onCancel:me,onRemoveRecurrence:pe,recurrenceSummaryTemplate:X,recurrenceEditor:L}),Y&&k.createElement(Ca,{onConfirm:ge,onCancel:ve}),G&&k.createElement(p.Dialog,{title:i.toLanguageString(rr,Pr[rr]),onClose:ce},i.toLanguageString(ar,Pr[ar]),k.createElement(p.DialogActionsBar,null,k.createElement(s.Button,{onClick:ce},i.toLanguageString(nr,Pr[nr])),k.createElement(s.Button,{themeColor:"primary",onClick:se},i.toLanguageString(lr,Pr[lr])))))});ba.displayName="KendoReactSchedulerFormEditor";const Sa=e=>{const{baseEditor:t,onStartChange:r,onChange:a,...n}=e,l=k.useCallback(e=>r(e,a),[r,a]);return k.createElement(t,{...n,onChange:l})};Sa.displayName="SchedulerDurationPreservingEditor";const wa=k.forwardRef((e,t)=>k.createElement(m.FormElement,{ref:t,id:e.id,style:e.style,tabIndex:e.tabIndex,className:e.className,horizontal:e.horizontal,children:e.children}));wa.displayName="SchedulerFormEditorDefaultElement";const Ia=e=>{const{value:t,onChange:r,valid:a,visited:n,touched:l,modified:o,name:s,validationMessage:c,...i}=e,u=k.useCallback(e=>{r&&r({value:e.value})},[r]);return k.createElement(h.Switch,{...i,checked:t||!1,onChange:u})};Ia.displayName="SwitchFieldAdapter";const Ra=e=>k.createElement(v.Label,{...e,style:{marginBottom:0,...e.style}});Ra.displayName="DefaultLabel";const Ta={as:wa,titleEditor:h.Input,startEditor:fa,endEditor:fa,startTimezoneEditor:Kr,endTimezoneEditor:Kr,startLabel:Ra,endLabel:Ra,allDayEditor:Ia,allDayLabel:Ra,recurrenceEditor:ma,descriptionEditor:h.TextArea,resourceEditor:e=>{const t=e.multiple?E.MultiSelect:E.DropDownList,r=k.useCallback(t=>{const r=t.target.props.dataItemKey,a=e.multiple?(t.target.value||[]).map(e=>e[r]):t.target.value[r];e.onChange.call(void 0,{value:a})},[e.multiple,e.onChange]),a=k.useCallback((t,r)=>{const a=k.createElement(k.Fragment,null,e.colorField&&k.createElement("span",{key:1,className:"k-scheduler-mark",style:{backgroundColor:r.dataItem[e.colorField],marginRight:_(r.dataItem[e.valueField])?"8px":"4px"}}," "),k.createElement("span",{key:2},"  ",t.props.children));return k.cloneElement(t,{...t.props},a)},[e.colorField,e.valueField]),n=k.useCallback((t,r)=>{const a=k.createElement(k.Fragment,null,e.colorField&&r&&k.createElement("span",{key:1,className:"k-scheduler-mark",style:{backgroundColor:r[e.colorField],marginRight:r[e.valueField]?"8px":"4px"}}," "),t.props.children);return k.cloneElement(t,{},a)},[e.colorField,e.valueField]),l=Array.isArray(e.value)?e.data.filter(t=>e.value.some(r=>t[e.valueField]===r)):e.data.find(t=>t[e.valueField]===e.value);return k.createElement(t,{value:l,onChange:r,data:e.data,textField:e.textField,dataItemKey:e.valueField,valid:e.valid,validationMessage:e.validationMessage,itemRender:a,valueRender:n,ariaLabel:e.ariaLabel})}},xa=e=>{const{onDiscard:t,onCancel:r}=e,a=o.useLocalization(),l=k.useId(),c=a.toLanguageString(hr,Pr[hr]),i=a.toLanguageString(Er,Pr[Er]),u=a.toLanguageString(yr,Pr[yr]),d=a.toLanguageString(fr,Pr[fr]),m=k.createElement(p.Dialog,{title:c,onClose:r,width:410,id:l},k.createElement("p",null,i),k.createElement(p.DialogActionsBar,{layout:"end"},k.createElement(s.Button,{onClick:r},d),k.createElement(s.Button,{themeColor:"primary",onClick:t},u)));return n.canUseDOM?D.createPortal(m,document.body):null};xa.displayName="KendoReactDiscardChangesDialog";const Aa=k.forwardRef((e,t)=>{const{onCancel:r,onClose:a,onSubmit:l,onDelete:c,editor:i,dialog:u=Ma.dialog,validator:g=Ma.validator,...v}=e,h=k.useRef(null);k.useImperativeHandle(h,()=>({props:e})),k.useImperativeHandle(t,()=>h.current);const E=o.useLocalization(),y=ie(),f=!(!e.dataItem||!e.dataItem[y.id]),C=k.useMemo(()=>E.toLanguageString(jt,Pr[jt]),[E]),b=k.useMemo(()=>E.toLanguageString(Qt,Pr[Qt]),[E]),S=k.useMemo(()=>E.toLanguageString(Ze,Pr[Ze]),[E]),w=k.useMemo(()=>E.toLanguageString(Ye,Pr[Ye]),[E]),I=k.useMemo(()=>E.toLanguageString(Wt,Pr[Wt]),[E]),R=k.useMemo(()=>E.toLanguageString(Xt,Pr[Xt]),[E]),T=k.useMemo(()=>E.toLanguageString(Mr,Pr[Mr]),[E]),x=k.useMemo(()=>E.toLanguageString(Nr,Pr[Nr]),[E]),A=f?x:T,M=k.useRef(!1),[N,L]=k.useState(null),z=k.useCallback(e=>{r&&r({value:null,syntheticEvent:e,target:h.current})},[r]),_=k.useCallback(e=>{a&&a({value:null,syntheticEvent:e,target:h.current})},[a]),F=k.useCallback(e=>{M.current?L({type:"cancel",syntheticEvent:e}):z(e)},[z]),O=k.useCallback(({syntheticEvent:e})=>{M.current?L({type:"close",syntheticEvent:e}):_(e)},[_]),W=k.useCallback(()=>{if(N){const{type:e,syntheticEvent:t}=N;L(null),"cancel"===e?z(t):_(t)}},[N,z,_]),P=k.useCallback(()=>{L(null)},[]),H=k.useCallback((e,t)=>{l&&l({value:e,syntheticEvent:t,target:h.current})},[l]),$=k.useCallback(t=>{c&&c({value:e.dataItem,syntheticEvent:t,target:h.current})},[c,e.dataItem]),K=k.useCallback((e,t)=>e&&t(y.end)&&e.getTime()>t(y.end).getTime()?R:void 0,[y,R]),B=k.useCallback((e,t)=>e&&t(y.start)&&e.getTime()<t(y.start).getTime()?b:void 0,[y,b]),V=k.useCallback(e=>e?void 0:C,[C]),G=k.useCallback((e,t)=>{const r={};r[y.start]=[V(t(y.start)),K(t(y.start),t)].filter(Boolean).reduce((e,t)=>e||t,""),r[y.end]=[V(t(y.start)),B(t(y.start),t)].filter(Boolean).reduce((e,t)=>e||t,"");const a=g(e,t);return{...r,...a}},[B,y.end,y.start,V,K,g]);return n.canUseDOM?D.createPortal(k.createElement(m.Form,{ignoreModified:!0,initialValues:e.dataItem,onSubmit:H,validator:G,render:e=>(M.current=e.modified,k.createElement(k.Fragment,null,k.createElement(u,{title:A,width:650,onClose:O},k.createElement(ba,{...e,as:i}),k.createElement(p.DialogActionsBar,{layout:"end"},f&&c&&k.createElement(s.Button,{fillMode:"flat",themeColor:"primary",svgIcon:d.trashIcon,onClick:$},I),k.createElement(s.Button,{onClick:F},w),k.createElement(s.Button,{themeColor:"primary",disabled:!e.allowSubmit,onClick:e.onSubmit},S))),N&&k.createElement(xa,{onDiscard:W,onCancel:P}))),...v}),document&&document.body):null}),Ma={dialog:p.Dialog,validator:()=>({})};Aa.displayName="KendoReactSchedulerForm";const Na=k.createContext({});Na.displayName="SchedulerViewPropsContext";const La=k.createContext([]),za=()=>k.useContext(La);La.displayName="SchedulerViewRangesContext";const _a=k.createContext([[],Z]),Fa=()=>k.useContext(_a);_a.displayName="SchedulerViewSlotsContext";const Oa=k.createContext([[],Z]),Wa=()=>k.useContext(Oa);Oa.displayName="SchedulerViewItemsContext";const Pa=k.createContext([[],Z]);Pa.displayName="SchedulerViewSelectedSlotsContext";const Ha=k.createContext([[],Z]),$a=()=>k.useContext(Ha);Ha.displayName="SchedulerViewSelectedItemsContext";const Ka=k.createContext([[],Z]);Ka.displayName="SchedulerViewFocusedItemsContext";const Ba=k.createContext([[],Z]),Va=()=>k.useContext(Ba);Ba.displayName="SchedulerViewFocusedSlotsContext";const Ga=({children:e,props:t,ranges:r,slots:a,items:n,selectedSlots:l,selectedItems:o,focusedItems:s,focusedSlots:c})=>k.createElement(Na.Provider,{value:t},k.createElement(La.Provider,{value:r},k.createElement(_a.Provider,{value:a},k.createElement(Oa.Provider,{value:n},k.createElement(Pa.Provider,{value:l},k.createElement(Ha.Provider,{value:o},k.createElement(Ka.Provider,{value:s},k.createElement(Ba.Provider,{value:c},e))))))));var Ua=(e=>(e.select="ITEMS_SELECT_SELECT",e.selectNext="ITEMS_SELECT_SELECT_NEXT",e.selectPrev="ITEMS_SELECT_SELECT_PREV",e.reset="ITEMS_SELECT_RESET",e.add="ITEMS_SELECT_ADD",e.remove="ITEMS_SELECT_REMOVE",e))(Ua||{});var qa=(e=>(e.select="SLOTS_SELECT_SELECT",e.reset="SLOTS_SELECT_RESET",e.add="SLOTS_SELECT_ADD",e))(qa||{});const Za=(e,t)=>{const{element:r}=e;n.useIsomorphicLayoutEffect(()=>{if(!r||!r.current)return;const t=[],a=[],n=[],l=r.current.querySelectorAll(e.selector);l.forEach(r=>{const l=r.getBoundingClientRect().width,o=e.explicitDepth&&void 0!==e.attribute?r.getAttribute(e.attribute):0,s=I(r,!0),c=((e,t=!1)=>parseFloat(window.getComputedStyle(e)[t?"borderLeftWidth":"borderTopWidth"]||"0")+parseFloat(window.getComputedStyle(e)[t?"borderRightWidth":"borderBottomWidth"]||"0"))(r,!0);null!==o&&((!n[o]||c>n[o])&&(n[o]=c),(!a[o]||s>a[o])&&(a[o]=s),(!t[o]||l>t[o])&&(t[o]=l))}),l.forEach(r=>{const l=e.explicitDepth?r.getAttribute(e.attribute):0;null!==l&&(r.style.minWidth=t[l]-a[l]-n[l]+"px")})},t)};var Ya=(e=>(e.up="SLOT_FOCUS_UP",e.down="SLOT_FOCUS_DOWN",e.left="SLOT_FOCUS_LEFT",e.right="SLOT_FOCUS_RIGHT",e))(Ya||{});const ja=(e,t)=>t.find(t=>null!==t.current&&null!==e.current&&t.current.props.row===e.current.props.row-1&&t.current.props.col===e.current.props.col),Xa=(e,t)=>t.find(t=>null!==t.current&&null!==e.current&&t.current.props.row===e.current.props.row&&t.current.props.col===e.current.props.col-1),Qa=(e,t)=>t.find(t=>null!==t.current&&null!==e.current&&t.current.props.row===e.current.props.row&&t.current.props.col===e.current.props.col+1),Ja=(e,t)=>t.find(t=>null!==t.current&&null!==e.current&&t.current.props.row===e.current.props.row+1&&t.current.props.col===e.current.props.col);var en=(e=>(e.next="ITEMS_FOCUS_NEXT",e.prev="ITEMS_FOCUS_PREV",e))(en||{});const tn=k.forwardRef((e,t)=>{const r=k.useRef(null);k.useImperativeHandle(t,()=>r.current);const[a,l]=n.useCollection([]),[o,s]=n.useCollection([]),[c,i]=(e=>[[],(t,r)=>{switch(t.type){case"ITEMS_FOCUS_NEXT":{if(!t.item||!t.item.current||!e)return;const a=Y(t.item,e,t.ignoreIsAllDay,!1);a&&a.current&&a.current.element&&(r.preventDefault(),a.current.element.focus());break}case"ITEMS_FOCUS_PREV":{if(!t.item||!t.item.current||!e)return;const a=Y(t.item,e,t.ignoreIsAllDay,!0);a&&a.current&&a.current.element&&(r.preventDefault(),a.current.element.focus());break}}}])(a),[u,d]=(e=>[[],(t,r)=>{switch(t.type){case"SLOT_FOCUS_UP":{if(!t.slot.current||!e)return;const a=ja(t.slot,e);a&&a.current&&a.current.element&&(r.preventDefault(),a.current.element.focus());break}case"SLOT_FOCUS_DOWN":{if(!t.slot||!e)return;const a=Ja(t.slot,e);a&&a.current&&a.current.element&&(r.preventDefault(),a.current.element.focus());break}case"SLOT_FOCUS_LEFT":{if(!t.slot||!e)return;const a=Xa(t.slot,e);a&&a.current&&a.current.element&&(r.preventDefault(),a.current.element.focus());break}case"SLOT_FOCUS_RIGHT":{if(!t.slot||!e)return;const a=Qa(t.slot,e);a&&a.current&&a.current.element&&(r.preventDefault(),a.current.element.focus());break}}}])(o),[m,p]=(e=>{const[t,r]=k.useState([]),a=k.useCallback((a,n)=>{switch(a.type){case"ITEMS_SELECT_SELECT":if(!a.item)return;r([a.item]);break;case"ITEMS_SELECT_SELECT_NEXT":{if(!a.item||!a.item.current||!e)return;const t=Y(a.item,e,a.ignoreIsAllDay,!1);t&&(n.preventDefault(),r([t]));break}case"ITEMS_SELECT_SELECT_PREV":{if(!a.item||!a.item.current||!e)return;const t=Y(a.item,e,a.ignoreIsAllDay,!0);t&&(n.preventDefault(),r([t]));break}case"ITEMS_SELECT_RESET":r([]);break;case"ITEMS_SELECT_ADD":if(!a.item)return;t.some(e=>e===a.item)||r([...t,a.item]);break;case"ITEMS_SELECT_REMOVE":if(!a.item)return;r([...t.filter(e=>e!==a.item)])}},[e,t]);return[t,a]})(a),[g,v]=(()=>{const[e,t]=k.useState([]),r=k.useCallback(r=>{switch(r.type){case"SLOTS_SELECT_SELECT":if(!r.slot)return;t([r.slot]);break;case"SLOTS_SELECT_RESET":t([]);break;case"SLOTS_SELECT_ADD":if(!r.slot)return;e.some(e=>e===r.slot)||t([...e,r.slot])}},[e]);return[e,r]})(),h=k.useCallback((e,t)=>{v({type:qa.reset}),p(e,t)},[p,v]),E=k.useCallback((e,t)=>{p({type:Ua.reset},t),v(e)},[p,v]),y=k.useMemo(()=>n.classNames("k-scheduler-layout k-scheduler-layout-flex",e.className),[e.className]);return Za({element:r,selector:".k-group-cell",attribute:"data-depth-index",explicitDepth:!0}),Za({element:r,selector:".k-side-cell",attribute:"data-depth-index",explicitDepth:!1}),k.createElement(Ga,{props:e.props,ranges:e.ranges,items:[a,l],slots:[o,s],selectedItems:[m,h],selectedSlots:[g,E],focusedItems:[c,i],focusedSlots:[u,d]},k.createElement("div",{ref:r,style:e.style,className:y,role:e.role||"none"},e.children))});tn.displayName="KendoReactSchedulerBaseView";const rn=k.createContext({resource:{},groupIndex:0}),an=e=>{const{nested:t,children:r,rowContentProps:a}=e,n=e.rowContent||on,l=e.childRowContent||n,o=b(e.group,e.resources);return k.createElement("div",{className:"k-scheduler-group k-group-horizontal"},t?nn({resources:o,children:r,nested:t,groupIndex:0,rowContent:n,rowContentProps:a,childRowContent:l}):ln({resources:o,children:r,rowContentProps:a,childRowContent:l}))},nn=e=>{const{resources:t,rowContent:r,nested:a,children:n,groupIndex:l,rowContentProps:o,childRowContent:s}=e;if(l===t.length)return ln({resources:t,children:n,rowContentProps:o,childRowContent:s});const c=S(t,l),i=r;return k.createElement(k.Fragment,null,a?k.createElement("div",{className:"k-scheduler-row"},k.createElement(i,{resources:t,groupIndex:l,...o},c.map((e,t)=>k.createElement("div",{key:t,className:"k-scheduler-cell k-heading-cell"},e.text)))):k.createElement(i,{resources:t,groupIndex:l,...o},c.map((e,t)=>k.createElement("div",{key:t,className:"k-scheduler-cell k-heading-cell"},e.text))),nn({resources:t,children:n,nested:a,rowContent:r,childRowContent:s,groupIndex:l+1}))},ln=e=>{const{resources:t,childRowContent:r,children:a,rowContentProps:n}=e,l=S(t,t.length-1),o=r,s=t.length>0;return k.createElement("div",{className:"k-scheduler-row"},k.createElement(o,{resources:t,...n},(l.length?l:Q).map((e,t)=>k.createElement("div",{key:t,className:"k-scheduler-cell k-group-cell"},k.createElement(rn.Provider,{value:{resource:e,groupIndex:s?t:0}},a)))))};an.displayName="KendoReactSchedulerHorizontalResourceIterator";const on=e=>e.children,sn=e=>k.createElement(k.Fragment,null,k.createElement("div",{className:"k-scheduler-cell k-side-cell","data-range-index":e.rangeIndex}),e.children),cn=e=>{const{nested:t,wrapGroup:r,children:a,role:n}=e,l=e.cellContent||hn,o=b(e.group,e.resources);return k.createElement("div",{className:"k-scheduler-group",role:n},t?r?k.createElement("div",{className:"k-scheduler-row"},k.createElement("div",{className:"k-sticky-cell"},mn({resources:o,children:a,cellContent:l,depth:0,groupIndex:0})),k.createElement("div",{className:"k-scheduler-cell k-group-content"},dn({resources:o,children:a,cellContent:l,depth:0,groupIndex:0},!1))):dn({resources:o,children:a,cellContent:l,depth:0,groupIndex:0},!0):r?k.createElement("div",{className:"k-scheduler-row"},k.createElement("div",{className:"k-sticky-cell"},un({resources:o})),k.createElement("div",{className:"k-scheduler-cell k-group-content"},a)):pn({resources:o,children:a,cellContent:l,groupIndex:0,role:n}))},un=e=>k.createElement("div",{className:"k-scheduler-row"},k.createElement("div",{className:"k-scheduler-row"},e.resources.map((e,t)=>k.createElement("div",{key:t,className:"k-scheduler-cell k-resource-cell k-heading-cell","data-depth-index":t})))),dn=(e,t=!0)=>{const{resources:r,children:a,cellContent:n,groupIndex:l,depth:o}=e,s=r.length>0;if(o===r.length||!s)return k.createElement(rn.Provider,{value:{resource:r[o],groupIndex:s?l:0}},a);const c=r[o].data.length;return r[o].data.map((e,s)=>k.createElement("div",{key:s,className:"k-scheduler-row"},t&&k.createElement("div",{className:"k-scheduler-cell k-group-cell k-heading-cell","data-depth-index":o},e[r[o].textField]),k.createElement("div",{className:"k-scheduler-cell k-group-content k-resource-row","data-depth-index":o,"data-resource-index":c*l+s},dn({resources:r,children:a,cellContent:n,groupIndex:c*l+s,depth:o+1},t))))},mn=e=>{const{resources:t,children:r,cellContent:a,groupIndex:n,depth:l}=e,o=t.length?t[l].data.length:0;return t[l]?t[l].data.map((e,s)=>k.createElement("div",{key:s,className:"k-scheduler-row"},k.createElement("div",{className:"k-scheduler-cell k-resource-cell k-resource-row k-heading-cell","data-depth-index":l,"data-resource-index":o*n+s},e[t[l].textField]),l+1!==t.length&&k.createElement("div",{className:"k-scheduler-cell k-resource-content"},mn({resources:t,children:r,cellContent:a,groupIndex:o*n+s,depth:l+1})))):null},pn=e=>{const{resources:t,children:r,groupIndex:a,cellContent:n,role:l}=e;return k.createElement("div",{className:"k-scheduler-row",role:l},vn(t),n,gn(r,t,a,l))},gn=(e,t,r,a)=>{const n=t.length>0;return k.createElement("div",{className:"k-scheduler-cell k-group-content",role:a},k.createElement(rn.Provider,{value:{resource:t[r],groupIndex:n?r:void 0}},e))},vn=e=>e.map((e,t)=>k.createElement("div",{key:t,className:"k-scheduler-cell k-group-cell k-heading-cell","data-depth-index":t}));cn.displayName="KendoReactSchedulerVerticalResourceIterator";const hn=null,En=e=>{const t=o.useLocalization();return k.createElement(k.Fragment,null,k.createElement("div",{className:"k-scheduler-cell k-heading-cell k-side-cell k-scheduler-times-all-day"},t.toLanguageString(Me,Pr[Me])),e.children)},yn=k.forwardRef((e,t)=>{const{as:r=fn.as,...a}=e,l=k.useRef(null),s=k.useRef(null),c=o.useInternationalization(),i=k.useMemo(()=>n.classNames("k-scheduler-cell k-heading-cell",e.className),[e.className]);return k.useImperativeHandle(s,()=>({element:l.current&&l.current.element?l.current.element:l.current,props:e})),k.useImperativeHandle(t,()=>s.current),k.createElement(r,{ref:r!==fn.as?void 0:l,...a,className:i},c.formatDate(e.date,e.format?e.format:fn.format))}),fn={as:k.forwardRef(({as:e,format:t,start:r,end:a,...n},l)=>k.createElement("div",{...n,ref:l})),format:"t"};yn.displayName="KendoReactSchedulerTimeHeaderCell";const kn=e=>{const{slot:t,children:r}=e;return k.createElement(k.Fragment,null,e.isMaster?k.createElement(yn,{as:e.timeHeaderCell,date:t.zonedStart,start:t.zonedStart,end:t.zonedEnd,className:n.classNames("k-side-cell",{"k-major-cell":!e.isLast})}):k.createElement("div",{className:"k-scheduler-cell k-heading-cell k-side-cell"}),r)},Dn=k.forwardRef((e,t)=>{const{onFocus:r,onBlur:a,onClick:l,onMouseEnter:o,onMouseLeave:s,onMouseOut:c,onMouseOver:i,onDoubleClick:u,onKeyDown:d,onKeyPress:m,onKeyUp:p}=e,{slot:g,element:v}=((e,t)=>{const{_ref:r}=e,a=k.useRef(null),l=k.useRef(null),[,o]=Fa();return k.useImperativeHandle(a,()=>({element:l.current,props:e})),k.useImperativeHandle(t,()=>a.current),k.useImperativeHandle(r,()=>a.current),k.useLayoutEffect(()=>(o({type:n.COLLECTION_ACTION.add,item:a}),()=>{o({type:n.COLLECTION_ACTION.remove,item:a})})),{slot:a,element:l}})(e,t),h=void 0!==e.tabIndex?null===e.tabIndex?void 0:e.tabIndex:e.selected?0:-1,E=k.useMemo(()=>{var t,r;const a=null!=(t=e.isWorkHour)?t:Cn.isWorkHour,l=null!=(r=e.isWorkDay)?r:Cn.isWorkDay;return n.classNames("k-scheduler-cell",e.className,"k-slot-cell",{"k-nonwork-hour":!a||!l,"k-selected":e.selected})},[e.className,e.selected,e.isWorkHour,e.isWorkDay]),y=k.useMemo(()=>({userSelect:"none",...e.style}),[e.style]),f=k.useCallback(e=>{r&&r.call(void 0,{syntheticEvent:e,target:g.current})},[r,g]),D=k.useCallback(e=>{a&&a.call(void 0,{syntheticEvent:e,target:g.current})},[a,g]),C=k.useCallback(e=>{l&&l.call(void 0,{syntheticEvent:e,target:g.current})},[l,g]),b=k.useCallback(e=>{i&&i.call(void 0,{syntheticEvent:e,target:g.current})},[i,g]),S=k.useCallback(e=>{c&&c.call(void 0,{syntheticEvent:e,target:g.current})},[c,g]),w=k.useCallback(e=>{o&&o.call(void 0,{syntheticEvent:e,target:g.current})},[o,g]),I=k.useCallback(e=>{s&&s.call(void 0,{syntheticEvent:e,target:g.current})},[s,g]),R=k.useCallback(e=>{u&&u.call(void 0,{syntheticEvent:e,target:g.current})},[u,g]),T=k.useCallback(e=>{d&&d.call(void 0,{syntheticEvent:e,target:g.current})},[d,g]),x=k.useCallback(e=>{m&&m.call(void 0,{syntheticEvent:e,target:g.current})},[m,g]),A=k.useCallback(e=>{p&&p.call(void 0,{syntheticEvent:e,target:g.current})},[p,g]);return k.createElement("div",{ref:v,id:e.id,style:y,className:E,tabIndex:h,role:e.role,"aria-selected":e.selected||void 0,onFocus:f,onBlur:D,onClick:C,onMouseEnter:w,onMouseLeave:I,onMouseOver:b,onMouseOut:S,onDoubleClick:R,onKeyDown:T,onKeyPress:x,onKeyUp:A,"data-slot":!0,"data-slot-allday":e.isAllDay,"data-slot-start":e.start.getTime(),"data-slot-end":e.end.getTime(),"data-slot-group":e.group.index,"data-slot-range":e.range.index,"data-slot-index":e.index},e.children)}),Cn={isWorkHour:!0,isWorkDay:!0};Dn.displayName="KendoReactSchedulerSlot";const bn=e=>{const t=new Map;Array.from(e.querySelectorAll(".k-resource-row")).filter(e=>!e.classList.contains("k-resource-cell")).forEach(e=>{var r;const a=e.getAttribute("data-depth-index"),n=e.getAttribute("data-resource-index");if(null===a||null===n)return;const l=`${a}:${n}`;t.set(l,Math.max(null!=(r=t.get(l))?r:0,e.clientHeight-1))});const r=[];Array.from(e.querySelectorAll(".k-resource-cell")).forEach(e=>{const a=e.getAttribute("data-depth-index"),n=e.getAttribute("data-resource-index");if(null===a||null===n)return;const l=t.get(`${a}:${n}`);if(void 0===l)return;const o=Math.round(l-I(e));r.push({cell:e,height:o,minHeight:o>0?`${o}px`:""})}),r.forEach(({cell:e,height:t,minHeight:r})=>{e.style.minHeight!==r&&R(e,{height:t},!0)})},Sn=new Set;let wn;const In=e=>{Sn.add(e),void 0===wn&&(wn=window.requestAnimationFrame(()=>{wn=void 0;const e=Array.from(Sn);Sn.clear();const t=new Set;e.map(e=>{try{return e()}catch{return}}).forEach(e=>{if(!e)return;const{element:r,minHeight:a}=e,n=a&&a>0?`${a}px`:"";if(r.style.minHeight!==n){R(r,{height:null!=a?a:0},!0);const e=r.closest(".k-scheduler-layout");e&&t.add(e)}}),t.forEach(bn)}))},Rn=(e,t,r,a)=>{const n=ae(),l=!!t,o="object"==typeof t&&t.offsetTop?t.offsetTop:0,s="object"==typeof t&&t.offsetBottom?t.offsetBottom:0,c=null!=a?a:e.current&&e.current.props.items,i=c?JSON.stringify(c.map(e=>{var t,r;return[e.uid,e.isRecurring&&null!=(r=null==(t=e.originalStart)?void 0:t.getTime())?r:null]})):"",u=r?`${r.padding}|${r.paddingTop}|${r.paddingBottom}`:"",d=k.useCallback(()=>{if(!l||!e.current)return;const t=e.current.element,r=e.current.props;if(!t)return;const a=I(t),n=new Map;let c=!1;const i=r.items.filter(e=>e._ref.current);let u;if(i.forEach(e=>{var t,r,a,l,o;if(!e._ref.current)return;const{height:s}=w(e._ref.current.element),i=null!=(a=null!=(r=null==(t=e._ref.current)?void 0:t._order)?r:e.order)?a:-1;null!=(l=e._ref.current.element)&&l.style.top&&(c=!0),(null!=(o=n.get(i))?o:0)<s&&n.set(i,s)}),!c||0===n.size)return{element:t,minHeight:null};const d=Math.max(...Array.from(n.keys())),m=d+1,p=Math.max(...Array.from(n.values()));u=0;for(let e=0;e<=d;e++)u+=n.has(e)?n.get(e):p;const g=1*m*2+u-a+o+s;return{element:t,minHeight:i.length?g:null}},[l,s,o,e]),m=k.useCallback(()=>{In(d)},[d]);k.useEffect(()=>{var t;if(!l){const r=e.current;if(null!=r&&r.element){const e=null==(t=r.props.style)?void 0:t.minHeight;r.element.style.minHeight="number"==typeof e?`${e}px`:null!=e?e:""}return}return In(d),()=>(e=>{Sn.delete(e),0===Sn.size&&void 0!==wn&&(window.cancelAnimationFrame(wn),wn=void 0)})(d)},[d,l,e,i,u]),k.useEffect(()=>{if(!l||!e.current)return;const t=e.current.props.items.filter(e=>e._ref.current).map(e=>{if(!e._ref.current||!e._ref.current.element||!n.current)return;const t=window.ResizeObserver,r=t&&new t(m);r&&r.observe(e._ref.current.element);const a=new MutationObserver(m);return a.observe(e._ref.current.element,{attributes:!0,attributeFilter:["style"]}),()=>{r&&r.disconnect(),a.disconnect()}});return()=>{t.forEach(e=>e&&e())}},[l,m,n,e,i])},Tn=k.forwardRef((e,t)=>{var r;const{slot:a,_ref:n,...l}=e,o=a||xn.slot,s=k.useRef(null),c=k.useRef(null);return k.useImperativeHandle(s,()=>({props:e})),k.useImperativeHandle(n,()=>c.current),k.useImperativeHandle(t,()=>s.current),Rn(c,null!=(r=e.expandable)?r:xn.expandable,e.style,e.items),k.createElement(o,{...l,_ref:c})}),xn={slot:Dn,expandable:!1};Tn.displayName="KendoReactSchedulerViewSlot";const An=k.createContext([null]);An.displayName="SchedulerEditSlotPropsContext";const Mn=k.createContext([null]);Mn.displayName="SchedulerEditSlotFormItemContext";const Nn=({props:e,form:t,children:r})=>k.createElement(An.Provider,{value:e},k.createElement(Mn.Provider,{value:t},r)),Ln={position:"top",collision:{horizontal:"fit",vertical:"flip"}},zn={position:"right",collision:{horizontal:"flip",vertical:"fit"}},_n=/(auto|scroll|overlay)/,Fn=(e,t,r)=>{k.useEffect(()=>{if(!e||!t||!r)return;const a=(e=>{const t=[];let r=e.parentElement;for(;r;){const{overflow:e,overflowX:a,overflowY:n}=getComputedStyle(r);if(_n.test(`${e}${a}${n}`)&&t.push(r),r.classList.contains("k-scheduler"))break;r=r.parentElement}return t})(t);if(0===a.length)return;const n=()=>{const e=t.getBoundingClientRect();return a.some(r=>{const a=((e,t)=>{const r=e.getBoundingClientRect(),a={top:r.top,left:r.left,right:r.right,bottom:r.bottom},n=e.querySelector(".k-scheduler-head");n&&!n.contains(t)&&(a.top=Math.max(a.top,n.getBoundingClientRect().bottom));const l=e.querySelector(".k-sticky-cell");if(l&&!t.closest(".k-sticky-cell")){const e=l.getBoundingClientRect();e.left-r.left<=r.right-e.right?a.left=Math.max(a.left,e.right):a.right=Math.min(a.right,e.left)}return a})(r,t);return e.bottom<=a.top||e.top>=a.bottom||e.right<=a.left||e.left>=a.right})},l=()=>{n()&&r()};return a.forEach(e=>e.addEventListener("scroll",l,{passive:!0})),()=>{a.forEach(e=>e.removeEventListener("scroll",l))}},[e,t,r])},On={skeleton:"MMMMd"},Wn=e=>{const{value:t,onChange:r,onKeyDown:a,valid:n,placeholder:l,ariaLabel:o}=e;return k.createElement(h.TextBox,{"aria-label":o,placeholder:l,autoComplete:"off",value:null!=t?t:"",onChange:r,onKeyDown:a,valid:n})},Pn=e=>{const{show:t,anchor:r,dataItem:l,validator:c,onSubmit:i,onMoreOptions:u,onCancel:p}=e,g=o.useInternationalization(),h=o.useLocalization(),E=ie(),{timezone:f}=le(),D=(()=>{const[e]=Ce(),t=ge(),r=me(),n=he();return k.useMemo(()=>"timeline"===e?zn:Math.max(1,Math.round((t.end.getTime()-t.start.getTime())/a.MS_PER_DAY))*("horizontal"===n?Math.max(1,r.length):1)<=1?Ln:zn,[e,t,r,n])})(),C=k.useRef(null),b=k.useCallback(()=>{null==p||p({value:null,syntheticEvent:void 0})},[p]);Fn(t,r,b),k.useEffect(()=>{if(!t)return;const e=e=>{var t,r;const a=e.target,n=null==(r=null==(t=C.current)?void 0:t.element)?void 0:r.closest(".k-popover");n&&n.contains(a)||null==p||p({value:null,syntheticEvent:void 0})};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[t,r,p]);const S=L(l,E.start),w=L(l,E.end),I=!!L(l,E.isAllDay),R=h.toLanguageString(Me,Pr[Me]);let T="";if(S&&w){const e=a.ZonedDate.fromLocalDate(S,f),t=a.ZonedDate.fromLocalDate(w,f);T=I?`${g.formatDate(e,On)}, ${R}`:`${g.formatDate(e,On)}, ${g.formatDate(e,"t")} - ${g.formatDate(t,"t")}`}const x=h.toLanguageString(Mr,Pr[Mr]),A=h.toLanguageString(Xe,Pr[Xe]),M=h.toLanguageString(zr,Pr[zr]),N=h.toLanguageString(_r,Pr[_r]),_=h.toLanguageString(Fr,Pr[Fr]),F=k.useCallback((e,t)=>{i({value:e,syntheticEvent:t})},[i]),O=k.useCallback(e=>t=>{if(!u)return;const r={...l};z(r,E.title,e.valueGetter(E.title)),u({value:r,syntheticEvent:t})},[u,l,E.title]),W=k.useCallback(e=>{p&&p({value:null,syntheticEvent:e})},[p]),P=k.useCallback(()=>{null==p||p({value:null,syntheticEvent:void 0})},[p]),H="top"===D.position||"bottom"===D.position,$={vertical:H?6:0,horizontal:H?0:6};return k.createElement(m.Form,{key:S?S.getTime():void 0,initialValues:l,validator:c,ignoreModified:!0,onSubmit:F,render:e=>k.createElement(y.Popover,{anchor:r,show:t,position:D.position,collision:D.collision,callout:!1,title:x,style:{width:360},onKeyDown:P,animate:{openDuration:1,closeDuration:1},margin:$},k.createElement(m.FormElement,{ref:C,horizontal:!0,className:"k-scheduler-edit-form"},k.createElement(m.FieldWrapper,null,k.createElement(v.Label,{className:"k-form-label"},k.createElement(n.SvgIcon,{icon:d.rightDoubleQuotesIcon,size:"xlarge"})),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(m.Field,{name:E.title,component:Wn,ariaLabel:A,placeholder:x,onKeyDown:t=>{"Enter"===t.key&&(t.preventDefault(),e.onSubmit(t))}}))),k.createElement(m.FieldWrapper,null,k.createElement(v.Label,{className:"k-form-label"},k.createElement(n.SvgIcon,{icon:d.clockIcon,size:"xlarge"})),k.createElement("div",{className:"k-form-field-wrap"},k.createElement("div",{className:"k-scheduler-edit-form-row k-color-subtle"},T)))),k.createElement(y.PopoverActionsBar,null,k.createElement(s.Button,{type:"button",fillMode:"flat",themeColor:"primary",onClick:O(e)},N),k.createElement("span",{className:"k-spacer"}),k.createElement(s.Button,{type:"button",onClick:W},_),k.createElement(s.Button,{type:"button",themeColor:"primary",disabled:!e.allowSubmit,onClick:e.onSubmit},M)))})};Pn.displayName="KendoReactSchedulerQuickCreateForm";const Hn=e=>{const t=k.useContext(ne),r=void 0!==e?e:t.editable||!1,a=!0===r||void 0!==r&&!1!==r&&!0===r.edit,n=!0===r||void 0!==r&&!1!==r&&!0===r.resize,l=!0===r||void 0!==r&&!1!==r&&!0===r.remove,o=!0===r||void 0!==r&&!1!==r&&!0===r.drag;return{add:!0===r||void 0!==r&&!1!==r&&!0===r.add,edit:a,drag:o,remove:l,resize:n,select:!0===r||void 0!==r&&!1!==r&&!0===r.select}},$n=(e=200)=>{const t=k.useRef(null),r=k.useCallback(()=>{null!==t.current&&(clearTimeout(t.current),t.current=null)},[]),a=k.useCallback(a=>{r(),t.current=setTimeout(()=>{t.current=null,a()},e)},[r,e]);return k.useEffect(()=>r,[r]),{schedule:a,cancel:r}},Kn=k.forwardRef((e,t)=>{const{_ref:r,onDataAction:a,viewSlot:l,form:o,formItem:s,onFormItemChange:c,quickCreateFormItem:i,onQuickCreateFormItemChange:u,...d}=e,[m,p]=k.useState(e.tabIndex),g=k.useRef(null),v=k.useRef(null);k.useImperativeHandle(v,()=>({props:e})),k.useImperativeHandle(t,()=>v.current),k.useImperativeHandle(r,()=>g.current);const h=Hn(e.editable),E=ie(),[y]=Fa(),[f]=Wa(),[D,C]=k.useContext(Pa),[,b]=Va(),S=o||Bn.form,w=l||Bn.viewSlot,[I,R]=we(null,s,e.onFormItemChange),T=le(),[x]=Ce(),A="agenda"!==x&&!1!==T.quickCreate,N=e.quickCreateForm||T.quickCreateForm||Pn,[_,F]=we(null,i,u),O=k.useRef(null),W=$n(),P=D.some(t=>!(!t.current||t.current.props.start.getTime()!==e.start.getTime()||t.current.props.end.getTime()!==e.end.getTime()||t.current.props.index!==e.index||t.current.props.group.index!==e.group.index||t.current.props.range.index!==e.range.index||t.current.props.isAllDay!==e.isAllDay)),H=k.useCallback(()=>{const t={};if(z(t,E.start,new Date(e.start.getTime())),z(t,E.end,new Date(e.end.getTime())),z(t,E.isAllDay,e.isAllDay),e.group.resources.length)for(let r=0;r<e.group.resources.length;r++){const a=e.group.resources[r];if(M(e.group.resources)){const n=L(e.group.resources[r],a.valueField);z(t,a.field,a.multiple?[n]:n)}else z(t,a.field,a.multiple?[]:void 0)}return t},[E.start,E.end,E.isAllDay,e.start,e.end,e.isAllDay,e.group.resources]),$=k.useCallback(t=>{h.select&&C({type:qa.select,slot:g},t.syntheticEvent),e.onFocus&&e.onFocus.call(void 0,t)},[C,h.select,e.onFocus]),K=k.useCallback(t=>{if(h.add&&A){const e=t.target?t.target.element:null;W.schedule(()=>{O.current=e,F(H())})}e.onClick&&e.onClick.call(void 0,t)},[H,h.add,A,e.onClick,W,F]),B=k.useCallback(t=>{if(W.cancel(),F(null),h.add){const e=H();R(e,t)}e.onDoubleClick&&e.onDoubleClick.call(void 0,t)},[H,h.add,e.onDoubleClick,R,W,F]),V=k.useCallback(e=>{let t;switch(e.syntheticEvent.keyCode){case n.Keys.left:if(!y)return;e.syntheticEvent.preventDefault(),b({type:Ya.left,slot:g},e.syntheticEvent);break;case n.Keys.right:if(!y)return;e.syntheticEvent.preventDefault(),b({type:Ya.right,slot:g},e.syntheticEvent);break;case n.Keys.up:if(!y)return;e.syntheticEvent.preventDefault(),b({type:Ya.up,slot:g},e.syntheticEvent);break;case n.Keys.down:if(!y)return;e.syntheticEvent.preventDefault(),b({type:Ya.down,slot:g},e.syntheticEvent);break;case n.Keys.enter:{if(!y||!h.add)return;const t=H();A?(O.current=e.target?e.target.element:null,F(t)):R(t);break}case n.Keys.tab:t=(e=>{const t=e.props.items.find(e=>0===e.order)||e.props.items[0];return t&&t._ref.current})(e.target)}t&&(e.syntheticEvent.preventDefault(),t.element&&t.element.focus())},[H,b,h.add,A,R,y,F]),G=k.useCallback(e=>{a&&a.call(void 0,{type:te.create,series:!1,dataItem:e.value},e),R(null,e.syntheticEvent)},[a,R]),U=k.useCallback(e=>{R(null,e.syntheticEvent)},[R]),q=k.useCallback(e=>{R(null,e)},[R]),Z=k.useCallback((e,t)=>{R&&R(e,t)},[R]),Y=k.useCallback(()=>{O.current&&O.current.focus({preventScroll:!0})},[]),j=k.useCallback(e=>{a&&a.call(void 0,{type:te.create,series:!1,dataItem:e.value},e.syntheticEvent),F(null),Y()},[a,Y,F]),X=k.useCallback(e=>{R(e.value),F(null)},[R,F]),Q=k.useCallback(()=>{F(null),Y()},[Y,F]);return k.useEffect(()=>{const t=y.length&&y[0].current===g.current;p(void 0!==e.tabIndex?null===e.tabIndex?void 0:e.tabIndex:0===D.length&&t&&0===f.length?0:void 0)},[f,e.tabIndex,D.length,y]),k.createElement(Nn,{props:e,form:[I,Z]},k.createElement(w,{...d,_ref:g,selected:P,tabIndex:m,onFocus:$,onClick:K,onDoubleClick:B,onKeyDown:V}),I&&k.createElement(S,{dataItem:I,onSubmit:G,onClose:q,onCancel:U}),_&&k.createElement(N,{show:!0,anchor:O.current,dataItem:_,onSubmit:j,onMoreOptions:X,onCancel:Q}))}),Bn={viewSlot:Tn,form:Aa};Kn.displayName="KendoReactSchedulerEditSlot";const Vn=k.forwardRef((e,t)=>{const{isRemove:r,onClose:a,onSeriesClick:l,onOccurrenceClick:c}=e,i=k.useRef(null);k.useImperativeHandle(i,()=>({props:e})),k.useImperativeHandle(t,()=>i.current);const u=o.useLocalization(),d=e=>u.toLanguageString(e,Pr[e]),m=d(Ve),g=d(Ge),v=d(Ue),h=d(qe),E=d(Kt),y=d(Bt),f=d(Ut),C=d($t),b=r?f:h,S=r?C:v,w=r?E:m,I=r?y:g,R=k.useCallback(({syntheticEvent:e})=>{a&&a.call(void 0,{syntheticEvent:e,value:null,target:i.current})},[a]),T=k.useCallback(e=>{l&&l.call(void 0,{syntheticEvent:e,value:null,target:i.current})},[l]),x=k.useCallback(e=>{c&&c.call(void 0,{syntheticEvent:e,value:null,target:i.current})},[c]);return n.canUseDOM?D.createPortal(k.createElement(p.Dialog,{title:b,onClose:R},S,k.createElement(p.DialogActionsBar,null,k.createElement(s.Button,{onClick:x},w),k.createElement(s.Button,{onClick:T},I))),document&&document.body):null});Vn.displayName="KendoReactSchedulerSchedulerOccurrenceDialog";const Gn=k.forwardRef((e,t)=>{const{onClose:r,onCancel:a,onConfirm:l,isSeries:c}=e,i=k.useRef(null);k.useImperativeHandle(i,()=>({props:e})),k.useImperativeHandle(t,()=>i.current);const u=o.useLocalization(),d=u.toLanguageString(Ye,Pr[Ye]),m=u.toLanguageString(Wt,Pr[Wt]),g=c?u.toLanguageString(Ht,Pr[Ht]):u.toLanguageString(Pt,Pr[Pt]),v=c?u.toLanguageString(Gt,Pr[Gt]):u.toLanguageString(Vt,Pr[Vt]),h=k.useCallback(({syntheticEvent:e})=>{if(!r)return;const t={syntheticEvent:e,value:null,target:i.current};r.call(void 0,t)},[r]),E=k.useCallback(e=>{a&&a.call(void 0,{syntheticEvent:e,value:null})},[a]),y=k.useCallback(e=>{l&&l.call(void 0,{syntheticEvent:e,value:null})},[l]);return n.canUseDOM?D.createPortal(k.createElement(p.Dialog,{title:v,onClose:h},g,k.createElement(p.DialogActionsBar,null,k.createElement(s.Button,{onClick:E},d),k.createElement(s.Button,{onClick:y},m))),document&&document.body):null});Gn.displayName="KendoReactSchedulerRemoveDialog";const Un=k.forwardRef((e,t)=>{const{onFocus:r,onBlur:a,onMouseDown:l,onClick:s,onMouseUp:c,onMouseOut:i,onMouseOver:u,onMouseEnter:d,onMouseLeave:m,onDoubleClick:p,onKeyUp:g,onKeyDown:v,onKeyPress:h,onPress:E,onDrag:y,onRelease:f,onResizePress:D,onResizeEndDrag:C,onResizeRelease:b,onResizeStartDrag:S}=e,{item:w,element:I}=((e,t)=>{const{_ref:r,itemRef:a,_maxSiblingsPerSlot:l,_siblings:o,_order:s}=e,c=k.useRef(null),i=k.useRef(null),[,u]=Wa();return k.useImperativeHandle(c,()=>({element:i.current,props:e,get _maxSiblingsPerSlot(){return null==l?void 0:l.current},set _maxSiblingsPerSlot(e){var t;null!=e&&void 0!==l&&void 0!==l.current&&(l.current=e,null==(t=null==o?void 0:o.current)||t.forEach(t=>{var r;!t||t._maxSiblingsPerSlot===e||e<(null!=(r=t._maxSiblingsPerSlot)?r:0)||(t._maxSiblingsPerSlot=e)}))},get _order(){return null==s?void 0:s.current},set _order(e){void 0!==e&&void 0!==s&&void 0!==s.current&&(s.current=e)}})),k.useImperativeHandle(t,()=>c.current),k.useImperativeHandle(r,()=>c.current),k.useImperativeHandle(a,()=>c.current),n.useIsomorphicLayoutEffect(()=>(u({type:n.COLLECTION_ACTION.add,item:c}),()=>{u({type:n.COLLECTION_ACTION.remove,item:c})})),{item:c,element:i}})(e,t),R=k.useRef(null),T=k.useRef(null),x=k.useRef(null),A=k.useRef(null),M=Hn(e.editable),N=e.readonly?{resize:!1,select:M.select}:M,L=o.useInternationalization(),z=o.useLocalization().toLanguageString(Me,Pr[Me]),_=e.group.resources.find(e=>!(!e.colorField||""===e[e.colorField]||void 0===e[e.colorField])),F=_&&_.colorField&&_[_.colorField],O=void 0!==e.tabIndex?null===e.tabIndex?void 0:e.tabIndex:e.selected?0:-1,W=k.useMemo(()=>{var t;return n.classNames({"k-event":!e.resizeHint,"k-event-all-day":!(e.resizeHint||!0!==(null==(t=e.range)?void 0:t.isAllDay)||e.isAllDay||e.head&&e.tail),"k-selected":e.selected&&N.select||e.dragHint,"k-readonly":!e.resizeHint&&!!e.readonly,"k-event-drag-hint":e.dragSource,"k-scheduler-marquee":e.resizeHint,"k-marquee":e.resizeHint,"k-first":e.resizeHint&&!e.tail,"k-last":e.resizeHint&&!e.head},e.className)},[e.resizeHint,e.selected,e.readonly,e.dragHint,e.dragSource,e.tail,e.head,e.isAllDay,e.className,e.range,N.select]),P=k.useMemo(()=>`${e.title}, ${function(e,t,r,a,n="all day"){const l={skeleton:"yMMMMEEEEdhm"},o={skeleton:"yMMMMEEEEd"},s=t.getFullYear()===r.getFullYear()&&t.getMonth()===r.getMonth()&&t.getDate()===r.getDate();if(a){const a=0===r.getHours()&&0===r.getMinutes()&&0===r.getSeconds()&&r.getTime()-t.getTime()===864e5;return s||a?`${e.formatDate(t,o)} (${n})`:`${e.formatDate(t,o)} to ${e.formatDate(r,o)} (${n})`}return s?`${e.formatDate(t,l)}–${e.formatDate(r,"t")}`:`${e.formatDate(t,l)}-${e.formatDate(r,l)}`}(L,e.zonedStart,e.zonedEnd,e.isAllDay,z)}`,[L,e.isAllDay,e.title,e.zonedEnd,e.zonedStart,z]),H=k.useMemo(()=>{var t;return{cursor:"pointer",userSelect:"none",...F?e.resizeHint?{"--kendo-marquee-color":F}:{"--kendo-scheduler-event-color":F}:void 0,touchAction:"none",...e.style,containerType:e.resizeHint?void 0:"auto"===(null==(t=e.style)?void 0:t.height)?"normal":"size"}},[F,e.style,e.resizeHint]),$=k.useCallback(e=>{r&&r.call(void 0,{syntheticEvent:e,target:w.current})},[r,w]),K=k.useCallback(e=>{a&&a.call(void 0,{syntheticEvent:e,target:w.current})},[a,w]),B=k.useCallback(e=>{l&&l.call(void 0,{syntheticEvent:e,target:w.current})},[l,w]),V=k.useCallback(e=>{s&&s.call(void 0,{syntheticEvent:e,target:w.current})},[s,w]),G=k.useCallback(e=>{c&&c.call(void 0,{syntheticEvent:e,target:w.current})},[c,w]),U=k.useCallback(e=>{u&&u.call(void 0,{syntheticEvent:e,target:w.current})},[u,w]),q=k.useCallback(e=>{i&&i.call(void 0,{syntheticEvent:e,target:w.current})},[i,w]),Z=k.useCallback(e=>{d&&d.call(void 0,{syntheticEvent:e,target:w.current})},[d,w]),Y=k.useCallback(e=>{m&&m.call(void 0,{syntheticEvent:e,target:w.current})},[m,w]),j=k.useCallback(t=>{!p||e.readonly||p.call(void 0,{syntheticEvent:t,target:w.current})},[p,w,e.readonly]),X=k.useCallback(e=>{v&&v.call(void 0,{syntheticEvent:e,target:w.current})},[v,w]),Q=k.useCallback(e=>{h&&h.call(void 0,{syntheticEvent:e,target:w.current})},[h,w]),J=k.useCallback(e=>{g&&g.call(void 0,{syntheticEvent:e,target:w.current})},[g,w]),ee=k.useCallback(t=>{!E||e.readonly||E.call(void 0,{dragEvent:t,target:w.current})},[E,w,e.readonly]),te=k.useCallback(t=>{!y||e.readonly||y.call(void 0,{dragEvent:t,target:w.current})},[y,w,e.readonly]),re=k.useCallback(t=>{!f||e.readonly||f.call(void 0,{dragEvent:t,target:w.current})},[f,w,e.readonly]),ae=k.useCallback(t=>{!D||e.readonly||D.call(void 0,{dragEvent:t,target:w.current})},[D,w,e.readonly]),ne=k.useCallback(e=>{S&&S.call(void 0,{dragEvent:e,target:w.current})},[S,w]),le=k.useCallback(e=>{C&&C.call(void 0,{dragEvent:e,target:w.current})},[C,w]),oe=k.useCallback(e=>{b&&b.call(void 0,{dragEvent:e,target:w.current})},[b,w]);return n.useDraggable(I,{onPress:ee,onDrag:te,onRelease:re}),n.useDraggable(R,{onPress:ae,onDrag:le,onRelease:oe}),n.useDraggable(T,{onPress:ae,onDrag:ne,onRelease:oe}),n.useDraggable(x,{onPress:ae,onDrag:ne,onRelease:oe}),n.useDraggable(A,{onPress:ae,onDrag:le,onRelease:oe}),k.createElement("div",{ref:I,id:e.id,style:H,tabIndex:O,className:W,role:"button","aria-label":P,onFocus:$,onBlur:K,onMouseUp:G,onMouseDown:B,onClick:V,onMouseOver:U,onMouseOut:q,onMouseEnter:Z,onMouseLeave:Y,onDoubleClick:j,onKeyDown:X,onKeyPress:Q,onKeyUp:J,"data-group-index":e.group.index,"data-range-index":e.range.index},e.children,N.resize&&!e.dragHint&&e.vertical&&k.createElement(k.Fragment,null,k.createElement("span",{className:"k-resize-handle k-resize-n",ref:x}),k.createElement("span",{className:"k-resize-handle k-resize-s",ref:A})),N.resize&&!e.dragHint&&!e.vertical&&k.createElement(k.Fragment,null,k.createElement("span",{className:"k-resize-handle k-resize-w",ref:T}),k.createElement("span",{className:"k-resize-handle k-resize-e",ref:R})),e.resizeHint&&k.createElement(k.Fragment,null,k.createElement("div",{className:"k-marquee-color"}),k.createElement("div",{className:"k-marquee-text"},!e.tail&&k.createElement("div",{className:"k-label-top"},L.formatDate(e.zonedStart,e.format)),!e.head&&k.createElement("div",{className:"k-label-bottom"},L.formatDate(e.zonedEnd,e.format)))))});Un.displayName="KendoReactSchedulerItem";const qn=k.forwardRef((e,t)=>{const r=k.useMemo(()=>n.classNames("k-event-template",e.className),[e.className]);return k.createElement("div",{ref:t,...e,className:r})}),Zn=(e,t)=>{const{element:r}=e;k.useEffect(()=>{if(!r||!e.syncHeight)return;const t=[[]];Array.from(r.querySelectorAll(e.selector)).filter(t=>!t.classList.contains((e=>e.slice(1,e.length))(e.applyTo))).forEach(r=>{const a=r.clientHeight,n=r.getAttribute(e.horizontalAttribute),l=r.getAttribute(e.verticalAttribute);null===n||null===l||(t[n]||(t[n]=[]),(!t[n][l]||a>t[n][l])&&(t[n][l]=a-1))}),Array.from(r.querySelectorAll(e.applyTo)).forEach(r=>{const a=r.getAttribute(e.horizontalAttribute),n=r.getAttribute(e.verticalAttribute);if(null===a||null===n)return;const l=I(r),o=Math.round(t[a][n]-l);R(r,{height:o},!0)})},t)},Yn=k.forwardRef((e,t)=>{var r;const{item:a,_ref:l,itemRef:s,...c}=e,i=k.useRef(void 0),u=k.useRef(void 0),m=k.useRef(null),p=k.useRef(null),g=k.useRef(null),v=Hn(e.editable);k.useImperativeHandle(p,()=>({props:e,element:m.current&&m.current.element})),k.useImperativeHandle(t,()=>p.current),k.useImperativeHandle(l,()=>m.current),k.useImperativeHandle(s,()=>m.current);const h=a||jn.item,E=o.useInternationalization(),[y]=Wa(),[f]=Fa(),D=ae(),[C,b]=k.useState(!0),[S,I]=k.useState(!1),x=k.useRef(e.order),A=k.useRef(0),M=k.useRef(!1),N=n.useDir(D),L=k.useMemo(()=>{var t,r;return e.isAllDay?null!=(t=e.title)?t:"":`(${E.format("{0:t} - {1:t}",e.zonedStart,e.zonedEnd)}): ${null!=(r=e.title)?r:""}`},[E,e.isAllDay,e.title,e.zonedEnd,e.zonedStart]);let z;e.isRecurring&&!e.isException?z="recurring":!e.isRecurring&&e.isException&&(z="non-recurring");const _=k.useMemo(()=>E.format("{0:t} – {1:t}",e.zonedStart,e.zonedEnd),[E,e.zonedStart,e.zonedEnd]),F=!0===(null==(r=e.range)?void 0:r.isAllDay),O=(e,t)=>{let r=1;return e.forEach(e=>{const a=t.filter(t=>W(e.current.props,t.props));a.length>r&&(r=a.length)}),r},W=(t,r)=>$(t.start,t.end,r.start,r.end)&&t.group.index===r.group.index&&t.range.index===r.range.index&&(void 0===t.range.isAllDay||void 0===r.range.isAllDay||t.range.isAllDay===r.range.isAllDay)&&(e.ignoreIsAllDay||t.isAllDay===r.isAllDay),P=()=>{var t,r,a,n,l,o,s,c;const i=(f||[]).filter(t=>t.current&&W(t.current.props,e)).sort((e,t)=>e.current.props.start.getTime()-t.current.props.start.getTime()),u=m.current&&m.current.element,d=T(i);if(0===i.length)return void b(!1);if(!d.current||!u)return;const p=w(d.current.element),g=[],h=[],E=[];(y||[]).forEach(e=>{e.current&&(e.current.props.dragHint?h.push(e.current):e.current.props.resizeHint?E.push(e.current):g.push(e.current))});const k=e.dragHint||e.resizeHint?((e,t,r,a=!1)=>{let n;return r.forEach(r=>{const l=[];t.sort((e,t)=>e.props.start.getTime()-t.props.start.getTime()).forEach(t=>{if((a||t.props.isAllDay===r.current.props.isAllDay)&&t.props.range.index===r.current.props.range.index&&t.props.group.index===r.current.props.group.index&&$(t.props.start,t.props.end,r.current.props.start,r.current.props.end)){const r=G(l);t===e&&void 0===n&&(n=r),l.splice(r,0,r)}})}),n})(m.current,e.dragHint?h:E,i,e.ignoreIsAllDay):null!=(t=e.order)?t:0;if(e.vertical||e.dragHint||e.resizeHint||null===e.order||void 0===e.order)x.current=k;else{const t=(!0===(null==(r=e.range)?void 0:r.isAllDay)?g.filter(e=>{var t;return!0===(null==(t=e.props.range)?void 0:t.isAllDay)}):e.ignoreIsAllDay?g:g.filter(e=>e.props.isAllDay)).filter(t=>t.props.group.index===e.group.index),l=null==(a=e.style)?void 0:a.height,o="number"==typeof l?l:parseFloat(l),s=null!=l&&Number.isNaN(o),c=!0===(null==(n=e.range)?void 0:n.isAllDay),i=!!e.ignoreIsAllDay&&!c,u=c,d=!!i||!s;x.current=((e,t,r,a=!1,n=!1)=>{var l;const o=t.filter(e=>null!==e.props.order&&void 0!==e.props.order).map(e=>{let t=e.props.start,r=e.props.end;if(e.props.isAllDay||a){t=new Date(t.getFullYear(),t.getMonth(),t.getDate());const e=new Date(r.getFullYear(),r.getMonth(),r.getDate());r=e.getTime()<=t.getTime()?new Date(t.getFullYear(),t.getMonth(),t.getDate()+1):e}else if(n){const e=new Date(t.getFullYear(),t.getMonth(),t.getDate()),a=new Date(r.getFullYear(),r.getMonth(),r.getDate()),n=a.getTime()<r.getTime()?new Date(a.getFullYear(),a.getMonth(),a.getDate()+1):a;t=e,r=n.getTime()<=e.getTime()?new Date(e.getFullYear(),e.getMonth(),e.getDate()+1):n}return{order:e.props.order,start:t,end:r}}),s=Array.from(new Set(o.map(e=>e.order))).sort((e,t)=>e-t),c=new Map;for(const e of o)c.has(e.order)||c.set(e.order,[]),c.get(e.order).push({start:e.start,end:e.end});const i=[],u=new Map;for(const e of s){const t=c.get(e);let a=-1,n=0;u.forEach((a,l)=>{if(l>=e)return;const o=c.get(l);o&&t.some(e=>o.some(t=>$(t.start,t.end,e.start,e.end,r)))&&a+1>n&&(n=a+1)});for(let e=n;e<i.length;e++)if(t.every(t=>i[e].every(e=>!$(e.start,e.end,t.start,t.end,r)))){a=e;break}-1===a&&(a=i.length,i.push([])),i[a].push(...t),u.set(e,a)}return null!=(l=u.get(e))?l:e})(e.order,t,d,i,u)}let D=e.dragHint||e.resizeHint?O(i,e.dragHint?h:E):O(i,g);const C=((e,t)=>e.map(e=>t.filter(t=>W(e.current.props,t.props))))(i,g);let S=0;const N=!e.vertical&&null!==x.current;if(C.forEach(e=>{let t=0;e.forEach(e=>{if(!N){const r=w(e.element);null!==e.props.order&&void 0!==e.props.order&&e.props.order<x.current&&(t=r.top+r.height-p.top-1*x.current+1)}}),t>S&&(S=t)}),N){const t=null==(l=e.style)?void 0:l.height,r="number"==typeof t?t:parseFloat(t);if(null==t)S=26*x.current;else if(Number.isNaN(r)){const t=!0===(null==(o=e.range)?void 0:o.isAllDay),r=!!e.ignoreIsAllDay&&!t,a=(t?g.filter(e=>{var t;return!0===(null==(t=e.props.range)?void 0:t.isAllDay)}):e.ignoreIsAllDay?g:g.filter(e=>e.props.isAllDay)).filter(t=>t.props.group.index===e.group.index&&t.element!==u&&(!r||!d.current||$(t.props.start,t.props.end,d.current.props.start,d.current.props.end))),n=new Map;a.forEach(e=>{var t,r;const a=e._order;if(null==a||a>=x.current)return;const l=(null==(t=e.element)?void 0:t.offsetHeight)||25;n.set(a,Math.max(null!=(r=n.get(a))?r:0,l))}),S=Array.from(n.values()).reduce((e,t)=>e+t+1,0)}else S=x.current*(r+1)}if(0===i.length)return void b(!1);const L=v.add?20:0;p.width=e.vertical?p.width/D-1-L/D:p.width*i.length-1,e.vertical?p.height=p.height*i.length-1:(e.resizeHint||e.dragHint)&&D<=1||(p.height=null!=(c=null==(s=e.style)?void 0:s.height)?c:25),p.left=e.vertical?p.left+x.current*p.width+1*x.current:p.left;const z=!e.vertical&&e.slotHeaderOffset||0;p.top=e.vertical?p.top:p.top+S+1*x.current+z,A.current=D,R(u,p),(M.current||e.dragHint||e.resizeHint)&&I(!0),b(!0)},H=k.useCallback(e=>{const t=e&&e[0],r=g.current;void 0!==i.current&&window.cancelAnimationFrame(i.current),r&&t&&(r.width!==t.contentRect.width||r.height!==t.contentRect.height)&&(i.current=window.requestAnimationFrame(()=>{P()})),g.current={width:t.contentRect.width,height:t.contentRect.height}},[P]);k.useEffect(()=>(P(),void 0!==u.current&&window.cancelAnimationFrame(u.current),u.current=window.requestAnimationFrame(()=>{u.current=window.requestAnimationFrame(()=>{u.current=void 0,P(),M.current=!0,I(!0)})}),()=>{void 0!==u.current&&(window.cancelAnimationFrame(u.current),u.current=void 0)}));const K=m.current&&m.current.element?m.current.element.closest(".k-scheduler-layout"):null;return Zn({element:K,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:e.isLast}),k.useEffect(()=>{if(!D.current)return;const e=window.ResizeObserver,t=e&&new e(H);return t&&t.observe(D.current),()=>{t&&t.disconnect()}},[H,D]),k.createElement(h,{...c,_ref:m,_maxSiblingsPerSlot:A,_order:x,itemRef:m,style:{visibility:S?void 0:"hidden",display:C?void 0:"none",...e.style}},!e.resizeHint&&k.createElement(k.Fragment,null,e.tail&&!e.vertical&&k.createElement("span",{className:"k-event-continuation"},k.createElement(n.IconWrap,{name:"rtl"===N?"chevron-right":"chevron-left",icon:"rtl"===N?d.chevronRightIcon:d.chevronLeftIcon})),k.createElement("div",{title:L},e.tail&&e.vertical&&k.createElement("span",{className:"k-event-continuation"},k.createElement(n.IconWrap,{name:"chevron-up",icon:d.chevronUpIcon})),F&&!e.isAllDay&&!e.tail&&k.createElement("span",{className:"k-event-all-day-time"},E.formatDate(e.zonedStart,"t")),k.createElement(qn,{className:"k-event-title"},e.title),F&&!e.isAllDay&&!e.head&&k.createElement("span",{className:"k-event-all-day-time"},E.formatDate(e.zonedEnd,"t")),!F&&k.createElement(qn,{className:"k-event-time"},"recurring"===z&&k.createElement("span",{className:"k-event-recurrence-icon"},k.createElement(n.IconWrap,{name:"arrow-rotate-cw",icon:d.arrowRotateCwIcon})),"non-recurring"===z&&k.createElement("span",{className:"k-event-recurrence-icon"},k.createElement(n.IconWrap,{name:"arrows-no-repeat",icon:d.arrowsNoRepeatIcon})),_),e.head&&e.vertical&&k.createElement("span",{className:"k-event-continuation"},k.createElement(n.IconWrap,{name:"chevron-down",icon:d.chevronDownIcon}))),z&&k.createElement("span",{className:"k-event-recurrence-icon"},k.createElement(n.IconWrap,{name:"recurring"===z?"arrow-rotate-cw":"arrows-no-repeat",icon:"recurring"===z?d.arrowRotateCwIcon:d.arrowsNoRepeatIcon})),e.head&&!e.vertical&&k.createElement("span",{className:"k-event-continuation"},k.createElement(n.IconWrap,{name:"rtl"===N?"chevron-left":"chevron-right",icon:"rtl"===N?d.chevronLeftIcon:d.chevronRightIcon}))))}),jn={item:Un};Yn.displayName="KendoReactSchedulerViewItem";const Xn=(e,{dateRange:t,fields:r,timezone:a})=>{const l=n.getter(r.recurrenceId||"recurrenceId"),o=n.getter(r.recurrenceRule||"recurrenceRule"),s=new Set(e.filter(e=>null!=l(e)&&!!o(e)).map(l));return e.map(Qn(r)).reduce(Jn(t,a,r,s),[]).filter(e=>!W(e.dataItem,r))},Qn=e=>t=>{const r=n.getter(e.start||"start")(t),a=n.getter(e.originalStart||"originalStart")(t),l=n.getter(e.recurrenceId||"recurrenceId")(t),o=n.getter(e.recurrenceRule||"recurrenceRule")(t),s=null!=l&&!!o&&null==a,c=n.clone(t);return s&&z(c,e.originalStart||"originalStart",r),{uid:n.getter(e.id||"id")(t),start:r,startTimezone:n.getter(e.startTimezone||"startTimezone")(t),originalStart:s?r:a,end:n.getter(e.end||"end")(t),endTimezone:n.getter(e.endTimezone||"endTimezone")(t),isAllDay:n.getter(e.isAllDay||"isAllDay")(t),title:n.getter(e.title||"title")(t),description:n.getter(e.description||"description")(t),occurrenceId:n.getter("occurrenceId")(t),recurrenceRule:o,recurrenceExceptions:n.getter(e.recurrenceExceptions||"recurrenceExceptions")(t),recurrenceId:l,readonly:n.getter(e.readonly||"readonly")(t),dataItem:c}},Jn=(e,t,r,a)=>(n,l)=>[...n,...!l.recurrenceRule||null!==l.recurrenceId&&void 0!==l.recurrenceId||!W(l.dataItem,r)||a.has(l.uid)?[l]:[...el(l,{dateRange:e,timezone:t,fields:r})]],el=(e,{dateRange:t,timezone:r,fields:l})=>{const o=e.recurrenceRule,s=g.parseRule({recurrenceRule:o});if(!s)return[];s.start||(s.start=a.ZonedDate.fromLocalDate(e.start,r)),s.end||(s.end=a.ZonedDate.fromLocalDate(e.end,r));const c=e.recurrenceExceptions;c&&(s.exceptionDates=c.map(e=>a.ZonedDate.fromLocalDate(e,r)));const i=s.end.getTime()-s.start.getTime(),u=a.ZonedDate.fromLocalDate(new Date(t.zonedStart.toLocalDate().getTime()-i),r),d=t.zonedEnd,m=g.expand(s,{rangeStart:u,rangeEnd:d});if(!m.events.length)return[];const p=s.until,v=p&&s.bySetPosition?m.events.filter(e=>e.start.getTime()<=p.getTime()):m.events;return v.length?v.map((t,r)=>{const a=n.clone(e),o=n.clone(e.dataItem);return a.recurrenceId=a.uid,z(o,l.recurrenceId,e.uid),a.originalStart=t.start.toLocalDate(),z(o,l.originalStart,t.start.toLocalDate()),a.start=t.start.toLocalDate(),z(o,l.start,t.start.toLocalDate()),a.end=t.end.toLocalDate(),z(o,l.end,t.end.toLocalDate()),a.occurrenceId=String(r),z(o,"occurrenceId",String(r)),a.dataItem=o,a}):[]},tl=(e,{timezone:t,ignoreIsAllDay:r},{groups:n,ranges:o})=>{const s=[];return l.orderBy(e,[{field:"start",dir:"asc"},{field:"end",dir:"desc"},{field:"isAllDay",dir:"desc"},{field:"title",dir:"asc"},{field:"uid",dir:"asc"}]).forEach(e=>{n.forEach(n=>{const l=!!n.isDefault,c=l?rl(e,n):n;(l||nl(e,c))&&o.forEach(n=>{var l;if(ll(e,n,t,r)){const r=k.createRef(),o=k.createRef(),i=n.end<e.end,u=e.start<n.start,d=a.ZonedDate.fromLocalDate(e.start,t),m=a.ZonedDate.fromLocalDate(e.end,t),p={...e,_ref:o,itemRef:r,head:i,tail:u,order:null,zonedStart:d,zonedEnd:m,group:c,range:n,slots:[],isRecurring:!!e.recurrenceRule,isException:!e.recurrenceRule&&null!==e.recurrenceId&&void 0!==e.recurrenceId,isAllDay:!!e.isAllDay,readonly:null!=(l=e.readonly)?l:void 0};s.push(p)}})})}),s},rl=(e,t)=>({index:0,resources:t.resources.filter(t=>al(e,t))}),al=(e,t)=>t.multiple?(e.dataItem[t.field]||[]).some(e=>t[t.valueField]===e):e.dataItem[t.field]===t[t.valueField],nl=(e,t)=>!t.resources.some(t=>t.multiple?!(e.dataItem[t.field]||[]).some(e=>t[t.valueField]===e):e.dataItem[t.field]!==t[t.valueField]),ll=(e,t,r,a)=>!!$(t.start,t.end,e.start,e.end)&&(!(void 0!==t.isAllDay&&!a&&!!e.isAllDay!=!!t.isAllDay)||!(!t.isAllDay||e.isAllDay)&&A(e.start,e.end,r)),ol=e=>{const t=za(),{timezone:r}=le(),a=me(),n=ie(),l=ge(),[o]=Fa(),s=e.viewItem||sl.viewItem,c=k.useMemo(()=>Xn([e.dataItem],{dateRange:l,fields:n,timezone:r}),[e.dataItem,l,n,r]),i=k.useMemo(()=>{const r=!0===e.ignoreIsAllDay;return t.filter(e=>void 0===e.isAllDay||e.isAllDay===r)},[t,e.ignoreIsAllDay]),u=k.useMemo(()=>tl(c,{timezone:r,ignoreIsAllDay:e.ignoreIsAllDay},{groups:a,ranges:i}),[c,r,a,i,e.ignoreIsAllDay]),d=(o||[]).map(e=>e.current.props);return q(u,d,e.ignoreIsAllDay),k.createElement(k.Fragment,null,u.map((t,r)=>k.createElement(s,{key:r,...t,item:e.item,dragHint:!0,vertical:e.vertical,ignoreIsAllDay:e.ignoreIsAllDay})))},sl={viewItem:Yn,item:Un};ol.displayName="KendoReactSchedulerDrag";const cl=e=>{const t=za(),{timezone:r}=le(),a=me(),n=ie(),l=ge(),[o]=Fa(),s=e.viewItem||il.viewItem,c=k.useMemo(()=>Xn([e.dataItem],{dateRange:l,fields:n,timezone:r}),[e.dataItem,l.start.getTime(),l.end.getTime(),n,r]),i=k.useMemo(()=>{const r=!0===e.ignoreIsAllDay;return t.filter(e=>void 0===e.isAllDay||e.isAllDay===r)},[t,e.ignoreIsAllDay]),u=k.useMemo(()=>tl(c,{timezone:r,ignoreIsAllDay:e.ignoreIsAllDay},{groups:a,ranges:i}),[c,r,a,i,e.ignoreIsAllDay]),d=(o||[]).map(e=>e.current.props);return q(u,d,e.ignoreIsAllDay),k.createElement(k.Fragment,null,u.map((t,r)=>{var a;return k.createElement(s,{key:r,...t,format:e.format,item:null!=(a=e.item)?a:il.item,resizeHint:!0,vertical:e.vertical,ignoreIsAllDay:e.ignoreIsAllDay})}))},il={viewItem:Yn,item:Un};cl.displayName="KendoReactSchedulerResize";const ul=k.createContext([null]);ul.displayName="SchedulerEditItemPropsContext";const dl=k.createContext([null,n.noop,n.noop]);dl.displayName="SchedulerEditItemFormItemContext";const ml=k.createContext([null,n.noop,n.noop]);ml.displayName="SchedulerEditItemDragItemContext";const pl=k.createContext([null,n.noop,n.noop]);pl.displayName="SchedulerEditItemResizeItemContext";const gl=k.createContext([null,n.noop,n.noop]);gl.displayName="SchedulerEditItemRemoveItemContext";const vl=k.createContext([!1,n.noop,n.noop]);vl.displayName="SchedulerEditItemShowRemoveDialogContext";const hl=k.createContext([!1,n.noop,n.noop]);hl.displayName="SchedulerEditItemShowOccurrenceDialogContext";const El=({props:e,form:t,drag:r,resize:a,remove:n,showRemoveDialog:l,showOccurrenceDialog:o,children:s})=>k.createElement(ul.Provider,{value:e},k.createElement(dl.Provider,{value:t},k.createElement(ml.Provider,{value:r},k.createElement(pl.Provider,{value:a},k.createElement(gl.Provider,{value:n},k.createElement(vl.Provider,{value:l},k.createElement(hl.Provider,{value:o},s)))))));var yl=(e=>(e.set="FORM_ITEM_SET",e.setMaster="FORM_ITEM_SET_MASTER",e.reset="FORM_ITEM_RESET",e.complete="FORM_ITEM_COMPLETE",e))(yl||{});var fl=(e=>(e.set="SHOW_OCCURRENCE_DIALOG_SET",e.open="SHOW_OCCURRENCE_DIALOG_OPEN",e.close="SHOW_OCCURRENCE_DIALOG_CLOSE",e.reset="SHOW_OCCURRENCE_DIALOG_RESET",e.toggle="SHOW_OCCURRENCE_DIALOG_TOGGLE",e))(fl||{});var kl=(e=>(e.set="REMOVE_ITEM_SET",e.reset="REMOVE_ITEM_RESET",e.complete="REMOVE_ITEM_COMPLETE",e))(kl||{});var Dl=(e=>(e.set="SHOW_REMOVE_DIALOG_SET",e.open="SHOW_REMOVE_DIALOG_OPEN",e.close="SHOW_REMOVE_DIALOG_CLOSE",e.reset="SHOW_REMOVE_DIALOG_RESET",e.toggle="SHOW_REMOVE_DIALOG_TOGGLE",e))(Dl||{});var Cl=(e=>(e.set="DRAG_ITEM_SET",e.start="DRAG_ITEM_START",e.drag="DRAG_ITEM_DRAG",e.complete="DRAG_ITEM_COMPLETE",e.completeOccurrence="DRAG_ITEM_COMPLETE_OCCURRENCE",e.completeSeries="DRAG_ITEM_COMPLETE_SERIES",e.reset="DRAG_ITEM_RESET",e.dragSelected="DRAG_ITEM_DRAG_SELECTED",e))(Cl||{});var bl=(e=>(e.set="RESIZE_ITEM_SET",e.start="RESIZE_ITEM_START",e.startDrag="RESIZE_ITEM_START_DRAG",e.startDragSelected="RESIZE_ITEM_START_DRAG_SELECTED",e.endDrag="RESIZE_ITEM_END_DRAG",e.endDragSelected="RESIZE_ITEM_END_DRAG_SELECTED",e.complete="RESIZE_ITEM_COMPLETE",e.completeOccurrence="RESIZE_ITEM_COMPLETE_OCCURRENCE",e.completeSeries="RESIZE_ITEM_COMPLETE_SERIES",e.reset="RESIZE_ITEM_RESET",e))(bl||{});var Sl=(e=>(e.reset="SERIES_RESET",e.set="SERIES_SET",e.toggle="SERIES_TOGGLE",e))(Sl||{});const wl=(e,t,r)=>{const[a,n]=we(e,t,r);return[a,n,e=>{const t=((e,t)=>{switch(t.type){case"SERIES_RESET":return null;case"SERIES_SET":return t.payload;case"SERIES_TOGGLE":return!e;default:return e}})(a,e);n(t)}]},Il={position:"right",collision:{horizontal:"fit",vertical:"fit"}},Rl={skeleton:"MMMMd"},Tl="t",xl=e=>{const{show:t,anchor:r,dataItem:l,fields:c,position:i,collision:u,isRecurring:p,canEdit:g,canRemove:h,onEdit:E,onEditOccurrence:f,onEditSeries:D,onDelete:C,onDeleteOccurrence:b,onDeleteSeries:S,onClose:w}=e,I=o.useInternationalization(),R=o.useLocalization(),{timezone:T}=le(),x=k.useRef(null);k.useEffect(()=>{if(!t)return;const e=e=>{const t=e.target,a=x.current&&x.current.element&&x.current.element.closest(".k-popover"),n=!!a&&a.contains(t),l=!!r&&r.contains(t);!n&&!l&&w()};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[t,r,w]),Fn(t,r,w),k.useEffect(()=>{if(t&&(g||h)&&x.current&&x.current.element){const e=x.current.element.closest(".k-popover"),t=e&&(e.querySelector(".k-popover-actions .k-button-primary")||e.querySelector(".k-popover-actions .k-button"));t&&t.focus()}},[t,g,h]);const A=k.useCallback(()=>{w()},[w]),M=R.toLanguageString(Or,Pr[Or]),N=R.toLanguageString(Wr,Pr[Wr]),z=L(l,c.title)||R.toLanguageString(Yt,Pr[Yt]),_=L(l,c.start),F=L(l,c.end),O=!!L(l,c.isAllDay),W=L(l,c.description),P=R.toLanguageString(Me,Pr[Me]),H=k.useMemo(()=>{if(!_||!F)return"";const e=a.ZonedDate.fromLocalDate(_,T),t=a.ZonedDate.fromLocalDate(F,T),r=0===t.getHours()&&0===t.getMinutes()&&0===t.getSeconds()&&0===t.getMilliseconds()?t.addDays(-1):t,n=e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()&&e.getDate()===r.getDate();return O?n?`${I.formatDate(e,Rl)}, ${P}`:`${I.formatDate(e,Rl)} - ${I.formatDate(r,Rl)}, ${P}`:n?`${I.formatDate(e,Rl)}, ${I.formatDate(e,Tl)} - ${I.formatDate(t,Tl)}`:`${I.formatDate(e,Rl)}, ${I.formatDate(e,Tl)} - ${I.formatDate(t,Rl)}, ${I.formatDate(t,Tl)}`},[I,_,F,O,P,T]),$=k.useMemo(()=>[{text:R.toLanguageString(Ve,Pr[Ve]),scope:"occurrence"},{text:R.toLanguageString(Ge,Pr[Ge]),scope:"series"}],[R]),K=k.useMemo(()=>[{text:R.toLanguageString(Kt,Pr[Kt]),scope:"occurrence"},{text:R.toLanguageString(Bt,Pr[Bt]),scope:"series"}],[R]),B=k.useCallback(e=>{"series"===e.item.scope?D():f()},[f,D]),V=k.useCallback(e=>{"series"===e.item.scope?S():b()},[b,S]),G=g||h,U="top"===i||"bottom"===i,q={vertical:U?6:0,horizontal:U?0:6};return k.createElement(y.Popover,{anchor:r,show:t,position:i,collision:u,callout:!1,title:z,style:{width:360},onKeyDown:A,autoFocus:!1,animate:{openDuration:1,closeDuration:1},margin:q},k.createElement(m.FormElement,{ref:x,horizontal:!0,className:"k-scheduler-edit-form"},k.createElement(m.FieldWrapper,null,k.createElement(v.Label,{className:"k-form-label"},k.createElement(n.SvgIcon,{icon:d.clockIcon,size:"xlarge"})),k.createElement("div",{className:"k-form-field-wrap"},k.createElement("div",{className:"k-scheduler-edit-form-row k-color-subtle"},H))),W&&k.createElement(m.FieldWrapper,null,k.createElement(v.Label,{className:"k-form-label"},k.createElement(n.SvgIcon,{icon:d.commentIcon,size:"xlarge"})),k.createElement("div",{className:"k-form-field-wrap"},k.createElement("div",{className:"k-scheduler-edit-form-row"},W)))),G&&k.createElement(y.PopoverActionsBar,{alignment:"end"},h&&(p?k.createElement(s.DropDownButton,{text:N,items:K,textField:"text",onItemClick:V}):k.createElement(s.Button,{type:"button",onClick:C},N)),g&&(p?k.createElement(s.DropDownButton,{text:M,themeColor:"primary",items:$,textField:"text",onItemClick:B}):k.createElement(s.Button,{type:"button",themeColor:"primary",onClick:E},M))))};xl.displayName="KendoReactSchedulerEventOverviewPopover";const Al=e=>{const{onKeep:t,onReset:r,onCancel:a}=e,l=o.useLocalization(),c=l.toLanguageString(dr,Pr[dr]),i=l.toLanguageString(mr,Pr[mr]),u=l.toLanguageString(pr,Pr[pr]),d=l.toLanguageString(gr,Pr[gr]),m=l.toLanguageString(vr,Pr[vr]),g=k.createElement(p.Dialog,{title:c,onClose:a,width:510},k.createElement("p",null,i),k.createElement(p.DialogActionsBar,{layout:"start"},k.createElement(s.Button,{fillMode:"flat",onClick:a},m),k.createElement("span",{className:"k-spacer"}),k.createElement(s.Button,{onClick:r},d),k.createElement(s.Button,{themeColor:"primary",onClick:t},u)));return n.canUseDOM?D.createPortal(g,document.body):null};Al.displayName="KendoReactKeepResetCustomEventsDialog";const Ml=e=>!0===e||"object"==typeof e&&null!==e&&!0===e.drag,Nl=k.forwardRef((e,t)=>{var r;const{_ref:a,itemRef:l,onDataAction:o,ignoreIsAllDay:s,viewItem:c,series:i,onSeriesChange:u,form:d,formItem:m,onFormItemChange:p,drag:g,dragItem:v,onDragItemChange:h,resize:E,resizeItem:y,onResizeItemChange:f,removeDialog:D,removeItem:C,onRemoveItemChange:b,occurrenceDialog:S,showOccurrenceDialog:w,onShowOccurrenceDialogChange:I,showRemoveDialog:R,onShowRemoveDialogChange:T,onFocus:x,onFocusAction:A,onMouseDown:M,onMouseDownAction:_,onMouseUp:F,onMouseUpAction:W,onClick:P,onClickAction:H,onDoubleClick:$,onDoubleClickAction:K,onRemoveClick:B,onRemoveClickAction:V,onPress:G,onPressAction:U,onDrag:q,onDragAction:Z,onRelease:Y,onReleaseAction:j,onResizePress:X,onResizePressAction:Q,onResizeStartDrag:J,onResizeStartDragAction:ee,onResizeEndDrag:re,onResizeEndDragAction:ae,onResizeRelease:ne,onResizeReleaseAction:oe,onOccurrenceClick:se,onOccurrenceClickAction:ce,onSeriesClick:ue,onSeriesClickAction:de,onKeyDown:pe,onKeyDownAction:ge,onKeyUp:ve,onKeyUpAction:he,onRemoveConfirm:Ee,onRemoveConfirmAction:ye,onFormSubmit:fe,onFormSubmitAction:De,onCancel:Ce,onCancelAction:Se}={...Ll,...e},[Ie,Re]=k.useState(e.tabIndex),Te=k.useRef(null),xe=k.useRef(null),Ae=n.useId();k.useImperativeHandle(Te,()=>({props:e,element:xe.current&&xe.current.element})),k.useImperativeHandle(t,()=>Te.current),k.useImperativeHandle(a,()=>xe.current),k.useImperativeHandle(l,()=>xe.current);const Me=c||Ll.viewItem,Ne=g||Ll.drag,Le=E||Ll.resize,ze=d||Ll.form,_e=S||Ll.occurrenceDialog,Fe=D||Ll.removeDialog,Oe=Hn(e.editable),We=ie(),Pe=le(),[He]=ke(),$e=!1!==Pe.eventOverview,Ke=Il,[Be,Ve]=k.useState(null),Ge=k.useRef(null),Ue=$n(),[qe,Ze]=$a(),[Ye,je]=k.useState(null),Xe=k.useRef(null),Qe=k.useCallback(e=>{const t=Array.isArray(e)?e[0]:e;if(!t)return!1;const r=L(t,We.recurrenceId),a=null!=r?r:L(t,We.id),n=He.find(e=>L(e,We.id)===a),l=n&&L(n,We.recurrenceExceptions);return Array.isArray(l)&&l.length>0},[We,He]),Je=k.useCallback((e,t)=>{e&&e.series&&(e.type===te.update||e.type===te.remove)&&Qe(e.dataItem)?je({action:e,event:t,fromForm:null!==Xe.current}):o&&o(e,t)},[o,Qe]),[et,,tt]=wl(null,i,u),[rt,at,nt]=((e,t)=>{const[r,a]=we(...t),l=ie(),[o]=ke();return[r,a,(t,s)=>{let c;switch(t.type){case"FORM_ITEM_SET":c=t.payload;break;case"FORM_ITEM_RESET":c=null;break;case"FORM_ITEM_SET_MASTER":c=n.clone(O(t.payload,l,o));break;case"FORM_ITEM_COMPLETE":e.onDataAction&&r&&(e.onDataAction.call(void 0,{type:te.update,series:e.series,dataItem:t.payload}),c=null);break;default:c=r}a(c,s)}]})({series:et,onDataAction:Je},[null,m,p]),[lt,ot,st]=((e,t)=>{const r=k.useRef(0),a=k.useRef(0),l=k.useRef(0),o=k.useRef(null),s=k.useRef(!1),[c,i]=we(...t),[u]=$a(),d=ie(),m=me();return[c,i,t=>{switch(t.type){case"DRAG_ITEM_SET":i(t.payload);break;case"DRAG_ITEM_RESET":i(null);break;case"DRAG_ITEM_DRAG_SELECTED":{if(Math.abs(a.current-t.payload.x)<10&&Math.abs(l.current-t.payload.y)<10)return;const c=N(t.payload.x,t.payload.y,7);if(!c||c===o.current)return;const m=n.clone(e.dataItem),p=c.getAttribute("data-slot-start"),g="true"===c.getAttribute("data-slot-allday");if(!e.ignoreIsAllDay&&g!==e.isAllDay||s.current&&!g)return;const v=new Date(L(m,d.start)),h=Number(p)-Number(r.current)-v.getTime(),E=u.map(e=>{if(!e.current)return null;const t=n.clone(e.current.props.dataItem),r=new Date(e.current.props.start.getTime()+h),a=new Date(e.current.props.end.getTime()+h);return z(t,d.start,r),z(t,d.end,a),t}).filter(Boolean);o.current=c,i([...E]);break}case"DRAG_ITEM_START":{const o=t.payload.x,c=t.payload.y;a.current=o,l.current=c;const i=N(o,c,7);if(!i)return;s.current="true"===i.getAttribute("data-slot-allday");const u=n.clone(e.dataItem),m=i.getAttribute("data-slot-start"),p=L(u,d.start);if(null===m)return;r.current=Number(m)-new Date(p).getTime();break}case"DRAG_ITEM_DRAG":{if(Math.abs(a.current-t.payload.x)<10&&Math.abs(l.current-t.payload.y)<10)return;const c=N(t.payload.x,t.payload.y,7);if(!c||c===o.current)return;const u=n.clone(e.dataItem),p=c.getAttribute("data-slot-start"),g=c.getAttribute("data-slot-group"),v="true"===c.getAttribute("data-slot-allday");if(!e.ignoreIsAllDay&&v!==e.isAllDay||s.current&&!v)return;const h=new Date(L(u,d.start)),E=new Date(L(u,d.end)).getTime()-h.getTime(),y=new Date(Number(p)-Number(r.current)),f=new Date(Number(p)-Number(r.current)+E),k=m.find(e=>e.index===Number(g));z(u,d.start,y),z(u,d.end,f),k&&m.length>1&&k.resources.forEach(e=>{e.multiple||z(u,e.field,e[e.valueField])}),o.current=c,u&&i(u);break}case"DRAG_ITEM_COMPLETE":i(null),e.onDataAction&&c&&e.onDataAction.call(void 0,{type:te.update,series:!1,dataItem:c});break;case"DRAG_ITEM_COMPLETE_OCCURRENCE":{const t=Array.isArray(c)?c.slice():n.clone(c);i(null),e.onDataAction&&t&&e.onDataAction.call(void 0,{type:te.update,series:!1,dataItem:t});break}case"DRAG_ITEM_COMPLETE_SERIES":{let t;if(Array.isArray(c))t=c.map(e=>{const t=n.clone(e);return z(t,d.start,L(e,d.start)),z(t,d.end,L(e,d.end)),t});else{const e=n.clone(c);z(e,d.start,L(c,d.start)),z(e,d.end,L(c,d.end)),t=e}i(null),e.onDataAction&&t&&e.onDataAction.call(void 0,{type:te.update,series:!0,dataItem:t});break}default:i(c)}}]})({dataItem:e.dataItem,ignoreIsAllDay:e.ignoreIsAllDay,isAllDay:e.isAllDay,onDataAction:Je},[null,v,h]),[ct,it,ut]=((e,t)=>{const r=k.useRef(null),[a,l]=we(...t),[o]=$a(),s=ie(),c=t=>void 0===e.rangeIsAllDay||"true"===t.getAttribute("data-slot-allday")===e.rangeIsAllDay;return[a,l,(t,i)=>{let u=a;switch(t.type){case"RESIZE_ITEM_SET":u=t.payload;break;case"RESIZE_ITEM_RESET":default:u=null;break;case"RESIZE_ITEM_START":{if(i.stopPropagation(),!u)return;const a=t.payload.x,l=t.payload.y,o=N(a,l,7);if(!o||o===r.current||!c(o))return;const d=o.getAttribute("data-slot-start"),m=new Date(Number(d)),p=n.clone(e.dataItem);if(m>=L(p,s.end)){r.current=null,u=null;break}z(p,s.start,m),r.current=o,u=p;break}case"RESIZE_ITEM_START_DRAG_SELECTED":{i.stopPropagation();const a=t.payload.x,l=t.payload.y,d=n.clone(e.dataItem),m=N(a,l,7);if(!m||m===r.current||!c(m))return;const p=m.getAttribute("data-slot-start"),g=new Date(L(d,s.start)),v=new Date(Number(p)).getTime()-g.getTime();let h=!1;const E=o.map(e=>{if(!e.current)return null;const t=n.clone(e.current.props.dataItem),r=new Date(e.current.props.start.getTime()+v);if(!(r>=L(t,s.end)))return z(t,s.start,r),t;h=!0}).filter(Boolean);h?(r.current=null,u=null):u=[...E];break}case"RESIZE_ITEM_START_DRAG":{const a=t.payload.x,l=t.payload.y,o=N(a,l,7);if(!o||o===r.current||!c(o))return;const i=o.getAttribute("data-slot-start"),d=new Date(Number(i)),m=n.clone(e.dataItem);if(d>=m.end){r.current=null,u=null;break}z(m,s.start,d),r.current=o,u=m;break}case"RESIZE_ITEM_END_DRAG":{const a=t.payload.x,l=t.payload.y,o=N(a,l,7);if(!o||o===r.current||!c(o))return;const i=o.getAttribute("data-slot-end"),d=new Date(Number(i)),m=n.clone(e.dataItem);if(d<=m.start){r.current=null,u=null;break}z(m,s.end,d),r.current=o,u=m;break}case"RESIZE_ITEM_END_DRAG_SELECTED":{i.stopPropagation();const a=t.payload.x,l=t.payload.y,d=n.clone(e.dataItem),m=N(a,l,7);if(!m||m===r.current||!c(m))return;const p=m.getAttribute("data-slot-start"),g=new Date(L(d,s.end)),v=new Date(Number(p)).getTime()-g.getTime();let h;const E=o.map(e=>{if(!e.current)return null;const t=n.clone(e.current.props.dataItem),r=new Date(e.current.props.end.getTime()+v);if(!(r<=L(t,s.start)))return z(t,s.end,r),t;h=!0}).filter(Boolean);h?(r.current=null,u=null):u=[...E];break}case"RESIZE_ITEM_COMPLETE":case"RESIZE_ITEM_COMPLETE_OCCURRENCE":u=null,e.onDataAction&&a&&e.onDataAction.call(void 0,{type:te.update,series:!1,dataItem:a});break;case"RESIZE_ITEM_COMPLETE_SERIES":{let t;if(u=null,Array.isArray(a))t=a.map(e=>{const t=n.clone(e);return z(t,s.start,L(e,s.start)),z(t,s.end,L(e,s.end)),t});else{const e=n.clone(a);z(e,s.start,L(a,s.start)),z(e,s.end,L(a,s.end)),t=e}e.onDataAction&&t&&e.onDataAction.call(void 0,{type:te.update,series:!0,dataItem:t});break}}l(u)}]})({dataItem:e.dataItem,rangeIsAllDay:null==(r=e.range)?void 0:r.isAllDay,onDataAction:Je},[null,y,f]),[dt,mt,pt]=((e,t)=>{const[r,a]=we(...t);return[r,a,t=>{let n;switch(t.type){case"REMOVE_ITEM_SET":n=t.payload;break;case"REMOVE_ITEM_RESET":n=null;break;case"REMOVE_ITEM_COMPLETE":e.onDataAction&&r&&e.onDataAction.call(void 0,{type:te.remove,series:e.series,dataItem:r}),n=null;break;default:n=r}a(n)}]})({series:et,onDataAction:Je},[null,C,b]);Xe.current=rt;const[gt,vt,ht]=((e,t,r)=>{const[a,n]=we(e,t,r);return[a,n,e=>{const t=((e,t)=>{switch(t.type){case"SHOW_REMOVE_DIALOG_RESET":case"SHOW_REMOVE_DIALOG_CLOSE":return!1;case"SHOW_REMOVE_DIALOG_SET":return t.payload;case"SHOW_REMOVE_DIALOG_OPEN":return!0;case"SHOW_REMOVE_DIALOG_TOGGLE":return!e;default:return e}})(a,e);n(t)}]})(!1,R,T),[Et,yt,ft]=((e,t,r)=>{const[a,n]=we(e,t,r);return[a,n,e=>{const t=((e,t)=>{switch(t.type){case"SHOW_OCCURRENCE_DIALOG_RESET":case"SHOW_OCCURRENCE_DIALOG_CLOSE":return!1;case"SHOW_OCCURRENCE_DIALOG_SET":return t.payload;case"SHOW_OCCURRENCE_DIALOG_OPEN":return!0;case"SHOW_OCCURRENCE_DIALOG_TOGGLE":return!e;default:return e}})(a,e);n(t)}]})(!1,w,I),[kt]=Wa(),[,Dt]=k.useContext(Ka),[,Ct]=Va(),bt=!!(xe.current&&qe&&qe.some(e=>e.current===xe.current)),St=k.useMemo(()=>({selected:bt,series:et,formItem:rt,dragItem:lt,resizeItem:ct,removeItem:dt,showRemoveDialog:gt,showOccurrenceDialog:Et}),[lt,rt,dt,ct,bt,et,Et,gt]),wt=k.useMemo(()=>({[Sl.set]:tt,[Sl.toggle]:tt,[Sl.reset]:tt,[Ua.select]:Ze,[Ua.add]:Ze,[Ua.remove]:Ze,[Ua.reset]:Ze,[Ua.selectNext]:Ze,[Ua.selectPrev]:Ze,[yl.set]:nt,[yl.setMaster]:nt,[yl.reset]:nt,[yl.complete]:nt,[kl.set]:pt,[kl.reset]:pt,[kl.complete]:pt,[fl.close]:ft,[fl.open]:ft,[fl.set]:ft,[fl.toggle]:ft,[fl.reset]:ft,[Dl.close]:ht,[Dl.open]:ht,[Dl.set]:ht,[Dl.toggle]:ht,[Dl.reset]:ht,[Cl.start]:st,[Cl.drag]:st,[Cl.complete]:st,[Cl.completeOccurrence]:st,[Cl.completeSeries]:st,[Cl.set]:st,[Cl.reset]:st,[Cl.dragSelected]:st,[bl.start]:ut,[bl.startDrag]:ut,[bl.startDragSelected]:ut,[bl.endDrag]:ut,[bl.endDragSelected]:ut,[bl.complete]:ut,[bl.completeOccurrence]:ut,[bl.completeSeries]:ut,[bl.set]:ut,[bl.reset]:ut,[en.next]:Dt,[en.prev]:Dt,[Ya.left]:Ct,[Ya.right]:Ct,[Ya.up]:Ct,[Ya.down]:Ct,null:()=>{}}),[st,nt,Ze,pt,ut,tt,ft,ht,Dt,Ct]),It=k.useCallback(t=>{if(A){const r=A(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t)):wt[r.type]({...r,item:xe}))}x&&x.call(void 0,t)},[wt,x,A,e,St]),Rt=k.useCallback(t=>{if(_){const r=_(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t)):wt[r.type]({...r,item:xe}))}M&&M.call(void 0,t)},[wt,M,_,e,St]),Tt=k.useCallback(t=>{if(W){const r=W(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t)):wt[r.type]({...r,item:xe}))}F&&F.call(void 0,t)},[wt,F,W,e,St]),[,xt]=k.useContext(be),At=k.useCallback(t=>{if(H){xt(xe.current);const r=H(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t)):wt[r.type]({...r,item:xe}))}P&&P.call(void 0,t),$e&&Ue.schedule(()=>{Ge.current=xe.current&&xe.current.element,Ve(e.dataItem)})},[wt,P,H,e,St,$e,Ue]),Mt=k.useCallback(t=>{if(Ue.cancel(),Ve(null),K){const r=K(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t)):wt[r.type]({...r,item:xe}))}$&&$.call(void 0,t)},[K,$,e,wt,St,Ue]),Nt=k.useCallback(t=>{if(V){const r=V(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t)):wt[r.type]({...r,item:xe}))}B&&B.call(void 0,t)},[V,B,e,wt,St]),Lt=k.useCallback(t=>{if(U){const r=U(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t)):wt[r.type]({...r,item:xe},t))}G&&G.call(void 0,t)},[U,G,e,wt,St]),zt=k.useCallback(t=>{if(Z){const r=Z(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t.dragEvent.originalEvent)):wt[r.type]({...r,item:xe},t.dragEvent.originalEvent))}q&&q.call(void 0,t)},[Z,q,e,wt,St]),_t=k.useCallback(t=>{if(j){const r=j(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t.dragEvent.originalEvent)):wt[r.type]({...r,item:xe},t.dragEvent.originalEvent))}Y&&Y.call(void 0,t)},[j,Y,e,wt,St]),Ft=k.useCallback(t=>{if(Q){const r=Q(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t.dragEvent.originalEvent)):wt[r.type]({...r,item:xe},t.dragEvent.originalEvent))}X&&X.call(void 0,t)},[Q,X,e,St,wt]),Ot=k.useCallback(t=>{if(ee){const r=ee(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t.dragEvent.originalEvent)):wt[r.type]({...r,item:xe},t.dragEvent.originalEvent))}J&&J.call(void 0,t)},[J,ee,e,wt,St]),Wt=k.useCallback(t=>{if(ae){const r=ae(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t.dragEvent.originalEvent)):wt[r.type]({...r,item:xe},t.dragEvent.originalEvent))}re&&re.call(void 0,t)},[re,ae,e,wt,St]),Pt=k.useCallback(t=>{if(oe){const r=oe(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t.dragEvent.originalEvent)):wt[r.type]({...r,item:xe},t.dragEvent.originalEvent))}ne&&ne.call(void 0,t)},[oe,ne,e,wt,St]),Ht=k.useCallback(t=>{if(De){const r=De(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t)):wt[r.type]({...r,item:xe},t))}fe&&fe.call(void 0,t)},[De,fe,e,St,wt]),$t=k.useCallback(t=>{if(Se){const r=Se(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t)):wt[r.type]({...r,item:xe},t))}Ce&&Ce.call(void 0,t)},[Se,Ce,e,St,wt]),Kt=k.useCallback(t=>{if(ce){const r=ce(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t)):wt[r.type]({...r,item:xe},t))}se&&se.call(void 0,t)},[ce,se,e,St,wt]),Bt=k.useCallback(t=>{if(de){const r=de(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t)):wt[r.type]({...r,item:xe},t))}ue&&ue.call(void 0,t)},[de,ue,e,St,wt]),Vt=k.useCallback(t=>{if($e&&t.syntheticEvent.keyCode===n.Keys.enter)return t.syntheticEvent.preventDefault(),Ge.current=xe.current&&xe.current.element,Ve(e.dataItem),void(pe&&pe.call(void 0,t));if(ge){const r=ge(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t.syntheticEvent)):wt[r.type]({...r,item:xe},t.syntheticEvent))}pe&&pe.call(void 0,t)},[ge,pe,e,St,wt,$e]),Gt=k.useCallback(t=>{if(he){const r=he(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t.syntheticEvent)):wt[r.type]({...r,item:xe},t.syntheticEvent))}ve&&ve.call(void 0,t)},[he,ve,e,St,wt]),Ut=k.useCallback(e=>{pt({type:kl.set,payload:e.value||rt}),ht({type:Dl.open})},[pt,ht,rt]),qt=k.useCallback(t=>{if(ye){const r=ye(t,e,St);r&&(Array.isArray(r)?r.filter(Boolean).map(e=>e&&wt[e.type]({...e,item:xe},t.syntheticEvent)):wt[r.type]({...r,item:xe},t.syntheticEvent))}Ee&&Ee.call(void 0,t)},[ye,Ee,e,St,wt]),Zt=k.useCallback(e=>{rt?(pt({type:kl.reset}),ht({type:Dl.close})):$t(e)},[rt,pt,ht,$t]),Yt=k.useCallback(()=>{Ve(null),Ge.current&&Ge.current.focus({preventScroll:!0})},[]),jt=k.useCallback(()=>{Ye&&o&&o(Ye.action,Ye.event),je(null)},[Ye,o]),Xt=k.useCallback(()=>{Ye&&o&&o({...Ye.action,resetExceptions:!0},Ye.event),je(null)},[Ye,o]),Qt=k.useCallback(()=>{const e=Ye;je(null),e&&e.fromForm&&!Array.isArray(e.action.dataItem)&&nt({type:yl.set,payload:e.action.dataItem})},[Ye,nt]),Jt=k.useCallback(()=>{Ve(null),nt({type:yl.set,payload:e.dataItem})},[nt,e.dataItem]),er=k.useCallback(()=>{Ve(null),tt({type:Sl.set,payload:!1}),nt({type:yl.set,payload:e.dataItem})},[tt,nt,e.dataItem]),tr=k.useCallback(()=>{Ve(null),tt({type:Sl.set,payload:!0}),nt({type:yl.setMaster,payload:e.dataItem})},[tt,nt,e.dataItem]),rr=k.useCallback(()=>{Ve(null),pt({type:kl.set,payload:e.dataItem}),ht({type:Dl.open})},[pt,ht,e.dataItem]),ar=k.useCallback(()=>{Ve(null),tt({type:Sl.set,payload:!1}),pt({type:kl.set,payload:e.dataItem}),ht({type:Dl.open})},[tt,pt,ht,e.dataItem]),nr=k.useCallback(()=>{Ve(null),tt({type:Sl.set,payload:!0}),pt({type:kl.set,payload:e.dataItem}),ht({type:Dl.open})},[tt,pt,ht,e.dataItem]);return k.useEffect(()=>{const t=kt.length&&kt[0].current===xe.current;Re(void 0!==e.tabIndex?null===e.tabIndex?void 0:e.tabIndex:0===qe.length&&t?0:void 0)},[kt,e.tabIndex,qe.length]),k.createElement(El,{props:e,form:[rt,at,nt],drag:[lt,ot,st],resize:[ct,it,ut],remove:[dt,mt,pt],showRemoveDialog:[gt,vt,ht],showOccurrenceDialog:[Et,yt,ft]},k.createElement(Me,{...e,_ref:xe,itemRef:xe,selected:bt,dragSource:!!lt&&Oe.drag,tabIndex:Ie,id:Ae,onKeyDown:Vt,onKeyUp:Gt,onFocus:It,onMouseUp:Tt,onMouseDown:Rt,onClick:At,onDoubleClick:Mt,onRemoveClick:Nt,onPress:Lt,onDrag:zt,onRelease:_t,onResizePress:Ft,onResizeEndDrag:Wt,onResizeStartDrag:Ot,onResizeRelease:Pt}),lt&&Oe.drag&&(Array.isArray(lt)?lt.map((t,r)=>k.createElement(Ne,{key:r,ignoreIsAllDay:s,dataItem:t,vertical:e.vertical,viewItem:Me,item:e.item})):k.createElement(Ne,{ignoreIsAllDay:s,dataItem:lt,vertical:e.vertical,viewItem:Me,item:e.item})),ct&&Oe.resize&&(Array.isArray(ct)?ct.map((t,r)=>k.createElement(Le,{key:r,format:e.format,ignoreIsAllDay:s,dataItem:t,viewItem:e.viewItem,item:e.item,vertical:e.vertical})):k.createElement(Le,{format:e.format,ignoreIsAllDay:s,dataItem:ct,viewItem:e.viewItem,item:e.item,vertical:e.vertical})),rt&&!Et&&Oe.edit&&k.createElement(ze,{dataItem:rt,onSubmit:Ht,onClose:$t,onCancel:$t,onDelete:Oe.remove?Ut:void 0}),Et&&k.createElement(_e,{dataItem:rt||lt||ct||dt,isRemove:null!==dt,onClose:$t,onOccurrenceClick:Kt,onSeriesClick:Bt}),Ye&&k.createElement(Al,{onKeep:jt,onReset:Xt,onCancel:Qt}),gt&&dt&&Oe.remove&&k.createElement(Fe,{dataItem:dt,isSeries:!0===et,onClose:Zt,onCancel:Zt,onConfirm:qt}),Be&&k.createElement(xl,{show:!0,anchor:Ge.current,dataItem:Be,fields:We,position:Ke.position,collision:Ke.collision,isRecurring:!!e.isRecurring,canEdit:Oe.edit&&!e.readonly,canRemove:Oe.remove&&!e.readonly,onEdit:Jt,onEditOccurrence:er,onEditSeries:tr,onDelete:rr,onDeleteOccurrence:ar,onDeleteSeries:nr,onClose:Yt}))}),Ll={viewItem:Yn,drag:ol,resize:cl,form:Aa,occurrenceDialog:Vn,removeDialog:Gn,onClickAction:(e,t,r)=>[{type:e.syntheticEvent.metaKey||e.syntheticEvent.ctrlKey?!r.selected||r.dragItem||r.resizeItem?Ua.add:Ua.remove:Ua.select}],onDoubleClickAction:(e,t)=>t.editable?[{type:yl.set,payload:t.dataItem},t.isRecurring&&{type:fl.open}].filter(Boolean):[],onRemoveClickAction:(e,t)=>t.editable?[{type:kl.set,payload:t.dataItem},t.isRecurring?{type:fl.open}:{type:Dl.open}]:[],onPressAction:(e,t)=>Ml(t.editable)?{type:Cl.start,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onDragAction:(e,t)=>Ml(t.editable)?{type:e.dragEvent.originalEvent.metaKey||e.dragEvent.originalEvent.ctrlKey?Cl.dragSelected:Cl.drag,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onReleaseAction:(e,t,r)=>Ml(t.editable)&&r.dragItem?t.isRecurring&&!t.isException&&null===r.series?{type:fl.open}:{type:t.isRecurring?r.series?Cl.completeSeries:Cl.completeOccurrence:Cl.complete,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onResizePressAction:(e,t)=>t.editable?{type:bl.start,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onResizeStartDragAction:(e,t)=>t.editable?{type:e.dragEvent.originalEvent.metaKey||e.dragEvent.originalEvent.ctrlKey?bl.startDragSelected:bl.startDrag,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onResizeEndDragAction:(e,t)=>t.editable?{type:e.dragEvent.originalEvent.metaKey||e.dragEvent.originalEvent.ctrlKey?bl.endDragSelected:bl.endDrag,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onResizeReleaseAction:(e,t,r)=>t.editable&&r.resizeItem?t.isRecurring&&!t.isException&&null===r.series?{type:fl.open}:{type:t.isRecurring?r.series?bl.completeSeries:bl.completeOccurrence:bl.complete,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onOccurrenceClickAction:(e,t,r)=>r.dragItem?[{type:Cl.completeOccurrence},{type:fl.close}]:r.resizeItem?[{type:bl.completeOccurrence},{type:fl.close}]:r.formItem?[{type:Sl.set,payload:!1},{type:yl.set,payload:t.dataItem},{type:fl.close}]:r.removeItem?[{type:Sl.set,payload:!1},{type:kl.set,payload:t.dataItem},{type:Dl.open},{type:fl.close}]:[],onSeriesClickAction:(e,t,r)=>r.dragItem?[{type:Cl.completeSeries},{type:fl.close}]:r.resizeItem?[{type:bl.completeSeries},{type:fl.close}]:r.formItem?[{type:Sl.set,payload:!0},{type:yl.setMaster,payload:t.dataItem},{type:fl.close}]:r.removeItem?[{type:Sl.set,payload:!0},{type:kl.set,payload:t.dataItem},{type:Dl.open},{type:fl.close}]:[],onKeyDownAction:(e,t)=>{switch(e.syntheticEvent.keyCode){case n.Keys.enter:return t.editable&&!t.readonly?[{type:yl.set,payload:t.dataItem},t.isRecurring&&{type:fl.open}]:[];case n.Keys.tab:return[{type:e.syntheticEvent.shiftKey?en.prev:en.next,ignoreIsAllDay:t.ignoreIsAllDay},{type:e.syntheticEvent.shiftKey?Ua.selectPrev:Ua.selectNext,ignoreIsAllDay:t.ignoreIsAllDay}];case n.Keys.up:return[!(!t.slots.length||!t.slots[0]._ref.current)&&{type:Ya.up,slot:t.slots[0]._ref}];case n.Keys.right:return[!(!t.slots.length||!t.slots[0]._ref.current)&&{type:Ya.right,slot:t.slots[0]._ref}];case n.Keys.down:return[!(!t.slots.length||!t.slots[t.slots.length-1]._ref.current)&&{type:Ya.down,slot:t.slots[t.slots.length-1]._ref}];case n.Keys.left:return[!(!t.slots.length||!t.slots[0]._ref.current)&&{type:Ya.left,slot:t.slots[0]._ref}];default:return}},onFormSubmitAction:e=>[{type:yl.complete,payload:e.value}],onRemoveConfirmAction:()=>[{type:kl.complete},{type:yl.reset},{type:Dl.close},{type:fl.close}],onCancelAction:()=>[{type:Sl.reset},{type:kl.reset},{type:yl.reset},{type:Cl.reset},{type:bl.reset},{type:Dl.reset},{type:fl.reset}]};Nl.displayName="KendoReactSchedulerEditItem";const zl=e=>{const[t,r]=k.useState(!1),l=ae(),o=le(),s=k.useRef(void 0),c=k.useRef(null),i=k.useRef(null),u=e.updateInterval||_l.updateInterval,[,d]=k.useState(!1),m=n.useDir(i,!0===o.rtl?"rtl":void 0),[p]=Fa(),g=k.useCallback(()=>{if(!p)return;const t=p.filter(t=>t.current&&(void 0===e.groupIndex||null===e.groupIndex||t.current.props.group.index===e.groupIndex)&&(e.vertical?$(new Date,new Date,t.current.props.start,t.current.props.end,!0):B(new Date,t.current.props.start,t.current.props.end))&&!t.current.props.isAllDay);if(t&&t.length&&c.current&&i.current){const n=T(t);if(!n.current)return;const l=e.vertical?(e=>{let t=0;return e.forEach(e=>{if(e.current){const r=w(e.current.element);t+=r.height}}),t})(t):(e=>{let t=0;return e.forEach(e=>{if(e.current){const r=w(e.current.element);t+=r.width}}),t})(t),o=w(n.current.element),s=w(c.current),u=(e.vertical?o.width:o.height)/(n.current.props.end.getTime()-n.current.props.start.getTime()),d=(Date.now()-((e,t)=>{const r=a.cloneDate(e);return r.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),r})(new Date,n.current.props.start).getTime())*u,p="rtl"===m,g=e.vertical?o.top:o.top+d-s.height/2,v=p?"right":"left",h=e.vertical?o[v]+d-s.width/2:o[v];e.vertical?c.current.style[v]=`${h}px`:c.current.style.top=`${g}px`,i.current.style[v]=`${h}px`,i.current.style.top=`${g}px`,i.current.style[e.vertical?"height":"width"]=l-1+"px",r(!0)}else c.current&&(c.current.style.top="",c.current.style.left="",c.current.style.right=""),i.current&&(i.current.style.top="",i.current.style.left="",i.current.style.right=""),r(!1)},[p,e.groupIndex,e.vertical,m]),v=k.useCallback(()=>{g(),d(e=>!e)},[g]);k.useEffect(()=>{if(!l.current||!window)return;clearInterval(s.current),s.current=window.setInterval(v,u);const e=window.ResizeObserver,t=e&&new e(v);return t&&t.observe(l.current),()=>{clearInterval(s.current),t&&t.disconnect()}},[g,v,l,u]),k.useEffect(g);const h=k.createElement("div",{ref:c,className:n.classNames("k-current-time",{"k-current-time-arrow-right":!e.vertical&&"rtl"!==m,"k-current-time-arrow-left":!e.vertical&&"rtl"===m,"k-current-time-arrow-down":e.vertical}),style:{transform:e.vertical?"rtl"===m?"translateX(50%)":"translateX(-50%)":"translateY(-50%)",visibility:t?void 0:"hidden"}});return k.createElement(k.Fragment,null,e.attachArrow&&e.attachArrow.current?D.createPortal(h,e.attachArrow.current):h,k.createElement("div",{className:"k-current-time",ref:i,style:{transform:e.vertical?"translateX(-50%)":"translateY(-50%)",[e.vertical?"width":"height"]:"1px",visibility:t?void 0:"hidden"}}))},_l={updateInterval:6e4},Fl=(e,t)=>{const[r,a]=((e,t)=>{const[r,a]=k.useState(t);return void 0!==e?[e,n.noop]:[r,a]})(e,t),l=k.useCallback(()=>{a(!r)},[r,a]);return[r,l]},Ol=k.forwardRef((e,t)=>{var r;const{as:a=Wl.as,...l}=e,s=k.useRef(null),c=k.useRef(null),i=o.useInternationalization(),u=k.useMemo(()=>n.classNames("k-scheduler-cell k-heading-cell",e.className),[e.className]);k.useImperativeHandle(c,()=>({element:s.current&&s.current.element?s.current.element:s.current,props:e})),k.useImperativeHandle(t,()=>c.current);const d=null!=(r=e.format)?r:Wl.format,m="object"==typeof d&&"skeleton"in d&&"string"==typeof d.skeleton&&d.skeleton.includes("E")&&d.skeleton.includes("d");return k.createElement(a,{ref:a!==Wl.as?void 0:s,...l,className:u},m?k.createElement(k.Fragment,null,k.createElement("span",{className:"k-scheduler-date-day"},i.formatDate(e.date,"EEE")),k.createElement("span",{className:"k-link k-nav-day","aria-label":i.formatDate(e.date,{skeleton:"Ed"})},i.formatDate(e.date,{skeleton:"d"}))," "):k.createElement("span",{className:"k-link k-nav-day"},i.formatDate(e.date,d)))}),Wl={as:k.forwardRef(({as:e,format:t,start:r,end:a,...n},l)=>k.createElement("div",{...n,ref:l})),format:"d"};Ol.displayName="KendoReactSchedulerDateHeaderCell";const Pl=(e,{step:t,timezone:r})=>{const n=[],l=a.ZonedDate.fromLocalDate(e.start,r),o=a.ZonedDate.fromLocalDate(e.end,r);for(let e=l.clone(),r=0;e.getTime()<o.getTime();r++,e=e.addTime(t)){const a=e.clone(),l=a.clone().addTime(t),o=new Date(a.getTime()),s={index:r,end:new Date(l.getTime()),start:o,zonedStart:a,zonedEnd:l};n.push(s)}return n},Hl=(e,{step:t},{groups:r,ranges:n})=>{const l=[];return r.forEach(e=>{n.forEach(r=>{const n=r.zonedStart,o=r.zonedEnd,s=o.timezoneOffset-n.timezoneOffset;for(let c=n.clone(),i=0,u=s<0?s*X*-1:0;c.getTime()<o.getTime();){const n=k.createRef(),o=c.clone(),s=c.addTime(t),d=(s.timezoneOffset-o.timezoneOffset)*X,m=t<=Math.abs(d);u&&m&&(u-=t,c=c.addTime(-t));const p=new Date(o.getTime()),g={_ref:n,index:i,end:new Date(s.getTime()),start:p,zonedStart:o,zonedEnd:s,range:r,group:e,items:[],isAllDay:a.MS_PER_DAY<=t};l.push(g),c=c.addTime(t),i++}})}),l},$l=k.createElement("div",{className:"k-scheduler-cell k-side-cell"}),Kl=e=>{var t,r,l,s,c,i,u,d,m,p,g,v;const{group:h,timezone:E,resources:y}=le(),f=o.useInternationalization(),D=e.editItem||Nl,C=e.editSlot||Kn,[b]=Fl(e.showWorkHours,null!=(t=e.defaultShowWorkHours)?t:Bl.defaultShowWorkHours),S=null!=(r=e.numberOfDays)?r:Bl.numberOfDays,w=null!=(l=e.slotDivisions)?l:Bl.slotDivisions,I=null!=(s=e.slotDuration)?s:Bl.slotDuration,R=null!=(c=e.workWeekStart)?c:Bl.workWeekStart,M=null!=(i=e.workWeekEnd)?i:Bl.workWeekEnd,N=!1!==e.currentTimeMarker&&Bl.currentTimeMarker,L=f.parseDate(null!=(d=null!=(u=e.workDayStart)?u:e.isWorkDayStart)?d:Bl.isWorkDayStart),z=f.parseDate(null!=(p=null!=(m=e.workDayEnd)?m:e.isWorkDayEnd)?p:Bl.isWorkDayEnd),_=f.parseDate(null!=(g=e.startTime)?g:Bl.startTime),F=f.parseDate(null!=(v=e.endTime)?v:Bl.endTime),[O]=ke(),W=me(),P=he(),H=ie(),K=ge(),G=k.useMemo(()=>b?L:_,[b,L,_]),Z=k.useMemo(()=>b?z:F,[b,z,F]),Y=k.useMemo(()=>Pl(K,{step:a.MS_PER_DAY*S,timezone:E}).map(e=>({...e,isAllDay:!0})),[K.start.getTime(),K.end.getTime(),S]),j=k.useMemo(()=>Pl(K,{step:a.MS_PER_DAY,timezone:E}).map(e=>({...e,isAllDay:!1})),[K.start.getTime(),K.end.getTime(),E]),Q=k.useMemo(()=>Hl(0,{step:a.MS_PER_DAY},{groups:W,ranges:Y}),[K.start.getTime(),K.end.getTime(),E,Y,W]),J=k.useMemo(()=>Hl(0,{step:I*X/w},{groups:W,ranges:j}).filter(e=>Z.getTime()===G.getTime()||B(e.zonedStart,G,Z)),[K.start.getTime(),K.end.getTime(),I,w,G.getTime(),Z.getTime(),W,j]),ee=k.useMemo(()=>Xn(O,{dateRange:K,fields:H,timezone:E}),[O,K.start.getTime(),K.end.getTime(),H,E]),te=k.useMemo(()=>ee.filter(e=>e.isAllDay||A(e.start,e.end,E)),[ee,E]),re=k.useMemo(()=>ee.filter(e=>!e.isAllDay&&!A(e.start,e.end,E)),[ee,E]),ae=k.useMemo(()=>tl(te,{timezone:E},{groups:W,ranges:Y}),[ee,E,W,Y]),ne=k.useMemo(()=>tl(re,{timezone:E},{groups:W,ranges:j}).filter(e=>{if(G.getTime()===Z.getTime())return!0;const t=e.range.zonedStart.getTime(),r=e.range.zonedEnd.getTime(),a=(Math.max(e.zonedStart.getTime(),t)-t)/X,n=(Math.min(e.zonedEnd.getTime(),r)-t)/X,l=60*G.getHours()+G.getMinutes();return a<60*Z.getHours()+Z.getMinutes()&&n>l}),[ee,E,W,j,G.getTime(),Z.getTime()]);k.useMemo(()=>q(ae,Q,!0),[ae,Q]),k.useMemo(()=>U(ae,Q,!0),[ae,Q]),k.useMemo(()=>q(ne,J,!1),[ne,J]),k.useMemo(()=>U(ne,J,!1),[ne,J]);const oe=k.createElement(rn.Consumer,null,({groupIndex:t})=>k.createElement("div",{className:"k-scheduler-row",key:t},j.map((t,r)=>k.createElement(Ol,{as:e.dateHeaderCell,key:r,date:a.ZonedDate.fromLocalDate(new Date(t.zonedEnd.getTime()-(t.zonedEnd.getTime()-t.zonedStart.getTime())/2),E),start:t.start,end:t.end,format:{skeleton:"MEd"}})))),se=k.createElement(rn.Consumer,null,({groupIndex:t})=>k.createElement("div",{key:t,className:"k-scheduler-row"},Y.map((r,a)=>Q.filter(e=>e.group.index===t&&e.range.index===a).map((r,a,n)=>k.createElement(C,{...r,onDataAction:e.onDataAction,form:e.form,slot:e.slot,viewSlot:e.viewSlot,key:`${r.start.getTime()}:${r.group.index}`,row:0,col:"horizontal"===P?n.length*(t||0)+a:a,isWorkDay:0<=r.zonedStart.getDay()+(S-R)&&(r.zonedStart.getDay()+(S-R))%S<=M+(S-R),expandable:{offsetBottom:25}}))))),ce=k.useMemo(()=>n.classNames("week"===e.name?"k-scheduler-weekview":"k-scheduler-dayview",e.className),[e.name,e.className]),ue=k.useCallback((t,r,a)=>j.map((n,l)=>J.filter(e=>e.index===t.index&&e.range.index===l&&e.group.index===a).map(t=>k.createElement(C,{key:`${t.start.getTime()}:${t.group.index}`,...t,onDataAction:e.onDataAction,slot:e.slot,viewSlot:e.viewSlot,form:e.form,row:r+1,col:j.length*(a||0)+l,isWorkHour:B(t.zonedStart,L,z),isWorkDay:V(t.zonedEnd.getDay(),R,M),editable:e.editable}))),[j,C,e.editable,e.form,e.onDataAction,e.slot,e.viewSlot,J,z,L,M,R]),de=k.useCallback((t,r,a)=>Q.filter(e=>e.group.index===r&&e.range.index===a).map((a,n)=>k.createElement(C,{slot:e.slot,viewSlot:e.viewSlot,form:e.form,...a,onDataAction:e.onDataAction,key:`${a.start.getTime()}:${a.group.index}`,className:"k-scheduler-alldays-slot",row:t*(r||0)+1*(r||0),col:n,expandable:{offsetBottom:25}})),[C,Q,e.form,e.onDataAction,e.slot,e.viewSlot]),pe=k.useCallback((t,r,a,n)=>j.map((l,o)=>J.filter(e=>e.index===t.index&&e.group.index===a&&e.range.index===o).map(t=>k.createElement(C,{slot:e.slot,viewSlot:e.viewSlot,form:e.form,onDataAction:e.onDataAction,...t,key:`${t.start.getTime()}:${t.group.index}`,row:r.length*(a||0)+n+1*(a||0)+1,col:o,editable:e.editable,isWorkHour:B(t.zonedStart,L,z),isWorkDay:0<=t.zonedStart.getDay()+(S-R)&&(t.zonedStart.getDay()+(S-R))%S<=M+(S-R)}))),[C,S,e.editable,e.form,e.onDataAction,e.slot,e.viewSlot,j,J,z,L,M,R]);return k.createElement(tn,{id:e.id,props:e,style:e.style,className:ce,ranges:[...Y,...j],slots:[...Q,...J]},k.createElement("div",{className:"k-scheduler-head"},"horizontal"===P?k.createElement(k.Fragment,null,k.createElement(an,{nested:!0,group:h,resources:y,rowContent:sn,childRowContent:sn},oe),k.createElement(an,{group:h,resources:y,rowContent:En,childRowContent:En},se),ae.map(t=>k.createElement(D,{key:t.isRecurring?`${t.uid}:${t.group.index}:${t.range.index}:${t.originalStart}`:`${t.uid}:${t.group.index}:${t.range.index}`,...t,form:e.form,onDataAction:e.onDataAction,item:e.item,viewItem:e.viewItem,editable:e.editable,vertical:!1,ignoreIsAllDay:!0}))):k.createElement(cn,{group:h,resources:y,cellContent:$l},oe)),k.createElement("div",{className:"k-scheduler-body"},"horizontal"===P?k.createElement(k.Fragment,null,J.filter(e=>0===e.group.index&&0===e.range.index).map((t,r)=>k.createElement(k.Fragment,{key:t.index},k.createElement(an,{nested:!1,group:h,resources:y,rowContent:kn,rowContentProps:{timeHeaderCell:e.timeHeaderCell,isMaster:r%w===0,isLast:(r+1)%w===0,slot:t}},k.createElement(rn.Consumer,null,({groupIndex:e})=>k.createElement("div",{className:n.classNames("k-scheduler-row",{"k-middle-row":(r+1)%w!==0})},ue(t,r,e)))))),!1!==N&&$(T(j).start,x(j).end,new Date,new Date,!0)&&k.createElement(zl,null)):k.createElement(k.Fragment,null,k.createElement(cn,{nested:!0,group:h,resources:y},k.createElement(rn.Consumer,null,({groupIndex:t})=>k.createElement(k.Fragment,{key:t},k.createElement("div",{className:"k-scheduler-row"},k.createElement(En,{groupIndex:t},Y.map((e,r)=>{const a=J.filter(e=>e.group.index===t&&0===e.range.index).length;return de(a,t,r)}))),J.filter(e=>e.group.index===t&&0===e.range.index).map((r,a,n)=>k.createElement("div",{className:"k-scheduler-row",key:r.index},k.createElement(kn,{slot:r,isMaster:a%w===0,isLast:(a+1)%w===0,timeHeaderCell:e.timeHeaderCell},pe(r,n,t,a)))),!1!==N&&$(T(j).start,x(j).end,new Date,new Date,!0)&&k.createElement(zl,{groupIndex:t})))),ae.map(t=>k.createElement(D,{key:t.isRecurring?`${t.uid}:${t.group.index}:${t.range.index}:${t.originalStart}`:`${t.uid}:${t.group.index}:${t.range.index}`,...t,onDataAction:e.onDataAction,viewItem:e.viewItem,item:e.item,form:e.form,editable:e.editable,vertical:!1,ignoreIsAllDay:!0}))),ne.map(t=>k.createElement(D,{key:t.isRecurring?`${t.uid}:${t.group.index}:${t.range.index}:${t.originalStart}`:`${t.uid}:${t.group.index}:${t.range.index}`,...t,format:"t",onDataAction:e.onDataAction,viewItem:e.viewItem,item:e.item,form:e.form,editable:e.editable,vertical:!0}))))},Bl={name:"multi-day",title:"Multi Day",currentTimeMarker:!0,dateRange:({date:e,numberOfDays:t=1,timezone:r})=>{const n=a.ZonedDate.fromLocalDate(e,r),l=a.getDate(n),o=a.addDays(l,t),s=a.ZonedDate.fromUTCDate(F(l),r),c=a.ZonedDate.fromUTCDate(F(o),r);return{start:new Date(s.getTime()),end:new Date(c.getTime()),zonedStart:s,zonedEnd:c}},selectedDateFormat:"{0:M}",selectedShortDateFormat:"{0:m}",numberOfDays:1,startTime:"00:00",endTime:"23:59",isWorkDayStart:"08:00",isWorkDayEnd:"17:00",workWeekStart:a.Day.Monday,workWeekEnd:a.Day.Friday,slotDivisions:2,slotDuration:60,showCurrentTime:!0,defaultShowWorkHours:!0};Kl.propTypes={currentTimeMarker:r.bool,name:r.string,numberOfDays:r.number,startTime:r.string,endTime:r.string,workDayStart:r.string,workDayEnd:r.string,workWeekStart:r.number,workWeekEnd:r.any,slotDivisions:r.number,slotDuration:r.number,showWorkHours:r.bool,selectedDateFormat:r.string,selectedShortDateFormat:r.string},Kl.displayName="KendoReactSchedulerMultiDayView";const Vl=e=>k.createElement(Kl,{...e}),Gl={...Bl,name:"day",title:e=>e.toLanguageString(Oe,Pr[Oe]),numberOfDays:1,slotDuration:60,slotDivisions:2,selectedDateFormat:"{0:M}",selectedShortDateFormat:"{0:m}"};Vl.displayName="KendoReactSchedulerDayView";const Ul=Object.freeze({name:"@progress/kendo-react-scheduler",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:1607496606,version:"16.4.0-develop.2",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui"}),ql=k.forwardRef((e,t)=>{const{_ref:r,onRemoveClick:a}=e,l=k.useRef(null),s=k.useRef(null);k.useImperativeHandle(l,()=>({props:e,element:s.current})),k.useImperativeHandle(t,()=>l.current),k.useImperativeHandle(r,()=>l.current);const c=Hn(e.editable),i=e.readonly?{remove:!1}:c,u=o.useLocalization().toLanguageString(Pe,Pr[Pe]),m=e.group.resources.find(e=>!(!e.colorField||void 0===e[e.colorField])),p=m&&m.colorField&&m[m.colorField],g=k.useCallback(e=>{a&&a.call(void 0,{syntheticEvent:e,target:l.current})},[a,l]),v=k.useMemo(()=>n.classNames("k-task",e.className),[e.className]);return k.createElement("div",{id:e.id,ref:s,style:e.style,className:v,tabIndex:e.tabIndex||void 0},p&&k.createElement("span",{className:"k-scheduler-mark",style:{color:p,backgroundColor:p}}),e.isRecurring&&k.createElement(n.IconWrap,{name:"arrow-rotate-cw",icon:d.arrowRotateCwIcon}),e.isException&&k.createElement(n.IconWrap,{name:"arrows-no-repeat",icon:d.arrowsNoRepeatIcon}),k.createElement("span",{className:"k-scheduler-task-text"},e.title),i.remove&&k.createElement("a",{className:"k-link k-event-delete",title:u,"aria-label":u,onClick:g},k.createElement(n.IconWrap,{name:"x",icon:d.xIcon})))});ql.displayName="KendoReactSchedulerTask";const Zl=k.forwardRef((e,t)=>{const{task:r,_ref:a,...n}=e,l=k.useRef(null),o=k.useRef(null);k.useImperativeHandle(o,()=>({props:e,element:l.current&&l.current.element})),k.useImperativeHandle(a,()=>l.current),k.useImperativeHandle(t,()=>o.current);const s=r||Yl.task;return k.createElement(s,{...n,_ref:l})}),Yl={task:ql};Zl.displayName="KendoReactSchedulerViewTask";const jl=k.createContext([null]),Xl=k.createContext([!1]),Ql=k.createContext([!1]),Jl=e=>k.createElement(jl.Provider,{value:e.remove},k.createElement(Xl.Provider,{value:e.showRemoveDialog},k.createElement(Ql.Provider,{value:e.showOccurrenceDialog},e.children))),eo=k.forwardRef((e,t)=>{const{_ref:r,onDataAction:a,viewTask:n,removeDialog:l,removeItem:o,onRemoveItemChange:s,occurrenceDialog:c,showOccurrenceDialog:i,onShowOccurrenceDialogChange:u,showRemoveDialog:d,onShowRemoveDialogChange:m,...p}=e,g=k.useRef(null);k.useImperativeHandle(g,()=>({props:e,element:g.current&&g.current.element})),k.useImperativeHandle(r,()=>g.current),k.useImperativeHandle(t,()=>g.current);const v=n||to.viewTask,h=c||to.occurrenceDialog,E=l||to.removeDialog,y=Hn(e.editable),f=ie(),[D,C]=ke(),[b,S]=k.useState(null),[w,I]=we(null,o,s),[R,T]=we(!1,d,m),[x,A]=we(!1,i,u),M=k.useCallback(t=>{y.remove&&(I(e.dataItem,t),e.isRecurring?A(!0,t):T(!0,t))},[I,e.dataItem,e.isRecurring,A,T]),N=k.useCallback(e=>{S(null),I(null,e),T(!1,e),A(!1,e)},[S,I,T,A]),L=k.useCallback(e=>{a&&w&&a.call(void 0,{type:te.remove,series:b,dataItem:w}),I(null,e),T(!1,e)},[w,C,T]),z=k.useCallback((e,t)=>{I&&I(e,t)},[I]),_=k.useCallback((e,t)=>{T&&T(e,t)},[T]),F=k.useCallback((e,t)=>{A&&A(e,t)},[A]),W=k.useCallback(t=>{w&&(S(!1),I(e.dataItem,t),T(!0,t)),A(!1,t)},[S,e.dataItem,w,I,T]),P=k.useCallback(e=>{if(w){S(!0);const t=O(w,f,D);I(t,e),T(!0,e)}A(!1,e)},[f,w,S,I,T,A]);return k.createElement(Jl,{remove:[w,z],showRemoveDialog:[R,_],showOccurrenceDialog:[x,F]},k.createElement(v,{_ref:g,...p,onRemoveClick:M}),x&&k.createElement(h,{dataItem:w,isRemove:null!==w,onClose:N,onOccurrenceClick:W,onSeriesClick:P}),R&&k.createElement(E,{dataItem:w,onClose:N,onCancel:N,onConfirm:L}))}),to={viewTask:Zl,occurrenceDialog:Vn,removeDialog:Gn};eo.displayName="KendoReactSchedulerEditTask";const ro=e=>{const{group:t,timezone:r,resources:l}=le(),s=e.editTask||eo,c=e.editSlot||Kn,i=k.useRef(null),u=n.useDir(i),m=o.useInternationalization(),p=o.useLocalization(),[g]=ke(),v=me(),h=ie(),E=ge(),y=k.useMemo(()=>Pl(E,{step:a.MS_PER_DAY,timezone:r}),[E.start.getTime(),E.end.getTime(),r]),f=k.useMemo(()=>Hl(0,{step:a.MS_PER_DAY},{groups:v,ranges:y}),[E.start.getTime(),E.end.getTime(),r,v,y]),D=k.useMemo(()=>Xn(g,{dateRange:E,fields:h,timezone:r}),[g,E.start.getTime(),E.end.getTime(),h,r]),C=k.useMemo(()=>tl(D,{timezone:r},{groups:v,ranges:y}),[D,r,v,y]),b=k.useMemo(()=>n.classNames("k-scheduler-agendaview",e.className),[e.className]);return Za({element:i,selector:".k-scheduler-datecolumn",explicitDepth:!1}),Za({element:i,selector:".k-scheduler-timecolumn",explicitDepth:!1}),k.useMemo(()=>q(C,f,!0),[C,f]),k.useMemo(()=>U(C,f,!0),[C,f]),k.createElement(tn,{ref:i,id:e.id,style:e.style,className:b,props:e,slots:C,ranges:y,role:"grid"},k.createElement("div",{className:"k-scheduler-head",role:"rowgroup"},k.createElement(cn,{resources:l,group:t,role:"presentation"},k.createElement(rn.Consumer,null,({groupIndex:e})=>k.createElement("div",{className:"k-scheduler-row",role:"row",key:e},k.createElement("div",{className:"k-scheduler-cell k-heading-cell k-group-cell k-scheduler-datecolumn",role:"columnheader"},p.toLanguageString(qt,Pr[qt])),k.createElement("div",{className:"k-scheduler-cell k-heading-cell k-scheduler-timecolumn",role:"columnheader"},p.toLanguageString(Zt,Pr[Zt])),k.createElement("div",{className:"k-scheduler-cell k-heading-cell k-scheduler-eventcolumn",role:"columnheader"},p.toLanguageString(Yt,Pr[Yt])))))),k.createElement("div",{className:"k-scheduler-body",role:"rowgroup"},k.createElement(cn,{resources:l,group:t,nested:!0,role:"presentation"},k.createElement(rn.Consumer,null,({groupIndex:t})=>f.filter(e=>e.group.index===(t||0)).map((r,a,l)=>k.createElement("div",{className:"k-scheduler-row k-scheduler-content",role:"row",key:`${t}:${a}`},k.createElement(c,{...r,editable:e.editable,row:l.length*(t||0)+a,col:0,slot:e.slot,viewSlot:e.viewSlot,className:"k-scheduler-datecolumn k-group-cell",role:"rowheader"},k.createElement("div",null,k.createElement("strong",{className:"k-scheduler-agendaday"},m.formatDate(r.zonedStart,"dd")),k.createElement("em",{className:"k-scheduler-agendaweek"},m.formatDate(r.zonedStart,"EEEE")),k.createElement("span",{className:"k-scheduler-agendadate"},m.formatDate(r.zonedStart,"y")))),k.createElement("div",{className:"k-scheduler-cell k-group-content",role:"gridcell"},r.items.length?r.items.map((t,r)=>k.createElement("div",{className:"k-scheduler-row",key:r},k.createElement("div",{className:"k-scheduler-cell k-scheduler-timecolumn"},k.createElement("div",null,t.tail&&k.createElement(n.IconWrap,{name:"rtl"===u?"chevron-right":"chevron-left",icon:"rtl"===u?d.chevronRightIcon:d.chevronLeftIcon}),t.isAllDay?p.toLanguageString(Me,Pr[Me]):ao(m,t),t.head&&k.createElement(n.IconWrap,{name:"rtl"===u?"chevron-left":"chevron-right",icon:"rtl"===u?d.chevronLeftIcon:d.chevronRightIcon}))),k.createElement("div",{className:"k-scheduler-cell"},k.createElement(s,{key:`${a}:${r}`,...t,onDataAction:e.onDataAction,task:e.task,viewTask:e.viewTask,editable:e.editable})))):k.createElement("div",{className:"k-scheduler-cell k-heading-cell k-group-cell"},p.toLanguageString(Jt,Pr[Jt])))))))))},ao=(e,t)=>{if(t.head&&t.tail)return e.format("{0:t}-{1:t}",t.range.zonedStart,t.range.zonedEnd);let r="{0:t}-{1:t}";return t.head?r="{0:t}":t.tail&&(r="{1:t}"),e.format(r,t.zonedStart,t.zonedEnd)},no={name:"agenda",title:e=>e.toLanguageString(Fe,Pr[Fe]),dateRange:({intl:e,date:t,numberOfDays:r=1,timezone:n})=>{const l=a.ZonedDate.fromLocalDate(t,n),o=(e=>a.getDate(e))(7===r?a.firstDayInWeek(l,e.firstDay()):l),s=((e,t)=>a.getDate(a.addDays(e,t||1)))(o,r),c=a.ZonedDate.fromUTCDate(F(o),n),i=a.ZonedDate.fromUTCDate(F(s),n);return{start:new Date(c.getTime()),end:new Date(i.getTime()),zonedStart:c,zonedEnd:i}},selectedDateFormat:"{0:M} - {1:M}",selectedShortDateFormat:"{0:m} - {1:m}",slotDuration:1440,slotDivision:1,numberOfDays:7},lo={title:r.any};ro.propTypes=lo,ro.displayName="KendoReactSchedulerAgendaView";const oo=k.forwardRef((e,t)=>{const r=k.useRef(null),a=k.useRef(null),n=o.useLocalization();k.useImperativeHandle(r,()=>({element:a.current&&a.current.element,...e})),k.useImperativeHandle(t,()=>r.current);const l=k.useCallback(t=>{t.stopPropagation(),e.onClick&&r.current&&e.onClick.call(void 0,{target:r.current,syntheticEvent:t})},[r,e.slot,e.onClick]),c=k.useCallback(e=>{e.stopPropagation()},[]),i=k.useCallback(e=>{e.stopPropagation()},[]),u=n.toLanguageString(tr,Pr[tr]),d=void 0!==e.hiddenCount?`${String(e.hiddenCount)} ${u}`:u;return k.createElement(s.Button,{ref:a,tabIndex:-1,size:"xs",fillMode:"flat",themeColor:"primary",className:"k-more-events",onClick:l,onDoubleClick:i,onFocus:c,"aria-label":d},d)});oo.displayName="KendoReactSchedulerShowMoreItemsButton";const so={skeleton:"MMM"},co={skeleton:"dd"},io=e=>{const{show:t,anchor:r,slot:a,itemsPerSlot:l,onDayClick:s,onItemDoubleClick:c,onClose:i}=e,u=o.useInternationalization(),d=o.useLocalization(),m=k.useMemo(()=>a?a.items.filter((e,t)=>t>=l):[],[a,l]),p=k.useCallback(e=>{a&&s&&s(a)},[a,s]);Fn(t,r,i),k.useEffect(()=>{if(!t)return;const e=e=>{const t=e.target,a=document.querySelector(".k-scheduler-popover");a&&!a.contains(t)&&r&&!r.contains(t)&&(null==i||i())};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[t,r,i]);const g=k.useCallback(e=>{"Escape"===e.key&&(null==i||i())},[i]);if(!a)return null;const v=new Date(a.zonedEnd.getTime()-(a.zonedEnd.getTime()-a.zonedStart.getTime())/2),h=u.formatDate(v,so),E=u.formatDate(v,co),f=d.toLanguageString(Jt,Pr[Jt]),D=d.toLanguageString(er,Pr[er]),C=d.toLanguageString(Me,Pr[Me]),b=k.createElement(k.Fragment,null,k.createElement("div",{className:"k-month"},h),k.createElement("div",{className:"k-link k-day",onClick:p},E));return k.createElement(y.Popover,{anchor:r,show:t,popoverClass:"k-scheduler-popover",position:"right",collision:{horizontal:"flip",vertical:"fit"},callout:!1,title:b,style:{width:220},onKeyDown:g,margin:{horizontal:6,vertical:0},animate:{openDuration:1,closeDuration:1}},m.length>0?k.createElement("div",{className:"k-popover-events",role:"list","aria-label":D},m.map((e,t)=>{var r,a;const l=null==(a=null==(r=e.group)?void 0:r.resources)?void 0:a.find(e=>!(!e.colorField||""===e[e.colorField]||void 0===e[e.colorField])),o=(null==l?void 0:l.colorField)&&l[l.colorField],s=o?{"--kendo-scheduler-event-color":o}:void 0;return k.createElement("div",{key:e.uid||t,className:n.classNames("k-popover-event k-event",{"k-readonly":!!e.readonly}),role:"listitem",style:s,onDoubleClick:c?t=>c(e,t):void 0},k.createElement("div",{className:"k-event-title"},e.title||""),k.createElement("span",{className:"k-event-time"},e.isAllDay?C:u.formatDate(e.zonedStart,"t")))})):k.createElement("span",{className:"k-no-data"},f))};io.displayName="KendoReactSchedulerMoreEventsPopover";const uo={skeleton:"dd"},mo={item:null,phase:"form",series:!1,removeItem:null};function po(e,t){switch(t.type){case"open":return{item:t.item,phase:t.isRecurring?"occurrence":"form",series:!1,removeItem:null};case"editOccurrence":return{...e,phase:"form",series:!1};case"editSeries":return{...e,item:t.item,phase:"form",series:!0};case"requestRemove":return{...e,removeItem:t.item};case"cancelRemove":return{...e,removeItem:null};case"reset":return mo;default:return e}}const go=e=>{const{group:t,timezone:r,resources:l}=le(),{onDataAction:s}=e,c=e.editItem||Nl,i=e.editSlot||Kn,[u]=ke(),[d,m]=ye(),[,p]=Ce(),g=se(),v=me(),h=he(),E=ge(),y=o.useInternationalization(),f=ie(),D=k.useRef(null),C=e.itemsPerSlot||vo.itemsPerSlot,w=k.useMemo(()=>Pl(E,{step:7*a.MS_PER_DAY,timezone:r}),[E.start.getTime(),E.end.getTime(),r]),I=k.useMemo(()=>Hl(0,{step:a.MS_PER_DAY},{groups:v,ranges:w}),[E.start.getTime(),E.end.getTime(),v,w]),R=k.useMemo(()=>Xn(u,{dateRange:E,fields:f,timezone:r}),[u,E.start.getTime(),E.end.getTime(),f,r]),T=k.useMemo(()=>tl(R,{timezone:r},{groups:v,ranges:w}),[R,r,v,w]),[x,A]=k.useState({show:!1,anchor:null,slot:null}),[M,N]=k.useReducer(po,mo),L=Hn(e.editable),z=e.form||Aa,_=k.useCallback(e=>{A({show:!0,anchor:e.target.element,slot:e.target.slot||null})},[]),F=k.useCallback(()=>{A({show:!1,anchor:null,slot:null})},[]),W=k.useCallback(e=>{const t=g.find(e=>"day"===e.props.name);!p||!t||!t.props.name||(p(t.props.name),m(e.start),A({show:!1,anchor:null,slot:null}))},[p,m,g]),P=k.useCallback(e=>{!L.edit||e.readonly||(A({show:!1,anchor:null,slot:null}),N({type:"open",item:e.dataItem,isRecurring:!!e.isRecurring}))},[L.edit]),H=k.useCallback(e=>{e.value&&s&&s({type:te.update,series:M.series,dataItem:e.value}),N({type:"reset"})},[s,M.series]),$=k.useCallback(()=>{N({type:"reset"})},[]),K=k.useCallback(()=>{N({type:"editOccurrence"})},[]),B=k.useCallback(()=>{if(!M.item)return;const e=O(M.item,f,u);N({type:"editSeries",item:e?n.clone(e):M.item})},[M.item,f,u]),V=k.useCallback(e=>{const t=e.value||M.item;t&&N({type:"requestRemove",item:t})},[M.item]),G=k.useCallback(()=>{M.removeItem&&s&&s({type:te.remove,series:M.series,dataItem:M.removeItem}),N({type:"reset"})},[s,M.series,M.removeItem]),Z=k.useCallback(()=>{N({type:"cancelRemove"})},[]);k.useMemo(()=>q(T,I,!0),[T,I]),k.useMemo(()=>U(T,I,!0),[T,I]);const Y=k.useMemo(()=>b(t,l),[t,l]),X=k.useMemo(()=>S(Y,Y.length-1),[Y]),Q=Y.length>0,J=k.createElement(rn.Consumer,null,({groupIndex:t})=>k.createElement("div",{className:"k-scheduler-row",key:t},I.filter(e=>e.group.index===t&&0===e.range.index).map((t,n)=>k.createElement(Ol,{as:e.dateHeaderCell,key:n,"data-dayslot-index":n,date:a.ZonedDate.fromLocalDate(new Date(t.zonedEnd.getTime()-(t.zonedEnd.getTime()-t.zonedStart.getTime())/2),r),start:t.start,end:t.end,format:{skeleton:"EEEE"}})))),ee=k.createElement(rn.Consumer,null,({groupIndex:t})=>w.map((r,a)=>k.createElement("div",{className:"k-scheduler-row",key:a},I.filter(e=>e.group.index===t&&e.range.index===a).map((r,l,o)=>k.createElement(i,{slot:e.slot,viewSlot:e.viewSlot,key:l,form:e.form,...r,expandable:{offsetTop:35,offsetBottom:26},onDataAction:e.onDataAction,col:"horizontal"===h?o.length*(t||0)+l:l,row:"horizontal"===h?a:w.length*(t||0)+a,editable:e.editable,className:n.classNames({"k-other-month":r.zonedStart.getMonth()!==d.getMonth()})},k.createElement("span",{className:"k-link k-nav-day"},y.formatDate(r.zonedStart,uo)),C<r.items.length&&k.createElement(oo,{slot:r,hiddenCount:r.items.length-C,onClick:_}))))));return k.createElement(tn,{props:e,slots:I,ranges:w,className:n.classNames("k-scheduler-monthview",e.className)},k.createElement("div",{className:"k-scheduler-head"},"horizontal"===h?k.createElement(an,{nested:!0,resources:l,group:t},J):k.createElement(cn,{resources:l,group:t},J)),k.createElement("div",{className:"k-scheduler-body",ref:D},"horizontal"===h&&Q?w.map((t,r)=>k.createElement("div",{className:"k-scheduler-group k-group-horizontal",key:r},k.createElement("div",{className:"k-scheduler-row"},X.map((t,a)=>k.createElement("div",{key:a,className:"k-scheduler-cell k-group-cell"},k.createElement(rn.Provider,{value:{resource:t,groupIndex:a}},k.createElement("div",{className:"k-scheduler-row"},I.filter(e=>e.group.index===a&&e.range.index===r).map((t,l,o)=>k.createElement(i,{slot:e.slot,viewSlot:e.viewSlot,key:l,form:e.form,...t,expandable:{offsetTop:35,offsetBottom:26},onDataAction:e.onDataAction,col:o.length*a+l,row:r,editable:e.editable,className:n.classNames({"k-other-month":t.zonedStart.getMonth()!==d.getMonth()})},k.createElement("span",{className:"k-link k-nav-day"},y.formatDate(t.zonedStart,uo)),C<t.items.length&&k.createElement(oo,{slot:t,hiddenCount:t.items.length-C,onClick:_})))))))))):"horizontal"===h?k.createElement(an,{resources:l,group:t},ee):k.createElement(cn,{nested:!0,resources:l,group:t},ee),T.filter(e=>null===e.order||e.order<C).sort(j).map(t=>k.createElement(c,{item:e.item,viewItem:e.viewItem,form:e.form,key:t.isRecurring?`${t.uid}:${t.group.index}:${t.range.index}:${t.originalStart}`:`${t.uid}:${t.group.index}:${t.range.index}`,...t,onDataAction:e.onDataAction,slotHeaderOffset:35,vertical:!1,editable:e.editable,ignoreIsAllDay:!0}))),k.createElement(io,{show:x.show,anchor:x.anchor,slot:x.slot,items:T,itemsPerSlot:C,onDayClick:W,onItemDoubleClick:P,onClose:F}),M.item&&"form"===M.phase&&L.edit&&k.createElement(z,{dataItem:M.item,onSubmit:H,onCancel:$,onClose:$,onDelete:L.remove?V:void 0}),M.item&&"occurrence"===M.phase&&k.createElement(Vn,{dataItem:M.item,onClose:$,onOccurrenceClick:K,onSeriesClick:B}),M.removeItem&&L.remove&&k.createElement(Gn,{dataItem:M.removeItem,isSeries:M.series,onClose:Z,onCancel:Z,onConfirm:G}))},vo={name:"month",dateRange:({intl:e,date:t,timezone:r})=>{const n=a.firstDayInWeek(a.firstDayOfMonth(a.getDate(t)),e.firstDay()),l=a.addDays(a.firstDayInWeek(a.lastDayOfMonth(a.getDate(t)),e.firstDay()),7),o=a.ZonedDate.fromUTCDate(F(n),r),s=a.ZonedDate.fromUTCDate(F(l),r);return{start:new Date(o.getTime()),end:new Date(s.getTime()),zonedStart:o,zonedEnd:s}},slotDuration:1440,slotDivision:1,itemsPerSlot:2,numberOfDays:31,title:e=>e.toLanguageString(We,Pr[We]),selectedDateFormat:"{0:Y}",selectedShortDateFormat:"{0:y}"},ho={itemsPerSlot:r.number};go.propTypes=ho,go.displayName="KendoReactSchedulerMonthView";const Eo=e=>k.createElement(Kl,{...e,step:7,numberOfDays:7}),yo={name:"week",slotDuration:60,slotDivisions:2,numberOfDays:7,dateRange:({intl:e,date:t,timezone:r})=>{const n=a.ZonedDate.fromLocalDate(t,r),l=(e=>a.getDate(e))(a.firstDayInWeek(n,e.firstDay())),o=((e,t)=>a.getDate(a.addDays(e,t)))(l,7),s=a.ZonedDate.fromUTCDate(F(l),r),c=a.ZonedDate.fromUTCDate(F(o),r);return{start:new Date(s.getTime()),end:new Date(c.getTime()),zonedStart:s,zonedEnd:c}},title:e=>e.toLanguageString(ze,Pr[ze]),selectedDateFormat:"{0:M} - {1:M}",selectedShortDateFormat:"{0:m} - {1:m}"};Eo.displayName="KendoReactSchedulerWeekView";const fo=e=>{const t=ge(),r=Math.round((t.end.getTime()-t.start.getTime())/a.MS_PER_DAY);return k.createElement(Kl,{...e,step:7,numberOfDays:r})},ko={name:"work-week",slotDuration:60,slotDivisions:2,numberOfDays:7,dateRange:({intl:e,date:t,timezone:r,...n})=>{const l=a.ZonedDate.fromLocalDate(t,r),o=void 0!==n.workWeekStart?n.workWeekStart:a.Day.Monday,s=void 0!==n.workWeekEnd?n.workWeekEnd:a.Day.Friday,c=s<o?7+s-o+1:s-o+1,i=a.getDate(((e,t=a.Day.Sunday)=>{let r=e.clone();for(;r.getDay()!==t;)r=r.addDays(-1);return r})(l,o)),u=a.addDays(i,c),d=a.ZonedDate.fromUTCDate(F(i),r),m=a.ZonedDate.fromUTCDate(F(u),r);return{start:new Date(d.getTime()),end:new Date(m.getTime()),zonedStart:d,zonedEnd:m}},title:e=>e.toLanguageString(_e,Pr[_e]),workWeekStart:a.Day.Monday,workWeekEnd:a.Day.Friday,selectedDateFormat:"{0:M} - {1:M}",selectedShortDateFormat:"{0:m} - {1:m}"};fo.displayName="KendoReactSchedulerWorkWeekView";const Do=k.createElement("div",{className:"k-scheduler-cell k-side-cell"}),Co=e=>k.createElement(k.Fragment,null,k.createElement("div",{className:"k-sticky-cell"},Do),e.children),bo=e=>{const t=o.useLocalization();return k.createElement(k.Fragment,null,k.createElement("div",{className:"k-sticky-cell"},k.createElement("div",{className:"k-scheduler-cell k-heading-cell k-side-cell k-scheduler-times-all-day","data-range-index":0},t.toLanguageString(Ae,Pr[Ae]))),e.children)},So=e=>{var t;const{group:r,timezone:l,resources:s}=le(),c=k.useRef(null),i=k.useRef(null),u=e.editItem||Nl,d=e.editSlot||Kn,m=k.useRef(null),[p]=ke(),g=he(),v=me(),h=ge(),E=ie(),y=o.useInternationalization(),[f]=Fl(e.showWorkHours,null!=(t=e.defaultShowWorkHours)?t:wo.defaultShowWorkHours),D=e.slotDivisions||wo.slotDivisions,C=e.slotDuration||wo.slotDuration,b=e.workWeekStart||wo.workWeekStart,S=e.workWeekEnd||wo.workWeekEnd,w=y.parseDate(e.workDayStart||e.isWorkDayStart||wo.isWorkDayStart),I=y.parseDate(e.workDayEnd||e.isWorkDayEnd||wo.isWorkDayEnd),R=y.parseDate(e.startTime||wo.startTime),A=y.parseDate(e.endTime||wo.endTime),M=k.useMemo(()=>f?w:R,[f,w,R]),N=k.useMemo(()=>f?I:A,[f,I,A]),L=k.useMemo(()=>Pl(h,{step:a.MS_PER_DAY,timezone:l}),[h.start.getTime(),h.end.getTime(),l]),z=k.useMemo(()=>Hl(0,{step:C/D*a.MS_PER_MINUTE},{groups:v,ranges:L}).filter(e=>B(e.zonedStart,M,N)||M.getTime()===N.getTime()),[v,L,h.start.getTime(),h.end.getTime(),l,C,D,M.getTime(),N.getTime()]),_=k.useMemo(()=>Xn(p,{dateRange:h,fields:E,timezone:l}),[p,h.start.getTime(),h.end.getTime(),E,l]),O=k.useMemo(()=>tl(_,{timezone:l},{groups:v,ranges:L}).filter(e=>M.getTime()===N.getTime()||B(e.zonedStart,M,N)||B(e.zonedEnd,M,N)||B(new Date(e.zonedEnd.getTime()-(e.zonedEnd.getTime()-e.zonedStart.getTime())/2),M,N)),[_,l,v,L,M.getTime(),N.getTime()]);k.useMemo(()=>q(O,z,!0),[O,z]),k.useMemo(()=>U(O,z,!0),[O,z]);const W=("horizontal"===g?z.length:z.length/v.length)*((e.columnWidth||wo.columnWidth)+1),P=k.createElement(rn.Consumer,null,()=>k.createElement(k.Fragment,null,k.createElement("div",{className:"k-scheduler-row"},L.map((t,r)=>k.createElement(Ol,{as:e.dateHeaderCell,key:r,date:t.zonedStart,start:t.start,end:t.end,format:"m"}))),k.createElement("div",{className:"k-scheduler-row",ref:c},L.map((t,r)=>z.filter(e=>0===e.group.index&&e.range.index===r).map(t=>t.zonedStart.getMinutes()%C===0?k.createElement(yn,{key:t.index,as:e.timeHeaderCell,format:"t",date:t.zonedStart,start:t.zonedStart,end:t.zonedEnd}):null))))),H=k.createElement(rn.Consumer,null,({groupIndex:t})=>k.createElement("div",{className:"k-scheduler-row"},L.map((r,n)=>z.filter(e=>e.group.index===t&&e.range.index===n).map((r,o,s)=>{const c=a.ZonedDate.fromUTCDate(F(r.zonedStart),l),i=V(c.getDay(),b,S);return k.createElement(d,{key:`${r.start.getTime()}:${r.group.index}`,slot:e.slot,viewSlot:e.viewSlot,...r,form:e.form,onDataAction:e.onDataAction,isWorkHour:B(r.zonedStart,w,I),isWorkDay:i,col:"horizontal"===g?n*s.length+o+s.length*L.length*(t||0):n*s.length+o,row:"horizontal"===g?0:t||0,expandable:{offsetBottom:25},editable:e.editable})})))),K=k.useMemo(()=>n.classNames("k-scheduler-timelineview",e.className),[e.className]);Za({element:m,selector:".k-resource-cell",attribute:"data-depth-index",explicitDepth:!0});const G=m.current?m.current.closest(".k-scheduler-layout"):null;return Zn({element:G,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:O&&!O.length}),k.createElement(tn,{ref:m,id:e.id,style:{...e.style},className:K,props:e,slots:z,ranges:L},k.createElement("div",{className:"k-scheduler-head",style:{width:W}},"horizontal"===g?k.createElement(an,{nested:!0,group:r,resources:s,rowContent:Co},P):k.createElement(cn,{wrapGroup:!0,group:r,resources:s},P)),k.createElement("div",{className:"k-scheduler-body",style:{width:W},ref:i},"horizontal"===g?k.createElement(an,{group:r,resources:s,rowContent:bo},H,k.createElement(rn.Consumer,null,({groupIndex:t})=>e.currentTimeMarker&&$(T(L).start,x(L).end,new Date,new Date,!0)&&k.createElement(zl,{groupIndex:t,attachArrow:c,vertical:!0}))):k.createElement(cn,{nested:!0,wrapGroup:!0,group:r,resources:s},H),"vertical"===g&&e.currentTimeMarker&&$(T(L).start,x(L).end,new Date,new Date,!0)&&k.createElement(zl,{attachArrow:c,vertical:!0}),O.sort(j).map((t,r)=>k.createElement(u,{key:t.isRecurring?`${t.uid}:${t.group.index}:${t.range.index}:${t.originalStart}`:`${t.uid}:${t.group.index}:${t.range.index}`,...t,format:"t",form:e.form,onDataAction:e.onDataAction,item:e.item,viewItem:e.viewItem,editable:e.editable,ignoreIsAllDay:!0,vertical:!1,isLast:r===O.length-1}))))},wo={name:"multi-day-timeline",title:"Multi Day Timeline",currentTimeMarker:!0,dateRange:({date:e,numberOfDays:t=1,timezone:r})=>{const n=a.ZonedDate.fromLocalDate(e,r),l=a.getDate(n),o=a.addDays(l,t),s=a.ZonedDate.fromUTCDate(F(l),r),c=a.ZonedDate.fromUTCDate(F(o),r);return{start:new Date(s.getTime()),end:new Date(c.getTime()),zonedStart:s,zonedEnd:c}},selectedDateFormat:"{0:M}",selectedShortDateFormat:"{0:m}",numberOfDays:1,startTime:"00:00",endTime:"00:00",isWorkDayStart:"8:00",isWorkDayEnd:"17:00",workWeekStart:a.Day.Monday,workWeekEnd:a.Day.Friday,slotDivisions:2,slotDuration:60,defaultShowWorkHours:!0,columnWidth:100},Io=e=>k.createElement(So,{...e}),Ro={...wo,name:"timeline",title:e=>e.toLanguageString(Le,Pr[Le]),slotDuration:60,slotDivisions:2,numberOfDays:1,selectedDateFormat:"{0:M}",selectedShortDateFormat:"{0:m}"};Io.displayName="KendoReactSchedulerTimelineView";const To=(e,t,r)=>e.filter(e=>{const a=L(e,t.recurrenceId);return null!=a&&a===r&&!L(e,t.recurrenceRule)}),xo=(e,t)=>{const r=n.clone(e);return z(r,t.recurrenceId,null),z(r,t.recurrenceRule,null),z(r,t.originalStart,null),r},Ao=new Map;Ao.set(ro,no),Ao.set(Vl,Gl),Ao.set(go,vo),Ao.set(Eo,yo),Ao.set(fo,ko),Ao.set(Io,Ro);const Mo=k.forwardRef((e,t)=>{var r,l,i,u;const m=!n.validatePackage(Ul,{component:"Scheduler"}),p=n.getLicenseMessage(Ul),{timezone:g,onDataChange:v}=e,h=k.useRef(null),E=k.useRef(null);k.useImperativeHandle(E,()=>({props:e,element:h.current})),k.useImperativeHandle(t,()=>E.current),n.useWebMcpRegister("scheduler",E,e,e.webMcp);const y=n.useRtl(h),f=o.useInternationalization(),D=o.useLocalization(),{fields:S}=k.useMemo(()=>(e=>({fields:{...K,...e}}))(e.modelFields),[e.modelFields]),[w,I]=we(e.defaultDate||No.defaultDate,e.date,e.onDateChange),R=k.Children.toArray(e.children||[]).map(e=>{var t;return k.isValidElement(e)?k.cloneElement(e,{...Ao.get(e.type),...null!=(t=e.props)?t:{}}):e}),T=k.cloneElement(k.createElement(Vl,null),Ao.get(Vl)),[x,A]=we(e.defaultView||R[0]&&R[0].props.name||"day",e.view,e.onViewChange),M=R.find(e=>e.props.name===x)||R[0]||T,N=M.props,[_,F]=we(null==(r=N.defaultShowWorkHours)||r,N.showWorkHours),W=(null!=(l=e.data)?l:No.data)||No.data,P=((e,t)=>{const r=b(e,t),a=C(r);return 1===a.length&&0===a[0].length?[{index:0,isDefault:!0,resources:(t||[]).reduce((e,t)=>[...e,...t.data.map(e=>({...e,field:t.field,valueField:t.valueField,colorField:t.colorField,multiple:t.multiple}))],[])}]:a.map((e,t)=>({index:t,resources:e}))})(e.group,e.resources),H=e.group&&e.group.orientation?e.group.orientation:"horizontal",$=M.props.selectedDateFormat||"{0:D}",B=M.props.selectedShortDateFormat||"{0:d}",V=M.props.slotDuration,G=void 0!==M.props.dateRange?"function"==typeof M.props.dateRange?M.props.dateRange.call(void 0,{intl:f,date:w,timezone:g,numberOfDays:M.props.numberOfDays,workWeekStart:M.props.workWeekStart||f.firstDay(),workWeekEnd:M.props.workWeekEnd||(f.firstDay()+M.props.numberOfDays)%6}):M.props.dateRange:{start:No.defaultDate,end:No.defaultDate},U=k.useCallback(({created:e=[],updated:t=[],deleted:r=[]})=>{if(v){const a={created:e,updated:t,deleted:r};v.call(void 0,a)}},[v]),q=k.useCallback(e=>{const t=[e.dataItem];U({created:t})},[U]),Z=k.useCallback(e=>{const t=[],r=[],a=[];if(e.series)if(Array.isArray(e.dataItem)){const t=e.dataItem[0];if(null!==L(t,S.recurrenceId)&&void 0!==L(t,S.recurrenceId)){const e=n.clone(O(t,S,W)),a=new Date(L(t,S.originalStart)).getTime(),l=new Date(L(t,S.start)).getTime(),o=new Date(L(t,S.end)).getTime(),s=l-a,c=o-l,i=new Date(L(e,S.start)).getTime();z(e,S.start,new Date(i+s)),z(e,S.end,new Date(i+s+c));const u=L(e,S.recurrenceExceptions)||[];if(u.length>0&&0!==s){const t=u.map(e=>new Date(new Date(e).getTime()+s));z(e,S.recurrenceExceptions,t)}r.push(e)}else e.dataItem.forEach(e=>{const t=n.clone(O(e,S,W)),a=n.clone(e);z(a,S.originalStart,L(t,S.originalStart)),z(a,S.recurrenceId,L(t,S.recurrenceId));const l=L(t,S.recurrenceExceptions)||[],o=new Date(L(t,S.start)).getTime(),s=new Date(L(a,S.start)).getTime()-o;if(l.length>0&&0!==s){const e=l.map(e=>new Date(new Date(e).getTime()+s));z(a,S.recurrenceExceptions,e)}else z(a,S.recurrenceExceptions,l);r.push(a)})}else if(null!==L(e.dataItem,S.recurrenceId)&&void 0!==L(e.dataItem,S.recurrenceId)){const t=n.clone(O(e.dataItem,S,W)),a=new Date(L(e.dataItem,S.originalStart)).getTime(),l=new Date(L(e.dataItem,S.start)).getTime(),o=new Date(L(e.dataItem,S.end)).getTime(),s=l-a,c=o-l,i=new Date(L(t,S.start)).getTime();z(t,S.start,new Date(i+s)),z(t,S.end,new Date(i+s+c));const u=L(t,S.recurrenceExceptions)||[];if(u.length>0&&0!==s){const e=u.map(e=>new Date(new Date(e).getTime()+s));z(t,S.recurrenceExceptions,e)}r.push(t)}else{const t=n.clone(e.dataItem);if(L(t,S.recurrenceRule)){const r=n.clone(O(e.dataItem,S,W));z(t,S.originalStart,L(r,S.originalStart)),z(t,S.recurrenceId,L(r,S.recurrenceId));const a=L(r,S.recurrenceExceptions)||[],l=new Date(L(r,S.start)).getTime(),o=new Date(L(t,S.start)).getTime()-l;if(a.length>0&&0!==o){const e=a.map(e=>new Date(new Date(e).getTime()+o));z(t,S.recurrenceExceptions,e)}else z(t,S.recurrenceExceptions,a)}else if(z(t,S.recurrenceExceptions,null),!e.resetExceptions){const e=L(t,S.id);To(W,S,e).forEach(e=>{r.push(xo(e,S))})}r.push(t)}else if(Array.isArray(e.dataItem))e.dataItem.forEach(e=>{const a=null!==L(e,S.recurrenceRule)&&void 0!==L(e,S.recurrenceRule);if(null!==L(e,S.recurrenceId)&&void 0!==L(e,S.recurrenceId)&&a){const a=n.clone(O(e,S,W)),l=L(e,S.originalStart),o=L(a,S.recurrenceExceptions)||[];z(a,S.recurrenceExceptions,[...o,l]),z(e,S.recurrenceRule,null),r.push(a),t.push(e)}else r.push(e)});else{const a=null!==L(e.dataItem,S.recurrenceRule)&&void 0!==L(e.dataItem,S.recurrenceRule);if(null!==L(e.dataItem,S.recurrenceId)&&void 0!==L(e.dataItem,S.recurrenceId)&&a){const a=n.clone(O(e.dataItem,S,W)),l=L(e.dataItem,S.originalStart),o=L(a,S.recurrenceExceptions)||[];z(a,S.recurrenceExceptions,[...o,l]),z(e.dataItem,S.recurrenceRule,null),r.push(a),t.push(e.dataItem)}else r.push(e.dataItem)}if(e.series&&e.resetExceptions){const t=Array.isArray(e.dataItem)?e.dataItem[0]:e.dataItem,l=t&&L(t,S.recurrenceId),o=null!=l?l:t&&L(t,S.id);null!=o&&(W.forEach(e=>{const t=L(e,S.recurrenceId),r=L(e,S.recurrenceRule);t===o&&!r&&a.push(n.clone(e))}),r.forEach(e=>{L(e,S.id)===o&&z(e,S.recurrenceExceptions,null)}))}U({updated:r,created:t,deleted:a})},[U,S,W]),Y=k.useCallback(e=>{const t=[],r=[];if(e.series){const a=n.clone(O(e.dataItem,S,W)),l=n.clone(e.dataItem);z(l,S.originalStart,L(a,S.originalStart)),z(l,S.recurrenceId,L(a,S.recurrenceId)),z(l,S.recurrenceRule,L(a,S.recurrenceRule)),z(l,S.recurrenceExceptions,L(a,S.recurrenceExceptions)),r.push(l);const o=L(a,S.id),s=To(W,S,o);e.resetExceptions?s.forEach(e=>r.push(n.clone(e))):s.forEach(e=>t.push(xo(e,S)))}else if(null===L(e.dataItem,S.recurrenceRule)||void 0===L(e.dataItem,S.recurrenceRule))r.push(e.dataItem);else{const r=n.clone(O(e.dataItem,S,W)),a=L(e.dataItem,S.originalStart),l=L(r,S.recurrenceExceptions)||[];z(r,S.recurrenceExceptions,[...l,a]),z(e.dataItem,S.recurrenceRule,null),t.push(r)}U({updated:t,deleted:r})},[U,S,W]),j=k.useCallback(e=>{switch(e.type){case te.create:q(e);break;case te.update:Z(e);break;case te.remove:Y(e)}},[q,Y,Z]),X=k.useCallback((e,t)=>{A(e,{...t,target:E.current})},[A,E]),Q=k.useCallback((e,t)=>{I(e,{...t,target:E.current})},[I,E]),J=k.useCallback(e=>{e.value&&I(e.value,{...e,target:E.current,nativeEvent:e.nativeEvent})},[I,E]),ee=k.useCallback(e=>{var t,r;e.preventDefault();const n=null!=(r=null!=(t=M.props.step)?t:M.props.numberOfDays)?r:1,l=n>27?a.addMonths(w,Math.round(n/27)):a.addDays(w,n);I(l,e)},[w,I,M.props.numberOfDays,M.props.step]),re=k.useCallback(e=>{var t,r;e.preventDefault();const n=null!=(r=null!=(t=M.props.step)?t:M.props.numberOfDays)?r:1,l=n>27?a.addMonths(w,-Math.round(n/27)):a.addDays(w,-n);I(l,e)},[w,I,M.props.numberOfDays,M.props.step]),ae=k.useCallback(e=>{e.preventDefault();const t=a.ZonedDate.fromLocalDate(new Date,g);I(new Date(t.getTime()),e)},[I,g]),ne=k.useCallback(()=>{F(!_)},[F,_]),le=k.useCallback(()=>{h.current&&(h.current.style.boxShadow="0 0.5px 0.5px 0.5px rgba(0, 0, 0, .12)")},[h]),oe=k.useCallback(()=>{h.current&&(h.current.style.boxShadow="")},[h]),se=k.useMemo(()=>{var t;return{...e.style,height:null!=(t=e.height)?t:No.height}},[e.height,e.style]),ce=k.useMemo(()=>n.classNames({"k-rtl":void 0!==e.rtl?e.rtl:"rtl"===y},"k-scheduler",e.className),[e.className,e.rtl,y]),ie=D.toLanguageString(Ne,Pr[Ne]),ue=D.toLanguageString(He,Pr[He]),de=D.toLanguageString($e,Pr[$e]),me=D.toLanguageString(Mr,Pr[Mr]),pe=D.toLanguageString(Lr,Pr[Lr]),ge=k.useRef(null),ve=(e=>{const[t,r]=k.useState(0),a=k.useRef(0),n=k.useRef(!1);return k.useEffect(()=>{const t=e.current;if(!t||"undefined"==typeof ResizeObserver)return;const l={childList:!0,subtree:!0,characterData:!0},o=()=>{if(!n.current&&0!==t.offsetWidth){for(n.current=!0,i.disconnect();a.current>0;)if(a.current--,c.flushSync(()=>r(a.current)),t.scrollWidth>t.offsetWidth){a.current++,c.flushSync(()=>r(a.current));break}for(;t.scrollWidth>t.offsetWidth&&a.current<3;)a.current++,c.flushSync(()=>r(a.current));i.observe(t,l),n.current=!1}},s=new ResizeObserver(o);s.observe(t);const i=new MutationObserver(o);return i.observe(t,l),()=>{s.disconnect(),i.disconnect()}},[e]),t})(ge),he=M.props.header||e.header||No.header,Ee=M.props.footer||e.footer||No.footer,ye=M.props.form||e.form||Aa,[fe,ke]=k.useState(null),[De,Ce]=k.useState(null),be=k.useCallback(e=>{e.preventDefault();const t=new Date,r=V||30,a=60*r*1e3,n=t.getMinutes(),l=Math.ceil(n/r)*r;let o=new Date(t);o.setHours(t.getHours()+Math.floor(l/60),l%60,0,0);const s=(e,t)=>W.some(r=>{const a=L(r,S.start),n=L(r,S.end);return!(!a||!n)&&(a.getTime()<t.getTime()&&n.getTime()>e.getTime())});let c=new Date(o.getTime()+a);for(let e=0;e<48&&s(o,c);e++)o=new Date(o.getTime()+a),c=new Date(o.getTime()+a);const i={};z(i,S.start,o),z(i,S.end,c),z(i,S.isAllDay,!1),z(i,S.title,""),z(i,S.description,""),Ce(i)},[W,S,V]),Ie=k.useCallback(e=>{e.value&&U({created:[e.value]}),Ce(null)},[U]),Re=k.useCallback(e=>{Ce(null)},[]),Te=k.useCallback(e=>{Ce(null)},[]),xe="object"==typeof e.editable?e.editable.add:!!e.editable;return k.createElement(Se,{element:h,props:e,views:R,fields:S,groups:P,dateRange:G,orientation:H,dateFormat:{dateFormat:$,shortDateFormat:B},date:[w,Q],activeView:[x,X],selection:[fe,ke],data:[W,j]},k.createElement("div",{ref:h,id:e.id,style:se,className:ce,tabIndex:null!=(i=e.tabIndex)?i:No.tabIndex,dir:y,role:e.role||"application","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-activedescendant":fe&&fe.props.id||void 0,onFocus:le,onBlur:oe},k.createElement(he,{ref:e=>{var t;ge.current=null!=(t=null==e?void 0:e.element)?t:null},ariaLabel:pe,style:{flexWrap:ve<3?"nowrap":"wrap"}},xe&&k.createElement(s.Button,{className:"k-toolbar-button",themeColor:"primary",svgIcon:d.plusIcon,"aria-label":me,tabIndex:-1,onClick:be},ve<2&&me),ve<2&&k.createElement(s.Button,{className:"k-toolbar-button",fillMode:"flat",tabIndex:-1,onClick:ae},ie),ve<3&&k.createElement(s.ButtonGroup,{className:"k-button-group-flat k-toolbar-button-group"},k.createElement(s.Button,{fillMode:"flat",tabIndex:-1,svgIcon:"rtl"===y?d.chevronRightIcon:d.chevronLeftIcon,"aria-label":ue,title:ue,onClick:re}),k.createElement(s.Button,{fillMode:"flat",tabIndex:-1,svgIcon:"rtl"===y?d.chevronLeftIcon:d.chevronRightIcon,"aria-label":de,title:de,onClick:ee})),k.createElement(Hr,{value:w,onChange:J,level:ve}),k.createElement(s.ToolbarSpacer,null),1===ve&&k.createElement("span",{className:"k-separator"}),k.createElement($r,{level:ve})),M&&k.createElement(M.type,{editable:null!=(u=e.editable)?u:No.editable,key:M.props.name,item:e.item,viewItem:e.viewItem,editItem:e.editItem,task:e.task,viewTask:e.viewTask,editTask:e.viewTask,slot:e.slot,viewSlot:e.viewSlot,editSlot:e.editSlot,form:e.form,onDataAction:j,showWorkHours:_,...M.props}),(M.props.footer||e.footer||"agenda"!==x&&"month"!==x)&&k.createElement(Ee,{ariaLabel:pe},"agenda"!==x&&"month"!==x&&V&&V<1440&&k.createElement(s.Button,{className:"k-toolbar-button k-scheduler-fullday",tabIndex:-1,onClick:ne,svgIcon:d.clockIcon},D.toLanguageString(_?Ke:Be,Pr[_?Ke:Be]))),m&&k.createElement(n.WatermarkOverlay,{message:p}),De&&k.createElement(ye,{dataItem:De,onSubmit:Ie,onCancel:Re,onClose:Te})))}),No={data:[],height:600,tabIndex:-1,editable:!1,quickCreate:!0,eventOverview:!0,defaultDate:new Date,header:Ie,footer:xe,navigation:Re,viewSelector:Te};Mo.propTypes={data:r.array,editable:r.oneOfType([r.bool,r.shape({add:r.bool,drag:r.bool,edit:r.bool,remove:r.bool,resize:r.bool})]),quickCreate:r.bool,eventOverview:r.bool,view:r.string,defaultView:r.string,date:r.any,defaultDate:r.any,rtl:r.bool,height:r.oneOfType([r.number,r.string]),children:r.any,timezone:r.string,group:r.any,resources:r.any,modelFields:r.shape({id:r.string,start:r.string,startTimezone:r.string,end:r.string,endTimezone:r.string,isAllDay:r.string,title:r.string,description:r.string,recurrenceRule:r.string,recurrenceId:r.string,recurrenceException:r.string})},Mo.displayName="KendoReactScheduler";const Lo=k.forwardRef((e,t)=>{var r;const{item:a,_ref:l,itemRef:s,...c}=e,i=k.useRef(void 0),u=k.useRef(null),m=k.useRef(null),p=k.useRef(null);k.useImperativeHandle(m,()=>({props:e,element:u.current&&u.current.element})),k.useImperativeHandle(t,()=>m.current),k.useImperativeHandle(l,()=>u.current),k.useImperativeHandle(s,()=>u.current);const g=a||zo.item,v=o.useInternationalization(),[h]=Wa(),[E]=Fa(),y=ae(),[f,D]=k.useState(!0),[C,b]=k.useState(!1),S=k.useRef(0),I=k.useRef(null),A=k.useRef([]),M=n.useDir(y),N=k.useMemo(()=>{var t,r;return e.isAllDay?null!=(t=e.title)?t:"":`(${v.format("{0:t} - {1:t}",e.zonedStart,e.zonedEnd)}): ${null!=(r=e.title)?r:""}`},[v,e.isAllDay,e.title,e.zonedEnd,e.zonedStart]);let L;e.isRecurring&&!e.isException?L="recurring":!e.isRecurring&&e.isException&&(L="non-recurring");const z=k.useMemo(()=>v.format("{0:t} – {1:t}",e.zonedStart,e.zonedEnd),[v,e.zonedStart,e.zonedEnd]),_=!0===(null==(r=e.range)?void 0:r.isAllDay),F=()=>{var t,r,a,n,l;const o=E.filter(t=>t.current&&((t,r)=>t.group.index===r.group.index&&t.range.index===r.range.index&&(void 0===t.range.isAllDay||void 0===r.range.isAllDay||t.range.isAllDay===r.range.isAllDay)&&(e.ignoreIsAllDay||t.isAllDay===r.isAllDay))(t.current.props,e)).sort((e,t)=>e.current.props.start.getTime()-t.current.props.start.getTime()),s=o.filter(t=>$(t.current.props.start,t.current.props.end,e.start,e.end)),c=u.current&&u.current.element;if(!c||!s.length)return;const i=T(o),d=x(o),m=T(s),p=x(s);if(!(m.current&&u.current&&p.current&&i.current&&d.current))return;if(!$(m.current.props.start,p.current.props.end,e.start,e.end))return void D(!1);const g=[],v=[],y=[],f=w(m.current.element),k=(e.vertical?f.height:f.width)/(m.current.props.end.getTime()-m.current.props.start.getTime()),C=(e.vertical?12:8)/k,M=(Math.min(e.start.getTime(),p.current.props.end.getTime()-C)-m.current.props.start.getTime())*k,N=Math.floor(Math.min(e.end.getTime(),p.current.props.end.getTime())-Math.max(e.start.getTime(),m.current.props.start.getTime()))*k;(h||[]).forEach(e=>{e.current&&(e.current.props.dragHint?v.push(e.current):e.current.props.resizeHint?y.push(e.current):g.push(e.current))}),A.current=((t,r,a)=>{const[n,l]=r,o=new Date(Math.min(l.props.end.getTime()-a,Math.max(e.start.getTime(),n.props.start.getTime()))),s=new Date(Math.max(o.getTime()+a,Math.min(e.end.getTime(),l.props.end.getTime())));return t.filter(t=>{const r=Math.max(Math.min(l.props.end.getTime()-a,t.props.start.getTime()),n.props.start.getTime()),c=Math.min(Math.max(r+a,t.props.end.getTime()),l.props.end.getTime());return t.props.id!==e.id&&t.props.group.index===e.group.index&&t.props.range.index===e.range.index&&(void 0===t.props.range.isAllDay||void 0===e.range.isAllDay||t.props.range.isAllDay===e.range.isAllDay)&&(e.ignoreIsAllDay||t.props.isAllDay===e.isAllDay)&&$(new Date(r),new Date(c),o,s)&&$(n.props.start,l.props.end,t.props.start,t.props.end)})})(g,[i.current,d.current],C),I.current=e.resizeHint||e.dragHint?0:((e,t)=>{const r=new Set;return t.forEach(e=>{void 0!==e._order&&null!==e._order&&r.add(e._order)}),G(Array.from(r))})(u.current,A.current);let L=1;e.resizeHint||e.dragHint||(L=((e,t)=>{var r;let a=null!=(r=e._order)?r:0;return t.forEach(e=>{void 0!==e._order&&null!==e._order&&a<e._order&&(a=e._order)}),a+1})(u.current,A.current));let z=0;const _=f;A.current.forEach(e=>{let t=0;void 0!==e._order&&null!==e._order&&e._order<I.current&&(t=w(e.element).top+w(e.element).height-_.top-1*I.current+1),t>z&&(z=t)});_.width=e.vertical?_.width/L-1-20/L:N-1,e.vertical?_.height=N-1:(e.resizeHint||e.dragHint)&&L<=1||(_.height=null!=(r=null==(t=e.style)?void 0:t.height)?r:12),_.left=e.vertical?_.left+(null!=(a=I.current)?a:0)+1*(null!=(n=I.current)?n:0)*_.width:_.left+(M<0?0:M),_.top=e.vertical?_.top+(M<0?0:M):_.top+z+1*(null!=(l=I.current)?l:0),S.current=L,R(c,_),b(!0),D(!0)},O=k.useCallback(e=>{const t=e&&e[0],r=p.current;void 0!==i.current&&window.cancelAnimationFrame(i.current),r&&t&&(r.width!==t.contentRect.width||r.height!==t.contentRect.height)&&(i.current=window.requestAnimationFrame(()=>{F()})),p.current={width:t.contentRect.width,height:t.contentRect.height}},[F]);k.useEffect(F);const W=u.current&&u.current.element?u.current.element.closest(".k-scheduler-layout"):null;return Zn({element:W,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:e.isLast}),k.useEffect(()=>{if(!y.current)return;const e=window.ResizeObserver,t=e&&new e(O);return t&&t.observe(y.current),()=>{t&&t.disconnect()}},[O,y]),k.createElement(g,{...c,_ref:u,_order:I,_maxSiblingsPerSlot:S,_siblings:A,itemRef:u,style:{visibility:C?void 0:"hidden",display:f?void 0:"none",...e.style}},!e.resizeHint&&k.createElement(k.Fragment,null,e.tail&&!e.vertical&&k.createElement("span",{className:"k-event-continuation"},k.createElement(n.IconWrap,{name:"rtl"===M?"chevron-right":"chevron-left",icon:"rtl"===M?d.chevronRightIcon:d.chevronLeftIcon})),k.createElement("div",{title:N},e.tail&&e.vertical&&k.createElement("span",{className:"k-event-continuation"},k.createElement(n.IconWrap,{name:"chevron-up",icon:d.chevronUpIcon})),_&&!e.isAllDay&&!e.tail&&k.createElement("span",{className:"k-event-all-day-time"},v.formatDate(e.zonedStart,"t")),k.createElement(qn,{className:"k-event-title"},e.title),_&&!e.isAllDay&&!e.head&&k.createElement("span",{className:"k-event-all-day-time"},v.formatDate(e.zonedEnd,"t")),!_&&k.createElement(qn,{className:"k-event-time"},"recurring"===L&&k.createElement("span",{className:"k-event-recurrence-icon"},k.createElement(n.IconWrap,{name:"arrow-rotate-cw",icon:d.arrowRotateCwIcon})),"non-recurring"===L&&k.createElement("span",{className:"k-event-recurrence-icon"},k.createElement(n.IconWrap,{name:"arrows-no-repeat",icon:d.arrowsNoRepeatIcon})),z),e.head&&e.vertical&&k.createElement("span",{className:"k-event-continuation"},k.createElement(n.IconWrap,{name:"chevron-down",icon:d.chevronDownIcon}))),L&&k.createElement("span",{className:"k-event-recurrence-icon"},k.createElement(n.IconWrap,{name:"recurring"===L?"arrow-rotate-cw":"arrows-no-repeat",icon:"recurring"===L?d.arrowRotateCwIcon:d.arrowsNoRepeatIcon})),e.head&&!e.vertical&&k.createElement("span",{className:"k-event-continuation"},k.createElement(n.IconWrap,{name:"rtl"===M?"chevron-left":"chevron-right",icon:"rtl"===M?d.chevronLeftIcon:d.chevronRightIcon}))))}),zo={item:Un};Lo.displayName="KendoReactSchedulerProportionalViewItem",e.AgendaView=ro,e.DATA_ACTION=te,e.DRAG_ITEM_ACTION=Cl,e.DateHeaderCell=Ol,e.DayView=Vl,e.DiscardChangesDialog=xa,e.ITEMS_FOCUS_ACTION=en,e.ITEMS_SELECT_ACTION=Ua,e.KeepResetCustomEventsDialog=Al,e.MonthView=go,e.REMOVE_ITEM_ACTION=kl,e.RESIZE_ITEM_ACTION=bl,e.RemoveRecurrenceConfirmDialog=Ca,e.SERIES_ACTION=Sl,e.SHOW_OCCURRENCE_DIALOG_ACTION=fl,e.SHOW_REMOVE_DIALOG_ACTION=Dl,e.SLOTS_FOCUS_ACTION=Ya,e.SLOTS_SELECT_ACTION=qa,e.Scheduler=Mo,e.SchedulerActiveViewContext=De,e.SchedulerDataContext=fe,e.SchedulerDateContext=Ee,e.SchedulerDateRangeContext=pe,e.SchedulerDrag=ol,e.SchedulerEditItem=Nl,e.SchedulerEditItemDragItemContext=ml,e.SchedulerEditItemFormItemContext=dl,e.SchedulerEditItemPropsContext=ul,e.SchedulerEditItemRemoveItemContext=gl,e.SchedulerEditItemResizeItemContext=pl,e.SchedulerEditItemShowOccurrenceDialogContext=hl,e.SchedulerEditItemShowRemoveDialogContext=vl,e.SchedulerEditSlot=Kn,e.SchedulerEditSlotFormItemContext=Mn,e.SchedulerEditSlotPropsContext=An,e.SchedulerEditTask=eo,e.SchedulerFieldsContext=ce,e.SchedulerFooter=xe,e.SchedulerForm=Aa,e.SchedulerFormEditor=ba,e.SchedulerGroupsContext=de,e.SchedulerHeader=Ie,e.SchedulerItem=Un,e.SchedulerItemContent=qn,e.SchedulerOccurrenceDialog=Vn,e.SchedulerOrientationContext=ve,e.SchedulerProportionalViewItem=Lo,e.SchedulerPropsContext=ne,e.SchedulerQuickCreateForm=Pn,e.SchedulerRecurrenceDialog=Da,e.SchedulerRemoveDialog=Gn,e.SchedulerResize=cl,e.SchedulerSlot=Dn,e.SchedulerTask=ql,e.SchedulerViewItem=Yn,e.SchedulerViewSlot=Tn,e.SchedulerViewTask=Zl,e.SchedulerViewsContext=oe,e.TimeHeaderCell=yn,e.TimelineView=Io,e.WeekView=Eo,e.WorkWeekView=fo,e.agendaViewDefaultProps=no,e.dateHeaderCellDefaultProps=Wl,e.dayViewDefaultProps=Gl,e.monthViewDefaultProps=vo,e.schedulerDefaultProps=No,e.schedulerDragDefaultProps=sl,e.schedulerEditItemDefaultProps=Ll,e.schedulerEditSlotDefaultProps=Bn,e.schedulerEditTaskDefaultProps=to,e.schedulerFormDefaultProps=Ma,e.schedulerFormEditorDefaultProps=Ta,e.schedulerProportionalViewItemDefaultProps=zo,e.schedulerQuickCreateFormDefaultProps={},e.schedulerResizeDefaultProps=il,e.schedulerSlotDefaultProps=Cn,e.schedulerViewItemDefaultProps=jn,e.schedulerViewSlotDefaultProps=xn,e.schedulerViewTaskDefaultProps=Yl,e.timeHeaderCellDefaultProps=fn,e.timeLineViewDefaultProps=Ro,e.useSchedulerActiveViewContext=Ce,e.useSchedulerDataContext=ke,e.useSchedulerDateContext=ye,e.useSchedulerDateRangeContext=ge,e.useSchedulerEditItemDragItemContext=()=>k.useContext(ml),e.useSchedulerEditItemFormItemContext=()=>k.useContext(dl),e.useSchedulerEditItemPropsContext=()=>k.useContext(ul),e.useSchedulerEditItemRemoveItemContext=()=>k.useContext(gl),e.useSchedulerEditItemResizeItemContext=()=>k.useContext(pl),e.useSchedulerEditItemShowOccurrenceDialogContext=()=>k.useContext(hl),e.useSchedulerEditItemShowRemoveDialogContext=()=>k.useContext(vl),e.useSchedulerEditSlotFormItemContext=()=>k.useContext(Mn),e.useSchedulerEditSlotPropsContext=()=>k.useContext(An),e.useSchedulerFieldsContext=ie,e.useSchedulerGroupsContext=me,e.useSchedulerOrientationContext=he,e.useSchedulerPropsContext=le,e.useSchedulerViewsContext=se,e.weekViewDefaultProps=yo,e.workWeekDefaultProps=ko});