define(["exports","./../dialoghelper/dialoghelper.js","./../common/globalize.js","./../dom.js","./../common/playback/playbackmanager.js","./../emby-elements/emby-button/emby-button.js","./../emby-elements/emby-button/paper-icon-button-light.js","./../emby-elements/emby-dialogclosebutton/emby-dialogclosebutton.js","./../emby-elements/emby-slider/emby-slider.js","./../emby-elements/emby-scroller/emby-scroller.js","./../viewmanager/basesettingscontainer.js","./../../settings/subtitleappearanceeditor.js"],function(_exports,_dialoghelper,_globalize,_dom,_playbackmanager,_embyButton,_paperIconButtonLight,_embyDialogclosebutton,_embySlider,_embyScroller,_basesettingscontainer,_subtitleappearanceeditor){function SubtitleAppearanceDialog(options){this.options=options}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,require(["material-icons","formDialogStyle"]),Object.assign(SubtitleAppearanceDialog.prototype,_basesettingscontainer.default.prototype),SubtitleAppearanceDialog.prototype.show=function(){this.view||(dialogOptions={removeOnClose:!0,scrollY:!1,transparentBackground:!0,positionTo:this.options.positionTo,positionX:this.options.positionX,positionY:this.options.positionY,transformOrigin:this.options.transformOrigin,lowResAutoHeight:!0,skipAutoFocusIfNotEnabled:!1,autoCenter:!1,size:"small"},(dialogOptions=_dialoghelper.default.createDialog(dialogOptions)).classList.add("formDialog","subtitleAppearanceDialog"),_dom.default.allowBackdropFilter()&&dialogOptions.classList.add("dialog-blur"),html="",title=_globalize.default.translate("HeaderSubtitleAppearance"),dialogOptions.innerHTML=html=(html=(html=(html+='<div class="formDialogHeader">')+'<button type="button" is="emby-dialogclosebutton" closetype="done"></button>'+'<h3 class="formDialogHeaderTitle">')+title+"</h3>")+"</div>"+'<div is="emby-scroller" data-horizontal="false" data-focusscroll="true" class="formDialogContent"><div class="scrollSlider"><form class="dialogContentInner dialog-content-centered padded-left padded-right fieldsets"></form></div></div>',dialogOptions.style.minWidth="initial",dialogOptions.addEventListener("opened",function(){this.settingsOnResume({refresh:!0})}.bind(this)),this.view=dialogOptions,_basesettingscontainer.default.call(this,dialogOptions)),title=this.options.player,_playbackmanager.default.getSubtitleOffset(title);var dialogOptions,title,html=function(){return Promise.resolve()}.bind(this);return _dialoghelper.default.open(this.view).then(html,html)},SubtitleAppearanceDialog.prototype.loadSettingsInternal=function(){var instance=this;return function(instance){var context=instance.view,subtitleAppearanceEditor=new _subtitleappearanceeditor.default({settingsContainer:instance,preview:!1,title:!1});return(instance.subtitleAppearanceEditor=subtitleAppearanceEditor).embed(context.querySelector(".fieldsets"),"afterbegin")}(instance).then(function(){return instance.loadAutoSettings().then(function(){instance.subtitleAppearanceEditor.bindEvents()})})},SubtitleAppearanceDialog.prototype.close=function(){var dlg=this.view;dlg&&_dialoghelper.default.close(dlg)},SubtitleAppearanceDialog.prototype.getApiClient=function(){return this.options.apiClient},SubtitleAppearanceDialog.prototype.destroy=function(){this.close(),_basesettingscontainer.default.prototype.destroy.apply(this,arguments);var subtitleAppearanceEditor=this.subtitleAppearanceEditor;subtitleAppearanceEditor&&(subtitleAppearanceEditor.destroy(),this.subtitleAppearanceEditor=null),this.options=null,this.view=null};_exports.default=SubtitleAppearanceDialog});