this.primereact=this.primereact||{},this.primereact.listbox=function(t,e,n,o,r,i,l,a){"use strict";function s(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var p=s(e);function u(){return u=Object.assign||function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,o=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return l=t.done,t},e:function(t){a=!0,i=t},f:function(){try{l||null==n.return||n.return()}finally{if(a)throw i}}}}function P(t,e){if(t){if("string"==typeof t)return V(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?V(t,e):void 0}}function V(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n-1}},{key:"hasFilter",value:function(){var t=this.getFilterValue();return t&&t.trim().length>0}},{key:"getOptionLabel",value:function(t){return this.props.optionLabel?o.ObjectUtils.resolveFieldData(t,this.props.optionLabel):t&&void 0!==t.label?t.label:t}},{key:"getOptionValue",value:function(t){return this.props.optionValue?o.ObjectUtils.resolveFieldData(t,this.props.optionValue):t&&void 0!==t.value?t.value:t}},{key:"getOptionRenderKey",value:function(t){return this.props.dataKey?o.ObjectUtils.resolveFieldData(t,this.props.dataKey):this.getOptionLabel(t)}},{key:"isOptionDisabled",value:function(t){return this.props.optionDisabled?o.ObjectUtils.isFunction(this.props.optionDisabled)?this.props.optionDisabled(t):o.ObjectUtils.resolveFieldData(t,this.props.optionDisabled):!(!t||void 0===t.disabled)&&t.disabled}},{key:"getOptionGroupRenderKey",value:function(t){return o.ObjectUtils.resolveFieldData(t,this.props.optionGroupLabel)}},{key:"getOptionGroupLabel",value:function(t){return o.ObjectUtils.resolveFieldData(t,this.props.optionGroupLabel)}},{key:"getOptionGroupChildren",value:function(t){return o.ObjectUtils.resolveFieldData(t,this.props.optionGroupChildren)}},{key:"getVisibleOptions",value:function(){if(this.hasFilter()){var t=this.getFilterValue().trim().toLocaleLowerCase(this.props.filterLocale),e=this.props.filterBy?this.props.filterBy.split(","):[this.props.optionLabel||"label"];if(this.props.optionGroupLabel){var o,r=[],i=L(this.props.options);try{for(i.s();!(o=i.n()).done;){var l=o.value,a=n.FilterService.filter(this.getOptionGroupChildren(l),e,t,this.props.filterMatchMode,this.props.filterLocale);a&&a.length&&r.push(R(R({},l),{items:a}))}}catch(t){i.e(t)}finally{i.f()}return r}return n.FilterService.filter(this.props.options,e,t,this.props.filterMatchMode,this.props.filterLocale)}return this.props.options}},{key:"renderGroupChildren",value:function(t){var e=this;return this.getOptionGroupChildren(t).map((function(t,n){var o=e.getOptionLabel(t),r=n+"_"+e.getOptionRenderKey(t),i=e.isOptionDisabled(t),l=i?null:e.props.tabIndex||0;return p.default.createElement(D,{key:r,label:o,option:t,template:e.props.itemTemplate,selected:e.isSelected(t),onClick:e.onOptionSelect,onTouchEnd:e.onOptionTouchEnd,tabIndex:l,disabled:i})}))}},{key:"renderItem",value:function(t,e){if(this.props.optionGroupLabel){var n=this.props.optionGroupTemplate?o.ObjectUtils.getJSXElement(this.props.optionGroupTemplate,t,e):this.getOptionGroupLabel(t),r=this.renderGroupChildren(t),i=e+"_"+this.getOptionGroupRenderKey(t);return p.default.createElement(p.default.Fragment,{key:i},p.default.createElement("li",{className:"p-listbox-item-group"},n),r)}var l=this.getOptionLabel(t),a=e+"_"+this.getOptionRenderKey(t),s=this.isOptionDisabled(t),u=s?null:this.props.tabIndex||0;return p.default.createElement(D,{key:a,label:l,option:t,template:this.props.itemTemplate,selected:this.isSelected(t),onClick:this.onOptionSelect,onTouchEnd:this.onOptionTouchEnd,tabIndex:u,disabled:s})}},{key:"renderItems",value:function(t){var e=this;return t&&t.length?t.map((function(t,n){return e.renderItem(t,n)})):null}},{key:"renderList",value:function(t){var e=this;if(this.props.virtualScrollerOptions){var n=R(R({},this.props.virtualScrollerOptions),{items:t,onLazyLoad:function(t){return e.props.virtualScrollerOptions.onLazyLoad(R(R({},t),{filter:e.getFilterValue()}))},itemTemplate:function(t,n){return t&&e.renderItem(t,n.index)},contentTemplate:function(t){var n=o.classNames("p-listbox-list",t.className);return p.default.createElement("ul",{ref:t.contentRef,className:n,role:"listbox","aria-multiselectable":e.props.multiple},t.children)}});return p.default.createElement(a.VirtualScroller,u({ref:function(t){return e.virtualScrollerRef=t}},n))}var r=this.renderItems(t);return p.default.createElement("ul",{className:"p-listbox-list",role:"listbox","aria-multiselectable":this.props.multiple},r)}},{key:"render",value:function(){var t,e=this,n=o.classNames("p-listbox p-component",{"p-disabled":this.props.disabled},this.props.className),r=o.classNames("p-listbox-list-wrapper",this.props.listClassName),i=this.getVisibleOptions(),l=this.renderList(i);return this.props.filter&&(t=p.default.createElement(F,{filter:this.getFilterValue(),onFilter:this.onFilter,disabled:this.props.disabled,filterPlaceholder:this.props.filterPlaceholder})),p.default.createElement("div",{ref:function(t){return e.element=t},id:this.props.id,className:n,style:this.props.style},t,p.default.createElement("div",{ref:function(t){return e.wrapper=t},className:r,style:this.props.listStyle},l))}}]),s}(e.Component);return w(N,"defaultProps",{id:null,value:null,options:null,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,optionGroupTemplate:null,itemTemplate:null,style:null,listStyle:null,listClassName:null,className:null,virtualScrollerOptions:null,disabled:null,dataKey:null,multiple:!1,metaKeySelection:!1,filter:!1,filterBy:null,filterValue:null,filterMatchMode:"contains",filterPlaceholder:null,filterLocale:void 0,tabIndex:0,tooltip:null,tooltipOptions:null,ariaLabelledBy:null,onChange:null,onFilterValueChange:null}),t.ListBox=N,Object.defineProperty(t,"__esModule",{value:!0}),t}({},React,primereact.api,primereact.utils,primereact.ripple,primereact.inputtext,primereact.tooltip,primereact.virtualscroller);