define(["browser","layoutManager","css!./emby-toggle"],function(browser,layoutManager){"use strict";function onKeyDown(e){return browser.tizen&&32===e.keyCode||13===e.keyCode?(e.preventDefault(),this.checked=!this.checked,this.dispatchEvent(new CustomEvent("change",{bubbles:!0})),!1):void 0}function onInit(){this.hasInit||(this.hasInit=!0)}var EmbyToggle=function(_HTMLInputElement){babelHelpers.inherits(EmbyToggle,_HTMLInputElement);var _super=_createSuper(EmbyToggle);function EmbyToggle(){var _this;babelHelpers.classCallCheck(this,EmbyToggle);var self=_this=_super.call(this);return onInit.call(self),babelHelpers.possibleConstructorReturn(_this,self)}return babelHelpers.createClass(EmbyToggle,[{key:"connectedCallback",value:function(){onInit.call(this),function(){var labelElement,labelTextElement;this.hasAttribute("data-classes")||(this.classList.add("emby-toggle"),layoutManager.tv?this.classList.add("emby-toggle-tv"):"-1"!==this.getAttribute("tabindex")&&this.classList.add("emby-toggle-focusring"),(labelElement=this.parentNode).classList.add("emby-toggle-label"),(labelTextElement=labelElement.querySelector("span"))&&(labelTextElement.classList.add("toggleLabel"),layoutManager.tv&&labelTextElement.classList.add("toggleLabel-tv"))),this.addEventListener("keydown",onKeyDown)}.call(this)}},{key:"disconnectedCallback",value:function(){(function(){this.removeEventListener("keydown",onKeyDown)}).call(this)}}]),EmbyToggle}(babelHelpers.wrapNativeSuper(HTMLInputElement));customElements.define("emby-toggle",EmbyToggle,{extends:"input"})});