import{f as s,am as e,an as a,ao as r,ap as t,aq as l,_ as o,d as i}from"./core.js";var n=function(a){function r(){var s=null!==a&&a.apply(this,arguments)||this;return s.wasScrolled=!1,s}return s(r,a),r.prototype.handleTargetScroll=function(){this.adapter.getViewportScrollY()<=0?this.wasScrolled&&(this.adapter.removeClass(e.FIXED_SCROLLED_CLASS),this.wasScrolled=!1):this.wasScrolled||(this.adapter.addClass(e.FIXED_SCROLLED_CLASS),this.wasScrolled=!0)},r}(a);class c extends r{constructor(){super(...arguments),this.mdcFoundationClass=n}barClasses(){return Object.assign(Object.assign({},super.barClasses()),{"mdc-top-app-bar--fixed":!0})}registerListeners(){this.scrollTarget.addEventListener("scroll",this.handleTargetScroll,t)}unregisterListeners(){this.scrollTarget.removeEventListener("scroll",this.handleTargetScroll)}}let d=class extends c{};d.styles=[l],d=o([i("mwc-top-app-bar-fixed")],d);export{d as TopAppBarFixed};