HEX
Server: Apache
System: Linux ecngx285.inmotionhosting.com 4.18.0-553.79.1.lve.el8.x86_64 #1 SMP Wed Oct 15 17:59:35 UTC 2025 x86_64
User: zeusxp5 (3862)
PHP: 8.3.28
Disabled: NONE
Upload Files
File: /home/zeusxp5/chuair.org/wp-content/plugins/post-and-page-builder/assets/dist/gutenberg.min.js
/*! For license information please see gutenberg.min.js.LICENSE.txt */
!function(){var t={5823:function(t){t.exports='<div class="mdc-menu mdc-menu-surface" tabindex="-1"> <ul class="mdc-list" role="menu" aria-hidden="true" aria-orientation="vertical"> <% _.each( options, function ( setting ) { %> <li data-action="<%= setting.name %>" class="mdc-list-item <%= setting.name === selected ? \'mdc-menu-item--selected\' : \'\' %>" role="menuitem"> <span class="mdc-list-item__ripple"></span> <span class="mdc-list-item__text"><%= setting.label %></span> </li> <% } ); %> </ul> </div> '},5148:function(t){t.exports='<svg xmlns="http://www.w3.org/2000/svg" clip-rule="evenodd" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="1"><g fill="#f95b26"><path d="M31.224 38.994h-17.48c-.87 0-1.652-.706-1.652-1.677v-8.562c0-.883.696-1.677 1.652-1.677h17.48c.87 0 1.653.706 1.653 1.677v8.65c-.087.883-.783 1.589-1.653 1.589zM24.354 22.93H13.571c-.783 0-1.392-.619-1.392-1.413v-9.004c0-.794.609-1.412 1.392-1.412h10.783c.783 0 1.392.618 1.392 1.412v9.004c0 .794-.61 1.412-1.392 1.412z"></path></g><path d="M41.051 47.115H9.396c-3.218 0-5.913-2.737-5.913-6.003V8.982c0-3.265 2.695-6.002 5.913-6.002h31.655c3.218 0 5.914 2.737 5.914 6.003v1.324a1.57 1.57 0 0 1-1.565 1.589 1.57 1.57 0 0 1-1.566-1.59V8.984c0-1.5-1.217-2.737-2.696-2.737H9.396C7.918 6.246 6.7 7.482 6.7 8.983v32.13c0 1.5 1.218 2.736 2.696 2.736h31.655c1.479 0 2.696-1.236 2.696-2.737V25.49c0-1.5-1.217-2.736-2.696-2.736H34.53a1.57 1.57 0 0 1-1.565-1.59 1.57 1.57 0 0 1 1.565-1.588h6.522c3.305 0 5.914 2.736 5.914 6.002v15.624c0 3.177-2.696 5.914-5.914 5.914z" fill="#f95b26"></path></svg>'},5311:function(t){"use strict";t.exports=jQuery}},e={};function n(i){var o=e[i];if(void 0!==o)return o.exports;var r=e[i]={exports:{}};return t[i](r,r.exports,n),r.exports}n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,{a:e}),e},n.d=function(t,e){for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},function(){"use strict";var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};function e(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}var i=function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)};function o(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,o,r=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(t){o={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s}function r(t,e,n){if(n||2===arguments.length)for(var i,o=0,r=e.length;o<r;o++)!i&&o in e||(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))}Object.create,Object.create;var s,a,u=function(){function t(t){void 0===t&&(t={}),this.adapter=t}return Object.defineProperty(t,"cssClasses",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{}},enumerable:!1,configurable:!0}),t.prototype.init=function(){},t.prototype.destroy=function(){},t}(),c=function(){function t(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];this.root=t,this.initialize.apply(this,r([],o(n))),this.foundation=void 0===e?this.getDefaultFoundation():e,this.foundation.init(),this.initialSyncWithDOM()}return t.attachTo=function(e){return new t(e,new u({}))},t.prototype.initialize=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},t.prototype.getDefaultFoundation=function(){throw new Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class")},t.prototype.initialSyncWithDOM=function(){},t.prototype.destroy=function(){this.foundation.destroy()},t.prototype.listen=function(t,e,n){this.root.addEventListener(t,e,n)},t.prototype.unlisten=function(t,e,n){this.root.removeEventListener(t,e,n)},t.prototype.emit=function(t,e,n){var i;void 0===n&&(n=!1),"function"==typeof CustomEvent?i=new CustomEvent(t,{bubbles:n,detail:e}):(i=document.createEvent("CustomEvent")).initCustomEvent(t,n,!1,e),this.root.dispatchEvent(i)},t}();function d(t,e){if(t.closest)return t.closest(e);for(var n=t;n;){if(l(n,e))return n;n=n.parentElement}return null}function l(t,e){return(t.matches||t.webkitMatchesSelector||t.msMatchesSelector).call(t,e)}var h={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"},f=((s={})[""+h.LIST_ITEM_ACTIVATED_CLASS]="mdc-list-item--activated",s[""+h.LIST_ITEM_CLASS]="mdc-list-item",s[""+h.LIST_ITEM_DISABLED_CLASS]="mdc-list-item--disabled",s[""+h.LIST_ITEM_SELECTED_CLASS]="mdc-list-item--selected",s[""+h.LIST_ITEM_PRIMARY_TEXT_CLASS]="mdc-list-item__primary-text",s[""+h.ROOT]="mdc-list",s),p=((a={})[""+h.LIST_ITEM_ACTIVATED_CLASS]="mdc-deprecated-list-item--activated",a[""+h.LIST_ITEM_CLASS]="mdc-deprecated-list-item",a[""+h.LIST_ITEM_DISABLED_CLASS]="mdc-deprecated-list-item--disabled",a[""+h.LIST_ITEM_SELECTED_CLASS]="mdc-deprecated-list-item--selected",a[""+h.LIST_ITEM_TEXT_CLASS]="mdc-deprecated-list-item__text",a[""+h.LIST_ITEM_PRIMARY_TEXT_CLASS]="mdc-deprecated-list-item__primary-text",a[""+h.ROOT]="mdc-deprecated-list",a),m={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    ."+h.LIST_ITEM_CLASS+" button:not(:disabled),\n    ."+h.LIST_ITEM_CLASS+" a,\n    ."+p[h.LIST_ITEM_CLASS]+" button:not(:disabled),\n    ."+p[h.LIST_ITEM_CLASS]+" a\n  ",DEPRECATED_SELECTOR:".mdc-deprecated-list",FOCUSABLE_CHILD_ELEMENTS:"\n    ."+h.LIST_ITEM_CLASS+" button:not(:disabled),\n    ."+h.LIST_ITEM_CLASS+" a,\n    ."+h.LIST_ITEM_CLASS+' input[type="radio"]:not(:disabled),\n    .'+h.LIST_ITEM_CLASS+' input[type="checkbox"]:not(:disabled),\n    .'+p[h.LIST_ITEM_CLASS]+" button:not(:disabled),\n    ."+p[h.LIST_ITEM_CLASS]+" a,\n    ."+p[h.LIST_ITEM_CLASS]+' input[type="radio"]:not(:disabled),\n    .'+p[h.LIST_ITEM_CLASS]+' input[type="checkbox"]:not(:disabled)\n  ',RADIO_SELECTOR:'input[type="radio"]',SELECTED_ITEM_SELECTOR:'[aria-selected="true"], [aria-current="true"]'},I={UNSET_INDEX:-1,TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS:300},E={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"},y=new Set;y.add(E.BACKSPACE),y.add(E.ENTER),y.add(E.SPACEBAR),y.add(E.PAGE_UP),y.add(E.PAGE_DOWN),y.add(E.END),y.add(E.HOME),y.add(E.ARROW_LEFT),y.add(E.ARROW_UP),y.add(E.ARROW_RIGHT),y.add(E.ARROW_DOWN),y.add(E.DELETE),y.add(E.ESCAPE),y.add(E.TAB);var S=new Map;S.set(8,E.BACKSPACE),S.set(13,E.ENTER),S.set(32,E.SPACEBAR),S.set(33,E.PAGE_UP),S.set(34,E.PAGE_DOWN),S.set(35,E.END),S.set(36,E.HOME),S.set(37,E.ARROW_LEFT),S.set(38,E.ARROW_UP),S.set(39,E.ARROW_RIGHT),S.set(40,E.ARROW_DOWN),S.set(46,E.DELETE),S.set(27,E.ESCAPE),S.set(9,E.TAB);var b=new Set;function T(t){var e=t.key;return y.has(e)?e:S.get(t.keyCode)||E.UNKNOWN}b.add(E.PAGE_UP),b.add(E.PAGE_DOWN),b.add(E.END),b.add(E.HOME),b.add(E.ARROW_LEFT),b.add(E.ARROW_UP),b.add(E.ARROW_RIGHT),b.add(E.ARROW_DOWN);var g=["input","button","textarea","select"],A=function(t){var e=t.target;if(e){var n=(""+e.tagName).toLowerCase();-1===g.indexOf(n)&&t.preventDefault()}};function x(t,e){var n,i=t.nextChar,o=t.focusItemAtIndex,r=t.sortedIndexByFirstChar,s=t.focusedItemIndex,a=t.skipFocus,u=t.isItemAtIndexDisabled;return clearTimeout(e.bufferClearTimeout),e.bufferClearTimeout=setTimeout((function(){O(e)}),I.TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS),e.typeaheadBuffer=e.typeaheadBuffer+i,n=1===e.typeaheadBuffer.length?function(t,e,n,i){var o=i.typeaheadBuffer[0],r=t.get(o);if(!r)return-1;if(o===i.currentFirstChar&&r[i.sortedIndexCursor].index===e){i.sortedIndexCursor=(i.sortedIndexCursor+1)%r.length;var s=r[i.sortedIndexCursor].index;if(!n(s))return s}i.currentFirstChar=o;var a,u=-1;for(a=0;a<r.length;a++)if(!n(r[a].index)){u=a;break}for(;a<r.length;a++)if(r[a].index>e&&!n(r[a].index)){u=a;break}return-1!==u?(i.sortedIndexCursor=u,r[i.sortedIndexCursor].index):-1}(r,s,u,e):function(t,e,n){var i=n.typeaheadBuffer[0],o=t.get(i);if(!o)return-1;var r=o[n.sortedIndexCursor];if(0===r.text.lastIndexOf(n.typeaheadBuffer,0)&&!e(r.index))return r.index;for(var s=(n.sortedIndexCursor+1)%o.length,a=-1;s!==n.sortedIndexCursor;){var u=o[s],c=0===u.text.lastIndexOf(n.typeaheadBuffer,0),d=!e(u.index);if(c&&d){a=s;break}s=(s+1)%o.length}return-1!==a?(n.sortedIndexCursor=a,o[n.sortedIndexCursor].index):-1}(r,u,e),-1===n||a||o(n),n}function C(t){return t.typeaheadBuffer.length>0}function O(t){t.typeaheadBuffer=""}function v(t,e){var n=t.event,i=t.isTargetListItem,o=t.focusedItemIndex,r=t.focusItemAtIndex,s=t.sortedIndexByFirstChar,a=t.isItemAtIndexDisabled,u="ArrowLeft"===T(n),c="ArrowUp"===T(n),d="ArrowRight"===T(n),l="ArrowDown"===T(n),h="Home"===T(n),f="End"===T(n),p="Enter"===T(n),m="Spacebar"===T(n);return n.altKey||n.ctrlKey||n.metaKey||u||c||d||l||h||f||p?-1:m||1!==n.key.length?m?(i&&A(n),i&&C(e)?x({focusItemAtIndex:r,focusedItemIndex:o,nextChar:" ",sortedIndexByFirstChar:s,skipFocus:!1,isItemAtIndexDisabled:a},e):-1):-1:(A(n),x({focusItemAtIndex:r,focusedItemIndex:o,nextChar:n.key.toLowerCase(),sortedIndexByFirstChar:s,skipFocus:!1,isItemAtIndexDisabled:a},e))}var L=["Alt","Control","Meta","Shift"];function R(t){var e=new Set(t?L.filter((function(e){return t.getModifierState(e)})):[]);return function(t){return t.every((function(t){return e.has(t)}))&&t.length===e.size}}var N,D,M=function(t){function n(e){var o=t.call(this,i(i({},n.defaultAdapter),e))||this;return o.wrapFocus=!1,o.isVertical=!0,o.isSingleSelectionList=!1,o.areDisabledItemsFocusable=!0,o.selectedIndex=I.UNSET_INDEX,o.focusedItemIndex=I.UNSET_INDEX,o.useActivatedClass=!1,o.useSelectedAttr=!1,o.ariaCurrentAttrValue=null,o.isCheckboxList=!1,o.isRadioList=!1,o.lastSelectedIndex=null,o.hasTypeahead=!1,o.typeaheadState={bufferClearTimeout:0,currentFirstChar:"",sortedIndexCursor:0,typeaheadBuffer:""},o.sortedIndexByFirstChar=new Map,o}return e(n,t),Object.defineProperty(n,"strings",{get:function(){return m},enumerable:!1,configurable:!0}),Object.defineProperty(n,"cssClasses",{get:function(){return h},enumerable:!1,configurable:!0}),Object.defineProperty(n,"numbers",{get:function(){return I},enumerable:!1,configurable:!0}),Object.defineProperty(n,"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}),n.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()))},n.prototype.getFocusedItemIndex=function(){return this.focusedItemIndex},n.prototype.setWrapFocus=function(t){this.wrapFocus=t},n.prototype.setVerticalOrientation=function(t){this.isVertical=t},n.prototype.setSingleSelection=function(t){this.isSingleSelectionList=t,t&&(this.maybeInitializeSingleSelection(),this.selectedIndex=this.getSelectedIndexFromDOM())},n.prototype.setDisabledItemsFocusable=function(t){this.areDisabledItemsFocusable=t},n.prototype.maybeInitializeSingleSelection=function(){var t=this.getSelectedIndexFromDOM();t!==I.UNSET_INDEX&&(this.adapter.listItemAtIndexHasClass(t,h.LIST_ITEM_ACTIVATED_CLASS)&&this.setUseActivatedClass(!0),this.isSingleSelectionList=!0,this.selectedIndex=t)},n.prototype.getSelectedIndexFromDOM=function(){for(var t=I.UNSET_INDEX,e=this.adapter.getListItemCount(),n=0;n<e;n++){var i=this.adapter.listItemAtIndexHasClass(n,h.LIST_ITEM_SELECTED_CLASS),o=this.adapter.listItemAtIndexHasClass(n,h.LIST_ITEM_ACTIVATED_CLASS);if(i||o){t=n;break}}return t},n.prototype.setHasTypeahead=function(t){this.hasTypeahead=t,t&&(this.sortedIndexByFirstChar=this.typeaheadInitSortedIndex())},n.prototype.isTypeaheadInProgress=function(){return this.hasTypeahead&&C(this.typeaheadState)},n.prototype.setUseActivatedClass=function(t){this.useActivatedClass=t},n.prototype.setUseSelectedAttribute=function(t){this.useSelectedAttr=t},n.prototype.getSelectedIndex=function(){return this.selectedIndex},n.prototype.setSelectedIndex=function(t,e){void 0===e&&(e={}),this.isIndexValid(t)&&(this.isCheckboxList?this.setCheckboxAtIndex(t,e):this.isRadioList?this.setRadioAtIndex(t,e):this.setSingleSelectionAtIndex(t,e))},n.prototype.handleFocusIn=function(t){t>=0&&(this.focusedItemIndex=t,this.adapter.setAttributeForElementIndex(t,"tabindex","0"),this.adapter.setTabIndexForListItemChildren(t,"0"))},n.prototype.handleFocusOut=function(t){var e=this;t>=0&&(this.adapter.setAttributeForElementIndex(t,"tabindex","-1"),this.adapter.setTabIndexForListItemChildren(t,"-1")),setTimeout((function(){e.adapter.isFocusInsideList()||e.setTabindexToFirstSelectedOrFocusedItem()}),0)},n.prototype.isIndexDisabled=function(t){return this.adapter.listItemAtIndexHasClass(t,h.LIST_ITEM_DISABLED_CLASS)},n.prototype.handleKeydown=function(t,e,n){var i,o=this,r="ArrowLeft"===T(t),s="ArrowUp"===T(t),a="ArrowRight"===T(t),u="ArrowDown"===T(t),c="Home"===T(t),d="End"===T(t),l="Enter"===T(t),h="Spacebar"===T(t),f=this.isVertical&&u||!this.isVertical&&a,p=this.isVertical&&s||!this.isVertical&&r,m="A"===t.key||"a"===t.key,E=R(t);if(this.adapter.isRootFocused())(p||d)&&E([])?(t.preventDefault(),this.focusLastElement()):(f||c)&&E([])?(t.preventDefault(),this.focusFirstElement()):p&&E(["Shift"])&&this.isCheckboxList?(t.preventDefault(),-1!==(S=this.focusLastElement())&&this.setSelectedIndexOnAction(S,!1)):f&&E(["Shift"])&&this.isCheckboxList&&(t.preventDefault(),-1!==(S=this.focusFirstElement())&&this.setSelectedIndexOnAction(S,!1)),this.hasTypeahead&&v({event:t,focusItemAtIndex:function(t){o.focusItemAtIndex(t)},focusedItemIndex:-1,isTargetListItem:e,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:function(t){return o.isIndexDisabled(t)}},this.typeaheadState);else{var y=this.adapter.getFocusedElementIndex();if(!(-1===y&&(y=n)<0)){if(f&&E([]))A(t),this.focusNextElement(y);else if(p&&E([]))A(t),this.focusPrevElement(y);else if(f&&E(["Shift"])&&this.isCheckboxList)A(t),-1!==(S=this.focusNextElement(y))&&this.setSelectedIndexOnAction(S,!1);else if(p&&E(["Shift"])&&this.isCheckboxList){var S;A(t),-1!==(S=this.focusPrevElement(y))&&this.setSelectedIndexOnAction(S,!1)}else if(c&&E([]))A(t),this.focusFirstElement();else if(d&&E([]))A(t),this.focusLastElement();else if(c&&E(["Control","Shift"])&&this.isCheckboxList){if(A(t),this.isIndexDisabled(y))return;this.focusFirstElement(),this.toggleCheckboxRange(0,y,y)}else if(d&&E(["Control","Shift"])&&this.isCheckboxList){if(A(t),this.isIndexDisabled(y))return;this.focusLastElement(),this.toggleCheckboxRange(y,this.adapter.getListItemCount()-1,y)}else if(m&&E(["Control"])&&this.isCheckboxList)t.preventDefault(),this.checkboxListToggleAll(this.selectedIndex===I.UNSET_INDEX?[]:this.selectedIndex,!0);else if((l||h)&&E([])){if(e){if((b=t.target)&&"A"===b.tagName&&l)return;if(A(t),this.isIndexDisabled(y))return;this.isTypeaheadInProgress()||(this.isSelectableList()&&this.setSelectedIndexOnAction(y,!1),this.adapter.notifyAction(y))}}else if((l||h)&&E(["Shift"])&&this.isCheckboxList){var b;if((b=t.target)&&"A"===b.tagName&&l)return;if(A(t),this.isIndexDisabled(y))return;this.isTypeaheadInProgress()||(this.toggleCheckboxRange(null!==(i=this.lastSelectedIndex)&&void 0!==i?i:y,y,y),this.adapter.notifyAction(y))}this.hasTypeahead&&v({event:t,focusItemAtIndex:function(t){o.focusItemAtIndex(t)},focusedItemIndex:this.focusedItemIndex,isTargetListItem:e,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:function(t){return o.isIndexDisabled(t)}},this.typeaheadState)}}},n.prototype.handleClick=function(t,e,n){var i,o=R(n);t!==I.UNSET_INDEX&&(this.isIndexDisabled(t)||(o([])?(this.isSelectableList()&&this.setSelectedIndexOnAction(t,e),this.adapter.notifyAction(t)):this.isCheckboxList&&o(["Shift"])&&(this.toggleCheckboxRange(null!==(i=this.lastSelectedIndex)&&void 0!==i?i:t,t,t),this.adapter.notifyAction(t))))},n.prototype.focusNextElement=function(t){var e=this.adapter.getListItemCount(),n=t,i=null;do{if(++n>=e){if(!this.wrapFocus)return t;n=0}if(n===i)return-1;i=null!=i?i:n}while(!this.areDisabledItemsFocusable&&this.isIndexDisabled(n));return this.focusItemAtIndex(n),n},n.prototype.focusPrevElement=function(t){var e=this.adapter.getListItemCount(),n=t,i=null;do{if(--n<0){if(!this.wrapFocus)return t;n=e-1}if(n===i)return-1;i=null!=i?i:n}while(!this.areDisabledItemsFocusable&&this.isIndexDisabled(n));return this.focusItemAtIndex(n),n},n.prototype.focusFirstElement=function(){return this.focusNextElement(-1)},n.prototype.focusLastElement=function(){return this.focusPrevElement(this.adapter.getListItemCount())},n.prototype.focusInitialElement=function(){var t=this.getFirstSelectedOrFocusedItemIndex();return this.focusItemAtIndex(t),t},n.prototype.setEnabled=function(t,e){this.isIndexValid(t,!1)&&(e?(this.adapter.removeClassForElementIndex(t,h.LIST_ITEM_DISABLED_CLASS),this.adapter.setAttributeForElementIndex(t,m.ARIA_DISABLED,"false")):(this.adapter.addClassForElementIndex(t,h.LIST_ITEM_DISABLED_CLASS),this.adapter.setAttributeForElementIndex(t,m.ARIA_DISABLED,"true")))},n.prototype.setSingleSelectionAtIndex=function(t,e){if(void 0===e&&(e={}),this.selectedIndex!==t||e.forceUpdate){var n=h.LIST_ITEM_SELECTED_CLASS;this.useActivatedClass&&(n=h.LIST_ITEM_ACTIVATED_CLASS),this.selectedIndex!==I.UNSET_INDEX&&this.adapter.removeClassForElementIndex(this.selectedIndex,n),this.setAriaForSingleSelectionAtIndex(t),this.setTabindexAtIndex(t),t!==I.UNSET_INDEX&&this.adapter.addClassForElementIndex(t,n),this.selectedIndex=t,e.isUserInteraction&&!e.forceUpdate&&this.adapter.notifySelectionChange([t])}},n.prototype.setAriaForSingleSelectionAtIndex=function(t){this.selectedIndex===I.UNSET_INDEX&&(this.ariaCurrentAttrValue=this.adapter.getAttributeForElementIndex(t,m.ARIA_CURRENT));var e=null!==this.ariaCurrentAttrValue,n=e?m.ARIA_CURRENT:m.ARIA_SELECTED;if(this.selectedIndex!==I.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex,n,"false"),t!==I.UNSET_INDEX){var i=e?this.ariaCurrentAttrValue:"true";this.adapter.setAttributeForElementIndex(t,n,i)}},n.prototype.getSelectionAttribute=function(){return this.useSelectedAttr?m.ARIA_SELECTED:m.ARIA_CHECKED},n.prototype.setRadioAtIndex=function(t,e){void 0===e&&(e={});var n=this.getSelectionAttribute();this.adapter.setCheckedCheckboxOrRadioAtIndex(t,!0),(this.selectedIndex!==t||e.forceUpdate)&&(this.selectedIndex!==I.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex,n,"false"),this.adapter.setAttributeForElementIndex(t,n,"true"),this.selectedIndex=t,e.isUserInteraction&&!e.forceUpdate&&this.adapter.notifySelectionChange([t]))},n.prototype.setCheckboxAtIndex=function(t,e){void 0===e&&(e={});for(var n=this.selectedIndex,i=e.isUserInteraction?new Set(n===I.UNSET_INDEX?[]:n):null,o=this.getSelectionAttribute(),r=[],s=0;s<this.adapter.getListItemCount();s++){var a=null==i?void 0:i.has(s),u=t.indexOf(s)>=0;u!==a&&r.push(s),this.adapter.setCheckedCheckboxOrRadioAtIndex(s,u),this.adapter.setAttributeForElementIndex(s,o,u?"true":"false")}this.selectedIndex=t,e.isUserInteraction&&r.length&&this.adapter.notifySelectionChange(r)},n.prototype.toggleCheckboxRange=function(t,e,n){this.lastSelectedIndex=n;for(var i=new Set(this.selectedIndex===I.UNSET_INDEX?[]:this.selectedIndex),s=!(null==i?void 0:i.has(n)),a=o([t,e].sort(),2),u=a[0],c=a[1],d=this.getSelectionAttribute(),l=[],h=u;h<=c;h++)this.isIndexDisabled(h)||s!==i.has(h)&&(l.push(h),this.adapter.setCheckedCheckboxOrRadioAtIndex(h,s),this.adapter.setAttributeForElementIndex(h,d,""+s),s?i.add(h):i.delete(h));l.length&&(this.selectedIndex=r([],o(i)),this.adapter.notifySelectionChange(l))},n.prototype.setTabindexAtIndex=function(t){this.focusedItemIndex===I.UNSET_INDEX&&0!==t?this.adapter.setAttributeForElementIndex(0,"tabindex","-1"):this.focusedItemIndex>=0&&this.focusedItemIndex!==t&&this.adapter.setAttributeForElementIndex(this.focusedItemIndex,"tabindex","-1"),this.selectedIndex instanceof Array||this.selectedIndex===t||this.adapter.setAttributeForElementIndex(this.selectedIndex,"tabindex","-1"),t!==I.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(t,"tabindex","0")},n.prototype.isSelectableList=function(){return this.isSingleSelectionList||this.isCheckboxList||this.isRadioList},n.prototype.setTabindexToFirstSelectedOrFocusedItem=function(){var t=this.getFirstSelectedOrFocusedItemIndex();this.setTabindexAtIndex(t)},n.prototype.getFirstSelectedOrFocusedItemIndex=function(){return this.isSelectableList()?"number"==typeof this.selectedIndex&&this.selectedIndex!==I.UNSET_INDEX?this.selectedIndex:this.selectedIndex instanceof Array&&this.selectedIndex.length>0?this.selectedIndex.reduce((function(t,e){return Math.min(t,e)})):0:Math.max(this.focusedItemIndex,0)},n.prototype.isIndexValid=function(t,e){var n=this;if(void 0===e&&(e=!0),t instanceof Array){if(!this.isCheckboxList&&e)throw new Error("MDCListFoundation: Array of index is only supported for checkbox based list");return 0===t.length||t.some((function(t){return n.isIndexInRange(t)}))}if("number"==typeof t){if(this.isCheckboxList&&e)throw new Error("MDCListFoundation: Expected array of index for checkbox based list but got number: "+t);return this.isIndexInRange(t)||this.isSingleSelectionList&&t===I.UNSET_INDEX}return!1},n.prototype.isIndexInRange=function(t){var e=this.adapter.getListItemCount();return t>=0&&t<e},n.prototype.setSelectedIndexOnAction=function(t,e){this.lastSelectedIndex=t,this.isCheckboxList?(this.toggleCheckboxAtIndex(t,e),this.adapter.notifySelectionChange([t])):this.setSelectedIndex(t,{isUserInteraction:!0})},n.prototype.toggleCheckboxAtIndex=function(t,e){var n,i=this.getSelectionAttribute(),o=this.adapter.isCheckboxCheckedAtIndex(t);e?n=o:(n=!o,this.adapter.setCheckedCheckboxOrRadioAtIndex(t,n)),this.adapter.setAttributeForElementIndex(t,i,n?"true":"false");var r=this.selectedIndex===I.UNSET_INDEX?[]:this.selectedIndex.slice();n?r.push(t):r=r.filter((function(e){return e!==t})),this.selectedIndex=r},n.prototype.focusItemAtIndex=function(t){this.adapter.focusItemAtIndex(t),this.focusedItemIndex=t},n.prototype.checkboxListToggleAll=function(t,e){var n=this.adapter.getListItemCount();if(t.length===n)this.setCheckboxAtIndex([],{isUserInteraction:e});else{for(var i=[],o=0;o<n;o++)(!this.isIndexDisabled(o)||t.indexOf(o)>-1)&&i.push(o);this.setCheckboxAtIndex(i,{isUserInteraction:e})}},n.prototype.typeaheadMatchItem=function(t,e,n){var i=this;return void 0===n&&(n=!1),x({focusItemAtIndex:function(t){i.focusItemAtIndex(t)},focusedItemIndex:e||this.focusedItemIndex,nextChar:t,sortedIndexByFirstChar:this.sortedIndexByFirstChar,skipFocus:n,isItemAtIndexDisabled:function(t){return i.isIndexDisabled(t)}},this.typeaheadState)},n.prototype.typeaheadInitSortedIndex=function(){return function(t,e){for(var n=new Map,i=0;i<t;i++){var o=e(i).trim();if(o){var r=o[0].toLowerCase();n.has(r)||n.set(r,[]),n.get(r).push({text:o.toLowerCase(),index:i})}}return n.forEach((function(t){t.sort((function(t,e){return t.index-e.index}))})),n}(this.adapter.getListItemCount(),this.adapter.getPrimaryTextAtIndex)},n.prototype.clearTypeaheadBuffer=function(){O(this.typeaheadState)},n}(u),w=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),Object.defineProperty(n.prototype,"vertical",{set:function(t){this.foundation.setVerticalOrientation(t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"listElements",{get:function(){return Array.from(this.root.querySelectorAll("."+this.classNameMap[h.LIST_ITEM_CLASS]))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"wrapFocus",{set:function(t){this.foundation.setWrapFocus(t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"typeaheadInProgress",{get:function(){return this.foundation.isTypeaheadInProgress()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasTypeahead",{set:function(t){this.foundation.setHasTypeahead(t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"singleSelection",{set:function(t){this.foundation.setSingleSelection(t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"disabledItemsFocusable",{set:function(t){this.foundation.setDisabledItemsFocusable(t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"selectedIndex",{get:function(){return this.foundation.getSelectedIndex()},set:function(t){this.foundation.setSelectedIndex(t)},enumerable:!1,configurable:!0}),n.attachTo=function(t){return new n(t)},n.prototype.initialSyncWithDOM=function(){this.isEvolutionEnabled="evolution"in this.root.dataset,this.isEvolutionEnabled?this.classNameMap=f:l(this.root,m.DEPRECATED_SELECTOR)?this.classNameMap=p:this.classNameMap=Object.values(h).reduce((function(t,e){return t[e]=e,t}),{}),this.handleClick=this.handleClickEvent.bind(this),this.handleKeydown=this.handleKeydownEvent.bind(this),this.focusInEventListener=this.handleFocusInEvent.bind(this),this.focusOutEventListener=this.handleFocusOutEvent.bind(this),this.listen("keydown",this.handleKeydown),this.listen("click",this.handleClick),this.listen("focusin",this.focusInEventListener),this.listen("focusout",this.focusOutEventListener),this.layout(),this.initializeListType(),this.ensureFocusable()},n.prototype.destroy=function(){this.unlisten("keydown",this.handleKeydown),this.unlisten("click",this.handleClick),this.unlisten("focusin",this.focusInEventListener),this.unlisten("focusout",this.focusOutEventListener)},n.prototype.layout=function(){var t=this.root.getAttribute(m.ARIA_ORIENTATION);this.vertical=t!==m.ARIA_ORIENTATION_HORIZONTAL;var e="."+this.classNameMap[h.LIST_ITEM_CLASS]+":not([tabindex])",n=m.FOCUSABLE_CHILD_ELEMENTS,i=this.root.querySelectorAll(e);i.length&&Array.prototype.forEach.call(i,(function(t){t.setAttribute("tabindex","-1")}));var o=this.root.querySelectorAll(n);o.length&&Array.prototype.forEach.call(o,(function(t){t.setAttribute("tabindex","-1")})),this.isEvolutionEnabled&&this.foundation.setUseSelectedAttribute(!0),this.foundation.layout()},n.prototype.getPrimaryText=function(t){var e,n=t.querySelector("."+this.classNameMap[h.LIST_ITEM_PRIMARY_TEXT_CLASS]);if(this.isEvolutionEnabled||n)return null!==(e=null==n?void 0:n.textContent)&&void 0!==e?e:"";var i=t.querySelector("."+this.classNameMap[h.LIST_ITEM_TEXT_CLASS]);return i&&i.textContent||""},n.prototype.initializeListType=function(){var t=this;if(this.isInteractive=l(this.root,m.ARIA_INTERACTIVE_ROLES_SELECTOR),this.isEvolutionEnabled&&this.isInteractive){var e=Array.from(this.root.querySelectorAll(m.SELECTED_ITEM_SELECTOR),(function(e){return t.listElements.indexOf(e)}));l(this.root,m.ARIA_MULTI_SELECTABLE_SELECTOR)?this.selectedIndex=e:e.length>0&&(this.selectedIndex=e[0])}else{var n=this.root.querySelectorAll(m.ARIA_ROLE_CHECKBOX_SELECTOR),i=this.root.querySelector(m.ARIA_CHECKED_RADIO_SELECTOR);if(n.length){var o=this.root.querySelectorAll(m.ARIA_CHECKED_CHECKBOX_SELECTOR);this.selectedIndex=Array.from(o,(function(e){return t.listElements.indexOf(e)}))}else i&&(this.selectedIndex=this.listElements.indexOf(i))}},n.prototype.setEnabled=function(t,e){this.foundation.setEnabled(t,e)},n.prototype.typeaheadMatchItem=function(t,e){return this.foundation.typeaheadMatchItem(t,e,!0)},n.prototype.getDefaultFoundation=function(){var t=this,e={addClassForElementIndex:function(e,n){var i=t.listElements[e];i&&i.classList.add(t.classNameMap[n])},focusItemAtIndex:function(e){var n=t.listElements[e];n&&n.focus()},getAttributeForElementIndex:function(e,n){return t.listElements[e].getAttribute(n)},getFocusedElementIndex:function(){return t.listElements.indexOf(document.activeElement)},getListItemCount:function(){return t.listElements.length},getPrimaryTextAtIndex:function(e){return t.getPrimaryText(t.listElements[e])},hasCheckboxAtIndex:function(e){return!!t.listElements[e].querySelector(m.CHECKBOX_SELECTOR)},hasRadioAtIndex:function(e){return!!t.listElements[e].querySelector(m.RADIO_SELECTOR)},isCheckboxCheckedAtIndex:function(e){return t.listElements[e].querySelector(m.CHECKBOX_SELECTOR).checked},isFocusInsideList:function(){return t.root!==document.activeElement&&t.root.contains(document.activeElement)},isRootFocused:function(){return document.activeElement===t.root},listItemAtIndexHasClass:function(e,n){return t.listElements[e].classList.contains(t.classNameMap[n])},notifyAction:function(e){t.emit(m.ACTION_EVENT,{index:e},!0)},notifySelectionChange:function(e){t.emit(m.SELECTION_CHANGE_EVENT,{changedIndices:e},!0)},removeClassForElementIndex:function(e,n){var i=t.listElements[e];i&&i.classList.remove(t.classNameMap[n])},setAttributeForElementIndex:function(e,n,i){var o=t.listElements[e];o&&o.setAttribute(n,i)},setCheckedCheckboxOrRadioAtIndex:function(e,n){var i=t.listElements[e].querySelector(m.CHECKBOX_RADIO_SELECTOR);i.checked=n;var o=document.createEvent("Event");o.initEvent("change",!0,!0),i.dispatchEvent(o)},setTabIndexForListItemChildren:function(e,n){var i=t.listElements[e],o=m.CHILD_ELEMENTS_TO_TOGGLE_TABINDEX;Array.prototype.forEach.call(i.querySelectorAll(o),(function(t){t.setAttribute("tabindex",n)}))}};return new M(e)},n.prototype.ensureFocusable=function(){if(this.isEvolutionEnabled&&this.isInteractive&&!this.root.querySelector("."+this.classNameMap[h.LIST_ITEM_CLASS]+'[tabindex="0"]')){var t=this.initialFocusIndex();-1!==t&&(this.listElements[t].tabIndex=0)}},n.prototype.initialFocusIndex=function(){if(this.selectedIndex instanceof Array&&this.selectedIndex.length>0)return this.selectedIndex[0];if("number"==typeof this.selectedIndex&&this.selectedIndex!==I.UNSET_INDEX)return this.selectedIndex;var t=this.root.querySelector("."+this.classNameMap[h.LIST_ITEM_CLASS]+":not(."+this.classNameMap[h.LIST_ITEM_DISABLED_CLASS]+")");return null===t?-1:this.getListItemIndex(t)},n.prototype.getListItemIndex=function(t){var e=d(t,"."+this.classNameMap[h.LIST_ITEM_CLASS]+", ."+this.classNameMap[h.ROOT]);return e&&l(e,"."+this.classNameMap[h.LIST_ITEM_CLASS])?this.listElements.indexOf(e):-1},n.prototype.handleFocusInEvent=function(t){var e=this.getListItemIndex(t.target);this.foundation.handleFocusIn(e)},n.prototype.handleFocusOutEvent=function(t){var e=this.getListItemIndex(t.target);this.foundation.handleFocusOut(e)},n.prototype.handleKeydownEvent=function(t){var e=this.getListItemIndex(t.target),n=t.target;this.foundation.handleKeydown(t,n.classList.contains(this.classNameMap[h.LIST_ITEM_CLASS]),e)},n.prototype.handleClickEvent=function(t){var e=this.getListItemIndex(t.target),n=!l(t.target,m.CHECKBOX_RADIO_SELECTOR);this.foundation.handleClick(e,n,t)},n}(c),F={ANCHOR:"mdc-menu-surface--anchor",ANIMATING_CLOSED:"mdc-menu-surface--animating-closed",ANIMATING_OPEN:"mdc-menu-surface--animating-open",FIXED:"mdc-menu-surface--fixed",IS_OPEN_BELOW:"mdc-menu-surface--is-open-below",OPEN:"mdc-menu-surface--open",ROOT:"mdc-menu-surface"},P={CLOSED_EVENT:"MDCMenuSurface:closed",CLOSING_EVENT:"MDCMenuSurface:closing",OPENED_EVENT:"MDCMenuSurface:opened",OPENING_EVENT:"MDCMenuSurface:opening",FOCUSABLE_ELEMENTS:["button:not(:disabled)",'[href]:not([aria-disabled="true"])',"input:not(:disabled)","select:not(:disabled)","textarea:not(:disabled)",'[tabindex]:not([tabindex="-1"]):not([aria-disabled="true"])'].join(", ")},k={TRANSITION_OPEN_DURATION:120,TRANSITION_CLOSE_DURATION:75,MARGIN_TO_EDGE:32,ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO:.67,TOUCH_EVENT_WAIT_MS:30};!function(t){t[t.BOTTOM=1]="BOTTOM",t[t.CENTER=2]="CENTER",t[t.RIGHT=4]="RIGHT",t[t.FLIP_RTL=8]="FLIP_RTL"}(N||(N={})),function(t){t[t.TOP_LEFT=0]="TOP_LEFT",t[t.TOP_RIGHT=4]="TOP_RIGHT",t[t.BOTTOM_LEFT=1]="BOTTOM_LEFT",t[t.BOTTOM_RIGHT=5]="BOTTOM_RIGHT",t[t.TOP_START=8]="TOP_START",t[t.TOP_END=12]="TOP_END",t[t.BOTTOM_START=9]="BOTTOM_START",t[t.BOTTOM_END=13]="BOTTOM_END"}(D||(D={}));var B=function(t){function n(e){var o=t.call(this,i(i({},n.defaultAdapter),e))||this;return o.isSurfaceOpen=!1,o.isQuickOpen=!1,o.isHoistedElement=!1,o.isFixedPosition=!1,o.isHorizontallyCenteredOnViewport=!1,o.maxHeight=0,o.openBottomBias=0,o.openAnimationEndTimerId=0,o.closeAnimationEndTimerId=0,o.animationRequestId=0,o.anchorCorner=D.TOP_START,o.originCorner=D.TOP_START,o.anchorMargin={top:0,right:0,bottom:0,left:0},o.position={x:0,y:0},o}return e(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return F},enumerable:!1,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return P},enumerable:!1,configurable:!0}),Object.defineProperty(n,"numbers",{get:function(){return k},enumerable:!1,configurable:!0}),Object.defineProperty(n,"Corner",{get:function(){return D},enumerable:!1,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},hasAnchor:function(){return!1},isElementInContainer:function(){return!1},isFocused:function(){return!1},isRtl:function(){return!1},getInnerDimensions:function(){return{height:0,width:0}},getAnchorDimensions:function(){return null},getWindowDimensions:function(){return{height:0,width:0}},getBodyDimensions:function(){return{height:0,width:0}},getWindowScroll:function(){return{x:0,y:0}},setPosition:function(){},setMaxHeight:function(){},setTransformOrigin:function(){},saveFocus:function(){},restoreFocus:function(){},notifyClose:function(){},notifyClosing:function(){},notifyOpen:function(){},notifyOpening:function(){}}},enumerable:!1,configurable:!0}),n.prototype.init=function(){var t=n.cssClasses,e=t.ROOT,i=t.OPEN;if(!this.adapter.hasClass(e))throw new Error(e+" class required in root element.");this.adapter.hasClass(i)&&(this.isSurfaceOpen=!0)},n.prototype.destroy=function(){clearTimeout(this.openAnimationEndTimerId),clearTimeout(this.closeAnimationEndTimerId),cancelAnimationFrame(this.animationRequestId)},n.prototype.setAnchorCorner=function(t){this.anchorCorner=t},n.prototype.flipCornerHorizontally=function(){this.originCorner=this.originCorner^N.RIGHT},n.prototype.setAnchorMargin=function(t){this.anchorMargin.top=t.top||0,this.anchorMargin.right=t.right||0,this.anchorMargin.bottom=t.bottom||0,this.anchorMargin.left=t.left||0},n.prototype.setIsHoisted=function(t){this.isHoistedElement=t},n.prototype.setFixedPosition=function(t){this.isFixedPosition=t},n.prototype.isFixed=function(){return this.isFixedPosition},n.prototype.setAbsolutePosition=function(t,e){this.position.x=this.isFinite(t)?t:0,this.position.y=this.isFinite(e)?e:0},n.prototype.setIsHorizontallyCenteredOnViewport=function(t){this.isHorizontallyCenteredOnViewport=t},n.prototype.setQuickOpen=function(t){this.isQuickOpen=t},n.prototype.setMaxHeight=function(t){this.maxHeight=t},n.prototype.setOpenBottomBias=function(t){this.openBottomBias=t},n.prototype.isOpen=function(){return this.isSurfaceOpen},n.prototype.open=function(){var t=this;this.isSurfaceOpen||(this.adapter.notifyOpening(),this.adapter.saveFocus(),this.isQuickOpen?(this.isSurfaceOpen=!0,this.adapter.addClass(n.cssClasses.OPEN),this.dimensions=this.adapter.getInnerDimensions(),this.autoposition(),this.adapter.notifyOpen()):(this.adapter.addClass(n.cssClasses.ANIMATING_OPEN),this.animationRequestId=requestAnimationFrame((function(){t.dimensions=t.adapter.getInnerDimensions(),t.autoposition(),t.adapter.addClass(n.cssClasses.OPEN),t.openAnimationEndTimerId=setTimeout((function(){t.openAnimationEndTimerId=0,t.adapter.removeClass(n.cssClasses.ANIMATING_OPEN),t.adapter.notifyOpen()}),k.TRANSITION_OPEN_DURATION)})),this.isSurfaceOpen=!0))},n.prototype.close=function(t){var e=this;if(void 0===t&&(t=!1),this.isSurfaceOpen){if(this.adapter.notifyClosing(),this.isQuickOpen)return this.isSurfaceOpen=!1,t||this.maybeRestoreFocus(),this.adapter.removeClass(n.cssClasses.OPEN),this.adapter.removeClass(n.cssClasses.IS_OPEN_BELOW),void this.adapter.notifyClose();this.adapter.addClass(n.cssClasses.ANIMATING_CLOSED),requestAnimationFrame((function(){e.adapter.removeClass(n.cssClasses.OPEN),e.adapter.removeClass(n.cssClasses.IS_OPEN_BELOW),e.closeAnimationEndTimerId=setTimeout((function(){e.closeAnimationEndTimerId=0,e.adapter.removeClass(n.cssClasses.ANIMATING_CLOSED),e.adapter.notifyClose()}),k.TRANSITION_CLOSE_DURATION)})),this.isSurfaceOpen=!1,t||this.maybeRestoreFocus()}},n.prototype.handleBodyClick=function(t){var e=t.target;this.adapter.isElementInContainer(e)||this.close()},n.prototype.handleKeydown=function(t){var e=t.keyCode;("Escape"===t.key||27===e)&&this.close()},n.prototype.autoposition=function(){var t;this.measurements=this.getAutoLayoutmeasurements();var e=this.getoriginCorner(),i=this.getMenuSurfaceMaxHeight(e),o=this.hasBit(e,N.BOTTOM)?"bottom":"top",r=this.hasBit(e,N.RIGHT)?"right":"left",s=this.getHorizontalOriginOffset(e),a=this.getVerticalOriginOffset(e),u=this.measurements,c=u.anchorSize,d=u.surfaceSize,l=((t={})[r]=s,t[o]=a,t);c.width/d.width>k.ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO&&(r="center"),(this.isHoistedElement||this.isFixedPosition)&&this.adjustPositionForHoistedElement(l),this.adapter.setTransformOrigin(r+" "+o),this.adapter.setPosition(l),this.adapter.setMaxHeight(i?i+"px":""),this.hasBit(e,N.BOTTOM)||this.adapter.addClass(n.cssClasses.IS_OPEN_BELOW)},n.prototype.getAutoLayoutmeasurements=function(){var t=this.adapter.getAnchorDimensions(),e=this.adapter.getBodyDimensions(),n=this.adapter.getWindowDimensions(),i=this.adapter.getWindowScroll();return t||(t={top:this.position.y,right:this.position.x,bottom:this.position.y,left:this.position.x,width:0,height:0}),{anchorSize:t,bodySize:e,surfaceSize:this.dimensions,viewportDistance:{top:t.top,right:n.width-t.right,bottom:n.height-t.bottom,left:t.left},viewportSize:n,windowScroll:i}},n.prototype.getoriginCorner=function(){var t,e,i=this.originCorner,o=this.measurements,r=o.viewportDistance,s=o.anchorSize,a=o.surfaceSize,u=n.numbers.MARGIN_TO_EDGE;this.hasBit(this.anchorCorner,N.BOTTOM)?(t=r.top-u+this.anchorMargin.bottom,e=r.bottom-u-this.anchorMargin.bottom):(t=r.top-u+this.anchorMargin.top,e=r.bottom-u+s.height-this.anchorMargin.top),!(e-a.height>0)&&t>e+this.openBottomBias&&(i=this.setBit(i,N.BOTTOM));var c,d,l,h=this.adapter.isRtl(),f=this.hasBit(this.anchorCorner,N.FLIP_RTL),p=this.hasBit(this.anchorCorner,N.RIGHT)||this.hasBit(i,N.RIGHT);(l=h&&f?!p:p)?(c=r.left+s.width+this.anchorMargin.right,d=r.right-this.anchorMargin.right):(c=r.left+this.anchorMargin.left,d=r.right+s.width-this.anchorMargin.left);var m=c-a.width>0,I=d-a.width>0,E=this.hasBit(i,N.FLIP_RTL)&&this.hasBit(i,N.RIGHT);return I&&E&&h||!m&&E?i=this.unsetBit(i,N.RIGHT):(m&&l&&h||m&&!l&&p||!I&&c>=d)&&(i=this.setBit(i,N.RIGHT)),i},n.prototype.getMenuSurfaceMaxHeight=function(t){if(this.maxHeight>0)return this.maxHeight;var e=this.measurements.viewportDistance,i=0,o=this.hasBit(t,N.BOTTOM),r=this.hasBit(this.anchorCorner,N.BOTTOM),s=n.numbers.MARGIN_TO_EDGE;return o?(i=e.top+this.anchorMargin.top-s,r||(i+=this.measurements.anchorSize.height)):(i=e.bottom-this.anchorMargin.bottom+this.measurements.anchorSize.height-s,r&&(i-=this.measurements.anchorSize.height)),i},n.prototype.getHorizontalOriginOffset=function(t){var e=this.measurements.anchorSize,n=this.hasBit(t,N.RIGHT),i=this.hasBit(this.anchorCorner,N.RIGHT);if(n){var o=i?e.width-this.anchorMargin.left:this.anchorMargin.right;return this.isHoistedElement||this.isFixedPosition?o-(this.measurements.viewportSize.width-this.measurements.bodySize.width):o}return i?e.width-this.anchorMargin.right:this.anchorMargin.left},n.prototype.getVerticalOriginOffset=function(t){var e=this.measurements.anchorSize,n=this.hasBit(t,N.BOTTOM),i=this.hasBit(this.anchorCorner,N.BOTTOM);return n?i?e.height-this.anchorMargin.top:-this.anchorMargin.bottom:i?e.height+this.anchorMargin.bottom:this.anchorMargin.top},n.prototype.adjustPositionForHoistedElement=function(t){var e,n,i=this.measurements,o=i.windowScroll,r=i.viewportDistance,s=i.surfaceSize,a=i.viewportSize,u=Object.keys(t);try{for(var c=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(u),d=c.next();!d.done;d=c.next()){var l=d.value,h=t[l]||0;!this.isHorizontallyCenteredOnViewport||"left"!==l&&"right"!==l?(h+=r[l],this.isFixedPosition||("top"===l?h+=o.y:"bottom"===l?h-=o.y:"left"===l?h+=o.x:h-=o.x),t[l]=h):t[l]=(a.width-s.width)/2}}catch(t){e={error:t}}finally{try{d&&!d.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}},n.prototype.maybeRestoreFocus=function(){var t=this,e=this.adapter.isFocused(),n=this.adapter.getOwnerDocument?this.adapter.getOwnerDocument():document,i=n.activeElement&&this.adapter.isElementInContainer(n.activeElement);(e||i)&&setTimeout((function(){t.adapter.restoreFocus()}),k.TOUCH_EVENT_WAIT_MS)},n.prototype.hasBit=function(t,e){return Boolean(t&e)},n.prototype.setBit=function(t,e){return t|e},n.prototype.unsetBit=function(t,e){return t^e},n.prototype.isFinite=function(t){return"number"==typeof t&&isFinite(t)},n}(u),H={animation:{prefixed:"-webkit-animation",standard:"animation"},transform:{prefixed:"-webkit-transform",standard:"transform"},transition:{prefixed:"-webkit-transition",standard:"transition"}};var U,j=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.attachTo=function(t){return new n(t)},n.prototype.initialSyncWithDOM=function(){var t=this,e=this.root.parentElement;this.anchorElement=e&&e.classList.contains(F.ANCHOR)?e:null,this.root.classList.contains(F.FIXED)&&this.setFixedPosition(!0),this.handleKeydown=function(e){t.foundation.handleKeydown(e)},this.handleBodyClick=function(e){t.foundation.handleBodyClick(e)},this.registerBodyClickListener=function(){document.body.addEventListener("click",t.handleBodyClick,{capture:!0})},this.deregisterBodyClickListener=function(){document.body.removeEventListener("click",t.handleBodyClick,{capture:!0})},this.listen("keydown",this.handleKeydown),this.listen(P.OPENED_EVENT,this.registerBodyClickListener),this.listen(P.CLOSED_EVENT,this.deregisterBodyClickListener)},n.prototype.destroy=function(){this.unlisten("keydown",this.handleKeydown),this.unlisten(P.OPENED_EVENT,this.registerBodyClickListener),this.unlisten(P.CLOSED_EVENT,this.deregisterBodyClickListener),t.prototype.destroy.call(this)},n.prototype.isOpen=function(){return this.foundation.isOpen()},n.prototype.open=function(){this.foundation.open()},n.prototype.close=function(t){void 0===t&&(t=!1),this.foundation.close(t)},Object.defineProperty(n.prototype,"quickOpen",{set:function(t){this.foundation.setQuickOpen(t)},enumerable:!1,configurable:!0}),n.prototype.setIsHoisted=function(t){this.foundation.setIsHoisted(t)},n.prototype.setMenuSurfaceAnchorElement=function(t){this.anchorElement=t},n.prototype.setFixedPosition=function(t){t?this.root.classList.add(F.FIXED):this.root.classList.remove(F.FIXED),this.foundation.setFixedPosition(t)},n.prototype.setAbsolutePosition=function(t,e){this.foundation.setAbsolutePosition(t,e),this.setIsHoisted(!0)},n.prototype.setAnchorCorner=function(t){this.foundation.setAnchorCorner(t)},n.prototype.setAnchorMargin=function(t){this.foundation.setAnchorMargin(t)},n.prototype.getDefaultFoundation=function(){var t=this,e={addClass:function(e){return t.root.classList.add(e)},removeClass:function(e){return t.root.classList.remove(e)},hasClass:function(e){return t.root.classList.contains(e)},hasAnchor:function(){return!!t.anchorElement},notifyClose:function(){return t.emit(B.strings.CLOSED_EVENT,{})},notifyClosing:function(){t.emit(B.strings.CLOSING_EVENT,{})},notifyOpen:function(){return t.emit(B.strings.OPENED_EVENT,{})},notifyOpening:function(){return t.emit(B.strings.OPENING_EVENT,{})},isElementInContainer:function(e){return t.root.contains(e)},isRtl:function(){return"rtl"===getComputedStyle(t.root).getPropertyValue("direction")},setTransformOrigin:function(e){var n=function(t,e){if(function(t){return Boolean(t.document)&&"function"==typeof t.document.createElement}(t)&&e in H){var n=t.document.createElement("div"),i=H[e],o=i.standard,r=i.prefixed;return o in n.style?o:r}return e}(window,"transform")+"-origin";t.root.style.setProperty(n,e)},isFocused:function(){return document.activeElement===t.root},saveFocus:function(){t.previousFocus=document.activeElement},restoreFocus:function(){t.root.contains(document.activeElement)&&t.previousFocus&&t.previousFocus.focus&&t.previousFocus.focus()},getInnerDimensions:function(){return{width:t.root.offsetWidth,height:t.root.offsetHeight}},getAnchorDimensions:function(){return t.anchorElement?t.anchorElement.getBoundingClientRect():null},getWindowDimensions:function(){return{width:window.innerWidth,height:window.innerHeight}},getBodyDimensions:function(){return{width:document.body.clientWidth,height:document.body.clientHeight}},getWindowScroll:function(){return{x:window.pageXOffset,y:window.pageYOffset}},setPosition:function(e){var n=t.root;n.style.left="left"in e?e.left+"px":"",n.style.right="right"in e?e.right+"px":"",n.style.top="top"in e?e.top+"px":"",n.style.bottom="bottom"in e?e.bottom+"px":""},setMaxHeight:function(e){t.root.style.maxHeight=e}};return new B(e)},n}(c),V={MENU_SELECTED_LIST_ITEM:"mdc-menu-item--selected",MENU_SELECTION_GROUP:"mdc-menu__selection-group",ROOT:"mdc-menu"},G={ARIA_CHECKED_ATTR:"aria-checked",ARIA_DISABLED_ATTR:"aria-disabled",CHECKBOX_SELECTOR:'input[type="checkbox"]',LIST_SELECTOR:".mdc-list,.mdc-deprecated-list",SELECTED_EVENT:"MDCMenu:selected",SKIP_RESTORE_FOCUS:"data-menu-item-skip-restore-focus"},W={FOCUS_ROOT_INDEX:-1};!function(t){t[t.NONE=0]="NONE",t[t.LIST_ROOT=1]="LIST_ROOT",t[t.FIRST_ITEM=2]="FIRST_ITEM",t[t.LAST_ITEM=3]="LAST_ITEM"}(U||(U={}));var X=function(t){function n(e){var o=t.call(this,i(i({},n.defaultAdapter),e))||this;return o.closeAnimationEndTimerId=0,o.defaultFocusState=U.LIST_ROOT,o.selectedIndex=-1,o}return e(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return V},enumerable:!1,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return G},enumerable:!1,configurable:!0}),Object.defineProperty(n,"numbers",{get:function(){return W},enumerable:!1,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClassToElementAtIndex:function(){},removeClassFromElementAtIndex:function(){},addAttributeToElementAtIndex:function(){},removeAttributeFromElementAtIndex:function(){},getAttributeFromElementAtIndex:function(){return null},elementContainsClass:function(){return!1},closeSurface:function(){},getElementIndex:function(){return-1},notifySelected:function(){},getMenuItemCount:function(){return 0},focusItemAtIndex:function(){},focusListRoot:function(){},getSelectedSiblingOfItemAtIndex:function(){return-1},isSelectableItemAtIndex:function(){return!1}}},enumerable:!1,configurable:!0}),n.prototype.destroy=function(){this.closeAnimationEndTimerId&&clearTimeout(this.closeAnimationEndTimerId),this.adapter.closeSurface()},n.prototype.handleKeydown=function(t){var e=t.key,n=t.keyCode;("Tab"===e||9===n)&&this.adapter.closeSurface(!0)},n.prototype.handleItemAction=function(t){var e=this,n=this.adapter.getElementIndex(t);if(!(n<0)){this.adapter.notifySelected({index:n});var i="true"===this.adapter.getAttributeFromElementAtIndex(n,G.SKIP_RESTORE_FOCUS);this.adapter.closeSurface(i),this.closeAnimationEndTimerId=setTimeout((function(){var n=e.adapter.getElementIndex(t);n>=0&&e.adapter.isSelectableItemAtIndex(n)&&e.setSelectedIndex(n)}),B.numbers.TRANSITION_CLOSE_DURATION)}},n.prototype.handleMenuSurfaceOpened=function(){switch(this.defaultFocusState){case U.FIRST_ITEM:this.adapter.focusItemAtIndex(0);break;case U.LAST_ITEM:this.adapter.focusItemAtIndex(this.adapter.getMenuItemCount()-1);break;case U.NONE:break;default:this.adapter.focusListRoot()}},n.prototype.setDefaultFocusState=function(t){this.defaultFocusState=t},n.prototype.getSelectedIndex=function(){return this.selectedIndex},n.prototype.setSelectedIndex=function(t){if(this.validatedIndex(t),!this.adapter.isSelectableItemAtIndex(t))throw new Error("MDCMenuFoundation: No selection group at specified index.");var e=this.adapter.getSelectedSiblingOfItemAtIndex(t);e>=0&&(this.adapter.removeAttributeFromElementAtIndex(e,G.ARIA_CHECKED_ATTR),this.adapter.removeClassFromElementAtIndex(e,V.MENU_SELECTED_LIST_ITEM)),this.adapter.addClassToElementAtIndex(t,V.MENU_SELECTED_LIST_ITEM),this.adapter.addAttributeToElementAtIndex(t,G.ARIA_CHECKED_ATTR,"true"),this.selectedIndex=t},n.prototype.setEnabled=function(t,e){this.validatedIndex(t),e?(this.adapter.removeClassFromElementAtIndex(t,h.LIST_ITEM_DISABLED_CLASS),this.adapter.addAttributeToElementAtIndex(t,G.ARIA_DISABLED_ATTR,"false")):(this.adapter.addClassToElementAtIndex(t,h.LIST_ITEM_DISABLED_CLASS),this.adapter.addAttributeToElementAtIndex(t,G.ARIA_DISABLED_ATTR,"true"))},n.prototype.validatedIndex=function(t){var e=this.adapter.getMenuItemCount();if(!(t>=0&&t<e))throw new Error("MDCMenuFoundation: No list item at specified index.")},n}(u),K=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.attachTo=function(t){return new n(t)},n.prototype.initialize=function(t,e){void 0===t&&(t=function(t){return new j(t)}),void 0===e&&(e=function(t){return new w(t)}),this.menuSurfaceFactory=t,this.listFactory=e},n.prototype.initialSyncWithDOM=function(){var t=this;this.menuSurface=this.menuSurfaceFactory(this.root);var e=this.root.querySelector(G.LIST_SELECTOR);e?(this.list=this.listFactory(e),this.list.wrapFocus=!0):this.list=null,this.handleKeydown=function(e){t.foundation.handleKeydown(e)},this.handleItemAction=function(e){t.foundation.handleItemAction(t.items[e.detail.index])},this.handleMenuSurfaceOpened=function(){t.foundation.handleMenuSurfaceOpened()},this.menuSurface.listen(B.strings.OPENED_EVENT,this.handleMenuSurfaceOpened),this.listen("keydown",this.handleKeydown),this.listen(M.strings.ACTION_EVENT,this.handleItemAction)},n.prototype.destroy=function(){this.list&&this.list.destroy(),this.menuSurface.destroy(),this.menuSurface.unlisten(B.strings.OPENED_EVENT,this.handleMenuSurfaceOpened),this.unlisten("keydown",this.handleKeydown),this.unlisten(M.strings.ACTION_EVENT,this.handleItemAction),t.prototype.destroy.call(this)},Object.defineProperty(n.prototype,"open",{get:function(){return this.menuSurface.isOpen()},set:function(t){t?this.menuSurface.open():this.menuSurface.close()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"wrapFocus",{get:function(){return!!this.list&&this.list.wrapFocus},set:function(t){this.list&&(this.list.wrapFocus=t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasTypeahead",{set:function(t){this.list&&(this.list.hasTypeahead=t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"typeaheadInProgress",{get:function(){return!!this.list&&this.list.typeaheadInProgress},enumerable:!1,configurable:!0}),n.prototype.typeaheadMatchItem=function(t,e){return this.list?this.list.typeaheadMatchItem(t,e):-1},n.prototype.layout=function(){this.list&&this.list.layout()},Object.defineProperty(n.prototype,"items",{get:function(){return this.list?this.list.listElements:[]},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"singleSelection",{set:function(t){this.list&&(this.list.singleSelection=t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"selectedIndex",{get:function(){return this.list?this.list.selectedIndex:I.UNSET_INDEX},set:function(t){this.list&&(this.list.selectedIndex=t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"quickOpen",{set:function(t){this.menuSurface.quickOpen=t},enumerable:!1,configurable:!0}),n.prototype.setDefaultFocusState=function(t){this.foundation.setDefaultFocusState(t)},n.prototype.setAnchorCorner=function(t){this.menuSurface.setAnchorCorner(t)},n.prototype.setAnchorMargin=function(t){this.menuSurface.setAnchorMargin(t)},n.prototype.setSelectedIndex=function(t){this.foundation.setSelectedIndex(t)},n.prototype.setEnabled=function(t,e){this.foundation.setEnabled(t,e)},n.prototype.getOptionByIndex=function(t){return t<this.items.length?this.items[t]:null},n.prototype.getPrimaryTextAtIndex=function(t){var e=this.getOptionByIndex(t);return e&&this.list&&this.list.getPrimaryText(e)||""},n.prototype.setFixedPosition=function(t){this.menuSurface.setFixedPosition(t)},n.prototype.setIsHoisted=function(t){this.menuSurface.setIsHoisted(t)},n.prototype.setAbsolutePosition=function(t,e){this.menuSurface.setAbsolutePosition(t,e)},n.prototype.setAnchorElement=function(t){this.menuSurface.anchorElement=t},n.prototype.getDefaultFoundation=function(){var t=this;return new X({addClassToElementAtIndex:function(e,n){t.items[e].classList.add(n)},removeClassFromElementAtIndex:function(e,n){t.items[e].classList.remove(n)},addAttributeToElementAtIndex:function(e,n,i){t.items[e].setAttribute(n,i)},removeAttributeFromElementAtIndex:function(e,n){t.items[e].removeAttribute(n)},getAttributeFromElementAtIndex:function(e,n){return t.items[e].getAttribute(n)},elementContainsClass:function(t,e){return t.classList.contains(e)},closeSurface:function(e){t.menuSurface.close(e)},getElementIndex:function(e){return t.items.indexOf(e)},notifySelected:function(e){t.emit(G.SELECTED_EVENT,{index:e.index,item:t.items[e.index]})},getMenuItemCount:function(){return t.items.length},focusItemAtIndex:function(e){t.items[e].focus()},focusListRoot:function(){t.root.querySelector(G.LIST_SELECTOR).focus()},isSelectableItemAtIndex:function(e){return!!d(t.items[e],"."+V.MENU_SELECTION_GROUP)},getSelectedSiblingOfItemAtIndex:function(e){var n=d(t.items[e],"."+V.MENU_SELECTION_GROUP).querySelector("."+V.MENU_SELECTED_LIST_ITEM);return n?t.items.indexOf(n):-1}})},n}(c),z=n(5823),q=n.n(z);function $(t){return $="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$(t)}function Q(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==$(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!==$(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(i.key),"symbol"===$(o)?o:String(o)),i)}var o}var Y=window.jQuery,Z=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.options=e||{},this.template=_.template(q())}var e,n;return e=t,(n=[{key:"render",value:function(){return this.$menu=Y(this.template(this.options)),this.menu=new K(this.$menu[0]),this.$menu}},{key:"show",value:function(){var t=this;this.menu.open=!0,setTimeout((function(){t.$menu.find(".mdc-menu-item--selected").focus()}),250)}},{key:"hide",value:function(){this.menu.open=!1}}])&&Q(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),J=n(5311),tt=n(5311);function et(t){return et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},et(t)}function nt(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==et(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!==et(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(i.key),"symbol"===et(o)?o:String(o)),i)}var o}var it=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n;return e=t,n=[{key:"postForm",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=J("<form method='POST' style='display:none;'></form>").appendTo(document.body);for(var i in e&&n.attr("target","_blank"),t)t.hasOwnProperty(i)&&tt('<input type="hidden" />').attr({name:i,value:t[i]}).appendTo(n);n.submit(),n.remove()}}],n&&nt(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),ot=n(5148),rt=n.n(ot),st=n(5311);function at(t){return at="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},at(t)}function ut(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==at(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!==at(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(i.key),"symbol"===at(o)?o:String(o)),i)}var o}var ct=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n;return e=t,(n=[{key:"show",value:function(){this._getElement().show()}},{key:"hide",value:function(){this._getElement().hide()}},{key:"_getElement",value:function(){return this.$element||(this.$element=st(this._getHTML()),st("body").append(this.$element)),this.$element}},{key:"_getHTML",value:function(){return'\n\t\t\t<div class="bgppb-page-loading">\n\t\t\t\t<span class="bgppb-page-loading__logo">'.concat(rt(),'</span>\n\t\t\t\t<span class="bgppb-page-loading__spinner"></span>\n\t\t\t</div>\n\t\t')}}])&&ut(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),dt=n(5311);function lt(t){return lt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lt(t)}function ht(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==lt(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!==lt(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(i.key),"symbol"===lt(o)?o:String(o)),i)}var o}var ft=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.labels=[{name:"bgppb",value:"bgppb",label:'<img src="'.concat(BoldgridEditor.plugin_url,'/assets/image/boldgrid-logo.svg"/> <span>Post and Page Builder</span>')},{name:"modern",value:"modern",label:"<span>WordPress Editor</span>"},{name:"classic",value:"classic",label:"<span>Classic Editor</span>"},{name:"default",value:"default",label:"<span>Default</span>"}],this.labels=this._filterAvailableEditors(this.labels),this.loading=new ct}var e,n;return e=t,(n=[{key:"init",value:function(){this.$element=dt(this._getHtml()),this.menu=this._renderMenu(),this._setupMenu(),this._setupClick(),dt("#screen-meta-links").prepend(this.$element),this.$element.show(),this.setEditorOverrideInput(dt("form#post"))}},{key:"changeType",value:function(t){var e=this;this.loading.show(),(new it).postForm({bgppb_default_editor_post:t},!1),setTimeout((function(){return e.loading.hide()}),3e3)}},{key:"setEditorOverrideInput",value:function(t){var e=dt("<input/>");e.attr("type","hidden").attr("name","bgppb_default_editor_post").val(BoldgridEditor.editor_override).attr("value",BoldgridEditor.editor_override),t.append(e)}},{key:"_filterAvailableEditors",value:function(t){return t.filter((function(t){return-1!==BoldgridEditor.plugin_configs.valid_editors.indexOf(t.name)}))}},{key:"_setupMenu",value:function(){var t=this;this.$element.find("[data-action]").on("click",(function(e){var n=dt(e.currentTarget).attr("data-action");t.changeType(n)}))}},{key:"_renderMenu",value:function(){var t=new Z({name:"bgppb-choose-editor",options:this.labels.filter((function(t){return"default"!==t.value})),selected:BoldgridEditor.globalSettings.current_editor});return this.$element.find(".menu-container").append(t.render()),t}},{key:"_setupClick",value:function(){var t=this;this.$element.find(".current-editor").on("click",(function(e){e.preventDefault(),t.menu.menu.open||t.menu.show()}))}},{key:"_getHtml",value:function(){var t=this.labels.find((function(t){return t.name===BoldgridEditor.globalSettings.current_editor}));return'\n\t\t\t<div id="bgppb-choose-editor" class="screen-meta-toggle">\n\t\t\t\t<span class="label">\n\t\t\t\t\t<span>Editor</span>\n\t\t\t\t</span>\n\t\t\t\t<span class="current-editor show-settings button">\n\t\t\t\t\t'.concat(t.label,'\n\t\t\t\t</span>\n\t\t\t\t<span class="menu-container"></span>\n\t\t\t</div>\n\t\t')}}])&&ht(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),pt=n(5311);function mt(t){return mt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mt(t)}function It(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==mt(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!==mt(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(i.key),"symbol"===mt(o)?o:String(o)),i)}var o}var Et=wp.i18n.__,yt=wp.element.createElement,St=wp.plugins.registerPlugin;(new(function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.editorSelect=new ft,this.loading=new ct}var e,n;return e=t,(n=[{key:"init",value:function(){var t=this,e=wp.data.select("core/edit-post").getActiveGeneralSidebarName();["bgppb-classic/bgppb-classic","bgppb/bgppb"].includes(e)&&wp.data.dispatch("core/edit-post").closeGeneralSidebar(),pt((function(){return t._onload()}))}},{key:"_onload",value:function(){this._bindSidebarOpen(),this.registerPlugin({pluginName:"bgppb",type:"bgppb",label:"Post and Page Builder",icon:yt("img",{src:BoldgridEditor.plugin_url+"/assets/image/boldgrid-logo.svg",width:"24px"})}),this.registerPlugin({pluginName:"bgppb-classic",type:"classic",label:"Classic Editor",icon:"edit"}),this.editorSelect.setEditorOverrideInput(pt("form.metabox-base-form"))}},{key:"_bindSidebarOpen",value:function(){var t=this;wp.data.subscribe((function(e){var n=wp.data.select("core/edit-post").getActiveGeneralSidebarName();"bgppb-classic/bgppb-classic"===n?t.editorSelect.changeType("classic"):"bgppb/bgppb"===n&&t.editorSelect.changeType("bgppb")}))}},{key:"registerPlugin",value:function(t){St(t.pluginName,{icon:t.icon||"",render:function(){return yt(wp.editPost.PluginSidebarMoreMenuItem,{target:t.pluginName},Et(t.label))}})}}])&&It(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())).init()}()}();