UNPKG

34 kBJavaScriptView Raw
1!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("@material/list",[],t):"object"==typeof exports?exports.list=t():(e.mdc=e.mdc||{},e.mdc.list=t())}(this,function(){return s={},i.m=n={0:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MDCFoundation=void 0;var s=(Object.defineProperty(i,"cssClasses",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(i,"strings",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(i,"numbers",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(i,"defaultAdapter",{get:function(){return{}},enumerable:!1,configurable:!0}),i.prototype.init=function(){},i.prototype.destroy=function(){},i);function i(e){void 0===e&&(e={}),this.adapter=e}t.MDCFoundation=s,t.default=s},1:function(e,t,n){"use strict";var i=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var s,i,r=n.call(e),o=[];try{for(;(void 0===t||0<t--)&&!(s=r.next()).done;)o.push(s.value)}catch(e){i={error:e}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return o},r=this&&this.__spreadArray||function(e,t){for(var n=0,s=t.length,i=e.length;n<s;n++,i++)e[i]=t[n];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.MDCComponent=void 0;var s=n(0),o=(a.attachTo=function(e){return new a(e,new s.MDCFoundation({}))},a.prototype.initialize=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},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(e,t,n){this.root.addEventListener(e,t,n)},a.prototype.unlisten=function(e,t,n){this.root.removeEventListener(e,t,n)},a.prototype.emit=function(e,t,n){var s;void 0===n&&(n=!1),"function"==typeof CustomEvent?s=new CustomEvent(e,{bubbles:n,detail:t}):(s=document.createEvent("CustomEvent")).initCustomEvent(e,n,!1,t),this.root.dispatchEvent(s)},a);function a(e,t){for(var n=[],s=2;s<arguments.length;s++)n[s-2]=arguments[s];this.root=e,this.initialize.apply(this,r([],i(n))),this.foundation=void 0===t?this.getDefaultFoundation():t,this.foundation.init(),this.initialSyncWithDOM()}t.MDCComponent=o,t.default=o},13:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.preventDefaultEvent=void 0;var s=["input","button","textarea","select"];t.preventDefaultEvent=function(e){var t=e.target;if(t){var n=(""+t.tagName).toLowerCase();-1===s.indexOf(n)&&e.preventDefault()}}},14:function(e,t,n){"use strict";var s,i=this&&this.__extends||(s=function(e,t){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,s=arguments.length;n<s;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,s){void 0===s&&(s=n),Object.defineProperty(e,s,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,s){void 0===s&&(s=n),e[s]=t[n]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return a(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.MDCListFoundation=void 0;var u=n(0),p=n(8),m=n(9),A=n(13),S=d(n(23));var c,l=(c=u.MDCFoundation,i(I,c),Object.defineProperty(I,"strings",{get:function(){return m.strings},enumerable:!1,configurable:!0}),Object.defineProperty(I,"cssClasses",{get:function(){return m.cssClasses},enumerable:!1,configurable:!0}),Object.defineProperty(I,"numbers",{get:function(){return m.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(){},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(e){this.wrapFocus=e},I.prototype.setVerticalOrientation=function(e){this.isVertical=e},I.prototype.setSingleSelection=function(e){(this.isSingleSelectionList=e)&&(this.maybeInitializeSingleSelection(),this.selectedIndex=this.getSelectedIndexFromDOM())},I.prototype.maybeInitializeSingleSelection=function(){var e=this.getSelectedIndexFromDOM();e!==m.numbers.UNSET_INDEX&&(this.adapter.listItemAtIndexHasClass(e,m.cssClasses.LIST_ITEM_ACTIVATED_CLASS)&&this.setUseActivatedClass(!0),this.isSingleSelectionList=!0,this.selectedIndex=e)},I.prototype.getSelectedIndexFromDOM=function(){for(var e=m.numbers.UNSET_INDEX,t=this.adapter.getListItemCount(),n=0;n<t;n++){var s=this.adapter.listItemAtIndexHasClass(n,m.cssClasses.LIST_ITEM_SELECTED_CLASS),i=this.adapter.listItemAtIndexHasClass(n,m.cssClasses.LIST_ITEM_ACTIVATED_CLASS);if(s||i){e=n;break}}return e},I.prototype.setHasTypeahead=function(e){(this.hasTypeahead=e)&&(this.sortedIndexByFirstChar=this.typeaheadInitSortedIndex())},I.prototype.isTypeaheadInProgress=function(){return this.hasTypeahead&&S.isTypingInProgress(this.typeaheadState)},I.prototype.setUseActivatedClass=function(e){this.useActivatedClass=e},I.prototype.setUseSelectedAttribute=function(e){this.useSelectedAttr=e},I.prototype.getSelectedIndex=function(){return this.selectedIndex},I.prototype.setSelectedIndex=function(e,t){var n=(void 0===t?{}:t).forceUpdate;this.isIndexValid(e)&&(this.isCheckboxList?this.setCheckboxAtIndex(e):this.isRadioList?this.setRadioAtIndex(e):this.setSingleSelectionAtIndex(e,{forceUpdate:n}))},I.prototype.handleFocusIn=function(e){0<=e&&(this.focusedItemIndex=e,this.adapter.setAttributeForElementIndex(e,"tabindex","0"),this.adapter.setTabIndexForListItemChildren(e,"0"))},I.prototype.handleFocusOut=function(e){var t=this;0<=e&&(this.adapter.setAttributeForElementIndex(e,"tabindex","-1"),this.adapter.setTabIndexForListItemChildren(e,"-1")),setTimeout(function(){t.adapter.isFocusInsideList()||t.setTabindexToFirstSelectedOrFocusedItem()},0)},I.prototype.handleKeydown=function(e,t,n){var s=this,i="ArrowLeft"===p.normalizeKey(e),r="ArrowUp"===p.normalizeKey(e),o="ArrowRight"===p.normalizeKey(e),a="ArrowDown"===p.normalizeKey(e),d="Home"===p.normalizeKey(e),u="End"===p.normalizeKey(e),c="Enter"===p.normalizeKey(e),l="Spacebar"===p.normalizeKey(e),I="A"===e.key||"a"===e.key;if(this.adapter.isRootFocused()){if(r||u?(e.preventDefault(),this.focusLastElement()):(a||d)&&(e.preventDefault(),this.focusFirstElement()),this.hasTypeahead){var h={event:e,focusItemAtIndex:function(e){s.focusItemAtIndex(e)},focusedItemIndex:-1,isTargetListItem:t,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:function(e){return s.adapter.listItemAtIndexHasClass(e,m.cssClasses.LIST_ITEM_DISABLED_CLASS)}};S.handleKeydown(h,this.typeaheadState)}}else{var f=this.adapter.getFocusedElementIndex();if(!(-1===f&&(f=n)<0)){if(this.isVertical&&a||!this.isVertical&&o)A.preventDefaultEvent(e),this.focusNextElement(f);else if(this.isVertical&&r||!this.isVertical&&i)A.preventDefaultEvent(e),this.focusPrevElement(f);else if(d)A.preventDefaultEvent(e),this.focusFirstElement();else if(u)A.preventDefaultEvent(e),this.focusLastElement();else if(I&&e.ctrlKey&&this.isCheckboxList)e.preventDefault(),this.toggleAll(this.selectedIndex===m.numbers.UNSET_INDEX?[]:this.selectedIndex);else if((c||l)&&t){var E=e.target;if(E&&"A"===E.tagName&&c)return;if(A.preventDefaultEvent(e),this.adapter.listItemAtIndexHasClass(f,m.cssClasses.LIST_ITEM_DISABLED_CLASS))return;this.isTypeaheadInProgress()||(this.isSelectableList()&&this.setSelectedIndexOnAction(f),this.adapter.notifyAction(f))}this.hasTypeahead&&(h={event:e,focusItemAtIndex:function(e){s.focusItemAtIndex(e)},focusedItemIndex:this.focusedItemIndex,isTargetListItem:t,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:function(e){return s.adapter.listItemAtIndexHasClass(e,m.cssClasses.LIST_ITEM_DISABLED_CLASS)}},S.handleKeydown(h,this.typeaheadState))}}},I.prototype.handleClick=function(e,t){e!==m.numbers.UNSET_INDEX&&(this.adapter.listItemAtIndexHasClass(e,m.cssClasses.LIST_ITEM_DISABLED_CLASS)||(this.isSelectableList()&&this.setSelectedIndexOnAction(e,t),this.adapter.notifyAction(e)))},I.prototype.focusNextElement=function(e){var t=e+1;if(this.adapter.getListItemCount()<=t){if(!this.wrapFocus)return e;t=0}return this.focusItemAtIndex(t),t},I.prototype.focusPrevElement=function(e){var t=e-1;if(t<0){if(!this.wrapFocus)return e;t=this.adapter.getListItemCount()-1}return this.focusItemAtIndex(t),t},I.prototype.focusFirstElement=function(){return this.focusItemAtIndex(0),0},I.prototype.focusLastElement=function(){var e=this.adapter.getListItemCount()-1;return this.focusItemAtIndex(e),e},I.prototype.focusInitialElement=function(){var e=this.getFirstSelectedOrFocusedItemIndex();return this.focusItemAtIndex(e),e},I.prototype.setEnabled=function(e,t){this.isIndexValid(e)&&(t?(this.adapter.removeClassForElementIndex(e,m.cssClasses.LIST_ITEM_DISABLED_CLASS),this.adapter.setAttributeForElementIndex(e,m.strings.ARIA_DISABLED,"false")):(this.adapter.addClassForElementIndex(e,m.cssClasses.LIST_ITEM_DISABLED_CLASS),this.adapter.setAttributeForElementIndex(e,m.strings.ARIA_DISABLED,"true")))},I.prototype.setSingleSelectionAtIndex=function(e,t){var n=(void 0===t?{}:t).forceUpdate;if(this.selectedIndex!==e||n){var s=m.cssClasses.LIST_ITEM_SELECTED_CLASS;this.useActivatedClass&&(s=m.cssClasses.LIST_ITEM_ACTIVATED_CLASS),this.selectedIndex!==m.numbers.UNSET_INDEX&&this.adapter.removeClassForElementIndex(this.selectedIndex,s),this.setAriaForSingleSelectionAtIndex(e),this.setTabindexAtIndex(e),e!==m.numbers.UNSET_INDEX&&this.adapter.addClassForElementIndex(e,s),this.selectedIndex=e}},I.prototype.setAriaForSingleSelectionAtIndex=function(e){this.selectedIndex===m.numbers.UNSET_INDEX&&(this.ariaCurrentAttrValue=this.adapter.getAttributeForElementIndex(e,m.strings.ARIA_CURRENT));var t=null!==this.ariaCurrentAttrValue,n=t?m.strings.ARIA_CURRENT:m.strings.ARIA_SELECTED;if(this.selectedIndex!==m.numbers.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex,n,"false"),e!==m.numbers.UNSET_INDEX){var s=t?this.ariaCurrentAttrValue:"true";this.adapter.setAttributeForElementIndex(e,n,s)}},I.prototype.getSelectionAttribute=function(){return this.useSelectedAttr?m.strings.ARIA_SELECTED:m.strings.ARIA_CHECKED},I.prototype.setRadioAtIndex=function(e){var t=this.getSelectionAttribute();this.adapter.setCheckedCheckboxOrRadioAtIndex(e,!0),this.selectedIndex!==m.numbers.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex,t,"false"),this.adapter.setAttributeForElementIndex(e,t,"true"),this.selectedIndex=e},I.prototype.setCheckboxAtIndex=function(e){for(var t=this.getSelectionAttribute(),n=0;n<this.adapter.getListItemCount();n++){var s=!1;0<=e.indexOf(n)&&(s=!0),this.adapter.setCheckedCheckboxOrRadioAtIndex(n,s),this.adapter.setAttributeForElementIndex(n,t,s?"true":"false")}this.selectedIndex=e},I.prototype.setTabindexAtIndex=function(e){this.focusedItemIndex===m.numbers.UNSET_INDEX&&0!==e?this.adapter.setAttributeForElementIndex(0,"tabindex","-1"):0<=this.focusedItemIndex&&this.focusedItemIndex!==e&&this.adapter.setAttributeForElementIndex(this.focusedItemIndex,"tabindex","-1"),this.selectedIndex instanceof Array||this.selectedIndex===e||this.adapter.setAttributeForElementIndex(this.selectedIndex,"tabindex","-1"),e!==m.numbers.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(e,"tabindex","0")},I.prototype.isSelectableList=function(){return this.isSingleSelectionList||this.isCheckboxList||this.isRadioList},I.prototype.setTabindexToFirstSelectedOrFocusedItem=function(){var e=this.getFirstSelectedOrFocusedItemIndex();this.setTabindexAtIndex(e)},I.prototype.getFirstSelectedOrFocusedItemIndex=function(){return this.isSelectableList()?"number"==typeof this.selectedIndex&&this.selectedIndex!==m.numbers.UNSET_INDEX?this.selectedIndex:function(e){return e instanceof Array}(this.selectedIndex)&&0<this.selectedIndex.length?this.selectedIndex.reduce(function(e,t){return Math.min(e,t)}):0:Math.max(this.focusedItemIndex,0)},I.prototype.isIndexValid=function(e){var t=this;if(e instanceof Array){if(!this.isCheckboxList)throw new Error("MDCListFoundation: Array of index is only supported for checkbox based list");return 0===e.length||e.some(function(e){return t.isIndexInRange(e)})}if("number"!=typeof e)return!1;if(this.isCheckboxList)throw new Error("MDCListFoundation: Expected array of index for checkbox based list but got number: "+e);return this.isIndexInRange(e)||this.isSingleSelectionList&&e===m.numbers.UNSET_INDEX},I.prototype.isIndexInRange=function(e){var t=this.adapter.getListItemCount();return 0<=e&&e<t},I.prototype.setSelectedIndexOnAction=function(e,t){void 0===t&&(t=!0),this.isCheckboxList?this.toggleCheckboxAtIndex(e,t):this.setSelectedIndex(e)},I.prototype.toggleCheckboxAtIndex=function(t,e){var n=this.getSelectionAttribute(),s=this.adapter.isCheckboxCheckedAtIndex(t);e&&(s=!s,this.adapter.setCheckedCheckboxOrRadioAtIndex(t,s)),this.adapter.setAttributeForElementIndex(t,n,s?"true":"false");var i=this.selectedIndex===m.numbers.UNSET_INDEX?[]:this.selectedIndex.slice();s?i.push(t):i=i.filter(function(e){return e!==t}),this.selectedIndex=i},I.prototype.focusItemAtIndex=function(e){this.adapter.focusItemAtIndex(e),this.focusedItemIndex=e},I.prototype.toggleAll=function(e){var t=this.adapter.getListItemCount();if(e.length===t)this.setCheckboxAtIndex([]);else{for(var n=[],s=0;s<t;s++)(!this.adapter.listItemAtIndexHasClass(s,m.cssClasses.LIST_ITEM_DISABLED_CLASS)||-1<e.indexOf(s))&&n.push(s);this.setCheckboxAtIndex(n)}},I.prototype.typeaheadMatchItem=function(e,t,n){var s=this;void 0===n&&(n=!1);var i={focusItemAtIndex:function(e){s.focusItemAtIndex(e)},focusedItemIndex:t||this.focusedItemIndex,nextChar:e,sortedIndexByFirstChar:this.sortedIndexByFirstChar,skipFocus:n,isItemAtIndexDisabled:function(e){return s.adapter.listItemAtIndexHasClass(e,m.cssClasses.LIST_ITEM_DISABLED_CLASS)}};return S.matchItem(i,this.typeaheadState)},I.prototype.typeaheadInitSortedIndex=function(){return S.initSortedIndex(this.adapter.getListItemCount(),this.adapter.getPrimaryTextAtIndex)},I.prototype.clearTypeaheadBuffer=function(){S.clearBuffer(this.typeaheadState)},I);function I(e){var t=c.call(this,r(r({},I.defaultAdapter),e))||this;return t.wrapFocus=!1,t.isVertical=!0,t.isSingleSelectionList=!1,t.selectedIndex=m.numbers.UNSET_INDEX,t.focusedItemIndex=m.numbers.UNSET_INDEX,t.useActivatedClass=!1,t.useSelectedAttr=!1,t.ariaCurrentAttrValue=null,t.isCheckboxList=!1,t.isRadioList=!1,t.hasTypeahead=!1,t.typeaheadState=S.initState(),t.sortedIndexByFirstChar=new Map,t}t.MDCListFoundation=l,t.default=l},192:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){void 0===s&&(s=n),Object.defineProperty(e,s,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,s){void 0===s&&(s=n),e[s]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||s(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(193),t),i(n(22),t),i(n(9),t),i(n(14),t),i(n(194),t)},193:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},194:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2:function(e,t,n){"use strict";function s(e,t){return(e.matches||e.webkitMatchesSelector||e.msMatchesSelector).call(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.estimateScrollWidth=t.matches=t.closest=void 0,t.closest=function(e,t){if(e.closest)return e.closest(t);for(var n=e;n;){if(s(n,t))return n;n=n.parentElement}return null},t.matches=s,t.estimateScrollWidth=function(e){var t=e;if(null!==t.offsetParent)return t.scrollWidth;var n=t.cloneNode(!0);n.style.setProperty("position","absolute"),n.style.setProperty("transform","translate(-9999px, -9999px)"),document.documentElement.appendChild(n);var s=n.scrollWidth;return document.documentElement.removeChild(n),s}},22:function(e,t,n){"use strict";var s,i=this&&this.__extends||(s=function(e,t){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.MDCList=void 0;var r,o=n(1),a=n(2),d=n(9),u=n(14),c=(r=o.MDCComponent,i(l,r),Object.defineProperty(l.prototype,"vertical",{set:function(e){this.foundation.setVerticalOrientation(e)},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"listElements",{get:function(){return Array.from(this.root.querySelectorAll("."+this.classNameMap[d.cssClasses.LIST_ITEM_CLASS]))},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"wrapFocus",{set:function(e){this.foundation.setWrapFocus(e)},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(e){this.foundation.setHasTypeahead(e)},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"singleSelection",{set:function(e){this.foundation.setSingleSelection(e)},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"selectedIndex",{get:function(){return this.foundation.getSelectedIndex()},set:function(e){this.foundation.setSelectedIndex(e)},enumerable:!1,configurable:!0}),l.attachTo=function(e){return new l(e)},l.prototype.initialSyncWithDOM=function(){this.isEvolutionEnabled=d.evolutionAttribute in this.root.dataset,this.isEvolutionEnabled?this.classNameMap=d.evolutionClassNameMap:a.matches(this.root,d.strings.DEPRECATED_SELECTOR)?this.classNameMap=d.deprecatedClassNameMap:this.classNameMap=Object.values(d.cssClasses).reduce(function(e,t){return e[t]=t,e},{}),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 e=this.root.getAttribute(d.strings.ARIA_ORIENTATION);this.vertical=e!==d.strings.ARIA_ORIENTATION_HORIZONTAL;var t="."+this.classNameMap[d.cssClasses.LIST_ITEM_CLASS]+":not([tabindex])",n=d.strings.FOCUSABLE_CHILD_ELEMENTS,s=this.root.querySelectorAll(t);s.length&&Array.prototype.forEach.call(s,function(e){e.setAttribute("tabindex","-1")});var i=this.root.querySelectorAll(n);i.length&&Array.prototype.forEach.call(i,function(e){e.setAttribute("tabindex","-1")}),this.isEvolutionEnabled&&this.foundation.setUseSelectedAttribute(!0),this.foundation.layout()},l.prototype.getPrimaryText=function(e){var t,n=e.querySelector("."+this.classNameMap[d.cssClasses.LIST_ITEM_PRIMARY_TEXT_CLASS]);if(this.isEvolutionEnabled||n)return null!==(t=null==n?void 0:n.textContent)&&void 0!==t?t:"";var s=e.querySelector("."+this.classNameMap[d.cssClasses.LIST_ITEM_TEXT_CLASS]);return s&&s.textContent||""},l.prototype.initializeListType=function(){var t=this;if(this.isInteractive=a.matches(this.root,d.strings.ARIA_INTERACTIVE_ROLES_SELECTOR),this.isEvolutionEnabled&&this.isInteractive){var e=Array.from(this.root.querySelectorAll(d.strings.SELECTED_ITEM_SELECTOR),function(e){return t.listElements.indexOf(e)});a.matches(this.root,d.strings.ARIA_MULTI_SELECTABLE_SELECTOR)?this.selectedIndex=e:0<e.length&&(this.selectedIndex=e[0])}else{var n=this.root.querySelectorAll(d.strings.ARIA_ROLE_CHECKBOX_SELECTOR),s=this.root.querySelector(d.strings.ARIA_CHECKED_RADIO_SELECTOR);if(n.length){var i=this.root.querySelectorAll(d.strings.ARIA_CHECKED_CHECKBOX_SELECTOR);this.selectedIndex=Array.from(i,function(e){return t.listElements.indexOf(e)})}else s&&(this.selectedIndex=this.listElements.indexOf(s))}},l.prototype.setEnabled=function(e,t){this.foundation.setEnabled(e,t)},l.prototype.typeaheadMatchItem=function(e,t){return this.foundation.typeaheadMatchItem(e,t,!0)},l.prototype.getDefaultFoundation=function(){var i=this,e={addClassForElementIndex:function(e,t){var n=i.listElements[e];n&&n.classList.add(i.classNameMap[t])},focusItemAtIndex:function(e){var t=i.listElements[e];t&&t.focus()},getAttributeForElementIndex:function(e,t){return i.listElements[e].getAttribute(t)},getFocusedElementIndex:function(){return i.listElements.indexOf(document.activeElement)},getListItemCount:function(){return i.listElements.length},getPrimaryTextAtIndex:function(e){return i.getPrimaryText(i.listElements[e])},hasCheckboxAtIndex:function(e){return!!i.listElements[e].querySelector(d.strings.CHECKBOX_SELECTOR)},hasRadioAtIndex:function(e){return!!i.listElements[e].querySelector(d.strings.RADIO_SELECTOR)},isCheckboxCheckedAtIndex:function(e){return i.listElements[e].querySelector(d.strings.CHECKBOX_SELECTOR).checked},isFocusInsideList:function(){return i.root!==document.activeElement&&i.root.contains(document.activeElement)},isRootFocused:function(){return document.activeElement===i.root},listItemAtIndexHasClass:function(e,t){return i.listElements[e].classList.contains(i.classNameMap[t])},notifyAction:function(e){i.emit(d.strings.ACTION_EVENT,{index:e},!0)},removeClassForElementIndex:function(e,t){var n=i.listElements[e];n&&n.classList.remove(i.classNameMap[t])},setAttributeForElementIndex:function(e,t,n){var s=i.listElements[e];s&&s.setAttribute(t,n)},setCheckedCheckboxOrRadioAtIndex:function(e,t){var n=i.listElements[e].querySelector(d.strings.CHECKBOX_RADIO_SELECTOR);n.checked=t;var s=document.createEvent("Event");s.initEvent("change",!0,!0),n.dispatchEvent(s)},setTabIndexForListItemChildren:function(e,t){var n=i.listElements[e],s=d.strings.CHILD_ELEMENTS_TO_TOGGLE_TABINDEX;Array.prototype.forEach.call(n.querySelectorAll(s),function(e){e.setAttribute("tabindex",t)})}};return new u.MDCListFoundation(e)},l.prototype.ensureFocusable=function(){if(this.isEvolutionEnabled&&this.isInteractive&&!this.root.querySelector("."+this.classNameMap[d.cssClasses.LIST_ITEM_CLASS]+'[tabindex="0"]')){var e=this.initialFocusIndex();-1!==e&&(this.listElements[e].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!==d.numbers.UNSET_INDEX)return this.selectedIndex;var e=this.root.querySelector("."+this.classNameMap[d.cssClasses.LIST_ITEM_CLASS]+":not(."+this.classNameMap[d.cssClasses.LIST_ITEM_DISABLED_CLASS]+")");return null===e?-1:this.getListItemIndex(e)},l.prototype.getListItemIndex=function(e){var t=a.closest(e,"."+this.classNameMap[d.cssClasses.LIST_ITEM_CLASS]+", ."+this.classNameMap[d.cssClasses.ROOT]);return t&&a.matches(t,"."+this.classNameMap[d.cssClasses.LIST_ITEM_CLASS])?this.listElements.indexOf(t):-1},l.prototype.handleFocusInEvent=function(e){var t=this.getListItemIndex(e.target);this.foundation.handleFocusIn(t)},l.prototype.handleFocusOutEvent=function(e){var t=this.getListItemIndex(e.target);this.foundation.handleFocusOut(t)},l.prototype.handleKeydownEvent=function(e){var t=this.getListItemIndex(e.target),n=e.target;this.foundation.handleKeydown(e,n.classList.contains(this.classNameMap[d.cssClasses.LIST_ITEM_CLASS]),t)},l.prototype.handleClickEvent=function(e){var t=this.getListItemIndex(e.target),n=e.target,s=!a.matches(n,d.strings.CHECKBOX_RADIO_SELECTOR);this.foundation.handleClick(t,s)},l);function l(){return null!==r&&r.apply(this,arguments)||this}t.MDCList=c},23:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleKeydown=t.clearBuffer=t.isTypingInProgress=t.matchItem=t.initSortedIndex=t.initState=void 0;var p=n(8),u=n(9),m=n(13);function A(e,t){var n,s=e.nextChar,i=e.focusItemAtIndex,r=e.sortedIndexByFirstChar,o=e.focusedItemIndex,a=e.skipFocus,d=e.isItemAtIndexDisabled;return clearTimeout(t.bufferClearTimeout),t.bufferClearTimeout=setTimeout(function(){c(t)},u.numbers.TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS),t.typeaheadBuffer=t.typeaheadBuffer+s,-1===(n=1===t.typeaheadBuffer.length?function(e,t,n,s){var i=s.typeaheadBuffer[0],r=e.get(i);if(!r)return-1;if(i===s.currentFirstChar&&r[s.sortedIndexCursor].index===t){s.sortedIndexCursor=(s.sortedIndexCursor+1)%r.length;var o=r[s.sortedIndexCursor].index;if(!n(o))return o}s.currentFirstChar=i;var a,d=-1;for(a=0;a<r.length;a++)if(!n(r[a].index)){d=a;break}for(;a<r.length;a++)if(r[a].index>t&&!n(r[a].index)){d=a;break}return-1===d?-1:(s.sortedIndexCursor=d,r[s.sortedIndexCursor].index)}(r,o,d,t):function(e,t,n){var s=n.typeaheadBuffer[0],i=e.get(s);if(!i)return-1;var r=i[n.sortedIndexCursor];if(0===r.text.lastIndexOf(n.typeaheadBuffer,0)&&!t(r.index))return r.index;var o=(n.sortedIndexCursor+1)%i.length,a=-1;for(;o!==n.sortedIndexCursor;){var d=i[o],u=0===d.text.lastIndexOf(n.typeaheadBuffer,0),c=!t(d.index);if(u&&c){a=o;break}o=(o+1)%i.length}return-1===a?-1:(n.sortedIndexCursor=a,i[n.sortedIndexCursor].index)}(r,d,t))||a||i(n),n}function S(e){return 0<e.typeaheadBuffer.length}function c(e){e.typeaheadBuffer=""}t.initState=function(){return{bufferClearTimeout:0,currentFirstChar:"",sortedIndexCursor:0,typeaheadBuffer:""}},t.initSortedIndex=function(e,t){for(var n=new Map,s=0;s<e;s++){var i=t(s).trim();if(i){var r=i[0].toLowerCase();n.has(r)||n.set(r,[]),n.get(r).push({text:i.toLowerCase(),index:s})}}return n.forEach(function(e){e.sort(function(e,t){return e.index-t.index})}),n},t.matchItem=A,t.isTypingInProgress=S,t.clearBuffer=c,t.handleKeydown=function(e,t){var n=e.event,s=e.isTargetListItem,i=e.focusedItemIndex,r=e.focusItemAtIndex,o=e.sortedIndexByFirstChar,a=e.isItemAtIndexDisabled,d="ArrowLeft"===p.normalizeKey(n),u="ArrowUp"===p.normalizeKey(n),c="ArrowRight"===p.normalizeKey(n),l="ArrowDown"===p.normalizeKey(n),I="Home"===p.normalizeKey(n),h="End"===p.normalizeKey(n),f="Enter"===p.normalizeKey(n),E="Spacebar"===p.normalizeKey(n);return n.ctrlKey||n.metaKey||d||u||c||l||I||h||f?-1:E||1!==n.key.length?E?(s&&m.preventDefaultEvent(n),s&&S(t)?A({focusItemAtIndex:r,focusedItemIndex:i,nextChar:" ",sortedIndexByFirstChar:o,skipFocus:!1,isItemAtIndexDisabled:a},t):-1):-1:(m.preventDefaultEvent(n),A({focusItemAtIndex:r,focusedItemIndex:i,nextChar:n.key.toLowerCase(),sortedIndexByFirstChar:o,skipFocus:!1,isItemAtIndexDisabled:a},t))}},8:function(e,s,t){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.isNavigationEvent=s.normalizeKey=s.KEY=void 0,s.KEY={UNKNOWN:"Unknown",BACKSPACE:"Backspace",ENTER:"Enter",SPACEBAR:"Spacebar",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",END:"End",HOME:"Home",ARROW_LEFT:"ArrowLeft",ARROW_UP:"ArrowUp",ARROW_RIGHT:"ArrowRight",ARROW_DOWN:"ArrowDown",DELETE:"Delete",ESCAPE:"Escape",TAB:"Tab"};var i=new Set;i.add(s.KEY.BACKSPACE),i.add(s.KEY.ENTER),i.add(s.KEY.SPACEBAR),i.add(s.KEY.PAGE_UP),i.add(s.KEY.PAGE_DOWN),i.add(s.KEY.END),i.add(s.KEY.HOME),i.add(s.KEY.ARROW_LEFT),i.add(s.KEY.ARROW_UP),i.add(s.KEY.ARROW_RIGHT),i.add(s.KEY.ARROW_DOWN),i.add(s.KEY.DELETE),i.add(s.KEY.ESCAPE),i.add(s.KEY.TAB);var n=8,r=13,o=32,a=33,d=34,u=35,c=36,l=37,I=38,h=39,f=40,E=46,p=27,m=9,A=new Map;A.set(n,s.KEY.BACKSPACE),A.set(r,s.KEY.ENTER),A.set(o,s.KEY.SPACEBAR),A.set(a,s.KEY.PAGE_UP),A.set(d,s.KEY.PAGE_DOWN),A.set(u,s.KEY.END),A.set(c,s.KEY.HOME),A.set(l,s.KEY.ARROW_LEFT),A.set(I,s.KEY.ARROW_UP),A.set(h,s.KEY.ARROW_RIGHT),A.set(f,s.KEY.ARROW_DOWN),A.set(E,s.KEY.DELETE),A.set(p,s.KEY.ESCAPE),A.set(m,s.KEY.TAB);var S=new Set;function _(e){var t=e.key;if(i.has(t))return t;var n=A.get(e.keyCode);return n||s.KEY.UNKNOWN}S.add(s.KEY.PAGE_UP),S.add(s.KEY.PAGE_DOWN),S.add(s.KEY.END),S.add(s.KEY.HOME),S.add(s.KEY.ARROW_LEFT),S.add(s.KEY.ARROW_UP),S.add(s.KEY.ARROW_RIGHT),S.add(s.KEY.ARROW_DOWN),s.normalizeKey=_,s.isNavigationEvent=function(e){return S.has(_(e))}},9:function(e,t,n){"use strict";var s,i;Object.defineProperty(t,"__esModule",{value:!0}),t.evolutionClassNameMap=t.evolutionAttribute=t.deprecatedClassNameMap=t.numbers=t.cssClasses=t.strings=void 0;var r={LIST_ITEM_ACTIVATED_CLASS:"mdc-list-item--activated",LIST_ITEM_CLASS:"mdc-list-item",LIST_ITEM_DISABLED_CLASS:"mdc-list-item--disabled",LIST_ITEM_SELECTED_CLASS:"mdc-list-item--selected",LIST_ITEM_TEXT_CLASS:"mdc-list-item__text",LIST_ITEM_PRIMARY_TEXT_CLASS:"mdc-list-item__primary-text",ROOT:"mdc-list"},o=((s={})[""+(t.cssClasses=r).LIST_ITEM_ACTIVATED_CLASS]="mdc-list-item--activated",s[""+r.LIST_ITEM_CLASS]="mdc-list-item",s[""+r.LIST_ITEM_DISABLED_CLASS]="mdc-list-item--disabled",s[""+r.LIST_ITEM_SELECTED_CLASS]="mdc-list-item--selected",s[""+r.LIST_ITEM_PRIMARY_TEXT_CLASS]="mdc-list-item__primary-text",s[""+r.ROOT]="mdc-list",s);t.evolutionClassNameMap=o;var a=((i={})[""+r.LIST_ITEM_ACTIVATED_CLASS]="mdc-deprecated-list-item--activated",i[""+r.LIST_ITEM_CLASS]="mdc-deprecated-list-item",i[""+r.LIST_ITEM_DISABLED_CLASS]="mdc-deprecated-list-item--disabled",i[""+r.LIST_ITEM_SELECTED_CLASS]="mdc-deprecated-list-item--selected",i[""+r.LIST_ITEM_TEXT_CLASS]="mdc-deprecated-list-item__text",i[""+r.LIST_ITEM_PRIMARY_TEXT_CLASS]="mdc-deprecated-list-item__primary-text",i[""+r.ROOT]="mdc-deprecated-list",i);t.deprecatedClassNameMap=a;var d={ACTION_EVENT:"MDCList:action",ARIA_CHECKED:"aria-checked",ARIA_CHECKED_CHECKBOX_SELECTOR:'[role="checkbox"][aria-checked="true"]',ARIA_CHECKED_RADIO_SELECTOR:'[role="radio"][aria-checked="true"]',ARIA_CURRENT:"aria-current",ARIA_DISABLED:"aria-disabled",ARIA_ORIENTATION:"aria-orientation",ARIA_ORIENTATION_HORIZONTAL:"horizontal",ARIA_ROLE_CHECKBOX_SELECTOR:'[role="checkbox"]',ARIA_SELECTED:"aria-selected",ARIA_INTERACTIVE_ROLES_SELECTOR:'[role="listbox"], [role="menu"]',ARIA_MULTI_SELECTABLE_SELECTOR:'[aria-multiselectable="true"]',CHECKBOX_RADIO_SELECTOR:'input[type="checkbox"], input[type="radio"]',CHECKBOX_SELECTOR:'input[type="checkbox"]',CHILD_ELEMENTS_TO_TOGGLE_TABINDEX:"\n ."+r.LIST_ITEM_CLASS+" button:not(:disabled),\n ."+r.LIST_ITEM_CLASS+" a,\n ."+a[r.LIST_ITEM_CLASS]+" button:not(:disabled),\n ."+a[r.LIST_ITEM_CLASS]+" a\n ",DEPRECATED_SELECTOR:".mdc-deprecated-list",FOCUSABLE_CHILD_ELEMENTS:"\n ."+r.LIST_ITEM_CLASS+" button:not(:disabled),\n ."+r.LIST_ITEM_CLASS+" a,\n ."+r.LIST_ITEM_CLASS+' input[type="radio"]:not(:disabled),\n .'+r.LIST_ITEM_CLASS+' input[type="checkbox"]:not(:disabled),\n .'+a[r.LIST_ITEM_CLASS]+" button:not(:disabled),\n ."+a[r.LIST_ITEM_CLASS]+" a,\n ."+a[r.LIST_ITEM_CLASS]+' input[type="radio"]:not(:disabled),\n .'+a[r.LIST_ITEM_CLASS]+' input[type="checkbox"]:not(:disabled)\n ',RADIO_SELECTOR:'input[type="radio"]',SELECTED_ITEM_SELECTOR:'[aria-selected="true"], [aria-current="true"]'};t.strings=d;t.numbers={UNSET_INDEX:-1,TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS:300};t.evolutionAttribute="evolution"}},i.c=s,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)i.d(n,s,function(e){return t[e]}.bind(null,s));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=192);function i(e){if(s[e])return s[e].exports;var t=s[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}var n,s});
\No newline at end of file