define(["exports","./../modules/viewmanager/baseview.js","./../modules/common/globalize.js","./../modules/emby-elements/emby-input/emby-input.js","./../modules/emby-elements/emby-button/emby-button.js","./../modules/emby-elements/emby-checkbox/emby-checkbox.js","./../modules/emby-elements/emby-select/emby-select.js","./../modules/emby-elements/emby-scroller/emby-scroller.js","./../modules/emby-apiclient/connectionmanager.js","./../modules/approuter.js"],function(_exports,_baseview,_globalize,_embyInput,_embyButton,_embyCheckbox,_embySelect,_embyScroller,_connectionmanager,_approuter){function onBackClick(){_approuter.default.back()}function showAlert(options){return Emby.importModule("./modules/common/dialogs/alert.js").then(function(alert){return alert(options)})}function onPasswordReset(){_approuter.default.beginConnectionWizard()}function processForgotPasswordResult(result){result.UsersReset.length?result.Success?showAlert({html:_globalize.default.translate("PasswordResetForUsers")+"<br/>"+"<br/>"+result.UsersReset.join("<br/>"),title:_globalize.default.translate("HeaderPasswordReset")}).then(onPasswordReset):showAlert({text:_globalize.default.translate("InvalidForgotPasswordPin"),title:_globalize.default.translate("HeaderPasswordReset")}):showAlert({text:_globalize.default.translate("ForgotPasswordNoUserFound"),title:_globalize.default.translate("HeaderPasswordReset")})}function View(view,params){_baseview.default.apply(this,arguments),view.querySelector(".btnCancel").addEventListener("click",onBackClick),view.querySelector("form").addEventListener("submit",function(e){var apiClient=_connectionmanager.default.currentApiClient();return apiClient.ajax({type:"POST",url:apiClient.getUrl("Users/ForgotPassword/Pin"),dataType:"json",data:{Pin:view.querySelector(".txtPin").value}}).then(processForgotPasswordResult),e.preventDefault(),!1})}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,Object.assign(View.prototype,_baseview.default.prototype);_exports.default=View});