{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./cartridges/app_custom_masymas/cartridge/client/default/js/redirectUrl.js","webpack:///./cartridges/int_loyalguru/cartridge/client/default/js/components/errorNotification.js","webpack:///./cartridges/int_loyalguru/cartridge/client/default/js/components/formValidation.js","webpack:///./cartridges/int_loyalguru/cartridge/client/default/js/login.js","webpack:///./cartridges/int_loyalguru/cartridge/client/default/js/login/login.js","webpack:///./cartridges/int_loyalguru/cartridge/client/default/js/util.js","webpack:///(webpack)/buildin/module.js"],"names":[],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;;;;;;;;AChFA;AACA;AACA,YAAY;AACZ;AACO;;AAEP;AACA;;AAEA;AACA;AACA,YAAY,OAAO;AACnB;AACO;AACP;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA,YAAY,SAAS;AACrB;AACO;AACP;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACO;AACP;AACA;AACA;;;;;;;;;;;;;AC5Ca;;AAEb;AACA;AACA;AACA;AACA,yCAAyC;AACzC;;AAEA;AACA;;;;;;;;;;;;;ACVa;;AAEb;AACA;AACA,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;;AC1Ca;;AAEb,qBAAqB,mBAAO,CAAC,8EAAQ;;AAErC;AACA,mBAAmB,mBAAO,CAAC,4FAAe;AAC1C,CAAC;;;;;;;;;;;;;ACND,8CAAa;;AAEb;;AAEA,qBAAqB,mBAAO,CAAC,yHAA8B;AAC3D,8BAA8B,mBAAO,CAAC,+HAAiC;AACvE,OAAO,sDAAsD,GAAG,mBAAO,CAAC,gKAA8E;;AAEtJ;AACA;AACA;AACA;AACA,kEAAkE,MAAM;AACxE;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,gE;AACA;AACA;AACA;AACA;AACA,2EAA2E,iBAAiB,IAAI,QAAQ;;AAExG;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;;AAEA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC,iB;;;;;;;;;;;;;AC1OpB;;AAEb;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;;;;;;;;;;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA","file":"default/js/login.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./cartridges/int_loyalguru/cartridge/client/default/js/login.js\");\n","\n\n/**\n * saves the url before go to selection stores enviroment\n * @return {void}\n */\nexport function saveUrlInSessionStorage (url = window.location.href) {\n\n sessionStorage.setItem ('mymUrlPrevious', url);\n}\n\n/**\n * retuns the previous url stored before store selection\n * @return {string} previous url if exists in sessionStorage\n */\nexport function recoverUrlInSessionStorage() {\n const previousUrl = sessionStorage.getItem('mymUrlPrevious');\n if (previousUrl) {\n return previousUrl;\n } else {\n return null;\n }\n}\n\n/**\n * retuns boolean when the function is called from checkout page\n * @return {booblean} isCalledFromCheckout\n */\nexport function verifyUrlInSessionStorage() {\n const previousUrl = sessionStorage.getItem('mymUrlPrevious');\n if (previousUrl && previousUrl.endsWith('shipping')) {\n return true;\n } else {\n return false;\n }\n}\n\n/**\n * retuns miniCart Quantity\n * @return {string}\n */\nexport function verifyMiniCartQuantity() {\n const minicartQuantity = parseInt($('.minicart-quantity .text').text().trim(), 10);\n return minicartQuantity;\n}\n","'use strict';\n\nmodule.exports = function (element, message) {\n var errorHtml = '
' +\n '' + message + '
';\n\n $(element).append(errorHtml);\n};\n","'use strict';\n\n/**\n * Remove all validation. Should be called every time before revalidating form\n * @param {element} form - Form to be cleared\n * @returns {void}\n */\nfunction clearFormErrors(form) {\n $(form).find('.form-control.is-invalid').removeClass('is-invalid');\n}\n\nmodule.exports = function (formElement, payload) {\n // clear form validation first\n clearFormErrors(formElement);\n $('.alert', formElement).remove();\n\n if (typeof payload === 'object' && payload.fields) {\n Object.keys(payload.fields).forEach(function (key) {\n if (payload.fields[key]) {\n var feedbackElement = $(formElement).find('[name=\"' + key + '\"]')\n .parent()\n .children('.invalid-feedback');\n\n if (feedbackElement.length > 0) {\n if (Array.isArray(payload[key])) {\n feedbackElement.html(payload.fields[key].join('
'));\n } else {\n feedbackElement.html(payload.fields[key]);\n }\n feedbackElement.siblings('.form-control').addClass('is-invalid');\n }\n }\n });\n }\n if (payload && payload.error) {\n var form = $(formElement).prop('tagName') === 'FORM'\n ? $(formElement)\n : $(formElement).parents('form');\n\n form.prepend('
'\n + payload.error.join('
') + '
');\n }\n};\n","'use strict';\n\nvar processInclude = require('./util');\n\n$(document).ready(function () {\n processInclude(require('./login/login'));\n});\n","'use strict';\n\nvar base = module.superModule;\n\nvar formValidation = require('../components/formValidation');\nvar createErrorNotification = require('../components/errorNotification');\nconst { saveUrlInSessionStorage, recoverUrlInSessionStorage } = require('../../../../../../app_custom_masymas/cartridge/client/default/js/redirectUrl');\n\nfunction loyalGuruParamsErrorTrigger(data,form) {\n Object.keys(data.fieldErrors).forEach(function (field) {\n var errorMessage = data.fieldErrors[field];\n if (errorMessage != ''){\n var fieldElement = form.find(`[id=registration-form-${field}]`);\n fieldElement.addClass('is-invalid');\n fieldElement.siblings('.invalid-feedback').text(errorMessage).show();\n }\n });\n}\n\nfunction registrationDialogTrigger(data) {\n var $dialogContainer = $('.registrationAlertEmailSent');\n $dialogContainer.empty().html(data.dialogHtml);\n\n if ($('#registrationAlertEmailDialog').length > 0) {\n $('#registrationAlertEmailDialog').modal('show');\n } else if ($('#loginAlertEmailDialog').length > 0) {\n $('#loginAlertEmailDialog').modal('show');\n }\n}\n\n/**\n * Create an alert to display the alert message\n * @param {Object} message - Message to display\n * @param {string} notificationType - type of notification to print correct alert color\n */\n function displayMessageDoubleOptin(notificationType, message) { \n if ($('.add-to-wishlist-messages').length === 0) {\n $('body').append('
');\n }\n $('.add-to-wishlist-messages')\n .append(`
${message}
`);\n\n setTimeout(() => {\n $('.add-to-wishlist-messages').remove();\n }, 5000);\n}\n\nfunction register () {\n $('form.registration').submit(function (e) {\n var form = $(this);\n var doubleOptinAlertMessageError = $('form.registration>span').attr('data-double-optin-error');\n e.preventDefault();\n var url = form.attr('action');\n form.spinner().start();\n $('form.registration').trigger('login:register', e);\n $.ajax({\n url: url,\n type: 'post',\n dataType: 'json',\n data: form.serialize(),\n success: function (data) {\n form.spinner().stop();\n if (!data.success) {\n $('form.registration').trigger('login:register:error', data);\n formValidation(form, data);\n } else {\n registrationDialogTrigger(data);\n }\n },\n error: function (err) {\n if (err.responseJSON && err.responseJSON.errorMessage) {\n displayMessageDoubleOptin('alert-danger', err.responseJSON.errorMessage);\n loyalGuruParamsErrorTrigger(err.responseJSON,form);\n } else {\n displayMessageDoubleOptin('alert-danger' , doubleOptinAlertMessageError);\n }\n form.spinner().stop();\n }\n });\n return false;\n });\n}\n\nfunction login () {\n $('form.login').submit(function (e) {\n var form = $(this);\n e.preventDefault();\n var url = form.attr('action');\n form.spinner().start();\n $('form.login').trigger('login:submit', e);\n $.ajax({\n url: url,\n type: 'post',\n dataType: 'json',\n data: form.serialize(),\n success: function (data) {\n form.spinner().stop();\n if (!data.success) {\n formValidation(form, data);\n $('form.login').trigger('login:error', data);\n } else {\n $('form.login').trigger('login:success', data);\n var storedUrl = recoverUrlInSessionStorage();\n\n if (storedUrl && storedUrl.includes('Checkout-Begin')) {\n location.href = storedUrl;\n sessionStorage.setItem ('mymUrlPrevious', \"\");\n } else {\n location.href = data.redirectUrl;\n }\n }\n },\n error: function (data) {\n if (data.responseJSON.redirectUrl) {\n window.location.href = data.responseJSON.redirectUrl;\n } else {\n $('form.login').trigger('login:error', data);\n form.spinner().stop();\n }\n }\n });\n return false;\n });\n}\n\nfunction resetPassword () {\n $('.reset-password-form').submit(function (e) {\n var form = $(this);\n e.preventDefault();\n var url = form.attr('action');\n form.spinner().start();\n $('.reset-password-form').trigger('login:register', e);\n $.ajax({\n url: url,\n type: 'post',\n dataType: 'json',\n data: form.serialize(),\n success: function (data) {\n form.spinner().stop();\n if (!data.success) {\n formValidation(form, data);\n } else {\n $('.request-password-title').text(data.receivedMsgHeading);\n $('.request-password-body').empty()\n .append('

' + data.receivedMsgBody + '

');\n if (!data.mobile) {\n $('#submitEmailButton').text(data.buttonText)\n .attr('data-dismiss', 'modal');\n } else {\n $('.send-email-btn').empty()\n .html(''\n + data.buttonText + ''\n );\n }\n }\n },\n error: function () {\n form.spinner().stop();\n }\n });\n return false;\n });\n}\n\nfunction clearResetForm () {\n $('#login .modal').on('hidden.bs.modal', function () {\n $('#reset-password-email').val('');\n $('.modal-dialog .form-control.is-invalid').removeClass('is-invalid');\n });\n}\n\nfunction test () {\n $('#login-tab').on('click', function () {\n $('#register-tab').removeClass('active').attr('aria-selected', 'false');\n $('#login-tab').addClass('active').attr('aria-selected', 'true');\n $('#register').removeClass('active');\n $('#login').addClass('active');\n });\n \n $('#register-tab').on('click', function () {\n $('#login-tab').removeClass('active').attr('aria-selected', 'false');\n $('#register-tab').addClass('active').attr('aria-selected', 'true');\n $('#login').removeClass('active');\n $('#register').addClass('active');\n });\n}\n\nfunction hideShowPassword () {\n $('body').on('click', '.hideShow', function () {\n var inputPassword = $('#registration-form-password');\n if(inputPassword.attr('type') === 'password') {\n inputPassword.attr('type','text');\n $('.icon').removeClass('fa fa-eye-slash').addClass('fa fa-eye');\n } else {\n inputPassword.attr('type','password');\n $('.icon').removeClass('fa fa-eye').addClass('fa fa-eye-slash');\n }\n });\n $('body').on('click', '.hideShowLogIn', function () {\n var inputPassword = $('#login-form-password');\n if(inputPassword.attr('type') === 'password') {\n inputPassword.attr('type','text');\n $('.icon').removeClass('fa fa-eye-slash').addClass('fa fa-eye');\n } else {\n inputPassword.attr('type','password');\n $('.icon').removeClass('fa fa-eye').addClass('fa fa-eye-slash');\n }\n });\n}\n\nfunction hideShowPasswordConfirm () {\n $('body').on('click', '.hideShowConfirm', function () {\n var inputPassword = $('#registration-form-password-confirm');\n if(inputPassword.attr('type') === 'password') {\n inputPassword.attr('type','text');\n $('.iconConfirm').removeClass('fa fa-eye-slash').addClass('fa fa-eye');\n } else {\n inputPassword.attr('type','password');\n $('.iconConfirm').removeClass('fa fa-eye').addClass('fa fa-eye-slash');\n }\n });\n}\nvar exports = {\n register: register,\n login: login,\n resetPassword: resetPassword,\n clearResetForm: clearResetForm,\n hideShowPassword: hideShowPassword,\n hideShowPasswordConfirm: hideShowPasswordConfirm,\n test: test\n}\n\nmodule.exports = Object.assign({}, base, exports);","'use strict';\n\nmodule.exports = function (include) {\n if (typeof include === 'function') {\n include();\n } else if (typeof include === 'object') {\n Object.keys(include).forEach(function (key) {\n if (typeof include[key] === 'function') {\n include[key]();\n }\n });\n }\n};\n","module.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n"],"sourceRoot":""}