/* Minification failed. Returning unminified contents. (3,1-6): run-time error JS1195: Expected expression: class (4,38-39): run-time error JS1004: Expected ';': { (35,12-13): run-time error JS1004: Expected ';': { (49,47-48): run-time error JS1014: Invalid character: ` (49,49-50): run-time error JS1193: Expected ',' or ')': { (49,66-67): run-time error JS1004: Expected ';': { (49,84-85): run-time error JS1004: Expected ';': { (49,95-96): run-time error JS1004: Expected ';': { (49,107-108): run-time error JS1004: Expected ';': { (49,118-119): run-time error JS1004: Expected ';': { (49,130-131): run-time error JS1004: Expected ';': { (49,139-140): run-time error JS1014: Invalid character: ` (49,140-141): run-time error JS1195: Expected expression: ) (62,21-22): run-time error JS1195: Expected expression: ) (62,23-24): run-time error JS1195: Expected expression: > (62,77-78): run-time error JS1004: Expected ';': ) (65,16-17): run-time error JS1004: Expected ';': { (114,16-17): run-time error JS1004: Expected ';': { (124,18-19): run-time error JS1004: Expected ';': { (132,55-56): run-time error JS1195: Expected expression: ) (132,58-59): run-time error JS1195: Expected expression: > (132,77-78): run-time error JS1004: Expected ';': ) (135,55-56): run-time error JS1195: Expected expression: ) (135,58-59): run-time error JS1195: Expected expression: > (135,129-130): run-time error JS1195: Expected expression: ) (151,23-24): run-time error JS1004: Expected ';': { (157,48-49): run-time error JS1195: Expected expression: ) (157,51-52): run-time error JS1195: Expected expression: > (157,70-71): run-time error JS1004: Expected ';': ) (158,37-48): run-time error JS1197: Too many errors. The file might not be a JavaScript file: closeButton (104,17-23): run-time error JS1018: 'return' statement outside of function: return */ 'use strict'; class Ax5Alerts { constructor(divWrapper, options) { this._divWrapper = document.getElementById(divWrapper); this._bodyWitdh = options.width; this._bodyHeight = options.height; this._maxWidth = options.max_width; this._minWidth = options.min_width; this._maxHeight = options.max_height; this._minHeight = options.min_height; this._text = options.message; this._icon = options.icon; this._button = options.button; this._btnAction = options.btn_action; this._btnText = options.btn_text; this._hasHtmlContent = options.has_html; this._htmlContent = options.html_content; this._closeButton = options.close_button; this._confirmDialog = options.confirm_dialog; this._confirmAction = options.confirm_action; this._cancelAction = options.cancel_action; this._confirmBtnText = options.confirm_btn_txt; this._confirmBtnWidth = options.confirm_btn_width; this._cancelBtnText = options.cancel_btn_txt; this._cancelBtnWidth = options.cancel_btn_width; this._btnGroupWidth = options.btn_group_width; this._ignoreEscKey = options.ignore_esc_key; this._fixedWrapper = options.fixed_wrapper; this._padding = options.padding; this._modalBody; this.init(); } init() { this.pressEnter(); this._divWrapper.innerHTML = ""; this._divWrapper.classList.add('modal-wrapper-show'); if (this._fixedWrapper === true) this._divWrapper.classList.add('modal-wrapper-fixed'); this._modalBody = document.createElement('div') const maxWidth = (this._maxWidth !== '' && this._maxWidth !== undefined) ? 'max-width:' + this._maxWidth + ';' : ''; const maxHeight = (this._maxHeight !== '' && this._maxHeight !== undefined) ? 'max-height:' + this._maxHeight + ';': ''; const minWidth = (this._minWidth !== '' && this._minWidth !== undefined) ? 'min-width:' + this._minWidth + ';' : ''; const minHeight = (this._minHeight !== '' && this._minHeight !== undefined) ? 'min-height:' + this._minHeight + ';' : ''; const alertbodyWidth = (this._bodyWitdh !== '' && this._bodyWitdh !== undefined) ? 'width:' + this._bodyWitdh + ';' : ''; const alertbodyHeight = (this._bodyHeight !== '' && this._bodyHeight !== undefined) ? 'height:' + this._bodyHeight + ';' : ''; const padding = (this._padding !== '' && this._padding !== undefined) ? 'padding:' + this._padding + ';' : ''; this._modalBody.setAttribute('style', `${alertbodyWidth}${alertbodyHeight}${maxWidth}${maxHeight}${minWidth}${minHeight}${padding}`); this._modalBody.setAttribute('class', 'modal-body'); this._divWrapper.appendChild(this._modalBody); if(this._hasHtmlContent) this.showInnerHtml(); else { this.showIcon(); this.showText(); } this.showButton(); this.showConfirmButton(); if(this._closeButton) this.showCloseButton(); setTimeout(()=> this._modalBody.classList.add('modal-body-show'), 25); } showIcon() { let icon; switch(this._icon) { case 'loading': icon = document.createElement('div'); icon.setAttribute('class', 'lds-ring lds-ring-'); icon.innerHTML = '
'; break; case 'error': icon = document.createElement('div'); icon.setAttribute('class', 'error-icon'); icon.innerHTML = ''; break; case 'success': icon = document.createElement('div'); icon.setAttribute('class', 'success-icon'); icon.innerHTML = ''; break; case 'info': icon = document.createElement('div'); icon.setAttribute('class', 'info-icon'); icon.innerHTML = ''; break; case 'question': icon = document.createElement('div'); icon.setAttribute('class', 'info-icon'); icon.innerHTML = ''; break; case 'warning': icon = document.createElement('div'); icon.setAttribute('class', 'warning-icon'); icon.innerHTML = ''; break; case 'shopping-cart': icon = document.createElement('div'); icon.setAttribute('class', 'cart-icon'); icon.innerHTML = '
'; break; case 'none': return; default: icon = document.createElement('div'); icon.setAttribute('class', 'lds-ring lds-ring-'); icon.innerHTML = '
'; break; } this._modalBody.appendChild(icon); } showText() { let msgText; if(this._text !== '' && this._text !== null && this._text !== undefined) { msgText = document.createElement('p'); msgText.setAttribute('class', 'alert-msg'); msgText.innerHTML = this._text; this._modalBody.appendChild(msgText); } } showButton() { let button; if(this._button) { button = document.createElement('div'); button.setAttribute('id', 'btnAx5Alert'); button.setAttribute('class', 'btn-div-alert'); switch(this._btnAction) { case 'close': button.addEventListener('click', () => this.closeAlert()); break; case 'closeAndReload': button.addEventListener('click', () => { this.closeAlert(); location.href = location.href.replace('#',''); }); break; default: button.setAttribute('onclick', this._btnAction); break; } if (this._btnText) { button.innerHTML = this._btnText; } else { button.innerHTML = 'Aceptar'; } this._modalBody.appendChild(button); } } showCloseButton() { let closeButton; closeButton = document.createElement('div'); closeButton.setAttribute('id', 'closeButtonAx5Alert'); closeButton.setAttribute('class', 'close-btn-alert'); closeButton.innerHTML = ''; closeButton.addEventListener('click', () => this.closeAlert()); this._modalBody.appendChild(closeButton); } showInnerHtml() { let innerHTML; innerHTML = document.createElement('div'); innerHTML.setAttribute('id', 'htmlContentAx5Alert'); innerHTML.setAttribute('class', 'html-content-alert'); innerHTML.innerHTML = this._htmlContent; this._modalBody.appendChild(innerHTML); } showConfirmButton() { if (this._confirmDialog) { let confirmButtonGroup; let confirmButton; let cancelButton; confirmButtonGroup = document.createElement('div'); confirmButtonGroup.setAttribute('class', 'btn-confirm-group'); if (this._btnGroupWidth) confirmButtonGroup.setAttribute('style', 'width:' + this._btnGroupWidth + ';'); confirmButton = document.createElement('div'); confirmButton.setAttribute('id', 'btnAx5Alert'); confirmButton.setAttribute('class', 'btn-alert-confirm'); confirmButton.setAttribute('onclick', this._confirmAction); if (this._confirmBtnText) confirmButton.innerText = this._confirmBtnText; else confirmButton.innerText = 'Si'; if (this._confirmBtnWidth) confirmButton.setAttribute('style', 'width:' + this._confirmBtnWidth + ';'); confirmButtonGroup.appendChild(confirmButton); cancelButton = document.createElement('div'); cancelButton.setAttribute('id', 'btnCancelAx5Alert'); cancelButton.setAttribute('class', 'btn-alert-cancel'); cancelButton.addEventListener('click', () => this.closeAlert()); if (this._cancelBtnText) cancelButton.innerText = this._cancelBtnText; else cancelButton.innerText = 'No'; if (this._cancelBtnWidth) cancelButton.setAttribute('style', 'width:' + this._cancelBtnWidth + ';'); if (this._cancelAction) cancelButton.setAttribute('onclick', this._cancelAction); confirmButtonGroup.appendChild(cancelButton); this._modalBody.appendChild(confirmButtonGroup); } } closeAlert() { this._modalBody.classList.remove('modal-body-show'); setTimeout(() => { this._divWrapper.classList.remove('modal-wrapper-show'); if (typeof (togglebar) === 'function') togglebar('light'); }, 500); setTimeout(() => { this._divWrapper.innerHTML = ""; }, 600); } pressEnter() { document.addEventListener('keydown', (e)=> { //e.stopPropagation(); if (this._divWrapper.classList.contains('modal-wrapper-show')) { if (e.key === 'Enter') { if (document.getElementById('btnAx5Alert') !== null) { e.preventDefault(); document.getElementById('btnAx5Alert').click(); } } else if (e.key === 'Escape') { e.preventDefault(); if (this._ignoreEscKey !== true) { //if (document.getElementById('btnCancelAx5Alert') === null) // document.getElementById('btnAx5Alert').click(); //else // document.getElementById('btnCancelAx5Alert').click(); if (document.getElementById('btnAx5Alert') !== null) document.getElementById('btnAx5Alert').click(); else if (document.getElementById('btnCancelAx5Alert') !== null) document.getElementById('btnCancelAx5Alert').click(); else if (document.getElementById('closeButtonAx5Alert') !== null) document.getElementById('closeButtonAx5Alert').click(); } } } }); } }; /** Abstract base class for collection plugins v1.0.1. Written by Keith Wood (kbwood{at}iinet.com.au) December 2013. Licensed under the MIT (http://keith-wood.name/licence.html) license. */ (function(){var j=false;window.JQClass=function(){};JQClass.classes={};JQClass.extend=function extender(f){var g=this.prototype;j=true;var h=new this();j=false;for(var i in f){h[i]=typeof f[i]=='function'&&typeof g[i]=='function'?(function(d,e){return function(){var b=this._super;this._super=function(a){return g[d].apply(this,a||[])};var c=e.apply(this,arguments);this._super=b;return c}})(i,f[i]):f[i]}function JQClass(){if(!j&&this._init){this._init.apply(this,arguments)}}JQClass.prototype=h;JQClass.prototype.constructor=JQClass;JQClass.extend=extender;return JQClass}})();(function($){JQClass.classes.JQPlugin=JQClass.extend({name:'plugin',defaultOptions:{},regionalOptions:{},_getters:[],_getMarker:function(){return'is-'+this.name},_init:function(){$.extend(this.defaultOptions,(this.regionalOptions&&this.regionalOptions[''])||{});var c=camelCase(this.name);$[c]=this;$.fn[c]=function(a){var b=Array.prototype.slice.call(arguments,1);if($[c]._isNotChained(a,b)){return $[c][a].apply($[c],[this[0]].concat(b))}return this.each(function(){if(typeof a==='string'){if(a[0]==='_'||!$[c][a]){throw'Unknown method: '+a;}$[c][a].apply($[c],[this].concat(b))}else{$[c]._attach(this,a)}})}},setDefaults:function(a){$.extend(this.defaultOptions,a||{})},_isNotChained:function(a,b){if(a==='option'&&(b.length===0||(b.length===1&&typeof b[0]==='string'))){return true}return $.inArray(a,this._getters)>-1},_attach:function(a,b){a=$(a);if(a.hasClass(this._getMarker())){return}a.addClass(this._getMarker());b=$.extend({},this.defaultOptions,this._getMetadata(a),b||{});var c=$.extend({name:this.name,elem:a,options:b},this._instSettings(a,b));a.data(this.name,c);this._postAttach(a,c);this.option(a,b)},_instSettings:function(a,b){return{}},_postAttach:function(a,b){},_getMetadata:function(d){try{var f=d.data(this.name.toLowerCase())||'';f=f.replace(/'/g,'"');f=f.replace(/([a-zA-Z0-9]+):/g,function(a,b,i){var c=f.substring(0,i).match(/"/g);return(!c||c.length%2===0?'"'+b+'":':b+':')});f=$.parseJSON('{'+f+'}');for(var g in f){var h=f[g];if(typeof h==='string'&&h.match(/^new Date\((.*)\)$/)){f[g]=eval(h)}}return f}catch(e){return{}}},_getInst:function(a){return $(a).data(this.name)||{}},option:function(a,b,c){a=$(a);var d=a.data(this.name);if(!b||(typeof b==='string'&&c==null)){var e=(d||{}).options;return(e&&b?e[b]:e)}if(!a.hasClass(this._getMarker())){return}var e=b||{};if(typeof b==='string'){e={};e[b]=c}this._optionsChanged(a,d,e);$.extend(d.options,e)},_optionsChanged:function(a,b,c){},destroy:function(a){a=$(a);if(!a.hasClass(this._getMarker())){return}this._preDestroy(a,this._getInst(a));a.removeData(this.name).removeClass(this._getMarker())},_preDestroy:function(a,b){}});function camelCase(c){return c.replace(/-([a-z])/g,function(a,b){return b.toUpperCase()})}$.JQPlugin={createPlugin:function(a,b){if(typeof a==='object'){b=a;a='JQPlugin'}a=camelCase(a);var c=camelCase(b.name);JQClass.classes[c]=JQClass.classes[a].extend(b);new JQClass.classes[c]()}}})(jQuery);; /* http://keith-wood.name/realPerson.html Real Person Form Submission for jQuery v2.0.1. Written by Keith Wood (kwood{at}iinet.com.au) June 2009. Available under the MIT (http://keith-wood.name/licence.html) license. Please attribute the author if you use it. */ const langRp = (window.location.host.indexOf('.com.br') == -1 && typeof (forceLang) == 'undefined') ? 'esp' : 'br'; (function($){var h='realperson';var k='ABCDEFGHIJKLMNOPQRSTUVWXYZ';var l=k+'0123456789';var m=[[' * ',' * * ',' * * ',' * * ',' ***** ','* *','* *'],['****** ','* *','* *','****** ','* *','* *','****** '],[' ***** ','* *','* ','* ','* ','* *',' ***** '],['****** ','* *','* *','* *','* *','* *','****** '],['*******','* ','* ','**** ','* ','* ','*******'],['*******','* ','* ','**** ','* ','* ','* '],[' ***** ','* *','* ','* ','* ***','* *',' ***** '],['* *','* *','* *','*******','* *','* *','* *'],['*******',' * ',' * ',' * ',' * ',' * ','*******'],[' *',' *',' *',' *',' *','* *',' ***** '],['* *','* ** ','* ** ','** ','* ** ','* ** ','* *'],['* ','* ','* ','* ','* ','* ','*******'],['* *','** **','* * * *','* * *','* *','* *','* *'],['* *','** *','* * *','* * *','* * *','* **','* *'],[' ***** ','* *','* *','* *','* *','* *',' ***** '],['****** ','* *','* *','****** ','* ','* ','* '],[' ***** ','* *','* *','* *','* * *','* * ',' **** *'],['****** ','* *','* *','****** ','* * ','* * ','* *'],[' ***** ','* *','* ',' ***** ',' *','* *',' ***** '],['*******',' * ',' * ',' * ',' * ',' * ',' * '],['* *','* *','* *','* *','* *','* *',' ***** '],['* *','* *',' * * ',' * * ',' * * ',' * * ',' * '],['* *','* *','* *','* * *','* * * *','** **','* *'],['* *',' * * ',' * * ',' * ',' * * ',' * * ','* *'],['* *',' * * ',' * * ',' * ',' * ',' * ',' * '],['*******',' * ',' * ',' * ',' * ',' * ','*******'],[' *** ',' * * ','* * *','* * *','* * *',' * * ',' *** '],[' * ',' ** ',' * * ',' * ',' * ',' * ','*******'],[' ***** ','* *',' *',' * ',' ** ',' ** ','*******'],[' ***** ','* *',' *',' ** ',' *','* *',' ***** '],[' * ',' ** ',' * * ',' * * ','*******',' * ',' * '],['*******','* ','****** ',' *',' *','* *',' ***** '],[' **** ',' * ','* ','****** ','* *','* *',' ***** '],['*******',' * ',' * ',' * ',' * ',' * ','* '],[' ***** ','* *','* *',' ***** ','* *','* *',' ***** '],[' ***** ','* *','* *',' ******',' *',' * ',' **** ']];$.JQPlugin.createPlugin({name:h,alphabetic:k,alphanumeric:l,defaultDots:m,defaultOptions:{length:6, regenerate: langRp === 'esp' ? 'Click para cambiar':'Clique para mudar',hashName:'{n}Hash',dot:'*',dots:m,chars:k},_getters:['getHash'],_challengeClass:h+'-challenge',_disabledClass:h+'-disabled',_hashClass:h+'-hash',_regenerateClass:h+'-regen',_textClass:h+'-text',_optionsChanged:function(c,d,e){$.extend(d.options,e);var f='';for(var i=0;i');setTimeout(function(){b.find('input[name="'+a+'"]').remove()},0)});c.prevAll('.'+this._challengeClass+',.'+this._hashClass).remove().end().before(this._generateHTML(d,f)).prevAll('div.'+this._challengeClass).click(function(){if(!$(this).hasClass(g._disabledClass)){c.realperson('option',{})}})},enable:function(a){a=$(a);if(!a.hasClass(this._getMarker())){return}a.removeClass(this._disabledClass).prop('disabled',false).prevAll('.'+this._challengeClass).removeClass(this._disabledClass)},disable:function(a){a=$(a);if(!a.hasClass(this._getMarker())){return}a.addClass(this._disabledClass).prop('disabled',true).prevAll('.'+this._challengeClass).addClass(this._disabledClass)},getHash:function(a){var b=this._getInst(a);return b?b.hash:0},_generateHTML:function(a,b){var c='
'+'
';for(var i=0;i'+a.options.regenerate+'
';return c},_preDestroy:function(a,b){a.closest('form').off('.'+b.name);a.prevAll('.'+this._challengeClass+',.'+this._hashClass).remove()}});var n=$.salt||'#salt';delete $.salt;$(function(){var a=$(n);if(a.length){n=a.text();a.remove()}if(n==='#salt'){n=''}});function hash(a){var b=5381;for(var i=0;iContinuar con Facebook", //CONTINUAR_GOOGLE: "Continuar con Google", CONTINUAR_GOOGLE: "Google LoogoContinuar con Google", VOLVER_ATRAS: "Volver atrás", VOLVIENDO: "Volviendo...", /*ERRORES FORMU*/ TERM_Y_COND: "Debes aceptar los términos y condiciones.", NOMBRE__INVALIDO: "El nombre de puede contener sólo letras y números, y debe tener entre 4 y 12 caracteres", NOMBRE__LONG_INVALIDA: "El nombre de debe tener entre 4 y 12 letras", CONTRASENA_LONG_INVALIDA: "La contraseña debe tener al menos 6 caracteres.", CONTRASENA_INVALIDA: "La contraseña ingresada no es válida", EMAIL_LONG_INVALIDA: "La dirección de E-mail debe tener menos de 100 caractéres.", EMAIL_YA_EXISTE: "Ya existe un registrado con la misma dirección de E-mail.", EMAIL_INVALIDO: "La dirección de E-mail no es válida", SEXO_REQUERIDO: "Selecciona una opción.", PAIS_REQUERIDO: "Selecciona país.", CONTRASENAS_NO_COINCIDEN: "No coinciden las contraseñas", EMAILS_NO_COINCIDEN: "No coinciden las direcciones de E-mail", CORRIGE_CAMPOS: "Por favor, corrige los campos marcados con rojo", COMPLETAR_CAMPOS: "Por favor, completa los campos vacios", NOMBRE__YA_EXISTE: "El nombre de usario ya existe", CORRIGE_CAMPOS_REQUERIDOS: "Por favor, completa todos los datos requeridos", PROCESANDO: "Por favor, espera mientras procesamos tu información", PROCESANDO_VINC_CUENTA: "Por favor, espera mientras asociamos tu cuenta", ERROR_VINC_CUENTA: "Error en la asociación de cuenta", CONF_MAIL_REENVIADO: "Ya has reenviado el correo de confirmación", RECUP_CUENTA: " puedes recuperarla.", EMAIL_SENT: "E-mail enviado", _BANNED: " suspendido", _NO_EXISTE: " o contraseña incorectos", _NO_EXISTE_RECOVER_: "El ingresado no existe", CAPTCHA_NO_VALIDO: "El código ingresado no es válido", DEMASIADOS_INTENTOS: "Has realizado demasiados intentos de
Ingresa el código de seguridad", CUENTA_NO_CONFIRMADA: "Tu cuenta no ha sido confirmada aún", ERROR_SOLICITUD: "Ocurrió un error procesando la solicitud", TXT_MAIL_CONFIRM: "Sigue el instructivo que has recibido en la cuenta de correo que utilizaste para registrarte y confirma tu cuenta para poder ingresar.
Si no recibiste el mail de confirmación, haz click a continuación para que te lo enviemos nuevamente", BTN_MAIL_CONFIRM: "Renviar E-mail de confirmación", //FACEBOOK__COMPLETE: "Has completado tu registro y vinculado tu cuenta con Facebook", GOOGLE__COMPLETE: "Has completado tu registro y vinculado tu cuenta con Google", //FACEBOOK_VINCULATE_COMPLETE: "Vinculación exitosa con Facebook", GOOGLE_VINCULATE_COMPLETE: "Vinculación exitosa con Google", //YA_TENES_CUENTA_FACEBOOK: "Ya existe una cuenta con el mismo e-mail, para vincularla con Facebook, ingresa tu contraseña de Axeso5 y pulsa el boton de 'VINCULAR CUENTA'", YA_TENES_CUENTA_GOOGLE: "Ya existe una cuenta con el mismo e-mail, para vincularla con Google, ingresa tu contraseña de Axeso5 y pulsa el botón de 'VINCULAR CUENTA'", //NECESITAS_CUENTA_FACEBOOK: "Necesitas un Nombre de y E-mail asociado a tu cuenta de Facebook para registrarte. Completa los datos y haz click en el botón 'CREA TU CUENTA' para continuar", NECESITAS_CUENTA_GOOGLE: "Necesitas un Nombre de y E-mail asociado a tu cuenta de Google para registrarte. Completa los datos y haz click en el botón 'CREA TU CUENTA' para continuar", //PORFAVOR_VINCULA_TU_CUENTA_FACEBOOK: "Por favor, vincula tu cuenta con Facebok", PORFAVOR_VINCULA_TU_CUENTA_GOOGLE: "Por favor, vincula tu cuenta con Google", DESCARGA_NO_DISPONIBLE: "Descarga no disponible en este momento, por favor intenta nuevamente mas tarde", ESPERAR_VALIDACION: "Espera mientras validamos tu información", _SIN_EMAIL: "No cuentas con un correo electrónico en tu cuenta. Comunícate con soporte para resolver tu situación", EMAIL_NO_VALIDO: "El correo electrónico no es válido", }; if (typeof (lang) == 'undefined') { var lang = langTemp; } else { for (let key in langTemp) { lang[key] = langTemp[key] } } } else { langTemp = { LANG_CODE: "pt-BR", INICIAR_SESION: "Iniciar sessão", INICIAR_SESION_COMP: "Faça com sua conta Axeso5", : "Usuário", : "Senha", CREAR_CUENTA: "Crie a sua conta", VINCULAR_CUENTA: "Link ", REALPERSON_CODIGO: "DIGITE O CODIGO", REALPERSON_CLICK: "Clique para mudar", CONDICIONES_DE_USO: "Li e aceito as condições de uso", OLVIDO_: "Recupere seu usuário", OLVIDO_: "Você esqueceu sua senha?", ENVIANDO_SOLICITUD: "Em processamento...", ACEPTAR: "Aceitar", CONTINUAR: "Prosseguir", //CONTINUAR_FACEBOOK: "Continuar com Facebook", CONTINUAR_GOOGLE: "Google LogoContinuar com Google", VOLVER_ATRAS: "Voltar atrás", VOLVIENDO: "Voltando...", /*ERRORES FORMU*/ TERM_Y_COND: "Você deve aceitar os termos e condições.", NOMBRE__INVALIDO: "O nome de usuário pode conter apenas letras e números e deve ter entre 4 e 12 caracteres", NOMBRE__LONG_INVALIDA: "O nome de usuário deve ter entre 4 e 12 letras", CONTRASENA_LONG_INVALIDA: "A senha deve ter pelo menos 6 dígitos.", CONTRASENA_INVALIDA: "A senha digitada não é válido", EMAIL_LONG_INVALIDA: "O endereço de E-mail deve ser inferior a 100 caracteres.", EMAIL_YA_EXISTE: "Já existe um usuário cadastrado com o mesmo endereço de E-mail.", EMAIL_INVALIDO: "O endereço de E-mail não é válido", SEXO_REQUERIDO: "Selecione selecione uma opção.", PAIS_REQUERIDO: "Selecione o país.", CONTRASENAS_NO_COINCIDEN: "As senhas não coincidem", EMAILS_NO_COINCIDEN: "Os endereços de E-mail não coincidem", CORRIGE_CAMPOS: "Por favor, corrija os quadros marcados em vermelho", COMPLETAR_CAMPOS: "Por favor, preencha as caixas vazias", NOMBRE__YA_EXISTE: "O nome de usario já existe", CORRIGE_CAMPOS_REQUERIDOS: "Por favor, complete todos os dados requeridos", PROCESANDO: "Por favor, espere enquanto processamos a sua informação", PROCESANDO_VINC_CUENTA: "Aguarde enquanto associamos sua conta", ERROR_VINC_CUENTA: "Erro de associação de conta", CONF_MAIL_REENVIADO: "Você já encaminhou o E-mail de confirmação", RECUP_CUENTA: "poderá recuperá-la", EMAIL_SENT: "o E-mail foi enviado", _BANNED: "Usuário suspenso", _NO_EXISTE: "Usuário ou senha incorretos", _NO_EXISTE_RECOVER_: "O usuário ingressado não existe", CAPTCHA_NO_VALIDO: "O código inserido não é válido", DEMASIADOS_INTENTOS: "Você realizou várias tentativas de recuperação. Tente novamente mais tarde.", CUENTA_NO_CONFIRMADA: "Sua conta ainda não foi confirmada", ERROR_SOLICITUD: "Ocorreu um erro ao processar o pedido", TXT_MAIL_CONFIRM: "Siga as instruções que recebeu no E-mail que utilizou para se registar e confirme a sua conta para entrar.
Se não recebeu o email de confirmação, clique abaixo para que o possamos enviar novamente", BTN_MAIL_CONFIRM: "Enviar E-mail de confirmação", //FACEBOOK__COMPLETE: "Você completou seu registro e vinculou sua conta ao Facebook", GOOGLE__COMPLETE: "Você concluiu seu registro e vinculou sua conta ao Google", //FACEBOOK_VINCULATE_COMPLETE: "Conexão bem-sucedida com o Facebook", GOOGLE_VINCULATE_COMPLETE: "Conexão bem-sucedida com o Google", //YA_TENES_CUENTA_FACEBOOK: "Já existe uma conta com o mesmo e-mail, para vinculá-la ao Facebook, digite sua senha Axeso5 e pressione o botão 'LINK '", YA_TENES_CUENTA_GOOGLE: "Já existe uma conta com o mesmo e-mail, para vinculá-la ao Google, digite sua senha Axeso5 e pressione o botão 'LINK '", //NECESITAS_CUENTA_FACEBOOK: "Você precisa de um nome de usuário e e-mail associado à sua conta do Facebook para se registrar. Preencha os dados e clique no botão 'CRIE SUA CONTA' para continuar", NECESITAS_CUENTA_GOOGLE: "Você precisa de um nome de usuário e e-mail associado à sua conta do Google para se registrar. Preencha os dados e clique no botão 'CRIE SUA CONTA' para continuar", //PORFAVOR_VINCULA_TU_CUENTA_FACEBOOK: "Vincule sua conta ao Facebook", PORFAVOR_VINCULA_TU_CUENTA_GOOGLE: "Vincule sua conta ao Google", DESCARGA_NO_DISPONIBLE: " não disponível no momento, tente novamente mais tarde.", ESPERAR_VALIDACION: "Aguarde validar as suas informações", _SIN_EMAIL: "Não possui um endereço de e-mail em sua conta. Entre em contato com o e para resolver sua situação", EMAIL_NO_VALIDO: "O correo eletrônico não é válido", }; if (typeof (lang) == 'undefined') { var lang = langTemp; } else { for (let key in langTemp) { lang[key] = langTemp[key] } } }; 'use strict'; window.addEventListener('load', () => { /*TEMPLATE TYPE*/ if (document.getElementById('templateType').value === 'gamesite') { const emailBtn = document.getElementById('emailBtn'); const regFormContainer = document.getElementById('regFormContainer'); emailBtn.addEventListener('click', () => { regFormContainer.classList.toggle('-form-container-hidden'); }); } /* FORM */ const Form = document.getElementById('frmRegistroContainer'); Form.addEventListener('submit', (e) => { e.preventDefault(); init(); }); const root = $("#regFormContainer"); const inputs = root.find(".required"); inputs.blur(function () { $(this).validate.init(this); }); const aduCheckBox = document.getElementById('aduCheckBox'); aduCheckBox.addEventListener('click', () => { if (aduCheckBox.checked == false) { addErrorDiv(aduCheckBox, lang.TERM_Y_COND); } else { addSuccessDiv(aduCheckBox); } }); /* Google Init */ let googleClient; if (Action !== 'launcher-') { const options = { client_id: Ax5GClientId, action: 'gamesite-' }; googleClient = new Ax5GoogleSDK(options); } /* GOOGLE BTN */ const googleBtn = document.getElementById('btnGoogle'); googleBtn.addEventListener('click', () => { if (Action !== 'launcher-') { doLoading(); googleClient.client.requestCode(); } else browse(mainSiteRoot + 'registro'); }); /*EYE */ const eye = document.getElementById('eye'); const eyeSlash = document.getElementById('eyeSlash'); const txt = document.getElementById('txt'); eye.addEventListener('click', () => { txt.setAttribute('type', 'text'); eye.style.display = 'none'; eyeSlash.style.display = 'flex'; }); eyeSlash.addEventListener('click', () => { txt.setAttribute('type', ''); eye.style.display = 'flex'; eyeSlash.style.display = 'none'; }); }); async function init() { resetValidation(); doLoading(); const root = $("#regFormContainer"); const emptyFields = validateForm(); let Ierrors = doValidateErrorInput(); root.find('.error').each(function () { Ierrors++; }); if (emptyFields.length) { doError(lang.CORRIGE_CAMPOS_REQUERIDOS); } else if (Ierrors != 0) { doError(lang.CORRIGE_CAMPOS); } else { validateCaptchaWS(); } } function sendForm() { //let retval = ''; //let gClientId = ''; const defaultReal = document.getElementById('defaultReal'); const sessionId = sessionStorage.sessionID; const sessionPageCount = sessionStorage.pagecount; const ref = getQueryStringParam('ref'); const gClId = getQueryStringParam('gclid'); //let ga_cookie = getCookie("_ga"); //if (ga_cookie != null) { // gClientId = ga_cookie.substring(6); //} //let cookie_gclid = getCookie("saved_gclid"); //if (cookie_gclid != null && gClId === '') { // gClId = cookie_gclid; //} const capParams = '&realPerson=' + defaultReal.value + '&realPersonHash=' + $('#defaultReal').realperson('getHash'); $.ajax({ type: 'POST', url: authRoot + 'ajaxService/regService.ashx', crossDomain: true, dataType: 'jsonp', data: 'Field=submit' + '&txtName=' + document.getElementById('txtName').value + '&txt=' + document.getElementById('txt').value + '&txtEmail=' + encodeURIComponent(document.getElementById('txtEmail').value) + '&cmbSex=' + document.getElementById('cmbSex').value + '&cmbCountries=' + $('[id$="cmbCountries"] :selected').text() + '&cmbCountriesID=' + $('[id$="cmbCountries"]').val() + capParams + '&location=' + escape(window.location.toString()) + '&ref=' + (ref == undefined ? "" : ref) + '&sessionId=' + (sessionId == undefined ? "" : sessionId) + '&sessionPageCount=' + (sessionPageCount == undefined ? "" : sessionPageCount) + //'&gClientId=' + (gClientId == undefined ? "" : gClientId) + '&gClId=' + (gClId == undefined ? "" : gClId), async: true, success: function (jsonResponse) { if (jsonResponse != '') { if (jsonResponse.State == true) { jsonResponse.Msg = jsonResponse.Msg.replace(/-_COMILLA_-/g, "'"); showCompleteRegisg(jsonResponse.Msg, 'redirectTo("/")'); // Deleting cookie let n_date = new Date(); n_date.setFullYear("1984"); setCookie(jsonResponse.CookieName, '', n_date, '/', cookieDomain, false); resetForm(); } else { jsonResponse.Msg = jsonResponse.Msg.replace(/-_COMILLA_-/g, "'"); if (jsonResponse.Code == 9) { doError(jsonResponse.Msg); resetRealPerson(); } else if (jsonResponse.Code == 51) { doError(lang.EMAIL_YA_EXISTE); } else if (jsonResponse.Code == 52) { doError(lang.CUENTA_NO_CONFIRMADA); } else { doError(jsonResponse.Msg, 'redirectTo("/registro")'); resetRealPerson(); } } } }, error: function () { doError(lang.ERROR_SOLICITUD); } }); //return retval; } /*////////////////// VALIDATION //////////////////*/ $.fn.validate = { init: function (o, l) { if (o.id == 'txtName') { this.name(o, l) }; if (o.id == 'txt') { this.(o, l) }; if (o.id == 'txtEmail') { this.email(o, l) }; if (o.id == 'cmbSex') { this.gender(o) }; if (o.id == 'aduCheckBox') { this.disclamer(o) }; }, name: function (o, l) { let = /^[A-Za-z0-9]{4,12}$/gi; if (o.value.match()) { if (l != 1) doValidate(o, 'name'); } else { if ($.trim(o.value) != "") { addErrorDiv(o, lang.NOMBRE__INVALIDO); } else { addErrorDiv(o, lang.NOMBRE__LONG_INVALIDA); } }; }, : function (o, l) { let = /[(\*\(\)\[\]\+\.\,\/\?\:\;\'\"\`\~\\#\$\%\^\&\<\>)+]/; if ($.trim(o.value).length < 6) { addErrorDiv(o, lang.CONTRASENA_LONG_INVALIDA); } else if (!o.value.match()) { if ($.trim(o.value) != "") { if (l != 1) doValidate(o, ''); } else { addErrorDiv(o, lang.CONTRASENA_INVALIDA); } } else { addErrorDiv(o, lang.CONTRASENA_INVALIDA); }; }, email: function (o, l) { let email = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; if ($.trim(o.value).length > 100) { addErrorDiv(o, lang.EMAIL_LONG_INVALIDA); } else if (o.value.match(email)) { if (o.id == 'email') { $('[id$="email"]').val(getReplacedMailDomain(o.value)); } doValidateMail(o, 'email'); } else { addErrorDiv(o, lang.EMAIL_INVALIDO); }; }, gender: function (o) { if (o.value == "0") { addErrorDiv(o, lang.SEXO_REQUERIDO); } else { addSuccessDiv(o); } }, disclamer: function (o) { if (o.checked == false) { addErrorDiv(o, lang.TERM_Y_COND); } else { addSuccessDiv(o); } } }; function resetRealPerson() { // RESET REALPERSON if ($('#defaultReal').realperson('getHash') != undefined) $('div.realperson-challenge').click(); } function doValidate(o, field) { // Y NAME $('[id$="' + o.id + 'Error"]').hide(); $.ajax({ type: 'GET', async: true, url: authRoot + 'ajaxService/regService.ashx', crossDomain: true, dataType: 'jsonp', data: 'Field=' + field + '&Parameters=' + $(o).val() + '', success: function (jsonResponse) { if (jsonResponse != '') { if (jsonResponse.State == true) addSuccessDiv(o); else addErrorDiv(o, jsonResponse.Msg) } } }); } function doValidateMail(o, field) { // EMAIL let bReturn = false; $('[id$="' + o.id + 'Error"]').hide(); $.ajax({ type: 'POST', async: true, url: authRoot + 'ajaxService/regService.ashx', crossDomain: true, dataType: 'jsonp', data: 'Field=' + field + '&Parameters=' + encodeURIComponent($(o).val()) + '', success: function (jsonResponse) { if (jsonResponse != '') { if (jsonResponse.State == true) { bReturn = true; addSuccessDiv(o); } else { bReturn = false; jsonResponse.Msg = jsonResponse.Msg.replace(/-_COMILLA_-/g, "'"); if (jsonResponse.Code == 51) //ya existe el mail addErrorDiv(o, lang.EMAIL_YA_EXISTE); else if (jsonResponse.Code == 52) //confirmation pending addErrorDiv(o, lang.CUENTA_NO_CONFIRMADA); if (jsonResponse.Msg.indexOf('ConfirmationIlightbox2(') !== -1) addErrorDiv(o, jsonResponse.Msg.replace('ConfirmationIlightbox2', "doMailConfirmEmail")); else addErrorDiv(o, jsonResponse.Msg); } } } }); return bReturn; } function validateForm() { ////VALIDA TODOS LOS CAMPOS const root = $('[id$="regFormContainer"]'); const inputs = root.find(".required"); $(inputs).each(function () { $(this).validate.init(this, 1); }); const empty = inputs.filter(function () { if ($(this).attr('type') == 'text') { return $(this).val().replace(/\s*/g, '') == ''; } else if ($(this).attr('type') == '') { return $(this).val().replace(/\s*/g, '') == ''; } else if ($(this).attr('type') == 'checkbox') { $("dvDisclamer").removeClass("disclaimer"); $("dvDisclamer").addClass("dvDisclaimer"); return $(this).is(':checked') == false; } else if ($(this).attr('type') == 'select-one') { return $(this).val() == 'default'; } }); if (empty.length) { return empty; } else { return ''; } } function validateCaptchaWS() { const defaultReal = document.getElementById('defaultReal'); const isGoogle = document.getElementById('isGoogle').value; $.ajax({ type: 'POST', url: authRoot + 'ajaxService/regService.ashx', async: true, crossDomain: true, dataType: 'jsonp', data: 'Field=validateCaptcha' + '&realPerson=' + defaultReal.value + '&realPersonHash=' + $('#defaultReal').realperson('getHash'), success: function (jsonResponse) { if (jsonResponse != '') { switch (jsonResponse.Code) { case "0": //INGRESA try { //setTimeout(function () { /*if (_facebookToken != null && _facebookToken != '' && isFacebook == 1) { sendFormFacebook(); } else if (_facebookToken != null && _facebookToken != '' && isFacebook == 2) { FacebookLink(); } else*/ if (isGoogle == 1) { sendFormGoogle(); } else if (isGoogle == 2) { GoogleLink(); } else { sendForm(); } //}, 1000); } catch { doError(lang.ERROR_SOLICITUD); } break; case "9": doError(lang.CAPTCHA_NO_VALIDO); break; default: doError(lang.ERROR_SOLICITUD); break; } } else { doError(lang.ERROR_SOLICITUD); } }, error: function () { doError(lang.ERROR_SOLICITUD); } }); return false; } function doValidateErrorInput() { //SE FIJA SI HAY UN ERRROR EN FORMULARIO const errorFields = $('.reject'); let cntErrorFields = 0; if (errorFields) { for (let i = 0; i < errorFields.length; i++) { if ($('[id$="' + errorFields[i].id + '"]').text() != "") { cntErrorFields++; } } if (cntErrorFields) doError(lang.CORRIGE_CAMPOS); }; return cntErrorFields; } function addSuccessDiv(o) { // AGREGA DIV SUCCESS let divSuccess = $("div[id$='divValResult-" + o.id + "']"); if (divSuccess != null) $("div[id$='divValResult-" + o.id + "']").remove(); if (o.id === 'cmbSex' && document.getElementById('isGoogle').value == 2) return; //if (o.id !== 'aduCheckBox') { // $(divSuccess).addClass("approve-disclaimer"); //else { divSuccess = document.createElement("div"); divSuccess.setAttribute("id", "divValResult-" + o.id); $(divSuccess).addClass("approve"); $(divSuccess).html(''); $(o).parent().append(divSuccess); //} } function addErrorDiv(o, errorMsg) { // AGREGA DIV ERROR let divError = $("div[id$='divValResult-" + o.id + "']"); if (divError != null) $("div[id$='divValResult-" + o.id + "']").remove(); if (o.id === 'txtEmail' && (document.getElementById('isGoogle').value == 1 || document.getElementById('isGoogle').value == 2)) return; if (o.id === 'cmbSex' && document.getElementById('isGoogle').value == 2) return; divError = document.createElement("div"); divError.setAttribute("id", "divValResult-" + o.id); let spanErrorMsg = document.createElement("span"); if (o.id === 'email' && errorMsg.indexOf('Ingresar') > 0) { $(spanErrorMsg).html(errorMsg.replace('Ingresar', 'Ingresar')); } else { $(spanErrorMsg).html(errorMsg); } if (o.id === 'aduCheckBox') $(divError).addClass("reject-disclaimer"); else $(divError).addClass("reject"); $(divError).html("✘"); $(divError).append($(spanErrorMsg)); $(o).parent().append(divError); if (document.getElementById('txtEmail').disabled === true) $("div[id$='divValResult-email']").remove(); if (document.getElementById('txtName').disabled === true) $("div[id$='divValResult-']").remove(); } /*////////////////// UTILS //////////////////*/ function getReplacedMailDomain(email) { let domHotmail = /\@(hotmial|hotnail|hotmil|hotmia|homail|hotnial|hotmai|hormail|hotmeil|hotrmail|htmail|htomail|hotmaol|hotmal|hotmaill|hotamil|hotail|homtail|holmail|gotmail)\./; let domGmail = /\@(gmai|gnail|gnial|gmial|gemail|gemai)\./; let domYahoo = /\@(yaho|yaahoo|yajoo)\./; return email.replace(domHotmail, '@hotmail.').replace(domGmail, '@gmail.').replace(domYahoo, '@yahoo.'); } function getGenders() { $.ajax({ type: 'GET', url: authRoot + 'ajaxService/regService.ashx', crossDomain: true, dataType: 'jsonp', data: 'Field=getGenders', async: true, success: function (jsonResponse) { if (jsonResponse != '') { for (i = 0; i < jsonResponse.Genders.length; i++) { $('[id$="cmbSex"]').append(''); } } } }); } function getQueryStringParam(paramName) { let vars = [], hash; let q = document.URL.split('?')[1]; if (q != undefined) { q = q.split('&'); for (let i = 0; i < q.length; i++) { hash = q[i].split('='); vars.push(hash[1]); vars[hash[0]] = hash[1]; } } return vars[paramName]; } function getCookie(c_name) { let i, x, y, ARRcookies = document.cookie.split(";"); for (i = 0; i < ARRcookies.length; i++) { x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("=")); y = ARRcookies[i].substr(ARRcookies[i].indexOf("=") + 1); x = x.replace(/^\s+|\s+$/g, ""); if (x == c_name) { return unescape(y); } } } function setCookie(name, value, expires, path, domain, secure) { document.cookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : ""); } function getReturnUrlN() { let retval = ''; if (location.href.split('?').length > 1) { var params = location.href.split('?')[1]; for (var i = 0; i < params.split('&').length; i++) { if (params.split('&')[i].split('=')[0].toLowerCase() == 'returnurl') retval = unescape(params.split('&')[i].split('=')[1]); } } if (retval == '') retval = '/'; return retval.replace('&openinparent', '').replace('?openInOverlay=true', ''); } /*////////////////// UI //////////////////*/ function showCompleteRegisg(msg, action = 'closeAndReload') { const optionsComplete = { //width: 'unset', height: 'unset', max_width: 'unset', max_height: 'unset', min_width: '300px', min_height: 'unset', padding: '3rem 0', has_html: false, icon: 'success', message: msg, button: true, btn_action: action, } new Ax5Alerts('alertContainer', optionsComplete); } function resetForm() { const Form = document.getElementById('frmRegistroContainer'); Form.reset(); resetValidation(); //document.getElementById('defaultReal').value = lang.REALPERSON_CODIGO; document.getElementById('do').value = lang.CREAR_CUENTA; } function resetValidation() { const root = $('[id$="regFormContainer"]'); root.find('.reject').each(function () { $(this).removeClass("reject"); $(this).html(''); }); root.find('.approve').each(function () { $(this).removeClass('approve'); $(this).html(''); }); root.find('.reject-disclaimer').each(function () { $(this).removeClass("reject-disclaimer"); $(this).html(''); }); } function googleUI(name, email) { resetForm(); let msg; let inputId; if (document.getElementById('templateType').value === 'gamesite') document.getElementById('regFormContainer').classList.remove('-form-container-hidden'); if (name !== '' && name !== 'undefined' && name !== undefined && name !== null) {// existente a vincular document.getElementById('isGoogle').value = 2; document.getElementById('txtName').value = name; document.getElementById('txtName').disabled = true; document.getElementById('txtName').style.pointerEvents = 'none'; document.getElementById('cmbSex').style.display = 'none'; document.getElementById('cmbSex').disabled = true; document.getElementById('cmbSex').style.pointerEvents = 'none'; document.getElementById('cmbSex').value = 1; inputId = 'txt'; document.getElementById('do').value = lang.VINCULAR_CUENTA; msg = lang.YA_TENES_CUENTA_GOOGLE; } else {// nuevo a registrar document.getElementById('isGoogle').value = 1; inputId = 'txtName'; msg = lang.NECESITAS_CUENTA_GOOGLE; } try { document.getElementById('divValResult-txtName').style.display = 'none'; } catch (e) { /*console.log(e)*/ } document.getElementById('txtEmail').value = email;// !== null ? email : ''; document.getElementById('txtEmail').disabled = true; document.getElementById('txtEmail').style.pointerEvents = 'none'; try { document.getElementById('divValResult-txtEmail').style.display = 'none'; } catch (e) { /*console.log(e)*/ } document.getElementById('btnGoogle').style.filter = 'grayscale(100%)'; document.getElementById('btnGoogle').style.pointerEvents = "none"; try { document.getElementById('loadingDiv').style.display = 'none'; } catch (e) { /*console.log(e)*/ } setTimeout(() => { doInfo(msg, `focusInput("${inputId}")`); }, 500); } function getGoogleSessionData(ignoreName) { setTimeout(() => { resetValidation(); resetForm(); $.ajax({ type: 'POST', url: RegServicesUrl, data: 'Field=getGoogleSession&ignoreName=' + ignoreName, async: true, cache: false, crossDomain: true, dataType: "jsonp", success: function (jsonResponse) { if (jsonResponse != '') { switch (jsonResponse.Code) { case "1": //setTimeout(() => { googleUI(jsonResponse.Name, jsonResponse.email); //}, 500); break; default: doError(lang.ERROR_SOLICITUD, 'redirectTo("/registro")'); break; } } else { doError(lang.ERROR_SOLICITUD, 'redirectTo("/registro")'); } }, error: function (error) { doError(lang.ERROR_SOLICITUD, 'redirectTo("/registro")'); } }); }, 500); } function focusInput(inputId) { const input = document.getElementById(inputId); try { input.focus(); } catch (e) { console.log(e) } doClose(); }; 'use strict'; function sendFormGoogle() { const ref = getQueryStringParam('ref'); const gClId = getQueryStringParam('gclid'); const defaultReal = document.getElementById('defaultReal'); const capParams = '&realPerson=' + defaultReal.value + '&realPersonHash=' + $('#defaultReal').realperson('getHash'); $.ajax({ type: 'POST', url: authRoot + 'ajaxService/regService.ashx', async: true, crossDomain: true, dataType: 'jsonp', data: 'Field=google' + '&txtName=' + $('[id$="txtName"]').val() + '&txt=' + $('[id$="txt"]').val() + '&txtEmail=' + encodeURIComponent($('[id$="txtEmail"]').val()) + '&cmbSex=' + $('[id$="cmbSex"]').val() + capParams + '&authority=' + escape(mainSiteRoot + 'registro') + '&ref=' + (ref == undefined ? "" : ref) + '&gClId=' + (gClId == undefined ? "" : gClId), success: function (jsonResponse) { if (jsonResponse != '') { if (jsonResponse.State == true) { // Deleting cookie //var n_date = new Date(); //n_date.setFullYear("1984"); //setCookie(jsonResponse.CookieName, '', n_date, '/', cookieDomain, false); if (jsonResponse.Code == 12) { let isMainSite = ''; if (mainSiteRoot.indexOf(location.origin) !== -1) isMainSite = '/auth'; doSuccess(lang.GOOGLE__COMPLETE, `redirectTo("${isMainSite}/RegistrationCodeN.aspx?GoogleReg=1&id=${$('[id$="txtName"]').val()}")`); } } else { jsonResponse.Msg = jsonResponse.Msg.replace(/-_COMILLA_-/g, "'"); if (jsonResponse.Code == 9) { resetRealPerson(); doError(jsonResponse.Msg); } else if (jsonResponse.Code == 51) { doError(lang.EMAIL_YA_EXISTE); } else if (jsonResponse.Code == 52) { doError(lang.CUENTA_NO_CONFIRMADA); } else { doError(jsonResponse.Msg, 'redirectTo("/registro")'); resetRealPerson(); } } } else { doError(lang.ERROR_VINC_CUENTA); } }, error: function (e) { console.log(e); doError(lang.ERROR_VINC_CUENTA); } }); } function GoogleLink() { const = document.getElementById('txtName'); const = document.getElementById('txt'); const defaultReal = document.getElementById('defaultReal'); const meval = 'on'; let returnurl; if (getReturnUrlN() == '' || getReturnUrlN() == '/') returnurl = getReturnUrlN(); else returnurl = location.origin; $.ajax({ type: 'POST', url: AuthServicesUrl, data: 'Field=Ex&name=' + .value + '&=' + .value + '&me=' + meval + '&returnurl=' + escape(returnurl) + '&language=' + lang.LANG_CODE + '&realPerson=' + defaultReal.value + '&realPersonHash=' + $('#defaultReal').realperson('getHash'), async: true, cache: false, crossDomain: true, dataType: "jsonp", success: function (jsonResponse) { if (jsonResponse != '') { if (jsonResponse.State == 0) { googleLink(.value, .value); } else { if (jsonResponse.State == 2) { //FALTA CONFIRMAR doMailConfirmEmail(.value, jsonResponse.Msg, false); } else { doError(jsonResponse.Msg); return; } } } }, error: function () { doError(lang.ERROR_SOLICITUD); } }); } function googleLink(name, ) { const options = { has_html: false, icon: 'loading', message: lang.PROCESANDO_VINC_CUENTA, button: false } new Ax5Alerts('alertContainer', options); $.ajax({ type: 'POST', url: authRoot + 'ajaxService/regService.ashx', data: 'Field=linkGoogleConnect&location=' + escape(location.origin) + '&name=' + name + '&=' + , async: true, crossDomain: true, dataType: 'jsonp', success: function (jsonResponse) { if (jsonResponse != '') { if (jsonResponse.State == true) { doSuccess(lang.GOOGLE_VINCULATE_COMPLETE, 'redirectTo("/")'); return 1; } else { if (jsonResponse.Code == 10) { doError(jsonResponse.Msg); return 0; } else { doError(lang.ERROR_VINC_CUENTA, 'redirectTo("/registro")'); return 0; } } } else { doError(lang.ERROR_VINC_CUENTA, 'redirectTo("/registro")'); return 0; } }, error: function () { doError(lang.ERROR_VINC_CUENTA, 'redirectTo("/registro")'); return 0; } }); }; 'use strict'; class Ax5GoogleSDK { #client_id; #action; constructor(options) { this.client; this.#client_id = options.client_id; this.#action = options.action; this.initClient(); } initClient() { this.client = google.s.oauth2.initCodeClient({ client_id: this.#client_id, scope: 'https://www.googleapis.com/auth/info.email', callback: (response) => { if (response.code) { this.switchAction(response.code); } else { doError(lang.ERROR_SOLICITUD); } }, error_callback: (error) => { if (error.type == 'popup_closed') { doClose(); } else { doError(lang.ERROR_SOLICITUD); } }, ux_mode: 'popup', context: '' }); } switchAction(code) { switch (this.#action) { case 'oauth2-': case 'launcher-': case 'mainsite-': googleGetState(code, Action); break; case 'mainsite-': googleGetState(code, 'mainsite-'); break; case 'mainsite-recover': setTimeout(function () { document.querySelector('[id$="hidCode"]').value = code; document.querySelector('[id$="hidService"]').value = 'google'; document.querySelector('[id$="frm"]').submit(); }, 500); break; case 'mainsite-recover': googleGetState(code, 'mainsite-recover'); break; case 'profile-link': GoogleLink(code, document.getElementById('GoogleLink').value); break; case 'gamesite-': googleGetState(code, 'gamesite-'); break; } } };