define(["exports","./../../emby-apiclient/connectionmanager.js","./../../dom.js","./../../layoutmanager.js","./../../common/servicelocator.js","./../../approuter.js"],function(_exports,_connectionmanager,_dom,_layoutmanager,_servicelocator,_approuter){Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,require(["css!modules/emby-elements/emby-button/emby-button.css","css!!tv|modules/emby-elements/emby-button/emby-button_nontv.css","css!tv|modules/emby-elements/emby-button/emby-button_tv.css"]);var EnableFocusTransfrom=_dom.default.allowFocusScaling();function openPremiumInfo(){Emby.importModule("./modules/registrationservices/registrationservices.js").then(function(registrationServices){registrationServices.showPremiereInfo()})}function showPremiereInfoToPremiereUser(){_connectionmanager.default.currentApiClient().getCurrentUser().then(function(user){user.Policy.IsAdministrator&&_approuter.default.getRouteInfo("/embypremiere")?_approuter.default.show("embypremiere"):openPremiumInfo()})}function onAnchorClick(e){var href=this.getAttribute("href")||"";"#"===href?(e.preventDefault(),"premiereinfo"===this.getAttribute("data-preset")&&Emby.importModule("./modules/registrationservices/registrationservices.js").then(function(registrationServices){registrationServices.validateFeature("themes",{viewOnly:!0,showDialog:!0}).then(showPremiereInfoToPremiereUser)})):this.getAttribute("target")?-1===href.indexOf("emby.media/premiere")||_servicelocator.appHost.supports("externalpremium")?_servicelocator.appHost.supports("targetblank")&&!_servicelocator.appHost.supports("shellopenurl")||(e.preventDefault(),_servicelocator.shell.openUrl(href)):(e.preventDefault(),openPremiumInfo()):_approuter.default.handleAnchorClick(e)}function onInit(){var classList;this.hasInit||(this.hasInit=!0,(classList=this.classList).add("emby-button"),_dom.default.allowBackdropFilter()&&!classList.contains("nobackdropfilter")&&(classList.contains("raised")?classList.add("raised-backdropfilter"):classList.contains("fab")&&classList.add("fab-backdropfilter")),EnableFocusTransfrom&&"false"!==this.getAttribute("data-focusscale")&&classList.add("emby-button-focusscale"))}var EmbyButton=function(_HTMLButtonElement){function EmbyButton(){var _this,self=_this=_HTMLButtonElement.call(this)||this;return onInit.call(self),babelHelpers.possibleConstructorReturn(_this,self)}return babelHelpers.inherits(EmbyButton,_HTMLButtonElement),babelHelpers.createClass(EmbyButton,[{key:"connectedCallback",value:function(){onInit.call(this)}},{key:"disconnectedCallback",value:function(){}}])}(babelHelpers.wrapNativeSuper(HTMLButtonElement)),EmbyAnchor=(customElements.define("emby-button",EmbyButton,{extends:"button"}),function(_HTMLAnchorElement){function EmbyAnchor(){var _this2,self=_this2=_HTMLAnchorElement.call(this)||this;return onInit.call(self),babelHelpers.possibleConstructorReturn(_this2,self)}return babelHelpers.inherits(EmbyAnchor,_HTMLAnchorElement),babelHelpers.createClass(EmbyAnchor,[{key:"connectedCallback",value:function(){onInit.call(this),_dom.default.removeEventListener(this,"click",onAnchorClick,{}),_dom.default.addEventListener(this,"click",onAnchorClick,{}),"true"===this.getAttribute("data-autohide")&&(_servicelocator.appHost.supports("externallinks")&&(_servicelocator.appHost.supports("externalappinfo")||"true"!==this.getAttribute("data-externalappinfo"))?this.classList.remove("hide"):this.classList.add("hide"))}},{key:"disconnectedCallback",value:function(){_dom.default.removeEventListener(this,"click",onAnchorClick,{})}}])}(babelHelpers.wrapNativeSuper(HTMLAnchorElement))),EmbySectionTitle=(customElements.define("emby-linkbutton",EmbyAnchor,{extends:"a"}),function(_EmbyAnchor){function EmbySectionTitle(){var _this3;_this3=_EmbyAnchor.call(this)||this;return babelHelpers.possibleConstructorReturn(_this3,_this3)}return babelHelpers.inherits(EmbySectionTitle,_EmbyAnchor),babelHelpers.createClass(EmbySectionTitle,[{key:"addSeeAllButton",value:function(){var elem;_layoutmanager.default.tv||this.querySelector(".sectionTitleMoreIcon")||((elem=document.createElement("i")).classList.add("md-icon","sectionTitleMoreIcon","secondaryText"),elem.innerHTML="&#xe5e1;",this.appendChild(elem),null!=(elem=this.querySelector(".sectionTitle"))&&elem.classList.add("sectionTitleText-withseeall"))}},{key:"connectedCallback",value:function(){EmbyAnchor.prototype.connectedCallback.call(this),this.addSeeAllButton()}},{key:"disconnectedCallback",value:function(){EmbyAnchor.prototype.disconnectedCallback.call(this)}}])}(EmbyAnchor));customElements.define("emby-sectiontitle",EmbySectionTitle,{extends:"a"}),_exports.default=EmbyButton});