@everymatrix/general-player-sms-verification-form 1.13.22 → 1.13.24

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.
@@ -597,5 +597,5 @@ return e[2]?sr:or}let $=D(t),k=$(t),F=!/*isSmsValid*/t[2]&&ar(t),x=/*timer*/t[3]
597
597
  locale.set(_locale);*/}({withLocale:"en",translations:{}});Object.keys(ir).forEach((e=>{nr(e,ir[e])}));const S=()=>{B>0?r(4,B--,B):(clearInterval(c),r(3,c=!1),r(4,B=60))},P=()=>{_<60&&r(3,c=setInterval((()=>{S()}),1e3))},L=e=>{A.numeric.test(e.key)||8===e.keyCode||9===e.keyCode||46===e.keyCode||e.preventDefault()};v((()=>{if(!f||!m){
598
598
  /* fix for when trying to log in after registeration & mail confirmation (without sms confirmation),
599
599
  upon switching between sms validation and register, the playerid and phone number would be lost */
600
- let e=JSON.parse(localStorage.getItem("playerData"));r(10,f=e.playerid),r(11,m=e.number)}P()}));return e.$$set=e=>{"endpoint"in e&&r(12,l=e.endpoint),"tokenid"in e&&r(9,u=e.tokenid),"playerid"in e&&r(10,f=e.playerid),"smstemplate"in e&&r(13,p=e.smstemplate),"number"in e&&r(11,m=e.number),"clientstyling"in e&&r(14,d=e.clientstyling),"clientstylingurl"in e&&r(15,g=e.clientstylingurl),"translationurl"in e&&r(16,b=e.translationurl)},e.$$.update=()=>{e.$$.dirty,/*clientstyling, customStylingContainer*/16385&e.$$.dirty&&d&&h&&(()=>{let e=document.createElement("style");e.innerHTML=d,h.appendChild(e)})(),/*clientstylingurl, customStylingContainer*/32769&e.$$.dirty&&g&&h&&(()=>{let e=new URL(g),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{h.appendChild(t)}),1),setTimeout((()=>{}),500)}))})(),/*translationurl*/65536&e.$$.dirty&&b&&fetch(b).then((e=>e.json())).then((e=>{Object.keys(e).forEach((t=>{nr(t,e[t])}))})).catch((e=>{console.log(e)}))},[h,a,E,c,B,n,async()=>{try{if(!(await fetch(`${l}/player/${f}/activateSMS?tokenId=${u}&validationCode=${a}`,{headers:{"Content-Type":"application/json",accept:"application/json"}})).ok)throw window.postMessage({type:"WidgetNotification",data:{type:"error",message:"Could not activate user"}},window.location.href),r(2,E=!1),new Error("Could not activate user");r(2,E=!0),window.postMessage({type:"SmsHasBeenValidated"},window.location.href)}catch(e){console.log(e)}},async()=>{localStorage.setItem("smsTimer",JSON.stringify(Math.floor(Date.now()/1e3))),P();try{const e=await fetch(`${l}/player/sms/token`,{method:"POST",headers:{"Content-Type":"application/json",accept:"application/json"},body:JSON.stringify({userId:f,messageTemplate:p,destination:m})}),t=await e.json();if(!e.ok)throw y=!0,new Error("Failed to fetch");r(9,u=t.id),y=!1,S()}catch(e){y=!0,console.error(e)}},L,u,f,m,l,p,d,g,b,function(){a=this.value,r(1,a)},e=>L(e),function(e){H[e?"unshift":"push"]((()=>{h=e,r(0,h)}))}]}class fr extends U{constructor(e){super();const t=document.createElement("style");t.textContent="*,*::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(--emfe-w-registration-contrast, var(--emfe-w-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{width:100%;height:44px;border:1px solid var(--emfe-w-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 vvar(--emfe-w-registration-color-primary, var(--emfe-w-color-pink-500, #D0046C));background:var(--emfe-w-color-pale, #FBECF4);color:var(--emfe-w-registration-color-primary, var(--emfe-w-color-pink-500, #D0046C))}.InvalidInput{color:var(--emfe-w-color-error, var(--emfe-w-color-red, #ed0909));font-size:10px;line-height:10px}.Button{color:var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));background:var(--emfe-w-registration-color-primary, var(--emfe-w-color-pink-500, #D0046C));border:1px solid var(--emfe-w-registration-color-primary, var(--emfe-w-color-pink-500, #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(--emfe-w-color-gray-100, #E6E6E6);border:1px solid var(--emfe-w-color-gray-100, #E6E6E6);cursor:not-allowed}.Button.SmsVerificationResend{background:var(--emfe-w-registration-color-bg, var(--emfe-w-color-gray-50, #F9F8F8));color:var(--emfe-w-registration-typography, var(--emfe-w-color-dunkel, #07072A))}",this.shadowRoot.appendChild(t),O(this,{target:this.shadowRoot,props:b(this.attributes),customElement:!0},ur,lr,o,{endpoint:12,tokenid:9,playerid:10,smstemplate:13,number:11,clientstyling:14,clientstylingurl:15,translationurl:16},null),e&&(e.target&&c(e.target,this,e.anchor),e.props&&(this.$set(e.props),C()))}static get observedAttributes(){return["endpoint","tokenid","playerid","smstemplate","number","clientstyling","clientstylingurl","translationurl"]}get endpoint(){return this.$$.ctx[12]}set endpoint(e){this.$$set({endpoint:e}),C()}get tokenid(){return this.$$.ctx[9]}set tokenid(e){this.$$set({tokenid:e}),C()}get playerid(){return this.$$.ctx[10]}set playerid(e){this.$$set({playerid:e}),C()}get smstemplate(){return this.$$.ctx[13]}set smstemplate(e){this.$$set({smstemplate:e}),C()}get number(){return this.$$.ctx[11]}set number(e){this.$$set({number:e}),C()}get clientstyling(){return this.$$.ctx[14]}set clientstyling(e){this.$$set({clientstyling:e}),C()}get clientstylingurl(){return this.$$.ctx[15]}set clientstylingurl(e){this.$$set({clientstylingurl:e}),C()}get translationurl(){return this.$$.ctx[16]}set translationurl(e){this.$$set({translationurl:e}),C()}}return!customElements.get("general-player-sms-verification-form")&&customElements.define("general-player-sms-verification-form",fr),fr}));
600
+ let e=JSON.parse(localStorage.getItem("playerData"));r(10,f=e.playerid),r(11,m=e.number)}P()}));return e.$$set=e=>{"endpoint"in e&&r(12,l=e.endpoint),"tokenid"in e&&r(9,u=e.tokenid),"playerid"in e&&r(10,f=e.playerid),"smstemplate"in e&&r(13,p=e.smstemplate),"number"in e&&r(11,m=e.number),"clientstyling"in e&&r(14,d=e.clientstyling),"clientstylingurl"in e&&r(15,g=e.clientstylingurl),"translationurl"in e&&r(16,b=e.translationurl)},e.$$.update=()=>{e.$$.dirty,/*clientstyling, customStylingContainer*/16385&e.$$.dirty&&d&&h&&(()=>{let e=document.createElement("style");e.innerHTML=d,h.appendChild(e)})(),/*clientstylingurl, customStylingContainer*/32769&e.$$.dirty&&g&&h&&(()=>{let e=new URL(g),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{h.appendChild(t)}),1),setTimeout((()=>{}),500)}))})(),/*translationurl*/65536&e.$$.dirty&&b&&fetch(b).then((e=>e.json())).then((e=>{Object.keys(e).forEach((t=>{nr(t,e[t])}))})).catch((e=>{console.log(e)}))},[h,a,E,c,B,n,async()=>{try{if(!(await fetch(`${l}/player/${f}/activateSMS?tokenId=${u}&validationCode=${a}`,{headers:{"Content-Type":"application/json",accept:"application/json"}})).ok)throw window.postMessage({type:"WidgetNotification",data:{type:"error",message:"Could not activate user"}},window.location.href),r(2,E=!1),new Error("Could not activate user");r(2,E=!0),window.postMessage({type:"SmsHasBeenValidated"},window.location.href)}catch(e){console.log(e)}},async()=>{localStorage.setItem("smsTimer",JSON.stringify(Math.floor(Date.now()/1e3))),P();try{const e=await fetch(`${l}/player/sms/token`,{method:"POST",headers:{"Content-Type":"application/json",accept:"application/json"},body:JSON.stringify({userId:f,messageTemplate:p,destination:m})}),t=await e.json();if(!e.ok)throw y=!0,new Error("Failed to fetch");r(9,u=t.id),y=!1,S()}catch(e){y=!0,console.error(e)}},L,u,f,m,l,p,d,g,b,function(){a=this.value,r(1,a)},e=>L(e),function(e){H[e?"unshift":"push"]((()=>{h=e,r(0,h)}))}]}class fr extends U{constructor(e){super();const t=document.createElement("style");t.textContent="*,*::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(--emfe-w-registration-contrast, var(--emfe-w-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{width:100%;height:44px;border:1px solid var(--emfe-w-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(--emfe-w-registration-color-primary, var(--emfe-w-color-pink-500, #D0046C));background:var(--emfe-w-color-pale, #FBECF4);color:var(--emfe-w-registration-color-primary, var(--emfe-w-color-pink-500, #D0046C))}.InvalidInput{color:var(--emfe-w-color-error, var(--emfe-w-color-red, #ed0909));font-size:10px;line-height:10px}.Button{color:var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));background:var(--emfe-w-registration-color-primary, var(--emfe-w-color-pink-500, #D0046C));border:1px solid var(--emfe-w-registration-color-primary, var(--emfe-w-color-pink-500, #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(--emfe-w-color-gray-100, #E6E6E6);border:1px solid var(--emfe-w-color-gray-100, #E6E6E6);cursor:not-allowed}.Button.SmsVerificationResend{background:var(--emfe-w-registration-color-bg, var(--emfe-w-color-gray-50, #F9F8F8));color:var(--emfe-w-registration-typography, var(--emfe-w-color-dunkel, #07072A))}",this.shadowRoot.appendChild(t),O(this,{target:this.shadowRoot,props:b(this.attributes),customElement:!0},ur,lr,o,{endpoint:12,tokenid:9,playerid:10,smstemplate:13,number:11,clientstyling:14,clientstylingurl:15,translationurl:16},null),e&&(e.target&&c(e.target,this,e.anchor),e.props&&(this.$set(e.props),C()))}static get observedAttributes(){return["endpoint","tokenid","playerid","smstemplate","number","clientstyling","clientstylingurl","translationurl"]}get endpoint(){return this.$$.ctx[12]}set endpoint(e){this.$$set({endpoint:e}),C()}get tokenid(){return this.$$.ctx[9]}set tokenid(e){this.$$set({tokenid:e}),C()}get playerid(){return this.$$.ctx[10]}set playerid(e){this.$$set({playerid:e}),C()}get smstemplate(){return this.$$.ctx[13]}set smstemplate(e){this.$$set({smstemplate:e}),C()}get number(){return this.$$.ctx[11]}set number(e){this.$$set({number:e}),C()}get clientstyling(){return this.$$.ctx[14]}set clientstyling(e){this.$$set({clientstyling:e}),C()}get clientstylingurl(){return this.$$.ctx[15]}set clientstylingurl(e){this.$$set({clientstylingurl:e}),C()}get translationurl(){return this.$$.ctx[16]}set translationurl(e){this.$$set({translationurl:e}),C()}}return!customElements.get("general-player-sms-verification-form")&&customElements.define("general-player-sms-verification-form",fr),fr}));
601
601
  //# sourceMappingURL=general-player-sms-verification-form.js.map