@material/list
Version:
The Material Components for the web list component
1 lines • 37.7 kB
JavaScript
!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 i={},s.m=n={0:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MDCFoundation=void 0;var i=(Object.defineProperty(s,"cssClasses",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(s,"strings",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(s,"numbers",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(s,"defaultAdapter",{get:function(){return{}},enumerable:!1,configurable:!0}),s.prototype.init=function(){},s.prototype.destroy=function(){},s);function s(e){void 0===e&&(e={}),this.adapter=e}t.MDCFoundation=i,t.default=i},1:function(e,t,n){"use strict";var s=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,s,r=n.call(e),o=[];try{for(;(void 0===t||0<t--)&&!(i=r.next()).done;)o.push(i.value)}catch(e){s={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o},r=this&&this.__spreadArray||function(e,t){for(var n=0,i=t.length,s=e.length;n<i;n++,s++)e[s]=t[n];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.MDCComponent=void 0;var i=n(0),o=(a.attachTo=function(e){return new a(e,new i.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 i;void 0===n&&(n=!1),"function"==typeof CustomEvent?i=new CustomEvent(e,{bubbles:n,detail:t}):(i=document.createEvent("CustomEvent")).initCustomEvent(e,n,!1,t),this.root.dispatchEvent(i)},a);function a(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];this.root=e,this.initialize.apply(this,r([],s(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 i=["input","button","textarea","select"];t.preventDefaultEvent=function(e){var t=e.target;if(t){var n=(""+t.tagName).toLowerCase();-1===i.indexOf(n)&&e.preventDefault()}}},14:function(e,t,n){"use strict";var i,s=this&&this.__extends||(i=function(e,t){return(i=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}i(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,i=arguments.length;n<i;n++)for(var s in t=arguments[n])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e}).apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,i){void 0===i&&(i=n),e[i]=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},l=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,s,r=n.call(e),o=[];try{for(;(void 0===t||0<t--)&&!(i=r.next()).done;)o.push(i.value)}catch(e){s={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o},h=this&&this.__spreadArray||function(e,t){for(var n=0,i=t.length,s=e.length;n<i;n++,s++)e[s]=t[n];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.MDCListFoundation=void 0;var u=n(0),C=n(8),y=n(9),_=n(13),b=d(n(23));var c=["Alt","Control","Meta","Shift"];function T(t){var n=new Set(t?c.filter(function(e){return t.getModifierState(e)}):[]);return function(e){return e.every(function(e){return n.has(e)})&&e.length===n.size}}var f,I=(f=u.MDCFoundation,s(E,f),Object.defineProperty(E,"strings",{get:function(){return y.strings},enumerable:!1,configurable:!0}),Object.defineProperty(E,"cssClasses",{get:function(){return y.cssClasses},enumerable:!1,configurable:!0}),Object.defineProperty(E,"numbers",{get:function(){return y.numbers},enumerable:!1,configurable:!0}),Object.defineProperty(E,"defaultAdapter",{get:function(){return{addClassForElementIndex:function(){},focusItemAtIndex:function(){},getAttributeForElementIndex:function(){return null},getFocusedElementIndex:function(){return 0},getListItemCount:function(){return 0},hasCheckboxAtIndex:function(){return!1},hasRadioAtIndex:function(){return!1},isCheckboxCheckedAtIndex:function(){return!1},isFocusInsideList:function(){return!1},isRootFocused:function(){return!1},listItemAtIndexHasClass:function(){return!1},notifyAction:function(){},notifySelectionChange:function(){},removeClassForElementIndex:function(){},setAttributeForElementIndex:function(){},setCheckedCheckboxOrRadioAtIndex:function(){},setTabIndexForListItemChildren:function(){},getPrimaryTextAtIndex:function(){return""}}},enumerable:!1,configurable:!0}),E.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()))},E.prototype.getFocusedItemIndex=function(){return this.focusedItemIndex},E.prototype.setWrapFocus=function(e){this.wrapFocus=e},E.prototype.setVerticalOrientation=function(e){this.isVertical=e},E.prototype.setSingleSelection=function(e){(this.isSingleSelectionList=e)&&(this.maybeInitializeSingleSelection(),this.selectedIndex=this.getSelectedIndexFromDOM())},E.prototype.setDisabledItemsFocusable=function(e){this.areDisabledItemsFocusable=e},E.prototype.maybeInitializeSingleSelection=function(){var e=this.getSelectedIndexFromDOM();e!==y.numbers.UNSET_INDEX&&(this.adapter.listItemAtIndexHasClass(e,y.cssClasses.LIST_ITEM_ACTIVATED_CLASS)&&this.setUseActivatedClass(!0),this.isSingleSelectionList=!0,this.selectedIndex=e)},E.prototype.getSelectedIndexFromDOM=function(){for(var e=y.numbers.UNSET_INDEX,t=this.adapter.getListItemCount(),n=0;n<t;n++){var i=this.adapter.listItemAtIndexHasClass(n,y.cssClasses.LIST_ITEM_SELECTED_CLASS),s=this.adapter.listItemAtIndexHasClass(n,y.cssClasses.LIST_ITEM_ACTIVATED_CLASS);if(i||s){e=n;break}}return e},E.prototype.setHasTypeahead=function(e){(this.hasTypeahead=e)&&(this.sortedIndexByFirstChar=this.typeaheadInitSortedIndex())},E.prototype.isTypeaheadInProgress=function(){return this.hasTypeahead&&b.isTypingInProgress(this.typeaheadState)},E.prototype.setUseActivatedClass=function(e){this.useActivatedClass=e},E.prototype.setUseSelectedAttribute=function(e){this.useSelectedAttr=e},E.prototype.getSelectedIndex=function(){return this.selectedIndex},E.prototype.setSelectedIndex=function(e,t){void 0===t&&(t={}),this.isIndexValid(e)&&(this.isCheckboxList?this.setCheckboxAtIndex(e,t):this.isRadioList?this.setRadioAtIndex(e,t):this.setSingleSelectionAtIndex(e,t))},E.prototype.handleFocusIn=function(e){0<=e&&(this.focusedItemIndex=e,this.adapter.setAttributeForElementIndex(e,"tabindex","0"),this.adapter.setTabIndexForListItemChildren(e,"0"))},E.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)},E.prototype.isIndexDisabled=function(e){return this.adapter.listItemAtIndexHasClass(e,y.cssClasses.LIST_ITEM_DISABLED_CLASS)},E.prototype.handleKeydown=function(e,t,n){var i,s=this,r="ArrowLeft"===C.normalizeKey(e),o="ArrowUp"===C.normalizeKey(e),a="ArrowRight"===C.normalizeKey(e),d="ArrowDown"===C.normalizeKey(e),u="Home"===C.normalizeKey(e),c="End"===C.normalizeKey(e),l="Enter"===C.normalizeKey(e),h="Spacebar"===C.normalizeKey(e),f=this.isVertical&&d||!this.isVertical&&a,I=this.isVertical&&o||!this.isVertical&&r,E="A"===e.key||"a"===e.key,p=T(e);if(this.adapter.isRootFocused()){if((I||c)&&p([])?(e.preventDefault(),this.focusLastElement()):(f||u)&&p([])?(e.preventDefault(),this.focusFirstElement()):I&&p(["Shift"])&&this.isCheckboxList?(e.preventDefault(),-1!==(S=this.focusLastElement())&&this.setSelectedIndexOnAction(S,!1)):f&&p(["Shift"])&&this.isCheckboxList&&(e.preventDefault(),-1!==(S=this.focusFirstElement())&&this.setSelectedIndexOnAction(S,!1)),this.hasTypeahead){var m={event:e,focusItemAtIndex:function(e){s.focusItemAtIndex(e)},focusedItemIndex:-1,isTargetListItem:t,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:function(e){return s.isIndexDisabled(e)}};b.handleKeydown(m,this.typeaheadState)}}else{var x=this.adapter.getFocusedElementIndex();if(!(-1===x&&(x=n)<0)){if(f&&p([]))_.preventDefaultEvent(e),this.focusNextElement(x);else if(I&&p([]))_.preventDefaultEvent(e),this.focusPrevElement(x);else if(f&&p(["Shift"])&&this.isCheckboxList)_.preventDefaultEvent(e),-1!==(S=this.focusNextElement(x))&&this.setSelectedIndexOnAction(S,!1);else if(I&&p(["Shift"])&&this.isCheckboxList){var S;_.preventDefaultEvent(e),-1!==(S=this.focusPrevElement(x))&&this.setSelectedIndexOnAction(S,!1)}else if(u&&p([]))_.preventDefaultEvent(e),this.focusFirstElement();else if(c&&p([]))_.preventDefaultEvent(e),this.focusLastElement();else if(u&&p(["Control","Shift"])&&this.isCheckboxList){if(_.preventDefaultEvent(e),this.isIndexDisabled(x))return;this.focusFirstElement(),this.toggleCheckboxRange(0,x,x)}else if(c&&p(["Control","Shift"])&&this.isCheckboxList){if(_.preventDefaultEvent(e),this.isIndexDisabled(x))return;this.focusLastElement(),this.toggleCheckboxRange(x,this.adapter.getListItemCount()-1,x)}else if(E&&p(["Control"])&&this.isCheckboxList)e.preventDefault(),this.checkboxListToggleAll(this.selectedIndex===y.numbers.UNSET_INDEX?[]:this.selectedIndex,!0);else if((l||h)&&p([])){if(t){if((A=e.target)&&"A"===A.tagName&&l)return;if(_.preventDefaultEvent(e),this.isIndexDisabled(x))return;this.isTypeaheadInProgress()||(this.isSelectableList()&&this.setSelectedIndexOnAction(x,!1),this.adapter.notifyAction(x))}}else if((l||h)&&p(["Shift"])&&this.isCheckboxList){var A;if((A=e.target)&&"A"===A.tagName&&l)return;if(_.preventDefaultEvent(e),this.isIndexDisabled(x))return;this.isTypeaheadInProgress()||(this.toggleCheckboxRange(null!==(i=this.lastSelectedIndex)&&void 0!==i?i:x,x,x),this.adapter.notifyAction(x))}this.hasTypeahead&&(m={event:e,focusItemAtIndex:function(e){s.focusItemAtIndex(e)},focusedItemIndex:this.focusedItemIndex,isTargetListItem:t,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:function(e){return s.isIndexDisabled(e)}},b.handleKeydown(m,this.typeaheadState))}}},E.prototype.handleClick=function(e,t,n){var i,s=T(n);e!==y.numbers.UNSET_INDEX&&(this.isIndexDisabled(e)||(s([])?(this.isSelectableList()&&this.setSelectedIndexOnAction(e,t),this.adapter.notifyAction(e)):this.isCheckboxList&&s(["Shift"])&&(this.toggleCheckboxRange(null!==(i=this.lastSelectedIndex)&&void 0!==i?i:e,e,e),this.adapter.notifyAction(e))))},E.prototype.focusNextElement=function(e){var t=this.adapter.getListItemCount(),n=e,i=null;do{if(t<=++n){if(!this.wrapFocus)return e;n=0}if(n===i)return-1;i=null!=i?i:n}while(!this.areDisabledItemsFocusable&&this.isIndexDisabled(n));return this.focusItemAtIndex(n),n},E.prototype.focusPrevElement=function(e){var t=this.adapter.getListItemCount(),n=e,i=null;do{if(--n<0){if(!this.wrapFocus)return e;n=t-1}if(n===i)return-1;i=null!=i?i:n}while(!this.areDisabledItemsFocusable&&this.isIndexDisabled(n));return this.focusItemAtIndex(n),n},E.prototype.focusFirstElement=function(){return this.focusNextElement(-1)},E.prototype.focusLastElement=function(){return this.focusPrevElement(this.adapter.getListItemCount())},E.prototype.focusInitialElement=function(){var e=this.getFirstSelectedOrFocusedItemIndex();return this.focusItemAtIndex(e),e},E.prototype.setEnabled=function(e,t){this.isIndexValid(e,!1)&&(t?(this.adapter.removeClassForElementIndex(e,y.cssClasses.LIST_ITEM_DISABLED_CLASS),this.adapter.setAttributeForElementIndex(e,y.strings.ARIA_DISABLED,"false")):(this.adapter.addClassForElementIndex(e,y.cssClasses.LIST_ITEM_DISABLED_CLASS),this.adapter.setAttributeForElementIndex(e,y.strings.ARIA_DISABLED,"true")))},E.prototype.setSingleSelectionAtIndex=function(e,t){if(void 0===t&&(t={}),this.selectedIndex!==e||t.forceUpdate){var n=y.cssClasses.LIST_ITEM_SELECTED_CLASS;this.useActivatedClass&&(n=y.cssClasses.LIST_ITEM_ACTIVATED_CLASS),this.selectedIndex!==y.numbers.UNSET_INDEX&&this.adapter.removeClassForElementIndex(this.selectedIndex,n),this.setAriaForSingleSelectionAtIndex(e),this.setTabindexAtIndex(e),e!==y.numbers.UNSET_INDEX&&this.adapter.addClassForElementIndex(e,n),this.selectedIndex=e,t.isUserInteraction&&!t.forceUpdate&&this.adapter.notifySelectionChange([e])}},E.prototype.setAriaForSingleSelectionAtIndex=function(e){this.selectedIndex===y.numbers.UNSET_INDEX&&(this.ariaCurrentAttrValue=this.adapter.getAttributeForElementIndex(e,y.strings.ARIA_CURRENT));var t=null!==this.ariaCurrentAttrValue,n=t?y.strings.ARIA_CURRENT:y.strings.ARIA_SELECTED;if(this.selectedIndex!==y.numbers.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex,n,"false"),e!==y.numbers.UNSET_INDEX){var i=t?this.ariaCurrentAttrValue:"true";this.adapter.setAttributeForElementIndex(e,n,i)}},E.prototype.getSelectionAttribute=function(){return this.useSelectedAttr?y.strings.ARIA_SELECTED:y.strings.ARIA_CHECKED},E.prototype.setRadioAtIndex=function(e,t){void 0===t&&(t={});var n=this.getSelectionAttribute();this.adapter.setCheckedCheckboxOrRadioAtIndex(e,!0),this.selectedIndex===e&&!t.forceUpdate||(this.selectedIndex!==y.numbers.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex,n,"false"),this.adapter.setAttributeForElementIndex(e,n,"true"),this.selectedIndex=e,t.isUserInteraction&&!t.forceUpdate&&this.adapter.notifySelectionChange([e]))},E.prototype.setCheckboxAtIndex=function(e,t){void 0===t&&(t={});for(var n=this.selectedIndex,i=t.isUserInteraction?new Set(n===y.numbers.UNSET_INDEX?[]:n):null,s=this.getSelectionAttribute(),r=[],o=0;o<this.adapter.getListItemCount();o++){var a=null==i?void 0:i.has(o),d=0<=e.indexOf(o);d!==a&&r.push(o),this.adapter.setCheckedCheckboxOrRadioAtIndex(o,d),this.adapter.setAttributeForElementIndex(o,s,d?"true":"false")}this.selectedIndex=e,t.isUserInteraction&&r.length&&this.adapter.notifySelectionChange(r)},E.prototype.toggleCheckboxRange=function(e,t,n){this.lastSelectedIndex=n;for(var i=new Set(this.selectedIndex===y.numbers.UNSET_INDEX?[]:this.selectedIndex),s=!(null==i?void 0:i.has(n)),r=l([e,t].sort(),2),o=r[0],a=r[1],d=this.getSelectionAttribute(),u=[],c=o;c<=a;c++)this.isIndexDisabled(c)||s!==i.has(c)&&(u.push(c),this.adapter.setCheckedCheckboxOrRadioAtIndex(c,s),this.adapter.setAttributeForElementIndex(c,d,""+s),s?i.add(c):i.delete(c));u.length&&(this.selectedIndex=h([],l(i)),this.adapter.notifySelectionChange(u))},E.prototype.setTabindexAtIndex=function(e){this.focusedItemIndex===y.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!==y.numbers.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(e,"tabindex","0")},E.prototype.isSelectableList=function(){return this.isSingleSelectionList||this.isCheckboxList||this.isRadioList},E.prototype.setTabindexToFirstSelectedOrFocusedItem=function(){var e=this.getFirstSelectedOrFocusedItemIndex();this.setTabindexAtIndex(e)},E.prototype.getFirstSelectedOrFocusedItemIndex=function(){return this.isSelectableList()?"number"==typeof this.selectedIndex&&this.selectedIndex!==y.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)},E.prototype.isIndexValid=function(e,t){var n=this;if(void 0===t&&(t=!0),e instanceof Array){if(!this.isCheckboxList&&t)throw new Error("MDCListFoundation: Array of index is only supported for checkbox based list");return 0===e.length||e.some(function(e){return n.isIndexInRange(e)})}if("number"!=typeof e)return!1;if(this.isCheckboxList&&t)throw new Error("MDCListFoundation: Expected array of index for checkbox based list but got number: "+e);return this.isIndexInRange(e)||this.isSingleSelectionList&&e===y.numbers.UNSET_INDEX},E.prototype.isIndexInRange=function(e){var t=this.adapter.getListItemCount();return 0<=e&&e<t},E.prototype.setSelectedIndexOnAction=function(e,t){this.lastSelectedIndex=e,this.isCheckboxList?(this.toggleCheckboxAtIndex(e,t),this.adapter.notifySelectionChange([e])):this.setSelectedIndex(e,{isUserInteraction:!0})},E.prototype.toggleCheckboxAtIndex=function(t,e){var n,i=this.getSelectionAttribute(),s=this.adapter.isCheckboxCheckedAtIndex(t);e?n=s:(n=!s,this.adapter.setCheckedCheckboxOrRadioAtIndex(t,n)),this.adapter.setAttributeForElementIndex(t,i,n?"true":"false");var r=this.selectedIndex===y.numbers.UNSET_INDEX?[]:this.selectedIndex.slice();n?r.push(t):r=r.filter(function(e){return e!==t}),this.selectedIndex=r},E.prototype.focusItemAtIndex=function(e){this.adapter.focusItemAtIndex(e),this.focusedItemIndex=e},E.prototype.checkboxListToggleAll=function(e,t){var n=this.adapter.getListItemCount();if(e.length===n)this.setCheckboxAtIndex([],{isUserInteraction:t});else{for(var i=[],s=0;s<n;s++)(!this.isIndexDisabled(s)||-1<e.indexOf(s))&&i.push(s);this.setCheckboxAtIndex(i,{isUserInteraction:t})}},E.prototype.typeaheadMatchItem=function(e,t,n){var i=this;void 0===n&&(n=!1);var s={focusItemAtIndex:function(e){i.focusItemAtIndex(e)},focusedItemIndex:t||this.focusedItemIndex,nextChar:e,sortedIndexByFirstChar:this.sortedIndexByFirstChar,skipFocus:n,isItemAtIndexDisabled:function(e){return i.isIndexDisabled(e)}};return b.matchItem(s,this.typeaheadState)},E.prototype.typeaheadInitSortedIndex=function(){return b.initSortedIndex(this.adapter.getListItemCount(),this.adapter.getPrimaryTextAtIndex)},E.prototype.clearTypeaheadBuffer=function(){b.clearBuffer(this.typeaheadState)},E);function E(e){var t=f.call(this,r(r({},E.defaultAdapter),e))||this;return t.wrapFocus=!1,t.isVertical=!0,t.isSingleSelectionList=!1,t.areDisabledItemsFocusable=!0,t.selectedIndex=y.numbers.UNSET_INDEX,t.focusedItemIndex=y.numbers.UNSET_INDEX,t.useActivatedClass=!1,t.useSelectedAttr=!1,t.ariaCurrentAttrValue=null,t.isCheckboxList=!1,t.isRadioList=!1,t.lastSelectedIndex=null,t.hasTypeahead=!1,t.typeaheadState=b.initState(),t.sortedIndexByFirstChar=new Map,t}t.MDCListFoundation=I,t.default=I},192:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),s=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),s(n(193),t),s(n(22),t),s(n(9),t),s(n(14),t),s(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 i(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(i(n,t))return n;n=n.parentElement}return null},t.matches=i,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 i=n.scrollWidth;return document.documentElement.removeChild(n),i}},22:function(e,t,n){"use strict";var i,s=this&&this.__extends||(i=function(e,t){return(i=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}i(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,s(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,"disabledItemsFocusable",{set:function(e){this.foundation.setDisabledItemsFocusable(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,i=this.root.querySelectorAll(t);i.length&&Array.prototype.forEach.call(i,function(e){e.setAttribute("tabindex","-1")});var s=this.root.querySelectorAll(n);s.length&&Array.prototype.forEach.call(s,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 i=e.querySelector("."+this.classNameMap[d.cssClasses.LIST_ITEM_TEXT_CLASS]);return i&&i.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),i=this.root.querySelector(d.strings.ARIA_CHECKED_RADIO_SELECTOR);if(n.length){var s=this.root.querySelectorAll(d.strings.ARIA_CHECKED_CHECKBOX_SELECTOR);this.selectedIndex=Array.from(s,function(e){return t.listElements.indexOf(e)})}else i&&(this.selectedIndex=this.listElements.indexOf(i))}},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 s=this,e={addClassForElementIndex:function(e,t){var n=s.listElements[e];n&&n.classList.add(s.classNameMap[t])},focusItemAtIndex:function(e){var t=s.listElements[e];t&&t.focus()},getAttributeForElementIndex:function(e,t){return s.listElements[e].getAttribute(t)},getFocusedElementIndex:function(){return s.listElements.indexOf(document.activeElement)},getListItemCount:function(){return s.listElements.length},getPrimaryTextAtIndex:function(e){return s.getPrimaryText(s.listElements[e])},hasCheckboxAtIndex:function(e){return!!s.listElements[e].querySelector(d.strings.CHECKBOX_SELECTOR)},hasRadioAtIndex:function(e){return!!s.listElements[e].querySelector(d.strings.RADIO_SELECTOR)},isCheckboxCheckedAtIndex:function(e){return s.listElements[e].querySelector(d.strings.CHECKBOX_SELECTOR).checked},isFocusInsideList:function(){return s.root!==document.activeElement&&s.root.contains(document.activeElement)},isRootFocused:function(){return document.activeElement===s.root},listItemAtIndexHasClass:function(e,t){return s.listElements[e].classList.contains(s.classNameMap[t])},notifyAction:function(e){s.emit(d.strings.ACTION_EVENT,{index:e},!0)},notifySelectionChange:function(e){s.emit(d.strings.SELECTION_CHANGE_EVENT,{changedIndices:e},!0)},removeClassForElementIndex:function(e,t){var n=s.listElements[e];n&&n.classList.remove(s.classNameMap[t])},setAttributeForElementIndex:function(e,t,n){var i=s.listElements[e];i&&i.setAttribute(t,n)},setCheckedCheckboxOrRadioAtIndex:function(e,t){var n=s.listElements[e].querySelector(d.strings.CHECKBOX_RADIO_SELECTOR);n.checked=t;var i=document.createEvent("Event");i.initEvent("change",!0,!0),n.dispatchEvent(i)},setTabIndexForListItemChildren:function(e,t){var n=s.listElements[e],i=d.strings.CHILD_ELEMENTS_TO_TOGGLE_TABINDEX;Array.prototype.forEach.call(n.querySelectorAll(i),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,i=!a.matches(n,d.strings.CHECKBOX_RADIO_SELECTOR);this.foundation.handleClick(t,i,e)},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 x(e,t){var n,i=e.nextChar,s=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+i,-1===(n=1===t.typeaheadBuffer.length?function(e,t,n,i){var s=i.typeaheadBuffer[0],r=e.get(s);if(!r)return-1;if(s===i.currentFirstChar&&r[i.sortedIndexCursor].index===t){i.sortedIndexCursor=(i.sortedIndexCursor+1)%r.length;var o=r[i.sortedIndexCursor].index;if(!n(o))return o}i.currentFirstChar=s;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:(i.sortedIndexCursor=d,r[i.sortedIndexCursor].index)}(r,o,d,t):function(e,t,n){var i=n.typeaheadBuffer[0],s=e.get(i);if(!s)return-1;var r=s[n.sortedIndexCursor];if(0===r.text.lastIndexOf(n.typeaheadBuffer,0)&&!t(r.index))return r.index;var o=(n.sortedIndexCursor+1)%s.length,a=-1;for(;o!==n.sortedIndexCursor;){var d=s[o],u=0===d.text.lastIndexOf(n.typeaheadBuffer,0),c=!t(d.index);if(u&&c){a=o;break}o=(o+1)%s.length}return-1===a?-1:(n.sortedIndexCursor=a,s[n.sortedIndexCursor].index)}(r,d,t))||a||s(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,i=0;i<e;i++){var s=t(i).trim();if(s){var r=s[0].toLowerCase();n.has(r)||n.set(r,[]),n.get(r).push({text:s.toLowerCase(),index:i})}}return n.forEach(function(e){e.sort(function(e,t){return e.index-t.index})}),n},t.matchItem=x,t.isTypingInProgress=S,t.clearBuffer=c,t.handleKeydown=function(e,t){var n=e.event,i=e.isTargetListItem,s=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),h="Home"===p.normalizeKey(n),f="End"===p.normalizeKey(n),I="Enter"===p.normalizeKey(n),E="Spacebar"===p.normalizeKey(n);return n.altKey||n.ctrlKey||n.metaKey||d||u||c||l||h||f||I?-1:E||1!==n.key.length?E?(i&&m.preventDefaultEvent(n),i&&S(t)?x({focusItemAtIndex:r,focusedItemIndex:s,nextChar:" ",sortedIndexByFirstChar:o,skipFocus:!1,isItemAtIndexDisabled:a},t):-1):-1:(m.preventDefaultEvent(n),x({focusItemAtIndex:r,focusedItemIndex:s,nextChar:n.key.toLowerCase(),sortedIndexByFirstChar:o,skipFocus:!1,isItemAtIndexDisabled:a},t))}},8:function(e,i,t){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.isNavigationEvent=i.normalizeKey=i.KEY=void 0,i.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 s=new Set;s.add(i.KEY.BACKSPACE),s.add(i.KEY.ENTER),s.add(i.KEY.SPACEBAR),s.add(i.KEY.PAGE_UP),s.add(i.KEY.PAGE_DOWN),s.add(i.KEY.END),s.add(i.KEY.HOME),s.add(i.KEY.ARROW_LEFT),s.add(i.KEY.ARROW_UP),s.add(i.KEY.ARROW_RIGHT),s.add(i.KEY.ARROW_DOWN),s.add(i.KEY.DELETE),s.add(i.KEY.ESCAPE),s.add(i.KEY.TAB);var n=8,r=13,o=32,a=33,d=34,u=35,c=36,l=37,h=38,f=39,I=40,E=46,p=27,m=9,x=new Map;x.set(n,i.KEY.BACKSPACE),x.set(r,i.KEY.ENTER),x.set(o,i.KEY.SPACEBAR),x.set(a,i.KEY.PAGE_UP),x.set(d,i.KEY.PAGE_DOWN),x.set(u,i.KEY.END),x.set(c,i.KEY.HOME),x.set(l,i.KEY.ARROW_LEFT),x.set(h,i.KEY.ARROW_UP),x.set(f,i.KEY.ARROW_RIGHT),x.set(I,i.KEY.ARROW_DOWN),x.set(E,i.KEY.DELETE),x.set(p,i.KEY.ESCAPE),x.set(m,i.KEY.TAB);var S=new Set;function A(e){var t=e.key;if(s.has(t))return t;var n=x.get(e.keyCode);return n||i.KEY.UNKNOWN}S.add(i.KEY.PAGE_UP),S.add(i.KEY.PAGE_DOWN),S.add(i.KEY.END),S.add(i.KEY.HOME),S.add(i.KEY.ARROW_LEFT),S.add(i.KEY.ARROW_UP),S.add(i.KEY.ARROW_RIGHT),S.add(i.KEY.ARROW_DOWN),i.normalizeKey=A,i.isNavigationEvent=function(e){return S.has(A(e))}},9:function(e,t,n){"use strict";var i,s;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=((i={})[""+(t.cssClasses=r).LIST_ITEM_ACTIVATED_CLASS]="mdc-list-item--activated",i[""+r.LIST_ITEM_CLASS]="mdc-list-item",i[""+r.LIST_ITEM_DISABLED_CLASS]="mdc-list-item--disabled",i[""+r.LIST_ITEM_SELECTED_CLASS]="mdc-list-item--selected",i[""+r.LIST_ITEM_PRIMARY_TEXT_CLASS]="mdc-list-item__primary-text",i[""+r.ROOT]="mdc-list",i);t.evolutionClassNameMap=o;var a=((s={})[""+r.LIST_ITEM_ACTIVATED_CLASS]="mdc-deprecated-list-item--activated",s[""+r.LIST_ITEM_CLASS]="mdc-deprecated-list-item",s[""+r.LIST_ITEM_DISABLED_CLASS]="mdc-deprecated-list-item--disabled",s[""+r.LIST_ITEM_SELECTED_CLASS]="mdc-deprecated-list-item--selected",s[""+r.LIST_ITEM_TEXT_CLASS]="mdc-deprecated-list-item__text",s[""+r.LIST_ITEM_PRIMARY_TEXT_CLASS]="mdc-deprecated-list-item__primary-text",s[""+r.ROOT]="mdc-deprecated-list",s);t.deprecatedClassNameMap=a;var d={ACTION_EVENT:"MDCList:action",SELECTION_CHANGE_EVENT:"MDCList:selectionChange",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"}},s.c=i,s.d=function(e,t,n){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(t,e){if(1&e&&(t=s(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)s.d(n,i,function(e){return t[e]}.bind(null,i));return n},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="",s(s.s=192);function s(e){if(i[e])return i[e].exports;var t=i[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,s),t.l=!0,t.exports}var n,i});