var AuthorDrawerElement=function(){"use strict";window.hasOwnProperty("AuthorBaseElement")||(console.error('[ERROR] <author-drawer> Required dependency "AuthorBaseElement" not found.'),console.info("AuthorBaseElement is available at https://github.com/author-elements/base")),function(){let t=Array.from(new Set([])).filter(t=>!customElements.get(t));t.length>0&&(console.error(`[ERROR] <author-drawer> Required dependenc${1!==t.length?"ies":"y"} not found: ${t.map(t=>`<${t}>`).join(", ").replace(", "+t[t.length-1]," and "+t[t.length-1])}`),t.forEach((t,e)=>console.info(`${e+1}. <${t}> is available at ${"https://github.com/author-elements/drawer".replace("drawer",t.replace("author-",""))}`)))}();class t extends(AuthorBaseElement(HTMLElement)){constructor(){super('<template><style>@charset "UTF-8"; :host{display:block}:host *,:host :after,:host :before{box-sizing:border-box}:host(:not([inert])){position:fixed;overflow:auto;visibility:hidden;transition:transform .382s}:host([position=top]:not([inert])){top:0;right:0;left:0;transform:translateY(-100%)}:host([position=right]:not([inert])){top:0;right:0;bottom:0;transform:translateX(100%)}:host([position=bottom]:not([inert])){top:auto;right:0;bottom:0;left:0;transform:translateY(100%)}:host(:not([inert])),:host([position=left]:not([inert])){top:0;bottom:0;transform:translateX(-100%)}:host([open]:not([inert])),:host([transition]:not([inert])){visibility:visible}:host([position=bottom][open]:not([inert])),:host([position=top][open]:not([inert])){transform:translateY(0)}:host([open]:not([inert])),:host([position=left][open]:not([inert])),:host([position=right][open]:not([inert])){transform:translateX(0)}author-drawer{display:block}author-drawer *,author-drawer :after,author-drawer :before{box-sizing:border-box}author-drawer:not([inert]){position:fixed;overflow:auto;visibility:hidden;transition:transform .382s}author-drawer[position=top]:not([inert]){top:0;right:0;left:0;transform:translateY(-100%)}author-drawer[position=right]:not([inert]){top:0;right:0;bottom:0;transform:translateX(100%)}author-drawer[position=bottom]:not([inert]){top:auto;right:0;bottom:0;left:0;transform:translateY(100%)}author-drawer([position=left]:not([inert])),author-drawer:not([inert]){top:0;bottom:0;transform:translateX(-100%)}author-drawer([transition]:not([inert])),author-drawer[open]:not([inert]){visibility:visible}author-drawer([position=bottom][open]:not([inert])),author-drawer[position=top][open]:not([inert]){transform:translateY(0)}author-drawer([position=left][open]:not([inert])),author-drawer([position=right][open]:not([inert])),author-drawer[open]:not([inert]){transform:translateX(0)}</style><slot></slot></template>'),this.UTIL.defineProperties({acceptablePositions:{private:!0,readonly:!0,default:["top","right","bottom","left"]},computedDimension:{private:!0,readonly:!0,get:()=>{let t=window.getComputedStyle(this);switch(this.position){case"left":case"right":return t.width;default:return t.height}}},position:{readonly:!0,get:()=>{if(!this.hasAttribute("position"))return"left";let t=this.getAttribute("position");return this.PRIVATE.acceptablePositions.includes(t)?t:(this.UTIL.printToConsole(`Invalid position "${t}". Reverting to default "left". Acceptable values: ${this.PRIVATE.acceptablePositions.join(", ")}`,"warning"),"left")}}}),this.UTIL.definePrivateMethods({open:()=>{document.body.style.overflow="hidden",this.setAttribute("transition",""),this.emit("open")},close:()=>{this.emit("close"),setTimeout(()=>{document.body.style.removeProperty("overflow"),this.removeAttribute("transition")},382)}}),this.UTIL.registerListeners(this,{"attribute.change":t=>{let{attribute:e,oldValue:o,newValue:r}=t.detail;switch(e){case"open":return this.hasAttribute("open")?this.PRIVATE.open():this.PRIVATE.close()}}})}static get observedAttributes(){return["position","open"]}open(){this.setAttribute("open","")}close(){this.removeAttribute("open")}}return customElements.define("author-drawer",t),t}();
//# sourceMappingURL=author-drawer.min.js.map
