@momentum-ui/web-components 3.2.10 → 3.2.11

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.
Files changed (58) hide show
  1. package/dist/2245.js +12 -11
  2. package/dist/2273.js +10 -7
  3. package/dist/3639.js +0 -1
  4. package/dist/378.js +18 -0
  5. package/dist/6005.js +1 -1
  6. package/dist/9189.js +3 -3
  7. package/dist/953.js +2 -2
  8. package/dist/comp/md-avatar-entry.js +5 -4
  9. package/dist/comp/md-avatar.js +1 -1
  10. package/dist/comp/md-chat-message-entry.js +1 -1
  11. package/dist/comp/md-chat-message.js +1 -1
  12. package/dist/comp/md-combobox-entry.js +24 -21
  13. package/dist/comp/md-datepicker-calendar-entry.js +2 -2
  14. package/dist/comp/md-datepicker-day-entry.js +0 -1
  15. package/dist/comp/md-dropdown-entry.js +2 -2
  16. package/dist/comp/md-floating-modal-entry.js +24 -13
  17. package/dist/comp/md-grabber-entry.js +12 -8
  18. package/dist/comp/md-input-entry.js +14 -14
  19. package/dist/comp/md-meeting-alert-entry.js +1 -1
  20. package/dist/comp/md-meeting-alert.js +1 -1
  21. package/dist/comp/md-tabs-entry.js +16 -16
  22. package/dist/comp/md-task-item-entry.js +1 -1
  23. package/dist/comp/md-task-item.js +1 -1
  24. package/dist/esm/2245.js +5 -4
  25. package/dist/esm/2273.js +36 -33
  26. package/dist/esm/3639.js +0 -1
  27. package/dist/esm/378.js +18 -0
  28. package/dist/esm/4626.js +12 -11
  29. package/dist/esm/4654.js +10 -7
  30. package/dist/esm/6005.js +1 -1
  31. package/dist/esm/6020.js +0 -1
  32. package/dist/esm/837.js +2 -2
  33. package/dist/esm/9189.js +5 -5
  34. package/dist/esm/953.js +2 -2
  35. package/dist/esm/comp/md-avatar-entry.js +1 -1
  36. package/dist/esm/comp/md-avatar.js +1 -1
  37. package/dist/esm/comp/md-chat-message-entry.js +1 -1
  38. package/dist/esm/comp/md-chat-message.js +1 -1
  39. package/dist/esm/comp/md-dropdown-entry.js +1 -1
  40. package/dist/esm/comp/md-floating-modal-entry.js +24 -13
  41. package/dist/esm/comp/md-grabber-entry.js +10 -6
  42. package/dist/esm/comp/md-input-entry.js +4 -4
  43. package/dist/esm/comp/md-meeting-alert-entry.js +1 -1
  44. package/dist/esm/comp/md-meeting-alert.js +1 -1
  45. package/dist/esm/comp/md-tabs-entry.js +15 -15
  46. package/dist/esm/comp/md-task-item-entry.js +1 -1
  47. package/dist/esm/comp/md-task-item.js +1 -1
  48. package/dist/esm/index-entry.js +42 -27
  49. package/dist/index-entry.js +58 -40
  50. package/dist/types/components/avatar/Avatar.constants.d.ts +2 -1
  51. package/dist/types/components/avatar/Avatar.d.ts +3 -0
  52. package/dist/types/components/floating-modal/FloatingModal.d.ts +10 -1
  53. package/dist/types/components/grabber/Grabber.d.ts +1 -0
  54. package/dist/types/components/input/Input.d.ts +1 -0
  55. package/dist/types/components/tabs/Tabs.d.ts +1 -0
  56. package/package.json +1 -1
  57. package/dist/4621.js +0 -18
  58. package/dist/esm/4621.js +0 -18
@@ -31,4 +31,4 @@
31
31
  </div>
32
32
  </div>
33
33
  </div>
34
- `}};m([(0,l.property)({type:String})],t.prototype,"title",void 0),m([(0,l.property)({type:String})],t.prototype,"src",void 0),m([(0,l.property)({type:String})],t.prototype,"time",void 0),m([(0,l.property)({type:String})],t.prototype,"label",void 0),m([(0,l.property)({type:String})],t.prototype,"status",void 0),m([(0,l.property)({type:Boolean})],t.prototype,"clickableTimestamp",void 0),m([(0,l.property)({type:Boolean})],t.prototype,"isSelected",void 0),m([(0,l.property)({type:String,reflect:!0,attribute:"self-label"})],t.prototype,"selfLabel",void 0),m([(0,l.property)({type:Boolean})],t.prototype,"self",void 0),m([(0,l.property)({type:String,reflect:!0,attribute:"avatar-color"})],t.prototype,"avatarColor",void 0),m([(0,l.property)({type:String,reflect:!0,attribute:"avatar-type"})],t.prototype,"avatarType",void 0),m([(0,l.property)({type:Number,reflect:!0,attribute:"avatar-size"})],t.prototype,"avatarSize",void 0),t=m([(0,r.w)("md-chat-message")],t),e.ELEMENT=t}(s||(s={}))},2022(e){e.exports=o},554(e){e.exports=a},7161(t){t.exports=e},429(e){e.exports=t},5125(e){e.exports=i},291(e){e.exports=r},318(e){e.exports=s},9756(e){e.exports=p},5314(e){e.exports=l}},n={};function c(e){var t=n[e];if(void 0!==t)return t.exports;var i=n[e]={exports:{}};return m[e](i,i.exports,c),i.exports}c.m=m,d=[],c.O=(e,t,i,s)=>{if(!t){var r=1/0;for(p=0;p<d.length;p++){for(var[t,i,s]=d[p],o=!0,a=0;a<t.length;a++)(!1&s||r>=s)&&Object.keys(c.O).every(e=>c.O[e](t[a]))?t.splice(a--,1):(o=!1,s<r&&(r=s));if(o){d.splice(p--,1);var l=i();void 0!==l&&(e=l)}}return e}s=s||0;for(var p=d.length;p>0&&d[p-1][2]>s;p--)d[p]=d[p-1];d[p]=[t,i,s]},c.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return c.d(t,{a:t}),t},c.d=(e,t)=>{for(var i in t)c.o(t,i)&&!c.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={7684:0};c.O.j=t=>0===e[t];var t=(t,i)=>{var s,r,[o,a,l]=i,p=0;if(o.some(t=>0!==e[t])){for(s in a)c.o(a,s)&&(c.m[s]=a[s]);if(l)var d=l(c)}for(t&&t(i);p<o.length;p++)r=o[p],c.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return c.O(d)},i=self["momentum-web-components-[id]"]=self["momentum-web-components-[id]"]||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();var u=c.O(void 0,[9609,4084,3305,4739,7154,9773,5983,9488,1821,519,6325,4449,1392,1618,4621,9244,2245,9316],()=>c(5558));return c.O(u)})());
34
+ `}};m([(0,l.property)({type:String})],t.prototype,"title",void 0),m([(0,l.property)({type:String})],t.prototype,"src",void 0),m([(0,l.property)({type:String})],t.prototype,"time",void 0),m([(0,l.property)({type:String})],t.prototype,"label",void 0),m([(0,l.property)({type:String})],t.prototype,"status",void 0),m([(0,l.property)({type:Boolean})],t.prototype,"clickableTimestamp",void 0),m([(0,l.property)({type:Boolean})],t.prototype,"isSelected",void 0),m([(0,l.property)({type:String,reflect:!0,attribute:"self-label"})],t.prototype,"selfLabel",void 0),m([(0,l.property)({type:Boolean})],t.prototype,"self",void 0),m([(0,l.property)({type:String,reflect:!0,attribute:"avatar-color"})],t.prototype,"avatarColor",void 0),m([(0,l.property)({type:String,reflect:!0,attribute:"avatar-type"})],t.prototype,"avatarType",void 0),m([(0,l.property)({type:Number,reflect:!0,attribute:"avatar-size"})],t.prototype,"avatarSize",void 0),t=m([(0,r.w)("md-chat-message")],t),e.ELEMENT=t}(s||(s={}))},2022(e){e.exports=o},554(e){e.exports=a},7161(t){t.exports=e},429(e){e.exports=t},5125(e){e.exports=i},291(e){e.exports=r},318(e){e.exports=s},9756(e){e.exports=p},5314(e){e.exports=l}},n={};function c(e){var t=n[e];if(void 0!==t)return t.exports;var i=n[e]={exports:{}};return m[e](i,i.exports,c),i.exports}c.m=m,d=[],c.O=(e,t,i,s)=>{if(!t){var r=1/0;for(p=0;p<d.length;p++){for(var[t,i,s]=d[p],o=!0,a=0;a<t.length;a++)(!1&s||r>=s)&&Object.keys(c.O).every(e=>c.O[e](t[a]))?t.splice(a--,1):(o=!1,s<r&&(r=s));if(o){d.splice(p--,1);var l=i();void 0!==l&&(e=l)}}return e}s=s||0;for(var p=d.length;p>0&&d[p-1][2]>s;p--)d[p]=d[p-1];d[p]=[t,i,s]},c.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return c.d(t,{a:t}),t},c.d=(e,t)=>{for(var i in t)c.o(t,i)&&!c.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={7684:0};c.O.j=t=>0===e[t];var t=(t,i)=>{var s,r,[o,a,l]=i,p=0;if(o.some(t=>0!==e[t])){for(s in a)c.o(a,s)&&(c.m[s]=a[s]);if(l)var d=l(c)}for(t&&t(i);p<o.length;p++)r=o[p],c.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return c.O(d)},i=self["momentum-web-components-[id]"]=self["momentum-web-components-[id]"]||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();var u=c.O(void 0,[9609,4084,3305,4739,7154,9773,5983,9488,1821,519,6325,4449,1392,1618,378,9244,2245,9316],()=>c(5558));return c.O(u)})());
@@ -1 +1 @@
1
- require("../9609"),require("../4084"),require("../3305"),require("../4739"),require("../7154"),require("../9773"),require("../5983"),require("../9488"),require("../1821"),require("../519"),require("../6325"),require("../4449"),require("../1392"),require("../1618"),require("../4621"),require("../9244"),require("../2245"),require("../9316"),module.exports=require("../comp/md-chat-message-entry");
1
+ require("../9609"),require("../4084"),require("../3305"),require("../4739"),require("../7154"),require("../9773"),require("../5983"),require("../9488"),require("../1821"),require("../519"),require("../6325"),require("../4449"),require("../1392"),require("../1618"),require("../378"),require("../9244"),require("../2245"),require("../9316"),module.exports=require("../comp/md-chat-message-entry");
@@ -1,9 +1,10 @@
1
- !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js"),require("lit/directives/if-defined.js"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("mobx"),require("lit/directives/repeat.js"));else if("function"==typeof define&&define.amd)define(["lit","lit/decorators.js","lit/directives/class-map.js","lit/directives/style-map.js","lit/directives/if-defined.js","@momentum-ui/icons/data/momentumUiIconsNames.json","@momentum-ui/utils/lib/getColorValue","mobx","lit/directives/repeat.js"],e);else{var i="object"==typeof exports?e(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js"),require("lit/directives/if-defined.js"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("mobx"),require("lit/directives/repeat.js")):e(t.lit,t["lit/decorators.js"],t["lit/directives/class-map.js"],t["lit/directives/style-map.js"],t["lit/directives/if-defined.js"],t["@momentum-ui/icons/data/momentumUiIconsNames.json"],t["@momentum-ui/utils/lib/getColorValue"],t.mobx,t["lit/directives/repeat.js"]);for(var s in i)("object"==typeof exports?exports:t)[s]=i[s]}}(self,(t,e,i,s,o,l,n,r,a)=>(()=>{"use strict";var h,d={2273(t,e,i){i.r(e),i.d(e,{ComboBox:()=>s}),i(7906),i(1821);var s,o=i(2900),l=i(7704),n=i(9609),r=i(2050),a=i(4084),h=i(7161),d=i(429),p=i(5125),u=i(291),c=i(8175),m=i(318),b=i(7103),g=i(4047),f=function(t,e,i,s){var o,l=arguments.length,n=l<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(n=(l<3?o(n):l>3?o(e,i,n):o(e,i))||n);return l>3&&n&&Object.defineProperty(e,i,n),n},x=function(t,e,i,s){return new(i||(i=Promise))(function(o,l){function n(t){try{a(s.next(t))}catch(t){l(t)}}function r(t){try{a(s.throw(t))}catch(t){l(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(n,r)}a((s=s.apply(t,e||[])).next())})};!function(t){class e{determineMessageType(t){return t.reduce((t,e)=>"error"===e?t:e.type,"")}filterMessagesByType(t,e){return t.reduce((t,i)=>i.type===e?t.concat(i.message):t,[])}}t.MessageController=e;let i=class extends((0,l.yC)(h.LitElement)){constructor(){super(...arguments),this._focusedIndex=-1,this._focusedGroupIndex=-1,this.label="Options",this.options=[],this.customOptions=[],this.placeholder="",this.isMulti=!1,this.useVirtualScroll=!1,this.disabled=!1,this.ordered=!1,this.expanded=!1,this.groupExpandedList=[],this.searchItem=!1,this.compact=!1,this.noClearIcon=!1,this.selectWhenInFocus=!1,this.selectedOptions=[],this.visibleOptions=8,this.optionId="",this.optionValue="",this.isCustomContent=!1,this.searchable=!1,this.shape="none",this.value=[],this.inputValue="",this.allowCustomValue=!1,this.autofocus=!1,this.resultsTextLocalization="No Results",this.optionsTextLocalization="No Options",this.trimSpace=!1,this.invalid=!1,this.invalidText="",this.ariaLabel="",this.searchResultAriaLabel="",this.ariaLabelForComboBox="",this.clearAriaLabel="Clear",this.arrowAriaLabel="Expand",this.clearIconHeight="auto",this.allTextLocalization="All",this.selectAllTextLocalization="Select All",this.selectedTextLocalization="Selected",this.allowSelectAll=!1,this.showCustomError=!1,this.showLoader=!1,this.showSelectedCount=!1,this.popupChevronAriaHidden="true",this.newMomentum=!1,this.showFilterIcon=!1,this.preventFilter=!1,this.isDropdownArrow=!1,this.comboboxId="",this.helpText="",this.messageArr=[],this.htmlId="",this.readOnly=!1,this.messageController=new e,this.isOptGroup=!1,this.isSelectAllChecked=!1,this.multiSelectedIndex=-1,this.multiSelected=[],this.customContent=[],this.notifySelectedChange=(0,r.sg)(t=>{this.dispatchEvent(new CustomEvent("change-selected",{composed:!0,bubbles:!0,detail:t}))},0),this.handleGroupFilter=t=>{const e=t.filter(t=>{if("string"!=typeof t&&"true"===t.isLabel)return t.groupName});return this.searchItem=!0,this.groupExpandedList=e.map(t=>{if("string"!=typeof t)return t.groupName}),t.filter(e=>"string"==typeof e||"true"!==e.isLabel||!!t.find(t=>{if("string"!=typeof e&&"string"!=typeof t)return e.groupName===t.groupName&&"false"===t.isLabel}))},this.notifyInputValueChanged=(0,r.sg)(t=>{this.dispatchEvent(new CustomEvent("combobox-input",{composed:!0,bubbles:!0,detail:{value:t}})),this.notifySearchResultCount(),this.focusedGroupIndex=0,requestAnimationFrame(()=>{this.input.focus(),this.focusedGroupIndex=-1})},250),this.handleOutsideClick=t=>{let e=!1;const i=t.composedPath();i.length&&(e=!!i.find(t=>t===this),e||(this.setVisualListbox(!1),this.unselectedAllMultiTag()))}}get focusedIndex(){return this._focusedIndex}set focusedIndex(t){this.updateFocusedIndex(t)}updateFocusedIndex(t){var e,i,s,o;const l=this._focusedIndex;if(this.checkForVirtualScroll()){let l;l=this.allowSelectAll?0===t?"selectAll":this.getOptionId(this.filteredOptions[t-1]):this.getOptionId(this.filteredOptions[t]);const n=this.lists?null===(e=[...this.lists])||void 0===e?void 0:e.find(t=>0!==t.offsetHeight&&t.id===l):"";this.lists&&[...this.lists].forEach(t=>{t.toggleAttribute("focused",!1)}),n&&(null==n||n.toggleAttribute("focused",!0));const r=null===(i=this.shadowRoot)||void 0===i?void 0:i.querySelector("lit-virtualizer");r&&(-1===t?null===(s=r.element(t))||void 0===s||s.scrollIntoView({block:"start"}):null===(o=r.element(t))||void 0===o||o.scrollIntoView({block:"center"}))}else if(this.lists){const e=this.lists[l];e&&e.toggleAttribute("focused",!1);const i=this.lists[t];i&&i.toggleAttribute("focused",!0)}this._focusedIndex=t,this.requestUpdate("focusedIndex",l)}get focusedGroupIndex(){return this._focusedGroupIndex}set focusedGroupIndex(t){const e=this._focusedGroupIndex;if(this.labels&&0!==this.labels.length){const i=this.labels[e];i&&i.toggleAttribute("focused",!1);const s=this.labels[t];s&&(s.toggleAttribute("focused",!0),s.focus())}this._focusedGroupIndex=t,this.requestUpdate("focusedGroupIndex",e)}get messageType(){return this.messageArr.length>0?this.messageController.determineMessageType(this.messageArr):null}get messages(){return this.messageType?this.messageController.filterMessagesByType(this.messageArr,this.messageType):null}notifySearchResultCount(){if(this.searchResultAriaLabel){const t=/{{.*?}}/g;this.ariaLabelForComboBox=this.searchResultAriaLabel.replace(t,this.filteredOptions.length.toString())}else this.ariaLabel?this.ariaLabelForComboBox=`${this.ariaLabel}, ${this.filteredOptions.length} results found.`:this.ariaLabelForComboBox=`ComboBox Element, ${this.filteredOptions.length} results found.`}firstUpdated(t){this.ariaLabelForComboBox=this.ariaLabel?this.ariaLabel:"ComboBox Element",super.firstUpdated(t),this.isCustomContent&&(this.optionId="id",this.optionValue="value",this.setOptionCustomContent()),this.setInitialValue()}updated(t){super.updated(t),t.has("expanded")&&(this.expanded?(this.resizeListbox(),this.checkSelectedOptions()):this.unCheckAllOptions()),t.has("focusedIndex")&&this.focusedIndex>=0&&(this.checkForVirtualScroll()||this.scrollToOption()),t.has("value")&&0===this.selectedOptions.length&&this.setInitialValue(),t.has("options")&&this.expanded&&this.checkForVirtualScroll()&&this.updateOnNextFrame(()=>{this.resizeListbox()}),t.has("customOptions")&&this.isCustomContent&&(this.setOptionCustomContent(),this.resizeListbox()),t.has("showCustomError")&&this.resizeListbox(),t.has("showLoader")&&this.resizeListbox(),t.has("searchItem")&&this.resizeListbox()}handleFocusIn(t){var e;this.disabled&&!this.readOnly||(this.noClearIcon&&(requestAnimationFrame(()=>{this.input.focus(),this.focusedGroupIndex=-1}),this.selectWhenInFocus&&this.input.select()),null===(e=super.handleFocusIn)||void 0===e||e.call(this,t)),this.dispatchEvent(new CustomEvent("combobox-focus-in",{composed:!0,bubbles:!0}))}handleFocusOut(t){var e;null===(e=super.handleFocusOut)||void 0===e||e.call(this,t),this.dispatchEvent(new CustomEvent("combobox-focus-out",{composed:!0,bubbles:!0}))}findFilteredOption(t){return this.isOptionObject(t)?this.filteredOptions.findIndex(e=>this.getOptionId(e)===this.getOptionId(t)&&this.getOptionValue(e)===this.getOptionValue(t)):this.filteredOptions.indexOf(t)}setInitialValue(){var t;if(this.value.length)if(this.isMulti)this.value.forEach(t=>{-1!==this.findFilteredOption(t)&&this.setSelectedOption(t)});else{const e=this.value[0],i=this.findFilteredOption(e);-1!==i&&(this.setSelectedOption(e),this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(e)),this.focusedIndex=i,this.focusedGroupIndex=-1)}}isOptionObject(t){return"object"==typeof t&&null!==t}setOptionCustomContent(){if(this.isOptGroup){const t=[...this.querySelectorAll("optgroup")],e=[];for(const i of t){const t=i.getAttribute("label"),s=[...i.querySelectorAll("[slot]")];e.push({isLabel:"true",[this.optionValue]:t,groupName:t});for(const i of s){const s=i.getAttribute("aria-label"),o=i.getAttribute("display-value"),l=i.getAttribute("slot");s&&o&&e.push({[this.optionId]:s,[this.optionValue]:o,isLabel:"false",groupName:t,slot:l})}}this.options=e}else this.customContent=[...this.querySelectorAll("[slot]")],this.customContent&&this.customContent.length?this.options=this.customContent.map(t=>{const e=t.getAttribute("aria-label"),i=t.getAttribute("display-value");if(e&&i)return{[this.optionId]:e,[this.optionValue]:i}}):this.options=[]}getOptionValue(t){return this.isOptionObject(t)?String(t[this.optionValue]):t}getOptionGroupName(t){return null==t?void 0:t.groupName}getOptionId(t){return this.isOptionObject(t)?String(t[this.optionId]):t}getFocusedItem(t){if(t>=0)return this.filteredOptions[t]}setupEvents(){document.addEventListener("click",this.handleOutsideClick),this.addEventListener("remove-all-selected",this.removeAllSelected),this.addEventListener("selected-changed",this.selectedChange)}teardownEvents(){document.removeEventListener("click",this.handleOutsideClick),this.removeEventListener("remove-all-selected",this.removeAllSelected),this.removeEventListener("selected-changed",this.selectedChange)}setVisualListbox(t){this.expanded=t}setGroupList(t){this.groupExpandedList.includes(t)?(this.groupExpandedList.splice(this.groupExpandedList.indexOf(t),1),this.groupExpandedList=[...this.groupExpandedList]):this.searchItem?this.groupExpandedList.push(t):this.groupExpandedList=[t]}findSelectedOption(t){return this.optionId&&t?this.selectedOptions.findIndex(e=>e&&e[this.optionId]===t[this.optionId]):this.selectedOptions.indexOf(t)}findOptionIndex(t){const e=t.composedPath();if(this.checkForVirtualScroll()){let t="";return[...this.lists].forEach(i=>{e.includes(i)&&(t=i.id)}),this.filteredOptions.findIndex(e=>this.getOptionId(e)===t)}return[...this.lists].findIndex(t=>e.includes(t))}checkSelectedOptions(){if(this.checkForVirtualScroll()){const t=this.selectedOptions.map(t=>this.getOptionId(t)),e=[...this.lists].filter(t=>"selectAll"!==t.id);null==e||e.forEach(e=>{t.includes(e.id)?(this.isMulti&&(null==e||e.setAttribute("aria-checked","true")),null==e||e.setAttribute("aria-selected","true")):this.isMulti&&(null==e||e.setAttribute("aria-checked","false"))})}}unCheckAllOptions(){var t;this.checkForVirtualScroll()&&this.isMulti&&(null===(t=[...this.lists])||void 0===t||t.forEach(t=>{"selectAll"!==(null==t?void 0:t.id)&&(null==t||t.setAttribute("aria-checked","false"))}))}setSelectedOption(t){this.isMulti||(this.selectedOptions=[]);const e=this.findSelectedOption(t);if(-1!==e){const t=this.selectedOptions[e];this.selectedOptions.splice(e,1),this.notifySelectedChange({value:t,selected:this.selectedOptions})}else this.selectedOptions.push(t),this.notifySelectedChange({value:t,selected:this.selectedOptions});this.checkSelectedOptions(),this.isMulti&&this.allowSelectAll&&(this.isSelectAllChecked=this.isSelectAllSelected()),this.requestUpdate()}filterOptions(t){if(this.preventFilter)return this.searchItem=!1,this.options;if(t&&t.length){const e=this.options.filter(e=>this.isOptGroup&&"string"!=typeof e&&"true"===e.isLabel?e:(this.isCustomContent?this.getOptionId(e):this.getOptionValue(e)).toLowerCase().includes(t.toLowerCase()));return this.isOptGroup?this.handleGroupFilter(e):e}return this.searchItem=!1,this.options}getListBoxVerticalPadding(){if(this.listBox){const t=window.getComputedStyle(this.listBox,null),e=parseInt(t.getPropertyValue("padding-top"))+parseInt(t.getPropertyValue("padding-bottom"));if(!isNaN(e))return e+2}return 10}resizeListbox(){this.updateOnNextFrame(()=>{var t;let e=0,i=0,s=0;const o=this.getListBoxVerticalPadding();if(this.lists){const t=this.checkForVirtualScroll()?[...this.lists].filter(t=>0!==t.offsetHeight):[...this.lists];e=t.slice(0,this.visibleOptions).reduce((t,e)=>t+e.offsetHeight,0),s=this.checkForVirtualScroll()&&this.allowSelectAll?t.slice(1,this.visibleOptions).reduce((t,e)=>t+e.offsetHeight,0):t.slice(0,this.visibleOptions).reduce((t,e)=>t+e.offsetHeight,0)}if(this.labels&&(i=[...this.labels].slice(0,this.visibleOptions).reduce((t,e)=>t+e.offsetHeight,0)),this.listBox&&(this.listBox.style.maxHeight=`${e+i+o}px`),this.virtualizer&&(this.virtualizer.style.height=`${s+o}px`),this.showCustomError||this.showLoader){const e=null===(t=this.listBox)||void 0===t?void 0:t.querySelector("[slot]");this.listBox&&e&&(this.listBox.style.height=`${e.clientHeight+o}px`,this.listBox.style.maxHeight=`${e.clientHeight+o}px`)}})}setInputValue(t=""){this.input.value=t}updateOnNextFrame(t){requestAnimationFrame(t)}unCheckedAllOptions(){this.isMulti&&(this.lists.forEach((t,e)=>this.unCheckedOption(e)),this.isSelectAllChecked=!1)}unCheckedOption(t){this.isMulti&&(this.lists[t].setAttribute("aria-checked","false"),this.notifySelectedChange({value:this.filteredOptions[t],selected:this.selectedOptions}))}checkAllOptions(){this.isMulti&&this.lists.forEach((t,e)=>this.checkOption(e))}checkOption(t){this.isMulti&&(this.lists[t].setAttribute("aria-checked","true"),this.notifySelectedChange({value:this.filteredOptions[t],selected:this.selectedOptions}))}isSelectAllSelected(){return this.selectedOptions.length===this.options.length}setFocusOnHost(t){this.setFocus&&this.setFocus(t)}isOptionFocused(t){return this.focusedIndex===t}getAriaState(t){return this.isOptionFocused(t)}scrollToOption(){var t,e;let i=0;const{top:s,bottom:o}=this.listBox.getBoundingClientRect(),l=this.lists[this.focusedIndex],n=null===(t=this.lists[this.focusedIndex+1]||l)||void 0===t?void 0:t.getBoundingClientRect(),r=null===(e=this.lists[this.focusedIndex-1]||l)||void 0===e?void 0:e.getBoundingClientRect();(null==n?void 0:n.bottom)>o?i=n.bottom-o+2:(null==r?void 0:r.top)<s&&(i=r.top-s-2),this.updateOnNextFrame(()=>{this.listBox.scrollTop+=i})}getCustomContentName(t){const e=this.options.indexOf(t);if(this.isOptGroup){const t=this.options[e];if(t&&"string"!=typeof t)return t.slot}else if(-1!==e)return this.customContent[e].slot}setInputSelectionRange(t,e){this.input.setSelectionRange(t,e)}isOptionChecked(t){return-1!==this.findSelectedOption(t)?"true":"false"}getInputSelection(){return this.input.selectionStart}canMultiSelect(){return 0===this.getInputSelection()&&0!==this.selectedOptions.length&&this.isMulti}removeMultiTag(){this.selected&&this.multiSelected.forEach(t=>{const e=this.selected[t];e&&e.hasAttribute("selected")&&this.removeSelected(this.selectedOptions[t])})}unselectedAllMultiTag(){this.selected&&this.selected.forEach(t=>t.removeAttribute("selected")),this.multiSelectedIndex=-1}findLastMultiSelected(){return this.selected[this.multiSelectedIndex]}toggleMultiSelectedTag(t,e){t&&t.toggleAttribute("selected",e)}selectMultiTag(t){if(this.canMultiSelect()){if(!t){this.multiSelected=[];const t=this.findLastMultiSelected();this.toggleMultiSelectedTag(t,!1)}this.multiSelectedIndex<=0?this.multiSelectedIndex=this.selectedOptions.length-1:this.multiSelectedIndex--,this.multiSelected.push(this.multiSelectedIndex);const e=this.findLastMultiSelected();this.toggleMultiSelectedTag(e,!0)}}handleListClick(t){return x(this,void 0,void 0,function*(){this.dispatchEvent(new CustomEvent("selected-changed",{detail:{event:t}})),yield this.updateComplete,this.isMulti?this.setVisualListbox(!0):this.setVisualListbox(!1),this.updateOnNextFrame(()=>{this.input.focus(),this.focusedGroupIndex=-1})})}handleSelectAll(){return x(this,void 0,void 0,function*(){this.isSelectAllChecked=!this.isSelectAllChecked,this.isSelectAllChecked?(this.selectedOptions=[...this.options],this.checkAllOptions()):(this.selectedOptions=[],this.unCheckedAllOptions()),yield this.updateComplete,this.setVisualListbox(!0),this.notifySelectedChange({selected:this.selectedOptions})})}handleInputKeyUp(t){switch(t.code){case o.Uz.Escape:break;case o.Uz.Backspace:this.setFocusOnHost(!0),this.setVisualListbox(!0),this.resizeListbox(),this.removeMultiTag();break;case o.Uz.ArrowLeft:this.isMulti&&(t.shiftKey?this.selectMultiTag(!0):this.selectMultiTag(!1));break;default:this.isMulti&&this.unselectedAllMultiTag()}}handleInput(t){const e=t.target.value;this.inputValue=e.trim(),this.notifyInputValueChanged(e.trim())}removeAllSelected(){var t;this.focusedIndex=-1,this.focusedGroupIndex=-1,this.selectedOptions=[],this.inputValue="",this.setInputValue(),null===(t=this.input)||void 0===t||t.setAttribute(o.iw.AriaActivedescendant,""),this.setVisualListbox(!1),this.unCheckedAllOptions(),this.setSelectedAttribute(void 0),this.updateOnNextFrame(()=>{this.input.focus()}),this.notifySelectedChange({selected:this.selectedOptions})}removeSelected(t){const e=this.findSelectedOption(t),i=this.filteredOptions.indexOf(t);-1!==i&&this.unCheckedOption(i),-1!==e&&(this.selectedOptions.splice(e,1),this.requestUpdate()),this.updateOnNextFrame(()=>{this.input.focus(),this.focusedGroupIndex=-1})}selectedChange(t){var e;const{event:i}=t.detail;let s=this.findOptionIndex(i);if(-1!==s){this.focusedIndex=this.allowSelectAll&&this.checkForVirtualScroll()?s+1:s,this.isMulti&&this.allowSelectAll&&!this.checkForVirtualScroll()&&(s-=1);const t=this.getFocusedItem(s);this.setSelectedAttribute(t),t&&(this.setSelectedOption(t),this.isMulti?this.isMulti&&this.allowSelectAll&&(this.isSelectAllChecked=this.isSelectAllSelected()):(this.setInputValue(this.getOptionValue(t)),null===(e=this.input)||void 0===e||e.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(t))))}}setSelectedAttribute(t){var e;let i="";t&&(i=this.getOptionId(t)),null===(e=this.lists)||void 0===e||e.forEach((t,e)=>{(null==t?void 0:t.id)===i?null==t||t.setAttribute("selected","true"):null==t||t.setAttribute("selected","false")})}shouldChangeButton(){const t=this.input&&this.input.value.length>0&&!this.noClearIcon||this.isMulti&&this.selectedOptions.length&&!this.noClearIcon;return t&&document.dispatchEvent(new CustomEvent("on-widget-update")),t}setCustomValue(){this.optionId||this.optionValue||(this.options=[...this.options,this.inputValue],this.setSelectedOption(this.inputValue),this.isMulti||this.updateOnNextFrame(()=>{var t;this.focusedIndex=this.filteredOptions.length-1;const e=this.getFocusedItem(this.focusedIndex);e&&(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(e)))}),this.dispatchEvent(new CustomEvent("custom-value-add",{composed:!0,bubbles:!0,detail:{value:this.inputValue}}))),this.inputValue=""}handleGroupFocus(){this.setFocusOnHost(!1),this.expanded||this.setVisualListbox(!0),this.filteredGroupOptions.length>0&&-1===this.focusedGroupIndex&&(this.focusedGroupIndex=this.filteredGroupOptions.findIndex(t=>"string"!=typeof t&&t.groupName===this.groupExpandedList[0])),this.updateOnNextFrame(()=>{-1===this.focusedGroupIndex||!this.allowSelectAll&&this.focusedGroupIndex>=this.filteredGroupOptions.length-1||this.allowSelectAll&&this.focusedGroupIndex>=this.filteredGroupOptions.length?this.focusedGroupIndex=0:this.focusedGroupIndex++}),this.focusedIndex=-1}handleInputKeyDown(t){var e,i;switch(t.code){case o.Uz.Backspace:this.focusedIndex=-1;break;case o.Uz.Tab:case o.Uz.Enter:if(this.setFocusOnHost(!0),this.expanded&&this.updateOnNextFrame(()=>{var t;const e=this.getFocusedItem(this.allowSelectAll?this.focusedIndex-1:this.focusedIndex);this.allowCustomValue&&this.input&&this.input.value.length&&-1===this.findFilteredOption(this.inputValue)?this.setCustomValue():(e&&(this.setSelectedAttribute(e),this.setSelectedOption(e),this.showSelectedCount||(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(e)))),this.isMulti&&this.allowSelectAll&&0===this.focusedIndex&&this.handleSelectAll())}),this.setVisualListbox(!1),t.code===o.Uz.Tab&&this.isMulti)return;break;case o.Uz.ArrowDown:if(this.isOptGroup&&0===this.filteredOptions.length)return void this.handleGroupFocus();this.setFocusOnHost(!1),this.expanded||this.setVisualListbox(!0),this.updateOnNextFrame(()=>{var t;-1===this.focusedIndex||!this.allowSelectAll&&this.focusedIndex>=this.filteredOptions.length-1||this.allowSelectAll&&this.focusedIndex>=this.filteredOptions.length?this.focusedIndex=0:this.focusedIndex++;const e=this.getFocusedItem(this.focusedIndex);this.groupExpandedList=[this.getOptionGroupName(e)],!this.showSelectedCount&&e&&(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(e))),this.focusedGroupIndex=-1});break;case o.Uz.ArrowUp:if(this.isOptGroup&&0===this.filteredOptions.length)return void this.handleGroupFocus();this.setFocusOnHost(!1),this.expanded||this.setVisualListbox(!0),this.updateOnNextFrame(()=>{var t;this.focusedIndex<=0?this.focusedIndex=this.allowSelectAll?this.filteredOptions.length:this.filteredOptions.length-1:this.focusedIndex--;const e=this.getFocusedItem(this.focusedIndex);this.groupExpandedList=[this.getOptionGroupName(e)],e&&!this.showSelectedCount&&(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(e)),this.focusedGroupIndex=-1)});break;case o.Uz.ArrowLeft:case o.Uz.ArrowRight:t.stopPropagation();break;case o.Uz.Escape:this.setFocusOnHost(!0),this.expanded?(t.stopPropagation(),this.setVisualListbox(!1)):(this.setInputValue(),null===(e=this.input)||void 0===e||e.setAttribute(o.iw.AriaActivedescendant,""),this.focusedIndex=-1,this.focusedGroupIndex=-1,this.removeAllSelected(),this.setSelectedAttribute(void 0));break;case o.Uz.Home:this.setInputSelectionRange(0,0);break;case o.Uz.End:{const{length:t}=this.inputValue;this.setInputSelectionRange(t,t)}break;case o.Uz.Space:if(this.isMulti&&this.expanded){t.preventDefault();const e=this.getFocusedItem(this.allowSelectAll?this.focusedIndex-1:this.focusedIndex);e&&(this.setSelectedOption(e),this.setSelectedAttribute(e),this.showSelectedCount||(this.setInputValue(),null===(i=this.input)||void 0===i||i.setAttribute(o.iw.AriaActivedescendant,""))),0===this.focusedIndex&&this.allowSelectAll&&this.handleSelectAll()}this.expanded=!0}}handleGroupLabelKeyDown(t,e){switch(t.code){case o.Uz.Tab:this.handleGroupFocus();break;case o.Uz.Enter:case o.Uz.Space:-1!==this.focusedGroupIndex?this.toggleGroupListBox(t,e.value):(this.setFocusOnHost(!0),this.setVisualListbox(!1),this.updateOnNextFrame(()=>{var t;const e=this.getFocusedItem(this.allowSelectAll?this.focusedIndex-1:this.focusedIndex);e&&(this.setSelectedOption(e),this.showSelectedCount||(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(e)),this.updateOnNextFrame(()=>{this.input.focus(),this.focusedGroupIndex=-1}))),this.isMulti&&this.allowSelectAll&&0===this.focusedIndex&&this.handleSelectAll()}));break;case o.Uz.ArrowDown:if(0===this.filteredOptions.length)return;this.setFocusOnHost(!1),this.updateOnNextFrame(()=>{var t;-1===this.focusedIndex||!this.allowSelectAll&&this.focusedIndex>=this.filteredOptions.length-1||this.allowSelectAll&&this.focusedIndex>=this.filteredOptions.length?this.focusedIndex=0:this.focusedIndex++;const e=this.getFocusedItem(this.focusedIndex);this.groupExpandedList=[this.getOptionGroupName(e)],!this.showSelectedCount&&e&&(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(e))),this.focusedGroupIndex=-1});break;case o.Uz.ArrowUp:if(this.isOptGroup&&0===this.filteredOptions.length)return;this.setFocusOnHost(!1),this.updateOnNextFrame(()=>{var t;this.focusedIndex<=0?this.focusedIndex=this.allowSelectAll?this.filteredOptions.length:this.filteredOptions.length-1:this.focusedIndex--;const e=this.getFocusedItem(this.focusedIndex);this.groupExpandedList=[this.getOptionGroupName(e)],e&&!this.showSelectedCount&&(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(e)))});break;case o.Uz.Escape:this.focusedGroupIndex=-1,this.setVisualListbox(!1),this.setFocusOnHost(!0),this.input.focus();break;default:this.setVisualListbox(!0)}}toggleVisualListBox(t){var e,i;if(!this.readOnly){if(t.target.classList.contains("md-combobox-listbox"))t.target.focus();else if("md-icon"===t.target.localName){const s=null===(i=null===(e=t.target.parentElement)||void 0===e?void 0:e.parentElement)||void 0===i?void 0:i.parentElement;if(s){const t=s.querySelector(".md-combobox-listbox");(0,b.setTimeout)(()=>{t.focus()},10)}}this.expanded?this.setVisualListbox(!1):(this.dispatchEvent(new CustomEvent("combobox-on-expand",{composed:!0,bubbles:!0})),this.notifySearchResultCount(),this.setVisualListbox(!0)),this.input.focus(),this.setGroupList(""),this.focusedGroupIndex=-1}}toggleGroupListBox(t,e){t.stopPropagation(),this.focusedGroupIndex=this.filteredGroupOptions.findIndex(t=>"string"!=typeof t&&t.groupName===e),this.setGroupList(e),this.resizeListbox()}handleRemoveAll(t){t.stopPropagation(),this.dispatchEvent(new CustomEvent("remove-all-selected"))}connectedCallback(){super.connectedCallback(),this.setupEvents(),this.querySelector("optgroup")&&(this.isOptGroup=!0)}disconnectedCallback(){super.disconnectedCallback(),this.teardownEvents()}static get styles(){return[a.A,g.A]}get listItemOptionMap(){return{"md-combobox-multiselect":this.isMulti,compact:this.compact,"md-combobox-dropdown-arrow":this.isDropdownArrow}}get filteredOptions(){return this.filterOptions(this.trimSpace?this.inputValue.replace(/\s+/g,""):this.inputValue).filter(t=>!this.isOptGroup||("string"!=typeof t&&this.groupExpandedList.includes(this.getOptionGroupName(t))?"false"===t.isLabel:void 0))}get filteredGroupOptions(){return this.filterOptions(this.trimSpace?this.inputValue.replace(/\s+/g,""):this.inputValue).filter(t=>!this.isOptGroup||("string"!=typeof t?"true"===t.isLabel:void 0))}get comboBoxTemplateClassMap(){return{[`md-combobox--${this.shape}`]:!!this.shape,"md-combobox-searchable":this.searchable,"md-combobox-has-leading-icon":this.searchable||this.showFilterIcon,"md-new-combobox":this.newMomentum,[`md-${this.messageType}`]:!!this.messageType,"md-combobox-readonly":this.readOnly,"md-combobox-compact":this.compact,"md-combobox-dropdown-arrow":this.isDropdownArrow}}searchIconTemplate(){return this.leadingIconTemplate("search-bold","search-icon")}filterIconTemplate(){return this.leadingIconTemplate("filter-bold","filter-icon")}leadingIconTemplate(t,e){return h.html`
1
+ !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js"),require("lit/directives/if-defined.js"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("mobx"),require("lit/directives/repeat.js"));else if("function"==typeof define&&define.amd)define(["lit","lit/decorators.js","lit/directives/class-map.js","lit/directives/style-map.js","lit/directives/if-defined.js","@momentum-ui/icons/data/momentumUiIconsNames.json","@momentum-ui/utils/lib/getColorValue","mobx","lit/directives/repeat.js"],e);else{var i="object"==typeof exports?e(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js"),require("lit/directives/if-defined.js"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("mobx"),require("lit/directives/repeat.js")):e(t.lit,t["lit/decorators.js"],t["lit/directives/class-map.js"],t["lit/directives/style-map.js"],t["lit/directives/if-defined.js"],t["@momentum-ui/icons/data/momentumUiIconsNames.json"],t["@momentum-ui/utils/lib/getColorValue"],t.mobx,t["lit/directives/repeat.js"]);for(var s in i)("object"==typeof exports?exports:t)[s]=i[s]}}(self,(t,e,i,s,o,l,n,r,a)=>(()=>{"use strict";var h,d={2273(t,e,i){i.r(e),i.d(e,{ComboBox:()=>s}),i(7906),i(1821);var s,o=i(2900),l=i(7704),n=i(9609),r=i(2050),a=i(4084),h=i(7161),d=i(429),u=i(5125),p=i(291),c=i(8175),m=i(318),b=i(7103),g=i(4047),f=function(t,e,i,s){var o,l=arguments.length,n=l<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(n=(l<3?o(n):l>3?o(e,i,n):o(e,i))||n);return l>3&&n&&Object.defineProperty(e,i,n),n},x=function(t,e,i,s){return new(i||(i=Promise))(function(o,l){function n(t){try{a(s.next(t))}catch(t){l(t)}}function r(t){try{a(s.throw(t))}catch(t){l(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(n,r)}a((s=s.apply(t,e||[])).next())})};!function(t){class e{determineMessageType(t){return t.reduce((t,e)=>"error"===e?t:e.type,"")}filterMessagesByType(t,e){return t.reduce((t,i)=>i.type===e?t.concat(i.message):t,[])}}t.MessageController=e;let i=class extends((0,l.yC)(h.LitElement)){constructor(){super(...arguments),this._focusedIndex=-1,this._focusedGroupIndex=-1,this.label="Options",this.options=[],this.customOptions=[],this.placeholder="",this.isMulti=!1,this.useVirtualScroll=!1,this.disabled=!1,this.ordered=!1,this.expanded=!1,this.groupExpandedList=[],this.searchItem=!1,this.compact=!1,this.noClearIcon=!1,this.selectWhenInFocus=!1,this.selectedOptions=[],this.visibleOptions=8,this.optionId="",this.optionValue="",this.isCustomContent=!1,this.searchable=!1,this.shape="none",this.value=[],this.inputValue="",this.allowCustomValue=!1,this.autofocus=!1,this.resultsTextLocalization="No Results",this.optionsTextLocalization="No Options",this.trimSpace=!1,this.invalid=!1,this.invalidText="",this.ariaLabel="",this.searchResultAriaLabel="",this.ariaLabelForComboBox="",this.clearAriaLabel="Clear",this.arrowAriaLabel="Expand",this.clearIconHeight="auto",this.allTextLocalization="All",this.selectAllTextLocalization="Select All",this.selectedTextLocalization="Selected",this.allowSelectAll=!1,this.showCustomError=!1,this.showLoader=!1,this.showSelectedCount=!1,this.popupChevronAriaHidden="true",this.newMomentum=!1,this.showFilterIcon=!1,this.preventFilter=!1,this.isDropdownArrow=!1,this.comboboxId="",this.helpText="",this.messageArr=[],this.htmlId="",this.readOnly=!1,this.messageController=new e,this.isOptGroup=!1,this.isSelectAllChecked=!1,this.multiSelectedIndex=-1,this.multiSelected=[],this.customContent=[],this.notifySelectedChange=(0,r.sg)(t=>{this.dispatchEvent(new CustomEvent("change-selected",{composed:!0,bubbles:!0,detail:t}))},0),this.handleGroupFilter=t=>{const e=t.filter(t=>{if("string"!=typeof t&&"true"===t.isLabel)return t.groupName});return this.searchItem=!0,this.groupExpandedList=e.map(t=>{if("string"!=typeof t)return t.groupName}),t.filter(e=>"string"==typeof e||"true"!==e.isLabel||!!t.find(t=>{if("string"!=typeof e&&"string"!=typeof t)return e.groupName===t.groupName&&"false"===t.isLabel}))},this.notifyInputValueChanged=(0,r.sg)(t=>{this.dispatchEvent(new CustomEvent("combobox-input",{composed:!0,bubbles:!0,detail:{value:t}})),this.notifySearchResultCount(),this.focusedGroupIndex=0,requestAnimationFrame(()=>{this.input.focus(),this.focusedGroupIndex=-1})},250),this.handleOutsideClick=t=>{let e=!1;const i=t.composedPath();i.length&&(e=!!i.find(t=>t===this),e||(this.setVisualListbox(!1),this.unselectedAllMultiTag()))}}get focusedIndex(){return this._focusedIndex}set focusedIndex(t){this.updateFocusedIndex(t)}updateFocusedIndex(t){var e,i,s,o;const l=this._focusedIndex;if(this.checkForVirtualScroll()){let l;l=this.allowSelectAll?0===t?"selectAll":this.getOptionId(this.filteredOptions[t-1]):this.getOptionId(this.filteredOptions[t]);const n=this.lists?null===(e=[...this.lists])||void 0===e?void 0:e.find(t=>0!==t.offsetHeight&&t.id===l):"";this.lists&&[...this.lists].forEach(t=>{t.toggleAttribute("focused",!1)}),n&&(null==n||n.toggleAttribute("focused",!0));const r=null===(i=this.shadowRoot)||void 0===i?void 0:i.querySelector("lit-virtualizer");r&&(-1===t?null===(s=r.element(t))||void 0===s||s.scrollIntoView({block:"start"}):null===(o=r.element(t))||void 0===o||o.scrollIntoView({block:"center"}))}else if(this.lists){const e=this.lists[l];e&&e.toggleAttribute("focused",!1);const i=this.lists[t];i&&i.toggleAttribute("focused",!0)}this._focusedIndex=t,this.requestUpdate("focusedIndex",l)}get focusedGroupIndex(){return this._focusedGroupIndex}set focusedGroupIndex(t){const e=this._focusedGroupIndex;if(this.labels&&0!==this.labels.length){const i=this.labels[e];i&&i.toggleAttribute("focused",!1);const s=this.labels[t];s&&(s.toggleAttribute("focused",!0),s.focus())}this._focusedGroupIndex=t,this.requestUpdate("focusedGroupIndex",e)}get messageType(){return this.messageArr.length>0?this.messageController.determineMessageType(this.messageArr):null}get messages(){return this.messageType?this.messageController.filterMessagesByType(this.messageArr,this.messageType):null}notifySearchResultCount(){if(this.searchResultAriaLabel){const t=/{{.*?}}/g;this.ariaLabelForComboBox=this.searchResultAriaLabel.replace(t,this.filteredOptions.length.toString())}else this.ariaLabel?this.ariaLabelForComboBox=`${this.ariaLabel}, ${this.filteredOptions.length} results found.`:this.ariaLabelForComboBox=`ComboBox Element, ${this.filteredOptions.length} results found.`}firstUpdated(t){this.ariaLabelForComboBox=this.ariaLabel?this.ariaLabel:"ComboBox Element",super.firstUpdated(t),this.isCustomContent&&(this.optionId="id",this.optionValue="value",this.setOptionCustomContent()),this.setInitialValue()}updated(t){super.updated(t),t.has("expanded")&&(this.expanded?(this.resizeListbox(),this.checkSelectedOptions()):this.unCheckAllOptions()),t.has("focusedIndex")&&this.focusedIndex>=0&&(this.checkForVirtualScroll()||this.scrollToOption()),t.has("value")&&0===this.selectedOptions.length&&this.setInitialValue(),t.has("options")&&this.expanded&&this.checkForVirtualScroll()&&this.updateOnNextFrame(()=>{this.resizeListbox()}),t.has("customOptions")&&this.isCustomContent&&(this.setOptionCustomContent(),this.resizeListbox()),t.has("showCustomError")&&this.resizeListbox(),t.has("showLoader")&&this.resizeListbox(),t.has("searchItem")&&this.resizeListbox()}handleFocusIn(t){var e;this.disabled&&!this.readOnly||(this.noClearIcon&&(requestAnimationFrame(()=>{this.input.focus(),this.focusedGroupIndex=-1}),this.selectWhenInFocus&&this.input.select()),null===(e=super.handleFocusIn)||void 0===e||e.call(this,t)),this.dispatchEvent(new CustomEvent("combobox-focus-in",{composed:!0,bubbles:!0}))}handleFocusOut(t){var e;null===(e=super.handleFocusOut)||void 0===e||e.call(this,t),this.dispatchEvent(new CustomEvent("combobox-focus-out",{composed:!0,bubbles:!0}))}findFilteredOption(t){return this.isOptionObject(t)?this.filteredOptions.findIndex(e=>this.getOptionId(e)===this.getOptionId(t)&&this.getOptionValue(e)===this.getOptionValue(t)):this.filteredOptions.indexOf(t)}setInitialValue(){var t;if(this.value.length)if(this.isMulti)this.value.forEach(t=>{-1!==this.findFilteredOption(t)&&this.setSelectedOption(t)});else{const e=this.value[0],i=this.findFilteredOption(e);-1!==i&&(this.setSelectedOption(e),this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(e)),this.focusedIndex=i,this.focusedGroupIndex=-1)}}isOptionObject(t){return"object"==typeof t&&null!==t}setOptionCustomContent(){if(this.isOptGroup){const t=[...this.querySelectorAll("optgroup")],e=[];for(const i of t){const t=i.getAttribute("label"),s=[...i.querySelectorAll("[slot]")];e.push({isLabel:"true",[this.optionValue]:t,groupName:t});for(const i of s){const s=i.getAttribute("aria-label"),o=i.getAttribute("display-value"),l=i.getAttribute("slot");s&&o&&e.push({[this.optionId]:s,[this.optionValue]:o,isLabel:"false",groupName:t,slot:l})}}this.options=e}else this.customContent=[...this.querySelectorAll("[slot]")],this.customContent&&this.customContent.length?this.options=this.customContent.map(t=>{const e=t.getAttribute("aria-label"),i=t.getAttribute("display-value");if(e&&i)return{[this.optionId]:e,[this.optionValue]:i}}):this.options=[]}getOptionValue(t){return this.isOptionObject(t)?String(t[this.optionValue]):t}getOptionGroupName(t){return null==t?void 0:t.groupName}getOptionId(t){return this.isOptionObject(t)?String(t[this.optionId]):t}getFocusedItem(t){if(t>=0)return this.filteredOptions[t]}setupEvents(){document.addEventListener("click",this.handleOutsideClick),this.addEventListener("remove-all-selected",this.removeAllSelected),this.addEventListener("selected-changed",this.selectedChange)}teardownEvents(){document.removeEventListener("click",this.handleOutsideClick),this.removeEventListener("remove-all-selected",this.removeAllSelected),this.removeEventListener("selected-changed",this.selectedChange)}setVisualListbox(t){this.expanded=t}setGroupList(t){this.groupExpandedList.includes(t)?(this.groupExpandedList.splice(this.groupExpandedList.indexOf(t),1),this.groupExpandedList=[...this.groupExpandedList]):this.searchItem?this.groupExpandedList.push(t):this.groupExpandedList=[t]}findSelectedOption(t){return this.optionId&&t?this.selectedOptions.findIndex(e=>e&&e[this.optionId]===t[this.optionId]):this.selectedOptions.indexOf(t)}findOptionIndex(t){const e=t.composedPath();if(this.checkForVirtualScroll()){let t="";return[...this.lists].forEach(i=>{e.includes(i)&&(t=i.id)}),this.filteredOptions.findIndex(e=>this.getOptionId(e)===t)}return[...this.lists].findIndex(t=>e.includes(t))}checkSelectedOptions(){if(this.checkForVirtualScroll()){const t=this.selectedOptions.map(t=>this.getOptionId(t)),e=[...this.lists].filter(t=>"selectAll"!==t.id);null==e||e.forEach(e=>{t.includes(e.id)?(this.isMulti&&(null==e||e.setAttribute("aria-checked","true")),null==e||e.setAttribute("aria-selected","true")):this.isMulti&&(null==e||e.setAttribute("aria-checked","false"))})}}unCheckAllOptions(){var t;this.checkForVirtualScroll()&&this.isMulti&&(null===(t=[...this.lists])||void 0===t||t.forEach(t=>{"selectAll"!==(null==t?void 0:t.id)&&(null==t||t.setAttribute("aria-checked","false"))}))}setSelectedOption(t){this.isMulti||(this.selectedOptions=[]);const e=this.findSelectedOption(t);if(-1!==e){const t=this.selectedOptions[e];this.selectedOptions.splice(e,1),this.notifySelectedChange({value:t,selected:this.selectedOptions})}else this.selectedOptions.push(t),this.notifySelectedChange({value:t,selected:this.selectedOptions});this.checkSelectedOptions(),this.isMulti&&this.allowSelectAll&&(this.isSelectAllChecked=this.isSelectAllSelected()),this.requestUpdate()}filterOptions(t){if(this.preventFilter)return this.searchItem=!1,this.options;if(t&&t.length){const e=this.options.filter(e=>this.isOptGroup&&"string"!=typeof e&&"true"===e.isLabel?e:(this.isCustomContent?this.getOptionId(e):this.getOptionValue(e)).toLowerCase().includes(t.toLowerCase()));return this.isOptGroup?this.handleGroupFilter(e):e}return this.searchItem=!1,this.options}getListBoxVerticalPadding(){if(this.listBox){const t=window.getComputedStyle(this.listBox,null),e=parseInt(t.getPropertyValue("padding-top"))+parseInt(t.getPropertyValue("padding-bottom"));if(!isNaN(e))return e+2}return 10}resizeListbox(){this.updateOnNextFrame(()=>{var t;let e=0,i=0,s=0;const o=this.getListBoxVerticalPadding();if(this.lists){const t=this.checkForVirtualScroll()?[...this.lists].filter(t=>0!==t.offsetHeight):[...this.lists];e=t.slice(0,this.visibleOptions).reduce((t,e)=>t+e.offsetHeight,0),s=this.checkForVirtualScroll()&&this.allowSelectAll?t.slice(1,this.visibleOptions).reduce((t,e)=>t+e.offsetHeight,0):t.slice(0,this.visibleOptions).reduce((t,e)=>t+e.offsetHeight,0)}if(this.labels&&(i=[...this.labels].slice(0,this.visibleOptions).reduce((t,e)=>t+e.offsetHeight,0)),this.listBox&&(this.listBox.style.maxHeight=`${e+i+o}px`),this.virtualizer&&(this.virtualizer.style.height=`${s+o}px`),this.showCustomError||this.showLoader){const e=null===(t=this.listBox)||void 0===t?void 0:t.querySelector("[slot]");this.listBox&&e&&(this.listBox.style.height=`${e.clientHeight+o}px`,this.listBox.style.maxHeight=`${e.clientHeight+o}px`)}})}setInputValue(t=""){this.input.value=t}updateOnNextFrame(t){requestAnimationFrame(t)}unCheckedAllOptions(){this.isMulti&&(this.lists.forEach((t,e)=>this.unCheckedOption(e)),this.isSelectAllChecked=!1)}unCheckedOption(t){this.isMulti&&(this.lists[t].setAttribute("aria-checked","false"),this.notifySelectedChange({value:this.filteredOptions[t],selected:this.selectedOptions}))}checkAllOptions(){this.isMulti&&this.lists.forEach((t,e)=>this.checkOption(e))}checkOption(t){this.isMulti&&(this.lists[t].setAttribute("aria-checked","true"),this.notifySelectedChange({value:this.filteredOptions[t],selected:this.selectedOptions}))}isSelectAllSelected(){return this.selectedOptions.length===this.options.length}setFocusOnHost(t){this.setFocus&&this.setFocus(t)}isOptionFocused(t){return this.focusedIndex===t}getAriaState(t){return this.isOptionFocused(t)}scrollToOption(){var t,e;let i=0;const{top:s,bottom:o}=this.listBox.getBoundingClientRect(),l=this.lists[this.focusedIndex],n=null===(t=this.lists[this.focusedIndex+1]||l)||void 0===t?void 0:t.getBoundingClientRect(),r=null===(e=this.lists[this.focusedIndex-1]||l)||void 0===e?void 0:e.getBoundingClientRect();(null==n?void 0:n.bottom)>o?i=n.bottom-o+2:(null==r?void 0:r.top)<s&&(i=r.top-s-2),this.updateOnNextFrame(()=>{this.listBox.scrollTop+=i})}getCustomContentName(t){const e=this.options.indexOf(t);if(this.isOptGroup){const t=this.options[e];if(t&&"string"!=typeof t)return t.slot}else if(-1!==e)return this.customContent[e].slot}setInputSelectionRange(t,e){this.input.setSelectionRange(t,e)}isOptionChecked(t){return-1!==this.findSelectedOption(t)?"true":"false"}getInputSelection(){return this.input.selectionStart}canMultiSelect(){return 0===this.getInputSelection()&&0!==this.selectedOptions.length&&this.isMulti}removeMultiTag(){this.selected&&this.multiSelected.forEach(t=>{const e=this.selected[t];e&&e.hasAttribute("selected")&&this.removeSelected(this.selectedOptions[t])})}unselectedAllMultiTag(){this.selected&&this.selected.forEach(t=>t.removeAttribute("selected")),this.multiSelectedIndex=-1}findLastMultiSelected(){return this.selected[this.multiSelectedIndex]}toggleMultiSelectedTag(t,e){t&&t.toggleAttribute("selected",e)}selectMultiTag(t){if(this.canMultiSelect()){if(!t){this.multiSelected=[];const t=this.findLastMultiSelected();this.toggleMultiSelectedTag(t,!1)}this.multiSelectedIndex<=0?this.multiSelectedIndex=this.selectedOptions.length-1:this.multiSelectedIndex--,this.multiSelected.push(this.multiSelectedIndex);const e=this.findLastMultiSelected();this.toggleMultiSelectedTag(e,!0)}}handleListClick(t){return x(this,void 0,void 0,function*(){this.dispatchEvent(new CustomEvent("selected-changed",{detail:{event:t}})),yield this.updateComplete,this.isMulti?this.setVisualListbox(!0):this.setVisualListbox(!1),this.updateOnNextFrame(()=>{this.input.focus(),this.focusedGroupIndex=-1})})}handleSelectAll(){return x(this,void 0,void 0,function*(){this.isSelectAllChecked=!this.isSelectAllChecked,this.isSelectAllChecked?(this.selectedOptions=[...this.options],this.checkAllOptions()):(this.selectedOptions=[],this.unCheckedAllOptions()),yield this.updateComplete,this.setVisualListbox(!0),this.notifySelectedChange({selected:this.selectedOptions})})}handleInputKeyUp(t){switch(t.code){case o.Uz.Escape:break;case o.Uz.Backspace:this.setFocusOnHost(!0),this.setVisualListbox(!0),this.resizeListbox(),this.removeMultiTag();break;case o.Uz.ArrowLeft:this.isMulti&&(t.shiftKey?this.selectMultiTag(!0):this.selectMultiTag(!1));break;default:this.isMulti&&this.unselectedAllMultiTag()}}handleInput(t){const e=t.target.value;this.inputValue=e.trim(),this.notifyInputValueChanged(e.trim())}removeAllSelected(){var t;this.focusedIndex=-1,this.focusedGroupIndex=-1,this.selectedOptions=[],this.inputValue="",this.setInputValue(),null===(t=this.input)||void 0===t||t.setAttribute(o.iw.AriaActivedescendant,""),this.setVisualListbox(!1),this.unCheckedAllOptions(),this.setSelectedAttribute(void 0),this.updateOnNextFrame(()=>{this.input.focus()}),this.notifySelectedChange({selected:this.selectedOptions})}removeSelected(t){const e=this.findSelectedOption(t),i=this.filteredOptions.indexOf(t);-1!==i&&this.unCheckedOption(i),-1!==e&&(this.selectedOptions.splice(e,1),this.requestUpdate()),this.updateOnNextFrame(()=>{this.input.focus(),this.focusedGroupIndex=-1})}selectedChange(t){var e;const{event:i}=t.detail;let s=this.findOptionIndex(i);if(-1!==s){this.focusedIndex=this.allowSelectAll&&this.checkForVirtualScroll()?s+1:s,this.isMulti&&this.allowSelectAll&&!this.checkForVirtualScroll()&&(s-=1);const t=this.getFocusedItem(s);if(this.setSelectedAttribute(t),t)if(this.setSelectedOption(t),this.isMulti)this.isMulti&&this.allowSelectAll&&(this.isSelectAllChecked=this.isSelectAllSelected());else{const i=this.getOptionValue(t);this.inputValue=i,this.setInputValue(i),null===(e=this.input)||void 0===e||e.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(t))}}}setSelectedAttribute(t){var e;let i="";t&&(i=this.getOptionId(t)),null===(e=this.lists)||void 0===e||e.forEach((t,e)=>{(null==t?void 0:t.id)===i?null==t||t.setAttribute("selected","true"):null==t||t.setAttribute("selected","false")})}shouldChangeButton(){const t=this.input&&this.input.value.length>0&&!this.noClearIcon||this.isMulti&&this.selectedOptions.length&&!this.noClearIcon;return t&&document.dispatchEvent(new CustomEvent("on-widget-update")),t}setCustomValue(){this.optionId||this.optionValue||(this.options=[...this.options,this.inputValue],this.setSelectedOption(this.inputValue),this.isMulti||this.updateOnNextFrame(()=>{var t;this.focusedIndex=this.filteredOptions.length-1;const e=this.getFocusedItem(this.focusedIndex);e&&(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(e)))}),this.dispatchEvent(new CustomEvent("custom-value-add",{composed:!0,bubbles:!0,detail:{value:this.inputValue}}))),this.inputValue=""}handleGroupFocus(){this.setFocusOnHost(!1),this.expanded||this.setVisualListbox(!0),this.filteredGroupOptions.length>0&&-1===this.focusedGroupIndex&&(this.focusedGroupIndex=this.filteredGroupOptions.findIndex(t=>"string"!=typeof t&&t.groupName===this.groupExpandedList[0])),this.updateOnNextFrame(()=>{-1===this.focusedGroupIndex||!this.allowSelectAll&&this.focusedGroupIndex>=this.filteredGroupOptions.length-1||this.allowSelectAll&&this.focusedGroupIndex>=this.filteredGroupOptions.length?this.focusedGroupIndex=0:this.focusedGroupIndex++}),this.focusedIndex=-1}handleInputKeyDown(t){var e,i;if(!this.readOnly)switch(t.code){case o.Uz.Backspace:this.focusedIndex=-1;break;case o.Uz.Tab:case o.Uz.Enter:if(this.setFocusOnHost(!0),this.expanded){if(this.allowCustomValue&&this.input&&this.input.value.length&&-1===this.findFilteredOption(this.inputValue))return void this.setCustomValue();this.updateOnNextFrame(()=>{var t;const e=this.getFocusedItem(this.allowSelectAll?this.focusedIndex-1:this.focusedIndex);!e||this.showSelectedCount||this.isMulti||(this.inputValue=this.getOptionValue(e)),e&&(this.setSelectedAttribute(e),this.setSelectedOption(e),this.showSelectedCount||(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(e)))),this.isMulti&&this.allowSelectAll&&0===this.focusedIndex&&this.handleSelectAll()})}if(this.setVisualListbox(!1),t.code===o.Uz.Tab&&this.isMulti)return;break;case o.Uz.ArrowDown:if(this.isOptGroup&&0===this.filteredOptions.length)return void this.handleGroupFocus();this.setFocusOnHost(!1),this.expanded||this.setVisualListbox(!0),this.updateOnNextFrame(()=>{var t;-1===this.focusedIndex||!this.allowSelectAll&&this.focusedIndex>=this.filteredOptions.length-1||this.allowSelectAll&&this.focusedIndex>=this.filteredOptions.length?this.focusedIndex=0:this.focusedIndex++;const e=this.getFocusedItem(this.focusedIndex);this.groupExpandedList=[this.getOptionGroupName(e)],!this.showSelectedCount&&e&&(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(e))),this.focusedGroupIndex=-1});break;case o.Uz.ArrowUp:if(this.isOptGroup&&0===this.filteredOptions.length)return void this.handleGroupFocus();this.setFocusOnHost(!1),this.expanded||this.setVisualListbox(!0),this.updateOnNextFrame(()=>{var t;this.focusedIndex<=0?this.focusedIndex=this.allowSelectAll?this.filteredOptions.length:this.filteredOptions.length-1:this.focusedIndex--;const e=this.getFocusedItem(this.focusedIndex);this.groupExpandedList=[this.getOptionGroupName(e)],e&&!this.showSelectedCount&&(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(e)),this.focusedGroupIndex=-1)});break;case o.Uz.ArrowLeft:case o.Uz.ArrowRight:t.stopPropagation();break;case o.Uz.Escape:this.setFocusOnHost(!0),this.expanded?(t.stopPropagation(),this.setVisualListbox(!1)):(this.setInputValue(),null===(e=this.input)||void 0===e||e.setAttribute(o.iw.AriaActivedescendant,""),this.focusedIndex=-1,this.focusedGroupIndex=-1,this.removeAllSelected(),this.setSelectedAttribute(void 0));break;case o.Uz.Home:this.setInputSelectionRange(0,0);break;case o.Uz.End:{const{length:t}=this.inputValue;this.setInputSelectionRange(t,t)}break;case o.Uz.Space:if(this.isMulti&&this.expanded){t.preventDefault();const e=this.getFocusedItem(this.allowSelectAll?this.focusedIndex-1:this.focusedIndex);e&&(this.setSelectedOption(e),this.setSelectedAttribute(e),this.showSelectedCount||(this.setInputValue(),null===(i=this.input)||void 0===i||i.setAttribute(o.iw.AriaActivedescendant,""))),0===this.focusedIndex&&this.allowSelectAll&&this.handleSelectAll()}this.expanded=!0}}handleGroupLabelKeyDown(t,e){switch(t.code){case o.Uz.Tab:this.handleGroupFocus();break;case o.Uz.Enter:case o.Uz.Space:-1!==this.focusedGroupIndex?this.toggleGroupListBox(t,e.value):(this.setFocusOnHost(!0),this.setVisualListbox(!1),this.updateOnNextFrame(()=>{var t;const e=this.getFocusedItem(this.allowSelectAll?this.focusedIndex-1:this.focusedIndex);e&&(this.setSelectedOption(e),this.showSelectedCount||(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(e)),this.updateOnNextFrame(()=>{this.input.focus(),this.focusedGroupIndex=-1}))),this.isMulti&&this.allowSelectAll&&0===this.focusedIndex&&this.handleSelectAll()}));break;case o.Uz.ArrowDown:if(0===this.filteredOptions.length)return;this.setFocusOnHost(!1),this.updateOnNextFrame(()=>{var t;-1===this.focusedIndex||!this.allowSelectAll&&this.focusedIndex>=this.filteredOptions.length-1||this.allowSelectAll&&this.focusedIndex>=this.filteredOptions.length?this.focusedIndex=0:this.focusedIndex++;const e=this.getFocusedItem(this.focusedIndex);this.groupExpandedList=[this.getOptionGroupName(e)],!this.showSelectedCount&&e&&(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(e))),this.focusedGroupIndex=-1});break;case o.Uz.ArrowUp:if(this.isOptGroup&&0===this.filteredOptions.length)return;this.setFocusOnHost(!1),this.updateOnNextFrame(()=>{var t;this.focusedIndex<=0?this.focusedIndex=this.allowSelectAll?this.filteredOptions.length:this.filteredOptions.length-1:this.focusedIndex--;const e=this.getFocusedItem(this.focusedIndex);this.groupExpandedList=[this.getOptionGroupName(e)],e&&!this.showSelectedCount&&(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(e)))});break;case o.Uz.Escape:this.focusedGroupIndex=-1,this.setVisualListbox(!1),this.setFocusOnHost(!0),this.input.focus();break;default:this.setVisualListbox(!0)}}toggleVisualListBox(t){var e,i;if(!this.readOnly){if(t.target.classList.contains("md-combobox-listbox"))t.target.focus();else if("md-icon"===t.target.localName){const s=null===(i=null===(e=t.target.parentElement)||void 0===e?void 0:e.parentElement)||void 0===i?void 0:i.parentElement;if(s){const t=s.querySelector(".md-combobox-listbox");(0,b.setTimeout)(()=>{t.focus()},10)}}this.expanded?this.setVisualListbox(!1):(this.dispatchEvent(new CustomEvent("combobox-on-expand",{composed:!0,bubbles:!0})),this.notifySearchResultCount(),this.setVisualListbox(!0)),this.input.focus(),this.setGroupList(""),this.focusedGroupIndex=-1}}toggleGroupListBox(t,e){t.stopPropagation(),this.focusedGroupIndex=this.filteredGroupOptions.findIndex(t=>"string"!=typeof t&&t.groupName===e),this.setGroupList(e),this.resizeListbox()}handleRemoveAll(t){t.stopPropagation(),this.dispatchEvent(new CustomEvent("remove-all-selected"))}connectedCallback(){super.connectedCallback(),this.setupEvents(),this.querySelector("optgroup")&&(this.isOptGroup=!0)}disconnectedCallback(){super.disconnectedCallback(),this.teardownEvents()}static get styles(){return[a.A,g.A]}get listItemOptionMap(){return{"md-combobox-multiselect":this.isMulti,compact:this.compact,"md-combobox-dropdown-arrow":this.isDropdownArrow}}get filteredOptions(){return this.filterOptions(this.trimSpace?this.inputValue.replace(/\s+/g,""):this.inputValue).filter(t=>!this.isOptGroup||("string"!=typeof t&&this.groupExpandedList.includes(this.getOptionGroupName(t))?"false"===t.isLabel:void 0))}get filteredGroupOptions(){return this.filterOptions(this.trimSpace?this.inputValue.replace(/\s+/g,""):this.inputValue).filter(t=>!this.isOptGroup||("string"!=typeof t?"true"===t.isLabel:void 0))}get comboBoxTemplateClassMap(){return{[`md-combobox--${this.shape}`]:!!this.shape,"md-combobox-searchable":this.searchable,"md-combobox-has-leading-icon":this.searchable||this.showFilterIcon,"md-new-combobox":this.newMomentum,[`md-${this.messageType}`]:!!this.messageType,"md-combobox-readonly":this.readOnly,"md-combobox-compact":this.compact,"md-combobox-dropdown-arrow":this.isDropdownArrow}}searchIconTemplate(){return this.leadingIconTemplate("search-bold","search-icon")}filterIconTemplate(){return this.leadingIconTemplate("filter-bold","filter-icon")}leadingIconTemplate(t,e){return h.html`
2
2
  <md-icon
3
3
  name=${t}
4
4
  class=${e}
5
5
  size="16"
6
6
  iconSet="momentumDesign"
7
+ aria-hidden="true"
7
8
  @click=${this.toggleVisualListBox}
8
9
  ></md-icon>
9
10
  `}selectedOptionTemplate(t){return h.html`
@@ -14,6 +15,7 @@
14
15
  name="cancel-bold"
15
16
  size=${this.newMomentum?"16":"8"}
16
17
  iconSet="momentumDesign"
18
+ aria-hidden="true"
17
19
  @click=${()=>this.removeSelected(t)}
18
20
  ></md-icon>
19
21
  </div>
@@ -33,6 +35,7 @@
33
35
  name="cancel-bold"
34
36
  size="14"
35
37
  iconSet="momentumDesign"
38
+ aria-hidden="true"
36
39
  style="height: ${this.clearIconHeight};"
37
40
  ></md-icon>
38
41
  </button>
@@ -42,22 +45,22 @@
42
45
  class="md-combobox-button arrow-down"
43
46
  part="combobox-button-arrow"
44
47
  aria-expanded=${this.expanded}
45
- aria-label=${(0,u.ifDefined)("true"===this.popupChevronAriaHidden?void 0:this.arrowAriaLabel)}
48
+ aria-label=${(0,p.ifDefined)("true"===this.popupChevronAriaHidden?void 0:this.arrowAriaLabel)}
46
49
  aria-controls="md-combobox-listbox"
47
50
  tabindex="-1"
48
- aria-hidden=${(0,u.ifDefined)("true"===this.popupChevronAriaHidden?"true":void 0)}
51
+ aria-hidden=${(0,p.ifDefined)("true"===this.popupChevronAriaHidden?"true":void 0)}
49
52
  ?disabled=${this.disabled}
50
53
  ?readonly=${this.readOnly}
51
54
  @click=${this.toggleVisualListBox}
52
55
  >
53
- <md-icon name="arrow-down-bold" size="16" iconSet="momentumDesign"></md-icon>
56
+ <md-icon name="arrow-down-bold" size="16" iconSet="momentumDesign" aria-hidden="true"></md-icon>
54
57
  </button>
55
58
  `}groupArrowButtonTemplate(t){const e=this.groupExpandedList.includes(t)?"arrow-up-bold":"arrow-down-bold";return h.html`
56
59
  <button
57
60
  type="button"
58
61
  class="md-combobox-button"
59
62
  part="combobox-button-arrow"
60
- aria-label=${(0,u.ifDefined)("true"===this.popupChevronAriaHidden?void 0:this.arrowAriaLabel)}
63
+ aria-label=${(0,p.ifDefined)("true"===this.popupChevronAriaHidden?void 0:this.arrowAriaLabel)}
61
64
  aria-controls="md-combobox-listbox"
62
65
  tabindex="-1"
63
66
  aria-hidden=${"true"===this.popupChevronAriaHidden?"true":"false"}
@@ -66,17 +69,17 @@
66
69
  @click=${e=>this.toggleGroupListBox(e,t)}
67
70
  >
68
71
  <span>
69
- <md-icon name=${e} size="12" iconSet="momentumDesign"></md-icon>
72
+ <md-icon name=${e} size="12" iconSet="momentumDesign" aria-hidden="true"></md-icon>
70
73
  </span>
71
74
  </button>
72
75
  `}getSelectAllOption(){const t=this.checkForVirtualScroll()?`, 1 of ${this.options.length+1}`:"";return h.html`
73
76
  <div
74
77
  id="selectAll"
75
78
  part="combobox-option"
76
- class="md-combobox-option ${(0,p.classMap)(this.listItemOptionMap)}"
79
+ class="md-combobox-option ${(0,u.classMap)(this.listItemOptionMap)}"
77
80
  @click=${this.handleSelectAll}
78
81
  aria-label="${this.selectAllTextLocalization}${t}"
79
- aria-checked=${(0,u.ifDefined)(this.isSelectAllChecked?"true":void 0)}
82
+ aria-checked=${(0,p.ifDefined)(this.isSelectAllChecked?"true":void 0)}
80
83
  role="checkbox"
81
84
  >
82
85
  <span class="select-option" aria-hidden="true">
@@ -87,7 +90,7 @@
87
90
  </div>
88
91
  `}getSelctedCount(){return 0===this.selectedOptions.length?h.nothing:this.isSelectAllSelected()?h.html` <span class="selected-count">${this.allTextLocalization}</span> `:h.html`
89
92
  <span class="selected-count">${this.selectedOptions.length} ${this.selectedTextLocalization}</span>
90
- `}checkForVirtualScroll(){return this.useVirtualScroll&&!this.isOptGroup}rangeChanged(){this.updateFocusedIndex(this.focusedIndex),this.checkSelectedOptions(),this.resizeListbox()}getCustomErrorContent(){const t=this.querySelector("[slot]")||this.shadowRoot.querySelector("[slot]");return document.createRange().createContextualFragment(`${null==t?void 0:t.outerHTML}`)}getCustomContent(t){const e=this.getCustomContentName(t);if(this.isOptGroup){const t=[...this.querySelectorAll("[slot]")].find(t=>t.slot===e);return t?document.createRange().createContextualFragment(`${t.outerHTML}`):h.html``}return h.html` <slot name=${(0,u.ifDefined)(e)}></slot> `}renderGroupLabelHeader(t,e){return h.html`
93
+ `}checkForVirtualScroll(){return this.useVirtualScroll&&!this.isOptGroup}rangeChanged(){this.updateFocusedIndex(this.focusedIndex),this.checkSelectedOptions(),this.resizeListbox()}getCustomErrorContent(){const t=this.querySelector("[slot]")||this.shadowRoot.querySelector("[slot]");return document.createRange().createContextualFragment(`${null==t?void 0:t.outerHTML}`)}getCustomContent(t){const e=this.getCustomContentName(t);if(this.isOptGroup){const t=[...this.querySelectorAll("[slot]")].find(t=>t.slot===e);return t?document.createRange().createContextualFragment(`${t.outerHTML}`):h.html``}return h.html` <slot name=${(0,p.ifDefined)(e)}></slot> `}renderGroupLabelHeader(t,e){return h.html`
91
94
  <div
92
95
  part="group-label"
93
96
  class="group-label"
@@ -114,7 +117,7 @@
114
117
  aria-label="${this.isCustomContent?this.getOptionId(t):this.getOptionValue(t)}${o}"
115
118
  tabindex="-1"
116
119
  @click=${t=>this.handleListClick(t)}
117
- aria-checked=${(0,u.ifDefined)(this.isMulti?this.isOptionChecked.call(this,t):void 0)}
120
+ aria-checked=${(0,p.ifDefined)(this.isMulti?this.isOptionChecked.call(this,t):void 0)}
118
121
  >
119
122
  ${this.isMulti?h.html`
120
123
  <span class="select-option" aria-hidden="true">
@@ -127,7 +130,7 @@
127
130
  </div>
128
131
  `}inputTitle(){return this.isMulti?this.selectedOptions.length>0?`${this.selectedOptions.length} ${this.selectedTextLocalization}`:this.placeholder:this.selectedOptions.length>0?this.getOptionValue(this.selectedOptions[0]):this.placeholder}helpTextTemplate(){return this.helpText?h.html`
129
132
  <md-help-text
130
- class="help-text ${(0,p.classMap)({disabled:this.disabled,newMomentum:this.newMomentum})}"
133
+ class="help-text ${(0,u.classMap)({disabled:this.disabled,newMomentum:this.newMomentum})}"
131
134
  .message=${this.helpText}
132
135
  style=${(0,m.styleMap)({width:"100%"})}
133
136
  ></md-help-text>
@@ -142,7 +145,7 @@
142
145
  ></md-help-text>
143
146
  `)}
144
147
  </div>
145
- `:h.nothing}get newArrowButtonTemplate(){return h.html`<div class="md-combobox-right-arrow">${this.arrowButtonTemplate()}</div>`}get renderNewMomentumArrow(){return h.html` ${this.isDropdownArrow?this.arrowButtonTemplate():this.newArrowButtonTemplate} `}get renderTrailingInputControls(){const t=this.shouldChangeButton();return this.newMomentum?t&&this.isDropdownArrow?h.html`${this.clearButtonTemplate()}`:t?h.html`${this.clearButtonTemplate()} ${this.renderNewMomentumArrow}`:this.renderNewMomentumArrow:this.compact?h.html`${h.nothing}`:h.html`${t?this.clearButtonTemplate():this.arrowButtonTemplate()}`}get renderVirtualScroll(){return h.html`
148
+ `:h.nothing}get newArrowButtonTemplate(){return h.html`<div class="md-combobox-right-arrow">${this.arrowButtonTemplate()}</div>`}get renderNewMomentumArrow(){return h.html` ${this.isDropdownArrow?this.arrowButtonTemplate():this.newArrowButtonTemplate} `}get renderTrailingInputControls(){const t=!this.readOnly&&this.shouldChangeButton();return this.newMomentum?t&&this.isDropdownArrow?h.html`${this.clearButtonTemplate()}`:t?h.html`${this.clearButtonTemplate()} ${this.renderNewMomentumArrow}`:this.renderNewMomentumArrow:this.compact?h.html`${h.nothing}`:h.html`${t?this.clearButtonTemplate():this.arrowButtonTemplate()}`}get renderVirtualScroll(){return h.html`
146
149
  <div class="virtual-scroll" @rangeChanged=${this.rangeChanged}>
147
150
  <lit-virtualizer
148
151
  .items=${this.filterOptions(this.trimSpace?this.inputValue.replace(/\s+/g,""):this.inputValue)}
@@ -150,26 +153,26 @@
150
153
  ></lit-virtualizer>
151
154
  </div>
152
155
  `}render(){return h.html`
153
- <div part="combobox" class="md-combobox md-combobox-list ${(0,p.classMap)(this.comboBoxTemplateClassMap)}">
154
- <div part="group" class="group ${(0,p.classMap)(this.listItemOptionMap)}">
156
+ <div part="combobox" class="md-combobox md-combobox-list ${(0,u.classMap)(this.comboBoxTemplateClassMap)}">
157
+ <div part="group" class="group ${(0,u.classMap)(this.listItemOptionMap)}">
155
158
  ${this.searchable?this.searchIconTemplate():this.showFilterIcon?this.filterIconTemplate():h.nothing}
156
159
  <div class="md-combobox__multiwrap" part="multiwrap">
157
160
  ${this.isMulti?this.isMulti&&!this.showSelectedCount?(0,c.repeat)(this.selectedOptions,t=>this.selectedOptionTemplate(t)):this.getSelctedCount():h.nothing}
158
161
  <input
159
- id=${(0,u.ifDefined)(this.comboboxId||void 0)}
162
+ id=${(0,p.ifDefined)(this.comboboxId||void 0)}
160
163
  class="md-combobox-listbox"
161
164
  type="text"
162
165
  role="combobox"
163
166
  aria-autocomplete="both"
164
- aria-label=${this.ariaLabelForComboBox}
167
+ aria-label=${(0,p.ifDefined)(this.inputValue&&this.selectedOptions.length>0?void 0:this.ariaLabelForComboBox)}
165
168
  part="multiwrap-input"
166
169
  aria-expanded=${this.expanded}
167
- placeholder=${this.isMulti&&this.showSelectedCount&&0!==this.selectedOptions.length?"":this.placeholder}
170
+ placeholder=${this.inputValue&&this.selectedOptions.length>0||this.isMulti&&this.showSelectedCount&&0!==this.selectedOptions.length?"":this.placeholder}
168
171
  aria-controls="md-combobox-listbox"
169
172
  ?readonly=${this.allowSelectAll||this.readOnly}
170
173
  ?disabled=${this.disabled}
171
174
  ?autofocus=${this.autofocus}
172
- title=${(0,u.ifDefined)(this.inputTitle())}
175
+ title=${(0,p.ifDefined)(this.inputValue&&this.selectedOptions.length>0?void 0:this.inputTitle())}
173
176
  .value=${this.inputValue}
174
177
  @click=${this.toggleVisualListBox}
175
178
  @input=${this.handleInput}
@@ -195,7 +198,7 @@
195
198
  part="combobox-options"
196
199
  aria-label=${this.ariaLabel||this.label}
197
200
  style=${this.addStyle()}
198
- role=${(0,u.ifDefined)(this.checkForVirtualScroll()?void 0:"list")}
201
+ role=${(0,p.ifDefined)(this.checkForVirtualScroll()?void 0:"list")}
199
202
  >
200
203
  ${this.isMulti&&this.allowSelectAll&&this.expanded?this.getSelectAllOption():h.nothing}
201
204
  ${this.checkForVirtualScroll()?0!==this.options.length&&this.filterOptions(this.trimSpace?this.inputValue.replace(/\s+/g,""):this.inputValue).length>0?this.renderVirtualScroll:h.nothing:this.renderWithoutVirtualScroll()}
@@ -213,9 +216,9 @@
213
216
  `}
214
217
  </div>
215
218
  ${this.invalid?h.html`
216
- <div part="message" class="md-combobox-error ${(0,p.classMap)({"md-new-combobox-error":this.newMomentum})}">
219
+ <div part="message" class="md-combobox-error ${(0,u.classMap)({"md-new-combobox-error":this.newMomentum})}">
217
220
  <md-help-text .message=${this.invalidText} messageType="error"></md-help-text>
218
221
  </div>
219
222
  `:h.nothing}
220
223
  ${this.messagesTemplate()} ${this.helpTextTemplate()}
221
- `}};f([(0,d.property)({type:String})],i.prototype,"label",void 0),f([(0,d.property)({type:Array})],i.prototype,"options",void 0),f([(0,d.property)({type:Array,attribute:"custom-options"})],i.prototype,"customOptions",void 0),f([(0,d.property)({type:String})],i.prototype,"placeholder",void 0),f([(0,d.property)({type:Boolean,attribute:"is-multi"})],i.prototype,"isMulti",void 0),f([(0,d.property)({type:Boolean,attribute:"use-virtual-scroll"})],i.prototype,"useVirtualScroll",void 0),f([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"disabled",void 0),f([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"ordered",void 0),f([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"expanded",void 0),f([(0,d.property)({type:Array,reflect:!0})],i.prototype,"groupExpandedList",void 0),f([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"searchItem",void 0),f([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"compact",void 0),f([(0,d.property)({type:Boolean,attribute:"no-clear-icon"})],i.prototype,"noClearIcon",void 0),f([(0,d.property)({type:Boolean,attribute:"select-when-in-focus"})],i.prototype,"selectWhenInFocus",void 0),f([(0,d.property)({type:Array})],i.prototype,"selectedOptions",void 0),f([(0,d.property)({type:Number,attribute:"visible-option",reflect:!0})],i.prototype,"visibleOptions",void 0),f([(0,d.property)({type:String,attribute:"option-id",reflect:!0})],i.prototype,"optionId",void 0),f([(0,d.property)({type:String,attribute:"option-value",reflect:!0})],i.prototype,"optionValue",void 0),f([(0,d.property)({type:Boolean,attribute:"with-custom-content"})],i.prototype,"isCustomContent",void 0),f([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"searchable",void 0),f([(0,d.property)({type:String})],i.prototype,"shape",void 0),f([(0,d.property)({type:Array})],i.prototype,"value",void 0),f([(0,d.property)({type:String,attribute:"input-value",reflect:!0})],i.prototype,"inputValue",void 0),f([(0,d.property)({type:Boolean,attribute:"allow-custom-value",reflect:!0})],i.prototype,"allowCustomValue",void 0),f([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"autofocus",void 0),f([(0,d.property)({type:String,attribute:"no-results-i18n"})],i.prototype,"resultsTextLocalization",void 0),f([(0,d.property)({type:String,attribute:"no-options-i18n"})],i.prototype,"optionsTextLocalization",void 0),f([(0,d.property)({type:Boolean,reflect:!0,attribute:"search-trim-space"})],i.prototype,"trimSpace",void 0),f([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"invalid",void 0),f([(0,d.property)({type:String,reflect:!0,attribute:"invalid-text-i18n"})],i.prototype,"invalidText",void 0),f([(0,d.property)({type:String,reflect:!0})],i.prototype,"ariaLabel",void 0),f([(0,d.property)({type:String,attribute:"search-result-aria-label"})],i.prototype,"searchResultAriaLabel",void 0),f([(0,d.state)()],i.prototype,"ariaLabelForComboBox",void 0),f([(0,d.property)({type:String,attribute:"clear-aria-label"})],i.prototype,"clearAriaLabel",void 0),f([(0,d.property)({type:String,attribute:"arrow-aria-label"})],i.prototype,"arrowAriaLabel",void 0),f([(0,d.property)({type:String,attribute:"clear-icon-height"})],i.prototype,"clearIconHeight",void 0),f([(0,d.property)({type:String,attribute:"all-i18n"})],i.prototype,"allTextLocalization",void 0),f([(0,d.property)({type:String,attribute:"select-all-i18n"})],i.prototype,"selectAllTextLocalization",void 0),f([(0,d.property)({type:String,attribute:"selected-all-i18n"})],i.prototype,"selectedTextLocalization",void 0),f([(0,d.property)({type:Boolean,attribute:"allow-select-all",reflect:!0})],i.prototype,"allowSelectAll",void 0),f([(0,d.property)({type:Boolean,attribute:"show-custom-error",reflect:!0})],i.prototype,"showCustomError",void 0),f([(0,d.property)({type:Boolean,attribute:"show-loader",reflect:!0})],i.prototype,"showLoader",void 0),f([(0,d.property)({type:Boolean,attribute:"show-selected-count",reflect:!0})],i.prototype,"showSelectedCount",void 0),f([(0,d.property)({type:String,attribute:"popup-chevron-aria-hidden"})],i.prototype,"popupChevronAriaHidden",void 0),f([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"newMomentum",void 0),f([(0,d.property)({type:Boolean,attribute:"show-filter-icon"})],i.prototype,"showFilterIcon",void 0),f([(0,d.property)({type:Boolean,attribute:"prevent-filter"})],i.prototype,"preventFilter",void 0),f([(0,d.property)({type:Boolean,attribute:"is-dropdown-arrow"})],i.prototype,"isDropdownArrow",void 0),f([(0,d.property)({type:String})],i.prototype,"comboboxId",void 0),f([(0,d.property)({type:String})],i.prototype,"helpText",void 0),f([(0,d.property)({type:Array})],i.prototype,"messageArr",void 0),f([(0,d.property)({type:String})],i.prototype,"htmlId",void 0),f([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"readOnly",void 0),f([(0,d.state)()],i.prototype,"isOptGroup",void 0),f([(0,d.state)()],i.prototype,"isSelectAllChecked",void 0),f([(0,d.query)(".group")],i.prototype,"group",void 0),f([(0,d.query)(".md-combobox-listbox")],i.prototype,"input",void 0),f([(0,d.query)(".md-combobox-button")],i.prototype,"button",void 0),f([(0,d.query)("div#md-combobox-listbox")],i.prototype,"listBox",void 0),f([(0,d.query)(".virtual-scroll")],i.prototype,"virtualizer",void 0),f([(0,d.queryAll)("div.md-combobox-option")],i.prototype,"lists",void 0),f([(0,d.queryAll)(".group-label")],i.prototype,"labels",void 0),f([(0,d.queryAll)(".md-combobox-selected-item")],i.prototype,"selected",void 0),i=f([(0,n.w)("md-combobox")],i),t.ELEMENT=i}(s||(s={}))},2022(t){t.exports=l},554(t){t.exports=n},7161(e){e.exports=t},429(t){t.exports=e},5125(t){t.exports=i},291(t){t.exports=o},8175(t){t.exports=a},318(t){t.exports=s},5314(t){t.exports=r}},p={};function u(t){var e=p[t];if(void 0!==e)return e.exports;var i=p[t]={exports:{}};return d[t].call(i.exports,i,i.exports,u),i.exports}u.m=d,h=[],u.O=(t,e,i,s)=>{if(!e){var o=1/0;for(a=0;a<h.length;a++){for(var[e,i,s]=h[a],l=!0,n=0;n<e.length;n++)(!1&s||o>=s)&&Object.keys(u.O).every(t=>u.O[t](e[n]))?e.splice(n--,1):(l=!1,s<o&&(o=s));if(l){h.splice(a--,1);var r=i();void 0!==r&&(t=r)}}return t}s=s||0;for(var a=h.length;a>0&&h[a-1][2]>s;a--)h[a]=h[a-1];h[a]=[e,i,s]},u.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return u.d(e,{a:e}),e},u.d=(t,e)=>{for(var i in e)u.o(e,i)&&!u.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},u.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),u.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),u.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t={2169:0,2273:0};u.O.j=e=>0===t[e];var e=(e,i)=>{var s,o,[l,n,r]=i,a=0;if(l.some(e=>0!==t[e])){for(s in n)u.o(n,s)&&(u.m[s]=n[s]);if(r)var h=r(u)}for(e&&e(i);a<l.length;a++)o=l[a],u.o(t,o)&&t[o]&&t[o][0](),t[o]=0;return u.O(h)},i=self["momentum-web-components-[id]"]=self["momentum-web-components-[id]"]||[];i.forEach(e.bind(null,0)),i.push=e.bind(null,i.push.bind(i))})();var c=u.O(void 0,[7103,9609,4084,3305,4739,7154,9773,5983,9488,1821,2364,9938,4781,5201,5584,8227,7704,2797,7906,4047,4431,8138],()=>u(2273));return u.O(c)})());
224
+ `}};f([(0,d.property)({type:String})],i.prototype,"label",void 0),f([(0,d.property)({type:Array})],i.prototype,"options",void 0),f([(0,d.property)({type:Array,attribute:"custom-options"})],i.prototype,"customOptions",void 0),f([(0,d.property)({type:String})],i.prototype,"placeholder",void 0),f([(0,d.property)({type:Boolean,attribute:"is-multi"})],i.prototype,"isMulti",void 0),f([(0,d.property)({type:Boolean,attribute:"use-virtual-scroll"})],i.prototype,"useVirtualScroll",void 0),f([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"disabled",void 0),f([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"ordered",void 0),f([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"expanded",void 0),f([(0,d.property)({type:Array,reflect:!0})],i.prototype,"groupExpandedList",void 0),f([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"searchItem",void 0),f([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"compact",void 0),f([(0,d.property)({type:Boolean,attribute:"no-clear-icon"})],i.prototype,"noClearIcon",void 0),f([(0,d.property)({type:Boolean,attribute:"select-when-in-focus"})],i.prototype,"selectWhenInFocus",void 0),f([(0,d.property)({type:Array})],i.prototype,"selectedOptions",void 0),f([(0,d.property)({type:Number,attribute:"visible-option",reflect:!0})],i.prototype,"visibleOptions",void 0),f([(0,d.property)({type:String,attribute:"option-id",reflect:!0})],i.prototype,"optionId",void 0),f([(0,d.property)({type:String,attribute:"option-value",reflect:!0})],i.prototype,"optionValue",void 0),f([(0,d.property)({type:Boolean,attribute:"with-custom-content"})],i.prototype,"isCustomContent",void 0),f([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"searchable",void 0),f([(0,d.property)({type:String})],i.prototype,"shape",void 0),f([(0,d.property)({type:Array})],i.prototype,"value",void 0),f([(0,d.property)({type:String,attribute:"input-value",reflect:!0})],i.prototype,"inputValue",void 0),f([(0,d.property)({type:Boolean,attribute:"allow-custom-value",reflect:!0})],i.prototype,"allowCustomValue",void 0),f([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"autofocus",void 0),f([(0,d.property)({type:String,attribute:"no-results-i18n"})],i.prototype,"resultsTextLocalization",void 0),f([(0,d.property)({type:String,attribute:"no-options-i18n"})],i.prototype,"optionsTextLocalization",void 0),f([(0,d.property)({type:Boolean,reflect:!0,attribute:"search-trim-space"})],i.prototype,"trimSpace",void 0),f([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"invalid",void 0),f([(0,d.property)({type:String,reflect:!0,attribute:"invalid-text-i18n"})],i.prototype,"invalidText",void 0),f([(0,d.property)({type:String,reflect:!0})],i.prototype,"ariaLabel",void 0),f([(0,d.property)({type:String,attribute:"search-result-aria-label"})],i.prototype,"searchResultAriaLabel",void 0),f([(0,d.state)()],i.prototype,"ariaLabelForComboBox",void 0),f([(0,d.property)({type:String,attribute:"clear-aria-label"})],i.prototype,"clearAriaLabel",void 0),f([(0,d.property)({type:String,attribute:"arrow-aria-label"})],i.prototype,"arrowAriaLabel",void 0),f([(0,d.property)({type:String,attribute:"clear-icon-height"})],i.prototype,"clearIconHeight",void 0),f([(0,d.property)({type:String,attribute:"all-i18n"})],i.prototype,"allTextLocalization",void 0),f([(0,d.property)({type:String,attribute:"select-all-i18n"})],i.prototype,"selectAllTextLocalization",void 0),f([(0,d.property)({type:String,attribute:"selected-all-i18n"})],i.prototype,"selectedTextLocalization",void 0),f([(0,d.property)({type:Boolean,attribute:"allow-select-all",reflect:!0})],i.prototype,"allowSelectAll",void 0),f([(0,d.property)({type:Boolean,attribute:"show-custom-error",reflect:!0})],i.prototype,"showCustomError",void 0),f([(0,d.property)({type:Boolean,attribute:"show-loader",reflect:!0})],i.prototype,"showLoader",void 0),f([(0,d.property)({type:Boolean,attribute:"show-selected-count",reflect:!0})],i.prototype,"showSelectedCount",void 0),f([(0,d.property)({type:String,attribute:"popup-chevron-aria-hidden"})],i.prototype,"popupChevronAriaHidden",void 0),f([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"newMomentum",void 0),f([(0,d.property)({type:Boolean,attribute:"show-filter-icon"})],i.prototype,"showFilterIcon",void 0),f([(0,d.property)({type:Boolean,attribute:"prevent-filter"})],i.prototype,"preventFilter",void 0),f([(0,d.property)({type:Boolean,attribute:"is-dropdown-arrow"})],i.prototype,"isDropdownArrow",void 0),f([(0,d.property)({type:String})],i.prototype,"comboboxId",void 0),f([(0,d.property)({type:String})],i.prototype,"helpText",void 0),f([(0,d.property)({type:Array})],i.prototype,"messageArr",void 0),f([(0,d.property)({type:String})],i.prototype,"htmlId",void 0),f([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"readOnly",void 0),f([(0,d.state)()],i.prototype,"isOptGroup",void 0),f([(0,d.state)()],i.prototype,"isSelectAllChecked",void 0),f([(0,d.query)(".group")],i.prototype,"group",void 0),f([(0,d.query)(".md-combobox-listbox")],i.prototype,"input",void 0),f([(0,d.query)(".md-combobox-button")],i.prototype,"button",void 0),f([(0,d.query)("div#md-combobox-listbox")],i.prototype,"listBox",void 0),f([(0,d.query)(".virtual-scroll")],i.prototype,"virtualizer",void 0),f([(0,d.queryAll)("div.md-combobox-option")],i.prototype,"lists",void 0),f([(0,d.queryAll)(".group-label")],i.prototype,"labels",void 0),f([(0,d.queryAll)(".md-combobox-selected-item")],i.prototype,"selected",void 0),i=f([(0,n.w)("md-combobox")],i),t.ELEMENT=i}(s||(s={}))},2022(t){t.exports=l},554(t){t.exports=n},7161(e){e.exports=t},429(t){t.exports=e},5125(t){t.exports=i},291(t){t.exports=o},8175(t){t.exports=a},318(t){t.exports=s},5314(t){t.exports=r}},u={};function p(t){var e=u[t];if(void 0!==e)return e.exports;var i=u[t]={exports:{}};return d[t].call(i.exports,i,i.exports,p),i.exports}p.m=d,h=[],p.O=(t,e,i,s)=>{if(!e){var o=1/0;for(a=0;a<h.length;a++){for(var[e,i,s]=h[a],l=!0,n=0;n<e.length;n++)(!1&s||o>=s)&&Object.keys(p.O).every(t=>p.O[t](e[n]))?e.splice(n--,1):(l=!1,s<o&&(o=s));if(l){h.splice(a--,1);var r=i();void 0!==r&&(t=r)}}return t}s=s||0;for(var a=h.length;a>0&&h[a-1][2]>s;a--)h[a]=h[a-1];h[a]=[e,i,s]},p.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return p.d(e,{a:e}),e},p.d=(t,e)=>{for(var i in e)p.o(e,i)&&!p.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},p.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),p.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),p.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t={2169:0,2273:0};p.O.j=e=>0===t[e];var e=(e,i)=>{var s,o,[l,n,r]=i,a=0;if(l.some(e=>0!==t[e])){for(s in n)p.o(n,s)&&(p.m[s]=n[s]);if(r)var h=r(p)}for(e&&e(i);a<l.length;a++)o=l[a],p.o(t,o)&&t[o]&&t[o][0](),t[o]=0;return p.O(h)},i=self["momentum-web-components-[id]"]=self["momentum-web-components-[id]"]||[];i.forEach(e.bind(null,0)),i.push=e.bind(null,i.push.bind(i))})();var c=p.O(void 0,[7103,9609,4084,3305,4739,7154,9773,5983,9488,1821,2364,9938,4781,5201,5584,8227,7704,2797,7906,4047,4431,8138],()=>p(2273));return p.O(c)})());
@@ -9,7 +9,7 @@
9
9
  ?disabled=${r}
10
10
  @click=${!r&&this.decreaseMonth}
11
11
  >
12
- <md-icon name="arrow-left-bold" size="16" iconSet="momentumDesign"></md-icon>
12
+ <md-icon name="arrow-left-bold" size="16" iconSet="momentumDesign" aria-hidden="true"></md-icon>
13
13
  </md-button>
14
14
  `},this.renderNextMonthButton=()=>{var e,t;const r=(null===(e=this.filterParams)||void 0===e?void 0:e.maxDate)&&(0,n.FO)(this.viewAnchorDate,null===(t=this.filterParams)||void 0===t?void 0:t.maxDate);return s.html`
15
15
  <md-button
@@ -21,7 +21,7 @@
21
21
  title=${"next month"}
22
22
  ?disabled=${r}
23
23
  @click=${!r&&this.increaseMonth}
24
- ><md-icon name="arrow-right-bold" size="16" iconSet="momentumDesign"></md-icon>
24
+ ><md-icon name="arrow-right-bold" size="16" iconSet="momentumDesign" aria-hidden="true"></md-icon>
25
25
  </md-button>
26
26
  `},this.header=()=>{var e;const t=(0,n.mK)(this.viewAnchorDate,null===(e=this.datePickerProps)||void 0===e?void 0:e.weekStart);return[].concat([0,1,2,3,4,5,6].map(e=>{var r;const i=(0,n.fi)((0,n.WV)(t,(null===(r=this.datePickerProps)||void 0===r?void 0:r.locale)||"en"),e),o=(0,n.XN)(i),a=this.getWeekDayName(o,i);return s.html` <div class="md-datepicker__day--name">${a}</div> `}))}}connectedCallback(){var e,t,r;super.connectedCallback(),this.viewAnchorDate=(null===(e=this.datePickerProps)||void 0===e?void 0:e.focused)||(null===(t=this.datePickerProps)||void 0===t?void 0:t.selected)||(0,n.tB)(),this.localeMonth=(0,n.WV)(this.viewAnchorDate,(null===(r=this.datePickerProps)||void 0===r?void 0:r.locale)||"en").toFormat(this.monthFormat)}updated(e){var t,r,i,o,a,s;if(super.updated(e),e.has("datePickerProps")){const a=e.get("datePickerProps"),s=null===(t=this.datePickerProps)||void 0===t?void 0:t.selected,d=null===(r=this.datePickerProps)||void 0===r?void 0:r.focused;if(null===(null==s?void 0:s.invalidReason)&&(!(null==a?void 0:a.selected)||!(0,n.ro)(a.selected,s))&&(this.viewAnchorDate=s||(0,n.tB)()),null==d?void 0:d.isValid){const e=!(null==a?void 0:a.focused)||!(0,n.ro)(a.focused,d),t=d.month!==this.viewAnchorDate.month||d.year!==this.viewAnchorDate.year;e&&t&&(this.viewAnchorDate=d)}this.localeMonth=((null===(i=this.datePickerProps)||void 0===i?void 0:i.locale)?(0,n.WV)(this.viewAnchorDate,null===(o=this.datePickerProps)||void 0===o?void 0:o.locale):this.viewAnchorDate).toFormat(this.monthFormat)}e.has("viewAnchorDate")&&(this.localeMonth=((null===(a=this.datePickerProps)||void 0===a?void 0:a.locale)?(0,n.WV)(this.viewAnchorDate,null===(s=this.datePickerProps)||void 0===s?void 0:s.locale):this.viewAnchorDate).toFormat(this.monthFormat))}getWeekDayName(e,t){return this.shortDay?(0,n.XY)(e,t):(0,n.DY)(e,t)}renderLoader(){return s.html`
27
27
  <div class="md-datepicker__loading">
@@ -8,7 +8,6 @@
8
8
  @click=${e=>{this.disabled||this.handleClick(e)}}
9
9
  @keydown=${e=>this.handleKeyDown(e)}
10
10
  ariaLabel=${i}
11
- title=${t}
12
11
  aria-selected=${(0,p.ifDefined)(this.selected)}
13
12
  tab-index=${this.focused?"0":"-1"}
14
13
  >
@@ -1,4 +1,4 @@
1
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js"),require("lit/directives/if-defined.js"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("mobx"),require("lit/directives/repeat.js"));else if("function"==typeof define&&define.amd)define(["lit","lit/decorators.js","lit/directives/class-map.js","lit/directives/style-map.js","lit/directives/if-defined.js","@momentum-ui/icons/data/momentumUiIconsNames.json","@momentum-ui/utils/lib/getColorValue","mobx","lit/directives/repeat.js"],t);else{var i="object"==typeof exports?t(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js"),require("lit/directives/if-defined.js"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("mobx"),require("lit/directives/repeat.js")):t(e.lit,e["lit/decorators.js"],e["lit/directives/class-map.js"],e["lit/directives/style-map.js"],e["lit/directives/if-defined.js"],e["@momentum-ui/icons/data/momentumUiIconsNames.json"],e["@momentum-ui/utils/lib/getColorValue"],e.mobx,e["lit/directives/repeat.js"]);for(var s in i)("object"==typeof exports?exports:e)[s]=i[s]}}(self,(e,t,i,s,o,n,r,a,l)=>(()=>{"use strict";var d,p={621(e,t,i){i.r(t),i.d(t,{Dropdown:()=>s}),i(1821);var s,o=i(2900),n=i(7704),r=i(2050),a=i(4084),l=i(7161),d=i(429),p=i(5125),h=i(291),u=i(8175),c=i(318),m=i(5057),y=function(e,t,i,s){var o,n=arguments.length,r=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(n<3?o(r):n>3?o(t,i,r):o(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},f=function(e,t,i,s){return new(i||(i=Promise))(function(o,n){function r(e){try{l(s.next(e))}catch(e){n(e)}}function a(e){try{l(s.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(r,a)}l((s=s.apply(e,t||[])).next())})};!function(e){class t{determineMessageType(e){return e.reduce((e,t)=>"error"===t?e:t.type,"")}filterMessagesByType(e,t){return e.reduce((e,i)=>i.type===t?e.concat(i.message):e,[])}}e.MessageController=t;let i=class extends((0,n.yC)(l.LitElement)){constructor(){super(...arguments),this.title="Select...",this.options=[],this.optionId="",this.optionValue="",this.defaultOption="",this.disabled=!1,this.customTabIndex=0,this.allowUnselected=!1,this.visibleOptions=8,this.newMomentum=!1,this.compact=!1,this.searchable=!1,this.searchItem=!1,this.inputValue="",this.placeholder="Select...",this.readOnly=!1,this.autofocus=!1,this.leftIcon="",this.trimSpace=!1,this.resultsTextLocalization="No Results",this.pill=!1,this.helpText="",this.messageArr=[],this.htmlId="",this.clearAriaLabel="Clear",this.clearIconHeight="auto",this.arrowAriaLabel="Expand",this.popupChevronAriaHidden="true",this.ariaLabel="",this.searchResultAriaLabel="",this.ariaLabelForDropdown="",this.dropdownRenderOptions=[],this.selectedKey="",this.expanded=!1,this.focusedIndex=-1,this.messageController=new t,this.lastMaxHeight="",this.onOutsideClick=e=>{let t=!1;const i=e.composedPath();i.length&&(t=!!i.find(e=>e===this),t||this.expanded&&this.collapse())},this.onKeyDown=e=>{var t;if(!this.disabled&&!this.readOnly)switch(e.code){case o.Uz.Tab:this.expanded&&(e.stopPropagation(),this.collapse());break;case o.Uz.Space:case o.Uz.Enter:{const i=e.composedPath()[0];if(null===(t=i.closest)||void 0===t?void 0:t.call(i,".md-dropdown-button"))break;e.preventDefault(),this.expanded?(this.select(),this.collapse()):this.expand();break}case o.Uz.ArrowDown:e.preventDefault(),this.expanded?this.focusNext():this.expand();break;case o.Uz.ArrowUp:e.preventDefault(),this.expanded?this.focusPrev():this.expand();break;case o.Uz.Home:e.preventDefault(),this.expanded?this.focusFirst():this.expand();break;case o.Uz.End:e.preventDefault(),this.expanded?this.focusLast():this.expand();break;case o.Uz.Escape:case o.Uz.Backspace:this.expanded&&(e.preventDefault(),e.stopPropagation(),this.collapse())}},this.notifyInputValueChanged=(0,r.sg)(e=>{this.dispatchEvent(new CustomEvent("dropdown-input",{composed:!0,bubbles:!0,detail:{value:e}})),this.notifySearchResultCount(),requestAnimationFrame(()=>{this.input.focus()})},250)}connectedCallback(){super.connectedCallback(),this.setupEvents()}disconnectedCallback(){super.disconnectedCallback(),this.teardownEvents()}firstUpdated(e){super.firstUpdated(e),e.forEach((e,t)=>{if("defaultOption"===t&&this.defaultOption){const{key:e}=this.getOptionKeyValuePair(this.defaultOption);this.selectedKey=e}}),this.searchable&&this.setInitialValue()}updated(e){super.updated(e),e.forEach((e,t)=>{if("options"===t&&this.updateRenderOptions(),"selectedKey"===t&&this.dropdownRenderOptions.some(e=>e.key===this.selectedKey)){const e=this.filteredOptions.findIndex(e=>e.key===this.selectedKey);-1!==e&&this.focusToIndex(e),this.searchable&&this.setInitialValue()}if("expanded"===t&&(this.updateListDOM(),this.updateActiveDescendant()),"focusedIndex"===t&&(this.updateListDOM(),this.updateActiveDescendant()),"defaultOption"===t&&this.defaultOption){const{key:e}=this.getOptionKeyValuePair(this.defaultOption);this.selectedKey=e}})}notifySearchResultCount(){if(this.searchResultAriaLabel){const e=/{{.*?}}/g;this.ariaLabelForDropdown=this.searchResultAriaLabel.replace(e,this.filteredOptions.length.toString())}else this.ariaLabel?this.ariaLabelForDropdown=`${this.ariaLabel}, ${this.filteredOptions.length} results found.`:this.ariaLabelForDropdown=`Dropdown Element, ${this.filteredOptions.length} results found.`}setInitialValue(){var e;if(this.options.length){const t=this.dropdownRenderOptions.find(e=>e.key===this.selectedKey),i=null==t?void 0:t.option;if(i){const t=this.getOptionValue(i);this.inputValue=t,this.setInputValue(t),null===(e=this.input)||void 0===e||e.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(i)),this.notifyInputValueChanged(t)}}}getOptionValue(e){return this.isOptionObject(e)&&!this.optionValue?Object.values(e)[0]:this.isOptionObject(e)?e[this.optionValue]:e}getOptionId(e){return this.isOptionObject(e)?e[this.optionId]:e}isOptionObject(e){return"object"==typeof e&&null!==e}updateRenderOptions(){const e=[];this.focusReset();const t=this.options.reduce((t,i)=>{const{key:s,value:o}=this.getOptionKeyValuePair(i);return-1!==e.indexOf(s)?console.error(`Dropdown already have option key: "${s}". Ignoring `):s?(e.push(s),t.push({key:s,value:o,option:i})):console.error(`Dropdown key is not defined: "${s}". (value: "${o}"). Ignoring `),t},[]);this.allowUnselected&&t.unshift({key:"",value:this.title}),this.dropdownRenderOptions=t}updateActiveDescendant(){const e=this.searchable?this.input:this.label;if(e){const t=this.expanded&&-1!==this.focusedIndex?`combo-${this.focusedIndex}`:"";e.setAttribute("aria-activedescendant",t)}}updateListDOM(){return f(this,void 0,void 0,function*(){this.expanded&&(yield this.resizeDropdownList(),yield this.scrollToIndex(this.focusedIndex))})}resizeDropdownList(){return f(this,void 0,void 0,function*(){yield new Promise(e=>requestAnimationFrame(()=>{if(this.optionsListItems)if(this.optionsListItems.length>this.visibleOptions){const e=`${[...this.optionsListItems].slice(0,this.visibleOptions).reduce((e,t)=>e+t.offsetHeight,0)}px`;this.lastMaxHeight!==e&&(this.optionsList.style.maxHeight=e,this.lastMaxHeight=e)}else{const e="auto";this.lastMaxHeight!==e&&(this.optionsList.style.maxHeight=e,this.lastMaxHeight=e)}e()}))})}handleFocusIn(e){var t;this.disabled||null===(t=super.handleFocusIn)||void 0===t||t.call(this,e),this.dispatchEvent(new CustomEvent("dropdown-focus-in",{composed:!0,bubbles:!0}))}handleFocusOut(e){var t;null===(t=super.handleFocusOut)||void 0===t||t.call(this,e),this.dispatchEvent(new CustomEvent("dropdown-focus-out",{composed:!0,bubbles:!0}))}static get styles(){return[a.A,m.A]}get filteredOptions(){const e=this.trimSpace?this.inputValue.replace(/\s+/g,""):this.inputValue;if(!e.trim())return this.dropdownRenderOptions;const t=this.dropdownRenderOptions.filter(t=>t.value.toLowerCase().includes(e.toLowerCase()));return 0===t.length?[{key:"no-result",value:"No Result",disabled:!0}]:t}get messageType(){return this.messageArr.length>0?this.messageController.determineMessageType(this.messageArr):null}get messages(){return this.messageType?this.messageController.filterMessagesByType(this.messageArr,this.messageType):null}setVisualListbox(e){this.expanded=e}updateOnNextFrame(e){requestAnimationFrame(e)}setInputValue(e=""){this.input.value=e}shouldChangeButton(){const e=this.input&&this.input.value.length>0;return e&&document.dispatchEvent(new CustomEvent("on-widget-update")),e}toggleVisualListBox(e){var t,i;if(!this.readOnly){if(e.target.classList.contains("md-dropdown-input"))e.target.focus();else if("md-icon"===e.target.localName){const s=null===(i=null===(t=e.target.parentElement)||void 0===t?void 0:t.parentElement)||void 0===i?void 0:i.parentElement;if(s){const e=s.querySelector(".md-dropdown-input");setTimeout(()=>{e.focus()},10)}}this.expanded?this.collapse():(this.dispatchEvent(new CustomEvent("combobox-on-expand",{composed:!0,bubbles:!0})),this.notifySearchResultCount(),this.expand()),this.input.focus()}}handleRemoveAll(e){e.stopPropagation(),this.dispatchEvent(new CustomEvent("remove-all-selected"))}removeAllSelected(){var e;this.focusReset(),this.selectedKey="",this.inputValue="",this.setInputValue(),null===(e=this.input)||void 0===e||e.setAttribute(o.iw.AriaActivedescendant,""),this.setVisualListbox(!1),this.updateOnNextFrame(()=>{this.input.focus()}),this.dispatchEvent(new CustomEvent("dropdown-selection-removed",{composed:!0,bubbles:!0,detail:{}}))}setupEvents(){document.addEventListener("click",this.onOutsideClick),this.addEventListener("keydown",this.onKeyDown),this.addEventListener("remove-all-selected",this.removeAllSelected)}teardownEvents(){document.removeEventListener("click",this.onOutsideClick),this.removeEventListener("keydown",this.onKeyDown),this.removeEventListener("remove-all-selected",this.removeAllSelected)}expand(){this.expanded=!0,document.dispatchEvent(new CustomEvent("on-widget-update")),!this.searchable&&this.label&&this.label.focus(),-1===this.focusedIndex&&this.focusNext()}collapse(){if(this.expanded=!1,this.searchable&&this.selectedKey){const e=this.dropdownRenderOptions.find(e=>e.key===this.selectedKey);if(null==e?void 0:e.option){const t=this.getOptionValue(e.option);this.inputValue=t,this.setInputValue(t)}}}toggle(){this.expanded?this.collapse():this.expand()}select(){if(-1!==this.focusedIndex){const e=this.filteredOptions[this.focusedIndex];if(!e||"no-result"===e.key)return;const t=e.key;t!==this.selectedKey&&(this.selectedKey=t,this.dispatchEvent(new CustomEvent("dropdown-selected",{composed:!0,bubbles:!0,detail:{option:"option"in e&&e.option||e.key}})))}}onLabelClick(){this.label.focus(),this.readOnly||this.toggle()}focusFirst(){this.filteredOptions.length&&(this.focusedIndex=0)}focusLast(){this.filteredOptions.length&&(this.focusedIndex=this.filteredOptions.length-1)}focusNext(){this.filteredOptions.length&&(-1!==this.focusedIndex&&this.focusedIndex<this.filteredOptions.length-1?this.focusedIndex++:this.focusFirst())}focusPrev(){this.filteredOptions.length&&(this.focusedIndex>0?this.focusedIndex--:this.focusLast())}focusToIndex(e){this.filteredOptions.length&&e>=0&&e<=this.filteredOptions.length-1&&(this.focusedIndex=e)}focusToIndexWithOption(e){const t=this.filteredOptions.findIndex(t=>t.key===e.key);this.filteredOptions.length&&t>=0&&t<=this.filteredOptions.length-1&&(this.focusedIndex=t)}focusReset(){this.focusedIndex=-1}scrollToIndex(e){return f(this,void 0,void 0,function*(){yield new Promise(t=>{requestAnimationFrame(()=>{if(this.optionsListItems&&this.optionsListItems.length>this.visibleOptions&&e>=0&&this.optionsListItems.length>e){let t=0;const{top:i,bottom:s}=this.optionsList.getBoundingClientRect(),o=this.optionsListItems[e],n=this.optionsListItems[e+1]||o,r=this.optionsListItems[e-1]||o,a=n.getBoundingClientRect(),l=r.getBoundingClientRect();a.bottom>s?t=a.bottom-s+2:l.top<i&&(t=l.top-i-2),this.optionsList.scrollTop+=t}t()})})})}getOptionKeyValuePair(e){if("string"==typeof e)return{key:e.trim(),value:e};if(e&&"object"==typeof e){const t=Object.keys(e),i=Object.values(e);if(t.length){if(1===t.length||!this.optionId)return{key:t[0],value:i[0]};if(this.optionId)return{key:e[this.optionId],value:e[this.optionValue||this.optionId]}}}return{key:"undefined",value:"undefined"}}get labelTitle(){if(this.selectedKey){const e=this.dropdownRenderOptions.find(e=>e.key===this.selectedKey);if(e)return e.value}return this.title}get dropDownClassMap(){return{"md-dropdown__expanded":this.expanded,[`md-${this.messageType}`]:!!this.messageType,"md-new-dropdown":this.newMomentum,"md-dropdown--pill":!0===this.pill}}handleInput(e){const t=e.target.value;this.inputValue=t.trim(),this.notifyInputValueChanged(t.trim())}helpTextTemplate(){return this.helpText?l.html`
1
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js"),require("lit/directives/if-defined.js"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("mobx"),require("lit/directives/repeat.js"));else if("function"==typeof define&&define.amd)define(["lit","lit/decorators.js","lit/directives/class-map.js","lit/directives/style-map.js","lit/directives/if-defined.js","@momentum-ui/icons/data/momentumUiIconsNames.json","@momentum-ui/utils/lib/getColorValue","mobx","lit/directives/repeat.js"],t);else{var i="object"==typeof exports?t(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js"),require("lit/directives/if-defined.js"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("mobx"),require("lit/directives/repeat.js")):t(e.lit,e["lit/decorators.js"],e["lit/directives/class-map.js"],e["lit/directives/style-map.js"],e["lit/directives/if-defined.js"],e["@momentum-ui/icons/data/momentumUiIconsNames.json"],e["@momentum-ui/utils/lib/getColorValue"],e.mobx,e["lit/directives/repeat.js"]);for(var s in i)("object"==typeof exports?exports:e)[s]=i[s]}}(self,(e,t,i,s,o,n,r,a,l)=>(()=>{"use strict";var d,p={621(e,t,i){i.r(t),i.d(t,{Dropdown:()=>s}),i(1821);var s,o=i(2900),n=i(7704),r=i(2050),a=i(4084),l=i(7161),d=i(429),p=i(5125),h=i(291),u=i(8175),c=i(318),m=i(5057),f=function(e,t,i,s){var o,n=arguments.length,r=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(n<3?o(r):n>3?o(t,i,r):o(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},y=function(e,t,i,s){return new(i||(i=Promise))(function(o,n){function r(e){try{l(s.next(e))}catch(e){n(e)}}function a(e){try{l(s.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(r,a)}l((s=s.apply(e,t||[])).next())})};!function(e){class t{determineMessageType(e){return e.reduce((e,t)=>"error"===t?e:t.type,"")}filterMessagesByType(e,t){return e.reduce((e,i)=>i.type===t?e.concat(i.message):e,[])}}e.MessageController=t;let i=class extends((0,n.yC)(l.LitElement)){constructor(){super(...arguments),this.title="Select...",this.options=[],this.optionId="",this.optionValue="",this.defaultOption="",this.disabled=!1,this.customTabIndex=0,this.allowUnselected=!1,this.visibleOptions=8,this.newMomentum=!1,this.compact=!1,this.searchable=!1,this.searchItem=!1,this.inputValue="",this.placeholder="Select...",this.readOnly=!1,this.autofocus=!1,this.leftIcon="",this.trimSpace=!1,this.resultsTextLocalization="No Results",this.pill=!1,this.helpText="",this.messageArr=[],this.htmlId="",this.clearAriaLabel="Clear",this.clearIconHeight="auto",this.arrowAriaLabel="Expand",this.popupChevronAriaHidden="true",this.ariaLabel="",this.searchResultAriaLabel="",this.ariaLabelForDropdown="",this.dropdownRenderOptions=[],this.selectedKey="",this.expanded=!1,this.focusedIndex=-1,this.messageController=new t,this.lastMaxHeight="",this.onOutsideClick=e=>{let t=!1;const i=e.composedPath();i.length&&(t=!!i.find(e=>e===this),t||this.expanded&&this.collapse())},this.onKeyDown=e=>{var t;if(!this.disabled&&!this.readOnly)switch(e.code){case o.Uz.Tab:this.expanded&&(e.stopPropagation(),this.collapse());break;case o.Uz.Space:case o.Uz.Enter:{const i=e.composedPath()[0];if(null===(t=i.closest)||void 0===t?void 0:t.call(i,".md-dropdown-button"))break;e.preventDefault(),this.expanded?(this.select(),this.collapse()):this.expand();break}case o.Uz.ArrowDown:e.preventDefault(),this.expanded?this.focusNext():this.expand();break;case o.Uz.ArrowUp:e.preventDefault(),this.expanded?this.focusPrev():this.expand();break;case o.Uz.Home:e.preventDefault(),this.expanded?this.focusFirst():this.expand();break;case o.Uz.End:e.preventDefault(),this.expanded?this.focusLast():this.expand();break;case o.Uz.Escape:case o.Uz.Backspace:this.expanded&&(e.preventDefault(),e.stopPropagation(),this.collapse())}},this.notifyInputValueChanged=(0,r.sg)(e=>{this.dispatchEvent(new CustomEvent("dropdown-input",{composed:!0,bubbles:!0,detail:{value:e}})),this.notifySearchResultCount(),requestAnimationFrame(()=>{this.input.focus()})},250)}connectedCallback(){super.connectedCallback(),this.setupEvents()}disconnectedCallback(){super.disconnectedCallback(),this.teardownEvents()}firstUpdated(e){super.firstUpdated(e),e.forEach((e,t)=>{if("defaultOption"===t&&this.defaultOption){const{key:e}=this.getOptionKeyValuePair(this.defaultOption);this.selectedKey=e}}),this.searchable&&this.setInitialValue()}updated(e){super.updated(e),e.forEach((e,t)=>{if("options"===t&&this.updateRenderOptions(),"selectedKey"===t&&this.dropdownRenderOptions.some(e=>e.key===this.selectedKey)){const e=this.filteredOptions.findIndex(e=>e.key===this.selectedKey);-1!==e&&this.focusToIndex(e),this.searchable&&this.setInitialValue()}if("expanded"===t&&(this.updateListDOM(),this.updateActiveDescendant()),"focusedIndex"===t&&(this.updateListDOM(),this.updateActiveDescendant()),"defaultOption"===t&&this.defaultOption){const{key:e}=this.getOptionKeyValuePair(this.defaultOption);this.selectedKey=e}})}notifySearchResultCount(){if(this.searchResultAriaLabel){const e=/{{.*?}}/g;this.ariaLabelForDropdown=this.searchResultAriaLabel.replace(e,this.filteredOptions.length.toString())}else this.ariaLabel?this.ariaLabelForDropdown=`${this.ariaLabel}, ${this.filteredOptions.length} results found.`:this.ariaLabelForDropdown=`Dropdown Element, ${this.filteredOptions.length} results found.`}setInitialValue(){var e;if(this.options.length){const t=this.dropdownRenderOptions.find(e=>e.key===this.selectedKey),i=null==t?void 0:t.option;if(i){const t=this.getOptionValue(i);this.inputValue=t,this.setInputValue(t),null===(e=this.input)||void 0===e||e.setAttribute(o.iw.AriaActivedescendant,this.getOptionId(i)),this.notifyInputValueChanged(t)}}}getOptionValue(e){return this.isOptionObject(e)&&!this.optionValue?Object.values(e)[0]:this.isOptionObject(e)?e[this.optionValue]:e}getOptionId(e){return this.isOptionObject(e)?e[this.optionId]:e}isOptionObject(e){return"object"==typeof e&&null!==e}updateRenderOptions(){const e=[];this.focusReset();const t=this.options.reduce((t,i)=>{const{key:s,value:o}=this.getOptionKeyValuePair(i);return-1!==e.indexOf(s)?console.error(`Dropdown already have option key: "${s}". Ignoring `):s?(e.push(s),t.push({key:s,value:o,option:i})):console.error(`Dropdown key is not defined: "${s}". (value: "${o}"). Ignoring `),t},[]);this.allowUnselected&&t.unshift({key:"",value:this.title}),this.dropdownRenderOptions=t}updateActiveDescendant(){const e=this.searchable?this.input:this.label;if(e){const t=this.expanded&&-1!==this.focusedIndex?`combo-${this.focusedIndex}`:"";e.setAttribute("aria-activedescendant",t)}}updateListDOM(){return y(this,void 0,void 0,function*(){this.expanded&&(yield this.resizeDropdownList(),yield this.scrollToIndex(this.focusedIndex))})}resizeDropdownList(){return y(this,void 0,void 0,function*(){yield new Promise(e=>requestAnimationFrame(()=>{if(this.optionsListItems)if(this.optionsListItems.length>this.visibleOptions){const e=`${[...this.optionsListItems].slice(0,this.visibleOptions).reduce((e,t)=>e+t.offsetHeight,0)}px`;this.lastMaxHeight!==e&&(this.optionsList.style.maxHeight=e,this.lastMaxHeight=e)}else{const e="auto";this.lastMaxHeight!==e&&(this.optionsList.style.maxHeight=e,this.lastMaxHeight=e)}e()}))})}handleFocusIn(e){var t;this.disabled||null===(t=super.handleFocusIn)||void 0===t||t.call(this,e),this.dispatchEvent(new CustomEvent("dropdown-focus-in",{composed:!0,bubbles:!0}))}handleFocusOut(e){var t;null===(t=super.handleFocusOut)||void 0===t||t.call(this,e),this.dispatchEvent(new CustomEvent("dropdown-focus-out",{composed:!0,bubbles:!0}))}static get styles(){return[a.A,m.A]}get filteredOptions(){const e=this.trimSpace?this.inputValue.replace(/\s+/g,""):this.inputValue;if(!e.trim())return this.dropdownRenderOptions;const t=this.dropdownRenderOptions.filter(t=>t.value.toLowerCase().includes(e.toLowerCase()));return 0===t.length?[{key:"no-result",value:"No Result",disabled:!0}]:t}get messageType(){return this.messageArr.length>0?this.messageController.determineMessageType(this.messageArr):null}get messages(){return this.messageType?this.messageController.filterMessagesByType(this.messageArr,this.messageType):null}setVisualListbox(e){this.expanded=e}updateOnNextFrame(e){requestAnimationFrame(e)}setInputValue(e=""){this.input.value=e}shouldChangeButton(){const e=this.input&&this.input.value.length>0;return e&&document.dispatchEvent(new CustomEvent("on-widget-update")),e}toggleVisualListBox(e){var t,i;if(!this.readOnly){if(e.target.classList.contains("md-dropdown-input"))e.target.focus();else if("md-icon"===e.target.localName){const s=null===(i=null===(t=e.target.parentElement)||void 0===t?void 0:t.parentElement)||void 0===i?void 0:i.parentElement;if(s){const e=s.querySelector(".md-dropdown-input");setTimeout(()=>{e.focus()},10)}}this.expanded?this.collapse():(this.dispatchEvent(new CustomEvent("combobox-on-expand",{composed:!0,bubbles:!0})),this.notifySearchResultCount(),this.expand()),this.input.focus()}}handleRemoveAll(e){e.stopPropagation(),this.dispatchEvent(new CustomEvent("remove-all-selected"))}removeAllSelected(){var e;this.focusReset(),this.selectedKey="",this.inputValue="",this.setInputValue(),null===(e=this.input)||void 0===e||e.setAttribute(o.iw.AriaActivedescendant,""),this.setVisualListbox(!1),this.updateOnNextFrame(()=>{this.input.focus()}),this.dispatchEvent(new CustomEvent("dropdown-selection-removed",{composed:!0,bubbles:!0,detail:{}}))}setupEvents(){document.addEventListener("click",this.onOutsideClick),this.addEventListener("keydown",this.onKeyDown),this.addEventListener("remove-all-selected",this.removeAllSelected)}teardownEvents(){document.removeEventListener("click",this.onOutsideClick),this.removeEventListener("keydown",this.onKeyDown),this.removeEventListener("remove-all-selected",this.removeAllSelected)}expand(){if(this.expanded=!0,document.dispatchEvent(new CustomEvent("on-widget-update")),!this.searchable&&this.label&&this.label.focus(),-1===this.focusedIndex)if(this.selectedKey){const e=this.filteredOptions.findIndex(e=>e.key===this.selectedKey);-1!==e?this.focusedIndex=e:this.focusNext()}else this.focusNext()}collapse(){if(this.expanded=!1,this.searchable&&this.selectedKey){const e=this.dropdownRenderOptions.find(e=>e.key===this.selectedKey);if(null==e?void 0:e.option){const t=this.getOptionValue(e.option);this.inputValue=t,this.setInputValue(t)}}}toggle(){this.expanded?this.collapse():this.expand()}select(){if(-1!==this.focusedIndex){const e=this.filteredOptions[this.focusedIndex];if(!e||"no-result"===e.key)return;const t=e.key;t!==this.selectedKey&&(this.selectedKey=t,this.dispatchEvent(new CustomEvent("dropdown-selected",{composed:!0,bubbles:!0,detail:{option:"option"in e&&e.option||e.key}})))}}onLabelClick(){this.label.focus(),this.readOnly||this.toggle()}focusFirst(){this.filteredOptions.length&&(this.focusedIndex=0)}focusLast(){this.filteredOptions.length&&(this.focusedIndex=this.filteredOptions.length-1)}focusNext(){this.filteredOptions.length&&(-1!==this.focusedIndex&&this.focusedIndex<this.filteredOptions.length-1?this.focusedIndex++:this.focusFirst())}focusPrev(){this.filteredOptions.length&&(this.focusedIndex>0?this.focusedIndex--:this.focusLast())}focusToIndex(e){this.filteredOptions.length&&e>=0&&e<=this.filteredOptions.length-1&&(this.focusedIndex=e)}focusToIndexWithOption(e){const t=this.filteredOptions.findIndex(t=>t.key===e.key);this.filteredOptions.length&&t>=0&&t<=this.filteredOptions.length-1&&(this.focusedIndex=t)}focusReset(){this.focusedIndex=-1}scrollToIndex(e){return y(this,void 0,void 0,function*(){yield new Promise(t=>{requestAnimationFrame(()=>{if(this.optionsListItems&&this.optionsListItems.length>this.visibleOptions&&e>=0&&this.optionsListItems.length>e){let t=0;const{top:i,bottom:s}=this.optionsList.getBoundingClientRect(),o=this.optionsListItems[e],n=this.optionsListItems[e+1]||o,r=this.optionsListItems[e-1]||o,a=n.getBoundingClientRect(),l=r.getBoundingClientRect();a.bottom>s?t=a.bottom-s+2:l.top<i&&(t=l.top-i-2),this.optionsList.scrollTop+=t}t()})})})}getOptionKeyValuePair(e){if("string"==typeof e)return{key:e.trim(),value:e};if(e&&"object"==typeof e){const t=Object.keys(e),i=Object.values(e);if(t.length){if(1===t.length||!this.optionId)return{key:t[0],value:i[0]};if(this.optionId)return{key:e[this.optionId],value:e[this.optionValue||this.optionId]}}}return{key:"undefined",value:"undefined"}}get labelTitle(){if(this.selectedKey){const e=this.dropdownRenderOptions.find(e=>e.key===this.selectedKey);if(e)return e.value}return this.title}get dropDownClassMap(){return{"md-dropdown__expanded":this.expanded,[`md-${this.messageType}`]:!!this.messageType,"md-new-dropdown":this.newMomentum,"md-dropdown--pill":!0===this.pill}}handleInput(e){const t=e.target.value;this.inputValue=t.trim(),this.notifyInputValueChanged(t.trim())}helpTextTemplate(){return this.helpText?l.html`
2
2
  <md-help-text
3
3
  class="help-text ${(0,p.classMap)({disabled:this.disabled,newMomentum:this.newMomentum})}"
4
4
  .message=${this.helpText}
@@ -147,4 +147,4 @@
147
147
  </ul>
148
148
  </div>
149
149
  ${this.messagesTemplate()} ${this.helpTextTemplate()}
150
- `}};y([(0,d.property)({type:String,attribute:"title"})],i.prototype,"title",void 0),y([(0,d.property)({type:Array})],i.prototype,"options",void 0),y([(0,d.property)({type:String,attribute:"option-id"})],i.prototype,"optionId",void 0),y([(0,d.property)({type:String,attribute:"option-value"})],i.prototype,"optionValue",void 0),y([(0,d.property)({type:Object})],i.prototype,"defaultOption",void 0),y([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"disabled",void 0),y([(0,d.property)({type:Number,attribute:"custom-tab-index",reflect:!0})],i.prototype,"customTabIndex",void 0),y([(0,d.property)({type:Boolean,attribute:"allow-unselected",reflect:!0})],i.prototype,"allowUnselected",void 0),y([(0,d.property)({type:Number,attribute:"visible-option",reflect:!0})],i.prototype,"visibleOptions",void 0),y([(0,d.property)({type:Boolean})],i.prototype,"newMomentum",void 0),y([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"compact",void 0),y([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"searchable",void 0),y([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"searchItem",void 0),y([(0,d.property)({type:String,attribute:"input-value",reflect:!0})],i.prototype,"inputValue",void 0),y([(0,d.property)({type:String})],i.prototype,"placeholder",void 0),y([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"readOnly",void 0),y([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"autofocus",void 0),y([(0,d.property)({type:String,attribute:"left-icon",reflect:!0})],i.prototype,"leftIcon",void 0),y([(0,d.property)({type:Boolean,reflect:!0,attribute:"search-trim-space"})],i.prototype,"trimSpace",void 0),y([(0,d.property)({type:String,attribute:"no-results-i18n"})],i.prototype,"resultsTextLocalization",void 0),y([(0,d.property)({type:Boolean})],i.prototype,"pill",void 0),y([(0,d.property)({type:String})],i.prototype,"helpText",void 0),y([(0,d.property)({type:Array})],i.prototype,"messageArr",void 0),y([(0,d.property)({type:String})],i.prototype,"htmlId",void 0),y([(0,d.property)({type:String,attribute:"clear-aria-label"})],i.prototype,"clearAriaLabel",void 0),y([(0,d.property)({type:String,attribute:"clear-icon-height"})],i.prototype,"clearIconHeight",void 0),y([(0,d.property)({type:String,attribute:"arrow-aria-label"})],i.prototype,"arrowAriaLabel",void 0),y([(0,d.property)({type:String,attribute:"popup-chevron-aria-hidden"})],i.prototype,"popupChevronAriaHidden",void 0),y([(0,d.property)({type:String,reflect:!0})],i.prototype,"ariaLabel",void 0),y([(0,d.property)({type:String,attribute:"search-result-aria-label"})],i.prototype,"searchResultAriaLabel",void 0),y([(0,d.state)()],i.prototype,"ariaLabelForDropdown",void 0),y([(0,d.state)()],i.prototype,"dropdownRenderOptions",void 0),y([(0,d.state)()],i.prototype,"selectedKey",void 0),y([(0,d.state)()],i.prototype,"expanded",void 0),y([(0,d.state)()],i.prototype,"focusedIndex",void 0),y([(0,d.query)("label")],i.prototype,"label",void 0),y([(0,d.query)(".md-dropdown-input")],i.prototype,"input",void 0),y([(0,d.query)("ul.md-dropdown-list")],i.prototype,"optionsList",void 0),y([(0,d.queryAll)("li.md-dropdown-option")],i.prototype,"optionsListItems",void 0),i=y([(0,n.wW)("md-dropdown")],i),e.ELEMENT=i}(s||(s={}))},7704(e,t,i){i.d(t,{wW:()=>o.w,yC:()=>s.y}),i(2364);var s=i(3203),o=(i(9938),i(5201),i(4781),i(608),i(9609))},2022(e){e.exports=n},554(e){e.exports=r},7161(t){t.exports=e},429(e){e.exports=t},5125(e){e.exports=i},291(e){e.exports=o},8175(e){e.exports=l},318(e){e.exports=s},5314(e){e.exports=a}},h={};function u(e){var t=h[e];if(void 0!==t)return t.exports;var i=h[e]={exports:{}};return p[e](i,i.exports,u),i.exports}u.m=p,d=[],u.O=(e,t,i,s)=>{if(!t){var o=1/0;for(l=0;l<d.length;l++){for(var[t,i,s]=d[l],n=!0,r=0;r<t.length;r++)(!1&s||o>=s)&&Object.keys(u.O).every(e=>u.O[e](t[r]))?t.splice(r--,1):(n=!1,s<o&&(o=s));if(n){d.splice(l--,1);var a=i();void 0!==a&&(e=a)}}return e}s=s||0;for(var l=d.length;l>0&&d[l-1][2]>s;l--)d[l]=d[l-1];d[l]=[t,i,s]},u.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return u.d(t,{a:t}),t},u.d=(e,t)=>{for(var i in t)u.o(t,i)&&!u.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},u.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),u.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={561:0,2942:0,5323:0,7704:0,7711:0,8180:0};u.O.j=t=>0===e[t];var t=(t,i)=>{var s,o,[n,r,a]=i,l=0;if(n.some(t=>0!==e[t])){for(s in r)u.o(r,s)&&(u.m[s]=r[s]);if(a)var d=a(u)}for(t&&t(i);l<n.length;l++)o=n[l],u.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return u.O(d)},i=self["momentum-web-components-[id]"]=self["momentum-web-components-[id]"]||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();var c=u.O(void 0,[9609,4084,3305,4739,7154,9773,5983,9488,1821,2364,9938,4781,5201,5584,8227,2050,8138,5057],()=>u(621));return u.O(c)})());
150
+ `}};f([(0,d.property)({type:String,attribute:"title"})],i.prototype,"title",void 0),f([(0,d.property)({type:Array})],i.prototype,"options",void 0),f([(0,d.property)({type:String,attribute:"option-id"})],i.prototype,"optionId",void 0),f([(0,d.property)({type:String,attribute:"option-value"})],i.prototype,"optionValue",void 0),f([(0,d.property)({type:Object})],i.prototype,"defaultOption",void 0),f([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"disabled",void 0),f([(0,d.property)({type:Number,attribute:"custom-tab-index",reflect:!0})],i.prototype,"customTabIndex",void 0),f([(0,d.property)({type:Boolean,attribute:"allow-unselected",reflect:!0})],i.prototype,"allowUnselected",void 0),f([(0,d.property)({type:Number,attribute:"visible-option",reflect:!0})],i.prototype,"visibleOptions",void 0),f([(0,d.property)({type:Boolean})],i.prototype,"newMomentum",void 0),f([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"compact",void 0),f([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"searchable",void 0),f([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"searchItem",void 0),f([(0,d.property)({type:String,attribute:"input-value",reflect:!0})],i.prototype,"inputValue",void 0),f([(0,d.property)({type:String})],i.prototype,"placeholder",void 0),f([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"readOnly",void 0),f([(0,d.property)({type:Boolean,reflect:!0})],i.prototype,"autofocus",void 0),f([(0,d.property)({type:String,attribute:"left-icon",reflect:!0})],i.prototype,"leftIcon",void 0),f([(0,d.property)({type:Boolean,reflect:!0,attribute:"search-trim-space"})],i.prototype,"trimSpace",void 0),f([(0,d.property)({type:String,attribute:"no-results-i18n"})],i.prototype,"resultsTextLocalization",void 0),f([(0,d.property)({type:Boolean})],i.prototype,"pill",void 0),f([(0,d.property)({type:String})],i.prototype,"helpText",void 0),f([(0,d.property)({type:Array})],i.prototype,"messageArr",void 0),f([(0,d.property)({type:String})],i.prototype,"htmlId",void 0),f([(0,d.property)({type:String,attribute:"clear-aria-label"})],i.prototype,"clearAriaLabel",void 0),f([(0,d.property)({type:String,attribute:"clear-icon-height"})],i.prototype,"clearIconHeight",void 0),f([(0,d.property)({type:String,attribute:"arrow-aria-label"})],i.prototype,"arrowAriaLabel",void 0),f([(0,d.property)({type:String,attribute:"popup-chevron-aria-hidden"})],i.prototype,"popupChevronAriaHidden",void 0),f([(0,d.property)({type:String,reflect:!0})],i.prototype,"ariaLabel",void 0),f([(0,d.property)({type:String,attribute:"search-result-aria-label"})],i.prototype,"searchResultAriaLabel",void 0),f([(0,d.state)()],i.prototype,"ariaLabelForDropdown",void 0),f([(0,d.state)()],i.prototype,"dropdownRenderOptions",void 0),f([(0,d.state)()],i.prototype,"selectedKey",void 0),f([(0,d.state)()],i.prototype,"expanded",void 0),f([(0,d.state)()],i.prototype,"focusedIndex",void 0),f([(0,d.query)("label")],i.prototype,"label",void 0),f([(0,d.query)(".md-dropdown-input")],i.prototype,"input",void 0),f([(0,d.query)("ul.md-dropdown-list")],i.prototype,"optionsList",void 0),f([(0,d.queryAll)("li.md-dropdown-option")],i.prototype,"optionsListItems",void 0),i=f([(0,n.wW)("md-dropdown")],i),e.ELEMENT=i}(s||(s={}))},7704(e,t,i){i.d(t,{wW:()=>o.w,yC:()=>s.y}),i(2364);var s=i(3203),o=(i(9938),i(5201),i(4781),i(608),i(9609))},2022(e){e.exports=n},554(e){e.exports=r},7161(t){t.exports=e},429(e){e.exports=t},5125(e){e.exports=i},291(e){e.exports=o},8175(e){e.exports=l},318(e){e.exports=s},5314(e){e.exports=a}},h={};function u(e){var t=h[e];if(void 0!==t)return t.exports;var i=h[e]={exports:{}};return p[e](i,i.exports,u),i.exports}u.m=p,d=[],u.O=(e,t,i,s)=>{if(!t){var o=1/0;for(l=0;l<d.length;l++){for(var[t,i,s]=d[l],n=!0,r=0;r<t.length;r++)(!1&s||o>=s)&&Object.keys(u.O).every(e=>u.O[e](t[r]))?t.splice(r--,1):(n=!1,s<o&&(o=s));if(n){d.splice(l--,1);var a=i();void 0!==a&&(e=a)}}return e}s=s||0;for(var l=d.length;l>0&&d[l-1][2]>s;l--)d[l]=d[l-1];d[l]=[t,i,s]},u.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return u.d(t,{a:t}),t},u.d=(e,t)=>{for(var i in t)u.o(t,i)&&!u.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},u.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),u.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={561:0,2942:0,5323:0,7704:0,7711:0,8180:0};u.O.j=t=>0===e[t];var t=(t,i)=>{var s,o,[n,r,a]=i,l=0;if(n.some(t=>0!==e[t])){for(s in r)u.o(r,s)&&(u.m[s]=r[s]);if(a)var d=a(u)}for(t&&t(i);l<n.length;l++)o=n[l],u.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return u.O(d)},i=self["momentum-web-components-[id]"]=self["momentum-web-components-[id]"]||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();var c=u.O(void 0,[9609,4084,3305,4739,7154,9773,5983,9488,1821,2364,9938,4781,5201,5584,8227,2050,8138,5057],()=>u(621));return u.O(c)})());