@material/select
Version:
The Material Components web select (text field drop-down) component
1 lines • 126 kB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("@material/select",[],e):"object"==typeof exports?exports.select=e():(t.mdc=t.mdc||{},t.mdc.select=e())}(this,function(){return i={},r.m=n={0:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MDCFoundation=void 0;var i=(Object.defineProperty(r,"cssClasses",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(r,"strings",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(r,"numbers",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultAdapter",{get:function(){return{}},enumerable:!1,configurable:!0}),r.prototype.init=function(){},r.prototype.destroy=function(){},r);function r(t){void 0===t&&(t={}),this.adapter=t}e.MDCFoundation=i,e.default=i},1:function(t,e,n){"use strict";var r=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,o=n.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(i=o.next()).done;)s.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s},o=this&&this.__spreadArray||function(t,e){for(var n=0,i=e.length,r=t.length;n<i;n++,r++)t[r]=e[n];return t};Object.defineProperty(e,"__esModule",{value:!0}),e.MDCComponent=void 0;var i=n(0),s=(a.attachTo=function(t){return new a(t,new i.MDCFoundation({}))},a.prototype.initialize=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},a.prototype.getDefaultFoundation=function(){throw new Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class")},a.prototype.initialSyncWithDOM=function(){},a.prototype.destroy=function(){this.foundation.destroy()},a.prototype.listen=function(t,e,n){this.root.addEventListener(t,e,n)},a.prototype.unlisten=function(t,e,n){this.root.removeEventListener(t,e,n)},a.prototype.emit=function(t,e,n){var i;void 0===n&&(n=!1),"function"==typeof CustomEvent?i=new CustomEvent(t,{bubbles:n,detail:e}):(i=document.createEvent("CustomEvent")).initCustomEvent(t,n,!1,e),this.root.dispatchEvent(i)},a);function a(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];this.root=t,this.initialize.apply(this,o([],r(n))),this.foundation=void 0===e?this.getDefaultFoundation():e,this.foundation.init(),this.initialSyncWithDOM()}e.MDCComponent=s,e.default=s},10:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getCorrectEventName=e.getCorrectPropertyName=void 0;var s={animation:{prefixed:"-webkit-animation",standard:"animation"},transform:{prefixed:"-webkit-transform",standard:"transform"},transition:{prefixed:"-webkit-transition",standard:"transition"}},a={animationend:{cssProperty:"animation",prefixed:"webkitAnimationEnd",standard:"animationend"},animationiteration:{cssProperty:"animation",prefixed:"webkitAnimationIteration",standard:"animationiteration"},animationstart:{cssProperty:"animation",prefixed:"webkitAnimationStart",standard:"animationstart"},transitionend:{cssProperty:"transition",prefixed:"webkitTransitionEnd",standard:"transitionend"}};function u(t){return Boolean(t.document)&&"function"==typeof t.document.createElement}e.getCorrectPropertyName=function(t,e){if(u(t)&&e in s){var n=t.document.createElement("div"),i=s[e],r=i.standard,o=i.prefixed;return r in n.style?r:o}return e},e.getCorrectEventName=function(t,e){if(u(t)&&e in a){var n=t.document.createElement("div"),i=a[e],r=i.standard,o=i.prefixed;return i.cssProperty in n.style?r:o}return e}},109:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.MDCSelectFoundation=void 0;var s,a=n(0),u=n(8),c=n(11),d=n(61),l=(s=a.MDCFoundation,r(h,s),Object.defineProperty(h,"cssClasses",{get:function(){return d.cssClasses},enumerable:!1,configurable:!0}),Object.defineProperty(h,"numbers",{get:function(){return d.numbers},enumerable:!1,configurable:!0}),Object.defineProperty(h,"strings",{get:function(){return d.strings},enumerable:!1,configurable:!0}),Object.defineProperty(h,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},activateBottomLine:function(){},deactivateBottomLine:function(){},getSelectedIndex:function(){return-1},setSelectedIndex:function(){},hasLabel:function(){return!1},floatLabel:function(){},getLabelWidth:function(){return 0},setLabelRequired:function(){},hasOutline:function(){return!1},notchOutline:function(){},closeOutline:function(){},setRippleCenter:function(){},notifyChange:function(){},setSelectedText:function(){},isSelectAnchorFocused:function(){return!1},getSelectAnchorAttr:function(){return""},setSelectAnchorAttr:function(){},removeSelectAnchorAttr:function(){},addMenuClass:function(){},removeMenuClass:function(){},openMenu:function(){},closeMenu:function(){},getAnchorElement:function(){return null},setMenuAnchorElement:function(){},setMenuAnchorCorner:function(){},setMenuWrapFocus:function(){},focusMenuItemAtIndex:function(){},getMenuItemCount:function(){return 0},getMenuItemValues:function(){return[]},getMenuItemTextAtIndex:function(){return""},isTypeaheadInProgress:function(){return!1},typeaheadMatchItem:function(){return-1}}},enumerable:!1,configurable:!0}),h.prototype.getSelectedIndex=function(){return this.adapter.getSelectedIndex()},h.prototype.setSelectedIndex=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!1),t>=this.adapter.getMenuItemCount()||(t===d.numbers.UNSET_INDEX?this.adapter.setSelectedText(""):this.adapter.setSelectedText(this.adapter.getMenuItemTextAtIndex(t).trim()),this.adapter.setSelectedIndex(t),e&&this.adapter.closeMenu(),n||this.lastSelectedIndex===t||this.handleChange(),this.lastSelectedIndex=t)},h.prototype.setValue=function(t,e){void 0===e&&(e=!1);var n=this.adapter.getMenuItemValues().indexOf(t);this.setSelectedIndex(n,!1,e)},h.prototype.getValue=function(){var t=this.adapter.getSelectedIndex(),e=this.adapter.getMenuItemValues();return t!==d.numbers.UNSET_INDEX?e[t]:""},h.prototype.getDisabled=function(){return this.disabled},h.prototype.setDisabled=function(t){this.disabled=t,this.disabled?(this.adapter.addClass(d.cssClasses.DISABLED),this.adapter.closeMenu()):this.adapter.removeClass(d.cssClasses.DISABLED),this.leadingIcon&&this.leadingIcon.setDisabled(this.disabled),this.disabled?this.adapter.removeSelectAnchorAttr("tabindex"):this.adapter.setSelectAnchorAttr("tabindex","0"),this.adapter.setSelectAnchorAttr("aria-disabled",this.disabled.toString())},h.prototype.openMenu=function(){this.adapter.addClass(d.cssClasses.ACTIVATED),this.adapter.openMenu(),this.isMenuOpen=!0,this.adapter.setSelectAnchorAttr("aria-expanded","true")},h.prototype.setHelperTextContent=function(t){this.helperText&&this.helperText.setContent(t)},h.prototype.layout=function(){if(this.adapter.hasLabel()){var t=0<this.getValue().length,e=this.adapter.hasClass(d.cssClasses.FOCUSED),n=t||e,i=this.adapter.hasClass(d.cssClasses.REQUIRED);this.notchOutline(n),this.adapter.floatLabel(n),this.adapter.setLabelRequired(i)}},h.prototype.layoutOptions=function(){var t=this.adapter.getMenuItemValues().indexOf(this.getValue());this.setSelectedIndex(t,!1,!0)},h.prototype.handleMenuOpened=function(){if(0!==this.adapter.getMenuItemValues().length){var t=this.getSelectedIndex(),e=0<=t?t:0;this.adapter.focusMenuItemAtIndex(e)}},h.prototype.handleMenuClosing=function(){this.adapter.setSelectAnchorAttr("aria-expanded","false")},h.prototype.handleMenuClosed=function(){this.adapter.removeClass(d.cssClasses.ACTIVATED),this.isMenuOpen=!1,this.adapter.isSelectAnchorFocused()||this.blur()},h.prototype.handleChange=function(){this.layout(),this.adapter.notifyChange(this.getValue()),this.adapter.hasClass(d.cssClasses.REQUIRED)&&this.useDefaultValidation&&this.setValid(this.isValid())},h.prototype.handleMenuItemAction=function(t){this.setSelectedIndex(t,!0)},h.prototype.handleFocus=function(){this.adapter.addClass(d.cssClasses.FOCUSED),this.layout(),this.adapter.activateBottomLine()},h.prototype.handleBlur=function(){this.isMenuOpen||this.blur()},h.prototype.handleClick=function(t){this.disabled||this.recentlyClicked||(this.setClickDebounceTimeout(),this.isMenuOpen?this.adapter.closeMenu():(this.adapter.setRippleCenter(t),this.openMenu()))},h.prototype.handleKeydown=function(t){if(!this.isMenuOpen&&this.adapter.hasClass(d.cssClasses.FOCUSED)){var e=u.normalizeKey(t)===u.KEY.ENTER,n=u.normalizeKey(t)===u.KEY.SPACEBAR,i=u.normalizeKey(t)===u.KEY.ARROW_UP,r=u.normalizeKey(t)===u.KEY.ARROW_DOWN;if(!t.ctrlKey&&!t.metaKey&&(!n&&t.key&&1===t.key.length||n&&this.adapter.isTypeaheadInProgress())){var o=n?" ":t.key,s=this.adapter.typeaheadMatchItem(o,this.getSelectedIndex());return 0<=s&&this.setSelectedIndex(s),void t.preventDefault()}(e||n||i||r)&&(this.openMenu(),t.preventDefault())}},h.prototype.notchOutline=function(t){if(this.adapter.hasOutline()){var e=this.adapter.hasClass(d.cssClasses.FOCUSED);if(t){var n=d.numbers.LABEL_SCALE,i=this.adapter.getLabelWidth()*n;this.adapter.notchOutline(i)}else e||this.adapter.closeOutline()}},h.prototype.setLeadingIconAriaLabel=function(t){this.leadingIcon&&this.leadingIcon.setAriaLabel(t)},h.prototype.setLeadingIconContent=function(t){this.leadingIcon&&this.leadingIcon.setContent(t)},h.prototype.getUseDefaultValidation=function(){return this.useDefaultValidation},h.prototype.setUseDefaultValidation=function(t){this.useDefaultValidation=t},h.prototype.setValid=function(t){this.useDefaultValidation||(this.customValidity=t),this.adapter.setSelectAnchorAttr("aria-invalid",(!t).toString()),t?(this.adapter.removeClass(d.cssClasses.INVALID),this.adapter.removeMenuClass(d.cssClasses.MENU_INVALID)):(this.adapter.addClass(d.cssClasses.INVALID),this.adapter.addMenuClass(d.cssClasses.MENU_INVALID)),this.syncHelperTextValidity(t)},h.prototype.isValid=function(){return this.useDefaultValidation&&this.adapter.hasClass(d.cssClasses.REQUIRED)&&!this.adapter.hasClass(d.cssClasses.DISABLED)?this.getSelectedIndex()!==d.numbers.UNSET_INDEX&&(0!==this.getSelectedIndex()||Boolean(this.getValue())):this.customValidity},h.prototype.setRequired=function(t){t?this.adapter.addClass(d.cssClasses.REQUIRED):this.adapter.removeClass(d.cssClasses.REQUIRED),this.adapter.setSelectAnchorAttr("aria-required",t.toString()),this.adapter.setLabelRequired(t)},h.prototype.getRequired=function(){return"true"===this.adapter.getSelectAnchorAttr("aria-required")},h.prototype.init=function(){var t=this.adapter.getAnchorElement();t&&(this.adapter.setMenuAnchorElement(t),this.adapter.setMenuAnchorCorner(c.Corner.BOTTOM_START)),this.adapter.setMenuWrapFocus(!1),this.setDisabled(this.adapter.hasClass(d.cssClasses.DISABLED)),this.syncHelperTextValidity(!this.adapter.hasClass(d.cssClasses.INVALID)),this.layout(),this.layoutOptions()},h.prototype.blur=function(){this.adapter.removeClass(d.cssClasses.FOCUSED),this.layout(),this.adapter.deactivateBottomLine(),this.adapter.hasClass(d.cssClasses.REQUIRED)&&this.useDefaultValidation&&this.setValid(this.isValid())},h.prototype.syncHelperTextValidity=function(t){if(this.helperText){this.helperText.setValidity(t);var e=this.helperText.isVisible(),n=this.helperText.getId();e&&n?this.adapter.setSelectAnchorAttr(d.strings.ARIA_DESCRIBEDBY,n):this.adapter.removeSelectAnchorAttr(d.strings.ARIA_DESCRIBEDBY)}},h.prototype.setClickDebounceTimeout=function(){var t=this;clearTimeout(this.clickDebounceTimeout),this.clickDebounceTimeout=setTimeout(function(){t.recentlyClicked=!1},d.numbers.CLICK_DEBOUNCE_TIMEOUT_MS),this.recentlyClicked=!0},h);function h(t,e){void 0===e&&(e={});var n=s.call(this,o(o({},h.defaultAdapter),t))||this;return n.disabled=!1,n.isMenuOpen=!1,n.useDefaultValidation=!0,n.customValidity=!0,n.lastSelectedIndex=d.numbers.UNSET_INDEX,n.clickDebounceTimeout=0,n.recentlyClicked=!1,n.leadingIcon=e.leadingIcon,n.helperText=e.helperText,n}e.MDCSelectFoundation=l,e.default=l},11:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Corner=e.CornerBit=e.numbers=e.strings=e.cssClasses=void 0;e.cssClasses={ANCHOR:"mdc-menu-surface--anchor",ANIMATING_CLOSED:"mdc-menu-surface--animating-closed",ANIMATING_OPEN:"mdc-menu-surface--animating-open",FIXED:"mdc-menu-surface--fixed",IS_OPEN_BELOW:"mdc-menu-surface--is-open-below",OPEN:"mdc-menu-surface--open",ROOT:"mdc-menu-surface"};var i={CLOSED_EVENT:"MDCMenuSurface:closed",CLOSING_EVENT:"MDCMenuSurface:closing",OPENED_EVENT:"MDCMenuSurface:opened",OPENING_EVENT:"MDCMenuSurface:opening",FOCUSABLE_ELEMENTS:["button:not(:disabled)",'[href]:not([aria-disabled="true"])',"input:not(:disabled)","select:not(:disabled)","textarea:not(:disabled)",'[tabindex]:not([tabindex="-1"]):not([aria-disabled="true"])'].join(", ")};e.strings=i;var r,o,s,a;e.numbers={TRANSITION_OPEN_DURATION:120,TRANSITION_CLOSE_DURATION:75,MARGIN_TO_EDGE:32,ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO:.67,TOUCH_EVENT_WAIT_MS:30},(o=r=r||{})[o.BOTTOM=1]="BOTTOM",o[o.CENTER=2]="CENTER",o[o.RIGHT=4]="RIGHT",o[o.FLIP_RTL=8]="FLIP_RTL",e.CornerBit=r,(a=s=s||{})[a.TOP_LEFT=0]="TOP_LEFT",a[a.TOP_RIGHT=4]="TOP_RIGHT",a[a.BOTTOM_LEFT=1]="BOTTOM_LEFT",a[a.BOTTOM_RIGHT=5]="BOTTOM_RIGHT",a[a.TOP_START=8]="TOP_START",a[a.TOP_END=12]="TOP_END",a[a.BOTTOM_START=9]="BOTTOM_START",a[a.BOTTOM_END=13]="BOTTOM_END",e.Corner=s},110:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.MDCSelectHelperText=void 0;var o,s=n(1),a=n(111),u=(o=s.MDCComponent,r(c,o),c.attachTo=function(t){return new c(t)},Object.defineProperty(c.prototype,"foundationForSelect",{get:function(){return this.foundation},enumerable:!1,configurable:!0}),c.prototype.getDefaultFoundation=function(){var n=this,t={addClass:function(t){return n.root.classList.add(t)},removeClass:function(t){return n.root.classList.remove(t)},hasClass:function(t){return n.root.classList.contains(t)},getAttr:function(t){return n.root.getAttribute(t)},setAttr:function(t,e){return n.root.setAttribute(t,e)},removeAttr:function(t){return n.root.removeAttribute(t)},setContent:function(t){n.root.textContent=t}};return new a.MDCSelectHelperTextFoundation(t)},c);function c(){return null!==o&&o.apply(this,arguments)||this}e.MDCSelectHelperText=u},111:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.MDCSelectHelperTextFoundation=void 0;var s,a=n(0),u=n(112),c=(s=a.MDCFoundation,r(d,s),Object.defineProperty(d,"cssClasses",{get:function(){return u.cssClasses},enumerable:!1,configurable:!0}),Object.defineProperty(d,"strings",{get:function(){return u.strings},enumerable:!1,configurable:!0}),Object.defineProperty(d,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},setAttr:function(){},getAttr:function(){return null},removeAttr:function(){},setContent:function(){}}},enumerable:!1,configurable:!0}),d.prototype.getId=function(){return this.adapter.getAttr("id")},d.prototype.isVisible=function(){return"true"!==this.adapter.getAttr(u.strings.ARIA_HIDDEN)},d.prototype.setContent=function(t){this.adapter.setContent(t)},d.prototype.setValidation=function(t){t?this.adapter.addClass(u.cssClasses.HELPER_TEXT_VALIDATION_MSG):this.adapter.removeClass(u.cssClasses.HELPER_TEXT_VALIDATION_MSG)},d.prototype.setValidationMsgPersistent=function(t){t?this.adapter.addClass(u.cssClasses.HELPER_TEXT_VALIDATION_MSG_PERSISTENT):this.adapter.removeClass(u.cssClasses.HELPER_TEXT_VALIDATION_MSG_PERSISTENT)},d.prototype.getIsValidation=function(){return this.adapter.hasClass(u.cssClasses.HELPER_TEXT_VALIDATION_MSG)},d.prototype.getIsValidationMsgPersistent=function(){return this.adapter.hasClass(u.cssClasses.HELPER_TEXT_VALIDATION_MSG_PERSISTENT)},d.prototype.setValidity=function(t){if(this.adapter.hasClass(u.cssClasses.HELPER_TEXT_VALIDATION_MSG)){var e=this.adapter.hasClass(u.cssClasses.HELPER_TEXT_VALIDATION_MSG_PERSISTENT);if(!t||e)return this.showToScreenReader(),void(t?this.adapter.removeAttr(u.strings.ROLE):this.adapter.setAttr(u.strings.ROLE,"alert"));this.adapter.removeAttr(u.strings.ROLE),this.hide()}},d.prototype.showToScreenReader=function(){this.adapter.removeAttr(u.strings.ARIA_HIDDEN)},d.prototype.hide=function(){this.adapter.setAttr(u.strings.ARIA_HIDDEN,"true")},d);function d(t){return s.call(this,o(o({},d.defaultAdapter),t))||this}e.MDCSelectHelperTextFoundation=c,e.default=c},112:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.cssClasses=e.strings=void 0;e.strings={ARIA_HIDDEN:"aria-hidden",ROLE:"role"};e.cssClasses={HELPER_TEXT_VALIDATION_MSG:"mdc-select-helper-text--validation-msg",HELPER_TEXT_VALIDATION_MSG_PERSISTENT:"mdc-select-helper-text--validation-msg-persistent"}},113:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.MDCSelectIcon=void 0;var o,s=n(1),a=n(114),u=(o=s.MDCComponent,r(c,o),c.attachTo=function(t){return new c(t)},Object.defineProperty(c.prototype,"foundationForSelect",{get:function(){return this.foundation},enumerable:!1,configurable:!0}),c.prototype.getDefaultFoundation=function(){var n=this,t={getAttr:function(t){return n.root.getAttribute(t)},setAttr:function(t,e){return n.root.setAttribute(t,e)},removeAttr:function(t){return n.root.removeAttribute(t)},setContent:function(t){n.root.textContent=t},registerInteractionHandler:function(t,e){return n.listen(t,e)},deregisterInteractionHandler:function(t,e){return n.unlisten(t,e)},notifyIconAction:function(){return n.emit(a.MDCSelectIconFoundation.strings.ICON_EVENT,{},!0)}};return new a.MDCSelectIconFoundation(t)},c);function c(){return null!==o&&o.apply(this,arguments)||this}e.MDCSelectIcon=u},114:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},s=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.MDCSelectIconFoundation=void 0;var a,u=n(0),c=n(115),d=["click","keydown"],l=(a=u.MDCFoundation,r(h,a),Object.defineProperty(h,"strings",{get:function(){return c.strings},enumerable:!1,configurable:!0}),Object.defineProperty(h,"defaultAdapter",{get:function(){return{getAttr:function(){return null},setAttr:function(){},removeAttr:function(){},setContent:function(){},registerInteractionHandler:function(){},deregisterInteractionHandler:function(){},notifyIconAction:function(){}}},enumerable:!1,configurable:!0}),h.prototype.init=function(){var e,t;this.savedTabIndex=this.adapter.getAttr("tabindex");try{for(var n=s(d),i=n.next();!i.done;i=n.next()){var r=i.value;this.adapter.registerInteractionHandler(r,this.interactionHandler)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},h.prototype.destroy=function(){var e,t;try{for(var n=s(d),i=n.next();!i.done;i=n.next()){var r=i.value;this.adapter.deregisterInteractionHandler(r,this.interactionHandler)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},h.prototype.setDisabled=function(t){this.savedTabIndex&&(t?(this.adapter.setAttr("tabindex","-1"),this.adapter.removeAttr("role")):(this.adapter.setAttr("tabindex",this.savedTabIndex),this.adapter.setAttr("role",c.strings.ICON_ROLE)))},h.prototype.setAriaLabel=function(t){this.adapter.setAttr("aria-label",t)},h.prototype.setContent=function(t){this.adapter.setContent(t)},h.prototype.handleInteraction=function(t){var e="Enter"===t.key||13===t.keyCode;"click"!==t.type&&!e||this.adapter.notifyIconAction()},h);function h(t){var e=a.call(this,o(o({},h.defaultAdapter),t))||this;return e.savedTabIndex=null,e.interactionHandler=function(t){e.handleInteraction(t)},e}e.MDCSelectIconFoundation=l,e.default=l},115:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.strings=void 0;e.strings={ICON_EVENT:"MDCSelect:icon",ICON_ROLE:"button"}},13:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.preventDefaultEvent=void 0;var i=["input","button","textarea","select"];e.preventDefaultEvent=function(t){var e=t.target;if(e){var n=(""+e.tagName).toLowerCase();-1===i.indexOf(n)&&t.preventDefault()}}},14:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},s=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),a=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),u=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&s(e,t,n);return a(e,t),e},l=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,o=n.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(i=o.next()).done;)s.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s},h=this&&this.__spreadArray||function(t,e){for(var n=0,i=e.length,r=t.length;n<i;n++,r++)t[r]=e[n];return t};Object.defineProperty(e,"__esModule",{value:!0}),e.MDCListFoundation=void 0;var c=n(0),v=n(8),g=n(9),A=n(13),b=u(n(23));var d=["Alt","Control","Meta","Shift"];function T(e){var n=new Set(e?d.filter(function(t){return e.getModifierState(t)}):[]);return function(t){return t.every(function(t){return n.has(t)})&&t.length===n.size}}var f,p=(f=c.MDCFoundation,r(m,f),Object.defineProperty(m,"strings",{get:function(){return g.strings},enumerable:!1,configurable:!0}),Object.defineProperty(m,"cssClasses",{get:function(){return g.cssClasses},enumerable:!1,configurable:!0}),Object.defineProperty(m,"numbers",{get:function(){return g.numbers},enumerable:!1,configurable:!0}),Object.defineProperty(m,"defaultAdapter",{get:function(){return{addClassForElementIndex:function(){},focusItemAtIndex:function(){},getAttributeForElementIndex:function(){return null},getFocusedElementIndex:function(){return 0},getListItemCount:function(){return 0},hasCheckboxAtIndex:function(){return!1},hasRadioAtIndex:function(){return!1},isCheckboxCheckedAtIndex:function(){return!1},isFocusInsideList:function(){return!1},isRootFocused:function(){return!1},listItemAtIndexHasClass:function(){return!1},notifyAction:function(){},notifySelectionChange:function(){},removeClassForElementIndex:function(){},setAttributeForElementIndex:function(){},setCheckedCheckboxOrRadioAtIndex:function(){},setTabIndexForListItemChildren:function(){},getPrimaryTextAtIndex:function(){return""}}},enumerable:!1,configurable:!0}),m.prototype.layout=function(){0!==this.adapter.getListItemCount()&&(this.adapter.hasCheckboxAtIndex(0)?this.isCheckboxList=!0:this.adapter.hasRadioAtIndex(0)?this.isRadioList=!0:this.maybeInitializeSingleSelection(),this.hasTypeahead&&(this.sortedIndexByFirstChar=this.typeaheadInitSortedIndex()))},m.prototype.getFocusedItemIndex=function(){return this.focusedItemIndex},m.prototype.setWrapFocus=function(t){this.wrapFocus=t},m.prototype.setVerticalOrientation=function(t){this.isVertical=t},m.prototype.setSingleSelection=function(t){(this.isSingleSelectionList=t)&&(this.maybeInitializeSingleSelection(),this.selectedIndex=this.getSelectedIndexFromDOM())},m.prototype.setDisabledItemsFocusable=function(t){this.areDisabledItemsFocusable=t},m.prototype.maybeInitializeSingleSelection=function(){var t=this.getSelectedIndexFromDOM();t!==g.numbers.UNSET_INDEX&&(this.adapter.listItemAtIndexHasClass(t,g.cssClasses.LIST_ITEM_ACTIVATED_CLASS)&&this.setUseActivatedClass(!0),this.isSingleSelectionList=!0,this.selectedIndex=t)},m.prototype.getSelectedIndexFromDOM=function(){for(var t=g.numbers.UNSET_INDEX,e=this.adapter.getListItemCount(),n=0;n<e;n++){var i=this.adapter.listItemAtIndexHasClass(n,g.cssClasses.LIST_ITEM_SELECTED_CLASS),r=this.adapter.listItemAtIndexHasClass(n,g.cssClasses.LIST_ITEM_ACTIVATED_CLASS);if(i||r){t=n;break}}return t},m.prototype.setHasTypeahead=function(t){(this.hasTypeahead=t)&&(this.sortedIndexByFirstChar=this.typeaheadInitSortedIndex())},m.prototype.isTypeaheadInProgress=function(){return this.hasTypeahead&&b.isTypingInProgress(this.typeaheadState)},m.prototype.setUseActivatedClass=function(t){this.useActivatedClass=t},m.prototype.setUseSelectedAttribute=function(t){this.useSelectedAttr=t},m.prototype.getSelectedIndex=function(){return this.selectedIndex},m.prototype.setSelectedIndex=function(t,e){void 0===e&&(e={}),this.isIndexValid(t)&&(this.isCheckboxList?this.setCheckboxAtIndex(t,e):this.isRadioList?this.setRadioAtIndex(t,e):this.setSingleSelectionAtIndex(t,e))},m.prototype.handleFocusIn=function(t){0<=t&&(this.focusedItemIndex=t,this.adapter.setAttributeForElementIndex(t,"tabindex","0"),this.adapter.setTabIndexForListItemChildren(t,"0"))},m.prototype.handleFocusOut=function(t){var e=this;0<=t&&(this.adapter.setAttributeForElementIndex(t,"tabindex","-1"),this.adapter.setTabIndexForListItemChildren(t,"-1")),setTimeout(function(){e.adapter.isFocusInsideList()||e.setTabindexToFirstSelectedOrFocusedItem()},0)},m.prototype.isIndexDisabled=function(t){return this.adapter.listItemAtIndexHasClass(t,g.cssClasses.LIST_ITEM_DISABLED_CLASS)},m.prototype.handleKeydown=function(t,e,n){var i,r=this,o="ArrowLeft"===v.normalizeKey(t),s="ArrowUp"===v.normalizeKey(t),a="ArrowRight"===v.normalizeKey(t),u="ArrowDown"===v.normalizeKey(t),c="Home"===v.normalizeKey(t),d="End"===v.normalizeKey(t),l="Enter"===v.normalizeKey(t),h="Spacebar"===v.normalizeKey(t),f=this.isVertical&&u||!this.isVertical&&a,p=this.isVertical&&s||!this.isVertical&&o,m="A"===t.key||"a"===t.key,E=T(t);if(this.adapter.isRootFocused()){if((p||d)&&E([])?(t.preventDefault(),this.focusLastElement()):(f||c)&&E([])?(t.preventDefault(),this.focusFirstElement()):p&&E(["Shift"])&&this.isCheckboxList?(t.preventDefault(),-1!==(C=this.focusLastElement())&&this.setSelectedIndexOnAction(C,!1)):f&&E(["Shift"])&&this.isCheckboxList&&(t.preventDefault(),-1!==(C=this.focusFirstElement())&&this.setSelectedIndexOnAction(C,!1)),this.hasTypeahead){var y={event:t,focusItemAtIndex:function(t){r.focusItemAtIndex(t)},focusedItemIndex:-1,isTargetListItem:e,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:function(t){return r.isIndexDisabled(t)}};b.handleKeydown(y,this.typeaheadState)}}else{var I=this.adapter.getFocusedElementIndex();if(!(-1===I&&(I=n)<0)){if(f&&E([]))A.preventDefaultEvent(t),this.focusNextElement(I);else if(p&&E([]))A.preventDefaultEvent(t),this.focusPrevElement(I);else if(f&&E(["Shift"])&&this.isCheckboxList)A.preventDefaultEvent(t),-1!==(C=this.focusNextElement(I))&&this.setSelectedIndexOnAction(C,!1);else if(p&&E(["Shift"])&&this.isCheckboxList){var C;A.preventDefaultEvent(t),-1!==(C=this.focusPrevElement(I))&&this.setSelectedIndexOnAction(C,!1)}else if(c&&E([]))A.preventDefaultEvent(t),this.focusFirstElement();else if(d&&E([]))A.preventDefaultEvent(t),this.focusLastElement();else if(c&&E(["Control","Shift"])&&this.isCheckboxList){if(A.preventDefaultEvent(t),this.isIndexDisabled(I))return;this.focusFirstElement(),this.toggleCheckboxRange(0,I,I)}else if(d&&E(["Control","Shift"])&&this.isCheckboxList){if(A.preventDefaultEvent(t),this.isIndexDisabled(I))return;this.focusLastElement(),this.toggleCheckboxRange(I,this.adapter.getListItemCount()-1,I)}else if(m&&E(["Control"])&&this.isCheckboxList)t.preventDefault(),this.checkboxListToggleAll(this.selectedIndex===g.numbers.UNSET_INDEX?[]:this.selectedIndex,!0);else if((l||h)&&E([])){if(e){if((_=t.target)&&"A"===_.tagName&&l)return;if(A.preventDefaultEvent(t),this.isIndexDisabled(I))return;this.isTypeaheadInProgress()||(this.isSelectableList()&&this.setSelectedIndexOnAction(I,!1),this.adapter.notifyAction(I))}}else if((l||h)&&E(["Shift"])&&this.isCheckboxList){var _;if((_=t.target)&&"A"===_.tagName&&l)return;if(A.preventDefaultEvent(t),this.isIndexDisabled(I))return;this.isTypeaheadInProgress()||(this.toggleCheckboxRange(null!==(i=this.lastSelectedIndex)&&void 0!==i?i:I,I,I),this.adapter.notifyAction(I))}this.hasTypeahead&&(y={event:t,focusItemAtIndex:function(t){r.focusItemAtIndex(t)},focusedItemIndex:this.focusedItemIndex,isTargetListItem:e,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:function(t){return r.isIndexDisabled(t)}},b.handleKeydown(y,this.typeaheadState))}}},m.prototype.handleClick=function(t,e,n){var i,r=T(n);t!==g.numbers.UNSET_INDEX&&(this.isIndexDisabled(t)||(r([])?(this.isSelectableList()&&this.setSelectedIndexOnAction(t,e),this.adapter.notifyAction(t)):this.isCheckboxList&&r(["Shift"])&&(this.toggleCheckboxRange(null!==(i=this.lastSelectedIndex)&&void 0!==i?i:t,t,t),this.adapter.notifyAction(t))))},m.prototype.focusNextElement=function(t){var e=this.adapter.getListItemCount(),n=t,i=null;do{if(e<=++n){if(!this.wrapFocus)return t;n=0}if(n===i)return-1;i=null!=i?i:n}while(!this.areDisabledItemsFocusable&&this.isIndexDisabled(n));return this.focusItemAtIndex(n),n},m.prototype.focusPrevElement=function(t){var e=this.adapter.getListItemCount(),n=t,i=null;do{if(--n<0){if(!this.wrapFocus)return t;n=e-1}if(n===i)return-1;i=null!=i?i:n}while(!this.areDisabledItemsFocusable&&this.isIndexDisabled(n));return this.focusItemAtIndex(n),n},m.prototype.focusFirstElement=function(){return this.focusNextElement(-1)},m.prototype.focusLastElement=function(){return this.focusPrevElement(this.adapter.getListItemCount())},m.prototype.focusInitialElement=function(){var t=this.getFirstSelectedOrFocusedItemIndex();return this.focusItemAtIndex(t),t},m.prototype.setEnabled=function(t,e){this.isIndexValid(t,!1)&&(e?(this.adapter.removeClassForElementIndex(t,g.cssClasses.LIST_ITEM_DISABLED_CLASS),this.adapter.setAttributeForElementIndex(t,g.strings.ARIA_DISABLED,"false")):(this.adapter.addClassForElementIndex(t,g.cssClasses.LIST_ITEM_DISABLED_CLASS),this.adapter.setAttributeForElementIndex(t,g.strings.ARIA_DISABLED,"true")))},m.prototype.setSingleSelectionAtIndex=function(t,e){if(void 0===e&&(e={}),this.selectedIndex!==t||e.forceUpdate){var n=g.cssClasses.LIST_ITEM_SELECTED_CLASS;this.useActivatedClass&&(n=g.cssClasses.LIST_ITEM_ACTIVATED_CLASS),this.selectedIndex!==g.numbers.UNSET_INDEX&&this.adapter.removeClassForElementIndex(this.selectedIndex,n),this.setAriaForSingleSelectionAtIndex(t),this.setTabindexAtIndex(t),t!==g.numbers.UNSET_INDEX&&this.adapter.addClassForElementIndex(t,n),this.selectedIndex=t,e.isUserInteraction&&!e.forceUpdate&&this.adapter.notifySelectionChange([t])}},m.prototype.setAriaForSingleSelectionAtIndex=function(t){this.selectedIndex===g.numbers.UNSET_INDEX&&(this.ariaCurrentAttrValue=this.adapter.getAttributeForElementIndex(t,g.strings.ARIA_CURRENT));var e=null!==this.ariaCurrentAttrValue,n=e?g.strings.ARIA_CURRENT:g.strings.ARIA_SELECTED;if(this.selectedIndex!==g.numbers.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex,n,"false"),t!==g.numbers.UNSET_INDEX){var i=e?this.ariaCurrentAttrValue:"true";this.adapter.setAttributeForElementIndex(t,n,i)}},m.prototype.getSelectionAttribute=function(){return this.useSelectedAttr?g.strings.ARIA_SELECTED:g.strings.ARIA_CHECKED},m.prototype.setRadioAtIndex=function(t,e){void 0===e&&(e={});var n=this.getSelectionAttribute();this.adapter.setCheckedCheckboxOrRadioAtIndex(t,!0),this.selectedIndex===t&&!e.forceUpdate||(this.selectedIndex!==g.numbers.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex,n,"false"),this.adapter.setAttributeForElementIndex(t,n,"true"),this.selectedIndex=t,e.isUserInteraction&&!e.forceUpdate&&this.adapter.notifySelectionChange([t]))},m.prototype.setCheckboxAtIndex=function(t,e){void 0===e&&(e={});for(var n=this.selectedIndex,i=e.isUserInteraction?new Set(n===g.numbers.UNSET_INDEX?[]:n):null,r=this.getSelectionAttribute(),o=[],s=0;s<this.adapter.getListItemCount();s++){var a=null==i?void 0:i.has(s),u=0<=t.indexOf(s);u!==a&&o.push(s),this.adapter.setCheckedCheckboxOrRadioAtIndex(s,u),this.adapter.setAttributeForElementIndex(s,r,u?"true":"false")}this.selectedIndex=t,e.isUserInteraction&&o.length&&this.adapter.notifySelectionChange(o)},m.prototype.toggleCheckboxRange=function(t,e,n){this.lastSelectedIndex=n;for(var i=new Set(this.selectedIndex===g.numbers.UNSET_INDEX?[]:this.selectedIndex),r=!(null==i?void 0:i.has(n)),o=l([t,e].sort(),2),s=o[0],a=o[1],u=this.getSelectionAttribute(),c=[],d=s;d<=a;d++)this.isIndexDisabled(d)||r!==i.has(d)&&(c.push(d),this.adapter.setCheckedCheckboxOrRadioAtIndex(d,r),this.adapter.setAttributeForElementIndex(d,u,""+r),r?i.add(d):i.delete(d));c.length&&(this.selectedIndex=h([],l(i)),this.adapter.notifySelectionChange(c))},m.prototype.setTabindexAtIndex=function(t){this.focusedItemIndex===g.numbers.UNSET_INDEX&&0!==t?this.adapter.setAttributeForElementIndex(0,"tabindex","-1"):0<=this.focusedItemIndex&&this.focusedItemIndex!==t&&this.adapter.setAttributeForElementIndex(this.focusedItemIndex,"tabindex","-1"),this.selectedIndex instanceof Array||this.selectedIndex===t||this.adapter.setAttributeForElementIndex(this.selectedIndex,"tabindex","-1"),t!==g.numbers.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(t,"tabindex","0")},m.prototype.isSelectableList=function(){return this.isSingleSelectionList||this.isCheckboxList||this.isRadioList},m.prototype.setTabindexToFirstSelectedOrFocusedItem=function(){var t=this.getFirstSelectedOrFocusedItemIndex();this.setTabindexAtIndex(t)},m.prototype.getFirstSelectedOrFocusedItemIndex=function(){return this.isSelectableList()?"number"==typeof this.selectedIndex&&this.selectedIndex!==g.numbers.UNSET_INDEX?this.selectedIndex:function(t){return t instanceof Array}(this.selectedIndex)&&0<this.selectedIndex.length?this.selectedIndex.reduce(function(t,e){return Math.min(t,e)}):0:Math.max(this.focusedItemIndex,0)},m.prototype.isIndexValid=function(t,e){var n=this;if(void 0===e&&(e=!0),t instanceof Array){if(!this.isCheckboxList&&e)throw new Error("MDCListFoundation: Array of index is only supported for checkbox based list");return 0===t.length||t.some(function(t){return n.isIndexInRange(t)})}if("number"!=typeof t)return!1;if(this.isCheckboxList&&e)throw new Error("MDCListFoundation: Expected array of index for checkbox based list but got number: "+t);return this.isIndexInRange(t)||this.isSingleSelectionList&&t===g.numbers.UNSET_INDEX},m.prototype.isIndexInRange=function(t){var e=this.adapter.getListItemCount();return 0<=t&&t<e},m.prototype.setSelectedIndexOnAction=function(t,e){this.lastSelectedIndex=t,this.isCheckboxList?(this.toggleCheckboxAtIndex(t,e),this.adapter.notifySelectionChange([t])):this.setSelectedIndex(t,{isUserInteraction:!0})},m.prototype.toggleCheckboxAtIndex=function(e,t){var n,i=this.getSelectionAttribute(),r=this.adapter.isCheckboxCheckedAtIndex(e);t?n=r:(n=!r,this.adapter.setCheckedCheckboxOrRadioAtIndex(e,n)),this.adapter.setAttributeForElementIndex(e,i,n?"true":"false");var o=this.selectedIndex===g.numbers.UNSET_INDEX?[]:this.selectedIndex.slice();n?o.push(e):o=o.filter(function(t){return t!==e}),this.selectedIndex=o},m.prototype.focusItemAtIndex=function(t){this.adapter.focusItemAtIndex(t),this.focusedItemIndex=t},m.prototype.checkboxListToggleAll=function(t,e){var n=this.adapter.getListItemCount();if(t.length===n)this.setCheckboxAtIndex([],{isUserInteraction:e});else{for(var i=[],r=0;r<n;r++)(!this.isIndexDisabled(r)||-1<t.indexOf(r))&&i.push(r);this.setCheckboxAtIndex(i,{isUserInteraction:e})}},m.prototype.typeaheadMatchItem=function(t,e,n){var i=this;void 0===n&&(n=!1);var r={focusItemAtIndex:function(t){i.focusItemAtIndex(t)},focusedItemIndex:e||this.focusedItemIndex,nextChar:t,sortedIndexByFirstChar:this.sortedIndexByFirstChar,skipFocus:n,isItemAtIndexDisabled:function(t){return i.isIndexDisabled(t)}};return b.matchItem(r,this.typeaheadState)},m.prototype.typeaheadInitSortedIndex=function(){return b.initSortedIndex(this.adapter.getListItemCount(),this.adapter.getPrimaryTextAtIndex)},m.prototype.clearTypeaheadBuffer=function(){b.clearBuffer(this.typeaheadState)},m);function m(t){var e=f.call(this,o(o({},m.defaultAdapter),t))||this;return e.wrapFocus=!1,e.isVertical=!0,e.isSingleSelectionList=!1,e.areDisabledItemsFocusable=!0,e.selectedIndex=g.numbers.UNSET_INDEX,e.focusedItemIndex=g.numbers.UNSET_INDEX,e.useActivatedClass=!1,e.useSelectedAttr=!1,e.ariaCurrentAttrValue=null,e.isCheckboxList=!1,e.isRadioList=!1,e.lastSelectedIndex=null,e.hasTypeahead=!1,e.typeaheadState=b.initState(),e.sortedIndexByFirstChar=new Map,e}e.MDCListFoundation=p,e.default=p},15:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.MDCFloatingLabelFoundation=void 0;var s,a=n(0),u=n(20),c=(s=a.MDCFoundation,r(d,s),Object.defineProperty(d,"cssClasses",{get:function(){return u.cssClasses},enumerable:!1,configurable:!0}),Object.defineProperty(d,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},getWidth:function(){return 0},registerInteractionHandler:function(){},deregisterInteractionHandler:function(){}}},enumerable:!1,configurable:!0}),d.prototype.init=function(){this.adapter.registerInteractionHandler("animationend",this.shakeAnimationEndHandler)},d.prototype.destroy=function(){this.adapter.deregisterInteractionHandler("animationend",this.shakeAnimationEndHandler)},d.prototype.getWidth=function(){return this.adapter.getWidth()},d.prototype.shake=function(t){var e=d.cssClasses.LABEL_SHAKE;t?this.adapter.addClass(e):this.adapter.removeClass(e)},d.prototype.float=function(t){var e=d.cssClasses,n=e.LABEL_FLOAT_ABOVE,i=e.LABEL_SHAKE;t?this.adapter.addClass(n):(this.adapter.removeClass(n),this.adapter.removeClass(i))},d.prototype.setRequired=function(t){var e=d.cssClasses.LABEL_REQUIRED;t?this.adapter.addClass(e):this.adapter.removeClass(e)},d.prototype.handleShakeAnimationEnd=function(){var t=d.cssClasses.LABEL_SHAKE;this.adapter.removeClass(t)},d);function d(t){var e=s.call(this,o(o({},d.defaultAdapter),t))||this;return e.shakeAnimationEndHandler=function(){e.handleShakeAnimationEnd()},e}e.MDCFloatingLabelFoundation=c,e.default=c},16:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},f=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.MDCMenuSurfaceFoundation=void 0;var s,a=n(0),y=n(11),u=(s=a.MDCFoundation,r(I,s),Object.defineProperty(I,"cssClasses",{get:function(){return y.cssClasses},enumerable:!1,configurable:!0}),Object.defineProperty(I,"strings",{get:function(){return y.strings},enumerable:!1,configurable:!0}),Object.defineProperty(I,"numbers",{get:function(){return y.numbers},enumerable:!1,configurable:!0}),Object.defineProperty(I,"Corner",{get:function(){return y.Corner},enumerable:!1,configurable:!0}),Object.defineProperty(I,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},hasAnchor:function(){return!1},isElementInContainer:function(){return!1},isFocused:function(){return!1},isRtl:function(){return!1},getInnerDimensions:function(){return{height:0,width:0}},getAnchorDimensions:function(){return null},getWindowDimensions:function(){return{height:0,width:0}},getBodyDimensions:function(){return{height:0,width:0}},getWindowScroll:function(){return{x:0,y:0}},setPosition:function(){},setMaxHeight:function(){},setTransformOrigin:function(){},saveFocus:function(){},restoreFocus:function(){},notifyClose:function(){},notifyClosing:function(){},notifyOpen:function(){},notifyOpening:function(){}}},enumerable:!1,configurable:!0}),I.prototype.init=function(){var t=I.cssClasses,e=t.ROOT,n=t.OPEN;if(!this.adapter.hasClass(e))throw new Error(e+" class required in root element.");this.adapter.hasClass(n)&&(this.isSurfaceOpen=!0)},I.prototype.destroy=function(){clearTimeout(this.openAnimationEndTimerId),clearTimeout(this.closeAnimationEndTimerId),cancelAnimationFrame(this.animationRequestId)},I.prototype.setAnchorCorner=function(t){this.anchorCorner=t},I.prototype.flipCornerHorizontally=function(){this.originCorner=this.originCorner^y.CornerBit.RIGHT},I.prototype.setAnchorMargin=function(t){this.anchorMargin.top=t.top||0,this.anchorMargin.right=t.right||0,this.anchorMargin.bottom=t.bottom||0,this.anchorMargin.left=t.left||0},I.prototype.setIsHoisted=function(t){this.isHoistedElement=t},I.prototype.setFixedPosition=function(t){this.isFixedPosition=t},I.prototype.isFixed=function(){return this.isFixedPosition},I.prototype.setAbsolutePosition=function(t,e){this.position.x=this.isFinite(t)?t:0,this.position.y=this.isFinite(e)?e:0},I.prototype.setIsHorizontallyCenteredOnViewport=function(t){this.isHorizontallyCenteredOnViewport=t},I.prototype.setQuickOpen=function(t){this.isQuickOpen=t},I.prototype.setMaxHeight=function(t){this.maxHeight=t},I.prototype.setOpenBottomBias=function(t){this.openBottomBias=t},I.prototype.isOpen=function(){return this.isSurfaceOpen},I.prototype.open=function(){var t=this;this.isSurfaceOpen||(this.adapter.notifyOpening(),this.adapter.saveFocus(),this.isQuickOpen?(this.isSurfaceOpen=!0,this.adapter.addClass(I.cssClasses.OPEN),this.dimensions=this.adapter.getInnerDimensions(),this.autoposition(),this.adapter.notifyOpen()):(this.adapter.addClass(I.cssClasses.ANIMATING_OPEN),this.animationRequestId=requestAnimationFrame(function(){t.dimensions=t.adapter.getInnerDimensions(),t.autoposition(),t.adapter.addClass(I.cssClasses.OPEN),t.openAnimationEndTimerId=setTimeout(function(){t.openAnimationEndTimerId=0,t.adapter.removeClass(I.cssClasses.ANIMATING_OPEN),t.adapter.notifyOpen()},y.numbers.TRANSITION_OPEN_DURATION)}),this.isSurfaceOpen=!0))},I.prototype.close=function(t){var e=this;if(void 0===t&&(t=!1),this.isSurfaceOpen){if(this.adapter.notifyClosing(),this.isQuickOpen)return this.isSurfaceOpen=!1,t||this.maybeRestoreFocus(),this.adapter.removeClass(I.cssClasses.OPEN),this.adapter.removeClass(I.cssClasses.IS_OPEN_BELOW),void this.adapter.notifyClose();this.adapter.addClass(I.cssClasses.ANIMATING_CLOSED),requestAnimationFrame(function(){e.adapter.removeClass(I.cssClasses.OPEN),e.adapter.removeClass(I.cssClasses.IS_OPEN_BELOW),e.closeAnimationEndTimerId=setTimeout(function(){e.closeAnimationEndTimerId=0,e.adapter.removeClass(I.cssClasses.ANIMATING_CLOSED),e.adapter.notifyClose()},y.numbers.TRANSITION_CLOSE_DURATION)}),this.isSurfaceOpen=!1,t||this.maybeRestoreFocus()}},I.prototype.handleBodyClick=function(t){var e=t.target;this.adapter.isElementInContainer(e)||this.close()},I.prototype.handleKeydown=function(t){var e=t.keyCode;"Escape"!==t.key&&27!==e||this.close()},I.prototype.autoposition=function(){var t;this.measurements=this.getAutoLayoutmeasurements();var e=this.getoriginCorner(),n=this.getMenuSurfaceMaxHeight(e),i=this.hasBit(e,y.CornerBit.BOTTOM)?"bottom":"top",r=this.hasBit(e,y.CornerBit.RIGHT)?"right":"left",o=this.getHorizontalOriginOffset(e),s=this.getVerticalOriginOffset(e),a=this.measurements,u=a.anchorSize,c=a.surfaceSize,d=((t={})[r]=o,t[i]=s,t);u.width/c.width>y.numbers.ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO&&(r="center"),(this.isHoistedElement||this.isFixedPosition)&&this.adjustPositionForHoistedElement(d),this.adapter.setTransformOrigin(r+" "+i),this.adapter.setPosition(d),this.adapter.setMaxHeight(n?n+"px":""),this.hasBit(e,y.CornerBit.BOTTOM)||this.adapter.addClass(I.cssClasses.IS_OPEN_BELOW)},I.prototype.getAutoLayoutmeasurements=function(){var t=this.adapter.getAnchorDimensions(),e=this.adapter.getBodyDimensions(),n=this.adapter.getWindowDimensions(),i=this.adapter.getWindowScroll();return{anchorSize:t=t||{top:this.position.y,right:this.position.x,bottom:this.position.y,left:this.position.x,width:0,height:0},bodySize:e,surfaceSize:this.dimensions,viewportDistance:{top:t.top,right:n.width-t.right,bottom:n.height-t.bottom,left:t.left},viewportSize:n,windowScroll:i}},I.prototype.getoriginCorner=function(){var t,e,n=this.originCorner,i=this.measurements,r=i.viewportDistance,o=i.anchorSize,s=i.surfaceSize,a=I.numbers.MARGIN_TO_EDGE;!(0<(e=this.hasBit(this.anchorCorner,y.CornerBit.BOTTOM)?(t=r.top-a+this.anchorMargin.bottom,r.bottom-a-this.anchorMargin.bottom):(t=r.top-a+this.anchorMargin.top,r.bottom-a+o.height-this.anchorMargin.top))-s.height)&&t>e+this.openBottomBias&&(n=this.setBit(n,y.CornerBit.BOTTOM));var u,c,d=this.adapter.isRtl(),l=this.hasBit(this.anchorCorner,y.CornerBit.FLIP_RTL),h=this.hasBit(this.anchorCorner,y.CornerBit.RIGHT)||this.hasBit(n,y.CornerBit.RIGHT),f=!1;c=(f=d&&l?!h:h)?(u=r.left+o.width+this.ancho