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K,KAAQuU,eAAgB,CAC3ElZ,MAAOiZ,EAAQjZ,MACfmZ,KAAMvX,EAAM+W,MAAMM,EAAQjZ,QAC1B,EACJ6W,iBAAkB,WAAc,OAAOjV,EAAM+W,MAAMtW,MAAQ,EAC3DqB,iBAAkB,SAAU1D,GAAS,OAAO4B,EAAM+W,MAAM3Y,GAAO2D,OAAS,EACxEmT,cAAe,WAAc,OAAOlV,EAAMnC,MAAMuC,cAAc,KAAQuW,eAAe5U,OAAS,EAC9FqT,wBAAyB,SAAUhX,GAAS,SAAS,OAAQ4B,EAAM+W,MAAM3Y,GAAQ,IAAM,KAAWoZ,qBAAuB,EACzHrC,gCAAiC,SAAU/W,GACvC,IACIqZ,GADmB,OAAQzX,EAAM+W,MAAM3Y,GAAQ,IAAM,KAAWoZ,sBAC9BpX,cAAc,IAAM,KAAW4V,yBACrE,OAAOyB,EAAiBzX,EAAM+W,MAAM/V,QAAQyW,IAAmB,CACnE,GAIR,EACOtB,CACX,CAlM4B,CAkM1B,kEC3MF,IAeIuB,EAfA/S,EAAa,CACbqR,wBAAyB,0BACzBwB,qBAAsB,4BACtBnT,KAAM,YAENQ,EAAU,CACVkR,kBAAmB,eACnBE,mBAAoB,gBACpB1T,kBAAmB,yBACnBoU,cAAe,YACfW,eAAgB,oBAEhBpS,EAAU,CACVyS,kBAAmB,IAGvB,SAAWD,GACPA,EAAkBA,EAAwB,KAAI,GAAK,OACnDA,EAAkBA,EAA6B,UAAI,GAAK,YACxDA,EAAkBA,EAA8B,WAAI,GAAK,aACzDA,EAAkBA,EAA6B,UAAI,GAAK,WAC3D,CALD,CAKGA,IAAsBA,EAAoB,CAAC","sources":["webpack://ch.enlightware.gamecreator/./node_modules/@material/list/component.js","webpack://ch.enlightware.gamecreator/./node_modules/@material/list/constants.js","webpack://ch.enlightware.gamecreator/./node_modules/@material/list/foundation.js","webpack://ch.enlightware.gamecreator/./node_modules/@material/menu-surface/constants.js","webpack://ch.enlightware.gamecreator/./node_modules/@material/menu-surface/foundation.js","webpack://ch.enlightware.gamecreator/./node_modules/@material/menu-surface/util.js","webpack://ch.enlightware.gamecreator/./node_modules/@material/menu-surface/component.js","webpack://ch.enlightware.gamecreator/./node_modules/@material/menu/foundation.js","webpack://ch.enlightware.gamecreator/./node_modules/@material/menu/component.js","webpack://ch.enlightware.gamecreator/./node_modules/@material/menu/constants.js"],"sourcesContent":["/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport * as tslib_1 from \"tslib\";\nimport { MDCComponent } from '@material/base/component';\nimport { closest, matches } from '@material/dom/ponyfill';\nimport { cssClasses, strings } from './constants';\nimport { MDCListFoundation } from './foundation';\nvar MDCList = /** @class */ (function (_super) {\n tslib_1.__extends(MDCList, _super);\n function MDCList() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(MDCList.prototype, \"vertical\", {\n set: function (value) {\n this.foundation_.setVerticalOrientation(value);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MDCList.prototype, \"listElements\", {\n get: function () {\n return [].slice.call(this.root_.querySelectorAll(\".\" + cssClasses.LIST_ITEM_CLASS));\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MDCList.prototype, \"wrapFocus\", {\n set: function (value) {\n this.foundation_.setWrapFocus(value);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MDCList.prototype, \"singleSelection\", {\n set: function (isSingleSelectionList) {\n this.foundation_.setSingleSelection(isSingleSelectionList);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MDCList.prototype, \"selectedIndex\", {\n get: function () {\n return this.foundation_.getSelectedIndex();\n },\n set: function (index) {\n this.foundation_.setSelectedIndex(index);\n },\n enumerable: true,\n configurable: true\n });\n MDCList.attachTo = function (root) {\n return new MDCList(root);\n };\n MDCList.prototype.initialSyncWithDOM = function () {\n this.handleClick_ = this.handleClickEvent_.bind(this);\n this.handleKeydown_ = this.handleKeydownEvent_.bind(this);\n this.focusInEventListener_ = this.handleFocusInEvent_.bind(this);\n this.focusOutEventListener_ = this.handleFocusOutEvent_.bind(this);\n this.listen('keydown', this.handleKeydown_);\n this.listen('click', this.handleClick_);\n this.listen('focusin', this.focusInEventListener_);\n this.listen('focusout', this.focusOutEventListener_);\n this.layout();\n this.initializeListType();\n };\n MDCList.prototype.destroy = function () {\n this.unlisten('keydown', this.handleKeydown_);\n this.unlisten('click', this.handleClick_);\n this.unlisten('focusin', this.focusInEventListener_);\n this.unlisten('focusout', this.focusOutEventListener_);\n };\n MDCList.prototype.layout = function () {\n var direction = this.root_.getAttribute(strings.ARIA_ORIENTATION);\n this.vertical = direction !== strings.ARIA_ORIENTATION_HORIZONTAL;\n // List items need to have at least tabindex=-1 to be focusable.\n [].slice.call(this.root_.querySelectorAll('.mdc-list-item:not([tabindex])'))\n .forEach(function (el) {\n el.setAttribute('tabindex', '-1');\n });\n // Child button/a elements are not tabbable until the list item is focused.\n [].slice.call(this.root_.querySelectorAll(strings.FOCUSABLE_CHILD_ELEMENTS))\n .forEach(function (el) { return el.setAttribute('tabindex', '-1'); });\n this.foundation_.layout();\n };\n /**\n * Initialize selectedIndex value based on pre-selected checkbox list items, single selection or radio.\n */\n MDCList.prototype.initializeListType = function () {\n var _this = this;\n var checkboxListItems = this.root_.querySelectorAll(strings.ARIA_ROLE_CHECKBOX_SELECTOR);\n var singleSelectedListItem = this.root_.querySelector(\"\\n .\" + cssClasses.LIST_ITEM_ACTIVATED_CLASS + \",\\n .\" + cssClasses.LIST_ITEM_SELECTED_CLASS + \"\\n \");\n var radioSelectedListItem = this.root_.querySelector(strings.ARIA_CHECKED_RADIO_SELECTOR);\n if (checkboxListItems.length) {\n var preselectedItems = this.root_.querySelectorAll(strings.ARIA_CHECKED_CHECKBOX_SELECTOR);\n this.selectedIndex =\n [].map.call(preselectedItems, function (listItem) { return _this.listElements.indexOf(listItem); });\n }\n else if (singleSelectedListItem) {\n if (singleSelectedListItem.classList.contains(cssClasses.LIST_ITEM_ACTIVATED_CLASS)) {\n this.foundation_.setUseActivatedClass(true);\n }\n this.singleSelection = true;\n this.selectedIndex = this.listElements.indexOf(singleSelectedListItem);\n }\n else if (radioSelectedListItem) {\n this.selectedIndex = this.listElements.indexOf(radioSelectedListItem);\n }\n };\n /**\n * Updates the list item at itemIndex to the desired isEnabled state.\n * @param itemIndex Index of the list item\n * @param isEnabled Sets the list item to enabled or disabled.\n */\n MDCList.prototype.setEnabled = function (itemIndex, isEnabled) {\n this.foundation_.setEnabled(itemIndex, isEnabled);\n };\n MDCList.prototype.getDefaultFoundation = function () {\n var _this = this;\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n var adapter = {\n addClassForElementIndex: function (index, className) {\n var element = _this.listElements[index];\n if (element) {\n element.classList.add(className);\n }\n },\n focusItemAtIndex: function (index) {\n var element = _this.listElements[index];\n if (element) {\n element.focus();\n }\n },\n getAttributeForElementIndex: function (index, attr) { return _this.listElements[index].getAttribute(attr); },\n getFocusedElementIndex: function () { return _this.listElements.indexOf(document.activeElement); },\n getListItemCount: function () { return _this.listElements.length; },\n hasCheckboxAtIndex: function (index) {\n var listItem = _this.listElements[index];\n return !!listItem.querySelector(strings.CHECKBOX_SELECTOR);\n },\n hasRadioAtIndex: function (index) {\n var listItem = _this.listElements[index];\n return !!listItem.querySelector(strings.RADIO_SELECTOR);\n },\n isCheckboxCheckedAtIndex: function (index) {\n var listItem = _this.listElements[index];\n var toggleEl = listItem.querySelector(strings.CHECKBOX_SELECTOR);\n return toggleEl.checked;\n },\n isFocusInsideList: function () {\n return _this.root_.contains(document.activeElement);\n },\n isRootFocused: function () { return document.activeElement === _this.root_; },\n notifyAction: function (index) {\n _this.emit(strings.ACTION_EVENT, { index: index }, /** shouldBubble */ true);\n },\n removeClassForElementIndex: function (index, className) {\n var element = _this.listElements[index];\n if (element) {\n element.classList.remove(className);\n }\n },\n setAttributeForElementIndex: function (index, attr, value) {\n var element = _this.listElements[index];\n if (element) {\n element.setAttribute(attr, value);\n }\n },\n setCheckedCheckboxOrRadioAtIndex: function (index, isChecked) {\n var listItem = _this.listElements[index];\n var toggleEl = listItem.querySelector(strings.CHECKBOX_RADIO_SELECTOR);\n toggleEl.checked = isChecked;\n var event = document.createEvent('Event');\n event.initEvent('change', true, true);\n toggleEl.dispatchEvent(event);\n },\n setTabIndexForListItemChildren: function (listItemIndex, tabIndexValue) {\n var element = _this.listElements[listItemIndex];\n var listItemChildren = [].slice.call(element.querySelectorAll(strings.CHILD_ELEMENTS_TO_TOGGLE_TABINDEX));\n listItemChildren.forEach(function (el) { return el.setAttribute('tabindex', tabIndexValue); });\n },\n };\n return new MDCListFoundation(adapter);\n };\n /**\n * Used to figure out which list item this event is targetting. Or returns -1 if\n * there is no list item\n */\n MDCList.prototype.getListItemIndex_ = function (evt) {\n var eventTarget = evt.target;\n var nearestParent = closest(eventTarget, \".\" + cssClasses.LIST_ITEM_CLASS + \", .\" + cssClasses.ROOT);\n // Get the index of the element if it is a list item.\n if (nearestParent && matches(nearestParent, \".\" + cssClasses.LIST_ITEM_CLASS)) {\n return this.listElements.indexOf(nearestParent);\n }\n return -1;\n };\n /**\n * Used to figure out which element was clicked before sending the event to the foundation.\n */\n MDCList.prototype.handleFocusInEvent_ = function (evt) {\n var index = this.getListItemIndex_(evt);\n this.foundation_.handleFocusIn(evt, index);\n };\n /**\n * Used to figure out which element was clicked before sending the event to the foundation.\n */\n MDCList.prototype.handleFocusOutEvent_ = function (evt) {\n var index = this.getListItemIndex_(evt);\n this.foundation_.handleFocusOut(evt, index);\n };\n /**\n * Used to figure out which element was focused when keydown event occurred before sending the event to the\n * foundation.\n */\n MDCList.prototype.handleKeydownEvent_ = function (evt) {\n var index = this.getListItemIndex_(evt);\n var target = evt.target;\n this.foundation_.handleKeydown(evt, target.classList.contains(cssClasses.LIST_ITEM_CLASS), index);\n };\n /**\n * Used to figure out which element was clicked before sending the event to the foundation.\n */\n MDCList.prototype.handleClickEvent_ = function (evt) {\n var index = this.getListItemIndex_(evt);\n var target = evt.target;\n // Toggle the checkbox only if it's not the target of the event, or the checkbox will have 2 change events.\n var toggleCheckbox = !matches(target, strings.CHECKBOX_RADIO_SELECTOR);\n this.foundation_.handleClick(index, toggleCheckbox);\n };\n return MDCList;\n}(MDCComponent));\nexport { MDCList };\n//# sourceMappingURL=component.js.map","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nvar cssClasses = {\n LIST_ITEM_ACTIVATED_CLASS: 'mdc-list-item--activated',\n LIST_ITEM_CLASS: 'mdc-list-item',\n LIST_ITEM_DISABLED_CLASS: 'mdc-list-item--disabled',\n LIST_ITEM_SELECTED_CLASS: 'mdc-list-item--selected',\n ROOT: 'mdc-list',\n};\nvar strings = {\n ACTION_EVENT: 'MDCList:action',\n ARIA_CHECKED: 'aria-checked',\n ARIA_CHECKED_CHECKBOX_SELECTOR: '[role=\"checkbox\"][aria-checked=\"true\"]',\n ARIA_CHECKED_RADIO_SELECTOR: '[role=\"radio\"][aria-checked=\"true\"]',\n ARIA_CURRENT: 'aria-current',\n ARIA_DISABLED: 'aria-disabled',\n ARIA_ORIENTATION: 'aria-orientation',\n ARIA_ORIENTATION_HORIZONTAL: 'horizontal',\n ARIA_ROLE_CHECKBOX_SELECTOR: '[role=\"checkbox\"]',\n ARIA_SELECTED: 'aria-selected',\n CHECKBOX_RADIO_SELECTOR: 'input[type=\"checkbox\"]:not(:disabled), input[type=\"radio\"]:not(:disabled)',\n CHECKBOX_SELECTOR: 'input[type=\"checkbox\"]:not(:disabled)',\n CHILD_ELEMENTS_TO_TOGGLE_TABINDEX: \"\\n .\" + cssClasses.LIST_ITEM_CLASS + \" button:not(:disabled),\\n .\" + cssClasses.LIST_ITEM_CLASS + \" a\\n \",\n FOCUSABLE_CHILD_ELEMENTS: \"\\n .\" + cssClasses.LIST_ITEM_CLASS + \" button:not(:disabled),\\n .\" + cssClasses.LIST_ITEM_CLASS + \" a,\\n .\" + cssClasses.LIST_ITEM_CLASS + \" input[type=\\\"radio\\\"]:not(:disabled),\\n .\" + cssClasses.LIST_ITEM_CLASS + \" input[type=\\\"checkbox\\\"]:not(:disabled)\\n \",\n RADIO_SELECTOR: 'input[type=\"radio\"]:not(:disabled)',\n};\nvar numbers = {\n UNSET_INDEX: -1,\n};\nexport { strings, cssClasses, numbers };\n//# sourceMappingURL=constants.js.map","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport * as tslib_1 from \"tslib\";\nimport { MDCFoundation } from '@material/base/foundation';\nimport { cssClasses, numbers, strings } from './constants';\nvar ELEMENTS_KEY_ALLOWED_IN = ['input', 'button', 'textarea', 'select'];\nfunction isNumberArray(selectedIndex) {\n return selectedIndex instanceof Array;\n}\nvar MDCListFoundation = /** @class */ (function (_super) {\n tslib_1.__extends(MDCListFoundation, _super);\n function MDCListFoundation(adapter) {\n var _this = _super.call(this, tslib_1.__assign({}, MDCListFoundation.defaultAdapter, adapter)) || this;\n _this.wrapFocus_ = false;\n _this.isVertical_ = true;\n _this.isSingleSelectionList_ = false;\n _this.selectedIndex_ = numbers.UNSET_INDEX;\n _this.focusedItemIndex_ = numbers.UNSET_INDEX;\n _this.useActivatedClass_ = false;\n _this.ariaCurrentAttrValue_ = null;\n _this.isCheckboxList_ = false;\n _this.isRadioList_ = false;\n return _this;\n }\n Object.defineProperty(MDCListFoundation, \"strings\", {\n get: function () {\n return strings;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MDCListFoundation, \"cssClasses\", {\n get: function () {\n return cssClasses;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MDCListFoundation, \"numbers\", {\n get: function () {\n return numbers;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MDCListFoundation, \"defaultAdapter\", {\n get: function () {\n return {\n addClassForElementIndex: function () { return undefined; },\n focusItemAtIndex: function () { return undefined; },\n getAttributeForElementIndex: function () { return null; },\n getFocusedElementIndex: function () { return 0; },\n getListItemCount: function () { return 0; },\n hasCheckboxAtIndex: function () { return false; },\n hasRadioAtIndex: function () { return false; },\n isCheckboxCheckedAtIndex: function () { return false; },\n isFocusInsideList: function () { return false; },\n isRootFocused: function () { return false; },\n notifyAction: function () { return undefined; },\n removeClassForElementIndex: function () { return undefined; },\n setAttributeForElementIndex: function () { return undefined; },\n setCheckedCheckboxOrRadioAtIndex: function () { return undefined; },\n setTabIndexForListItemChildren: function () { return undefined; },\n };\n },\n enumerable: true,\n configurable: true\n });\n MDCListFoundation.prototype.layout = function () {\n if (this.adapter_.getListItemCount() === 0) {\n return;\n }\n if (this.adapter_.hasCheckboxAtIndex(0)) {\n this.isCheckboxList_ = true;\n }\n else if (this.adapter_.hasRadioAtIndex(0)) {\n this.isRadioList_ = true;\n }\n };\n /**\n * Sets the private wrapFocus_ variable.\n */\n MDCListFoundation.prototype.setWrapFocus = function (value) {\n this.wrapFocus_ = value;\n };\n /**\n * Sets the isVertical_ private variable.\n */\n MDCListFoundation.prototype.setVerticalOrientation = function (value) {\n this.isVertical_ = value;\n };\n /**\n * Sets the isSingleSelectionList_ private variable.\n */\n MDCListFoundation.prototype.setSingleSelection = function (value) {\n this.isSingleSelectionList_ = value;\n };\n /**\n * Sets the useActivatedClass_ private variable.\n */\n MDCListFoundation.prototype.setUseActivatedClass = function (useActivated) {\n this.useActivatedClass_ = useActivated;\n };\n MDCListFoundation.prototype.getSelectedIndex = function () {\n return this.selectedIndex_;\n };\n MDCListFoundation.prototype.setSelectedIndex = function (index) {\n if (!this.isIndexValid_(index)) {\n return;\n }\n if (this.isCheckboxList_) {\n this.setCheckboxAtIndex_(index);\n }\n else if (this.isRadioList_) {\n this.setRadioAtIndex_(index);\n }\n else {\n this.setSingleSelectionAtIndex_(index);\n }\n };\n /**\n * Focus in handler for the list items.\n */\n MDCListFoundation.prototype.handleFocusIn = function (_, listItemIndex) {\n if (listItemIndex >= 0) {\n this.adapter_.setTabIndexForListItemChildren(listItemIndex, '0');\n }\n };\n /**\n * Focus out handler for the list items.\n */\n MDCListFoundation.prototype.handleFocusOut = function (_, listItemIndex) {\n var _this = this;\n if (listItemIndex >= 0) {\n this.adapter_.setTabIndexForListItemChildren(listItemIndex, '-1');\n }\n /**\n * Between Focusout & Focusin some browsers do not have focus on any element. Setting a delay to wait till the focus\n * is moved to next element.\n */\n setTimeout(function () {\n if (!_this.adapter_.isFocusInsideList()) {\n _this.setTabindexToFirstSelectedItem_();\n }\n }, 0);\n };\n /**\n * Key handler for the list.\n */\n MDCListFoundation.prototype.handleKeydown = function (evt, isRootListItem, listItemIndex) {\n var isArrowLeft = evt.key === 'ArrowLeft' || evt.keyCode === 37;\n var isArrowUp = evt.key === 'ArrowUp' || evt.keyCode === 38;\n var isArrowRight = evt.key === 'ArrowRight' || evt.keyCode === 39;\n var isArrowDown = evt.key === 'ArrowDown' || evt.keyCode === 40;\n var isHome = evt.key === 'Home' || evt.keyCode === 36;\n var isEnd = evt.key === 'End' || evt.keyCode === 35;\n var isEnter = evt.key === 'Enter' || evt.keyCode === 13;\n var isSpace = evt.key === 'Space' || evt.keyCode === 32;\n if (this.adapter_.isRootFocused()) {\n if (isArrowUp || isEnd) {\n evt.preventDefault();\n this.focusLastElement();\n }\n else if (isArrowDown || isHome) {\n evt.preventDefault();\n this.focusFirstElement();\n }\n return;\n }\n var currentIndex = this.adapter_.getFocusedElementIndex();\n if (currentIndex === -1) {\n currentIndex = listItemIndex;\n if (currentIndex < 0) {\n // If this event doesn't have a mdc-list-item ancestor from the\n // current list (not from a sublist), return early.\n return;\n }\n }\n var nextIndex;\n if ((this.isVertical_ && isArrowDown) || (!this.isVertical_ && isArrowRight)) {\n this.preventDefaultEvent_(evt);\n nextIndex = this.focusNextElement(currentIndex);\n }\n else if ((this.isVertical_ && isArrowUp) || (!this.isVertical_ && isArrowLeft)) {\n this.preventDefaultEvent_(evt);\n nextIndex = this.focusPrevElement(currentIndex);\n }\n else if (isHome) {\n this.preventDefaultEvent_(evt);\n nextIndex = this.focusFirstElement();\n }\n else if (isEnd) {\n this.preventDefaultEvent_(evt);\n nextIndex = this.focusLastElement();\n }\n else if (isEnter || isSpace) {\n if (isRootListItem) {\n // Return early if enter key is pressed on anchor element which triggers synthetic MouseEvent event.\n var target = evt.target;\n if (target && target.tagName === 'A' && isEnter) {\n return;\n }\n this.preventDefaultEvent_(evt);\n if (this.isSelectableList_()) {\n this.setSelectedIndexOnAction_(currentIndex);\n }\n this.adapter_.notifyAction(currentIndex);\n }\n }\n this.focusedItemIndex_ = currentIndex;\n if (nextIndex !== undefined) {\n this.setTabindexAtIndex_(nextIndex);\n this.focusedItemIndex_ = nextIndex;\n }\n };\n /**\n * Click handler for the list.\n */\n MDCListFoundation.prototype.handleClick = function (index, toggleCheckbox) {\n if (index === numbers.UNSET_INDEX) {\n return;\n }\n if (this.isSelectableList_()) {\n this.setSelectedIndexOnAction_(index, toggleCheckbox);\n }\n this.adapter_.notifyAction(index);\n this.setTabindexAtIndex_(index);\n this.focusedItemIndex_ = index;\n };\n /**\n * Focuses the next element on the list.\n */\n MDCListFoundation.prototype.focusNextElement = function (index) {\n var count = this.adapter_.getListItemCount();\n var nextIndex = index + 1;\n if (nextIndex >= count) {\n if (this.wrapFocus_) {\n nextIndex = 0;\n }\n else {\n // Return early because last item is already focused.\n return index;\n }\n }\n this.adapter_.focusItemAtIndex(nextIndex);\n return nextIndex;\n };\n /**\n * Focuses the previous element on the list.\n */\n MDCListFoundation.prototype.focusPrevElement = function (index) {\n var prevIndex = index - 1;\n if (prevIndex < 0) {\n if (this.wrapFocus_) {\n prevIndex = this.adapter_.getListItemCount() - 1;\n }\n else {\n // Return early because first item is already focused.\n return index;\n }\n }\n this.adapter_.focusItemAtIndex(prevIndex);\n return prevIndex;\n };\n MDCListFoundation.prototype.focusFirstElement = function () {\n this.adapter_.focusItemAtIndex(0);\n return 0;\n };\n MDCListFoundation.prototype.focusLastElement = function () {\n var lastIndex = this.adapter_.getListItemCount() - 1;\n this.adapter_.focusItemAtIndex(lastIndex);\n return lastIndex;\n };\n /**\n * @param itemIndex Index of the list item\n * @param isEnabled Sets the list item to enabled or disabled.\n */\n MDCListFoundation.prototype.setEnabled = function (itemIndex, isEnabled) {\n if (!this.isIndexValid_(itemIndex)) {\n return;\n }\n if (isEnabled) {\n this.adapter_.removeClassForElementIndex(itemIndex, cssClasses.LIST_ITEM_DISABLED_CLASS);\n this.adapter_.setAttributeForElementIndex(itemIndex, strings.ARIA_DISABLED, 'false');\n }\n else {\n this.adapter_.addClassForElementIndex(itemIndex, cssClasses.LIST_ITEM_DISABLED_CLASS);\n this.adapter_.setAttributeForElementIndex(itemIndex, strings.ARIA_DISABLED, 'true');\n }\n };\n /**\n * Ensures that preventDefault is only called if the containing element doesn't\n * consume the event, and it will cause an unintended scroll.\n */\n MDCListFoundation.prototype.preventDefaultEvent_ = function (evt) {\n var target = evt.target;\n var tagName = (\"\" + target.tagName).toLowerCase();\n if (ELEMENTS_KEY_ALLOWED_IN.indexOf(tagName) === -1) {\n evt.preventDefault();\n }\n };\n MDCListFoundation.prototype.setSingleSelectionAtIndex_ = function (index) {\n if (this.selectedIndex_ === index) {\n return;\n }\n var selectedClassName = cssClasses.LIST_ITEM_SELECTED_CLASS;\n if (this.useActivatedClass_) {\n selectedClassName = cssClasses.LIST_ITEM_ACTIVATED_CLASS;\n }\n if (this.selectedIndex_ !== numbers.UNSET_INDEX) {\n this.adapter_.removeClassForElementIndex(this.selectedIndex_, selectedClassName);\n }\n this.adapter_.addClassForElementIndex(index, selectedClassName);\n this.setAriaForSingleSelectionAtIndex_(index);\n this.selectedIndex_ = index;\n };\n /**\n * Sets aria attribute for single selection at given index.\n */\n MDCListFoundation.prototype.setAriaForSingleSelectionAtIndex_ = function (index) {\n // Detect the presence of aria-current and get the value only during list initialization when it is in unset state.\n if (this.selectedIndex_ === numbers.UNSET_INDEX) {\n this.ariaCurrentAttrValue_ =\n this.adapter_.getAttributeForElementIndex(index, strings.ARIA_CURRENT);\n }\n var isAriaCurrent = this.ariaCurrentAttrValue_ !== null;\n var ariaAttribute = isAriaCurrent ? strings.ARIA_CURRENT : strings.ARIA_SELECTED;\n if (this.selectedIndex_ !== numbers.UNSET_INDEX) {\n this.adapter_.setAttributeForElementIndex(this.selectedIndex_, ariaAttribute, 'false');\n }\n var ariaAttributeValue = isAriaCurrent ? this.ariaCurrentAttrValue_ : 'true';\n this.adapter_.setAttributeForElementIndex(index, ariaAttribute, ariaAttributeValue);\n };\n /**\n * Toggles radio at give index. Radio doesn't change the checked state if it is already checked.\n */\n MDCListFoundation.prototype.setRadioAtIndex_ = function (index) {\n this.adapter_.setCheckedCheckboxOrRadioAtIndex(index, true);\n if (this.selectedIndex_ !== numbers.UNSET_INDEX) {\n this.adapter_.setAttributeForElementIndex(this.selectedIndex_, strings.ARIA_CHECKED, 'false');\n }\n this.adapter_.setAttributeForElementIndex(index, strings.ARIA_CHECKED, 'true');\n this.selectedIndex_ = index;\n };\n MDCListFoundation.prototype.setCheckboxAtIndex_ = function (index) {\n for (var i = 0; i < this.adapter_.getListItemCount(); i++) {\n var isChecked = false;\n if (index.indexOf(i) >= 0) {\n isChecked = true;\n }\n this.adapter_.setCheckedCheckboxOrRadioAtIndex(i, isChecked);\n this.adapter_.setAttributeForElementIndex(i, strings.ARIA_CHECKED, isChecked ? 'true' : 'false');\n }\n this.selectedIndex_ = index;\n };\n MDCListFoundation.prototype.setTabindexAtIndex_ = function (index) {\n if (this.focusedItemIndex_ === numbers.UNSET_INDEX && index !== 0) {\n // If no list item was selected set first list item's tabindex to -1.\n // Generally, tabindex is set to 0 on first list item of list that has no preselected items.\n this.adapter_.setAttributeForElementIndex(0, 'tabindex', '-1');\n }\n else if (this.focusedItemIndex_ >= 0 && this.focusedItemIndex_ !== index) {\n this.adapter_.setAttributeForElementIndex(this.focusedItemIndex_, 'tabindex', '-1');\n }\n this.adapter_.setAttributeForElementIndex(index, 'tabindex', '0');\n };\n /**\n * @return Return true if it is single selectin list, checkbox list or radio list.\n */\n MDCListFoundation.prototype.isSelectableList_ = function () {\n return this.isSingleSelectionList_ || this.isCheckboxList_ || this.isRadioList_;\n };\n MDCListFoundation.prototype.setTabindexToFirstSelectedItem_ = function () {\n var targetIndex = 0;\n if (this.isSelectableList_()) {\n if (typeof this.selectedIndex_ === 'number' && this.selectedIndex_ !== numbers.UNSET_INDEX) {\n targetIndex = this.selectedIndex_;\n }\n else if (isNumberArray(this.selectedIndex_) && this.selectedIndex_.length > 0) {\n targetIndex = this.selectedIndex_.reduce(function (currentIndex, minIndex) { return Math.min(currentIndex, minIndex); });\n }\n }\n this.setTabindexAtIndex_(targetIndex);\n };\n MDCListFoundation.prototype.isIndexValid_ = function (index) {\n var _this = this;\n if (index instanceof Array) {\n if (!this.isCheckboxList_) {\n throw new Error('MDCListFoundation: Array of index is only supported for checkbox based list');\n }\n if (index.length === 0) {\n return true;\n }\n else {\n return index.some(function (i) { return _this.isIndexInRange_(i); });\n }\n }\n else if (typeof index === 'number') {\n if (this.isCheckboxList_) {\n throw new Error('MDCListFoundation: Expected array of index for checkbox based list but got number: ' + index);\n }\n return this.isIndexInRange_(index);\n }\n else {\n return false;\n }\n };\n MDCListFoundation.prototype.isIndexInRange_ = function (index) {\n var listSize = this.adapter_.getListItemCount();\n return index >= 0 && index < listSize;\n };\n MDCListFoundation.prototype.setSelectedIndexOnAction_ = function (index, toggleCheckbox) {\n if (toggleCheckbox === void 0) { toggleCheckbox = true; }\n if (this.isCheckboxList_) {\n this.toggleCheckboxAtIndex_(index, toggleCheckbox);\n }\n else {\n this.setSelectedIndex(index);\n }\n };\n MDCListFoundation.prototype.toggleCheckboxAtIndex_ = function (index, toggleCheckbox) {\n var isChecked = this.adapter_.isCheckboxCheckedAtIndex(index);\n if (toggleCheckbox) {\n isChecked = !isChecked;\n this.adapter_.setCheckedCheckboxOrRadioAtIndex(index, isChecked);\n }\n this.adapter_.setAttributeForElementIndex(index, strings.ARIA_CHECKED, isChecked ? 'true' : 'false');\n // If none of the checkbox items are selected and selectedIndex is not initialized then provide a default value.\n var selectedIndexes = this.selectedIndex_ === numbers.UNSET_INDEX ? [] : this.selectedIndex_.slice();\n if (isChecked) {\n selectedIndexes.push(index);\n }\n else {\n selectedIndexes = selectedIndexes.filter(function (i) { return i !== index; });\n }\n this.selectedIndex_ = selectedIndexes;\n };\n return MDCListFoundation;\n}(MDCFoundation));\nexport { MDCListFoundation };\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCListFoundation;\n//# sourceMappingURL=foundation.js.map","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nvar cssClasses = {\n ANCHOR: 'mdc-menu-surface--anchor',\n ANIMATING_CLOSED: 'mdc-menu-surface--animating-closed',\n ANIMATING_OPEN: 'mdc-menu-surface--animating-open',\n FIXED: 'mdc-menu-surface--fixed',\n OPEN: 'mdc-menu-surface--open',\n ROOT: 'mdc-menu-surface',\n};\n// tslint:disable:object-literal-sort-keys\nvar strings = {\n CLOSED_EVENT: 'MDCMenuSurface:closed',\n OPENED_EVENT: 'MDCMenuSurface:opened',\n FOCUSABLE_ELEMENTS: [\n 'button:not(:disabled)', '[href]:not([aria-disabled=\"true\"])', 'input:not(:disabled)',\n 'select:not(:disabled)', 'textarea:not(:disabled)', '[tabindex]:not([tabindex=\"-1\"]):not([aria-disabled=\"true\"])',\n ].join(', '),\n};\n// tslint:enable:object-literal-sort-keys\nvar numbers = {\n /** Total duration of menu-surface open animation. */\n TRANSITION_OPEN_DURATION: 120,\n /** Total duration of menu-surface close animation. */\n TRANSITION_CLOSE_DURATION: 75,\n /** Margin left to the edge of the viewport when menu-surface is at maximum possible height. */\n MARGIN_TO_EDGE: 32,\n /** Ratio of anchor width to menu-surface width for switching from corner positioning to center positioning. */\n ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO: 0.67,\n};\n/**\n * Enum for bits in the {@see Corner) bitmap.\n */\nvar CornerBit;\n(function (CornerBit) {\n CornerBit[CornerBit[\"BOTTOM\"] = 1] = \"BOTTOM\";\n CornerBit[CornerBit[\"CENTER\"] = 2] = \"CENTER\";\n CornerBit[CornerBit[\"RIGHT\"] = 4] = \"RIGHT\";\n CornerBit[CornerBit[\"FLIP_RTL\"] = 8] = \"FLIP_RTL\";\n})(CornerBit || (CornerBit = {}));\n/**\n * Enum for representing an element corner for positioning the menu-surface.\n *\n * The START constants map to LEFT if element directionality is left\n * to right and RIGHT if the directionality is right to left.\n * Likewise END maps to RIGHT or LEFT depending on the directionality.\n */\nvar Corner;\n(function (Corner) {\n Corner[Corner[\"TOP_LEFT\"] = 0] = \"TOP_LEFT\";\n Corner[Corner[\"TOP_RIGHT\"] = 4] = \"TOP_RIGHT\";\n Corner[Corner[\"BOTTOM_LEFT\"] = 1] = \"BOTTOM_LEFT\";\n Corner[Corner[\"BOTTOM_RIGHT\"] = 5] = \"BOTTOM_RIGHT\";\n Corner[Corner[\"TOP_START\"] = 8] = \"TOP_START\";\n Corner[Corner[\"TOP_END\"] = 12] = \"TOP_END\";\n Corner[Corner[\"BOTTOM_START\"] = 9] = \"BOTTOM_START\";\n Corner[Corner[\"BOTTOM_END\"] = 13] = \"BOTTOM_END\";\n})(Corner || (Corner = {}));\nexport { cssClasses, strings, numbers, CornerBit, Corner };\n//# sourceMappingURL=constants.js.map","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport * as tslib_1 from \"tslib\";\nimport { MDCFoundation } from '@material/base/foundation';\nimport { Corner, CornerBit, cssClasses, numbers, strings } from './constants';\nvar MDCMenuSurfaceFoundation = /** @class */ (function (_super) {\n tslib_1.__extends(MDCMenuSurfaceFoundation, _super);\n function MDCMenuSurfaceFoundation(adapter) {\n var _this = _super.call(this, tslib_1.__assign({}, MDCMenuSurfaceFoundation.defaultAdapter, adapter)) || this;\n _this.isOpen_ = false;\n _this.isQuickOpen_ = false;\n _this.isHoistedElement_ = false;\n _this.isFixedPosition_ = false;\n _this.openAnimationEndTimerId_ = 0;\n _this.closeAnimationEndTimerId_ = 0;\n _this.animationRequestId_ = 0;\n _this.anchorCorner_ = Corner.TOP_START;\n _this.anchorMargin_ = { top: 0, right: 0, bottom: 0, left: 0 };\n _this.position_ = { x: 0, y: 0 };\n return _this;\n }\n Object.defineProperty(MDCMenuSurfaceFoundation, \"cssClasses\", {\n get: function () {\n return cssClasses;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MDCMenuSurfaceFoundation, \"strings\", {\n get: function () {\n return strings;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MDCMenuSurfaceFoundation, \"numbers\", {\n get: function () {\n return numbers;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MDCMenuSurfaceFoundation, \"Corner\", {\n get: function () {\n return Corner;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MDCMenuSurfaceFoundation, \"defaultAdapter\", {\n /**\n * @see {@link MDCMenuSurfaceAdapter} for typing information on parameters and return types.\n */\n get: function () {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClass: function () { return undefined; },\n removeClass: function () { return undefined; },\n hasClass: function () { return false; },\n hasAnchor: function () { return false; },\n isElementInContainer: function () { return false; },\n isFocused: function () { return false; },\n isRtl: function () { return false; },\n getInnerDimensions: function () { return ({ height: 0, width: 0 }); },\n getAnchorDimensions: function () { return null; },\n getWindowDimensions: function () { return ({ height: 0, width: 0 }); },\n getBodyDimensions: function () { return ({ height: 0, width: 0 }); },\n getWindowScroll: function () { return ({ x: 0, y: 0 }); },\n setPosition: function () { return undefined; },\n setMaxHeight: function () { return undefined; },\n setTransformOrigin: function () { return undefined; },\n saveFocus: function () { return undefined; },\n restoreFocus: function () { return undefined; },\n notifyClose: function () { return undefined; },\n notifyOpen: function () { return undefined; },\n };\n // tslint:enable:object-literal-sort-keys\n },\n enumerable: true,\n configurable: true\n });\n MDCMenuSurfaceFoundation.prototype.init = function () {\n var _a = MDCMenuSurfaceFoundation.cssClasses, ROOT = _a.ROOT, OPEN = _a.OPEN;\n if (!this.adapter_.hasClass(ROOT)) {\n throw new Error(ROOT + \" class required in root element.\");\n }\n if (this.adapter_.hasClass(OPEN)) {\n this.isOpen_ = true;\n }\n };\n MDCMenuSurfaceFoundation.prototype.destroy = function () {\n clearTimeout(this.openAnimationEndTimerId_);\n clearTimeout(this.closeAnimationEndTimerId_);\n // Cancel any currently running animations.\n cancelAnimationFrame(this.animationRequestId_);\n };\n /**\n * @param corner Default anchor corner alignment of top-left menu surface corner.\n */\n MDCMenuSurfaceFoundation.prototype.setAnchorCorner = function (corner) {\n this.anchorCorner_ = corner;\n };\n /**\n * @param margin Set of margin values from anchor.\n */\n MDCMenuSurfaceFoundation.prototype.setAnchorMargin = function (margin) {\n this.anchorMargin_.top = margin.top || 0;\n this.anchorMargin_.right = margin.right || 0;\n this.anchorMargin_.bottom = margin.bottom || 0;\n this.anchorMargin_.left = margin.left || 0;\n };\n /** Used to indicate if the menu-surface is hoisted to the body. */\n MDCMenuSurfaceFoundation.prototype.setIsHoisted = function (isHoisted) {\n this.isHoistedElement_ = isHoisted;\n };\n /** Used to set the menu-surface calculations based on a fixed position menu. */\n MDCMenuSurfaceFoundation.prototype.setFixedPosition = function (isFixedPosition) {\n this.isFixedPosition_ = isFixedPosition;\n };\n /** Sets the menu-surface position on the page. */\n MDCMenuSurfaceFoundation.prototype.setAbsolutePosition = function (x, y) {\n this.position_.x = this.isFinite_(x) ? x : 0;\n this.position_.y = this.isFinite_(y) ? y : 0;\n };\n MDCMenuSurfaceFoundation.prototype.setQuickOpen = function (quickOpen) {\n this.isQuickOpen_ = quickOpen;\n };\n MDCMenuSurfaceFoundation.prototype.isOpen = function () {\n return this.isOpen_;\n };\n /**\n * Open the menu surface.\n */\n MDCMenuSurfaceFoundation.prototype.open = function () {\n var _this = this;\n this.adapter_.saveFocus();\n if (!this.isQuickOpen_) {\n this.adapter_.addClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_OPEN);\n }\n this.animationRequestId_ = requestAnimationFrame(function () {\n _this.adapter_.addClass(MDCMenuSurfaceFoundation.cssClasses.OPEN);\n _this.dimensions_ = _this.adapter_.getInnerDimensions();\n _this.autoPosition_();\n if (_this.isQuickOpen_) {\n _this.adapter_.notifyOpen();\n }\n else {\n _this.openAnimationEndTimerId_ = setTimeout(function () {\n _this.openAnimationEndTimerId_ = 0;\n _this.adapter_.removeClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_OPEN);\n _this.adapter_.notifyOpen();\n }, numbers.TRANSITION_OPEN_DURATION);\n }\n });\n this.isOpen_ = true;\n };\n /**\n * Closes the menu surface.\n */\n MDCMenuSurfaceFoundation.prototype.close = function (skipRestoreFocus) {\n var _this = this;\n if (skipRestoreFocus === void 0) { skipRestoreFocus = false; }\n if (!this.isQuickOpen_) {\n this.adapter_.addClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_CLOSED);\n }\n requestAnimationFrame(function () {\n _this.adapter_.removeClass(MDCMenuSurfaceFoundation.cssClasses.OPEN);\n if (_this.isQuickOpen_) {\n _this.adapter_.notifyClose();\n }\n else {\n _this.closeAnimationEndTimerId_ = setTimeout(function () {\n _this.closeAnimationEndTimerId_ = 0;\n _this.adapter_.removeClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_CLOSED);\n _this.adapter_.notifyClose();\n }, numbers.TRANSITION_CLOSE_DURATION);\n }\n });\n this.isOpen_ = false;\n if (!skipRestoreFocus) {\n this.maybeRestoreFocus_();\n }\n };\n /** Handle clicks and close if not within menu-surface element. */\n MDCMenuSurfaceFoundation.prototype.handleBodyClick = function (evt) {\n var el = evt.target;\n if (this.adapter_.isElementInContainer(el)) {\n return;\n }\n this.close();\n };\n /** Handle keys that close the surface. */\n MDCMenuSurfaceFoundation.prototype.handleKeydown = function (evt) {\n var keyCode = evt.keyCode, key = evt.key;\n var isEscape = key === 'Escape' || keyCode === 27;\n if (isEscape) {\n this.close();\n }\n };\n MDCMenuSurfaceFoundation.prototype.autoPosition_ = function () {\n var _a;\n // Compute measurements for autoposition methods reuse.\n this.measurements_ = this.getAutoLayoutMeasurements_();\n var corner = this.getOriginCorner_();\n var maxMenuSurfaceHeight = this.getMenuSurfaceMaxHeight_(corner);\n var verticalAlignment = this.hasBit_(corner, CornerBit.BOTTOM) ? 'bottom' : 'top';\n var horizontalAlignment = this.hasBit_(corner, CornerBit.RIGHT) ? 'right' : 'left';\n var horizontalOffset = this.getHorizontalOriginOffset_(corner);\n var verticalOffset = this.getVerticalOriginOffset_(corner);\n var _b = this.measurements_, anchorSize = _b.anchorSize, surfaceSize = _b.surfaceSize;\n var position = (_a = {},\n _a[horizontalAlignment] = horizontalOffset,\n _a[verticalAlignment] = verticalOffset,\n _a);\n // Center align when anchor width is comparable or greater than menu surface, otherwise keep corner.\n if (anchorSize.width / surfaceSize.width > numbers.ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO) {\n horizontalAlignment = 'center';\n }\n // If the menu-surface has been hoisted to the body, it's no longer relative to the anchor element\n if (this.isHoistedElement_ || this.isFixedPosition_) {\n this.adjustPositionForHoistedElement_(position);\n }\n this.adapter_.setTransformOrigin(horizontalAlignment + \" \" + verticalAlignment);\n this.adapter_.setPosition(position);\n this.adapter_.setMaxHeight(maxMenuSurfaceHeight ? maxMenuSurfaceHeight + 'px' : '');\n };\n /**\n * @return Measurements used to position menu surface popup.\n */\n MDCMenuSurfaceFoundation.prototype.getAutoLayoutMeasurements_ = function () {\n var anchorRect = this.adapter_.getAnchorDimensions();\n var bodySize = this.adapter_.getBodyDimensions();\n var viewportSize = this.adapter_.getWindowDimensions();\n var windowScroll = this.adapter_.getWindowScroll();\n if (!anchorRect) {\n // tslint:disable:object-literal-sort-keys Positional properties are more readable when they're grouped together\n anchorRect = {\n top: this.position_.y,\n right: this.position_.x,\n bottom: this.position_.y,\n left: this.position_.x,\n width: 0,\n height: 0,\n };\n // tslint:enable:object-literal-sort-keys\n }\n return {\n anchorSize: anchorRect,\n bodySize: bodySize,\n surfaceSize: this.dimensions_,\n viewportDistance: {\n // tslint:disable:object-literal-sort-keys Positional properties are more readable when they're grouped together\n top: anchorRect.top,\n right: viewportSize.width - anchorRect.right,\n bottom: viewportSize.height - anchorRect.bottom,\n left: anchorRect.left,\n },\n viewportSize: viewportSize,\n windowScroll: windowScroll,\n };\n };\n /**\n * Computes the corner of the anchor from which to animate and position the menu surface.\n */\n MDCMenuSurfaceFoundation.prototype.getOriginCorner_ = function () {\n // Defaults: open from the top left.\n var corner = Corner.TOP_LEFT;\n var _a = this.measurements_, viewportDistance = _a.viewportDistance, anchorSize = _a.anchorSize, surfaceSize = _a.surfaceSize;\n var isBottomAligned = this.hasBit_(this.anchorCorner_, CornerBit.BOTTOM);\n var availableTop = isBottomAligned ? viewportDistance.top + anchorSize.height + this.anchorMargin_.bottom\n : viewportDistance.top + this.anchorMargin_.top;\n var availableBottom = isBottomAligned ? viewportDistance.bottom - this.anchorMargin_.bottom\n : viewportDistance.bottom + anchorSize.height - this.anchorMargin_.top;\n var topOverflow = surfaceSize.height - availableTop;\n var bottomOverflow = surfaceSize.height - availableBottom;\n if (bottomOverflow > 0 && topOverflow < bottomOverflow) {\n corner = this.setBit_(corner, CornerBit.BOTTOM);\n }\n var isRtl = this.adapter_.isRtl();\n var isFlipRtl = this.hasBit_(this.anchorCorner_, CornerBit.FLIP_RTL);\n var avoidHorizontalOverlap = this.hasBit_(this.anchorCorner_, CornerBit.RIGHT);\n var isAlignedRight = (avoidHorizontalOverlap && !isRtl) ||\n (!avoidHorizontalOverlap && isFlipRtl && isRtl);\n var availableLeft = isAlignedRight ? viewportDistance.left + anchorSize.width + this.anchorMargin_.right :\n viewportDistance.left + this.anchorMargin_.left;\n var availableRight = isAlignedRight ? viewportDistance.right - this.anchorMargin_.right :\n viewportDistance.right + anchorSize.width - this.anchorMargin_.left;\n var leftOverflow = surfaceSize.width - availableLeft;\n var rightOverflow = surfaceSize.width - availableRight;\n if ((leftOverflow < 0 && isAlignedRight && isRtl) ||\n (avoidHorizontalOverlap && !isAlignedRight && leftOverflow < 0) ||\n (rightOverflow > 0 && leftOverflow < rightOverflow)) {\n corner = this.setBit_(corner, CornerBit.RIGHT);\n }\n return corner;\n };\n /**\n * @param corner Origin corner of the menu surface.\n * @return Maximum height of the menu surface, based on available space. 0 indicates should not be set.\n */\n MDCMenuSurfaceFoundation.prototype.getMenuSurfaceMaxHeight_ = function (corner) {\n var viewportDistance = this.measurements_.viewportDistance;\n var maxHeight = 0;\n var isBottomAligned = this.hasBit_(corner, CornerBit.BOTTOM);\n var isBottomAnchored = this.hasBit_(this.anchorCorner_, CornerBit.BOTTOM);\n var MARGIN_TO_EDGE = MDCMenuSurfaceFoundation.numbers.MARGIN_TO_EDGE;\n // When maximum height is not specified, it is handled from CSS.\n if (isBottomAligned) {\n maxHeight = viewportDistance.top + this.anchorMargin_.top - MARGIN_TO_EDGE;\n if (!isBottomAnchored) {\n maxHeight += this.measurements_.anchorSize.height;\n }\n }\n else {\n maxHeight =\n viewportDistance.bottom - this.anchorMargin_.bottom + this.measurements_.anchorSize.height - MARGIN_TO_EDGE;\n if (isBottomAnchored) {\n maxHeight -= this.measurements_.anchorSize.height;\n }\n }\n return maxHeight;\n };\n /**\n * @param corner Origin corner of the menu surface.\n * @return Horizontal offset of menu surface origin corner from corresponding anchor corner.\n */\n MDCMenuSurfaceFoundation.prototype.getHorizontalOriginOffset_ = function (corner) {\n var anchorSize = this.measurements_.anchorSize;\n // isRightAligned corresponds to using the 'right' property on the surface.\n var isRightAligned = this.hasBit_(corner, CornerBit.RIGHT);\n var avoidHorizontalOverlap = this.hasBit_(this.anchorCorner_, CornerBit.RIGHT);\n if (isRightAligned) {\n var rightOffset = avoidHorizontalOverlap ? anchorSize.width - this.anchorMargin_.left : this.anchorMargin_.right;\n // For hoisted or fixed elements, adjust the offset by the difference between viewport width and body width so\n // when we calculate the right value (`adjustPositionForHoistedElement_`) based on the element position,\n // the right property is correct.\n if (this.isHoistedElement_ || this.isFixedPosition_) {\n return rightOffset - (this.measurements_.viewportSize.width - this.measurements_.bodySize.width);\n }\n return rightOffset;\n }\n return avoidHorizontalOverlap ? anchorSize.width - this.anchorMargin_.right : this.anchorMargin_.left;\n };\n /**\n * @param corner Origin corner of the menu surface.\n * @return Vertical offset of menu surface origin corner from corresponding anchor corner.\n */\n MDCMenuSurfaceFoundation.prototype.getVerticalOriginOffset_ = function (corner) {\n var anchorSize = this.measurements_.anchorSize;\n var isBottomAligned = this.hasBit_(corner, CornerBit.BOTTOM);\n var avoidVerticalOverlap = this.hasBit_(this.anchorCorner_, CornerBit.BOTTOM);\n var y = 0;\n if (isBottomAligned) {\n y = avoidVerticalOverlap ? anchorSize.height - this.anchorMargin_.top : -this.anchorMargin_.bottom;\n }\n else {\n y = avoidVerticalOverlap ? (anchorSize.height + this.anchorMargin_.bottom) : this.anchorMargin_.top;\n }\n return y;\n };\n /** Calculates the offsets for positioning the menu-surface when the menu-surface has been hoisted to the body. */\n MDCMenuSurfaceFoundation.prototype.adjustPositionForHoistedElement_ = function (position) {\n var e_1, _a;\n var _b = this.measurements_, windowScroll = _b.windowScroll, viewportDistance = _b.viewportDistance;\n var props = Object.keys(position);\n try {\n for (var props_1 = tslib_1.__values(props), props_1_1 = props_1.next(); !props_1_1.done; props_1_1 = props_1.next()) {\n var prop = props_1_1.value;\n var value = position[prop] || 0;\n // Hoisted surfaces need to have the anchor elements location on the page added to the\n // position properties for proper alignment on the body.\n value += viewportDistance[prop];\n // Surfaces that are absolutely positioned need to have additional calculations for scroll\n // and bottom positioning.\n if (!this.isFixedPosition_) {\n if (prop === 'top') {\n value += windowScroll.y;\n }\n else if (prop === 'bottom') {\n value -= windowScroll.y;\n }\n else if (prop === 'left') {\n value += windowScroll.x;\n }\n else { // prop === 'right'\n value -= windowScroll.x;\n }\n }\n position[prop] = value;\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (props_1_1 && !props_1_1.done && (_a = props_1.return)) _a.call(props_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n };\n /**\n * The last focused element when the menu surface was opened should regain focus, if the user is\n * focused on or within the menu surface when it is closed.\n */\n MDCMenuSurfaceFoundation.prototype.maybeRestoreFocus_ = function () {\n var isRootFocused = this.adapter_.isFocused();\n var childHasFocus = document.activeElement && this.adapter_.isElementInContainer(document.activeElement);\n if (isRootFocused || childHasFocus) {\n this.adapter_.restoreFocus();\n }\n };\n MDCMenuSurfaceFoundation.prototype.hasBit_ = function (corner, bit) {\n return Boolean(corner & bit); // tslint:disable-line:no-bitwise\n };\n MDCMenuSurfaceFoundation.prototype.setBit_ = function (corner, bit) {\n return corner | bit; // tslint:disable-line:no-bitwise\n };\n /**\n * isFinite that doesn't force conversion to number type.\n * Equivalent to Number.isFinite in ES2015, which is not supported in IE.\n */\n MDCMenuSurfaceFoundation.prototype.isFinite_ = function (num) {\n return typeof num === 'number' && isFinite(num);\n };\n return MDCMenuSurfaceFoundation;\n}(MDCFoundation));\nexport { MDCMenuSurfaceFoundation };\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCMenuSurfaceFoundation;\n//# sourceMappingURL=foundation.js.map","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nvar cachedCssTransformPropertyName_;\n/**\n * Returns the name of the correct transform property to use on the current browser.\n */\nfunction getTransformPropertyName(globalObj, forceRefresh) {\n if (forceRefresh === void 0) { forceRefresh = false; }\n if (cachedCssTransformPropertyName_ === undefined || forceRefresh) {\n var el = globalObj.document.createElement('div');\n cachedCssTransformPropertyName_ = 'transform' in el.style ? 'transform' : 'webkitTransform';\n }\n return cachedCssTransformPropertyName_;\n}\nexport { getTransformPropertyName };\n//# sourceMappingURL=util.js.map","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport * as tslib_1 from \"tslib\";\nimport { MDCComponent } from '@material/base/component';\nimport { cssClasses, strings } from './constants';\nimport { MDCMenuSurfaceFoundation } from './foundation';\nimport * as util from './util';\nvar MDCMenuSurface = /** @class */ (function (_super) {\n tslib_1.__extends(MDCMenuSurface, _super);\n function MDCMenuSurface() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n MDCMenuSurface.attachTo = function (root) {\n return new MDCMenuSurface(root);\n };\n MDCMenuSurface.prototype.initialSyncWithDOM = function () {\n var _this = this;\n var parentEl = this.root_.parentElement;\n this.anchorElement = parentEl && parentEl.classList.contains(cssClasses.ANCHOR) ? parentEl : null;\n if (this.root_.classList.contains(cssClasses.FIXED)) {\n this.setFixedPosition(true);\n }\n this.handleKeydown_ = function (evt) { return _this.foundation_.handleKeydown(evt); };\n this.handleBodyClick_ = function (evt) { return _this.foundation_.handleBodyClick(evt); };\n this.registerBodyClickListener_ = function () { return document.body.addEventListener('click', _this.handleBodyClick_); };\n this.deregisterBodyClickListener_ = function () { return document.body.removeEventListener('click', _this.handleBodyClick_); };\n this.listen('keydown', this.handleKeydown_);\n this.listen(strings.OPENED_EVENT, this.registerBodyClickListener_);\n this.listen(strings.CLOSED_EVENT, this.deregisterBodyClickListener_);\n };\n MDCMenuSurface.prototype.destroy = function () {\n this.unlisten('keydown', this.handleKeydown_);\n this.unlisten(strings.OPENED_EVENT, this.registerBodyClickListener_);\n this.unlisten(strings.CLOSED_EVENT, this.deregisterBodyClickListener_);\n _super.prototype.destroy.call(this);\n };\n MDCMenuSurface.prototype.isOpen = function () {\n return this.foundation_.isOpen();\n };\n MDCMenuSurface.prototype.open = function () {\n this.foundation_.open();\n };\n MDCMenuSurface.prototype.close = function (skipRestoreFocus) {\n if (skipRestoreFocus === void 0) { skipRestoreFocus = false; }\n this.foundation_.close(skipRestoreFocus);\n };\n Object.defineProperty(MDCMenuSurface.prototype, \"quickOpen\", {\n set: function (quickOpen) {\n this.foundation_.setQuickOpen(quickOpen);\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Removes the menu-surface from it's current location and appends it to the\n * body to overcome any overflow:hidden issues.\n */\n MDCMenuSurface.prototype.hoistMenuToBody = function () {\n document.body.appendChild(this.root_);\n this.setIsHoisted(true);\n };\n /** Sets the foundation to use page offsets for an positioning when the menu is hoisted to the body. */\n MDCMenuSurface.prototype.setIsHoisted = function (isHoisted) {\n this.foundation_.setIsHoisted(isHoisted);\n };\n /** Sets the element that the menu-surface is anchored to. */\n MDCMenuSurface.prototype.setMenuSurfaceAnchorElement = function (element) {\n this.anchorElement = element;\n };\n /** Sets the menu-surface to position: fixed. */\n MDCMenuSurface.prototype.setFixedPosition = function (isFixed) {\n if (isFixed) {\n this.root_.classList.add(cssClasses.FIXED);\n }\n else {\n this.root_.classList.remove(cssClasses.FIXED);\n }\n this.foundation_.setFixedPosition(isFixed);\n };\n /** Sets the absolute x/y position to position based on. Requires the menu to be hoisted. */\n MDCMenuSurface.prototype.setAbsolutePosition = function (x, y) {\n this.foundation_.setAbsolutePosition(x, y);\n this.setIsHoisted(true);\n };\n /**\n * @param corner Default anchor corner alignment of top-left surface corner.\n */\n MDCMenuSurface.prototype.setAnchorCorner = function (corner) {\n this.foundation_.setAnchorCorner(corner);\n };\n MDCMenuSurface.prototype.setAnchorMargin = function (margin) {\n this.foundation_.setAnchorMargin(margin);\n };\n MDCMenuSurface.prototype.getDefaultFoundation = function () {\n var _this = this;\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n var adapter = {\n addClass: function (className) { return _this.root_.classList.add(className); },\n removeClass: function (className) { return _this.root_.classList.remove(className); },\n hasClass: function (className) { return _this.root_.classList.contains(className); },\n hasAnchor: function () { return !!_this.anchorElement; },\n notifyClose: function () { return _this.emit(MDCMenuSurfaceFoundation.strings.CLOSED_EVENT, {}); },\n notifyOpen: function () { return _this.emit(MDCMenuSurfaceFoundation.strings.OPENED_EVENT, {}); },\n isElementInContainer: function (el) { return _this.root_.contains(el); },\n isRtl: function () { return getComputedStyle(_this.root_).getPropertyValue('direction') === 'rtl'; },\n setTransformOrigin: function (origin) {\n var propertyName = util.getTransformPropertyName(window) + \"-origin\";\n _this.root_.style.setProperty(propertyName, origin);\n },\n isFocused: function () { return document.activeElement === _this.root_; },\n saveFocus: function () {\n _this.previousFocus_ = document.activeElement;\n },\n restoreFocus: function () {\n if (_this.root_.contains(document.activeElement)) {\n if (_this.previousFocus_ && _this.previousFocus_.focus) {\n _this.previousFocus_.focus();\n }\n }\n },\n getInnerDimensions: function () {\n return { width: _this.root_.offsetWidth, height: _this.root_.offsetHeight };\n },\n getAnchorDimensions: function () { return _this.anchorElement ? _this.anchorElement.getBoundingClientRect() : null; },\n getWindowDimensions: function () {\n return { width: window.innerWidth, height: window.innerHeight };\n },\n getBodyDimensions: function () {\n return { width: document.body.clientWidth, height: document.body.clientHeight };\n },\n getWindowScroll: function () {\n return { x: window.pageXOffset, y: window.pageYOffset };\n },\n setPosition: function (position) {\n _this.root_.style.left = 'left' in position ? position.left + \"px\" : '';\n _this.root_.style.right = 'right' in position ? position.right + \"px\" : '';\n _this.root_.style.top = 'top' in position ? position.top + \"px\" : '';\n _this.root_.style.bottom = 'bottom' in position ? position.bottom + \"px\" : '';\n },\n setMaxHeight: function (height) {\n _this.root_.style.maxHeight = height;\n },\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCMenuSurfaceFoundation(adapter);\n };\n return MDCMenuSurface;\n}(MDCComponent));\nexport { MDCMenuSurface };\n//# sourceMappingURL=component.js.map","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport * as tslib_1 from \"tslib\";\nimport { MDCFoundation } from '@material/base/foundation';\nimport { cssClasses as listCssClasses } from '@material/list/constants';\nimport { MDCMenuSurfaceFoundation } from '@material/menu-surface/foundation';\nimport { cssClasses, DefaultFocusState, numbers, strings } from './constants';\nvar MDCMenuFoundation = /** @class */ (function (_super) {\n tslib_1.__extends(MDCMenuFoundation, _super);\n function MDCMenuFoundation(adapter) {\n var _this = _super.call(this, tslib_1.__assign({}, MDCMenuFoundation.defaultAdapter, adapter)) || this;\n _this.closeAnimationEndTimerId_ = 0;\n _this.defaultFocusState_ = DefaultFocusState.LIST_ROOT;\n return _this;\n }\n Object.defineProperty(MDCMenuFoundation, \"cssClasses\", {\n get: function () {\n return cssClasses;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MDCMenuFoundation, \"strings\", {\n get: function () {\n return strings;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MDCMenuFoundation, \"numbers\", {\n get: function () {\n return numbers;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MDCMenuFoundation, \"defaultAdapter\", {\n /**\n * @see {@link MDCMenuAdapter} for typing information on parameters and return types.\n */\n get: function () {\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n return {\n addClassToElementAtIndex: function () { return undefined; },\n removeClassFromElementAtIndex: function () { return undefined; },\n addAttributeToElementAtIndex: function () { return undefined; },\n removeAttributeFromElementAtIndex: function () { return undefined; },\n elementContainsClass: function () { return false; },\n closeSurface: function () { return undefined; },\n getElementIndex: function () { return -1; },\n notifySelected: function () { return undefined; },\n getMenuItemCount: function () { return 0; },\n focusItemAtIndex: function () { return undefined; },\n focusListRoot: function () { return undefined; },\n getSelectedSiblingOfItemAtIndex: function () { return -1; },\n isSelectableItemAtIndex: function () { return false; },\n };\n // tslint:enable:object-literal-sort-keys\n },\n enumerable: true,\n configurable: true\n });\n MDCMenuFoundation.prototype.destroy = function () {\n if (this.closeAnimationEndTimerId_) {\n clearTimeout(this.closeAnimationEndTimerId_);\n }\n this.adapter_.closeSurface();\n };\n MDCMenuFoundation.prototype.handleKeydown = function (evt) {\n var key = evt.key, keyCode = evt.keyCode;\n var isTab = key === 'Tab' || keyCode === 9;\n if (isTab) {\n this.adapter_.closeSurface(/** skipRestoreFocus */ true);\n }\n };\n MDCMenuFoundation.prototype.handleItemAction = function (listItem) {\n var _this = this;\n var index = this.adapter_.getElementIndex(listItem);\n if (index < 0) {\n return;\n }\n this.adapter_.notifySelected({ index: index });\n this.adapter_.closeSurface();\n // Wait for the menu to close before adding/removing classes that affect styles.\n this.closeAnimationEndTimerId_ = setTimeout(function () {\n // Recompute the index in case the menu contents have changed.\n var recomputedIndex = _this.adapter_.getElementIndex(listItem);\n if (_this.adapter_.isSelectableItemAtIndex(recomputedIndex)) {\n _this.setSelectedIndex(recomputedIndex);\n }\n }, MDCMenuSurfaceFoundation.numbers.TRANSITION_CLOSE_DURATION);\n };\n MDCMenuFoundation.prototype.handleMenuSurfaceOpened = function () {\n switch (this.defaultFocusState_) {\n case DefaultFocusState.FIRST_ITEM:\n this.adapter_.focusItemAtIndex(0);\n break;\n case DefaultFocusState.LAST_ITEM:\n this.adapter_.focusItemAtIndex(this.adapter_.getMenuItemCount() - 1);\n break;\n case DefaultFocusState.NONE:\n // Do nothing.\n break;\n default:\n this.adapter_.focusListRoot();\n break;\n }\n };\n /**\n * Sets default focus state where the menu should focus every time when menu\n * is opened. Focuses the list root (`DefaultFocusState.LIST_ROOT`) element by\n * default.\n */\n MDCMenuFoundation.prototype.setDefaultFocusState = function (focusState) {\n this.defaultFocusState_ = focusState;\n };\n /**\n * Selects the list item at `index` within the menu.\n * @param index Index of list item within the menu.\n */\n MDCMenuFoundation.prototype.setSelectedIndex = function (index) {\n this.validatedIndex_(index);\n if (!this.adapter_.isSelectableItemAtIndex(index)) {\n throw new Error('MDCMenuFoundation: No selection group at specified index.');\n }\n var prevSelectedIndex = this.adapter_.getSelectedSiblingOfItemAtIndex(index);\n if (prevSelectedIndex >= 0) {\n this.adapter_.removeAttributeFromElementAtIndex(prevSelectedIndex, strings.ARIA_CHECKED_ATTR);\n this.adapter_.removeClassFromElementAtIndex(prevSelectedIndex, cssClasses.MENU_SELECTED_LIST_ITEM);\n }\n this.adapter_.addClassToElementAtIndex(index, cssClasses.MENU_SELECTED_LIST_ITEM);\n this.adapter_.addAttributeToElementAtIndex(index, strings.ARIA_CHECKED_ATTR, 'true');\n };\n /**\n * Sets the enabled state to isEnabled for the menu item at the given index.\n * @param index Index of the menu item\n * @param isEnabled The desired enabled state of the menu item.\n */\n MDCMenuFoundation.prototype.setEnabled = function (index, isEnabled) {\n this.validatedIndex_(index);\n if (isEnabled) {\n this.adapter_.removeClassFromElementAtIndex(index, listCssClasses.LIST_ITEM_DISABLED_CLASS);\n this.adapter_.addAttributeToElementAtIndex(index, strings.ARIA_DISABLED_ATTR, 'false');\n }\n else {\n this.adapter_.addClassToElementAtIndex(index, listCssClasses.LIST_ITEM_DISABLED_CLASS);\n this.adapter_.addAttributeToElementAtIndex(index, strings.ARIA_DISABLED_ATTR, 'true');\n }\n };\n MDCMenuFoundation.prototype.validatedIndex_ = function (index) {\n var menuSize = this.adapter_.getMenuItemCount();\n var isIndexInRange = index >= 0 && index < menuSize;\n if (!isIndexInRange) {\n throw new Error('MDCMenuFoundation: No list item at specified index.');\n }\n };\n return MDCMenuFoundation;\n}(MDCFoundation));\nexport { MDCMenuFoundation };\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCMenuFoundation;\n//# sourceMappingURL=foundation.js.map","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport * as tslib_1 from \"tslib\";\nimport { MDCComponent } from '@material/base/component';\nimport { closest } from '@material/dom/ponyfill';\nimport { MDCList } from '@material/list/component';\nimport { MDCListFoundation } from '@material/list/foundation';\nimport { MDCMenuSurface } from '@material/menu-surface/component';\nimport { MDCMenuSurfaceFoundation } from '@material/menu-surface/foundation';\nimport { cssClasses, strings } from './constants';\nimport { MDCMenuFoundation } from './foundation';\nvar MDCMenu = /** @class */ (function (_super) {\n tslib_1.__extends(MDCMenu, _super);\n function MDCMenu() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n MDCMenu.attachTo = function (root) {\n return new MDCMenu(root);\n };\n MDCMenu.prototype.initialize = function (menuSurfaceFactory, listFactory) {\n if (menuSurfaceFactory === void 0) { menuSurfaceFactory = function (el) { return new MDCMenuSurface(el); }; }\n if (listFactory === void 0) { listFactory = function (el) { return new MDCList(el); }; }\n this.menuSurfaceFactory_ = menuSurfaceFactory;\n this.listFactory_ = listFactory;\n };\n MDCMenu.prototype.initialSyncWithDOM = function () {\n var _this = this;\n this.menuSurface_ = this.menuSurfaceFactory_(this.root_);\n var list = this.root_.querySelector(strings.LIST_SELECTOR);\n if (list) {\n this.list_ = this.listFactory_(list);\n this.list_.wrapFocus = true;\n }\n else {\n this.list_ = null;\n }\n this.handleKeydown_ = function (evt) { return _this.foundation_.handleKeydown(evt); };\n this.handleItemAction_ = function (evt) { return _this.foundation_.handleItemAction(_this.items[evt.detail.index]); };\n this.handleMenuSurfaceOpened_ = function () { return _this.foundation_.handleMenuSurfaceOpened(); };\n this.menuSurface_.listen(MDCMenuSurfaceFoundation.strings.OPENED_EVENT, this.handleMenuSurfaceOpened_);\n this.listen('keydown', this.handleKeydown_);\n this.listen(MDCListFoundation.strings.ACTION_EVENT, this.handleItemAction_);\n };\n MDCMenu.prototype.destroy = function () {\n if (this.list_) {\n this.list_.destroy();\n }\n this.menuSurface_.destroy();\n this.menuSurface_.unlisten(MDCMenuSurfaceFoundation.strings.OPENED_EVENT, this.handleMenuSurfaceOpened_);\n this.unlisten('keydown', this.handleKeydown_);\n this.unlisten(MDCListFoundation.strings.ACTION_EVENT, this.handleItemAction_);\n _super.prototype.destroy.call(this);\n };\n Object.defineProperty(MDCMenu.prototype, \"open\", {\n get: function () {\n return this.menuSurface_.isOpen();\n },\n set: function (value) {\n if (value) {\n this.menuSurface_.open();\n }\n else {\n this.menuSurface_.close();\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MDCMenu.prototype, \"wrapFocus\", {\n get: function () {\n return this.list_ ? this.list_.wrapFocus : false;\n },\n set: function (value) {\n if (this.list_) {\n this.list_.wrapFocus = value;\n }\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MDCMenu.prototype, \"items\", {\n /**\n * Return the items within the menu. Note that this only contains the set of elements within\n * the items container that are proper list items, and not supplemental / presentational DOM\n * elements.\n */\n get: function () {\n return this.list_ ? this.list_.listElements : [];\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MDCMenu.prototype, \"quickOpen\", {\n set: function (quickOpen) {\n this.menuSurface_.quickOpen = quickOpen;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Sets default focus state where the menu should focus every time when menu\n * is opened. Focuses the list root (`DefaultFocusState.LIST_ROOT`) element by\n * default.\n * @param focusState Default focus state.\n */\n MDCMenu.prototype.setDefaultFocusState = function (focusState) {\n this.foundation_.setDefaultFocusState(focusState);\n };\n /**\n * @param corner Default anchor corner alignment of top-left menu corner.\n */\n MDCMenu.prototype.setAnchorCorner = function (corner) {\n this.menuSurface_.setAnchorCorner(corner);\n };\n MDCMenu.prototype.setAnchorMargin = function (margin) {\n this.menuSurface_.setAnchorMargin(margin);\n };\n /**\n * Sets the list item as the selected row at the specified index.\n * @param index Index of list item within menu.\n */\n MDCMenu.prototype.setSelectedIndex = function (index) {\n this.foundation_.setSelectedIndex(index);\n };\n /**\n * Sets the enabled state to isEnabled for the menu item at the given index.\n * @param index Index of the menu item\n * @param isEnabled The desired enabled state of the menu item.\n */\n MDCMenu.prototype.setEnabled = function (index, isEnabled) {\n this.foundation_.setEnabled(index, isEnabled);\n };\n /**\n * @return The item within the menu at the index specified.\n */\n MDCMenu.prototype.getOptionByIndex = function (index) {\n var items = this.items;\n if (index < items.length) {\n return this.items[index];\n }\n else {\n return null;\n }\n };\n MDCMenu.prototype.setFixedPosition = function (isFixed) {\n this.menuSurface_.setFixedPosition(isFixed);\n };\n MDCMenu.prototype.hoistMenuToBody = function () {\n this.menuSurface_.hoistMenuToBody();\n };\n MDCMenu.prototype.setIsHoisted = function (isHoisted) {\n this.menuSurface_.setIsHoisted(isHoisted);\n };\n MDCMenu.prototype.setAbsolutePosition = function (x, y) {\n this.menuSurface_.setAbsolutePosition(x, y);\n };\n /**\n * Sets the element that the menu-surface is anchored to.\n */\n MDCMenu.prototype.setAnchorElement = function (element) {\n this.menuSurface_.anchorElement = element;\n };\n MDCMenu.prototype.getDefaultFoundation = function () {\n var _this = this;\n // DO NOT INLINE this variable. For backward compatibility, foundations take a Partial.\n // To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable.\n // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.\n var adapter = {\n addClassToElementAtIndex: function (index, className) {\n var list = _this.items;\n list[index].classList.add(className);\n },\n removeClassFromElementAtIndex: function (index, className) {\n var list = _this.items;\n list[index].classList.remove(className);\n },\n addAttributeToElementAtIndex: function (index, attr, value) {\n var list = _this.items;\n list[index].setAttribute(attr, value);\n },\n removeAttributeFromElementAtIndex: function (index, attr) {\n var list = _this.items;\n list[index].removeAttribute(attr);\n },\n elementContainsClass: function (element, className) { return element.classList.contains(className); },\n closeSurface: function (skipRestoreFocus) { return _this.menuSurface_.close(skipRestoreFocus); },\n getElementIndex: function (element) { return _this.items.indexOf(element); },\n notifySelected: function (evtData) { return _this.emit(strings.SELECTED_EVENT, {\n index: evtData.index,\n item: _this.items[evtData.index],\n }); },\n getMenuItemCount: function () { return _this.items.length; },\n focusItemAtIndex: function (index) { return _this.items[index].focus(); },\n focusListRoot: function () { return _this.root_.querySelector(strings.LIST_SELECTOR).focus(); },\n isSelectableItemAtIndex: function (index) { return !!closest(_this.items[index], \".\" + cssClasses.MENU_SELECTION_GROUP); },\n getSelectedSiblingOfItemAtIndex: function (index) {\n var selectionGroupEl = closest(_this.items[index], \".\" + cssClasses.MENU_SELECTION_GROUP);\n var selectedItemEl = selectionGroupEl.querySelector(\".\" + cssClasses.MENU_SELECTED_LIST_ITEM);\n return selectedItemEl ? _this.items.indexOf(selectedItemEl) : -1;\n },\n };\n // tslint:enable:object-literal-sort-keys\n return new MDCMenuFoundation(adapter);\n };\n return MDCMenu;\n}(MDCComponent));\nexport { MDCMenu };\n//# sourceMappingURL=component.js.map","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nvar cssClasses = {\n MENU_SELECTED_LIST_ITEM: 'mdc-menu-item--selected',\n MENU_SELECTION_GROUP: 'mdc-menu__selection-group',\n ROOT: 'mdc-menu',\n};\nvar strings = {\n ARIA_CHECKED_ATTR: 'aria-checked',\n ARIA_DISABLED_ATTR: 'aria-disabled',\n CHECKBOX_SELECTOR: 'input[type=\"checkbox\"]',\n LIST_SELECTOR: '.mdc-list',\n SELECTED_EVENT: 'MDCMenu:selected',\n};\nvar numbers = {\n FOCUS_ROOT_INDEX: -1,\n};\nvar DefaultFocusState;\n(function (DefaultFocusState) {\n DefaultFocusState[DefaultFocusState[\"NONE\"] = 0] = \"NONE\";\n DefaultFocusState[DefaultFocusState[\"LIST_ROOT\"] = 1] = \"LIST_ROOT\";\n DefaultFocusState[DefaultFocusState[\"FIRST_ITEM\"] = 2] = \"FIRST_ITEM\";\n DefaultFocusState[DefaultFocusState[\"LAST_ITEM\"] = 3] = \"LAST_ITEM\";\n})(DefaultFocusState || (DefaultFocusState = {}));\nexport { cssClasses, strings, numbers, DefaultFocusState };\n//# sourceMappingURL=constants.js.map"],"names":["MDCList","_super","apply","this","arguments","Object","defineProperty","prototype","set","value","foundation_","setVerticalOrientation","enumerable","configurable","get","slice","call","root_","querySelectorAll","LIST_ITEM_CLASS","setWrapFocus","isSingleSelectionList","setSingleSelection","getSelectedIndex","index","setSelectedIndex","attachTo","root","initialSyncWithDOM","handleClick_","handleClickEvent_","bind","handleKeydown_","handleKeydownEvent_","focusInEventListener_","handleFocusInEvent_","focusOutEventListener_","handleFocusOutEvent_","listen","layout","initializeListType","destroy","unlisten","direction","getAttribute","ARIA_ORIENTATION","vertical","ARIA_ORIENTATION_HORIZONTAL","forEach","el","setAttribute","FOCUSABLE_CHILD_ELEMENTS","_this","checkboxListItems","ARIA_ROLE_CHECKBOX_SELECTOR","singleSelectedListItem","querySelector","LIST_ITEM_ACTIVATED_CLASS","LIST_ITEM_SELECTED_CLASS","radioSelectedListItem","ARIA_CHECKED_RADIO_SELECTOR","length","preselectedItems","ARIA_CHECKED_CHECKBOX_SELECTOR","selectedIndex","map","listItem","listElements","indexOf","classList","contains","setUseActivatedClass","singleSelection","setEnabled","itemIndex","isEnabled","getDefaultFoundation","adapter","addClassForElementIndex","className","element","add","focusItemAtIndex","focus","getAttributeForElementIndex","attr","getFocusedElementIndex","document","activeElement","getListItemCount","hasCheckboxAtIndex","CHECKBOX_SELECTOR","hasRadioAtIndex","RADIO_SELECTOR","isCheckboxCheckedAtIndex","checked","isFocusInsideList","isRootFocused","notifyAction","emit","ACTION_EVENT","removeClassForElementIndex","remove","setAttributeForElementIndex","setCheckedCheckboxOrRadioAtIndex","isChecked","toggleEl","CHECKBOX_RADIO_SELECTOR","event","createEvent","initEvent","dispatchEvent","setTabIndexForListItemChildren","listItemIndex","tabIndexValue","CHILD_ELEMENTS_TO_TOGGLE_TABINDEX","getListItemIndex_","evt","eventTarget","target","nearestParent","ROOT","handleFocusIn","handleFocusOut","handleKeydown","toggleCheckbox","handleClick","cssClasses","LIST_ITEM_DISABLED_CLASS","strings","ARIA_CHECKED","ARIA_CURRENT","ARIA_DISABLED","ARIA_SELECTED","numbers","UNSET_INDEX","ELEMENTS_KEY_ALLOWED_IN","MDCListFoundation","defaultAdapter","wrapFocus_","isVertical_","isSingleSelectionList_","selectedIndex_","focusedItemIndex_","useActivatedClass_","ariaCurrentAttrValue_","isCheckboxList_","isRadioList_","adapter_","useActivated","isIndexValid_","setCheckboxAtIndex_","setRadioAtIndex_","setSingleSelectionAtIndex_","_","setTimeout","setTabindexToFirstSelectedItem_","isRootListItem","isArrowLeft","key","keyCode","isArrowUp","isArrowRight","isArrowDown","isHome","isEnd","isEnter","isSpace","preventDefault","focusLastElement","focusFirstElement","currentIndex","nextIndex","preventDefaultEvent_","focusNextElement","focusPrevElement","tagName","isSelectableList_","setSelectedIndexOnAction_","undefined","setTabindexAtIndex_","prevIndex","lastIndex","toLowerCase","selectedClassName","setAriaForSingleSelectionAtIndex_","isAriaCurrent","ariaAttribute","ariaAttributeValue","i","targetIndex","Array","reduce","minIndex","Math","min","Error","some","isIndexInRange_","listSize","toggleCheckboxAtIndex_","selectedIndexes","push","filter","CornerBit","Corner","ANCHOR","ANIMATING_CLOSED","ANIMATING_OPEN","FIXED","OPEN","CLOSED_EVENT","OPENED_EVENT","FOCUSABLE_ELEMENTS","join","TRANSITION_OPEN_DURATION","TRANSITION_CLOSE_DURATION","MARGIN_TO_EDGE","ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO","MDCMenuSurfaceFoundation","isOpen_","isQuickOpen_","isHoistedElement_","isFixedPosition_","openAnimationEndTimerId_","closeAnimationEndTimerId_","animationRequestId_","anchorCorner_","TOP_START","anchorMargin_","top","right","bottom","left","position_","x","y","addClass","removeClass","hasClass","hasAnchor","isElementInContainer","isFocused","isRtl","getInnerDimensions","height","width","getAnchorDimensions","getWindowDimensions","getBodyDimensions","getWindowScroll","setPosition","setMaxHeight","setTransformOrigin","saveFocus","restoreFocus","notifyClose","notifyOpen","init","_a","clearTimeout","cancelAnimationFrame","setAnchorCorner","corner","setAnchorMargin","margin","setIsHoisted","isHoisted","setFixedPosition","isFixedPosition","setAbsolutePosition","isFinite_","setQuickOpen","quickOpen","isOpen","open","requestAnimationFrame","dimensions_","autoPosition_","close","skipRestoreFocus","maybeRestoreFocus_","handleBodyClick","measurements_","getAutoLayoutMeasurements_","getOriginCorner_","maxMenuSurfaceHeight","getMenuSurfaceMaxHeight_","verticalAlignment","hasBit_","BOTTOM","horizontalAlignment","RIGHT","horizontalOffset","getHorizontalOriginOffset_","verticalOffset","getVerticalOriginOffset_","_b","anchorSize","surfaceSize","position","adjustPositionForHoistedElement_","anchorRect","bodySize","viewportSize","windowScroll","viewportDistance","TOP_LEFT","isBottomAligned","availableTop","availableBottom","topOverflow","bottomOverflow","setBit_","isFlipRtl","FLIP_RTL","avoidHorizontalOverlap","isAlignedRight","availableLeft","availableRight","leftOverflow","rightOverflow","maxHeight","isBottomAnchored","isRightAligned","rightOffset","avoidVerticalOverlap","e_1","props","keys","props_1","props_1_1","next","done","prop","e_1_1","error","return","childHasFocus","bit","Boolean","num","isFinite","cachedCssTransformPropertyName_","MDCMenuSurface","parentEl","parentElement","anchorElement","handleBodyClick_","registerBodyClickListener_","body","addEventListener","deregisterBodyClickListener_","removeEventListener","hoistMenuToBody","appendChild","setMenuSurfaceAnchorElement","isFixed","getComputedStyle","getPropertyValue","origin","propertyName","globalObj","forceRefresh","createElement","style","window","setProperty","previousFocus_","offsetWidth","offsetHeight","getBoundingClientRect","innerWidth","innerHeight","clientWidth","clientHeight","pageXOffset","pageYOffset","MDCMenuFoundation","defaultFocusState_","LIST_ROOT","addClassToElementAtIndex","removeClassFromElementAtIndex","addAttributeToElementAtIndex","removeAttributeFromElementAtIndex","elementContainsClass","closeSurface","getElementIndex","notifySelected","getMenuItemCount","focusListRoot","getSelectedSiblingOfItemAtIndex","isSelectableItemAtIndex","handleItemAction","recomputedIndex","handleMenuSurfaceOpened","FIRST_ITEM","LAST_ITEM","NONE","setDefaultFocusState","focusState","validatedIndex_","prevSelectedIndex","ARIA_CHECKED_ATTR","MENU_SELECTED_LIST_ITEM","ARIA_DISABLED_ATTR","menuSize","MDCMenu","initialize","menuSurfaceFactory","listFactory","menuSurfaceFactory_","listFactory_","menuSurface_","list","LIST_SELECTOR","list_","wrapFocus","handleItemAction_","items","detail","handleMenuSurfaceOpened_","getOptionByIndex","setAnchorElement","removeAttribute","evtData","SELECTED_EVENT","item","MENU_SELECTION_GROUP","selectedItemEl","DefaultFocusState","FOCUS_ROOT_INDEX"],"sourceRoot":""}