@progress/kendo-react-dateinputs 7.0.1 → 7.0.2-develop.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -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
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $s=require("react"),Ks=require("prop-types"),d=require("@progress/kendo-react-common"),l=require("@progress/kendo-date-math"),k=require("@progress/kendo-react-intl"),N=require("@progress/kendo-react-buttons"),J=require("@progress/kendo-svg-icons"),ss=require("@progress/kendo-react-labels"),Qe=require("@progress/kendo-react-popup"),ce=require("@progress/kendo-react-layout");function is(s){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const t in s)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(s,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>s[t]})}}return e.default=s,Object.freeze(e)}const r=is($s),n=is(Ks),Se={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"},js=(s,e,t)=>[...s.slice(0,e+1),...s.slice(e+1).map(i=>i+t)];class Zs{constructor(e=0,t,i){this.total=e,this.rowHeight=t,this.detailRowHeight=i,this.offsets=[],this.heights=[];let a=0;for(let o=0;o<e;o++)this.offsets.push(a),a+=t,this.heights.push(t)}height(e){return this.heights[e]}expandDetail(e){this.height(e)===this.rowHeight&&this.updateRowHeight(e,this.detailRowHeight)}collapseDetail(e){this.height(e)>this.rowHeight&&this.updateRowHeight(e,this.detailRowHeight*-1)}index(e){for(let t=0;t<this.offsets.length;t++){if(e===this.offsets[t])return t;if(e<this.offsets[t])return t-1}return this.total-1}offset(e){return this.offsets[e]}totalHeight(){return this.heights.reduce((e,t)=>e+t,0)}updateRowHeight(e,t){this.heights[e]+=t,this.offsets=js(this.offsets,e,t)}}const Ae=s=>Math.max(s,0);class at{constructor(e){this.offset=e}}class ot{constructor(e){this.skip=e}}class Gs{constructor(e,t){this.onScrollAction=e,this.onPageAction=t,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(e,t,i,a,o=0,h=0,u="vertical"){this.rowHeightService=e,this.firstLoaded=t,this.lastLoaded=t+i,this.take=i,this.total=a,this.lastScrollTop=0,this.topOffset=o,this.bottomOffset=h,this.direction=u;const c=this.rowsForHeight(o),p=Ae(t-c);this.onScrollAction(new at(this.rowOffset(p))),this.onPageAction(new ot(p))}onScroll({scrollLeft:e,scrollTop:t,offsetHeight:i,offsetWidth:a}){const o=this.direction==="vertical"?t:e,h=this.direction==="vertical"?i:a;if(this.lastScrollTop===o||!this.rowHeightService)return;const u=this.lastScrollTop>=o;this.lastScrollTop=o;const c=this.rowHeightService.index(Ae(o-this.topOffset)),p=this.rowHeightService.index(Ae(o+h-this.bottomOffset));if(!u&&p>=this.lastLoaded&&this.lastLoaded<this.total&&(this.firstLoaded=c,this.onScrollAction(new at(this.rowOffset(c))),this.lastLoaded=Math.min(this.firstLoaded+this.take,this.total),this.onPageAction(new ot(this.firstLoaded))),u&&c<=this.firstLoaded){const m=Math.floor(this.take*.3);this.firstLoaded=Ae(c-m),this.onScrollAction(new at(this.rowOffset(this.firstLoaded))),this.lastLoaded=Math.min(this.firstLoaded+this.take,this.total),this.onPageAction(new ot(this.firstLoaded))}}rowOffset(e){return this.rowHeightService?this.rowHeightService.offset(e)+this.topOffset:0}rowsForHeight(e){return this.rowHeightService?Math.ceil(e/this.rowHeightService.height(0)):0}}const Xs=(s,e,t)=>Math.min(Math.abs(e-s),t),Js=17,Qs=10,ei={[1]:s=>e=>e+s,[0]:s=>e=>e-s},ti={[1]:s=>e=>Math.min(e,s),[0]:s=>e=>Math.max(e,s)},si={[1]:s=>e=>e<s,[0]:s=>e=>e>s},Be=class extends r.Component{constructor(s){super(s),this.rowHeightService=null,this.scrollContainer=null,this.lastDirection=null,this.lastTotal=0,this.lastTake=0,this.animationInProgress=!1,this.restrictScroll=!1,this.scrollTo=e=>{const t=this.direction==="vertical"?"scrollTop":"scrollLeft";if(!this.scrollContainer)return;const i=this.scrollContainer[t];this.restrictScroll&&t==="scrollTop"&&(!Number.isInteger(i)||!Number.isInteger(e))&&Math.abs(i-e)<Qs||(this.scrollContainer[t]=e)},this.scrollToIndex=e=>{this.animationInProgress=!1,this.rowHeightService&&this.scrollTo(this.rowHeightService.offset(e))},this.animateToIndex=e=>{if(!this.rowHeightService||!window)return;window.cancelAnimationFrame(this.cancelAnimation);const t=this.rowHeightService.offset(e),i=this.getContainerScrollDirection(t);let{start:a,end:o}=this.scrollRange(t,i);if(a===o)return;const h=this.scrollStep(a,o),u=ei[i](h),c=ti[i](o),p=si[i](u(o)),m=g=>{this.animationInProgress=!0;const f=u(g);this.scrollTo(c(f)),p(f)?this.cancelAnimation=window.requestAnimationFrame(()=>{m(f)}):this.animationInProgress=!1};this.cancelAnimation=window.requestAnimationFrame(()=>{m(a)})},this.scrollToBottom=()=>{this.rowHeightService&&this.scrollTo(this.rowHeightService.totalHeight()+this.props.bottomOffset)},this.scrollStep=(e,t)=>{const i=this.props.scrollDuration||Be.defaultProps.scrollDuration;return Math.abs(t-e)/(i/Js)},this.scrollRange=(e,t)=>{const i=this.containerScrollPosition;if(parseInt(`${e}`,10)===parseInt(`${i}`,10))return{start:e,end:e};const a=this.containerMaxScroll(),o=t===0?1:-1,h=Xs(i,e,this.props.maxScrollDifference||0),u=Math.min(e,a);return{start:Math.min(Math.max(u+o*h,0),a),end:u}},this.containerMaxScroll=()=>this.containerScrollSize-this.containerOffsetSize,this.getContainerScrollDirection=e=>e<this.containerScrollPosition?0:1,this.initServices=(e=this.props)=>{const t=this.direction==="vertical"?e.itemHeight:e.itemWidth;t!==void 0&&(this.rowHeightService=new Zs(e.total,t,0),this.scrollerService.create(this.rowHeightService,e.skip,e.take,e.total,e.topOffset,this.scrollOffsetSize,this.direction))},this.getContainerProperty=e=>this.scrollContainer?this.scrollContainer[e]:0,this.handleScroll=e=>{if(!this.scrollContainer||!this.rowHeightService)return;const t=e.target;this.scrollerService.onScroll({scrollLeft:t.scrollLeft,scrollTop:t.scrollTop,offsetHeight:t.offsetHeight,offsetWidth:t.offsetWidth});const i=this.rowHeightService.index(this.containerScrollPosition-this.props.topOffset),{onScrollAction:a}=this.props,o={index:i,target:t,scrollAction:this.scrollAction,pageAction:this.pageAction,animationInProgress:this.animationInProgress};this.props.onScroll&&this.props.onScroll.call(void 0,e),a&&a.call(void 0,o),this.scrollAction=void 0,this.pageAction=void 0},this.handleScrollAction=e=>{this.scrollAction=e},this.handlePageAction=e=>{this.pageAction=e},this.scrollerService=new Gs(this.handleScrollAction,this.handlePageAction),this.restrictScroll=Number.parseFloat(r.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:Be.defaultProps.direction}get scrollOffsetSize(){return this.props.scrollOffsetSize!==void 0?this.props.scrollOffsetSize:Be.defaultProps.scrollOffsetSize}activeIndex(){return this.itemIndex(Math.ceil(this.containerScrollPosition))}itemIndex(s){return this.rowHeightService?this.rowHeightService.index(s):0}itemOffset(s){return this.rowHeightService?this.rowHeightService.offset(s):0}isIndexVisible(s){if(!this.rowHeightService)return!1;const e=this.containerScrollPosition,t=e+this.containerOffsetSize,i=this.rowHeightService.offset(s),a=i+this.rowHeightService.height(s);return i>=e&&a<=t}isListScrolled(s){return this.rowHeightService?this.containerScrollPosition!==this.rowHeightService.offset(s):!1}componentDidMount(){const{onMount:s}=this.props;s&&s.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 s=`${(this.rowHeightService?this.rowHeightService.totalHeight():0)+this.props.bottomOffset}`,e=this.direction==="vertical"?{height:`${s}px`}:{width:`${s}px`},t=d.classNames("k-content k-scrollable",{"k-scrollable-horizontal":this.direction==="horizontal"},this.props.className),i=d.classNames("k-scrollable-placeholder",{"k-scrollable-horizontal-placeholder":this.direction==="horizontal"});return r.createElement("div",{ref:a=>{this.scrollContainer=a},onScroll:this.handleScroll,className:t,tabIndex:this.props.tabIndex,role:this.props.role},this.props.children,r.createElement("div",{style:e,className:i}))}};let Ce=Be;Ce.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};Ce.defaultProps={direction:"vertical",forceScroll:!1,scrollOffsetSize:0,maxScrollDifference:100,scrollDuration:100};const ii=(s,e)=>{const t=Object.getOwnPropertyNames(s),i=Object.getOwnPropertyNames(e);if(t.length!==i.length)return!1;for(let a=0;a<t.length;a++){const o=t[a];if(s[o]!==e[o])return!1}return!0};class ns extends r.Component{constructor(){super(...arguments),this.handleClick=e=>{const{onClick:t,value:i}=this.props;t&&t.call(void 0,i,e)},this.handleMouseEnter=()=>{const{onMouseEnter:e,value:t}=this.props;e&&e.call(void 0,t)},this.handleMouseLeave=()=>{const{onMouseLeave:e,value:t}=this.props;e&&e.call(void 0,t)}}shouldComponentUpdate(e){const{value:t,...i}=this.props,{value:a,...o}=e;return!((!(t&&a)||t.getTime()===a.getTime())&&ii(i,o))}render(){const{className:e,formattedValue:t,isWeekend:i,isFocused:a,isInRange:o,isSelected:h,isRangeStart:u,isRangeMid:c,isRangeEnd:p,isRangeSplitStart:m,isRangeSplitEnd:g,isToday:f,isDisabled:v,view:C,value:I,...T}=this.props,b=this.props.activeRangeEnd==="end"&&p,E=this.props.activeRangeEnd==="start"&&u,w=d.classNames("k-calendar-td",{"k-range-end":p,"k-range-mid":c,"k-range-split-end":g,"k-range-split-start":m,"k-range-start":u,"k-active":E||b,"k-state-pending-focus":a,"k-selected":h||u||p,"k-today":f,"k-weekend":i,"k-disabled":v},e);return r.createElement("td",{...T,className:w,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},r.createElement("span",{className:"k-link"},this.props.children))}}class as extends r.Component{render(){const{className:e,firstDate:t,...i}=this.props;return r.createElement("td",{className:d.classNames("k-calendar-td",e),...i},this.props.children)}}var D=(s=>(s[s.Left=0]="Left",s[s.Right=1]="Right",s[s.Up=2]="Up",s[s.Down=3]="Down",s[s.PrevView=4]="PrevView",s[s.NextView=5]="NextView",s[s.FirstInView=6]="FirstInView",s[s.LastInView=7]="LastInView",s[s.LowerView=8]="LowerView",s[s.UpperView=9]="UpperView",s))(D||{}),S=(s=>(s[s.month=0]="month",s[s.year=1]="year",s[s.decade=2]="decade",s[s.century=3]="century",s))(S||{});const _={start:null,end:null};function ee(s){const e=(i,a,o,...h)=>a[o]===null?null:(i?s.isRequired:s)(a,o,...h),t=e.bind(null,!1);return t.isRequired=e.bind(null,!0),t}const $e=(s,e,t)=>e===void 0||t===void 0||e<=s&&s<=t?s:s<e?e:t,L=new Date(1980,0,1),te=new Date(1900,0,1),se=new Date(2099,11,31),de=new Date(1980,0,1),oe=new Date(1980,0,1,23,59,59),q=(s,e)=>{const t=l.cloneDate(s);return t.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),t},H=()=>l.getDate(new Date),F=(s,e,t)=>!s||!(e&&e>s||t&&t<s),os=(s,e,t)=>s===null||!(e&&l.getDate(e)>l.getDate(s)||t&&l.getDate(t)<l.getDate(s)),et=(s,e)=>{const{start:t,end:i}=e||_;return!t||!i?!1:t<s&&s<i},Z=(s,e,t=1)=>{const i=[];for(let a=s;a<e;a=a+t)i.push(a);return i},rs=(s,e,t)=>e.getTime()<=s.getTime()&&s.getTime()<=t.getTime(),ls=(s,e)=>s.slice(e).concat(s.slice(0,e)),U=(s,e,t)=>s&&(e&&s<e?l.cloneDate(e):t&&s>t?l.cloneDate(t):s),W=s=>(e,t="",i={})=>{const a=document.createElement(s);return a.className=t,Object.keys(i).map(o=>a.style[o]=i[o]),typeof e=="string"?a.innerHTML=e||"":(e||[]).forEach(o=>o&&a.appendChild(o)),a};function ni(s,e,t={}){let i,a;t.maxWait;let o,h,u;const c=window;let p=!1,m=!1;const g=!e&&e!==0&&typeof c.requestAnimationFrame=="function";if(typeof s!="function")throw new TypeError("Expected a function");e=+e||0;function f(x){const V=i,G=a;return i=a=void 0,o=s.apply(G,V),o}function v(x,V){return g?(c.cancelAnimationFrame(h),c.requestAnimationFrame(x)):setTimeout(x,V)}function C(x){if(g)return c.cancelAnimationFrame(x);clearTimeout(x)}function I(x){return h=v(E,e),p?f():o}function T(x){const V=x-u;return e-V}function b(x){const V=x-u;return u===void 0||V>=e||V<0||m}function E(){const x=Date.now();if(b(x))return w();h=v(E,T(x))}function w(x){return h=void 0,i?f():(i=a=void 0,o)}function A(){h!==void 0&&C(h),i=u=a=h=void 0}function O(){return h===void 0?o:w()}function P(){return h!==void 0}function B(...x){const V=Date.now(),G=b(V);return i=x,a=this,u=V,G&&h===void 0?I():(h===void 0&&(h=v(E,e)),o)}return B.cancel=A,B.flush=O,B.pending=P,B}const ai=[[]],rt=4,oi=3,ri={[D.Left]:s=>l.addDecades(s,-1),[D.Up]:s=>l.addDecades(s,-5),[D.Right]:s=>l.addDecades(s,1),[D.Down]:s=>l.addDecades(s,5),[D.PrevView]:s=>l.addCenturies(s,-1),[D.NextView]:s=>l.addCenturies(s,1),[D.FirstInView]:s=>l.firstDecadeOfCentury(s),[D.LastInView]:s=>l.lastDecadeOfCentury(s)};class hs{addToDate(e,t){return l.addCenturies(e,t)}datesList(e,t){return Z(0,t).map(i=>l.addCenturies(e,i))}data(e){const{cellUID:t,focusedDate:i,isActiveView:a,max:o,min:h,selectedDate:u,selectionRange:c=_,viewDate:p}=e;if(!p)return ai;const m=Z(0,rt),g=l.firstDecadeOfCentury(p),f=l.lastDecadeOfCentury(p),v=H();return Z(0,oi).map(C=>{const I=l.addDecades(g,C*rt);return m.map(T=>{const b=this.normalize(l.addDecades(I,T),h,o),E=this.isEqual(b,c.start),w=this.isEqual(b,c.end),O=!E&&!w&&et(b,c),P=a&&(Array.isArray(u)?this.isSelectedFromArray(b,u,h,o):F(u,h,o)&&this.isEqual(b,u));return rs(b,g,f)?{formattedValue:this.value(b),id:`${t}${b.getTime()}`,isFocused:this.isEqual(b,i),isSelected:P,isWeekend:!1,isInRange:F(b,h,o),isRangeStart:E,isRangeMid:O,isRangeEnd:w,isRangeSplitEnd:O&&this.isEqual(b,f),isRangeSplitStart:O&&this.isEqual(b,g),isToday:this.isEqual(b,v),title:this.cellTitle(b),value:b}:null})})}isSelectedFromArray(e,t,i,a){let o=!1;return t.forEach(h=>{F(e,i,a)&&this.isEqual(e,h)&&(o=!0)}),o}isEqual(e,t){return!e||!t?!1:l.firstYearOfDecade(e).getFullYear()===l.firstYearOfDecade(t).getFullYear()}isInArray(e,t){if(!t.length)return!1;const i=e.getFullYear();return t[0].getFullYear()<=i&&i<=t[t.length-1].getFullYear()+99}isInRange(e,t,i){const a=l.firstYearOfDecade(e).getFullYear(),o=!t||l.firstYearOfDecade(t).getFullYear()<=a,h=!i||a<=l.firstYearOfDecade(i).getFullYear();return o&&h}isInSameView(e,t){return l.durationInCenturies(e,t)===0}isRangeStart(e){return e.getFullYear()%1e3===0}move(e,t){const i=ri[t];return i?i(e):e}cellTitle(e){return l.firstYearOfDecade(e).getFullYear().toString()}navigationTitle(e){return e?l.firstDecadeOfCentury(e).getFullYear().toString():""}title(e){return e?`${l.firstDecadeOfCentury(e).getFullYear()} - ${l.lastDecadeOfCentury(e).getFullYear()}`:""}rowLength(e){return rt}skip(e,t){return l.durationInCenturies(t,e)}total(e,t){return l.durationInCenturies(e,t)+1}value(e){return e?l.firstYearOfDecade(e).getFullYear().toString():""}viewDate(e,t,i=1){return l.durationInCenturies(e,t)<i?l.addCenturies(e,-1):e}normalize(e,t,i){return e<t&&this.isEqual(e,t)?l.cloneDate(t):e>i&&this.isEqual(e,i)?l.cloneDate(i):e}}const li=[[]],lt=4,hi=3,ci={[D.Left]:s=>l.addYears(s,-1),[D.Up]:s=>l.addYears(s,-5),[D.Right]:s=>l.addYears(s,1),[D.Down]:s=>l.addYears(s,5),[D.PrevView]:s=>l.addDecades(s,-1),[D.NextView]:s=>l.addDecades(s,1),[D.FirstInView]:s=>l.firstYearOfDecade(s),[D.LastInView]:s=>l.lastYearOfDecade(s)};class cs{addToDate(e,t){return l.addDecades(e,t)}datesList(e,t){return Z(0,t).map(i=>l.addDecades(e,i))}data(e){const{cellUID:t,focusedDate:i,isActiveView:a,max:o,min:h,selectedDate:u,selectionRange:c=_,viewDate:p}=e;if(!p)return li;const m=Z(0,lt),g=l.firstYearOfDecade(p),f=l.lastYearOfDecade(p),v=H();return Z(0,hi).map(C=>{const I=l.addYears(g,C*lt);return m.map(T=>{const b=this.normalize(l.addYears(I,T),h,o),E=this.isEqual(b,c.start),w=this.isEqual(b,c.end),O=!E&&!w&&et(b,c),P=a&&(Array.isArray(u)?this.isSelectedFromArray(b,u,h,o):F(u,h,o)&&this.isEqual(b,u));return rs(b,g,f)?{formattedValue:this.value(b),id:`${t}${b.getTime()}`,isFocused:this.isEqual(b,i),isSelected:P,isWeekend:!1,isInRange:F(b,h,o),isRangeStart:E,isRangeMid:O,isRangeEnd:w,isRangeSplitEnd:O&&this.isEqual(b,f),isRangeSplitStart:O&&this.isEqual(b,g),isToday:this.isEqual(b,v),title:this.cellTitle(b),value:b}:null})})}isSelectedFromArray(e,t,i,a){let o=!1;return t.forEach(h=>{F(e,i,a)&&this.isEqual(e,h)&&(o=!0)}),o}isEqual(e,t){return!e||!t?!1:e.getFullYear()===t.getFullYear()}isInArray(e,t){if(!t.length)return!1;const i=e.getFullYear();return t[0].getFullYear()<=i&&i<=t[t.length-1].getFullYear()+9}isInRange(e,t,i){const a=e.getFullYear(),o=!t||t.getFullYear()<=a,h=!i||a<=i.getFullYear();return o&&h}isRangeStart(e){return e.getFullYear()%100===0}isInSameView(e,t){return l.durationInDecades(e,t)===0}move(e,t){const i=ci[t];return i?i(e):e}cellTitle(e){return e.getFullYear().toString()}navigationTitle(e){return e?l.firstYearOfDecade(e).getFullYear().toString():""}title(e){return e?`${l.firstYearOfDecade(e).getFullYear()} - ${l.lastYearOfDecade(e).getFullYear()}`:""}rowLength(e){return lt}skip(e,t){return l.durationInDecades(t,e)}total(e,t){return l.durationInDecades(e,t)+1}value(e){return e?e.getFullYear().toString():""}viewDate(e,t,i=1){return l.durationInDecades(e,t)<i?l.addDecades(e,-1):e}normalize(e,t,i){return e<t&&this.isEqual(e,t)?l.cloneDate(t):e>i&&this.isEqual(e,i)?l.cloneDate(i):e}}const ui=[[]],ht=7,di=6,pi=6,mi=0,gi={[D.Left]:s=>l.addDays(s,-1),[D.Up]:s=>l.addWeeks(s,-1),[D.Right]:s=>l.addDays(s,1),[D.Down]:s=>l.addWeeks(s,1),[D.PrevView]:s=>l.addMonths(s,-1),[D.NextView]:s=>l.addMonths(s,1),[D.FirstInView]:s=>l.firstDayOfMonth(s),[D.LastInView]:s=>l.lastDayOfMonth(s)};class us{constructor(e){this.intl=e}addToDate(e,t){return l.addMonths(e,t)}datesList(e,t){return Z(0,t).map(i=>l.addMonths(e,i))}data(e){const{cellUID:t,focusedDate:i,isActiveView:a,max:o,min:h,selectedDate:u,selectionRange:c=_,viewDate:p}=e;if(!p)return ui;const m=l.firstDayOfMonth(p),g=l.lastDayOfMonth(p),f=-1,v=l.dayOfWeek(m,this.intl.firstDay(),f),C=Z(0,ht),I=H();return Z(0,di).map(T=>{const b=l.addDays(v,T*ht);return C.map(E=>{const w=this.normalize(l.addDays(b,E),h,o);if(w<m||w>g)return null;const O=this.isEqual(w,c.start),P=this.isEqual(w,c.end),x=!O&&!P&&et(w,c),V=a&&(Array.isArray(u)?this.isSelectedFromArray(w,u,h,o):F(u,h,o)&&this.isEqual(w,u));return{formattedValue:this.value(w),id:`${t}${w.getTime()}`,isFocused:this.isEqual(w,i),isSelected:V,isInRange:F(w,h,o),isWeekend:this.isWeekend(w),isRangeStart:O,isRangeMid:x,isRangeEnd:P,isRangeSplitStart:x&&this.isEqual(w,m),isRangeSplitEnd:x&&this.isEqual(w,g),isToday:this.isEqual(w,I),title:this.cellTitle(w),value:w}})})}isEqual(e,t){return!e||!t?!1:l.getDate(e).getTime()===l.getDate(t).getTime()}isSelectedFromArray(e,t,i,a){let o=!1;return t.forEach(h=>{F(e,i,a)&&this.isEqual(e,h)&&(o=!0)}),o}isInArray(e,t){return!!t.length&&l.firstDayOfMonth(t[0])<=e&&e<=l.lastDayOfMonth(t[t.length-1])}isInRange(e,t,i){const a=l.getDate(e),o=!t||l.getDate(t)<=a,h=!i||a<=l.getDate(i);return o&&h}isInSameView(e,t){return l.durationInMonths(e,t)===0}isRangeStart(e){return!e.getMonth()}move(e,t){const i=gi[t];return i?i(e):e}cellTitle(e){return this.intl.formatDate(e,"D")}navigationTitle(e){return e?this.isRangeStart(e)?e.getFullYear().toString():this.abbrMonthNames()[e.getMonth()]:""}title(e){return`${this.wideMonthNames()[e.getMonth()]} ${e.getFullYear()}`}rowLength(e){return ht+(e?1:0)}skip(e,t){return l.durationInMonths(t,e)}total(e,t){return l.durationInMonths(e,t)+1}value(e){return e?e.getDate().toString():""}viewDate(e,t,i=1){return l.durationInMonths(e,t)<i?l.addMonths(e,-1):e}isWeekend(e){const t=e.getDay();return t===pi||t===mi}abbrMonthNames(){return this.intl.dateFormatNames({nameType:"abbreviated",type:"months"})}normalize(e,t,i){return e<t&&this.isEqual(e,t)?l.getDate(t):e>i&&this.isEqual(e,i)?l.getDate(i):e}wideMonthNames(){return this.intl.dateFormatNames({nameType:"wide",type:"months",standAlone:!0})}}const fi=[[]],ct=4,vi=3,wi=s=>s>4?-5:s<2?-2:-7,bi=s=>s<7?5:s<10?7:2,Di={[D.Left]:s=>l.addMonths(s,-1),[D.Up]:s=>l.addMonths(s,wi(s.getMonth())),[D.Right]:s=>l.addMonths(s,1),[D.Down]:s=>l.addMonths(s,bi(s.getMonth())),[D.PrevView]:s=>l.addYears(s,-1),[D.NextView]:s=>l.addYears(s,1),[D.FirstInView]:s=>l.firstMonthOfYear(s),[D.LastInView]:s=>l.lastMonthOfYear(s)};class ds{constructor(e){this._intl=e}addToDate(e,t){return l.addYears(e,t)}datesList(e,t){return Z(0,t).map(i=>l.addYears(e,i))}data(e){const{cellUID:t,focusedDate:i,isActiveView:a,max:o,min:h,selectedDate:u,selectionRange:c=_,viewDate:p}=e;if(!p)return fi;const m=this.abbrMonthNames(),g=l.firstMonthOfYear(p),f=l.lastMonthOfYear(p),v=g.getFullYear(),C=Z(0,ct),I=H();return Z(0,vi).map(T=>{const b=l.addMonths(g,T*ct);return C.map(E=>{const w=this.normalize(l.addMonths(b,E),h,o);if(v<w.getFullYear())return null;const O=this.isEqual(w,c.start),P=this.isEqual(w,c.end),x=!O&&!P&&et(w,c),V=a&&(Array.isArray(u)?this.isSelectedFromArray(w,u,h,o):F(u,h,o)&&this.isEqual(w,u));return{formattedValue:m[w.getMonth()],id:`${t}${w.getTime()}`,isFocused:this.isEqual(w,i),isSelected:V,isInRange:F(w,h,o),isWeekend:!1,isRangeStart:O,isRangeMid:x,isRangeEnd:P,isRangeSplitEnd:x&&this.isEqual(w,f),isRangeSplitStart:x&&this.isEqual(w,g),isToday:this.isEqual(w,I),title:this.cellTitle(w),value:w}})})}isSelectedFromArray(e,t,i,a){let o=!1;return t.forEach(h=>{F(e,i,a)&&this.isEqual(e,h)&&(o=!0)}),o}isEqual(e,t){return!e||!t?!1:e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()}isInArray(e,t){if(!t.length)return!1;const i=e.getFullYear();return t[0].getFullYear()<=i&&i<=t[t.length-1].getFullYear()}isInRange(e,t,i){const a=l.createDate(e.getFullYear(),e.getMonth(),1),o=!t||l.createDate(t.getFullYear(),t.getMonth(),1)<=a,h=!i||a<=l.createDate(i.getFullYear(),i.getMonth(),1);return o&&h}isInSameView(e,t){return l.durationInYears(e,t)===0}isRangeStart(e){return e.getFullYear()%10===0}move(e,t){const i=Di[t];return i?i(e):e}cellTitle(e){return`${e.getFullYear()} ${this.value(e)}`}navigationTitle(e){return this.title(e)}title(e){return e?e.getFullYear().toString():""}rowLength(e){return ct}skip(e,t){return l.durationInYears(t,e)}total(e,t){return l.durationInYears(e,t)+1}value(e){return e?this.abbrMonthNames()[e.getMonth()]:""}viewDate(e,t,i=1){return l.durationInYears(e,t)<i?l.addYears(e,-1):e}abbrMonthNames(){return this._intl.dateFormatNames({nameType:"abbreviated",type:"months"})}normalize(e,t,i){return e<t&&this.isEqual(e,t)?l.cloneDate(t):e>i&&this.isEqual(e,i)?l.cloneDate(i):e}}const yi={[S.month]:us,[S.year]:ds,[S.decade]:cs,[S.century]:hs},ki=(s,e)=>{const t=S[S[s+e]];return t!==void 0?t:s};class Et{constructor(e){this.bottom=S.month,this.top=S.century,this.onViewChanged=e}configure(e,t){this.bottom=e,this.top=t}service(e,t){return new yi[`${e}`](t)}moveDown(e,t){this.move(e,-1,t)}moveUp(e,t){this.move(e,1,t)}moveToBottom(e){e!==this.bottom&&this.onViewChanged({view:this.bottom})}canMoveDown(e){return this.bottom<e}canMoveUp(e){return e<this.top}clamp(e){return e<this.bottom?this.bottom:e>this.top?this.top:e}move(e,t,i){const a=this.clamp(ki(e,t));a!==e&&this.onViewChanged({view:a},i)}}let ps=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(e){if(!d.canUseDOM)return;const t=W("div"),i=W("ul"),a=W("li"),o=W("td"),h=W("th"),u=W("tr"),c=W("tbody"),p=W("thead"),m=W("table"),g=()=>t(`
5
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ys=require("react"),n=require("prop-types"),d=require("@progress/kendo-react-common"),l=require("@progress/kendo-date-math"),k=require("@progress/kendo-react-intl"),N=require("@progress/kendo-react-buttons"),J=require("@progress/kendo-svg-icons"),ss=require("@progress/kendo-react-labels"),Qe=require("@progress/kendo-react-popup"),ce=require("@progress/kendo-react-layout");function $s(s){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const t in s)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(s,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>s[t]})}}return e.default=s,Object.freeze(e)}const r=$s(Ys),Se={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"},Ks=(s,e,t)=>[...s.slice(0,e+1),...s.slice(e+1).map(i=>i+t)];class js{constructor(e=0,t,i){this.total=e,this.rowHeight=t,this.detailRowHeight=i,this.offsets=[],this.heights=[];let a=0;for(let o=0;o<e;o++)this.offsets.push(a),a+=t,this.heights.push(t)}height(e){return this.heights[e]}expandDetail(e){this.height(e)===this.rowHeight&&this.updateRowHeight(e,this.detailRowHeight)}collapseDetail(e){this.height(e)>this.rowHeight&&this.updateRowHeight(e,this.detailRowHeight*-1)}index(e){for(let t=0;t<this.offsets.length;t++){if(e===this.offsets[t])return t;if(e<this.offsets[t])return t-1}return this.total-1}offset(e){return this.offsets[e]}totalHeight(){return this.heights.reduce((e,t)=>e+t,0)}updateRowHeight(e,t){this.heights[e]+=t,this.offsets=Ks(this.offsets,e,t)}}const Ae=s=>Math.max(s,0);class at{constructor(e){this.offset=e}}class ot{constructor(e){this.skip=e}}class Zs{constructor(e,t){this.onScrollAction=e,this.onPageAction=t,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(e,t,i,a,o=0,h=0,u="vertical"){this.rowHeightService=e,this.firstLoaded=t,this.lastLoaded=t+i,this.take=i,this.total=a,this.lastScrollTop=0,this.topOffset=o,this.bottomOffset=h,this.direction=u;const c=this.rowsForHeight(o),p=Ae(t-c);this.onScrollAction(new at(this.rowOffset(p))),this.onPageAction(new ot(p))}onScroll({scrollLeft:e,scrollTop:t,offsetHeight:i,offsetWidth:a}){const o=this.direction==="vertical"?t:e,h=this.direction==="vertical"?i:a;if(this.lastScrollTop===o||!this.rowHeightService)return;const u=this.lastScrollTop>=o;this.lastScrollTop=o;const c=this.rowHeightService.index(Ae(o-this.topOffset)),p=this.rowHeightService.index(Ae(o+h-this.bottomOffset));if(!u&&p>=this.lastLoaded&&this.lastLoaded<this.total&&(this.firstLoaded=c,this.onScrollAction(new at(this.rowOffset(c))),this.lastLoaded=Math.min(this.firstLoaded+this.take,this.total),this.onPageAction(new ot(this.firstLoaded))),u&&c<=this.firstLoaded){const m=Math.floor(this.take*.3);this.firstLoaded=Ae(c-m),this.onScrollAction(new at(this.rowOffset(this.firstLoaded))),this.lastLoaded=Math.min(this.firstLoaded+this.take,this.total),this.onPageAction(new ot(this.firstLoaded))}}rowOffset(e){return this.rowHeightService?this.rowHeightService.offset(e)+this.topOffset:0}rowsForHeight(e){return this.rowHeightService?Math.ceil(e/this.rowHeightService.height(0)):0}}const Gs=(s,e,t)=>Math.min(Math.abs(e-s),t),Xs=17,Js=10,Qs={[1]:s=>e=>e+s,[0]:s=>e=>e-s},ei={[1]:s=>e=>Math.min(e,s),[0]:s=>e=>Math.max(e,s)},ti={[1]:s=>e=>e<s,[0]:s=>e=>e>s},Be=class extends r.Component{constructor(s){super(s),this.rowHeightService=null,this.scrollContainer=null,this.lastDirection=null,this.lastTotal=0,this.lastTake=0,this.animationInProgress=!1,this.restrictScroll=!1,this.scrollTo=e=>{const t=this.direction==="vertical"?"scrollTop":"scrollLeft";if(!this.scrollContainer)return;const i=this.scrollContainer[t];this.restrictScroll&&t==="scrollTop"&&(!Number.isInteger(i)||!Number.isInteger(e))&&Math.abs(i-e)<Js||(this.scrollContainer[t]=e)},this.scrollToIndex=e=>{this.animationInProgress=!1,this.rowHeightService&&this.scrollTo(this.rowHeightService.offset(e))},this.animateToIndex=e=>{if(!this.rowHeightService||!window)return;window.cancelAnimationFrame(this.cancelAnimation);const t=this.rowHeightService.offset(e),i=this.getContainerScrollDirection(t);let{start:a,end:o}=this.scrollRange(t,i);if(a===o)return;const h=this.scrollStep(a,o),u=Qs[i](h),c=ei[i](o),p=ti[i](u(o)),m=g=>{this.animationInProgress=!0;const f=u(g);this.scrollTo(c(f)),p(f)?this.cancelAnimation=window.requestAnimationFrame(()=>{m(f)}):this.animationInProgress=!1};this.cancelAnimation=window.requestAnimationFrame(()=>{m(a)})},this.scrollToBottom=()=>{this.rowHeightService&&this.scrollTo(this.rowHeightService.totalHeight()+this.props.bottomOffset)},this.scrollStep=(e,t)=>{const i=this.props.scrollDuration||Be.defaultProps.scrollDuration;return Math.abs(t-e)/(i/Xs)},this.scrollRange=(e,t)=>{const i=this.containerScrollPosition;if(parseInt(`${e}`,10)===parseInt(`${i}`,10))return{start:e,end:e};const a=this.containerMaxScroll(),o=t===0?1:-1,h=Gs(i,e,this.props.maxScrollDifference||0),u=Math.min(e,a);return{start:Math.min(Math.max(u+o*h,0),a),end:u}},this.containerMaxScroll=()=>this.containerScrollSize-this.containerOffsetSize,this.getContainerScrollDirection=e=>e<this.containerScrollPosition?0:1,this.initServices=(e=this.props)=>{const t=this.direction==="vertical"?e.itemHeight:e.itemWidth;t!==void 0&&(this.rowHeightService=new js(e.total,t,0),this.scrollerService.create(this.rowHeightService,e.skip,e.take,e.total,e.topOffset,this.scrollOffsetSize,this.direction))},this.getContainerProperty=e=>this.scrollContainer?this.scrollContainer[e]:0,this.handleScroll=e=>{if(!this.scrollContainer||!this.rowHeightService)return;const t=e.target;this.scrollerService.onScroll({scrollLeft:t.scrollLeft,scrollTop:t.scrollTop,offsetHeight:t.offsetHeight,offsetWidth:t.offsetWidth});const i=this.rowHeightService.index(this.containerScrollPosition-this.props.topOffset),{onScrollAction:a}=this.props,o={index:i,target:t,scrollAction:this.scrollAction,pageAction:this.pageAction,animationInProgress:this.animationInProgress};this.props.onScroll&&this.props.onScroll.call(void 0,e),a&&a.call(void 0,o),this.scrollAction=void 0,this.pageAction=void 0},this.handleScrollAction=e=>{this.scrollAction=e},this.handlePageAction=e=>{this.pageAction=e},this.scrollerService=new Zs(this.handleScrollAction,this.handlePageAction),this.restrictScroll=Number.parseFloat(r.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:Be.defaultProps.direction}get scrollOffsetSize(){return this.props.scrollOffsetSize!==void 0?this.props.scrollOffsetSize:Be.defaultProps.scrollOffsetSize}activeIndex(){return this.itemIndex(Math.ceil(this.containerScrollPosition))}itemIndex(s){return this.rowHeightService?this.rowHeightService.index(s):0}itemOffset(s){return this.rowHeightService?this.rowHeightService.offset(s):0}isIndexVisible(s){if(!this.rowHeightService)return!1;const e=this.containerScrollPosition,t=e+this.containerOffsetSize,i=this.rowHeightService.offset(s),a=i+this.rowHeightService.height(s);return i>=e&&a<=t}isListScrolled(s){return this.rowHeightService?this.containerScrollPosition!==this.rowHeightService.offset(s):!1}componentDidMount(){const{onMount:s}=this.props;s&&s.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 s=`${(this.rowHeightService?this.rowHeightService.totalHeight():0)+this.props.bottomOffset}`,e=this.direction==="vertical"?{height:`${s}px`}:{width:`${s}px`},t=d.classNames("k-content k-scrollable",{"k-scrollable-horizontal":this.direction==="horizontal"},this.props.className),i=d.classNames("k-scrollable-placeholder",{"k-scrollable-horizontal-placeholder":this.direction==="horizontal"});return r.createElement("div",{ref:a=>{this.scrollContainer=a},onScroll:this.handleScroll,className:t,tabIndex:this.props.tabIndex,role:this.props.role},this.props.children,r.createElement("div",{style:e,className:i}))}};let Ce=Be;Ce.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};Ce.defaultProps={direction:"vertical",forceScroll:!1,scrollOffsetSize:0,maxScrollDifference:100,scrollDuration:100};const si=(s,e)=>{const t=Object.getOwnPropertyNames(s),i=Object.getOwnPropertyNames(e);if(t.length!==i.length)return!1;for(let a=0;a<t.length;a++){const o=t[a];if(s[o]!==e[o])return!1}return!0};class is extends r.Component{constructor(){super(...arguments),this.handleClick=e=>{const{onClick:t,value:i}=this.props;t&&t.call(void 0,i,e)},this.handleMouseEnter=()=>{const{onMouseEnter:e,value:t}=this.props;e&&e.call(void 0,t)},this.handleMouseLeave=()=>{const{onMouseLeave:e,value:t}=this.props;e&&e.call(void 0,t)}}shouldComponentUpdate(e){const{value:t,...i}=this.props,{value:a,...o}=e;return!((!(t&&a)||t.getTime()===a.getTime())&&si(i,o))}render(){const{className:e,formattedValue:t,isWeekend:i,isFocused:a,isInRange:o,isSelected:h,isRangeStart:u,isRangeMid:c,isRangeEnd:p,isRangeSplitStart:m,isRangeSplitEnd:g,isToday:f,isDisabled:v,view:C,value:I,...T}=this.props,b=this.props.activeRangeEnd==="end"&&p,E=this.props.activeRangeEnd==="start"&&u,w=d.classNames("k-calendar-td",{"k-range-end":p,"k-range-mid":c,"k-range-split-end":g,"k-range-split-start":m,"k-range-start":u,"k-active":E||b,"k-state-pending-focus":a,"k-selected":h||u||p,"k-today":f,"k-weekend":i,"k-disabled":v},e);return r.createElement("td",{...T,className:w,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},r.createElement("span",{className:"k-link"},this.props.children))}}class ns extends r.Component{render(){const{className:e,firstDate:t,...i}=this.props;return r.createElement("td",{className:d.classNames("k-calendar-td",e),...i},this.props.children)}}var D=(s=>(s[s.Left=0]="Left",s[s.Right=1]="Right",s[s.Up=2]="Up",s[s.Down=3]="Down",s[s.PrevView=4]="PrevView",s[s.NextView=5]="NextView",s[s.FirstInView=6]="FirstInView",s[s.LastInView=7]="LastInView",s[s.LowerView=8]="LowerView",s[s.UpperView=9]="UpperView",s))(D||{}),S=(s=>(s[s.month=0]="month",s[s.year=1]="year",s[s.decade=2]="decade",s[s.century=3]="century",s))(S||{});const _={start:null,end:null};function ee(s){const e=(i,a,o,...h)=>a[o]===null?null:(i?s.isRequired:s)(a,o,...h),t=e.bind(null,!1);return t.isRequired=e.bind(null,!0),t}const $e=(s,e,t)=>e===void 0||t===void 0||e<=s&&s<=t?s:s<e?e:t,L=new Date(1980,0,1),te=new Date(1900,0,1),se=new Date(2099,11,31),de=new Date(1980,0,1),oe=new Date(1980,0,1,23,59,59),q=(s,e)=>{const t=l.cloneDate(s);return t.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),t},H=()=>l.getDate(new Date),F=(s,e,t)=>!s||!(e&&e>s||t&&t<s),as=(s,e,t)=>s===null||!(e&&l.getDate(e)>l.getDate(s)||t&&l.getDate(t)<l.getDate(s)),et=(s,e)=>{const{start:t,end:i}=e||_;return!t||!i?!1:t<s&&s<i},Z=(s,e,t=1)=>{const i=[];for(let a=s;a<e;a=a+t)i.push(a);return i},os=(s,e,t)=>e.getTime()<=s.getTime()&&s.getTime()<=t.getTime(),rs=(s,e)=>s.slice(e).concat(s.slice(0,e)),U=(s,e,t)=>s&&(e&&s<e?l.cloneDate(e):t&&s>t?l.cloneDate(t):s),W=s=>(e,t="",i={})=>{const a=document.createElement(s);return a.className=t,Object.keys(i).map(o=>a.style[o]=i[o]),typeof e=="string"?a.innerHTML=e||"":(e||[]).forEach(o=>o&&a.appendChild(o)),a};function ii(s,e,t={}){let i,a;t.maxWait;let o,h,u;const c=window;let p=!1,m=!1;const g=!e&&e!==0&&typeof c.requestAnimationFrame=="function";if(typeof s!="function")throw new TypeError("Expected a function");e=+e||0;function f(x){const V=i,G=a;return i=a=void 0,o=s.apply(G,V),o}function v(x,V){return g?(c.cancelAnimationFrame(h),c.requestAnimationFrame(x)):setTimeout(x,V)}function C(x){if(g)return c.cancelAnimationFrame(x);clearTimeout(x)}function I(x){return h=v(E,e),p?f():o}function T(x){const V=x-u;return e-V}function b(x){const V=x-u;return u===void 0||V>=e||V<0||m}function E(){const x=Date.now();if(b(x))return w();h=v(E,T(x))}function w(x){return h=void 0,i?f():(i=a=void 0,o)}function A(){h!==void 0&&C(h),i=u=a=h=void 0}function O(){return h===void 0?o:w()}function P(){return h!==void 0}function B(...x){const V=Date.now(),G=b(V);return i=x,a=this,u=V,G&&h===void 0?I():(h===void 0&&(h=v(E,e)),o)}return B.cancel=A,B.flush=O,B.pending=P,B}const ni=[[]],rt=4,ai=3,oi={[D.Left]:s=>l.addDecades(s,-1),[D.Up]:s=>l.addDecades(s,-5),[D.Right]:s=>l.addDecades(s,1),[D.Down]:s=>l.addDecades(s,5),[D.PrevView]:s=>l.addCenturies(s,-1),[D.NextView]:s=>l.addCenturies(s,1),[D.FirstInView]:s=>l.firstDecadeOfCentury(s),[D.LastInView]:s=>l.lastDecadeOfCentury(s)};class ls{addToDate(e,t){return l.addCenturies(e,t)}datesList(e,t){return Z(0,t).map(i=>l.addCenturies(e,i))}data(e){const{cellUID:t,focusedDate:i,isActiveView:a,max:o,min:h,selectedDate:u,selectionRange:c=_,viewDate:p}=e;if(!p)return ni;const m=Z(0,rt),g=l.firstDecadeOfCentury(p),f=l.lastDecadeOfCentury(p),v=H();return Z(0,ai).map(C=>{const I=l.addDecades(g,C*rt);return m.map(T=>{const b=this.normalize(l.addDecades(I,T),h,o),E=this.isEqual(b,c.start),w=this.isEqual(b,c.end),O=!E&&!w&&et(b,c),P=a&&(Array.isArray(u)?this.isSelectedFromArray(b,u,h,o):F(u,h,o)&&this.isEqual(b,u));return os(b,g,f)?{formattedValue:this.value(b),id:`${t}${b.getTime()}`,isFocused:this.isEqual(b,i),isSelected:P,isWeekend:!1,isInRange:F(b,h,o),isRangeStart:E,isRangeMid:O,isRangeEnd:w,isRangeSplitEnd:O&&this.isEqual(b,f),isRangeSplitStart:O&&this.isEqual(b,g),isToday:this.isEqual(b,v),title:this.cellTitle(b),value:b}:null})})}isSelectedFromArray(e,t,i,a){let o=!1;return t.forEach(h=>{F(e,i,a)&&this.isEqual(e,h)&&(o=!0)}),o}isEqual(e,t){return!e||!t?!1:l.firstYearOfDecade(e).getFullYear()===l.firstYearOfDecade(t).getFullYear()}isInArray(e,t){if(!t.length)return!1;const i=e.getFullYear();return t[0].getFullYear()<=i&&i<=t[t.length-1].getFullYear()+99}isInRange(e,t,i){const a=l.firstYearOfDecade(e).getFullYear(),o=!t||l.firstYearOfDecade(t).getFullYear()<=a,h=!i||a<=l.firstYearOfDecade(i).getFullYear();return o&&h}isInSameView(e,t){return l.durationInCenturies(e,t)===0}isRangeStart(e){return e.getFullYear()%1e3===0}move(e,t){const i=oi[t];return i?i(e):e}cellTitle(e){return l.firstYearOfDecade(e).getFullYear().toString()}navigationTitle(e){return e?l.firstDecadeOfCentury(e).getFullYear().toString():""}title(e){return e?`${l.firstDecadeOfCentury(e).getFullYear()} - ${l.lastDecadeOfCentury(e).getFullYear()}`:""}rowLength(e){return rt}skip(e,t){return l.durationInCenturies(t,e)}total(e,t){return l.durationInCenturies(e,t)+1}value(e){return e?l.firstYearOfDecade(e).getFullYear().toString():""}viewDate(e,t,i=1){return l.durationInCenturies(e,t)<i?l.addCenturies(e,-1):e}normalize(e,t,i){return e<t&&this.isEqual(e,t)?l.cloneDate(t):e>i&&this.isEqual(e,i)?l.cloneDate(i):e}}const ri=[[]],lt=4,li=3,hi={[D.Left]:s=>l.addYears(s,-1),[D.Up]:s=>l.addYears(s,-5),[D.Right]:s=>l.addYears(s,1),[D.Down]:s=>l.addYears(s,5),[D.PrevView]:s=>l.addDecades(s,-1),[D.NextView]:s=>l.addDecades(s,1),[D.FirstInView]:s=>l.firstYearOfDecade(s),[D.LastInView]:s=>l.lastYearOfDecade(s)};class hs{addToDate(e,t){return l.addDecades(e,t)}datesList(e,t){return Z(0,t).map(i=>l.addDecades(e,i))}data(e){const{cellUID:t,focusedDate:i,isActiveView:a,max:o,min:h,selectedDate:u,selectionRange:c=_,viewDate:p}=e;if(!p)return ri;const m=Z(0,lt),g=l.firstYearOfDecade(p),f=l.lastYearOfDecade(p),v=H();return Z(0,li).map(C=>{const I=l.addYears(g,C*lt);return m.map(T=>{const b=this.normalize(l.addYears(I,T),h,o),E=this.isEqual(b,c.start),w=this.isEqual(b,c.end),O=!E&&!w&&et(b,c),P=a&&(Array.isArray(u)?this.isSelectedFromArray(b,u,h,o):F(u,h,o)&&this.isEqual(b,u));return os(b,g,f)?{formattedValue:this.value(b),id:`${t}${b.getTime()}`,isFocused:this.isEqual(b,i),isSelected:P,isWeekend:!1,isInRange:F(b,h,o),isRangeStart:E,isRangeMid:O,isRangeEnd:w,isRangeSplitEnd:O&&this.isEqual(b,f),isRangeSplitStart:O&&this.isEqual(b,g),isToday:this.isEqual(b,v),title:this.cellTitle(b),value:b}:null})})}isSelectedFromArray(e,t,i,a){let o=!1;return t.forEach(h=>{F(e,i,a)&&this.isEqual(e,h)&&(o=!0)}),o}isEqual(e,t){return!e||!t?!1:e.getFullYear()===t.getFullYear()}isInArray(e,t){if(!t.length)return!1;const i=e.getFullYear();return t[0].getFullYear()<=i&&i<=t[t.length-1].getFullYear()+9}isInRange(e,t,i){const a=e.getFullYear(),o=!t||t.getFullYear()<=a,h=!i||a<=i.getFullYear();return o&&h}isRangeStart(e){return e.getFullYear()%100===0}isInSameView(e,t){return l.durationInDecades(e,t)===0}move(e,t){const i=hi[t];return i?i(e):e}cellTitle(e){return e.getFullYear().toString()}navigationTitle(e){return e?l.firstYearOfDecade(e).getFullYear().toString():""}title(e){return e?`${l.firstYearOfDecade(e).getFullYear()} - ${l.lastYearOfDecade(e).getFullYear()}`:""}rowLength(e){return lt}skip(e,t){return l.durationInDecades(t,e)}total(e,t){return l.durationInDecades(e,t)+1}value(e){return e?e.getFullYear().toString():""}viewDate(e,t,i=1){return l.durationInDecades(e,t)<i?l.addDecades(e,-1):e}normalize(e,t,i){return e<t&&this.isEqual(e,t)?l.cloneDate(t):e>i&&this.isEqual(e,i)?l.cloneDate(i):e}}const ci=[[]],ht=7,ui=6,di=6,pi=0,mi={[D.Left]:s=>l.addDays(s,-1),[D.Up]:s=>l.addWeeks(s,-1),[D.Right]:s=>l.addDays(s,1),[D.Down]:s=>l.addWeeks(s,1),[D.PrevView]:s=>l.addMonths(s,-1),[D.NextView]:s=>l.addMonths(s,1),[D.FirstInView]:s=>l.firstDayOfMonth(s),[D.LastInView]:s=>l.lastDayOfMonth(s)};class cs{constructor(e){this.intl=e}addToDate(e,t){return l.addMonths(e,t)}datesList(e,t){return Z(0,t).map(i=>l.addMonths(e,i))}data(e){const{cellUID:t,focusedDate:i,isActiveView:a,max:o,min:h,selectedDate:u,selectionRange:c=_,viewDate:p}=e;if(!p)return ci;const m=l.firstDayOfMonth(p),g=l.lastDayOfMonth(p),f=-1,v=l.dayOfWeek(m,this.intl.firstDay(),f),C=Z(0,ht),I=H();return Z(0,ui).map(T=>{const b=l.addDays(v,T*ht);return C.map(E=>{const w=this.normalize(l.addDays(b,E),h,o);if(w<m||w>g)return null;const O=this.isEqual(w,c.start),P=this.isEqual(w,c.end),x=!O&&!P&&et(w,c),V=a&&(Array.isArray(u)?this.isSelectedFromArray(w,u,h,o):F(u,h,o)&&this.isEqual(w,u));return{formattedValue:this.value(w),id:`${t}${w.getTime()}`,isFocused:this.isEqual(w,i),isSelected:V,isInRange:F(w,h,o),isWeekend:this.isWeekend(w),isRangeStart:O,isRangeMid:x,isRangeEnd:P,isRangeSplitStart:x&&this.isEqual(w,m),isRangeSplitEnd:x&&this.isEqual(w,g),isToday:this.isEqual(w,I),title:this.cellTitle(w),value:w}})})}isEqual(e,t){return!e||!t?!1:l.getDate(e).getTime()===l.getDate(t).getTime()}isSelectedFromArray(e,t,i,a){let o=!1;return t.forEach(h=>{F(e,i,a)&&this.isEqual(e,h)&&(o=!0)}),o}isInArray(e,t){return!!t.length&&l.firstDayOfMonth(t[0])<=e&&e<=l.lastDayOfMonth(t[t.length-1])}isInRange(e,t,i){const a=l.getDate(e),o=!t||l.getDate(t)<=a,h=!i||a<=l.getDate(i);return o&&h}isInSameView(e,t){return l.durationInMonths(e,t)===0}isRangeStart(e){return!e.getMonth()}move(e,t){const i=mi[t];return i?i(e):e}cellTitle(e){return this.intl.formatDate(e,"D")}navigationTitle(e){return e?this.isRangeStart(e)?e.getFullYear().toString():this.abbrMonthNames()[e.getMonth()]:""}title(e){return`${this.wideMonthNames()[e.getMonth()]} ${e.getFullYear()}`}rowLength(e){return ht+(e?1:0)}skip(e,t){return l.durationInMonths(t,e)}total(e,t){return l.durationInMonths(e,t)+1}value(e){return e?e.getDate().toString():""}viewDate(e,t,i=1){return l.durationInMonths(e,t)<i?l.addMonths(e,-1):e}isWeekend(e){const t=e.getDay();return t===di||t===pi}abbrMonthNames(){return this.intl.dateFormatNames({nameType:"abbreviated",type:"months"})}normalize(e,t,i){return e<t&&this.isEqual(e,t)?l.getDate(t):e>i&&this.isEqual(e,i)?l.getDate(i):e}wideMonthNames(){return this.intl.dateFormatNames({nameType:"wide",type:"months",standAlone:!0})}}const gi=[[]],ct=4,fi=3,vi=s=>s>4?-5:s<2?-2:-7,wi=s=>s<7?5:s<10?7:2,bi={[D.Left]:s=>l.addMonths(s,-1),[D.Up]:s=>l.addMonths(s,vi(s.getMonth())),[D.Right]:s=>l.addMonths(s,1),[D.Down]:s=>l.addMonths(s,wi(s.getMonth())),[D.PrevView]:s=>l.addYears(s,-1),[D.NextView]:s=>l.addYears(s,1),[D.FirstInView]:s=>l.firstMonthOfYear(s),[D.LastInView]:s=>l.lastMonthOfYear(s)};class us{constructor(e){this._intl=e}addToDate(e,t){return l.addYears(e,t)}datesList(e,t){return Z(0,t).map(i=>l.addYears(e,i))}data(e){const{cellUID:t,focusedDate:i,isActiveView:a,max:o,min:h,selectedDate:u,selectionRange:c=_,viewDate:p}=e;if(!p)return gi;const m=this.abbrMonthNames(),g=l.firstMonthOfYear(p),f=l.lastMonthOfYear(p),v=g.getFullYear(),C=Z(0,ct),I=H();return Z(0,fi).map(T=>{const b=l.addMonths(g,T*ct);return C.map(E=>{const w=this.normalize(l.addMonths(b,E),h,o);if(v<w.getFullYear())return null;const O=this.isEqual(w,c.start),P=this.isEqual(w,c.end),x=!O&&!P&&et(w,c),V=a&&(Array.isArray(u)?this.isSelectedFromArray(w,u,h,o):F(u,h,o)&&this.isEqual(w,u));return{formattedValue:m[w.getMonth()],id:`${t}${w.getTime()}`,isFocused:this.isEqual(w,i),isSelected:V,isInRange:F(w,h,o),isWeekend:!1,isRangeStart:O,isRangeMid:x,isRangeEnd:P,isRangeSplitEnd:x&&this.isEqual(w,f),isRangeSplitStart:x&&this.isEqual(w,g),isToday:this.isEqual(w,I),title:this.cellTitle(w),value:w}})})}isSelectedFromArray(e,t,i,a){let o=!1;return t.forEach(h=>{F(e,i,a)&&this.isEqual(e,h)&&(o=!0)}),o}isEqual(e,t){return!e||!t?!1:e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()}isInArray(e,t){if(!t.length)return!1;const i=e.getFullYear();return t[0].getFullYear()<=i&&i<=t[t.length-1].getFullYear()}isInRange(e,t,i){const a=l.createDate(e.getFullYear(),e.getMonth(),1),o=!t||l.createDate(t.getFullYear(),t.getMonth(),1)<=a,h=!i||a<=l.createDate(i.getFullYear(),i.getMonth(),1);return o&&h}isInSameView(e,t){return l.durationInYears(e,t)===0}isRangeStart(e){return e.getFullYear()%10===0}move(e,t){const i=bi[t];return i?i(e):e}cellTitle(e){return`${e.getFullYear()} ${this.value(e)}`}navigationTitle(e){return this.title(e)}title(e){return e?e.getFullYear().toString():""}rowLength(e){return ct}skip(e,t){return l.durationInYears(t,e)}total(e,t){return l.durationInYears(e,t)+1}value(e){return e?this.abbrMonthNames()[e.getMonth()]:""}viewDate(e,t,i=1){return l.durationInYears(e,t)<i?l.addYears(e,-1):e}abbrMonthNames(){return this._intl.dateFormatNames({nameType:"abbreviated",type:"months"})}normalize(e,t,i){return e<t&&this.isEqual(e,t)?l.cloneDate(t):e>i&&this.isEqual(e,i)?l.cloneDate(i):e}}const Di={[S.month]:cs,[S.year]:us,[S.decade]:hs,[S.century]:ls},yi=(s,e)=>{const t=S[S[s+e]];return t!==void 0?t:s};class Et{constructor(e){this.bottom=S.month,this.top=S.century,this.onViewChanged=e}configure(e,t){this.bottom=e,this.top=t}service(e,t){return new Di[`${e}`](t)}moveDown(e,t){this.move(e,-1,t)}moveUp(e,t){this.move(e,1,t)}moveToBottom(e){e!==this.bottom&&this.onViewChanged({view:this.bottom})}canMoveDown(e){return this.bottom<e}canMoveUp(e){return e<this.top}clamp(e){return e<this.bottom?this.bottom:e>this.top?this.top:e}move(e,t,i){const a=this.clamp(yi(e,t));a!==e&&this.onViewChanged({view:a},i)}}let ds=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(e){if(!d.canUseDOM)return;const t=W("div"),i=W("ul"),a=W("li"),o=W("td"),h=W("th"),u=W("tr"),c=W("tbody"),p=W("thead"),m=W("table"),g=()=>t(`
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"),f=()=>m([p([u([h("MO","k-calendar-th")],"k-calendar-tr")],"k-calendar-thead")],"k-calendar-table k-calendar-weekdays"),v=(y,R)=>new Array(y).fill("1").map(R),C=(y,R=1)=>m([c([u([o("1","k-calendar-td k-alt")])].concat(v(y,()=>u(v(R,ge=>o(`<span class="k-link">${ge}</span>`,"k-calendar-td")),"k-calendar-tr"))),"k-calendar-tbody")],"k-calendar-table"),I=y=>t(y,"k-content k-scrollable"),T=(y,R,ge)=>t(ge?[g(),f(),I([y,y])]:[g(),I([y,y])],R,{left:"-10000px",position:"absolute"}),b=(()=>{let y;return()=>d.canUseDOM?(y||(y=t([I([i([a("<span>FEB</span>")])])],"k-calendar-navigation",{left:"0px",position:"absolute"})),y):null})(),E=({cells:y,rows:R},ge,Ys)=>{let nt;return()=>d.canUseDOM?(nt||(nt=T(C(R,y),ge,Ys)),nt):null},w=y=>y.querySelector(".k-scrollable"),A=y=>{const R=w(y);return R.className=`${R.className} k-scrollable-horizontal`,y},O=E({cells:7,rows:6},"k-calendar-view k-calendar-monthview k-vstack",!0),P=E({cells:5,rows:3},"k-calendar-view k-calendar-yearview",!1),B=E({cells:5,rows:2},"k-calendar-view k-calendar-decadeview",!1),x=()=>A(O()),V=()=>A(P()),G=()=>A(B()),Y=y=>parseFloat(window.getComputedStyle(y).height)||y.offsetHeight,le=y=>{const R=window.getComputedStyle(y);return parseFloat(R.width)+parseFloat(R.paddingLeft)+parseFloat(R.paddingRight)||y.offsetWidth},me=y=>y.querySelector("tbody");this.didCalculate=!0,e&&(this.hostContainer=e),this.batch(O(),y=>{const R=me(y);this.calendarHeight=Y(y),this.monthViewHeight=Y(R),this.headerHeight=Y(R.children[0]),this.scrollableContentHeight=Y(w(y))}),this.batch(x(),y=>{const R=me(y);this.calendarWidth=le(y),this.monthViewWidth=le(R),this.scrollableContentWidth=le(w(y))}),this.batch(P(),y=>{this.yearViewHeight=Y(me(y)),this.scrollableYearContentHeight=Y(w(y))}),this.batch(V(),y=>{this.yearViewWidth=le(me(y))}),this.batch(B(),y=>{this.decadeViewHeight=Y(me(y)),this.centuryViewHeight=this.decadeViewHeight}),this.batch(G(),y=>{this.decadeViewWidth=le(me(y)),this.centuryViewWidth=this.decadeViewWidth}),this.batch(b(),y=>{this.navigationItemHeight=Y(y.querySelector("li"))})}viewHeight(e){return this.viewDimension(e,"height")}viewWidth(e){return this.viewDimension(e,"width")}viewDimension(e,t){const i=t==="height"?"ViewHeight":"ViewWidth";switch(e){case S.month:return this[`month${i}`];case S.year:return this[`year${i}`];case S.decade:return this[`decade${i}`];case S.century:return this[`century${i}`];default:return 1}}batch(e,t){const i=this.hostContainer||document.body,a=i.appendChild(e);t(a),i.removeChild(a)}};const Si={33:D.PrevView,34:D.NextView,35:D.LastInView,36:D.FirstInView,37:D.Left,38:D.Up,39:D.Right,40:D.Down,"meta+38":D.UpperView,"meta+40":D.LowerView};class Ot{constructor(e){this.bus=e}action(e){const t=`${e.ctrlKey||e.metaKey?"meta+":""}${e.keyCode}`;return Si[t]}move(e,t,i,a,o){return a?t===D.UpperView&&this.bus.canMoveUp(i)?(this.bus.moveUp(i,o),e):t===D.LowerView&&this.bus.canMoveDown(i)?(this.bus.moveDown(i,o),e):a.move(e,t):e}}const Ci=s=>e=>Math.floor(e/s),xi=s=>e=>e*s;class ms{constructor(e){this.dom=e,this.divideByMagnitude=null,this.powerByMagnitude=null,this.navigator=null,this.view=null,this.monthScrolled=!1,this.navScrolled=!1}configure(e){const t=Math.max(this.dom.viewHeight(e)/this.dom.navigationItemHeight,1);this.divideByMagnitude=Ci(t),this.powerByMagnitude=xi(t)}sync(e,t,i){if(!(!e||!t)){if(this.navigator=e,this.view=t,i.target===this.navigator.element){if(this.monthScrolled){this.monthScrolled=!1;return}this.navScrolled=!0,this.scrollSiblingOf(this.navigator.element)}if(i.target===this.view.element){if(this.navScrolled){this.navScrolled=!1;return}this.monthScrolled=!0,this.scrollSiblingOf(this.view.element)}}}scrollSiblingOf(e){const t=this.siblingComponent(e),i=this.calculateScroll(t,e.scrollTop);t.scrollTo(i)}siblingComponent(e){return this.navigator.element===e?this.view:this.navigator}calculateScroll(e,t){const i=e===this.navigator?this.divideByMagnitude:this.powerByMagnitude;return i?i(t):0}}class gs{constructor(e){this.intl=e}getWeekNames(e=!1){const t=ls(this.intl.dateFormatNames({nameType:"short",type:"days"}),this.intl.firstDay());return e?[""].concat(t):t}}const qt=s=>r.createElement("td",{key:s,className:"k-calendar-td"}," "),fs=class extends r.Component{constructor(){super(...arguments),this.intl=null,this.weekService=null,this.buildWeekNumber=(s,e)=>{if(!this.firstDate(s))return qt(`week-cell-${e}`);const i=this.firstDate(s),a=this.getWeekNumber(i),o=`kendo-react-calendar-week-cell-${a}`,h={className:"k-alt",value:a,firstDate:i};return this.props.weekCell?r.createElement(this.props.weekCell,{...h,key:o},a):r.createElement(as,{...h,key:o},a)},this.buildRow=s=>s.map((e,t)=>{if(!e)return qt(t);const i={"aria-selected":e.isSelected},a=`kendo-react-calendar-cell-${e.value.getTime()}`,o={...i,...e,isDisabled:!e.isInRange,view:this.props.activeView,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave};return this.props.cell?r.createElement(this.props.cell,{...o,key:a},e.formattedValue):r.createElement(ns,{...o,key:a},e.formattedValue)}),this.firstDate=s=>{const e=this.firstWeekDateContext(s);return e?e.value:null},this.firstWeekDateContext=s=>{if(!this.weekNumber)return null;let e=0,t=s[e];for(;!t&&e<s.length;)t=s[++e];return t},this.handleClick=(s,e)=>{const{onChange:t}=this.props;if(t&&e){const i={value:l.cloneDate(s),target:this,nativeEvent:e&&e.nativeEvent,syntheticEvent:e};t.call(void 0,i)}},this.handleMouseEnter=s=>{const{onCellEnter:e}=this.props;e&&e.call(void 0,l.cloneDate(s))},this.handleMouseLeave=s=>{const{onCellLeave:e}=this.props;e&&e.call(void 0,l.cloneDate(s))}}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===S.month}get weekNumber(){return!!(this.props.showWeekNumbers&&this.props.activeView===S.month)}get selectedDate(){return this.props.selectedDate!==void 0?this.props.selectedDate:fs.defaultProps.selectedDate}render(){this.intl=k.provideIntlService(this),this.weekService=new gs(this.intl);const s=this.weekService.getWeekNames(this.weekNumber),e=this.props.service.rowLength(this.weekNumber),t=this.props.service.title(this.props.viewDate),i=H(),a=q(this.props.viewDate,i),o=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 r.createElement(r.Fragment,null,this.isMonthView&&this.isHorizontal&&r.createElement("thead",{role:"rowgroup",className:"k-calendar-thead"},r.createElement("tr",{role:"row",className:"k-calendar-tr"},s.map((h,u)=>r.createElement("th",{key:u,className:"k-calendar-th"},h)))),r.createElement("tbody",{role:"rowgroup",className:"k-calendar-tbody"},!this.isHorizontal&&r.createElement("tr",{role:"presentation",className:"k-calendar-tr"},r.createElement("th",{scope:"col",colSpan:e,className:"k-calendar-caption"},t)),o.map((h,u)=>r.createElement("tr",{role:"row",className:"k-calendar-tr",key:u},this.weekNumber&&this.buildWeekNumber(h,u),this.buildRow(h)))))}getWeekNumber(s){return!this.weekNumber||!this.intl?null:l.weekInYear(s,this.intl.firstDay())}};let Le=fs;Le.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};Le.defaultProps={direction:"vertical",selectedDate:H(),showWeekNumbers:!1};k.registerForIntl(Le);class vs extends r.PureComponent{render(){const{view:e,...t}=this.props;return r.createElement(N.Button,{type:"button",fillMode:"flat",...t},this.props.children)}}const ze=class extends r.Component{constructor(){super(...arguments),this.getTitle=()=>{if(!this.props.currentDate)return"";const s=this.rangeLength-1,e=this.props.service.title(this.props.currentDate),t=this.props.service.addToDate(this.props.currentDate,s);return s<1||!this.props.service.isInRange(t,this.min,this.max)?e:`${e} - ${this.props.service.title(t)}`},this.handleTitleClick=s=>{this.canMoveUp&&this.props.bus.moveUp(this.props.activeView,s)}}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}get rangeLength(){return this.props.rangeLength!==void 0?this.props.rangeLength:ze.defaultProps.rangeLength}get canMoveUp(){return this.props.bus.canMoveUp(this.props.activeView)}render(){const s=this.getTitle(),e=d.classNames("k-calendar-title"),t={children:s,value:s,view:this.props.activeView,className:e,onClick:this.handleTitleClick,disabled:!this.canMoveUp},i=this.props.headerTitle?r.createElement(this.props.headerTitle,{...t},s):r.createElement(vs,{...t},s);return r.createElement("div",{className:d.classNames("k-calendar-header",{"k-vstack":this.props.verticalView,"k-hstack":!this.props.verticalView})},i,r.createElement("span",{className:"k-spacer"}),r.createElement("span",{className:"k-calendar-nav k-hstack"},this.props.commands))}};let xe=ze;xe.propTypes={activeView:n.number.isRequired,currentDate:n.instanceOf(Date).isRequired,max:n.instanceOf(Date).isRequired,min:n.instanceOf(Date).isRequired,rangeLength:n.number};xe.defaultProps={rangeLength:1,min:te,max:se};k.registerForLocalization(xe);const ft="multiviewcalendar.prevView",vt="multiviewcalendar.nextView",we="dateinput.increment",be="dateinput.decrement",Ke="calendar.today",je="datepicker.toggleCalendar",De="daterangepicker.swapStartEnd",Ze="daterangepicker.start",Ge="daterangepicker.end",Xe="daterangepicker.separator",ye="datetimepicker.toggleDateTimeSelector",wt="timepicker.now",bt="timepicker.selectNow",Je="timepicker.cancel",Ne="timepicker.set",Dt="timepicker.toggleTimeSelector",qe="timepicker.toggleClock",yt="datetimepicker.date",kt="datetimepicker.time",Re="datetimepicker.cancel",Fe="datetimepicker.set",St="daterangepicker.cancel",Ct="daterangepicker.set",M={[Ke]:"TODAY",[wt]:"NOW",[Ne]:"Set",[Je]:"Cancel",[yt]:"Date",[kt]:"Time",[Re]:"Cancel",[Fe]:"Set",[St]:"Cancel",[Ct]:"Set",[Ze]:"Start",[Ge]:"End",[Xe]:" ",[bt]:"Select Now",[Dt]:"Toggle TimeSelector",[qe]:"Toggle Clock",[we]:"Increase value",[be]:"Decrease value",[je]:"Toggle calendar",[ft]:"Navigate to previous view",[vt]:"Navigate to next view",[De]:"Swap start and end values",[ye]:"Toggle date-time selector"},xt=class extends r.Component{constructor(){super(...arguments),this.localization=null,this.handleClick=s=>{if(this.todayIsInRange&&this.props.onClick){const e={syntheticEvent:s,nativeEvent:s.nativeEvent,value:U(H(),this.min,this.max),target:this,isTodayClick:!0};this.props.onClick.call(void 0,e)}}}get min(){return this.props.min!==void 0?this.props.min:xt.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:xt.defaultProps.max}get todayIsInRange(){return F(H(),l.getDate(this.min),l.getDate(this.max))}render(){this.localization=k.provideLocalizationService(this);const s=this.localization.toLanguageString(Ke,M[Ke]),e=d.classNames("k-calendar-nav-today",{"k-disabled":this.props.disabled});return r.createElement(N.Button,{className:e,onClick:this.handleClick,tabIndex:this.props.tabIndex,fillMode:"flat"},s)}};let Ie=xt;Ie.propTypes={max:n.instanceOf(Date).isRequired,min:n.instanceOf(Date).isRequired,onClick:n.func,disabled:n.bool};Ie.defaultProps={min:te,max:se};k.registerForLocalization(Ie);const Ii=5,ws=class extends r.Component{constructor(s){super(s),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 e=this._element.querySelector("td.k-focus"),t=this._element.querySelector(".k-state-pending-focus");e&&e[0]&&e[0].classList.remove("k-focus"),t&&t.classList.add("k-focus"),this.isActive=!0},this.blurActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus");e&&e.classList.remove("k-focus"),this.isActive=!1},this.handleVirtualizationMount=e=>{if(this.virtualization=e,this.virtualization&&this.table){this.table.style.transform=`translateY(${this.viewOffset}px)`;const t=U(this.props.focusedDate,this.props.min,this.props.max),i=this.props.service.skip(t,this.props.min);this.virtualization.scrollToIndex(i)}},this.buildMonthView=(e,t)=>r.createElement("table",{key:"calendar-view-list-weekdays",className:"k-calendar-table k-calendar-weekdays",role:"grid",tabIndex:this.props.tabIndex},r.createElement("colgroup",null,e.map((i,a)=>r.createElement("col",{key:a}))),r.createElement("thead",{className:"k-calendar-thead"},r.createElement("tr",{className:"k-calendar-tr"},t.map((i,a)=>r.createElement("th",{key:a,className:"k-calendar-th"},i))))),this.buildDates=(e,t)=>{const i=this.props.cellUID;return r.createElement("table",{className:"k-calendar-table",ref:a=>this.table=a,role:"grid",tabIndex:this.props.tabIndex,"aria-activedescendant":i+this.props.focusedDate.getTime()},r.createElement("colgroup",null,e.map((a,o)=>r.createElement("col",{key:o}))),t.map(a=>r.createElement(Le,{ref:o=>{this.calendarView||(this.calendarView=o)},key:a.getTime(),activeView:this.props.activeView,viewDate:a,min:this.props.min,max:this.props.max,cellUID:i,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 e=this.props.activeView===S.month?this.props.dom.scrollableContentHeight:this.props.dom.scrollableYearContentHeight;this.bottomOffset=e-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=(e,t)=>Math.min(t-e,this.take),this.handleScrollAction=({index:e,scrollAction:t,pageAction:i})=>{const a=i?i.skip:this.state.skip;if((this.state.index!==e||this.state.skip!==a)&&this.setState({index:e,skip:a}),this.table&&t){const o=`translateY(${t.offset}px)`;this.table.style.transform=o}},this.handleTodayClick=e=>{this.shouldScroll=!0,this.handleDateChange.call(void 0,e,!0)},this.handleDateChange=(e,t=!1)=>{const{onChange:i}=this.props;if(i){const a={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:l.cloneDate(e.value),target:this,isTodayClick:t};i.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=k.provideIntlService(this);const s=ls(this.intl.dateFormatNames({nameType:"short",type:"days"}),this.intl.firstDay());return this.weekNumber?[""].concat(s):s}get weekNumber(){return!!(this.props.showWeekNumbers&&this.props.activeView===S.month)}get take(){return this.props.take!==void 0?this.props.take:ws.defaultProps.take}get animate(){return!!(this.props.smoothScroll&&this.animateToIndex)}get todayIsInRange(){return F(H(),l.getDate(this.props.min),l.getDate(this.props.max))}componentDidUpdate(s,e){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 s=this.lastView!==this.props.activeView,e=U(this.props.focusedDate,this.props.min,this.props.max),t=s?this.props.service.skip(e,this.props.min):this.state.skip,i=this.props.service.total(this.props.min,this.props.max),a=this.getTake(t,i),o=this.props.service.addToDate(this.props.min,t),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,e)||this.shouldScroll||!this.props.shouldScroll||this.props.shouldScroll())&&(this.indexToScroll=this.props.service.skip(e,this.props.min)),this.lastFocus=e;const p=d.classNames("k-calendar-view k-vstack",{"k-calendar-monthview":this.props.activeView===S.month,"k-calendar-yearview":this.props.activeView===S.year,"k-calendar-decadeview":this.props.activeView===S.decade,"k-calendar-centuryview":this.props.activeView===S.century}),m=this.buildDates(u,this.props.service.datesList(o,a)),g=r.createElement(r.Fragment,null,r.createElement(xe,{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:r.createElement(r.Fragment,null,r.createElement(Ie,{min:this.props.min,max:this.props.max,onClick:this.handleTodayClick,disabled:!this.todayIsInRange,tabIndex:this.props.tabIndex}))}),this.props.activeView===S.month&&this.buildMonthView(u,this.weekNames),r.createElement(Ce,{key:"calendar-view-list-content",skip:t,take:this.take,total:i,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 r.createElement("div",{ref:f=>{this._element=f},className:p},this.props.dom.didCalculate?g:null)}};let _e=ws;_e.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};_e.defaultProps={take:Ii,showWeekNumbers:!1,smoothScroll:!0};k.registerForIntl(_e);class bs extends r.Component{constructor(){super(...arguments),this.handleClick=e=>{const{onClick:t,value:i}=this.props;t&&t.call(void 0,i,e)}}render(){const{isRangeStart:e,value:t,text:i,...a}=this.props;return r.createElement("li",{...a,onClick:this.handleClick},r.createElement("span",{className:d.classNames({"k-calendar-navigation-marker":e})},this.props.children))}}const Mi=30,Ds=class extends r.Component{constructor(s){super(s),this.virtualization=null,this.list=null,this.itemHeight=0,this.topOffset=0,this.maxViewHeight=0,this.bottomOffset=0,this.handleVirtualizationMount=i=>{if(this.virtualization=i,this.virtualization&&this.list){this.list.style.transform=`translateY(${this.topOffset}px)`;const a=U(this.props.focusedDate,this.props.min,this.props.max),o=this.props.service.skip(a,this.props.min);this.virtualization.scrollToIndex(o)}},this.buildNavigationItem=i=>{const a=this.props.service.navigationTitle(i),o=this.props.service.isRangeStart(i),h=`kendo-react-calendar-nav-item-${i.getTime()}`,u={text:a,value:i,isRangeStart:o,view:this.props.activeView,onClick:this.handleDateChange};return this.props.navigationItem?r.createElement(this.props.navigationItem,{...u,key:h},a):r.createElement(bs,{...u,key:h},a)},this.calculateHeights=()=>{const i=this.props.dom.calendarHeight;this.itemHeight=this.props.dom.navigationItemHeight||1,this.maxViewHeight=this.props.dom.monthViewHeight,this.topOffset=(i-this.itemHeight)/2,this.bottomOffset=i-this.itemHeight},this.handleDateChange=(i,a)=>{const{onChange:o}=this.props;if(o&&a){const h={value:l.cloneDate(i),target:this,nativeEvent:a&&a.nativeEvent,syntheticEvent:a};o.call(void 0,h)}},this.handleScrollAction=({scrollAction:i,pageAction:a})=>{const o=a?a.skip:this.state.skip;if(this.state.skip!==o&&this.setState({skip:o}),this.list&&i){const h=`translateY(${i.offset}px)`;this.list.style.transform=h}},this.lastView=this.props.activeView,this.lastFocus=this.props.focusedDate;const e=this.props.service.skip(this.props.focusedDate,this.props.min),t=this.props.service.total(this.props.min,this.props.max);this.state={skip:e-this.getTake(e,t)>0?e:0}}get take(){return this.props.take!==void 0?this.props.take:Ds.defaultProps.take}componentDidUpdate(s,e){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 s=this.lastView!==this.props.activeView,e=U(this.props.focusedDate,this.props.min,this.props.max),t=s?this.props.service.skip(e,this.props.min):this.state.skip,i=this.props.service.total(this.props.min,this.props.max),a=this.getTake(t,i),o=this.props.service.addToDate(this.props.min,t),h=this.props.service.datesList(o,a);(this.props.activeView!==this.lastView||!l.isEqual(e,this.lastFocus))&&(this.indexToScroll=this.props.service.skip(e,this.props.min));const u=r.createElement(Ce,{skip:t,take:this.take,total:i,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},r.createElement("ul",{ref:c=>{this.list=c},className:"k-reset"},h.map(c=>this.buildNavigationItem(c))));return r.createElement("div",{className:"k-calendar-navigation"},r.createElement("span",{className:"k-calendar-navigation-highlight"}),this.props.dom.didCalculate?u:null)}getTake(s,e){return Math.min(e-s,this.take)}};let Vt=Ds;Vt.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};Vt.defaultProps={take:Mi};const ut=s=>s?s.virtualization:null,Wt=(s=ne.defaultProps.min,e=ne.defaultProps.max,t,i)=>i!==void 0?i!==null&&F(l.getDate(i),s,e)?i:null:t!==null&&F(l.getDate(t),s,e)?t:null,ie=class extends r.Component{constructor(s){super(s),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=t=>{this.scrollSyncService&&this.scrollSyncService.sync(ut(this.Navigation),ut(this.calendarViewList),t)},this.handleNavigationChange=t=>{if(this.props.disabled)return;this.didNavigationChange=!0;const i=l.cloneDate(t.value);this.setState({focusedDate:i})},this.handleViewChange=({view:t})=>{this.scrollSyncService&&this.scrollSyncService.configure(t),this.setState({activeView:t})},this.handleDateChange=t=>{const i=l.cloneDate(t.value),a=l.cloneDate(t.value),o=this.bus.canMoveDown(this.state.activeView);if(this.props.disabled)return;if(o)if(t.isTodayClick)this.bus.moveToBottom(this.state.activeView);else{this.bus.moveDown(this.state.activeView,t.syntheticEvent),this.setState({focusedDate:a});return}this.setState({value:i,focusedDate:a}),this.valueDuringOnChange=i;const{onChange:h}=this.props;if(h){const u={syntheticEvent:t.syntheticEvent,nativeEvent:t.nativeEvent,value:i,target:this};h.call(void 0,u)}this.valueDuringOnChange=void 0},this.handleFocus=t=>{if(this.isActive=!0,!this.calendarViewList)return;this.calendarViewList.focusActiveDate();const{onFocus:i}=this.props;i&&i.call(void 0,t)},this.handleBlur=t=>{if(this.isActive=!1,!this.calendarViewList)return;this.calendarViewList.blurActiveDate();const{onBlur:i}=this.props;i&&i.call(void 0,t)},this.handleKeyDown=t=>{const{keyCode:i}=t;if(!(!this.focusedDate||!this.service)){if(i===d.Keys.enter){if(this.value!==null&&l.isEqualDate(this.focusedDate,this.value)){const o=U(this.focusedDate,this.min,this.max);ut(this.calendarViewList).scrollToIndex(this.service.skip(o,this.min))}const a={syntheticEvent:t,nativeEvent:t.nativeEvent,value:this.focusedDate,target:this};this.handleDateChange(a)}else{const a=U(this.navigation.move(this.focusedDate,this.navigation.action(t),this.state.activeView,this.service,t),this.min,this.max);if(l.isEqualDate(this.focusedDate,a))return;this.setState({focusedDate:a})}t.preventDefault()}},this.handleMouseDown=t=>{t.preventDefault()},this.handleClick=t=>{this._element&&this._element.focus({preventScroll:!0})},d.validatePackage(Se);const e=Wt(this.min,this.max,this.props.defaultValue||ie.defaultProps.defaultValue,this.props.value);this.state={value:e,activeView:$e(S[s.defaultActiveView],this.bottomView,this.topView),focusedDate:U(s.focusedDate||e||H(),this.min,this.max)},this.dom=new ps,this.bus=new Et(this.handleViewChange),this.navigation=new Ot(this.bus),this.oldValue=e}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:ie.defaultProps.min)}get max(){return l.getDate(this.props.max!==void 0?this.props.max:ie.defaultProps.max)}get bottomView(){return S[this.props.bottomView!==void 0?this.props.bottomView:ie.defaultProps.bottomView]}get topView(){return S[this.props.topView!==void 0?this.props.topView:ie.defaultProps.topView]}componentDidMount(){Promise.resolve().then(()=>{d.setScrollbarWidth(),this._element&&(this.dom.calculateHeights(this._element),this.scrollSyncService=new ms(this.dom),this.scrollSyncService.configure(this.state.activeView),this.forceUpdate())})}componentDidUpdate(s,e){d.setScrollbarWidth(),e.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 s=this.value!==null&&this.oldValue!==null?!l.isEqualDate(this.value,this.oldValue):this.value!==this.oldValue,e=$e(this.state.activeView,S[this.props.bottomView!==void 0?this.props.bottomView:ie.defaultProps.bottomView],S[this.props.topView!==void 0?this.props.topView:ie.defaultProps.topView]),t=Wt(this.min,this.max,this.value,this.value),i=t?l.getDate(t):null;this.focusedDate=l.getDate(U(s&&t!==null?t:this.state.focusedDate,this.min,this.max)),this.intl=k.provideIntlService(this),this.bus.configure(this.bottomView,this.topView),this.service=this.bus.service(e,this.intl);const{smoothScroll:a=Number.parseFloat(r.version)<18}=this.props,o=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&&r.createElement(Vt,{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}),r.createElement(_e,{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:i,cellUID:this.cellUID,headerTitle:this.props.headerTitle,tabIndex:this.props.tabIndex})];return r.createElement("div",{ref:u=>{this._element=u},className:o,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 ne=ie;ne.displayName="Calendar";ne.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:(s,e,t)=>{const i=s[e],a=s.bottomView;return i&&a&&S[i]<S[a]?new Error(`Invalid prop + ${e} suplied to ${t}.
11
+ `,"k-calendar-header k-hstack"),f=()=>m([p([u([h("MO","k-calendar-th")],"k-calendar-tr")],"k-calendar-thead")],"k-calendar-table k-calendar-weekdays"),v=(y,R)=>new Array(y).fill("1").map(R),C=(y,R=1)=>m([c([u([o("1","k-calendar-td k-alt")])].concat(v(y,()=>u(v(R,ge=>o(`<span class="k-link">${ge}</span>`,"k-calendar-td")),"k-calendar-tr"))),"k-calendar-tbody")],"k-calendar-table"),I=y=>t(y,"k-content k-scrollable"),T=(y,R,ge)=>t(ge?[g(),f(),I([y,y])]:[g(),I([y,y])],R,{left:"-10000px",position:"absolute"}),b=(()=>{let y;return()=>d.canUseDOM?(y||(y=t([I([i([a("<span>FEB</span>")])])],"k-calendar-navigation",{left:"0px",position:"absolute"})),y):null})(),E=({cells:y,rows:R},ge,Us)=>{let nt;return()=>d.canUseDOM?(nt||(nt=T(C(R,y),ge,Us)),nt):null},w=y=>y.querySelector(".k-scrollable"),A=y=>{const R=w(y);return R.className=`${R.className} k-scrollable-horizontal`,y},O=E({cells:7,rows:6},"k-calendar-view k-calendar-monthview k-vstack",!0),P=E({cells:5,rows:3},"k-calendar-view k-calendar-yearview",!1),B=E({cells:5,rows:2},"k-calendar-view k-calendar-decadeview",!1),x=()=>A(O()),V=()=>A(P()),G=()=>A(B()),Y=y=>parseFloat(window.getComputedStyle(y).height)||y.offsetHeight,le=y=>{const R=window.getComputedStyle(y);return parseFloat(R.width)+parseFloat(R.paddingLeft)+parseFloat(R.paddingRight)||y.offsetWidth},me=y=>y.querySelector("tbody");this.didCalculate=!0,e&&(this.hostContainer=e),this.batch(O(),y=>{const R=me(y);this.calendarHeight=Y(y),this.monthViewHeight=Y(R),this.headerHeight=Y(R.children[0]),this.scrollableContentHeight=Y(w(y))}),this.batch(x(),y=>{const R=me(y);this.calendarWidth=le(y),this.monthViewWidth=le(R),this.scrollableContentWidth=le(w(y))}),this.batch(P(),y=>{this.yearViewHeight=Y(me(y)),this.scrollableYearContentHeight=Y(w(y))}),this.batch(V(),y=>{this.yearViewWidth=le(me(y))}),this.batch(B(),y=>{this.decadeViewHeight=Y(me(y)),this.centuryViewHeight=this.decadeViewHeight}),this.batch(G(),y=>{this.decadeViewWidth=le(me(y)),this.centuryViewWidth=this.decadeViewWidth}),this.batch(b(),y=>{this.navigationItemHeight=Y(y.querySelector("li"))})}viewHeight(e){return this.viewDimension(e,"height")}viewWidth(e){return this.viewDimension(e,"width")}viewDimension(e,t){const i=t==="height"?"ViewHeight":"ViewWidth";switch(e){case S.month:return this[`month${i}`];case S.year:return this[`year${i}`];case S.decade:return this[`decade${i}`];case S.century:return this[`century${i}`];default:return 1}}batch(e,t){const i=this.hostContainer||document.body,a=i.appendChild(e);t(a),i.removeChild(a)}};const ki={33:D.PrevView,34:D.NextView,35:D.LastInView,36:D.FirstInView,37:D.Left,38:D.Up,39:D.Right,40:D.Down,"meta+38":D.UpperView,"meta+40":D.LowerView};class Ot{constructor(e){this.bus=e}action(e){const t=`${e.ctrlKey||e.metaKey?"meta+":""}${e.keyCode}`;return ki[t]}move(e,t,i,a,o){return a?t===D.UpperView&&this.bus.canMoveUp(i)?(this.bus.moveUp(i,o),e):t===D.LowerView&&this.bus.canMoveDown(i)?(this.bus.moveDown(i,o),e):a.move(e,t):e}}const Si=s=>e=>Math.floor(e/s),Ci=s=>e=>e*s;class ps{constructor(e){this.dom=e,this.divideByMagnitude=null,this.powerByMagnitude=null,this.navigator=null,this.view=null,this.monthScrolled=!1,this.navScrolled=!1}configure(e){const t=Math.max(this.dom.viewHeight(e)/this.dom.navigationItemHeight,1);this.divideByMagnitude=Si(t),this.powerByMagnitude=Ci(t)}sync(e,t,i){if(!(!e||!t)){if(this.navigator=e,this.view=t,i.target===this.navigator.element){if(this.monthScrolled){this.monthScrolled=!1;return}this.navScrolled=!0,this.scrollSiblingOf(this.navigator.element)}if(i.target===this.view.element){if(this.navScrolled){this.navScrolled=!1;return}this.monthScrolled=!0,this.scrollSiblingOf(this.view.element)}}}scrollSiblingOf(e){const t=this.siblingComponent(e),i=this.calculateScroll(t,e.scrollTop);t.scrollTo(i)}siblingComponent(e){return this.navigator.element===e?this.view:this.navigator}calculateScroll(e,t){const i=e===this.navigator?this.divideByMagnitude:this.powerByMagnitude;return i?i(t):0}}class ms{constructor(e){this.intl=e}getWeekNames(e=!1){const t=rs(this.intl.dateFormatNames({nameType:"short",type:"days"}),this.intl.firstDay());return e?[""].concat(t):t}}const qt=s=>r.createElement("td",{key:s,className:"k-calendar-td"}," "),gs=class extends r.Component{constructor(){super(...arguments),this.intl=null,this.weekService=null,this.buildWeekNumber=(s,e)=>{if(!this.firstDate(s))return qt(`week-cell-${e}`);const i=this.firstDate(s),a=this.getWeekNumber(i),o=`kendo-react-calendar-week-cell-${a}`,h={className:"k-alt",value:a,firstDate:i};return this.props.weekCell?r.createElement(this.props.weekCell,{...h,key:o},a):r.createElement(ns,{...h,key:o},a)},this.buildRow=s=>s.map((e,t)=>{if(!e)return qt(t);const i={"aria-selected":e.isSelected},a=`kendo-react-calendar-cell-${e.value.getTime()}`,o={...i,...e,isDisabled:!e.isInRange,view:this.props.activeView,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave};return this.props.cell?r.createElement(this.props.cell,{...o,key:a},e.formattedValue):r.createElement(is,{...o,key:a},e.formattedValue)}),this.firstDate=s=>{const e=this.firstWeekDateContext(s);return e?e.value:null},this.firstWeekDateContext=s=>{if(!this.weekNumber)return null;let e=0,t=s[e];for(;!t&&e<s.length;)t=s[++e];return t},this.handleClick=(s,e)=>{const{onChange:t}=this.props;if(t&&e){const i={value:l.cloneDate(s),target:this,nativeEvent:e&&e.nativeEvent,syntheticEvent:e};t.call(void 0,i)}},this.handleMouseEnter=s=>{const{onCellEnter:e}=this.props;e&&e.call(void 0,l.cloneDate(s))},this.handleMouseLeave=s=>{const{onCellLeave:e}=this.props;e&&e.call(void 0,l.cloneDate(s))}}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===S.month}get weekNumber(){return!!(this.props.showWeekNumbers&&this.props.activeView===S.month)}get selectedDate(){return this.props.selectedDate!==void 0?this.props.selectedDate:gs.defaultProps.selectedDate}render(){this.intl=k.provideIntlService(this),this.weekService=new ms(this.intl);const s=this.weekService.getWeekNames(this.weekNumber),e=this.props.service.rowLength(this.weekNumber),t=this.props.service.title(this.props.viewDate),i=H(),a=q(this.props.viewDate,i),o=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 r.createElement(r.Fragment,null,this.isMonthView&&this.isHorizontal&&r.createElement("thead",{role:"rowgroup",className:"k-calendar-thead"},r.createElement("tr",{role:"row",className:"k-calendar-tr"},s.map((h,u)=>r.createElement("th",{key:u,className:"k-calendar-th"},h)))),r.createElement("tbody",{role:"rowgroup",className:"k-calendar-tbody"},!this.isHorizontal&&r.createElement("tr",{role:"presentation",className:"k-calendar-tr"},r.createElement("th",{scope:"col",colSpan:e,className:"k-calendar-caption"},t)),o.map((h,u)=>r.createElement("tr",{role:"row",className:"k-calendar-tr",key:u},this.weekNumber&&this.buildWeekNumber(h,u),this.buildRow(h)))))}getWeekNumber(s){return!this.weekNumber||!this.intl?null:l.weekInYear(s,this.intl.firstDay())}};let Le=gs;Le.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};Le.defaultProps={direction:"vertical",selectedDate:H(),showWeekNumbers:!1};k.registerForIntl(Le);class fs extends r.PureComponent{render(){const{view:e,...t}=this.props;return r.createElement(N.Button,{type:"button",fillMode:"flat",...t},this.props.children)}}const ze=class extends r.Component{constructor(){super(...arguments),this.getTitle=()=>{if(!this.props.currentDate)return"";const s=this.rangeLength-1,e=this.props.service.title(this.props.currentDate),t=this.props.service.addToDate(this.props.currentDate,s);return s<1||!this.props.service.isInRange(t,this.min,this.max)?e:`${e} - ${this.props.service.title(t)}`},this.handleTitleClick=s=>{this.canMoveUp&&this.props.bus.moveUp(this.props.activeView,s)}}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}get rangeLength(){return this.props.rangeLength!==void 0?this.props.rangeLength:ze.defaultProps.rangeLength}get canMoveUp(){return this.props.bus.canMoveUp(this.props.activeView)}render(){const s=this.getTitle(),e=d.classNames("k-calendar-title"),t={children:s,value:s,view:this.props.activeView,className:e,onClick:this.handleTitleClick,disabled:!this.canMoveUp},i=this.props.headerTitle?r.createElement(this.props.headerTitle,{...t},s):r.createElement(fs,{...t},s);return r.createElement("div",{className:d.classNames("k-calendar-header",{"k-vstack":this.props.verticalView,"k-hstack":!this.props.verticalView})},i,r.createElement("span",{className:"k-spacer"}),r.createElement("span",{className:"k-calendar-nav k-hstack"},this.props.commands))}};let xe=ze;xe.propTypes={activeView:n.number.isRequired,currentDate:n.instanceOf(Date).isRequired,max:n.instanceOf(Date).isRequired,min:n.instanceOf(Date).isRequired,rangeLength:n.number};xe.defaultProps={rangeLength:1,min:te,max:se};k.registerForLocalization(xe);const ft="multiviewcalendar.prevView",vt="multiviewcalendar.nextView",we="dateinput.increment",be="dateinput.decrement",Ke="calendar.today",je="datepicker.toggleCalendar",De="daterangepicker.swapStartEnd",Ze="daterangepicker.start",Ge="daterangepicker.end",Xe="daterangepicker.separator",ye="datetimepicker.toggleDateTimeSelector",wt="timepicker.now",bt="timepicker.selectNow",Je="timepicker.cancel",Ne="timepicker.set",Dt="timepicker.toggleTimeSelector",qe="timepicker.toggleClock",yt="datetimepicker.date",kt="datetimepicker.time",Re="datetimepicker.cancel",Fe="datetimepicker.set",St="daterangepicker.cancel",Ct="daterangepicker.set",M={[Ke]:"TODAY",[wt]:"NOW",[Ne]:"Set",[Je]:"Cancel",[yt]:"Date",[kt]:"Time",[Re]:"Cancel",[Fe]:"Set",[St]:"Cancel",[Ct]:"Set",[Ze]:"Start",[Ge]:"End",[Xe]:" ",[bt]:"Select Now",[Dt]:"Toggle TimeSelector",[qe]:"Toggle Clock",[we]:"Increase value",[be]:"Decrease value",[je]:"Toggle calendar",[ft]:"Navigate to previous view",[vt]:"Navigate to next view",[De]:"Swap start and end values",[ye]:"Toggle date-time selector"},xt=class extends r.Component{constructor(){super(...arguments),this.localization=null,this.handleClick=s=>{if(this.todayIsInRange&&this.props.onClick){const e={syntheticEvent:s,nativeEvent:s.nativeEvent,value:U(H(),this.min,this.max),target:this,isTodayClick:!0};this.props.onClick.call(void 0,e)}}}get min(){return this.props.min!==void 0?this.props.min:xt.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:xt.defaultProps.max}get todayIsInRange(){return F(H(),l.getDate(this.min),l.getDate(this.max))}render(){this.localization=k.provideLocalizationService(this);const s=this.localization.toLanguageString(Ke,M[Ke]),e=d.classNames("k-calendar-nav-today",{"k-disabled":this.props.disabled});return r.createElement(N.Button,{className:e,onClick:this.handleClick,tabIndex:this.props.tabIndex,fillMode:"flat"},s)}};let Ie=xt;Ie.propTypes={max:n.instanceOf(Date).isRequired,min:n.instanceOf(Date).isRequired,onClick:n.func,disabled:n.bool};Ie.defaultProps={min:te,max:se};k.registerForLocalization(Ie);const xi=5,vs=class extends r.Component{constructor(s){super(s),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 e=this._element.querySelector("td.k-focus"),t=this._element.querySelector(".k-state-pending-focus");e&&e[0]&&e[0].classList.remove("k-focus"),t&&t.classList.add("k-focus"),this.isActive=!0},this.blurActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus");e&&e.classList.remove("k-focus"),this.isActive=!1},this.handleVirtualizationMount=e=>{if(this.virtualization=e,this.virtualization&&this.table){this.table.style.transform=`translateY(${this.viewOffset}px)`;const t=U(this.props.focusedDate,this.props.min,this.props.max),i=this.props.service.skip(t,this.props.min);this.virtualization.scrollToIndex(i)}},this.buildMonthView=(e,t)=>r.createElement("table",{key:"calendar-view-list-weekdays",className:"k-calendar-table k-calendar-weekdays",role:"grid",tabIndex:this.props.tabIndex},r.createElement("colgroup",null,e.map((i,a)=>r.createElement("col",{key:a}))),r.createElement("thead",{className:"k-calendar-thead"},r.createElement("tr",{className:"k-calendar-tr"},t.map((i,a)=>r.createElement("th",{key:a,className:"k-calendar-th"},i))))),this.buildDates=(e,t)=>{const i=this.props.cellUID;return r.createElement("table",{className:"k-calendar-table",ref:a=>this.table=a,role:"grid",tabIndex:this.props.tabIndex,"aria-activedescendant":i+this.props.focusedDate.getTime()},r.createElement("colgroup",null,e.map((a,o)=>r.createElement("col",{key:o}))),t.map(a=>r.createElement(Le,{ref:o=>{this.calendarView||(this.calendarView=o)},key:a.getTime(),activeView:this.props.activeView,viewDate:a,min:this.props.min,max:this.props.max,cellUID:i,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 e=this.props.activeView===S.month?this.props.dom.scrollableContentHeight:this.props.dom.scrollableYearContentHeight;this.bottomOffset=e-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=(e,t)=>Math.min(t-e,this.take),this.handleScrollAction=({index:e,scrollAction:t,pageAction:i})=>{const a=i?i.skip:this.state.skip;if((this.state.index!==e||this.state.skip!==a)&&this.setState({index:e,skip:a}),this.table&&t){const o=`translateY(${t.offset}px)`;this.table.style.transform=o}},this.handleTodayClick=e=>{this.shouldScroll=!0,this.handleDateChange.call(void 0,e,!0)},this.handleDateChange=(e,t=!1)=>{const{onChange:i}=this.props;if(i){const a={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:l.cloneDate(e.value),target:this,isTodayClick:t};i.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=k.provideIntlService(this);const s=rs(this.intl.dateFormatNames({nameType:"short",type:"days"}),this.intl.firstDay());return this.weekNumber?[""].concat(s):s}get weekNumber(){return!!(this.props.showWeekNumbers&&this.props.activeView===S.month)}get take(){return this.props.take!==void 0?this.props.take:vs.defaultProps.take}get animate(){return!!(this.props.smoothScroll&&this.animateToIndex)}get todayIsInRange(){return F(H(),l.getDate(this.props.min),l.getDate(this.props.max))}componentDidUpdate(s,e){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 s=this.lastView!==this.props.activeView,e=U(this.props.focusedDate,this.props.min,this.props.max),t=s?this.props.service.skip(e,this.props.min):this.state.skip,i=this.props.service.total(this.props.min,this.props.max),a=this.getTake(t,i),o=this.props.service.addToDate(this.props.min,t),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,e)||this.shouldScroll||!this.props.shouldScroll||this.props.shouldScroll())&&(this.indexToScroll=this.props.service.skip(e,this.props.min)),this.lastFocus=e;const p=d.classNames("k-calendar-view k-vstack",{"k-calendar-monthview":this.props.activeView===S.month,"k-calendar-yearview":this.props.activeView===S.year,"k-calendar-decadeview":this.props.activeView===S.decade,"k-calendar-centuryview":this.props.activeView===S.century}),m=this.buildDates(u,this.props.service.datesList(o,a)),g=r.createElement(r.Fragment,null,r.createElement(xe,{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:r.createElement(r.Fragment,null,r.createElement(Ie,{min:this.props.min,max:this.props.max,onClick:this.handleTodayClick,disabled:!this.todayIsInRange,tabIndex:this.props.tabIndex}))}),this.props.activeView===S.month&&this.buildMonthView(u,this.weekNames),r.createElement(Ce,{key:"calendar-view-list-content",skip:t,take:this.take,total:i,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 r.createElement("div",{ref:f=>{this._element=f},className:p},this.props.dom.didCalculate?g:null)}};let _e=vs;_e.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};_e.defaultProps={take:xi,showWeekNumbers:!1,smoothScroll:!0};k.registerForIntl(_e);class ws extends r.Component{constructor(){super(...arguments),this.handleClick=e=>{const{onClick:t,value:i}=this.props;t&&t.call(void 0,i,e)}}render(){const{isRangeStart:e,value:t,text:i,...a}=this.props;return r.createElement("li",{...a,onClick:this.handleClick},r.createElement("span",{className:d.classNames({"k-calendar-navigation-marker":e})},this.props.children))}}const Ii=30,bs=class extends r.Component{constructor(s){super(s),this.virtualization=null,this.list=null,this.itemHeight=0,this.topOffset=0,this.maxViewHeight=0,this.bottomOffset=0,this.handleVirtualizationMount=i=>{if(this.virtualization=i,this.virtualization&&this.list){this.list.style.transform=`translateY(${this.topOffset}px)`;const a=U(this.props.focusedDate,this.props.min,this.props.max),o=this.props.service.skip(a,this.props.min);this.virtualization.scrollToIndex(o)}},this.buildNavigationItem=i=>{const a=this.props.service.navigationTitle(i),o=this.props.service.isRangeStart(i),h=`kendo-react-calendar-nav-item-${i.getTime()}`,u={text:a,value:i,isRangeStart:o,view:this.props.activeView,onClick:this.handleDateChange};return this.props.navigationItem?r.createElement(this.props.navigationItem,{...u,key:h},a):r.createElement(ws,{...u,key:h},a)},this.calculateHeights=()=>{const i=this.props.dom.calendarHeight;this.itemHeight=this.props.dom.navigationItemHeight||1,this.maxViewHeight=this.props.dom.monthViewHeight,this.topOffset=(i-this.itemHeight)/2,this.bottomOffset=i-this.itemHeight},this.handleDateChange=(i,a)=>{const{onChange:o}=this.props;if(o&&a){const h={value:l.cloneDate(i),target:this,nativeEvent:a&&a.nativeEvent,syntheticEvent:a};o.call(void 0,h)}},this.handleScrollAction=({scrollAction:i,pageAction:a})=>{const o=a?a.skip:this.state.skip;if(this.state.skip!==o&&this.setState({skip:o}),this.list&&i){const h=`translateY(${i.offset}px)`;this.list.style.transform=h}},this.lastView=this.props.activeView,this.lastFocus=this.props.focusedDate;const e=this.props.service.skip(this.props.focusedDate,this.props.min),t=this.props.service.total(this.props.min,this.props.max);this.state={skip:e-this.getTake(e,t)>0?e:0}}get take(){return this.props.take!==void 0?this.props.take:bs.defaultProps.take}componentDidUpdate(s,e){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 s=this.lastView!==this.props.activeView,e=U(this.props.focusedDate,this.props.min,this.props.max),t=s?this.props.service.skip(e,this.props.min):this.state.skip,i=this.props.service.total(this.props.min,this.props.max),a=this.getTake(t,i),o=this.props.service.addToDate(this.props.min,t),h=this.props.service.datesList(o,a);(this.props.activeView!==this.lastView||!l.isEqual(e,this.lastFocus))&&(this.indexToScroll=this.props.service.skip(e,this.props.min));const u=r.createElement(Ce,{skip:t,take:this.take,total:i,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},r.createElement("ul",{ref:c=>{this.list=c},className:"k-reset"},h.map(c=>this.buildNavigationItem(c))));return r.createElement("div",{className:"k-calendar-navigation"},r.createElement("span",{className:"k-calendar-navigation-highlight"}),this.props.dom.didCalculate?u:null)}getTake(s,e){return Math.min(e-s,this.take)}};let Vt=bs;Vt.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};Vt.defaultProps={take:Ii};const ut=s=>s?s.virtualization:null,Wt=(s=ne.defaultProps.min,e=ne.defaultProps.max,t,i)=>i!==void 0?i!==null&&F(l.getDate(i),s,e)?i:null:t!==null&&F(l.getDate(t),s,e)?t:null,ie=class extends r.Component{constructor(s){super(s),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=t=>{this.scrollSyncService&&this.scrollSyncService.sync(ut(this.Navigation),ut(this.calendarViewList),t)},this.handleNavigationChange=t=>{if(this.props.disabled)return;this.didNavigationChange=!0;const i=l.cloneDate(t.value);this.setState({focusedDate:i})},this.handleViewChange=({view:t})=>{this.scrollSyncService&&this.scrollSyncService.configure(t),this.setState({activeView:t})},this.handleDateChange=t=>{const i=l.cloneDate(t.value),a=l.cloneDate(t.value),o=this.bus.canMoveDown(this.state.activeView);if(this.props.disabled)return;if(o)if(t.isTodayClick)this.bus.moveToBottom(this.state.activeView);else{this.bus.moveDown(this.state.activeView,t.syntheticEvent),this.setState({focusedDate:a});return}this.setState({value:i,focusedDate:a}),this.valueDuringOnChange=i;const{onChange:h}=this.props;if(h){const u={syntheticEvent:t.syntheticEvent,nativeEvent:t.nativeEvent,value:i,target:this};h.call(void 0,u)}this.valueDuringOnChange=void 0},this.handleFocus=t=>{if(this.isActive=!0,!this.calendarViewList)return;this.calendarViewList.focusActiveDate();const{onFocus:i}=this.props;i&&i.call(void 0,t)},this.handleBlur=t=>{if(this.isActive=!1,!this.calendarViewList)return;this.calendarViewList.blurActiveDate();const{onBlur:i}=this.props;i&&i.call(void 0,t)},this.handleKeyDown=t=>{const{keyCode:i}=t;if(!(!this.focusedDate||!this.service)){if(i===d.Keys.enter){if(this.value!==null&&l.isEqualDate(this.focusedDate,this.value)){const o=U(this.focusedDate,this.min,this.max);ut(this.calendarViewList).scrollToIndex(this.service.skip(o,this.min))}const a={syntheticEvent:t,nativeEvent:t.nativeEvent,value:this.focusedDate,target:this};this.handleDateChange(a)}else{const a=U(this.navigation.move(this.focusedDate,this.navigation.action(t),this.state.activeView,this.service,t),this.min,this.max);if(l.isEqualDate(this.focusedDate,a))return;this.setState({focusedDate:a})}t.preventDefault()}},this.handleMouseDown=t=>{t.preventDefault()},this.handleClick=t=>{this._element&&this._element.focus({preventScroll:!0})},d.validatePackage(Se);const e=Wt(this.min,this.max,this.props.defaultValue||ie.defaultProps.defaultValue,this.props.value);this.state={value:e,activeView:$e(S[s.defaultActiveView],this.bottomView,this.topView),focusedDate:U(s.focusedDate||e||H(),this.min,this.max)},this.dom=new ds,this.bus=new Et(this.handleViewChange),this.navigation=new Ot(this.bus),this.oldValue=e}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:ie.defaultProps.min)}get max(){return l.getDate(this.props.max!==void 0?this.props.max:ie.defaultProps.max)}get bottomView(){return S[this.props.bottomView!==void 0?this.props.bottomView:ie.defaultProps.bottomView]}get topView(){return S[this.props.topView!==void 0?this.props.topView:ie.defaultProps.topView]}componentDidMount(){Promise.resolve().then(()=>{d.setScrollbarWidth(),this._element&&(this.dom.calculateHeights(this._element),this.scrollSyncService=new ps(this.dom),this.scrollSyncService.configure(this.state.activeView),this.forceUpdate())})}componentDidUpdate(s,e){d.setScrollbarWidth(),e.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 s=this.value!==null&&this.oldValue!==null?!l.isEqualDate(this.value,this.oldValue):this.value!==this.oldValue,e=$e(this.state.activeView,S[this.props.bottomView!==void 0?this.props.bottomView:ie.defaultProps.bottomView],S[this.props.topView!==void 0?this.props.topView:ie.defaultProps.topView]),t=Wt(this.min,this.max,this.value,this.value),i=t?l.getDate(t):null;this.focusedDate=l.getDate(U(s&&t!==null?t:this.state.focusedDate,this.min,this.max)),this.intl=k.provideIntlService(this),this.bus.configure(this.bottomView,this.topView),this.service=this.bus.service(e,this.intl);const{smoothScroll:a=Number.parseFloat(r.version)<18}=this.props,o=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&&r.createElement(Vt,{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}),r.createElement(_e,{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:i,cellUID:this.cellUID,headerTitle:this.props.headerTitle,tabIndex:this.props.tabIndex})];return r.createElement("div",{ref:u=>{this._element=u},className:o,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 ne=ie;ne.displayName="Calendar";ne.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:(s,e,t)=>{const i=s[e],a=s.bottomView;return i&&a&&S[i]<S[a]?new Error(`Invalid prop + ${e} suplied to ${t}.
12
12
  ${e} can not be smaller than bottomView.
13
13
  `):null},bottomView:(s,e,t)=>{const i=s[e],a=s.topView;return i&&a&&S[i]>S[a]?new Error(`Invalid prop + ${e} suplied to ${t}.
14
14
  ${e} can not be bigger than topView.
15
- `):null}};ne.defaultProps={disabled:!1,min:te,max:se,navigation:!0,defaultActiveView:"month",defaultValue:null,topView:"century",bottomView:"month"};const ys=d.createPropsContext(),tt=d.withIdHOC(d.withPropsContext(ys,ne));tt.displayName="KendoReactCalendar";k.registerForIntl(ne);class Ti{constructor(){this.symbols="",this.partMap=[]}}const Ei="d",Oi="wide",Vi=(s,e,t,i)=>{const a=s[i+s.length-t.length],o=s.substring(0,i+s.length-t.length),h=t.substring(0,i),u=[];if(o===h&&i>0)return u.push([e[i-1],h[i-1]]),u;if(o.indexOf(h)===0&&(h.length===0||e[h.length-1]!==e[h.length])){let c="";h.length===1&&u.push([e[0],h[0]]);for(let p=h.length;p<o.length;p++)e[p]!==c&&e[p]!=="_"&&(c=e[p],u.push([c,""]));return u}if(h.indexOf(o)===0||e[i-1]==="_"){let c=e[0];for(let p=Math.max(0,o.length-1);p<e.length;p++)if(e[p]!=="_"){c=e[p];break}return[[c,h[i-1]]]}return h[h.length-1]===" "||h[h.length-1]===a?[[e[i-1],"_"]]:[[e[i-1],h[i-1]]]},Pi=(s,e)=>(s[e.pattern[0]]=e.type,s),Ni=(s,e,t)=>s===null||!(e&&e>s||t&&t<s),Ri=["k-widget","k-dateinput"];class Fi{constructor(e,t,i){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=e,this.formatPlaceholder=t,this.format=i,this.monthNames=this.allFormatedMonths()}get intl(){return this.intlProvider()}get value(){return this._value}setValue(e){e?l.isEqual(e,this._value)||(this._value=l.cloneDate(e),this.modifyExisting(!0)):(this._value=l.getDate(new Date),this.modifyExisting(!1))}hasValue(){const e=(t,i)=>t||i.type!=="literal"&&i.type!=="dayperiod"&&this.getExisting(i.pattern[0]);return this.intl.splitDateFormat(this.format).reduce(e,!1)}getDateObject(){for(let e=0;e<this.knownParts.length;e++)if(!this.getExisting(this.knownParts[e]))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(e){const t=this.dateFormatString(this.value,this.format).symbols;for(let i=0;i<t.length;i++)this.setExisting(t[i],e)}getExisting(e){switch(e){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(e,t){switch(e){case"y":this.year=t,t===!1&&this._value.setFullYear(2e3);break;case"M":this.month=t,t===!1&&this._value.setMonth(0);break;case"d":this.date=t;break;case"h":case"H":this.hours=t;break;case"m":this.minutes=t;break;case"s":this.seconds=t;break;default:return}}modifyPart(e,t){let i=l.cloneDate(this.value);switch(e){case"y":i.setFullYear(i.getFullYear()+t);break;case"M":i=l.addMonths(this.value,t);break;case"d":case"E":i.setDate(i.getDate()+t);break;case"h":case"H":i.setHours(i.getHours()+t);break;case"m":i.setMinutes(i.getMinutes()+t);break;case"s":i.setSeconds(i.getSeconds()+t);break;case"a":i.setHours(i.getHours()+12*t);break}this.setExisting(e,!0),this._value=i}parsePart(e,t){if(this.resetLeadingZero(),!t)return this.setExisting(e,!1),{value:null};const i=this.intl.formatDate(this.value,this.format),a=this.dateFormatString(this.value,this.format),o=a.symbols;let h=!1,u="",c="",p="";for(let f=0;f<i.length;f++)o[f]===e?(c+=this.getExisting(e)?i[f]:"0",h=!0):h?p+=i[f]:u+=i[f];let m=null;const g=this.matchMonth(t);for(;c.length>0&&c.charAt(0)==="0";)c=c.slice(1);c.length>=4&&(c="");for(let f=0;f<2;f++){let v=c+t,C=parseInt(v,10);if(m=this.intl.parseDate(u+v+p,this.format),!m&&!isNaN(C)&&!isNaN(parseInt(t,10))){if(e==="M"&&!g){const I=C-1;I>-1&&I<12&&(m=l.cloneDate(this.value),m.setMonth(I),m.getMonth()!==I&&(m=l.lastDayOfMonth(l.addMonths(m,-1))))}e==="y"&&(m=l.createDate(parseInt(v,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(e,!0),{value:this.value};c=""}return g&&(m=this.intl.parseDate(u+g+p,this.format),m)?(this._value=m,this.setExisting(e,!0),{value:this.value}):(t==="0"&&(this.leadingZero=this.isAbbrMonth(a.partMap,e)?null:{[e]:!0},this.setExisting(e,!1)),{value:null})}symbolMap(e){return this.intl.splitDateFormat(this.format).reduce(Pi,{})[e]}resetLeadingZero(){const e=this.leadingZero!==null;return this.leadingZero=null,e}isAbbrMonth(e,t){const i=this.partPattern(e,t);return i.type==="month"&&i.names}partPattern(e,t){return e.filter(i=>i.pattern.indexOf(t)!==-1)[0]}matchMonth(e){if(this.typedMonthPart+=e.toLowerCase(),this.monthNames.length===0)return"";for(;this.typedMonthPart.length>0;){for(let i=0;i<this.monthNames.length;i++)if(this.monthNames[i].toLowerCase().indexOf(this.typedMonthPart)===0)return this.monthNames[i];const t=parseInt(this.typedMonthPart,10);if(t>=1&&t<=12&&t.toString()===this.typedMonthPart)return this.monthNames[t-1];this.typedMonthPart=this.typedMonthPart.substring(1,this.typedMonthPart.length)}return""}allFormatedMonths(){const e=this.intl.splitDateFormat(this.format);for(let t=0;t<e.length;t++)if(e[t].type==="month"&&e[t].names)return this.intl.dateFormatNames(e[t].names);return[]}dateFormatString(e,t){const i=this.intl.splitDateFormat(t),a=[],o=[];for(let u=0;u<i.length;u++){let c=this.intl.formatDate(e,{pattern:i[u].pattern}).length;for(;c>0;)a.push(this.symbols[i[u].pattern[0]]||"_"),o.push(i[u]),c--}const h=new Ti;return h.symbols=a.join(""),h.partMap=o,h}merge(e,t){let i="",a="",o=t.symbols;for(let h=o.length-1;h>=0;h--)if(this.knownParts.indexOf(o[h])===-1||this.getExisting(o[h]))i=e[h]+i,a=o[h]+a;else{const u=o[h];for(;h>=0&&u===o[h];)h--;for(h++,this.leadingZero&&this.leadingZero[u]?i="0"+i:i=this.dateFieldName(t.partMap[h])+i;a.length<i.length;)a=o[h]+a}return{text:i,format:a}}dateFieldName(e){const t=this.formatPlaceholder||"wide";return t[e.type]?t[e.type]:t==="formatPattern"?e.pattern:this.intl.dateFieldName(Object.assign(e,{nameType:t}))}}const j={dayperiod:"dayperiod",hour:"hour",millisecond:"millisecond",minute:"minute",second:"second"},Pt=s=>(e,t)=>{const i=l.cloneDate(e);return i[s](t),i},ks=[{type:j.hour,getter:s=>s.getHours()},{type:j.minute,getter:s=>s.getMinutes()},{type:j.second,getter:s=>s.getSeconds()},{type:j.millisecond,getter:s=>s.getMilliseconds()}],Li=s=>(e,t)=>s(e),_i=s=>(e,t)=>s(t),Hi=s=>s.reduce((e,t)=>(e[t.type]=t.type,e),{}),Ai=s=>e=>s[e.type]?_i(e.getter):Li(e.getter),Bi=s=>e=>s.map(Ai(Hi(e))),zi=(s,e,t,i)=>a=>{const o=s(a),h=s(t);return i==="hour"?o-(o-h)%e:a.getTime()<=t.getTime()&&o!==0&&o<=h?Math.ceil(o/e)*e:o-o%e},qi=s=>(e,t)=>s.map(i=>{const a=Math.floor(e[i.type]);return a?zi(i.getter,a,t,i.type):i.getter}),Wi=Bi(ks),Ut=qi(ks),Ui=s=>(e,t)=>(e.setHours(...s.map(i=>i(e,t))),e),Yt=s=>e=>{const t=l.cloneDate(e);return t.setHours(...s.map(i=>i(t))),t},We=Pt("setHours"),Ue=Pt("setMinutes"),Ye=Pt("setSeconds"),ue=()=>new Date,Nt=(s,e,t=1)=>{const i=[];for(let a=s;a<e;a=a+t)i.push(a);return i},Rt=(s,e,t)=>({candidateValue:q(L,s),maxValue:l.addDays(q(L,t),e.getHours()<t.getHours()?0:1),minValue:q(L,e)}),Yi=(s,e,t)=>{if(!s||!e||!t)return s;const{candidateValue:i,minValue:a,maxValue:o}=Rt(s,e,t);return i<a?q(s,e):i>o?q(s,t):s},Ft=(s,e,t)=>{if(!s||!e||!t)return!0;const{candidateValue:i,minValue:a,maxValue:o}=Rt(s,e,t);return a<=i&&i<=o},$i=(s,e,t)=>{if(s===null)return!0;const{candidateValue:i,minValue:a,maxValue:o}=Rt(s,e,t);return a<=i&&i<=o},Ki=(s,e)=>{if(s===null||e===null)return!1;const t=q(L,s),i=q(L,e);return t.getTime()<i.getHours()},ji=(s,e)=>{if(s===null||e===null)return!1;const t=q(L,s);return q(L,e).getTime()<t.getHours()},Zi="Please enter a valid value!",$=class extends r.Component{constructor(s){super(s),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||$.defaultProps.validationMessage)},this.updateOnPaste=e=>{if(!this.element||!this.kendoDate)return;const t=k.provideIntlService(this).parseDate(this.element.value,this.props.format)||this.value,i=this.value;this.kendoDate.setValue(t),this.triggerChange(e,i)},this.spinnersMouseDown=e=>{e.preventDefault();const t=d.getActiveElement(document);this.element&&t!==this.element&&this.element.focus({preventScroll:!0})},this.handlePaste=()=>{this.paste=!0},this.elementChange=e=>{if(!this.element||!this.kendoDate)return;if(this.paste){this.updateOnPaste(e),this.paste=!1;return}const{text:t,format:i}=this.kendoDate.getTextAndFormat();this.currentFormat=i;const a=this.value,o=Vi(t,this.currentFormat,this.element.value,this.selection.start),h=o.length===1&&o[0][1]==="_";if(!h)for(let u=0;u<o.length;u++)this.kendoDate.parsePart(o[u][0],o[u][1]);o.length&&o[0][0]!=="_"&&this.setSelection(this.selectionBySymbol(o[0][0])),h&&this.switchDateSegment(1),this.triggerChange(e,a)},this.elementClick=e=>{this.setSelection(this.selectionByIndex(this.selection.start))},this.nativeWheel=e=>{d.getActiveElement(document)===this.element&&e.preventDefault()},this.wheel=e=>{d.getActiveElement(document)===this.element&&(e.nativeEvent.deltaY<0&&this.increasePart(e),e.nativeEvent.deltaY>0&&this.decreasePart(e))},this.increasePart=e=>{this.modifyDateSegmentValue(1,e)},this.decreasePart=e=>{this.modifyDateSegmentValue(-1,e)},this.elementKeyDown=e=>{if(!e.altKey){switch(e.keyCode){case 37:this.switchDateSegment(-1);break;case 38:this.modifyDateSegmentValue(1,e);break;case 39:this.switchDateSegment(1);break;case 40:this.modifyDateSegmentValue(-1,e);break;default:return}e.preventDefault()}},this.elementOnFocus=e=>{this.wrapper&&this.wrapper.classList.add("k-focus"),this.setState({focused:!0})},this.elementOnBlur=e=>{this.wrapper&&this.wrapper.classList.remove("k-focus"),this.setState({focused:!1})},d.validatePackage(Se),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(s,e){this._lastSelectedSymbol&&e.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:s=$.defaultProps.size,fillMode:e=$.defaultProps.fillMode,rounded:t=$.defaultProps.rounded}=this.props;this.props._ref&&(this.props._ref.current=this);const i=k.provideLocalizationService(this),a={...$.defaultProps,...this.props},{name:o,label:h,id:u}=a,c=this.text,p=c===this.props.placeholder?"":c,m=c===this.props.placeholder?c:void 0,g=u||this._inputId,f=!this.validityStyles||this.validity.valid;let v=[...Ri];this.props.className&&v.push(this.props.className);const C=r.createElement(d.AsyncFocusBlur,{onFocus:this.elementOnFocus,onBlur:this.elementOnBlur},({onFocus:I,onBlur:T})=>r.createElement("span",{ref:b=>{this._wrapper=b},style:h?void 0:{width:this.props.width},dir:this.props.dir,className:d.classNames("k-dateinput","k-input",{[`k-input-${d.kendoThemeMaps.sizeMap[s]||s}`]:s,[`k-input-${e}`]:e,[`k-rounded-${d.kendoThemeMaps.roundedMap[t]||t}`]:t,"k-invalid":!f,"k-required":this.required,"k-disabled":this.props.disabled},this.props.className),onFocus:I,onBlur:T},r.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:g,"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:o,ref:b=>this._element=b}),this.props.children,this.props.spinners&&r.createElement("span",{className:"k-input-spinner k-spin-button",onMouseDown:this.spinnersMouseDown},r.createElement(N.Button,{tabIndex:-1,type:"button",rounded:null,className:"k-spinner-increase",icon:"caret-alt-up",svgIcon:J.caretAltUpIcon,"aria-label":i.toLanguageString(we,M[we]),title:i.toLanguageString(we,M[we]),onClick:this.increasePart}),r.createElement(N.Button,{tabIndex:-1,type:"button",rounded:null,className:"k-spinner-decrease",icon:"caret-alt-down",svgIcon:J.caretAltDownIcon,"aria-label":i.toLanguageString(be,M[be]),title:i.toLanguageString(be,M[be]),onClick:this.decreasePart}))));return h?r.createElement(ss.FloatingLabel,{label:h,editorId:g,editorValue:c,editorValid:f,editorDisabled:this.props.disabled,children:C,style:{width:this.props.width}}):C}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:$.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:$.defaultProps.max}get text(){const s={...ae.defaultProps,...this.props},{formatPlaceholder:e=$.defaultProps.formatPlaceholder,format:t=$.defaultProps.format,value:i,defaultValue:a}=s;this.kendoDate===null?(this.kendoDate=new Fi(this.intl.bind(this),e,t),this.kendoDate.setValue(i||a||null)):(this.kendoDate.format=t,this.kendoDate.formatPlaceholder=e),i!==void 0&&this.value!==i&&this.kendoDate.setValue(i);const{text:o,format:h}=this.kendoDate.getTextAndFormat();return this.currentFormat=h,s.placeholder!==null&&s.placeholder!==void 0&&!this.state.focused&&!this.kendoDate.hasValue()?s.placeholder:o}get validity(){const s=Ni(this.value,this.min,this.max)&&Ft(this.value,this.props.minTime,this.props.maxTime),e=this.props.validationMessage!==void 0,t=(!this.required||this.value!==null)&&s,i=this.props.valid!==void 0?this.props.valid:t;return{customError:e,rangeOverflow:this.value&&this.max.getTime()<this.value.getTime()||!1,rangeUnderflow:this.value&&this.value.getTime()<this.min.getTime()||!1,valid:i,valueMissing:this.value===null}}get element(){return this._element}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:$.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:$.defaultProps.required}get wrapper(){return this._wrapper}intl(){return k.provideIntlService(this)}get selection(){let s={start:0,end:0};return this.element!==null&&this.element.selectionStart!==void 0&&(s={start:this.element.selectionStart,end:this.element.selectionEnd}),s}setSelection(s){this._lastSelectedSymbol=this.currentFormat[s.start],window.requestAnimationFrame(()=>{const e=d.getActiveElement(document);this.element&&e===this.element&&!this.props.disableSelection&&this.element.setSelectionRange(s.start,s.end)})}triggerChange(s,e){this.valueDuringOnChange=this.value,this.forceUpdate(),this.props.onChange&&!l.isEqual(e,this.value)&&this.props.onChange.call(void 0,{syntheticEvent:s,nativeEvent:s.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0}selectionBySymbol(s){let e=-1,t=0;for(let i=0;i<this.currentFormat.length;i++)this.currentFormat[i]===s&&(t=i+1,e===-1&&(e=i));return e<0&&(e=0),{start:e,end:t}}selectionByIndex(s){let e={start:s,end:s};for(let t=s,i=s-1;t<this.currentFormat.length||i>=0;t++,i--){if(t<this.currentFormat.length&&this.currentFormat[t]!=="_"){e=this.selectionBySymbol(this.currentFormat[t]);break}if(i>=0&&this.currentFormat[i]!=="_"){e=this.selectionBySymbol(this.currentFormat[i]);break}}return e}switchDateSegment(s){const{start:e,end:t}=this.selection;if(e<t&&this.currentFormat[e]!==this.currentFormat[t-1]){this.setSelection(this.selectionByIndex(s>0?e:t-1));return}const i=this.currentFormat[e];let a=e+s;for(;a>0&&a<this.currentFormat.length&&!(this.currentFormat[a]!==i&&this.currentFormat[a]!=="_");)a+=s;if(this.currentFormat[a]==="_")return;let o=a;for(;o>=0&&o<this.currentFormat.length&&this.currentFormat[o]===this.currentFormat[a];)o+=s;a>o&&(o+1!==e||a+1!==t)?this.setSelection({start:o+1,end:a+1}):a<o&&(a!==e||o!==t)&&this.setSelection({start:a,end:o})}modifyDateSegmentValue(s,e){if(!this.kendoDate)return;const t=this.value,i=this.currentFormat[this.selection.start],a=this.kendoDate.symbolMap(i),o=((this.props.steps||{})[a]||1)*s;this.kendoDate.modifyPart(i,o),this.triggerChange(e,t)}};let re=$;re.displayName="DateInput";re.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"])};re.defaultProps={format:Ei,size:"medium",rounded:"medium",fillMode:"solid",formatPlaceholder:Oi,spinners:!1,disabled:!1,max:l.cloneDate(se),min:l.cloneDate(te),minTime:l.cloneDate(de),maxTime:l.cloneDate(oe),required:!1,validityStyles:!0,validationMessage:Zi,placeholder:null,ariaHasPopup:"grid"};const Ss=d.createPropsContext(),ae=d.withIdHOC(d.withPropsContext(Ss,re));ae.displayName="KendoReactDateInput";k.registerForIntl(re);k.registerForLocalization(re);const Cs=N.Button,xs=r.forwardRef((s,e)=>{const{_ref:t}=s,i=r.useRef(null);r.useImperativeHandle(e,()=>i.current),r.useImperativeHandle(t,()=>i.current);const a=r.useMemo(()=>d.classNames(s.className,"k-picker-wrap"),[s.className]);return r.createElement("span",{ref:i,id:s.id,style:s.style,className:a,tabIndex:s.tabIndex},s.children)}),Gi=s=>{const[e,t]=r.useState(!1),i=()=>{s.current&&t(!!s.current.text)};return r.useEffect(i),{editorValue:e}},Lt=s=>{const e=Gi(s.dateInput);return r.createElement(ss.FloatingLabel,{...s,...e})},$t=500,st=s=>{const{footer:e,children:t,windowWidth:i=0,navigatable:a,navigatableElements:o,expand:h,animation:u,onClose:c,adaptiveTitle:p,mobileFilter:m}=s,g={navigatable:a||!1,navigatableElements:o||[],expand:h,animation:u!==!1,onClose:c,animationStyles:i<=$t?{top:0,width:"100%",height:"100%"}:void 0,className:i<=$t?"k-adaptive-actionsheet k-actionsheet-fullscreen":"k-adaptive-actionsheet k-actionsheet-bottom"};return r.createElement(ce.ActionSheet,{...g},r.createElement(ce.ActionSheetHeader,{className:"k-text-center"},r.createElement("div",{className:"k-actionsheet-titlebar-group k-hbox"},r.createElement("div",{className:"k-actionsheet-title"},r.createElement("div",null,p)),r.createElement("div",{className:"k-actionsheet-actions"},r.createElement(N.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",icon:"x",svgIcon:J.xIcon,onClick:c}))),m&&r.createElement("div",{className:"k-actionsheet-titlebar-group k-actionsheet-filter"},m)),t,e&&r.createElement(ce.ActionSheetFooter,{className:"k-actions k-actions-stretched"},r.createElement(N.Button,{size:"large",tabIndex:0,"aria-label":e.cancelText,"aria-disabled":"false",type:"button",onClick:e.onCancel},e.cancelText),r.createElement(N.Button,{tabIndex:0,themeColor:"primary",size:"large","aria-label":e.applyText,"aria-disabled":"false",type:"button",onClick:e.onApply},e.applyText)))},it=768,z=class extends r.Component{constructor(s){super(s),this._element=null,this._dateInput=r.createRef(),this._calendar=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.focus=()=>{this.dateInput&&this.dateInput.focus()},this.setCalendarRef=e=>{this._calendar=e},this.nextValue=(e,t)=>e.value!==void 0?e.value:t.value,this.nextShow=(e,t)=>e.show!==void 0?e.show:t.show,this.renderPopup=()=>{const{disabled:e,min:t,max:i,weekNumber:a,focusedDate:o}=this.props,{popupClass:h,...u}=this.props.popupSettings,c=this.show,p=this.value,m=p&&l.getDate(p),g=d.classNames("k-calendar-container k-group k-reset",h),f={popupClass:"k-datepicker-popup",show:c,anchor:this._element,className:g,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...u},v={disabled:e,value:m,min:t,max:i,weekNumber:a,focusedDate:o,className:this.mobileMode?"k-calendar-lg":"",navigation:!this.mobileMode,onChange:this.handleCalendarValueChange};return this.mobileMode?r.createElement(this.calendarComp,{_ref:this.setCalendarRef,...v}):r.createElement(this.popupComp,{...f},r.createElement(this.calendarComp,{_ref:this.setCalendarRef,...v}))},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,t={expand:this.show,onClose:this.handleBlur,adaptiveTitle:this.props.adaptiveTitle,windowWidth:e};return r.createElement(st,{...t},r.createElement(ce.ActionSheetContent,{className:"!k-overflow-hidden"},this.renderPopup()))},this.handleInputValueChange=e=>{this.handleValueChange(e.value,e)},this.handleCalendarValueChange=e=>{const t=this.mergeTime(e.value);this.handleValueChange(t,e)},this.handleValueChange=(e,t)=>{this.setState({value:l.cloneDate(e||void 0)}),this.valueDuringOnChange=e,this.showDuringOnChange=!1,this.mobileMode||(this.shouldFocusDateInput=!0);const{onChange:i}=this.props;i&&i.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.handleIconClick=()=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=e=>{e.preventDefault()},this.handleKeyDown=e=>{const{altKey:t,keyCode:i}=e;if(i===d.Keys.esc){this.shouldFocusDateInput=!0,this.setShow(!1);return}t&&(i===d.Keys.up||i===d.Keys.down)&&(e.preventDefault(),e.stopPropagation(),this.shouldFocusDateInput=i===d.Keys.up,this.setShow(i===d.Keys.down))},d.validatePackage(Se),this.state={value:this.props.defaultValue||z.defaultProps.defaultValue,show:this.props.defaultShow||z.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<=it&&this.props.adaptive)}get dateInput(){return this._dateInput.current}get calendar(){return this._calendar}get value(){const s=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return s!==null?l.cloneDate(s):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: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 toggleButtonComp(){return this.props.toggleButton||z.defaultProps.toggleButton}get calendarComp(){return this.props.calendar||z.defaultProps.calendar}get popupComp(){return this.props.popup||z.defaultProps.popup}get pickerWrapComp(){return this.props.pickerWrap||z.defaultProps.pickerWrap}get validity(){const s=os(this.value,this.min,this.max),e=this.props.validationMessage!==void 0,t=(!this.required||this.value!==null)&&s,i=this.props.valid!==void 0?this.props.valid:t;return{customError:e,rangeOverflow:this.value&&this.max.getTime()<this.value.getTime()||!1,rangeUnderflow:this.value&&this.value.getTime()<this.min.getTime()||!1,valid:i,valueMissing:this.value===null}}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}componentDidMount(){var s;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(s=this.document)!=null&&s.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 s;clearTimeout(this.nextTickId),(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:s=z.defaultProps.size,rounded:e=z.defaultProps.rounded,fillMode:t=z.defaultProps.fillMode,disabled:i,tabIndex:a,title:o,id:h,format:u,formatPlaceholder:c,min:p,max:m,className:g,width:f,name:v,validationMessage:C,required:I,validityStyles:T,ariaLabelledBy:b,ariaDescribedBy:E,ariaLabel:w}=this.props,A=this.show,O=this.value,P=!this.validityStyles||this.validity.valid,B={disabled:i,format:u,formatPlaceholder:c,id:h,ariaLabelledBy:b,ariaDescribedBy:E,ariaLabel:w,max:m,min:p,name:v,onChange:this.handleInputValueChange,required:I,tabIndex:A?-1:a,title:o,valid:this.validity.valid,validationMessage:C,validityStyles:T,value:O,label:void 0,placeholder:this.state.focused?null:this.props.placeholder,ariaExpanded:this.show,size:null,fillMode:null,rounded:null},x=k.provideLocalizationService(this).toLanguageString(je,M[je]),V=r.createElement(d.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.mobileMode?void 0:this.handleBlur,onSyncBlur:this.props.onBlur,onSyncFocus:this.props.onFocus},({onFocus:G,onBlur:Y})=>r.createElement(r.Fragment,null,r.createElement("span",{ref:le=>{this._element=le},className:d.classNames("k-input","k-datepicker",{[`k-input-${d.kendoThemeMaps.sizeMap[s]||s}`]:s,[`k-rounded-${d.kendoThemeMaps.roundedMap[e]||e}`]:e,[`k-input-${t}`]:t,["k-invalid"]:!P,["k-required"]:this.required,["k-disabled"]:this.props.disabled},g),onKeyDown:this.handleKeyDown,style:{width:f},onFocus:G,onBlur:Y,onClick:this.mobileMode?this.handleIconClick:void 0},r.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",readonly:this.mobileMode,ariaExpanded:this.show,ariaControls:this._popupId,...B}),r.createElement(this.toggleButtonComp,{type:"button",icon:"calendar",svgIcon:J.calendarIcon,title:x,className:"k-input-button",rounded:null,onClick:this.mobileMode?void 0:this.handleIconClick,"aria-label":x,onMouseDown:this.handleIconMouseDown}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup()));return this.props.label?r.createElement(Lt,{dateInput:this._dateInput,label:this.props.label,editorId:h,editorValid:P,editorDisabled:this.props.disabled,children:V,style:{width:this.props.width}}):V}setShow(s){const{onOpen:e,onClose:t}=this.props;this.show!==s&&(this.setState({show:s}),s&&e&&e.call(void 0,{target:this}),!s&&t&&t.call(void 0,{target:this}))}mergeTime(s){return this.value&&s?q(s,this.value):s}nextTick(s){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>s())}calculateMedia(s){for(let e of s)this.setState({windowWidth:e.target.clientWidth})}};let Me=z;Me.displayName="DatePicker";Me.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};Me.defaultProps={defaultShow:!1,defaultValue:null,dateInput:ae,calendar:tt,toggleButton:Cs,popup:Qe.Popup,pickerWrap:xs,disabled:!1,format:"d",max:se,min:te,popupSettings:{},tabIndex:0,weekNumber:!1,required:!1,validityStyles:!0,size:"medium",rounded:"medium",fillMode:"solid"};const Is=d.createPropsContext(),Ms=d.withIdHOC(d.withPropsContext(Is,Me));Ms.displayName="KendoReactDatePicker";k.registerForLocalization(Me);const dt=(s,e)=>{const t=l.cloneDate(s);return t.setHours(e),t},pt=s=>s!==null&&s<12,Xi=s=>s!==null&&(!s||s>11),Ji=(s,e,t)=>!e&&!t||s>=e&&s<=t,Qi=(s,e,t)=>!e&&!t||s>=e||s<=t;class Ts{constructor(e){this.intl=e,this.min=null,this.max=null,this.part=null}apply(e,t){const i=e.getHours(),a=pt(i),o=pt(t.getHours());if(a&&o||!a&&!o)return e;const[h,u=24]=this.normalizedRange(),c=i+(o?-12:12);return dt(e,Math.min(Math.max(h,c),u||24))}configure(e){const{min:t=this.min,max:i=this.max,part:a=this.part}=e;this.min=t,this.max=i,this.part=a}data(e){const t=this.part&&this.part.names;if(!t||!this.min)return[];const i=[],[a,o]=this.normalizedRange(),h=this.intl.dateFormatNames(t);return pt(a)&&i.push({text:h.am,value:dt(this.min,a)}),Xi(o)&&i.push({text:h.pm,value:dt(this.min,Math.max(12,o))}),this.min.getHours()!==a?i.reverse():i}isRangeChanged(e,t){return!1}limitRange(e,t,i){return[e,t]}total(){const[e,t]=this.normalizedRange();return!e&&!t?2:e>11||t<12?1:2}selectedIndex(e){if(!this.valueInList(e)||!this.min)return-1;const t=Math.floor(e.getHours()/12);return this.min.getHours()===this.normalizedRange()[0]?t:t===0?1:0}valueInList(e){return!this.min||!this.max?!1:(this.min.getHours()!==this.normalizedRange()[0]?Qi:Ji)(e.getHours(),this.min.getHours(),this.max.getHours())}normalizedRange(){const e=this.min.getHours(),t=this.max.getHours();return[Math.min(e,t),Math.max(e,t)]}}class en{constructor(){this.itemHeight=0,this.timeListHeight=0,this.didCalculate=!1}ensureHeights(){this.timeListHeight===void 0&&this.calculateHeights()}calculateHeights(e){if(!d.canUseDOM)return;const t=W("div"),i=W("span"),a=W("ul"),o=W("li"),h=()=>o("<span>02</span>","k-item"),u=()=>a([h()],"k-reset"),c=()=>t([u()],"k-content k-scrollable k-time-container"),m=(()=>t([i("minute","k-title"),t([c()],"k-time-list")],"k-time-list-wrapper",{left:"-10000px",position:"absolute"}))(),f=e&&e.querySelector(".k-time-container")||document.body,v=f.appendChild(m);this.timeListHeight=v.querySelector(".k-scrollable").offsetHeight,this.itemHeight=v.querySelector("li").offsetHeight,f.removeChild(v),this.didCalculate=!0}}const _t=24,tn=s=>e=>e%s,Es=tn(_t),sn=(s,e)=>t=>Es(s+t*e),Kt=(s,e)=>Es(_t+s-e),Os=s=>(e,t)=>!t||l.getDate(e).getTime()===l.getDate(t).getTime()?e:We(e,s),nn=Os(0),an=Os(_t-1);class Vs{constructor(e){this.intl=e,this.boundRange=!1,this.insertUndividedMax=!1,this.min=null,this.max=null,this.step=0,this.toListItem=null}apply(e,t){return We(e,t.getHours())}configure(e){const{boundRange:t=this.boundRange,insertUndividedMax:i=this.insertUndividedMax,min:a=this.min,max:o=this.max,part:h,step:u=this.step}=e;this.boundRange=t,this.insertUndividedMax=i,this.toListItem=c=>{const p=We(L,c);return{text:this.intl.formatDate(p,h.pattern),value:p}},this.min=a,this.max=o,this.step=u}data(e){const[t]=this.range(e),i=sn(t,this.step),a=h=>this.toListItem&&this.toListItem(i(h)),o=Nt(0,this.countFromMin(e)).map(a);return this.addLast(o),e&&this.addMissing(o,e),o}isRangeChanged(e,t){return!this.min||!this.max?!1:!l.isEqual(this.min,e)||!l.isEqual(this.max,t)}limitRange(e,t,i){return this.boundRange?[nn(e,i),an(t,i)]:[e,t]}total(e){const t=this.insertUndividedMax&&this.isLastMissing(e)?1:0,i=this.isMissing(e)?1:0;return this.countFromMin(e)+i+t}selectedIndex(e){return Math.ceil(this.divideByStep(e))}valueInList(e){return e?this.insertUndividedMax&&this.lastHour(e)===e.getHours()||!this.isMissing(e):!0}addLast(e,t){return this.insertUndividedMax&&this.isLastMissing(t)&&this.toListItem&&e.push(this.toListItem(this.lastHour(t))),e}addMissing(e,t){if(this.valueInList(t))return e;if(this.toListItem){const i=this.toListItem(t.getHours());e.splice(this.selectedIndex(t),0,i)}return e}countFromMin(e){const[t,i]=this.range(e);return Math.floor(Kt(i,t)/this.step)+1}isMissing(e){return e?this.selectedIndex(e)!==this.divideByStep(e):!1}isLastMissing(e){return this.max!==null&&this.isMissing(We(this.max,this.lastHour(e)))}divideByStep(e){return Kt(e.getHours(),this.min.getHours())/this.step}lastHour(e){return this.range(e)[1]}range(e){const[t,i]=this.limitRange(this.min,this.max,e);return[t.getHours(),i.getHours()]}}const Ht=60,on=s=>e=>e%s,Ps=on(Ht),rn=(s,e)=>t=>Ps(s+t*e),jt=(s,e)=>Ps(Ht+s-e),Ns=s=>(e,t)=>!t||e.getHours()===t.getHours()?e:Ue(e,s),ln=Ns(0),hn=Ns(Ht-1);class Rs{constructor(e){this.intl=e,this.toListItem=null,this.min=null,this.max=null,this.step=0,this.insertUndividedMax=!1}apply(e,t){return Ue(e,t.getMinutes())}configure(e){const{insertUndividedMax:t=this.insertUndividedMax,min:i=this.min,max:a=this.max,part:o,step:h=this.step}=e;this.insertUndividedMax=t,this.toListItem=u=>{const c=Ue(L,u);return{text:this.intl.formatDate(c,o.pattern),value:c}},this.min=i,this.max=a,this.step=h}data(e){const[t]=this.range(e),i=rn(t,this.step),a=h=>this.toListItem&&this.toListItem(i(h)),o=Nt(0,this.countFromMin(e)).map(a);return this.addLast(o),e&&this.addMissing(o,e),o}isRangeChanged(e,t){return this.min!==null&&this.max!==null&&(!l.isEqual(this.min,e)||!l.isEqual(this.max,t))}limitRange(e,t,i){return[ln(e,i),hn(t,i)]}total(e){const t=this.insertUndividedMax&&this.isLastMissing(e)?1:0,i=this.isMissing(e)?1:0;return this.countFromMin(e)+i+t}selectedIndex(e){return Math.ceil(this.divideByStep(e))}valueInList(e){return e?this.insertUndividedMax&&this.lastMinute(e)===e.getMinutes()||!this.isMissing(e):!0}addLast(e,t){return this.insertUndividedMax&&this.isLastMissing(t)&&this.toListItem&&e.push(this.toListItem(this.lastMinute(t))),e}addMissing(e,t){if(this.valueInList(t))return e;if(this.toListItem){const i=this.toListItem(t.getMinutes());e.splice(this.selectedIndex(t),0,i)}return e}countFromMin(e){const[t,i]=this.range(e);return Math.floor(jt(i,t)/this.step)+1}isMissing(e){return e?this.selectedIndex(e)!==this.divideByStep(e):!1}isLastMissing(e){return this.max!==null&&this.isMissing(Ue(this.max,this.lastMinute(e)))}divideByStep(e){return jt(e.getMinutes(),this.min.getMinutes())/this.step}lastMinute(e){return this.range(e)[1]}range(e){const[t,i]=this.limitRange(this.min,this.max,e);return[t.getMinutes(),i.getMinutes()]}}const At=60,cn=s=>e=>e%s,Fs=cn(At),un=(s,e)=>t=>Fs(s+t*e),Zt=(s,e)=>Fs(At+s-e),Ls=s=>(e,t)=>!t||e.getMinutes()===t.getMinutes()&&e.getHours()===t.getHours()?e:Ye(e,s),dn=Ls(0),pn=Ls(At-1);class _s{constructor(e){this.intl=e,this.toListItem=null,this.min=null,this.max=null,this.step=0,this.insertUndividedMax=!1}apply(e,t){return Ye(e,t.getSeconds())}configure(e){const{insertUndividedMax:t=this.insertUndividedMax,min:i=this.min,max:a=this.max,part:o,step:h=this.step}=e;this.insertUndividedMax=t,this.toListItem=u=>{const c=Ye(L,u);return{text:this.intl.formatDate(c,o.pattern),value:c}},this.min=i,this.max=a,this.step=h}data(e){const[t]=this.range(e),i=un(t,this.step),a=h=>this.toListItem&&this.toListItem(i(h)),o=Nt(0,this.countFromMin(e)).map(a);return this.addLast(o),e&&this.addMissing(o,e),o}isRangeChanged(e,t){return this.min!==null&&this.max!==null&&(!l.isEqual(this.min,e)||!l.isEqual(this.max,t))}limitRange(e,t,i){return[dn(e,i),pn(t,i)]}total(e){const t=this.insertUndividedMax&&this.isLastMissing(e)?1:0,i=this.isMissing(e)?1:0;return this.countFromMin(e)+i+t}selectedIndex(e){return Math.ceil(this.divideByStep(e))}valueInList(e){return e?this.insertUndividedMax&&this.lastSecond(e)===e.getSeconds()||!this.isMissing(e):!0}divideByStep(e){return Zt(e.getSeconds(),this.min.getSeconds())/this.step}addLast(e,t){return this.insertUndividedMax&&this.isLastMissing(t)&&this.toListItem&&e.push(this.toListItem(this.lastSecond(t))),e}addMissing(e,t){if(this.valueInList(t))return e;if(this.toListItem){const i=this.toListItem(t.getSeconds());e.splice(this.selectedIndex(t),0,i)}return e}countFromMin(e){const[t,i]=this.range(e);return Math.floor(Zt(i,t)/this.step)+1}isMissing(e){return e?this.selectedIndex(e)!==this.divideByStep(e):!1}isLastMissing(e){return this.max!==null&&this.isMissing(Ye(this.max,this.lastSecond(e)))}lastSecond(e){return this.range(e)[1]}range(e){const[t,i]=this.limitRange(this.min,this.max,e);return[t.getSeconds(),i.getSeconds()]}}const mn=2,Gt=.05,gn=100,fn=0,Xt=9,vn={[d.Keys.end]:(s,e)=>s[s.length-1],[d.Keys.home]:(s,e)=>s[0],[d.Keys.up]:(s,e)=>s[e-1],[d.Keys.down]:(s,e)=>s[e+1]},It={[j.dayperiod]:Ts,[j.hour]:Vs,[j.minute]:Rs,[j.second]:_s},fe=class extends r.Component{constructor(s){super(s),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=e=>{Promise.resolve().then(()=>{this.element&&this.element.focus(e)})},this.itemOffset=e=>{if(!this.virtualization||!this.service)return-1;const t=this.service.selectedIndex(this.props.value),i=this.virtualization.activeIndex(),a=this.virtualization.itemOffset(i),o=Math.abs(Math.ceil(e)-a);if(t===i&&o<mn)return a;const h=t>i;return h&&o>=this.bottomThreshold||!h&&o>this.topThreshold?this.virtualization.itemOffset(i+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+=Xt,this.bottomOffset+=Xt*2),this.topThreshold=this.itemHeight*Gt,this.bottomThreshold=this.itemHeight*(1-Gt))},this.configureServices=({min:e,max:t,value:i}=this.props)=>{if(this.service){const[a,o]=this.service.limitRange(e||this.min,t||this.max,i||this.props.value);this.service.configure(this.serviceSettings({min:a,max:o}))}},this.serviceSettings=e=>{const t={boundRange:this.props.boundRange||fe.defaultProps.boundRange,insertUndividedMax:!1,min:l.cloneDate(this.min),max:l.cloneDate(this.max),part:this.props.part,step:this.step},i=Object.assign({},t,e);return i.boundRange=i.part.type!=="hour"||this.props.boundRange||fe.defaultProps.boundRange,i},this.handleScrollAction=({target:e,animationInProgress:t})=>{if(!(!this.virtualization||!this.service)&&e&&!t){this.animateToIndex=!1;const i=this.virtualization.itemIndex(this.itemOffset(e.scrollTop)),a=this.service.data(this.props.value)[i];this.handleChange(a)}},this.handleFocus=e=>{const{onFocus:t}=this.props;t&&t.call(void 0,e)},this.handleBlur=e=>{const{onBlur:t}=this.props;t&&t.call(void 0,e)},this.handleMouseOver=()=>{if(!this._element)return;const e=d.getActiveElement(document);document&&e!==this._element&&this.props.show&&this._element.focus({preventScroll:!0})},this.handleKeyDown=e=>{if(!this.service)return;const{keyCode:t}=e;(t===d.Keys.down||t===d.Keys.up||t===d.Keys.end||t===d.Keys.home)&&e.preventDefault();const a=(vn[e.keyCode]||d.noop)(this.service.data(this.props.value),this.service.selectedIndex(this.props.value));a&&this.handleChange(a)},this.handleChange=ni(e=>{if(!this.service)return;const t=this.service.apply(this.props.value,e.value);if(this.props.value.getTime()===t.getTime())return;const{onChange:i}=this.props;i&&i.call(void 0,t)},gn),this.dom=new en}get element(){return this._element}get animate(){return!!(this.props.smoothScroll&&this.animateToIndex)}get min(){return this.props.min||fe.defaultProps.min}get max(){return this.props.max||fe.defaultProps.max}get step(){return this.props.step!==void 0&&this.props.step!==0?Math.floor(this.props.step):fe.defaultProps.step}componentDidMount(){Promise.resolve().then(()=>{this._element&&(this.dom.calculateHeights(this._element),this.forceUpdate())})}componentDidUpdate(){if(!this.virtualization||!this.service)return;const s=this.service.selectedIndex(this.props.value);this.virtualization[this.animate?"animateToIndex":"scrollToIndex"](s),this.animateToIndex=!0}render(){if(!this.props.part.type||!It[this.props.part.type])return;this.calculateHeights(),this.intl=k.provideIntlService(this),this.service=new It[this.props.part.type](this.intl),this.configureServices();const s=this.service.data(this.props.value),e="translateY("+this.topOffset+"px)",t=this.service.total(this.props.value),i=r.createElement("ul",{style:{transform:e,msTransform:e},className:"k-reset"},s.map((a,o)=>r.createElement("li",{key:o,className:"k-item",onClick:()=>{this.handleChange(a)}},r.createElement("span",null,a.text))));return r.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?r.createElement(Ce,{bottomOffset:this.bottomOffset,children:i,className:"k-time-container",itemHeight:this.itemHeight,maxScrollDifference:this.listHeight,onScrollAction:this.handleScrollAction,ref:a=>{this.virtualization=a},role:"presentation",skip:fn,tabIndex:-1,take:t,topOffset:this.topOffset,total:t}):r.createElement("div",{className:"k-time-container"},i))}};let He=fe;He.propTypes={id:n.number,max:n.instanceOf(Date),min:n.instanceOf(Date),part:function(s,e,t){const i=s[e];if(!i||!It[i.type])throw new Error(`
15
+ `):null}};ne.defaultProps={disabled:!1,min:te,max:se,navigation:!0,defaultActiveView:"month",defaultValue:null,topView:"century",bottomView:"month"};const Ds=d.createPropsContext(),tt=d.withIdHOC(d.withPropsContext(Ds,ne));tt.displayName="KendoReactCalendar";k.registerForIntl(ne);class Mi{constructor(){this.symbols="",this.partMap=[]}}const Ti="d",Ei="wide",Oi=(s,e,t,i)=>{const a=s[i+s.length-t.length],o=s.substring(0,i+s.length-t.length),h=t.substring(0,i),u=[];if(o===h&&i>0)return u.push([e[i-1],h[i-1]]),u;if(o.indexOf(h)===0&&(h.length===0||e[h.length-1]!==e[h.length])){let c="";h.length===1&&u.push([e[0],h[0]]);for(let p=h.length;p<o.length;p++)e[p]!==c&&e[p]!=="_"&&(c=e[p],u.push([c,""]));return u}if(h.indexOf(o)===0||e[i-1]==="_"){let c=e[0];for(let p=Math.max(0,o.length-1);p<e.length;p++)if(e[p]!=="_"){c=e[p];break}return[[c,h[i-1]]]}return h[h.length-1]===" "||h[h.length-1]===a?[[e[i-1],"_"]]:[[e[i-1],h[i-1]]]},Vi=(s,e)=>(s[e.pattern[0]]=e.type,s),Pi=(s,e,t)=>s===null||!(e&&e>s||t&&t<s),Ni=["k-widget","k-dateinput"];class Ri{constructor(e,t,i){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=e,this.formatPlaceholder=t,this.format=i,this.monthNames=this.allFormatedMonths()}get intl(){return this.intlProvider()}get value(){return this._value}setValue(e){e?l.isEqual(e,this._value)||(this._value=l.cloneDate(e),this.modifyExisting(!0)):(this._value=l.getDate(new Date),this.modifyExisting(!1))}hasValue(){const e=(t,i)=>t||i.type!=="literal"&&i.type!=="dayperiod"&&this.getExisting(i.pattern[0]);return this.intl.splitDateFormat(this.format).reduce(e,!1)}getDateObject(){for(let e=0;e<this.knownParts.length;e++)if(!this.getExisting(this.knownParts[e]))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(e){const t=this.dateFormatString(this.value,this.format).symbols;for(let i=0;i<t.length;i++)this.setExisting(t[i],e)}getExisting(e){switch(e){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(e,t){switch(e){case"y":this.year=t,t===!1&&this._value.setFullYear(2e3);break;case"M":this.month=t,t===!1&&this._value.setMonth(0);break;case"d":this.date=t;break;case"h":case"H":this.hours=t;break;case"m":this.minutes=t;break;case"s":this.seconds=t;break;default:return}}modifyPart(e,t){let i=l.cloneDate(this.value);switch(e){case"y":i.setFullYear(i.getFullYear()+t);break;case"M":i=l.addMonths(this.value,t);break;case"d":case"E":i.setDate(i.getDate()+t);break;case"h":case"H":i.setHours(i.getHours()+t);break;case"m":i.setMinutes(i.getMinutes()+t);break;case"s":i.setSeconds(i.getSeconds()+t);break;case"a":i.setHours(i.getHours()+12*t);break}this.setExisting(e,!0),this._value=i}parsePart(e,t){if(this.resetLeadingZero(),!t)return this.setExisting(e,!1),{value:null};const i=this.intl.formatDate(this.value,this.format),a=this.dateFormatString(this.value,this.format),o=a.symbols;let h=!1,u="",c="",p="";for(let f=0;f<i.length;f++)o[f]===e?(c+=this.getExisting(e)?i[f]:"0",h=!0):h?p+=i[f]:u+=i[f];let m=null;const g=this.matchMonth(t);for(;c.length>0&&c.charAt(0)==="0";)c=c.slice(1);c.length>=4&&(c="");for(let f=0;f<2;f++){let v=c+t,C=parseInt(v,10);if(m=this.intl.parseDate(u+v+p,this.format),!m&&!isNaN(C)&&!isNaN(parseInt(t,10))){if(e==="M"&&!g){const I=C-1;I>-1&&I<12&&(m=l.cloneDate(this.value),m.setMonth(I),m.getMonth()!==I&&(m=l.lastDayOfMonth(l.addMonths(m,-1))))}e==="y"&&(m=l.createDate(parseInt(v,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(e,!0),{value:this.value};c=""}return g&&(m=this.intl.parseDate(u+g+p,this.format),m)?(this._value=m,this.setExisting(e,!0),{value:this.value}):(t==="0"&&(this.leadingZero=this.isAbbrMonth(a.partMap,e)?null:{[e]:!0},this.setExisting(e,!1)),{value:null})}symbolMap(e){return this.intl.splitDateFormat(this.format).reduce(Vi,{})[e]}resetLeadingZero(){const e=this.leadingZero!==null;return this.leadingZero=null,e}isAbbrMonth(e,t){const i=this.partPattern(e,t);return i.type==="month"&&i.names}partPattern(e,t){return e.filter(i=>i.pattern.indexOf(t)!==-1)[0]}matchMonth(e){if(this.typedMonthPart+=e.toLowerCase(),this.monthNames.length===0)return"";for(;this.typedMonthPart.length>0;){for(let i=0;i<this.monthNames.length;i++)if(this.monthNames[i].toLowerCase().indexOf(this.typedMonthPart)===0)return this.monthNames[i];const t=parseInt(this.typedMonthPart,10);if(t>=1&&t<=12&&t.toString()===this.typedMonthPart)return this.monthNames[t-1];this.typedMonthPart=this.typedMonthPart.substring(1,this.typedMonthPart.length)}return""}allFormatedMonths(){const e=this.intl.splitDateFormat(this.format);for(let t=0;t<e.length;t++)if(e[t].type==="month"&&e[t].names)return this.intl.dateFormatNames(e[t].names);return[]}dateFormatString(e,t){const i=this.intl.splitDateFormat(t),a=[],o=[];for(let u=0;u<i.length;u++){let c=this.intl.formatDate(e,{pattern:i[u].pattern}).length;for(;c>0;)a.push(this.symbols[i[u].pattern[0]]||"_"),o.push(i[u]),c--}const h=new Mi;return h.symbols=a.join(""),h.partMap=o,h}merge(e,t){let i="",a="",o=t.symbols;for(let h=o.length-1;h>=0;h--)if(this.knownParts.indexOf(o[h])===-1||this.getExisting(o[h]))i=e[h]+i,a=o[h]+a;else{const u=o[h];for(;h>=0&&u===o[h];)h--;for(h++,this.leadingZero&&this.leadingZero[u]?i="0"+i:i=this.dateFieldName(t.partMap[h])+i;a.length<i.length;)a=o[h]+a}return{text:i,format:a}}dateFieldName(e){const t=this.formatPlaceholder||"wide";return t[e.type]?t[e.type]:t==="formatPattern"?e.pattern:this.intl.dateFieldName(Object.assign(e,{nameType:t}))}}const j={dayperiod:"dayperiod",hour:"hour",millisecond:"millisecond",minute:"minute",second:"second"},Pt=s=>(e,t)=>{const i=l.cloneDate(e);return i[s](t),i},ys=[{type:j.hour,getter:s=>s.getHours()},{type:j.minute,getter:s=>s.getMinutes()},{type:j.second,getter:s=>s.getSeconds()},{type:j.millisecond,getter:s=>s.getMilliseconds()}],Fi=s=>(e,t)=>s(e),Li=s=>(e,t)=>s(t),_i=s=>s.reduce((e,t)=>(e[t.type]=t.type,e),{}),Hi=s=>e=>s[e.type]?Li(e.getter):Fi(e.getter),Ai=s=>e=>s.map(Hi(_i(e))),Bi=(s,e,t,i)=>a=>{const o=s(a),h=s(t);return i==="hour"?o-(o-h)%e:a.getTime()<=t.getTime()&&o!==0&&o<=h?Math.ceil(o/e)*e:o-o%e},zi=s=>(e,t)=>s.map(i=>{const a=Math.floor(e[i.type]);return a?Bi(i.getter,a,t,i.type):i.getter}),qi=Ai(ys),Ut=zi(ys),Wi=s=>(e,t)=>(e.setHours(...s.map(i=>i(e,t))),e),Yt=s=>e=>{const t=l.cloneDate(e);return t.setHours(...s.map(i=>i(t))),t},We=Pt("setHours"),Ue=Pt("setMinutes"),Ye=Pt("setSeconds"),ue=()=>new Date,Nt=(s,e,t=1)=>{const i=[];for(let a=s;a<e;a=a+t)i.push(a);return i},Rt=(s,e,t)=>({candidateValue:q(L,s),maxValue:l.addDays(q(L,t),e.getHours()<t.getHours()?0:1),minValue:q(L,e)}),Ui=(s,e,t)=>{if(!s||!e||!t)return s;const{candidateValue:i,minValue:a,maxValue:o}=Rt(s,e,t);return i<a?q(s,e):i>o?q(s,t):s},Ft=(s,e,t)=>{if(!s||!e||!t)return!0;const{candidateValue:i,minValue:a,maxValue:o}=Rt(s,e,t);return a<=i&&i<=o},Yi=(s,e,t)=>{if(s===null)return!0;const{candidateValue:i,minValue:a,maxValue:o}=Rt(s,e,t);return a<=i&&i<=o},$i=(s,e)=>{if(s===null||e===null)return!1;const t=q(L,s),i=q(L,e);return t.getTime()<i.getHours()},Ki=(s,e)=>{if(s===null||e===null)return!1;const t=q(L,s);return q(L,e).getTime()<t.getHours()},ji="Please enter a valid value!",$=class extends r.Component{constructor(s){super(s),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||$.defaultProps.validationMessage)},this.updateOnPaste=e=>{if(!this.element||!this.kendoDate)return;const t=k.provideIntlService(this).parseDate(this.element.value,this.props.format)||this.value,i=this.value;this.kendoDate.setValue(t),this.triggerChange(e,i)},this.spinnersMouseDown=e=>{e.preventDefault();const t=d.getActiveElement(document);this.element&&t!==this.element&&this.element.focus({preventScroll:!0})},this.handlePaste=()=>{this.paste=!0},this.elementChange=e=>{if(!this.element||!this.kendoDate)return;if(this.paste){this.updateOnPaste(e),this.paste=!1;return}const{text:t,format:i}=this.kendoDate.getTextAndFormat();this.currentFormat=i;const a=this.value,o=Oi(t,this.currentFormat,this.element.value,this.selection.start),h=o.length===1&&o[0][1]==="_";if(!h)for(let u=0;u<o.length;u++)this.kendoDate.parsePart(o[u][0],o[u][1]);o.length&&o[0][0]!=="_"&&this.setSelection(this.selectionBySymbol(o[0][0])),h&&this.switchDateSegment(1),this.triggerChange(e,a)},this.elementClick=e=>{this.setSelection(this.selectionByIndex(this.selection.start))},this.nativeWheel=e=>{d.getActiveElement(document)===this.element&&e.preventDefault()},this.wheel=e=>{d.getActiveElement(document)===this.element&&(e.nativeEvent.deltaY<0&&this.increasePart(e),e.nativeEvent.deltaY>0&&this.decreasePart(e))},this.increasePart=e=>{this.modifyDateSegmentValue(1,e)},this.decreasePart=e=>{this.modifyDateSegmentValue(-1,e)},this.elementKeyDown=e=>{if(!e.altKey){switch(e.keyCode){case 37:this.switchDateSegment(-1);break;case 38:this.modifyDateSegmentValue(1,e);break;case 39:this.switchDateSegment(1);break;case 40:this.modifyDateSegmentValue(-1,e);break;default:return}e.preventDefault()}},this.elementOnFocus=e=>{this.wrapper&&this.wrapper.classList.add("k-focus"),this.setState({focused:!0})},this.elementOnBlur=e=>{this.wrapper&&this.wrapper.classList.remove("k-focus"),this.setState({focused:!1})},d.validatePackage(Se),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(s,e){this._lastSelectedSymbol&&e.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:s=$.defaultProps.size,fillMode:e=$.defaultProps.fillMode,rounded:t=$.defaultProps.rounded}=this.props;this.props._ref&&(this.props._ref.current=this);const i=k.provideLocalizationService(this),a={...$.defaultProps,...this.props},{name:o,label:h,id:u}=a,c=this.text,p=c===this.props.placeholder?"":c,m=c===this.props.placeholder?c:void 0,g=u||this._inputId,f=!this.validityStyles||this.validity.valid;let v=[...Ni];this.props.className&&v.push(this.props.className);const C=r.createElement(d.AsyncFocusBlur,{onFocus:this.elementOnFocus,onBlur:this.elementOnBlur},({onFocus:I,onBlur:T})=>r.createElement("span",{ref:b=>{this._wrapper=b},style:h?void 0:{width:this.props.width},dir:this.props.dir,className:d.classNames("k-dateinput","k-input",{[`k-input-${d.kendoThemeMaps.sizeMap[s]||s}`]:s,[`k-input-${e}`]:e,[`k-rounded-${d.kendoThemeMaps.roundedMap[t]||t}`]:t,"k-invalid":!f,"k-required":this.required,"k-disabled":this.props.disabled},this.props.className),onFocus:I,onBlur:T},r.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:g,"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:o,ref:b=>this._element=b}),this.props.children,this.props.spinners&&r.createElement("span",{className:"k-input-spinner k-spin-button",onMouseDown:this.spinnersMouseDown},r.createElement(N.Button,{tabIndex:-1,type:"button",rounded:null,className:"k-spinner-increase",icon:"caret-alt-up",svgIcon:J.caretAltUpIcon,"aria-label":i.toLanguageString(we,M[we]),title:i.toLanguageString(we,M[we]),onClick:this.increasePart}),r.createElement(N.Button,{tabIndex:-1,type:"button",rounded:null,className:"k-spinner-decrease",icon:"caret-alt-down",svgIcon:J.caretAltDownIcon,"aria-label":i.toLanguageString(be,M[be]),title:i.toLanguageString(be,M[be]),onClick:this.decreasePart}))));return h?r.createElement(ss.FloatingLabel,{label:h,editorId:g,editorValue:c,editorValid:f,editorDisabled:this.props.disabled,children:C,style:{width:this.props.width}}):C}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:$.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:$.defaultProps.max}get text(){const s={...ae.defaultProps,...this.props},{formatPlaceholder:e=$.defaultProps.formatPlaceholder,format:t=$.defaultProps.format,value:i,defaultValue:a}=s;this.kendoDate===null?(this.kendoDate=new Ri(this.intl.bind(this),e,t),this.kendoDate.setValue(i||a||null)):(this.kendoDate.format=t,this.kendoDate.formatPlaceholder=e),i!==void 0&&this.value!==i&&this.kendoDate.setValue(i);const{text:o,format:h}=this.kendoDate.getTextAndFormat();return this.currentFormat=h,s.placeholder!==null&&s.placeholder!==void 0&&!this.state.focused&&!this.kendoDate.hasValue()?s.placeholder:o}get validity(){const s=Pi(this.value,this.min,this.max)&&Ft(this.value,this.props.minTime,this.props.maxTime),e=this.props.validationMessage!==void 0,t=(!this.required||this.value!==null)&&s,i=this.props.valid!==void 0?this.props.valid:t;return{customError:e,rangeOverflow:this.value&&this.max.getTime()<this.value.getTime()||!1,rangeUnderflow:this.value&&this.value.getTime()<this.min.getTime()||!1,valid:i,valueMissing:this.value===null}}get element(){return this._element}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:$.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:$.defaultProps.required}get wrapper(){return this._wrapper}intl(){return k.provideIntlService(this)}get selection(){let s={start:0,end:0};return this.element!==null&&this.element.selectionStart!==void 0&&(s={start:this.element.selectionStart,end:this.element.selectionEnd}),s}setSelection(s){this._lastSelectedSymbol=this.currentFormat[s.start],window.requestAnimationFrame(()=>{const e=d.getActiveElement(document);this.element&&e===this.element&&!this.props.disableSelection&&this.element.setSelectionRange(s.start,s.end)})}triggerChange(s,e){this.valueDuringOnChange=this.value,this.forceUpdate(),this.props.onChange&&!l.isEqual(e,this.value)&&this.props.onChange.call(void 0,{syntheticEvent:s,nativeEvent:s.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0}selectionBySymbol(s){let e=-1,t=0;for(let i=0;i<this.currentFormat.length;i++)this.currentFormat[i]===s&&(t=i+1,e===-1&&(e=i));return e<0&&(e=0),{start:e,end:t}}selectionByIndex(s){let e={start:s,end:s};for(let t=s,i=s-1;t<this.currentFormat.length||i>=0;t++,i--){if(t<this.currentFormat.length&&this.currentFormat[t]!=="_"){e=this.selectionBySymbol(this.currentFormat[t]);break}if(i>=0&&this.currentFormat[i]!=="_"){e=this.selectionBySymbol(this.currentFormat[i]);break}}return e}switchDateSegment(s){const{start:e,end:t}=this.selection;if(e<t&&this.currentFormat[e]!==this.currentFormat[t-1]){this.setSelection(this.selectionByIndex(s>0?e:t-1));return}const i=this.currentFormat[e];let a=e+s;for(;a>0&&a<this.currentFormat.length&&!(this.currentFormat[a]!==i&&this.currentFormat[a]!=="_");)a+=s;if(this.currentFormat[a]==="_")return;let o=a;for(;o>=0&&o<this.currentFormat.length&&this.currentFormat[o]===this.currentFormat[a];)o+=s;a>o&&(o+1!==e||a+1!==t)?this.setSelection({start:o+1,end:a+1}):a<o&&(a!==e||o!==t)&&this.setSelection({start:a,end:o})}modifyDateSegmentValue(s,e){if(!this.kendoDate)return;const t=this.value,i=this.currentFormat[this.selection.start],a=this.kendoDate.symbolMap(i),o=((this.props.steps||{})[a]||1)*s;this.kendoDate.modifyPart(i,o),this.triggerChange(e,t)}};let re=$;re.displayName="DateInput";re.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"])};re.defaultProps={format:Ti,size:"medium",rounded:"medium",fillMode:"solid",formatPlaceholder:Ei,spinners:!1,disabled:!1,max:l.cloneDate(se),min:l.cloneDate(te),minTime:l.cloneDate(de),maxTime:l.cloneDate(oe),required:!1,validityStyles:!0,validationMessage:ji,placeholder:null,ariaHasPopup:"grid"};const ks=d.createPropsContext(),ae=d.withIdHOC(d.withPropsContext(ks,re));ae.displayName="KendoReactDateInput";k.registerForIntl(re);k.registerForLocalization(re);const Ss=N.Button,Cs=r.forwardRef((s,e)=>{const{_ref:t}=s,i=r.useRef(null);r.useImperativeHandle(e,()=>i.current),r.useImperativeHandle(t,()=>i.current);const a=r.useMemo(()=>d.classNames(s.className,"k-picker-wrap"),[s.className]);return r.createElement("span",{ref:i,id:s.id,style:s.style,className:a,tabIndex:s.tabIndex},s.children)}),Zi=s=>{const[e,t]=r.useState(!1),i=()=>{s.current&&t(!!s.current.text)};return r.useEffect(i),{editorValue:e}},Lt=s=>{const e=Zi(s.dateInput);return r.createElement(ss.FloatingLabel,{...s,...e})},$t=500,st=s=>{const{footer:e,children:t,windowWidth:i=0,navigatable:a,navigatableElements:o,expand:h,animation:u,onClose:c,adaptiveTitle:p,mobileFilter:m}=s,g={navigatable:a||!1,navigatableElements:o||[],expand:h,animation:u!==!1,onClose:c,animationStyles:i<=$t?{top:0,width:"100%",height:"100%"}:void 0,className:i<=$t?"k-adaptive-actionsheet k-actionsheet-fullscreen":"k-adaptive-actionsheet k-actionsheet-bottom"};return r.createElement(ce.ActionSheet,{...g},r.createElement(ce.ActionSheetHeader,{className:"k-text-center"},r.createElement("div",{className:"k-actionsheet-titlebar-group k-hbox"},r.createElement("div",{className:"k-actionsheet-title"},r.createElement("div",null,p)),r.createElement("div",{className:"k-actionsheet-actions"},r.createElement(N.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",icon:"x",svgIcon:J.xIcon,onClick:c}))),m&&r.createElement("div",{className:"k-actionsheet-titlebar-group k-actionsheet-filter"},m)),t,e&&r.createElement(ce.ActionSheetFooter,{className:"k-actions k-actions-stretched"},r.createElement(N.Button,{size:"large",tabIndex:0,"aria-label":e.cancelText,"aria-disabled":"false",type:"button",onClick:e.onCancel},e.cancelText),r.createElement(N.Button,{tabIndex:0,themeColor:"primary",size:"large","aria-label":e.applyText,"aria-disabled":"false",type:"button",onClick:e.onApply},e.applyText)))},it=768,z=class extends r.Component{constructor(s){super(s),this._element=null,this._dateInput=r.createRef(),this._calendar=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.focus=()=>{this.dateInput&&this.dateInput.focus()},this.setCalendarRef=e=>{this._calendar=e},this.nextValue=(e,t)=>e.value!==void 0?e.value:t.value,this.nextShow=(e,t)=>e.show!==void 0?e.show:t.show,this.renderPopup=()=>{const{disabled:e,min:t,max:i,weekNumber:a,focusedDate:o}=this.props,{popupClass:h,...u}=this.props.popupSettings,c=this.show,p=this.value,m=p&&l.getDate(p),g=d.classNames("k-calendar-container k-group k-reset",h),f={popupClass:"k-datepicker-popup",show:c,anchor:this._element,className:g,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...u},v={disabled:e,value:m,min:t,max:i,weekNumber:a,focusedDate:o,className:this.mobileMode?"k-calendar-lg":"",navigation:!this.mobileMode,onChange:this.handleCalendarValueChange};return this.mobileMode?r.createElement(this.calendarComp,{_ref:this.setCalendarRef,...v}):r.createElement(this.popupComp,{...f},r.createElement(this.calendarComp,{_ref:this.setCalendarRef,...v}))},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,t={expand:this.show,onClose:this.handleBlur,adaptiveTitle:this.props.adaptiveTitle,windowWidth:e};return r.createElement(st,{...t},r.createElement(ce.ActionSheetContent,{className:"!k-overflow-hidden"},this.renderPopup()))},this.handleInputValueChange=e=>{this.handleValueChange(e.value,e)},this.handleCalendarValueChange=e=>{const t=this.mergeTime(e.value);this.handleValueChange(t,e)},this.handleValueChange=(e,t)=>{this.setState({value:l.cloneDate(e||void 0)}),this.valueDuringOnChange=e,this.showDuringOnChange=!1,this.mobileMode||(this.shouldFocusDateInput=!0);const{onChange:i}=this.props;i&&i.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.handleIconClick=()=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=e=>{e.preventDefault()},this.handleKeyDown=e=>{const{altKey:t,keyCode:i}=e;if(i===d.Keys.esc){this.shouldFocusDateInput=!0,this.setShow(!1);return}t&&(i===d.Keys.up||i===d.Keys.down)&&(e.preventDefault(),e.stopPropagation(),this.shouldFocusDateInput=i===d.Keys.up,this.setShow(i===d.Keys.down))},d.validatePackage(Se),this.state={value:this.props.defaultValue||z.defaultProps.defaultValue,show:this.props.defaultShow||z.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<=it&&this.props.adaptive)}get dateInput(){return this._dateInput.current}get calendar(){return this._calendar}get value(){const s=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return s!==null?l.cloneDate(s):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: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 toggleButtonComp(){return this.props.toggleButton||z.defaultProps.toggleButton}get calendarComp(){return this.props.calendar||z.defaultProps.calendar}get popupComp(){return this.props.popup||z.defaultProps.popup}get pickerWrapComp(){return this.props.pickerWrap||z.defaultProps.pickerWrap}get validity(){const s=as(this.value,this.min,this.max),e=this.props.validationMessage!==void 0,t=(!this.required||this.value!==null)&&s,i=this.props.valid!==void 0?this.props.valid:t;return{customError:e,rangeOverflow:this.value&&this.max.getTime()<this.value.getTime()||!1,rangeUnderflow:this.value&&this.value.getTime()<this.min.getTime()||!1,valid:i,valueMissing:this.value===null}}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}componentDidMount(){var s;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(s=this.document)!=null&&s.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 s;clearTimeout(this.nextTickId),(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:s=z.defaultProps.size,rounded:e=z.defaultProps.rounded,fillMode:t=z.defaultProps.fillMode,disabled:i,tabIndex:a,title:o,id:h,format:u,formatPlaceholder:c,min:p,max:m,className:g,width:f,name:v,validationMessage:C,required:I,validityStyles:T,ariaLabelledBy:b,ariaDescribedBy:E,ariaLabel:w}=this.props,A=this.show,O=this.value,P=!this.validityStyles||this.validity.valid,B={disabled:i,format:u,formatPlaceholder:c,id:h,ariaLabelledBy:b,ariaDescribedBy:E,ariaLabel:w,max:m,min:p,name:v,onChange:this.handleInputValueChange,required:I,tabIndex:A?-1:a,title:o,valid:this.validity.valid,validationMessage:C,validityStyles:T,value:O,label:void 0,placeholder:this.state.focused?null:this.props.placeholder,ariaExpanded:this.show,size:null,fillMode:null,rounded:null},x=k.provideLocalizationService(this).toLanguageString(je,M[je]),V=r.createElement(d.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.mobileMode?void 0:this.handleBlur,onSyncBlur:this.props.onBlur,onSyncFocus:this.props.onFocus},({onFocus:G,onBlur:Y})=>r.createElement(r.Fragment,null,r.createElement("span",{ref:le=>{this._element=le},className:d.classNames("k-input","k-datepicker",{[`k-input-${d.kendoThemeMaps.sizeMap[s]||s}`]:s,[`k-rounded-${d.kendoThemeMaps.roundedMap[e]||e}`]:e,[`k-input-${t}`]:t,["k-invalid"]:!P,["k-required"]:this.required,["k-disabled"]:this.props.disabled},g),onKeyDown:this.handleKeyDown,style:{width:f},onFocus:G,onBlur:Y,onClick:this.mobileMode?this.handleIconClick:void 0},r.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",readonly:this.mobileMode,ariaExpanded:this.show,ariaControls:this._popupId,...B}),r.createElement(this.toggleButtonComp,{type:"button",icon:"calendar",svgIcon:J.calendarIcon,title:x,className:"k-input-button",rounded:null,onClick:this.mobileMode?void 0:this.handleIconClick,"aria-label":x,onMouseDown:this.handleIconMouseDown}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup()));return this.props.label?r.createElement(Lt,{dateInput:this._dateInput,label:this.props.label,editorId:h,editorValid:P,editorDisabled:this.props.disabled,children:V,style:{width:this.props.width}}):V}setShow(s){const{onOpen:e,onClose:t}=this.props;this.show!==s&&(this.setState({show:s}),s&&e&&e.call(void 0,{target:this}),!s&&t&&t.call(void 0,{target:this}))}mergeTime(s){return this.value&&s?q(s,this.value):s}nextTick(s){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>s())}calculateMedia(s){for(let e of s)this.setState({windowWidth:e.target.clientWidth})}};let Me=z;Me.displayName="DatePicker";Me.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};Me.defaultProps={defaultShow:!1,defaultValue:null,dateInput:ae,calendar:tt,toggleButton:Ss,popup:Qe.Popup,pickerWrap:Cs,disabled:!1,format:"d",max:se,min:te,popupSettings:{},tabIndex:0,weekNumber:!1,required:!1,validityStyles:!0,size:"medium",rounded:"medium",fillMode:"solid"};const xs=d.createPropsContext(),Is=d.withIdHOC(d.withPropsContext(xs,Me));Is.displayName="KendoReactDatePicker";k.registerForLocalization(Me);const dt=(s,e)=>{const t=l.cloneDate(s);return t.setHours(e),t},pt=s=>s!==null&&s<12,Gi=s=>s!==null&&(!s||s>11),Xi=(s,e,t)=>!e&&!t||s>=e&&s<=t,Ji=(s,e,t)=>!e&&!t||s>=e||s<=t;class Ms{constructor(e){this.intl=e,this.min=null,this.max=null,this.part=null}apply(e,t){const i=e.getHours(),a=pt(i),o=pt(t.getHours());if(a&&o||!a&&!o)return e;const[h,u=24]=this.normalizedRange(),c=i+(o?-12:12);return dt(e,Math.min(Math.max(h,c),u||24))}configure(e){const{min:t=this.min,max:i=this.max,part:a=this.part}=e;this.min=t,this.max=i,this.part=a}data(e){const t=this.part&&this.part.names;if(!t||!this.min)return[];const i=[],[a,o]=this.normalizedRange(),h=this.intl.dateFormatNames(t);return pt(a)&&i.push({text:h.am,value:dt(this.min,a)}),Gi(o)&&i.push({text:h.pm,value:dt(this.min,Math.max(12,o))}),this.min.getHours()!==a?i.reverse():i}isRangeChanged(e,t){return!1}limitRange(e,t,i){return[e,t]}total(){const[e,t]=this.normalizedRange();return!e&&!t?2:e>11||t<12?1:2}selectedIndex(e){if(!this.valueInList(e)||!this.min)return-1;const t=Math.floor(e.getHours()/12);return this.min.getHours()===this.normalizedRange()[0]?t:t===0?1:0}valueInList(e){return!this.min||!this.max?!1:(this.min.getHours()!==this.normalizedRange()[0]?Ji:Xi)(e.getHours(),this.min.getHours(),this.max.getHours())}normalizedRange(){const e=this.min.getHours(),t=this.max.getHours();return[Math.min(e,t),Math.max(e,t)]}}class Qi{constructor(){this.itemHeight=0,this.timeListHeight=0,this.didCalculate=!1}ensureHeights(){this.timeListHeight===void 0&&this.calculateHeights()}calculateHeights(e){if(!d.canUseDOM)return;const t=W("div"),i=W("span"),a=W("ul"),o=W("li"),h=()=>o("<span>02</span>","k-item"),u=()=>a([h()],"k-reset"),c=()=>t([u()],"k-content k-scrollable k-time-container"),m=(()=>t([i("minute","k-title"),t([c()],"k-time-list")],"k-time-list-wrapper",{left:"-10000px",position:"absolute"}))(),f=e&&e.querySelector(".k-time-container")||document.body,v=f.appendChild(m);this.timeListHeight=v.querySelector(".k-scrollable").offsetHeight,this.itemHeight=v.querySelector("li").offsetHeight,f.removeChild(v),this.didCalculate=!0}}const _t=24,en=s=>e=>e%s,Ts=en(_t),tn=(s,e)=>t=>Ts(s+t*e),Kt=(s,e)=>Ts(_t+s-e),Es=s=>(e,t)=>!t||l.getDate(e).getTime()===l.getDate(t).getTime()?e:We(e,s),sn=Es(0),nn=Es(_t-1);class Os{constructor(e){this.intl=e,this.boundRange=!1,this.insertUndividedMax=!1,this.min=null,this.max=null,this.step=0,this.toListItem=null}apply(e,t){return We(e,t.getHours())}configure(e){const{boundRange:t=this.boundRange,insertUndividedMax:i=this.insertUndividedMax,min:a=this.min,max:o=this.max,part:h,step:u=this.step}=e;this.boundRange=t,this.insertUndividedMax=i,this.toListItem=c=>{const p=We(L,c);return{text:this.intl.formatDate(p,h.pattern),value:p}},this.min=a,this.max=o,this.step=u}data(e){const[t]=this.range(e),i=tn(t,this.step),a=h=>this.toListItem&&this.toListItem(i(h)),o=Nt(0,this.countFromMin(e)).map(a);return this.addLast(o),e&&this.addMissing(o,e),o}isRangeChanged(e,t){return!this.min||!this.max?!1:!l.isEqual(this.min,e)||!l.isEqual(this.max,t)}limitRange(e,t,i){return this.boundRange?[sn(e,i),nn(t,i)]:[e,t]}total(e){const t=this.insertUndividedMax&&this.isLastMissing(e)?1:0,i=this.isMissing(e)?1:0;return this.countFromMin(e)+i+t}selectedIndex(e){return Math.ceil(this.divideByStep(e))}valueInList(e){return e?this.insertUndividedMax&&this.lastHour(e)===e.getHours()||!this.isMissing(e):!0}addLast(e,t){return this.insertUndividedMax&&this.isLastMissing(t)&&this.toListItem&&e.push(this.toListItem(this.lastHour(t))),e}addMissing(e,t){if(this.valueInList(t))return e;if(this.toListItem){const i=this.toListItem(t.getHours());e.splice(this.selectedIndex(t),0,i)}return e}countFromMin(e){const[t,i]=this.range(e);return Math.floor(Kt(i,t)/this.step)+1}isMissing(e){return e?this.selectedIndex(e)!==this.divideByStep(e):!1}isLastMissing(e){return this.max!==null&&this.isMissing(We(this.max,this.lastHour(e)))}divideByStep(e){return Kt(e.getHours(),this.min.getHours())/this.step}lastHour(e){return this.range(e)[1]}range(e){const[t,i]=this.limitRange(this.min,this.max,e);return[t.getHours(),i.getHours()]}}const Ht=60,an=s=>e=>e%s,Vs=an(Ht),on=(s,e)=>t=>Vs(s+t*e),jt=(s,e)=>Vs(Ht+s-e),Ps=s=>(e,t)=>!t||e.getHours()===t.getHours()?e:Ue(e,s),rn=Ps(0),ln=Ps(Ht-1);class Ns{constructor(e){this.intl=e,this.toListItem=null,this.min=null,this.max=null,this.step=0,this.insertUndividedMax=!1}apply(e,t){return Ue(e,t.getMinutes())}configure(e){const{insertUndividedMax:t=this.insertUndividedMax,min:i=this.min,max:a=this.max,part:o,step:h=this.step}=e;this.insertUndividedMax=t,this.toListItem=u=>{const c=Ue(L,u);return{text:this.intl.formatDate(c,o.pattern),value:c}},this.min=i,this.max=a,this.step=h}data(e){const[t]=this.range(e),i=on(t,this.step),a=h=>this.toListItem&&this.toListItem(i(h)),o=Nt(0,this.countFromMin(e)).map(a);return this.addLast(o),e&&this.addMissing(o,e),o}isRangeChanged(e,t){return this.min!==null&&this.max!==null&&(!l.isEqual(this.min,e)||!l.isEqual(this.max,t))}limitRange(e,t,i){return[rn(e,i),ln(t,i)]}total(e){const t=this.insertUndividedMax&&this.isLastMissing(e)?1:0,i=this.isMissing(e)?1:0;return this.countFromMin(e)+i+t}selectedIndex(e){return Math.ceil(this.divideByStep(e))}valueInList(e){return e?this.insertUndividedMax&&this.lastMinute(e)===e.getMinutes()||!this.isMissing(e):!0}addLast(e,t){return this.insertUndividedMax&&this.isLastMissing(t)&&this.toListItem&&e.push(this.toListItem(this.lastMinute(t))),e}addMissing(e,t){if(this.valueInList(t))return e;if(this.toListItem){const i=this.toListItem(t.getMinutes());e.splice(this.selectedIndex(t),0,i)}return e}countFromMin(e){const[t,i]=this.range(e);return Math.floor(jt(i,t)/this.step)+1}isMissing(e){return e?this.selectedIndex(e)!==this.divideByStep(e):!1}isLastMissing(e){return this.max!==null&&this.isMissing(Ue(this.max,this.lastMinute(e)))}divideByStep(e){return jt(e.getMinutes(),this.min.getMinutes())/this.step}lastMinute(e){return this.range(e)[1]}range(e){const[t,i]=this.limitRange(this.min,this.max,e);return[t.getMinutes(),i.getMinutes()]}}const At=60,hn=s=>e=>e%s,Rs=hn(At),cn=(s,e)=>t=>Rs(s+t*e),Zt=(s,e)=>Rs(At+s-e),Fs=s=>(e,t)=>!t||e.getMinutes()===t.getMinutes()&&e.getHours()===t.getHours()?e:Ye(e,s),un=Fs(0),dn=Fs(At-1);class Ls{constructor(e){this.intl=e,this.toListItem=null,this.min=null,this.max=null,this.step=0,this.insertUndividedMax=!1}apply(e,t){return Ye(e,t.getSeconds())}configure(e){const{insertUndividedMax:t=this.insertUndividedMax,min:i=this.min,max:a=this.max,part:o,step:h=this.step}=e;this.insertUndividedMax=t,this.toListItem=u=>{const c=Ye(L,u);return{text:this.intl.formatDate(c,o.pattern),value:c}},this.min=i,this.max=a,this.step=h}data(e){const[t]=this.range(e),i=cn(t,this.step),a=h=>this.toListItem&&this.toListItem(i(h)),o=Nt(0,this.countFromMin(e)).map(a);return this.addLast(o),e&&this.addMissing(o,e),o}isRangeChanged(e,t){return this.min!==null&&this.max!==null&&(!l.isEqual(this.min,e)||!l.isEqual(this.max,t))}limitRange(e,t,i){return[un(e,i),dn(t,i)]}total(e){const t=this.insertUndividedMax&&this.isLastMissing(e)?1:0,i=this.isMissing(e)?1:0;return this.countFromMin(e)+i+t}selectedIndex(e){return Math.ceil(this.divideByStep(e))}valueInList(e){return e?this.insertUndividedMax&&this.lastSecond(e)===e.getSeconds()||!this.isMissing(e):!0}divideByStep(e){return Zt(e.getSeconds(),this.min.getSeconds())/this.step}addLast(e,t){return this.insertUndividedMax&&this.isLastMissing(t)&&this.toListItem&&e.push(this.toListItem(this.lastSecond(t))),e}addMissing(e,t){if(this.valueInList(t))return e;if(this.toListItem){const i=this.toListItem(t.getSeconds());e.splice(this.selectedIndex(t),0,i)}return e}countFromMin(e){const[t,i]=this.range(e);return Math.floor(Zt(i,t)/this.step)+1}isMissing(e){return e?this.selectedIndex(e)!==this.divideByStep(e):!1}isLastMissing(e){return this.max!==null&&this.isMissing(Ye(this.max,this.lastSecond(e)))}lastSecond(e){return this.range(e)[1]}range(e){const[t,i]=this.limitRange(this.min,this.max,e);return[t.getSeconds(),i.getSeconds()]}}const pn=2,Gt=.05,mn=100,gn=0,Xt=9,fn={[d.Keys.end]:(s,e)=>s[s.length-1],[d.Keys.home]:(s,e)=>s[0],[d.Keys.up]:(s,e)=>s[e-1],[d.Keys.down]:(s,e)=>s[e+1]},It={[j.dayperiod]:Ms,[j.hour]:Os,[j.minute]:Ns,[j.second]:Ls},fe=class extends r.Component{constructor(s){super(s),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=e=>{Promise.resolve().then(()=>{this.element&&this.element.focus(e)})},this.itemOffset=e=>{if(!this.virtualization||!this.service)return-1;const t=this.service.selectedIndex(this.props.value),i=this.virtualization.activeIndex(),a=this.virtualization.itemOffset(i),o=Math.abs(Math.ceil(e)-a);if(t===i&&o<pn)return a;const h=t>i;return h&&o>=this.bottomThreshold||!h&&o>this.topThreshold?this.virtualization.itemOffset(i+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+=Xt,this.bottomOffset+=Xt*2),this.topThreshold=this.itemHeight*Gt,this.bottomThreshold=this.itemHeight*(1-Gt))},this.configureServices=({min:e,max:t,value:i}=this.props)=>{if(this.service){const[a,o]=this.service.limitRange(e||this.min,t||this.max,i||this.props.value);this.service.configure(this.serviceSettings({min:a,max:o}))}},this.serviceSettings=e=>{const t={boundRange:this.props.boundRange||fe.defaultProps.boundRange,insertUndividedMax:!1,min:l.cloneDate(this.min),max:l.cloneDate(this.max),part:this.props.part,step:this.step},i=Object.assign({},t,e);return i.boundRange=i.part.type!=="hour"||this.props.boundRange||fe.defaultProps.boundRange,i},this.handleScrollAction=({target:e,animationInProgress:t})=>{if(!(!this.virtualization||!this.service)&&e&&!t){this.animateToIndex=!1;const i=this.virtualization.itemIndex(this.itemOffset(e.scrollTop)),a=this.service.data(this.props.value)[i];this.handleChange(a)}},this.handleFocus=e=>{const{onFocus:t}=this.props;t&&t.call(void 0,e)},this.handleBlur=e=>{const{onBlur:t}=this.props;t&&t.call(void 0,e)},this.handleMouseOver=()=>{if(!this._element)return;const e=d.getActiveElement(document);document&&e!==this._element&&this.props.show&&this._element.focus({preventScroll:!0})},this.handleKeyDown=e=>{if(!this.service)return;const{keyCode:t}=e;(t===d.Keys.down||t===d.Keys.up||t===d.Keys.end||t===d.Keys.home)&&e.preventDefault();const a=(fn[e.keyCode]||d.noop)(this.service.data(this.props.value),this.service.selectedIndex(this.props.value));a&&this.handleChange(a)},this.handleChange=ii(e=>{if(!this.service)return;const t=this.service.apply(this.props.value,e.value);if(this.props.value.getTime()===t.getTime())return;const{onChange:i}=this.props;i&&i.call(void 0,t)},mn),this.dom=new Qi}get element(){return this._element}get animate(){return!!(this.props.smoothScroll&&this.animateToIndex)}get min(){return this.props.min||fe.defaultProps.min}get max(){return this.props.max||fe.defaultProps.max}get step(){return this.props.step!==void 0&&this.props.step!==0?Math.floor(this.props.step):fe.defaultProps.step}componentDidMount(){Promise.resolve().then(()=>{this._element&&(this.dom.calculateHeights(this._element),this.forceUpdate())})}componentDidUpdate(){if(!this.virtualization||!this.service)return;const s=this.service.selectedIndex(this.props.value);this.virtualization[this.animate?"animateToIndex":"scrollToIndex"](s),this.animateToIndex=!0}render(){if(!this.props.part.type||!It[this.props.part.type])return;this.calculateHeights(),this.intl=k.provideIntlService(this),this.service=new It[this.props.part.type](this.intl),this.configureServices();const s=this.service.data(this.props.value),e="translateY("+this.topOffset+"px)",t=this.service.total(this.props.value),i=r.createElement("ul",{style:{transform:e,msTransform:e},className:"k-reset"},s.map((a,o)=>r.createElement("li",{key:o,className:"k-item",onClick:()=>{this.handleChange(a)}},r.createElement("span",null,a.text))));return r.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?r.createElement(Ce,{bottomOffset:this.bottomOffset,children:i,className:"k-time-container",itemHeight:this.itemHeight,maxScrollDifference:this.listHeight,onScrollAction:this.handleScrollAction,ref:a=>{this.virtualization=a},role:"presentation",skip:gn,tabIndex:-1,take:t,topOffset:this.topOffset,total:t}):r.createElement("div",{className:"k-time-container"},i))}};let He=fe;He.propTypes={id:n.number,max:n.instanceOf(Date),min:n.instanceOf(Date),part:function(s,e,t){const i=s[e];if(!i||!It[i.type])throw new Error(`
16
16
  Invalid prop '${e}' supplied to ${t}.
17
17
  Supported part types are hour|minute|second|dayperiod.
18
18
  `);return null},step:function(s,e,t){const i=s[e];if(i!==void 0&&i<=0)throw new Error(`
19
19
  Invalid prop '${e}' supplied to ${t}.
20
20
  ${e} cannot be less than 1.
21
- `);return null},value:n.instanceOf(Date),smoothScroll:n.bool,show:n.bool};He.defaultProps={boundRange:!1,max:oe,min:L,step:1,smoothScroll:!0};k.registerForIntl(He);const mt=new RegExp(`${j.hour}|${j.minute}|${j.second}|${j.dayperiod}|literal`),he=class extends r.Component{constructor(s){super(s),this._element=null,this._nowButton=null,this.dateFormatParts=[],this.timeLists=[],this.focus=e=>{Promise.resolve().then(()=>{const t=this.timeLists[0];this.state.activeListIndex===-1&&!this.hasActiveButton()&&t&&t.element&&t.focus(e)})},this.timeFormatReducer=(e,t)=>e+t.pattern,this.timeFormatFilter=(e,t,i)=>{const a=t>=1&&i[t-1];return a&&a&&e.type==="literal"?mt.test(a.type||""):mt.test(e.type||"")},this.focusList=e=>{this.timeLists.length&&this.timeLists.reduce(this.listReducer,[]).map(t=>e===1?t.next:t.prev).map(t=>t&&t.element&&t.element.focus({preventScroll:!0}))},this.listReducer=(e,t,i,a)=>e.length||t.props.id!==this.state.activeListIndex?e:[{next:a[i+1]||t,prev:a[i-1]||t}],this.showNowButton=()=>!this.hasSteps()&&this.props.nowButton&&Ft(ue(),this.min,this.max),this.handleKeyDown=e=>{const{keyCode:t}=e;switch(t){case d.Keys.left:e.preventDefault(),this.focusList(0);return;case d.Keys.right:e.preventDefault(),this.focusList(1);return;default:return}},this.handleListBlur=()=>{this.nextTick(()=>{this.setState({activeListIndex:-1})})},this.handleListFocus=e=>{clearTimeout(this.nextTickId),this.setState({activeListIndex:e})},this.handleChange=e=>{const{onChange:t}=this.props;t&&t.call(void 0,e)},this.snapTime=Yt(Ut(this.props.steps,this.props.min||he.defaultProps.min)),this.state={activeListIndex:-1},this.hasActiveButton=this.hasActiveButton.bind(this)}get element(){return this._element}get value(){return Yi(this.snapTime(l.cloneDate(this.props.value||L)),this.min,this.max)}get intl(){return k.provideIntlService(this)}get min(){return this.snapTime(this.props.min||he.defaultProps.min)}get max(){return this.snapTime(this.props.max||he.defaultProps.max)}get steps(){return this.props.steps||he.defaultProps.steps}get boundRange(){return this.props.boundRange!==void 0?this.props.boundRange:he.defaultProps.boundRange}componentWillUnmount(){clearTimeout(this.nextTickId)}componentDidMount(){const{onMount:s}=this.props;s&&s.call(void 0,this.value)}render(){const{format:s,smoothScroll:e,onNowClick:t,className:i,disabled:a,mobileMode:o,show:h}=this.props;this.snapTime=Yt(Ut(this.steps,this.min)),this.dateFormatParts=this.intl.splitDateFormat(s||he.defaultProps.format).filter(this.timeFormatFilter);const u=d.classNames({"k-disabled":a,"k-time-part":o},i);this.timeLists=[];const c=k.provideLocalizationService(this),p=c.toLanguageString(bt,M[bt]);return r.createElement("div",{className:u},r.createElement("div",{className:"k-time-header"},r.createElement("span",{className:"k-title"},this.intl.formatDate(this.value,this.dateFormatParts.reduce(this.timeFormatReducer,""))),this.showNowButton()&&r.createElement(N.Button,{type:"button",ref:m=>{this._nowButton=m},className:"k-time-now",fillMode:"flat",themeColor:"primary",title:p,"aria-label":p,onClick:t,tabIndex:a?-1:0},c.toLanguageString(wt,M[wt]))),r.createElement("div",{className:"k-time-list-container",onKeyDown:this.handleKeyDown},r.createElement("span",{className:"k-time-highlight"}),this.dateFormatParts.map((m,g)=>m.type!=="literal"?r.createElement("div",{key:g,className:d.classNames("k-time-list-wrapper",{"k-focus":g===this.state.activeListIndex}),role:"presentation",tabIndex:-1},r.createElement("span",{className:"k-title",onMouseDown:f=>{f.preventDefault()}},this.intl.dateFieldName(m)),r.createElement(He,{min:this.min,max:this.max,boundRange:this.boundRange,part:m,step:m.type?this.steps[m.type]:1,smoothScroll:e,ref:f=>{f&&this.timeLists.push(f)},id:g,onFocus:()=>{this.handleListFocus(g)},onBlur:this.handleListBlur,onChange:this.handleChange,value:this.value,disabled:a,show:h,mobileMode:o})):r.createElement("div",{key:g,className:"k-time-separator"},m.pattern))))}nextTick(s){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>s())}hasActiveButton(){const s=d.getActiveElement(document);return this._nowButton&&s===this._nowButton.element}hasSteps(){const s=Object.keys(this.steps);return s.length!==s.reduce((e,t)=>e+this.steps[t],0)}};let pe=he;pe.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};pe.defaultProps={value:null,disabled:!1,nowButton:!0,cancelButton:!0,format:"hh:mm a",min:de,max:oe,steps:{},boundRange:!1};k.registerForIntl(pe);k.registerForLocalization(pe);const Mt=class extends r.Component{constructor(s){super(s),this._element=null,this._cancelButton=null,this._acceptButton=null,this.timePart=null,this.focusActiveList=()=>{this.timePart&&this.timePart.focus({preventScroll:!0})},this.handleKeyDown=e=>{const{keyCode:t}=e;switch(t){case d.Keys.enter:this.hasActiveButton()||this.handleAccept(e);return;default:return}},this.handleAccept=e=>{const t=this.mergeValue(l.cloneDate(this.value||ue()),this.timePart?this.timePart.value:this.current);this.setState({value:t}),this.valueDuringOnChange=t;const{onChange:i}=this.props;i&&i.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0},this.handleReject=e=>{this.setState({current:this.value});const{onReject:t}=this.props;t&&t.call(void 0,e)},this.handleNowClick=e=>{const t=this.mergeValue(l.cloneDate(this.value||ue()),ue());this.setState({current:t,value:t}),this.valueDuringOnChange=t;const{onChange:i}=this.props;i&&i.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0},this.handleChange=e=>{this.setState({current:e});const{handleTimeChange:t}=this.props;t&&t.call(void 0,{time:e})},this.dateFormatParts=this.intl.splitDateFormat(this.props.format||Mt.defaultProps.format),this.mergeValue=Ui(Wi(this.dateFormatParts)),this.hasActiveButton=this.hasActiveButton.bind(this),this.state={current:this.props.value||L,value:this.props.value||Mt.defaultProps.value}}get element(){return this._element}get value(){const s=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return s!==null?l.cloneDate(s):null}get intl(){return k.provideIntlService(this)}get current(){return this.state.current!==null?l.cloneDate(this.state.current):null}componentWillUnmount(){clearTimeout(this.nextTickId)}render(){const{format:s,cancelButton:e,disabled:t,tabIndex:i,className:a,smoothScroll:o,min:h,max:u,boundRange:c,nowButton:p,steps:m,show:g,mobileMode:f}=this.props,v=k.provideLocalizationService(this),C=v.toLanguageString(Je,M[Je]),I=v.toLanguageString(Ne,M[Ne]);return r.createElement("div",{ref:T=>{this._element=T},tabIndex:t?void 0:i||0,className:d.classNames("k-timeselector",a,{"k-disabled":t}),onKeyDown:this.handleKeyDown},r.createElement(pe,{ref:T=>{this.timePart=T},value:this.current,onChange:this.handleChange,onNowClick:this.handleNowClick,format:s,smoothScroll:o,min:h,max:u,boundRange:c,disabled:t,nowButton:p,steps:m,show:g,mobileMode:f}),this.props.footer&&r.createElement("div",{className:"k-time-footer k-actions k-actions-stretched"},e&&r.createElement(N.Button,{type:"button",ref:T=>{this._cancelButton=T},className:"k-time-cancel",onClick:this.handleReject,title:C,"aria-label":C},C),r.createElement(N.Button,{type:"button",ref:T=>{this._acceptButton=T},className:"k-time-accept",themeColor:"primary",onClick:this.handleAccept,title:I,"aria-label":I},I)))}nextTick(s){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>s())}hasActiveButton(){if(!this._acceptButton||!this._acceptButton.element)return!1;const s=d.getActiveElement(document);return this._acceptButton&&s===this._acceptButton.element||this._cancelButton&&s===this._cancelButton.element}};let Te=Mt;Te.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};Te.defaultProps={value:null,disabled:!1,cancelButton:!0,format:"t",min:de,max:oe,boundRange:!1,footer:!0};k.registerForIntl(Te);k.registerForLocalization(Te);const K=class extends r.Component{constructor(s){super(s),this._element=null,this._dateInput=r.createRef(),this._timeSelector=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.focus=()=>{this.dateInput&&this.dateInput.focus()},this.renderTimeSelector=()=>{const{smoothScroll:e,cancelButton:t,nowButton:i,disabled:a,format:o,steps:h}=this.props;return r.createElement(Te,{ref:this.setTimeSelectorRef,className:this.mobileMode?"k-reset k-timeselector-lg":"",mobileMode:this.mobileMode,show:this.show,cancelButton:t,disabled:a,nowButton:i,format:o,min:this.min,max:this.max,steps:h,smoothScroll:e,value:this.value,footer:!this.mobileMode,handleTimeChange:this.mobileMode&&this.handleTimeChange,onChange:this.handleValueChange,onReject:this.handleValueReject})},this.renderPopup=()=>{const{popupClass:e,...t}=this.popupSettings,i=d.classNames("k-group k-reset",e),a={popupClass:"k-timepicker-popup",show:this.show,animate:this.element!==null,anchor:this.element,className:i,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...t};return this.props.popup?r.createElement(this.props.popup,{...a},this.renderTimeSelector()):r.createElement(Qe.Popup,{...a},this.renderTimeSelector())},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,t={expand:this.show,onClose:this.handleBlur,adaptiveTitle:this.props.adaptiveTitle,windowWidth:e,footer:{cancelText:this.localizationService.toLanguageString(qe,M[Je]),onCancel:this.handleValueReject,applyText:this.localizationService.toLanguageString(Ne,M[Ne]),onApply:i=>this.handleValueChange(i)}};return r.createElement(st,{...t},r.createElement(ce.ActionSheetContent,{className:"!k-overflow-hidden"},this.renderTimeSelector()))},this.setTimeSelectorRef=e=>{this._timeSelector=e},this.nextValue=(e,t)=>e.value!==void 0?e.value:t.value,this.nextShow=(e,t)=>e.show!==void 0?e.show:t.show,this.handleInputValueChange=e=>{const t=this.mergeTime(e.value);this.handleValueChange({...e,value:t})},this.handleTimeChange=e=>{this.setState({candidate:e.time})},this.handleValueChange=e=>{this.setState({value:l.cloneDate(e.value||this.state.candidate)}),this.valueDuringOnChange=e.value,this.showDuringOnChange=!1,this.shouldFocusDateInput=!0;const{onChange:t}=this.props,i=this.value||this.state.candidate;t&&t.call(void 0,{syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:i,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=e=>{this.setShow(!1)},this.handleIconClick=e=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=e=>{e.preventDefault()},this.handleKeyDown=e=>{const{altKey:t,keyCode:i}=e;if(i===d.Keys.esc){this.shouldFocusDateInput=!0,this.setShow(!1);return}t&&(i===d.Keys.up||i===d.Keys.down)&&(e.preventDefault(),e.stopPropagation(),this.shouldFocusDateInput=i===d.Keys.up,this.setShow(i===d.Keys.down))},d.validatePackage(Se),this.state={value:this.props.defaultValue||K.defaultProps.defaultValue,show:this.props.defaultShow||K.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 s=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return s!==null?l.cloneDate(s):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 s=this.value&&this.normalizeTime(this.value),e=this.normalizeTime(this.min),t=this.normalizeTime(this.max),i=$i(s,e,t),a=this.props.validationMessage!==void 0,o=(!this.required||this.value!==null)&&i,h=this.props.valid!==void 0?this.props.valid:o;return{customError:a,rangeOverflow:ji(s,t),rangeUnderflow:Ki(s,e),valid:h,valueMissing:this.value===null}}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=it&&this.props.adaptive)}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:K.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:K.defaultProps.required}get popupSettings(){return this.props.popupSettings||K.defaultProps.popupSettings}get min(){return this.props.min!==void 0?this.props.min:K.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:K.defaultProps.max}get dateInputComp(){return this.props.dateInput||K.defaultProps.dateInput}get localizationService(){return k.provideLocalizationService(this)}componentDidMount(){var s;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(s=this.document)!=null&&s.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 s;(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:s=K.defaultProps.size,rounded:e=K.defaultProps.rounded,fillMode:t=K.defaultProps.fillMode,disabled:i,tabIndex:a,title:o,id:h,className:u,format:c,formatPlaceholder:p,width:m,name:g,steps:f,validationMessage:v,required:C,validityStyles:I,ariaLabelledBy:T,ariaDescribedBy:b}=this.props,E=!this.validityStyles||this.validity.valid,w={disabled:i,format:c,formatPlaceholder:p,id:h,ariaLabelledBy:T,ariaDescribedBy:b,max:this.normalizeTime(this.max),min:this.normalizeTime(this.min),name:g,onChange:this.handleInputValueChange,required:C,steps:f,tabIndex:this.show?-1:a,title:o,valid:this.validity.valid,validationMessage:v,validityStyles:I,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},A=this.localizationService.toLanguageString(qe,M[qe]),O=this.localizationService.toLanguageString(Dt,M[Dt]),P=r.createElement(d.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.mobileMode?void 0:this.handleBlur,onSyncBlur:this.props.onBlur,onSyncFocus:this.props.onFocus},({onFocus:B,onBlur:x})=>r.createElement(r.Fragment,null,r.createElement("div",{id:this.props.id,ref:V=>{this._element=V},className:d.classNames("k-input","k-timepicker",{[`k-input-${d.kendoThemeMaps.sizeMap[s]||s}`]:s,[`k-rounded-${d.kendoThemeMaps.roundedMap[e]||e}`]:e,[`k-input-${t}`]:t,["k-invalid"]:!E,["k-required"]:this.required,["k-disabled"]:this.props.disabled},u),onKeyDown:this.handleKeyDown,style:{width:m},onFocus:B,onBlur:x,onClick:this.mobileMode?this.handleIconClick:void 0},r.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",ariaControls:this._popupId,...w}),r.createElement(N.Button,{tabIndex:-1,type:"button",icon:"clock",svgIcon:J.clockIcon,onMouseDown:this.handleIconMouseDown,onClick:this.mobileMode?void 0:this.handleIconClick,title:O,className:"k-input-button",rounded:null,"aria-label":A}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup()));return this.props.label?r.createElement(Lt,{dateInput:this._dateInput,label:this.props.label,editorId:h,editorValid:E,editorDisabled:this.props.disabled,children:P,style:{width:this.props.width}}):P}normalizeTime(s){return q(L,s)}setShow(s){const{onOpen:e,onClose:t}=this.props;this.show!==s&&(this.setState({show:s}),s&&e&&e.call(void 0,{target:this}),!s&&t&&t.call(void 0,{target:this}))}mergeTime(s){return this.value&&s?q(this.value,s):s}calculateMedia(s){for(let e of s)this.setState({windowWidth:e.target.clientWidth})}};let Ee=K;Ee.displayName="TimePicker";Ee.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"])};Ee.defaultProps={defaultShow:!1,defaultValue:null,disabled:!1,format:"t",max:oe,min:de,popupSettings:{},tabIndex:0,steps:{},required:!1,validityStyles:!0,dateInput:ae,size:"medium",rounded:"medium",fillMode:"solid"};const Hs=d.createPropsContext(),As=d.withIdHOC(d.withPropsContext(Hs,Ee));As.displayName="KendoReactTimePicker";k.registerForLocalization(Ee);const Jt=2,Tt=class extends r.Component{constructor(s){super(s),this._element=null,this.isActive=!1,this.focusActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus"),t=this._element.querySelector(".k-state-pending-focus");e&&e[0]&&e[0].classList.remove("k-focus"),t&&t.classList.add("k-focus"),this.isActive=!0},this.blurActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus");e&&e.classList.remove("k-focus"),this.isActive=!1},this.rotateSelectionRange=e=>{if(e.start===null||e.end===null)return e;const t=e.end<e.start;return{start:t?e.end:e.start,end:t?e.start:e.end}},this.handleDateChange=(e,t=!1)=>{const{onChange:i}=this.props;if(i){const a={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:l.cloneDate(e.value),target:this,isTodayClick:t};i.call(void 0,a)}}}get element(){return this._element}get weekNumber(){return!!(this.props.showWeekNumbers&&this.props.activeView===S.month)}get min(){return this.props.min!==void 0?this.props.min:Tt.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:Tt.defaultProps.max}componentDidUpdate(){this.isActive&&this.focusActiveDate()}render(){const s=this.props.allowReverse?this.rotateSelectionRange(this.props.selectionRange):this.props.selectionRange,e=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===S.month,"k-calendar-yearview":this.props.activeView===S.year,"k-calendar-decadeview":this.props.activeView===S.decade,"k-calendar-centuryview":this.props.activeView===S.century});return r.createElement("div",{ref:t=>{this._element=t},className:e},this.props.dates.map(t=>r.createElement("table",{className:"k-calendar-table k-content",key:t.getTime(),role:"grid"},r.createElement(Le,{bus:this.props.bus,service:this.props.service,key:t.getTime(),direction:"horizontal",activeView:this.props.activeView,cellUID:this.props.cellUID,viewDate:t,min:this.min,max:this.max,focusedDate:this.props.focusedDate,selectionRange:s,selectedDate:this.props.value,showWeekNumbers:this.weekNumber,onChange:this.handleDateChange,onCellEnter:this.props.onCellEnter,cell:this.props.cell,weekCell:this.props.weekCell}))))}};let ke=Tt;ke.defaultProps={showWeekNumbers:!1,views:Jt,take:Jt,allowReverse:!0,min:te,max:se};const gt=(s=Q.defaultProps.min,e=Q.defaultProps.max,t)=>t instanceof Date&&!Array.isArray(t)&&F(l.getDate(t),s,e)?l.getDate(t):null,Qt=(s=Q.defaultProps.min,e=Q.defaultProps.max,t)=>Array.isArray(t)?t.filter(i=>F(i,s,e)).map(i=>l.getDate(i)):null,es=s=>typeof s=="object"&&!(s instanceof Date)&&s!==null&&!Array.isArray(s)?s:_,ts=(s,e,t)=>s||e&&e[0]||t&&t.start,wn=(s,e)=>s.start===null&&e===null?"start":s.end===null?"end":"start",ve=class extends r.Component{constructor(s){super(s),this.dates=[],this.selectedDate=null,this.selectedMultiple=null,this.selectedRange=_,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:g}=p;const f=p.start!==null&&c.getTime()<=p.start.getTime();return!this.props.allowReverse&&f?{start:c,end:this.selectedRange.start}:this.activeRange!=="end"?{start:c,end:m}:{start:g||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:g}=p;return this.activeRange!=="end"?m!==null&&c>m:g!==null&&c<g},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=D.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(D.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 g;switch(this.props.mode){case"single":g=l.cloneDate(c.value);break;case"multiple":if(Array.isArray(this.selectedMultiple)){let v=this.selectedMultiple.slice(),C=-1;v.forEach((I,T)=>{l.isEqualDate(I,c.value)&&(C=T)}),C!==-1?v.splice(C,1):v.push(l.cloneDate(c.value)),g=v.slice()}else this.selectedDate?g=[l.cloneDate(this.selectedDate),l.cloneDate(c.value)]:g=[l.cloneDate(c.value)];break;case"range":{g=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:g=l.cloneDate(c.value);break}this.valueDuringOnChange=g,c.isTodayClick&&this.setState({navigateDate:p}),this.setState({value:g,focusedDate:p}),this.valueDuringOnChange=g;const{onChange:f}=this.props;if(f){const v={syntheticEvent:c.syntheticEvent,nativeEvent:c.nativeEvent,value:g,target:this};f.call(void 0,v)}this.valueDuringOnChange=void 0};const e=s.value!==void 0?s.value:s.defaultValue||ve.defaultProps.defaultValue,t=gt(this.min,this.max,e),i=Qt(this.min,this.max,e),a=es(e),o=ts(t,i,a),h=$e(S[s.defaultActiveView],this.bottomView,this.topView),u=U(s.focusedDate||o||H(),this.min,this.max);this.state={value:e,activeView:h,focusedDate:u,navigateDate:u},this.activeRangeEnd=wn(a,t),this.bus=new Et(this.handleViewChange),this.navigation=new Ot(this.bus),this.calculateFocusFromValue=!1,this.lastView=h,this.lastViewsCount=this.props.views||ke.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:ve.defaultProps.min)}get max(){return l.getDate(this.props.max!==void 0?this.props.max:ve.defaultProps.max)}get bottomView(){return S[this.props.bottomView!==void 0?this.props.bottomView:ve.defaultProps.bottomView]}get topView(){return S[this.props.topView!==void 0?this.props.topView:ve.defaultProps.topView]}get activeRange(){return this.props.activeRangeEnd!==void 0?this.props.activeRangeEnd:this.activeRangeEnd}get todayIsInRange(){return F(H(),l.getDate(this.min),l.getDate(this.max))}componentDidMount(){this.calculateFocusFromValue=!0}componentDidUpdate(){this.calendarViewList&&(this.isActive?this.calendarViewList.focusActiveDate:this.calendarViewList.blurActiveDate)();const s=gt(this.min,this.max,this.value);this.calculateFocusFromValue=!!(this.selectedDate&&s&&this.selectedDate.getTime()&&s.getTime()),this.lastView=this.state.activeView,this.lastViewsCount=this.props.views||ke.defaultProps.views}render(){this.props._ref&&this.props._ref(this),this.intl=k.provideIntlService(this),this.localization=k.provideLocalizationService(this),this.bus.configure(this.bottomView,this.topView);const s=$e(this.state.activeView,this.bottomView,this.topView);this.service=this.bus.service(s,this.intl),this.selectedDate=gt(this.min,this.max,this.value),this.selectedMultiple=Qt(this.min,this.max,this.value),this.selectedRange=es(this.value);const e=ts(this.selectedDate,this.selectedMultiple,this.selectedRange);this._focusedDate=U(this.calculateFocusFromValue&&e!==null?e:this.state.focusedDate,this.min,this.max);const t=d.classNames("k-widget k-calendar k-calendar-range",{"k-disabled":this.props.disabled},this.props.className),i=this.rangeWithFocused(this.selectedRange,this.focusedDate),a=this.localization.toLanguageString(ft,M[ft]),o=this.localization.toLanguageString(vt,M[vt]),h=!this.canNavigate(D.PrevView),u=!this.canNavigate(D.NextView),c={"aria-disabled":h},p={"aria-disabled":u},m=this.lastView!==s,g=this.dates&&this.isInMonth(this.state.navigateDate,this.dates[0]),f=this.lastViewsCount!==this.props.views;(!g||m||f)&&(this.dates=this.service.datesList(this.state.navigateDate,this.props.views||ke.defaultProps.views));const v=l.cloneDate(this.dates&&this.dates[0]?this.dates[0]:H());return r.createElement("div",{ref:C=>{this._element=C},className:t,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},r.createElement(xe,{key:`.kendo.calendar.header.${v.getTime()}`,activeView:s,currentDate:v,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:r.createElement(r.Fragment,null,r.createElement(N.Button,{type:"button",className:"k-calendar-nav-prev",icon:this.isRtl?"chevron-right":"chevron-left",svgIcon:this.isRtl?J.chevronRightIcon:J.chevronLeftIcon,fillMode:"flat",title:a,disabled:h,onClick:this.handlePrevButtonClick,...c}),r.createElement(Ie,{min:this.min,max:this.max,onClick:this.handleTodayClick,disabled:!this.todayIsInRange}),r.createElement(N.Button,{type:"button",className:"k-calendar-nav-next",icon:this.isRtl?"chevron-left":"chevron-right",svgIcon:this.isRtl?J.chevronLeftIcon:J.chevronRightIcon,fillMode:"flat",title:o,disabled:u,onClick:this.handleNextButtonClick,...p}))}),r.createElement(ke,{ref:C=>{this.calendarViewList=C},dates:this.dates,activeView:s,focusedDate:this.focusedDate,min:this.min,max:this.max,bus:this.bus,service:this.service,selectionRange:i,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(s,e){return!!e&&l.firstDayOfMonth(e)<=s&&s<=l.lastDayOfMonth(e)}};let Q=ve;Q.displayName="MultiViewCalendar";Q.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([ee(n.instanceOf(Date)),n.arrayOf(n.instanceOf(Date)),n.shape({start:ee(n.instanceOf(Date)),end:ee(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([ee(n.instanceOf(Date)),n.arrayOf(n.instanceOf(Date)),n.shape({start:ee(n.instanceOf(Date).isRequired),end:ee(n.instanceOf(Date).isRequired)})]),views:(s,e,t)=>{const i=s[e];return i!==void 0&&i<1?new Error(`Invalid prop '${e}' supplied to'${t}'. The '${e}' property cannot be less than 1'`):null},weekNumber:n.bool,dir:n.string};Q.defaultProps={disabled:!1,min:te,max:se,navigation:!0,defaultActiveView:"month",defaultValue:null,topView:"century",tabIndex:0,bottomView:"month",views:2,allowReverse:!1};const Bs=d.createPropsContext(),Bt=d.withIdHOC(d.withPropsContext(Bs,Q));Bt.displayName="KendoReactMultiViewCalendar";k.registerForIntl(Q);k.registerForLocalization(Q);const Pe=class extends r.Component{constructor(s){super(s),this._element=null,this._calendar=null,this._startDateInput=r.createRef(),this._endDateInput=r.createRef(),this.shouldFocusDateInput=!1,this.shouldFocusCalendar=!1,this.focus=()=>{this.startDateInput&&this.startDateInput.focus()},this.setCalendarRef=e=>{this._calendar=e},this.focusCalendarElement=()=>{this._calendar&&this._calendar.element&&this._calendar.element.focus({preventScroll:!0})},this.calculateValue=(e,t)=>(e.value!==void 0?e.value:t.value)||_,this.calculateShow=(e,t)=>e.show!==void 0?e.show:t.show,this.renderCalendar=()=>{const e=this.value||_,t={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:e,dir:this.props.dir,onChange:this.handleCalendarChange};return this.props.calendar?r.createElement(this.props.calendar,{...t}):r.createElement(Bt,{...t,ref:this.setCalendarRef})},this.renderPopup=()=>{const e={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?r.createElement(this.props.popup,{...e},this.renderCalendar()):r.createElement(Qe.Popup,{...e},this.renderCalendar())},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,t={expand:this.show,onClose:i=>this.handleCancel(i),adaptiveTitle:this.props.adaptiveTitle,windowWidth:e,footer:{cancelText:this.localizationService.toLanguageString(St,M[St]),onCancel:this.handleCancel,applyText:this.localizationService.toLanguageString(Ct,M[Ct]),onApply:this.handleBlur}};return r.createElement(st,{...t},r.createElement(ce.ActionSheetContent,{className:"!k-overflow-hidden"},r.createElement("div",{className:"k-scrollable-wrap"},this.renderCalendar())))},this.handleReverseClick=e=>{const t={start:this.value.end,end:this.value.start},i={syntheticEvent:e,nativeEvent:e.nativeEvent};this.handleChange(t,i)},this.handleReverseMouseDown=e=>{e.preventDefault()},this.handleFocus=e=>{clearTimeout(this.nextTickId),this.shouldFocusDateInput||(this.setShow(!0),this.mobileMode&&this.setState({currentValue:this.value}));const{onFocus:t}=this.props;t&&t.call(void 0,e)},this.handleBlur=e=>{this.nextTick(()=>{this.setShow(!1)});const{onBlur:t}=this.props;t&&t.call(void 0,e)},this.handleCancel=e=>{this.nextTick(()=>{this.setShow(!1),this.setState({currentValue:_})});const{onCancel:t}=this.props;t&&t.call(void 0,e)},this.handleEndChange=e=>{const t={start:this.value.start,end:l.cloneDate(e.value||void 0)};this.handleChange(t,e)},this.handleStartChange=e=>{const t={start:l.cloneDate(e.value||void 0),end:this.value.end};this.handleChange(t,e)},this.extractRangeFromValue=e=>{if(!Array.isArray(e.value)&&!(e.value instanceof Date))return e.value||_;const t=Array.isArray(e.value)?e.value[0]:e.value;return{start:this.value.end!==null?t:this.value.start,end:this.value.start!==null?t:this.value.end}},this.handleCalendarChange=e=>{const t=this.extractRangeFromValue(e);this.handleChange(t,e)},this.handleKeyDown=e=>{const{keyCode:t,altKey:i}=e,a=d.getActiveElement(document);t===d.Keys.esc?(e.preventDefault(),this.shouldFocusDateInput=!0,this.setShow(!1)):i&&t===d.Keys.down?(e.preventDefault(),this.shouldFocusCalendar=!0,this.setShow(!0)):t===d.Keys.tab&&this.show&&this._calendar&&this._calendar.element&&this.endDateInput&&this.endDateInput.element&&document&&a===this.endDateInput.element&&(e.preventDefault(),this.focusCalendarElement())},this.handleChange=(e,t)=>{this.setState({value:e}),this.valueDuringOnChange=e;const{onChange:i}=this.props;if(i){const a={syntheticEvent:t.syntheticEvent,nativeEvent:t.nativeEvent,value:this.value,show:this.show,target:this};i.call(void 0,a)}this.valueDuringOnChange=void 0},d.validatePackage(Se),this.state={show:this.props.show||this.props.defaultShow||Pe.defaultProps.defaultShow,value:this.props.value||this.props.defaultValue||Pe.defaultProps.defaultValue,currentValue:_},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)||_}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:Pe.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:Pe.defaultProps.max}get document(){if(d.canUseDOM)return this.element&&this.element.ownerDocument||document}get localizationService(){return k.provideLocalizationService(this)}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=it&&this.props.adaptive)}componentDidMount(){var s;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(s=this.document)!=null&&s.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 s;clearTimeout(this.nextTickId),(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.disconnect()}render(){const s=this.value||_,e=this.mobileMode&&this.show?this.state.currentValue:s,t=(this.props.startDateInputSettings||{}).id||this._startInputId,i=(this.props.endDateInputSettings||{}).id||this._endInputId,a=d.classNames("k-daterangepicker",{"k-disabled":this.props.disabled},this.props.className),o=this.localizationService.toLanguageString(Ze,M[Ze]),h=this.localizationService.toLanguageString(Ge,M[Ge]),u=this.localizationService.toLanguageString(Xe,M[Xe]),c={disableSelection:this.mobileMode&&!0,label:o,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:e.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:e.end,onChange:this.handleEndChange},m=r.createElement(N.Button,{type:"button",className:"k-select",fillMode:"flat",title:k.provideLocalizationService(this).toLanguageString(De,M[De]),onMouseDown:this.handleReverseMouseDown,onClick:this.handleReverseClick,"aria-controls":t+" "+i,"aria-label":k.provideLocalizationService(this).toLanguageString(De,M[De])},r.createElement(d.IconWrap,{style:{transform:"rotate(90deg)"},name:"arrows-swap",icon:J.arrowsSwapIcon}));return r.createElement(r.Fragment,null,r.createElement("span",{ref:g=>{this._element=g},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?r.createElement(this.props.startDateInput,{...c}):r.createElement(ae,{...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?r.createElement(this.props.endDateInput,{...p}):r.createElement(ae,{...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 s=d.getActiveElement(document);(this.value.start===null||this.value.end!==null)&&s!==this.endDateInput.element?this.startDateInput.element.focus({preventScroll:!0}):s!==this.startDateInput.element&&this.endDateInput.element.focus({preventScroll:!0})}nextTick(s){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>s())}setShow(s){const{onOpen:e,onClose:t}=this.props;this.show!==s&&(this.setState({show:s}),s&&e&&e.call(void 0,{target:this}),!s&&t&&t.call(void 0,{target:this}))}calculateMedia(s){for(let e of s)this.setState({windowWidth:e.target.clientWidth})}};let Oe=Pe;Oe.displayName="DateRangePicker";Oe.propTypes={allowReverse:n.bool,calendarSettings:n.any,className:n.string,defaultShow:n.bool,defaultValue:n.shape({start:ee(n.instanceOf(Date).isRequired),end:ee(n.instanceOf(Date).isRequired)}),disabled:n.bool,endDateInputSettings:n.shape(re.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:ee(n.instanceOf(Date).isRequired),end:ee(n.instanceOf(Date).isRequired)})};Oe.defaultProps={allowReverse:!1,defaultShow:!1,defaultValue:_,disabled:!1,format:"d",max:se,min:te,swapButton:!1};const zs=d.createPropsContext(),qs=d.withIdHOC(d.withPropsContext(zs,Oe));qs.displayName="KendoReactDateRangePicker";k.registerForLocalization(Oe);class zt extends r.Component{constructor(e){super(e),this._calendar=null,this._timePart=null,this._cancelButton=null,this._acceptButton=null,this._calendarWrap=null,this.shouldFocusPart=!1,this.focus=t=>{Promise.resolve().then(()=>{this.state.tab==="time"&&this._timePart&&this._timePart.focus(t);const i=this.calendarElement();this.state.tab==="date"&&i&&i.focus(t)})},this.calendarElement=()=>this._calendar&&this._calendar.element||this._calendarWrap&&this._calendarWrap.querySelector(".k-widget.k-calendar"),this.move=t=>{if(t==="right"&&this.state.tab==="time"||t==="left"&&this.state.tab==="date")return;const i=t==="left"?"date":"time";this.shouldFocusPart=!0,this.setState({tab:i})},this.dateTimeFooter=()=>{const{cancelButton:t}=this.props,i=this.localizationService.toLanguageString(Re,M[Re]),a=this.localizationService.toLanguageString(Fe,M[Fe]);return r.createElement("div",{className:"k-datetime-footer k-actions k-actions-stretched "},t&&r.createElement(N.Button,{type:"button",ref:o=>{this._cancelButton=o},className:"k-time-cancel",onClick:this.handleReject,title:i,"aria-label":i},i),r.createElement(N.Button,{type:"button",themeColor:"primary",ref:o=>{this._acceptButton=o},className:"k-time-accept",disabled:!this.hasDateValue,onClick:this.handleAccept,title:a,"aria-label":a},a))},this.handleReject=t=>{this.setState({dateValue:this.props.value,timeValue:this.props.value||L});const i=this.mergeDate(this.props.value,this.props.value||L);if(this.props.onReject){const a={nativeEvent:t.nativeEvent,syntheticEvent:t,target:this,value:i};this.props.onReject.call(void 0,a)}},this.handleAccept=(t,i)=>{if(!this.state.dateValue||!this.state.timeValue||!this.hasDateValue)return;const a=this.mergeDate(this.state.dateValue,i||this.state.timeValue);this.props.onChange.call(void 0,{syntheticEvent:t,nativeEvent:t.nativeEvent,value:a,target:this})},this.handleNowClick=t=>{this.setState({timeValue:ue()}),this.handleAccept(t,ue())},this.handleCalendarValueChange=t=>{t.syntheticEvent.stopPropagation(),this.setState({dateValue:t.value,tab:"time"}),this.shouldFocusPart=!0},this.handleTimeListContainerChange=t=>{this.setState({timeValue:t})},this.handleDateClick=t=>{t.stopPropagation(),this.move("left")},this.handleTimeClick=t=>{t.stopPropagation(),this.move("right")},this.handleKeyDown=t=>{const{keyCode:i,altKey:a}=t;switch(i){case d.Keys.enter:!this.hasActiveButton()&&this.hasDateValue&&this.handleAccept(t);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=t=>{this.setState({timeValue:t})},this.state={tab:"date",dateValue:this.props.value,timeValue:this.props.value||L}}get calendar(){return this._calendar}get timePart(){return this._timePart}get hasDateValue(){return this.state.dateValue!==null}get localizationService(){return k.provideLocalizationService(this)}componentDidUpdate(){this.shouldFocusPart&&this.focus({preventScroll:!0}),this.shouldFocusPart=!1}render(){const{disabled:e,min:t,max:i,weekNumber:a,focusedDate:o,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":e},"k-datetime-wrap"),m=this.localizationService.toLanguageString(yt,M[yt]),g=this.localizationService.toLanguageString(kt,M[kt]),f={min:t,max:i,weekNumber:a,focusedDate:o,disabled:e||this.state.tab!=="date",value:this.state.dateValue,onChange:this.handleCalendarValueChange,navigation:!1,mobileMode:u};return r.createElement("div",{onKeyDown:this.handleKeyDown,className:p,tabIndex:-1},r.createElement("div",{className:"k-datetime-buttongroup"},r.createElement(N.ButtonGroup,{width:"100%"},r.createElement(N.Button,{type:"button",selected:this.state.tab==="date",togglable:!0,onClick:this.handleDateClick},m),r.createElement(N.Button,{type:"button",selected:this.state.tab==="time",togglable:!0,onClick:this.handleTimeClick},g))),r.createElement("div",{className:"k-datetime-selector"},r.createElement("div",{className:"k-datetime-calendar-wrap",ref:v=>this._calendarWrap=v},this.props.calendar?r.createElement(this.props.calendar,{...f}):r.createElement(tt,{ref:v=>{this._calendar=v},...f})),r.createElement("div",{className:"k-datetime-time-wrap"},r.createElement("div",{className:u?"k-reset k-timeselector-lg k-timeselector":""},r.createElement(pe,{key:1,onNowClick:this.handleNowClick,disabled:e||this.state.tab!=="time",ref:v=>{this._timePart=v},min:this.minTime||de,max:this.maxTime||oe,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(e,t){return l.isEqualDate(e,t||H())?e:null}hasActiveButton(){if(!this._acceptButton)return!1;const e=d.getActiveElement(document);return this._acceptButton&&e===this._acceptButton.element||this._cancelButton&&e===this._cancelButton.element}mergeTime(e,t){return e&&t?q(t,e):t}mergeDate(e,t){return e?q(e||H(),t):t}}zt.defaultProps={footerActions:!0};k.registerForLocalization(zt);const X=class extends r.Component{constructor(s){super(s),this._element=null,this._dateInput=r.createRef(),this._dateTimeSelector=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.focus=()=>{const e=this.dateInputElement();e&&e.focus()},this.renderPicker=()=>{const{disabled:e,minTime:t,maxTime:i,format:a,calendar:o,cancelButton:h,weekNumber:u,focusedDate:c}=this.props;return r.createElement(zt,{ref:p=>{this._dateTimeSelector=p},cancelButton:h,steps:this.props.steps,value:this.value,onChange:this.handleValueChange,onReject:this.handleReject,disabled:e,weekNumber:u,min:this.min,max:this.max,minTime:t,maxTime:i,focusedDate:c,format:a,calendar:o,mobileMode:this.mobileMode,footerActions:!this.mobileMode})},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,t=k.provideLocalizationService(this).toLanguageString(Re,M[Re]),i=k.provideLocalizationService(this).toLanguageString(Fe,M[Fe]),a={expand:this.show,onClose:this.handleBlur,adaptiveTitle:this.props.adaptiveTitle,windowWidth:e,footer:{cancelText:t,onCancel:o=>{var h;return(h=this._dateTimeSelector)==null?void 0:h.handleReject(o)},applyText:i,onApply:o=>{var h;return(h=this._dateTimeSelector)==null?void 0:h.handleAccept(o)}}};return r.createElement(st,{...a},r.createElement(ce.ActionSheetContent,{className:"!k-overflow-hidden"},this.renderPicker()))},this.handleReject=()=>{this.shouldFocusDateInput=!0,this.setShow(!1)},this.handleValueChange=e=>{this.setState({value:l.cloneDate(e.value||void 0)}),this.valueDuringOnChange=e.value,this.showDuringOnChange=!1,this.mobileMode||(this.shouldFocusDateInput=!0);const{onChange:t}=this.props;t&&t.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.handleDateIconClick=()=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=e=>{e.preventDefault()},this.handleKeyDown=e=>{const{altKey:t,keyCode:i}=e;if(i===d.Keys.esc){this.shouldFocusDateInput=!0,this.setShow(!1);return}t&&(i===d.Keys.up||i===d.Keys.down)&&(e.preventDefault(),e.stopPropagation(),this.shouldFocusDateInput=i===d.Keys.up,this.setShow(i===d.Keys.down))},this.dateInputElement=()=>this.dateInput&&this.dateInput.element||this.element&&this.element.querySelector(".k-dateinput > input.k-input-inner"),d.validatePackage(Se),this.state={value:this.props.defaultValue||X.defaultProps.defaultValue,show:this.props.defaultShow||X.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 s=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return s!==null?l.cloneDate(s):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<=it&&this.props.adaptive)}get min(){return this.props.min!==void 0?this.props.min:X.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:X.defaultProps.max}get validity(){const s=os(this.value,this.min,this.max)&&Ft(this.value,this.props.minTime||de,this.props.maxTime||oe),e=this.props.validationMessage!==void 0,t=(!this.required||this.value!==null)&&s,i=this.props.valid!==void 0?this.props.valid:t;return{customError:e,rangeOverflow:this.value&&this.max.getTime()<this.value.getTime()||!1,rangeUnderflow:this.value&&this.value.getTime()<this.min.getTime()||!1,valid:i,valueMissing:this.value===null}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:X.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:X.defaultProps.required}get dateInputComp(){return this.props.dateInput||X.defaultProps.dateInput}componentDidMount(){var s;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){const s=this.dateInputElement();this._dateTimeSelector&&this.show&&!this.prevShow&&this._dateTimeSelector.focus({preventScroll:!0}),s&&!this.show&&this.shouldFocusDateInput&&s.focus({preventScroll:!0}),this.prevShow=this.show,this.shouldFocusDateInput=!1}componentWillUnmount(){var s;clearTimeout(this.nextTickId),(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:s=X.defaultProps.size,rounded:e=X.defaultProps.rounded,fillMode:t=X.defaultProps.fillMode,disabled:i,tabIndex:a,title:o,id:h,format:u,formatPlaceholder:c,min:p,max:m,className:g,width:f,name:v,validationMessage:C,required:I,validityStyles:T,minTime:b,maxTime:E,ariaLabelledBy:w,ariaDescribedBy:A,popup:O=Qe.Popup}=this.props,P=!this.validityStyles||this.validity.valid,B={id:h,ariaLabelledBy:w,ariaDescribedBy:A,format:u,formatPlaceholder:c,disabled:i,title:o,validityStyles:T,validationMessage:C,required:I,min:p,max:m,minTime:b,maxTime:E,name:v,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},x=r.createElement(d.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.handleBlur,onSyncFocus:this.props.onFocus,onSyncBlur:this.props.onBlur},({onFocus:V,onBlur:G})=>r.createElement(r.Fragment,null,r.createElement("div",{ref:Y=>{this._element=Y},className:d.classNames("k-input","k-datetimepicker",{[`k-input-${d.kendoThemeMaps.sizeMap[s]||s}`]:s,[`k-rounded-${d.kendoThemeMaps.roundedMap[e]||e}`]:e,[`k-input-${t}`]:t,["k-invalid"]:!P,["k-required"]:this.required,["k-disabled"]:this.props.disabled},g),onKeyDown:this.handleKeyDown,style:{width:f},onFocus:this.mobileMode?void 0:V,onBlur:G,onClick:this.mobileMode?this.handleDateIconClick:void 0},r.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",ariaControls:this._popupId,readonly:this.mobileMode,...B}),r.createElement(N.Button,{tabIndex:-1,type:"button",icon:"calendar",svgIcon:J.calendarIcon,onMouseDown:this.handleIconMouseDown,onClick:this.mobileMode?void 0:this.handleDateIconClick,title:k.provideLocalizationService(this).toLanguageString(ye,M[ye]),className:"k-input-button",rounded:null,"aria-label":k.provideLocalizationService(this).toLanguageString(ye,M[ye])}),r.createElement(O,{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?r.createElement(Lt,{dateInput:this._dateInput,label:this.props.label,editorId:h,editorValid:P,editorDisabled:this.props.disabled,children:x,style:{width:this.props.width}}):x}setShow(s){const{onOpen:e,onClose:t}=this.props;this.show!==s&&(this.setState({show:s}),s&&e&&e.call(void 0,{target:this}),!s&&t&&t.call(void 0,{target:this}))}nextTick(s){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>s())}calculateMedia(s){for(let e of s)this.setState({windowWidth:e.target.clientWidth})}};let Ve=X;Ve.displayName="DateTimePicker";Ve.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"])};Ve.defaultProps={defaultShow:!1,defaultValue:null,disabled:!1,format:"g",max:se,min:te,popupSettings:{},tabIndex:0,weekNumber:!1,required:!1,validityStyles:!0,cancelButton:!0,dateInput:ae,size:"medium",rounded:"medium",fillMode:"solid"};const Ws=d.createPropsContext(),Us=d.withIdHOC(d.withPropsContext(Ws,Ve));Us.displayName="KendoReactDateTimePicker";k.registerForLocalization(Ve);exports.Action=D;exports.BusViewService=Et;exports.Calendar=tt;exports.CalendarCell=ns;exports.CalendarHeaderTitle=vs;exports.CalendarNavigationItem=bs;exports.CalendarPropsContext=ys;exports.CalendarViewEnum=S;exports.CalendarWeekCell=as;exports.CalendarWithoutContext=ne;exports.CenturyViewService=hs;exports.DOMService=ps;exports.DateInput=ae;exports.DateInputPropsContext=Ss;exports.DateInputWithoutContext=re;exports.DatePicker=Ms;exports.DatePickerPropsContext=Is;exports.DatePickerWithoutContext=Me;exports.DateRangePicker=qs;exports.DateRangePickerPropsContext=zs;exports.DateRangePickerWithoutContext=Oe;exports.DateTimePicker=Us;exports.DateTimePickerPropsContext=Ws;exports.DateTimePickerWithoutContext=Ve;exports.DayPeriodService=Ts;exports.DecadeViewService=cs;exports.EMPTY_SELECTIONRANGE=_;exports.Header=xe;exports.HorizontalViewList=ke;exports.HoursService=Vs;exports.MAX_DATE=se;exports.MAX_TIME=oe;exports.MIN_DATE=te;exports.MIN_TIME=de;exports.MinutesService=Rs;exports.MonthViewService=us;exports.MultiViewCalendar=Bt;exports.MultiViewCalendarPropsContext=Bs;exports.MultiViewCalendarWithoutContext=Q;exports.NavigationService=Ot;exports.PickerWrap=xs;exports.ScrollSyncService=ms;exports.SecondsService=_s;exports.TimeList=He;exports.TimePart=pe;exports.TimePicker=As;exports.TimePickerPropsContext=Hs;exports.TimePickerWithoutContext=Ee;exports.TimeSelector=Te;exports.TodayCommand=Ie;exports.ToggleButton=Cs;exports.ViewList=_e;exports.Virtualization=Ce;exports.WeekNamesService=gs;exports.YearViewService=ds;exports.dateInputsMessages=M;exports.decreaseValue=be;exports.end=Ge;exports.getNow=ue;exports.getToday=H;exports.increaseValue=we;exports.separator=Xe;exports.start=Ze;exports.swapStartEnd=De;exports.today=Ke;exports.toggleCalendar=je;exports.toggleDateTimeSelector=ye;
21
+ `);return null},value:n.instanceOf(Date),smoothScroll:n.bool,show:n.bool};He.defaultProps={boundRange:!1,max:oe,min:L,step:1,smoothScroll:!0};k.registerForIntl(He);const mt=new RegExp(`${j.hour}|${j.minute}|${j.second}|${j.dayperiod}|literal`),he=class extends r.Component{constructor(s){super(s),this._element=null,this._nowButton=null,this.dateFormatParts=[],this.timeLists=[],this.focus=e=>{Promise.resolve().then(()=>{const t=this.timeLists[0];this.state.activeListIndex===-1&&!this.hasActiveButton()&&t&&t.element&&t.focus(e)})},this.timeFormatReducer=(e,t)=>e+t.pattern,this.timeFormatFilter=(e,t,i)=>{const a=t>=1&&i[t-1];return a&&a&&e.type==="literal"?mt.test(a.type||""):mt.test(e.type||"")},this.focusList=e=>{this.timeLists.length&&this.timeLists.reduce(this.listReducer,[]).map(t=>e===1?t.next:t.prev).map(t=>t&&t.element&&t.element.focus({preventScroll:!0}))},this.listReducer=(e,t,i,a)=>e.length||t.props.id!==this.state.activeListIndex?e:[{next:a[i+1]||t,prev:a[i-1]||t}],this.showNowButton=()=>!this.hasSteps()&&this.props.nowButton&&Ft(ue(),this.min,this.max),this.handleKeyDown=e=>{const{keyCode:t}=e;switch(t){case d.Keys.left:e.preventDefault(),this.focusList(0);return;case d.Keys.right:e.preventDefault(),this.focusList(1);return;default:return}},this.handleListBlur=()=>{this.nextTick(()=>{this.setState({activeListIndex:-1})})},this.handleListFocus=e=>{clearTimeout(this.nextTickId),this.setState({activeListIndex:e})},this.handleChange=e=>{const{onChange:t}=this.props;t&&t.call(void 0,e)},this.snapTime=Yt(Ut(this.props.steps,this.props.min||he.defaultProps.min)),this.state={activeListIndex:-1},this.hasActiveButton=this.hasActiveButton.bind(this)}get element(){return this._element}get value(){return Ui(this.snapTime(l.cloneDate(this.props.value||L)),this.min,this.max)}get intl(){return k.provideIntlService(this)}get min(){return this.snapTime(this.props.min||he.defaultProps.min)}get max(){return this.snapTime(this.props.max||he.defaultProps.max)}get steps(){return this.props.steps||he.defaultProps.steps}get boundRange(){return this.props.boundRange!==void 0?this.props.boundRange:he.defaultProps.boundRange}componentWillUnmount(){clearTimeout(this.nextTickId)}componentDidMount(){const{onMount:s}=this.props;s&&s.call(void 0,this.value)}render(){const{format:s,smoothScroll:e,onNowClick:t,className:i,disabled:a,mobileMode:o,show:h}=this.props;this.snapTime=Yt(Ut(this.steps,this.min)),this.dateFormatParts=this.intl.splitDateFormat(s||he.defaultProps.format).filter(this.timeFormatFilter);const u=d.classNames({"k-disabled":a,"k-time-part":o},i);this.timeLists=[];const c=k.provideLocalizationService(this),p=c.toLanguageString(bt,M[bt]);return r.createElement("div",{className:u},r.createElement("div",{className:"k-time-header"},r.createElement("span",{className:"k-title"},this.intl.formatDate(this.value,this.dateFormatParts.reduce(this.timeFormatReducer,""))),this.showNowButton()&&r.createElement(N.Button,{type:"button",ref:m=>{this._nowButton=m},className:"k-time-now",fillMode:"flat",themeColor:"primary",title:p,"aria-label":p,onClick:t,tabIndex:a?-1:0},c.toLanguageString(wt,M[wt]))),r.createElement("div",{className:"k-time-list-container",onKeyDown:this.handleKeyDown},r.createElement("span",{className:"k-time-highlight"}),this.dateFormatParts.map((m,g)=>m.type!=="literal"?r.createElement("div",{key:g,className:d.classNames("k-time-list-wrapper",{"k-focus":g===this.state.activeListIndex}),role:"presentation",tabIndex:-1},r.createElement("span",{className:"k-title",onMouseDown:f=>{f.preventDefault()}},this.intl.dateFieldName(m)),r.createElement(He,{min:this.min,max:this.max,boundRange:this.boundRange,part:m,step:m.type?this.steps[m.type]:1,smoothScroll:e,ref:f=>{f&&this.timeLists.push(f)},id:g,onFocus:()=>{this.handleListFocus(g)},onBlur:this.handleListBlur,onChange:this.handleChange,value:this.value,disabled:a,show:h,mobileMode:o})):r.createElement("div",{key:g,className:"k-time-separator"},m.pattern))))}nextTick(s){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>s())}hasActiveButton(){const s=d.getActiveElement(document);return this._nowButton&&s===this._nowButton.element}hasSteps(){const s=Object.keys(this.steps);return s.length!==s.reduce((e,t)=>e+this.steps[t],0)}};let pe=he;pe.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};pe.defaultProps={value:null,disabled:!1,nowButton:!0,cancelButton:!0,format:"hh:mm a",min:de,max:oe,steps:{},boundRange:!1};k.registerForIntl(pe);k.registerForLocalization(pe);const Mt=class extends r.Component{constructor(s){super(s),this._element=null,this._cancelButton=null,this._acceptButton=null,this.timePart=null,this.focusActiveList=()=>{this.timePart&&this.timePart.focus({preventScroll:!0})},this.handleKeyDown=e=>{const{keyCode:t}=e;switch(t){case d.Keys.enter:this.hasActiveButton()||this.handleAccept(e);return;default:return}},this.handleAccept=e=>{const t=this.mergeValue(l.cloneDate(this.value||ue()),this.timePart?this.timePart.value:this.current);this.setState({value:t}),this.valueDuringOnChange=t;const{onChange:i}=this.props;i&&i.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0},this.handleReject=e=>{this.setState({current:this.value});const{onReject:t}=this.props;t&&t.call(void 0,e)},this.handleNowClick=e=>{const t=this.mergeValue(l.cloneDate(this.value||ue()),ue());this.setState({current:t,value:t}),this.valueDuringOnChange=t;const{onChange:i}=this.props;i&&i.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0},this.handleChange=e=>{this.setState({current:e});const{handleTimeChange:t}=this.props;t&&t.call(void 0,{time:e})},this.dateFormatParts=this.intl.splitDateFormat(this.props.format||Mt.defaultProps.format),this.mergeValue=Wi(qi(this.dateFormatParts)),this.hasActiveButton=this.hasActiveButton.bind(this),this.state={current:this.props.value||L,value:this.props.value||Mt.defaultProps.value}}get element(){return this._element}get value(){const s=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return s!==null?l.cloneDate(s):null}get intl(){return k.provideIntlService(this)}get current(){return this.state.current!==null?l.cloneDate(this.state.current):null}componentWillUnmount(){clearTimeout(this.nextTickId)}render(){const{format:s,cancelButton:e,disabled:t,tabIndex:i,className:a,smoothScroll:o,min:h,max:u,boundRange:c,nowButton:p,steps:m,show:g,mobileMode:f}=this.props,v=k.provideLocalizationService(this),C=v.toLanguageString(Je,M[Je]),I=v.toLanguageString(Ne,M[Ne]);return r.createElement("div",{ref:T=>{this._element=T},tabIndex:t?void 0:i||0,className:d.classNames("k-timeselector",a,{"k-disabled":t}),onKeyDown:this.handleKeyDown},r.createElement(pe,{ref:T=>{this.timePart=T},value:this.current,onChange:this.handleChange,onNowClick:this.handleNowClick,format:s,smoothScroll:o,min:h,max:u,boundRange:c,disabled:t,nowButton:p,steps:m,show:g,mobileMode:f}),this.props.footer&&r.createElement("div",{className:"k-time-footer k-actions k-actions-stretched"},e&&r.createElement(N.Button,{type:"button",ref:T=>{this._cancelButton=T},className:"k-time-cancel",onClick:this.handleReject,title:C,"aria-label":C},C),r.createElement(N.Button,{type:"button",ref:T=>{this._acceptButton=T},className:"k-time-accept",themeColor:"primary",onClick:this.handleAccept,title:I,"aria-label":I},I)))}nextTick(s){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>s())}hasActiveButton(){if(!this._acceptButton||!this._acceptButton.element)return!1;const s=d.getActiveElement(document);return this._acceptButton&&s===this._acceptButton.element||this._cancelButton&&s===this._cancelButton.element}};let Te=Mt;Te.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};Te.defaultProps={value:null,disabled:!1,cancelButton:!0,format:"t",min:de,max:oe,boundRange:!1,footer:!0};k.registerForIntl(Te);k.registerForLocalization(Te);const K=class extends r.Component{constructor(s){super(s),this._element=null,this._dateInput=r.createRef(),this._timeSelector=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.focus=()=>{this.dateInput&&this.dateInput.focus()},this.renderTimeSelector=()=>{const{smoothScroll:e,cancelButton:t,nowButton:i,disabled:a,format:o,steps:h}=this.props;return r.createElement(Te,{ref:this.setTimeSelectorRef,className:this.mobileMode?"k-reset k-timeselector-lg":"",mobileMode:this.mobileMode,show:this.show,cancelButton:t,disabled:a,nowButton:i,format:o,min:this.min,max:this.max,steps:h,smoothScroll:e,value:this.value,footer:!this.mobileMode,handleTimeChange:this.mobileMode&&this.handleTimeChange,onChange:this.handleValueChange,onReject:this.handleValueReject})},this.renderPopup=()=>{const{popupClass:e,...t}=this.popupSettings,i=d.classNames("k-group k-reset",e),a={popupClass:"k-timepicker-popup",show:this.show,animate:this.element!==null,anchor:this.element,className:i,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...t};return this.props.popup?r.createElement(this.props.popup,{...a},this.renderTimeSelector()):r.createElement(Qe.Popup,{...a},this.renderTimeSelector())},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,t={expand:this.show,onClose:this.handleBlur,adaptiveTitle:this.props.adaptiveTitle,windowWidth:e,footer:{cancelText:this.localizationService.toLanguageString(qe,M[Je]),onCancel:this.handleValueReject,applyText:this.localizationService.toLanguageString(Ne,M[Ne]),onApply:i=>this.handleValueChange(i)}};return r.createElement(st,{...t},r.createElement(ce.ActionSheetContent,{className:"!k-overflow-hidden"},this.renderTimeSelector()))},this.setTimeSelectorRef=e=>{this._timeSelector=e},this.nextValue=(e,t)=>e.value!==void 0?e.value:t.value,this.nextShow=(e,t)=>e.show!==void 0?e.show:t.show,this.handleInputValueChange=e=>{const t=this.mergeTime(e.value);this.handleValueChange({...e,value:t})},this.handleTimeChange=e=>{this.setState({candidate:e.time})},this.handleValueChange=e=>{this.setState({value:l.cloneDate(e.value||this.state.candidate)}),this.valueDuringOnChange=e.value,this.showDuringOnChange=!1,this.shouldFocusDateInput=!0;const{onChange:t}=this.props,i=this.value||this.state.candidate;t&&t.call(void 0,{syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:i,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=e=>{this.setShow(!1)},this.handleIconClick=e=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=e=>{e.preventDefault()},this.handleKeyDown=e=>{const{altKey:t,keyCode:i}=e;if(i===d.Keys.esc){this.shouldFocusDateInput=!0,this.setShow(!1);return}t&&(i===d.Keys.up||i===d.Keys.down)&&(e.preventDefault(),e.stopPropagation(),this.shouldFocusDateInput=i===d.Keys.up,this.setShow(i===d.Keys.down))},d.validatePackage(Se),this.state={value:this.props.defaultValue||K.defaultProps.defaultValue,show:this.props.defaultShow||K.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 s=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return s!==null?l.cloneDate(s):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 s=this.value&&this.normalizeTime(this.value),e=this.normalizeTime(this.min),t=this.normalizeTime(this.max),i=Yi(s,e,t),a=this.props.validationMessage!==void 0,o=(!this.required||this.value!==null)&&i,h=this.props.valid!==void 0?this.props.valid:o;return{customError:a,rangeOverflow:Ki(s,t),rangeUnderflow:$i(s,e),valid:h,valueMissing:this.value===null}}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=it&&this.props.adaptive)}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:K.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:K.defaultProps.required}get popupSettings(){return this.props.popupSettings||K.defaultProps.popupSettings}get min(){return this.props.min!==void 0?this.props.min:K.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:K.defaultProps.max}get dateInputComp(){return this.props.dateInput||K.defaultProps.dateInput}get localizationService(){return k.provideLocalizationService(this)}componentDidMount(){var s;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(s=this.document)!=null&&s.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 s;(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:s=K.defaultProps.size,rounded:e=K.defaultProps.rounded,fillMode:t=K.defaultProps.fillMode,disabled:i,tabIndex:a,title:o,id:h,className:u,format:c,formatPlaceholder:p,width:m,name:g,steps:f,validationMessage:v,required:C,validityStyles:I,ariaLabelledBy:T,ariaDescribedBy:b}=this.props,E=!this.validityStyles||this.validity.valid,w={disabled:i,format:c,formatPlaceholder:p,id:h,ariaLabelledBy:T,ariaDescribedBy:b,max:this.normalizeTime(this.max),min:this.normalizeTime(this.min),name:g,onChange:this.handleInputValueChange,required:C,steps:f,tabIndex:this.show?-1:a,title:o,valid:this.validity.valid,validationMessage:v,validityStyles:I,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},A=this.localizationService.toLanguageString(qe,M[qe]),O=this.localizationService.toLanguageString(Dt,M[Dt]),P=r.createElement(d.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.mobileMode?void 0:this.handleBlur,onSyncBlur:this.props.onBlur,onSyncFocus:this.props.onFocus},({onFocus:B,onBlur:x})=>r.createElement(r.Fragment,null,r.createElement("div",{id:this.props.id,ref:V=>{this._element=V},className:d.classNames("k-input","k-timepicker",{[`k-input-${d.kendoThemeMaps.sizeMap[s]||s}`]:s,[`k-rounded-${d.kendoThemeMaps.roundedMap[e]||e}`]:e,[`k-input-${t}`]:t,["k-invalid"]:!E,["k-required"]:this.required,["k-disabled"]:this.props.disabled},u),onKeyDown:this.handleKeyDown,style:{width:m},onFocus:B,onBlur:x,onClick:this.mobileMode?this.handleIconClick:void 0},r.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",ariaControls:this._popupId,...w}),r.createElement(N.Button,{tabIndex:-1,type:"button",icon:"clock",svgIcon:J.clockIcon,onMouseDown:this.handleIconMouseDown,onClick:this.mobileMode?void 0:this.handleIconClick,title:O,className:"k-input-button",rounded:null,"aria-label":A}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup()));return this.props.label?r.createElement(Lt,{dateInput:this._dateInput,label:this.props.label,editorId:h,editorValid:E,editorDisabled:this.props.disabled,children:P,style:{width:this.props.width}}):P}normalizeTime(s){return q(L,s)}setShow(s){const{onOpen:e,onClose:t}=this.props;this.show!==s&&(this.setState({show:s}),s&&e&&e.call(void 0,{target:this}),!s&&t&&t.call(void 0,{target:this}))}mergeTime(s){return this.value&&s?q(this.value,s):s}calculateMedia(s){for(let e of s)this.setState({windowWidth:e.target.clientWidth})}};let Ee=K;Ee.displayName="TimePicker";Ee.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"])};Ee.defaultProps={defaultShow:!1,defaultValue:null,disabled:!1,format:"t",max:oe,min:de,popupSettings:{},tabIndex:0,steps:{},required:!1,validityStyles:!0,dateInput:ae,size:"medium",rounded:"medium",fillMode:"solid"};const _s=d.createPropsContext(),Hs=d.withIdHOC(d.withPropsContext(_s,Ee));Hs.displayName="KendoReactTimePicker";k.registerForLocalization(Ee);const Jt=2,Tt=class extends r.Component{constructor(s){super(s),this._element=null,this.isActive=!1,this.focusActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus"),t=this._element.querySelector(".k-state-pending-focus");e&&e[0]&&e[0].classList.remove("k-focus"),t&&t.classList.add("k-focus"),this.isActive=!0},this.blurActiveDate=()=>{if(!this._element)return;const e=this._element.querySelector("td.k-focus");e&&e.classList.remove("k-focus"),this.isActive=!1},this.rotateSelectionRange=e=>{if(e.start===null||e.end===null)return e;const t=e.end<e.start;return{start:t?e.end:e.start,end:t?e.start:e.end}},this.handleDateChange=(e,t=!1)=>{const{onChange:i}=this.props;if(i){const a={syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,value:l.cloneDate(e.value),target:this,isTodayClick:t};i.call(void 0,a)}}}get element(){return this._element}get weekNumber(){return!!(this.props.showWeekNumbers&&this.props.activeView===S.month)}get min(){return this.props.min!==void 0?this.props.min:Tt.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:Tt.defaultProps.max}componentDidUpdate(){this.isActive&&this.focusActiveDate()}render(){const s=this.props.allowReverse?this.rotateSelectionRange(this.props.selectionRange):this.props.selectionRange,e=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===S.month,"k-calendar-yearview":this.props.activeView===S.year,"k-calendar-decadeview":this.props.activeView===S.decade,"k-calendar-centuryview":this.props.activeView===S.century});return r.createElement("div",{ref:t=>{this._element=t},className:e},this.props.dates.map(t=>r.createElement("table",{className:"k-calendar-table k-content",key:t.getTime(),role:"grid"},r.createElement(Le,{bus:this.props.bus,service:this.props.service,key:t.getTime(),direction:"horizontal",activeView:this.props.activeView,cellUID:this.props.cellUID,viewDate:t,min:this.min,max:this.max,focusedDate:this.props.focusedDate,selectionRange:s,selectedDate:this.props.value,showWeekNumbers:this.weekNumber,onChange:this.handleDateChange,onCellEnter:this.props.onCellEnter,cell:this.props.cell,weekCell:this.props.weekCell}))))}};let ke=Tt;ke.defaultProps={showWeekNumbers:!1,views:Jt,take:Jt,allowReverse:!0,min:te,max:se};const gt=(s=Q.defaultProps.min,e=Q.defaultProps.max,t)=>t instanceof Date&&!Array.isArray(t)&&F(l.getDate(t),s,e)?l.getDate(t):null,Qt=(s=Q.defaultProps.min,e=Q.defaultProps.max,t)=>Array.isArray(t)?t.filter(i=>F(i,s,e)).map(i=>l.getDate(i)):null,es=s=>typeof s=="object"&&!(s instanceof Date)&&s!==null&&!Array.isArray(s)?s:_,ts=(s,e,t)=>s||e&&e[0]||t&&t.start,vn=(s,e)=>s.start===null&&e===null?"start":s.end===null?"end":"start",ve=class extends r.Component{constructor(s){super(s),this.dates=[],this.selectedDate=null,this.selectedMultiple=null,this.selectedRange=_,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:g}=p;const f=p.start!==null&&c.getTime()<=p.start.getTime();return!this.props.allowReverse&&f?{start:c,end:this.selectedRange.start}:this.activeRange!=="end"?{start:c,end:m}:{start:g||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:g}=p;return this.activeRange!=="end"?m!==null&&c>m:g!==null&&c<g},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=D.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(D.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 g;switch(this.props.mode){case"single":g=l.cloneDate(c.value);break;case"multiple":if(Array.isArray(this.selectedMultiple)){let v=this.selectedMultiple.slice(),C=-1;v.forEach((I,T)=>{l.isEqualDate(I,c.value)&&(C=T)}),C!==-1?v.splice(C,1):v.push(l.cloneDate(c.value)),g=v.slice()}else this.selectedDate?g=[l.cloneDate(this.selectedDate),l.cloneDate(c.value)]:g=[l.cloneDate(c.value)];break;case"range":{g=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:g=l.cloneDate(c.value);break}this.valueDuringOnChange=g,c.isTodayClick&&this.setState({navigateDate:p}),this.setState({value:g,focusedDate:p}),this.valueDuringOnChange=g;const{onChange:f}=this.props;if(f){const v={syntheticEvent:c.syntheticEvent,nativeEvent:c.nativeEvent,value:g,target:this};f.call(void 0,v)}this.valueDuringOnChange=void 0};const e=s.value!==void 0?s.value:s.defaultValue||ve.defaultProps.defaultValue,t=gt(this.min,this.max,e),i=Qt(this.min,this.max,e),a=es(e),o=ts(t,i,a),h=$e(S[s.defaultActiveView],this.bottomView,this.topView),u=U(s.focusedDate||o||H(),this.min,this.max);this.state={value:e,activeView:h,focusedDate:u,navigateDate:u},this.activeRangeEnd=vn(a,t),this.bus=new Et(this.handleViewChange),this.navigation=new Ot(this.bus),this.calculateFocusFromValue=!1,this.lastView=h,this.lastViewsCount=this.props.views||ke.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:ve.defaultProps.min)}get max(){return l.getDate(this.props.max!==void 0?this.props.max:ve.defaultProps.max)}get bottomView(){return S[this.props.bottomView!==void 0?this.props.bottomView:ve.defaultProps.bottomView]}get topView(){return S[this.props.topView!==void 0?this.props.topView:ve.defaultProps.topView]}get activeRange(){return this.props.activeRangeEnd!==void 0?this.props.activeRangeEnd:this.activeRangeEnd}get todayIsInRange(){return F(H(),l.getDate(this.min),l.getDate(this.max))}componentDidMount(){this.calculateFocusFromValue=!0}componentDidUpdate(){this.calendarViewList&&(this.isActive?this.calendarViewList.focusActiveDate:this.calendarViewList.blurActiveDate)();const s=gt(this.min,this.max,this.value);this.calculateFocusFromValue=!!(this.selectedDate&&s&&this.selectedDate.getTime()&&s.getTime()),this.lastView=this.state.activeView,this.lastViewsCount=this.props.views||ke.defaultProps.views}render(){this.props._ref&&this.props._ref(this),this.intl=k.provideIntlService(this),this.localization=k.provideLocalizationService(this),this.bus.configure(this.bottomView,this.topView);const s=$e(this.state.activeView,this.bottomView,this.topView);this.service=this.bus.service(s,this.intl),this.selectedDate=gt(this.min,this.max,this.value),this.selectedMultiple=Qt(this.min,this.max,this.value),this.selectedRange=es(this.value);const e=ts(this.selectedDate,this.selectedMultiple,this.selectedRange);this._focusedDate=U(this.calculateFocusFromValue&&e!==null?e:this.state.focusedDate,this.min,this.max);const t=d.classNames("k-widget k-calendar k-calendar-range",{"k-disabled":this.props.disabled},this.props.className),i=this.rangeWithFocused(this.selectedRange,this.focusedDate),a=this.localization.toLanguageString(ft,M[ft]),o=this.localization.toLanguageString(vt,M[vt]),h=!this.canNavigate(D.PrevView),u=!this.canNavigate(D.NextView),c={"aria-disabled":h},p={"aria-disabled":u},m=this.lastView!==s,g=this.dates&&this.isInMonth(this.state.navigateDate,this.dates[0]),f=this.lastViewsCount!==this.props.views;(!g||m||f)&&(this.dates=this.service.datesList(this.state.navigateDate,this.props.views||ke.defaultProps.views));const v=l.cloneDate(this.dates&&this.dates[0]?this.dates[0]:H());return r.createElement("div",{ref:C=>{this._element=C},className:t,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},r.createElement(xe,{key:`.kendo.calendar.header.${v.getTime()}`,activeView:s,currentDate:v,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:r.createElement(r.Fragment,null,r.createElement(N.Button,{type:"button",className:"k-calendar-nav-prev",icon:this.isRtl?"chevron-right":"chevron-left",svgIcon:this.isRtl?J.chevronRightIcon:J.chevronLeftIcon,fillMode:"flat",title:a,disabled:h,onClick:this.handlePrevButtonClick,...c}),r.createElement(Ie,{min:this.min,max:this.max,onClick:this.handleTodayClick,disabled:!this.todayIsInRange}),r.createElement(N.Button,{type:"button",className:"k-calendar-nav-next",icon:this.isRtl?"chevron-left":"chevron-right",svgIcon:this.isRtl?J.chevronLeftIcon:J.chevronRightIcon,fillMode:"flat",title:o,disabled:u,onClick:this.handleNextButtonClick,...p}))}),r.createElement(ke,{ref:C=>{this.calendarViewList=C},dates:this.dates,activeView:s,focusedDate:this.focusedDate,min:this.min,max:this.max,bus:this.bus,service:this.service,selectionRange:i,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(s,e){return!!e&&l.firstDayOfMonth(e)<=s&&s<=l.lastDayOfMonth(e)}};let Q=ve;Q.displayName="MultiViewCalendar";Q.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([ee(n.instanceOf(Date)),n.arrayOf(n.instanceOf(Date)),n.shape({start:ee(n.instanceOf(Date)),end:ee(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([ee(n.instanceOf(Date)),n.arrayOf(n.instanceOf(Date)),n.shape({start:ee(n.instanceOf(Date).isRequired),end:ee(n.instanceOf(Date).isRequired)})]),views:(s,e,t)=>{const i=s[e];return i!==void 0&&i<1?new Error(`Invalid prop '${e}' supplied to'${t}'. The '${e}' property cannot be less than 1'`):null},weekNumber:n.bool,dir:n.string};Q.defaultProps={disabled:!1,min:te,max:se,navigation:!0,defaultActiveView:"month",defaultValue:null,topView:"century",tabIndex:0,bottomView:"month",views:2,allowReverse:!1};const As=d.createPropsContext(),Bt=d.withIdHOC(d.withPropsContext(As,Q));Bt.displayName="KendoReactMultiViewCalendar";k.registerForIntl(Q);k.registerForLocalization(Q);const Pe=class extends r.Component{constructor(s){super(s),this._element=null,this._calendar=null,this._startDateInput=r.createRef(),this._endDateInput=r.createRef(),this.shouldFocusDateInput=!1,this.shouldFocusCalendar=!1,this.focus=()=>{this.startDateInput&&this.startDateInput.focus()},this.setCalendarRef=e=>{this._calendar=e},this.focusCalendarElement=()=>{this._calendar&&this._calendar.element&&this._calendar.element.focus({preventScroll:!0})},this.calculateValue=(e,t)=>(e.value!==void 0?e.value:t.value)||_,this.calculateShow=(e,t)=>e.show!==void 0?e.show:t.show,this.renderCalendar=()=>{const e=this.value||_,t={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:e,dir:this.props.dir,onChange:this.handleCalendarChange};return this.props.calendar?r.createElement(this.props.calendar,{...t}):r.createElement(Bt,{...t,ref:this.setCalendarRef})},this.renderPopup=()=>{const e={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?r.createElement(this.props.popup,{...e},this.renderCalendar()):r.createElement(Qe.Popup,{...e},this.renderCalendar())},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,t={expand:this.show,onClose:i=>this.handleCancel(i),adaptiveTitle:this.props.adaptiveTitle,windowWidth:e,footer:{cancelText:this.localizationService.toLanguageString(St,M[St]),onCancel:this.handleCancel,applyText:this.localizationService.toLanguageString(Ct,M[Ct]),onApply:this.handleBlur}};return r.createElement(st,{...t},r.createElement(ce.ActionSheetContent,{className:"!k-overflow-hidden"},r.createElement("div",{className:"k-scrollable-wrap"},this.renderCalendar())))},this.handleReverseClick=e=>{const t={start:this.value.end,end:this.value.start},i={syntheticEvent:e,nativeEvent:e.nativeEvent};this.handleChange(t,i)},this.handleReverseMouseDown=e=>{e.preventDefault()},this.handleFocus=e=>{clearTimeout(this.nextTickId),this.shouldFocusDateInput||(this.setShow(!0),this.mobileMode&&this.setState({currentValue:this.value}));const{onFocus:t}=this.props;t&&t.call(void 0,e)},this.handleBlur=e=>{this.nextTick(()=>{this.setShow(!1)});const{onBlur:t}=this.props;t&&t.call(void 0,e)},this.handleCancel=e=>{this.nextTick(()=>{this.setShow(!1),this.setState({currentValue:_})});const{onCancel:t}=this.props;t&&t.call(void 0,e)},this.handleEndChange=e=>{const t={start:this.value.start,end:l.cloneDate(e.value||void 0)};this.handleChange(t,e)},this.handleStartChange=e=>{const t={start:l.cloneDate(e.value||void 0),end:this.value.end};this.handleChange(t,e)},this.extractRangeFromValue=e=>{if(!Array.isArray(e.value)&&!(e.value instanceof Date))return e.value||_;const t=Array.isArray(e.value)?e.value[0]:e.value;return{start:this.value.end!==null?t:this.value.start,end:this.value.start!==null?t:this.value.end}},this.handleCalendarChange=e=>{const t=this.extractRangeFromValue(e);this.handleChange(t,e)},this.handleKeyDown=e=>{const{keyCode:t,altKey:i}=e,a=d.getActiveElement(document);t===d.Keys.esc?(e.preventDefault(),this.shouldFocusDateInput=!0,this.setShow(!1)):i&&t===d.Keys.down?(e.preventDefault(),this.shouldFocusCalendar=!0,this.setShow(!0)):t===d.Keys.tab&&this.show&&this._calendar&&this._calendar.element&&this.endDateInput&&this.endDateInput.element&&document&&a===this.endDateInput.element&&(e.preventDefault(),this.focusCalendarElement())},this.handleChange=(e,t)=>{this.setState({value:e}),this.valueDuringOnChange=e;const{onChange:i}=this.props;if(i){const a={syntheticEvent:t.syntheticEvent,nativeEvent:t.nativeEvent,value:this.value,show:this.show,target:this};i.call(void 0,a)}this.valueDuringOnChange=void 0},d.validatePackage(Se),this.state={show:this.props.show||this.props.defaultShow||Pe.defaultProps.defaultShow,value:this.props.value||this.props.defaultValue||Pe.defaultProps.defaultValue,currentValue:_},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)||_}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:Pe.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:Pe.defaultProps.max}get document(){if(d.canUseDOM)return this.element&&this.element.ownerDocument||document}get localizationService(){return k.provideLocalizationService(this)}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=it&&this.props.adaptive)}componentDidMount(){var s;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(s=this.document)!=null&&s.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 s;clearTimeout(this.nextTickId),(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.disconnect()}render(){const s=this.value||_,e=this.mobileMode&&this.show?this.state.currentValue:s,t=(this.props.startDateInputSettings||{}).id||this._startInputId,i=(this.props.endDateInputSettings||{}).id||this._endInputId,a=d.classNames("k-daterangepicker",{"k-disabled":this.props.disabled},this.props.className),o=this.localizationService.toLanguageString(Ze,M[Ze]),h=this.localizationService.toLanguageString(Ge,M[Ge]),u=this.localizationService.toLanguageString(Xe,M[Xe]),c={disableSelection:this.mobileMode&&!0,label:o,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:e.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:e.end,onChange:this.handleEndChange},m=r.createElement(N.Button,{type:"button",className:"k-select",fillMode:"flat",title:k.provideLocalizationService(this).toLanguageString(De,M[De]),onMouseDown:this.handleReverseMouseDown,onClick:this.handleReverseClick,"aria-controls":t+" "+i,"aria-label":k.provideLocalizationService(this).toLanguageString(De,M[De])},r.createElement(d.IconWrap,{style:{transform:"rotate(90deg)"},name:"arrows-swap",icon:J.arrowsSwapIcon}));return r.createElement(r.Fragment,null,r.createElement("span",{ref:g=>{this._element=g},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?r.createElement(this.props.startDateInput,{...c}):r.createElement(ae,{...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?r.createElement(this.props.endDateInput,{...p}):r.createElement(ae,{...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 s=d.getActiveElement(document);(this.value.start===null||this.value.end!==null)&&s!==this.endDateInput.element?this.startDateInput.element.focus({preventScroll:!0}):s!==this.startDateInput.element&&this.endDateInput.element.focus({preventScroll:!0})}nextTick(s){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>s())}setShow(s){const{onOpen:e,onClose:t}=this.props;this.show!==s&&(this.setState({show:s}),s&&e&&e.call(void 0,{target:this}),!s&&t&&t.call(void 0,{target:this}))}calculateMedia(s){for(let e of s)this.setState({windowWidth:e.target.clientWidth})}};let Oe=Pe;Oe.displayName="DateRangePicker";Oe.propTypes={allowReverse:n.bool,calendarSettings:n.any,className:n.string,defaultShow:n.bool,defaultValue:n.shape({start:ee(n.instanceOf(Date).isRequired),end:ee(n.instanceOf(Date).isRequired)}),disabled:n.bool,endDateInputSettings:n.shape(re.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:ee(n.instanceOf(Date).isRequired),end:ee(n.instanceOf(Date).isRequired)})};Oe.defaultProps={allowReverse:!1,defaultShow:!1,defaultValue:_,disabled:!1,format:"d",max:se,min:te,swapButton:!1};const Bs=d.createPropsContext(),zs=d.withIdHOC(d.withPropsContext(Bs,Oe));zs.displayName="KendoReactDateRangePicker";k.registerForLocalization(Oe);class zt extends r.Component{constructor(e){super(e),this._calendar=null,this._timePart=null,this._cancelButton=null,this._acceptButton=null,this._calendarWrap=null,this.shouldFocusPart=!1,this.focus=t=>{Promise.resolve().then(()=>{this.state.tab==="time"&&this._timePart&&this._timePart.focus(t);const i=this.calendarElement();this.state.tab==="date"&&i&&i.focus(t)})},this.calendarElement=()=>this._calendar&&this._calendar.element||this._calendarWrap&&this._calendarWrap.querySelector(".k-widget.k-calendar"),this.move=t=>{if(t==="right"&&this.state.tab==="time"||t==="left"&&this.state.tab==="date")return;const i=t==="left"?"date":"time";this.shouldFocusPart=!0,this.setState({tab:i})},this.dateTimeFooter=()=>{const{cancelButton:t}=this.props,i=this.localizationService.toLanguageString(Re,M[Re]),a=this.localizationService.toLanguageString(Fe,M[Fe]);return r.createElement("div",{className:"k-datetime-footer k-actions k-actions-stretched "},t&&r.createElement(N.Button,{type:"button",ref:o=>{this._cancelButton=o},className:"k-time-cancel",onClick:this.handleReject,title:i,"aria-label":i},i),r.createElement(N.Button,{type:"button",themeColor:"primary",ref:o=>{this._acceptButton=o},className:"k-time-accept",disabled:!this.hasDateValue,onClick:this.handleAccept,title:a,"aria-label":a},a))},this.handleReject=t=>{this.setState({dateValue:this.props.value,timeValue:this.props.value||L});const i=this.mergeDate(this.props.value,this.props.value||L);if(this.props.onReject){const a={nativeEvent:t.nativeEvent,syntheticEvent:t,target:this,value:i};this.props.onReject.call(void 0,a)}},this.handleAccept=(t,i)=>{if(!this.state.dateValue||!this.state.timeValue||!this.hasDateValue)return;const a=this.mergeDate(this.state.dateValue,i||this.state.timeValue);this.props.onChange.call(void 0,{syntheticEvent:t,nativeEvent:t.nativeEvent,value:a,target:this})},this.handleNowClick=t=>{this.setState({timeValue:ue()}),this.handleAccept(t,ue())},this.handleCalendarValueChange=t=>{t.syntheticEvent.stopPropagation(),this.setState({dateValue:t.value,tab:"time"}),this.shouldFocusPart=!0},this.handleTimeListContainerChange=t=>{this.setState({timeValue:t})},this.handleDateClick=t=>{t.stopPropagation(),this.move("left")},this.handleTimeClick=t=>{t.stopPropagation(),this.move("right")},this.handleKeyDown=t=>{const{keyCode:i,altKey:a}=t;switch(i){case d.Keys.enter:!this.hasActiveButton()&&this.hasDateValue&&this.handleAccept(t);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=t=>{this.setState({timeValue:t})},this.state={tab:"date",dateValue:this.props.value,timeValue:this.props.value||L}}get calendar(){return this._calendar}get timePart(){return this._timePart}get hasDateValue(){return this.state.dateValue!==null}get localizationService(){return k.provideLocalizationService(this)}componentDidUpdate(){this.shouldFocusPart&&this.focus({preventScroll:!0}),this.shouldFocusPart=!1}render(){const{disabled:e,min:t,max:i,weekNumber:a,focusedDate:o,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":e},"k-datetime-wrap"),m=this.localizationService.toLanguageString(yt,M[yt]),g=this.localizationService.toLanguageString(kt,M[kt]),f={min:t,max:i,weekNumber:a,focusedDate:o,disabled:e||this.state.tab!=="date",value:this.state.dateValue,onChange:this.handleCalendarValueChange,navigation:!1,mobileMode:u};return r.createElement("div",{onKeyDown:this.handleKeyDown,className:p,tabIndex:-1},r.createElement("div",{className:"k-datetime-buttongroup"},r.createElement(N.ButtonGroup,{width:"100%"},r.createElement(N.Button,{type:"button",selected:this.state.tab==="date",togglable:!0,onClick:this.handleDateClick},m),r.createElement(N.Button,{type:"button",selected:this.state.tab==="time",togglable:!0,onClick:this.handleTimeClick},g))),r.createElement("div",{className:"k-datetime-selector"},r.createElement("div",{className:"k-datetime-calendar-wrap",ref:v=>this._calendarWrap=v},this.props.calendar?r.createElement(this.props.calendar,{...f}):r.createElement(tt,{ref:v=>{this._calendar=v},...f})),r.createElement("div",{className:"k-datetime-time-wrap"},r.createElement("div",{className:u?"k-reset k-timeselector-lg k-timeselector":""},r.createElement(pe,{key:1,onNowClick:this.handleNowClick,disabled:e||this.state.tab!=="time",ref:v=>{this._timePart=v},min:this.minTime||de,max:this.maxTime||oe,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(e,t){return l.isEqualDate(e,t||H())?e:null}hasActiveButton(){if(!this._acceptButton)return!1;const e=d.getActiveElement(document);return this._acceptButton&&e===this._acceptButton.element||this._cancelButton&&e===this._cancelButton.element}mergeTime(e,t){return e&&t?q(t,e):t}mergeDate(e,t){return e?q(e||H(),t):t}}zt.defaultProps={footerActions:!0};k.registerForLocalization(zt);const X=class extends r.Component{constructor(s){super(s),this._element=null,this._dateInput=r.createRef(),this._dateTimeSelector=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.focus=()=>{const e=this.dateInputElement();e&&e.focus()},this.renderPicker=()=>{const{disabled:e,minTime:t,maxTime:i,format:a,calendar:o,cancelButton:h,weekNumber:u,focusedDate:c}=this.props;return r.createElement(zt,{ref:p=>{this._dateTimeSelector=p},cancelButton:h,steps:this.props.steps,value:this.value,onChange:this.handleValueChange,onReject:this.handleReject,disabled:e,weekNumber:u,min:this.min,max:this.max,minTime:t,maxTime:i,focusedDate:c,format:a,calendar:o,mobileMode:this.mobileMode,footerActions:!this.mobileMode})},this.renderAdaptivePopup=()=>{const{windowWidth:e=0}=this.state,t=k.provideLocalizationService(this).toLanguageString(Re,M[Re]),i=k.provideLocalizationService(this).toLanguageString(Fe,M[Fe]),a={expand:this.show,onClose:this.handleBlur,adaptiveTitle:this.props.adaptiveTitle,windowWidth:e,footer:{cancelText:t,onCancel:o=>{var h;return(h=this._dateTimeSelector)==null?void 0:h.handleReject(o)},applyText:i,onApply:o=>{var h;return(h=this._dateTimeSelector)==null?void 0:h.handleAccept(o)}}};return r.createElement(st,{...a},r.createElement(ce.ActionSheetContent,{className:"!k-overflow-hidden"},this.renderPicker()))},this.handleReject=()=>{this.shouldFocusDateInput=!0,this.setShow(!1)},this.handleValueChange=e=>{this.setState({value:l.cloneDate(e.value||void 0)}),this.valueDuringOnChange=e.value,this.showDuringOnChange=!1,this.mobileMode||(this.shouldFocusDateInput=!0);const{onChange:t}=this.props;t&&t.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.handleDateIconClick=()=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=e=>{e.preventDefault()},this.handleKeyDown=e=>{const{altKey:t,keyCode:i}=e;if(i===d.Keys.esc){this.shouldFocusDateInput=!0,this.setShow(!1);return}t&&(i===d.Keys.up||i===d.Keys.down)&&(e.preventDefault(),e.stopPropagation(),this.shouldFocusDateInput=i===d.Keys.up,this.setShow(i===d.Keys.down))},this.dateInputElement=()=>this.dateInput&&this.dateInput.element||this.element&&this.element.querySelector(".k-dateinput > input.k-input-inner"),d.validatePackage(Se),this.state={value:this.props.defaultValue||X.defaultProps.defaultValue,show:this.props.defaultShow||X.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 s=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return s!==null?l.cloneDate(s):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<=it&&this.props.adaptive)}get min(){return this.props.min!==void 0?this.props.min:X.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:X.defaultProps.max}get validity(){const s=as(this.value,this.min,this.max)&&Ft(this.value,this.props.minTime||de,this.props.maxTime||oe),e=this.props.validationMessage!==void 0,t=(!this.required||this.value!==null)&&s,i=this.props.valid!==void 0?this.props.valid:t;return{customError:e,rangeOverflow:this.value&&this.max.getTime()<this.value.getTime()||!1,rangeUnderflow:this.value&&this.value.getTime()<this.min.getTime()||!1,valid:i,valueMissing:this.value===null}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:X.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:X.defaultProps.required}get dateInputComp(){return this.props.dateInput||X.defaultProps.dateInput}componentDidMount(){var s;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){const s=this.dateInputElement();this._dateTimeSelector&&this.show&&!this.prevShow&&this._dateTimeSelector.focus({preventScroll:!0}),s&&!this.show&&this.shouldFocusDateInput&&s.focus({preventScroll:!0}),this.prevShow=this.show,this.shouldFocusDateInput=!1}componentWillUnmount(){var s;clearTimeout(this.nextTickId),(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:s=X.defaultProps.size,rounded:e=X.defaultProps.rounded,fillMode:t=X.defaultProps.fillMode,disabled:i,tabIndex:a,title:o,id:h,format:u,formatPlaceholder:c,min:p,max:m,className:g,width:f,name:v,validationMessage:C,required:I,validityStyles:T,minTime:b,maxTime:E,ariaLabelledBy:w,ariaDescribedBy:A,popup:O=Qe.Popup}=this.props,P=!this.validityStyles||this.validity.valid,B={id:h,ariaLabelledBy:w,ariaDescribedBy:A,format:u,formatPlaceholder:c,disabled:i,title:o,validityStyles:T,validationMessage:C,required:I,min:p,max:m,minTime:b,maxTime:E,name:v,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},x=r.createElement(d.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.handleBlur,onSyncFocus:this.props.onFocus,onSyncBlur:this.props.onBlur},({onFocus:V,onBlur:G})=>r.createElement(r.Fragment,null,r.createElement("div",{ref:Y=>{this._element=Y},className:d.classNames("k-input","k-datetimepicker",{[`k-input-${d.kendoThemeMaps.sizeMap[s]||s}`]:s,[`k-rounded-${d.kendoThemeMaps.roundedMap[e]||e}`]:e,[`k-input-${t}`]:t,["k-invalid"]:!P,["k-required"]:this.required,["k-disabled"]:this.props.disabled},g),onKeyDown:this.handleKeyDown,style:{width:f},onFocus:this.mobileMode?void 0:V,onBlur:G,onClick:this.mobileMode?this.handleDateIconClick:void 0},r.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",ariaControls:this._popupId,readonly:this.mobileMode,...B}),r.createElement(N.Button,{tabIndex:-1,type:"button",icon:"calendar",svgIcon:J.calendarIcon,onMouseDown:this.handleIconMouseDown,onClick:this.mobileMode?void 0:this.handleDateIconClick,title:k.provideLocalizationService(this).toLanguageString(ye,M[ye]),className:"k-input-button",rounded:null,"aria-label":k.provideLocalizationService(this).toLanguageString(ye,M[ye])}),r.createElement(O,{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?r.createElement(Lt,{dateInput:this._dateInput,label:this.props.label,editorId:h,editorValid:P,editorDisabled:this.props.disabled,children:x,style:{width:this.props.width}}):x}setShow(s){const{onOpen:e,onClose:t}=this.props;this.show!==s&&(this.setState({show:s}),s&&e&&e.call(void 0,{target:this}),!s&&t&&t.call(void 0,{target:this}))}nextTick(s){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>s())}calculateMedia(s){for(let e of s)this.setState({windowWidth:e.target.clientWidth})}};let Ve=X;Ve.displayName="DateTimePicker";Ve.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"])};Ve.defaultProps={defaultShow:!1,defaultValue:null,disabled:!1,format:"g",max:se,min:te,popupSettings:{},tabIndex:0,weekNumber:!1,required:!1,validityStyles:!0,cancelButton:!0,dateInput:ae,size:"medium",rounded:"medium",fillMode:"solid"};const qs=d.createPropsContext(),Ws=d.withIdHOC(d.withPropsContext(qs,Ve));Ws.displayName="KendoReactDateTimePicker";k.registerForLocalization(Ve);exports.Action=D;exports.BusViewService=Et;exports.Calendar=tt;exports.CalendarCell=is;exports.CalendarHeaderTitle=fs;exports.CalendarNavigationItem=ws;exports.CalendarPropsContext=Ds;exports.CalendarViewEnum=S;exports.CalendarWeekCell=ns;exports.CalendarWithoutContext=ne;exports.CenturyViewService=ls;exports.DOMService=ds;exports.DateInput=ae;exports.DateInputPropsContext=ks;exports.DateInputWithoutContext=re;exports.DatePicker=Is;exports.DatePickerPropsContext=xs;exports.DatePickerWithoutContext=Me;exports.DateRangePicker=zs;exports.DateRangePickerPropsContext=Bs;exports.DateRangePickerWithoutContext=Oe;exports.DateTimePicker=Ws;exports.DateTimePickerPropsContext=qs;exports.DateTimePickerWithoutContext=Ve;exports.DayPeriodService=Ms;exports.DecadeViewService=hs;exports.EMPTY_SELECTIONRANGE=_;exports.Header=xe;exports.HorizontalViewList=ke;exports.HoursService=Os;exports.MAX_DATE=se;exports.MAX_TIME=oe;exports.MIN_DATE=te;exports.MIN_TIME=de;exports.MinutesService=Ns;exports.MonthViewService=cs;exports.MultiViewCalendar=Bt;exports.MultiViewCalendarPropsContext=As;exports.MultiViewCalendarWithoutContext=Q;exports.NavigationService=Ot;exports.PickerWrap=Cs;exports.ScrollSyncService=ps;exports.SecondsService=Ls;exports.TimeList=He;exports.TimePart=pe;exports.TimePicker=Hs;exports.TimePickerPropsContext=_s;exports.TimePickerWithoutContext=Ee;exports.TimeSelector=Te;exports.TodayCommand=Ie;exports.ToggleButton=Ss;exports.ViewList=_e;exports.Virtualization=Ce;exports.WeekNamesService=ms;exports.YearViewService=us;exports.dateInputsMessages=M;exports.decreaseValue=be;exports.end=Ge;exports.getNow=ue;exports.getToday=H;exports.increaseValue=we;exports.separator=Xe;exports.start=Ze;exports.swapStartEnd=De;exports.today=Ke;exports.toggleCalendar=je;exports.toggleDateTimeSelector=ye;