@everymatrix/casino-challenge-details 0.0.1

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 (83) hide show
  1. package/dist/casino-challenge-details/app-globals-0f993ce5.js +1 -0
  2. package/dist/casino-challenge-details/casino-challenge-details-5a765f2c.js +1 -0
  3. package/dist/casino-challenge-details/casino-challenge-details.esm.js +1 -0
  4. package/dist/casino-challenge-details/casino-challenge-details_4.entry.js +1 -0
  5. package/dist/casino-challenge-details/index-30adf0cb.js +2 -0
  6. package/dist/casino-challenge-details/index.esm.js +1 -0
  7. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  8. package/dist/cjs/casino-challenge-details-ddf27d4e.js +761 -0
  9. package/dist/cjs/casino-challenge-details.cjs.js +25 -0
  10. package/dist/cjs/casino-challenge-details_4.cjs.entry.js +144 -0
  11. package/dist/cjs/index-2a30d71d.js +1250 -0
  12. package/dist/cjs/index.cjs.js +10 -0
  13. package/dist/cjs/loader.cjs.js +15 -0
  14. package/dist/collection/assets/active-chevron.svg +3 -0
  15. package/dist/collection/assets/alert.svg +3 -0
  16. package/dist/collection/assets/back-arrow.svg +9 -0
  17. package/dist/collection/assets/check.svg +10 -0
  18. package/dist/collection/assets/finish.svg +7 -0
  19. package/dist/collection/assets/gift.svg +14 -0
  20. package/dist/collection/assets/inactive-chevron.svg +3 -0
  21. package/dist/collection/assets/info-circle.svg +3 -0
  22. package/dist/collection/assets/lock.svg +3 -0
  23. package/dist/collection/assets/notification.svg +20 -0
  24. package/dist/collection/assets/target.svg +9 -0
  25. package/dist/collection/assets/title-icon.svg +1 -0
  26. package/dist/collection/assets/trophy.svg +14 -0
  27. package/dist/collection/collection-manifest.json +15 -0
  28. package/dist/collection/components/casino-challenge-details/casino-challenge-details.css +592 -0
  29. package/dist/collection/components/casino-challenge-details/casino-challenge-details.js +684 -0
  30. package/dist/collection/components/casino-challenge-details/index.js +1 -0
  31. package/dist/collection/components/components/casino-challenge-expandable-paragraph.css +76 -0
  32. package/dist/collection/components/components/casino-challenge-expandable-paragraph.js +116 -0
  33. package/dist/collection/components/components/casino-challenge-level-progress-bar.css +33 -0
  34. package/dist/collection/components/components/casino-challenge-level-progress-bar.js +81 -0
  35. package/dist/collection/components/components/casino-challenge-progress-bar.css +66 -0
  36. package/dist/collection/components/components/casino-challenge-progress-bar.js +120 -0
  37. package/dist/collection/index.js +1 -0
  38. package/dist/collection/utils/locale.utils.js +166 -0
  39. package/dist/collection/utils/mock.js +238 -0
  40. package/dist/collection/utils/types.js +60 -0
  41. package/dist/collection/utils/utils.js +29 -0
  42. package/dist/esm/app-globals-0f993ce5.js +3 -0
  43. package/dist/esm/casino-challenge-details-5a765f2c.js +758 -0
  44. package/dist/esm/casino-challenge-details.js +20 -0
  45. package/dist/esm/casino-challenge-details_4.entry.js +138 -0
  46. package/dist/esm/index-30adf0cb.js +1221 -0
  47. package/dist/esm/index.js +2 -0
  48. package/dist/esm/loader.js +11 -0
  49. package/dist/index.cjs.js +1 -0
  50. package/dist/index.js +1 -0
  51. package/dist/stencil.config.dev.js +19 -0
  52. package/dist/stencil.config.js +19 -0
  53. package/dist/storybook/main.js +43 -0
  54. package/dist/storybook/preview.js +9 -0
  55. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenge-details/.stencil/libs/common/src/storybook/storybook-utils.d.ts +39 -0
  56. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenge-details/.stencil/packages/stencil/casino-challenge-details/stencil.config.d.ts +2 -0
  57. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenge-details/.stencil/packages/stencil/casino-challenge-details/stencil.config.dev.d.ts +2 -0
  58. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenge-details/.stencil/packages/stencil/casino-challenge-details/storybook/main.d.ts +3 -0
  59. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenge-details/.stencil/packages/stencil/casino-challenge-details/storybook/preview.d.ts +70 -0
  60. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenge-details/.stencil/tools/plugins/index.d.ts +4 -0
  61. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenge-details/.stencil/tools/plugins/lazy-load-chunk-plugin.d.ts +12 -0
  62. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenge-details/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +5 -0
  63. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenge-details/.stencil/tools/plugins/vite-chunk-plugin.d.ts +6 -0
  64. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenge-details/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +4 -0
  65. package/dist/types/components/casino-challenge-details/casino-challenge-details.d.ts +105 -0
  66. package/dist/types/components/casino-challenge-details/index.d.ts +1 -0
  67. package/dist/types/components/components/casino-challenge-expandable-paragraph.d.ts +16 -0
  68. package/dist/types/components/components/casino-challenge-level-progress-bar.d.ts +6 -0
  69. package/dist/types/components/components/casino-challenge-progress-bar.d.ts +8 -0
  70. package/dist/types/components.d.ts +198 -0
  71. package/dist/types/index.d.ts +1 -0
  72. package/dist/types/stencil-public-runtime.d.ts +1674 -0
  73. package/dist/types/utils/locale.utils.d.ts +3 -0
  74. package/dist/types/utils/mock.d.ts +76 -0
  75. package/dist/types/utils/types.d.ts +127 -0
  76. package/dist/types/utils/utils.d.ts +3 -0
  77. package/loader/cdn.js +1 -0
  78. package/loader/index.cjs.js +1 -0
  79. package/loader/index.d.ts +24 -0
  80. package/loader/index.es2017.js +1 -0
  81. package/loader/index.js +2 -0
  82. package/loader/package.json +11 -0
  83. package/package.json +27 -0
@@ -0,0 +1 @@
1
+ export { CasinoChallengeDetails } from './casino-challenge-details';
@@ -0,0 +1,76 @@
1
+ :host {
2
+ display: block;
3
+ }
4
+
5
+ .container {
6
+ position: relative;
7
+ max-width: 100%;
8
+ }
9
+
10
+ .paragraph {
11
+ overflow: hidden;
12
+ position: relative;
13
+ transition: max-height 0.3s ease;
14
+ line-height: 1.5em;
15
+ word-break: break-word;
16
+ }
17
+
18
+ .truncated {
19
+ overflow: hidden;
20
+ text-overflow: ellipsis;
21
+ transition: all 0.3s;
22
+ }
23
+
24
+ .expanded {
25
+ max-height: none !important;
26
+ overflow: visible;
27
+ }
28
+
29
+ .expand-overlay {
30
+ position: absolute;
31
+ bottom: 0;
32
+ left: 0;
33
+ right: 0;
34
+ display: flex;
35
+ justify-content: center;
36
+ align-items: flex-end;
37
+ height: 30px;
38
+ pointer-events: none;
39
+ }
40
+
41
+ .overlay-fade {
42
+ position: absolute;
43
+ bottom: 0;
44
+ left: 0;
45
+ right: 0;
46
+ height: 100%;
47
+ z-index: 0;
48
+ }
49
+
50
+ .expand-overlay .control-link {
51
+ position: relative;
52
+ z-index: 1;
53
+ pointer-events: auto;
54
+ margin-bottom: 4px;
55
+ }
56
+
57
+ .collapse-container {
58
+ text-align: center;
59
+ margin-top: 12px;
60
+ background: linear-gradient(166deg, rgba(23, 24, 23, 0.7) 9.98%, #171817 89.76%);
61
+ backdrop-filter: blur(0.5px);
62
+ width: 100%;
63
+ height: 26px;
64
+ }
65
+ .collapse-container.is-expanded {
66
+ backdrop-filter: none;
67
+ background: transparent;
68
+ }
69
+
70
+ .control-link {
71
+ cursor: pointer;
72
+ user-select: none;
73
+ font-size: var(--emw--font-size-sm, 14px);
74
+ text-decoration: none;
75
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
76
+ }
@@ -0,0 +1,116 @@
1
+ import { h } from "@stencil/core";
2
+ import activeChevron from "../../assets/active-chevron.svg";
3
+ import inActiveChevron from "../../assets/inactive-chevron.svg";
4
+ export class CasinoChallengeExpandableParagraph {
5
+ constructor() {
6
+ this.handleResize = () => {
7
+ this.evaluateLayout();
8
+ };
9
+ this.evaluateLayout = () => {
10
+ const content = this.contentEl;
11
+ const isSmall = window.innerWidth <= 860;
12
+ this.isSmallScreen = isSmall;
13
+ if (isSmall && content.scrollHeight > this.maxHeight) {
14
+ this.needsTruncation = true;
15
+ }
16
+ else {
17
+ this.needsTruncation = false;
18
+ this.expanded = false;
19
+ }
20
+ };
21
+ this.toggleExpand = () => {
22
+ this.expanded = true;
23
+ };
24
+ this.toggleCollapse = () => {
25
+ this.expanded = false;
26
+ };
27
+ this.expanded = false;
28
+ this.needsTruncation = false;
29
+ this.isSmallScreen = true;
30
+ this.maxHeight = 75;
31
+ this.active = false;
32
+ }
33
+ componentDidLoad() {
34
+ this.evaluateLayout();
35
+ window.addEventListener('resize', this.handleResize);
36
+ }
37
+ disconnectedCallback() {
38
+ window.removeEventListener('resize', this.handleResize);
39
+ }
40
+ render() {
41
+ const shouldClamp = this.isSmallScreen && this.needsTruncation && !this.expanded;
42
+ return (h("div", { key: '1a560a834781449bfe9b3aee1779e3025134c986', class: "container" }, h("div", { key: 'e47f4cc53f0e07f968f231b4243636de1e5af16e', ref: (el) => (this.contentEl = el), class: {
43
+ paragraph: true,
44
+ truncated: shouldClamp,
45
+ expanded: this.expanded
46
+ }, style: shouldClamp ? { maxHeight: `${this.maxHeight}px` } : {} }, h("slot", { key: '15121a785a76f38fc7eb27966914fc0dcd447b4f' }), this.isSmallScreen && this.needsTruncation && (h("div", { key: '8f709a953cca5b578ed88bcc8520c1794bfcea04', class: "expand-overlay" }, h("div", { key: '50601d0d4f4de80c69ca8fef91b7433598ff008a', class: {
47
+ 'collapse-container': true,
48
+ 'is-expanded': this.expanded
49
+ } }, h("img", { key: '53c06703a49a157ab95f06692dfe35b8634dc3a3', class: "control-link", src: this.active ? activeChevron : inActiveChevron, onClick: this.expanded ? this.toggleCollapse : this.toggleExpand, style: {
50
+ position: 'absolute',
51
+ bottom: this.expanded ? '-15px' : '-5px',
52
+ transform: this.expanded ? 'rotate(180deg)' : '',
53
+ transition: 'all 0.3s'
54
+ } })))))));
55
+ }
56
+ static get is() { return "casino-challenge-expandable-paragraph"; }
57
+ static get encapsulation() { return "shadow"; }
58
+ static get originalStyleUrls() {
59
+ return {
60
+ "$": ["casino-challenge-expandable-paragraph.scss"]
61
+ };
62
+ }
63
+ static get styleUrls() {
64
+ return {
65
+ "$": ["casino-challenge-expandable-paragraph.css"]
66
+ };
67
+ }
68
+ static get properties() {
69
+ return {
70
+ "maxHeight": {
71
+ "type": "number",
72
+ "mutable": false,
73
+ "complexType": {
74
+ "original": "number",
75
+ "resolved": "number",
76
+ "references": {}
77
+ },
78
+ "required": false,
79
+ "optional": false,
80
+ "docs": {
81
+ "tags": [],
82
+ "text": ""
83
+ },
84
+ "attribute": "max-height",
85
+ "reflect": false,
86
+ "defaultValue": "75"
87
+ },
88
+ "active": {
89
+ "type": "boolean",
90
+ "mutable": false,
91
+ "complexType": {
92
+ "original": "boolean",
93
+ "resolved": "boolean",
94
+ "references": {}
95
+ },
96
+ "required": false,
97
+ "optional": false,
98
+ "docs": {
99
+ "tags": [],
100
+ "text": ""
101
+ },
102
+ "attribute": "active",
103
+ "reflect": false,
104
+ "defaultValue": "false"
105
+ }
106
+ };
107
+ }
108
+ static get states() {
109
+ return {
110
+ "expanded": {},
111
+ "needsTruncation": {},
112
+ "isSmallScreen": {}
113
+ };
114
+ }
115
+ static get elementRef() { return "el"; }
116
+ }
@@ -0,0 +1,33 @@
1
+ :host {
2
+ display: block;
3
+ width: 100%;
4
+ }
5
+
6
+ .bar-wrapper {
7
+ display: flex;
8
+ flex-direction: column;
9
+ align-items: flex-end;
10
+ }
11
+
12
+ .bar-container {
13
+ position: relative;
14
+ width: 100%;
15
+ background: var(--emw--progress-background, rgba(188, 252, 177, 0.1019607843));
16
+ overflow: hidden;
17
+ box-shadow: 0 0 4px 0 #134629;
18
+ border-radius: 20px;
19
+ mix-blend-mode: luminosity;
20
+ }
21
+ .bar-container.active {
22
+ background: linear-gradient(90deg, rgba(30, 101, 79, 0.3) 0%, rgba(28, 141, 86, 0.3) 100%);
23
+ mix-blend-mode: normal;
24
+ }
25
+
26
+ .bar-fill {
27
+ height: 100%;
28
+ transition: width 0.4s ease-in-out;
29
+ background: linear-gradient(90deg, var(--emw--secondary-green, #1e654f) 0%, var(--emw--dark-green, #1c8d56) 100%);
30
+ }
31
+ .bar-fill.active {
32
+ background: var(--emw--progress-background-fill, linear-gradient(90deg, #1e654f 0%, #1c8d56 100%));
33
+ }
@@ -0,0 +1,81 @@
1
+ import { h, Host } from "@stencil/core";
2
+ export class CasinoChallengeLevelProgressBar {
3
+ constructor() {
4
+ this.height = '8px';
5
+ this.active = true;
6
+ this.value = 0;
7
+ }
8
+ render() {
9
+ return (h(Host, { key: 'b8e61f34292f68ee181ebeb1459892b2a736aab2' }, h("div", { key: 'd7ed2ac70030b6842ca1a26f25cc8350c8ab6065', class: "bar-wrapper" }, h("div", { key: '797bc1b134e114a0a2e463ff62829e82f99a1c45', class: { 'bar-container': true, active: this.active }, style: { height: this.height } }, h("div", { key: '6ea2b651d63c1a75ab9e3a0c38cb6899dd2df707', class: { 'bar-fill': true, active: this.active }, style: { width: `${this.value}%` } })))));
10
+ }
11
+ static get is() { return "casino-challenge-level-progress-bar"; }
12
+ static get encapsulation() { return "shadow"; }
13
+ static get originalStyleUrls() {
14
+ return {
15
+ "$": ["casino-challenge-level-progress-bar.scss"]
16
+ };
17
+ }
18
+ static get styleUrls() {
19
+ return {
20
+ "$": ["casino-challenge-level-progress-bar.css"]
21
+ };
22
+ }
23
+ static get properties() {
24
+ return {
25
+ "height": {
26
+ "type": "string",
27
+ "mutable": false,
28
+ "complexType": {
29
+ "original": "string",
30
+ "resolved": "string",
31
+ "references": {}
32
+ },
33
+ "required": false,
34
+ "optional": false,
35
+ "docs": {
36
+ "tags": [],
37
+ "text": ""
38
+ },
39
+ "attribute": "height",
40
+ "reflect": false,
41
+ "defaultValue": "'8px'"
42
+ },
43
+ "active": {
44
+ "type": "boolean",
45
+ "mutable": false,
46
+ "complexType": {
47
+ "original": "boolean",
48
+ "resolved": "boolean",
49
+ "references": {}
50
+ },
51
+ "required": false,
52
+ "optional": false,
53
+ "docs": {
54
+ "tags": [],
55
+ "text": ""
56
+ },
57
+ "attribute": "active",
58
+ "reflect": false,
59
+ "defaultValue": "true"
60
+ },
61
+ "value": {
62
+ "type": "number",
63
+ "mutable": false,
64
+ "complexType": {
65
+ "original": "number",
66
+ "resolved": "number",
67
+ "references": {}
68
+ },
69
+ "required": false,
70
+ "optional": false,
71
+ "docs": {
72
+ "tags": [],
73
+ "text": ""
74
+ },
75
+ "attribute": "value",
76
+ "reflect": false,
77
+ "defaultValue": "0"
78
+ }
79
+ };
80
+ }
81
+ }
@@ -0,0 +1,66 @@
1
+ .progress {
2
+ background-color: var(--emw--progress-background, rgba(188, 252, 177, 0.1019607843));
3
+ border-radius: 100px;
4
+ height: 20px;
5
+ margin: 16px 0;
6
+ position: relative;
7
+ align-content: center;
8
+ padding: 0 2px;
9
+ box-sizing: border-box;
10
+ }
11
+ .progress.paused {
12
+ opacity: 0.5;
13
+ }
14
+ .progress.grayed {
15
+ mix-blend-mode: luminosity;
16
+ }
17
+ .progress__placeholder {
18
+ height: 20px;
19
+ }
20
+ .progress__icon {
21
+ padding-top: 4px;
22
+ }
23
+ .progress__point {
24
+ position: absolute;
25
+ text-align: center;
26
+ font-size: 12px;
27
+ color: var(--emw--color-gray-150, #c8d6ce);
28
+ font-weight: 700;
29
+ line-height: 19px;
30
+ top: 0;
31
+ height: 19px;
32
+ width: 19px;
33
+ border-radius: 50%;
34
+ }
35
+ .progress__point.start {
36
+ left: 0;
37
+ border: 2px solid var(--emw--button-background-primary-color, #18ce51);
38
+ background: linear-gradient(90deg, var(--emw--progress-active-level, #24aa4d) 0%, var(--emw--progress-active-level-secondary, #113f21) 100%);
39
+ }
40
+ .progress__point.end {
41
+ right: 0;
42
+ border: 2px solid var(--emw--dark-green, #1c8d56);
43
+ background: var(--emw--color-gray-300, #083b17);
44
+ opacity: 0.7;
45
+ }
46
+ .progress__point.finished {
47
+ opacity: 1;
48
+ }
49
+ .progress__point.hidden {
50
+ opacity: 0;
51
+ }
52
+ .progress__bar {
53
+ border-radius: 73px;
54
+ height: 16px;
55
+ background: linear-gradient(90deg, var(--emw--secondary-green, #1e654f) 0%, var(--emw--dark-green, #1c8d56) 100%);
56
+ text-align: end;
57
+ color: var(--emw--color-gray-50, #e2e2e2);
58
+ font-size: 11px;
59
+ font-weight: 700;
60
+ line-height: 16px;
61
+ padding-right: 6px;
62
+ box-sizing: border-box;
63
+ }
64
+ .progress__bar.finished {
65
+ text-align: center;
66
+ }
@@ -0,0 +1,120 @@
1
+ import { h, Host } from "@stencil/core";
2
+ import { EChallengeProgressStatus, EChallengeStatus } from "../../utils/types";
3
+ import { translate } from "../../utils/locale.utils";
4
+ import trophyIcon from "../../assets/trophy.svg";
5
+ import finishIcon from "../../assets/finish.svg";
6
+ export class CasinoChallengeProgressBar {
7
+ constructor() {
8
+ this.challenge = undefined;
9
+ this.isUserAuthorized = undefined;
10
+ this.language = 'en';
11
+ }
12
+ get challengeProgress() {
13
+ var _a;
14
+ const currLevel = (_a = this.challenge) === null || _a === void 0 ? void 0 : _a.LevelProgresses.find((x) => x.ProgressStatus === EChallengeProgressStatus.InProgress);
15
+ if (!this.isUserAuthorized || !currLevel)
16
+ return null;
17
+ const { Status, LevelProgresses } = this.challenge;
18
+ if (Status === EChallengeStatus.Expired || Status === EChallengeStatus.Started) {
19
+ return null;
20
+ }
21
+ const barValue = Status === EChallengeStatus.Paused
22
+ ? translate('suspended', this.language)
23
+ : Status === EChallengeStatus.Completed
24
+ ? translate('finished', this.language)
25
+ : `${currLevel.ProgressPercentage}%`;
26
+ const isLastLevel = !LevelProgresses.some((x) => x.OrderNumber > currLevel.OrderNumber);
27
+ const secondImgSrc = Status === EChallengeStatus.Completed ? trophyIcon : isLastLevel ? finishIcon : '';
28
+ return (h("div", { class: {
29
+ progress: true,
30
+ paused: Status === EChallengeStatus.Paused,
31
+ grayed: Status === EChallengeStatus.Forfeited
32
+ } }, h("div", { class: {
33
+ progress__point: true,
34
+ start: true,
35
+ hidden: Status === EChallengeStatus.Completed
36
+ } }, currLevel.OrderNumber + 1), h("div", { class: {
37
+ progress__bar: true,
38
+ finished: Status === EChallengeStatus.Completed
39
+ }, style: { width: `${currLevel.ProgressPercentage}%` } }, barValue), h("div", { class: {
40
+ progress__point: true,
41
+ end: true,
42
+ finished: Status === EChallengeStatus.Completed
43
+ } }, secondImgSrc ? h("img", { class: "progress__icon", src: secondImgSrc }) : currLevel.OrderNumber + 2)));
44
+ }
45
+ render() {
46
+ return h(Host, { key: 'e75584687abe5ea34c8f1e3a66ca09fca73ba8ed' }, this.challengeProgress);
47
+ }
48
+ static get is() { return "casino-challenge-progress-bar"; }
49
+ static get encapsulation() { return "shadow"; }
50
+ static get originalStyleUrls() {
51
+ return {
52
+ "$": ["casino-challenge-progress-bar.scss"]
53
+ };
54
+ }
55
+ static get styleUrls() {
56
+ return {
57
+ "$": ["casino-challenge-progress-bar.css"]
58
+ };
59
+ }
60
+ static get properties() {
61
+ return {
62
+ "challenge": {
63
+ "type": "unknown",
64
+ "mutable": false,
65
+ "complexType": {
66
+ "original": "IChallenge",
67
+ "resolved": "IChallenge",
68
+ "references": {
69
+ "IChallenge": {
70
+ "location": "import",
71
+ "path": "../../utils/types",
72
+ "id": "../../../../packages/stencil/casino-challenge-details/src/utils/types.ts::IChallenge"
73
+ }
74
+ }
75
+ },
76
+ "required": false,
77
+ "optional": false,
78
+ "docs": {
79
+ "tags": [],
80
+ "text": ""
81
+ }
82
+ },
83
+ "isUserAuthorized": {
84
+ "type": "boolean",
85
+ "mutable": false,
86
+ "complexType": {
87
+ "original": "boolean",
88
+ "resolved": "boolean",
89
+ "references": {}
90
+ },
91
+ "required": false,
92
+ "optional": false,
93
+ "docs": {
94
+ "tags": [],
95
+ "text": ""
96
+ },
97
+ "attribute": "is-user-authorized",
98
+ "reflect": false
99
+ },
100
+ "language": {
101
+ "type": "string",
102
+ "mutable": false,
103
+ "complexType": {
104
+ "original": "string",
105
+ "resolved": "string",
106
+ "references": {}
107
+ },
108
+ "required": false,
109
+ "optional": false,
110
+ "docs": {
111
+ "tags": [],
112
+ "text": ""
113
+ },
114
+ "attribute": "language",
115
+ "reflect": false,
116
+ "defaultValue": "'en'"
117
+ }
118
+ };
119
+ }
120
+ }
@@ -0,0 +1 @@
1
+ export * from './components/casino-challenge-details';
@@ -0,0 +1,166 @@
1
+ const DEFAULT_LANGUAGE = 'en';
2
+ const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hr'];
3
+ const TRANSLATIONS = {
4
+ en: {
5
+ title: 'Challenges',
6
+ totalLevels: 'Total levels:',
7
+ endsIn: 'Ends In',
8
+ expired: 'Expired',
9
+ placeBetsOf: 'Place bets of',
10
+ place: 'Place',
11
+ bet: 'bet',
12
+ bets: 'bets',
13
+ minBet: 'min bet',
14
+ forfeited: 'Forfeited',
15
+ finished: 'Finished',
16
+ suspended: 'Suspended',
17
+ completed: 'Completed',
18
+ start: 'Start',
19
+ resume: 'Resume',
20
+ pause: 'Pause',
21
+ join: 'Join to Start',
22
+ congrats: 'Congratulations!',
23
+ forfeitNotification: 'Unfortunately, your progress has been forfeited, and you are no longer eligible to continue this challenge. Check out other available challenges!',
24
+ completedNofitication: "You've successfully completed this challenge! Explore the next one and keep playing to earn more rewards!",
25
+ expiredNotification: "Unfortunately, this challenge has expired and is no longer available to complete. Try another one that’s still active!",
26
+ terms: "Terms & Conditions",
27
+ contribution: 'contribution',
28
+ endDate: 'End Date',
29
+ back: 'Back',
30
+ all: 'All Challenges'
31
+ },
32
+ ro: {
33
+ title: 'Provocări',
34
+ totalLevels: 'Niveluri totale:',
35
+ endsIn: 'Se termină în',
36
+ expired: 'Expirat',
37
+ placeBetsOf: 'Plasează pariuri de',
38
+ place: 'Plasare',
39
+ bet: 'pariu',
40
+ bets: 'pariuri',
41
+ minBet: 'pariu minim',
42
+ forfeited: 'Pierdut',
43
+ finished: 'Terminat',
44
+ suspended: 'Suspendat',
45
+ start: 'Start',
46
+ resume: 'Reia',
47
+ pause: 'Pauză',
48
+ join: 'Alătură-te pentru a începe',
49
+ congrats: "Felicitări!",
50
+ forfeitNotification: "Din păcate, progresul tău a fost abandonat și nu mai poți continua această provocare. Consultă celelalte provocări disponibile!",
51
+ completedNofitication: "Ai finalizat cu succes această provocare! Explorează următoarea și continuă să joci pentru a câștiga mai multe recompense!",
52
+ expiredNotification: "Din păcate, această provocare a expirat și nu mai este disponibilă pentru finalizare. Încearcă una care este încă activă!",
53
+ terms: "Termeni și condiții",
54
+ contribution: "contribuție",
55
+ endDate: "Data de încheiere",
56
+ back: "Înapoi",
57
+ all: "Toate Provocările"
58
+ },
59
+ fr: {
60
+ title: 'Défis',
61
+ totalLevels: 'Niveaux totaux :',
62
+ endsIn: 'Se termine dans',
63
+ expired: 'Expiré',
64
+ placeBetsOf: 'Placez des paris de',
65
+ place: 'Placer',
66
+ bet: 'pari',
67
+ bets: 'paris',
68
+ minBet: 'mise minimale',
69
+ forfeited: 'Forfait',
70
+ finished: 'Terminé',
71
+ suspended: 'Suspendu',
72
+ start: 'Démarrer',
73
+ resume: 'Reprendre',
74
+ pause: 'Pause',
75
+ join: 'Rejoindre pour commencer',
76
+ congrats: "Félicitations !",
77
+ forfeitNotification: "Malheureusement, votre progression a été abandonnée et vous n'êtes plus éligible pour continuer ce défi. Découvrez les autres défis disponibles !",
78
+ completedNofitication: "Vous avez réussi ce défi ! Découvrez le suivant et continuez à jouer pour gagner plus de récompenses !",
79
+ expiredNotification: "Malheureusement, ce défi a expiré et n’est plus disponible à compléter. Essayez-en un autre qui est encore actif !",
80
+ terms: "Termes et conditions",
81
+ contribution: "contribution",
82
+ endDate: "Date de fin",
83
+ back: "Retour",
84
+ all: "Tous les Défis"
85
+ },
86
+ ar: {
87
+ title: 'تحديات',
88
+ totalLevels: 'إجمالي المستويات:',
89
+ endsIn: 'ينتهي في',
90
+ expired: 'منتهي الصلاحية',
91
+ placeBetsOf: 'قم بوضع رهانات بقيمة',
92
+ place: 'ضع',
93
+ bet: 'رهان',
94
+ bets: 'رهانات',
95
+ minBet: 'الحد الأدنى للرهان',
96
+ forfeited: 'خاسر',
97
+ finished: 'منتهي',
98
+ suspended: 'معلق',
99
+ start: 'ابدأ',
100
+ resume: 'استئناف',
101
+ pause: 'إيقاف مؤقت',
102
+ join: 'انضم للبدء',
103
+ congrats: "تهانينا!",
104
+ forfeitNotification: "للأسف، تم التخلي عن تقدمك ولم تعد مؤهلاً لمتابعة هذا التحدي. تحقق من التحديات الأخرى المتاحة!",
105
+ completedNofitication: "لقد أكملت هذا التحدي بنجاح! استكشف التحدي التالي واستمر في اللعب للحصول على مزيد من الجوائز!",
106
+ expiredNotification: "للأسف، هذا التحدي انتهت صلاحيته ولم يعد متاحًا لإكماله. جرّب تحديًا آخر لا يزال نشطًا!",
107
+ terms: "الشروط والأحكام",
108
+ contribution: "مساهمة",
109
+ endDate: "تاريخ الانتهاء",
110
+ back: "عودة",
111
+ all: "جميع التحديات"
112
+ },
113
+ hr: {
114
+ title: 'Izazovi',
115
+ totalLevels: 'Ukupno razina:',
116
+ endsIn: 'Završava za',
117
+ expired: 'Isteklo',
118
+ placeBetsOf: 'Postavite oklade od',
119
+ place: 'Postavi',
120
+ bet: 'kladnja',
121
+ bets: 'kladnje',
122
+ minBet: 'minimalna oklada',
123
+ forfeited: 'Oduzeto',
124
+ finished: 'Završeno',
125
+ suspended: 'Suspendirano',
126
+ start: 'Počni',
127
+ resume: 'Nastavi',
128
+ pause: 'Pauza',
129
+ join: 'Pridruži se za početak',
130
+ congrats: "Čestitamo!",
131
+ forfeitNotification: "Nažalost, tvoj napredak je izgubljen i više nisi podoban nastaviti ovaj izazov. Pogledaj ostale dostupne izazove!",
132
+ completedNofitication: "Uspješno si završio ovaj izazov! Istraži sljedeći i nastavi igrati kako bi zaradio/la više nagrada!",
133
+ expiredNotification: "Nažalost, ovaj izazov je istekao i više nije dostupan za dovršavanje. Probaj neki drugi koji je još aktivan!",
134
+ terms: "Uvjeti i odredbe",
135
+ contribution: "doprinos",
136
+ endDate: "Datum završetka",
137
+ back: "Nazad",
138
+ all: "Svi Izazovi"
139
+ }
140
+ };
141
+ export const translate = (key, customLang) => {
142
+ const lang = customLang;
143
+ return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
144
+ };
145
+ export const getTranslations = (data) => {
146
+ Object.keys(data).forEach((item) => {
147
+ for (let key in data[item]) {
148
+ TRANSLATIONS[item][key] = data[item][key];
149
+ }
150
+ });
151
+ };
152
+ export const resolveTranslationUrl = async (translationUrl) => {
153
+ if (translationUrl) {
154
+ try {
155
+ const response = await fetch(translationUrl);
156
+ if (!response.ok) {
157
+ throw new Error(`HTTP error! status: ${response.status}`);
158
+ }
159
+ const translations = await response.json();
160
+ getTranslations(translations);
161
+ }
162
+ catch (error) {
163
+ console.error('Failed to fetch or parse translations from URL:', error);
164
+ }
165
+ }
166
+ };