{"version":3,"sources":["webpack:///./src/_js/partials/channel-partners.js"],"names":[],"mappings":"0FAAA,wEAEwB,WAEpB,CAWa,YAGL,GAAE,qBAGF,UAGA,MAAU,YAAe,EAAE,uCAC3B,MAAU,QAAW,EAAE,mCAEvB,cAGA,SAAE,KACE,MACA,WACA,mBACA,2BACA,wBAAM,KACN,qBAAkB,WAEd,YAAW,UACP,GAAE,qBAEE,kBAAQ,IAAiB,eAAM,CAAE,QACjC,OAAE,UAAU,SACT,cACH,MAAE,kBAET,MACJ,MACD,QAAiC,UAC9B,OACF,iBAGR,GAED,SAnDI,IAGR,6CAAI,GAAe,QAAQ,IAG3B,aACI,WADO,cACL,UAAU,SAIZ,eAwCE,uCAAuC,GAAG,QAAmB,WAE3D,GAAE,kBAEF,SAEA,iBACI,UADA,QAAQ,sBAIZ,sBACI,cAEP,GAED,GACI,CADA,GAAE,gDAA8C,QAE5C,WADO,mBACA,SAAS,QAG/B","file":"channel-partners.js?v=a818fd1a44eedda19984","sourcesContent":["'use strict';\r\n\r\nexport default function($){\r\n\r\n console.log(\">> This comes from channel-partners.js\");\r\n\r\n // get cookie\r\n var $logInCookie = Cookies.get(\"agentAuth\");\r\n\r\n // show/access loged in details\r\n if (typeof $logInCookie !== \"undefined\") {\r\n $('#login').addClass('logged-in');\r\n };\r\n \r\n // control login\r\n function submitLogin() {\r\n\r\n // Show loading\r\n $('.loading--spinner').show();\r\n\r\n // validation\r\n var $formData = {\r\n };\r\n\r\n $formData['agentCode'] = $('[id*=\"PartnerLogin_txtAgentCode\"]').val();\r\n $formData['email'] = $('[id*=\"PartnerLogin_txtEmail\"]').val();\r\n\r\n console.log($formData);\r\n\r\n // post api\r\n $.ajax({\r\n type: \"POST\",\r\n url: \"/api/agent/login\",\r\n processData: false,\r\n contentType: 'application/json',\r\n data: JSON.stringify($formData),\r\n success: function(r) {\r\n // Show loading\r\n setTimeout(function(){\r\n $('.loading--spinner').hide();\r\n if (r) {\r\n Cookies.set(\"agentAuth\", true, { expires: 30 });\r\n $('#login').addClass('logged-in');\r\n } else if (!r) { \r\n $('.loading--fail').show();\r\n }\r\n }, 1000);\r\n },\r\n error: function(xhr, textStatus, errorThrown){\r\n alert('request failed');\r\n }\r\n \r\n });\r\n };\r\n\r\n $('.partner-login-container .btn-login').on('click', function (event) {\r\n \r\n $('.loading--fail').hide();\r\n \r\n event.preventDefault();\r\n\r\n if (typeof (Page_ClientValidate) === 'function') {\r\n Page_ClientValidate();\r\n };\r\n\r\n if (Page_IsValid) {\r\n submitLogin();\r\n };\r\n });\r\n\r\n if ($('.channel-partners-container[data-open=\"0\"]').length > 0) {\r\n if (typeof $logInCookie === \"undefined\") {\r\n window.location.replace('/information-for-partners');\r\n };\r\n }\r\n};\n\n\n// WEBPACK FOOTER //\n// ./src/_js/partials/channel-partners.js"],"sourceRoot":""}