@everymatrix/player-account-balance-modal 1.63.2 → 1.64.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.
@@ -4558,7 +4558,7 @@ de.prototype = {
4558
4558
  }
4559
4559
  };
4560
4560
  function Uo(e) {
4561
- yn(e, "svelte-113krup", '*,*::before,*::after{font-family:inherit}:host{font-family:inherit}input,textarea,button{font-family:inherit}p{padding:0;margin:0}.ShowBalance{position:relative}.ShowBalance .Loading{font-size:14px;white-space:nowrap;padding-right:10px}.ShowBalance .BalanceValue{font-size:14px;cursor:pointer;display:flex;flex-wrap:nowrap;white-space:nowrap}.ShowBalance .BalanceValue svg{width:16px}.ShowBalance .BalanceValue span{padding-left:8px}@media only screen and (max-width: 360px){.ShowBalance .BalanceValue{font-size:12px}.ShowBalance .BalanceValue svg{width:12px}}.BalanceModalWrapper{background-color:var(--emw--color-white, #FFFFFF);position:absolute;top:45px;left:50%;transform:translateX(-60%);padding:10px;box-shadow:0px 30px 30px var(--emw--header-color-primary, var(--emw--color-primary, #D0046C));border-radius:5px;z-index:17;box-shadow:0px 5px 20px 0px #191919}.BalanceModalWrapper:before{content:"";background:var(--emw--color-white, #FFFFFF);clip-path:polygon(50% 0, 0% 100%, 100% 100%);position:absolute;top:-8px;left:60%;width:25px;height:10px;transform:translateX(-50%);z-index:1}.BalanceModalClose{position:absolute;top:5px;right:5px;width:20px;height:20px;z-index:1;cursor:pointer}.BalanceModalClose:before{content:"";background:var(--emw--color-secondary, var(--emw--color-secondary, #FD2839));position:absolute;top:8px;left:0;width:20px;height:2px;transform:rotate(45deg)}.BalanceModalClose:after{content:"";background:var(--emw--color-secondary, var(--emw--color-secondary, #FD2839));position:absolute;top:8px;left:0;width:20px;height:2px;transform:rotate(-45deg)}.BalanceModal{position:relative;width:280px}.BalanceModalHeader{display:flex;align-items:center;justify-content:center;padding:20px 0}.BalanceModalHeader .BalanceModalTitle{font-size:16px;font-weight:bold;color:var(--emw--header-contrast, var(--emw--color-contrast, #07072A))}.BalanceModalRowBoth{display:flex;flex-direction:column;gap:5px;padding:20px 0;border-bottom:1px solid var(--emw--color-gray-100, #E6E6E6)}.BalanceModalRowBoth:last-child{border-bottom:none}.BalanceModalRowBoth .BalanceModalRowLine{display:flex;width:100%;justify-content:space-between}.BalanceModalRowBoth .BalanceModalText{color:var(--emw--header-contrast, var(--emw--color-contrast, #07072A));font-size:14px;text-transform:capitalize}.BalanceModalRowBoth .BalanceModalValue{font-size:14px;font-weight:bold;color:var(--emw--header-contrast, var(--emw--color-contrast, #07072A))}.BalanceModalFooter{display:flex;align-items:center;padding:20px 0 10px}.BalanceModalFooter .BalanceModalAction{background:var(--emw--header-color-primary, var(--emw--color-primary, #D0046C));font-size:12px;color:white;text-transform:uppercase;width:100%;border-radius:5px;border:none;padding:10px 0;cursor:pointer}.BalanceModalFooter .BalanceModalAction:hover,.BalanceModalFooter .BalanceModalActionactive{background:var(--emw--header-contrast, var(--emw--color-background, #07072A))}.ShowBalanceModalOverlay{background-color:rgba(0, 0, 0, 0.7);position:fixed;top:0;bottom:0;left:0;right:0;z-index:16}');
4561
+ yn(e, "svelte-4pkr1", '*,*::before,*::after{font-family:inherit}:host{font-family:inherit}input,textarea,button{font-family:inherit}p{padding:0;margin:0}.ShowBalance{position:relative}.ShowBalance .Loading{font-size:14px;white-space:nowrap;padding-right:10px}.ShowBalance .BalanceValue{font-size:14px;cursor:pointer;display:flex;flex-wrap:nowrap;white-space:nowrap}.ShowBalance .BalanceValue svg{width:16px}.ShowBalance .BalanceValue span{padding-left:8px}@media only screen and (max-width: 360px){.ShowBalance .BalanceValue{font-size:12px}.ShowBalance .BalanceValue svg{width:12px}}.BalanceModalWrapper{background-color:var(--emw--color-white, #FFFFFF);position:absolute;top:45px;left:50%;transform:translateX(-60%);padding:10px;box-shadow:0px 30px 30px var(--emw--header-color-primary, var(--emw--color-primary, #22B04E));border-radius:5px;z-index:17;box-shadow:0px 5px 20px 0px #191919}.BalanceModalWrapper:before{content:"";background:var(--emw--color-white, #FFFFFF);clip-path:polygon(50% 0, 0% 100%, 100% 100%);position:absolute;top:-8px;left:60%;width:25px;height:10px;transform:translateX(-50%);z-index:1}.BalanceModalClose{position:absolute;top:5px;right:5px;width:20px;height:20px;z-index:1;cursor:pointer}.BalanceModalClose:before{content:"";background:var(--emw--color-secondary, var(--emw--color-secondary, #FD2839));position:absolute;top:8px;left:0;width:20px;height:2px;transform:rotate(45deg)}.BalanceModalClose:after{content:"";background:var(--emw--color-secondary, var(--emw--color-secondary, #FD2839));position:absolute;top:8px;left:0;width:20px;height:2px;transform:rotate(-45deg)}.BalanceModal{position:relative;width:280px}.BalanceModalHeader{display:flex;align-items:center;justify-content:center;padding:20px 0}.BalanceModalHeader .BalanceModalTitle{font-size:16px;font-weight:bold;color:var(--emw--header-contrast, var(--emw--color-contrast, #07072A))}.BalanceModalRowBoth{display:flex;flex-direction:column;gap:5px;padding:20px 0;border-bottom:1px solid var(--emw--color-gray-100, #E6E6E6)}.BalanceModalRowBoth:last-child{border-bottom:none}.BalanceModalRowBoth .BalanceModalRowLine{display:flex;width:100%;justify-content:space-between}.BalanceModalRowBoth .BalanceModalText{color:var(--emw--header-contrast, var(--emw--color-contrast, #07072A));font-size:14px;text-transform:capitalize}.BalanceModalRowBoth .BalanceModalValue{font-size:14px;font-weight:bold;color:var(--emw--header-contrast, var(--emw--color-contrast, #07072A))}.BalanceModalFooter{display:flex;align-items:center;padding:20px 0 10px}.BalanceModalFooter .BalanceModalAction{background:var(--emw--header-color-primary, var(--emw--color-primary, #22B04E));font-size:12px;color:white;text-transform:uppercase;width:100%;border-radius:5px;border:none;padding:10px 0;cursor:pointer}.BalanceModalFooter .BalanceModalAction:hover,.BalanceModalFooter .BalanceModalActionactive{background:var(--emw--header-contrast, var(--emw--color-background, #07072A))}.ShowBalanceModalOverlay{background-color:rgba(0, 0, 0, 0.7);position:fixed;top:0;bottom:0;left:0;right:0;z-index:16}');
4562
4562
  }
4563
4563
  function wr(e, t, r) {
4564
4564
  const n = e.slice();
@@ -4521,7 +4521,7 @@ fe.prototype = {
4521
4521
  }
4522
4522
  };
4523
4523
  function Co(e) {
4524
- sn(e, "svelte-113krup", '*,*::before,*::after{font-family:inherit}:host{font-family:inherit}input,textarea,button{font-family:inherit}p{padding:0;margin:0}.ShowBalance{position:relative}.ShowBalance .Loading{font-size:14px;white-space:nowrap;padding-right:10px}.ShowBalance .BalanceValue{font-size:14px;cursor:pointer;display:flex;flex-wrap:nowrap;white-space:nowrap}.ShowBalance .BalanceValue svg{width:16px}.ShowBalance .BalanceValue span{padding-left:8px}@media only screen and (max-width: 360px){.ShowBalance .BalanceValue{font-size:12px}.ShowBalance .BalanceValue svg{width:12px}}.BalanceModalWrapper{background-color:var(--emw--color-white, #FFFFFF);position:absolute;top:45px;left:50%;transform:translateX(-60%);padding:10px;box-shadow:0px 30px 30px var(--emw--header-color-primary, var(--emw--color-primary, #D0046C));border-radius:5px;z-index:17;box-shadow:0px 5px 20px 0px #191919}.BalanceModalWrapper:before{content:"";background:var(--emw--color-white, #FFFFFF);clip-path:polygon(50% 0, 0% 100%, 100% 100%);position:absolute;top:-8px;left:60%;width:25px;height:10px;transform:translateX(-50%);z-index:1}.BalanceModalClose{position:absolute;top:5px;right:5px;width:20px;height:20px;z-index:1;cursor:pointer}.BalanceModalClose:before{content:"";background:var(--emw--color-secondary, var(--emw--color-secondary, #FD2839));position:absolute;top:8px;left:0;width:20px;height:2px;transform:rotate(45deg)}.BalanceModalClose:after{content:"";background:var(--emw--color-secondary, var(--emw--color-secondary, #FD2839));position:absolute;top:8px;left:0;width:20px;height:2px;transform:rotate(-45deg)}.BalanceModal{position:relative;width:280px}.BalanceModalHeader{display:flex;align-items:center;justify-content:center;padding:20px 0}.BalanceModalHeader .BalanceModalTitle{font-size:16px;font-weight:bold;color:var(--emw--header-contrast, var(--emw--color-contrast, #07072A))}.BalanceModalRowBoth{display:flex;flex-direction:column;gap:5px;padding:20px 0;border-bottom:1px solid var(--emw--color-gray-100, #E6E6E6)}.BalanceModalRowBoth:last-child{border-bottom:none}.BalanceModalRowBoth .BalanceModalRowLine{display:flex;width:100%;justify-content:space-between}.BalanceModalRowBoth .BalanceModalText{color:var(--emw--header-contrast, var(--emw--color-contrast, #07072A));font-size:14px;text-transform:capitalize}.BalanceModalRowBoth .BalanceModalValue{font-size:14px;font-weight:bold;color:var(--emw--header-contrast, var(--emw--color-contrast, #07072A))}.BalanceModalFooter{display:flex;align-items:center;padding:20px 0 10px}.BalanceModalFooter .BalanceModalAction{background:var(--emw--header-color-primary, var(--emw--color-primary, #D0046C));font-size:12px;color:white;text-transform:uppercase;width:100%;border-radius:5px;border:none;padding:10px 0;cursor:pointer}.BalanceModalFooter .BalanceModalAction:hover,.BalanceModalFooter .BalanceModalActionactive{background:var(--emw--header-contrast, var(--emw--color-background, #07072A))}.ShowBalanceModalOverlay{background-color:rgba(0, 0, 0, 0.7);position:fixed;top:0;bottom:0;left:0;right:0;z-index:16}');
4524
+ sn(e, "svelte-4pkr1", '*,*::before,*::after{font-family:inherit}:host{font-family:inherit}input,textarea,button{font-family:inherit}p{padding:0;margin:0}.ShowBalance{position:relative}.ShowBalance .Loading{font-size:14px;white-space:nowrap;padding-right:10px}.ShowBalance .BalanceValue{font-size:14px;cursor:pointer;display:flex;flex-wrap:nowrap;white-space:nowrap}.ShowBalance .BalanceValue svg{width:16px}.ShowBalance .BalanceValue span{padding-left:8px}@media only screen and (max-width: 360px){.ShowBalance .BalanceValue{font-size:12px}.ShowBalance .BalanceValue svg{width:12px}}.BalanceModalWrapper{background-color:var(--emw--color-white, #FFFFFF);position:absolute;top:45px;left:50%;transform:translateX(-60%);padding:10px;box-shadow:0px 30px 30px var(--emw--header-color-primary, var(--emw--color-primary, #22B04E));border-radius:5px;z-index:17;box-shadow:0px 5px 20px 0px #191919}.BalanceModalWrapper:before{content:"";background:var(--emw--color-white, #FFFFFF);clip-path:polygon(50% 0, 0% 100%, 100% 100%);position:absolute;top:-8px;left:60%;width:25px;height:10px;transform:translateX(-50%);z-index:1}.BalanceModalClose{position:absolute;top:5px;right:5px;width:20px;height:20px;z-index:1;cursor:pointer}.BalanceModalClose:before{content:"";background:var(--emw--color-secondary, var(--emw--color-secondary, #FD2839));position:absolute;top:8px;left:0;width:20px;height:2px;transform:rotate(45deg)}.BalanceModalClose:after{content:"";background:var(--emw--color-secondary, var(--emw--color-secondary, #FD2839));position:absolute;top:8px;left:0;width:20px;height:2px;transform:rotate(-45deg)}.BalanceModal{position:relative;width:280px}.BalanceModalHeader{display:flex;align-items:center;justify-content:center;padding:20px 0}.BalanceModalHeader .BalanceModalTitle{font-size:16px;font-weight:bold;color:var(--emw--header-contrast, var(--emw--color-contrast, #07072A))}.BalanceModalRowBoth{display:flex;flex-direction:column;gap:5px;padding:20px 0;border-bottom:1px solid var(--emw--color-gray-100, #E6E6E6)}.BalanceModalRowBoth:last-child{border-bottom:none}.BalanceModalRowBoth .BalanceModalRowLine{display:flex;width:100%;justify-content:space-between}.BalanceModalRowBoth .BalanceModalText{color:var(--emw--header-contrast, var(--emw--color-contrast, #07072A));font-size:14px;text-transform:capitalize}.BalanceModalRowBoth .BalanceModalValue{font-size:14px;font-weight:bold;color:var(--emw--header-contrast, var(--emw--color-contrast, #07072A))}.BalanceModalFooter{display:flex;align-items:center;padding:20px 0 10px}.BalanceModalFooter .BalanceModalAction{background:var(--emw--header-color-primary, var(--emw--color-primary, #22B04E));font-size:12px;color:white;text-transform:uppercase;width:100%;border-radius:5px;border:none;padding:10px 0;cursor:pointer}.BalanceModalFooter .BalanceModalAction:hover,.BalanceModalFooter .BalanceModalActionactive{background:var(--emw--header-contrast, var(--emw--color-background, #07072A))}.ShowBalanceModalOverlay{background-color:rgba(0, 0, 0, 0.7);position:fixed;top:0;bottom:0;left:0;right:0;z-index:16}');
4525
4525
  }
4526
4526
  function Er(e, t, r) {
4527
4527
  const n = e.slice();
@@ -12,4 +12,4 @@ Try polyfilling it using "@formatjs/intl-pluralrules"
12
12
  *
13
13
  * Copyright (c) 2021 Jason Wilson
14
14
  * Released under MIT license
15
- */var Po={symbol:"$",separator:",",decimal:".",errorOnInvalid:!1,precision:2,pattern:"!#",negativePattern:"-!#",format:Uo,fromCents:!1},un=function(t){return Math.round(t)},ar=function(t){return Math.pow(10,t)},Io=function(t,r){return un(t/r)*r},Do=/(\d)(?=(\d{3})+\b)/g,Fo=/(\d)(?=(\d\d)+\d\b)/g;function de(e,t){var r=this;if(!(r instanceof de))return new de(e,t);var n=Object.assign({},Po,t),i=ar(n.precision),o=bt(e,n);r.intValue=o,r.value=o/i,n.increment=n.increment||1/i,n.useVedic?n.groups=Fo:n.groups=Do,this.s=n,this.p=i}function bt(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=0,i=t.decimal,o=t.errorOnInvalid,u=t.precision,s=t.fromCents,c=ar(u),l=typeof e=="number",f=e instanceof de;if(f&&s)return e.intValue;if(l||f)n=f?e.value:e;else if(typeof e=="string"){var g=new RegExp("[^-\\d"+i+"]","g"),p=new RegExp("\\"+i,"g");n=e.replace(/\((.*)\)/,"-$1").replace(g,"").replace(p,"."),n=n||0}else{if(o)throw Error("Invalid Input");n=0}return s||(n*=c,n=n.toFixed(4)),r?un(n):n}function Uo(e,t){var r=t.pattern,n=t.negativePattern,i=t.symbol,o=t.separator,u=t.decimal,s=t.groups,c=(""+e).replace(/^-/,"").split("."),l=c[0],f=c[1];return(e.value>=0?r:n).replace("!",i).replace("#",l.replace(s,"$1"+o)+(f?u+f:""))}de.prototype={add:function(t){var r=this.intValue,n=this.s,i=this.p;return de((r+=bt(t,n))/(n.fromCents?1:i),n)},subtract:function(t){var r=this.intValue,n=this.s,i=this.p;return de((r-=bt(t,n))/(n.fromCents?1:i),n)},multiply:function(t){var r=this.intValue,n=this.s;return de((r*=t)/(n.fromCents?1:ar(n.precision)),n)},divide:function(t){var r=this.intValue,n=this.s;return de(r/=bt(t,n,!1),n)},distribute:function(t){for(var r=this.intValue,n=this.p,i=this.s,o=[],u=Math[r>=0?"floor":"ceil"](r/t),s=Math.abs(r-u*t),c=i.fromCents?1:n;t!==0;t--){var l=de(u/c,i);s-- >0&&(l=l[r>=0?"add":"subtract"](1/c)),o.push(l)}return o},dollars:function(){return~~this.value},cents:function(){var t=this.intValue,r=this.p;return~~(t%r)},format:function(t){var r=this.s;return typeof t=="function"?t(this,r):r.format(this,Object.assign({},r,t))},toString:function(){var t=this.intValue,r=this.p,n=this.s;return Io(t/r,n.increment).toFixed(n.precision)},toJSON:function(){return this.value}};function Go(e){vn(e,"svelte-113krup",'*,*::before,*::after{font-family:inherit}:host{font-family:inherit}input,textarea,button{font-family:inherit}p{padding:0;margin:0}.ShowBalance{position:relative}.ShowBalance .Loading{font-size:14px;white-space:nowrap;padding-right:10px}.ShowBalance .BalanceValue{font-size:14px;cursor:pointer;display:flex;flex-wrap:nowrap;white-space:nowrap}.ShowBalance .BalanceValue svg{width:16px}.ShowBalance .BalanceValue span{padding-left:8px}@media only screen and (max-width: 360px){.ShowBalance .BalanceValue{font-size:12px}.ShowBalance .BalanceValue svg{width:12px}}.BalanceModalWrapper{background-color:var(--emw--color-white, #FFFFFF);position:absolute;top:45px;left:50%;transform:translateX(-60%);padding:10px;box-shadow:0px 30px 30px var(--emw--header-color-primary, var(--emw--color-primary, #D0046C));border-radius:5px;z-index:17;box-shadow:0px 5px 20px 0px #191919}.BalanceModalWrapper:before{content:"";background:var(--emw--color-white, #FFFFFF);clip-path:polygon(50% 0, 0% 100%, 100% 100%);position:absolute;top:-8px;left:60%;width:25px;height:10px;transform:translateX(-50%);z-index:1}.BalanceModalClose{position:absolute;top:5px;right:5px;width:20px;height:20px;z-index:1;cursor:pointer}.BalanceModalClose:before{content:"";background:var(--emw--color-secondary, var(--emw--color-secondary, #FD2839));position:absolute;top:8px;left:0;width:20px;height:2px;transform:rotate(45deg)}.BalanceModalClose:after{content:"";background:var(--emw--color-secondary, var(--emw--color-secondary, #FD2839));position:absolute;top:8px;left:0;width:20px;height:2px;transform:rotate(-45deg)}.BalanceModal{position:relative;width:280px}.BalanceModalHeader{display:flex;align-items:center;justify-content:center;padding:20px 0}.BalanceModalHeader .BalanceModalTitle{font-size:16px;font-weight:bold;color:var(--emw--header-contrast, var(--emw--color-contrast, #07072A))}.BalanceModalRowBoth{display:flex;flex-direction:column;gap:5px;padding:20px 0;border-bottom:1px solid var(--emw--color-gray-100, #E6E6E6)}.BalanceModalRowBoth:last-child{border-bottom:none}.BalanceModalRowBoth .BalanceModalRowLine{display:flex;width:100%;justify-content:space-between}.BalanceModalRowBoth .BalanceModalText{color:var(--emw--header-contrast, var(--emw--color-contrast, #07072A));font-size:14px;text-transform:capitalize}.BalanceModalRowBoth .BalanceModalValue{font-size:14px;font-weight:bold;color:var(--emw--header-contrast, var(--emw--color-contrast, #07072A))}.BalanceModalFooter{display:flex;align-items:center;padding:20px 0 10px}.BalanceModalFooter .BalanceModalAction{background:var(--emw--header-color-primary, var(--emw--color-primary, #D0046C));font-size:12px;color:white;text-transform:uppercase;width:100%;border-radius:5px;border:none;padding:10px 0;cursor:pointer}.BalanceModalFooter .BalanceModalAction:hover,.BalanceModalFooter .BalanceModalActionactive{background:var(--emw--header-contrast, var(--emw--color-background, #07072A))}.ShowBalanceModalOverlay{background-color:rgba(0, 0, 0, 0.7);position:fixed;top:0;bottom:0;left:0;right:0;z-index:16}')}function wr(e,t,r){const n=e.slice();return n[47]=t[r],n}function Ar(e,t,r){const n=e.slice();return n[50]=t[r],n}function $o(e){let t,r=(e[4].Total?e[6](e[4].Total[0].amount):"0")+"",n,i,o,u,s,c,l,f,g,p=e[2]&&Cr(e);return{c(){t=V("p"),n=pe(r),i=ge(),o=pe(e[3]),u=ge(),s=V("span"),s.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 11.435"><defs><style>.a{fill:var(--emw--color-white, #FFFFFF);}</style></defs><path class="a" d="M16.191,19.235l7.562-7.568a1.423,1.423,0,0,1,2.019,0,1.441,1.441,0,0,1,0,2.025L17.2,22.265a1.427,1.427,0,0,1-1.971.042L6.6,13.7a1.429,1.429,0,0,1,2.019-2.025Z" transform="translate(-6.188 -11.246)"></path></svg>',c=ge(),p&&p.c(),l=_n(),Z(t,"class","BalanceValue")},m(y,E){Ee(y,t,E),L(t,n),L(t,i),L(t,o),L(t,u),L(t,s),Ee(y,c,E),p&&p.m(y,E),Ee(y,l,E),f||(g=yt(t,"click",e[23]),f=!0)},p(y,E){E[0]&16&&r!==(r=(y[4].Total?y[6](y[4].Total[0].amount):"0")+"")&&Se(n,r),E[0]&8&&Se(o,y[3]),y[2]?p?p.p(y,E):(p=Cr(y),p.c(),p.m(l.parentNode,l)):p&&(p.d(1),p=null)},d(y){y&&(me(t),me(c),me(l)),p&&p.d(y),f=!1,g()}}}function jo(e){let t,r=e[5]("Loading")+"",n;return{c(){t=V("p"),n=pe(r)},m(i,o){Ee(i,t,o),L(t,n)},p(i,o){o[0]&32&&r!==(r=i[5]("Loading")+"")&&Se(n,r)},d(i){i&&me(t)}}}function Cr(e){let t,r,n,i,o,u,s=e[5]("Title")+"",c,l,f,g,p,y,E=e[5]("DepositButton")+"",N,C,G,X=vt(Object.keys(e[4])),T=[];for(let S=0;S<X.length;S+=1)T[S]=Or(wr(e,X,S));return{c(){t=V("div"),r=V("div"),n=ge(),i=V("div"),o=V("div"),u=V("p"),c=pe(s),l=ge(),f=V("div");for(let S=0;S<T.length;S+=1)T[S].c();g=ge(),p=V("div"),y=V("button"),N=pe(E),Z(r,"class","BalanceModalClose"),Z(u,"class","BalanceModalTitle"),Z(o,"class","BalanceModalHeader"),Z(f,"class","BalanceModalBody"),Z(y,"class","BalanceModalAction"),Z(p,"class","BalanceModalFooter"),Z(i,"class","BalanceModal"),Z(t,"class","BalanceModalWrapper")},m(S,F){Ee(S,t,F),L(t,r),L(t,n),L(t,i),L(i,o),L(o,u),L(u,c),L(i,l),L(i,f);for(let M=0;M<T.length;M+=1)T[M]&&T[M].m(f,null);L(i,g),L(i,p),L(p,y),L(y,N),C||(G=[yt(r,"click",e[24]),yt(y,"click",e[25])],C=!0)},p(S,F){if(F[0]&32&&s!==(s=S[5]("Title")+"")&&Se(c,s),F[0]&120){X=vt(Object.keys(S[4]));let M;for(M=0;M<X.length;M+=1){const te=wr(S,X,M);T[M]?T[M].p(te,F):(T[M]=Or(te),T[M].c(),T[M].m(f,null))}for(;M<T.length;M+=1)T[M].d(1);T.length=X.length}F[0]&32&&E!==(E=S[5]("DepositButton")+"")&&Se(N,E)},d(S){S&&me(t),Pr(T,S),C=!1,Ve(G)}}}function Hr(e){let t,r,n=e[5](e[47])+"",i,o,u=(e[50].productType?e[5](e[50].productType):"")+"",s,c,l,f,g=(e[50].amount?e[6](e[50].amount):"0")+"",p,y,E,N;return{c(){t=V("div"),r=V("p"),i=pe(n),o=ge(),s=pe(u),c=ge(),l=V("p"),f=V("span"),p=pe(g),y=ge(),E=V("span"),N=pe(e[3]),Z(r,"class","BalanceModalText"),Z(f,"class","BalanceModalAmount"),Z(E,"class","BalanceModalCurrency"),Z(l,"class","BalanceModalValue"),Z(t,"class","BalanceModalRowLine")},m(C,G){Ee(C,t,G),L(t,r),L(r,i),L(r,o),L(r,s),L(t,c),L(t,l),L(l,f),L(f,p),L(l,y),L(l,E),L(E,N)},p(C,G){G[0]&48&&n!==(n=C[5](C[47])+"")&&Se(i,n),G[0]&48&&u!==(u=(C[50].productType?C[5](C[50].productType):"")+"")&&Se(s,u),G[0]&16&&g!==(g=(C[50].amount?C[6](C[50].amount):"0")+"")&&Se(p,g),G[0]&8&&Se(N,C[3])},d(C){C&&me(t)}}}function Or(e){let t,r,n=vt(e[4][e[47]]),i=[];for(let o=0;o<n.length;o+=1)i[o]=Hr(Ar(e,n,o));return{c(){t=V("div");for(let o=0;o<i.length;o+=1)i[o].c();r=ge(),Z(t,"class","BalanceModalRowBoth")},m(o,u){Ee(o,t,u);for(let s=0;s<i.length;s+=1)i[s]&&i[s].m(t,null);L(t,r)},p(o,u){if(u[0]&120){n=vt(o[4][o[47]]);let s;for(s=0;s<n.length;s+=1){const c=Ar(o,n,s);i[s]?i[s].p(c,u):(i[s]=Hr(c),i[s].c(),i[s].m(t,r))}for(;s<i.length;s+=1)i[s].d(1);i.length=n.length}},d(o){o&&me(t),Pr(i,o)}}}function Rr(e){let t,r,n;return{c(){t=V("div"),Z(t,"class","ShowBalanceModalOverlay")},m(i,o){Ee(i,t,o),r||(n=yt(t,"click",e[26]),r=!0)},p:le,d(i){i&&me(t),r=!1,n()}}}function ko(e){let t,r,n;function i(c,l){return c[1]?jo:$o}let o=i(e),u=o(e),s=e[2]&&Rr(e);return{c(){t=V("div"),r=V("div"),u.c(),n=ge(),s&&s.c(),Z(r,"class","ShowBalance")},m(c,l){Ee(c,t,l),L(t,r),u.m(r,null),L(t,n),s&&s.m(t,null),e[27](t)},p(c,l){o===(o=i(c))&&u?u.p(c,l):(u.d(1),u=o(c),u&&(u.c(),u.m(r,null))),c[2]?s?s.p(c,l):(s=Rr(c),s.c(),s.m(t,null)):s&&(s.d(1),s=null)},i:le,o:le,d(c){c&&me(t),u.d(),s&&s.d(),e[27](null)}}}function Vo(e,t,r){let n;yn(e,Lo,b=>r(5,n=b));let{userid:i=""}=t,{session:o=""}=t,{endpoint:u=""}=t,{lang:s="en"}=t,{clientstyling:c=""}=t,{clientstylingurl:l=""}=t,{translationurl:f=""}=t,{customlocaleidentifier:g=""}=t,{gmversion:p="gm16"}=t,{displaybalanceoption:y="All"}=t,{totalcalculationmode:E="totalCashAmount"}=t,{currencyseparator:N=""}=t,{currencydecimal:C=""}=t,{currencyprecision:G=""}=t,{mbsource:X}=t,T,S,F,M=!1,te="",he=[],we,ce=!1;const v={},ae=["totalCashAmount","totalRealAmount"],at=()=>{fetch(f).then(b=>b.json()).then(b=>Object.keys(b).forEach(R=>Br(R,b[R]))).catch(b=>console.log(b))};Object.keys(Sr).forEach(b=>Br(b,Sr[b]));const Le=()=>{if(g.includes(s))return g},st=b=>g?new Intl.NumberFormat(Le(),{useGrouping:!0}).format(b):N&&C?de(b,{separator:N,decimal:C,symbol:"",precision:parseInt(G||"2",10)}).format():de(b,{separator:".",decimal:",",symbol:"",precision:parseInt(G||"2",10)}).format(),Ze=()=>It(this,null,function*(){var R,P,a;r(1,T=!0);const b=new URL(`${u}/v1/player/${i}/account`);try{const d=yield fetch(b,{method:"GET",headers:{"X-SessionID":o}}),m=yield d.json();if(d.ok)he=m.items,r(3,te=(R=he.find(h=>h.displayName==="Casino"))==null?void 0:R.currency),r(4,v.Total=[{amount:m.totalAmount[te]}],v),r(4,v.Real=[{amount:(P=he.find(h=>h.displayName==="Casino"))==null?void 0:P.balanceAmount}],v),r(4,v.Bonus=[{amount:(a=he.find(h=>h.displayName==="UBS"))==null?void 0:a.balanceAmount}],v);else throw new Error("Failed to fetch balance data !")}catch(d){console.log("Balance error: ",d)}finally{r(1,T=!1)}}),be=()=>{r(1,T=!0);const b=new URL(`${u}/v2/player/${i}/balance`),R=new Headers;R.append("X-SessionID",o),fetch(b,{method:"GET",headers:R}).then(a=>a.json()).then(a=>{a[E]||r(8,E=ae[0]);const d=a.items.find(h=>h.type==="Real"&&h.walletAccountType==="Ordinary");if(r(3,te=d.currency),ce=!!d.productType,r(4,v.Total=[{amount:0}],v),r(4,v.Real=[],v),r(4,v.Bonus=[],v),r(4,v.Credit=[],v),!ce){we={lastOrdinaryAfterAmount:0,showCreditLineAfterAmount:!1},r(4,v.Total[0].amount=a[E][te],v);for(const h of a.items)switch(h.type){case"Bonus":v.Bonus.length===0?v.Bonus.push({amount:h.amount}):r(4,v.Bonus[0].amount+=h.amount,v);break;case"Real":if(h.creditLine&&v.Credit.length===0&&v.Credit.push({amount:h.creditLine}),E==="totalRealAmount")continue;v.Real.length===0?v.Real.push({amount:h.amount}):r(4,v.Real[0].amount+=h.amount,v);break}for(const[h,_]of Object.entries(v))_.length<1&&delete v[h];r(1,T=!1);return}we={Casino:{lastOrdinaryAfterAmount:0,showCreditLineAfterAmount:!1},Sports:{lastOrdinaryAfterAmount:0,showCreditLineAfterAmount:!1}};let m=a.items;y&&y!=="All"&&(m=a.items.filter(h=>h.productType===y));for(const h of m){let _;switch(h.type){case"Bonus":_=v.Bonus.findIndex(x=>x.productType===h.productType),_>0?r(4,v.Bonus[_].amount+=h.amount,v):v.Bonus.push({amount:h.amount,productType:h.productType});break;case"Real":h.creditLine&&v.Credit.push({amount:h.creditLine,productType:h.productType}),_=v.Real.findIndex(x=>x.productType===h.productType),_>0?r(4,v.Real[_].amount+=h.amount,v):v.Real.push({amount:h.amount,productType:h.productType});break}}Ne();for(const[h,_]of Object.entries(v))_.length<1&&delete v[h];r(1,T=!1)}).catch(a=>{throw r(1,T=!1),new Error("Failed to fetch balance data !")})},ye=()=>{if(F&&F.close(),o.length<1)return;let b,R;switch(p){case"gm16":b=new URL(`${u}/v2/player/${i}/information/updates`),R=d=>ut(d);break;case"gmcore":b=new URL(`${u}/v1/player/${i}/balance/updates`),R=d=>qe(d);break}const P={accept:"text/event-stream","X-SessionId":o},a=new Mo.EventSourcePolyfill(b,{headers:P});F=a,a.addEventListener("message",R)},Ae=b=>{let R;try{R=JSON.parse(b)}catch(P){console.log("Balance stream failed: ",P);return}return R},qe=b=>{var d,m;const R=Ae(b.data);if(!R){ye();return}let P="0";const a=R.balanceChange;he=he.map(h=>(a&&a[h.id]&&(h=Pt(Mt({},h),{balanceAmount:a[h.id].afterAmount})),P=(parseFloat(h==null?void 0:h.balanceAmount)+parseFloat(P)).toString(),h)),r(4,v.Real=[{amount:(d=he[0])==null?void 0:d.balanceAmount}],v),r(4,v.Bonus=[{amount:(m=he[1])==null?void 0:m.balanceAmount}],v),r(4,v.Total=[{amount:Number(P)}],v)},se=(b,R,P)=>{let a=null;switch(P.walletAccountType){case"Ordinary":P.afterAmount!==P.affectedAmount&&(R.lastOrdinaryAfterAmount=P.afterAmount,R.showCreditLineAfterAmount||(a=P.afterAmount));break;case"CreditLine":P.afterAmount!==0?(a=P.afterAmount,R.showCreditLineAfterAmount=!0):(a=R.lastOrdinaryAfterAmount,R.showCreditLineAfterAmount=!1);break;default:a=P.afterAmount}return a===null?b:a},Ne=()=>{switch(E){case"totalCashAmount":let b=0;for(const P of["Real","Bonus"])for(const a of v[P])b+=Math.max(a.amount,0);r(4,v.Total[0].amount=b,v);break;case"totalRealAmount":if(!ce)return;let R=0;for(const P of v.Real)R+=P.amount;r(4,v.Total[0].amount=R,v)}},ut=b=>{const R=Ae(b.data);if(!R){ye();return}if(R.type!=="BALANCE_UPDATE_V2")return;const P=R.body.balanceChange;for(const[a,d]of Object.entries(P))if(E==="totalRealAmount"&&a==="Real"&&!ce&&r(4,v.Total[0].amount=se(v.Total[0].amount,we,d),v),!!v[a])for(const m of v[a]){if(!ce){m.amount=a==="Real"?se(m.amount,we,d):d.afterAmount;continue}d.productType===m.productType&&(m.amount=a==="Real"?se(m.amount,we[m.productType],d):d.afterAmount)}Ne()},lt=()=>{r(2,M=!1),window.postMessage({type:"GoToDeposit"},window.location.href),typeof gtag=="function"&&gtag("event","GoToDeposit",{context:"PlayerAccountBalanceModal"})},Ct=()=>{ae.includes(E)||(console.error(`Unsupported value ('${E}') for totalcalculationmode parameter. Only the following values are supported ${ae}. Using default value ('${ae[0]}').`),r(8,E=ae[0]))},Ht=()=>{switch(No(s),Ct(),p){case"gmcore":Ze();break;case"gm16":be();break;default:throw Error(`Invalid apiversion attribute: ${p}`)}},ht=b=>b.data&&b.data.type==="LogoutSuccessfull"&&F.close();wn(()=>(window.addEventListener("message",ht,!1),()=>{window.removeEventListener("message",ht),F&&F.close()}));const Qe=()=>r(2,M=!0),Je=()=>r(2,M=!1),Ce=()=>lt(),re=()=>r(2,M=!1);function Ot(b){Vt[b?"unshift":"push"](()=>{S=b,r(0,S)})}return e.$$set=b=>{"userid"in b&&r(9,i=b.userid),"session"in b&&r(10,o=b.session),"endpoint"in b&&r(11,u=b.endpoint),"lang"in b&&r(12,s=b.lang),"clientstyling"in b&&r(13,c=b.clientstyling),"clientstylingurl"in b&&r(14,l=b.clientstylingurl),"translationurl"in b&&r(15,f=b.translationurl),"customlocaleidentifier"in b&&r(16,g=b.customlocaleidentifier),"gmversion"in b&&r(17,p=b.gmversion),"displaybalanceoption"in b&&r(18,y=b.displaybalanceoption),"totalcalculationmode"in b&&r(8,E=b.totalcalculationmode),"currencyseparator"in b&&r(19,N=b.currencyseparator),"currencydecimal"in b&&r(20,C=b.currencydecimal),"currencyprecision"in b&&r(21,G=b.currencyprecision),"mbsource"in b&&r(22,X=b.mbsource)},e.$$.update=()=>{e.$$.dirty[0]&4096&&s&&Le(),e.$$.dirty[0]&400896&&u&&i&&o&&s&&p&&y&&Ht(),e.$$.dirty[0]&134656&&u&&i&&o&&p&&ye(),e.$$.dirty[0]&8193&&c&&S&&Gn(S,c),e.$$.dirty[0]&16385&&l&&S&&$n(S,l),e.$$.dirty[0]&4194305&&S&&jn(S,`${X}.Style`),e.$$.dirty[0]&32768&&f&&at()},[S,T,M,te,v,n,st,lt,E,i,o,u,s,c,l,f,g,p,y,N,C,G,X,Qe,Je,Ce,re,Ot]}class ln extends Fn{constructor(t){super(),In(this,t,Vo,ko,Nr,{userid:9,session:10,endpoint:11,lang:12,clientstyling:13,clientstylingurl:14,translationurl:15,customlocaleidentifier:16,gmversion:17,displaybalanceoption:18,totalcalculationmode:8,currencyseparator:19,currencydecimal:20,currencyprecision:21,mbsource:22},Go,[-1,-1])}get userid(){return this.$$.ctx[9]}set userid(t){this.$$set({userid:t}),Q()}get session(){return this.$$.ctx[10]}set session(t){this.$$set({session:t}),Q()}get endpoint(){return this.$$.ctx[11]}set endpoint(t){this.$$set({endpoint:t}),Q()}get lang(){return this.$$.ctx[12]}set lang(t){this.$$set({lang:t}),Q()}get clientstyling(){return this.$$.ctx[13]}set clientstyling(t){this.$$set({clientstyling:t}),Q()}get clientstylingurl(){return this.$$.ctx[14]}set clientstylingurl(t){this.$$set({clientstylingurl:t}),Q()}get translationurl(){return this.$$.ctx[15]}set translationurl(t){this.$$set({translationurl:t}),Q()}get customlocaleidentifier(){return this.$$.ctx[16]}set customlocaleidentifier(t){this.$$set({customlocaleidentifier:t}),Q()}get gmversion(){return this.$$.ctx[17]}set gmversion(t){this.$$set({gmversion:t}),Q()}get displaybalanceoption(){return this.$$.ctx[18]}set displaybalanceoption(t){this.$$set({displaybalanceoption:t}),Q()}get totalcalculationmode(){return this.$$.ctx[8]}set totalcalculationmode(t){this.$$set({totalcalculationmode:t}),Q()}get currencyseparator(){return this.$$.ctx[19]}set currencyseparator(t){this.$$set({currencyseparator:t}),Q()}get currencydecimal(){return this.$$.ctx[20]}set currencydecimal(t){this.$$set({currencydecimal:t}),Q()}get currencyprecision(){return this.$$.ctx[21]}set currencyprecision(t){this.$$set({currencyprecision:t}),Q()}get mbsource(){return this.$$.ctx[22]}set mbsource(t){this.$$set({mbsource:t}),Q()}}Dn(ln,{userid:{},session:{},endpoint:{},lang:{},clientstyling:{},clientstylingurl:{},translationurl:{},customlocaleidentifier:{},gmversion:{},displaybalanceoption:{},totalcalculationmode:{},currencyseparator:{},currencydecimal:{},currencyprecision:{},mbsource:{}},[],[],!0);exports.default=ln;
15
+ */var Po={symbol:"$",separator:",",decimal:".",errorOnInvalid:!1,precision:2,pattern:"!#",negativePattern:"-!#",format:Uo,fromCents:!1},un=function(t){return Math.round(t)},ar=function(t){return Math.pow(10,t)},Io=function(t,r){return un(t/r)*r},Do=/(\d)(?=(\d{3})+\b)/g,Fo=/(\d)(?=(\d\d)+\d\b)/g;function de(e,t){var r=this;if(!(r instanceof de))return new de(e,t);var n=Object.assign({},Po,t),i=ar(n.precision),o=bt(e,n);r.intValue=o,r.value=o/i,n.increment=n.increment||1/i,n.useVedic?n.groups=Fo:n.groups=Do,this.s=n,this.p=i}function bt(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=0,i=t.decimal,o=t.errorOnInvalid,u=t.precision,s=t.fromCents,c=ar(u),l=typeof e=="number",f=e instanceof de;if(f&&s)return e.intValue;if(l||f)n=f?e.value:e;else if(typeof e=="string"){var g=new RegExp("[^-\\d"+i+"]","g"),p=new RegExp("\\"+i,"g");n=e.replace(/\((.*)\)/,"-$1").replace(g,"").replace(p,"."),n=n||0}else{if(o)throw Error("Invalid Input");n=0}return s||(n*=c,n=n.toFixed(4)),r?un(n):n}function Uo(e,t){var r=t.pattern,n=t.negativePattern,i=t.symbol,o=t.separator,u=t.decimal,s=t.groups,c=(""+e).replace(/^-/,"").split("."),l=c[0],f=c[1];return(e.value>=0?r:n).replace("!",i).replace("#",l.replace(s,"$1"+o)+(f?u+f:""))}de.prototype={add:function(t){var r=this.intValue,n=this.s,i=this.p;return de((r+=bt(t,n))/(n.fromCents?1:i),n)},subtract:function(t){var r=this.intValue,n=this.s,i=this.p;return de((r-=bt(t,n))/(n.fromCents?1:i),n)},multiply:function(t){var r=this.intValue,n=this.s;return de((r*=t)/(n.fromCents?1:ar(n.precision)),n)},divide:function(t){var r=this.intValue,n=this.s;return de(r/=bt(t,n,!1),n)},distribute:function(t){for(var r=this.intValue,n=this.p,i=this.s,o=[],u=Math[r>=0?"floor":"ceil"](r/t),s=Math.abs(r-u*t),c=i.fromCents?1:n;t!==0;t--){var l=de(u/c,i);s-- >0&&(l=l[r>=0?"add":"subtract"](1/c)),o.push(l)}return o},dollars:function(){return~~this.value},cents:function(){var t=this.intValue,r=this.p;return~~(t%r)},format:function(t){var r=this.s;return typeof t=="function"?t(this,r):r.format(this,Object.assign({},r,t))},toString:function(){var t=this.intValue,r=this.p,n=this.s;return Io(t/r,n.increment).toFixed(n.precision)},toJSON:function(){return this.value}};function Go(e){vn(e,"svelte-4pkr1",'*,*::before,*::after{font-family:inherit}:host{font-family:inherit}input,textarea,button{font-family:inherit}p{padding:0;margin:0}.ShowBalance{position:relative}.ShowBalance .Loading{font-size:14px;white-space:nowrap;padding-right:10px}.ShowBalance .BalanceValue{font-size:14px;cursor:pointer;display:flex;flex-wrap:nowrap;white-space:nowrap}.ShowBalance .BalanceValue svg{width:16px}.ShowBalance .BalanceValue span{padding-left:8px}@media only screen and (max-width: 360px){.ShowBalance .BalanceValue{font-size:12px}.ShowBalance .BalanceValue svg{width:12px}}.BalanceModalWrapper{background-color:var(--emw--color-white, #FFFFFF);position:absolute;top:45px;left:50%;transform:translateX(-60%);padding:10px;box-shadow:0px 30px 30px var(--emw--header-color-primary, var(--emw--color-primary, #22B04E));border-radius:5px;z-index:17;box-shadow:0px 5px 20px 0px #191919}.BalanceModalWrapper:before{content:"";background:var(--emw--color-white, #FFFFFF);clip-path:polygon(50% 0, 0% 100%, 100% 100%);position:absolute;top:-8px;left:60%;width:25px;height:10px;transform:translateX(-50%);z-index:1}.BalanceModalClose{position:absolute;top:5px;right:5px;width:20px;height:20px;z-index:1;cursor:pointer}.BalanceModalClose:before{content:"";background:var(--emw--color-secondary, var(--emw--color-secondary, #FD2839));position:absolute;top:8px;left:0;width:20px;height:2px;transform:rotate(45deg)}.BalanceModalClose:after{content:"";background:var(--emw--color-secondary, var(--emw--color-secondary, #FD2839));position:absolute;top:8px;left:0;width:20px;height:2px;transform:rotate(-45deg)}.BalanceModal{position:relative;width:280px}.BalanceModalHeader{display:flex;align-items:center;justify-content:center;padding:20px 0}.BalanceModalHeader .BalanceModalTitle{font-size:16px;font-weight:bold;color:var(--emw--header-contrast, var(--emw--color-contrast, #07072A))}.BalanceModalRowBoth{display:flex;flex-direction:column;gap:5px;padding:20px 0;border-bottom:1px solid var(--emw--color-gray-100, #E6E6E6)}.BalanceModalRowBoth:last-child{border-bottom:none}.BalanceModalRowBoth .BalanceModalRowLine{display:flex;width:100%;justify-content:space-between}.BalanceModalRowBoth .BalanceModalText{color:var(--emw--header-contrast, var(--emw--color-contrast, #07072A));font-size:14px;text-transform:capitalize}.BalanceModalRowBoth .BalanceModalValue{font-size:14px;font-weight:bold;color:var(--emw--header-contrast, var(--emw--color-contrast, #07072A))}.BalanceModalFooter{display:flex;align-items:center;padding:20px 0 10px}.BalanceModalFooter .BalanceModalAction{background:var(--emw--header-color-primary, var(--emw--color-primary, #22B04E));font-size:12px;color:white;text-transform:uppercase;width:100%;border-radius:5px;border:none;padding:10px 0;cursor:pointer}.BalanceModalFooter .BalanceModalAction:hover,.BalanceModalFooter .BalanceModalActionactive{background:var(--emw--header-contrast, var(--emw--color-background, #07072A))}.ShowBalanceModalOverlay{background-color:rgba(0, 0, 0, 0.7);position:fixed;top:0;bottom:0;left:0;right:0;z-index:16}')}function wr(e,t,r){const n=e.slice();return n[47]=t[r],n}function Ar(e,t,r){const n=e.slice();return n[50]=t[r],n}function $o(e){let t,r=(e[4].Total?e[6](e[4].Total[0].amount):"0")+"",n,i,o,u,s,c,l,f,g,p=e[2]&&Cr(e);return{c(){t=V("p"),n=pe(r),i=ge(),o=pe(e[3]),u=ge(),s=V("span"),s.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 11.435"><defs><style>.a{fill:var(--emw--color-white, #FFFFFF);}</style></defs><path class="a" d="M16.191,19.235l7.562-7.568a1.423,1.423,0,0,1,2.019,0,1.441,1.441,0,0,1,0,2.025L17.2,22.265a1.427,1.427,0,0,1-1.971.042L6.6,13.7a1.429,1.429,0,0,1,2.019-2.025Z" transform="translate(-6.188 -11.246)"></path></svg>',c=ge(),p&&p.c(),l=_n(),Z(t,"class","BalanceValue")},m(y,E){Ee(y,t,E),L(t,n),L(t,i),L(t,o),L(t,u),L(t,s),Ee(y,c,E),p&&p.m(y,E),Ee(y,l,E),f||(g=yt(t,"click",e[23]),f=!0)},p(y,E){E[0]&16&&r!==(r=(y[4].Total?y[6](y[4].Total[0].amount):"0")+"")&&Se(n,r),E[0]&8&&Se(o,y[3]),y[2]?p?p.p(y,E):(p=Cr(y),p.c(),p.m(l.parentNode,l)):p&&(p.d(1),p=null)},d(y){y&&(me(t),me(c),me(l)),p&&p.d(y),f=!1,g()}}}function jo(e){let t,r=e[5]("Loading")+"",n;return{c(){t=V("p"),n=pe(r)},m(i,o){Ee(i,t,o),L(t,n)},p(i,o){o[0]&32&&r!==(r=i[5]("Loading")+"")&&Se(n,r)},d(i){i&&me(t)}}}function Cr(e){let t,r,n,i,o,u,s=e[5]("Title")+"",c,l,f,g,p,y,E=e[5]("DepositButton")+"",N,C,G,X=vt(Object.keys(e[4])),T=[];for(let S=0;S<X.length;S+=1)T[S]=Or(wr(e,X,S));return{c(){t=V("div"),r=V("div"),n=ge(),i=V("div"),o=V("div"),u=V("p"),c=pe(s),l=ge(),f=V("div");for(let S=0;S<T.length;S+=1)T[S].c();g=ge(),p=V("div"),y=V("button"),N=pe(E),Z(r,"class","BalanceModalClose"),Z(u,"class","BalanceModalTitle"),Z(o,"class","BalanceModalHeader"),Z(f,"class","BalanceModalBody"),Z(y,"class","BalanceModalAction"),Z(p,"class","BalanceModalFooter"),Z(i,"class","BalanceModal"),Z(t,"class","BalanceModalWrapper")},m(S,F){Ee(S,t,F),L(t,r),L(t,n),L(t,i),L(i,o),L(o,u),L(u,c),L(i,l),L(i,f);for(let M=0;M<T.length;M+=1)T[M]&&T[M].m(f,null);L(i,g),L(i,p),L(p,y),L(y,N),C||(G=[yt(r,"click",e[24]),yt(y,"click",e[25])],C=!0)},p(S,F){if(F[0]&32&&s!==(s=S[5]("Title")+"")&&Se(c,s),F[0]&120){X=vt(Object.keys(S[4]));let M;for(M=0;M<X.length;M+=1){const te=wr(S,X,M);T[M]?T[M].p(te,F):(T[M]=Or(te),T[M].c(),T[M].m(f,null))}for(;M<T.length;M+=1)T[M].d(1);T.length=X.length}F[0]&32&&E!==(E=S[5]("DepositButton")+"")&&Se(N,E)},d(S){S&&me(t),Pr(T,S),C=!1,Ve(G)}}}function Hr(e){let t,r,n=e[5](e[47])+"",i,o,u=(e[50].productType?e[5](e[50].productType):"")+"",s,c,l,f,g=(e[50].amount?e[6](e[50].amount):"0")+"",p,y,E,N;return{c(){t=V("div"),r=V("p"),i=pe(n),o=ge(),s=pe(u),c=ge(),l=V("p"),f=V("span"),p=pe(g),y=ge(),E=V("span"),N=pe(e[3]),Z(r,"class","BalanceModalText"),Z(f,"class","BalanceModalAmount"),Z(E,"class","BalanceModalCurrency"),Z(l,"class","BalanceModalValue"),Z(t,"class","BalanceModalRowLine")},m(C,G){Ee(C,t,G),L(t,r),L(r,i),L(r,o),L(r,s),L(t,c),L(t,l),L(l,f),L(f,p),L(l,y),L(l,E),L(E,N)},p(C,G){G[0]&48&&n!==(n=C[5](C[47])+"")&&Se(i,n),G[0]&48&&u!==(u=(C[50].productType?C[5](C[50].productType):"")+"")&&Se(s,u),G[0]&16&&g!==(g=(C[50].amount?C[6](C[50].amount):"0")+"")&&Se(p,g),G[0]&8&&Se(N,C[3])},d(C){C&&me(t)}}}function Or(e){let t,r,n=vt(e[4][e[47]]),i=[];for(let o=0;o<n.length;o+=1)i[o]=Hr(Ar(e,n,o));return{c(){t=V("div");for(let o=0;o<i.length;o+=1)i[o].c();r=ge(),Z(t,"class","BalanceModalRowBoth")},m(o,u){Ee(o,t,u);for(let s=0;s<i.length;s+=1)i[s]&&i[s].m(t,null);L(t,r)},p(o,u){if(u[0]&120){n=vt(o[4][o[47]]);let s;for(s=0;s<n.length;s+=1){const c=Ar(o,n,s);i[s]?i[s].p(c,u):(i[s]=Hr(c),i[s].c(),i[s].m(t,r))}for(;s<i.length;s+=1)i[s].d(1);i.length=n.length}},d(o){o&&me(t),Pr(i,o)}}}function Rr(e){let t,r,n;return{c(){t=V("div"),Z(t,"class","ShowBalanceModalOverlay")},m(i,o){Ee(i,t,o),r||(n=yt(t,"click",e[26]),r=!0)},p:le,d(i){i&&me(t),r=!1,n()}}}function ko(e){let t,r,n;function i(c,l){return c[1]?jo:$o}let o=i(e),u=o(e),s=e[2]&&Rr(e);return{c(){t=V("div"),r=V("div"),u.c(),n=ge(),s&&s.c(),Z(r,"class","ShowBalance")},m(c,l){Ee(c,t,l),L(t,r),u.m(r,null),L(t,n),s&&s.m(t,null),e[27](t)},p(c,l){o===(o=i(c))&&u?u.p(c,l):(u.d(1),u=o(c),u&&(u.c(),u.m(r,null))),c[2]?s?s.p(c,l):(s=Rr(c),s.c(),s.m(t,null)):s&&(s.d(1),s=null)},i:le,o:le,d(c){c&&me(t),u.d(),s&&s.d(),e[27](null)}}}function Vo(e,t,r){let n;yn(e,Lo,b=>r(5,n=b));let{userid:i=""}=t,{session:o=""}=t,{endpoint:u=""}=t,{lang:s="en"}=t,{clientstyling:c=""}=t,{clientstylingurl:l=""}=t,{translationurl:f=""}=t,{customlocaleidentifier:g=""}=t,{gmversion:p="gm16"}=t,{displaybalanceoption:y="All"}=t,{totalcalculationmode:E="totalCashAmount"}=t,{currencyseparator:N=""}=t,{currencydecimal:C=""}=t,{currencyprecision:G=""}=t,{mbsource:X}=t,T,S,F,M=!1,te="",he=[],we,ce=!1;const v={},ae=["totalCashAmount","totalRealAmount"],at=()=>{fetch(f).then(b=>b.json()).then(b=>Object.keys(b).forEach(R=>Br(R,b[R]))).catch(b=>console.log(b))};Object.keys(Sr).forEach(b=>Br(b,Sr[b]));const Le=()=>{if(g.includes(s))return g},st=b=>g?new Intl.NumberFormat(Le(),{useGrouping:!0}).format(b):N&&C?de(b,{separator:N,decimal:C,symbol:"",precision:parseInt(G||"2",10)}).format():de(b,{separator:".",decimal:",",symbol:"",precision:parseInt(G||"2",10)}).format(),Ze=()=>It(this,null,function*(){var R,P,a;r(1,T=!0);const b=new URL(`${u}/v1/player/${i}/account`);try{const d=yield fetch(b,{method:"GET",headers:{"X-SessionID":o}}),m=yield d.json();if(d.ok)he=m.items,r(3,te=(R=he.find(h=>h.displayName==="Casino"))==null?void 0:R.currency),r(4,v.Total=[{amount:m.totalAmount[te]}],v),r(4,v.Real=[{amount:(P=he.find(h=>h.displayName==="Casino"))==null?void 0:P.balanceAmount}],v),r(4,v.Bonus=[{amount:(a=he.find(h=>h.displayName==="UBS"))==null?void 0:a.balanceAmount}],v);else throw new Error("Failed to fetch balance data !")}catch(d){console.log("Balance error: ",d)}finally{r(1,T=!1)}}),be=()=>{r(1,T=!0);const b=new URL(`${u}/v2/player/${i}/balance`),R=new Headers;R.append("X-SessionID",o),fetch(b,{method:"GET",headers:R}).then(a=>a.json()).then(a=>{a[E]||r(8,E=ae[0]);const d=a.items.find(h=>h.type==="Real"&&h.walletAccountType==="Ordinary");if(r(3,te=d.currency),ce=!!d.productType,r(4,v.Total=[{amount:0}],v),r(4,v.Real=[],v),r(4,v.Bonus=[],v),r(4,v.Credit=[],v),!ce){we={lastOrdinaryAfterAmount:0,showCreditLineAfterAmount:!1},r(4,v.Total[0].amount=a[E][te],v);for(const h of a.items)switch(h.type){case"Bonus":v.Bonus.length===0?v.Bonus.push({amount:h.amount}):r(4,v.Bonus[0].amount+=h.amount,v);break;case"Real":if(h.creditLine&&v.Credit.length===0&&v.Credit.push({amount:h.creditLine}),E==="totalRealAmount")continue;v.Real.length===0?v.Real.push({amount:h.amount}):r(4,v.Real[0].amount+=h.amount,v);break}for(const[h,_]of Object.entries(v))_.length<1&&delete v[h];r(1,T=!1);return}we={Casino:{lastOrdinaryAfterAmount:0,showCreditLineAfterAmount:!1},Sports:{lastOrdinaryAfterAmount:0,showCreditLineAfterAmount:!1}};let m=a.items;y&&y!=="All"&&(m=a.items.filter(h=>h.productType===y));for(const h of m){let _;switch(h.type){case"Bonus":_=v.Bonus.findIndex(x=>x.productType===h.productType),_>0?r(4,v.Bonus[_].amount+=h.amount,v):v.Bonus.push({amount:h.amount,productType:h.productType});break;case"Real":h.creditLine&&v.Credit.push({amount:h.creditLine,productType:h.productType}),_=v.Real.findIndex(x=>x.productType===h.productType),_>0?r(4,v.Real[_].amount+=h.amount,v):v.Real.push({amount:h.amount,productType:h.productType});break}}Ne();for(const[h,_]of Object.entries(v))_.length<1&&delete v[h];r(1,T=!1)}).catch(a=>{throw r(1,T=!1),new Error("Failed to fetch balance data !")})},ye=()=>{if(F&&F.close(),o.length<1)return;let b,R;switch(p){case"gm16":b=new URL(`${u}/v2/player/${i}/information/updates`),R=d=>ut(d);break;case"gmcore":b=new URL(`${u}/v1/player/${i}/balance/updates`),R=d=>qe(d);break}const P={accept:"text/event-stream","X-SessionId":o},a=new Mo.EventSourcePolyfill(b,{headers:P});F=a,a.addEventListener("message",R)},Ae=b=>{let R;try{R=JSON.parse(b)}catch(P){console.log("Balance stream failed: ",P);return}return R},qe=b=>{var d,m;const R=Ae(b.data);if(!R){ye();return}let P="0";const a=R.balanceChange;he=he.map(h=>(a&&a[h.id]&&(h=Pt(Mt({},h),{balanceAmount:a[h.id].afterAmount})),P=(parseFloat(h==null?void 0:h.balanceAmount)+parseFloat(P)).toString(),h)),r(4,v.Real=[{amount:(d=he[0])==null?void 0:d.balanceAmount}],v),r(4,v.Bonus=[{amount:(m=he[1])==null?void 0:m.balanceAmount}],v),r(4,v.Total=[{amount:Number(P)}],v)},se=(b,R,P)=>{let a=null;switch(P.walletAccountType){case"Ordinary":P.afterAmount!==P.affectedAmount&&(R.lastOrdinaryAfterAmount=P.afterAmount,R.showCreditLineAfterAmount||(a=P.afterAmount));break;case"CreditLine":P.afterAmount!==0?(a=P.afterAmount,R.showCreditLineAfterAmount=!0):(a=R.lastOrdinaryAfterAmount,R.showCreditLineAfterAmount=!1);break;default:a=P.afterAmount}return a===null?b:a},Ne=()=>{switch(E){case"totalCashAmount":let b=0;for(const P of["Real","Bonus"])for(const a of v[P])b+=Math.max(a.amount,0);r(4,v.Total[0].amount=b,v);break;case"totalRealAmount":if(!ce)return;let R=0;for(const P of v.Real)R+=P.amount;r(4,v.Total[0].amount=R,v)}},ut=b=>{const R=Ae(b.data);if(!R){ye();return}if(R.type!=="BALANCE_UPDATE_V2")return;const P=R.body.balanceChange;for(const[a,d]of Object.entries(P))if(E==="totalRealAmount"&&a==="Real"&&!ce&&r(4,v.Total[0].amount=se(v.Total[0].amount,we,d),v),!!v[a])for(const m of v[a]){if(!ce){m.amount=a==="Real"?se(m.amount,we,d):d.afterAmount;continue}d.productType===m.productType&&(m.amount=a==="Real"?se(m.amount,we[m.productType],d):d.afterAmount)}Ne()},lt=()=>{r(2,M=!1),window.postMessage({type:"GoToDeposit"},window.location.href),typeof gtag=="function"&&gtag("event","GoToDeposit",{context:"PlayerAccountBalanceModal"})},Ct=()=>{ae.includes(E)||(console.error(`Unsupported value ('${E}') for totalcalculationmode parameter. Only the following values are supported ${ae}. Using default value ('${ae[0]}').`),r(8,E=ae[0]))},Ht=()=>{switch(No(s),Ct(),p){case"gmcore":Ze();break;case"gm16":be();break;default:throw Error(`Invalid apiversion attribute: ${p}`)}},ht=b=>b.data&&b.data.type==="LogoutSuccessfull"&&F.close();wn(()=>(window.addEventListener("message",ht,!1),()=>{window.removeEventListener("message",ht),F&&F.close()}));const Qe=()=>r(2,M=!0),Je=()=>r(2,M=!1),Ce=()=>lt(),re=()=>r(2,M=!1);function Ot(b){Vt[b?"unshift":"push"](()=>{S=b,r(0,S)})}return e.$$set=b=>{"userid"in b&&r(9,i=b.userid),"session"in b&&r(10,o=b.session),"endpoint"in b&&r(11,u=b.endpoint),"lang"in b&&r(12,s=b.lang),"clientstyling"in b&&r(13,c=b.clientstyling),"clientstylingurl"in b&&r(14,l=b.clientstylingurl),"translationurl"in b&&r(15,f=b.translationurl),"customlocaleidentifier"in b&&r(16,g=b.customlocaleidentifier),"gmversion"in b&&r(17,p=b.gmversion),"displaybalanceoption"in b&&r(18,y=b.displaybalanceoption),"totalcalculationmode"in b&&r(8,E=b.totalcalculationmode),"currencyseparator"in b&&r(19,N=b.currencyseparator),"currencydecimal"in b&&r(20,C=b.currencydecimal),"currencyprecision"in b&&r(21,G=b.currencyprecision),"mbsource"in b&&r(22,X=b.mbsource)},e.$$.update=()=>{e.$$.dirty[0]&4096&&s&&Le(),e.$$.dirty[0]&400896&&u&&i&&o&&s&&p&&y&&Ht(),e.$$.dirty[0]&134656&&u&&i&&o&&p&&ye(),e.$$.dirty[0]&8193&&c&&S&&Gn(S,c),e.$$.dirty[0]&16385&&l&&S&&$n(S,l),e.$$.dirty[0]&4194305&&S&&jn(S,`${X}.Style`),e.$$.dirty[0]&32768&&f&&at()},[S,T,M,te,v,n,st,lt,E,i,o,u,s,c,l,f,g,p,y,N,C,G,X,Qe,Je,Ce,re,Ot]}class ln extends Fn{constructor(t){super(),In(this,t,Vo,ko,Nr,{userid:9,session:10,endpoint:11,lang:12,clientstyling:13,clientstylingurl:14,translationurl:15,customlocaleidentifier:16,gmversion:17,displaybalanceoption:18,totalcalculationmode:8,currencyseparator:19,currencydecimal:20,currencyprecision:21,mbsource:22},Go,[-1,-1])}get userid(){return this.$$.ctx[9]}set userid(t){this.$$set({userid:t}),Q()}get session(){return this.$$.ctx[10]}set session(t){this.$$set({session:t}),Q()}get endpoint(){return this.$$.ctx[11]}set endpoint(t){this.$$set({endpoint:t}),Q()}get lang(){return this.$$.ctx[12]}set lang(t){this.$$set({lang:t}),Q()}get clientstyling(){return this.$$.ctx[13]}set clientstyling(t){this.$$set({clientstyling:t}),Q()}get clientstylingurl(){return this.$$.ctx[14]}set clientstylingurl(t){this.$$set({clientstylingurl:t}),Q()}get translationurl(){return this.$$.ctx[15]}set translationurl(t){this.$$set({translationurl:t}),Q()}get customlocaleidentifier(){return this.$$.ctx[16]}set customlocaleidentifier(t){this.$$set({customlocaleidentifier:t}),Q()}get gmversion(){return this.$$.ctx[17]}set gmversion(t){this.$$set({gmversion:t}),Q()}get displaybalanceoption(){return this.$$.ctx[18]}set displaybalanceoption(t){this.$$set({displaybalanceoption:t}),Q()}get totalcalculationmode(){return this.$$.ctx[8]}set totalcalculationmode(t){this.$$set({totalcalculationmode:t}),Q()}get currencyseparator(){return this.$$.ctx[19]}set currencyseparator(t){this.$$set({currencyseparator:t}),Q()}get currencydecimal(){return this.$$.ctx[20]}set currencydecimal(t){this.$$set({currencydecimal:t}),Q()}get currencyprecision(){return this.$$.ctx[21]}set currencyprecision(t){this.$$set({currencyprecision:t}),Q()}get mbsource(){return this.$$.ctx[22]}set mbsource(t){this.$$set({mbsource:t}),Q()}}Dn(ln,{userid:{},session:{},endpoint:{},lang:{},clientstyling:{},clientstylingurl:{},translationurl:{},customlocaleidentifier:{},gmversion:{},displaybalanceoption:{},totalcalculationmode:{},currencyseparator:{},currencydecimal:{},currencyprecision:{},mbsource:{}},[],[],!0);exports.default=ln;
@@ -1 +1 @@
1
- "use strict";if(typeof window!="undefined"){let n=function(t){return function(...s){try{return t.apply(this,s)}catch(e){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"))return!1;throw e}}};customElements.define=n(customElements.define),Promise.resolve().then(()=>require("../components/PlayerAccountBalanceModal-B2b7vvuX.cjs")).then(({default:t})=>{!customElements.get("player-account-balance-modal")&&customElements.define("player-account-balance-modal",t.element)})}
1
+ "use strict";if(typeof window!="undefined"){let n=function(t){return function(...s){try{return t.apply(this,s)}catch(e){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"))return!1;throw e}}};customElements.define=n(customElements.define),Promise.resolve().then(()=>require("../components/PlayerAccountBalanceModal-RqhX6_CL.cjs")).then(({default:t})=>{!customElements.get("player-account-balance-modal")&&customElements.define("player-account-balance-modal",t.element)})}
@@ -10,7 +10,7 @@ if (typeof window != "undefined") {
10
10
  }
11
11
  };
12
12
  };
13
- customElements.define = n(customElements.define), import("../components/PlayerAccountBalanceModal-DL163yxm.js").then(({ default: t }) => {
13
+ customElements.define = n(customElements.define), import("../components/PlayerAccountBalanceModal-Bgb65ZsG.js").then(({ default: t }) => {
14
14
  !customElements.get("player-account-balance-modal") && customElements.define("player-account-balance-modal", t.element);
15
15
  });
16
16
  }
@@ -1,4 +1,4 @@
1
- import { P as a } from "../components/PlayerAccountBalanceModal-eNv28Hxd.js";
1
+ import { P as a } from "../components/PlayerAccountBalanceModal-BkmyvIEC.js";
2
2
  function s(t) {
3
3
  return function(...n) {
4
4
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/player-account-balance-modal",
3
- "version": "1.63.2",
3
+ "version": "1.64.0",
4
4
  "type": "module",
5
5
  "main": "es2015/player-account-balance-modal.cjs",
6
6
  "module": "esnext/player-account-balance-modal.js",