{"version":3,"sources":["progressbar.js","accountPwdReset.js"],"names":["$","progressBar","el","options","self","this","$el","extend","defaultOptions","init","html","pb","find","attr","minValue","maxValue","value","width","text","hideOnStart","hide","show","changeText","b2b","jQuery","_createForOfIteratorHelper","r","e","o","a","u","_n","t","Symbol","iterator","s","call","n","next","done","f","Array","isArray","_unsupportedIterableToArray","length","F","TypeError","_arrayLikeToArray","toString","slice","constructor","name","from","test","pwdResetForm","checkPasswords","hash","val","password","passwordConfirmation","post","confirmPassword","response","rules","empty","Success","removeAttr","append","_step2","_iterator2","Data","message","concat","err","fail","jqXhr","errors","showAjaxError","click","valid","disableForm","ajax","url","resetUrl","data","email","type","success","enableForm","toastNotificationService","showInfo","Errors","join","showError","error","saveUrl","pwd","showSuccess","then","window","location","_step","_iterator","keypress","which","preventDefault","trigger","keyup","delay","fn","ms","timer","clearTimeout","_len","arguments","args","_key","setTimeout","bind","apply"],"mappings":"CAEWA,IASS,SAAdC,EAAmCC,EAAIC,GACzC,IAAIC,EAAOC,KAEXD,EAAKE,IAAMN,EAAEE,CAAE,EACfE,EAAKF,GAAKA,EACVE,EAAKD,QAAUH,EAAEO,OAAO,GAAIC,EAAgBL,CAAO,EACnDC,EAAKK,KAAO,WACVL,EAAKE,IAAII,KALI,gOAKS,EACtB,IAAIC,EAAKP,EAAKE,IAAIM,KAAK,eAAe,EACtCD,EAAGE,KAAK,gBAAiBT,EAAKD,QAAQW,QAAQ,EAC9CH,EAAGE,KAAK,gBAAiBT,EAAKD,QAAQY,QAAQ,EAC9CJ,EAAGE,KAAK,gBAAiBT,EAAKD,QAAQa,KAAK,EAC3CL,EAAGM,MAAMb,EAAKD,QAAQc,KAAK,EACjBb,EAAKE,IAAIM,KAAK,UAAU,EAC9BM,KAAKd,EAAKD,QAAQe,IAAI,EACtBd,EAAKD,QAAQgB,aACff,EAAKE,IAAIc,KAAK,CAElB,EACAhB,EAAKiB,KAAO,WACVjB,EAAKE,IAAIe,KAAK,CAChB,EACAjB,EAAKgB,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AMC,EAAMrD,EAAgB,GAAG,CAAC,CAC3D,EAoCAnD,EAAK4E,YAAc,WACjBhF,EAAE,YAAY,EAAEa,KAAK,WAAY,UAAU,EAC3Cb,EAAE,WAAW,EAAEa,KAAK,WAAY,UAAU,EAC1Cb,EAAE,SAAS,EAAEa,KAAK,WAAY,UAAU,EACxCb,EAAE,qBAAqB,EAAEa,KAAK,WAAY,UAAU,EACpDb,EAAE,UAAU,EAAEa,KAAK,WAAY,UAAU,CAC3C,EACAT,EAAKoF,WAAa,WAChBxF,EAAE,YAAY,EAAEkE,WAAW,UAAU,EACrClE,EAAE,WAAW,EAAEkE,WAAW,UAAU,EACpClE,EAAE,SAAS,EAAEkE,WAAW,UAAU,EAClClE,EAAE,qBAAqB,EAAEkE,WAAW,UAAU,EAC9ClE,EAAE,UAAU,EAAEkE,WAAW,UAAU,CACrC,EACA9D,EAAKK,KAAK,CACZ,CA9IA,IAAID,EAAiB,CACnB2E,SAAU,GACVY,QAAS,EACX,EAoJA,SAASa,EAAMC,EAAIC,GACjB,IAAIC,EAAQ,EACZ,OAAO,WACLC,aAAaD,CAAK,EAClB,IAAK,IAAIE,EAAOC,UAAUtE,OAAQuE,EAAO,IAAI1E,MAAMwE,CAAI,EAAGG,EAAO,EAAGA,EAAOH,EAAMG,CAAI,GACnFD,EAAKC,GAAQF,UAAUE,GAEzBL,EAAQM,WAAWR,EAAGS,KAAKC,MAAMV,EAAI,CAACxG,MAAMmE,OAAO2C,CAAI,CAAC,EAAGL,GAAM,CAAC,CACpE,CACF,CAfA9G,EAAEuB,IAAMvB,EAAEuB,KAAO,GAGjBvB,EAAEuB,IAAI+B,aAAe,SAAUpD,EAAIC,GACjC,OAAO,IAAImD,EAAapD,EAAIC,CAAO,CACrC,CAWD,GAAEqB,MAAM","file":"../account-pwdReset-afb095b3.js","sourcesContent":["\"use strict\";\n\n(function ($) {\n var defaultOptions = {\n value: 100,\n minValue: 0,\n maxValue: 100,\n text: 'Загрузка...',\n width: '100%',\n hideOnStart: true\n };\n var progressBar = function progressBar(el, options) {\n var self = this;\n var template = '
Загрузка...
';\n self.$el = $(el);\n self.el = el;\n self.options = $.extend({}, defaultOptions, options);\n self.init = function () {\n self.$el.html(template);\n var pb = self.$el.find('.progress-bar');\n pb.attr('aria-valuemin', self.options.minValue);\n pb.attr('aria-valuemax', self.options.maxValue);\n pb.attr('aria-valuenow', self.options.value);\n pb.width(self.options.width);\n var txt = self.$el.find('.sr-only');\n txt.text(self.options.text);\n if (self.options.hideOnStart) {\n self.$el.hide();\n }\n };\n self.show = function () {\n self.$el.show();\n };\n self.hide = function () {\n self.$el.hide();\n };\n self.changeText = function (text) {\n var txt = self.$el.find('.sr-only');\n txt.text(text);\n };\n self.init();\n };\n\n // check namespace\n $.b2b = $.b2b || {};\n\n // set wrapper\n $.b2b.progressBar = function (el, options) {\n return new progressBar(el, options);\n };\n})(jQuery);","\"use strict\";\n\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\n(function ($) {\n 'use stict';\n\n var defaultOptions = {\n resetUrl: '',\n saveUrl: ''\n };\n var pwdResetForm = function pwdResetForm(el, options) {\n var self = this;\n var pb;\n self.$el = $(el);\n self.el = el;\n self.options = $.extend({}, defaultOptions, options);\n self.init = function () {\n pb = $.b2b.progressBar($('#progressBar'));\n $('#resetBtn').click(function () {\n if (self.$el.valid()) {\n self.disableForm();\n pb.show();\n $.ajax({\n url: options.resetUrl,\n data: {\n email: $('#userEmail').val()\n },\n type: \"POST\",\n success: function success(data) {\n pb.hide();\n self.enableForm();\n if (data.Success) {\n $.b2b.toastNotificationService.showInfo(\"Восстановление пароля.
На указанный Вами E-mail было отправлено письмо с дальнейшими инструкциями\");\n } else {\n var message = 'Ошибка при попытке восстановления пароля:
';\n message += data.Errors.join('
');\n $.b2b.toastNotificationService.showError(message);\n }\n },\n error: function error(jqXhr) {\n pb.hide();\n self.enableForm();\n $.b2b.errors.showAjaxError(jqXhr);\n }\n });\n }\n });\n $('#saveBtn').click(function () {\n self.disableForm();\n pb.show();\n $.ajax({\n url: options.saveUrl,\n data: {\n hash: $('#userHash').val(),\n pwd: $('#newPwd').val()\n },\n type: \"POST\",\n success: function success(data) {\n pb.hide();\n if (data.Success) {\n $.b2b.toastNotificationService.showSuccess(\"Пароль успешно изменен\").then(function () {\n window.location = \"/\";\n });\n } else {\n self.enableForm();\n var rules = $(\"#passwordRule\");\n rules.empty();\n rules.append('
Пароль должен :
');\n var _iterator = _createForOfIteratorHelper(data.Data),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var message = _step.value;\n rules.append(\"
- \".concat(message, \"
\"));\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n },\n error: function error(jqXhr) {\n pb.hide();\n self.enableForm();\n $.b2b.errors.showAjaxError(jqXhr);\n }\n });\n });\n $('#userEmail').keypress(function (e) {\n if (e.which == 13) {\n e.preventDefault();\n $('#resetBtn').trigger('click');\n }\n });\n $('#newPwd').keyup(delay(checkPasswords, 500));\n $('#newPwdConfirmation').keyup(delay(checkPasswords, 500));\n };\n\n /** Проверить пароли на безопасность */\n function checkPasswords() {\n $('#saveBtn').attr('disabled', 'disabled');\n var hash = $('#userHash').val();\n var password = $('#newPwd').val();\n var passwordConfirmation = $('#newPwdConfirmation').val();\n $.post(\"/Account/ValidatePassword\", {\n hash: hash,\n password: password,\n confirmPassword: passwordConfirmation\n }).done(function (response) {\n var rules = $(\"#passwordRule\");\n rules.empty();\n if (response.Success) {\n $('#saveBtn').removeAttr('disabled');\n return;\n }\n rules.append('
Пароль должен :
');\n var _iterator2 = _createForOfIteratorHelper(response.Data),\n _step2;\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var message = _step2.value;\n rules.append(\"
- \".concat(message, \"
\"));\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n }).fail(function (jqXhr) {\n $.b2b.errors.showAjaxError(jqXhr);\n });\n }\n self.disableForm = function () {\n $('#userEmail').attr('disabled', 'disabled');\n $('#resetBtn').attr('disabled', 'disabled');\n $('#newPwd').attr('disabled', 'disabled');\n $('#newPwdConfirmation').attr('disabled', 'disabled');\n $('#saveBtn').attr('disabled', 'disabled');\n };\n self.enableForm = function () {\n $('#userEmail').removeAttr('disabled');\n $('#resetBtn').removeAttr('disabled');\n $('#newPwd').removeAttr('disabled');\n $('#newPwdConfirmation').removeAttr('disabled');\n $('#saveBtn').removeAttr('disabled');\n };\n self.init();\n };\n\n // check namespace\n $.b2b = $.b2b || {};\n\n // set wrapper\n $.b2b.pwdResetForm = function (el, options) {\n return new pwdResetForm(el, options);\n };\n function delay(fn, ms) {\n var timer = 0;\n return function () {\n clearTimeout(timer);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n timer = setTimeout(fn.bind.apply(fn, [this].concat(args)), ms || 0);\n };\n }\n})(jQuery);"]}