{"version":3,"file":"js/pages/custom/login/login-general.js","mappings":";;;;;;AAAa;;AAEb;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,MAAM;AACN,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,MAAM;AACN;AACA,OAAO;AACP,SAAS;;AAET;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,MAAM;AACN,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,MAAM;AACN;AACA,OAAO;AACP,SAAS;;AAET;AACA;AACA;;AAEA;AACA,SAAS;AACT;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,MAAM;AACN;AACA,OAAO;AACP,SAAS;;AAET;AACA;AACA;;AAEA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,CAAC","sources":["webpack://metronic/../demo1/src/js/pages/custom/login/login-general.js"],"sourcesContent":["\"use strict\";\n\n// Class Definition\nvar KTLogin = function() {\n var _login;\n\n var _showForm = function(form) {\n var cls = 'login-' + form + '-on';\n var form = 'kt_login_' + form + '_form';\n\n _login.removeClass('login-forgot-on');\n _login.removeClass('login-signin-on');\n _login.removeClass('login-signup-on');\n\n _login.addClass(cls);\n\n KTUtil.animateClass(KTUtil.getById(form), 'animate__animated animate__backInUp');\n }\n\n var _handleSignInForm = function() {\n var validation;\n\n // Init form validation rules. For more info check the FormValidation plugin's official documentation:https://formvalidation.io/\n validation = FormValidation.formValidation(\n\t\t\tKTUtil.getById('kt_login_signin_form'),\n\t\t\t{\n\t\t\t\tfields: {\n\t\t\t\t\tusername: {\n\t\t\t\t\t\tvalidators: {\n\t\t\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\t\t\tmessage: 'Username is required'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tpassword: {\n\t\t\t\t\t\tvalidators: {\n\t\t\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\t\t\tmessage: 'Password is required'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tplugins: {\n trigger: new FormValidation.plugins.Trigger(),\n submitButton: new FormValidation.plugins.SubmitButton(),\n //defaultSubmit: new FormValidation.plugins.DefaultSubmit(), // Uncomment this line to enable normal button submit after form validation\n\t\t\t\t\tbootstrap: new FormValidation.plugins.Bootstrap()\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n $('#kt_login_signin_submit').on('click', function (e) {\n e.preventDefault();\n\n validation.validate().then(function(status) {\n\t\t if (status == 'Valid') {\n swal.fire({\n\t\t text: \"All is cool! Now you submit this form\",\n\t\t icon: \"success\",\n\t\t buttonsStyling: false,\n\t\t confirmButtonText: \"Ok, got it!\",\n customClass: {\n \t\t\t\t\t\tconfirmButton: \"btn font-weight-bold btn-light-primary\"\n \t\t\t\t\t}\n\t\t }).then(function() {\n\t\t\t\t\t\tKTUtil.scrollTop();\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tswal.fire({\n\t\t text: \"Sorry, looks like there are some errors detected, please try again.\",\n\t\t icon: \"error\",\n\t\t buttonsStyling: false,\n\t\t confirmButtonText: \"Ok, got it!\",\n customClass: {\n \t\t\t\t\t\tconfirmButton: \"btn font-weight-bold btn-light-primary\"\n \t\t\t\t\t}\n\t\t }).then(function() {\n\t\t\t\t\t\tKTUtil.scrollTop();\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t });\n });\n\n // Handle forgot button\n $('#kt_login_forgot').on('click', function (e) {\n e.preventDefault();\n _showForm('forgot');\n });\n\n // Handle signup\n $('#kt_login_signup').on('click', function (e) {\n e.preventDefault();\n _showForm('signup');\n });\n }\n\n var _handleSignUpForm = function(e) {\n var validation;\n var form = KTUtil.getById('kt_login_signup_form');\n\n // Init form validation rules. For more info check the FormValidation plugin's official documentation:https://formvalidation.io/\n validation = FormValidation.formValidation(\n\t\t\tform,\n\t\t\t{\n\t\t\t\tfields: {\n\t\t\t\t\tfullname: {\n\t\t\t\t\t\tvalidators: {\n\t\t\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\t\t\tmessage: 'Username is required'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\temail: {\n validators: {\n\t\t\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\t\t\tmessage: 'Email address is required'\n\t\t\t\t\t\t\t},\n emailAddress: {\n\t\t\t\t\t\t\t\tmessage: 'The value is not a valid email address'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n password: {\n validators: {\n notEmpty: {\n message: 'The password is required'\n }\n }\n },\n cpassword: {\n validators: {\n notEmpty: {\n message: 'The password confirmation is required'\n },\n identical: {\n compare: function() {\n return form.querySelector('[name=\"password\"]').value;\n },\n message: 'The password and its confirm are not the same'\n }\n }\n },\n agree: {\n validators: {\n notEmpty: {\n message: 'You must accept the terms and conditions'\n }\n }\n },\n\t\t\t\t},\n\t\t\t\tplugins: {\n\t\t\t\t\ttrigger: new FormValidation.plugins.Trigger(),\n\t\t\t\t\tbootstrap: new FormValidation.plugins.Bootstrap()\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n $('#kt_login_signup_submit').on('click', function (e) {\n e.preventDefault();\n\n validation.validate().then(function(status) {\n\t\t if (status == 'Valid') {\n swal.fire({\n\t\t text: \"All is cool! Now you submit this form\",\n\t\t icon: \"success\",\n\t\t buttonsStyling: false,\n\t\t confirmButtonText: \"Ok, got it!\",\n customClass: {\n \t\t\t\t\t\tconfirmButton: \"btn font-weight-bold btn-light-primary\"\n \t\t\t\t\t}\n\t\t }).then(function() {\n\t\t\t\t\t\tKTUtil.scrollTop();\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tswal.fire({\n\t\t text: \"Sorry, looks like there are some errors detected, please try again.\",\n\t\t icon: \"error\",\n\t\t buttonsStyling: false,\n\t\t confirmButtonText: \"Ok, got it!\",\n customClass: {\n \t\t\t\t\t\tconfirmButton: \"btn font-weight-bold btn-light-primary\"\n \t\t\t\t\t}\n\t\t }).then(function() {\n\t\t\t\t\t\tKTUtil.scrollTop();\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t });\n });\n\n // Handle cancel button\n $('#kt_login_signup_cancel').on('click', function (e) {\n e.preventDefault();\n\n _showForm('signin');\n });\n }\n\n var _handleForgotForm = function(e) {\n var validation;\n\n // Init form validation rules. For more info check the FormValidation plugin's official documentation:https://formvalidation.io/\n validation = FormValidation.formValidation(\n\t\t\tKTUtil.getById('kt_login_forgot_form'),\n\t\t\t{\n\t\t\t\tfields: {\n\t\t\t\t\temail: {\n\t\t\t\t\t\tvalidators: {\n\t\t\t\t\t\t\tnotEmpty: {\n\t\t\t\t\t\t\t\tmessage: 'Email address is required'\n\t\t\t\t\t\t\t},\n emailAddress: {\n\t\t\t\t\t\t\t\tmessage: 'The value is not a valid email address'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tplugins: {\n\t\t\t\t\ttrigger: new FormValidation.plugins.Trigger(),\n\t\t\t\t\tbootstrap: new FormValidation.plugins.Bootstrap()\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n // Handle submit button\n $('#kt_login_forgot_submit').on('click', function (e) {\n e.preventDefault();\n\n validation.validate().then(function(status) {\n\t\t if (status == 'Valid') {\n // Submit form\n KTUtil.scrollTop();\n\t\t\t\t} else {\n\t\t\t\t\tswal.fire({\n\t\t text: \"Sorry, looks like there are some errors detected, please try again.\",\n\t\t icon: \"error\",\n\t\t buttonsStyling: false,\n\t\t confirmButtonText: \"Ok, got it!\",\n customClass: {\n \t\t\t\t\t\tconfirmButton: \"btn font-weight-bold btn-light-primary\"\n \t\t\t\t\t}\n\t\t }).then(function() {\n\t\t\t\t\t\tKTUtil.scrollTop();\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t });\n });\n\n // Handle cancel button\n $('#kt_login_forgot_cancel').on('click', function (e) {\n e.preventDefault();\n\n _showForm('signin');\n });\n }\n\n // Public Functions\n return {\n // public functions\n init: function() {\n _login = $('#kt_login');\n\n _handleSignInForm();\n _handleSignUpForm();\n _handleForgotForm();\n }\n };\n}();\n\n// Class Initialization\njQuery(document).ready(function() {\n KTLogin.init();\n});\n"],"names":[],"sourceRoot":""}