@progress/kendo-react-scheduler 16.4.0-develop.6 → 16.4.0-develop.7
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.
|
@@ -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,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.recurrenceCustomEventsDeleteDialogTitle",hr="scheduler.recurrenceCustomEventsDeleteConfirmation",Er="scheduler.recurrenceCustomEventsDelete",yr="scheduler.recurrenceCustomEventsCancel",fr="scheduler.editorDiscardChangesDialogTitle",kr="scheduler.editorDiscardChangesConfirmation",Dr="scheduler.editorDiscardChangesDiscard",Cr="scheduler.editorDiscardChangesCancel",br="scheduler.recurrenceEditorWeeklyRepeatOnDays",Sr="scheduler.editorMakeRecurring",wr="scheduler.editorEditRecurrence",Ir="scheduler.editorTimezoneButton",Rr="scheduler.editorSetTimezoneTitle",Tr="scheduler.editorResetTimezoneTitle",xr="scheduler.editorResetTimezoneAriaLabel",Ar="scheduler.editorStartTimeAriaLabel",Mr="scheduler.editorEndTimeAriaLabel",Nr="scheduler.editorDateConnectorFrom",Lr="scheduler.editorDateConnectorTo",zr="scheduler.editorNewEvent",_r="scheduler.editorEditEvent",Fr="scheduler.toolbarLabel",Or="scheduler.quickCreateSave",Wr="scheduler.quickCreateMoreOptions",Pr="scheduler.quickCreateCancel",Hr="scheduler.overviewPopoverEdit",$r="scheduler.overviewPopoverDelete",Kr={[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]:"Keep or delete custom events?",[hr]:"Some events in this series have been edited separately. Choose whether to keep those custom events, or delete them along with the series?",[Er]:"Delete custom events",[yr]:"Cancel",[fr]:"Discard changes",[kr]:"Are you sure you want to discard the changes?",[Dr]:"Discard changes",[Cr]:"Cancel",[br]:"Repeat on days",[Sr]:"Make recurring",[wr]:"Edit recurrence",[Ir]:"Time zone",[Rr]:"Set Timezone",[Tr]:"Reset Timezone",[xr]:"Reset timezone",[Ar]:"Start time",[Mr]:"End time",[Nr]:"from",[Lr]:"to",[zr]:"New event",[_r]:"Edit event",[Fr]:"Toolbar",[Or]:"Save",[Wr]:"More options",[Pr]:"Cancel",[Hr]:"Edit",[$r]:"Delete"},Br=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})))});Br.displayName="KendoReactSchedulerNavigationDatePicker";const Vr=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})});Vr.displayName="KendoReactSchedulerViewSelectorList";const Gr=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})},Ur=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)))},qr=e=>e.charAt(0).toUpperCase()+e.slice(1),Zr=["first","second","third","fourth","last"],Yr=["never","daily","weekly","monthly","yearly"],jr=[{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}],Xr=[{day:1,offset:0},{day:2,offset:0},{day:3,offset:0},{day:4,offset:0},{day:5,offset:0}],Qr=[{day:0,offset:0},{day:6,offset:0}],Jr=e=>{switch(e){case"day":return jr;case"weekday":return Xr;case"weekend":return Qr}},ea=e=>g.parseRule({recurrenceRule:e})||{},ta=e=>_(e)&&!(e=>(e=>null==e)(e)||e.trim&&0===e.trim().length)(e.freq)?e.freq:"never",ra=e=>e.dateFormatNames({type:"months",nameType:"wide",standAlone:!0}).map((e,t)=>({text:e,value:t+1})),aa=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))},na=(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]},la=(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)},oa=(e,t)=>e.find(e=>e.value===(t.bySetPosition?t.bySetPosition[0]:t.byWeekDay&&t.byWeekDay[0]?t.byWeekDay[0].offset:1))||e[0],sa=e=>{const t=[1,2,3,4,-1];return Zr.map((r,a)=>({text:e("OffsetPositions"+qr(r)),value:t[a]}))},ca=e=>_(e.count)?"count":_(e.until)?"until":"never",ia=e=>_(e.byWeekDay)?"weekday":_(e.byMonthDay)?"monthday":void 0,ua=(e,t)=>e.find(e=>(t.byMonth?t.byMonth[0]:null)===e.value)||e[0],da=(e,t)=>_(e.byMonthDay)&&e.byMonthDay.length>0?e.byMonthDay[0]:t.getDate(),ma=(e,t)=>a.ZonedDate.fromUTCDate(new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),23,59,59)),t),pa=e=>{const{value:t,data:r,onChange:a,...n}={...ga,...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||ga.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},qr(e.text))))},ga={data:[],value:[]},va=e=>{const t=o.useInternationalization(),r=o.useLocalization(),{timezone:n}=le(),[l,s]=k.useState(1),[c,u]=k.useState(ma(e.start,e.timezone)),d=k.useCallback((e,t)=>{const a=t?e:"scheduler.recurrenceEditor"+e;return r.toLanguageString(a,Kr[a])},[r]),p=k.useMemo(()=>{var t;return ea(null!=(t=e.value)?t:Ea.value)},[e.value]),y=k.useMemo(()=>(e=>Yr.map(t=>({value:t,text:e("Frequencies"+qr(t))})))(d),[d]),f=k.useMemo(()=>ta(p),[p]),D=k.useMemo(()=>la(t,d),[t,d]),C=k.useMemo(()=>na(D,p,e.start),[D,p,e.start]),b=k.useMemo(()=>ra(t),[t]),S=k.useMemo(()=>ua(b,p),[b,p]),w=k.useMemo(()=>sa(d),[d]),I=k.useMemo(()=>oa(w,p),[w,p]),R=k.useMemo(()=>ca(p),[p]),T=k.useMemo(()=>da(p,e.start),[p,e.start]),x=k.useMemo(()=>(e=>_(e.until)?a.toLocalDate(e.until):null)(p),[p.until]),A=k.useMemo(()=>aa(t),[t]),M=k.useMemo(()=>ia(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=ma(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,Kr[ot])),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(Ur,{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(qr(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(qr(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(pa,{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:ha,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:ha,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:ha,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"})]}]})))))},ha=e=>k.createElement("li",{...e},e.children),Ea={value:""};va.displayName="KendoReactSchedulerRepeatEditor";const ya=(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},fa=(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},ka={minute:15},Da=(e,t)=>!(!e||!t||t.getFullYear()!==e.getFullYear()||t.getMonth()!==e.getMonth()||t.getDate()!==e.getDate()),Ca=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=ka}=e,{timezone:v}=le(),h=k.useMemo(()=>t?ya(t,v):null,[t,v]),E=k.useMemo(()=>m?ya(m,v):void 0,[m,v]),y=k.useMemo(()=>p?ya(p,v):void 0,[p,v]),f=Da(h,E)?E:void 0,D=Da(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:fa(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:fa(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 ba(e,t,r,n){var l,o,s,c,i,u;if(!e)return"";const d=e=>n.toLanguageString(e,Kr[e]),m=(e,t)=>{const r=t?e:"scheduler.recurrenceEditor"+e;return n.toLanguageString(r,Kr[r])},p=ea(e);if(!p.freq||"never"===p.freq)return"";const g=aa(r),v=la(r,m),h=na(v,p,t),E=ra(r),y=ua(E,p),f=sa(m),k=oa(f,p),D=da(p,t),C=ia(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 Sa=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,Kr[r])},[b]),[I,R]=k.useState(()=>{const e=ea(null!=t?t:"");return e.freq?e:{freq:"daily",interval:1}}),[T,x]=k.useState(1),A=k.useRef(!1),[M,N]=k.useState(()=>ma(r,l)),[L]=k.useState(r),z=k.useRef(null),_=k.useMemo(()=>ta(I),[I]),F=k.useMemo(()=>aa(C),[C]),O=k.useMemo(()=>la(C,w),[C,w]),W=k.useMemo(()=>na(O,I,L),[O,I,L]),P=k.useMemo(()=>ra(C),[C]),H=k.useMemo(()=>ua(P,I),[P,I]),$=k.useMemo(()=>sa(w),[w]),K=k.useMemo(()=>oa($,I),[$,I]),B=k.useMemo(()=>ca(I),[I]),V=k.useMemo(()=>da(I,L),[I,L]),G=k.useMemo(()=>I.until?a.toLocalDate(I.until):null,[I.until]),U=k.useMemo(()=>ia(I),[I.byWeekDay,I.byMonthDay]),q=!!t,Z=b.toLanguageString(Ze,Kr[Ze]),Y=b.toLanguageString(Ye,Kr[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=ma(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 ba(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(br,!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};Sa.displayName="KendoReactSchedulerRecurrenceDialog";const wa=e=>{const{onConfirm:t,onCancel:r}=e,a=o.useLocalization(),l=a.toLanguageString(sr,Kr[sr]),c=a.toLanguageString(cr,Kr[cr]),i=a.toLanguageString(ir,Kr[ir]),u=a.toLanguageString(ur,Kr[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};wa.displayName="KendoReactRemoveRecurrenceConfirmDialog";const Ia=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=Ma.as,...D}=e,{onChange:C,valueGetter:b}=e,{titleEditor:S=Ma.titleEditor,startEditor:w=Ma.startEditor,endEditor:I=Ma.endEditor,startTimezoneEditor:R=Ma.startTimezoneEditor,endTimezoneEditor:T=Ma.endTimezoneEditor,startLabel:x=Ma.startLabel,endLabel:A=Ma.endLabel,allDayEditor:M=Ma.allDayEditor,allDayLabel:N=Ma.allDayLabel,recurrenceEditor:L,descriptionEditor:z=Ma.descriptionEditor,resourceEditor:_=Ma.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,Kr[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(Sr,Kr[Sr]),[i]),J=k.useMemo(()=>i.toLanguageString(wr,Kr[wr]),[i]),ee=H?J:Q,te=k.useMemo(()=>H?ba(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===Ma.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,Kr[Xe]),"aria-label":i.toLanguageString(Xe,Kr[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:Ra,baseEditor:w,onStartChange:he,isAllDay:W,fieldError:e.errors[h.start],ariaLabel:i.toLanguageString(Qe,Kr[Qe]),timezone:y}),k.createElement(m.Field,{name:h.end,component:A,editorId:"k-scheduler-editor-end",className:"k-scheduler-datetime-label"},i.toLanguageString(Lr,Kr[Lr])),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,Kr[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:Ra,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(Nr,Kr[Nr])),fieldError:e.errors[h.start],ariaLabel:i.toLanguageString(Qe,Kr[Qe]),timeAriaLabel:i.toLanguageString(Ar,Kr[Ar]),timezone:y})),!B&&k.createElement(s.Button,{className:"k-col-span-2",fillMode:"flat",themeColor:"primary",title:i.toLanguageString(Rr,Kr[Rr]),onClick:oe,svgIcon:d.globeIcon},i.toLanguageString(Ir,Kr[Ir])),B&&k.createElement(k.Fragment,null,k.createElement(m.Field,{name:h.startTimezone,component:R,data:c,value:P,ariaLabel:i.toLanguageString(Je,Kr[Je])}),k.createElement(s.Button,{title:i.toLanguageString(Tr,Kr[Tr]),"aria-label":i.toLanguageString(xr,Kr[xr]),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(Lr,Kr[Lr])),fieldError:e.errors[h.end],ariaLabel:i.toLanguageString(et,Kr[et]),timeAriaLabel:i.toLanguageString(Mr,Kr[Mr]),timezone:y})),B&&k.createElement(m.Field,{name:h.endTimezone,component:T,data:c,value:b(h.endTimezone)||y||"",ariaLabel:i.toLanguageString(tt,Kr[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,Kr[at]),"aria-label":i.toLanguageString(at,Kr[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(Sa,{value:H,start:F,timezone:y||"",onSave:de,onCancel:me,onRemoveRecurrence:pe,recurrenceSummaryTemplate:X,recurrenceEditor:L}),Y&&k.createElement(wa,{onConfirm:ge,onCancel:ve}),G&&k.createElement(p.Dialog,{title:i.toLanguageString(rr,Kr[rr]),onClose:ce},i.toLanguageString(ar,Kr[ar]),k.createElement(p.DialogActionsBar,null,k.createElement(s.Button,{onClick:ce},i.toLanguageString(nr,Kr[nr])),k.createElement(s.Button,{themeColor:"primary",onClick:se},i.toLanguageString(lr,Kr[lr])))))});Ia.displayName="KendoReactSchedulerFormEditor";const Ra=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})};Ra.displayName="SchedulerDurationPreservingEditor";const Ta=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}));Ta.displayName="SchedulerFormEditorDefaultElement";const xa=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})};xa.displayName="SwitchFieldAdapter";const Aa=e=>k.createElement(v.Label,{...e,style:{marginBottom:0,...e.style}});Aa.displayName="DefaultLabel";const Ma={as:Ta,titleEditor:h.Input,startEditor:Ca,endEditor:Ca,startTimezoneEditor:Gr,endTimezoneEditor:Gr,startLabel:Aa,endLabel:Aa,allDayEditor:xa,allDayLabel:Aa,recurrenceEditor:va,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})}},Na=e=>{const{onDiscard:t,onCancel:r}=e,a=o.useLocalization(),l=k.useId(),c=a.toLanguageString(fr,Kr[fr]),i=a.toLanguageString(kr,Kr[kr]),u=a.toLanguageString(Dr,Kr[Dr]),d=a.toLanguageString(Cr,Kr[Cr]),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};Na.displayName="KendoReactDiscardChangesDialog";const La=k.forwardRef((e,t)=>{const{onCancel:r,onClose:a,onSubmit:l,onDelete:c,editor:i,dialog:u=za.dialog,validator:g=za.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,Kr[jt]),[E]),b=k.useMemo(()=>E.toLanguageString(Qt,Kr[Qt]),[E]),S=k.useMemo(()=>E.toLanguageString(Ze,Kr[Ze]),[E]),w=k.useMemo(()=>E.toLanguageString(Ye,Kr[Ye]),[E]),I=k.useMemo(()=>E.toLanguageString(Wt,Kr[Wt]),[E]),R=k.useMemo(()=>E.toLanguageString(Xt,Kr[Xt]),[E]),T=k.useMemo(()=>E.toLanguageString(zr,Kr[zr]),[E]),x=k.useMemo(()=>E.toLanguageString(_r,Kr[_r]),[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(Ia,{...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(Na,{onDiscard:W,onCancel:P}))),...v}),document&&document.body):null}),za={dialog:p.Dialog,validator:()=>({})};La.displayName="KendoReactSchedulerForm";const _a=k.createContext({});_a.displayName="SchedulerViewPropsContext";const Fa=k.createContext([]),Oa=()=>k.useContext(Fa);Fa.displayName="SchedulerViewRangesContext";const Wa=k.createContext([[],Z]),Pa=()=>k.useContext(Wa);Wa.displayName="SchedulerViewSlotsContext";const Ha=k.createContext([[],Z]),$a=()=>k.useContext(Ha);Ha.displayName="SchedulerViewItemsContext";const Ka=k.createContext([[],Z]);Ka.displayName="SchedulerViewSelectedSlotsContext";const Ba=k.createContext([[],Z]),Va=()=>k.useContext(Ba);Ba.displayName="SchedulerViewSelectedItemsContext";const Ga=k.createContext([[],Z]);Ga.displayName="SchedulerViewFocusedItemsContext";const Ua=k.createContext([[],Z]),qa=()=>k.useContext(Ua);Ua.displayName="SchedulerViewFocusedSlotsContext";const Za=({children:e,props:t,ranges:r,slots:a,items:n,selectedSlots:l,selectedItems:o,focusedItems:s,focusedSlots:c})=>k.createElement(_a.Provider,{value:t},k.createElement(Fa.Provider,{value:r},k.createElement(Wa.Provider,{value:a},k.createElement(Ha.Provider,{value:n},k.createElement(Ka.Provider,{value:l},k.createElement(Ba.Provider,{value:o},k.createElement(Ga.Provider,{value:s},k.createElement(Ua.Provider,{value:c},e))))))));var Ya=(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))(Ya||{});var ja=(e=>(e.select="SLOTS_SELECT_SELECT",e.reset="SLOTS_SELECT_RESET",e.add="SLOTS_SELECT_ADD",e))(ja||{});const Xa=(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 Qa=(e=>(e.up="SLOT_FOCUS_UP",e.down="SLOT_FOCUS_DOWN",e.left="SLOT_FOCUS_LEFT",e.right="SLOT_FOCUS_RIGHT",e))(Qa||{});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),en=(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),tn=(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),rn=(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 an=(e=>(e.next="ITEMS_FOCUS_NEXT",e.prev="ITEMS_FOCUS_PREV",e))(an||{});const nn=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=rn(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=en(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=tn(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:ja.reset}),p(e,t)},[p,v]),E=k.useCallback((e,t)=>{p({type:Ya.reset},t),v(e)},[p,v]),y=k.useMemo(()=>n.classNames("k-scheduler-layout k-scheduler-layout-flex",e.className),[e.className]);return Xa({element:r,selector:".k-group-cell",attribute:"data-depth-index",explicitDepth:!0}),Xa({element:r,selector:".k-side-cell",attribute:"data-depth-index",explicitDepth:!1}),k.createElement(Za,{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))});nn.displayName="KendoReactSchedulerBaseView";const ln=k.createContext({resource:{},groupIndex:0}),on=e=>{const{nested:t,children:r,rowContentProps:a}=e,n=e.rowContent||un,l=e.childRowContent||n,o=b(e.group,e.resources);return k.createElement("div",{className:"k-scheduler-group k-group-horizontal"},t?sn({resources:o,children:r,nested:t,groupIndex:0,rowContent:n,rowContentProps:a,childRowContent:l}):cn({resources:o,children:r,rowContentProps:a,childRowContent:l}))},sn=e=>{const{resources:t,rowContent:r,nested:a,children:n,groupIndex:l,rowContentProps:o,childRowContent:s}=e;if(l===t.length)return cn({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))),sn({resources:t,children:n,nested:a,rowContent:r,childRowContent:s,groupIndex:l+1}))},cn=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(ln.Provider,{value:{resource:e,groupIndex:s?t:0}},a)))))};on.displayName="KendoReactSchedulerHorizontalResourceIterator";const un=e=>e.children,dn=e=>k.createElement(k.Fragment,null,k.createElement("div",{className:"k-scheduler-cell k-side-cell","data-range-index":e.rangeIndex}),e.children),mn=e=>{const{nested:t,wrapGroup:r,children:a,role:n}=e,l=e.cellContent||fn,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"},vn({resources:o,children:a,cellContent:l,depth:0,groupIndex:0})),k.createElement("div",{className:"k-scheduler-cell k-group-content"},gn({resources:o,children:a,cellContent:l,depth:0,groupIndex:0},!1))):gn({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"},pn({resources:o})),k.createElement("div",{className:"k-scheduler-cell k-group-content"},a)):hn({resources:o,children:a,cellContent:l,groupIndex:0,role:n}))},pn=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})))),gn=(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(ln.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},gn({resources:r,children:a,cellContent:n,groupIndex:c*l+s,depth:o+1},t))))},vn=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"},vn({resources:t,children:r,cellContent:a,groupIndex:o*n+s,depth:l+1})))):null},hn=e=>{const{resources:t,children:r,groupIndex:a,cellContent:n,role:l}=e;return k.createElement("div",{className:"k-scheduler-row",role:l},yn(t),n,En(r,t,a,l))},En=(e,t,r,a)=>{const n=t.length>0;return k.createElement("div",{className:"k-scheduler-cell k-group-content",role:a},k.createElement(ln.Provider,{value:{resource:t[r],groupIndex:n?r:void 0}},e))},yn=e=>e.map((e,t)=>k.createElement("div",{key:t,className:"k-scheduler-cell k-group-cell k-heading-cell","data-depth-index":t}));mn.displayName="KendoReactSchedulerVerticalResourceIterator";const fn=null,kn=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,Kr[Me])),e.children)},Dn=k.forwardRef((e,t)=>{const{as:r=Cn.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!==Cn.as?void 0:l,...a,className:i},c.formatDate(e.date,e.format?e.format:Cn.format))}),Cn={as:k.forwardRef(({as:e,format:t,start:r,end:a,...n},l)=>k.createElement("div",{...n,ref:l})),format:"t"};Dn.displayName="KendoReactSchedulerTimeHeaderCell";const bn=e=>{const{slot:t,children:r}=e;return k.createElement(k.Fragment,null,e.isMaster?k.createElement(Dn,{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)},Sn=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]=Pa();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:wn.isWorkHour,l=null!=(r=e.isWorkDay)?r:wn.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)}),wn={isWorkHour:!0,isWorkDay:!0};Sn.displayName="KendoReactSchedulerSlot";const In=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)})},Rn=new Set;let Tn;const xn=e=>{Rn.add(e),void 0===Tn&&(Tn=window.requestAnimationFrame(()=>{Tn=void 0;const e=Array.from(Rn);Rn.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(In)}))},An=(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(()=>{xn(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 xn(d),()=>(e=>{Rn.delete(e),0===Rn.size&&void 0!==Tn&&(window.cancelAnimationFrame(Tn),Tn=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])},Mn=k.forwardRef((e,t)=>{var r;const{slot:a,_ref:n,...l}=e,o=a||Nn.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),An(c,null!=(r=e.expandable)?r:Nn.expandable,e.style,e.items),k.createElement(o,{...l,_ref:c})}),Nn={slot:Sn,expandable:!1};Mn.displayName="KendoReactSchedulerViewSlot";const Ln=k.createContext([null]);Ln.displayName="SchedulerEditSlotPropsContext";const zn=k.createContext([null]);zn.displayName="SchedulerEditSlotFormItemContext";const _n=({props:e,form:t,children:r})=>k.createElement(Ln.Provider,{value:e},k.createElement(zn.Provider,{value:t},r)),Fn={position:"top",collision:{horizontal:"fit",vertical:"flip"}},On={position:"right",collision:{horizontal:"flip",vertical:"fit"}},Wn=/(auto|scroll|overlay)/,Pn=(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(Wn.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])},Hn={skeleton:"MMMMd"},$n=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})},Kn=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?On:Math.max(1,Math.round((t.end.getTime()-t.start.getTime())/a.MS_PER_DAY))*("horizontal"===n?Math.max(1,r.length):1)<=1?Fn:On,[e,t,r,n])})(),C=k.useRef(null),b=k.useCallback(()=>{null==p||p({value:null,syntheticEvent:void 0})},[p]);Pn(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,Kr[Me]);let T="";if(S&&w){const e=a.ZonedDate.fromLocalDate(S,f),t=a.ZonedDate.fromLocalDate(w,f);T=I?`${g.formatDate(e,Hn)}, ${R}`:`${g.formatDate(e,Hn)}, ${g.formatDate(e,"t")} - ${g.formatDate(t,"t")}`}const x=h.toLanguageString(zr,Kr[zr]),A=h.toLanguageString(Xe,Kr[Xe]),M=h.toLanguageString(Or,Kr[Or]),N=h.toLanguageString(Wr,Kr[Wr]),_=h.toLanguageString(Pr,Kr[Pr]),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:$n,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)))})};Kn.displayName="KendoReactSchedulerQuickCreateForm";const Bn=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}},Vn=(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}},Gn=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=Bn(e.editable),E=ie(),[y]=Pa(),[f]=$a(),[D,C]=k.useContext(Ka),[,b]=qa(),S=o||Un.form,w=l||Un.viewSlot,[I,R]=we(null,s,e.onFormItemChange),T=le(),[x]=Ce(),A="agenda"!==x&&!1!==T.quickCreate,N=e.quickCreateForm||T.quickCreateForm||Kn,[_,F]=we(null,i,u),O=k.useRef(null),W=Vn(),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:ja.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:Qa.left,slot:g},e.syntheticEvent);break;case n.Keys.right:if(!y)return;e.syntheticEvent.preventDefault(),b({type:Qa.right,slot:g},e.syntheticEvent);break;case n.Keys.up:if(!y)return;e.syntheticEvent.preventDefault(),b({type:Qa.up,slot:g},e.syntheticEvent);break;case n.Keys.down:if(!y)return;e.syntheticEvent.preventDefault(),b({type:Qa.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(_n,{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}))}),Un={viewSlot:Mn,form:La};Gn.displayName="KendoReactSchedulerEditSlot";const qn=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,Kr[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});qn.displayName="KendoReactSchedulerSchedulerOccurrenceDialog";const Zn=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,Kr[Ye]),m=u.toLanguageString(Wt,Kr[Wt]),g=c?u.toLanguageString(Ht,Kr[Ht]):u.toLanguageString(Pt,Kr[Pt]),v=c?u.toLanguageString(Gt,Kr[Gt]):u.toLanguageString(Vt,Kr[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});Zn.displayName="KendoReactSchedulerRemoveDialog";const Yn=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]=$a();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=Bn(e.editable),N=e.readonly?{resize:!1,select:M.select}:M,L=o.useInternationalization(),z=o.useLocalization().toLanguageString(Me,Kr[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)))))});Yn.displayName="KendoReactSchedulerItem";const jn=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})}),Xn=(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)},Qn=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=Bn(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]=$a(),[f]=Pa(),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 Xn({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(jn,{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(jn,{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:Yn};Qn.displayName="KendoReactSchedulerViewItem";const el=(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(tl(r)).reduce(rl(t,a,r,s),[]).filter(e=>!W(e.dataItem,r))},tl=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}},rl=(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]:[...al(l,{dateRange:e,timezone:t,fields:r})]],al=(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}):[]},nl=(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?ll(e,n):n;(l||sl(e,c))&&o.forEach(n=>{var l;if(cl(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},ll=(e,t)=>({index:0,resources:t.resources.filter(t=>ol(e,t))}),ol=(e,t)=>t.multiple?(e.dataItem[t.field]||[]).some(e=>t[t.valueField]===e):e.dataItem[t.field]===t[t.valueField],sl=(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]),cl=(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)),il=e=>{const t=Oa(),{timezone:r}=le(),a=me(),n=ie(),l=ge(),[o]=Pa(),s=e.viewItem||ul.viewItem,c=k.useMemo(()=>el([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(()=>nl(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})))},ul={viewItem:Qn,item:Yn};il.displayName="KendoReactSchedulerDrag";const dl=e=>{const t=Oa(),{timezone:r}=le(),a=me(),n=ie(),l=ge(),[o]=Pa(),s=e.viewItem||ml.viewItem,c=k.useMemo(()=>el([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(()=>nl(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:ml.item,resizeHint:!0,vertical:e.vertical,ignoreIsAllDay:e.ignoreIsAllDay})}))},ml={viewItem:Qn,item:Yn};dl.displayName="KendoReactSchedulerResize";const pl=k.createContext([null]);pl.displayName="SchedulerEditItemPropsContext";const gl=k.createContext([null,n.noop,n.noop]);gl.displayName="SchedulerEditItemFormItemContext";const vl=k.createContext([null,n.noop,n.noop]);vl.displayName="SchedulerEditItemDragItemContext";const hl=k.createContext([null,n.noop,n.noop]);hl.displayName="SchedulerEditItemResizeItemContext";const El=k.createContext([null,n.noop,n.noop]);El.displayName="SchedulerEditItemRemoveItemContext";const yl=k.createContext([!1,n.noop,n.noop]);yl.displayName="SchedulerEditItemShowRemoveDialogContext";const fl=k.createContext([!1,n.noop,n.noop]);fl.displayName="SchedulerEditItemShowOccurrenceDialogContext";const kl=({props:e,form:t,drag:r,resize:a,remove:n,showRemoveDialog:l,showOccurrenceDialog:o,children:s})=>k.createElement(pl.Provider,{value:e},k.createElement(gl.Provider,{value:t},k.createElement(vl.Provider,{value:r},k.createElement(hl.Provider,{value:a},k.createElement(El.Provider,{value:n},k.createElement(yl.Provider,{value:l},k.createElement(fl.Provider,{value:o},s)))))));var Dl=(e=>(e.set="FORM_ITEM_SET",e.setMaster="FORM_ITEM_SET_MASTER",e.reset="FORM_ITEM_RESET",e.complete="FORM_ITEM_COMPLETE",e))(Dl||{});var Cl=(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))(Cl||{});var bl=(e=>(e.set="REMOVE_ITEM_SET",e.reset="REMOVE_ITEM_RESET",e.complete="REMOVE_ITEM_COMPLETE",e))(bl||{});var Sl=(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))(Sl||{});var wl=(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))(wl||{});var Il=(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))(Il||{});var Rl=(e=>(e.reset="SERIES_RESET",e.set="SERIES_SET",e.toggle="SERIES_TOGGLE",e))(Rl||{});const Tl=(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)}]},xl={position:"right",collision:{horizontal:"fit",vertical:"fit"}},Al={skeleton:"MMMMd"},Ml="t",Nl=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]),Pn(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(Hr,Kr[Hr]),N=R.toLanguageString($r,Kr[$r]),z=L(l,c.title)||R.toLanguageString(Yt,Kr[Yt]),_=L(l,c.start),F=L(l,c.end),O=!!L(l,c.isAllDay),W=L(l,c.description),P=R.toLanguageString(Me,Kr[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,Al)}, ${P}`:`${I.formatDate(e,Al)} - ${I.formatDate(r,Al)}, ${P}`:n?`${I.formatDate(e,Al)}, ${I.formatDate(e,Ml)} - ${I.formatDate(t,Ml)}`:`${I.formatDate(e,Al)}, ${I.formatDate(e,Ml)} - ${I.formatDate(t,Al)}, ${I.formatDate(t,Ml)}`},[I,_,F,O,P,T]),$=k.useMemo(()=>[{text:R.toLanguageString(Ve,Kr[Ve]),scope:"occurrence"},{text:R.toLanguageString(Ge,Kr[Ge]),scope:"series"}],[R]),K=k.useMemo(()=>[{text:R.toLanguageString(Kt,Kr[Kt]),scope:"occurrence"},{text:R.toLanguageString(Bt,Kr[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))))};Nl.displayName="KendoReactSchedulerEventOverviewPopover";const Ll=e=>{const{onKeep:t,onReset:r,onCancel:a,isRemove:l}=e,c=o.useLocalization(),i=l?vr:dr,u=l?hr:mr,d=l?Er:gr,m=c.toLanguageString(i,Kr[i]),g=c.toLanguageString(u,Kr[u]),v=c.toLanguageString(pr,Kr[pr]),h=c.toLanguageString(d,Kr[d]),E=c.toLanguageString(yr,Kr[yr]),y=k.createElement(p.Dialog,{title:m,onClose:a,width:510},k.createElement("p",null,g),k.createElement(p.DialogActionsBar,{layout:"start"},k.createElement(s.Button,{fillMode:"flat",onClick:a},E),k.createElement("span",{className:"k-spacer"}),k.createElement(s.Button,{onClick:r},h),k.createElement(s.Button,{themeColor:"primary",onClick:t},v)));return n.canUseDOM?D.createPortal(y,document.body):null};Ll.displayName="KendoReactKeepResetCustomEventsDialog";const zl=e=>!0===e||"object"==typeof e&&null!==e&&!0===e.drag,_l=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}={...Fl,...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||Fl.viewItem,Ne=g||Fl.drag,Le=E||Fl.resize,ze=d||Fl.form,_e=S||Fl.occurrenceDialog,Fe=D||Fl.removeDialog,Oe=Bn(e.editable),We=ie(),Pe=le(),[He]=ke(),$e=!1!==Pe.eventOverview,Ke=xl,[Be,Ve]=k.useState(null),Ge=k.useRef(null),Ue=Vn(),[qe,Ze]=Va(),[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]=Tl(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]=Va(),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]=Va(),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]=$a(),[,Dt]=k.useContext(Ga),[,Ct]=qa(),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(()=>({[Rl.set]:tt,[Rl.toggle]:tt,[Rl.reset]:tt,[Ya.select]:Ze,[Ya.add]:Ze,[Ya.remove]:Ze,[Ya.reset]:Ze,[Ya.selectNext]:Ze,[Ya.selectPrev]:Ze,[Dl.set]:nt,[Dl.setMaster]:nt,[Dl.reset]:nt,[Dl.complete]:nt,[bl.set]:pt,[bl.reset]:pt,[bl.complete]:pt,[Cl.close]:ft,[Cl.open]:ft,[Cl.set]:ft,[Cl.toggle]:ft,[Cl.reset]:ft,[Sl.close]:ht,[Sl.open]:ht,[Sl.set]:ht,[Sl.toggle]:ht,[Sl.reset]:ht,[wl.start]:st,[wl.drag]:st,[wl.complete]:st,[wl.completeOccurrence]:st,[wl.completeSeries]:st,[wl.set]:st,[wl.reset]:st,[wl.dragSelected]:st,[Il.start]:ut,[Il.startDrag]:ut,[Il.startDragSelected]:ut,[Il.endDrag]:ut,[Il.endDragSelected]:ut,[Il.complete]:ut,[Il.completeOccurrence]:ut,[Il.completeSeries]:ut,[Il.set]:ut,[Il.reset]:ut,[an.next]:Dt,[an.prev]:Dt,[Qa.left]:Ct,[Qa.right]:Ct,[Qa.up]:Ct,[Qa.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:bl.set,payload:e.value||rt}),ht({type:Sl.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:bl.reset}),ht({type:Sl.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:Dl.set,payload:e.action.dataItem})},[Ye,nt]),Jt=k.useCallback(()=>{Ve(null),nt({type:Dl.set,payload:e.dataItem})},[nt,e.dataItem]),er=k.useCallback(()=>{Ve(null),tt({type:Rl.set,payload:!1}),nt({type:Dl.set,payload:e.dataItem})},[tt,nt,e.dataItem]),tr=k.useCallback(()=>{Ve(null),tt({type:Rl.set,payload:!0}),nt({type:Dl.setMaster,payload:e.dataItem})},[tt,nt,e.dataItem]),rr=k.useCallback(()=>{Ve(null),pt({type:bl.set,payload:e.dataItem}),ht({type:Sl.open})},[pt,ht,e.dataItem]),ar=k.useCallback(()=>{Ve(null),tt({type:Rl.set,payload:!1}),pt({type:bl.set,payload:e.dataItem}),ht({type:Sl.open})},[tt,pt,ht,e.dataItem]),nr=k.useCallback(()=>{Ve(null),tt({type:Rl.set,payload:!0}),pt({type:bl.set,payload:e.dataItem}),ht({type:Sl.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(kl,{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(Ll,{isRemove:Ye.action.type===te.remove,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(Nl,{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}))}),Fl={viewItem:Qn,drag:il,resize:dl,form:La,occurrenceDialog:qn,removeDialog:Zn,onClickAction:(e,t,r)=>[{type:e.syntheticEvent.metaKey||e.syntheticEvent.ctrlKey?!r.selected||r.dragItem||r.resizeItem?Ya.add:Ya.remove:Ya.select}],onDoubleClickAction:(e,t)=>t.editable?[{type:Dl.set,payload:t.dataItem},t.isRecurring&&{type:Cl.open}].filter(Boolean):[],onRemoveClickAction:(e,t)=>t.editable?[{type:bl.set,payload:t.dataItem},t.isRecurring?{type:Cl.open}:{type:Sl.open}]:[],onPressAction:(e,t)=>zl(t.editable)?{type:wl.start,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onDragAction:(e,t)=>zl(t.editable)?{type:e.dragEvent.originalEvent.metaKey||e.dragEvent.originalEvent.ctrlKey?wl.dragSelected:wl.drag,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onReleaseAction:(e,t,r)=>zl(t.editable)&&r.dragItem?t.isRecurring&&!t.isException&&null===r.series?{type:Cl.open}:{type:t.isRecurring?r.series?wl.completeSeries:wl.completeOccurrence:wl.complete,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onResizePressAction:(e,t)=>t.editable?{type:Il.start,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onResizeStartDragAction:(e,t)=>t.editable?{type:e.dragEvent.originalEvent.metaKey||e.dragEvent.originalEvent.ctrlKey?Il.startDragSelected:Il.startDrag,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onResizeEndDragAction:(e,t)=>t.editable?{type:e.dragEvent.originalEvent.metaKey||e.dragEvent.originalEvent.ctrlKey?Il.endDragSelected:Il.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:Cl.open}:{type:t.isRecurring?r.series?Il.completeSeries:Il.completeOccurrence:Il.complete,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onOccurrenceClickAction:(e,t,r)=>r.dragItem?[{type:wl.completeOccurrence},{type:Cl.close}]:r.resizeItem?[{type:Il.completeOccurrence},{type:Cl.close}]:r.formItem?[{type:Rl.set,payload:!1},{type:Dl.set,payload:t.dataItem},{type:Cl.close}]:r.removeItem?[{type:Rl.set,payload:!1},{type:bl.set,payload:t.dataItem},{type:Sl.open},{type:Cl.close}]:[],onSeriesClickAction:(e,t,r)=>r.dragItem?[{type:wl.completeSeries},{type:Cl.close}]:r.resizeItem?[{type:Il.completeSeries},{type:Cl.close}]:r.formItem?[{type:Rl.set,payload:!0},{type:Dl.setMaster,payload:t.dataItem},{type:Cl.close}]:r.removeItem?[{type:Rl.set,payload:!0},{type:bl.set,payload:t.dataItem},{type:Sl.open},{type:Cl.close}]:[],onKeyDownAction:(e,t)=>{switch(e.syntheticEvent.keyCode){case n.Keys.enter:return t.editable&&!t.readonly?[{type:Dl.set,payload:t.dataItem},t.isRecurring&&{type:Cl.open}]:[];case n.Keys.tab:return[{type:e.syntheticEvent.shiftKey?an.prev:an.next,ignoreIsAllDay:t.ignoreIsAllDay},{type:e.syntheticEvent.shiftKey?Ya.selectPrev:Ya.selectNext,ignoreIsAllDay:t.ignoreIsAllDay}];case n.Keys.up:return[!(!t.slots.length||!t.slots[0]._ref.current)&&{type:Qa.up,slot:t.slots[0]._ref}];case n.Keys.right:return[!(!t.slots.length||!t.slots[0]._ref.current)&&{type:Qa.right,slot:t.slots[0]._ref}];case n.Keys.down:return[!(!t.slots.length||!t.slots[t.slots.length-1]._ref.current)&&{type:Qa.down,slot:t.slots[t.slots.length-1]._ref}];case n.Keys.left:return[!(!t.slots.length||!t.slots[0]._ref.current)&&{type:Qa.left,slot:t.slots[0]._ref}];default:return}},onFormSubmitAction:e=>[{type:Dl.complete,payload:e.value}],onRemoveConfirmAction:()=>[{type:bl.complete},{type:Dl.reset},{type:Sl.close},{type:Cl.close}],onCancelAction:()=>[{type:Rl.reset},{type:bl.reset},{type:Dl.reset},{type:wl.reset},{type:Il.reset},{type:Sl.reset},{type:Cl.reset}]};_l.displayName="KendoReactSchedulerEditItem";const Ol=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||Wl.updateInterval,[,d]=k.useState(!1),m=n.useDir(i,!0===o.rtl?"rtl":void 0),[p]=Pa(),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"}}))},Wl={updateInterval:6e4},Pl=(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]},Hl=k.forwardRef((e,t)=>{var r;const{as:a=$l.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:$l.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!==$l.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)))}),$l={as:k.forwardRef(({as:e,format:t,start:r,end:a,...n},l)=>k.createElement("div",{...n,ref:l})),format:"d"};Hl.displayName="KendoReactSchedulerDateHeaderCell";const Kl=(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},Bl=(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},Vl=k.createElement("div",{className:"k-scheduler-cell k-side-cell"}),Gl=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||_l,C=e.editSlot||Gn,[b]=Pl(e.showWorkHours,null!=(t=e.defaultShowWorkHours)?t:Ul.defaultShowWorkHours),S=null!=(r=e.numberOfDays)?r:Ul.numberOfDays,w=null!=(l=e.slotDivisions)?l:Ul.slotDivisions,I=null!=(s=e.slotDuration)?s:Ul.slotDuration,R=null!=(c=e.workWeekStart)?c:Ul.workWeekStart,M=null!=(i=e.workWeekEnd)?i:Ul.workWeekEnd,N=!1!==e.currentTimeMarker&&Ul.currentTimeMarker,L=f.parseDate(null!=(d=null!=(u=e.workDayStart)?u:e.isWorkDayStart)?d:Ul.isWorkDayStart),z=f.parseDate(null!=(p=null!=(m=e.workDayEnd)?m:e.isWorkDayEnd)?p:Ul.isWorkDayEnd),_=f.parseDate(null!=(g=e.startTime)?g:Ul.startTime),F=f.parseDate(null!=(v=e.endTime)?v:Ul.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(()=>Kl(K,{step:a.MS_PER_DAY*S,timezone:E}).map(e=>({...e,isAllDay:!0})),[K.start.getTime(),K.end.getTime(),S]),j=k.useMemo(()=>Kl(K,{step:a.MS_PER_DAY,timezone:E}).map(e=>({...e,isAllDay:!1})),[K.start.getTime(),K.end.getTime(),E]),Q=k.useMemo(()=>Bl(0,{step:a.MS_PER_DAY},{groups:W,ranges:Y}),[K.start.getTime(),K.end.getTime(),E,Y,W]),J=k.useMemo(()=>Bl(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(()=>el(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(()=>nl(te,{timezone:E},{groups:W,ranges:Y}),[ee,E,W,Y]),ne=k.useMemo(()=>nl(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(ln.Consumer,null,({groupIndex:t})=>k.createElement("div",{className:"k-scheduler-row",key:t},j.map((t,r)=>k.createElement(Hl,{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(ln.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(nn,{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(on,{nested:!0,group:h,resources:y,rowContent:dn,childRowContent:dn},oe),k.createElement(on,{group:h,resources:y,rowContent:kn,childRowContent:kn},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(mn,{group:h,resources:y,cellContent:Vl},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(on,{nested:!1,group:h,resources:y,rowContent:bn,rowContentProps:{timeHeaderCell:e.timeHeaderCell,isMaster:r%w===0,isLast:(r+1)%w===0,slot:t}},k.createElement(ln.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(Ol,null)):k.createElement(k.Fragment,null,k.createElement(mn,{nested:!0,group:h,resources:y},k.createElement(ln.Consumer,null,({groupIndex:t})=>k.createElement(k.Fragment,{key:t},k.createElement("div",{className:"k-scheduler-row"},k.createElement(kn,{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(bn,{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(Ol,{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}))))},Ul={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};Gl.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},Gl.displayName="KendoReactSchedulerMultiDayView";const ql=e=>k.createElement(Gl,{...e}),Zl={...Ul,name:"day",title:e=>e.toLanguageString(Oe,Kr[Oe]),numberOfDays:1,slotDuration:60,slotDivisions:2,selectedDateFormat:"{0:M}",selectedShortDateFormat:"{0:m}"};ql.displayName="KendoReactSchedulerDayView";const Yl=Object.freeze({name:"@progress/kendo-react-scheduler",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:1607496606,version:"16.4.0-develop.6",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui"}),jl=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=Bn(e.editable),i=e.readonly?{remove:!1}:c,u=o.useLocalization().toLanguageString(Pe,Kr[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})))});jl.displayName="KendoReactSchedulerTask";const Xl=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||Ql.task;return k.createElement(s,{...n,_ref:l})}),Ql={task:jl};Xl.displayName="KendoReactSchedulerViewTask";const Jl=k.createContext([null]),eo=k.createContext([!1]),to=k.createContext([!1]),ro=e=>k.createElement(Jl.Provider,{value:e.remove},k.createElement(eo.Provider,{value:e.showRemoveDialog},k.createElement(to.Provider,{value:e.showOccurrenceDialog},e.children))),ao=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||no.viewTask,h=c||no.occurrenceDialog,E=l||no.removeDialog,y=Bn(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(ro,{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}))}),no={viewTask:Xl,occurrenceDialog:qn,removeDialog:Zn};ao.displayName="KendoReactSchedulerEditTask";const lo=e=>{const{group:t,timezone:r,resources:l}=le(),s=e.editTask||ao,c=e.editSlot||Gn,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(()=>Kl(E,{step:a.MS_PER_DAY,timezone:r}),[E.start.getTime(),E.end.getTime(),r]),f=k.useMemo(()=>Bl(0,{step:a.MS_PER_DAY},{groups:v,ranges:y}),[E.start.getTime(),E.end.getTime(),r,v,y]),D=k.useMemo(()=>el(g,{dateRange:E,fields:h,timezone:r}),[g,E.start.getTime(),E.end.getTime(),h,r]),C=k.useMemo(()=>nl(D,{timezone:r},{groups:v,ranges:y}),[D,r,v,y]),b=k.useMemo(()=>n.classNames("k-scheduler-agendaview",e.className),[e.className]);return Xa({element:i,selector:".k-scheduler-datecolumn",explicitDepth:!1}),Xa({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(nn,{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(mn,{resources:l,group:t,role:"presentation"},k.createElement(ln.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,Kr[qt])),k.createElement("div",{className:"k-scheduler-cell k-heading-cell k-scheduler-timecolumn",role:"columnheader"},p.toLanguageString(Zt,Kr[Zt])),k.createElement("div",{className:"k-scheduler-cell k-heading-cell k-scheduler-eventcolumn",role:"columnheader"},p.toLanguageString(Yt,Kr[Yt])))))),k.createElement("div",{className:"k-scheduler-body",role:"rowgroup"},k.createElement(mn,{resources:l,group:t,nested:!0,role:"presentation"},k.createElement(ln.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,Kr[Me]):oo(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,Kr[Jt])))))))))},oo=(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)},so={name:"agenda",title:e=>e.toLanguageString(Fe,Kr[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},co={title:r.any};lo.propTypes=co,lo.displayName="KendoReactSchedulerAgendaView";const io=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,Kr[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)});io.displayName="KendoReactSchedulerShowMoreItemsButton";const uo={skeleton:"MMM"},mo={skeleton:"dd"},po=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]);Pn(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,uo),E=u.formatDate(v,mo),f=d.toLanguageString(Jt,Kr[Jt]),D=d.toLanguageString(er,Kr[er]),C=d.toLanguageString(Me,Kr[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))};po.displayName="KendoReactSchedulerMoreEventsPopover";const go={skeleton:"dd"},vo={item:null,phase:"form",series:!1,removeItem:null};function ho(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 vo;default:return e}}const Eo=e=>{const{group:t,timezone:r,resources:l}=le(),{onDataAction:s}=e,c=e.editItem||_l,i=e.editSlot||Gn,[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||yo.itemsPerSlot,w=k.useMemo(()=>Kl(E,{step:7*a.MS_PER_DAY,timezone:r}),[E.start.getTime(),E.end.getTime(),r]),I=k.useMemo(()=>Bl(0,{step:a.MS_PER_DAY},{groups:v,ranges:w}),[E.start.getTime(),E.end.getTime(),v,w]),R=k.useMemo(()=>el(u,{dateRange:E,fields:f,timezone:r}),[u,E.start.getTime(),E.end.getTime(),f,r]),T=k.useMemo(()=>nl(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(ho,vo),L=Bn(e.editable),z=e.form||La,_=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(ln.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(Hl,{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(ln.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,go)),C<r.items.length&&k.createElement(io,{slot:r,hiddenCount:r.items.length-C,onClick:_}))))));return k.createElement(nn,{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(on,{nested:!0,resources:l,group:t},J):k.createElement(mn,{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(ln.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,go)),C<t.items.length&&k.createElement(io,{slot:t,hiddenCount:t.items.length-C,onClick:_})))))))))):"horizontal"===h?k.createElement(on,{resources:l,group:t},ee):k.createElement(mn,{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(po,{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(qn,{dataItem:M.item,onClose:$,onOccurrenceClick:K,onSeriesClick:B}),M.removeItem&&L.remove&&k.createElement(Zn,{dataItem:M.removeItem,isSeries:M.series,onClose:Z,onCancel:Z,onConfirm:G}))},yo={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,Kr[We]),selectedDateFormat:"{0:Y}",selectedShortDateFormat:"{0:y}"},fo={itemsPerSlot:r.number};Eo.propTypes=fo,Eo.displayName="KendoReactSchedulerMonthView";const ko=e=>k.createElement(Gl,{...e,step:7,numberOfDays:7}),Do={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,Kr[ze]),selectedDateFormat:"{0:M} - {1:M}",selectedShortDateFormat:"{0:m} - {1:m}"};ko.displayName="KendoReactSchedulerWeekView";const Co=e=>{const t=ge(),r=Math.round((t.end.getTime()-t.start.getTime())/a.MS_PER_DAY);return k.createElement(Gl,{...e,step:7,numberOfDays:r})},bo={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,Kr[_e]),workWeekStart:a.Day.Monday,workWeekEnd:a.Day.Friday,selectedDateFormat:"{0:M} - {1:M}",selectedShortDateFormat:"{0:m} - {1:m}"};Co.displayName="KendoReactSchedulerWorkWeekView";const So=k.createElement("div",{className:"k-scheduler-cell k-side-cell"}),wo=e=>k.createElement(k.Fragment,null,k.createElement("div",{className:"k-sticky-cell"},So),e.children),Io=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,Kr[Ae]))),e.children)},Ro=e=>{var t;const{group:r,timezone:l,resources:s}=le(),c=k.useRef(null),i=k.useRef(null),u=e.editItem||_l,d=e.editSlot||Gn,m=k.useRef(null),[p]=ke(),g=he(),v=me(),h=ge(),E=ie(),y=o.useInternationalization(),[f]=Pl(e.showWorkHours,null!=(t=e.defaultShowWorkHours)?t:To.defaultShowWorkHours),D=e.slotDivisions||To.slotDivisions,C=e.slotDuration||To.slotDuration,b=e.workWeekStart||To.workWeekStart,S=e.workWeekEnd||To.workWeekEnd,w=y.parseDate(e.workDayStart||e.isWorkDayStart||To.isWorkDayStart),I=y.parseDate(e.workDayEnd||e.isWorkDayEnd||To.isWorkDayEnd),R=y.parseDate(e.startTime||To.startTime),A=y.parseDate(e.endTime||To.endTime),M=k.useMemo(()=>f?w:R,[f,w,R]),N=k.useMemo(()=>f?I:A,[f,I,A]),L=k.useMemo(()=>Kl(h,{step:a.MS_PER_DAY,timezone:l}),[h.start.getTime(),h.end.getTime(),l]),z=k.useMemo(()=>Bl(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(()=>el(p,{dateRange:h,fields:E,timezone:l}),[p,h.start.getTime(),h.end.getTime(),E,l]),O=k.useMemo(()=>nl(_,{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||To.columnWidth)+1),P=k.createElement(ln.Consumer,null,()=>k.createElement(k.Fragment,null,k.createElement("div",{className:"k-scheduler-row"},L.map((t,r)=>k.createElement(Hl,{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(Dn,{key:t.index,as:e.timeHeaderCell,format:"t",date:t.zonedStart,start:t.zonedStart,end:t.zonedEnd}):null))))),H=k.createElement(ln.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]);Xa({element:m,selector:".k-resource-cell",attribute:"data-depth-index",explicitDepth:!0});const G=m.current?m.current.closest(".k-scheduler-layout"):null;return Xn({element:G,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:O&&!O.length}),k.createElement(nn,{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(on,{nested:!0,group:r,resources:s,rowContent:wo},P):k.createElement(mn,{wrapGroup:!0,group:r,resources:s},P)),k.createElement("div",{className:"k-scheduler-body",style:{width:W},ref:i},"horizontal"===g?k.createElement(on,{group:r,resources:s,rowContent:Io},H,k.createElement(ln.Consumer,null,({groupIndex:t})=>e.currentTimeMarker&&$(T(L).start,x(L).end,new Date,new Date,!0)&&k.createElement(Ol,{groupIndex:t,attachArrow:c,vertical:!0}))):k.createElement(mn,{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(Ol,{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}))))},To={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},xo=e=>k.createElement(Ro,{...e}),Ao={...To,name:"timeline",title:e=>e.toLanguageString(Le,Kr[Le]),slotDuration:60,slotDivisions:2,numberOfDays:1,selectedDateFormat:"{0:M}",selectedShortDateFormat:"{0:m}"};xo.displayName="KendoReactSchedulerTimelineView";const Mo=(e,t,r)=>e.filter(e=>{const a=L(e,t.recurrenceId);return null!=a&&a===r&&!L(e,t.recurrenceRule)}),No=(e,t)=>{const r=n.clone(e);return z(r,t.recurrenceId,null),z(r,t.recurrenceRule,null),z(r,t.originalStart,null),r},Lo=new Map;Lo.set(lo,so),Lo.set(ql,Zl),Lo.set(Eo,yo),Lo.set(ko,Do),Lo.set(Co,bo),Lo.set(xo,Ao);const zo=k.forwardRef((e,t)=>{var r,l,i,u;const m=!n.validatePackage(Yl,{component:"Scheduler"}),p=n.getLicenseMessage(Yl),{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||_o.defaultDate,e.date,e.onDateChange),R=k.Children.toArray(e.children||[]).map(e=>{var t;return k.isValidElement(e)?k.cloneElement(e,{...Lo.get(e.type),...null!=(t=e.props)?t:{}}):e}),T=k.cloneElement(k.createElement(ql,null),Lo.get(ql)),[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:_o.data)||_o.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:_o.defaultDate,end:_o.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);Mo(W,S,e).forEach(e=>{r.push(No(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=Mo(W,S,o);e.resetExceptions?s.forEach(e=>r.push(n.clone(e))):s.forEach(e=>t.push(No(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:_o.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,Kr[Ne]),ue=D.toLanguageString(He,Kr[He]),de=D.toLanguageString($e,Kr[$e]),me=D.toLanguageString(zr,Kr[zr]),pe=D.toLanguageString(Fr,Kr[Fr]),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||_o.header,Ee=M.props.footer||e.footer||_o.footer,ye=M.props.form||e.form||La,[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:_o.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(Br,{value:w,onChange:J,level:ve}),k.createElement(s.ToolbarSpacer,null),1===ve&&k.createElement("span",{className:"k-separator"}),k.createElement(Vr,{level:ve})),M&&k.createElement(M.type,{editable:null!=(u=e.editable)?u:_o.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,Kr[_?Ke:Be]))),m&&k.createElement(n.WatermarkOverlay,{message:p}),De&&k.createElement(ye,{dataItem:De,onSubmit:Ie,onCancel:Re,onClose:Te})))}),_o={data:[],height:600,tabIndex:-1,editable:!1,quickCreate:!0,eventOverview:!0,defaultDate:new Date,header:Ie,footer:xe,navigation:Re,viewSelector:Te};zo.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})},zo.displayName="KendoReactScheduler";const Fo=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||Oo.item,v=o.useInternationalization(),[h]=$a(),[E]=Pa(),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 Xn({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(jn,{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(jn,{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}))))}),Oo={item:Yn};Fo.displayName="KendoReactSchedulerProportionalViewItem",e.AgendaView=lo,e.DATA_ACTION=te,e.DRAG_ITEM_ACTION=wl,e.DateHeaderCell=Hl,e.DayView=ql,e.DiscardChangesDialog=Na,e.ITEMS_FOCUS_ACTION=an,e.ITEMS_SELECT_ACTION=Ya,e.KeepResetCustomEventsDialog=Ll,e.MonthView=Eo,e.REMOVE_ITEM_ACTION=bl,e.RESIZE_ITEM_ACTION=Il,e.RemoveRecurrenceConfirmDialog=wa,e.SERIES_ACTION=Rl,e.SHOW_OCCURRENCE_DIALOG_ACTION=Cl,e.SHOW_REMOVE_DIALOG_ACTION=Sl,e.SLOTS_FOCUS_ACTION=Qa,e.SLOTS_SELECT_ACTION=ja,e.Scheduler=zo,e.SchedulerActiveViewContext=De,e.SchedulerDataContext=fe,e.SchedulerDateContext=Ee,e.SchedulerDateRangeContext=pe,e.SchedulerDrag=il,e.SchedulerEditItem=_l,e.SchedulerEditItemDragItemContext=vl,e.SchedulerEditItemFormItemContext=gl,e.SchedulerEditItemPropsContext=pl,e.SchedulerEditItemRemoveItemContext=El,e.SchedulerEditItemResizeItemContext=hl,e.SchedulerEditItemShowOccurrenceDialogContext=fl,e.SchedulerEditItemShowRemoveDialogContext=yl,e.SchedulerEditSlot=Gn,e.SchedulerEditSlotFormItemContext=zn,e.SchedulerEditSlotPropsContext=Ln,e.SchedulerEditTask=ao,e.SchedulerFieldsContext=ce,e.SchedulerFooter=xe,e.SchedulerForm=La,e.SchedulerFormEditor=Ia,e.SchedulerGroupsContext=de,e.SchedulerHeader=Ie,e.SchedulerItem=Yn,e.SchedulerItemContent=jn,e.SchedulerOccurrenceDialog=qn,e.SchedulerOrientationContext=ve,e.SchedulerProportionalViewItem=Fo,e.SchedulerPropsContext=ne,e.SchedulerQuickCreateForm=Kn,e.SchedulerRecurrenceDialog=Sa,e.SchedulerRemoveDialog=Zn,e.SchedulerResize=dl,e.SchedulerSlot=Sn,e.SchedulerTask=jl,e.SchedulerViewItem=Qn,e.SchedulerViewSlot=Mn,e.SchedulerViewTask=Xl,e.SchedulerViewsContext=oe,e.TimeHeaderCell=Dn,e.TimelineView=xo,e.WeekView=ko,e.WorkWeekView=Co,e.agendaViewDefaultProps=so,e.dateHeaderCellDefaultProps=$l,e.dayViewDefaultProps=Zl,e.monthViewDefaultProps=yo,e.schedulerDefaultProps=_o,e.schedulerDragDefaultProps=ul,e.schedulerEditItemDefaultProps=Fl,e.schedulerEditSlotDefaultProps=Un,e.schedulerEditTaskDefaultProps=no,e.schedulerFormDefaultProps=za,e.schedulerFormEditorDefaultProps=Ma,e.schedulerProportionalViewItemDefaultProps=Oo,e.schedulerQuickCreateFormDefaultProps={},e.schedulerResizeDefaultProps=ml,e.schedulerSlotDefaultProps=wn,e.schedulerViewItemDefaultProps=Jn,e.schedulerViewSlotDefaultProps=Nn,e.schedulerViewTaskDefaultProps=Ql,e.timeHeaderCellDefaultProps=Cn,e.timeLineViewDefaultProps=Ao,e.useSchedulerActiveViewContext=Ce,e.useSchedulerDataContext=ke,e.useSchedulerDateContext=ye,e.useSchedulerDateRangeContext=ge,e.useSchedulerEditItemDragItemContext=()=>k.useContext(vl),e.useSchedulerEditItemFormItemContext=()=>k.useContext(gl),e.useSchedulerEditItemPropsContext=()=>k.useContext(pl),e.useSchedulerEditItemRemoveItemContext=()=>k.useContext(El),e.useSchedulerEditItemResizeItemContext=()=>k.useContext(hl),e.useSchedulerEditItemShowOccurrenceDialogContext=()=>k.useContext(fl),e.useSchedulerEditItemShowRemoveDialogContext=()=>k.useContext(yl),e.useSchedulerEditSlotFormItemContext=()=>k.useContext(zn),e.useSchedulerEditSlotPropsContext=()=>k.useContext(Ln),e.useSchedulerFieldsContext=ie,e.useSchedulerGroupsContext=me,e.useSchedulerOrientationContext=he,e.useSchedulerPropsContext=le,e.useSchedulerViewsContext=se,e.weekViewDefaultProps=Do,e.workWeekDefaultProps=bo});
|
|
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.recurrenceCustomEventsDeleteDialogTitle",hr="scheduler.recurrenceCustomEventsDeleteConfirmation",Er="scheduler.recurrenceCustomEventsDelete",yr="scheduler.recurrenceCustomEventsCancel",fr="scheduler.editorDiscardChangesDialogTitle",kr="scheduler.editorDiscardChangesConfirmation",Dr="scheduler.editorDiscardChangesDiscard",Cr="scheduler.editorDiscardChangesCancel",br="scheduler.recurrenceEditorWeeklyRepeatOnDays",Sr="scheduler.editorMakeRecurring",wr="scheduler.editorEditRecurrence",Ir="scheduler.editorTimezoneButton",Rr="scheduler.editorSetTimezoneTitle",Tr="scheduler.editorResetTimezoneTitle",xr="scheduler.editorResetTimezoneAriaLabel",Ar="scheduler.editorStartTimeAriaLabel",Mr="scheduler.editorEndTimeAriaLabel",Nr="scheduler.editorDateConnectorFrom",Lr="scheduler.editorDateConnectorTo",zr="scheduler.editorNewEvent",_r="scheduler.editorEditEvent",Fr="scheduler.toolbarLabel",Or="scheduler.quickCreateSave",Wr="scheduler.quickCreateMoreOptions",Pr="scheduler.quickCreateCancel",Hr="scheduler.overviewPopoverEdit",$r="scheduler.overviewPopoverDelete",Kr={[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]:"Keep or delete custom events?",[hr]:"Some events in this series have been edited separately. Choose whether to keep those custom events, or delete them along with the series?",[Er]:"Delete custom events",[yr]:"Cancel",[fr]:"Discard changes",[kr]:"Are you sure you want to discard the changes?",[Dr]:"Discard changes",[Cr]:"Cancel",[br]:"Repeat on days",[Sr]:"Make recurring",[wr]:"Edit recurrence",[Ir]:"Time zone",[Rr]:"Set Timezone",[Tr]:"Reset Timezone",[xr]:"Reset timezone",[Ar]:"Start time",[Mr]:"End time",[Nr]:"from",[Lr]:"to",[zr]:"New event",[_r]:"Edit event",[Fr]:"Toolbar",[Or]:"Save",[Wr]:"More options",[Pr]:"Cancel",[Hr]:"Edit",[$r]:"Delete"},Br=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})))});Br.displayName="KendoReactSchedulerNavigationDatePicker";const Vr=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})});Vr.displayName="KendoReactSchedulerViewSelectorList";const Gr=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})},Ur=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)))},qr=e=>e.charAt(0).toUpperCase()+e.slice(1),Zr=["first","second","third","fourth","last"],Yr=["never","daily","weekly","monthly","yearly"],jr=[{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}],Xr=[{day:1,offset:0},{day:2,offset:0},{day:3,offset:0},{day:4,offset:0},{day:5,offset:0}],Qr=[{day:0,offset:0},{day:6,offset:0}],Jr=e=>{switch(e){case"day":return jr;case"weekday":return Xr;case"weekend":return Qr}},ea=e=>g.parseRule({recurrenceRule:e})||{},ta=e=>_(e)&&!(e=>(e=>null==e)(e)||e.trim&&0===e.trim().length)(e.freq)?e.freq:"never",ra=e=>e.dateFormatNames({type:"months",nameType:"wide",standAlone:!0}).map((e,t)=>({text:e,value:t+1})),aa=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))},na=(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]},la=(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)},oa=(e,t)=>e.find(e=>e.value===(t.bySetPosition?t.bySetPosition[0]:t.byWeekDay&&t.byWeekDay[0]?t.byWeekDay[0].offset:1))||e[0],sa=e=>{const t=[1,2,3,4,-1];return Zr.map((r,a)=>({text:e("OffsetPositions"+qr(r)),value:t[a]}))},ca=e=>_(e.count)?"count":_(e.until)?"until":"never",ia=e=>_(e.byWeekDay)?"weekday":_(e.byMonthDay)?"monthday":void 0,ua=(e,t)=>e.find(e=>(t.byMonth?t.byMonth[0]:null)===e.value)||e[0],da=(e,t)=>_(e.byMonthDay)&&e.byMonthDay.length>0?e.byMonthDay[0]:t.getDate(),ma=(e,t)=>a.ZonedDate.fromUTCDate(new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),23,59,59)),t),pa=e=>{const{value:t,data:r,onChange:a,...n}={...ga,...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||ga.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},qr(e.text))))},ga={data:[],value:[]},va=e=>{const t=o.useInternationalization(),r=o.useLocalization(),{timezone:n}=le(),[l,s]=k.useState(1),[c,u]=k.useState(ma(e.start,e.timezone)),d=k.useCallback((e,t)=>{const a=t?e:"scheduler.recurrenceEditor"+e;return r.toLanguageString(a,Kr[a])},[r]),p=k.useMemo(()=>{var t;return ea(null!=(t=e.value)?t:Ea.value)},[e.value]),y=k.useMemo(()=>(e=>Yr.map(t=>({value:t,text:e("Frequencies"+qr(t))})))(d),[d]),f=k.useMemo(()=>ta(p),[p]),D=k.useMemo(()=>la(t,d),[t,d]),C=k.useMemo(()=>na(D,p,e.start),[D,p,e.start]),b=k.useMemo(()=>ra(t),[t]),S=k.useMemo(()=>ua(b,p),[b,p]),w=k.useMemo(()=>sa(d),[d]),I=k.useMemo(()=>oa(w,p),[w,p]),R=k.useMemo(()=>ca(p),[p]),T=k.useMemo(()=>da(p,e.start),[p,e.start]),x=k.useMemo(()=>(e=>_(e.until)?a.toLocalDate(e.until):null)(p),[p.until]),A=k.useMemo(()=>aa(t),[t]),M=k.useMemo(()=>ia(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=ma(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,Kr[ot])),k.createElement("div",{className:"k-form-field-wrap"},k.createElement(Ur,{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(qr(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(qr(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(pa,{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:ha,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:ha,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:ha,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"})]}]})))))},ha=e=>k.createElement("li",{...e},e.children),Ea={value:""};va.displayName="KendoReactSchedulerRepeatEditor";const ya=(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},fa=(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},ka={minute:15},Da=(e,t)=>!(!e||!t||t.getFullYear()!==e.getFullYear()||t.getMonth()!==e.getMonth()||t.getDate()!==e.getDate()),Ca=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=ka}=e,{timezone:v}=le(),h=k.useMemo(()=>t?ya(t,v):null,[t,v]),E=k.useMemo(()=>m?ya(m,v):void 0,[m,v]),y=k.useMemo(()=>p?ya(p,v):void 0,[p,v]),f=Da(h,E)?E:void 0,D=Da(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:fa(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:fa(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 ba(e,t,r,n){var l,o,s,c,i,u;if(!e)return"";const d=e=>n.toLanguageString(e,Kr[e]),m=(e,t)=>{const r=t?e:"scheduler.recurrenceEditor"+e;return n.toLanguageString(r,Kr[r])},p=ea(e);if(!p.freq||"never"===p.freq)return"";const g=aa(r),v=la(r,m),h=na(v,p,t),E=ra(r),y=ua(E,p),f=sa(m),k=oa(f,p),D=da(p,t),C=ia(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 Sa=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,Kr[r])},[b]),[I,R]=k.useState(()=>{const e=ea(null!=t?t:"");return e.freq?e:{freq:"daily",interval:1}}),[T,x]=k.useState(1),A=k.useRef(!1),[M,N]=k.useState(()=>ma(r,l)),[L]=k.useState(r),z=k.useRef(null),_=k.useMemo(()=>ta(I),[I]),F=k.useMemo(()=>aa(C),[C]),O=k.useMemo(()=>la(C,w),[C,w]),W=k.useMemo(()=>na(O,I,L),[O,I,L]),P=k.useMemo(()=>ra(C),[C]),H=k.useMemo(()=>ua(P,I),[P,I]),$=k.useMemo(()=>sa(w),[w]),K=k.useMemo(()=>oa($,I),[$,I]),B=k.useMemo(()=>ca(I),[I]),V=k.useMemo(()=>da(I,L),[I,L]),G=k.useMemo(()=>I.until?a.toLocalDate(I.until):null,[I.until]),U=k.useMemo(()=>ia(I),[I.byWeekDay,I.byMonthDay]),q=!!t,Z=b.toLanguageString(Ze,Kr[Ze]),Y=b.toLanguageString(Ye,Kr[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=ma(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 ba(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(br,!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};Sa.displayName="KendoReactSchedulerRecurrenceDialog";const wa=e=>{const{onConfirm:t,onCancel:r}=e,a=o.useLocalization(),l=a.toLanguageString(sr,Kr[sr]),c=a.toLanguageString(cr,Kr[cr]),i=a.toLanguageString(ir,Kr[ir]),u=a.toLanguageString(ur,Kr[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};wa.displayName="KendoReactRemoveRecurrenceConfirmDialog";const Ia=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=Ma.as,...D}=e,{onChange:C,valueGetter:b}=e,{titleEditor:S=Ma.titleEditor,startEditor:w=Ma.startEditor,endEditor:I=Ma.endEditor,startTimezoneEditor:R=Ma.startTimezoneEditor,endTimezoneEditor:T=Ma.endTimezoneEditor,startLabel:x=Ma.startLabel,endLabel:A=Ma.endLabel,allDayEditor:M=Ma.allDayEditor,allDayLabel:N=Ma.allDayLabel,recurrenceEditor:L,descriptionEditor:z=Ma.descriptionEditor,resourceEditor:_=Ma.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,Kr[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(Sr,Kr[Sr]),[i]),J=k.useMemo(()=>i.toLanguageString(wr,Kr[wr]),[i]),ee=H?J:Q,te=k.useMemo(()=>H?ba(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===Ma.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,Kr[Xe]),"aria-label":i.toLanguageString(Xe,Kr[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:Ra,baseEditor:w,onStartChange:he,isAllDay:W,fieldError:e.errors[h.start],ariaLabel:i.toLanguageString(Qe,Kr[Qe]),timezone:y}),k.createElement(m.Field,{name:h.end,component:A,editorId:"k-scheduler-editor-end",className:"k-scheduler-datetime-label"},i.toLanguageString(Lr,Kr[Lr])),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,Kr[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:Ra,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(Nr,Kr[Nr])),fieldError:e.errors[h.start],ariaLabel:i.toLanguageString(Qe,Kr[Qe]),timeAriaLabel:i.toLanguageString(Ar,Kr[Ar]),timezone:y})),!B&&k.createElement(s.Button,{className:"k-col-span-2",fillMode:"flat",themeColor:"primary",title:i.toLanguageString(Rr,Kr[Rr]),onClick:oe,svgIcon:d.globeIcon},i.toLanguageString(Ir,Kr[Ir])),B&&k.createElement(k.Fragment,null,k.createElement(m.Field,{name:h.startTimezone,component:R,data:c,value:P,ariaLabel:i.toLanguageString(Je,Kr[Je])}),k.createElement(s.Button,{title:i.toLanguageString(Tr,Kr[Tr]),"aria-label":i.toLanguageString(xr,Kr[xr]),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(Lr,Kr[Lr])),fieldError:e.errors[h.end],ariaLabel:i.toLanguageString(et,Kr[et]),timeAriaLabel:i.toLanguageString(Mr,Kr[Mr]),timezone:y})),B&&k.createElement(m.Field,{name:h.endTimezone,component:T,data:c,value:b(h.endTimezone)||y||"",ariaLabel:i.toLanguageString(tt,Kr[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,Kr[at]),"aria-label":i.toLanguageString(at,Kr[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(Sa,{value:H,start:F,timezone:y||"",onSave:de,onCancel:me,onRemoveRecurrence:pe,recurrenceSummaryTemplate:X,recurrenceEditor:L}),Y&&k.createElement(wa,{onConfirm:ge,onCancel:ve}),G&&k.createElement(p.Dialog,{title:i.toLanguageString(rr,Kr[rr]),onClose:ce},i.toLanguageString(ar,Kr[ar]),k.createElement(p.DialogActionsBar,null,k.createElement(s.Button,{onClick:ce},i.toLanguageString(nr,Kr[nr])),k.createElement(s.Button,{themeColor:"primary",onClick:se},i.toLanguageString(lr,Kr[lr])))))});Ia.displayName="KendoReactSchedulerFormEditor";const Ra=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})};Ra.displayName="SchedulerDurationPreservingEditor";const Ta=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}));Ta.displayName="SchedulerFormEditorDefaultElement";const xa=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})};xa.displayName="SwitchFieldAdapter";const Aa=e=>k.createElement(v.Label,{...e,style:{marginBottom:0,...e.style}});Aa.displayName="DefaultLabel";const Ma={as:Ta,titleEditor:h.Input,startEditor:Ca,endEditor:Ca,startTimezoneEditor:Gr,endTimezoneEditor:Gr,startLabel:Aa,endLabel:Aa,allDayEditor:xa,allDayLabel:Aa,recurrenceEditor:va,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})}},Na=e=>{const{onDiscard:t,onCancel:r}=e,a=o.useLocalization(),l=k.useId(),c=a.toLanguageString(fr,Kr[fr]),i=a.toLanguageString(kr,Kr[kr]),u=a.toLanguageString(Dr,Kr[Dr]),d=a.toLanguageString(Cr,Kr[Cr]),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};Na.displayName="KendoReactDiscardChangesDialog";const La=k.forwardRef((e,t)=>{const{onCancel:r,onClose:a,onSubmit:l,onDelete:c,editor:i,dialog:u=za.dialog,validator:g=za.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,Kr[jt]),[E]),b=k.useMemo(()=>E.toLanguageString(Qt,Kr[Qt]),[E]),S=k.useMemo(()=>E.toLanguageString(Ze,Kr[Ze]),[E]),w=k.useMemo(()=>E.toLanguageString(Ye,Kr[Ye]),[E]),I=k.useMemo(()=>E.toLanguageString(Wt,Kr[Wt]),[E]),R=k.useMemo(()=>E.toLanguageString(Xt,Kr[Xt]),[E]),T=k.useMemo(()=>E.toLanguageString(zr,Kr[zr]),[E]),x=k.useMemo(()=>E.toLanguageString(_r,Kr[_r]),[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(Ia,{...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(Na,{onDiscard:W,onCancel:P}))),...v}),document&&document.body):null}),za={dialog:p.Dialog,validator:()=>({})};La.displayName="KendoReactSchedulerForm";const _a=k.createContext({});_a.displayName="SchedulerViewPropsContext";const Fa=k.createContext([]),Oa=()=>k.useContext(Fa);Fa.displayName="SchedulerViewRangesContext";const Wa=k.createContext([[],Z]),Pa=()=>k.useContext(Wa);Wa.displayName="SchedulerViewSlotsContext";const Ha=k.createContext([[],Z]),$a=()=>k.useContext(Ha);Ha.displayName="SchedulerViewItemsContext";const Ka=k.createContext([[],Z]);Ka.displayName="SchedulerViewSelectedSlotsContext";const Ba=k.createContext([[],Z]),Va=()=>k.useContext(Ba);Ba.displayName="SchedulerViewSelectedItemsContext";const Ga=k.createContext([[],Z]);Ga.displayName="SchedulerViewFocusedItemsContext";const Ua=k.createContext([[],Z]),qa=()=>k.useContext(Ua);Ua.displayName="SchedulerViewFocusedSlotsContext";const Za=({children:e,props:t,ranges:r,slots:a,items:n,selectedSlots:l,selectedItems:o,focusedItems:s,focusedSlots:c})=>k.createElement(_a.Provider,{value:t},k.createElement(Fa.Provider,{value:r},k.createElement(Wa.Provider,{value:a},k.createElement(Ha.Provider,{value:n},k.createElement(Ka.Provider,{value:l},k.createElement(Ba.Provider,{value:o},k.createElement(Ga.Provider,{value:s},k.createElement(Ua.Provider,{value:c},e))))))));var Ya=(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))(Ya||{});var ja=(e=>(e.select="SLOTS_SELECT_SELECT",e.reset="SLOTS_SELECT_RESET",e.add="SLOTS_SELECT_ADD",e))(ja||{});const Xa=(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 Qa=(e=>(e.up="SLOT_FOCUS_UP",e.down="SLOT_FOCUS_DOWN",e.left="SLOT_FOCUS_LEFT",e.right="SLOT_FOCUS_RIGHT",e))(Qa||{});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),en=(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),tn=(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),rn=(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 an=(e=>(e.next="ITEMS_FOCUS_NEXT",e.prev="ITEMS_FOCUS_PREV",e))(an||{});const nn=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=rn(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=en(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=tn(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:ja.reset}),p(e,t)},[p,v]),E=k.useCallback((e,t)=>{p({type:Ya.reset},t),v(e)},[p,v]),y=k.useMemo(()=>n.classNames("k-scheduler-layout k-scheduler-layout-flex",e.className),[e.className]);return Xa({element:r,selector:".k-group-cell",attribute:"data-depth-index",explicitDepth:!0}),Xa({element:r,selector:".k-side-cell",attribute:"data-depth-index",explicitDepth:!1}),k.createElement(Za,{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))});nn.displayName="KendoReactSchedulerBaseView";const ln=k.createContext({resource:{},groupIndex:0}),on=e=>{const{nested:t,children:r,rowContentProps:a}=e,n=e.rowContent||un,l=e.childRowContent||n,o=b(e.group,e.resources);return k.createElement("div",{className:"k-scheduler-group k-group-horizontal"},t?sn({resources:o,children:r,nested:t,groupIndex:0,rowContent:n,rowContentProps:a,childRowContent:l}):cn({resources:o,children:r,rowContentProps:a,childRowContent:l}))},sn=e=>{const{resources:t,rowContent:r,nested:a,children:n,groupIndex:l,rowContentProps:o,childRowContent:s}=e;if(l===t.length)return cn({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))),sn({resources:t,children:n,nested:a,rowContent:r,childRowContent:s,groupIndex:l+1}))},cn=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(ln.Provider,{value:{resource:e,groupIndex:s?t:0}},a)))))};on.displayName="KendoReactSchedulerHorizontalResourceIterator";const un=e=>e.children,dn=e=>k.createElement(k.Fragment,null,k.createElement("div",{className:"k-scheduler-cell k-side-cell","data-range-index":e.rangeIndex}),e.children),mn=e=>{const{nested:t,wrapGroup:r,children:a,role:n}=e,l=e.cellContent||fn,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"},vn({resources:o,children:a,cellContent:l,depth:0,groupIndex:0})),k.createElement("div",{className:"k-scheduler-cell k-group-content"},gn({resources:o,children:a,cellContent:l,depth:0,groupIndex:0},!1))):gn({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"},pn({resources:o})),k.createElement("div",{className:"k-scheduler-cell k-group-content"},a)):hn({resources:o,children:a,cellContent:l,groupIndex:0,role:n}))},pn=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})))),gn=(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(ln.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},gn({resources:r,children:a,cellContent:n,groupIndex:c*l+s,depth:o+1},t))))},vn=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"},vn({resources:t,children:r,cellContent:a,groupIndex:o*n+s,depth:l+1})))):null},hn=e=>{const{resources:t,children:r,groupIndex:a,cellContent:n,role:l}=e;return k.createElement("div",{className:"k-scheduler-row",role:l},yn(t),n,En(r,t,a,l))},En=(e,t,r,a)=>{const n=t.length>0;return k.createElement("div",{className:"k-scheduler-cell k-group-content",role:a},k.createElement(ln.Provider,{value:{resource:t[r],groupIndex:n?r:void 0}},e))},yn=e=>e.map((e,t)=>k.createElement("div",{key:t,className:"k-scheduler-cell k-group-cell k-heading-cell","data-depth-index":t}));mn.displayName="KendoReactSchedulerVerticalResourceIterator";const fn=null,kn=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,Kr[Me])),e.children)},Dn=k.forwardRef((e,t)=>{const{as:r=Cn.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!==Cn.as?void 0:l,...a,className:i},c.formatDate(e.date,e.format?e.format:Cn.format))}),Cn={as:k.forwardRef(({as:e,format:t,start:r,end:a,...n},l)=>k.createElement("div",{...n,ref:l})),format:"t"};Dn.displayName="KendoReactSchedulerTimeHeaderCell";const bn=e=>{const{slot:t,children:r}=e;return k.createElement(k.Fragment,null,e.isMaster?k.createElement(Dn,{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)},Sn=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]=Pa();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:wn.isWorkHour,l=null!=(r=e.isWorkDay)?r:wn.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)}),wn={isWorkHour:!0,isWorkDay:!0};Sn.displayName="KendoReactSchedulerSlot";const In=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)})},Rn=new Set;let Tn;const xn=e=>{Rn.add(e),void 0===Tn&&(Tn=window.requestAnimationFrame(()=>{Tn=void 0;const e=Array.from(Rn);Rn.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(In)}))},An=(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(()=>{xn(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 xn(d),()=>(e=>{Rn.delete(e),0===Rn.size&&void 0!==Tn&&(window.cancelAnimationFrame(Tn),Tn=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])},Mn=k.forwardRef((e,t)=>{var r;const{slot:a,_ref:n,...l}=e,o=a||Nn.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),An(c,null!=(r=e.expandable)?r:Nn.expandable,e.style,e.items),k.createElement(o,{...l,_ref:c})}),Nn={slot:Sn,expandable:!1};Mn.displayName="KendoReactSchedulerViewSlot";const Ln=k.createContext([null]);Ln.displayName="SchedulerEditSlotPropsContext";const zn=k.createContext([null]);zn.displayName="SchedulerEditSlotFormItemContext";const _n=({props:e,form:t,children:r})=>k.createElement(Ln.Provider,{value:e},k.createElement(zn.Provider,{value:t},r)),Fn={position:"top",collision:{horizontal:"fit",vertical:"flip"}},On={position:"right",collision:{horizontal:"flip",vertical:"fit"}},Wn=/(auto|scroll|overlay)/,Pn=(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(Wn.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])},Hn={skeleton:"MMMMd"},$n=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})},Kn=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?On:Math.max(1,Math.round((t.end.getTime()-t.start.getTime())/a.MS_PER_DAY))*("horizontal"===n?Math.max(1,r.length):1)<=1?Fn:On,[e,t,r,n])})(),C=k.useRef(null),b=k.useCallback(()=>{null==p||p({value:null,syntheticEvent:void 0})},[p]);Pn(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,Kr[Me]);let T="";if(S&&w){const e=a.ZonedDate.fromLocalDate(S,f),t=a.ZonedDate.fromLocalDate(w,f);T=I?`${g.formatDate(e,Hn)}, ${R}`:`${g.formatDate(e,Hn)}, ${g.formatDate(e,"t")} - ${g.formatDate(t,"t")}`}const x=h.toLanguageString(zr,Kr[zr]),A=h.toLanguageString(Xe,Kr[Xe]),M=h.toLanguageString(Or,Kr[Or]),N=h.toLanguageString(Wr,Kr[Wr]),_=h.toLanguageString(Pr,Kr[Pr]),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:$n,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)))})};Kn.displayName="KendoReactSchedulerQuickCreateForm";const Bn=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}},Vn=(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}},Gn=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=Bn(e.editable),E=ie(),[y]=Pa(),[f]=$a(),[D,C]=k.useContext(Ka),[,b]=qa(),S=o||Un.form,w=l||Un.viewSlot,[I,R]=we(null,s,e.onFormItemChange),T=le(),[x]=Ce(),A="agenda"!==x&&!1!==T.quickCreate,N=e.quickCreateForm||T.quickCreateForm||Kn,[_,F]=we(null,i,u),O=k.useRef(null),W=Vn(),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:ja.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:Qa.left,slot:g},e.syntheticEvent);break;case n.Keys.right:if(!y)return;e.syntheticEvent.preventDefault(),b({type:Qa.right,slot:g},e.syntheticEvent);break;case n.Keys.up:if(!y)return;e.syntheticEvent.preventDefault(),b({type:Qa.up,slot:g},e.syntheticEvent);break;case n.Keys.down:if(!y)return;e.syntheticEvent.preventDefault(),b({type:Qa.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(_n,{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}))}),Un={viewSlot:Mn,form:La};Gn.displayName="KendoReactSchedulerEditSlot";const qn=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,Kr[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});qn.displayName="KendoReactSchedulerSchedulerOccurrenceDialog";const Zn=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,Kr[Ye]),m=u.toLanguageString(Wt,Kr[Wt]),g=c?u.toLanguageString(Ht,Kr[Ht]):u.toLanguageString(Pt,Kr[Pt]),v=c?u.toLanguageString(Gt,Kr[Gt]):u.toLanguageString(Vt,Kr[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});Zn.displayName="KendoReactSchedulerRemoveDialog";const Yn=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]=$a();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=Bn(e.editable),N=e.readonly?{resize:!1,select:M.select}:M,L=o.useInternationalization(),z=o.useLocalization().toLanguageString(Me,Kr[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)))))});Yn.displayName="KendoReactSchedulerItem";const jn=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})}),Xn=(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)},Qn=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=Bn(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]=$a(),[f]=Pa(),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 Xn({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(jn,{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(jn,{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:Yn};Qn.displayName="KendoReactSchedulerViewItem";const el=(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(tl(r)).reduce(rl(t,a,r,s),[]).filter(e=>!W(e.dataItem,r))},tl=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}},rl=(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]:[...al(l,{dateRange:e,timezone:t,fields:r})]],al=(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}):[]},nl=(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?ll(e,n):n;(l||sl(e,c))&&o.forEach(n=>{var l;if(cl(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},ll=(e,t)=>({index:0,resources:t.resources.filter(t=>ol(e,t))}),ol=(e,t)=>t.multiple?(e.dataItem[t.field]||[]).some(e=>t[t.valueField]===e):e.dataItem[t.field]===t[t.valueField],sl=(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]),cl=(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)),il=e=>{const t=Oa(),{timezone:r}=le(),a=me(),n=ie(),l=ge(),[o]=Pa(),s=e.viewItem||ul.viewItem,c=k.useMemo(()=>el([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(()=>nl(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})))},ul={viewItem:Qn,item:Yn};il.displayName="KendoReactSchedulerDrag";const dl=e=>{const t=Oa(),{timezone:r}=le(),a=me(),n=ie(),l=ge(),[o]=Pa(),s=e.viewItem||ml.viewItem,c=k.useMemo(()=>el([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(()=>nl(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:ml.item,resizeHint:!0,vertical:e.vertical,ignoreIsAllDay:e.ignoreIsAllDay})}))},ml={viewItem:Qn,item:Yn};dl.displayName="KendoReactSchedulerResize";const pl=k.createContext([null]);pl.displayName="SchedulerEditItemPropsContext";const gl=k.createContext([null,n.noop,n.noop]);gl.displayName="SchedulerEditItemFormItemContext";const vl=k.createContext([null,n.noop,n.noop]);vl.displayName="SchedulerEditItemDragItemContext";const hl=k.createContext([null,n.noop,n.noop]);hl.displayName="SchedulerEditItemResizeItemContext";const El=k.createContext([null,n.noop,n.noop]);El.displayName="SchedulerEditItemRemoveItemContext";const yl=k.createContext([!1,n.noop,n.noop]);yl.displayName="SchedulerEditItemShowRemoveDialogContext";const fl=k.createContext([!1,n.noop,n.noop]);fl.displayName="SchedulerEditItemShowOccurrenceDialogContext";const kl=({props:e,form:t,drag:r,resize:a,remove:n,showRemoveDialog:l,showOccurrenceDialog:o,children:s})=>k.createElement(pl.Provider,{value:e},k.createElement(gl.Provider,{value:t},k.createElement(vl.Provider,{value:r},k.createElement(hl.Provider,{value:a},k.createElement(El.Provider,{value:n},k.createElement(yl.Provider,{value:l},k.createElement(fl.Provider,{value:o},s)))))));var Dl=(e=>(e.set="FORM_ITEM_SET",e.setMaster="FORM_ITEM_SET_MASTER",e.reset="FORM_ITEM_RESET",e.complete="FORM_ITEM_COMPLETE",e))(Dl||{});var Cl=(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))(Cl||{});var bl=(e=>(e.set="REMOVE_ITEM_SET",e.reset="REMOVE_ITEM_RESET",e.complete="REMOVE_ITEM_COMPLETE",e))(bl||{});var Sl=(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))(Sl||{});var wl=(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))(wl||{});var Il=(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))(Il||{});var Rl=(e=>(e.reset="SERIES_RESET",e.set="SERIES_SET",e.toggle="SERIES_TOGGLE",e))(Rl||{});const Tl=(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)}]},xl={position:"right",collision:{horizontal:"fit",vertical:"fit"}},Al={skeleton:"MMMMd"},Ml="t",Nl=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]),Pn(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(Hr,Kr[Hr]),N=R.toLanguageString($r,Kr[$r]),z=L(l,c.title)||R.toLanguageString(Yt,Kr[Yt]),_=L(l,c.start),F=L(l,c.end),O=!!L(l,c.isAllDay),W=L(l,c.description),P=R.toLanguageString(Me,Kr[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,Al)}, ${P}`:`${I.formatDate(e,Al)} - ${I.formatDate(r,Al)}, ${P}`:n?`${I.formatDate(e,Al)}, ${I.formatDate(e,Ml)} - ${I.formatDate(t,Ml)}`:`${I.formatDate(e,Al)}, ${I.formatDate(e,Ml)} - ${I.formatDate(t,Al)}, ${I.formatDate(t,Ml)}`},[I,_,F,O,P,T]),$=k.useMemo(()=>[{text:R.toLanguageString(Ve,Kr[Ve]),scope:"occurrence"},{text:R.toLanguageString(Ge,Kr[Ge]),scope:"series"}],[R]),K=k.useMemo(()=>[{text:R.toLanguageString(Kt,Kr[Kt]),scope:"occurrence"},{text:R.toLanguageString(Bt,Kr[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))))};Nl.displayName="KendoReactSchedulerEventOverviewPopover";const Ll=e=>{const{onKeep:t,onReset:r,onCancel:a,isRemove:l}=e,c=o.useLocalization(),i=l?vr:dr,u=l?hr:mr,d=l?Er:gr,m=c.toLanguageString(i,Kr[i]),g=c.toLanguageString(u,Kr[u]),v=c.toLanguageString(pr,Kr[pr]),h=c.toLanguageString(d,Kr[d]),E=c.toLanguageString(yr,Kr[yr]),y=k.createElement(p.Dialog,{title:m,onClose:a,width:510},k.createElement("p",null,g),k.createElement(p.DialogActionsBar,{layout:"start"},k.createElement(s.Button,{fillMode:"flat",onClick:a},E),k.createElement("span",{className:"k-spacer"}),k.createElement(s.Button,{onClick:r},h),k.createElement(s.Button,{themeColor:"primary",onClick:t},v)));return n.canUseDOM?D.createPortal(y,document.body):null};Ll.displayName="KendoReactKeepResetCustomEventsDialog";const zl=e=>!0===e||"object"==typeof e&&null!==e&&!0===e.drag,_l=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}={...Fl,...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||Fl.viewItem,Ne=g||Fl.drag,Le=E||Fl.resize,ze=d||Fl.form,_e=S||Fl.occurrenceDialog,Fe=D||Fl.removeDialog,Oe=Bn(e.editable),We=ie(),Pe=le(),[He]=ke(),$e=!1!==Pe.eventOverview,Ke=xl,[Be,Ve]=k.useState(null),Ge=k.useRef(null),Ue=Vn(),[qe,Ze]=Va(),[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]=Tl(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]=Va(),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]=Va(),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]=$a(),[,Dt]=k.useContext(Ga),[,Ct]=qa(),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(()=>({[Rl.set]:tt,[Rl.toggle]:tt,[Rl.reset]:tt,[Ya.select]:Ze,[Ya.add]:Ze,[Ya.remove]:Ze,[Ya.reset]:Ze,[Ya.selectNext]:Ze,[Ya.selectPrev]:Ze,[Dl.set]:nt,[Dl.setMaster]:nt,[Dl.reset]:nt,[Dl.complete]:nt,[bl.set]:pt,[bl.reset]:pt,[bl.complete]:pt,[Cl.close]:ft,[Cl.open]:ft,[Cl.set]:ft,[Cl.toggle]:ft,[Cl.reset]:ft,[Sl.close]:ht,[Sl.open]:ht,[Sl.set]:ht,[Sl.toggle]:ht,[Sl.reset]:ht,[wl.start]:st,[wl.drag]:st,[wl.complete]:st,[wl.completeOccurrence]:st,[wl.completeSeries]:st,[wl.set]:st,[wl.reset]:st,[wl.dragSelected]:st,[Il.start]:ut,[Il.startDrag]:ut,[Il.startDragSelected]:ut,[Il.endDrag]:ut,[Il.endDragSelected]:ut,[Il.complete]:ut,[Il.completeOccurrence]:ut,[Il.completeSeries]:ut,[Il.set]:ut,[Il.reset]:ut,[an.next]:Dt,[an.prev]:Dt,[Qa.left]:Ct,[Qa.right]:Ct,[Qa.up]:Ct,[Qa.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:bl.set,payload:e.value||rt}),ht({type:Sl.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:bl.reset}),ht({type:Sl.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:Dl.set,payload:e.action.dataItem})},[Ye,nt]),Jt=k.useCallback(()=>{Ve(null),nt({type:Dl.set,payload:e.dataItem})},[nt,e.dataItem]),er=k.useCallback(()=>{Ve(null),tt({type:Rl.set,payload:!1}),nt({type:Dl.set,payload:e.dataItem})},[tt,nt,e.dataItem]),tr=k.useCallback(()=>{Ve(null),tt({type:Rl.set,payload:!0}),nt({type:Dl.setMaster,payload:e.dataItem})},[tt,nt,e.dataItem]),rr=k.useCallback(()=>{Ve(null),pt({type:bl.set,payload:e.dataItem}),ht({type:Sl.open})},[pt,ht,e.dataItem]),ar=k.useCallback(()=>{Ve(null),tt({type:Rl.set,payload:!1}),pt({type:bl.set,payload:e.dataItem}),ht({type:Sl.open})},[tt,pt,ht,e.dataItem]),nr=k.useCallback(()=>{Ve(null),tt({type:Rl.set,payload:!0}),pt({type:bl.set,payload:e.dataItem}),ht({type:Sl.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(kl,{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(Ll,{isRemove:Ye.action.type===te.remove,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(Nl,{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}))}),Fl={viewItem:Qn,drag:il,resize:dl,form:La,occurrenceDialog:qn,removeDialog:Zn,onClickAction:(e,t,r)=>[{type:e.syntheticEvent.metaKey||e.syntheticEvent.ctrlKey?!r.selected||r.dragItem||r.resizeItem?Ya.add:Ya.remove:Ya.select}],onDoubleClickAction:(e,t)=>t.editable?[{type:Dl.set,payload:t.dataItem},t.isRecurring&&{type:Cl.open}].filter(Boolean):[],onRemoveClickAction:(e,t)=>t.editable?[{type:bl.set,payload:t.dataItem},t.isRecurring?{type:Cl.open}:{type:Sl.open}]:[],onPressAction:(e,t)=>zl(t.editable)?{type:wl.start,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onDragAction:(e,t)=>zl(t.editable)?{type:e.dragEvent.originalEvent.metaKey||e.dragEvent.originalEvent.ctrlKey?wl.dragSelected:wl.drag,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onReleaseAction:(e,t,r)=>zl(t.editable)&&r.dragItem?t.isRecurring&&!t.isException&&null===r.series?{type:Cl.open}:{type:t.isRecurring?r.series?wl.completeSeries:wl.completeOccurrence:wl.complete,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onResizePressAction:(e,t)=>t.editable?{type:Il.start,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onResizeStartDragAction:(e,t)=>t.editable?{type:e.dragEvent.originalEvent.metaKey||e.dragEvent.originalEvent.ctrlKey?Il.startDragSelected:Il.startDrag,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onResizeEndDragAction:(e,t)=>t.editable?{type:e.dragEvent.originalEvent.metaKey||e.dragEvent.originalEvent.ctrlKey?Il.endDragSelected:Il.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:Cl.open}:{type:t.isRecurring?r.series?Il.completeSeries:Il.completeOccurrence:Il.complete,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onOccurrenceClickAction:(e,t,r)=>r.dragItem?[{type:wl.completeOccurrence},{type:Cl.close}]:r.resizeItem?[{type:Il.completeOccurrence},{type:Cl.close}]:r.formItem?[{type:Rl.set,payload:!1},{type:Dl.set,payload:t.dataItem},{type:Cl.close}]:r.removeItem?[{type:Rl.set,payload:!1},{type:bl.set,payload:t.dataItem},{type:Sl.open},{type:Cl.close}]:[],onSeriesClickAction:(e,t,r)=>r.dragItem?[{type:wl.completeSeries},{type:Cl.close}]:r.resizeItem?[{type:Il.completeSeries},{type:Cl.close}]:r.formItem?[{type:Rl.set,payload:!0},{type:Dl.setMaster,payload:t.dataItem},{type:Cl.close}]:r.removeItem?[{type:Rl.set,payload:!0},{type:bl.set,payload:t.dataItem},{type:Sl.open},{type:Cl.close}]:[],onKeyDownAction:(e,t)=>{switch(e.syntheticEvent.keyCode){case n.Keys.enter:return t.editable&&!t.readonly?[{type:Dl.set,payload:t.dataItem},t.isRecurring&&{type:Cl.open}]:[];case n.Keys.tab:return[{type:e.syntheticEvent.shiftKey?an.prev:an.next,ignoreIsAllDay:t.ignoreIsAllDay},{type:e.syntheticEvent.shiftKey?Ya.selectPrev:Ya.selectNext,ignoreIsAllDay:t.ignoreIsAllDay}];case n.Keys.up:return[!(!t.slots.length||!t.slots[0]._ref.current)&&{type:Qa.up,slot:t.slots[0]._ref}];case n.Keys.right:return[!(!t.slots.length||!t.slots[0]._ref.current)&&{type:Qa.right,slot:t.slots[0]._ref}];case n.Keys.down:return[!(!t.slots.length||!t.slots[t.slots.length-1]._ref.current)&&{type:Qa.down,slot:t.slots[t.slots.length-1]._ref}];case n.Keys.left:return[!(!t.slots.length||!t.slots[0]._ref.current)&&{type:Qa.left,slot:t.slots[0]._ref}];default:return}},onFormSubmitAction:e=>[{type:Dl.complete,payload:e.value}],onRemoveConfirmAction:()=>[{type:bl.complete},{type:Dl.reset},{type:Sl.close},{type:Cl.close}],onCancelAction:()=>[{type:Rl.reset},{type:bl.reset},{type:Dl.reset},{type:wl.reset},{type:Il.reset},{type:Sl.reset},{type:Cl.reset}]};_l.displayName="KendoReactSchedulerEditItem";const Ol=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||Wl.updateInterval,[,d]=k.useState(!1),m=n.useDir(i,!0===o.rtl?"rtl":void 0),[p]=Pa(),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"}}))},Wl={updateInterval:6e4},Pl=(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]},Hl=k.forwardRef((e,t)=>{var r;const{as:a=$l.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:$l.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!==$l.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)))}),$l={as:k.forwardRef(({as:e,format:t,start:r,end:a,...n},l)=>k.createElement("div",{...n,ref:l})),format:"d"};Hl.displayName="KendoReactSchedulerDateHeaderCell";const Kl=(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},Bl=(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},Vl=k.createElement("div",{className:"k-scheduler-cell k-side-cell"}),Gl=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||_l,C=e.editSlot||Gn,[b]=Pl(e.showWorkHours,null!=(t=e.defaultShowWorkHours)?t:Ul.defaultShowWorkHours),S=null!=(r=e.numberOfDays)?r:Ul.numberOfDays,w=null!=(l=e.slotDivisions)?l:Ul.slotDivisions,I=null!=(s=e.slotDuration)?s:Ul.slotDuration,R=null!=(c=e.workWeekStart)?c:Ul.workWeekStart,M=null!=(i=e.workWeekEnd)?i:Ul.workWeekEnd,N=!1!==e.currentTimeMarker&&Ul.currentTimeMarker,L=f.parseDate(null!=(d=null!=(u=e.workDayStart)?u:e.isWorkDayStart)?d:Ul.isWorkDayStart),z=f.parseDate(null!=(p=null!=(m=e.workDayEnd)?m:e.isWorkDayEnd)?p:Ul.isWorkDayEnd),_=f.parseDate(null!=(g=e.startTime)?g:Ul.startTime),F=f.parseDate(null!=(v=e.endTime)?v:Ul.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(()=>Kl(K,{step:a.MS_PER_DAY*S,timezone:E}).map(e=>({...e,isAllDay:!0})),[K.start.getTime(),K.end.getTime(),S]),j=k.useMemo(()=>Kl(K,{step:a.MS_PER_DAY,timezone:E}).map(e=>({...e,isAllDay:!1})),[K.start.getTime(),K.end.getTime(),E]),Q=k.useMemo(()=>Bl(0,{step:a.MS_PER_DAY},{groups:W,ranges:Y}),[K.start.getTime(),K.end.getTime(),E,Y,W]),J=k.useMemo(()=>Bl(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(()=>el(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(()=>nl(te,{timezone:E},{groups:W,ranges:Y}),[ee,E,W,Y]),ne=k.useMemo(()=>nl(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(ln.Consumer,null,({groupIndex:t})=>k.createElement("div",{className:"k-scheduler-row",key:t},j.map((t,r)=>k.createElement(Hl,{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(ln.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(nn,{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(on,{nested:!0,group:h,resources:y,rowContent:dn,childRowContent:dn},oe),k.createElement(on,{group:h,resources:y,rowContent:kn,childRowContent:kn},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(mn,{group:h,resources:y,cellContent:Vl},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(on,{nested:!1,group:h,resources:y,rowContent:bn,rowContentProps:{timeHeaderCell:e.timeHeaderCell,isMaster:r%w===0,isLast:(r+1)%w===0,slot:t}},k.createElement(ln.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(Ol,null)):k.createElement(k.Fragment,null,k.createElement(mn,{nested:!0,group:h,resources:y},k.createElement(ln.Consumer,null,({groupIndex:t})=>k.createElement(k.Fragment,{key:t},k.createElement("div",{className:"k-scheduler-row"},k.createElement(kn,{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(bn,{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(Ol,{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}))))},Ul={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};Gl.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},Gl.displayName="KendoReactSchedulerMultiDayView";const ql=e=>k.createElement(Gl,{...e}),Zl={...Ul,name:"day",title:e=>e.toLanguageString(Oe,Kr[Oe]),numberOfDays:1,slotDuration:60,slotDivisions:2,selectedDateFormat:"{0:M}",selectedShortDateFormat:"{0:m}"};ql.displayName="KendoReactSchedulerDayView";const Yl=Object.freeze({name:"@progress/kendo-react-scheduler",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:1607496606,version:"16.4.0-develop.7",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui"}),jl=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=Bn(e.editable),i=e.readonly?{remove:!1}:c,u=o.useLocalization().toLanguageString(Pe,Kr[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})))});jl.displayName="KendoReactSchedulerTask";const Xl=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||Ql.task;return k.createElement(s,{...n,_ref:l})}),Ql={task:jl};Xl.displayName="KendoReactSchedulerViewTask";const Jl=k.createContext([null]),eo=k.createContext([!1]),to=k.createContext([!1]),ro=e=>k.createElement(Jl.Provider,{value:e.remove},k.createElement(eo.Provider,{value:e.showRemoveDialog},k.createElement(to.Provider,{value:e.showOccurrenceDialog},e.children))),ao=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||no.viewTask,h=c||no.occurrenceDialog,E=l||no.removeDialog,y=Bn(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(ro,{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}))}),no={viewTask:Xl,occurrenceDialog:qn,removeDialog:Zn};ao.displayName="KendoReactSchedulerEditTask";const lo=e=>{const{group:t,timezone:r,resources:l}=le(),s=e.editTask||ao,c=e.editSlot||Gn,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(()=>Kl(E,{step:a.MS_PER_DAY,timezone:r}),[E.start.getTime(),E.end.getTime(),r]),f=k.useMemo(()=>Bl(0,{step:a.MS_PER_DAY},{groups:v,ranges:y}),[E.start.getTime(),E.end.getTime(),r,v,y]),D=k.useMemo(()=>el(g,{dateRange:E,fields:h,timezone:r}),[g,E.start.getTime(),E.end.getTime(),h,r]),C=k.useMemo(()=>nl(D,{timezone:r},{groups:v,ranges:y}),[D,r,v,y]),b=k.useMemo(()=>n.classNames("k-scheduler-agendaview",e.className),[e.className]);return Xa({element:i,selector:".k-scheduler-datecolumn",explicitDepth:!1}),Xa({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(nn,{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(mn,{resources:l,group:t,role:"presentation"},k.createElement(ln.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,Kr[qt])),k.createElement("div",{className:"k-scheduler-cell k-heading-cell k-scheduler-timecolumn",role:"columnheader"},p.toLanguageString(Zt,Kr[Zt])),k.createElement("div",{className:"k-scheduler-cell k-heading-cell k-scheduler-eventcolumn",role:"columnheader"},p.toLanguageString(Yt,Kr[Yt])))))),k.createElement("div",{className:"k-scheduler-body",role:"rowgroup"},k.createElement(mn,{resources:l,group:t,nested:!0,role:"presentation"},k.createElement(ln.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,Kr[Me]):oo(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,Kr[Jt])))))))))},oo=(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)},so={name:"agenda",title:e=>e.toLanguageString(Fe,Kr[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},co={title:r.any};lo.propTypes=co,lo.displayName="KendoReactSchedulerAgendaView";const io=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,Kr[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)});io.displayName="KendoReactSchedulerShowMoreItemsButton";const uo={skeleton:"MMM"},mo={skeleton:"dd"},po=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]);Pn(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,uo),E=u.formatDate(v,mo),f=d.toLanguageString(Jt,Kr[Jt]),D=d.toLanguageString(er,Kr[er]),C=d.toLanguageString(Me,Kr[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))};po.displayName="KendoReactSchedulerMoreEventsPopover";const go={skeleton:"dd"},vo={item:null,phase:"form",series:!1,removeItem:null};function ho(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 vo;default:return e}}const Eo=e=>{const{group:t,timezone:r,resources:l}=le(),{onDataAction:s}=e,c=e.editItem||_l,i=e.editSlot||Gn,[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||yo.itemsPerSlot,w=k.useMemo(()=>Kl(E,{step:7*a.MS_PER_DAY,timezone:r}),[E.start.getTime(),E.end.getTime(),r]),I=k.useMemo(()=>Bl(0,{step:a.MS_PER_DAY},{groups:v,ranges:w}),[E.start.getTime(),E.end.getTime(),v,w]),R=k.useMemo(()=>el(u,{dateRange:E,fields:f,timezone:r}),[u,E.start.getTime(),E.end.getTime(),f,r]),T=k.useMemo(()=>nl(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(ho,vo),L=Bn(e.editable),z=e.form||La,_=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(ln.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(Hl,{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(ln.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,go)),C<r.items.length&&k.createElement(io,{slot:r,hiddenCount:r.items.length-C,onClick:_}))))));return k.createElement(nn,{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(on,{nested:!0,resources:l,group:t},J):k.createElement(mn,{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(ln.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,go)),C<t.items.length&&k.createElement(io,{slot:t,hiddenCount:t.items.length-C,onClick:_})))))))))):"horizontal"===h?k.createElement(on,{resources:l,group:t},ee):k.createElement(mn,{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(po,{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(qn,{dataItem:M.item,onClose:$,onOccurrenceClick:K,onSeriesClick:B}),M.removeItem&&L.remove&&k.createElement(Zn,{dataItem:M.removeItem,isSeries:M.series,onClose:Z,onCancel:Z,onConfirm:G}))},yo={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,Kr[We]),selectedDateFormat:"{0:Y}",selectedShortDateFormat:"{0:y}"},fo={itemsPerSlot:r.number};Eo.propTypes=fo,Eo.displayName="KendoReactSchedulerMonthView";const ko=e=>k.createElement(Gl,{...e,step:7,numberOfDays:7}),Do={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,Kr[ze]),selectedDateFormat:"{0:M} - {1:M}",selectedShortDateFormat:"{0:m} - {1:m}"};ko.displayName="KendoReactSchedulerWeekView";const Co=e=>{const t=ge(),r=Math.round((t.end.getTime()-t.start.getTime())/a.MS_PER_DAY);return k.createElement(Gl,{...e,step:7,numberOfDays:r})},bo={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,Kr[_e]),workWeekStart:a.Day.Monday,workWeekEnd:a.Day.Friday,selectedDateFormat:"{0:M} - {1:M}",selectedShortDateFormat:"{0:m} - {1:m}"};Co.displayName="KendoReactSchedulerWorkWeekView";const So=k.createElement("div",{className:"k-scheduler-cell k-side-cell"}),wo=e=>k.createElement(k.Fragment,null,k.createElement("div",{className:"k-sticky-cell"},So),e.children),Io=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,Kr[Ae]))),e.children)},Ro=e=>{var t;const{group:r,timezone:l,resources:s}=le(),c=k.useRef(null),i=k.useRef(null),u=e.editItem||_l,d=e.editSlot||Gn,m=k.useRef(null),[p]=ke(),g=he(),v=me(),h=ge(),E=ie(),y=o.useInternationalization(),[f]=Pl(e.showWorkHours,null!=(t=e.defaultShowWorkHours)?t:To.defaultShowWorkHours),D=e.slotDivisions||To.slotDivisions,C=e.slotDuration||To.slotDuration,b=e.workWeekStart||To.workWeekStart,S=e.workWeekEnd||To.workWeekEnd,w=y.parseDate(e.workDayStart||e.isWorkDayStart||To.isWorkDayStart),I=y.parseDate(e.workDayEnd||e.isWorkDayEnd||To.isWorkDayEnd),R=y.parseDate(e.startTime||To.startTime),A=y.parseDate(e.endTime||To.endTime),M=k.useMemo(()=>f?w:R,[f,w,R]),N=k.useMemo(()=>f?I:A,[f,I,A]),L=k.useMemo(()=>Kl(h,{step:a.MS_PER_DAY,timezone:l}),[h.start.getTime(),h.end.getTime(),l]),z=k.useMemo(()=>Bl(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(()=>el(p,{dateRange:h,fields:E,timezone:l}),[p,h.start.getTime(),h.end.getTime(),E,l]),O=k.useMemo(()=>nl(_,{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||To.columnWidth)+1),P=k.createElement(ln.Consumer,null,()=>k.createElement(k.Fragment,null,k.createElement("div",{className:"k-scheduler-row"},L.map((t,r)=>k.createElement(Hl,{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(Dn,{key:t.index,as:e.timeHeaderCell,format:"t",date:t.zonedStart,start:t.zonedStart,end:t.zonedEnd}):null))))),H=k.createElement(ln.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]);Xa({element:m,selector:".k-resource-cell",attribute:"data-depth-index",explicitDepth:!0});const G=m.current?m.current.closest(".k-scheduler-layout"):null;return Xn({element:G,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:O&&!O.length}),k.createElement(nn,{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(on,{nested:!0,group:r,resources:s,rowContent:wo},P):k.createElement(mn,{wrapGroup:!0,group:r,resources:s},P)),k.createElement("div",{className:"k-scheduler-body",style:{width:W},ref:i},"horizontal"===g?k.createElement(on,{group:r,resources:s,rowContent:Io},H,k.createElement(ln.Consumer,null,({groupIndex:t})=>e.currentTimeMarker&&$(T(L).start,x(L).end,new Date,new Date,!0)&&k.createElement(Ol,{groupIndex:t,attachArrow:c,vertical:!0}))):k.createElement(mn,{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(Ol,{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}))))},To={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},xo=e=>k.createElement(Ro,{...e}),Ao={...To,name:"timeline",title:e=>e.toLanguageString(Le,Kr[Le]),slotDuration:60,slotDivisions:2,numberOfDays:1,selectedDateFormat:"{0:M}",selectedShortDateFormat:"{0:m}"};xo.displayName="KendoReactSchedulerTimelineView";const Mo=(e,t,r)=>e.filter(e=>{const a=L(e,t.recurrenceId);return null!=a&&a===r&&!L(e,t.recurrenceRule)}),No=(e,t)=>{const r=n.clone(e);return z(r,t.recurrenceId,null),z(r,t.recurrenceRule,null),z(r,t.originalStart,null),r},Lo=new Map;Lo.set(lo,so),Lo.set(ql,Zl),Lo.set(Eo,yo),Lo.set(ko,Do),Lo.set(Co,bo),Lo.set(xo,Ao);const zo=k.forwardRef((e,t)=>{var r,l,i,u;const m=!n.validatePackage(Yl,{component:"Scheduler"}),p=n.getLicenseMessage(Yl),{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||_o.defaultDate,e.date,e.onDateChange),R=k.Children.toArray(e.children||[]).map(e=>{var t;return k.isValidElement(e)?k.cloneElement(e,{...Lo.get(e.type),...null!=(t=e.props)?t:{}}):e}),T=k.cloneElement(k.createElement(ql,null),Lo.get(ql)),[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:_o.data)||_o.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:_o.defaultDate,end:_o.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);Mo(W,S,e).forEach(e=>{r.push(No(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=Mo(W,S,o);e.resetExceptions?s.forEach(e=>r.push(n.clone(e))):s.forEach(e=>t.push(No(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:_o.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,Kr[Ne]),ue=D.toLanguageString(He,Kr[He]),de=D.toLanguageString($e,Kr[$e]),me=D.toLanguageString(zr,Kr[zr]),pe=D.toLanguageString(Fr,Kr[Fr]),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||_o.header,Ee=M.props.footer||e.footer||_o.footer,ye=M.props.form||e.form||La,[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:_o.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(Br,{value:w,onChange:J,level:ve}),k.createElement(s.ToolbarSpacer,null),1===ve&&k.createElement("span",{className:"k-separator"}),k.createElement(Vr,{level:ve})),M&&k.createElement(M.type,{editable:null!=(u=e.editable)?u:_o.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,Kr[_?Ke:Be]))),m&&k.createElement(n.WatermarkOverlay,{message:p}),De&&k.createElement(ye,{dataItem:De,onSubmit:Ie,onCancel:Re,onClose:Te})))}),_o={data:[],height:600,tabIndex:-1,editable:!1,quickCreate:!0,eventOverview:!0,defaultDate:new Date,header:Ie,footer:xe,navigation:Re,viewSelector:Te};zo.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})},zo.displayName="KendoReactScheduler";const Fo=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||Oo.item,v=o.useInternationalization(),[h]=$a(),[E]=Pa(),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 Xn({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(jn,{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(jn,{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}))))}),Oo={item:Yn};Fo.displayName="KendoReactSchedulerProportionalViewItem",e.AgendaView=lo,e.DATA_ACTION=te,e.DRAG_ITEM_ACTION=wl,e.DateHeaderCell=Hl,e.DayView=ql,e.DiscardChangesDialog=Na,e.ITEMS_FOCUS_ACTION=an,e.ITEMS_SELECT_ACTION=Ya,e.KeepResetCustomEventsDialog=Ll,e.MonthView=Eo,e.REMOVE_ITEM_ACTION=bl,e.RESIZE_ITEM_ACTION=Il,e.RemoveRecurrenceConfirmDialog=wa,e.SERIES_ACTION=Rl,e.SHOW_OCCURRENCE_DIALOG_ACTION=Cl,e.SHOW_REMOVE_DIALOG_ACTION=Sl,e.SLOTS_FOCUS_ACTION=Qa,e.SLOTS_SELECT_ACTION=ja,e.Scheduler=zo,e.SchedulerActiveViewContext=De,e.SchedulerDataContext=fe,e.SchedulerDateContext=Ee,e.SchedulerDateRangeContext=pe,e.SchedulerDrag=il,e.SchedulerEditItem=_l,e.SchedulerEditItemDragItemContext=vl,e.SchedulerEditItemFormItemContext=gl,e.SchedulerEditItemPropsContext=pl,e.SchedulerEditItemRemoveItemContext=El,e.SchedulerEditItemResizeItemContext=hl,e.SchedulerEditItemShowOccurrenceDialogContext=fl,e.SchedulerEditItemShowRemoveDialogContext=yl,e.SchedulerEditSlot=Gn,e.SchedulerEditSlotFormItemContext=zn,e.SchedulerEditSlotPropsContext=Ln,e.SchedulerEditTask=ao,e.SchedulerFieldsContext=ce,e.SchedulerFooter=xe,e.SchedulerForm=La,e.SchedulerFormEditor=Ia,e.SchedulerGroupsContext=de,e.SchedulerHeader=Ie,e.SchedulerItem=Yn,e.SchedulerItemContent=jn,e.SchedulerOccurrenceDialog=qn,e.SchedulerOrientationContext=ve,e.SchedulerProportionalViewItem=Fo,e.SchedulerPropsContext=ne,e.SchedulerQuickCreateForm=Kn,e.SchedulerRecurrenceDialog=Sa,e.SchedulerRemoveDialog=Zn,e.SchedulerResize=dl,e.SchedulerSlot=Sn,e.SchedulerTask=jl,e.SchedulerViewItem=Qn,e.SchedulerViewSlot=Mn,e.SchedulerViewTask=Xl,e.SchedulerViewsContext=oe,e.TimeHeaderCell=Dn,e.TimelineView=xo,e.WeekView=ko,e.WorkWeekView=Co,e.agendaViewDefaultProps=so,e.dateHeaderCellDefaultProps=$l,e.dayViewDefaultProps=Zl,e.monthViewDefaultProps=yo,e.schedulerDefaultProps=_o,e.schedulerDragDefaultProps=ul,e.schedulerEditItemDefaultProps=Fl,e.schedulerEditSlotDefaultProps=Un,e.schedulerEditTaskDefaultProps=no,e.schedulerFormDefaultProps=za,e.schedulerFormEditorDefaultProps=Ma,e.schedulerProportionalViewItemDefaultProps=Oo,e.schedulerQuickCreateFormDefaultProps={},e.schedulerResizeDefaultProps=ml,e.schedulerSlotDefaultProps=wn,e.schedulerViewItemDefaultProps=Jn,e.schedulerViewSlotDefaultProps=Nn,e.schedulerViewTaskDefaultProps=Ql,e.timeHeaderCellDefaultProps=Cn,e.timeLineViewDefaultProps=Ao,e.useSchedulerActiveViewContext=Ce,e.useSchedulerDataContext=ke,e.useSchedulerDateContext=ye,e.useSchedulerDateRangeContext=ge,e.useSchedulerEditItemDragItemContext=()=>k.useContext(vl),e.useSchedulerEditItemFormItemContext=()=>k.useContext(gl),e.useSchedulerEditItemPropsContext=()=>k.useContext(pl),e.useSchedulerEditItemRemoveItemContext=()=>k.useContext(El),e.useSchedulerEditItemResizeItemContext=()=>k.useContext(hl),e.useSchedulerEditItemShowOccurrenceDialogContext=()=>k.useContext(fl),e.useSchedulerEditItemShowRemoveDialogContext=()=>k.useContext(yl),e.useSchedulerEditSlotFormItemContext=()=>k.useContext(zn),e.useSchedulerEditSlotPropsContext=()=>k.useContext(Ln),e.useSchedulerFieldsContext=ie,e.useSchedulerGroupsContext=me,e.useSchedulerOrientationContext=he,e.useSchedulerPropsContext=le,e.useSchedulerViewsContext=se,e.weekViewDefaultProps=Do,e.workWeekDefaultProps=bo});
|
package/package-metadata.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Object.freeze({name:"@progress/kendo-react-scheduler",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Object.freeze({name:"@progress/kendo-react-scheduler",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1793895196,version:"16.4.0-develop.7",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui"});exports.packageMetadata=e;
|
package/package-metadata.mjs
CHANGED
|
@@ -6,7 +6,7 @@ export const packageMetadata = Object.freeze({
|
|
|
6
6
|
productName: 'KendoReact',
|
|
7
7
|
productCode: 'KENDOUIREACT',
|
|
8
8
|
productCodes: ['KENDOUIREACT'],
|
|
9
|
-
publishDate:
|
|
10
|
-
version: '16.4.0-develop.
|
|
9
|
+
publishDate: 1793895196,
|
|
10
|
+
version: '16.4.0-develop.7',
|
|
11
11
|
licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui'
|
|
12
12
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-scheduler",
|
|
3
|
-
"version": "16.4.0-develop.
|
|
3
|
+
"version": "16.4.0-develop.7",
|
|
4
4
|
"description": "React Scheduler brings the functionality of Outlook's Calendar to a single UI component. KendoReact Scheduler package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -29,16 +29,16 @@
|
|
|
29
29
|
"@progress/kendo-date-math": "^1.4.1",
|
|
30
30
|
"@progress/kendo-drawing": "^1.25.5",
|
|
31
31
|
"@progress/kendo-licensing": "^1.13.0",
|
|
32
|
-
"@progress/kendo-react-buttons": "16.4.0-develop.
|
|
33
|
-
"@progress/kendo-react-common": "16.4.0-develop.
|
|
34
|
-
"@progress/kendo-react-dateinputs": "16.4.0-develop.
|
|
35
|
-
"@progress/kendo-react-dialogs": "16.4.0-develop.
|
|
36
|
-
"@progress/kendo-react-dropdowns": "16.4.0-develop.
|
|
37
|
-
"@progress/kendo-react-form": "16.4.0-develop.
|
|
38
|
-
"@progress/kendo-react-inputs": "16.4.0-develop.
|
|
39
|
-
"@progress/kendo-react-intl": "16.4.0-develop.
|
|
40
|
-
"@progress/kendo-react-popup": "16.4.0-develop.
|
|
41
|
-
"@progress/kendo-react-tooltip": "16.4.0-develop.
|
|
32
|
+
"@progress/kendo-react-buttons": "16.4.0-develop.7",
|
|
33
|
+
"@progress/kendo-react-common": "16.4.0-develop.7",
|
|
34
|
+
"@progress/kendo-react-dateinputs": "16.4.0-develop.7",
|
|
35
|
+
"@progress/kendo-react-dialogs": "16.4.0-develop.7",
|
|
36
|
+
"@progress/kendo-react-dropdowns": "16.4.0-develop.7",
|
|
37
|
+
"@progress/kendo-react-form": "16.4.0-develop.7",
|
|
38
|
+
"@progress/kendo-react-inputs": "16.4.0-develop.7",
|
|
39
|
+
"@progress/kendo-react-intl": "16.4.0-develop.7",
|
|
40
|
+
"@progress/kendo-react-popup": "16.4.0-develop.7",
|
|
41
|
+
"@progress/kendo-react-tooltip": "16.4.0-develop.7",
|
|
42
42
|
"@progress/kendo-svg-icons": "^4.9.0 || ^5.0.0",
|
|
43
43
|
"react": "^18.0.0 || ^19.0.0",
|
|
44
44
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
"package": {
|
|
114
114
|
"productName": "KendoReact",
|
|
115
115
|
"productCode": "KENDOUIREACT",
|
|
116
|
-
"publishDate":
|
|
116
|
+
"publishDate": 1793895196,
|
|
117
117
|
"licensingDocsUrl": "https://www.telerik.com/kendo-react-ui"
|
|
118
118
|
}
|
|
119
119
|
},
|