vrembem 4.0.0-next.25 → 4.0.0-next.27
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/README.md +4 -2
- package/dev/base.css +106 -110
- package/dev/base.css.map +1 -1
- package/dev/index.css +116 -138
- package/dev/index.css.map +1 -1
- package/dev/index.js +2048 -1980
- package/dev/index.js.map +1 -1
- package/dev/index.umd.cjs +2048 -1980
- package/dev/index.umd.cjs.map +1 -1
- package/dev/root.css +10 -41
- package/dev/root.css.map +1 -1
- package/dist/base.css +1 -1
- package/dist/base.css.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +1601 -1476
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +3 -3
- package/dist/index.umd.cjs.map +1 -1
- package/dist/root.css +1 -1
- package/dist/root.css.map +1 -1
- package/package.json +22 -22
package/dist/index.umd.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
(function(w,C){typeof exports=="object"&&typeof module<"u"?C(exports):typeof define=="function"&&define.amd?define(["exports"],C):(w=typeof globalThis<"u"?globalThis:w||self,C(w.vrembem={}))})(this,function(w){"use strict";var ii=w=>{throw TypeError(w)};var si=(w,C,P)=>C.has(w)||ii("Cannot "+P);var E=(w,C,P)=>(si(w,C,"read from private field"),P?P.call(w):C.get(w)),q=(w,C,P)=>C.has(w)?ii("Cannot add the same private member more than once"):C instanceof WeakSet?C.add(w):C.set(w,P),N=(w,C,P,at)=>(si(w,C,"write to private field"),at?at.call(w,P):C.set(w,P),P);var _,ht,tt,et,pt,gt,vt,mt,bt;class C{constructor(e,i){q(this,_);this.value=e,N(this,_,i),this.mql=null}get handler(){return E(this,_)}set handler(e){this.mql&&this.mql.removeEventListener("change",E(this,_)),N(this,_,e)}mount(e,i){return e&&(this.value=e),i&&N(this,_,i),this.value?(this.mql=window.matchMedia(`(min-width: ${this.value})`),this.mql.addEventListener("change",E(this,_)),E(this,_).call(this,this.mql),this):this}unmount(){return this.mql?(this.mql.removeEventListener("change",E(this,_)),this.value=null,N(this,_,null),this.mql=null,this):this}}_=new WeakMap;class P{constructor(){this.collection=[]}async register(e){return await this.deregister(e),this.collection.push(e),this.collection}async deregister(e){const i=this.collection.findIndex(s=>s===e);if(i>=0){const s=this.collection[i];Object.getOwnPropertyNames(s).forEach(n=>{delete s[n]}),this.collection.splice(i,1)}return this.collection}async registerCollection(e){return await Promise.all(Array.from(e,i=>{this.register(i)})),this.collection}async deregisterCollection(){for(;this.collection.length>0;)await this.deregister(this.collection[0]);return this.collection}get(e,i="id"){return this.collection.find(s=>s[i]===e)}}class at{constructor(e=null,i="[data-focus]"){q(this,ht);q(this,tt);q(this,et);this.el=e,this.selectorFocus=i,N(this,tt,ri.bind(this)),N(this,et,oi.bind(this))}get focusable(){return E(this,ht)}set focusable(e){N(this,ht,e),E(this,ht).length?(document.removeEventListener("keydown",E(this,et)),document.addEventListener("keydown",E(this,tt))):(document.removeEventListener("keydown",E(this,tt)),document.addEventListener("keydown",E(this,et)))}get focusableFirst(){return this.focusable[0]}get focusableLast(){return this.focusable[this.focusable.length-1]}mount(e,i){e&&(this.el=e),i&&(this.selectorFocus=i),this.focusable=this.getFocusable(),this.focus()}unmount(){this.el=null,this.focusable=[],document.removeEventListener("keydown",E(this,tt)),document.removeEventListener("keydown",E(this,et))}focus(e=this.el,i=this.selectorFocus){(e.querySelector(i)||e).focus()}getFocusable(e=this.el){const i=[],s=document.activeElement,n=e.scrollTop,r=ni.join(",");return e.querySelectorAll(r).forEach(l=>{l.focus(),document.activeElement===l&&i.push(l)}),e.scrollTop=n,s.focus(),i}}ht=new WeakMap,tt=new WeakMap,et=new WeakMap;const R=":not([inert])",B=':not([tabindex^="-"])',yt=":not(:disabled)",ni=[`a[href]${R}${B}`,`area[href]${R}${B}`,`input:not([type="hidden"]):not([type="radio"])${R}${B}${yt}`,`input[type="radio"]${R}${B}${yt}`,`select${R}${B}${yt}`,`textarea${R}${B}${yt}`,`button${R}${B}${yt}`,`details${R} > summary:first-of-type${B}`,`iframe${R}${B}`,`audio[controls]${R}${B}`,`video[controls]${R}${B}`,`[contenteditable]${R}${B}`,`[tabindex]${R}${B}`];function ri(t){(t.key==="Tab"||t.keyCode===9)&&(t.shiftKey?(document.activeElement===this.focusableFirst||document.activeElement===this.el)&&(t.preventDefault(),this.focusableLast.focus()):(document.activeElement===this.focusableLast||document.activeElement===this.el)&&(t.preventDefault(),this.focusableFirst.focus()))}function oi(t){(t.key==="Tab"||t.keyCode===9)&&t.preventDefault()}function Mt(){return getComputedStyle(document.body).getPropertyValue("--vb-prefix").trim()}function Kt(t,e){const i={fallback:null,element:document.body,...e};if(t.slice(0,2)!=="--"){const n=Mt();n&&(t=`${n}${t}`),t=`--${t}`}const s=getComputedStyle(i.element).getPropertyValue(t).trim();if(s)return s;if(i.fallback)return i.fallback;throw new Error(`CSS variable "${t}" was not found!`)}function Xt(t,e){const s=(t.getAttribute(`data-${e}`)||"").replace(/'/g,'"');return s?JSON.parse(s):{}}function Yt(t,e=!0){const i=localStorage.getItem(t),s=i?JSON.parse(i):{};return{get(n){return n?s[n]:s},set(n,r){return r?s[n]=r:delete s[n],e&&localStorage.setItem(t,JSON.stringify(s)),s}}}function qt(t,e,i){const s=e.nodeType===Node.COMMENT_NODE,n=e.nodeType===Node.ELEMENT_NODE;if(e=s||n?e:document.querySelector(e),s&&(i="after"),!e)throw new Error(`Not a valid teleport reference: '${e}'`);if(typeof e[i]!="function")throw new Error(`Not a valid teleport method: '${i}'`);let r=null;return s||(r=document.createComment("teleported #"+t.id),t.before(r)),e[i](t),s&&e.remove(),r}function ai(t){const e={prefix:Kt("prefix-themes",{fallback:"vb-theme-"}),themes:["root","light","dark"],storeKey:"VB:Profile"};for(const[r]of Object.entries(e))t&&t[r]&&(e[r]=t[r]);const i={onInit(){},onChange(){}};for(const[r]of Object.entries(i))t&&t[r]&&(i[r]=t[r]);const s=Yt(e.storeKey),n={settings:e,add(r){e.themes.push(r)},remove(r){const a=e.themes.indexOf(r);~a&&e.themes.splice(a,1)},callback(r){i[r].call(this)},get class(){return`${e.prefix}${this.theme}`},get classes(){return e.themes.map(r=>`${e.prefix}${r}`)},get themes(){return e.themes},get theme(){return s.get("theme")||"root"},set theme(r){e.themes.includes(r)?this.theme!=r&&(s.set("theme",r),document.documentElement.classList.remove(...this.classes),document.documentElement.classList.add(`${e.prefix}${r}`),this.callback("onChange")):console.error(`Not a valid theme value: "${r}"`)}};return n.callback("onInit"),n}function xt(t,e,i,s="transition-duration"){return new Promise(n=>{if(typeof s=="string"){const r=Kt(s,{element:t}),a=!!r.includes("ms");s=parseFloat(r)*(a?1:1e3)}t.classList.remove(e.finish),t.classList.add(i.start),setTimeout(()=>{t.classList.add(i.finish),t.classList.remove(i.start),n(t)},s)})}function li(t,e){e&&document.querySelectorAll(e).forEach(s=>{t?s.style.overflow="hidden":s.style.removeProperty("overflow")})}function ci(t,e){e&&document.querySelectorAll(e).forEach(s=>{t?(s.inert=!0,s.setAttribute("aria-hidden",!0)):(s.inert=null,s.removeAttribute("aria-hidden"))})}function Et(t,e){ci(!!t,e.selectorInert),li(!!t,e.selectorOverflow)}const fi=Object.freeze(Object.defineProperty({__proto__:null,Breakpoint:C,Collection:P,FocusTrap:at,cssVar:Kt,getConfig:Xt,getPrefix:Mt,localStore:Yt,teleport:qt,themeStore:ai,transition:xt,updateGlobalState:Et},Symbol.toStringTag,{value:"Module"})),ui={autoMount:!1,dataOpen:"drawer-open",dataClose:"drawer-close",dataToggle:"drawer-toggle",dataBreakpoint:"drawer-breakpoint",dataConfig:"drawer-config",selectorDrawer:".drawer",selectorDialog:".drawer__dialog",selectorScreen:".drawer",selectorFocus:"[data-focus]",selectorInert:null,selectorOverflow:"body",stateOpened:"is-opened",stateOpening:"is-opening",stateClosing:"is-closing",stateClosed:"is-closed",classModal:"drawer_modal",breakpoints:null,customEventPrefix:"drawer:",eventListeners:!0,store:!0,storeKey:"VB:DrawerState",setTabindex:!0,transition:!0,transitionDuration:"drawer-transition-duration"};function di(t){t.store==="opened"?t.open(!1,!1):t.store==="closed"?t.close(!1,!1):t.store==="indeterminate"?t.state="indeterminate":t.el.classList.contains(t.getSetting("stateOpened"))?t.open(!1,!1):t.el.classList.contains(t.getSetting("stateClosed"))?t.close(!1,!1):t.state="indeterminate"}async function hi(t){t.store==="opened"?await t.open(!1,!1):t.store==="closed"?await t.close(!1,!1):t.store==="indeterminate"?t.state!="indeterminate"&&(t.state="indeterminate"):(t.state!=t.inlineState&&(t.state=t.inlineState),t.inlineState==="opened"?await t.open(!1,!1):t.inlineState==="closed"&&await t.close(!1,!1))}function pi(t){const e=Mt(),i=t.getAttribute(`data-${this.settings.dataBreakpoint}`);return this.settings.breakpoints&&this.settings.breakpoints[i]?this.settings.breakpoints[i]:getComputedStyle(document.body).getPropertyValue(`--${e}breakpoint-${i}`).trim()?getComputedStyle(document.body).getPropertyValue(`--${e}breakpoint-${i}`).trim():i}function lt(t){const e=typeof t=="string"?this.get(t):this.get(t.id);if(e)return e;throw new Error(`Drawer not found in collection with id of "${t.id||t}".`)}function me(t){t.state==="opened"?t.mode==="modal"?this.focusTrap.mount(t.dialog,this.settings.selectorFocus):this.focusTrap.focus(t.dialog,this.settings.selectorFocus):(t.trigger&&(t.trigger.focus(),t.trigger=null),this.focusTrap.unmount())}async function gi(t){const e=t.target.closest(`
|
|
1
|
+
(function(S,A){typeof exports=="object"&&typeof module<"u"?A(exports):typeof define=="function"&&define.amd?define(["exports"],A):(S=typeof globalThis<"u"?globalThis:S||self,A(S.vrembem={}))})(this,function(S){"use strict";var Pe=S=>{throw TypeError(S)};var Re=(S,A,O)=>A.has(S)||Pe("Cannot "+O);var w=(S,A,O)=>(Re(S,A,"read from private field"),O?O.call(S):A.get(S)),L=(S,A,O)=>A.has(S)?Pe("Cannot add the same private member more than once"):A instanceof WeakSet?A.add(S):A.set(S,O),C=(S,A,O,yt)=>(Re(S,A,"write to private field"),yt?yt.call(S,O):A.set(S,O),O);var M,ct,q,tt,ft,ut,dt,ht,gt,mt,pt,F,U,wt;function A(t){return t.split("-").map((e,i)=>i===0?e:e.charAt(0).toUpperCase()+e.slice(1)).join("")}function O(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function yt(t){if(typeof t=="number")return t;const e=parseFloat(t);if(!Number.isNaN(e)){const i=t.includes("ms");return e*(i?1:1e3)}throw new Error(`Could not convert value to milliseconds: ${t}`)}function Pt(){return getComputedStyle(document.body).getPropertyValue("--vb-prefix").trim()}function se(t,e){const i={fallback:null,element:document.body,...e};if(t.slice(0,2)!=="--"){const n=Pt();n&&(t=`${n}${t}`),t=`--${t}`}const s=getComputedStyle(i.element).getPropertyValue(t).trim();if(s)return s;if(i.fallback)return i.fallback;throw new Error(`CSS variable "${t}" was not found!`)}function ne(t,e="config"){const s=(t.getAttribute(`data-${e}`)||"").replace(/'/g,'"');return s?JSON.parse(s):{}}function oe(t){const e=getComputedStyle(t.el),i={},s=Object.keys(t.context.settings);for(let n=0;n<s.length;n++){const o=Pt(),r=t.context.module.toLowerCase(),l=O(s[n]),a=e.getPropertyValue(`--${o}${r}-${l}`).trim();a&&(i[l]=a)}return i}function re(t){return typeof t=="string"?document.getElementById(t):t instanceof HTMLElement?t:null}async function k(t,...e){t in this&&typeof this[t]=="function"&&await this[t](...e)}function xt(t,e,i,s,n=0){return new Promise(o=>{t.classList.remove(e),t.classList.add(i),setTimeout(()=>{t.classList.add(s),t.classList.remove(i),o(t)},yt(n))})}function De(t,e){e&&document.querySelectorAll(e).forEach(s=>{t?s.style.overflow="hidden":s.style.removeProperty("overflow")})}function Me(t,e){e&&document.querySelectorAll(e).forEach(s=>{t?(s.inert=!0,s.setAttribute("aria-hidden",!0)):(s.inert=null,s.removeAttribute("aria-hidden"))})}function vt(t,e,i){Me(!!t,e),De(!!t,i)}class le{constructor(e,i){L(this,M);this.value=e,C(this,M,i),this.mql=null}get handler(){return w(this,M)}set handler(e){this.mql&&this.mql.removeEventListener("change",w(this,M)),C(this,M,e)}mount(e,i){return e&&(this.value=e),i&&C(this,M,i),this.value?(this.mql=window.matchMedia(`(min-width: ${this.value})`),this.mql.addEventListener("change",w(this,M)),w(this,M).call(this,this.mql),this):this}unmount(){return this.mql?(this.mql.removeEventListener("change",w(this,M)),this.value=null,C(this,M,null),this.mql=null,this):this}}M=new WeakMap;class Rt{constructor(e={}){this.module=this.constructor.name,this.collection=[],this.settings=Object.assign({dataConfig:"config",teleport:null,teleportMethod:"append"},e)}get(e,i="id"){return this.collection.find(s=>s[i]===e)}applySettings(e){return Object.assign(this.settings,e)}async createEntry(e,i){return new St(this,e,i)}async register(e,i={}){await this.deregister((e==null?void 0:e.id)||e,!0);const s=await this.createEntry(e,i);return await s.mount(),await k.call(this,"beforeRegister",s),await k.call(s,"beforeRegister"),this.collection.push(s),await k.call(s,"afterRegister"),await k.call(this,"afterRegister",s),s}async deregister(e,i=!1){const s=this.collection.findIndex(n=>n.id===e);if(~s){const n=this.collection[s];await n.unmount(i),await k.call(this,"beforeDeregister",n),await k.call(n,"beforeDeregister",i),Object.getOwnPropertyNames(n).forEach(o=>{o!="beforeDeregister"&&o!="afterDeregister"&&delete n[o]}),this.collection.splice(s,1),await k.call(n,"afterDeregister",i),await k.call(this,"afterDeregister",n)}return this.collection}async mount(e={}){this.applySettings(e),await k.call(this,"beforeMount");const i=document.querySelectorAll(this.settings.selector);for(const s of i)await this.register(s);return await k.call(this,"afterMount"),this}async unmount(){for(await k.call(this,"beforeUnmount");this.collection.length>0;)await this.deregister(this.collection[0].id);return await k.call(this,"afterUnmount"),this}}class St{constructor(e,i,s={}){this.context=e,this.id=(i==null?void 0:i.id)||i,this.el=re(i),this.settings=Object.assign({},s),this.dataConfig={},this.customProps={},this.returnRef=null}applySettings(e){return Object.assign(this.settings,e)}getDataConfig(){return Object.assign(this.dataConfig,ne(this.el,this.getSetting("dataConfig")))}getCustomProps(){return Object.assign(this.customProps,oe(this))}getSetting(e){const i=A(e),s=O(e);if("dataConfig"in this&&i in this.dataConfig)return this.dataConfig[i];if("customProps"in this&&s in this.customProps)return this.customProps[s];if("settings"in this&&i in this.settings)return this.settings[i];if("settings"in this.context&&i in this.context.settings)return this.context.settings[i];throw new Error(`${this.context.module} setting does not exist: ${e}`)}async mount(e={}){if(this.el===null)throw new Error(`${this.context.module} element was not found with ID: "${this.id}"`);this.applySettings(e),this.getDataConfig(),this.getCustomProps(),await k.call(this,"beforeMount"),this.getSetting("teleport")&&this.teleport(),await k.call(this,"afterMount")}async unmount(e=!1){await k.call(this,"beforeUnmount",e),this.getSetting("teleport")&&this.teleportReturn(),await k.call(this,"afterUnmount",e)}teleport(e=this.getSetting("teleport"),i=this.getSetting("teleportMethod")){return this.returnRef?(console.error("Element has already been teleported:",this.el),!1):(this.returnRef=Wt(this.el,e,i),this.el)}teleportReturn(){return this.returnRef?(this.returnRef=Wt(this.el,this.returnRef),this.el):(console.error("No return reference found:",this.el),!1)}}class _t{constructor(e=null,i="[data-focus]"){L(this,ct);L(this,q);L(this,tt);this.el=e,this.selectorFocus=i,C(this,q,Ie.bind(this)),C(this,tt,Ne.bind(this))}get focusable(){return w(this,ct)}set focusable(e){C(this,ct,e),w(this,ct).length?(document.removeEventListener("keydown",w(this,tt)),document.addEventListener("keydown",w(this,q))):(document.removeEventListener("keydown",w(this,q)),document.addEventListener("keydown",w(this,tt)))}get focusableFirst(){return this.focusable[0]}get focusableLast(){return this.focusable[this.focusable.length-1]}mount(e,i){e&&(this.el=e),i&&(this.selectorFocus=i),this.focusable=this.getFocusable(),this.focus()}unmount(){this.el=null,this.focusable=[],document.removeEventListener("keydown",w(this,q)),document.removeEventListener("keydown",w(this,tt))}focus(e=this.el,i=this.selectorFocus){(e.querySelector(i)||e).focus()}getFocusable(e=this.el){const i=[],s=document.activeElement,n=e.scrollTop,o=Fe.join(",");return e.querySelectorAll(o).forEach(l=>{l.focus(),document.activeElement===l&&i.push(l)}),e.scrollTop=n,s.focus(),i}}ct=new WeakMap,q=new WeakMap,tt=new WeakMap;const T=":not([inert])",P=':not([tabindex^="-"])',Et=":not(:disabled)",Fe=[`a[href]${T}${P}`,`area[href]${T}${P}`,`input:not([type="hidden"]):not([type="radio"])${T}${P}${Et}`,`input[type="radio"]${T}${P}${Et}`,`select${T}${P}${Et}`,`textarea${T}${P}${Et}`,`button${T}${P}${Et}`,`details${T} > summary:first-of-type${P}`,`iframe${T}${P}`,`audio[controls]${T}${P}`,`video[controls]${T}${P}`,`[contenteditable]${T}${P}`,`[tabindex]${T}${P}`];function Ie(t){(t.key==="Tab"||t.keyCode===9)&&(t.shiftKey?(document.activeElement===this.focusableFirst||document.activeElement===this.el)&&(t.preventDefault(),this.focusableLast.focus()):(document.activeElement===this.focusableLast||document.activeElement===this.el)&&(t.preventDefault(),this.focusableFirst.focus()))}function Ne(t){(t.key==="Tab"||t.keyCode===9)&&t.preventDefault()}function zt(t,e=!0){const i=localStorage.getItem(t),s=i?JSON.parse(i):{};return{get(n){return n?s[n]:s},set(n,o){return o?s[n]=o:delete s[n],e&&localStorage.setItem(t,JSON.stringify(s)),s}}}function Wt(t,e,i){const s=e.nodeType===Node.COMMENT_NODE,n=e.nodeType===Node.ELEMENT_NODE;if(e=s||n?e:document.querySelector(e),s&&(i="after"),!e)throw new Error(`Not a valid teleport reference: '${e}'`);if(typeof e[i]!="function")throw new Error(`Not a valid teleport method: '${i}'`);let o=null;return s||(o=document.createComment("teleported #"+t.id),t.before(o)),e[i](t),s&&e.remove(),o}function Be(t){const e={prefix:se("prefix-themes",{fallback:"vb-theme-"}),themes:["root","light","dark"],storeKey:"VB:Profile"};for(const[o]of Object.entries(e))t&&t[o]&&(e[o]=t[o]);const i={onInit(){},onChange(){}};for(const[o]of Object.entries(i))t&&t[o]&&(i[o]=t[o]);const s=zt(e.storeKey),n={settings:e,add(o){e.themes.push(o)},remove(o){const r=e.themes.indexOf(o);~r&&e.themes.splice(r,1)},callback(o){i[o].call(this)},get class(){return`${e.prefix}${this.theme}`},get classes(){return e.themes.map(o=>`${e.prefix}${o}`)},get themes(){return e.themes},get theme(){return s.get("theme")||"root"},set theme(o){e.themes.includes(o)?this.theme!=o&&(s.set("theme",o),document.documentElement.classList.remove(...this.classes),document.documentElement.classList.add(`${e.prefix}${o}`),this.callback("onChange")):console.error(`Not a valid theme value: "${o}"`)}};return n.callback("onInit"),n}const Ve=Object.freeze(Object.defineProperty({__proto__:null,Breakpoint:le,Collection:Rt,CollectionEntry:St,FocusTrap:_t,cssVar:se,getConfig:ne,getCustomProps:oe,getElement:re,getPrefix:Pt,lifecycleHook:k,localStore:zt,setGlobalState:vt,teleport:Wt,themeStore:Be,toCamel:A,toKebab:O,toMilliseconds:yt,transition:xt},Symbol.toStringTag,{value:"Module"})),He={dataOpen:"drawer-open",dataClose:"drawer-close",dataToggle:"drawer-toggle",dataBreakpoint:"drawer-breakpoint",selector:".drawer",selectorDialog:".drawer__dialog",selectorScreen:".drawer",selectorFocus:"[data-focus]",selectorInert:null,selectorOverflow:"body",stateOpened:"is-opened",stateOpening:"is-opening",stateClosing:"is-closing",stateClosed:"is-closed",classModal:"drawer_modal",breakpoints:null,customEventPrefix:"drawer:",store:!0,storeKey:"VB:DrawerState",setTabindex:!0,teleport:null,teleportMethod:"prepend",transition:!0,transitionDuration:"drawer-transition-duration"};function _e(t){t.store==="opened"?t.open(!1,!1):t.store==="closed"?t.close(!1,!1):t.store==="indeterminate"?t.state="indeterminate":t.el.classList.contains(t.getSetting("stateOpened"))?t.open(!1,!1):t.el.classList.contains(t.getSetting("stateClosed"))?t.close(!1,!1):t.state="indeterminate"}async function ze(t){t.store==="opened"?await t.open(!1,!1):t.store==="closed"?await t.close(!1,!1):t.store==="indeterminate"?t.state!="indeterminate"&&(t.state="indeterminate"):(t.state!=t.inlineState&&(t.state=t.inlineState),t.inlineState==="opened"?await t.open(!1,!1):t.inlineState==="closed"&&await t.close(!1,!1))}function We(t){const e=Pt(),i=t.getAttribute(`data-${this.settings.dataBreakpoint}`);return this.settings.breakpoints&&this.settings.breakpoints[i]?this.settings.breakpoints[i]:getComputedStyle(document.body).getPropertyValue(`--${e}breakpoint-${i}`).trim()?getComputedStyle(document.body).getPropertyValue(`--${e}breakpoint-${i}`).trim():i}function nt(t){const e=typeof t=="string"?this.get(t):t;if(e)return e;throw new Error(`Drawer not found in collection with id of "${t.id||t}".`)}function ae(t){t.state==="opened"?t.mode==="modal"?this.focusTrap.mount(t.dialog,this.settings.selectorFocus):this.focusTrap.focus(t.dialog,this.settings.selectorFocus):(t.trigger&&(t.trigger.focus(),t.trigger=null),this.focusTrap.unmount())}function je(t){switch(t.mode){case"inline":return Ue.call(this,t);case"modal":return Ke.call(this,t);default:throw new Error(`"${t.mode}" is not a valid drawer mode.`)}}async function Ue(t){return t.el.classList.remove(t.getSetting("classModal")),t.dialog.removeAttribute("aria-modal"),vt(!1,t.getSetting("selectorInert"),t.getSetting("selectorOverflow")),this.focusTrap.unmount(),await ze(t),t.el.dispatchEvent(new CustomEvent(t.getSetting("customEventPrefix")+"switchMode",{detail:this,bubbles:!0})),t}async function Ke(t){return t.el.classList.add(t.getSetting("classModal")),t.dialog.setAttribute("aria-modal","true"),await t.close(!1,!1),t.el.dispatchEvent(new CustomEvent(t.getSetting("customEventPrefix")+"switchMode",{detail:this,bubbles:!0})),t}class Xe extends St{constructor(i,s,n={}){super(i,s,n);L(this,ft);L(this,ut);L(this,dt);this.dialog=null,this.trigger=null,C(this,dt,new le),C(this,ft,"indeterminate"),C(this,ut,"indeterminate"),this.inlineState="indeterminate"}get breakpoint(){return We.call(this.context,this.el)}get store(){return this.context.store.get(this.id)}get mode(){return w(this,ft)}set mode(i){C(this,ft,i),je.call(this.context,this)}get state(){return w(this,ut)}set state(i){C(this,ut,i),this.mode==="inline"&&i!="opening"&&i!="closing"&&(this.inlineState=i,this.getSetting("store")&&this.context.store.set(this.id,i)),i==="indeterminate"&&(this.el.classList.remove(this.getSetting("stateOpened")),this.el.classList.remove(this.getSetting("stateOpening")),this.el.classList.remove(this.getSetting("stateClosed")),this.el.classList.remove(this.getSetting("stateClosing")))}async open(i,s){return this.context.open(this,i,s)}async close(i,s){return this.context.close(this,i,s)}async toggle(i,s){return this.context.toggle(this,i,s)}async deregister(){return this.context.deregister(this.id)}mountBreakpoint(){const i=this.breakpoint,s=this.handleBreakpoint.bind(this);w(this,dt).mount(i,s)}unmountBreakpoint(){w(this,dt).unmount()}handleBreakpoint(i){const s=i.matches?"inline":"modal";this.mode!=s&&(this.mode=s)}async beforeMount(){const i=this.el.querySelector(this.getSetting("selectorDialog"));this.dialog=i||this.el,this.getSetting("setTabindex")&&this.dialog.setAttribute("tabindex","-1"),_e(this),this.inlineState=this.state,this.mode=this.el.classList.contains(this.getSetting("classModal"))?"modal":"inline",this.breakpoint&&this.mountBreakpoint()}async beforeUnmount(i=!0){i&&this.state==="opened"&&await this.close(!1),this.context.store.set(this.id),this.unmountBreakpoint()}}ft=new WeakMap,ut=new WeakMap,dt=new WeakMap;async function Ye(t){const e=t.target.closest(`
|
|
2
2
|
[data-${this.settings.dataOpen}],
|
|
3
3
|
[data-${this.settings.dataToggle}],
|
|
4
4
|
[data-${this.settings.dataClose}]
|
|
5
|
-
`);if(e){t.preventDefault(),e.matches(`[data-${this.settings.dataToggle}]`)&&e.getAttribute(`data-${this.settings.dataToggle}`).trim().split(" ").forEach(s=>{const n=
|
|
5
|
+
`);if(e){t.preventDefault(),e.matches(`[data-${this.settings.dataToggle}]`)&&e.getAttribute(`data-${this.settings.dataToggle}`).trim().split(" ").forEach(s=>{const n=nt.call(this,s);return n.trigger=e,n.toggle()}),e.matches(`[data-${this.settings.dataOpen}]`)&&e.getAttribute(`data-${this.settings.dataOpen}`).trim().split(" ").forEach(s=>{const n=nt.call(this,s);return n.trigger=e,n.open()}),e.matches(`[data-${this.settings.dataClose}]`)&&e.getAttribute(`data-${this.settings.dataClose}`).trim().split(" ").forEach(s=>{if(s){const n=nt.call(this,s);return n.trigger=e,n.close()}else{const n=t.target.closest(this.settings.selector);if(n)return this.close(n.id)}});return}if(this.activeModal&&t.target.matches(this.settings.selectorScreen))return this.close(this.activeModal.id)}function Ge(t){if(t.key==="Escape"&&this.activeModal)return this.close(this.activeModal.id)}async function ce(t,e,i=!0){const s=nt.call(this,t);return(s.state==="closed"||s.state==="indeterminate")&&(s.state="opening",e??s.getSetting("transition")?await xt(s.el,s.getSetting("stateClosed"),s.getSetting("stateOpening"),s.getSetting("stateOpened"),s.getSetting("transitionDuration")):(s.el.classList.add(s.getSetting("stateOpened")),s.el.classList.remove(s.getSetting("stateClosed"))),s.state="opened",s.mode==="modal"&&vt(!0,s.getSetting("selectorInert"),s.getSetting("selectorOverflow")),i&&ae.call(this,s),s.el.dispatchEvent(new CustomEvent(s.getSetting("customEventPrefix")+"opened",{detail:this,bubbles:!0}))),s}async function fe(t,e,i=!0){const s=nt.call(this,t);return(s.state==="opened"||s.state==="indeterminate")&&(s.state="closing",document.activeElement.blur(),e??s.getSetting("transition")?await xt(s.el,s.getSetting("stateOpened"),s.getSetting("stateClosing"),s.getSetting("stateClosed"),s.getSetting("transitionDuration")):(s.el.classList.add(s.getSetting("stateClosed")),s.el.classList.remove(s.getSetting("stateOpened"))),s.state="closed",s.mode==="modal"&&vt(!1,s.getSetting("selectorInert"),s.getSetting("selectorOverflow")),i&&ae.call(this,s),s.el.dispatchEvent(new CustomEvent(s.getSetting("customEventPrefix")+"closed",{detail:this,bubbles:!0}))),s}async function Je(t,e,i){const s=nt.call(this,t);return s.state==="closed"?ce.call(this,s,e,i):fe.call(this,s,e,i)}class Ze extends Rt{constructor(i){super({...He,...i});L(this,ht);L(this,gt);this.focusTrap=new _t,C(this,ht,Ye.bind(this)),C(this,gt,Ge.bind(this)),this.store=zt(this.settings.storeKey,this.settings.store)}get activeModal(){return this.collection.find(i=>i.state==="opened"&&i.mode==="modal")}async createEntry(i,s){return new Xe(this,i,s)}async open(i,s,n){return ce.call(this,i,s,n)}async close(i,s,n){return fe.call(this,i,s,n)}async toggle(i,s,n){return Je.call(this,i,s,n)}async afterMount(){document.addEventListener("click",w(this,ht),!1),document.addEventListener("keydown",w(this,gt),!1)}async beforeUnmount(){this.trigger=null}async afterUnmount(){document.removeEventListener("click",w(this,ht),!1),document.removeEventListener("keydown",w(this,gt),!1)}}ht=new WeakMap,gt=new WeakMap;const Qe={dataOpen:"modal-open",dataClose:"modal-close",dataReplace:"modal-replace",selector:".modal",selectorDialog:".modal__dialog",selectorScreen:".modal",selectorRequired:'[role="alertdialog"]',selectorFocus:"[data-focus]",selectorInert:null,selectorOverflow:"body",stateOpened:"is-opened",stateOpening:"is-opening",stateClosing:"is-closing",stateClosed:"is-closed",customEventPrefix:"modal:",setTabindex:!0,teleport:null,teleportMethod:"append",transition:!0,transitionDuration:"modal-transition-duration"};class qe extends St{constructor(e,i,s={}){super(e,i,s),this.state="closed",this.dialog=null}get isRequired(){return this.dialog.matches(this.getSetting("selectorRequired"))}async open(e,i){return this.context.open(this,e,i)}async close(e,i){return this.context.close(this,e,i)}async replace(e,i){return this.context.replace(this,e,i)}async deregister(){return this.context.deregister(this.id)}async beforeMount(){const e=this.el.querySelector(this.getSetting("selectorDialog"));this.dialog=e||this.el,this.dialog.setAttribute("aria-modal","true"),this.dialog.hasAttribute("role")||this.dialog.setAttribute("role","dialog"),this.getSetting("setTabindex")&&this.dialog.setAttribute("tabindex","-1")}async afterRegister(){this.el.classList.contains(this.getSetting("stateOpened"))?await this.open(!1):(this.el.classList.remove(this.getSetting("stateOpening")),this.el.classList.remove(this.getSetting("stateClosing")),this.el.classList.add(this.getSetting("stateClosed")))}async beforeUnmount(e=!1){!e&&this.state==="opened"?await this.close(!1):this.context.stack.remove(this)}}function Ct(t){const e=typeof t=="string"?this.get(t):this.get(t.id);if(e)return e;throw new Error(`Modal not found in collection with id of "${t.id||t}".`)}function Dt(){this.active?this.focusTrap.mount(this.active.dialog,this.settings.selectorFocus):(this.trigger&&(this.trigger.focus(),this.trigger=null),this.focusTrap.unmount())}async function ti(t){const e=t.target.closest(`
|
|
6
6
|
[data-${this.settings.dataOpen}],
|
|
7
7
|
[data-${this.settings.dataReplace}],
|
|
8
8
|
[data-${this.settings.dataClose}]
|
|
9
|
-
`);if(e){if(t.preventDefault(),e.matches(`[data-${this.settings.dataOpen}]`)){const i=e.getAttribute(`data-${this.settings.dataOpen}`).trim(),s=Ot.call(this,i);return t.target.closest(this.settings.selectorModal)||(this.trigger=e),s.open()}if(e.matches(`[data-${this.settings.dataReplace}]`)){const i=e.getAttribute(`data-${this.settings.dataReplace}`).trim(),s=Ot.call(this,i);return t.target.closest(this.settings.selectorModal)||(this.trigger=e),s.replace()}if(e.matches(`[data-${this.settings.dataClose}]`)){const i=e.getAttribute(`data-${this.settings.dataClose}`).trim();return i==="*"?this.closeAll():this.close(i)}}if(this.active&&t.target.matches(this.settings.selectorScreen)&&!this.active.required)return this.close(this.active.id)}function $i(t){if(t.key==="Escape"&&this.active&&!this.active.dialog.matches(this.settings.selectorRequired))return this.close()}async function Jt(t,e=!0){const i=this.collection.findIndex(s=>s.id===t.id);if(i>=0){const s=this.collection[i];e&&s.state==="opened"?await s.close(!1):this.stack.remove(s),s.getSetting("teleport")&&s.teleportReturn(),Object.getOwnPropertyNames(s).forEach(n=>{delete s[n]}),this.collection.splice(i,1)}return this.collection}async function Qt(t,e,i=!0){const s=Ot.call(this,t),n={...this.settings,...s.settings};return e!==void 0&&(n.transition=e),this.stack.moveToTop(s),s.state==="closed"&&(s.state="opening",this.stack.add(s),n.transition?await xt(s.el,{start:n.stateClosing,finish:n.stateClosed},{start:n.stateOpening,finish:n.stateOpened},n.transitionDuration):(s.el.classList.add(n.stateOpened),s.el.classList.remove(n.stateClosed)),s.state="opened"),i&&Rt.call(this),s.el.dispatchEvent(new CustomEvent(n.customEventPrefix+"opened",{detail:this,bubbles:!0})),s}async function Zt(t,e,i=!0){const s=t?Ot.call(this,t):this.active;if(s&&s.state==="opened"){s.state="closing";const n={...this.settings,...s.settings};e!==void 0&&(n.transition=e),document.activeElement.blur(),n.transition?await xt(s.el,{start:n.stateOpening,finish:n.stateOpened},{start:n.stateClosing,finish:n.stateClosed},n.transitionDuration):(s.el.classList.add(n.stateClosed),s.el.classList.remove(n.stateOpened)),this.stack.remove(s),s.state="closed",i&&Rt.call(this),s.el.dispatchEvent(new CustomEvent(n.customEventPrefix+"closed",{detail:this,bubbles:!0}))}return s}async function te(t,e){const i=[];return await Promise.all(this.stack.value.map(async s=>{t&&t===s.id?Promise.resolve():i.push(await Zt.call(this,s,e,!1)),s.trigger=null})),i}async function we(t,e,i=!0){const s=Ot.call(this,t);let n,r;return s.state==="opened"?(n=s,r=await te.call(this,s.id,e)):(r=te.call(this,!1,e),n=Qt.call(this,s,e,!1),await Promise.all([n,r])),i&&Rt.call(this),{opened:n,closed:r}}async function Li(t,e={}){await Jt.call(this,t,!1);const i=this,s={id:t.id,state:"closed",el:t,dialog:null,get required(){return this.dialog.matches(this.getSetting("selectorRequired"))},returnRef:null,settings:{...Xt(t,this.settings.dataConfig),...e},open(r,a){return Qt.call(i,this,r,a)},close(r,a){return Zt.call(i,this,r,a)},replace(r,a){return we.call(i,this,r,a)},deregister(){return Jt.call(i,this)},teleport(r=this.getSetting("teleport"),a=this.getSetting("teleportMethod")){return this.returnRef?(console.error("Element has already been teleported:",this.el),!1):(this.returnRef=qt(this.el,r,a),this.el)},teleportReturn(){return this.returnRef?(this.returnRef=qt(this.el,this.returnRef),this.el):(console.error("No return reference found:",this.el),!1)},getSetting(r){return r in this.settings?this.settings[r]:i.settings[r]}},n=t.querySelector(s.getSetting("selectorDialog"));return s.dialog=n||t,s.dialog.setAttribute("aria-modal","true"),s.dialog.hasAttribute("role")||s.dialog.setAttribute("role","dialog"),s.getSetting("setTabindex")&&s.dialog.setAttribute("tabindex","-1"),s.getSetting("teleport")&&s.teleport(),this.collection.push(s),s.el.classList.contains(this.settings.stateOpened)?await s.open(!1):(s.el.classList.remove(this.settings.stateOpening),s.el.classList.remove(this.settings.stateClosing),s.el.classList.add(this.settings.stateClosed)),s}function Ci(t){const e=[];return{get value(){return[...e]},get top(){return e[e.length-1]},updateIndex(){e.forEach((i,s)=>{i.el.style.zIndex=null;const n=getComputedStyle(i.el)["z-index"];i.el.style.zIndex=parseInt(n)+s+1})},updateGlobalState(){Et(this.top,t),this.updateIndex()},add(i){i.el.style.zIndex=null;const s=getComputedStyle(i.el)["z-index"];i.el.style.zIndex=parseInt(s)+e.length+1,e.push(i),this.updateGlobalState()},remove(i){const s=e.findIndex(n=>n.id===i.id);s>=0&&(i.el.style.zIndex=null,e.splice(s,1),this.updateGlobalState())},moveToTop(i){const s=e.findIndex(n=>n.id===i.id);s>=0&&(e.splice(s,1),this.add(i))}}}class ki extends P{constructor(i){super();q(this,vt);q(this,mt);this.defaults=Ei,this.settings={...this.defaults,...i},this.trigger=null,this.focusTrap=new at,this.stack=Ci(this.settings),N(this,vt,Oi.bind(this)),N(this,mt,$i.bind(this)),this.settings.autoMount&&this.mount()}get active(){return this.stack.top}async mount(i){i&&(this.settings={...this.settings,...i});const s=document.querySelectorAll(this.settings.selectorModal);return await this.registerCollection(s),this.settings.eventListeners&&this.mountEventListeners(),this}async unmount(){return this.trigger=null,await this.deregisterCollection(),this.settings.eventListeners&&this.unmountEventListeners(),this}mountEventListeners(){document.addEventListener("click",E(this,vt),!1),document.addEventListener("keydown",E(this,mt),!1)}unmountEventListeners(){document.removeEventListener("click",E(this,vt),!1),document.removeEventListener("keydown",E(this,mt),!1)}register(i,s={}){let n=typeof i=="string"?document.getElementById(i):i;return n?Li.call(this,n,s):Promise.reject(new Error(`Failed to register; modal not found with ID of: "${i.id||i}".`))}deregister(i){let s=this.get(i.id||i);return s?Jt.call(this,s):Promise.reject(new Error(`Failed to deregister; modal does not exist in collection with ID of: "${i.id||i}".`))}open(i,s,n){return Qt.call(this,i,s,n)}close(i,s,n){return Zt.call(this,i,s,n)}replace(i,s,n){return we.call(this,i,s,n)}async closeAll(i=!1,s,n=!0){const r=await te.call(this,i,s);return n&&Rt.call(this),r}}vt=new WeakMap,mt=new WeakMap;const Si={autoMount:!1,selectorPopover:".popover",selectorTooltip:".popover_tooltip",selectorArrow:".popover__arrow",stateActive:"is-active",eventListeners:!0,eventType:"click",placement:"bottom",hoverToggleDelay:0};function ye(t,e){const i=getComputedStyle(t),s={placement:e.placement,event:e.eventType,offset:0,"overflow-padding":0,"flip-padding":0,"arrow-element":e.selectorArrow,"arrow-padding":0,"toggle-delay":e.hoverToggleDelay};for(const n in s){const r=Mt(),a=i.getPropertyValue(`--${r}popover-${n}`).trim();a&&(s[n]=a)}return s}function ee(t){let e;const i=typeof t=="string"?t.trim().split(" "):[t];switch(i.forEach(function(s,n){i[n]=parseInt(s,10)}),i.length){case 1:e=i[0];break;case 2:e={top:i[0],right:i[1],bottom:i[0],left:i[1]};break;case 3:e={top:i[0],right:i[1],bottom:i[2],left:i[1]};break;case 4:e={top:i[0],right:i[1],bottom:i[2],left:i[3]};break;default:e=!1;break}return e}function xe(t){return[{name:"offset",options:{offset:[0,parseInt(t.offset,10)]}},{name:"preventOverflow",options:{padding:ee(t["overflow-padding"])}},{name:"flip",options:{padding:ee(t["flip-padding"])}},{name:"arrow",options:{element:t["arrow-element"],padding:ee(t["arrow-padding"])}}]}function Ee(t){const e=typeof t=="string"?this.get(t):this.get(t.id);if(e)return e;throw new Error(`Popover not found in collection with id of "${t}".`)}function Ai(t){return typeof t=="string"?t:typeof t.hasAttribute=="function"?t.closest(this.settings.selectorPopover)?(t=t.closest(this.settings.selectorPopover),t.id):t.hasAttribute("aria-controls")?t.getAttribute("aria-controls"):t.hasAttribute("aria-describedby")?t.getAttribute("aria-describedby"):!1:!1}function Ti(t){const e=Ai.call(this,t);if(e){const i=document.querySelector(`#${e}`),s=document.querySelector(`[aria-controls="${e}"]`)||document.querySelector(`[aria-describedby="${e}"]`);return!s&&!i?{error:new Error(`No popover elements found using the ID: "${e}".`)}:s?i?{popover:i,trigger:s}:{error:new Error(`No popover associated with the provided popover trigger: "${e}".`)}:{error:new Error(`No popover trigger associated with the provided popover: "${e}".`)}}else return{error:new Error("Could not resolve the popover ID.")}}async function ie(t){const e=t?Ee.call(this,t):await Oe.call(this);return e&&e.state==="opened"&&(e.el.inert=!0,e.el.classList.remove(this.settings.stateActive),e.isTooltip||e.trigger.setAttribute("aria-expanded","false"),e.popper.setOptions({placement:e.config.placement,modifiers:[{name:"eventListeners",enabled:!1},...xe(e.config)]}),e.state="closed",e.trigger===this.trigger&&(this.trigger=null)),e}async function Oe(){const t=[];return await Promise.all(this.collection.map(async e=>{e.state==="opened"&&t.push(await ie.call(this,e))})),t}function $e(t){t.state=="opened"&&setTimeout(()=>{const e=t.el.matches(":hover")===t.el||t.trigger.matches(":hover")===t.trigger;let i=document.activeElement.closest(`#${t.id}, [aria-controls="${t.id}"], [aria-describedby="${t.id}"]`);return i=i?i.matches(":focus-visible"):!1,!e&&!i&&t.close(),t},1)}function Pi(t){const e=t.trigger.getAttribute("aria-describedby");if(e){const i=this.get(e);i.isTooltip&&(i.toggleDelayId&&clearTimeout(i.toggleDelayId),i.close())}t.state==="opened"?t.close():(this.trigger=t.trigger,t.open(),Le.call(this,t))}function Di(t,e){if(e.type=="focus"&&!t.trigger.matches(":focus-visible"))return;const i=t.trigger.getAttribute("aria-expanded");if(i&&i=="true")return;t.toggleDelayId&&clearTimeout(t.toggleDelayId);const s=this.activeTooltip?0:t.config["toggle-delay"];this.activeTooltip&&this.activeTooltip.close(),t.toggleDelayId=setTimeout(()=>{t.id&&t.open()},s)}function Mi(t){t.toggleDelayId&&clearTimeout(t.toggleDelayId),t.toggleDelayId=setTimeout(()=>{$e.call(this,t)},t.config["toggle-delay"])}function Ii(t){switch(t.key){case"Escape":this.trigger&&this.trigger.focus(),Oe.call(this);return;case"Tab":this.collection.forEach(e=>{$e.call(this,e)});return;default:return}}function Le(t){const e=this;document.addEventListener("click",function i(s){s.target.closest(`#${t.id}, [aria-controls="${t.id}"], [aria-describedby="${t.id}"]`)?t.el&&!t.el.classList.contains(e.settings.stateActive)&&this.removeEventListener("click",i):(t.el&&t.el.classList.contains(e.settings.stateActive)&&t.close(),this.removeEventListener("click",i))})}var M="top",V="bottom",W="right",I="left",se="auto",$t=[M,V,W,I],ct="start",Lt="end",Ri="clippingParents",Ce="viewport",Ct="popper",Bi="reference",ke=$t.reduce(function(t,e){return t.concat([e+"-"+ct,e+"-"+Lt])},[]),Se=[].concat($t,[se]).reduce(function(t,e){return t.concat([e,e+"-"+ct,e+"-"+Lt])},[]),ji="beforeRead",Fi="read",Ni="afterRead",Vi="beforeMain",Wi="main",Hi="afterMain",_i="beforeWrite",zi="write",Ki="afterWrite",Xi=[ji,Fi,Ni,Vi,Wi,Hi,_i,zi,Ki];function X(t){return t?(t.nodeName||"").toLowerCase():null}function j(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Q(t){var e=j(t).Element;return t instanceof e||t instanceof Element}function H(t){var e=j(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function ne(t){if(typeof ShadowRoot>"u")return!1;var e=j(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Yi(t){var e=t.state;Object.keys(e.elements).forEach(function(i){var s=e.styles[i]||{},n=e.attributes[i]||{},r=e.elements[i];!H(r)||!X(r)||(Object.assign(r.style,s),Object.keys(n).forEach(function(a){var l=n[a];l===!1?r.removeAttribute(a):r.setAttribute(a,l===!0?"":l)}))})}function qi(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach(function(s){var n=e.elements[s],r=e.attributes[s]||{},a=Object.keys(e.styles.hasOwnProperty(s)?e.styles[s]:i[s]),l=a.reduce(function(o,f){return o[f]="",o},{});!H(n)||!X(n)||(Object.assign(n.style,l),Object.keys(r).forEach(function(o){n.removeAttribute(o)}))})}}const Ui={name:"applyStyles",enabled:!0,phase:"write",fn:Yi,effect:qi,requires:["computeStyles"]};function Y(t){return t.split("-")[0]}var Z=Math.max,Bt=Math.min,ft=Math.round;function re(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Ae(){return!/^((?!chrome|android).)*safari/i.test(re())}function ut(t,e,i){e===void 0&&(e=!1),i===void 0&&(i=!1);var s=t.getBoundingClientRect(),n=1,r=1;e&&H(t)&&(n=t.offsetWidth>0&&ft(s.width)/t.offsetWidth||1,r=t.offsetHeight>0&&ft(s.height)/t.offsetHeight||1);var a=Q(t)?j(t):window,l=a.visualViewport,o=!Ae()&&i,f=(s.left+(o&&l?l.offsetLeft:0))/n,c=(s.top+(o&&l?l.offsetTop:0))/r,g=s.width/n,b=s.height/r;return{width:g,height:b,top:c,right:f+g,bottom:c+b,left:f,x:f,y:c}}function oe(t){var e=ut(t),i=t.offsetWidth,s=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-s)<=1&&(s=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:s}}function Te(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&ne(i)){var s=e;do{if(s&&t.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function U(t){return j(t).getComputedStyle(t)}function Gi(t){return["table","td","th"].indexOf(X(t))>=0}function G(t){return((Q(t)?t.ownerDocument:t.document)||window.document).documentElement}function jt(t){return X(t)==="html"?t:t.assignedSlot||t.parentNode||(ne(t)?t.host:null)||G(t)}function Pe(t){return!H(t)||U(t).position==="fixed"?null:t.offsetParent}function Ji(t){var e=/firefox/i.test(re()),i=/Trident/i.test(re());if(i&&H(t)){var s=U(t);if(s.position==="fixed")return null}var n=jt(t);for(ne(n)&&(n=n.host);H(n)&&["html","body"].indexOf(X(n))<0;){var r=U(n);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||e&&r.willChange==="filter"||e&&r.filter&&r.filter!=="none")return n;n=n.parentNode}return null}function kt(t){for(var e=j(t),i=Pe(t);i&&Gi(i)&&U(i).position==="static";)i=Pe(i);return i&&(X(i)==="html"||X(i)==="body"&&U(i).position==="static")?e:i||Ji(t)||e}function ae(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function St(t,e,i){return Z(t,Bt(e,i))}function Qi(t,e,i){var s=St(t,e,i);return s>i?i:s}function De(){return{top:0,right:0,bottom:0,left:0}}function Me(t){return Object.assign({},De(),t)}function Ie(t,e){return e.reduce(function(i,s){return i[s]=t,i},{})}var Zi=function(e,i){return e=typeof e=="function"?e(Object.assign({},i.rects,{placement:i.placement})):e,Me(typeof e!="number"?e:Ie(e,$t))};function ts(t){var e,i=t.state,s=t.name,n=t.options,r=i.elements.arrow,a=i.modifiersData.popperOffsets,l=Y(i.placement),o=ae(l),f=[I,W].indexOf(l)>=0,c=f?"height":"width";if(!(!r||!a)){var g=Zi(n.padding,i),b=oe(r),u=o==="y"?M:I,x=o==="y"?V:W,p=i.rects.reference[c]+i.rects.reference[o]-a[o]-i.rects.popper[c],h=a[o]-i.rects.reference[o],y=kt(r),$=y?o==="y"?y.clientHeight||0:y.clientWidth||0:0,L=p/2-h/2,d=g[u],v=$-b[c]-g[x],m=$/2-b[c]/2+L,O=St(d,m,v),A=o;i.modifiersData[s]=(e={},e[A]=O,e.centerOffset=O-m,e)}}function es(t){var e=t.state,i=t.options,s=i.element,n=s===void 0?"[data-popper-arrow]":s;n!=null&&(typeof n=="string"&&(n=e.elements.popper.querySelector(n),!n)||Te(e.elements.popper,n)&&(e.elements.arrow=n))}const is={name:"arrow",enabled:!0,phase:"main",fn:ts,effect:es,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function dt(t){return t.split("-")[1]}var ss={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ns(t,e){var i=t.x,s=t.y,n=e.devicePixelRatio||1;return{x:ft(i*n)/n||0,y:ft(s*n)/n||0}}function Re(t){var e,i=t.popper,s=t.popperRect,n=t.placement,r=t.variation,a=t.offsets,l=t.position,o=t.gpuAcceleration,f=t.adaptive,c=t.roundOffsets,g=t.isFixed,b=a.x,u=b===void 0?0:b,x=a.y,p=x===void 0?0:x,h=typeof c=="function"?c({x:u,y:p}):{x:u,y:p};u=h.x,p=h.y;var y=a.hasOwnProperty("x"),$=a.hasOwnProperty("y"),L=I,d=M,v=window;if(f){var m=kt(i),O="clientHeight",A="clientWidth";if(m===j(i)&&(m=G(i),U(m).position!=="static"&&l==="absolute"&&(O="scrollHeight",A="scrollWidth")),m=m,n===M||(n===I||n===W)&&r===Lt){d=V;var S=g&&m===v&&v.visualViewport?v.visualViewport.height:m[O];p-=S-s.height,p*=o?1:-1}if(n===I||(n===M||n===V)&&r===Lt){L=W;var k=g&&m===v&&v.visualViewport?v.visualViewport.width:m[A];u-=k-s.width,u*=o?1:-1}}var T=Object.assign({position:l},f&&ss),z=c===!0?ns({x:u,y:p},j(i)):{x:u,y:p};if(u=z.x,p=z.y,o){var D;return Object.assign({},T,(D={},D[d]=$?"0":"",D[L]=y?"0":"",D.transform=(v.devicePixelRatio||1)<=1?"translate("+u+"px, "+p+"px)":"translate3d("+u+"px, "+p+"px, 0)",D))}return Object.assign({},T,(e={},e[d]=$?p+"px":"",e[L]=y?u+"px":"",e.transform="",e))}function rs(t){var e=t.state,i=t.options,s=i.gpuAcceleration,n=s===void 0?!0:s,r=i.adaptive,a=r===void 0?!0:r,l=i.roundOffsets,o=l===void 0?!0:l,f={placement:Y(e.placement),variation:dt(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:n,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Re(Object.assign({},f,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:o})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Re(Object.assign({},f,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:o})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const os={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:rs,data:{}};var Ft={passive:!0};function as(t){var e=t.state,i=t.instance,s=t.options,n=s.scroll,r=n===void 0?!0:n,a=s.resize,l=a===void 0?!0:a,o=j(e.elements.popper),f=[].concat(e.scrollParents.reference,e.scrollParents.popper);return r&&f.forEach(function(c){c.addEventListener("scroll",i.update,Ft)}),l&&o.addEventListener("resize",i.update,Ft),function(){r&&f.forEach(function(c){c.removeEventListener("scroll",i.update,Ft)}),l&&o.removeEventListener("resize",i.update,Ft)}}const ls={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:as,data:{}};var cs={left:"right",right:"left",bottom:"top",top:"bottom"};function Nt(t){return t.replace(/left|right|bottom|top/g,function(e){return cs[e]})}var fs={start:"end",end:"start"};function Be(t){return t.replace(/start|end/g,function(e){return fs[e]})}function le(t){var e=j(t),i=e.pageXOffset,s=e.pageYOffset;return{scrollLeft:i,scrollTop:s}}function ce(t){return ut(G(t)).left+le(t).scrollLeft}function us(t,e){var i=j(t),s=G(t),n=i.visualViewport,r=s.clientWidth,a=s.clientHeight,l=0,o=0;if(n){r=n.width,a=n.height;var f=Ae();(f||!f&&e==="fixed")&&(l=n.offsetLeft,o=n.offsetTop)}return{width:r,height:a,x:l+ce(t),y:o}}function ds(t){var e,i=G(t),s=le(t),n=(e=t.ownerDocument)==null?void 0:e.body,r=Z(i.scrollWidth,i.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),a=Z(i.scrollHeight,i.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),l=-s.scrollLeft+ce(t),o=-s.scrollTop;return U(n||i).direction==="rtl"&&(l+=Z(i.clientWidth,n?n.clientWidth:0)-r),{width:r,height:a,x:l,y:o}}function fe(t){var e=U(t),i=e.overflow,s=e.overflowX,n=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+n+s)}function je(t){return["html","body","#document"].indexOf(X(t))>=0?t.ownerDocument.body:H(t)&&fe(t)?t:je(jt(t))}function At(t,e){var i;e===void 0&&(e=[]);var s=je(t),n=s===((i=t.ownerDocument)==null?void 0:i.body),r=j(s),a=n?[r].concat(r.visualViewport||[],fe(s)?s:[]):s,l=e.concat(a);return n?l:l.concat(At(jt(a)))}function ue(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function hs(t,e){var i=ut(t,!1,e==="fixed");return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}function Fe(t,e,i){return e===Ce?ue(us(t,i)):Q(e)?hs(e,i):ue(ds(G(t)))}function ps(t){var e=At(jt(t)),i=["absolute","fixed"].indexOf(U(t).position)>=0,s=i&&H(t)?kt(t):t;return Q(s)?e.filter(function(n){return Q(n)&&Te(n,s)&&X(n)!=="body"}):[]}function gs(t,e,i,s){var n=e==="clippingParents"?ps(t):[].concat(e),r=[].concat(n,[i]),a=r[0],l=r.reduce(function(o,f){var c=Fe(t,f,s);return o.top=Z(c.top,o.top),o.right=Bt(c.right,o.right),o.bottom=Bt(c.bottom,o.bottom),o.left=Z(c.left,o.left),o},Fe(t,a,s));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function Ne(t){var e=t.reference,i=t.element,s=t.placement,n=s?Y(s):null,r=s?dt(s):null,a=e.x+e.width/2-i.width/2,l=e.y+e.height/2-i.height/2,o;switch(n){case M:o={x:a,y:e.y-i.height};break;case V:o={x:a,y:e.y+e.height};break;case W:o={x:e.x+e.width,y:l};break;case I:o={x:e.x-i.width,y:l};break;default:o={x:e.x,y:e.y}}var f=n?ae(n):null;if(f!=null){var c=f==="y"?"height":"width";switch(r){case ct:o[f]=o[f]-(e[c]/2-i[c]/2);break;case Lt:o[f]=o[f]+(e[c]/2-i[c]/2);break}}return o}function Tt(t,e){e===void 0&&(e={});var i=e,s=i.placement,n=s===void 0?t.placement:s,r=i.strategy,a=r===void 0?t.strategy:r,l=i.boundary,o=l===void 0?Ri:l,f=i.rootBoundary,c=f===void 0?Ce:f,g=i.elementContext,b=g===void 0?Ct:g,u=i.altBoundary,x=u===void 0?!1:u,p=i.padding,h=p===void 0?0:p,y=Me(typeof h!="number"?h:Ie(h,$t)),$=b===Ct?Bi:Ct,L=t.rects.popper,d=t.elements[x?$:b],v=gs(Q(d)?d:d.contextElement||G(t.elements.popper),o,c,a),m=ut(t.elements.reference),O=Ne({reference:m,element:L,strategy:"absolute",placement:n}),A=ue(Object.assign({},L,O)),S=b===Ct?A:m,k={top:v.top-S.top+y.top,bottom:S.bottom-v.bottom+y.bottom,left:v.left-S.left+y.left,right:S.right-v.right+y.right},T=t.modifiersData.offset;if(b===Ct&&T){var z=T[n];Object.keys(k).forEach(function(D){var it=[W,V].indexOf(D)>=0?1:-1,st=[M,V].indexOf(D)>=0?"y":"x";k[D]+=z[st]*it})}return k}function vs(t,e){e===void 0&&(e={});var i=e,s=i.placement,n=i.boundary,r=i.rootBoundary,a=i.padding,l=i.flipVariations,o=i.allowedAutoPlacements,f=o===void 0?Se:o,c=dt(s),g=c?l?ke:ke.filter(function(x){return dt(x)===c}):$t,b=g.filter(function(x){return f.indexOf(x)>=0});b.length===0&&(b=g);var u=b.reduce(function(x,p){return x[p]=Tt(t,{placement:p,boundary:n,rootBoundary:r,padding:a})[Y(p)],x},{});return Object.keys(u).sort(function(x,p){return u[x]-u[p]})}function ms(t){if(Y(t)===se)return[];var e=Nt(t);return[Be(t),e,Be(e)]}function bs(t){var e=t.state,i=t.options,s=t.name;if(!e.modifiersData[s]._skip){for(var n=i.mainAxis,r=n===void 0?!0:n,a=i.altAxis,l=a===void 0?!0:a,o=i.fallbackPlacements,f=i.padding,c=i.boundary,g=i.rootBoundary,b=i.altBoundary,u=i.flipVariations,x=u===void 0?!0:u,p=i.allowedAutoPlacements,h=e.options.placement,y=Y(h),$=y===h,L=o||($||!x?[Nt(h)]:ms(h)),d=[h].concat(L).reduce(function(wt,J){return wt.concat(Y(J)===se?vs(e,{placement:J,boundary:c,rootBoundary:g,padding:f,flipVariations:x,allowedAutoPlacements:p}):J)},[]),v=e.rects.reference,m=e.rects.popper,O=new Map,A=!0,S=d[0],k=0;k<d.length;k++){var T=d[k],z=Y(T),D=dt(T)===ct,it=[M,V].indexOf(z)>=0,st=it?"width":"height",F=Tt(e,{placement:T,boundary:c,rootBoundary:g,altBoundary:b,padding:f}),K=it?D?W:I:D?V:M;v[st]>m[st]&&(K=Nt(K));var Vt=Nt(K),nt=[];if(r&&nt.push(F[z]<=0),l&&nt.push(F[K]<=0,F[Vt]<=0),nt.every(function(wt){return wt})){S=T,A=!1;break}O.set(T,nt)}if(A)for(var Wt=x?3:1,he=function(J){var Dt=d.find(function(_t){var rt=O.get(_t);if(rt)return rt.slice(0,J).every(function(pe){return pe})});if(Dt)return S=Dt,"break"},Pt=Wt;Pt>0;Pt--){var Ht=he(Pt);if(Ht==="break")break}e.placement!==S&&(e.modifiersData[s]._skip=!0,e.placement=S,e.reset=!0)}}const ws={name:"flip",enabled:!0,phase:"main",fn:bs,requiresIfExists:["offset"],data:{_skip:!1}};function Ve(t,e,i){return i===void 0&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function We(t){return[M,W,V,I].some(function(e){return t[e]>=0})}function ys(t){var e=t.state,i=t.name,s=e.rects.reference,n=e.rects.popper,r=e.modifiersData.preventOverflow,a=Tt(e,{elementContext:"reference"}),l=Tt(e,{altBoundary:!0}),o=Ve(a,s),f=Ve(l,n,r),c=We(o),g=We(f);e.modifiersData[i]={referenceClippingOffsets:o,popperEscapeOffsets:f,isReferenceHidden:c,hasPopperEscaped:g},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":g})}const xs={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:ys};function Es(t,e,i){var s=Y(t),n=[I,M].indexOf(s)>=0?-1:1,r=typeof i=="function"?i(Object.assign({},e,{placement:t})):i,a=r[0],l=r[1];return a=a||0,l=(l||0)*n,[I,W].indexOf(s)>=0?{x:l,y:a}:{x:a,y:l}}function Os(t){var e=t.state,i=t.options,s=t.name,n=i.offset,r=n===void 0?[0,0]:n,a=Se.reduce(function(c,g){return c[g]=Es(g,e.rects,r),c},{}),l=a[e.placement],o=l.x,f=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=o,e.modifiersData.popperOffsets.y+=f),e.modifiersData[s]=a}const $s={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Os};function Ls(t){var e=t.state,i=t.name;e.modifiersData[i]=Ne({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const Cs={name:"popperOffsets",enabled:!0,phase:"read",fn:Ls,data:{}};function ks(t){return t==="x"?"y":"x"}function Ss(t){var e=t.state,i=t.options,s=t.name,n=i.mainAxis,r=n===void 0?!0:n,a=i.altAxis,l=a===void 0?!1:a,o=i.boundary,f=i.rootBoundary,c=i.altBoundary,g=i.padding,b=i.tether,u=b===void 0?!0:b,x=i.tetherOffset,p=x===void 0?0:x,h=Tt(e,{boundary:o,rootBoundary:f,padding:g,altBoundary:c}),y=Y(e.placement),$=dt(e.placement),L=!$,d=ae(y),v=ks(d),m=e.modifiersData.popperOffsets,O=e.rects.reference,A=e.rects.popper,S=typeof p=="function"?p(Object.assign({},e.rects,{placement:e.placement})):p,k=typeof S=="number"?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),T=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,z={x:0,y:0};if(m){if(r){var D,it=d==="y"?M:I,st=d==="y"?V:W,F=d==="y"?"height":"width",K=m[d],Vt=K+h[it],nt=K-h[st],Wt=u?-A[F]/2:0,he=$===ct?O[F]:A[F],Pt=$===ct?-A[F]:-O[F],Ht=e.elements.arrow,wt=u&&Ht?oe(Ht):{width:0,height:0},J=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:De(),Dt=J[it],_t=J[st],rt=St(0,O[F],wt[F]),pe=L?O[F]/2-Wt-rt-Dt-k.mainAxis:he-rt-Dt-k.mainAxis,_s=L?-O[F]/2+Wt+rt+_t+k.mainAxis:Pt+rt+_t+k.mainAxis,ge=e.elements.arrow&&kt(e.elements.arrow),zs=ge?d==="y"?ge.clientTop||0:ge.clientLeft||0:0,Ye=(D=T==null?void 0:T[d])!=null?D:0,Ks=K+pe-Ye-zs,Xs=K+_s-Ye,qe=St(u?Bt(Vt,Ks):Vt,K,u?Z(nt,Xs):nt);m[d]=qe,z[d]=qe-K}if(l){var Ue,Ys=d==="x"?M:I,qs=d==="x"?V:W,ot=m[v],zt=v==="y"?"height":"width",Ge=ot+h[Ys],Je=ot-h[qs],ve=[M,I].indexOf(y)!==-1,Qe=(Ue=T==null?void 0:T[v])!=null?Ue:0,Ze=ve?Ge:ot-O[zt]-A[zt]-Qe+k.altAxis,ti=ve?ot+O[zt]+A[zt]-Qe-k.altAxis:Je,ei=u&&ve?Qi(Ze,ot,ti):St(u?Ze:Ge,ot,u?ti:Je);m[v]=ei,z[v]=ei-ot}e.modifiersData[s]=z}}const As={name:"preventOverflow",enabled:!0,phase:"main",fn:Ss,requiresIfExists:["offset"]};function Ts(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Ps(t){return t===j(t)||!H(t)?le(t):Ts(t)}function Ds(t){var e=t.getBoundingClientRect(),i=ft(e.width)/t.offsetWidth||1,s=ft(e.height)/t.offsetHeight||1;return i!==1||s!==1}function Ms(t,e,i){i===void 0&&(i=!1);var s=H(e),n=H(e)&&Ds(e),r=G(e),a=ut(t,n,i),l={scrollLeft:0,scrollTop:0},o={x:0,y:0};return(s||!s&&!i)&&((X(e)!=="body"||fe(r))&&(l=Ps(e)),H(e)?(o=ut(e,!0),o.x+=e.clientLeft,o.y+=e.clientTop):r&&(o.x=ce(r))),{x:a.left+l.scrollLeft-o.x,y:a.top+l.scrollTop-o.y,width:a.width,height:a.height}}function Is(t){var e=new Map,i=new Set,s=[];t.forEach(function(r){e.set(r.name,r)});function n(r){i.add(r.name);var a=[].concat(r.requires||[],r.requiresIfExists||[]);a.forEach(function(l){if(!i.has(l)){var o=e.get(l);o&&n(o)}}),s.push(r)}return t.forEach(function(r){i.has(r.name)||n(r)}),s}function Rs(t){var e=Is(t);return Xi.reduce(function(i,s){return i.concat(e.filter(function(n){return n.phase===s}))},[])}function Bs(t){var e;return function(){return e||(e=new Promise(function(i){Promise.resolve().then(function(){e=void 0,i(t())})})),e}}function js(t){var e=t.reduce(function(i,s){var n=i[s.name];return i[s.name]=n?Object.assign({},n,s,{options:Object.assign({},n.options,s.options),data:Object.assign({},n.data,s.data)}):s,i},{});return Object.keys(e).map(function(i){return e[i]})}var He={placement:"bottom",modifiers:[],strategy:"absolute"};function _e(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return!e.some(function(s){return!(s&&typeof s.getBoundingClientRect=="function")})}function Fs(t){t===void 0&&(t={});var e=t,i=e.defaultModifiers,s=i===void 0?[]:i,n=e.defaultOptions,r=n===void 0?He:n;return function(l,o,f){f===void 0&&(f=r);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},He,r),modifiersData:{},elements:{reference:l,popper:o},attributes:{},styles:{}},g=[],b=!1,u={state:c,setOptions:function(y){var $=typeof y=="function"?y(c.options):y;p(),c.options=Object.assign({},r,c.options,$),c.scrollParents={reference:Q(l)?At(l):l.contextElement?At(l.contextElement):[],popper:At(o)};var L=Rs(js([].concat(s,c.options.modifiers)));return c.orderedModifiers=L.filter(function(d){return d.enabled}),x(),u.update()},forceUpdate:function(){if(!b){var y=c.elements,$=y.reference,L=y.popper;if(_e($,L)){c.rects={reference:Ms($,kt(L),c.options.strategy==="fixed"),popper:oe(L)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(k){return c.modifiersData[k.name]=Object.assign({},k.data)});for(var d=0;d<c.orderedModifiers.length;d++){if(c.reset===!0){c.reset=!1,d=-1;continue}var v=c.orderedModifiers[d],m=v.fn,O=v.options,A=O===void 0?{}:O,S=v.name;typeof m=="function"&&(c=m({state:c,options:A,name:S,instance:u})||c)}}}},update:Bs(function(){return new Promise(function(h){u.forceUpdate(),h(c)})}),destroy:function(){p(),b=!0}};if(!_e(l,o))return u;u.setOptions(f).then(function(h){!b&&f.onFirstUpdate&&f.onFirstUpdate(h)});function x(){c.orderedModifiers.forEach(function(h){var y=h.name,$=h.options,L=$===void 0?{}:$,d=h.effect;if(typeof d=="function"){var v=d({state:c,name:y,instance:u,options:L}),m=function(){};g.push(v||m)}})}function p(){g.forEach(function(h){return h()}),g=[]}return u}}var Ns=[ls,Cs,os,Ui,$s,ws,As,is,xs],Vs=Fs({defaultModifiers:Ns});async function de(t){const e=this.collection.findIndex(i=>i.id===t.id);if(e>=0){const i=this.collection[e];i.state==="opened"&&i.close(),i.popper.destroy(),ze(i),Object.getOwnPropertyNames(i).forEach(s=>{delete i[s]}),this.collection.splice(e,1)}return this.collection}function ze(t){return t.__eventListeners&&(t.__eventListeners.forEach(e=>{e.el.forEach(i=>{e.type.forEach(s=>{t[i].removeEventListener(s,e.listener,!1)})})}),delete t.__eventListeners),t}async function Ke(t){const e=Ee.call(this,t);return e.el.inert=!1,e.el.classList.add(this.settings.stateActive),e.isTooltip||e.trigger.setAttribute("aria-expanded","true"),e.config=ye(e.el,this.settings),e.popper.setOptions({placement:e.config.placement,modifiers:[{name:"eventListeners",enabled:!0},...xe(e.config)]}),e.popper.update(),e.state="opened",e}async function Ws(t,e){de.call(this,t);const i=this,s={id:t.id,state:"closed",el:t,trigger:e,toggleDelayId:null,popper:Vs(e,t),config:ye(t,this.settings),get isTooltip(){return!!t.closest(i.settings.selectorTooltip)||t.getAttribute("role")=="tooltip"},open(){return Ke.call(i,this)},close(){return ie.call(i,this)},deregister(){return de.call(i,this)}};return s.isTooltip&&s.el.setAttribute("role","tooltip"),s.isTooltip||s.trigger.setAttribute("aria-expanded","false"),Xe.call(this,s),this.collection.push(s),s.el.classList.contains(this.settings.stateActive)?(await s.open(),Le.call(this,s)):s.el.inert=!0,s.popper.setOptions({placement:s.config.placement}),s}function Xe(t){return t.__eventListeners||((t.isTooltip?"hover":t.config.event)==="hover"?(t.__eventListeners=[{el:["trigger"],type:["mouseenter","focus"],listener:Di.bind(this,t)},{el:["el","trigger"],type:["mouseleave","focusout"],listener:Mi.bind(this,t)}],t.__eventListeners.forEach(i=>{i.el.forEach(s=>{i.type.forEach(n=>{t[s].addEventListener(n,i.listener,!1)})})})):(t.__eventListeners=[{el:["trigger"],type:["click"],listener:Pi.bind(this,t)}],t.__eventListeners.forEach(i=>{i.el.forEach(s=>{i.type.forEach(n=>{t[s].addEventListener(n,i.listener,!1)})})}))),t}class Hs extends P{constructor(i){super();q(this,bt);this.defaults=Si,this.settings={...this.defaults,...i},this.trigger=null,N(this,bt,Ii.bind(this)),this.settings.autoMount&&this.mount()}get active(){return this.collection.find(i=>i.state=="opened")}get activeTooltip(){return this.collection.find(i=>i.state=="opened"&&i.isTooltip)}async mount(i){i&&(this.settings={...this.settings,...i});const s=document.querySelectorAll(this.settings.selectorPopover);return await this.registerCollection(s),this.settings.eventListeners&&this.mountEventListeners(!1),this}async unmount(){return this.trigger=null,await this.deregisterCollection(),this.settings.eventListeners&&this.unmountEventListeners(!1),this}mountEventListeners(i=!0){i&&this.collection.forEach(s=>{Xe.call(this,s)}),document.addEventListener("keydown",E(this,bt),!1)}unmountEventListeners(i=!0){i&&this.collection.forEach(s=>{ze(s)}),document.removeEventListener("keydown",E(this,bt),!1)}register(i){const s=Ti.call(this,i);return s.error?Promise.reject(s.error):Ws.call(this,s.popover,s.trigger)}deregister(i){let s=this.get(i.id||i);return s?de.call(this,s):Promise.reject(new Error(`Failed to deregister; popover does not exist in collection with ID of: "${i.id||i}".`))}open(i){return Ke.call(this,i)}close(i){return ie.call(this,i)}}bt=new WeakMap,w.Drawer=xi,w.Modal=ki,w.Popover=Hs,w.core=fi,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});
|
|
9
|
+
`);if(e){if(t.preventDefault(),e.matches(`[data-${this.settings.dataOpen}]`)){const i=e.getAttribute(`data-${this.settings.dataOpen}`).trim(),s=Ct.call(this,i);return t.target.closest(this.settings.selector)||(this.trigger=e),s.open()}if(e.matches(`[data-${this.settings.dataReplace}]`)){const i=e.getAttribute(`data-${this.settings.dataReplace}`).trim(),s=Ct.call(this,i);return t.target.closest(this.settings.selector)||(this.trigger=e),s.replace()}if(e.matches(`[data-${this.settings.dataClose}]`)){const i=e.getAttribute(`data-${this.settings.dataClose}`).trim();return i==="*"?this.closeAll():this.close(i)}}if(this.active&&t.target.matches(this.settings.selectorScreen)&&!this.active.isRequired)return this.close(this.active.id)}function ei(t){if(t.key==="Escape"&&this.active&&!this.active.dialog.matches(this.settings.selectorRequired))return this.close()}async function ue(t,e=void 0,i=!0){const s=Ct.call(this,t);return this.stack.moveToTop(s),s.state==="closed"&&(s.state="opening",this.stack.add(s),e??s.getSetting("transition")?await xt(s.el,s.getSetting("stateClosed"),s.getSetting("stateOpening"),s.getSetting("stateOpened"),s.getSetting("transitionDuration")):(s.el.classList.add(s.getSetting("stateOpened")),s.el.classList.remove(s.getSetting("stateClosed"))),s.state="opened"),i&&Dt.call(this),s.el.dispatchEvent(new CustomEvent(s.getSetting("customEventPrefix")+"opened",{detail:this,bubbles:!0})),s}async function de(t,e,i=!0){const s=t?Ct.call(this,t):this.active;return s&&s.state==="opened"&&(s.state="closing",document.activeElement.blur(),e??s.getSetting("transition")?await xt(s.el,s.getSetting("stateOpened"),s.getSetting("stateClosing"),s.getSetting("stateClosed"),s.getSetting("transitionDuration")):(s.el.classList.add(s.getSetting("stateClosed")),s.el.classList.remove(s.getSetting("stateOpened"))),this.stack.remove(s),s.state="closed",i&&Dt.call(this),s.el.dispatchEvent(new CustomEvent(s.getSetting("customEventPrefix")+"closed",{detail:this,bubbles:!0}))),s}async function jt(t,e){const i=[];return await Promise.all(this.stack.value.map(async s=>{t&&t===s.id?Promise.resolve():i.push(await de.call(this,s,e,!1)),s.trigger=null})),i}async function ii(t,e,i=!0){const s=Ct.call(this,t);let n,o;return s.state==="opened"?(n=s,o=await jt.call(this,s.id,e)):(o=jt.call(this,!1,e),n=ue.call(this,s,e,!1),await Promise.all([n,o])),i&&Dt.call(this),{opened:n,closed:o}}function si(t){const e=[];return{get value(){return[...e]},get top(){const i=e[e.length-1];return i||null},updateIndex(){e.forEach((i,s)=>{i.el.style.zIndex=null;const n=getComputedStyle(i.el)["z-index"];i.el.style.zIndex=parseInt(n)+s+1})},setGlobalState(){vt(this.top,t.selectorInert,t.selectorOverflow),this.updateIndex()},add(i){i.el.style.zIndex=null;const s=getComputedStyle(i.el)["z-index"];i.el.style.zIndex=parseInt(s)+e.length+1,e.push(i),this.setGlobalState()},remove(i){const s=e.findIndex(n=>n.id===i.id);s>=0&&(i.el.style.zIndex=null,e.splice(s,1),this.setGlobalState())},moveToTop(i){const s=e.findIndex(n=>n.id===i.id);s>=0&&(e.splice(s,1),this.add(i))}}}class ni extends Rt{constructor(i){super({...Qe,...i});L(this,mt);L(this,pt);this.trigger=null,this.focusTrap=new _t,C(this,mt,ti.bind(this)),C(this,pt,ei.bind(this)),this.stack=si(this.settings)}get active(){return this.stack.top}async createEntry(i,s){return new qe(this,i,s)}async open(i,s,n){return ue.call(this,i,s,n)}async close(i,s,n){return de.call(this,i,s,n)}async replace(i,s,n){return ii.call(this,i,s,n)}async closeAll(i=!1,s,n=!0){const o=await jt.call(this,i,s);return n&&Dt.call(this),o}async afterMount(){document.addEventListener("click",w(this,mt),!1),document.addEventListener("keydown",w(this,pt),!1)}async beforeUnmount(){this.trigger=null}async afterUnmount(){document.removeEventListener("click",w(this,mt),!1),document.removeEventListener("keydown",w(this,pt),!1)}}mt=new WeakMap,pt=new WeakMap;const oi={selector:".popover",selectorTooltip:".popover_tooltip",selectorArrow:".popover__arrow",stateActive:"is-active",placement:"bottom",event:"click",offset:0,flipPadding:0,shiftPadding:0,arrowPadding:0,toggleDelay:0,teleport:null,teleportMethod:"append"};function he(t,e,i){Object.assign(t.style,{left:e!=null?`${e}px`:"",top:i!=null?`${i}px`:""})}function ge(t,e){let i=t.getSetting("toggle-delay");typeof i=="string"&&(i.indexOf(",")>-1&&(i=i.split(",")),i.indexOf(" ")>-1&&(i=i.split(" "))),Array.isArray(i)&&(i=i[e]);const s=Number(i);if(Number.isNaN(s))throw new Error(`Provided delay value is not a number: "${i}"`);return s}function Ut(t){let e;const i=typeof t=="string"?t.trim().split(" "):[t];for(let s=0;s<i.length;s++)i[s]=Number(i[s]);switch(i.length){case 1:e=i[0];break;case 2:e={top:i[0],right:i[1],bottom:i[0],left:i[1]};break;case 3:e={top:i[0],right:i[1],bottom:i[2],left:i[1]};break;case 4:e={top:i[0],right:i[1],bottom:i[2],left:i[3]};break;default:e=!1;break}return e}function ri(t){return{offset:Number(t.getSetting("offset")),flip:{padding:Ut(t.getSetting("flip-padding"))},shift:{padding:Ut(t.getSetting("shift-padding"))},arrow:{element:t.getSetting("selectorArrow"),padding:Ut(t.getSetting("arrow-padding"))}}}function me(t){const e=typeof t=="string"?this.get(t):this.get(t.id);if(e)return e;throw new Error(`Popover not found in collection with id of "${t}".`)}async function pe(t){const e=t?me.call(this,t):await we.call(this);return e&&e.state==="opened"&&(e.el.inert=!0,e.el.classList.remove(this.settings.stateActive),e.isTooltip||e.trigger.setAttribute("aria-expanded","false"),e.floatingCleanup(),e.state="closed",e.trigger===this.trigger&&(this.trigger=null)),e}async function we(){const t=[];return await Promise.all(this.collection.map(async e=>{e.state==="opened"&&t.push(await pe.call(this,e))})),t}function be(t){t.state=="opened"&&setTimeout(()=>{const e=t.el.matches(":hover")===t.el||t.trigger.matches(":hover")===t.trigger;let i=document.activeElement.closest(`#${t.id}, [aria-controls="${t.id}"], [aria-describedby="${t.id}"]`);return i=i?i.matches(":focus-visible"):!1,!e&&!i&&t.close(),t},1)}function li(t){t.state==="opened"?t.close():(this.trigger=t.trigger,t.open())}function ai(t){t.isTooltip&&(t.toggleDelayId&&clearTimeout(t.toggleDelayId),t.close())}function ci(t,e){if(t.isHovered=e,e.type=="focus"&&!t.trigger.matches(":focus-visible"))return;t.toggleDelayId&&clearTimeout(t.toggleDelayId);const i=t.trigger.getAttribute("aria-expanded");if(i&&i=="true")return;const s=this.activeHover?0:ge(t,0);this.activeHover&&this.activeHover.close(),t.toggleDelayId=setTimeout(()=>{t.id&&t.open()},s)}function fi(t,e){setTimeout(()=>{t.isHovered=e,!t.isHovered&&(t.toggleDelayId&&clearTimeout(t.toggleDelayId),t.toggleDelayId=setTimeout(()=>{be.call(this,t)},ge(t,1)))},1)}function ui(t){switch(t.key){case"Escape":this.trigger&&this.trigger.focus(),we.call(this);return;case"Tab":this.collection.forEach(e=>{be.call(this,e)});return;default:return}}function di(t){const e=this;document.addEventListener("click",function i(s){s.target.closest(`#${t.id}, [aria-controls="${t.id}"], [aria-describedby="${t.id}"]`)?t.el&&!t.el.classList.contains(e.settings.stateActive)&&this.removeEventListener("click",i):(t.el&&t.el.classList.contains(e.settings.stateActive)&&t.close(),this.removeEventListener("click",i))})}class hi extends St{constructor(i,s,n={}){super(i,s,n);L(this,F);L(this,U);this.state="closed",this.toggleDelayId=null,this.trigger=null,C(this,F,null),C(this,U,{el:!1,trigger:!1}),this.floatingCleanup=()=>{}}get isTooltip(){return!!this.el.closest(this.getSetting("selectorTooltip"))||this.el.getAttribute("role")=="tooltip"}get isHovered(){return w(this,U).el||w(this,U).trigger}set isHovered(i){const s=i.type=="mouseenter"?!0:i.type=="mouseleave"?!1:void 0;if(s!=null)switch(i.target){case this.el:w(this,U).el=s;break;case this.trigger:w(this,U).trigger=s;break}}async open(){return this.context.open(this)}async close(){return this.context.close(this)}async deregister(){return this.context.deregister(this.id)}registerEventListeners(){w(this,F)||(this.getSetting("event")==="hover"?(C(this,F,[{el:["el","trigger"],type:["mouseenter","focus"],listener:ci.bind(this.context,this)},{el:["el","trigger"],type:["mouseleave","focusout"],listener:fi.bind(this.context,this)},{el:["trigger"],type:["click"],listener:ai.bind(this.context,this)}]),w(this,F).forEach(s=>{s.el.forEach(n=>{s.type.forEach(o=>{this[n].addEventListener(o,s.listener,!1)})})})):(C(this,F,[{el:["trigger"],type:["click"],listener:li.bind(this.context,this)}]),w(this,F).forEach(s=>{s.el.forEach(n=>{s.type.forEach(o=>{this[n].addEventListener(o,s.listener,!1)})})})))}deregisterEventListeners(){w(this,F)&&(w(this,F).forEach(i=>{i.el.forEach(s=>{i.type.forEach(n=>{this[s].removeEventListener(n,i.listener,!1)})})}),C(this,F,null))}async beforeMount(){this.trigger=document.querySelector(`[aria-controls="${this.id}"], [aria-describedby="${this.id}"]`),this.isTooltip?(this.settings.event="hover",this.el.setAttribute("role","tooltip")):this.trigger.setAttribute("aria-expanded","false"),this.registerEventListeners()}async afterRegister(){this.el.classList.contains(this.getSetting("stateActive"))?await this.open():this.el.inert=!0}async beforeUnmount(){this.state==="opened"&&await this.close(),this.floatingCleanup(),this.deregisterEventListeners()}}F=new WeakMap,U=new WeakMap;const ot=Math.min,G=Math.max,Mt=Math.round,Ft=Math.floor,z=t=>({x:t,y:t}),gi={left:"right",right:"left",bottom:"top",top:"bottom"},mi={start:"end",end:"start"};function Kt(t,e,i){return G(t,ot(e,i))}function J(t,e){return typeof t=="function"?t(e):t}function W(t){return t.split("-")[0]}function At(t){return t.split("-")[1]}function Xt(t){return t==="x"?"y":"x"}function Yt(t){return t==="y"?"height":"width"}function Z(t){return["top","bottom"].includes(W(t))?"y":"x"}function Gt(t){return Xt(Z(t))}function pi(t,e,i){i===void 0&&(i=!1);const s=At(t),n=Gt(t),o=Yt(n);let r=n==="x"?s===(i?"end":"start")?"right":"left":s==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(r=It(r)),[r,It(r)]}function wi(t){const e=It(t);return[Jt(t),e,Jt(e)]}function Jt(t){return t.replace(/start|end/g,e=>mi[e])}function bi(t,e,i){const s=["left","right"],n=["right","left"],o=["top","bottom"],r=["bottom","top"];switch(t){case"top":case"bottom":return i?e?n:s:e?s:n;case"left":case"right":return e?o:r;default:return[]}}function yi(t,e,i,s){const n=At(t);let o=bi(W(t),i==="start",s);return n&&(o=o.map(r=>r+"-"+n),e&&(o=o.concat(o.map(Jt)))),o}function It(t){return t.replace(/left|right|bottom|top/g,e=>gi[e])}function xi(t){return{top:0,right:0,bottom:0,left:0,...t}}function ye(t){return typeof t!="number"?xi(t):{top:t,right:t,bottom:t,left:t}}function Nt(t){const{x:e,y:i,width:s,height:n}=t;return{width:s,height:n,top:i,left:e,right:e+s,bottom:i+n,x:e,y:i}}function xe(t,e,i){let{reference:s,floating:n}=t;const o=Z(e),r=Gt(e),l=Yt(r),a=W(e),c=o==="y",d=s.x+s.width/2-n.width/2,u=s.y+s.height/2-n.height/2,h=s[l]/2-n[l]/2;let f;switch(a){case"top":f={x:d,y:s.y-n.height};break;case"bottom":f={x:d,y:s.y+s.height};break;case"right":f={x:s.x+s.width,y:u};break;case"left":f={x:s.x-n.width,y:u};break;default:f={x:s.x,y:s.y}}switch(At(e)){case"start":f[r]-=h*(i&&c?-1:1);break;case"end":f[r]+=h*(i&&c?-1:1);break}return f}const vi=async(t,e,i)=>{const{placement:s="bottom",strategy:n="absolute",middleware:o=[],platform:r}=i,l=o.filter(Boolean),a=await(r.isRTL==null?void 0:r.isRTL(e));let c=await r.getElementRects({reference:t,floating:e,strategy:n}),{x:d,y:u}=xe(c,s,a),h=s,f={},g=0;for(let m=0;m<l.length;m++){const{name:b,fn:p}=l[m],{x:y,y:x,data:E,reset:v}=await p({x:d,y:u,initialPlacement:s,placement:h,strategy:n,middlewareData:f,rects:c,platform:r,elements:{reference:t,floating:e}});d=y??d,u=x??u,f={...f,[b]:{...f[b],...E}},v&&g<=50&&(g++,typeof v=="object"&&(v.placement&&(h=v.placement),v.rects&&(c=v.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:n}):v.rects),{x:d,y:u}=xe(c,h,a)),m=-1)}return{x:d,y:u,placement:h,strategy:n,middlewareData:f}};async function ve(t,e){var i;e===void 0&&(e={});const{x:s,y:n,platform:o,rects:r,elements:l,strategy:a}=t,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:h=!1,padding:f=0}=J(e,t),g=ye(f),b=l[h?u==="floating"?"reference":"floating":u],p=Nt(await o.getClippingRect({element:(i=await(o.isElement==null?void 0:o.isElement(b)))==null||i?b:b.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(l.floating)),boundary:c,rootBoundary:d,strategy:a})),y=u==="floating"?{x:s,y:n,width:r.floating.width,height:r.floating.height}:r.reference,x=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),E=await(o.isElement==null?void 0:o.isElement(x))?await(o.getScale==null?void 0:o.getScale(x))||{x:1,y:1}:{x:1,y:1},v=Nt(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:x,strategy:a}):y);return{top:(p.top-v.top+g.top)/E.y,bottom:(v.bottom-p.bottom+g.bottom)/E.y,left:(p.left-v.left+g.left)/E.x,right:(v.right-p.right+g.right)/E.x}}const Si=t=>({name:"arrow",options:t,async fn(e){const{x:i,y:s,placement:n,rects:o,platform:r,elements:l,middlewareData:a}=e,{element:c,padding:d=0}=J(t,e)||{};if(c==null)return{};const u=ye(d),h={x:i,y:s},f=Gt(n),g=Yt(f),m=await r.getDimensions(c),b=f==="y",p=b?"top":"left",y=b?"bottom":"right",x=b?"clientHeight":"clientWidth",E=o.reference[g]+o.reference[f]-h[f]-o.floating[g],v=h[f]-o.reference[f],D=await(r.getOffsetParent==null?void 0:r.getOffsetParent(c));let et=D?D[x]:0;(!et||!await(r.isElement==null?void 0:r.isElement(D)))&&(et=l.floating[x]||o.floating[g]);const Lt=E/2-v/2,it=et/2-m[g]/2-1,K=ot(u[p],it),Ot=ot(u[y],it),st=K,Tt=et-m[g]-Ot,$=et/2-m[g]/2+Lt,bt=Kt(st,$,Tt),_=!a.arrow&&At(n)!=null&&$!==bt&&o.reference[g]/2-($<st?K:Ot)-m[g]/2<0,H=_?$<st?$-st:$-Tt:0;return{[f]:h[f]+H,data:{[f]:bt,centerOffset:$-bt-H,..._&&{alignmentOffset:H}},reset:_}}}),Ei=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var i,s;const{placement:n,middlewareData:o,rects:r,initialPlacement:l,platform:a,elements:c}=e,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...b}=J(t,e);if((i=o.arrow)!=null&&i.alignmentOffset)return{};const p=W(n),y=Z(l),x=W(l)===l,E=await(a.isRTL==null?void 0:a.isRTL(c.floating)),v=h||(x||!m?[It(l)]:wi(l)),D=g!=="none";!h&&D&&v.push(...yi(l,m,g,E));const et=[l,...v],Lt=await ve(e,b),it=[];let K=((s=o.flip)==null?void 0:s.overflows)||[];if(d&&it.push(Lt[p]),u){const $=pi(n,r,E);it.push(Lt[$[0]],Lt[$[1]])}if(K=[...K,{placement:n,overflows:it}],!it.every($=>$<=0)){var Ot,st;const $=(((Ot=o.flip)==null?void 0:Ot.index)||0)+1,bt=et[$];if(bt)return{data:{index:$,overflows:K},reset:{placement:bt}};let _=(st=K.filter(H=>H.overflows[0]<=0).sort((H,X)=>H.overflows[1]-X.overflows[1])[0])==null?void 0:st.placement;if(!_)switch(f){case"bestFit":{var Tt;const H=(Tt=K.filter(X=>{if(D){const Y=Z(X.placement);return Y===y||Y==="y"}return!0}).map(X=>[X.placement,X.overflows.filter(Y=>Y>0).reduce((Y,ts)=>Y+ts,0)]).sort((X,Y)=>X[1]-Y[1])[0])==null?void 0:Tt[0];H&&(_=H);break}case"initialPlacement":_=l;break}if(n!==_)return{reset:{placement:_}}}return{}}}};async function Ci(t,e){const{placement:i,platform:s,elements:n}=t,o=await(s.isRTL==null?void 0:s.isRTL(n.floating)),r=W(i),l=At(i),a=Z(i)==="y",c=["left","top"].includes(r)?-1:1,d=o&&a?-1:1,u=J(e,t);let{mainAxis:h,crossAxis:f,alignmentAxis:g}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return l&&typeof g=="number"&&(f=l==="end"?g*-1:g),a?{x:f*d,y:h*c}:{x:h*c,y:f*d}}const Ai=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var i,s;const{x:n,y:o,placement:r,middlewareData:l}=e,a=await Ci(e,t);return r===((i=l.offset)==null?void 0:i.placement)&&(s=l.arrow)!=null&&s.alignmentOffset?{}:{x:n+a.x,y:o+a.y,data:{...a,placement:r}}}}},ki=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:i,y:s,placement:n}=e,{mainAxis:o=!0,crossAxis:r=!1,limiter:l={fn:b=>{let{x:p,y}=b;return{x:p,y}}},...a}=J(t,e),c={x:i,y:s},d=await ve(e,a),u=Z(W(n)),h=Xt(u);let f=c[h],g=c[u];if(o){const b=h==="y"?"top":"left",p=h==="y"?"bottom":"right",y=f+d[b],x=f-d[p];f=Kt(y,f,x)}if(r){const b=u==="y"?"top":"left",p=u==="y"?"bottom":"right",y=g+d[b],x=g-d[p];g=Kt(y,g,x)}const m=l.fn({...e,[h]:f,[u]:g});return{...m,data:{x:m.x-i,y:m.y-s,enabled:{[h]:o,[u]:r}}}}}},$i=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:i,y:s,placement:n,rects:o,middlewareData:r}=e,{offset:l=0,mainAxis:a=!0,crossAxis:c=!0}=J(t,e),d={x:i,y:s},u=Z(n),h=Xt(u);let f=d[h],g=d[u];const m=J(l,e),b=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(a){const x=h==="y"?"height":"width",E=o.reference[h]-o.floating[x]+b.mainAxis,v=o.reference[h]+o.reference[x]-b.mainAxis;f<E?f=E:f>v&&(f=v)}if(c){var p,y;const x=h==="y"?"width":"height",E=["top","left"].includes(W(n)),v=o.reference[u]-o.floating[x]+(E&&((p=r.offset)==null?void 0:p[u])||0)+(E?0:b.crossAxis),D=o.reference[u]+o.reference[x]+(E?0:((y=r.offset)==null?void 0:y[u])||0)-(E?b.crossAxis:0);g<v?g=v:g>D&&(g=D)}return{[h]:f,[u]:g}}}};function Bt(){return typeof window<"u"}function rt(t){return Se(t)?(t.nodeName||"").toLowerCase():"#document"}function R(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function B(t){var e;return(e=(Se(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Se(t){return Bt()?t instanceof Node||t instanceof R(t).Node:!1}function I(t){return Bt()?t instanceof Element||t instanceof R(t).Element:!1}function V(t){return Bt()?t instanceof HTMLElement||t instanceof R(t).HTMLElement:!1}function Ee(t){return!Bt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof R(t).ShadowRoot}function kt(t){const{overflow:e,overflowX:i,overflowY:s,display:n}=N(t);return/auto|scroll|overlay|hidden|clip/.test(e+s+i)&&!["inline","contents"].includes(n)}function Li(t){return["table","td","th"].includes(rt(t))}function Vt(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function Zt(t){const e=Qt(),i=I(t)?N(t):t;return i.transform!=="none"||i.perspective!=="none"||(i.containerType?i.containerType!=="normal":!1)||!e&&(i.backdropFilter?i.backdropFilter!=="none":!1)||!e&&(i.filter?i.filter!=="none":!1)||["transform","perspective","filter"].some(s=>(i.willChange||"").includes(s))||["paint","layout","strict","content"].some(s=>(i.contain||"").includes(s))}function Oi(t){let e=j(t);for(;V(e)&&!lt(e);){if(Zt(e))return e;if(Vt(e))return null;e=j(e)}return null}function Qt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function lt(t){return["html","body","#document"].includes(rt(t))}function N(t){return R(t).getComputedStyle(t)}function Ht(t){return I(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function j(t){if(rt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Ee(t)&&t.host||B(t);return Ee(e)?e.host:e}function Ce(t){const e=j(t);return lt(e)?t.ownerDocument?t.ownerDocument.body:t.body:V(e)&&kt(e)?e:Ce(e)}function $t(t,e,i){var s;e===void 0&&(e=[]),i===void 0&&(i=!0);const n=Ce(t),o=n===((s=t.ownerDocument)==null?void 0:s.body),r=R(n);if(o){const l=qt(r);return e.concat(r,r.visualViewport||[],kt(n)?n:[],l&&i?$t(l):[])}return e.concat(n,$t(n,[],i))}function qt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Ae(t){const e=N(t);let i=parseFloat(e.width)||0,s=parseFloat(e.height)||0;const n=V(t),o=n?t.offsetWidth:i,r=n?t.offsetHeight:s,l=Mt(i)!==o||Mt(s)!==r;return l&&(i=o,s=r),{width:i,height:s,$:l}}function te(t){return I(t)?t:t.contextElement}function at(t){const e=te(t);if(!V(e))return z(1);const i=e.getBoundingClientRect(),{width:s,height:n,$:o}=Ae(e);let r=(o?Mt(i.width):i.width)/s,l=(o?Mt(i.height):i.height)/n;return(!r||!Number.isFinite(r))&&(r=1),(!l||!Number.isFinite(l))&&(l=1),{x:r,y:l}}const Ti=z(0);function ke(t){const e=R(t);return!Qt()||!e.visualViewport?Ti:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Pi(t,e,i){return e===void 0&&(e=!1),!i||e&&i!==R(t)?!1:e}function Q(t,e,i,s){e===void 0&&(e=!1),i===void 0&&(i=!1);const n=t.getBoundingClientRect(),o=te(t);let r=z(1);e&&(s?I(s)&&(r=at(s)):r=at(t));const l=Pi(o,i,s)?ke(o):z(0);let a=(n.left+l.x)/r.x,c=(n.top+l.y)/r.y,d=n.width/r.x,u=n.height/r.y;if(o){const h=R(o),f=s&&I(s)?R(s):s;let g=h,m=qt(g);for(;m&&s&&f!==g;){const b=at(m),p=m.getBoundingClientRect(),y=N(m),x=p.left+(m.clientLeft+parseFloat(y.paddingLeft))*b.x,E=p.top+(m.clientTop+parseFloat(y.paddingTop))*b.y;a*=b.x,c*=b.y,d*=b.x,u*=b.y,a+=x,c+=E,g=R(m),m=qt(g)}}return Nt({width:d,height:u,x:a,y:c})}function Ri(t){let{elements:e,rect:i,offsetParent:s,strategy:n}=t;const o=n==="fixed",r=B(s),l=e?Vt(e.floating):!1;if(s===r||l&&o)return i;let a={scrollLeft:0,scrollTop:0},c=z(1);const d=z(0),u=V(s);if((u||!u&&!o)&&((rt(s)!=="body"||kt(r))&&(a=Ht(s)),V(s))){const h=Q(s);c=at(s),d.x=h.x+s.clientLeft,d.y=h.y+s.clientTop}return{width:i.width*c.x,height:i.height*c.y,x:i.x*c.x-a.scrollLeft*c.x+d.x,y:i.y*c.y-a.scrollTop*c.y+d.y}}function Di(t){return Array.from(t.getClientRects())}function ee(t,e){const i=Ht(t).scrollLeft;return e?e.left+i:Q(B(t)).left+i}function Mi(t){const e=B(t),i=Ht(t),s=t.ownerDocument.body,n=G(e.scrollWidth,e.clientWidth,s.scrollWidth,s.clientWidth),o=G(e.scrollHeight,e.clientHeight,s.scrollHeight,s.clientHeight);let r=-i.scrollLeft+ee(t);const l=-i.scrollTop;return N(s).direction==="rtl"&&(r+=G(e.clientWidth,s.clientWidth)-n),{width:n,height:o,x:r,y:l}}function Fi(t,e){const i=R(t),s=B(t),n=i.visualViewport;let o=s.clientWidth,r=s.clientHeight,l=0,a=0;if(n){o=n.width,r=n.height;const c=Qt();(!c||c&&e==="fixed")&&(l=n.offsetLeft,a=n.offsetTop)}return{width:o,height:r,x:l,y:a}}function Ii(t,e){const i=Q(t,!0,e==="fixed"),s=i.top+t.clientTop,n=i.left+t.clientLeft,o=V(t)?at(t):z(1),r=t.clientWidth*o.x,l=t.clientHeight*o.y,a=n*o.x,c=s*o.y;return{width:r,height:l,x:a,y:c}}function $e(t,e,i){let s;if(e==="viewport")s=Fi(t,i);else if(e==="document")s=Mi(B(t));else if(I(e))s=Ii(e,i);else{const n=ke(t);s={...e,x:e.x-n.x,y:e.y-n.y}}return Nt(s)}function Le(t,e){const i=j(t);return i===e||!I(i)||lt(i)?!1:N(i).position==="fixed"||Le(i,e)}function Ni(t,e){const i=e.get(t);if(i)return i;let s=$t(t,[],!1).filter(l=>I(l)&&rt(l)!=="body"),n=null;const o=N(t).position==="fixed";let r=o?j(t):t;for(;I(r)&&!lt(r);){const l=N(r),a=Zt(r);!a&&l.position==="fixed"&&(n=null),(o?!a&&!n:!a&&l.position==="static"&&!!n&&["absolute","fixed"].includes(n.position)||kt(r)&&!a&&Le(t,r))?s=s.filter(d=>d!==r):n=l,r=j(r)}return e.set(t,s),s}function Bi(t){let{element:e,boundary:i,rootBoundary:s,strategy:n}=t;const r=[...i==="clippingAncestors"?Vt(e)?[]:Ni(e,this._c):[].concat(i),s],l=r[0],a=r.reduce((c,d)=>{const u=$e(e,d,n);return c.top=G(u.top,c.top),c.right=ot(u.right,c.right),c.bottom=ot(u.bottom,c.bottom),c.left=G(u.left,c.left),c},$e(e,l,n));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Vi(t){const{width:e,height:i}=Ae(t);return{width:e,height:i}}function Hi(t,e,i){const s=V(e),n=B(e),o=i==="fixed",r=Q(t,!0,o,e);let l={scrollLeft:0,scrollTop:0};const a=z(0);if(s||!s&&!o)if((rt(e)!=="body"||kt(n))&&(l=Ht(e)),s){const f=Q(e,!0,o,e);a.x=f.x+e.clientLeft,a.y=f.y+e.clientTop}else n&&(a.x=ee(n));let c=0,d=0;if(n&&!s&&!o){const f=n.getBoundingClientRect();d=f.top+l.scrollTop,c=f.left+l.scrollLeft-ee(n,f)}const u=r.left+l.scrollLeft-a.x-c,h=r.top+l.scrollTop-a.y-d;return{x:u,y:h,width:r.width,height:r.height}}function ie(t){return N(t).position==="static"}function Oe(t,e){if(!V(t)||N(t).position==="fixed")return null;if(e)return e(t);let i=t.offsetParent;return B(t)===i&&(i=i.ownerDocument.body),i}function Te(t,e){const i=R(t);if(Vt(t))return i;if(!V(t)){let n=j(t);for(;n&&!lt(n);){if(I(n)&&!ie(n))return n;n=j(n)}return i}let s=Oe(t,e);for(;s&&Li(s)&&ie(s);)s=Oe(s,e);return s&<(s)&&ie(s)&&!Zt(s)?i:s||Oi(t)||i}const _i=async function(t){const e=this.getOffsetParent||Te,i=this.getDimensions,s=await i(t.floating);return{reference:Hi(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function zi(t){return N(t).direction==="rtl"}const Wi={convertOffsetParentRelativeRectToViewportRelativeRect:Ri,getDocumentElement:B,getClippingRect:Bi,getOffsetParent:Te,getElementRects:_i,getClientRects:Di,getDimensions:Vi,getScale:at,isElement:I,isRTL:zi};function ji(t,e){let i=null,s;const n=B(t);function o(){var l;clearTimeout(s),(l=i)==null||l.disconnect(),i=null}function r(l,a){l===void 0&&(l=!1),a===void 0&&(a=1),o();const{left:c,top:d,width:u,height:h}=t.getBoundingClientRect();if(l||e(),!u||!h)return;const f=Ft(d),g=Ft(n.clientWidth-(c+u)),m=Ft(n.clientHeight-(d+h)),b=Ft(c),y={rootMargin:-f+"px "+-g+"px "+-m+"px "+-b+"px",threshold:G(0,ot(1,a))||1};let x=!0;function E(v){const D=v[0].intersectionRatio;if(D!==a){if(!x)return r();D?r(!1,D):s=setTimeout(()=>{r(!1,1e-7)},1e3)}x=!1}try{i=new IntersectionObserver(E,{...y,root:n.ownerDocument})}catch{i=new IntersectionObserver(E,y)}i.observe(t)}return r(!0),o}function Ui(t,e,i,s){s===void 0&&(s={});const{ancestorScroll:n=!0,ancestorResize:o=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=s,c=te(t),d=n||o?[...c?$t(c):[],...$t(e)]:[];d.forEach(p=>{n&&p.addEventListener("scroll",i,{passive:!0}),o&&p.addEventListener("resize",i)});const u=c&&l?ji(c,i):null;let h=-1,f=null;r&&(f=new ResizeObserver(p=>{let[y]=p;y&&y.target===c&&f&&(f.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=f)==null||x.observe(e)})),i()}),c&&!a&&f.observe(c),f.observe(e));let g,m=a?Q(t):null;a&&b();function b(){const p=Q(t);m&&(p.x!==m.x||p.y!==m.y||p.width!==m.width||p.height!==m.height)&&i(),m=p,g=requestAnimationFrame(b)}return i(),()=>{var p;d.forEach(y=>{n&&y.removeEventListener("scroll",i),o&&y.removeEventListener("resize",i)}),u==null||u(),(p=f)==null||p.disconnect(),f=null,a&&cancelAnimationFrame(g)}}const Ki=Ai,Xi=ki,Yi=Ei,Gi=Si,Ji=$i,Zi=(t,e,i)=>{const s=new Map,n={platform:Wi,...i},o={...n.platform,_c:s};return vi(t,e,{...n,platform:o})};async function Qi(t){const e=me.call(this,t);e.el.inert=!1,e.el.classList.add(this.settings.stateActive),e.isTooltip||e.trigger.setAttribute("aria-expanded","true"),e.getCustomProps();const i=ri(e),s=e.el.querySelector(i.arrow.element);return i.arrow.element=s||void 0,e.floatingCleanup=Ui(e.trigger,e.el,()=>{Zi(e.trigger,e.el,{placement:e.getSetting("placement"),middleware:[Yi(i.flip),Xi({...i.shift,limiter:Ji()}),Ki(i.offset),Gi(i.arrow)]}).then(({x:n,y:o,placement:r,middlewareData:l})=>{if(e.el){if(he(e.el,n,o),i.arrow.element&&l.arrow){const{x:a,y:c}=l.arrow;he(i.arrow.element,a,c)}e.el.setAttribute("data-floating-placement",r)}})}),e.state="opened",e.getSetting("event")==="click"&&di.call(this,e),e}class qi extends Rt{constructor(i={}){super({...oi,...i});L(this,wt);this.trigger=null,C(this,wt,ui.bind(this))}get active(){return this.get("opened","state")}get activeHover(){return this.collection.find(i=>i.state=="opened"&&i.getSetting("event")=="hover")}async createEntry(i,s){return new hi(this,i,s)}async open(i){return Qi.call(this,i)}async close(i){return pe.call(this,i)}async afterMount(){document.addEventListener("keydown",w(this,wt),!1)}async beforeUnmount(){this.trigger=null}async afterUnmount(){document.removeEventListener("keydown",w(this,wt),!1)}}wt=new WeakMap,S.Drawer=Ze,S.Modal=ni,S.Popover=qi,S.core=Ve,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})});
|
|
10
10
|
//# sourceMappingURL=index.umd.cjs.map
|