@everymatrix/casino-header-controller 1.47.0 → 1.47.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,242 @@
1
+ var c = (e, i, t) => new Promise((r, n) => {
2
+ var h = (a) => {
3
+ try {
4
+ s(t.next(a));
5
+ } catch (p) {
6
+ n(p);
7
+ }
8
+ }, d = (a) => {
9
+ try {
10
+ s(t.throw(a));
11
+ } catch (p) {
12
+ n(p);
13
+ }
14
+ }, s = (a) => a.done ? r(a.value) : Promise.resolve(a.value).then(h, d);
15
+ s((t = t.apply(e, i)).next());
16
+ });
17
+ import { b as u, p as w, r as y, h as o, H as f } from "./index-04d3e726-Dp8kKTwx.js";
18
+ import { g } from "./app-globals-0f993ce5-D-kw1sls.js";
19
+ var m = () => {
20
+ const e = import.meta.url, i = {};
21
+ return e !== "" && (i.resourcesUrl = new URL(".", e).href), w(i);
22
+ };
23
+ m().then((e) => c(void 0, null, function* () {
24
+ return yield g(), u([["user-deposit-withdrawal", [[1, "user-deposit-withdrawal", { clientStyling: [513, "client-styling"], clientStylingUrl: [513, "client-styling-url"], endpoint: [513], type: [513], channel: [513], language: [513], productType: [513, "product-type"], userId: [513, "user-id"], session: [513], successUrl: [513, "success-url"], cancelUrl: [513, "cancel-url"], failUrl: [513, "fail-url"], sportsUrl: [513, "sports-url"], casinoUrl: [513, "casino-url"], contactUrl: [513, "contact-url"], depositUrl: [513, "deposit-url"], currency: [513], showBonusSelectionInput: [513, "show-bonus-selection-input"], isShortCashier: [516, "is-short-cashier"], homeUrl: [513, "home-url"], beforeRedirect: [16], limitStylingAppends: [32], dynamicHeight: [32], cashierInfoUrl: [32] }, null, { session: ["watchLoadWidget"], userId: ["watchLoadWidget"], isShortCashier: ["watchLoadWidget"], currency: ["watchLoadWidget"], showBonusSelectionInput: ["watchLoadWidget"] }]]]], e);
25
+ }));
26
+ const C = "en", v = ["ro", "en", "fr", "hr"], b = {
27
+ en: {
28
+ Deposit: "Deposit",
29
+ Withdraw: "Withdraw",
30
+ denyDeposit: "Please be informed that currently you are not allowed to initiate depost transactions.",
31
+ denyWithdrawal: "Please be informed that currently you are not allowed to initiate withdrawal transactions.",
32
+ notFoundErrorCode: "Not found error code",
33
+ errorCode21122: "Dear player! Please be informed that currently you are not allowed to initiate withdrawal transaction from your player account. Error Code: 21122",
34
+ errorCode21123: "Dear player! Please be informed that currently you are not allowed to make a deposit to your player account. Error Code:21123"
35
+ },
36
+ ro: {
37
+ Deposit: "Depozit",
38
+ Withdraw: "Retragere",
39
+ denyDeposit: "Vă informăm că în prezent nu aveți permisiunea de a iniția tranzacții de depunere.",
40
+ denyWithdrawal: "Vă informăm că în prezent nu aveți permisiunea de a iniția tranzacții de retragere.",
41
+ notFoundErrorCode: "Not found error code",
42
+ errorCode21122: "Dear player! Please be informed that currently you are not allowed to initiate withdrawal transaction from your player account. Error Code: 21122",
43
+ errorCode21123: "Dear player! Please be informed that currently you are not allowed to make a deposit to your player account. Error Code:21123"
44
+ },
45
+ fr: {
46
+ Deposit: "Deposit",
47
+ Withdraw: "Withdraw",
48
+ denyDeposit: "Veuillez être informé que vous n'êtes actuellement pas autorisé à initier des transactions de dépôt.",
49
+ denyWithdrawal: "Veuillez être informé que vous n'êtes actuellement pas autorisé à initier des transactions de retrait.",
50
+ notFoundErrorCode: "Not found error code",
51
+ errorCode21122: "Dear player! Please be informed that currently you are not allowed to initiate withdrawal transaction from your player account. Error Code: 21122",
52
+ errorCode21123: "Dear player! Please be informed that currently you are not allowed to make a deposit to your player account. Error Code:21123"
53
+ },
54
+ hr: {
55
+ Deposit: "Uplata",
56
+ Withdraw: "Isplata",
57
+ denyDeposit: "Obavještavamo Vas da trenutno nemate mogućnost uplata.",
58
+ denyWithdrawal: "Obavještavamo vas da trenutno niste ovlašteni za pokretanje transakcija isplate.",
59
+ notFoundErrorCode: "Not found error code",
60
+ errorCode21122: "Poštovani, trenutno nije moguće izvršiti isplatu sa Vašeg računa. Error Code: 21122",
61
+ errorCode21123: "Poštovani, trenutno nije moguće izvršiti uplatu na Vaš račun. Error Code:21123"
62
+ }
63
+ }, l = (e, i) => {
64
+ const t = i;
65
+ return b[t !== void 0 && v.includes(t) ? t : C][e];
66
+ }, S = (e) => !!(e.toLowerCase().match(/android/i) || e.toLowerCase().match(/blackberry|bb/i) || e.toLowerCase().match(/iphone|ipad|ipod/i) || e.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i)), U = `:host {
67
+ font: inherit;
68
+ display: block;
69
+ height: 100%;
70
+ overflow: hidden;
71
+ }
72
+
73
+ .CategoryTitle {
74
+ font-size: var(--emw--font-size-x-large, 26px);
75
+ color: var(--emfe-w-pam-color-primary, var(--emfe-w-color-primary, #D0046C));
76
+ }
77
+
78
+ .MenuReturnButton {
79
+ font: inherit;
80
+ color: var(--emfe-w-color-gray-300, #58586B);
81
+ display: inline-flex;
82
+ align-items: center;
83
+ column-gap: 10px;
84
+ margin-bottom: 10px;
85
+ }
86
+ .MenuReturnButton svg {
87
+ fill: var(--emfe-w-pam-color-primary, var(--emfe-w-color-primary, #D0046C));
88
+ }
89
+ .MenuReturnButton h2.CategoryTitleMobile {
90
+ font-size: 16px;
91
+ color: var(--emfe-w-pam-color-primary, var(--emfe-w-color-primary, #D0046C));
92
+ }
93
+
94
+ .ErrorMessage {
95
+ color: var(--emfe-w-pam-color-typography, var(--emfe-w-color-typography, #FFFFFF));
96
+ }
97
+
98
+ .DepositWithdrawalWrapper {
99
+ width: 100%;
100
+ padding: 0;
101
+ margin: 0;
102
+ height: 100vh;
103
+ }
104
+
105
+ @container (max-width: 475px) {
106
+ .DepositWithdrawalWrapper {
107
+ height: 100vh;
108
+ }
109
+ }
110
+ .ShortCashier.DepositWithdrawalWrapper {
111
+ height: 500px;
112
+ }
113
+ .ShortCashier.CategoryTitle.CategoryTitle {
114
+ margin-right: 20px;
115
+ padding-top: 20px;
116
+ color: ar(--emfe-w-color-black, #000000);
117
+ }
118
+ .ShortCashier .ErrorMessage {
119
+ margin: auto;
120
+ width: 90%;
121
+ margin-top: 70px;
122
+ text-align: center;
123
+ color: var(--emfe-w-color-black, #000000);
124
+ }`, W = U, D = () => {
125
+ }, M = class {
126
+ constructor(e) {
127
+ y(this, e), this.bindedHandler = this.handleMessage.bind(this), this.userAgent = window.navigator.userAgent, this.isMobile = S(this.userAgent), this.errorCodes = ["21123", "21122"], this.setClientStyling = () => {
128
+ let i = document.createElement("style");
129
+ i.innerHTML = this.clientStyling, this.stylingContainer.prepend(i);
130
+ }, this.setClientStylingURL = () => {
131
+ let i = new URL(this.clientStylingUrl), t = document.createElement("style");
132
+ fetch(i.href).then((r) => r.text()).then((r) => {
133
+ t.innerHTML = r, setTimeout(() => {
134
+ this.stylingContainer.prepend(t);
135
+ }, 1);
136
+ }).catch((r) => {
137
+ console.log("error ", r);
138
+ });
139
+ }, this.clientStyling = "", this.clientStylingUrl = "", this.endpoint = void 0, this.type = void 0, this.channel = void 0, this.language = void 0, this.productType = void 0, this.userId = void 0, this.session = void 0, this.successUrl = void 0, this.cancelUrl = void 0, this.failUrl = void 0, this.sportsUrl = void 0, this.casinoUrl = void 0, this.contactUrl = void 0, this.depositUrl = void 0, this.currency = "", this.showBonusSelectionInput = "true", this.isShortCashier = !1, this.homeUrl = void 0, this.beforeRedirect = D, this.limitStylingAppends = !1, this.dynamicHeight = void 0, this.cashierInfoUrl = void 0;
140
+ }
141
+ get typeParameter() {
142
+ if (this.type === "deposit")
143
+ return "Deposit";
144
+ if (this.type === "withdraw")
145
+ return "Withdraw";
146
+ }
147
+ watchLoadWidget() {
148
+ this.loadWidget();
149
+ }
150
+ componentWillLoad() {
151
+ return c(this, null, function* () {
152
+ yield this.loadWidget();
153
+ });
154
+ }
155
+ toggleScreen(e) {
156
+ window.postMessage({ type: "PlayerAccountMenuActive", isMobile: e }, window.location.href);
157
+ }
158
+ componentDidLoad() {
159
+ window.addEventListener("message", this.bindedHandler, !1);
160
+ }
161
+ disconnectedCallback() {
162
+ window.removeEventListener("message", this.bindedHandler, !1);
163
+ }
164
+ componentDidRender() {
165
+ !this.limitStylingAppends && this.stylingContainer && (this.clientStyling && this.setClientStyling(), this.clientStylingUrl && this.setClientStylingURL(), this.limitStylingAppends = !0);
166
+ }
167
+ render() {
168
+ return o(f, { key: "ccdd9243da65080f4ac854a4bc6ed4006f0c9f5e" }, o("div", { key: "e39b500a56740d0f7e23f92e2f73ea386a3bbb5c", ref: (e) => this.stylingContainer = e }, !(this.isMobile && !this.isShortCashier) && o("h2", { key: "3e2e8bf8a07a4249674f4dae7df7a76da6435fa3", class: "CategoryTitle" }, l(this.typeParameter === "Withdraw" ? "Withdraw" : "Deposit", this.language)), o("div", { key: "886bedf58fac20d2f620d4600b6588089d0e502c", class: `DepositWithdrawalWrapper ${this.isShortCashier ? "ShortCashier" : ""}`, style: { height: this.dynamicHeight, marginTop: this.isShortCashier ? "30px" : "0" } }, o("div", { key: "fa038bb3d599cbd894ba6a14ead4c03bbfa425fd" }, this.isMobile && !this.isShortCashier ? o("div", { class: "MenuReturnButton", onClick: () => this.toggleScreen(this.isMobile) }, o("svg", { xmlns: "http://www.w3.org/2000/svg", width: "15", height: "15", viewBox: "0 0 15 15" }, o("defs", null), o("g", { transform: "translate(-20 -158)" }, o("g", { transform: "translate(20 158)" }, o("path", { class: "aaa", d: "M7.5,0,6.136,1.364,11.3,6.526H0V8.474H11.3L6.136,13.636,7.5,15,15,7.5Z", transform: "translate(15 15) rotate(180)" })))), o("h2", { class: "CategoryTitleMobile" }, l(this.typeParameter === "Withdraw" ? "Withdraw" : "Deposit", this.language))) : null), this.cashierInfoUrl ? o("iframe", { width: "100%", height: "100%", src: this.cashierInfoUrl }) : o("h3", { class: "ErrorMessage" }, this.type === "deposit" ? l("denyDeposit", this.language) : l("denyWithdrawal", this.language)))));
169
+ }
170
+ loadWidget() {
171
+ return c(this, null, function* () {
172
+ const e = {
173
+ Channel: this.channel,
174
+ Type: this.typeParameter,
175
+ SuccessUrl: this.successUrl,
176
+ CancelUrl: this.cancelUrl,
177
+ FailUrl: this.failUrl,
178
+ Language: this.language,
179
+ productType: this.productType,
180
+ isShortCashier: this.isShortCashier,
181
+ currency: this.currency,
182
+ showBonusSelectionInput: this.showBonusSelectionInput
183
+ };
184
+ try {
185
+ const i = `${this.endpoint}/v1/player/${this.userId}/payment/GetPaymentSession`, t = yield fetch(i, {
186
+ method: "POST",
187
+ headers: {
188
+ "X-Sessionid": this.session,
189
+ "Content-Type": "application/json"
190
+ },
191
+ body: JSON.stringify(e)
192
+ });
193
+ if (!t.ok) {
194
+ const n = yield t.text();
195
+ throw new Error(n);
196
+ }
197
+ const r = yield t.json();
198
+ if (r.CashierInfo)
199
+ this.cashierInfoUrl = r.CashierInfo.Url;
200
+ else {
201
+ let n;
202
+ if (r.ResponseMessage) {
203
+ let d = this.errorCodes.find((s) => r.ResponseMessage.includes(s)) || null;
204
+ d ? n = l(`errorCode${d}`, this.language) : n = l("notFoundErrorCode", this.language);
205
+ } else
206
+ n = this.type === "deposit" ? l("denyDeposit", this.language) : l("denyWithdrawal", this.language);
207
+ const h = { type: "error", message: n };
208
+ window.postMessage({ type: "DenyDepositOrWithdrawal", data: h }, window.location.href);
209
+ }
210
+ } catch (i) {
211
+ console.error(i);
212
+ }
213
+ });
214
+ }
215
+ handleMessage(e) {
216
+ var i, t, r, n, h, d, s, a;
217
+ e.data["MMFE:openFullCashier"] === "true" && (window.postMessage({ type: "GoToDeposit" }, window.location.href), window.postMessage({ type: "CloseShortCashier" }, window.location.href)), e.data["MMFE:setQuickDepositHeight"] && this.isShortCashier && (this.dynamicHeight = e.data["MMFE:setQuickDepositHeight"].toString() + "px"), e.data["MMFE:setIFrameHeight"] && this.isShortCashier && (this.dynamicHeight = e.data["MMFE:setIFrameHeight"].toString() + "px"), ((i = e.data) === null || i === void 0 ? void 0 : i.type) === "mm-hcback-to-merchant" && this.doRedirect(e.data.type, this.homeUrl), ((t = e.data) === null || t === void 0 ? void 0 : t.redirect) === "mm-hc-back-tomerchant" && this.doRedirect(e.data.redirect, this.homeUrl), ((r = e.data) === null || r === void 0 ? void 0 : r.redirect) === "mm-hc-sports" && this.doRedirect((n = e.data) === null || n === void 0 ? void 0 : n.redirect, this.sportsUrl), ((h = e.data) === null || h === void 0 ? void 0 : h.redirect) === "mm-hc-casino" && this.doRedirect(window.location.href, this.casinoUrl), ((d = e.data) === null || d === void 0 ? void 0 : d.redirect) === "mm-hc-contact" && (window.postMessage({ type: "CloseShortCashier" }, window.location.href), this.doRedirect(window.location.href, this.contactUrl)), (((s = e.data) === null || s === void 0 ? void 0 : s.redirect) === "mm-wm-hc-init-deposit" || ((a = e.data) === null || a === void 0 ? void 0 : a.redirect) === "mm-wm-hc-init-deposit-quick") && (window.postMessage({ type: "CloseShortCashier" }, window.location.href), this.doRedirect(window.location.href, this.depositUrl));
218
+ }
219
+ doRedirect(e, i) {
220
+ const t = { reason: e, url: i, cancel: !1 };
221
+ if (this.beforeRedirect(t), !t.cancel) {
222
+ if (!t.url) {
223
+ window.location.href = "/";
224
+ return;
225
+ }
226
+ window.location.href = t.url;
227
+ }
228
+ }
229
+ static get watchers() {
230
+ return {
231
+ session: ["watchLoadWidget"],
232
+ userId: ["watchLoadWidget"],
233
+ isShortCashier: ["watchLoadWidget"],
234
+ currency: ["watchLoadWidget"],
235
+ showBonusSelectionInput: ["watchLoadWidget"]
236
+ };
237
+ }
238
+ };
239
+ M.style = W;
240
+ export {
241
+ M as user_deposit_withdrawal
242
+ };
@@ -0,0 +1,59 @@
1
+ "use strict";var c=(e,i,t)=>new Promise((o,n)=>{var h=a=>{try{s(t.next(a))}catch(u){n(u)}},d=a=>{try{s(t.throw(a))}catch(u){n(u)}},s=a=>a.done?o(a.value):Promise.resolve(a.value).then(h,d);s((t=t.apply(e,i)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-04d3e726-Bk7opmvq.cjs"),y=require("./app-globals-0f993ce5-sCt45RkC.cjs");var p=typeof document!="undefined"?document.currentScript:null,f=()=>{const e=typeof document=="undefined"?require("url").pathToFileURL(__filename).href:p&&p.src||new URL("stencil/user-deposit-withdrawal-CsuWz3w0.cjs",document.baseURI).href,i={};return e!==""&&(i.resourcesUrl=new URL(".",e).href),r.promiseResolve(i)};f().then(e=>c(exports,null,function*(){return yield y.globalScripts(),r.bootstrapLazy([["user-deposit-withdrawal",[[1,"user-deposit-withdrawal",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],endpoint:[513],type:[513],channel:[513],language:[513],productType:[513,"product-type"],userId:[513,"user-id"],session:[513],successUrl:[513,"success-url"],cancelUrl:[513,"cancel-url"],failUrl:[513,"fail-url"],sportsUrl:[513,"sports-url"],casinoUrl:[513,"casino-url"],contactUrl:[513,"contact-url"],depositUrl:[513,"deposit-url"],currency:[513],showBonusSelectionInput:[513,"show-bonus-selection-input"],isShortCashier:[516,"is-short-cashier"],homeUrl:[513,"home-url"],beforeRedirect:[16],limitStylingAppends:[32],dynamicHeight:[32],cashierInfoUrl:[32]},null,{session:["watchLoadWidget"],userId:["watchLoadWidget"],isShortCashier:["watchLoadWidget"],currency:["watchLoadWidget"],showBonusSelectionInput:["watchLoadWidget"]}]]]],e)}));const g="en",m=["ro","en","fr","hr"],C={en:{Deposit:"Deposit",Withdraw:"Withdraw",denyDeposit:"Please be informed that currently you are not allowed to initiate depost transactions.",denyWithdrawal:"Please be informed that currently you are not allowed to initiate withdrawal transactions.",notFoundErrorCode:"Not found error code",errorCode21122:"Dear player! Please be informed that currently you are not allowed to initiate withdrawal transaction from your player account. Error Code: 21122",errorCode21123:"Dear player! Please be informed that currently you are not allowed to make a deposit to your player account. Error Code:21123"},ro:{Deposit:"Depozit",Withdraw:"Retragere",denyDeposit:"Vă informăm că în prezent nu aveți permisiunea de a iniția tranzacții de depunere.",denyWithdrawal:"Vă informăm că în prezent nu aveți permisiunea de a iniția tranzacții de retragere.",notFoundErrorCode:"Not found error code",errorCode21122:"Dear player! Please be informed that currently you are not allowed to initiate withdrawal transaction from your player account. Error Code: 21122",errorCode21123:"Dear player! Please be informed that currently you are not allowed to make a deposit to your player account. Error Code:21123"},fr:{Deposit:"Deposit",Withdraw:"Withdraw",denyDeposit:"Veuillez être informé que vous n'êtes actuellement pas autorisé à initier des transactions de dépôt.",denyWithdrawal:"Veuillez être informé que vous n'êtes actuellement pas autorisé à initier des transactions de retrait.",notFoundErrorCode:"Not found error code",errorCode21122:"Dear player! Please be informed that currently you are not allowed to initiate withdrawal transaction from your player account. Error Code: 21122",errorCode21123:"Dear player! Please be informed that currently you are not allowed to make a deposit to your player account. Error Code:21123"},hr:{Deposit:"Uplata",Withdraw:"Isplata",denyDeposit:"Obavještavamo Vas da trenutno nemate mogućnost uplata.",denyWithdrawal:"Obavještavamo vas da trenutno niste ovlašteni za pokretanje transakcija isplate.",notFoundErrorCode:"Not found error code",errorCode21122:"Poštovani, trenutno nije moguće izvršiti isplatu sa Vašeg računa. Error Code: 21122",errorCode21123:"Poštovani, trenutno nije moguće izvršiti uplatu na Vaš račun. Error Code:21123"}},l=(e,i)=>{const t=i;return C[t!==void 0&&m.includes(t)?t:g][e]},v=e=>!!(e.toLowerCase().match(/android/i)||e.toLowerCase().match(/blackberry|bb/i)||e.toLowerCase().match(/iphone|ipad|ipod/i)||e.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i)),b=`:host {
2
+ font: inherit;
3
+ display: block;
4
+ height: 100%;
5
+ overflow: hidden;
6
+ }
7
+
8
+ .CategoryTitle {
9
+ font-size: var(--emw--font-size-x-large, 26px);
10
+ color: var(--emfe-w-pam-color-primary, var(--emfe-w-color-primary, #D0046C));
11
+ }
12
+
13
+ .MenuReturnButton {
14
+ font: inherit;
15
+ color: var(--emfe-w-color-gray-300, #58586B);
16
+ display: inline-flex;
17
+ align-items: center;
18
+ column-gap: 10px;
19
+ margin-bottom: 10px;
20
+ }
21
+ .MenuReturnButton svg {
22
+ fill: var(--emfe-w-pam-color-primary, var(--emfe-w-color-primary, #D0046C));
23
+ }
24
+ .MenuReturnButton h2.CategoryTitleMobile {
25
+ font-size: 16px;
26
+ color: var(--emfe-w-pam-color-primary, var(--emfe-w-color-primary, #D0046C));
27
+ }
28
+
29
+ .ErrorMessage {
30
+ color: var(--emfe-w-pam-color-typography, var(--emfe-w-color-typography, #FFFFFF));
31
+ }
32
+
33
+ .DepositWithdrawalWrapper {
34
+ width: 100%;
35
+ padding: 0;
36
+ margin: 0;
37
+ height: 100vh;
38
+ }
39
+
40
+ @container (max-width: 475px) {
41
+ .DepositWithdrawalWrapper {
42
+ height: 100vh;
43
+ }
44
+ }
45
+ .ShortCashier.DepositWithdrawalWrapper {
46
+ height: 500px;
47
+ }
48
+ .ShortCashier.CategoryTitle.CategoryTitle {
49
+ margin-right: 20px;
50
+ padding-top: 20px;
51
+ color: ar(--emfe-w-color-black, #000000);
52
+ }
53
+ .ShortCashier .ErrorMessage {
54
+ margin: auto;
55
+ width: 90%;
56
+ margin-top: 70px;
57
+ text-align: center;
58
+ color: var(--emfe-w-color-black, #000000);
59
+ }`,S=b,U=()=>{},w=class{constructor(e){r.registerInstance(this,e),this.bindedHandler=this.handleMessage.bind(this),this.userAgent=window.navigator.userAgent,this.isMobile=v(this.userAgent),this.errorCodes=["21123","21122"],this.setClientStyling=()=>{let i=document.createElement("style");i.innerHTML=this.clientStyling,this.stylingContainer.prepend(i)},this.setClientStylingURL=()=>{let i=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(i.href).then(o=>o.text()).then(o=>{t.innerHTML=o,setTimeout(()=>{this.stylingContainer.prepend(t)},1)}).catch(o=>{console.log("error ",o)})},this.clientStyling="",this.clientStylingUrl="",this.endpoint=void 0,this.type=void 0,this.channel=void 0,this.language=void 0,this.productType=void 0,this.userId=void 0,this.session=void 0,this.successUrl=void 0,this.cancelUrl=void 0,this.failUrl=void 0,this.sportsUrl=void 0,this.casinoUrl=void 0,this.contactUrl=void 0,this.depositUrl=void 0,this.currency="",this.showBonusSelectionInput="true",this.isShortCashier=!1,this.homeUrl=void 0,this.beforeRedirect=U,this.limitStylingAppends=!1,this.dynamicHeight=void 0,this.cashierInfoUrl=void 0}get typeParameter(){if(this.type==="deposit")return"Deposit";if(this.type==="withdraw")return"Withdraw"}watchLoadWidget(){this.loadWidget()}componentWillLoad(){return c(this,null,function*(){yield this.loadWidget()})}toggleScreen(e){window.postMessage({type:"PlayerAccountMenuActive",isMobile:e},window.location.href)}componentDidLoad(){window.addEventListener("message",this.bindedHandler,!1)}disconnectedCallback(){window.removeEventListener("message",this.bindedHandler,!1)}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}render(){return r.h(r.Host,{key:"ccdd9243da65080f4ac854a4bc6ed4006f0c9f5e"},r.h("div",{key:"e39b500a56740d0f7e23f92e2f73ea386a3bbb5c",ref:e=>this.stylingContainer=e},!(this.isMobile&&!this.isShortCashier)&&r.h("h2",{key:"3e2e8bf8a07a4249674f4dae7df7a76da6435fa3",class:"CategoryTitle"},l(this.typeParameter==="Withdraw"?"Withdraw":"Deposit",this.language)),r.h("div",{key:"886bedf58fac20d2f620d4600b6588089d0e502c",class:`DepositWithdrawalWrapper ${this.isShortCashier?"ShortCashier":""}`,style:{height:this.dynamicHeight,marginTop:this.isShortCashier?"30px":"0"}},r.h("div",{key:"fa038bb3d599cbd894ba6a14ead4c03bbfa425fd"},this.isMobile&&!this.isShortCashier?r.h("div",{class:"MenuReturnButton",onClick:()=>this.toggleScreen(this.isMobile)},r.h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"15",height:"15",viewBox:"0 0 15 15"},r.h("defs",null),r.h("g",{transform:"translate(-20 -158)"},r.h("g",{transform:"translate(20 158)"},r.h("path",{class:"aaa",d:"M7.5,0,6.136,1.364,11.3,6.526H0V8.474H11.3L6.136,13.636,7.5,15,15,7.5Z",transform:"translate(15 15) rotate(180)"})))),r.h("h2",{class:"CategoryTitleMobile"},l(this.typeParameter==="Withdraw"?"Withdraw":"Deposit",this.language))):null),this.cashierInfoUrl?r.h("iframe",{width:"100%",height:"100%",src:this.cashierInfoUrl}):r.h("h3",{class:"ErrorMessage"},this.type==="deposit"?l("denyDeposit",this.language):l("denyWithdrawal",this.language)))))}loadWidget(){return c(this,null,function*(){const e={Channel:this.channel,Type:this.typeParameter,SuccessUrl:this.successUrl,CancelUrl:this.cancelUrl,FailUrl:this.failUrl,Language:this.language,productType:this.productType,isShortCashier:this.isShortCashier,currency:this.currency,showBonusSelectionInput:this.showBonusSelectionInput};try{const i=`${this.endpoint}/v1/player/${this.userId}/payment/GetPaymentSession`,t=yield fetch(i,{method:"POST",headers:{"X-Sessionid":this.session,"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const n=yield t.text();throw new Error(n)}const o=yield t.json();if(o.CashierInfo)this.cashierInfoUrl=o.CashierInfo.Url;else{let n;if(o.ResponseMessage){let d=this.errorCodes.find(s=>o.ResponseMessage.includes(s))||null;d?n=l(`errorCode${d}`,this.language):n=l("notFoundErrorCode",this.language)}else n=this.type==="deposit"?l("denyDeposit",this.language):l("denyWithdrawal",this.language);const h={type:"error",message:n};window.postMessage({type:"DenyDepositOrWithdrawal",data:h},window.location.href)}}catch(i){console.error(i)}})}handleMessage(e){var i,t,o,n,h,d,s,a;e.data["MMFE:openFullCashier"]==="true"&&(window.postMessage({type:"GoToDeposit"},window.location.href),window.postMessage({type:"CloseShortCashier"},window.location.href)),e.data["MMFE:setQuickDepositHeight"]&&this.isShortCashier&&(this.dynamicHeight=e.data["MMFE:setQuickDepositHeight"].toString()+"px"),e.data["MMFE:setIFrameHeight"]&&this.isShortCashier&&(this.dynamicHeight=e.data["MMFE:setIFrameHeight"].toString()+"px"),((i=e.data)===null||i===void 0?void 0:i.type)==="mm-hcback-to-merchant"&&this.doRedirect(e.data.type,this.homeUrl),((t=e.data)===null||t===void 0?void 0:t.redirect)==="mm-hc-back-tomerchant"&&this.doRedirect(e.data.redirect,this.homeUrl),((o=e.data)===null||o===void 0?void 0:o.redirect)==="mm-hc-sports"&&this.doRedirect((n=e.data)===null||n===void 0?void 0:n.redirect,this.sportsUrl),((h=e.data)===null||h===void 0?void 0:h.redirect)==="mm-hc-casino"&&this.doRedirect(window.location.href,this.casinoUrl),((d=e.data)===null||d===void 0?void 0:d.redirect)==="mm-hc-contact"&&(window.postMessage({type:"CloseShortCashier"},window.location.href),this.doRedirect(window.location.href,this.contactUrl)),(((s=e.data)===null||s===void 0?void 0:s.redirect)==="mm-wm-hc-init-deposit"||((a=e.data)===null||a===void 0?void 0:a.redirect)==="mm-wm-hc-init-deposit-quick")&&(window.postMessage({type:"CloseShortCashier"},window.location.href),this.doRedirect(window.location.href,this.depositUrl))}doRedirect(e,i){const t={reason:e,url:i,cancel:!1};if(this.beforeRedirect(t),!t.cancel){if(!t.url){window.location.href="/";return}window.location.href=t.url}}static get watchers(){return{session:["watchLoadWidget"],userId:["watchLoadWidget"],isShortCashier:["watchLoadWidget"],currency:["watchLoadWidget"],showBonusSelectionInput:["watchLoadWidget"]}}};w.style=S;exports.user_deposit_withdrawal=w;