@everymatrix/casino-header-controller 1.69.0 → 1.69.3
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.
- package/components/{CasinoHeaderController-3BLmbuuT.js → CasinoHeaderController-B1x--_Oq.js} +1 -1
- package/components/{CasinoHeaderController-CP9C9tGa.cjs → CasinoHeaderController-BRa3odIv.cjs} +1 -1
- package/components/{CasinoHeaderController-DSTFZ8Kb.js → CasinoHeaderController-BfAseLS8.js} +1 -1
- package/es2015/casino-header-controller.cjs +1 -1
- package/es2015/casino-header-controller.js +1 -1
- package/esnext/casino-header-controller.js +1 -1
- package/package.json +1 -1
- package/stencil/{gamification-dropdown-8eb8a896-BqA7JEtY.cjs → gamification-dropdown-343647b2-B50uewij.cjs} +1 -1
- package/stencil/{gamification-dropdown-8eb8a896-4sKWcJtH.js → gamification-dropdown-343647b2-BtKUznL8.js} +8 -5
- package/stencil/{gamification-dropdown-8eb8a896-BP2u_HU7.js → gamification-dropdown-343647b2-DuhB4qAC.js} +6 -3
- package/stencil/gamification-dropdown-BXoXmCVj.js +25 -0
- package/stencil/gamification-dropdown-BgQs3qHL.cjs +1 -0
- package/stencil/gamification-dropdown-CHDfyBlq.js +7 -0
- package/stencil/gamification-dropdown_4-BCIlNfU2.cjs +192 -0
- package/stencil/{gamification-dropdown_4-B0ji-X9m.js → gamification-dropdown_4-BMYGUc6f.js} +73 -64
- package/stencil/{gamification-dropdown_4-BKbYm0F4.js → gamification-dropdown_4-Bwo0uyQb.js} +75 -66
- package/stencil/{index-71b1bdfa-BZYfjyyu.js → index-71b1bdfa-Br04T1ks.js} +4 -4
- package/stencil/{index-71b1bdfa-BMawsq6K.js → index-71b1bdfa-CqHhm_K7.js} +4 -4
- package/stencil/{index-71b1bdfa-DqjJO9rg.cjs → index-71b1bdfa-DEOwV3WT.cjs} +1 -1
- package/stencil/player-elevate-card-CkeeX0Fc.cjs +64 -0
- package/stencil/{player-elevate-card-DYry-kuc.js → player-elevate-card-Csrn1cq3.js} +8 -8
- package/stencil/{player-elevate-card-BupHMU0C.js → player-elevate-card-Cyj2vrTT.js} +8 -8
- package/stencil/{player-elevate-card-items-5071deed-C5xbU-Hh.js → player-elevate-card-items-08c6fbd8-DvNcpL9M.js} +149 -148
- package/stencil/{player-elevate-card-items-5071deed-BUtyLOrj.js → player-elevate-card-items-08c6fbd8-GG7yo-HJ.js} +149 -148
- package/stencil/{player-elevate-card-items-5071deed-BXQrJn1S.cjs → player-elevate-card-items-08c6fbd8-swAJgFA-.cjs} +2 -2
- package/stencil/{player-elevate-pointcard-B2cW4cvo.js → player-elevate-pointcard-CDT1deRp.js} +6 -6
- package/stencil/{player-elevate-pointcard-BAOz9vT6.js → player-elevate-pointcard-CQ618787.js} +6 -6
- package/stencil/player-elevate-pointcard-D962b07c.cjs +1 -0
- package/stencil/{player-rakeback-card-DqDgl21L.js → player-rakeback-card-D-wGOAvr.js} +3 -3
- package/stencil/player-rakeback-card-DI8fIhnW.cjs +1 -0
- package/stencil/{player-rakeback-card-CmhmooCE.js → player-rakeback-card-r5qjxDTk.js} +3 -3
- package/stencil/gamification-dropdown-Bk5q3WKD.js +0 -25
- package/stencil/gamification-dropdown-DnZ5a8p_.cjs +0 -1
- package/stencil/gamification-dropdown-MVnEAzQz.js +0 -7
- package/stencil/gamification-dropdown_4-CFeI4Vdg.cjs +0 -192
- package/stencil/player-elevate-card-BMQXFNhf.cjs +0 -64
- package/stencil/player-elevate-pointcard-XJ0TKbja.cjs +0 -1
- package/stencil/player-rakeback-card-BE5M20hP.cjs +0 -1
@@ -1,192 +0,0 @@
|
|
1
|
-
"use strict";var x=(e,t,a)=>new Promise((n,r)=>{var l=c=>{try{s(a.next(c))}catch(h){r(h)}},d=c=>{try{s(a.throw(c))}catch(h){r(h)}},s=c=>c.done?n(c.value):Promise.resolve(c.value).then(l,d);s((a=a.apply(e,t)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("./gamification-dropdown-8eb8a896-BqA7JEtY.cjs"),i=require("./index-71b1bdfa-DqjJO9rg.cjs"),y=require("./locale-B_6Rn5-v.cjs"),o=require("./player-elevate-card-items-5071deed-BXQrJn1S.cjs"),M=(e,t)=>new Promise(a=>{fetch(e).then(n=>n.json()).then(n=>{Object.keys(n).forEach(r=>{t[r]=t[r]||t.en,Object.keys(n[r]).forEach(l=>{t.en[l]&&(t[r][l]=t[r][l]||t.en[l],typeof n[r][l]=="object"?Object.keys(n[r][l]).forEach(d=>{t[r][l][d]=n[r][l][d]}):t[r][l]=n[r][l])})}),a(!0)})}),R=":host{display:block}",O=R,L=class{constructor(e){i.registerInstance(this,e),this.stylingAppends=!1,this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.el.prepend(t)},this.setClientStylingURL=()=>{let t=new URL(this.clientStylingUrl),a=document.createElement("style");fetch(t.href).then(n=>n.text()).then(n=>{a.innerHTML=n,setTimeout(()=>{this.el.prepend(a)},1)}).catch(n=>{console.log("error ",n)})},this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.targetTranslations=void 0}componentDidRender(){this.stylingAppends||(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.stylingAppends=!0)}componentWillLoad(){return x(this,null,function*(){const e=[];if(this.translationUrl){const t=M(this.translationUrl,this.targetTranslations);e.push(t)}return yield Promise.all(e)})}render(){return i.h("div",{key:"4d3414408c7662f88331dbe655966237f74d6958",class:"StyleShell"},i.h("slot",{key:"1d004644d84602c4314bdf5dfc26b55b160f57df",name:"mainContent"}))}get el(){return i.getElement(this)}};L.style=O;function b(e){o.requiredArgs(1,arguments);var t=o.toDate(e);return t.setHours(0,0,0,0),t}var $=864e5;function q(e,t){o.requiredArgs(2,arguments);var a=b(e),n=b(t),r=a.getTime()-o.getTimezoneOffsetInMilliseconds(a),l=n.getTime()-o.getTimezoneOffsetInMilliseconds(n);return Math.round((r-l)/$)}var N=6e4,W=36e5;function E(e,t){return o.requiredArgs(2,arguments),o.toDate(e).getTime()-o.toDate(t).getTime()}var m={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}},z="trunc";function w(e){return e?m[e]:m[z]}function U(e,t,a){o.requiredArgs(2,arguments);var n=E(e,t)/W;return w(a==null?void 0:a.roundingMethod)(n)}function F(e,t,a){o.requiredArgs(2,arguments);var n=E(e,t)/N;return w(a==null?void 0:a.roundingMethod)(n)}function j(e,t){o.requiredArgs(2,arguments);var a=o.toDate(e),n=o.toDate(t);return a.getTime()<n.getTime()}function H(e,t){const a=e.querySelector("#total_level"),n=17,r=6.5,l=a.getBBox().width,d=t>1?1:t,s=d*l-n<0?0:d*l-n,c=e.querySelector("#current_level"),h=e.querySelector("#filter_current_level"),p=e.querySelector("#circle_current_level");a.setAttribute("viewbox",`0 0 ${s} 28`),c.setAttribute("width",`${s}`),p.setAttribute("cx",`${s<r?r:s}`),h.setAttribute("x",`${s-8}`);const g=e.querySelector("#lock"),S=e.querySelector("#filter_heart_ball"),C=e.querySelector("#filter_ball"),k=e.querySelector("#filter_heart"),T=e.querySelector("#filter_lock"),u=e.querySelector("#paint0_linear_ball"),f=e.querySelector("#paint1_linear_lock"),A=e.querySelector("#lock_box"),D=e.querySelector("#heart_box"),_=10,v=l-_;g.setAttribute("cx",`${v}`),f.setAttribute("x1",`${v}`),f.setAttribute("x2",`${v}`),u.setAttribute("x1",`${v-6}`),u.setAttribute("x2",`${v-6+11.2}`),T.setAttribute("x",`${v-6}`),k.setAttribute("x",`${v-6-2}`),C.setAttribute("x",`${v-6-2-2}`),S.setAttribute("x",`${v-6-2-2-4}`),A.setAttribute("x",`${v-6}`),D.setAttribute("x",`${v-6}`),a.parentElement.style.opacity="1"}const G=`:host {
|
2
|
-
display: block;
|
3
|
-
width: 360px;
|
4
|
-
height: 230px;
|
5
|
-
}
|
6
|
-
|
7
|
-
.ElevateCardWrapper {
|
8
|
-
contain: layout inline-size;
|
9
|
-
width: 100%;
|
10
|
-
height: fit-content;
|
11
|
-
min-height: 218px;
|
12
|
-
}
|
13
|
-
|
14
|
-
.Outer {
|
15
|
-
container-type: inline-size;
|
16
|
-
font-size: 12px;
|
17
|
-
background-size: cover;
|
18
|
-
background-repeat: no-repeat;
|
19
|
-
line-height: initial;
|
20
|
-
width: 100%;
|
21
|
-
height: 100%;
|
22
|
-
}
|
23
|
-
|
24
|
-
.Dark {
|
25
|
-
color: var(--emw--color-gray150, #efefef);
|
26
|
-
}
|
27
|
-
|
28
|
-
.Light {
|
29
|
-
color: var(--emw--color-black, #0e0e0e);
|
30
|
-
}
|
31
|
-
|
32
|
-
@container (min-width: 381px) {
|
33
|
-
.Outer {
|
34
|
-
background-size: cover;
|
35
|
-
}
|
36
|
-
.Outer .OuterCover {
|
37
|
-
min-height: 190px;
|
38
|
-
}
|
39
|
-
}
|
40
|
-
@container (min-width: 260px) {
|
41
|
-
.Outer {
|
42
|
-
background-size: contain;
|
43
|
-
}
|
44
|
-
}
|
45
|
-
.OuterCover {
|
46
|
-
width: 100%;
|
47
|
-
height: 100%;
|
48
|
-
content: "";
|
49
|
-
background-repeat: no-repeat;
|
50
|
-
background-size: cover;
|
51
|
-
border-radius: 15px;
|
52
|
-
}
|
53
|
-
|
54
|
-
.Inner {
|
55
|
-
display: flex;
|
56
|
-
flex-direction: column;
|
57
|
-
min-height: 158px;
|
58
|
-
}
|
59
|
-
.Inner .Content {
|
60
|
-
padding: 15px;
|
61
|
-
flex-wrap: wrap;
|
62
|
-
gap: 8px;
|
63
|
-
}
|
64
|
-
.Inner .Row {
|
65
|
-
display: flex;
|
66
|
-
flex-direction: row;
|
67
|
-
}
|
68
|
-
.Inner .CardCell {
|
69
|
-
display: flex;
|
70
|
-
}
|
71
|
-
.Inner .LevelProgress svg {
|
72
|
-
transition: opacity 0.4s;
|
73
|
-
}
|
74
|
-
.Inner .LevelInfo {
|
75
|
-
display: flex;
|
76
|
-
flex-direction: column;
|
77
|
-
}
|
78
|
-
.Inner .LevelInfo .ElevateLevel .LevelName {
|
79
|
-
height: 28px;
|
80
|
-
border-radius: 5px;
|
81
|
-
line-height: 28px;
|
82
|
-
overflow: hidden;
|
83
|
-
text-overflow: ellipsis;
|
84
|
-
white-space: nowrap;
|
85
|
-
}
|
86
|
-
.Inner .LevelInfo.Level0 .ElevateLevel .LevelName {
|
87
|
-
box-shadow: -2px -2px 7px 0px var(--emw--elevate-color-level0button-shadow, rgba(191, 84, 6, 0.75));
|
88
|
-
background: linear-gradient(180deg, var(--emw--elevate-color-level0-bg0, #E2792C) 0%, var(--emw--elevate-color-level0-bg1, rgba(242, 151, 99, 0)) 100%);
|
89
|
-
}
|
90
|
-
.Inner .LevelInfo.Level1 .ElevateLevel .LevelName {
|
91
|
-
box-shadow: -2px -2px 7px 0px var(--emw--elevate-color-level1button-shadow, rgba(151, 151, 151, 0.75));
|
92
|
-
background: linear-gradient(180deg, var(--emw--elevate-color-level1-bg0, #BEBFED) 0%, var(--emw--elevate-color-level1-bg1, rgba(216, 217, 233, 0)) 100%);
|
93
|
-
}
|
94
|
-
.Inner .LevelInfo.Level2 .ElevateLevel .LevelName {
|
95
|
-
box-shadow: -2px -2px 7px 0px var(--emw--elevate-color-level2button-shadow, rgba(191, 120, 6, 0.75));
|
96
|
-
background: linear-gradient(180deg, var(--emw--elevate-color-level2-bg0, #FCC410) 0%, var(--emw--elevate-color-level2-bg1, rgba(255, 189, 43, 0)) 100%);
|
97
|
-
}
|
98
|
-
.Inner .LevelInfo.Level3 .ElevateLevel .LevelName {
|
99
|
-
box-shadow: -2px -2px 7px 0px var(--emw--elevate-color-level3button-shadow, rgba(65, 6, 191, 0.75));
|
100
|
-
background: linear-gradient(180deg, var(--emw--elevate-color-level3-bg0, #B1A2DB) 0%, var(--emw--elevate-color-level3-bg1, rgba(203, 202, 245, 0)) 100%);
|
101
|
-
}
|
102
|
-
.Inner .LevelInfo.Level4 .ElevateLevel .LevelName {
|
103
|
-
box-shadow: -2px -2px 7px 0px var(--emw--elevate-color-level4button-shadow, rgba(65, 6, 191, 0.75));
|
104
|
-
background: linear-gradient(180deg, var(--emw--elevate-color-level4-bg0, #B1A2DB) 0%, var(--emw--elevate-color-level4-bg1, rgba(203, 202, 245, 0)) 100%);
|
105
|
-
}
|
106
|
-
.Inner .LevelInfo .ElevateLevel {
|
107
|
-
display: flex;
|
108
|
-
}
|
109
|
-
.Inner .LevelInfo {
|
110
|
-
flex: 1;
|
111
|
-
flex-grow: 1;
|
112
|
-
min-width: 150px;
|
113
|
-
}
|
114
|
-
.Inner .PlayerImg {
|
115
|
-
width: 29%;
|
116
|
-
margin: auto;
|
117
|
-
max-width: 100px;
|
118
|
-
min-width: 30px;
|
119
|
-
order: 0;
|
120
|
-
}
|
121
|
-
.Inner .PlayerAvatar {
|
122
|
-
max-width: 100px;
|
123
|
-
flex-basis: 100px;
|
124
|
-
height: auto;
|
125
|
-
margin: auto;
|
126
|
-
padding-top: 10px;
|
127
|
-
}
|
128
|
-
.Inner .PlayerAvatar .Avatar, .Inner .PlayerAvatar .Badge {
|
129
|
-
width: 100%;
|
130
|
-
height: 100%;
|
131
|
-
}
|
132
|
-
.Inner .PlayerAvatar .Avatar {
|
133
|
-
border-radius: 50%;
|
134
|
-
background-size: contain;
|
135
|
-
background-repeat: no-repeat;
|
136
|
-
}
|
137
|
-
.Inner .ElevateLevel .ExpirationDate {
|
138
|
-
max-width: 138px;
|
139
|
-
min-width: 118px;
|
140
|
-
}
|
141
|
-
.Inner .PlayerName, .Inner .RedeemButton, .Inner .ElevateLevel {
|
142
|
-
text-transform: capitalize;
|
143
|
-
width: 100%;
|
144
|
-
}
|
145
|
-
.Inner .PlayerName {
|
146
|
-
font-size: 16px;
|
147
|
-
}
|
148
|
-
.Inner .Row .PointsInfo {
|
149
|
-
display: table;
|
150
|
-
font-weight: 600;
|
151
|
-
}
|
152
|
-
.Inner .Row .Redeem {
|
153
|
-
justify-content: flex-end;
|
154
|
-
margin-left: auto;
|
155
|
-
}
|
156
|
-
.Inner .Row .Redeem:hover {
|
157
|
-
color: var(--emw--elevate-color-redeem-hover, #00ABA4);
|
158
|
-
cursor: pointer;
|
159
|
-
}
|
160
|
-
.Inner .Row .RedeemButton:hover span {
|
161
|
-
color: var(emfe-w-elevate-color-redeem-text-hover, #f1f1f1);
|
162
|
-
font-weight: bold;
|
163
|
-
}
|
164
|
-
.Inner .Row .RedeemButton {
|
165
|
-
width: 95px;
|
166
|
-
height: 35px;
|
167
|
-
display: flex;
|
168
|
-
align-items: center;
|
169
|
-
border-radius: var(--emw--border-radius-medium, 10px);
|
170
|
-
background: var(--emw--elevate-color-redeem-bg, linear-gradient(0deg, #26CC37, #26CC37)), linear-gradient(117.99deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.89%), linear-gradient(283.85deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.47%), linear-gradient(268.18deg, rgba(255, 255, 255, 0.6) -17.36%, rgba(239, 239, 239, 0) 15.78%);
|
171
|
-
box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.2509803922);
|
172
|
-
}
|
173
|
-
.Inner .Row .RedeemButton span {
|
174
|
-
color: var(--emw--color-white, #fff);
|
175
|
-
line-height: 18px;
|
176
|
-
font-size: 15px;
|
177
|
-
text-align: center;
|
178
|
-
width: 100%;
|
179
|
-
}
|
180
|
-
.Inner .Row .Points {
|
181
|
-
font-size: large;
|
182
|
-
vertical-align: middle;
|
183
|
-
}
|
184
|
-
.Inner .Row .Points .XP {
|
185
|
-
font-size: x-small;
|
186
|
-
}
|
187
|
-
.Inner .Row .ExpirationPoints {
|
188
|
-
font-size: small;
|
189
|
-
text-align: right;
|
190
|
-
font-weight: bold;
|
191
|
-
color: var(--emw--color-red, #9e595f);
|
192
|
-
}`,X=G,I=class{constructor(e){i.registerInstance(this,e),this.playerElevateLeveLoaded=i.createEvent(this,"playerElevateLeveLoaded"),this.params=void 0,this.playerElevateLevel=void 0,this.pointExpireString=void 0}handleWindowResizs(){this.initLevelProgressbar()}onParamsChanged(){this.loadElevateInfo()}redeemGiftButtonHandler(){this.loadElevateInfo()}onRedeemClick(){window.postMessage({type:"BEERedeemClicked"},window.location.href)}loadLevels(){let e=new URL(`${this.params.endpoint}/v1/elevate/levels?language=${this.params.language}`);return new Promise((t,a)=>fetch(e.href,{method:"GET"}).then(n=>n.json()).then(n=>{this.levels=n.data,t(!0)}).catch(n=>{a(n)}))}calcuatePointsToBeExpired(e,t){let a="";if(!e||!e.aboutToExpire||e.aboutToExpire.length==0||e.aboutToExpire[0].points<=0)return a;e.aboutToExpire.sort((c,h)=>j(new Date(c.expireTime),new Date(h.expireTime))?-1:1);const n=e.aboutToExpire[0],r=q(new Date(n.expireTime),new Date);let l=0,d=0,s=r===0?`${t}Day`:t;return r<=0&&(l=U(new Date(n.expireTime),new Date,{roundingMethod:"floor"}),s=l>1?`${t}Hours`:`${t}Hour`,l<=0&&(d=F(new Date(n.expireTime),new Date,{roundingMethod:"floor"}),s=d>1?`${t}Minutes`:`${t}Minute`)),a=y.translateWithParams(s,{expirationPoints:n.points,expireDay:Math.max(r,l,d),lang:this.params.language}),a}loadPlayerLevelInfo(){let e=new URL(`${this.params.endpoint}/v1/elevate/playerInfo?language=${this.params.language}`);return new Promise((t,a)=>fetch(e.href,{method:"GET",headers:{"X-Sessionid":this.params.session,"Content-Type":"application/json"}}).then(n=>n.json()).then(n=>{var r,l,d;if(!n.success){console.error("Exception when fetch user elevateinfo, ",n.errorCode,n.errorMessage),a(!0);return}let s=n.data;this.playerElevateLevel=s.level,this.playerElevateLevel.name=this.playerElevateLevel.presentation.displayName||this.playerElevateLevel.name,this.playerElevateLevel.spendablePoints=((r=s.spendableWallet)===null||r===void 0?void 0:r.total.points)||0,this.playerElevateLeveLoaded.emit({elevateLevel:this.playerElevateLevel});const c=(l=n.data.spendableWallet)===null||l===void 0?void 0:l.total,h=(d=n.data.loyaltyWallet)===null||d===void 0?void 0:d.total;this.playerElevateLeveLoaded.emit({elevateLevelWalletTotal:c,loyaltyWalletTotal:h});let p=this.calcuatePointsToBeExpired(c,"coinsToBeExpired"),g=this.calcuatePointsToBeExpired(h,"pointsToBeExpired");(p||g)&&this.playerElevateLeveLoaded.emit({pointExpireString:p,xpExpireString:g}),t(this.playerElevateLevel)}).catch(n=>{console.log("error ",n),a(!0)}))}setLoyaltyProgress(e){H(this.loyaltyProgressEle,e)}initLevelProgressbar(){setTimeout(()=>{this.loyaltyProgressEle=this.elevateCardRef.parentElement.querySelector("#LevelProgress"),this.loyaltyProgressEle&&(this.setLoyaltyProgress(this.playerElevateLevel.nextLevel?this.playerElevateLevel.loyaltyPoints/this.playerElevateLevel.nextLevel.entryPoints:1),this.params.playerElevateLevel=this.playerElevateLevel)},80)}componentDidRender(){this.initLevelProgressbar()}loadElevateInfo(){if(!this.params.endpoint||!this.params.session)return;const e=[];e.push(this.loadPlayerLevelInfo()),this.params.calculateLevelFlag&&e.push(this.loadLevels()),Promise.all(e).then(t=>{if(console.log("elevate-init",t),this.initLevelProgressbar(),!this.levels)return;this.levels.sort((r,l)=>r.firstEntryPoints>l.firstEntryPoints?1:-1);const a=this.playerElevateLevel.loyaltyPoints;let n=0;this.levels.forEach((r,l)=>{a>r.firstEntryPoints&&(n=l)}),this.playerElevateLeveLoaded.emit({calculatedLevelFlag:n})})}componentWillLoad(){this.loadElevateInfo()}get elevateCardRef(){return i.getElement(this)}static get watchers(){return{params:["onParamsChanged"]}}};I.style=X;const Y=":host{display:block}@media screen and (min-width: 501px){.LoyaltyCard .Inner .LevelInfo .ElevateLevel{flex-wrap:nowrap}.LoyaltyCard .Inner .LevelInfo .ElevateLevel .ExpirationDate{padding-top:11px;margin-left:5px}}@media screen and (max-width: 500px){.LoyaltyCard .Inner .LevelInfo .ElevateLevel{flex-wrap:wrap}.LoyaltyCard .Inner .LevelInfo .ElevateLevel .ExpirationDate{padding-top:0px;margin-left:0px}}.LoyaltyCard .Inner .LevelProgress{margin-left:0px}.LoyaltyCard .Inner .Row .PointsInfo.ExpirationPoints{text-align:left;color:var(--emw--color-red-50, red)}.LoyaltyCard .Inner .PlayerAvatar .Avatar{display:none}.LoyaltyCard .Inner .PlayerAvatar .Badge{border-radius:50%;background-size:contain;width:100%;height:100%}.LoyaltyCard .Inner .LevelInfo .ElevateLevel{display:flex;flex:1;align-items:center}.LoyaltyCard .Inner .LevelInfo .ElevateLevel .ExpirationDate{position:relative;padding-left:5px}.LoyaltyCard .Inner .LevelInfo .ElevateLevel .ExpirationDate .ExpireTime{margin-left:5px}.LoyaltyCard .Inner .LevelInfo .ElevateLevel .LevelName{padding-left:0;font-size:var(--emw--elevate-fontsize-2xlarge, 21px);position:relative;width:auto;color:var(--emw--elevate-color-levelname, #FFBD2B);font-weight:bold}.LoyaltyCard .PointsRange{display:flex;justify-content:space-between}.LoyaltyCard .PointsRange .PointsInfo{width:auto}.LoyaltyCard .NextLevelTip{text-align:right;font-size:11px;color:var(--emw--color-black, #000);opacity:0.8;font-weight:bold}",J=Y,P=class{constructor(e){i.registerInstance(this,e),this.endpoint=void 0,this.theme="Dark",this.session=void 0,this.playerAvatarUrl=void 0,this.language="en",this.playerName=void 0,this.dateFormat="yyyy-MM-dd",this.mbSource=void 0,this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.pointExpireString=void 0,this.playerElevateLevel=void 0,this.elevateWalletTotal=void 0}onSessionOrEndpointChange(){this.paramProxy=Object.assign(Object.assign({},this.paramProxy),{session:this.session,endpoint:this.endpoint,language:this.language})}playerElevateLeveLoadedHandler(e){e.detail&&(e.detail.elevateLevelWalletTotal&&(this.elevateWalletTotal=e.detail.elevateLevelWalletTotal),e.detail.elevateLevel&&(this.playerElevateLevel=e.detail.elevateLevel),e.detail.pointExpireString&&(this.pointExpireString=e.detail.xpExpireString))}onRedeemClick(){window.postMessage({type:"BEERedeemClicked"},window.location.href)}componentWillLoad(){this.paramProxy={endpoint:this.endpoint,session:this.session,language:this.language}}getNextLevelPoints(){var e,t;return!((e=this.playerElevateLevel)===null||e===void 0)&&e.nextLevel?(t=this.playerElevateLevel)===null||t===void 0?void 0:t.nextLevel.entryPoints:-1}getNextLevelTips(){var e;let t=(e=this.playerElevateLevel)===null||e===void 0?void 0:e.nextLevel;if(this.playerElevateLevel&&t){const a=(t.entryPoints-this.playerElevateLevel.loyaltyPoints).toFixed(2);return y.translateWithParams("tipsForNextLevel",{pointsToReach:a,levelName:t.name,lang:this.language})}return""}render(){const e=i.getAssetPath("../static/card-ground.svg"),t=i.getAssetPath("../static/card-ground-over.svg");return i.h("div",{key:"39295a651da66747a20554699bba5f96b8ad5c35",class:`ElevateCardWrapper ${this.theme}`},i.h("div",{key:"78c34fe054fc2459f8af3354116cd21a68ce01be",class:"LoyaltyCard Outer",style:{backgroundImage:`url(${e}`}},i.h("general-styling-wrapper",{key:"be6efc6da4c3ccf4cc3ece8ecc73561bae75aa20",clientStyling:this.clientStyling,clientStylingUrl:this.clientStylingUrl,targetTranslations:y.TRANSLATIONS,translationUrl:this.translationUrl}),i.h("player-elevate-card-data",{key:"b53e4b59d4ee55a2f567efa09afab3d72969e6e4",params:this.paramProxy}),i.h("div",{key:"1f3e504440bab2df3a181058fad7149c85c48c14",class:"OuterCover Inner",style:{backgroundImage:`url(${t}`}},i.h("div",{key:"a07c6cd95770dc1bfd3da78b1c7cc8e1367321b1",class:"Content Row"},this.playerElevateLevel&&i.h(i.Fragment,{key:"5c104f5ba1a018219c6ed5f6e50af99b035a0344"},i.h("div",{key:"bd94591e6ab9298ab7c769fa48efaf314dc1a63b",class:"PlayerImg"},i.h(o.PlayerAvatar,{key:"928849ce86d8c7a483eba7850efc83f8149bae43",onlyBadge:!0,loyaltyIconUrl:this.playerElevateLevel.presentation.asset})),i.h("div",{key:"37192c9b8502eb3c7d93914369df2d784c17e9f7",class:`LevelInfo ${this.playerElevateLevel.name}`},i.h(o.PlayerElevateLoyaltyLevel,{key:"2d1df152fa288291128259c3950ff84e7cb6d8f2",hideInfo:!0,level:this.playerElevateLevel.name,expireTime:this.playerElevateLevel.expireTime,dateFormat:this.dateFormat,language:this.language}),i.h("div",{key:"798167bf5a4525623008954bd91c241fb1fe6f59",class:"PointsRange"},i.h(o.PlayerPoints,{key:"cb88a77677200b0b459900c34781857933e15c26",loyaltyPoints:this.playerElevateLevel.loyaltyPoints,language:this.language}),i.h(o.PlayerPoints,{key:"c7958718ca7b423842c7f88808ab69246388b75c",loyaltyPoints:this.getNextLevelPoints(),language:this.language})),i.h(o.PlayerLoyaltyProcess,{key:"e66ef489cbaa28ac60019daa1eba0b0f04309181"}),i.h("div",{key:"e6ca3ffc781b37bc92be8a264ae44dcbc01d9024",class:"NextLevelTip"},this.getNextLevelTips()),this.pointExpireString&&i.h("div",{key:"9538973ab5c1d4bdd33f4d532f7041f94a1cb2d7",class:"PointsInfo ExpirationPoints"},this.pointExpireString," ")))))))}static get watchers(){return{session:["onSessionOrEndpointChange"],endpoint:["onSessionOrEndpointChange"],language:["onSessionOrEndpointChange"]}}};P.style=J;exports.gamification_dropdown=B.GamificationDropdown;exports.general_styling_wrapper=L;exports.player_elevate_card_data=I;exports.player_elevate_loyaltycard=P;
|
@@ -1,64 +0,0 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-71b1bdfa-DqjJO9rg.cjs"),n=require("./player-elevate-card-items-5071deed-BXQrJn1S.cjs"),i=require("./locale-B_6Rn5-v.cjs"),r=`@container (max-width: 270px) {
|
2
|
-
.Card .Inner {
|
3
|
-
flex-direction: column;
|
4
|
-
}
|
5
|
-
.Card .Inner .Content {
|
6
|
-
padding: 9px;
|
7
|
-
}
|
8
|
-
.Inner .Row .ExpirationPoints {
|
9
|
-
order: 1;
|
10
|
-
}
|
11
|
-
}
|
12
|
-
.Card .PlayerImg {
|
13
|
-
order: 0;
|
14
|
-
}
|
15
|
-
.Card .ExpirationPoints {
|
16
|
-
order: 3;
|
17
|
-
}
|
18
|
-
.Card .LevelInfo {
|
19
|
-
order: 2;
|
20
|
-
}
|
21
|
-
.Card .Inner .Row .PlayerImg {
|
22
|
-
flex-direction: column;
|
23
|
-
}
|
24
|
-
.Card .Inner .Row .PointsInfo {
|
25
|
-
width: 100%;
|
26
|
-
text-align: center;
|
27
|
-
display: flex;
|
28
|
-
flex-direction: column;
|
29
|
-
max-height: 50%;
|
30
|
-
}
|
31
|
-
.Card .Inner .PlayerAvatar .Badge {
|
32
|
-
background-size: contain;
|
33
|
-
background-repeat: no-repeat;
|
34
|
-
position: absolute;
|
35
|
-
right: 5px;
|
36
|
-
bottom: -5px;
|
37
|
-
width: 40%;
|
38
|
-
height: 40%;
|
39
|
-
overflow: visible;
|
40
|
-
}
|
41
|
-
.Card .Inner .Row .ExpirationPoints {
|
42
|
-
text-align: left;
|
43
|
-
color: var(--emw--color-red, red);
|
44
|
-
}
|
45
|
-
.Card .Inner .Row .Points {
|
46
|
-
text-wrap: nowrap;
|
47
|
-
}
|
48
|
-
.Card .Inner .LevelInfo .ElevateLevel {
|
49
|
-
flex-direction: column;
|
50
|
-
}
|
51
|
-
.Card .Inner .LevelInfo .ElevateLevel .LevelName {
|
52
|
-
width: calc(100% - 20px);
|
53
|
-
text-align: left;
|
54
|
-
font-size: 13px;
|
55
|
-
padding-left: 20px;
|
56
|
-
margin: 10px 0;
|
57
|
-
}
|
58
|
-
.Card .Inner .LevelInfo .ElevateLevel .ExpirationDate {
|
59
|
-
text-align: center;
|
60
|
-
font-size: smaller;
|
61
|
-
}
|
62
|
-
.Card .Inner .LevelInfo .ElevateLevel .ExpireTime {
|
63
|
-
margin-left: 5px;
|
64
|
-
}`,s=r,t=class{constructor(a){e.registerInstance(this,a),this.endpoint=void 0,this.theme="Dark",this.session=void 0,this.playerAvatarUrl=void 0,this.language="en",this.playerName=void 0,this.dateFormat="yyyy-MM-dd",this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.pointExpireString=void 0,this.playerLevelFlag=0,this.playerElevateLevel=void 0,this.elevateWalletTotal=void 0}onSessionOrEndpointChange(){this.paramProxy=Object.assign(Object.assign({},this.paramProxy),{session:this.session,endpoint:this.endpoint,language:this.language})}playerElevateLeveLoadedHandler(a){a.detail&&(a.detail.elevateLevelWalletTotal&&(this.elevateWalletTotal=a.detail.elevateLevelWalletTotal),a.detail.elevateLevel&&(this.playerElevateLevel=a.detail.elevateLevel),a.detail.pointExpireString&&(this.pointExpireString=a.detail.xpExpireString),a.detail.calculatedLevelFlag&&(this.playerLevelFlag=a.detail.calculatedLevelFlag))}onRedeemClick(){window.postMessage({type:"BEERedeemClicked"},window.location.href)}componentWillLoad(){this.paramProxy={endpoint:this.endpoint,session:this.session,language:this.language,calculateLevelFlag:!0}}render(){const a=e.getAssetPath("../static/card-ground.svg"),l=e.getAssetPath("../static/card-ground-over.svg");return e.h("div",{key:"278a328dd084ee73b2707b93a57bccae64a2c9c7",class:`ElevateCardWrapper ${this.theme}`},e.h("div",{key:"68c885baf533447a7c77fd887bbec11e53768277",class:"Card Outer",style:{backgroundImage:`url(${a}`}},e.h("general-styling-wrapper",{key:"4066253a70cdd5e712ca244a708e7c1600c83071",clientStyling:this.clientStyling,clientStylingUrl:this.clientStylingUrl,targetTranslations:i.TRANSLATIONS,translationUrl:this.translationUrl}),e.h("player-elevate-card-data",{key:"64cda2a267c752056b3c7e3134cc324fa96bc261",params:this.paramProxy}),e.h("div",{key:"c63ae83b401a35f5a78acd83dc3d7296c25141d7",class:"OuterCover Inner",style:{backgroundImage:`url(${l}`}},this.playerElevateLevel&&e.h(e.Fragment,{key:"ba16e5bb54259c17fd9e5aa0e3c03c2ec5d4263c"},e.h("div",{key:"fa1bf74f45e28318c95266cc42c54541bde92718",class:"Content Row"},e.h("div",{key:"7ede46f91bcc0d894b2b633627a4ca97d15fbe90",class:"PlayerImg"},e.h(n.PlayerAvatar,{key:"b6d0bac085e0178512b8a63ba8fccae7d4cc8399",playerAvatarUrl:this.playerAvatarUrl,loyaltyIconUrl:this.playerElevateLevel.presentation.asset}),e.h(n.PlayerPoints,{key:"88c445dbcd7dbe426a8de18beea02aecc03e26f3",loyaltyPoints:this.playerElevateLevel.loyaltyPoints,language:this.language})),this.pointExpireString&&e.h("div",{key:"4d985e486ecb74a6c916b28e619de83cb3d77ac1",class:"PointsInfo ExpirationPoints"},this.pointExpireString," "),e.h("div",{key:"34e051ee1ff79b825fca57db958e1e5684a0aca1",class:`LevelInfo Level${this.playerLevelFlag} ${this.playerElevateLevel.presentation.displayName}`},e.h(n.PlayerNameDiv,{key:"fa1b1f16e0b25c6adfba4c215e4ed377e05699b2",playerName:this.playerName}),e.h(n.PlayerElevateLoyaltyLevel,{key:"6d18b1422db202363ebcd56cc56946e0e071937b",hideInfo:!0,level:this.playerElevateLevel.name,expireTime:this.playerElevateLevel.expireTime,dateFormat:this.dateFormat}),e.h(n.PlayerLoyaltyProcess,{key:"7dae355c4a5a9e28c70dced0ac061608f1753020"}),e.h(n.PlayerElevateCardRedeem,{key:"7e5f830b612c962a828c58f20a88dc97d315c910",onRedeemClick:this.onRedeemClick,language:this.language})))))))}static get assetsDirs(){return["../static"]}static get watchers(){return{session:["onSessionOrEndpointChange"],endpoint:["onSessionOrEndpointChange"],language:["onSessionOrEndpointChange"]}}};t.style=s;exports.player_elevate_card=t;
|
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-71b1bdfa-DqjJO9rg.cjs"),a=require("./locale-B_6Rn5-v.cjs"),n=require("./player-elevate-card-items-5071deed-BXQrJn1S.cjs"),r=":host{display:block}.PointsCard .Inner .Row .ExpirationPoints{text-align:left}.PointsCard .Inner .PlayerAvatar .Avatar{display:none}.PointsCard .Inner .PlayerAvatar .Badge{border-radius:50%;background-size:contain;width:100%;height:100%;position:inherit}.PointsCard .Inner .PointsTxt{display:flex;flex-direction:row;justify-content:space-between}.PointsCard .Inner .DetailButton{background:linear-gradient(283.85deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.47%), linear-gradient(117.99deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.89%), linear-gradient(268.18deg, rgba(255, 255, 255, 0.6) -17.36%, rgba(239, 239, 239, 0) 15.78%), linear-gradient(0deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.6));border-radius:5px;box-shadow:0px 4px 4px 0px rgba(0, 0, 0, 0.25);border:2px solid;font-size:11px;width:108px;padding:4px;cursor:pointer;margin-top:5px;height:16px;min-width:45px;text-align:center}.PointsCard .Inner .DetailButton span{color:var(--emw--color-gray-150, #6D6D6D)}.PointsCard .Inner .DetailButton span{display:inline-block;vertical-align:middle}.PointsCard .Inner .DetailButton:hover span{color:var(--emw--color-gray-150, #6D6D6D)}.PointsCard .Inner .LevelInfo{gap:15px;width:70%}.PointsCard .Inner .LevelInfo .PointsTxt{font-size:15px}.PointsCard .Inner .LevelInfo .PointsTxt.Label{display:none}.PointsCard .Inner .LevelInfo .PointsTxt.SPPoints{padding-top:15px}.PointsCard .Inner .LevelInfo .PointsTxt .TC{font-size:x-small;color:var(--emw--color-gray-300, #58586B);display:flex;align-content:center;height:100%;flex-wrap:wrap;text-decoration:underline;cursor:pointer;display:none}",s=r,i=class{constructor(t){e.registerInstance(this,t),this.isPointDetailCard=this.buttonType==="earningRule",this.endpoint=void 0,this.theme="Dark",this.session=void 0,this.playerAvatarUrl=void 0,this.language="en",this.playerName=void 0,this.cardTitle=void 0,this.buttonType="earningRule",this.dateFormat="yyyy-MM-dd",this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.pointExpireString=void 0,this.playerElevateLevel=void 0,this.elevateWalletTotal=void 0,this.elevateSPTotal=void 0}onSessionOrEndpointChange(){this.paramProxy=Object.assign(Object.assign({},this.paramProxy),{session:this.session,endpoint:this.endpoint,language:this.language})}playerElevateLeveLoadedHandler(t){t.detail&&(t.detail.elevateLevelWalletTotal&&(this.elevateWalletTotal=t.detail.elevateLevelWalletTotal,this.elevateSPTotal=t.detail.loyaltyWalletTotal),t.detail.elevateLevel&&(this.playerElevateLevel=t.detail.elevateLevel),t.detail.pointExpireString&&(this.pointExpireString=t.detail.pointExpireString))}onDetailsClick(){window.postMessage({type:this.isPointDetailCard?"BEEPointRulesClicked":"BEEDetailsClicked",path:this.isPointDetailCard?"player-elevate-level":"player-elevate-point-details"},window.location.href)}componentWillLoad(){this.paramProxy={endpoint:this.endpoint,session:this.session,language:this.language}}render(){const t=e.getAssetPath("../static/card-ground.svg"),l=e.getAssetPath("../static/card-ground-over.svg");return e.h("div",{key:"4e6e25bdd2a9f795369b39dbfd7e9adbd1523e17",class:`ElevateCardWrapper ${this.theme}`},e.h("div",{key:"ddeea1e67d51d5c0c8ed56edfd2d8d9c39e85253",class:"PointsCard Outer ",style:{backgroundImage:`url(${t}`}},e.h("general-styling-wrapper",{key:"c6d6e3a3bc9a54cb99b4268feb3c296527d1ba8c",clientStyling:this.clientStyling,clientStylingUrl:this.clientStylingUrl,targetTranslations:a.TRANSLATIONS,translationUrl:this.translationUrl}),e.h("player-elevate-card-data",{key:"4371faac6967c5b3eced57f6251064ea4e1d6a65",params:this.paramProxy}),e.h("div",{key:"c78235a6fdc2aed90df898f007b5ee091cece8dc",class:"OuterCover Inner",style:{backgroundImage:`url(${l}`}},e.h("div",{key:"025e779223c1c85c11998be8389a8ff836a31e6c",class:"Content Row"},this.playerElevateLevel&&e.h(e.Fragment,{key:"68daa6047dc93d2596d8b2309a26f56960737617"},e.h("div",{key:"6a2d2b2e7d234bceaf3d9240c5d4f2eb80395319",class:"PlayerImg"},e.h(n.PlayerAvatar,{key:"aeaf35ad8055ad4f7312922c8600ea58d09be74f",onlyBadge:!0,loyaltyIconUrl:this.playerElevateLevel.presentation.asset})),e.h("div",{key:"bd51ce868b4d8a547f40ec55548bbf3cfa416534",class:`LevelInfo ${this.playerElevateLevel.name}`},e.h("div",{key:"5f4d77a5b43c8efee850b9813bc1c8e61d27d45d",class:"PointsTxt Label"},this.cardTitle?this.cardTitle:a.translate("spendablePoints",this.language)),e.h("div",{key:"eb83431a73b78eaa1e9384e87492f45a258927c7",class:"PointsTxt SPPoints"},e.h(n.PlayerPoints,{key:"91e1326134f0417dcbc6a0811739ab906272862c",spendablePoints:this.playerElevateLevel.spendablePoints,language:this.language}),e.h("a",{key:"4333bb9afa6276f62f25acb8042d9df82fe03f40",class:"TC",onClick:()=>{this.onDetailsClick()}},a.translate("termAndConditions",this.language))),this.pointExpireString&&e.h("div",{key:"77c30ba4c25c810e84bac42199ab4ca78bdbae99",class:"ExpirationPoints"},this.pointExpireString," ")))))))}static get watchers(){return{session:["onSessionOrEndpointChange"],endpoint:["onSessionOrEndpointChange"],language:["onSessionOrEndpointChange"]}}};i.style=s;exports.player_elevate_pointcard=i;
|
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";var l=(a,t,e)=>new Promise((o,i)=>{var c=r=>{try{s(e.next(r))}catch(b){i(b)}},d=r=>{try{s(e.throw(r))}catch(b){i(b)}},s=r=>r.done?o(r.value):Promise.resolve(r.value).then(c,d);s((e=e.apply(a,t)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-71b1bdfa-DqjJO9rg.cjs"),k=require("./locale-B_6Rn5-v.cjs"),f=":host{display:block}@keyframes rotate{from{transform:rotate(360deg)}to{transform:rotate(0deg)}}.RakebackCard{border:2px solid var(--em-color-border-primary, #003E5C);padding:32px;border-radius:var(--emw--border-radius-medium, 12px);overflow:hidden;font-family:inherit}.RakebackCard .RakebackCardContent .RakebackTitle{font-size:var(--emw--font-size-small, 14px);font-weight:var(--emw--font-weight-semibold, 500);color:var(--em-color-text-secondary, #727672)}.RakebackCard .RakebackCardContent .RakebackDetails{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;margin-top:17px}.RakebackCard .RakebackCardContent .RakebackDetails .RakebackInfo{display:flex;flex-wrap:wrap;align-items:center;gap:0 17px}.RakebackCard .RakebackCardContent .RakebackDetails .RakebackInfo .RakebackRefresh{width:52px;height:52px;cursor:pointer}.RakebackCard .RakebackCardContent .RakebackDetails .RakebackInfo .RakebackRefresh.RakebackLoading{animation:rotate 0.5s linear infinite}.RakebackCard .RakebackCardContent .RakebackDetails .RakebackInfo .RakebackNumContainer{color:var(--em-color-text-primary, #fff);display:flex;align-items:center;gap:8px}.RakebackCard .RakebackCardContent .RakebackDetails .RakebackInfo .RakebackNumContainer .RakebackNum{display:inline-block;font-weight:var(--emw--font-weight-bold, 700);font-size:var(--emw--font-size-2x-large, 36px)}.RakebackCard .RakebackCardContent .RakebackDetails .RakebackInfo .RakebackNumContainer .RakebackCurrency{display:inline-block;font-weight:var(--emw--font-weight-semibold, 500);font-size:var(--emw--font-size-small, 14px);margin-top:14px}.RakebackCard .RakebackCardContent .RakebackDetails .RakebackButton{font-family:inherit;cursor:pointer;width:90px;height:34px;border-radius:var(--emw--border-radius-large, 99px);border:2px solid var(--em-color-border-success, #083B17);display:flex;justify-content:center;align-items:center;color:var(--em-color-text-primary, #fff);background:linear-gradient(180deg, var(--em-color-gradient-1, #24B24E) 0%, var(--em-color-gradient-1, #24B24E) 100%)}.RakebackCard .RakebackCardContent .RakebackDetails .RakebackButton.disabled{cursor:not-allowed;opacity:0.4}.RakebackCard .RakebackCardContent .RakebackCoolOff,.RakebackCard .RakebackCardContent .RakebackError{margin-top:8px;font-weight:var(--emw--font-weight-semibold, 500);font-size:var(--emw--font-size-x-small, 12px);color:var(--em-color-text-error, #FF7A73);text-align:center}",g=f,h=class{constructor(a){n.registerInstance(this,a),this.truncateNumber=(t,e=2)=>{const o=t.toString(),[i,c=""]=o.split(".");return e>0?`${i}.${c?c.slice(0,e):"00"}`:`${i}`},this.sendRakebackClaimedEvent=()=>{!this.endpoint||!this.session||!this.rakebackInfo.claimable||this.isLoading||window.postMessage({type:"RakebackClaimTrigger",points:this.rakebackInfo.points},window.location.href)},this.endpoint=void 0,this.theme="Dark",this.session=void 0,this.language="en",this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.show=!0,this.rakebackInfo={hasRakebackWallet:!1,points:0,currency:"TRY",claimable:!1,minutesCanClaim:0,showCanClaim:!1},this.isLoading=!1,this.coolingOffPeriod=!1,this.showTheWidget=!1}onSessionOrEndpointChange(){return l(this,null,function*(){yield this.loadRakebackInfo()})}onShowOrHasRakebackWalletChange(){return l(this,null,function*(){this.showTheWidget=this.show&&this.rakebackInfo.hasRakebackWallet})}handleMessage(a){const{type:t}=a==null?void 0:a.data;t==="RakebackClaimConfirmed"&&this.claimRakeback()}loadRakebackInfo(){return l(this,null,function*(){if(!(!this.endpoint||!this.session)){this.isLoading=!0;try{const a=new URL(`${this.endpoint}/v1/elevate/playerInfo?language=${this.language}`),t=yield fetch(a.href,{method:"GET",headers:{"X-Sessionid":this.session,"Content-Type":"application/json"}});if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);const e=yield t.json();if(!e.success)throw new Error(e.errorMessage||"Failed to load rakeback info");const{rakebackWallet:o}=e==null?void 0:e.data;if(!o){window.postMessage({type:"RakebackWalletMissing"},window.location.href);return}const{total:i,claimable:c,currency:d,minutesCanClaim:s}=o||{};this.rakebackInfo={hasRakebackWallet:!0,points:i!=null&&i.points?this.truncateNumber(i.points,2):"0.00",currency:d||"",claimable:c||!1,showCanClaim:!!(s&&s>0),minutesCanClaim:s?s<=1&&s>0?1:this.truncateNumber(s,0):0}}catch(a){console.error("Error loading rakeback info:",a),window.postMessage({type:"RakebackClaimError",message:a.message},window.location.href)}finally{this.isLoading=!1}}})}claimRakeback(){return l(this,null,function*(){this.isLoading=!0;try{const a=new URL(`${this.endpoint}/v1/elevate/rakeback/claim`),t=yield fetch(a.href,{method:"PUT",headers:{"X-Sessionid":this.session,"Content-Type":"application/json"},body:JSON.stringify({})});if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);const e=yield t.json();if(!e.success)throw new Error(e.errorMessage||"Failed to claim rakeback");yield this.loadRakebackInfo(),window.postMessage({type:"RakebackClaimed",points:this.rakebackInfo.points},window.location.href)}catch(a){console.error("Error claiming rakeback:",a),window.postMessage({type:"RakebackClaimError",message:a.message},window.location.href)}finally{this.isLoading=!1}})}componentWillLoad(){return l(this,null,function*(){yield this.loadRakebackInfo(),yield this.onShowOrHasRakebackWalletChange()})}render(){return this.showTheWidget?n.h("div",{class:"RakebackCard"},n.h("general-styling-wrapper",{clientStyling:this.clientStyling,clientStylingUrl:this.clientStylingUrl,targetTranslations:k.TRANSLATIONS,translationUrl:this.translationUrl}),n.h("div",{class:"RakebackCardContent"},n.h("div",{class:"RakebackTitle"},k.translate("rakebackTitle",this.language)),n.h("div",{class:"RakebackDetails"},n.h("div",{class:"RakebackInfo"},n.h("div",{class:"RakebackNumContainer"},n.h("span",{class:"RakebackNum"},this.rakebackInfo.points),n.h("span",{class:"RakebackCurrency"},this.rakebackInfo.currency))),n.h("div",{class:`RakebackButton ${this.isLoading||!this.rakebackInfo.claimable?"disabled":""}`,onClick:this.sendRakebackClaimedEvent},k.translate("claim",this.language))),!this.rakebackInfo.claimable&&this.rakebackInfo.showCanClaim&&n.h("div",{class:"RakebackCoolOff"},k.translateWithParams("minutesCanClaim",{lang:this.language,minutes:this.rakebackInfo.minutesCanClaim})))):null}static get watchers(){return{session:["onSessionOrEndpointChange"],endpoint:["onSessionOrEndpointChange"],language:["onSessionOrEndpointChange"],show:["onShowOrHasRakebackWalletChange"],rakebackInfo:["onShowOrHasRakebackWalletChange"]}}};h.style=g;exports.player_rakeback_card=h;
|