@progress/kendo-react-dropdowns 7.1.1-develop.2 → 7.1.1-develop.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,4 +2,4 @@
2
2
  * Copyright © 2024 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the package root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
- (function(M,Qe){typeof exports=="object"&&typeof module!="undefined"?Qe(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-react-labels"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-popup"),require("@progress/kendo-react-inputs"),require("@progress/kendo-react-intl"),require("@progress/kendo-react-buttons"),require("@progress/kendo-react-layout"),require("@progress/kendo-react-treeview")):typeof define=="function"&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-react-labels","@progress/kendo-svg-icons","@progress/kendo-react-popup","@progress/kendo-react-inputs","@progress/kendo-react-intl","@progress/kendo-react-buttons","@progress/kendo-react-layout","@progress/kendo-react-treeview"],Qe):(M=typeof globalThis!="undefined"?globalThis:M||self,Qe(M.KendoReactDropdowns={},M.React,M.PropTypes,M.KendoReactCommon,M.KendoReactLabels,M.KendoSvgIcons,M.KendoReactPopup,M.KendoReactInputs,M.KendoReactIntl,M.KendoReactButtons,M.KendoReactLayout,M.KendoReactTreeview))})(this,function(M,Qe,o,d,Ae,Ie,ct,Jt,xe,Ce,fe,ut){"use strict";"use client";function xs(i){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const e in i)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(t,e,s.get?s:{enumerable:!0,get:()=>i[e]})}}return t.default=i,Object.freeze(t)}const a=xs(Qe);class Xe extends a.Component{render(){const{children:t,width:e,dir:s,itemsCount:n,popupSettings:l}=this.props;return a.createElement(ct.Popup,{style:{width:e,direction:s},contentKey:n&&n.join(),...l},t)}}const Ft=a.forwardRef((i,t)=>{const e=a.useRef(null);return a.useImperativeHandle(t,()=>e.current),a.createElement("div",{className:"k-list-filter"},a.createElement(Jt.TextBox,{...i,ref:e,value:i.value||"",onChange:i.onChange,onKeyDown:i.onKeyDown,tabIndex:i.tabIndex,onClick:s=>s.stopPropagation(),size:i.size,fillMode:i.fillMode,rounded:i.rounded,prefix:()=>a.createElement(Jt.InputPrefix,null,a.createElement(d.IconWrap,{name:"search",icon:Ie.searchIcon}))}))});Ft.propTypes={value:o.oneOfType([o.string,o.number,o.array]),tabIndex:o.number,onChange:o.func,onKeyDown:o.func,size:o.oneOf([null,"small","medium","large"]),rounded:o.oneOf([null,"small","medium","large","full"]),fillMode:o.oneOf([null,"solid","flat","outline"])},Ft.displayName="KendoReactListFilter";const Ke=Ft;class We extends a.Component{render(){const{group:t,groupMode:e,render:s}=this.props,n=a.createElement("div",{className:"k-list-group-sticky-header"},e==="classic"?t:a.createElement("div",{className:"k-list-header-text"},t));return s!==void 0?s.call(void 0,n,this.props):n}}const Y=i=>i!=null,ys=(i,t)=>{for(let e=0;e<i.length;e++)if(i.charAt(e)!==t)return!1;return!0},Ss=(i,t,e)=>{let s=i;return e&&(s=[e].concat(s)),s.slice(t).concat(s.slice(0,t))},Qt=(i,t,e)=>{if(!Y(i))return!1;let s=String(i);return e&&(s=s.toLowerCase()),s.indexOf(t)===0},Xt=(i,t,e,s,n)=>{const l=i.offsetHeight,h=t.children.item(e),u=h.offsetTop+(n?s-i.scrollTop:0),c=h.offsetHeight;if(n){let r=0;u+c>l?r=u+c-l:u<0&&(r=u),r!==0?i.scrollTop+=r:i.scrollTop===0&&s!==0&&(i.scrollTop=s)}else u+c>l+i.scrollTop?i.scrollTop=u+c-l:u<i.scrollTop&&(i.scrollTop-=i.scrollTop-u)},_e=(i,t,e)=>{let s=-1;if(t){t=t.toLowerCase();for(let n=0;n<i.length;n++){const l=(z(i[n],e)||"")+"";if(l&&l.toLowerCase().startsWith(t)){s=n;break}}}return s},Kt=(i,t,e,s=!1)=>{const n=l=>s?l:l.toLowerCase();return i.findIndex(l=>e?n(z(l,e))===n(t):n(t)===n(l.toString()))},z=(i,t)=>{if(t&&Y(i)){const e=t.split(".");let s=i;return e.forEach(n=>{s=s?s[n]:void 0}),s}return i},ws=(i,t,e)=>{if(!i)return;const s=i.findIndex(n=>z(n,t)===e);return i[s]},Es=(i=[],t=[],e)=>{if(i===t)return!0;if(i.length!==t.length)return!1;for(let s=0;s<i.length;s++)if(!L(i[s],t[s],e))return!1;return!0},ht=(i,t,e)=>{t.forEach(s=>{const n=i.findIndex(l=>L(l,s,e));n!==-1&&i.splice(n,1)})},L=(i,t,e)=>i===t||Y(i)===Y(t)&&z(i,e)===z(t,e),Zt=(i,t,e)=>{if(t){const s=Kt(i,t,e,!0);return s!==-1?i[s]:i[_e(i,t,e)]}return i[0]},Cs=(i,t=[],e)=>{let s="";if(i){const n=t[_e(t,i,e)];if(n){const l=z(n,e);i.toLowerCase()!==l.toLowerCase()&&(s=l.substring(i.length))}}return s},ks=i=>{i.target.nodeName!=="INPUT"&&i.preventDefault()},pt=(i,t,e)=>!!i!=!!t||i.text!==t.text?!1:i===t||Es(i.data,t.data,e),Ds=i=>i.preventDefault();class Fs extends a.Component{render(){const{selected:t,defaultItem:e,textField:s}=this.props;return a.createElement("div",{onClick:this.props.onClick,onMouseDown:Ds,style:{position:"unset"},className:d.classNames("k-list-optionlabel",{"k-selected":t})},z(e,s)||"")}}class Pt extends a.Component{constructor(){super(...arguments),this.handleClick=t=>this.props.onClick(this.props.index,t)}render(){const{selected:t,group:e,dataItem:s,virtual:n,groupMode:l,disabled:h,render:u}=this.props,c=a.createElement("li",{id:this.props.id,role:"option","aria-selected":t,"aria-disabled":h?!0:void 0,className:d.classNames("k-list-item",{"k-selected":t,"k-focus":this.props.focused,"k-first":!!e&&l==="classic","k-disabled":h}),onClick:this.handleClick,style:{position:n?"relative":"unset"}},a.createElement("span",{className:"k-list-item-text"},z(s,this.props.textField).toString()),e!==void 0&&l==="classic"?a.createElement("div",{className:"k-list-item-group-label"},e):null);return u!==void 0?u.call(void 0,c,this.props):c}}class Ks extends a.Component{render(){const{group:t,virtual:e,render:s,isMultiColumn:n=!1}=this.props,l=a.createElement("li",{id:this.props.id,role:"group",className:n?"k-table-group-row":"k-list-group-item",style:n?{boxSizing:"inherit"}:{position:e?"relative":"unset"}},a.createElement("span",{className:s?void 0:n?"k-table-th":"k-list-item-text"},t));return s!==void 0?s.call(void 0,l,this.props):l}}const ge="dropdowns.nodata",Ze="dropdowns.clear",Mt="dropdowns.comboArrowBtnAriaLabelExpand",Nt="dropdowns.comboArrowBtnAriaLabelCollapse",Ot="dropdowns.dropDownListArrowBtnAriaLabel",Pe="dropdowns.apply",Re="dropdowns.cancel",ne={[Ze]:"clear",[ge]:"NO DATA FOUND.",[Mt]:"expand combobox",[Nt]:"collapse combobox",[Ot]:"select",[Pe]:"Apply",[Re]:"Cancel"};class Ve extends a.Component{renderItems(){const{textField:t,valueField:e,groupField:s,groupMode:n,isMultiColumn:l,optionsGuid:h,skip:u=0,virtual:c,focusedIndex:r,highlightSelected:p=!0,value:f,data:g,itemRender:v,groupHeaderItemRender:m}=this.props,b=Array.isArray(f);let C=0;return g.map((w,D)=>{const _=u+D,O=u+D+C,B=w.disabled?!1:p&&(!b&&L(w,f,e)||b&&f.findIndex(k=>L(k,w,e))!==-1);let E,K,S;return D>0&&s!==void 0&&(K=z(w,s),S=z(g[D-1],s),K&&S&&K!==S&&(E=K)),E!==void 0&&n==="modern"&&(C+=1),[E!==void 0&&n==="modern"&&a.createElement(Ks,{id:`option-${h}-${O}`,virtual:c,key:_+"-group-item",group:E,isMultiColumn:l,render:m}),a.createElement(Pt,{id:`option-${h}-${E!==void 0&&n==="modern"?O+1:O}`,virtual:c,dataItem:w,groupMode:n,selected:B,focused:r===D,index:_,key:_,onClick:this.props.onClick,textField:t,group:E,render:v,disabled:w.disabled})]})}renderNoValueElement(t){const e=this.props.noDataRender,s=a.createElement("div",{className:"k-nodata"},a.createElement("div",null,t.toLanguageString(ge,ne[ge])));return e?e.call(void 0,s):s}render(){const t=xe.provideLocalizationService(this),{id:e,show:s,wrapperCssClass:n,wrapperStyle:l,listStyle:h,listRef:u,wrapperRef:c,listClassName:r="k-list-ul",ariaSetSize:p}=this.props,f=this.renderItems();return f.length?a.createElement("div",{className:n,style:l,ref:c,onMouseDown:this.props.onMouseDown,onBlur:this.props.onBlur,onScroll:this.props.onScroll,unselectable:"on"},a.createElement("ul",{id:e,role:"listbox","aria-hidden":s?void 0:!0,"aria-setsize":p,className:r,ref:u,style:h},f),this.props.scroller&&a.createElement("div",{className:"k-height-container"},this.props.scroller)):this.renderNoValueElement(t)}}xe.registerForLocalization(Ve);const Ms=1533915;class Ns{constructor(){this.container=null,this.scrollElement=null,this.list=null,this.containerHeight=0,this.skip=0,this.total=0,this.enabled=!1,this.pageSize=0,this.itemHeight=0,this.PageChange=null,this.prevScrollPos=0,this.listTranslate=0,this.scrollSyncing=!1,this.scrollerRef=t=>{const e=this;e.container=t,t&&(t.setAttribute("unselectable","on"),window.setTimeout(e.calcScrollElementHeight.bind(e),0))},this.calcScrollElementHeight=()=>{this.scrollSyncing=!0;let t=!1;this.itemHeight=this.list?this.list.children[0].offsetHeight:this.itemHeight,this.containerHeight=Math.min(Ms,this.itemHeight*this.total);const e=this.containerHeight;return this.scrollElement&&(t=this.scrollElement.style.height!==e+"px",t&&(this.scrollElement.style.height=e+"px")),this.scrollSyncing=!1,t},this.scrollHandler=this.scrollHandler.bind(this)}get translate(){return this.listTranslate}changePage(t,e){const s=Math.min(Math.max(0,t),this.total-this.pageSize);s!==this.skip&&this.PageChange&&this.PageChange({skip:s,take:this.pageSize},e)}translateTo(t){this.listTranslate=t,this.list&&(this.list.style.transform="translateY("+t+"px)")}reset(){this.container&&(this.calcScrollElementHeight(),this.container.scrollTop=0,this.translateTo(0))}scrollToEnd(){this.container&&this.list&&(this.calcScrollElementHeight(),this.container.scrollTop=this.container.scrollHeight-this.container.offsetHeight,this.translateTo(this.container.scrollHeight))}localScrollUp(t){const e=this.itemHeight,s=this.container.scrollTop;let n=this.listTranslate,l,h=s-n;if(!(h>e)){for(l=0;l<this.skip&&!(n+e+h<=s);l++)n-=e;if(n=this.validateTranslate(n),this.skip-l<=0&&n>=s){this.translateTo(0),this.changePage(0,t),this.container.scrollTop=0;return}n!==this.listTranslate&&(this.translateTo(n),this.changePage(this.skip-l,t))}}localScrollDown(t){const e=this.itemHeight;let s=this.container.scrollTop,n=this.listTranslate;const l=this.list.children.length;let h;for(h=0;h<l&&!(n+e>=s);h++)n+=e;n=this.validateTranslate(n),h>=l&&this.skip+h>=this.total?(this.translateTo(n),this.changePage(this.total-1,t)):n!==this.listTranslate&&(this.translateTo(n),this.changePage(this.skip+h,t))}scrollNonStrict(t){const e=this.total*this.prevScrollPos/this.containerHeight,s=Math.min(Math.floor(e),this.total-1);let n=this.containerHeight*e/this.total;n=this.validateTranslate(n),this.translateTo(n),this.changePage(s,t)}scrollHandler(t){const e=this.container?this.container.scrollTop:0,s=this.prevScrollPos;this.prevScrollPos=e,!(!this.enabled||!this.list||!this.container||this.scrollSyncing)&&(e-s<=0&&e>this.listTranslate-this.list.scrollHeight/10?this.localScrollUp(t):e-s>0&&e<this.listTranslate+this.list.scrollHeight*2/3?this.localScrollDown(t):this.scrollNonStrict(t))}validateTranslate(t){return t=Math.max(0,t),t=Math.min(this.containerHeight,t),t}}class Os{navigate(t){const e=t.keyCode;if(e===d.Keys.up||e===d.Keys.left)return this.next({current:t.current,min:t.min,max:t.max,step:t.skipItems?t.skipItems:-1});if(e===d.Keys.down||e===d.Keys.right)return this.next({current:t.current,min:t.min,max:t.max,step:t.skipItems?t.skipItems:1});if(e===d.Keys.home)return 0;if(e===d.Keys.end)return t.max}next(t){return Y(t.current)?Math.min(t.max,Math.max(t.current+t.step,t.min)):t.min}}const _t=class{constructor(i){this.wrapper=null,this.list=null,this.vs=new Ns,this.navigation=new Os,this.handleItemClick=(t,e)=>{const s=this.initState();s.syntheticEvent=e,e.stopPropagation(),this.component.handleItemSelect(t,s),this.togglePopup(s),this.applyState(s)},this.handleFocus=t=>{if(!this.component.state.focused){const e=this.initState();e.data.focused=!0,e.events.push({type:"onFocus"}),e.syntheticEvent=t,this.applyState(e)}},this.filterChanged=(t,e)=>{const{textField:s,filterable:n}=this.component.props;n&&e.events.push({type:"onFilterChange",filter:{field:s,operator:"contains",ignoreCase:!0,value:t}})},this.togglePopup=t=>{const e=this.component.props,s=e.opened!==void 0?e.opened:this.component.state.opened;e.opened===void 0&&(t.data.opened=!s),s?t.events.push({type:"onClose"}):(t.events.push({type:"onOpen"}),this.calculatePopupWidth())},this.pageChange=(t,e)=>{const s=this.initState();s.syntheticEvent=e,this.triggerOnPageChange(s,t.skip,t.take),this.applyState(s)},this.scrollToVirtualItem=(t,e)=>{const s=this.vs;if(s.enabled=!1,t.skip===0)s.reset();else if(t.skip+t.pageSize===t.total)s.scrollToEnd();else{let n=s.translate;n===0&&(s.calcScrollElementHeight(),n=s.itemHeight*t.skip,s.translateTo(n-s.itemHeight)),s.container&&(s.container.scrollTop=n),this.scrollToItem(e,!0)}window.setTimeout(()=>s.enabled=!0,10)},this.scrollPopupByPageSize=t=>{var h,u,c,r,p,f;const e=this.vs,s=(u=(h=this.list)==null?void 0:h.parentElement)==null?void 0:u.scrollTop,n=e.enabled&&e.itemHeight?e.itemHeight:this.list?this.list.children[0].offsetHeight:0,l=(r=(c=this.list)==null?void 0:c.parentElement)==null?void 0:r.offsetHeight;s!==void 0&&l!==void 0&&((f=(p=this.list)==null?void 0:p.parentElement)==null||f.scroll({top:s+t*Math.floor(l/n)*n}))},this.renderScrollElement=()=>{const t=this.vs;return t.enabled&&a.createElement("div",{ref:e=>t.scrollElement=e,key:"scrollElementKey"})},this.resetGroupStickyHeader=(t,e)=>{t!==e.state.group&&e.setState({...e.state,group:t})},this.listBoxId=i.props.id+"list",this.guid=i.props.id,this.component=i,this.vs.PageChange=this.pageChange}didMount(){const i=this.component.props,t=i.popupSettings||{},e=i.style||{},s=t.width;let n=i.opened===!0;s===void 0&&this.calculatePopupWidth(),i.dir===void 0&&e.direction===void 0&&(this.calculateDir(),n=!0),n&&this.component.forceUpdate()}calculateDir(){const i=this.component.element;i&&i.ownerDocument&&i.ownerDocument.defaultView&&(this.dirCalculated=i.ownerDocument.defaultView.getComputedStyle(i).direction||void 0)}calculatePopupWidth(){this.wrapper&&(this.popupWidth=this.wrapper.offsetWidth+"px")}scrollToItem(i,t,e){const s=this.list||this.vs.list;if(!s&&!e&&setTimeout(()=>{this.scrollToItem(i,t,!0)},10),s&&i>=0){const n=this.vs,l=n.container||s.parentNode,h=t!==void 0?t:n.enabled;Xt(l,s,i,n.translate,h)}}initState(){return{data:{},events:[],syntheticEvent:void 0}}applyState(i){Object.keys(i.data).length>0&&this.component.setState(i.data);const t={syntheticEvent:i.syntheticEvent,nativeEvent:i.syntheticEvent?i.syntheticEvent.nativeEvent:void 0,target:this.component,value:this.component.value};i.events.forEach(e=>{const s=e.type;delete e.type;const n=s&&this.component.props[s];n&&n.call(void 0,{...t,...e})})}triggerOnPageChange(i,t,e){const s=this.component.props.virtual;if(s){const n=Math.min(Math.max(0,t),Math.max(0,s.total-e));n!==s.skip&&i.events.push({type:"onPageChange",page:{skip:n,take:e}})}}triggerPageChangeCornerItems(i,t){const e=this.component.props,{data:s=[],dataItemKey:n,virtual:l}=e,h=e.opened!==void 0?e.opened:this.component.state.opened;i&&l&&this.vs.enabled&&(l.skip>0&&L(i,s[0],n)?this.triggerOnPageChange(t,l.skip-1,l.pageSize):!h&&l.skip+l.pageSize<l.total&&L(i,s[s.length-1],n)&&this.triggerOnPageChange(t,l.skip+1,l.pageSize))}getPopupSettings(){return Object.assign({},_t.defaultProps.popupSettings,this.component.props.popupSettings)}getGroupedDataModernMode(i,t){let e=[];return i.forEach((s,n)=>{i[n-1]&&s[t]!==i[n-1][t]&&e.push({[t]:s[t]}),e.push(i[n])}),e}};let ae=_t;ae.basicPropTypes={opened:o.bool,disabled:o.bool,dir:o.string,tabIndex:o.number,accessKey:o.string,data:o.array,textField:o.string,className:o.string,label:o.string,loading:o.bool,popupSettings:o.shape({animate:o.oneOfType([o.bool,o.shape({openDuration:o.number,closeDuration:o.number})]),popupClass:o.string,className:o.string,appendTo:o.any,width:o.oneOfType([o.string,o.number]),height:o.oneOfType([o.string,o.number])}),onOpen:o.func,onClose:o.func,onFocus:o.func,onBlur:o.func,onChange:o.func,itemRender:o.func,listNoDataRender:o.func,focusedItemIndex:o.func,header:o.node,footer:o.node},ae.propTypes={..._t.basicPropTypes,value:o.any,defaultValue:o.any,filterable:o.bool,filter:o.string,virtual:o.shape({pageSize:o.number.isRequired,skip:o.number.isRequired,total:o.number.isRequired}),onFilterChange:o.func,onPageChange:o.func},ae.defaultProps={popupSettings:{height:"200px"},required:!1,validityStyles:!0};const qe={name:"@progress/kendo-react-dropdowns",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:1654528156,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"},ft=500,ke=768,_s="Please select a value from the list!",{sizeMap:Vt,roundedMap:Vs}=d.kendoThemeMaps,Bt=class extends a.Component{constructor(i){super(i),this.state={},this._element=null,this.base=new ae(this),this.searchState={word:"",last:""},this._select=null,this._skipFocusEvent=!1,this._filterInput=null,this._navigated=!1,this._lastKeypressIsFilter=!1,this.itemHeight=0,this.focus=()=>{this.base.wrapper&&this.base.wrapper.focus()},this.handleItemSelect=(t,e)=>{const{data:s=[],virtual:n,dataItemKey:l,defaultItem:h}=this.props,u=n?n.skip:0,c=t===-1&&h!==void 0?h:s[t-u],r=!L(c,this.value,l);this.triggerOnChange(c,e),r&&this.base.triggerPageChangeCornerItems(c,e)},this.componentRef=t=>{this._element=t,this.base.wrapper=t},this.dummySelect=t=>a.createElement("select",{name:this.props.name,ref:e=>{this._select=e},tabIndex:-1,"aria-hidden":!0,title:this.props.label,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},a.createElement("option",{value:this.props.valueMap?this.props.valueMap.call(void 0,t):t})),this.renderListContainer=()=>{const{header:t,footer:e,dir:s,data:n=[],size:l,groupField:h,groupStickyHeaderItemRender:u,list:c}=this.props,r=this.base,p=r.getPopupSettings(),f=this.props.opened!==void 0?this.props.opened:this.state.opened,g=p.width!==void 0?p.width:r.popupWidth,v={dir:s!==void 0?s:r.dirCalculated,width:g,popupSettings:{popupClass:d.classNames(p.popupClass,"k-list-container","k-dropdownlist-popup"),className:p.className,animate:p.animate,anchor:this.element,show:f,onOpen:this.onPopupOpened,onClose:this.onPopupClosed,appendTo:p.appendTo},itemsCount:[n.length]};let{group:m}=this.state;return m===void 0&&h!==void 0&&(m=z(n[0],h)),a.createElement(Xe,{...v},this.renderListFilter(),t&&a.createElement("div",{className:"k-list-header"},t),a.createElement("div",{className:d.classNames("k-list",{[`k-list-${Vt[l]||l}`]:l,"k-virtual-list":this.base.vs.enabled})},this.renderDefaultItem(),!c&&m&&n.length!==0&&a.createElement(We,{group:m,groupMode:"modern",render:u}),this.renderList()),e&&a.createElement("div",{className:"k-list-footer"},e))},this.renderList=()=>{const{data:t=[],textField:e,dataItemKey:s,virtual:n={skip:0,total:void 0},groupHeaderItemRender:l,listNoDataRender:h,itemRender:u}=this.props,c=this.base.vs,r=n.skip,p=this.props.opened!==void 0?this.props.opened:this.state.opened,f=this.base.getPopupSettings(),g=`translateY(${c.translate}px)`;return a.createElement(Ve,{id:this._listboxId,show:p,data:t.slice(),focusedIndex:this.getFocusedIndex(),value:this.value,textField:e,valueField:s,optionsGuid:this._guid,groupField:this.props.groupField,groupMode:"modern",listRef:v=>c.list=this.base.list=v,wrapperStyle:{maxHeight:f.height},wrapperCssClass:"k-list-content",listStyle:c.enabled?{transform:g}:void 0,key:"listkey",skip:r,onClick:this.handleItemClick,itemRender:u,groupHeaderItemRender:l,noDataRender:h,onScroll:this.onScroll,wrapperRef:c.scrollerRef,scroller:this.base.renderScrollElement(),ariaSetSize:n.total})},this.onScroll=t=>{const{vs:e,list:s}=this.base;e.scrollHandler(t);const{groupField:n}=this.props;let{data:l=[]}=this.props;if(!(!n||!l.length)&&n){const h=this.itemHeight=this.itemHeight||(e.enabled?e.itemHeight:s?s.children[0].offsetHeight:0),c=t.target.scrollTop-e.skip*h;l=this.base.getGroupedDataModernMode(l,n);let r=l[0][n];for(let p=1;p<l.length&&!(h*p>c);p++)l[p]&&l[p][n]&&(r=l[p][n]);r!==this.state.group&&this.setState({group:r})}},this.renderListFilter=()=>{const t=this.props.filter!==void 0?this.props.filter:this.state.text;return this.props.filterable&&a.createElement(Ke,{value:t,ref:e=>this._filterInput=e&&e.element,onChange:this.handleListFilterChange,onKeyDown:this.handleKeyDown,size:this.props.size,rounded:this.props.rounded,fillMode:this.props.fillMode})},this.renderDefaultItem=()=>{const{textField:t,defaultItem:e,dataItemKey:s}=this.props;return e!==void 0&&a.createElement(Fs,{defaultItem:e,textField:t,selected:L(this.value,e,s),key:"defaultitemkey",onClick:this.handleDefaultItemClick})},this.search=t=>{clearTimeout(this._typingTimeout),this.props.filterable||(this._typingTimeout=window.setTimeout(()=>this.searchState.word="",this.props.delay),this.selectNext(t))},this.selectNext=t=>{const{data:e=[],dataItemKey:s}=this.props;let n=e.map((w,D)=>({item:w,itemIndex:D}));const l=this.searchState.word,h=this.searchState.last,u=ys(l,h);let c=n.length,r=Math.max(0,e.findIndex(w=>L(w,this.value,s))),p;this.props.defaultItem&&(p={item:this.props.defaultItem,itemIndex:-1},c+=1,r+=1),r+=u?1:0,n=Ss(n,r,p);let f,g,v,m=0;const{textField:b,ignoreCase:C}=this.props;for(;m<c;m++)if(f=z(n[m].item,b),g=u&&Qt(f,h,C),v=Qt(f,l,C),g||v){m=n[m].itemIndex;break}if(m!==c){const w=this.base.initState();w.syntheticEvent=t,this.handleItemSelect(m,w),this.applyState(w),this._valueDuringOnChange=void 0}},this.handleKeyDown=t=>{t&&t.target instanceof Element&&t.target.nodeName==="INPUT"&&t.stopPropagation&&t.stopPropagation();const{data:e=[],filterable:s,disabled:n,defaultItem:l,leftRightKeysNavigation:h=!0,virtual:u={skip:0,total:0,pageSize:0},dataItemKey:c,groupField:r="",textField:p,skipDisabledItems:f=!0}=this.props,g=this.value,v=e.findIndex(K=>L(K,g,c)),m=this.props.opened!==void 0?this.props.opened:this.state.opened,b=t.keyCode,C=b===d.Keys.home||b===d.Keys.end,w=b===d.Keys.up||b===d.Keys.down,D=!m&&(t.altKey&&b===d.Keys.down||b===d.Keys.enter||b===d.Keys.space),_=m&&(t.altKey&&b===d.Keys.up||b===d.Keys.esc),O=h&&(b===d.Keys.left||b===d.Keys.right),B=w||O&&!s||C,E=this.base.initState();if(E.syntheticEvent=t,!n){if(C&&this.base.vs.enabled)b===d.Keys.home?u.skip!==0?(this.base.triggerOnPageChange(E,0,u.pageSize),this._navigated=!0):this.triggerOnChange(e[0],E):u.skip<u.total-u.pageSize?(this.base.triggerOnPageChange(E,u.total-u.pageSize,u.pageSize),this._navigated=!0):this.triggerOnChange(e[e.length-1],E);else if(m&&b===d.Keys.pageUp)this.base.scrollPopupByPageSize(-1);else if(m&&b===d.Keys.pageDown)this.base.scrollPopupByPageSize(1);else if(m&&b===d.Keys.enter){const K=this.getFocusedIndex();this.haveFocusedItemAndDataNotEmpty(e,K)?(this.triggerOnChange(null,E),this.applyState(E)):this.handleItemSelect(K,E),this.base.togglePopup(E),t.preventDefault()}else if(D||_)_&&this.resetValueIfDisabledItem(),this.base.togglePopup(E),t.preventDefault();else if(B){if(this._lastKeypressIsFilter=!1,r!==""&&p)if(!f&&m)this.onNavigate(E,b);else{let K;if(b===d.Keys.down||b===d.Keys.right){const S=e.slice(v+1).find(k=>!k.disabled&&k[p]);K=S&&e.findIndex(k=>k[p]===S[p])}else if(b===d.Keys.up||b===d.Keys.left){let S;if(v===0&&l)K=-1;else if(v===-1)S=e,K=e.findIndex(k=>!k.disabled&&k[p]);else{S=e.slice(0,v);let k=S.pop();for(;k&&k.disabled;)k=S.pop();K=k&&e.findIndex(N=>N[p]===k[p])}}if(K!==void 0){const S=K-v;this.onNavigate(E,b,S)}else K===void 0&&e.findIndex(S=>S[p]===g[p])===e.length-1&&this.onNavigate(E,b)}else if(!f&&m||C)this.onNavigate(E,b);else if(p){let K;if(b===d.Keys.down||b===d.Keys.right){const S=e.slice(v+1).find(k=>!k.disabled&&k[p]);K=S&&e.findIndex(k=>k[p]===S[p])}else if(b===d.Keys.up||b===d.Keys.left){let S;if(v===0&&l)K=-1;else if(v===-1)S=e,K=e.find(k=>!k.disabled&&k[p]);else{S=e.slice(0,v);let k=S.pop();for(;k&&k.disabled;)k=S.pop();K=k&&e.findIndex(N=>N[p]===k[p])}}if(K!==void 0){const S=K-v;this.onNavigate(E,b,S)}else K===void 0&&e.findIndex(S=>S[p]===g[p])===e.length-1&&this.onNavigate(E,b)}else this.onNavigate(E,b);t.preventDefault()}this.applyState(E)}},this.handleItemClick=(t,e)=>{this.base.handleItemClick(t,e),this._valueDuringOnChange=void 0},this.handleFocus=t=>{this._skipFocusEvent||this.base.handleFocus(t)},this.handleBlur=t=>{if(this._skipFocusEvent||!this.state.focused)return;const e=this.props.opened!==void 0?this.props.opened:this.state.opened,{adaptive:s}=this.props,{windowWidth:n=0}=this.state,l=n<=ke&&s,h=this.base.initState();h.syntheticEvent=t,h.data.focused=!1,h.events.push({type:"onBlur"}),e&&this.resetValueIfDisabledItem(),e&&!l&&this.base.togglePopup(h),this.applyState(h)},this.handleDefaultItemClick=t=>{const e=this.base.initState();e.syntheticEvent=t,this.base.togglePopup(e),this.triggerOnChange(this.props.defaultItem,e),this.applyState(e)},this.handleWrapperClick=t=>{if(t.isPropagationStopped())return;const e=this.base.initState();e.syntheticEvent=t,this.state.focused||(e.data.focused=!0),this.resetValueIfDisabledItem(),this.base.togglePopup(e),this.applyState(e)},this.handleKeyPress=t=>{if(this.props.filterable||t.which===0||t.keyCode===d.Keys.enter)return;let e=String.fromCharCode(t.charCode||t.keyCode);this.props.ignoreCase&&(e=e.toLowerCase()),e===" "&&t.preventDefault(),this.searchState={word:this.searchState.word+e,last:this.searchState.last+e},this.search(t)},this.handleListFilterChange=t=>{const e=this.base.initState();e.syntheticEvent=t.syntheticEvent,this.props.filter===void 0&&(e.data.text=t.target.value),this.base.filterChanged(t.target.value,e),this._lastKeypressIsFilter=!0,this.applyState(e),this.setState({group:void 0})},this.onPopupOpened=()=>{this._filterInput&&this.focusElement(this._filterInput),this.props.adaptive&&setTimeout(()=>{this._filterInput&&this.focusElement(this._filterInput)},300)},this.onPopupClosed=()=>{this.state.focused&&window.setTimeout(()=>{this.state.focused&&this.base.wrapper&&this.focusElement(this.base.wrapper)})},this.setValidity=()=>{this._select&&this._select.setCustomValidity&&this._select.setCustomValidity(this.validity.valid?"":this.props.validationMessage||_s)},d.validatePackage(qe)}get _inputId(){return this.props.id+"-accessibility-id"}get _listboxId(){return this.props.id+"-listbox-id"}get _guid(){return this.props.id+"-guid"}get document(){if(d.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get value(){let i;return this._valueDuringOnChange!==void 0?i=this._valueDuringOnChange:this.props.value!==void 0?i=this.props.value:this.state.value!==void 0?i=this.state.value:this.props.defaultValue!==void 0&&(i=this.props.defaultValue),!Y(i)&&this.props.defaultItem!==void 0&&(i=this.props.defaultItem),i}get index(){const{data:i=[],dataItemKey:t}=this.props,e=this.value;return i.findIndex(s=>L(s,e,t))}get name(){return this.props.name}get validity(){const i=this.props.validationMessage!==void 0,t=!this.required||this.value!==null&&this.value!==""&&this.value!==void 0,e=this.props.valid!==void 0?this.props.valid:t;return{customError:i,valid:e,valueMissing:this.value===null}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:Bt.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:Bt.defaultProps.required}componentDidUpdate(i,t){var f;const{dataItemKey:e,virtual:s,groupField:n="",textField:l}=this.props;let{data:h=[]}=this.props;const u=i.virtual?i.virtual.total:0,c=this.props.opened!==void 0?this.props.opened:this.state.opened,r=i.opened!==void 0?i.opened:t.opened,p=!r&&c;if(this.base.getPopupSettings().animate||p&&this.onPopupOpened(),s&&s.total!==u)this.base.vs.calcScrollElementHeight(),this.base.vs.reset();else{const g=this.value,v=i.value!==void 0?i.value:t.value;let m=h.findIndex(C=>L(C,g,e));n!==""&&g&&l&&(m=(f=this.base.getGroupedDataModernMode(h,n))==null?void 0:f.map(C=>C[l]).indexOf(g[l]));const b=!L(v,g,e);p&&s?this.base.scrollToVirtualItem(s,m):p&&!s?(this.onPopupOpened(),h&&h.length!==0&&this.base.resetGroupStickyHeader(h[0][n],this),this.base.scrollToItem(m)):c&&r&&g&&b&&!this._navigated?this.base.scrollToItem(m):c&&r&&this._navigated&&(this._navigated&&s&&s.skip===0?this.base.vs.reset():this._navigated&&s&&s.skip===s.total-s.pageSize&&this.base.vs.scrollToEnd())}this._navigated=!1,this.setValidity()}componentDidMount(){var i;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.base.didMount(),this.setValidity(),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentWillUnmount(){var i;(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.disconnect()}render(){const i=xe.provideLocalizationService(this).toLanguageString(Ot,ne[Ot]),{style:t,className:e,label:s,dir:n,virtual:l,size:h,rounded:u,fillMode:c,adaptive:r}=this.props,{windowWidth:p=0}=this.state,f=this.props.opened!==void 0?this.props.opened:this.state.opened,g=this.value,v=z(g,this.props.textField),m=!this.validityStyles||this.validity.valid,b=this.base,C=b.vs,w=p<=ke&&r;C.enabled=l!==void 0,l!==void 0&&(b.vs.skip=l.skip,b.vs.total=l.total,b.vs.pageSize=l.pageSize);const{dataItemKey:D,data:_=[],disabled:O,tabIndex:B,loading:E,iconClassName:K,valueRender:S}=this.props,{focused:k}=this.state,N=_.findIndex(Q=>L(Q,g,D)),q=a.createElement("span",{id:this._inputId,className:"k-input-inner"},a.createElement("span",{className:"k-input-value-text"},v)),X=S!==void 0?S.call(void 0,q,g):q,J=a.createElement(a.Fragment,null,a.createElement("span",{ref:this.componentRef,className:d.classNames("k-dropdownlist k-picker",e,{[`k-picker-${Vt[h]||h}`]:h,[`k-rounded-${Vs[u]||u}`]:u,[`k-picker-${c}`]:c,"k-focus":k,"k-disabled":O,"k-invalid":!m,"k-loading":E,"k-required":this.required}),style:s?{...t,width:void 0}:t,dir:n,onMouseDown:f?Q=>{Q.target.nodeName!=="INPUT"&&(this.focusElement(this.base.wrapper),Q.preventDefault())}:void 0,onFocus:this.handleFocus,onBlur:this.handleBlur,tabIndex:d.getTabIndex(B,O),accessKey:this.props.accessKey,onKeyDown:this.handleKeyDown,onKeyPress:this.handleKeyPress,onClick:O?void 0:this.handleWrapperClick,role:"combobox","aria-required":this.required,"aria-disabled":O||void 0,"aria-haspopup":"listbox","aria-expanded":f||!1,"aria-owns":this._listboxId,"aria-activedescendant":f?"option-"+this._guid+"-"+(N+(l?l.skip:0)):void 0,"aria-label":this.props.ariaLabel||this.props.label,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy||this._inputId,id:this.props.id,title:this.props.title},X,E&&a.createElement(d.IconWrap,{className:"k-input-loading-icon",name:"loading"}),a.createElement(Ce.Button,{tabIndex:-1,type:"button","aria-label":i,"aria-hidden":!0,size:h,fillMode:c,iconClass:K,className:"k-input-button",rounded:null,themeColor:"base",icon:K?void 0:"caret-alt-down",svgIcon:K?this.props.svgIcon:Ie.caretAltDownIcon,onMouseDown:Q=>this.state.focused&&Q.preventDefault()}),this.dummySelect(g),!w&&this.renderListContainer()),w&&this.renderAdaptiveListContainer());return s?a.createElement(Ae.FloatingLabel,{label:s,editorValue:v,editorValid:m,editorDisabled:this.props.disabled,style:{width:t?t.width:void 0},children:J}):J}onNavigate(i,t,e){const{data:s=[],defaultItem:n,dataItemKey:l,virtual:h={skip:0,total:0,pageSize:0}}=this.props,u=this.base.vs,c=this.value,r=s.findIndex(f=>L(f,c,l)),p=this.base.navigation.navigate({current:h.skip+r,max:(u.enabled?h.total:s.length)-1,min:n!==void 0?-1:0,keyCode:t,skipItems:e||void 0});p!==void 0&&this.handleItemSelect(p,i),this.applyState(i)}renderAdaptiveListContainer(){const{windowWidth:i=0}=this.state,{header:t,footer:e,size:s,adaptiveTitle:n,groupField:l,groupStickyHeaderItemRender:h,list:u,data:c=[]}=this.props,r=this.props.opened!==void 0?this.props.opened:this.state.opened,p={navigatable:!1,navigatableElements:[],expand:r,animation:!0,onClose:g=>this.handleWrapperClick(g),animationStyles:i<=ft?{top:0,width:"100%",height:"100%"}:void 0,className:i<=ft?"k-adaptive-actionsheet k-actionsheet-fullscreen":"k-adaptive-actionsheet k-actionsheet-bottom"};let{group:f}=this.state;return f===void 0&&l!==void 0&&(f=z(c[0],l)),a.createElement(a.Fragment,null,a.createElement(fe.ActionSheet,{...p},a.createElement(fe.ActionSheetHeader,{className:"k-text-center"},a.createElement("div",{className:"k-actionsheet-titlebar-group k-hbox"},a.createElement("div",{className:"k-actionsheet-title"},a.createElement("div",null,n)),a.createElement("div",{className:"k-actionsheet-actions"},a.createElement(Ce.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",onClick:this.handleWrapperClick,icon:"x",svgIcon:Ie.xIcon}))),a.createElement("div",{className:"k-actionsheet-titlebar-group k-actionsheet-filter"},this.renderListFilter())),a.createElement(fe.ActionSheetContent,{className:"!k-overflow-hidden"},t&&a.createElement("div",{className:"k-list-header"},t),a.createElement("div",{className:d.classNames("k-list",{[`k-list-${Vt[s]||s}`]:s,"k-virtual-list":this.base.vs.enabled})},this.renderDefaultItem(),!u&&f&&c.length!==0&&a.createElement(We,{group:f,groupMode:"modern",render:h}),this.renderList()),e&&a.createElement("div",{className:"k-list-footer"},e))))}getFocusedIndex(){const i=this.value,{data:t=[],textField:e,dataItemKey:s,virtual:n={skip:0},focusedItemIndex:l=_e,filterable:h,skipDisabledItems:u=!0}=this.props,c=this.props.filter?this.props.filter:this.state.text;return u&&e&&!c&&!i?t.findIndex(r=>!r.disabled&&r[e]):Y(i)&&c===void 0||h&&c===""?t.findIndex(r=>L(r,i,s)):c?this._lastKeypressIsFilter?l(t,c,e):t.findIndex(r=>L(r,i,s)):n.skip===0?0:-1}focusElement(i){this._skipFocusEvent=!0,i.focus(),window.setTimeout(()=>this._skipFocusEvent=!1,30)}triggerOnChange(i,t){L(this.value,i,this.props.dataItemKey)||(this.props.value===void 0&&(t.data.value=i),this._valueDuringOnChange=i,t.events.push({type:"onChange"}))}applyState(i){this.base.applyState(i),this._valueDuringOnChange=void 0}calculateMedia(i){for(let t of i)this.setState({windowWidth:t.target.clientWidth})}resetValueIfDisabledItem(){const{data:i=[]}=this.props,t=this.base.initState(),e=this.getFocusedIndex();this.haveFocusedItemAndDataNotEmpty(i,e)&&(this.triggerOnChange(null,t),this.applyState(t))}haveFocusedItemAndDataNotEmpty(i,t){return t!==void 0&&t!==-1&&i&&i.length>0&&i[t].disabled}};let $e=Bt;$e.displayName="DropDownList",$e.propTypes={delay:o.number,ignoreCase:o.bool,iconClassName:o.string,svgIcon:d.svgIconPropType,defaultItem:o.any,valueRender:o.func,valueMap:o.func,validationMessage:o.string,required:o.bool,id:o.string,ariaLabelledBy:o.string,ariaDescribedBy:o.string,ariaLabel:o.string,leftRightKeysNavigation:o.bool,title:o.string,groupField:o.string,list:o.any,skipDisabledItems:o.bool,...ae.propTypes},$e.defaultProps={delay:500,tabIndex:0,ignoreCase:!0,...ae.defaultProps,required:!1,size:"medium",rounded:"medium",fillMode:"solid",groupMode:"modern"};const Rt=d.createPropsContext(),es=d.withIdHOC(d.withPropsContext(Rt,$e));es.displayName="KendoReactDropDownList";class gt extends a.Component{constructor(){super(...arguments),this._input=null}get input(){return this._input}componentDidUpdate(t){const e=t.value,s=t.suggestedText,{value:n,suggestedText:l,focused:h}=this.props,u=this.input,c=e!==n||l!==s,r=c&&e.startsWith(n)&&!(s&&l&&s.endsWith(l)),p=d.getActiveElement(document);h&&u&&p!==u&&u.focus(),l&&c&&!r&&u&&u.setSelectionRange(n.length-l.length,n.length)}render(){const{expanded:t=!1,disabled:e,role:s="listbox",render:n}=this.props,l=a.createElement("input",{autoComplete:"off",id:this.props.id,type:"text",key:"searchbar",size:this.props.size,placeholder:this.props.placeholder,className:"k-input-inner",tabIndex:this.props.tabIndex,accessKey:this.props.accessKey,role:s,name:this.props.name,value:this.props.value,onChange:this.props.onChange,ref:h=>this._input=h,onKeyDown:this.props.onKeyDown,onFocus:this.props.onFocus,onBlur:this.props.onBlur,onClick:this.props.onClick,"aria-disabled":e||void 0,disabled:e||void 0,readOnly:this.props.readOnly||void 0,title:this.props.title,"aria-haspopup":"listbox","aria-expanded":t,"aria-owns":this.props.owns,"aria-activedescendant":t?this.props.activedescendant:void 0,"aria-describedby":this.props.ariaDescribedBy,"aria-labelledby":this.props.ariaLabelledBy,"aria-required":this.props.ariaRequired});return n?n.call(void 0,l):l}}class et extends a.Component{constructor(){super(...arguments),this.onMouseDown=t=>t.preventDefault()}render(){const t=xe.provideLocalizationService(this).toLanguageString(Ze,ne[Ze]);return a.createElement("span",{className:"k-clear-value",role:"button",onClick:this.props.onClick,onMouseDown:this.onMouseDown,tabIndex:-1,title:t,key:"clearbutton"},a.createElement(d.IconWrap,{name:"x",icon:Ie.xIcon}))}}xe.registerForLocalization(et);const Me=d.useCustomComponent,Bs="Please enter a valid value!",{sizeMap:vt,roundedMap:Ls}=d.kendoThemeMaps,mt=class extends a.Component{constructor(i){super(i),this.state={},this.base=new ae(this),this._element=null,this._suggested="",this._skipBlur=!1,this._input=null,this._adaptiveFilterInput=null,this.itemHeight=0,this.focus=()=>{this._input&&this._input.focus()},this.handleItemSelect=(t,e)=>{const{data:s=[],virtual:n,dataItemKey:l}=this.props,h=n?n.skip:0,u=s[t-h],c=!L(u,this.value,l);this.triggerOnChange(u,e),this.state.text!==void 0&&(e.data.text=void 0),c&&this.base.triggerPageChangeCornerItems(u,e)},this.onPopupOpened=()=>{setTimeout(()=>{this.mobileMode&&this._adaptiveFilterInput&&(this._skipBlur=!0,this._adaptiveFilterInput.focus(),this._skipBlur=!1)},300)},this.componentRef=t=>{this._element=t,this.base.wrapper=t},this.toggleBtnClick=t=>{const{data:e=[],skipDisabledItems:s,textField:n}=this.props,l=this.getFocusedIndex(),h=this.getCurrentValueDisabledStatus(n,e,l),u=this.props.opened!==void 0?this.props.opened:this.state.opened,c=this.base.initState();if(c.syntheticEvent=t,!s&&n&&h&&this.clearValueOnToggleBtnClick(t),this.base.togglePopup(c),!u&&this.mobileMode){const r=this.props.adaptiveFilter!==void 0?this.props.adaptiveFilter:this.state.text||null;this.base.filterChanged(r,c)}this.applyState(c)},this.renderMobileListFilter=()=>{const t=this.props.adaptiveFilter!==void 0?this.props.adaptiveFilter:this.state.text,e=z(this.value,this.props.textField),s=Y(t)?t:e;return a.createElement(Ke,{value:s,ref:n=>this._adaptiveFilterInput=n&&n.element,onChange:this.handleMobileFilterChange,onKeyDown:this.onInputKeyDown,size:this.props.size,rounded:this.props.rounded,fillMode:this.props.fillMode})},this.handleMobileFilterChange=t=>{const e=this.base.initState();e.syntheticEvent=t.syntheticEvent,e.data.text=t.target.value,this.base.filterChanged(t.target.value,e),this.applyState(e)},this.onScroll=t=>{const{vs:e,list:s}=this.base;e.scrollHandler(t);const{groupField:n}=this.props;let{data:l=[]}=this.props;if(!n||!l.length)return;const h=this.itemHeight=this.itemHeight||(e.enabled?e.itemHeight:s?s.children[0].offsetHeight:0),c=t.target.scrollTop-e.skip*h;this.props.groupMode==="modern"&&(l=this.base.getGroupedDataModernMode(l,n));let r=l[0][n];for(let p=1;p<l.length&&!(h*p>c);p++)l[p]&&l[p][n]&&(r=l[p][n]);r!==this.state.group&&(this.setState({group:r}),this.props.onGroupScroll&&this.props.onGroupScroll.call(void 0,{group:r}))},this.handleItemClick=(t,e)=>{this.base.handleItemClick(t,e),this._valueDuringOnChange=void 0},this.handleBlur=t=>{if(this.state.focused&&!this._skipBlur){const e=this.base.initState(),{textField:s,data:n=[]}=this.props,l=this.getFocusedIndex(),u=!(l===-1)&&this.getCurrentValueDisabledStatus(s,n,l);e.data.focused=!1,e.events.push({type:"onBlur"}),e.syntheticEvent=t,s&&u&&this.clearValueOnBlur(t),this.applyValueOnRejectSuggestions(t.currentTarget.value,e)}},this.onInputClick=t=>{const e=this.props.opened!==void 0?this.props.opened:this.state.opened,s=this.props.adaptiveFilter!==void 0?this.props.adaptiveFilter:this.state.text||null;if(!e&&this.mobileMode){const n=this.base.initState();n.syntheticEvent=t,this.base.togglePopup(n),this.base.filterChanged(s,n),this.applyState(n)}},this.onInputKeyDown=t=>{const{data:e=[],skipDisabledItems:s,textField:n,dataItemKey:l,groupField:h}=this.props,u=this.value,c=Math.max(0,e.findIndex(C=>L(C,u,l))),r=t.keyCode,p=this.props.opened!==void 0?this.props.opened:this.state.opened,f=this.base.initState();if(f.syntheticEvent=t,!t.altKey&&(r===d.Keys.up||r===d.Keys.down)){if(t.preventDefault(),h!==""&&n)if(!this.props.skipDisabledItems&&p)this.onNavigate(f,r);else{let C=0;if(r===d.Keys.down||r===d.Keys.right){const w=e.slice(c+1).find(D=>!D.disabled&&D[n]);C=w&&e.findIndex(D=>D[n]===w[n])}else if(r===d.Keys.up||r===d.Keys.left){let w;if(c===0)w=e,C=e.findIndex(D=>!D.disabled&&D[n]);else{w=e.slice(0,c);let D=w.pop();for(;D&&D.disabled;)D=w.pop();C=D&&e.findIndex(_=>_[n]===D[n])}}if(C!==void 0){const w=C-c;this.onNavigate(f,r,w)}else C===void 0&&e.findIndex(w=>w[n]===u[n])===e.length-1&&this.onNavigate(f,r)}else if(!this.props.skipDisabledItems&&p)this.onNavigate(f,r);else{let C=null;if(r===d.Keys.down||r===d.Keys.right)C=e.slice(c+1).find(w=>!w.disabled);else if(r===d.Keys.up||r===d.Keys.left){const w=e.slice(0,c);for(C=w.pop();C&&C.disabled;)C=w.pop()}if(C){const w=C.id-c-1;this.onNavigate(f,r,w)}else this.onNavigate(f,r)}this.applyState(f)}const g=()=>{t.preventDefault(),this.base.togglePopup(f),this.applyState(f)},v=this.getFocusedIndex(),m=v===-1,b=!m&&this.getCurrentValueDisabledStatus(n,e,v);p?r===d.Keys.pageUp?this.base.scrollPopupByPageSize(-1):r===d.Keys.pageDown?this.base.scrollPopupByPageSize(1):t.altKey&&r===d.Keys.up?g():r===d.Keys.enter?(t.preventDefault(),(n&&!m&&t.currentTarget.value?e[v][n]:void 0)?!s&&n&&b?this.clearValueOnEnterOrEsc(t):b||this.applyValueOnEnter(t.currentTarget.value,f):this.applyValueOnEnter(t.currentTarget.value,f)):r===d.Keys.esc&&(!s&&n&&b&&this.clearValueOnEnterOrEsc(t),this.applyValueOnRejectSuggestions(t.currentTarget.value,f)):!p&&r===d.Keys.esc?this.clearValueOnEnterOrEsc(t):t.altKey&&r===d.Keys.down&&g()},this.inputOnChange=t=>{const e=this.base.initState();e.syntheticEvent=t;const s=this.props.opened!==void 0?this.props.opened:this.state.opened,n=t.currentTarget,l=n.value;if(this.props.suggest){const h=n.selectionEnd===l.length;let u=this.props.filter!==void 0?this.props.filter:this.state.text;Y(u)||(u=z(this.value,this.props.textField)||"");const c=u&&u===l,r=u&&u.length>l.length;c||r||!h?this._suggested="":this.suggestValue(l)}this.props.filter===void 0&&(e.data.text=l),this.state.focusedItem!==void 0&&(e.data.focusedItem=void 0),s||this.base.togglePopup(e),this.base.filterChanged(l,e),this.applyState(e),this.setState({group:void 0})},this.clearButtonClick=t=>{const e=this.base.initState();e.syntheticEvent=t,t.stopPropagation(),this.clearValue()},this.clearValueOnEnterOrEsc=t=>{const e=this.base.initState();e.syntheticEvent=t,t.stopPropagation(),this.clearValue()},this.clearValueOnBlur=t=>{const e=this.base.initState();e.syntheticEvent=t,t.stopPropagation(),this.clearValue()},this.clearValueOnToggleBtnClick=t=>{const e=this.base.initState();e.syntheticEvent=t,t.stopPropagation(),this.clearValue()},this.setValidity=()=>{this._input&&this._input.setCustomValidity&&this._input.setCustomValidity(this.validity.valid?"":this.props.validationMessage||Bs)},d.validatePackage(qe)}get _inputId(){return this.props.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<=ke&&this.props.adaptive)}get value(){if(this._valueDuringOnChange!==void 0)return this._valueDuringOnChange;if(this.props.value!==void 0)return this.props.value;if(this.state.value!==void 0)return this.state.value;if(this.props.defaultValue!==void 0)return this.props.defaultValue}get index(){const{data:i=[],dataItemKey:t}=this.props,e=this.value;return i.findIndex(s=>L(s,e,t))}get name(){return this.props.name}get validity(){const i=this.props.validationMessage!==void 0,t=!this.required||this.value!==null&&this.value!==""&&this.value!==void 0,e=this.props.valid!==void 0?this.props.valid:t;return{customError:i,valid:e,valueMissing:this.value===null}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:mt.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:mt.defaultProps.required}componentDidUpdate(i,t){var g;const{dataItemKey:e,virtual:s,groupField:n="",data:l=[],textField:h}=this.props,u=i.virtual?i.virtual.total:0,c=this.props.opened!==void 0?this.props.opened:this.state.opened,r=i.opened!==void 0?i.opened:t.opened,p=!r&&c,f=this.value;if(this._valueOnDidUpdate=f,s&&s.total!==u)this.base.vs.calcScrollElementHeight(),this.base.vs.reset();else{const v=i.value!==void 0?i.value:t.value;let m=l.findIndex(C=>L(C,f,e));this.props.groupMode==="modern"&&h&&f&&(m=(g=this.base.getGroupedDataModernMode(l,n))==null?void 0:g.map(C=>C[h]).indexOf(f[h]));const b=!L(v,f,e);p&&s?this.base.scrollToVirtualItem(s,m):p&&!s?(this.onPopupOpened(),l&&l.length!==0&&this.base.resetGroupStickyHeader(l[0][n],this),this.base.scrollToItem(m)):c&&r&&f&&b&&this.base.scrollToItem(m)}p&&this._input&&this._input.focus(),this.setValidity()}componentDidMount(){var i;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.base.didMount(),this.setValidity(),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentWillUnmount(){var i;(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.disconnect()}render(){const i=xe.provideLocalizationService(this).toLanguageString(Mt,ne[Mt]),t=xe.provideLocalizationService(this).toLanguageString(Nt,ne[Nt]),{dir:e,disabled:s,clearButton:n=mt.defaultProps.clearButton,label:l,textField:h,adaptive:u,className:c,style:r,loading:p,iconClassName:f,virtual:g,size:v,rounded:m,fillMode:b,opened:C=this.state.opened,placeholder:w}=this.props,{windowWidth:D=0}=this.state,_=!this.validityStyles||this.validity.valid,O=this.props.filter!==void 0?this.props.filter:this.state.text,B=z(this.value,h),E=Y(O)?O:B,K=n&&(!!E||Y(this.value)),k=this.base.vs,N=this.props.id||this._inputId,q=D<=ke&&u;k.enabled=g!==void 0,g!==void 0&&(k.skip=g.skip,k.total=g.total,k.pageSize=g.pageSize);const[X,J]=Me(this.props.prefix||a.Fragment),[Q,T]=Me(this.props.suffix||a.Fragment),me=a.createElement(a.Fragment,null,a.createElement("span",{className:d.classNames("k-combobox k-input",{[`k-input-${vt[v]||v}`]:v,[`k-rounded-${Ls[m]||m}`]:m,[`k-input-${b}`]:b,"k-invalid":!_,"k-loading":p,"k-required":this.required,"k-disabled":s},c),ref:this.componentRef,style:l?{...r,width:void 0}:r,dir:e},this.props.prefix&&a.createElement(X,{...J}),this.renderSearchBar(E||"",N,w),K&&!p&&a.createElement(et,{onClick:this.clearButtonClick,key:"clearbutton"}),p&&a.createElement(d.IconWrap,{className:"k-input-loading-icon",name:"loading",key:"loading"}),this.props.suffix&&a.createElement(Q,{...T}),a.createElement(Ce.Button,{tabIndex:-1,type:"button","aria-label":C?t:i,icon:f?void 0:"caret-alt-down",svgIcon:f?this.props.svgIcon:Ie.caretAltDownIcon,iconClass:f,size:v,fillMode:b,rounded:null,themeColor:"base",className:"k-input-button",onClick:this.toggleBtnClick,onMouseDown:R=>R.preventDefault()}),!q&&this.renderListContainer()),q&&this.renderAdaptiveListContainer());return l?a.createElement(Ae.FloatingLabel,{label:l,editorId:N,editorValue:E,editorValid:_,editorDisabled:s,style:{width:r?r.width:void 0},children:me}):me}onNavigate(i,t,e){const{data:s=[],virtual:n={skip:0}}=this.props,l=this.props.filter?this.props.filter:this.state.text,h=this.getFocusedIndex(),u=this.base.vs,c=this.value;if(this._suggested="",h!==-1&&!Y(c))this.handleItemSelect(h,i);else if(l==="")this.handleItemSelect(0,i);else{const r=n.skip+h,p=this.base.navigation.navigate({keyCode:t,current:r,max:(u.enabled?u.total:s.length)-1,min:0,skipItems:e||void 0});p!==void 0&&this.handleItemSelect(p,i)}}getCurrentValueDisabledStatus(i,t,e){return i&&t&&t[e]&&t[e].disabled}applyValueOnEnter(i,t){const{data:e=[],textField:s,allowCustom:n}=this.props,l=this.props.opened!==void 0?this.props.opened:this.state.opened,u=z(this.value,s)===i?this.index:Kt(e,i,s),c=u!==-1;let r;if(this._suggested="",c)r=e[u];else if(n)r=s!==void 0?{[s]:i}:i;else return this.selectFocusedItem(i,t);this.triggerOnChange(r,t),l&&this.base.togglePopup(t),this.props.filter===void 0&&this.state.text!==void 0&&(t.data.text=void 0),this.applyState(t)}applyValueOnRejectSuggestions(i,t){const{data:e=[],textField:s,allowCustom:n}=this.props,l=this.props.opened!==void 0?this.props.opened:this.state.opened,h=z(this.value,s),u=this.state.windowWidth&&this.state.windowWidth<=ke;if(this._suggested="",i===h||i===""&&!Y(h))return l&&!u&&this.base.togglePopup(t),this.applyState(t);const c=Kt(e,i,s,!0),r=c!==-1;let p=null;r?p=e[c]:n&&(p=i?s?{[s]:i}:i:null),this.triggerOnChange(p,t),this.state.text!==void 0&&(t.data.text=void 0,this.base.filterChanged("",t)),l&&!u&&this.base.togglePopup(t),this.applyState(t)}selectFocusedItem(i,t){const e=this.props.opened!==void 0?this.props.opened:this.state.opened,{data:s=[],textField:n,virtual:l={skip:0},focusedItemIndex:h=_e}=this.props,u=l.skip,c=i===""&&u===0?0:h(s,i,n);return c!==-1?this.handleItemSelect(c+u,t):(this.triggerOnChange(null,t),this.state.text!==void 0&&(t.data.text=void 0)),e&&this.base.togglePopup(t),this.applyState(t)}renderAdaptiveListContainer(){const{windowWidth:i=0}=this.state,{header:t,footer:e,size:s,data:n=[],groupField:l,groupMode:h,list:u,virtual:c,adaptiveTitle:r,groupStickyHeaderItemRender:p}=this.props,f=this.props.opened!==void 0?this.props.opened:this.state.opened;let{group:g}=this.state;g===void 0&&l!==void 0&&(g=z(n[0],l));const v={navigatable:!1,navigatableElements:[],expand:f,animation:!0,onClose:m=>this.toggleBtnClick(m),animationStyles:i<=ft?{top:0,width:"100%",height:"100%"}:void 0,className:i<=ft?"k-adaptive-actionsheet k-actionsheet-fullscreen":"k-adaptive-actionsheet k-actionsheet-bottom"};return a.createElement(fe.ActionSheet,{...v},a.createElement(fe.ActionSheetHeader,{className:"k-text-center"},a.createElement("div",{className:"k-actionsheet-titlebar-group k-hbox"},a.createElement("div",{className:"k-actionsheet-title"},a.createElement("div",null,r)),a.createElement("div",{className:"k-actionsheet-actions"},a.createElement(Ce.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",onClick:this.toggleBtnClick,icon:"x",svgIcon:Ie.xIcon}))),a.createElement("div",{className:"k-actionsheet-titlebar-group k-actionsheet-filter"},this.renderMobileListFilter())),a.createElement(fe.ActionSheetContent,{className:"!k-overflow-hidden"},a.createElement("div",{className:"k-list-container"},a.createElement("div",{className:d.classNames({"k-list":!u,"k-list-lg":!0,"k-virtual-list":c,"k-data-table":u,[`k-table-${vt[s]||s}`]:u&&s})},t&&a.createElement("div",{className:"k-table-header"},t),!u&&g&&n.length!==0&&a.createElement(We,{group:g,groupMode:h,render:p}),this.renderList(),e&&a.createElement("div",{className:"k-list-footer"},e)))))}renderListContainer(){const i=this.base,{dir:t,header:e,footer:s,data:n=[],groupField:l,groupMode:h,size:u,list:c,virtual:r,groupStickyHeaderItemRender:p}=this.props,f=this.props.opened!==void 0?this.props.opened:this.state.opened,g=i.getPopupSettings(),v=g.width!==void 0?g.width:i.popupWidth;let{group:m}=this.state;return m===void 0&&l!==void 0&&(m=z(n[0],l)),a.createElement(Xe,{width:v,popupSettings:{animate:g.animate,anchor:this.element,show:f,popupClass:d.classNames(g.popupClass,"k-list-container","k-combobox-popup"),className:g.className,appendTo:g.appendTo},dir:t!==void 0?t:this.base.dirCalculated,itemsCount:[n.length]},a.createElement("div",{className:d.classNames({"k-list":!c,[`k-list-${vt[u]||u}`]:!c&&u,"k-virtual-list":r,"k-data-table":c,[`k-table-${vt[u]||u}`]:c&&u})},e&&a.createElement("div",{className:"k-table-header"},e),!c&&m&&n.length!==0&&a.createElement(We,{group:m,groupMode:h,render:p}),this.renderList(),s&&a.createElement("div",{className:d.classNames({"k-list-footer":!this.props.footerClassName},this.props.footerClassName)},s)))}renderList(){const i=this.base,{textField:t,dataItemKey:e,listNoDataRender:s,itemRender:n,groupHeaderItemRender:l,data:h=[],virtual:u={skip:0,total:void 0}}=this.props,c=i.getPopupSettings(),r=i.vs,p=u.skip,f=this.props.opened!==void 0?this.props.opened:this.state.opened,g=`translateY(${r.translate}px)`,v=f?this.getFocusedIndex():void 0,m=this.props.filter!==void 0?this.props.filter:this.state.text,b=z(this.value,t),C=Y(m)&&m!==b?null:this.value,w=this.props.list||Ve;return a.createElement(w,{id:i.listBoxId,virtual:!!u,show:f,data:h,focusedIndex:v,value:C,textField:t,valueField:e,groupField:this.props.groupField,groupMode:this.props.groupMode,isMultiColumn:this.props.isMultiColumn,optionsGuid:i.guid,listRef:D=>{r.list=this.base.list=D,this.itemHeight=0},wrapperStyle:this.state.windowWidth&&this.state.windowWidth>ke?{maxHeight:c.height}:{},wrapperCssClass:d.classNames("k-list-content",{"k-list-scroller":!u}),listStyle:r.enabled?{transform:g}:void 0,key:"listkey",skip:p,onClick:this.handleItemClick,itemRender:n,groupHeaderItemRender:l,noDataRender:s,onMouseDown:D=>D.preventDefault(),onScroll:this.onScroll,wrapperRef:r.scrollerRef,scroller:this.base.renderScrollElement(),ariaSetSize:u.total})}renderSearchBar(i,t,e){const{tabIndex:s,disabled:n,data:l=[],dataItemKey:h,virtual:u={skip:0}}=this.props,c=this.props.opened!==void 0?this.props.opened:this.state.opened,r=this.value,p=Math.max(0,l.findIndex(f=>L(f,r,h)));return this._suggested&&!L(this._valueOnDidUpdate,r,h)&&(this._suggested=""),a.createElement(gt,{id:t,readOnly:c&&this.mobileMode,placeholder:e,tabIndex:s,title:this.props.title,accessKey:this.props.accessKey,value:i+this._suggested,suggestedText:this._suggested,ref:f=>this._input=f&&f.input,onClick:this.onInputClick,onKeyDown:this.onInputKeyDown,onChange:this.inputOnChange,onFocus:this.base.handleFocus,onBlur:this.handleBlur,disabled:n,expanded:c,owns:this.base.listBoxId,activedescendant:`option-${this.base.guid}-${p+u.skip}`,role:"combobox",ariaLabelledBy:this.props.ariaLabelledBy,ariaDescribedBy:this.props.ariaDescribedBy,ariaRequired:this.required,render:this.props.valueRender})}clearValue(){const i=this.base.initState();this._suggested="",this.base.filterChanged("",i),this.props.filter===void 0&&this.state.text!==void 0&&(i.data.text=void 0),this.triggerOnChange(null,i);const t=this.props.opened!==void 0?this.props.opened:this.state.opened,e=this.mobileMode;t&&!e&&this.base.togglePopup(i),this.applyState(i)}triggerOnChange(i,t){const e=this.value;!Y(e)&&!Y(i)||L(e,i,this.props.dataItemKey)||(this.props.value===void 0&&(t.data.value=i),this._valueDuringOnChange=i,t.events.push({type:"onChange"}))}getFocusedIndex(){const i=this.value,{data:t=[],textField:e,dataItemKey:s,virtual:n={skip:0},focusedItemIndex:l=_e,skipDisabledItems:h}=this.props,u=this.props.filter?this.props.filter:this.state.text;return Y(i)&&u===void 0?t.findIndex(c=>L(c,i,s)):u?l(t,u,e):h&&e&&!u&&n.skip===0?t.findIndex(c=>!c.disabled&&c[e]):n.skip===0?0:-1}suggestValue(i){const{data:t,textField:e}=this.props;this._suggested=Cs(i,t,e)}applyState(i){this.base.applyState(i),this._valueDuringOnChange=void 0}calculateMedia(i){for(const t of i)this.setState({windowWidth:t.target.clientWidth})}};let Te=mt;Te.displayName="ComboBox",Te.propTypes={...ae.propTypes,size:o.oneOf([null,"small","medium","large"]),rounded:o.oneOf([null,"small","medium","large","full"]),fillMode:o.oneOf([null,"solid","flat","outline"]),dataItemKey:o.string,groupField:o.string,groupMode:o.oneOf([void 0,"classic","modern"]),isMultiColumn:o.bool,suggest:o.bool,placeholder:o.string,title:o.string,allowCustom:o.bool,clearButton:o.bool,iconClassName:o.string,svgIcon:d.svgIconPropType,validationMessage:o.string,required:o.bool,id:o.string,ariaLabelledBy:o.string,ariaDescribedBy:o.string,list:o.any,valueRender:o.func,skipDisabledItems:o.bool},Te.defaultProps={...ae.defaultProps,size:"medium",rounded:"medium",fillMode:"solid",allowCustom:!1,clearButton:!0,required:!1,groupMode:"modern",isMultiColumn:!1,skipDisabledItems:!0,prefix:void 0,suffix:void 0};const ts=d.createPropsContext(),Lt=d.withIdHOC(d.withPropsContext(ts,Te));Lt.displayName="KendoReactComboBox";const zs="Please enter a valid value!",{sizeMap:ss,roundedMap:Hs}=d.kendoThemeMaps,zt=class extends a.Component{constructor(i){super(i),this.state={},this.base=new ae(this),this._element=null,this._suggested="",this._input=null,this._isScrolling=!1,this.itemHeight=0,this.focus=()=>{this._input&&this._input.focus()},this.handleItemSelect=(t,e)=>{const{data:s=[]}=this.props,n=z(s[t],this.props.textField);this.triggerOnChange(n,e)},this.itemFocus=(t,e)=>{const{data:s=[],textField:n}=this.props,l=s[t];L(this.state.focusedItem,l,n)||(e.data.focusedItem=l)},this.togglePopup=t=>{this.base.togglePopup(t)},this.setValidity=()=>{this._input&&this._input.setCustomValidity&&this._input.setCustomValidity(this.validity.valid?"":this.props.validationMessage||zs)},this.onScroll=t=>{this._isScrolling=!0;const{list:e}=this.base,{groupField:s}=this.props;let{data:n=[]}=this.props;if(!s||!n.length)return;const l=this.itemHeight||(e?e.children[0].offsetHeight:0),u=t.target.scrollTop;s&&(n=this.base.getGroupedDataModernMode(n,s));let c=n[0][s];for(let r=1;r<n.length&&!(l*r>u);r++)n[r]&&n[r][s]&&(c=n[r][s]);c!==this.state.group&&this.setState({group:c})},this.handleItemClick=(t,e)=>{this.base.handleItemClick(t,e),this._valueDuringOnChange=void 0},this.onChangeHandler=t=>{const s=this.base.initState(),n=t.currentTarget,l=n.value,h=n.selectionEnd===l.length;s.syntheticEvent=t;const u=this._suggested,c=this.value,r=c&&c.substring(0,c.length-u.length),p=r&&r===l,f=r&&r.length>l.length,{suggest:g}=this.props,v=this.props.opened!==void 0?this.props.opened:this.state.opened;if(g!==void 0&&g!==!1){p||f||!h?this._suggested="":this.suggestValue(l);const m=l+this._suggested,b={userInput:l,value:this._suggested};this.triggerOnChange(m,s,{suggestion:b})}else this._suggested="",this.triggerOnChange(l,s);(!v&&l||v&&!l)&&this.togglePopup(s),s.data.focusedItem=void 0,this.applyState(s),this.setState({group:void 0})},this.clearButtonClick=t=>{const s=this.base.initState(),n=this.props.opened!==void 0?this.props.opened:this.state.opened;s.syntheticEvent=t;const l="";this._suggested="",this.triggerOnChange(l,s),this.state.focusedItem!==void 0&&(s.data.focusedItem=void 0),n&&this.togglePopup(s),this.applyState(s)},this.onInputKeyDown=t=>{const{data:e=[],skipDisabledItems:s,groupField:n,textField:l}=this.props;this._isScrolling&&(this._isScrolling=!1);const h=this.focusedIndex(),u=e[h],c=t.keyCode,r=t.altKey,p=this.props.opened!==void 0?this.props.opened:this.state.opened,f=this.base.initState();f.syntheticEvent=t;const g=()=>{p&&t.preventDefault()};if(r&&c===d.Keys.down)this.setState({opened:!0});else if(r&&c===d.Keys.up)this.setState({opened:!1});else if(p&&c===d.Keys.pageUp)this.base.scrollPopupByPageSize(-1);else if(p&&c===d.Keys.pageDown)this.base.scrollPopupByPageSize(1);else if(p&&(c===d.Keys.enter||c===d.Keys.esc))g(),s===!1&&u&&u.disabled?(p&&this.togglePopup(f),this.applyState(f)):this.applyInputValue(t.currentTarget.value,f,t.keyCode);else if(!p&&c===d.Keys.esc){const v="";this._suggested="",this.triggerOnChange(v,f),this.state.focusedItem!==void 0&&(f.data.focusedItem=void 0),this.applyState(f)}else if(c===d.Keys.up||c===d.Keys.down){if(n!==""&&l)if(!this.props.skipDisabledItems&&p)this.onNavigate(f,c);else{let v=0;if(c===d.Keys.down||c===d.Keys.right){const m=e.slice(h+1).find(b=>!b.disabled&&b[l]);v=m&&e.findIndex(b=>b[l]===m[l])}else if(c===d.Keys.up||c===d.Keys.left){let m;if(h===-1)m=e,v=e.findIndex(b=>!b.disabled&&b[l]);else{m=e.slice(0,h);let b=m.pop();for(;b&&b.disabled;)b=m.pop();v=b&&e.findIndex(C=>C[l]===b[l])}}if(v!==void 0){const m=v-h;this.onNavigate(f,c,m)}else v===void 0&&e.findIndex(m=>m[l])===e.length-1&&this.onNavigate(f,c)}else if(!this.props.skipDisabledItems&&p)this.onNavigate(f,c);else{let v=null;if(c===d.Keys.down||c===d.Keys.right)v=e.slice(h+1).find(m=>!m.disabled);else if(c===d.Keys.up||c===d.Keys.left){const m=e.slice(0,h);for(v=m.pop();v&&v.disabled;)v=m.pop()}if(v){const m=v.id-h-1;this.onNavigate(f,c,m)}else this.onNavigate(f,c)}this.applyState(f),g()}},this.handleBlur=t=>{if(this.state.focused){const e=this.base.initState();e.data.focused=!1,e.events.push({type:"onBlur"}),e.syntheticEvent=t,this.applyInputValue(t.currentTarget.value,e)}},d.validatePackage(qe)}get _inputId(){return this.props.id+"-accessibility-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!==void 0?this.state.value:this.props.defaultValue!==void 0?this.props.defaultValue:""}get name(){return this.props.name}get validity(){const i=this.props.validationMessage!==void 0,t=!this.required||this.value!=="",e=this.props.valid!==void 0?this.props.valid:t;return{customError:i,valid:e,valueMissing:this.value===null}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:zt.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:zt.defaultProps.required}componentDidUpdate(i,t){var g;const{groupField:e="",data:s=[]}=this.props,{data:n=[]}=i,l=this.focusedIndex(),h=s[l],u=n!==s,c=h!==void 0&&t.focusedItem!==h,r=this.props.opened!==void 0?this.props.opened:this.state.opened,p=i.opened!==void 0?i.opened:t.opened,f=!p&&r;if(e==="")(r&&(c||u)||f)&&this.base.scrollToItem(l);else if(!this._isScrolling){let v=(g=this.base.getGroupedDataModernMode(s,e))==null?void 0:g.indexOf(h);f&&(s&&s.length!==0&&this.base.resetGroupStickyHeader(s[0][e],this),this.base.scrollToItem(v)),r&&p&&c&&this.base.scrollToItem(v)}this.setValidity()}componentDidMount(){this.base.didMount(),this.setValidity()}render(){const{dir:i,disabled:t,label:e,className:s,style:n,loading:l,suggest:h,size:u,rounded:c,fillMode:r}=this.props,p=!this.validityStyles||this.validity.valid,f=this.base,g=this.value,v=this.props.clearButton!==!1&&!l&&!!g,m=this.props.id||this._inputId;typeof h=="string"&&(this._suggested=h);const[b,C]=Me(this.props.prefix||a.Fragment),[w,D]=Me(this.props.suffix||a.Fragment),_=a.createElement("span",{className:d.classNames("k-autocomplete k-input",s,{[`k-input-${ss[u]||u}`]:u,[`k-rounded-${Hs[c]||c}`]:c,[`k-input-${r}`]:r,"k-invalid":!p,"k-loading":l,"k-required":this.required,"k-disabled":t}),ref:O=>{this._element=O,f.wrapper=O},style:e?{...n,width:void 0}:n,dir:i},this.props.prefix&&a.createElement(b,{...C}),this.renderSearchBar(g||"",m),l&&a.createElement(d.IconWrap,{className:"k-input-loading-icon",name:"loading"}),v&&!l&&a.createElement(et,{onClick:this.clearButtonClick,key:"clearbutton"}),this.props.suffix&&a.createElement(w,{...D}),this.renderListContainer());return e?a.createElement(Ae.FloatingLabel,{label:e,editorId:m,editorValue:g,editorValid:p,editorDisabled:t,style:{width:n?n.width:void 0},children:_}):_}onNavigate(i,t,e){const s=this.value,{data:n=[],textField:l,focusedItemIndex:h}=this.props,u=this.state.focusedItem!==void 0?n.findIndex(r=>L(r,this.state.focusedItem,l)):h?h(n,s,l):n.indexOf(Zt(n,s,l)),c=this.base.navigation.navigate({keyCode:t,current:u,max:n.length-1,min:0,skipItems:e||void 0});c!==void 0&&this.itemFocus(c,i),this.applyState(i)}applyInputValue(i,t,e){const s=this.props.opened!==void 0?this.props.opened:this.state.opened,{data:n=[],textField:l}=this.props,h=this.focusedIndex(),u=n[h];if(this._suggested="",s&&e===d.Keys.enter&&u&&!u.disabled){const c=z(n[this.focusedIndex(i)],l);this.triggerOnChange(c,t)}s&&this.togglePopup(t),this.applyState(t)}renderSearchBar(i,t){const e=this.base,{placeholder:s,tabIndex:n,disabled:l,readonly:h}=this.props,{focused:u}=this.state,c=this.props.opened!==void 0?this.props.opened:this.state.opened;return a.createElement(gt,{id:t,placeholder:s,tabIndex:n,accessKey:this.props.accessKey,value:i,suggestedText:this._suggested,focused:u,name:this.props.name,ref:r=>this._input=r&&r.input,onKeyDown:this.onInputKeyDown,onChange:this.onChangeHandler,onFocus:e.handleFocus,onBlur:this.handleBlur,disabled:l,readOnly:h,expanded:c,owns:e.listBoxId,activedescendant:"option-"+e.guid+"-"+this.focusedIndex(),role:"combobox",ariaLabelledBy:this.props.ariaLabelledBy,ariaDescribedBy:this.props.ariaDescribedBy,ariaRequired:this.required,render:this.props.valueRender})}renderListContainer(){const i=this.base,{dir:t,header:e,footer:s,data:n=[],size:l,groupField:h,list:u,groupStickyHeaderItemRender:c}=this.props,r=i.getPopupSettings(),p=this.props.opened!==void 0?this.props.opened:this.state.opened,f=r.width!==void 0?r.width:i.popupWidth;let{group:g}=this.state;return g===void 0&&h!==void 0&&(g=z(n[0],h)),a.createElement(Xe,{width:f,popupSettings:{animate:r.animate,anchor:this.element,show:p,popupClass:d.classNames(r.popupClass,"k-list-container","k-autocomplete-popup"),className:r.className,appendTo:r.appendTo},dir:t!==void 0?t:this.base.dirCalculated,itemsCount:[n.length]},e&&a.createElement("div",{className:"k-list-header"},e),a.createElement("div",{className:d.classNames("k-list",{[`k-list-${ss[l]||l}`]:l})},!u&&g&&n.length!==0&&a.createElement(We,{group:g,groupMode:"modern",render:c}),this.renderList()),s&&a.createElement("div",{className:"k-list-footer"},s))}renderList(){const i=this.base,t=i.getPopupSettings(),{textField:e,data:s=[],listNoDataRender:n,itemRender:l,groupHeaderItemRender:h}=this.props,u=this.value,c=this.props.opened!==void 0?this.props.opened:this.state.opened;return a.createElement(Ve,{id:i.listBoxId,show:c,data:s.slice(),focusedIndex:this.focusedIndex(),value:u,textField:e,valueField:e,highlightSelected:!1,optionsGuid:i.guid,groupField:this.props.groupField,groupMode:"modern",listRef:r=>i.list=r,wrapperStyle:{maxHeight:t.height},wrapperCssClass:"k-list-content",onClick:this.handleItemClick,itemRender:l,groupHeaderItemRender:h,noDataRender:n,onMouseDown:r=>r.preventDefault(),onScroll:this.onScroll})}triggerOnChange(i,t,e){this.value===i&&!e||(t.data.value=i,this._valueDuringOnChange=i,t.events.push({type:"onChange",...e||{}}))}applyState(i){this.base.applyState(i),this._valueDuringOnChange=void 0}suggestValue(i){if(this._suggested="",i){const{data:t=[],textField:e}=this.props,s=t[_e(t,i,e)];if(s){const n=z(s,e);i.toLowerCase()!==n.toLowerCase()&&(this._suggested=n.substring(i.length))}}}focusedIndex(i){const{data:t=[],textField:e,focusedItemIndex:s,skipDisabledItems:n}=this.props,l=i!==void 0?i:this.value;if(this.state.focusedItem!==void 0)return t.findIndex(h=>L(h,this.state.focusedItem,e));if(s)return s(t,l,e);{const h=t.indexOf(Zt(t,l,e));return n&&e&&h===-1?t.findIndex(u=>!u.disabled&&u[e]):Math.max(0,h)}}};let tt=zt;tt.displayName="AutoComplete",tt.propTypes={...ae.basicPropTypes,size:o.oneOf([null,"small","medium","large"]),rounded:o.oneOf([null,"small","medium","large","full"]),fillMode:o.oneOf([null,"solid","flat","outline"]),groupField:o.string,suggest:o.oneOfType([o.bool,o.string]),placeholder:o.string,value:o.string,defaultValue:o.string,validationMessage:o.string,required:o.bool,readonly:o.bool,clearButton:o.bool,valueRender:o.func,id:o.string,ariaLabelledBy:o.string,ariaDescribedBy:o.string,list:o.any,skipDisabledItems:o.bool},tt.defaultProps={...ae.defaultProps,size:"medium",rounded:"medium",fillMode:"solid",skipDisabledItems:!0,prefix:void 0,suffix:void 0};const is=d.createPropsContext(),ns=d.withIdHOC(d.withPropsContext(is,tt));ns.displayName="KendoReactAutoComplete";const As=i=>i.syntheticEvent.preventDefault(),Ws=i=>i.syntheticEvent.stopPropagation();class Ht extends a.Component{render(){const{data:t,guid:e,focused:s,tagRender:n,tag:l,onTagDelete:h,size:u}=this.props;return a.createElement(a.Fragment,null,t.map((c,r)=>{const p=l?a.createElement(l,{key:c.text+r,tagData:c,guid:e,focusedTag:s,onTagDelete:h}):a.createElement(Ce.Chip,{id:`tag-${e}-${c.text.replace(/\s+/g,"-")}`,"aria-selected":!0,role:"option","aria-setsize":t.length,key:c.text+r,text:c.text,removable:!0,onRemove:f=>h.call(void 0,c.data,f.syntheticEvent),onMouseDown:As,onClick:Ws,className:c===s?"k-focus":void 0,size:u});return n?n(c,p):p}),this.props.children)}}var st=(i=>(i[i.PopupList=0]="PopupList",i[i.TagsList=1]="TagsList",i))(st||{});const as=500,At=i=>{const{footer:t,children:e,windowWidth:s=0,navigatable:n,navigatableElements:l,expand:h,animation:u,onClose:c,adaptiveTitle:r,mobileFilter:p}=i,f={navigatable:n||!1,navigatableElements:l||[],expand:h,animation:u!==!1,onClose:c,animationStyles:s<=as?{top:0,width:"100%",height:"100%"}:void 0,className:s<=as?"k-adaptive-actionsheet k-actionsheet-fullscreen":"k-adaptive-actionsheet k-actionsheet-bottom"};return a.createElement(fe.ActionSheet,{...f},a.createElement(fe.ActionSheetHeader,{className:"k-text-center"},a.createElement("div",{className:"k-actionsheet-titlebar-group k-hbox"},a.createElement("div",{className:"k-actionsheet-title"},a.createElement("div",null,r)),a.createElement("div",{className:"k-actionsheet-actions"},a.createElement(Ce.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",icon:"x",svgIcon:Ie.xIcon,onClick:c}))),p&&a.createElement("div",{className:"k-actionsheet-titlebar-group k-actionsheet-filter"},p)),e,t&&a.createElement(fe.ActionSheetFooter,{className:"k-actions k-actions-stretched"},a.createElement(Ce.Button,{size:"large",tabIndex:0,"aria-label":t.cancelText,"aria-disabled":"false",type:"button",onClick:t.onCancel},t.cancelText),a.createElement(Ce.Button,{tabIndex:0,themeColor:"primary",size:"large","aria-label":t.applyText,"aria-disabled":"false",type:"button",onClick:t.onApply},t.applyText)))},{sizeMap:bt,roundedMap:qs}=d.kendoThemeMaps,$s="Please enter a valid value!",ls=i=>i.preventDefault(),os=i=>i===2,Wt=class extends a.Component{constructor(i){super(i),this.state={activedescendant:st.PopupList,currentValue:[]},this._element=null,this._valueItemsDuringOnChange=null,this.base=new ae(this),this._tags=[],this._input=null,this._adaptiveInput=null,this._skipFocusEvent=!1,this._lastSelectedOrDeslectedItemIndex=null,this.itemHeight=0,this.scrollToFocused=!1,this.localization=null,this.focus=()=>{this._input&&this._input.focus()},this.handleItemSelect=(t,e)=>{const{data:s=[],dataItemKey:n,virtual:l}=this.props,h=l?l.skip:0,u=s[t-h],c=this.value.findIndex(f=>L(f,u,n));this._lastSelectedOrDeslectedItemIndex=s.findIndex(f=>L(f,u,n));let r=[];c!==-1?(r=this.value,r.splice(c,1)):r=[...this.value,u],(this.props.filter!==void 0?this.props.filter:this.state.text)&&!this.mobileMode&&(this.state.text&&(e.data.text=""),this.base.filterChanged("",e)),this._adaptiveInput&&this._adaptiveInput.blur(),this.state.focusedIndex!==void 0&&(e.data.focusedIndex=void 0),this.triggerOnChange(r,e),this.base.triggerPageChangeCornerItems(u,e)},this.onTagDelete=(t,e)=>{const s=this.base.initState();s.syntheticEvent=e,this.opened&&this.base.togglePopup(s),!this.state.focused&&!this.mobileMode&&(s.data.focused=!0,this.focus());const n=this.value;ht(n,t,this.props.dataItemKey),this.triggerOnChange(n,s),this.applyState(s)},this.itemFocus=(t,e)=>{const{data:s=[],allowCustom:n,virtual:l}=this.props,h=l?l.skip:0,u=this.props.filter!==void 0?this.props.filter:this.state.text,{focusedIndex:c}=this.getFocusedState(),r=n&&u,p=s[t-h];p&&c!==t?this.state.focusedIndex!==t&&(e.data.focusedIndex=t,e.data.activedescendant=st.PopupList):r&&t===-1&&this.state.focusedIndex!==void 0&&(e.data.focusedIndex=void 0),this.base.triggerPageChangeCornerItems(p,e)},this.componentRef=t=>{this._element=t,this.base.wrapper=t},this.searchbarRef=t=>{const e=this._input=t&&t.input;e&&this.state.focused&&window.setTimeout(()=>e.focus(),0)},this.onChangeHandler=t=>{const e=this.base.initState(),s=t.target.value;e.syntheticEvent=t,this.props.filter===void 0&&(e.data.text=s),e.data.focusedIndex=void 0,this.opened||(this.base.togglePopup(e),this.setState({currentValue:this.value})),this.base.filterChanged(s,e),this.applyState(e),this.setState({group:void 0})},this.clearButtonClick=t=>{const e=this.base.initState();e.syntheticEvent=t,t.stopPropagation(),this.value.length>0&&this.triggerOnChange([],e),this.state.focusedIndex!==void 0&&(e.data.focusedIndex=void 0),this.opened&&this.base.togglePopup(e);const s=this.props.filter!==void 0?this.props.filter:this.state.text;Y(s)&&s!==""&&this.base.filterChanged("",e),this.state.text&&(e.data.text=""),this._lastSelectedOrDeslectedItemIndex=null,this.applyState(e)},this.onInputKeyDown=t=>{const{data:e=[],textField:s,groupField:n}=this.props,l=t.keyCode,h=this.props.filter!==void 0?this.props.filter:this.state.text,u=this.props.opened!==void 0?this.props.opened:this.state.opened,{focusedItem:c,focusedIndex:r}=this.getFocusedState(),p=this.base.initState();if(p.syntheticEvent=t,!h&&this.value.length>0&&(l===d.Keys.left||l===d.Keys.right||l===d.Keys.home||l===d.Keys.end||l===d.Keys.delete||l===d.Keys.backspace)&&!t.shiftKey)return this.onTagsNavigate(t,p);const f=()=>{t.preventDefault(),this.base.togglePopup(p),this.applyState(p)};if(this.opened)if(l===d.Keys.pageUp)this.base.scrollPopupByPageSize(-1);else if(l===d.Keys.pageDown)this.base.scrollPopupByPageSize(1);else if((t.ctrlKey||t.metaKey)&&t.code==="KeyA"){const v=(this.state.value&&this.state.value.length)===e.length?[]:e;this.updateStateOnKeyboardNavigation(v,p)}else if((t.ctrlKey||t.metaKey)&&t.shiftKey&&t.keyCode===d.Keys.end){const g=e.slice(this.getFocusedState().focusedIndex);this.itemFocus(e.length-1,p),this.updateStateOnKeyboardNavigation(g,p)}else if((t.ctrlKey||t.metaKey)&&t.shiftKey&&t.keyCode===d.Keys.home){const g=e.slice(0,this.getFocusedState().focusedIndex+1);this.itemFocus(0,p),this.updateStateOnKeyboardNavigation(g,p)}else if(t.shiftKey&&t.keyCode===d.Keys.up){let g;const v=this.getLastSelectedOrDeselectedIndex(1,r);v===null?g=r!==0?e.slice(r-1,r):[e[r]]:v===r?g=[e[v-1]]:r>=0&&(g=v>r?e.slice(r-1,v):e.slice(v-1,r)),g&&g.length>0&&(r>=1&&this.itemFocus(r-1,p),this.updateStateOnKeyboardNavigation(g,p))}else if(t.shiftKey&&t.keyCode===d.Keys.down){let g;const v=this.getLastSelectedOrDeselectedIndex(0,r);v===null?g=r!==e.length-1?e.slice(r,r+1):[e[r]]:v===r?g=e.slice(r,r+2):r>=0&&(g=v>r?e.slice(r+1,v+1):e.slice(v,r+2)),g&&g.length>=1&&(this.itemFocus(r+1,p),this.updateStateOnKeyboardNavigation(g,p))}else if(t.altKey&&l===d.Keys.up)f();else if(l===d.Keys.up||l===d.Keys.down){if(n!==""&&s)if(!this.props.skipDisabledItems&&u)this.onNavigate(p,l);else{let g=0;if(l===d.Keys.down||l===d.Keys.right){const v=e.slice(r+1).find(m=>!m.disabled&&m[s]);g=v&&e.findIndex(m=>m[s]===v[s])}else if(l===d.Keys.up||l===d.Keys.left){let v;if(r===-1)v=e,g=e.findIndex(m=>!m.disabled&&m[s]);else{v=e.slice(0,r);let m=v.pop();for(;m&&m.disabled;)m=v.pop();g=m&&e.findIndex(b=>b[s]===m[s])}}if(g){const v=g-r;this.onNavigate(p,l,v)}else g!==void 0&&this.onNavigate(p,l)}else if(!this.props.skipDisabledItems&&u)this.onNavigate(p,l);else{let g=null;if(l===d.Keys.down||l===d.Keys.right)g=e.slice(r+1).find(v=>!v.disabled);else if(l===d.Keys.up||l===d.Keys.left){const v=e.slice(0,r);for(g=v.pop();g&&g.disabled;)g=v.pop()}if(g){const v=g.id-r-1;this.onNavigate(p,l,v)}else this.onNavigate(p,l)}this.applyState(p),t.preventDefault()}else l===d.Keys.enter?(t.preventDefault(),this.props.allowCustom&&h&&c===null?this.customItemSelect(t):c&&c.disabled?f():this.selectFocusedItem(t)):l===d.Keys.esc&&f();else t.altKey&&l===d.Keys.down&&f()},this.listContainerContent=()=>{const{header:t,footer:e,allowCustom:s,size:n,data:l=[],groupStickyHeaderItemRender:h,groupField:u,list:c}=this.props,r=this.props.filter!==void 0?this.props.filter:this.state.text,{focusedType:p}=this.getFocusedState(),f=s&&r&&a.createElement("div",{className:d.classNames("k-list",{[`k-list-${bt[n]||n}`]:n}),key:"customitem",onClick:this.customItemSelect,onMouseDown:ls},a.createElement("div",{className:d.classNames("k-list-item k-custom-item",{"k-focus":os(p)}),style:{fontStyle:"italic"}},r,a.createElement(d.IconWrap,{name:"plus",icon:Ie.plusIcon,style:{position:"absolute",right:"0.5em"}})));let{group:g}=this.state;return g===void 0&&u!==void 0&&(g=z(l[0],u)),a.createElement(a.Fragment,null,t&&a.createElement("div",{className:"k-list-header"},t),f,a.createElement("div",{className:d.classNames("k-list",{[`k-list-${this.mobileMode?"lg":bt[n]||n}`]:n,"k-virtual-list":this.base.vs.enabled})},!c&&g&&l.length!==0&&a.createElement(We,{group:g,groupMode:"modern",render:h}),this.renderList()),e&&a.createElement("div",{className:"k-list-footer"},e))},this.renderListContainer=()=>{const t=this.base,{dir:e,data:s=[]}=this.props,n=this.base.getPopupSettings(),l=n.width!==void 0?n.width:t.popupWidth,h={dir:e!==void 0?e:t.dirCalculated,width:l,popupSettings:{popupClass:d.classNames(n.popupClass,"k-list-container","k-multiselect-popup"),className:n.className,animate:n.animate,anchor:this.element,show:this.opened,onOpen:this.onPopupOpened,onClose:this.onPopupClosed,appendTo:n.appendTo},itemsCount:[s.length,this.value.length]};return a.createElement(Xe,{...h},this.listContainerContent())},this.renderAdaptiveListContainer=()=>{const{adaptiveTitle:t,filterable:e,filter:s}=this.props,{windowWidth:n=0}=this.state,l=s!==void 0?s:this.state.text;this.localization=xe.provideLocalizationService(this);const h=e?a.createElement(Ke,{value:l,ref:c=>this._adaptiveInput=c&&c.element,onChange:this.onChangeHandler,onKeyDown:this.onInputKeyDown,size:this.props.size,rounded:this.props.rounded,fillMode:this.props.fillMode}):null,u={adaptiveTitle:t,expand:this.opened,onClose:c=>this.onCancel(c),windowWidth:n,mobileFilter:h,footer:{cancelText:this.localization.toLanguageString(Re,ne[Re]),onCancel:this.onCancel,applyText:this.localization.toLanguageString(Pe,ne[Pe]),onApply:this.closePopup}};return a.createElement(At,{...u},a.createElement(fe.ActionSheetContent,{className:"!k-overflow-hidden"},a.createElement("div",{className:"k-list-container"},this.listContainerContent())))},this.closePopup=t=>{const e=this.base.initState();e.syntheticEvent=t,t.stopPropagation(),this.state.focusedIndex!==void 0&&(e.data.focusedIndex=void 0),this.opened&&this.base.togglePopup(e),e.events.push({type:"onClose"});const s=this.props.filter!==void 0?this.props.filter:this.state.text;Y(s)&&s!==""&&this.base.filterChanged("",e),this.state.text&&(e.data.text=""),this.applyState(e)},this.onCancel=t=>{const e=this.base.initState();e.syntheticEvent=t,t.stopPropagation(),this.state.focusedIndex!==void 0&&(e.data.focusedIndex=void 0),this.opened&&this.base.togglePopup(e),e.events.push({type:"onCancel"});const s=this.props.filter!==void 0?this.props.filter:this.state.text;Y(s)&&s!==""&&this.base.filterChanged("",e),this.state.text&&(e.data.text=""),this.applyState(e)},this.renderList=()=>{const{data:t=[],textField:e,listNoDataRender:s,itemRender:n,groupHeaderItemRender:l,dataItemKey:h,virtual:u={skip:0,total:void 0}}=this.props,c=this.base.vs,{focusedIndex:r}=this.getFocusedState(),p=this.base.getPopupSettings(),f=`translateY(${c.translate}px)`;return a.createElement(Ve,{id:this.base.listBoxId,show:this.opened,data:t.slice(),focusedIndex:r-u.skip,value:this.value,textField:e,valueField:h,optionsGuid:this.base.guid,groupField:this.props.groupField,groupMode:"modern",listRef:g=>{c.list=this.base.list=g},wrapperStyle:this.mobileMode?{}:{maxHeight:p.height},wrapperCssClass:"k-list-content",listStyle:c.enabled?{transform:f}:void 0,key:"listKey",skip:u.skip,onClick:this.handleItemClick,itemRender:n,groupHeaderItemRender:l,noDataRender:s,onMouseDown:ls,onBlur:this.handleBlur,onScroll:this.onScroll,wrapperRef:c.scrollerRef,scroller:this.base.renderScrollElement(),ariaSetSize:u.total})},this.onScroll=t=>{const{vs:e,list:s}=this.base;e.scrollHandler(t);const{groupField:n}=this.props;let{data:l=[]}=this.props;if(!(!n||!l.length)&&n){const h=this.itemHeight=this.itemHeight||(e.enabled?e.itemHeight:s?s.children[0].offsetHeight:0),c=t.target.scrollTop-e.skip*h;l=this.base.getGroupedDataModernMode(l,n);let r=l[0][n];for(let p=1;p<l.length&&!(h*p>c);p++)l[p]&&l[p][n]&&(r=l[p][n]);r!==this.state.group&&this.setState({group:r})}},this.customItemSelect=t=>{const e=this.props.filter!==void 0?this.props.filter:this.state.text,{textField:s}=this.props;if(!e)return;const n=this.base.initState();n.syntheticEvent=t;const l=s?{[s]:e}:e;this.state.text!==void 0&&(n.data.text=""),n.data.focusedIndex=void 0,this.base.filterChanged("",n);const h=[...this.value,l];this.triggerOnChange(h,n),this.base.togglePopup(n),this.applyState(n)},this.handleWrapperClick=t=>{const e=this._input;!this.opened&&e&&this.focusElement(e);const s=this.base.initState();s.syntheticEvent=t,!this.state.focused&&!this.mobileMode&&(s.events.push({type:"onFocus"}),s.data.focused=!0),this.mobileMode&&(this.setState({currentValue:this.tagsToRender}),this.mobileMode&&window.setTimeout(()=>this._adaptiveInput&&this._adaptiveInput.focus(),300)),this.base.togglePopup(s),this.applyState(s)},this.handleItemClick=(t,e)=>{const s=this.base.initState();s.syntheticEvent=e,this.handleItemSelect(t,s),this.props.autoClose&&!this.mobileMode&&this.base.togglePopup(s),e.stopPropagation(),this.applyState(s)},this.handleBlur=t=>{if(!this.state.focused||this._skipFocusEvent)return;const e=this.base.initState(),{allowCustom:s,filterable:n}=this.props;e.syntheticEvent=t,e.data.focused=!1,e.events.push({type:"onBlur"}),this.opened&&!this.mobileMode&&(this.state.opened&&(e.data.opened=!1),e.events.push({type:"onClose"})),!s&&!n&&this.state.text&&(e.data.text=""),this.applyState(e)},this.handleFocus=t=>{this._skipFocusEvent||this.base.handleFocus(t)},this.onPopupOpened=()=>{this._input&&this.state.focused&&!this.mobileMode&&this.focusElement(this._input)},this.onPopupClosed=()=>{this.state.focused&&window.setTimeout(()=>{this.state.focused&&this.focusElement(this._input)},0)},this.setValidity=()=>{this._input&&this._input.setCustomValidity&&this._input.setCustomValidity(this.validity.valid?"":this.props.validationMessage||$s)},d.validatePackage(qe)}get _inputId(){return this.props.id}get document(){if(d.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get opened(){return!!(this.props.opened!==void 0?this.props.opened:this.state.opened)}get tagsToRender(){const{tags:i,textField:t}=this.props;let e=[];return i===void 0?this.value.forEach(s=>{e.push({text:z(s,t),data:[s]})}):e.push(...i),e}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=ke&&this.props.adaptive)}get value(){const i=[];return this._valueItemsDuringOnChange?i.push(...this._valueItemsDuringOnChange):this.props.value?i.push(...this.props.value):this.state.value?i.push(...this.state.value):this.props.defaultValue&&i.push(...this.props.defaultValue),i}get name(){return this.props.name}get validity(){const i=this.props.validationMessage!==void 0,t=!this.required||this.value!==null&&this.value.length>0&&this.value!==void 0,e=this.props.valid!==void 0?this.props.valid:t;return{customError:i,valid:e,valueMissing:this.value===null}}get required(){return this.props.required!==void 0?this.props.required:Wt.defaultProps.required}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:Wt.defaultProps.validityStyles}componentDidUpdate(i,t){var f;const{virtual:e,groupField:s="",data:n=[]}=this.props,l=e?e.skip:0,h=i.virtual?i.virtual.total:0,u=i.opened!==void 0?i.opened:t.opened,c=!u&&this.opened,r=u&&!this.opened;if(!this.base.getPopupSettings().animate&&r&&this.onPopupClosed(),e&&e.total!==h)this.base.vs.calcScrollElementHeight(),this.base.vs.reset();else{let{focusedItem:g,focusedIndex:v}=this.getFocusedState();s!==""&&(v=(f=this.base.getGroupedDataModernMode(n,s))==null?void 0:f.indexOf(g)),c&&e?this.base.scrollToVirtualItem(e,v-l):c&&!e?(n&&n.length!==0&&this.base.resetGroupStickyHeader(n[0][s],this),this.base.scrollToItem(v)):this.opened&&u&&g&&this.scrollToFocused&&this.base.scrollToItem(v-l)}this.scrollToFocused=!1,this.setValidity()}componentDidMount(){var i;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.base.didMount(),this.setValidity(),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentWillUnmount(){var i;(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.disconnect()}onNavigate(i,t,e){const{allowCustom:s,data:n=[]}=this.props,l=this.props.filter!==void 0?this.props.filter:this.state.text,{focusedType:h,focusedIndex:u}=this.getFocusedState(),c=s&&l,r=os(h),p=this.base,f=p.vs;if(this.opened&&t===d.Keys.up&&r)this.state.focusedIndex!==void 0&&(i.data.focusedIndex=void 0);else{const g=p.navigation.navigate({keyCode:t,current:u,max:(f.enabled?f.total:n.length)-1,min:c?-1:0,skipItems:e||void 0});g!==void 0&&(this.itemFocus(g,i),this.scrollToFocused=!0)}this.applyState(i)}render(){const{style:i,className:t,label:e,dir:s,disabled:n,textField:l,dataItemKey:h,virtual:u,size:c,rounded:r,fillMode:p,loading:f,filter:g}=this.props,{text:v,focused:m,focusedTag:b,currentValue:C}=this.state,w=this.base.vs,D=this.props.id||this._inputId;w.enabled=u!==void 0,u!==void 0&&(w.skip=u.skip,w.total=u.total,w.pageSize=u.pageSize);const _=this.mobileMode&&this.opened?C:this.tagsToRender;this.setItems(this.tagsToRender,this._tags);const O=!this.validityStyles||this.validity.valid,B=!!(g!==void 0?g:v)||_&&_.length>0,[E,K]=Me(this.props.prefix||a.Fragment),[S,k]=Me(this.props.suffix||a.Fragment),N=a.createElement(a.Fragment,null,a.createElement("div",{ref:this.componentRef,className:d.classNames("k-multiselect k-input",t,{[`k-input-${bt[c]||c}`]:c,[`k-rounded-${qs[r]||r}`]:r,[`k-input-${p}`]:p,"k-focus":m&&!n,"k-invalid":!O,"k-disabled":n,"k-loading":f,"k-required":this.required}),style:e?{...i,width:void 0}:i,dir:s,onFocus:this.handleFocus,onBlur:this.handleBlur,onClick:this.handleWrapperClick,onMouseDown:ks},this.props.prefix&&a.createElement(E,{...K}),a.createElement("div",{className:d.classNames("k-input-values")},a.createElement("div",{className:d.classNames("k-chip-list",{[`k-chip-list-${bt[c]||c}`]:c}),role:"listbox",id:"tagslist-"+this.base.guid},_&&_.length>0&&a.createElement(Ht,{tagRender:this.props.tagRender,onTagDelete:this.onTagDelete,data:_,guid:this.base.guid,focused:b?_.find(q=>pt(q,b,h)):void 0,size:c})),this.renderSearchBar(D)),f&&a.createElement(d.IconWrap,{className:"k-input-loading-icon",name:"loading"}),this.props.suffix&&a.createElement(S,{...k}),B&&a.createElement(et,{onClick:this.clearButtonClick}),!this.mobileMode&&this.renderListContainer()),this.mobileMode&&this.renderAdaptiveListContainer());return e?a.createElement(Ae.FloatingLabel,{label:e,editorId:D,editorValue:v||z(this.value[0],l),editorValid:O,editorDisabled:n,style:{width:i?i.width:void 0},children:N}):N}renderSearchBar(i){const{activedescendant:t,focusedTag:e,currentValue:s}=this.state,{disabled:n,placeholder:l,ariaDescribedBy:h}=this.props,u=!this.mobileMode&&(this.props.filter!==void 0?this.props.filter:this.state.text)||"",{focusedIndex:c}=this.getFocusedState(),r=this.value.length===0&&!u?l:void 0,p=s&&s.length>0?void 0:l,f=t===st.TagsList&&e!==void 0?`tag-${this.base.guid}-${e.text.replace(/\s+/g,"-")}`:`option-${this.base.guid}-${c}`;return a.createElement(gt,{id:i,size:Math.max((r||"").length,u.length,1),tabIndex:this.props.tabIndex,accessKey:this.props.accessKey,placeholder:this.mobileMode&&this.opened?p:r,value:u,onChange:this.onChangeHandler,onKeyDown:this.onInputKeyDown,ref:this.searchbarRef,disabled:n,expanded:this.opened,owns:this.base.listBoxId,role:"combobox",activedescendant:f,ariaDescribedBy:`tagslist-${this.base.guid}${h?" "+h:""}`,ariaLabelledBy:this.props.ariaLabelledBy,ariaRequired:this.required})}onTagsNavigate(i,t){const e=i.keyCode,{focusedTag:s}=this.state,n=this._tags,l=this.props.dataItemKey;let h=s?n.findIndex(r=>pt(r,s,l)):-1,u;const c=h!==-1;if(e===d.Keys.left)c?h=Math.max(0,h-1):h=n.length-1,u=n[h];else if(e===d.Keys.right)h===n.length-1?u=void 0:c&&(h=Math.min(n.length-1,h+1),u=n[h]);else if(e===d.Keys.home&&!i.shiftKey)u=n[0];else if(e===d.Keys.end&&!i.shiftKey)u=n[n.length-1];else if(e===d.Keys.delete){if(c){const r=this.value;ht(r,n[h].data,l),this.triggerOnChange(r,t)}}else if(e===d.Keys.backspace){const r=this.value;if(c)ht(r,n[h].data,l),this.triggerOnChange(r,t);else if(!c&&n.length){const p=n.pop();ht(r,p.data,l),this.triggerOnChange(r,t)}}u!==s&&(t.data.focusedTag=u,t.data.activedescendant=st.TagsList),this.applyState(t)}triggerOnChange(i,t){this.props.value===void 0&&(t.data.value=[...i]),this._valueItemsDuringOnChange=[],this.setItems(i,this._valueItemsDuringOnChange),t.events.push({type:"onChange"})}selectFocusedItem(i,t){const{data:e=[],virtual:s}=this.props,{focusedIndex:n}=t||this.getFocusedState(),l=s?s.skip:0;e[n-l]!==void 0&&this.handleItemClick(n,i)}setItems(i,t){t.length=0,t.push(...i)}getFocusedState(){const{focusedIndex:i}=this.state,t=this.props.filter!==void 0?this.props.filter:this.state.text,{allowCustom:e,data:s=[],dataItemKey:n,virtual:l,textField:h,focusedItemIndex:u=_e,skipDisabledItems:c}=this.props,r=l&&l.skip||0;let p;if(i!==void 0)return{focusedIndex:i,focusedItem:s[i-r],focusedType:1};const f=this.value;if(e&&t)return{focusedItem:null,focusedIndex:-1,focusedType:2};if(t)return p=u(s,t,h),{focusedItem:s[p],focusedIndex:p+r,focusedType:1};if(f.length){const g=f[f.length-1];return p=s.findIndex(v=>L(v,g,n)),s[p]!==void 0?{focusedIndex:p+r,focusedItem:s[p],focusedType:1}:{focusedType:0,focusedIndex:-1}}else if(c&&h&&!t&&r===0){const g=s.findIndex(v=>!v.disabled&&v[h]);return{focusedIndex:g,focusedItem:s[g-r],focusedType:1}}return r===0?{focusedItem:s[0],focusedIndex:0,focusedType:1}:{focusedType:0,focusedIndex:-1}}focusElement(i){this._skipFocusEvent=!0,i.focus(),window.setTimeout(()=>this._skipFocusEvent=!1,0)}applyState(i){this.base.applyState(i),this._valueItemsDuringOnChange=null}calculateMedia(i){for(let t of i)this.setState({windowWidth:t.target.clientWidth})}updateStateOnKeyboardNavigation(i,t){this.setState({value:i}),this.triggerOnChange(i,t),this.applyState(t)}getLastSelectedOrDeselectedIndex(i,t){return this._lastSelectedOrDeslectedItemIndex===null&&(this._lastSelectedOrDeslectedItemIndex=t),this._lastSelectedOrDeslectedItemIndex!==null?this._lastSelectedOrDeslectedItemIndex+i:null}};let it=Wt;it.displayName="MultiSelect",it.propTypes={...ae.propTypes,autoClose:o.bool,value:o.arrayOf(o.any),defaultValue:o.arrayOf(o.any),dataItemKey:o.string,placeholder:o.string,tags:o.arrayOf(o.shape({text:o.string,data:o.arrayOf(o.any)})),tagRender:o.func,id:o.string,ariaLabelledBy:o.string,ariaDescribedBy:o.string,groupField:o.string,list:o.any,adaptive:o.bool,adaptiveTitle:o.string,onCancel:o.func,skipDisabledItems:o.bool},it.defaultProps={...ae.defaultProps,autoClose:!0,required:!1,size:"medium",rounded:"medium",fillMode:"solid",groupMode:"modern",skipDisabledItems:!0,prefix:void 0,suffix:void 0};const rs=d.createPropsContext(),ds=d.withIdHOC(d.withPropsContext(rs,it));ds.displayName="KendoReactMultiSelect";const Ts=i=>a.createElement(Ve,{...i,wrapperCssClass:"k-table-body k-table-scroller",listClassName:d.classNames("k-table k-table-list",{"k-virtual-table":i.virtual!==void 0}),listStyle:{...i.listStyle}}),Gs=(i,t)=>i?typeof i=="number"?i+"px":i:t,cs=d.createPropsContext(),It=a.forwardRef((i,t)=>{const e=d.usePropsContext(cs,i),s=a.useRef(null),n=a.useRef(null),l=d.getScrollbarWidth(),{columns:h=Ge.columns,popupSettings:u=Ge.popupSettings,className:c,size:r,prefix:p=void 0,suffix:f=void 0,onOpen:g,onClose:v,onFocus:m,onBlur:b,onChange:C,onFilterChange:w,onPageChange:D,..._}=e;a.useImperativeHandle(s,()=>({element:n.current&&n.current.element,focus(){n.current&&n.current.focus()},get value(){return n.current&&n.current.value},get name(){return n.current&&n.current.name},props:e})),a.useImperativeHandle(t,()=>s.current);const O=a.useMemo(()=>{if(e.groupField!==void 0&&e.data)return z(e.data[0],e.groupField)},[e.data,e.groupField]),[B,E]=a.useState(O),[K,S]=a.useState(!0),[k]=p?Me(e.prefix||a.Fragment):[],[N]=f?Me(e.suffix||a.Fragment):[],q=a.useMemo(()=>{const V=a.createElement("th",{className:"k-table-th",colSpan:h.length},B);return a.createElement(a.Fragment,null,e.header,a.createElement("div",{className:"k-table-header-wrap"},a.createElement("table",{className:"k-table",role:"presentation"},a.createElement("colgroup",null,h.map((G,ye)=>a.createElement("col",{key:G.uniqueKey?G.uniqueKey:ye,style:{width:G.width?G.width:Ge.width}}))),a.createElement("thead",{className:"k-table-thead"},a.createElement("tr",{className:"k-table-row"},h.map((G,ye)=>a.createElement("th",{className:"k-table-th",key:G.uniqueKey?G.uniqueKey:ye},G.header||" "))),B&&K&&a.createElement("tr",{className:"k-table-group-row"},e.groupStickyHeaderItemRender?e.groupStickyHeaderItemRender.call(void 0,V,{}):V)))))},[e.header,h,B,K]),X=a.useMemo(()=>`calc(${h.map(V=>Gs(V.width,Ge.width)).filter(Boolean).join(" + ")} + ${l}px + 4px)`,[h,l]),J=e.virtual?e.virtual.skip:0,Q=a.useCallback((V,G)=>{const ye=h.map((P,nt)=>a.createElement("span",{className:e.itemRender?void 0:"k-table-td",style:e.itemRender?void 0:{width:P.width?P.width:Ge.width},key:P.uniqueKey?P.uniqueKey:nt},P.field?String(d.getter(P.field)(G.dataItem)):""));let De,A,Z,re,W=e.data||[];const Ne=G.index-J;e.groupField!==void 0&&(re=d.getter(e.groupField),A=re(W[Ne]),Z=re(W[Ne-1]),A&&Z&&A!==Z&&(De=A)),De&&e.groupMode==="classic"&&ye.push(a.createElement("div",{key:"group",className:"k-table-td k-table-group-td"},a.createElement("span",null,De)));const de=a.cloneElement(V,{...V.props,className:d.classNames("k-table-row",{"k-table-alt-row":G.index%2!==0,"k-focus":G.focused,"k-selected":G.selected,"k-first":!!De,"k-disabled":G.dataItem.disabled})},ye);return e.itemRender?e.itemRender.call(void 0,de,G):de},[h,e.groupField,e.itemRender,e.data,J]),T=a.useCallback((V,G)=>{V&&V.call(void 0,{...G,target:s.current})},[]),me=a.useCallback(V=>(e.virtual||E(O),T(g,V)),[T,g,e.virtual,O]),R=a.useCallback(V=>T(v,V),[v]),ee=a.useCallback(V=>T(m,V),[m]),oe=a.useCallback(V=>T(b,V),[b]),je=a.useCallback(V=>T(C,V),[C]),Le=a.useCallback(V=>T(D,V),[D]),Ye=a.useCallback(V=>(E(O),T(w,{...V,mobileMode:V.target.mobileMode})),[w]),$=a.useCallback(V=>{E(V.group)},[]);a.useEffect(()=>{d.setScrollbarWidth()}),a.useEffect(()=>{const V=e.data;E(O),V&&V.length!==0?S(!0):S(!1)},[e.data]);const ze=a.useCallback(V=>a.createElement(Ts,{...V}),[]);return a.createElement(ct.PopupPropsContext.Provider,{value:V=>({...V,popupClass:`k-dropdowngrid-popup ${u.popupClass}`})},a.createElement(Lt,{..._,list:ze,popupSettings:{width:X,...u,className:u.className},ref:n,header:q,itemRender:Q,groupHeaderItemRender:e.groupHeaderItemRender,size:e.size,rounded:e.rounded,fillMode:e.fillMode,groupMode:e.groupMode,groupField:e.groupField,isMultiColumn:!0,onOpen:me,onClose:R,onFocus:ee,onBlur:oe,onChange:je,onFilterChange:Ye,onPageChange:Le,onGroupScroll:$,className:d.classNames("k-dropdowngrid",c),required:e.required,adaptive:e.adaptive,adaptiveFilter:e.adaptiveFilter,adaptiveTitle:e.adaptiveTitle,footer:e.footer,footerClassName:"k-table-footer",prefix:k,suffix:N}))}),Us={...Te.propTypes,columns:o.any.isRequired},Ge={columns:[],popupSettings:{},width:"200px",size:"medium",rounded:"medium",fillMode:"solid"};It.displayName="KendoMultiColumnComboBox",It.propTypes=Us,It.defaultProps=Ge;function us(i,t,e){const[s,n]=a.useState(t);return a.useEffect(()=>{s!==void 0&&i.current&&n(i.current.offsetWidth)},e),s}const hs=i=>a.createElement("div",{className:"k-nodata"},a.createElement("div",null,i.children)),{sizeMap:js,roundedMap:Ys}=d.kendoThemeMaps,Js="Please select a value from the list!",Qs=i=>a.createElement("span",{className:"k-input-value-text"},i.children),ps=i=>i.split("_").map(t=>parseInt(t,10)),Xs=(i,t)=>{const{validationMessage:e,valid:s,required:n}=i;return{customError:e!==void 0,valid:!!(s!==void 0?s:!n||t),valueMissing:!t}},fs={selectField:"selected",subItemsField:"items",popupSettings:{animate:!0,width:"200px",height:"200px"},data:[],required:!1,style:{},validityStyles:!0,size:"medium",rounded:"medium",fillMode:"solid"},gs=d.createPropsContext(),qt=a.forwardRef((i,t)=>{d.validatePackage(qe);const e=d.usePropsContext(gs,i),s={...fs,...e},n=d.useId(),l=s.id||n,{data:h,dataItemKey:u,popupSettings:c,style:r,opened:p,disabled:f,onOpen:g=d.noop,onClose:v=d.noop,placeholder:m,label:b,name:C,selectField:w,subItemsField:D,validationMessage:_,valid:O,required:B,validityStyles:E}=s,K=d.getTabIndex(s.tabIndex,f),S=a.useRef(null),k=a.useRef(null),N=a.useRef(null),q=a.useRef(null),X=a.useRef(null),J=a.useRef(null),Q=a.useRef(!1),[T,me]=a.useState(void 0),R=s.value!==void 0,ee=R?s.value:T!==void 0?T:s.defaultValue,oe=Y(ee),je=oe?z(ee,s.textField):"",Le=Xs({validationMessage:_,valid:O,required:B},oe),Ye=a.useCallback(()=>k.current&&k.current.focus(),[]);a.useImperativeHandle(S,()=>({props:s,element:k.current,focus:Ye})),a.useImperativeHandle(t,()=>S.current);const $=d.useRtl(k,s.dir),ze=c.width!==void 0?c.width:r.width!==void 0?r.width:fs.popupSettings.width,G={width:us(k,ze),...$!==void 0?{direction:$}:{}},[ye,De]=a.useState(!1),A=p!==void 0?p:ye,[Z,re]=a.useState(!1),[W,Ne]=a.useState(),de=!!(W&&W<=ke&&s.adaptive),[P,nt]=a.useState(""),bs=a.useCallback(()=>{X.current&&X.current.setCustomValidity&&X.current.setCustomValidity(Le.valid?"":_===void 0?Js:_)},[_,Le]);a.useEffect(bs),a.useEffect(()=>{const x=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(jt.bind(void 0));return document!=null&&document.body&&x&&x.observe(document.body),()=>{document!=null&&document.body&&x&&x.disconnect()}},[]);const yt=a.useCallback(x=>{if(!A){if(g){const F={...x};g.call(void 0,F)}p===void 0&&De(!0)}},[A,p,g]),Fe=a.useCallback(x=>{if(A){if(v){const F={...x};v.call(void 0,F)}p===void 0&&(De(!1),de&&setTimeout(()=>{var F;U((F=q.current)==null?void 0:F.element)},300))}},[A,p,v,de]),$t=a.useCallback(x=>{if(!x.isDefaultPrevented()&&S.current){re(!0);const F={syntheticEvent:x,nativeEvent:x.nativeEvent,target:S.current};(A?Fe:yt)(F)}},[A,p,g,v]),le=a.useCallback(x=>{Q.current=!0,x(),window.setTimeout(()=>Q.current=!1,0)},[]),Je=a.useCallback(x=>{var y,H;const{keyCode:F,altKey:j}=x,ue=J.current&&J.current.element;if(!S.current||x.isDefaultPrevented()&&((y=N.current)==null?void 0:y.element)===x.target)return;const I={syntheticEvent:x,nativeEvent:x.nativeEvent,target:S.current};if(A)if(F===d.Keys.esc||j&&F===d.Keys.up)x.preventDefault(),Fe(I);else if(ue&&ue.querySelector(".k-focus")&&(F===d.Keys.up||F===d.Keys.down||F===d.Keys.left||F===d.Keys.right||F===d.Keys.home||F===d.Keys.end)){if(F===d.Keys.up&&((H=N.current)!=null&&H.element)){const se=Array.from(ue.querySelectorAll(".k-treeview-item")),we=[...se].reverse().find(Ee=>!!(Ee&&Ee.querySelector(".k-focus")));if(we&&se.indexOf(we)===0)return le(()=>{var Ee;U((Ee=N.current)==null?void 0:Ee.element)})}le(d.noop)}else F===d.Keys.down&&le(()=>{var se;U(((se=N.current)==null?void 0:se.element)||ue)});else j&&F===d.Keys.down?(x.preventDefault(),yt(I)):A||F===d.Keys.esc&&Et(x)},[A,p,g,v]),He=a.useCallback(x=>{const{keyCode:F,altKey:j}=x;j||F!==d.Keys.up&&F!==d.Keys.down||(x.preventDefault(),le(F===d.Keys.up?()=>{U(k.current)}:()=>{U(J.current&&J.current.element)}))},[]),U=a.useCallback(x=>{x&&le(()=>x.focus())},[]),ve=a.useCallback(()=>{var x;!Z&&A&&!p?Fe({target:S.current}):e.filterable?U((x=N.current)==null?void 0:x.element):U(J.current&&J.current.element)},[v,e.filterable,Z,p,A]),te=a.useCallback(()=>{Z&&U(k.current)},[Z]),Tt=a.useCallback(x=>{if(!Z&&!Q.current&&(re(!0),e.onFocus&&S.current)){const F={syntheticEvent:x,nativeEvent:x.nativeEvent,target:S.current};e.onFocus.call(void 0,F)}},[Z,e.onFocus]),Gt=a.useCallback(x=>{if(Z&&!Q.current&&S.current){re(!1);const F={syntheticEvent:x,nativeEvent:x.nativeEvent,target:S.current};if(e.onBlur){const j={...F};e.onBlur.call(void 0,j)}de||Fe(F)}},[Z,e.onBlur,A,p,v]),Ut=a.useCallback(()=>{Z&&le(d.noop),de&&setTimeout(()=>{var x;U((x=q.current)==null?void 0:x.element)},300)},[Z,de]),St=a.useCallback((x,F,j)=>{if(e.onChange){const ue={value:F,level:j?ps(j):[],...x};e.onChange.call(void 0,ue)}R||me(F)},[e.onChange,R]),wt=a.useCallback(x=>{if(L(x.item,ee,u)||!S.current)return;const{item:F,itemHierarchicalIndex:j,nativeEvent:ue,syntheticEvent:I}=x,y={syntheticEvent:I,nativeEvent:ue,target:S.current};St(y,F,j),Fe(y)},[R,ee,e.onChange,u,A,p,v]),Et=a.useCallback(x=>{if(!S.current)return;const F={syntheticEvent:x,nativeEvent:x.nativeEvent,target:S.current};St(F,null),Fe(F),x.preventDefault()},[R,e.onChange,A,p,v]),Ct=a.useCallback(x=>{if(x.syntheticEvent.stopPropagation(),e.onExpandChange&&S.current){const{item:F,itemHierarchicalIndex:j,nativeEvent:ue,syntheticEvent:I}=x,y={level:ps(j),item:F,nativeEvent:ue,syntheticEvent:I,target:S.current};e.onExpandChange.call(void 0,y)}},[e.onExpandChange]),at=a.useCallback(x=>{if(e.onFilterChange&&S.current){const j={filter:{field:e.textField,operator:"contains",value:x.target.value},syntheticEvent:x.syntheticEvent,nativeEvent:x.nativeEvent,target:S.current};e.onFilterChange.call(void 0,j),e.filter===void 0&&nt(x.target.value)}},[e.onFilterChange,e.filter,e.textField]),lt=()=>{const x=s.filterable?a.createElement(Ke,{value:s.filter===void 0?P:s.filter,ref:q,onChange:at,onKeyDown:He,size:be,rounded:Se,fillMode:Oe}):null,F={adaptiveTitle:s.adaptiveTitle,expand:A,onClose:j=>Fe(j),windowWidth:W,mobileFilter:x};return a.createElement(At,{...F},a.createElement(fe.ActionSheetContent,{className:"!k-overflow-hidden"},a.createElement("div",{className:"k-list-container"},a.createElement("div",{className:"k-list k-list-lg"},h.length>0?a.createElement(ut.TreeView,{ref:J,tabIndex:K,data:ot,focusIdField:u,textField:s.textField,selectField:w,expandField:s.expandField,childrenField:D,expandIcons:!0,onItemClick:wt,onExpandChange:Ct,size:be,item:s.item,dir:$}):a.createElement(rt,null,dt.toLanguageString(ge,ne[ge]))))))},jt=a.useCallback(x=>{for(let F of x)Ne(F.target.clientWidth)},[]),ot=a.useMemo(()=>R||!oe?h:d.mapTree(h,D,x=>d.extendDataItem(x,D,{[w]:L(x,ee,u)})),[h,ee,R,oe,w,D]),rt=s.listNoData||hs,kt=s.valueHolder||Qs,dt=xe.useLocalization(),Dt=!E||Le.valid,{size:be,rounded:Se,fillMode:Oe}=s,ce=a.createElement(a.Fragment,null,a.createElement("span",{className:d.classNames("k-dropdowntree k-picker",s.className,{[`k-picker-${js[be]||be}`]:be,[`k-rounded-${Ys[Se]||Se}`]:Se,[`k-picker-${Oe}`]:Oe,"k-focus":Z,"k-invalid":!Dt,"k-loading":s.loading,"k-required":B,"k-disabled":s.disabled}),tabIndex:K,accessKey:s.accessKey,id:l,style:b?{...r,width:void 0}:r,dir:$,ref:k,onKeyDown:f?void 0:Je,onMouseDown:Ut,onClick:f?void 0:$t,onFocus:Tt,onBlur:Gt,role:"combobox","aria-haspopup":"tree","aria-expanded":A,"aria-disabled":f,"aria-label":b,"aria-labelledby":s.ariaLabelledBy,"aria-describedby":s.ariaDescribedBy,"aria-required":B},a.createElement("span",{className:"k-input-inner"},a.createElement(kt,{item:ee},je||m)),s.loading&&a.createElement(d.IconWrap,{className:"k-input-loading-icon",name:"loading"}),oe&&!f&&a.createElement("span",{onClick:Et,className:"k-clear-value",title:dt.toLanguageString(Ze,ne[Ze]),role:"button",tabIndex:-1,onMouseDown:x=>x.preventDefault()},a.createElement(d.IconWrap,{name:"x",icon:Ie.xIcon})),a.createElement(Ce.Button,{tabIndex:-1,type:"button","aria-label":"select",className:"k-input-button",size:be,fillMode:Oe,themeColor:"base",rounded:null,icon:"caret-alt-down",svgIcon:Ie.caretAltDownIcon}),a.createElement("select",{name:C,ref:X,tabIndex:-1,"aria-hidden":!0,title:b,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},a.createElement("option",{value:s.valueMap?s.valueMap.call(void 0,ee):ee})),!de&&a.createElement(ct.Popup,{className:d.classNames(c.className,{"k-rtl":$==="rtl"}),popupClass:d.classNames(c.popupClass,"k-dropdowntree-popup"),style:G,animate:c.animate,anchor:k.current,show:A,onOpen:ve,onClose:te,appendTo:c.appendTo},s.filterable&&a.createElement(Ke,{value:s.filter===void 0?P:s.filter,ref:N,onChange:at,onKeyDown:He,size:be,rounded:Se,fillMode:Oe}),h.length>0?a.createElement(ut.TreeView,{ref:J,tabIndex:K,data:ot,focusIdField:u,textField:s.textField,selectField:w,expandField:s.expandField,childrenField:D,expandIcons:!0,onItemClick:wt,onExpandChange:Ct,size:be,item:s.item,dir:$}):a.createElement(rt,null,dt.toLanguageString(ge,ne[ge])))),de&&lt());return b?a.createElement(Ae.FloatingLabel,{label:b,editorValue:je,editorPlaceholder:m,editorValid:Dt,editorDisabled:f,editorId:l,style:{width:r?r.width:void 0},children:ce,dir:$}):ce}),Zs={opened:o.bool,disabled:o.bool,dir:o.string,tabIndex:o.number,accessKey:o.string,data:o.array,value:o.any,valueMap:o.func,placeholder:o.string,dataItemKey:o.string.isRequired,textField:o.string.isRequired,selectField:o.string,expandField:o.string,subItemsField:o.string,className:o.string,style:o.object,label:o.string,validationMessage:o.string,validityStyles:o.bool,valid:o.bool,required:o.bool,name:o.string,id:o.string,ariaLabelledBy:o.string,ariaDescribedBy:o.string,filterable:o.bool,filter:o.string,loading:o.bool,popupSettings:o.shape({animate:o.oneOfType([o.bool,o.shape({openDuration:o.number,closeDuration:o.number})]),popupClass:o.string,className:o.string,appendTo:o.any,width:o.oneOfType([o.string,o.number]),height:o.oneOfType([o.string,o.number])}),onOpen:o.func,onClose:o.func,onFocus:o.func,onBlur:o.func,onChange:o.func,onFilterChange:o.func,onExpandChange:o.func,item:o.func,valueHolder:o.func,listNoData:o.func,adaptiveTitle:o.string,adaptive:o.bool};qt.displayName="KendoReactDropDownTree",qt.propTypes=Zs;const Ps="Please select a value from the list!",{sizeMap:vs,roundedMap:Rs}=d.kendoThemeMaps,ei=i=>i.split("_").map(t=>parseInt(t,10)),ti=(i,t)=>{const{validationMessage:e,valid:s,required:n}=i;return{customError:e!==void 0,valid:!!(s!==void 0?s:!n||t),valueMissing:!t}},Be={checkField:"checkField",checkIndeterminateField:"checkIndeterminateField",subItemsField:"items",popupSettings:{animate:!0,width:"200px",height:"200px"},size:"medium",rounded:"medium",fillMode:"solid",required:!1,validityStyles:!0},ms=d.createPropsContext(),xt=a.forwardRef((i,t)=>{const e=d.usePropsContext(ms,i);d.validatePackage(qe);const s=d.useId(),n=e.id||s,{data:l=[],dataItemKey:h,popupSettings:u={},style:c={},opened:r,disabled:p,onOpen:f=d.noop,onClose:g=d.noop,placeholder:v,label:m,name:b,checkField:C=Be.checkField,checkIndeterminateField:w=Be.checkIndeterminateField,subItemsField:D=Be.subItemsField,validationMessage:_,valid:O,tags:B,value:E,required:K=Be.required,validityStyles:S=Be.validityStyles}=e,k=d.getTabIndex(e.tabIndex,p),N=a.useRef(null),q=a.useRef(null),X=a.useRef(null),J=a.useRef(null),Q=a.useRef(null),T=a.useRef(null),me=a.useRef(!1),R=a.useRef([]),ee=a.useRef(null),[oe,je]=a.useState(),[Le,Ye]=a.useState(!1),[$,ze]=a.useState(!1),[V,G]=a.useState(),[ye,De]=a.useState([]),[A,Z]=a.useState(""),re=!!(V&&V<=ke&&e.adaptive),W=r!==void 0?r:Le,Ne=!!(Array.isArray(E)&&E.length),de=ti({validationMessage:_,valid:O,required:K},Ne),P=d.useRtl(q,e.dir),nt=u.width!==void 0?u.width:c.width!==void 0?c.width:Be.popupSettings.width,yt={width:us(q,nt),...P!==void 0?{direction:P}:{}},Fe=a.useCallback(()=>q.current&&q.current.focus(),[]);R.current=B===void 0?(E||[]).map(I=>({text:z(I,e.textField),data:[I]})):[...B],a.useImperativeHandle(N,()=>({props:e,element:q.current,focus:Fe})),a.useImperativeHandle(t,()=>N.current);const $t=a.useCallback(()=>{Q.current&&Q.current.setCustomValidity&&Q.current.setCustomValidity(de.valid?"":_===void 0?Ps:_)},[_,de]);a.useEffect($t),a.useEffect(()=>{const I=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(Dt.bind(void 0));return document!=null&&document.body&&I&&I.observe(document.body),()=>{I&&I.disconnect()}},[]),a.useEffect(()=>{ee.current&&W&&ee.current.setPosition(ee.current._popup)},[E,W]);const le=a.useCallback((I,y,H)=>{if(e.onChange){const se={items:y,operation:H,...I};e.onChange.call(void 0,se)}},[e.onChange]),Je=a.useCallback(I=>{if(L(I.item,E,h)||!N.current)return;const{item:y,nativeEvent:H,syntheticEvent:se}=I,we={syntheticEvent:se,nativeEvent:H,target:N.current};le(we,[y],"toggle")},[E,h,le]),He=a.useCallback(I=>{if(!W){if(f){const y={...I};f.call(void 0,y)}r===void 0&&(Ye(!0),De(E||[]),re&&setTimeout(()=>{var y;te((y=J.current)==null?void 0:y.element)},300))}},[W,r,f,re,J]),U=a.useCallback(I=>{if(W){if(g){const y={...I};g.call(void 0,y)}r===void 0&&Ye(!1)}},[W,r,g]),ve=a.useCallback(I=>{me.current=!0,I(),window.setTimeout(()=>me.current=!1,0)},[]),te=a.useCallback(I=>{I&&ve(()=>I.focus())},[ve]),Tt=a.useCallback(()=>{var I;!$&&W?U({target:N.current}):e.filterable?te((I=X.current)==null?void 0:I.element):te(T.current&&T.current.element)},[$,W,te,U,e.filterable]),Gt=a.useCallback(()=>{$&&te(q.current)},[$,te]),Ut=a.useCallback(I=>{if(!$&&!me.current&&(ze(!0),e.onFocus&&N.current)){const y={syntheticEvent:I,nativeEvent:I.nativeEvent,target:N.current};e.onFocus.call(void 0,y)}},[$,e.onFocus]),St=a.useCallback(I=>{if($&&!me.current&&N.current){ze(!1);const y={syntheticEvent:I,nativeEvent:I.nativeEvent,target:N.current};if(e.onBlur){const H={...y};e.onBlur.call(void 0,H)}re||U(y)}},[$,e.onBlur,W,r,g]),wt=a.useCallback(()=>{$&&ve(d.noop)},[$,ve]),Et=a.useCallback(I=>{if(!I.isDefaultPrevented()&&N.current){ze(!0);const y={syntheticEvent:I,nativeEvent:I.nativeEvent,target:N.current};W||He(y)}},[W,He]),Ct=a.useCallback(I=>{var Ee,Is;const{keyCode:y,altKey:H}=I,se=T.current&&T.current.element;if(!N.current||I.isDefaultPrevented()&&((Ee=X.current)==null?void 0:Ee.element)===I.target)return;const we={syntheticEvent:I,nativeEvent:I.nativeEvent,target:N.current};if(E&&E.length>0&&(y===d.Keys.left||y===d.Keys.right||y===d.Keys.home||y===d.Keys.end||y===d.Keys.delete)){const ie=R.current;let he=oe?ie.findIndex(ni=>pt(ni,oe,h)):-1,pe;const Yt=he!==-1;y===d.Keys.left?(Yt?he=Math.max(0,he-1):he=ie.length-1,pe=ie[he]):y===d.Keys.right?he===ie.length-1?pe=void 0:Yt&&(he=Math.min(ie.length-1,he+1),pe=ie[he]):y===d.Keys.home?pe=ie[0]:y===d.Keys.end?pe=ie[ie.length-1]:y===d.Keys.delete&&Yt&&le(we,ie[he].data,"delete"),pe!==oe&&je(pe)}if(W)if(y===d.Keys.esc||H&&y===d.Keys.up)I.preventDefault(),U(we);else if(se&&se.querySelector(".k-focus")&&(y===d.Keys.up||y===d.Keys.down||y===d.Keys.left||y===d.Keys.right||y===d.Keys.home||y===d.Keys.end)){if(y===d.Keys.up&&((Is=X.current)!=null&&Is.element)){const ie=Array.from(se.querySelectorAll(".k-treeview-item")),he=[...ie].reverse().find(pe=>!!(pe&&pe.querySelector(".k-focus")));if(he&&ie.indexOf(he)===0)return ve(()=>{var pe;te((pe=X.current)==null?void 0:pe.element)})}ve(d.noop)}else y===d.Keys.down&&ve(()=>{var ie;te(((ie=X.current)==null?void 0:ie.element)||se)});else H&&y===d.Keys.down&&(I.preventDefault(),He(we))},[W,U,te,ve,He,oe,h,E,le]),at=a.useCallback(I=>{const{keyCode:y,altKey:H}=I;H||y!==d.Keys.up&&y!==d.Keys.down||(I.preventDefault(),ve(y===d.Keys.up?()=>{te(q.current)}:()=>{te(T.current&&T.current.element)}))},[te,ve]),lt=a.useCallback(I=>{if(!N.current)return;const y={syntheticEvent:I,nativeEvent:I.nativeEvent,target:N.current};le(y,[],"clear"),U(y),I.preventDefault()},[le,U]),jt=a.useCallback((I,y)=>{var H;U({target:N.current}),$||te((H=X.current)==null?void 0:H.element),le({syntheticEvent:y,nativeEvent:y.nativeEvent,target:N.current},I,"delete")},[le,U,te,$]),ot=a.useCallback(I=>{if(e.onExpandChange&&N.current){const{item:y,itemHierarchicalIndex:H,nativeEvent:se,syntheticEvent:we}=I,Ee={level:ei(H),item:y,nativeEvent:se,syntheticEvent:we,target:N.current};e.onExpandChange.call(void 0,Ee)}},[e.onExpandChange]),rt=a.useCallback(I=>{if(e.onFilterChange&&N.current){const H={filter:{field:e.textField,operator:"contains",value:I.target.value},syntheticEvent:I.syntheticEvent,nativeEvent:I.nativeEvent,target:N.current};e.onFilterChange.call(void 0,H),e.filter===void 0&&Z(I.target.value)}},[e.onFilterChange,e.filter,e.textField]),kt=a.useCallback(I=>{if(!N.current)return;const y={syntheticEvent:I,nativeEvent:I.nativeEvent,target:N.current};e.onCancel&&e.onCancel.call(void 0,y),U(y),I.preventDefault()},[e.onCancel,U]),dt=()=>{const I=e.filterable?a.createElement(Ke,{value:e.filter===void 0?A:e.filter,ref:J,onChange:rt,onKeyDown:at,size:ce,rounded:x,fillMode:F}):null,y={adaptiveTitle:e.adaptiveTitle,expand:W,onClose:H=>e.onCancel?kt(H):lt(H),windowWidth:V,mobileFilter:I,footer:{cancelText:Se.toLanguageString(Re,ne[Re]),onCancel:H=>e.onCancel?kt(H):lt(H),applyText:Se.toLanguageString(Pe,ne[Pe]),onApply:H=>U(H)}};return a.createElement(At,{...y},a.createElement(fe.ActionSheetContent,{className:"!k-overflow-hidden"},a.createElement("div",{className:"k-list-container"},a.createElement("div",{className:"k-list k-list-lg"},l.length>0?a.createElement(ut.TreeView,{ref:T,tabIndex:k,data:l,focusIdField:h,textField:e.textField,checkField:C,checkIndeterminateField:w,expandField:e.expandField,childrenField:D,expandIcons:!0,onItemClick:Je,onCheckChange:Je,onExpandChange:ot,checkboxes:!0,size:ce,item:e.item,dir:P}):a.createElement(be,null,Se.toLanguageString(ge,ne[ge]))))))},Dt=a.useCallback(I=>{for(let y of I)G(y.target.clientWidth)},[]),be=e.listNoData||hs,Se=xe.useLocalization(),Oe=!S||de.valid,{size:ce,rounded:x,fillMode:F}=e,j=re&&W?ye:R.current,ue=a.createElement(a.Fragment,null,a.createElement("span",{className:d.classNames("k-multiselecttree k-input",e.className,{[`k-input-${vs[ce]||ce}`]:ce,[`k-rounded-${Rs[x]||x}`]:x,[`k-input-${F}`]:F,"k-focus":$&&!p,"k-invalid":!Oe,"k-disabled":p,"k-loading":e.loading,"k-required":K}),tabIndex:k,accessKey:e.accessKey,id:n,style:m?{...c,width:void 0}:c,dir:P,ref:q,onKeyDown:p?void 0:Ct,onMouseDown:wt,onFocus:Ut,onBlur:St,role:"combobox","aria-haspopup":"tree","aria-expanded":W,"aria-disabled":p,"aria-label":m,"aria-labelledby":e.ariaLabelledBy,"aria-describedby":e.ariaDescribedBy?e.ariaDescribedBy:"tagslist-"+n,"aria-required":e.required,onClick:p?void 0:Et},a.createElement("div",{id:"tagslist-"+n,className:d.classNames("k-input-values k-chip-list k-selection-multiple",{[`k-chip-list-${vs[ce]||ce}`]:ce})},j.length>0&&a.createElement(Ht,{tag:e.tag,onTagDelete:jt,data:j,guid:n,focused:oe?R.current.find(I=>pt(I,oe,h)):void 0,size:ce})),a.createElement("span",{className:"k-input-inner"},j.length===0&&a.createElement("span",{className:"k-input-value-text"},v)),e.loading&&a.createElement(d.IconWrap,{className:"k-input-loading-icon",name:"loading"}),Ne&&!p&&j.length>0&&a.createElement(et,{onClick:lt}),a.createElement("select",{name:b,ref:Q,tabIndex:-1,"aria-hidden":!0,title:m,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},a.createElement("option",{value:e.valueMap?e.valueMap.call(void 0,E):E})),!re&&a.createElement(ct.Popup,{popupClass:d.classNames(u.popupClass,"k-multiselecttree-popup"),className:d.classNames(u.className,{"k-rtl":P==="rtl"}),style:yt,animate:u.animate,anchor:q.current,show:W,onOpen:Tt,onClose:Gt,appendTo:u.appendTo,ref:ee},e.filterable&&a.createElement(Ke,{value:e.filter===void 0?A:e.filter,ref:X,onChange:rt,onKeyDown:at,tabIndex:k,size:ce,rounded:x,fillMode:F}),l.length>0?a.createElement(ut.TreeView,{ref:T,tabIndex:k,data:l,focusIdField:h,textField:e.textField,checkField:C,checkIndeterminateField:w,expandField:e.expandField,childrenField:D,expandIcons:!0,onItemClick:Je,onCheckChange:Je,onExpandChange:ot,checkboxes:!0,size:ce,item:e.item,dir:P}):a.createElement(be,null,Se.toLanguageString(ge,ne[ge])))),re&&dt());return m?a.createElement(Ae.FloatingLabel,{label:m,editorValue:Ne,editorPlaceholder:v,editorValid:Oe,editorDisabled:p,editorId:n,style:{width:c?c.width:void 0},children:ue,dir:P}):ue}),si={opened:o.bool,disabled:o.bool,dir:o.string,tabIndex:o.number,accessKey:o.string,data:o.array,value:o.any,valueMap:o.func,placeholder:o.string,dataItemKey:o.string.isRequired,textField:o.string.isRequired,checkField:o.string,checkIndeterminateField:o.string,expandField:o.string,subItemsField:o.string,className:o.string,style:o.object,label:o.string,validationMessage:o.string,validityStyles:o.bool,valid:o.bool,required:o.bool,name:o.string,id:o.string,ariaLabelledBy:o.string,ariaDescribedBy:o.string,filterable:o.bool,filter:o.string,loading:o.bool,tags:o.arrayOf(o.shape({text:o.string,data:o.arrayOf(o.any)})),popupSettings:o.shape({animate:o.oneOfType([o.bool,o.shape({openDuration:o.number,closeDuration:o.number})]),popupClass:o.string,className:o.string,appendTo:o.any,width:o.oneOfType([o.string,o.number]),height:o.oneOfType([o.string,o.number])}),onOpen:o.func,onClose:o.func,onFocus:o.func,onBlur:o.func,onChange:o.func,onFilterChange:o.func,onExpandChange:o.func,onCancel:o.func,item:o.func,listNoData:o.func,adaptiveTitle:o.string,adaptive:o.bool};xt.displayName="KendoReactMultiSelectTree",xt.defaultProps=Be,xt.propTypes=si;const Ue=(i,t)=>{const e={};return i&&i.length&&i.forEach(s=>{e[t(s)]=!0}),e},ii=(i,t)=>{const{items:e,dataItemKey:s,value:n,subItemsField:l="items",operation:h}=t,u=d.getter(s),c=Ue(n,u);if(h==="clear")return[];if(h==="delete"){const O=Ue(e,u);return n.filter(B=>!O[u(B)])}const r=e[0],p=u(r),f=d.getter(l),g=[...i],v=[];let m=[],b;for(;g.length;){const O=g.pop();if(p===u(O)){m=v.map(B=>B.item),b=O;break}else{v&&v.length&&v[v.length-1].parentPosition===g.length&&v.pop();const B=f(O);B&&B.length&&(v.push({item:O,parentPosition:g.length}),g.push(...B))}}const C=[...f(b)||[]];let w=[];for(;C.length;){const O=C.pop();w.push(O);const B=f(O);B&&B.length&&C.push(...B)}const D=!c[p],_=[];if(D){_.push(...n),_.push(b),_.push(...w.filter(E=>!c[u(E)]));const O=m.filter(E=>!c[u(E)]),B=Ue(_,u);for(let E=O.length-1;E>-1;E--){const K=O[E],S=f(K);if(S.filter(N=>B[u(N)]).length<S.length)break;_.push(K),B[u(K)]=!0}}else{const O=u(b),B=Ue(w,u),E=Ue(m,u);_.push(...n.filter(K=>{const S=u(K);return!B[S]&&O!==S&&!E[S]}))}return _};M.AutoComplete=ns,M.AutoCompletePropsContext=is,M.AutoCompleteWithoutContext=tt,M.ComboBox=Lt,M.ComboBoxPropsContext=ts,M.ComboBoxWithoutContext=Te,M.DropDownList=es,M.DropDownListClassComponent=$e,M.DropDownListPropsContext=Rt,M.DropDownListWithoutContext=$e,M.DropDownTree=qt,M.DropDownTreePropsContext=gs,M.List=Ve,M.ListContainer=Xe,M.ListFilter=Ke,M.ListItem=Pt,M.MultiColumnComboBox=It,M.MultiColumnComboBoxPropsContext=cs,M.MultiSelect=ds,M.MultiSelectPropsContext=rs,M.MultiSelectTree=xt,M.MultiSelectTreePropsContext=ms,M.MultiSelectWithoutContext=it,M.SearchBar=gt,M.TagList=Ht,M.dropdownsMessages=ne,M.findByFieldValue=ws,M.getItemValue=z,M.getMultiSelectTreeValue=ii,M.getValueMap=Ue,M.nodata=ge,M.scrollToItem=Xt,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})});
5
+ (function(M,Qe){typeof exports=="object"&&typeof module!="undefined"?Qe(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-react-labels"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-popup"),require("@progress/kendo-react-inputs"),require("@progress/kendo-react-intl"),require("@progress/kendo-react-buttons"),require("@progress/kendo-react-layout"),require("@progress/kendo-react-treeview")):typeof define=="function"&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-react-labels","@progress/kendo-svg-icons","@progress/kendo-react-popup","@progress/kendo-react-inputs","@progress/kendo-react-intl","@progress/kendo-react-buttons","@progress/kendo-react-layout","@progress/kendo-react-treeview"],Qe):(M=typeof globalThis!="undefined"?globalThis:M||self,Qe(M.KendoReactDropdowns={},M.React,M.PropTypes,M.KendoReactCommon,M.KendoReactLabels,M.KendoSvgIcons,M.KendoReactPopup,M.KendoReactInputs,M.KendoReactIntl,M.KendoReactButtons,M.KendoReactLayout,M.KendoReactTreeview))})(this,function(M,Qe,o,d,Ae,Ie,ct,Jt,xe,Ce,fe,ut){"use strict";"use client";function xs(i){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const e in i)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(t,e,s.get?s:{enumerable:!0,get:()=>i[e]})}}return t.default=i,Object.freeze(t)}const a=xs(Qe);class Xe extends a.Component{render(){const{children:t,width:e,dir:s,itemsCount:n,popupSettings:l}=this.props;return a.createElement(ct.Popup,{style:{width:e,direction:s},contentKey:n&&n.join(),...l},t)}}const Ft=a.forwardRef((i,t)=>{const e=a.useRef(null);return a.useImperativeHandle(t,()=>e.current),a.createElement("div",{className:"k-list-filter"},a.createElement(Jt.TextBox,{...i,ref:e,value:i.value||"",onChange:i.onChange,onKeyDown:i.onKeyDown,tabIndex:i.tabIndex,onClick:s=>s.stopPropagation(),size:i.size,fillMode:i.fillMode,rounded:i.rounded,prefix:()=>a.createElement(Jt.InputPrefix,null,a.createElement(d.IconWrap,{name:"search",icon:Ie.searchIcon}))}))});Ft.propTypes={value:o.oneOfType([o.string,o.number,o.array]),tabIndex:o.number,onChange:o.func,onKeyDown:o.func,size:o.oneOf([null,"small","medium","large"]),rounded:o.oneOf([null,"small","medium","large","full"]),fillMode:o.oneOf([null,"solid","flat","outline"])},Ft.displayName="KendoReactListFilter";const Ke=Ft;class We extends a.Component{render(){const{group:t,groupMode:e,render:s}=this.props,n=a.createElement("div",{className:"k-list-group-sticky-header"},e==="classic"?t:a.createElement("div",{className:"k-list-header-text"},t));return s!==void 0?s.call(void 0,n,this.props):n}}const Y=i=>i!=null,ys=(i,t)=>{for(let e=0;e<i.length;e++)if(i.charAt(e)!==t)return!1;return!0},Ss=(i,t,e)=>{let s=i;return e&&(s=[e].concat(s)),s.slice(t).concat(s.slice(0,t))},Qt=(i,t,e)=>{if(!Y(i))return!1;let s=String(i);return e&&(s=s.toLowerCase()),s.indexOf(t)===0},Xt=(i,t,e,s,n)=>{const l=i.offsetHeight,h=t.children.item(e),u=h.offsetTop+(n?s-i.scrollTop:0),c=h.offsetHeight;if(n){let r=0;u+c>l?r=u+c-l:u<0&&(r=u),r!==0?i.scrollTop+=r:i.scrollTop===0&&s!==0&&(i.scrollTop=s)}else u+c>l+i.scrollTop?i.scrollTop=u+c-l:u<i.scrollTop&&(i.scrollTop-=i.scrollTop-u)},_e=(i,t,e)=>{let s=-1;if(t){t=t.toLowerCase();for(let n=0;n<i.length;n++){const l=(z(i[n],e)||"")+"";if(l&&l.toLowerCase().startsWith(t)){s=n;break}}}return s},Kt=(i,t,e,s=!1)=>{const n=l=>s?l:l.toLowerCase();return i.findIndex(l=>e?n(z(l,e))===n(t):n(t)===n(l.toString()))},z=(i,t)=>{if(t&&Y(i)){const e=t.split(".");let s=i;return e.forEach(n=>{s=s?s[n]:void 0}),s}return i},ws=(i,t,e)=>{if(!i)return;const s=i.findIndex(n=>z(n,t)===e);return i[s]},Es=(i=[],t=[],e)=>{if(i===t)return!0;if(i.length!==t.length)return!1;for(let s=0;s<i.length;s++)if(!L(i[s],t[s],e))return!1;return!0},ht=(i,t,e)=>{t.forEach(s=>{const n=i.findIndex(l=>L(l,s,e));n!==-1&&i.splice(n,1)})},L=(i,t,e)=>i===t||Y(i)===Y(t)&&z(i,e)===z(t,e),Zt=(i,t,e)=>{if(t){const s=Kt(i,t,e,!0);return s!==-1?i[s]:i[_e(i,t,e)]}return i[0]},Cs=(i,t=[],e)=>{let s="";if(i){const n=t[_e(t,i,e)];if(n){const l=z(n,e);i.toLowerCase()!==l.toLowerCase()&&(s=l.substring(i.length))}}return s},ks=i=>{i.target.nodeName!=="INPUT"&&i.preventDefault()},pt=(i,t,e)=>!!i!=!!t||i.text!==t.text?!1:i===t||Es(i.data,t.data,e),Ds=i=>i.preventDefault();class Fs extends a.Component{render(){const{selected:t,defaultItem:e,textField:s}=this.props;return a.createElement("div",{onClick:this.props.onClick,onMouseDown:Ds,style:{position:"unset"},className:d.classNames("k-list-optionlabel",{"k-selected":t})},z(e,s)||"")}}class Pt extends a.Component{constructor(){super(...arguments),this.handleClick=t=>this.props.onClick(this.props.index,t)}render(){const{selected:t,group:e,dataItem:s,virtual:n,groupMode:l,disabled:h,render:u}=this.props,c=a.createElement("li",{id:this.props.id,role:"option","aria-selected":t,"aria-disabled":h?!0:void 0,className:d.classNames("k-list-item",{"k-selected":t,"k-focus":this.props.focused,"k-first":!!e&&l==="classic","k-disabled":h}),onClick:this.handleClick,style:{position:n?"relative":"unset"}},a.createElement("span",{className:"k-list-item-text"},z(s,this.props.textField).toString()),e!==void 0&&l==="classic"?a.createElement("div",{className:"k-list-item-group-label"},e):null);return u!==void 0?u.call(void 0,c,this.props):c}}class Ks extends a.Component{render(){const{group:t,virtual:e,render:s,isMultiColumn:n=!1}=this.props,l=a.createElement("li",{id:this.props.id,role:"group",className:n?"k-table-group-row":"k-list-group-item",style:n?{boxSizing:"inherit"}:{position:e?"relative":"unset"}},a.createElement("span",{className:s?void 0:n?"k-table-th":"k-list-item-text"},t));return s!==void 0?s.call(void 0,l,this.props):l}}const ge="dropdowns.nodata",Ze="dropdowns.clear",Mt="dropdowns.comboArrowBtnAriaLabelExpand",Nt="dropdowns.comboArrowBtnAriaLabelCollapse",Ot="dropdowns.dropDownListArrowBtnAriaLabel",Pe="dropdowns.apply",Re="dropdowns.cancel",ne={[Ze]:"clear",[ge]:"NO DATA FOUND.",[Mt]:"expand combobox",[Nt]:"collapse combobox",[Ot]:"select",[Pe]:"Apply",[Re]:"Cancel"};class Ve extends a.Component{renderItems(){const{textField:t,valueField:e,groupField:s,groupMode:n,isMultiColumn:l,optionsGuid:h,skip:u=0,virtual:c,focusedIndex:r,highlightSelected:p=!0,value:f,data:g,itemRender:v,groupHeaderItemRender:m}=this.props,b=Array.isArray(f);let C=0;return g.map((w,D)=>{const _=u+D,O=u+D+C,B=w.disabled?!1:p&&(!b&&L(w,f,e)||b&&f.findIndex(k=>L(k,w,e))!==-1);let E,K,S;return D>0&&s!==void 0&&(K=z(w,s),S=z(g[D-1],s),K&&S&&K!==S&&(E=K)),E!==void 0&&n==="modern"&&(C+=1),[E!==void 0&&n==="modern"&&a.createElement(Ks,{id:`option-${h}-${O}`,virtual:c,key:_+"-group-item",group:E,isMultiColumn:l,render:m}),a.createElement(Pt,{id:`option-${h}-${E!==void 0&&n==="modern"?O+1:O}`,virtual:c,dataItem:w,groupMode:n,selected:B,focused:r===D,index:_,key:_,onClick:this.props.onClick,textField:t,group:E,render:v,disabled:w.disabled})]})}renderNoValueElement(t){const e=this.props.noDataRender,s=a.createElement("div",{className:"k-nodata"},a.createElement("div",null,t.toLanguageString(ge,ne[ge])));return e?e.call(void 0,s):s}render(){const t=xe.provideLocalizationService(this),{id:e,show:s,wrapperCssClass:n,wrapperStyle:l,listStyle:h,listRef:u,wrapperRef:c,listClassName:r="k-list-ul",ariaSetSize:p}=this.props,f=this.renderItems();return f.length?a.createElement("div",{className:n,style:l,ref:c,onMouseDown:this.props.onMouseDown,onBlur:this.props.onBlur,onScroll:this.props.onScroll,unselectable:"on"},a.createElement("ul",{id:e,role:"listbox","aria-hidden":s?void 0:!0,"aria-setsize":p,className:r,ref:u,style:h},f),this.props.scroller&&a.createElement("div",{className:"k-height-container"},this.props.scroller)):this.renderNoValueElement(t)}}xe.registerForLocalization(Ve);const Ms=1533915;class Ns{constructor(){this.container=null,this.scrollElement=null,this.list=null,this.containerHeight=0,this.skip=0,this.total=0,this.enabled=!1,this.pageSize=0,this.itemHeight=0,this.PageChange=null,this.prevScrollPos=0,this.listTranslate=0,this.scrollSyncing=!1,this.scrollerRef=t=>{const e=this;e.container=t,t&&(t.setAttribute("unselectable","on"),window.setTimeout(e.calcScrollElementHeight.bind(e),0))},this.calcScrollElementHeight=()=>{this.scrollSyncing=!0;let t=!1;this.itemHeight=this.list?this.list.children[0].offsetHeight:this.itemHeight,this.containerHeight=Math.min(Ms,this.itemHeight*this.total);const e=this.containerHeight;return this.scrollElement&&(t=this.scrollElement.style.height!==e+"px",t&&(this.scrollElement.style.height=e+"px")),this.scrollSyncing=!1,t},this.scrollHandler=this.scrollHandler.bind(this)}get translate(){return this.listTranslate}changePage(t,e){const s=Math.min(Math.max(0,t),this.total-this.pageSize);s!==this.skip&&this.PageChange&&this.PageChange({skip:s,take:this.pageSize},e)}translateTo(t){this.listTranslate=t,this.list&&(this.list.style.transform="translateY("+t+"px)")}reset(){this.container&&(this.calcScrollElementHeight(),this.container.scrollTop=0,this.translateTo(0))}scrollToEnd(){this.container&&this.list&&(this.calcScrollElementHeight(),this.container.scrollTop=this.container.scrollHeight-this.container.offsetHeight,this.translateTo(this.container.scrollHeight))}localScrollUp(t){const e=this.itemHeight,s=this.container.scrollTop;let n=this.listTranslate,l,h=s-n;if(!(h>e)){for(l=0;l<this.skip&&!(n+e+h<=s);l++)n-=e;if(n=this.validateTranslate(n),this.skip-l<=0&&n>=s){this.translateTo(0),this.changePage(0,t),this.container.scrollTop=0;return}n!==this.listTranslate&&(this.translateTo(n),this.changePage(this.skip-l,t))}}localScrollDown(t){const e=this.itemHeight;let s=this.container.scrollTop,n=this.listTranslate;const l=this.list.children.length;let h;for(h=0;h<l&&!(n+e>=s);h++)n+=e;n=this.validateTranslate(n),h>=l&&this.skip+h>=this.total?(this.translateTo(n),this.changePage(this.total-1,t)):n!==this.listTranslate&&(this.translateTo(n),this.changePage(this.skip+h,t))}scrollNonStrict(t){const e=this.total*this.prevScrollPos/this.containerHeight,s=Math.min(Math.floor(e),this.total-1);let n=this.containerHeight*e/this.total;n=this.validateTranslate(n),this.translateTo(n),this.changePage(s,t)}scrollHandler(t){const e=this.container?this.container.scrollTop:0,s=this.prevScrollPos;this.prevScrollPos=e,!(!this.enabled||!this.list||!this.container||this.scrollSyncing)&&(e-s<=0&&e>this.listTranslate-this.list.scrollHeight/10?this.localScrollUp(t):e-s>0&&e<this.listTranslate+this.list.scrollHeight*2/3?this.localScrollDown(t):this.scrollNonStrict(t))}validateTranslate(t){return t=Math.max(0,t),t=Math.min(this.containerHeight,t),t}}class Os{navigate(t){const e=t.keyCode;if(e===d.Keys.up||e===d.Keys.left)return this.next({current:t.current,min:t.min,max:t.max,step:t.skipItems?t.skipItems:-1});if(e===d.Keys.down||e===d.Keys.right)return this.next({current:t.current,min:t.min,max:t.max,step:t.skipItems?t.skipItems:1});if(e===d.Keys.home)return 0;if(e===d.Keys.end)return t.max}next(t){return Y(t.current)?Math.min(t.max,Math.max(t.current+t.step,t.min)):t.min}}const _t=class{constructor(i){this.wrapper=null,this.list=null,this.vs=new Ns,this.navigation=new Os,this.handleItemClick=(t,e)=>{const s=this.initState();s.syntheticEvent=e,e.stopPropagation(),this.component.handleItemSelect(t,s),this.togglePopup(s),this.applyState(s)},this.handleFocus=t=>{if(!this.component.state.focused){const e=this.initState();e.data.focused=!0,e.events.push({type:"onFocus"}),e.syntheticEvent=t,this.applyState(e)}},this.filterChanged=(t,e)=>{const{textField:s,filterable:n}=this.component.props;n&&e.events.push({type:"onFilterChange",filter:{field:s,operator:"contains",ignoreCase:!0,value:t}})},this.togglePopup=t=>{const e=this.component.props,s=e.opened!==void 0?e.opened:this.component.state.opened;e.opened===void 0&&(t.data.opened=!s),s?t.events.push({type:"onClose"}):(t.events.push({type:"onOpen"}),this.calculatePopupWidth())},this.pageChange=(t,e)=>{const s=this.initState();s.syntheticEvent=e,this.triggerOnPageChange(s,t.skip,t.take),this.applyState(s)},this.scrollToVirtualItem=(t,e)=>{const s=this.vs;if(s.enabled=!1,t.skip===0)s.reset();else if(t.skip+t.pageSize===t.total)s.scrollToEnd();else{let n=s.translate;n===0&&(s.calcScrollElementHeight(),n=s.itemHeight*t.skip,s.translateTo(n-s.itemHeight)),s.container&&(s.container.scrollTop=n),this.scrollToItem(e,!0)}window.setTimeout(()=>s.enabled=!0,10)},this.scrollPopupByPageSize=t=>{var h,u,c,r,p,f;const e=this.vs,s=(u=(h=this.list)==null?void 0:h.parentElement)==null?void 0:u.scrollTop,n=e.enabled&&e.itemHeight?e.itemHeight:this.list?this.list.children[0].offsetHeight:0,l=(r=(c=this.list)==null?void 0:c.parentElement)==null?void 0:r.offsetHeight;s!==void 0&&l!==void 0&&((f=(p=this.list)==null?void 0:p.parentElement)==null||f.scroll({top:s+t*Math.floor(l/n)*n}))},this.renderScrollElement=()=>{const t=this.vs;return t.enabled&&a.createElement("div",{ref:e=>t.scrollElement=e,key:"scrollElementKey"})},this.resetGroupStickyHeader=(t,e)=>{t!==e.state.group&&e.setState({...e.state,group:t})},this.listBoxId=i.props.id+"list",this.guid=i.props.id,this.component=i,this.vs.PageChange=this.pageChange}didMount(){const i=this.component.props,t=i.popupSettings||{},e=i.style||{},s=t.width;let n=i.opened===!0;s===void 0&&this.calculatePopupWidth(),i.dir===void 0&&e.direction===void 0&&(this.calculateDir(),n=!0),n&&this.component.forceUpdate()}calculateDir(){const i=this.component.element;i&&i.ownerDocument&&i.ownerDocument.defaultView&&(this.dirCalculated=i.ownerDocument.defaultView.getComputedStyle(i).direction||void 0)}calculatePopupWidth(){this.wrapper&&(this.popupWidth=this.wrapper.offsetWidth+"px")}scrollToItem(i,t,e){const s=this.list||this.vs.list;if(!s&&!e&&setTimeout(()=>{this.scrollToItem(i,t,!0)},10),s&&i>=0){const n=this.vs,l=n.container||s.parentNode,h=t!==void 0?t:n.enabled;Xt(l,s,i,n.translate,h)}}initState(){return{data:{},events:[],syntheticEvent:void 0}}applyState(i){Object.keys(i.data).length>0&&this.component.setState(i.data);const t={syntheticEvent:i.syntheticEvent,nativeEvent:i.syntheticEvent?i.syntheticEvent.nativeEvent:void 0,target:this.component,value:this.component.value};i.events.forEach(e=>{const s=e.type;delete e.type;const n=s&&this.component.props[s];n&&n.call(void 0,{...t,...e})})}triggerOnPageChange(i,t,e){const s=this.component.props.virtual;if(s){const n=Math.min(Math.max(0,t),Math.max(0,s.total-e));n!==s.skip&&i.events.push({type:"onPageChange",page:{skip:n,take:e}})}}triggerPageChangeCornerItems(i,t){const e=this.component.props,{data:s=[],dataItemKey:n,virtual:l}=e,h=e.opened!==void 0?e.opened:this.component.state.opened;i&&l&&this.vs.enabled&&(l.skip>0&&L(i,s[0],n)?this.triggerOnPageChange(t,l.skip-1,l.pageSize):!h&&l.skip+l.pageSize<l.total&&L(i,s[s.length-1],n)&&this.triggerOnPageChange(t,l.skip+1,l.pageSize))}getPopupSettings(){return Object.assign({},_t.defaultProps.popupSettings,this.component.props.popupSettings)}getGroupedDataModernMode(i,t){let e=[];return i.forEach((s,n)=>{i[n-1]&&s[t]!==i[n-1][t]&&e.push({[t]:s[t]}),e.push(i[n])}),e}};let ae=_t;ae.basicPropTypes={opened:o.bool,disabled:o.bool,dir:o.string,tabIndex:o.number,accessKey:o.string,data:o.array,textField:o.string,className:o.string,label:o.string,loading:o.bool,popupSettings:o.shape({animate:o.oneOfType([o.bool,o.shape({openDuration:o.number,closeDuration:o.number})]),popupClass:o.string,className:o.string,appendTo:o.any,width:o.oneOfType([o.string,o.number]),height:o.oneOfType([o.string,o.number])}),onOpen:o.func,onClose:o.func,onFocus:o.func,onBlur:o.func,onChange:o.func,itemRender:o.func,listNoDataRender:o.func,focusedItemIndex:o.func,header:o.node,footer:o.node},ae.propTypes={..._t.basicPropTypes,value:o.any,defaultValue:o.any,filterable:o.bool,filter:o.string,virtual:o.shape({pageSize:o.number.isRequired,skip:o.number.isRequired,total:o.number.isRequired}),onFilterChange:o.func,onPageChange:o.func},ae.defaultProps={popupSettings:{height:"200px"},required:!1,validityStyles:!0};const qe={name:"@progress/kendo-react-dropdowns",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:1654528156,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"},ft=500,ke=768,_s="Please select a value from the list!",{sizeMap:Vt,roundedMap:Vs}=d.kendoThemeMaps,Bt=class extends a.Component{constructor(i){super(i),this.state={},this._element=null,this.base=new ae(this),this.searchState={word:"",last:""},this._select=null,this._skipFocusEvent=!1,this._filterInput=null,this._navigated=!1,this._lastKeypressIsFilter=!1,this.itemHeight=0,this.focus=()=>{this.base.wrapper&&this.base.wrapper.focus()},this.handleItemSelect=(t,e)=>{const{data:s=[],virtual:n,dataItemKey:l,defaultItem:h}=this.props,u=n?n.skip:0,c=t===-1&&h!==void 0?h:s[t-u],r=!L(c,this.value,l);this.triggerOnChange(c,e),r&&this.base.triggerPageChangeCornerItems(c,e)},this.componentRef=t=>{this._element=t,this.base.wrapper=t},this.dummySelect=t=>a.createElement("select",{name:this.props.name,ref:e=>{this._select=e},tabIndex:-1,"aria-hidden":!0,title:this.props.label,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},a.createElement("option",{value:this.props.valueMap?this.props.valueMap.call(void 0,t):t})),this.renderListContainer=()=>{const{header:t,footer:e,dir:s,data:n=[],size:l,groupField:h,groupStickyHeaderItemRender:u,list:c}=this.props,r=this.base,p=r.getPopupSettings(),f=this.props.opened!==void 0?this.props.opened:this.state.opened,g=p.width!==void 0?p.width:r.popupWidth,v={dir:s!==void 0?s:r.dirCalculated,width:g,popupSettings:{popupClass:d.classNames(p.popupClass,"k-list-container","k-dropdownlist-popup"),className:p.className,animate:p.animate,anchor:this.element,show:f,onOpen:this.onPopupOpened,onClose:this.onPopupClosed,appendTo:p.appendTo},itemsCount:[n.length]};let{group:m}=this.state;return m===void 0&&h!==void 0&&(m=z(n[0],h)),a.createElement(Xe,{...v},this.renderListFilter(),t&&a.createElement("div",{className:"k-list-header"},t),a.createElement("div",{className:d.classNames("k-list",{[`k-list-${Vt[l]||l}`]:l,"k-virtual-list":this.base.vs.enabled})},this.renderDefaultItem(),!c&&m&&n.length!==0&&a.createElement(We,{group:m,groupMode:"modern",render:u}),this.renderList()),e&&a.createElement("div",{className:"k-list-footer"},e))},this.renderList=()=>{const{data:t=[],textField:e,dataItemKey:s,virtual:n={skip:0,total:void 0},groupHeaderItemRender:l,listNoDataRender:h,itemRender:u}=this.props,c=this.base.vs,r=n.skip,p=this.props.opened!==void 0?this.props.opened:this.state.opened,f=this.base.getPopupSettings(),g=`translateY(${c.translate}px)`;return a.createElement(Ve,{id:this._listboxId,show:p,data:t.slice(),focusedIndex:this.getFocusedIndex(),value:this.value,textField:e,valueField:s,optionsGuid:this._guid,groupField:this.props.groupField,groupMode:"modern",listRef:v=>c.list=this.base.list=v,wrapperStyle:{maxHeight:f.height},wrapperCssClass:"k-list-content",listStyle:c.enabled?{transform:g}:void 0,key:"listkey",skip:r,onClick:this.handleItemClick,itemRender:u,groupHeaderItemRender:l,noDataRender:h,onScroll:this.onScroll,wrapperRef:c.scrollerRef,scroller:this.base.renderScrollElement(),ariaSetSize:n.total})},this.onScroll=t=>{const{vs:e,list:s}=this.base;e.scrollHandler(t);const{groupField:n}=this.props;let{data:l=[]}=this.props;if(!(!n||!l.length)&&n){const h=this.itemHeight=this.itemHeight||(e.enabled?e.itemHeight:s?s.children[0].offsetHeight:0),c=t.target.scrollTop-e.skip*h;l=this.base.getGroupedDataModernMode(l,n);let r=l[0][n];for(let p=1;p<l.length&&!(h*p>c);p++)l[p]&&l[p][n]&&(r=l[p][n]);r!==this.state.group&&this.setState({group:r})}},this.renderListFilter=()=>{const t=this.props.filter!==void 0?this.props.filter:this.state.text;return this.props.filterable&&a.createElement(Ke,{value:t,ref:e=>this._filterInput=e&&e.element,onChange:this.handleListFilterChange,onKeyDown:this.handleKeyDown,size:this.props.size,rounded:this.props.rounded,fillMode:this.props.fillMode})},this.renderDefaultItem=()=>{const{textField:t,defaultItem:e,dataItemKey:s}=this.props;return e!==void 0&&a.createElement(Fs,{defaultItem:e,textField:t,selected:L(this.value,e,s),key:"defaultitemkey",onClick:this.handleDefaultItemClick})},this.search=t=>{clearTimeout(this._typingTimeout),this.props.filterable||(this._typingTimeout=window.setTimeout(()=>this.searchState.word="",this.props.delay),this.selectNext(t))},this.selectNext=t=>{const{data:e=[],dataItemKey:s}=this.props;let n=e.map((w,D)=>({item:w,itemIndex:D}));const l=this.searchState.word,h=this.searchState.last,u=ys(l,h);let c=n.length,r=Math.max(0,e.findIndex(w=>L(w,this.value,s))),p;this.props.defaultItem&&(p={item:this.props.defaultItem,itemIndex:-1},c+=1,r+=1),r+=u?1:0,n=Ss(n,r,p);let f,g,v,m=0;const{textField:b,ignoreCase:C}=this.props;for(;m<c;m++)if(f=z(n[m].item,b),g=u&&Qt(f,h,C),v=Qt(f,l,C),g||v){m=n[m].itemIndex;break}if(m!==c){const w=this.base.initState();w.syntheticEvent=t,this.handleItemSelect(m,w),this.applyState(w),this._valueDuringOnChange=void 0}},this.handleKeyDown=t=>{t&&t.target instanceof Element&&t.target.nodeName==="INPUT"&&t.stopPropagation&&t.stopPropagation();const{data:e=[],filterable:s,disabled:n,defaultItem:l,leftRightKeysNavigation:h=!0,virtual:u={skip:0,total:0,pageSize:0},dataItemKey:c,groupField:r="",textField:p,skipDisabledItems:f=!0}=this.props,g=this.value,v=e.findIndex(K=>L(K,g,c)),m=this.props.opened!==void 0?this.props.opened:this.state.opened,b=t.keyCode,C=b===d.Keys.home||b===d.Keys.end,w=b===d.Keys.up||b===d.Keys.down,D=!m&&(t.altKey&&b===d.Keys.down||b===d.Keys.enter||b===d.Keys.space),_=m&&(t.altKey&&b===d.Keys.up||b===d.Keys.esc),O=h&&(b===d.Keys.left||b===d.Keys.right),B=w||O&&!s||C,E=this.base.initState();if(E.syntheticEvent=t,!n){if(C&&this.base.vs.enabled)b===d.Keys.home?u.skip!==0?(this.base.triggerOnPageChange(E,0,u.pageSize),this._navigated=!0):this.triggerOnChange(e[0],E):u.skip<u.total-u.pageSize?(this.base.triggerOnPageChange(E,u.total-u.pageSize,u.pageSize),this._navigated=!0):this.triggerOnChange(e[e.length-1],E);else if(m&&b===d.Keys.pageUp)this.base.scrollPopupByPageSize(-1);else if(m&&b===d.Keys.pageDown)this.base.scrollPopupByPageSize(1);else if(m&&b===d.Keys.enter){const K=this.getFocusedIndex();this.haveFocusedItemAndDataNotEmpty(e,K)?(this.triggerOnChange(null,E),this.applyState(E)):this.handleItemSelect(K,E),this.base.togglePopup(E),t.preventDefault()}else if(D||_)_&&this.resetValueIfDisabledItem(),this.base.togglePopup(E),t.preventDefault();else if(B){if(this._lastKeypressIsFilter=!1,r!==""&&p)if(!f&&m)this.onNavigate(E,b);else{let K;if(b===d.Keys.down||b===d.Keys.right){const S=e.slice(v+1).find(k=>!k.disabled&&k[p]);K=S&&e.findIndex(k=>k[p]===S[p])}else if(b===d.Keys.up||b===d.Keys.left){let S;if(v===0&&l)K=-1;else if(v===-1)S=e,K=e.findIndex(k=>!k.disabled&&k[p]);else{S=e.slice(0,v);let k=S.pop();for(;k&&k.disabled;)k=S.pop();K=k&&e.findIndex(N=>N[p]===k[p])}}if(K!==void 0){const S=K-v;this.onNavigate(E,b,S)}else K===void 0&&e.findIndex(S=>S[p]===g[p])===e.length-1&&this.onNavigate(E,b)}else if(!f&&m||C)this.onNavigate(E,b);else if(p){let K;if(b===d.Keys.down||b===d.Keys.right){const S=e.slice(v+1).find(k=>!k.disabled&&k[p]);K=S&&e.findIndex(k=>k[p]===S[p])}else if(b===d.Keys.up||b===d.Keys.left){let S;if(v===0&&l)K=-1;else if(v===-1)S=e,K=e.find(k=>!k.disabled&&k[p]);else{S=e.slice(0,v);let k=S.pop();for(;k&&k.disabled;)k=S.pop();K=k&&e.findIndex(N=>N[p]===k[p])}}if(K!==void 0){const S=K-v;this.onNavigate(E,b,S)}else K===void 0&&e.findIndex(S=>S[p]===g[p])===e.length-1&&this.onNavigate(E,b)}else this.onNavigate(E,b);t.preventDefault()}this.applyState(E)}},this.handleItemClick=(t,e)=>{this.base.handleItemClick(t,e),this._valueDuringOnChange=void 0},this.handleFocus=t=>{this._skipFocusEvent||this.base.handleFocus(t)},this.handleBlur=t=>{if(this._skipFocusEvent||!this.state.focused)return;const e=this.props.opened!==void 0?this.props.opened:this.state.opened,{adaptive:s}=this.props,{windowWidth:n=0}=this.state,l=n<=ke&&s,h=this.base.initState();h.syntheticEvent=t,h.data.focused=!1,h.events.push({type:"onBlur"}),e&&this.resetValueIfDisabledItem(),e&&!l&&this.base.togglePopup(h),this.applyState(h)},this.handleDefaultItemClick=t=>{const e=this.base.initState();e.syntheticEvent=t,this.base.togglePopup(e),this.triggerOnChange(this.props.defaultItem,e),this.applyState(e)},this.handleWrapperClick=t=>{if(t.isPropagationStopped())return;const e=this.base.initState();e.syntheticEvent=t,this.state.focused||(e.data.focused=!0),this.resetValueIfDisabledItem(),this.base.togglePopup(e),this.applyState(e)},this.handleKeyPress=t=>{if(this.props.filterable||t.which===0||t.keyCode===d.Keys.enter)return;let e=String.fromCharCode(t.charCode||t.keyCode);this.props.ignoreCase&&(e=e.toLowerCase()),e===" "&&t.preventDefault(),this.searchState={word:this.searchState.word+e,last:this.searchState.last+e},this.search(t)},this.handleListFilterChange=t=>{const e=this.base.initState();e.syntheticEvent=t.syntheticEvent,this.props.filter===void 0&&(e.data.text=t.target.value),this.base.filterChanged(t.target.value,e),this._lastKeypressIsFilter=!0,this.applyState(e),this.setState({group:void 0})},this.onPopupOpened=()=>{this._filterInput&&this.focusElement(this._filterInput),this.props.adaptive&&setTimeout(()=>{this._filterInput&&this.focusElement(this._filterInput)},300)},this.onPopupClosed=()=>{this.state.focused&&window.setTimeout(()=>{this.state.focused&&this.base.wrapper&&this.focusElement(this.base.wrapper)})},this.setValidity=()=>{this._select&&this._select.setCustomValidity&&this._select.setCustomValidity(this.validity.valid?"":this.props.validationMessage||_s)},d.validatePackage(qe)}get _inputId(){return this.props.id+"-accessibility-id"}get _listboxId(){return this.props.id+"-listbox-id"}get _guid(){return this.props.id+"-guid"}get document(){if(d.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get value(){let i;return this._valueDuringOnChange!==void 0?i=this._valueDuringOnChange:this.props.value!==void 0?i=this.props.value:this.state.value!==void 0?i=this.state.value:this.props.defaultValue!==void 0&&(i=this.props.defaultValue),!Y(i)&&this.props.defaultItem!==void 0&&(i=this.props.defaultItem),i}get index(){const{data:i=[],dataItemKey:t}=this.props,e=this.value;return i.findIndex(s=>L(s,e,t))}get name(){return this.props.name}get validity(){const i=this.props.validationMessage!==void 0,t=!this.required||this.value!==null&&this.value!==""&&this.value!==void 0,e=this.props.valid!==void 0?this.props.valid:t;return{customError:i,valid:e,valueMissing:this.value===null}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:Bt.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:Bt.defaultProps.required}componentDidUpdate(i,t){var f;const{dataItemKey:e,virtual:s,groupField:n="",textField:l}=this.props;let{data:h=[]}=this.props;const u=i.virtual?i.virtual.total:0,c=this.props.opened!==void 0?this.props.opened:this.state.opened,r=i.opened!==void 0?i.opened:t.opened,p=!r&&c;if(this.base.getPopupSettings().animate||p&&this.onPopupOpened(),s&&s.total!==u)this.base.vs.calcScrollElementHeight(),this.base.vs.reset();else{const g=this.value,v=i.value!==void 0?i.value:t.value;let m=h.findIndex(C=>L(C,g,e));n!==""&&g&&l&&(m=(f=this.base.getGroupedDataModernMode(h,n))==null?void 0:f.map(C=>C[l]).indexOf(g[l]));const b=!L(v,g,e);p&&s?this.base.scrollToVirtualItem(s,m):p&&!s?(this.onPopupOpened(),h&&h.length!==0&&this.base.resetGroupStickyHeader(h[0][n],this),this.base.scrollToItem(m)):c&&r&&g&&b&&!this._navigated?this.base.scrollToItem(m):c&&r&&this._navigated&&(this._navigated&&s&&s.skip===0?this.base.vs.reset():this._navigated&&s&&s.skip===s.total-s.pageSize&&this.base.vs.scrollToEnd())}this._navigated=!1,this.setValidity()}componentDidMount(){var i;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.base.didMount(),this.setValidity(),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentWillUnmount(){var i;(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.disconnect()}render(){const i=xe.provideLocalizationService(this).toLanguageString(Ot,ne[Ot]),{style:t,className:e,label:s,dir:n,virtual:l,size:h,rounded:u,fillMode:c,adaptive:r}=this.props,{windowWidth:p=0}=this.state,f=this.props.opened!==void 0?this.props.opened:this.state.opened,g=this.value,v=z(g,this.props.textField),m=!this.validityStyles||this.validity.valid,b=this.base,C=b.vs,w=p<=ke&&r;C.enabled=l!==void 0,l!==void 0&&(b.vs.skip=l.skip,b.vs.total=l.total,b.vs.pageSize=l.pageSize);const{dataItemKey:D,data:_=[],disabled:O,tabIndex:B,loading:E,iconClassName:K,valueRender:S}=this.props,{focused:k}=this.state,N=_.findIndex(Q=>L(Q,g,D)),q=a.createElement("span",{id:this._inputId,className:"k-input-inner"},a.createElement("span",{className:"k-input-value-text"},v)),X=S!==void 0?S.call(void 0,q,g):q,J=a.createElement(a.Fragment,null,a.createElement("span",{ref:this.componentRef,className:d.classNames("k-dropdownlist k-picker",e,{[`k-picker-${Vt[h]||h}`]:h,[`k-rounded-${Vs[u]||u}`]:u,[`k-picker-${c}`]:c,"k-focus":k,"k-disabled":O,"k-invalid":!m,"k-loading":E,"k-required":this.required}),style:s?{...t,width:void 0}:t,dir:n,onMouseDown:f?Q=>{Q.target.nodeName!=="INPUT"&&(this.focusElement(this.base.wrapper),Q.preventDefault())}:void 0,onFocus:this.handleFocus,onBlur:this.handleBlur,tabIndex:d.getTabIndex(B,O),accessKey:this.props.accessKey,onKeyDown:this.handleKeyDown,onKeyPress:this.handleKeyPress,onClick:O?void 0:this.handleWrapperClick,role:"combobox","aria-required":this.required,"aria-disabled":O||void 0,"aria-haspopup":"listbox","aria-expanded":f||!1,"aria-owns":this._listboxId,"aria-activedescendant":f?"option-"+this._guid+"-"+(N+(l?l.skip:0)):void 0,"aria-label":this.props.ariaLabel||this.props.label,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy||this._inputId,id:this.props.id,title:this.props.title},X,E&&a.createElement(d.IconWrap,{className:"k-input-loading-icon",name:"loading"}),a.createElement(Ce.Button,{tabIndex:-1,type:"button","aria-label":i,"aria-hidden":!0,size:h,fillMode:c,iconClass:K,className:"k-input-button",rounded:null,themeColor:"base",icon:K?void 0:"caret-alt-down",svgIcon:K?this.props.svgIcon:Ie.caretAltDownIcon,onMouseDown:Q=>this.state.focused&&Q.preventDefault()}),this.dummySelect(g),!w&&this.renderListContainer()),w&&this.renderAdaptiveListContainer());return s?a.createElement(Ae.FloatingLabel,{label:s,editorValue:v,editorValid:m,editorDisabled:this.props.disabled,style:{width:t?t.width:void 0},children:J}):J}onNavigate(i,t,e){const{data:s=[],defaultItem:n,dataItemKey:l,virtual:h={skip:0,total:0,pageSize:0}}=this.props,u=this.base.vs,c=this.value,r=s.findIndex(f=>L(f,c,l)),p=this.base.navigation.navigate({current:h.skip+r,max:(u.enabled?h.total:s.length)-1,min:n!==void 0?-1:0,keyCode:t,skipItems:e||void 0});p!==void 0&&this.handleItemSelect(p,i),this.applyState(i)}renderAdaptiveListContainer(){const{windowWidth:i=0}=this.state,{header:t,footer:e,size:s,adaptiveTitle:n,groupField:l,groupStickyHeaderItemRender:h,list:u,data:c=[]}=this.props,r=this.props.opened!==void 0?this.props.opened:this.state.opened,p={navigatable:!1,navigatableElements:[],expand:r,animation:!0,onClose:g=>this.handleWrapperClick(g),animationStyles:i<=ft?{top:0,width:"100%",height:"100%"}:void 0,className:i<=ft?"k-adaptive-actionsheet k-actionsheet-fullscreen":"k-adaptive-actionsheet k-actionsheet-bottom"};let{group:f}=this.state;return f===void 0&&l!==void 0&&(f=z(c[0],l)),a.createElement(a.Fragment,null,a.createElement(fe.ActionSheet,{...p},a.createElement(fe.ActionSheetHeader,{className:"k-text-center"},a.createElement("div",{className:"k-actionsheet-titlebar-group k-hbox"},a.createElement("div",{className:"k-actionsheet-title"},a.createElement("div",null,n)),a.createElement("div",{className:"k-actionsheet-actions"},a.createElement(Ce.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",onClick:this.handleWrapperClick,icon:"x",svgIcon:Ie.xIcon}))),a.createElement("div",{className:"k-actionsheet-titlebar-group k-actionsheet-filter"},this.renderListFilter())),a.createElement(fe.ActionSheetContent,{className:"!k-overflow-hidden"},t&&a.createElement("div",{className:"k-list-header"},t),a.createElement("div",{className:d.classNames("k-list",{[`k-list-${Vt[s]||s}`]:s,"k-virtual-list":this.base.vs.enabled})},this.renderDefaultItem(),!u&&f&&c.length!==0&&a.createElement(We,{group:f,groupMode:"modern",render:h}),this.renderList()),e&&a.createElement("div",{className:"k-list-footer"},e))))}getFocusedIndex(){const i=this.value,{data:t=[],textField:e,dataItemKey:s,virtual:n={skip:0},focusedItemIndex:l=_e,filterable:h,skipDisabledItems:u=!0}=this.props,c=this.props.filter?this.props.filter:this.state.text;return u&&e&&!c&&!i?t.findIndex(r=>!r.disabled&&r[e]):Y(i)&&c===void 0||h&&c===""?t.findIndex(r=>L(r,i,s)):c?this._lastKeypressIsFilter?l(t,c,e):t.findIndex(r=>L(r,i,s)):n.skip===0?0:-1}focusElement(i){this._skipFocusEvent=!0,i.focus(),window.setTimeout(()=>this._skipFocusEvent=!1,30)}triggerOnChange(i,t){L(this.value,i,this.props.dataItemKey)||(this.props.value===void 0&&(t.data.value=i),this._valueDuringOnChange=i,t.events.push({type:"onChange"}))}applyState(i){this.base.applyState(i),this._valueDuringOnChange=void 0}calculateMedia(i){for(let t of i)this.setState({windowWidth:t.target.clientWidth})}resetValueIfDisabledItem(){const{data:i=[]}=this.props,t=this.base.initState(),e=this.getFocusedIndex();this.haveFocusedItemAndDataNotEmpty(i,e)&&(this.triggerOnChange(null,t),this.applyState(t))}haveFocusedItemAndDataNotEmpty(i,t){return t!==void 0&&t!==-1&&i&&i.length>0&&i[t].disabled}};let $e=Bt;$e.displayName="DropDownList",$e.propTypes={delay:o.number,ignoreCase:o.bool,iconClassName:o.string,svgIcon:d.svgIconPropType,defaultItem:o.any,valueRender:o.func,valueMap:o.func,validationMessage:o.string,required:o.bool,id:o.string,ariaLabelledBy:o.string,ariaDescribedBy:o.string,ariaLabel:o.string,leftRightKeysNavigation:o.bool,title:o.string,groupField:o.string,list:o.any,skipDisabledItems:o.bool,...ae.propTypes},$e.defaultProps={delay:500,tabIndex:0,ignoreCase:!0,...ae.defaultProps,required:!1,size:"medium",rounded:"medium",fillMode:"solid",groupMode:"modern"};const Rt=d.createPropsContext(),es=d.withIdHOC(d.withPropsContext(Rt,$e));es.displayName="KendoReactDropDownList";class gt extends a.Component{constructor(){super(...arguments),this._input=null}get input(){return this._input}componentDidUpdate(t){const e=t.value,s=t.suggestedText,{value:n,suggestedText:l,focused:h}=this.props,u=this.input,c=e!==n||l!==s,r=c&&e.startsWith(n)&&!(s&&l&&s.endsWith(l)),p=d.getActiveElement(document);h&&u&&p!==u&&u.focus(),l&&c&&!r&&u&&u.setSelectionRange(n.length-l.length,n.length)}render(){const{expanded:t=!1,disabled:e,role:s="listbox",render:n}=this.props,l=a.createElement("input",{autoComplete:"off",id:this.props.id,type:"text",key:"searchbar",size:this.props.size,placeholder:this.props.placeholder,className:"k-input-inner",tabIndex:this.props.tabIndex,accessKey:this.props.accessKey,role:s,name:this.props.name,value:this.props.value,onChange:this.props.onChange,ref:h=>this._input=h,onKeyDown:this.props.onKeyDown,onFocus:this.props.onFocus,onBlur:this.props.onBlur,onClick:this.props.onClick,"aria-disabled":e||void 0,disabled:e||void 0,readOnly:this.props.readOnly||void 0,title:this.props.title,"aria-haspopup":"listbox","aria-expanded":t,"aria-owns":this.props.owns,"aria-activedescendant":t?this.props.activedescendant:void 0,"aria-describedby":this.props.ariaDescribedBy,"aria-labelledby":this.props.ariaLabelledBy,"aria-required":this.props.ariaRequired});return n?n.call(void 0,l):l}}class et extends a.Component{constructor(){super(...arguments),this.onMouseDown=t=>t.preventDefault()}render(){const t=xe.provideLocalizationService(this).toLanguageString(Ze,ne[Ze]);return a.createElement("span",{className:"k-clear-value",role:"button",onClick:this.props.onClick,onMouseDown:this.onMouseDown,tabIndex:-1,title:t,key:"clearbutton"},a.createElement(d.IconWrap,{name:"x",icon:Ie.xIcon}))}}xe.registerForLocalization(et);const Me=d.useCustomComponent,Bs="Please enter a valid value!",{sizeMap:vt,roundedMap:Ls}=d.kendoThemeMaps,mt=class extends a.Component{constructor(i){super(i),this.state={},this.base=new ae(this),this._element=null,this._suggested="",this._skipBlur=!1,this._input=null,this._adaptiveFilterInput=null,this.itemHeight=0,this.focus=()=>{this._input&&this._input.focus()},this.handleItemSelect=(t,e)=>{const{data:s=[],virtual:n,dataItemKey:l}=this.props,h=n?n.skip:0,u=s[t-h],c=!L(u,this.value,l);this.triggerOnChange(u,e),this.state.text!==void 0&&(e.data.text=void 0),c&&this.base.triggerPageChangeCornerItems(u,e)},this.onPopupOpened=()=>{setTimeout(()=>{this.mobileMode&&this._adaptiveFilterInput&&(this._skipBlur=!0,this._adaptiveFilterInput.focus(),this._skipBlur=!1)},300)},this.componentRef=t=>{this._element=t,this.base.wrapper=t},this.toggleBtnClick=t=>{const{data:e=[],skipDisabledItems:s,textField:n}=this.props,l=this.getFocusedIndex(),h=this.getCurrentValueDisabledStatus(n,e,l),u=this.props.opened!==void 0?this.props.opened:this.state.opened,c=this.base.initState();if(c.syntheticEvent=t,!s&&n&&h&&this.clearValueOnToggleBtnClick(t),this.base.togglePopup(c),!u&&this.mobileMode){const r=this.props.adaptiveFilter!==void 0?this.props.adaptiveFilter:this.state.text||null;this.base.filterChanged(r,c)}this.applyState(c)},this.renderMobileListFilter=()=>{const t=this.props.adaptiveFilter!==void 0?this.props.adaptiveFilter:this.state.text,e=z(this.value,this.props.textField),s=Y(t)?t:e;return a.createElement(Ke,{value:s,ref:n=>this._adaptiveFilterInput=n&&n.element,onChange:this.handleMobileFilterChange,onKeyDown:this.onInputKeyDown,size:this.props.size,rounded:this.props.rounded,fillMode:this.props.fillMode})},this.handleMobileFilterChange=t=>{const e=this.base.initState();e.syntheticEvent=t.syntheticEvent,e.data.text=t.target.value,this.base.filterChanged(t.target.value,e),this.applyState(e)},this.onScroll=t=>{const{vs:e,list:s}=this.base;e.scrollHandler(t);const{groupField:n}=this.props;let{data:l=[]}=this.props;if(!n||!l.length)return;const h=this.itemHeight=this.itemHeight||(e.enabled?e.itemHeight:s?s.children[0].offsetHeight:0),c=t.target.scrollTop-e.skip*h;this.props.groupMode==="modern"&&(l=this.base.getGroupedDataModernMode(l,n));let r=l[0][n];for(let p=1;p<l.length&&!(h*p>c);p++)l[p]&&l[p][n]&&(r=l[p][n]);r!==this.state.group&&(this.setState({group:r}),this.props.onGroupScroll&&this.props.onGroupScroll.call(void 0,{group:r}))},this.handleItemClick=(t,e)=>{this.base.handleItemClick(t,e),this._valueDuringOnChange=void 0},this.handleBlur=t=>{if(this.state.focused&&!this._skipBlur){const e=this.base.initState(),{textField:s,data:n=[]}=this.props,l=this.getFocusedIndex(),u=!(l===-1)&&this.getCurrentValueDisabledStatus(s,n,l);e.data.focused=!1,e.events.push({type:"onBlur"}),e.syntheticEvent=t,s&&u&&this.clearValueOnBlur(t),this.applyValueOnRejectSuggestions(t.currentTarget.value,e)}},this.onInputClick=t=>{const e=this.props.opened!==void 0?this.props.opened:this.state.opened,s=this.props.adaptiveFilter!==void 0?this.props.adaptiveFilter:this.state.text||null;if(!e&&this.mobileMode){const n=this.base.initState();n.syntheticEvent=t,this.base.togglePopup(n),this.base.filterChanged(s,n),this.applyState(n)}},this.onInputKeyDown=t=>{const{data:e=[],skipDisabledItems:s,textField:n,dataItemKey:l,groupField:h}=this.props,u=this.value,c=Math.max(0,e.findIndex(C=>L(C,u,l))),r=t.keyCode,p=this.props.opened!==void 0?this.props.opened:this.state.opened,f=this.base.initState();if(f.syntheticEvent=t,!t.altKey&&(r===d.Keys.up||r===d.Keys.down)){if(t.preventDefault(),h!==""&&n)if(!this.props.skipDisabledItems&&p)this.onNavigate(f,r);else{let C=0;if(r===d.Keys.down||r===d.Keys.right){const w=e.slice(c+1<e.length?c+1:c).find(D=>!D.disabled&&D[n]);C=w&&e.findIndex(D=>D[n]===w[n])}else if(r===d.Keys.up||r===d.Keys.left){let w;if(c===0)w=e,C=e.findIndex(D=>!D.disabled&&D[n]);else{w=e.slice(0,c);let D=w.pop();for(;D&&D.disabled;)D=w.pop();C=D&&e.findIndex(_=>_[n]===D[n])}}if(C!==void 0){const w=C-c;this.onNavigate(f,r,w)}else C===void 0&&e.findIndex(w=>w[n]===u[n])===e.length-1&&this.onNavigate(f,r)}else if(!this.props.skipDisabledItems&&p)this.onNavigate(f,r);else{let C=null;if(r===d.Keys.down||r===d.Keys.right)C=e.slice(c+1).find(w=>!w.disabled);else if(r===d.Keys.up||r===d.Keys.left){const w=e.slice(0,c);for(C=w.pop();C&&C.disabled;)C=w.pop()}if(C){const w=C.id-c-1;this.onNavigate(f,r,w)}else this.onNavigate(f,r)}this.applyState(f)}const g=()=>{t.preventDefault(),this.base.togglePopup(f),this.applyState(f)},v=this.getFocusedIndex(),m=v===-1,b=!m&&this.getCurrentValueDisabledStatus(n,e,v);p?r===d.Keys.pageUp?this.base.scrollPopupByPageSize(-1):r===d.Keys.pageDown?this.base.scrollPopupByPageSize(1):t.altKey&&r===d.Keys.up?g():r===d.Keys.enter?(t.preventDefault(),(n&&!m&&t.currentTarget.value?e[v][n]:void 0)?!s&&n&&b?this.clearValueOnEnterOrEsc(t):b||this.applyValueOnEnter(t.currentTarget.value,f):this.applyValueOnEnter(t.currentTarget.value,f)):r===d.Keys.esc&&(!s&&n&&b&&this.clearValueOnEnterOrEsc(t),this.applyValueOnRejectSuggestions(t.currentTarget.value,f)):!p&&r===d.Keys.esc?this.clearValueOnEnterOrEsc(t):t.altKey&&r===d.Keys.down&&g()},this.inputOnChange=t=>{const e=this.base.initState();e.syntheticEvent=t;const s=this.props.opened!==void 0?this.props.opened:this.state.opened,n=t.currentTarget,l=n.value;if(this.props.suggest){const h=n.selectionEnd===l.length;let u=this.props.filter!==void 0?this.props.filter:this.state.text;Y(u)||(u=z(this.value,this.props.textField)||"");const c=u&&u===l,r=u&&u.length>l.length;c||r||!h?this._suggested="":this.suggestValue(l)}this.props.filter===void 0&&(e.data.text=l),this.state.focusedItem!==void 0&&(e.data.focusedItem=void 0),s||this.base.togglePopup(e),this.base.filterChanged(l,e),this.applyState(e),this.setState({group:void 0})},this.clearButtonClick=t=>{const e=this.base.initState();e.syntheticEvent=t,t.stopPropagation(),this.clearValue()},this.clearValueOnEnterOrEsc=t=>{const e=this.base.initState();e.syntheticEvent=t,t.stopPropagation(),this.clearValue()},this.clearValueOnBlur=t=>{const e=this.base.initState();e.syntheticEvent=t,t.stopPropagation(),this.clearValue()},this.clearValueOnToggleBtnClick=t=>{const e=this.base.initState();e.syntheticEvent=t,t.stopPropagation(),this.clearValue()},this.setValidity=()=>{this._input&&this._input.setCustomValidity&&this._input.setCustomValidity(this.validity.valid?"":this.props.validationMessage||Bs)},d.validatePackage(qe)}get _inputId(){return this.props.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<=ke&&this.props.adaptive)}get value(){if(this._valueDuringOnChange!==void 0)return this._valueDuringOnChange;if(this.props.value!==void 0)return this.props.value;if(this.state.value!==void 0)return this.state.value;if(this.props.defaultValue!==void 0)return this.props.defaultValue}get index(){const{data:i=[],dataItemKey:t}=this.props,e=this.value;return i.findIndex(s=>L(s,e,t))}get name(){return this.props.name}get validity(){const i=this.props.validationMessage!==void 0,t=!this.required||this.value!==null&&this.value!==""&&this.value!==void 0,e=this.props.valid!==void 0?this.props.valid:t;return{customError:i,valid:e,valueMissing:this.value===null}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:mt.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:mt.defaultProps.required}componentDidUpdate(i,t){var g;const{dataItemKey:e,virtual:s,groupField:n="",data:l=[],textField:h}=this.props,u=i.virtual?i.virtual.total:0,c=this.props.opened!==void 0?this.props.opened:this.state.opened,r=i.opened!==void 0?i.opened:t.opened,p=!r&&c,f=this.value;if(this._valueOnDidUpdate=f,s&&s.total!==u)this.base.vs.calcScrollElementHeight(),this.base.vs.reset();else{const v=i.value!==void 0?i.value:t.value;let m=l.findIndex(C=>L(C,f,e));this.props.groupMode==="modern"&&h&&f&&(m=(g=this.base.getGroupedDataModernMode(l,n))==null?void 0:g.map(C=>C[h]).indexOf(f[h]));const b=!L(v,f,e);p&&s?this.base.scrollToVirtualItem(s,m):p&&!s?(this.onPopupOpened(),l&&l.length!==0&&this.base.resetGroupStickyHeader(l[0][n],this),this.base.scrollToItem(m)):c&&r&&f&&b&&this.base.scrollToItem(m)}p&&this._input&&this._input.focus(),this.setValidity()}componentDidMount(){var i;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.base.didMount(),this.setValidity(),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentWillUnmount(){var i;(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.disconnect()}render(){const i=xe.provideLocalizationService(this).toLanguageString(Mt,ne[Mt]),t=xe.provideLocalizationService(this).toLanguageString(Nt,ne[Nt]),{dir:e,disabled:s,clearButton:n=mt.defaultProps.clearButton,label:l,textField:h,adaptive:u,className:c,style:r,loading:p,iconClassName:f,virtual:g,size:v,rounded:m,fillMode:b,opened:C=this.state.opened,placeholder:w}=this.props,{windowWidth:D=0}=this.state,_=!this.validityStyles||this.validity.valid,O=this.props.filter!==void 0?this.props.filter:this.state.text,B=z(this.value,h),E=Y(O)?O:B,K=n&&(!!E||Y(this.value)),k=this.base.vs,N=this.props.id||this._inputId,q=D<=ke&&u;k.enabled=g!==void 0,g!==void 0&&(k.skip=g.skip,k.total=g.total,k.pageSize=g.pageSize);const[X,J]=Me(this.props.prefix||a.Fragment),[Q,T]=Me(this.props.suffix||a.Fragment),me=a.createElement(a.Fragment,null,a.createElement("span",{className:d.classNames("k-combobox k-input",{[`k-input-${vt[v]||v}`]:v,[`k-rounded-${Ls[m]||m}`]:m,[`k-input-${b}`]:b,"k-invalid":!_,"k-loading":p,"k-required":this.required,"k-disabled":s},c),ref:this.componentRef,style:l?{...r,width:void 0}:r,dir:e},this.props.prefix&&a.createElement(X,{...J}),this.renderSearchBar(E||"",N,w),K&&!p&&a.createElement(et,{onClick:this.clearButtonClick,key:"clearbutton"}),p&&a.createElement(d.IconWrap,{className:"k-input-loading-icon",name:"loading",key:"loading"}),this.props.suffix&&a.createElement(Q,{...T}),a.createElement(Ce.Button,{tabIndex:-1,type:"button","aria-label":C?t:i,icon:f?void 0:"caret-alt-down",svgIcon:f?this.props.svgIcon:Ie.caretAltDownIcon,iconClass:f,size:v,fillMode:b,rounded:null,themeColor:"base",className:"k-input-button",onClick:this.toggleBtnClick,onMouseDown:R=>R.preventDefault()}),!q&&this.renderListContainer()),q&&this.renderAdaptiveListContainer());return l?a.createElement(Ae.FloatingLabel,{label:l,editorId:N,editorValue:E,editorValid:_,editorDisabled:s,style:{width:r?r.width:void 0},children:me}):me}onNavigate(i,t,e){const{data:s=[],virtual:n={skip:0}}=this.props,l=this.props.filter?this.props.filter:this.state.text,h=this.getFocusedIndex(),u=this.base.vs,c=this.value;if(this._suggested="",h!==-1&&!Y(c))this.handleItemSelect(h,i);else if(l==="")this.handleItemSelect(0,i);else{const r=n.skip+h,p=this.base.navigation.navigate({keyCode:t,current:r,max:(u.enabled?u.total:s.length)-1,min:0,skipItems:e||void 0});p!==void 0&&this.handleItemSelect(p,i)}}getCurrentValueDisabledStatus(i,t,e){return i&&t&&t[e]&&t[e].disabled}applyValueOnEnter(i,t){const{data:e=[],textField:s,allowCustom:n}=this.props,l=this.props.opened!==void 0?this.props.opened:this.state.opened,u=z(this.value,s)===i?this.index:Kt(e,i,s),c=u!==-1;let r;if(this._suggested="",c)r=e[u];else if(n)r=s!==void 0?{[s]:i}:i;else return this.selectFocusedItem(i,t);this.triggerOnChange(r,t),l&&this.base.togglePopup(t),this.props.filter===void 0&&this.state.text!==void 0&&(t.data.text=void 0),this.applyState(t)}applyValueOnRejectSuggestions(i,t){const{data:e=[],textField:s,allowCustom:n}=this.props,l=this.props.opened!==void 0?this.props.opened:this.state.opened,h=z(this.value,s),u=this.state.windowWidth&&this.state.windowWidth<=ke;if(this._suggested="",i===h||i===""&&!Y(h))return l&&!u&&this.base.togglePopup(t),this.applyState(t);const c=Kt(e,i,s,!0),r=c!==-1;let p=null;r?p=e[c]:n&&(p=i?s?{[s]:i}:i:null),this.triggerOnChange(p,t),this.state.text!==void 0&&(t.data.text=void 0,this.base.filterChanged("",t)),l&&!u&&this.base.togglePopup(t),this.applyState(t)}selectFocusedItem(i,t){const e=this.props.opened!==void 0?this.props.opened:this.state.opened,{data:s=[],textField:n,virtual:l={skip:0},focusedItemIndex:h=_e}=this.props,u=l.skip,c=i===""&&u===0?0:h(s,i,n);return c!==-1?this.handleItemSelect(c+u,t):(this.triggerOnChange(null,t),this.state.text!==void 0&&(t.data.text=void 0)),e&&this.base.togglePopup(t),this.applyState(t)}renderAdaptiveListContainer(){const{windowWidth:i=0}=this.state,{header:t,footer:e,size:s,data:n=[],groupField:l,groupMode:h,list:u,virtual:c,adaptiveTitle:r,groupStickyHeaderItemRender:p}=this.props,f=this.props.opened!==void 0?this.props.opened:this.state.opened;let{group:g}=this.state;g===void 0&&l!==void 0&&(g=z(n[0],l));const v={navigatable:!1,navigatableElements:[],expand:f,animation:!0,onClose:m=>this.toggleBtnClick(m),animationStyles:i<=ft?{top:0,width:"100%",height:"100%"}:void 0,className:i<=ft?"k-adaptive-actionsheet k-actionsheet-fullscreen":"k-adaptive-actionsheet k-actionsheet-bottom"};return a.createElement(fe.ActionSheet,{...v},a.createElement(fe.ActionSheetHeader,{className:"k-text-center"},a.createElement("div",{className:"k-actionsheet-titlebar-group k-hbox"},a.createElement("div",{className:"k-actionsheet-title"},a.createElement("div",null,r)),a.createElement("div",{className:"k-actionsheet-actions"},a.createElement(Ce.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",onClick:this.toggleBtnClick,icon:"x",svgIcon:Ie.xIcon}))),a.createElement("div",{className:"k-actionsheet-titlebar-group k-actionsheet-filter"},this.renderMobileListFilter())),a.createElement(fe.ActionSheetContent,{className:"!k-overflow-hidden"},a.createElement("div",{className:"k-list-container"},a.createElement("div",{className:d.classNames({"k-list":!u,"k-list-lg":!0,"k-virtual-list":c,"k-data-table":u,[`k-table-${vt[s]||s}`]:u&&s})},t&&a.createElement("div",{className:"k-table-header"},t),!u&&g&&n.length!==0&&a.createElement(We,{group:g,groupMode:h,render:p}),this.renderList(),e&&a.createElement("div",{className:"k-list-footer"},e)))))}renderListContainer(){const i=this.base,{dir:t,header:e,footer:s,data:n=[],groupField:l,groupMode:h,size:u,list:c,virtual:r,groupStickyHeaderItemRender:p}=this.props,f=this.props.opened!==void 0?this.props.opened:this.state.opened,g=i.getPopupSettings(),v=g.width!==void 0?g.width:i.popupWidth;let{group:m}=this.state;return m===void 0&&l!==void 0&&(m=z(n[0],l)),a.createElement(Xe,{width:v,popupSettings:{animate:g.animate,anchor:this.element,show:f,popupClass:d.classNames(g.popupClass,"k-list-container","k-combobox-popup"),className:g.className,appendTo:g.appendTo},dir:t!==void 0?t:this.base.dirCalculated,itemsCount:[n.length]},a.createElement("div",{className:d.classNames({"k-list":!c,[`k-list-${vt[u]||u}`]:!c&&u,"k-virtual-list":r,"k-data-table":c,[`k-table-${vt[u]||u}`]:c&&u})},e&&a.createElement("div",{className:"k-table-header"},e),!c&&m&&n.length!==0&&a.createElement(We,{group:m,groupMode:h,render:p}),this.renderList(),s&&a.createElement("div",{className:d.classNames({"k-list-footer":!this.props.footerClassName},this.props.footerClassName)},s)))}renderList(){const i=this.base,{textField:t,dataItemKey:e,listNoDataRender:s,itemRender:n,groupHeaderItemRender:l,data:h=[],virtual:u={skip:0,total:void 0}}=this.props,c=i.getPopupSettings(),r=i.vs,p=u.skip,f=this.props.opened!==void 0?this.props.opened:this.state.opened,g=`translateY(${r.translate}px)`,v=f?this.getFocusedIndex():void 0,m=this.props.filter!==void 0?this.props.filter:this.state.text,b=z(this.value,t),C=Y(m)&&m!==b?null:this.value,w=this.props.list||Ve;return a.createElement(w,{id:i.listBoxId,virtual:!!u,show:f,data:h,focusedIndex:v,value:C,textField:t,valueField:e,groupField:this.props.groupField,groupMode:this.props.groupMode,isMultiColumn:this.props.isMultiColumn,optionsGuid:i.guid,listRef:D=>{r.list=this.base.list=D,this.itemHeight=0},wrapperStyle:this.state.windowWidth&&this.state.windowWidth>ke?{maxHeight:c.height}:{},wrapperCssClass:d.classNames("k-list-content",{"k-list-scroller":!u}),listStyle:r.enabled?{transform:g}:void 0,key:"listkey",skip:p,onClick:this.handleItemClick,itemRender:n,groupHeaderItemRender:l,noDataRender:s,onMouseDown:D=>D.preventDefault(),onScroll:this.onScroll,wrapperRef:r.scrollerRef,scroller:this.base.renderScrollElement(),ariaSetSize:u.total})}renderSearchBar(i,t,e){const{tabIndex:s,disabled:n,data:l=[],dataItemKey:h,virtual:u={skip:0}}=this.props,c=this.props.opened!==void 0?this.props.opened:this.state.opened,r=this.value,p=Math.max(0,l.findIndex(f=>L(f,r,h)));return this._suggested&&!L(this._valueOnDidUpdate,r,h)&&(this._suggested=""),a.createElement(gt,{id:t,readOnly:c&&this.mobileMode,placeholder:e,tabIndex:s,title:this.props.title,accessKey:this.props.accessKey,value:i+this._suggested,suggestedText:this._suggested,ref:f=>this._input=f&&f.input,onClick:this.onInputClick,onKeyDown:this.onInputKeyDown,onChange:this.inputOnChange,onFocus:this.base.handleFocus,onBlur:this.handleBlur,disabled:n,expanded:c,owns:this.base.listBoxId,activedescendant:`option-${this.base.guid}-${p+u.skip}`,role:"combobox",ariaLabelledBy:this.props.ariaLabelledBy,ariaDescribedBy:this.props.ariaDescribedBy,ariaRequired:this.required,render:this.props.valueRender})}clearValue(){const i=this.base.initState();this._suggested="",this.base.filterChanged("",i),this.props.filter===void 0&&this.state.text!==void 0&&(i.data.text=void 0),this.triggerOnChange(null,i);const t=this.props.opened!==void 0?this.props.opened:this.state.opened,e=this.mobileMode;t&&!e&&this.base.togglePopup(i),this.applyState(i)}triggerOnChange(i,t){const e=this.value;!Y(e)&&!Y(i)||L(e,i,this.props.dataItemKey)||(this.props.value===void 0&&(t.data.value=i),this._valueDuringOnChange=i,t.events.push({type:"onChange"}))}getFocusedIndex(){const i=this.value,{data:t=[],textField:e,dataItemKey:s,virtual:n={skip:0},focusedItemIndex:l=_e,skipDisabledItems:h}=this.props,u=this.props.filter?this.props.filter:this.state.text;return Y(i)&&u===void 0?t.findIndex(c=>L(c,i,s)):u?l(t,u,e):h&&e&&!u&&n.skip===0?t.findIndex(c=>!c.disabled&&c[e]):n.skip===0?0:-1}suggestValue(i){const{data:t,textField:e}=this.props;this._suggested=Cs(i,t,e)}applyState(i){this.base.applyState(i),this._valueDuringOnChange=void 0}calculateMedia(i){for(const t of i)this.setState({windowWidth:t.target.clientWidth})}};let Te=mt;Te.displayName="ComboBox",Te.propTypes={...ae.propTypes,size:o.oneOf([null,"small","medium","large"]),rounded:o.oneOf([null,"small","medium","large","full"]),fillMode:o.oneOf([null,"solid","flat","outline"]),dataItemKey:o.string,groupField:o.string,groupMode:o.oneOf([void 0,"classic","modern"]),isMultiColumn:o.bool,suggest:o.bool,placeholder:o.string,title:o.string,allowCustom:o.bool,clearButton:o.bool,iconClassName:o.string,svgIcon:d.svgIconPropType,validationMessage:o.string,required:o.bool,id:o.string,ariaLabelledBy:o.string,ariaDescribedBy:o.string,list:o.any,valueRender:o.func,skipDisabledItems:o.bool},Te.defaultProps={...ae.defaultProps,size:"medium",rounded:"medium",fillMode:"solid",allowCustom:!1,clearButton:!0,required:!1,groupMode:"modern",isMultiColumn:!1,skipDisabledItems:!0,prefix:void 0,suffix:void 0};const ts=d.createPropsContext(),Lt=d.withIdHOC(d.withPropsContext(ts,Te));Lt.displayName="KendoReactComboBox";const zs="Please enter a valid value!",{sizeMap:ss,roundedMap:Hs}=d.kendoThemeMaps,zt=class extends a.Component{constructor(i){super(i),this.state={},this.base=new ae(this),this._element=null,this._suggested="",this._input=null,this._isScrolling=!1,this.itemHeight=0,this.focus=()=>{this._input&&this._input.focus()},this.handleItemSelect=(t,e)=>{const{data:s=[]}=this.props,n=z(s[t],this.props.textField);this.triggerOnChange(n,e)},this.itemFocus=(t,e)=>{const{data:s=[],textField:n}=this.props,l=s[t];L(this.state.focusedItem,l,n)||(e.data.focusedItem=l)},this.togglePopup=t=>{this.base.togglePopup(t)},this.setValidity=()=>{this._input&&this._input.setCustomValidity&&this._input.setCustomValidity(this.validity.valid?"":this.props.validationMessage||zs)},this.onScroll=t=>{this._isScrolling=!0;const{list:e}=this.base,{groupField:s}=this.props;let{data:n=[]}=this.props;if(!s||!n.length)return;const l=this.itemHeight||(e?e.children[0].offsetHeight:0),u=t.target.scrollTop;s&&(n=this.base.getGroupedDataModernMode(n,s));let c=n[0][s];for(let r=1;r<n.length&&!(l*r>u);r++)n[r]&&n[r][s]&&(c=n[r][s]);c!==this.state.group&&this.setState({group:c})},this.handleItemClick=(t,e)=>{this.base.handleItemClick(t,e),this._valueDuringOnChange=void 0},this.onChangeHandler=t=>{const s=this.base.initState(),n=t.currentTarget,l=n.value,h=n.selectionEnd===l.length;s.syntheticEvent=t;const u=this._suggested,c=this.value,r=c&&c.substring(0,c.length-u.length),p=r&&r===l,f=r&&r.length>l.length,{suggest:g}=this.props,v=this.props.opened!==void 0?this.props.opened:this.state.opened;if(g!==void 0&&g!==!1){p||f||!h?this._suggested="":this.suggestValue(l);const m=l+this._suggested,b={userInput:l,value:this._suggested};this.triggerOnChange(m,s,{suggestion:b})}else this._suggested="",this.triggerOnChange(l,s);(!v&&l||v&&!l)&&this.togglePopup(s),s.data.focusedItem=void 0,this.applyState(s),this.setState({group:void 0})},this.clearButtonClick=t=>{const s=this.base.initState(),n=this.props.opened!==void 0?this.props.opened:this.state.opened;s.syntheticEvent=t;const l="";this._suggested="",this.triggerOnChange(l,s),this.state.focusedItem!==void 0&&(s.data.focusedItem=void 0),n&&this.togglePopup(s),this.applyState(s)},this.onInputKeyDown=t=>{const{data:e=[],skipDisabledItems:s,groupField:n,textField:l}=this.props;this._isScrolling&&(this._isScrolling=!1);const h=this.focusedIndex(),u=e[h],c=t.keyCode,r=t.altKey,p=this.props.opened!==void 0?this.props.opened:this.state.opened,f=this.base.initState();f.syntheticEvent=t;const g=()=>{p&&t.preventDefault()};if(r&&c===d.Keys.down)this.setState({opened:!0});else if(r&&c===d.Keys.up)this.setState({opened:!1});else if(p&&c===d.Keys.pageUp)this.base.scrollPopupByPageSize(-1);else if(p&&c===d.Keys.pageDown)this.base.scrollPopupByPageSize(1);else if(p&&(c===d.Keys.enter||c===d.Keys.esc))g(),s===!1&&u&&u.disabled?(p&&this.togglePopup(f),this.applyState(f)):this.applyInputValue(t.currentTarget.value,f,t.keyCode);else if(!p&&c===d.Keys.esc){const v="";this._suggested="",this.triggerOnChange(v,f),this.state.focusedItem!==void 0&&(f.data.focusedItem=void 0),this.applyState(f)}else if(c===d.Keys.up||c===d.Keys.down){if(n!==""&&l)if(!this.props.skipDisabledItems&&p)this.onNavigate(f,c);else{let v=0;if(c===d.Keys.down||c===d.Keys.right){const m=e.slice(h+1).find(b=>!b.disabled&&b[l]);v=m&&e.findIndex(b=>b[l]===m[l])}else if(c===d.Keys.up||c===d.Keys.left){let m;if(h===-1)m=e,v=e.findIndex(b=>!b.disabled&&b[l]);else{m=e.slice(0,h);let b=m.pop();for(;b&&b.disabled;)b=m.pop();v=b&&e.findIndex(C=>C[l]===b[l])}}if(v!==void 0){const m=v-h;this.onNavigate(f,c,m)}else v===void 0&&e.findIndex(m=>m[l])===e.length-1&&this.onNavigate(f,c)}else if(!this.props.skipDisabledItems&&p)this.onNavigate(f,c);else{let v=null;if(c===d.Keys.down||c===d.Keys.right)v=e.slice(h+1).find(m=>!m.disabled);else if(c===d.Keys.up||c===d.Keys.left){const m=e.slice(0,h);for(v=m.pop();v&&v.disabled;)v=m.pop()}if(v){const m=v.id-h-1;this.onNavigate(f,c,m)}else this.onNavigate(f,c)}this.applyState(f),g()}},this.handleBlur=t=>{if(this.state.focused){const e=this.base.initState();e.data.focused=!1,e.events.push({type:"onBlur"}),e.syntheticEvent=t,this.applyInputValue(t.currentTarget.value,e)}},d.validatePackage(qe)}get _inputId(){return this.props.id+"-accessibility-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!==void 0?this.state.value:this.props.defaultValue!==void 0?this.props.defaultValue:""}get name(){return this.props.name}get validity(){const i=this.props.validationMessage!==void 0,t=!this.required||this.value!=="",e=this.props.valid!==void 0?this.props.valid:t;return{customError:i,valid:e,valueMissing:this.value===null}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:zt.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:zt.defaultProps.required}componentDidUpdate(i,t){var g;const{groupField:e="",data:s=[]}=this.props,{data:n=[]}=i,l=this.focusedIndex(),h=s[l],u=n!==s,c=h!==void 0&&t.focusedItem!==h,r=this.props.opened!==void 0?this.props.opened:this.state.opened,p=i.opened!==void 0?i.opened:t.opened,f=!p&&r;if(e==="")(r&&(c||u)||f)&&this.base.scrollToItem(l);else if(!this._isScrolling){let v=(g=this.base.getGroupedDataModernMode(s,e))==null?void 0:g.indexOf(h);f&&(s&&s.length!==0&&this.base.resetGroupStickyHeader(s[0][e],this),this.base.scrollToItem(v)),r&&p&&c&&this.base.scrollToItem(v)}this.setValidity()}componentDidMount(){this.base.didMount(),this.setValidity()}render(){const{dir:i,disabled:t,label:e,className:s,style:n,loading:l,suggest:h,size:u,rounded:c,fillMode:r}=this.props,p=!this.validityStyles||this.validity.valid,f=this.base,g=this.value,v=this.props.clearButton!==!1&&!l&&!!g,m=this.props.id||this._inputId;typeof h=="string"&&(this._suggested=h);const[b,C]=Me(this.props.prefix||a.Fragment),[w,D]=Me(this.props.suffix||a.Fragment),_=a.createElement("span",{className:d.classNames("k-autocomplete k-input",s,{[`k-input-${ss[u]||u}`]:u,[`k-rounded-${Hs[c]||c}`]:c,[`k-input-${r}`]:r,"k-invalid":!p,"k-loading":l,"k-required":this.required,"k-disabled":t}),ref:O=>{this._element=O,f.wrapper=O},style:e?{...n,width:void 0}:n,dir:i},this.props.prefix&&a.createElement(b,{...C}),this.renderSearchBar(g||"",m),l&&a.createElement(d.IconWrap,{className:"k-input-loading-icon",name:"loading"}),v&&!l&&a.createElement(et,{onClick:this.clearButtonClick,key:"clearbutton"}),this.props.suffix&&a.createElement(w,{...D}),this.renderListContainer());return e?a.createElement(Ae.FloatingLabel,{label:e,editorId:m,editorValue:g,editorValid:p,editorDisabled:t,style:{width:n?n.width:void 0},children:_}):_}onNavigate(i,t,e){const s=this.value,{data:n=[],textField:l,focusedItemIndex:h}=this.props,u=this.state.focusedItem!==void 0?n.findIndex(r=>L(r,this.state.focusedItem,l)):h?h(n,s,l):n.indexOf(Zt(n,s,l)),c=this.base.navigation.navigate({keyCode:t,current:u,max:n.length-1,min:0,skipItems:e||void 0});c!==void 0&&this.itemFocus(c,i),this.applyState(i)}applyInputValue(i,t,e){const s=this.props.opened!==void 0?this.props.opened:this.state.opened,{data:n=[],textField:l}=this.props,h=this.focusedIndex(),u=n[h];if(this._suggested="",s&&e===d.Keys.enter&&u&&!u.disabled){const c=z(n[this.focusedIndex(i)],l);this.triggerOnChange(c,t)}s&&this.togglePopup(t),this.applyState(t)}renderSearchBar(i,t){const e=this.base,{placeholder:s,tabIndex:n,disabled:l,readonly:h}=this.props,{focused:u}=this.state,c=this.props.opened!==void 0?this.props.opened:this.state.opened;return a.createElement(gt,{id:t,placeholder:s,tabIndex:n,accessKey:this.props.accessKey,value:i,suggestedText:this._suggested,focused:u,name:this.props.name,ref:r=>this._input=r&&r.input,onKeyDown:this.onInputKeyDown,onChange:this.onChangeHandler,onFocus:e.handleFocus,onBlur:this.handleBlur,disabled:l,readOnly:h,expanded:c,owns:e.listBoxId,activedescendant:"option-"+e.guid+"-"+this.focusedIndex(),role:"combobox",ariaLabelledBy:this.props.ariaLabelledBy,ariaDescribedBy:this.props.ariaDescribedBy,ariaRequired:this.required,render:this.props.valueRender})}renderListContainer(){const i=this.base,{dir:t,header:e,footer:s,data:n=[],size:l,groupField:h,list:u,groupStickyHeaderItemRender:c}=this.props,r=i.getPopupSettings(),p=this.props.opened!==void 0?this.props.opened:this.state.opened,f=r.width!==void 0?r.width:i.popupWidth;let{group:g}=this.state;return g===void 0&&h!==void 0&&(g=z(n[0],h)),a.createElement(Xe,{width:f,popupSettings:{animate:r.animate,anchor:this.element,show:p,popupClass:d.classNames(r.popupClass,"k-list-container","k-autocomplete-popup"),className:r.className,appendTo:r.appendTo},dir:t!==void 0?t:this.base.dirCalculated,itemsCount:[n.length]},e&&a.createElement("div",{className:"k-list-header"},e),a.createElement("div",{className:d.classNames("k-list",{[`k-list-${ss[l]||l}`]:l})},!u&&g&&n.length!==0&&a.createElement(We,{group:g,groupMode:"modern",render:c}),this.renderList()),s&&a.createElement("div",{className:"k-list-footer"},s))}renderList(){const i=this.base,t=i.getPopupSettings(),{textField:e,data:s=[],listNoDataRender:n,itemRender:l,groupHeaderItemRender:h}=this.props,u=this.value,c=this.props.opened!==void 0?this.props.opened:this.state.opened;return a.createElement(Ve,{id:i.listBoxId,show:c,data:s.slice(),focusedIndex:this.focusedIndex(),value:u,textField:e,valueField:e,highlightSelected:!1,optionsGuid:i.guid,groupField:this.props.groupField,groupMode:"modern",listRef:r=>i.list=r,wrapperStyle:{maxHeight:t.height},wrapperCssClass:"k-list-content",onClick:this.handleItemClick,itemRender:l,groupHeaderItemRender:h,noDataRender:n,onMouseDown:r=>r.preventDefault(),onScroll:this.onScroll})}triggerOnChange(i,t,e){this.value===i&&!e||(t.data.value=i,this._valueDuringOnChange=i,t.events.push({type:"onChange",...e||{}}))}applyState(i){this.base.applyState(i),this._valueDuringOnChange=void 0}suggestValue(i){if(this._suggested="",i){const{data:t=[],textField:e}=this.props,s=t[_e(t,i,e)];if(s){const n=z(s,e);i.toLowerCase()!==n.toLowerCase()&&(this._suggested=n.substring(i.length))}}}focusedIndex(i){const{data:t=[],textField:e,focusedItemIndex:s,skipDisabledItems:n}=this.props,l=i!==void 0?i:this.value;if(this.state.focusedItem!==void 0)return t.findIndex(h=>L(h,this.state.focusedItem,e));if(s)return s(t,l,e);{const h=t.indexOf(Zt(t,l,e));return n&&e&&h===-1?t.findIndex(u=>!u.disabled&&u[e]):Math.max(0,h)}}};let tt=zt;tt.displayName="AutoComplete",tt.propTypes={...ae.basicPropTypes,size:o.oneOf([null,"small","medium","large"]),rounded:o.oneOf([null,"small","medium","large","full"]),fillMode:o.oneOf([null,"solid","flat","outline"]),groupField:o.string,suggest:o.oneOfType([o.bool,o.string]),placeholder:o.string,value:o.string,defaultValue:o.string,validationMessage:o.string,required:o.bool,readonly:o.bool,clearButton:o.bool,valueRender:o.func,id:o.string,ariaLabelledBy:o.string,ariaDescribedBy:o.string,list:o.any,skipDisabledItems:o.bool},tt.defaultProps={...ae.defaultProps,size:"medium",rounded:"medium",fillMode:"solid",skipDisabledItems:!0,prefix:void 0,suffix:void 0};const is=d.createPropsContext(),ns=d.withIdHOC(d.withPropsContext(is,tt));ns.displayName="KendoReactAutoComplete";const As=i=>i.syntheticEvent.preventDefault(),Ws=i=>i.syntheticEvent.stopPropagation();class Ht extends a.Component{render(){const{data:t,guid:e,focused:s,tagRender:n,tag:l,onTagDelete:h,size:u}=this.props;return a.createElement(a.Fragment,null,t.map((c,r)=>{const p=l?a.createElement(l,{key:c.text+r,tagData:c,guid:e,focusedTag:s,onTagDelete:h}):a.createElement(Ce.Chip,{id:`tag-${e}-${c.text.replace(/\s+/g,"-")}`,"aria-selected":!0,role:"option","aria-setsize":t.length,key:c.text+r,text:c.text,removable:!0,onRemove:f=>h.call(void 0,c.data,f.syntheticEvent),onMouseDown:As,onClick:Ws,className:c===s?"k-focus":void 0,size:u});return n?n(c,p):p}),this.props.children)}}var st=(i=>(i[i.PopupList=0]="PopupList",i[i.TagsList=1]="TagsList",i))(st||{});const as=500,At=i=>{const{footer:t,children:e,windowWidth:s=0,navigatable:n,navigatableElements:l,expand:h,animation:u,onClose:c,adaptiveTitle:r,mobileFilter:p}=i,f={navigatable:n||!1,navigatableElements:l||[],expand:h,animation:u!==!1,onClose:c,animationStyles:s<=as?{top:0,width:"100%",height:"100%"}:void 0,className:s<=as?"k-adaptive-actionsheet k-actionsheet-fullscreen":"k-adaptive-actionsheet k-actionsheet-bottom"};return a.createElement(fe.ActionSheet,{...f},a.createElement(fe.ActionSheetHeader,{className:"k-text-center"},a.createElement("div",{className:"k-actionsheet-titlebar-group k-hbox"},a.createElement("div",{className:"k-actionsheet-title"},a.createElement("div",null,r)),a.createElement("div",{className:"k-actionsheet-actions"},a.createElement(Ce.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",icon:"x",svgIcon:Ie.xIcon,onClick:c}))),p&&a.createElement("div",{className:"k-actionsheet-titlebar-group k-actionsheet-filter"},p)),e,t&&a.createElement(fe.ActionSheetFooter,{className:"k-actions k-actions-stretched"},a.createElement(Ce.Button,{size:"large",tabIndex:0,"aria-label":t.cancelText,"aria-disabled":"false",type:"button",onClick:t.onCancel},t.cancelText),a.createElement(Ce.Button,{tabIndex:0,themeColor:"primary",size:"large","aria-label":t.applyText,"aria-disabled":"false",type:"button",onClick:t.onApply},t.applyText)))},{sizeMap:bt,roundedMap:qs}=d.kendoThemeMaps,$s="Please enter a valid value!",ls=i=>i.preventDefault(),os=i=>i===2,Wt=class extends a.Component{constructor(i){super(i),this.state={activedescendant:st.PopupList,currentValue:[]},this._element=null,this._valueItemsDuringOnChange=null,this.base=new ae(this),this._tags=[],this._input=null,this._adaptiveInput=null,this._skipFocusEvent=!1,this._lastSelectedOrDeslectedItemIndex=null,this.itemHeight=0,this.scrollToFocused=!1,this.localization=null,this.focus=()=>{this._input&&this._input.focus()},this.handleItemSelect=(t,e)=>{const{data:s=[],dataItemKey:n,virtual:l}=this.props,h=l?l.skip:0,u=s[t-h],c=this.value.findIndex(f=>L(f,u,n));this._lastSelectedOrDeslectedItemIndex=s.findIndex(f=>L(f,u,n));let r=[];c!==-1?(r=this.value,r.splice(c,1)):r=[...this.value,u],(this.props.filter!==void 0?this.props.filter:this.state.text)&&!this.mobileMode&&(this.state.text&&(e.data.text=""),this.base.filterChanged("",e)),this._adaptiveInput&&this._adaptiveInput.blur(),this.state.focusedIndex!==void 0&&(e.data.focusedIndex=void 0),this.triggerOnChange(r,e),this.base.triggerPageChangeCornerItems(u,e)},this.onTagDelete=(t,e)=>{const s=this.base.initState();s.syntheticEvent=e,this.opened&&this.base.togglePopup(s),!this.state.focused&&!this.mobileMode&&(s.data.focused=!0,this.focus());const n=this.value;ht(n,t,this.props.dataItemKey),this.triggerOnChange(n,s),this.applyState(s)},this.itemFocus=(t,e)=>{const{data:s=[],allowCustom:n,virtual:l}=this.props,h=l?l.skip:0,u=this.props.filter!==void 0?this.props.filter:this.state.text,{focusedIndex:c}=this.getFocusedState(),r=n&&u,p=s[t-h];p&&c!==t?this.state.focusedIndex!==t&&(e.data.focusedIndex=t,e.data.activedescendant=st.PopupList):r&&t===-1&&this.state.focusedIndex!==void 0&&(e.data.focusedIndex=void 0),this.base.triggerPageChangeCornerItems(p,e)},this.componentRef=t=>{this._element=t,this.base.wrapper=t},this.searchbarRef=t=>{const e=this._input=t&&t.input;e&&this.state.focused&&window.setTimeout(()=>e.focus(),0)},this.onChangeHandler=t=>{const e=this.base.initState(),s=t.target.value;e.syntheticEvent=t,this.props.filter===void 0&&(e.data.text=s),e.data.focusedIndex=void 0,this.opened||(this.base.togglePopup(e),this.setState({currentValue:this.value})),this.base.filterChanged(s,e),this.applyState(e),this.setState({group:void 0})},this.clearButtonClick=t=>{const e=this.base.initState();e.syntheticEvent=t,t.stopPropagation(),this.value.length>0&&this.triggerOnChange([],e),this.state.focusedIndex!==void 0&&(e.data.focusedIndex=void 0),this.opened&&this.base.togglePopup(e);const s=this.props.filter!==void 0?this.props.filter:this.state.text;Y(s)&&s!==""&&this.base.filterChanged("",e),this.state.text&&(e.data.text=""),this._lastSelectedOrDeslectedItemIndex=null,this.applyState(e)},this.onInputKeyDown=t=>{const{data:e=[],textField:s,groupField:n}=this.props,l=t.keyCode,h=this.props.filter!==void 0?this.props.filter:this.state.text,u=this.props.opened!==void 0?this.props.opened:this.state.opened,{focusedItem:c,focusedIndex:r}=this.getFocusedState(),p=this.base.initState();if(p.syntheticEvent=t,!h&&this.value.length>0&&(l===d.Keys.left||l===d.Keys.right||l===d.Keys.home||l===d.Keys.end||l===d.Keys.delete||l===d.Keys.backspace)&&!t.shiftKey)return this.onTagsNavigate(t,p);const f=()=>{t.preventDefault(),this.base.togglePopup(p),this.applyState(p)};if(this.opened)if(l===d.Keys.pageUp)this.base.scrollPopupByPageSize(-1);else if(l===d.Keys.pageDown)this.base.scrollPopupByPageSize(1);else if((t.ctrlKey||t.metaKey)&&t.code==="KeyA"){const v=(this.state.value&&this.state.value.length)===e.length?[]:e;this.updateStateOnKeyboardNavigation(v,p)}else if((t.ctrlKey||t.metaKey)&&t.shiftKey&&t.keyCode===d.Keys.end){const g=e.slice(this.getFocusedState().focusedIndex);this.itemFocus(e.length-1,p),this.updateStateOnKeyboardNavigation(g,p)}else if((t.ctrlKey||t.metaKey)&&t.shiftKey&&t.keyCode===d.Keys.home){const g=e.slice(0,this.getFocusedState().focusedIndex+1);this.itemFocus(0,p),this.updateStateOnKeyboardNavigation(g,p)}else if(t.shiftKey&&t.keyCode===d.Keys.up){let g;const v=this.getLastSelectedOrDeselectedIndex(1,r);v===null?g=r!==0?e.slice(r-1,r):[e[r]]:v===r?g=[e[v-1]]:r>=0&&(g=v>r?e.slice(r-1,v):e.slice(v-1,r)),g&&g.length>0&&(r>=1&&this.itemFocus(r-1,p),this.updateStateOnKeyboardNavigation(g,p))}else if(t.shiftKey&&t.keyCode===d.Keys.down){let g;const v=this.getLastSelectedOrDeselectedIndex(0,r);v===null?g=r!==e.length-1?e.slice(r,r+1):[e[r]]:v===r?g=e.slice(r,r+2):r>=0&&(g=v>r?e.slice(r+1,v+1):e.slice(v,r+2)),g&&g.length>=1&&(this.itemFocus(r+1,p),this.updateStateOnKeyboardNavigation(g,p))}else if(t.altKey&&l===d.Keys.up)f();else if(l===d.Keys.up||l===d.Keys.down){if(n!==""&&s)if(!this.props.skipDisabledItems&&u)this.onNavigate(p,l);else{let g=0;if(l===d.Keys.down||l===d.Keys.right){const v=e.slice(r+1).find(m=>!m.disabled&&m[s]);g=v&&e.findIndex(m=>m[s]===v[s])}else if(l===d.Keys.up||l===d.Keys.left){let v;if(r===-1)v=e,g=e.findIndex(m=>!m.disabled&&m[s]);else{v=e.slice(0,r);let m=v.pop();for(;m&&m.disabled;)m=v.pop();g=m&&e.findIndex(b=>b[s]===m[s])}}if(g){const v=g-r;this.onNavigate(p,l,v)}else g!==void 0&&this.onNavigate(p,l)}else if(!this.props.skipDisabledItems&&u)this.onNavigate(p,l);else{let g=null;if(l===d.Keys.down||l===d.Keys.right)g=e.slice(r+1).find(v=>!v.disabled);else if(l===d.Keys.up||l===d.Keys.left){const v=e.slice(0,r);for(g=v.pop();g&&g.disabled;)g=v.pop()}if(g){const v=g.id-r-1;this.onNavigate(p,l,v)}else this.onNavigate(p,l)}this.applyState(p),t.preventDefault()}else l===d.Keys.enter?(t.preventDefault(),this.props.allowCustom&&h&&c===null?this.customItemSelect(t):c&&c.disabled?f():this.selectFocusedItem(t)):l===d.Keys.esc&&f();else t.altKey&&l===d.Keys.down&&f()},this.listContainerContent=()=>{const{header:t,footer:e,allowCustom:s,size:n,data:l=[],groupStickyHeaderItemRender:h,groupField:u,list:c}=this.props,r=this.props.filter!==void 0?this.props.filter:this.state.text,{focusedType:p}=this.getFocusedState(),f=s&&r&&a.createElement("div",{className:d.classNames("k-list",{[`k-list-${bt[n]||n}`]:n}),key:"customitem",onClick:this.customItemSelect,onMouseDown:ls},a.createElement("div",{className:d.classNames("k-list-item k-custom-item",{"k-focus":os(p)}),style:{fontStyle:"italic"}},r,a.createElement(d.IconWrap,{name:"plus",icon:Ie.plusIcon,style:{position:"absolute",right:"0.5em"}})));let{group:g}=this.state;return g===void 0&&u!==void 0&&(g=z(l[0],u)),a.createElement(a.Fragment,null,t&&a.createElement("div",{className:"k-list-header"},t),f,a.createElement("div",{className:d.classNames("k-list",{[`k-list-${this.mobileMode?"lg":bt[n]||n}`]:n,"k-virtual-list":this.base.vs.enabled})},!c&&g&&l.length!==0&&a.createElement(We,{group:g,groupMode:"modern",render:h}),this.renderList()),e&&a.createElement("div",{className:"k-list-footer"},e))},this.renderListContainer=()=>{const t=this.base,{dir:e,data:s=[]}=this.props,n=this.base.getPopupSettings(),l=n.width!==void 0?n.width:t.popupWidth,h={dir:e!==void 0?e:t.dirCalculated,width:l,popupSettings:{popupClass:d.classNames(n.popupClass,"k-list-container","k-multiselect-popup"),className:n.className,animate:n.animate,anchor:this.element,show:this.opened,onOpen:this.onPopupOpened,onClose:this.onPopupClosed,appendTo:n.appendTo},itemsCount:[s.length,this.value.length]};return a.createElement(Xe,{...h},this.listContainerContent())},this.renderAdaptiveListContainer=()=>{const{adaptiveTitle:t,filterable:e,filter:s}=this.props,{windowWidth:n=0}=this.state,l=s!==void 0?s:this.state.text;this.localization=xe.provideLocalizationService(this);const h=e?a.createElement(Ke,{value:l,ref:c=>this._adaptiveInput=c&&c.element,onChange:this.onChangeHandler,onKeyDown:this.onInputKeyDown,size:this.props.size,rounded:this.props.rounded,fillMode:this.props.fillMode}):null,u={adaptiveTitle:t,expand:this.opened,onClose:c=>this.onCancel(c),windowWidth:n,mobileFilter:h,footer:{cancelText:this.localization.toLanguageString(Re,ne[Re]),onCancel:this.onCancel,applyText:this.localization.toLanguageString(Pe,ne[Pe]),onApply:this.closePopup}};return a.createElement(At,{...u},a.createElement(fe.ActionSheetContent,{className:"!k-overflow-hidden"},a.createElement("div",{className:"k-list-container"},this.listContainerContent())))},this.closePopup=t=>{const e=this.base.initState();e.syntheticEvent=t,t.stopPropagation(),this.state.focusedIndex!==void 0&&(e.data.focusedIndex=void 0),this.opened&&this.base.togglePopup(e),e.events.push({type:"onClose"});const s=this.props.filter!==void 0?this.props.filter:this.state.text;Y(s)&&s!==""&&this.base.filterChanged("",e),this.state.text&&(e.data.text=""),this.applyState(e)},this.onCancel=t=>{const e=this.base.initState();e.syntheticEvent=t,t.stopPropagation(),this.state.focusedIndex!==void 0&&(e.data.focusedIndex=void 0),this.opened&&this.base.togglePopup(e),e.events.push({type:"onCancel"});const s=this.props.filter!==void 0?this.props.filter:this.state.text;Y(s)&&s!==""&&this.base.filterChanged("",e),this.state.text&&(e.data.text=""),this.applyState(e)},this.renderList=()=>{const{data:t=[],textField:e,listNoDataRender:s,itemRender:n,groupHeaderItemRender:l,dataItemKey:h,virtual:u={skip:0,total:void 0}}=this.props,c=this.base.vs,{focusedIndex:r}=this.getFocusedState(),p=this.base.getPopupSettings(),f=`translateY(${c.translate}px)`;return a.createElement(Ve,{id:this.base.listBoxId,show:this.opened,data:t.slice(),focusedIndex:r-u.skip,value:this.value,textField:e,valueField:h,optionsGuid:this.base.guid,groupField:this.props.groupField,groupMode:"modern",listRef:g=>{c.list=this.base.list=g},wrapperStyle:this.mobileMode?{}:{maxHeight:p.height},wrapperCssClass:"k-list-content",listStyle:c.enabled?{transform:f}:void 0,key:"listKey",skip:u.skip,onClick:this.handleItemClick,itemRender:n,groupHeaderItemRender:l,noDataRender:s,onMouseDown:ls,onBlur:this.handleBlur,onScroll:this.onScroll,wrapperRef:c.scrollerRef,scroller:this.base.renderScrollElement(),ariaSetSize:u.total})},this.onScroll=t=>{const{vs:e,list:s}=this.base;e.scrollHandler(t);const{groupField:n}=this.props;let{data:l=[]}=this.props;if(!(!n||!l.length)&&n){const h=this.itemHeight=this.itemHeight||(e.enabled?e.itemHeight:s?s.children[0].offsetHeight:0),c=t.target.scrollTop-e.skip*h;l=this.base.getGroupedDataModernMode(l,n);let r=l[0][n];for(let p=1;p<l.length&&!(h*p>c);p++)l[p]&&l[p][n]&&(r=l[p][n]);r!==this.state.group&&this.setState({group:r})}},this.customItemSelect=t=>{const e=this.props.filter!==void 0?this.props.filter:this.state.text,{textField:s}=this.props;if(!e)return;const n=this.base.initState();n.syntheticEvent=t;const l=s?{[s]:e}:e;this.state.text!==void 0&&(n.data.text=""),n.data.focusedIndex=void 0,this.base.filterChanged("",n);const h=[...this.value,l];this.triggerOnChange(h,n),this.base.togglePopup(n),this.applyState(n)},this.handleWrapperClick=t=>{const e=this._input;!this.opened&&e&&this.focusElement(e);const s=this.base.initState();s.syntheticEvent=t,!this.state.focused&&!this.mobileMode&&(s.events.push({type:"onFocus"}),s.data.focused=!0),this.mobileMode&&(this.setState({currentValue:this.tagsToRender}),this.mobileMode&&window.setTimeout(()=>this._adaptiveInput&&this._adaptiveInput.focus(),300)),this.base.togglePopup(s),this.applyState(s)},this.handleItemClick=(t,e)=>{const s=this.base.initState();s.syntheticEvent=e,this.handleItemSelect(t,s),this.props.autoClose&&!this.mobileMode&&this.base.togglePopup(s),e.stopPropagation(),this.applyState(s)},this.handleBlur=t=>{if(!this.state.focused||this._skipFocusEvent)return;const e=this.base.initState(),{allowCustom:s,filterable:n}=this.props;e.syntheticEvent=t,e.data.focused=!1,e.events.push({type:"onBlur"}),this.opened&&!this.mobileMode&&(this.state.opened&&(e.data.opened=!1),e.events.push({type:"onClose"})),!s&&!n&&this.state.text&&(e.data.text=""),this.applyState(e)},this.handleFocus=t=>{this._skipFocusEvent||this.base.handleFocus(t)},this.onPopupOpened=()=>{this._input&&this.state.focused&&!this.mobileMode&&this.focusElement(this._input)},this.onPopupClosed=()=>{this.state.focused&&window.setTimeout(()=>{this.state.focused&&this.focusElement(this._input)},0)},this.setValidity=()=>{this._input&&this._input.setCustomValidity&&this._input.setCustomValidity(this.validity.valid?"":this.props.validationMessage||$s)},d.validatePackage(qe)}get _inputId(){return this.props.id}get document(){if(d.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get opened(){return!!(this.props.opened!==void 0?this.props.opened:this.state.opened)}get tagsToRender(){const{tags:i,textField:t}=this.props;let e=[];return i===void 0?this.value.forEach(s=>{e.push({text:z(s,t),data:[s]})}):e.push(...i),e}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=ke&&this.props.adaptive)}get value(){const i=[];return this._valueItemsDuringOnChange?i.push(...this._valueItemsDuringOnChange):this.props.value?i.push(...this.props.value):this.state.value?i.push(...this.state.value):this.props.defaultValue&&i.push(...this.props.defaultValue),i}get name(){return this.props.name}get validity(){const i=this.props.validationMessage!==void 0,t=!this.required||this.value!==null&&this.value.length>0&&this.value!==void 0,e=this.props.valid!==void 0?this.props.valid:t;return{customError:i,valid:e,valueMissing:this.value===null}}get required(){return this.props.required!==void 0?this.props.required:Wt.defaultProps.required}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:Wt.defaultProps.validityStyles}componentDidUpdate(i,t){var f;const{virtual:e,groupField:s="",data:n=[]}=this.props,l=e?e.skip:0,h=i.virtual?i.virtual.total:0,u=i.opened!==void 0?i.opened:t.opened,c=!u&&this.opened,r=u&&!this.opened;if(!this.base.getPopupSettings().animate&&r&&this.onPopupClosed(),e&&e.total!==h)this.base.vs.calcScrollElementHeight(),this.base.vs.reset();else{let{focusedItem:g,focusedIndex:v}=this.getFocusedState();s!==""&&(v=(f=this.base.getGroupedDataModernMode(n,s))==null?void 0:f.indexOf(g)),c&&e?this.base.scrollToVirtualItem(e,v-l):c&&!e?(n&&n.length!==0&&this.base.resetGroupStickyHeader(n[0][s],this),this.base.scrollToItem(v)):this.opened&&u&&g&&this.scrollToFocused&&this.base.scrollToItem(v-l)}this.scrollToFocused=!1,this.setValidity()}componentDidMount(){var i;this.observerResize=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.base.didMount(),this.setValidity(),(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentWillUnmount(){var i;(i=this.document)!=null&&i.body&&this.observerResize&&this.observerResize.disconnect()}onNavigate(i,t,e){const{allowCustom:s,data:n=[]}=this.props,l=this.props.filter!==void 0?this.props.filter:this.state.text,{focusedType:h,focusedIndex:u}=this.getFocusedState(),c=s&&l,r=os(h),p=this.base,f=p.vs;if(this.opened&&t===d.Keys.up&&r)this.state.focusedIndex!==void 0&&(i.data.focusedIndex=void 0);else{const g=p.navigation.navigate({keyCode:t,current:u,max:(f.enabled?f.total:n.length)-1,min:c?-1:0,skipItems:e||void 0});g!==void 0&&(this.itemFocus(g,i),this.scrollToFocused=!0)}this.applyState(i)}render(){const{style:i,className:t,label:e,dir:s,disabled:n,textField:l,dataItemKey:h,virtual:u,size:c,rounded:r,fillMode:p,loading:f,filter:g}=this.props,{text:v,focused:m,focusedTag:b,currentValue:C}=this.state,w=this.base.vs,D=this.props.id||this._inputId;w.enabled=u!==void 0,u!==void 0&&(w.skip=u.skip,w.total=u.total,w.pageSize=u.pageSize);const _=this.mobileMode&&this.opened?C:this.tagsToRender;this.setItems(this.tagsToRender,this._tags);const O=!this.validityStyles||this.validity.valid,B=!!(g!==void 0?g:v)||_&&_.length>0,[E,K]=Me(this.props.prefix||a.Fragment),[S,k]=Me(this.props.suffix||a.Fragment),N=a.createElement(a.Fragment,null,a.createElement("div",{ref:this.componentRef,className:d.classNames("k-multiselect k-input",t,{[`k-input-${bt[c]||c}`]:c,[`k-rounded-${qs[r]||r}`]:r,[`k-input-${p}`]:p,"k-focus":m&&!n,"k-invalid":!O,"k-disabled":n,"k-loading":f,"k-required":this.required}),style:e?{...i,width:void 0}:i,dir:s,onFocus:this.handleFocus,onBlur:this.handleBlur,onClick:this.handleWrapperClick,onMouseDown:ks},this.props.prefix&&a.createElement(E,{...K}),a.createElement("div",{className:d.classNames("k-input-values")},a.createElement("div",{className:d.classNames("k-chip-list",{[`k-chip-list-${bt[c]||c}`]:c}),role:"listbox",id:"tagslist-"+this.base.guid},_&&_.length>0&&a.createElement(Ht,{tagRender:this.props.tagRender,onTagDelete:this.onTagDelete,data:_,guid:this.base.guid,focused:b?_.find(q=>pt(q,b,h)):void 0,size:c})),this.renderSearchBar(D)),f&&a.createElement(d.IconWrap,{className:"k-input-loading-icon",name:"loading"}),this.props.suffix&&a.createElement(S,{...k}),B&&a.createElement(et,{onClick:this.clearButtonClick}),!this.mobileMode&&this.renderListContainer()),this.mobileMode&&this.renderAdaptiveListContainer());return e?a.createElement(Ae.FloatingLabel,{label:e,editorId:D,editorValue:v||z(this.value[0],l),editorValid:O,editorDisabled:n,style:{width:i?i.width:void 0},children:N}):N}renderSearchBar(i){const{activedescendant:t,focusedTag:e,currentValue:s}=this.state,{disabled:n,placeholder:l,ariaDescribedBy:h}=this.props,u=!this.mobileMode&&(this.props.filter!==void 0?this.props.filter:this.state.text)||"",{focusedIndex:c}=this.getFocusedState(),r=this.value.length===0&&!u?l:void 0,p=s&&s.length>0?void 0:l,f=t===st.TagsList&&e!==void 0?`tag-${this.base.guid}-${e.text.replace(/\s+/g,"-")}`:`option-${this.base.guid}-${c}`;return a.createElement(gt,{id:i,size:Math.max((r||"").length,u.length,1),tabIndex:this.props.tabIndex,accessKey:this.props.accessKey,placeholder:this.mobileMode&&this.opened?p:r,value:u,onChange:this.onChangeHandler,onKeyDown:this.onInputKeyDown,ref:this.searchbarRef,disabled:n,expanded:this.opened,owns:this.base.listBoxId,role:"combobox",activedescendant:f,ariaDescribedBy:`tagslist-${this.base.guid}${h?" "+h:""}`,ariaLabelledBy:this.props.ariaLabelledBy,ariaRequired:this.required})}onTagsNavigate(i,t){const e=i.keyCode,{focusedTag:s}=this.state,n=this._tags,l=this.props.dataItemKey;let h=s?n.findIndex(r=>pt(r,s,l)):-1,u;const c=h!==-1;if(e===d.Keys.left)c?h=Math.max(0,h-1):h=n.length-1,u=n[h];else if(e===d.Keys.right)h===n.length-1?u=void 0:c&&(h=Math.min(n.length-1,h+1),u=n[h]);else if(e===d.Keys.home&&!i.shiftKey)u=n[0];else if(e===d.Keys.end&&!i.shiftKey)u=n[n.length-1];else if(e===d.Keys.delete){if(c){const r=this.value;ht(r,n[h].data,l),this.triggerOnChange(r,t)}}else if(e===d.Keys.backspace){const r=this.value;if(c)ht(r,n[h].data,l),this.triggerOnChange(r,t);else if(!c&&n.length){const p=n.pop();ht(r,p.data,l),this.triggerOnChange(r,t)}}u!==s&&(t.data.focusedTag=u,t.data.activedescendant=st.TagsList),this.applyState(t)}triggerOnChange(i,t){this.props.value===void 0&&(t.data.value=[...i]),this._valueItemsDuringOnChange=[],this.setItems(i,this._valueItemsDuringOnChange),t.events.push({type:"onChange"})}selectFocusedItem(i,t){const{data:e=[],virtual:s}=this.props,{focusedIndex:n}=t||this.getFocusedState(),l=s?s.skip:0;e[n-l]!==void 0&&this.handleItemClick(n,i)}setItems(i,t){t.length=0,t.push(...i)}getFocusedState(){const{focusedIndex:i}=this.state,t=this.props.filter!==void 0?this.props.filter:this.state.text,{allowCustom:e,data:s=[],dataItemKey:n,virtual:l,textField:h,focusedItemIndex:u=_e,skipDisabledItems:c}=this.props,r=l&&l.skip||0;let p;if(i!==void 0)return{focusedIndex:i,focusedItem:s[i-r],focusedType:1};const f=this.value;if(e&&t)return{focusedItem:null,focusedIndex:-1,focusedType:2};if(t)return p=u(s,t,h),{focusedItem:s[p],focusedIndex:p+r,focusedType:1};if(f.length){const g=f[f.length-1];return p=s.findIndex(v=>L(v,g,n)),s[p]!==void 0?{focusedIndex:p+r,focusedItem:s[p],focusedType:1}:{focusedType:0,focusedIndex:-1}}else if(c&&h&&!t&&r===0){const g=s.findIndex(v=>!v.disabled&&v[h]);return{focusedIndex:g,focusedItem:s[g-r],focusedType:1}}return r===0?{focusedItem:s[0],focusedIndex:0,focusedType:1}:{focusedType:0,focusedIndex:-1}}focusElement(i){this._skipFocusEvent=!0,i.focus(),window.setTimeout(()=>this._skipFocusEvent=!1,0)}applyState(i){this.base.applyState(i),this._valueItemsDuringOnChange=null}calculateMedia(i){for(let t of i)this.setState({windowWidth:t.target.clientWidth})}updateStateOnKeyboardNavigation(i,t){this.setState({value:i}),this.triggerOnChange(i,t),this.applyState(t)}getLastSelectedOrDeselectedIndex(i,t){return this._lastSelectedOrDeslectedItemIndex===null&&(this._lastSelectedOrDeslectedItemIndex=t),this._lastSelectedOrDeslectedItemIndex!==null?this._lastSelectedOrDeslectedItemIndex+i:null}};let it=Wt;it.displayName="MultiSelect",it.propTypes={...ae.propTypes,autoClose:o.bool,value:o.arrayOf(o.any),defaultValue:o.arrayOf(o.any),dataItemKey:o.string,placeholder:o.string,tags:o.arrayOf(o.shape({text:o.string,data:o.arrayOf(o.any)})),tagRender:o.func,id:o.string,ariaLabelledBy:o.string,ariaDescribedBy:o.string,groupField:o.string,list:o.any,adaptive:o.bool,adaptiveTitle:o.string,onCancel:o.func,skipDisabledItems:o.bool},it.defaultProps={...ae.defaultProps,autoClose:!0,required:!1,size:"medium",rounded:"medium",fillMode:"solid",groupMode:"modern",skipDisabledItems:!0,prefix:void 0,suffix:void 0};const rs=d.createPropsContext(),ds=d.withIdHOC(d.withPropsContext(rs,it));ds.displayName="KendoReactMultiSelect";const Ts=i=>a.createElement(Ve,{...i,wrapperCssClass:"k-table-body k-table-scroller",listClassName:d.classNames("k-table k-table-list",{"k-virtual-table":i.virtual!==void 0}),listStyle:{...i.listStyle}}),Gs=(i,t)=>i?typeof i=="number"?i+"px":i:t,cs=d.createPropsContext(),It=a.forwardRef((i,t)=>{const e=d.usePropsContext(cs,i),s=a.useRef(null),n=a.useRef(null),l=d.getScrollbarWidth(),{columns:h=Ge.columns,popupSettings:u=Ge.popupSettings,className:c,size:r,prefix:p=void 0,suffix:f=void 0,onOpen:g,onClose:v,onFocus:m,onBlur:b,onChange:C,onFilterChange:w,onPageChange:D,..._}=e;a.useImperativeHandle(s,()=>({element:n.current&&n.current.element,focus(){n.current&&n.current.focus()},get value(){return n.current&&n.current.value},get name(){return n.current&&n.current.name},props:e})),a.useImperativeHandle(t,()=>s.current);const O=a.useMemo(()=>{if(e.groupField!==void 0&&e.data)return z(e.data[0],e.groupField)},[e.data,e.groupField]),[B,E]=a.useState(O),[K,S]=a.useState(!0),[k]=p?Me(e.prefix||a.Fragment):[],[N]=f?Me(e.suffix||a.Fragment):[],q=a.useMemo(()=>{const V=a.createElement("th",{className:"k-table-th",colSpan:h.length},B);return a.createElement(a.Fragment,null,e.header,a.createElement("div",{className:"k-table-header-wrap"},a.createElement("table",{className:"k-table",role:"presentation"},a.createElement("colgroup",null,h.map((G,ye)=>a.createElement("col",{key:G.uniqueKey?G.uniqueKey:ye,style:{width:G.width?G.width:Ge.width}}))),a.createElement("thead",{className:"k-table-thead"},a.createElement("tr",{className:"k-table-row"},h.map((G,ye)=>a.createElement("th",{className:"k-table-th",key:G.uniqueKey?G.uniqueKey:ye},G.header||" "))),B&&K&&a.createElement("tr",{className:"k-table-group-row"},e.groupStickyHeaderItemRender?e.groupStickyHeaderItemRender.call(void 0,V,{}):V)))))},[e.header,h,B,K]),X=a.useMemo(()=>`calc(${h.map(V=>Gs(V.width,Ge.width)).filter(Boolean).join(" + ")} + ${l}px + 4px)`,[h,l]),J=e.virtual?e.virtual.skip:0,Q=a.useCallback((V,G)=>{const ye=h.map((P,nt)=>a.createElement("span",{className:e.itemRender?void 0:"k-table-td",style:e.itemRender?void 0:{width:P.width?P.width:Ge.width},key:P.uniqueKey?P.uniqueKey:nt},P.field?String(d.getter(P.field)(G.dataItem)):""));let De,A,Z,re,W=e.data||[];const Ne=G.index-J;e.groupField!==void 0&&(re=d.getter(e.groupField),A=re(W[Ne]),Z=re(W[Ne-1]),A&&Z&&A!==Z&&(De=A)),De&&e.groupMode==="classic"&&ye.push(a.createElement("div",{key:"group",className:"k-table-td k-table-group-td"},a.createElement("span",null,De)));const de=a.cloneElement(V,{...V.props,className:d.classNames("k-table-row",{"k-table-alt-row":G.index%2!==0,"k-focus":G.focused,"k-selected":G.selected,"k-first":!!De,"k-disabled":G.dataItem.disabled})},ye);return e.itemRender?e.itemRender.call(void 0,de,G):de},[h,e.groupField,e.itemRender,e.data,J]),T=a.useCallback((V,G)=>{V&&V.call(void 0,{...G,target:s.current})},[]),me=a.useCallback(V=>(e.virtual||E(O),T(g,V)),[T,g,e.virtual,O]),R=a.useCallback(V=>T(v,V),[v]),ee=a.useCallback(V=>T(m,V),[m]),oe=a.useCallback(V=>T(b,V),[b]),je=a.useCallback(V=>T(C,V),[C]),Le=a.useCallback(V=>T(D,V),[D]),Ye=a.useCallback(V=>(E(O),T(w,{...V,mobileMode:V.target.mobileMode})),[w]),$=a.useCallback(V=>{E(V.group)},[]);a.useEffect(()=>{d.setScrollbarWidth()}),a.useEffect(()=>{const V=e.data;E(O),V&&V.length!==0?S(!0):S(!1)},[e.data]);const ze=a.useCallback(V=>a.createElement(Ts,{...V}),[]);return a.createElement(ct.PopupPropsContext.Provider,{value:V=>({...V,popupClass:`k-dropdowngrid-popup ${u.popupClass}`})},a.createElement(Lt,{..._,list:ze,popupSettings:{width:X,...u,className:u.className},ref:n,header:q,itemRender:Q,groupHeaderItemRender:e.groupHeaderItemRender,size:e.size,rounded:e.rounded,fillMode:e.fillMode,groupMode:e.groupMode,groupField:e.groupField,isMultiColumn:!0,onOpen:me,onClose:R,onFocus:ee,onBlur:oe,onChange:je,onFilterChange:Ye,onPageChange:Le,onGroupScroll:$,className:d.classNames("k-dropdowngrid",c),required:e.required,adaptive:e.adaptive,adaptiveFilter:e.adaptiveFilter,adaptiveTitle:e.adaptiveTitle,footer:e.footer,footerClassName:"k-table-footer",prefix:k,suffix:N}))}),Us={...Te.propTypes,columns:o.any.isRequired},Ge={columns:[],popupSettings:{},width:"200px",size:"medium",rounded:"medium",fillMode:"solid"};It.displayName="KendoMultiColumnComboBox",It.propTypes=Us,It.defaultProps=Ge;function us(i,t,e){const[s,n]=a.useState(t);return a.useEffect(()=>{s!==void 0&&i.current&&n(i.current.offsetWidth)},e),s}const hs=i=>a.createElement("div",{className:"k-nodata"},a.createElement("div",null,i.children)),{sizeMap:js,roundedMap:Ys}=d.kendoThemeMaps,Js="Please select a value from the list!",Qs=i=>a.createElement("span",{className:"k-input-value-text"},i.children),ps=i=>i.split("_").map(t=>parseInt(t,10)),Xs=(i,t)=>{const{validationMessage:e,valid:s,required:n}=i;return{customError:e!==void 0,valid:!!(s!==void 0?s:!n||t),valueMissing:!t}},fs={selectField:"selected",subItemsField:"items",popupSettings:{animate:!0,width:"200px",height:"200px"},data:[],required:!1,style:{},validityStyles:!0,size:"medium",rounded:"medium",fillMode:"solid"},gs=d.createPropsContext(),qt=a.forwardRef((i,t)=>{d.validatePackage(qe);const e=d.usePropsContext(gs,i),s={...fs,...e},n=d.useId(),l=s.id||n,{data:h,dataItemKey:u,popupSettings:c,style:r,opened:p,disabled:f,onOpen:g=d.noop,onClose:v=d.noop,placeholder:m,label:b,name:C,selectField:w,subItemsField:D,validationMessage:_,valid:O,required:B,validityStyles:E}=s,K=d.getTabIndex(s.tabIndex,f),S=a.useRef(null),k=a.useRef(null),N=a.useRef(null),q=a.useRef(null),X=a.useRef(null),J=a.useRef(null),Q=a.useRef(!1),[T,me]=a.useState(void 0),R=s.value!==void 0,ee=R?s.value:T!==void 0?T:s.defaultValue,oe=Y(ee),je=oe?z(ee,s.textField):"",Le=Xs({validationMessage:_,valid:O,required:B},oe),Ye=a.useCallback(()=>k.current&&k.current.focus(),[]);a.useImperativeHandle(S,()=>({props:s,element:k.current,focus:Ye})),a.useImperativeHandle(t,()=>S.current);const $=d.useRtl(k,s.dir),ze=c.width!==void 0?c.width:r.width!==void 0?r.width:fs.popupSettings.width,G={width:us(k,ze),...$!==void 0?{direction:$}:{}},[ye,De]=a.useState(!1),A=p!==void 0?p:ye,[Z,re]=a.useState(!1),[W,Ne]=a.useState(),de=!!(W&&W<=ke&&s.adaptive),[P,nt]=a.useState(""),bs=a.useCallback(()=>{X.current&&X.current.setCustomValidity&&X.current.setCustomValidity(Le.valid?"":_===void 0?Js:_)},[_,Le]);a.useEffect(bs),a.useEffect(()=>{const x=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(jt.bind(void 0));return document!=null&&document.body&&x&&x.observe(document.body),()=>{document!=null&&document.body&&x&&x.disconnect()}},[]);const yt=a.useCallback(x=>{if(!A){if(g){const F={...x};g.call(void 0,F)}p===void 0&&De(!0)}},[A,p,g]),Fe=a.useCallback(x=>{if(A){if(v){const F={...x};v.call(void 0,F)}p===void 0&&(De(!1),de&&setTimeout(()=>{var F;U((F=q.current)==null?void 0:F.element)},300))}},[A,p,v,de]),$t=a.useCallback(x=>{if(!x.isDefaultPrevented()&&S.current){re(!0);const F={syntheticEvent:x,nativeEvent:x.nativeEvent,target:S.current};(A?Fe:yt)(F)}},[A,p,g,v]),le=a.useCallback(x=>{Q.current=!0,x(),window.setTimeout(()=>Q.current=!1,0)},[]),Je=a.useCallback(x=>{var y,H;const{keyCode:F,altKey:j}=x,ue=J.current&&J.current.element;if(!S.current||x.isDefaultPrevented()&&((y=N.current)==null?void 0:y.element)===x.target)return;const I={syntheticEvent:x,nativeEvent:x.nativeEvent,target:S.current};if(A)if(F===d.Keys.esc||j&&F===d.Keys.up)x.preventDefault(),Fe(I);else if(ue&&ue.querySelector(".k-focus")&&(F===d.Keys.up||F===d.Keys.down||F===d.Keys.left||F===d.Keys.right||F===d.Keys.home||F===d.Keys.end)){if(F===d.Keys.up&&((H=N.current)!=null&&H.element)){const se=Array.from(ue.querySelectorAll(".k-treeview-item")),we=[...se].reverse().find(Ee=>!!(Ee&&Ee.querySelector(".k-focus")));if(we&&se.indexOf(we)===0)return le(()=>{var Ee;U((Ee=N.current)==null?void 0:Ee.element)})}le(d.noop)}else F===d.Keys.down&&le(()=>{var se;U(((se=N.current)==null?void 0:se.element)||ue)});else j&&F===d.Keys.down?(x.preventDefault(),yt(I)):A||F===d.Keys.esc&&Et(x)},[A,p,g,v]),He=a.useCallback(x=>{const{keyCode:F,altKey:j}=x;j||F!==d.Keys.up&&F!==d.Keys.down||(x.preventDefault(),le(F===d.Keys.up?()=>{U(k.current)}:()=>{U(J.current&&J.current.element)}))},[]),U=a.useCallback(x=>{x&&le(()=>x.focus())},[]),ve=a.useCallback(()=>{var x;!Z&&A&&!p?Fe({target:S.current}):e.filterable?U((x=N.current)==null?void 0:x.element):U(J.current&&J.current.element)},[v,e.filterable,Z,p,A]),te=a.useCallback(()=>{Z&&U(k.current)},[Z]),Tt=a.useCallback(x=>{if(!Z&&!Q.current&&(re(!0),e.onFocus&&S.current)){const F={syntheticEvent:x,nativeEvent:x.nativeEvent,target:S.current};e.onFocus.call(void 0,F)}},[Z,e.onFocus]),Gt=a.useCallback(x=>{if(Z&&!Q.current&&S.current){re(!1);const F={syntheticEvent:x,nativeEvent:x.nativeEvent,target:S.current};if(e.onBlur){const j={...F};e.onBlur.call(void 0,j)}de||Fe(F)}},[Z,e.onBlur,A,p,v]),Ut=a.useCallback(()=>{Z&&le(d.noop),de&&setTimeout(()=>{var x;U((x=q.current)==null?void 0:x.element)},300)},[Z,de]),St=a.useCallback((x,F,j)=>{if(e.onChange){const ue={value:F,level:j?ps(j):[],...x};e.onChange.call(void 0,ue)}R||me(F)},[e.onChange,R]),wt=a.useCallback(x=>{if(L(x.item,ee,u)||!S.current)return;const{item:F,itemHierarchicalIndex:j,nativeEvent:ue,syntheticEvent:I}=x,y={syntheticEvent:I,nativeEvent:ue,target:S.current};St(y,F,j),Fe(y)},[R,ee,e.onChange,u,A,p,v]),Et=a.useCallback(x=>{if(!S.current)return;const F={syntheticEvent:x,nativeEvent:x.nativeEvent,target:S.current};St(F,null),Fe(F),x.preventDefault()},[R,e.onChange,A,p,v]),Ct=a.useCallback(x=>{if(x.syntheticEvent.stopPropagation(),e.onExpandChange&&S.current){const{item:F,itemHierarchicalIndex:j,nativeEvent:ue,syntheticEvent:I}=x,y={level:ps(j),item:F,nativeEvent:ue,syntheticEvent:I,target:S.current};e.onExpandChange.call(void 0,y)}},[e.onExpandChange]),at=a.useCallback(x=>{if(e.onFilterChange&&S.current){const j={filter:{field:e.textField,operator:"contains",value:x.target.value},syntheticEvent:x.syntheticEvent,nativeEvent:x.nativeEvent,target:S.current};e.onFilterChange.call(void 0,j),e.filter===void 0&&nt(x.target.value)}},[e.onFilterChange,e.filter,e.textField]),lt=()=>{const x=s.filterable?a.createElement(Ke,{value:s.filter===void 0?P:s.filter,ref:q,onChange:at,onKeyDown:He,size:be,rounded:Se,fillMode:Oe}):null,F={adaptiveTitle:s.adaptiveTitle,expand:A,onClose:j=>Fe(j),windowWidth:W,mobileFilter:x};return a.createElement(At,{...F},a.createElement(fe.ActionSheetContent,{className:"!k-overflow-hidden"},a.createElement("div",{className:"k-list-container"},a.createElement("div",{className:"k-list k-list-lg"},h.length>0?a.createElement(ut.TreeView,{ref:J,tabIndex:K,data:ot,focusIdField:u,textField:s.textField,selectField:w,expandField:s.expandField,childrenField:D,expandIcons:!0,onItemClick:wt,onExpandChange:Ct,size:be,item:s.item,dir:$}):a.createElement(rt,null,dt.toLanguageString(ge,ne[ge]))))))},jt=a.useCallback(x=>{for(let F of x)Ne(F.target.clientWidth)},[]),ot=a.useMemo(()=>R||!oe?h:d.mapTree(h,D,x=>d.extendDataItem(x,D,{[w]:L(x,ee,u)})),[h,ee,R,oe,w,D]),rt=s.listNoData||hs,kt=s.valueHolder||Qs,dt=xe.useLocalization(),Dt=!E||Le.valid,{size:be,rounded:Se,fillMode:Oe}=s,ce=a.createElement(a.Fragment,null,a.createElement("span",{className:d.classNames("k-dropdowntree k-picker",s.className,{[`k-picker-${js[be]||be}`]:be,[`k-rounded-${Ys[Se]||Se}`]:Se,[`k-picker-${Oe}`]:Oe,"k-focus":Z,"k-invalid":!Dt,"k-loading":s.loading,"k-required":B,"k-disabled":s.disabled}),tabIndex:K,accessKey:s.accessKey,id:l,style:b?{...r,width:void 0}:r,dir:$,ref:k,onKeyDown:f?void 0:Je,onMouseDown:Ut,onClick:f?void 0:$t,onFocus:Tt,onBlur:Gt,role:"combobox","aria-haspopup":"tree","aria-expanded":A,"aria-disabled":f,"aria-label":b,"aria-labelledby":s.ariaLabelledBy,"aria-describedby":s.ariaDescribedBy,"aria-required":B},a.createElement("span",{className:"k-input-inner"},a.createElement(kt,{item:ee},je||m)),s.loading&&a.createElement(d.IconWrap,{className:"k-input-loading-icon",name:"loading"}),oe&&!f&&a.createElement("span",{onClick:Et,className:"k-clear-value",title:dt.toLanguageString(Ze,ne[Ze]),role:"button",tabIndex:-1,onMouseDown:x=>x.preventDefault()},a.createElement(d.IconWrap,{name:"x",icon:Ie.xIcon})),a.createElement(Ce.Button,{tabIndex:-1,type:"button","aria-label":"select",className:"k-input-button",size:be,fillMode:Oe,themeColor:"base",rounded:null,icon:"caret-alt-down",svgIcon:Ie.caretAltDownIcon}),a.createElement("select",{name:C,ref:X,tabIndex:-1,"aria-hidden":!0,title:b,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},a.createElement("option",{value:s.valueMap?s.valueMap.call(void 0,ee):ee})),!de&&a.createElement(ct.Popup,{className:d.classNames(c.className,{"k-rtl":$==="rtl"}),popupClass:d.classNames(c.popupClass,"k-dropdowntree-popup"),style:G,animate:c.animate,anchor:k.current,show:A,onOpen:ve,onClose:te,appendTo:c.appendTo},s.filterable&&a.createElement(Ke,{value:s.filter===void 0?P:s.filter,ref:N,onChange:at,onKeyDown:He,size:be,rounded:Se,fillMode:Oe}),h.length>0?a.createElement(ut.TreeView,{ref:J,tabIndex:K,data:ot,focusIdField:u,textField:s.textField,selectField:w,expandField:s.expandField,childrenField:D,expandIcons:!0,onItemClick:wt,onExpandChange:Ct,size:be,item:s.item,dir:$}):a.createElement(rt,null,dt.toLanguageString(ge,ne[ge])))),de&&lt());return b?a.createElement(Ae.FloatingLabel,{label:b,editorValue:je,editorPlaceholder:m,editorValid:Dt,editorDisabled:f,editorId:l,style:{width:r?r.width:void 0},children:ce,dir:$}):ce}),Zs={opened:o.bool,disabled:o.bool,dir:o.string,tabIndex:o.number,accessKey:o.string,data:o.array,value:o.any,valueMap:o.func,placeholder:o.string,dataItemKey:o.string.isRequired,textField:o.string.isRequired,selectField:o.string,expandField:o.string,subItemsField:o.string,className:o.string,style:o.object,label:o.string,validationMessage:o.string,validityStyles:o.bool,valid:o.bool,required:o.bool,name:o.string,id:o.string,ariaLabelledBy:o.string,ariaDescribedBy:o.string,filterable:o.bool,filter:o.string,loading:o.bool,popupSettings:o.shape({animate:o.oneOfType([o.bool,o.shape({openDuration:o.number,closeDuration:o.number})]),popupClass:o.string,className:o.string,appendTo:o.any,width:o.oneOfType([o.string,o.number]),height:o.oneOfType([o.string,o.number])}),onOpen:o.func,onClose:o.func,onFocus:o.func,onBlur:o.func,onChange:o.func,onFilterChange:o.func,onExpandChange:o.func,item:o.func,valueHolder:o.func,listNoData:o.func,adaptiveTitle:o.string,adaptive:o.bool};qt.displayName="KendoReactDropDownTree",qt.propTypes=Zs;const Ps="Please select a value from the list!",{sizeMap:vs,roundedMap:Rs}=d.kendoThemeMaps,ei=i=>i.split("_").map(t=>parseInt(t,10)),ti=(i,t)=>{const{validationMessage:e,valid:s,required:n}=i;return{customError:e!==void 0,valid:!!(s!==void 0?s:!n||t),valueMissing:!t}},Be={checkField:"checkField",checkIndeterminateField:"checkIndeterminateField",subItemsField:"items",popupSettings:{animate:!0,width:"200px",height:"200px"},size:"medium",rounded:"medium",fillMode:"solid",required:!1,validityStyles:!0},ms=d.createPropsContext(),xt=a.forwardRef((i,t)=>{const e=d.usePropsContext(ms,i);d.validatePackage(qe);const s=d.useId(),n=e.id||s,{data:l=[],dataItemKey:h,popupSettings:u={},style:c={},opened:r,disabled:p,onOpen:f=d.noop,onClose:g=d.noop,placeholder:v,label:m,name:b,checkField:C=Be.checkField,checkIndeterminateField:w=Be.checkIndeterminateField,subItemsField:D=Be.subItemsField,validationMessage:_,valid:O,tags:B,value:E,required:K=Be.required,validityStyles:S=Be.validityStyles}=e,k=d.getTabIndex(e.tabIndex,p),N=a.useRef(null),q=a.useRef(null),X=a.useRef(null),J=a.useRef(null),Q=a.useRef(null),T=a.useRef(null),me=a.useRef(!1),R=a.useRef([]),ee=a.useRef(null),[oe,je]=a.useState(),[Le,Ye]=a.useState(!1),[$,ze]=a.useState(!1),[V,G]=a.useState(),[ye,De]=a.useState([]),[A,Z]=a.useState(""),re=!!(V&&V<=ke&&e.adaptive),W=r!==void 0?r:Le,Ne=!!(Array.isArray(E)&&E.length),de=ti({validationMessage:_,valid:O,required:K},Ne),P=d.useRtl(q,e.dir),nt=u.width!==void 0?u.width:c.width!==void 0?c.width:Be.popupSettings.width,yt={width:us(q,nt),...P!==void 0?{direction:P}:{}},Fe=a.useCallback(()=>q.current&&q.current.focus(),[]);R.current=B===void 0?(E||[]).map(I=>({text:z(I,e.textField),data:[I]})):[...B],a.useImperativeHandle(N,()=>({props:e,element:q.current,focus:Fe})),a.useImperativeHandle(t,()=>N.current);const $t=a.useCallback(()=>{Q.current&&Q.current.setCustomValidity&&Q.current.setCustomValidity(de.valid?"":_===void 0?Ps:_)},[_,de]);a.useEffect($t),a.useEffect(()=>{const I=d.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(Dt.bind(void 0));return document!=null&&document.body&&I&&I.observe(document.body),()=>{I&&I.disconnect()}},[]),a.useEffect(()=>{ee.current&&W&&ee.current.setPosition(ee.current._popup)},[E,W]);const le=a.useCallback((I,y,H)=>{if(e.onChange){const se={items:y,operation:H,...I};e.onChange.call(void 0,se)}},[e.onChange]),Je=a.useCallback(I=>{if(L(I.item,E,h)||!N.current)return;const{item:y,nativeEvent:H,syntheticEvent:se}=I,we={syntheticEvent:se,nativeEvent:H,target:N.current};le(we,[y],"toggle")},[E,h,le]),He=a.useCallback(I=>{if(!W){if(f){const y={...I};f.call(void 0,y)}r===void 0&&(Ye(!0),De(E||[]),re&&setTimeout(()=>{var y;te((y=J.current)==null?void 0:y.element)},300))}},[W,r,f,re,J]),U=a.useCallback(I=>{if(W){if(g){const y={...I};g.call(void 0,y)}r===void 0&&Ye(!1)}},[W,r,g]),ve=a.useCallback(I=>{me.current=!0,I(),window.setTimeout(()=>me.current=!1,0)},[]),te=a.useCallback(I=>{I&&ve(()=>I.focus())},[ve]),Tt=a.useCallback(()=>{var I;!$&&W?U({target:N.current}):e.filterable?te((I=X.current)==null?void 0:I.element):te(T.current&&T.current.element)},[$,W,te,U,e.filterable]),Gt=a.useCallback(()=>{$&&te(q.current)},[$,te]),Ut=a.useCallback(I=>{if(!$&&!me.current&&(ze(!0),e.onFocus&&N.current)){const y={syntheticEvent:I,nativeEvent:I.nativeEvent,target:N.current};e.onFocus.call(void 0,y)}},[$,e.onFocus]),St=a.useCallback(I=>{if($&&!me.current&&N.current){ze(!1);const y={syntheticEvent:I,nativeEvent:I.nativeEvent,target:N.current};if(e.onBlur){const H={...y};e.onBlur.call(void 0,H)}re||U(y)}},[$,e.onBlur,W,r,g]),wt=a.useCallback(()=>{$&&ve(d.noop)},[$,ve]),Et=a.useCallback(I=>{if(!I.isDefaultPrevented()&&N.current){ze(!0);const y={syntheticEvent:I,nativeEvent:I.nativeEvent,target:N.current};W||He(y)}},[W,He]),Ct=a.useCallback(I=>{var Ee,Is;const{keyCode:y,altKey:H}=I,se=T.current&&T.current.element;if(!N.current||I.isDefaultPrevented()&&((Ee=X.current)==null?void 0:Ee.element)===I.target)return;const we={syntheticEvent:I,nativeEvent:I.nativeEvent,target:N.current};if(E&&E.length>0&&(y===d.Keys.left||y===d.Keys.right||y===d.Keys.home||y===d.Keys.end||y===d.Keys.delete)){const ie=R.current;let he=oe?ie.findIndex(ni=>pt(ni,oe,h)):-1,pe;const Yt=he!==-1;y===d.Keys.left?(Yt?he=Math.max(0,he-1):he=ie.length-1,pe=ie[he]):y===d.Keys.right?he===ie.length-1?pe=void 0:Yt&&(he=Math.min(ie.length-1,he+1),pe=ie[he]):y===d.Keys.home?pe=ie[0]:y===d.Keys.end?pe=ie[ie.length-1]:y===d.Keys.delete&&Yt&&le(we,ie[he].data,"delete"),pe!==oe&&je(pe)}if(W)if(y===d.Keys.esc||H&&y===d.Keys.up)I.preventDefault(),U(we);else if(se&&se.querySelector(".k-focus")&&(y===d.Keys.up||y===d.Keys.down||y===d.Keys.left||y===d.Keys.right||y===d.Keys.home||y===d.Keys.end)){if(y===d.Keys.up&&((Is=X.current)!=null&&Is.element)){const ie=Array.from(se.querySelectorAll(".k-treeview-item")),he=[...ie].reverse().find(pe=>!!(pe&&pe.querySelector(".k-focus")));if(he&&ie.indexOf(he)===0)return ve(()=>{var pe;te((pe=X.current)==null?void 0:pe.element)})}ve(d.noop)}else y===d.Keys.down&&ve(()=>{var ie;te(((ie=X.current)==null?void 0:ie.element)||se)});else H&&y===d.Keys.down&&(I.preventDefault(),He(we))},[W,U,te,ve,He,oe,h,E,le]),at=a.useCallback(I=>{const{keyCode:y,altKey:H}=I;H||y!==d.Keys.up&&y!==d.Keys.down||(I.preventDefault(),ve(y===d.Keys.up?()=>{te(q.current)}:()=>{te(T.current&&T.current.element)}))},[te,ve]),lt=a.useCallback(I=>{if(!N.current)return;const y={syntheticEvent:I,nativeEvent:I.nativeEvent,target:N.current};le(y,[],"clear"),U(y),I.preventDefault()},[le,U]),jt=a.useCallback((I,y)=>{var H;U({target:N.current}),$||te((H=X.current)==null?void 0:H.element),le({syntheticEvent:y,nativeEvent:y.nativeEvent,target:N.current},I,"delete")},[le,U,te,$]),ot=a.useCallback(I=>{if(e.onExpandChange&&N.current){const{item:y,itemHierarchicalIndex:H,nativeEvent:se,syntheticEvent:we}=I,Ee={level:ei(H),item:y,nativeEvent:se,syntheticEvent:we,target:N.current};e.onExpandChange.call(void 0,Ee)}},[e.onExpandChange]),rt=a.useCallback(I=>{if(e.onFilterChange&&N.current){const H={filter:{field:e.textField,operator:"contains",value:I.target.value},syntheticEvent:I.syntheticEvent,nativeEvent:I.nativeEvent,target:N.current};e.onFilterChange.call(void 0,H),e.filter===void 0&&Z(I.target.value)}},[e.onFilterChange,e.filter,e.textField]),kt=a.useCallback(I=>{if(!N.current)return;const y={syntheticEvent:I,nativeEvent:I.nativeEvent,target:N.current};e.onCancel&&e.onCancel.call(void 0,y),U(y),I.preventDefault()},[e.onCancel,U]),dt=()=>{const I=e.filterable?a.createElement(Ke,{value:e.filter===void 0?A:e.filter,ref:J,onChange:rt,onKeyDown:at,size:ce,rounded:x,fillMode:F}):null,y={adaptiveTitle:e.adaptiveTitle,expand:W,onClose:H=>e.onCancel?kt(H):lt(H),windowWidth:V,mobileFilter:I,footer:{cancelText:Se.toLanguageString(Re,ne[Re]),onCancel:H=>e.onCancel?kt(H):lt(H),applyText:Se.toLanguageString(Pe,ne[Pe]),onApply:H=>U(H)}};return a.createElement(At,{...y},a.createElement(fe.ActionSheetContent,{className:"!k-overflow-hidden"},a.createElement("div",{className:"k-list-container"},a.createElement("div",{className:"k-list k-list-lg"},l.length>0?a.createElement(ut.TreeView,{ref:T,tabIndex:k,data:l,focusIdField:h,textField:e.textField,checkField:C,checkIndeterminateField:w,expandField:e.expandField,childrenField:D,expandIcons:!0,onItemClick:Je,onCheckChange:Je,onExpandChange:ot,checkboxes:!0,size:ce,item:e.item,dir:P}):a.createElement(be,null,Se.toLanguageString(ge,ne[ge]))))))},Dt=a.useCallback(I=>{for(let y of I)G(y.target.clientWidth)},[]),be=e.listNoData||hs,Se=xe.useLocalization(),Oe=!S||de.valid,{size:ce,rounded:x,fillMode:F}=e,j=re&&W?ye:R.current,ue=a.createElement(a.Fragment,null,a.createElement("span",{className:d.classNames("k-multiselecttree k-input",e.className,{[`k-input-${vs[ce]||ce}`]:ce,[`k-rounded-${Rs[x]||x}`]:x,[`k-input-${F}`]:F,"k-focus":$&&!p,"k-invalid":!Oe,"k-disabled":p,"k-loading":e.loading,"k-required":K}),tabIndex:k,accessKey:e.accessKey,id:n,style:m?{...c,width:void 0}:c,dir:P,ref:q,onKeyDown:p?void 0:Ct,onMouseDown:wt,onFocus:Ut,onBlur:St,role:"combobox","aria-haspopup":"tree","aria-expanded":W,"aria-disabled":p,"aria-label":m,"aria-labelledby":e.ariaLabelledBy,"aria-describedby":e.ariaDescribedBy?e.ariaDescribedBy:"tagslist-"+n,"aria-required":e.required,onClick:p?void 0:Et},a.createElement("div",{id:"tagslist-"+n,className:d.classNames("k-input-values k-chip-list k-selection-multiple",{[`k-chip-list-${vs[ce]||ce}`]:ce})},j.length>0&&a.createElement(Ht,{tag:e.tag,onTagDelete:jt,data:j,guid:n,focused:oe?R.current.find(I=>pt(I,oe,h)):void 0,size:ce})),a.createElement("span",{className:"k-input-inner"},j.length===0&&a.createElement("span",{className:"k-input-value-text"},v)),e.loading&&a.createElement(d.IconWrap,{className:"k-input-loading-icon",name:"loading"}),Ne&&!p&&j.length>0&&a.createElement(et,{onClick:lt}),a.createElement("select",{name:b,ref:Q,tabIndex:-1,"aria-hidden":!0,title:m,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},a.createElement("option",{value:e.valueMap?e.valueMap.call(void 0,E):E})),!re&&a.createElement(ct.Popup,{popupClass:d.classNames(u.popupClass,"k-multiselecttree-popup"),className:d.classNames(u.className,{"k-rtl":P==="rtl"}),style:yt,animate:u.animate,anchor:q.current,show:W,onOpen:Tt,onClose:Gt,appendTo:u.appendTo,ref:ee},e.filterable&&a.createElement(Ke,{value:e.filter===void 0?A:e.filter,ref:X,onChange:rt,onKeyDown:at,tabIndex:k,size:ce,rounded:x,fillMode:F}),l.length>0?a.createElement(ut.TreeView,{ref:T,tabIndex:k,data:l,focusIdField:h,textField:e.textField,checkField:C,checkIndeterminateField:w,expandField:e.expandField,childrenField:D,expandIcons:!0,onItemClick:Je,onCheckChange:Je,onExpandChange:ot,checkboxes:!0,size:ce,item:e.item,dir:P}):a.createElement(be,null,Se.toLanguageString(ge,ne[ge])))),re&&dt());return m?a.createElement(Ae.FloatingLabel,{label:m,editorValue:Ne,editorPlaceholder:v,editorValid:Oe,editorDisabled:p,editorId:n,style:{width:c?c.width:void 0},children:ue,dir:P}):ue}),si={opened:o.bool,disabled:o.bool,dir:o.string,tabIndex:o.number,accessKey:o.string,data:o.array,value:o.any,valueMap:o.func,placeholder:o.string,dataItemKey:o.string.isRequired,textField:o.string.isRequired,checkField:o.string,checkIndeterminateField:o.string,expandField:o.string,subItemsField:o.string,className:o.string,style:o.object,label:o.string,validationMessage:o.string,validityStyles:o.bool,valid:o.bool,required:o.bool,name:o.string,id:o.string,ariaLabelledBy:o.string,ariaDescribedBy:o.string,filterable:o.bool,filter:o.string,loading:o.bool,tags:o.arrayOf(o.shape({text:o.string,data:o.arrayOf(o.any)})),popupSettings:o.shape({animate:o.oneOfType([o.bool,o.shape({openDuration:o.number,closeDuration:o.number})]),popupClass:o.string,className:o.string,appendTo:o.any,width:o.oneOfType([o.string,o.number]),height:o.oneOfType([o.string,o.number])}),onOpen:o.func,onClose:o.func,onFocus:o.func,onBlur:o.func,onChange:o.func,onFilterChange:o.func,onExpandChange:o.func,onCancel:o.func,item:o.func,listNoData:o.func,adaptiveTitle:o.string,adaptive:o.bool};xt.displayName="KendoReactMultiSelectTree",xt.defaultProps=Be,xt.propTypes=si;const Ue=(i,t)=>{const e={};return i&&i.length&&i.forEach(s=>{e[t(s)]=!0}),e},ii=(i,t)=>{const{items:e,dataItemKey:s,value:n,subItemsField:l="items",operation:h}=t,u=d.getter(s),c=Ue(n,u);if(h==="clear")return[];if(h==="delete"){const O=Ue(e,u);return n.filter(B=>!O[u(B)])}const r=e[0],p=u(r),f=d.getter(l),g=[...i],v=[];let m=[],b;for(;g.length;){const O=g.pop();if(p===u(O)){m=v.map(B=>B.item),b=O;break}else{v&&v.length&&v[v.length-1].parentPosition===g.length&&v.pop();const B=f(O);B&&B.length&&(v.push({item:O,parentPosition:g.length}),g.push(...B))}}const C=[...f(b)||[]];let w=[];for(;C.length;){const O=C.pop();w.push(O);const B=f(O);B&&B.length&&C.push(...B)}const D=!c[p],_=[];if(D){_.push(...n),_.push(b),_.push(...w.filter(E=>!c[u(E)]));const O=m.filter(E=>!c[u(E)]),B=Ue(_,u);for(let E=O.length-1;E>-1;E--){const K=O[E],S=f(K);if(S.filter(N=>B[u(N)]).length<S.length)break;_.push(K),B[u(K)]=!0}}else{const O=u(b),B=Ue(w,u),E=Ue(m,u);_.push(...n.filter(K=>{const S=u(K);return!B[S]&&O!==S&&!E[S]}))}return _};M.AutoComplete=ns,M.AutoCompletePropsContext=is,M.AutoCompleteWithoutContext=tt,M.ComboBox=Lt,M.ComboBoxPropsContext=ts,M.ComboBoxWithoutContext=Te,M.DropDownList=es,M.DropDownListClassComponent=$e,M.DropDownListPropsContext=Rt,M.DropDownListWithoutContext=$e,M.DropDownTree=qt,M.DropDownTreePropsContext=gs,M.List=Ve,M.ListContainer=Xe,M.ListFilter=Ke,M.ListItem=Pt,M.MultiColumnComboBox=It,M.MultiColumnComboBoxPropsContext=cs,M.MultiSelect=ds,M.MultiSelectPropsContext=rs,M.MultiSelectTree=xt,M.MultiSelectTreePropsContext=ms,M.MultiSelectWithoutContext=it,M.SearchBar=gt,M.TagList=Ht,M.dropdownsMessages=ne,M.findByFieldValue=ws,M.getItemValue=z,M.getMultiSelectTreeValue=ii,M.getValueMap=Ue,M.nodata=ge,M.scrollToItem=Xt,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})});