define(["exports","./../layoutmanager.js","./../common/globalize.js","./../dialoghelper/dialoghelper.js","./../emby-elements/emby-button/emby-button.js","./../emby-elements/emby-input/emby-input.js","./../emby-elements/emby-scroller/emby-scroller.js","./../emby-elements/emby-button/paper-icon-button-light.js","./../emby-elements/emby-dialogclosebutton/emby-dialogclosebutton.js"],function(_exports,_layoutmanager,_globalize,_dialoghelper,_embyButton,_embyInput,_embyScroller,_paperIconButtonLight,_embyDialogclosebutton){Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=function(options){return require(["text!modules/prompt/prompt.template.html"]).then(function(responses){responses=responses[0];return function(options,template){var dialogOptions={removeOnClose:!0,scrollY:!1,autoFocus:!0};_layoutmanager.default.tv&&(dialogOptions.size="fullscreen");var submitValue,dlg=_dialoghelper.default.createDialog(dialogOptions);dlg.classList.add("formDialog"),dlg.innerHTML=_globalize.default.translateHtml(template,"sharedcomponents"),dlg.querySelector(".formDialogHeaderTitle").innerHTML=options.title||"",options.description?dlg.querySelector(".fieldDescription").innerHTML=options.description:dlg.querySelector(".fieldDescription").classList.add("hide");return function(dlg,options){dlg=dlg.querySelector(".txtInput");_embyInput.default.setLabel(dlg,options.label||""),dlg.value=options.value||""}(dlg,options),dlg.querySelector("form").addEventListener("submit",function(e){return submitValue=dlg.querySelector(".txtInput").value,e.preventDefault(),e.stopPropagation(),setTimeout(function(){_dialoghelper.default.close(dlg)},300),!1}),dlg.querySelector(".submitText").innerHTML=options.confirmText||_globalize.default.translate("Submit"),_dialoghelper.default.open(dlg).then(function(){var value=submitValue;return value||Promise.reject()})}(options="string"==typeof options?{title:"",label:options}:options,responses)})},require(["formDialogStyle","material-icons"])});