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