{"version":3,"sources":["webpack:///webpack/bootstrap 18ae76087b773c166ed0?35be***************************","webpack:///./cartridges/app_bata_sfra/cartridge/client/default/js/institutional.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","id","loaded","modules","call","m","c","p","$","on","contactPhone","this","val","replace","e","preventDefault","form","url","attr","length","spinner","start","ajax","type","dataType","data","serialize","success","text","title","msg","stop","modal","error","err"],"mappings":"aACA,IAAAA,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,IACAC,WACAE,GAAAH,EACAI,QAAA,GAUA,OANAC,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,IAAAD,QAAAF,GAGAG,EAAAE,QAAA,EAGAF,EAAAD,QAKAF,EAAAQ,EAAAF,EAGAN,EAAAS,EAAAV,EAGAC,EAAAU,EAAA,GAGAV,EAAA,mBCtCA,aAKAW,EAAE,kBAAkBC,GAAG,OAAQ,WAC3B,IAAIC,EAAeF,EAAEG,MAAMC,MACvBF,IACAA,EAAeA,EAAaG,QAAQ,MAAO,IAC3CL,EAAEG,MAAMC,IAAIF,MAQhBF,EAAE,sBAAsBC,GAAG,SAAU,SAAUK,GAC3CA,EAAEC,iBACF,IAAIC,EAAOR,EAAEG,MACTM,EAAMD,EAAKE,KAAK,UAEc,IAA9BV,EAAE,iBAAiBW,SACnBX,EAAEY,UAAUC,QACZb,EAAEc,MACEL,IAAKA,EACLM,KAAM,OACNC,SAAU,OACVC,KAAMT,EAAKU,YACXC,QAAS,SAAUF,GACfjB,EAAE,mBAAmBoB,KAAKH,EAAKI,OAC/BrB,EAAE,eAAeoB,KAAKH,EAAKK,KAC3BtB,EAAEY,UAAUW,OACZvB,EAAE,wBAAwBwB,MAAM,SAEpCC,MAAO,SAAUC,GACb1B,EAAE,mBAAmBoB,KAAKM,EAAIL,OAC9BrB,EAAE,oBAAoBoB,KAAKM,EAAIJ,KAC/BtB,EAAEY,UAAUW,OACZvB,EAAE,wBAAwBwB,MAAM","file":"institutional.min.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\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\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.loaded = 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// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 18ae76087b773c166ed0","'use strict';\n\n/**\n * when the user focuses out of the contact phone input label, removes all the whitespaces if present (for example from autofill)\n */\n$('#contact-phone').on('blur', function() {\n let contactPhone = $(this).val();\n if (contactPhone) {\n contactPhone = contactPhone.replace(/\\s/g, '');\n $(this).val(contactPhone);\n }\n});\n\n/**\n * Ajax script that allows to submit form without refreshing the page and shows modal on submit\n */\nfunction submitForm() {\n $('form#institutional').on('submit', function (e) {\n e.preventDefault();\n var form = $(this);\n var url = form.attr('action');\n\n if ($('.custom-error').length === 0) {\n $.spinner().start();\n $.ajax({\n url: url,\n type: 'POST',\n dataType: 'json',\n data: form.serialize(),\n success: function (data) {\n $('#ModalFormTitle').text(data.title);\n $('#modal-body').text(data.msg);\n $.spinner().stop();\n $('#institutional-modal').modal('show');\n },\n error: function (err) {\n $('#ModalFormTitle').text(err.title);\n $('#modal-form-body').text(err.msg);\n $.spinner().stop();\n $('#institutional-modal').modal('show');\n }\n });\n }\n });\n}\n\nsubmitForm();\n\n\n\n// WEBPACK FOOTER //\n// ./cartridges/app_bata_sfra/cartridge/client/default/js/institutional.js"],"sourceRoot":""}