vrembem 1.38.0 → 1.40.2

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
- const t=(t,e)=>{e&&document.querySelectorAll(e).forEach(e=>{t?(e.inert=!0,e.setAttribute("aria-hidden",!0)):(e.inert=null,e.removeAttribute("aria-hidden"))})},e=(t,e)=>{e&&document.querySelectorAll(e).forEach(e=>{t?e.style.overflow="hidden":e.style.removeProperty("overflow")})},n=t=>{t&&document.querySelectorAll(t).forEach(t=>{t.setAttribute("tabindex","-1")})},s=(t,...e)=>{(t=t.forEach?t:[t]).forEach(t=>{t.classList.add(...e)})};var i=['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^="-"])'];const r=(t,e)=>{const n=t.querySelector(`[data-${e.dataFocus}]`);if(n)n.focus();else{const e=t.querySelector('[tabindex="-1"]');e&&e.focus()}},o=(t=null)=>{t&&t.memory&&t.memory.trigger&&(t.memory.trigger.focus(),t.memory.trigger=null)};class a{constructor(){this.target=null,this.__handlerFocusTrap=this.handlerFocusTrap.bind(this)}init(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)}destroy(){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)}refresh(){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)))}handlerFocusTrap(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()))}handlerFocusLock(t){("Tab"===t.key||9===t.keyCode)&&t.preventDefault()}getFocusable(){const t=[],e=document.activeElement,n=this.inner?this.inner.scrollTop:0;return this.target.querySelectorAll(i.join(",")).forEach(e=>{e.focus(),e===document.activeElement&&t.push(e)}),this.inner&&(this.inner.scrollTop=n),e.focus(),t}}const c=function(t,e=0){return"string"!=typeof t?t:e?document.querySelector(t):document.querySelectorAll(t)},l=(t,...e)=>(t=[].slice.call(t=t.forEach?t:[t]),e.some(e=>t.some(t=>{if(t.classList.contains(e))return!0})));function d(t,e,n=!1){if(n){const s=c(t);if(!s.length)throw new Error(`Move target element "${t}" not found!`);const i=c(n,1);if(!i)throw new Error(`Move reference element "${n}" not found!`);s.forEach(t=>{switch(e){case"after":return i.after(t),{ref:i,el:t,type:e};case"before":return i.before(t),{ref:i,el:t,type:e};case"append":return i.append(t),{ref:i,el:t,type:e};case"prepend":return i.prepend(t),{ref:i,el:t,type:e};default:throw new Error(`Move type "${e}" does not exist!`)}})}}const u=(t,...e)=>{(t=t.forEach?t:[t]).forEach(t=>{t.classList.remove(...e)})},f=(t,e)=>new Promise(n=>{e.transition?(t.classList.remove(e.stateClosed),t.classList.add(e.stateOpening),t.addEventListener("transitionend",function s(){t.classList.add(e.stateOpened),t.classList.remove(e.stateOpening),n(t),this.removeEventListener("transitionend",s)})):(t.classList.add(e.stateOpened),t.classList.remove(e.stateClosed),n(t))}),h=(t,e)=>new Promise(n=>{e.transition?(t.classList.add(e.stateClosing),t.classList.remove(e.stateOpened),t.addEventListener("transitionend",function s(){t.classList.remove(e.stateClosing),t.classList.add(e.stateClosed),n(t),this.removeEventListener("transitionend",s)})):(t.classList.add(e.stateClosed),t.classList.remove(e.stateOpened),n(t))}),p={xs:"480px",sm:"620px",md:"760px",lg:"990px",xl:"1380px"};var g={__proto__:null,setInert:t,setOverflowHidden:e,setTabindex:n,addClass:s,camelCase:t=>t.replace(/-([a-z])/g,function(t){return t[1].toUpperCase()}),focusTarget:r,focusTrigger:o,FocusTrap:a,getElement:c,hasClass:l,hyphenCase:t=>t.replace(/([a-z][A-Z])/g,function(t){return t[0]+"-"+t[1].toLowerCase()}),moveElement:d,removeClass:u,toggleClass:(t,...e)=>{(t=t.forEach?t:[t]).forEach(t=>{e.forEach(e=>{t.classList.toggle(e)})})},openTransition:f,closeTransition:h,breakpoints:p};function m(){return(m=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t}).apply(this,arguments)}class v{constructor(t){this.defaults={autoInit:!1,stateAttr:"aria-checked",stateValue:"mixed"},this.settings=m({},this.defaults,t),this.__handlerClick=this.handlerClick.bind(this),this.settings.autoInit&&this.init()}init(t=null){t&&(this.settings=m({},this.settings,t));const e=document.querySelectorAll(`[${this.settings.stateAttr}="${this.settings.stateValue}"]`);this.setIndeterminate(e),document.addEventListener("click",this.__handlerClick,!1)}destroy(){document.removeEventListener("click",this.__handlerClick,!1)}handlerClick(t){const e=t.target.closest(`[${this.settings.stateAttr}="${this.settings.stateValue}"]`);e&&(this.removeAriaState(e),this.setIndeterminate(e))}setAriaState(t,e=this.settings.stateValue){(t=t.forEach?t:[t]).forEach(t=>{t.setAttribute(this.settings.stateAttr,e)})}removeAriaState(t){(t=t.forEach?t:[t]).forEach(t=>{t.removeAttribute(this.settings.stateAttr)})}setIndeterminate(t){(t=t.forEach?t:[t]).forEach(t=>{t.indeterminate=!!t.hasAttribute(this.settings.stateAttr)})}}var y={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:p,customEventPrefix:"drawer:",eventListeners:!0,stateSave:!0,stateKey:"DrawerState",setTabindex:!0,transition:!0};async function b(t,e){const n=e.getDrawer(t);return n?l(n,e.settings.classModal)?void 0:(s(n,e.settings.classModal),s(n,e.settings.stateClosed),u(n,e.settings.stateOpened),n.dispatchEvent(new CustomEvent(e.settings.customEventPrefix+"toModal",{bubbles:!0})),n):e.drawerNotFound(t)}async function w(n,i){const r=i.getDrawer(n);return r?l(r,i.settings.classModal)?(t(!1,i.settings.selectorInert),e(!1,i.settings.selectorOverflow),u(r,i.settings.classModal),i.focusTrap.destroy(),n=r.getAttribute(`data-${i.settings.dataDrawer}`),i.state[n]==i.settings.stateOpened&&(s(r,i.settings.stateOpened),u(r,i.settings.stateClosed)),r.dispatchEvent(new CustomEvent(i.settings.customEventPrefix+"toDefault",{bubbles:!0})),r):void 0:i.drawerNotFound(n)}class E{constructor(t){this.mediaQueryLists=[],this.parent=t,this.__check=this.check.bind(this)}init(){document.querySelectorAll(`[data-${this.parent.settings.dataBreakpoint}]`).forEach(t=>{const e=t.getAttribute(`data-${this.parent.settings.dataDrawer}`),n=t.getAttribute(`data-${this.parent.settings.dataBreakpoint}`),s=window.matchMedia("(min-width:"+(this.parent.settings.breakpoints[n]?this.parent.settings.breakpoints[n]:n)+")");this.match(s,t),s.addEventListener("change",this.__check),this.mediaQueryLists.push({mql:s,drawer:e})})}destroy(){this.mediaQueryLists&&this.mediaQueryLists.length&&this.mediaQueryLists.forEach(t=>{t.mql.removeListener(this.__check)}),this.mediaQueryLists=null}check(t=null){this.mediaQueryLists&&this.mediaQueryLists.length&&(this.mediaQueryLists.forEach(e=>{if(t&&t.media!=e.mql.media)return;const n=document.querySelector(`[data-${this.parent.settings.dataDrawer}="${e.drawer}"]`);n&&this.match(e.mql,n)}),document.dispatchEvent(new CustomEvent(this.parent.settings.customEventPrefix+"breakpoint",{bubbles:!0})))}match(t,e){t.matches?w(e,this.parent):b(e,this.parent)}}function x(t){if(this.working)return;let e=t.target.closest(`[data-${this.settings.dataToggle}]`);if(e){const 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}]`),e){const n=e.getAttribute(`data-${this.settings.dataOpen}`);return this.memory.trigger=e,this.open(n),void t.preventDefault()}if(e=t.target.closest(`[data-${this.settings.dataClose}]`),e){const n=e.getAttribute(`data-${this.settings.dataClose}`);if(n)this.memory.trigger=e,this.close(n);else{const e=t.target.closest(`[data-${this.settings.dataDrawer}]`);e&&this.close(e)}t.preventDefault()}else t.target.hasAttribute(`data-${this.settings.dataDrawer}`)&&this.close(t.target)}function O(t){if(!this.working&&"Escape"===t.key){const t=document.querySelector(`.${this.settings.classModal}.${this.settings.stateOpened}`);t&&this.close(t)}}function L(t,e){if(!e.stateSave)return k(e);const n=localStorage.getItem(e.stateKey)?JSON.parse(localStorage.getItem(e.stateKey)):{};return(t?[t]:document.querySelectorAll(`[data-${e.dataDrawer}]`)).forEach(t=>{if(l(t,e.classModal))return;const s=t.getAttribute(`data-${e.dataDrawer}`);n[s]=l(t,e.stateOpened)?e.stateOpened:e.stateClosed}),localStorage.setItem(e.stateKey,JSON.stringify(n)),n}function k(t){return localStorage.getItem(t.stateKey)&&localStorage.removeItem(t.stateKey),{}}class _{constructor(t){this.defaults=y,this.settings=m({},this.defaults,t),this.working=!1,this.memory={},this.state={},this.focusTrap=new a,this.breakpoint=new E(this),this.__handlerClick=x.bind(this),this.__handlerKeydown=O.bind(this),this.settings.autoInit&&this.init()}init(t=null){t&&(this.settings=m({},this.settings,t)),this.stateSet(),this.settings.setTabindex&&this.setTabindex(),this.breakpoint.init(),this.settings.eventListeners&&this.initEventListeners()}destroy(){this.breakpoint.destroy(),this.memory={},this.state={},localStorage.removeItem(this.settings.stateKey),this.settings.eventListeners&&this.destroyEventListeners()}initEventListeners(){document.addEventListener("click",this.__handlerClick,!1),document.addEventListener("touchend",this.__handlerClick,!1),document.addEventListener("keydown",this.__handlerKeydown,!1)}destroyEventListeners(){document.removeEventListener("click",this.__handlerClick,!1),document.removeEventListener("touchend",this.__handlerClick,!1),document.removeEventListener("keydown",this.__handlerKeydown,!1)}getDrawer(t){return"string"!=typeof t?t:document.querySelector(`[data-${this.settings.dataDrawer}="${t}"]`)}drawerNotFound(t){return Promise.reject(new Error(`Did not find drawer with key: "${t}"`))}setTabindex(){n(`\n [data-${this.settings.dataDrawer}]\n [data-${this.settings.dataDialog}]\n `)}stateSet(){this.state=function(t){if(!t.stateSave)return k(t);const e=localStorage.getItem(t.stateKey);if(!e||e&&0===Object.keys(JSON.parse(e)).length)return L(null,t);const n=JSON.parse(localStorage.getItem(t.stateKey));return Object.keys(n).forEach(e=>{const i=document.querySelector(`[data-${t.dataDrawer}="${e}"]`);i&&(n[e]==t.stateOpened?s(i,t.stateOpened):u(i,t.stateOpened))}),n}(this.settings)}stateSave(t=null){this.state=L(t,this.settings)}stateClear(){this.state=k(this.settings)}switchToDefault(t){return w(t,this)}switchToModal(t){return b(t,this)}async toggle(t){const e=this.getDrawer(t);return e?l(e,this.settings.stateOpened)?this.close(e):this.open(e):this.drawerNotFound(t)}async open(n){const s=this.getDrawer(n);if(!s)return this.drawerNotFound(n);if(l(s,this.settings.stateOpened))return r(s,this.settings),s;{this.working=!0;const n=l(s,this.settings.classModal);return n&&e(!0,this.settings.selectorOverflow),await f(s,this.settings),this.stateSave(s),n&&(this.focusTrap.init(s),t(!0,this.settings.selectorInert)),r(s,this.settings),s.dispatchEvent(new CustomEvent(this.settings.customEventPrefix+"opened",{detail:this,bubbles:!0})),this.working=!1,s}}async close(n){const s=this.getDrawer(n);return s?l(s,this.settings.stateOpened)?(this.working=!0,l(s,this.settings.classModal)&&(t(!1,this.settings.selectorInert),e(!1,this.settings.selectorOverflow)),await h(s,this.settings),this.stateSave(s),o(this),this.focusTrap.destroy(),s.dispatchEvent(new CustomEvent(this.settings.customEventPrefix+"closed",{detail:this,bubbles:!0})),this.working=!1,s):s:this.drawerNotFound(n)}}var A={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};async function C(t){if(this.working)return;const e=t.target.closest(`[data-${this.settings.dataOpen}]`);if(e){t.preventDefault();const n=e.getAttribute(`data-${this.settings.dataOpen}`),s=t.target.closest(`[data-${this.settings.dataModal}]`);return s||(this.memory.trigger=e),await this.close(!s),void this.open(n)}if(t.target.closest(`[data-${this.settings.dataClose}]`))return t.preventDefault(),void this.close();!t.target.hasAttribute(`data-${this.settings.dataModal}`)||t.target.hasAttribute(`data-${this.settings.dataRequired}`)||this.close()}function S(t){if(!this.working&&"Escape"===t.key){const t=document.querySelector(`[data-${this.settings.dataModal}].${this.settings.stateOpened}`);t&&!t.hasAttribute(`data-${this.settings.dataRequired}`)&&this.close()}}class ${constructor(t){this.defaults=A,this.settings=m({},this.defaults,t),this.working=!1,this.memory={},this.focusTrap=new a,this.__handlerClick=C.bind(this),this.__handlerKeydown=S.bind(this),this.settings.autoInit&&this.init()}init(t=null){t&&(this.settings=m({},this.settings,t)),this.moveModals(),this.settings.setTabindex&&this.setTabindex(),this.setInitialState(),this.settings.eventListeners&&this.initEventListeners()}destroy(){this.memory={},this.settings.eventListeners&&this.destroyEventListeners()}initEventListeners(){document.addEventListener("click",this.__handlerClick,!1),document.addEventListener("touchend",this.__handlerClick,!1),document.addEventListener("keydown",this.__handlerKeydown,!1)}destroyEventListeners(){document.removeEventListener("click",this.__handlerClick,!1),document.removeEventListener("touchend",this.__handlerClick,!1),document.removeEventListener("keydown",this.__handlerKeydown,!1)}getModal(t){return"string"!=typeof t?t:document.querySelector(`[data-${this.settings.dataModal}="${t}"]`)}modalNotFound(t){return Promise.reject(new Error(`Did not find modal with key: "${t}"`))}setTabindex(){n(`\n [data-${this.settings.dataModal}]\n [data-${this.settings.dataDialog}]\n `)}setInitialState(){var n;n=this,document.querySelectorAll(`[data-${n.settings.dataModal}]`).forEach(i=>{i.classList.contains(n.settings.stateOpened)&&(t(!1,n.settings.selectorInert),e(!1,n.settings.selectorOverflow),o(n),n.focusTrap.destroy()),u(i,n.settings.stateOpened,n.settings.stateOpening,n.settings.stateClosing),s(i,n.settings.stateClosed)})}moveModals(t=this.settings.moveModals.type,e=this.settings.moveModals.ref){const n=document.querySelectorAll(`[data-${this.settings.dataModal}]`);n.length&&d(n,t,e)}async open(n){const s=this.getModal(n);return s?l(s,this.settings.stateClosed)?(this.working=!0,e(!0,this.settings.selectorOverflow),await f(s,this.settings),this.focusTrap.init(s),r(s,this.settings),t(!0,this.settings.selectorInert),s.dispatchEvent(new CustomEvent(this.settings.customEventPrefix+"opened",{detail:this,bubbles:!0})),this.working=!1,s):s:this.modalNotFound(n)}async close(n=!0){const s=document.querySelector(`[data-${this.settings.dataModal}].${this.settings.stateOpened}`);return s?(this.working=!0,t(!1,this.settings.selectorInert),e(!1,this.settings.selectorOverflow),await h(s,this.settings),n&&o(this),this.focusTrap.destroy(),s.dispatchEvent(new CustomEvent(this.settings.customEventPrefix+"closed",{detail:this,bubbles:!0})),this.working=!1,s):s}}var D={autoInit:!1,dataPopover:"popover",dataTrigger:"popover-trigger",dataArrow:"popover-arrow",dataEventType:"popover-event",dataPlacement:"popover-placement",stateActive:"is-active",eventType:"click",eventListeners:!0,placement:"bottom-start"};function T(t,e){t.target.classList.remove(e.settings.stateActive),t.trigger.setAttribute("aria-expanded","false"),t.popper.setOptions({modifiers:[{name:"eventListeners",enabled:!1}]});const n=e.collection.findIndex(e=>e.target===t.target);return e.collection[n].state="hide",t}function M(t){return t.collection.forEach(e=>{"show"===e.state&&T(e,t)}),t.collection}function P(t,e){setTimeout(()=>{const n=t.target.closest(":hover")===t.target||t.trigger.closest(":hover")===t.trigger,s=document.activeElement.closest(`[data-${e.settings.dataPopover}]`)===t.target||document.activeElement.closest(`[data-${e.settings.dataTrigger}]`)===t.trigger;return n||s||T(t,e),t},1)}function j(t,e){const n=getComputedStyle(t),s={placement:e.placement,event:e.eventType,offset:0,"overflow-padding":0,"flip-padding":0,"arrow-element":`[data-${e.dataArrow}]`,"arrow-padding":0};for(const t in s){const e=n.getPropertyValue(`--popover-${t}`).trim();e&&(s[t]=e)}return s}function q(t,e,n=!1){return t.hasAttribute(`data-${e}`)?t.getAttribute(`data-${e}`):n}function I(t){let e;const 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 F(t,e){var n;t.target.classList.add(e.settings.stateActive),t.trigger.setAttribute("aria-expanded","true"),t.config=j(t.target,e.settings),t.popper.setOptions({placement:q(t.target,e.settings.dataPlacement,t.config.placement),modifiers:[{name:"eventListeners",enabled:!0},...(n=t.config,[{name:"offset",options:{offset:[0,parseInt(n.offset,10)]}},{name:"preventOverflow",options:{padding:I(n["overflow-padding"])}},{name:"flip",options:{padding:I(n["flip-padding"])}},{name:"arrow",options:{element:n["arrow-element"],padding:I(n["arrow-padding"])}}])]}),t.popper.update();const s=e.collection.findIndex(e=>e.target===t.target);return e.collection[s].state="show",t}function B(t){t.target.classList.contains(this.settings.stateActive)?T(t,this):(F(t,this),K(t,this))}function N(t){"Escape"===t.key&&M(this)}function K(t,e){document.addEventListener("click",function n(s){const i=s.target.closest(`[data-${e.settings.dataPopover}], [data-${e.settings.dataTrigger}]`);i===t.target||i===t.trigger?t.target.classList.contains(e.settings.stateActive)||this.removeEventListener("click",n):(t.target.classList.contains(e.settings.stateActive)&&T(t,e),this.removeEventListener("click",n))})}var W="top",R="bottom",H="right",V="left",Q=[W,R,H,V],z=/*#__PURE__*/Q.reduce(function(t,e){return t.concat([e+"-start",e+"-end"])},[]),U=/*#__PURE__*/[].concat(Q,["auto"]).reduce(function(t,e){return t.concat([e,e+"-start",e+"-end"])},[]),J=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function X(t){return t?(t.nodeName||"").toLowerCase():null}function Y(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Z(t){return t instanceof Y(t).Element||t instanceof Element}function G(t){return t instanceof Y(t).HTMLElement||t instanceof HTMLElement}function tt(t){return"undefined"!=typeof ShadowRoot&&(t instanceof Y(t).ShadowRoot||t instanceof ShadowRoot)}function et(t){return t.split("-")[0]}var nt=Math.max,st=Math.min,it=Math.round;function rt(t,e){void 0===e&&(e=!1);var n=t.getBoundingClientRect(),s=1,i=1;if(G(t)&&e){var r=t.offsetHeight,o=t.offsetWidth;o>0&&(s=it(n.width)/o||1),r>0&&(i=it(n.height)/r||1)}return{width:n.width/s,height:n.height/i,top:n.top/i,right:n.right/s,bottom:n.bottom/i,left:n.left/s,x:n.left/s,y:n.top/i}}function ot(t){var e=rt(t),n=t.offsetWidth,s=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-s)<=1&&(s=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:s}}function at(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&tt(n)){var s=e;do{if(s&&t.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function ct(t){return Y(t).getComputedStyle(t)}function lt(t){return["table","td","th"].indexOf(X(t))>=0}function dt(t){return((Z(t)?t.ownerDocument:t.document)||window.document).documentElement}function ut(t){return"html"===X(t)?t:t.assignedSlot||t.parentNode||(tt(t)?t.host:null)||dt(t)}function ft(t){return G(t)&&"fixed"!==ct(t).position?t.offsetParent:null}function ht(t){for(var e=Y(t),n=ft(t);n&&lt(n)&&"static"===ct(n).position;)n=ft(n);return n&&("html"===X(n)||"body"===X(n)&&"static"===ct(n).position)?e:n||function(t){var e=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&G(t)&&"fixed"===ct(t).position)return null;for(var n=ut(t);G(n)&&["html","body"].indexOf(X(n))<0;){var s=ct(n);if("none"!==s.transform||"none"!==s.perspective||"paint"===s.contain||-1!==["transform","perspective"].indexOf(s.willChange)||e&&"filter"===s.willChange||e&&s.filter&&"none"!==s.filter)return n;n=n.parentNode}return null}(t)||e}function pt(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function gt(t,e,n){return nt(t,st(e,n))}function mt(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function vt(t,e){return e.reduce(function(e,n){return e[n]=t,e},{})}function yt(t){return t.split("-")[1]}var bt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function wt(t){var e,n=t.popper,s=t.popperRect,i=t.placement,r=t.variation,o=t.offsets,a=t.position,c=t.gpuAcceleration,l=t.adaptive,d=t.roundOffsets,u=t.isFixed,f=o.x,h=void 0===f?0:f,p=o.y,g=void 0===p?0:p,m="function"==typeof d?d({x:h,y:g}):{x:h,y:g};h=m.x,g=m.y;var v=o.hasOwnProperty("x"),y=o.hasOwnProperty("y"),b=V,w=W,E=window;if(l){var x=ht(n),O="clientHeight",L="clientWidth";x===Y(n)&&"static"!==ct(x=dt(n)).position&&"absolute"===a&&(O="scrollHeight",L="scrollWidth"),x=x,(i===W||(i===V||i===H)&&"end"===r)&&(w=R,g-=(u&&E.visualViewport?E.visualViewport.height:x[O])-s.height,g*=c?1:-1),i!==V&&(i!==W&&i!==R||"end"!==r)||(b=H,h-=(u&&E.visualViewport?E.visualViewport.width:x[L])-s.width,h*=c?1:-1)}var k,_=Object.assign({position:a},l&&bt),A=!0===d?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:g}):{x:h,y:g};return h=A.x,g=A.y,Object.assign({},_,c?((k={})[w]=y?"0":"",k[b]=v?"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]=v?h+"px":"",e.transform="",e))}var Et={passive:!0},xt={left:"right",right:"left",bottom:"top",top:"bottom"};function Ot(t){return t.replace(/left|right|bottom|top/g,function(t){return xt[t]})}var Lt={start:"end",end:"start"};function kt(t){return t.replace(/start|end/g,function(t){return Lt[t]})}function _t(t){var e=Y(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function At(t){return rt(dt(t)).left+_t(t).scrollLeft}function Ct(t){var e=ct(t);return/auto|scroll|overlay|hidden/.test(e.overflow+e.overflowY+e.overflowX)}function St(t){return["html","body","#document"].indexOf(X(t))>=0?t.ownerDocument.body:G(t)&&Ct(t)?t:St(ut(t))}function $t(t,e){var n;void 0===e&&(e=[]);var s=St(t),i=s===(null==(n=t.ownerDocument)?void 0:n.body),r=Y(s),o=i?[r].concat(r.visualViewport||[],Ct(s)?s:[]):s,a=e.concat(o);return i?a:a.concat($t(ut(o)))}function Dt(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Tt(t,e){return"viewport"===e?Dt(function(t){var e=Y(t),n=dt(t),s=e.visualViewport,i=n.clientWidth,r=n.clientHeight,o=0,a=0;return s&&(i=s.width,r=s.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=s.offsetLeft,a=s.offsetTop)),{width:i,height:r,x:o+At(t),y:a}}(t)):Z(e)?function(t){var e=rt(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):Dt(function(t){var e,n=dt(t),s=_t(t),i=null==(e=t.ownerDocument)?void 0:e.body,r=nt(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=nt(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-s.scrollLeft+At(t),c=-s.scrollTop;return"rtl"===ct(i||n).direction&&(a+=nt(n.clientWidth,i?i.clientWidth:0)-r),{width:r,height:o,x:a,y:c}}(dt(t)))}function Mt(t){var e,n=t.reference,s=t.element,i=t.placement,r=i?et(i):null,o=i?yt(i):null,a=n.x+n.width/2-s.width/2,c=n.y+n.height/2-s.height/2;switch(r){case W:e={x:a,y:n.y-s.height};break;case R:e={x:a,y:n.y+n.height};break;case H:e={x:n.x+n.width,y:c};break;case V:e={x:n.x-s.width,y:c};break;default:e={x:n.x,y:n.y}}var l=r?pt(r):null;if(null!=l){var d="y"===l?"height":"width";switch(o){case"start":e[l]=e[l]-(n[d]/2-s[d]/2);break;case"end":e[l]=e[l]+(n[d]/2-s[d]/2)}}return e}function Pt(t,e){void 0===e&&(e={});var n=e.placement,s=void 0===n?t.placement:n,i=e.boundary,r=void 0===i?"clippingParents":i,o=e.rootBoundary,a=void 0===o?"viewport":o,c=e.elementContext,l=void 0===c?"popper":c,d=e.altBoundary,u=void 0!==d&&d,f=e.padding,h=void 0===f?0:f,p=mt("number"!=typeof h?h:vt(h,Q)),g=t.rects.popper,m=t.elements[u?"popper"===l?"reference":"popper":l],v=function(t,e,n){var s="clippingParents"===e?function(t){var e=$t(ut(t)),n=["absolute","fixed"].indexOf(ct(t).position)>=0&&G(t)?ht(t):t;return Z(n)?e.filter(function(t){return Z(t)&&at(t,n)&&"body"!==X(t)}):[]}(t):[].concat(e),i=[].concat(s,[n]),r=i.reduce(function(e,n){var s=Tt(t,n);return e.top=nt(s.top,e.top),e.right=st(s.right,e.right),e.bottom=st(s.bottom,e.bottom),e.left=nt(s.left,e.left),e},Tt(t,i[0]));return r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}(Z(m)?m:m.contextElement||dt(t.elements.popper),r,a),y=rt(t.elements.reference),b=Mt({reference:y,element:g,strategy:"absolute",placement:s}),w=Dt(Object.assign({},g,b)),E="popper"===l?w:y,x={top:v.top-E.top+p.top,bottom:E.bottom-v.bottom+p.bottom,left:v.left-E.left+p.left,right:E.right-v.right+p.right},O=t.modifiersData.offset;if("popper"===l&&O){var L=O[s];Object.keys(x).forEach(function(t){var e=[H,R].indexOf(t)>=0?1:-1,n=[W,R].indexOf(t)>=0?"y":"x";x[t]+=L[n]*e})}return x}function jt(t,e){void 0===e&&(e={});var n=e.boundary,s=e.rootBoundary,i=e.padding,r=e.flipVariations,o=e.allowedAutoPlacements,a=void 0===o?U:o,c=yt(e.placement),l=c?r?z:z.filter(function(t){return yt(t)===c}):Q,d=l.filter(function(t){return a.indexOf(t)>=0});0===d.length&&(d=l);var u=d.reduce(function(e,r){return e[r]=Pt(t,{placement:r,boundary:n,rootBoundary:s,padding:i})[et(r)],e},{});return Object.keys(u).sort(function(t,e){return u[t]-u[e]})}function qt(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 It(t){return[W,H,R,V].some(function(e){return t[e]>=0})}function Ft(t,e,n){void 0===n&&(n=!1);var s,i,r=G(e),o=G(e)&&function(t){var e=t.getBoundingClientRect(),n=it(e.width)/t.offsetWidth||1,s=it(e.height)/t.offsetHeight||1;return 1!==n||1!==s}(e),a=dt(e),c=rt(t,o),l={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(r||!r&&!n)&&(("body"!==X(e)||Ct(a))&&(l=(s=e)!==Y(s)&&G(s)?{scrollLeft:(i=s).scrollLeft,scrollTop:i.scrollTop}:_t(s)),G(e)?((d=rt(e,!0)).x+=e.clientLeft,d.y+=e.clientTop):a&&(d.x=At(a))),{x:c.left+l.scrollLeft-d.x,y:c.top+l.scrollTop-d.y,width:c.width,height:c.height}}function Bt(t){var e=new Map,n=new Set,s=[];function i(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){if(!n.has(t)){var s=e.get(t);s&&i(s)}}),s.push(t)}return t.forEach(function(t){e.set(t.name,t)}),t.forEach(function(t){n.has(t.name)||i(t)}),s}var Nt={placement:"bottom",modifiers:[],strategy:"absolute"};function Kt(){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 Wt(t){void 0===t&&(t={});var e=t.defaultModifiers,n=void 0===e?[]:e,s=t.defaultOptions,i=void 0===s?Nt:s;return function(t,e,s){void 0===s&&(s=i);var r,o,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},Nt,i),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},c=[],l=!1,d={state:a,setOptions:function(s){var r="function"==typeof s?s(a.options):s;u(),a.options=Object.assign({},i,a.options,r),a.scrollParents={reference:Z(t)?$t(t):t.contextElement?$t(t.contextElement):[],popper:$t(e)};var o,l,f=function(t){var e=Bt(t);return J.reduce(function(t,n){return t.concat(e.filter(function(t){return t.phase===n}))},[])}((o=[].concat(n,a.options.modifiers),l=o.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 s=n({state:a,name:t.name,instance:d,options:void 0===e?{}:e});c.push(s||function(){})}}),d.update()},forceUpdate:function(){if(!l){var t=a.elements,e=t.reference,n=t.popper;if(Kt(e,n)){a.rects={reference:Ft(e,ht(n),"fixed"===a.options.strategy),popper:ot(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 s=0;s<a.orderedModifiers.length;s++)if(!0!==a.reset){var i=a.orderedModifiers[s],r=i.fn,o=i.options;"function"==typeof r&&(a=r({state:a,options:void 0===o?{}:o,name:i.name,instance:d})||a)}else a.reset=!1,s=-1}}},update:(r=function(){return new Promise(function(t){d.forceUpdate(),t(a)})},function(){return o||(o=new Promise(function(t){Promise.resolve().then(function(){o=void 0,t(r())})})),o}),destroy:function(){u(),l=!0}};if(!Kt(t,e))return d;function u(){c.forEach(function(t){return t()}),c=[]}return d.setOptions(s).then(function(t){!l&&s.onFirstUpdate&&s.onFirstUpdate(t)}),d}}var Rt=/*#__PURE__*/Wt({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,s=t.options,i=s.scroll,r=void 0===i||i,o=s.resize,a=void 0===o||o,c=Y(e.elements.popper),l=[].concat(e.scrollParents.reference,e.scrollParents.popper);return r&&l.forEach(function(t){t.addEventListener("scroll",n.update,Et)}),a&&c.addEventListener("resize",n.update,Et),function(){r&&l.forEach(function(t){t.removeEventListener("scroll",n.update,Et)}),a&&c.removeEventListener("resize",n.update,Et)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state;e.modifiersData[t.name]=Mt({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,s=n.gpuAcceleration,i=void 0===s||s,r=n.adaptive,o=void 0===r||r,a=n.roundOffsets,c=void 0===a||a,l={placement:et(e.placement),variation:yt(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,wt(Object.assign({},l,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:c})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,wt(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]||{},s=e.attributes[t]||{},i=e.elements[t];G(i)&&X(i)&&(Object.assign(i.style,n),Object.keys(s).forEach(function(t){var e=s[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 s=e.elements[t],i=e.attributes[t]||{},r=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce(function(t,e){return t[e]="",t},{});G(s)&&X(s)&&(Object.assign(s.style,r),Object.keys(i).forEach(function(t){s.removeAttribute(t)}))})}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.name,s=t.options.offset,i=void 0===s?[0,0]:s,r=U.reduce(function(t,n){return t[n]=function(t,e,n){var s=et(t),i=[V,W].indexOf(s)>=0?-1:1,r="function"==typeof n?n(Object.assign({},e,{placement:t})):n,o=r[0],a=r[1];return o=o||0,a=(a||0)*i,[V,H].indexOf(s)>=0?{x:a,y:o}:{x:o,y:a}}(n,e.rects,i),t},{}),o=r[e.placement],a=o.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=o.x,e.modifiersData.popperOffsets.y+=a),e.modifiersData[n]=r}},{name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,s=t.name;if(!e.modifiersData[s]._skip){for(var i=n.mainAxis,r=void 0===i||i,o=n.altAxis,a=void 0===o||o,c=n.fallbackPlacements,l=n.padding,d=n.boundary,u=n.rootBoundary,f=n.altBoundary,h=n.flipVariations,p=void 0===h||h,g=n.allowedAutoPlacements,m=e.options.placement,v=et(m),y=c||(v!==m&&p?function(t){if("auto"===et(t))return[];var e=Ot(t);return[kt(t),e,kt(e)]}(m):[Ot(m)]),b=[m].concat(y).reduce(function(t,n){return t.concat("auto"===et(n)?jt(e,{placement:n,boundary:d,rootBoundary:u,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=et(_),C="start"===yt(_),S=[W,R].indexOf(A)>=0,$=S?"width":"height",D=Pt(e,{placement:_,boundary:d,rootBoundary:u,altBoundary:f,padding:l}),T=S?C?H:V:C?R:W;w[$]>E[$]&&(T=Ot(T));var M=Ot(T),P=[];if(r&&P.push(D[A]<=0),a&&P.push(D[T]<=0,D[M]<=0),P.every(function(t){return t})){L=_,O=!1;break}x.set(_,P)}if(O)for(var j=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"},q=p?3:1;q>0&&"break"!==j(q);q--);e.placement!==L&&(e.modifiersData[s]._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,s=t.name,i=n.mainAxis,r=void 0===i||i,o=n.altAxis,a=void 0!==o&&o,c=n.tether,l=void 0===c||c,d=n.tetherOffset,u=void 0===d?0:d,f=Pt(e,{boundary:n.boundary,rootBoundary:n.rootBoundary,padding:n.padding,altBoundary:n.altBoundary}),h=et(e.placement),p=yt(e.placement),g=!p,m=pt(h),v="x"===m?"y":"x",y=e.modifiersData.popperOffsets,b=e.rects.reference,w=e.rects.popper,E="function"==typeof u?u(Object.assign({},e.rects,{placement:e.placement})):u,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(r){var k,_="y"===m?W:V,A="y"===m?R:H,C="y"===m?"height":"width",S=y[m],$=S+f[_],D=S-f[A],T=l?-w[C]/2:0,M="start"===p?b[C]:w[C],P="start"===p?-w[C]:-b[C],j=e.elements.arrow,q=l&&j?ot(j):{width:0,height:0},I=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},F=I[_],B=I[A],N=gt(0,b[C],q[C]),K=g?b[C]/2-T-N-F-x.mainAxis:M-N-F-x.mainAxis,Q=g?-b[C]/2+T+N+B+x.mainAxis:P+N+B+x.mainAxis,z=e.elements.arrow&&ht(e.elements.arrow),U=null!=(k=null==O?void 0:O[m])?k:0,J=S+Q-U,X=gt(l?st($,S+K-U-(z?"y"===m?z.clientTop||0:z.clientLeft||0:0)):$,S,l?nt(D,J):D);y[m]=X,L[m]=X-S}if(a){var Y,Z=y[v],G="y"===v?"height":"width",tt=Z+f["x"===m?W:V],it=Z-f["x"===m?R:H],rt=-1!==[W,V].indexOf(h),at=null!=(Y=null==O?void 0:O[v])?Y:0,ct=rt?tt:Z-b[G]-w[G]-at+x.altAxis,lt=rt?Z+b[G]+w[G]-at-x.altAxis:it,dt=l&&rt?function(t,e,n){var s=gt(t,e,n);return s>n?n:s}(ct,Z,lt):gt(l?ct:tt,Z,l?lt:it);y[v]=dt,L[v]=dt-Z}e.modifiersData[s]=L}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,s=t.name,i=t.options,r=n.elements.arrow,o=n.modifiersData.popperOffsets,a=et(n.placement),c=pt(a),l=[V,H].indexOf(a)>=0?"height":"width";if(r&&o){var d=function(t,e){return mt("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:vt(t,Q))}(i.padding,n),u=ot(r),f="y"===c?W:V,h="y"===c?R:H,p=n.rects.reference[l]+n.rects.reference[c]-o[c]-n.rects.popper[l],g=o[c]-n.rects.reference[c],m=ht(r),v=m?"y"===c?m.clientHeight||0:m.clientWidth||0:0,y=v/2-u[l]/2+(p/2-g/2),b=gt(d[f],y,v-u[l]-d[h]);n.modifiersData[s]=((e={})[c]=b,e.centerOffset=b-y,e)}},effect:function(t){var e=t.state,n=t.options.element,s=void 0===n?"[data-popper-arrow]":n;null!=s&&("string"!=typeof s||(s=e.elements.popper.querySelector(s)))&&at(e.elements.popper,s)&&(e.elements.arrow=s)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,s=e.rects.reference,i=e.rects.popper,r=e.modifiersData.preventOverflow,o=Pt(e,{elementContext:"reference"}),a=Pt(e,{altBoundary:!0}),c=qt(o,s),l=qt(a,i,r),d=It(c),u=It(l);e.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:d,hasPopperEscaped:u},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":u})}}]});function Ht(t,e,n){if(!e&&!(e=function(t,e){const n=t.getAttribute(`data-${e.dataTrigger}`).trim();return n?document.querySelector(`[data-${e.dataPopover}="${n}"]`):!(!t.nextElementSibling||!t.nextElementSibling.hasAttribute(`data-${e.dataPopover}`))&&t.nextElementSibling}(t,n.settings)))return console.error("No popover associated with the provided trigger:",t),!1;const s=n.collection.findIndex(n=>n.trigger===t&&n.target===e);let i;if(s>=0)i=n.collection[s];else{const s=Rt(t,e);i={state:"hide",trigger:t,target:e,popper:s,config:j(e,n.settings)},n.collection.push(i)}return Qt(i,n),i.target.classList.contains(n.settings.stateActive)?(F(i,n),K(i,n)):T(i,n),i}function Vt(t,e){const n=e.collection.findIndex(e=>e.trigger===t.trigger&&e.target===t.target);return n>=0&&("show"===t.state&&T(t,e),t.popper.destroy(),zt(t),e.collection.splice(n,1)),e.collection}function Qt(t,e){return t.__eventListeners||("hover"===q(t.target,e.settings.dataEventType,t.config.event)?(t.__eventListeners=[{el:["trigger"],type:["mouseenter","focus"],listener:F.bind(null,t,e)},{el:["trigger","target"],type:["mouseleave","focusout"],listener:P.bind(null,t,e)}],t.__eventListeners.forEach(e=>{e.el.forEach(n=>{e.type.forEach(s=>{t[n].addEventListener(s,e.listener,!1)})})})):(t.__eventListeners=[{el:["trigger"],type:["click"],listener:B.bind(e,t)}],t.__eventListeners.forEach(e=>{e.el.forEach(n=>{e.type.forEach(s=>{t[n].addEventListener(s,e.listener,!1)})})}))),t}function zt(t){return t.__eventListeners&&(t.__eventListeners.forEach(e=>{e.el.forEach(n=>{e.type.forEach(s=>{t[n].removeEventListener(s,e.listener,!1)})})}),delete t.__eventListeners),t}function Ut(t){return document.querySelectorAll(`[data-${t.settings.dataTrigger}]`).forEach(e=>{Ht(e,!1,t)}),t.collection}function Jt(t){for(;t.collection.length>0;)Vt(t.collection[0],t);return t.collection}class Xt{constructor(t){this.defaults=D,this.settings=m({},this.defaults,t),this.collection=[],this.__handlerKeydown=N.bind(this),this.settings.autoInit&&this.init()}init(t=null){t&&(this.settings=m({},this.settings,t)),Ut(this),this.settings.eventListeners&&this.initEventListeners(!1)}destroy(){Jt(this),this.settings.eventListeners&&this.destroyEventListeners(!1)}initEventListeners(t=!0){t&&this.collection.forEach(t=>{Qt(t,this)}),document.addEventListener("keydown",this.__handlerKeydown,!1)}destroyEventListeners(t=!0){t&&this.collection.forEach(t=>{zt(t)}),document.removeEventListener("keydown",this.__handlerKeydown,!1)}register(t,e=!1){return Ht(t,e,this)}deregister(t){return Vt(t,this)}registerCollection(){return Ut(this)}deregisterCollection(){return Jt(this)}show(t){return F(t,this)}hide(t){return T(t,this)}hideAll(){return M(this)}}export{v as Checkbox,_ as Drawer,$ as Modal,Xt as Popover,g as core};
1
+ const t=(t,e)=>{e&&document.querySelectorAll(e).forEach(e=>{t?(e.inert=!0,e.setAttribute("aria-hidden",!0)):(e.inert=null,e.removeAttribute("aria-hidden"))})},e=(t,e)=>{e&&document.querySelectorAll(e).forEach(e=>{t?e.style.overflow="hidden":e.style.removeProperty("overflow")})},n=t=>{t&&document.querySelectorAll(t).forEach(t=>{t.setAttribute("tabindex","-1")})},s=(t,...e)=>{(t=t.forEach?t:[t]).forEach(t=>{t.classList.add(...e)})};var i=['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^="-"])'];const r=(t,e)=>{const n=t.querySelector(`[data-${e.dataFocus}]`);if(n)n.focus();else{const e=t.querySelector('[tabindex="-1"]');e&&e.focus()}},o=(t=null)=>{t&&t.memory&&t.memory.trigger&&(t.memory.trigger.focus(),t.memory.trigger=null)};class a{constructor(){this.target=null,this.__handlerFocusTrap=this.handlerFocusTrap.bind(this)}init(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)}destroy(){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)}refresh(){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)))}handlerFocusTrap(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()))}handlerFocusLock(t){("Tab"===t.key||9===t.keyCode)&&t.preventDefault()}getFocusable(){const t=[],e=document.activeElement,n=this.inner?this.inner.scrollTop:0;return this.target.querySelectorAll(i.join(",")).forEach(e=>{e.focus(),e===document.activeElement&&t.push(e)}),this.inner&&(this.inner.scrollTop=n),e.focus(),t}}const c=function(t,e=0){return"string"!=typeof t?t:e?document.querySelector(t):document.querySelectorAll(t)},l=(t,...e)=>(t=[].slice.call(t=t.forEach?t:[t]),e.some(e=>t.some(t=>{if(t.classList.contains(e))return!0})));function d(t,e,n=!1){if(n){const s=c(t);if(!s.length)throw new Error(`Move target element "${t}" not found!`);const i=c(n,1);if(!i)throw new Error(`Move reference element "${n}" not found!`);s.forEach(t=>{switch(e){case"after":return i.after(t),{ref:i,el:t,type:e};case"before":return i.before(t),{ref:i,el:t,type:e};case"append":return i.append(t),{ref:i,el:t,type:e};case"prepend":return i.prepend(t),{ref:i,el:t,type:e};default:throw new Error(`Move type "${e}" does not exist!`)}})}}const u=(t,...e)=>{(t=t.forEach?t:[t]).forEach(t=>{t.classList.remove(...e)})},h=(t,e)=>new Promise(n=>{e.transition?(t.classList.remove(e.stateClosed),t.classList.add(e.stateOpening),t.addEventListener("transitionend",function s(){t.classList.add(e.stateOpened),t.classList.remove(e.stateOpening),n(t),this.removeEventListener("transitionend",s)})):(t.classList.add(e.stateOpened),t.classList.remove(e.stateClosed),n(t))}),f=(t,e)=>new Promise(n=>{e.transition?(t.classList.add(e.stateClosing),t.classList.remove(e.stateOpened),t.addEventListener("transitionend",function s(){t.classList.remove(e.stateClosing),t.classList.add(e.stateClosed),n(t),this.removeEventListener("transitionend",s)})):(t.classList.add(e.stateClosed),t.classList.remove(e.stateOpened),n(t))});var p={__proto__:null,setInert:t,setOverflowHidden:e,setTabindex:n,addClass:s,camelCase:t=>t.replace(/-([a-z])/g,function(t){return t[1].toUpperCase()}),focusTarget:r,focusTrigger:o,FocusTrap:a,getElement:c,hasClass:l,hyphenCase:t=>t.replace(/([a-z][A-Z])/g,function(t){return t[0]+"-"+t[1].toLowerCase()}),moveElement:d,removeClass:u,toggleClass:(t,...e)=>{(t=t.forEach?t:[t]).forEach(t=>{e.forEach(e=>{t.classList.toggle(e)})})},openTransition:h,closeTransition:f};function g(){return(g=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t}).apply(this,arguments)}class m{constructor(t){this.defaults={autoInit:!1,stateAttr:"aria-checked",stateValue:"mixed"},this.settings=g({},this.defaults,t),this.__handlerClick=this.handlerClick.bind(this),this.settings.autoInit&&this.init()}init(t=null){t&&(this.settings=g({},this.settings,t));const e=document.querySelectorAll(`[${this.settings.stateAttr}="${this.settings.stateValue}"]`);this.setIndeterminate(e),document.addEventListener("click",this.__handlerClick,!1)}destroy(){document.removeEventListener("click",this.__handlerClick,!1)}handlerClick(t){const e=t.target.closest(`[${this.settings.stateAttr}="${this.settings.stateValue}"]`);e&&(this.removeAriaState(e),this.setIndeterminate(e))}setAriaState(t,e=this.settings.stateValue){(t=t.forEach?t:[t]).forEach(t=>{t.setAttribute(this.settings.stateAttr,e)})}removeAriaState(t){(t=t.forEach?t:[t]).forEach(t=>{t.removeAttribute(this.settings.stateAttr)})}setIndeterminate(t){(t=t.forEach?t:[t]).forEach(t=>{t.indeterminate=!!t.hasAttribute(this.settings.stateAttr)})}}var v={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};class y{constructor(t){this.mediaQueryLists=[],this.parent=t,this.prefix=this.getVariablePrefix(),this.__check=this.check.bind(this)}init(){document.querySelectorAll(`[data-${this.parent.settings.dataBreakpoint}]`).forEach(t=>{const e=t.getAttribute(`data-${this.parent.settings.dataDrawer}`),n=t.getAttribute(`data-${this.parent.settings.dataBreakpoint}`),s=this.getBreakpoint(n),i=window.matchMedia("(min-width:"+s+")");this.match(i,t),i.addEventListener("change",this.__check),this.mediaQueryLists.push({mql:i,drawer:e})})}destroy(){this.mediaQueryLists&&this.mediaQueryLists.length&&this.mediaQueryLists.forEach(t=>{t.mql.removeListener(this.__check)}),this.mediaQueryLists=null}check(t=null){this.mediaQueryLists&&this.mediaQueryLists.length&&(this.mediaQueryLists.forEach(e=>{if(t&&t.media!=e.mql.media)return;const n=document.querySelector(`[data-${this.parent.settings.dataDrawer}="${e.drawer}"]`);n&&this.match(e.mql,n)}),document.dispatchEvent(new CustomEvent(this.parent.settings.customEventPrefix+"breakpoint",{bubbles:!0})))}match(t,e){t.matches?this.parent.switchToDefault(e):this.parent.switchToModal(e)}getBreakpoint(t){let 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}getVariablePrefix(){let t="--";return t+=getComputedStyle(document.body).getPropertyValue("--vrembem-variable-prefix"),t+="breakpoint-",t}}function b(t){return"string"!=typeof t?t:document.querySelector(`[data-${this.settings.dataDrawer}="${t}"]`)}function w(t){return Promise.reject(new Error(`Did not find drawer with key: "${t}"`))}async function E(n){const s=this.getDrawer(n);return s?l(s,this.settings.stateOpened)?(this.working=!0,l(s,this.settings.classModal)&&(t(!1,this.settings.selectorInert),e(!1,this.settings.selectorOverflow)),await f(s,this.settings),this.stateSave(s),o(this),this.focusTrap.destroy(),s.dispatchEvent(new CustomEvent(this.settings.customEventPrefix+"closed",{detail:this,bubbles:!0})),this.working=!1,s):s:w(n)}function x(t){if(this.working)return;let e=t.target.closest(`[data-${this.settings.dataToggle}]`);if(e){const 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}]`),e){const n=e.getAttribute(`data-${this.settings.dataOpen}`);return this.memory.trigger=e,this.open(n),void t.preventDefault()}if(e=t.target.closest(`[data-${this.settings.dataClose}]`),e){const n=e.getAttribute(`data-${this.settings.dataClose}`);if(n)this.memory.trigger=e,this.close(n);else{const e=t.target.closest(`[data-${this.settings.dataDrawer}]`);e&&this.close(e)}t.preventDefault()}else t.target.hasAttribute(`data-${this.settings.dataDrawer}`)&&this.close(t.target)}function O(t){if(!this.working&&"Escape"===t.key){const t=document.querySelector(`.${this.settings.classModal}.${this.settings.stateOpened}`);t&&this.close(t)}}async function L(n){const s=this.getDrawer(n);if(!s)return w(n);if(l(s,this.settings.stateOpened))return r(s,this.settings),s;{this.working=!0;const n=l(s,this.settings.classModal);return n&&e(!0,this.settings.selectorOverflow),await h(s,this.settings),this.stateSave(s),n&&(this.focusTrap.init(s),t(!0,this.settings.selectorInert)),r(s,this.settings),s.dispatchEvent(new CustomEvent(this.settings.customEventPrefix+"opened",{detail:this,bubbles:!0})),this.working=!1,s}}function k(t,e){if(!e.stateSave)return _(e);const n=localStorage.getItem(e.stateKey)?JSON.parse(localStorage.getItem(e.stateKey)):{};return(t?[t]:document.querySelectorAll(`[data-${e.dataDrawer}]`)).forEach(t=>{if(l(t,e.classModal))return;const s=t.getAttribute(`data-${e.dataDrawer}`);n[s]=l(t,e.stateOpened)?e.stateOpened:e.stateClosed}),localStorage.setItem(e.stateKey,JSON.stringify(n)),n}function _(t){return localStorage.getItem(t.stateKey)&&localStorage.removeItem(t.stateKey),{}}async function A(t){const e=this.getDrawer(t);return e?l(e,this.settings.classModal)?void 0:(s(e,this.settings.classModal),s(e,this.settings.stateClosed),u(e,this.settings.stateOpened),e.dispatchEvent(new CustomEvent(this.settings.customEventPrefix+"toModal",{bubbles:!0})),e):w(t)}async function C(n){const i=this.getDrawer(n);return i?l(i,this.settings.classModal)?(t(!1,this.settings.selectorInert),e(!1,this.settings.selectorOverflow),u(i,this.settings.classModal),this.focusTrap.destroy(),n=i.getAttribute(`data-${this.settings.dataDrawer}`),this.state[n]==this.settings.stateOpened&&(s(i,this.settings.stateOpened),u(i,this.settings.stateClosed)),i.dispatchEvent(new CustomEvent(this.settings.customEventPrefix+"toDefault",{bubbles:!0})),i):void 0:w(n)}async function S(t){const e=this.getDrawer(t);return e?l(e,this.settings.stateOpened)?this.close(e):this.open(e):w(t)}class T{constructor(t){this.defaults=v,this.settings=g({},this.defaults,t),this.working=!1,this.memory={},this.state={},this.focusTrap=new a,this.breakpoint=new y(this),this.__handlerClick=x.bind(this),this.__handlerKeydown=O.bind(this),this.settings.autoInit&&this.init()}init(t=null){t&&(this.settings=g({},this.settings,t)),this.stateSet(),this.settings.setTabindex&&this.setTabindex(),this.breakpoint.init(),this.settings.eventListeners&&this.initEventListeners()}destroy(){this.breakpoint.destroy(),this.memory={},this.state={},localStorage.removeItem(this.settings.stateKey),this.settings.eventListeners&&this.destroyEventListeners()}initEventListeners(){document.addEventListener("click",this.__handlerClick,!1),document.addEventListener("touchend",this.__handlerClick,!1),document.addEventListener("keydown",this.__handlerKeydown,!1)}destroyEventListeners(){document.removeEventListener("click",this.__handlerClick,!1),document.removeEventListener("touchend",this.__handlerClick,!1),document.removeEventListener("keydown",this.__handlerKeydown,!1)}getDrawer(t){return b.call(this,t)}setTabindex(){return n(`\n [data-${this.settings.dataDrawer}]\n [data-${this.settings.dataDialog}]\n `)}stateSet(){this.state=function(t){if(!t.stateSave)return _(t);const e=localStorage.getItem(t.stateKey);if(!e||e&&0===Object.keys(JSON.parse(e)).length)return k(null,t);const n=JSON.parse(localStorage.getItem(t.stateKey));return Object.keys(n).forEach(e=>{const i=document.querySelector(`[data-${t.dataDrawer}="${e}"]`);i&&(n[e]==t.stateOpened?s(i,t.stateOpened):u(i,t.stateOpened))}),n}(this.settings)}stateSave(t=null){this.state=k(t,this.settings)}stateClear(){this.state=_(this.settings)}switchToDefault(t){return C.call(this,t)}switchToModal(t){return A.call(this,t)}toggle(t){return S.call(this,t)}open(t){return L.call(this,t)}close(t){return E.call(this,t)}}var $={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};async function D(n=!0){const s=document.querySelector(`[data-${this.settings.dataModal}].${this.settings.stateOpened}`);return s?(this.working=!0,t(!1,this.settings.selectorInert),e(!1,this.settings.selectorOverflow),await f(s,this.settings),n&&o(this),this.focusTrap.destroy(),s.dispatchEvent(new CustomEvent(this.settings.customEventPrefix+"closed",{detail:this,bubbles:!0})),this.working=!1,s):s}async function M(t){if(this.working)return;const e=t.target.closest(`[data-${this.settings.dataOpen}]`);if(e){t.preventDefault();const n=e.getAttribute(`data-${this.settings.dataOpen}`),s=t.target.closest(`[data-${this.settings.dataModal}]`);return s||(this.memory.trigger=e),await this.close(!s),void this.open(n)}if(t.target.closest(`[data-${this.settings.dataClose}]`))return t.preventDefault(),void this.close();!t.target.hasAttribute(`data-${this.settings.dataModal}`)||t.target.hasAttribute(`data-${this.settings.dataRequired}`)||this.close()}function P(t){if(!this.working&&"Escape"===t.key){const t=document.querySelector(`[data-${this.settings.dataModal}].${this.settings.stateOpened}`);t&&!t.hasAttribute(`data-${this.settings.dataRequired}`)&&this.close()}}function j(t){return"string"!=typeof t?t:document.querySelector(`[data-${this.settings.dataModal}="${t}"]`)}function q(t=this.settings.moveModals.type,e=this.settings.moveModals.ref){const n=document.querySelectorAll(`[data-${this.settings.dataModal}]`);n.length&&d(n,t,e)}function I(){document.querySelectorAll(`[data-${this.settings.dataModal}]`).forEach(n=>{n.classList.contains(this.settings.stateOpened)&&(t(!1,this.settings.selectorInert),e(!1,this.settings.selectorOverflow),o(this),this.focusTrap.destroy()),u(n,this.settings.stateOpened,this.settings.stateOpening,this.settings.stateClosing),s(n,this.settings.stateClosed)})}async function F(n){const s=j.call(this,n);return s?l(s,this.settings.stateClosed)?(this.working=!0,e(!0,this.settings.selectorOverflow),await h(s,this.settings),this.focusTrap.init(s),r(s,this.settings),t(!0,this.settings.selectorInert),s.dispatchEvent(new CustomEvent(this.settings.customEventPrefix+"opened",{detail:this,bubbles:!0})),this.working=!1,s):s:Promise.reject(new Error(`Did not find modal with key: "${n}"`))}class B{constructor(t){this.defaults=$,this.settings=g({},this.defaults,t),this.working=!1,this.memory={},this.focusTrap=new a,this.__handlerClick=M.bind(this),this.__handlerKeydown=P.bind(this),this.settings.autoInit&&this.init()}init(t=null){t&&(this.settings=g({},this.settings,t)),this.moveModals(),this.setInitialState(),this.settings.setTabindex&&this.setTabindex(),this.settings.eventListeners&&this.initEventListeners()}destroy(){this.memory={},this.settings.eventListeners&&this.destroyEventListeners()}initEventListeners(){document.addEventListener("click",this.__handlerClick,!1),document.addEventListener("touchend",this.__handlerClick,!1),document.addEventListener("keydown",this.__handlerKeydown,!1)}destroyEventListeners(){document.removeEventListener("click",this.__handlerClick,!1),document.removeEventListener("touchend",this.__handlerClick,!1),document.removeEventListener("keydown",this.__handlerKeydown,!1)}getModal(t){return j.call(this,t)}setTabindex(){return n(`\n [data-${this.settings.dataModal}]\n [data-${this.settings.dataDialog}]\n `)}setInitialState(){return I.call(this)}moveModals(t,e){return q.call(this,t,e)}open(t){return F.call(this,t)}close(t){return D.call(this,t)}}var V={autoInit:!1,dataPopover:"popover",dataTrigger:"popover-trigger",dataArrow:"popover-arrow",dataEventType:"popover-event",dataPlacement:"popover-placement",stateActive:"is-active",eventType:"click",eventListeners:!0,placement:"bottom-start"};function K(t){t.target.classList.remove(this.settings.stateActive),t.trigger.setAttribute("aria-expanded","false"),t.popper.setOptions({modifiers:[{name:"eventListeners",enabled:!1}]});const e=this.collection.findIndex(e=>e.target===t.target);return this.collection[e].state="closed",t.trigger===this.memory.trigger&&(this.memory.trigger=null),t}function W(){return this.collection.forEach(t=>{"opened"===t.state&&this.close(t)}),this.collection}function R(t){"opened"==t.state&&setTimeout(()=>{const e=t.target.closest(":hover")===t.target||t.trigger.closest(":hover")===t.trigger,n=document.activeElement.closest(`[data-${this.settings.dataPopover}]`)===t.target||document.activeElement.closest(`[data-${this.settings.dataTrigger}]`)===t.trigger;return e||n||this.close(t),t},1)}function H(t){t.target.classList.contains(this.settings.stateActive)?this.close(t):(this.memory.trigger=t.trigger,this.open(t),Q.call(this,t))}function N(t){switch(t.key){case"Escape":return this.memory.trigger&&this.memory.trigger.focus(),void this.closeAll();case"Tab":return void this.collection.forEach(t=>{R.call(this,t)});default:return}}function Q(t){const e=this;document.addEventListener("click",function n(s){const i=s.target.closest(`[data-${e.settings.dataPopover}], [data-${e.settings.dataTrigger}]`);i===t.target||i===t.trigger?t.target.classList.contains(e.settings.stateActive)||this.removeEventListener("click",n):(t.target.classList.contains(e.settings.stateActive)&&e.close(t),this.removeEventListener("click",n))})}function z(t,e){const n=getComputedStyle(t),s={placement:e.placement,event:e.eventType,offset:0,"overflow-padding":0,"flip-padding":0,"arrow-element":`[data-${e.dataArrow}]`,"arrow-padding":0};for(const t in s){const e=getComputedStyle(document.body).getPropertyValue("--vrembem-variable-prefix"),i=n.getPropertyValue(`--${e}popover-${t}`).trim();i&&(s[t]=i)}return s}function U(t,e,n=!1){return t.hasAttribute(`data-${e}`)?t.getAttribute(`data-${e}`):n}function J(t){let e;const 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 X(t){var e;t.target.classList.add(this.settings.stateActive),t.trigger.setAttribute("aria-expanded","true"),t.config=z(t.target,this.settings),t.popper.setOptions({placement:U(t.target,this.settings.dataPlacement,t.config.placement),modifiers:[{name:"eventListeners",enabled:!0},...(e=t.config,[{name:"offset",options:{offset:[0,parseInt(e.offset,10)]}},{name:"preventOverflow",options:{padding:J(e["overflow-padding"])}},{name:"flip",options:{padding:J(e["flip-padding"])}},{name:"arrow",options:{element:e["arrow-element"],padding:J(e["arrow-padding"])}}])]}),t.popper.update();const n=this.collection.findIndex(e=>e.target===t.target);return this.collection[n].state="opened",t}var Y="top",Z="bottom",G="right",tt="left",et=[Y,Z,G,tt],nt=/*#__PURE__*/et.reduce(function(t,e){return t.concat([e+"-start",e+"-end"])},[]),st=/*#__PURE__*/[].concat(et,["auto"]).reduce(function(t,e){return t.concat([e,e+"-start",e+"-end"])},[]),it=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function rt(t){return t?(t.nodeName||"").toLowerCase():null}function ot(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 ot(t).Element||t instanceof Element}function ct(t){return t instanceof ot(t).HTMLElement||t instanceof HTMLElement}function lt(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ot(t).ShadowRoot||t instanceof ShadowRoot)}function dt(t){return t.split("-")[0]}var ut=Math.max,ht=Math.min,ft=Math.round;function pt(t,e){void 0===e&&(e=!1);var n=t.getBoundingClientRect(),s=1,i=1;if(ct(t)&&e){var r=t.offsetHeight,o=t.offsetWidth;o>0&&(s=ft(n.width)/o||1),r>0&&(i=ft(n.height)/r||1)}return{width:n.width/s,height:n.height/i,top:n.top/i,right:n.right/s,bottom:n.bottom/i,left:n.left/s,x:n.left/s,y:n.top/i}}function gt(t){var e=pt(t),n=t.offsetWidth,s=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-s)<=1&&(s=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:s}}function mt(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&lt(n)){var s=e;do{if(s&&t.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function vt(t){return ot(t).getComputedStyle(t)}function yt(t){return["table","td","th"].indexOf(rt(t))>=0}function bt(t){return((at(t)?t.ownerDocument:t.document)||window.document).documentElement}function wt(t){return"html"===rt(t)?t:t.assignedSlot||t.parentNode||(lt(t)?t.host:null)||bt(t)}function Et(t){return ct(t)&&"fixed"!==vt(t).position?t.offsetParent:null}function xt(t){for(var e=ot(t),n=Et(t);n&&yt(n)&&"static"===vt(n).position;)n=Et(n);return n&&("html"===rt(n)||"body"===rt(n)&&"static"===vt(n).position)?e:n||function(t){var e=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&ct(t)&&"fixed"===vt(t).position)return null;for(var n=wt(t);ct(n)&&["html","body"].indexOf(rt(n))<0;){var s=vt(n);if("none"!==s.transform||"none"!==s.perspective||"paint"===s.contain||-1!==["transform","perspective"].indexOf(s.willChange)||e&&"filter"===s.willChange||e&&s.filter&&"none"!==s.filter)return n;n=n.parentNode}return null}(t)||e}function Ot(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Lt(t,e,n){return ut(t,ht(e,n))}function kt(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function _t(t,e){return e.reduce(function(e,n){return e[n]=t,e},{})}function At(t){return t.split("-")[1]}var Ct={top:"auto",right:"auto",bottom:"auto",left:"auto"};function St(t){var e,n=t.popper,s=t.popperRect,i=t.placement,r=t.variation,o=t.offsets,a=t.position,c=t.gpuAcceleration,l=t.adaptive,d=t.roundOffsets,u=t.isFixed,h=o.x,f=void 0===h?0:h,p=o.y,g=void 0===p?0:p,m="function"==typeof d?d({x:f,y:g}):{x:f,y:g};f=m.x,g=m.y;var v=o.hasOwnProperty("x"),y=o.hasOwnProperty("y"),b=tt,w=Y,E=window;if(l){var x=xt(n),O="clientHeight",L="clientWidth";x===ot(n)&&"static"!==vt(x=bt(n)).position&&"absolute"===a&&(O="scrollHeight",L="scrollWidth"),x=x,(i===Y||(i===tt||i===G)&&"end"===r)&&(w=Z,g-=(u&&E.visualViewport?E.visualViewport.height:x[O])-s.height,g*=c?1:-1),i!==tt&&(i!==Y&&i!==Z||"end"!==r)||(b=G,f-=(u&&E.visualViewport?E.visualViewport.width:x[L])-s.width,f*=c?1:-1)}var k,_=Object.assign({position:a},l&&Ct),A=!0===d?function(t){var e=t.y,n=window.devicePixelRatio||1;return{x:ft(t.x*n)/n||0,y:ft(e*n)/n||0}}({x:f,y:g}):{x:f,y:g};return f=A.x,g=A.y,Object.assign({},_,c?((k={})[w]=y?"0":"",k[b]=v?"0":"",k.transform=(E.devicePixelRatio||1)<=1?"translate("+f+"px, "+g+"px)":"translate3d("+f+"px, "+g+"px, 0)",k):((e={})[w]=y?g+"px":"",e[b]=v?f+"px":"",e.transform="",e))}var Tt={passive:!0},$t={left:"right",right:"left",bottom:"top",top:"bottom"};function Dt(t){return t.replace(/left|right|bottom|top/g,function(t){return $t[t]})}var Mt={start:"end",end:"start"};function Pt(t){return t.replace(/start|end/g,function(t){return Mt[t]})}function jt(t){var e=ot(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function qt(t){return pt(bt(t)).left+jt(t).scrollLeft}function It(t){var e=vt(t);return/auto|scroll|overlay|hidden/.test(e.overflow+e.overflowY+e.overflowX)}function Ft(t){return["html","body","#document"].indexOf(rt(t))>=0?t.ownerDocument.body:ct(t)&&It(t)?t:Ft(wt(t))}function Bt(t,e){var n;void 0===e&&(e=[]);var s=Ft(t),i=s===(null==(n=t.ownerDocument)?void 0:n.body),r=ot(s),o=i?[r].concat(r.visualViewport||[],It(s)?s:[]):s,a=e.concat(o);return i?a:a.concat(Bt(wt(o)))}function Vt(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Kt(t,e){return"viewport"===e?Vt(function(t){var e=ot(t),n=bt(t),s=e.visualViewport,i=n.clientWidth,r=n.clientHeight,o=0,a=0;return s&&(i=s.width,r=s.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=s.offsetLeft,a=s.offsetTop)),{width:i,height:r,x:o+qt(t),y:a}}(t)):at(e)?function(t){var e=pt(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):Vt(function(t){var e,n=bt(t),s=jt(t),i=null==(e=t.ownerDocument)?void 0:e.body,r=ut(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=ut(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-s.scrollLeft+qt(t),c=-s.scrollTop;return"rtl"===vt(i||n).direction&&(a+=ut(n.clientWidth,i?i.clientWidth:0)-r),{width:r,height:o,x:a,y:c}}(bt(t)))}function Wt(t){var e,n=t.reference,s=t.element,i=t.placement,r=i?dt(i):null,o=i?At(i):null,a=n.x+n.width/2-s.width/2,c=n.y+n.height/2-s.height/2;switch(r){case Y:e={x:a,y:n.y-s.height};break;case Z:e={x:a,y:n.y+n.height};break;case G:e={x:n.x+n.width,y:c};break;case tt:e={x:n.x-s.width,y:c};break;default:e={x:n.x,y:n.y}}var l=r?Ot(r):null;if(null!=l){var d="y"===l?"height":"width";switch(o){case"start":e[l]=e[l]-(n[d]/2-s[d]/2);break;case"end":e[l]=e[l]+(n[d]/2-s[d]/2)}}return e}function Rt(t,e){void 0===e&&(e={});var n=e.placement,s=void 0===n?t.placement:n,i=e.boundary,r=void 0===i?"clippingParents":i,o=e.rootBoundary,a=void 0===o?"viewport":o,c=e.elementContext,l=void 0===c?"popper":c,d=e.altBoundary,u=void 0!==d&&d,h=e.padding,f=void 0===h?0:h,p=kt("number"!=typeof f?f:_t(f,et)),g=t.rects.popper,m=t.elements[u?"popper"===l?"reference":"popper":l],v=function(t,e,n){var s="clippingParents"===e?function(t){var e=Bt(wt(t)),n=["absolute","fixed"].indexOf(vt(t).position)>=0&&ct(t)?xt(t):t;return at(n)?e.filter(function(t){return at(t)&&mt(t,n)&&"body"!==rt(t)}):[]}(t):[].concat(e),i=[].concat(s,[n]),r=i.reduce(function(e,n){var s=Kt(t,n);return e.top=ut(s.top,e.top),e.right=ht(s.right,e.right),e.bottom=ht(s.bottom,e.bottom),e.left=ut(s.left,e.left),e},Kt(t,i[0]));return r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}(at(m)?m:m.contextElement||bt(t.elements.popper),r,a),y=pt(t.elements.reference),b=Wt({reference:y,element:g,strategy:"absolute",placement:s}),w=Vt(Object.assign({},g,b)),E="popper"===l?w:y,x={top:v.top-E.top+p.top,bottom:E.bottom-v.bottom+p.bottom,left:v.left-E.left+p.left,right:E.right-v.right+p.right},O=t.modifiersData.offset;if("popper"===l&&O){var L=O[s];Object.keys(x).forEach(function(t){var e=[G,Z].indexOf(t)>=0?1:-1,n=[Y,Z].indexOf(t)>=0?"y":"x";x[t]+=L[n]*e})}return x}function Ht(t,e){void 0===e&&(e={});var n=e.boundary,s=e.rootBoundary,i=e.padding,r=e.flipVariations,o=e.allowedAutoPlacements,a=void 0===o?st:o,c=At(e.placement),l=c?r?nt:nt.filter(function(t){return At(t)===c}):et,d=l.filter(function(t){return a.indexOf(t)>=0});0===d.length&&(d=l);var u=d.reduce(function(e,r){return e[r]=Rt(t,{placement:r,boundary:n,rootBoundary:s,padding:i})[dt(r)],e},{});return Object.keys(u).sort(function(t,e){return u[t]-u[e]})}function Nt(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 Qt(t){return[Y,G,Z,tt].some(function(e){return t[e]>=0})}function zt(t,e,n){void 0===n&&(n=!1);var s,i,r=ct(e),o=ct(e)&&function(t){var e=t.getBoundingClientRect(),n=ft(e.width)/t.offsetWidth||1,s=ft(e.height)/t.offsetHeight||1;return 1!==n||1!==s}(e),a=bt(e),c=pt(t,o),l={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(r||!r&&!n)&&(("body"!==rt(e)||It(a))&&(l=(s=e)!==ot(s)&&ct(s)?{scrollLeft:(i=s).scrollLeft,scrollTop:i.scrollTop}:jt(s)),ct(e)?((d=pt(e,!0)).x+=e.clientLeft,d.y+=e.clientTop):a&&(d.x=qt(a))),{x:c.left+l.scrollLeft-d.x,y:c.top+l.scrollTop-d.y,width:c.width,height:c.height}}function Ut(t){var e=new Map,n=new Set,s=[];function i(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){if(!n.has(t)){var s=e.get(t);s&&i(s)}}),s.push(t)}return t.forEach(function(t){e.set(t.name,t)}),t.forEach(function(t){n.has(t.name)||i(t)}),s}var Jt={placement:"bottom",modifiers:[],strategy:"absolute"};function Xt(){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 Yt(t){void 0===t&&(t={});var e=t.defaultModifiers,n=void 0===e?[]:e,s=t.defaultOptions,i=void 0===s?Jt:s;return function(t,e,s){void 0===s&&(s=i);var r,o,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},Jt,i),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},c=[],l=!1,d={state:a,setOptions:function(s){var r="function"==typeof s?s(a.options):s;u(),a.options=Object.assign({},i,a.options,r),a.scrollParents={reference:at(t)?Bt(t):t.contextElement?Bt(t.contextElement):[],popper:Bt(e)};var o,l,h=function(t){var e=Ut(t);return it.reduce(function(t,n){return t.concat(e.filter(function(t){return t.phase===n}))},[])}((o=[].concat(n,a.options.modifiers),l=o.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=h.filter(function(t){return t.enabled}),a.orderedModifiers.forEach(function(t){var e=t.options,n=t.effect;if("function"==typeof n){var s=n({state:a,name:t.name,instance:d,options:void 0===e?{}:e});c.push(s||function(){})}}),d.update()},forceUpdate:function(){if(!l){var t=a.elements,e=t.reference,n=t.popper;if(Xt(e,n)){a.rects={reference:zt(e,xt(n),"fixed"===a.options.strategy),popper:gt(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 s=0;s<a.orderedModifiers.length;s++)if(!0!==a.reset){var i=a.orderedModifiers[s],r=i.fn,o=i.options;"function"==typeof r&&(a=r({state:a,options:void 0===o?{}:o,name:i.name,instance:d})||a)}else a.reset=!1,s=-1}}},update:(r=function(){return new Promise(function(t){d.forceUpdate(),t(a)})},function(){return o||(o=new Promise(function(t){Promise.resolve().then(function(){o=void 0,t(r())})})),o}),destroy:function(){u(),l=!0}};if(!Xt(t,e))return d;function u(){c.forEach(function(t){return t()}),c=[]}return d.setOptions(s).then(function(t){!l&&s.onFirstUpdate&&s.onFirstUpdate(t)}),d}}var Zt=/*#__PURE__*/Yt({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,s=t.options,i=s.scroll,r=void 0===i||i,o=s.resize,a=void 0===o||o,c=ot(e.elements.popper),l=[].concat(e.scrollParents.reference,e.scrollParents.popper);return r&&l.forEach(function(t){t.addEventListener("scroll",n.update,Tt)}),a&&c.addEventListener("resize",n.update,Tt),function(){r&&l.forEach(function(t){t.removeEventListener("scroll",n.update,Tt)}),a&&c.removeEventListener("resize",n.update,Tt)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state;e.modifiersData[t.name]=Wt({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,s=n.gpuAcceleration,i=void 0===s||s,r=n.adaptive,o=void 0===r||r,a=n.roundOffsets,c=void 0===a||a,l={placement:dt(e.placement),variation:At(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,St(Object.assign({},l,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:c})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,St(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]||{},s=e.attributes[t]||{},i=e.elements[t];ct(i)&&rt(i)&&(Object.assign(i.style,n),Object.keys(s).forEach(function(t){var e=s[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 s=e.elements[t],i=e.attributes[t]||{},r=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce(function(t,e){return t[e]="",t},{});ct(s)&&rt(s)&&(Object.assign(s.style,r),Object.keys(i).forEach(function(t){s.removeAttribute(t)}))})}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.name,s=t.options.offset,i=void 0===s?[0,0]:s,r=st.reduce(function(t,n){return t[n]=function(t,e,n){var s=dt(t),i=[tt,Y].indexOf(s)>=0?-1:1,r="function"==typeof n?n(Object.assign({},e,{placement:t})):n,o=r[0],a=r[1];return o=o||0,a=(a||0)*i,[tt,G].indexOf(s)>=0?{x:a,y:o}:{x:o,y:a}}(n,e.rects,i),t},{}),o=r[e.placement],a=o.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=o.x,e.modifiersData.popperOffsets.y+=a),e.modifiersData[n]=r}},{name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,s=t.name;if(!e.modifiersData[s]._skip){for(var i=n.mainAxis,r=void 0===i||i,o=n.altAxis,a=void 0===o||o,c=n.fallbackPlacements,l=n.padding,d=n.boundary,u=n.rootBoundary,h=n.altBoundary,f=n.flipVariations,p=void 0===f||f,g=n.allowedAutoPlacements,m=e.options.placement,v=dt(m),y=c||(v!==m&&p?function(t){if("auto"===dt(t))return[];var e=Dt(t);return[Pt(t),e,Pt(e)]}(m):[Dt(m)]),b=[m].concat(y).reduce(function(t,n){return t.concat("auto"===dt(n)?Ht(e,{placement:n,boundary:d,rootBoundary:u,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=dt(_),C="start"===At(_),S=[Y,Z].indexOf(A)>=0,T=S?"width":"height",$=Rt(e,{placement:_,boundary:d,rootBoundary:u,altBoundary:h,padding:l}),D=S?C?G:tt:C?Z:Y;w[T]>E[T]&&(D=Dt(D));var M=Dt(D),P=[];if(r&&P.push($[A]<=0),a&&P.push($[D]<=0,$[M]<=0),P.every(function(t){return t})){L=_,O=!1;break}x.set(_,P)}if(O)for(var j=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"},q=p?3:1;q>0&&"break"!==j(q);q--);e.placement!==L&&(e.modifiersData[s]._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,s=t.name,i=n.mainAxis,r=void 0===i||i,o=n.altAxis,a=void 0!==o&&o,c=n.tether,l=void 0===c||c,d=n.tetherOffset,u=void 0===d?0:d,h=Rt(e,{boundary:n.boundary,rootBoundary:n.rootBoundary,padding:n.padding,altBoundary:n.altBoundary}),f=dt(e.placement),p=At(e.placement),g=!p,m=Ot(f),v="x"===m?"y":"x",y=e.modifiersData.popperOffsets,b=e.rects.reference,w=e.rects.popper,E="function"==typeof u?u(Object.assign({},e.rects,{placement:e.placement})):u,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(r){var k,_="y"===m?Y:tt,A="y"===m?Z:G,C="y"===m?"height":"width",S=y[m],T=S+h[_],$=S-h[A],D=l?-w[C]/2:0,M="start"===p?b[C]:w[C],P="start"===p?-w[C]:-b[C],j=e.elements.arrow,q=l&&j?gt(j):{width:0,height:0},I=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},F=I[_],B=I[A],V=Lt(0,b[C],q[C]),K=g?b[C]/2-D-V-F-x.mainAxis:M-V-F-x.mainAxis,W=g?-b[C]/2+D+V+B+x.mainAxis:P+V+B+x.mainAxis,R=e.elements.arrow&&xt(e.elements.arrow),H=null!=(k=null==O?void 0:O[m])?k:0,N=S+W-H,Q=Lt(l?ht(T,S+K-H-(R?"y"===m?R.clientTop||0:R.clientLeft||0:0)):T,S,l?ut($,N):$);y[m]=Q,L[m]=Q-S}if(a){var z,U=y[v],J="y"===v?"height":"width",X=U+h["x"===m?Y:tt],et=U-h["x"===m?Z:G],nt=-1!==[Y,tt].indexOf(f),st=null!=(z=null==O?void 0:O[v])?z:0,it=nt?X:U-b[J]-w[J]-st+x.altAxis,rt=nt?U+b[J]+w[J]-st-x.altAxis:et,ot=l&&nt?function(t,e,n){var s=Lt(t,e,n);return s>n?n:s}(it,U,rt):Lt(l?it:X,U,l?rt:et);y[v]=ot,L[v]=ot-U}e.modifiersData[s]=L}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,s=t.name,i=t.options,r=n.elements.arrow,o=n.modifiersData.popperOffsets,a=dt(n.placement),c=Ot(a),l=[tt,G].indexOf(a)>=0?"height":"width";if(r&&o){var d=function(t,e){return kt("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:_t(t,et))}(i.padding,n),u=gt(r),h="y"===c?Y:tt,f="y"===c?Z:G,p=n.rects.reference[l]+n.rects.reference[c]-o[c]-n.rects.popper[l],g=o[c]-n.rects.reference[c],m=xt(r),v=m?"y"===c?m.clientHeight||0:m.clientWidth||0:0,y=v/2-u[l]/2+(p/2-g/2),b=Lt(d[h],y,v-u[l]-d[f]);n.modifiersData[s]=((e={})[c]=b,e.centerOffset=b-y,e)}},effect:function(t){var e=t.state,n=t.options.element,s=void 0===n?"[data-popper-arrow]":n;null!=s&&("string"!=typeof s||(s=e.elements.popper.querySelector(s)))&&mt(e.elements.popper,s)&&(e.elements.arrow=s)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,s=e.rects.reference,i=e.rects.popper,r=e.modifiersData.preventOverflow,o=Rt(e,{elementContext:"reference"}),a=Rt(e,{altBoundary:!0}),c=Nt(o,s),l=Nt(a,i,r),d=Qt(c),u=Qt(l);e.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:d,hasPopperEscaped:u},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":u})}}]});function Gt(t,e){if(!e&&!(e=function(t,e){const n=t.getAttribute(`data-${e.dataTrigger}`).trim();return n?document.querySelector(`[data-${e.dataPopover}="${n}"]`):!(!t.nextElementSibling||!t.nextElementSibling.hasAttribute(`data-${e.dataPopover}`))&&t.nextElementSibling}(t,this.settings)))return console.error("No popover associated with the provided trigger:",t),!1;const n=this.collection.findIndex(n=>n.trigger===t&&n.target===e);let s;if(n>=0)s=this.collection[n];else{const n=Zt(t,e);s={state:"closed",trigger:t,target:e,popper:n,config:z(e,this.settings)},this.collection.push(s)}return ee.call(this,s),s.target.classList.contains(this.settings.stateActive)?(this.open(s),Q.call(this,s)):this.close(s),s}function te(t){const e=this.collection.findIndex(e=>e.trigger===t.trigger&&e.target===t.target);return e>=0&&("opened"===t.state&&this.close(t),t.popper.destroy(),ne(t),this.collection.splice(e,1)),this.collection}function ee(t){return t.__eventListeners||("hover"===U(t.target,this.settings.dataEventType,t.config.event)?(t.__eventListeners=[{el:["trigger"],type:["mouseenter","focus"],listener:X.bind(this,t)},{el:["trigger","target"],type:["mouseleave","focusout"],listener:R.bind(this,t)}],t.__eventListeners.forEach(e=>{e.el.forEach(n=>{e.type.forEach(s=>{t[n].addEventListener(s,e.listener,!1)})})})):(t.__eventListeners=[{el:["trigger"],type:["click"],listener:H.bind(this,t)}],t.__eventListeners.forEach(e=>{e.el.forEach(n=>{e.type.forEach(s=>{t[n].addEventListener(s,e.listener,!1)})})}))),t}function ne(t){return t.__eventListeners&&(t.__eventListeners.forEach(e=>{e.el.forEach(n=>{e.type.forEach(s=>{t[n].removeEventListener(s,e.listener,!1)})})}),delete t.__eventListeners),t}function se(){return document.querySelectorAll(`[data-${this.settings.dataTrigger}]`).forEach(t=>{this.register(t,!1)}),this.collection}function ie(){for(;this.collection.length>0;)this.deregister(this.collection[0]);return this.collection}class re{constructor(t){this.defaults=V,this.settings=g({},this.defaults,t),this.collection=[],this.memory={trigger:null},this.__handlerKeydown=N.bind(this),this.settings.autoInit&&this.init()}init(t=null){t&&(this.settings=g({},this.settings,t)),this.registerCollection(),this.settings.eventListeners&&this.initEventListeners(!1)}destroy(){this.deregisterCollection(),this.settings.eventListeners&&this.destroyEventListeners(!1)}initEventListeners(t=!0){t&&this.collection.forEach(t=>{ee.call(this,t)}),document.addEventListener("keydown",this.__handlerKeydown,!1)}destroyEventListeners(t=!0){t&&this.collection.forEach(t=>{ne(t)}),document.removeEventListener("keydown",this.__handlerKeydown,!1)}register(t,e=!1){return Gt.call(this,t,e)}deregister(t){return te.call(this,t)}registerCollection(){return se.call(this)}deregisterCollection(){return ie.call(this)}open(t){return X.call(this,t)}close(t){return K.call(this,t)}closeAll(){return W.call(this)}}export{m as Checkbox,T as Drawer,B as Modal,re as Popover,p as core};
2
2
  //# sourceMappingURL=scripts.modern.js.map