/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/@authentic/mwc-top-app-bar@0.9.0/mwc-top-app-bar.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
var __decorate=this&&this.__decorate||function(t,e,o,r){var a,p=arguments.length,s=p<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,r);else for(var n=t.length-1;n>=0;n--)(a=t[n])&&(s=(p<3?a(s):p>3?a(e,o,s):a(e,o))||s);return p>3&&s&&Object.defineProperty(e,o,s),s};
/**
@license
Copyright 2018 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/import{BaseElement,html,property,query,customElement,classMap,addHasRemoveClass,emit}from"@authentic/mwc-base/base-element";import MDCTopAppBarFoundation from"@material/top-app-bar/standard/foundation";import MDCShortTopAppBarFoundation from"@material/top-app-bar/short/foundation";import MDCFixedTopAppBarFoundation from"@material/top-app-bar/fixed/foundation";import{style}from"./mwc-top-app-bar-css";export const EVENTS={nav:"nav"};let TopAppBar=class extends BaseElement{constructor(){super(...arguments),this.type="",this.dense=!1,this.centerTitle=!1}get mdcFoundationClass(){return"fixed"===this.type||"prominentFixed"===this.type?MDCFixedTopAppBarFoundation:"short"===this.type||"shortCollapsed"===this.type?MDCShortTopAppBarFoundation:MDCTopAppBarFoundation}get scrollTarget(){return this._scrollTarget||window}set scrollTarget(t){const e=this.scrollTarget;this._scrollTarget=t,this.requestUpdate("scrollTarget",e)}render(){const t={"mdc-top-app-bar--fixed":"fixed"===this.type||"prominentFixed"===this.type,"mdc-top-app-bar--short":"shortCollapsed"===this.type||"short"===this.type,"mdc-top-app-bar--short-collapsed":"shortCollapsed"===this.type,"mdc-top-app-bar--prominent":"prominent"===this.type||"prominentFixed"===this.type,"mdc-top-app-bar--dense":this.dense,"mwc-top-app-bar--center-title":this.centerTitle},e=this.centerTitle?"":html`
      <span class="mdc-top-app-bar__title">
        <slot name="title"></slot>
      </span>
    `,o=this.centerTitle?html`
      <section class="mdc-top-app-bar__section mdc-top-app-bar__section--align-center">
        <span class="mdc-top-app-bar__title">
          <slot name="title"></slot>
        </span>
      </section>`:"";return html`
      <header class="mdc-top-app-bar ${classMap(t)}">
        <div class="mdc-top-app-bar__row">
          <section class="mdc-top-app-bar__section mdc-top-app-bar__section--align-start">
            <slot name="navigationIcon"></slot>
            ${e}
          </section>
          ${o}
          <section class="mdc-top-app-bar__section mdc-top-app-bar__section--align-end" role="toolbar">
            <slot name="actionItems"></slot>
          </section>
        </div>
      </header>`}createAdapter(){return Object.assign({},addHasRemoveClass(this.mdcRoot),{setStyle:(t,e)=>this.mdcRoot.style.setProperty(t,e),getTopAppBarHeight:()=>this.mdcRoot.clientHeight,registerNavigationIconInteractionHandler:(t,e)=>{this._navIconSlot&&this._navIconSlot.addEventListener(t,e)},deregisterNavigationIconInteractionHandler:(t,e)=>{this._navIconSlot&&this._navIconSlot.removeEventListener(t,e)},notifyNavigationIconClicked:()=>{emit(this,EVENTS.nav,{},!0)},registerScrollHandler:t=>this.scrollTarget.addEventListener("scroll",t),deregisterScrollHandler:t=>this.scrollTarget.removeEventListener("scroll",t),registerResizeHandler:t=>window.addEventListener("resize",t),deregisterResizeHandler:t=>window.removeEventListener("resize",t),getViewportScrollY:()=>this.scrollTarget[this.scrollTarget===window?"pageYOffset":"scrollTop"],getTotalActionItems:()=>this._actionItemsSlot.assignedNodes({flatten:!0}).length})}firstUpdated(){}updated(t){(t.has("type")||t.has("scrollTarget"))&&this.createFoundation()}createFoundation(){super.createFoundation();const t=this.scrollTarget===window;this.mdcRoot.style.position=t?"":"absolute",this.mdcRoot.style.top=t?"0px":""}};TopAppBar.styles=style,__decorate([query(".mdc-top-app-bar")],TopAppBar.prototype,"mdcRoot",void 0),__decorate([query('[name="navigationIcon"]')],TopAppBar.prototype,"_navIconSlot",void 0),__decorate([query('[name="actionItems"]')],TopAppBar.prototype,"_actionItemsSlot",void 0),__decorate([property({reflect:!0})],TopAppBar.prototype,"type",void 0),__decorate([property({type:Boolean,reflect:!0})],TopAppBar.prototype,"dense",void 0),__decorate([property({type:Boolean,reflect:!0})],TopAppBar.prototype,"centerTitle",void 0),TopAppBar=__decorate([customElement("mwc-top-app-bar")],TopAppBar);export{TopAppBar};
//# sourceMappingURL=/sm/e4f532b1da4e3307c6091cdbd3e44531b0e3aa23ea5fa9e28f44e6b31eac3622.map