@everymatrix/user-deposit-withdrawal 1.0.69

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.
Files changed (44) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/index-faa382a8.js +1265 -0
  3. package/dist/cjs/index.cjs.js +2 -0
  4. package/dist/cjs/loader.cjs.js +15 -0
  5. package/dist/cjs/user-deposit-withdrawal.cjs.entry.js +256 -0
  6. package/dist/cjs/user-deposit-withdrawal.cjs.js +25 -0
  7. package/dist/collection/collection-manifest.json +12 -0
  8. package/dist/collection/components/user-deposit-withdrawal/index.js +1 -0
  9. package/dist/collection/components/user-deposit-withdrawal/user-deposit-withdrawal.css +35 -0
  10. package/dist/collection/components/user-deposit-withdrawal/user-deposit-withdrawal.js +601 -0
  11. package/dist/collection/index.js +1 -0
  12. package/dist/collection/utils/locale.utils.js +32 -0
  13. package/dist/collection/utils/utils.js +29 -0
  14. package/dist/esm/app-globals-0f993ce5.js +3 -0
  15. package/dist/esm/index-04d3e726.js +1238 -0
  16. package/dist/esm/index.js +1 -0
  17. package/dist/esm/loader.js +11 -0
  18. package/dist/esm/user-deposit-withdrawal.entry.js +252 -0
  19. package/dist/esm/user-deposit-withdrawal.js +20 -0
  20. package/dist/index.cjs.js +1 -0
  21. package/dist/index.js +1 -0
  22. package/dist/stencil.config.dev.js +17 -0
  23. package/dist/stencil.config.js +17 -0
  24. package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/user-deposit-withdrawal/.stencil/packages/stencil/user-deposit-withdrawal/stencil.config.d.ts +2 -0
  25. package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/user-deposit-withdrawal/.stencil/packages/stencil/user-deposit-withdrawal/stencil.config.dev.d.ts +2 -0
  26. package/dist/types/components/user-deposit-withdrawal/index.d.ts +1 -0
  27. package/dist/types/components/user-deposit-withdrawal/user-deposit-withdrawal.d.ts +75 -0
  28. package/dist/types/components.d.ts +99 -0
  29. package/dist/types/index.d.ts +1 -0
  30. package/dist/types/stencil-public-runtime.d.ts +1674 -0
  31. package/dist/types/utils/locale.utils.d.ts +1 -0
  32. package/dist/types/utils/utils.d.ts +8 -0
  33. package/dist/user-deposit-withdrawal/index.esm.js +0 -0
  34. package/dist/user-deposit-withdrawal/p-53a8ad89.js +2 -0
  35. package/dist/user-deposit-withdrawal/p-83b68346.entry.js +1 -0
  36. package/dist/user-deposit-withdrawal/p-e1255160.js +1 -0
  37. package/dist/user-deposit-withdrawal/user-deposit-withdrawal.esm.js +1 -0
  38. package/loader/cdn.js +1 -0
  39. package/loader/index.cjs.js +1 -0
  40. package/loader/index.d.ts +24 -0
  41. package/loader/index.es2017.js +1 -0
  42. package/loader/index.js +2 -0
  43. package/loader/package.json +11 -0
  44. package/package.json +26 -0
@@ -0,0 +1,601 @@
1
+ import { Host, h } from "@stencil/core";
2
+ import { translate } from "../../utils/locale.utils";
3
+ import { isMobile } from "../../utils/utils";
4
+ const emptyFunction = () => { };
5
+ export class UserDepositWithdrawal {
6
+ constructor() {
7
+ this.bindedHandler = this.handleMessage.bind(this);
8
+ this.userAgent = window.navigator.userAgent;
9
+ this.isMobile = isMobile(this.userAgent);
10
+ this.errorCodes = ["21123", "21122"];
11
+ this.setClientStyling = () => {
12
+ let sheet = document.createElement('style');
13
+ sheet.innerHTML = this.clientStyling;
14
+ this.stylingContainer.prepend(sheet);
15
+ };
16
+ this.setClientStylingURL = () => {
17
+ let url = new URL(this.clientStylingUrl);
18
+ let cssFile = document.createElement('style');
19
+ fetch(url.href)
20
+ .then((res) => res.text())
21
+ .then((data) => {
22
+ cssFile.innerHTML = data;
23
+ setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
24
+ })
25
+ .catch((err) => {
26
+ console.log('error ', err);
27
+ });
28
+ };
29
+ this.clientStyling = '';
30
+ this.clientStylingUrl = '';
31
+ this.endpoint = undefined;
32
+ this.type = undefined;
33
+ this.channel = undefined;
34
+ this.language = undefined;
35
+ this.productType = undefined;
36
+ this.userId = undefined;
37
+ this.session = undefined;
38
+ this.successUrl = undefined;
39
+ this.cancelUrl = undefined;
40
+ this.failUrl = undefined;
41
+ this.sportsUrl = undefined;
42
+ this.casinoUrl = undefined;
43
+ this.contactUrl = undefined;
44
+ this.depositUrl = undefined;
45
+ this.currency = '';
46
+ this.showBonusSelectionInput = 'true';
47
+ this.isShortCashier = false;
48
+ this.homeUrl = undefined;
49
+ this.beforeRedirect = emptyFunction;
50
+ this.limitStylingAppends = false;
51
+ this.dynamicHeight = undefined;
52
+ this.cashierInfoUrl = undefined;
53
+ }
54
+ get typeParameter() {
55
+ if (this.type === 'deposit') {
56
+ return 'Deposit';
57
+ }
58
+ if (this.type === 'withdraw') {
59
+ return 'Withdraw';
60
+ }
61
+ }
62
+ watchLoadWidget() {
63
+ this.loadWidget();
64
+ }
65
+ async componentWillLoad() {
66
+ await this.loadWidget();
67
+ }
68
+ toggleScreen(isMobile) {
69
+ window.postMessage({ type: 'PlayerAccountMenuActive', isMobile }, window.location.href);
70
+ }
71
+ componentDidLoad() {
72
+ window.addEventListener('message', this.bindedHandler, false);
73
+ }
74
+ disconnectedCallback() {
75
+ window.removeEventListener('message', this.bindedHandler, false);
76
+ }
77
+ componentDidRender() {
78
+ // start custom styling area
79
+ if (!this.limitStylingAppends && this.stylingContainer) {
80
+ if (this.clientStyling)
81
+ this.setClientStyling();
82
+ if (this.clientStylingUrl)
83
+ this.setClientStylingURL();
84
+ this.limitStylingAppends = true;
85
+ }
86
+ // end custom styling area
87
+ }
88
+ render() {
89
+ return (h(Host, { key: 'ccdd9243da65080f4ac854a4bc6ed4006f0c9f5e' }, h("div", { key: 'e39b500a56740d0f7e23f92e2f73ea386a3bbb5c', ref: el => this.stylingContainer = el }, (!(this.isMobile && !this.isShortCashier) && (h("h2", { key: '3e2e8bf8a07a4249674f4dae7df7a76da6435fa3', class: "CategoryTitle" }, translate(this.typeParameter === 'Withdraw' ? 'Withdraw' : 'Deposit', this.language)))), h("div", { key: '886bedf58fac20d2f620d4600b6588089d0e502c', class: `DepositWithdrawalWrapper ${this.isShortCashier ? 'ShortCashier' : ''}`, style: { height: this.dynamicHeight, marginTop: this.isShortCashier ? '30px' : '0' } }, h("div", { key: 'fa038bb3d599cbd894ba6a14ead4c03bbfa425fd' }, (this.isMobile && !this.isShortCashier ?
90
+ h("div", { class: "MenuReturnButton", onClick: () => this.toggleScreen(this.isMobile) }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "15", height: "15", viewBox: "0 0 15 15" }, h("defs", null), h("g", { transform: "translate(-20 -158)" }, h("g", { transform: "translate(20 158)" }, 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)" })))), h("h2", { class: "CategoryTitleMobile" }, translate(this.typeParameter === 'Withdraw' ? 'Withdraw' : 'Deposit', this.language)))
91
+ : null)), this.cashierInfoUrl ? h("iframe", { width: "100%", height: "100%", src: this.cashierInfoUrl }) : h("h3", { class: "ErrorMessage" }, this.type === 'deposit' ? translate('denyDeposit', this.language) : translate('denyWithdrawal', this.language))))));
92
+ }
93
+ async loadWidget() {
94
+ const requestObject = {
95
+ Channel: this.channel,
96
+ Type: this.typeParameter,
97
+ SuccessUrl: this.successUrl,
98
+ CancelUrl: this.cancelUrl,
99
+ FailUrl: this.failUrl,
100
+ Language: this.language,
101
+ productType: this.productType,
102
+ isShortCashier: this.isShortCashier,
103
+ currency: this.currency,
104
+ showBonusSelectionInput: this.showBonusSelectionInput
105
+ };
106
+ try {
107
+ const url = `${this.endpoint}/v1/player/${this.userId}/payment/GetPaymentSession`;
108
+ const response = await fetch(url, {
109
+ method: 'POST',
110
+ headers: {
111
+ 'X-Sessionid': this.session,
112
+ 'Content-Type': 'application/json',
113
+ },
114
+ body: JSON.stringify(requestObject)
115
+ });
116
+ if (!response.ok) {
117
+ const err = await response.text();
118
+ throw new Error(err);
119
+ }
120
+ const data = await response.json();
121
+ if (data.CashierInfo) {
122
+ this.cashierInfoUrl = data.CashierInfo.Url;
123
+ }
124
+ else {
125
+ let apiMessage;
126
+ if (data.ResponseMessage) {
127
+ let foundErrorCode = this.errorCodes.find(code => data.ResponseMessage.includes(code)) || null;
128
+ if (foundErrorCode) {
129
+ apiMessage = translate(`errorCode${foundErrorCode}`, this.language);
130
+ }
131
+ else {
132
+ apiMessage = translate('notFoundErrorCode', this.language);
133
+ }
134
+ }
135
+ else {
136
+ apiMessage = this.type === 'deposit'
137
+ ? translate('denyDeposit', this.language)
138
+ : translate('denyWithdrawal', this.language);
139
+ }
140
+ const messageOBj = { type: 'error', message: apiMessage };
141
+ window.postMessage({ type: 'DenyDepositOrWithdrawal', data: messageOBj }, window.location.href);
142
+ }
143
+ }
144
+ catch (ex) {
145
+ console.error(ex);
146
+ }
147
+ }
148
+ handleMessage(message) {
149
+ var _a, _b, _c, _d, _e, _f, _g, _h;
150
+ if (message.data['MMFE:openFullCashier'] === 'true') {
151
+ window.postMessage({ type: 'GoToDeposit' }, window.location.href);
152
+ window.postMessage({ type: 'CloseShortCashier' }, window.location.href);
153
+ }
154
+ if (message.data["MMFE:setQuickDepositHeight"] && this.isShortCashier) {
155
+ this.dynamicHeight = message.data["MMFE:setQuickDepositHeight"].toString() + 'px';
156
+ }
157
+ if (message.data["MMFE:setIFrameHeight"] && this.isShortCashier) {
158
+ this.dynamicHeight = message.data["MMFE:setIFrameHeight"].toString() + 'px';
159
+ }
160
+ if (((_a = message.data) === null || _a === void 0 ? void 0 : _a.type) === 'mm-hcback-to-merchant') {
161
+ this.doRedirect(message.data.type, this.homeUrl);
162
+ }
163
+ if (((_b = message.data) === null || _b === void 0 ? void 0 : _b.redirect) === 'mm-hc-back-tomerchant') {
164
+ this.doRedirect(message.data.redirect, this.homeUrl);
165
+ }
166
+ if (((_c = message.data) === null || _c === void 0 ? void 0 : _c.redirect) === 'mm-hc-sports') {
167
+ this.doRedirect((_d = message.data) === null || _d === void 0 ? void 0 : _d.redirect, this.sportsUrl);
168
+ }
169
+ if (((_e = message.data) === null || _e === void 0 ? void 0 : _e.redirect) === 'mm-hc-casino') {
170
+ this.doRedirect(window.location.href, this.casinoUrl);
171
+ }
172
+ if (((_f = message.data) === null || _f === void 0 ? void 0 : _f.redirect) === 'mm-hc-contact') {
173
+ window.postMessage({ type: 'CloseShortCashier' }, window.location.href);
174
+ this.doRedirect(window.location.href, this.contactUrl);
175
+ }
176
+ if (((_g = message.data) === null || _g === void 0 ? void 0 : _g.redirect) === 'mm-wm-hc-init-deposit' || ((_h = message.data) === null || _h === void 0 ? void 0 : _h.redirect) === 'mm-wm-hc-init-deposit-quick') {
177
+ window.postMessage({ type: 'CloseShortCashier' }, window.location.href);
178
+ this.doRedirect(window.location.href, this.depositUrl);
179
+ }
180
+ }
181
+ doRedirect(reason, url) {
182
+ const redirectArgs = { reason, url, cancel: false };
183
+ this.beforeRedirect(redirectArgs);
184
+ if (redirectArgs.cancel) {
185
+ return;
186
+ }
187
+ if (!redirectArgs.url) {
188
+ window.location.href = '/';
189
+ return;
190
+ }
191
+ window.location.href = redirectArgs.url;
192
+ }
193
+ static get is() { return "user-deposit-withdrawal"; }
194
+ static get encapsulation() { return "shadow"; }
195
+ static get originalStyleUrls() {
196
+ return {
197
+ "$": ["user-deposit-withdrawal.scss"]
198
+ };
199
+ }
200
+ static get styleUrls() {
201
+ return {
202
+ "$": ["user-deposit-withdrawal.css"]
203
+ };
204
+ }
205
+ static get properties() {
206
+ return {
207
+ "clientStyling": {
208
+ "type": "string",
209
+ "mutable": false,
210
+ "complexType": {
211
+ "original": "string",
212
+ "resolved": "string",
213
+ "references": {}
214
+ },
215
+ "required": false,
216
+ "optional": false,
217
+ "docs": {
218
+ "tags": [],
219
+ "text": "Client custom styling via inline style"
220
+ },
221
+ "attribute": "client-styling",
222
+ "reflect": true,
223
+ "defaultValue": "''"
224
+ },
225
+ "clientStylingUrl": {
226
+ "type": "string",
227
+ "mutable": false,
228
+ "complexType": {
229
+ "original": "string",
230
+ "resolved": "string",
231
+ "references": {}
232
+ },
233
+ "required": false,
234
+ "optional": false,
235
+ "docs": {
236
+ "tags": [],
237
+ "text": "Client custom styling via url"
238
+ },
239
+ "attribute": "client-styling-url",
240
+ "reflect": true,
241
+ "defaultValue": "''"
242
+ },
243
+ "endpoint": {
244
+ "type": "string",
245
+ "mutable": false,
246
+ "complexType": {
247
+ "original": "string",
248
+ "resolved": "string",
249
+ "references": {}
250
+ },
251
+ "required": true,
252
+ "optional": false,
253
+ "docs": {
254
+ "tags": [],
255
+ "text": "Endpoint"
256
+ },
257
+ "attribute": "endpoint",
258
+ "reflect": true
259
+ },
260
+ "type": {
261
+ "type": "string",
262
+ "mutable": false,
263
+ "complexType": {
264
+ "original": "'deposit' | 'withdraw'",
265
+ "resolved": "\"deposit\" | \"withdraw\"",
266
+ "references": {}
267
+ },
268
+ "required": true,
269
+ "optional": false,
270
+ "docs": {
271
+ "tags": [],
272
+ "text": ""
273
+ },
274
+ "attribute": "type",
275
+ "reflect": true
276
+ },
277
+ "channel": {
278
+ "type": "string",
279
+ "mutable": false,
280
+ "complexType": {
281
+ "original": "string",
282
+ "resolved": "string",
283
+ "references": {}
284
+ },
285
+ "required": true,
286
+ "optional": false,
287
+ "docs": {
288
+ "tags": [],
289
+ "text": ""
290
+ },
291
+ "attribute": "channel",
292
+ "reflect": true
293
+ },
294
+ "language": {
295
+ "type": "string",
296
+ "mutable": false,
297
+ "complexType": {
298
+ "original": "string",
299
+ "resolved": "string",
300
+ "references": {}
301
+ },
302
+ "required": false,
303
+ "optional": false,
304
+ "docs": {
305
+ "tags": [],
306
+ "text": ""
307
+ },
308
+ "attribute": "language",
309
+ "reflect": true
310
+ },
311
+ "productType": {
312
+ "type": "string",
313
+ "mutable": false,
314
+ "complexType": {
315
+ "original": "string",
316
+ "resolved": "string",
317
+ "references": {}
318
+ },
319
+ "required": false,
320
+ "optional": false,
321
+ "docs": {
322
+ "tags": [],
323
+ "text": ""
324
+ },
325
+ "attribute": "product-type",
326
+ "reflect": true
327
+ },
328
+ "userId": {
329
+ "type": "string",
330
+ "mutable": false,
331
+ "complexType": {
332
+ "original": "string",
333
+ "resolved": "string",
334
+ "references": {}
335
+ },
336
+ "required": false,
337
+ "optional": false,
338
+ "docs": {
339
+ "tags": [],
340
+ "text": ""
341
+ },
342
+ "attribute": "user-id",
343
+ "reflect": true
344
+ },
345
+ "session": {
346
+ "type": "string",
347
+ "mutable": false,
348
+ "complexType": {
349
+ "original": "string",
350
+ "resolved": "string",
351
+ "references": {}
352
+ },
353
+ "required": false,
354
+ "optional": false,
355
+ "docs": {
356
+ "tags": [],
357
+ "text": ""
358
+ },
359
+ "attribute": "session",
360
+ "reflect": true
361
+ },
362
+ "successUrl": {
363
+ "type": "string",
364
+ "mutable": false,
365
+ "complexType": {
366
+ "original": "string",
367
+ "resolved": "string",
368
+ "references": {}
369
+ },
370
+ "required": false,
371
+ "optional": false,
372
+ "docs": {
373
+ "tags": [],
374
+ "text": ""
375
+ },
376
+ "attribute": "success-url",
377
+ "reflect": true
378
+ },
379
+ "cancelUrl": {
380
+ "type": "string",
381
+ "mutable": false,
382
+ "complexType": {
383
+ "original": "string",
384
+ "resolved": "string",
385
+ "references": {}
386
+ },
387
+ "required": false,
388
+ "optional": false,
389
+ "docs": {
390
+ "tags": [],
391
+ "text": ""
392
+ },
393
+ "attribute": "cancel-url",
394
+ "reflect": true
395
+ },
396
+ "failUrl": {
397
+ "type": "string",
398
+ "mutable": false,
399
+ "complexType": {
400
+ "original": "string",
401
+ "resolved": "string",
402
+ "references": {}
403
+ },
404
+ "required": false,
405
+ "optional": false,
406
+ "docs": {
407
+ "tags": [],
408
+ "text": ""
409
+ },
410
+ "attribute": "fail-url",
411
+ "reflect": true
412
+ },
413
+ "sportsUrl": {
414
+ "type": "string",
415
+ "mutable": false,
416
+ "complexType": {
417
+ "original": "string",
418
+ "resolved": "string",
419
+ "references": {}
420
+ },
421
+ "required": false,
422
+ "optional": false,
423
+ "docs": {
424
+ "tags": [],
425
+ "text": ""
426
+ },
427
+ "attribute": "sports-url",
428
+ "reflect": true
429
+ },
430
+ "casinoUrl": {
431
+ "type": "string",
432
+ "mutable": false,
433
+ "complexType": {
434
+ "original": "string",
435
+ "resolved": "string",
436
+ "references": {}
437
+ },
438
+ "required": false,
439
+ "optional": false,
440
+ "docs": {
441
+ "tags": [],
442
+ "text": ""
443
+ },
444
+ "attribute": "casino-url",
445
+ "reflect": true
446
+ },
447
+ "contactUrl": {
448
+ "type": "string",
449
+ "mutable": false,
450
+ "complexType": {
451
+ "original": "string",
452
+ "resolved": "string",
453
+ "references": {}
454
+ },
455
+ "required": false,
456
+ "optional": false,
457
+ "docs": {
458
+ "tags": [],
459
+ "text": ""
460
+ },
461
+ "attribute": "contact-url",
462
+ "reflect": true
463
+ },
464
+ "depositUrl": {
465
+ "type": "string",
466
+ "mutable": false,
467
+ "complexType": {
468
+ "original": "string",
469
+ "resolved": "string",
470
+ "references": {}
471
+ },
472
+ "required": false,
473
+ "optional": false,
474
+ "docs": {
475
+ "tags": [],
476
+ "text": ""
477
+ },
478
+ "attribute": "deposit-url",
479
+ "reflect": true
480
+ },
481
+ "currency": {
482
+ "type": "string",
483
+ "mutable": false,
484
+ "complexType": {
485
+ "original": "string",
486
+ "resolved": "string",
487
+ "references": {}
488
+ },
489
+ "required": false,
490
+ "optional": false,
491
+ "docs": {
492
+ "tags": [],
493
+ "text": ""
494
+ },
495
+ "attribute": "currency",
496
+ "reflect": true,
497
+ "defaultValue": "''"
498
+ },
499
+ "showBonusSelectionInput": {
500
+ "type": "string",
501
+ "mutable": false,
502
+ "complexType": {
503
+ "original": "string",
504
+ "resolved": "string",
505
+ "references": {}
506
+ },
507
+ "required": false,
508
+ "optional": false,
509
+ "docs": {
510
+ "tags": [],
511
+ "text": ""
512
+ },
513
+ "attribute": "show-bonus-selection-input",
514
+ "reflect": true,
515
+ "defaultValue": "'true'"
516
+ },
517
+ "isShortCashier": {
518
+ "type": "boolean",
519
+ "mutable": false,
520
+ "complexType": {
521
+ "original": "boolean",
522
+ "resolved": "boolean",
523
+ "references": {}
524
+ },
525
+ "required": false,
526
+ "optional": false,
527
+ "docs": {
528
+ "tags": [],
529
+ "text": ""
530
+ },
531
+ "attribute": "is-short-cashier",
532
+ "reflect": true,
533
+ "defaultValue": "false"
534
+ },
535
+ "homeUrl": {
536
+ "type": "string",
537
+ "mutable": false,
538
+ "complexType": {
539
+ "original": "string",
540
+ "resolved": "string",
541
+ "references": {}
542
+ },
543
+ "required": false,
544
+ "optional": false,
545
+ "docs": {
546
+ "tags": [],
547
+ "text": ""
548
+ },
549
+ "attribute": "home-url",
550
+ "reflect": true
551
+ },
552
+ "beforeRedirect": {
553
+ "type": "unknown",
554
+ "mutable": false,
555
+ "complexType": {
556
+ "original": "(params: RedirectCallbackArgs) => void",
557
+ "resolved": "(params: RedirectCallbackArgs) => void",
558
+ "references": {
559
+ "RedirectCallbackArgs": {
560
+ "location": "local",
561
+ "path": "/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/user-deposit-withdrawal/src/components/user-deposit-withdrawal/user-deposit-withdrawal.tsx",
562
+ "id": "../../../../packages/stencil/user-deposit-withdrawal/src/components/user-deposit-withdrawal/user-deposit-withdrawal.tsx::RedirectCallbackArgs"
563
+ }
564
+ }
565
+ },
566
+ "required": false,
567
+ "optional": false,
568
+ "docs": {
569
+ "tags": [],
570
+ "text": ""
571
+ },
572
+ "defaultValue": "emptyFunction"
573
+ }
574
+ };
575
+ }
576
+ static get states() {
577
+ return {
578
+ "limitStylingAppends": {},
579
+ "dynamicHeight": {},
580
+ "cashierInfoUrl": {}
581
+ };
582
+ }
583
+ static get watchers() {
584
+ return [{
585
+ "propName": "session",
586
+ "methodName": "watchLoadWidget"
587
+ }, {
588
+ "propName": "userId",
589
+ "methodName": "watchLoadWidget"
590
+ }, {
591
+ "propName": "isShortCashier",
592
+ "methodName": "watchLoadWidget"
593
+ }, {
594
+ "propName": "currency",
595
+ "methodName": "watchLoadWidget"
596
+ }, {
597
+ "propName": "showBonusSelectionInput",
598
+ "methodName": "watchLoadWidget"
599
+ }];
600
+ }
601
+ }
@@ -0,0 +1 @@
1
+ export * from './components';
@@ -0,0 +1,32 @@
1
+ const DEFAULT_LANGUAGE = 'en';
2
+ const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'hr'];
3
+ const TRANSLATIONS = {
4
+ en: {
5
+ Deposit: 'Deposit',
6
+ Withdraw: 'Withdraw',
7
+ denyDeposit: 'Please be informed that currently you are not allowed to initiate depost transactions.',
8
+ denyWithdrawal: 'Please be informed that currently you are not allowed to initiate withdrawal transactions.'
9
+ },
10
+ ro: {
11
+ Deposit: 'Depozit',
12
+ Withdraw: 'Retragere',
13
+ denyDeposit: 'Vă informăm că în prezent nu aveți permisiunea de a iniția tranzacții de depunere.',
14
+ denyWithdrawal: 'Vă informăm că în prezent nu aveți permisiunea de a iniția tranzacții de retragere.'
15
+ },
16
+ fr: {
17
+ Deposit: 'Deposit',
18
+ Withdraw: 'Withdraw',
19
+ denyDeposit: 'Veuillez être informé que vous n\'êtes actuellement pas autorisé à initier des transactions de dépôt.',
20
+ denyWithdrawal: 'Veuillez être informé que vous n\'êtes actuellement pas autorisé à initier des transactions de retrait.'
21
+ },
22
+ hr: {
23
+ Deposit: 'Letét',
24
+ Withdraw: 'Visszavonás',
25
+ denyDeposit: 'Obavještavamo vas da trenutno niste ovlašteni za pokretanje transakcija pologa.',
26
+ denyWithdrawal: 'Obavještavamo vas da trenutno niste ovlašteni za pokretanje transakcija isplate.'
27
+ }
28
+ };
29
+ export const translate = (key, customLang) => {
30
+ const lang = customLang;
31
+ return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
32
+ };
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @name isMobile
3
+ * @description A method that returns if the browser used to access the app is from a mobile device or not
4
+ * @param {String} userAgent window.navigator.userAgent
5
+ * @returns {Boolean} true or false
6
+ */
7
+ export const isMobile = (userAgent) => {
8
+ return !!(userAgent.toLowerCase().match(/android/i) ||
9
+ userAgent.toLowerCase().match(/blackberry|bb/i) ||
10
+ userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||
11
+ userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
12
+ };
13
+ export function checkDeviceType() {
14
+ const userAgent = navigator.userAgent.toLowerCase();
15
+ const width = screen.availWidth;
16
+ const height = screen.availHeight;
17
+ if (userAgent.includes('iphone')) {
18
+ return 'mobile';
19
+ }
20
+ if (userAgent.includes('android')) {
21
+ if (height > width && width < 800) {
22
+ return 'mobile';
23
+ }
24
+ if (width > height && height < 800) {
25
+ return 'tablet';
26
+ }
27
+ }
28
+ return 'desktop';
29
+ }
@@ -0,0 +1,3 @@
1
+ const globalScripts = () => {};
2
+
3
+ export { globalScripts as g };