@progress/kendo-react-scheduler 9.1.0-develop.4 → 9.1.0-develop.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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
- !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("@progress/kendo-react-dateinputs"),require("@progress/kendo-react-popup"),require("@progress/kendo-svg-icons"),require("react-dom"),require("@progress/kendo-react-form"),require("@progress/kendo-react-dialogs"),require("@progress/kendo-react-labels"),require("@progress/kendo-react-inputs"),require("@progress/kendo-react-dropdowns"),require("@progress/kendo-recurrence")):"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","@progress/kendo-react-dateinputs","@progress/kendo-react-popup","@progress/kendo-svg-icons","react-dom","@progress/kendo-react-form","@progress/kendo-react-dialogs","@progress/kendo-react-labels","@progress/kendo-react-inputs","@progress/kendo-react-dropdowns","@progress/kendo-recurrence"],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.KendoReactDateinputs,e.KendoReactPopup,e.KendoSvgIcons,e.ReactDOM,e.KendoReactForm,e.KendoReactDialogs,e.KendoReactLabels,e.KendoReactInputs,e.KendoReactDropdowns,e.KendoRecurrence)}(this,(function(e,t,r,a,n,l,o,s,c,i,d,u,m,p,g,E,h,y){"use strict";function v(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 f=v(t),k=v(u);const D=(e,t=0,r=0,a=[])=>{if(e.length<=t)return[a];const n=[];return e[t].data.map((l=>{n.push(...D(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 S(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 C=(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},b=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"),w=(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],R=e=>e[e.length-1],x=e=>{const t=new Set;return e.forEach((e=>{t.add(e.field)})),t.size===e.length};const A=(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=A(e,t,r,a+1),l.style.pointerEvents=o,n},N=(e,t)=>n.getter(t)(e),_=(e,t,r)=>{if(t)return n.setter(t)(e,r)},M=e=>null!=e;function z(e){return new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))}const L=(e,t,r)=>{const a=O(e,t)?N(e,t.id):N(e,t.recurrenceId);return r.find((e=>N(e,t.id)===a))},O=(e,t)=>{const r=N(e,t.id),a=N(e,t.recurrenceId),n=N(e,t.recurrenceRule);return!(!r||!n||null!=a)},F=(e,t)=>Math.max(e.getTime(),t.getTime()),P=(e,t)=>Math.min(e.getTime(),t.getTime()),H=(e,t,r,a,n=!1)=>n?F(t,a)-P(e,r)<=t.getTime()-e.getTime()+(a.getTime()-r.getTime()):F(t,a)-P(e,r)<t.getTime()-e.getTime()+(a.getTime()-r.getTime()),W={id:"id",start:"start",startTimezone:"startTimezone",originalStart:"originalStart",end:"end",endTimezone:"endTimezone",isAllDay:"isAllDay",title:"title",description:"description",recurrenceRule:"recurrenceRule",recurrenceId:"recurrenceId",recurrenceExceptions:"recurrenceExceptions"},K=(e,t,r)=>(t.getHours()<e.getHours()||t.getHours()===e.getHours()&&t.getMinutes()<=e.getMinutes())&&(e.getHours()<r.getHours()||r.getHours()===e.getHours()&&e.getMinutes()<r.getMinutes()),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},B=(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&&H(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},U=(e,t,r=!1)=>{t.forEach((e=>e.items.splice(0,e.items.length))),t.forEach((t=>{const a=[];e.forEach((e=>{if((r||e.isAllDay===t.isAllDay)&&e.range.index===t.range.index&&e.group.index===t.group.index&&H(e.start,e.end,t.start,t.end)){const r=G(a);(null===e.order||void 0===e.order||e.order<r)&&(e.order=r),a.splice(e.order,0,e.order),t.items.push(e)}}))}))},Z=(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&&e.group.index===t.group.index&&H(e.start,e.end,t.start,t.end)&&e.slots.push(t)}))}))},$=(...e)=>{},q=(e,t,r=!1,a=!1)=>{const n=e.current;if(!n||!t)return null;const o=t.filter((e=>null!==e.current&&null!==e.current.element)),s=l.orderBy(o,[{field:"current.props.group.index",dir:"asc"},{field:"current.props.range.index",dir:"asc"},r?{field:""}:{field:"current.props.isAllDay",dir:"desc"},{field:"current.props.start",dir:"asc"}]),c=s.findIndex((e=>null!==e.current&&!(e.current.props.uid!==n.props.uid||void 0!==e.current.props.occurrenceId&&e.current.props.occurrenceId!==n.props.occurrenceId||e.current.props.group.index!==n.props.group.index||e.current.props.range.index!==n.props.range.index||!r&&e.current.props.isAllDay!==n.props.isAllDay)));return s[c+(a?-1:1)]},Y=(e,t)=>(e.order||0)-(t.order||0),j=6e4,X=[{}],Q=new Date(1900,0,1),J=new Date(2099,11,31);a.ZonedDate.fromLocalDate(Q),a.ZonedDate.fromLocalDate(J);var ee=(e=>(e[e.create=0]="create",e[e.update=1]="update",e[e.remove=2]="remove",e))(ee||{});const te=f.createContext({current:null}),re=()=>f.useContext(te);te.displayName="SchedulerElementContext";const ae=f.createContext({}),ne=()=>f.useContext(ae);ae.displayName="SchedulerPropsContext";const le=f.createContext([]),oe=()=>f.useContext(le);le.displayName="SchedulerViewsContext";const se=f.createContext(W),ce=()=>f.useContext(se);se.displayName="SchedulerFieldsContext";const ie=f.createContext({dateFormat:"{0:D}",shortDateFormat:"{0:d}"});ie.displayName="SchedulerDateFormatContext";const de=f.createContext([{index:0,resources:[]}]),ue=()=>f.useContext(de);de.displayName="SchedulerGroupsContext";const me=f.createContext({start:new Date,end:new Date,zonedStart:a.ZonedDate.fromLocalDate(new Date),zonedEnd:a.ZonedDate.fromLocalDate(new Date)}),pe=()=>f.useContext(me);me.displayName="SchedulerDateRangeContext";const ge=f.createContext(null),Ee=()=>f.useContext(ge);ge.displayName="SchedulerOrientationContext";const he=f.createContext([new Date,$]),ye=()=>f.useContext(he);he.displayName="SchedulerDateContext";const ve=f.createContext([[],$]),fe=()=>f.useContext(ve);ve.displayName="SchedulerDataContext";const ke=f.createContext(["day",$]),De=()=>f.useContext(ke);ke.displayName="SchedulerActiveViewContext";const Se=f.createContext([null,()=>{}]);Se.displayName="SchedulerItemSelectionContext";const Ce=({children:e,element:t,props:r,views:a,fields:n,groups:l,dateRange:o,dateFormat:s,orientation:c,date:i,data:d,activeView:u,selection:m})=>f.createElement(te.Provider,{value:t},f.createElement(ae.Provider,{value:r},f.createElement(le.Provider,{value:a},f.createElement(se.Provider,{value:n},f.createElement(ie.Provider,{value:s},f.createElement(de.Provider,{value:l},f.createElement(me.Provider,{value:o},f.createElement(ge.Provider,{value:c},f.createElement(he.Provider,{value:i},f.createElement(ve.Provider,{value:d},f.createElement(ke.Provider,{value:u},f.createElement(Se.Provider,{value:m},e)))))))))))),be=(e,t,r)=>{const[a,n]=f.useState(t||e),l=f.useCallback(((e,t)=>{n(e),r&&r.call(void 0,{...t,value:e})}),[r,n]);return[void 0!==t?t:a,l]},Ie=f.forwardRef(((e,t)=>{const{className:r,...a}=e,l=f.useRef(null),o=f.useRef(null);f.useImperativeHandle(o,(()=>({element:l.current,props:e}))),f.useImperativeHandle(t,(()=>o.current));const c=f.useMemo((()=>n.classNames("k-scheduler-toolbar",r)),[r]);return f.createElement(s.Toolbar,{id:e.id,ref:e=>{e&&(l.current=e.element)},className:c,...a},e.children)}));Ie.displayName="KendoReactSchedulerHeader";const we=f.forwardRef(((e,t)=>{const{className:r,...a}=e,l=f.useRef(null);return f.useImperativeHandle(t,(()=>({element:l.current,props:e}))),f.createElement(s.ToolbarItem,{ref:e=>{e&&(l.current=e.element)},className:n.classNames(r),...a},e.children)}));we.displayName="KendoReactSchedulerSchedulerNavigation";const Te=f.forwardRef(((e,t)=>{const{className:r,...a}=e,l=f.useRef(null);return f.useImperativeHandle(t,(()=>({element:l.current,props:e}))),f.createElement(s.ToolbarItem,{ref:e=>{e&&(l.current=e.element)},className:n.classNames("k-scheduler-views",r),...a},e.children)}));Te.displayName="KendoReactSchedulerViewSelector";const Re=f.forwardRef(((e,t)=>{const{className:r,style:a,...l}=e,o=f.useRef(null),c=f.useRef(null);f.useImperativeHandle(o,(()=>({element:c.current,props:e}))),f.useImperativeHandle(t,(()=>o.current));const i=f.useMemo((()=>n.classNames("k-scheduler-footer",e.className)),[e.className]);return f.createElement(s.Toolbar,{ref:e=>{e&&(c.current=e.element)},className:i,style:{boxShadow:"none",...a},...l},e.children)}));Re.displayName="KendoReactSchedulerFooter";const xe="scheduler.allEvents",Ae="scheduler.allDay",Ne="scheduler.today",_e="scheduler.timelineViewTitle",Me="scheduler.weekViewTitle",ze="scheduler.workWeekViewTitle",Le="scheduler.agendaViewTitle",Oe="scheduler.dayViewTitle",Fe="scheduler.monthViewTitle",Pe="scheduler.deleteTitle",He="scheduler.previousTitle",We="scheduler.nextTitle",Ke="scheduler.showFullDay",Ve="scheduler.showWorkDay",Ge="scheduler.editOccurrence",Be="scheduler.editSeries",Ue="scheduler.editRecurringConfirmation",Ze="scheduler.editRecurringDialogTitle",$e="scheduler.editSave",qe="scheduler.editCancel",Ye="scheduler.editorTitle",je="scheduler.editorEventTitle",Xe="scheduler.editorEventStart",Qe="scheduler.editorEventStartTimeZone",Je="scheduler.editorEventEnd",et="scheduler.editorEventEndTimeZone",tt="scheduler.editorEventAllDay",rt="scheduler.editorEventDescription",at="scheduler.editorEventSeparateTimeZones",nt="scheduler.editorEventTimeZone",lt="scheduler.recurrenceEditorRepeat",ot="scheduler.recurrenceEditorWeeklyRepeatOn",st="scheduler.recurrenceEditorMonthlyDay",ct="scheduler.recurrenceEditorMonthlyRepeatOn",it="scheduler.recurrenceEditorYearlyOf",dt="scheduler.recurrenceEditorYearlyRepeatOn",ut="scheduler.recurrenceEditorEndAfter",mt="scheduler.recurrenceEditorEndOccurrence",pt="scheduler.recurrenceEditorEndLabel",gt="scheduler.recurrenceEditorEndNever",Et="scheduler.recurrenceEditorEndOn",ht="scheduler.editorDelete",yt="scheduler.deleteConfirmation",vt="scheduler.deleteRecurringConfirmation",ft="scheduler.deleteOccurrence",kt="scheduler.deleteSeries",Dt="scheduler.deleteDialogTitle",St="scheduler.deleteRecurringDialogTitle",Ct="scheduler.dateTitle",bt="scheduler.timeTitle",It="scheduler.eventTitle",wt="scheduler.editorValidationRequired",Tt="scheduler.editorValidationStart",Rt="scheduler.editorValidationEnd",xt="scheduler.noEvents",At="scheduler.moreEvents",Nt={[wt]:"Field is required.",[Tt]:"Start time must be before End time.",[Rt]:"End time must be after Start time.",[xe]:"All events",[Ae]:"all day",[Ne]:"Today",[Oe]:"Day",[Fe]:"Month",[Me]:"Week",[ze]:"Work Week",[_e]:"Timeline",[Le]:"Agenda",[Pe]:"Delete",[He]:"Previous",[We]:"Next",[Ke]:"Show full day",[Ve]:"Show business hours",[Ge]:"Edit current occurrence",[Be]:"Edit the series",[Ue]:"Do you want to edit only this event occurrence or the whole series?",[Ze]:"Edit Recurring Item",[$e]:"Save",[qe]:"Cancel",[ht]:"Delete",[Ye]:"Event",[je]:"Title",[Xe]:"Start",[Qe]:"Start Time Zone",[Je]:"End",[et]:"End Time Zone",[tt]:"All Day Event",[rt]:"Description",[at]:"End in different Time Zone",[nt]:"Specify Time Zone",[lt]:"Repeat","scheduler.recurrenceEditorDailyInterval":"day(s)","scheduler.recurrenceEditorDailyRepeatEvery":"Repeat every","scheduler.recurrenceEditorWeeklyInterval":"week(s)","scheduler.recurrenceEditorWeeklyRepeatEvery":"Repeat every",[ot]:"Repeat on",[st]:"Day","scheduler.recurrenceEditorMonthlyInterval":"month(s)","scheduler.recurrenceEditorMonthlyRepeatEvery":"Repeat every",[ct]:"Repeat on",[it]:"of","scheduler.recurrenceEditorYearlyRepeatEvery":"Repeat every",[dt]:"Repeat on","scheduler.recurrenceEditorYearlyInterval":"year(s)","scheduler.recurrenceEditorFrequenciesDaily":"Daily","scheduler.recurrenceEditorFrequenciesMonthly":"Monthly","scheduler.recurrenceEditorFrequenciesNever":"Never","scheduler.recurrenceEditorFrequenciesWeekly":"Weekly","scheduler.recurrenceEditorFrequenciesYearly":"Yearly","scheduler.recurrenceEditorOffsetPositionsFirst":"First","scheduler.recurrenceEditorOffsetPositionsSecond":"Second","scheduler.recurrenceEditorOffsetPositionsThird":"Third","scheduler.recurrenceEditorOffsetPositionsFourth":"Fourth","scheduler.recurrenceEditorOffsetPositionsLast":"Last","scheduler.recurrenceEditorWeekdaysDay":"Day","scheduler.recurrenceEditorWeekdaysWeekday":"Weekday","scheduler.recurrenceEditorWeekdaysWeekendday":"Weekend Day",[ut]:"After",[mt]:"occurrence(s)",[pt]:"End",[gt]:"Never",[Et]:"On",[yt]:"Are you sure you want to delete this event?",[vt]:"Do you want to delete only this event occurrence or the whole series?",[ft]:"Delete current occurrence",[kt]:"Delete the series",[Dt]:"Delete Event",[St]:"Delete Recurring Item",[Ct]:"Date",[bt]:"Time",[It]:"Event",[xt]:"no events",[At]:"More events"},_t=f.forwardRef(((e,t)=>{var r;const l=f.useRef(null),u=f.useRef(null);f.useImperativeHandle(t,(()=>l.current));const{timezone:m}=ne(),p=a.ZonedDate.fromLocalDate(e.value,m),g=a.getDate(p),E=re(),h=n.useWindow(E),[y,v]=f.useState("desktop"),[k,D]=f.useState(!1),[S,C]=f.useState(!1),b=o.useInternationalization(),{dateFormat:I,shortDateFormat:w}=f.useContext(ie),T=pe(),[R]=ye(),x=T.end.getTime()-T.start.getTime()>27*a.MS_PER_DAY,A=b.format(I,x?R:T.zonedStart,x?R:T.zonedEnd.addDays(-1)),N=b.format(w,x?R:T.zonedStart,x?R:T.zonedEnd.addDays(-1)),_=f.useCallback((()=>{D(!k)}),[k]),M=f.useCallback((()=>{C(!0)}),[]),L=f.useCallback((()=>{D(!1),C(!1)}),[]),O=f.useCallback((t=>{if(e.onChange){const r=a.ZonedDate.fromUTCDate(z(t.value),m);e.onChange.call(void 0,{...t,value:r})}D(!1)}),[e.onChange,m]),F=f.useCallback((()=>{h().matchMedia&&v(h().matchMedia("(min-width: 1024px)").matches?"desktop":"mobile")}),[h]);f.useEffect((()=>{F();const e=h().ResizeObserver,t=e&&new e(F);return t&&t.observe(E.current),()=>{e&&t.disconnect()}}),[F,E,h]),f.useEffect((()=>{k&&S&&u.current&&u.current.focus()}),[S,k]);const{onFocus:P,onBlur:H}=n.useAsyncFocusBlur({onFocus:M,onBlur:L});return f.createElement(f.Fragment,null,f.createElement(s.Button,{ref:l,onFocus:P,onBlur:H,fillMode:"flat",className:"k-nav-current",icon:"calendar",svgIcon:d.calendarIcon,"aria-live":"polite",tabIndex:-1,onClick:_},"desktop"===y?A:N),f.createElement(i.Popup,{anchor:null==(r=l.current)?void 0:r.element,show:k},f.createElement(c.Calendar,{ref:u,onFocus:P,onBlur:H,onChange:O,value:g})))}));_t.displayName="KendoReactSchedulerNavigationDatePicker";const Mt=e=>{const[t,r]=De(),a=o.useLocalization(),n=f.useMemo((()=>"function"==typeof e.view.title?e.view.title.call(void 0,a):e.view.title),[e.view.title,a]),l=f.useCallback((()=>{e.view.name&&r(e.view.name)}),[r,e.view.name]);return f.createElement(s.Button,{className:"k-toolbar-button",role:"button",type:"button",tabIndex:-1,togglable:!0,selected:e.view.name===t,onClick:l},n)},zt=f.forwardRef((()=>{const e=f.useRef(null),[t,r]=f.useState("desktop"),a=oe(),l=n.useWindow(e),[c,i]=De(),u=a.find((e=>e.props.name===c)),m=o.useLocalization(),p=f.useCallback((e=>{i&&(e.syntheticEvent.preventDefault(),i(e.item.name))}),[i]),g=()=>{l().matchMedia&&r(l().matchMedia("(min-width: 1024px)").matches?"desktop":"mobile")};return f.useEffect((()=>{g();const t=l().ResizeObserver,r=t&&new t(g);return r&&r.observe(e.current),()=>{r&&r.disconnect()}}),[]),f.createElement("div",{className:n.classNames("k-toolbar-button-group k-button-group k-button-group-solid",{"k-scheduler-views":"desktop"===t,"k-scheduler-tools":"mobile"===t}),role:"group",ref:e},u&&"mobile"===t&&f.createElement(s.DropDownButton,{className:"k-views-dropdown",onItemClick:p,popupSettings:{popupClass:"k-scheduler-toolbar"},textField:"title",items:a.map((e=>({...e.props,selected:e.props.name===c,title:"function"==typeof e.props.title?e.props.title.call(void 0,m):e.props.title}))),text:f.createElement(f.Fragment,null,"function"==typeof u.props.title?u.props.title.call(void 0,m):u.props.title,f.createElement(n.IconWrap,{name:"caret-alt-down",icon:d.caretAltDownIcon}))}),"desktop"===t&&f.createElement(f.Fragment,null,a.map((e=>f.createElement(Mt,{key:e.props.name,view:e.props})))))}));zt.displayName="KendoReactSchedulerViewSelectorList";const Lt=f.forwardRef(((e,t)=>{const{className:r,...a}=e,l=f.useRef(null);return f.useImperativeHandle(t,(()=>({element:l.current,props:e}))),f.createElement(s.ToolbarItem,{ref:e=>{e&&(l.current=e.element)},className:n.classNames("k-scheduler-navigation",r),...a},e.children)})),Ot=f.createContext({});Ot.displayName="SchedulerViewPropsContext";const Ft=f.createContext([]),Pt=()=>f.useContext(Ft);Ft.displayName="SchedulerViewRangesContext";const Ht=f.createContext([[],$]),Wt=()=>f.useContext(Ht);Ht.displayName="SchedulerViewSlotsContext";const Kt=f.createContext([[],$]),Vt=()=>f.useContext(Kt);Kt.displayName="SchedulerViewItemsContext";const Gt=f.createContext([[],$]);Gt.displayName="SchedulerViewSelectedSlotsContext";const Bt=f.createContext([[],$]),Ut=()=>f.useContext(Bt);Bt.displayName="SchedulerViewSelectedItemsContext";const Zt=f.createContext([[],$]);Zt.displayName="SchedulerViewFocusedItemsContext";const $t=f.createContext([[],$]),qt=()=>f.useContext($t);$t.displayName="SchedulerViewFocusedSlotsContext";const Yt=({children:e,props:t,ranges:r,slots:a,items:n,selectedSlots:l,selectedItems:o,focusedItems:s,focusedSlots:c})=>f.createElement(Ot.Provider,{value:t},f.createElement(Ft.Provider,{value:r},f.createElement(Ht.Provider,{value:a},f.createElement(Kt.Provider,{value:n},f.createElement(Gt.Provider,{value:l},f.createElement(Bt.Provider,{value:o},f.createElement(Zt.Provider,{value:s},f.createElement($t.Provider,{value:c},e))))))));var jt=(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))(jt||{});var Xt=(e=>(e.select="SLOTS_SELECT_SELECT",e.reset="SLOTS_SELECT_RESET",e.add="SLOTS_SELECT_ADD",e))(Xt||{});const Qt=(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 Jt=(e=>(e.next="ITEMS_FOCUS_NEXT",e.prev="ITEMS_FOCUS_PREV",e))(Jt||{});var er=(e=>(e.up="SLOT_FOCUS_UP",e.down="SLOT_FOCUS_DOWN",e.left="SLOT_FOCUS_LEFT",e.right="SLOT_FOCUS_RIGHT",e))(er||{});const tr=(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)),rr=(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)),ar=(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)),nr=(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)),lr=f.forwardRef(((e,t)=>{const r=f.useRef(null);f.useImperativeHandle(t,(()=>r.current));const[a,l]=n.useCollection([]),[o,s]=n.useCollection([]),[c,i]=(e=>[[],(t,r)=>{switch(t.type){case"ITEMS_FOCUS_NEXT":{if(!t.item||!t.item.current||!e)return;const a=q(t.item,e,t.ignoreIsAllDay,!1);a&&a.current&&a.current.element&&(r.preventDefault(),a.current.element.focus());break}case"ITEMS_FOCUS_PREV":{if(!t.item||!t.item.current||!e)return;const a=q(t.item,e,t.ignoreIsAllDay,!0);a&&a.current&&a.current.element&&(r.preventDefault(),a.current.element.focus());break}}}])(a),[d,u]=(e=>[[],(t,r)=>{switch(t.type){case"SLOT_FOCUS_UP":{if(!t.slot.current||!e)return;const a=tr(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=nr(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=rr(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=ar(t.slot,e);a&&a.current&&a.current.element&&(r.preventDefault(),a.current.element.focus());break}}}])(o),[m,p]=(e=>{const[t,r]=f.useState([]),a=f.useCallback(((a,n)=>{switch(a.type){case"ITEMS_SELECT_SELECT":if(!a.item)return;r([a.item]);break;case"ITEMS_SELECT_SELECT_NEXT":{if(!a.item||!a.item.current||!e)return;const t=q(a.item,e,a.ignoreIsAllDay,!1);t&&(n.preventDefault(),r([t]));break}case"ITEMS_SELECT_SELECT_PREV":{if(!a.item||!a.item.current||!e)return;const t=q(a.item,e,a.ignoreIsAllDay,!0);t&&(n.preventDefault(),r([t]));break}case"ITEMS_SELECT_RESET":r([]);break;case"ITEMS_SELECT_ADD":if(!a.item)return;t.some((e=>e===a.item))||r([...t,a.item]);break;case"ITEMS_SELECT_REMOVE":if(!a.item)return;r([...t.filter((e=>e!==a.item))])}}),[e,t]);return[t,a]})(a),[g,E]=(e=>{const[t,r]=f.useState([]),a=f.useCallback((e=>{switch(e.type){case"SLOTS_SELECT_SELECT":if(!e.slot)return;r([e.slot]);break;case"SLOTS_SELECT_RESET":r([]);break;case"SLOTS_SELECT_ADD":if(!e.slot)return;t.some((t=>t===e.slot))||r([...t,e.slot])}}),[t]);return[t,a]})(),h=f.useCallback(((e,t)=>{E({type:Xt.reset}),p(e,t)}),[p,E]),y=f.useCallback(((e,t)=>{p({type:jt.reset},t),E(e)}),[p,E]),v=f.useMemo((()=>n.classNames("k-scheduler-layout k-scheduler-layout-flex",e.className)),[e.className]);return Qt({element:r,selector:".k-group-cell",attribute:"data-depth-index",explicitDepth:!0}),Qt({element:r,selector:".k-side-cell",attribute:"data-depth-index",explicitDepth:!1}),f.createElement(Yt,{props:e.props,ranges:e.ranges,items:[a,l],slots:[o,s],selectedItems:[m,h],selectedSlots:[g,y],focusedItems:[c,i],focusedSlots:[d,u]},f.createElement("div",{ref:r,style:e.style,className:v,role:"presentation"},e.children))}));lr.displayName="KendoReactSchedulerBaseView";const or=f.createContext({resource:{},groupIndex:0}),sr=e=>{const{nested:t,children:r,rowContentProps:a}=e,n=e.rowContent||dr,l=e.childRowContent||n,o=S(e.group,e.resources);return f.createElement("div",{className:"k-scheduler-group k-group-horizontal"},t?cr({resources:o,children:r,nested:t,groupIndex:0,rowContent:n,rowContentProps:a,childRowContent:l}):ir({resources:o,children:r,rowContent:n,nested:!!t,groupIndex:0,rowContentProps:a,childRowContent:l}))},cr=e=>{const{resources:t,rowContent:r,nested:a,children:n,groupIndex:l,rowContentProps:o,childRowContent:s}=e;if(l===t.length)return ir({resources:t,rowContent:r,children:n,nested:a,groupIndex:l,rowContentProps:o,childRowContent:s});const c=C(t,l),i=r;return f.createElement(f.Fragment,null,a?f.createElement("div",{className:"k-scheduler-row"},f.createElement(i,{resources:t,groupIndex:l,...o},c.map(((e,t)=>f.createElement("div",{key:t,className:"k-scheduler-cell k-heading-cell"},e.text))))):f.createElement(i,{resources:t,groupIndex:l,...o},c.map(((e,t)=>f.createElement("div",{key:t,className:"k-scheduler-cell k-heading-cell"},e.text)))),cr({resources:t,children:n,nested:a,rowContent:r,childRowContent:s,groupIndex:l+1}))},ir=e=>{const{resources:t,childRowContent:r,children:a,rowContentProps:n}=e,l=C(t,t.length-1),o=r,s=t.length>0;return f.createElement("div",{className:"k-scheduler-row"},f.createElement(o,{resources:t,...n},(l.length?l:X).map(((e,t)=>f.createElement("div",{key:t,className:"k-scheduler-cell k-group-cell"},f.createElement(or.Provider,{value:{resource:e,groupIndex:s?t:0}},a))))))};sr.displayName="KendoReactSchedulerHorizontalResourceIterator";const dr=e=>e.children,ur=e=>f.createElement(f.Fragment,null,f.createElement("div",{className:"k-scheduler-cell k-side-cell","data-range-index":e.rangeIndex}),e.children),mr=e=>{const{nested:t,wrapGroup:r,children:a}=e,n=e.cellContent||fr,l=S(e.group,e.resources);return f.createElement("div",{className:"k-scheduler-group"},t?r?f.createElement("div",{className:"k-scheduler-row"},f.createElement("div",{className:"k-sticky-cell"},Er({resources:l,children:a,cellContent:n,depth:0,groupIndex:0})),f.createElement("div",{className:"k-scheduler-cell k-group-content"},gr({resources:l,children:a,cellContent:n,depth:0,groupIndex:0},!1))):gr({resources:l,children:a,cellContent:n,depth:0,groupIndex:0},!0):r?f.createElement("div",{className:"k-scheduler-row"},f.createElement("div",{className:"k-sticky-cell"},pr({resources:l,children:a,cellContent:n,depth:0,groupIndex:0})),f.createElement("div",{className:"k-scheduler-cell k-group-content"},a)):hr({resources:l,children:a,cellContent:n,depth:0,groupIndex:0}))},pr=e=>f.createElement("div",{className:"k-scheduler-row"},f.createElement("div",{className:"k-scheduler-row"},e.resources.map(((e,t)=>f.createElement("div",{key:t,className:"k-scheduler-cell k-resource-cell k-heading-cell","data-depth-index":t}))))),gr=(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 f.createElement(or.Provider,{value:{resource:r[o],groupIndex:s?l:0}},a);const c=r[o].data.length;return r[o].data.map(((e,s)=>f.createElement("div",{key:s,className:"k-scheduler-row"},t&&f.createElement("div",{className:"k-scheduler-cell k-group-cell k-heading-cell","data-depth-index":o},e[r[o].textField]),f.createElement("div",{className:"k-scheduler-cell k-group-content k-resource-row","data-depth-index":o,"data-resource-index":c*l+s},gr({resources:r,children:a,cellContent:n,groupIndex:c*l+s,depth:o+1},t)))))},Er=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)=>f.createElement("div",{key:s,className:"k-scheduler-row"},f.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&&f.createElement("div",{className:"k-scheduler-cell k-resource-content"},Er({resources:t,children:r,cellContent:a,groupIndex:o*n+s,depth:l+1}))))):null},hr=e=>{const{resources:t,children:r,groupIndex:a,cellContent:n}=e;return f.createElement("div",{className:"k-scheduler-row"},vr(t),n,yr(r,t,a))},yr=(e,t,r)=>{const a=t.length>0;return f.createElement("div",{className:"k-scheduler-cell k-group-content"},f.createElement(or.Provider,{value:{resource:t[r],groupIndex:a?r:void 0}},e))},vr=e=>e.map(((e,t)=>f.createElement("div",{key:t,className:"k-scheduler-cell k-group-cell k-heading-cell","data-depth-index":t})));mr.displayName="KendoReactSchedulerVerticalResourceIterator";const fr=null,kr=e=>{const t=o.useLocalization();return f.createElement(f.Fragment,null,f.createElement("div",{className:"k-scheduler-cell k-heading-cell k-side-cell k-scheduler-times-all-day"},t.toLanguageString(Ae,Nt[Ae])),e.children)},Dr=f.forwardRef(((e,t)=>{const{as:r=Sr.as,...a}=e,l=f.useRef(null),s=f.useRef(null),c=o.useInternationalization(),i=f.useMemo((()=>n.classNames("k-scheduler-cell k-heading-cell",e.className)),[e.className]);return f.useImperativeHandle(s,(()=>({element:l.current&&l.current.element?l.current.element:l.current,props:e}))),f.useImperativeHandle(t,(()=>s.current)),f.createElement(r,{ref:r!==Sr.as?void 0:l,...a,className:i},c.formatDate(e.date,e.format?e.format:Sr.format))})),Sr={as:f.forwardRef((({as:e,format:t,start:r,end:a,...n},l)=>f.createElement("div",{...n,ref:l}))),format:"t"};Dr.displayName="KendoReactSchedulerTimeHeaderCell";const Cr=e=>{const{slot:t,children:r}=e;return f.createElement(f.Fragment,null,e.isMaster?f.createElement(Dr,{as:e.timeHeaderCell,date:t.zonedStart,start:t.zonedStart,end:t.zonedEnd,className:n.classNames("k-side-cell",{"k-major-cell":!e.isLast})}):f.createElement("div",{className:"k-scheduler-cell k-heading-cell k-side-cell"}),r)},br=e=>{const{onChange:t,data:r,validationMessage:a,visited:n,touched:o,modified:s,...c}=e,[i,d]=f.useState(r),u=f.useCallback((e=>t(e)),[t]),m=f.useCallback((e=>{const t=l.filterBy(r||[],e.filter);d(t)}),[]);return f.createElement(h.ComboBox,{style:{width:"100%"},data:i,filterable:!0,onFilterChange:m,onChange:u,...c})},Ir=e=>{const{value:t,data:r,onChange:a,...n}=e,l=f.useCallback((e=>{a&&a.call(void 0,e.currentTarget.dataset.value)}),[a]);return f.createElement(s.ButtonGroup,{className:"k-scheduler-recurrence-repeat",width:"100%",...n},r.map((e=>f.createElement(s.Button,{type:"button",key:e.value,selected:e.value===t,onClick:l,"data-value":e.value,togglable:!0},e.text))))},wr=e=>e.charAt(0).toUpperCase()+e.slice(1),Tr=["first","second","third","fourth","last"],Rr=["never","daily","weekly","monthly","yearly"],xr=[{day:0,offset:0},{day:1,offset:0},{day:2,offset:0},{day:3,offset:0},{day:4,offset:0},{day:5,offset:0},{day:6,offset:0}],Ar=[{day:1,offset:0},{day:2,offset:0},{day:3,offset:0},{day:4,offset:0},{day:5,offset:0}],Nr=[{day:0,offset:0},{day:6,offset:0}],_r=e=>{switch(e){case"day":return xr;case"weekday":return Ar;case"weekend":return Nr}},Mr=e=>{const{value:t,data:r,onChange:a,...n}={...zr,...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 f.createElement(s.ButtonGroup,{width:"auto",...n},(e.data||zr.data).map((e=>f.createElement(s.Button,{type:"button",key:e.value,"data-key":e.value,selected:t.some((t=>t===e.value)),togglable:!0,onClick:l},wr(e.text)))))},zr={data:[],value:[]},Lr=e=>{const t=o.useInternationalization(),r=o.useLocalization(),{timezone:n}=ne(),[l,s]=f.useState(1),[i,d]=f.useState(a.ZonedDate.fromUTCDate(e.start)),u=f.useCallback(((e,t)=>{const a=t?e:"scheduler.recurrenceEditor"+e;return r.toLanguageString(a,Nt[a])}),[r]),p=f.useMemo((()=>{var t;return(e=>y.parseRule({recurrenceRule:e})||{})(null!=(t=e.value)?t:Fr.value)}),[e.value]),v=f.useMemo((()=>(e=>Rr.map((t=>({value:t,text:e("Frequencies"+wr(t))}))))(u)),[u]),k=f.useMemo((()=>(e=>M(e)&&!(e=>(e=>null==e)(e)||e.trim&&0===e.trim().length)(e.freq)?e.freq:"never")(p)),[p]),D=f.useMemo((()=>((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)})(t,u)),[t,u]),S=f.useMemo((()=>((e,t,r)=>{var a;let n;if(M(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]})(D,p,e.start)),[D,p,e.start]),C=f.useMemo((()=>(e=>e.dateFormatNames({type:"months",nameType:"wide",standAlone:!0}).map(((e,t)=>({text:e,value:t+1}))))(t)),[t]),b=f.useMemo((()=>((e,t)=>e.find((e=>(t.byMonth?t.byMonth[0]:null)===e.value))||e[0])(C,p)),[C,p]),I=f.useMemo((()=>(e=>{const t=[1,2,3,4,-1];return Tr.map(((r,a)=>({text:e("OffsetPositions"+wr(r)),value:t[a]})))})(u)),[u]),w=f.useMemo((()=>((e,t)=>e.find((e=>e.value===(t.bySetPosition?t.bySetPosition[0]:t.byWeekDay&&t.byWeekDay[0]?t.byWeekDay[0].offset:1)))||e[0])(I,p)),[I,p]),T=f.useMemo((()=>(e=>M(e.count)?"count":M(e.until)?"until":"never")(p)),[p]),R=f.useMemo((()=>((e,t)=>M(e.byMonthDay)&&e.byMonthDay.length>0?e.byMonthDay[0]:t.getDate())(p,e.start)),[p,e.start]),x=f.useMemo((()=>(e=>M(e.until)?a.toLocalDate(e.until):null)(p)),[p.until]),A=f.useMemo((()=>(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))})(t)),[t]),N=f.useMemo((()=>(e=>M(e.byWeekDay)?"weekday":M(e.byMonthDay)?"monthday":void 0)(p)),[p.byWeekDay,p.byMonthDay]),_=f.useCallback((r=>{"never"===r.freq?e.onChange({value:null}):(void 0===r.weekStart&&(r.weekStart=t.firstDay()),e.onChange({value:y.serializeRule(r,e.timezone)}))}),[e.onChange,e.timezone]),z=f.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]),_(r)}),[_,e.start,n]),L=f.useCallback((e=>{const t=e.value;_(Object.assign({},p,{interval:t}))}),[_,p]),O=f.useCallback((e=>{const t=e.value;_(Object.assign({},p,{count:t})),null!==t&&s(t)}),[_,p]),F=f.useCallback((t=>{const r=t.value;if(!r)return;const n=a.ZonedDate.fromLocalDate(r,e.timezone);_(Object.assign({},p,{until:n})),d(n)}),[_,p,e.timezone]),P=f.useCallback((e=>{_(Object.assign({},p,{byWeekDay:A.filter((t=>e.some((e=>e===t.value)))).map((e=>({offset:0,day:e.value})))}))}),[_,p,A]),H=f.useCallback((e=>{const t=Object.assign({},p),r=e.target.value;"string"==typeof r.value?(t.byWeekDay=_r(r.value),t.bySetPosition=[w.value]):(t.bySetPosition=void 0,t.byWeekDay=[{day:r.value,offset:w.value}]),_(t)}),[w.value,_,p]),W=f.useCallback((e=>{_(Object.assign({},p,{byMonthDay:[e.value]}))}),[_,p]),K=f.useCallback((e=>{const t=e.value;_(Object.assign({},p,{byMonth:[t.value]}))}),[_,p]),V=f.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=i,r.count=void 0}_(r)}),[_,p,e.timezone]),G=f.useCallback((e=>{const t=Object.assign({},p);"monthday"===e.value?(t.byWeekDay=void 0,t.bySetPosition=void 0,t.byMonthDay=[R]):"weekday"===e.value&&(t.byMonthDay=void 0,"string"==typeof S.value?(t.bySetPosition=[w.value],t.byWeekDay=_r(S.value)):t.byWeekDay=[{day:S.value,offset:w.value}]),_(t)}),[_,p,R,S]),B=f.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}_(t)}),[_,p]);return f.createElement(f.Fragment,null,f.createElement(m.FieldWrapper,null,f.createElement(g.Label,{className:"k-form-label"},r.toLanguageString(lt,Nt[lt])),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(Ir,{value:k,data:v,onChange:z}))),"never"!==k&&f.createElement(m.FieldWrapper,null,f.createElement(g.Label,{editorId:"interval-editor",className:"k-form-label"},u(wr(k)+"RepeatEvery")),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(E.NumericTextBox,{min:1,step:1,defaultValue:1,value:p.interval,onChange:L,id:"interval-editor",className:"k-recur-interval"})," ",f.createElement(g.Label,{editorId:"interval-editor",className:"k-form-label"},u(wr(k)+"Interval")))),"weekly"===k&&f.createElement(m.FieldWrapper,null,f.createElement(g.Label,{className:"k-form-label"},u(ot,!0)),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(Mr,{data:A,value:(p.byWeekDay||[]).map((({day:e})=>e)),onChange:P}))),"monthly"===k&&f.createElement(m.FieldWrapper,null,f.createElement(g.Label,{key:"recurrence-repeat-on-monthly-label",className:"k-form-label"},u(ct,!0)),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(E.RadioGroup,{value:N,onChange:G,item:Or,className:"k-reset",data:[{value:"monthday",label:u(st,!0),children:[f.createElement(f.Fragment,{key:"separator"}," "),f.createElement(E.NumericTextBox,{key:"weekday-day",min:1,max:31,disabled:"monthday"!==N,value:p&&p.byMonthDay&&p.byMonthDay[0],onChange:W,width:"auto"})]},{value:"weekday",label:" ",children:[f.createElement(h.DropDownList,{key:"weekday-offset",textField:"text",dataItemKey:"value",disabled:"weekday"!==N,data:I,value:w,onChange:B,style:{width:"auto"}}),f.createElement(f.Fragment,{key:"separator"}," "),f.createElement(h.DropDownList,{key:"weekday-value",disabled:"weekday"!==N,value:S,data:D,onChange:H,textField:"text",dataItemKey:"value",style:{width:"auto"}})]}]}))),"yearly"===k&&f.createElement(m.FieldWrapper,null,f.createElement(g.Label,null,u(dt,!0)),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(E.RadioGroup,{value:N,item:Or,onChange:G,className:"k-reset",data:[{value:"monthday",label:" ",children:[f.createElement(h.DropDownList,{key:"monthday-month",disabled:"monthday"!==N,value:b,data:C,textField:"text",dataItemKey:"value",onChange:K,style:{width:"auto"}}),f.createElement(f.Fragment,{key:"separator"}," "),f.createElement(E.NumericTextBox,{key:"monthday-day",min:1,max:31,disabled:"monthday"!==N,value:R,onChange:W,width:"auto"})]},{value:"weekday",label:" ",children:[f.createElement(h.DropDownList,{key:"yearly-weekday-offset",textField:"text",dataItemKey:"value",disabled:"weekday"!==N,data:I,value:w,onChange:B,style:{width:"auto"}}),f.createElement(f.Fragment,{key:"yearly-separator-1"}," "),f.createElement(h.DropDownList,{key:"yearly-weekday-day",textField:"text",dataItemKey:"value",disabled:"weekday"!==N,value:S,data:D,onChange:H,style:{width:"auto"}}),f.createElement(f.Fragment,{key:"yearly-separator-2"}," "),f.createElement("span",{key:"yearly-weekday-of-label"},u(it,!0)),f.createElement(f.Fragment,{key:"yearly-separator-3"}," "),f.createElement(h.DropDownList,{key:"yearly-weekday-month",textField:"text",dataItemKey:"value",disabled:"weekday"!==N,value:b,data:C,onChange:K,style:{width:"auto"}})]}]}))),"never"!==k&&f.createElement("div",{className:"k-scheduler-recurrence-end-rule-editor"},f.createElement(m.FieldWrapper,null,f.createElement(g.Label,{className:"k-form-label"},u(pt,!0)),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(E.RadioGroup,{item:Or,value:T,onChange:V,data:[{value:"never",label:u(gt,!0)},{value:"count",label:u(ut,!0),children:[f.createElement(f.Fragment,{key:"separator-1"}," "),f.createElement(E.NumericTextBox,{key:"endrule-after-editor",id:"k-endrule-after",className:"k-recur-count",min:1,width:"auto",value:"count"===T?p.count:l,onChange:O,disabled:"count"!==T}),f.createElement(f.Fragment,{key:"separator-2"}," "),f.createElement(g.Label,{key:"endrule-after-label",className:"k-radio-label",editorId:"k-endrule-after"},u(mt,!0))]},{value:"until",label:u(Et,!0),children:[f.createElement(f.Fragment,{key:"separator"}," "),f.createElement(c.DatePicker,{key:"k-endrule-until-editor",id:"k-endrule-until",disabled:"until"!==T,min:e.start,value:"until"===T?x:a.toLocalDate(i),onChange:F,width:"auto"})]}]})))))},Or=e=>f.createElement("li",{...e},e.children),Fr={value:""};Lr.displayName="KendoReactSchedulerRepeatEditor";const Pr=e=>{const{as:t=Kr.as,value:r,onChange:a,...n}=e,{timezone:l}=ne();return f.createElement(t,{...n,value:Hr(r,l),onChange:e=>{a&&a({value:Wr(e.target.value,l)})}})},Hr=(e,t)=>{if(e){const r=a.toLocalDate(a.ZonedDate.fromLocalDate(e,t).toUTCDate());return r.setUTCFullYear(e.getFullYear()),r}return e},Wr=(e,t)=>{if(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},Kr={as:c.DateTimePicker},Vr=f.forwardRef(((e,t)=>{const r=f.useRef(null),l=f.useRef(null),s=a.timezoneNames(),i=o.useLocalization(),d=ce(),{resources:u,timezone:p}=ne();f.useImperativeHandle(l,(()=>({element:r.current&&r.current.element?r.current.element:r.current,props:e}))),f.useImperativeHandle(t,(()=>l.current));const{as:E=Gr.as,...h}=e,{titleLabel:y=Gr.titleLabel,titleError:v=Gr.titleError,titleEditor:k=Gr.titleEditor,startLabel:D=Gr.startLabel,startError:S=Gr.startError,startEditor:C=Gr.startEditor,startTimezoneLabel:b=Gr.startTimezoneLabel,startTimezoneError:I=Gr.startTimezoneError,startTimezoneEditor:w=Gr.startTimezoneEditor,startTimezoneCheckedLabel:T=Gr.startTimezoneCheckedLabel,startTimezoneCheckedEditor:R=Gr.startTimezoneCheckedEditor,endLabel:x=Gr.endLabel,endError:A=Gr.endError,endEditor:N=Gr.endEditor,endTimezoneLabel:_=Gr.endTimezoneLabel,endTimezoneError:M=Gr.endTimezoneError,endTimezoneEditor:z=Gr.endTimezoneEditor,endTimezoneCheckedLabel:L=Gr.endTimezoneCheckedLabel,endTimezoneCheckedEditor:O=Gr.endTimezoneCheckedEditor,allDayLabel:F=Gr.allDayLabel,allDayEditor:P=Gr.allDayEditor,recurrenceEditor:H=Gr.recurrenceEditor,descriptionLabel:W=Gr.descriptionLabel,descriptionEditor:K=Gr.descriptionEditor,descriptionError:V=Gr.descriptionError,resourceLabel:G=Gr.resourceLabel,resourceEditor:B=Gr.resourceEditor}=e,U=e.valueGetter(d.start)||new Date,Z=e.valueGetter(d.startTimezone)||p||"",$=e.valueGetter(d.endTimezone)||p||"",q=f.useMemo((()=>i.toLanguageString(wt,Nt[wt])),[i]),[Y,j]=f.useState(!!e.valueGetter(d.startTimezone)),[X,Q]=f.useState(!!e.valueGetter(d.endTimezone)),J=f.useCallback((t=>{t.value||(e.onChange(d.startTimezone,{value:null}),e.onChange(d.endTimezone,{value:null}),Q(t.value)),j(t.value)}),[e.onChange,d.startTimezone,d.endTimezone]),ee=f.useCallback((t=>{t.value||e.onChange(d.endTimezone,{value:null}),Q(t.value)}),[e.onChange]),te=f.useCallback((e=>e?void 0:q),[q]),re=f.useCallback(((e,t)=>Y?te(t(d.startTimezone)):void 0),[te,Y,d.startTimezone]),ae=f.useCallback(((e,t)=>Y&&X?te(t(d.endTimezone))||te(t(d.startTimezone)):void 0),[te,Y,X,d.startTimezone,d.endTimezone]),le=f.useMemo((()=>n.classNames("k-scheduler-edit-form",e.className)),[e.className]);return f.createElement(E,{ref:E===Gr.as?r:void 0,...h,className:le},f.createElement(f.Fragment,null,f.createElement(m.FieldWrapper,null,f.createElement(m.Field,{name:d.title,component:y,editorId:"k-scheduler-editor-title",className:"k-form-label"},i.toLanguageString(je,Nt[je])),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(m.Field,{id:"k-scheduler-editor-title",name:d.title,field:d.title,component:k}),e.errors[d.title]&&f.createElement(m.Field,{name:d.title,component:v},e.errors[d.title]))),f.createElement(m.FieldWrapper,null,f.createElement(m.Field,{name:d.start,component:D,editorId:"k-scheduler-editor-start",className:"k-form-label"},i.toLanguageString(Xe,Nt[Xe])),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(m.Field,{id:"k-scheduler-editor-start",name:d.start,width:"auto",component:C,as:e.valueGetter(d.isAllDay)?c.DatePicker:c.DateTimePicker,timezone:p}),e.errors[d.start]&&f.createElement(m.Field,{name:d.start,component:S},e.errors[d.start]))),f.createElement(m.FieldWrapper,null,f.createElement(T,{className:"k-form-label"}),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(R,{id:"k-scheduler-editor-set-start-timezone",onChange:J,value:Y}),f.createElement(T,{className:"k-checkbox-label",editorId:"k-scheduler-editor-set-start-timezone"},i.toLanguageString(nt,Nt[nt])))),Y&&f.createElement(m.FieldWrapper,null,f.createElement(m.Field,{name:d.start,component:b,className:"k-form-label"},i.toLanguageString(Qe,Nt[Qe])),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(m.Field,{component:w,value:Z,validator:re,data:s,name:d.startTimezone}),e.errors[d.startTimezone]&&f.createElement(m.Field,{name:d.startTimezone,component:I},e.errors[d.startTimezone]))),f.createElement(m.FieldWrapper,null,f.createElement(m.Field,{name:d.end,component:x,editorId:"k-scheduler-editor-end",className:"k-form-label"},i.toLanguageString(Je,Nt[Je])),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(m.Field,{id:"k-scheduler-editor-end",name:d.end,width:"auto",component:N,as:e.valueGetter(d.isAllDay)?c.DatePicker:c.DateTimePicker,timezone:p}),e.errors[d.end]&&f.createElement(m.Field,{name:d.end,component:A},e.errors[d.end]))),Y&&f.createElement(m.FieldWrapper,null,f.createElement("div",{className:"k-form-field-wrap"},f.createElement(O,{id:"k-scheduler-editor-set-end-timezone",onChange:ee,value:X})),f.createElement(L,{editorId:"k-scheduler-editor-set-end-timezone",className:"k-form-label"},i.toLanguageString(at,Nt[at]))),X&&f.createElement(m.FieldWrapper,null,f.createElement(m.Field,{name:d.endTimezone,component:_,className:"k-form-label"},i.toLanguageString(et,Nt[et])),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(m.Field,{value:$,data:s,validator:ae,component:z,name:d.endTimezone}),e.errors[d.endTimezone]&&f.createElement(m.Field,{name:d.endTimezone,component:M},e.errors[d.endTimezone]))),f.createElement(m.FieldWrapper,null,f.createElement(m.Field,{name:d.isAllDay,component:g.Label,className:"k-form-label"}),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(m.Field,{id:"k-is-allday-checkbox",name:d.isAllDay,component:P}),f.createElement(m.Field,{name:d.isAllDay,field:d.isAllDay,editorId:"k-is-allday-checkbox",className:"k-checkbox-label",component:F},i.toLanguageString(tt,Nt[tt])))),f.createElement("div",{className:"k-recurrence-editor"},f.createElement(m.Field,{component:H,field:d.recurrenceRule,name:d.recurrenceRule,start:U})),f.createElement(m.FieldWrapper,null,f.createElement(m.Field,{name:d.description,component:W,className:"k-form-label"},i.toLanguageString(rt,Nt[rt])),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(m.Field,{component:K,name:d.description,rows:1,id:"k-event-description"}),e.errors[d.description]&&f.createElement(m.Field,{name:d.description,component:V},e.errors[d.description]))),(u||[]).map((e=>f.createElement(m.FieldWrapper,{key:e.field},f.createElement(m.Field,{name:e.field,component:G,className:"k-form-label"}),f.createElement(g.Label,{className:"k-form-label"},e.name),f.createElement(m.Field,{name:e.field,component:B,resource:e,multiple:e.multiple,data:e.data,textField:e.textField,valueField:e.valueField,colorField:e.colorField}))))))})),Gr={as:f.forwardRef(((e,t)=>f.createElement(m.FormElement,{ref:t,id:e.id,style:e.style,tabIndex:e.tabIndex,className:e.className,horizontal:e.horizontal,children:e.children}))),titleLabel:g.Label,titleError:g.Error,titleEditor:E.Input,startLabel:g.Label,startError:g.Error,startEditor:Pr,startTimezoneLabel:g.Label,startTimezoneError:g.Error,startTimezoneEditor:br,startTimezoneCheckedLabel:g.Label,startTimezoneCheckedEditor:E.Checkbox,endLabel:g.Label,endError:g.Error,endEditor:Pr,endTimezoneLabel:g.Label,endTimezoneError:g.Error,endTimezoneEditor:br,endTimezoneCheckedLabel:g.Label,endTimezoneCheckedEditor:E.Checkbox,allDayLabel:g.Label,allDayEditor:E.Checkbox,recurrenceEditor:Lr,descriptionLabel:g.Label,descriptionEditor:E.TextArea,descriptionError:g.Error,resourceLabel:g.Label,resourceEditor:e=>{const t=e.multiple?h.MultiSelect:h.DropDownList,r=f.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=f.useCallback(((t,r)=>{const a=f.createElement(f.Fragment,null,e.colorField&&f.createElement("span",{key:1,className:"k-scheduler-mark",style:{backgroundColor:r.dataItem[e.colorField],marginRight:M(r.dataItem[e.valueField])?"8px":"4px"}}," "),f.createElement("span",{key:2},"  ",t.props.children));return f.cloneElement(t,{...t.props},a)}),[e.colorField,e.valueField]),n=f.useCallback(((t,r)=>{const a=f.createElement(f.Fragment,null,e.colorField&&r&&f.createElement("span",{key:1,className:"k-scheduler-mark",style:{backgroundColor:r[e.colorField],marginRight:r[e.valueField]?"8px":"4px"}}," "),t.props.children);return f.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 f.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})}};Vr.displayName="KendoReactSchedulerFormEditor";const Br=f.forwardRef(((e,t)=>{const{onCancel:r,onClose:a,onSubmit:l,editor:c,dialog:i=Ur.dialog,validator:u=Ur.validator,...g}=e,E=f.useRef(null);f.useImperativeHandle(E,(()=>({props:e}))),f.useImperativeHandle(t,(()=>E.current));const h=o.useLocalization(),y=ce(),v=f.useMemo((()=>h.toLanguageString(wt,Nt[wt])),[h]),D=f.useMemo((()=>h.toLanguageString(Rt,Nt[Rt])),[h]),S=f.useMemo((()=>h.toLanguageString($e,Nt[$e])),[h]),C=f.useMemo((()=>h.toLanguageString(qe,Nt[qe])),[h]),b=f.useMemo((()=>h.toLanguageString(Ye,Nt[Ye])),[h]),I=f.useMemo((()=>h.toLanguageString(Tt,Nt[Tt])),[h]),w=f.useCallback((e=>{r&&r.call(void 0,{value:null,syntheticEvent:e,target:E.current})}),[r]),T=f.useCallback((({syntheticEvent:e})=>{a&&a.call(void 0,{value:null,syntheticEvent:e,target:E.current})}),[a]),R=f.useCallback(((e,t)=>{l&&l.call(void 0,{value:e,syntheticEvent:t,target:E.current})}),[l]),x=f.useCallback(((e,t)=>e&&t(y.end)&&e.getTime()>t(y.end).getTime()?I:void 0),[y,I]),A=f.useCallback(((e,t)=>e&&t(y.start)&&e.getTime()<t(y.start).getTime()?D:void 0),[y,D]),N=f.useCallback((e=>e?void 0:v),[v]),_=f.useCallback(((e,t)=>{const r={};r[y.start]=[N(t(y.start)),x(t(y.start),t)].filter(Boolean).reduce(((e,t)=>e||t),""),r[y.end]=[N(t(y.start)),A(t(y.start),t)].filter(Boolean).reduce(((e,t)=>e||t),"");const a=u(e,t);return{...r,...a}}),[A,y.end,y.start,N,x,u]);return n.canUseDOM?k.createPortal(f.createElement(m.Form,{initialValues:e.dataItem,onSubmit:R,validator:_,render:e=>f.createElement(i,{title:b,minWidth:400,onClose:T,className:"k-scheduler-edit-dialog"},f.createElement(Vr,{...e,as:c}),f.createElement(p.DialogActionsBar,{layout:"start"},f.createElement(s.Button,{themeColor:"primary",disabled:!e.allowSubmit,onClick:e.onSubmit,icon:"save",svgIcon:d.saveIcon},S),f.createElement(s.Button,{onClick:w,icon:"cancel",svgIcon:d.cancelIcon},C))),...g}),document&&document.body):null})),Ur={dialog:p.Dialog,validator:()=>({})};Br.displayName="KendoReactSchedulerForm";const Zr=f.forwardRef(((e,t)=>{const{onFocus:r,onBlur:a,onClick:l,onMouseEnter:o,onMouseLeave:s,onMouseOut:c,onMouseOver:i,onDoubleClick:d,onKeyDown:u,onKeyPress:m,onKeyUp:p}=e,{slot:g,element:E}=((e,t)=>{const{_ref:r}=e,a=f.useRef(null),l=f.useRef(null),[,o]=Wt();return f.useImperativeHandle(a,(()=>({element:l.current,props:e}))),f.useImperativeHandle(t,(()=>a.current)),f.useImperativeHandle(r,(()=>a.current)),f.useEffect((()=>(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,y=f.useMemo((()=>{var t,r;const a=null!=(t=e.isWorkHour)?t:$r.isWorkHour,l=null!=(r=e.isWorkDay)?r:$r.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]),v=f.useMemo((()=>({userSelect:"none",...e.style})),[e.style]),k=f.useCallback((e=>{r&&r.call(void 0,{syntheticEvent:e,target:g.current})}),[r,g]),D=f.useCallback((e=>{a&&a.call(void 0,{syntheticEvent:e,target:g.current})}),[a,g]),S=f.useCallback((e=>{l&&l.call(void 0,{syntheticEvent:e,target:g.current})}),[l,g]),C=f.useCallback((e=>{i&&i.call(void 0,{syntheticEvent:e,target:g.current})}),[i,g]),b=f.useCallback((e=>{c&&c.call(void 0,{syntheticEvent:e,target:g.current})}),[c,g]),I=f.useCallback((e=>{o&&o.call(void 0,{syntheticEvent:e,target:g.current})}),[o,g]),w=f.useCallback((e=>{s&&s.call(void 0,{syntheticEvent:e,target:g.current})}),[s,g]),T=f.useCallback((e=>{d&&d.call(void 0,{syntheticEvent:e,target:g.current})}),[d,g]),R=f.useCallback((e=>{u&&u.call(void 0,{syntheticEvent:e,target:g.current})}),[u,g]),x=f.useCallback((e=>{m&&m.call(void 0,{syntheticEvent:e,target:g.current})}),[m,g]),A=f.useCallback((e=>{p&&p.call(void 0,{syntheticEvent:e,target:g.current})}),[p,g]);return f.createElement("div",{ref:E,id:e.id,style:v,className:y,tabIndex:h,"aria-selected":e.selected||void 0,onFocus:k,onBlur:D,onClick:S,onMouseEnter:I,onMouseLeave:w,onMouseOver:C,onMouseOut:b,onDoubleClick:T,onKeyDown:R,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)})),$r={isWorkHour:!0,isWorkDay:!0};Zr.displayName="KendoReactSchedulerSlot";const qr=f.forwardRef(((e,t)=>{var r;const{slot:a,_ref:l,...o}=e,s=a||Yr.slot,c=f.useRef(null),i=f.useRef(null);return f.useImperativeHandle(c,(()=>({props:e}))),f.useImperativeHandle(l,(()=>i.current)),f.useImperativeHandle(t,(()=>c.current)),((e,t)=>{const r=f.useRef(),a=f.useRef(0),l=re(),o=f.useCallback((()=>{if(!t||!e.current)return;const r=e.current.element,n=e.current.props;if(!r)return;const l=I(r);let o=0;const s=n.items.filter((e=>e._ref.current));s.forEach((e=>{if(!e._ref.current)return;const{height:t}=b(e._ref.current.element);o+=t}));const c=1*s.length*2+o-(l||0)+("object"==typeof t&&t.offsetTop?t.offsetTop:0)+("object"==typeof t&&t.offsetBottom?t.offsetBottom:0);s.length?c>a.current-l&&w(r,{height:c},!0):r&&(r.style.minHeight="")}),[t,e]),s=f.useCallback((()=>{void 0!==r.current&&window.cancelAnimationFrame(r.current),r.current=window.requestAnimationFrame((()=>{o()}))}),[o]);n.useIsomorphicLayoutEffect((()=>{if(!e.current)return;const t=e.current.element;t&&(a.current=t.clientHeight)}),[]),f.useEffect(o,[e,e.current&&e.current.props,t]),f.useEffect((()=>{if(!e.current)return;const t=e.current.props.items.filter((e=>e._ref.current)).map((e=>{if(!e._ref.current||!e._ref.current.element||!l.current)return;const t=window.ResizeObserver,r=t&&new t(s);return r&&r.observe(e._ref.current.element),()=>{r&&r.disconnect()}}));return()=>{t.forEach((e=>e&&e()))}}),[s,l,e])})(i,null!=(r=e.expandable)?r:Yr.expandable),f.createElement(s,{...o,_ref:i})})),Yr={slot:Zr,expandable:!1};qr.displayName="KendoReactSchedulerViewSlot";const jr=f.createContext([null]);jr.displayName="SchedulerEditSlotPropsContext";const Xr=f.createContext([null]);Xr.displayName="SchedulerEditSlotFormItemContext";const Qr=({props:e,form:t,children:r})=>f.createElement(jr.Provider,{value:e},f.createElement(Xr.Provider,{value:t},r)),Jr=e=>{const t=f.useContext(ae),r=void 0!==e?e:t.editable||!1,a=!0===r||void 0!==r&&!1!==r&&!0===r.edit,n=!0===r||void 0!==r&&!1!==r&&!0===r.resize,l=!0===r||void 0!==r&&!1!==r&&!0===r.remove,o=!0===r||void 0!==r&&!1!==r&&!0===r.drag;return{add:!0===r||void 0!==r&&!1!==r&&!0===r.add,edit:a,drag:o,remove:l,resize:n,select:!0===r||void 0!==r&&!1!==r&&!0===r.select}},ea=f.forwardRef(((e,t)=>{const{_ref:r,onDataAction:a,viewSlot:l,form:o,formItem:s,onFormItemChange:c,...i}=e,[d,u]=f.useState(e.tabIndex),m=f.useRef(null),p=f.useRef(null);f.useImperativeHandle(p,(()=>({props:e}))),f.useImperativeHandle(t,(()=>p.current)),f.useImperativeHandle(r,(()=>m.current));const g=Jr(e.editable),E=ce(),[h]=Wt(),[y]=Vt(),[v,k]=f.useContext(Gt),[,D]=qt(),S=o||ta.form,C=l||ta.viewSlot,[b,I]=be(null,s,e.onFormItemChange),w=v.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))),T=f.useCallback((()=>{const t={};if(_(t,E.start,new Date(e.start.getTime())),_(t,E.end,new Date(e.end.getTime())),_(t,E.isAllDay,e.isAllDay),e.group.resources.length)for(let r=0;r<e.group.resources.length;r++){const a=e.group.resources[r];if(x(e.group.resources)){const n=N(e.group.resources[r],a.valueField);_(t,a.field,a.multiple?[n]:n)}else _(t,a.field,a.multiple?[]:void 0)}return t}),[E.start,E.end,E.isAllDay,e.start,e.end,e.isAllDay,e.group.resources]),R=f.useCallback((t=>{g.select&&k({type:Xt.select,slot:m},t.syntheticEvent),e.onFocus&&e.onFocus.call(void 0,t)}),[k,g.select,e.onFocus]),A=f.useCallback((t=>{if(g.add){const e=T();I(e,t)}e.onDoubleClick&&e.onDoubleClick.call(void 0,t)}),[T,g.add,e.onDoubleClick,I]),M=f.useCallback((e=>{let t;switch(e.syntheticEvent.keyCode){case n.Keys.left:if(!h)return;e.syntheticEvent.preventDefault(),D({type:er.left,slot:m},e.syntheticEvent);break;case n.Keys.right:if(!h)return;e.syntheticEvent.preventDefault(),D({type:er.right,slot:m},e.syntheticEvent);break;case n.Keys.up:if(!h)return;e.syntheticEvent.preventDefault(),D({type:er.up,slot:m},e.syntheticEvent);break;case n.Keys.down:if(!h)return;e.syntheticEvent.preventDefault(),D({type:er.down,slot:m},e.syntheticEvent);break;case n.Keys.enter:{if(!h||!g.add)return;const e=T();I(e);break}case n.Keys.tab:t=(e=>{const t=e.props.items.find((e=>0===e.order))||e.props.items[0];return t&&t._ref.current})(e.target)}t&&(e.syntheticEvent.preventDefault(),t.element&&t.element.focus())}),[T,D,g.add,I,h]),z=f.useCallback((e=>{a&&a.call(void 0,{type:ee.create,series:!1,dataItem:e.value},e),I(null,e.syntheticEvent)}),[a,I]),L=f.useCallback((e=>{I(null,e.syntheticEvent)}),[I]),O=f.useCallback((e=>{I(null,e)}),[I]),F=f.useCallback(((e,t)=>{I&&I(e,t)}),[I]);return f.useEffect((()=>{const t=h.length&&h[0].current===m.current;u(void 0!==e.tabIndex?null===e.tabIndex?void 0:e.tabIndex:0===v.length&&t&&0===y.length?0:void 0)}),[y,e.tabIndex,v.length,h]),f.createElement(Qr,{props:e,form:[b,F]},f.createElement(C,{...i,_ref:m,selected:w,tabIndex:d,onFocus:R,onDoubleClick:A,onKeyDown:M}),b&&f.createElement(S,{dataItem:b,onSubmit:z,onClose:O,onCancel:L}))})),ta={viewSlot:qr,form:Br};ea.displayName="KendoReactSchedulerEditSlot";const ra=f.forwardRef(((e,t)=>{const{isRemove:r,onClose:a,onSeriesClick:l,onOccurrenceClick:c}=e,i=f.useRef(null);f.useImperativeHandle(i,(()=>({props:e}))),f.useImperativeHandle(t,(()=>i.current));const d=o.useLocalization(),u=e=>d.toLanguageString(e,Nt[e]),m=u(Ge),g=u(Be),E=u(Ue),h=u(Ze),y=u(ft),v=u(kt),D=u(St),S=u(vt),C=r?D:h,b=r?S:E,I=r?y:m,w=r?v:g,T=f.useCallback((({syntheticEvent:e})=>{a&&a.call(void 0,{syntheticEvent:e,value:null,target:i.current})}),[a]),R=f.useCallback((e=>{l&&l.call(void 0,{syntheticEvent:e,value:null,target:i.current})}),[l]),x=f.useCallback((e=>{c&&c.call(void 0,{syntheticEvent:e,value:null,target:i.current})}),[c]);return n.canUseDOM?k.createPortal(f.createElement(p.Dialog,{title:C,onClose:T},b,f.createElement(p.DialogActionsBar,null,f.createElement(s.Button,{onClick:x},I),f.createElement(s.Button,{onClick:R},w))),document&&document.body):null}));ra.displayName="KendoReactSchedulerSchedulerOccurrenceDialog";const aa=f.forwardRef(((e,t)=>{const{onClose:r,onCancel:a,onConfirm:l}=e,c=f.useRef(null);f.useImperativeHandle(c,(()=>({props:e}))),f.useImperativeHandle(t,(()=>c.current));const i=o.useLocalization(),d=i.toLanguageString(qe,Nt[qe]),u=i.toLanguageString(ht,Nt[ht]),m=i.toLanguageString(yt,Nt[yt]),g=i.toLanguageString(Dt,Nt[Dt]),E=f.useCallback((({syntheticEvent:e})=>{if(!r)return;const t={syntheticEvent:e,value:null,target:c.current};r.call(void 0,t)}),[r]),h=f.useCallback((e=>{a&&a.call(void 0,{syntheticEvent:e,value:null})}),[a]),y=f.useCallback((e=>{l&&l.call(void 0,{syntheticEvent:e,value:null})}),[l]);return n.canUseDOM?k.createPortal(f.createElement(p.Dialog,{title:g,onClose:E},m,f.createElement(p.DialogActionsBar,null,f.createElement(s.Button,{onClick:h},d),f.createElement(s.Button,{onClick:y},u))),document&&document.body):null}));aa.displayName="KendoReactSchedulerRemoveDialog";const na=f.forwardRef(((e,t)=>{const{onFocus:r,onBlur:a,onMouseDown:l,onClick:s,onMouseUp:c,onMouseOut:i,onMouseOver:u,onMouseEnter:m,onMouseLeave:p,onDoubleClick:g,onRemoveClick:E,onKeyUp:h,onKeyDown:y,onKeyPress:v,onPress:k,onDrag:D,onRelease:S,onResizePress:C,onResizeEndDrag:b,onResizeRelease:I,onResizeStartDrag:w}=e,{item:T,element:R}=((e,t)=>{const{_ref:r,itemRef:a,_maxSiblingsPerSlot:l}=e,o=f.useRef(null),s=f.useRef(null),[,c]=Vt();return f.useImperativeHandle(o,(()=>({element:s.current,props:e,get _maxSiblingsPerSlot(){var e;return null!=(e=null==l?void 0:l.current)?e:0}}))),f.useImperativeHandle(t,(()=>o.current)),f.useImperativeHandle(r,(()=>o.current)),f.useImperativeHandle(a,(()=>o.current)),n.useIsomorphicLayoutEffect((()=>(c({type:n.COLLECTION_ACTION.add,item:o}),()=>{c({type:n.COLLECTION_ACTION.remove,item:o})}))),{item:o,element:s}})(e,t),x=n.useDir(R),A=f.useRef(null),N=f.useRef(null),_=f.useRef(null),M=f.useRef(null),z=Jr(e.editable),L=o.useInternationalization(),O=o.useLocalization().toLanguageString(Pe,Nt[Pe]),F=e.group.resources.find((e=>!(!e.colorField||""===e[e.colorField]||void 0===e[e.colorField]))),P=F&&F.colorField&&F[F.colorField],H=void 0!==e.tabIndex?null===e.tabIndex?void 0:e.tabIndex:e.selected?0:-1,W=f.useMemo((()=>n.classNames({"k-event":!e.resizeHint,"k-selected":e.selected&&z.select,"k-event-drag-hint":e.dragHint,"k-scheduler-marquee":e.resizeHint,"k-marquee":e.resizeHint,"k-first":e.resizeHint&&!e.tail,"k-last":e.resizeHint&&!e.head},e.className)),[e.resizeHint,e.selected,e.dragHint,e.tail,e.head,e.className,z.select]),K=f.useMemo((()=>`${function(e,t,r,a){return a?`${e.formatDate(t,{skeleton:"yMMMMEEEEd"})}`:`${e.formatDate(t,{skeleton:"yMMMMEEEEdhm"})}–${e.formatDate(r,"t")}`}(L,e.zonedStart,e.zonedEnd,e.isAllDay)}, ${e.title}`),[L,e.isAllDay,e.title,e.zonedEnd,e.zonedStart]),V=f.useMemo((()=>({cursor:"pointer",userSelect:"none",borderColor:e.resizeHint?void 0:P,backgroundColor:e.resizeHint?void 0:P,touchAction:"none",...e.style})),[P,e.style,e.resizeHint]),G=f.useCallback((e=>{r&&r.call(void 0,{syntheticEvent:e,target:T.current})}),[r,T]),B=f.useCallback((e=>{a&&a.call(void 0,{syntheticEvent:e,target:T.current})}),[a,T]),U=f.useCallback((e=>{l&&l.call(void 0,{syntheticEvent:e,target:T.current})}),[l,T]),Z=f.useCallback((e=>{s&&s.call(void 0,{syntheticEvent:e,target:T.current})}),[s,T]),$=f.useCallback((e=>{c&&c.call(void 0,{syntheticEvent:e,target:T.current})}),[c,T]),q=f.useCallback((e=>{u&&u.call(void 0,{syntheticEvent:e,target:T.current})}),[u,T]),Y=f.useCallback((e=>{i&&i.call(void 0,{syntheticEvent:e,target:T.current})}),[i,T]),j=f.useCallback((e=>{m&&m.call(void 0,{syntheticEvent:e,target:T.current})}),[m,T]),X=f.useCallback((e=>{p&&p.call(void 0,{syntheticEvent:e,target:T.current})}),[p,T]),Q=f.useCallback((e=>{g&&g.call(void 0,{syntheticEvent:e,target:T.current})}),[g,T]),J=f.useCallback((e=>{E&&E.call(void 0,{syntheticEvent:e,target:T.current})}),[E,T]),ee=f.useCallback((e=>{y&&y.call(void 0,{syntheticEvent:e,target:T.current})}),[y,T]),te=f.useCallback((e=>{v&&v.call(void 0,{syntheticEvent:e,target:T.current})}),[v,T]),re=f.useCallback((e=>{h&&h.call(void 0,{syntheticEvent:e,target:T.current})}),[h,T]),ae=f.useCallback((e=>{k&&k.call(void 0,{dragEvent:e,target:T.current})}),[k,T]),ne=f.useCallback((e=>{D&&D.call(void 0,{dragEvent:e,target:T.current})}),[D,T]),le=f.useCallback((e=>{S&&S.call(void 0,{dragEvent:e,target:T.current})}),[S,T]),oe=f.useCallback((e=>{C&&C.call(void 0,{dragEvent:e,target:T.current})}),[C,T]),se=f.useCallback((e=>{w&&w.call(void 0,{dragEvent:e,target:T.current})}),[w,T]),ce=f.useCallback((e=>{b&&b.call(void 0,{dragEvent:e,target:T.current})}),[b,T]),ie=f.useCallback((e=>{I&&I.call(void 0,{dragEvent:e,target:T.current})}),[I,T]);return n.useDraggable(R,{onPress:ae,onDrag:ne,onRelease:le}),n.useDraggable(A,{onPress:oe,onDrag:ce,onRelease:ie}),n.useDraggable(N,{onPress:oe,onDrag:se,onRelease:ie}),n.useDraggable(_,{onPress:oe,onDrag:se,onRelease:ie}),n.useDraggable(M,{onPress:oe,onDrag:ce,onRelease:ie}),f.createElement("div",{ref:R,id:e.id,style:V,tabIndex:H,className:W,role:"button","aria-label":K,onFocus:G,onBlur:B,onMouseUp:$,onMouseDown:U,onClick:Z,onMouseOver:q,onMouseOut:Y,onMouseEnter:j,onMouseLeave:X,onDoubleClick:Q,onKeyDown:ee,onKeyPress:te,onKeyUp:re,"data-group-index":e.group.index,"data-range-index":e.range.index},e.children,!e.resizeHint&&f.createElement("span",{className:"k-event-actions"},z.remove&&f.createElement("a",{tabIndex:-1,"aria-hidden":"true",className:"k-link k-event-delete",title:O,"aria-label":O,onClick:J},f.createElement(n.IconWrap,{name:"x",icon:d.xIcon})),e.head&&f.createElement(n.IconWrap,{name:"rtl"===x?"caret-alt-left":"caret-alt-right",icon:"rtl"===x?d.caretAltLeftIcon:d.caretAltRightIcon})),z.resize&&e.vertical&&f.createElement(f.Fragment,null,f.createElement("span",{className:"k-resize-handle k-resize-n",ref:_}),f.createElement("span",{className:"k-resize-handle k-resize-s",ref:M})),z.resize&&!e.vertical&&f.createElement(f.Fragment,null,f.createElement("span",{className:"k-resize-handle k-resize-w",ref:N}),f.createElement("span",{className:"k-resize-handle k-resize-e",ref:A})),e.resizeHint&&f.createElement(f.Fragment,null,f.createElement("div",{className:"k-marquee-color",style:{borderColor:P,backgroundColor:P}}),f.createElement("div",{className:"k-marquee-text"},!e.tail&&f.createElement("div",{className:"k-label-top"},L.formatDate(e.zonedStart,e.format)),!e.head&&f.createElement("div",{className:"k-label-bottom"},L.formatDate(e.zonedEnd,e.format)))))}));na.displayName="KendoReactSchedulerItem";const la=f.forwardRef(((e,t)=>{const r=f.useMemo((()=>n.classNames("k-event-template",e.className)),[e.className]);return f.createElement("div",{ref:t,...e,className:r})})),oa=(e,t)=>{const{element:r}=e;f.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=t[a][n]-l;w(r,{height:o},!0)}))}),t)},sa=f.forwardRef(((e,t)=>{const{item:r,_ref:a,itemRef:l,...s}=e,c=f.useRef(),i=f.useRef(null),u=f.useRef(null),m=f.useRef(null),p=Jr(e.editable);f.useImperativeHandle(u,(()=>({props:e,element:i.current&&i.current.element}))),f.useImperativeHandle(t,(()=>u.current)),f.useImperativeHandle(a,(()=>i.current)),f.useImperativeHandle(l,(()=>i.current));const g=r||ca.item,E=o.useInternationalization(),[h]=Vt(),[y]=Wt(),v=re(),[k,D]=f.useState(!0),[S,C]=f.useState(!1),I=f.useRef(0),R=n.useDir(v),x=f.useMemo((()=>e.isAllDay?E.toString(e.zonedStart,"t"):E.format("{0:t} - {1:t}",e.zonedStart,e.zonedEnd)),[E,e.isAllDay,e.zonedEnd,e.zonedStart]),A=f.useMemo((()=>`(${x}): ${e.title}`),[x,e.title]),N=(e,t)=>{let r=1;return e.forEach((e=>{const a=t.filter((t=>_(e.current.props,t.props)));a.length>r&&(r=a.length)})),r},_=(t,r)=>H(t.start,t.end,r.start,r.end)&&t.group.index===r.group.index&&t.range.index===r.range.index&&(e.ignoreIsAllDay||t.isAllDay===r.isAllDay),M=()=>{const t=(y||[]).filter((t=>t.current&&_(t.current.props,e)));if(0===t.length)return void D(!1);const r=T(t);if(!r.current||!i.current)return;const a=b(r.current.element);w(i.current.element,a)},z=()=>{const t=i.current&&i.current.element;if(!t)return;const r=(y||[]).filter((t=>t.current&&_(t.current.props,e))),a=[],n=[],l=[];(h||[]).forEach((e=>{e.current&&(e.current.props.dragHint?n.push(e.current):e.current.props.resizeHint?l.push(e.current):a.push(e.current))}));const o=e.dragHint||e.resizeHint?B(i.current,e.dragHint?n:l,r,e.ignoreIsAllDay):e.order||0;let s=e.dragHint||e.resizeHint?N(r,e.dragHint?n:l):N(r,a);const c=((e,t)=>e.map((e=>t.filter((t=>_(e.current.props,t.props))))))(r,a);let d=0;const u=b(t);if(c.forEach((r=>{let a=0;r.forEach((r=>{H(r.props.start,r.props.end,e.start,e.end)&&!e.dragHint&&!e.resizeHint&&r._maxSiblingsPerSlot&&r._maxSiblingsPerSlot>s&&r.element!==t&&(s=r._maxSiblingsPerSlot);const n=b(r.element);null!==r.props.order&&r.props.order<o&&(a=n.top+n.height-u.top-1*o+1)})),a>d&&(d=a)})),0===r.length)return void D(!1);const m=p.add?20:0;u.width=e.vertical?u.width/s-1-m/s:u.width*r.length-1,u.height=e.vertical?u.height*r.length-1:(e.resizeHint||e.dragHint)&&s<=1?u.height:e.style&&e.style.height?e.style.height:25,u.left=e.vertical?u.left+o*u.width+1*o:u.left,u.top=e.vertical?u.top:u.top+d+1*o,I.current=s,w(t,u),C(!0),D(!0)},L=f.useCallback((e=>{const t=e&&e[0],r=m.current;void 0!==c.current&&window.cancelAnimationFrame(c.current),r&&t&&(r.width!==t.contentRect.width||r.height!==t.contentRect.height)&&(c.current=window.requestAnimationFrame((()=>{M(),z()}))),m.current={width:t.contentRect.width,height:t.contentRect.height}}),[M,z]);f.useEffect(M),f.useEffect(z);const O=i.current&&i.current.element?i.current.element.closest(".k-scheduler-layout"):null;return oa({element:O,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:e.isLast}),f.useEffect((()=>{if(!v.current)return;const e=window.ResizeObserver,t=e&&new e(L);return t&&t.observe(v.current),()=>{t&&t.disconnect()}}),[L,v]),f.createElement(g,{...s,_ref:i,_maxSiblingsPerSlot:I,itemRef:i,style:{visibility:S?void 0:"hidden",display:k?void 0:"none",...e.style}},!e.resizeHint&&f.createElement("span",{className:"k-event-actions"},e.tail&&f.createElement(n.IconWrap,{name:"rtl"===R?"caret-alt-right":"caret-alt-left",icon:"rtl"===R?d.caretAltRightIcon:d.caretAltLeftIcon}),e.isRecurring&&!e.isException&&f.createElement(n.IconWrap,{name:"arrow-rotate-cw",icon:d.arrowRotateCwIcon}),!e.isRecurring&&e.isException&&f.createElement(n.IconWrap,{name:"arrows-no-repeat",icon:d.arrowsNoRepeatIcon})),!e.resizeHint&&f.createElement("div",{title:A},!e.isAllDay&&f.createElement(la,{className:"k-event-template k-event-time "},A),f.createElement(la,{className:"k-event-template"},e.title)))})),ca={item:na};sa.displayName="KendoReactSchedulerViewItem";const ia=(e,{dateRange:t,fields:r,timezone:a})=>e.map(da(r)).reduce(ua(t,a,r),[]).filter((e=>!O(e.dataItem,r))),da=e=>t=>({uid:n.getter(e.id||"id")(t),start:n.getter(e.start||"start")(t),startTimezone:n.getter(e.startTimezone||"startTimezone")(t),originalStart:n.getter(e.originalStart||"originalStart")(t),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:n.getter(e.recurrenceRule||"recurrenceRule")(t),recurrenceExceptions:n.getter(e.recurrenceExceptions||"recurrenceExceptions")(t),recurrenceId:n.getter(e.recurrenceId||"recurrenceId")(t),dataItem:n.clone(t)}),ua=(e,t,r)=>(a,n)=>[...a,...n.recurrenceRule&&(null===n.recurrenceId||void 0===n.recurrenceId)&&O(n.dataItem,r)?[...ma(n,{dateRange:e,timezone:t,fields:r})]:[n]],ma=(e,{dateRange:t,timezone:r,fields:l})=>{const o=e.recurrenceRule,s=y.parseRule({recurrenceRule:o});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=t.zonedStart,d=t.zonedEnd,u=y.expand(s,{rangeStart:i,rangeEnd:d});return u.events.length?u.events.map(((t,r)=>{const a=n.clone(e),o=n.clone(e.dataItem);return a.recurrenceId=a.uid,_(o,l.recurrenceId,e.uid),a.originalStart=t.start.toLocalDate(),_(o,l.originalStart,t.start.toLocalDate()),a.start=t.start.toLocalDate(),_(o,l.start,t.start.toLocalDate()),a.end=t.end.toLocalDate(),_(o,l.end,t.end.toLocalDate()),a.occurrenceId=String(r),_(o,"occurrenceId",String(r)),a.dataItem=o,a})):[]},pa=(e,{timezone:t},{groups:r,ranges:n})=>{const o=[];return l.orderBy(e,[{field:"start",dir:"asc"},{field:"end",dir:"desc"},{field:"isAllDay",dir:"desc"}]).forEach((e=>{r.forEach((l=>{const s=1===r.length?ga(e,l):l;ha(e,s)&&n.forEach((r=>{if(ya(e,r)){const n=f.createRef(),l=f.createRef(),c=r.end<e.end,i=e.start<r.start,d=a.ZonedDate.fromLocalDate(e.start,t),u=a.ZonedDate.fromLocalDate(e.end,t),m={...e,_ref:l,itemRef:n,head:c,tail:i,order:null,zonedStart:d,zonedEnd:u,group:s,range:r,slots:[],isRecurring:!!e.recurrenceRule,isException:!e.recurrenceRule&&null!==e.recurrenceId&&void 0!==e.recurrenceId,isAllDay:!!e.isAllDay};o.push(m)}}))}))})),o},ga=(e,t)=>({index:0,resources:t.resources.filter((t=>Ea(e,t)))}),Ea=(e,t)=>t.multiple?(e.dataItem[t.field]||[]).some((e=>t[t.valueField]===e)):e.dataItem[t.field]===t[t.valueField],ha=(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])),ya=(e,t)=>H(t.start,t.end,e.start,e.end)&&(void 0===t.isAllDay||!!e.isAllDay==!!t.isAllDay),va=e=>{const t=Pt(),{timezone:r}=ne(),a=ue(),n=ce(),l=pe(),[o]=Wt(),s=e.viewItem||fa.viewItem,c=f.useMemo((()=>ia([e.dataItem],{dateRange:l,fields:n,timezone:r})),[e.dataItem,l,n,r]),i=f.useMemo((()=>pa(c,{timezone:r},{groups:a,ranges:t})),[c,r,a,t]),d=(o||[]).map((e=>e.current.props));return Z(i,d),f.createElement(f.Fragment,null,i.map(((t,r)=>f.createElement(s,{key:r,...t,item:e.item,dragHint:!0,vertical:e.vertical,ignoreIsAllDay:e.ignoreIsAllDay}))))},fa={viewItem:sa,item:na};va.displayName="KendoReactSchedulerDrag";const ka=e=>{const t=Pt(),{timezone:r}=ne(),a=ue(),n=ce(),l=pe(),[o]=Wt(),s=e.viewItem||Da.viewItem,c=f.useMemo((()=>ia([e.dataItem],{dateRange:l,fields:n,timezone:r})),[e.dataItem,l.start.getTime(),l.end.getTime(),n,r]),i=f.useMemo((()=>pa(c,{timezone:r},{groups:a,ranges:t})),[c,r,a,t]),d=(o||[]).map((e=>e.current.props));return Z(i,d),f.createElement(f.Fragment,null,i.map(((t,r)=>{var a;return f.createElement(s,{key:r,...t,format:e.format,item:null!=(a=e.item)?a:Da.item,resizeHint:!0,vertical:e.vertical,ignoreIsAllDay:e.ignoreIsAllDay})})))},Da={viewItem:sa,item:na};ka.displayName="KendoReactSchedulerResize";const Sa=f.createContext([null]);Sa.displayName="SchedulerEditItemPropsContext";const Ca=f.createContext([null,n.noop,n.noop]);Ca.displayName="SchedulerEditItemFormItemContext";const ba=f.createContext([null,n.noop,n.noop]);ba.displayName="SchedulerEditItemDragItemContext";const Ia=f.createContext([null,n.noop,n.noop]);Ia.displayName="SchedulerEditItemResizeItemContext";const wa=f.createContext([null,n.noop,n.noop]);wa.displayName="SchedulerEditItemRemoveItemContext";const Ta=f.createContext([!1,n.noop,n.noop]);Ta.displayName="SchedulerEditItemShowRemoveDialogContext";const Ra=f.createContext([!1,n.noop,n.noop]);Ra.displayName="SchedulerEditItemShowOccurrenceDialogContext";const xa=({props:e,form:t,drag:r,resize:a,remove:n,showRemoveDialog:l,showOccurrenceDialog:o,children:s})=>f.createElement(Sa.Provider,{value:e},f.createElement(Ca.Provider,{value:t},f.createElement(ba.Provider,{value:r},f.createElement(Ia.Provider,{value:a},f.createElement(wa.Provider,{value:n},f.createElement(Ta.Provider,{value:l},f.createElement(Ra.Provider,{value:o},s)))))));var Aa=(e=>(e.set="FORM_ITEM_SET",e.setMaster="FORM_ITEM_SET_MASTER",e.reset="FORM_ITEM_RESET",e.complete="FORM_ITEM_COMPLETE",e))(Aa||{});var Na=(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))(Na||{});var _a=(e=>(e.set="REMOVE_ITEM_SET",e.reset="REMOVE_ITEM_RESET",e.complete="REMOVE_ITEM_COMPLETE",e))(_a||{});var Ma=(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))(Ma||{});var za=(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))(za||{});var La=(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))(La||{});var Oa=(e=>(e.reset="SERIES_RESET",e.set="SERIES_SET",e.toggle="SERIES_TOGGLE",e))(Oa||{});const Fa=(e,t,r)=>{const[a,n]=be(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)}]},Pa=f.forwardRef(((e,t)=>{const{_ref:r,itemRef:a,onDataAction:l,ignoreIsAllDay:o,viewItem:s,series:c,onSeriesChange:i,form:d,formItem:u,onFormItemChange:m,drag:p,dragItem:g,onDragItemChange:E,resize:h,resizeItem:y,onResizeItemChange:v,removeDialog:k,removeItem:D,onRemoveItemChange:S,occurrenceDialog:C,showOccurrenceDialog:b,onShowOccurrenceDialogChange:I,showRemoveDialog:w,onShowRemoveDialogChange:T,onFocus:R,onFocusAction:x,onMouseDown:M,onMouseDownAction:z,onMouseUp:O,onMouseUpAction:F,onClick:P,onClickAction:H,onDoubleClick:W,onDoubleClickAction:K,onRemoveClick:V,onRemoveClickAction:G,onPress:B,onPressAction:U,onDrag:Z,onDragAction:$,onRelease:q,onReleaseAction:Y,onResizePress:j,onResizePressAction:X,onResizeStartDrag:Q,onResizeStartDragAction:J,onResizeEndDrag:te,onResizeEndDragAction:re,onResizeRelease:ae,onResizeReleaseAction:ne,onOccurrenceClick:le,onOccurrenceClickAction:oe,onSeriesClick:se,onSeriesClickAction:ie,onKeyDown:de,onKeyDownAction:me,onKeyUp:pe,onKeyUpAction:ge,onRemoveConfirm:Ee,onRemoveConfirmAction:he,onFormSubmit:ye,onFormSubmitAction:ve,onCancel:ke,onCancelAction:De}={...Ha,...e},[Ce,Ie]=f.useState(e.tabIndex),we=f.useRef(null),Te=f.useRef(null),Re=n.useId();f.useImperativeHandle(we,(()=>({props:e,element:Te.current&&Te.current.element}))),f.useImperativeHandle(t,(()=>we.current)),f.useImperativeHandle(r,(()=>Te.current)),f.useImperativeHandle(a,(()=>Te.current));const xe=s||Ha.viewItem,Ae=p||Ha.drag,Ne=h||Ha.resize,_e=d||Ha.form,Me=C||Ha.occurrenceDialog,ze=k||Ha.removeDialog,Le=Jr(e.editable),[Oe,Fe]=Ut(),[Pe,,He]=Fa(null,c,i),[We,Ke,Ve]=((e,t)=>{const[r,a]=be(...t),l=ce(),[o]=fe();return[r,a,(t,s)=>{let c;switch(t.type){case"FORM_ITEM_SET":c=t.payload;break;case"FORM_ITEM_RESET":c=null;break;case"FORM_ITEM_SET_MASTER":c=n.clone(L(t.payload,l,o));break;case"FORM_ITEM_COMPLETE":e.onDataAction&&r&&(e.onDataAction.call(void 0,{type:ee.update,series:e.series,dataItem:t.payload}),c=null);break;default:c=r}a(c,s)}]})({series:Pe,onDataAction:l},[null,u,m]),[Ge,Be,Ue]=((e,t)=>{const r=f.useRef(0),a=f.useRef(0),l=f.useRef(0),o=f.useRef(null),[s,c]=be(...t),[i]=Ut(),d=ce(),u=ue();return[s,c,t=>{switch(t.type){case"DRAG_ITEM_SET":c(t.payload);break;case"DRAG_ITEM_RESET":c(null);break;case"DRAG_ITEM_DRAG_SELECTED":{if(Math.abs(a.current-t.payload.x)<10&&Math.abs(l.current-t.payload.y)<10)return;const r=A(t.payload.x,t.payload.y,7);if(!r||r===o.current)return;const s=n.clone(e.dataItem),u=r.getAttribute("data-slot-start"),m="true"===r.getAttribute("data-slot-allday");if(!e.ignoreIsAllDay&&m!==e.isAllDay)return;const p=new Date(N(s,d.start)),g=Number(u)-p.getTime(),E=i.map((e=>{if(!e.current)return null;const t=n.clone(e.current.props.dataItem),r=new Date(e.current.props.start.getTime()+g),a=new Date(e.current.props.end.getTime()+g);return _(t,d.start,r),_(t,d.end,a),t})).filter(Boolean);o.current=r,c([...E]);break}case"DRAG_ITEM_START":{const o=t.payload.x,s=t.payload.y;a.current=o,l.current=s;const c=A(o,s,7);if(!c)return;const i=n.clone(e.dataItem),u=c.getAttribute("data-slot-start"),m=N(i,d.start);if(null===u)return;r.current=Number(u)-new Date(m).getTime();break}case"DRAG_ITEM_DRAG":{if(Math.abs(a.current-t.payload.x)<10&&Math.abs(l.current-t.payload.y)<10)return;const s=A(t.payload.x,t.payload.y,7);if(!s||s===o.current)return;const i=n.clone(e.dataItem),m=s.getAttribute("data-slot-start"),p=s.getAttribute("data-slot-group"),g="true"===s.getAttribute("data-slot-allday");if(!e.ignoreIsAllDay&&g!==e.isAllDay)return;const E=new Date(N(i,d.start)),h=new Date(N(i,d.end)).getTime()-E.getTime(),y=new Date(Number(m)-Number(r.current)),v=new Date(Number(m)-Number(r.current)+h),f=u.find((e=>e.index===Number(p)));_(i,d.start,y),_(i,d.end,v),f&&u.length>1&&f.resources.forEach((e=>{e.multiple||_(i,e.field,e[e.valueField])})),o.current=s,i&&c(i);break}case"DRAG_ITEM_COMPLETE":c(null),e.onDataAction&&s&&e.onDataAction.call(void 0,{type:ee.update,series:!1,dataItem:s});break;case"DRAG_ITEM_COMPLETE_OCCURRENCE":{const t=Array.isArray(s)?s.slice():n.clone(s);c(null),e.onDataAction&&s&&e.onDataAction.call(void 0,{type:ee.update,series:!1,dataItem:t});break}case"DRAG_ITEM_COMPLETE_SERIES":{let t;if(Array.isArray(s))t=s.map((e=>{const t=n.clone(e);return _(t,d.start,N(e,d.start)),_(t,d.end,N(e,d.end)),t}));else{const e=n.clone(s);_(e,d.start,N(s,d.start)),_(e,d.end,N(s,d.end)),t=e}c(null),e.onDataAction&&t&&e.onDataAction.call(void 0,{type:ee.update,series:!0,dataItem:t});break}default:c(s)}}]})({dataItem:e.dataItem,ignoreIsAllDay:e.ignoreIsAllDay,isAllDay:e.isAllDay,onDataAction:l},[null,g,E]),[Ze,$e,qe]=((e,t)=>{const r=f.useRef(null),[a,l]=be(...t),[o]=Ut(),s=ce();return[a,l,(t,c)=>{let i=a;switch(t.type){case"RESIZE_ITEM_SET":i=t.payload;break;case"RESIZE_ITEM_RESET":default:i=null;break;case"RESIZE_ITEM_START":{if(c.stopPropagation(),!i)return;const a=t.payload.x,l=t.payload.y,o=A(a,l,7);if(!o||o===r.current)return;const d=o.getAttribute("data-slot-start"),u=new Date(Number(d)),m=n.clone(e.dataItem);if(u>=N(m,s.end))return;_(m,s.start,u),r.current=o,i=m;break}case"RESIZE_ITEM_START_DRAG_SELECTED":{c.stopPropagation();const a=t.payload.x,l=t.payload.y,d=n.clone(e.dataItem),u=A(a,l,7);if(!u||u===r.current)return;const m=u.getAttribute("data-slot-start"),p=new Date(N(d,s.start)),g=new Date(Number(m)).getTime()-p.getTime();let E=!1;const h=o.map((e=>{if(!e.current)return null;const t=n.clone(e.current.props.dataItem),r=new Date(e.current.props.start.getTime()+g);if(!(r>=N(t,s.end)))return _(t,s.start,r),t;E=!0})).filter(Boolean);E||(i=[...h]);break}case"RESIZE_ITEM_START_DRAG":{const a=t.payload.x,l=t.payload.y,o=A(a,l,7);if(!o||o===r.current)return;const c=o.getAttribute("data-slot-start"),d=new Date(Number(c)),u=n.clone(e.dataItem);if(d>=u.end)return;_(u,s.start,d),r.current=o,i=u;break}case"RESIZE_ITEM_END_DRAG":{const a=t.payload.x,l=t.payload.y,o=A(a,l,7);if(!o||o===r.current)return;const c=o.getAttribute("data-slot-end"),d=new Date(Number(c)),u=n.clone(e.dataItem);if(d<=u.start)return;_(u,s.end,d),r.current=o,i=u;break}case"RESIZE_ITEM_END_DRAG_SELECTED":{c.stopPropagation();const a=t.payload.x,l=t.payload.y,d=n.clone(e.dataItem),u=A(a,l,7);if(!u||u===r.current)return;const m=u.getAttribute("data-slot-start"),p=new Date(N(d,s.end)),g=new Date(Number(m)).getTime()-p.getTime();let E;const h=o.map((e=>{if(!e.current)return null;const t=n.clone(e.current.props.dataItem),r=new Date(e.current.props.end.getTime()+g);if(!(r<=N(t,s.start)))return _(t,s.end,r),t;E=!0})).filter(Boolean);E||(i=[...h]);break}case"RESIZE_ITEM_COMPLETE":case"RESIZE_ITEM_COMPLETE_OCCURRENCE":i=null,e.onDataAction&&a&&e.onDataAction.call(void 0,{type:ee.update,series:!1,dataItem:a});break;case"RESIZE_ITEM_COMPLETE_SERIES":{let t;if(i=null,Array.isArray(a))t=a.map((e=>{const t=n.clone(e);return _(t,s.start,N(e,s.start)),_(t,s.end,N(e,s.end)),t}));else{const e=n.clone(a);_(e,s.start,N(a,s.start)),_(e,s.end,N(a,s.end)),t=e}e.onDataAction&&t&&e.onDataAction.call(void 0,{type:ee.update,series:!0,dataItem:t});break}}l(i)}]})({dataItem:e.dataItem,onDataAction:l},[null,y,v]),[Ye,je,Xe]=((e,t)=>{const[r,a]=be(...t);return[r,a,t=>{let n;switch(t.type){case"REMOVE_ITEM_SET":n=t.payload;break;case"REMOVE_ITEM_RESET":n=null;break;case"REMOVE_ITEM_COMPLETE":e.onDataAction&&r&&e.onDataAction.call(void 0,{type:ee.remove,series:e.series,dataItem:r}),n=null;break;default:n=r}a(n)}]})({series:Pe,onDataAction:l},[null,D,S]),[Qe,Je,et]=((e,t,r)=>{const[a,n]=be(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,w,T),[tt,rt,at]=((e,t,r)=>{const[a,n]=be(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,b,I),[nt]=Vt(),[,lt]=f.useContext(Zt),[,ot]=qt(),st=!!(Te.current&&Oe&&Oe.some((e=>e.current===Te.current))),ct=f.useMemo((()=>({selected:st,series:Pe,formItem:We,dragItem:Ge,resizeItem:Ze,removeItem:Ye,showRemoveDialog:Qe,showOccurrenceDialog:tt})),[Ge,We,Ye,Ze,st,Pe,tt,Qe]),it=f.useMemo((()=>({[Oa.set]:He,[Oa.toggle]:He,[Oa.reset]:He,[jt.select]:Fe,[jt.add]:Fe,[jt.remove]:Fe,[jt.reset]:Fe,[jt.selectNext]:Fe,[jt.selectPrev]:Fe,[Aa.set]:Ve,[Aa.setMaster]:Ve,[Aa.reset]:Ve,[Aa.complete]:Ve,[_a.set]:Xe,[_a.reset]:Xe,[_a.complete]:Xe,[Na.close]:at,[Na.open]:at,[Na.set]:at,[Na.toggle]:at,[Na.reset]:at,[Ma.close]:et,[Ma.open]:et,[Ma.set]:et,[Ma.toggle]:et,[Ma.reset]:et,[za.start]:Ue,[za.drag]:Ue,[za.complete]:Ue,[za.completeOccurrence]:Ue,[za.completeSeries]:Ue,[za.set]:Ue,[za.reset]:Ue,[za.dragSelected]:Ue,[La.start]:qe,[La.startDrag]:qe,[La.startDragSelected]:qe,[La.endDrag]:qe,[La.endDragSelected]:qe,[La.complete]:qe,[La.completeOccurrence]:qe,[La.completeSeries]:qe,[La.set]:qe,[La.reset]:qe,[Jt.next]:lt,[Jt.prev]:lt,[er.left]:ot,[er.right]:ot,[er.up]:ot,[er.down]:ot,null:()=>{}})),[Ue,Ve,Fe,Xe,qe,He,at,et,lt,ot]),dt=f.useCallback((t=>{if(x){const r=x(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t))):it[r.type]({...r,item:Te}))}R&&R.call(void 0,t)}),[it,R,x,e,ct]),ut=f.useCallback((t=>{if(z){const r=z(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t))):it[r.type]({...r,item:Te}))}M&&M.call(void 0,t)}),[it,M,z,e,ct]),mt=f.useCallback((t=>{if(F){const r=F(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t))):it[r.type]({...r,item:Te}))}O&&O.call(void 0,t)}),[it,O,F,e,ct]),[,pt]=f.useContext(Se),gt=f.useCallback((t=>{if(H){pt(Te.current);const r=H(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t))):it[r.type]({...r,item:Te}))}P&&P.call(void 0,t)}),[it,P,H,e,ct]),Et=f.useCallback((t=>{if(K){const r=K(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t))):it[r.type]({...r,item:Te}))}W&&W.call(void 0,t)}),[K,W,e,it,ct]),ht=f.useCallback((t=>{if(G){const r=G(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t))):it[r.type]({...r,item:Te}))}V&&V.call(void 0,t)}),[G,V,e,it,ct]),yt=f.useCallback((t=>{if(U){const r=U(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t))):it[r.type]({...r,item:Te},t))}B&&B.call(void 0,t)}),[U,B,e,it,ct]),vt=f.useCallback((t=>{if($){const r=$(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t.dragEvent.originalEvent))):it[r.type]({...r,item:Te},t.dragEvent.originalEvent))}Z&&Z.call(void 0,t)}),[$,Z,e,it,ct]),ft=f.useCallback((t=>{if(Y){const r=Y(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t.dragEvent.originalEvent))):it[r.type]({...r,item:Te},t.dragEvent.originalEvent))}q&&q.call(void 0,t)}),[Y,q,e,it,ct]),kt=f.useCallback((t=>{if(X){const r=X(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t.dragEvent.originalEvent))):it[r.type]({...r,item:Te},t.dragEvent.originalEvent))}j&&j.call(void 0,t)}),[X,j,e,ct,it]),Dt=f.useCallback((t=>{if(J){const r=J(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t.dragEvent.originalEvent))):it[r.type]({...r,item:Te},t.dragEvent.originalEvent))}Q&&Q.call(void 0,t)}),[Q,J,e,it,ct]),St=f.useCallback((t=>{if(re){const r=re(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t.dragEvent.originalEvent))):it[r.type]({...r,item:Te},t.dragEvent.originalEvent))}te&&te.call(void 0,t)}),[te,re,e,it,ct]),Ct=f.useCallback((t=>{if(ne){const r=ne(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t.dragEvent.originalEvent))):it[r.type]({...r,item:Te},t.dragEvent.originalEvent))}ae&&ae.call(void 0,t)}),[ne,ae,e,it,ct]),bt=f.useCallback((t=>{if(ve){const r=ve(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t))):it[r.type]({...r,item:Te},t))}ye&&ye.call(void 0,t)}),[ve,ye,e,ct,it]),It=f.useCallback((t=>{if(De){const r=De(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t))):it[r.type]({...r,item:Te},t))}ke&&ke.call(void 0,t)}),[De,ke,e,ct,it]),wt=f.useCallback((t=>{if(oe){const r=oe(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t))):it[r.type]({...r,item:Te},t))}le&&le.call(void 0,t)}),[oe,le,e,ct,it]),Tt=f.useCallback((t=>{if(ie){const r=ie(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t))):it[r.type]({...r,item:Te},t))}se&&se.call(void 0,t)}),[ie,se,e,ct,it]),Rt=f.useCallback((t=>{if(me){const r=me(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t.syntheticEvent))):it[r.type]({...r,item:Te},t.syntheticEvent))}de&&de.call(void 0,t)}),[me,de,e,ct,it]),xt=f.useCallback((t=>{if(ge){const r=ge(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t.syntheticEvent))):it[r.type]({...r,item:Te},t.syntheticEvent))}pe&&pe.call(void 0,t)}),[ge,pe,e,ct,it]),At=f.useCallback((t=>{if(he){const r=he(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t.syntheticEvent))):it[r.type]({...r,item:Te},t.syntheticEvent))}Ee&&Ee.call(void 0,t)}),[he,Ee,e,ct,it]);return f.useEffect((()=>{const t=nt.length&&nt[0].current===Te.current;Ie(void 0!==e.tabIndex?null===e.tabIndex?void 0:e.tabIndex:0===Oe.length&&t?0:void 0)}),[nt,e.tabIndex,Oe.length]),f.createElement(xa,{props:e,form:[We,Ke,Ve],drag:[Ge,Be,Ue],resize:[Ze,$e,qe],remove:[Ye,je,Xe],showRemoveDialog:[Qe,Je,et],showOccurrenceDialog:[tt,rt,at]},f.createElement(xe,{...e,_ref:Te,itemRef:Te,selected:st,tabIndex:Ce,id:Re,onKeyDown:Rt,onKeyUp:xt,onFocus:dt,onMouseUp:mt,onMouseDown:ut,onClick:gt,onDoubleClick:Et,onRemoveClick:ht,onPress:yt,onDrag:vt,onRelease:ft,onResizePress:kt,onResizeEndDrag:St,onResizeStartDrag:Dt,onResizeRelease:Ct}),Ge&&Le.drag&&(Array.isArray(Ge)?Ge.map(((t,r)=>f.createElement(Ae,{key:r,ignoreIsAllDay:o,dataItem:t,vertical:e.vertical,viewItem:xe,item:e.item}))):f.createElement(Ae,{ignoreIsAllDay:o,dataItem:Ge,vertical:e.vertical,viewItem:xe,item:e.item})),Ze&&Le.resize&&(Array.isArray(Ze)?Ze.map(((t,r)=>f.createElement(Ne,{key:r,format:e.format,ignoreIsAllDay:o,dataItem:t,viewItem:e.viewItem,item:e.item,vertical:e.vertical}))):f.createElement(Ne,{format:e.format,ignoreIsAllDay:o,dataItem:Ze,viewItem:e.viewItem,item:e.item,vertical:e.vertical})),We&&!tt&&Le.edit&&f.createElement(_e,{dataItem:We,onSubmit:bt,onClose:It,onCancel:It}),tt&&f.createElement(Me,{dataItem:We||Ge||Ze||Ye,isRemove:null!==Ye,onClose:It,onOccurrenceClick:wt,onSeriesClick:Tt}),Qe&&Ye&&Le.remove&&f.createElement(ze,{dataItem:Ye,onClose:It,onCancel:It,onConfirm:At}))})),Ha={viewItem:sa,drag:va,resize:ka,form:Br,occurrenceDialog:ra,removeDialog:aa,onClickAction:(e,t,r)=>[{type:e.syntheticEvent.metaKey||e.syntheticEvent.ctrlKey?!r.selected||r.dragItem||r.resizeItem?jt.add:jt.remove:jt.select}],onDoubleClickAction:(e,t)=>t.editable?[{type:Aa.set,payload:t.dataItem},t.isRecurring&&{type:Na.open}].filter(Boolean):[],onRemoveClickAction:(e,t)=>t.editable?[{type:_a.set,payload:t.dataItem},t.isRecurring?{type:Na.open}:{type:Ma.open}]:[],onPressAction:(e,t)=>t.editable?{type:za.start,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onDragAction:(e,t)=>t.editable?{type:e.dragEvent.originalEvent.metaKey||e.dragEvent.originalEvent.ctrlKey?za.dragSelected:za.drag,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onReleaseAction:(e,t,r)=>t.editable&&r.dragItem?t.isRecurring&&!t.isException&&null===r.series?{type:Na.open}:{type:t.isRecurring?r.series?za.completeSeries:za.completeOccurrence:za.complete,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onResizePressAction:(e,t)=>t.editable?{type:La.start,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onResizeStartDragAction:(e,t)=>t.editable?{type:e.dragEvent.originalEvent.metaKey||e.dragEvent.originalEvent.ctrlKey?La.startDragSelected:La.startDrag,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onResizeEndDragAction:(e,t)=>t.editable?{type:e.dragEvent.originalEvent.metaKey||e.dragEvent.originalEvent.ctrlKey?La.endDragSelected:La.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:Na.open}:{type:t.isRecurring?r.series?La.completeSeries:La.completeOccurrence:La.complete,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onOccurrenceClickAction:(e,t,r)=>r.dragItem?[{type:za.completeOccurrence},{type:Na.close}]:r.resizeItem?[{type:La.completeOccurrence},{type:Na.close}]:r.formItem?[{type:Oa.set,payload:!1},{type:Aa.set,payload:t.dataItem},{type:Na.close}]:r.removeItem?[{type:Oa.set,payload:!1},{type:_a.set,payload:t.dataItem},{type:Ma.open},{type:Na.close}]:[],onSeriesClickAction:(e,t,r)=>r.dragItem?[{type:za.completeSeries},{type:Na.close}]:r.resizeItem?[{type:La.completeSeries},{type:Na.close}]:r.formItem?[{type:Oa.set,payload:!0},{type:Aa.setMaster,payload:t.dataItem},{type:Na.close}]:r.removeItem?[{type:Oa.set,payload:!0},{type:_a.set,payload:t.dataItem},{type:Ma.open},{type:Na.close}]:[],onKeyDownAction:(e,t)=>{switch(e.syntheticEvent.keyCode){case n.Keys.enter:return[{type:Aa.set,payload:t.dataItem},t.isRecurring&&{type:Na.open}];case n.Keys.tab:return[{type:e.syntheticEvent.shiftKey?Jt.prev:Jt.next,ignoreIsAllDay:t.ignoreIsAllDay},{type:e.syntheticEvent.shiftKey?jt.selectPrev:jt.selectNext,ignoreIsAllDay:t.ignoreIsAllDay}];case n.Keys.up:return[!(!t.slots.length||!t.slots[0]._ref.current)&&{type:er.up,slot:t.slots[0]._ref}];case n.Keys.right:return[!(!t.slots.length||!t.slots[0]._ref.current)&&{type:er.right,slot:t.slots[0]._ref}];case n.Keys.down:return[!(!t.slots.length||!t.slots[t.slots.length-1]._ref.current)&&{type:er.down,slot:t.slots[t.slots.length-1]._ref}];case n.Keys.left:return[!(!t.slots.length||!t.slots[0]._ref.current)&&{type:er.left,slot:t.slots[0]._ref}];default:return}},onFormSubmitAction:e=>[{type:Aa.complete,payload:e.value}],onRemoveConfirmAction:()=>[{type:_a.complete},{type:Na.close}],onCancelAction:()=>[{type:Oa.reset},{type:_a.reset},{type:Aa.reset},{type:za.reset},{type:La.reset},{type:Ma.reset},{type:Na.reset}]};Pa.displayName="KendoReactSchedulerEditItem";const Wa=e=>{const[t,r]=f.useState(!1),l=re(),o=ne(),s=f.useRef(void 0),c=f.useRef(null),i=f.useRef(null),d=e.updateInterval||Ka.updateInterval,[,u]=f.useState(!1),m=n.useDir(i,!0===o.rtl?"rtl":void 0),[p]=Wt(),g=f.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?H(new Date,new Date,t.current.props.start,t.current.props.end,!0):K(new Date,t.current.props.start,t.current.props.end))&&!t.current.props.isAllDay));if(t&&t.length&&c.current&&i.current){const n=T(t);if(!n.current)return;const l=e.vertical?(e=>{let t=0;return e.forEach((e=>{if(e.current){const r=b(e.current.element);t+=r.height}})),t})(t):(e=>{let t=0;return e.forEach((e=>{if(e.current){const r=b(e.current.element);t+=r.width}})),t})(t),o=b(n.current.element),s=b(c.current),d=(e.vertical?o.width:o.height)/(n.current.props.end.getTime()-n.current.props.start.getTime()),u=(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())*d,p="rtl"===m,g=e.vertical?o.top:o.top+u-s.height/2,E=p?"right":"left",h=e.vertical?o[E]+u-s.width/2:o[E];e.vertical?c.current.style[E]=`${h}px`:c.current.style.top=`${g}px`,i.current.style[E]=`${h}px`,i.current.style.top=`${g}px`,i.current.style[e.vertical?"height":"width"]=l-1+"px",r(!0)}else r(!1)}),[p,e.groupIndex,e.vertical,m]),E=f.useCallback((()=>{g(),u((e=>!e))}),[g]);f.useEffect((()=>{if(!l.current||!window)return;clearInterval(s.current),s.current=window.setInterval(E,d);const e=window.ResizeObserver,t=e&&new e(E);return t&&t.observe(l.current),()=>{clearInterval(s.current),t&&t.disconnect()}}),[g,E,l,d]),f.useEffect(g);const h=f.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 f.createElement(f.Fragment,null,e.attachArrow&&e.attachArrow.current?k.createPortal(h,e.attachArrow.current):h,f.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"}}))},Ka={updateInterval:6e4},Va=f.forwardRef(((e,t)=>{const{as:r=Ga.as,...a}=e,l=f.useRef(null),s=f.useRef(null),c=o.useInternationalization(),i=f.useMemo((()=>n.classNames("k-scheduler-cell k-heading-cell",e.className)),[e.className]);return f.useImperativeHandle(s,(()=>({element:l.current&&l.current.element?l.current.element:l.current,props:e}))),f.useImperativeHandle(t,(()=>s.current)),f.createElement(r,{ref:r!==Ga.as?void 0:l,...a,className:i},f.createElement("span",{className:"k-link k-nav-day"},c.formatDate(e.date,e.format?e.format:Ga.format)))})),Ga={as:f.forwardRef((({as:e,format:t,start:r,end:a,...n},l)=>f.createElement("div",{...n,ref:l}))),format:"d"};Va.displayName="KendoReactSchedulerDateHeaderCell";const Ba=(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},Ua=(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,d=s<0?s*j*-1:0;c.getTime()<o.getTime();i++,c=c.addTime(t)){const n=f.createRef(),o=c.clone(),s=c.addTime(t),u=(s.timezoneOffset-o.timezoneOffset)*j,m=t<=Math.abs(u);d&&m&&(d-=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)}}))})),l},Za=f.createElement("div",{className:"k-scheduler-cell k-side-cell"}),$a=e=>{const{group:t,timezone:r,resources:l}=ne(),s=o.useInternationalization(),c=e.editItem||Pa,i=e.editSlot||ea,d=e.showWorkHours,u=e.numberOfDays||qa.numberOfDays,m=e.slotDivisions||qa.slotDivisions,p=e.slotDuration||qa.slotDuration,g=e.workWeekStart||qa.workWeekStart,E=e.workWeekEnd||qa.workWeekEnd,h=!1!==e.currentTimeMarker&&qa.currentTimeMarker,y=s.parseDate(e.workDayStart||e.isWorkDayStart||qa.isWorkDayStart),v=s.parseDate(e.workDayEnd||e.isWorkDayEnd||qa.isWorkDayEnd),k=s.parseDate(e.startTime||qa.startTime),D=s.parseDate(e.endTime||qa.endTime),[S]=fe(),C=ue(),b=Ee(),I=ce(),w=pe(),x=f.useMemo((()=>d?y:k),[d,y,k]),A=f.useMemo((()=>d?v:D),[d,v,D]),N=f.useMemo((()=>Ba(w,{step:a.MS_PER_DAY*u,timezone:r}).map((e=>({...e,isAllDay:!0})))),[w.start.getTime(),w.end.getTime(),u]),_=f.useMemo((()=>Ba(w,{step:a.MS_PER_DAY,timezone:r}).map((e=>({...e,isAllDay:!1})))),[w.start.getTime(),w.end.getTime(),r]),M=f.useMemo((()=>Ua(0,{step:a.MS_PER_DAY},{groups:C,ranges:N})),[w.start.getTime(),w.end.getTime(),r,N,C]),z=f.useMemo((()=>Ua(0,{step:p*j/m},{groups:C,ranges:_}).filter((e=>A.getTime()===x.getTime()||K(e.zonedStart,x,A)))),[w.start.getTime(),w.end.getTime(),p,m,x.getTime(),A.getTime(),C,_]),L=f.useMemo((()=>ia(S,{dateRange:w,fields:I,timezone:r})),[S,w.start.getTime(),w.end.getTime(),I,r]),O=f.useMemo((()=>L.filter((e=>e.isAllDay))),[L]),F=f.useMemo((()=>L.filter((e=>!e.isAllDay))),[L]),P=f.useMemo((()=>pa(O,{timezone:r},{groups:C,ranges:N})),[L,r,C,N]),W=f.useMemo((()=>pa(F,{timezone:r},{groups:C,ranges:_}).filter((e=>x.getTime()===A.getTime()||K(e.zonedStart,x,A)||K(e.zonedEnd,x,A)||K(new Date(e.zonedEnd.getTime()-(e.zonedEnd.getTime()-e.zonedStart.getTime())/2),x,A)))),[L,r,C,_,x.getTime(),A.getTime()]);f.useMemo((()=>Z(P,M,!1)),[P,M]),f.useMemo((()=>U(P,M,!1)),[P,M]),f.useMemo((()=>Z(W,z,!1)),[W,z]),f.useMemo((()=>U(W,z,!1)),[W,z]);const G=f.createElement(or.Consumer,null,(({groupIndex:t})=>f.createElement("div",{className:"k-scheduler-row",key:t},_.map(((t,n)=>f.createElement(Va,{as:e.dateHeaderCell,key: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:"MEd"}})))))),B=f.createElement(or.Consumer,null,(({groupIndex:t})=>f.createElement("div",{key:t,className:"k-scheduler-row"},N.map(((r,a)=>M.filter((e=>e.group.index===t&&e.range.index===a)).map(((r,a,n)=>f.createElement(i,{...r,onDataAction:e.onDataAction,form:e.form,slot:e.slot,viewSlot:e.viewSlot,key:`${r.start.getTime()}:${r.group.index}`,row:0,col:"horizontal"===b?n.length*(t||0)+a:a,isWorkDay:0<=r.zonedStart.getDay()+(u-g)&&(r.zonedStart.getDay()+(u-g))%u<=E+(u-g),expandable:!0})))))))),$=f.useMemo((()=>n.classNames("week"===e.name?"k-scheduler-weekview":"k-scheduler-dayview",e.className)),[e.className]);return f.createElement(lr,{id:e.id,props:e,style:e.style,className:$,ranges:[...N,..._],slots:[...M,...z]},f.createElement("div",{className:"k-scheduler-head"},"horizontal"===b?f.createElement(f.Fragment,null,f.createElement(sr,{nested:!0,group:t,resources:l,rowContent:ur,childRowContent:ur},G),f.createElement(sr,{group:t,resources:l,rowContent:kr,childRowContent:kr},B),P.map((t=>f.createElement(c,{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})))):f.createElement(mr,{group:t,resources:l,cellContent:Za},G)),f.createElement("div",{className:"k-scheduler-body"},"horizontal"===b?f.createElement(f.Fragment,null,z.filter((e=>0===e.group.index&&0===e.range.index)).map(((r,a)=>f.createElement(f.Fragment,{key:r.index},f.createElement(sr,{nested:!1,group:t,resources:l,rowContent:Cr,rowContentProps:{timeHeaderCell:e.timeHeaderCell,isMaster:a%m==0,isLast:(a+1)%m==0,slot:r}},f.createElement(or.Consumer,null,(({groupIndex:t})=>f.createElement("div",{className:n.classNames("k-scheduler-row",{"k-middle-row":(a+1)%m!=0})},_.map(((n,l)=>z.filter((e=>e.index===r.index&&e.range.index===l&&e.group.index===t)).map((r=>f.createElement(i,{key:`${r.start.getTime()}:${r.group.index}`,...r,onDataAction:e.onDataAction,slot:e.slot,viewSlot:e.viewSlot,form:e.form,row:a+1,col:_.length*(t||0)+l,isWorkHour:K(r.zonedStart,y,v),isWorkDay:V(r.zonedEnd.getDay(),g,E),editable:e.editable})))))))))))),!1!==h&&H(T(_).start,R(_).end,new Date,new Date,!0)&&f.createElement(Wa,null)):f.createElement(f.Fragment,null,f.createElement(mr,{nested:!0,group:t,resources:l},f.createElement(or.Consumer,null,(({groupIndex:t})=>f.createElement(f.Fragment,{key:t},f.createElement("div",{className:"k-scheduler-row"},f.createElement(kr,{groupIndex:t},N.map(((r,a)=>{const n=z.filter((e=>e.group.index===t&&0===e.range.index)).length;return M.filter((e=>e.group.index===t&&e.range.index===a)).map(((r,a)=>f.createElement(i,{slot:e.slot,viewSlot:e.viewSlot,form:e.form,...r,onDataAction:e.onDataAction,key:`${r.start.getTime()}:${r.group.index}`,className:"k-scheduler-alldays-slot",row:n*(t||0)+1*(t||0),col:a,expandable:!0})))})))),z.filter((e=>e.group.index===t&&0===e.range.index)).map(((r,a,n)=>f.createElement("div",{className:"k-scheduler-row",key:r.index},f.createElement(Cr,{slot:r,isMaster:a%m==0,isLast:(a+1)%m==0,timeHeaderCell:e.timeHeaderCell},_.map(((l,o)=>z.filter((e=>e.index===r.index&&e.group.index===t&&e.range.index===o)).map((r=>f.createElement(i,{slot:e.slot,viewSlot:e.viewSlot,form:e.form,onDataAction:e.onDataAction,...r,key:`${r.start.getTime()}:${r.group.index}`,row:n.length*(t||0)+a+1*(t||0)+1,col:o,editable:e.editable,isWorkHour:K(r.zonedStart,y,v),isWorkDay:0<=r.zonedStart.getDay()+(u-g)&&(r.zonedStart.getDay()+(u-g))%u<=E+(u-g)}))))))))),!1!==h&&H(T(_).start,R(_).end,new Date,new Date,!0)&&f.createElement(Wa,{groupIndex:t}))))),P.map((t=>f.createElement(c,{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})))),W.map((t=>f.createElement(c,{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})))))},qa={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(z(l),r),c=a.ZonedDate.fromUTCDate(z(o),r);return{start:new Date(s.getTime()),end:new Date(c.getTime()),zonedStart:s,zonedEnd:c}},selectedDateFormat:"{0:D} - {1:D}",selectedShortDateFormat:"{0:d} - {1:d}",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};$a.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},$a.displayName="KendoReactSchedulerMultiDayView";const Ya=e=>f.createElement($a,{...e}),ja={...qa,name:"day",title:e=>e.toLanguageString(Oe,Nt[Oe]),numberOfDays:1,slotDuration:60,slotDivisions:2,selectedDateFormat:"{0:D}",selectedShortDateFormat:"{0:d}"};Ya.displayName="KendoReactSchedulerDayView";const Xa={name:"@progress/kendo-react-scheduler",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:1607496606,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui"},Qa=f.forwardRef(((e,t)=>{const{_ref:r,onRemoveClick:a}=e,l=f.useRef(null),s=f.useRef(null);f.useImperativeHandle(l,(()=>({props:e,element:s.current}))),f.useImperativeHandle(t,(()=>l.current)),f.useImperativeHandle(r,(()=>l.current));const c=Jr(e.editable),i=o.useLocalization().toLanguageString(Pe,Nt[Pe]),u=e.group.resources.find((e=>!(!e.colorField||void 0===e[e.colorField]))),m=u&&u.colorField&&u[u.colorField],p=f.useCallback((e=>{a&&a.call(void 0,{syntheticEvent:e,target:l.current})}),[a,l]),g=f.useMemo((()=>n.classNames("k-task",e.className)),[e.className]);return f.createElement("div",{id:e.id,ref:s,style:e.style,className:g,tabIndex:e.tabIndex||void 0},m&&f.createElement("span",{className:"k-scheduler-mark",style:{color:m,backgroundColor:m}}),e.isRecurring&&f.createElement(n.IconWrap,{name:"arrow-rotate-cw",icon:d.arrowRotateCwIcon}),e.isException&&f.createElement(n.IconWrap,{name:"arrows-no-repeat",icon:d.arrowsNoRepeatIcon}),e.title,c.remove&&f.createElement("a",{className:"k-link k-event-delete",title:i,"aria-label":i,onClick:p},f.createElement(n.IconWrap,{name:"x",icon:d.xIcon})))}));Qa.displayName="KendoReactSchedulerTask";const Ja=f.forwardRef(((e,t)=>{const{task:r,_ref:a,...n}=e,l=f.useRef(null),o=f.useRef(null);f.useImperativeHandle(o,(()=>({props:e,element:l.current&&l.current.element}))),f.useImperativeHandle(a,(()=>l.current)),f.useImperativeHandle(t,(()=>o.current));const s=r||en.task;return f.createElement(s,{...n,_ref:l})})),en={task:Qa};Ja.displayName="KendoReactSchedulerViewTask";const tn=f.createContext([null]),rn=f.createContext([!1]),an=f.createContext([!1]),nn=e=>f.createElement(tn.Provider,{value:e.remove},f.createElement(rn.Provider,{value:e.showRemoveDialog},f.createElement(an.Provider,{value:e.showOccurrenceDialog},e.children))),ln=f.forwardRef(((e,t)=>{const{_ref:r,onDataAction:a,viewTask:n,removeDialog:l,removeItem:o,onRemoveItemChange:s,occurrenceDialog:c,showOccurrenceDialog:i,onShowOccurrenceDialogChange:d,showRemoveDialog:u,onShowRemoveDialogChange:m,...p}=e,g=f.useRef(null);f.useImperativeHandle(g,(()=>({props:e,element:g.current&&g.current.element}))),f.useImperativeHandle(r,(()=>g.current)),f.useImperativeHandle(t,(()=>g.current));const E=n||on.viewTask,h=c||on.occurrenceDialog,y=l||on.removeDialog,v=Jr(e.editable),k=ce(),[D,S]=fe(),[C,b]=f.useState(null),[I,w]=be(null,o,s),[T,R]=be(!1,u,m),[x,A]=be(!1,i,d),N=f.useCallback((t=>{v.remove&&(w(e.dataItem,t),e.isRecurring?A(!0,t):R(!0,t))}),[w,e.dataItem,e.isRecurring,A,R]),_=f.useCallback((e=>{b(null),w(null,e),R(!1,e),A(!1,e)}),[b,w,R,A]),M=f.useCallback((e=>{a&&I&&a.call(void 0,{type:ee.remove,series:C,dataItem:I}),w(null,e),R(!1,e)}),[I,S,R]),z=f.useCallback(((e,t)=>{w&&w(e,t)}),[w]),O=f.useCallback(((e,t)=>{R&&R(e,t)}),[R]),F=f.useCallback(((e,t)=>{A&&A(e,t)}),[A]),P=f.useCallback((t=>{I&&(b(!1),w(e.dataItem,t),R(!0,t)),A(!1,t)}),[b,e.dataItem,I,w,R]),H=f.useCallback((e=>{if(I){b(!0);const t=L(I,k,D);w(t,e),R(!0,e)}A(!1,e)}),[k,I,b,w,R,A]);return f.createElement(nn,{remove:[I,z],showRemoveDialog:[T,O],showOccurrenceDialog:[x,F]},f.createElement(E,{_ref:g,...p,onRemoveClick:N}),x&&f.createElement(h,{dataItem:I,isRemove:null!==I,onClose:_,onOccurrenceClick:P,onSeriesClick:H}),T&&f.createElement(y,{dataItem:I,onClose:_,onCancel:_,onConfirm:M}))})),on={viewTask:Ja,occurrenceDialog:ra,removeDialog:aa};ln.displayName="KendoReactSchedulerEditTask";const sn=e=>{const{group:t,timezone:r,resources:l}=ne(),s=e.editTask||ln,c=e.editSlot||ea,i=f.useRef(null),u=n.useDir(i),m=o.useInternationalization(),p=o.useLocalization(),[g]=fe(),E=ue(),h=ce(),y=pe(),v=f.useMemo((()=>Ba(y,{step:a.MS_PER_DAY,timezone:r})),[y.start.getTime(),y.end.getTime(),r]),k=f.useMemo((()=>Ua(0,{step:a.MS_PER_DAY},{groups:E,ranges:v})),[y.start.getTime(),y.end.getTime(),r,E,v]),D=f.useMemo((()=>ia(g,{dateRange:y,fields:h,timezone:r})),[g,y.start.getTime(),y.end.getTime(),h,r]),S=f.useMemo((()=>pa(D,{timezone:r},{groups:E,ranges:v})),[D,r,E,v]),C=f.useMemo((()=>n.classNames("k-scheduler-agendaview",e.className)),[e.className]);return Qt({element:i,selector:".k-scheduler-datecolumn",explicitDepth:!1}),Qt({element:i,selector:".k-scheduler-timecolumn",explicitDepth:!1}),f.useMemo((()=>Z(S,k,!0)),[S,k]),f.useMemo((()=>U(S,k,!0)),[S,k]),f.createElement(lr,{ref:i,id:e.id,style:e.style,className:C,props:e,slots:S,ranges:v},f.createElement("div",{className:"k-scheduler-head"},f.createElement(mr,{resources:l,group:t},f.createElement(or.Consumer,null,(({groupIndex:e})=>f.createElement("div",{className:"k-scheduler-row",key:e},f.createElement("div",{className:"k-scheduler-cell k-heading-cell k-group-cell k-scheduler-datecolumn"},p.toLanguageString(Ct,Nt[Ct])),f.createElement("div",{className:"k-scheduler-cell k-heading-cell k-group-cell k-scheduler-timecolumn"},p.toLanguageString(bt,Nt[bt])),f.createElement("div",{className:"k-scheduler-cell k-heading-cell k-scheduler-eventcolumn"},p.toLanguageString(It,Nt[It]))))))),f.createElement("div",{className:"k-scheduler-body"},f.createElement(mr,{resources:l,group:t,nested:!0},f.createElement(or.Consumer,null,(({groupIndex:t})=>k.filter((e=>e.group.index===(t||0))).map(((r,a,l)=>f.createElement("div",{className:"k-scheduler-row k-scheduler-content",key:`${t}:${a}`},f.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"},f.createElement("div",null,f.createElement("strong",{className:"k-scheduler-agendaday"},m.formatDate(r.zonedStart,"dd")),f.createElement("em",{className:"k-scheduler-agendaweek"},m.formatDate(r.zonedStart,"EEEE")),f.createElement("span",{className:"k-scheduler-agendadate"},m.formatDate(r.zonedStart,"y")))),f.createElement("div",{className:"k-scheduler-cell k-group-content"},r.items.length?r.items.map(((t,r)=>f.createElement("div",{className:"k-scheduler-row",key:r},f.createElement("div",{className:"k-scheduler-cell k-scheduler-timecolumn"},f.createElement("div",null,t.tail&&f.createElement(n.IconWrap,{name:"rtl"===u?"caret-alt-right":"caret-alt-left",icon:"rtl"===u?d.caretAltRightIcon:d.caretAltLeftIcon}),t.isAllDay?p.toLanguageString(Ae,Nt[Ae]):cn(m,t),t.head&&f.createElement(n.IconWrap,{name:"rtl"===u?"caret-alt-left":"caret-alt-right",icon:"rtl"===u?d.caretAltLeftIcon:d.caretAltRightIcon}))),f.createElement("div",{className:"k-scheduler-cell"},f.createElement(s,{key:`${a}:${r}`,...t,onDataAction:e.onDataAction,task:e.task,viewTask:e.viewTask,editable:e.editable}))))):f.createElement("div",{className:"k-scheduler-cell k-heading-cell k-group-cell"},p.toLanguageString(xt,Nt[xt])))))))))))},cn=(e,t)=>{let r="{0:t}-{1:t}";return t.head?r="{0:t}":t.tail&&(r="{1:t}"),e.format(r,t.zonedStart,t.zonedEnd)},dn={name:"agenda",title:e=>e.toLanguageString(Le,Nt[Le]),dateRange:({intl:e,date:t,numberOfDays:r=1,timezone:n})=>{const l=a.ZonedDate.fromLocalDate(t,n),o=(e=>a.getDate(e))(7===r?a.firstDayInWeek(l,e.firstDay()):l),s=((e,t)=>a.getDate(a.addDays(e,t||1)))(o,r),c=a.ZonedDate.fromUTCDate(z(o),n),i=a.ZonedDate.fromUTCDate(z(s),n);return{start:new Date(c.getTime()),end:new Date(i.getTime()),zonedStart:c,zonedEnd:i}},selectedDateFormat:"{0:D} - {1:D}",selectedShortDateFormat:"{0:d} - {1:d}",slotDuration:1440,slotDivision:1,numberOfDays:7},un={title:r.any};sn.propTypes=un,sn.displayName="KendoReactSchedulerAgendaView";const mn=f.forwardRef(((e,t)=>{const r=f.useRef(null),a=f.useRef(null),n=o.useLocalization();f.useImperativeHandle(r,(()=>({element:a.current&&a.current.element,...e}))),f.useImperativeHandle(t,(()=>r.current));const l=f.useCallback((t=>{!e.onClick||!r.current||e.onClick.call(void 0,{target:r.current,syntheticEvent:t})}),[r,e.slot,e.onClick]),c=n.toLanguageString(At,Nt[At]);return f.createElement(s.Button,{ref:a,tabIndex:-1,className:"k-more-events",onClick:l,"aria-label":c,icon:"more-horizontal",svgIcon:d.moreHorizontalIcon})}));mn.displayName="KendoReactSchedulerShowMoreItemsButton";const pn={skeleton:"dd"},gn=e=>{const{group:t,timezone:r,resources:l}=ne(),s=e.editItem||Pa,c=e.editSlot||ea,[i]=fe(),[d,u]=ye(),[,m]=De(),p=oe(),g=ue(),E=Ee(),h=pe(),y=o.useInternationalization(),v=ce(),k=e.itemsPerSlot||En.itemsPerSlot,D=f.useMemo((()=>Ba(h,{step:7*a.MS_PER_DAY,timezone:r})),[h.start.getTime(),h.end.getTime(),r]),S=f.useMemo((()=>Ua(0,{step:a.MS_PER_DAY},{groups:g,ranges:D})),[h.start.getTime(),h.end.getTime(),g,D]),C=f.useMemo((()=>ia(i,{dateRange:h,fields:v,timezone:r})),[i,h.start.getTime(),h.end.getTime(),v,r]),b=f.useMemo((()=>pa(C,{timezone:r},{groups:g,ranges:D})),[C,r,g,D]),I=f.useCallback((e=>{const t=p.find((e=>"day"===e.props.name));!m||!t||!t.props.name||!e.target.slot||(m(t.props.name,e),u(e.target.slot.start,e))}),[m,p]);f.useMemo((()=>Z(b,S,!0)),[b,S]),f.useMemo((()=>U(b,S,!0)),[b,S]);const w=f.createElement(or.Consumer,null,(({groupIndex:t})=>f.createElement("div",{className:"k-scheduler-row",key:t},S.filter((e=>e.group.index===t&&0===e.range.index)).map(((t,n)=>f.createElement(Va,{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"}})))))),T=f.createElement(or.Consumer,null,(({groupIndex:t})=>D.map(((r,a)=>f.createElement("div",{className:"k-scheduler-row",key:a},S.filter((e=>e.group.index===t&&e.range.index===a)).map(((r,l,o)=>f.createElement(c,{slot:e.slot,viewSlot:e.viewSlot,key:l,form:e.form,...r,expandable:{offsetTop:30,offsetBottom:k<r.items.length?15:0},onDataAction:e.onDataAction,col:"horizontal"===E?o.length*(t||0)+l:l,row:"horizontal"===E?a:D.length*(t||0)+a,editable:e.editable,className:n.classNames({"k-other-month":r.start.getMonth()<d.getMonth()||r.start.getMonth()>d.getMonth()})},f.createElement("span",{className:"k-link k-nav-day"},y.formatDate(new Date(r.end.getTime()-(r.end.getTime()-r.start.getTime())/2),pn)),k<r.items.length&&f.createElement(mn,{slot:r,onClick:I})))))))));return f.createElement(lr,{props:e,slots:S,ranges:D,className:n.classNames("k-scheduler-monthview",e.className)},f.createElement("div",{className:"k-scheduler-head"},"horizontal"===E?f.createElement(sr,{nested:!0,resources:l,group:t},w):f.createElement(mr,{resources:l,group:t},w)),f.createElement("div",{className:"k-scheduler-body"},"horizontal"===E?f.createElement(sr,{resources:l,group:t},T):f.createElement(mr,{nested:!0,resources:l,group:t},T),b.filter((e=>null===e.order||e.order<k)).sort(Y).map((t=>f.createElement(s,{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,style:{transform:"translateY(30px)"},vertical:!1,editable:e.editable,ignoreIsAllDay:!0})))))},En={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(z(n),r),s=a.ZonedDate.fromUTCDate(z(l),r);return{start:new Date(o.getTime()),end:new Date(s.getTime()),zonedStart:o,zonedEnd:s}},slotDuration:1440,slotDivision:1,itemsPerSlot:2,numberOfDays:31,title:e=>e.toLanguageString(Fe,Nt[Fe]),selectedDateFormat:"{0:Y}",selectedShortDateFormat:"{0:Y}"},hn={itemsPerSlot:r.number};gn.propTypes=hn,gn.displayName="KendoReactSchedulerMonthView";const yn=e=>f.createElement($a,{...e,step:7,numberOfDays:7}),vn={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(z(l),r),c=a.ZonedDate.fromUTCDate(z(o),r);return{start:new Date(s.getTime()),end:new Date(c.getTime()),zonedStart:s,zonedEnd:c}},title:e=>e.toLanguageString(Me,Nt[Me]),selectedDateFormat:"{0:D} - {1:D}",selectedShortDateFormat:"{0:d} - {1:d}"};yn.displayName="KendoReactSchedulerWeekView";const fn=e=>{const t=pe(),r=Math.round((t.end.getTime()-t.start.getTime())/a.MS_PER_DAY);return f.createElement($a,{...e,step:7,numberOfDays:r})},kn={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)),d=a.addDays(i,c),u=a.ZonedDate.fromUTCDate(z(i),r),m=a.ZonedDate.fromUTCDate(z(d),r);return{start:new Date(u.getTime()),end:new Date(m.getTime()),zonedStart:u,zonedEnd:m}},title:e=>e.toLanguageString(ze,Nt[ze]),workWeekStart:a.Day.Monday,workWeekEnd:a.Day.Friday,selectedDateFormat:"{0:D} - {1:D}",selectedShortDateFormat:"{0:d} - {1:d}"};fn.displayName="KendoReactSchedulerWorkWeekView";const Dn=f.createElement("div",{className:"k-scheduler-cell k-side-cell"}),Sn=e=>f.createElement(f.Fragment,null,f.createElement("div",{className:"k-sticky-cell"},Dn),e.children),Cn=e=>{const t=o.useLocalization();return f.createElement(f.Fragment,null,f.createElement("div",{className:"k-sticky-cell"},f.createElement("div",{className:"k-scheduler-cell k-heading-cell k-side-cell k-scheduler-times-all-day","data-range-index":0},t.toLanguageString(xe,Nt[xe]))),e.children)},bn=e=>{const{group:t,timezone:r,resources:l}=ne(),s=f.useRef(null),c=f.useRef(null),i=e.editItem||Pa,d=e.editSlot||ea,u=f.useRef(null),[m]=fe(),p=Ee(),g=ue(),E=pe(),h=ce(),y=o.useInternationalization(),v=e.showWorkHours,k=e.slotDivisions||In.slotDivisions,D=e.slotDuration||In.slotDuration,S=e.workWeekStart||In.workWeekStart,C=e.workWeekEnd||In.workWeekEnd,b=y.parseDate(e.workDayStart||e.isWorkDayStart||In.isWorkDayStart),I=y.parseDate(e.workDayEnd||e.isWorkDayEnd||In.isWorkDayEnd),w=y.parseDate(e.startTime||In.startTime),x=y.parseDate(e.endTime||In.endTime),A=f.useMemo((()=>v?b:w),[v,b,w]),N=f.useMemo((()=>v?I:x),[v,I,x]),_=f.useMemo((()=>Ba(E,{step:a.MS_PER_DAY,timezone:r})),[E.start.getTime(),E.end.getTime(),r]),M=f.useMemo((()=>Ua(0,{step:D/k*a.MS_PER_MINUTE},{groups:g,ranges:_}).filter((e=>K(e.zonedStart,A,N)||A.getTime()===N.getTime()))),[g,_,E.start.getTime(),E.end.getTime(),r,D,k,A.getTime(),N.getTime()]),L=f.useMemo((()=>ia(m,{dateRange:E,fields:h,timezone:r})),[m,E.start.getTime(),E.end.getTime(),h,r]),O=f.useMemo((()=>pa(L,{timezone:r},{groups:g,ranges:_}).filter((e=>A.getTime()===N.getTime()||K(e.zonedStart,A,N)||K(e.zonedEnd,A,N)||K(new Date(e.zonedEnd.getTime()-(e.zonedEnd.getTime()-e.zonedStart.getTime())/2),A,N)))),[L,r,g,_,A.getTime(),N.getTime()]);f.useMemo((()=>Z(O,M,!0)),[O,M]),f.useMemo((()=>U(O,M,!0)),[O,M]);const F=("horizontal"===p?M.length:M.length/g.length)*((e.columnWidth||In.columnWidth)+1),P=f.createElement(or.Consumer,null,(()=>f.createElement(f.Fragment,null,f.createElement("div",{className:"k-scheduler-row"},_.map(((t,r)=>f.createElement(Va,{as:e.dateHeaderCell,key:r,date:t.zonedStart,start:t.start,end:t.end,format:"m"})))),f.createElement("div",{className:"k-scheduler-row",ref:s},_.map(((t,r)=>M.filter((e=>0===e.group.index&&e.range.index===r)).map((t=>t.zonedStart.getMinutes()%D==0?f.createElement(Dr,{key:t.index,as:e.timeHeaderCell,format:"t",date:t.zonedStart,start:t.zonedStart,end:t.zonedEnd}):null)))))))),W=f.createElement(or.Consumer,null,(({groupIndex:t})=>f.createElement("div",{className:"k-scheduler-row"},_.map(((n,l)=>M.filter((e=>e.group.index===t&&e.range.index===l)).map(((n,o,s)=>{const c=a.ZonedDate.fromUTCDate(z(n.zonedStart),r),i=V(c.getDay(),S,C);return f.createElement(d,{key:`${n.start.getTime()}:${n.group.index}`,slot:e.slot,viewSlot:e.viewSlot,...n,form:e.form,onDataAction:e.onDataAction,isWorkHour:K(n.zonedStart,b,I),isWorkDay:i,col:"horizontal"===p?l*s.length+o+s.length*_.length*(t||0):l*s.length+o,row:"horizontal"===p?0:t||0,expandable:!0,editable:e.editable})}))))))),G=f.useMemo((()=>n.classNames("k-scheduler-timelineview",e.className)),[e.className]);Qt({element:u,selector:".k-resource-cell",attribute:"data-depth-index",explicitDepth:!0});const B=u.current?u.current.closest(".k-scheduler-layout"):null;return oa({element:B,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:O&&!O.length}),f.createElement(lr,{ref:u,id:e.id,style:{...e.style},className:G,props:e,slots:M,ranges:_},f.createElement("div",{className:"k-scheduler-head",style:{width:F}},"horizontal"===p?f.createElement(sr,{nested:!0,group:t,resources:l,rowContent:Sn},P):f.createElement(mr,{wrapGroup:!0,group:t,resources:l},P)),f.createElement("div",{className:"k-scheduler-body",style:{width:F},ref:c},"horizontal"===p?f.createElement(sr,{group:t,resources:l,rowContent:Cn},W,f.createElement(or.Consumer,null,(({groupIndex:t})=>e.currentTimeMarker&&H(T(_).start,R(_).end,new Date,new Date,!0)&&f.createElement(Wa,{groupIndex:t,attachArrow:s,vertical:!0})))):f.createElement(mr,{nested:!0,wrapGroup:!0,group:t,resources:l},W),"vertical"===p&&e.currentTimeMarker&&H(T(_).start,R(_).end,new Date,new Date,!0)&&f.createElement(Wa,{attachArrow:s,vertical:!0}),O.sort(Y).map(((t,r)=>f.createElement(i,{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})))))},In={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(z(l),r),c=a.ZonedDate.fromUTCDate(z(o),r);return{start:new Date(s.getTime()),end:new Date(c.getTime()),zonedStart:s,zonedEnd:c}},selectedDateFormat:"{0:D} - {1:D}",selectedShortDateFormat:"{0:d} - {1:d}",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},wn=e=>f.createElement(bn,{...e}),Tn={...In,name:"timeline",title:e=>e.toLanguageString(_e,Nt[_e]),slotDuration:60,slotDivisions:2,numberOfDays:1,selectedDateFormat:"{0:D}",selectedShortDateFormat:"{0:d}"};wn.displayName="KendoReactSchedulerTimelineView";const Rn=new Map;Rn.set(sn,dn),Rn.set(Ya,ja),Rn.set(gn,En),Rn.set(yn,vn),Rn.set(fn,kn),Rn.set(wn,Tn);const xn=f.forwardRef(((e,t)=>{var r,l,c;n.validatePackage(Xa);const i=n.shouldShowValidationUI(Xa),{timezone:u,onDataChange:m}=e,p=f.useRef(null),g=f.useRef(null);f.useImperativeHandle(g,(()=>({props:e,element:p.current}))),f.useImperativeHandle(t,(()=>g.current));const E=n.useRtl(p),h=o.useInternationalization(),y=o.useLocalization(),{fields:v}=f.useMemo((()=>(e=>({fields:{...W,...e}}))(e.modelFields)),[e.modelFields]),[k,C]=be(e.defaultDate||An.defaultDate,e.date,e.onDateChange),b=f.Children.toArray(e.children||[]).map((e=>f.isValidElement(e)?f.cloneElement(e,{...Rn.get(e.type),...e.props}):e)),I=f.cloneElement(f.createElement(Ya,null),Rn.get(Ya)),[w,T]=be(e.defaultView||b[0]&&b[0].props.name||"day",e.view,e.onViewChange),[R,x]=be(!0),A=b.find((e=>e.props.name===w))||b[0]||I,M=(null!=(r=e.data)?r:An.data)||An.data,z=((e,t)=>{const r=S(e,t),a=D(r);return 1===a.length?[{index: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),O=e.group&&e.group.orientation?e.group.orientation:"horizontal",F=A.props.selectedDateFormat||"{0:D}",P=A.props.selectedShortDateFormat||"{0:d}",H=A.props.slotDuration,K=void 0!==A.props.dateRange?"function"==typeof A.props.dateRange?A.props.dateRange.call(void 0,{intl:h,date:k,timezone:u,numberOfDays:A.props.numberOfDays,workWeekStart:A.props.workWeekStart||h.firstDay(),workWeekEnd:A.props.workWeekEnd||(h.firstDay()+A.props.numberOfDays)%6}):A.props.dateRange:{start:An.defaultDate,end:An.defaultDate},V=f.useCallback((({created:e=[],updated:t=[],deleted:r=[]})=>{if(m){const a={created:e,updated:t,deleted:r};m.call(void 0,a)}}),[m]),G=f.useCallback((e=>{const t=[e.dataItem];V({created:t})}),[V]),B=f.useCallback((e=>{const t=[],r=[];if(e.series)if(Array.isArray(e.dataItem))e.dataItem.map((t=>{const a=n.clone(L(e.dataItem,v,M)),l=n.clone(t);_(l,v.originalStart,N(a,v.originalStart)),_(l,v.recurrenceId,N(a,v.recurrenceId)),_(l,v.recurrenceExceptions,N(a,v.recurrenceExceptions)),r.push(l)}));else{const t=n.clone(L(e.dataItem,v,M)),a=n.clone(e.dataItem);_(a,v.originalStart,N(t,v.originalStart)),_(a,v.recurrenceId,N(t,v.recurrenceId)),_(a,v.recurrenceExceptions,N(t,v.recurrenceExceptions)),r.push(a)}else if(Array.isArray(e.dataItem))e.dataItem.map((e=>{const a=null!==N(e,v.recurrenceRule)&&void 0!==N(e,v.recurrenceRule);if(null!==N(e,v.recurrenceId)&&void 0!==N(e,v.recurrenceId)&&a){const a=n.clone(L(e,v,M)),l=N(e,v.originalStart),o=N(a,v.recurrenceExceptions)||[];_(a,v.recurrenceExceptions,[...o,l]),_(e,v.recurrenceRule,null),r.push(a),t.push(e)}else r.push(e)}));else{const a=null!==N(e.dataItem,v.recurrenceRule)&&void 0!==N(e.dataItem,v.recurrenceRule);if(null!==N(e.dataItem,v.recurrenceId)&&void 0!==N(e.dataItem,v.recurrenceId)&&a){const a=n.clone(L(e.dataItem,v,M)),l=N(e.dataItem,v.originalStart),o=N(a,v.recurrenceExceptions)||[];_(a,v.recurrenceExceptions,[...o,l]),_(e.dataItem,v.recurrenceRule,null),r.push(a),t.push(e.dataItem)}else r.push(e.dataItem)}V({updated:r,created:t})}),[V,v,M]),U=f.useCallback((e=>{const t=[],r=[];if(e.series){const t=n.clone(L(e.dataItem,v,M)),a=n.clone(e.dataItem);_(a,v.originalStart,N(t,v.originalStart)),_(a,v.recurrenceId,N(t,v.recurrenceId)),_(a,v.recurrenceRule,N(t,v.recurrenceRule)),_(a,v.recurrenceExceptions,N(t,v.recurrenceExceptions)),r.push(a)}else if(null===N(e.dataItem,v.recurrenceRule)||void 0===N(e.dataItem,v.recurrenceRule))r.push(e.dataItem);else{const r=n.clone(L(e.dataItem,v,M)),a=N(e.dataItem,v.originalStart),l=N(r,v.recurrenceExceptions)||[];_(r,v.recurrenceExceptions,[...l,a]),_(e.dataItem,v.recurrenceRule,null),t.push(r)}V({updated:t,deleted:r})}),[V,v,M]),Z=f.useCallback((e=>{switch(e.type){case ee.create:G(e);break;case ee.update:B(e);break;case ee.remove:U(e)}}),[G,U,B]),$=f.useCallback(((e,t)=>{T(e,{...t,target:g.current})}),[T,g]),q=f.useCallback(((e,t)=>{C(e,{...t,target:g.current})}),[C,g]),Y=f.useCallback((e=>{e.value&&C(e.value,{...e,target:g.current,nativeEvent:e.nativeEvent})}),[C,g]),j=f.useCallback((e=>{var t,r;e.preventDefault();const n=null!=(r=null!=(t=A.props.step)?t:A.props.numberOfDays)?r:1,l=n>27?a.addMonths(k,Math.round(n/27)):a.addDays(k,n);C(l,e)}),[k,C,A.props.numberOfDays,A.props.step]),X=f.useCallback((e=>{var t,r;e.preventDefault();const n=null!=(r=null!=(t=A.props.step)?t:A.props.numberOfDays)?r:1,l=n>27?a.addMonths(k,-Math.round(n/27)):a.addDays(k,-n);C(l,e)}),[k,C,A.props.numberOfDays,A.props.step]),Q=f.useCallback((e=>{e.preventDefault();const t=a.ZonedDate.fromLocalDate(new Date,u);C(new Date(t.getTime()),e)}),[C,u]),J=f.useCallback((()=>{x(!R)}),[x,R]),te=f.useCallback((()=>{p.current&&(p.current.style.boxShadow="0 0.5px 0.5px 0.5px rgba(0, 0, 0, .12)")}),[p]),re=f.useCallback((()=>{p.current&&(p.current.style.boxShadow="")}),[p]),ae=f.useMemo((()=>{var t;return{...e.style,height:null!=(t=e.height)?t:An.height}}),[e.height,e.style]),ne=f.useMemo((()=>n.classNames({"k-rtl":void 0!==e.rtl?e.rtl:"rtl"===E},"k-scheduler",e.className)),[e.className,e.rtl,E]),le=y.toLanguageString(Ne,Nt[Ne]),oe=y.toLanguageString(He,Nt[He]),se=y.toLanguageString(We,Nt[We]),ce=A.props.header||e.header||An.header,ie=A.props.footer||e.footer||An.footer,de=we,[ue,me]=f.useState(null);return f.createElement(Ce,{element:p,props:e,views:b,fields:v,groups:z,dateRange:K,orientation:O,dateFormat:{dateFormat:F,shortDateFormat:P},date:[k,q],activeView:[w,$],selection:[ue,me],data:[M,Z]},f.createElement("div",{ref:p,id:e.id,style:ae,className:ne,tabIndex:null!=(l=e.tabIndex)?l:An.tabIndex,dir:E,role:e.role||"application","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-activedescendant":ue&&ue.props.id||void 0,onFocus:te,onBlur:re},f.createElement(ce,null,f.createElement(de,null,f.createElement(s.ButtonGroup,{className:"k-scheduler-navigation"},f.createElement(s.Button,{role:"button",tabIndex:-1,title:le,"aria-label":le,onClick:Q},le),f.createElement(s.Button,{role:"button",tabIndex:-1,icon:"rtl"===E?"caret-alt-right":"caret-alt-left",svgIcon:"rtl"===E?d.caretAltRightIcon:d.caretAltLeftIcon,title:oe,"aria-label":oe,onClick:X}),f.createElement(s.Button,{role:"button",tabIndex:-1,icon:"rtl"===E?"caret-alt-left":"caret-alt-right",svgIcon:"rtl"===E?d.caretAltLeftIcon:d.caretAltRightIcon,title:se,"aria-label":se,onClick:j}))),f.createElement(_t,{value:k,onChange:Y}),f.createElement(s.ToolbarSpacer,null),f.createElement(zt,null)),A&&f.createElement(A.type,{editable:null!=(c=e.editable)?c:An.editable,key:A.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:Z,showWorkHours:R,...A.props}),f.createElement(ie,null,H&&H<1440&&f.createElement(Lt,null,f.createElement(s.Button,{tabIndex:-1,onClick:J,icon:"clock",svgIcon:d.clockIcon},y.toLanguageString(R?Ke:Ve,Nt[R?Ke:Ve])))),i&&f.createElement(n.WatermarkOverlay,null)))})),An={data:[],height:600,tabIndex:-1,editable:!1,defaultDate:new Date,header:Ie,footer:Re,navigation:we,viewSelector:Te};xn.propTypes={data:r.array,editable:r.oneOfType([r.bool,r.shape({add:r.bool,drag:r.bool,edit:r.bool,remove:r.bool,resize:r.bool})]),view:r.string,defaultView:r.string,date:r.any,defaultDate:r.any,rtl:r.bool,height:r.oneOfType([r.number,r.string]),children:r.any,timezone:r.string,group:r.any,resources:r.any,modelFields:r.shape({id:r.string,start:r.string,startTimezone:r.string,end:r.string,endTimezone:r.string,isAllDay:r.string,title:r.string,description:r.string,recurrenceRule:r.string,recurrenceId:r.string,recurrenceException:r.string})},xn.displayName="KendoReactScheduler";const Nn=f.forwardRef(((e,t)=>{const{item:r,_ref:a,itemRef:l,...s}=e,c=f.useRef(),i=f.useRef(null),u=f.useRef(null),m=f.useRef(null);f.useImperativeHandle(u,(()=>({props:e,element:i.current&&i.current.element}))),f.useImperativeHandle(t,(()=>u.current)),f.useImperativeHandle(a,(()=>i.current)),f.useImperativeHandle(l,(()=>i.current));const p=r||_n.item,g=o.useInternationalization(),[E]=Vt(),[h]=Wt(),y=re(),[v,k]=f.useState(!0),[D,S]=f.useState(!1),C=f.useRef(0),I=n.useDir(y),x=f.useMemo((()=>e.isAllDay?g.toString(e.zonedStart,"t"):g.format("{0:t} - {1:t}",e.zonedStart,e.zonedEnd)),[g,e.isAllDay,e.zonedEnd,e.zonedStart]),A=f.useMemo((()=>`(${x}): ${e.title}`),[x,e.title]),N=(e,t)=>{let r=1;return e.forEach((e=>{const a=t.filter((t=>_(e.current.props,t.props)));a.length>r&&(r=a.length)})),r},_=(t,r)=>H(t.start,t.end,r.start,r.end)&&t.group.index===r.group.index&&t.range.index===r.range.index&&(e.ignoreIsAllDay||t.isAllDay===r.isAllDay),M=()=>{const t=(h||[]).filter((t=>t.current&&_(t.current.props,e)));if(0===t.length)return void k(!1);const r=T(t);if(!r.current||!i.current)return;const a=b(r.current.element);w(i.current.element,a)},z=()=>{const t=(h||[]).filter((t=>t.current&&_(t.current.props,e))),r=i.current&&i.current.element;if(!r||!t.length)return;const a=T(t),n=R(t);if(!a.current||!i.current||!n.current)return;const l=[],o=[],s=[],c=b(a.current.element),d=(e.vertical?c.height:c.width)/(a.current.props.end.getTime()-a.current.props.start.getTime()),u=(e.start.getTime()-a.current.props.start.getTime())*d,m=(Math.min(e.end.getTime(),n.current.props.end.getTime())-Math.max(e.start.getTime(),a.current.props.start.getTime()))*d;(E||[]).forEach((e=>{e.current&&(e.current.props.dragHint?o.push(e.current):e.current.props.resizeHint?s.push(e.current):l.push(e.current))}));const p=e.dragHint||e.resizeHint?B(i.current,e.dragHint?o:s,t,e.ignoreIsAllDay):e.order||0;let g=e.dragHint||e.resizeHint?N(t,e.dragHint?o:s):N(t,l);const y=((e,t)=>e.map((e=>t.filter((t=>_(e.current.props,t.props))))))(t,l);let v=0;const f=b(r);if(y.forEach((t=>{let a=0;t.forEach((t=>{H(t.props.start,t.props.end,e.start,e.end)&&!e.dragHint&&!e.resizeHint&&t._maxSiblingsPerSlot&&t._maxSiblingsPerSlot>g&&t.element!==r&&(g=t._maxSiblingsPerSlot);const n=b(t.element);null!==t.props.order&&t.props.order<p&&(a=n.top+n.height-f.top-1*p+1)})),a>v&&(v=a)})),0===t.length)return void k(!1);f.width=e.vertical?f.width/g-1-20/g:m+1,f.height=e.vertical?m-1:(e.resizeHint||e.dragHint)&&g<=1?f.height:e.style&&e.style.height?e.style.height:25,f.left=e.vertical?f.left+p*f.width+1*p:f.left+(u<0?0:u),f.top=e.vertical?f.top+(u<0?0:u):f.top+v+1*p,C.current=g,w(r,f),S(!0),k(!0)},L=f.useCallback((e=>{const t=e&&e[0],r=m.current;void 0!==c.current&&window.cancelAnimationFrame(c.current),r&&t&&(r.width!==t.contentRect.width||r.height!==t.contentRect.height)&&(c.current=window.requestAnimationFrame((()=>{M(),z()}))),m.current={width:t.contentRect.width,height:t.contentRect.height}}),[M,z]);f.useEffect(M),f.useEffect(z);const O=i.current&&i.current.element?i.current.element.closest(".k-scheduler-layout"):null;return oa({element:O,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:e.isLast}),f.useEffect((()=>{if(!y.current)return;const e=window.ResizeObserver,t=e&&new e(L);return t&&t.observe(y.current),()=>{t&&t.disconnect()}}),[L,y]),f.createElement(p,{...s,_ref:i,_maxSiblingsPerSlot:C,itemRef:i,style:{visibility:D?void 0:"hidden",display:v?void 0:"none",...e.style}},!e.resizeHint&&f.createElement("span",{className:"k-event-actions"},e.tail&&f.createElement(n.IconWrap,{name:"rtl"===I?"caret-alt-right":"caret-alt-left",icon:"rtl"===I?d.caretAltRightIcon:d.caretAltLeftIcon}),e.isRecurring&&!e.isException&&f.createElement(n.IconWrap,{name:"reload",icon:d.arrowRotateCwIcon}),!e.isRecurring&&e.isException&&f.createElement(n.IconWrap,{name:"non-recurrence",icon:d.nonRecurrenceIcon})),!e.resizeHint&&f.createElement("div",{title:A},!e.isAllDay&&f.createElement(la,{className:"k-event-template k-event-time "},A),f.createElement(la,{className:"k-event-template"},e.title)))})),_n={item:na};Nn.displayName="KendoReactSchedulerProportionalViewItem",e.AgendaView=sn,e.DATA_ACTION=ee,e.DRAG_ITEM_ACTION=za,e.DateHeaderCell=Va,e.DayView=Ya,e.ITEMS_FOCUS_ACTION=Jt,e.ITEMS_SELECT_ACTION=jt,e.MonthView=gn,e.REMOVE_ITEM_ACTION=_a,e.RESIZE_ITEM_ACTION=La,e.SERIES_ACTION=Oa,e.SHOW_OCCURRENCE_DIALOG_ACTION=Na,e.SHOW_REMOVE_DIALOG_ACTION=Ma,e.SLOTS_FOCUS_ACTION=er,e.SLOTS_SELECT_ACTION=Xt,e.Scheduler=xn,e.SchedulerActiveViewContext=ke,e.SchedulerDataContext=ve,e.SchedulerDateContext=he,e.SchedulerDateRangeContext=me,e.SchedulerDrag=va,e.SchedulerEditItem=Pa,e.SchedulerEditItemDragItemContext=ba,e.SchedulerEditItemFormItemContext=Ca,e.SchedulerEditItemPropsContext=Sa,e.SchedulerEditItemRemoveItemContext=wa,e.SchedulerEditItemResizeItemContext=Ia,e.SchedulerEditItemShowOccurrenceDialogContext=Ra,e.SchedulerEditItemShowRemoveDialogContext=Ta,e.SchedulerEditSlot=ea,e.SchedulerEditSlotFormItemContext=Xr,e.SchedulerEditSlotPropsContext=jr,e.SchedulerEditTask=ln,e.SchedulerFieldsContext=se,e.SchedulerFooter=Re,e.SchedulerForm=Br,e.SchedulerFormEditor=Vr,e.SchedulerGroupsContext=de,e.SchedulerHeader=Ie,e.SchedulerItem=na,e.SchedulerItemContent=la,e.SchedulerOccurrenceDialog=ra,e.SchedulerOrientationContext=ge,e.SchedulerProportionalViewItem=Nn,e.SchedulerPropsContext=ae,e.SchedulerRemoveDialog=aa,e.SchedulerResize=ka,e.SchedulerSlot=Zr,e.SchedulerTask=Qa,e.SchedulerViewItem=sa,e.SchedulerViewSlot=qr,e.SchedulerViewTask=Ja,e.SchedulerViewsContext=le,e.TimeHeaderCell=Dr,e.TimelineView=wn,e.WeekView=yn,e.WorkWeekView=fn,e.agendaViewDefaultProps=dn,e.dateHeaderCellDefaultProps=Ga,e.dayViewDefaultProps=ja,e.monthViewDefaultProps=En,e.schedulerDefaultProps=An,e.schedulerDragDefaultProps=fa,e.schedulerEditItemDefaultProps=Ha,e.schedulerEditSlotDefaultProps=ta,e.schedulerEditTaskDefaultProps=on,e.schedulerFormDefaultProps=Ur,e.schedulerFormEditorDefaultProps=Gr,e.schedulerProportionalViewItemDefaultProps=_n,e.schedulerResizeDefaultProps=Da,e.schedulerSlotDefaultProps=$r,e.schedulerViewItemDefaultProps=ca,e.schedulerViewSlotDefaultProps=Yr,e.schedulerViewTaskDefaultProps=en,e.timeHeaderCellDefaultProps=Sr,e.timeLineViewDefaultProps=Tn,e.useSchedulerActiveViewContext=De,e.useSchedulerDataContext=fe,e.useSchedulerDateContext=ye,e.useSchedulerDateRangeContext=pe,e.useSchedulerEditItemDragItemContext=()=>f.useContext(ba),e.useSchedulerEditItemFormItemContext=()=>f.useContext(Ca),e.useSchedulerEditItemPropsContext=()=>f.useContext(Sa),e.useSchedulerEditItemRemoveItemContext=()=>f.useContext(wa),e.useSchedulerEditItemResizeItemContext=()=>f.useContext(Ia),e.useSchedulerEditItemShowOccurrenceDialogContext=()=>f.useContext(Ra),e.useSchedulerEditItemShowRemoveDialogContext=()=>f.useContext(Ta),e.useSchedulerEditSlotFormItemContext=()=>f.useContext(Xr),e.useSchedulerEditSlotPropsContext=()=>f.useContext(jr),e.useSchedulerFieldsContext=ce,e.useSchedulerGroupsContext=ue,e.useSchedulerOrientationContext=Ee,e.useSchedulerPropsContext=ne,e.useSchedulerViewsContext=oe,e.weekViewDefaultProps=vn,e.workWeekDefaultProps=kn}));
8
+ !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("@progress/kendo-react-dateinputs"),require("@progress/kendo-react-popup"),require("@progress/kendo-svg-icons"),require("react-dom"),require("@progress/kendo-react-form"),require("@progress/kendo-react-dialogs"),require("@progress/kendo-react-labels"),require("@progress/kendo-react-inputs"),require("@progress/kendo-react-dropdowns"),require("@progress/kendo-recurrence")):"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","@progress/kendo-react-dateinputs","@progress/kendo-react-popup","@progress/kendo-svg-icons","react-dom","@progress/kendo-react-form","@progress/kendo-react-dialogs","@progress/kendo-react-labels","@progress/kendo-react-inputs","@progress/kendo-react-dropdowns","@progress/kendo-recurrence"],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.KendoReactDateinputs,e.KendoReactPopup,e.KendoSvgIcons,e.ReactDOM,e.KendoReactForm,e.KendoReactDialogs,e.KendoReactLabels,e.KendoReactInputs,e.KendoReactDropdowns,e.KendoRecurrence)}(this,(function(e,t,r,a,n,l,o,s,c,i,d,u,m,p,g,E,h,y){"use strict";function v(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 f=v(t),k=v(u);const D=(e,t=0,r=0,a=[])=>{if(e.length<=t)return[a];const n=[];return e[t].data.map((l=>{n.push(...D(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 S(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 C=(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},b=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"),w=(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],R=e=>e[e.length-1],x=e=>{const t=new Set;return e.forEach((e=>{t.add(e.field)})),t.size===e.length};const A=(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=A(e,t,r,a+1),l.style.pointerEvents=o,n},N=(e,t)=>n.getter(t)(e),_=(e,t,r)=>{if(t)return n.setter(t)(e,r)},M=e=>null!=e;function z(e){return new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))}const L=(e,t,r)=>{const a=O(e,t)?N(e,t.id):N(e,t.recurrenceId);return r.find((e=>N(e,t.id)===a))},O=(e,t)=>{const r=N(e,t.id),a=N(e,t.recurrenceId),n=N(e,t.recurrenceRule);return!(!r||!n||null!=a)},F=(e,t)=>Math.max(e.getTime(),t.getTime()),P=(e,t)=>Math.min(e.getTime(),t.getTime()),H=(e,t,r,a,n=!1)=>n?F(t,a)-P(e,r)<=t.getTime()-e.getTime()+(a.getTime()-r.getTime()):F(t,a)-P(e,r)<t.getTime()-e.getTime()+(a.getTime()-r.getTime()),W={id:"id",start:"start",startTimezone:"startTimezone",originalStart:"originalStart",end:"end",endTimezone:"endTimezone",isAllDay:"isAllDay",title:"title",description:"description",recurrenceRule:"recurrenceRule",recurrenceId:"recurrenceId",recurrenceExceptions:"recurrenceExceptions"},K=(e,t,r)=>(t.getHours()<e.getHours()||t.getHours()===e.getHours()&&t.getMinutes()<=e.getMinutes())&&(e.getHours()<r.getHours()||r.getHours()===e.getHours()&&e.getMinutes()<r.getMinutes()),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},B=(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&&H(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},U=(e,t,r=!1)=>{t.forEach((e=>e.items.splice(0,e.items.length))),t.forEach((t=>{const a=[];e.forEach((e=>{if((r||e.isAllDay===t.isAllDay)&&e.range.index===t.range.index&&e.group.index===t.group.index&&H(e.start,e.end,t.start,t.end)){const r=G(a);(null===e.order||void 0===e.order||e.order<r)&&(e.order=r),a.splice(e.order,0,e.order),t.items.push(e)}}))}))},Z=(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&&e.group.index===t.group.index&&H(e.start,e.end,t.start,t.end)&&e.slots.push(t)}))}))},$=(...e)=>{},q=(e,t,r=!1,a=!1)=>{const n=e.current;if(!n||!t)return null;const o=t.filter((e=>null!==e.current&&null!==e.current.element)),s=l.orderBy(o,[{field:"current.props.group.index",dir:"asc"},{field:"current.props.range.index",dir:"asc"},r?{field:""}:{field:"current.props.isAllDay",dir:"desc"},{field:"current.props.start",dir:"asc"}]),c=s.findIndex((e=>null!==e.current&&!(e.current.props.uid!==n.props.uid||void 0!==e.current.props.occurrenceId&&e.current.props.occurrenceId!==n.props.occurrenceId||e.current.props.group.index!==n.props.group.index||e.current.props.range.index!==n.props.range.index||!r&&e.current.props.isAllDay!==n.props.isAllDay)));return s[c+(a?-1:1)]},Y=(e,t)=>(e.order||0)-(t.order||0),j=6e4,X=[{}],Q=new Date(1900,0,1),J=new Date(2099,11,31);a.ZonedDate.fromLocalDate(Q),a.ZonedDate.fromLocalDate(J);var ee=(e=>(e[e.create=0]="create",e[e.update=1]="update",e[e.remove=2]="remove",e))(ee||{});const te=f.createContext({current:null}),re=()=>f.useContext(te);te.displayName="SchedulerElementContext";const ae=f.createContext({}),ne=()=>f.useContext(ae);ae.displayName="SchedulerPropsContext";const le=f.createContext([]),oe=()=>f.useContext(le);le.displayName="SchedulerViewsContext";const se=f.createContext(W),ce=()=>f.useContext(se);se.displayName="SchedulerFieldsContext";const ie=f.createContext({dateFormat:"{0:D}",shortDateFormat:"{0:d}"});ie.displayName="SchedulerDateFormatContext";const de=f.createContext([{index:0,resources:[]}]),ue=()=>f.useContext(de);de.displayName="SchedulerGroupsContext";const me=f.createContext({start:new Date,end:new Date,zonedStart:a.ZonedDate.fromLocalDate(new Date),zonedEnd:a.ZonedDate.fromLocalDate(new Date)}),pe=()=>f.useContext(me);me.displayName="SchedulerDateRangeContext";const ge=f.createContext(null),Ee=()=>f.useContext(ge);ge.displayName="SchedulerOrientationContext";const he=f.createContext([new Date,$]),ye=()=>f.useContext(he);he.displayName="SchedulerDateContext";const ve=f.createContext([[],$]),fe=()=>f.useContext(ve);ve.displayName="SchedulerDataContext";const ke=f.createContext(["day",$]),De=()=>f.useContext(ke);ke.displayName="SchedulerActiveViewContext";const Se=f.createContext([null,()=>{}]);Se.displayName="SchedulerItemSelectionContext";const Ce=({children:e,element:t,props:r,views:a,fields:n,groups:l,dateRange:o,dateFormat:s,orientation:c,date:i,data:d,activeView:u,selection:m})=>f.createElement(te.Provider,{value:t},f.createElement(ae.Provider,{value:r},f.createElement(le.Provider,{value:a},f.createElement(se.Provider,{value:n},f.createElement(ie.Provider,{value:s},f.createElement(de.Provider,{value:l},f.createElement(me.Provider,{value:o},f.createElement(ge.Provider,{value:c},f.createElement(he.Provider,{value:i},f.createElement(ve.Provider,{value:d},f.createElement(ke.Provider,{value:u},f.createElement(Se.Provider,{value:m},e)))))))))))),be=(e,t,r)=>{const[a,n]=f.useState(t||e),l=f.useCallback(((e,t)=>{n(e),r&&r.call(void 0,{...t,value:e})}),[r,n]);return[void 0!==t?t:a,l]},Ie=f.forwardRef(((e,t)=>{const{className:r,...a}=e,l=f.useRef(null),o=f.useRef(null);f.useImperativeHandle(o,(()=>({element:l.current,props:e}))),f.useImperativeHandle(t,(()=>o.current));const c=f.useMemo((()=>n.classNames("k-scheduler-toolbar",r)),[r]);return f.createElement(s.Toolbar,{id:e.id,ref:e=>{e&&(l.current=e.element)},className:c,...a},e.children)}));Ie.displayName="KendoReactSchedulerHeader";const we=f.forwardRef(((e,t)=>{const{className:r,...a}=e,l=f.useRef(null);return f.useImperativeHandle(t,(()=>({element:l.current,props:e}))),f.createElement(s.ToolbarItem,{ref:e=>{e&&(l.current=e.element)},className:n.classNames(r),...a},e.children)}));we.displayName="KendoReactSchedulerSchedulerNavigation";const Te=f.forwardRef(((e,t)=>{const{className:r,...a}=e,l=f.useRef(null);return f.useImperativeHandle(t,(()=>({element:l.current,props:e}))),f.createElement(s.ToolbarItem,{ref:e=>{e&&(l.current=e.element)},className:n.classNames("k-scheduler-views",r),...a},e.children)}));Te.displayName="KendoReactSchedulerViewSelector";const Re=f.forwardRef(((e,t)=>{const{className:r,style:a,...l}=e,o=f.useRef(null),c=f.useRef(null);f.useImperativeHandle(o,(()=>({element:c.current,props:e}))),f.useImperativeHandle(t,(()=>o.current));const i=f.useMemo((()=>n.classNames("k-scheduler-footer",e.className)),[e.className]);return f.createElement(s.Toolbar,{ref:e=>{e&&(c.current=e.element)},className:i,style:{boxShadow:"none",...a},...l},e.children)}));Re.displayName="KendoReactSchedulerFooter";const xe="scheduler.allEvents",Ae="scheduler.allDay",Ne="scheduler.today",_e="scheduler.timelineViewTitle",Me="scheduler.weekViewTitle",ze="scheduler.workWeekViewTitle",Le="scheduler.agendaViewTitle",Oe="scheduler.dayViewTitle",Fe="scheduler.monthViewTitle",Pe="scheduler.deleteTitle",He="scheduler.previousTitle",We="scheduler.nextTitle",Ke="scheduler.showFullDay",Ve="scheduler.showWorkDay",Ge="scheduler.editOccurrence",Be="scheduler.editSeries",Ue="scheduler.editRecurringConfirmation",Ze="scheduler.editRecurringDialogTitle",$e="scheduler.editSave",qe="scheduler.editCancel",Ye="scheduler.editorTitle",je="scheduler.editorEventTitle",Xe="scheduler.editorEventStart",Qe="scheduler.editorEventStartTimeZone",Je="scheduler.editorEventEnd",et="scheduler.editorEventEndTimeZone",tt="scheduler.editorEventAllDay",rt="scheduler.editorEventDescription",at="scheduler.editorEventSeparateTimeZones",nt="scheduler.editorEventTimeZone",lt="scheduler.recurrenceEditorRepeat",ot="scheduler.recurrenceEditorWeeklyRepeatOn",st="scheduler.recurrenceEditorMonthlyDay",ct="scheduler.recurrenceEditorMonthlyRepeatOn",it="scheduler.recurrenceEditorYearlyOf",dt="scheduler.recurrenceEditorYearlyRepeatOn",ut="scheduler.recurrenceEditorEndAfter",mt="scheduler.recurrenceEditorEndOccurrence",pt="scheduler.recurrenceEditorEndLabel",gt="scheduler.recurrenceEditorEndNever",Et="scheduler.recurrenceEditorEndOn",ht="scheduler.editorDelete",yt="scheduler.deleteConfirmation",vt="scheduler.deleteRecurringConfirmation",ft="scheduler.deleteOccurrence",kt="scheduler.deleteSeries",Dt="scheduler.deleteDialogTitle",St="scheduler.deleteRecurringDialogTitle",Ct="scheduler.dateTitle",bt="scheduler.timeTitle",It="scheduler.eventTitle",wt="scheduler.editorValidationRequired",Tt="scheduler.editorValidationStart",Rt="scheduler.editorValidationEnd",xt="scheduler.noEvents",At="scheduler.moreEvents",Nt={[wt]:"Field is required.",[Tt]:"Start time must be before End time.",[Rt]:"End time must be after Start time.",[xe]:"All events",[Ae]:"all day",[Ne]:"Today",[Oe]:"Day",[Fe]:"Month",[Me]:"Week",[ze]:"Work Week",[_e]:"Timeline",[Le]:"Agenda",[Pe]:"Delete",[He]:"Previous",[We]:"Next",[Ke]:"Show full day",[Ve]:"Show business hours",[Ge]:"Edit current occurrence",[Be]:"Edit the series",[Ue]:"Do you want to edit only this event occurrence or the whole series?",[Ze]:"Edit Recurring Item",[$e]:"Save",[qe]:"Cancel",[ht]:"Delete",[Ye]:"Event",[je]:"Title",[Xe]:"Start",[Qe]:"Start Time Zone",[Je]:"End",[et]:"End Time Zone",[tt]:"All Day Event",[rt]:"Description",[at]:"End in different Time Zone",[nt]:"Specify Time Zone",[lt]:"Repeat","scheduler.recurrenceEditorDailyInterval":"day(s)","scheduler.recurrenceEditorDailyRepeatEvery":"Repeat every","scheduler.recurrenceEditorWeeklyInterval":"week(s)","scheduler.recurrenceEditorWeeklyRepeatEvery":"Repeat every",[ot]:"Repeat on",[st]:"Day","scheduler.recurrenceEditorMonthlyInterval":"month(s)","scheduler.recurrenceEditorMonthlyRepeatEvery":"Repeat every",[ct]:"Repeat on",[it]:"of","scheduler.recurrenceEditorYearlyRepeatEvery":"Repeat every",[dt]:"Repeat on","scheduler.recurrenceEditorYearlyInterval":"year(s)","scheduler.recurrenceEditorFrequenciesDaily":"Daily","scheduler.recurrenceEditorFrequenciesMonthly":"Monthly","scheduler.recurrenceEditorFrequenciesNever":"Never","scheduler.recurrenceEditorFrequenciesWeekly":"Weekly","scheduler.recurrenceEditorFrequenciesYearly":"Yearly","scheduler.recurrenceEditorOffsetPositionsFirst":"First","scheduler.recurrenceEditorOffsetPositionsSecond":"Second","scheduler.recurrenceEditorOffsetPositionsThird":"Third","scheduler.recurrenceEditorOffsetPositionsFourth":"Fourth","scheduler.recurrenceEditorOffsetPositionsLast":"Last","scheduler.recurrenceEditorWeekdaysDay":"Day","scheduler.recurrenceEditorWeekdaysWeekday":"Weekday","scheduler.recurrenceEditorWeekdaysWeekendday":"Weekend Day",[ut]:"After",[mt]:"occurrence(s)",[pt]:"End",[gt]:"Never",[Et]:"On",[yt]:"Are you sure you want to delete this event?",[vt]:"Do you want to delete only this event occurrence or the whole series?",[ft]:"Delete current occurrence",[kt]:"Delete the series",[Dt]:"Delete Event",[St]:"Delete Recurring Item",[Ct]:"Date",[bt]:"Time",[It]:"Event",[xt]:"no events",[At]:"More events"},_t=f.forwardRef(((e,t)=>{var r;const l=f.useRef(null),u=f.useRef(null);f.useImperativeHandle(t,(()=>l.current));const{timezone:m}=ne(),p=a.ZonedDate.fromLocalDate(e.value,m),g=a.getDate(p),E=re(),h=n.useWindow(E),[y,v]=f.useState("desktop"),[k,D]=f.useState(!1),[S,C]=f.useState(!1),b=o.useInternationalization(),{dateFormat:I,shortDateFormat:w}=f.useContext(ie),T=pe(),[R]=ye(),x=T.end.getTime()-T.start.getTime()>27*a.MS_PER_DAY,A=b.format(I,x?R:T.zonedStart,x?R:T.zonedEnd.addDays(-1)),N=b.format(w,x?R:T.zonedStart,x?R:T.zonedEnd.addDays(-1)),_=f.useCallback((()=>{D(!k)}),[k]),M=f.useCallback((()=>{C(!0)}),[]),L=f.useCallback((()=>{D(!1),C(!1)}),[]),O=f.useCallback((t=>{if(e.onChange){const r=a.ZonedDate.fromUTCDate(z(t.value),m);e.onChange.call(void 0,{...t,value:r})}D(!1)}),[e.onChange,m]),F=f.useCallback((()=>{h().matchMedia&&v(h().matchMedia("(min-width: 1024px)").matches?"desktop":"mobile")}),[h]);f.useEffect((()=>{F();const e=h().ResizeObserver,t=e&&new e(F);return t&&t.observe(E.current),()=>{e&&t.disconnect()}}),[F,E,h]),f.useEffect((()=>{k&&S&&u.current&&u.current.focus()}),[S,k]);const{onFocus:P,onBlur:H}=n.useAsyncFocusBlur({onFocus:M,onBlur:L});return f.createElement(f.Fragment,null,f.createElement(s.Button,{ref:l,onFocus:P,onBlur:H,fillMode:"flat",className:"k-nav-current",icon:"calendar",svgIcon:d.calendarIcon,"aria-live":"polite",tabIndex:-1,onClick:_},"desktop"===y?A:N),f.createElement(i.Popup,{anchor:null==(r=l.current)?void 0:r.element,show:k},f.createElement(c.Calendar,{ref:u,onFocus:P,onBlur:H,onChange:O,value:g})))}));_t.displayName="KendoReactSchedulerNavigationDatePicker";const Mt=e=>{const[t,r]=De(),a=o.useLocalization(),n=f.useMemo((()=>"function"==typeof e.view.title?e.view.title.call(void 0,a):e.view.title),[e.view.title,a]),l=f.useCallback((()=>{e.view.name&&r(e.view.name)}),[r,e.view.name]);return f.createElement(s.Button,{className:"k-toolbar-button",role:"button",type:"button",tabIndex:-1,togglable:!0,selected:e.view.name===t,onClick:l},n)},zt=f.forwardRef((()=>{const e=f.useRef(null),[t,r]=f.useState("desktop"),a=oe(),l=n.useWindow(e),[c,i]=De(),u=a.find((e=>e.props.name===c)),m=o.useLocalization(),p=f.useCallback((e=>{i&&(e.syntheticEvent.preventDefault(),i(e.item.name))}),[i]),g=()=>{l().matchMedia&&r(l().matchMedia("(min-width: 1024px)").matches?"desktop":"mobile")};return f.useEffect((()=>{g();const t=l().ResizeObserver,r=t&&new t(g);return r&&r.observe(e.current),()=>{r&&r.disconnect()}}),[]),f.createElement("div",{className:n.classNames("k-toolbar-button-group k-button-group k-button-group-solid",{"k-scheduler-views":"desktop"===t,"k-scheduler-tools":"mobile"===t}),role:"group",ref:e},u&&"mobile"===t&&f.createElement(s.DropDownButton,{className:"k-views-dropdown",onItemClick:p,popupSettings:{popupClass:"k-scheduler-toolbar"},textField:"title",items:a.map((e=>({...e.props,selected:e.props.name===c,title:"function"==typeof e.props.title?e.props.title.call(void 0,m):e.props.title}))),text:f.createElement(f.Fragment,null,"function"==typeof u.props.title?u.props.title.call(void 0,m):u.props.title,f.createElement(n.IconWrap,{name:"caret-alt-down",icon:d.caretAltDownIcon}))}),"desktop"===t&&f.createElement(f.Fragment,null,a.map((e=>f.createElement(Mt,{key:e.props.name,view:e.props})))))}));zt.displayName="KendoReactSchedulerViewSelectorList";const Lt=f.forwardRef(((e,t)=>{const{className:r,...a}=e,l=f.useRef(null);return f.useImperativeHandle(t,(()=>({element:l.current,props:e}))),f.createElement(s.ToolbarItem,{ref:e=>{e&&(l.current=e.element)},className:n.classNames("k-scheduler-navigation",r),...a},e.children)})),Ot=f.createContext({});Ot.displayName="SchedulerViewPropsContext";const Ft=f.createContext([]),Pt=()=>f.useContext(Ft);Ft.displayName="SchedulerViewRangesContext";const Ht=f.createContext([[],$]),Wt=()=>f.useContext(Ht);Ht.displayName="SchedulerViewSlotsContext";const Kt=f.createContext([[],$]),Vt=()=>f.useContext(Kt);Kt.displayName="SchedulerViewItemsContext";const Gt=f.createContext([[],$]);Gt.displayName="SchedulerViewSelectedSlotsContext";const Bt=f.createContext([[],$]),Ut=()=>f.useContext(Bt);Bt.displayName="SchedulerViewSelectedItemsContext";const Zt=f.createContext([[],$]);Zt.displayName="SchedulerViewFocusedItemsContext";const $t=f.createContext([[],$]),qt=()=>f.useContext($t);$t.displayName="SchedulerViewFocusedSlotsContext";const Yt=({children:e,props:t,ranges:r,slots:a,items:n,selectedSlots:l,selectedItems:o,focusedItems:s,focusedSlots:c})=>f.createElement(Ot.Provider,{value:t},f.createElement(Ft.Provider,{value:r},f.createElement(Ht.Provider,{value:a},f.createElement(Kt.Provider,{value:n},f.createElement(Gt.Provider,{value:l},f.createElement(Bt.Provider,{value:o},f.createElement(Zt.Provider,{value:s},f.createElement($t.Provider,{value:c},e))))))));var jt=(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))(jt||{});var Xt=(e=>(e.select="SLOTS_SELECT_SELECT",e.reset="SLOTS_SELECT_RESET",e.add="SLOTS_SELECT_ADD",e))(Xt||{});const Qt=(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 Jt=(e=>(e.next="ITEMS_FOCUS_NEXT",e.prev="ITEMS_FOCUS_PREV",e))(Jt||{});var er=(e=>(e.up="SLOT_FOCUS_UP",e.down="SLOT_FOCUS_DOWN",e.left="SLOT_FOCUS_LEFT",e.right="SLOT_FOCUS_RIGHT",e))(er||{});const tr=(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)),rr=(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)),ar=(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)),nr=(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)),lr=f.forwardRef(((e,t)=>{const r=f.useRef(null);f.useImperativeHandle(t,(()=>r.current));const[a,l]=n.useCollection([]),[o,s]=n.useCollection([]),[c,i]=(e=>[[],(t,r)=>{switch(t.type){case"ITEMS_FOCUS_NEXT":{if(!t.item||!t.item.current||!e)return;const a=q(t.item,e,t.ignoreIsAllDay,!1);a&&a.current&&a.current.element&&(r.preventDefault(),a.current.element.focus());break}case"ITEMS_FOCUS_PREV":{if(!t.item||!t.item.current||!e)return;const a=q(t.item,e,t.ignoreIsAllDay,!0);a&&a.current&&a.current.element&&(r.preventDefault(),a.current.element.focus());break}}}])(a),[d,u]=(e=>[[],(t,r)=>{switch(t.type){case"SLOT_FOCUS_UP":{if(!t.slot.current||!e)return;const a=tr(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=nr(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=rr(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=ar(t.slot,e);a&&a.current&&a.current.element&&(r.preventDefault(),a.current.element.focus());break}}}])(o),[m,p]=(e=>{const[t,r]=f.useState([]),a=f.useCallback(((a,n)=>{switch(a.type){case"ITEMS_SELECT_SELECT":if(!a.item)return;r([a.item]);break;case"ITEMS_SELECT_SELECT_NEXT":{if(!a.item||!a.item.current||!e)return;const t=q(a.item,e,a.ignoreIsAllDay,!1);t&&(n.preventDefault(),r([t]));break}case"ITEMS_SELECT_SELECT_PREV":{if(!a.item||!a.item.current||!e)return;const t=q(a.item,e,a.ignoreIsAllDay,!0);t&&(n.preventDefault(),r([t]));break}case"ITEMS_SELECT_RESET":r([]);break;case"ITEMS_SELECT_ADD":if(!a.item)return;t.some((e=>e===a.item))||r([...t,a.item]);break;case"ITEMS_SELECT_REMOVE":if(!a.item)return;r([...t.filter((e=>e!==a.item))])}}),[e,t]);return[t,a]})(a),[g,E]=(e=>{const[t,r]=f.useState([]),a=f.useCallback((e=>{switch(e.type){case"SLOTS_SELECT_SELECT":if(!e.slot)return;r([e.slot]);break;case"SLOTS_SELECT_RESET":r([]);break;case"SLOTS_SELECT_ADD":if(!e.slot)return;t.some((t=>t===e.slot))||r([...t,e.slot])}}),[t]);return[t,a]})(),h=f.useCallback(((e,t)=>{E({type:Xt.reset}),p(e,t)}),[p,E]),y=f.useCallback(((e,t)=>{p({type:jt.reset},t),E(e)}),[p,E]),v=f.useMemo((()=>n.classNames("k-scheduler-layout k-scheduler-layout-flex",e.className)),[e.className]);return Qt({element:r,selector:".k-group-cell",attribute:"data-depth-index",explicitDepth:!0}),Qt({element:r,selector:".k-side-cell",attribute:"data-depth-index",explicitDepth:!1}),f.createElement(Yt,{props:e.props,ranges:e.ranges,items:[a,l],slots:[o,s],selectedItems:[m,h],selectedSlots:[g,y],focusedItems:[c,i],focusedSlots:[d,u]},f.createElement("div",{ref:r,style:e.style,className:v,role:"presentation"},e.children))}));lr.displayName="KendoReactSchedulerBaseView";const or=f.createContext({resource:{},groupIndex:0}),sr=e=>{const{nested:t,children:r,rowContentProps:a}=e,n=e.rowContent||dr,l=e.childRowContent||n,o=S(e.group,e.resources);return f.createElement("div",{className:"k-scheduler-group k-group-horizontal"},t?cr({resources:o,children:r,nested:t,groupIndex:0,rowContent:n,rowContentProps:a,childRowContent:l}):ir({resources:o,children:r,rowContent:n,nested:!!t,groupIndex:0,rowContentProps:a,childRowContent:l}))},cr=e=>{const{resources:t,rowContent:r,nested:a,children:n,groupIndex:l,rowContentProps:o,childRowContent:s}=e;if(l===t.length)return ir({resources:t,rowContent:r,children:n,nested:a,groupIndex:l,rowContentProps:o,childRowContent:s});const c=C(t,l),i=r;return f.createElement(f.Fragment,null,a?f.createElement("div",{className:"k-scheduler-row"},f.createElement(i,{resources:t,groupIndex:l,...o},c.map(((e,t)=>f.createElement("div",{key:t,className:"k-scheduler-cell k-heading-cell"},e.text))))):f.createElement(i,{resources:t,groupIndex:l,...o},c.map(((e,t)=>f.createElement("div",{key:t,className:"k-scheduler-cell k-heading-cell"},e.text)))),cr({resources:t,children:n,nested:a,rowContent:r,childRowContent:s,groupIndex:l+1}))},ir=e=>{const{resources:t,childRowContent:r,children:a,rowContentProps:n}=e,l=C(t,t.length-1),o=r,s=t.length>0;return f.createElement("div",{className:"k-scheduler-row"},f.createElement(o,{resources:t,...n},(l.length?l:X).map(((e,t)=>f.createElement("div",{key:t,className:"k-scheduler-cell k-group-cell"},f.createElement(or.Provider,{value:{resource:e,groupIndex:s?t:0}},a))))))};sr.displayName="KendoReactSchedulerHorizontalResourceIterator";const dr=e=>e.children,ur=e=>f.createElement(f.Fragment,null,f.createElement("div",{className:"k-scheduler-cell k-side-cell","data-range-index":e.rangeIndex}),e.children),mr=e=>{const{nested:t,wrapGroup:r,children:a}=e,n=e.cellContent||fr,l=S(e.group,e.resources);return f.createElement("div",{className:"k-scheduler-group"},t?r?f.createElement("div",{className:"k-scheduler-row"},f.createElement("div",{className:"k-sticky-cell"},Er({resources:l,children:a,cellContent:n,depth:0,groupIndex:0})),f.createElement("div",{className:"k-scheduler-cell k-group-content"},gr({resources:l,children:a,cellContent:n,depth:0,groupIndex:0},!1))):gr({resources:l,children:a,cellContent:n,depth:0,groupIndex:0},!0):r?f.createElement("div",{className:"k-scheduler-row"},f.createElement("div",{className:"k-sticky-cell"},pr({resources:l,children:a,cellContent:n,depth:0,groupIndex:0})),f.createElement("div",{className:"k-scheduler-cell k-group-content"},a)):hr({resources:l,children:a,cellContent:n,depth:0,groupIndex:0}))},pr=e=>f.createElement("div",{className:"k-scheduler-row"},f.createElement("div",{className:"k-scheduler-row"},e.resources.map(((e,t)=>f.createElement("div",{key:t,className:"k-scheduler-cell k-resource-cell k-heading-cell","data-depth-index":t}))))),gr=(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 f.createElement(or.Provider,{value:{resource:r[o],groupIndex:s?l:0}},a);const c=r[o].data.length;return r[o].data.map(((e,s)=>f.createElement("div",{key:s,className:"k-scheduler-row"},t&&f.createElement("div",{className:"k-scheduler-cell k-group-cell k-heading-cell","data-depth-index":o},e[r[o].textField]),f.createElement("div",{className:"k-scheduler-cell k-group-content k-resource-row","data-depth-index":o,"data-resource-index":c*l+s},gr({resources:r,children:a,cellContent:n,groupIndex:c*l+s,depth:o+1},t)))))},Er=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)=>f.createElement("div",{key:s,className:"k-scheduler-row"},f.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&&f.createElement("div",{className:"k-scheduler-cell k-resource-content"},Er({resources:t,children:r,cellContent:a,groupIndex:o*n+s,depth:l+1}))))):null},hr=e=>{const{resources:t,children:r,groupIndex:a,cellContent:n}=e;return f.createElement("div",{className:"k-scheduler-row"},vr(t),n,yr(r,t,a))},yr=(e,t,r)=>{const a=t.length>0;return f.createElement("div",{className:"k-scheduler-cell k-group-content"},f.createElement(or.Provider,{value:{resource:t[r],groupIndex:a?r:void 0}},e))},vr=e=>e.map(((e,t)=>f.createElement("div",{key:t,className:"k-scheduler-cell k-group-cell k-heading-cell","data-depth-index":t})));mr.displayName="KendoReactSchedulerVerticalResourceIterator";const fr=null,kr=e=>{const t=o.useLocalization();return f.createElement(f.Fragment,null,f.createElement("div",{className:"k-scheduler-cell k-heading-cell k-side-cell k-scheduler-times-all-day"},t.toLanguageString(Ae,Nt[Ae])),e.children)},Dr=f.forwardRef(((e,t)=>{const{as:r=Sr.as,...a}=e,l=f.useRef(null),s=f.useRef(null),c=o.useInternationalization(),i=f.useMemo((()=>n.classNames("k-scheduler-cell k-heading-cell",e.className)),[e.className]);return f.useImperativeHandle(s,(()=>({element:l.current&&l.current.element?l.current.element:l.current,props:e}))),f.useImperativeHandle(t,(()=>s.current)),f.createElement(r,{ref:r!==Sr.as?void 0:l,...a,className:i},c.formatDate(e.date,e.format?e.format:Sr.format))})),Sr={as:f.forwardRef((({as:e,format:t,start:r,end:a,...n},l)=>f.createElement("div",{...n,ref:l}))),format:"t"};Dr.displayName="KendoReactSchedulerTimeHeaderCell";const Cr=e=>{const{slot:t,children:r}=e;return f.createElement(f.Fragment,null,e.isMaster?f.createElement(Dr,{as:e.timeHeaderCell,date:t.zonedStart,start:t.zonedStart,end:t.zonedEnd,className:n.classNames("k-side-cell",{"k-major-cell":!e.isLast})}):f.createElement("div",{className:"k-scheduler-cell k-heading-cell k-side-cell"}),r)},br=e=>{const{onChange:t,data:r,validationMessage:a,visited:n,touched:o,modified:s,...c}=e,[i,d]=f.useState(r),u=f.useCallback((e=>t(e)),[t]),m=f.useCallback((e=>{const t=l.filterBy(r||[],e.filter);d(t)}),[]);return f.createElement(h.ComboBox,{style:{width:"100%"},data:i,filterable:!0,onFilterChange:m,onChange:u,...c})},Ir=e=>{const{value:t,data:r,onChange:a,...n}=e,l=f.useCallback((e=>{a&&a.call(void 0,e.currentTarget.dataset.value)}),[a]);return f.createElement(s.ButtonGroup,{className:"k-scheduler-recurrence-repeat",width:"100%",...n},r.map((e=>f.createElement(s.Button,{type:"button",key:e.value,selected:e.value===t,onClick:l,"data-value":e.value,togglable:!0},e.text))))},wr=e=>e.charAt(0).toUpperCase()+e.slice(1),Tr=["first","second","third","fourth","last"],Rr=["never","daily","weekly","monthly","yearly"],xr=[{day:0,offset:0},{day:1,offset:0},{day:2,offset:0},{day:3,offset:0},{day:4,offset:0},{day:5,offset:0},{day:6,offset:0}],Ar=[{day:1,offset:0},{day:2,offset:0},{day:3,offset:0},{day:4,offset:0},{day:5,offset:0}],Nr=[{day:0,offset:0},{day:6,offset:0}],_r=e=>{switch(e){case"day":return xr;case"weekday":return Ar;case"weekend":return Nr}},Mr=e=>{const{value:t,data:r,onChange:a,...n}={...zr,...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 f.createElement(s.ButtonGroup,{width:"auto",...n},(e.data||zr.data).map((e=>f.createElement(s.Button,{type:"button",key:e.value,"data-key":e.value,selected:t.some((t=>t===e.value)),togglable:!0,onClick:l},wr(e.text)))))},zr={data:[],value:[]},Lr=e=>{const t=o.useInternationalization(),r=o.useLocalization(),{timezone:n}=ne(),[l,s]=f.useState(1),[i,d]=f.useState(a.ZonedDate.fromUTCDate(e.start)),u=f.useCallback(((e,t)=>{const a=t?e:"scheduler.recurrenceEditor"+e;return r.toLanguageString(a,Nt[a])}),[r]),p=f.useMemo((()=>{var t;return(e=>y.parseRule({recurrenceRule:e})||{})(null!=(t=e.value)?t:Fr.value)}),[e.value]),v=f.useMemo((()=>(e=>Rr.map((t=>({value:t,text:e("Frequencies"+wr(t))}))))(u)),[u]),k=f.useMemo((()=>(e=>M(e)&&!(e=>(e=>null==e)(e)||e.trim&&0===e.trim().length)(e.freq)?e.freq:"never")(p)),[p]),D=f.useMemo((()=>((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)})(t,u)),[t,u]),S=f.useMemo((()=>((e,t,r)=>{var a;let n;if(M(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]})(D,p,e.start)),[D,p,e.start]),C=f.useMemo((()=>(e=>e.dateFormatNames({type:"months",nameType:"wide",standAlone:!0}).map(((e,t)=>({text:e,value:t+1}))))(t)),[t]),b=f.useMemo((()=>((e,t)=>e.find((e=>(t.byMonth?t.byMonth[0]:null)===e.value))||e[0])(C,p)),[C,p]),I=f.useMemo((()=>(e=>{const t=[1,2,3,4,-1];return Tr.map(((r,a)=>({text:e("OffsetPositions"+wr(r)),value:t[a]})))})(u)),[u]),w=f.useMemo((()=>((e,t)=>e.find((e=>e.value===(t.bySetPosition?t.bySetPosition[0]:t.byWeekDay&&t.byWeekDay[0]?t.byWeekDay[0].offset:1)))||e[0])(I,p)),[I,p]),T=f.useMemo((()=>(e=>M(e.count)?"count":M(e.until)?"until":"never")(p)),[p]),R=f.useMemo((()=>((e,t)=>M(e.byMonthDay)&&e.byMonthDay.length>0?e.byMonthDay[0]:t.getDate())(p,e.start)),[p,e.start]),x=f.useMemo((()=>(e=>M(e.until)?a.toLocalDate(e.until):null)(p)),[p.until]),A=f.useMemo((()=>(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))})(t)),[t]),N=f.useMemo((()=>(e=>M(e.byWeekDay)?"weekday":M(e.byMonthDay)?"monthday":void 0)(p)),[p.byWeekDay,p.byMonthDay]),_=f.useCallback((r=>{"never"===r.freq?e.onChange({value:null}):(void 0===r.weekStart&&(r.weekStart=t.firstDay()),e.onChange({value:y.serializeRule(r,e.timezone)}))}),[e.onChange,e.timezone]),z=f.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]),_(r)}),[_,e.start,n]),L=f.useCallback((e=>{const t=e.value;_(Object.assign({},p,{interval:t}))}),[_,p]),O=f.useCallback((e=>{const t=e.value;_(Object.assign({},p,{count:t})),null!==t&&s(t)}),[_,p]),F=f.useCallback((t=>{const r=t.value;if(!r)return;const n=a.ZonedDate.fromLocalDate(r,e.timezone);_(Object.assign({},p,{until:n})),d(n)}),[_,p,e.timezone]),P=f.useCallback((e=>{_(Object.assign({},p,{byWeekDay:A.filter((t=>e.some((e=>e===t.value)))).map((e=>({offset:0,day:e.value})))}))}),[_,p,A]),H=f.useCallback((e=>{const t=Object.assign({},p),r=e.target.value;"string"==typeof r.value?(t.byWeekDay=_r(r.value),t.bySetPosition=[w.value]):(t.bySetPosition=void 0,t.byWeekDay=[{day:r.value,offset:w.value}]),_(t)}),[w.value,_,p]),W=f.useCallback((e=>{_(Object.assign({},p,{byMonthDay:[e.value]}))}),[_,p]),K=f.useCallback((e=>{const t=e.value;_(Object.assign({},p,{byMonth:[t.value]}))}),[_,p]),V=f.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=i,r.count=void 0}_(r)}),[_,p,e.timezone]),G=f.useCallback((e=>{const t=Object.assign({},p);"monthday"===e.value?(t.byWeekDay=void 0,t.bySetPosition=void 0,t.byMonthDay=[R]):"weekday"===e.value&&(t.byMonthDay=void 0,"string"==typeof S.value?(t.bySetPosition=[w.value],t.byWeekDay=_r(S.value)):t.byWeekDay=[{day:S.value,offset:w.value}]),_(t)}),[_,p,R,S]),B=f.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}_(t)}),[_,p]);return f.createElement(f.Fragment,null,f.createElement(m.FieldWrapper,null,f.createElement(g.Label,{className:"k-form-label"},r.toLanguageString(lt,Nt[lt])),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(Ir,{value:k,data:v,onChange:z}))),"never"!==k&&f.createElement(m.FieldWrapper,null,f.createElement(g.Label,{editorId:"interval-editor",className:"k-form-label"},u(wr(k)+"RepeatEvery")),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(E.NumericTextBox,{min:1,step:1,defaultValue:1,value:p.interval,onChange:L,id:"interval-editor",className:"k-recur-interval"})," ",f.createElement(g.Label,{editorId:"interval-editor",className:"k-form-label"},u(wr(k)+"Interval")))),"weekly"===k&&f.createElement(m.FieldWrapper,null,f.createElement(g.Label,{className:"k-form-label"},u(ot,!0)),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(Mr,{data:A,value:(p.byWeekDay||[]).map((({day:e})=>e)),onChange:P}))),"monthly"===k&&f.createElement(m.FieldWrapper,null,f.createElement(g.Label,{key:"recurrence-repeat-on-monthly-label",className:"k-form-label"},u(ct,!0)),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(E.RadioGroup,{value:N,onChange:G,item:Or,className:"k-reset",data:[{value:"monthday",label:u(st,!0),children:[f.createElement(f.Fragment,{key:"separator"}," "),f.createElement(E.NumericTextBox,{key:"weekday-day",min:1,max:31,disabled:"monthday"!==N,value:p&&p.byMonthDay&&p.byMonthDay[0],onChange:W,width:"auto"})]},{value:"weekday",label:" ",children:[f.createElement(h.DropDownList,{key:"weekday-offset",textField:"text",dataItemKey:"value",disabled:"weekday"!==N,data:I,value:w,onChange:B,style:{width:"auto"}}),f.createElement(f.Fragment,{key:"separator"}," "),f.createElement(h.DropDownList,{key:"weekday-value",disabled:"weekday"!==N,value:S,data:D,onChange:H,textField:"text",dataItemKey:"value",style:{width:"auto"}})]}]}))),"yearly"===k&&f.createElement(m.FieldWrapper,null,f.createElement(g.Label,null,u(dt,!0)),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(E.RadioGroup,{value:N,item:Or,onChange:G,className:"k-reset",data:[{value:"monthday",label:" ",children:[f.createElement(h.DropDownList,{key:"monthday-month",disabled:"monthday"!==N,value:b,data:C,textField:"text",dataItemKey:"value",onChange:K,style:{width:"auto"}}),f.createElement(f.Fragment,{key:"separator"}," "),f.createElement(E.NumericTextBox,{key:"monthday-day",min:1,max:31,disabled:"monthday"!==N,value:R,onChange:W,width:"auto"})]},{value:"weekday",label:" ",children:[f.createElement(h.DropDownList,{key:"yearly-weekday-offset",textField:"text",dataItemKey:"value",disabled:"weekday"!==N,data:I,value:w,onChange:B,style:{width:"auto"}}),f.createElement(f.Fragment,{key:"yearly-separator-1"}," "),f.createElement(h.DropDownList,{key:"yearly-weekday-day",textField:"text",dataItemKey:"value",disabled:"weekday"!==N,value:S,data:D,onChange:H,style:{width:"auto"}}),f.createElement(f.Fragment,{key:"yearly-separator-2"}," "),f.createElement("span",{key:"yearly-weekday-of-label"},u(it,!0)),f.createElement(f.Fragment,{key:"yearly-separator-3"}," "),f.createElement(h.DropDownList,{key:"yearly-weekday-month",textField:"text",dataItemKey:"value",disabled:"weekday"!==N,value:b,data:C,onChange:K,style:{width:"auto"}})]}]}))),"never"!==k&&f.createElement("div",{className:"k-scheduler-recurrence-end-rule-editor"},f.createElement(m.FieldWrapper,null,f.createElement(g.Label,{className:"k-form-label"},u(pt,!0)),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(E.RadioGroup,{item:Or,value:T,onChange:V,data:[{value:"never",label:u(gt,!0)},{value:"count",label:u(ut,!0),children:[f.createElement(f.Fragment,{key:"separator-1"}," "),f.createElement(E.NumericTextBox,{key:"endrule-after-editor",id:"k-endrule-after",className:"k-recur-count",min:1,width:"auto",value:"count"===T?p.count:l,onChange:O,disabled:"count"!==T}),f.createElement(f.Fragment,{key:"separator-2"}," "),f.createElement(g.Label,{key:"endrule-after-label",className:"k-radio-label",editorId:"k-endrule-after"},u(mt,!0))]},{value:"until",label:u(Et,!0),children:[f.createElement(f.Fragment,{key:"separator"}," "),f.createElement(c.DatePicker,{key:"k-endrule-until-editor",id:"k-endrule-until",disabled:"until"!==T,min:e.start,value:"until"===T?x:a.toLocalDate(i),onChange:F,width:"auto"})]}]})))))},Or=e=>f.createElement("li",{...e},e.children),Fr={value:""};Lr.displayName="KendoReactSchedulerRepeatEditor";const Pr=e=>{const{as:t=Kr.as,value:r,onChange:a,...n}=e,{timezone:l}=ne();return f.createElement(t,{...n,value:Hr(r,l),onChange:e=>{a&&a({value:Wr(e.target.value,l)})}})},Hr=(e,t)=>{if(e){const r=a.toLocalDate(a.ZonedDate.fromLocalDate(e,t).toUTCDate());return r.setUTCFullYear(e.getFullYear()),r}return e},Wr=(e,t)=>{if(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},Kr={as:c.DateTimePicker},Vr=f.forwardRef(((e,t)=>{const r=f.useRef(null),l=f.useRef(null),s=a.timezoneNames(),i=o.useLocalization(),d=ce(),{resources:u,timezone:p}=ne();f.useImperativeHandle(l,(()=>({element:r.current&&r.current.element?r.current.element:r.current,props:e}))),f.useImperativeHandle(t,(()=>l.current));const{as:E=Gr.as,...h}=e,{titleLabel:y=Gr.titleLabel,titleError:v=Gr.titleError,titleEditor:k=Gr.titleEditor,startLabel:D=Gr.startLabel,startError:S=Gr.startError,startEditor:C=Gr.startEditor,startTimezoneLabel:b=Gr.startTimezoneLabel,startTimezoneError:I=Gr.startTimezoneError,startTimezoneEditor:w=Gr.startTimezoneEditor,startTimezoneCheckedLabel:T=Gr.startTimezoneCheckedLabel,startTimezoneCheckedEditor:R=Gr.startTimezoneCheckedEditor,endLabel:x=Gr.endLabel,endError:A=Gr.endError,endEditor:N=Gr.endEditor,endTimezoneLabel:_=Gr.endTimezoneLabel,endTimezoneError:M=Gr.endTimezoneError,endTimezoneEditor:z=Gr.endTimezoneEditor,endTimezoneCheckedLabel:L=Gr.endTimezoneCheckedLabel,endTimezoneCheckedEditor:O=Gr.endTimezoneCheckedEditor,allDayLabel:F=Gr.allDayLabel,allDayEditor:P=Gr.allDayEditor,recurrenceEditor:H=Gr.recurrenceEditor,descriptionLabel:W=Gr.descriptionLabel,descriptionEditor:K=Gr.descriptionEditor,descriptionError:V=Gr.descriptionError,resourceLabel:G=Gr.resourceLabel,resourceEditor:B=Gr.resourceEditor}=e,U=e.valueGetter(d.start)||new Date,Z=e.valueGetter(d.startTimezone)||p||"",$=e.valueGetter(d.endTimezone)||p||"",q=f.useMemo((()=>i.toLanguageString(wt,Nt[wt])),[i]),[Y,j]=f.useState(!!e.valueGetter(d.startTimezone)),[X,Q]=f.useState(!!e.valueGetter(d.endTimezone)),J=f.useCallback((t=>{t.value||(e.onChange(d.startTimezone,{value:null}),e.onChange(d.endTimezone,{value:null}),Q(t.value)),j(t.value)}),[e.onChange,d.startTimezone,d.endTimezone]),ee=f.useCallback((t=>{t.value||e.onChange(d.endTimezone,{value:null}),Q(t.value)}),[e.onChange]),te=f.useCallback((e=>e?void 0:q),[q]),re=f.useCallback(((e,t)=>Y?te(t(d.startTimezone)):void 0),[te,Y,d.startTimezone]),ae=f.useCallback(((e,t)=>Y&&X?te(t(d.endTimezone))||te(t(d.startTimezone)):void 0),[te,Y,X,d.startTimezone,d.endTimezone]),le=f.useMemo((()=>n.classNames("k-scheduler-edit-form",e.className)),[e.className]);return f.createElement(E,{ref:E===Gr.as?r:void 0,...h,className:le},f.createElement(f.Fragment,null,f.createElement(m.FieldWrapper,null,f.createElement(m.Field,{name:d.title,component:y,editorId:"k-scheduler-editor-title",className:"k-form-label"},i.toLanguageString(je,Nt[je])),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(m.Field,{id:"k-scheduler-editor-title",name:d.title,field:d.title,component:k}),e.errors[d.title]&&f.createElement(m.Field,{name:d.title,component:v},e.errors[d.title]))),f.createElement(m.FieldWrapper,null,f.createElement(m.Field,{name:d.start,component:D,editorId:"k-scheduler-editor-start",className:"k-form-label"},i.toLanguageString(Xe,Nt[Xe])),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(m.Field,{id:"k-scheduler-editor-start",name:d.start,width:"auto",component:C,as:e.valueGetter(d.isAllDay)?c.DatePicker:c.DateTimePicker,timezone:p}),e.errors[d.start]&&f.createElement(m.Field,{name:d.start,component:S},e.errors[d.start]))),f.createElement(m.FieldWrapper,null,f.createElement(T,{className:"k-form-label"}),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(R,{id:"k-scheduler-editor-set-start-timezone",onChange:J,value:Y}),f.createElement(T,{className:"k-checkbox-label",editorId:"k-scheduler-editor-set-start-timezone"},i.toLanguageString(nt,Nt[nt])))),Y&&f.createElement(m.FieldWrapper,null,f.createElement(m.Field,{name:d.start,component:b,className:"k-form-label"},i.toLanguageString(Qe,Nt[Qe])),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(m.Field,{component:w,value:Z,validator:re,data:s,name:d.startTimezone}),e.errors[d.startTimezone]&&f.createElement(m.Field,{name:d.startTimezone,component:I},e.errors[d.startTimezone]))),f.createElement(m.FieldWrapper,null,f.createElement(m.Field,{name:d.end,component:x,editorId:"k-scheduler-editor-end",className:"k-form-label"},i.toLanguageString(Je,Nt[Je])),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(m.Field,{id:"k-scheduler-editor-end",name:d.end,width:"auto",component:N,as:e.valueGetter(d.isAllDay)?c.DatePicker:c.DateTimePicker,timezone:p}),e.errors[d.end]&&f.createElement(m.Field,{name:d.end,component:A},e.errors[d.end]))),Y&&f.createElement(m.FieldWrapper,null,f.createElement("div",{className:"k-form-field-wrap"},f.createElement(O,{id:"k-scheduler-editor-set-end-timezone",onChange:ee,value:X})),f.createElement(L,{editorId:"k-scheduler-editor-set-end-timezone",className:"k-form-label"},i.toLanguageString(at,Nt[at]))),X&&f.createElement(m.FieldWrapper,null,f.createElement(m.Field,{name:d.endTimezone,component:_,className:"k-form-label"},i.toLanguageString(et,Nt[et])),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(m.Field,{value:$,data:s,validator:ae,component:z,name:d.endTimezone}),e.errors[d.endTimezone]&&f.createElement(m.Field,{name:d.endTimezone,component:M},e.errors[d.endTimezone]))),f.createElement(m.FieldWrapper,null,f.createElement(m.Field,{name:d.isAllDay,component:g.Label,className:"k-form-label"}),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(m.Field,{id:"k-is-allday-checkbox",name:d.isAllDay,component:P}),f.createElement(m.Field,{name:d.isAllDay,field:d.isAllDay,editorId:"k-is-allday-checkbox",className:"k-checkbox-label",component:F},i.toLanguageString(tt,Nt[tt])))),f.createElement("div",{className:"k-recurrence-editor"},f.createElement(m.Field,{component:H,field:d.recurrenceRule,name:d.recurrenceRule,start:U})),f.createElement(m.FieldWrapper,null,f.createElement(m.Field,{name:d.description,component:W,className:"k-form-label"},i.toLanguageString(rt,Nt[rt])),f.createElement("div",{className:"k-form-field-wrap"},f.createElement(m.Field,{component:K,name:d.description,rows:1,id:"k-event-description"}),e.errors[d.description]&&f.createElement(m.Field,{name:d.description,component:V},e.errors[d.description]))),(u||[]).map((e=>f.createElement(m.FieldWrapper,{key:e.field},f.createElement(m.Field,{name:e.field,component:G,className:"k-form-label"}),f.createElement(g.Label,{className:"k-form-label"},e.name),f.createElement(m.Field,{name:e.field,component:B,resource:e,multiple:e.multiple,data:e.data,textField:e.textField,valueField:e.valueField,colorField:e.colorField}))))))})),Gr={as:f.forwardRef(((e,t)=>f.createElement(m.FormElement,{ref:t,id:e.id,style:e.style,tabIndex:e.tabIndex,className:e.className,horizontal:e.horizontal,children:e.children}))),titleLabel:g.Label,titleError:g.Error,titleEditor:E.Input,startLabel:g.Label,startError:g.Error,startEditor:Pr,startTimezoneLabel:g.Label,startTimezoneError:g.Error,startTimezoneEditor:br,startTimezoneCheckedLabel:g.Label,startTimezoneCheckedEditor:E.Checkbox,endLabel:g.Label,endError:g.Error,endEditor:Pr,endTimezoneLabel:g.Label,endTimezoneError:g.Error,endTimezoneEditor:br,endTimezoneCheckedLabel:g.Label,endTimezoneCheckedEditor:E.Checkbox,allDayLabel:g.Label,allDayEditor:E.Checkbox,recurrenceEditor:Lr,descriptionLabel:g.Label,descriptionEditor:E.TextArea,descriptionError:g.Error,resourceLabel:g.Label,resourceEditor:e=>{const t=e.multiple?h.MultiSelect:h.DropDownList,r=f.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=f.useCallback(((t,r)=>{const a=f.createElement(f.Fragment,null,e.colorField&&f.createElement("span",{key:1,className:"k-scheduler-mark",style:{backgroundColor:r.dataItem[e.colorField],marginRight:M(r.dataItem[e.valueField])?"8px":"4px"}}," "),f.createElement("span",{key:2},"  ",t.props.children));return f.cloneElement(t,{...t.props},a)}),[e.colorField,e.valueField]),n=f.useCallback(((t,r)=>{const a=f.createElement(f.Fragment,null,e.colorField&&r&&f.createElement("span",{key:1,className:"k-scheduler-mark",style:{backgroundColor:r[e.colorField],marginRight:r[e.valueField]?"8px":"4px"}}," "),t.props.children);return f.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 f.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})}};Vr.displayName="KendoReactSchedulerFormEditor";const Br=f.forwardRef(((e,t)=>{const{onCancel:r,onClose:a,onSubmit:l,editor:c,dialog:i=Ur.dialog,validator:u=Ur.validator,...g}=e,E=f.useRef(null);f.useImperativeHandle(E,(()=>({props:e}))),f.useImperativeHandle(t,(()=>E.current));const h=o.useLocalization(),y=ce(),v=f.useMemo((()=>h.toLanguageString(wt,Nt[wt])),[h]),D=f.useMemo((()=>h.toLanguageString(Rt,Nt[Rt])),[h]),S=f.useMemo((()=>h.toLanguageString($e,Nt[$e])),[h]),C=f.useMemo((()=>h.toLanguageString(qe,Nt[qe])),[h]),b=f.useMemo((()=>h.toLanguageString(Ye,Nt[Ye])),[h]),I=f.useMemo((()=>h.toLanguageString(Tt,Nt[Tt])),[h]),w=f.useCallback((e=>{r&&r.call(void 0,{value:null,syntheticEvent:e,target:E.current})}),[r]),T=f.useCallback((({syntheticEvent:e})=>{a&&a.call(void 0,{value:null,syntheticEvent:e,target:E.current})}),[a]),R=f.useCallback(((e,t)=>{l&&l.call(void 0,{value:e,syntheticEvent:t,target:E.current})}),[l]),x=f.useCallback(((e,t)=>e&&t(y.end)&&e.getTime()>t(y.end).getTime()?I:void 0),[y,I]),A=f.useCallback(((e,t)=>e&&t(y.start)&&e.getTime()<t(y.start).getTime()?D:void 0),[y,D]),N=f.useCallback((e=>e?void 0:v),[v]),_=f.useCallback(((e,t)=>{const r={};r[y.start]=[N(t(y.start)),x(t(y.start),t)].filter(Boolean).reduce(((e,t)=>e||t),""),r[y.end]=[N(t(y.start)),A(t(y.start),t)].filter(Boolean).reduce(((e,t)=>e||t),"");const a=u(e,t);return{...r,...a}}),[A,y.end,y.start,N,x,u]);return n.canUseDOM?k.createPortal(f.createElement(m.Form,{initialValues:e.dataItem,onSubmit:R,validator:_,render:e=>f.createElement(i,{title:b,minWidth:400,onClose:T,className:"k-scheduler-edit-dialog"},f.createElement(Vr,{...e,as:c}),f.createElement(p.DialogActionsBar,{layout:"start"},f.createElement(s.Button,{themeColor:"primary",disabled:!e.allowSubmit,onClick:e.onSubmit,icon:"save",svgIcon:d.saveIcon},S),f.createElement(s.Button,{onClick:w,icon:"cancel",svgIcon:d.cancelIcon},C))),...g}),document&&document.body):null})),Ur={dialog:p.Dialog,validator:()=>({})};Br.displayName="KendoReactSchedulerForm";const Zr=f.forwardRef(((e,t)=>{const{onFocus:r,onBlur:a,onClick:l,onMouseEnter:o,onMouseLeave:s,onMouseOut:c,onMouseOver:i,onDoubleClick:d,onKeyDown:u,onKeyPress:m,onKeyUp:p}=e,{slot:g,element:E}=((e,t)=>{const{_ref:r}=e,a=f.useRef(null),l=f.useRef(null),[,o]=Wt();return f.useImperativeHandle(a,(()=>({element:l.current,props:e}))),f.useImperativeHandle(t,(()=>a.current)),f.useImperativeHandle(r,(()=>a.current)),f.useEffect((()=>(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,y=f.useMemo((()=>{var t,r;const a=null!=(t=e.isWorkHour)?t:$r.isWorkHour,l=null!=(r=e.isWorkDay)?r:$r.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]),v=f.useMemo((()=>({userSelect:"none",...e.style})),[e.style]),k=f.useCallback((e=>{r&&r.call(void 0,{syntheticEvent:e,target:g.current})}),[r,g]),D=f.useCallback((e=>{a&&a.call(void 0,{syntheticEvent:e,target:g.current})}),[a,g]),S=f.useCallback((e=>{l&&l.call(void 0,{syntheticEvent:e,target:g.current})}),[l,g]),C=f.useCallback((e=>{i&&i.call(void 0,{syntheticEvent:e,target:g.current})}),[i,g]),b=f.useCallback((e=>{c&&c.call(void 0,{syntheticEvent:e,target:g.current})}),[c,g]),I=f.useCallback((e=>{o&&o.call(void 0,{syntheticEvent:e,target:g.current})}),[o,g]),w=f.useCallback((e=>{s&&s.call(void 0,{syntheticEvent:e,target:g.current})}),[s,g]),T=f.useCallback((e=>{d&&d.call(void 0,{syntheticEvent:e,target:g.current})}),[d,g]),R=f.useCallback((e=>{u&&u.call(void 0,{syntheticEvent:e,target:g.current})}),[u,g]),x=f.useCallback((e=>{m&&m.call(void 0,{syntheticEvent:e,target:g.current})}),[m,g]),A=f.useCallback((e=>{p&&p.call(void 0,{syntheticEvent:e,target:g.current})}),[p,g]);return f.createElement("div",{ref:E,id:e.id,style:v,className:y,tabIndex:h,"aria-selected":e.selected||void 0,onFocus:k,onBlur:D,onClick:S,onMouseEnter:I,onMouseLeave:w,onMouseOver:C,onMouseOut:b,onDoubleClick:T,onKeyDown:R,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)})),$r={isWorkHour:!0,isWorkDay:!0};Zr.displayName="KendoReactSchedulerSlot";const qr=f.forwardRef(((e,t)=>{var r;const{slot:a,_ref:l,...o}=e,s=a||Yr.slot,c=f.useRef(null),i=f.useRef(null);return f.useImperativeHandle(c,(()=>({props:e}))),f.useImperativeHandle(l,(()=>i.current)),f.useImperativeHandle(t,(()=>c.current)),((e,t)=>{const r=f.useRef(),a=f.useRef(0),l=re(),o=f.useCallback((()=>{if(!t||!e.current)return;const r=e.current.element,n=e.current.props;if(!r)return;const l=I(r);let o=0;const s=n.items.filter((e=>e._ref.current));s.forEach((e=>{if(!e._ref.current)return;const{height:t}=b(e._ref.current.element);o+=t}));const c=1*s.length*2+o-(l||0)+("object"==typeof t&&t.offsetTop?t.offsetTop:0)+("object"==typeof t&&t.offsetBottom?t.offsetBottom:0);s.length?c>a.current-l&&w(r,{height:c},!0):r&&(r.style.minHeight="")}),[t,e]),s=f.useCallback((()=>{void 0!==r.current&&window.cancelAnimationFrame(r.current),r.current=window.requestAnimationFrame((()=>{o()}))}),[o]);n.useIsomorphicLayoutEffect((()=>{if(!e.current)return;const t=e.current.element;t&&(a.current=t.clientHeight)}),[]),f.useEffect(o,[e,e.current&&e.current.props,t]),f.useEffect((()=>{if(!e.current)return;const t=e.current.props.items.filter((e=>e._ref.current)).map((e=>{if(!e._ref.current||!e._ref.current.element||!l.current)return;const t=window.ResizeObserver,r=t&&new t(s);return r&&r.observe(e._ref.current.element),()=>{r&&r.disconnect()}}));return()=>{t.forEach((e=>e&&e()))}}),[s,l,e])})(i,null!=(r=e.expandable)?r:Yr.expandable),f.createElement(s,{...o,_ref:i})})),Yr={slot:Zr,expandable:!1};qr.displayName="KendoReactSchedulerViewSlot";const jr=f.createContext([null]);jr.displayName="SchedulerEditSlotPropsContext";const Xr=f.createContext([null]);Xr.displayName="SchedulerEditSlotFormItemContext";const Qr=({props:e,form:t,children:r})=>f.createElement(jr.Provider,{value:e},f.createElement(Xr.Provider,{value:t},r)),Jr=e=>{const t=f.useContext(ae),r=void 0!==e?e:t.editable||!1,a=!0===r||void 0!==r&&!1!==r&&!0===r.edit,n=!0===r||void 0!==r&&!1!==r&&!0===r.resize,l=!0===r||void 0!==r&&!1!==r&&!0===r.remove,o=!0===r||void 0!==r&&!1!==r&&!0===r.drag;return{add:!0===r||void 0!==r&&!1!==r&&!0===r.add,edit:a,drag:o,remove:l,resize:n,select:!0===r||void 0!==r&&!1!==r&&!0===r.select}},ea=f.forwardRef(((e,t)=>{const{_ref:r,onDataAction:a,viewSlot:l,form:o,formItem:s,onFormItemChange:c,...i}=e,[d,u]=f.useState(e.tabIndex),m=f.useRef(null),p=f.useRef(null);f.useImperativeHandle(p,(()=>({props:e}))),f.useImperativeHandle(t,(()=>p.current)),f.useImperativeHandle(r,(()=>m.current));const g=Jr(e.editable),E=ce(),[h]=Wt(),[y]=Vt(),[v,k]=f.useContext(Gt),[,D]=qt(),S=o||ta.form,C=l||ta.viewSlot,[b,I]=be(null,s,e.onFormItemChange),w=v.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))),T=f.useCallback((()=>{const t={};if(_(t,E.start,new Date(e.start.getTime())),_(t,E.end,new Date(e.end.getTime())),_(t,E.isAllDay,e.isAllDay),e.group.resources.length)for(let r=0;r<e.group.resources.length;r++){const a=e.group.resources[r];if(x(e.group.resources)){const n=N(e.group.resources[r],a.valueField);_(t,a.field,a.multiple?[n]:n)}else _(t,a.field,a.multiple?[]:void 0)}return t}),[E.start,E.end,E.isAllDay,e.start,e.end,e.isAllDay,e.group.resources]),R=f.useCallback((t=>{g.select&&k({type:Xt.select,slot:m},t.syntheticEvent),e.onFocus&&e.onFocus.call(void 0,t)}),[k,g.select,e.onFocus]),A=f.useCallback((t=>{if(g.add){const e=T();I(e,t)}e.onDoubleClick&&e.onDoubleClick.call(void 0,t)}),[T,g.add,e.onDoubleClick,I]),M=f.useCallback((e=>{let t;switch(e.syntheticEvent.keyCode){case n.Keys.left:if(!h)return;e.syntheticEvent.preventDefault(),D({type:er.left,slot:m},e.syntheticEvent);break;case n.Keys.right:if(!h)return;e.syntheticEvent.preventDefault(),D({type:er.right,slot:m},e.syntheticEvent);break;case n.Keys.up:if(!h)return;e.syntheticEvent.preventDefault(),D({type:er.up,slot:m},e.syntheticEvent);break;case n.Keys.down:if(!h)return;e.syntheticEvent.preventDefault(),D({type:er.down,slot:m},e.syntheticEvent);break;case n.Keys.enter:{if(!h||!g.add)return;const e=T();I(e);break}case n.Keys.tab:t=(e=>{const t=e.props.items.find((e=>0===e.order))||e.props.items[0];return t&&t._ref.current})(e.target)}t&&(e.syntheticEvent.preventDefault(),t.element&&t.element.focus())}),[T,D,g.add,I,h]),z=f.useCallback((e=>{a&&a.call(void 0,{type:ee.create,series:!1,dataItem:e.value},e),I(null,e.syntheticEvent)}),[a,I]),L=f.useCallback((e=>{I(null,e.syntheticEvent)}),[I]),O=f.useCallback((e=>{I(null,e)}),[I]),F=f.useCallback(((e,t)=>{I&&I(e,t)}),[I]);return f.useEffect((()=>{const t=h.length&&h[0].current===m.current;u(void 0!==e.tabIndex?null===e.tabIndex?void 0:e.tabIndex:0===v.length&&t&&0===y.length?0:void 0)}),[y,e.tabIndex,v.length,h]),f.createElement(Qr,{props:e,form:[b,F]},f.createElement(C,{...i,_ref:m,selected:w,tabIndex:d,onFocus:R,onDoubleClick:A,onKeyDown:M}),b&&f.createElement(S,{dataItem:b,onSubmit:z,onClose:O,onCancel:L}))})),ta={viewSlot:qr,form:Br};ea.displayName="KendoReactSchedulerEditSlot";const ra=f.forwardRef(((e,t)=>{const{isRemove:r,onClose:a,onSeriesClick:l,onOccurrenceClick:c}=e,i=f.useRef(null);f.useImperativeHandle(i,(()=>({props:e}))),f.useImperativeHandle(t,(()=>i.current));const d=o.useLocalization(),u=e=>d.toLanguageString(e,Nt[e]),m=u(Ge),g=u(Be),E=u(Ue),h=u(Ze),y=u(ft),v=u(kt),D=u(St),S=u(vt),C=r?D:h,b=r?S:E,I=r?y:m,w=r?v:g,T=f.useCallback((({syntheticEvent:e})=>{a&&a.call(void 0,{syntheticEvent:e,value:null,target:i.current})}),[a]),R=f.useCallback((e=>{l&&l.call(void 0,{syntheticEvent:e,value:null,target:i.current})}),[l]),x=f.useCallback((e=>{c&&c.call(void 0,{syntheticEvent:e,value:null,target:i.current})}),[c]);return n.canUseDOM?k.createPortal(f.createElement(p.Dialog,{title:C,onClose:T},b,f.createElement(p.DialogActionsBar,null,f.createElement(s.Button,{onClick:x},I),f.createElement(s.Button,{onClick:R},w))),document&&document.body):null}));ra.displayName="KendoReactSchedulerSchedulerOccurrenceDialog";const aa=f.forwardRef(((e,t)=>{const{onClose:r,onCancel:a,onConfirm:l}=e,c=f.useRef(null);f.useImperativeHandle(c,(()=>({props:e}))),f.useImperativeHandle(t,(()=>c.current));const i=o.useLocalization(),d=i.toLanguageString(qe,Nt[qe]),u=i.toLanguageString(ht,Nt[ht]),m=i.toLanguageString(yt,Nt[yt]),g=i.toLanguageString(Dt,Nt[Dt]),E=f.useCallback((({syntheticEvent:e})=>{if(!r)return;const t={syntheticEvent:e,value:null,target:c.current};r.call(void 0,t)}),[r]),h=f.useCallback((e=>{a&&a.call(void 0,{syntheticEvent:e,value:null})}),[a]),y=f.useCallback((e=>{l&&l.call(void 0,{syntheticEvent:e,value:null})}),[l]);return n.canUseDOM?k.createPortal(f.createElement(p.Dialog,{title:g,onClose:E},m,f.createElement(p.DialogActionsBar,null,f.createElement(s.Button,{onClick:h},d),f.createElement(s.Button,{onClick:y},u))),document&&document.body):null}));aa.displayName="KendoReactSchedulerRemoveDialog";const na=f.forwardRef(((e,t)=>{const{onFocus:r,onBlur:a,onMouseDown:l,onClick:s,onMouseUp:c,onMouseOut:i,onMouseOver:u,onMouseEnter:m,onMouseLeave:p,onDoubleClick:g,onRemoveClick:E,onKeyUp:h,onKeyDown:y,onKeyPress:v,onPress:k,onDrag:D,onRelease:S,onResizePress:C,onResizeEndDrag:b,onResizeRelease:I,onResizeStartDrag:w}=e,{item:T,element:R}=((e,t)=>{const{_ref:r,itemRef:a,_maxSiblingsPerSlot:l}=e,o=f.useRef(null),s=f.useRef(null),[,c]=Vt();return f.useImperativeHandle(o,(()=>({element:s.current,props:e,get _maxSiblingsPerSlot(){var e;return null!=(e=null==l?void 0:l.current)?e:0}}))),f.useImperativeHandle(t,(()=>o.current)),f.useImperativeHandle(r,(()=>o.current)),f.useImperativeHandle(a,(()=>o.current)),n.useIsomorphicLayoutEffect((()=>(c({type:n.COLLECTION_ACTION.add,item:o}),()=>{c({type:n.COLLECTION_ACTION.remove,item:o})}))),{item:o,element:s}})(e,t),x=n.useDir(R),A=f.useRef(null),N=f.useRef(null),_=f.useRef(null),M=f.useRef(null),z=Jr(e.editable),L=o.useInternationalization(),O=o.useLocalization().toLanguageString(Pe,Nt[Pe]),F=e.group.resources.find((e=>!(!e.colorField||""===e[e.colorField]||void 0===e[e.colorField]))),P=F&&F.colorField&&F[F.colorField],H=void 0!==e.tabIndex?null===e.tabIndex?void 0:e.tabIndex:e.selected?0:-1,W=f.useMemo((()=>n.classNames({"k-event":!e.resizeHint,"k-selected":e.selected&&z.select,"k-event-drag-hint":e.dragHint,"k-scheduler-marquee":e.resizeHint,"k-marquee":e.resizeHint,"k-first":e.resizeHint&&!e.tail,"k-last":e.resizeHint&&!e.head},e.className)),[e.resizeHint,e.selected,e.dragHint,e.tail,e.head,e.className,z.select]),K=f.useMemo((()=>`${function(e,t,r,a){return a?`${e.formatDate(t,{skeleton:"yMMMMEEEEd"})}`:`${e.formatDate(t,{skeleton:"yMMMMEEEEdhm"})}–${e.formatDate(r,"t")}`}(L,e.zonedStart,e.zonedEnd,e.isAllDay)}, ${e.title}`),[L,e.isAllDay,e.title,e.zonedEnd,e.zonedStart]),V=f.useMemo((()=>({cursor:"pointer",userSelect:"none",borderColor:e.resizeHint?void 0:P,backgroundColor:e.resizeHint?void 0:P,touchAction:"none",...e.style})),[P,e.style,e.resizeHint]),G=f.useCallback((e=>{r&&r.call(void 0,{syntheticEvent:e,target:T.current})}),[r,T]),B=f.useCallback((e=>{a&&a.call(void 0,{syntheticEvent:e,target:T.current})}),[a,T]),U=f.useCallback((e=>{l&&l.call(void 0,{syntheticEvent:e,target:T.current})}),[l,T]),Z=f.useCallback((e=>{s&&s.call(void 0,{syntheticEvent:e,target:T.current})}),[s,T]),$=f.useCallback((e=>{c&&c.call(void 0,{syntheticEvent:e,target:T.current})}),[c,T]),q=f.useCallback((e=>{u&&u.call(void 0,{syntheticEvent:e,target:T.current})}),[u,T]),Y=f.useCallback((e=>{i&&i.call(void 0,{syntheticEvent:e,target:T.current})}),[i,T]),j=f.useCallback((e=>{m&&m.call(void 0,{syntheticEvent:e,target:T.current})}),[m,T]),X=f.useCallback((e=>{p&&p.call(void 0,{syntheticEvent:e,target:T.current})}),[p,T]),Q=f.useCallback((e=>{g&&g.call(void 0,{syntheticEvent:e,target:T.current})}),[g,T]),J=f.useCallback((e=>{E&&E.call(void 0,{syntheticEvent:e,target:T.current})}),[E,T]),ee=f.useCallback((e=>{y&&y.call(void 0,{syntheticEvent:e,target:T.current})}),[y,T]),te=f.useCallback((e=>{v&&v.call(void 0,{syntheticEvent:e,target:T.current})}),[v,T]),re=f.useCallback((e=>{h&&h.call(void 0,{syntheticEvent:e,target:T.current})}),[h,T]),ae=f.useCallback((e=>{k&&k.call(void 0,{dragEvent:e,target:T.current})}),[k,T]),ne=f.useCallback((e=>{D&&D.call(void 0,{dragEvent:e,target:T.current})}),[D,T]),le=f.useCallback((e=>{S&&S.call(void 0,{dragEvent:e,target:T.current})}),[S,T]),oe=f.useCallback((e=>{C&&C.call(void 0,{dragEvent:e,target:T.current})}),[C,T]),se=f.useCallback((e=>{w&&w.call(void 0,{dragEvent:e,target:T.current})}),[w,T]),ce=f.useCallback((e=>{b&&b.call(void 0,{dragEvent:e,target:T.current})}),[b,T]),ie=f.useCallback((e=>{I&&I.call(void 0,{dragEvent:e,target:T.current})}),[I,T]);return n.useDraggable(R,{onPress:ae,onDrag:ne,onRelease:le}),n.useDraggable(A,{onPress:oe,onDrag:ce,onRelease:ie}),n.useDraggable(N,{onPress:oe,onDrag:se,onRelease:ie}),n.useDraggable(_,{onPress:oe,onDrag:se,onRelease:ie}),n.useDraggable(M,{onPress:oe,onDrag:ce,onRelease:ie}),f.createElement("div",{ref:R,id:e.id,style:V,tabIndex:H,className:W,role:"button","aria-label":K,onFocus:G,onBlur:B,onMouseUp:$,onMouseDown:U,onClick:Z,onMouseOver:q,onMouseOut:Y,onMouseEnter:j,onMouseLeave:X,onDoubleClick:Q,onKeyDown:ee,onKeyPress:te,onKeyUp:re,"data-group-index":e.group.index,"data-range-index":e.range.index},e.children,!e.resizeHint&&f.createElement("span",{className:"k-event-actions"},z.remove&&f.createElement("a",{tabIndex:-1,"aria-hidden":"true",className:"k-link k-event-delete",title:O,"aria-label":O,onClick:J},f.createElement(n.IconWrap,{name:"x",icon:d.xIcon})),e.head&&f.createElement(n.IconWrap,{name:"rtl"===x?"caret-alt-left":"caret-alt-right",icon:"rtl"===x?d.caretAltLeftIcon:d.caretAltRightIcon})),z.resize&&e.vertical&&f.createElement(f.Fragment,null,f.createElement("span",{className:"k-resize-handle k-resize-n",ref:_}),f.createElement("span",{className:"k-resize-handle k-resize-s",ref:M})),z.resize&&!e.vertical&&f.createElement(f.Fragment,null,f.createElement("span",{className:"k-resize-handle k-resize-w",ref:N}),f.createElement("span",{className:"k-resize-handle k-resize-e",ref:A})),e.resizeHint&&f.createElement(f.Fragment,null,f.createElement("div",{className:"k-marquee-color",style:{borderColor:P,backgroundColor:P}}),f.createElement("div",{className:"k-marquee-text"},!e.tail&&f.createElement("div",{className:"k-label-top"},L.formatDate(e.zonedStart,e.format)),!e.head&&f.createElement("div",{className:"k-label-bottom"},L.formatDate(e.zonedEnd,e.format)))))}));na.displayName="KendoReactSchedulerItem";const la=f.forwardRef(((e,t)=>{const r=f.useMemo((()=>n.classNames("k-event-template",e.className)),[e.className]);return f.createElement("div",{ref:t,...e,className:r})})),oa=(e,t)=>{const{element:r}=e;f.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=t[a][n]-l;w(r,{height:o},!0)}))}),t)},sa=f.forwardRef(((e,t)=>{const{item:r,_ref:a,itemRef:l,...s}=e,c=f.useRef(),i=f.useRef(null),u=f.useRef(null),m=f.useRef(null),p=Jr(e.editable);f.useImperativeHandle(u,(()=>({props:e,element:i.current&&i.current.element}))),f.useImperativeHandle(t,(()=>u.current)),f.useImperativeHandle(a,(()=>i.current)),f.useImperativeHandle(l,(()=>i.current));const g=r||ca.item,E=o.useInternationalization(),[h]=Vt(),[y]=Wt(),v=re(),[k,D]=f.useState(!0),[S,C]=f.useState(!1),I=f.useRef(0),R=n.useDir(v),x=f.useMemo((()=>e.isAllDay?E.toString(e.zonedStart,"t"):E.format("{0:t} - {1:t}",e.zonedStart,e.zonedEnd)),[E,e.isAllDay,e.zonedEnd,e.zonedStart]),A=f.useMemo((()=>`(${x}): ${e.title}`),[x,e.title]),N=(e,t)=>{let r=1;return e.forEach((e=>{const a=t.filter((t=>_(e.current.props,t.props)));a.length>r&&(r=a.length)})),r},_=(t,r)=>H(t.start,t.end,r.start,r.end)&&t.group.index===r.group.index&&t.range.index===r.range.index&&(e.ignoreIsAllDay||t.isAllDay===r.isAllDay),M=()=>{const t=(y||[]).filter((t=>t.current&&_(t.current.props,e)));if(0===t.length)return void D(!1);const r=T(t);if(!r.current||!i.current)return;const a=b(r.current.element);w(i.current.element,a)},z=()=>{const t=i.current&&i.current.element;if(!t)return;const r=(y||[]).filter((t=>t.current&&_(t.current.props,e))),a=[],n=[],l=[];(h||[]).forEach((e=>{e.current&&(e.current.props.dragHint?n.push(e.current):e.current.props.resizeHint?l.push(e.current):a.push(e.current))}));const o=e.dragHint||e.resizeHint?B(i.current,e.dragHint?n:l,r,e.ignoreIsAllDay):e.order||0;let s=e.dragHint||e.resizeHint?N(r,e.dragHint?n:l):N(r,a);const c=((e,t)=>e.map((e=>t.filter((t=>_(e.current.props,t.props))))))(r,a);let d=0;const u=b(t);if(c.forEach((r=>{let a=0;r.forEach((r=>{H(r.props.start,r.props.end,e.start,e.end)&&!e.dragHint&&!e.resizeHint&&r._maxSiblingsPerSlot&&r._maxSiblingsPerSlot>s&&r.element!==t&&(s=r._maxSiblingsPerSlot);const n=b(r.element);null!==r.props.order&&r.props.order<o&&(a=n.top+n.height-u.top-1*o+1)})),a>d&&(d=a)})),0===r.length)return void D(!1);const m=p.add?20:0;u.width=e.vertical?u.width/s-1-m/s:u.width*r.length-1,u.height=e.vertical?u.height*r.length-1:(e.resizeHint||e.dragHint)&&s<=1?u.height:e.style&&e.style.height?e.style.height:25,u.left=e.vertical?u.left+o*u.width+1*o:u.left,u.top=e.vertical?u.top:u.top+d+1*o,I.current=s,w(t,u),C(!0),D(!0)},L=f.useCallback((e=>{const t=e&&e[0],r=m.current;void 0!==c.current&&window.cancelAnimationFrame(c.current),r&&t&&(r.width!==t.contentRect.width||r.height!==t.contentRect.height)&&(c.current=window.requestAnimationFrame((()=>{M(),z()}))),m.current={width:t.contentRect.width,height:t.contentRect.height}}),[M,z]);f.useEffect(M),f.useEffect(z);const O=i.current&&i.current.element?i.current.element.closest(".k-scheduler-layout"):null;return oa({element:O,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:e.isLast}),f.useEffect((()=>{if(!v.current)return;const e=window.ResizeObserver,t=e&&new e(L);return t&&t.observe(v.current),()=>{t&&t.disconnect()}}),[L,v]),f.createElement(g,{...s,_ref:i,_maxSiblingsPerSlot:I,itemRef:i,style:{visibility:S?void 0:"hidden",display:k?void 0:"none",...e.style}},!e.resizeHint&&f.createElement("span",{className:"k-event-actions"},e.tail&&f.createElement(n.IconWrap,{name:"rtl"===R?"caret-alt-right":"caret-alt-left",icon:"rtl"===R?d.caretAltRightIcon:d.caretAltLeftIcon}),e.isRecurring&&!e.isException&&f.createElement(n.IconWrap,{name:"arrow-rotate-cw",icon:d.arrowRotateCwIcon}),!e.isRecurring&&e.isException&&f.createElement(n.IconWrap,{name:"arrows-no-repeat",icon:d.arrowsNoRepeatIcon})),!e.resizeHint&&f.createElement("div",{title:A},!e.isAllDay&&f.createElement(la,{className:"k-event-time"},A),f.createElement(la,null,e.title)))})),ca={item:na};sa.displayName="KendoReactSchedulerViewItem";const ia=(e,{dateRange:t,fields:r,timezone:a})=>e.map(da(r)).reduce(ua(t,a,r),[]).filter((e=>!O(e.dataItem,r))),da=e=>t=>({uid:n.getter(e.id||"id")(t),start:n.getter(e.start||"start")(t),startTimezone:n.getter(e.startTimezone||"startTimezone")(t),originalStart:n.getter(e.originalStart||"originalStart")(t),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:n.getter(e.recurrenceRule||"recurrenceRule")(t),recurrenceExceptions:n.getter(e.recurrenceExceptions||"recurrenceExceptions")(t),recurrenceId:n.getter(e.recurrenceId||"recurrenceId")(t),dataItem:n.clone(t)}),ua=(e,t,r)=>(a,n)=>[...a,...n.recurrenceRule&&(null===n.recurrenceId||void 0===n.recurrenceId)&&O(n.dataItem,r)?[...ma(n,{dateRange:e,timezone:t,fields:r})]:[n]],ma=(e,{dateRange:t,timezone:r,fields:l})=>{const o=e.recurrenceRule,s=y.parseRule({recurrenceRule:o});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=t.zonedStart,d=t.zonedEnd,u=y.expand(s,{rangeStart:i,rangeEnd:d});return u.events.length?u.events.map(((t,r)=>{const a=n.clone(e),o=n.clone(e.dataItem);return a.recurrenceId=a.uid,_(o,l.recurrenceId,e.uid),a.originalStart=t.start.toLocalDate(),_(o,l.originalStart,t.start.toLocalDate()),a.start=t.start.toLocalDate(),_(o,l.start,t.start.toLocalDate()),a.end=t.end.toLocalDate(),_(o,l.end,t.end.toLocalDate()),a.occurrenceId=String(r),_(o,"occurrenceId",String(r)),a.dataItem=o,a})):[]},pa=(e,{timezone:t},{groups:r,ranges:n})=>{const o=[];return l.orderBy(e,[{field:"start",dir:"asc"},{field:"end",dir:"desc"},{field:"isAllDay",dir:"desc"}]).forEach((e=>{r.forEach((l=>{const s=1===r.length?ga(e,l):l;ha(e,s)&&n.forEach((r=>{if(ya(e,r)){const n=f.createRef(),l=f.createRef(),c=r.end<e.end,i=e.start<r.start,d=a.ZonedDate.fromLocalDate(e.start,t),u=a.ZonedDate.fromLocalDate(e.end,t),m={...e,_ref:l,itemRef:n,head:c,tail:i,order:null,zonedStart:d,zonedEnd:u,group:s,range:r,slots:[],isRecurring:!!e.recurrenceRule,isException:!e.recurrenceRule&&null!==e.recurrenceId&&void 0!==e.recurrenceId,isAllDay:!!e.isAllDay};o.push(m)}}))}))})),o},ga=(e,t)=>({index:0,resources:t.resources.filter((t=>Ea(e,t)))}),Ea=(e,t)=>t.multiple?(e.dataItem[t.field]||[]).some((e=>t[t.valueField]===e)):e.dataItem[t.field]===t[t.valueField],ha=(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])),ya=(e,t)=>H(t.start,t.end,e.start,e.end)&&(void 0===t.isAllDay||!!e.isAllDay==!!t.isAllDay),va=e=>{const t=Pt(),{timezone:r}=ne(),a=ue(),n=ce(),l=pe(),[o]=Wt(),s=e.viewItem||fa.viewItem,c=f.useMemo((()=>ia([e.dataItem],{dateRange:l,fields:n,timezone:r})),[e.dataItem,l,n,r]),i=f.useMemo((()=>pa(c,{timezone:r},{groups:a,ranges:t})),[c,r,a,t]),d=(o||[]).map((e=>e.current.props));return Z(i,d),f.createElement(f.Fragment,null,i.map(((t,r)=>f.createElement(s,{key:r,...t,item:e.item,dragHint:!0,vertical:e.vertical,ignoreIsAllDay:e.ignoreIsAllDay}))))},fa={viewItem:sa,item:na};va.displayName="KendoReactSchedulerDrag";const ka=e=>{const t=Pt(),{timezone:r}=ne(),a=ue(),n=ce(),l=pe(),[o]=Wt(),s=e.viewItem||Da.viewItem,c=f.useMemo((()=>ia([e.dataItem],{dateRange:l,fields:n,timezone:r})),[e.dataItem,l.start.getTime(),l.end.getTime(),n,r]),i=f.useMemo((()=>pa(c,{timezone:r},{groups:a,ranges:t})),[c,r,a,t]),d=(o||[]).map((e=>e.current.props));return Z(i,d),f.createElement(f.Fragment,null,i.map(((t,r)=>{var a;return f.createElement(s,{key:r,...t,format:e.format,item:null!=(a=e.item)?a:Da.item,resizeHint:!0,vertical:e.vertical,ignoreIsAllDay:e.ignoreIsAllDay})})))},Da={viewItem:sa,item:na};ka.displayName="KendoReactSchedulerResize";const Sa=f.createContext([null]);Sa.displayName="SchedulerEditItemPropsContext";const Ca=f.createContext([null,n.noop,n.noop]);Ca.displayName="SchedulerEditItemFormItemContext";const ba=f.createContext([null,n.noop,n.noop]);ba.displayName="SchedulerEditItemDragItemContext";const Ia=f.createContext([null,n.noop,n.noop]);Ia.displayName="SchedulerEditItemResizeItemContext";const wa=f.createContext([null,n.noop,n.noop]);wa.displayName="SchedulerEditItemRemoveItemContext";const Ta=f.createContext([!1,n.noop,n.noop]);Ta.displayName="SchedulerEditItemShowRemoveDialogContext";const Ra=f.createContext([!1,n.noop,n.noop]);Ra.displayName="SchedulerEditItemShowOccurrenceDialogContext";const xa=({props:e,form:t,drag:r,resize:a,remove:n,showRemoveDialog:l,showOccurrenceDialog:o,children:s})=>f.createElement(Sa.Provider,{value:e},f.createElement(Ca.Provider,{value:t},f.createElement(ba.Provider,{value:r},f.createElement(Ia.Provider,{value:a},f.createElement(wa.Provider,{value:n},f.createElement(Ta.Provider,{value:l},f.createElement(Ra.Provider,{value:o},s)))))));var Aa=(e=>(e.set="FORM_ITEM_SET",e.setMaster="FORM_ITEM_SET_MASTER",e.reset="FORM_ITEM_RESET",e.complete="FORM_ITEM_COMPLETE",e))(Aa||{});var Na=(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))(Na||{});var _a=(e=>(e.set="REMOVE_ITEM_SET",e.reset="REMOVE_ITEM_RESET",e.complete="REMOVE_ITEM_COMPLETE",e))(_a||{});var Ma=(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))(Ma||{});var za=(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))(za||{});var La=(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))(La||{});var Oa=(e=>(e.reset="SERIES_RESET",e.set="SERIES_SET",e.toggle="SERIES_TOGGLE",e))(Oa||{});const Fa=(e,t,r)=>{const[a,n]=be(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)}]},Pa=f.forwardRef(((e,t)=>{const{_ref:r,itemRef:a,onDataAction:l,ignoreIsAllDay:o,viewItem:s,series:c,onSeriesChange:i,form:d,formItem:u,onFormItemChange:m,drag:p,dragItem:g,onDragItemChange:E,resize:h,resizeItem:y,onResizeItemChange:v,removeDialog:k,removeItem:D,onRemoveItemChange:S,occurrenceDialog:C,showOccurrenceDialog:b,onShowOccurrenceDialogChange:I,showRemoveDialog:w,onShowRemoveDialogChange:T,onFocus:R,onFocusAction:x,onMouseDown:M,onMouseDownAction:z,onMouseUp:O,onMouseUpAction:F,onClick:P,onClickAction:H,onDoubleClick:W,onDoubleClickAction:K,onRemoveClick:V,onRemoveClickAction:G,onPress:B,onPressAction:U,onDrag:Z,onDragAction:$,onRelease:q,onReleaseAction:Y,onResizePress:j,onResizePressAction:X,onResizeStartDrag:Q,onResizeStartDragAction:J,onResizeEndDrag:te,onResizeEndDragAction:re,onResizeRelease:ae,onResizeReleaseAction:ne,onOccurrenceClick:le,onOccurrenceClickAction:oe,onSeriesClick:se,onSeriesClickAction:ie,onKeyDown:de,onKeyDownAction:me,onKeyUp:pe,onKeyUpAction:ge,onRemoveConfirm:Ee,onRemoveConfirmAction:he,onFormSubmit:ye,onFormSubmitAction:ve,onCancel:ke,onCancelAction:De}={...Ha,...e},[Ce,Ie]=f.useState(e.tabIndex),we=f.useRef(null),Te=f.useRef(null),Re=n.useId();f.useImperativeHandle(we,(()=>({props:e,element:Te.current&&Te.current.element}))),f.useImperativeHandle(t,(()=>we.current)),f.useImperativeHandle(r,(()=>Te.current)),f.useImperativeHandle(a,(()=>Te.current));const xe=s||Ha.viewItem,Ae=p||Ha.drag,Ne=h||Ha.resize,_e=d||Ha.form,Me=C||Ha.occurrenceDialog,ze=k||Ha.removeDialog,Le=Jr(e.editable),[Oe,Fe]=Ut(),[Pe,,He]=Fa(null,c,i),[We,Ke,Ve]=((e,t)=>{const[r,a]=be(...t),l=ce(),[o]=fe();return[r,a,(t,s)=>{let c;switch(t.type){case"FORM_ITEM_SET":c=t.payload;break;case"FORM_ITEM_RESET":c=null;break;case"FORM_ITEM_SET_MASTER":c=n.clone(L(t.payload,l,o));break;case"FORM_ITEM_COMPLETE":e.onDataAction&&r&&(e.onDataAction.call(void 0,{type:ee.update,series:e.series,dataItem:t.payload}),c=null);break;default:c=r}a(c,s)}]})({series:Pe,onDataAction:l},[null,u,m]),[Ge,Be,Ue]=((e,t)=>{const r=f.useRef(0),a=f.useRef(0),l=f.useRef(0),o=f.useRef(null),[s,c]=be(...t),[i]=Ut(),d=ce(),u=ue();return[s,c,t=>{switch(t.type){case"DRAG_ITEM_SET":c(t.payload);break;case"DRAG_ITEM_RESET":c(null);break;case"DRAG_ITEM_DRAG_SELECTED":{if(Math.abs(a.current-t.payload.x)<10&&Math.abs(l.current-t.payload.y)<10)return;const r=A(t.payload.x,t.payload.y,7);if(!r||r===o.current)return;const s=n.clone(e.dataItem),u=r.getAttribute("data-slot-start"),m="true"===r.getAttribute("data-slot-allday");if(!e.ignoreIsAllDay&&m!==e.isAllDay)return;const p=new Date(N(s,d.start)),g=Number(u)-p.getTime(),E=i.map((e=>{if(!e.current)return null;const t=n.clone(e.current.props.dataItem),r=new Date(e.current.props.start.getTime()+g),a=new Date(e.current.props.end.getTime()+g);return _(t,d.start,r),_(t,d.end,a),t})).filter(Boolean);o.current=r,c([...E]);break}case"DRAG_ITEM_START":{const o=t.payload.x,s=t.payload.y;a.current=o,l.current=s;const c=A(o,s,7);if(!c)return;const i=n.clone(e.dataItem),u=c.getAttribute("data-slot-start"),m=N(i,d.start);if(null===u)return;r.current=Number(u)-new Date(m).getTime();break}case"DRAG_ITEM_DRAG":{if(Math.abs(a.current-t.payload.x)<10&&Math.abs(l.current-t.payload.y)<10)return;const s=A(t.payload.x,t.payload.y,7);if(!s||s===o.current)return;const i=n.clone(e.dataItem),m=s.getAttribute("data-slot-start"),p=s.getAttribute("data-slot-group"),g="true"===s.getAttribute("data-slot-allday");if(!e.ignoreIsAllDay&&g!==e.isAllDay)return;const E=new Date(N(i,d.start)),h=new Date(N(i,d.end)).getTime()-E.getTime(),y=new Date(Number(m)-Number(r.current)),v=new Date(Number(m)-Number(r.current)+h),f=u.find((e=>e.index===Number(p)));_(i,d.start,y),_(i,d.end,v),f&&u.length>1&&f.resources.forEach((e=>{e.multiple||_(i,e.field,e[e.valueField])})),o.current=s,i&&c(i);break}case"DRAG_ITEM_COMPLETE":c(null),e.onDataAction&&s&&e.onDataAction.call(void 0,{type:ee.update,series:!1,dataItem:s});break;case"DRAG_ITEM_COMPLETE_OCCURRENCE":{const t=Array.isArray(s)?s.slice():n.clone(s);c(null),e.onDataAction&&s&&e.onDataAction.call(void 0,{type:ee.update,series:!1,dataItem:t});break}case"DRAG_ITEM_COMPLETE_SERIES":{let t;if(Array.isArray(s))t=s.map((e=>{const t=n.clone(e);return _(t,d.start,N(e,d.start)),_(t,d.end,N(e,d.end)),t}));else{const e=n.clone(s);_(e,d.start,N(s,d.start)),_(e,d.end,N(s,d.end)),t=e}c(null),e.onDataAction&&t&&e.onDataAction.call(void 0,{type:ee.update,series:!0,dataItem:t});break}default:c(s)}}]})({dataItem:e.dataItem,ignoreIsAllDay:e.ignoreIsAllDay,isAllDay:e.isAllDay,onDataAction:l},[null,g,E]),[Ze,$e,qe]=((e,t)=>{const r=f.useRef(null),[a,l]=be(...t),[o]=Ut(),s=ce();return[a,l,(t,c)=>{let i=a;switch(t.type){case"RESIZE_ITEM_SET":i=t.payload;break;case"RESIZE_ITEM_RESET":default:i=null;break;case"RESIZE_ITEM_START":{if(c.stopPropagation(),!i)return;const a=t.payload.x,l=t.payload.y,o=A(a,l,7);if(!o||o===r.current)return;const d=o.getAttribute("data-slot-start"),u=new Date(Number(d)),m=n.clone(e.dataItem);if(u>=N(m,s.end))return;_(m,s.start,u),r.current=o,i=m;break}case"RESIZE_ITEM_START_DRAG_SELECTED":{c.stopPropagation();const a=t.payload.x,l=t.payload.y,d=n.clone(e.dataItem),u=A(a,l,7);if(!u||u===r.current)return;const m=u.getAttribute("data-slot-start"),p=new Date(N(d,s.start)),g=new Date(Number(m)).getTime()-p.getTime();let E=!1;const h=o.map((e=>{if(!e.current)return null;const t=n.clone(e.current.props.dataItem),r=new Date(e.current.props.start.getTime()+g);if(!(r>=N(t,s.end)))return _(t,s.start,r),t;E=!0})).filter(Boolean);E||(i=[...h]);break}case"RESIZE_ITEM_START_DRAG":{const a=t.payload.x,l=t.payload.y,o=A(a,l,7);if(!o||o===r.current)return;const c=o.getAttribute("data-slot-start"),d=new Date(Number(c)),u=n.clone(e.dataItem);if(d>=u.end)return;_(u,s.start,d),r.current=o,i=u;break}case"RESIZE_ITEM_END_DRAG":{const a=t.payload.x,l=t.payload.y,o=A(a,l,7);if(!o||o===r.current)return;const c=o.getAttribute("data-slot-end"),d=new Date(Number(c)),u=n.clone(e.dataItem);if(d<=u.start)return;_(u,s.end,d),r.current=o,i=u;break}case"RESIZE_ITEM_END_DRAG_SELECTED":{c.stopPropagation();const a=t.payload.x,l=t.payload.y,d=n.clone(e.dataItem),u=A(a,l,7);if(!u||u===r.current)return;const m=u.getAttribute("data-slot-start"),p=new Date(N(d,s.end)),g=new Date(Number(m)).getTime()-p.getTime();let E;const h=o.map((e=>{if(!e.current)return null;const t=n.clone(e.current.props.dataItem),r=new Date(e.current.props.end.getTime()+g);if(!(r<=N(t,s.start)))return _(t,s.end,r),t;E=!0})).filter(Boolean);E||(i=[...h]);break}case"RESIZE_ITEM_COMPLETE":case"RESIZE_ITEM_COMPLETE_OCCURRENCE":i=null,e.onDataAction&&a&&e.onDataAction.call(void 0,{type:ee.update,series:!1,dataItem:a});break;case"RESIZE_ITEM_COMPLETE_SERIES":{let t;if(i=null,Array.isArray(a))t=a.map((e=>{const t=n.clone(e);return _(t,s.start,N(e,s.start)),_(t,s.end,N(e,s.end)),t}));else{const e=n.clone(a);_(e,s.start,N(a,s.start)),_(e,s.end,N(a,s.end)),t=e}e.onDataAction&&t&&e.onDataAction.call(void 0,{type:ee.update,series:!0,dataItem:t});break}}l(i)}]})({dataItem:e.dataItem,onDataAction:l},[null,y,v]),[Ye,je,Xe]=((e,t)=>{const[r,a]=be(...t);return[r,a,t=>{let n;switch(t.type){case"REMOVE_ITEM_SET":n=t.payload;break;case"REMOVE_ITEM_RESET":n=null;break;case"REMOVE_ITEM_COMPLETE":e.onDataAction&&r&&e.onDataAction.call(void 0,{type:ee.remove,series:e.series,dataItem:r}),n=null;break;default:n=r}a(n)}]})({series:Pe,onDataAction:l},[null,D,S]),[Qe,Je,et]=((e,t,r)=>{const[a,n]=be(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,w,T),[tt,rt,at]=((e,t,r)=>{const[a,n]=be(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,b,I),[nt]=Vt(),[,lt]=f.useContext(Zt),[,ot]=qt(),st=!!(Te.current&&Oe&&Oe.some((e=>e.current===Te.current))),ct=f.useMemo((()=>({selected:st,series:Pe,formItem:We,dragItem:Ge,resizeItem:Ze,removeItem:Ye,showRemoveDialog:Qe,showOccurrenceDialog:tt})),[Ge,We,Ye,Ze,st,Pe,tt,Qe]),it=f.useMemo((()=>({[Oa.set]:He,[Oa.toggle]:He,[Oa.reset]:He,[jt.select]:Fe,[jt.add]:Fe,[jt.remove]:Fe,[jt.reset]:Fe,[jt.selectNext]:Fe,[jt.selectPrev]:Fe,[Aa.set]:Ve,[Aa.setMaster]:Ve,[Aa.reset]:Ve,[Aa.complete]:Ve,[_a.set]:Xe,[_a.reset]:Xe,[_a.complete]:Xe,[Na.close]:at,[Na.open]:at,[Na.set]:at,[Na.toggle]:at,[Na.reset]:at,[Ma.close]:et,[Ma.open]:et,[Ma.set]:et,[Ma.toggle]:et,[Ma.reset]:et,[za.start]:Ue,[za.drag]:Ue,[za.complete]:Ue,[za.completeOccurrence]:Ue,[za.completeSeries]:Ue,[za.set]:Ue,[za.reset]:Ue,[za.dragSelected]:Ue,[La.start]:qe,[La.startDrag]:qe,[La.startDragSelected]:qe,[La.endDrag]:qe,[La.endDragSelected]:qe,[La.complete]:qe,[La.completeOccurrence]:qe,[La.completeSeries]:qe,[La.set]:qe,[La.reset]:qe,[Jt.next]:lt,[Jt.prev]:lt,[er.left]:ot,[er.right]:ot,[er.up]:ot,[er.down]:ot,null:()=>{}})),[Ue,Ve,Fe,Xe,qe,He,at,et,lt,ot]),dt=f.useCallback((t=>{if(x){const r=x(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t))):it[r.type]({...r,item:Te}))}R&&R.call(void 0,t)}),[it,R,x,e,ct]),ut=f.useCallback((t=>{if(z){const r=z(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t))):it[r.type]({...r,item:Te}))}M&&M.call(void 0,t)}),[it,M,z,e,ct]),mt=f.useCallback((t=>{if(F){const r=F(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t))):it[r.type]({...r,item:Te}))}O&&O.call(void 0,t)}),[it,O,F,e,ct]),[,pt]=f.useContext(Se),gt=f.useCallback((t=>{if(H){pt(Te.current);const r=H(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t))):it[r.type]({...r,item:Te}))}P&&P.call(void 0,t)}),[it,P,H,e,ct]),Et=f.useCallback((t=>{if(K){const r=K(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t))):it[r.type]({...r,item:Te}))}W&&W.call(void 0,t)}),[K,W,e,it,ct]),ht=f.useCallback((t=>{if(G){const r=G(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t))):it[r.type]({...r,item:Te}))}V&&V.call(void 0,t)}),[G,V,e,it,ct]),yt=f.useCallback((t=>{if(U){const r=U(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t))):it[r.type]({...r,item:Te},t))}B&&B.call(void 0,t)}),[U,B,e,it,ct]),vt=f.useCallback((t=>{if($){const r=$(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t.dragEvent.originalEvent))):it[r.type]({...r,item:Te},t.dragEvent.originalEvent))}Z&&Z.call(void 0,t)}),[$,Z,e,it,ct]),ft=f.useCallback((t=>{if(Y){const r=Y(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t.dragEvent.originalEvent))):it[r.type]({...r,item:Te},t.dragEvent.originalEvent))}q&&q.call(void 0,t)}),[Y,q,e,it,ct]),kt=f.useCallback((t=>{if(X){const r=X(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t.dragEvent.originalEvent))):it[r.type]({...r,item:Te},t.dragEvent.originalEvent))}j&&j.call(void 0,t)}),[X,j,e,ct,it]),Dt=f.useCallback((t=>{if(J){const r=J(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t.dragEvent.originalEvent))):it[r.type]({...r,item:Te},t.dragEvent.originalEvent))}Q&&Q.call(void 0,t)}),[Q,J,e,it,ct]),St=f.useCallback((t=>{if(re){const r=re(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t.dragEvent.originalEvent))):it[r.type]({...r,item:Te},t.dragEvent.originalEvent))}te&&te.call(void 0,t)}),[te,re,e,it,ct]),Ct=f.useCallback((t=>{if(ne){const r=ne(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t.dragEvent.originalEvent))):it[r.type]({...r,item:Te},t.dragEvent.originalEvent))}ae&&ae.call(void 0,t)}),[ne,ae,e,it,ct]),bt=f.useCallback((t=>{if(ve){const r=ve(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t))):it[r.type]({...r,item:Te},t))}ye&&ye.call(void 0,t)}),[ve,ye,e,ct,it]),It=f.useCallback((t=>{if(De){const r=De(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t))):it[r.type]({...r,item:Te},t))}ke&&ke.call(void 0,t)}),[De,ke,e,ct,it]),wt=f.useCallback((t=>{if(oe){const r=oe(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t))):it[r.type]({...r,item:Te},t))}le&&le.call(void 0,t)}),[oe,le,e,ct,it]),Tt=f.useCallback((t=>{if(ie){const r=ie(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t))):it[r.type]({...r,item:Te},t))}se&&se.call(void 0,t)}),[ie,se,e,ct,it]),Rt=f.useCallback((t=>{if(me){const r=me(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t.syntheticEvent))):it[r.type]({...r,item:Te},t.syntheticEvent))}de&&de.call(void 0,t)}),[me,de,e,ct,it]),xt=f.useCallback((t=>{if(ge){const r=ge(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t.syntheticEvent))):it[r.type]({...r,item:Te},t.syntheticEvent))}pe&&pe.call(void 0,t)}),[ge,pe,e,ct,it]),At=f.useCallback((t=>{if(he){const r=he(t,e,ct);r&&(Array.isArray(r)?r.filter(Boolean).map((e=>e&&it[e.type]({...e,item:Te},t.syntheticEvent))):it[r.type]({...r,item:Te},t.syntheticEvent))}Ee&&Ee.call(void 0,t)}),[he,Ee,e,ct,it]);return f.useEffect((()=>{const t=nt.length&&nt[0].current===Te.current;Ie(void 0!==e.tabIndex?null===e.tabIndex?void 0:e.tabIndex:0===Oe.length&&t?0:void 0)}),[nt,e.tabIndex,Oe.length]),f.createElement(xa,{props:e,form:[We,Ke,Ve],drag:[Ge,Be,Ue],resize:[Ze,$e,qe],remove:[Ye,je,Xe],showRemoveDialog:[Qe,Je,et],showOccurrenceDialog:[tt,rt,at]},f.createElement(xe,{...e,_ref:Te,itemRef:Te,selected:st,tabIndex:Ce,id:Re,onKeyDown:Rt,onKeyUp:xt,onFocus:dt,onMouseUp:mt,onMouseDown:ut,onClick:gt,onDoubleClick:Et,onRemoveClick:ht,onPress:yt,onDrag:vt,onRelease:ft,onResizePress:kt,onResizeEndDrag:St,onResizeStartDrag:Dt,onResizeRelease:Ct}),Ge&&Le.drag&&(Array.isArray(Ge)?Ge.map(((t,r)=>f.createElement(Ae,{key:r,ignoreIsAllDay:o,dataItem:t,vertical:e.vertical,viewItem:xe,item:e.item}))):f.createElement(Ae,{ignoreIsAllDay:o,dataItem:Ge,vertical:e.vertical,viewItem:xe,item:e.item})),Ze&&Le.resize&&(Array.isArray(Ze)?Ze.map(((t,r)=>f.createElement(Ne,{key:r,format:e.format,ignoreIsAllDay:o,dataItem:t,viewItem:e.viewItem,item:e.item,vertical:e.vertical}))):f.createElement(Ne,{format:e.format,ignoreIsAllDay:o,dataItem:Ze,viewItem:e.viewItem,item:e.item,vertical:e.vertical})),We&&!tt&&Le.edit&&f.createElement(_e,{dataItem:We,onSubmit:bt,onClose:It,onCancel:It}),tt&&f.createElement(Me,{dataItem:We||Ge||Ze||Ye,isRemove:null!==Ye,onClose:It,onOccurrenceClick:wt,onSeriesClick:Tt}),Qe&&Ye&&Le.remove&&f.createElement(ze,{dataItem:Ye,onClose:It,onCancel:It,onConfirm:At}))})),Ha={viewItem:sa,drag:va,resize:ka,form:Br,occurrenceDialog:ra,removeDialog:aa,onClickAction:(e,t,r)=>[{type:e.syntheticEvent.metaKey||e.syntheticEvent.ctrlKey?!r.selected||r.dragItem||r.resizeItem?jt.add:jt.remove:jt.select}],onDoubleClickAction:(e,t)=>t.editable?[{type:Aa.set,payload:t.dataItem},t.isRecurring&&{type:Na.open}].filter(Boolean):[],onRemoveClickAction:(e,t)=>t.editable?[{type:_a.set,payload:t.dataItem},t.isRecurring?{type:Na.open}:{type:Ma.open}]:[],onPressAction:(e,t)=>t.editable?{type:za.start,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onDragAction:(e,t)=>t.editable?{type:e.dragEvent.originalEvent.metaKey||e.dragEvent.originalEvent.ctrlKey?za.dragSelected:za.drag,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onReleaseAction:(e,t,r)=>t.editable&&r.dragItem?t.isRecurring&&!t.isException&&null===r.series?{type:Na.open}:{type:t.isRecurring?r.series?za.completeSeries:za.completeOccurrence:za.complete,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onResizePressAction:(e,t)=>t.editable?{type:La.start,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onResizeStartDragAction:(e,t)=>t.editable?{type:e.dragEvent.originalEvent.metaKey||e.dragEvent.originalEvent.ctrlKey?La.startDragSelected:La.startDrag,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onResizeEndDragAction:(e,t)=>t.editable?{type:e.dragEvent.originalEvent.metaKey||e.dragEvent.originalEvent.ctrlKey?La.endDragSelected:La.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:Na.open}:{type:t.isRecurring?r.series?La.completeSeries:La.completeOccurrence:La.complete,payload:{x:e.dragEvent.clientX,y:e.dragEvent.clientY}}:[],onOccurrenceClickAction:(e,t,r)=>r.dragItem?[{type:za.completeOccurrence},{type:Na.close}]:r.resizeItem?[{type:La.completeOccurrence},{type:Na.close}]:r.formItem?[{type:Oa.set,payload:!1},{type:Aa.set,payload:t.dataItem},{type:Na.close}]:r.removeItem?[{type:Oa.set,payload:!1},{type:_a.set,payload:t.dataItem},{type:Ma.open},{type:Na.close}]:[],onSeriesClickAction:(e,t,r)=>r.dragItem?[{type:za.completeSeries},{type:Na.close}]:r.resizeItem?[{type:La.completeSeries},{type:Na.close}]:r.formItem?[{type:Oa.set,payload:!0},{type:Aa.setMaster,payload:t.dataItem},{type:Na.close}]:r.removeItem?[{type:Oa.set,payload:!0},{type:_a.set,payload:t.dataItem},{type:Ma.open},{type:Na.close}]:[],onKeyDownAction:(e,t)=>{switch(e.syntheticEvent.keyCode){case n.Keys.enter:return[{type:Aa.set,payload:t.dataItem},t.isRecurring&&{type:Na.open}];case n.Keys.tab:return[{type:e.syntheticEvent.shiftKey?Jt.prev:Jt.next,ignoreIsAllDay:t.ignoreIsAllDay},{type:e.syntheticEvent.shiftKey?jt.selectPrev:jt.selectNext,ignoreIsAllDay:t.ignoreIsAllDay}];case n.Keys.up:return[!(!t.slots.length||!t.slots[0]._ref.current)&&{type:er.up,slot:t.slots[0]._ref}];case n.Keys.right:return[!(!t.slots.length||!t.slots[0]._ref.current)&&{type:er.right,slot:t.slots[0]._ref}];case n.Keys.down:return[!(!t.slots.length||!t.slots[t.slots.length-1]._ref.current)&&{type:er.down,slot:t.slots[t.slots.length-1]._ref}];case n.Keys.left:return[!(!t.slots.length||!t.slots[0]._ref.current)&&{type:er.left,slot:t.slots[0]._ref}];default:return}},onFormSubmitAction:e=>[{type:Aa.complete,payload:e.value}],onRemoveConfirmAction:()=>[{type:_a.complete},{type:Na.close}],onCancelAction:()=>[{type:Oa.reset},{type:_a.reset},{type:Aa.reset},{type:za.reset},{type:La.reset},{type:Ma.reset},{type:Na.reset}]};Pa.displayName="KendoReactSchedulerEditItem";const Wa=e=>{const[t,r]=f.useState(!1),l=re(),o=ne(),s=f.useRef(void 0),c=f.useRef(null),i=f.useRef(null),d=e.updateInterval||Ka.updateInterval,[,u]=f.useState(!1),m=n.useDir(i,!0===o.rtl?"rtl":void 0),[p]=Wt(),g=f.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?H(new Date,new Date,t.current.props.start,t.current.props.end,!0):K(new Date,t.current.props.start,t.current.props.end))&&!t.current.props.isAllDay));if(t&&t.length&&c.current&&i.current){const n=T(t);if(!n.current)return;const l=e.vertical?(e=>{let t=0;return e.forEach((e=>{if(e.current){const r=b(e.current.element);t+=r.height}})),t})(t):(e=>{let t=0;return e.forEach((e=>{if(e.current){const r=b(e.current.element);t+=r.width}})),t})(t),o=b(n.current.element),s=b(c.current),d=(e.vertical?o.width:o.height)/(n.current.props.end.getTime()-n.current.props.start.getTime()),u=(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())*d,p="rtl"===m,g=e.vertical?o.top:o.top+u-s.height/2,E=p?"right":"left",h=e.vertical?o[E]+u-s.width/2:o[E];e.vertical?c.current.style[E]=`${h}px`:c.current.style.top=`${g}px`,i.current.style[E]=`${h}px`,i.current.style.top=`${g}px`,i.current.style[e.vertical?"height":"width"]=l-1+"px",r(!0)}else r(!1)}),[p,e.groupIndex,e.vertical,m]),E=f.useCallback((()=>{g(),u((e=>!e))}),[g]);f.useEffect((()=>{if(!l.current||!window)return;clearInterval(s.current),s.current=window.setInterval(E,d);const e=window.ResizeObserver,t=e&&new e(E);return t&&t.observe(l.current),()=>{clearInterval(s.current),t&&t.disconnect()}}),[g,E,l,d]),f.useEffect(g);const h=f.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 f.createElement(f.Fragment,null,e.attachArrow&&e.attachArrow.current?k.createPortal(h,e.attachArrow.current):h,f.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"}}))},Ka={updateInterval:6e4},Va=f.forwardRef(((e,t)=>{const{as:r=Ga.as,...a}=e,l=f.useRef(null),s=f.useRef(null),c=o.useInternationalization(),i=f.useMemo((()=>n.classNames("k-scheduler-cell k-heading-cell",e.className)),[e.className]);return f.useImperativeHandle(s,(()=>({element:l.current&&l.current.element?l.current.element:l.current,props:e}))),f.useImperativeHandle(t,(()=>s.current)),f.createElement(r,{ref:r!==Ga.as?void 0:l,...a,className:i},f.createElement("span",{className:"k-link k-nav-day"},c.formatDate(e.date,e.format?e.format:Ga.format)))})),Ga={as:f.forwardRef((({as:e,format:t,start:r,end:a,...n},l)=>f.createElement("div",{...n,ref:l}))),format:"d"};Va.displayName="KendoReactSchedulerDateHeaderCell";const Ba=(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},Ua=(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,d=s<0?s*j*-1:0;c.getTime()<o.getTime();i++,c=c.addTime(t)){const n=f.createRef(),o=c.clone(),s=c.addTime(t),u=(s.timezoneOffset-o.timezoneOffset)*j,m=t<=Math.abs(u);d&&m&&(d-=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)}}))})),l},Za=f.createElement("div",{className:"k-scheduler-cell k-side-cell"}),$a=e=>{const{group:t,timezone:r,resources:l}=ne(),s=o.useInternationalization(),c=e.editItem||Pa,i=e.editSlot||ea,d=e.showWorkHours,u=e.numberOfDays||qa.numberOfDays,m=e.slotDivisions||qa.slotDivisions,p=e.slotDuration||qa.slotDuration,g=e.workWeekStart||qa.workWeekStart,E=e.workWeekEnd||qa.workWeekEnd,h=!1!==e.currentTimeMarker&&qa.currentTimeMarker,y=s.parseDate(e.workDayStart||e.isWorkDayStart||qa.isWorkDayStart),v=s.parseDate(e.workDayEnd||e.isWorkDayEnd||qa.isWorkDayEnd),k=s.parseDate(e.startTime||qa.startTime),D=s.parseDate(e.endTime||qa.endTime),[S]=fe(),C=ue(),b=Ee(),I=ce(),w=pe(),x=f.useMemo((()=>d?y:k),[d,y,k]),A=f.useMemo((()=>d?v:D),[d,v,D]),N=f.useMemo((()=>Ba(w,{step:a.MS_PER_DAY*u,timezone:r}).map((e=>({...e,isAllDay:!0})))),[w.start.getTime(),w.end.getTime(),u]),_=f.useMemo((()=>Ba(w,{step:a.MS_PER_DAY,timezone:r}).map((e=>({...e,isAllDay:!1})))),[w.start.getTime(),w.end.getTime(),r]),M=f.useMemo((()=>Ua(0,{step:a.MS_PER_DAY},{groups:C,ranges:N})),[w.start.getTime(),w.end.getTime(),r,N,C]),z=f.useMemo((()=>Ua(0,{step:p*j/m},{groups:C,ranges:_}).filter((e=>A.getTime()===x.getTime()||K(e.zonedStart,x,A)))),[w.start.getTime(),w.end.getTime(),p,m,x.getTime(),A.getTime(),C,_]),L=f.useMemo((()=>ia(S,{dateRange:w,fields:I,timezone:r})),[S,w.start.getTime(),w.end.getTime(),I,r]),O=f.useMemo((()=>L.filter((e=>e.isAllDay))),[L]),F=f.useMemo((()=>L.filter((e=>!e.isAllDay))),[L]),P=f.useMemo((()=>pa(O,{timezone:r},{groups:C,ranges:N})),[L,r,C,N]),W=f.useMemo((()=>pa(F,{timezone:r},{groups:C,ranges:_}).filter((e=>x.getTime()===A.getTime()||K(e.zonedStart,x,A)||K(e.zonedEnd,x,A)||K(new Date(e.zonedEnd.getTime()-(e.zonedEnd.getTime()-e.zonedStart.getTime())/2),x,A)))),[L,r,C,_,x.getTime(),A.getTime()]);f.useMemo((()=>Z(P,M,!1)),[P,M]),f.useMemo((()=>U(P,M,!1)),[P,M]),f.useMemo((()=>Z(W,z,!1)),[W,z]),f.useMemo((()=>U(W,z,!1)),[W,z]);const G=f.createElement(or.Consumer,null,(({groupIndex:t})=>f.createElement("div",{className:"k-scheduler-row",key:t},_.map(((t,n)=>f.createElement(Va,{as:e.dateHeaderCell,key: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:"MEd"}})))))),B=f.createElement(or.Consumer,null,(({groupIndex:t})=>f.createElement("div",{key:t,className:"k-scheduler-row"},N.map(((r,a)=>M.filter((e=>e.group.index===t&&e.range.index===a)).map(((r,a,n)=>f.createElement(i,{...r,onDataAction:e.onDataAction,form:e.form,slot:e.slot,viewSlot:e.viewSlot,key:`${r.start.getTime()}:${r.group.index}`,row:0,col:"horizontal"===b?n.length*(t||0)+a:a,isWorkDay:0<=r.zonedStart.getDay()+(u-g)&&(r.zonedStart.getDay()+(u-g))%u<=E+(u-g),expandable:!0})))))))),$=f.useMemo((()=>n.classNames("week"===e.name?"k-scheduler-weekview":"k-scheduler-dayview",e.className)),[e.className]);return f.createElement(lr,{id:e.id,props:e,style:e.style,className:$,ranges:[...N,..._],slots:[...M,...z]},f.createElement("div",{className:"k-scheduler-head"},"horizontal"===b?f.createElement(f.Fragment,null,f.createElement(sr,{nested:!0,group:t,resources:l,rowContent:ur,childRowContent:ur},G),f.createElement(sr,{group:t,resources:l,rowContent:kr,childRowContent:kr},B),P.map((t=>f.createElement(c,{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})))):f.createElement(mr,{group:t,resources:l,cellContent:Za},G)),f.createElement("div",{className:"k-scheduler-body"},"horizontal"===b?f.createElement(f.Fragment,null,z.filter((e=>0===e.group.index&&0===e.range.index)).map(((r,a)=>f.createElement(f.Fragment,{key:r.index},f.createElement(sr,{nested:!1,group:t,resources:l,rowContent:Cr,rowContentProps:{timeHeaderCell:e.timeHeaderCell,isMaster:a%m==0,isLast:(a+1)%m==0,slot:r}},f.createElement(or.Consumer,null,(({groupIndex:t})=>f.createElement("div",{className:n.classNames("k-scheduler-row",{"k-middle-row":(a+1)%m!=0})},_.map(((n,l)=>z.filter((e=>e.index===r.index&&e.range.index===l&&e.group.index===t)).map((r=>f.createElement(i,{key:`${r.start.getTime()}:${r.group.index}`,...r,onDataAction:e.onDataAction,slot:e.slot,viewSlot:e.viewSlot,form:e.form,row:a+1,col:_.length*(t||0)+l,isWorkHour:K(r.zonedStart,y,v),isWorkDay:V(r.zonedEnd.getDay(),g,E),editable:e.editable})))))))))))),!1!==h&&H(T(_).start,R(_).end,new Date,new Date,!0)&&f.createElement(Wa,null)):f.createElement(f.Fragment,null,f.createElement(mr,{nested:!0,group:t,resources:l},f.createElement(or.Consumer,null,(({groupIndex:t})=>f.createElement(f.Fragment,{key:t},f.createElement("div",{className:"k-scheduler-row"},f.createElement(kr,{groupIndex:t},N.map(((r,a)=>{const n=z.filter((e=>e.group.index===t&&0===e.range.index)).length;return M.filter((e=>e.group.index===t&&e.range.index===a)).map(((r,a)=>f.createElement(i,{slot:e.slot,viewSlot:e.viewSlot,form:e.form,...r,onDataAction:e.onDataAction,key:`${r.start.getTime()}:${r.group.index}`,className:"k-scheduler-alldays-slot",row:n*(t||0)+1*(t||0),col:a,expandable:!0})))})))),z.filter((e=>e.group.index===t&&0===e.range.index)).map(((r,a,n)=>f.createElement("div",{className:"k-scheduler-row",key:r.index},f.createElement(Cr,{slot:r,isMaster:a%m==0,isLast:(a+1)%m==0,timeHeaderCell:e.timeHeaderCell},_.map(((l,o)=>z.filter((e=>e.index===r.index&&e.group.index===t&&e.range.index===o)).map((r=>f.createElement(i,{slot:e.slot,viewSlot:e.viewSlot,form:e.form,onDataAction:e.onDataAction,...r,key:`${r.start.getTime()}:${r.group.index}`,row:n.length*(t||0)+a+1*(t||0)+1,col:o,editable:e.editable,isWorkHour:K(r.zonedStart,y,v),isWorkDay:0<=r.zonedStart.getDay()+(u-g)&&(r.zonedStart.getDay()+(u-g))%u<=E+(u-g)}))))))))),!1!==h&&H(T(_).start,R(_).end,new Date,new Date,!0)&&f.createElement(Wa,{groupIndex:t}))))),P.map((t=>f.createElement(c,{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})))),W.map((t=>f.createElement(c,{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})))))},qa={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(z(l),r),c=a.ZonedDate.fromUTCDate(z(o),r);return{start:new Date(s.getTime()),end:new Date(c.getTime()),zonedStart:s,zonedEnd:c}},selectedDateFormat:"{0:D} - {1:D}",selectedShortDateFormat:"{0:d} - {1:d}",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};$a.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},$a.displayName="KendoReactSchedulerMultiDayView";const Ya=e=>f.createElement($a,{...e}),ja={...qa,name:"day",title:e=>e.toLanguageString(Oe,Nt[Oe]),numberOfDays:1,slotDuration:60,slotDivisions:2,selectedDateFormat:"{0:D}",selectedShortDateFormat:"{0:d}"};Ya.displayName="KendoReactSchedulerDayView";const Xa={name:"@progress/kendo-react-scheduler",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:1607496606,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui"},Qa=f.forwardRef(((e,t)=>{const{_ref:r,onRemoveClick:a}=e,l=f.useRef(null),s=f.useRef(null);f.useImperativeHandle(l,(()=>({props:e,element:s.current}))),f.useImperativeHandle(t,(()=>l.current)),f.useImperativeHandle(r,(()=>l.current));const c=Jr(e.editable),i=o.useLocalization().toLanguageString(Pe,Nt[Pe]),u=e.group.resources.find((e=>!(!e.colorField||void 0===e[e.colorField]))),m=u&&u.colorField&&u[u.colorField],p=f.useCallback((e=>{a&&a.call(void 0,{syntheticEvent:e,target:l.current})}),[a,l]),g=f.useMemo((()=>n.classNames("k-task",e.className)),[e.className]);return f.createElement("div",{id:e.id,ref:s,style:e.style,className:g,tabIndex:e.tabIndex||void 0},m&&f.createElement("span",{className:"k-scheduler-mark",style:{color:m,backgroundColor:m}}),e.isRecurring&&f.createElement(n.IconWrap,{name:"arrow-rotate-cw",icon:d.arrowRotateCwIcon}),e.isException&&f.createElement(n.IconWrap,{name:"arrows-no-repeat",icon:d.arrowsNoRepeatIcon}),e.title,c.remove&&f.createElement("a",{className:"k-link k-event-delete",title:i,"aria-label":i,onClick:p},f.createElement(n.IconWrap,{name:"x",icon:d.xIcon})))}));Qa.displayName="KendoReactSchedulerTask";const Ja=f.forwardRef(((e,t)=>{const{task:r,_ref:a,...n}=e,l=f.useRef(null),o=f.useRef(null);f.useImperativeHandle(o,(()=>({props:e,element:l.current&&l.current.element}))),f.useImperativeHandle(a,(()=>l.current)),f.useImperativeHandle(t,(()=>o.current));const s=r||en.task;return f.createElement(s,{...n,_ref:l})})),en={task:Qa};Ja.displayName="KendoReactSchedulerViewTask";const tn=f.createContext([null]),rn=f.createContext([!1]),an=f.createContext([!1]),nn=e=>f.createElement(tn.Provider,{value:e.remove},f.createElement(rn.Provider,{value:e.showRemoveDialog},f.createElement(an.Provider,{value:e.showOccurrenceDialog},e.children))),ln=f.forwardRef(((e,t)=>{const{_ref:r,onDataAction:a,viewTask:n,removeDialog:l,removeItem:o,onRemoveItemChange:s,occurrenceDialog:c,showOccurrenceDialog:i,onShowOccurrenceDialogChange:d,showRemoveDialog:u,onShowRemoveDialogChange:m,...p}=e,g=f.useRef(null);f.useImperativeHandle(g,(()=>({props:e,element:g.current&&g.current.element}))),f.useImperativeHandle(r,(()=>g.current)),f.useImperativeHandle(t,(()=>g.current));const E=n||on.viewTask,h=c||on.occurrenceDialog,y=l||on.removeDialog,v=Jr(e.editable),k=ce(),[D,S]=fe(),[C,b]=f.useState(null),[I,w]=be(null,o,s),[T,R]=be(!1,u,m),[x,A]=be(!1,i,d),N=f.useCallback((t=>{v.remove&&(w(e.dataItem,t),e.isRecurring?A(!0,t):R(!0,t))}),[w,e.dataItem,e.isRecurring,A,R]),_=f.useCallback((e=>{b(null),w(null,e),R(!1,e),A(!1,e)}),[b,w,R,A]),M=f.useCallback((e=>{a&&I&&a.call(void 0,{type:ee.remove,series:C,dataItem:I}),w(null,e),R(!1,e)}),[I,S,R]),z=f.useCallback(((e,t)=>{w&&w(e,t)}),[w]),O=f.useCallback(((e,t)=>{R&&R(e,t)}),[R]),F=f.useCallback(((e,t)=>{A&&A(e,t)}),[A]),P=f.useCallback((t=>{I&&(b(!1),w(e.dataItem,t),R(!0,t)),A(!1,t)}),[b,e.dataItem,I,w,R]),H=f.useCallback((e=>{if(I){b(!0);const t=L(I,k,D);w(t,e),R(!0,e)}A(!1,e)}),[k,I,b,w,R,A]);return f.createElement(nn,{remove:[I,z],showRemoveDialog:[T,O],showOccurrenceDialog:[x,F]},f.createElement(E,{_ref:g,...p,onRemoveClick:N}),x&&f.createElement(h,{dataItem:I,isRemove:null!==I,onClose:_,onOccurrenceClick:P,onSeriesClick:H}),T&&f.createElement(y,{dataItem:I,onClose:_,onCancel:_,onConfirm:M}))})),on={viewTask:Ja,occurrenceDialog:ra,removeDialog:aa};ln.displayName="KendoReactSchedulerEditTask";const sn=e=>{const{group:t,timezone:r,resources:l}=ne(),s=e.editTask||ln,c=e.editSlot||ea,i=f.useRef(null),u=n.useDir(i),m=o.useInternationalization(),p=o.useLocalization(),[g]=fe(),E=ue(),h=ce(),y=pe(),v=f.useMemo((()=>Ba(y,{step:a.MS_PER_DAY,timezone:r})),[y.start.getTime(),y.end.getTime(),r]),k=f.useMemo((()=>Ua(0,{step:a.MS_PER_DAY},{groups:E,ranges:v})),[y.start.getTime(),y.end.getTime(),r,E,v]),D=f.useMemo((()=>ia(g,{dateRange:y,fields:h,timezone:r})),[g,y.start.getTime(),y.end.getTime(),h,r]),S=f.useMemo((()=>pa(D,{timezone:r},{groups:E,ranges:v})),[D,r,E,v]),C=f.useMemo((()=>n.classNames("k-scheduler-agendaview",e.className)),[e.className]);return Qt({element:i,selector:".k-scheduler-datecolumn",explicitDepth:!1}),Qt({element:i,selector:".k-scheduler-timecolumn",explicitDepth:!1}),f.useMemo((()=>Z(S,k,!0)),[S,k]),f.useMemo((()=>U(S,k,!0)),[S,k]),f.createElement(lr,{ref:i,id:e.id,style:e.style,className:C,props:e,slots:S,ranges:v},f.createElement("div",{className:"k-scheduler-head"},f.createElement(mr,{resources:l,group:t},f.createElement(or.Consumer,null,(({groupIndex:e})=>f.createElement("div",{className:"k-scheduler-row",key:e},f.createElement("div",{className:"k-scheduler-cell k-heading-cell k-group-cell k-scheduler-datecolumn"},p.toLanguageString(Ct,Nt[Ct])),f.createElement("div",{className:"k-scheduler-cell k-heading-cell k-group-cell k-scheduler-timecolumn"},p.toLanguageString(bt,Nt[bt])),f.createElement("div",{className:"k-scheduler-cell k-heading-cell k-scheduler-eventcolumn"},p.toLanguageString(It,Nt[It]))))))),f.createElement("div",{className:"k-scheduler-body"},f.createElement(mr,{resources:l,group:t,nested:!0},f.createElement(or.Consumer,null,(({groupIndex:t})=>k.filter((e=>e.group.index===(t||0))).map(((r,a,l)=>f.createElement("div",{className:"k-scheduler-row k-scheduler-content",key:`${t}:${a}`},f.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"},f.createElement("div",null,f.createElement("strong",{className:"k-scheduler-agendaday"},m.formatDate(r.zonedStart,"dd")),f.createElement("em",{className:"k-scheduler-agendaweek"},m.formatDate(r.zonedStart,"EEEE")),f.createElement("span",{className:"k-scheduler-agendadate"},m.formatDate(r.zonedStart,"y")))),f.createElement("div",{className:"k-scheduler-cell k-group-content"},r.items.length?r.items.map(((t,r)=>f.createElement("div",{className:"k-scheduler-row",key:r},f.createElement("div",{className:"k-scheduler-cell k-scheduler-timecolumn"},f.createElement("div",null,t.tail&&f.createElement(n.IconWrap,{name:"rtl"===u?"caret-alt-right":"caret-alt-left",icon:"rtl"===u?d.caretAltRightIcon:d.caretAltLeftIcon}),t.isAllDay?p.toLanguageString(Ae,Nt[Ae]):cn(m,t),t.head&&f.createElement(n.IconWrap,{name:"rtl"===u?"caret-alt-left":"caret-alt-right",icon:"rtl"===u?d.caretAltLeftIcon:d.caretAltRightIcon}))),f.createElement("div",{className:"k-scheduler-cell"},f.createElement(s,{key:`${a}:${r}`,...t,onDataAction:e.onDataAction,task:e.task,viewTask:e.viewTask,editable:e.editable}))))):f.createElement("div",{className:"k-scheduler-cell k-heading-cell k-group-cell"},p.toLanguageString(xt,Nt[xt])))))))))))},cn=(e,t)=>{let r="{0:t}-{1:t}";return t.head?r="{0:t}":t.tail&&(r="{1:t}"),e.format(r,t.zonedStart,t.zonedEnd)},dn={name:"agenda",title:e=>e.toLanguageString(Le,Nt[Le]),dateRange:({intl:e,date:t,numberOfDays:r=1,timezone:n})=>{const l=a.ZonedDate.fromLocalDate(t,n),o=(e=>a.getDate(e))(7===r?a.firstDayInWeek(l,e.firstDay()):l),s=((e,t)=>a.getDate(a.addDays(e,t||1)))(o,r),c=a.ZonedDate.fromUTCDate(z(o),n),i=a.ZonedDate.fromUTCDate(z(s),n);return{start:new Date(c.getTime()),end:new Date(i.getTime()),zonedStart:c,zonedEnd:i}},selectedDateFormat:"{0:D} - {1:D}",selectedShortDateFormat:"{0:d} - {1:d}",slotDuration:1440,slotDivision:1,numberOfDays:7},un={title:r.any};sn.propTypes=un,sn.displayName="KendoReactSchedulerAgendaView";const mn=f.forwardRef(((e,t)=>{const r=f.useRef(null),a=f.useRef(null),n=o.useLocalization();f.useImperativeHandle(r,(()=>({element:a.current&&a.current.element,...e}))),f.useImperativeHandle(t,(()=>r.current));const l=f.useCallback((t=>{!e.onClick||!r.current||e.onClick.call(void 0,{target:r.current,syntheticEvent:t})}),[r,e.slot,e.onClick]),c=n.toLanguageString(At,Nt[At]);return f.createElement(s.Button,{ref:a,tabIndex:-1,className:"k-more-events",onClick:l,"aria-label":c,icon:"more-horizontal",svgIcon:d.moreHorizontalIcon})}));mn.displayName="KendoReactSchedulerShowMoreItemsButton";const pn={skeleton:"dd"},gn=e=>{const{group:t,timezone:r,resources:l}=ne(),s=e.editItem||Pa,c=e.editSlot||ea,[i]=fe(),[d,u]=ye(),[,m]=De(),p=oe(),g=ue(),E=Ee(),h=pe(),y=o.useInternationalization(),v=ce(),k=e.itemsPerSlot||En.itemsPerSlot,D=f.useMemo((()=>Ba(h,{step:7*a.MS_PER_DAY,timezone:r})),[h.start.getTime(),h.end.getTime(),r]),S=f.useMemo((()=>Ua(0,{step:a.MS_PER_DAY},{groups:g,ranges:D})),[h.start.getTime(),h.end.getTime(),g,D]),C=f.useMemo((()=>ia(i,{dateRange:h,fields:v,timezone:r})),[i,h.start.getTime(),h.end.getTime(),v,r]),b=f.useMemo((()=>pa(C,{timezone:r},{groups:g,ranges:D})),[C,r,g,D]),I=f.useCallback((e=>{const t=p.find((e=>"day"===e.props.name));!m||!t||!t.props.name||!e.target.slot||(m(t.props.name,e),u(e.target.slot.start,e))}),[m,p]);f.useMemo((()=>Z(b,S,!0)),[b,S]),f.useMemo((()=>U(b,S,!0)),[b,S]);const w=f.createElement(or.Consumer,null,(({groupIndex:t})=>f.createElement("div",{className:"k-scheduler-row",key:t},S.filter((e=>e.group.index===t&&0===e.range.index)).map(((t,n)=>f.createElement(Va,{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"}})))))),T=f.createElement(or.Consumer,null,(({groupIndex:t})=>D.map(((r,a)=>f.createElement("div",{className:"k-scheduler-row",key:a},S.filter((e=>e.group.index===t&&e.range.index===a)).map(((r,l,o)=>f.createElement(c,{slot:e.slot,viewSlot:e.viewSlot,key:l,form:e.form,...r,expandable:{offsetTop:30,offsetBottom:k<r.items.length?15:0},onDataAction:e.onDataAction,col:"horizontal"===E?o.length*(t||0)+l:l,row:"horizontal"===E?a:D.length*(t||0)+a,editable:e.editable,className:n.classNames({"k-other-month":r.start.getMonth()<d.getMonth()||r.start.getMonth()>d.getMonth()})},f.createElement("span",{className:"k-link k-nav-day"},y.formatDate(new Date(r.end.getTime()-(r.end.getTime()-r.start.getTime())/2),pn)),k<r.items.length&&f.createElement(mn,{slot:r,onClick:I})))))))));return f.createElement(lr,{props:e,slots:S,ranges:D,className:n.classNames("k-scheduler-monthview",e.className)},f.createElement("div",{className:"k-scheduler-head"},"horizontal"===E?f.createElement(sr,{nested:!0,resources:l,group:t},w):f.createElement(mr,{resources:l,group:t},w)),f.createElement("div",{className:"k-scheduler-body"},"horizontal"===E?f.createElement(sr,{resources:l,group:t},T):f.createElement(mr,{nested:!0,resources:l,group:t},T),b.filter((e=>null===e.order||e.order<k)).sort(Y).map((t=>f.createElement(s,{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,style:{transform:"translateY(30px)"},vertical:!1,editable:e.editable,ignoreIsAllDay:!0})))))},En={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(z(n),r),s=a.ZonedDate.fromUTCDate(z(l),r);return{start:new Date(o.getTime()),end:new Date(s.getTime()),zonedStart:o,zonedEnd:s}},slotDuration:1440,slotDivision:1,itemsPerSlot:2,numberOfDays:31,title:e=>e.toLanguageString(Fe,Nt[Fe]),selectedDateFormat:"{0:Y}",selectedShortDateFormat:"{0:Y}"},hn={itemsPerSlot:r.number};gn.propTypes=hn,gn.displayName="KendoReactSchedulerMonthView";const yn=e=>f.createElement($a,{...e,step:7,numberOfDays:7}),vn={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(z(l),r),c=a.ZonedDate.fromUTCDate(z(o),r);return{start:new Date(s.getTime()),end:new Date(c.getTime()),zonedStart:s,zonedEnd:c}},title:e=>e.toLanguageString(Me,Nt[Me]),selectedDateFormat:"{0:D} - {1:D}",selectedShortDateFormat:"{0:d} - {1:d}"};yn.displayName="KendoReactSchedulerWeekView";const fn=e=>{const t=pe(),r=Math.round((t.end.getTime()-t.start.getTime())/a.MS_PER_DAY);return f.createElement($a,{...e,step:7,numberOfDays:r})},kn={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)),d=a.addDays(i,c),u=a.ZonedDate.fromUTCDate(z(i),r),m=a.ZonedDate.fromUTCDate(z(d),r);return{start:new Date(u.getTime()),end:new Date(m.getTime()),zonedStart:u,zonedEnd:m}},title:e=>e.toLanguageString(ze,Nt[ze]),workWeekStart:a.Day.Monday,workWeekEnd:a.Day.Friday,selectedDateFormat:"{0:D} - {1:D}",selectedShortDateFormat:"{0:d} - {1:d}"};fn.displayName="KendoReactSchedulerWorkWeekView";const Dn=f.createElement("div",{className:"k-scheduler-cell k-side-cell"}),Sn=e=>f.createElement(f.Fragment,null,f.createElement("div",{className:"k-sticky-cell"},Dn),e.children),Cn=e=>{const t=o.useLocalization();return f.createElement(f.Fragment,null,f.createElement("div",{className:"k-sticky-cell"},f.createElement("div",{className:"k-scheduler-cell k-heading-cell k-side-cell k-scheduler-times-all-day","data-range-index":0},t.toLanguageString(xe,Nt[xe]))),e.children)},bn=e=>{const{group:t,timezone:r,resources:l}=ne(),s=f.useRef(null),c=f.useRef(null),i=e.editItem||Pa,d=e.editSlot||ea,u=f.useRef(null),[m]=fe(),p=Ee(),g=ue(),E=pe(),h=ce(),y=o.useInternationalization(),v=e.showWorkHours,k=e.slotDivisions||In.slotDivisions,D=e.slotDuration||In.slotDuration,S=e.workWeekStart||In.workWeekStart,C=e.workWeekEnd||In.workWeekEnd,b=y.parseDate(e.workDayStart||e.isWorkDayStart||In.isWorkDayStart),I=y.parseDate(e.workDayEnd||e.isWorkDayEnd||In.isWorkDayEnd),w=y.parseDate(e.startTime||In.startTime),x=y.parseDate(e.endTime||In.endTime),A=f.useMemo((()=>v?b:w),[v,b,w]),N=f.useMemo((()=>v?I:x),[v,I,x]),_=f.useMemo((()=>Ba(E,{step:a.MS_PER_DAY,timezone:r})),[E.start.getTime(),E.end.getTime(),r]),M=f.useMemo((()=>Ua(0,{step:D/k*a.MS_PER_MINUTE},{groups:g,ranges:_}).filter((e=>K(e.zonedStart,A,N)||A.getTime()===N.getTime()))),[g,_,E.start.getTime(),E.end.getTime(),r,D,k,A.getTime(),N.getTime()]),L=f.useMemo((()=>ia(m,{dateRange:E,fields:h,timezone:r})),[m,E.start.getTime(),E.end.getTime(),h,r]),O=f.useMemo((()=>pa(L,{timezone:r},{groups:g,ranges:_}).filter((e=>A.getTime()===N.getTime()||K(e.zonedStart,A,N)||K(e.zonedEnd,A,N)||K(new Date(e.zonedEnd.getTime()-(e.zonedEnd.getTime()-e.zonedStart.getTime())/2),A,N)))),[L,r,g,_,A.getTime(),N.getTime()]);f.useMemo((()=>Z(O,M,!0)),[O,M]),f.useMemo((()=>U(O,M,!0)),[O,M]);const F=("horizontal"===p?M.length:M.length/g.length)*((e.columnWidth||In.columnWidth)+1),P=f.createElement(or.Consumer,null,(()=>f.createElement(f.Fragment,null,f.createElement("div",{className:"k-scheduler-row"},_.map(((t,r)=>f.createElement(Va,{as:e.dateHeaderCell,key:r,date:t.zonedStart,start:t.start,end:t.end,format:"m"})))),f.createElement("div",{className:"k-scheduler-row",ref:s},_.map(((t,r)=>M.filter((e=>0===e.group.index&&e.range.index===r)).map((t=>t.zonedStart.getMinutes()%D==0?f.createElement(Dr,{key:t.index,as:e.timeHeaderCell,format:"t",date:t.zonedStart,start:t.zonedStart,end:t.zonedEnd}):null)))))))),W=f.createElement(or.Consumer,null,(({groupIndex:t})=>f.createElement("div",{className:"k-scheduler-row"},_.map(((n,l)=>M.filter((e=>e.group.index===t&&e.range.index===l)).map(((n,o,s)=>{const c=a.ZonedDate.fromUTCDate(z(n.zonedStart),r),i=V(c.getDay(),S,C);return f.createElement(d,{key:`${n.start.getTime()}:${n.group.index}`,slot:e.slot,viewSlot:e.viewSlot,...n,form:e.form,onDataAction:e.onDataAction,isWorkHour:K(n.zonedStart,b,I),isWorkDay:i,col:"horizontal"===p?l*s.length+o+s.length*_.length*(t||0):l*s.length+o,row:"horizontal"===p?0:t||0,expandable:!0,editable:e.editable})}))))))),G=f.useMemo((()=>n.classNames("k-scheduler-timelineview",e.className)),[e.className]);Qt({element:u,selector:".k-resource-cell",attribute:"data-depth-index",explicitDepth:!0});const B=u.current?u.current.closest(".k-scheduler-layout"):null;return oa({element:B,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:O&&!O.length}),f.createElement(lr,{ref:u,id:e.id,style:{...e.style},className:G,props:e,slots:M,ranges:_},f.createElement("div",{className:"k-scheduler-head",style:{width:F}},"horizontal"===p?f.createElement(sr,{nested:!0,group:t,resources:l,rowContent:Sn},P):f.createElement(mr,{wrapGroup:!0,group:t,resources:l},P)),f.createElement("div",{className:"k-scheduler-body",style:{width:F},ref:c},"horizontal"===p?f.createElement(sr,{group:t,resources:l,rowContent:Cn},W,f.createElement(or.Consumer,null,(({groupIndex:t})=>e.currentTimeMarker&&H(T(_).start,R(_).end,new Date,new Date,!0)&&f.createElement(Wa,{groupIndex:t,attachArrow:s,vertical:!0})))):f.createElement(mr,{nested:!0,wrapGroup:!0,group:t,resources:l},W),"vertical"===p&&e.currentTimeMarker&&H(T(_).start,R(_).end,new Date,new Date,!0)&&f.createElement(Wa,{attachArrow:s,vertical:!0}),O.sort(Y).map(((t,r)=>f.createElement(i,{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})))))},In={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(z(l),r),c=a.ZonedDate.fromUTCDate(z(o),r);return{start:new Date(s.getTime()),end:new Date(c.getTime()),zonedStart:s,zonedEnd:c}},selectedDateFormat:"{0:D} - {1:D}",selectedShortDateFormat:"{0:d} - {1:d}",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},wn=e=>f.createElement(bn,{...e}),Tn={...In,name:"timeline",title:e=>e.toLanguageString(_e,Nt[_e]),slotDuration:60,slotDivisions:2,numberOfDays:1,selectedDateFormat:"{0:D}",selectedShortDateFormat:"{0:d}"};wn.displayName="KendoReactSchedulerTimelineView";const Rn=new Map;Rn.set(sn,dn),Rn.set(Ya,ja),Rn.set(gn,En),Rn.set(yn,vn),Rn.set(fn,kn),Rn.set(wn,Tn);const xn=f.forwardRef(((e,t)=>{var r,l,c;n.validatePackage(Xa);const i=n.shouldShowValidationUI(Xa),{timezone:u,onDataChange:m}=e,p=f.useRef(null),g=f.useRef(null);f.useImperativeHandle(g,(()=>({props:e,element:p.current}))),f.useImperativeHandle(t,(()=>g.current));const E=n.useRtl(p),h=o.useInternationalization(),y=o.useLocalization(),{fields:v}=f.useMemo((()=>(e=>({fields:{...W,...e}}))(e.modelFields)),[e.modelFields]),[k,C]=be(e.defaultDate||An.defaultDate,e.date,e.onDateChange),b=f.Children.toArray(e.children||[]).map((e=>f.isValidElement(e)?f.cloneElement(e,{...Rn.get(e.type),...e.props}):e)),I=f.cloneElement(f.createElement(Ya,null),Rn.get(Ya)),[w,T]=be(e.defaultView||b[0]&&b[0].props.name||"day",e.view,e.onViewChange),[R,x]=be(!0),A=b.find((e=>e.props.name===w))||b[0]||I,M=(null!=(r=e.data)?r:An.data)||An.data,z=((e,t)=>{const r=S(e,t),a=D(r);return 1===a.length?[{index: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),O=e.group&&e.group.orientation?e.group.orientation:"horizontal",F=A.props.selectedDateFormat||"{0:D}",P=A.props.selectedShortDateFormat||"{0:d}",H=A.props.slotDuration,K=void 0!==A.props.dateRange?"function"==typeof A.props.dateRange?A.props.dateRange.call(void 0,{intl:h,date:k,timezone:u,numberOfDays:A.props.numberOfDays,workWeekStart:A.props.workWeekStart||h.firstDay(),workWeekEnd:A.props.workWeekEnd||(h.firstDay()+A.props.numberOfDays)%6}):A.props.dateRange:{start:An.defaultDate,end:An.defaultDate},V=f.useCallback((({created:e=[],updated:t=[],deleted:r=[]})=>{if(m){const a={created:e,updated:t,deleted:r};m.call(void 0,a)}}),[m]),G=f.useCallback((e=>{const t=[e.dataItem];V({created:t})}),[V]),B=f.useCallback((e=>{const t=[],r=[];if(e.series)if(Array.isArray(e.dataItem))e.dataItem.map((t=>{const a=n.clone(L(e.dataItem,v,M)),l=n.clone(t);_(l,v.originalStart,N(a,v.originalStart)),_(l,v.recurrenceId,N(a,v.recurrenceId)),_(l,v.recurrenceExceptions,N(a,v.recurrenceExceptions)),r.push(l)}));else{const t=n.clone(L(e.dataItem,v,M)),a=n.clone(e.dataItem);_(a,v.originalStart,N(t,v.originalStart)),_(a,v.recurrenceId,N(t,v.recurrenceId)),_(a,v.recurrenceExceptions,N(t,v.recurrenceExceptions)),r.push(a)}else if(Array.isArray(e.dataItem))e.dataItem.map((e=>{const a=null!==N(e,v.recurrenceRule)&&void 0!==N(e,v.recurrenceRule);if(null!==N(e,v.recurrenceId)&&void 0!==N(e,v.recurrenceId)&&a){const a=n.clone(L(e,v,M)),l=N(e,v.originalStart),o=N(a,v.recurrenceExceptions)||[];_(a,v.recurrenceExceptions,[...o,l]),_(e,v.recurrenceRule,null),r.push(a),t.push(e)}else r.push(e)}));else{const a=null!==N(e.dataItem,v.recurrenceRule)&&void 0!==N(e.dataItem,v.recurrenceRule);if(null!==N(e.dataItem,v.recurrenceId)&&void 0!==N(e.dataItem,v.recurrenceId)&&a){const a=n.clone(L(e.dataItem,v,M)),l=N(e.dataItem,v.originalStart),o=N(a,v.recurrenceExceptions)||[];_(a,v.recurrenceExceptions,[...o,l]),_(e.dataItem,v.recurrenceRule,null),r.push(a),t.push(e.dataItem)}else r.push(e.dataItem)}V({updated:r,created:t})}),[V,v,M]),U=f.useCallback((e=>{const t=[],r=[];if(e.series){const t=n.clone(L(e.dataItem,v,M)),a=n.clone(e.dataItem);_(a,v.originalStart,N(t,v.originalStart)),_(a,v.recurrenceId,N(t,v.recurrenceId)),_(a,v.recurrenceRule,N(t,v.recurrenceRule)),_(a,v.recurrenceExceptions,N(t,v.recurrenceExceptions)),r.push(a)}else if(null===N(e.dataItem,v.recurrenceRule)||void 0===N(e.dataItem,v.recurrenceRule))r.push(e.dataItem);else{const r=n.clone(L(e.dataItem,v,M)),a=N(e.dataItem,v.originalStart),l=N(r,v.recurrenceExceptions)||[];_(r,v.recurrenceExceptions,[...l,a]),_(e.dataItem,v.recurrenceRule,null),t.push(r)}V({updated:t,deleted:r})}),[V,v,M]),Z=f.useCallback((e=>{switch(e.type){case ee.create:G(e);break;case ee.update:B(e);break;case ee.remove:U(e)}}),[G,U,B]),$=f.useCallback(((e,t)=>{T(e,{...t,target:g.current})}),[T,g]),q=f.useCallback(((e,t)=>{C(e,{...t,target:g.current})}),[C,g]),Y=f.useCallback((e=>{e.value&&C(e.value,{...e,target:g.current,nativeEvent:e.nativeEvent})}),[C,g]),j=f.useCallback((e=>{var t,r;e.preventDefault();const n=null!=(r=null!=(t=A.props.step)?t:A.props.numberOfDays)?r:1,l=n>27?a.addMonths(k,Math.round(n/27)):a.addDays(k,n);C(l,e)}),[k,C,A.props.numberOfDays,A.props.step]),X=f.useCallback((e=>{var t,r;e.preventDefault();const n=null!=(r=null!=(t=A.props.step)?t:A.props.numberOfDays)?r:1,l=n>27?a.addMonths(k,-Math.round(n/27)):a.addDays(k,-n);C(l,e)}),[k,C,A.props.numberOfDays,A.props.step]),Q=f.useCallback((e=>{e.preventDefault();const t=a.ZonedDate.fromLocalDate(new Date,u);C(new Date(t.getTime()),e)}),[C,u]),J=f.useCallback((()=>{x(!R)}),[x,R]),te=f.useCallback((()=>{p.current&&(p.current.style.boxShadow="0 0.5px 0.5px 0.5px rgba(0, 0, 0, .12)")}),[p]),re=f.useCallback((()=>{p.current&&(p.current.style.boxShadow="")}),[p]),ae=f.useMemo((()=>{var t;return{...e.style,height:null!=(t=e.height)?t:An.height}}),[e.height,e.style]),ne=f.useMemo((()=>n.classNames({"k-rtl":void 0!==e.rtl?e.rtl:"rtl"===E},"k-scheduler",e.className)),[e.className,e.rtl,E]),le=y.toLanguageString(Ne,Nt[Ne]),oe=y.toLanguageString(He,Nt[He]),se=y.toLanguageString(We,Nt[We]),ce=A.props.header||e.header||An.header,ie=A.props.footer||e.footer||An.footer,de=we,[ue,me]=f.useState(null);return f.createElement(Ce,{element:p,props:e,views:b,fields:v,groups:z,dateRange:K,orientation:O,dateFormat:{dateFormat:F,shortDateFormat:P},date:[k,q],activeView:[w,$],selection:[ue,me],data:[M,Z]},f.createElement("div",{ref:p,id:e.id,style:ae,className:ne,tabIndex:null!=(l=e.tabIndex)?l:An.tabIndex,dir:E,role:e.role||"application","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-activedescendant":ue&&ue.props.id||void 0,onFocus:te,onBlur:re},f.createElement(ce,null,f.createElement(de,null,f.createElement(s.ButtonGroup,{className:"k-scheduler-navigation"},f.createElement(s.Button,{role:"button",tabIndex:-1,title:le,"aria-label":le,onClick:Q},le),f.createElement(s.Button,{role:"button",tabIndex:-1,icon:"rtl"===E?"caret-alt-right":"caret-alt-left",svgIcon:"rtl"===E?d.caretAltRightIcon:d.caretAltLeftIcon,title:oe,"aria-label":oe,onClick:X}),f.createElement(s.Button,{role:"button",tabIndex:-1,icon:"rtl"===E?"caret-alt-left":"caret-alt-right",svgIcon:"rtl"===E?d.caretAltLeftIcon:d.caretAltRightIcon,title:se,"aria-label":se,onClick:j}))),f.createElement(_t,{value:k,onChange:Y}),f.createElement(s.ToolbarSpacer,null),f.createElement(zt,null)),A&&f.createElement(A.type,{editable:null!=(c=e.editable)?c:An.editable,key:A.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:Z,showWorkHours:R,...A.props}),f.createElement(ie,null,H&&H<1440&&f.createElement(Lt,null,f.createElement(s.Button,{tabIndex:-1,onClick:J,icon:"clock",svgIcon:d.clockIcon},y.toLanguageString(R?Ke:Ve,Nt[R?Ke:Ve])))),i&&f.createElement(n.WatermarkOverlay,null)))})),An={data:[],height:600,tabIndex:-1,editable:!1,defaultDate:new Date,header:Ie,footer:Re,navigation:we,viewSelector:Te};xn.propTypes={data:r.array,editable:r.oneOfType([r.bool,r.shape({add:r.bool,drag:r.bool,edit:r.bool,remove:r.bool,resize:r.bool})]),view:r.string,defaultView:r.string,date:r.any,defaultDate:r.any,rtl:r.bool,height:r.oneOfType([r.number,r.string]),children:r.any,timezone:r.string,group:r.any,resources:r.any,modelFields:r.shape({id:r.string,start:r.string,startTimezone:r.string,end:r.string,endTimezone:r.string,isAllDay:r.string,title:r.string,description:r.string,recurrenceRule:r.string,recurrenceId:r.string,recurrenceException:r.string})},xn.displayName="KendoReactScheduler";const Nn=f.forwardRef(((e,t)=>{const{item:r,_ref:a,itemRef:l,...s}=e,c=f.useRef(),i=f.useRef(null),u=f.useRef(null),m=f.useRef(null);f.useImperativeHandle(u,(()=>({props:e,element:i.current&&i.current.element}))),f.useImperativeHandle(t,(()=>u.current)),f.useImperativeHandle(a,(()=>i.current)),f.useImperativeHandle(l,(()=>i.current));const p=r||_n.item,g=o.useInternationalization(),[E]=Vt(),[h]=Wt(),y=re(),[v,k]=f.useState(!0),[D,S]=f.useState(!1),C=f.useRef(0),I=n.useDir(y),x=f.useMemo((()=>e.isAllDay?g.toString(e.zonedStart,"t"):g.format("{0:t} - {1:t}",e.zonedStart,e.zonedEnd)),[g,e.isAllDay,e.zonedEnd,e.zonedStart]),A=f.useMemo((()=>`(${x}): ${e.title}`),[x,e.title]),N=(e,t)=>{let r=1;return e.forEach((e=>{const a=t.filter((t=>_(e.current.props,t.props)));a.length>r&&(r=a.length)})),r},_=(t,r)=>H(t.start,t.end,r.start,r.end)&&t.group.index===r.group.index&&t.range.index===r.range.index&&(e.ignoreIsAllDay||t.isAllDay===r.isAllDay),M=()=>{const t=(h||[]).filter((t=>t.current&&_(t.current.props,e)));if(0===t.length)return void k(!1);const r=T(t);if(!r.current||!i.current)return;const a=b(r.current.element);w(i.current.element,a)},z=()=>{const t=(h||[]).filter((t=>t.current&&_(t.current.props,e))),r=i.current&&i.current.element;if(!r||!t.length)return;const a=T(t),n=R(t);if(!a.current||!i.current||!n.current)return;const l=[],o=[],s=[],c=b(a.current.element),d=(e.vertical?c.height:c.width)/(a.current.props.end.getTime()-a.current.props.start.getTime()),u=(e.start.getTime()-a.current.props.start.getTime())*d,m=(Math.min(e.end.getTime(),n.current.props.end.getTime())-Math.max(e.start.getTime(),a.current.props.start.getTime()))*d;(E||[]).forEach((e=>{e.current&&(e.current.props.dragHint?o.push(e.current):e.current.props.resizeHint?s.push(e.current):l.push(e.current))}));const p=e.dragHint||e.resizeHint?B(i.current,e.dragHint?o:s,t,e.ignoreIsAllDay):e.order||0;let g=e.dragHint||e.resizeHint?N(t,e.dragHint?o:s):N(t,l);const y=((e,t)=>e.map((e=>t.filter((t=>_(e.current.props,t.props))))))(t,l);let v=0;const f=b(r);if(y.forEach((t=>{let a=0;t.forEach((t=>{H(t.props.start,t.props.end,e.start,e.end)&&!e.dragHint&&!e.resizeHint&&t._maxSiblingsPerSlot&&t._maxSiblingsPerSlot>g&&t.element!==r&&(g=t._maxSiblingsPerSlot);const n=b(t.element);null!==t.props.order&&t.props.order<p&&(a=n.top+n.height-f.top-1*p+1)})),a>v&&(v=a)})),0===t.length)return void k(!1);f.width=e.vertical?f.width/g-1-20/g:m+1,f.height=e.vertical?m-1:(e.resizeHint||e.dragHint)&&g<=1?f.height:e.style&&e.style.height?e.style.height:25,f.left=e.vertical?f.left+p*f.width+1*p:f.left+(u<0?0:u),f.top=e.vertical?f.top+(u<0?0:u):f.top+v+1*p,C.current=g,w(r,f),S(!0),k(!0)},L=f.useCallback((e=>{const t=e&&e[0],r=m.current;void 0!==c.current&&window.cancelAnimationFrame(c.current),r&&t&&(r.width!==t.contentRect.width||r.height!==t.contentRect.height)&&(c.current=window.requestAnimationFrame((()=>{M(),z()}))),m.current={width:t.contentRect.width,height:t.contentRect.height}}),[M,z]);f.useEffect(M),f.useEffect(z);const O=i.current&&i.current.element?i.current.element.closest(".k-scheduler-layout"):null;return oa({element:O,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:e.isLast}),f.useEffect((()=>{if(!y.current)return;const e=window.ResizeObserver,t=e&&new e(L);return t&&t.observe(y.current),()=>{t&&t.disconnect()}}),[L,y]),f.createElement(p,{...s,_ref:i,_maxSiblingsPerSlot:C,itemRef:i,style:{visibility:D?void 0:"hidden",display:v?void 0:"none",...e.style}},!e.resizeHint&&f.createElement("span",{className:"k-event-actions"},e.tail&&f.createElement(n.IconWrap,{name:"rtl"===I?"caret-alt-right":"caret-alt-left",icon:"rtl"===I?d.caretAltRightIcon:d.caretAltLeftIcon}),e.isRecurring&&!e.isException&&f.createElement(n.IconWrap,{name:"reload",icon:d.arrowRotateCwIcon}),!e.isRecurring&&e.isException&&f.createElement(n.IconWrap,{name:"non-recurrence",icon:d.nonRecurrenceIcon})),!e.resizeHint&&f.createElement("div",{title:A},!e.isAllDay&&f.createElement(la,{className:"k-event-time"},A),f.createElement(la,null,e.title)))})),_n={item:na};Nn.displayName="KendoReactSchedulerProportionalViewItem",e.AgendaView=sn,e.DATA_ACTION=ee,e.DRAG_ITEM_ACTION=za,e.DateHeaderCell=Va,e.DayView=Ya,e.ITEMS_FOCUS_ACTION=Jt,e.ITEMS_SELECT_ACTION=jt,e.MonthView=gn,e.REMOVE_ITEM_ACTION=_a,e.RESIZE_ITEM_ACTION=La,e.SERIES_ACTION=Oa,e.SHOW_OCCURRENCE_DIALOG_ACTION=Na,e.SHOW_REMOVE_DIALOG_ACTION=Ma,e.SLOTS_FOCUS_ACTION=er,e.SLOTS_SELECT_ACTION=Xt,e.Scheduler=xn,e.SchedulerActiveViewContext=ke,e.SchedulerDataContext=ve,e.SchedulerDateContext=he,e.SchedulerDateRangeContext=me,e.SchedulerDrag=va,e.SchedulerEditItem=Pa,e.SchedulerEditItemDragItemContext=ba,e.SchedulerEditItemFormItemContext=Ca,e.SchedulerEditItemPropsContext=Sa,e.SchedulerEditItemRemoveItemContext=wa,e.SchedulerEditItemResizeItemContext=Ia,e.SchedulerEditItemShowOccurrenceDialogContext=Ra,e.SchedulerEditItemShowRemoveDialogContext=Ta,e.SchedulerEditSlot=ea,e.SchedulerEditSlotFormItemContext=Xr,e.SchedulerEditSlotPropsContext=jr,e.SchedulerEditTask=ln,e.SchedulerFieldsContext=se,e.SchedulerFooter=Re,e.SchedulerForm=Br,e.SchedulerFormEditor=Vr,e.SchedulerGroupsContext=de,e.SchedulerHeader=Ie,e.SchedulerItem=na,e.SchedulerItemContent=la,e.SchedulerOccurrenceDialog=ra,e.SchedulerOrientationContext=ge,e.SchedulerProportionalViewItem=Nn,e.SchedulerPropsContext=ae,e.SchedulerRemoveDialog=aa,e.SchedulerResize=ka,e.SchedulerSlot=Zr,e.SchedulerTask=Qa,e.SchedulerViewItem=sa,e.SchedulerViewSlot=qr,e.SchedulerViewTask=Ja,e.SchedulerViewsContext=le,e.TimeHeaderCell=Dr,e.TimelineView=wn,e.WeekView=yn,e.WorkWeekView=fn,e.agendaViewDefaultProps=dn,e.dateHeaderCellDefaultProps=Ga,e.dayViewDefaultProps=ja,e.monthViewDefaultProps=En,e.schedulerDefaultProps=An,e.schedulerDragDefaultProps=fa,e.schedulerEditItemDefaultProps=Ha,e.schedulerEditSlotDefaultProps=ta,e.schedulerEditTaskDefaultProps=on,e.schedulerFormDefaultProps=Ur,e.schedulerFormEditorDefaultProps=Gr,e.schedulerProportionalViewItemDefaultProps=_n,e.schedulerResizeDefaultProps=Da,e.schedulerSlotDefaultProps=$r,e.schedulerViewItemDefaultProps=ca,e.schedulerViewSlotDefaultProps=Yr,e.schedulerViewTaskDefaultProps=en,e.timeHeaderCellDefaultProps=Sr,e.timeLineViewDefaultProps=Tn,e.useSchedulerActiveViewContext=De,e.useSchedulerDataContext=fe,e.useSchedulerDateContext=ye,e.useSchedulerDateRangeContext=pe,e.useSchedulerEditItemDragItemContext=()=>f.useContext(ba),e.useSchedulerEditItemFormItemContext=()=>f.useContext(Ca),e.useSchedulerEditItemPropsContext=()=>f.useContext(Sa),e.useSchedulerEditItemRemoveItemContext=()=>f.useContext(wa),e.useSchedulerEditItemResizeItemContext=()=>f.useContext(Ia),e.useSchedulerEditItemShowOccurrenceDialogContext=()=>f.useContext(Ra),e.useSchedulerEditItemShowRemoveDialogContext=()=>f.useContext(Ta),e.useSchedulerEditSlotFormItemContext=()=>f.useContext(Xr),e.useSchedulerEditSlotPropsContext=()=>f.useContext(jr),e.useSchedulerFieldsContext=ce,e.useSchedulerGroupsContext=ue,e.useSchedulerOrientationContext=Ee,e.useSchedulerPropsContext=ne,e.useSchedulerViewsContext=oe,e.weekViewDefaultProps=vn,e.workWeekDefaultProps=kn}));
@@ -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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const se=require("react"),oe=require("./SchedulerItem.js"),f=require("../utils/index.js"),g=require("../views/common/utils.js"),h=require("../constants/index.js"),ae=require("@progress/kendo-react-intl"),K=require("./SchedulerItemContent.js"),y=require("@progress/kendo-react-common"),D=require("@progress/kendo-svg-icons"),J=require("../context/SchedulerViewContext.js"),ue=require("../context/SchedulerContext.js"),de=require("../hooks/useRowSync.js");function me(e){const S=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const d in e)if(d!=="default"){const w=Object.getOwnPropertyDescriptor(e,d);Object.defineProperty(S,d,w.get?w:{enumerable:!0,get:()=>e[d]})}}return S.default=e,Object.freeze(S)}const r=me(se),fe=1,Q=r.forwardRef((e,S)=>{const{item:d,_ref:w,itemRef:X,...Y}=e,H=r.useRef(),c=r.useRef(null),q=r.useRef(null),k=r.useRef(null);r.useImperativeHandle(q,()=>({props:e,element:c.current&&c.current.element})),r.useImperativeHandle(S,()=>q.current),r.useImperativeHandle(w,()=>c.current),r.useImperativeHandle(X,()=>c.current);const Z=d||U.item,x=ae.useInternationalization(),[p]=J.useSchedulerViewItemsContext(),[C]=J.useSchedulerViewSlotsContext(),v=ue.useSchedulerElementContext(),[ee,T]=r.useState(!0),[te,ne]=r.useState(!1),M=r.useRef(0),V=y.useDir(v),W=r.useMemo(()=>e.isAllDay?x.toString(e.zonedStart,"t"):x.format("{0:t} - {1:t}",e.zonedStart,e.zonedEnd),[x,e.isAllDay,e.zonedEnd,e.zonedStart]),B=r.useMemo(()=>`(${W}): ${e.title}`,[W,e.title]),N=(n,t)=>{let i=1;return n.forEach(o=>{const u=t.filter(R=>b(o.current.props,R.props));u.length>i&&(i=u.length)}),i},re=(n,t)=>n.map(o=>t.filter(u=>b(o.current.props,u.props))),b=(n,t)=>f.intersects(n.start,n.end,t.start,t.end)&&n.group.index===t.group.index&&n.range.index===t.range.index&&(e.ignoreIsAllDay||n.isAllDay===t.isAllDay),P=()=>{const n=(C||[]).filter(o=>o.current&&b(o.current.props,e));if(n.length===0){T(!1);return}const t=f.first(n);if(!t.current||!c.current)return;const i=g.getRect(t.current.element);g.setRect(c.current.element,i)},z=()=>{const n=(C||[]).filter(s=>s.current&&b(s.current.props,e)),t=c.current&&c.current.element;if(!t||!n.length)return;const i=f.first(n),o=f.last(n);if(!i.current||!c.current||!o.current)return;const u=[],R=[],O=[],F=g.getRect(i.current.element),$=(e.vertical?F.height:F.width)/(i.current.props.end.getTime()-i.current.props.start.getTime()),E=(e.start.getTime()-i.current.props.start.getTime())*$,L=(Math.min(e.end.getTime(),o.current.props.end.getTime())-Math.max(e.start.getTime(),i.current.props.start.getTime()))*$;(p||[]).forEach(s=>{s.current&&(s.current.props.dragHint?R.push(s.current):s.current.props.resizeHint?O.push(s.current):u.push(s.current))});const I=e.dragHint||e.resizeHint?f.calculateOrder(c.current,e.dragHint?R:O,n,e.ignoreIsAllDay):e.order||0;let m=e.dragHint||e.resizeHint?N(n,e.dragHint?R:O):N(n,u);const ce=re(n,u);let _=0;const l=g.getRect(t);if(ce.forEach(s=>{let A=0;s.forEach(a=>{f.intersects(a.props.start,a.props.end,e.start,e.end)&&!(e.dragHint||e.resizeHint)&&a._maxSiblingsPerSlot&&a._maxSiblingsPerSlot>m&&a.element!==t&&(m=a._maxSiblingsPerSlot);const G=g.getRect(a.element);a.props.order!==null&&a.props.order<I&&(A=G.top+G.height-l.top-h.BORDER_WIDTH*I+fe)}),A>_&&(_=A)}),n.length===0){T(!1);return}const le=20;l.width=e.vertical?l.width/m-h.BORDER_WIDTH-le/m:L+h.BORDER_WIDTH,l.height=e.vertical?L-h.BORDER_WIDTH:(e.resizeHint||e.dragHint)&&m<=1?l.height:e.style&&e.style.height?e.style.height:25,l.left=e.vertical?l.left+I*l.width+h.BORDER_WIDTH*I:l.left+(E<0?0:E),l.top=e.vertical?l.top+(E<0?0:E):l.top+_+h.BORDER_WIDTH*I,M.current=m,g.setRect(t,l),ne(!0),T(!0)},j=r.useCallback(n=>{const t=n&&n[0],i=k.current;H.current!==void 0&&window.cancelAnimationFrame(H.current),i&&t&&(i.width!==t.contentRect.width||i.height!==t.contentRect.height)&&(H.current=window.requestAnimationFrame(()=>{P(),z()})),k.current={width:t.contentRect.width,height:t.contentRect.height}},[P,z]);r.useEffect(P),r.useEffect(z);const ie=c.current&&c.current.element?c.current.element.closest(".k-scheduler-layout"):null;return de.useRowSync({element:ie,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:e.isLast}),r.useEffect(()=>{if(!v.current)return;const n=window.ResizeObserver,t=n&&new n(j);return t&&t.observe(v.current),()=>{t&&t.disconnect()}},[j,v]),r.createElement(Z,{...Y,_ref:c,_maxSiblingsPerSlot:M,itemRef:c,style:{visibility:te?void 0:"hidden",display:ee?void 0:"none",...e.style}},!e.resizeHint&&r.createElement("span",{className:"k-event-actions"},e.tail&&r.createElement(y.IconWrap,{name:V==="rtl"?"caret-alt-right":"caret-alt-left",icon:V==="rtl"?D.caretAltRightIcon:D.caretAltLeftIcon}),e.isRecurring&&!e.isException&&r.createElement(y.IconWrap,{name:"reload",icon:D.arrowRotateCwIcon}),!e.isRecurring&&e.isException&&r.createElement(y.IconWrap,{name:"non-recurrence",icon:D.nonRecurrenceIcon})),!e.resizeHint&&r.createElement("div",{title:B},!e.isAllDay&&r.createElement(K.SchedulerItemContent,{className:"k-event-template k-event-time "},B),r.createElement(K.SchedulerItemContent,{className:"k-event-template"},e.title)))}),U={item:oe.SchedulerItem};Q.displayName="KendoReactSchedulerProportionalViewItem";exports.SchedulerProportionalViewItem=Q;exports.schedulerProportionalViewItemDefaultProps=U;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const se=require("react"),oe=require("./SchedulerItem.js"),f=require("../utils/index.js"),g=require("../views/common/utils.js"),h=require("../constants/index.js"),ae=require("@progress/kendo-react-intl"),K=require("./SchedulerItemContent.js"),y=require("@progress/kendo-react-common"),D=require("@progress/kendo-svg-icons"),J=require("../context/SchedulerViewContext.js"),ue=require("../context/SchedulerContext.js"),de=require("../hooks/useRowSync.js");function me(e){const S=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const d in e)if(d!=="default"){const w=Object.getOwnPropertyDescriptor(e,d);Object.defineProperty(S,d,w.get?w:{enumerable:!0,get:()=>e[d]})}}return S.default=e,Object.freeze(S)}const r=me(se),fe=1,Q=r.forwardRef((e,S)=>{const{item:d,_ref:w,itemRef:X,...Y}=e,H=r.useRef(),c=r.useRef(null),q=r.useRef(null),C=r.useRef(null);r.useImperativeHandle(q,()=>({props:e,element:c.current&&c.current.element})),r.useImperativeHandle(S,()=>q.current),r.useImperativeHandle(w,()=>c.current),r.useImperativeHandle(X,()=>c.current);const Z=d||U.item,x=ae.useInternationalization(),[p]=J.useSchedulerViewItemsContext(),[k]=J.useSchedulerViewSlotsContext(),b=ue.useSchedulerElementContext(),[ee,T]=r.useState(!0),[te,ne]=r.useState(!1),M=r.useRef(0),V=y.useDir(b),W=r.useMemo(()=>e.isAllDay?x.toString(e.zonedStart,"t"):x.format("{0:t} - {1:t}",e.zonedStart,e.zonedEnd),[x,e.isAllDay,e.zonedEnd,e.zonedStart]),B=r.useMemo(()=>`(${W}): ${e.title}`,[W,e.title]),j=(n,t)=>{let i=1;return n.forEach(o=>{const u=t.filter(R=>E(o.current.props,R.props));u.length>i&&(i=u.length)}),i},re=(n,t)=>n.map(o=>t.filter(u=>E(o.current.props,u.props))),E=(n,t)=>f.intersects(n.start,n.end,t.start,t.end)&&n.group.index===t.group.index&&n.range.index===t.range.index&&(e.ignoreIsAllDay||n.isAllDay===t.isAllDay),P=()=>{const n=(k||[]).filter(o=>o.current&&E(o.current.props,e));if(n.length===0){T(!1);return}const t=f.first(n);if(!t.current||!c.current)return;const i=g.getRect(t.current.element);g.setRect(c.current.element,i)},z=()=>{const n=(k||[]).filter(s=>s.current&&E(s.current.props,e)),t=c.current&&c.current.element;if(!t||!n.length)return;const i=f.first(n),o=f.last(n);if(!i.current||!c.current||!o.current)return;const u=[],R=[],O=[],F=g.getRect(i.current.element),$=(e.vertical?F.height:F.width)/(i.current.props.end.getTime()-i.current.props.start.getTime()),v=(e.start.getTime()-i.current.props.start.getTime())*$,L=(Math.min(e.end.getTime(),o.current.props.end.getTime())-Math.max(e.start.getTime(),i.current.props.start.getTime()))*$;(p||[]).forEach(s=>{s.current&&(s.current.props.dragHint?R.push(s.current):s.current.props.resizeHint?O.push(s.current):u.push(s.current))});const I=e.dragHint||e.resizeHint?f.calculateOrder(c.current,e.dragHint?R:O,n,e.ignoreIsAllDay):e.order||0;let m=e.dragHint||e.resizeHint?j(n,e.dragHint?R:O):j(n,u);const ce=re(n,u);let _=0;const l=g.getRect(t);if(ce.forEach(s=>{let A=0;s.forEach(a=>{f.intersects(a.props.start,a.props.end,e.start,e.end)&&!(e.dragHint||e.resizeHint)&&a._maxSiblingsPerSlot&&a._maxSiblingsPerSlot>m&&a.element!==t&&(m=a._maxSiblingsPerSlot);const G=g.getRect(a.element);a.props.order!==null&&a.props.order<I&&(A=G.top+G.height-l.top-h.BORDER_WIDTH*I+fe)}),A>_&&(_=A)}),n.length===0){T(!1);return}const le=20;l.width=e.vertical?l.width/m-h.BORDER_WIDTH-le/m:L+h.BORDER_WIDTH,l.height=e.vertical?L-h.BORDER_WIDTH:(e.resizeHint||e.dragHint)&&m<=1?l.height:e.style&&e.style.height?e.style.height:25,l.left=e.vertical?l.left+I*l.width+h.BORDER_WIDTH*I:l.left+(v<0?0:v),l.top=e.vertical?l.top+(v<0?0:v):l.top+_+h.BORDER_WIDTH*I,M.current=m,g.setRect(t,l),ne(!0),T(!0)},N=r.useCallback(n=>{const t=n&&n[0],i=C.current;H.current!==void 0&&window.cancelAnimationFrame(H.current),i&&t&&(i.width!==t.contentRect.width||i.height!==t.contentRect.height)&&(H.current=window.requestAnimationFrame(()=>{P(),z()})),C.current={width:t.contentRect.width,height:t.contentRect.height}},[P,z]);r.useEffect(P),r.useEffect(z);const ie=c.current&&c.current.element?c.current.element.closest(".k-scheduler-layout"):null;return de.useRowSync({element:ie,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:e.isLast}),r.useEffect(()=>{if(!b.current)return;const n=window.ResizeObserver,t=n&&new n(N);return t&&t.observe(b.current),()=>{t&&t.disconnect()}},[N,b]),r.createElement(Z,{...Y,_ref:c,_maxSiblingsPerSlot:M,itemRef:c,style:{visibility:te?void 0:"hidden",display:ee?void 0:"none",...e.style}},!e.resizeHint&&r.createElement("span",{className:"k-event-actions"},e.tail&&r.createElement(y.IconWrap,{name:V==="rtl"?"caret-alt-right":"caret-alt-left",icon:V==="rtl"?D.caretAltRightIcon:D.caretAltLeftIcon}),e.isRecurring&&!e.isException&&r.createElement(y.IconWrap,{name:"reload",icon:D.arrowRotateCwIcon}),!e.isRecurring&&e.isException&&r.createElement(y.IconWrap,{name:"non-recurrence",icon:D.nonRecurrenceIcon})),!e.resizeHint&&r.createElement("div",{title:B},!e.isAllDay&&r.createElement(K.SchedulerItemContent,{className:"k-event-time"},B),r.createElement(K.SchedulerItemContent,null,e.title)))}),U={item:oe.SchedulerItem};Q.displayName="KendoReactSchedulerProportionalViewItem";exports.SchedulerProportionalViewItem=Q;exports.schedulerProportionalViewItemDefaultProps=U;
@@ -22,10 +22,10 @@ const Re = 1, we = r.forwardRef(
22
22
  (e, K) => {
23
23
  const { item: j, _ref: J, itemRef: Q, ...U } = e, w = r.useRef(), c = r.useRef(null), P = r.useRef(null), T = r.useRef(null);
24
24
  r.useImperativeHandle(P, () => ({ props: e, element: c.current && c.current.element })), r.useImperativeHandle(K, () => P.current), r.useImperativeHandle(J, () => c.current), r.useImperativeHandle(Q, () => c.current);
25
- const X = j || ve.item, v = oe(), [Y] = he(), [D] = ge(), g = Se(), [Z, E] = r.useState(!0), [p, ee] = r.useState(!1), k = r.useRef(0), _ = ae(g), C = r.useMemo(
25
+ const X = j || ve.item, v = oe(), [Y] = he(), [D] = ge(), g = Se(), [Z, E] = r.useState(!0), [p, ee] = r.useState(!1), _ = r.useRef(0), C = ae(g), M = r.useMemo(
26
26
  () => e.isAllDay ? v.toString(e.zonedStart, "t") : v.format("{0:t} - {1:t}", e.zonedStart, e.zonedEnd),
27
27
  [v, e.isAllDay, e.zonedEnd, e.zonedStart]
28
- ), M = r.useMemo(() => `(${C}): ${e.title}`, [C, e.title]), O = (n, t) => {
28
+ ), O = r.useMemo(() => `(${M}): ${e.title}`, [M, e.title]), k = (n, t) => {
29
29
  let i = 1;
30
30
  return n.forEach((o) => {
31
31
  const u = t.filter((f) => S(o.current.props, f.props));
@@ -49,7 +49,7 @@ const Re = 1, we = r.forwardRef(
49
49
  const i = $(n), o = le(n);
50
50
  if (!i.current || !c.current || !o.current)
51
51
  return;
52
- const u = [], f = [], H = [], N = R(i.current.element), F = (e.vertical ? N.height : N.width) / (i.current.props.end.getTime() - i.current.props.start.getTime()), I = (e.start.getTime() - i.current.props.start.getTime()) * F, L = (Math.min(e.end.getTime(), o.current.props.end.getTime()) - Math.max(e.start.getTime(), i.current.props.start.getTime())) * F;
52
+ const u = [], f = [], H = [], F = R(i.current.element), N = (e.vertical ? F.height : F.width) / (i.current.props.end.getTime() - i.current.props.start.getTime()), I = (e.start.getTime() - i.current.props.start.getTime()) * N, L = (Math.min(e.end.getTime(), o.current.props.end.getTime()) - Math.max(e.start.getTime(), i.current.props.start.getTime())) * N;
53
53
  (Y || []).forEach((s) => {
54
54
  s.current && (s.current.props.dragHint ? f.push(s.current) : s.current.props.resizeHint ? H.push(s.current) : u.push(s.current));
55
55
  });
@@ -59,7 +59,7 @@ const Re = 1, we = r.forwardRef(
59
59
  n,
60
60
  e.ignoreIsAllDay
61
61
  ) : e.order || 0;
62
- let m = e.dragHint || e.resizeHint ? O(n, e.dragHint ? f : H) : O(n, u);
62
+ let m = e.dragHint || e.resizeHint ? k(n, e.dragHint ? f : H) : k(n, u);
63
63
  const re = te(n, u);
64
64
  let x = 0;
65
65
  const l = R(t);
@@ -75,7 +75,7 @@ const Re = 1, we = r.forwardRef(
75
75
  return;
76
76
  }
77
77
  const ie = 20;
78
- l.width = e.vertical ? l.width / m - d - ie / m : L + d, l.height = e.vertical ? L - d : (e.resizeHint || e.dragHint) && m <= 1 ? l.height : e.style && e.style.height ? e.style.height : 25, l.left = e.vertical ? l.left + h * l.width + d * h : l.left + (I < 0 ? 0 : I), l.top = e.vertical ? l.top + (I < 0 ? 0 : I) : l.top + x + d * h, k.current = m, B(t, l), ee(!0), E(!0);
78
+ l.width = e.vertical ? l.width / m - d - ie / m : L + d, l.height = e.vertical ? L - d : (e.resizeHint || e.dragHint) && m <= 1 ? l.height : e.style && e.style.height ? e.style.height : 25, l.left = e.vertical ? l.left + h * l.width + d * h : l.left + (I < 0 ? 0 : I), l.top = e.vertical ? l.top + (I < 0 ? 0 : I) : l.top + x + d * h, _.current = m, B(t, l), ee(!0), E(!0);
79
79
  }, V = r.useCallback(
80
80
  (n) => {
81
81
  const t = n && n[0], i = T.current;
@@ -106,7 +106,7 @@ const Re = 1, we = r.forwardRef(
106
106
  {
107
107
  ...U,
108
108
  _ref: c,
109
- _maxSiblingsPerSlot: k,
109
+ _maxSiblingsPerSlot: _,
110
110
  itemRef: c,
111
111
  style: {
112
112
  visibility: p ? void 0 : "hidden",
@@ -117,11 +117,11 @@ const Re = 1, we = r.forwardRef(
117
117
  !e.resizeHint && /* @__PURE__ */ r.createElement("span", { className: "k-event-actions" }, e.tail && /* @__PURE__ */ r.createElement(
118
118
  A,
119
119
  {
120
- name: _ === "rtl" ? "caret-alt-right" : "caret-alt-left",
121
- icon: _ === "rtl" ? ue : me
120
+ name: C === "rtl" ? "caret-alt-right" : "caret-alt-left",
121
+ icon: C === "rtl" ? ue : me
122
122
  }
123
123
  ), e.isRecurring && !e.isException && /* @__PURE__ */ r.createElement(A, { name: "reload", icon: de }), !e.isRecurring && e.isException && /* @__PURE__ */ r.createElement(A, { name: "non-recurrence", icon: fe })),
124
- !e.resizeHint && /* @__PURE__ */ r.createElement("div", { title: M }, !e.isAllDay && /* @__PURE__ */ r.createElement(G, { className: "k-event-template k-event-time " }, M), /* @__PURE__ */ r.createElement(G, { className: "k-event-template" }, e.title))
124
+ !e.resizeHint && /* @__PURE__ */ r.createElement("div", { title: O }, !e.isAllDay && /* @__PURE__ */ r.createElement(G, { className: "k-event-time" }, O), /* @__PURE__ */ r.createElement(G, null, e.title))
125
125
  );
126
126
  }
127
127
  ), ve = {
@@ -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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ne=require("react"),re=require("./SchedulerItem.js"),b=require("../utils/index.js"),S=require("../views/common/utils.js"),h=require("../constants/index.js"),ie=require("@progress/kendo-react-intl"),M=require("./SchedulerItemContent.js"),E=require("@progress/kendo-react-common"),v=require("@progress/kendo-svg-icons"),ce=require("../hooks/useRowSync.js"),le=require("../hooks/useEditable.js"),j=require("../context/SchedulerViewContext.js"),se=require("../context/SchedulerContext.js");function oe(e){const g=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const m in e)if(m!=="default"){const R=Object.getOwnPropertyDescriptor(e,m);Object.defineProperty(g,m,R.get?R:{enumerable:!0,get:()=>e[m]})}}return g.default=e,Object.freeze(g)}const n=oe(ne),ae=1,F=n.forwardRef((e,g)=>{const{item:m,_ref:R,itemRef:L,...G}=e,y=n.useRef(),c=n.useRef(null),A=n.useRef(null),q=n.useRef(null),K=le.useEditable(e.editable);n.useImperativeHandle(A,()=>({props:e,element:c.current&&c.current.element})),n.useImperativeHandle(g,()=>A.current),n.useImperativeHandle(R,()=>c.current),n.useImperativeHandle(L,()=>c.current);const J=m||$.item,D=ie.useInternationalization(),[Q]=j.useSchedulerViewItemsContext(),[P]=j.useSchedulerViewSlotsContext(),I=se.useSchedulerElementContext(),[U,H]=n.useState(!0),[X,Y]=n.useState(!1),T=n.useRef(0),k=E.useDir(I),C=n.useMemo(()=>e.isAllDay?D.toString(e.zonedStart,"t"):D.format("{0:t} - {1:t}",e.zonedStart,e.zonedEnd),[D,e.isAllDay,e.zonedEnd,e.zonedStart]),V=n.useMemo(()=>`(${C}): ${e.title}`,[C,e.title]),W=(r,t)=>{let l=1;return r.forEach(o=>{const u=t.filter(d=>w(o.current.props,d.props));u.length>l&&(l=u.length)}),l},Z=(r,t)=>r.map(o=>t.filter(u=>w(o.current.props,u.props))),w=(r,t)=>b.intersects(r.start,r.end,t.start,t.end)&&r.group.index===t.group.index&&r.range.index===t.range.index&&(e.ignoreIsAllDay||r.isAllDay===t.isAllDay),x=()=>{const r=(P||[]).filter(o=>o.current&&w(o.current.props,e));if(r.length===0){H(!1);return}const t=b.first(r);if(!t.current||!c.current)return;const l=S.getRect(t.current.element);S.setRect(c.current.element,l)},z=()=>{const r=c.current&&c.current.element;if(!r)return;const t=(P||[]).filter(s=>s.current&&w(s.current.props,e)),l=[],o=[],u=[];(Q||[]).forEach(s=>{s.current&&(s.current.props.dragHint?o.push(s.current):s.current.props.resizeHint?u.push(s.current):l.push(s.current))});const d=e.dragHint||e.resizeHint?b.calculateOrder(c.current,e.dragHint?o:u,t,e.ignoreIsAllDay):e.order||0;let f=e.dragHint||e.resizeHint?W(t,e.dragHint?o:u):W(t,l);const ee=Z(t,l);let O=0;const i=S.getRect(r);if(ee.forEach(s=>{let _=0;s.forEach(a=>{b.intersects(a.props.start,a.props.end,e.start,e.end)&&!(e.dragHint||e.resizeHint)&&a._maxSiblingsPerSlot&&a._maxSiblingsPerSlot>f&&a.element!==r&&(f=a._maxSiblingsPerSlot);const B=S.getRect(a.element);a.props.order!==null&&a.props.order<d&&(_=B.top+B.height-i.top-h.BORDER_WIDTH*d+ae)}),_>O&&(O=_)}),t.length===0){H(!1);return}const te=K.add?20:0;i.width=e.vertical?i.width/f-h.BORDER_WIDTH-te/f:i.width*t.length-h.BORDER_WIDTH,i.height=e.vertical?i.height*t.length-h.BORDER_WIDTH:(e.resizeHint||e.dragHint)&&f<=1?i.height:e.style&&e.style.height?e.style.height:25,i.left=e.vertical?i.left+d*i.width+h.BORDER_WIDTH*d:i.left,i.top=e.vertical?i.top:i.top+O+h.BORDER_WIDTH*d,T.current=f,S.setRect(r,i),Y(!0),H(!0)},N=n.useCallback(r=>{const t=r&&r[0],l=q.current;y.current!==void 0&&window.cancelAnimationFrame(y.current),l&&t&&(l.width!==t.contentRect.width||l.height!==t.contentRect.height)&&(y.current=window.requestAnimationFrame(()=>{x(),z()})),q.current={width:t.contentRect.width,height:t.contentRect.height}},[x,z]);n.useEffect(x),n.useEffect(z);const p=c.current&&c.current.element?c.current.element.closest(".k-scheduler-layout"):null;return ce.useRowSync({element:p,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:e.isLast}),n.useEffect(()=>{if(!I.current)return;const r=window.ResizeObserver,t=r&&new r(N);return t&&t.observe(I.current),()=>{t&&t.disconnect()}},[N,I]),n.createElement(J,{...G,_ref:c,_maxSiblingsPerSlot:T,itemRef:c,style:{visibility:X?void 0:"hidden",display:U?void 0:"none",...e.style}},!e.resizeHint&&n.createElement("span",{className:"k-event-actions"},e.tail&&n.createElement(E.IconWrap,{name:k==="rtl"?"caret-alt-right":"caret-alt-left",icon:k==="rtl"?v.caretAltRightIcon:v.caretAltLeftIcon}),e.isRecurring&&!e.isException&&n.createElement(E.IconWrap,{name:"arrow-rotate-cw",icon:v.arrowRotateCwIcon}),!e.isRecurring&&e.isException&&n.createElement(E.IconWrap,{name:"arrows-no-repeat",icon:v.arrowsNoRepeatIcon})),!e.resizeHint&&n.createElement("div",{title:V},!e.isAllDay&&n.createElement(M.SchedulerItemContent,{className:"k-event-template k-event-time "},V),n.createElement(M.SchedulerItemContent,{className:"k-event-template"},e.title)))}),$={item:re.SchedulerItem};F.displayName="KendoReactSchedulerViewItem";exports.SchedulerViewItem=F;exports.schedulerViewItemDefaultProps=$;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ne=require("react"),re=require("./SchedulerItem.js"),b=require("../utils/index.js"),S=require("../views/common/utils.js"),h=require("../constants/index.js"),ie=require("@progress/kendo-react-intl"),N=require("./SchedulerItemContent.js"),E=require("@progress/kendo-react-common"),y=require("@progress/kendo-svg-icons"),ce=require("../hooks/useRowSync.js"),le=require("../hooks/useEditable.js"),j=require("../context/SchedulerViewContext.js"),se=require("../context/SchedulerContext.js");function oe(e){const g=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const m in e)if(m!=="default"){const R=Object.getOwnPropertyDescriptor(e,m);Object.defineProperty(g,m,R.get?R:{enumerable:!0,get:()=>e[m]})}}return g.default=e,Object.freeze(g)}const n=oe(ne),ae=1,F=n.forwardRef((e,g)=>{const{item:m,_ref:R,itemRef:L,...G}=e,v=n.useRef(),c=n.useRef(null),A=n.useRef(null),q=n.useRef(null),K=le.useEditable(e.editable);n.useImperativeHandle(A,()=>({props:e,element:c.current&&c.current.element})),n.useImperativeHandle(g,()=>A.current),n.useImperativeHandle(R,()=>c.current),n.useImperativeHandle(L,()=>c.current);const J=m||$.item,D=ie.useInternationalization(),[Q]=j.useSchedulerViewItemsContext(),[P]=j.useSchedulerViewSlotsContext(),I=se.useSchedulerElementContext(),[U,H]=n.useState(!0),[X,Y]=n.useState(!1),T=n.useRef(0),C=E.useDir(I),k=n.useMemo(()=>e.isAllDay?D.toString(e.zonedStart,"t"):D.format("{0:t} - {1:t}",e.zonedStart,e.zonedEnd),[D,e.isAllDay,e.zonedEnd,e.zonedStart]),V=n.useMemo(()=>`(${k}): ${e.title}`,[k,e.title]),W=(r,t)=>{let l=1;return r.forEach(o=>{const u=t.filter(d=>w(o.current.props,d.props));u.length>l&&(l=u.length)}),l},Z=(r,t)=>r.map(o=>t.filter(u=>w(o.current.props,u.props))),w=(r,t)=>b.intersects(r.start,r.end,t.start,t.end)&&r.group.index===t.group.index&&r.range.index===t.range.index&&(e.ignoreIsAllDay||r.isAllDay===t.isAllDay),x=()=>{const r=(P||[]).filter(o=>o.current&&w(o.current.props,e));if(r.length===0){H(!1);return}const t=b.first(r);if(!t.current||!c.current)return;const l=S.getRect(t.current.element);S.setRect(c.current.element,l)},z=()=>{const r=c.current&&c.current.element;if(!r)return;const t=(P||[]).filter(s=>s.current&&w(s.current.props,e)),l=[],o=[],u=[];(Q||[]).forEach(s=>{s.current&&(s.current.props.dragHint?o.push(s.current):s.current.props.resizeHint?u.push(s.current):l.push(s.current))});const d=e.dragHint||e.resizeHint?b.calculateOrder(c.current,e.dragHint?o:u,t,e.ignoreIsAllDay):e.order||0;let f=e.dragHint||e.resizeHint?W(t,e.dragHint?o:u):W(t,l);const ee=Z(t,l);let O=0;const i=S.getRect(r);if(ee.forEach(s=>{let _=0;s.forEach(a=>{b.intersects(a.props.start,a.props.end,e.start,e.end)&&!(e.dragHint||e.resizeHint)&&a._maxSiblingsPerSlot&&a._maxSiblingsPerSlot>f&&a.element!==r&&(f=a._maxSiblingsPerSlot);const M=S.getRect(a.element);a.props.order!==null&&a.props.order<d&&(_=M.top+M.height-i.top-h.BORDER_WIDTH*d+ae)}),_>O&&(O=_)}),t.length===0){H(!1);return}const te=K.add?20:0;i.width=e.vertical?i.width/f-h.BORDER_WIDTH-te/f:i.width*t.length-h.BORDER_WIDTH,i.height=e.vertical?i.height*t.length-h.BORDER_WIDTH:(e.resizeHint||e.dragHint)&&f<=1?i.height:e.style&&e.style.height?e.style.height:25,i.left=e.vertical?i.left+d*i.width+h.BORDER_WIDTH*d:i.left,i.top=e.vertical?i.top:i.top+O+h.BORDER_WIDTH*d,T.current=f,S.setRect(r,i),Y(!0),H(!0)},B=n.useCallback(r=>{const t=r&&r[0],l=q.current;v.current!==void 0&&window.cancelAnimationFrame(v.current),l&&t&&(l.width!==t.contentRect.width||l.height!==t.contentRect.height)&&(v.current=window.requestAnimationFrame(()=>{x(),z()})),q.current={width:t.contentRect.width,height:t.contentRect.height}},[x,z]);n.useEffect(x),n.useEffect(z);const p=c.current&&c.current.element?c.current.element.closest(".k-scheduler-layout"):null;return ce.useRowSync({element:p,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:e.isLast}),n.useEffect(()=>{if(!I.current)return;const r=window.ResizeObserver,t=r&&new r(B);return t&&t.observe(I.current),()=>{t&&t.disconnect()}},[B,I]),n.createElement(J,{...G,_ref:c,_maxSiblingsPerSlot:T,itemRef:c,style:{visibility:X?void 0:"hidden",display:U?void 0:"none",...e.style}},!e.resizeHint&&n.createElement("span",{className:"k-event-actions"},e.tail&&n.createElement(E.IconWrap,{name:C==="rtl"?"caret-alt-right":"caret-alt-left",icon:C==="rtl"?y.caretAltRightIcon:y.caretAltLeftIcon}),e.isRecurring&&!e.isException&&n.createElement(E.IconWrap,{name:"arrow-rotate-cw",icon:y.arrowRotateCwIcon}),!e.isRecurring&&e.isException&&n.createElement(E.IconWrap,{name:"arrows-no-repeat",icon:y.arrowsNoRepeatIcon})),!e.resizeHint&&n.createElement("div",{title:V},!e.isAllDay&&n.createElement(N.SchedulerItemContent,{className:"k-event-time"},V),n.createElement(N.SchedulerItemContent,null,e.title)))}),$={item:re.SchedulerItem};F.displayName="KendoReactSchedulerViewItem";exports.SchedulerViewItem=F;exports.schedulerViewItemDefaultProps=$;
@@ -8,8 +8,8 @@
8
8
  "use client";
9
9
  import * as n from "react";
10
10
  import { SchedulerItem as p } from "./SchedulerItem.mjs";
11
- import { first as ee, calculateOrder as te, intersects as T } from "../utils/index.mjs";
12
- import { getRect as y, setRect as V } from "../views/common/utils.mjs";
11
+ import { first as ee, calculateOrder as te, intersects as V } from "../utils/index.mjs";
12
+ import { getRect as y, setRect as N } from "../views/common/utils.mjs";
13
13
  import { BORDER_WIDTH as f } from "../constants/index.mjs";
14
14
  import { useInternationalization as ne } from "@progress/kendo-react-intl";
15
15
  import { SchedulerItemContent as F } from "./SchedulerItemContent.mjs";
@@ -17,22 +17,22 @@ import { useDir as re, IconWrap as H } from "@progress/kendo-react-common";
17
17
  import { caretAltRightIcon as ie, caretAltLeftIcon as le, arrowRotateCwIcon as ce, arrowsNoRepeatIcon as se } from "@progress/kendo-svg-icons";
18
18
  import { useRowSync as oe } from "../hooks/useRowSync.mjs";
19
19
  import { useEditable as ae } from "../hooks/useEditable.mjs";
20
- import { useSchedulerViewItemsContext as me, useSchedulerViewSlotsContext as ue } from "../context/SchedulerViewContext.mjs";
20
+ import { useSchedulerViewItemsContext as ue, useSchedulerViewSlotsContext as me } from "../context/SchedulerViewContext.mjs";
21
21
  import { useSchedulerElementContext as de } from "../context/SchedulerContext.mjs";
22
22
  const fe = 1, he = n.forwardRef(
23
23
  (e, M) => {
24
24
  const { item: L, _ref: W, itemRef: $, ...q } = e, S = n.useRef(), l = n.useRef(null), z = n.useRef(null), x = n.useRef(null), B = ae(e.editable);
25
25
  n.useImperativeHandle(z, () => ({ props: e, element: l.current && l.current.element })), n.useImperativeHandle(M, () => z.current), n.useImperativeHandle(W, () => l.current), n.useImperativeHandle($, () => l.current);
26
- const G = L || ge.item, w = ne(), [K] = me(), [A] = ue(), h = de(), [j, I] = n.useState(!0), [J, Q] = n.useState(!1), D = n.useRef(0), P = re(h), k = n.useMemo(
26
+ const G = L || ge.item, w = ne(), [K] = ue(), [A] = me(), h = de(), [j, I] = n.useState(!0), [J, Q] = n.useState(!1), D = n.useRef(0), P = re(h), _ = n.useMemo(
27
27
  () => e.isAllDay ? w.toString(e.zonedStart, "t") : w.format("{0:t} - {1:t}", e.zonedStart, e.zonedEnd),
28
28
  [w, e.isAllDay, e.zonedEnd, e.zonedStart]
29
- ), _ = n.useMemo(() => `(${k}): ${e.title}`, [k, e.title]), C = (r, t) => {
29
+ ), C = n.useMemo(() => `(${_}): ${e.title}`, [_, e.title]), O = (r, t) => {
30
30
  let c = 1;
31
31
  return r.forEach((o) => {
32
- const m = t.filter((u) => g(o.current.props, u.props));
33
- m.length > c && (c = m.length);
32
+ const u = t.filter((m) => g(o.current.props, m.props));
33
+ u.length > c && (c = u.length);
34
34
  }), c;
35
- }, U = (r, t) => r.map((o) => t.filter((m) => g(o.current.props, m.props))), g = (r, t) => T(r.start, r.end, t.start, t.end) && r.group.index === t.group.index && r.range.index === t.range.index && (e.ignoreIsAllDay || r.isAllDay === t.isAllDay), R = () => {
35
+ }, U = (r, t) => r.map((o) => t.filter((u) => g(o.current.props, u.props))), g = (r, t) => V(r.start, r.end, t.start, t.end) && r.group.index === t.group.index && r.range.index === t.range.index && (e.ignoreIsAllDay || r.isAllDay === t.isAllDay), R = () => {
36
36
  const r = (A || []).filter((o) => o.current && g(o.current.props, e));
37
37
  if (r.length === 0) {
38
38
  I(!1);
@@ -42,48 +42,48 @@ const fe = 1, he = n.forwardRef(
42
42
  if (!t.current || !l.current)
43
43
  return;
44
44
  const c = y(t.current.element);
45
- V(l.current.element, c);
46
- }, v = () => {
45
+ N(l.current.element, c);
46
+ }, E = () => {
47
47
  const r = l.current && l.current.element;
48
48
  if (!r)
49
49
  return;
50
- const t = (A || []).filter((s) => s.current && g(s.current.props, e)), c = [], o = [], m = [];
50
+ const t = (A || []).filter((s) => s.current && g(s.current.props, e)), c = [], o = [], u = [];
51
51
  (K || []).forEach((s) => {
52
- s.current && (s.current.props.dragHint ? o.push(s.current) : s.current.props.resizeHint ? m.push(s.current) : c.push(s.current));
52
+ s.current && (s.current.props.dragHint ? o.push(s.current) : s.current.props.resizeHint ? u.push(s.current) : c.push(s.current));
53
53
  });
54
- const u = e.dragHint || e.resizeHint ? te(
54
+ const m = e.dragHint || e.resizeHint ? te(
55
55
  l.current,
56
- e.dragHint ? o : m,
56
+ e.dragHint ? o : u,
57
57
  t,
58
58
  e.ignoreIsAllDay
59
59
  ) : e.order || 0;
60
- let d = e.dragHint || e.resizeHint ? C(t, e.dragHint ? o : m) : C(t, c);
60
+ let d = e.dragHint || e.resizeHint ? O(t, e.dragHint ? o : u) : O(t, c);
61
61
  const Y = U(t, c);
62
- let E = 0;
62
+ let b = 0;
63
63
  const i = y(r);
64
64
  if (Y.forEach((s) => {
65
- let b = 0;
65
+ let v = 0;
66
66
  s.forEach((a) => {
67
- T(a.props.start, a.props.end, e.start, e.end) && !(e.dragHint || e.resizeHint) && a._maxSiblingsPerSlot && a._maxSiblingsPerSlot > d && a.element !== r && (d = a._maxSiblingsPerSlot);
68
- const N = y(a.element);
69
- a.props.order !== null && a.props.order < u && (b = N.top + N.height - i.top - f * u + fe);
70
- }), b > E && (E = b);
67
+ V(a.props.start, a.props.end, e.start, e.end) && !(e.dragHint || e.resizeHint) && a._maxSiblingsPerSlot && a._maxSiblingsPerSlot > d && a.element !== r && (d = a._maxSiblingsPerSlot);
68
+ const T = y(a.element);
69
+ a.props.order !== null && a.props.order < m && (v = T.top + T.height - i.top - f * m + fe);
70
+ }), v > b && (b = v);
71
71
  }), t.length === 0) {
72
72
  I(!1);
73
73
  return;
74
74
  }
75
75
  const Z = B.add ? 20 : 0;
76
- i.width = e.vertical ? i.width / d - f - Z / d : i.width * t.length - f, i.height = e.vertical ? i.height * t.length - f : (e.resizeHint || e.dragHint) && d <= 1 ? i.height : e.style && e.style.height ? e.style.height : 25, i.left = e.vertical ? i.left + u * i.width + f * u : i.left, i.top = e.vertical ? i.top : i.top + E + f * u, D.current = d, V(r, i), Q(!0), I(!0);
77
- }, O = n.useCallback(
76
+ i.width = e.vertical ? i.width / d - f - Z / d : i.width * t.length - f, i.height = e.vertical ? i.height * t.length - f : (e.resizeHint || e.dragHint) && d <= 1 ? i.height : e.style && e.style.height ? e.style.height : 25, i.left = e.vertical ? i.left + m * i.width + f * m : i.left, i.top = e.vertical ? i.top : i.top + b + f * m, D.current = d, N(r, i), Q(!0), I(!0);
77
+ }, k = n.useCallback(
78
78
  (r) => {
79
79
  const t = r && r[0], c = x.current;
80
80
  S.current !== void 0 && window.cancelAnimationFrame(S.current), c && t && (c.width !== t.contentRect.width || c.height !== t.contentRect.height) && (S.current = window.requestAnimationFrame(() => {
81
- R(), v();
81
+ R(), E();
82
82
  })), x.current = { width: t.contentRect.width, height: t.contentRect.height };
83
83
  },
84
- [R, v]
84
+ [R, E]
85
85
  );
86
- n.useEffect(R), n.useEffect(v);
86
+ n.useEffect(R), n.useEffect(E);
87
87
  const X = l.current && l.current.element ? l.current.element.closest(".k-scheduler-layout") : null;
88
88
  return oe({
89
89
  element: X,
@@ -95,11 +95,11 @@ const fe = 1, he = n.forwardRef(
95
95
  }), n.useEffect(() => {
96
96
  if (!h.current)
97
97
  return;
98
- const r = window.ResizeObserver, t = r && new r(O);
98
+ const r = window.ResizeObserver, t = r && new r(k);
99
99
  return t && t.observe(h.current), () => {
100
100
  t && t.disconnect();
101
101
  };
102
- }, [O, h]), /* @__PURE__ */ n.createElement(
102
+ }, [k, h]), /* @__PURE__ */ n.createElement(
103
103
  G,
104
104
  {
105
105
  ...q,
@@ -119,7 +119,7 @@ const fe = 1, he = n.forwardRef(
119
119
  icon: P === "rtl" ? ie : le
120
120
  }
121
121
  ), e.isRecurring && !e.isException && /* @__PURE__ */ n.createElement(H, { name: "arrow-rotate-cw", icon: ce }), !e.isRecurring && e.isException && /* @__PURE__ */ n.createElement(H, { name: "arrows-no-repeat", icon: se })),
122
- !e.resizeHint && /* @__PURE__ */ n.createElement("div", { title: _ }, !e.isAllDay && /* @__PURE__ */ n.createElement(F, { className: "k-event-template k-event-time " }, _), /* @__PURE__ */ n.createElement(F, { className: "k-event-template" }, e.title))
122
+ !e.resizeHint && /* @__PURE__ */ n.createElement("div", { title: C }, !e.isAllDay && /* @__PURE__ */ n.createElement(F, { className: "k-event-time" }, C), /* @__PURE__ */ n.createElement(F, null, e.title))
123
123
  );
124
124
  }
125
125
  ), ge = {
@@ -10,7 +10,7 @@ const e = {
10
10
  name: "@progress/kendo-react-scheduler",
11
11
  productName: "KendoReact",
12
12
  productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
13
- publishDate: 1732012642,
13
+ publishDate: 1732179190,
14
14
  version: "",
15
15
  licensingDocsUrl: "https://www.telerik.com/kendo-react-ui"
16
16
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-scheduler",
3
- "version": "9.1.0-develop.4",
3
+ "version": "9.1.0-develop.6",
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",
@@ -26,15 +26,15 @@
26
26
  "@progress/kendo-date-math": "^1.4.1",
27
27
  "@progress/kendo-drawing": "^1.21.1",
28
28
  "@progress/kendo-licensing": "^1.3.4",
29
- "@progress/kendo-react-buttons": "9.1.0-develop.4",
30
- "@progress/kendo-react-common": "9.1.0-develop.4",
31
- "@progress/kendo-react-dateinputs": "9.1.0-develop.4",
32
- "@progress/kendo-react-dialogs": "9.1.0-develop.4",
33
- "@progress/kendo-react-dropdowns": "9.1.0-develop.4",
34
- "@progress/kendo-react-form": "9.1.0-develop.4",
35
- "@progress/kendo-react-inputs": "9.1.0-develop.4",
36
- "@progress/kendo-react-intl": "9.1.0-develop.4",
37
- "@progress/kendo-react-popup": "9.1.0-develop.4",
29
+ "@progress/kendo-react-buttons": "9.1.0-develop.6",
30
+ "@progress/kendo-react-common": "9.1.0-develop.6",
31
+ "@progress/kendo-react-dateinputs": "9.1.0-develop.6",
32
+ "@progress/kendo-react-dialogs": "9.1.0-develop.6",
33
+ "@progress/kendo-react-dropdowns": "9.1.0-develop.6",
34
+ "@progress/kendo-react-form": "9.1.0-develop.6",
35
+ "@progress/kendo-react-inputs": "9.1.0-develop.6",
36
+ "@progress/kendo-react-intl": "9.1.0-develop.6",
37
+ "@progress/kendo-react-popup": "9.1.0-develop.6",
38
38
  "@progress/kendo-svg-icons": "^4.0.0",
39
39
  "react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
40
40
  "react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"