@progress/kendo-react-dateinputs 7.0.0-develop.11 → 7.0.0-develop.13

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.
@@ -2,20 +2,20 @@
2
2
  * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the package root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
- (function(g,Mt){typeof exports=="object"&&typeof module<"u"?Mt(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-date-math"),require("@progress/kendo-react-intl"),require("@progress/kendo-react-buttons"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-labels"),require("@progress/kendo-react-popup"),require("@progress/kendo-react-layout")):typeof define=="function"&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-date-math","@progress/kendo-react-intl","@progress/kendo-react-buttons","@progress/kendo-svg-icons","@progress/kendo-react-labels","@progress/kendo-react-popup","@progress/kendo-react-layout"],Mt):(g=typeof globalThis<"u"?globalThis:g||self,Mt(g.KendoReactDateinputs={},g.React,g.PropTypes,g.KendoReactCommon,g.KendoDateMath,g.KendoReactIntl,g.KendoReactButtons,g.KendoSvgIcons,g.KendoReactLabels,g.KendoReactPopup,g.KendoReactLayout))})(this,function(g,Mt,Ki,d,l,x,F,X,Ue,qt,ht){"use strict";function Ye(i){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const e in i)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(t,e,s.get?s:{enumerable:!0,get:()=>i[e]})}}return t.default=i,Object.freeze(t)}const o=Ye(Mt),n=Ye(Ki),gt={name:"@progress/kendo-react-dateinputs",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:1617189075,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"},ji=(i,t,e)=>[...i.slice(0,t+1),...i.slice(t+1).map(s=>s+e)];class Zi{constructor(t=0,e,s){this.total=t,this.rowHeight=e,this.detailRowHeight=s,this.offsets=[],this.heights=[];let a=0;for(let r=0;r<t;r++)this.offsets.push(a),a+=e,this.heights.push(e)}height(t){return this.heights[t]}expandDetail(t){this.height(t)===this.rowHeight&&this.updateRowHeight(t,this.detailRowHeight)}collapseDetail(t){this.height(t)>this.rowHeight&&this.updateRowHeight(t,this.detailRowHeight*-1)}index(t){for(let e=0;e<this.offsets.length;e++){if(t===this.offsets[e])return e;if(t<this.offsets[e])return e-1}return this.total-1}offset(t){return this.offsets[t]}totalHeight(){return this.heights.reduce((t,e)=>t+e,0)}updateRowHeight(t,e){this.heights[t]+=e,this.offsets=ji(this.offsets,t,e)}}const Rt=i=>Math.max(i,0);class re{constructor(t){this.offset=t}}class oe{constructor(t){this.skip=t}}class Gi{constructor(t,e){this.onScrollAction=t,this.onPageAction=e,this.direction="vertical",this.firstLoaded=0,this.lastLoaded=0,this.lastScrollTop=0,this.take=0,this.total=0,this.rowHeightService=null,this.bottomOffset=0,this.topOffset=0}create(t,e,s,a,r=0,h=0,u="vertical"){this.rowHeightService=t,this.firstLoaded=e,this.lastLoaded=e+s,this.take=s,this.total=a,this.lastScrollTop=0,this.topOffset=r,this.bottomOffset=h,this.direction=u;const c=this.rowsForHeight(r),p=Rt(e-c);this.onScrollAction(new re(this.rowOffset(p))),this.onPageAction(new oe(p))}onScroll({scrollLeft:t,scrollTop:e,offsetHeight:s,offsetWidth:a}){const r=this.direction==="vertical"?e:t,h=this.direction==="vertical"?s:a;if(this.lastScrollTop===r||!this.rowHeightService)return;const u=this.lastScrollTop>=r;this.lastScrollTop=r;const c=this.rowHeightService.index(Rt(r-this.topOffset)),p=this.rowHeightService.index(Rt(r+h-this.bottomOffset));if(!u&&p>=this.lastLoaded&&this.lastLoaded<this.total&&(this.firstLoaded=c,this.onScrollAction(new re(this.rowOffset(c))),this.lastLoaded=Math.min(this.firstLoaded+this.take,this.total),this.onPageAction(new oe(this.firstLoaded))),u&&c<=this.firstLoaded){const m=Math.floor(this.take*.3);this.firstLoaded=Rt(c-m),this.onScrollAction(new re(this.rowOffset(this.firstLoaded))),this.lastLoaded=Math.min(this.firstLoaded+this.take,this.total),this.onPageAction(new oe(this.firstLoaded))}}rowOffset(t){return this.rowHeightService?this.rowHeightService.offset(t)+this.topOffset:0}rowsForHeight(t){return this.rowHeightService?Math.ceil(t/this.rowHeightService.height(0)):0}}const Xi=(i,t,e)=>Math.min(Math.abs(t-i),e),Ji=17,Qi=10,ts={[1]:i=>t=>t+i,[0]:i=>t=>t-i},es={[1]:i=>t=>Math.min(t,i),[0]:i=>t=>Math.max(t,i)},is={[1]:i=>t=>t<i,[0]:i=>t=>t>i},Wt=class extends o.Component{constructor(i){super(i),this.rowHeightService=null,this.scrollContainer=null,this.lastDirection=null,this.lastTotal=0,this.lastTake=0,this.animationInProgress=!1,this.restrictScroll=!1,this.scrollTo=t=>{const e=this.direction==="vertical"?"scrollTop":"scrollLeft";if(!this.scrollContainer)return;const s=this.scrollContainer[e];this.restrictScroll&&e==="scrollTop"&&(!Number.isInteger(s)||!Number.isInteger(t))&&Math.abs(s-t)<Qi||(this.scrollContainer[e]=t)},this.scrollToIndex=t=>{this.animationInProgress=!1,this.rowHeightService&&this.scrollTo(this.rowHeightService.offset(t))},this.animateToIndex=t=>{if(!this.rowHeightService||!window)return;window.cancelAnimationFrame(this.cancelAnimation);const e=this.rowHeightService.offset(t),s=this.getContainerScrollDirection(e);let{start:a,end:r}=this.scrollRange(e,s);if(a===r)return;const h=this.scrollStep(a,r),u=ts[s](h),c=es[s](r),p=is[s](u(r)),m=f=>{this.animationInProgress=!0;const v=u(f);this.scrollTo(c(v)),p(v)?this.cancelAnimation=window.requestAnimationFrame(()=>{m(v)}):this.animationInProgress=!1};this.cancelAnimation=window.requestAnimationFrame(()=>{m(a)})},this.scrollToBottom=()=>{this.rowHeightService&&this.scrollTo(this.rowHeightService.totalHeight()+this.props.bottomOffset)},this.scrollStep=(t,e)=>{const s=this.props.scrollDuration||Wt.defaultProps.scrollDuration;return Math.abs(e-t)/(s/Ji)},this.scrollRange=(t,e)=>{const s=this.containerScrollPosition;if(parseInt(`${t}`,10)===parseInt(`${s}`,10))return{start:t,end:t};const a=this.containerMaxScroll(),r=e===0?1:-1,h=Xi(s,t,this.props.maxScrollDifference||0),u=Math.min(t,a);return{start:Math.min(Math.max(u+r*h,0),a),end:u}},this.containerMaxScroll=()=>this.containerScrollSize-this.containerOffsetSize,this.getContainerScrollDirection=t=>t<this.containerScrollPosition?0:1,this.initServices=(t=this.props)=>{const e=this.direction==="vertical"?t.itemHeight:t.itemWidth;e!==void 0&&(this.rowHeightService=new Zi(t.total,e,0),this.scrollerService.create(this.rowHeightService,t.skip,t.take,t.total,t.topOffset,this.scrollOffsetSize,this.direction))},this.getContainerProperty=t=>this.scrollContainer?this.scrollContainer[t]:0,this.handleScroll=t=>{if(!this.scrollContainer||!this.rowHeightService)return;const e=t.target;this.scrollerService.onScroll({scrollLeft:e.scrollLeft,scrollTop:e.scrollTop,offsetHeight:e.offsetHeight,offsetWidth:e.offsetWidth});const s=this.rowHeightService.index(this.containerScrollPosition-this.props.topOffset),{onScrollAction:a}=this.props,r={index:s,target:e,scrollAction:this.scrollAction,pageAction:this.pageAction,animationInProgress:this.animationInProgress};this.props.onScroll&&this.props.onScroll.call(void 0,t),a&&a.call(void 0,r),this.scrollAction=void 0,this.pageAction=void 0},this.handleScrollAction=t=>{this.scrollAction=t},this.handlePageAction=t=>{this.pageAction=t},this.scrollerService=new Gi(this.handleScrollAction,this.handlePageAction),this.restrictScroll=Number.parseFloat(o.version)>17}get element(){return this.scrollContainer}get containerOffsetSize(){return this.getContainerProperty(this.direction==="vertical"?"offsetHeight":"offsetWidth")}get containerScrollSize(){return this.getContainerProperty(this.direction==="vertical"?"scrollHeight":"scrollWidth")}get containerScrollPosition(){return this.getContainerProperty(this.direction==="vertical"?"scrollTop":"scrollLeft")}get direction(){return this.props.direction!==void 0?this.props.direction:Wt.defaultProps.direction}get scrollOffsetSize(){return this.props.scrollOffsetSize!==void 0?this.props.scrollOffsetSize:Wt.defaultProps.scrollOffsetSize}activeIndex(){return this.itemIndex(Math.ceil(this.containerScrollPosition))}itemIndex(i){return this.rowHeightService?this.rowHeightService.index(i):0}itemOffset(i){return this.rowHeightService?this.rowHeightService.offset(i):0}isIndexVisible(i){if(!this.rowHeightService)return!1;const t=this.containerScrollPosition,e=t+this.containerOffsetSize,s=this.rowHeightService.offset(i),a=s+this.rowHeightService.height(i);return s>=t&&a<=e}isListScrolled(i){return this.rowHeightService?this.containerScrollPosition!==this.rowHeightService.offset(i):!1}componentDidMount(){const{onMount:i}=this.props;i&&i.call(void 0,this)}render(){(this.lastTotal!==this.props.total||this.lastDirection!==this.direction||this.lastTake!==this.props.take)&&(this.initServices(),this.lastTotal=this.props.total,this.lastDirection=this.direction,this.lastTake=this.props.take);const i=`${(this.rowHeightService?this.rowHeightService.totalHeight():0)+this.props.bottomOffset}`,t=this.direction==="vertical"?{height:`${i}px`}:{width:`${i}px`},e=d.classNames("k-content k-scrollable",{"k-scrollable-horizontal":this.direction==="horizontal"},this.props.className),s=d.classNames("k-scrollable-placeholder",{"k-scrollable-horizontal-placeholder":this.direction==="horizontal"});return o.createElement("div",{ref:a=>{this.scrollContainer=a},onScroll:this.handleScroll,className:e,tabIndex:this.props.tabIndex,role:this.props.role},this.props.children,o.createElement("div",{style:t,className:s}))}};let ft=Wt;ft.propTypes={bottomOffset:n.number.isRequired,className:n.string,direction:n.oneOf(["horizontal","vertical"]),forceScroll:n.bool,itemHeight:n.number,itemWidth:n.number,maxScrollDifference:n.number,onScroll:n.func,onScrollAction:n.func,scrollDuration:n.number,scrollOffsetSize:n.number,skip:n.number.isRequired,tabIndex:n.number,take:n.number.isRequired,topOffset:n.number.isRequired,total:n.number.isRequired,role:n.string},ft.defaultProps={direction:"vertical",forceScroll:!1,scrollOffsetSize:0,maxScrollDifference:100,scrollDuration:100};const ss=(i,t)=>{const e=Object.getOwnPropertyNames(i),s=Object.getOwnPropertyNames(t);if(e.length!==s.length)return!1;for(let a=0;a<e.length;a++){const r=e[a];if(i[r]!==t[r])return!1}return!0};class $e extends o.Component{constructor(){super(...arguments),this.handleClick=t=>{const{onClick:e,value:s}=this.props;e&&e.call(void 0,s,t)},this.handleMouseEnter=()=>{const{onMouseEnter:t,value:e}=this.props;t&&t.call(void 0,e)},this.handleMouseLeave=()=>{const{onMouseLeave:t,value:e}=this.props;t&&t.call(void 0,e)}}shouldComponentUpdate(t){const{value:e,...s}=this.props,{value:a,...r}=t;return!((!(e&&a)||e.getTime()===a.getTime())&&ss(s,r))}render(){const{className:t,formattedValue:e,isWeekend:s,isFocused:a,isInRange:r,isSelected:h,isRangeStart:u,isRangeMid:c,isRangeEnd:p,isRangeSplitStart:m,isRangeSplitEnd:f,isToday:v,isDisabled:w,view:T,value:E,...O}=this.props,y=this.props.activeRangeEnd==="end"&&p,P=this.props.activeRangeEnd==="start"&&u,b=d.classNames("k-calendar-td",{"k-range-end":p,"k-range-mid":c,"k-range-split-end":f,"k-range-split-start":m,"k-range-start":u,"k-active":P||y,"k-state-pending-focus":a,"k-selected":h||u||p,"k-today":v,"k-weekend":s,"k-disabled":w},t);return o.createElement("td",{...O,className:b,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},o.createElement("span",{className:"k-link"},this.props.children))}}class Ke extends o.Component{render(){const{className:t,firstDate:e,...s}=this.props;return o.createElement("td",{className:d.classNames("k-calendar-td",t),...s},this.props.children)}}var S=(i=>(i[i.Left=0]="Left",i[i.Right=1]="Right",i[i.Up=2]="Up",i[i.Down=3]="Down",i[i.PrevView=4]="PrevView",i[i.NextView=5]="NextView",i[i.FirstInView=6]="FirstInView",i[i.LastInView=7]="LastInView",i[i.LowerView=8]="LowerView",i[i.UpperView=9]="UpperView",i))(S||{}),I=(i=>(i[i.month=0]="month",i[i.year=1]="year",i[i.decade=2]="decade",i[i.century=3]="century",i))(I||{});const H={start:null,end:null};function et(i){const t=(s,a,r,...h)=>a[r]===null?null:(s?i.isRequired:i)(a,r,...h),e=t.bind(null,!1);return e.isRequired=t.bind(null,!0),e}const Ut=(i,t,e)=>t===void 0||e===void 0||t<=i&&i<=e?i:i<t?t:e,A=new Date(1980,0,1),it=new Date(1900,0,1),st=new Date(2099,11,31),ct=new Date(1980,0,1),nt=new Date(1980,0,1,23,59,59),B=(i,t)=>{const e=l.cloneDate(i);return e.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),e},z=()=>l.getDate(new Date),_=(i,t,e)=>!i||!(t&&t>i||e&&e<i),je=(i,t,e)=>i===null||!(t&&l.getDate(t)>l.getDate(i)||e&&l.getDate(e)<l.getDate(i)),Yt=(i,t)=>{const{start:e,end:s}=t||H;return!e||!s?!1:e<i&&i<s},$=(i,t,e=1)=>{const s=[];for(let a=i;a<t;a=a+e)s.push(a);return s},Ze=(i,t,e)=>t.getTime()<=i.getTime()&&i.getTime()<=e.getTime(),Ge=(i,t)=>i.slice(t).concat(i.slice(0,t)),U=(i,t,e)=>i&&(t&&i<t?l.cloneDate(t):e&&i>e?l.cloneDate(e):i),Y=i=>(t,e="",s={})=>{const a=document.createElement(i);return a.className=e,Object.keys(s).map(r=>a.style[r]=s[r]),typeof t=="string"?a.innerHTML=t||"":(t||[]).forEach(r=>r&&a.appendChild(r)),a};function ns(i,t,e={}){let s,a;e.maxWait;let r,h,u;const c=window;let p=!1,m=!1;const f=!t&&t!==0&&typeof c.requestAnimationFrame=="function";if(typeof i!="function")throw new TypeError("Expected a function");t=+t||0;function v(C){const N=s,tt=a;return s=a=void 0,r=i.apply(tt,N),r}function w(C,N){return f?(c.cancelAnimationFrame(h),c.requestAnimationFrame(C)):setTimeout(C,N)}function T(C){if(f)return c.cancelAnimationFrame(C);clearTimeout(C)}function E(C){return h=w(P,t),p?v():r}function O(C){const N=C-u;return t-N}function y(C){const N=C-u;return u===void 0||N>=t||N<0||m}function P(){const C=Date.now();if(y(C))return b();h=w(P,O(C))}function b(C){return h=void 0,s?v():(s=a=void 0,r)}function R(){h!==void 0&&T(h),s=u=a=h=void 0}function k(){return h===void 0?r:b()}function M(){return h!==void 0}function W(...C){const N=Date.now(),tt=y(N);return s=C,a=this,u=N,tt&&h===void 0?E():(h===void 0&&(h=w(P,t)),r)}return W.cancel=R,W.flush=k,W.pending=M,W}const as=[[]],le=4,rs=3,os={[S.Left]:i=>l.addDecades(i,-1),[S.Up]:i=>l.addDecades(i,-5),[S.Right]:i=>l.addDecades(i,1),[S.Down]:i=>l.addDecades(i,5),[S.PrevView]:i=>l.addCenturies(i,-1),[S.NextView]:i=>l.addCenturies(i,1),[S.FirstInView]:i=>l.firstDecadeOfCentury(i),[S.LastInView]:i=>l.lastDecadeOfCentury(i)};class Xe{addToDate(t,e){return l.addCenturies(t,e)}datesList(t,e){return $(0,e).map(s=>l.addCenturies(t,s))}data(t){const{cellUID:e,focusedDate:s,isActiveView:a,max:r,min:h,selectedDate:u,selectionRange:c=H,viewDate:p}=t;if(!p)return as;const m=$(0,le),f=l.firstDecadeOfCentury(p),v=l.lastDecadeOfCentury(p),w=z();return $(0,rs).map(T=>{const E=l.addDecades(f,T*le);return m.map(O=>{const y=this.normalize(l.addDecades(E,O),h,r),P=this.isEqual(y,c.start),b=this.isEqual(y,c.end),k=!P&&!b&&Yt(y,c),M=a&&(Array.isArray(u)?this.isSelectedFromArray(y,u,h,r):_(u,h,r)&&this.isEqual(y,u));return Ze(y,f,v)?{formattedValue:this.value(y),id:`${e}${y.getTime()}`,isFocused:this.isEqual(y,s),isSelected:M,isWeekend:!1,isInRange:_(y,h,r),isRangeStart:P,isRangeMid:k,isRangeEnd:b,isRangeSplitEnd:k&&this.isEqual(y,v),isRangeSplitStart:k&&this.isEqual(y,f),isToday:this.isEqual(y,w),title:this.cellTitle(y),value:y}:null})})}isSelectedFromArray(t,e,s,a){let r=!1;return e.forEach(h=>{_(t,s,a)&&this.isEqual(t,h)&&(r=!0)}),r}isEqual(t,e){return!t||!e?!1:l.firstYearOfDecade(t).getFullYear()===l.firstYearOfDecade(e).getFullYear()}isInArray(t,e){if(!e.length)return!1;const s=t.getFullYear();return e[0].getFullYear()<=s&&s<=e[e.length-1].getFullYear()+99}isInRange(t,e,s){const a=l.firstYearOfDecade(t).getFullYear(),r=!e||l.firstYearOfDecade(e).getFullYear()<=a,h=!s||a<=l.firstYearOfDecade(s).getFullYear();return r&&h}isInSameView(t,e){return l.durationInCenturies(t,e)===0}isRangeStart(t){return t.getFullYear()%1e3===0}move(t,e){const s=os[e];return s?s(t):t}cellTitle(t){return l.firstYearOfDecade(t).getFullYear().toString()}navigationTitle(t){return t?l.firstDecadeOfCentury(t).getFullYear().toString():""}title(t){return t?`${l.firstDecadeOfCentury(t).getFullYear()} - ${l.lastDecadeOfCentury(t).getFullYear()}`:""}rowLength(t){return le}skip(t,e){return l.durationInCenturies(e,t)}total(t,e){return l.durationInCenturies(t,e)+1}value(t){return t?l.firstYearOfDecade(t).getFullYear().toString():""}viewDate(t,e,s=1){return l.durationInCenturies(t,e)<s?l.addCenturies(t,-1):t}normalize(t,e,s){return t<e&&this.isEqual(t,e)?l.cloneDate(e):t>s&&this.isEqual(t,s)?l.cloneDate(s):t}}const ls=[[]],he=4,hs=3,cs={[S.Left]:i=>l.addYears(i,-1),[S.Up]:i=>l.addYears(i,-5),[S.Right]:i=>l.addYears(i,1),[S.Down]:i=>l.addYears(i,5),[S.PrevView]:i=>l.addDecades(i,-1),[S.NextView]:i=>l.addDecades(i,1),[S.FirstInView]:i=>l.firstYearOfDecade(i),[S.LastInView]:i=>l.lastYearOfDecade(i)};class Je{addToDate(t,e){return l.addDecades(t,e)}datesList(t,e){return $(0,e).map(s=>l.addDecades(t,s))}data(t){const{cellUID:e,focusedDate:s,isActiveView:a,max:r,min:h,selectedDate:u,selectionRange:c=H,viewDate:p}=t;if(!p)return ls;const m=$(0,he),f=l.firstYearOfDecade(p),v=l.lastYearOfDecade(p),w=z();return $(0,hs).map(T=>{const E=l.addYears(f,T*he);return m.map(O=>{const y=this.normalize(l.addYears(E,O),h,r),P=this.isEqual(y,c.start),b=this.isEqual(y,c.end),k=!P&&!b&&Yt(y,c),M=a&&(Array.isArray(u)?this.isSelectedFromArray(y,u,h,r):_(u,h,r)&&this.isEqual(y,u));return Ze(y,f,v)?{formattedValue:this.value(y),id:`${e}${y.getTime()}`,isFocused:this.isEqual(y,s),isSelected:M,isWeekend:!1,isInRange:_(y,h,r),isRangeStart:P,isRangeMid:k,isRangeEnd:b,isRangeSplitEnd:k&&this.isEqual(y,v),isRangeSplitStart:k&&this.isEqual(y,f),isToday:this.isEqual(y,w),title:this.cellTitle(y),value:y}:null})})}isSelectedFromArray(t,e,s,a){let r=!1;return e.forEach(h=>{_(t,s,a)&&this.isEqual(t,h)&&(r=!0)}),r}isEqual(t,e){return!t||!e?!1:t.getFullYear()===e.getFullYear()}isInArray(t,e){if(!e.length)return!1;const s=t.getFullYear();return e[0].getFullYear()<=s&&s<=e[e.length-1].getFullYear()+9}isInRange(t,e,s){const a=t.getFullYear(),r=!e||e.getFullYear()<=a,h=!s||a<=s.getFullYear();return r&&h}isRangeStart(t){return t.getFullYear()%100===0}isInSameView(t,e){return l.durationInDecades(t,e)===0}move(t,e){const s=cs[e];return s?s(t):t}cellTitle(t){return t.getFullYear().toString()}navigationTitle(t){return t?l.firstYearOfDecade(t).getFullYear().toString():""}title(t){return t?`${l.firstYearOfDecade(t).getFullYear()} - ${l.lastYearOfDecade(t).getFullYear()}`:""}rowLength(t){return he}skip(t,e){return l.durationInDecades(e,t)}total(t,e){return l.durationInDecades(t,e)+1}value(t){return t?t.getFullYear().toString():""}viewDate(t,e,s=1){return l.durationInDecades(t,e)<s?l.addDecades(t,-1):t}normalize(t,e,s){return t<e&&this.isEqual(t,e)?l.cloneDate(e):t>s&&this.isEqual(t,s)?l.cloneDate(s):t}}const us=[[]],ce=7,ds=6,ps=6,ms=0,gs={[S.Left]:i=>l.addDays(i,-1),[S.Up]:i=>l.addWeeks(i,-1),[S.Right]:i=>l.addDays(i,1),[S.Down]:i=>l.addWeeks(i,1),[S.PrevView]:i=>l.addMonths(i,-1),[S.NextView]:i=>l.addMonths(i,1),[S.FirstInView]:i=>l.firstDayOfMonth(i),[S.LastInView]:i=>l.lastDayOfMonth(i)};class Qe{constructor(t){this.intl=t}addToDate(t,e){return l.addMonths(t,e)}datesList(t,e){return $(0,e).map(s=>l.addMonths(t,s))}data(t){const{cellUID:e,focusedDate:s,isActiveView:a,max:r,min:h,selectedDate:u,selectionRange:c=H,viewDate:p}=t;if(!p)return us;const m=l.firstDayOfMonth(p),f=l.lastDayOfMonth(p),v=-1,w=l.dayOfWeek(m,this.intl.firstDay(),v),T=$(0,ce),E=z();return $(0,ds).map(O=>{const y=l.addDays(w,O*ce);return T.map(P=>{const b=this.normalize(l.addDays(y,P),h,r);if(b<m||b>f)return null;const k=this.isEqual(b,c.start),M=this.isEqual(b,c.end),C=!k&&!M&&Yt(b,c),N=a&&(Array.isArray(u)?this.isSelectedFromArray(b,u,h,r):_(u,h,r)&&this.isEqual(b,u));return{formattedValue:this.value(b),id:`${e}${b.getTime()}`,isFocused:this.isEqual(b,s),isSelected:N,isInRange:_(b,h,r),isWeekend:this.isWeekend(b),isRangeStart:k,isRangeMid:C,isRangeEnd:M,isRangeSplitStart:C&&this.isEqual(b,m),isRangeSplitEnd:C&&this.isEqual(b,f),isToday:this.isEqual(b,E),title:this.cellTitle(b),value:b}})})}isEqual(t,e){return!t||!e?!1:l.getDate(t).getTime()===l.getDate(e).getTime()}isSelectedFromArray(t,e,s,a){let r=!1;return e.forEach(h=>{_(t,s,a)&&this.isEqual(t,h)&&(r=!0)}),r}isInArray(t,e){return!!e.length&&l.firstDayOfMonth(e[0])<=t&&t<=l.lastDayOfMonth(e[e.length-1])}isInRange(t,e,s){const a=l.getDate(t),r=!e||l.getDate(e)<=a,h=!s||a<=l.getDate(s);return r&&h}isInSameView(t,e){return l.durationInMonths(t,e)===0}isRangeStart(t){return!t.getMonth()}move(t,e){const s=gs[e];return s?s(t):t}cellTitle(t){return this.intl.formatDate(t,"D")}navigationTitle(t){return t?this.isRangeStart(t)?t.getFullYear().toString():this.abbrMonthNames()[t.getMonth()]:""}title(t){return`${this.wideMonthNames()[t.getMonth()]} ${t.getFullYear()}`}rowLength(t){return ce+(t?1:0)}skip(t,e){return l.durationInMonths(e,t)}total(t,e){return l.durationInMonths(t,e)+1}value(t){return t?t.getDate().toString():""}viewDate(t,e,s=1){return l.durationInMonths(t,e)<s?l.addMonths(t,-1):t}isWeekend(t){const e=t.getDay();return e===ps||e===ms}abbrMonthNames(){return this.intl.dateFormatNames({nameType:"abbreviated",type:"months"})}normalize(t,e,s){return t<e&&this.isEqual(t,e)?l.getDate(e):t>s&&this.isEqual(t,s)?l.getDate(s):t}wideMonthNames(){return this.intl.dateFormatNames({nameType:"wide",type:"months",standAlone:!0})}}const fs=[[]],ue=4,vs=3,ws=i=>i>4?-5:i<2?-2:-7,bs=i=>i<7?5:i<10?7:2,ys={[S.Left]:i=>l.addMonths(i,-1),[S.Up]:i=>l.addMonths(i,ws(i.getMonth())),[S.Right]:i=>l.addMonths(i,1),[S.Down]:i=>l.addMonths(i,bs(i.getMonth())),[S.PrevView]:i=>l.addYears(i,-1),[S.NextView]:i=>l.addYears(i,1),[S.FirstInView]:i=>l.firstMonthOfYear(i),[S.LastInView]:i=>l.lastMonthOfYear(i)};class ti{constructor(t){this._intl=t}addToDate(t,e){return l.addYears(t,e)}datesList(t,e){return $(0,e).map(s=>l.addYears(t,s))}data(t){const{cellUID:e,focusedDate:s,isActiveView:a,max:r,min:h,selectedDate:u,selectionRange:c=H,viewDate:p}=t;if(!p)return fs;const m=this.abbrMonthNames(),f=l.firstMonthOfYear(p),v=l.lastMonthOfYear(p),w=f.getFullYear(),T=$(0,ue),E=z();return $(0,vs).map(O=>{const y=l.addMonths(f,O*ue);return T.map(P=>{const b=this.normalize(l.addMonths(y,P),h,r);if(w<b.getFullYear())return null;const k=this.isEqual(b,c.start),M=this.isEqual(b,c.end),C=!k&&!M&&Yt(b,c),N=a&&(Array.isArray(u)?this.isSelectedFromArray(b,u,h,r):_(u,h,r)&&this.isEqual(b,u));return{formattedValue:m[b.getMonth()],id:`${e}${b.getTime()}`,isFocused:this.isEqual(b,s),isSelected:N,isInRange:_(b,h,r),isWeekend:!1,isRangeStart:k,isRangeMid:C,isRangeEnd:M,isRangeSplitEnd:C&&this.isEqual(b,v),isRangeSplitStart:C&&this.isEqual(b,f),isToday:this.isEqual(b,E),title:this.cellTitle(b),value:b}})})}isSelectedFromArray(t,e,s,a){let r=!1;return e.forEach(h=>{_(t,s,a)&&this.isEqual(t,h)&&(r=!0)}),r}isEqual(t,e){return!t||!e?!1:t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()}isInArray(t,e){if(!e.length)return!1;const s=t.getFullYear();return e[0].getFullYear()<=s&&s<=e[e.length-1].getFullYear()}isInRange(t,e,s){const a=l.createDate(t.getFullYear(),t.getMonth(),1),r=!e||l.createDate(e.getFullYear(),e.getMonth(),1)<=a,h=!s||a<=l.createDate(s.getFullYear(),s.getMonth(),1);return r&&h}isInSameView(t,e){return l.durationInYears(t,e)===0}isRangeStart(t){return t.getFullYear()%10===0}move(t,e){const s=ys[e];return s?s(t):t}cellTitle(t){return`${t.getFullYear()} ${this.value(t)}`}navigationTitle(t){return this.title(t)}title(t){return t?t.getFullYear().toString():""}rowLength(t){return ue}skip(t,e){return l.durationInYears(e,t)}total(t,e){return l.durationInYears(t,e)+1}value(t){return t?this.abbrMonthNames()[t.getMonth()]:""}viewDate(t,e,s=1){return l.durationInYears(t,e)<s?l.addYears(t,-1):t}abbrMonthNames(){return this._intl.dateFormatNames({nameType:"abbreviated",type:"months"})}normalize(t,e,s){return t<e&&this.isEqual(t,e)?l.cloneDate(e):t>s&&this.isEqual(t,s)?l.cloneDate(s):t}}const Ss={[I.month]:Qe,[I.year]:ti,[I.decade]:Je,[I.century]:Xe},Ds=(i,t)=>{const e=I[I[i+t]];return e!==void 0?e:i};class de{constructor(t){this.bottom=I.month,this.top=I.century,this.onViewChanged=t}configure(t,e){this.bottom=t,this.top=e}service(t,e){return new Ss[`${t}`](e)}moveDown(t,e){this.move(t,-1,e)}moveUp(t,e){this.move(t,1,e)}moveToBottom(t){t!==this.bottom&&this.onViewChanged({view:this.bottom})}canMoveDown(t){return this.bottom<t}canMoveUp(t){return t<this.top}clamp(t){return t<this.bottom?this.bottom:t>this.top?this.top:t}move(t,e,s){const a=this.clamp(Ds(t,e));a!==t&&this.onViewChanged({view:a},s)}}let ei=class{constructor(){this.calendarHeight=0,this.headerHeight=0,this.monthViewHeight=0,this.yearViewHeight=0,this.decadeViewHeight=0,this.centuryViewHeight=0,this.navigationItemHeight=0,this.scrollableContentHeight=0,this.scrollableYearContentHeight=0,this.calendarWidth=0,this.monthViewWidth=0,this.yearViewWidth=0,this.decadeViewWidth=0,this.centuryViewWidth=0,this.scrollableContentWidth=0,this.didCalculate=!1,this.hostContainer=null}ensureHeights(){this.calendarHeight===void 0&&this.calculateHeights()}calculateHeights(t){if(!d.canUseDOM)return;const e=Y("div"),s=Y("ul"),a=Y("li"),r=Y("td"),h=Y("th"),u=Y("tr"),c=Y("tbody"),p=Y("thead"),m=Y("table"),f=()=>e(`
5
+ (function(g,Mt){typeof exports=="object"&&typeof module<"u"?Mt(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-date-math"),require("@progress/kendo-react-intl"),require("@progress/kendo-react-buttons"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-labels"),require("@progress/kendo-react-popup"),require("@progress/kendo-react-layout")):typeof define=="function"&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-date-math","@progress/kendo-react-intl","@progress/kendo-react-buttons","@progress/kendo-svg-icons","@progress/kendo-react-labels","@progress/kendo-react-popup","@progress/kendo-react-layout"],Mt):(g=typeof globalThis<"u"?globalThis:g||self,Mt(g.KendoReactDateinputs={},g.React,g.PropTypes,g.KendoReactCommon,g.KendoDateMath,g.KendoReactIntl,g.KendoReactButtons,g.KendoSvgIcons,g.KendoReactLabels,g.KendoReactPopup,g.KendoReactLayout))})(this,function(g,Mt,Ki,d,l,I,F,X,Ue,qt,ht){"use strict";"use client";function Ye(i){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const e in i)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(t,e,s.get?s:{enumerable:!0,get:()=>i[e]})}}return t.default=i,Object.freeze(t)}const o=Ye(Mt),n=Ye(Ki),gt={name:"@progress/kendo-react-dateinputs",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:1617189075,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"},ji=(i,t,e)=>[...i.slice(0,t+1),...i.slice(t+1).map(s=>s+e)];class Zi{constructor(t=0,e,s){this.total=t,this.rowHeight=e,this.detailRowHeight=s,this.offsets=[],this.heights=[];let a=0;for(let r=0;r<t;r++)this.offsets.push(a),a+=e,this.heights.push(e)}height(t){return this.heights[t]}expandDetail(t){this.height(t)===this.rowHeight&&this.updateRowHeight(t,this.detailRowHeight)}collapseDetail(t){this.height(t)>this.rowHeight&&this.updateRowHeight(t,this.detailRowHeight*-1)}index(t){for(let e=0;e<this.offsets.length;e++){if(t===this.offsets[e])return e;if(t<this.offsets[e])return e-1}return this.total-1}offset(t){return this.offsets[t]}totalHeight(){return this.heights.reduce((t,e)=>t+e,0)}updateRowHeight(t,e){this.heights[t]+=e,this.offsets=ji(this.offsets,t,e)}}const Rt=i=>Math.max(i,0);class re{constructor(t){this.offset=t}}class oe{constructor(t){this.skip=t}}class Gi{constructor(t,e){this.onScrollAction=t,this.onPageAction=e,this.direction="vertical",this.firstLoaded=0,this.lastLoaded=0,this.lastScrollTop=0,this.take=0,this.total=0,this.rowHeightService=null,this.bottomOffset=0,this.topOffset=0}create(t,e,s,a,r=0,h=0,u="vertical"){this.rowHeightService=t,this.firstLoaded=e,this.lastLoaded=e+s,this.take=s,this.total=a,this.lastScrollTop=0,this.topOffset=r,this.bottomOffset=h,this.direction=u;const c=this.rowsForHeight(r),p=Rt(e-c);this.onScrollAction(new re(this.rowOffset(p))),this.onPageAction(new oe(p))}onScroll({scrollLeft:t,scrollTop:e,offsetHeight:s,offsetWidth:a}){const r=this.direction==="vertical"?e:t,h=this.direction==="vertical"?s:a;if(this.lastScrollTop===r||!this.rowHeightService)return;const u=this.lastScrollTop>=r;this.lastScrollTop=r;const c=this.rowHeightService.index(Rt(r-this.topOffset)),p=this.rowHeightService.index(Rt(r+h-this.bottomOffset));if(!u&&p>=this.lastLoaded&&this.lastLoaded<this.total&&(this.firstLoaded=c,this.onScrollAction(new re(this.rowOffset(c))),this.lastLoaded=Math.min(this.firstLoaded+this.take,this.total),this.onPageAction(new oe(this.firstLoaded))),u&&c<=this.firstLoaded){const m=Math.floor(this.take*.3);this.firstLoaded=Rt(c-m),this.onScrollAction(new re(this.rowOffset(this.firstLoaded))),this.lastLoaded=Math.min(this.firstLoaded+this.take,this.total),this.onPageAction(new oe(this.firstLoaded))}}rowOffset(t){return this.rowHeightService?this.rowHeightService.offset(t)+this.topOffset:0}rowsForHeight(t){return this.rowHeightService?Math.ceil(t/this.rowHeightService.height(0)):0}}const Xi=(i,t,e)=>Math.min(Math.abs(t-i),e),Ji=17,Qi=10,ts={[1]:i=>t=>t+i,[0]:i=>t=>t-i},es={[1]:i=>t=>Math.min(t,i),[0]:i=>t=>Math.max(t,i)},is={[1]:i=>t=>t<i,[0]:i=>t=>t>i},Wt=class extends o.Component{constructor(i){super(i),this.rowHeightService=null,this.scrollContainer=null,this.lastDirection=null,this.lastTotal=0,this.lastTake=0,this.animationInProgress=!1,this.restrictScroll=!1,this.scrollTo=t=>{const e=this.direction==="vertical"?"scrollTop":"scrollLeft";if(!this.scrollContainer)return;const s=this.scrollContainer[e];this.restrictScroll&&e==="scrollTop"&&(!Number.isInteger(s)||!Number.isInteger(t))&&Math.abs(s-t)<Qi||(this.scrollContainer[e]=t)},this.scrollToIndex=t=>{this.animationInProgress=!1,this.rowHeightService&&this.scrollTo(this.rowHeightService.offset(t))},this.animateToIndex=t=>{if(!this.rowHeightService||!window)return;window.cancelAnimationFrame(this.cancelAnimation);const e=this.rowHeightService.offset(t),s=this.getContainerScrollDirection(e);let{start:a,end:r}=this.scrollRange(e,s);if(a===r)return;const h=this.scrollStep(a,r),u=ts[s](h),c=es[s](r),p=is[s](u(r)),m=f=>{this.animationInProgress=!0;const v=u(f);this.scrollTo(c(v)),p(v)?this.cancelAnimation=window.requestAnimationFrame(()=>{m(v)}):this.animationInProgress=!1};this.cancelAnimation=window.requestAnimationFrame(()=>{m(a)})},this.scrollToBottom=()=>{this.rowHeightService&&this.scrollTo(this.rowHeightService.totalHeight()+this.props.bottomOffset)},this.scrollStep=(t,e)=>{const s=this.props.scrollDuration||Wt.defaultProps.scrollDuration;return Math.abs(e-t)/(s/Ji)},this.scrollRange=(t,e)=>{const s=this.containerScrollPosition;if(parseInt(`${t}`,10)===parseInt(`${s}`,10))return{start:t,end:t};const a=this.containerMaxScroll(),r=e===0?1:-1,h=Xi(s,t,this.props.maxScrollDifference||0),u=Math.min(t,a);return{start:Math.min(Math.max(u+r*h,0),a),end:u}},this.containerMaxScroll=()=>this.containerScrollSize-this.containerOffsetSize,this.getContainerScrollDirection=t=>t<this.containerScrollPosition?0:1,this.initServices=(t=this.props)=>{const e=this.direction==="vertical"?t.itemHeight:t.itemWidth;e!==void 0&&(this.rowHeightService=new Zi(t.total,e,0),this.scrollerService.create(this.rowHeightService,t.skip,t.take,t.total,t.topOffset,this.scrollOffsetSize,this.direction))},this.getContainerProperty=t=>this.scrollContainer?this.scrollContainer[t]:0,this.handleScroll=t=>{if(!this.scrollContainer||!this.rowHeightService)return;const e=t.target;this.scrollerService.onScroll({scrollLeft:e.scrollLeft,scrollTop:e.scrollTop,offsetHeight:e.offsetHeight,offsetWidth:e.offsetWidth});const s=this.rowHeightService.index(this.containerScrollPosition-this.props.topOffset),{onScrollAction:a}=this.props,r={index:s,target:e,scrollAction:this.scrollAction,pageAction:this.pageAction,animationInProgress:this.animationInProgress};this.props.onScroll&&this.props.onScroll.call(void 0,t),a&&a.call(void 0,r),this.scrollAction=void 0,this.pageAction=void 0},this.handleScrollAction=t=>{this.scrollAction=t},this.handlePageAction=t=>{this.pageAction=t},this.scrollerService=new Gi(this.handleScrollAction,this.handlePageAction),this.restrictScroll=Number.parseFloat(o.version)>17}get element(){return this.scrollContainer}get containerOffsetSize(){return this.getContainerProperty(this.direction==="vertical"?"offsetHeight":"offsetWidth")}get containerScrollSize(){return this.getContainerProperty(this.direction==="vertical"?"scrollHeight":"scrollWidth")}get containerScrollPosition(){return this.getContainerProperty(this.direction==="vertical"?"scrollTop":"scrollLeft")}get direction(){return this.props.direction!==void 0?this.props.direction:Wt.defaultProps.direction}get scrollOffsetSize(){return this.props.scrollOffsetSize!==void 0?this.props.scrollOffsetSize:Wt.defaultProps.scrollOffsetSize}activeIndex(){return this.itemIndex(Math.ceil(this.containerScrollPosition))}itemIndex(i){return this.rowHeightService?this.rowHeightService.index(i):0}itemOffset(i){return this.rowHeightService?this.rowHeightService.offset(i):0}isIndexVisible(i){if(!this.rowHeightService)return!1;const t=this.containerScrollPosition,e=t+this.containerOffsetSize,s=this.rowHeightService.offset(i),a=s+this.rowHeightService.height(i);return s>=t&&a<=e}isListScrolled(i){return this.rowHeightService?this.containerScrollPosition!==this.rowHeightService.offset(i):!1}componentDidMount(){const{onMount:i}=this.props;i&&i.call(void 0,this)}render(){(this.lastTotal!==this.props.total||this.lastDirection!==this.direction||this.lastTake!==this.props.take)&&(this.initServices(),this.lastTotal=this.props.total,this.lastDirection=this.direction,this.lastTake=this.props.take);const i=`${(this.rowHeightService?this.rowHeightService.totalHeight():0)+this.props.bottomOffset}`,t=this.direction==="vertical"?{height:`${i}px`}:{width:`${i}px`},e=d.classNames("k-content k-scrollable",{"k-scrollable-horizontal":this.direction==="horizontal"},this.props.className),s=d.classNames("k-scrollable-placeholder",{"k-scrollable-horizontal-placeholder":this.direction==="horizontal"});return o.createElement("div",{ref:a=>{this.scrollContainer=a},onScroll:this.handleScroll,className:e,tabIndex:this.props.tabIndex,role:this.props.role},this.props.children,o.createElement("div",{style:t,className:s}))}};let ft=Wt;ft.propTypes={bottomOffset:n.number.isRequired,className:n.string,direction:n.oneOf(["horizontal","vertical"]),forceScroll:n.bool,itemHeight:n.number,itemWidth:n.number,maxScrollDifference:n.number,onScroll:n.func,onScrollAction:n.func,scrollDuration:n.number,scrollOffsetSize:n.number,skip:n.number.isRequired,tabIndex:n.number,take:n.number.isRequired,topOffset:n.number.isRequired,total:n.number.isRequired,role:n.string},ft.defaultProps={direction:"vertical",forceScroll:!1,scrollOffsetSize:0,maxScrollDifference:100,scrollDuration:100};const ss=(i,t)=>{const e=Object.getOwnPropertyNames(i),s=Object.getOwnPropertyNames(t);if(e.length!==s.length)return!1;for(let a=0;a<e.length;a++){const r=e[a];if(i[r]!==t[r])return!1}return!0};class $e extends o.Component{constructor(){super(...arguments),this.handleClick=t=>{const{onClick:e,value:s}=this.props;e&&e.call(void 0,s,t)},this.handleMouseEnter=()=>{const{onMouseEnter:t,value:e}=this.props;t&&t.call(void 0,e)},this.handleMouseLeave=()=>{const{onMouseLeave:t,value:e}=this.props;t&&t.call(void 0,e)}}shouldComponentUpdate(t){const{value:e,...s}=this.props,{value:a,...r}=t;return!((!(e&&a)||e.getTime()===a.getTime())&&ss(s,r))}render(){const{className:t,formattedValue:e,isWeekend:s,isFocused:a,isInRange:r,isSelected:h,isRangeStart:u,isRangeMid:c,isRangeEnd:p,isRangeSplitStart:m,isRangeSplitEnd:f,isToday:v,isDisabled:w,view:T,value:E,...V}=this.props,y=this.props.activeRangeEnd==="end"&&p,P=this.props.activeRangeEnd==="start"&&u,b=d.classNames("k-calendar-td",{"k-range-end":p,"k-range-mid":c,"k-range-split-end":f,"k-range-split-start":m,"k-range-start":u,"k-active":P||y,"k-state-pending-focus":a,"k-selected":h||u||p,"k-today":v,"k-weekend":s,"k-disabled":w},t);return o.createElement("td",{...V,className:b,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},o.createElement("span",{className:"k-link"},this.props.children))}}class Ke extends o.Component{render(){const{className:t,firstDate:e,...s}=this.props;return o.createElement("td",{className:d.classNames("k-calendar-td",t),...s},this.props.children)}}var S=(i=>(i[i.Left=0]="Left",i[i.Right=1]="Right",i[i.Up=2]="Up",i[i.Down=3]="Down",i[i.PrevView=4]="PrevView",i[i.NextView=5]="NextView",i[i.FirstInView=6]="FirstInView",i[i.LastInView=7]="LastInView",i[i.LowerView=8]="LowerView",i[i.UpperView=9]="UpperView",i))(S||{}),x=(i=>(i[i.month=0]="month",i[i.year=1]="year",i[i.decade=2]="decade",i[i.century=3]="century",i))(x||{});const A={start:null,end:null};function et(i){const t=(s,a,r,...h)=>a[r]===null?null:(s?i.isRequired:i)(a,r,...h),e=t.bind(null,!1);return e.isRequired=t.bind(null,!0),e}const Ut=(i,t,e)=>t===void 0||e===void 0||t<=i&&i<=e?i:i<t?t:e,H=new Date(1980,0,1),it=new Date(1900,0,1),st=new Date(2099,11,31),ct=new Date(1980,0,1),nt=new Date(1980,0,1,23,59,59),B=(i,t)=>{const e=l.cloneDate(i);return e.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),e},z=()=>l.getDate(new Date),_=(i,t,e)=>!i||!(t&&t>i||e&&e<i),je=(i,t,e)=>i===null||!(t&&l.getDate(t)>l.getDate(i)||e&&l.getDate(e)<l.getDate(i)),Yt=(i,t)=>{const{start:e,end:s}=t||A;return!e||!s?!1:e<i&&i<s},$=(i,t,e=1)=>{const s=[];for(let a=i;a<t;a=a+e)s.push(a);return s},Ze=(i,t,e)=>t.getTime()<=i.getTime()&&i.getTime()<=e.getTime(),Ge=(i,t)=>i.slice(t).concat(i.slice(0,t)),U=(i,t,e)=>i&&(t&&i<t?l.cloneDate(t):e&&i>e?l.cloneDate(e):i),Y=i=>(t,e="",s={})=>{const a=document.createElement(i);return a.className=e,Object.keys(s).map(r=>a.style[r]=s[r]),typeof t=="string"?a.innerHTML=t||"":(t||[]).forEach(r=>r&&a.appendChild(r)),a};function ns(i,t,e={}){let s,a;e.maxWait;let r,h,u;const c=window;let p=!1,m=!1;const f=!t&&t!==0&&typeof c.requestAnimationFrame=="function";if(typeof i!="function")throw new TypeError("Expected a function");t=+t||0;function v(C){const N=s,tt=a;return s=a=void 0,r=i.apply(tt,N),r}function w(C,N){return f?(c.cancelAnimationFrame(h),c.requestAnimationFrame(C)):setTimeout(C,N)}function T(C){if(f)return c.cancelAnimationFrame(C);clearTimeout(C)}function E(C){return h=w(P,t),p?v():r}function V(C){const N=C-u;return t-N}function y(C){const N=C-u;return u===void 0||N>=t||N<0||m}function P(){const C=Date.now();if(y(C))return b();h=w(P,V(C))}function b(C){return h=void 0,s?v():(s=a=void 0,r)}function R(){h!==void 0&&T(h),s=u=a=h=void 0}function k(){return h===void 0?r:b()}function M(){return h!==void 0}function W(...C){const N=Date.now(),tt=y(N);return s=C,a=this,u=N,tt&&h===void 0?E():(h===void 0&&(h=w(P,t)),r)}return W.cancel=R,W.flush=k,W.pending=M,W}const as=[[]],le=4,rs=3,os={[S.Left]:i=>l.addDecades(i,-1),[S.Up]:i=>l.addDecades(i,-5),[S.Right]:i=>l.addDecades(i,1),[S.Down]:i=>l.addDecades(i,5),[S.PrevView]:i=>l.addCenturies(i,-1),[S.NextView]:i=>l.addCenturies(i,1),[S.FirstInView]:i=>l.firstDecadeOfCentury(i),[S.LastInView]:i=>l.lastDecadeOfCentury(i)};class Xe{addToDate(t,e){return l.addCenturies(t,e)}datesList(t,e){return $(0,e).map(s=>l.addCenturies(t,s))}data(t){const{cellUID:e,focusedDate:s,isActiveView:a,max:r,min:h,selectedDate:u,selectionRange:c=A,viewDate:p}=t;if(!p)return as;const m=$(0,le),f=l.firstDecadeOfCentury(p),v=l.lastDecadeOfCentury(p),w=z();return $(0,rs).map(T=>{const E=l.addDecades(f,T*le);return m.map(V=>{const y=this.normalize(l.addDecades(E,V),h,r),P=this.isEqual(y,c.start),b=this.isEqual(y,c.end),k=!P&&!b&&Yt(y,c),M=a&&(Array.isArray(u)?this.isSelectedFromArray(y,u,h,r):_(u,h,r)&&this.isEqual(y,u));return Ze(y,f,v)?{formattedValue:this.value(y),id:`${e}${y.getTime()}`,isFocused:this.isEqual(y,s),isSelected:M,isWeekend:!1,isInRange:_(y,h,r),isRangeStart:P,isRangeMid:k,isRangeEnd:b,isRangeSplitEnd:k&&this.isEqual(y,v),isRangeSplitStart:k&&this.isEqual(y,f),isToday:this.isEqual(y,w),title:this.cellTitle(y),value:y}:null})})}isSelectedFromArray(t,e,s,a){let r=!1;return e.forEach(h=>{_(t,s,a)&&this.isEqual(t,h)&&(r=!0)}),r}isEqual(t,e){return!t||!e?!1:l.firstYearOfDecade(t).getFullYear()===l.firstYearOfDecade(e).getFullYear()}isInArray(t,e){if(!e.length)return!1;const s=t.getFullYear();return e[0].getFullYear()<=s&&s<=e[e.length-1].getFullYear()+99}isInRange(t,e,s){const a=l.firstYearOfDecade(t).getFullYear(),r=!e||l.firstYearOfDecade(e).getFullYear()<=a,h=!s||a<=l.firstYearOfDecade(s).getFullYear();return r&&h}isInSameView(t,e){return l.durationInCenturies(t,e)===0}isRangeStart(t){return t.getFullYear()%1e3===0}move(t,e){const s=os[e];return s?s(t):t}cellTitle(t){return l.firstYearOfDecade(t).getFullYear().toString()}navigationTitle(t){return t?l.firstDecadeOfCentury(t).getFullYear().toString():""}title(t){return t?`${l.firstDecadeOfCentury(t).getFullYear()} - ${l.lastDecadeOfCentury(t).getFullYear()}`:""}rowLength(t){return le}skip(t,e){return l.durationInCenturies(e,t)}total(t,e){return l.durationInCenturies(t,e)+1}value(t){return t?l.firstYearOfDecade(t).getFullYear().toString():""}viewDate(t,e,s=1){return l.durationInCenturies(t,e)<s?l.addCenturies(t,-1):t}normalize(t,e,s){return t<e&&this.isEqual(t,e)?l.cloneDate(e):t>s&&this.isEqual(t,s)?l.cloneDate(s):t}}const ls=[[]],he=4,hs=3,cs={[S.Left]:i=>l.addYears(i,-1),[S.Up]:i=>l.addYears(i,-5),[S.Right]:i=>l.addYears(i,1),[S.Down]:i=>l.addYears(i,5),[S.PrevView]:i=>l.addDecades(i,-1),[S.NextView]:i=>l.addDecades(i,1),[S.FirstInView]:i=>l.firstYearOfDecade(i),[S.LastInView]:i=>l.lastYearOfDecade(i)};class Je{addToDate(t,e){return l.addDecades(t,e)}datesList(t,e){return $(0,e).map(s=>l.addDecades(t,s))}data(t){const{cellUID:e,focusedDate:s,isActiveView:a,max:r,min:h,selectedDate:u,selectionRange:c=A,viewDate:p}=t;if(!p)return ls;const m=$(0,he),f=l.firstYearOfDecade(p),v=l.lastYearOfDecade(p),w=z();return $(0,hs).map(T=>{const E=l.addYears(f,T*he);return m.map(V=>{const y=this.normalize(l.addYears(E,V),h,r),P=this.isEqual(y,c.start),b=this.isEqual(y,c.end),k=!P&&!b&&Yt(y,c),M=a&&(Array.isArray(u)?this.isSelectedFromArray(y,u,h,r):_(u,h,r)&&this.isEqual(y,u));return Ze(y,f,v)?{formattedValue:this.value(y),id:`${e}${y.getTime()}`,isFocused:this.isEqual(y,s),isSelected:M,isWeekend:!1,isInRange:_(y,h,r),isRangeStart:P,isRangeMid:k,isRangeEnd:b,isRangeSplitEnd:k&&this.isEqual(y,v),isRangeSplitStart:k&&this.isEqual(y,f),isToday:this.isEqual(y,w),title:this.cellTitle(y),value:y}:null})})}isSelectedFromArray(t,e,s,a){let r=!1;return e.forEach(h=>{_(t,s,a)&&this.isEqual(t,h)&&(r=!0)}),r}isEqual(t,e){return!t||!e?!1:t.getFullYear()===e.getFullYear()}isInArray(t,e){if(!e.length)return!1;const s=t.getFullYear();return e[0].getFullYear()<=s&&s<=e[e.length-1].getFullYear()+9}isInRange(t,e,s){const a=t.getFullYear(),r=!e||e.getFullYear()<=a,h=!s||a<=s.getFullYear();return r&&h}isRangeStart(t){return t.getFullYear()%100===0}isInSameView(t,e){return l.durationInDecades(t,e)===0}move(t,e){const s=cs[e];return s?s(t):t}cellTitle(t){return t.getFullYear().toString()}navigationTitle(t){return t?l.firstYearOfDecade(t).getFullYear().toString():""}title(t){return t?`${l.firstYearOfDecade(t).getFullYear()} - ${l.lastYearOfDecade(t).getFullYear()}`:""}rowLength(t){return he}skip(t,e){return l.durationInDecades(e,t)}total(t,e){return l.durationInDecades(t,e)+1}value(t){return t?t.getFullYear().toString():""}viewDate(t,e,s=1){return l.durationInDecades(t,e)<s?l.addDecades(t,-1):t}normalize(t,e,s){return t<e&&this.isEqual(t,e)?l.cloneDate(e):t>s&&this.isEqual(t,s)?l.cloneDate(s):t}}const us=[[]],ce=7,ds=6,ps=6,ms=0,gs={[S.Left]:i=>l.addDays(i,-1),[S.Up]:i=>l.addWeeks(i,-1),[S.Right]:i=>l.addDays(i,1),[S.Down]:i=>l.addWeeks(i,1),[S.PrevView]:i=>l.addMonths(i,-1),[S.NextView]:i=>l.addMonths(i,1),[S.FirstInView]:i=>l.firstDayOfMonth(i),[S.LastInView]:i=>l.lastDayOfMonth(i)};class Qe{constructor(t){this.intl=t}addToDate(t,e){return l.addMonths(t,e)}datesList(t,e){return $(0,e).map(s=>l.addMonths(t,s))}data(t){const{cellUID:e,focusedDate:s,isActiveView:a,max:r,min:h,selectedDate:u,selectionRange:c=A,viewDate:p}=t;if(!p)return us;const m=l.firstDayOfMonth(p),f=l.lastDayOfMonth(p),v=-1,w=l.dayOfWeek(m,this.intl.firstDay(),v),T=$(0,ce),E=z();return $(0,ds).map(V=>{const y=l.addDays(w,V*ce);return T.map(P=>{const b=this.normalize(l.addDays(y,P),h,r);if(b<m||b>f)return null;const k=this.isEqual(b,c.start),M=this.isEqual(b,c.end),C=!k&&!M&&Yt(b,c),N=a&&(Array.isArray(u)?this.isSelectedFromArray(b,u,h,r):_(u,h,r)&&this.isEqual(b,u));return{formattedValue:this.value(b),id:`${e}${b.getTime()}`,isFocused:this.isEqual(b,s),isSelected:N,isInRange:_(b,h,r),isWeekend:this.isWeekend(b),isRangeStart:k,isRangeMid:C,isRangeEnd:M,isRangeSplitStart:C&&this.isEqual(b,m),isRangeSplitEnd:C&&this.isEqual(b,f),isToday:this.isEqual(b,E),title:this.cellTitle(b),value:b}})})}isEqual(t,e){return!t||!e?!1:l.getDate(t).getTime()===l.getDate(e).getTime()}isSelectedFromArray(t,e,s,a){let r=!1;return e.forEach(h=>{_(t,s,a)&&this.isEqual(t,h)&&(r=!0)}),r}isInArray(t,e){return!!e.length&&l.firstDayOfMonth(e[0])<=t&&t<=l.lastDayOfMonth(e[e.length-1])}isInRange(t,e,s){const a=l.getDate(t),r=!e||l.getDate(e)<=a,h=!s||a<=l.getDate(s);return r&&h}isInSameView(t,e){return l.durationInMonths(t,e)===0}isRangeStart(t){return!t.getMonth()}move(t,e){const s=gs[e];return s?s(t):t}cellTitle(t){return this.intl.formatDate(t,"D")}navigationTitle(t){return t?this.isRangeStart(t)?t.getFullYear().toString():this.abbrMonthNames()[t.getMonth()]:""}title(t){return`${this.wideMonthNames()[t.getMonth()]} ${t.getFullYear()}`}rowLength(t){return ce+(t?1:0)}skip(t,e){return l.durationInMonths(e,t)}total(t,e){return l.durationInMonths(t,e)+1}value(t){return t?t.getDate().toString():""}viewDate(t,e,s=1){return l.durationInMonths(t,e)<s?l.addMonths(t,-1):t}isWeekend(t){const e=t.getDay();return e===ps||e===ms}abbrMonthNames(){return this.intl.dateFormatNames({nameType:"abbreviated",type:"months"})}normalize(t,e,s){return t<e&&this.isEqual(t,e)?l.getDate(e):t>s&&this.isEqual(t,s)?l.getDate(s):t}wideMonthNames(){return this.intl.dateFormatNames({nameType:"wide",type:"months",standAlone:!0})}}const fs=[[]],ue=4,vs=3,ws=i=>i>4?-5:i<2?-2:-7,bs=i=>i<7?5:i<10?7:2,ys={[S.Left]:i=>l.addMonths(i,-1),[S.Up]:i=>l.addMonths(i,ws(i.getMonth())),[S.Right]:i=>l.addMonths(i,1),[S.Down]:i=>l.addMonths(i,bs(i.getMonth())),[S.PrevView]:i=>l.addYears(i,-1),[S.NextView]:i=>l.addYears(i,1),[S.FirstInView]:i=>l.firstMonthOfYear(i),[S.LastInView]:i=>l.lastMonthOfYear(i)};class ti{constructor(t){this._intl=t}addToDate(t,e){return l.addYears(t,e)}datesList(t,e){return $(0,e).map(s=>l.addYears(t,s))}data(t){const{cellUID:e,focusedDate:s,isActiveView:a,max:r,min:h,selectedDate:u,selectionRange:c=A,viewDate:p}=t;if(!p)return fs;const m=this.abbrMonthNames(),f=l.firstMonthOfYear(p),v=l.lastMonthOfYear(p),w=f.getFullYear(),T=$(0,ue),E=z();return $(0,vs).map(V=>{const y=l.addMonths(f,V*ue);return T.map(P=>{const b=this.normalize(l.addMonths(y,P),h,r);if(w<b.getFullYear())return null;const k=this.isEqual(b,c.start),M=this.isEqual(b,c.end),C=!k&&!M&&Yt(b,c),N=a&&(Array.isArray(u)?this.isSelectedFromArray(b,u,h,r):_(u,h,r)&&this.isEqual(b,u));return{formattedValue:m[b.getMonth()],id:`${e}${b.getTime()}`,isFocused:this.isEqual(b,s),isSelected:N,isInRange:_(b,h,r),isWeekend:!1,isRangeStart:k,isRangeMid:C,isRangeEnd:M,isRangeSplitEnd:C&&this.isEqual(b,v),isRangeSplitStart:C&&this.isEqual(b,f),isToday:this.isEqual(b,E),title:this.cellTitle(b),value:b}})})}isSelectedFromArray(t,e,s,a){let r=!1;return e.forEach(h=>{_(t,s,a)&&this.isEqual(t,h)&&(r=!0)}),r}isEqual(t,e){return!t||!e?!1:t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()}isInArray(t,e){if(!e.length)return!1;const s=t.getFullYear();return e[0].getFullYear()<=s&&s<=e[e.length-1].getFullYear()}isInRange(t,e,s){const a=l.createDate(t.getFullYear(),t.getMonth(),1),r=!e||l.createDate(e.getFullYear(),e.getMonth(),1)<=a,h=!s||a<=l.createDate(s.getFullYear(),s.getMonth(),1);return r&&h}isInSameView(t,e){return l.durationInYears(t,e)===0}isRangeStart(t){return t.getFullYear()%10===0}move(t,e){const s=ys[e];return s?s(t):t}cellTitle(t){return`${t.getFullYear()} ${this.value(t)}`}navigationTitle(t){return this.title(t)}title(t){return t?t.getFullYear().toString():""}rowLength(t){return ue}skip(t,e){return l.durationInYears(e,t)}total(t,e){return l.durationInYears(t,e)+1}value(t){return t?this.abbrMonthNames()[t.getMonth()]:""}viewDate(t,e,s=1){return l.durationInYears(t,e)<s?l.addYears(t,-1):t}abbrMonthNames(){return this._intl.dateFormatNames({nameType:"abbreviated",type:"months"})}normalize(t,e,s){return t<e&&this.isEqual(t,e)?l.cloneDate(e):t>s&&this.isEqual(t,s)?l.cloneDate(s):t}}const Ss={[x.month]:Qe,[x.year]:ti,[x.decade]:Je,[x.century]:Xe},Ds=(i,t)=>{const e=x[x[i+t]];return e!==void 0?e:i};class de{constructor(t){this.bottom=x.month,this.top=x.century,this.onViewChanged=t}configure(t,e){this.bottom=t,this.top=e}service(t,e){return new Ss[`${t}`](e)}moveDown(t,e){this.move(t,-1,e)}moveUp(t,e){this.move(t,1,e)}moveToBottom(t){t!==this.bottom&&this.onViewChanged({view:this.bottom})}canMoveDown(t){return this.bottom<t}canMoveUp(t){return t<this.top}clamp(t){return t<this.bottom?this.bottom:t>this.top?this.top:t}move(t,e,s){const a=this.clamp(Ds(t,e));a!==t&&this.onViewChanged({view:a},s)}}let ei=class{constructor(){this.calendarHeight=0,this.headerHeight=0,this.monthViewHeight=0,this.yearViewHeight=0,this.decadeViewHeight=0,this.centuryViewHeight=0,this.navigationItemHeight=0,this.scrollableContentHeight=0,this.scrollableYearContentHeight=0,this.calendarWidth=0,this.monthViewWidth=0,this.yearViewWidth=0,this.decadeViewWidth=0,this.centuryViewWidth=0,this.scrollableContentWidth=0,this.didCalculate=!1,this.hostContainer=null}ensureHeights(){this.calendarHeight===void 0&&this.calculateHeights()}calculateHeights(t){if(!d.canUseDOM)return;const e=Y("div"),s=Y("ul"),a=Y("li"),r=Y("td"),h=Y("th"),u=Y("tr"),c=Y("tbody"),p=Y("thead"),m=Y("table"),f=()=>e(`
6
6
  <span class="k-button k-button-md k-button-rectangle k-button-solid k-button-solid-base k-button-flat k-calendar-title">
7
7
  <span className="k-button-text">March 2017</span>
8
8
  </span>
9
9
  <span class="k-spacer"></span>
10
10
  <span class="k-calendar-nav k-hstack"><button class="k-calendar-nav-today">TODAY</button></span>
11
- `,"k-calendar-header k-hstack"),v=()=>m([p([u([h("MO","k-calendar-th")],"k-calendar-tr")],"k-calendar-thead")],"k-calendar-table k-calendar-weekdays"),w=(D,L)=>new Array(D).fill("1").map(L),T=(D,L=1)=>m([c([u([r("1","k-calendar-td k-alt")])].concat(w(D,()=>u(w(L,Nt=>r(`<span class="k-link">${Nt}</span>`,"k-calendar-td")),"k-calendar-tr"))),"k-calendar-tbody")],"k-calendar-table"),E=D=>e(D,"k-content k-scrollable"),O=(D,L,Nt)=>e(Nt?[f(),v(),E([D,D])]:[f(),E([D,D])],L,{left:"-10000px",position:"absolute"}),y=(()=>{let D;return()=>d.canUseDOM?(D||(D=e([E([s([a("<span>FEB</span>")])])],"k-calendar-navigation",{left:"0px",position:"absolute"})),D):null})(),P=({cells:D,rows:L},Nt,fn)=>{let We;return()=>d.canUseDOM?(We||(We=O(T(L,D),Nt,fn)),We):null},b=D=>D.querySelector(".k-scrollable"),R=D=>{const L=b(D);return L.className=`${L.className} k-scrollable-horizontal`,D},k=P({cells:7,rows:6},"k-calendar-view k-calendar-monthview k-vstack",!0),M=P({cells:5,rows:3},"k-calendar-view k-calendar-yearview",!1),W=P({cells:5,rows:2},"k-calendar-view k-calendar-decadeview",!1),C=()=>R(k()),N=()=>R(M()),tt=()=>R(W()),G=D=>parseFloat(window.getComputedStyle(D).height)||D.offsetHeight,mt=D=>{const L=window.getComputedStyle(D);return parseFloat(L.width)+parseFloat(L.paddingLeft)+parseFloat(L.paddingRight)||D.offsetWidth},kt=D=>D.querySelector("tbody");this.didCalculate=!0,t&&(this.hostContainer=t),this.batch(k(),D=>{const L=kt(D);this.calendarHeight=G(D),this.monthViewHeight=G(L),this.headerHeight=G(L.children[0]),this.scrollableContentHeight=G(b(D))}),this.batch(C(),D=>{const L=kt(D);this.calendarWidth=mt(D),this.monthViewWidth=mt(L),this.scrollableContentWidth=mt(b(D))}),this.batch(M(),D=>{this.yearViewHeight=G(kt(D)),this.scrollableYearContentHeight=G(b(D))}),this.batch(N(),D=>{this.yearViewWidth=mt(kt(D))}),this.batch(W(),D=>{this.decadeViewHeight=G(kt(D)),this.centuryViewHeight=this.decadeViewHeight}),this.batch(tt(),D=>{this.decadeViewWidth=mt(kt(D)),this.centuryViewWidth=this.decadeViewWidth}),this.batch(y(),D=>{this.navigationItemHeight=G(D.querySelector("li"))})}viewHeight(t){return this.viewDimension(t,"height")}viewWidth(t){return this.viewDimension(t,"width")}viewDimension(t,e){const s=e==="height"?"ViewHeight":"ViewWidth";switch(t){case I.month:return this[`month${s}`];case I.year:return this[`year${s}`];case I.decade:return this[`decade${s}`];case I.century:return this[`century${s}`];default:return 1}}batch(t,e){const s=this.hostContainer||document.body,a=s.appendChild(t);e(a),s.removeChild(a)}};const xs={33:S.PrevView,34:S.NextView,35:S.LastInView,36:S.FirstInView,37:S.Left,38:S.Up,39:S.Right,40:S.Down,"meta+38":S.UpperView,"meta+40":S.LowerView};class pe{constructor(t){this.bus=t}action(t){const e=`${t.ctrlKey||t.metaKey?"meta+":""}${t.keyCode}`;return xs[e]}move(t,e,s,a,r){return a?e===S.UpperView&&this.bus.canMoveUp(s)?(this.bus.moveUp(s,r),t):e===S.LowerView&&this.bus.canMoveDown(s)?(this.bus.moveDown(s,r),t):a.move(t,e):t}}const Is=i=>t=>Math.floor(t/i),Ts=i=>t=>t*i;class ii{constructor(t){this.dom=t,this.divideByMagnitude=null,this.powerByMagnitude=null,this.navigator=null,this.view=null,this.monthScrolled=!1,this.navScrolled=!1}configure(t){const e=Math.max(this.dom.viewHeight(t)/this.dom.navigationItemHeight,1);this.divideByMagnitude=Is(e),this.powerByMagnitude=Ts(e)}sync(t,e,s){if(!(!t||!e)){if(this.navigator=t,this.view=e,s.target===this.navigator.element){if(this.monthScrolled){this.monthScrolled=!1;return}this.navScrolled=!0,this.scrollSiblingOf(this.navigator.element)}if(s.target===this.view.element){if(this.navScrolled){this.navScrolled=!1;return}this.monthScrolled=!0,this.scrollSiblingOf(this.view.element)}}}scrollSiblingOf(t){const e=this.siblingComponent(t),s=this.calculateScroll(e,t.scrollTop);e.scrollTo(s)}siblingComponent(t){return this.navigator.element===t?this.view:this.navigator}calculateScroll(t,e){const s=t===this.navigator?this.divideByMagnitude:this.powerByMagnitude;return s?s(e):0}}class si{constructor(t){this.intl=t}getWeekNames(t=!1){const e=Ge(this.intl.dateFormatNames({nameType:"short",type:"days"}),this.intl.firstDay());return t?[""].concat(e):e}}const ni=i=>o.createElement("td",{key:i,className:"k-calendar-td"}," "),ai=class extends o.Component{constructor(){super(...arguments),this.intl=null,this.weekService=null,this.buildWeekNumber=(i,t)=>{if(!this.firstDate(i))return ni(`week-cell-${t}`);const s=this.firstDate(i),a=this.getWeekNumber(s),r=`kendo-react-calendar-week-cell-${a}`,h={className:"k-alt",value:a,firstDate:s};return this.props.weekCell?o.createElement(this.props.weekCell,{...h,key:r},a):o.createElement(Ke,{...h,key:r},a)},this.buildRow=i=>i.map((t,e)=>{if(!t)return ni(e);const s={"aria-selected":t.isSelected},a=`kendo-react-calendar-cell-${t.value.getTime()}`,r={...s,...t,isDisabled:!t.isInRange,view:this.props.activeView,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave};return this.props.cell?o.createElement(this.props.cell,{...r,key:a},t.formattedValue):o.createElement($e,{...r,key:a},t.formattedValue)}),this.firstDate=i=>{const t=this.firstWeekDateContext(i);return t?t.value:null},this.firstWeekDateContext=i=>{if(!this.weekNumber)return null;let t=0,e=i[t];for(;!e&&t<i.length;)e=i[++t];return e},this.handleClick=(i,t)=>{const{onChange:e}=this.props;if(e&&t){const s={value:l.cloneDate(i),target:this,nativeEvent:t&&t.nativeEvent,syntheticEvent:t};e.call(void 0,s)}},this.handleMouseEnter=i=>{const{onCellEnter:t}=this.props;t&&t.call(void 0,l.cloneDate(i))},this.handleMouseLeave=i=>{const{onCellLeave:t}=this.props;t&&t.call(void 0,l.cloneDate(i))}}get min(){return this.props.min}get max(){return this.props.max}get isHorizontal(){return this.props.direction==="horizontal"}get isMonthView(){return this.props.activeView===I.month}get weekNumber(){return!!(this.props.showWeekNumbers&&this.props.activeView===I.month)}get selectedDate(){return this.props.selectedDate!==void 0?this.props.selectedDate:ai.defaultProps.selectedDate}render(){this.intl=x.provideIntlService(this),this.weekService=new si(this.intl);const i=this.weekService.getWeekNames(this.weekNumber),t=this.props.service.rowLength(this.weekNumber),e=this.props.service.title(this.props.viewDate),s=z(),a=B(this.props.viewDate,s),r=this.props.service.data({cellUID:this.props.cellUID,min:this.min,max:this.max,focusedDate:this.props.focusedDate,isActiveView:!this.props.bus.canMoveDown(this.props.activeView),selectedDate:this.selectedDate,selectionRange:this.props.selectionRange,viewDate:a});return o.createElement(o.Fragment,null,this.isMonthView&&this.isHorizontal&&o.createElement("thead",{role:"rowgroup",className:"k-calendar-thead"},o.createElement("tr",{role:"row",className:"k-calendar-tr"},i.map((h,u)=>o.createElement("th",{key:u,className:"k-calendar-th"},h)))),o.createElement("tbody",{role:"rowgroup",className:"k-calendar-tbody"},!this.isHorizontal&&o.createElement("tr",{role:"presentation",className:"k-calendar-tr"},o.createElement("th",{scope:"col",colSpan:t,className:"k-calendar-caption"},e)),r.map((h,u)=>o.createElement("tr",{role:"row",className:"k-calendar-tr",key:u},this.weekNumber&&this.buildWeekNumber(h,u),this.buildRow(h)))))}getWeekNumber(i){return!this.weekNumber||!this.intl?null:l.weekInYear(i,this.intl.firstDay())}};let Ft=ai;Ft.propTypes={activeRangeEnd:n.oneOf(["start","end",null]),activeView:n.number.isRequired,cellUID:n.string.isRequired,direction:n.oneOf(["horizontal","vertical"]),focusedDate:n.instanceOf(Date).isRequired,max:n.instanceOf(Date).isRequired,min:n.instanceOf(Date).isRequired,onChange:n.func,selectedDate:n.oneOfType([n.instanceOf(Date),n.arrayOf(n.instanceOf(Date))]),showWeekNumbers:n.bool,viewDate:n.instanceOf(Date).isRequired},Ft.defaultProps={direction:"vertical",selectedDate:z(),showWeekNumbers:!1},x.registerForIntl(Ft);class ri extends o.PureComponent{render(){const{view:t,...e}=this.props;return o.createElement(F.Button,{type:"button",fillMode:"flat",...e},this.props.children)}}const $t=class extends o.Component{constructor(){super(...arguments),this.getTitle=()=>{if(!this.props.currentDate)return"";const i=this.rangeLength-1,t=this.props.service.title(this.props.currentDate),e=this.props.service.addToDate(this.props.currentDate,i);return i<1||!this.props.service.isInRange(e,this.min,this.max)?t:`${t} - ${this.props.service.title(e)}`},this.handleTitleClick=i=>{this.canMoveUp&&this.props.bus.moveUp(this.props.activeView,i)}}get min(){return this.props.min!==void 0?this.props.min:$t.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:$t.defaultProps.max}get rangeLength(){return this.props.rangeLength!==void 0?this.props.rangeLength:$t.defaultProps.rangeLength}get canMoveUp(){return this.props.bus.canMoveUp(this.props.activeView)}render(){const i=this.getTitle(),t=d.classNames("k-calendar-title"),e={children:i,value:i,view:this.props.activeView,className:t,onClick:this.handleTitleClick,disabled:!this.canMoveUp},s=this.props.headerTitle?o.createElement(this.props.headerTitle,{...e},i):o.createElement(ri,{...e},i);return o.createElement("div",{className:d.classNames("k-calendar-header",{"k-vstack":this.props.verticalView,"k-hstack":!this.props.verticalView})},s,o.createElement("span",{className:"k-spacer"}),o.createElement("span",{className:"k-calendar-nav k-hstack"},this.props.commands))}};let vt=$t;vt.propTypes={activeView:n.number.isRequired,currentDate:n.instanceOf(Date).isRequired,max:n.instanceOf(Date).isRequired,min:n.instanceOf(Date).isRequired,rangeLength:n.number},vt.defaultProps={rangeLength:1,min:it,max:st},x.registerForLocalization(vt);const me="multiviewcalendar.prevView",ge="multiviewcalendar.nextView",wt="dateinput.increment",bt="dateinput.decrement",Kt="calendar.today",jt="datepicker.toggleCalendar",yt="daterangepicker.swapStartEnd",Zt="daterangepicker.start",Gt="daterangepicker.end",Xt="daterangepicker.separator",St="datetimepicker.toggleDateTimeSelector",fe="timepicker.now",ve="timepicker.selectNow",Jt="timepicker.cancel",_t="timepicker.set",we="timepicker.toggleTimeSelector",Qt="timepicker.toggleClock",be="datetimepicker.date",ye="datetimepicker.time",Lt="datetimepicker.cancel",At="datetimepicker.set",Se="daterangepicker.cancel",De="daterangepicker.set",V={[Kt]:"TODAY",[fe]:"NOW",[_t]:"Set",[Jt]:"Cancel",[be]:"Date",[ye]:"Time",[Lt]:"Cancel",[At]:"Set",[Se]:"Cancel",[De]:"Set",[Zt]:"Start",[Gt]:"End",[Xt]:" ",[ve]:"Select Now",[we]:"Toggle TimeSelector",[Qt]:"Toggle Clock",[wt]:"Increase value",[bt]:"Decrease value",[jt]:"Toggle calendar",[me]:"Navigate to previous view",[ge]:"Navigate to next view",[yt]:"Swap start and end values",[St]:"Toggle date-time selector"},xe=class extends o.Component{constructor(){super(...arguments),this.localization=null,this.handleClick=i=>{if(this.todayIsInRange&&this.props.onClick){const t={syntheticEvent:i,nativeEvent:i.nativeEvent,value:U(z(),this.min,this.max),target:this,isTodayClick:!0};this.props.onClick.call(void 0,t)}}}get min(){return this.props.min!==void 0?this.props.min:xe.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:xe.defaultProps.max}get todayIsInRange(){return _(z(),l.getDate(this.min),l.getDate(this.max))}render(){this.localization=x.provideLocalizationService(this);const i=this.localization.toLanguageString(Kt,V[Kt]),t=d.classNames("k-calendar-nav-today",{"k-disabled":this.props.disabled});return o.createElement(F.Button,{className:t,onClick:this.handleClick,tabIndex:this.props.tabIndex,fillMode:"flat"},i)}};let Dt=xe;Dt.propTypes={max:n.instanceOf(Date).isRequired,min:n.instanceOf(Date).isRequired,onClick:n.func,disabled:n.bool},Dt.defaultProps={min:it,max:st},x.registerForLocalization(Dt);const Cs=5,oi=class extends o.Component{constructor(i){super(i),this.virtualization=null,this.calendarView=null,this.table=null,this.intl=null,this.bottomOffset=0,this.viewOffset=0,this.viewHeight=0,this._element=null,this.isActive=!1,this.animateToIndex=!0,this.shouldScroll=!1,this.focusActiveDate=()=>{if(!this._element)return;const t=this._element.querySelector("td.k-focus"),e=this._element.querySelector(".k-state-pending-focus");t&&t[0]&&t[0].classList.remove("k-focus"),e&&e.classList.add("k-focus"),this.isActive=!0},this.blurActiveDate=()=>{if(!this._element)return;const t=this._element.querySelector("td.k-focus");t&&t.classList.remove("k-focus"),this.isActive=!1},this.handleVirtualizationMount=t=>{if(this.virtualization=t,this.virtualization&&this.table){this.table.style.transform=`translateY(${this.viewOffset}px)`;const e=U(this.props.focusedDate,this.props.min,this.props.max),s=this.props.service.skip(e,this.props.min);this.virtualization.scrollToIndex(s)}},this.buildMonthView=(t,e)=>o.createElement("table",{key:"calendar-view-list-weekdays",className:"k-calendar-table k-calendar-weekdays",role:"grid",tabIndex:this.props.tabIndex},o.createElement("colgroup",null,t.map((s,a)=>o.createElement("col",{key:a}))),o.createElement("thead",{className:"k-calendar-thead"},o.createElement("tr",{className:"k-calendar-tr"},e.map((s,a)=>o.createElement("th",{key:a,className:"k-calendar-th"},s))))),this.buildDates=(t,e)=>{const s=this.props.cellUID;return o.createElement("table",{className:"k-calendar-table",ref:a=>this.table=a,role:"grid",tabIndex:this.props.tabIndex,"aria-activedescendant":s+this.props.focusedDate.getTime()},o.createElement("colgroup",null,t.map((a,r)=>o.createElement("col",{key:r}))),e.map(a=>o.createElement(Ft,{ref:r=>{this.calendarView||(this.calendarView=r)},key:a.getTime(),activeView:this.props.activeView,viewDate:a,min:this.props.min,max:this.props.max,cellUID:s,focusedDate:this.props.focusedDate,cell:this.props.cell,selectedDate:this.props.value,showWeekNumbers:this.weekNumber,onChange:this.handleDateChange,bus:this.props.bus,service:this.props.service,weekCell:this.props.weekCell})))},this.calculateHeights=()=>{if(!this.props.dom)return;const t=this.props.activeView===I.month?this.props.dom.scrollableContentHeight:this.props.dom.scrollableYearContentHeight;this.bottomOffset=t-this.props.dom.viewHeight(this.props.activeView),this.viewOffset=-1*this.props.dom.headerHeight,this.viewHeight=this.props.dom.viewHeight(this.props.activeView)||1},this.getTake=(t,e)=>Math.min(e-t,this.take),this.handleScrollAction=({index:t,scrollAction:e,pageAction:s})=>{const a=s?s.skip:this.state.skip;if((this.state.index!==t||this.state.skip!==a)&&this.setState({index:t,skip:a}),this.table&&e){const r=`translateY(${e.offset}px)`;this.table.style.transform=r}},this.handleTodayClick=t=>{this.shouldScroll=!0,this.handleDateChange.call(void 0,t,!0)},this.handleDateChange=(t,e=!1)=>{const{onChange:s}=this.props;if(s){const a={syntheticEvent:t.syntheticEvent,nativeEvent:t.nativeEvent,value:l.cloneDate(t.value),target:this,isTodayClick:e};s.call(void 0,a)}},this.lastView=this.props.activeView,this.lastFocus=this.props.focusedDate,this.state={skip:this.props.service.skip(this.props.focusedDate,this.props.min),index:this.props.service.skip(this.props.focusedDate,this.props.min)}}get element(){return this._element}get weekNames(){this.intl=x.provideIntlService(this);const i=Ge(this.intl.dateFormatNames({nameType:"short",type:"days"}),this.intl.firstDay());return this.weekNumber?[""].concat(i):i}get weekNumber(){return!!(this.props.showWeekNumbers&&this.props.activeView===I.month)}get take(){return this.props.take!==void 0?this.props.take:oi.defaultProps.take}get animate(){return!!(this.props.smoothScroll&&this.animateToIndex)}get todayIsInRange(){return _(z(),l.getDate(this.props.min),l.getDate(this.props.max))}componentDidUpdate(i,t){this.shouldScroll=!1,this.indexToScroll!==void 0&&this.virtualization&&this.virtualization[this.animate?"animateToIndex":"scrollToIndex"](this.indexToScroll),this.isActive&&this.focusActiveDate(),this.lastView=this.props.activeView,this.indexToScroll=void 0}render(){this.calculateHeights();const i=this.lastView!==this.props.activeView,t=U(this.props.focusedDate,this.props.min,this.props.max),e=i?this.props.service.skip(t,this.props.min):this.state.skip,s=this.props.service.total(this.props.min,this.props.max),a=this.getTake(e,s),r=this.props.service.addToDate(this.props.min,e),h=this.props.service.addToDate(this.props.min,this.state.index),u=new Array(this.props.service.rowLength(this.weekNumber)).fill(""),c=this.props.activeView!==this.lastView;this.animateToIndex=!c,(c||!l.isEqualDate(this.lastFocus,t)||this.shouldScroll||!this.props.shouldScroll||this.props.shouldScroll())&&(this.indexToScroll=this.props.service.skip(t,this.props.min)),this.lastFocus=t;const p=d.classNames("k-calendar-view k-vstack",{"k-calendar-monthview":this.props.activeView===I.month,"k-calendar-yearview":this.props.activeView===I.year,"k-calendar-decadeview":this.props.activeView===I.decade,"k-calendar-centuryview":this.props.activeView===I.century}),m=this.buildDates(u,this.props.service.datesList(r,a)),f=o.createElement(o.Fragment,null,o.createElement(vt,{key:"calendar-view-list-header",currentDate:h,min:this.props.min,max:this.props.max,activeView:this.props.activeView,bus:this.props.bus,service:this.props.service,headerTitle:this.props.headerTitle,commands:o.createElement(o.Fragment,null,o.createElement(Dt,{min:this.props.min,max:this.props.max,onClick:this.handleTodayClick,disabled:!this.todayIsInRange,tabIndex:this.props.tabIndex}))}),this.props.activeView===I.month&&this.buildMonthView(u,this.weekNames),o.createElement(ft,{key:"calendar-view-list-content",skip:e,take:this.take,total:s,itemHeight:this.viewHeight,topOffset:this.viewOffset,bottomOffset:this.bottomOffset,scrollOffsetSize:this.viewOffset,maxScrollDifference:this.viewHeight,onScroll:this.props.onScroll,onScrollAction:this.handleScrollAction,onMount:this.handleVirtualizationMount,children:m,tabIndex:this.props.tabIndex}));return o.createElement("div",{ref:v=>{this._element=v},className:p},this.props.dom.didCalculate?f:null)}};let Ht=oi;Ht.propTypes={activeView:n.number.isRequired,bottomOffset:n.number,cellUID:n.string.isRequired,focusedDate:n.instanceOf(Date).isRequired,max:n.instanceOf(Date).isRequired,min:n.instanceOf(Date).isRequired,onChange:n.func,showWeekNumbers:n.bool,smoothScroll:n.bool,take:n.number,value:n.instanceOf(Date),viewHeight:n.number,viewOffset:n.number,tabIndex:n.number},Ht.defaultProps={take:Cs,showWeekNumbers:!1,smoothScroll:!0},x.registerForIntl(Ht);class li extends o.Component{constructor(){super(...arguments),this.handleClick=t=>{const{onClick:e,value:s}=this.props;e&&e.call(void 0,s,t)}}render(){const{isRangeStart:t,value:e,text:s,...a}=this.props;return o.createElement("li",{...a,onClick:this.handleClick},o.createElement("span",{className:d.classNames({"k-calendar-navigation-marker":t})},this.props.children))}}const Es=30,hi=class extends o.Component{constructor(i){super(i),this.virtualization=null,this.list=null,this.itemHeight=0,this.topOffset=0,this.maxViewHeight=0,this.bottomOffset=0,this.handleVirtualizationMount=s=>{if(this.virtualization=s,this.virtualization&&this.list){this.list.style.transform=`translateY(${this.topOffset}px)`;const a=U(this.props.focusedDate,this.props.min,this.props.max),r=this.props.service.skip(a,this.props.min);this.virtualization.scrollToIndex(r)}},this.buildNavigationItem=s=>{const a=this.props.service.navigationTitle(s),r=this.props.service.isRangeStart(s),h=`kendo-react-calendar-nav-item-${s.getTime()}`,u={text:a,value:s,isRangeStart:r,view:this.props.activeView,onClick:this.handleDateChange};return this.props.navigationItem?o.createElement(this.props.navigationItem,{...u,key:h},a):o.createElement(li,{...u,key:h},a)},this.calculateHeights=()=>{const s=this.props.dom.calendarHeight;this.itemHeight=this.props.dom.navigationItemHeight||1,this.maxViewHeight=this.props.dom.monthViewHeight,this.topOffset=(s-this.itemHeight)/2,this.bottomOffset=s-this.itemHeight},this.handleDateChange=(s,a)=>{const{onChange:r}=this.props;if(r&&a){const h={value:l.cloneDate(s),target:this,nativeEvent:a&&a.nativeEvent,syntheticEvent:a};r.call(void 0,h)}},this.handleScrollAction=({scrollAction:s,pageAction:a})=>{const r=a?a.skip:this.state.skip;if(this.state.skip!==r&&this.setState({skip:r}),this.list&&s){const h=`translateY(${s.offset}px)`;this.list.style.transform=h}},this.lastView=this.props.activeView,this.lastFocus=this.props.focusedDate;const t=this.props.service.skip(this.props.focusedDate,this.props.min),e=this.props.service.total(this.props.min,this.props.max);this.state={skip:t-this.getTake(t,e)>0?t:0}}get take(){return this.props.take!==void 0?this.props.take:hi.defaultProps.take}componentDidUpdate(i,t){this.indexToScroll!==void 0&&this.virtualization&&this.virtualization.scrollToIndex(this.indexToScroll),this.lastView=this.props.activeView,this.lastFocus=this.props.focusedDate,this.indexToScroll=void 0}render(){this.calculateHeights();const i=this.lastView!==this.props.activeView,t=U(this.props.focusedDate,this.props.min,this.props.max),e=i?this.props.service.skip(t,this.props.min):this.state.skip,s=this.props.service.total(this.props.min,this.props.max),a=this.getTake(e,s),r=this.props.service.addToDate(this.props.min,e),h=this.props.service.datesList(r,a);(this.props.activeView!==this.lastView||!l.isEqual(t,this.lastFocus))&&(this.indexToScroll=this.props.service.skip(t,this.props.min));const u=o.createElement(ft,{skip:e,take:this.take,total:s,itemHeight:this.itemHeight,topOffset:this.topOffset,bottomOffset:this.bottomOffset,onScroll:this.props.onScroll,maxScrollDifference:this.maxViewHeight,onScrollAction:this.handleScrollAction,onMount:this.handleVirtualizationMount,tabIndex:this.props.tabIndex},o.createElement("ul",{ref:c=>{this.list=c},className:"k-reset"},h.map(c=>this.buildNavigationItem(c))));return o.createElement("div",{className:"k-calendar-navigation"},o.createElement("span",{className:"k-calendar-navigation-highlight"}),this.props.dom.didCalculate?u:null)}getTake(i,t){return Math.min(t-i,this.take)}};let Ie=hi;Ie.propTypes={activeView:n.number.isRequired,focusedDate:n.instanceOf(Date).isRequired,max:n.instanceOf(Date).isRequired,min:n.instanceOf(Date).isRequired,onChange:n.func,take:n.number,tabIndex:n.number},Ie.defaultProps={take:Es};const Te=i=>i?i.virtualization:null,ci=(i=rt.defaultProps.min,t=rt.defaultProps.max,e,s)=>s!==void 0?s!==null&&_(l.getDate(s),i,t)?s:null:e!==null&&_(l.getDate(e),i,t)?e:null,at=class extends o.Component{constructor(i){super(i),this.scrollSyncService=null,this.focusedDate=null,this.cellUID=d.guid(),this.id=d.guid(),this.Navigation=null,this.calendarViewList=null,this._element=null,this.intl=null,this.service=null,this.isActive=!1,this.didNavigationChange=!1,this.focus=()=>{this._element&&this._element.focus()},this.shouldScroll=()=>this.didNavigationChange,this.handleScroll=e=>{this.scrollSyncService&&this.scrollSyncService.sync(Te(this.Navigation),Te(this.calendarViewList),e)},this.handleNavigationChange=e=>{if(this.props.disabled)return;this.didNavigationChange=!0;const s=l.cloneDate(e.value);this.setState({focusedDate:s})},this.handleViewChange=({view:e})=>{this.scrollSyncService&&this.scrollSyncService.configure(e),this.setState({activeView:e})},this.handleDateChange=e=>{const s=l.cloneDate(e.value),a=l.cloneDate(e.value),r=this.bus.canMoveDown(this.state.activeView);if(this.props.disabled)return;if(r)if(e.isTodayClick)this.bus.moveToBottom(this.state.activeView);else{this.bus.moveDown(this.state.activeView,e.syntheticEvent),this.setState({focusedDate:a});return}this.setState({value:s,focusedDate:a}),this.valueDuringOnChange=s;const{onChange:h}=this.props;if(h){const u={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:s,target:this};h.call(void 0,u)}this.valueDuringOnChange=void 0},this.handleFocus=e=>{if(this.isActive=!0,!this.calendarViewList)return;this.calendarViewList.focusActiveDate();const{onFocus:s}=this.props;s&&s.call(void 0,e)},this.handleBlur=e=>{if(this.isActive=!1,!this.calendarViewList)return;this.calendarViewList.blurActiveDate();const{onBlur:s}=this.props;s&&s.call(void 0,e)},this.handleKeyDown=e=>{const{keyCode:s}=e;if(!(!this.focusedDate||!this.service)){if(s===d.Keys.enter){if(this.value!==null&&l.isEqualDate(this.focusedDate,this.value)){const r=U(this.focusedDate,this.min,this.max);Te(this.calendarViewList).scrollToIndex(this.service.skip(r,this.min))}const a={syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.focusedDate,target:this};this.handleDateChange(a)}else{const a=U(this.navigation.move(this.focusedDate,this.navigation.action(e),this.state.activeView,this.service,e),this.min,this.max);if(l.isEqualDate(this.focusedDate,a))return;this.setState({focusedDate:a})}e.preventDefault()}},this.handleMouseDown=e=>{e.preventDefault()},this.handleClick=e=>{this._element&&this._element.focus({preventScroll:!0})},d.validatePackage(gt);const t=ci(this.min,this.max,this.props.defaultValue||at.defaultProps.defaultValue,this.props.value);this.state={value:t,activeView:Ut(I[i.defaultActiveView],this.bottomView,this.topView),focusedDate:U(i.focusedDate||t||z(),this.min,this.max)},this.dom=new ei,this.bus=new de(this.handleViewChange),this.navigation=new pe(this.bus),this.oldValue=t}get element(){return this._element}get value(){return this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value}get min(){return l.getDate(this.props.min!==void 0?this.props.min:at.defaultProps.min)}get max(){return l.getDate(this.props.max!==void 0?this.props.max:at.defaultProps.max)}get bottomView(){return I[this.props.bottomView!==void 0?this.props.bottomView:at.defaultProps.bottomView]}get topView(){return I[this.props.topView!==void 0?this.props.topView:at.defaultProps.topView]}componentDidMount(){Promise.resolve().then(()=>{d.setScrollbarWidth(),this._element&&(this.dom.calculateHeights(this._element),this.scrollSyncService=new ii(this.dom),this.scrollSyncService.configure(this.state.activeView),this.forceUpdate())})}componentDidUpdate(i,t){d.setScrollbarWidth(),t.activeView!==this.state.activeView&&this.scrollSyncService&&this.scrollSyncService.configure(this.state.activeView),this.calendarViewList&&(this.isActive?this.calendarViewList.focusActiveDate:this.calendarViewList.blurActiveDate)(),this.didNavigationChange=!1,this.oldValue=this.value}render(){this.props._ref&&this.props._ref(this);const i=this.value!==null&&this.oldValue!==null?!l.isEqualDate(this.value,this.oldValue):this.value!==this.oldValue,t=Ut(this.state.activeView,I[this.props.bottomView!==void 0?this.props.bottomView:at.defaultProps.bottomView],I[this.props.topView!==void 0?this.props.topView:at.defaultProps.topView]),e=ci(this.min,this.max,this.value,this.value),s=e?l.getDate(e):null;this.focusedDate=l.getDate(U(i&&e!==null?e:this.state.focusedDate,this.min,this.max)),this.intl=x.provideIntlService(this),this.bus.configure(this.bottomView,this.topView),this.service=this.bus.service(t,this.intl);const{smoothScroll:a=Number.parseFloat(o.version)<18}=this.props,r=d.classNames("k-widget k-calendar k-calendar-infinite",{"k-disabled":this.props.disabled,"k-week-number":this.props.weekNumber,"k-calendar-lg":this.props.mobileMode},this.props.className),h=[this.props.navigation&&o.createElement(Ie,{key:0,ref:u=>{this.Navigation=u},activeView:this.state.activeView,focusedDate:this.focusedDate,min:this.min,max:this.max,onScroll:this.handleScroll,onChange:this.handleNavigationChange,service:this.service,dom:this.dom,navigationItem:this.props.navigationItem,tabIndex:this.props.tabIndex}),o.createElement(Ht,{key:1,ref:u=>{this.calendarViewList=u},activeView:this.state.activeView,focusedDate:this.focusedDate,min:this.min,max:this.max,bus:this.bus,shouldScroll:this.shouldScroll,onScroll:this.handleScroll,service:this.service,cell:this.props.cell,weekCell:this.props.weekCell,dom:this.dom,smoothScroll:a,showWeekNumbers:this.props.weekNumber,onChange:this.handleDateChange,value:s,cellUID:this.cellUID,headerTitle:this.props.headerTitle,tabIndex:this.props.tabIndex})];return o.createElement("div",{ref:u=>{this._element=u},className:r,id:this.props.id||this.id,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,"aria-disabled":this.props.disabled,tabIndex:this.props.disabled?void 0:this.props.tabIndex||0,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,onMouseDown:this.handleMouseDown,onClick:this.handleClick},h)}};let rt=at;rt.displayName="Calendar",rt.propTypes={className:n.string,defaultActiveView:n.oneOf(["month","year","decade","century"]),defaultValue:n.instanceOf(Date),disabled:n.bool,focusedDate:n.instanceOf(Date),id:n.string,ariaLabelledBy:n.string,ariaDescribedBy:n.string,max:n.instanceOf(Date),min:n.instanceOf(Date),navigation:n.bool,smoothScroll:n.bool,onBlur:n.func,onChange:n.func,onFocus:n.func,tabIndex:n.number,value:n.instanceOf(Date),weekNumber:n.bool,topView:(i,t,e)=>{const s=i[t],a=i.bottomView;return s&&a&&I[s]<I[a]?new Error(`Invalid prop + ${t} suplied to ${e}.
11
+ `,"k-calendar-header k-hstack"),v=()=>m([p([u([h("MO","k-calendar-th")],"k-calendar-tr")],"k-calendar-thead")],"k-calendar-table k-calendar-weekdays"),w=(D,L)=>new Array(D).fill("1").map(L),T=(D,L=1)=>m([c([u([r("1","k-calendar-td k-alt")])].concat(w(D,()=>u(w(L,Nt=>r(`<span class="k-link">${Nt}</span>`,"k-calendar-td")),"k-calendar-tr"))),"k-calendar-tbody")],"k-calendar-table"),E=D=>e(D,"k-content k-scrollable"),V=(D,L,Nt)=>e(Nt?[f(),v(),E([D,D])]:[f(),E([D,D])],L,{left:"-10000px",position:"absolute"}),y=(()=>{let D;return()=>d.canUseDOM?(D||(D=e([E([s([a("<span>FEB</span>")])])],"k-calendar-navigation",{left:"0px",position:"absolute"})),D):null})(),P=({cells:D,rows:L},Nt,fn)=>{let We;return()=>d.canUseDOM?(We||(We=V(T(L,D),Nt,fn)),We):null},b=D=>D.querySelector(".k-scrollable"),R=D=>{const L=b(D);return L.className=`${L.className} k-scrollable-horizontal`,D},k=P({cells:7,rows:6},"k-calendar-view k-calendar-monthview k-vstack",!0),M=P({cells:5,rows:3},"k-calendar-view k-calendar-yearview",!1),W=P({cells:5,rows:2},"k-calendar-view k-calendar-decadeview",!1),C=()=>R(k()),N=()=>R(M()),tt=()=>R(W()),G=D=>parseFloat(window.getComputedStyle(D).height)||D.offsetHeight,mt=D=>{const L=window.getComputedStyle(D);return parseFloat(L.width)+parseFloat(L.paddingLeft)+parseFloat(L.paddingRight)||D.offsetWidth},kt=D=>D.querySelector("tbody");this.didCalculate=!0,t&&(this.hostContainer=t),this.batch(k(),D=>{const L=kt(D);this.calendarHeight=G(D),this.monthViewHeight=G(L),this.headerHeight=G(L.children[0]),this.scrollableContentHeight=G(b(D))}),this.batch(C(),D=>{const L=kt(D);this.calendarWidth=mt(D),this.monthViewWidth=mt(L),this.scrollableContentWidth=mt(b(D))}),this.batch(M(),D=>{this.yearViewHeight=G(kt(D)),this.scrollableYearContentHeight=G(b(D))}),this.batch(N(),D=>{this.yearViewWidth=mt(kt(D))}),this.batch(W(),D=>{this.decadeViewHeight=G(kt(D)),this.centuryViewHeight=this.decadeViewHeight}),this.batch(tt(),D=>{this.decadeViewWidth=mt(kt(D)),this.centuryViewWidth=this.decadeViewWidth}),this.batch(y(),D=>{this.navigationItemHeight=G(D.querySelector("li"))})}viewHeight(t){return this.viewDimension(t,"height")}viewWidth(t){return this.viewDimension(t,"width")}viewDimension(t,e){const s=e==="height"?"ViewHeight":"ViewWidth";switch(t){case x.month:return this[`month${s}`];case x.year:return this[`year${s}`];case x.decade:return this[`decade${s}`];case x.century:return this[`century${s}`];default:return 1}}batch(t,e){const s=this.hostContainer||document.body,a=s.appendChild(t);e(a),s.removeChild(a)}};const Is={33:S.PrevView,34:S.NextView,35:S.LastInView,36:S.FirstInView,37:S.Left,38:S.Up,39:S.Right,40:S.Down,"meta+38":S.UpperView,"meta+40":S.LowerView};class pe{constructor(t){this.bus=t}action(t){const e=`${t.ctrlKey||t.metaKey?"meta+":""}${t.keyCode}`;return Is[e]}move(t,e,s,a,r){return a?e===S.UpperView&&this.bus.canMoveUp(s)?(this.bus.moveUp(s,r),t):e===S.LowerView&&this.bus.canMoveDown(s)?(this.bus.moveDown(s,r),t):a.move(t,e):t}}const xs=i=>t=>Math.floor(t/i),Ts=i=>t=>t*i;class ii{constructor(t){this.dom=t,this.divideByMagnitude=null,this.powerByMagnitude=null,this.navigator=null,this.view=null,this.monthScrolled=!1,this.navScrolled=!1}configure(t){const e=Math.max(this.dom.viewHeight(t)/this.dom.navigationItemHeight,1);this.divideByMagnitude=xs(e),this.powerByMagnitude=Ts(e)}sync(t,e,s){if(!(!t||!e)){if(this.navigator=t,this.view=e,s.target===this.navigator.element){if(this.monthScrolled){this.monthScrolled=!1;return}this.navScrolled=!0,this.scrollSiblingOf(this.navigator.element)}if(s.target===this.view.element){if(this.navScrolled){this.navScrolled=!1;return}this.monthScrolled=!0,this.scrollSiblingOf(this.view.element)}}}scrollSiblingOf(t){const e=this.siblingComponent(t),s=this.calculateScroll(e,t.scrollTop);e.scrollTo(s)}siblingComponent(t){return this.navigator.element===t?this.view:this.navigator}calculateScroll(t,e){const s=t===this.navigator?this.divideByMagnitude:this.powerByMagnitude;return s?s(e):0}}class si{constructor(t){this.intl=t}getWeekNames(t=!1){const e=Ge(this.intl.dateFormatNames({nameType:"short",type:"days"}),this.intl.firstDay());return t?[""].concat(e):e}}const ni=i=>o.createElement("td",{key:i,className:"k-calendar-td"}," "),ai=class extends o.Component{constructor(){super(...arguments),this.intl=null,this.weekService=null,this.buildWeekNumber=(i,t)=>{if(!this.firstDate(i))return ni(`week-cell-${t}`);const s=this.firstDate(i),a=this.getWeekNumber(s),r=`kendo-react-calendar-week-cell-${a}`,h={className:"k-alt",value:a,firstDate:s};return this.props.weekCell?o.createElement(this.props.weekCell,{...h,key:r},a):o.createElement(Ke,{...h,key:r},a)},this.buildRow=i=>i.map((t,e)=>{if(!t)return ni(e);const s={"aria-selected":t.isSelected},a=`kendo-react-calendar-cell-${t.value.getTime()}`,r={...s,...t,isDisabled:!t.isInRange,view:this.props.activeView,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave};return this.props.cell?o.createElement(this.props.cell,{...r,key:a},t.formattedValue):o.createElement($e,{...r,key:a},t.formattedValue)}),this.firstDate=i=>{const t=this.firstWeekDateContext(i);return t?t.value:null},this.firstWeekDateContext=i=>{if(!this.weekNumber)return null;let t=0,e=i[t];for(;!e&&t<i.length;)e=i[++t];return e},this.handleClick=(i,t)=>{const{onChange:e}=this.props;if(e&&t){const s={value:l.cloneDate(i),target:this,nativeEvent:t&&t.nativeEvent,syntheticEvent:t};e.call(void 0,s)}},this.handleMouseEnter=i=>{const{onCellEnter:t}=this.props;t&&t.call(void 0,l.cloneDate(i))},this.handleMouseLeave=i=>{const{onCellLeave:t}=this.props;t&&t.call(void 0,l.cloneDate(i))}}get min(){return this.props.min}get max(){return this.props.max}get isHorizontal(){return this.props.direction==="horizontal"}get isMonthView(){return this.props.activeView===x.month}get weekNumber(){return!!(this.props.showWeekNumbers&&this.props.activeView===x.month)}get selectedDate(){return this.props.selectedDate!==void 0?this.props.selectedDate:ai.defaultProps.selectedDate}render(){this.intl=I.provideIntlService(this),this.weekService=new si(this.intl);const i=this.weekService.getWeekNames(this.weekNumber),t=this.props.service.rowLength(this.weekNumber),e=this.props.service.title(this.props.viewDate),s=z(),a=B(this.props.viewDate,s),r=this.props.service.data({cellUID:this.props.cellUID,min:this.min,max:this.max,focusedDate:this.props.focusedDate,isActiveView:!this.props.bus.canMoveDown(this.props.activeView),selectedDate:this.selectedDate,selectionRange:this.props.selectionRange,viewDate:a});return o.createElement(o.Fragment,null,this.isMonthView&&this.isHorizontal&&o.createElement("thead",{role:"rowgroup",className:"k-calendar-thead"},o.createElement("tr",{role:"row",className:"k-calendar-tr"},i.map((h,u)=>o.createElement("th",{key:u,className:"k-calendar-th"},h)))),o.createElement("tbody",{role:"rowgroup",className:"k-calendar-tbody"},!this.isHorizontal&&o.createElement("tr",{role:"presentation",className:"k-calendar-tr"},o.createElement("th",{scope:"col",colSpan:t,className:"k-calendar-caption"},e)),r.map((h,u)=>o.createElement("tr",{role:"row",className:"k-calendar-tr",key:u},this.weekNumber&&this.buildWeekNumber(h,u),this.buildRow(h)))))}getWeekNumber(i){return!this.weekNumber||!this.intl?null:l.weekInYear(i,this.intl.firstDay())}};let Ft=ai;Ft.propTypes={activeRangeEnd:n.oneOf(["start","end",null]),activeView:n.number.isRequired,cellUID:n.string.isRequired,direction:n.oneOf(["horizontal","vertical"]),focusedDate:n.instanceOf(Date).isRequired,max:n.instanceOf(Date).isRequired,min:n.instanceOf(Date).isRequired,onChange:n.func,selectedDate:n.oneOfType([n.instanceOf(Date),n.arrayOf(n.instanceOf(Date))]),showWeekNumbers:n.bool,viewDate:n.instanceOf(Date).isRequired},Ft.defaultProps={direction:"vertical",selectedDate:z(),showWeekNumbers:!1},I.registerForIntl(Ft);class ri extends o.PureComponent{render(){const{view:t,...e}=this.props;return o.createElement(F.Button,{type:"button",fillMode:"flat",...e},this.props.children)}}const $t=class extends o.Component{constructor(){super(...arguments),this.getTitle=()=>{if(!this.props.currentDate)return"";const i=this.rangeLength-1,t=this.props.service.title(this.props.currentDate),e=this.props.service.addToDate(this.props.currentDate,i);return i<1||!this.props.service.isInRange(e,this.min,this.max)?t:`${t} - ${this.props.service.title(e)}`},this.handleTitleClick=i=>{this.canMoveUp&&this.props.bus.moveUp(this.props.activeView,i)}}get min(){return this.props.min!==void 0?this.props.min:$t.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:$t.defaultProps.max}get rangeLength(){return this.props.rangeLength!==void 0?this.props.rangeLength:$t.defaultProps.rangeLength}get canMoveUp(){return this.props.bus.canMoveUp(this.props.activeView)}render(){const i=this.getTitle(),t=d.classNames("k-calendar-title"),e={children:i,value:i,view:this.props.activeView,className:t,onClick:this.handleTitleClick,disabled:!this.canMoveUp},s=this.props.headerTitle?o.createElement(this.props.headerTitle,{...e},i):o.createElement(ri,{...e},i);return o.createElement("div",{className:d.classNames("k-calendar-header",{"k-vstack":this.props.verticalView,"k-hstack":!this.props.verticalView})},s,o.createElement("span",{className:"k-spacer"}),o.createElement("span",{className:"k-calendar-nav k-hstack"},this.props.commands))}};let vt=$t;vt.propTypes={activeView:n.number.isRequired,currentDate:n.instanceOf(Date).isRequired,max:n.instanceOf(Date).isRequired,min:n.instanceOf(Date).isRequired,rangeLength:n.number},vt.defaultProps={rangeLength:1,min:it,max:st},I.registerForLocalization(vt);const me="multiviewcalendar.prevView",ge="multiviewcalendar.nextView",wt="dateinput.increment",bt="dateinput.decrement",Kt="calendar.today",jt="datepicker.toggleCalendar",yt="daterangepicker.swapStartEnd",Zt="daterangepicker.start",Gt="daterangepicker.end",Xt="daterangepicker.separator",St="datetimepicker.toggleDateTimeSelector",fe="timepicker.now",ve="timepicker.selectNow",Jt="timepicker.cancel",_t="timepicker.set",we="timepicker.toggleTimeSelector",Qt="timepicker.toggleClock",be="datetimepicker.date",ye="datetimepicker.time",Lt="datetimepicker.cancel",Ht="datetimepicker.set",Se="daterangepicker.cancel",De="daterangepicker.set",O={[Kt]:"TODAY",[fe]:"NOW",[_t]:"Set",[Jt]:"Cancel",[be]:"Date",[ye]:"Time",[Lt]:"Cancel",[Ht]:"Set",[Se]:"Cancel",[De]:"Set",[Zt]:"Start",[Gt]:"End",[Xt]:" ",[ve]:"Select Now",[we]:"Toggle TimeSelector",[Qt]:"Toggle Clock",[wt]:"Increase value",[bt]:"Decrease value",[jt]:"Toggle calendar",[me]:"Navigate to previous view",[ge]:"Navigate to next view",[yt]:"Swap start and end values",[St]:"Toggle date-time selector"},Ie=class extends o.Component{constructor(){super(...arguments),this.localization=null,this.handleClick=i=>{if(this.todayIsInRange&&this.props.onClick){const t={syntheticEvent:i,nativeEvent:i.nativeEvent,value:U(z(),this.min,this.max),target:this,isTodayClick:!0};this.props.onClick.call(void 0,t)}}}get min(){return this.props.min!==void 0?this.props.min:Ie.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:Ie.defaultProps.max}get todayIsInRange(){return _(z(),l.getDate(this.min),l.getDate(this.max))}render(){this.localization=I.provideLocalizationService(this);const i=this.localization.toLanguageString(Kt,O[Kt]),t=d.classNames("k-calendar-nav-today",{"k-disabled":this.props.disabled});return o.createElement(F.Button,{className:t,onClick:this.handleClick,tabIndex:this.props.tabIndex,fillMode:"flat"},i)}};let Dt=Ie;Dt.propTypes={max:n.instanceOf(Date).isRequired,min:n.instanceOf(Date).isRequired,onClick:n.func,disabled:n.bool},Dt.defaultProps={min:it,max:st},I.registerForLocalization(Dt);const Cs=5,oi=class extends o.Component{constructor(i){super(i),this.virtualization=null,this.calendarView=null,this.table=null,this.intl=null,this.bottomOffset=0,this.viewOffset=0,this.viewHeight=0,this._element=null,this.isActive=!1,this.animateToIndex=!0,this.shouldScroll=!1,this.focusActiveDate=()=>{if(!this._element)return;const t=this._element.querySelector("td.k-focus"),e=this._element.querySelector(".k-state-pending-focus");t&&t[0]&&t[0].classList.remove("k-focus"),e&&e.classList.add("k-focus"),this.isActive=!0},this.blurActiveDate=()=>{if(!this._element)return;const t=this._element.querySelector("td.k-focus");t&&t.classList.remove("k-focus"),this.isActive=!1},this.handleVirtualizationMount=t=>{if(this.virtualization=t,this.virtualization&&this.table){this.table.style.transform=`translateY(${this.viewOffset}px)`;const e=U(this.props.focusedDate,this.props.min,this.props.max),s=this.props.service.skip(e,this.props.min);this.virtualization.scrollToIndex(s)}},this.buildMonthView=(t,e)=>o.createElement("table",{key:"calendar-view-list-weekdays",className:"k-calendar-table k-calendar-weekdays",role:"grid",tabIndex:this.props.tabIndex},o.createElement("colgroup",null,t.map((s,a)=>o.createElement("col",{key:a}))),o.createElement("thead",{className:"k-calendar-thead"},o.createElement("tr",{className:"k-calendar-tr"},e.map((s,a)=>o.createElement("th",{key:a,className:"k-calendar-th"},s))))),this.buildDates=(t,e)=>{const s=this.props.cellUID;return o.createElement("table",{className:"k-calendar-table",ref:a=>this.table=a,role:"grid",tabIndex:this.props.tabIndex,"aria-activedescendant":s+this.props.focusedDate.getTime()},o.createElement("colgroup",null,t.map((a,r)=>o.createElement("col",{key:r}))),e.map(a=>o.createElement(Ft,{ref:r=>{this.calendarView||(this.calendarView=r)},key:a.getTime(),activeView:this.props.activeView,viewDate:a,min:this.props.min,max:this.props.max,cellUID:s,focusedDate:this.props.focusedDate,cell:this.props.cell,selectedDate:this.props.value,showWeekNumbers:this.weekNumber,onChange:this.handleDateChange,bus:this.props.bus,service:this.props.service,weekCell:this.props.weekCell})))},this.calculateHeights=()=>{if(!this.props.dom)return;const t=this.props.activeView===x.month?this.props.dom.scrollableContentHeight:this.props.dom.scrollableYearContentHeight;this.bottomOffset=t-this.props.dom.viewHeight(this.props.activeView),this.viewOffset=-1*this.props.dom.headerHeight,this.viewHeight=this.props.dom.viewHeight(this.props.activeView)||1},this.getTake=(t,e)=>Math.min(e-t,this.take),this.handleScrollAction=({index:t,scrollAction:e,pageAction:s})=>{const a=s?s.skip:this.state.skip;if((this.state.index!==t||this.state.skip!==a)&&this.setState({index:t,skip:a}),this.table&&e){const r=`translateY(${e.offset}px)`;this.table.style.transform=r}},this.handleTodayClick=t=>{this.shouldScroll=!0,this.handleDateChange.call(void 0,t,!0)},this.handleDateChange=(t,e=!1)=>{const{onChange:s}=this.props;if(s){const a={syntheticEvent:t.syntheticEvent,nativeEvent:t.nativeEvent,value:l.cloneDate(t.value),target:this,isTodayClick:e};s.call(void 0,a)}},this.lastView=this.props.activeView,this.lastFocus=this.props.focusedDate,this.state={skip:this.props.service.skip(this.props.focusedDate,this.props.min),index:this.props.service.skip(this.props.focusedDate,this.props.min)}}get element(){return this._element}get weekNames(){this.intl=I.provideIntlService(this);const i=Ge(this.intl.dateFormatNames({nameType:"short",type:"days"}),this.intl.firstDay());return this.weekNumber?[""].concat(i):i}get weekNumber(){return!!(this.props.showWeekNumbers&&this.props.activeView===x.month)}get take(){return this.props.take!==void 0?this.props.take:oi.defaultProps.take}get animate(){return!!(this.props.smoothScroll&&this.animateToIndex)}get todayIsInRange(){return _(z(),l.getDate(this.props.min),l.getDate(this.props.max))}componentDidUpdate(i,t){this.shouldScroll=!1,this.indexToScroll!==void 0&&this.virtualization&&this.virtualization[this.animate?"animateToIndex":"scrollToIndex"](this.indexToScroll),this.isActive&&this.focusActiveDate(),this.lastView=this.props.activeView,this.indexToScroll=void 0}render(){this.calculateHeights();const i=this.lastView!==this.props.activeView,t=U(this.props.focusedDate,this.props.min,this.props.max),e=i?this.props.service.skip(t,this.props.min):this.state.skip,s=this.props.service.total(this.props.min,this.props.max),a=this.getTake(e,s),r=this.props.service.addToDate(this.props.min,e),h=this.props.service.addToDate(this.props.min,this.state.index),u=new Array(this.props.service.rowLength(this.weekNumber)).fill(""),c=this.props.activeView!==this.lastView;this.animateToIndex=!c,(c||!l.isEqualDate(this.lastFocus,t)||this.shouldScroll||!this.props.shouldScroll||this.props.shouldScroll())&&(this.indexToScroll=this.props.service.skip(t,this.props.min)),this.lastFocus=t;const p=d.classNames("k-calendar-view k-vstack",{"k-calendar-monthview":this.props.activeView===x.month,"k-calendar-yearview":this.props.activeView===x.year,"k-calendar-decadeview":this.props.activeView===x.decade,"k-calendar-centuryview":this.props.activeView===x.century}),m=this.buildDates(u,this.props.service.datesList(r,a)),f=o.createElement(o.Fragment,null,o.createElement(vt,{key:"calendar-view-list-header",currentDate:h,min:this.props.min,max:this.props.max,activeView:this.props.activeView,bus:this.props.bus,service:this.props.service,headerTitle:this.props.headerTitle,commands:o.createElement(o.Fragment,null,o.createElement(Dt,{min:this.props.min,max:this.props.max,onClick:this.handleTodayClick,disabled:!this.todayIsInRange,tabIndex:this.props.tabIndex}))}),this.props.activeView===x.month&&this.buildMonthView(u,this.weekNames),o.createElement(ft,{key:"calendar-view-list-content",skip:e,take:this.take,total:s,itemHeight:this.viewHeight,topOffset:this.viewOffset,bottomOffset:this.bottomOffset,scrollOffsetSize:this.viewOffset,maxScrollDifference:this.viewHeight,onScroll:this.props.onScroll,onScrollAction:this.handleScrollAction,onMount:this.handleVirtualizationMount,children:m,tabIndex:this.props.tabIndex}));return o.createElement("div",{ref:v=>{this._element=v},className:p},this.props.dom.didCalculate?f:null)}};let At=oi;At.propTypes={activeView:n.number.isRequired,bottomOffset:n.number,cellUID:n.string.isRequired,focusedDate:n.instanceOf(Date).isRequired,max:n.instanceOf(Date).isRequired,min:n.instanceOf(Date).isRequired,onChange:n.func,showWeekNumbers:n.bool,smoothScroll:n.bool,take:n.number,value:n.instanceOf(Date),viewHeight:n.number,viewOffset:n.number,tabIndex:n.number},At.defaultProps={take:Cs,showWeekNumbers:!1,smoothScroll:!0},I.registerForIntl(At);class li extends o.Component{constructor(){super(...arguments),this.handleClick=t=>{const{onClick:e,value:s}=this.props;e&&e.call(void 0,s,t)}}render(){const{isRangeStart:t,value:e,text:s,...a}=this.props;return o.createElement("li",{...a,onClick:this.handleClick},o.createElement("span",{className:d.classNames({"k-calendar-navigation-marker":t})},this.props.children))}}const Es=30,hi=class extends o.Component{constructor(i){super(i),this.virtualization=null,this.list=null,this.itemHeight=0,this.topOffset=0,this.maxViewHeight=0,this.bottomOffset=0,this.handleVirtualizationMount=s=>{if(this.virtualization=s,this.virtualization&&this.list){this.list.style.transform=`translateY(${this.topOffset}px)`;const a=U(this.props.focusedDate,this.props.min,this.props.max),r=this.props.service.skip(a,this.props.min);this.virtualization.scrollToIndex(r)}},this.buildNavigationItem=s=>{const a=this.props.service.navigationTitle(s),r=this.props.service.isRangeStart(s),h=`kendo-react-calendar-nav-item-${s.getTime()}`,u={text:a,value:s,isRangeStart:r,view:this.props.activeView,onClick:this.handleDateChange};return this.props.navigationItem?o.createElement(this.props.navigationItem,{...u,key:h},a):o.createElement(li,{...u,key:h},a)},this.calculateHeights=()=>{const s=this.props.dom.calendarHeight;this.itemHeight=this.props.dom.navigationItemHeight||1,this.maxViewHeight=this.props.dom.monthViewHeight,this.topOffset=(s-this.itemHeight)/2,this.bottomOffset=s-this.itemHeight},this.handleDateChange=(s,a)=>{const{onChange:r}=this.props;if(r&&a){const h={value:l.cloneDate(s),target:this,nativeEvent:a&&a.nativeEvent,syntheticEvent:a};r.call(void 0,h)}},this.handleScrollAction=({scrollAction:s,pageAction:a})=>{const r=a?a.skip:this.state.skip;if(this.state.skip!==r&&this.setState({skip:r}),this.list&&s){const h=`translateY(${s.offset}px)`;this.list.style.transform=h}},this.lastView=this.props.activeView,this.lastFocus=this.props.focusedDate;const t=this.props.service.skip(this.props.focusedDate,this.props.min),e=this.props.service.total(this.props.min,this.props.max);this.state={skip:t-this.getTake(t,e)>0?t:0}}get take(){return this.props.take!==void 0?this.props.take:hi.defaultProps.take}componentDidUpdate(i,t){this.indexToScroll!==void 0&&this.virtualization&&this.virtualization.scrollToIndex(this.indexToScroll),this.lastView=this.props.activeView,this.lastFocus=this.props.focusedDate,this.indexToScroll=void 0}render(){this.calculateHeights();const i=this.lastView!==this.props.activeView,t=U(this.props.focusedDate,this.props.min,this.props.max),e=i?this.props.service.skip(t,this.props.min):this.state.skip,s=this.props.service.total(this.props.min,this.props.max),a=this.getTake(e,s),r=this.props.service.addToDate(this.props.min,e),h=this.props.service.datesList(r,a);(this.props.activeView!==this.lastView||!l.isEqual(t,this.lastFocus))&&(this.indexToScroll=this.props.service.skip(t,this.props.min));const u=o.createElement(ft,{skip:e,take:this.take,total:s,itemHeight:this.itemHeight,topOffset:this.topOffset,bottomOffset:this.bottomOffset,onScroll:this.props.onScroll,maxScrollDifference:this.maxViewHeight,onScrollAction:this.handleScrollAction,onMount:this.handleVirtualizationMount,tabIndex:this.props.tabIndex},o.createElement("ul",{ref:c=>{this.list=c},className:"k-reset"},h.map(c=>this.buildNavigationItem(c))));return o.createElement("div",{className:"k-calendar-navigation"},o.createElement("span",{className:"k-calendar-navigation-highlight"}),this.props.dom.didCalculate?u:null)}getTake(i,t){return Math.min(t-i,this.take)}};let xe=hi;xe.propTypes={activeView:n.number.isRequired,focusedDate:n.instanceOf(Date).isRequired,max:n.instanceOf(Date).isRequired,min:n.instanceOf(Date).isRequired,onChange:n.func,take:n.number,tabIndex:n.number},xe.defaultProps={take:Es};const Te=i=>i?i.virtualization:null,ci=(i=rt.defaultProps.min,t=rt.defaultProps.max,e,s)=>s!==void 0?s!==null&&_(l.getDate(s),i,t)?s:null:e!==null&&_(l.getDate(e),i,t)?e:null,at=class extends o.Component{constructor(i){super(i),this.scrollSyncService=null,this.focusedDate=null,this.Navigation=null,this.calendarViewList=null,this._element=null,this.intl=null,this.service=null,this.isActive=!1,this.didNavigationChange=!1,this.focus=()=>{this._element&&this._element.focus()},this.shouldScroll=()=>this.didNavigationChange,this.handleScroll=e=>{this.scrollSyncService&&this.scrollSyncService.sync(Te(this.Navigation),Te(this.calendarViewList),e)},this.handleNavigationChange=e=>{if(this.props.disabled)return;this.didNavigationChange=!0;const s=l.cloneDate(e.value);this.setState({focusedDate:s})},this.handleViewChange=({view:e})=>{this.scrollSyncService&&this.scrollSyncService.configure(e),this.setState({activeView:e})},this.handleDateChange=e=>{const s=l.cloneDate(e.value),a=l.cloneDate(e.value),r=this.bus.canMoveDown(this.state.activeView);if(this.props.disabled)return;if(r)if(e.isTodayClick)this.bus.moveToBottom(this.state.activeView);else{this.bus.moveDown(this.state.activeView,e.syntheticEvent),this.setState({focusedDate:a});return}this.setState({value:s,focusedDate:a}),this.valueDuringOnChange=s;const{onChange:h}=this.props;if(h){const u={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:s,target:this};h.call(void 0,u)}this.valueDuringOnChange=void 0},this.handleFocus=e=>{if(this.isActive=!0,!this.calendarViewList)return;this.calendarViewList.focusActiveDate();const{onFocus:s}=this.props;s&&s.call(void 0,e)},this.handleBlur=e=>{if(this.isActive=!1,!this.calendarViewList)return;this.calendarViewList.blurActiveDate();const{onBlur:s}=this.props;s&&s.call(void 0,e)},this.handleKeyDown=e=>{const{keyCode:s}=e;if(!(!this.focusedDate||!this.service)){if(s===d.Keys.enter){if(this.value!==null&&l.isEqualDate(this.focusedDate,this.value)){const r=U(this.focusedDate,this.min,this.max);Te(this.calendarViewList).scrollToIndex(this.service.skip(r,this.min))}const a={syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.focusedDate,target:this};this.handleDateChange(a)}else{const a=U(this.navigation.move(this.focusedDate,this.navigation.action(e),this.state.activeView,this.service,e),this.min,this.max);if(l.isEqualDate(this.focusedDate,a))return;this.setState({focusedDate:a})}e.preventDefault()}},this.handleMouseDown=e=>{e.preventDefault()},this.handleClick=e=>{this._element&&this._element.focus({preventScroll:!0})},d.validatePackage(gt);const t=ci(this.min,this.max,this.props.defaultValue||at.defaultProps.defaultValue,this.props.value);this.state={value:t,activeView:Ut(x[i.defaultActiveView],this.bottomView,this.topView),focusedDate:U(i.focusedDate||t||z(),this.min,this.max)},this.dom=new ei,this.bus=new de(this.handleViewChange),this.navigation=new pe(this.bus),this.oldValue=t}get cellUID(){return this.props.id+"-cell-uid"}get id(){return this.props.id+"-id"}get element(){return this._element}get value(){return this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value}get min(){return l.getDate(this.props.min!==void 0?this.props.min:at.defaultProps.min)}get max(){return l.getDate(this.props.max!==void 0?this.props.max:at.defaultProps.max)}get bottomView(){return x[this.props.bottomView!==void 0?this.props.bottomView:at.defaultProps.bottomView]}get topView(){return x[this.props.topView!==void 0?this.props.topView:at.defaultProps.topView]}componentDidMount(){Promise.resolve().then(()=>{d.setScrollbarWidth(),this._element&&(this.dom.calculateHeights(this._element),this.scrollSyncService=new ii(this.dom),this.scrollSyncService.configure(this.state.activeView),this.forceUpdate())})}componentDidUpdate(i,t){d.setScrollbarWidth(),t.activeView!==this.state.activeView&&this.scrollSyncService&&this.scrollSyncService.configure(this.state.activeView),this.calendarViewList&&(this.isActive?this.calendarViewList.focusActiveDate:this.calendarViewList.blurActiveDate)(),this.didNavigationChange=!1,this.oldValue=this.value}render(){this.props._ref&&this.props._ref(this);const i=this.value!==null&&this.oldValue!==null?!l.isEqualDate(this.value,this.oldValue):this.value!==this.oldValue,t=Ut(this.state.activeView,x[this.props.bottomView!==void 0?this.props.bottomView:at.defaultProps.bottomView],x[this.props.topView!==void 0?this.props.topView:at.defaultProps.topView]),e=ci(this.min,this.max,this.value,this.value),s=e?l.getDate(e):null;this.focusedDate=l.getDate(U(i&&e!==null?e:this.state.focusedDate,this.min,this.max)),this.intl=I.provideIntlService(this),this.bus.configure(this.bottomView,this.topView),this.service=this.bus.service(t,this.intl);const{smoothScroll:a=Number.parseFloat(o.version)<18}=this.props,r=d.classNames("k-widget k-calendar k-calendar-infinite",{"k-disabled":this.props.disabled,"k-week-number":this.props.weekNumber,"k-calendar-lg":this.props.mobileMode},this.props.className),h=[this.props.navigation&&o.createElement(xe,{key:0,ref:u=>{this.Navigation=u},activeView:this.state.activeView,focusedDate:this.focusedDate,min:this.min,max:this.max,onScroll:this.handleScroll,onChange:this.handleNavigationChange,service:this.service,dom:this.dom,navigationItem:this.props.navigationItem,tabIndex:this.props.tabIndex}),o.createElement(At,{key:1,ref:u=>{this.calendarViewList=u},activeView:this.state.activeView,focusedDate:this.focusedDate,min:this.min,max:this.max,bus:this.bus,shouldScroll:this.shouldScroll,onScroll:this.handleScroll,service:this.service,cell:this.props.cell,weekCell:this.props.weekCell,dom:this.dom,smoothScroll:a,showWeekNumbers:this.props.weekNumber,onChange:this.handleDateChange,value:s,cellUID:this.cellUID,headerTitle:this.props.headerTitle,tabIndex:this.props.tabIndex})];return o.createElement("div",{ref:u=>{this._element=u},className:r,id:this.props.id||this.id,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,"aria-disabled":this.props.disabled,tabIndex:this.props.disabled?void 0:this.props.tabIndex||0,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,onMouseDown:this.handleMouseDown,onClick:this.handleClick},h)}};let rt=at;rt.displayName="Calendar",rt.propTypes={className:n.string,defaultActiveView:n.oneOf(["month","year","decade","century"]),defaultValue:n.instanceOf(Date),disabled:n.bool,focusedDate:n.instanceOf(Date),id:n.string,ariaLabelledBy:n.string,ariaDescribedBy:n.string,max:n.instanceOf(Date),min:n.instanceOf(Date),navigation:n.bool,smoothScroll:n.bool,onBlur:n.func,onChange:n.func,onFocus:n.func,tabIndex:n.number,value:n.instanceOf(Date),weekNumber:n.bool,topView:(i,t,e)=>{const s=i[t],a=i.bottomView;return s&&a&&x[s]<x[a]?new Error(`Invalid prop + ${t} suplied to ${e}.
12
12
  ${t} can not be smaller than bottomView.
13
- `):null},bottomView:(i,t,e)=>{const s=i[t],a=i.topView;return s&&a&&I[s]>I[a]?new Error(`Invalid prop + ${t} suplied to ${e}.
13
+ `):null},bottomView:(i,t,e)=>{const s=i[t],a=i.topView;return s&&a&&x[s]>x[a]?new Error(`Invalid prop + ${t} suplied to ${e}.
14
14
  ${t} can not be bigger than topView.
15
- `):null}},rt.defaultProps={disabled:!1,min:it,max:st,navigation:!0,defaultActiveView:"month",defaultValue:null,topView:"century",bottomView:"month"};const ui=d.createPropsContext(),te=d.withPropsContext(ui,rt);te.displayName="KendoReactCalendar",x.registerForIntl(rt);class Vs{constructor(){this.symbols="",this.partMap=[]}}const Os="d",Ps="wide",ks=(i,t,e,s)=>{const a=i[s+i.length-e.length],r=i.substring(0,s+i.length-e.length),h=e.substring(0,s),u=[];if(r===h&&s>0)return u.push([t[s-1],h[s-1]]),u;if(r.indexOf(h)===0&&(h.length===0||t[h.length-1]!==t[h.length])){let c="";h.length===1&&u.push([t[0],h[0]]);for(let p=h.length;p<r.length;p++)t[p]!==c&&t[p]!=="_"&&(c=t[p],u.push([c,""]));return u}if(h.indexOf(r)===0||t[s-1]==="_"){let c=t[0];for(let p=Math.max(0,r.length-1);p<t.length;p++)if(t[p]!=="_"){c=t[p];break}return[[c,h[s-1]]]}return h[h.length-1]===" "||h[h.length-1]===a?[[t[s-1],"_"]]:[[t[s-1],h[s-1]]]},Ns=(i,t)=>(i[t.pattern[0]]=t.type,i),Ms=(i,t,e)=>i===null||!(t&&t>i||e&&e<i),Fs=["k-widget","k-dateinput"];class _s{constructor(t,e,s){this.year=!0,this.month=!0,this.date=!0,this.hours=!0,this.minutes=!0,this.seconds=!0,this.milliseconds=!0,this.leadingZero=null,this.typedMonthPart="",this.knownParts="adHhmMsEy",this.symbols={E:"E",H:"H",M:"M",a:"a",d:"d",h:"h",m:"m",s:"s",y:"y"},this._value=l.getDate(new Date),this.intlProvider=t,this.formatPlaceholder=e,this.format=s,this.monthNames=this.allFormatedMonths()}get intl(){return this.intlProvider()}get value(){return this._value}setValue(t){t?l.isEqual(t,this._value)||(this._value=l.cloneDate(t),this.modifyExisting(!0)):(this._value=l.getDate(new Date),this.modifyExisting(!1))}hasValue(){const t=(e,s)=>e||s.type!=="literal"&&s.type!=="dayperiod"&&this.getExisting(s.pattern[0]);return this.intl.splitDateFormat(this.format).reduce(t,!1)}getDateObject(){for(let t=0;t<this.knownParts.length;t++)if(!this.getExisting(this.knownParts[t]))return null;return l.cloneDate(this.value)}getTextAndFormat(){return this.merge(this.intl.formatDate(this.value,this.format),this.dateFormatString(this.value,this.format))}modifyExisting(t){const e=this.dateFormatString(this.value,this.format).symbols;for(let s=0;s<e.length;s++)this.setExisting(e[s],t)}getExisting(t){switch(t){case"y":return this.year;case"M":case"L":return this.month;case"d":return this.date;case"E":return this.date&&this.month&&this.year;case"h":case"H":return this.hours;case"m":return this.minutes;case"s":return this.seconds;default:return!0}}setExisting(t,e){switch(t){case"y":this.year=e,e===!1&&this._value.setFullYear(2e3);break;case"M":this.month=e,e===!1&&this._value.setMonth(0);break;case"d":this.date=e;break;case"h":case"H":this.hours=e;break;case"m":this.minutes=e;break;case"s":this.seconds=e;break;default:return}}modifyPart(t,e){let s=l.cloneDate(this.value);switch(t){case"y":s.setFullYear(s.getFullYear()+e);break;case"M":s=l.addMonths(this.value,e);break;case"d":case"E":s.setDate(s.getDate()+e);break;case"h":case"H":s.setHours(s.getHours()+e);break;case"m":s.setMinutes(s.getMinutes()+e);break;case"s":s.setSeconds(s.getSeconds()+e);break;case"a":s.setHours(s.getHours()+12*e);break}this.setExisting(t,!0),this._value=s}parsePart(t,e){if(this.resetLeadingZero(),!e)return this.setExisting(t,!1),{value:null};const s=this.intl.formatDate(this.value,this.format),a=this.dateFormatString(this.value,this.format),r=a.symbols;let h=!1,u="",c="",p="";for(let v=0;v<s.length;v++)r[v]===t?(c+=this.getExisting(t)?s[v]:"0",h=!0):h?p+=s[v]:u+=s[v];let m=null;const f=this.matchMonth(e);for(;c.length>0&&c.charAt(0)==="0";)c=c.slice(1);c.length>=4&&(c="");for(let v=0;v<2;v++){let w=c+e,T=parseInt(w,10);if(m=this.intl.parseDate(u+w+p,this.format),!m&&!isNaN(T)&&!isNaN(parseInt(e,10))){if(t==="M"&&!f){const E=T-1;E>-1&&E<12&&(m=l.cloneDate(this.value),m.setMonth(E),m.getMonth()!==E&&(m=l.lastDayOfMonth(l.addMonths(m,-1))))}t==="y"&&(m=l.createDate(parseInt(w,10),this.month?this.value.getMonth():0,this.date?this.value.getDate():1,this.hours?this.value.getHours():0,this.minutes?this.value.getMinutes():0,this.seconds?this.value.getSeconds():0,this.milliseconds?this.value.getMilliseconds():0),this.date&&m.getDate()!==this.value.getDate()&&(m=l.lastDayOfMonth(l.addMonths(m,-1))))}if(m)return this._value=m,this.setExisting(t,!0),{value:this.value};c=""}return f&&(m=this.intl.parseDate(u+f+p,this.format),m)?(this._value=m,this.setExisting(t,!0),{value:this.value}):(e==="0"&&(this.leadingZero=this.isAbbrMonth(a.partMap,t)?null:{[t]:!0},this.setExisting(t,!1)),{value:null})}symbolMap(t){return this.intl.splitDateFormat(this.format).reduce(Ns,{})[t]}resetLeadingZero(){const t=this.leadingZero!==null;return this.leadingZero=null,t}isAbbrMonth(t,e){const s=this.partPattern(t,e);return s.type==="month"&&s.names}partPattern(t,e){return t.filter(s=>s.pattern.indexOf(e)!==-1)[0]}matchMonth(t){if(this.typedMonthPart+=t.toLowerCase(),this.monthNames.length===0)return"";for(;this.typedMonthPart.length>0;){for(let s=0;s<this.monthNames.length;s++)if(this.monthNames[s].toLowerCase().indexOf(this.typedMonthPart)===0)return this.monthNames[s];const e=parseInt(this.typedMonthPart,10);if(e>=1&&e<=12&&e.toString()===this.typedMonthPart)return this.monthNames[e-1];this.typedMonthPart=this.typedMonthPart.substring(1,this.typedMonthPart.length)}return""}allFormatedMonths(){const t=this.intl.splitDateFormat(this.format);for(let e=0;e<t.length;e++)if(t[e].type==="month"&&t[e].names)return this.intl.dateFormatNames(t[e].names);return[]}dateFormatString(t,e){const s=this.intl.splitDateFormat(e),a=[],r=[];for(let u=0;u<s.length;u++){let c=this.intl.formatDate(t,{pattern:s[u].pattern}).length;for(;c>0;)a.push(this.symbols[s[u].pattern[0]]||"_"),r.push(s[u]),c--}const h=new Vs;return h.symbols=a.join(""),h.partMap=r,h}merge(t,e){let s="",a="",r=e.symbols;for(let h=r.length-1;h>=0;h--)if(this.knownParts.indexOf(r[h])===-1||this.getExisting(r[h]))s=t[h]+s,a=r[h]+a;else{const u=r[h];for(;h>=0&&u===r[h];)h--;for(h++,this.leadingZero&&this.leadingZero[u]?s="0"+s:s=this.dateFieldName(e.partMap[h])+s;a.length<s.length;)a=r[h]+a}return{text:s,format:a}}dateFieldName(t){const e=this.formatPlaceholder||"wide";return e[t.type]?e[t.type]:e==="formatPattern"?t.pattern:this.intl.dateFieldName(Object.assign(t,{nameType:e}))}}const K={dayperiod:"dayperiod",hour:"hour",millisecond:"millisecond",minute:"minute",second:"second"},Ce=i=>(t,e)=>{const s=l.cloneDate(t);return s[i](e),s},di=[{type:K.hour,getter:i=>i.getHours()},{type:K.minute,getter:i=>i.getMinutes()},{type:K.second,getter:i=>i.getSeconds()},{type:K.millisecond,getter:i=>i.getMilliseconds()}],Ls=i=>(t,e)=>i(t),As=i=>(t,e)=>i(e),Hs=i=>i.reduce((t,e)=>(t[e.type]=e.type,t),{}),zs=i=>t=>i[t.type]?As(t.getter):Ls(t.getter),Bs=i=>t=>i.map(zs(Hs(t))),qs=(i,t,e,s)=>a=>{const r=i(a),h=i(e);return s==="hour"?r-(r-h)%t:a.getTime()<=e.getTime()&&r!==0&&r<=h?Math.ceil(r/t)*t:r-r%t},Rs=i=>(t,e)=>i.map(s=>{const a=Math.floor(t[s.type]);return a?qs(s.getter,a,e,s.type):s.getter}),Ws=Bs(di),pi=Rs(di),Us=i=>(t,e)=>(t.setHours(...i.map(s=>s(t,e))),t),mi=i=>t=>{const e=l.cloneDate(t);return e.setHours(...i.map(s=>s(e))),e},ee=Ce("setHours"),ie=Ce("setMinutes"),se=Ce("setSeconds"),ut=()=>new Date,Ee=(i,t,e=1)=>{const s=[];for(let a=i;a<t;a=a+e)s.push(a);return s},Ve=(i,t,e)=>({candidateValue:B(A,i),maxValue:l.addDays(B(A,e),t.getHours()<e.getHours()?0:1),minValue:B(A,t)}),Ys=(i,t,e)=>{if(!i||!t||!e)return i;const{candidateValue:s,minValue:a,maxValue:r}=Ve(i,t,e);return s<a?B(i,t):s>r?B(i,e):i},Oe=(i,t,e)=>{if(!i||!t||!e)return!0;const{candidateValue:s,minValue:a,maxValue:r}=Ve(i,t,e);return a<=s&&s<=r},$s=(i,t,e)=>{if(i===null)return!0;const{candidateValue:s,minValue:a,maxValue:r}=Ve(i,t,e);return a<=s&&s<=r},Ks=(i,t)=>{if(i===null||t===null)return!1;const e=B(A,i),s=B(A,t);return e.getTime()<s.getHours()},js=(i,t)=>{if(i===null||t===null)return!1;const e=B(A,i);return B(A,t).getTime()<e.getHours()},Zs="Please enter a valid value!",j=class extends o.Component{constructor(i){super(i),this.kendoDate=null,this.currentFormat="",this.paste=!1,this._element=null,this._wrapper=null,this._inputId=d.guid(),this._lastSelectedSymbol="",this.focus=()=>{this._element&&this._element.focus()},this.setValidity=()=>{this.element&&this.element.setCustomValidity&&this.element.setCustomValidity(this.validity.valid?"":this.props.validationMessage||j.defaultProps.validationMessage)},this.updateOnPaste=t=>{if(!this.element||!this.kendoDate)return;const e=x.provideIntlService(this).parseDate(this.element.value,this.props.format)||this.value,s=this.value;this.kendoDate.setValue(e),this.triggerChange(t,s)},this.spinnersMouseDown=t=>{t.preventDefault();const e=d.getActiveElement(document);this.element&&e!==this.element&&this.element.focus({preventScroll:!0})},this.handlePaste=()=>{this.paste=!0},this.elementChange=t=>{if(!this.element||!this.kendoDate)return;if(this.paste){this.updateOnPaste(t),this.paste=!1;return}const{text:e,format:s}=this.kendoDate.getTextAndFormat();this.currentFormat=s;const a=this.value,r=ks(e,this.currentFormat,this.element.value,this.selection.start),h=r.length===1&&r[0][1]==="_";if(!h)for(let u=0;u<r.length;u++)this.kendoDate.parsePart(r[u][0],r[u][1]);r.length&&r[0][0]!=="_"&&this.setSelection(this.selectionBySymbol(r[0][0])),h&&this.switchDateSegment(1),this.triggerChange(t,a)},this.elementClick=t=>{this.setSelection(this.selectionByIndex(this.selection.start))},this.nativeWheel=t=>{d.getActiveElement(document)===this.element&&t.preventDefault()},this.wheel=t=>{d.getActiveElement(document)===this.element&&(t.nativeEvent.deltaY<0&&this.increasePart(t),t.nativeEvent.deltaY>0&&this.decreasePart(t))},this.increasePart=t=>{this.modifyDateSegmentValue(1,t)},this.decreasePart=t=>{this.modifyDateSegmentValue(-1,t)},this.elementKeyDown=t=>{if(!t.altKey){switch(t.keyCode){case 37:this.switchDateSegment(-1);break;case 38:this.modifyDateSegmentValue(1,t);break;case 39:this.switchDateSegment(1);break;case 40:this.modifyDateSegmentValue(-1,t);break;default:return}t.preventDefault()}},this.elementOnFocus=t=>{this.wrapper&&this.wrapper.classList.add("k-focus"),this.setState({focused:!0})},this.elementOnBlur=t=>{this.wrapper&&this.wrapper.classList.remove("k-focus"),this.setState({focused:!1})},d.validatePackage(gt),this.state={focused:!1}}componentDidMount(){this.setValidity(),this.wrapper&&this.wrapper.addEventListener("wheel",this.nativeWheel,{passive:!1})}componentDidUpdate(i,t){this._lastSelectedSymbol&&t.focused===this.state.focused?this.setSelection(this.selectionBySymbol(this._lastSelectedSymbol)):this.props.placeholder!==void 0&&this.selection.start===this.selection.end&&this.setSelection({start:0,end:this.currentFormat.length}),this.setValidity()}componentWillUnmount(){this.wrapper&&this.wrapper.removeEventListener("wheel",this.nativeWheel)}render(){const{size:i=j.defaultProps.size,fillMode:t=j.defaultProps.fillMode,rounded:e=j.defaultProps.rounded}=this.props;this.props._ref&&(this.props._ref.current=this);const s=x.provideLocalizationService(this),a={...j.defaultProps,...this.props},{name:r,label:h,id:u}=a,c=this.text,p=c===this.props.placeholder?"":c,m=c===this.props.placeholder?c:void 0,f=u||this._inputId,v=!this.validityStyles||this.validity.valid;let w=[...Fs];this.props.className&&w.push(this.props.className);const T=o.createElement(d.AsyncFocusBlur,{onFocus:this.elementOnFocus,onBlur:this.elementOnBlur},({onFocus:E,onBlur:O})=>o.createElement("span",{ref:y=>{this._wrapper=y},style:h?void 0:{width:this.props.width},dir:this.props.dir,className:d.classNames("k-dateinput","k-input",{[`k-input-${d.kendoThemeMaps.sizeMap[i]||i}`]:i,[`k-input-${t}`]:t,[`k-rounded-${d.kendoThemeMaps.roundedMap[e]||e}`]:e,"k-invalid":!v,"k-required":this.required,"k-disabled":this.props.disabled},this.props.className),onFocus:E,onBlur:O},o.createElement("input",{role:this.props.ariaRole||"textbox",readOnly:this.props.readonly,tabIndex:this.props.tabIndex,disabled:this.props.disabled,title:this.props.title!==void 0?this.props.title:c,type:"text",spellCheck:!1,autoComplete:"off",autoCorrect:"off",className:"k-input-inner",id:f,"aria-label":this.props.ariaLabel,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,"aria-haspopup":this.props.ariaHasPopup,"aria-disabled":this.props.disabled,"aria-expanded":this.props.ariaExpanded,"aria-controls":this.props.ariaControls,onWheel:this.wheel,onClick:this.elementClick,onInput:this.elementChange,onPaste:this.handlePaste,onKeyDown:this.elementKeyDown,onChange:d.noop,value:p,placeholder:m,name:r,ref:y=>this._element=y}),this.props.children,this.props.spinners&&o.createElement("span",{className:"k-input-spinner k-spin-button",onMouseDown:this.spinnersMouseDown},o.createElement(F.Button,{tabIndex:-1,type:"button",rounded:null,className:"k-spinner-increase",icon:"caret-alt-up",svgIcon:X.caretAltUpIcon,"aria-label":s.toLanguageString(wt,V[wt]),title:s.toLanguageString(wt,V[wt]),onClick:this.increasePart}),o.createElement(F.Button,{tabIndex:-1,type:"button",rounded:null,className:"k-spinner-decrease",icon:"caret-alt-down",svgIcon:X.caretAltDownIcon,"aria-label":s.toLanguageString(bt,V[bt]),title:s.toLanguageString(bt,V[bt]),onClick:this.decreasePart}))));return h?o.createElement(Ue.FloatingLabel,{label:h,editorId:f,editorValue:c,editorValid:v,editorDisabled:this.props.disabled,children:T,style:{width:this.props.width}}):T}get value(){return this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.kendoDate&&this.kendoDate.getDateObject()}get name(){return this.props.name}get min(){return this.props.min!==void 0?this.props.min:j.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:j.defaultProps.max}get text(){const i={...lt.defaultProps,...this.props},{formatPlaceholder:t=j.defaultProps.formatPlaceholder,format:e=j.defaultProps.format,value:s,defaultValue:a}=i;this.kendoDate===null?(this.kendoDate=new _s(this.intl.bind(this),t,e),this.kendoDate.setValue(s||a||null)):(this.kendoDate.format=e,this.kendoDate.formatPlaceholder=t),s!==void 0&&this.value!==s&&this.kendoDate.setValue(s);const{text:r,format:h}=this.kendoDate.getTextAndFormat();return this.currentFormat=h,i.placeholder!==null&&i.placeholder!==void 0&&!this.state.focused&&!this.kendoDate.hasValue()?i.placeholder:r}get validity(){const i=Ms(this.value,this.min,this.max)&&Oe(this.value,this.props.minTime,this.props.maxTime),t=this.props.validationMessage!==void 0,e=(!this.required||this.value!==null)&&i,s=this.props.valid!==void 0?this.props.valid:e;return{customError:t,rangeOverflow:this.value&&this.max.getTime()<this.value.getTime()||!1,rangeUnderflow:this.value&&this.value.getTime()<this.min.getTime()||!1,valid:s,valueMissing:this.value===null}}get element(){return this._element}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:j.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:j.defaultProps.required}get wrapper(){return this._wrapper}intl(){return x.provideIntlService(this)}get selection(){let i={start:0,end:0};return this.element!==null&&this.element.selectionStart!==void 0&&(i={start:this.element.selectionStart,end:this.element.selectionEnd}),i}setSelection(i){this._lastSelectedSymbol=this.currentFormat[i.start],window.requestAnimationFrame(()=>{const t=d.getActiveElement(document);this.element&&t===this.element&&!this.props.disableSelection&&this.element.setSelectionRange(i.start,i.end)})}triggerChange(i,t){this.valueDuringOnChange=this.value,this.forceUpdate(),this.props.onChange&&!l.isEqual(t,this.value)&&this.props.onChange.call(void 0,{syntheticEvent:i,nativeEvent:i.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0}selectionBySymbol(i){let t=-1,e=0;for(let s=0;s<this.currentFormat.length;s++)this.currentFormat[s]===i&&(e=s+1,t===-1&&(t=s));return t<0&&(t=0),{start:t,end:e}}selectionByIndex(i){let t={start:i,end:i};for(let e=i,s=i-1;e<this.currentFormat.length||s>=0;e++,s--){if(e<this.currentFormat.length&&this.currentFormat[e]!=="_"){t=this.selectionBySymbol(this.currentFormat[e]);break}if(s>=0&&this.currentFormat[s]!=="_"){t=this.selectionBySymbol(this.currentFormat[s]);break}}return t}switchDateSegment(i){const{start:t,end:e}=this.selection;if(t<e&&this.currentFormat[t]!==this.currentFormat[e-1]){this.setSelection(this.selectionByIndex(i>0?t:e-1));return}const s=this.currentFormat[t];let a=t+i;for(;a>0&&a<this.currentFormat.length&&!(this.currentFormat[a]!==s&&this.currentFormat[a]!=="_");)a+=i;if(this.currentFormat[a]==="_")return;let r=a;for(;r>=0&&r<this.currentFormat.length&&this.currentFormat[r]===this.currentFormat[a];)r+=i;a>r&&(r+1!==t||a+1!==e)?this.setSelection({start:r+1,end:a+1}):a<r&&(a!==t||r!==e)&&this.setSelection({start:a,end:r})}modifyDateSegmentValue(i,t){if(!this.kendoDate)return;const e=this.value,s=this.currentFormat[this.selection.start],a=this.kendoDate.symbolMap(s),r=((this.props.steps||{})[a]||1)*i;this.kendoDate.modifyPart(s,r),this.triggerChange(t,e)}};let ot=j;ot.displayName="DateInput",ot.propTypes={value:n.instanceOf(Date),format:n.oneOfType([n.string,n.shape({skeleton:n.string,pattern:n.string,date:n.oneOf(["short","medium","long","full"]),time:n.oneOf(["short","medium","long","full"]),datetime:n.oneOf(["short","medium","long","full"]),era:n.oneOf(["narrow","short","long"]),year:n.oneOf(["numeric","2-digit"]),month:n.oneOf(["numeric","2-digit","narrow","short","long"]),day:n.oneOf(["numeric","2-digit"]),weekday:n.oneOf(["narrow","short","long"]),hour:n.oneOf(["numeric","2-digit"]),hour12:n.bool,minute:n.oneOf(["numeric","2-digit"]),second:n.oneOf(["numeric","2-digit"]),timeZoneName:n.oneOf(["short","long"])})]),formatPlaceholder:n.oneOfType([n.oneOf(["wide","narrow","short","formatPattern"]),n.shape({year:n.string,month:n.string,day:n.string,hour:n.string,minute:n.string,second:n.string})]),width:n.oneOfType([n.string,n.number]),tabIndex:n.number,title:n.string,steps:n.shape({year:n.number,month:n.number,day:n.number,hour:n.number,minute:n.number,second:n.number}),min:n.instanceOf(Date),max:n.instanceOf(Date),disabled:n.bool,spinners:n.bool,name:n.string,dir:n.string,label:n.string,id:n.string,ariaLabelledBy:n.string,ariaDescribedBy:n.string,ariaLabel:n.string,ariaRole:n.string,ariaHasPopup:n.oneOfType([n.bool,n.string]),ariaExpanded:n.oneOfType([n.bool]),onChange:n.func,validationMessage:n.string,required:n.bool,validate:n.bool,valid:n.bool,size:n.oneOf([null,"small","medium","large"]),rounded:n.oneOf([null,"small","medium","large","full"]),fillMode:n.oneOf([null,"solid","flat","outline"])},ot.defaultProps={format:Os,size:"medium",rounded:"medium",fillMode:"solid",formatPlaceholder:Ps,spinners:!1,disabled:!1,max:l.cloneDate(st),min:l.cloneDate(it),minTime:l.cloneDate(ct),maxTime:l.cloneDate(nt),required:!1,validityStyles:!0,validationMessage:Zs,placeholder:null,ariaHasPopup:"grid"};const gi=d.createPropsContext(),lt=d.withPropsContext(gi,ot);lt.displayName="KendoReactDateInput",x.registerForIntl(ot),x.registerForLocalization(ot);const fi=F.Button,vi=o.forwardRef((i,t)=>{const{_ref:e}=i,s=o.useRef(null);o.useImperativeHandle(t,()=>s.current),o.useImperativeHandle(e,()=>s.current);const a=o.useMemo(()=>d.classNames(i.className,"k-picker-wrap"),[i.className]);return o.createElement("span",{ref:s,id:i.id,style:i.style,className:a,tabIndex:i.tabIndex},i.children)}),Gs=i=>{const[t,e]=o.useState(!1),s=()=>{i.current&&e(!!i.current.text)};return o.useEffect(s),{editorValue:t}},Pe=i=>{const t=Gs(i.dateInput);return o.createElement(Ue.FloatingLabel,{...i,...t})},wi=500,ne=i=>{const{footer:t,children:e,windowWidth:s=0,navigatable:a,navigatableElements:r,expand:h,animation:u,onClose:c,adaptiveTitle:p,mobileFilter:m}=i,f={navigatable:a||!1,navigatableElements:r||[],expand:h,animation:u!==!1,onClose:c,animationStyles:s<=wi?{top:0,width:"100%",height:"100%"}:void 0,className:s<=wi?"k-adaptive-actionsheet k-actionsheet-fullscreen":"k-adaptive-actionsheet k-actionsheet-bottom"};return o.createElement(ht.ActionSheet,{...f},o.createElement(ht.ActionSheetHeader,{className:"k-text-center"},o.createElement("div",{className:"k-actionsheet-titlebar-group k-hbox"},o.createElement("div",{className:"k-actionsheet-title"},o.createElement("div",null,p)),o.createElement("div",{className:"k-actionsheet-actions"},o.createElement(F.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",icon:"x",svgIcon:X.xIcon,onClick:c}))),m&&o.createElement("div",{className:"k-actionsheet-titlebar-group k-actionsheet-filter"},m)),e,t&&o.createElement(ht.ActionSheetFooter,{className:"k-actions k-actions-stretched"},o.createElement(F.Button,{size:"large",tabIndex:0,"aria-label":t.cancelText,"aria-disabled":"false",type:"button",onClick:t.onCancel},t.cancelText),o.createElement(F.Button,{tabIndex:0,themeColor:"primary",size:"large","aria-label":t.applyText,"aria-disabled":"false",type:"button",onClick:t.onApply},t.applyText)))},ae=768,q=class extends o.Component{constructor(i){super(i),this._popupId=d.guid(),this._element=null,this._dateInput=o.createRef(),this._calendar=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.focus=()=>{this.dateInput&&this.dateInput.focus()},this.setCalendarRef=t=>{this._calendar=t},this.nextValue=(t,e)=>t.value!==void 0?t.value:e.value,this.nextShow=(t,e)=>t.show!==void 0?t.show:e.show,this.renderPopup=()=>{const{disabled:t,min:e,max:s,weekNumber:a,focusedDate:r}=this.props,{popupClass:h,...u}=this.props.popupSettings,c=this.show,p=this.value,m=p&&l.getDate(p),f=d.classNames("k-calendar-container k-group k-reset",h),v={popupClass:"k-datepicker-popup",show:c,anchor:this._element,className:f,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...u},w={disabled:t,value:m,min:e,max:s,weekNumber:a,focusedDate:r,className:this.mobileMode?"k-calendar-lg":"",navigation:!this.mobileMode,onChange:this.handleCalendarValueChange};return this.mobileMode?o.createElement(this.calendarComp,{_ref:this.setCalendarRef,...w}):o.createElement(this.popupComp,{...v},o.createElement(this.calendarComp,{_ref:this.setCalendarRef,...w}))},this.renderAdaptivePopup=()=>{const{windowWidth:t=0}=this.state,e={expand:this.show,onClose:this.handleBlur,adaptiveTitle:this.props.adaptiveTitle,windowWidth:t};return o.createElement(ne,{...e},o.createElement(ht.ActionSheetContent,{className:"!k-overflow-hidden"},this.renderPopup()))},this.handleInputValueChange=t=>{this.handleValueChange(t.value,t)},this.handleCalendarValueChange=t=>{const e=this.mergeTime(t.value);this.handleValueChange(e,t)},this.handleValueChange=(t,e)=>{this.setState({value:l.cloneDate(t||void 0)}),this.valueDuringOnChange=t,this.showDuringOnChange=!1,this.mobileMode||(this.shouldFocusDateInput=!0);const{onChange:s}=this.props;s&&s.call(void 0,{syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:this.value,show:this.show,target:this}),this.valueDuringOnChange=void 0,this.showDuringOnChange=void 0,this.setShow(!1)},this.handleFocus=()=>{this.setState({focused:!0})},this.handleBlur=()=>{this.setState({focused:!1}),this.setShow(!1)},this.handleIconClick=()=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=t=>{t.preventDefault()},this.handleKeyDown=t=>{const{altKey:e,keyCode:s}=t;if(s===d.Keys.esc){this.shouldFocusDateInput=!0,this.setShow(!1);return}e&&(s===d.Keys.up||s===d.Keys.down)&&(t.preventDefault(),t.stopPropagation(),this.shouldFocusDateInput=s===d.Keys.up,this.setShow(s===d.Keys.down))},d.validatePackage(gt),this.state={value:this.props.defaultValue||q.defaultProps.defaultValue,show:this.props.defaultShow||q.defaultProps.defaultShow,focused:!1}}get document(){if(d.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=ae&&this.props.adaptive)}get dateInput(){return this._dateInput.current}get calendar(){return this._calendar}get value(){const i=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return i!==null?l.cloneDate(i):null}get show(){return this.showDuringOnChange!==void 0?this.showDuringOnChange:this.props.show!==void 0?this.props.show:this.state.show}get name(){return this.props.name}get min(){return this.props.min!==void 0?this.props.min:q.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:q.defaultProps.max}get dateInputComp(){return this.props.dateInput||q.defaultProps.dateInput}get toggleButtonComp(){return this.props.toggleButton||q.defaultProps.toggleButton}get calendarComp(){return this.props.calendar||q.defaultProps.calendar}get popupComp(){return this.props.popup||q.defaultProps.popup}get pickerWrapComp(){return this.props.pickerWrap||q.defaultProps.pickerWrap}get validity(){const i=je(this.value,this.min,this.max),t=this.props.validationMessage!==void 0,e=(!this.required||this.value!==null)&&i,s=this.props.valid!==void 0?this.props.valid:e;return{customError:t,rangeOverflow:this.value&&this.max.getTime()<this.value.getTime()||!1,rangeUnderflow:this.value&&this.value.getTime()<this.min.getTime()||!1,valid:s,valueMissing:this.value===null}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:q.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:q.defaultProps.required}componentDidMount(){var i;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){this._calendar&&this._calendar.element&&this.show&&!this.prevShow&&this._calendar.element.focus({preventScroll:!0}),this.dateInput&&this.dateInput.element&&!this.show&&this.shouldFocusDateInput&&this.dateInput.element.focus({preventScroll:!0}),this.prevShow=this.show,this.shouldFocusDateInput=!1}componentWillUnmount(){var i;clearTimeout(this.nextTickId),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:i=q.defaultProps.size,rounded:t=q.defaultProps.rounded,fillMode:e=q.defaultProps.fillMode,disabled:s,tabIndex:a,title:r,id:h,format:u,formatPlaceholder:c,min:p,max:m,className:f,width:v,name:w,validationMessage:T,required:E,validityStyles:O,ariaLabelledBy:y,ariaDescribedBy:P,ariaLabel:b}=this.props,R=this.show,k=this.value,M=!this.validityStyles||this.validity.valid,W={disabled:s,format:u,formatPlaceholder:c,id:h,ariaLabelledBy:y,ariaDescribedBy:P,ariaLabel:b,max:m,min:p,name:w,onChange:this.handleInputValueChange,required:E,tabIndex:R?-1:a,title:r,valid:this.validity.valid,validationMessage:T,validityStyles:O,value:k,label:void 0,placeholder:this.state.focused?null:this.props.placeholder,ariaExpanded:this.show,size:null,fillMode:null,rounded:null},C=x.provideLocalizationService(this).toLanguageString(jt,V[jt]),N=o.createElement(d.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.mobileMode?void 0:this.handleBlur,onSyncBlur:this.props.onBlur,onSyncFocus:this.props.onFocus},({onFocus:tt,onBlur:G})=>o.createElement(o.Fragment,null,o.createElement("span",{ref:mt=>{this._element=mt},className:d.classNames("k-input","k-datepicker",{[`k-input-${d.kendoThemeMaps.sizeMap[i]||i}`]:i,[`k-rounded-${d.kendoThemeMaps.roundedMap[t]||t}`]:t,[`k-input-${e}`]:e,["k-invalid"]:!M,["k-required"]:this.required,["k-disabled"]:this.props.disabled},f),onKeyDown:this.handleKeyDown,style:{width:v},onFocus:tt,onBlur:G,onClick:this.mobileMode?this.handleIconClick:void 0},o.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",readonly:this.mobileMode,ariaExpanded:this.show,ariaControls:this._popupId,...W}),o.createElement(this.toggleButtonComp,{type:"button",icon:"calendar",svgIcon:X.calendarIcon,title:C,className:"k-input-button",rounded:null,onClick:this.mobileMode?void 0:this.handleIconClick,"aria-label":C,onMouseDown:this.handleIconMouseDown}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup()));return this.props.label?o.createElement(Pe,{dateInput:this._dateInput,label:this.props.label,editorId:h,editorValid:M,editorDisabled:this.props.disabled,children:N,style:{width:this.props.width}}):N}setShow(i){const{onOpen:t,onClose:e}=this.props;this.show!==i&&(this.setState({show:i}),i&&t&&t.call(void 0,{target:this}),!i&&e&&e.call(void 0,{target:this}))}mergeTime(i){return this.value&&i?B(i,this.value):i}nextTick(i){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>i())}calculateMedia(i){for(let t of i)this.setState({windowWidth:t.target.clientWidth})}};let xt=q;xt.displayName="DatePicker",xt.propTypes={className:n.string,defaultShow:n.bool,defaultValue:n.instanceOf(Date),disabled:n.bool,focusedDate:n.instanceOf(Date),format:n.oneOfType([n.string,n.shape({skeleton:n.string,pattern:n.string,date:n.oneOf(["short","medium","long","full"]),time:n.oneOf(["short","medium","long","full"]),datetime:n.oneOf(["short","medium","long","full"]),era:n.oneOf(["narrow","short","long"]),year:n.oneOf(["numeric","2-digit"]),month:n.oneOf(["numeric","2-digit","narrow","short","long"]),day:n.oneOf(["numeric","2-digit"]),weekday:n.oneOf(["narrow","short","long"]),hour:n.oneOf(["numeric","2-digit"]),hour12:n.bool,minute:n.oneOf(["numeric","2-digit"]),second:n.oneOf(["numeric","2-digit"]),timeZoneName:n.oneOf(["short","long"])})]),formatPlaceholder:n.oneOfType([n.oneOf(["wide","narrow","short","formatPattern"]),n.shape({year:n.string,month:n.string,day:n.string,hour:n.string,minute:n.string,second:n.string})]),id:n.string,ariaLabelledBy:n.string,ariaDescribedBy:n.string,ariaLabel:n.string,min:n.instanceOf(Date),max:n.instanceOf(Date),name:n.string,popupSettings:n.shape({animate:n.bool,appendTo:n.any,popupClass:n.string}),show:n.bool,tabIndex:n.number,title:n.string,value:n.instanceOf(Date),weekNumber:n.bool,width:n.oneOfType([n.number,n.string]),validationMessage:n.string,required:n.bool,validate:n.bool,valid:n.bool,size:n.oneOf([null,"small","medium","large"]),rounded:n.oneOf([null,"small","medium","large","full"]),fillMode:n.oneOf([null,"solid","flat","outline"]),adaptive:n.bool,adaptiveTitle:n.string},xt.defaultProps={defaultShow:!1,defaultValue:null,dateInput:lt,calendar:te,toggleButton:fi,popup:qt.Popup,pickerWrap:vi,disabled:!1,format:"d",max:st,min:it,popupSettings:{},tabIndex:0,weekNumber:!1,required:!1,validityStyles:!0,size:"medium",rounded:"medium",fillMode:"solid"};const bi=d.createPropsContext(),yi=d.withPropsContext(bi,xt);yi.displayName="KendoReactDatePicker",x.registerForLocalization(xt);const ke=(i,t)=>{const e=l.cloneDate(i);return e.setHours(t),e},Ne=i=>i!==null&&i<12,Xs=i=>i!==null&&(!i||i>11),Js=(i,t,e)=>!t&&!e||i>=t&&i<=e,Qs=(i,t,e)=>!t&&!e||i>=t||i<=e;class Si{constructor(t){this.intl=t,this.min=null,this.max=null,this.part=null}apply(t,e){const s=t.getHours(),a=Ne(s),r=Ne(e.getHours());if(a&&r||!a&&!r)return t;const[h,u=24]=this.normalizedRange(),c=s+(r?-12:12);return ke(t,Math.min(Math.max(h,c),u||24))}configure(t){const{min:e=this.min,max:s=this.max,part:a=this.part}=t;this.min=e,this.max=s,this.part=a}data(t){const e=this.part&&this.part.names;if(!e||!this.min)return[];const s=[],[a,r]=this.normalizedRange(),h=this.intl.dateFormatNames(e);return Ne(a)&&s.push({text:h.am,value:ke(this.min,a)}),Xs(r)&&s.push({text:h.pm,value:ke(this.min,Math.max(12,r))}),this.min.getHours()!==a?s.reverse():s}isRangeChanged(t,e){return!1}limitRange(t,e,s){return[t,e]}total(){const[t,e]=this.normalizedRange();return!t&&!e?2:t>11||e<12?1:2}selectedIndex(t){if(!this.valueInList(t)||!this.min)return-1;const e=Math.floor(t.getHours()/12);return this.min.getHours()===this.normalizedRange()[0]?e:e===0?1:0}valueInList(t){return!this.min||!this.max?!1:(this.min.getHours()!==this.normalizedRange()[0]?Qs:Js)(t.getHours(),this.min.getHours(),this.max.getHours())}normalizedRange(){const t=this.min.getHours(),e=this.max.getHours();return[Math.min(t,e),Math.max(t,e)]}}class tn{constructor(){this.itemHeight=0,this.timeListHeight=0,this.didCalculate=!1}ensureHeights(){this.timeListHeight===void 0&&this.calculateHeights()}calculateHeights(t){if(!d.canUseDOM)return;const e=Y("div"),s=Y("span"),a=Y("ul"),r=Y("li"),h=()=>r("<span>02</span>","k-item"),u=()=>a([h()],"k-reset"),c=()=>e([u()],"k-content k-scrollable k-time-container"),m=(()=>e([s("minute","k-title"),e([c()],"k-time-list")],"k-time-list-wrapper",{left:"-10000px",position:"absolute"}))(),v=t&&t.querySelector(".k-time-container")||document.body,w=v.appendChild(m);this.timeListHeight=w.querySelector(".k-scrollable").offsetHeight,this.itemHeight=w.querySelector("li").offsetHeight,v.removeChild(w),this.didCalculate=!0}}const Me=24,Di=(i=>t=>t%i)(Me),en=(i,t)=>e=>Di(i+e*t),xi=(i,t)=>Di(Me+i-t),Ii=i=>(t,e)=>!e||l.getDate(t).getTime()===l.getDate(e).getTime()?t:ee(t,i),sn=Ii(0),nn=Ii(Me-1);class Ti{constructor(t){this.intl=t,this.boundRange=!1,this.insertUndividedMax=!1,this.min=null,this.max=null,this.step=0,this.toListItem=null}apply(t,e){return ee(t,e.getHours())}configure(t){const{boundRange:e=this.boundRange,insertUndividedMax:s=this.insertUndividedMax,min:a=this.min,max:r=this.max,part:h,step:u=this.step}=t;this.boundRange=e,this.insertUndividedMax=s,this.toListItem=c=>{const p=ee(A,c);return{text:this.intl.formatDate(p,h.pattern),value:p}},this.min=a,this.max=r,this.step=u}data(t){const[e]=this.range(t),s=en(e,this.step),a=h=>this.toListItem&&this.toListItem(s(h)),r=Ee(0,this.countFromMin(t)).map(a);return this.addLast(r),t&&this.addMissing(r,t),r}isRangeChanged(t,e){return!this.min||!this.max?!1:!l.isEqual(this.min,t)||!l.isEqual(this.max,e)}limitRange(t,e,s){return this.boundRange?[sn(t,s),nn(e,s)]:[t,e]}total(t){const e=this.insertUndividedMax&&this.isLastMissing(t)?1:0,s=this.isMissing(t)?1:0;return this.countFromMin(t)+s+e}selectedIndex(t){return Math.ceil(this.divideByStep(t))}valueInList(t){return t?this.insertUndividedMax&&this.lastHour(t)===t.getHours()||!this.isMissing(t):!0}addLast(t,e){return this.insertUndividedMax&&this.isLastMissing(e)&&this.toListItem&&t.push(this.toListItem(this.lastHour(e))),t}addMissing(t,e){if(this.valueInList(e))return t;if(this.toListItem){const s=this.toListItem(e.getHours());t.splice(this.selectedIndex(e),0,s)}return t}countFromMin(t){const[e,s]=this.range(t);return Math.floor(xi(s,e)/this.step)+1}isMissing(t){return t?this.selectedIndex(t)!==this.divideByStep(t):!1}isLastMissing(t){return this.max!==null&&this.isMissing(ee(this.max,this.lastHour(t)))}divideByStep(t){return xi(t.getHours(),this.min.getHours())/this.step}lastHour(t){return this.range(t)[1]}range(t){const[e,s]=this.limitRange(this.min,this.max,t);return[e.getHours(),s.getHours()]}}const Fe=60,Ci=(i=>t=>t%i)(Fe),an=(i,t)=>e=>Ci(i+e*t),Ei=(i,t)=>Ci(Fe+i-t),Vi=i=>(t,e)=>!e||t.getHours()===e.getHours()?t:ie(t,i),rn=Vi(0),on=Vi(Fe-1);class Oi{constructor(t){this.intl=t,this.toListItem=null,this.min=null,this.max=null,this.step=0,this.insertUndividedMax=!1}apply(t,e){return ie(t,e.getMinutes())}configure(t){const{insertUndividedMax:e=this.insertUndividedMax,min:s=this.min,max:a=this.max,part:r,step:h=this.step}=t;this.insertUndividedMax=e,this.toListItem=u=>{const c=ie(A,u);return{text:this.intl.formatDate(c,r.pattern),value:c}},this.min=s,this.max=a,this.step=h}data(t){const[e]=this.range(t),s=an(e,this.step),a=h=>this.toListItem&&this.toListItem(s(h)),r=Ee(0,this.countFromMin(t)).map(a);return this.addLast(r),t&&this.addMissing(r,t),r}isRangeChanged(t,e){return this.min!==null&&this.max!==null&&(!l.isEqual(this.min,t)||!l.isEqual(this.max,e))}limitRange(t,e,s){return[rn(t,s),on(e,s)]}total(t){const e=this.insertUndividedMax&&this.isLastMissing(t)?1:0,s=this.isMissing(t)?1:0;return this.countFromMin(t)+s+e}selectedIndex(t){return Math.ceil(this.divideByStep(t))}valueInList(t){return t?this.insertUndividedMax&&this.lastMinute(t)===t.getMinutes()||!this.isMissing(t):!0}addLast(t,e){return this.insertUndividedMax&&this.isLastMissing(e)&&this.toListItem&&t.push(this.toListItem(this.lastMinute(e))),t}addMissing(t,e){if(this.valueInList(e))return t;if(this.toListItem){const s=this.toListItem(e.getMinutes());t.splice(this.selectedIndex(e),0,s)}return t}countFromMin(t){const[e,s]=this.range(t);return Math.floor(Ei(s,e)/this.step)+1}isMissing(t){return t?this.selectedIndex(t)!==this.divideByStep(t):!1}isLastMissing(t){return this.max!==null&&this.isMissing(ie(this.max,this.lastMinute(t)))}divideByStep(t){return Ei(t.getMinutes(),this.min.getMinutes())/this.step}lastMinute(t){return this.range(t)[1]}range(t){const[e,s]=this.limitRange(this.min,this.max,t);return[e.getMinutes(),s.getMinutes()]}}const _e=60,Pi=(i=>t=>t%i)(_e),ln=(i,t)=>e=>Pi(i+e*t),ki=(i,t)=>Pi(_e+i-t),Ni=i=>(t,e)=>!e||t.getMinutes()===e.getMinutes()&&t.getHours()===e.getHours()?t:se(t,i),hn=Ni(0),cn=Ni(_e-1);class Mi{constructor(t){this.intl=t,this.toListItem=null,this.min=null,this.max=null,this.step=0,this.insertUndividedMax=!1}apply(t,e){return se(t,e.getSeconds())}configure(t){const{insertUndividedMax:e=this.insertUndividedMax,min:s=this.min,max:a=this.max,part:r,step:h=this.step}=t;this.insertUndividedMax=e,this.toListItem=u=>{const c=se(A,u);return{text:this.intl.formatDate(c,r.pattern),value:c}},this.min=s,this.max=a,this.step=h}data(t){const[e]=this.range(t),s=ln(e,this.step),a=h=>this.toListItem&&this.toListItem(s(h)),r=Ee(0,this.countFromMin(t)).map(a);return this.addLast(r),t&&this.addMissing(r,t),r}isRangeChanged(t,e){return this.min!==null&&this.max!==null&&(!l.isEqual(this.min,t)||!l.isEqual(this.max,e))}limitRange(t,e,s){return[hn(t,s),cn(e,s)]}total(t){const e=this.insertUndividedMax&&this.isLastMissing(t)?1:0,s=this.isMissing(t)?1:0;return this.countFromMin(t)+s+e}selectedIndex(t){return Math.ceil(this.divideByStep(t))}valueInList(t){return t?this.insertUndividedMax&&this.lastSecond(t)===t.getSeconds()||!this.isMissing(t):!0}divideByStep(t){return ki(t.getSeconds(),this.min.getSeconds())/this.step}addLast(t,e){return this.insertUndividedMax&&this.isLastMissing(e)&&this.toListItem&&t.push(this.toListItem(this.lastSecond(e))),t}addMissing(t,e){if(this.valueInList(e))return t;if(this.toListItem){const s=this.toListItem(e.getSeconds());t.splice(this.selectedIndex(e),0,s)}return t}countFromMin(t){const[e,s]=this.range(t);return Math.floor(ki(s,e)/this.step)+1}isMissing(t){return t?this.selectedIndex(t)!==this.divideByStep(t):!1}isLastMissing(t){return this.max!==null&&this.isMissing(se(this.max,this.lastSecond(t)))}lastSecond(t){return this.range(t)[1]}range(t){const[e,s]=this.limitRange(this.min,this.max,t);return[e.getSeconds(),s.getSeconds()]}}const un=2,Fi=.05,dn=100,pn=0,_i=9,mn={[d.Keys.end]:(i,t)=>i[i.length-1],[d.Keys.home]:(i,t)=>i[0],[d.Keys.up]:(i,t)=>i[t-1],[d.Keys.down]:(i,t)=>i[t+1]},Le={[K.dayperiod]:Si,[K.hour]:Ti,[K.minute]:Oi,[K.second]:Mi},It=class extends o.Component{constructor(i){super(i),this.intl=null,this._element=null,this.service=null,this.virtualization=null,this.topOffset=0,this.bottomOffset=0,this.itemHeight=0,this.listHeight=0,this.topThreshold=0,this.bottomThreshold=0,this.animateToIndex=!1,this.focus=t=>{Promise.resolve().then(()=>{this.element&&this.element.focus(t)})},this.itemOffset=t=>{if(!this.virtualization||!this.service)return-1;const e=this.service.selectedIndex(this.props.value),s=this.virtualization.activeIndex(),a=this.virtualization.itemOffset(s),r=Math.abs(Math.ceil(t)-a);if(e===s&&r<un)return a;const h=e>s;return h&&r>=this.bottomThreshold||!h&&r>this.topThreshold?this.virtualization.itemOffset(s+1):a},this.calculateHeights=()=>{this.dom.didCalculate&&(this.itemHeight=this.dom.itemHeight,this.listHeight=this.dom.timeListHeight,this.topOffset=(this.listHeight-this.itemHeight)/2,this.bottomOffset=this.listHeight-this.itemHeight,this.props.mobileMode&&(this.topOffset+=_i,this.bottomOffset+=_i*2),this.topThreshold=this.itemHeight*Fi,this.bottomThreshold=this.itemHeight*(1-Fi))},this.configureServices=({min:t,max:e,value:s}=this.props)=>{if(this.service){const[a,r]=this.service.limitRange(t||this.min,e||this.max,s||this.props.value);this.service.configure(this.serviceSettings({min:a,max:r}))}},this.serviceSettings=t=>{const e={boundRange:this.props.boundRange||It.defaultProps.boundRange,insertUndividedMax:!1,min:l.cloneDate(this.min),max:l.cloneDate(this.max),part:this.props.part,step:this.step},s=Object.assign({},e,t);return s.boundRange=s.part.type!=="hour"||this.props.boundRange||It.defaultProps.boundRange,s},this.handleScrollAction=({target:t,animationInProgress:e})=>{if(!(!this.virtualization||!this.service)&&t&&!e){this.animateToIndex=!1;const s=this.virtualization.itemIndex(this.itemOffset(t.scrollTop)),a=this.service.data(this.props.value)[s];this.handleChange(a)}},this.handleFocus=t=>{const{onFocus:e}=this.props;e&&e.call(void 0,t)},this.handleBlur=t=>{const{onBlur:e}=this.props;e&&e.call(void 0,t)},this.handleMouseOver=()=>{if(!this._element)return;const t=d.getActiveElement(document);document&&t!==this._element&&this.props.show&&this._element.focus({preventScroll:!0})},this.handleKeyDown=t=>{if(!this.service)return;const{keyCode:e}=t;(e===d.Keys.down||e===d.Keys.up||e===d.Keys.end||e===d.Keys.home)&&t.preventDefault();const a=(mn[t.keyCode]||d.noop)(this.service.data(this.props.value),this.service.selectedIndex(this.props.value));a&&this.handleChange(a)},this.handleChange=ns(t=>{if(!this.service)return;const e=this.service.apply(this.props.value,t.value);if(this.props.value.getTime()===e.getTime())return;const{onChange:s}=this.props;s&&s.call(void 0,e)},dn),this.dom=new tn}get element(){return this._element}get animate(){return!!(this.props.smoothScroll&&this.animateToIndex)}get min(){return this.props.min||It.defaultProps.min}get max(){return this.props.max||It.defaultProps.max}get step(){return this.props.step!==void 0&&this.props.step!==0?Math.floor(this.props.step):It.defaultProps.step}componentDidMount(){Promise.resolve().then(()=>{this._element&&(this.dom.calculateHeights(this._element),this.forceUpdate())})}componentDidUpdate(){if(!this.virtualization||!this.service)return;const i=this.service.selectedIndex(this.props.value);this.virtualization[this.animate?"animateToIndex":"scrollToIndex"](i),this.animateToIndex=!0}render(){if(!this.props.part.type||!Le[this.props.part.type])return;this.calculateHeights(),this.intl=x.provideIntlService(this),this.service=new Le[this.props.part.type](this.intl),this.configureServices();const i=this.service.data(this.props.value),t="translateY("+this.topOffset+"px)",e=this.service.total(this.props.value),s=o.createElement("ul",{style:{transform:t,msTransform:t},className:"k-reset"},i.map((a,r)=>o.createElement("li",{key:r,className:"k-item",onClick:()=>{this.handleChange(a)}},o.createElement("span",null,a.text))));return o.createElement("div",{className:"k-time-list",id:String(this.props.id||""),tabIndex:this.props.disabled?-1:0,ref:a=>{this._element=a},onKeyDown:this.handleKeyDown,onFocus:this.handleFocus,onBlur:this.handleBlur,onMouseOver:this.handleMouseOver},this.dom.didCalculate?o.createElement(ft,{bottomOffset:this.bottomOffset,children:s,className:"k-time-container",itemHeight:this.itemHeight,maxScrollDifference:this.listHeight,onScrollAction:this.handleScrollAction,ref:a=>{this.virtualization=a},role:"presentation",skip:pn,tabIndex:-1,take:e,topOffset:this.topOffset,total:e}):o.createElement("div",{className:"k-time-container"},s))}};let zt=It;zt.propTypes={id:n.number,max:n.instanceOf(Date),min:n.instanceOf(Date),part:function(i,t,e){const s=i[t];if(!s||!Le[s.type])throw new Error(`
15
+ `):null}},rt.defaultProps={disabled:!1,min:it,max:st,navigation:!0,defaultActiveView:"month",defaultValue:null,topView:"century",bottomView:"month"};const ui=d.createPropsContext(),te=d.withIdHOC(d.withPropsContext(ui,rt));te.displayName="KendoReactCalendar",I.registerForIntl(rt);class Os{constructor(){this.symbols="",this.partMap=[]}}const Vs="d",Ps="wide",ks=(i,t,e,s)=>{const a=i[s+i.length-e.length],r=i.substring(0,s+i.length-e.length),h=e.substring(0,s),u=[];if(r===h&&s>0)return u.push([t[s-1],h[s-1]]),u;if(r.indexOf(h)===0&&(h.length===0||t[h.length-1]!==t[h.length])){let c="";h.length===1&&u.push([t[0],h[0]]);for(let p=h.length;p<r.length;p++)t[p]!==c&&t[p]!=="_"&&(c=t[p],u.push([c,""]));return u}if(h.indexOf(r)===0||t[s-1]==="_"){let c=t[0];for(let p=Math.max(0,r.length-1);p<t.length;p++)if(t[p]!=="_"){c=t[p];break}return[[c,h[s-1]]]}return h[h.length-1]===" "||h[h.length-1]===a?[[t[s-1],"_"]]:[[t[s-1],h[s-1]]]},Ns=(i,t)=>(i[t.pattern[0]]=t.type,i),Ms=(i,t,e)=>i===null||!(t&&t>i||e&&e<i),Fs=["k-widget","k-dateinput"];class _s{constructor(t,e,s){this.year=!0,this.month=!0,this.date=!0,this.hours=!0,this.minutes=!0,this.seconds=!0,this.milliseconds=!0,this.leadingZero=null,this.typedMonthPart="",this.knownParts="adHhmMsEy",this.symbols={E:"E",H:"H",M:"M",a:"a",d:"d",h:"h",m:"m",s:"s",y:"y"},this._value=l.getDate(new Date),this.intlProvider=t,this.formatPlaceholder=e,this.format=s,this.monthNames=this.allFormatedMonths()}get intl(){return this.intlProvider()}get value(){return this._value}setValue(t){t?l.isEqual(t,this._value)||(this._value=l.cloneDate(t),this.modifyExisting(!0)):(this._value=l.getDate(new Date),this.modifyExisting(!1))}hasValue(){const t=(e,s)=>e||s.type!=="literal"&&s.type!=="dayperiod"&&this.getExisting(s.pattern[0]);return this.intl.splitDateFormat(this.format).reduce(t,!1)}getDateObject(){for(let t=0;t<this.knownParts.length;t++)if(!this.getExisting(this.knownParts[t]))return null;return l.cloneDate(this.value)}getTextAndFormat(){return this.merge(this.intl.formatDate(this.value,this.format),this.dateFormatString(this.value,this.format))}modifyExisting(t){const e=this.dateFormatString(this.value,this.format).symbols;for(let s=0;s<e.length;s++)this.setExisting(e[s],t)}getExisting(t){switch(t){case"y":return this.year;case"M":case"L":return this.month;case"d":return this.date;case"E":return this.date&&this.month&&this.year;case"h":case"H":return this.hours;case"m":return this.minutes;case"s":return this.seconds;default:return!0}}setExisting(t,e){switch(t){case"y":this.year=e,e===!1&&this._value.setFullYear(2e3);break;case"M":this.month=e,e===!1&&this._value.setMonth(0);break;case"d":this.date=e;break;case"h":case"H":this.hours=e;break;case"m":this.minutes=e;break;case"s":this.seconds=e;break;default:return}}modifyPart(t,e){let s=l.cloneDate(this.value);switch(t){case"y":s.setFullYear(s.getFullYear()+e);break;case"M":s=l.addMonths(this.value,e);break;case"d":case"E":s.setDate(s.getDate()+e);break;case"h":case"H":s.setHours(s.getHours()+e);break;case"m":s.setMinutes(s.getMinutes()+e);break;case"s":s.setSeconds(s.getSeconds()+e);break;case"a":s.setHours(s.getHours()+12*e);break}this.setExisting(t,!0),this._value=s}parsePart(t,e){if(this.resetLeadingZero(),!e)return this.setExisting(t,!1),{value:null};const s=this.intl.formatDate(this.value,this.format),a=this.dateFormatString(this.value,this.format),r=a.symbols;let h=!1,u="",c="",p="";for(let v=0;v<s.length;v++)r[v]===t?(c+=this.getExisting(t)?s[v]:"0",h=!0):h?p+=s[v]:u+=s[v];let m=null;const f=this.matchMonth(e);for(;c.length>0&&c.charAt(0)==="0";)c=c.slice(1);c.length>=4&&(c="");for(let v=0;v<2;v++){let w=c+e,T=parseInt(w,10);if(m=this.intl.parseDate(u+w+p,this.format),!m&&!isNaN(T)&&!isNaN(parseInt(e,10))){if(t==="M"&&!f){const E=T-1;E>-1&&E<12&&(m=l.cloneDate(this.value),m.setMonth(E),m.getMonth()!==E&&(m=l.lastDayOfMonth(l.addMonths(m,-1))))}t==="y"&&(m=l.createDate(parseInt(w,10),this.month?this.value.getMonth():0,this.date?this.value.getDate():1,this.hours?this.value.getHours():0,this.minutes?this.value.getMinutes():0,this.seconds?this.value.getSeconds():0,this.milliseconds?this.value.getMilliseconds():0),this.date&&m.getDate()!==this.value.getDate()&&(m=l.lastDayOfMonth(l.addMonths(m,-1))))}if(m)return this._value=m,this.setExisting(t,!0),{value:this.value};c=""}return f&&(m=this.intl.parseDate(u+f+p,this.format),m)?(this._value=m,this.setExisting(t,!0),{value:this.value}):(e==="0"&&(this.leadingZero=this.isAbbrMonth(a.partMap,t)?null:{[t]:!0},this.setExisting(t,!1)),{value:null})}symbolMap(t){return this.intl.splitDateFormat(this.format).reduce(Ns,{})[t]}resetLeadingZero(){const t=this.leadingZero!==null;return this.leadingZero=null,t}isAbbrMonth(t,e){const s=this.partPattern(t,e);return s.type==="month"&&s.names}partPattern(t,e){return t.filter(s=>s.pattern.indexOf(e)!==-1)[0]}matchMonth(t){if(this.typedMonthPart+=t.toLowerCase(),this.monthNames.length===0)return"";for(;this.typedMonthPart.length>0;){for(let s=0;s<this.monthNames.length;s++)if(this.monthNames[s].toLowerCase().indexOf(this.typedMonthPart)===0)return this.monthNames[s];const e=parseInt(this.typedMonthPart,10);if(e>=1&&e<=12&&e.toString()===this.typedMonthPart)return this.monthNames[e-1];this.typedMonthPart=this.typedMonthPart.substring(1,this.typedMonthPart.length)}return""}allFormatedMonths(){const t=this.intl.splitDateFormat(this.format);for(let e=0;e<t.length;e++)if(t[e].type==="month"&&t[e].names)return this.intl.dateFormatNames(t[e].names);return[]}dateFormatString(t,e){const s=this.intl.splitDateFormat(e),a=[],r=[];for(let u=0;u<s.length;u++){let c=this.intl.formatDate(t,{pattern:s[u].pattern}).length;for(;c>0;)a.push(this.symbols[s[u].pattern[0]]||"_"),r.push(s[u]),c--}const h=new Os;return h.symbols=a.join(""),h.partMap=r,h}merge(t,e){let s="",a="",r=e.symbols;for(let h=r.length-1;h>=0;h--)if(this.knownParts.indexOf(r[h])===-1||this.getExisting(r[h]))s=t[h]+s,a=r[h]+a;else{const u=r[h];for(;h>=0&&u===r[h];)h--;for(h++,this.leadingZero&&this.leadingZero[u]?s="0"+s:s=this.dateFieldName(e.partMap[h])+s;a.length<s.length;)a=r[h]+a}return{text:s,format:a}}dateFieldName(t){const e=this.formatPlaceholder||"wide";return e[t.type]?e[t.type]:e==="formatPattern"?t.pattern:this.intl.dateFieldName(Object.assign(t,{nameType:e}))}}const K={dayperiod:"dayperiod",hour:"hour",millisecond:"millisecond",minute:"minute",second:"second"},Ce=i=>(t,e)=>{const s=l.cloneDate(t);return s[i](e),s},di=[{type:K.hour,getter:i=>i.getHours()},{type:K.minute,getter:i=>i.getMinutes()},{type:K.second,getter:i=>i.getSeconds()},{type:K.millisecond,getter:i=>i.getMilliseconds()}],Ls=i=>(t,e)=>i(t),Hs=i=>(t,e)=>i(e),As=i=>i.reduce((t,e)=>(t[e.type]=e.type,t),{}),zs=i=>t=>i[t.type]?Hs(t.getter):Ls(t.getter),Bs=i=>t=>i.map(zs(As(t))),qs=(i,t,e,s)=>a=>{const r=i(a),h=i(e);return s==="hour"?r-(r-h)%t:a.getTime()<=e.getTime()&&r!==0&&r<=h?Math.ceil(r/t)*t:r-r%t},Rs=i=>(t,e)=>i.map(s=>{const a=Math.floor(t[s.type]);return a?qs(s.getter,a,e,s.type):s.getter}),Ws=Bs(di),pi=Rs(di),Us=i=>(t,e)=>(t.setHours(...i.map(s=>s(t,e))),t),mi=i=>t=>{const e=l.cloneDate(t);return e.setHours(...i.map(s=>s(e))),e},ee=Ce("setHours"),ie=Ce("setMinutes"),se=Ce("setSeconds"),ut=()=>new Date,Ee=(i,t,e=1)=>{const s=[];for(let a=i;a<t;a=a+e)s.push(a);return s},Oe=(i,t,e)=>({candidateValue:B(H,i),maxValue:l.addDays(B(H,e),t.getHours()<e.getHours()?0:1),minValue:B(H,t)}),Ys=(i,t,e)=>{if(!i||!t||!e)return i;const{candidateValue:s,minValue:a,maxValue:r}=Oe(i,t,e);return s<a?B(i,t):s>r?B(i,e):i},Ve=(i,t,e)=>{if(!i||!t||!e)return!0;const{candidateValue:s,minValue:a,maxValue:r}=Oe(i,t,e);return a<=s&&s<=r},$s=(i,t,e)=>{if(i===null)return!0;const{candidateValue:s,minValue:a,maxValue:r}=Oe(i,t,e);return a<=s&&s<=r},Ks=(i,t)=>{if(i===null||t===null)return!1;const e=B(H,i),s=B(H,t);return e.getTime()<s.getHours()},js=(i,t)=>{if(i===null||t===null)return!1;const e=B(H,i);return B(H,t).getTime()<e.getHours()},Zs="Please enter a valid value!",j=class extends o.Component{constructor(i){super(i),this.kendoDate=null,this.currentFormat="",this.paste=!1,this._element=null,this._wrapper=null,this._lastSelectedSymbol="",this.focus=()=>{this._element&&this._element.focus()},this.setValidity=()=>{this.element&&this.element.setCustomValidity&&this.element.setCustomValidity(this.validity.valid?"":this.props.validationMessage||j.defaultProps.validationMessage)},this.updateOnPaste=t=>{if(!this.element||!this.kendoDate)return;const e=I.provideIntlService(this).parseDate(this.element.value,this.props.format)||this.value,s=this.value;this.kendoDate.setValue(e),this.triggerChange(t,s)},this.spinnersMouseDown=t=>{t.preventDefault();const e=d.getActiveElement(document);this.element&&e!==this.element&&this.element.focus({preventScroll:!0})},this.handlePaste=()=>{this.paste=!0},this.elementChange=t=>{if(!this.element||!this.kendoDate)return;if(this.paste){this.updateOnPaste(t),this.paste=!1;return}const{text:e,format:s}=this.kendoDate.getTextAndFormat();this.currentFormat=s;const a=this.value,r=ks(e,this.currentFormat,this.element.value,this.selection.start),h=r.length===1&&r[0][1]==="_";if(!h)for(let u=0;u<r.length;u++)this.kendoDate.parsePart(r[u][0],r[u][1]);r.length&&r[0][0]!=="_"&&this.setSelection(this.selectionBySymbol(r[0][0])),h&&this.switchDateSegment(1),this.triggerChange(t,a)},this.elementClick=t=>{this.setSelection(this.selectionByIndex(this.selection.start))},this.nativeWheel=t=>{d.getActiveElement(document)===this.element&&t.preventDefault()},this.wheel=t=>{d.getActiveElement(document)===this.element&&(t.nativeEvent.deltaY<0&&this.increasePart(t),t.nativeEvent.deltaY>0&&this.decreasePart(t))},this.increasePart=t=>{this.modifyDateSegmentValue(1,t)},this.decreasePart=t=>{this.modifyDateSegmentValue(-1,t)},this.elementKeyDown=t=>{if(!t.altKey){switch(t.keyCode){case 37:this.switchDateSegment(-1);break;case 38:this.modifyDateSegmentValue(1,t);break;case 39:this.switchDateSegment(1);break;case 40:this.modifyDateSegmentValue(-1,t);break;default:return}t.preventDefault()}},this.elementOnFocus=t=>{this.wrapper&&this.wrapper.classList.add("k-focus"),this.setState({focused:!0})},this.elementOnBlur=t=>{this.wrapper&&this.wrapper.classList.remove("k-focus"),this.setState({focused:!1})},d.validatePackage(gt),this.state={focused:!1}}get _inputId(){return this.props.id+"-accessibility-id"}componentDidMount(){this.setValidity(),this.wrapper&&this.wrapper.addEventListener("wheel",this.nativeWheel,{passive:!1})}componentDidUpdate(i,t){this._lastSelectedSymbol&&t.focused===this.state.focused?this.setSelection(this.selectionBySymbol(this._lastSelectedSymbol)):this.props.placeholder!==void 0&&this.selection.start===this.selection.end&&this.setSelection({start:0,end:this.currentFormat.length}),this.setValidity()}componentWillUnmount(){this.wrapper&&this.wrapper.removeEventListener("wheel",this.nativeWheel)}render(){const{size:i=j.defaultProps.size,fillMode:t=j.defaultProps.fillMode,rounded:e=j.defaultProps.rounded}=this.props;this.props._ref&&(this.props._ref.current=this);const s=I.provideLocalizationService(this),a={...j.defaultProps,...this.props},{name:r,label:h,id:u}=a,c=this.text,p=c===this.props.placeholder?"":c,m=c===this.props.placeholder?c:void 0,f=u||this._inputId,v=!this.validityStyles||this.validity.valid;let w=[...Fs];this.props.className&&w.push(this.props.className);const T=o.createElement(d.AsyncFocusBlur,{onFocus:this.elementOnFocus,onBlur:this.elementOnBlur},({onFocus:E,onBlur:V})=>o.createElement("span",{ref:y=>{this._wrapper=y},style:h?void 0:{width:this.props.width},dir:this.props.dir,className:d.classNames("k-dateinput","k-input",{[`k-input-${d.kendoThemeMaps.sizeMap[i]||i}`]:i,[`k-input-${t}`]:t,[`k-rounded-${d.kendoThemeMaps.roundedMap[e]||e}`]:e,"k-invalid":!v,"k-required":this.required,"k-disabled":this.props.disabled},this.props.className),onFocus:E,onBlur:V},o.createElement("input",{role:this.props.ariaRole||"textbox",readOnly:this.props.readonly,tabIndex:this.props.tabIndex,disabled:this.props.disabled,title:this.props.title!==void 0?this.props.title:c,type:"text",spellCheck:!1,autoComplete:"off",autoCorrect:"off",className:"k-input-inner",id:f,"aria-label":this.props.ariaLabel,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,"aria-haspopup":this.props.ariaHasPopup,"aria-disabled":this.props.disabled,"aria-expanded":this.props.ariaExpanded,"aria-controls":this.props.ariaControls,onWheel:this.wheel,onClick:this.elementClick,onInput:this.elementChange,onPaste:this.handlePaste,onKeyDown:this.elementKeyDown,onChange:d.noop,value:p,placeholder:m,name:r,ref:y=>this._element=y}),this.props.children,this.props.spinners&&o.createElement("span",{className:"k-input-spinner k-spin-button",onMouseDown:this.spinnersMouseDown},o.createElement(F.Button,{tabIndex:-1,type:"button",rounded:null,className:"k-spinner-increase",icon:"caret-alt-up",svgIcon:X.caretAltUpIcon,"aria-label":s.toLanguageString(wt,O[wt]),title:s.toLanguageString(wt,O[wt]),onClick:this.increasePart}),o.createElement(F.Button,{tabIndex:-1,type:"button",rounded:null,className:"k-spinner-decrease",icon:"caret-alt-down",svgIcon:X.caretAltDownIcon,"aria-label":s.toLanguageString(bt,O[bt]),title:s.toLanguageString(bt,O[bt]),onClick:this.decreasePart}))));return h?o.createElement(Ue.FloatingLabel,{label:h,editorId:f,editorValue:c,editorValid:v,editorDisabled:this.props.disabled,children:T,style:{width:this.props.width}}):T}get value(){return this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.kendoDate&&this.kendoDate.getDateObject()}get name(){return this.props.name}get min(){return this.props.min!==void 0?this.props.min:j.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:j.defaultProps.max}get text(){const i={...lt.defaultProps,...this.props},{formatPlaceholder:t=j.defaultProps.formatPlaceholder,format:e=j.defaultProps.format,value:s,defaultValue:a}=i;this.kendoDate===null?(this.kendoDate=new _s(this.intl.bind(this),t,e),this.kendoDate.setValue(s||a||null)):(this.kendoDate.format=e,this.kendoDate.formatPlaceholder=t),s!==void 0&&this.value!==s&&this.kendoDate.setValue(s);const{text:r,format:h}=this.kendoDate.getTextAndFormat();return this.currentFormat=h,i.placeholder!==null&&i.placeholder!==void 0&&!this.state.focused&&!this.kendoDate.hasValue()?i.placeholder:r}get validity(){const i=Ms(this.value,this.min,this.max)&&Ve(this.value,this.props.minTime,this.props.maxTime),t=this.props.validationMessage!==void 0,e=(!this.required||this.value!==null)&&i,s=this.props.valid!==void 0?this.props.valid:e;return{customError:t,rangeOverflow:this.value&&this.max.getTime()<this.value.getTime()||!1,rangeUnderflow:this.value&&this.value.getTime()<this.min.getTime()||!1,valid:s,valueMissing:this.value===null}}get element(){return this._element}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:j.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:j.defaultProps.required}get wrapper(){return this._wrapper}intl(){return I.provideIntlService(this)}get selection(){let i={start:0,end:0};return this.element!==null&&this.element.selectionStart!==void 0&&(i={start:this.element.selectionStart,end:this.element.selectionEnd}),i}setSelection(i){this._lastSelectedSymbol=this.currentFormat[i.start],window.requestAnimationFrame(()=>{const t=d.getActiveElement(document);this.element&&t===this.element&&!this.props.disableSelection&&this.element.setSelectionRange(i.start,i.end)})}triggerChange(i,t){this.valueDuringOnChange=this.value,this.forceUpdate(),this.props.onChange&&!l.isEqual(t,this.value)&&this.props.onChange.call(void 0,{syntheticEvent:i,nativeEvent:i.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0}selectionBySymbol(i){let t=-1,e=0;for(let s=0;s<this.currentFormat.length;s++)this.currentFormat[s]===i&&(e=s+1,t===-1&&(t=s));return t<0&&(t=0),{start:t,end:e}}selectionByIndex(i){let t={start:i,end:i};for(let e=i,s=i-1;e<this.currentFormat.length||s>=0;e++,s--){if(e<this.currentFormat.length&&this.currentFormat[e]!=="_"){t=this.selectionBySymbol(this.currentFormat[e]);break}if(s>=0&&this.currentFormat[s]!=="_"){t=this.selectionBySymbol(this.currentFormat[s]);break}}return t}switchDateSegment(i){const{start:t,end:e}=this.selection;if(t<e&&this.currentFormat[t]!==this.currentFormat[e-1]){this.setSelection(this.selectionByIndex(i>0?t:e-1));return}const s=this.currentFormat[t];let a=t+i;for(;a>0&&a<this.currentFormat.length&&!(this.currentFormat[a]!==s&&this.currentFormat[a]!=="_");)a+=i;if(this.currentFormat[a]==="_")return;let r=a;for(;r>=0&&r<this.currentFormat.length&&this.currentFormat[r]===this.currentFormat[a];)r+=i;a>r&&(r+1!==t||a+1!==e)?this.setSelection({start:r+1,end:a+1}):a<r&&(a!==t||r!==e)&&this.setSelection({start:a,end:r})}modifyDateSegmentValue(i,t){if(!this.kendoDate)return;const e=this.value,s=this.currentFormat[this.selection.start],a=this.kendoDate.symbolMap(s),r=((this.props.steps||{})[a]||1)*i;this.kendoDate.modifyPart(s,r),this.triggerChange(t,e)}};let ot=j;ot.displayName="DateInput",ot.propTypes={value:n.instanceOf(Date),format:n.oneOfType([n.string,n.shape({skeleton:n.string,pattern:n.string,date:n.oneOf(["short","medium","long","full"]),time:n.oneOf(["short","medium","long","full"]),datetime:n.oneOf(["short","medium","long","full"]),era:n.oneOf(["narrow","short","long"]),year:n.oneOf(["numeric","2-digit"]),month:n.oneOf(["numeric","2-digit","narrow","short","long"]),day:n.oneOf(["numeric","2-digit"]),weekday:n.oneOf(["narrow","short","long"]),hour:n.oneOf(["numeric","2-digit"]),hour12:n.bool,minute:n.oneOf(["numeric","2-digit"]),second:n.oneOf(["numeric","2-digit"]),timeZoneName:n.oneOf(["short","long"])})]),formatPlaceholder:n.oneOfType([n.oneOf(["wide","narrow","short","formatPattern"]),n.shape({year:n.string,month:n.string,day:n.string,hour:n.string,minute:n.string,second:n.string})]),width:n.oneOfType([n.string,n.number]),tabIndex:n.number,title:n.string,steps:n.shape({year:n.number,month:n.number,day:n.number,hour:n.number,minute:n.number,second:n.number}),min:n.instanceOf(Date),max:n.instanceOf(Date),disabled:n.bool,spinners:n.bool,name:n.string,dir:n.string,label:n.string,id:n.string,ariaLabelledBy:n.string,ariaDescribedBy:n.string,ariaLabel:n.string,ariaRole:n.string,ariaHasPopup:n.oneOfType([n.bool,n.string]),ariaExpanded:n.oneOfType([n.bool]),onChange:n.func,validationMessage:n.string,required:n.bool,validate:n.bool,valid:n.bool,size:n.oneOf([null,"small","medium","large"]),rounded:n.oneOf([null,"small","medium","large","full"]),fillMode:n.oneOf([null,"solid","flat","outline"])},ot.defaultProps={format:Vs,size:"medium",rounded:"medium",fillMode:"solid",formatPlaceholder:Ps,spinners:!1,disabled:!1,max:l.cloneDate(st),min:l.cloneDate(it),minTime:l.cloneDate(ct),maxTime:l.cloneDate(nt),required:!1,validityStyles:!0,validationMessage:Zs,placeholder:null,ariaHasPopup:"grid"};const gi=d.createPropsContext(),lt=d.withIdHOC(d.withPropsContext(gi,ot));lt.displayName="KendoReactDateInput",I.registerForIntl(ot),I.registerForLocalization(ot);const fi=F.Button,vi=o.forwardRef((i,t)=>{const{_ref:e}=i,s=o.useRef(null);o.useImperativeHandle(t,()=>s.current),o.useImperativeHandle(e,()=>s.current);const a=o.useMemo(()=>d.classNames(i.className,"k-picker-wrap"),[i.className]);return o.createElement("span",{ref:s,id:i.id,style:i.style,className:a,tabIndex:i.tabIndex},i.children)}),Gs=i=>{const[t,e]=o.useState(!1),s=()=>{i.current&&e(!!i.current.text)};return o.useEffect(s),{editorValue:t}},Pe=i=>{const t=Gs(i.dateInput);return o.createElement(Ue.FloatingLabel,{...i,...t})},wi=500,ne=i=>{const{footer:t,children:e,windowWidth:s=0,navigatable:a,navigatableElements:r,expand:h,animation:u,onClose:c,adaptiveTitle:p,mobileFilter:m}=i,f={navigatable:a||!1,navigatableElements:r||[],expand:h,animation:u!==!1,onClose:c,animationStyles:s<=wi?{top:0,width:"100%",height:"100%"}:void 0,className:s<=wi?"k-adaptive-actionsheet k-actionsheet-fullscreen":"k-adaptive-actionsheet k-actionsheet-bottom"};return o.createElement(ht.ActionSheet,{...f},o.createElement(ht.ActionSheetHeader,{className:"k-text-center"},o.createElement("div",{className:"k-actionsheet-titlebar-group k-hbox"},o.createElement("div",{className:"k-actionsheet-title"},o.createElement("div",null,p)),o.createElement("div",{className:"k-actionsheet-actions"},o.createElement(F.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",icon:"x",svgIcon:X.xIcon,onClick:c}))),m&&o.createElement("div",{className:"k-actionsheet-titlebar-group k-actionsheet-filter"},m)),e,t&&o.createElement(ht.ActionSheetFooter,{className:"k-actions k-actions-stretched"},o.createElement(F.Button,{size:"large",tabIndex:0,"aria-label":t.cancelText,"aria-disabled":"false",type:"button",onClick:t.onCancel},t.cancelText),o.createElement(F.Button,{tabIndex:0,themeColor:"primary",size:"large","aria-label":t.applyText,"aria-disabled":"false",type:"button",onClick:t.onApply},t.applyText)))},ae=768,q=class extends o.Component{constructor(i){super(i),this._element=null,this._dateInput=o.createRef(),this._calendar=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.focus=()=>{this.dateInput&&this.dateInput.focus()},this.setCalendarRef=t=>{this._calendar=t},this.nextValue=(t,e)=>t.value!==void 0?t.value:e.value,this.nextShow=(t,e)=>t.show!==void 0?t.show:e.show,this.renderPopup=()=>{const{disabled:t,min:e,max:s,weekNumber:a,focusedDate:r}=this.props,{popupClass:h,...u}=this.props.popupSettings,c=this.show,p=this.value,m=p&&l.getDate(p),f=d.classNames("k-calendar-container k-group k-reset",h),v={popupClass:"k-datepicker-popup",show:c,anchor:this._element,className:f,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...u},w={disabled:t,value:m,min:e,max:s,weekNumber:a,focusedDate:r,className:this.mobileMode?"k-calendar-lg":"",navigation:!this.mobileMode,onChange:this.handleCalendarValueChange};return this.mobileMode?o.createElement(this.calendarComp,{_ref:this.setCalendarRef,...w}):o.createElement(this.popupComp,{...v},o.createElement(this.calendarComp,{_ref:this.setCalendarRef,...w}))},this.renderAdaptivePopup=()=>{const{windowWidth:t=0}=this.state,e={expand:this.show,onClose:this.handleBlur,adaptiveTitle:this.props.adaptiveTitle,windowWidth:t};return o.createElement(ne,{...e},o.createElement(ht.ActionSheetContent,{className:"!k-overflow-hidden"},this.renderPopup()))},this.handleInputValueChange=t=>{this.handleValueChange(t.value,t)},this.handleCalendarValueChange=t=>{const e=this.mergeTime(t.value);this.handleValueChange(e,t)},this.handleValueChange=(t,e)=>{this.setState({value:l.cloneDate(t||void 0)}),this.valueDuringOnChange=t,this.showDuringOnChange=!1,this.mobileMode||(this.shouldFocusDateInput=!0);const{onChange:s}=this.props;s&&s.call(void 0,{syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:this.value,show:this.show,target:this}),this.valueDuringOnChange=void 0,this.showDuringOnChange=void 0,this.setShow(!1)},this.handleFocus=()=>{this.setState({focused:!0})},this.handleBlur=()=>{this.setState({focused:!1}),this.setShow(!1)},this.handleIconClick=()=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=t=>{t.preventDefault()},this.handleKeyDown=t=>{const{altKey:e,keyCode:s}=t;if(s===d.Keys.esc){this.shouldFocusDateInput=!0,this.setShow(!1);return}e&&(s===d.Keys.up||s===d.Keys.down)&&(t.preventDefault(),t.stopPropagation(),this.shouldFocusDateInput=s===d.Keys.up,this.setShow(s===d.Keys.down))},d.validatePackage(gt),this.state={value:this.props.defaultValue||q.defaultProps.defaultValue,show:this.props.defaultShow||q.defaultProps.defaultShow,focused:!1}}get _popupId(){return this.props.id+"-popup-id"}get document(){if(d.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=ae&&this.props.adaptive)}get dateInput(){return this._dateInput.current}get calendar(){return this._calendar}get value(){const i=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return i!==null?l.cloneDate(i):null}get show(){return this.showDuringOnChange!==void 0?this.showDuringOnChange:this.props.show!==void 0?this.props.show:this.state.show}get name(){return this.props.name}get min(){return this.props.min!==void 0?this.props.min:q.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:q.defaultProps.max}get dateInputComp(){return this.props.dateInput||q.defaultProps.dateInput}get toggleButtonComp(){return this.props.toggleButton||q.defaultProps.toggleButton}get calendarComp(){return this.props.calendar||q.defaultProps.calendar}get popupComp(){return this.props.popup||q.defaultProps.popup}get pickerWrapComp(){return this.props.pickerWrap||q.defaultProps.pickerWrap}get validity(){const i=je(this.value,this.min,this.max),t=this.props.validationMessage!==void 0,e=(!this.required||this.value!==null)&&i,s=this.props.valid!==void 0?this.props.valid:e;return{customError:t,rangeOverflow:this.value&&this.max.getTime()<this.value.getTime()||!1,rangeUnderflow:this.value&&this.value.getTime()<this.min.getTime()||!1,valid:s,valueMissing:this.value===null}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:q.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:q.defaultProps.required}componentDidMount(){var i;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){this._calendar&&this._calendar.element&&this.show&&!this.prevShow&&this._calendar.element.focus({preventScroll:!0}),this.dateInput&&this.dateInput.element&&!this.show&&this.shouldFocusDateInput&&this.dateInput.element.focus({preventScroll:!0}),this.prevShow=this.show,this.shouldFocusDateInput=!1}componentWillUnmount(){var i;clearTimeout(this.nextTickId),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:i=q.defaultProps.size,rounded:t=q.defaultProps.rounded,fillMode:e=q.defaultProps.fillMode,disabled:s,tabIndex:a,title:r,id:h,format:u,formatPlaceholder:c,min:p,max:m,className:f,width:v,name:w,validationMessage:T,required:E,validityStyles:V,ariaLabelledBy:y,ariaDescribedBy:P,ariaLabel:b}=this.props,R=this.show,k=this.value,M=!this.validityStyles||this.validity.valid,W={disabled:s,format:u,formatPlaceholder:c,id:h,ariaLabelledBy:y,ariaDescribedBy:P,ariaLabel:b,max:m,min:p,name:w,onChange:this.handleInputValueChange,required:E,tabIndex:R?-1:a,title:r,valid:this.validity.valid,validationMessage:T,validityStyles:V,value:k,label:void 0,placeholder:this.state.focused?null:this.props.placeholder,ariaExpanded:this.show,size:null,fillMode:null,rounded:null},C=I.provideLocalizationService(this).toLanguageString(jt,O[jt]),N=o.createElement(d.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.mobileMode?void 0:this.handleBlur,onSyncBlur:this.props.onBlur,onSyncFocus:this.props.onFocus},({onFocus:tt,onBlur:G})=>o.createElement(o.Fragment,null,o.createElement("span",{ref:mt=>{this._element=mt},className:d.classNames("k-input","k-datepicker",{[`k-input-${d.kendoThemeMaps.sizeMap[i]||i}`]:i,[`k-rounded-${d.kendoThemeMaps.roundedMap[t]||t}`]:t,[`k-input-${e}`]:e,["k-invalid"]:!M,["k-required"]:this.required,["k-disabled"]:this.props.disabled},f),onKeyDown:this.handleKeyDown,style:{width:v},onFocus:tt,onBlur:G,onClick:this.mobileMode?this.handleIconClick:void 0},o.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",readonly:this.mobileMode,ariaExpanded:this.show,ariaControls:this._popupId,...W}),o.createElement(this.toggleButtonComp,{type:"button",icon:"calendar",svgIcon:X.calendarIcon,title:C,className:"k-input-button",rounded:null,onClick:this.mobileMode?void 0:this.handleIconClick,"aria-label":C,onMouseDown:this.handleIconMouseDown}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup()));return this.props.label?o.createElement(Pe,{dateInput:this._dateInput,label:this.props.label,editorId:h,editorValid:M,editorDisabled:this.props.disabled,children:N,style:{width:this.props.width}}):N}setShow(i){const{onOpen:t,onClose:e}=this.props;this.show!==i&&(this.setState({show:i}),i&&t&&t.call(void 0,{target:this}),!i&&e&&e.call(void 0,{target:this}))}mergeTime(i){return this.value&&i?B(i,this.value):i}nextTick(i){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>i())}calculateMedia(i){for(let t of i)this.setState({windowWidth:t.target.clientWidth})}};let It=q;It.displayName="DatePicker",It.propTypes={className:n.string,defaultShow:n.bool,defaultValue:n.instanceOf(Date),disabled:n.bool,focusedDate:n.instanceOf(Date),format:n.oneOfType([n.string,n.shape({skeleton:n.string,pattern:n.string,date:n.oneOf(["short","medium","long","full"]),time:n.oneOf(["short","medium","long","full"]),datetime:n.oneOf(["short","medium","long","full"]),era:n.oneOf(["narrow","short","long"]),year:n.oneOf(["numeric","2-digit"]),month:n.oneOf(["numeric","2-digit","narrow","short","long"]),day:n.oneOf(["numeric","2-digit"]),weekday:n.oneOf(["narrow","short","long"]),hour:n.oneOf(["numeric","2-digit"]),hour12:n.bool,minute:n.oneOf(["numeric","2-digit"]),second:n.oneOf(["numeric","2-digit"]),timeZoneName:n.oneOf(["short","long"])})]),formatPlaceholder:n.oneOfType([n.oneOf(["wide","narrow","short","formatPattern"]),n.shape({year:n.string,month:n.string,day:n.string,hour:n.string,minute:n.string,second:n.string})]),id:n.string,ariaLabelledBy:n.string,ariaDescribedBy:n.string,ariaLabel:n.string,min:n.instanceOf(Date),max:n.instanceOf(Date),name:n.string,popupSettings:n.shape({animate:n.bool,appendTo:n.any,popupClass:n.string}),show:n.bool,tabIndex:n.number,title:n.string,value:n.instanceOf(Date),weekNumber:n.bool,width:n.oneOfType([n.number,n.string]),validationMessage:n.string,required:n.bool,validate:n.bool,valid:n.bool,size:n.oneOf([null,"small","medium","large"]),rounded:n.oneOf([null,"small","medium","large","full"]),fillMode:n.oneOf([null,"solid","flat","outline"]),adaptive:n.bool,adaptiveTitle:n.string},It.defaultProps={defaultShow:!1,defaultValue:null,dateInput:lt,calendar:te,toggleButton:fi,popup:qt.Popup,pickerWrap:vi,disabled:!1,format:"d",max:st,min:it,popupSettings:{},tabIndex:0,weekNumber:!1,required:!1,validityStyles:!0,size:"medium",rounded:"medium",fillMode:"solid"};const bi=d.createPropsContext(),yi=d.withIdHOC(d.withPropsContext(bi,It));yi.displayName="KendoReactDatePicker",I.registerForLocalization(It);const ke=(i,t)=>{const e=l.cloneDate(i);return e.setHours(t),e},Ne=i=>i!==null&&i<12,Xs=i=>i!==null&&(!i||i>11),Js=(i,t,e)=>!t&&!e||i>=t&&i<=e,Qs=(i,t,e)=>!t&&!e||i>=t||i<=e;class Si{constructor(t){this.intl=t,this.min=null,this.max=null,this.part=null}apply(t,e){const s=t.getHours(),a=Ne(s),r=Ne(e.getHours());if(a&&r||!a&&!r)return t;const[h,u=24]=this.normalizedRange(),c=s+(r?-12:12);return ke(t,Math.min(Math.max(h,c),u||24))}configure(t){const{min:e=this.min,max:s=this.max,part:a=this.part}=t;this.min=e,this.max=s,this.part=a}data(t){const e=this.part&&this.part.names;if(!e||!this.min)return[];const s=[],[a,r]=this.normalizedRange(),h=this.intl.dateFormatNames(e);return Ne(a)&&s.push({text:h.am,value:ke(this.min,a)}),Xs(r)&&s.push({text:h.pm,value:ke(this.min,Math.max(12,r))}),this.min.getHours()!==a?s.reverse():s}isRangeChanged(t,e){return!1}limitRange(t,e,s){return[t,e]}total(){const[t,e]=this.normalizedRange();return!t&&!e?2:t>11||e<12?1:2}selectedIndex(t){if(!this.valueInList(t)||!this.min)return-1;const e=Math.floor(t.getHours()/12);return this.min.getHours()===this.normalizedRange()[0]?e:e===0?1:0}valueInList(t){return!this.min||!this.max?!1:(this.min.getHours()!==this.normalizedRange()[0]?Qs:Js)(t.getHours(),this.min.getHours(),this.max.getHours())}normalizedRange(){const t=this.min.getHours(),e=this.max.getHours();return[Math.min(t,e),Math.max(t,e)]}}class tn{constructor(){this.itemHeight=0,this.timeListHeight=0,this.didCalculate=!1}ensureHeights(){this.timeListHeight===void 0&&this.calculateHeights()}calculateHeights(t){if(!d.canUseDOM)return;const e=Y("div"),s=Y("span"),a=Y("ul"),r=Y("li"),h=()=>r("<span>02</span>","k-item"),u=()=>a([h()],"k-reset"),c=()=>e([u()],"k-content k-scrollable k-time-container"),m=(()=>e([s("minute","k-title"),e([c()],"k-time-list")],"k-time-list-wrapper",{left:"-10000px",position:"absolute"}))(),v=t&&t.querySelector(".k-time-container")||document.body,w=v.appendChild(m);this.timeListHeight=w.querySelector(".k-scrollable").offsetHeight,this.itemHeight=w.querySelector("li").offsetHeight,v.removeChild(w),this.didCalculate=!0}}const Me=24,Di=(i=>t=>t%i)(Me),en=(i,t)=>e=>Di(i+e*t),Ii=(i,t)=>Di(Me+i-t),xi=i=>(t,e)=>!e||l.getDate(t).getTime()===l.getDate(e).getTime()?t:ee(t,i),sn=xi(0),nn=xi(Me-1);class Ti{constructor(t){this.intl=t,this.boundRange=!1,this.insertUndividedMax=!1,this.min=null,this.max=null,this.step=0,this.toListItem=null}apply(t,e){return ee(t,e.getHours())}configure(t){const{boundRange:e=this.boundRange,insertUndividedMax:s=this.insertUndividedMax,min:a=this.min,max:r=this.max,part:h,step:u=this.step}=t;this.boundRange=e,this.insertUndividedMax=s,this.toListItem=c=>{const p=ee(H,c);return{text:this.intl.formatDate(p,h.pattern),value:p}},this.min=a,this.max=r,this.step=u}data(t){const[e]=this.range(t),s=en(e,this.step),a=h=>this.toListItem&&this.toListItem(s(h)),r=Ee(0,this.countFromMin(t)).map(a);return this.addLast(r),t&&this.addMissing(r,t),r}isRangeChanged(t,e){return!this.min||!this.max?!1:!l.isEqual(this.min,t)||!l.isEqual(this.max,e)}limitRange(t,e,s){return this.boundRange?[sn(t,s),nn(e,s)]:[t,e]}total(t){const e=this.insertUndividedMax&&this.isLastMissing(t)?1:0,s=this.isMissing(t)?1:0;return this.countFromMin(t)+s+e}selectedIndex(t){return Math.ceil(this.divideByStep(t))}valueInList(t){return t?this.insertUndividedMax&&this.lastHour(t)===t.getHours()||!this.isMissing(t):!0}addLast(t,e){return this.insertUndividedMax&&this.isLastMissing(e)&&this.toListItem&&t.push(this.toListItem(this.lastHour(e))),t}addMissing(t,e){if(this.valueInList(e))return t;if(this.toListItem){const s=this.toListItem(e.getHours());t.splice(this.selectedIndex(e),0,s)}return t}countFromMin(t){const[e,s]=this.range(t);return Math.floor(Ii(s,e)/this.step)+1}isMissing(t){return t?this.selectedIndex(t)!==this.divideByStep(t):!1}isLastMissing(t){return this.max!==null&&this.isMissing(ee(this.max,this.lastHour(t)))}divideByStep(t){return Ii(t.getHours(),this.min.getHours())/this.step}lastHour(t){return this.range(t)[1]}range(t){const[e,s]=this.limitRange(this.min,this.max,t);return[e.getHours(),s.getHours()]}}const Fe=60,Ci=(i=>t=>t%i)(Fe),an=(i,t)=>e=>Ci(i+e*t),Ei=(i,t)=>Ci(Fe+i-t),Oi=i=>(t,e)=>!e||t.getHours()===e.getHours()?t:ie(t,i),rn=Oi(0),on=Oi(Fe-1);class Vi{constructor(t){this.intl=t,this.toListItem=null,this.min=null,this.max=null,this.step=0,this.insertUndividedMax=!1}apply(t,e){return ie(t,e.getMinutes())}configure(t){const{insertUndividedMax:e=this.insertUndividedMax,min:s=this.min,max:a=this.max,part:r,step:h=this.step}=t;this.insertUndividedMax=e,this.toListItem=u=>{const c=ie(H,u);return{text:this.intl.formatDate(c,r.pattern),value:c}},this.min=s,this.max=a,this.step=h}data(t){const[e]=this.range(t),s=an(e,this.step),a=h=>this.toListItem&&this.toListItem(s(h)),r=Ee(0,this.countFromMin(t)).map(a);return this.addLast(r),t&&this.addMissing(r,t),r}isRangeChanged(t,e){return this.min!==null&&this.max!==null&&(!l.isEqual(this.min,t)||!l.isEqual(this.max,e))}limitRange(t,e,s){return[rn(t,s),on(e,s)]}total(t){const e=this.insertUndividedMax&&this.isLastMissing(t)?1:0,s=this.isMissing(t)?1:0;return this.countFromMin(t)+s+e}selectedIndex(t){return Math.ceil(this.divideByStep(t))}valueInList(t){return t?this.insertUndividedMax&&this.lastMinute(t)===t.getMinutes()||!this.isMissing(t):!0}addLast(t,e){return this.insertUndividedMax&&this.isLastMissing(e)&&this.toListItem&&t.push(this.toListItem(this.lastMinute(e))),t}addMissing(t,e){if(this.valueInList(e))return t;if(this.toListItem){const s=this.toListItem(e.getMinutes());t.splice(this.selectedIndex(e),0,s)}return t}countFromMin(t){const[e,s]=this.range(t);return Math.floor(Ei(s,e)/this.step)+1}isMissing(t){return t?this.selectedIndex(t)!==this.divideByStep(t):!1}isLastMissing(t){return this.max!==null&&this.isMissing(ie(this.max,this.lastMinute(t)))}divideByStep(t){return Ei(t.getMinutes(),this.min.getMinutes())/this.step}lastMinute(t){return this.range(t)[1]}range(t){const[e,s]=this.limitRange(this.min,this.max,t);return[e.getMinutes(),s.getMinutes()]}}const _e=60,Pi=(i=>t=>t%i)(_e),ln=(i,t)=>e=>Pi(i+e*t),ki=(i,t)=>Pi(_e+i-t),Ni=i=>(t,e)=>!e||t.getMinutes()===e.getMinutes()&&t.getHours()===e.getHours()?t:se(t,i),hn=Ni(0),cn=Ni(_e-1);class Mi{constructor(t){this.intl=t,this.toListItem=null,this.min=null,this.max=null,this.step=0,this.insertUndividedMax=!1}apply(t,e){return se(t,e.getSeconds())}configure(t){const{insertUndividedMax:e=this.insertUndividedMax,min:s=this.min,max:a=this.max,part:r,step:h=this.step}=t;this.insertUndividedMax=e,this.toListItem=u=>{const c=se(H,u);return{text:this.intl.formatDate(c,r.pattern),value:c}},this.min=s,this.max=a,this.step=h}data(t){const[e]=this.range(t),s=ln(e,this.step),a=h=>this.toListItem&&this.toListItem(s(h)),r=Ee(0,this.countFromMin(t)).map(a);return this.addLast(r),t&&this.addMissing(r,t),r}isRangeChanged(t,e){return this.min!==null&&this.max!==null&&(!l.isEqual(this.min,t)||!l.isEqual(this.max,e))}limitRange(t,e,s){return[hn(t,s),cn(e,s)]}total(t){const e=this.insertUndividedMax&&this.isLastMissing(t)?1:0,s=this.isMissing(t)?1:0;return this.countFromMin(t)+s+e}selectedIndex(t){return Math.ceil(this.divideByStep(t))}valueInList(t){return t?this.insertUndividedMax&&this.lastSecond(t)===t.getSeconds()||!this.isMissing(t):!0}divideByStep(t){return ki(t.getSeconds(),this.min.getSeconds())/this.step}addLast(t,e){return this.insertUndividedMax&&this.isLastMissing(e)&&this.toListItem&&t.push(this.toListItem(this.lastSecond(e))),t}addMissing(t,e){if(this.valueInList(e))return t;if(this.toListItem){const s=this.toListItem(e.getSeconds());t.splice(this.selectedIndex(e),0,s)}return t}countFromMin(t){const[e,s]=this.range(t);return Math.floor(ki(s,e)/this.step)+1}isMissing(t){return t?this.selectedIndex(t)!==this.divideByStep(t):!1}isLastMissing(t){return this.max!==null&&this.isMissing(se(this.max,this.lastSecond(t)))}lastSecond(t){return this.range(t)[1]}range(t){const[e,s]=this.limitRange(this.min,this.max,t);return[e.getSeconds(),s.getSeconds()]}}const un=2,Fi=.05,dn=100,pn=0,_i=9,mn={[d.Keys.end]:(i,t)=>i[i.length-1],[d.Keys.home]:(i,t)=>i[0],[d.Keys.up]:(i,t)=>i[t-1],[d.Keys.down]:(i,t)=>i[t+1]},Le={[K.dayperiod]:Si,[K.hour]:Ti,[K.minute]:Vi,[K.second]:Mi},xt=class extends o.Component{constructor(i){super(i),this.intl=null,this._element=null,this.service=null,this.virtualization=null,this.topOffset=0,this.bottomOffset=0,this.itemHeight=0,this.listHeight=0,this.topThreshold=0,this.bottomThreshold=0,this.animateToIndex=!1,this.focus=t=>{Promise.resolve().then(()=>{this.element&&this.element.focus(t)})},this.itemOffset=t=>{if(!this.virtualization||!this.service)return-1;const e=this.service.selectedIndex(this.props.value),s=this.virtualization.activeIndex(),a=this.virtualization.itemOffset(s),r=Math.abs(Math.ceil(t)-a);if(e===s&&r<un)return a;const h=e>s;return h&&r>=this.bottomThreshold||!h&&r>this.topThreshold?this.virtualization.itemOffset(s+1):a},this.calculateHeights=()=>{this.dom.didCalculate&&(this.itemHeight=this.dom.itemHeight,this.listHeight=this.dom.timeListHeight,this.topOffset=(this.listHeight-this.itemHeight)/2,this.bottomOffset=this.listHeight-this.itemHeight,this.props.mobileMode&&(this.topOffset+=_i,this.bottomOffset+=_i*2),this.topThreshold=this.itemHeight*Fi,this.bottomThreshold=this.itemHeight*(1-Fi))},this.configureServices=({min:t,max:e,value:s}=this.props)=>{if(this.service){const[a,r]=this.service.limitRange(t||this.min,e||this.max,s||this.props.value);this.service.configure(this.serviceSettings({min:a,max:r}))}},this.serviceSettings=t=>{const e={boundRange:this.props.boundRange||xt.defaultProps.boundRange,insertUndividedMax:!1,min:l.cloneDate(this.min),max:l.cloneDate(this.max),part:this.props.part,step:this.step},s=Object.assign({},e,t);return s.boundRange=s.part.type!=="hour"||this.props.boundRange||xt.defaultProps.boundRange,s},this.handleScrollAction=({target:t,animationInProgress:e})=>{if(!(!this.virtualization||!this.service)&&t&&!e){this.animateToIndex=!1;const s=this.virtualization.itemIndex(this.itemOffset(t.scrollTop)),a=this.service.data(this.props.value)[s];this.handleChange(a)}},this.handleFocus=t=>{const{onFocus:e}=this.props;e&&e.call(void 0,t)},this.handleBlur=t=>{const{onBlur:e}=this.props;e&&e.call(void 0,t)},this.handleMouseOver=()=>{if(!this._element)return;const t=d.getActiveElement(document);document&&t!==this._element&&this.props.show&&this._element.focus({preventScroll:!0})},this.handleKeyDown=t=>{if(!this.service)return;const{keyCode:e}=t;(e===d.Keys.down||e===d.Keys.up||e===d.Keys.end||e===d.Keys.home)&&t.preventDefault();const a=(mn[t.keyCode]||d.noop)(this.service.data(this.props.value),this.service.selectedIndex(this.props.value));a&&this.handleChange(a)},this.handleChange=ns(t=>{if(!this.service)return;const e=this.service.apply(this.props.value,t.value);if(this.props.value.getTime()===e.getTime())return;const{onChange:s}=this.props;s&&s.call(void 0,e)},dn),this.dom=new tn}get element(){return this._element}get animate(){return!!(this.props.smoothScroll&&this.animateToIndex)}get min(){return this.props.min||xt.defaultProps.min}get max(){return this.props.max||xt.defaultProps.max}get step(){return this.props.step!==void 0&&this.props.step!==0?Math.floor(this.props.step):xt.defaultProps.step}componentDidMount(){Promise.resolve().then(()=>{this._element&&(this.dom.calculateHeights(this._element),this.forceUpdate())})}componentDidUpdate(){if(!this.virtualization||!this.service)return;const i=this.service.selectedIndex(this.props.value);this.virtualization[this.animate?"animateToIndex":"scrollToIndex"](i),this.animateToIndex=!0}render(){if(!this.props.part.type||!Le[this.props.part.type])return;this.calculateHeights(),this.intl=I.provideIntlService(this),this.service=new Le[this.props.part.type](this.intl),this.configureServices();const i=this.service.data(this.props.value),t="translateY("+this.topOffset+"px)",e=this.service.total(this.props.value),s=o.createElement("ul",{style:{transform:t,msTransform:t},className:"k-reset"},i.map((a,r)=>o.createElement("li",{key:r,className:"k-item",onClick:()=>{this.handleChange(a)}},o.createElement("span",null,a.text))));return o.createElement("div",{className:"k-time-list",id:String(this.props.id||""),tabIndex:this.props.disabled?-1:0,ref:a=>{this._element=a},onKeyDown:this.handleKeyDown,onFocus:this.handleFocus,onBlur:this.handleBlur,onMouseOver:this.handleMouseOver},this.dom.didCalculate?o.createElement(ft,{bottomOffset:this.bottomOffset,children:s,className:"k-time-container",itemHeight:this.itemHeight,maxScrollDifference:this.listHeight,onScrollAction:this.handleScrollAction,ref:a=>{this.virtualization=a},role:"presentation",skip:pn,tabIndex:-1,take:e,topOffset:this.topOffset,total:e}):o.createElement("div",{className:"k-time-container"},s))}};let zt=xt;zt.propTypes={id:n.number,max:n.instanceOf(Date),min:n.instanceOf(Date),part:function(i,t,e){const s=i[t];if(!s||!Le[s.type])throw new Error(`
16
16
  Invalid prop '${t}' supplied to ${e}.
17
17
  Supported part types are hour|minute|second|dayperiod.
18
18
  `);return null},step:function(i,t,e){const s=i[t];if(s!==void 0&&s<=0)throw new Error(`
19
19
  Invalid prop '${t}' supplied to ${e}.
20
20
  ${t} cannot be less than 1.
21
- `);return null},value:n.instanceOf(Date),smoothScroll:n.bool,show:n.bool},zt.defaultProps={boundRange:!1,max:nt,min:A,step:1,smoothScroll:!0},x.registerForIntl(zt);const Ae=new RegExp(`${K.hour}|${K.minute}|${K.second}|${K.dayperiod}|literal`),dt=class extends o.Component{constructor(i){super(i),this._element=null,this._nowButton=null,this.dateFormatParts=[],this.timeLists=[],this.focus=t=>{Promise.resolve().then(()=>{const e=this.timeLists[0];this.state.activeListIndex===-1&&!this.hasActiveButton()&&e&&e.element&&e.focus(t)})},this.timeFormatReducer=(t,e)=>t+e.pattern,this.timeFormatFilter=(t,e,s)=>{const a=e>=1&&s[e-1];return a&&a&&t.type==="literal"?Ae.test(a.type||""):Ae.test(t.type||"")},this.focusList=t=>{this.timeLists.length&&this.timeLists.reduce(this.listReducer,[]).map(e=>t===1?e.next:e.prev).map(e=>e&&e.element&&e.element.focus({preventScroll:!0}))},this.listReducer=(t,e,s,a)=>t.length||e.props.id!==this.state.activeListIndex?t:[{next:a[s+1]||e,prev:a[s-1]||e}],this.showNowButton=()=>!this.hasSteps()&&this.props.nowButton&&Oe(ut(),this.min,this.max),this.handleKeyDown=t=>{const{keyCode:e}=t;switch(e){case d.Keys.left:t.preventDefault(),this.focusList(0);return;case d.Keys.right:t.preventDefault(),this.focusList(1);return;default:return}},this.handleListBlur=()=>{this.nextTick(()=>{this.setState({activeListIndex:-1})})},this.handleListFocus=t=>{clearTimeout(this.nextTickId),this.setState({activeListIndex:t})},this.handleChange=t=>{const{onChange:e}=this.props;e&&e.call(void 0,t)},this.snapTime=mi(pi(this.props.steps,this.props.min||dt.defaultProps.min)),this.state={activeListIndex:-1},this.hasActiveButton=this.hasActiveButton.bind(this)}get element(){return this._element}get value(){return Ys(this.snapTime(l.cloneDate(this.props.value||A)),this.min,this.max)}get intl(){return x.provideIntlService(this)}get min(){return this.snapTime(this.props.min||dt.defaultProps.min)}get max(){return this.snapTime(this.props.max||dt.defaultProps.max)}get steps(){return this.props.steps||dt.defaultProps.steps}get boundRange(){return this.props.boundRange!==void 0?this.props.boundRange:dt.defaultProps.boundRange}componentWillUnmount(){clearTimeout(this.nextTickId)}componentDidMount(){const{onMount:i}=this.props;i&&i.call(void 0,this.value)}render(){const{format:i,smoothScroll:t,onNowClick:e,className:s,disabled:a,mobileMode:r,show:h}=this.props;this.snapTime=mi(pi(this.steps,this.min)),this.dateFormatParts=this.intl.splitDateFormat(i||dt.defaultProps.format).filter(this.timeFormatFilter);const u=d.classNames({"k-disabled":a,"k-time-part":r},s);this.timeLists=[];const c=x.provideLocalizationService(this),p=c.toLanguageString(ve,V[ve]);return o.createElement("div",{className:u},o.createElement("div",{className:"k-time-header"},o.createElement("span",{className:"k-title"},this.intl.formatDate(this.value,this.dateFormatParts.reduce(this.timeFormatReducer,""))),this.showNowButton()&&o.createElement(F.Button,{type:"button",ref:m=>{this._nowButton=m},className:"k-time-now",fillMode:"flat",themeColor:"primary",title:p,"aria-label":p,onClick:e,tabIndex:a?-1:0},c.toLanguageString(fe,V[fe]))),o.createElement("div",{className:"k-time-list-container",onKeyDown:this.handleKeyDown},o.createElement("span",{className:"k-time-highlight"}),this.dateFormatParts.map((m,f)=>m.type!=="literal"?o.createElement("div",{key:f,className:d.classNames("k-time-list-wrapper",{"k-focus":f===this.state.activeListIndex}),role:"presentation",tabIndex:-1},o.createElement("span",{className:"k-title",onMouseDown:v=>{v.preventDefault()}},this.intl.dateFieldName(m)),o.createElement(zt,{min:this.min,max:this.max,boundRange:this.boundRange,part:m,step:m.type?this.steps[m.type]:1,smoothScroll:t,ref:v=>{v&&this.timeLists.push(v)},id:f,onFocus:()=>{this.handleListFocus(f)},onBlur:this.handleListBlur,onChange:this.handleChange,value:this.value,disabled:a,show:h,mobileMode:r})):o.createElement("div",{key:f,className:"k-time-separator"},m.pattern))))}nextTick(i){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>i())}hasActiveButton(){const i=d.getActiveElement(document);return this._nowButton&&i===this._nowButton.element}hasSteps(){const i=Object.keys(this.steps);return i.length!==i.reduce((t,e)=>t+this.steps[e],0)}};let pt=dt;pt.propTypes={cancelButton:n.bool,disabled:n.bool,format:n.oneOfType([n.string,n.shape({skeleton:n.string,pattern:n.string,date:n.oneOf(["short","medium","long","full"]),time:n.oneOf(["short","medium","long","full"]),datetime:n.oneOf(["short","medium","long","full"]),era:n.oneOf(["narrow","short","long"]),year:n.oneOf(["numeric","2-digit"]),month:n.oneOf(["numeric","2-digit","narrow","short","long"]),day:n.oneOf(["numeric","2-digit"]),weekday:n.oneOf(["narrow","short","long"]),hour:n.oneOf(["numeric","2-digit"]),hour12:n.bool,minute:n.oneOf(["numeric","2-digit"]),second:n.oneOf(["numeric","2-digit"]),timeZoneName:n.oneOf(["short","long"])})]),max:n.instanceOf(Date),min:n.instanceOf(Date),nowButton:n.bool,steps:n.shape({hour:n.number,minute:n.number,second:n.number}),smoothScroll:n.bool,tabIndex:n.number,value:n.instanceOf(Date),show:n.bool},pt.defaultProps={value:null,disabled:!1,nowButton:!0,cancelButton:!0,format:"hh:mm a",min:ct,max:nt,steps:{},boundRange:!1},x.registerForIntl(pt),x.registerForLocalization(pt);const He=class extends o.Component{constructor(i){super(i),this._element=null,this._cancelButton=null,this._acceptButton=null,this.timePart=null,this.focusActiveList=()=>{this.timePart&&this.timePart.focus({preventScroll:!0})},this.handleKeyDown=t=>{const{keyCode:e}=t;switch(e){case d.Keys.enter:this.hasActiveButton()||this.handleAccept(t);return;default:return}},this.handleAccept=t=>{const e=this.mergeValue(l.cloneDate(this.value||ut()),this.timePart?this.timePart.value:this.current);this.setState({value:e}),this.valueDuringOnChange=e;const{onChange:s}=this.props;s&&s.call(void 0,{syntheticEvent:t,nativeEvent:t.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0},this.handleReject=t=>{this.setState({current:this.value});const{onReject:e}=this.props;e&&e.call(void 0,t)},this.handleNowClick=t=>{const e=this.mergeValue(l.cloneDate(this.value||ut()),ut());this.setState({current:e,value:e}),this.valueDuringOnChange=e;const{onChange:s}=this.props;s&&s.call(void 0,{syntheticEvent:t,nativeEvent:t.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0},this.handleChange=t=>{this.setState({current:t});const{handleTimeChange:e}=this.props;e&&e.call(void 0,{time:t})},this.dateFormatParts=this.intl.splitDateFormat(this.props.format||He.defaultProps.format),this.mergeValue=Us(Ws(this.dateFormatParts)),this.hasActiveButton=this.hasActiveButton.bind(this),this.state={current:this.props.value||A,value:this.props.value||He.defaultProps.value}}get element(){return this._element}get value(){const i=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return i!==null?l.cloneDate(i):null}get intl(){return x.provideIntlService(this)}get current(){return this.state.current!==null?l.cloneDate(this.state.current):null}componentWillUnmount(){clearTimeout(this.nextTickId)}render(){const{format:i,cancelButton:t,disabled:e,tabIndex:s,className:a,smoothScroll:r,min:h,max:u,boundRange:c,nowButton:p,steps:m,show:f,mobileMode:v}=this.props,w=x.provideLocalizationService(this),T=w.toLanguageString(Jt,V[Jt]),E=w.toLanguageString(_t,V[_t]);return o.createElement("div",{ref:O=>{this._element=O},tabIndex:e?void 0:s||0,className:d.classNames("k-timeselector",a,{"k-disabled":e}),onKeyDown:this.handleKeyDown},o.createElement(pt,{ref:O=>{this.timePart=O},value:this.current,onChange:this.handleChange,onNowClick:this.handleNowClick,format:i,smoothScroll:r,min:h,max:u,boundRange:c,disabled:e,nowButton:p,steps:m,show:f,mobileMode:v}),this.props.footer&&o.createElement("div",{className:"k-time-footer k-actions k-actions-stretched"},t&&o.createElement(F.Button,{type:"button",ref:O=>{this._cancelButton=O},className:"k-time-cancel",onClick:this.handleReject,title:T,"aria-label":T},T),o.createElement(F.Button,{type:"button",ref:O=>{this._acceptButton=O},className:"k-time-accept",themeColor:"primary",onClick:this.handleAccept,title:E,"aria-label":E},E)))}nextTick(i){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>i())}hasActiveButton(){if(!this._acceptButton||!this._acceptButton.element)return!1;const i=d.getActiveElement(document);return this._acceptButton&&i===this._acceptButton.element||this._cancelButton&&i===this._cancelButton.element}};let Tt=He;Tt.propTypes={cancelButton:n.bool,className:n.string,disabled:n.bool,format:n.oneOfType([n.string,n.shape({skeleton:n.string,pattern:n.string,date:n.oneOf(["short","medium","long","full"]),time:n.oneOf(["short","medium","long","full"]),datetime:n.oneOf(["short","medium","long","full"]),era:n.oneOf(["narrow","short","long"]),year:n.oneOf(["numeric","2-digit"]),month:n.oneOf(["numeric","2-digit","narrow","short","long"]),day:n.oneOf(["numeric","2-digit"]),weekday:n.oneOf(["narrow","short","long"]),hour:n.oneOf(["numeric","2-digit"]),hour12:n.bool,minute:n.oneOf(["numeric","2-digit"]),second:n.oneOf(["numeric","2-digit"]),timeZoneName:n.oneOf(["short","long"])})]),max:n.instanceOf(Date),min:n.instanceOf(Date),nowButton:n.bool,steps:n.shape({hour:n.number,minute:n.number,second:n.number}),smoothScroll:n.bool,tabIndex:n.number,value:n.instanceOf(Date),show:n.bool},Tt.defaultProps={value:null,disabled:!1,cancelButton:!0,format:"t",min:ct,max:nt,boundRange:!1,footer:!0},x.registerForIntl(Tt),x.registerForLocalization(Tt);const Z=class extends o.Component{constructor(i){super(i),this._popupId=d.guid(),this._element=null,this._dateInput=o.createRef(),this._timeSelector=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.focus=()=>{this.dateInput&&this.dateInput.focus()},this.renderTimeSelector=()=>{const{smoothScroll:t,cancelButton:e,nowButton:s,disabled:a,format:r,steps:h}=this.props;return o.createElement(Tt,{ref:this.setTimeSelectorRef,className:this.mobileMode?"k-reset k-timeselector-lg":"",mobileMode:this.mobileMode,show:this.show,cancelButton:e,disabled:a,nowButton:s,format:r,min:this.min,max:this.max,steps:h,smoothScroll:t,value:this.value,footer:!this.mobileMode,handleTimeChange:this.mobileMode&&this.handleTimeChange,onChange:this.handleValueChange,onReject:this.handleValueReject})},this.renderPopup=()=>{const{popupClass:t,...e}=this.popupSettings,s=d.classNames("k-group k-reset",t),a={popupClass:"k-timepicker-popup",show:this.show,animate:this.element!==null,anchor:this.element,className:s,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...e};return this.props.popup?o.createElement(this.props.popup,{...a},this.renderTimeSelector()):o.createElement(qt.Popup,{...a},this.renderTimeSelector())},this.renderAdaptivePopup=()=>{const{windowWidth:t=0}=this.state,e={expand:this.show,onClose:this.handleBlur,adaptiveTitle:this.props.adaptiveTitle,windowWidth:t,footer:{cancelText:this.localizationService.toLanguageString(Qt,V[Jt]),onCancel:this.handleValueReject,applyText:this.localizationService.toLanguageString(_t,V[_t]),onApply:s=>this.handleValueChange(s)}};return o.createElement(ne,{...e},o.createElement(ht.ActionSheetContent,{className:"!k-overflow-hidden"},this.renderTimeSelector()))},this.setTimeSelectorRef=t=>{this._timeSelector=t},this.nextValue=(t,e)=>t.value!==void 0?t.value:e.value,this.nextShow=(t,e)=>t.show!==void 0?t.show:e.show,this.handleInputValueChange=t=>{const e=this.mergeTime(t.value);this.handleValueChange({...t,value:e})},this.handleTimeChange=t=>{this.setState({candidate:t.time})},this.handleValueChange=t=>{this.setState({value:l.cloneDate(t.value||this.state.candidate)}),this.valueDuringOnChange=t.value,this.showDuringOnChange=!1,this.shouldFocusDateInput=!0;const{onChange:e}=this.props,s=this.value||this.state.candidate;e&&e.call(void 0,{syntheticEvent:t.syntheticEvent,nativeEvent:t.nativeEvent,value:s,show:this.show,target:this}),this.valueDuringOnChange=void 0,this.showDuringOnChange=void 0,this.setShow(!1)},this.handleFocus=()=>{this.setState({focused:!0})},this.handleBlur=()=>{this.setState({focused:!1}),this.setShow(!1)},this.handleValueReject=t=>{this.setShow(!1)},this.handleIconClick=t=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=t=>{t.preventDefault()},this.handleKeyDown=t=>{const{altKey:e,keyCode:s}=t;if(s===d.Keys.esc){this.shouldFocusDateInput=!0,this.setShow(!1);return}e&&(s===d.Keys.up||s===d.Keys.down)&&(t.preventDefault(),t.stopPropagation(),this.shouldFocusDateInput=s===d.Keys.up,this.setShow(s===d.Keys.down))},d.validatePackage(gt),this.state={value:this.props.defaultValue||Z.defaultProps.defaultValue,show:this.props.defaultShow||Z.defaultProps.defaultShow,focused:!1,candidate:null},this.normalizeTime=this.normalizeTime.bind(this),this.setShow=this.setShow.bind(this),this.mergeTime=this.mergeTime.bind(this)}get document(){if(d.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get dateInput(){return this._dateInput.current}get timeSelector(){return this._timeSelector}get value(){const i=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return i!==null?l.cloneDate(i):null}get show(){return this.showDuringOnChange!==void 0?this.showDuringOnChange:this.props.show!==void 0?this.props.show:this.state.show}get name(){return this.props.name}get validity(){const i=this.value&&this.normalizeTime(this.value),t=this.normalizeTime(this.min),e=this.normalizeTime(this.max),s=$s(i,t,e),a=this.props.validationMessage!==void 0,r=(!this.required||this.value!==null)&&s,h=this.props.valid!==void 0?this.props.valid:r;return{customError:a,rangeOverflow:js(i,e),rangeUnderflow:Ks(i,t),valid:h,valueMissing:this.value===null}}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=ae&&this.props.adaptive)}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:Z.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:Z.defaultProps.required}get popupSettings(){return this.props.popupSettings||Z.defaultProps.popupSettings}get min(){return this.props.min!==void 0?this.props.min:Z.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:Z.defaultProps.max}get dateInputComp(){return this.props.dateInput||Z.defaultProps.dateInput}get localizationService(){return x.provideLocalizationService(this)}componentDidMount(){var i;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){this._timeSelector&&this.show&&!this.prevShow?this._timeSelector.focusActiveList():this.dateInput&&this.dateInput.element&&!this.show&&this.shouldFocusDateInput&&this.dateInput.element.focus({preventScroll:!0}),this.prevShow=this.show,this.shouldFocusDateInput=!1}componentWillUnmount(){var i;(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:i=Z.defaultProps.size,rounded:t=Z.defaultProps.rounded,fillMode:e=Z.defaultProps.fillMode,disabled:s,tabIndex:a,title:r,id:h,className:u,format:c,formatPlaceholder:p,width:m,name:f,steps:v,validationMessage:w,required:T,validityStyles:E,ariaLabelledBy:O,ariaDescribedBy:y}=this.props,P=!this.validityStyles||this.validity.valid,b={disabled:s,format:c,formatPlaceholder:p,id:h,ariaLabelledBy:O,ariaDescribedBy:y,max:this.normalizeTime(this.max),min:this.normalizeTime(this.min),name:f,onChange:this.handleInputValueChange,required:T,steps:v,tabIndex:this.show?-1:a,title:r,valid:this.validity.valid,validationMessage:w,validityStyles:E,value:this.value&&this.normalizeTime(this.value),label:void 0,placeholder:this.state.focused?null:this.props.placeholder,ariaHasPopup:"dialog",ariaExpanded:this.show,size:null,fillMode:null,rounded:null,readonly:this.mobileMode},R=this.localizationService.toLanguageString(Qt,V[Qt]),k=this.localizationService.toLanguageString(we,V[we]),M=o.createElement(d.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.mobileMode?void 0:this.handleBlur,onSyncBlur:this.props.onBlur,onSyncFocus:this.props.onFocus},({onFocus:W,onBlur:C})=>o.createElement(o.Fragment,null,o.createElement("div",{ref:N=>{this._element=N},className:d.classNames("k-input","k-timepicker",{[`k-input-${d.kendoThemeMaps.sizeMap[i]||i}`]:i,[`k-rounded-${d.kendoThemeMaps.roundedMap[t]||t}`]:t,[`k-input-${e}`]:e,["k-invalid"]:!P,["k-required"]:this.required,["k-disabled"]:this.props.disabled},u),onKeyDown:this.handleKeyDown,style:{width:m},onFocus:W,onBlur:C,onClick:this.mobileMode?this.handleIconClick:void 0},o.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",ariaControls:this._popupId,...b}),o.createElement(F.Button,{tabIndex:-1,type:"button",icon:"clock",svgIcon:X.clockIcon,onMouseDown:this.handleIconMouseDown,onClick:this.mobileMode?void 0:this.handleIconClick,title:k,className:"k-input-button",rounded:null,"aria-label":R}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup()));return this.props.label?o.createElement(Pe,{dateInput:this._dateInput,label:this.props.label,editorId:h,editorValid:P,editorDisabled:this.props.disabled,children:M,style:{width:this.props.width}}):M}normalizeTime(i){return B(A,i)}setShow(i){const{onOpen:t,onClose:e}=this.props;this.show!==i&&(this.setState({show:i}),i&&t&&t.call(void 0,{target:this}),!i&&e&&e.call(void 0,{target:this}))}mergeTime(i){return this.value&&i?B(this.value,i):i}calculateMedia(i){for(let t of i)this.setState({windowWidth:t.target.clientWidth})}};let Ct=Z;Ct.displayName="TimePicker",Ct.propTypes={className:n.string,cancelButton:n.bool,nowButton:n.bool,defaultShow:n.bool,defaultValue:n.instanceOf(Date),disabled:n.bool,format:n.oneOfType([n.string,n.shape({skeleton:n.string,pattern:n.string,date:n.oneOf(["short","medium","long","full"]),time:n.oneOf(["short","medium","long","full"]),datetime:n.oneOf(["short","medium","long","full"]),era:n.oneOf(["narrow","short","long"]),year:n.oneOf(["numeric","2-digit"]),month:n.oneOf(["numeric","2-digit","narrow","short","long"]),day:n.oneOf(["numeric","2-digit"]),weekday:n.oneOf(["narrow","short","long"]),hour:n.oneOf(["numeric","2-digit"]),hour12:n.bool,minute:n.oneOf(["numeric","2-digit"]),second:n.oneOf(["numeric","2-digit"]),timeZoneName:n.oneOf(["short","long"])})]),formatPlaceholder:n.oneOfType([n.oneOf(["wide","narrow","short","formatPattern"]),n.shape({year:n.string,month:n.string,day:n.string,hour:n.string,minute:n.string,second:n.string})]),id:n.string,ariaLabelledBy:n.string,ariaDescribedBy:n.string,min:n.instanceOf(Date),max:n.instanceOf(Date),name:n.string,popupSettings:n.shape({animate:n.bool,appendTo:n.any,popupClass:n.string}),show:n.bool,steps:n.shape({hour:n.number,minute:n.number,second:n.number}),smoothScroll:n.bool,tabIndex:n.number,title:n.string,value:n.instanceOf(Date),width:n.oneOfType([n.number,n.string]),validationMessage:n.string,required:n.bool,validate:n.bool,valid:n.bool,size:n.oneOf([null,"small","medium","large"]),rounded:n.oneOf([null,"small","medium","large","full"]),fillMode:n.oneOf([null,"solid","flat","outline"])},Ct.defaultProps={defaultShow:!1,defaultValue:null,disabled:!1,format:"t",max:nt,min:ct,popupSettings:{},tabIndex:0,steps:{},required:!1,validityStyles:!0,dateInput:lt,size:"medium",rounded:"medium",fillMode:"solid"};const Li=d.createPropsContext(),Ai=d.withPropsContext(Li,Ct);Ai.displayName="KendoReactTimePicker",x.registerForLocalization(Ct);const Hi=2,ze=class extends o.Component{constructor(i){super(i),this._element=null,this.isActive=!1,this.focusActiveDate=()=>{if(!this._element)return;const t=this._element.querySelector("td.k-focus"),e=this._element.querySelector(".k-state-pending-focus");t&&t[0]&&t[0].classList.remove("k-focus"),e&&e.classList.add("k-focus"),this.isActive=!0},this.blurActiveDate=()=>{if(!this._element)return;const t=this._element.querySelector("td.k-focus");t&&t.classList.remove("k-focus"),this.isActive=!1},this.rotateSelectionRange=t=>{if(t.start===null||t.end===null)return t;const e=t.end<t.start;return{start:e?t.end:t.start,end:e?t.start:t.end}},this.handleDateChange=(t,e=!1)=>{const{onChange:s}=this.props;if(s){const a={syntheticEvent:t.syntheticEvent,nativeEvent:t.nativeEvent,value:l.cloneDate(t.value),target:this,isTodayClick:e};s.call(void 0,a)}}}get element(){return this._element}get weekNumber(){return!!(this.props.showWeekNumbers&&this.props.activeView===I.month)}get min(){return this.props.min!==void 0?this.props.min:ze.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:ze.defaultProps.max}componentDidUpdate(){this.isActive&&this.focusActiveDate()}render(){const i=this.props.allowReverse?this.rotateSelectionRange(this.props.selectionRange):this.props.selectionRange,t=d.classNames("k-calendar-view k-align-items-start k-justify-content-center",{"k-vstack":this.props.verticalView,"k-hstack":!this.props.verticalView,"k-calendar-monthview":this.props.activeView===I.month,"k-calendar-yearview":this.props.activeView===I.year,"k-calendar-decadeview":this.props.activeView===I.decade,"k-calendar-centuryview":this.props.activeView===I.century});return o.createElement("div",{ref:e=>{this._element=e},className:t},this.props.dates.map(e=>o.createElement("table",{className:"k-calendar-table k-content",key:e.getTime(),role:"grid"},o.createElement(Ft,{bus:this.props.bus,service:this.props.service,key:e.getTime(),direction:"horizontal",activeView:this.props.activeView,cellUID:this.props.cellUID,viewDate:e,min:this.min,max:this.max,focusedDate:this.props.focusedDate,selectionRange:i,selectedDate:this.props.value,showWeekNumbers:this.weekNumber,onChange:this.handleDateChange,onCellEnter:this.props.onCellEnter,cell:this.props.cell,weekCell:this.props.weekCell}))))}};let Et=ze;Et.defaultProps={showWeekNumbers:!1,views:Hi,take:Hi,allowReverse:!0,min:it,max:st};const Be=(i=J.defaultProps.min,t=J.defaultProps.max,e)=>e instanceof Date&&!Array.isArray(e)&&_(l.getDate(e),i,t)?l.getDate(e):null,zi=(i=J.defaultProps.min,t=J.defaultProps.max,e)=>Array.isArray(e)?e.filter(s=>_(s,i,t)).map(s=>l.getDate(s)):null,Bi=i=>typeof i=="object"&&!(i instanceof Date)&&i!==null&&!Array.isArray(i)?i:H,qi=(i,t,e)=>i||t&&t[0]||e&&e.start,gn=(i,t)=>i.start===null&&t===null?"start":i.end===null?"end":"start",Vt=class extends o.Component{constructor(i){super(i),this.dates=[],this.selectedDate=null,this.selectedMultiple=null,this.selectedRange=H,this._focusedDate=new Date,this.cellUID=d.guid(),this.activeRangeEnd="start",this._element=null,this.intl=null,this.localization=null,this.service=null,this.wrapperID=d.guid(),this.calendarViewList=null,this.isActive=!1,this.calculateFocusFromValue=!0,this.focus=()=>{this._element&&this._element.focus()},this.clampRange=c=>({start:c,end:null}),this.rangeWithFocused=(c,p)=>({start:c.start,end:c.end===null&&c.start!==null&&this.isActive?p:c.end}),this.generateRange=(c,p)=>{let{end:m,start:f}=p;const v=p.start!==null&&c.getTime()<=p.start.getTime();return!this.props.allowReverse&&v?{start:c,end:this.selectedRange.start}:this.activeRange!=="end"?{start:c,end:m}:{start:f||this.selectedDate,end:c}},this.canNavigate=c=>{if(!this.service)return!1;const p=this.service.move(this.focusedDate,c);return this.min<=p&&p<=this.max||this.service.isInSameView(p,this.min)||this.service.isInSameView(p,this.max)},this.navigate=(c,p)=>{this.calculateFocusFromValue=!1;const m=this.move(c,p);this.setState({navigateDate:m,focusedDate:m})},this.move=(c,p)=>this.clampDate(this.service.move(p,c)),this.clampDate=c=>U(c,this.min,this.max),this.shouldAutoCorrect=(c,p)=>{const{end:m,start:f}=p;return this.activeRange!=="end"?m!==null&&c>m:f!==null&&c<f},this.handleCellEnter=c=>{this.props.mode==="range"&&(this.calculateFocusFromValue=!1,this.setState({focusedDate:c}))},this.handleMouseDown=c=>{c.preventDefault()},this.handleClick=c=>{this._element&&this._element.focus({preventScroll:!0})},this.handleFocus=c=>{if(this.isActive=!0,!this.calendarViewList)return;this.calendarViewList.focusActiveDate();const{onFocus:p}=this.props;p&&p.call(void 0,c)},this.handleBlur=c=>{if(this.isActive=!1,!this.calendarViewList)return;this.calendarViewList.blurActiveDate();const{onBlur:p}=this.props;p&&p.call(void 0,c)},this.handleTodayClick=c=>{this.todayIsInRange&&this.handleDateChange(c)},this.handlePrevButtonClick=()=>{const c=S.PrevView;if(this.state.activeView>0&&this.focusedDate.getFullYear()>this.dates[0].getFullYear())this.navigate(c,this.move(c,this.focusedDate));else{const p=this.isInMonth(this.focusedDate,this.dates[1])?this.move(c,this.focusedDate):this.focusedDate;this.navigate(c,p)}},this.handleNextButtonClick=()=>{this.navigate(S.NextView,this.focusedDate)},this.handleKeyDown=c=>{const{keyCode:p}=c;if(p===d.Keys.enter){const m={syntheticEvent:c,nativeEvent:c.nativeEvent,value:this.focusedDate,target:this};this.handleDateChange(m)}else{const m=U(this.navigation.move(this.focusedDate,this.navigation.action(c),this.state.activeView,this.service,c),this.min,this.max);if(l.isEqualDate(this.focusedDate,m))return;this.dates&&this.service&&!this.service.isInArray(m,this.dates)&&this.setState({navigateDate:m}),this.calculateFocusFromValue=!1,this.setState({focusedDate:m})}c.preventDefault()},this.handleViewChange=({view:c})=>{this.calculateFocusFromValue=!1,this.setState(p=>({activeView:c,navigateDate:p.focusedDate}))},this.handleDateChange=c=>{const p=l.cloneDate(c.value),m=this.bus.canMoveDown(this.state.activeView);if(this.props.disabled)return;if(m)if(c.isTodayClick)this.bus.moveToBottom(this.state.activeView);else{this.bus.moveDown(this.state.activeView,c.syntheticEvent),this.setState({focusedDate:p});return}this.calculateFocusFromValue=!0;let f;switch(this.props.mode){case"single":f=l.cloneDate(c.value);break;case"multiple":if(Array.isArray(this.selectedMultiple)){let w=this.selectedMultiple.slice(),T=-1;w.forEach((E,O)=>{l.isEqualDate(E,c.value)&&(T=O)}),T!==-1?w.splice(T,1):w.push(l.cloneDate(c.value)),f=w.slice()}else this.selectedDate?f=[l.cloneDate(this.selectedDate),l.cloneDate(c.value)]:f=[l.cloneDate(c.value)];break;case"range":{f=this.selectedRange.start!==null&&this.selectedRange.end!==null&&this.activeRange==="start"?this.clampRange(c.value):this.generateRange(c.value,this.selectedRange),this.activeRangeEnd=this.activeRange!=="end"?"end":"start";break}default:f=l.cloneDate(c.value);break}this.valueDuringOnChange=f,c.isTodayClick&&this.setState({navigateDate:p}),this.setState({value:f,focusedDate:p}),this.valueDuringOnChange=f;const{onChange:v}=this.props;if(v){const w={syntheticEvent:c.syntheticEvent,nativeEvent:c.nativeEvent,value:f,target:this};v.call(void 0,w)}this.valueDuringOnChange=void 0};const t=i.value!==void 0?i.value:i.defaultValue||Vt.defaultProps.defaultValue,e=Be(this.min,this.max,t),s=zi(this.min,this.max,t),a=Bi(t),r=qi(e,s,a),h=Ut(I[i.defaultActiveView],this.bottomView,this.topView),u=U(i.focusedDate||r||z(),this.min,this.max);this.state={value:t,activeView:h,focusedDate:u,navigateDate:u},this.activeRangeEnd=gn(a,e),this.bus=new de(this.handleViewChange),this.navigation=new pe(this.bus),this.calculateFocusFromValue=!1,this.lastView=h,this.lastViewsCount=this.props.views||Et.defaultProps.views}get isRtl(){return this.props.dir==="rtl"}get element(){return this._element}get value(){return this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value}get focusedDate(){return l.cloneDate(this._focusedDate)}get min(){return l.getDate(this.props.min!==void 0?this.props.min:Vt.defaultProps.min)}get max(){return l.getDate(this.props.max!==void 0?this.props.max:Vt.defaultProps.max)}get bottomView(){return I[this.props.bottomView!==void 0?this.props.bottomView:Vt.defaultProps.bottomView]}get topView(){return I[this.props.topView!==void 0?this.props.topView:Vt.defaultProps.topView]}get activeRange(){return this.props.activeRangeEnd!==void 0?this.props.activeRangeEnd:this.activeRangeEnd}get todayIsInRange(){return _(z(),l.getDate(this.min),l.getDate(this.max))}componentDidMount(){this.calculateFocusFromValue=!0}componentDidUpdate(){this.calendarViewList&&(this.isActive?this.calendarViewList.focusActiveDate:this.calendarViewList.blurActiveDate)();const i=Be(this.min,this.max,this.value);this.calculateFocusFromValue=!!(this.selectedDate&&i&&this.selectedDate.getTime()&&i.getTime()),this.lastView=this.state.activeView,this.lastViewsCount=this.props.views||Et.defaultProps.views}render(){this.props._ref&&this.props._ref(this),this.intl=x.provideIntlService(this),this.localization=x.provideLocalizationService(this),this.bus.configure(this.bottomView,this.topView);const i=Ut(this.state.activeView,this.bottomView,this.topView);this.service=this.bus.service(i,this.intl),this.selectedDate=Be(this.min,this.max,this.value),this.selectedMultiple=zi(this.min,this.max,this.value),this.selectedRange=Bi(this.value);const t=qi(this.selectedDate,this.selectedMultiple,this.selectedRange);this._focusedDate=U(this.calculateFocusFromValue&&t!==null?t:this.state.focusedDate,this.min,this.max);const e=d.classNames("k-widget k-calendar k-calendar-range",{"k-disabled":this.props.disabled},this.props.className),s=this.rangeWithFocused(this.selectedRange,this.focusedDate),a=this.localization.toLanguageString(me,V[me]),r=this.localization.toLanguageString(ge,V[ge]),h=!this.canNavigate(S.PrevView),u=!this.canNavigate(S.NextView),c={"aria-disabled":h},p={"aria-disabled":u},m=this.lastView!==i,f=this.dates&&this.isInMonth(this.state.navigateDate,this.dates[0]),v=this.lastViewsCount!==this.props.views;(!f||m||v)&&(this.dates=this.service.datesList(this.state.navigateDate,this.props.views||Et.defaultProps.views));const w=l.cloneDate(this.dates&&this.dates[0]?this.dates[0]:z());return o.createElement("div",{ref:T=>{this._element=T},className:e,id:this.props.id||this.wrapperID,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,tabIndex:this.props.disabled?void 0:this.props.tabIndex,onFocus:this.handleFocus,onBlur:this.handleBlur,onMouseDown:this.handleMouseDown,onClick:this.handleClick,onKeyDown:this.handleKeyDown,"aria-disabled":this.props.disabled,dir:this.props.dir},o.createElement(vt,{key:`.kendo.calendar.header.${w.getTime()}`,activeView:i,currentDate:w,min:this.min,max:this.max,rangeLength:this.props.views,bus:this.bus,service:this.service,headerTitle:this.props.headerTitle,verticalView:this.props.mobileMode,commands:o.createElement(o.Fragment,null,o.createElement(F.Button,{type:"button",className:"k-calendar-nav-prev",icon:this.isRtl?"chevron-right":"chevron-left",svgIcon:this.isRtl?X.chevronRightIcon:X.chevronLeftIcon,fillMode:"flat",title:a,disabled:h,onClick:this.handlePrevButtonClick,...c}),o.createElement(Dt,{min:this.min,max:this.max,onClick:this.handleTodayClick,disabled:!this.todayIsInRange}),o.createElement(F.Button,{type:"button",className:"k-calendar-nav-next",icon:this.isRtl?"chevron-left":"chevron-right",svgIcon:this.isRtl?X.chevronLeftIcon:X.chevronRightIcon,fillMode:"flat",title:r,disabled:u,onClick:this.handleNextButtonClick,...p}))}),o.createElement(Et,{ref:T=>{this.calendarViewList=T},dates:this.dates,activeView:i,focusedDate:this.focusedDate,min:this.min,max:this.max,bus:this.bus,service:this.service,selectionRange:s,value:this.selectedMultiple||this.selectedDate,cellUID:this.cellUID,views:this.props.views,onChange:this.handleDateChange,showWeekNumbers:this.props.weekNumber,onCellEnter:this.handleCellEnter,cell:this.props.cell,weekCell:this.props.weekCell,headerTitle:this.props.headerTitle,verticalView:this.props.mobileMode}))}isInMonth(i,t){return!!t&&l.firstDayOfMonth(t)<=i&&i<=l.lastDayOfMonth(t)}};let J=Vt;J.displayName="MultiViewCalendar",J.propTypes={activeRangeEnd:n.oneOf(["start","end"]),allowReverse:n.bool,bottomView:n.oneOf(["month","year","decade","century"]),className:n.string,defaultActiveView:n.oneOf(["month","year","decade","century"]),defaultValue:n.oneOfType([et(n.instanceOf(Date)),n.arrayOf(n.instanceOf(Date)),n.shape({start:et(n.instanceOf(Date)),end:et(n.instanceOf(Date))})]),disabled:n.bool,focusedDate:n.instanceOf(Date),id:n.string,ariaLabelledBy:n.string,ariaDescribedBy:n.string,max:n.instanceOf(Date),min:n.instanceOf(Date),mode:n.oneOf(["single","multiple","range"]),onBlur:n.func,onChange:n.func,onFocus:n.func,tabIndex:n.number,topView:n.oneOf(["month","year","decade","century"]),value:n.oneOfType([et(n.instanceOf(Date)),n.arrayOf(n.instanceOf(Date)),n.shape({start:et(n.instanceOf(Date).isRequired),end:et(n.instanceOf(Date).isRequired)})]),views:(i,t,e)=>{const s=i[t];return s!==void 0&&s<1?new Error(`Invalid prop '${t}' supplied to'${e}'. The '${t}' property cannot be less than 1'`):null},weekNumber:n.bool,dir:n.string},J.defaultProps={disabled:!1,min:it,max:st,navigation:!0,defaultActiveView:"month",defaultValue:null,topView:"century",tabIndex:0,bottomView:"month",views:2,allowReverse:!1};const Ri=d.createPropsContext(),qe=d.withPropsContext(Ri,J);qe.displayName="KendoReactMultiViewCalendar",x.registerForIntl(J),x.registerForLocalization(J);const Bt=class extends o.Component{constructor(i){super(i),this._element=null,this._calendar=null,this._startDateInput=o.createRef(),this._endDateInput=o.createRef(),this._popupId=d.guid(),this._startInputId=d.guid(),this._endInputId=d.guid(),this.shouldFocusDateInput=!1,this.shouldFocusCalendar=!1,this.focus=()=>{this.startDateInput&&this.startDateInput.focus()},this.setCalendarRef=t=>{this._calendar=t},this.focusCalendarElement=()=>{this._calendar&&this._calendar.element&&this._calendar.element.focus({preventScroll:!0})},this.calculateValue=(t,e)=>(t.value!==void 0?t.value:e.value)||H,this.calculateShow=(t,e)=>t.show!==void 0?t.show:e.show,this.renderCalendar=()=>{const t=this.value||H,e={min:this.min,max:this.max,allowReverse:this.props.allowReverse,mode:"range",focusedDate:this.props.focusedDate,disabled:this.props.disabled,className:this.mobileMode?"k-calendar-lg":"",mobileMode:this.mobileMode,...this.props.calendarSettings,value:t,dir:this.props.dir,onChange:this.handleCalendarChange};return this.props.calendar?o.createElement(this.props.calendar,{...e}):o.createElement(qe,{...e,ref:this.setCalendarRef})},this.renderPopup=()=>{const t={popupClass:"k-daterangepicker-popup",animate:this._element!==null,anchor:this._element,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...this.props.popupSettings,show:this.show};return this.props.popup?o.createElement(this.props.popup,{...t},this.renderCalendar()):o.createElement(qt.Popup,{...t},this.renderCalendar())},this.renderAdaptivePopup=()=>{const{windowWidth:t=0}=this.state,e={expand:this.show,onClose:s=>this.handleCancel(s),adaptiveTitle:this.props.adaptiveTitle,windowWidth:t,footer:{cancelText:this.localizationService.toLanguageString(Se,V[Se]),onCancel:this.handleCancel,applyText:this.localizationService.toLanguageString(De,V[De]),onApply:this.handleBlur}};return o.createElement(ne,{...e},o.createElement(ht.ActionSheetContent,{className:"!k-overflow-hidden"},o.createElement("div",{className:"k-scrollable-wrap"},this.renderCalendar())))},this.handleReverseClick=t=>{const e={start:this.value.end,end:this.value.start},s={syntheticEvent:t,nativeEvent:t.nativeEvent};this.handleChange(e,s)},this.handleReverseMouseDown=t=>{t.preventDefault()},this.handleFocus=t=>{clearTimeout(this.nextTickId),this.shouldFocusDateInput||(this.setShow(!0),this.mobileMode&&this.setState({currentValue:this.value}));const{onFocus:e}=this.props;e&&e.call(void 0,t)},this.handleBlur=t=>{this.nextTick(()=>{this.setShow(!1)});const{onBlur:e}=this.props;e&&e.call(void 0,t)},this.handleCancel=t=>{this.nextTick(()=>{this.setShow(!1),this.setState({currentValue:H})});const{onCancel:e}=this.props;e&&e.call(void 0,t)},this.handleEndChange=t=>{const e={start:this.value.start,end:l.cloneDate(t.value||void 0)};this.handleChange(e,t)},this.handleStartChange=t=>{const e={start:l.cloneDate(t.value||void 0),end:this.value.end};this.handleChange(e,t)},this.extractRangeFromValue=t=>{if(!Array.isArray(t.value)&&!(t.value instanceof Date))return t.value||H;const e=Array.isArray(t.value)?t.value[0]:t.value;return{start:this.value.end!==null?e:this.value.start,end:this.value.start!==null?e:this.value.end}},this.handleCalendarChange=t=>{const e=this.extractRangeFromValue(t);this.handleChange(e,t)},this.handleKeyDown=t=>{const{keyCode:e,altKey:s}=t,a=d.getActiveElement(document);e===d.Keys.esc?(t.preventDefault(),this.shouldFocusDateInput=!0,this.setShow(!1)):s&&e===d.Keys.down?(t.preventDefault(),this.shouldFocusCalendar=!0,this.setShow(!0)):e===d.Keys.tab&&this.show&&this._calendar&&this._calendar.element&&this.endDateInput&&this.endDateInput.element&&document&&a===this.endDateInput.element&&(t.preventDefault(),this.focusCalendarElement())},this.handleChange=(t,e)=>{this.setState({value:t}),this.valueDuringOnChange=t;const{onChange:s}=this.props;if(s){const a={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:this.value,show:this.show,target:this};s.call(void 0,a)}this.valueDuringOnChange=void 0},d.validatePackage(gt),this.state={show:this.props.show||this.props.defaultShow||Bt.defaultProps.defaultShow,value:this.props.value||this.props.defaultValue||Bt.defaultProps.defaultValue,currentValue:H},this.nextTick=this.nextTick.bind(this),this.setShow=this.setShow.bind(this),this.focusCalendarElement=this.focusCalendarElement.bind(this),this.focusDateInputElement=this.focusDateInputElement.bind(this)}get element(){return this._element}get startDateInput(){return this._startDateInput.current}get endDateInput(){return this._endDateInput.current}get calendar(){return this._calendar}get value(){return(this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value)||H}get show(){return this.showDuringOnChange!==void 0?this.showDuringOnChange:this.props.show!==void 0?this.props.show:this.state.show}get min(){return this.props.min!==void 0?this.props.min:Bt.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:Bt.defaultProps.max}get document(){if(d.canUseDOM)return this.element&&this.element.ownerDocument||document}get localizationService(){return x.provideLocalizationService(this)}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=ae&&this.props.adaptive)}componentDidMount(){var i;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){this.shouldFocusCalendar&&this.focusCalendarElement(),this.shouldFocusDateInput&&this.focusDateInputElement(),this.shouldFocusCalendar=!1,this.shouldFocusDateInput=!1}componentWillUnmount(){var i;clearTimeout(this.nextTickId),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.disconnect()}render(){const i=this.value||H,t=this.mobileMode&&this.show?this.state.currentValue:i,e=(this.props.startDateInputSettings||{}).id||this._startInputId,s=(this.props.endDateInputSettings||{}).id||this._endInputId,a=d.classNames("k-daterangepicker",{"k-disabled":this.props.disabled},this.props.className),r=this.localizationService.toLanguageString(Zt,V[Zt]),h=this.localizationService.toLanguageString(Gt,V[Gt]),u=this.localizationService.toLanguageString(Xt,V[Xt]),c={disableSelection:this.mobileMode&&!0,label:r,format:this.props.format,min:this.min,max:this.max,id:this._startInputId,disabled:this.props.disabled,valid:this.props.valid,tabIndex:this.props.tabIndex,ariaExpanded:this.show,...this.props.startDateInputSettings,value:t.start,onChange:this.handleStartChange},p={disableSelection:this.mobileMode&&!0,label:h,format:this.props.format,min:this.min,max:this.max,id:this._endInputId,disabled:this.props.disabled,valid:this.props.valid,tabIndex:this.props.tabIndex,ariaExpanded:this.show,...this.props.endDateInputSettings,value:t.end,onChange:this.handleEndChange},m=o.createElement(F.Button,{type:"button",className:"k-select",fillMode:"flat",title:x.provideLocalizationService(this).toLanguageString(yt,V[yt]),onMouseDown:this.handleReverseMouseDown,onClick:this.handleReverseClick,"aria-controls":e+" "+s,"aria-label":x.provideLocalizationService(this).toLanguageString(yt,V[yt])},o.createElement(d.IconWrap,{style:{transform:"rotate(90deg)"},name:"arrows-swap",icon:X.arrowsSwapIcon}));return o.createElement(o.Fragment,null,o.createElement("span",{ref:f=>{this._element=f},className:a,style:this.props.style,id:this.props.id,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,tabIndex:this.props.tabIndex,onFocus:this.handleFocus,onBlur:this.mobileMode?void 0:this.handleBlur,onKeyDown:this.handleKeyDown,dir:this.props.dir},this.props.startDateInput?o.createElement(this.props.startDateInput,{...c}):o.createElement(lt,{...c,ref:this._startDateInput,ariaRole:"combobox",ariaControls:this._popupId,readonly:this.mobileMode}),(this.props.allowReverse||this.props.calendarSettings&&this.props.calendarSettings.allowReverse)&&this.props.swapButton?m:u,this.props.endDateInput?o.createElement(this.props.endDateInput,{...p}):o.createElement(lt,{...p,ref:this._endDateInput,ariaRole:"combobox",ariaControls:this._popupId,readonly:this.mobileMode}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup())}focusDateInputElement(){if(!document||!this.startDateInput||!this.startDateInput.element||!this.endDateInput||!this.endDateInput.element)return;const i=d.getActiveElement(document);(this.value.start===null||this.value.end!==null)&&i!==this.endDateInput.element?this.startDateInput.element.focus({preventScroll:!0}):i!==this.startDateInput.element&&this.endDateInput.element.focus({preventScroll:!0})}nextTick(i){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>i())}setShow(i){const{onOpen:t,onClose:e}=this.props;this.show!==i&&(this.setState({show:i}),i&&t&&t.call(void 0,{target:this}),!i&&e&&e.call(void 0,{target:this}))}calculateMedia(i){for(let t of i)this.setState({windowWidth:t.target.clientWidth})}};let Ot=Bt;Ot.displayName="DateRangePicker",Ot.propTypes={allowReverse:n.bool,calendarSettings:n.any,className:n.string,defaultShow:n.bool,defaultValue:n.shape({start:et(n.instanceOf(Date).isRequired),end:et(n.instanceOf(Date).isRequired)}),disabled:n.bool,endDateInputSettings:n.shape(ot.propTypes),focusedDate:n.instanceOf(Date),format:n.oneOfType([n.string,n.shape({skeleton:n.string,pattern:n.string,date:n.oneOf(["short","medium","long","full"]),time:n.oneOf(["short","medium","long","full"]),datetime:n.oneOf(["short","medium","long","full"]),era:n.oneOf(["narrow","short","long"]),year:n.oneOf(["numeric","2-digit"]),month:n.oneOf(["numeric","2-digit","narrow","short","long"]),day:n.oneOf(["numeric","2-digit"]),weekday:n.oneOf(["narrow","short","long"]),hour:n.oneOf(["numeric","2-digit"]),hour12:n.bool,minute:n.oneOf(["numeric","2-digit"]),second:n.oneOf(["numeric","2-digit"]),timeZoneName:n.oneOf(["short","long"])})]),id:n.string,ariaLabelledBy:n.string,ariaDescribedBy:n.string,max:n.instanceOf(Date),min:n.instanceOf(Date),onBlur:n.func,onChange:n.func,onFocus:n.func,popupSettings:n.any,show:n.bool,startDateInputSettings:n.any,style:n.any,swapButton:n.any,tabIndex:n.number,dir:n.string,value:n.shape({start:et(n.instanceOf(Date).isRequired),end:et(n.instanceOf(Date).isRequired)})},Ot.defaultProps={allowReverse:!1,defaultShow:!1,defaultValue:H,disabled:!1,format:"d",max:st,min:it,swapButton:!1};const Wi=d.createPropsContext(),Ui=d.withPropsContext(Wi,Ot);Ui.displayName="KendoReactDateRangePicker",x.registerForLocalization(Ot);class Re extends o.Component{constructor(t){super(t),this._calendar=null,this._timePart=null,this._cancelButton=null,this._acceptButton=null,this._calendarWrap=null,this.shouldFocusPart=!1,this.focus=e=>{Promise.resolve().then(()=>{this.state.tab==="time"&&this._timePart&&this._timePart.focus(e);const s=this.calendarElement();this.state.tab==="date"&&s&&s.focus(e)})},this.calendarElement=()=>this._calendar&&this._calendar.element||this._calendarWrap&&this._calendarWrap.querySelector(".k-widget.k-calendar"),this.move=e=>{if(e==="right"&&this.state.tab==="time"||e==="left"&&this.state.tab==="date")return;const s=e==="left"?"date":"time";this.shouldFocusPart=!0,this.setState({tab:s})},this.dateTimeFooter=()=>{const{cancelButton:e}=this.props,s=this.localizationService.toLanguageString(Lt,V[Lt]),a=this.localizationService.toLanguageString(At,V[At]);return o.createElement("div",{className:"k-datetime-footer k-actions k-actions-stretched "},e&&o.createElement(F.Button,{type:"button",ref:r=>{this._cancelButton=r},className:"k-time-cancel",onClick:this.handleReject,title:s,"aria-label":s},s),o.createElement(F.Button,{type:"button",themeColor:"primary",ref:r=>{this._acceptButton=r},className:"k-time-accept",disabled:!this.hasDateValue,onClick:this.handleAccept,title:a,"aria-label":a},a))},this.handleReject=e=>{this.setState({dateValue:this.props.value,timeValue:this.props.value||A});const s=this.mergeDate(this.props.value,this.props.value||A);if(this.props.onReject){const a={nativeEvent:e.nativeEvent,syntheticEvent:e,target:this,value:s};this.props.onReject.call(void 0,a)}},this.handleAccept=(e,s)=>{if(!this.state.dateValue||!this.state.timeValue||!this.hasDateValue)return;const a=this.mergeDate(this.state.dateValue,s||this.state.timeValue);this.props.onChange.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:a,target:this})},this.handleNowClick=e=>{this.setState({timeValue:ut()}),this.handleAccept(e,ut())},this.handleCalendarValueChange=e=>{e.syntheticEvent.stopPropagation(),this.setState({dateValue:e.value,tab:"time"}),this.shouldFocusPart=!0},this.handleTimeListContainerChange=e=>{this.setState({timeValue:e})},this.handleDateClick=e=>{e.stopPropagation(),this.move("left")},this.handleTimeClick=e=>{e.stopPropagation(),this.move("right")},this.handleKeyDown=e=>{const{keyCode:s,altKey:a}=e;switch(s){case d.Keys.enter:!this.hasActiveButton()&&this.hasDateValue&&this.handleAccept(e);return;case d.Keys.left:if(!a)return;this.move("left");return;case d.Keys.right:if(!a)return;this.move("right");return;default:return}},this.handleTimePartMount=e=>{this.setState({timeValue:e})},this.state={tab:"date",dateValue:this.props.value,timeValue:this.props.value||A}}get calendar(){return this._calendar}get timePart(){return this._timePart}get hasDateValue(){return this.state.dateValue!==null}get localizationService(){return x.provideLocalizationService(this)}componentDidUpdate(){this.shouldFocusPart&&this.focus({preventScroll:!0}),this.shouldFocusPart=!1}render(){const{disabled:t,min:e,max:s,weekNumber:a,focusedDate:r,format:h,mobileMode:u,footerActions:c}=this.props,p=d.classNames({"k-date-tab":this.state.tab==="date","k-time-tab":this.state.tab==="time","k-disabled":t},"k-datetime-wrap"),m=this.localizationService.toLanguageString(be,V[be]),f=this.localizationService.toLanguageString(ye,V[ye]),v={min:e,max:s,weekNumber:a,focusedDate:r,disabled:t||this.state.tab!=="date",value:this.state.dateValue,onChange:this.handleCalendarValueChange,navigation:!1,mobileMode:u};return o.createElement("div",{onKeyDown:this.handleKeyDown,className:p,tabIndex:-1},o.createElement("div",{className:"k-datetime-buttongroup"},o.createElement(F.ButtonGroup,{width:"100%"},o.createElement(F.Button,{type:"button",selected:this.state.tab==="date",togglable:!0,onClick:this.handleDateClick},m),o.createElement(F.Button,{type:"button",selected:this.state.tab==="time",togglable:!0,onClick:this.handleTimeClick},f))),o.createElement("div",{className:"k-datetime-selector"},o.createElement("div",{className:"k-datetime-calendar-wrap",ref:w=>this._calendarWrap=w},this.props.calendar?o.createElement(this.props.calendar,{...v}):o.createElement(te,{ref:w=>{this._calendar=w},...v})),o.createElement("div",{className:"k-datetime-time-wrap"},o.createElement("div",{className:u?"k-reset k-timeselector-lg k-timeselector":""},o.createElement(pt,{key:1,onNowClick:this.handleNowClick,disabled:t||this.state.tab!=="time",ref:w=>{this._timePart=w},min:this.minTime||ct,max:this.maxTime||nt,steps:this.props.steps,value:this.state.timeValue,format:h,onChange:this.handleTimeListContainerChange,onMount:this.handleTimePartMount,mobileMode:u})))),c&&this.dateTimeFooter())}get minTime(){return this.props.minTime!==void 0?this.props.minTime:this.normalizeRange(this.props.min,this.state.dateValue)}get maxTime(){return this.props.maxTime!==void 0?this.props.maxTime:this.normalizeRange(this.props.max,this.state.dateValue)}normalizeRange(t,e){return l.isEqualDate(t,e||z())?t:null}hasActiveButton(){if(!this._acceptButton)return!1;const t=d.getActiveElement(document);return this._acceptButton&&t===this._acceptButton.element||this._cancelButton&&t===this._cancelButton.element}mergeTime(t,e){return t&&e?B(e,t):e}mergeDate(t,e){return t?B(t||z(),e):e}}Re.defaultProps={footerActions:!0},x.registerForLocalization(Re);const Q=class extends o.Component{constructor(i){super(i),this._popupId=d.guid(),this._element=null,this._dateInput=o.createRef(),this._dateTimeSelector=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.focus=()=>{const t=this.dateInputElement();t&&t.focus()},this.renderPicker=()=>{const{disabled:t,minTime:e,maxTime:s,format:a,calendar:r,cancelButton:h,weekNumber:u,focusedDate:c}=this.props;return o.createElement(Re,{ref:p=>{this._dateTimeSelector=p},cancelButton:h,steps:this.props.steps,value:this.value,onChange:this.handleValueChange,onReject:this.handleReject,disabled:t,weekNumber:u,min:this.min,max:this.max,minTime:e,maxTime:s,focusedDate:c,format:a,calendar:r,mobileMode:this.mobileMode,footerActions:!this.mobileMode})},this.renderAdaptivePopup=()=>{const{windowWidth:t=0}=this.state,e=x.provideLocalizationService(this).toLanguageString(Lt,V[Lt]),s=x.provideLocalizationService(this).toLanguageString(At,V[At]),a={expand:this.show,onClose:this.handleBlur,adaptiveTitle:this.props.adaptiveTitle,windowWidth:t,footer:{cancelText:e,onCancel:r=>{var h;return(h=this._dateTimeSelector)==null?void 0:h.handleReject(r)},applyText:s,onApply:r=>{var h;return(h=this._dateTimeSelector)==null?void 0:h.handleAccept(r)}}};return o.createElement(ne,{...a},o.createElement(ht.ActionSheetContent,{className:"!k-overflow-hidden"},this.renderPicker()))},this.handleReject=()=>{this.shouldFocusDateInput=!0,this.setShow(!1)},this.handleValueChange=t=>{this.setState({value:l.cloneDate(t.value||void 0)}),this.valueDuringOnChange=t.value,this.showDuringOnChange=!1,this.mobileMode||(this.shouldFocusDateInput=!0);const{onChange:e}=this.props;e&&e.call(void 0,{syntheticEvent:t.syntheticEvent,nativeEvent:t.nativeEvent,value:this.value,show:this.show,target:this}),this.valueDuringOnChange=void 0,this.showDuringOnChange=void 0,this.setShow(!1)},this.handleFocus=()=>{this.setState({focused:!0})},this.handleBlur=()=>{this.setState({focused:!1}),this.setShow(!1)},this.handleDateIconClick=()=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=t=>{t.preventDefault()},this.handleKeyDown=t=>{const{altKey:e,keyCode:s}=t;if(s===d.Keys.esc){this.shouldFocusDateInput=!0,this.setShow(!1);return}e&&(s===d.Keys.up||s===d.Keys.down)&&(t.preventDefault(),t.stopPropagation(),this.shouldFocusDateInput=s===d.Keys.up,this.setShow(s===d.Keys.down))},this.dateInputElement=()=>this.dateInput&&this.dateInput.element||this.element&&this.element.querySelector(".k-dateinput > input.k-input-inner"),d.validatePackage(gt),this.state={value:this.props.defaultValue||Q.defaultProps.defaultValue,show:this.props.defaultShow||Q.defaultProps.defaultShow,focused:!1}}get document(){if(d.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get dateInput(){return this._dateInput.current}get value(){const i=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return i!==null?l.cloneDate(i):null}get show(){return this.showDuringOnChange!==void 0?this.showDuringOnChange:this.props.show!==void 0?this.props.show:this.state.show}get name(){return this.props.name}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=ae&&this.props.adaptive)}get min(){return this.props.min!==void 0?this.props.min:Q.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:Q.defaultProps.max}get validity(){const i=je(this.value,this.min,this.max)&&Oe(this.value,this.props.minTime||ct,this.props.maxTime||nt),t=this.props.validationMessage!==void 0,e=(!this.required||this.value!==null)&&i,s=this.props.valid!==void 0?this.props.valid:e;return{customError:t,rangeOverflow:this.value&&this.max.getTime()<this.value.getTime()||!1,rangeUnderflow:this.value&&this.value.getTime()<this.min.getTime()||!1,valid:s,valueMissing:this.value===null}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:Q.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:Q.defaultProps.required}get dateInputComp(){return this.props.dateInput||Q.defaultProps.dateInput}componentDidMount(){var i;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){const i=this.dateInputElement();this._dateTimeSelector&&this.show&&!this.prevShow&&this._dateTimeSelector.focus({preventScroll:!0}),i&&!this.show&&this.shouldFocusDateInput&&i.focus({preventScroll:!0}),this.prevShow=this.show,this.shouldFocusDateInput=!1}componentWillUnmount(){var i;clearTimeout(this.nextTickId),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:i=Q.defaultProps.size,rounded:t=Q.defaultProps.rounded,fillMode:e=Q.defaultProps.fillMode,disabled:s,tabIndex:a,title:r,id:h,format:u,formatPlaceholder:c,min:p,max:m,className:f,width:v,name:w,validationMessage:T,required:E,validityStyles:O,minTime:y,maxTime:P,ariaLabelledBy:b,ariaDescribedBy:R,popup:k=qt.Popup}=this.props,M=!this.validityStyles||this.validity.valid,W={id:h,ariaLabelledBy:b,ariaDescribedBy:R,format:u,formatPlaceholder:c,disabled:s,title:r,validityStyles:O,validationMessage:T,required:E,min:p,max:m,minTime:y,maxTime:P,name:w,tabIndex:this.show?-1:a,valid:this.validity.valid,value:this.value,onChange:this.handleValueChange,steps:this.props.steps,label:void 0,placeholder:this.state.focused?null:this.props.placeholder,ariaExpanded:this.show,size:null,fillMode:null,rounded:null},C=o.createElement(d.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.handleBlur,onSyncFocus:this.props.onFocus,onSyncBlur:this.props.onBlur},({onFocus:N,onBlur:tt})=>o.createElement(o.Fragment,null,o.createElement("div",{ref:G=>{this._element=G},className:d.classNames("k-input","k-datetimepicker",{[`k-input-${d.kendoThemeMaps.sizeMap[i]||i}`]:i,[`k-rounded-${d.kendoThemeMaps.roundedMap[t]||t}`]:t,[`k-input-${e}`]:e,["k-invalid"]:!M,["k-required"]:this.required,["k-disabled"]:this.props.disabled},f),onKeyDown:this.handleKeyDown,style:{width:v},onFocus:this.mobileMode?void 0:N,onBlur:tt,onClick:this.mobileMode?this.handleDateIconClick:void 0},o.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",ariaControls:this._popupId,readonly:this.mobileMode,...W}),o.createElement(F.Button,{tabIndex:-1,type:"button",icon:"calendar",svgIcon:X.calendarIcon,onMouseDown:this.handleIconMouseDown,onClick:this.mobileMode?void 0:this.handleDateIconClick,title:x.provideLocalizationService(this).toLanguageString(St,V[St]),className:"k-input-button",rounded:null,"aria-label":x.provideLocalizationService(this).toLanguageString(St,V[St])}),o.createElement(k,{show:this.show,animate:this.element!==null,anchor:this.element,popupClass:"k-datetime-container k-reset",id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"}},!this.mobileMode&&this.renderPicker())),this.mobileMode&&this.renderAdaptivePopup()));return this.props.label?o.createElement(Pe,{dateInput:this._dateInput,label:this.props.label,editorId:h,editorValid:M,editorDisabled:this.props.disabled,children:C,style:{width:this.props.width}}):C}setShow(i){const{onOpen:t,onClose:e}=this.props;this.show!==i&&(this.setState({show:i}),i&&t&&t.call(void 0,{target:this}),!i&&e&&e.call(void 0,{target:this}))}nextTick(i){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>i())}calculateMedia(i){for(let t of i)this.setState({windowWidth:t.target.clientWidth})}};let Pt=Q;Pt.displayName="DateTimePicker",Pt.propTypes={className:n.string,defaultShow:n.bool,defaultValue:n.instanceOf(Date),disabled:n.bool,focusedDate:n.instanceOf(Date),format:n.oneOfType([n.string,n.shape({skeleton:n.string,pattern:n.string,date:n.oneOf(["short","medium","long","full"]),time:n.oneOf(["short","medium","long","full"]),datetime:n.oneOf(["short","medium","long","full"]),era:n.oneOf(["narrow","short","long"]),year:n.oneOf(["numeric","2-digit"]),month:n.oneOf(["numeric","2-digit","narrow","short","long"]),day:n.oneOf(["numeric","2-digit"]),weekday:n.oneOf(["narrow","short","long"]),hour:n.oneOf(["numeric","2-digit"]),hour12:n.bool,minute:n.oneOf(["numeric","2-digit"]),second:n.oneOf(["numeric","2-digit"]),timeZoneName:n.oneOf(["short","long"])})]),formatPlaceholder:n.oneOfType([n.oneOf(["wide","narrow","short","formatPattern"]),n.shape({year:n.string,month:n.string,day:n.string,hour:n.string,minute:n.string,second:n.string})]),id:n.string,ariaLabelledBy:n.string,ariaDescribedBy:n.string,min:n.instanceOf(Date),max:n.instanceOf(Date),name:n.string,popupSettings:n.shape({animate:n.bool,appendTo:n.any,popupClass:n.string}),show:n.bool,tabIndex:n.number,title:n.string,value:n.instanceOf(Date),weekNumber:n.bool,width:n.oneOfType([n.number,n.string]),validationMessage:n.string,required:n.bool,validate:n.bool,valid:n.bool,cancelButton:n.bool,size:n.oneOf([null,"small","medium","large"]),rounded:n.oneOf([null,"small","medium","large","full"]),fillMode:n.oneOf([null,"solid","flat","outline"])},Pt.defaultProps={defaultShow:!1,defaultValue:null,disabled:!1,format:"g",max:st,min:it,popupSettings:{},tabIndex:0,weekNumber:!1,required:!1,validityStyles:!0,cancelButton:!0,dateInput:lt,size:"medium",rounded:"medium",fillMode:"solid"};const Yi=d.createPropsContext(),$i=d.withPropsContext(Yi,Pt);$i.displayName="KendoReactDateTimePicker",x.registerForLocalization(Pt),g.Action=S,g.BusViewService=de,g.Calendar=te,g.CalendarCell=$e,g.CalendarHeaderTitle=ri,g.CalendarNavigationItem=li,g.CalendarPropsContext=ui,g.CalendarViewEnum=I,g.CalendarWeekCell=Ke,g.CalendarWithoutContext=rt,g.CenturyViewService=Xe,g.DOMService=ei,g.DateInput=lt,g.DateInputPropsContext=gi,g.DateInputWithoutContext=ot,g.DatePicker=yi,g.DatePickerPropsContext=bi,g.DatePickerWithoutContext=xt,g.DateRangePicker=Ui,g.DateRangePickerPropsContext=Wi,g.DateRangePickerWithoutContext=Ot,g.DateTimePicker=$i,g.DateTimePickerPropsContext=Yi,g.DateTimePickerWithoutContext=Pt,g.DayPeriodService=Si,g.DecadeViewService=Je,g.EMPTY_SELECTIONRANGE=H,g.Header=vt,g.HorizontalViewList=Et,g.HoursService=Ti,g.MAX_DATE=st,g.MAX_TIME=nt,g.MIN_DATE=it,g.MIN_TIME=ct,g.MinutesService=Oi,g.MonthViewService=Qe,g.MultiViewCalendar=qe,g.MultiViewCalendarPropsContext=Ri,g.MultiViewCalendarWithoutContext=J,g.NavigationService=pe,g.PickerWrap=vi,g.ScrollSyncService=ii,g.SecondsService=Mi,g.TimeList=zt,g.TimePart=pt,g.TimePicker=Ai,g.TimePickerPropsContext=Li,g.TimePickerWithoutContext=Ct,g.TimeSelector=Tt,g.TodayCommand=Dt,g.ToggleButton=fi,g.ViewList=Ht,g.Virtualization=ft,g.WeekNamesService=si,g.YearViewService=ti,g.dateInputsMessages=V,g.decreaseValue=bt,g.end=Gt,g.getNow=ut,g.getToday=z,g.increaseValue=wt,g.separator=Xt,g.start=Zt,g.swapStartEnd=yt,g.today=Kt,g.toggleCalendar=jt,g.toggleDateTimeSelector=St,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
21
+ `);return null},value:n.instanceOf(Date),smoothScroll:n.bool,show:n.bool},zt.defaultProps={boundRange:!1,max:nt,min:H,step:1,smoothScroll:!0},I.registerForIntl(zt);const He=new RegExp(`${K.hour}|${K.minute}|${K.second}|${K.dayperiod}|literal`),dt=class extends o.Component{constructor(i){super(i),this._element=null,this._nowButton=null,this.dateFormatParts=[],this.timeLists=[],this.focus=t=>{Promise.resolve().then(()=>{const e=this.timeLists[0];this.state.activeListIndex===-1&&!this.hasActiveButton()&&e&&e.element&&e.focus(t)})},this.timeFormatReducer=(t,e)=>t+e.pattern,this.timeFormatFilter=(t,e,s)=>{const a=e>=1&&s[e-1];return a&&a&&t.type==="literal"?He.test(a.type||""):He.test(t.type||"")},this.focusList=t=>{this.timeLists.length&&this.timeLists.reduce(this.listReducer,[]).map(e=>t===1?e.next:e.prev).map(e=>e&&e.element&&e.element.focus({preventScroll:!0}))},this.listReducer=(t,e,s,a)=>t.length||e.props.id!==this.state.activeListIndex?t:[{next:a[s+1]||e,prev:a[s-1]||e}],this.showNowButton=()=>!this.hasSteps()&&this.props.nowButton&&Ve(ut(),this.min,this.max),this.handleKeyDown=t=>{const{keyCode:e}=t;switch(e){case d.Keys.left:t.preventDefault(),this.focusList(0);return;case d.Keys.right:t.preventDefault(),this.focusList(1);return;default:return}},this.handleListBlur=()=>{this.nextTick(()=>{this.setState({activeListIndex:-1})})},this.handleListFocus=t=>{clearTimeout(this.nextTickId),this.setState({activeListIndex:t})},this.handleChange=t=>{const{onChange:e}=this.props;e&&e.call(void 0,t)},this.snapTime=mi(pi(this.props.steps,this.props.min||dt.defaultProps.min)),this.state={activeListIndex:-1},this.hasActiveButton=this.hasActiveButton.bind(this)}get element(){return this._element}get value(){return Ys(this.snapTime(l.cloneDate(this.props.value||H)),this.min,this.max)}get intl(){return I.provideIntlService(this)}get min(){return this.snapTime(this.props.min||dt.defaultProps.min)}get max(){return this.snapTime(this.props.max||dt.defaultProps.max)}get steps(){return this.props.steps||dt.defaultProps.steps}get boundRange(){return this.props.boundRange!==void 0?this.props.boundRange:dt.defaultProps.boundRange}componentWillUnmount(){clearTimeout(this.nextTickId)}componentDidMount(){const{onMount:i}=this.props;i&&i.call(void 0,this.value)}render(){const{format:i,smoothScroll:t,onNowClick:e,className:s,disabled:a,mobileMode:r,show:h}=this.props;this.snapTime=mi(pi(this.steps,this.min)),this.dateFormatParts=this.intl.splitDateFormat(i||dt.defaultProps.format).filter(this.timeFormatFilter);const u=d.classNames({"k-disabled":a,"k-time-part":r},s);this.timeLists=[];const c=I.provideLocalizationService(this),p=c.toLanguageString(ve,O[ve]);return o.createElement("div",{className:u},o.createElement("div",{className:"k-time-header"},o.createElement("span",{className:"k-title"},this.intl.formatDate(this.value,this.dateFormatParts.reduce(this.timeFormatReducer,""))),this.showNowButton()&&o.createElement(F.Button,{type:"button",ref:m=>{this._nowButton=m},className:"k-time-now",fillMode:"flat",themeColor:"primary",title:p,"aria-label":p,onClick:e,tabIndex:a?-1:0},c.toLanguageString(fe,O[fe]))),o.createElement("div",{className:"k-time-list-container",onKeyDown:this.handleKeyDown},o.createElement("span",{className:"k-time-highlight"}),this.dateFormatParts.map((m,f)=>m.type!=="literal"?o.createElement("div",{key:f,className:d.classNames("k-time-list-wrapper",{"k-focus":f===this.state.activeListIndex}),role:"presentation",tabIndex:-1},o.createElement("span",{className:"k-title",onMouseDown:v=>{v.preventDefault()}},this.intl.dateFieldName(m)),o.createElement(zt,{min:this.min,max:this.max,boundRange:this.boundRange,part:m,step:m.type?this.steps[m.type]:1,smoothScroll:t,ref:v=>{v&&this.timeLists.push(v)},id:f,onFocus:()=>{this.handleListFocus(f)},onBlur:this.handleListBlur,onChange:this.handleChange,value:this.value,disabled:a,show:h,mobileMode:r})):o.createElement("div",{key:f,className:"k-time-separator"},m.pattern))))}nextTick(i){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>i())}hasActiveButton(){const i=d.getActiveElement(document);return this._nowButton&&i===this._nowButton.element}hasSteps(){const i=Object.keys(this.steps);return i.length!==i.reduce((t,e)=>t+this.steps[e],0)}};let pt=dt;pt.propTypes={cancelButton:n.bool,disabled:n.bool,format:n.oneOfType([n.string,n.shape({skeleton:n.string,pattern:n.string,date:n.oneOf(["short","medium","long","full"]),time:n.oneOf(["short","medium","long","full"]),datetime:n.oneOf(["short","medium","long","full"]),era:n.oneOf(["narrow","short","long"]),year:n.oneOf(["numeric","2-digit"]),month:n.oneOf(["numeric","2-digit","narrow","short","long"]),day:n.oneOf(["numeric","2-digit"]),weekday:n.oneOf(["narrow","short","long"]),hour:n.oneOf(["numeric","2-digit"]),hour12:n.bool,minute:n.oneOf(["numeric","2-digit"]),second:n.oneOf(["numeric","2-digit"]),timeZoneName:n.oneOf(["short","long"])})]),max:n.instanceOf(Date),min:n.instanceOf(Date),nowButton:n.bool,steps:n.shape({hour:n.number,minute:n.number,second:n.number}),smoothScroll:n.bool,tabIndex:n.number,value:n.instanceOf(Date),show:n.bool},pt.defaultProps={value:null,disabled:!1,nowButton:!0,cancelButton:!0,format:"hh:mm a",min:ct,max:nt,steps:{},boundRange:!1},I.registerForIntl(pt),I.registerForLocalization(pt);const Ae=class extends o.Component{constructor(i){super(i),this._element=null,this._cancelButton=null,this._acceptButton=null,this.timePart=null,this.focusActiveList=()=>{this.timePart&&this.timePart.focus({preventScroll:!0})},this.handleKeyDown=t=>{const{keyCode:e}=t;switch(e){case d.Keys.enter:this.hasActiveButton()||this.handleAccept(t);return;default:return}},this.handleAccept=t=>{const e=this.mergeValue(l.cloneDate(this.value||ut()),this.timePart?this.timePart.value:this.current);this.setState({value:e}),this.valueDuringOnChange=e;const{onChange:s}=this.props;s&&s.call(void 0,{syntheticEvent:t,nativeEvent:t.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0},this.handleReject=t=>{this.setState({current:this.value});const{onReject:e}=this.props;e&&e.call(void 0,t)},this.handleNowClick=t=>{const e=this.mergeValue(l.cloneDate(this.value||ut()),ut());this.setState({current:e,value:e}),this.valueDuringOnChange=e;const{onChange:s}=this.props;s&&s.call(void 0,{syntheticEvent:t,nativeEvent:t.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0},this.handleChange=t=>{this.setState({current:t});const{handleTimeChange:e}=this.props;e&&e.call(void 0,{time:t})},this.dateFormatParts=this.intl.splitDateFormat(this.props.format||Ae.defaultProps.format),this.mergeValue=Us(Ws(this.dateFormatParts)),this.hasActiveButton=this.hasActiveButton.bind(this),this.state={current:this.props.value||H,value:this.props.value||Ae.defaultProps.value}}get element(){return this._element}get value(){const i=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return i!==null?l.cloneDate(i):null}get intl(){return I.provideIntlService(this)}get current(){return this.state.current!==null?l.cloneDate(this.state.current):null}componentWillUnmount(){clearTimeout(this.nextTickId)}render(){const{format:i,cancelButton:t,disabled:e,tabIndex:s,className:a,smoothScroll:r,min:h,max:u,boundRange:c,nowButton:p,steps:m,show:f,mobileMode:v}=this.props,w=I.provideLocalizationService(this),T=w.toLanguageString(Jt,O[Jt]),E=w.toLanguageString(_t,O[_t]);return o.createElement("div",{ref:V=>{this._element=V},tabIndex:e?void 0:s||0,className:d.classNames("k-timeselector",a,{"k-disabled":e}),onKeyDown:this.handleKeyDown},o.createElement(pt,{ref:V=>{this.timePart=V},value:this.current,onChange:this.handleChange,onNowClick:this.handleNowClick,format:i,smoothScroll:r,min:h,max:u,boundRange:c,disabled:e,nowButton:p,steps:m,show:f,mobileMode:v}),this.props.footer&&o.createElement("div",{className:"k-time-footer k-actions k-actions-stretched"},t&&o.createElement(F.Button,{type:"button",ref:V=>{this._cancelButton=V},className:"k-time-cancel",onClick:this.handleReject,title:T,"aria-label":T},T),o.createElement(F.Button,{type:"button",ref:V=>{this._acceptButton=V},className:"k-time-accept",themeColor:"primary",onClick:this.handleAccept,title:E,"aria-label":E},E)))}nextTick(i){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>i())}hasActiveButton(){if(!this._acceptButton||!this._acceptButton.element)return!1;const i=d.getActiveElement(document);return this._acceptButton&&i===this._acceptButton.element||this._cancelButton&&i===this._cancelButton.element}};let Tt=Ae;Tt.propTypes={cancelButton:n.bool,className:n.string,disabled:n.bool,format:n.oneOfType([n.string,n.shape({skeleton:n.string,pattern:n.string,date:n.oneOf(["short","medium","long","full"]),time:n.oneOf(["short","medium","long","full"]),datetime:n.oneOf(["short","medium","long","full"]),era:n.oneOf(["narrow","short","long"]),year:n.oneOf(["numeric","2-digit"]),month:n.oneOf(["numeric","2-digit","narrow","short","long"]),day:n.oneOf(["numeric","2-digit"]),weekday:n.oneOf(["narrow","short","long"]),hour:n.oneOf(["numeric","2-digit"]),hour12:n.bool,minute:n.oneOf(["numeric","2-digit"]),second:n.oneOf(["numeric","2-digit"]),timeZoneName:n.oneOf(["short","long"])})]),max:n.instanceOf(Date),min:n.instanceOf(Date),nowButton:n.bool,steps:n.shape({hour:n.number,minute:n.number,second:n.number}),smoothScroll:n.bool,tabIndex:n.number,value:n.instanceOf(Date),show:n.bool},Tt.defaultProps={value:null,disabled:!1,cancelButton:!0,format:"t",min:ct,max:nt,boundRange:!1,footer:!0},I.registerForIntl(Tt),I.registerForLocalization(Tt);const Z=class extends o.Component{constructor(i){super(i),this._element=null,this._dateInput=o.createRef(),this._timeSelector=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.focus=()=>{this.dateInput&&this.dateInput.focus()},this.renderTimeSelector=()=>{const{smoothScroll:t,cancelButton:e,nowButton:s,disabled:a,format:r,steps:h}=this.props;return o.createElement(Tt,{ref:this.setTimeSelectorRef,className:this.mobileMode?"k-reset k-timeselector-lg":"",mobileMode:this.mobileMode,show:this.show,cancelButton:e,disabled:a,nowButton:s,format:r,min:this.min,max:this.max,steps:h,smoothScroll:t,value:this.value,footer:!this.mobileMode,handleTimeChange:this.mobileMode&&this.handleTimeChange,onChange:this.handleValueChange,onReject:this.handleValueReject})},this.renderPopup=()=>{const{popupClass:t,...e}=this.popupSettings,s=d.classNames("k-group k-reset",t),a={popupClass:"k-timepicker-popup",show:this.show,animate:this.element!==null,anchor:this.element,className:s,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...e};return this.props.popup?o.createElement(this.props.popup,{...a},this.renderTimeSelector()):o.createElement(qt.Popup,{...a},this.renderTimeSelector())},this.renderAdaptivePopup=()=>{const{windowWidth:t=0}=this.state,e={expand:this.show,onClose:this.handleBlur,adaptiveTitle:this.props.adaptiveTitle,windowWidth:t,footer:{cancelText:this.localizationService.toLanguageString(Qt,O[Jt]),onCancel:this.handleValueReject,applyText:this.localizationService.toLanguageString(_t,O[_t]),onApply:s=>this.handleValueChange(s)}};return o.createElement(ne,{...e},o.createElement(ht.ActionSheetContent,{className:"!k-overflow-hidden"},this.renderTimeSelector()))},this.setTimeSelectorRef=t=>{this._timeSelector=t},this.nextValue=(t,e)=>t.value!==void 0?t.value:e.value,this.nextShow=(t,e)=>t.show!==void 0?t.show:e.show,this.handleInputValueChange=t=>{const e=this.mergeTime(t.value);this.handleValueChange({...t,value:e})},this.handleTimeChange=t=>{this.setState({candidate:t.time})},this.handleValueChange=t=>{this.setState({value:l.cloneDate(t.value||this.state.candidate)}),this.valueDuringOnChange=t.value,this.showDuringOnChange=!1,this.shouldFocusDateInput=!0;const{onChange:e}=this.props,s=this.value||this.state.candidate;e&&e.call(void 0,{syntheticEvent:t.syntheticEvent,nativeEvent:t.nativeEvent,value:s,show:this.show,target:this}),this.valueDuringOnChange=void 0,this.showDuringOnChange=void 0,this.setShow(!1)},this.handleFocus=()=>{this.setState({focused:!0})},this.handleBlur=()=>{this.setState({focused:!1}),this.setShow(!1)},this.handleValueReject=t=>{this.setShow(!1)},this.handleIconClick=t=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=t=>{t.preventDefault()},this.handleKeyDown=t=>{const{altKey:e,keyCode:s}=t;if(s===d.Keys.esc){this.shouldFocusDateInput=!0,this.setShow(!1);return}e&&(s===d.Keys.up||s===d.Keys.down)&&(t.preventDefault(),t.stopPropagation(),this.shouldFocusDateInput=s===d.Keys.up,this.setShow(s===d.Keys.down))},d.validatePackage(gt),this.state={value:this.props.defaultValue||Z.defaultProps.defaultValue,show:this.props.defaultShow||Z.defaultProps.defaultShow,focused:!1,candidate:null},this.normalizeTime=this.normalizeTime.bind(this),this.setShow=this.setShow.bind(this),this.mergeTime=this.mergeTime.bind(this)}get _popupId(){return this.props.id+"-popup-id"}get document(){if(d.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get dateInput(){return this._dateInput.current}get timeSelector(){return this._timeSelector}get value(){const i=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return i!==null?l.cloneDate(i):null}get show(){return this.showDuringOnChange!==void 0?this.showDuringOnChange:this.props.show!==void 0?this.props.show:this.state.show}get name(){return this.props.name}get validity(){const i=this.value&&this.normalizeTime(this.value),t=this.normalizeTime(this.min),e=this.normalizeTime(this.max),s=$s(i,t,e),a=this.props.validationMessage!==void 0,r=(!this.required||this.value!==null)&&s,h=this.props.valid!==void 0?this.props.valid:r;return{customError:a,rangeOverflow:js(i,e),rangeUnderflow:Ks(i,t),valid:h,valueMissing:this.value===null}}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=ae&&this.props.adaptive)}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:Z.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:Z.defaultProps.required}get popupSettings(){return this.props.popupSettings||Z.defaultProps.popupSettings}get min(){return this.props.min!==void 0?this.props.min:Z.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:Z.defaultProps.max}get dateInputComp(){return this.props.dateInput||Z.defaultProps.dateInput}get localizationService(){return I.provideLocalizationService(this)}componentDidMount(){var i;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){this._timeSelector&&this.show&&!this.prevShow?this._timeSelector.focusActiveList():this.dateInput&&this.dateInput.element&&!this.show&&this.shouldFocusDateInput&&this.dateInput.element.focus({preventScroll:!0}),this.prevShow=this.show,this.shouldFocusDateInput=!1}componentWillUnmount(){var i;(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:i=Z.defaultProps.size,rounded:t=Z.defaultProps.rounded,fillMode:e=Z.defaultProps.fillMode,disabled:s,tabIndex:a,title:r,id:h,className:u,format:c,formatPlaceholder:p,width:m,name:f,steps:v,validationMessage:w,required:T,validityStyles:E,ariaLabelledBy:V,ariaDescribedBy:y}=this.props,P=!this.validityStyles||this.validity.valid,b={disabled:s,format:c,formatPlaceholder:p,id:h,ariaLabelledBy:V,ariaDescribedBy:y,max:this.normalizeTime(this.max),min:this.normalizeTime(this.min),name:f,onChange:this.handleInputValueChange,required:T,steps:v,tabIndex:this.show?-1:a,title:r,valid:this.validity.valid,validationMessage:w,validityStyles:E,value:this.value&&this.normalizeTime(this.value),label:void 0,placeholder:this.state.focused?null:this.props.placeholder,ariaHasPopup:"dialog",ariaExpanded:this.show,size:null,fillMode:null,rounded:null,readonly:this.mobileMode},R=this.localizationService.toLanguageString(Qt,O[Qt]),k=this.localizationService.toLanguageString(we,O[we]),M=o.createElement(d.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.mobileMode?void 0:this.handleBlur,onSyncBlur:this.props.onBlur,onSyncFocus:this.props.onFocus},({onFocus:W,onBlur:C})=>o.createElement(o.Fragment,null,o.createElement("div",{id:this.props.id,ref:N=>{this._element=N},className:d.classNames("k-input","k-timepicker",{[`k-input-${d.kendoThemeMaps.sizeMap[i]||i}`]:i,[`k-rounded-${d.kendoThemeMaps.roundedMap[t]||t}`]:t,[`k-input-${e}`]:e,["k-invalid"]:!P,["k-required"]:this.required,["k-disabled"]:this.props.disabled},u),onKeyDown:this.handleKeyDown,style:{width:m},onFocus:W,onBlur:C,onClick:this.mobileMode?this.handleIconClick:void 0},o.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",ariaControls:this._popupId,...b}),o.createElement(F.Button,{tabIndex:-1,type:"button",icon:"clock",svgIcon:X.clockIcon,onMouseDown:this.handleIconMouseDown,onClick:this.mobileMode?void 0:this.handleIconClick,title:k,className:"k-input-button",rounded:null,"aria-label":R}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup()));return this.props.label?o.createElement(Pe,{dateInput:this._dateInput,label:this.props.label,editorId:h,editorValid:P,editorDisabled:this.props.disabled,children:M,style:{width:this.props.width}}):M}normalizeTime(i){return B(H,i)}setShow(i){const{onOpen:t,onClose:e}=this.props;this.show!==i&&(this.setState({show:i}),i&&t&&t.call(void 0,{target:this}),!i&&e&&e.call(void 0,{target:this}))}mergeTime(i){return this.value&&i?B(this.value,i):i}calculateMedia(i){for(let t of i)this.setState({windowWidth:t.target.clientWidth})}};let Ct=Z;Ct.displayName="TimePicker",Ct.propTypes={className:n.string,cancelButton:n.bool,nowButton:n.bool,defaultShow:n.bool,defaultValue:n.instanceOf(Date),disabled:n.bool,format:n.oneOfType([n.string,n.shape({skeleton:n.string,pattern:n.string,date:n.oneOf(["short","medium","long","full"]),time:n.oneOf(["short","medium","long","full"]),datetime:n.oneOf(["short","medium","long","full"]),era:n.oneOf(["narrow","short","long"]),year:n.oneOf(["numeric","2-digit"]),month:n.oneOf(["numeric","2-digit","narrow","short","long"]),day:n.oneOf(["numeric","2-digit"]),weekday:n.oneOf(["narrow","short","long"]),hour:n.oneOf(["numeric","2-digit"]),hour12:n.bool,minute:n.oneOf(["numeric","2-digit"]),second:n.oneOf(["numeric","2-digit"]),timeZoneName:n.oneOf(["short","long"])})]),formatPlaceholder:n.oneOfType([n.oneOf(["wide","narrow","short","formatPattern"]),n.shape({year:n.string,month:n.string,day:n.string,hour:n.string,minute:n.string,second:n.string})]),id:n.string,ariaLabelledBy:n.string,ariaDescribedBy:n.string,min:n.instanceOf(Date),max:n.instanceOf(Date),name:n.string,popupSettings:n.shape({animate:n.bool,appendTo:n.any,popupClass:n.string}),show:n.bool,steps:n.shape({hour:n.number,minute:n.number,second:n.number}),smoothScroll:n.bool,tabIndex:n.number,title:n.string,value:n.instanceOf(Date),width:n.oneOfType([n.number,n.string]),validationMessage:n.string,required:n.bool,validate:n.bool,valid:n.bool,size:n.oneOf([null,"small","medium","large"]),rounded:n.oneOf([null,"small","medium","large","full"]),fillMode:n.oneOf([null,"solid","flat","outline"])},Ct.defaultProps={defaultShow:!1,defaultValue:null,disabled:!1,format:"t",max:nt,min:ct,popupSettings:{},tabIndex:0,steps:{},required:!1,validityStyles:!0,dateInput:lt,size:"medium",rounded:"medium",fillMode:"solid"};const Li=d.createPropsContext(),Hi=d.withIdHOC(d.withPropsContext(Li,Ct));Hi.displayName="KendoReactTimePicker",I.registerForLocalization(Ct);const Ai=2,ze=class extends o.Component{constructor(i){super(i),this._element=null,this.isActive=!1,this.focusActiveDate=()=>{if(!this._element)return;const t=this._element.querySelector("td.k-focus"),e=this._element.querySelector(".k-state-pending-focus");t&&t[0]&&t[0].classList.remove("k-focus"),e&&e.classList.add("k-focus"),this.isActive=!0},this.blurActiveDate=()=>{if(!this._element)return;const t=this._element.querySelector("td.k-focus");t&&t.classList.remove("k-focus"),this.isActive=!1},this.rotateSelectionRange=t=>{if(t.start===null||t.end===null)return t;const e=t.end<t.start;return{start:e?t.end:t.start,end:e?t.start:t.end}},this.handleDateChange=(t,e=!1)=>{const{onChange:s}=this.props;if(s){const a={syntheticEvent:t.syntheticEvent,nativeEvent:t.nativeEvent,value:l.cloneDate(t.value),target:this,isTodayClick:e};s.call(void 0,a)}}}get element(){return this._element}get weekNumber(){return!!(this.props.showWeekNumbers&&this.props.activeView===x.month)}get min(){return this.props.min!==void 0?this.props.min:ze.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:ze.defaultProps.max}componentDidUpdate(){this.isActive&&this.focusActiveDate()}render(){const i=this.props.allowReverse?this.rotateSelectionRange(this.props.selectionRange):this.props.selectionRange,t=d.classNames("k-calendar-view k-align-items-start k-justify-content-center",{"k-vstack":this.props.verticalView,"k-hstack":!this.props.verticalView,"k-calendar-monthview":this.props.activeView===x.month,"k-calendar-yearview":this.props.activeView===x.year,"k-calendar-decadeview":this.props.activeView===x.decade,"k-calendar-centuryview":this.props.activeView===x.century});return o.createElement("div",{ref:e=>{this._element=e},className:t},this.props.dates.map(e=>o.createElement("table",{className:"k-calendar-table k-content",key:e.getTime(),role:"grid"},o.createElement(Ft,{bus:this.props.bus,service:this.props.service,key:e.getTime(),direction:"horizontal",activeView:this.props.activeView,cellUID:this.props.cellUID,viewDate:e,min:this.min,max:this.max,focusedDate:this.props.focusedDate,selectionRange:i,selectedDate:this.props.value,showWeekNumbers:this.weekNumber,onChange:this.handleDateChange,onCellEnter:this.props.onCellEnter,cell:this.props.cell,weekCell:this.props.weekCell}))))}};let Et=ze;Et.defaultProps={showWeekNumbers:!1,views:Ai,take:Ai,allowReverse:!0,min:it,max:st};const Be=(i=J.defaultProps.min,t=J.defaultProps.max,e)=>e instanceof Date&&!Array.isArray(e)&&_(l.getDate(e),i,t)?l.getDate(e):null,zi=(i=J.defaultProps.min,t=J.defaultProps.max,e)=>Array.isArray(e)?e.filter(s=>_(s,i,t)).map(s=>l.getDate(s)):null,Bi=i=>typeof i=="object"&&!(i instanceof Date)&&i!==null&&!Array.isArray(i)?i:A,qi=(i,t,e)=>i||t&&t[0]||e&&e.start,gn=(i,t)=>i.start===null&&t===null?"start":i.end===null?"end":"start",Ot=class extends o.Component{constructor(i){super(i),this.dates=[],this.selectedDate=null,this.selectedMultiple=null,this.selectedRange=A,this._focusedDate=new Date,this.cellUID=this.props.id+"-cell-uid",this.activeRangeEnd="start",this._element=null,this.intl=null,this.localization=null,this.service=null,this.calendarViewList=null,this.isActive=!1,this.calculateFocusFromValue=!0,this.focus=()=>{this._element&&this._element.focus()},this.clampRange=c=>({start:c,end:null}),this.rangeWithFocused=(c,p)=>({start:c.start,end:c.end===null&&c.start!==null&&this.isActive?p:c.end}),this.generateRange=(c,p)=>{let{end:m,start:f}=p;const v=p.start!==null&&c.getTime()<=p.start.getTime();return!this.props.allowReverse&&v?{start:c,end:this.selectedRange.start}:this.activeRange!=="end"?{start:c,end:m}:{start:f||this.selectedDate,end:c}},this.canNavigate=c=>{if(!this.service)return!1;const p=this.service.move(this.focusedDate,c);return this.min<=p&&p<=this.max||this.service.isInSameView(p,this.min)||this.service.isInSameView(p,this.max)},this.navigate=(c,p)=>{this.calculateFocusFromValue=!1;const m=this.move(c,p);this.setState({navigateDate:m,focusedDate:m})},this.move=(c,p)=>this.clampDate(this.service.move(p,c)),this.clampDate=c=>U(c,this.min,this.max),this.shouldAutoCorrect=(c,p)=>{const{end:m,start:f}=p;return this.activeRange!=="end"?m!==null&&c>m:f!==null&&c<f},this.handleCellEnter=c=>{this.props.mode==="range"&&(this.calculateFocusFromValue=!1,this.setState({focusedDate:c}))},this.handleMouseDown=c=>{c.preventDefault()},this.handleClick=c=>{this._element&&this._element.focus({preventScroll:!0})},this.handleFocus=c=>{if(this.isActive=!0,!this.calendarViewList)return;this.calendarViewList.focusActiveDate();const{onFocus:p}=this.props;p&&p.call(void 0,c)},this.handleBlur=c=>{if(this.isActive=!1,!this.calendarViewList)return;this.calendarViewList.blurActiveDate();const{onBlur:p}=this.props;p&&p.call(void 0,c)},this.handleTodayClick=c=>{this.todayIsInRange&&this.handleDateChange(c)},this.handlePrevButtonClick=()=>{const c=S.PrevView;if(this.state.activeView>0&&this.focusedDate.getFullYear()>this.dates[0].getFullYear())this.navigate(c,this.move(c,this.focusedDate));else{const p=this.isInMonth(this.focusedDate,this.dates[1])?this.move(c,this.focusedDate):this.focusedDate;this.navigate(c,p)}},this.handleNextButtonClick=()=>{this.navigate(S.NextView,this.focusedDate)},this.handleKeyDown=c=>{const{keyCode:p}=c;if(p===d.Keys.enter){const m={syntheticEvent:c,nativeEvent:c.nativeEvent,value:this.focusedDate,target:this};this.handleDateChange(m)}else{const m=U(this.navigation.move(this.focusedDate,this.navigation.action(c),this.state.activeView,this.service,c),this.min,this.max);if(l.isEqualDate(this.focusedDate,m))return;this.dates&&this.service&&!this.service.isInArray(m,this.dates)&&this.setState({navigateDate:m}),this.calculateFocusFromValue=!1,this.setState({focusedDate:m})}c.preventDefault()},this.handleViewChange=({view:c})=>{this.calculateFocusFromValue=!1,this.setState(p=>({activeView:c,navigateDate:p.focusedDate}))},this.handleDateChange=c=>{const p=l.cloneDate(c.value),m=this.bus.canMoveDown(this.state.activeView);if(this.props.disabled)return;if(m)if(c.isTodayClick)this.bus.moveToBottom(this.state.activeView);else{this.bus.moveDown(this.state.activeView,c.syntheticEvent),this.setState({focusedDate:p});return}this.calculateFocusFromValue=!0;let f;switch(this.props.mode){case"single":f=l.cloneDate(c.value);break;case"multiple":if(Array.isArray(this.selectedMultiple)){let w=this.selectedMultiple.slice(),T=-1;w.forEach((E,V)=>{l.isEqualDate(E,c.value)&&(T=V)}),T!==-1?w.splice(T,1):w.push(l.cloneDate(c.value)),f=w.slice()}else this.selectedDate?f=[l.cloneDate(this.selectedDate),l.cloneDate(c.value)]:f=[l.cloneDate(c.value)];break;case"range":{f=this.selectedRange.start!==null&&this.selectedRange.end!==null&&this.activeRange==="start"?this.clampRange(c.value):this.generateRange(c.value,this.selectedRange),this.activeRangeEnd=this.activeRange!=="end"?"end":"start";break}default:f=l.cloneDate(c.value);break}this.valueDuringOnChange=f,c.isTodayClick&&this.setState({navigateDate:p}),this.setState({value:f,focusedDate:p}),this.valueDuringOnChange=f;const{onChange:v}=this.props;if(v){const w={syntheticEvent:c.syntheticEvent,nativeEvent:c.nativeEvent,value:f,target:this};v.call(void 0,w)}this.valueDuringOnChange=void 0};const t=i.value!==void 0?i.value:i.defaultValue||Ot.defaultProps.defaultValue,e=Be(this.min,this.max,t),s=zi(this.min,this.max,t),a=Bi(t),r=qi(e,s,a),h=Ut(x[i.defaultActiveView],this.bottomView,this.topView),u=U(i.focusedDate||r||z(),this.min,this.max);this.state={value:t,activeView:h,focusedDate:u,navigateDate:u},this.activeRangeEnd=gn(a,e),this.bus=new de(this.handleViewChange),this.navigation=new pe(this.bus),this.calculateFocusFromValue=!1,this.lastView=h,this.lastViewsCount=this.props.views||Et.defaultProps.views}get wrapperID(){return this.props.id+"-wrapper-id"}get isRtl(){return this.props.dir==="rtl"}get element(){return this._element}get value(){return this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value}get focusedDate(){return l.cloneDate(this._focusedDate)}get min(){return l.getDate(this.props.min!==void 0?this.props.min:Ot.defaultProps.min)}get max(){return l.getDate(this.props.max!==void 0?this.props.max:Ot.defaultProps.max)}get bottomView(){return x[this.props.bottomView!==void 0?this.props.bottomView:Ot.defaultProps.bottomView]}get topView(){return x[this.props.topView!==void 0?this.props.topView:Ot.defaultProps.topView]}get activeRange(){return this.props.activeRangeEnd!==void 0?this.props.activeRangeEnd:this.activeRangeEnd}get todayIsInRange(){return _(z(),l.getDate(this.min),l.getDate(this.max))}componentDidMount(){this.calculateFocusFromValue=!0}componentDidUpdate(){this.calendarViewList&&(this.isActive?this.calendarViewList.focusActiveDate:this.calendarViewList.blurActiveDate)();const i=Be(this.min,this.max,this.value);this.calculateFocusFromValue=!!(this.selectedDate&&i&&this.selectedDate.getTime()&&i.getTime()),this.lastView=this.state.activeView,this.lastViewsCount=this.props.views||Et.defaultProps.views}render(){this.props._ref&&this.props._ref(this),this.intl=I.provideIntlService(this),this.localization=I.provideLocalizationService(this),this.bus.configure(this.bottomView,this.topView);const i=Ut(this.state.activeView,this.bottomView,this.topView);this.service=this.bus.service(i,this.intl),this.selectedDate=Be(this.min,this.max,this.value),this.selectedMultiple=zi(this.min,this.max,this.value),this.selectedRange=Bi(this.value);const t=qi(this.selectedDate,this.selectedMultiple,this.selectedRange);this._focusedDate=U(this.calculateFocusFromValue&&t!==null?t:this.state.focusedDate,this.min,this.max);const e=d.classNames("k-widget k-calendar k-calendar-range",{"k-disabled":this.props.disabled},this.props.className),s=this.rangeWithFocused(this.selectedRange,this.focusedDate),a=this.localization.toLanguageString(me,O[me]),r=this.localization.toLanguageString(ge,O[ge]),h=!this.canNavigate(S.PrevView),u=!this.canNavigate(S.NextView),c={"aria-disabled":h},p={"aria-disabled":u},m=this.lastView!==i,f=this.dates&&this.isInMonth(this.state.navigateDate,this.dates[0]),v=this.lastViewsCount!==this.props.views;(!f||m||v)&&(this.dates=this.service.datesList(this.state.navigateDate,this.props.views||Et.defaultProps.views));const w=l.cloneDate(this.dates&&this.dates[0]?this.dates[0]:z());return o.createElement("div",{ref:T=>{this._element=T},className:e,id:this.props.id||this.wrapperID,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,tabIndex:this.props.disabled?void 0:this.props.tabIndex,onFocus:this.handleFocus,onBlur:this.handleBlur,onMouseDown:this.handleMouseDown,onClick:this.handleClick,onKeyDown:this.handleKeyDown,"aria-disabled":this.props.disabled,dir:this.props.dir},o.createElement(vt,{key:`.kendo.calendar.header.${w.getTime()}`,activeView:i,currentDate:w,min:this.min,max:this.max,rangeLength:this.props.views,bus:this.bus,service:this.service,headerTitle:this.props.headerTitle,verticalView:this.props.mobileMode,commands:o.createElement(o.Fragment,null,o.createElement(F.Button,{type:"button",className:"k-calendar-nav-prev",icon:this.isRtl?"chevron-right":"chevron-left",svgIcon:this.isRtl?X.chevronRightIcon:X.chevronLeftIcon,fillMode:"flat",title:a,disabled:h,onClick:this.handlePrevButtonClick,...c}),o.createElement(Dt,{min:this.min,max:this.max,onClick:this.handleTodayClick,disabled:!this.todayIsInRange}),o.createElement(F.Button,{type:"button",className:"k-calendar-nav-next",icon:this.isRtl?"chevron-left":"chevron-right",svgIcon:this.isRtl?X.chevronLeftIcon:X.chevronRightIcon,fillMode:"flat",title:r,disabled:u,onClick:this.handleNextButtonClick,...p}))}),o.createElement(Et,{ref:T=>{this.calendarViewList=T},dates:this.dates,activeView:i,focusedDate:this.focusedDate,min:this.min,max:this.max,bus:this.bus,service:this.service,selectionRange:s,value:this.selectedMultiple||this.selectedDate,cellUID:this.cellUID,views:this.props.views,onChange:this.handleDateChange,showWeekNumbers:this.props.weekNumber,onCellEnter:this.handleCellEnter,cell:this.props.cell,weekCell:this.props.weekCell,headerTitle:this.props.headerTitle,verticalView:this.props.mobileMode}))}isInMonth(i,t){return!!t&&l.firstDayOfMonth(t)<=i&&i<=l.lastDayOfMonth(t)}};let J=Ot;J.displayName="MultiViewCalendar",J.propTypes={activeRangeEnd:n.oneOf(["start","end"]),allowReverse:n.bool,bottomView:n.oneOf(["month","year","decade","century"]),className:n.string,defaultActiveView:n.oneOf(["month","year","decade","century"]),defaultValue:n.oneOfType([et(n.instanceOf(Date)),n.arrayOf(n.instanceOf(Date)),n.shape({start:et(n.instanceOf(Date)),end:et(n.instanceOf(Date))})]),disabled:n.bool,focusedDate:n.instanceOf(Date),id:n.string,ariaLabelledBy:n.string,ariaDescribedBy:n.string,max:n.instanceOf(Date),min:n.instanceOf(Date),mode:n.oneOf(["single","multiple","range"]),onBlur:n.func,onChange:n.func,onFocus:n.func,tabIndex:n.number,topView:n.oneOf(["month","year","decade","century"]),value:n.oneOfType([et(n.instanceOf(Date)),n.arrayOf(n.instanceOf(Date)),n.shape({start:et(n.instanceOf(Date).isRequired),end:et(n.instanceOf(Date).isRequired)})]),views:(i,t,e)=>{const s=i[t];return s!==void 0&&s<1?new Error(`Invalid prop '${t}' supplied to'${e}'. The '${t}' property cannot be less than 1'`):null},weekNumber:n.bool,dir:n.string},J.defaultProps={disabled:!1,min:it,max:st,navigation:!0,defaultActiveView:"month",defaultValue:null,topView:"century",tabIndex:0,bottomView:"month",views:2,allowReverse:!1};const Ri=d.createPropsContext(),qe=d.withIdHOC(d.withPropsContext(Ri,J));qe.displayName="KendoReactMultiViewCalendar",I.registerForIntl(J),I.registerForLocalization(J);const Bt=class extends o.Component{constructor(i){super(i),this._element=null,this._calendar=null,this._startDateInput=o.createRef(),this._endDateInput=o.createRef(),this.shouldFocusDateInput=!1,this.shouldFocusCalendar=!1,this.focus=()=>{this.startDateInput&&this.startDateInput.focus()},this.setCalendarRef=t=>{this._calendar=t},this.focusCalendarElement=()=>{this._calendar&&this._calendar.element&&this._calendar.element.focus({preventScroll:!0})},this.calculateValue=(t,e)=>(t.value!==void 0?t.value:e.value)||A,this.calculateShow=(t,e)=>t.show!==void 0?t.show:e.show,this.renderCalendar=()=>{const t=this.value||A,e={min:this.min,max:this.max,allowReverse:this.props.allowReverse,mode:"range",focusedDate:this.props.focusedDate,disabled:this.props.disabled,className:this.mobileMode?"k-calendar-lg":"",mobileMode:this.mobileMode,...this.props.calendarSettings,value:t,dir:this.props.dir,onChange:this.handleCalendarChange};return this.props.calendar?o.createElement(this.props.calendar,{...e}):o.createElement(qe,{...e,ref:this.setCalendarRef})},this.renderPopup=()=>{const t={popupClass:"k-daterangepicker-popup",animate:this._element!==null,anchor:this._element,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...this.props.popupSettings,show:this.show};return this.props.popup?o.createElement(this.props.popup,{...t},this.renderCalendar()):o.createElement(qt.Popup,{...t},this.renderCalendar())},this.renderAdaptivePopup=()=>{const{windowWidth:t=0}=this.state,e={expand:this.show,onClose:s=>this.handleCancel(s),adaptiveTitle:this.props.adaptiveTitle,windowWidth:t,footer:{cancelText:this.localizationService.toLanguageString(Se,O[Se]),onCancel:this.handleCancel,applyText:this.localizationService.toLanguageString(De,O[De]),onApply:this.handleBlur}};return o.createElement(ne,{...e},o.createElement(ht.ActionSheetContent,{className:"!k-overflow-hidden"},o.createElement("div",{className:"k-scrollable-wrap"},this.renderCalendar())))},this.handleReverseClick=t=>{const e={start:this.value.end,end:this.value.start},s={syntheticEvent:t,nativeEvent:t.nativeEvent};this.handleChange(e,s)},this.handleReverseMouseDown=t=>{t.preventDefault()},this.handleFocus=t=>{clearTimeout(this.nextTickId),this.shouldFocusDateInput||(this.setShow(!0),this.mobileMode&&this.setState({currentValue:this.value}));const{onFocus:e}=this.props;e&&e.call(void 0,t)},this.handleBlur=t=>{this.nextTick(()=>{this.setShow(!1)});const{onBlur:e}=this.props;e&&e.call(void 0,t)},this.handleCancel=t=>{this.nextTick(()=>{this.setShow(!1),this.setState({currentValue:A})});const{onCancel:e}=this.props;e&&e.call(void 0,t)},this.handleEndChange=t=>{const e={start:this.value.start,end:l.cloneDate(t.value||void 0)};this.handleChange(e,t)},this.handleStartChange=t=>{const e={start:l.cloneDate(t.value||void 0),end:this.value.end};this.handleChange(e,t)},this.extractRangeFromValue=t=>{if(!Array.isArray(t.value)&&!(t.value instanceof Date))return t.value||A;const e=Array.isArray(t.value)?t.value[0]:t.value;return{start:this.value.end!==null?e:this.value.start,end:this.value.start!==null?e:this.value.end}},this.handleCalendarChange=t=>{const e=this.extractRangeFromValue(t);this.handleChange(e,t)},this.handleKeyDown=t=>{const{keyCode:e,altKey:s}=t,a=d.getActiveElement(document);e===d.Keys.esc?(t.preventDefault(),this.shouldFocusDateInput=!0,this.setShow(!1)):s&&e===d.Keys.down?(t.preventDefault(),this.shouldFocusCalendar=!0,this.setShow(!0)):e===d.Keys.tab&&this.show&&this._calendar&&this._calendar.element&&this.endDateInput&&this.endDateInput.element&&document&&a===this.endDateInput.element&&(t.preventDefault(),this.focusCalendarElement())},this.handleChange=(t,e)=>{this.setState({value:t}),this.valueDuringOnChange=t;const{onChange:s}=this.props;if(s){const a={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:this.value,show:this.show,target:this};s.call(void 0,a)}this.valueDuringOnChange=void 0},d.validatePackage(gt),this.state={show:this.props.show||this.props.defaultShow||Bt.defaultProps.defaultShow,value:this.props.value||this.props.defaultValue||Bt.defaultProps.defaultValue,currentValue:A},this.nextTick=this.nextTick.bind(this),this.setShow=this.setShow.bind(this),this.focusCalendarElement=this.focusCalendarElement.bind(this),this.focusDateInputElement=this.focusDateInputElement.bind(this)}get _popupId(){return this.props.id+"-popup-id"}get _startInputId(){return this.props.id+"-start-input-id"}get _endInputId(){return this.props.id+"-end-input-id"}get element(){return this._element}get startDateInput(){return this._startDateInput.current}get endDateInput(){return this._endDateInput.current}get calendar(){return this._calendar}get value(){return(this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value)||A}get show(){return this.showDuringOnChange!==void 0?this.showDuringOnChange:this.props.show!==void 0?this.props.show:this.state.show}get min(){return this.props.min!==void 0?this.props.min:Bt.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:Bt.defaultProps.max}get document(){if(d.canUseDOM)return this.element&&this.element.ownerDocument||document}get localizationService(){return I.provideLocalizationService(this)}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=ae&&this.props.adaptive)}componentDidMount(){var i;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){this.shouldFocusCalendar&&this.focusCalendarElement(),this.shouldFocusDateInput&&this.focusDateInputElement(),this.shouldFocusCalendar=!1,this.shouldFocusDateInput=!1}componentWillUnmount(){var i;clearTimeout(this.nextTickId),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.disconnect()}render(){const i=this.value||A,t=this.mobileMode&&this.show?this.state.currentValue:i,e=(this.props.startDateInputSettings||{}).id||this._startInputId,s=(this.props.endDateInputSettings||{}).id||this._endInputId,a=d.classNames("k-daterangepicker",{"k-disabled":this.props.disabled},this.props.className),r=this.localizationService.toLanguageString(Zt,O[Zt]),h=this.localizationService.toLanguageString(Gt,O[Gt]),u=this.localizationService.toLanguageString(Xt,O[Xt]),c={disableSelection:this.mobileMode&&!0,label:r,format:this.props.format,min:this.min,max:this.max,id:this._startInputId,disabled:this.props.disabled,valid:this.props.valid,tabIndex:this.props.tabIndex,ariaExpanded:this.show,...this.props.startDateInputSettings,value:t.start,onChange:this.handleStartChange},p={disableSelection:this.mobileMode&&!0,label:h,format:this.props.format,min:this.min,max:this.max,id:this._endInputId,disabled:this.props.disabled,valid:this.props.valid,tabIndex:this.props.tabIndex,ariaExpanded:this.show,...this.props.endDateInputSettings,value:t.end,onChange:this.handleEndChange},m=o.createElement(F.Button,{type:"button",className:"k-select",fillMode:"flat",title:I.provideLocalizationService(this).toLanguageString(yt,O[yt]),onMouseDown:this.handleReverseMouseDown,onClick:this.handleReverseClick,"aria-controls":e+" "+s,"aria-label":I.provideLocalizationService(this).toLanguageString(yt,O[yt])},o.createElement(d.IconWrap,{style:{transform:"rotate(90deg)"},name:"arrows-swap",icon:X.arrowsSwapIcon}));return o.createElement(o.Fragment,null,o.createElement("span",{ref:f=>{this._element=f},className:a,style:this.props.style,id:this.props.id,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,tabIndex:this.props.tabIndex,onFocus:this.handleFocus,onBlur:this.mobileMode?void 0:this.handleBlur,onKeyDown:this.handleKeyDown,dir:this.props.dir},this.props.startDateInput?o.createElement(this.props.startDateInput,{...c}):o.createElement(lt,{...c,ref:this._startDateInput,ariaRole:"combobox",ariaControls:this._popupId,readonly:this.mobileMode}),(this.props.allowReverse||this.props.calendarSettings&&this.props.calendarSettings.allowReverse)&&this.props.swapButton?m:u,this.props.endDateInput?o.createElement(this.props.endDateInput,{...p}):o.createElement(lt,{...p,ref:this._endDateInput,ariaRole:"combobox",ariaControls:this._popupId,readonly:this.mobileMode}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup())}focusDateInputElement(){if(!document||!this.startDateInput||!this.startDateInput.element||!this.endDateInput||!this.endDateInput.element)return;const i=d.getActiveElement(document);(this.value.start===null||this.value.end!==null)&&i!==this.endDateInput.element?this.startDateInput.element.focus({preventScroll:!0}):i!==this.startDateInput.element&&this.endDateInput.element.focus({preventScroll:!0})}nextTick(i){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>i())}setShow(i){const{onOpen:t,onClose:e}=this.props;this.show!==i&&(this.setState({show:i}),i&&t&&t.call(void 0,{target:this}),!i&&e&&e.call(void 0,{target:this}))}calculateMedia(i){for(let t of i)this.setState({windowWidth:t.target.clientWidth})}};let Vt=Bt;Vt.displayName="DateRangePicker",Vt.propTypes={allowReverse:n.bool,calendarSettings:n.any,className:n.string,defaultShow:n.bool,defaultValue:n.shape({start:et(n.instanceOf(Date).isRequired),end:et(n.instanceOf(Date).isRequired)}),disabled:n.bool,endDateInputSettings:n.shape(ot.propTypes),focusedDate:n.instanceOf(Date),format:n.oneOfType([n.string,n.shape({skeleton:n.string,pattern:n.string,date:n.oneOf(["short","medium","long","full"]),time:n.oneOf(["short","medium","long","full"]),datetime:n.oneOf(["short","medium","long","full"]),era:n.oneOf(["narrow","short","long"]),year:n.oneOf(["numeric","2-digit"]),month:n.oneOf(["numeric","2-digit","narrow","short","long"]),day:n.oneOf(["numeric","2-digit"]),weekday:n.oneOf(["narrow","short","long"]),hour:n.oneOf(["numeric","2-digit"]),hour12:n.bool,minute:n.oneOf(["numeric","2-digit"]),second:n.oneOf(["numeric","2-digit"]),timeZoneName:n.oneOf(["short","long"])})]),id:n.string,ariaLabelledBy:n.string,ariaDescribedBy:n.string,max:n.instanceOf(Date),min:n.instanceOf(Date),onBlur:n.func,onChange:n.func,onFocus:n.func,popupSettings:n.any,show:n.bool,startDateInputSettings:n.any,style:n.any,swapButton:n.any,tabIndex:n.number,dir:n.string,value:n.shape({start:et(n.instanceOf(Date).isRequired),end:et(n.instanceOf(Date).isRequired)})},Vt.defaultProps={allowReverse:!1,defaultShow:!1,defaultValue:A,disabled:!1,format:"d",max:st,min:it,swapButton:!1};const Wi=d.createPropsContext(),Ui=d.withIdHOC(d.withPropsContext(Wi,Vt));Ui.displayName="KendoReactDateRangePicker",I.registerForLocalization(Vt);class Re extends o.Component{constructor(t){super(t),this._calendar=null,this._timePart=null,this._cancelButton=null,this._acceptButton=null,this._calendarWrap=null,this.shouldFocusPart=!1,this.focus=e=>{Promise.resolve().then(()=>{this.state.tab==="time"&&this._timePart&&this._timePart.focus(e);const s=this.calendarElement();this.state.tab==="date"&&s&&s.focus(e)})},this.calendarElement=()=>this._calendar&&this._calendar.element||this._calendarWrap&&this._calendarWrap.querySelector(".k-widget.k-calendar"),this.move=e=>{if(e==="right"&&this.state.tab==="time"||e==="left"&&this.state.tab==="date")return;const s=e==="left"?"date":"time";this.shouldFocusPart=!0,this.setState({tab:s})},this.dateTimeFooter=()=>{const{cancelButton:e}=this.props,s=this.localizationService.toLanguageString(Lt,O[Lt]),a=this.localizationService.toLanguageString(Ht,O[Ht]);return o.createElement("div",{className:"k-datetime-footer k-actions k-actions-stretched "},e&&o.createElement(F.Button,{type:"button",ref:r=>{this._cancelButton=r},className:"k-time-cancel",onClick:this.handleReject,title:s,"aria-label":s},s),o.createElement(F.Button,{type:"button",themeColor:"primary",ref:r=>{this._acceptButton=r},className:"k-time-accept",disabled:!this.hasDateValue,onClick:this.handleAccept,title:a,"aria-label":a},a))},this.handleReject=e=>{this.setState({dateValue:this.props.value,timeValue:this.props.value||H});const s=this.mergeDate(this.props.value,this.props.value||H);if(this.props.onReject){const a={nativeEvent:e.nativeEvent,syntheticEvent:e,target:this,value:s};this.props.onReject.call(void 0,a)}},this.handleAccept=(e,s)=>{if(!this.state.dateValue||!this.state.timeValue||!this.hasDateValue)return;const a=this.mergeDate(this.state.dateValue,s||this.state.timeValue);this.props.onChange.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:a,target:this})},this.handleNowClick=e=>{this.setState({timeValue:ut()}),this.handleAccept(e,ut())},this.handleCalendarValueChange=e=>{e.syntheticEvent.stopPropagation(),this.setState({dateValue:e.value,tab:"time"}),this.shouldFocusPart=!0},this.handleTimeListContainerChange=e=>{this.setState({timeValue:e})},this.handleDateClick=e=>{e.stopPropagation(),this.move("left")},this.handleTimeClick=e=>{e.stopPropagation(),this.move("right")},this.handleKeyDown=e=>{const{keyCode:s,altKey:a}=e;switch(s){case d.Keys.enter:!this.hasActiveButton()&&this.hasDateValue&&this.handleAccept(e);return;case d.Keys.left:if(!a)return;this.move("left");return;case d.Keys.right:if(!a)return;this.move("right");return;default:return}},this.handleTimePartMount=e=>{this.setState({timeValue:e})},this.state={tab:"date",dateValue:this.props.value,timeValue:this.props.value||H}}get calendar(){return this._calendar}get timePart(){return this._timePart}get hasDateValue(){return this.state.dateValue!==null}get localizationService(){return I.provideLocalizationService(this)}componentDidUpdate(){this.shouldFocusPart&&this.focus({preventScroll:!0}),this.shouldFocusPart=!1}render(){const{disabled:t,min:e,max:s,weekNumber:a,focusedDate:r,format:h,mobileMode:u,footerActions:c}=this.props,p=d.classNames({"k-date-tab":this.state.tab==="date","k-time-tab":this.state.tab==="time","k-disabled":t},"k-datetime-wrap"),m=this.localizationService.toLanguageString(be,O[be]),f=this.localizationService.toLanguageString(ye,O[ye]),v={min:e,max:s,weekNumber:a,focusedDate:r,disabled:t||this.state.tab!=="date",value:this.state.dateValue,onChange:this.handleCalendarValueChange,navigation:!1,mobileMode:u};return o.createElement("div",{onKeyDown:this.handleKeyDown,className:p,tabIndex:-1},o.createElement("div",{className:"k-datetime-buttongroup"},o.createElement(F.ButtonGroup,{width:"100%"},o.createElement(F.Button,{type:"button",selected:this.state.tab==="date",togglable:!0,onClick:this.handleDateClick},m),o.createElement(F.Button,{type:"button",selected:this.state.tab==="time",togglable:!0,onClick:this.handleTimeClick},f))),o.createElement("div",{className:"k-datetime-selector"},o.createElement("div",{className:"k-datetime-calendar-wrap",ref:w=>this._calendarWrap=w},this.props.calendar?o.createElement(this.props.calendar,{...v}):o.createElement(te,{ref:w=>{this._calendar=w},...v})),o.createElement("div",{className:"k-datetime-time-wrap"},o.createElement("div",{className:u?"k-reset k-timeselector-lg k-timeselector":""},o.createElement(pt,{key:1,onNowClick:this.handleNowClick,disabled:t||this.state.tab!=="time",ref:w=>{this._timePart=w},min:this.minTime||ct,max:this.maxTime||nt,steps:this.props.steps,value:this.state.timeValue,format:h,onChange:this.handleTimeListContainerChange,onMount:this.handleTimePartMount,mobileMode:u})))),c&&this.dateTimeFooter())}get minTime(){return this.props.minTime!==void 0?this.props.minTime:this.normalizeRange(this.props.min,this.state.dateValue)}get maxTime(){return this.props.maxTime!==void 0?this.props.maxTime:this.normalizeRange(this.props.max,this.state.dateValue)}normalizeRange(t,e){return l.isEqualDate(t,e||z())?t:null}hasActiveButton(){if(!this._acceptButton)return!1;const t=d.getActiveElement(document);return this._acceptButton&&t===this._acceptButton.element||this._cancelButton&&t===this._cancelButton.element}mergeTime(t,e){return t&&e?B(e,t):e}mergeDate(t,e){return t?B(t||z(),e):e}}Re.defaultProps={footerActions:!0},I.registerForLocalization(Re);const Q=class extends o.Component{constructor(i){super(i),this._element=null,this._dateInput=o.createRef(),this._dateTimeSelector=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.focus=()=>{const t=this.dateInputElement();t&&t.focus()},this.renderPicker=()=>{const{disabled:t,minTime:e,maxTime:s,format:a,calendar:r,cancelButton:h,weekNumber:u,focusedDate:c}=this.props;return o.createElement(Re,{ref:p=>{this._dateTimeSelector=p},cancelButton:h,steps:this.props.steps,value:this.value,onChange:this.handleValueChange,onReject:this.handleReject,disabled:t,weekNumber:u,min:this.min,max:this.max,minTime:e,maxTime:s,focusedDate:c,format:a,calendar:r,mobileMode:this.mobileMode,footerActions:!this.mobileMode})},this.renderAdaptivePopup=()=>{const{windowWidth:t=0}=this.state,e=I.provideLocalizationService(this).toLanguageString(Lt,O[Lt]),s=I.provideLocalizationService(this).toLanguageString(Ht,O[Ht]),a={expand:this.show,onClose:this.handleBlur,adaptiveTitle:this.props.adaptiveTitle,windowWidth:t,footer:{cancelText:e,onCancel:r=>{var h;return(h=this._dateTimeSelector)==null?void 0:h.handleReject(r)},applyText:s,onApply:r=>{var h;return(h=this._dateTimeSelector)==null?void 0:h.handleAccept(r)}}};return o.createElement(ne,{...a},o.createElement(ht.ActionSheetContent,{className:"!k-overflow-hidden"},this.renderPicker()))},this.handleReject=()=>{this.shouldFocusDateInput=!0,this.setShow(!1)},this.handleValueChange=t=>{this.setState({value:l.cloneDate(t.value||void 0)}),this.valueDuringOnChange=t.value,this.showDuringOnChange=!1,this.mobileMode||(this.shouldFocusDateInput=!0);const{onChange:e}=this.props;e&&e.call(void 0,{syntheticEvent:t.syntheticEvent,nativeEvent:t.nativeEvent,value:this.value,show:this.show,target:this}),this.valueDuringOnChange=void 0,this.showDuringOnChange=void 0,this.setShow(!1)},this.handleFocus=()=>{this.setState({focused:!0})},this.handleBlur=()=>{this.setState({focused:!1}),this.setShow(!1)},this.handleDateIconClick=()=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=t=>{t.preventDefault()},this.handleKeyDown=t=>{const{altKey:e,keyCode:s}=t;if(s===d.Keys.esc){this.shouldFocusDateInput=!0,this.setShow(!1);return}e&&(s===d.Keys.up||s===d.Keys.down)&&(t.preventDefault(),t.stopPropagation(),this.shouldFocusDateInput=s===d.Keys.up,this.setShow(s===d.Keys.down))},this.dateInputElement=()=>this.dateInput&&this.dateInput.element||this.element&&this.element.querySelector(".k-dateinput > input.k-input-inner"),d.validatePackage(gt),this.state={value:this.props.defaultValue||Q.defaultProps.defaultValue,show:this.props.defaultShow||Q.defaultProps.defaultShow,focused:!1}}get _popupId(){return this.props.id+"-popup-id"}get document(){if(d.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get dateInput(){return this._dateInput.current}get value(){const i=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return i!==null?l.cloneDate(i):null}get show(){return this.showDuringOnChange!==void 0?this.showDuringOnChange:this.props.show!==void 0?this.props.show:this.state.show}get name(){return this.props.name}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=ae&&this.props.adaptive)}get min(){return this.props.min!==void 0?this.props.min:Q.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:Q.defaultProps.max}get validity(){const i=je(this.value,this.min,this.max)&&Ve(this.value,this.props.minTime||ct,this.props.maxTime||nt),t=this.props.validationMessage!==void 0,e=(!this.required||this.value!==null)&&i,s=this.props.valid!==void 0?this.props.valid:e;return{customError:t,rangeOverflow:this.value&&this.max.getTime()<this.value.getTime()||!1,rangeUnderflow:this.value&&this.value.getTime()<this.min.getTime()||!1,valid:s,valueMissing:this.value===null}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:Q.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:Q.defaultProps.required}get dateInputComp(){return this.props.dateInput||Q.defaultProps.dateInput}componentDidMount(){var i;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){const i=this.dateInputElement();this._dateTimeSelector&&this.show&&!this.prevShow&&this._dateTimeSelector.focus({preventScroll:!0}),i&&!this.show&&this.shouldFocusDateInput&&i.focus({preventScroll:!0}),this.prevShow=this.show,this.shouldFocusDateInput=!1}componentWillUnmount(){var i;clearTimeout(this.nextTickId),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:i=Q.defaultProps.size,rounded:t=Q.defaultProps.rounded,fillMode:e=Q.defaultProps.fillMode,disabled:s,tabIndex:a,title:r,id:h,format:u,formatPlaceholder:c,min:p,max:m,className:f,width:v,name:w,validationMessage:T,required:E,validityStyles:V,minTime:y,maxTime:P,ariaLabelledBy:b,ariaDescribedBy:R,popup:k=qt.Popup}=this.props,M=!this.validityStyles||this.validity.valid,W={id:h,ariaLabelledBy:b,ariaDescribedBy:R,format:u,formatPlaceholder:c,disabled:s,title:r,validityStyles:V,validationMessage:T,required:E,min:p,max:m,minTime:y,maxTime:P,name:w,tabIndex:this.show?-1:a,valid:this.validity.valid,value:this.value,onChange:this.handleValueChange,steps:this.props.steps,label:void 0,placeholder:this.state.focused?null:this.props.placeholder,ariaExpanded:this.show,size:null,fillMode:null,rounded:null},C=o.createElement(d.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.handleBlur,onSyncFocus:this.props.onFocus,onSyncBlur:this.props.onBlur},({onFocus:N,onBlur:tt})=>o.createElement(o.Fragment,null,o.createElement("div",{ref:G=>{this._element=G},className:d.classNames("k-input","k-datetimepicker",{[`k-input-${d.kendoThemeMaps.sizeMap[i]||i}`]:i,[`k-rounded-${d.kendoThemeMaps.roundedMap[t]||t}`]:t,[`k-input-${e}`]:e,["k-invalid"]:!M,["k-required"]:this.required,["k-disabled"]:this.props.disabled},f),onKeyDown:this.handleKeyDown,style:{width:v},onFocus:this.mobileMode?void 0:N,onBlur:tt,onClick:this.mobileMode?this.handleDateIconClick:void 0},o.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",ariaControls:this._popupId,readonly:this.mobileMode,...W}),o.createElement(F.Button,{tabIndex:-1,type:"button",icon:"calendar",svgIcon:X.calendarIcon,onMouseDown:this.handleIconMouseDown,onClick:this.mobileMode?void 0:this.handleDateIconClick,title:I.provideLocalizationService(this).toLanguageString(St,O[St]),className:"k-input-button",rounded:null,"aria-label":I.provideLocalizationService(this).toLanguageString(St,O[St])}),o.createElement(k,{show:this.show,animate:this.element!==null,anchor:this.element,popupClass:"k-datetime-container k-reset",id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"}},!this.mobileMode&&this.renderPicker())),this.mobileMode&&this.renderAdaptivePopup()));return this.props.label?o.createElement(Pe,{dateInput:this._dateInput,label:this.props.label,editorId:h,editorValid:M,editorDisabled:this.props.disabled,children:C,style:{width:this.props.width}}):C}setShow(i){const{onOpen:t,onClose:e}=this.props;this.show!==i&&(this.setState({show:i}),i&&t&&t.call(void 0,{target:this}),!i&&e&&e.call(void 0,{target:this}))}nextTick(i){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>i())}calculateMedia(i){for(let t of i)this.setState({windowWidth:t.target.clientWidth})}};let Pt=Q;Pt.displayName="DateTimePicker",Pt.propTypes={className:n.string,defaultShow:n.bool,defaultValue:n.instanceOf(Date),disabled:n.bool,focusedDate:n.instanceOf(Date),format:n.oneOfType([n.string,n.shape({skeleton:n.string,pattern:n.string,date:n.oneOf(["short","medium","long","full"]),time:n.oneOf(["short","medium","long","full"]),datetime:n.oneOf(["short","medium","long","full"]),era:n.oneOf(["narrow","short","long"]),year:n.oneOf(["numeric","2-digit"]),month:n.oneOf(["numeric","2-digit","narrow","short","long"]),day:n.oneOf(["numeric","2-digit"]),weekday:n.oneOf(["narrow","short","long"]),hour:n.oneOf(["numeric","2-digit"]),hour12:n.bool,minute:n.oneOf(["numeric","2-digit"]),second:n.oneOf(["numeric","2-digit"]),timeZoneName:n.oneOf(["short","long"])})]),formatPlaceholder:n.oneOfType([n.oneOf(["wide","narrow","short","formatPattern"]),n.shape({year:n.string,month:n.string,day:n.string,hour:n.string,minute:n.string,second:n.string})]),id:n.string,ariaLabelledBy:n.string,ariaDescribedBy:n.string,min:n.instanceOf(Date),max:n.instanceOf(Date),name:n.string,popupSettings:n.shape({animate:n.bool,appendTo:n.any,popupClass:n.string}),show:n.bool,tabIndex:n.number,title:n.string,value:n.instanceOf(Date),weekNumber:n.bool,width:n.oneOfType([n.number,n.string]),validationMessage:n.string,required:n.bool,validate:n.bool,valid:n.bool,cancelButton:n.bool,size:n.oneOf([null,"small","medium","large"]),rounded:n.oneOf([null,"small","medium","large","full"]),fillMode:n.oneOf([null,"solid","flat","outline"])},Pt.defaultProps={defaultShow:!1,defaultValue:null,disabled:!1,format:"g",max:st,min:it,popupSettings:{},tabIndex:0,weekNumber:!1,required:!1,validityStyles:!0,cancelButton:!0,dateInput:lt,size:"medium",rounded:"medium",fillMode:"solid"};const Yi=d.createPropsContext(),$i=d.withIdHOC(d.withPropsContext(Yi,Pt));$i.displayName="KendoReactDateTimePicker",I.registerForLocalization(Pt),g.Action=S,g.BusViewService=de,g.Calendar=te,g.CalendarCell=$e,g.CalendarHeaderTitle=ri,g.CalendarNavigationItem=li,g.CalendarPropsContext=ui,g.CalendarViewEnum=x,g.CalendarWeekCell=Ke,g.CalendarWithoutContext=rt,g.CenturyViewService=Xe,g.DOMService=ei,g.DateInput=lt,g.DateInputPropsContext=gi,g.DateInputWithoutContext=ot,g.DatePicker=yi,g.DatePickerPropsContext=bi,g.DatePickerWithoutContext=It,g.DateRangePicker=Ui,g.DateRangePickerPropsContext=Wi,g.DateRangePickerWithoutContext=Vt,g.DateTimePicker=$i,g.DateTimePickerPropsContext=Yi,g.DateTimePickerWithoutContext=Pt,g.DayPeriodService=Si,g.DecadeViewService=Je,g.EMPTY_SELECTIONRANGE=A,g.Header=vt,g.HorizontalViewList=Et,g.HoursService=Ti,g.MAX_DATE=st,g.MAX_TIME=nt,g.MIN_DATE=it,g.MIN_TIME=ct,g.MinutesService=Vi,g.MonthViewService=Qe,g.MultiViewCalendar=qe,g.MultiViewCalendarPropsContext=Ri,g.MultiViewCalendarWithoutContext=J,g.NavigationService=pe,g.PickerWrap=vi,g.ScrollSyncService=ii,g.SecondsService=Mi,g.TimeList=zt,g.TimePart=pt,g.TimePicker=Hi,g.TimePickerPropsContext=Li,g.TimePickerWithoutContext=Ct,g.TimeSelector=Tt,g.TodayCommand=Dt,g.ToggleButton=fi,g.ViewList=At,g.Virtualization=ft,g.WeekNamesService=si,g.YearViewService=ti,g.dateInputsMessages=O,g.decreaseValue=bt,g.end=Gt,g.getNow=ut,g.getToday=z,g.increaseValue=wt,g.separator=Xt,g.start=Zt,g.swapStartEnd=yt,g.today=Kt,g.toggleCalendar=jt,g.toggleDateTimeSelector=St,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});