UNPKG

@material/menu

Version:
1 lines • 66.1 kB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("@material/menu",[],e):"object"==typeof exports?exports.menu=e():(t.mdc=t.mdc||{},t.mdc.menu=e())}(this,function(){return i={},s.m=n={0:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MDCFoundation=void 0;var i=(Object.defineProperty(s,"cssClasses",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(s,"strings",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(s,"numbers",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(s,"defaultAdapter",{get:function(){return{}},enumerable:!1,configurable:!0}),s.prototype.init=function(){},s.prototype.destroy=function(){},s);function s(t){void 0===t&&(t={}),this.adapter=t}e.MDCFoundation=i,e.default=i},1:function(t,e,n){"use strict";var s=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,s,o=n.call(t),r=[];try{for(;(void 0===e||0<e--)&&!(i=o.next()).done;)r.push(i.value)}catch(t){s={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(s)throw s.error}}return r},o=this&&this.__spreadArray||function(t,e){for(var n=0,i=e.length,s=t.length;n<i;n++,s++)t[s]=e[n];return t};Object.defineProperty(e,"__esModule",{value:!0}),e.MDCComponent=void 0;var i=n(0),r=(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([],s(n))),this.foundation=void 0===e?this.getDefaultFoundation():e,this.foundation.init(),this.initialSyncWithDOM()}e.MDCComponent=r,e.default=r},10:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getCorrectEventName=e.getCorrectPropertyName=void 0;var r={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 r){var n=t.document.createElement("div"),i=r[e],s=i.standard,o=i.prefixed;return s in n.style?s:o}return e},e.getCorrectEventName=function(t,e){if(u(t)&&e in a){var n=t.document.createElement("div"),i=a[e],s=i.standard,o=i.prefixed;return i.cssProperty in n.style?s:o}return e}},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 s,o,r,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=s=s||{})[o.BOTTOM=1]="BOTTOM",o[o.CENTER=2]="CENTER",o[o.RIGHT=4]="RIGHT",o[o.FLIP_RTL=8]="FLIP_RTL",e.CornerBit=s,(a=r=r||{})[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=r},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,s=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 s in e=arguments[n])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t}).apply(this,arguments)},r=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)&&r(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,s,o=n.call(t),r=[];try{for(;(void 0===e||0<e--)&&!(i=o.next()).done;)r.push(i.value)}catch(t){s={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(s)throw s.error}}return r},h=this&&this.__spreadArray||function(t,e){for(var n=0,i=e.length,s=t.length;n<i;n++,s++)t[s]=e[n];return t};Object.defineProperty(e,"__esModule",{value:!0}),e.MDCListFoundation=void 0;var c=n(0),T=n(8),_=n(9),A=n(13),b=u(n(23));var d=["Alt","Control","Meta","Shift"];function x(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,s(I,f),Object.defineProperty(I,"strings",{get:function(){return _.strings},enumerable:!1,configurable:!0}),Object.defineProperty(I,"cssClasses",{get:function(){return _.cssClasses},enumerable:!1,configurable:!0}),Object.defineProperty(I,"numbers",{get:function(){return _.numbers},enumerable:!1,configurable:!0}),Object.defineProperty(I,"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}),I.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()))},I.prototype.getFocusedItemIndex=function(){return this.focusedItemIndex},I.prototype.setWrapFocus=function(t){this.wrapFocus=t},I.prototype.setVerticalOrientation=function(t){this.isVertical=t},I.prototype.setSingleSelection=function(t){(this.isSingleSelectionList=t)&&(this.maybeInitializeSingleSelection(),this.selectedIndex=this.getSelectedIndexFromDOM())},I.prototype.setDisabledItemsFocusable=function(t){this.areDisabledItemsFocusable=t},I.prototype.maybeInitializeSingleSelection=function(){var t=this.getSelectedIndexFromDOM();t!==_.numbers.UNSET_INDEX&&(this.adapter.listItemAtIndexHasClass(t,_.cssClasses.LIST_ITEM_ACTIVATED_CLASS)&&this.setUseActivatedClass(!0),this.isSingleSelectionList=!0,this.selectedIndex=t)},I.prototype.getSelectedIndexFromDOM=function(){for(var t=_.numbers.UNSET_INDEX,e=this.adapter.getListItemCount(),n=0;n<e;n++){var i=this.adapter.listItemAtIndexHasClass(n,_.cssClasses.LIST_ITEM_SELECTED_CLASS),s=this.adapter.listItemAtIndexHasClass(n,_.cssClasses.LIST_ITEM_ACTIVATED_CLASS);if(i||s){t=n;break}}return t},I.prototype.setHasTypeahead=function(t){(this.hasTypeahead=t)&&(this.sortedIndexByFirstChar=this.typeaheadInitSortedIndex())},I.prototype.isTypeaheadInProgress=function(){return this.hasTypeahead&&b.isTypingInProgress(this.typeaheadState)},I.prototype.setUseActivatedClass=function(t){this.useActivatedClass=t},I.prototype.setUseSelectedAttribute=function(t){this.useSelectedAttr=t},I.prototype.getSelectedIndex=function(){return this.selectedIndex},I.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))},I.prototype.handleFocusIn=function(t){0<=t&&(this.focusedItemIndex=t,this.adapter.setAttributeForElementIndex(t,"tabindex","0"),this.adapter.setTabIndexForListItemChildren(t,"0"))},I.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)},I.prototype.isIndexDisabled=function(t){return this.adapter.listItemAtIndexHasClass(t,_.cssClasses.LIST_ITEM_DISABLED_CLASS)},I.prototype.handleKeydown=function(t,e,n){var i,s=this,o="ArrowLeft"===T.normalizeKey(t),r="ArrowUp"===T.normalizeKey(t),a="ArrowRight"===T.normalizeKey(t),u="ArrowDown"===T.normalizeKey(t),c="Home"===T.normalizeKey(t),d="End"===T.normalizeKey(t),l="Enter"===T.normalizeKey(t),h="Spacebar"===T.normalizeKey(t),f=this.isVertical&&u||!this.isVertical&&a,p=this.isVertical&&r||!this.isVertical&&o,I="A"===t.key||"a"===t.key,E=x(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 m={event:t,focusItemAtIndex:function(t){s.focusItemAtIndex(t)},focusedItemIndex:-1,isTargetListItem:e,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:function(t){return s.isIndexDisabled(t)}};b.handleKeydown(m,this.typeaheadState)}}else{var y=this.adapter.getFocusedElementIndex();if(!(-1===y&&(y=n)<0)){if(f&&E([]))A.preventDefaultEvent(t),this.focusNextElement(y);else if(p&&E([]))A.preventDefaultEvent(t),this.focusPrevElement(y);else if(f&&E(["Shift"])&&this.isCheckboxList)A.preventDefaultEvent(t),-1!==(C=this.focusNextElement(y))&&this.setSelectedIndexOnAction(C,!1);else if(p&&E(["Shift"])&&this.isCheckboxList){var C;A.preventDefaultEvent(t),-1!==(C=this.focusPrevElement(y))&&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(y))return;this.focusFirstElement(),this.toggleCheckboxRange(0,y,y)}else if(d&&E(["Control","Shift"])&&this.isCheckboxList){if(A.preventDefaultEvent(t),this.isIndexDisabled(y))return;this.focusLastElement(),this.toggleCheckboxRange(y,this.adapter.getListItemCount()-1,y)}else if(I&&E(["Control"])&&this.isCheckboxList)t.preventDefault(),this.checkboxListToggleAll(this.selectedIndex===_.numbers.UNSET_INDEX?[]:this.selectedIndex,!0);else if((l||h)&&E([])){if(e){if((S=t.target)&&"A"===S.tagName&&l)return;if(A.preventDefaultEvent(t),this.isIndexDisabled(y))return;this.isTypeaheadInProgress()||(this.isSelectableList()&&this.setSelectedIndexOnAction(y,!1),this.adapter.notifyAction(y))}}else if((l||h)&&E(["Shift"])&&this.isCheckboxList){var S;if((S=t.target)&&"A"===S.tagName&&l)return;if(A.preventDefaultEvent(t),this.isIndexDisabled(y))return;this.isTypeaheadInProgress()||(this.toggleCheckboxRange(null!==(i=this.lastSelectedIndex)&&void 0!==i?i:y,y,y),this.adapter.notifyAction(y))}this.hasTypeahead&&(m={event:t,focusItemAtIndex:function(t){s.focusItemAtIndex(t)},focusedItemIndex:this.focusedItemIndex,isTargetListItem:e,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:function(t){return s.isIndexDisabled(t)}},b.handleKeydown(m,this.typeaheadState))}}},I.prototype.handleClick=function(t,e,n){var i,s=x(n);t!==_.numbers.UNSET_INDEX&&(this.isIndexDisabled(t)||(s([])?(this.isSelectableList()&&this.setSelectedIndexOnAction(t,e),this.adapter.notifyAction(t)):this.isCheckboxList&&s(["Shift"])&&(this.toggleCheckboxRange(null!==(i=this.lastSelectedIndex)&&void 0!==i?i:t,t,t),this.adapter.notifyAction(t))))},I.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},I.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},I.prototype.focusFirstElement=function(){return this.focusNextElement(-1)},I.prototype.focusLastElement=function(){return this.focusPrevElement(this.adapter.getListItemCount())},I.prototype.focusInitialElement=function(){var t=this.getFirstSelectedOrFocusedItemIndex();return this.focusItemAtIndex(t),t},I.prototype.setEnabled=function(t,e){this.isIndexValid(t,!1)&&(e?(this.adapter.removeClassForElementIndex(t,_.cssClasses.LIST_ITEM_DISABLED_CLASS),this.adapter.setAttributeForElementIndex(t,_.strings.ARIA_DISABLED,"false")):(this.adapter.addClassForElementIndex(t,_.cssClasses.LIST_ITEM_DISABLED_CLASS),this.adapter.setAttributeForElementIndex(t,_.strings.ARIA_DISABLED,"true")))},I.prototype.setSingleSelectionAtIndex=function(t,e){if(void 0===e&&(e={}),this.selectedIndex!==t||e.forceUpdate){var n=_.cssClasses.LIST_ITEM_SELECTED_CLASS;this.useActivatedClass&&(n=_.cssClasses.LIST_ITEM_ACTIVATED_CLASS),this.selectedIndex!==_.numbers.UNSET_INDEX&&this.adapter.removeClassForElementIndex(this.selectedIndex,n),this.setAriaForSingleSelectionAtIndex(t),this.setTabindexAtIndex(t),t!==_.numbers.UNSET_INDEX&&this.adapter.addClassForElementIndex(t,n),this.selectedIndex=t,e.isUserInteraction&&!e.forceUpdate&&this.adapter.notifySelectionChange([t])}},I.prototype.setAriaForSingleSelectionAtIndex=function(t){this.selectedIndex===_.numbers.UNSET_INDEX&&(this.ariaCurrentAttrValue=this.adapter.getAttributeForElementIndex(t,_.strings.ARIA_CURRENT));var e=null!==this.ariaCurrentAttrValue,n=e?_.strings.ARIA_CURRENT:_.strings.ARIA_SELECTED;if(this.selectedIndex!==_.numbers.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex,n,"false"),t!==_.numbers.UNSET_INDEX){var i=e?this.ariaCurrentAttrValue:"true";this.adapter.setAttributeForElementIndex(t,n,i)}},I.prototype.getSelectionAttribute=function(){return this.useSelectedAttr?_.strings.ARIA_SELECTED:_.strings.ARIA_CHECKED},I.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!==_.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]))},I.prototype.setCheckboxAtIndex=function(t,e){void 0===e&&(e={});for(var n=this.selectedIndex,i=e.isUserInteraction?new Set(n===_.numbers.UNSET_INDEX?[]:n):null,s=this.getSelectionAttribute(),o=[],r=0;r<this.adapter.getListItemCount();r++){var a=null==i?void 0:i.has(r),u=0<=t.indexOf(r);u!==a&&o.push(r),this.adapter.setCheckedCheckboxOrRadioAtIndex(r,u),this.adapter.setAttributeForElementIndex(r,s,u?"true":"false")}this.selectedIndex=t,e.isUserInteraction&&o.length&&this.adapter.notifySelectionChange(o)},I.prototype.toggleCheckboxRange=function(t,e,n){this.lastSelectedIndex=n;for(var i=new Set(this.selectedIndex===_.numbers.UNSET_INDEX?[]:this.selectedIndex),s=!(null==i?void 0:i.has(n)),o=l([t,e].sort(),2),r=o[0],a=o[1],u=this.getSelectionAttribute(),c=[],d=r;d<=a;d++)this.isIndexDisabled(d)||s!==i.has(d)&&(c.push(d),this.adapter.setCheckedCheckboxOrRadioAtIndex(d,s),this.adapter.setAttributeForElementIndex(d,u,""+s),s?i.add(d):i.delete(d));c.length&&(this.selectedIndex=h([],l(i)),this.adapter.notifySelectionChange(c))},I.prototype.setTabindexAtIndex=function(t){this.focusedItemIndex===_.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!==_.numbers.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(t,"tabindex","0")},I.prototype.isSelectableList=function(){return this.isSingleSelectionList||this.isCheckboxList||this.isRadioList},I.prototype.setTabindexToFirstSelectedOrFocusedItem=function(){var t=this.getFirstSelectedOrFocusedItemIndex();this.setTabindexAtIndex(t)},I.prototype.getFirstSelectedOrFocusedItemIndex=function(){return this.isSelectableList()?"number"==typeof this.selectedIndex&&this.selectedIndex!==_.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)},I.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===_.numbers.UNSET_INDEX},I.prototype.isIndexInRange=function(t){var e=this.adapter.getListItemCount();return 0<=t&&t<e},I.prototype.setSelectedIndexOnAction=function(t,e){this.lastSelectedIndex=t,this.isCheckboxList?(this.toggleCheckboxAtIndex(t,e),this.adapter.notifySelectionChange([t])):this.setSelectedIndex(t,{isUserInteraction:!0})},I.prototype.toggleCheckboxAtIndex=function(e,t){var n,i=this.getSelectionAttribute(),s=this.adapter.isCheckboxCheckedAtIndex(e);t?n=s:(n=!s,this.adapter.setCheckedCheckboxOrRadioAtIndex(e,n)),this.adapter.setAttributeForElementIndex(e,i,n?"true":"false");var o=this.selectedIndex===_.numbers.UNSET_INDEX?[]:this.selectedIndex.slice();n?o.push(e):o=o.filter(function(t){return t!==e}),this.selectedIndex=o},I.prototype.focusItemAtIndex=function(t){this.adapter.focusItemAtIndex(t),this.focusedItemIndex=t},I.prototype.checkboxListToggleAll=function(t,e){var n=this.adapter.getListItemCount();if(t.length===n)this.setCheckboxAtIndex([],{isUserInteraction:e});else{for(var i=[],s=0;s<n;s++)(!this.isIndexDisabled(s)||-1<t.indexOf(s))&&i.push(s);this.setCheckboxAtIndex(i,{isUserInteraction:e})}},I.prototype.typeaheadMatchItem=function(t,e,n){var i=this;void 0===n&&(n=!1);var s={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(s,this.typeaheadState)},I.prototype.typeaheadInitSortedIndex=function(){return b.initSortedIndex(this.adapter.getListItemCount(),this.adapter.getPrimaryTextAtIndex)},I.prototype.clearTypeaheadBuffer=function(){b.clearBuffer(this.typeaheadState)},I);function I(t){var e=f.call(this,o(o({},I.defaultAdapter),t))||this;return e.wrapFocus=!1,e.isVertical=!0,e.isSingleSelectionList=!1,e.areDisabledItemsFocusable=!0,e.selectedIndex=_.numbers.UNSET_INDEX,e.focusedItemIndex=_.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},16:function(t,e,n){"use strict";var i,s=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 s in e=arguments[n])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);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 r,a=n(0),m=n(11),u=(r=a.MDCFoundation,s(y,r),Object.defineProperty(y,"cssClasses",{get:function(){return m.cssClasses},enumerable:!1,configurable:!0}),Object.defineProperty(y,"strings",{get:function(){return m.strings},enumerable:!1,configurable:!0}),Object.defineProperty(y,"numbers",{get:function(){return m.numbers},enumerable:!1,configurable:!0}),Object.defineProperty(y,"Corner",{get:function(){return m.Corner},enumerable:!1,configurable:!0}),Object.defineProperty(y,"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}),y.prototype.init=function(){var t=y.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)},y.prototype.destroy=function(){clearTimeout(this.openAnimationEndTimerId),clearTimeout(this.closeAnimationEndTimerId),cancelAnimationFrame(this.animationRequestId)},y.prototype.setAnchorCorner=function(t){this.anchorCorner=t},y.prototype.flipCornerHorizontally=function(){this.originCorner=this.originCorner^m.CornerBit.RIGHT},y.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},y.prototype.setIsHoisted=function(t){this.isHoistedElement=t},y.prototype.setFixedPosition=function(t){this.isFixedPosition=t},y.prototype.isFixed=function(){return this.isFixedPosition},y.prototype.setAbsolutePosition=function(t,e){this.position.x=this.isFinite(t)?t:0,this.position.y=this.isFinite(e)?e:0},y.prototype.setIsHorizontallyCenteredOnViewport=function(t){this.isHorizontallyCenteredOnViewport=t},y.prototype.setQuickOpen=function(t){this.isQuickOpen=t},y.prototype.setMaxHeight=function(t){this.maxHeight=t},y.prototype.setOpenBottomBias=function(t){this.openBottomBias=t},y.prototype.isOpen=function(){return this.isSurfaceOpen},y.prototype.open=function(){var t=this;this.isSurfaceOpen||(this.adapter.notifyOpening(),this.adapter.saveFocus(),this.isQuickOpen?(this.isSurfaceOpen=!0,this.adapter.addClass(y.cssClasses.OPEN),this.dimensions=this.adapter.getInnerDimensions(),this.autoposition(),this.adapter.notifyOpen()):(this.adapter.addClass(y.cssClasses.ANIMATING_OPEN),this.animationRequestId=requestAnimationFrame(function(){t.dimensions=t.adapter.getInnerDimensions(),t.autoposition(),t.adapter.addClass(y.cssClasses.OPEN),t.openAnimationEndTimerId=setTimeout(function(){t.openAnimationEndTimerId=0,t.adapter.removeClass(y.cssClasses.ANIMATING_OPEN),t.adapter.notifyOpen()},m.numbers.TRANSITION_OPEN_DURATION)}),this.isSurfaceOpen=!0))},y.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(y.cssClasses.OPEN),this.adapter.removeClass(y.cssClasses.IS_OPEN_BELOW),void this.adapter.notifyClose();this.adapter.addClass(y.cssClasses.ANIMATING_CLOSED),requestAnimationFrame(function(){e.adapter.removeClass(y.cssClasses.OPEN),e.adapter.removeClass(y.cssClasses.IS_OPEN_BELOW),e.closeAnimationEndTimerId=setTimeout(function(){e.closeAnimationEndTimerId=0,e.adapter.removeClass(y.cssClasses.ANIMATING_CLOSED),e.adapter.notifyClose()},m.numbers.TRANSITION_CLOSE_DURATION)}),this.isSurfaceOpen=!1,t||this.maybeRestoreFocus()}},y.prototype.handleBodyClick=function(t){var e=t.target;this.adapter.isElementInContainer(e)||this.close()},y.prototype.handleKeydown=function(t){var e=t.keyCode;"Escape"!==t.key&&27!==e||this.close()},y.prototype.autoposition=function(){var t;this.measurements=this.getAutoLayoutmeasurements();var e=this.getoriginCorner(),n=this.getMenuSurfaceMaxHeight(e),i=this.hasBit(e,m.CornerBit.BOTTOM)?"bottom":"top",s=this.hasBit(e,m.CornerBit.RIGHT)?"right":"left",o=this.getHorizontalOriginOffset(e),r=this.getVerticalOriginOffset(e),a=this.measurements,u=a.anchorSize,c=a.surfaceSize,d=((t={})[s]=o,t[i]=r,t);u.width/c.width>m.numbers.ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO&&(s="center"),(this.isHoistedElement||this.isFixedPosition)&&this.adjustPositionForHoistedElement(d),this.adapter.setTransformOrigin(s+" "+i),this.adapter.setPosition(d),this.adapter.setMaxHeight(n?n+"px":""),this.hasBit(e,m.CornerBit.BOTTOM)||this.adapter.addClass(y.cssClasses.IS_OPEN_BELOW)},y.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}},y.prototype.getoriginCorner=function(){var t,e,n=this.originCorner,i=this.measurements,s=i.viewportDistance,o=i.anchorSize,r=i.surfaceSize,a=y.numbers.MARGIN_TO_EDGE;!(0<(e=this.hasBit(this.anchorCorner,m.CornerBit.BOTTOM)?(t=s.top-a+this.anchorMargin.bottom,s.bottom-a-this.anchorMargin.bottom):(t=s.top-a+this.anchorMargin.top,s.bottom-a+o.height-this.anchorMargin.top))-r.height)&&t>e+this.openBottomBias&&(n=this.setBit(n,m.CornerBit.BOTTOM));var u,c,d=this.adapter.isRtl(),l=this.hasBit(this.anchorCorner,m.CornerBit.FLIP_RTL),h=this.hasBit(this.anchorCorner,m.CornerBit.RIGHT)||this.hasBit(n,m.CornerBit.RIGHT),f=!1;c=(f=d&&l?!h:h)?(u=s.left+o.width+this.anchorMargin.right,s.right-this.anchorMargin.right):(u=s.left+this.anchorMargin.left,s.right+o.width-this.anchorMargin.left);var p=0<u-r.width,I=0<c-r.width,E=this.hasBit(n,m.CornerBit.FLIP_RTL)&&this.hasBit(n,m.CornerBit.RIGHT);return I&&E&&d||!p&&E?n=this.unsetBit(n,m.CornerBit.RIGHT):(p&&f&&d||p&&!f&&h||!I&&c<=u)&&(n=this.setBit(n,m.CornerBit.RIGHT)),n},y.prototype.getMenuSurfaceMaxHeight=function(t){if(0<this.maxHeight)return this.maxHeight;var e=this.measurements.viewportDistance,n=0,i=this.hasBit(t,m.CornerBit.BOTTOM),s=this.hasBit(this.anchorCorner,m.CornerBit.BOTTOM),o=y.numbers.MARGIN_TO_EDGE;return i?(n=e.top+this.anchorMargin.top-o,s||(n+=this.measurements.anchorSize.height)):(n=e.bottom-this.anchorMargin.bottom+this.measurements.anchorSize.height-o,s&&(n-=this.measurements.anchorSize.height)),n},y.prototype.getHorizontalOriginOffset=function(t){var e=this.measurements.anchorSize,n=this.hasBit(t,m.CornerBit.RIGHT),i=this.hasBit(this.anchorCorner,m.CornerBit.RIGHT);if(n){var s=i?e.width-this.anchorMargin.left:this.anchorMargin.right;return this.isHoistedElement||this.isFixedPosition?s-(this.measurements.viewportSize.width-this.measurements.bodySize.width):s}return i?e.width-this.anchorMargin.right:this.anchorMargin.left},y.prototype.getVerticalOriginOffset=function(t){var e=this.measurements.anchorSize,n=this.hasBit(t,m.CornerBit.BOTTOM),i=this.hasBit(this.anchorCorner,m.CornerBit.BOTTOM);return n?i?e.height-this.anchorMargin.top:-this.anchorMargin.bottom:i?e.height+this.anchorMargin.bottom:this.anchorMargin.top},y.prototype.adjustPositionForHoistedElement=function(t){var e,n,i=this.measurements,s=i.windowScroll,o=i.viewportDistance,r=i.surfaceSize,a=i.viewportSize,u=Object.keys(t);try{for(var c=f(u),d=c.next();!d.done;d=c.next()){var l=d.value,h=t[l]||0;!this.isHorizontallyCenteredOnViewport||"left"!==l&&"right"!==l?(h+=o[l],this.isFixedPosition||("top"===l?h+=s.y:"bottom"===l?h-=s.y:"left"===l?h+=s.x:h-=s.x),t[l]=h):t[l]=(a.width-r.width)/2}}catch(t){e={error:t}}finally{try{d&&!d.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}},y.prototype.maybeRestoreFocus=function(){var t=this,e=this.adapter.isFocused(),n=this.adapter.getOwnerDocument?this.adapter.getOwnerDocument():document,i=n.activeElement&&this.adapter.isElementInContainer(n.activeElement);(e||i)&&setTimeout(function(){t.adapter.restoreFocus()},m.numbers.TOUCH_EVENT_WAIT_MS)},y.prototype.hasBit=function(t,e){return Boolean(t&e)},y.prototype.setBit=function(t,e){return t|e},y.prototype.unsetBit=function(t,e){return t^e},y.prototype.isFinite=function(t){return"number"==typeof t&&isFinite(t)},y);function y(t){var e=r.call(this,o(o({},y.defaultAdapter),t))||this;return e.isSurfaceOpen=!1,e.isQuickOpen=!1,e.isHoistedElement=!1,e.isFixedPosition=!1,e.isHorizontallyCenteredOnViewport=!1,e.maxHeight=0,e.openBottomBias=0,e.openAnimationEndTimerId=0,e.closeAnimationEndTimerId=0,e.animationRequestId=0,e.anchorCorner=m.Corner.TOP_START,e.originCorner=m.Corner.TOP_START,e.anchorMargin={top:0,right:0,bottom:0,left:0},e.position={x:0,y:0},e}e.MDCMenuSurfaceFoundation=u,e.default=u},2:function(t,e,n){"use strict";function i(t,e){return(t.matches||t.webkitMatchesSelector||t.msMatchesSelector).call(t,e)}Object.defineProperty(e,"__esModule",{value:!0}),e.estimateScrollWidth=e.matches=e.closest=void 0,e.closest=function(t,e){if(t.closest)return t.closest(e);for(var n=t;n;){if(i(n,e))return n;n=n.parentElement}return null},e.matches=i,e.estimateScrollWidth=function(t){var e=t;if(null!==e.offsetParent)return e.scrollWidth;var n=e.cloneNode(!0);n.style.setProperty("position","absolute"),n.style.setProperty("transform","translate(-9999px, -9999px)"),document.documentElement.appendChild(n);var i=n.scrollWidth;return document.documentElement.removeChild(n),i}},200:function(t,e,n){"use strict";var i=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]}),s=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||i(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.Corner=void 0;var o=n(11);Object.defineProperty(e,"Corner",{enumerable:!0,get:function(){return o.Corner}}),s(n(201),e),s(n(60),e),s(n(24),e),s(n(47),e),s(n(202),e)},201:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},202:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},22:function(t,e,n){"use strict";var i,s=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.MDCList=void 0;var o,r=n(1),a=n(2),u=n(9),c=n(14),d=(o=r.MDCComponent,s(l,o),Object.defineProperty(l.prototype,"vertical",{set:function(t){this.foundation.setVerticalOrientation(t)},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"listElements",{get:function(){return Array.from(this.root.querySelectorAll("."+this.classNameMap[u.cssClasses.LIST_ITEM_CLASS]))},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"wrapFocus",{set:function(t){this.foundation.setWrapFocus(t)},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"typeaheadInProgress",{get:function(){return this.foundation.isTypeaheadInProgress()},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"hasTypeahead",{set:function(t){this.foundation.setHasTypeahead(t)},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"singleSelection",{set:function(t){this.foundation.setSingleSelection(t)},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"disabledItemsFocusable",{set:function(t){this.foundation.setDisabledItemsFocusable(t)},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"selectedIndex",{get:function(){return this.foundation.getSelectedIndex()},set:function(t){this.foundation.setSelectedIndex(t)},enumerable:!1,configurable:!0}),l.attachTo=function(t){return new l(t)},l.prototype.initialSyncWithDOM=function(){this.isEvolutionEnabled=u.evolutionAttribute in this.root.dataset,this.isEvolutionEnabled?this.classNameMap=u.evolutionClassNameMap:a.matches(this.root,u.strings.DEPRECATED_SELECTOR)?this.classNameMap=u.deprecatedClassNameMap:this.classNameMap=Object.values(u.cssClasses).reduce(function(t,e){return t[e]=e,t},{}),this.handleClick=this.handleClickEvent.bind(this),this.handleKeydown=this.handleKeydownEvent.bind(this),this.focusInEventListener=this.handleFocusInEvent.bind(this),this.focusOutEventListener=this.handleFocusOutEvent.bind(this),this.listen("keydown",this.handleKeydown),this.listen("click",this.handleClick),this.listen("focusin",this.focusInEventListener),this.listen("focusout",this.focusOutEventListener),this.layout(),this.initializeListType(),this.ensureFocusable()},l.prototype.destroy=function(){this.unlisten("keydown",this.handleKeydown),this.unlisten("click",this.handleClick),this.unlisten("focusin",this.focusInEventListener),this.unlisten("focusout",this.focusOutEventListener)},l.prototype.layout=function(){var t=this.root.getAttribute(u.strings.ARIA_ORIENTATION);this.vertical=t!==u.strings.ARIA_ORIENTATION_HORIZONTAL;var e="."+this.classNameMap[u.cssClasses.LIST_ITEM_CLASS]+":not([tabindex])",n=u.strings.FOCUSABLE_CHILD_ELEMENTS,i=this.root.querySelectorAll(e);i.length&&Array.prototype.forEach.call(i,function(t){t.setAttribute("tabindex","-1")});var s=this.root.querySelectorAll(n);s.length&&Array.prototype.forEach.call(s,function(t){t.setAttribute("tabindex","-1")}),this.isEvolutionEnabled&&this.foundation.setUseSelectedAttribute(!0),this.foundation.layout()},l.prototype.getPrimaryText=function(t){var e,n=t.querySelector("."+this.classNameMap[u.cssClasses.LIST_ITEM_PRIMARY_TEXT_CLASS]);if(this.isEvolutionEnabled||n)return null!==(e=null==n?void 0:n.textContent)&&void 0!==e?e:"";var i=t.querySelector("."+this.classNameMap[u.cssClasses.LIST_ITEM_TEXT_CLASS]);return i&&i.textContent||""},l.prototype.initializeListType=function(){var e=this;if(this.isInteractive=a.matches(this.root,u.strings.ARIA_INTERACTIVE_ROLES_SELECTOR),this.isEvolutionEnabled&&this.isInteractive){var t=Array.from(this.root.querySelectorAll(u.strings.SELECTED_ITEM_SELECTOR),function(t){return e.listElements.indexOf(t)});a.matches(this.root,u.strings.ARIA_MULTI_SELECTABLE_SELECTOR)?this.selectedIndex=t:0<t.length&&(this.selectedIndex=t[0])}else{var n=this.root.querySelectorAll(u.strings.ARIA_ROLE_CHECKBOX_SELECTOR),i=this.root.querySelector(u.strings.ARIA_CHECKED_RADIO_SELECTOR);if(n.length){var s=this.root.querySelectorAll(u.strings.ARIA_CHECKED_CHECKBOX_SELECTOR);this.selectedIndex=Array.from(s,function(t){return e.listElements.indexOf(t)})}else i&&(this.selectedIndex=this.listElements.indexOf(i))}},l.prototype.setEnabled=function(t,e){this.foundation.setEnabled(t,e)},l.prototype.typeaheadMatchItem=function(t,e){return this.foundation.typeaheadMatchItem(t,e,!0)},l.prototype.getDefaultFoundation=function(){var s=this,t={addClassForElementIndex:function(t,e){var n=s.listElements[t];n&&n.classList.add(s.classNameMap[e])},focusItemAtIndex:function(t){var e=s.listElements[t];e&&e.focus()},getAttributeForElementIndex:function(t,e){return s.listElements[t].getAttribute(e)},getFocusedElementIndex:function(){return s.listElements.indexOf(document.activeElement)},getListItemCount:function(){return s.listElements.length},getPrimaryTextAtIndex:function(t){return s.getPrimaryText(s.listElements[t])},hasCheckboxAtIndex:function(t){return!!s.listElements[t].querySelector(u.strings.CHECKBOX_SELECTOR)},hasRadioAtIndex:function(t){return!!s.listElements[t].querySelector(u.strings.RADIO_SELECTOR)},isCheckboxCheckedAtIndex:function(t){return s.listElements[t].querySelector(u.strings.CHECKBOX_SELECTOR).checked},isFocusInsideList:function(){return s.root!==document.activeElement&&s.root.contains(document.activeElement)},isRootFocused:function(){return document.activeElement===s.root},listItemAtIndexHasClass:function(t,e){return s.listElements[t].classList.contains(s.classNameMap[e])},notifyAction:function(t){s.emit(u.strings.ACTION_EVENT,{index:t},!0)},notifySelectionChange:function(t){s.emit(u.strings.SELECTION_CHANGE_EVENT,{changedIndices:t},!0)},removeClassForElementIndex:function(t,e){var n=s.listElements[t];n&&n.classList.remove(s.classNameMap[e])},setAttributeForElementIndex:function(t,e,n){var i=s.listElements[t];i&&i.setAttribute(e,n)},setCheckedCheckboxOrRadioAtIndex:function(t,e){var n=s.listElements[t].querySelector(u.strings.CHECKBOX_RADIO_SELECTOR);n.checked=e;var i=document.createEvent("Event");i.initEvent("change",!0,!0),n.dispatchEvent(i)},setTabIndexForListItemChildren:function(t,e){var n=s.listElements[t],i=u.strings.CHILD_ELEMENTS_TO_TOGGLE_TABINDEX;Array.prototype.forEach.call(n.querySelectorAll(i),function(t){t.setAttribute("tabindex",e)})}};return new c.MDCListFoundation(t)},l.prototype.ensureFocusable=function(){if(this.isEvolutionEnabled&&this.isInteractive&&!this.root.querySelector("."+this.classNameMap[u.cssClasses.LIST_ITEM_CLASS]+'[tabindex="0"]')){var t=this.initialFocusIndex();-1!==t&&(this.listElements[t].tabIndex=0)}},l.prototype.initialFocusIndex=function(){if(this.selectedIndex instanceof Array&&0<this.selectedIndex.length)return this.selectedIndex[0];if("number"==typeof this.selectedIndex&&this.selectedIndex!==u.numbers.UNSET_INDEX)return this.selectedIndex;var t=this.root.querySelector("."+this.classNameMap[u.cssClasses.LIST_ITEM_CLASS]+":not(."+this.classNameMap[u.cssClasses.LIST_ITEM_DISABLED_CLASS]+")");return null===t?-1:this.getListItemIndex(t)},l.prototype.getListItemIndex=function(t){var e=a.closest(t,"."+this.classNameMap[u.cssClasses.LIST_ITEM_CLASS]+", ."+this.classNameMap[u.cssClasses.ROOT]);return e&&a.matches(e,"."+this.classNameMap[u.cssClasses.LIST_ITEM_CLASS])?this.listElements.indexOf(e):-1},l.prototype.handleFocusInEvent=function(t){var e=this.getListItemIndex(t.target);this.foundation.handleFocusIn(e)},l.prototype.handleFocusOutEvent=function(t){var e=this.getListItemIndex(t.target);this.foundation.handleFocusOut(e)},l.prototype.handleKeydownEvent=function(t){var e=this.getListItemIndex(t.target),n=t.target;this.foundation.handleKeydown(t,n.classList.contains(this.classNameMap[u.cssClasses.LIST_ITEM_CLASS]),e)},l.prototype.handleClickEvent=function(t){var e=this.getListItemIndex(t.target),n=t.target,i=!a.matches(n,u.strings.CHECKBOX_RADIO_SELECTOR);this.foundation.handleClick(e,i,t)},l);function l(){return null!==o&&o.apply(this,arguments)||this}e.MDCList=d},23:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.handleKeydown=e.clearBuffer=e.isTypingInProgress=e.matchItem=e.initSortedIndex=e.initState=void 0;var E=n(8),c=n(9),m=n(13);function y(t,e){var n,i=t.nextChar,s=t.focusItemAtIndex,o=t.sortedIndexByFirstChar,r=t.focusedItemIndex,a=t.skipFocus,u=t.isItemAtIndexDisabled;return clearTimeout(e.bufferClearTimeout),e.bufferClearTimeout=setTimeout(function(){d(e)},c.numbers.TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS),e.typeaheadBuffer=e.typeaheadBuffer+i,-1===(n=1===e.typeaheadBuffer.length?function(t,e,n,i){var s=i.typeaheadBuffer[0],o=t.get(s);if(!o)return-1;if(s===i.currentFirstChar&&o[i.sortedIndexCursor].index===e){i.sortedIndexCursor=(i.sortedIndexCursor+1)%o.length;var r=o[i.sortedIndexCursor].index;if(!n(r))return r}i.currentFirstChar=s;var a,u=-1;for(a=0;a<o.length;a++)if(!n(o[a].index)){u=a;break}for(;a<o.length;a++)if(o[a].index>e&&!n(o[a].index)){u=a;break}return-1===u?-1:(i.sortedIndexCursor=u,o[i.sortedIndexCursor].index)}(o,r,u,e):function(t,e,n){var i=n.typeaheadBuffer[0],s=t.get(i);if(!s)return-1;var o=s[n.sortedIndexCursor];if(0===o.text.lastIndexOf(n.typeaheadBuffer,0)&&!e(o.index))return o.index;var r=(n.sortedIndexCursor+1)%s.length,a=-1;for(;r!==n.sortedIndexCursor;){var u=s[r],c=0===u.text.lastIndexOf(n.typeaheadBuffer,0),d=!e(u.index);if(c&&d){a=r;break}r=(r+1)%s.length}return-1===a?-1:(n.sortedIndexCursor=a,s[n.sortedIndexCursor].index)}(o,u,e))||a||s(n),n}function C(t){return 0<t.typeaheadBuffer.length}function d(t){t.typeaheadBuffer=""}e.initState=function(){return{bufferClearTimeout:0,currentFirstChar:"",sortedIndexCursor:0,typeaheadBuffer:""}},e.initSortedIndex=function(t,e){for(var n=new Map,i=0;i<t;i++){var s=e(i).trim();if(s){var o=s[0].toLowerCase();n.has(o)||n.set(o,[]),n.get(o).push({text:s.toLowerCase(),index:i})}}return n.forEach(function(t){t.sort(function(t,e){return t.index-e.index})}),n},e.matchItem=y,e.isTypingInProgress=C,e.clearBuffer=d,e.handleKeydown=function(t,e){var n=t.event,i=t.isTargetListItem,s=t.focusedItemIndex,o=t.focusItemAtIndex,r=t.sortedIndexByFirstChar,a=t.isItemAtIndexDisabled,u="ArrowLeft"===E.normalizeKey(n),c="ArrowUp"===E.normalizeKey(n),d="ArrowRight"===E.normalizeKey(n),l="ArrowDown"===E.normalizeKey(n),h="Home"===E.normalizeKey(n),f="End"===E.normalizeKey(n),p="Enter"===E.normalizeKey(n),I="Spacebar"===E.normalizeKey(n);return n.altKey||n.ctrlKey||n.metaKey||u||c||d||l||h||f||p?-1:I||1!==n.key.length?I?(i&&m.preventDefaultEvent(n),i&&C(e)?y({focusItemAtIndex:o,focusedItemIndex:s,nextChar:" ",sortedIndexByFirstChar:r,skipFocus:!1,isItemAtIndexDisabled:a},e):-1):-1:(m.preventDefaultEvent(n),y({focusItemAtIndex:o,focusedItemIndex:s,nextChar:n.key.toLowerCase(),sortedIndexByFirstChar:r,skipFocus:!1,isItemAtIndexDisabled:a},e))}},24:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DefaultFocusState=e.numbers=e.strings=e.cssClasses=void 0;e.cssClasses={MENU_SELECTED_LIST_ITEM:"mdc-menu-item--selected",MENU_SELECTION_GROUP:"mdc-menu__selection-group",ROOT:"mdc-menu"};e.strings={ARIA_CHECKED_ATTR:"aria-checked",ARIA_DISABLED_ATTR:"aria-disabled",CHECKBOX_SELECTOR:'input[type="checkbox"]',LIST_SELECTOR:".mdc-list,.mdc-deprecated-list",SELECTED_EVENT:"MDCMenu:selected",SKIP_RESTORE_FOCUS:"data-menu-item-skip-restore-focus"};var i,s;e.numbers={FOCUS_ROOT_INDEX:-1},(s=i=i||{})[s.NONE=0]="NONE",s[s.LIST_ROOT=1]="LIST_ROOT",s[s.FIRST_ITEM=2]="FIRST_ITEM",s[s.LAST_ITEM=3]="LAST_ITEM",e.DefaultFocusState=i},37:function(t,e,n){"use strict";var i,s=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.MDCMenuSurface=void 0;var o,r=n(1),a=n(11),u=n(16),c=n(10),d=(o=r.MDCComponent,s(l,o),l.attachTo=function(t){return new l(t)},l.prototype.initialSyncWithDOM=function(){var e=this,t=this.root.parentElement;this.anchorElement=t&&t.classList.contains(a.cssClasses.ANCHOR)?t:null,this.root.classList.contains(a.cssClasses.FIXED)&&this.setFixedPosition(!0),this.handleKeydown=function(t){e.foundation.handleKeydown(t)},this.handleBodyClick=function(t){e.foundation.handleBodyClick(t)},this.registerBodyClickListener=function(){document.body.addEventListener("click",e.handleBodyClick,{capture:!0})},this.deregisterBodyClickListener=function(){document.body.removeEventListener("click",e.handleBodyClick,{capture:!0})},this.listen("keydown",this.handleKeydown),this.listen(a.strings.OPENED_EVENT,this.registerBodyClickListener),this.listen(a.strings.CLOSED_EVENT,this.deregisterBodyClickListener)},l.prototype.destroy=function(){this.unlisten("keydown",this.handleKeydown),this.unlisten(a.strings.OPENED_EVENT,this.registerBodyClickListener),this.unlisten(a.strings.CLOSED_EVENT,this.deregisterBodyClickListener),o.prototype.destroy.call(this)},l.prototype.isOpen=function(){return this.foundation.isOpen()},l.prototype.open=function(){this.foundation.open()},l.prototype.close=function(t){void 0===t&&(t=!1),this.foundation.close(t)},Object.defineProperty(l.prototype,"quickOpen",{set:function(t){this.foundation.setQuickOpen(t)},enumerable:!1,configurable:!0}),l.prototype.setIsHoisted=function(t){this.foundation.setIsHoisted(t)},l.prototype.setMenuSurfaceAnchorElement=function(t){this.anchorElement=t},l.prototype.setFixedPosition=function(t){t?this.root.classList.add(a.cssClasses.FIXED):this.root.classList.remove(a.cssClasses.FIXED),this.foundation.setFixedPosition(t)},l.prototype.setAbsolutePosition=function(t,e){this.foundation.setAbsolutePosition(t,e),this.setIsHoisted(!0)},l.prototype.setAnchorCorner=function(t){this.foundation.setAnchorCorner(t)},l.prototype.setAnchorMargin=function(t){this.foundation.setAnchorMargin(t)},l.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)},hasAnchor:function(){return!!n.anchorElement},notifyClose:function(){return n.emit(u.MDCMenuSurfaceFoundation.strings.CLOSED_EVENT,{})},notifyClosing:function(){n.emit(u.MDCMenuSurfaceFoundation.strings.CLOSING_EVENT,{})},notifyOpen:function(){return n.emit(u.MDCMenuSurfaceFoundation.strings.OPENED_EVENT,{})},notifyOpening:function(){return n.emit(u.MDCMenuSurfaceFoundation.strings.OPENING_EVENT,{})},isElementInContainer:function(t){return n.root.contains(t)},isRtl:function(){return"rtl"===getComputedStyle(n.root).getPropertyValue("direction")},setTransformOrigin:function(t){var e=c.getCorrectPropertyName(window,"transform")+"-origin";n.root.style.setProperty(e,t)},isFocused:function(){return document.activeElement===n.root},saveFocus:function(){n.previousFocus=document.activeElement},restoreFocus:function(){n.root.contains(document.activeElement)&&n.previousFocus&&n.previousFocus.focus&&n.previousFocus.focus()},getInnerDimensions:function(){return{width:n.root.offsetWidth,height:n.root.offsetHeight}},getAnchorDimensions:function(){return n.anch