vrembem 1.41.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t||self).vrembem={})}(this,function(t){var e=function(t,e){e&&document.querySelectorAll(e).forEach(function(e){t?(e.inert=!0,e.setAttribute("aria-hidden",!0)):(e.inert=null,e.removeAttribute("aria-hidden"))})},n=function(t,e){e&&document.querySelectorAll(e).forEach(function(e){t?e.style.overflow="hidden":e.style.removeProperty("overflow")})},i=function(t){t&&document.querySelectorAll(t).forEach(function(t){t.setAttribute("tabindex","-1")})},r=function(t){var e=arguments;(t=t.forEach?t:[t]).forEach(function(t){var n;(n=t.classList).add.apply(n,[].slice.call(e,1))})},o=['a[href]:not([tabindex^="-"])','area[href]:not([tabindex^="-"])','input:not([type="hidden"]):not([type="radio"]):not([disabled]):not([tabindex^="-"])','input[type="radio"]:not([disabled]):not([tabindex^="-"])','select:not([disabled]):not([tabindex^="-"])','textarea:not([disabled]):not([tabindex^="-"])','button:not([disabled]):not([tabindex^="-"])','iframe:not([tabindex^="-"])','audio[controls]:not([tabindex^="-"])','video[controls]:not([tabindex^="-"])','[contenteditable]:not([tabindex^="-"])','[tabindex]:not([tabindex^="-"])'],s=function(t,e){var n=t.querySelector("[data-"+e.dataFocus+"]");if(n)n.focus();else{var i=t.querySelector('[tabindex="-1"]');i&&i.focus()}},a=function(t){void 0===t&&(t=null),t&&t.memory&&t.memory.trigger&&(t.memory.trigger.focus(),t.memory.trigger=null)},c=/*#__PURE__*/function(){function t(){this.target=null,this.__handlerFocusTrap=this.handlerFocusTrap.bind(this)}var e=t.prototype;return e.init=function(t){this.target=t,this.inner=this.target.querySelector('[tabindex="-1"]'),this.focusable=this.getFocusable(),this.focusable.length?(this.focusableFirst=this.focusable[0],this.focusableLast=this.focusable[this.focusable.length-1],this.target.addEventListener("keydown",this.__handlerFocusTrap)):this.target.addEventListener("keydown",this.handlerFocusLock)},e.destroy=function(){this.target&&(this.inner=null,this.focusable=null,this.focusableFirst=null,this.focusableLast=null,this.target.removeEventListener("keydown",this.__handlerFocusTrap),this.target.removeEventListener("keydown",this.handlerFocusLock),this.target=null)},e.refresh=function(){this.target&&(this.target.removeEventListener("keydown",this.__handlerFocusTrap),this.target.removeEventListener("keydown",this.handlerFocusLock),this.focusable=this.getFocusable(),this.focusable.length?(this.focusableFirst=this.focusable[0],this.focusableLast=this.focusable[this.focusable.length-1],this.target.addEventListener("keydown",this.__handlerFocusTrap)):(this.focusableFirst=null,this.focusableLast=null,this.target.addEventListener("keydown",this.handlerFocusLock)))},e.handlerFocusTrap=function(t){("Tab"===t.key||9===t.keyCode)&&(t.shiftKey?document.activeElement!==this.focusableFirst&&document.activeElement!==this.inner||(this.focusableLast.focus(),t.preventDefault()):document.activeElement!==this.focusableLast&&document.activeElement!==this.inner||(this.focusableFirst.focus(),t.preventDefault()))},e.handlerFocusLock=function(t){("Tab"===t.key||9===t.keyCode)&&t.preventDefault()},e.getFocusable=function(){var t=[],e=document.activeElement,n=this.inner?this.inner.scrollTop:0;return this.target.querySelectorAll(o.join(",")).forEach(function(e){e.focus(),e===document.activeElement&&t.push(e)}),this.inner&&(this.inner.scrollTop=n),e.focus(),t},t}(),l=function(t,e){return void 0===e&&(e=0),"string"!=typeof t?t:e?document.querySelector(t):document.querySelectorAll(t)},u=function(t){return t=[].slice.call(t=t.forEach?t:[t]),[].slice.call(arguments,1).some(function(e){return t.some(function(t){if(t.classList.contains(e))return!0})})};function d(t,e,n){if(void 0===n&&(n=!1),n){var i=l(t);if(!i.length)throw new Error('Move target element "'+t+'" not found!');var r=l(n,1);if(!r)throw new Error('Move reference element "'+n+'" not found!');i.forEach(function(t){switch(e){case"after":return r.after(t),{ref:r,el:t,type:e};case"before":return r.before(t),{ref:r,el:t,type:e};case"append":return r.append(t),{ref:r,el:t,type:e};case"prepend":return r.prepend(t),{ref:r,el:t,type:e};default:throw new Error('Move type "'+e+'" does not exist!')}})}}var f=function(t){var e=arguments;(t=t.forEach?t:[t]).forEach(function(t){var n;(n=t.classList).remove.apply(n,[].slice.call(e,1))})},h=function(t,e){return new Promise(function(n){e.transition?(t.classList.remove(e.stateClosed),t.classList.add(e.stateOpening),t.addEventListener("transitionend",function i(){t.classList.add(e.stateOpened),t.classList.remove(e.stateOpening),n(t),this.removeEventListener("transitionend",i)})):(t.classList.add(e.stateOpened),t.classList.remove(e.stateClosed),n(t))})},p=function(t,e){return new Promise(function(n){e.transition?(t.classList.add(e.stateClosing),t.classList.remove(e.stateOpened),t.addEventListener("transitionend",function i(){t.classList.remove(e.stateClosing),t.classList.add(e.stateClosed),n(t),this.removeEventListener("transitionend",i)})):(t.classList.add(e.stateClosed),t.classList.remove(e.stateOpened),n(t))})},g={__proto__:null,setInert:e,setOverflowHidden:n,setTabindex:i,addClass:r,camelCase:function(t){return t.replace(/-([a-z])/g,function(t){return t[1].toUpperCase()})},focusTarget:s,focusTrigger:a,FocusTrap:c,getElement:l,hasClass:u,hyphenCase:function(t){return t.replace(/([a-z][A-Z])/g,function(t){return t[0]+"-"+t[1].toLowerCase()})},moveElement:d,removeClass:f,toggleClass:function(t){var e=arguments;(t=t.forEach?t:[t]).forEach(function(t){[].slice.call(e,1).forEach(function(e){t.classList.toggle(e)})})},openTransition:h,closeTransition:p};function v(){return(v=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}function m(t,e){return(m=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var y={autoInit:!1,stateAttr:"aria-checked",stateValue:"mixed"},b=/*#__PURE__*/function(){function t(t){this.defaults=y,this.settings=v({},this.defaults,t),this.__handlerClick=this.handlerClick.bind(this),this.settings.autoInit&&this.init()}var e=t.prototype;return e.init=function(t){void 0===t&&(t=null),t&&(this.settings=v({},this.settings,t));var e=document.querySelectorAll("["+this.settings.stateAttr+'="'+this.settings.stateValue+'"]');this.setIndeterminate(e),document.addEventListener("click",this.__handlerClick,!1)},e.destroy=function(){document.removeEventListener("click",this.__handlerClick,!1)},e.handlerClick=function(t){var e=t.target.closest("["+this.settings.stateAttr+'="'+this.settings.stateValue+'"]');e&&(this.removeAriaState(e),this.setIndeterminate(e))},e.setAriaState=function(t,e){var n=this;void 0===e&&(e=this.settings.stateValue),(t=t.forEach?t:[t]).forEach(function(t){t.setAttribute(n.settings.stateAttr,e)})},e.removeAriaState=function(t){var e=this;(t=t.forEach?t:[t]).forEach(function(t){t.removeAttribute(e.settings.stateAttr)})},e.setIndeterminate=function(t){var e=this;(t=t.forEach?t:[t]).forEach(function(t){t.indeterminate=!!t.hasAttribute(e.settings.stateAttr)})},t}(),w={autoInit:!1,dataDrawer:"drawer",dataDialog:"drawer-dialog",dataToggle:"drawer-toggle",dataOpen:"drawer-open",dataClose:"drawer-close",dataBreakpoint:"drawer-breakpoint",dataFocus:"drawer-focus",stateOpened:"is-opened",stateOpening:"is-opening",stateClosing:"is-closing",stateClosed:"is-closed",classModal:"drawer_modal",selectorInert:null,selectorOverflow:null,breakpoints:null,customEventPrefix:"drawer:",eventListeners:!0,stateSave:!0,stateKey:"DrawerState",setTabindex:!0,transition:!0},E=/*#__PURE__*/function(){function t(t){this.mediaQueryLists=[],this.parent=t,this.prefix=this.getVariablePrefix(),this.__check=this.check.bind(this)}var e=t.prototype;return e.init=function(){var t=this;document.querySelectorAll("[data-"+this.parent.settings.dataBreakpoint+"]").forEach(function(e){var n=e.getAttribute("data-"+t.parent.settings.dataDrawer),i=e.getAttribute("data-"+t.parent.settings.dataBreakpoint),r=t.getBreakpoint(i),o=window.matchMedia("(min-width:"+r+")");t.match(o,e),"function"==typeof o.addEventListener?o.addEventListener("change",t.__check):o.addListener(t.__check),t.mediaQueryLists.push({mql:o,drawer:n})})},e.destroy=function(){var t=this;this.mediaQueryLists&&this.mediaQueryLists.length&&this.mediaQueryLists.forEach(function(e){e.mql.removeListener(t.__check)}),this.mediaQueryLists=null},e.check=function(t){var e=this;void 0===t&&(t=null),this.mediaQueryLists&&this.mediaQueryLists.length&&(this.mediaQueryLists.forEach(function(n){if(!t||t.media==n.mql.media){var i=document.querySelector("[data-"+e.parent.settings.dataDrawer+'="'+n.drawer+'"]');i&&e.match(n.mql,i)}}),document.dispatchEvent(new CustomEvent(this.parent.settings.customEventPrefix+"breakpoint",{bubbles:!0})))},e.match=function(t,e){t.matches?this.parent.switchToDefault(e):this.parent.switchToModal(e)},e.getBreakpoint=function(t){var e=t;return this.parent.settings.breakpoints&&this.parent.settings.breakpoints[t]?e=this.parent.settings.breakpoints[t]:getComputedStyle(document.body).getPropertyValue(this.prefix+t)&&(e=getComputedStyle(document.body).getPropertyValue(this.prefix+t)),e},e.getVariablePrefix=function(){var t="--";return(t+=getComputedStyle(document.body).getPropertyValue("--vrembem-variable-prefix"))+"breakpoint-"},t}();function x(t){return"string"!=typeof t?t:document.querySelector("[data-"+this.settings.dataDrawer+'="'+t+'"]')}function O(t){return Promise.reject(new Error('Did not find drawer with key: "'+t+'"'))}var L=function(t){try{var i=this,r=i.getDrawer(t);return r?u(r,i.settings.stateOpened)?(i.working=!0,u(r,i.settings.classModal)&&(e(!1,i.settings.selectorInert),n(!1,i.settings.selectorOverflow)),Promise.resolve(p(r,i.settings)).then(function(){return i.stateSave(r),a(i),i.focusTrap.destroy(),r.dispatchEvent(new CustomEvent(i.settings.customEventPrefix+"closed",{detail:i,bubbles:!0})),i.working=!1,r})):Promise.resolve(r):Promise.resolve(O(t))}catch(t){return Promise.reject(t)}};function k(t){if(!this.working){var e=t.target.closest("[data-"+this.settings.dataToggle+"]");if(e){var n=e.getAttribute("data-"+this.settings.dataToggle);return this.memory.trigger=e,this.toggle(n),void t.preventDefault()}if(e=t.target.closest("[data-"+this.settings.dataOpen+"]")){var i=e.getAttribute("data-"+this.settings.dataOpen);return this.memory.trigger=e,this.open(i),void t.preventDefault()}if(e=t.target.closest("[data-"+this.settings.dataClose+"]")){var r=e.getAttribute("data-"+this.settings.dataClose);if(r)this.memory.trigger=e,this.close(r);else{var o=t.target.closest("[data-"+this.settings.dataDrawer+"]");o&&this.close(o)}t.preventDefault()}else t.target.hasAttribute("data-"+this.settings.dataDrawer)&&this.close(t.target)}}function _(t){if(!this.working&&"Escape"===t.key){var e=document.querySelector("."+this.settings.classModal+"."+this.settings.stateOpened);e&&this.close(e)}}var A=function(t){try{var i=this,r=i.getDrawer(t);if(!r)return Promise.resolve(O(t));if(u(r,i.settings.stateOpened))return s(r,i.settings),Promise.resolve(r);i.working=!0;var o=u(r,i.settings.classModal);return o&&n(!0,i.settings.selectorOverflow),Promise.resolve(h(r,i.settings)).then(function(){return i.stateSave(r),o&&(i.focusTrap.init(r),e(!0,i.settings.selectorInert)),s(r,i.settings),r.dispatchEvent(new CustomEvent(i.settings.customEventPrefix+"opened",{detail:i,bubbles:!0})),i.working=!1,r})}catch(t){return Promise.reject(t)}};function P(t,e){if(!e.stateSave)return C(e);var n=localStorage.getItem(e.stateKey)?JSON.parse(localStorage.getItem(e.stateKey)):{};return(t?[t]:document.querySelectorAll("[data-"+e.dataDrawer+"]")).forEach(function(t){if(!u(t,e.classModal)){var i=t.getAttribute("data-"+e.dataDrawer);n[i]=u(t,e.stateOpened)?e.stateOpened:e.stateClosed}}),localStorage.setItem(e.stateKey,JSON.stringify(n)),n}function C(t){return localStorage.getItem(t.stateKey)&&localStorage.removeItem(t.stateKey),{}}var D=function(t){try{var i=this,o=i.getDrawer(t);return o?u(o,i.settings.classModal)?(e(!1,i.settings.selectorInert),n(!1,i.settings.selectorOverflow),f(o,i.settings.classModal),i.focusTrap.destroy(),t=o.getAttribute("data-"+i.settings.dataDrawer),i.state[t]==i.settings.stateOpened&&(r(o,i.settings.stateOpened),f(o,i.settings.stateClosed)),o.dispatchEvent(new CustomEvent(i.settings.customEventPrefix+"toDefault",{bubbles:!0})),Promise.resolve(o)):Promise.resolve():Promise.resolve(O(t))}catch(t){return Promise.reject(t)}},S=function(t){try{var e=this,n=e.getDrawer(t);return n?u(n,e.settings.classModal)?Promise.resolve():(r(n,e.settings.classModal),r(n,e.settings.stateClosed),f(n,e.settings.stateOpened),n.dispatchEvent(new CustomEvent(e.settings.customEventPrefix+"toModal",{bubbles:!0})),Promise.resolve(n)):Promise.resolve(O(t))}catch(t){return Promise.reject(t)}},T=function(t){try{var e=this,n=e.getDrawer(t);if(!n)return Promise.resolve(O(t));var i=!u(n,e.settings.stateOpened);return Promise.resolve(i?e.open(n):e.close(n))}catch(t){return Promise.reject(t)}},j=/*#__PURE__*/function(){function t(t){this.defaults=w,this.settings=v({},this.defaults,t),this.working=!1,this.memory={},this.state={},this.focusTrap=new c,this.breakpoint=new E(this),this.__handlerClick=k.bind(this),this.__handlerKeydown=_.bind(this),this.settings.autoInit&&this.init()}var e=t.prototype;return e.init=function(t){void 0===t&&(t=null),t&&(this.settings=v({},this.settings,t)),this.stateSet(),this.settings.setTabindex&&this.setTabindex(),this.breakpoint.init(),this.settings.eventListeners&&this.initEventListeners()},e.destroy=function(){this.breakpoint.destroy(),this.memory={},this.state={},localStorage.removeItem(this.settings.stateKey),this.settings.eventListeners&&this.destroyEventListeners()},e.initEventListeners=function(){document.addEventListener("click",this.__handlerClick,!1),document.addEventListener("touchend",this.__handlerClick,!1),document.addEventListener("keydown",this.__handlerKeydown,!1)},e.destroyEventListeners=function(){document.removeEventListener("click",this.__handlerClick,!1),document.removeEventListener("touchend",this.__handlerClick,!1),document.removeEventListener("keydown",this.__handlerKeydown,!1)},e.getDrawer=function(t){return x.call(this,t)},e.setTabindex=function(){return i("\n [data-"+this.settings.dataDrawer+"]\n [data-"+this.settings.dataDialog+"]\n ")},e.stateSet=function(){this.state=function(t){if(!t.stateSave)return C(t);var e=localStorage.getItem(t.stateKey);if(!e||e&&0===Object.keys(JSON.parse(e)).length)return P(null,t);var n=JSON.parse(localStorage.getItem(t.stateKey));return Object.keys(n).forEach(function(e){var i=document.querySelector("[data-"+t.dataDrawer+'="'+e+'"]');i&&(n[e]==t.stateOpened?r(i,t.stateOpened):f(i,t.stateOpened))}),n}(this.settings)},e.stateSave=function(t){void 0===t&&(t=null),this.state=P(t,this.settings)},e.stateClear=function(){this.state=C(this.settings)},e.switchToDefault=function(t){return D.call(this,t)},e.switchToModal=function(t){return S.call(this,t)},e.toggle=function(t){return T.call(this,t)},e.open=function(t){return A.call(this,t)},e.close=function(t){return L.call(this,t)},t}(),M={autoInit:!1,dataModal:"modal",dataDialog:"modal-dialog",dataOpen:"modal-open",dataClose:"modal-close",dataFocus:"modal-focus",dataRequired:"modal-required",stateOpened:"is-opened",stateOpening:"is-opening",stateClosing:"is-closing",stateClosed:"is-closed",selectorInert:null,selectorOverflow:"body",customEventPrefix:"modal:",eventListeners:!0,moveModals:{ref:null,type:null},setTabindex:!0,transition:!0},q=function(t){void 0===t&&(t=!0);try{var i=this,r=document.querySelector("[data-"+i.settings.dataModal+"]."+i.settings.stateOpened);return r?(i.working=!0,e(!1,i.settings.selectorInert),n(!1,i.settings.selectorOverflow),Promise.resolve(p(r,i.settings)).then(function(){return t&&a(i),i.focusTrap.destroy(),r.dispatchEvent(new CustomEvent(i.settings.customEventPrefix+"closed",{detail:i,bubbles:!0})),i.working=!1,r})):Promise.resolve(r)}catch(t){return Promise.reject(t)}},I=function(t){try{var e,n=function(n){return e?n:t.target.closest("[data-"+i.settings.dataClose+"]")?(t.preventDefault(),void i.close()):void(t.target.hasAttribute("data-"+i.settings.dataModal)&&!t.target.hasAttribute("data-"+i.settings.dataRequired)&&i.close())},i=this;if(i.working)return Promise.resolve();var r=t.target.closest("[data-"+i.settings.dataOpen+"]"),o=function(){if(r){t.preventDefault();var n=r.getAttribute("data-"+i.settings.dataOpen),o=t.target.closest("[data-"+i.settings.dataModal+"]");return o||(i.memory.trigger=r),Promise.resolve(i.close(!o)).then(function(){i.open(n),e=1})}}();return Promise.resolve(o&&o.then?o.then(n):n(o))}catch(t){return Promise.reject(t)}};function F(t){if(!this.working&&"Escape"===t.key){var e=document.querySelector("[data-"+this.settings.dataModal+"]."+this.settings.stateOpened);e&&!e.hasAttribute("data-"+this.settings.dataRequired)&&this.close()}}function B(t){return"string"!=typeof t?t:document.querySelector("[data-"+this.settings.dataModal+'="'+t+'"]')}function V(t,e){void 0===t&&(t=this.settings.moveModals.type),void 0===e&&(e=this.settings.moveModals.ref);var n=document.querySelectorAll("[data-"+this.settings.dataModal+"]");n.length&&d(n,t,e)}function K(){var t=this;document.querySelectorAll("[data-"+this.settings.dataModal+"]").forEach(function(i){i.classList.contains(t.settings.stateOpened)&&(e(!1,t.settings.selectorInert),n(!1,t.settings.selectorOverflow),a(t),t.focusTrap.destroy()),f(i,t.settings.stateOpened,t.settings.stateOpening,t.settings.stateClosing),r(i,t.settings.stateClosed)})}var R=function(t){try{var i=this,r=B.call(i,t);return r?u(r,i.settings.stateClosed)?(i.working=!0,n(!0,i.settings.selectorOverflow),Promise.resolve(h(r,i.settings)).then(function(){return i.focusTrap.init(r),s(r,i.settings),e(!0,i.settings.selectorInert),r.dispatchEvent(new CustomEvent(i.settings.customEventPrefix+"opened",{detail:i,bubbles:!0})),i.working=!1,r})):Promise.resolve(r):Promise.resolve(Promise.reject(new Error('Did not find modal with key: "'+t+'"')))}catch(t){return Promise.reject(t)}},W=/*#__PURE__*/function(){function t(t){this.defaults=M,this.settings=v({},this.defaults,t),this.working=!1,this.memory={},this.focusTrap=new c,this.__handlerClick=I.bind(this),this.__handlerKeydown=F.bind(this),this.settings.autoInit&&this.init()}var e=t.prototype;return e.init=function(t){void 0===t&&(t=null),t&&(this.settings=v({},this.settings,t)),this.moveModals(),this.setInitialState(),this.settings.setTabindex&&this.setTabindex(),this.settings.eventListeners&&this.initEventListeners()},e.destroy=function(){this.memory={},this.settings.eventListeners&&this.destroyEventListeners()},e.initEventListeners=function(){document.addEventListener("click",this.__handlerClick,!1),document.addEventListener("touchend",this.__handlerClick,!1),document.addEventListener("keydown",this.__handlerKeydown,!1)},e.destroyEventListeners=function(){document.removeEventListener("click",this.__handlerClick,!1),document.removeEventListener("touchend",this.__handlerClick,!1),document.removeEventListener("keydown",this.__handlerKeydown,!1)},e.getModal=function(t){return B.call(this,t)},e.setTabindex=function(){return i("\n [data-"+this.settings.dataModal+"]\n [data-"+this.settings.dataDialog+"]\n ")},e.setInitialState=function(){return K.call(this)},e.moveModals=function(t,e){return V.call(this,t,e)},e.open=function(t){return R.call(this,t)},e.close=function(t){return q.call(this,t)},t}(),H=/*#__PURE__*/function(){function t(){this.collection=[]}var e=t.prototype;return e.register=function(t){return this.deregister(t),this.collection.push(t),this.collection},e.deregister=function(t){var e=this.collection.findIndex(function(e){return e===t});if(e>=0){var n=this.collection[e];Object.getOwnPropertyNames(n).forEach(function(t){delete n[t]}),this.collection.splice(e,1)}return this.collection},e.registerCollection=function(t){var e=this;return t.forEach(function(t){e.register(t)}),this.collection},e.deregisterCollection=function(){for(;this.collection.length>0;)this.deregister(this.collection[0]);return this.collection},e.get=function(t,e){return void 0===e&&(e="id"),this.collection.find(function(n){return n[e]===t})||null},t}(),N={autoInit:!1,selectorPopover:".popover",selectorArrow:".popover__arrow",stateActive:"is-active",eventListeners:!0,eventType:"click",placement:"bottom"};function Q(t){return t.target.classList.remove(this.settings.stateActive),t.trigger.setAttribute("aria-expanded","false"),t.popper.setOptions({modifiers:[{name:"eventListeners",enabled:!1}]}),t.state="closed",t.trigger===this.memory.trigger&&(this.memory.trigger=null),t}function z(){return this.collection.forEach(function(t){"opened"===t.state&&t.close()}),this.collection}function U(t){"opened"==t.state&&setTimeout(function(){var e=t.target.closest(":hover")===t.target||t.trigger.closest(":hover")===t.trigger,n=document.activeElement.closest("#"+t.id+', [aria-controls="'+t.id+'"]');return e||n||t.close(),t},1)}function J(t){t.target.classList.contains(this.settings.stateActive)?t.close():(this.memory.trigger=t.trigger,t.open(),Y.call(this,t))}function X(t){var e=this;switch(t.key){case"Escape":return this.memory.trigger&&this.memory.trigger.focus(),void z.call(this);case"Tab":return void this.collection.forEach(function(t){U.call(e,t)});default:return}}function Y(t){var e=this;document.addEventListener("click",function n(i){i.target.closest("#"+t.id+', [aria-controls="'+t.id+'"]')?t.target&&!t.target.classList.contains(e.settings.stateActive)&&this.removeEventListener("click",n):(t.target&&t.target.classList.contains(e.settings.stateActive)&&t.close(),this.removeEventListener("click",n))})}function Z(t,e){var n=getComputedStyle(t),i={placement:e.placement,event:e.eventType,offset:0,"overflow-padding":0,"flip-padding":0,"arrow-element":e.selectorArrow,"arrow-padding":0};for(var r in i){var o=getComputedStyle(document.body).getPropertyValue("--vrembem-variable-prefix"),s=n.getPropertyValue("--"+o+"popover-"+r).trim();s&&(i[r]=s)}return i}function G(t){var e,n="string"==typeof t?t.trim().split(" "):[t];switch(n.forEach(function(t,e){n[e]=parseInt(t,10)}),n.length){case 1:e=n[0];break;case 2:e={top:n[0],right:n[1],bottom:n[0],left:n[1]};break;case 3:e={top:n[0],right:n[1],bottom:n[2],left:n[1]};break;case 4:e={top:n[0],right:n[1],bottom:n[2],left:n[3]};break;default:e=!1}return e}function $(t){return"string"==typeof t?t:"function"==typeof t.hasAttribute?t.hasAttribute("aria-controls")?t.getAttribute("aria-controls"):!!t.closest(this.settings.selectorPopover)&&t.id:!!t.id&&t.id}function tt(t){var e=$.call(this,t);if(e){var n=document.querySelector('[aria-controls="'+e+'"]'),i=document.querySelector("#"+e);return n||i?n?i||console.error("No popover associated with the provided popover trigger:",n):console.error("No popover trigger associated with the provided popover:",i):console.error("No popover elements found using the provided ID:",e),!(!n||!i)&&{trigger:n,target:i}}return console.error("Could not resolve the popover ID:",t),!1}var et="top",nt="bottom",it="right",rt="left",ot="auto",st=[et,nt,it,rt],at="start",ct="end",lt="viewport",ut="popper",dt=/*#__PURE__*/st.reduce(function(t,e){return t.concat([e+"-"+at,e+"-"+ct])},[]),ft=/*#__PURE__*/[].concat(st,[ot]).reduce(function(t,e){return t.concat([e,e+"-"+at,e+"-"+ct])},[]),ht=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function pt(t){return t?(t.nodeName||"").toLowerCase():null}function gt(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function vt(t){return t instanceof gt(t).Element||t instanceof Element}function mt(t){return t instanceof gt(t).HTMLElement||t instanceof HTMLElement}function yt(t){return"undefined"!=typeof ShadowRoot&&(t instanceof gt(t).ShadowRoot||t instanceof ShadowRoot)}function bt(t){return t.split("-")[0]}var wt=Math.max,Et=Math.min,xt=Math.round;function Ot(t,e){void 0===e&&(e=!1);var n=t.getBoundingClientRect(),i=1,r=1;if(mt(t)&&e){var o=t.offsetHeight,s=t.offsetWidth;s>0&&(i=xt(n.width)/s||1),o>0&&(r=xt(n.height)/o||1)}return{width:n.width/i,height:n.height/r,top:n.top/r,right:n.right/i,bottom:n.bottom/r,left:n.left/i,x:n.left/i,y:n.top/r}}function Lt(t){var e=Ot(t),n=t.offsetWidth,i=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:i}}function kt(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&yt(n)){var i=e;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function _t(t){return gt(t).getComputedStyle(t)}function At(t){return["table","td","th"].indexOf(pt(t))>=0}function Pt(t){return((vt(t)?t.ownerDocument:t.document)||window.document).documentElement}function Ct(t){return"html"===pt(t)?t:t.assignedSlot||t.parentNode||(yt(t)?t.host:null)||Pt(t)}function Dt(t){return mt(t)&&"fixed"!==_t(t).position?t.offsetParent:null}function St(t){for(var e=gt(t),n=Dt(t);n&&At(n)&&"static"===_t(n).position;)n=Dt(n);return n&&("html"===pt(n)||"body"===pt(n)&&"static"===_t(n).position)?e:n||function(t){var e=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&mt(t)&&"fixed"===_t(t).position)return null;for(var n=Ct(t);mt(n)&&["html","body"].indexOf(pt(n))<0;){var i=_t(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||e&&"filter"===i.willChange||e&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(t)||e}function Tt(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function jt(t,e,n){return wt(t,Et(e,n))}function Mt(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function qt(t,e){return e.reduce(function(e,n){return e[n]=t,e},{})}function It(t){return t.split("-")[1]}var Ft={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Bt(t){var e,n=t.popper,i=t.popperRect,r=t.placement,o=t.variation,s=t.offsets,a=t.position,c=t.gpuAcceleration,l=t.adaptive,u=t.roundOffsets,d=t.isFixed,f=s.x,h=void 0===f?0:f,p=s.y,g=void 0===p?0:p,v="function"==typeof u?u({x:h,y:g}):{x:h,y:g};h=v.x,g=v.y;var m=s.hasOwnProperty("x"),y=s.hasOwnProperty("y"),b=rt,w=et,E=window;if(l){var x=St(n),O="clientHeight",L="clientWidth";x===gt(n)&&"static"!==_t(x=Pt(n)).position&&"absolute"===a&&(O="scrollHeight",L="scrollWidth"),x=x,(r===et||(r===rt||r===it)&&o===ct)&&(w=nt,g-=(d&&E.visualViewport?E.visualViewport.height:x[O])-i.height,g*=c?1:-1),r!==rt&&(r!==et&&r!==nt||o!==ct)||(b=it,h-=(d&&E.visualViewport?E.visualViewport.width:x[L])-i.width,h*=c?1:-1)}var k,_=Object.assign({position:a},l&&Ft),A=!0===u?function(t){var e=t.y,n=window.devicePixelRatio||1;return{x:xt(t.x*n)/n||0,y:xt(e*n)/n||0}}({x:h,y:g}):{x:h,y:g};return h=A.x,g=A.y,Object.assign({},_,c?((k={})[w]=y?"0":"",k[b]=m?"0":"",k.transform=(E.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",k):((e={})[w]=y?g+"px":"",e[b]=m?h+"px":"",e.transform="",e))}var Vt={passive:!0},Kt={left:"right",right:"left",bottom:"top",top:"bottom"};function Rt(t){return t.replace(/left|right|bottom|top/g,function(t){return Kt[t]})}var Wt={start:"end",end:"start"};function Ht(t){return t.replace(/start|end/g,function(t){return Wt[t]})}function Nt(t){var e=gt(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Qt(t){return Ot(Pt(t)).left+Nt(t).scrollLeft}function zt(t){var e=_t(t);return/auto|scroll|overlay|hidden/.test(e.overflow+e.overflowY+e.overflowX)}function Ut(t){return["html","body","#document"].indexOf(pt(t))>=0?t.ownerDocument.body:mt(t)&&zt(t)?t:Ut(Ct(t))}function Jt(t,e){var n;void 0===e&&(e=[]);var i=Ut(t),r=i===(null==(n=t.ownerDocument)?void 0:n.body),o=gt(i),s=r?[o].concat(o.visualViewport||[],zt(i)?i:[]):i,a=e.concat(s);return r?a:a.concat(Jt(Ct(s)))}function Xt(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Yt(t,e){return e===lt?Xt(function(t){var e=gt(t),n=Pt(t),i=e.visualViewport,r=n.clientWidth,o=n.clientHeight,s=0,a=0;return i&&(r=i.width,o=i.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=i.offsetLeft,a=i.offsetTop)),{width:r,height:o,x:s+Qt(t),y:a}}(t)):vt(e)?function(t){var e=Ot(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}(e):Xt(function(t){var e,n=Pt(t),i=Nt(t),r=null==(e=t.ownerDocument)?void 0:e.body,o=wt(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=wt(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-i.scrollLeft+Qt(t),c=-i.scrollTop;return"rtl"===_t(r||n).direction&&(a+=wt(n.clientWidth,r?r.clientWidth:0)-o),{width:o,height:s,x:a,y:c}}(Pt(t)))}function Zt(t){var e,n=t.reference,i=t.element,r=t.placement,o=r?bt(r):null,s=r?It(r):null,a=n.x+n.width/2-i.width/2,c=n.y+n.height/2-i.height/2;switch(o){case et:e={x:a,y:n.y-i.height};break;case nt:e={x:a,y:n.y+n.height};break;case it:e={x:n.x+n.width,y:c};break;case rt:e={x:n.x-i.width,y:c};break;default:e={x:n.x,y:n.y}}var l=o?Tt(o):null;if(null!=l){var u="y"===l?"height":"width";switch(s){case at:e[l]=e[l]-(n[u]/2-i[u]/2);break;case ct:e[l]=e[l]+(n[u]/2-i[u]/2)}}return e}function Gt(t,e){void 0===e&&(e={});var n=e.placement,i=void 0===n?t.placement:n,r=e.boundary,o=void 0===r?"clippingParents":r,s=e.rootBoundary,a=void 0===s?lt:s,c=e.elementContext,l=void 0===c?ut:c,u=e.altBoundary,d=void 0!==u&&u,f=e.padding,h=void 0===f?0:f,p=Mt("number"!=typeof h?h:qt(h,st)),g=t.rects.popper,v=t.elements[d?l===ut?"reference":ut:l],m=function(t,e,n){var i="clippingParents"===e?function(t){var e=Jt(Ct(t)),n=["absolute","fixed"].indexOf(_t(t).position)>=0&&mt(t)?St(t):t;return vt(n)?e.filter(function(t){return vt(t)&&kt(t,n)&&"body"!==pt(t)}):[]}(t):[].concat(e),r=[].concat(i,[n]),o=r.reduce(function(e,n){var i=Yt(t,n);return e.top=wt(i.top,e.top),e.right=Et(i.right,e.right),e.bottom=Et(i.bottom,e.bottom),e.left=wt(i.left,e.left),e},Yt(t,r[0]));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}(vt(v)?v:v.contextElement||Pt(t.elements.popper),o,a),y=Ot(t.elements.reference),b=Zt({reference:y,element:g,strategy:"absolute",placement:i}),w=Xt(Object.assign({},g,b)),E=l===ut?w:y,x={top:m.top-E.top+p.top,bottom:E.bottom-m.bottom+p.bottom,left:m.left-E.left+p.left,right:E.right-m.right+p.right},O=t.modifiersData.offset;if(l===ut&&O){var L=O[i];Object.keys(x).forEach(function(t){var e=[it,nt].indexOf(t)>=0?1:-1,n=[et,nt].indexOf(t)>=0?"y":"x";x[t]+=L[n]*e})}return x}function $t(t,e){void 0===e&&(e={});var n=e.boundary,i=e.rootBoundary,r=e.padding,o=e.flipVariations,s=e.allowedAutoPlacements,a=void 0===s?ft:s,c=It(e.placement),l=c?o?dt:dt.filter(function(t){return It(t)===c}):st,u=l.filter(function(t){return a.indexOf(t)>=0});0===u.length&&(u=l);var d=u.reduce(function(e,o){return e[o]=Gt(t,{placement:o,boundary:n,rootBoundary:i,padding:r})[bt(o)],e},{});return Object.keys(d).sort(function(t,e){return d[t]-d[e]})}function te(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function ee(t){return[et,it,nt,rt].some(function(e){return t[e]>=0})}function ne(t,e,n){void 0===n&&(n=!1);var i,r,o=mt(e),s=mt(e)&&function(t){var e=t.getBoundingClientRect(),n=xt(e.width)/t.offsetWidth||1,i=xt(e.height)/t.offsetHeight||1;return 1!==n||1!==i}(e),a=Pt(e),c=Ot(t,s),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(o||!o&&!n)&&(("body"!==pt(e)||zt(a))&&(l=(i=e)!==gt(i)&&mt(i)?{scrollLeft:(r=i).scrollLeft,scrollTop:r.scrollTop}:Nt(i)),mt(e)?((u=Ot(e,!0)).x+=e.clientLeft,u.y+=e.clientTop):a&&(u.x=Qt(a))),{x:c.left+l.scrollLeft-u.x,y:c.top+l.scrollTop-u.y,width:c.width,height:c.height}}function ie(t){var e=new Map,n=new Set,i=[];function r(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){if(!n.has(t)){var i=e.get(t);i&&r(i)}}),i.push(t)}return t.forEach(function(t){e.set(t.name,t)}),t.forEach(function(t){n.has(t.name)||r(t)}),i}var re={placement:"bottom",modifiers:[],strategy:"absolute"};function oe(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(t){return!(t&&"function"==typeof t.getBoundingClientRect)})}function se(t){void 0===t&&(t={});var e=t.defaultModifiers,n=void 0===e?[]:e,i=t.defaultOptions,r=void 0===i?re:i;return function(t,e,i){void 0===i&&(i=r);var o,s,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},re,r),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},c=[],l=!1,u={state:a,setOptions:function(i){var o="function"==typeof i?i(a.options):i;d(),a.options=Object.assign({},r,a.options,o),a.scrollParents={reference:vt(t)?Jt(t):t.contextElement?Jt(t.contextElement):[],popper:Jt(e)};var s,l,f=function(t){var e=ie(t);return ht.reduce(function(t,n){return t.concat(e.filter(function(t){return t.phase===n}))},[])}((s=[].concat(n,a.options.modifiers),l=s.reduce(function(t,e){var n=t[e.name];return t[e.name]=n?Object.assign({},n,e,{options:Object.assign({},n.options,e.options),data:Object.assign({},n.data,e.data)}):e,t},{}),Object.keys(l).map(function(t){return l[t]})));return a.orderedModifiers=f.filter(function(t){return t.enabled}),a.orderedModifiers.forEach(function(t){var e=t.options,n=t.effect;if("function"==typeof n){var i=n({state:a,name:t.name,instance:u,options:void 0===e?{}:e});c.push(i||function(){})}}),u.update()},forceUpdate:function(){if(!l){var t=a.elements,e=t.reference,n=t.popper;if(oe(e,n)){a.rects={reference:ne(e,St(n),"fixed"===a.options.strategy),popper:Lt(n)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach(function(t){return a.modifiersData[t.name]=Object.assign({},t.data)});for(var i=0;i<a.orderedModifiers.length;i++)if(!0!==a.reset){var r=a.orderedModifiers[i],o=r.fn,s=r.options;"function"==typeof o&&(a=o({state:a,options:void 0===s?{}:s,name:r.name,instance:u})||a)}else a.reset=!1,i=-1}}},update:(o=function(){return new Promise(function(t){u.forceUpdate(),t(a)})},function(){return s||(s=new Promise(function(t){Promise.resolve().then(function(){s=void 0,t(o())})})),s}),destroy:function(){d(),l=!0}};if(!oe(t,e))return u;function d(){c.forEach(function(t){return t()}),c=[]}return u.setOptions(i).then(function(t){!l&&i.onFirstUpdate&&i.onFirstUpdate(t)}),u}}var ae=/*#__PURE__*/se({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,i=t.options,r=i.scroll,o=void 0===r||r,s=i.resize,a=void 0===s||s,c=gt(e.elements.popper),l=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&l.forEach(function(t){t.addEventListener("scroll",n.update,Vt)}),a&&c.addEventListener("resize",n.update,Vt),function(){o&&l.forEach(function(t){t.removeEventListener("scroll",n.update,Vt)}),a&&c.removeEventListener("resize",n.update,Vt)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state;e.modifiersData[t.name]=Zt({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,i=n.gpuAcceleration,r=void 0===i||i,o=n.adaptive,s=void 0===o||o,a=n.roundOffsets,c=void 0===a||a,l={placement:bt(e.placement),variation:It(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,Bt(Object.assign({},l,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:c})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,Bt(Object.assign({},l,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach(function(t){var n=e.styles[t]||{},i=e.attributes[t]||{},r=e.elements[t];mt(r)&&pt(r)&&(Object.assign(r.style,n),Object.keys(i).forEach(function(t){var e=i[t];!1===e?r.removeAttribute(t):r.setAttribute(t,!0===e?"":e)}))})},effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(t){var i=e.elements[t],r=e.attributes[t]||{},o=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce(function(t,e){return t[e]="",t},{});mt(i)&&pt(i)&&(Object.assign(i.style,o),Object.keys(r).forEach(function(t){i.removeAttribute(t)}))})}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.name,i=t.options.offset,r=void 0===i?[0,0]:i,o=ft.reduce(function(t,n){return t[n]=function(t,e,n){var i=bt(t),r=[rt,et].indexOf(i)>=0?-1:1,o="function"==typeof n?n(Object.assign({},e,{placement:t})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*r,[rt,it].indexOf(i)>=0?{x:a,y:s}:{x:s,y:a}}(n,e.rects,r),t},{}),s=o[e.placement],a=s.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=s.x,e.modifiersData.popperOffsets.y+=a),e.modifiersData[n]=o}},{name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,i=t.name;if(!e.modifiersData[i]._skip){for(var r=n.mainAxis,o=void 0===r||r,s=n.altAxis,a=void 0===s||s,c=n.fallbackPlacements,l=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,h=n.flipVariations,p=void 0===h||h,g=n.allowedAutoPlacements,v=e.options.placement,m=bt(v),y=c||(m!==v&&p?function(t){if(bt(t)===ot)return[];var e=Rt(t);return[Ht(t),e,Ht(e)]}(v):[Rt(v)]),b=[v].concat(y).reduce(function(t,n){return t.concat(bt(n)===ot?$t(e,{placement:n,boundary:u,rootBoundary:d,padding:l,flipVariations:p,allowedAutoPlacements:g}):n)},[]),w=e.rects.reference,E=e.rects.popper,x=new Map,O=!0,L=b[0],k=0;k<b.length;k++){var _=b[k],A=bt(_),P=It(_)===at,C=[et,nt].indexOf(A)>=0,D=C?"width":"height",S=Gt(e,{placement:_,boundary:u,rootBoundary:d,altBoundary:f,padding:l}),T=C?P?it:rt:P?nt:et;w[D]>E[D]&&(T=Rt(T));var j=Rt(T),M=[];if(o&&M.push(S[A]<=0),a&&M.push(S[T]<=0,S[j]<=0),M.every(function(t){return t})){L=_,O=!1;break}x.set(_,M)}if(O)for(var q=function(t){var e=b.find(function(e){var n=x.get(e);if(n)return n.slice(0,t).every(function(t){return t})});if(e)return L=e,"break"},I=p?3:1;I>0&&"break"!==q(I);I--);e.placement!==L&&(e.modifiersData[i]._skip=!0,e.placement=L,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,i=t.name,r=n.mainAxis,o=void 0===r||r,s=n.altAxis,a=void 0!==s&&s,c=n.tether,l=void 0===c||c,u=n.tetherOffset,d=void 0===u?0:u,f=Gt(e,{boundary:n.boundary,rootBoundary:n.rootBoundary,padding:n.padding,altBoundary:n.altBoundary}),h=bt(e.placement),p=It(e.placement),g=!p,v=Tt(h),m="x"===v?"y":"x",y=e.modifiersData.popperOffsets,b=e.rects.reference,w=e.rects.popper,E="function"==typeof d?d(Object.assign({},e.rects,{placement:e.placement})):d,x="number"==typeof E?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),O=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,L={x:0,y:0};if(y){if(o){var k,_="y"===v?et:rt,A="y"===v?nt:it,P="y"===v?"height":"width",C=y[v],D=C+f[_],S=C-f[A],T=l?-w[P]/2:0,j=p===at?b[P]:w[P],M=p===at?-w[P]:-b[P],q=e.elements.arrow,I=l&&q?Lt(q):{width:0,height:0},F=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},B=F[_],V=F[A],K=jt(0,b[P],I[P]),R=g?b[P]/2-T-K-B-x.mainAxis:j-K-B-x.mainAxis,W=g?-b[P]/2+T+K+V+x.mainAxis:M+K+V+x.mainAxis,H=e.elements.arrow&&St(e.elements.arrow),N=null!=(k=null==O?void 0:O[v])?k:0,Q=C+W-N,z=jt(l?Et(D,C+R-N-(H?"y"===v?H.clientTop||0:H.clientLeft||0:0)):D,C,l?wt(S,Q):S);y[v]=z,L[v]=z-C}if(a){var U,J=y[m],X="y"===m?"height":"width",Y=J+f["x"===v?et:rt],Z=J-f["x"===v?nt:it],G=-1!==[et,rt].indexOf(h),$=null!=(U=null==O?void 0:O[m])?U:0,tt=G?Y:J-b[X]-w[X]-$+x.altAxis,ot=G?J+b[X]+w[X]-$-x.altAxis:Z,st=l&&G?function(t,e,n){var i=jt(t,e,n);return i>n?n:i}(tt,J,ot):jt(l?tt:Y,J,l?ot:Z);y[m]=st,L[m]=st-J}e.modifiersData[i]=L}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,i=t.name,r=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=bt(n.placement),c=Tt(a),l=[rt,it].indexOf(a)>=0?"height":"width";if(o&&s){var u=function(t,e){return Mt("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:qt(t,st))}(r.padding,n),d=Lt(o),f="y"===c?et:rt,h="y"===c?nt:it,p=n.rects.reference[l]+n.rects.reference[c]-s[c]-n.rects.popper[l],g=s[c]-n.rects.reference[c],v=St(o),m=v?"y"===c?v.clientHeight||0:v.clientWidth||0:0,y=m/2-d[l]/2+(p/2-g/2),b=jt(u[f],y,m-d[l]-u[h]);n.modifiersData[i]=((e={})[c]=b,e.centerOffset=b-y,e)}},effect:function(t){var e=t.state,n=t.options.element,i=void 0===n?"[data-popper-arrow]":n;null!=i&&("string"!=typeof i||(i=e.elements.popper.querySelector(i)))&&kt(e.elements.popper,i)&&(e.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,i=e.rects.reference,r=e.rects.popper,o=e.modifiersData.preventOverflow,s=Gt(e,{elementContext:"reference"}),a=Gt(e,{altBoundary:!0}),c=te(s,i),l=te(a,r,o),u=ee(c),d=ee(l);e.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}}]});function ce(t){var e;return t.target.classList.add(this.settings.stateActive),t.trigger.setAttribute("aria-expanded","true"),t.config=Z(t.target,this.settings),t.popper.setOptions({placement:t.config.placement,modifiers:[{name:"eventListeners",enabled:!0}].concat((e=t.config,[{name:"offset",options:{offset:[0,parseInt(e.offset,10)]}},{name:"preventOverflow",options:{padding:G(e["overflow-padding"])}},{name:"flip",options:{padding:G(e["flip-padding"])}},{name:"arrow",options:{element:e["arrow-element"],padding:G(e["arrow-padding"])}}]))}),t.popper.update(),t.state="opened",t}function le(t,e){this.deregister(e.id);var n=ae(t,e),i=this,r={open:function(){ce.call(i,this)},close:function(){Q.call(i,this)},deregister:function(){ue.call(i,this)}},o=v({id:e.id,state:"closed",trigger:t,target:e,popper:n,config:Z(e,this.settings)},r);return de.call(this,o),o.target.classList.contains(this.settings.stateActive)?(o.open(),Y.call(this,o)):o.close(),this.collection.push(o),o}function ue(t){var e=this.collection.findIndex(function(e){return e.id===t.id});if(e>=0){var n=this.collection[e];"opened"===n.state&&n.close(),n.popper.destroy(),fe(n),Object.getOwnPropertyNames(n).forEach(function(t){delete n[t]}),this.collection.splice(e,1)}return this.collection}function de(t){return t.__eventListeners||("hover"===t.config.event?(t.__eventListeners=[{el:["trigger"],type:["mouseenter","focus"],listener:ce.bind(this,t)},{el:["trigger","target"],type:["mouseleave","focusout"],listener:U.bind(this,t)}],t.__eventListeners.forEach(function(e){e.el.forEach(function(n){e.type.forEach(function(i){t[n].addEventListener(i,e.listener,!1)})})})):(t.__eventListeners=[{el:["trigger"],type:["click"],listener:J.bind(this,t)}],t.__eventListeners.forEach(function(e){e.el.forEach(function(n){e.type.forEach(function(i){t[n].addEventListener(i,e.listener,!1)})})}))),t}function fe(t){return t.__eventListeners&&(t.__eventListeners.forEach(function(e){e.el.forEach(function(n){e.type.forEach(function(i){t[n].removeEventListener(i,e.listener,!1)})})}),delete t.__eventListeners),t}var he=/*#__PURE__*/function(t){var e,n;function i(e){var n;return(n=t.call(this)||this).defaults=N,n.settings=v({},n.defaults,e),n.memory={trigger:null},n.__handlerKeydown=X.bind(function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(n)),n.settings.autoInit&&n.init(),n}n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,m(e,n);var r=i.prototype;return r.init=function(t){void 0===t&&(t=null),t&&(this.settings=v({},this.settings,t));var e=document.querySelectorAll(this.settings.selectorPopover);this.registerCollection(e),this.settings.eventListeners&&this.initEventListeners(!1)},r.destroy=function(){this.deregisterCollection(),this.settings.eventListeners&&this.destroyEventListeners(!1)},r.initEventListeners=function(t){var e=this;void 0===t&&(t=!0),t&&this.collection.forEach(function(t){de.call(e,t)}),document.addEventListener("keydown",this.__handlerKeydown,!1)},r.destroyEventListeners=function(t){void 0===t&&(t=!0),t&&this.collection.forEach(function(t){fe(t)}),document.removeEventListener("keydown",this.__handlerKeydown,!1)},r.register=function(t){var e=tt.call(this,t);return!!e&&le.call(this,e.trigger,e.target)},r.deregister=function(t){var e=this.get($(t));return!!e&&ue.call(this,e)},r.open=function(t){var e=this.get(t);return!!e&&e.open()},r.close=function(t){if(t){var e=this.get(t);return!!e&&e.close()}return z.call(this)},i}(H);t.Checkbox=b,t.Drawer=j,t.Modal=W,t.Popover=he,t.core=g});
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t||self).vrembem={})}(this,function(t){var e=function(t,e){e&&document.querySelectorAll(e).forEach(function(e){t?(e.inert=!0,e.setAttribute("aria-hidden",!0)):(e.inert=null,e.removeAttribute("aria-hidden"))})},n=function(t,e){e&&document.querySelectorAll(e).forEach(function(e){t?e.style.overflow="hidden":e.style.removeProperty("overflow")})},r=function(t){t&&document.querySelectorAll(t).forEach(function(t){t.setAttribute("tabindex","-1")})},i=function(t){var e=arguments;(t=t.forEach?t:[t]).forEach(function(t){var n;(n=t.classList).add.apply(n,[].slice.call(e,1))})};function o(t,e,n){if(!t.s){if(n instanceof s){if(!n.s)return void(n.o=o.bind(null,t,e));1&e&&(e=n.s),n=n.v}if(n&&n.then)return void n.then(o.bind(null,t,e),o.bind(null,t,2));t.s=e,t.v=n;var r=t.o;r&&r(t)}}var s=/*#__PURE__*/function(){function t(){}return t.prototype.then=function(e,n){var r=new t,i=this.s;if(i){var s=1&i?e:n;if(s){try{o(r,1,s(this.v))}catch(t){o(r,2,t)}return r}return this}return this.o=function(t){try{var i=t.v;1&t.s?o(r,1,e?e(i):i):n?o(r,1,n(i)):o(r,2,i)}catch(t){o(r,2,t)}},r},t}();function a(t){return t instanceof s&&1&t.s}var c=/*#__PURE__*/function(){function t(){this.collection=[]}var e=t.prototype;return e.register=function(t){try{var e=this;return Promise.resolve(e.deregister(t)).then(function(){return e.collection.push(t),e.collection})}catch(t){return Promise.reject(t)}},e.deregister=function(t){try{var e=this,n=e.collection.findIndex(function(e){return e===t});if(n>=0){var r=e.collection[n];Object.getOwnPropertyNames(r).forEach(function(t){delete r[t]}),e.collection.splice(n,1)}return Promise.resolve(e.collection)}catch(t){return Promise.reject(t)}},e.registerCollection=function(t){try{var e=this;return Promise.resolve(Promise.all(Array.from(t,function(t){e.register(t)}))).then(function(){return e.collection})}catch(t){return Promise.reject(t)}},e.deregisterCollection=function(){try{var t=function(){return e.collection},e=this,n=function(t,e,n){for(var r;;){var i=t();if(a(i)&&(i=i.v),!i)return c;if(i.then){r=0;break}var c=n();if(c&&c.then){if(!a(c)){r=1;break}c=c.s}}var l=new s,u=o.bind(null,l,2);return(0===r?i.then(f):1===r?c.then(d):(void 0).then(function(){(i=t())?i.then?i.then(f).then(void 0,u):f(i):o(l,1,c)})).then(void 0,u),l;function d(e){c=e;do{if(!(i=t())||a(i)&&!i.v)return void o(l,1,c);if(i.then)return void i.then(f).then(void 0,u);a(c=n())&&(c=c.v)}while(!c||!c.then);c.then(d).then(void 0,u)}function f(t){t?(c=n())&&c.then?c.then(d).then(void 0,u):d(c):o(l,1,c)}}(function(){return e.collection.length>0},0,function(){return Promise.resolve(e.deregister(e.collection[0])).then(function(){})});return Promise.resolve(n&&n.then?n.then(t):t())}catch(t){return Promise.reject(t)}},e.get=function(t,e){return void 0===e&&(e="id"),this.collection.find(function(n){return n[e]===t})},t}(),l=['a[href]:not([tabindex^="-"])','area[href]:not([tabindex^="-"])','input:not([type="hidden"]):not([type="radio"]):not([disabled]):not([tabindex^="-"])','input[type="radio"]:not([disabled]):not([tabindex^="-"])','select:not([disabled]):not([tabindex^="-"])','textarea:not([disabled]):not([tabindex^="-"])','button:not([disabled]):not([tabindex^="-"])','iframe:not([tabindex^="-"])','audio[controls]:not([tabindex^="-"])','video[controls]:not([tabindex^="-"])','[contenteditable]:not([tabindex^="-"])','[tabindex]:not([tabindex^="-"])'],u=function(t,e){var n=t.querySelector(e.selectorFocus);if(n)n.focus();else{var r=t.querySelector('[tabindex="-1"]');r&&r.focus()}},d=function(t){t&&t.memory&&t.memory.trigger&&(t.memory.trigger.focus(),t.memory.trigger=null)},f=/*#__PURE__*/function(){function t(){this.target=null,this.__handlerFocusTrap=this.handlerFocusTrap.bind(this)}var e=t.prototype;return e.init=function(t){this.destroy(),this.target=t,this.inner=this.target.querySelector('[tabindex="-1"]'),this.focusable=this.getFocusable(),this.focusable.length?(this.focusableFirst=this.focusable[0],this.focusableLast=this.focusable[this.focusable.length-1],this.target.addEventListener("keydown",this.__handlerFocusTrap)):this.target.addEventListener("keydown",this.handlerFocusLock)},e.destroy=function(){this.target&&(this.inner=null,this.focusable=null,this.focusableFirst=null,this.focusableLast=null,this.target.removeEventListener("keydown",this.__handlerFocusTrap),this.target.removeEventListener("keydown",this.handlerFocusLock),this.target=null)},e.refresh=function(){this.target&&(this.target.removeEventListener("keydown",this.__handlerFocusTrap),this.target.removeEventListener("keydown",this.handlerFocusLock),this.focusable=this.getFocusable(),this.focusable.length?(this.focusableFirst=this.focusable[0],this.focusableLast=this.focusable[this.focusable.length-1],this.target.addEventListener("keydown",this.__handlerFocusTrap)):(this.focusableFirst=null,this.focusableLast=null,this.target.addEventListener("keydown",this.handlerFocusLock)))},e.handlerFocusTrap=function(t){("Tab"===t.key||9===t.keyCode)&&(t.shiftKey?document.activeElement!==this.focusableFirst&&document.activeElement!==this.inner||(this.focusableLast.focus(),t.preventDefault()):document.activeElement!==this.focusableLast&&document.activeElement!==this.inner||(this.focusableFirst.focus(),t.preventDefault()))},e.handlerFocusLock=function(t){("Tab"===t.key||9===t.keyCode)&&t.preventDefault()},e.getFocusable=function(){var t=[],e=document.activeElement,n=this.inner?this.inner.scrollTop:0;return this.target.querySelectorAll(l.join(",")).forEach(function(e){e.focus(),e===document.activeElement&&t.push(e)}),this.inner&&(this.inner.scrollTop=n),e.focus(),t},t}(),h=function(t){return t=[].slice.call(t=t.forEach?t:[t]),[].slice.call(arguments,1).some(function(e){return t.some(function(t){if(t.classList.contains(e))return!0})})},p=function(t){var e=arguments;(t=t.forEach?t:[t]).forEach(function(t){var n;(n=t.classList).remove.apply(n,[].slice.call(e,1))})};function v(t,e,n){var r=e.nodeType===Node.COMMENT_NODE,i=e.nodeType===Node.ELEMENT_NODE;if(r&&(n="after"),!(e=r||i?e:document.querySelector(e)))throw new Error("Not a valid teleport reference: '"+e+"'");if("function"!=typeof e[n])throw new Error("Not a valid teleport method: '"+n+"'");var o=null;return r||(o=document.createComment("teleported #"+t.id),t.before(o)),e[n](t),r&&e.remove(),o}var g=function(t,e){return new Promise(function(n){e.transition?(t.classList.remove(e.stateClosed),t.classList.add(e.stateOpening),t.addEventListener("transitionend",function r(){t.classList.add(e.stateOpened),t.classList.remove(e.stateOpening),n(t),this.removeEventListener("transitionend",r)})):(t.classList.add(e.stateOpened),t.classList.remove(e.stateClosed),n(t))})},m=function(t,e){return new Promise(function(n){e.transition?(t.classList.add(e.stateClosing),t.classList.remove(e.stateOpened),t.addEventListener("transitionend",function r(){t.classList.remove(e.stateClosing),t.classList.add(e.stateClosed),n(t),this.removeEventListener("transitionend",r)})):(t.classList.add(e.stateClosed),t.classList.remove(e.stateOpened),n(t))})},y={__proto__:null,setInert:e,setOverflowHidden:n,setTabindex:r,addClass:i,camelCase:function(t){return t.replace(/-([a-z])/g,function(t){return t[1].toUpperCase()})},Collection:c,focusTarget:u,focusTrigger:d,FocusTrap:f,hasClass:h,hyphenCase:function(t){return t.replace(/([a-z][A-Z])/g,function(t){return t[0]+"-"+t[1].toLowerCase()})},removeClass:p,teleport:v,toggleClass:function(t){var e=arguments;(t=t.forEach?t:[t]).forEach(function(t){[].slice.call(e,1).forEach(function(e){t.classList.toggle(e)})})},openTransition:g,closeTransition:m};function b(){return(b=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function w(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,E(t,e)}function E(t,e){return(E=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function x(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var O={autoInit:!1,stateAttr:"aria-checked",stateValue:"mixed"},P=/*#__PURE__*/function(){function t(t){this.defaults=O,this.settings=b({},this.defaults,t),this.__handlerClick=this.handlerClick.bind(this),this.settings.autoInit&&this.init()}var e=t.prototype;return e.init=function(t){void 0===t&&(t=null),t&&(this.settings=b({},this.settings,t));var e=document.querySelectorAll("["+this.settings.stateAttr+'="'+this.settings.stateValue+'"]');this.setIndeterminate(e),document.addEventListener("click",this.__handlerClick,!1)},e.destroy=function(){document.removeEventListener("click",this.__handlerClick,!1)},e.handlerClick=function(t){var e=t.target.closest("["+this.settings.stateAttr+'="'+this.settings.stateValue+'"]');e&&(this.removeAriaState(e),this.setIndeterminate(e))},e.setAriaState=function(t,e){var n=this;void 0===e&&(e=this.settings.stateValue),(t=t.forEach?t:[t]).forEach(function(t){t.setAttribute(n.settings.stateAttr,e)})},e.removeAriaState=function(t){var e=this;(t=t.forEach?t:[t]).forEach(function(t){t.removeAttribute(e.settings.stateAttr)})},e.setIndeterminate=function(t){var e=this;(t=t.forEach?t:[t]).forEach(function(t){t.indeterminate=!!t.hasAttribute(e.settings.stateAttr)})},t}(),L={autoInit:!1,dataDrawer:"drawer",dataDialog:"drawer-dialog",dataToggle:"drawer-toggle",dataOpen:"drawer-open",dataClose:"drawer-close",dataBreakpoint:"drawer-breakpoint",selectorFocus:"[data-focus]",selectorInert:null,selectorOverflow:null,stateOpened:"is-opened",stateOpening:"is-opening",stateClosing:"is-closing",stateClosed:"is-closed",classModal:"drawer_modal",breakpoints:null,customEventPrefix:"drawer:",eventListeners:!0,stateSave:!0,stateKey:"DrawerState",setTabindex:!0,transition:!0},k=/*#__PURE__*/function(){function t(t){this.mediaQueryLists=[],this.parent=t,this.prefix=this.getVariablePrefix(),this.__check=this.check.bind(this)}var e=t.prototype;return e.init=function(){var t=this;document.querySelectorAll("[data-"+this.parent.settings.dataBreakpoint+"]").forEach(function(e){var n=e.getAttribute("data-"+t.parent.settings.dataDrawer),r=e.getAttribute("data-"+t.parent.settings.dataBreakpoint),i=t.getBreakpoint(r),o=window.matchMedia("(min-width:"+i+")");t.match(o,e),"function"==typeof o.addEventListener?o.addEventListener("change",t.__check):o.addListener(t.__check),t.mediaQueryLists.push({mql:o,drawer:n})})},e.destroy=function(){var t=this;this.mediaQueryLists&&this.mediaQueryLists.length&&this.mediaQueryLists.forEach(function(e){e.mql.removeListener(t.__check)}),this.mediaQueryLists=null},e.check=function(t){var e=this;void 0===t&&(t=null),this.mediaQueryLists&&this.mediaQueryLists.length&&(this.mediaQueryLists.forEach(function(n){if(!t||t.media==n.mql.media){var r=document.querySelector("[data-"+e.parent.settings.dataDrawer+'="'+n.drawer+'"]');r&&e.match(n.mql,r)}}),document.dispatchEvent(new CustomEvent(this.parent.settings.customEventPrefix+"breakpoint",{bubbles:!0})))},e.match=function(t,e){t.matches?this.parent.switchToDefault(e):this.parent.switchToModal(e)},e.getBreakpoint=function(t){var e=t;return this.parent.settings.breakpoints&&this.parent.settings.breakpoints[t]?e=this.parent.settings.breakpoints[t]:getComputedStyle(document.body).getPropertyValue(this.prefix+t)&&(e=getComputedStyle(document.body).getPropertyValue(this.prefix+t)),e},e.getVariablePrefix=function(){var t="--";return(t+=getComputedStyle(document.body).getPropertyValue("--vrembem-variable-prefix"))+"breakpoint-"},t}();function _(t){return"string"!=typeof t?t:document.querySelector("[data-"+this.settings.dataDrawer+'="'+t+'"]')}function A(t){return Promise.reject(new Error('Did not find drawer with key: "'+t+'"'))}var C=function(t){try{var r=this,i=r.getDrawer(t);return i?h(i,r.settings.stateOpened)?(r.working=!0,h(i,r.settings.classModal)&&(e(!1,r.settings.selectorInert),n(!1,r.settings.selectorOverflow)),Promise.resolve(m(i,r.settings)).then(function(){return r.stateSave(i),d(r),r.focusTrap.destroy(),i.dispatchEvent(new CustomEvent(r.settings.customEventPrefix+"closed",{detail:r,bubbles:!0})),r.working=!1,i})):Promise.resolve(i):Promise.resolve(A(t))}catch(t){return Promise.reject(t)}};function j(t){if(!this.working){var e=t.target.closest("[data-"+this.settings.dataToggle+"]");if(e){var n=e.getAttribute("data-"+this.settings.dataToggle);return this.memory.trigger=e,this.toggle(n),void t.preventDefault()}if(e=t.target.closest("[data-"+this.settings.dataOpen+"]")){var r=e.getAttribute("data-"+this.settings.dataOpen);return this.memory.trigger=e,this.open(r),void t.preventDefault()}if(e=t.target.closest("[data-"+this.settings.dataClose+"]")){var i=e.getAttribute("data-"+this.settings.dataClose);if(i)this.memory.trigger=e,this.close(i);else{var o=t.target.closest("[data-"+this.settings.dataDrawer+"]");o&&this.close(o)}t.preventDefault()}else t.target.hasAttribute("data-"+this.settings.dataDrawer)&&this.close(t.target)}}function S(t){if(!this.working&&"Escape"===t.key){var e=document.querySelector("."+this.settings.classModal+"."+this.settings.stateOpened);e&&this.close(e)}}var D=function(t){try{var r=this,i=r.getDrawer(t);if(!i)return Promise.resolve(A(t));if(h(i,r.settings.stateOpened))return u(i,r.settings),Promise.resolve(i);r.working=!0;var o=h(i,r.settings.classModal);return o&&n(!0,r.settings.selectorOverflow),Promise.resolve(g(i,r.settings)).then(function(){return r.stateSave(i),o&&(r.focusTrap.init(i),e(!0,r.settings.selectorInert)),u(i,r.settings),i.dispatchEvent(new CustomEvent(r.settings.customEventPrefix+"opened",{detail:r,bubbles:!0})),r.working=!1,i})}catch(t){return Promise.reject(t)}};function T(t,e){if(!e.stateSave)return I(e);var n=localStorage.getItem(e.stateKey)?JSON.parse(localStorage.getItem(e.stateKey)):{};return(t?[t]:document.querySelectorAll("[data-"+e.dataDrawer+"]")).forEach(function(t){if(!h(t,e.classModal)){var r=t.getAttribute("data-"+e.dataDrawer);n[r]=h(t,e.stateOpened)?e.stateOpened:e.stateClosed}}),localStorage.setItem(e.stateKey,JSON.stringify(n)),n}function I(t){return localStorage.getItem(t.stateKey)&&localStorage.removeItem(t.stateKey),{}}var M=function(t){try{var r=this,o=r.getDrawer(t);return o?h(o,r.settings.classModal)?(e(!1,r.settings.selectorInert),n(!1,r.settings.selectorOverflow),p(o,r.settings.classModal),r.focusTrap.destroy(),t=o.getAttribute("data-"+r.settings.dataDrawer),r.state[t]==r.settings.stateOpened&&(i(o,r.settings.stateOpened),p(o,r.settings.stateClosed)),o.dispatchEvent(new CustomEvent(r.settings.customEventPrefix+"toDefault",{bubbles:!0})),Promise.resolve(o)):Promise.resolve():Promise.resolve(A(t))}catch(t){return Promise.reject(t)}},q=function(t){try{var e=this,n=e.getDrawer(t);return n?h(n,e.settings.classModal)?Promise.resolve():(i(n,e.settings.classModal),i(n,e.settings.stateClosed),p(n,e.settings.stateOpened),n.dispatchEvent(new CustomEvent(e.settings.customEventPrefix+"toModal",{bubbles:!0})),Promise.resolve(n)):Promise.resolve(A(t))}catch(t){return Promise.reject(t)}},R=function(t){try{var e=this,n=e.getDrawer(t);if(!n)return Promise.resolve(A(t));var r=!h(n,e.settings.stateOpened);return Promise.resolve(r?e.open(n):e.close(n))}catch(t){return Promise.reject(t)}},F=/*#__PURE__*/function(){function t(t){this.defaults=L,this.settings=b({},this.defaults,t),this.working=!1,this.memory={},this.state={},this.focusTrap=new f,this.breakpoint=new k(this),this.__handlerClick=j.bind(this),this.__handlerKeydown=S.bind(this),this.settings.autoInit&&this.init()}var e=t.prototype;return e.init=function(t){void 0===t&&(t=null),t&&(this.settings=b({},this.settings,t)),this.stateSet(),this.settings.setTabindex&&this.setTabindex(),this.breakpoint.init(),this.settings.eventListeners&&this.initEventListeners()},e.destroy=function(){this.breakpoint.destroy(),this.memory={},this.state={},localStorage.removeItem(this.settings.stateKey),this.settings.eventListeners&&this.destroyEventListeners()},e.initEventListeners=function(){document.addEventListener("click",this.__handlerClick,!1),document.addEventListener("touchend",this.__handlerClick,!1),document.addEventListener("keydown",this.__handlerKeydown,!1)},e.destroyEventListeners=function(){document.removeEventListener("click",this.__handlerClick,!1),document.removeEventListener("touchend",this.__handlerClick,!1),document.removeEventListener("keydown",this.__handlerKeydown,!1)},e.getDrawer=function(t){return _.call(this,t)},e.setTabindex=function(){return r("\n [data-"+this.settings.dataDrawer+"]\n [data-"+this.settings.dataDialog+"]\n ")},e.stateSet=function(){this.state=function(t){if(!t.stateSave)return I(t);var e=localStorage.getItem(t.stateKey);if(!e||e&&0===Object.keys(JSON.parse(e)).length)return T(null,t);var n=JSON.parse(localStorage.getItem(t.stateKey));return Object.keys(n).forEach(function(e){var r=document.querySelector("[data-"+t.dataDrawer+'="'+e+'"]');r&&(n[e]==t.stateOpened?i(r,t.stateOpened):p(r,t.stateOpened))}),n}(this.settings)},e.stateSave=function(t){void 0===t&&(t=null),this.state=T(t,this.settings)},e.stateClear=function(){this.state=I(this.settings)},e.switchToDefault=function(t){return M.call(this,t)},e.switchToModal=function(t){return q.call(this,t)},e.toggle=function(t){return R.call(this,t)},e.open=function(t){return D.call(this,t)},e.close=function(t){return C.call(this,t)},t}(),N={autoInit:!1,dataOpen:"modal-open",dataClose:"modal-close",dataReplace:"modal-replace",dataConfig:"modal-config",selectorModal:".modal",selectorDialog:".modal__dialog",selectorRequired:'[role="alertdialog"]',selectorFocus:"[data-focus]",selectorInert:null,selectorOverflow:"body",stateOpened:"is-opened",stateOpening:"is-opening",stateClosing:"is-closing",stateClosed:"is-closed",customEventPrefix:"modal:",eventListeners:!0,teleport:null,teleportMethod:"append",setTabindex:!0,transition:!0};function B(){e(!!this.active,this.settings.selectorInert),n(!!this.active,this.settings.selectorOverflow),this.stack.forEach(function(t,e){t.target.style.zIndex=null;var n=getComputedStyle(t.target)["z-index"];t.target.style.zIndex=parseInt(n)+e+1})}function V(){this.active?(u(this.active.target,this.settings),this.focusTrap.init(this.active.target)):(d(this),this.focusTrap.destroy())}function K(t){var e=(t.getAttribute("data-"+this.settings.dataConfig)||"").replace(/'/g,'"');return e?JSON.parse(e):{}}function W(t){var e=this.get("string"==typeof t?t:t.id);if(e)return e;throw new Error('Modal not found in collection with id of "'+t+'".')}function H(t){return"string"==typeof t?t:"function"==typeof t.hasAttribute?t.hasAttribute("data-"+this.settings.dataOpen)?t.getAttribute("data-"+this.settings.dataOpen):t.hasAttribute("data-"+this.settings.dataClose)?t.getAttribute("data-"+this.settings.dataClose)||!1:t.hasAttribute("data-"+this.settings.dataReplace)?t.getAttribute("data-"+this.settings.dataReplace):t.closest(this.settings.selectorModal)&&(t=t.closest(this.settings.selectorModal)).id||!1:!!t.id&&t.id}function z(t){var e=H.call(this,t);if(e){var n=document.querySelector("#"+e),r=n?n.querySelector(this.settings.selectorDialog):null;return n||r?r?{target:n,dialog:r}:{error:new Error("Modal is missing dialog element.")}:{error:new Error('No modal elements found using the ID: "'+e+'".')}}return{error:new Error("Could not resolve the modal ID.")}}var Q=function(t){try{var e=this,n=t.target.closest("[data-"+e.settings.dataOpen+"], [data-"+e.settings.dataReplace+"]");if(n){t.preventDefault(),t.target.closest(e.settings.selectorModal)||(e.memory.trigger=n);var r=e.get(H.call(e,n));return Promise.resolve(n.matches("[data-"+e.settings.dataOpen+"]")?r.open():r.replace())}if(n=t.target.closest("[data-"+e.settings.dataClose+"]")){t.preventDefault();var i=n.getAttribute("data-"+e.settings.dataClose);return Promise.resolve("*"===i?e.closeAll():e.close(i))}return t.target.matches(e.settings.selectorModal)&&!t.target.querySelector(e.settings.selectorRequired)?Promise.resolve(e.close(H.call(e,t.target))):Promise.resolve()}catch(t){return Promise.reject(t)}};function J(t){if("Escape"===t.key&&this.active&&!this.active.dialog.matches(this.settings.selectorRequired))return this.close()}var U=function(t,e){void 0===e&&(e=!0);try{var n=function(){return r.collection},r=this;if(!t)return Promise.resolve(r.collection);var i=r.collection.findIndex(function(e){return e.id===t.id}),o=function(){if(i>=0){var t=function(){n.getSetting("teleport")&&n.teleportReturn(),Object.getOwnPropertyNames(n).forEach(function(t){delete n[t]}),r.collection.splice(i,1)},n=r.collection[i],o=function(){if(e&&"opened"===n.state)return Promise.resolve(n.close(!1)).then(function(){});var t=r.stack.findIndex(function(t){return t.id===n.id});t>=0&&r.stack.splice(t,1)}();return o&&o.then?o.then(t):t()}}();return Promise.resolve(o&&o.then?o.then(n):n())}catch(t){return Promise.reject(t)}},X=function(t,e,n){void 0===n&&(n=!1);try{var r=function(){return n||V.call(i),o.target.dispatchEvent(new CustomEvent(s.customEventPrefix+"opened",{detail:i,bubbles:!0})),o},i=this,o=W.call(i,t),s=b({},i.settings,o.settings);void 0!==e&&(s.transition=e);var a=i.stack.findIndex(function(t){return t.id===o.id});a>=0&&(i.stack.splice(a,1),i.stack.push(o));var c=function(){if("closed"===o.state){o.state="opening",o.target.style.zIndex=null;var t=getComputedStyle(o.target)["z-index"];return o.target.style.zIndex=parseInt(t)+i.stack.length+1,i.stack.push(o),Promise.resolve(g(o.target,s)).then(function(){o.state="opened"})}}();return Promise.resolve(c&&c.then?c.then(r):r())}catch(t){return Promise.reject(t)}},Y=function(t,e,n){void 0===n&&(n=!1);try{var r=this,i=t?W.call(r,t):r.active,o=function(){if(i&&"opened"===i.state){i.state="closing";var t=b({},r.settings,i.settings);return void 0!==e&&(t.transition=e),document.activeElement.blur(),Promise.resolve(m(i.target,t)).then(function(){i.target.style.zIndex=null;var e=r.stack.findIndex(function(t){return t.id===i.id});r.stack.splice(e,1),n||V.call(r),i.state="closed",i.target.dispatchEvent(new CustomEvent(t.customEventPrefix+"closed",{detail:r,bubbles:!0}))})}}();return Promise.resolve(o&&o.then?o.then(function(){return i}):i)}catch(t){return Promise.reject(t)}},Z=function(t,e){try{var n=this,r=[];return Promise.resolve(Promise.all(n.stack.map(function(i){try{var o=function(){i.trigger=null},s=function(){if(!t||t!==i.id){var o=r.push;return Promise.resolve(Y.call(n,i,e,!0)).then(function(t){o.call(r,t)})}Promise.resolve()}();return Promise.resolve(s&&s.then?s.then(o):o())}catch(t){return Promise.reject(t)}}))).then(function(){return r})}catch(t){return Promise.reject(t)}},G=function(t,e){try{var n,r,i=function(){return V.call(o),{opened:n,closed:r}},o=this,s=W.call(o,t),a="opened"===s.state?(n=s,Promise.resolve(Z.call(o,s.id,e)).then(function(t){r=t})):(n=X.call(o,s,e,!0),r=Z.call(o,!1,e),Promise.resolve(Promise.all([n,r])).then(function(){}));return Promise.resolve(a&&a.then?a.then(i):i())}catch(t){return Promise.reject(t)}},$=function(t,e){try{var n=this;return Promise.resolve(U.call(n,t,!1)).then(function(){var r=n,i={open:function(t){return X.call(r,this,t)},close:function(t){return Y.call(r,this,t)},replace:function(t){return G.call(r,this,t)},deregister:function(){return U.call(r,this)},teleport:function(t,e){return void 0===t&&(t=this.getSetting("teleport")),void 0===e&&(e=this.getSetting("teleportMethod")),this.returnRef?(console.error("Element has already been teleported:",this.target),!1):(this.returnRef=v(this.target,t,e),this.target)},teleportReturn:function(){return this.returnRef?(this.returnRef=v(this.target,this.returnRef),this.target):(console.error("No return reference found:",this.target),!1)},getSetting:function(t){return t in this.settings?this.settings[t]:r.settings[t]}},o=b({id:t.id,state:"closed",settings:K.call(n,t),target:t,dialog:e,returnRef:null},i);return o.dialog.setAttribute("aria-modal","true"),o.dialog.hasAttribute("role")||o.dialog.setAttribute("role","dialog"),o.getSetting("setTabindex")&&o.dialog.setAttribute("tabindex","-1"),o.getSetting("teleport")&&o.teleport(),n.collection.push(o),o.target.classList.contains(n.settings.stateOpened)?o.open(!1):(o.target.classList.remove(n.settings.stateOpening),o.target.classList.remove(n.settings.stateClosing),o.target.classList.add(n.settings.stateClosed)),o})}catch(t){return Promise.reject(t)}},tt=/*#__PURE__*/function(t){function e(e){var n;return(n=t.call(this)||this).defaults=N,n.settings=b({},n.defaults,e),n.memory={},n.focusTrap=new f,n.stack=new Proxy([],{set:function(t,e,r){return t[e]=r,"length"===e&&B.call(x(n)),!0}}),n.__handleClick=Q.bind(x(n)),n.__handleKeydown=J.bind(x(n)),n.settings.autoInit&&n.init(),n}w(e,t);var n,r,i=e.prototype;return i.init=function(t){try{var e=this;t&&(e.settings=b({},e.settings,t));var n=document.querySelectorAll(e.settings.selectorModal);return Promise.resolve(e.registerCollection(n)).then(function(){e.settings.eventListeners&&e.initEventListeners()})}catch(t){return Promise.reject(t)}},i.destroy=function(){try{var t=this;return t.memory={},Promise.resolve(t.deregisterCollection()).then(function(){t.settings.eventListeners&&t.destroyEventListeners()})}catch(t){return Promise.reject(t)}},i.initEventListeners=function(){document.addEventListener("click",this.__handleClick,!1),document.addEventListener("touchend",this.__handleClick,!1),document.addEventListener("keydown",this.__handleKeydown,!1)},i.destroyEventListeners=function(){document.removeEventListener("click",this.__handleClick,!1),document.removeEventListener("touchend",this.__handleClick,!1),document.removeEventListener("keydown",this.__handleKeydown,!1)},i.register=function(t){var e=z.call(this,t);return e.error?Promise.reject(e.error):$.call(this,e.target,e.dialog)},i.deregister=function(t){var e=this.get(H.call(this,t));return U.call(this,e)},i.open=function(t,e){return X.call(this,t,e)},i.close=function(t,e){return Y.call(this,t,e)},i.replace=function(t,e){return G.call(this,t,e)},i.closeAll=function(t,e){void 0===t&&(t=!1);try{var n=this;return Promise.resolve(Z.call(n,t,e)).then(function(t){return V.call(n),t})}catch(t){return Promise.reject(t)}},n=e,(r=[{key:"active",get:function(){return this.stack[this.stack.length-1]}}])&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e}(c),et={autoInit:!1,selectorPopover:".popover",selectorArrow:".popover__arrow",stateActive:"is-active",eventListeners:!0,eventType:"click",placement:"bottom"};function nt(t,e){var n=getComputedStyle(t),r={placement:e.placement,event:e.eventType,offset:0,"overflow-padding":0,"flip-padding":0,"arrow-element":e.selectorArrow,"arrow-padding":0};for(var i in r){var o=getComputedStyle(document.body).getPropertyValue("--vrembem-variable-prefix"),s=n.getPropertyValue("--"+o+"popover-"+i).trim();s&&(r[i]=s)}return r}function rt(t){var e,n="string"==typeof t?t.trim().split(" "):[t];switch(n.forEach(function(t,e){n[e]=parseInt(t,10)}),n.length){case 1:e=n[0];break;case 2:e={top:n[0],right:n[1],bottom:n[0],left:n[1]};break;case 3:e={top:n[0],right:n[1],bottom:n[2],left:n[1]};break;case 4:e={top:n[0],right:n[1],bottom:n[2],left:n[3]};break;default:e=!1}return e}function it(t){var e=this.get("string"==typeof t?t:t.id);if(e)return e;throw new Error('Popover not found in collection with id of "'+t+'".')}function ot(t){return"string"==typeof t?t:"function"==typeof t.hasAttribute?t.closest(this.settings.selectorPopover)?(t=t.closest(this.settings.selectorPopover)).id:t.hasAttribute("aria-controls")?t.getAttribute("aria-controls"):!!t.hasAttribute("aria-describedby")&&t.getAttribute("aria-describedby"):!!t.id&&t.id}function st(t){var e=ot.call(this,t);if(e){var n=document.querySelector('[aria-controls="'+e+'"]')||document.querySelector('[aria-describedby="'+e+'"]'),r=document.querySelector("#"+e);return n||r?n?r?{trigger:n,target:r}:{error:new Error("No popover associated with the provided popover trigger.")}:{error:new Error("No popover trigger associated with the provided popover.")}:{error:new Error('No popover elements found using the ID: "'+e+'".')}}return{error:new Error("Could not resolve the popover ID.")}}var at=function(){try{var t=this,e=[];return Promise.resolve(Promise.all(t.collection.map(function(n){try{var r=function(){if("opened"===n.state){var r=e.push;return Promise.resolve(ct.call(t,n)).then(function(t){r.call(e,t)})}}();return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(t){return Promise.reject(t)}}))).then(function(){return e})}catch(t){return Promise.reject(t)}},ct=function(t){try{var e=function(t){return t&&"opened"===t.state&&(t.target.classList.remove(n.settings.stateActive),t.trigger.hasAttribute("aria-controls")&&t.trigger.setAttribute("aria-expanded","false"),t.popper.setOptions({modifiers:[{name:"eventListeners",enabled:!1}]}),t.state="closed",t.trigger===n.memory.trigger&&(n.memory.trigger=null)),t},n=this;return Promise.resolve(t?e(it.call(n,t)):Promise.resolve(at.call(n)).then(e))}catch(t){return Promise.reject(t)}};function lt(t){"opened"==t.state&&setTimeout(function(){var e=t.target.closest(":hover")===t.target||t.trigger.closest(":hover")===t.trigger,n=document.activeElement.closest("#"+t.id+', [aria-controls="'+t.id+'"]');return e||n||t.close(),t},1)}function ut(t){"opened"===t.state?t.close():(this.memory.trigger=t.trigger,t.open(),ft.call(this,t))}function dt(t){var e=this;switch(t.key){case"Escape":return this.memory.trigger&&this.memory.trigger.focus(),void at.call(this);case"Tab":return void this.collection.forEach(function(t){lt.call(e,t)});default:return}}function ft(t){var e=this;document.addEventListener("click",function n(r){r.target.closest("#"+t.id+', [aria-controls="'+t.id+'"]')?t.target&&!t.target.classList.contains(e.settings.stateActive)&&this.removeEventListener("click",n):(t.target&&t.target.classList.contains(e.settings.stateActive)&&t.close(),this.removeEventListener("click",n))})}var ht="top",pt="bottom",vt="right",gt="left",mt="auto",yt=[ht,pt,vt,gt],bt="start",wt="end",Et="viewport",xt="popper",Ot=/*#__PURE__*/yt.reduce(function(t,e){return t.concat([e+"-"+bt,e+"-"+wt])},[]),Pt=/*#__PURE__*/[].concat(yt,[mt]).reduce(function(t,e){return t.concat([e,e+"-"+bt,e+"-"+wt])},[]),Lt=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function kt(t){return t?(t.nodeName||"").toLowerCase():null}function _t(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function At(t){return t instanceof _t(t).Element||t instanceof Element}function Ct(t){return t instanceof _t(t).HTMLElement||t instanceof HTMLElement}function jt(t){return"undefined"!=typeof ShadowRoot&&(t instanceof _t(t).ShadowRoot||t instanceof ShadowRoot)}function St(t){return t.split("-")[0]}var Dt=Math.max,Tt=Math.min,It=Math.round;function Mt(t,e){void 0===e&&(e=!1);var n=t.getBoundingClientRect(),r=1,i=1;if(Ct(t)&&e){var o=t.offsetHeight,s=t.offsetWidth;s>0&&(r=It(n.width)/s||1),o>0&&(i=It(n.height)/o||1)}return{width:n.width/r,height:n.height/i,top:n.top/i,right:n.right/r,bottom:n.bottom/i,left:n.left/r,x:n.left/r,y:n.top/i}}function qt(t){var e=Mt(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function Rt(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&jt(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Ft(t){return _t(t).getComputedStyle(t)}function Nt(t){return["table","td","th"].indexOf(kt(t))>=0}function Bt(t){return((At(t)?t.ownerDocument:t.document)||window.document).documentElement}function Vt(t){return"html"===kt(t)?t:t.assignedSlot||t.parentNode||(jt(t)?t.host:null)||Bt(t)}function Kt(t){return Ct(t)&&"fixed"!==Ft(t).position?t.offsetParent:null}function Wt(t){for(var e=_t(t),n=Kt(t);n&&Nt(n)&&"static"===Ft(n).position;)n=Kt(n);return n&&("html"===kt(n)||"body"===kt(n)&&"static"===Ft(n).position)?e:n||function(t){var e=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&Ct(t)&&"fixed"===Ft(t).position)return null;var n=Vt(t);for(jt(n)&&(n=n.host);Ct(n)&&["html","body"].indexOf(kt(n))<0;){var r=Ft(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||e&&"filter"===r.willChange||e&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(t)||e}function Ht(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function zt(t,e,n){return Dt(t,Tt(e,n))}function Qt(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function Jt(t,e){return e.reduce(function(e,n){return e[n]=t,e},{})}function Ut(t){return t.split("-")[1]}var Xt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Yt(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,a=t.position,c=t.gpuAcceleration,l=t.adaptive,u=t.roundOffsets,d=t.isFixed,f=s.x,h=void 0===f?0:f,p=s.y,v=void 0===p?0:p,g="function"==typeof u?u({x:h,y:v}):{x:h,y:v};h=g.x,v=g.y;var m=s.hasOwnProperty("x"),y=s.hasOwnProperty("y"),b=gt,w=ht,E=window;if(l){var x=Wt(n),O="clientHeight",P="clientWidth";x===_t(n)&&"static"!==Ft(x=Bt(n)).position&&"absolute"===a&&(O="scrollHeight",P="scrollWidth"),x=x,(i===ht||(i===gt||i===vt)&&o===wt)&&(w=pt,v-=(d&&x===E&&E.visualViewport?E.visualViewport.height:x[O])-r.height,v*=c?1:-1),i!==gt&&(i!==ht&&i!==pt||o!==wt)||(b=vt,h-=(d&&x===E&&E.visualViewport?E.visualViewport.width:x[P])-r.width,h*=c?1:-1)}var L,k=Object.assign({position:a},l&&Xt),_=!0===u?function(t){var e=t.y,n=window.devicePixelRatio||1;return{x:It(t.x*n)/n||0,y:It(e*n)/n||0}}({x:h,y:v}):{x:h,y:v};return h=_.x,v=_.y,Object.assign({},k,c?((L={})[w]=y?"0":"",L[b]=m?"0":"",L.transform=(E.devicePixelRatio||1)<=1?"translate("+h+"px, "+v+"px)":"translate3d("+h+"px, "+v+"px, 0)",L):((e={})[w]=y?v+"px":"",e[b]=m?h+"px":"",e.transform="",e))}var Zt={passive:!0},Gt={left:"right",right:"left",bottom:"top",top:"bottom"};function $t(t){return t.replace(/left|right|bottom|top/g,function(t){return Gt[t]})}var te={start:"end",end:"start"};function ee(t){return t.replace(/start|end/g,function(t){return te[t]})}function ne(t){var e=_t(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function re(t){return Mt(Bt(t)).left+ne(t).scrollLeft}function ie(t){var e=Ft(t);return/auto|scroll|overlay|hidden/.test(e.overflow+e.overflowY+e.overflowX)}function oe(t){return["html","body","#document"].indexOf(kt(t))>=0?t.ownerDocument.body:Ct(t)&&ie(t)?t:oe(Vt(t))}function se(t,e){var n;void 0===e&&(e=[]);var r=oe(t),i=r===(null==(n=t.ownerDocument)?void 0:n.body),o=_t(r),s=i?[o].concat(o.visualViewport||[],ie(r)?r:[]):r,a=e.concat(s);return i?a:a.concat(se(Vt(s)))}function ae(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function ce(t,e){return e===Et?ae(function(t){var e=_t(t),n=Bt(t),r=e.visualViewport,i=n.clientWidth,o=n.clientHeight,s=0,a=0;return r&&(i=r.width,o=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=r.offsetLeft,a=r.offsetTop)),{width:i,height:o,x:s+re(t),y:a}}(t)):At(e)?function(t){var e=Mt(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}(e):ae(function(t){var e,n=Bt(t),r=ne(t),i=null==(e=t.ownerDocument)?void 0:e.body,o=Dt(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Dt(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+re(t),c=-r.scrollTop;return"rtl"===Ft(i||n).direction&&(a+=Dt(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:c}}(Bt(t)))}function le(t){var e,n=t.reference,r=t.element,i=t.placement,o=i?St(i):null,s=i?Ut(i):null,a=n.x+n.width/2-r.width/2,c=n.y+n.height/2-r.height/2;switch(o){case ht:e={x:a,y:n.y-r.height};break;case pt:e={x:a,y:n.y+n.height};break;case vt:e={x:n.x+n.width,y:c};break;case gt:e={x:n.x-r.width,y:c};break;default:e={x:n.x,y:n.y}}var l=o?Ht(o):null;if(null!=l){var u="y"===l?"height":"width";switch(s){case bt:e[l]=e[l]-(n[u]/2-r[u]/2);break;case wt:e[l]=e[l]+(n[u]/2-r[u]/2)}}return e}function ue(t,e){void 0===e&&(e={});var n=e.placement,r=void 0===n?t.placement:n,i=e.boundary,o=void 0===i?"clippingParents":i,s=e.rootBoundary,a=void 0===s?Et:s,c=e.elementContext,l=void 0===c?xt:c,u=e.altBoundary,d=void 0!==u&&u,f=e.padding,h=void 0===f?0:f,p=Qt("number"!=typeof h?h:Jt(h,yt)),v=t.rects.popper,g=t.elements[d?l===xt?"reference":xt:l],m=function(t,e,n){var r="clippingParents"===e?function(t){var e=se(Vt(t)),n=["absolute","fixed"].indexOf(Ft(t).position)>=0&&Ct(t)?Wt(t):t;return At(n)?e.filter(function(t){return At(t)&&Rt(t,n)&&"body"!==kt(t)}):[]}(t):[].concat(e),i=[].concat(r,[n]),o=i.reduce(function(e,n){var r=ce(t,n);return e.top=Dt(r.top,e.top),e.right=Tt(r.right,e.right),e.bottom=Tt(r.bottom,e.bottom),e.left=Dt(r.left,e.left),e},ce(t,i[0]));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}(At(g)?g:g.contextElement||Bt(t.elements.popper),o,a),y=Mt(t.elements.reference),b=le({reference:y,element:v,strategy:"absolute",placement:r}),w=ae(Object.assign({},v,b)),E=l===xt?w:y,x={top:m.top-E.top+p.top,bottom:E.bottom-m.bottom+p.bottom,left:m.left-E.left+p.left,right:E.right-m.right+p.right},O=t.modifiersData.offset;if(l===xt&&O){var P=O[r];Object.keys(x).forEach(function(t){var e=[vt,pt].indexOf(t)>=0?1:-1,n=[ht,pt].indexOf(t)>=0?"y":"x";x[t]+=P[n]*e})}return x}function de(t,e){void 0===e&&(e={});var n=e.boundary,r=e.rootBoundary,i=e.padding,o=e.flipVariations,s=e.allowedAutoPlacements,a=void 0===s?Pt:s,c=Ut(e.placement),l=c?o?Ot:Ot.filter(function(t){return Ut(t)===c}):yt,u=l.filter(function(t){return a.indexOf(t)>=0});0===u.length&&(u=l);var d=u.reduce(function(e,o){return e[o]=ue(t,{placement:o,boundary:n,rootBoundary:r,padding:i})[St(o)],e},{});return Object.keys(d).sort(function(t,e){return d[t]-d[e]})}function fe(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function he(t){return[ht,vt,pt,gt].some(function(e){return t[e]>=0})}function pe(t,e,n){void 0===n&&(n=!1);var r,i,o=Ct(e),s=Ct(e)&&function(t){var e=t.getBoundingClientRect(),n=It(e.width)/t.offsetWidth||1,r=It(e.height)/t.offsetHeight||1;return 1!==n||1!==r}(e),a=Bt(e),c=Mt(t,s),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(o||!o&&!n)&&(("body"!==kt(e)||ie(a))&&(l=(r=e)!==_t(r)&&Ct(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:ne(r)),Ct(e)?((u=Mt(e,!0)).x+=e.clientLeft,u.y+=e.clientTop):a&&(u.x=re(a))),{x:c.left+l.scrollLeft-u.x,y:c.top+l.scrollTop-u.y,width:c.width,height:c.height}}function ve(t){var e=new Map,n=new Set,r=[];function i(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){if(!n.has(t)){var r=e.get(t);r&&i(r)}}),r.push(t)}return t.forEach(function(t){e.set(t.name,t)}),t.forEach(function(t){n.has(t.name)||i(t)}),r}var ge={placement:"bottom",modifiers:[],strategy:"absolute"};function me(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(t){return!(t&&"function"==typeof t.getBoundingClientRect)})}function ye(t){void 0===t&&(t={});var e=t.defaultModifiers,n=void 0===e?[]:e,r=t.defaultOptions,i=void 0===r?ge:r;return function(t,e,r){void 0===r&&(r=i);var o,s,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},ge,i),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},c=[],l=!1,u={state:a,setOptions:function(r){var o="function"==typeof r?r(a.options):r;d(),a.options=Object.assign({},i,a.options,o),a.scrollParents={reference:At(t)?se(t):t.contextElement?se(t.contextElement):[],popper:se(e)};var s,l,f=function(t){var e=ve(t);return Lt.reduce(function(t,n){return t.concat(e.filter(function(t){return t.phase===n}))},[])}((s=[].concat(n,a.options.modifiers),l=s.reduce(function(t,e){var n=t[e.name];return t[e.name]=n?Object.assign({},n,e,{options:Object.assign({},n.options,e.options),data:Object.assign({},n.data,e.data)}):e,t},{}),Object.keys(l).map(function(t){return l[t]})));return a.orderedModifiers=f.filter(function(t){return t.enabled}),a.orderedModifiers.forEach(function(t){var e=t.options,n=t.effect;if("function"==typeof n){var r=n({state:a,name:t.name,instance:u,options:void 0===e?{}:e});c.push(r||function(){})}}),u.update()},forceUpdate:function(){if(!l){var t=a.elements,e=t.reference,n=t.popper;if(me(e,n)){a.rects={reference:pe(e,Wt(n),"fixed"===a.options.strategy),popper:qt(n)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach(function(t){return a.modifiersData[t.name]=Object.assign({},t.data)});for(var r=0;r<a.orderedModifiers.length;r++)if(!0!==a.reset){var i=a.orderedModifiers[r],o=i.fn,s=i.options;"function"==typeof o&&(a=o({state:a,options:void 0===s?{}:s,name:i.name,instance:u})||a)}else a.reset=!1,r=-1}}},update:(o=function(){return new Promise(function(t){u.forceUpdate(),t(a)})},function(){return s||(s=new Promise(function(t){Promise.resolve().then(function(){s=void 0,t(o())})})),s}),destroy:function(){d(),l=!0}};if(!me(t,e))return u;function d(){c.forEach(function(t){return t()}),c=[]}return u.setOptions(r).then(function(t){!l&&r.onFirstUpdate&&r.onFirstUpdate(t)}),u}}var be=/*#__PURE__*/ye({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=void 0===i||i,s=r.resize,a=void 0===s||s,c=_t(e.elements.popper),l=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&l.forEach(function(t){t.addEventListener("scroll",n.update,Zt)}),a&&c.addEventListener("resize",n.update,Zt),function(){o&&l.forEach(function(t){t.removeEventListener("scroll",n.update,Zt)}),a&&c.removeEventListener("resize",n.update,Zt)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state;e.modifiersData[t.name]=le({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,s=void 0===o||o,a=n.roundOffsets,c=void 0===a||a,l={placement:St(e.placement),variation:Ut(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,Yt(Object.assign({},l,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:c})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,Yt(Object.assign({},l,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach(function(t){var n=e.styles[t]||{},r=e.attributes[t]||{},i=e.elements[t];Ct(i)&&kt(i)&&(Object.assign(i.style,n),Object.keys(r).forEach(function(t){var e=r[t];!1===e?i.removeAttribute(t):i.setAttribute(t,!0===e?"":e)}))})},effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(t){var r=e.elements[t],i=e.attributes[t]||{},o=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce(function(t,e){return t[e]="",t},{});Ct(r)&&kt(r)&&(Object.assign(r.style,o),Object.keys(i).forEach(function(t){r.removeAttribute(t)}))})}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.name,r=t.options.offset,i=void 0===r?[0,0]:r,o=Pt.reduce(function(t,n){return t[n]=function(t,e,n){var r=St(t),i=[gt,ht].indexOf(r)>=0?-1:1,o="function"==typeof n?n(Object.assign({},e,{placement:t})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[gt,vt].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}(n,e.rects,i),t},{}),s=o[e.placement],a=s.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=s.x,e.modifiersData.popperOffsets.y+=a),e.modifiersData[n]=o}},{name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,s=n.altAxis,a=void 0===s||s,c=n.fallbackPlacements,l=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,h=n.flipVariations,p=void 0===h||h,v=n.allowedAutoPlacements,g=e.options.placement,m=St(g),y=c||(m!==g&&p?function(t){if(St(t)===mt)return[];var e=$t(t);return[ee(t),e,ee(e)]}(g):[$t(g)]),b=[g].concat(y).reduce(function(t,n){return t.concat(St(n)===mt?de(e,{placement:n,boundary:u,rootBoundary:d,padding:l,flipVariations:p,allowedAutoPlacements:v}):n)},[]),w=e.rects.reference,E=e.rects.popper,x=new Map,O=!0,P=b[0],L=0;L<b.length;L++){var k=b[L],_=St(k),A=Ut(k)===bt,C=[ht,pt].indexOf(_)>=0,j=C?"width":"height",S=ue(e,{placement:k,boundary:u,rootBoundary:d,altBoundary:f,padding:l}),D=C?A?vt:gt:A?pt:ht;w[j]>E[j]&&(D=$t(D));var T=$t(D),I=[];if(o&&I.push(S[_]<=0),a&&I.push(S[D]<=0,S[T]<=0),I.every(function(t){return t})){P=k,O=!1;break}x.set(k,I)}if(O)for(var M=function(t){var e=b.find(function(e){var n=x.get(e);if(n)return n.slice(0,t).every(function(t){return t})});if(e)return P=e,"break"},q=p?3:1;q>0&&"break"!==M(q);q--);e.placement!==P&&(e.modifiersData[r]._skip=!0,e.placement=P,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=void 0===i||i,s=n.altAxis,a=void 0!==s&&s,c=n.tether,l=void 0===c||c,u=n.tetherOffset,d=void 0===u?0:u,f=ue(e,{boundary:n.boundary,rootBoundary:n.rootBoundary,padding:n.padding,altBoundary:n.altBoundary}),h=St(e.placement),p=Ut(e.placement),v=!p,g=Ht(h),m="x"===g?"y":"x",y=e.modifiersData.popperOffsets,b=e.rects.reference,w=e.rects.popper,E="function"==typeof d?d(Object.assign({},e.rects,{placement:e.placement})):d,x="number"==typeof E?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),O=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,P={x:0,y:0};if(y){if(o){var L,k="y"===g?ht:gt,_="y"===g?pt:vt,A="y"===g?"height":"width",C=y[g],j=C+f[k],S=C-f[_],D=l?-w[A]/2:0,T=p===bt?b[A]:w[A],I=p===bt?-w[A]:-b[A],M=e.elements.arrow,q=l&&M?qt(M):{width:0,height:0},R=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},F=R[k],N=R[_],B=zt(0,b[A],q[A]),V=v?b[A]/2-D-B-F-x.mainAxis:T-B-F-x.mainAxis,K=v?-b[A]/2+D+B+N+x.mainAxis:I+B+N+x.mainAxis,W=e.elements.arrow&&Wt(e.elements.arrow),H=null!=(L=null==O?void 0:O[g])?L:0,z=C+K-H,Q=zt(l?Tt(j,C+V-H-(W?"y"===g?W.clientTop||0:W.clientLeft||0:0)):j,C,l?Dt(S,z):S);y[g]=Q,P[g]=Q-C}if(a){var J,U=y[m],X="y"===m?"height":"width",Y=U+f["x"===g?ht:gt],Z=U-f["x"===g?pt:vt],G=-1!==[ht,gt].indexOf(h),$=null!=(J=null==O?void 0:O[m])?J:0,tt=G?Y:U-b[X]-w[X]-$+x.altAxis,et=G?U+b[X]+w[X]-$-x.altAxis:Z,nt=l&&G?function(t,e,n){var r=zt(t,e,n);return r>n?n:r}(tt,U,et):zt(l?tt:Y,U,l?et:Z);y[m]=nt,P[m]=nt-U}e.modifiersData[r]=P}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=St(n.placement),c=Ht(a),l=[gt,vt].indexOf(a)>=0?"height":"width";if(o&&s){var u=function(t,e){return Qt("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:Jt(t,yt))}(i.padding,n),d=qt(o),f="y"===c?ht:gt,h="y"===c?pt:vt,p=n.rects.reference[l]+n.rects.reference[c]-s[c]-n.rects.popper[l],v=s[c]-n.rects.reference[c],g=Wt(o),m=g?"y"===c?g.clientHeight||0:g.clientWidth||0:0,y=m/2-d[l]/2+(p/2-v/2),b=zt(u[f],y,m-d[l]-u[h]);n.modifiersData[r]=((e={})[c]=b,e.centerOffset=b-y,e)}},effect:function(t){var e=t.state,n=t.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=e.elements.popper.querySelector(r)))&&Rt(e.elements.popper,r)&&(e.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=ue(e,{elementContext:"reference"}),a=ue(e,{altBoundary:!0}),c=fe(s,r),l=fe(a,i,o),u=he(c),d=he(l);e.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}}]}),we=function(t){try{var e=this;if(!t)return Promise.resolve(e.collection);var n=e.collection.findIndex(function(e){return e.id===t.id});if(n>=0){var r=e.collection[n];"opened"===r.state&&r.close(),r.popper.destroy(),Ee(r),Object.getOwnPropertyNames(r).forEach(function(t){delete r[t]}),e.collection.splice(n,1)}return Promise.resolve(e.collection)}catch(t){return Promise.reject(t)}};function Ee(t){return t.__eventListeners&&(t.__eventListeners.forEach(function(e){e.el.forEach(function(n){e.type.forEach(function(r){t[n].removeEventListener(r,e.listener,!1)})})}),delete t.__eventListeners),t}var xe=function(t){try{var e=this,n=it.call(e,t);return n.target.classList.add(e.settings.stateActive),n.trigger.hasAttribute("aria-controls")&&n.trigger.setAttribute("aria-expanded","true"),n.config=nt(n.target,e.settings),n.popper.setOptions({placement:n.config.placement,modifiers:[{name:"eventListeners",enabled:!0}].concat((r=n.config,[{name:"offset",options:{offset:[0,parseInt(r.offset,10)]}},{name:"preventOverflow",options:{padding:rt(r["overflow-padding"])}},{name:"flip",options:{padding:rt(r["flip-padding"])}},{name:"arrow",options:{element:r["arrow-element"],padding:rt(r["arrow-padding"])}}]))}),n.popper.update(),n.state="opened",Promise.resolve(n)}catch(t){return Promise.reject(t)}var r},Oe=function(t,e){try{var n=this;we.call(n,e);var r=n,i={open:function(){return xe.call(r,this)},close:function(){return ct.call(r,this)},deregister:function(){return we.call(r,this)}},o=b({id:e.id,state:"closed",trigger:t,target:e,popper:be(t,e),config:nt(e,n.settings)},i);o.trigger.hasAttribute("aria-controls")&&o.trigger.setAttribute("aria-expanded","false"),Pe.call(n,o),n.collection.push(o);var s=function(){if(o.target.classList.contains(n.settings.stateActive))return Promise.resolve(o.open()).then(function(){ft.call(n,o)})}();return Promise.resolve(s&&s.then?s.then(function(){return o}):o)}catch(t){return Promise.reject(t)}};function Pe(t){return t.__eventListeners||("hover"===t.config.event?(t.__eventListeners=[{el:["trigger"],type:["mouseenter","focus"],listener:xe.bind(this,t)},{el:["trigger","target"],type:["mouseleave","focusout"],listener:lt.bind(this,t)}],t.__eventListeners.forEach(function(e){e.el.forEach(function(n){e.type.forEach(function(r){t[n].addEventListener(r,e.listener,!1)})})})):(t.__eventListeners=[{el:["trigger"],type:["click"],listener:ut.bind(this,t)}],t.__eventListeners.forEach(function(e){e.el.forEach(function(n){e.type.forEach(function(r){t[n].addEventListener(r,e.listener,!1)})})}))),t}var Le=/*#__PURE__*/function(t){function e(e){var n;return(n=t.call(this)||this).defaults=et,n.settings=b({},n.defaults,e),n.memory={},n.__handlerKeydown=dt.bind(x(n)),n.settings.autoInit&&n.init(),n}w(e,t);var n=e.prototype;return n.init=function(t){try{var e=this;t&&(e.settings=b({},e.settings,t));var n=document.querySelectorAll(e.settings.selectorPopover);return Promise.resolve(e.registerCollection(n)).then(function(){e.settings.eventListeners&&e.initEventListeners(!1)})}catch(t){return Promise.reject(t)}},n.destroy=function(){try{var t=this;return t.memory={},Promise.resolve(t.deregisterCollection()).then(function(){t.settings.eventListeners&&t.destroyEventListeners(!1)})}catch(t){return Promise.reject(t)}},n.initEventListeners=function(t){var e=this;void 0===t&&(t=!0),t&&this.collection.forEach(function(t){Pe.call(e,t)}),document.addEventListener("keydown",this.__handlerKeydown,!1)},n.destroyEventListeners=function(t){void 0===t&&(t=!0),t&&this.collection.forEach(function(t){Ee(t)}),document.removeEventListener("keydown",this.__handlerKeydown,!1)},n.register=function(t){var e=st.call(this,t);return e.error?Promise.reject(e.error):Oe.call(this,e.trigger,e.target)},n.deregister=function(t){var e=this.get(ot.call(this,t));return we.call(this,e)},n.open=function(t){return xe.call(this,t)},n.close=function(t){return ct.call(this,t)},e}(c);t.Checkbox=P,t.Drawer=F,t.Modal=tt,t.Popover=Le,t.core=y});
2
2
  //# sourceMappingURL=scripts.umd.js.map