@everymatrix/general-player-login-form 1.53.12 → 1.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ "use strict";var V=(r,t,i)=>new Promise((a,o)=>{var s=d=>{try{c(i.next(d))}catch(g){o(g)}},m=d=>{try{c(i.throw(d))}catch(g){o(g)}},c=d=>d.done?a(d.value):Promise.resolve(d.value).then(s,m);c((i=i.apply(r,t)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./GeneralPlayerLoginForm-BeNMMtcU.cjs");function O({withLocale:r,translations:t}){e.$locale.subscribe(i=>{i==null&&(e.$dictionary.set(t),e.$locale.set(r))})}function U(r,t){e.addMessages(r,t)}const H={en:{title:"Please enter the verification code you received on your number",errorTitle:"Your code was invalid, you can resend the code and try again",code:"Sms code",smsCodeError:"Invalid sms code, you can resend the code",resendMessage:"A new verification code has been sent to your phone number.",activate:"Activate Account",resend:"Resend",loginSMSHint:"A new verification code has been sent to your phone number"},"zh-hk":{title:"请输入您在号码上收到的验证码",errorTitle:"您的代码无效,您可以重新发送代码并重试",code:"短信代码",smsCodeError:"短信验证码无效,请重新发送验证码",resendMessage:"新的验证码已发送至您的手机号码",activate:"激活账户",resend:"重发"},fr:{title:"Veuillez entrer le code de vérification que vous avez reçu sur votre numéro",errorTitle:"Votre code n'était pas valide, vous pouvez renvoyer le code et réessayer",code:"Code SMS",smsCodeError:"Code sms invalide, vous pouvez renvoyer le code",resendMessage:"Un nouveau code de vérification a été envoyé à votre numéro de téléphone.",activate:"Activer le compte",resend:"Renvoyer"},tr:{title:"Please enter the verification code you received on your number",errorTitle:"Kodunuz geçersizdi, kodu tekrar gönderip tekrar deneyebilirsiniz",code:"SMS kodu",smsCodeError:"Geçersiz sms kodu, kodu tekrar gönderebilirsiniz",resendMessage:"Telefon numaranıza yeni bir doğrulama kodu gönderildi.",activate:"Aktif hesap",resend:"Yeniden gönder",loginSMSHint:"Telefon numaranıza yeni bir doğrulama kodu gönderildi"},ro:{title:"Please enter the verification code you received on your number",errorTitle:"Your code was invalid, you can resend the code and try again",code:"Sms code",smsCodeError:"Invalid sms code, you can resend the code",resendMessage:"Un nou cod de verificare a fost trimis catre numarul dumneavoastra.",activate:"Activate Account",resend:"Resend"},es:{title:"Por favor ingrese su código de verificación enviado por mensaje de texto a su número de telefono",errorTitle:"Su código es invalido",code:"Código SMS",smsCodeError:"Código SMS invalido",resendMessage:"Un nuevo codigo de verificación ha sido enviado a tu número celular.",activate:"Activar Cuenta",resend:"Reenviar"},pt:{title:"Please enter the verification code you received on your number",errorTitle:"Your code was invalid, you can resend the code and try again",code:"Sms code",smsCodeError:"Invalid sms code, you can resend the code",resendMessage:"Um novo código de verificação foi enviado para o seu número de telefone.",activate:"Activate Account",resend:"Resend"},hr:{title:"Unesite verifikacijski kod koji ste primili na svoj broj telefona",errorTitle:"Vaš kod je nevažeći",code:"Sms kod",smsCodeError:"Nevažeći sms kod",resendMessage:"Novi verifkacijski kod poslan je na vaš broj telefona.",activate:"Aktiviraj račun",resend:"Ponovno pošalji",loginSMSHint:"Novi verifkacijski kod poslan je na vaš broj telefona"},"pt-br":{title:"Por favor, insira o código de verificação que você recebeu no seu número de celular",errorTitle:"Código inválido,vôce pode reenviar o código e tentar novamente",code:"Código SMS",smsCodeError:"Código SMS inválido,vôce pode reenviar o código",resendMessage:"Um novo código de verificação foi enviado para o seu número de celular.",activate:"Ativar conta",resend:"Reenviar",loginSMSHint:"Um novo código de verificação foi enviado para o seu número de celular."},"es-mx":{title:"Por favor ingrese el código de verificación que recibió en su número móvil",errorTitle:"Código inválido,Puede enviar el código e intentar de nuevo",code:"Código SMS",smsCodeError:"Código SMS inválido,Puede reenviar el código",resendMessage:"Un nuevo código de verificación ha sido enviado a su número móvil .",activate:"Activar Cuenta",resend:"Reenviar",loginSMSHint:"Un nuevo código de verificación ha sido enviado a su número móvil ."},"en-us":{title:"Please enter the verification code you received on your number",errorTitle:"Your code was invalid, you can resend the code and try again",code:"Sms code",smsCodeError:"Invalid sms code, you can resend the code",resendMessage:"A new verification code has been sent to your phone number.",activate:"Activate Account",resend:"Resend",loginSMSHint:"A new verification code has been sent to your phone number"}};function q(r){e.append_styles(r,"svelte-uutjwi","*,*::before,*::after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box}.Title{font-size:14px;margin:0;padding-bottom:20px}.Field{color:var(--emw--registration-contrast, var(--emw--color-gray-300, #58586B));display:flex;flex-direction:column;padding-bottom:30px;position:relative}.Field label{font-size:14px;font-weight:300;padding-bottom:5px}.Field input,.Field select{width:100%;height:44px;border:1px solid var(--emw--color-gray-100, #E6E6E6);border-radius:5px;box-sizing:border-box;padding:5px 15px;font-size:16px;line-height:18px}.Field.InvalidField input{border:1px solid var(--emw--registration-color-primary, var(--emw--color-primary, #D0046C));background:var(--emw--color-pale, #FBECF4);color:var(--emw--registration-color-primary, var(--emw--color-primary, #D0046C))}.Field.Hidden{display:none}.LoginSMSHint{margin-top:20px}.InvalidInput{color:var(--emw--color-error, var(--emw--color-red, #ed0909));font-size:10px;line-height:10px}.ErrorMessage{margin:0 0 15px 0;font-size:12px;color:var(--emw--color-error, var(--emw--color-red, #ed0909))}.Button{color:var(--emw--button-typography, var(--emw--color-white, #FFFFFF));background:var(--emw--registration-color-primary, var(--emw--color-primary, #D0046C));border:1px solid var(--emw--registration-color-primary, var(--emw--color-primary, #D0046C));border-radius:5px;width:100%;height:60px;padding:0;text-transform:uppercase;font-size:18px;cursor:pointer;margin-top:24px}.Button[disabled]{background:var(--emw--color-gray-100, #E6E6E6);border:1px solid var(--emw--color-gray-100, #E6E6E6);cursor:not-allowed}.Button.SmsVerificationResend{background:var(--emw--registration-color-bg, var(--emw--color-gray-50, #F9F8F8));color:var(--emw--registration-typography, var(--emw--color-contrast, #07072A))}")}function Y(r){let t=r[5]("errorTitle")+"",i;return{c(){i=e.text(t)},m(a,o){e.insert(a,i,o)},p(a,o){o&32&&t!==(t=a[5]("errorTitle")+"")&&e.set_data(i,t)},d(a){a&&e.detach(i)}}}function G(r){let t=r[5]("title")+"",i;return{c(){i=e.text(t)},m(a,o){e.insert(a,i,o)},p(a,o){o&32&&t!==(t=a[5]("title")+"")&&e.set_data(i,t)},d(a){a&&e.detach(i)}}}function N(r){let t,i=r[5]("smsCodeError")+"",a;return{c(){t=e.element("p"),a=e.text(i),e.attr(t,"class","InvalidInput")},m(o,s){e.insert(o,t,s),e.append(t,a)},p(o,s){s&32&&i!==(i=o[5]("smsCodeError")+"")&&e.set_data(a,i)},d(o){o&&e.detach(t)}}}function L(r){let t,i=r[5]("resendMessage")+"",a;return{c(){t=e.element("p"),a=e.text(i),e.attr(t,"class","SmsVerificationResendMessage")},m(o,s){e.insert(o,t,s),e.append(t,a)},p(o,s){s&32&&i!==(i=o[5]("resendMessage")+"")&&e.set_data(a,i)},d(o){o&&e.detach(t)}}}function D(r){let t,i,a=r[4]<10?"0":"",o,s,m;return{c(){t=e.element("span"),i=e.text("(0:"),o=e.text(a),s=e.text(r[4]),m=e.text(")"),e.attr(t,"class","SmsVerificationResendTimer")},m(c,d){e.insert(c,t,d),e.append(t,i),e.append(t,o),e.append(t,s),e.append(t,m)},p(c,d){d&16&&a!==(a=c[4]<10?"0":"")&&e.set_data(o,a),d&16&&e.set_data(s,c[4])},d(c){c&&e.detach(t)}}}function J(r){let t,i,a,o,s,m=r[5]("code")+"",c,d,g,_,u,C,S,T,k,h,E=r[5]("activate")+"",F,w,b,j=r[5]("resend")+"",z,I,A,P;function R(n,l){return n[2]?G:Y}let M=R(r),y=M(r),p=!r[2]&&N(r),f=r[3]&&L(r),v=r[3]&&D(r);return{c(){t=e.element("div"),i=e.element("h3"),y.c(),a=e.space(),o=e.element("div"),s=e.element("label"),c=e.text(m),d=e.text(":"),g=e.element("span"),g.textContent="*",_=e.space(),u=e.element("input"),C=e.space(),p&&p.c(),T=e.space(),f&&f.c(),k=e.space(),h=e.element("button"),F=e.text(E),w=e.space(),b=e.element("button"),z=e.text(j),I=e.space(),v&&v.c(),e.attr(i,"class","Title"),e.attr(g,"class","FormRequired"),e.attr(s,"for","SmsCode"),e.attr(u,"type","text"),e.attr(u,"id","SmsCode"),e.attr(u,"inputmode","numeric"),e.attr(u,"pattern","[0-9]*"),e.attr(u,"maxlength","6"),e.attr(o,"class",S="Field SmsVerificationField "+(r[2]?"":"InvalidField")),e.attr(h,"class","Button SmsVerificationValidate"),e.attr(b,"class","Button SmsVerificationResend"),b.disabled=r[3],e.attr(t,"class","Container SmsVerificationContainer")},m(n,l){e.insert(n,t,l),e.append(t,i),y.m(i,null),e.append(t,a),e.append(t,o),e.append(o,s),e.append(s,c),e.append(s,d),e.append(s,g),e.append(o,_),e.append(o,u),e.set_input_value(u,r[1]),e.append(o,C),p&&p.m(o,null),e.append(t,T),f&&f.m(t,null),e.append(t,k),e.append(t,h),e.append(h,F),e.append(t,w),e.append(t,b),e.append(b,z),e.append(b,I),v&&v.m(b,null),r[19](t),A||(P=[e.listen(u,"input",r[17]),e.listen(u,"keydown",r[18]),e.listen(h,"click",r[6]),e.listen(b,"click",r[7])],A=!0)},p(n,[l]){M===(M=R(n))&&y?y.p(n,l):(y.d(1),y=M(n),y&&(y.c(),y.m(i,null))),l&32&&m!==(m=n[5]("code")+"")&&e.set_data(c,m),l&2&&u.value!==n[1]&&e.set_input_value(u,n[1]),n[2]?p&&(p.d(1),p=null):p?p.p(n,l):(p=N(n),p.c(),p.m(o,null)),l&4&&S!==(S="Field SmsVerificationField "+(n[2]?"":"InvalidField"))&&e.attr(o,"class",S),n[3]?f?f.p(n,l):(f=L(n),f.c(),f.m(t,k)):f&&(f.d(1),f=null),l&32&&E!==(E=n[5]("activate")+"")&&e.set_data(F,E),l&32&&j!==(j=n[5]("resend")+"")&&e.set_data(z,j),n[3]?v?v.p(n,l):(v=D(n),v.c(),v.m(b,null)):v&&(v.d(1),v=null),l&8&&(b.disabled=n[3])},i:e.noop,o:e.noop,d(n){n&&e.detach(t),y.d(),p&&p.d(),f&&f.d(),v&&v.d(),r[19](null),A=!1,e.run_all(P)}}}function K(r,t,i){let a;e.component_subscribe(r,e.$format,n=>i(5,a=n));let{endpoint:o=""}=t,{tokenid:s=""}=t,{playerid:m=""}=t,{smstemplate:c="Please use this code {0} to activate your accout"}=t,{number:d=""}=t,{clientstyling:g=""}=t,{clientstylingurl:_=""}=t,{translationurl:u=""}=t,C,S=!0,T=!1,k,h,E=+localStorage.getItem("smsTimer")||0,F=Date.now()/1e3-E,w=60-Math.floor(F);const b={numeric:/^[0-9]{0,6}$/};O({withLocale:"en",translations:{}});const j=()=>{fetch(u).then(l=>l.json()).then(l=>{Object.keys(l).forEach(x=>{U(x,l[x])})}).catch(l=>{console.log(l)})};Object.keys(H).forEach(n=>{U(n,H[n])});const z=()=>V(this,null,function*(){try{if((yield fetch(`${o}/v1/player/${m}/activateSMS?tokenId=${s}&validationCode=${C}`,{headers:{"Content-Type":"application/json",accept:"application/json"}})).ok)i(2,S=!0),window.postMessage({type:"SmsHasBeenValidated"},window.location.href);else throw window.postMessage({type:"WidgetNotification",data:{type:"error",message:"Could not activate user"}},window.location.href),i(2,S=!1),new Error("Could not activate user")}catch(n){console.log(n)}}),I=()=>V(this,null,function*(){localStorage.setItem("smsTimer",JSON.stringify(Math.floor(Date.now()/1e3))),M();try{const n=yield fetch(`${o}/v1/player/sms/token`,{method:"POST",headers:{"Content-Type":"application/json",accept:"application/json"},body:JSON.stringify({userId:m,messageTemplate:c,destination:d})}),l=yield n.json();if(n.ok)i(9,s=l.id),T=!1,A();else throw T=!0,new Error("Failed to fetch")}catch(n){T=!0,console.error(n)}}),A=()=>{w>0?i(4,w--,w):(clearInterval(k),i(3,k=!1),i(4,w=60))},P=()=>{let n=document.createElement("style");n.innerHTML=g,h.appendChild(n)},R=()=>{let n=new URL(_),l=document.createElement("style");fetch(n.href).then(x=>x.text()).then(x=>{l.innerHTML=x,setTimeout(()=>{h.appendChild(l)},1),setTimeout(()=>{},500)})},M=()=>{F<60&&i(3,k=setInterval(()=>{A()},1e3))},y=n=>{!b.numeric.test(n.key)&&n.keyCode!==8&&n.keyCode!==9&&n.keyCode!==46&&n.preventDefault()};e.onMount(()=>{if(!m||!d){let n=JSON.parse(localStorage.getItem("playerData"));i(10,m=n.playerid),i(11,d=n.number)}M()});function p(){C=this.value,i(1,C)}const f=n=>y(n);function v(n){e.binding_callbacks[n?"unshift":"push"](()=>{h=n,i(0,h)})}return r.$$set=n=>{"endpoint"in n&&i(12,o=n.endpoint),"tokenid"in n&&i(9,s=n.tokenid),"playerid"in n&&i(10,m=n.playerid),"smstemplate"in n&&i(13,c=n.smstemplate),"number"in n&&i(11,d=n.number),"clientstyling"in n&&i(14,g=n.clientstyling),"clientstylingurl"in n&&i(15,_=n.clientstylingurl),"translationurl"in n&&i(16,u=n.translationurl)},r.$$.update=()=>{r.$$.dirty&5632,r.$$.dirty&16385&&g&&h&&P(),r.$$.dirty&32769&&_&&h&&R(),r.$$.dirty&65536&&u&&j()},[h,C,S,k,w,a,z,I,y,s,m,d,o,c,g,_,u,p,f,v]}class B extends e.SvelteComponent{constructor(t){super(),e.init(this,t,K,J,e.safe_not_equal,{endpoint:12,tokenid:9,playerid:10,smstemplate:13,number:11,clientstyling:14,clientstylingurl:15,translationurl:16},q)}get endpoint(){return this.$$.ctx[12]}set endpoint(t){this.$$set({endpoint:t}),e.flush()}get tokenid(){return this.$$.ctx[9]}set tokenid(t){this.$$set({tokenid:t}),e.flush()}get playerid(){return this.$$.ctx[10]}set playerid(t){this.$$set({playerid:t}),e.flush()}get smstemplate(){return this.$$.ctx[13]}set smstemplate(t){this.$$set({smstemplate:t}),e.flush()}get number(){return this.$$.ctx[11]}set number(t){this.$$set({number:t}),e.flush()}get clientstyling(){return this.$$.ctx[14]}set clientstyling(t){this.$$set({clientstyling:t}),e.flush()}get clientstylingurl(){return this.$$.ctx[15]}set clientstylingurl(t){this.$$set({clientstylingurl:t}),e.flush()}get translationurl(){return this.$$.ctx[16]}set translationurl(t){this.$$set({translationurl:t}),e.flush()}}e.create_custom_element(B,{endpoint:{},tokenid:{},playerid:{},smstemplate:{},number:{},clientstyling:{},clientstylingurl:{},translationurl:{}},[],[],!0);exports.default=B;
@@ -1,13 +1,29 @@
1
- import { $ as Y, a as $, b as ee, S as te, i as ie, f as E, c as oe, s as re, d as ne, e as k, g as z, t as S, h as f, j as H, k as s, l as J, m as q, n as C, o as G, p as N, r as ae, q as se, u as le, v as de, w as ce } from "./GeneralPlayerLoginForm-MMmgBHKW.js";
2
- function ue({ withLocale: o, translations: e }) {
3
- Y.subscribe((i) => {
4
- i == null && ($.set(e), Y.set(o));
1
+ var Y = (o, e, i) => new Promise((n, r) => {
2
+ var a = (d) => {
3
+ try {
4
+ c(i.next(d));
5
+ } catch (y) {
6
+ r(y);
7
+ }
8
+ }, m = (d) => {
9
+ try {
10
+ c(i.throw(d));
11
+ } catch (y) {
12
+ r(y);
13
+ }
14
+ }, c = (d) => d.done ? n(d.value) : Promise.resolve(d.value).then(a, m);
15
+ c((i = i.apply(o, e)).next());
16
+ });
17
+ import { $ as J, a as ee, b as te, S as ie, i as oe, f as E, c as re, s as ne, d as ae, e as w, g as z, t as k, h as p, j as H, k as l, l as G, m as q, n as C, o as K, p as N, r as se, q as le, u as de, v as ce, w as ue } from "./GeneralPlayerLoginForm-DUIEbQRl.js";
18
+ function me({ withLocale: o, translations: e }) {
19
+ J.subscribe((i) => {
20
+ i == null && (ee.set(e), J.set(o));
5
21
  });
6
22
  }
7
- function K(o, e) {
8
- ee(o, e);
23
+ function W(o, e) {
24
+ te(o, e);
9
25
  }
10
- const W = {
26
+ const Q = {
11
27
  en: {
12
28
  title: "Please enter the verification code you received on your number",
13
29
  errorTitle: "Your code was invalid, you can resend the code and try again",
@@ -114,17 +130,17 @@ const W = {
114
130
  loginSMSHint: "A new verification code has been sent to your phone number"
115
131
  }
116
132
  };
117
- function me(o) {
118
- ne(o, "svelte-uutjwi", "*,*::before,*::after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box}.Title{font-size:14px;margin:0;padding-bottom:20px}.Field{color:var(--emw--registration-contrast, var(--emw--color-gray-300, #58586B));display:flex;flex-direction:column;padding-bottom:30px;position:relative}.Field label{font-size:14px;font-weight:300;padding-bottom:5px}.Field input,.Field select{width:100%;height:44px;border:1px solid var(--emw--color-gray-100, #E6E6E6);border-radius:5px;box-sizing:border-box;padding:5px 15px;font-size:16px;line-height:18px}.Field.InvalidField input{border:1px solid var(--emw--registration-color-primary, var(--emw--color-primary, #D0046C));background:var(--emw--color-pale, #FBECF4);color:var(--emw--registration-color-primary, var(--emw--color-primary, #D0046C))}.Field.Hidden{display:none}.LoginSMSHint{margin-top:20px}.InvalidInput{color:var(--emw--color-error, var(--emw--color-red, #ed0909));font-size:10px;line-height:10px}.ErrorMessage{margin:0 0 15px 0;font-size:12px;color:var(--emw--color-error, var(--emw--color-red, #ed0909))}.Button{color:var(--emw--button-typography, var(--emw--color-white, #FFFFFF));background:var(--emw--registration-color-primary, var(--emw--color-primary, #D0046C));border:1px solid var(--emw--registration-color-primary, var(--emw--color-primary, #D0046C));border-radius:5px;width:100%;height:60px;padding:0;text-transform:uppercase;font-size:18px;cursor:pointer;margin-top:24px}.Button[disabled]{background:var(--emw--color-gray-100, #E6E6E6);border:1px solid var(--emw--color-gray-100, #E6E6E6);cursor:not-allowed}.Button.SmsVerificationResend{background:var(--emw--registration-color-bg, var(--emw--color-gray-50, #F9F8F8));color:var(--emw--registration-typography, var(--emw--color-contrast, #07072A))}");
119
- }
120
133
  function fe(o) {
134
+ ae(o, "svelte-uutjwi", "*,*::before,*::after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box}.Title{font-size:14px;margin:0;padding-bottom:20px}.Field{color:var(--emw--registration-contrast, var(--emw--color-gray-300, #58586B));display:flex;flex-direction:column;padding-bottom:30px;position:relative}.Field label{font-size:14px;font-weight:300;padding-bottom:5px}.Field input,.Field select{width:100%;height:44px;border:1px solid var(--emw--color-gray-100, #E6E6E6);border-radius:5px;box-sizing:border-box;padding:5px 15px;font-size:16px;line-height:18px}.Field.InvalidField input{border:1px solid var(--emw--registration-color-primary, var(--emw--color-primary, #D0046C));background:var(--emw--color-pale, #FBECF4);color:var(--emw--registration-color-primary, var(--emw--color-primary, #D0046C))}.Field.Hidden{display:none}.LoginSMSHint{margin-top:20px}.InvalidInput{color:var(--emw--color-error, var(--emw--color-red, #ed0909));font-size:10px;line-height:10px}.ErrorMessage{margin:0 0 15px 0;font-size:12px;color:var(--emw--color-error, var(--emw--color-red, #ed0909))}.Button{color:var(--emw--button-typography, var(--emw--color-white, #FFFFFF));background:var(--emw--registration-color-primary, var(--emw--color-primary, #D0046C));border:1px solid var(--emw--registration-color-primary, var(--emw--color-primary, #D0046C));border-radius:5px;width:100%;height:60px;padding:0;text-transform:uppercase;font-size:18px;cursor:pointer;margin-top:24px}.Button[disabled]{background:var(--emw--color-gray-100, #E6E6E6);border:1px solid var(--emw--color-gray-100, #E6E6E6);cursor:not-allowed}.Button.SmsVerificationResend{background:var(--emw--registration-color-bg, var(--emw--color-gray-50, #F9F8F8));color:var(--emw--registration-typography, var(--emw--color-contrast, #07072A))}");
135
+ }
136
+ function ve(o) {
121
137
  let e = (
122
138
  /*$_*/
123
139
  o[5]("errorTitle") + ""
124
140
  ), i;
125
141
  return {
126
142
  c() {
127
- i = S(e);
143
+ i = k(e);
128
144
  },
129
145
  m(n, r) {
130
146
  H(n, i, r);
@@ -139,14 +155,14 @@ function fe(o) {
139
155
  }
140
156
  };
141
157
  }
142
- function ve(o) {
158
+ function ge(o) {
143
159
  let e = (
144
160
  /*$_*/
145
161
  o[5]("title") + ""
146
162
  ), i;
147
163
  return {
148
164
  c() {
149
- i = S(e);
165
+ i = k(e);
150
166
  },
151
167
  m(n, r) {
152
168
  H(n, i, r);
@@ -161,20 +177,20 @@ function ve(o) {
161
177
  }
162
178
  };
163
179
  }
164
- function Q(o) {
180
+ function X(o) {
165
181
  let e, i = (
166
182
  /*$_*/
167
183
  o[5]("smsCodeError") + ""
168
184
  ), n;
169
185
  return {
170
186
  c() {
171
- e = k("p"), n = S(i), f(e, "class", "InvalidInput");
187
+ e = w("p"), n = k(i), p(e, "class", "InvalidInput");
172
188
  },
173
- m(r, l) {
174
- H(r, e, l), s(e, n);
189
+ m(r, a) {
190
+ H(r, e, a), l(e, n);
175
191
  },
176
- p(r, l) {
177
- l & /*$_*/
192
+ p(r, a) {
193
+ a & /*$_*/
178
194
  32 && i !== (i = /*$_*/
179
195
  r[5]("smsCodeError") + "") && C(n, i);
180
196
  },
@@ -183,20 +199,20 @@ function Q(o) {
183
199
  }
184
200
  };
185
201
  }
186
- function X(o) {
202
+ function Z(o) {
187
203
  let e, i = (
188
204
  /*$_*/
189
205
  o[5]("resendMessage") + ""
190
206
  ), n;
191
207
  return {
192
208
  c() {
193
- e = k("p"), n = S(i), f(e, "class", "SmsVerificationResendMessage");
209
+ e = w("p"), n = k(i), p(e, "class", "SmsVerificationResendMessage");
194
210
  },
195
- m(r, l) {
196
- H(r, e, l), s(e, n);
211
+ m(r, a) {
212
+ H(r, e, a), l(e, n);
197
213
  },
198
- p(r, l) {
199
- l & /*$_*/
214
+ p(r, a) {
215
+ a & /*$_*/
200
216
  32 && i !== (i = /*$_*/
201
217
  r[5]("resendMessage") + "") && C(n, i);
202
218
  },
@@ -205,149 +221,149 @@ function X(o) {
205
221
  }
206
222
  };
207
223
  }
208
- function Z(o) {
224
+ function $(o) {
209
225
  let e, i, n = (
210
226
  /*secondsLeft*/
211
227
  o[4] < 10 ? "0" : ""
212
- ), r, l, v;
228
+ ), r, a, m;
213
229
  return {
214
230
  c() {
215
- e = k("span"), i = S("(0:"), r = S(n), l = S(
231
+ e = w("span"), i = k("(0:"), r = k(n), a = k(
216
232
  /*secondsLeft*/
217
233
  o[4]
218
- ), v = S(")"), f(e, "class", "SmsVerificationResendTimer");
234
+ ), m = k(")"), p(e, "class", "SmsVerificationResendTimer");
219
235
  },
220
- m(g, p) {
221
- H(g, e, p), s(e, i), s(e, r), s(e, l), s(e, v);
236
+ m(c, d) {
237
+ H(c, e, d), l(e, i), l(e, r), l(e, a), l(e, m);
222
238
  },
223
- p(g, p) {
224
- p & /*secondsLeft*/
239
+ p(c, d) {
240
+ d & /*secondsLeft*/
225
241
  16 && n !== (n = /*secondsLeft*/
226
- g[4] < 10 ? "0" : "") && C(r, n), p & /*secondsLeft*/
242
+ c[4] < 10 ? "0" : "") && C(r, n), d & /*secondsLeft*/
227
243
  16 && C(
228
- l,
244
+ a,
229
245
  /*secondsLeft*/
230
- g[4]
246
+ c[4]
231
247
  );
232
248
  },
233
- d(g) {
234
- g && N(e);
249
+ d(c) {
250
+ c && N(e);
235
251
  }
236
252
  };
237
253
  }
238
- function ge(o) {
239
- let e, i, n, r, l, v = (
254
+ function pe(o) {
255
+ let e, i, n, r, a, m = (
240
256
  /*$_*/
241
257
  o[5]("code") + ""
242
- ), g, p, w, F, d, j, _, I, M, y, R = (
258
+ ), c, d, y, F, u, j, _, I, M, h, R = (
243
259
  /*$_*/
244
260
  o[5]("activate") + ""
245
- ), V, T, b, P = (
261
+ ), V, T, S, P = (
246
262
  /*$_*/
247
263
  o[5]("resend") + ""
248
264
  ), D, L, U, B;
249
- function O(t, a) {
265
+ function O(t, s) {
250
266
  return (
251
267
  /*isSmsValid*/
252
- t[2] ? ve : fe
268
+ t[2] ? ge : ve
253
269
  );
254
270
  }
255
- let A = O(o), h = A(o), c = !/*isSmsValid*/
256
- o[2] && Q(o), u = (
257
- /*timer*/
258
- o[3] && X(o)
259
- ), m = (
271
+ let A = O(o), b = A(o), f = !/*isSmsValid*/
272
+ o[2] && X(o), v = (
260
273
  /*timer*/
261
274
  o[3] && Z(o)
275
+ ), g = (
276
+ /*timer*/
277
+ o[3] && $(o)
262
278
  );
263
279
  return {
264
280
  c() {
265
- e = k("div"), i = k("h3"), h.c(), n = z(), r = k("div"), l = k("label"), g = S(v), p = S(":"), w = k("span"), w.textContent = "*", F = z(), d = k("input"), j = z(), c && c.c(), I = z(), u && u.c(), M = z(), y = k("button"), V = S(R), T = z(), b = k("button"), D = S(P), L = z(), m && m.c(), f(i, "class", "Title"), f(w, "class", "FormRequired"), f(l, "for", "SmsCode"), f(d, "type", "text"), f(d, "id", "SmsCode"), f(d, "inputmode", "numeric"), f(d, "pattern", "[0-9]*"), f(d, "maxlength", "6"), f(r, "class", _ = "Field SmsVerificationField " + (/*isSmsValid*/
266
- o[2] ? "" : "InvalidField")), f(y, "class", "Button SmsVerificationValidate"), f(b, "class", "Button SmsVerificationResend"), b.disabled = /*timer*/
267
- o[3], f(e, "class", "Container SmsVerificationContainer");
281
+ e = w("div"), i = w("h3"), b.c(), n = z(), r = w("div"), a = w("label"), c = k(m), d = k(":"), y = w("span"), y.textContent = "*", F = z(), u = w("input"), j = z(), f && f.c(), I = z(), v && v.c(), M = z(), h = w("button"), V = k(R), T = z(), S = w("button"), D = k(P), L = z(), g && g.c(), p(i, "class", "Title"), p(y, "class", "FormRequired"), p(a, "for", "SmsCode"), p(u, "type", "text"), p(u, "id", "SmsCode"), p(u, "inputmode", "numeric"), p(u, "pattern", "[0-9]*"), p(u, "maxlength", "6"), p(r, "class", _ = "Field SmsVerificationField " + (/*isSmsValid*/
282
+ o[2] ? "" : "InvalidField")), p(h, "class", "Button SmsVerificationValidate"), p(S, "class", "Button SmsVerificationResend"), S.disabled = /*timer*/
283
+ o[3], p(e, "class", "Container SmsVerificationContainer");
268
284
  },
269
- m(t, a) {
270
- H(t, e, a), s(e, i), h.m(i, null), s(e, n), s(e, r), s(r, l), s(l, g), s(l, p), s(l, w), s(r, F), s(r, d), J(
271
- d,
285
+ m(t, s) {
286
+ H(t, e, s), l(e, i), b.m(i, null), l(e, n), l(e, r), l(r, a), l(a, c), l(a, d), l(a, y), l(r, F), l(r, u), G(
287
+ u,
272
288
  /*smsCode*/
273
289
  o[1]
274
- ), s(r, j), c && c.m(r, null), s(e, I), u && u.m(e, null), s(e, M), s(e, y), s(y, V), s(e, T), s(e, b), s(b, D), s(b, L), m && m.m(b, null), o[19](e), U || (B = [
290
+ ), l(r, j), f && f.m(r, null), l(e, I), v && v.m(e, null), l(e, M), l(e, h), l(h, V), l(e, T), l(e, S), l(S, D), l(S, L), g && g.m(S, null), o[19](e), U || (B = [
275
291
  q(
276
- d,
292
+ u,
277
293
  "input",
278
294
  /*input_input_handler*/
279
295
  o[17]
280
296
  ),
281
297
  q(
282
- d,
298
+ u,
283
299
  "keydown",
284
300
  /*keydown_handler*/
285
301
  o[18]
286
302
  ),
287
303
  q(
288
- y,
304
+ h,
289
305
  "click",
290
306
  /*activateUser*/
291
307
  o[6]
292
308
  ),
293
309
  q(
294
- b,
310
+ S,
295
311
  "click",
296
312
  /*resendCode*/
297
313
  o[7]
298
314
  )
299
315
  ], U = !0);
300
316
  },
301
- p(t, [a]) {
302
- A === (A = O(t)) && h ? h.p(t, a) : (h.d(1), h = A(t), h && (h.c(), h.m(i, null))), a & /*$_*/
303
- 32 && v !== (v = /*$_*/
304
- t[5]("code") + "") && C(g, v), a & /*smsCode*/
305
- 2 && d.value !== /*smsCode*/
306
- t[1] && J(
307
- d,
317
+ p(t, [s]) {
318
+ A === (A = O(t)) && b ? b.p(t, s) : (b.d(1), b = A(t), b && (b.c(), b.m(i, null))), s & /*$_*/
319
+ 32 && m !== (m = /*$_*/
320
+ t[5]("code") + "") && C(c, m), s & /*smsCode*/
321
+ 2 && u.value !== /*smsCode*/
322
+ t[1] && G(
323
+ u,
308
324
  /*smsCode*/
309
325
  t[1]
310
326
  ), /*isSmsValid*/
311
- t[2] ? c && (c.d(1), c = null) : c ? c.p(t, a) : (c = Q(t), c.c(), c.m(r, null)), a & /*isSmsValid*/
327
+ t[2] ? f && (f.d(1), f = null) : f ? f.p(t, s) : (f = X(t), f.c(), f.m(r, null)), s & /*isSmsValid*/
312
328
  4 && _ !== (_ = "Field SmsVerificationField " + (/*isSmsValid*/
313
- t[2] ? "" : "InvalidField")) && f(r, "class", _), /*timer*/
314
- t[3] ? u ? u.p(t, a) : (u = X(t), u.c(), u.m(e, M)) : u && (u.d(1), u = null), a & /*$_*/
329
+ t[2] ? "" : "InvalidField")) && p(r, "class", _), /*timer*/
330
+ t[3] ? v ? v.p(t, s) : (v = Z(t), v.c(), v.m(e, M)) : v && (v.d(1), v = null), s & /*$_*/
315
331
  32 && R !== (R = /*$_*/
316
- t[5]("activate") + "") && C(V, R), a & /*$_*/
332
+ t[5]("activate") + "") && C(V, R), s & /*$_*/
317
333
  32 && P !== (P = /*$_*/
318
334
  t[5]("resend") + "") && C(D, P), /*timer*/
319
- t[3] ? m ? m.p(t, a) : (m = Z(t), m.c(), m.m(b, null)) : m && (m.d(1), m = null), a & /*timer*/
320
- 8 && (b.disabled = /*timer*/
335
+ t[3] ? g ? g.p(t, s) : (g = $(t), g.c(), g.m(S, null)) : g && (g.d(1), g = null), s & /*timer*/
336
+ 8 && (S.disabled = /*timer*/
321
337
  t[3]);
322
338
  },
323
- i: G,
324
- o: G,
339
+ i: K,
340
+ o: K,
325
341
  d(t) {
326
- t && N(e), h.d(), c && c.d(), u && u.d(), m && m.d(), o[19](null), U = !1, ae(B);
342
+ t && N(e), b.d(), f && f.d(), v && v.d(), g && g.d(), o[19](null), U = !1, se(B);
327
343
  }
328
344
  };
329
345
  }
330
- function pe(o, e, i) {
346
+ function ye(o, e, i) {
331
347
  let n;
332
- se(o, ce, (t) => i(5, n = t));
333
- let { endpoint: r = "" } = e, { tokenid: l = "" } = e, { playerid: v = "" } = e, { smstemplate: g = "Please use this code {0} to activate your accout" } = e, { number: p = "" } = e, { clientstyling: w = "" } = e, { clientstylingurl: F = "" } = e, { translationurl: d = "" } = e, j, _ = !0, I = !1, M, y, R = +localStorage.getItem("smsTimer") || 0, V = Date.now() / 1e3 - R, T = 60 - Math.floor(V);
334
- const b = { numeric: /^[0-9]{0,6}$/ };
335
- ue({ withLocale: "en", translations: {} });
348
+ le(o, ue, (t) => i(5, n = t));
349
+ let { endpoint: r = "" } = e, { tokenid: a = "" } = e, { playerid: m = "" } = e, { smstemplate: c = "Please use this code {0} to activate your accout" } = e, { number: d = "" } = e, { clientstyling: y = "" } = e, { clientstylingurl: F = "" } = e, { translationurl: u = "" } = e, j, _ = !0, I = !1, M, h, R = +localStorage.getItem("smsTimer") || 0, V = Date.now() / 1e3 - R, T = 60 - Math.floor(V);
350
+ const S = { numeric: /^[0-9]{0,6}$/ };
351
+ me({ withLocale: "en", translations: {} });
336
352
  const P = () => {
337
- fetch(d).then((a) => a.json()).then((a) => {
338
- Object.keys(a).forEach((x) => {
339
- K(x, a[x]);
353
+ fetch(u).then((s) => s.json()).then((s) => {
354
+ Object.keys(s).forEach((x) => {
355
+ W(x, s[x]);
340
356
  });
341
- }).catch((a) => {
342
- console.log(a);
357
+ }).catch((s) => {
358
+ console.log(s);
343
359
  });
344
360
  };
345
- Object.keys(W).forEach((t) => {
346
- K(t, W[t]);
361
+ Object.keys(Q).forEach((t) => {
362
+ W(t, Q[t]);
347
363
  });
348
- const D = async () => {
364
+ const D = () => Y(this, null, function* () {
349
365
  try {
350
- if ((await fetch(`${r}/v1/player/${v}/activateSMS?tokenId=${l}&validationCode=${j}`, {
366
+ if ((yield fetch(`${r}/v1/player/${m}/activateSMS?tokenId=${a}&validationCode=${j}`, {
351
367
  headers: {
352
368
  "Content-Type": "application/json",
353
369
  accept: "application/json"
@@ -368,39 +384,39 @@ function pe(o, e, i) {
368
384
  } catch (t) {
369
385
  console.log(t);
370
386
  }
371
- }, L = async () => {
387
+ }), L = () => Y(this, null, function* () {
372
388
  localStorage.setItem("smsTimer", JSON.stringify(Math.floor(Date.now() / 1e3))), A();
373
389
  try {
374
- const t = await fetch(`${r}/v1/player/sms/token`, {
390
+ const t = yield fetch(`${r}/v1/player/sms/token`, {
375
391
  method: "POST",
376
392
  headers: {
377
393
  "Content-Type": "application/json",
378
394
  accept: "application/json"
379
395
  },
380
396
  body: JSON.stringify({
381
- userId: v,
382
- messageTemplate: g,
383
- destination: p
397
+ userId: m,
398
+ messageTemplate: c,
399
+ destination: d
384
400
  })
385
- }), a = await t.json();
401
+ }), s = yield t.json();
386
402
  if (t.ok)
387
- i(9, l = a.id), I = !1, U();
403
+ i(9, a = s.id), I = !1, U();
388
404
  else
389
405
  throw I = !0, new Error("Failed to fetch");
390
406
  } catch (t) {
391
407
  I = !0, console.error(t);
392
408
  }
393
- }, U = () => {
409
+ }), U = () => {
394
410
  T > 0 ? i(4, T--, T) : (clearInterval(M), i(3, M = !1), i(4, T = 60));
395
411
  }, B = () => {
396
412
  let t = document.createElement("style");
397
- t.innerHTML = w, y.appendChild(t);
413
+ t.innerHTML = y, h.appendChild(t);
398
414
  }, O = () => {
399
- let t = new URL(F), a = document.createElement("style");
415
+ let t = new URL(F), s = document.createElement("style");
400
416
  fetch(t.href).then((x) => x.text()).then((x) => {
401
- a.innerHTML = x, setTimeout(
417
+ s.innerHTML = x, setTimeout(
402
418
  () => {
403
- y.appendChild(a);
419
+ h.appendChild(s);
404
420
  },
405
421
  1
406
422
  ), setTimeout(
@@ -416,35 +432,35 @@ function pe(o, e, i) {
416
432
  },
417
433
  1e3
418
434
  ));
419
- }, h = (t) => {
420
- !b.numeric.test(t.key) && t.keyCode !== 8 && t.keyCode !== 9 && t.keyCode !== 46 && t.preventDefault();
435
+ }, b = (t) => {
436
+ !S.numeric.test(t.key) && t.keyCode !== 8 && t.keyCode !== 9 && t.keyCode !== 46 && t.preventDefault();
421
437
  };
422
- le(() => {
423
- if (!v || !p) {
438
+ de(() => {
439
+ if (!m || !d) {
424
440
  let t = JSON.parse(localStorage.getItem("playerData"));
425
- i(10, v = t.playerid), i(11, p = t.number);
441
+ i(10, m = t.playerid), i(11, d = t.number);
426
442
  }
427
443
  A();
428
444
  });
429
- function c() {
445
+ function f() {
430
446
  j = this.value, i(1, j);
431
447
  }
432
- const u = (t) => h(t);
433
- function m(t) {
434
- de[t ? "unshift" : "push"](() => {
435
- y = t, i(0, y);
448
+ const v = (t) => b(t);
449
+ function g(t) {
450
+ ce[t ? "unshift" : "push"](() => {
451
+ h = t, i(0, h);
436
452
  });
437
453
  }
438
454
  return o.$$set = (t) => {
439
- "endpoint" in t && i(12, r = t.endpoint), "tokenid" in t && i(9, l = t.tokenid), "playerid" in t && i(10, v = t.playerid), "smstemplate" in t && i(13, g = t.smstemplate), "number" in t && i(11, p = t.number), "clientstyling" in t && i(14, w = t.clientstyling), "clientstylingurl" in t && i(15, F = t.clientstylingurl), "translationurl" in t && i(16, d = t.translationurl);
455
+ "endpoint" in t && i(12, r = t.endpoint), "tokenid" in t && i(9, a = t.tokenid), "playerid" in t && i(10, m = t.playerid), "smstemplate" in t && i(13, c = t.smstemplate), "number" in t && i(11, d = t.number), "clientstyling" in t && i(14, y = t.clientstyling), "clientstylingurl" in t && i(15, F = t.clientstylingurl), "translationurl" in t && i(16, u = t.translationurl);
440
456
  }, o.$$.update = () => {
441
457
  o.$$.dirty & /*tokenid, playerid, endpoint*/
442
458
  5632, o.$$.dirty & /*clientstyling, customStylingContainer*/
443
- 16385 && w && y && B(), o.$$.dirty & /*clientstylingurl, customStylingContainer*/
444
- 32769 && F && y && O(), o.$$.dirty & /*translationurl*/
445
- 65536 && d && P();
459
+ 16385 && y && h && B(), o.$$.dirty & /*clientstylingurl, customStylingContainer*/
460
+ 32769 && F && h && O(), o.$$.dirty & /*translationurl*/
461
+ 65536 && u && P();
446
462
  }, [
447
- y,
463
+ h,
448
464
  j,
449
465
  _,
450
466
  M,
@@ -452,28 +468,28 @@ function pe(o, e, i) {
452
468
  n,
453
469
  D,
454
470
  L,
455
- h,
456
- l,
457
- v,
458
- p,
459
- r,
460
- g,
461
- w,
462
- F,
471
+ b,
472
+ a,
473
+ m,
463
474
  d,
475
+ r,
464
476
  c,
477
+ y,
478
+ F,
465
479
  u,
466
- m
480
+ f,
481
+ v,
482
+ g
467
483
  ];
468
484
  }
469
- class ye extends te {
485
+ class he extends ie {
470
486
  constructor(e) {
471
- super(), ie(
487
+ super(), oe(
472
488
  this,
473
489
  e,
490
+ ye,
474
491
  pe,
475
- ge,
476
- re,
492
+ ne,
477
493
  {
478
494
  endpoint: 12,
479
495
  tokenid: 9,
@@ -484,7 +500,7 @@ class ye extends te {
484
500
  clientstylingurl: 15,
485
501
  translationurl: 16
486
502
  },
487
- me
503
+ fe
488
504
  );
489
505
  }
490
506
  get endpoint() {
@@ -536,7 +552,7 @@ class ye extends te {
536
552
  this.$$set({ translationurl: e }), E();
537
553
  }
538
554
  }
539
- oe(ye, { endpoint: {}, tokenid: {}, playerid: {}, smstemplate: {}, number: {}, clientstyling: {}, clientstylingurl: {}, translationurl: {} }, [], [], !0);
555
+ re(he, { endpoint: {}, tokenid: {}, playerid: {}, smstemplate: {}, number: {}, clientstyling: {}, clientstylingurl: {}, translationurl: {} }, [], [], !0);
540
556
  export {
541
- ye as default
557
+ he as default
542
558
  };
@@ -0,0 +1 @@
1
+ "use strict";if(typeof window!="undefined"){let n=function(e){return function(...r){try{return e.apply(this,r)}catch(t){if(t instanceof DOMException&&t.message.includes("has already been used with this registry")||t.message.includes("Cannot define multiple custom elements with the same tag name"))return!1;throw t}}};customElements.define=n(customElements.define),Promise.resolve().then(()=>require("../components/GeneralPlayerLoginForm-BeNMMtcU.cjs")).then(e=>e.GeneralPlayerLoginForm_ce).then(({default:e})=>{!customElements.get("general-player-login-form")&&customElements.define("general-player-login-form",e.element)})}
@@ -0,0 +1,16 @@
1
+ if (typeof window != "undefined") {
2
+ let n = function(e) {
3
+ return function(...s) {
4
+ try {
5
+ return e.apply(this, s);
6
+ } catch (t) {
7
+ if (t instanceof DOMException && t.message.includes("has already been used with this registry") || t.message.includes("Cannot define multiple custom elements with the same tag name"))
8
+ return !1;
9
+ throw t;
10
+ }
11
+ };
12
+ };
13
+ customElements.define = n(customElements.define), import("../components/GeneralPlayerLoginForm-DUIEbQRl.js").then((e) => e.G).then(({ default: e }) => {
14
+ !customElements.get("general-player-login-form") && customElements.define("general-player-login-form", e.element);
15
+ });
16
+ }
package/package.json CHANGED
@@ -1,26 +1,25 @@
1
-
2
1
  {
3
2
  "name": "@everymatrix/general-player-login-form",
4
- "version": "1.53.12",
3
+ "version": "1.54.0",
5
4
  "type": "module",
6
- "main": "esnext/general-player-login-form.js",
7
- "module": "esnext/general-player-login-form.js",
5
+ "main": "es2015/general-player-login-form.cjs",
6
+ "module": "es2015/general-player-login-form.js",
8
7
  "exports": {
9
8
  ".": {
10
- "import": "./esnext/general-player-login-form.js"
9
+ "import": "./es2015/general-player-login-form.js",
10
+ "require": "./es2015/general-player-login-form.cjs"
11
11
  },
12
- "./es2015/general-player-login-form.cjs": "./es2015/general-player-login-form.cjs",
13
- "./es2015/general-player-login-form.js": "./es2015/general-player-login-form.js"
12
+ "./es2015/general-player-login-form.cjs": "./es2015/general-player-login-form.cjs"
14
13
  },
15
14
  "files": [
16
- "components/",
17
15
  "es2015/",
18
- "stencil",
19
- "angular",
20
- "esnext/"
16
+ "components",
17
+ "stencil"
21
18
  ],
22
19
  "publishConfig": {
23
20
  "access": "public"
21
+ },
22
+ "dependencies": {
23
+ "@everymatrix/general-player-sms-verification-form": "1.45.7"
24
24
  }
25
25
  }
26
-
@@ -1,14 +0,0 @@
1
- import { G as r } from "../components/GeneralPlayerLoginForm-MMmgBHKW.js";
2
- function s(t) {
3
- return function(...n) {
4
- try {
5
- return t.apply(this, n);
6
- } catch (e) {
7
- if (e instanceof DOMException && e.message.includes("has already been used with this registry") || e.message.includes("Cannot define multiple custom elements with the same tag name"))
8
- return !1;
9
- throw e;
10
- }
11
- };
12
- }
13
- customElements.define = s(customElements.define);
14
- !customElements.get("general-player-login-form") && customElements.define("general-player-login-form", r.element);