@everymatrix/lottery-ticket-controller 0.1.23 → 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 (58) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/helper-accordion_5.cjs.entry.js +574 -671
  3. package/dist/cjs/index-2275f129.js +1304 -0
  4. package/dist/cjs/loader.cjs.js +7 -13
  5. package/dist/cjs/lottery-ticket-controller.cjs.js +17 -11
  6. package/dist/collection/collection-manifest.json +3 -3
  7. package/dist/collection/components/lottery-ticket-controller/index.js +1 -0
  8. package/dist/collection/components/lottery-ticket-controller/lottery-ticket-controller.css +182 -0
  9. package/dist/collection/components/lottery-ticket-controller/lottery-ticket-controller.js +371 -376
  10. package/dist/collection/utils/locale.utils.js +18 -15
  11. package/dist/collection/utils/utils.js +1 -1
  12. package/dist/esm/app-globals-0f993ce5.js +3 -0
  13. package/dist/esm/helper-accordion_5.entry.js +574 -671
  14. package/dist/esm/index-cf1a7f99.js +1277 -0
  15. package/dist/esm/loader.js +7 -13
  16. package/dist/esm/lottery-ticket-controller.js +14 -11
  17. package/dist/lottery-ticket-controller/lottery-ticket-controller.esm.js +1 -1
  18. package/dist/lottery-ticket-controller/p-1846ecd7.entry.js +1 -0
  19. package/dist/lottery-ticket-controller/p-e1255160.js +1 -0
  20. package/dist/lottery-ticket-controller/p-ee226061.js +2 -0
  21. package/dist/stencil.config.dev.js +17 -0
  22. package/dist/stencil.config.js +14 -19
  23. package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/lottery-ticket-controller/.stencil/packages/stencil/lottery-ticket-controller/stencil.config.d.ts +2 -0
  24. package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/lottery-ticket-controller/.stencil/packages/stencil/lottery-ticket-controller/stencil.config.dev.d.ts +2 -0
  25. package/dist/types/components/lottery-ticket-controller/index.d.ts +1 -0
  26. package/dist/types/components/lottery-ticket-controller/lottery-ticket-controller.d.ts +70 -66
  27. package/dist/types/components.d.ts +24 -1
  28. package/dist/types/stencil-public-runtime.d.ts +142 -33
  29. package/loader/cdn.js +1 -3
  30. package/loader/index.cjs.js +1 -3
  31. package/loader/index.d.ts +13 -1
  32. package/loader/index.es2017.js +1 -3
  33. package/loader/index.js +1 -3
  34. package/loader/package.json +1 -0
  35. package/package.json +11 -4
  36. package/dist/cjs/index-dd94b8db.js +0 -1275
  37. package/dist/components/helper-accordion.js +0 -6
  38. package/dist/components/helper-accordion2.js +0 -156
  39. package/dist/components/index.d.ts +0 -26
  40. package/dist/components/index.js +0 -1
  41. package/dist/components/lottery-bullet.js +0 -6
  42. package/dist/components/lottery-bullet2.js +0 -91
  43. package/dist/components/lottery-grid.js +0 -6
  44. package/dist/components/lottery-grid2.js +0 -236
  45. package/dist/components/lottery-ticket-controller.d.ts +0 -11
  46. package/dist/components/lottery-ticket-controller.js +0 -176
  47. package/dist/components/lottery-ticket.js +0 -6
  48. package/dist/components/lottery-ticket2.js +0 -263
  49. package/dist/esm/index-74cef6d4.js +0 -1249
  50. package/dist/esm/polyfills/core-js.js +0 -11
  51. package/dist/esm/polyfills/css-shim.js +0 -1
  52. package/dist/esm/polyfills/dom.js +0 -79
  53. package/dist/esm/polyfills/es5-html-element.js +0 -1
  54. package/dist/esm/polyfills/index.js +0 -34
  55. package/dist/esm/polyfills/system.js +0 -6
  56. package/dist/lottery-ticket-controller/p-72e48800.js +0 -1
  57. package/dist/lottery-ticket-controller/p-9a5da031.entry.js +0 -1
  58. package/dist/types/Users/dragos.bodea/Documents/everymatrix-prjs/stencil/widgets-stencil/packages/lottery-ticket-controller/.stencil/packages/lottery-ticket-controller/stencil.config.d.ts +0 -2
@@ -2,723 +2,626 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-dd94b8db.js');
5
+ const index = require('./index-2275f129.js');
6
6
 
7
7
  const DEFAULT_LANGUAGE$2 = 'en';
8
- const SUPPORTED_LANGUAGES$2 = ['ro', 'en'];
8
+ const SUPPORTED_LANGUAGES$2 = ['ro', 'en', 'hr'];
9
9
  const TRANSLATIONS$2 = {
10
- en: {
11
- deleteTicket: 'Delete ticket'
12
- },
13
- ro: {
14
- deleteTicket: 'Sterge biletul'
15
- },
16
- fr: {
17
- deleteTicket: 'Supprimer le billet'
18
- },
19
- ar: {
20
- deleteTicket: 'حذف التذكرة'
21
- }
10
+ en: {
11
+ deleteTicket: 'Delete ticket'
12
+ },
13
+ ro: {
14
+ deleteTicket: 'Sterge biletul'
15
+ },
16
+ fr: {
17
+ deleteTicket: 'Supprimer le billet'
18
+ },
19
+ ar: {
20
+ deleteTicket: 'حذف التذكرة'
21
+ },
22
+ hr: {
23
+ deleteTicket: 'Izbriši listić'
24
+ }
22
25
  };
23
26
  const translate$2 = (key, customLang) => {
24
- const lang = customLang;
25
- return TRANSLATIONS$2[lang !== undefined && SUPPORTED_LANGUAGES$2.includes(lang) ? lang : DEFAULT_LANGUAGE$2][key];
27
+ const lang = customLang;
28
+ return TRANSLATIONS$2[lang !== undefined && SUPPORTED_LANGUAGES$2.includes(lang) ? lang : DEFAULT_LANGUAGE$2][key];
26
29
  };
27
30
 
28
- const helperAccordionCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.Header{border-radius:5px;background:#009993;display:flex;gap:30px;border:1px solid #009993;padding:8px 10px;user-select:none;margin-bottom:1px}.Header:hover{background:#00ABA4}.Header .Title,.Header .Subtitle,.Header .Description{margin:0;font-size:14px;color:#fff;text-transform:capitalize}.Header .Expand{margin-left:auto;color:#FFF;width:17px;height:17px;cursor:pointer;text-align:center;transform:rotate(90deg);font-size:20px;user-select:none}.HeaderTicketHistory{border-radius:4px;background:#F1F1F1;display:flex;gap:30px;border:1px solid #009993;padding:8px 10px;user-select:none;margin-bottom:5px}.HeaderTicketHistory:hover{background:#00ABA4}.HeaderTicketHistory .Title,.HeaderTicketHistory .Subtitle,.HeaderTicketHistory .Description{margin:0;font-size:14px;color:#000}.HeaderTicketHistory .Expand{margin-left:auto;color:#FFF;width:17px;height:17px;cursor:pointer;text-align:center;transform:rotate(90deg);font-size:20px;user-select:none}.Content{border-radius:0 0 4px 4px;background:#fff;border:1px solid #009993;padding:10px 15px;user-select:none;color:#000;margin-bottom:10px}.ActionButton{cursor:pointer;display:inline-block;border-radius:4px;margin:20px 0 10px;text-transform:uppercase;font-size:12px;text-align:center;padding:8px 20px;min-width:80px;background:#FF3D00;border:1px solid #FF3D00;color:#FFF}.ActionButton:hover{background:#FF6536;border:1px solid #FF3D00}";
31
+ const helperAccordionCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.Header{border-radius:5px;background:#009993;display:flex;gap:30px;border:1px solid #009993;padding:8px 10px;user-select:none;margin-bottom:1px;cursor:pointer}.Header:hover{background:#00ABA4}.Header .Title,.Header .Subtitle,.Header .Description{margin:0;font-size:14px;color:#fff;text-transform:capitalize}.Header .Expand{margin-left:auto;color:#FFF;width:17px;height:17px;cursor:pointer;text-align:center;transform:rotate(90deg);font-size:20px;user-select:none}.HeaderTicketHistory{border-radius:4px;background:#F1F1F1;display:flex;gap:30px;border:1px solid #009993;padding:8px 10px;user-select:none;margin-bottom:5px;cursor:pointer}.HeaderTicketHistory:hover{background:#00ABA4}.HeaderTicketHistory .Title,.HeaderTicketHistory .Subtitle,.HeaderTicketHistory .Description{margin:0;font-size:14px;color:#000}.HeaderTicketHistory .Expand{margin-left:auto;color:#FFF;width:17px;height:17px;cursor:pointer;text-align:center;transform:rotate(90deg);font-size:20px;user-select:none}.Content{border-radius:0 0 4px 4px;background:#fff;border:1px solid #009993;padding:10px 15px;user-select:none;color:#000;margin-bottom:10px}.ActionButton{cursor:pointer;display:inline-block;border-radius:4px;margin:20px 0 10px;text-transform:uppercase;font-size:12px;text-align:center;padding:8px 20px;min-width:80px;background:#FF3D00;border:1px solid #FF3D00;color:#FFF}.ActionButton:hover{background:#FF6536;border:1px solid #FF3D00}";
32
+ const HelperAccordionStyle0 = helperAccordionCss;
29
33
 
30
- const Accordion = class {
31
- constructor(hostRef) {
32
- index.registerInstance(this, hostRef);
33
- this.accordionEvent = index.createEvent(this, "helperAccordionAction", 7);
34
- /**
35
- * Flag for ticket history
36
- */
37
- this.ticketHistoryFlag = false;
38
- /**
39
- * Title (top header)
40
- */
41
- this.headerTitle = '';
42
- /**
43
- * SubTitle (top header)
44
- */
45
- this.headerSubtitle = '';
46
- /**
47
- * Description
48
- */
49
- this.description = '';
50
- /**
51
- * Enables footer content
52
- */
53
- this.footer = false;
54
- /**
55
- * Enables footer button for tab deletion
56
- */
57
- this.deleteTab = false;
58
- /**
59
- * Activates postMessages as events for actions from the widget
60
- */
61
- this.postMessage = false;
62
- /**
63
- * Name of the event emitter by the action button
64
- */
65
- this.eventName = 'helperAccordionAction';
66
- /**
67
- * Collapsed
68
- */
69
- this.collapsed = true;
70
- /**
71
- * Language
72
- */
73
- this.language = 'en';
74
- /**
75
- * Client custom styling via string
76
- */
77
- this.clientStyling = '';
78
- /**
79
- * Client custom styling via url content
80
- */
81
- this.clientStylingUrlContent = '';
82
- this.limitStylingAppends = false;
83
- this.setClientStyling = () => {
84
- let sheet = document.createElement('style');
85
- sheet.innerHTML = this.clientStyling;
86
- this.stylingContainer.prepend(sheet);
87
- };
88
- this.setClientStylingURL = () => {
89
- let cssFile = document.createElement('style');
90
- setTimeout(() => {
91
- cssFile.innerHTML = this.clientStylingUrlContent;
92
- this.stylingContainer.prepend(cssFile);
93
- }, 1);
94
- };
95
- }
96
- // @TODO fix the `any` type :)
97
- connectedCallback() {
98
- this.showContent = !this.collapsed;
99
- }
100
- componentDidRender() {
101
- // start custom styling area
102
- if (!this.limitStylingAppends && this.stylingContainer) {
103
- if (this.clientStyling)
104
- this.setClientStyling();
105
- if (this.clientStylingUrlContent)
106
- this.setClientStylingURL();
107
- this.limitStylingAppends = true;
108
- }
109
- // end custom styling area
110
- }
111
- toggleContent() {
112
- this.showContent = !this.showContent;
113
- }
114
- deleteAction() {
115
- if (this.postMessage) {
116
- // @TODO maybe change the name type, this one sucks
117
- window.postMessage({ type: this.eventName }, window.location.href);
118
- }
119
- this.accordionEvent.emit();
120
- }
121
- render() {
122
- return (index.h("div", { class: "Wrapper", ref: el => this.stylingContainer = el }, index.h("div", { class: this.ticketHistoryFlag === true ? 'HeaderTicketHistory' : 'Header' }, index.h("p", { class: "Title" }, this.headerTitle), index.h("p", { class: "Subtitle" }, this.headerSubtitle), index.h("p", { class: "Subtitle Description" }, this.description), index.h("span", { class: "Expand", onClick: () => this.toggleContent() }, this.showContent ? '<' : '>')), this.showContent &&
123
- index.h("div", null, index.h("div", { class: "Content" }, index.h("slot", { name: 'accordionContent' }), this.footer && this.showContent &&
124
- index.h("div", null, this.deleteTab &&
125
- index.h("span", { class: "ActionButton", onClick: () => this.deleteAction() }, translate$2('deleteTicket', this.language)))))));
126
- }
34
+ const HelperAccordion = class {
35
+ constructor(hostRef) {
36
+ index.registerInstance(this, hostRef);
37
+ this.accordionEvent = index.createEvent(this, "helperAccordionAction", 7);
38
+ this.setClientStyling = () => {
39
+ let sheet = document.createElement('style');
40
+ sheet.innerHTML = this.clientStyling;
41
+ this.stylingContainer.prepend(sheet);
42
+ };
43
+ this.setClientStylingURL = () => {
44
+ let cssFile = document.createElement('style');
45
+ setTimeout(() => {
46
+ cssFile.innerHTML = this.clientStylingUrlContent;
47
+ this.stylingContainer.prepend(cssFile);
48
+ }, 1);
49
+ };
50
+ this.ticketHistoryFlag = false;
51
+ this.headerTitle = '';
52
+ this.headerSubtitle = '';
53
+ this.description = '';
54
+ this.footer = false;
55
+ this.deleteTab = false;
56
+ this.postMessage = false;
57
+ this.eventName = 'helperAccordionAction';
58
+ this.collapsed = true;
59
+ this.language = 'en';
60
+ this.clientStyling = '';
61
+ this.clientStylingUrlContent = '';
62
+ this.showContent = undefined;
63
+ this.limitStylingAppends = false;
64
+ }
65
+ // @TODO fix the `any` type :)
66
+ connectedCallback() {
67
+ this.showContent = !this.collapsed;
68
+ }
69
+ componentDidRender() {
70
+ // start custom styling area
71
+ if (!this.limitStylingAppends && this.stylingContainer) {
72
+ if (this.clientStyling)
73
+ this.setClientStyling();
74
+ if (this.clientStylingUrlContent)
75
+ this.setClientStylingURL();
76
+ this.limitStylingAppends = true;
77
+ }
78
+ // end custom styling area
79
+ }
80
+ toggleContent() {
81
+ this.showContent = !this.showContent;
82
+ }
83
+ deleteAction() {
84
+ if (this.postMessage) {
85
+ // @TODO maybe change the name type, this one sucks
86
+ window.postMessage({ type: this.eventName }, window.location.href);
87
+ }
88
+ this.accordionEvent.emit();
89
+ }
90
+ render() {
91
+ return (index.h("div", { key: 'ad26faefd6e3dd089171c7e2bff13faa5a26d972', class: "Wrapper", ref: el => this.stylingContainer = el }, index.h("div", { key: 'bb7045653ec12a2526029589744f7ef014ec6a6a', class: this.ticketHistoryFlag === true ? 'HeaderTicketHistory' : 'Header', onClick: () => this.toggleContent() }, index.h("p", { key: 'ae30943582063e368e942124d8d5acadc1732629', class: "Title" }, this.headerTitle), index.h("p", { key: '7c35076cb768de784177988900c61fe40a71594c', class: "Subtitle" }, this.headerSubtitle), index.h("p", { key: 'daff2b456a427f45b00efc32ba33a68cdc2228f0', class: "Subtitle Description" }, this.description), index.h("span", { key: '0c4f942642da6e8b1ac3d2aeac46034963965d8f', class: "Expand" }, this.showContent ? '<' : '>')), this.showContent &&
92
+ index.h("div", { key: 'c688ab7cc629a3974b905a2fdc43063e996a3b90' }, index.h("div", { key: 'aaa3ad7d9f1503b8e1baaa2c756376a580ffe261', class: "Content" }, index.h("slot", { key: '8c5c8ff70857da9414c7284b052a3fbc5f503f4a', name: 'accordionContent' }), this.footer && this.showContent &&
93
+ index.h("div", { key: '917191f55a45647d708a5e3ff5e188c7e565a0c0' }, this.deleteTab &&
94
+ index.h("span", { key: 'e7fdd5b4f18cacaceda206b36ce9576cc3fc1472', class: "ActionButton", onClick: () => this.deleteAction() }, translate$2('deleteTicket', this.language)))))));
95
+ }
127
96
  };
128
- Accordion.style = helperAccordionCss;
97
+ HelperAccordion.style = HelperAccordionStyle0;
129
98
 
130
- const lotteryBulletCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}@-webkit-keyframes Circle{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes Circle{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes hover-rotate{0%{-webkit-transform:scale(1) rotateZ(0);transform:scale(1) rotateZ(0)}50%{-webkit-transform:scale(1.2) rotateZ(180deg);transform:scale(1.22) rotateZ(180deg)}100%{-webkit-transform:scale(1) rotateZ(360deg);transform:scale(1) rotateZ(360deg)}}@keyframes hover-rotate{0%{-webkit-transform:scale(1) rotateZ(0);transform:scale(1) rotateZ(0)}50%{-webkit-transform:scale(1.2) rotateZ(180deg);transform:scale(1.2) rotateZ(180deg)}100%{-webkit-transform:scale(1) rotateZ(360deg);transform:scale(1) rotateZ(360deg)}}@-webkit-keyframes selected-scaleUp{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1.2);transform:scale(1.2)}}@keyframes selected-scaleUp{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}.Circle{-webkit-animation:Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;cursor:pointer;color:#000000;display:block;height:30px;width:30px;margin:0;display:flex;align-items:center;justify-content:center;justify-content:center;align-items:center;border:solid 2px #ffffff;background:radial-gradient(circle at top, white 0%, white 100%);font-weight:bold;border-radius:50%;box-shadow:0 2px 4px 0 rgba(0, 0, 0, 0.5);user-select:none;font-size:16px;line-height:16px;font-weight:600;position:relative}.Circle:hover{-webkit-animation:hover-rotate 0.4s linear both;animation:hover-rotate 0.4s linear both;background:radial-gradient(circle at top, white 0%, #f1f1f1 100%)}.Circle.Selected{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#ffffff;background:#9EC258;background:-webkit-radial-gradient(top, #00958f, #004D4A);background:-moz-radial-gradient(top, #00958f, #004D4A);background:radial-gradient(to bottom, #00958f, #004D4A);border:solid 2px #00958f}.Circle.Disabled{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#f1f1f1;background:#D4D4D4;border:solid 2px #D4D4D4;cursor:default}.Circle.DisabledSelected{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#f1f1f1;background:#9EC258;background:-webkit-radial-gradient(top, #00958f, #004D4A);background:-moz-radial-gradient(top, #00958f, #004D4A);background:radial-gradient(to bottom, #00958f, #004D4A);border:solid 2px #D4D4D4;cursor:default}";
99
+ const lotteryBulletCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}@-webkit-keyframes Circle{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes Circle{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes hover-rotate{0%{-webkit-transform:scale(1) rotateZ(0);transform:scale(1) rotateZ(0)}50%{-webkit-transform:scale(1.2) rotateZ(180deg);transform:scale(1.22) rotateZ(180deg)}100%{-webkit-transform:scale(1) rotateZ(360deg);transform:scale(1) rotateZ(360deg)}}@keyframes hover-rotate{0%{-webkit-transform:scale(1) rotateZ(0);transform:scale(1) rotateZ(0)}50%{-webkit-transform:scale(1.2) rotateZ(180deg);transform:scale(1.2) rotateZ(180deg)}100%{-webkit-transform:scale(1) rotateZ(360deg);transform:scale(1) rotateZ(360deg)}}@-webkit-keyframes selected-scaleUp{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1.2);transform:scale(1.2)}}@keyframes selected-scaleUp{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}.Circle{-webkit-animation:Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;cursor:pointer;color:#000000;display:block;height:30px;width:30px;margin:0;display:flex;align-items:center;justify-content:center;justify-content:center;align-items:center;border:solid 2px #ffffff;background:radial-gradient(circle at top, rgb(255, 255, 255) 0%, rgb(255, 255, 255) 100%);font-weight:bold;border-radius:50%;box-shadow:0 2px 4px 0 rgba(0, 0, 0, 0.5);user-select:none;font-size:16px;line-height:16px;font-weight:600;position:relative}.Circle:hover{-webkit-animation:hover-rotate 0.4s linear both;animation:hover-rotate 0.4s linear both;background:radial-gradient(circle at top, rgb(255, 255, 255) 0%, rgb(241, 241, 241) 100%)}.Circle.Selected{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#ffffff;background:#9EC258;background:-webkit-radial-gradient(top, #00958f, #004D4A);background:-moz-radial-gradient(top, #00958f, #004D4A);background:radial-gradient(to bottom, #00958f, #004D4A);border:solid 2px #00958f}.Circle.Disabled{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#f1f1f1;background:#D4D4D4;border:solid 2px #D4D4D4;cursor:default}.Circle.DisabledSelected{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#f1f1f1;background:#9EC258;background:-webkit-radial-gradient(top, #00958f, #004D4A);background:-moz-radial-gradient(top, #00958f, #004D4A);background:radial-gradient(to bottom, #00958f, #004D4A);border:solid 2px #D4D4D4;cursor:default}";
100
+ const LotteryBulletStyle0 = lotteryBulletCss;
131
101
 
132
102
  const LotteryBullet = class {
133
- constructor(hostRef) {
134
- index.registerInstance(this, hostRef);
135
- this.bulletEvent = index.createEvent(this, "lotteryBulletSelection", 7);
136
- /**
137
- * Value of the bullet
138
- */
139
- this.value = '0';
140
- /**
141
- * Marks if the bullet should be selectable
142
- */
143
- this.selectable = true;
144
- /**
145
- * Marks if the bullet should be selected
146
- */
147
- this.isSelected = false;
148
- /**
149
- * Client custom styling via string
150
- */
151
- this.clientStyling = '';
152
- /**
153
- * Client custom styling via url content
154
- */
155
- this.clientStylingUrlContent = '';
156
- this.limitStylingAppends = false;
157
- this.select = () => {
158
- if (this.selectable) {
159
- this.isSelected = !this.isSelected;
160
- this.bulletEvent.emit({
161
- value: this.value,
162
- selected: this.isSelected
163
- });
164
- }
165
- };
166
- this.setClientStyling = () => {
167
- let sheet = document.createElement('style');
168
- sheet.innerHTML = this.clientStyling;
169
- this.stylingContainer.prepend(sheet);
170
- };
171
- this.setClientStylingURL = () => {
172
- let cssFile = document.createElement('style');
173
- setTimeout(() => {
174
- cssFile.innerHTML = this.clientStylingUrlContent;
175
- this.stylingContainer.prepend(cssFile);
176
- }, 1);
177
- };
178
- }
179
- componentDidRender() {
180
- // start custom styling area
181
- if (!this.limitStylingAppends && this.stylingContainer) {
182
- if (this.clientStyling)
183
- this.setClientStyling();
184
- if (this.clientStylingUrlContent)
185
- this.setClientStylingURL();
186
- this.limitStylingAppends = true;
187
- }
188
- // end custom styling area
189
- }
190
- render() {
191
- return (index.h("div", { class: 'Circle ' + (this.selectable ? '' : 'Disabled') + (this.isSelected ? 'Selected' : ''), onClick: () => this.select(), ref: el => this.stylingContainer = el }, this.value));
192
- }
103
+ constructor(hostRef) {
104
+ index.registerInstance(this, hostRef);
105
+ this.bulletEvent = index.createEvent(this, "lotteryBulletSelection", 7);
106
+ this.select = () => {
107
+ if (this.selectable) {
108
+ this.isSelected = !this.isSelected;
109
+ this.bulletEvent.emit({
110
+ value: this.value,
111
+ selected: this.isSelected
112
+ });
113
+ }
114
+ };
115
+ this.setClientStyling = () => {
116
+ let sheet = document.createElement('style');
117
+ sheet.innerHTML = this.clientStyling;
118
+ this.stylingContainer.prepend(sheet);
119
+ };
120
+ this.setClientStylingURL = () => {
121
+ let cssFile = document.createElement('style');
122
+ setTimeout(() => {
123
+ cssFile.innerHTML = this.clientStylingUrlContent;
124
+ this.stylingContainer.prepend(cssFile);
125
+ }, 1);
126
+ };
127
+ this.value = '0';
128
+ this.selectable = true;
129
+ this.isSelected = false;
130
+ this.clientStyling = '';
131
+ this.clientStylingUrlContent = '';
132
+ this.limitStylingAppends = false;
133
+ }
134
+ componentDidRender() {
135
+ // start custom styling area
136
+ if (!this.limitStylingAppends && this.stylingContainer) {
137
+ if (this.clientStyling)
138
+ this.setClientStyling();
139
+ if (this.clientStylingUrlContent)
140
+ this.setClientStylingURL();
141
+ this.limitStylingAppends = true;
142
+ }
143
+ // end custom styling area
144
+ }
145
+ render() {
146
+ return (index.h("div", { key: 'af3601684ecf1f39d65fc9461430cba96b9e4b8c', class: 'Circle ' + (this.selectable ? '' : 'Disabled') + (this.isSelected ? 'Selected' : ''), onClick: () => this.select(), ref: el => this.stylingContainer = el }, this.value));
147
+ }
193
148
  };
194
- LotteryBullet.style = lotteryBulletCss;
149
+ LotteryBullet.style = LotteryBulletStyle0;
195
150
 
196
151
  const lotteryGridCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.GridContainer{display:flex;flex-direction:column;max-width:1200px}.Grid{margin-top:10px 0 10px 0;display:flex;flex-direction:row;flex-wrap:wrap;gap:20px}.Grid.TicketGrid{gap:5px}";
152
+ const LotteryGridStyle0 = lotteryGridCss;
197
153
 
198
154
  const LotteryGrid = class {
199
- constructor(hostRef) {
200
- index.registerInstance(this, hostRef);
201
- this.gridFilledEvent = index.createEvent(this, "gridFilled", 7);
202
- this.gridDirtyEvent = index.createEvent(this, "gridDirty", 7);
203
- /**
204
- * Number of bullets of grid
205
- */
206
- this.totalNumbers = 0;
207
- /**
208
- * Number of maximum bullets that can be selected
209
- */
210
- this.maximumAllowed = 0;
211
- /**
212
- * Minimum allowed of bullets
213
- */
214
- this.minimumAllowed = 1;
215
- /**
216
- * Allows the user to select numbers on the grid
217
- */
218
- this.selectable = true;
219
- /**
220
- * Numbers that should be showed as selected on the grid (as a string of those numbers e.g. '1,2,3,4,5,6')
221
- */
222
- this.selectedNumbers = '';
223
- /**
224
- * Show only selected numbers
225
- */
226
- this.displaySelected = false;
227
- /**
228
- * Language
229
- */
230
- this.language = 'en';
231
- /**
232
- * Personalize grid for ticket
233
- */
234
- this.gridType = '';
235
- /**
236
- * Client custom styling via string
237
- */
238
- this.clientStyling = '';
239
- /**
240
- * Client custom styling via url content
241
- */
242
- this.clientStylingUrlContent = '';
243
- this.numbers = [];
244
- this.limitStylingAppends = false;
245
- this.selectedCounter = 0;
246
- this.setClientStyling = () => {
247
- let sheet = document.createElement('style');
248
- sheet.innerHTML = this.clientStyling;
249
- this.stylingContainer.prepend(sheet);
250
- };
251
- this.setClientStylingURL = () => {
252
- let cssFile = document.createElement('style');
253
- setTimeout(() => {
254
- cssFile.innerHTML = this.clientStylingUrlContent;
255
- this.stylingContainer.prepend(cssFile);
256
- }, 1);
257
- };
258
- }
259
- connectedCallback() {
260
- let selected = [];
261
- if (this.selectedNumbers.length > 0) {
262
- selected = this.selectedNumbers.split(',');
263
- this.selectedCounter = selected.length;
264
- }
265
- if (this.displaySelected) {
266
- selected.forEach((item) => {
267
- this.numbers.push({
268
- number: item,
269
- selected: true,
270
- selectable: this.selectable
271
- });
272
- });
273
- }
274
- else {
275
- [...Array(this.totalNumbers).keys()]
276
- .map(number => (number + 1).toString())
277
- .forEach((number) => {
278
- this.numbers.push({
279
- number,
280
- selected: selected.indexOf(number) >= 0 ? true : false,
281
- selectable: this.selectedCounter == this.maximumAllowed ? false : this.selectable
282
- });
283
- });
284
- }
285
- }
286
- componentDidRender() {
287
- // start custom styling area
288
- if (!this.limitStylingAppends && this.stylingContainer) {
289
- if (this.clientStyling)
290
- this.setClientStyling();
291
- if (this.clientStylingUrlContent)
292
- this.setClientStylingURL();
293
- this.limitStylingAppends = true;
294
- }
295
- // end custom styling area
296
- }
297
- lotteryBulletSelectionHandler(event) {
298
- this.numbers = this.numbers.map((item) => {
299
- if (item.number == event.detail.value) {
300
- return {
301
- number: item.number,
302
- selected: event.detail.selected,
303
- selectable: item.selectable
155
+ constructor(hostRef) {
156
+ index.registerInstance(this, hostRef);
157
+ this.gridFilledEvent = index.createEvent(this, "gridFilled", 7);
158
+ this.gridDirtyEvent = index.createEvent(this, "gridDirty", 7);
159
+ this.selectedCounter = 0;
160
+ this.setClientStyling = () => {
161
+ let sheet = document.createElement('style');
162
+ sheet.innerHTML = this.clientStyling;
163
+ this.stylingContainer.prepend(sheet);
304
164
  };
305
- }
306
- return {
307
- number: item.number,
308
- selected: item.selected,
309
- selectable: item.selectable
310
- };
311
- });
312
- if (event.detail.selected) {
313
- this.selectedCounter += 1;
314
- if (this.selectedCounter == this.maximumAllowed) {
315
- this.numbers = this.numbers.map((item) => {
316
- return {
317
- number: item.number,
318
- selected: item.selected,
319
- selectable: item.selected ? true : false
320
- };
321
- });
322
- this.gridFilledEvent.emit({
323
- id: this.ticketId,
324
- index: this.gridIndex,
325
- selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
326
- });
327
- }
165
+ this.setClientStylingURL = () => {
166
+ let cssFile = document.createElement('style');
167
+ setTimeout(() => {
168
+ cssFile.innerHTML = this.clientStylingUrlContent;
169
+ this.stylingContainer.prepend(cssFile);
170
+ }, 1);
171
+ };
172
+ this.ticketId = undefined;
173
+ this.totalNumbers = 0;
174
+ this.gameId = undefined;
175
+ this.maximumAllowed = 0;
176
+ this.minimumAllowed = 1;
177
+ this.selectable = true;
178
+ this.selectedNumbers = '';
179
+ this.displaySelected = false;
180
+ this.language = 'en';
181
+ this.gridIndex = undefined;
182
+ this.gridType = '';
183
+ this.clientStyling = '';
184
+ this.clientStylingUrlContent = '';
185
+ this.numbers = [];
186
+ this.limitStylingAppends = false;
187
+ }
188
+ connectedCallback() {
189
+ let selected = [];
190
+ if (this.selectedNumbers.length > 0) {
191
+ selected = this.selectedNumbers.split(',');
192
+ this.selectedCounter = selected.length;
193
+ }
194
+ if (this.displaySelected) {
195
+ selected.forEach((item) => {
196
+ this.numbers.push({
197
+ number: item,
198
+ selected: true,
199
+ selectable: this.selectable
200
+ });
201
+ });
202
+ }
203
+ else {
204
+ [...Array(this.totalNumbers).keys()]
205
+ .map(number => (number + 1).toString())
206
+ .forEach((number) => {
207
+ this.numbers.push({
208
+ number,
209
+ selected: selected.indexOf(number) >= 0 ? true : false,
210
+ selectable: this.selectedCounter == this.maximumAllowed ? false : this.selectable
211
+ });
212
+ });
213
+ }
214
+ }
215
+ componentDidRender() {
216
+ // start custom styling area
217
+ if (!this.limitStylingAppends && this.stylingContainer) {
218
+ if (this.clientStyling)
219
+ this.setClientStyling();
220
+ if (this.clientStylingUrlContent)
221
+ this.setClientStylingURL();
222
+ this.limitStylingAppends = true;
223
+ }
224
+ // end custom styling area
328
225
  }
329
- else {
330
- if (this.selectedCounter == this.maximumAllowed) {
226
+ // wrote this because the classic .sort(() => 0.5 - Math.random()) method yielded low entropy shuffles for some reason on certain devices
227
+ shuffleArray(array) {
228
+ const result = [];
229
+ while (array.length > 0) {
230
+ const randomIndex = Math.floor(Math.random() * (array.length));
231
+ result.push(array.splice(randomIndex, 1)[0]);
232
+ }
233
+ return result;
234
+ }
235
+ lotteryBulletSelectionHandler(event) {
331
236
  this.numbers = this.numbers.map((item) => {
332
- return {
333
- number: item.number,
334
- selected: item.selected,
335
- selectable: true
336
- };
337
- });
338
- this.gridDirtyEvent.emit({
339
- id: this.ticketId,
340
- index: this.gridIndex,
341
- selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
237
+ if (item.number == event.detail.value) {
238
+ return {
239
+ number: item.number,
240
+ selected: event.detail.selected,
241
+ selectable: item.selectable
242
+ };
243
+ }
244
+ return {
245
+ number: item.number,
246
+ selected: item.selected,
247
+ selectable: item.selectable
248
+ };
342
249
  });
343
- }
344
- this.selectedCounter -= 1;
345
- }
346
- }
347
- async resetSelectionHandler(event) {
348
- if (event.detail && event.detail == this.ticketId) {
349
- this.selectedCounter = 0;
350
- this.numbers = this.numbers.map((item) => {
351
- return {
352
- number: item.number,
353
- selected: false,
354
- selectable: this.selectable
355
- };
356
- });
357
- this.gridDirtyEvent.emit({
358
- id: this.ticketId,
359
- index: this.gridIndex,
360
- selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
361
- });
362
- }
363
- }
364
- async autoSelectionHandler(event) {
365
- if (event.detail && event.detail == this.ticketId) {
366
- this.resetSelectionHandler(event);
367
- let array = [...Array(this.totalNumbers).keys()]
368
- .map(number => number + 1)
369
- .sort(() => 0.5 - Math.random());
370
- array = array.slice(0, this.minimumAllowed);
371
- this.numbers = this.numbers.map((item) => {
372
- return {
373
- number: item.number,
374
- selected: array.indexOf(parseInt(item.number, 10)) >= 0 ? true : false,
375
- selectable: array.indexOf(parseInt(item.number, 10)) >= 0 ? true : false,
376
- };
377
- });
378
- this.gridFilledEvent.emit({
379
- id: this.ticketId,
380
- index: this.gridIndex,
381
- selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
382
- });
383
- this.selectedCounter = this.maximumAllowed;
384
- }
385
- }
386
- render() {
387
- return (index.h("div", { class: "GridContainer", ref: el => this.stylingContainer = el }, index.h("div", { class: this.gridType === 'ticket' ? 'Grid TicketGrid' : 'Grid' }, this.numbers.map((item) => index.h("div", null, index.h("lottery-bullet", { value: item.number, selectable: item.selectable, "is-selected": item.selected, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }))))));
388
- }
250
+ if (event.detail.selected) {
251
+ this.selectedCounter += 1;
252
+ if (this.selectedCounter == this.maximumAllowed) {
253
+ this.numbers = this.numbers.map((item) => {
254
+ return {
255
+ number: item.number,
256
+ selected: item.selected,
257
+ selectable: item.selected ? true : false
258
+ };
259
+ });
260
+ this.gridFilledEvent.emit({
261
+ id: this.ticketId,
262
+ index: this.gridIndex,
263
+ selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
264
+ });
265
+ }
266
+ }
267
+ else {
268
+ if (this.selectedCounter == this.maximumAllowed) {
269
+ this.numbers = this.numbers.map((item) => {
270
+ return {
271
+ number: item.number,
272
+ selected: item.selected,
273
+ selectable: true
274
+ };
275
+ });
276
+ this.gridDirtyEvent.emit({
277
+ id: this.ticketId,
278
+ index: this.gridIndex,
279
+ selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
280
+ });
281
+ }
282
+ this.selectedCounter -= 1;
283
+ }
284
+ }
285
+ async resetSelectionHandler(event) {
286
+ if (event.detail && event.detail == this.ticketId) {
287
+ this.selectedCounter = 0;
288
+ this.numbers = this.numbers.map((item) => {
289
+ return {
290
+ number: item.number,
291
+ selected: false,
292
+ selectable: this.selectable
293
+ };
294
+ });
295
+ this.gridDirtyEvent.emit({
296
+ id: this.ticketId,
297
+ index: this.gridIndex,
298
+ selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
299
+ });
300
+ }
301
+ }
302
+ async autoSelectionHandler(event) {
303
+ if (event.detail && event.detail == this.ticketId) {
304
+ this.resetSelectionHandler(event);
305
+ let array = [...Array(this.totalNumbers).keys()]
306
+ .map(number => number + 1);
307
+ array = this.shuffleArray(array);
308
+ array = array.slice(0, this.minimumAllowed);
309
+ this.numbers = this.numbers.map((item) => {
310
+ return {
311
+ number: item.number,
312
+ selected: array.indexOf(parseInt(item.number, 10)) >= 0 ? true : false,
313
+ selectable: array.indexOf(parseInt(item.number, 10)) >= 0 ? true : false,
314
+ };
315
+ });
316
+ this.gridFilledEvent.emit({
317
+ id: this.ticketId,
318
+ index: this.gridIndex,
319
+ selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
320
+ });
321
+ this.selectedCounter = this.maximumAllowed;
322
+ }
323
+ }
324
+ render() {
325
+ return (index.h("div", { key: '54b9187146b5d2625fd5ce7f53f38abf091cd943', class: "GridContainer", ref: el => this.stylingContainer = el }, index.h("div", { key: 'e7e8570557ebaa78edf881cdbc1ed720028cdf6e', class: this.gridType === 'ticket' ? 'Grid TicketGrid' : 'Grid' }, this.numbers.map((item) => index.h("div", null, index.h("lottery-bullet", { value: item.number, selectable: item.selectable, "is-selected": item.selected, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }))))));
326
+ }
389
327
  };
390
- LotteryGrid.style = lotteryGridCss;
328
+ LotteryGrid.style = LotteryGridStyle0;
391
329
 
392
330
  const DEFAULT_LANGUAGE$1 = 'en';
393
- const SUPPORTED_LANGUAGES$1 = ['ro', 'en'];
331
+ const SUPPORTED_LANGUAGES$1 = ['ro', 'en', 'hr'];
394
332
  const TRANSLATIONS$1 = {
395
- en: {
396
- loading: 'Loading, please wait ...',
397
- error: 'It was an error while trying to fetch the data',
398
- grid: 'Grid',
399
- multiplier: 'Multiplier',
400
- numberOfDraws: 'Number of draws',
401
- wagerPerDraw: 'Wager per draw',
402
- resetButton: 'Reset',
403
- autoButton: 'I feel lucky'
404
- },
405
- ro: {
406
- loading: 'Se incarca, va rugam asteptati ...',
407
- error: 'A fost o eroare in timp ce asteptam datele',
408
- grid: 'Grid',
409
- multiplier: 'Multiplicator',
410
- numberOfDraws: 'Numarul de extrageri',
411
- wagerPerDraw: 'Pariul per extragere',
412
- resetButton: 'Reseteaza',
413
- autoButton: 'Ma simt norocos'
414
- },
415
- fr: {
416
- loading: 'Loading, please wait ...',
417
- error: 'It was an error while trying to fetch the data',
418
- grid: 'Grid',
419
- multiplier: 'Multiplier',
420
- numberOfDraws: 'Number of draws',
421
- wagerPerDraw: 'Wager per draw',
422
- resetButton: 'Reset',
423
- autoButton: 'I feel lucky'
424
- },
425
- ar: {
426
- loading: 'Loading, please wait ...',
427
- error: 'It was an error while trying to fetch the data',
428
- grid: 'Grid',
429
- multiplier: 'Multiplier',
430
- numberOfDraws: 'Number of draws',
431
- wagerPerDraw: 'Wager per draw',
432
- resetButton: 'Reset',
433
- autoButton: 'I feel lucky'
434
- }
333
+ en: {
334
+ loading: 'Loading, please wait ...',
335
+ error: 'It was an error while trying to fetch the data',
336
+ grid: 'Grid',
337
+ multiplier: 'Multiplier',
338
+ numberOfDraws: 'Number of draws',
339
+ wagerPerDraw: 'Wager per draw',
340
+ resetButton: 'Reset',
341
+ autoButton: 'I feel lucky'
342
+ },
343
+ ro: {
344
+ loading: 'Se incarca, va rugam asteptati ...',
345
+ error: 'A fost o eroare in timp ce asteptam datele',
346
+ grid: 'Grid',
347
+ multiplier: 'Multiplicator',
348
+ numberOfDraws: 'Numarul de extrageri',
349
+ wagerPerDraw: 'Pariul per extragere',
350
+ resetButton: 'Reseteaza',
351
+ autoButton: 'Ma simt norocos'
352
+ },
353
+ fr: {
354
+ loading: 'Loading, please wait ...',
355
+ error: 'It was an error while trying to fetch the data',
356
+ grid: 'Grid',
357
+ multiplier: 'Multiplier',
358
+ numberOfDraws: 'Number of draws',
359
+ wagerPerDraw: 'Wager per draw',
360
+ resetButton: 'Reset',
361
+ autoButton: 'I feel lucky'
362
+ },
363
+ ar: {
364
+ loading: 'Loading, please wait ...',
365
+ error: 'It was an error while trying to fetch the data',
366
+ grid: 'Grid',
367
+ multiplier: 'Multiplier',
368
+ numberOfDraws: 'Number of draws',
369
+ wagerPerDraw: 'Wager per draw',
370
+ resetButton: 'Reset',
371
+ autoButton: 'I feel lucky'
372
+ },
373
+ hr: {
374
+ loading: 'Učitavanje, molimo pričekajte ...',
375
+ error: 'Došlo je do pogreške prilikom pokušaja dohvaćanja podataka',
376
+ grid: 'Tablica',
377
+ multiplier: 'Multiplikator',
378
+ numberOfDraws: 'Broj izvlačenja',
379
+ wagerPerDraw: 'Ulog po izvlačenju',
380
+ resetButton: 'Resetiraj',
381
+ autoButton: 'Osjećam se sretno'
382
+ }
435
383
  };
436
384
  const translate$1 = (key, customLang) => {
437
- const lang = customLang;
438
- return TRANSLATIONS$1[lang !== undefined && SUPPORTED_LANGUAGES$1.includes(lang) ? lang : DEFAULT_LANGUAGE$1][key];
385
+ const lang = customLang;
386
+ return TRANSLATIONS$1[lang !== undefined && SUPPORTED_LANGUAGES$1.includes(lang) ? lang : DEFAULT_LANGUAGE$1][key];
439
387
  };
440
388
 
441
389
  const lotteryTicketCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.TicketTitle{font-size:16px;font-weight:bold}.ButtonContainer{display:flex;justify-content:flex-end}.Toggle{cursor:pointer;margin-top:20px;display:inline-block}.ToggleSwitch{display:inline-block;background:#707070;border-radius:16px;width:58px;height:24px;position:relative;vertical-align:middle;transition:background 0.25s}.ToggleSwitch:before,.ToggleSwitch:after{content:\"\"}.ToggleSwitch:before{display:block;background:linear-gradient(to bottom, #fff 0%, #F1F1F1 100%);border-radius:50%;box-shadow:0 0 0 1px rgba(0, 0, 0, 0.25);width:16px;height:16px;position:absolute;top:4px;left:4px;transition:left 0.25s}.Toggle:hover .ToggleSwitch:before{background:linear-gradient(to bottom, #fff 0%, #fff 100%);box-shadow:0 0 0 1px rgba(0, 0, 0, 0.5)}.ToggleCheckbox:checked+.ToggleSwitch{background:#00ABA4}.ToggleCheckbox:checked+.ToggleSwitch:before{left:38px}.ToggleCheckbox{position:absolute;visibility:hidden}.Label{margin-right:5px;position:relative;top:2px;font-size:14px;font-weight:lighter;color:#000}input[type=number]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none}.NumberInput,.WagerInput{margin-top:10px;display:inline-flex;align-items:center}.NumberInput,.NumberInput *{box-sizing:border-box}.NumberInput button{cursor:pointer;outline:none;-webkit-appearance:none;border:none;align-items:center;justify-content:center;height:20px;position:relative}.NumberInput button:after{display:inline-block;position:absolute;transform:translate(-50%, -50%) rotate(180deg);align-items:center;text-align:center}.NumberInput button.Plus:after{transform:translate(-50%, -50%) rotate(0deg);width:30px;display:inline-flex;align-items:center;text-align:center}.NumberInput input[type=number],.WagerInput input[type=number]{max-width:50px;display:inline-flex;align-items:center;padding:4px 10px;text-align:center}.NumberInput input[type=number] .WagerInputTitle,.WagerInput input[type=number] .WagerInputTitle{font-size:14px;color:#000;padding:10px}.InputDefault{background-color:#F1F1F1;border-radius:4px;padding:5px;border:solid 1px #D4D4D4;color:#707070}.AutoButton{cursor:pointer;display:inline-block;border-radius:4px;padding:8px 20px;width:max-content;margin:5px 0;border:1px solid #00958f;background:#FFF;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.AutoButton:active{background:#00958f;color:#FFF}.ResetButton{cursor:pointer;display:inline-block;border-radius:4px;padding:8px 20px;width:max-content;margin:5px 0;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0;background:#FF3D00;border:1px solid #FF3D00;color:#FFF}.ResetButton:hover{background:#FF6536;border:1px solid #FF3D00}.TicketGridBullets{background:#f1f1f1;border-radius:4px;padding:20px;margin-top:5px}.TicketGridBullets .TicketGridTitle{margin-top:0px}.Minus{border-radius:4px;width:30px;height:24px !important;margin-right:10px;color:#FFF;background:#009993}.Plus{border-radius:4px;width:30px;height:24px !important;margin-left:10px;color:#FFF;background:#009993}.SelectWrapper{width:auto;padding:5px;margin:0 auto;border:1px solid #ccc;border-radius:5px;position:relative}.SelectButton,.SelectOptions li{display:flex;align-items:center;cursor:pointer}.SelectButton{display:flex;padding:0 5px;border-radius:7px;align-items:center;justify-content:space-between;font-size:14px}.SelectButton span:first-child{padding-right:10px}.SelectExpand{transition:transform 0.3s linear;font-size:12px}.SelectActive .SelectExpand{transform:rotate(180deg)}.SelectContent{display:none;padding:5px;border-radius:7px}.SelectWrapper.SelectActive .SelectContent{width:100%;display:block;position:absolute;left:0;top:32px;padding:0;border:1px solid #ccc;overflow:hidden;background:#fff}.SelectContent .SelectOptions{max-height:100px;margin:0;overflow-y:auto;padding:0}.SelectContent .SelectOptions .SelectedValue{background-color:#009993;color:#fff}.SelectOptions::-webkit-scrollbar{width:7px}.SelectOptions::-webkit-scrollbar-track{background:#f1f1f1;border-radius:25px}.SelectOptions::-webkit-scrollbar-thumb{background:#ccc;border-radius:25px}.SelectOptions li{height:20px;padding:0 13px;font-size:14px}.SelectOptions li:hover{background:#f2f2f2}";
390
+ const LotteryTicketStyle0 = lotteryTicketCss;
442
391
 
443
392
  const LotteryTicket = class {
444
- constructor(hostRef) {
445
- index.registerInstance(this, hostRef);
446
- this.ticketCompleted = index.createEvent(this, "ticketCompleted", 7);
447
- this.autoSelection = index.createEvent(this, "autoSelection", 7);
448
- this.resetSelection = index.createEvent(this, "resetSelection", 7);
449
- this.stakeChange = index.createEvent(this, "stakeChange", 7);
450
- this.multiplierChange = index.createEvent(this, "multiplierChange", 7);
451
- /**
452
- * Number of grids of a ticket
453
- */
454
- this.numberOfGrids = 1;
455
- /**
456
- * Option to have the ticket registered for multiple draws
457
- */
458
- this.multipleDraws = true;
459
- /**
460
- * Shows the reset button
461
- */
462
- this.resetButton = false;
463
- /**
464
- * Shows the auto-pick button
465
- */
466
- this.autoPick = false;
467
- /**
468
- * Language
469
- */
470
- this.language = 'en';
471
- /**
472
- * Client custom styling via string
473
- */
474
- this.clientStyling = '';
393
+ constructor(hostRef) {
394
+ index.registerInstance(this, hostRef);
395
+ this.ticketCompleted = index.createEvent(this, "ticketCompleted", 7);
396
+ this.autoSelection = index.createEvent(this, "autoSelection", 7);
397
+ this.resetSelection = index.createEvent(this, "resetSelection", 7);
398
+ this.stakeChange = index.createEvent(this, "stakeChange", 7);
399
+ this.multiplierChange = index.createEvent(this, "multiplierChange", 7);
400
+ this.setClientStyling = () => {
401
+ let sheet = document.createElement('style');
402
+ sheet.innerHTML = this.clientStyling;
403
+ this.stylingContainer.prepend(sheet);
404
+ };
405
+ this.setClientStylingURL = () => {
406
+ let cssFile = document.createElement('style');
407
+ setTimeout(() => {
408
+ cssFile.innerHTML = this.clientStylingUrlContent;
409
+ this.stylingContainer.prepend(cssFile);
410
+ }, 1);
411
+ };
412
+ this.endpoint = undefined;
413
+ this.gameId = undefined;
414
+ this.numberOfGrids = 1;
415
+ this.multipleDraws = true;
416
+ this.ticketId = undefined;
417
+ this.resetButton = false;
418
+ this.autoPick = false;
419
+ this.language = 'en';
420
+ this.clientStyling = '';
421
+ this.clientStylingUrlContent = '';
422
+ this.multiplier = false;
423
+ this.numberOfDraws = 1;
424
+ this.isLoading = true;
425
+ this.hasErrors = false;
426
+ this.ticketDone = false;
427
+ this.isCustomSelect = false;
428
+ this.amountInfo = {};
429
+ this.limitStylingAppends = false;
430
+ }
475
431
  /**
476
- * Client custom styling via url content
432
+ * @TODO find a better way to implement click outside the custom select, so that we don't have to use the 'data-cluster' attribute on each element
477
433
  */
478
- this.clientStylingUrlContent = '';
479
- this.multiplier = false;
480
- this.numberOfDraws = 1;
481
- this.isLoading = true;
482
- this.hasErrors = false;
483
- this.ticketDone = false;
484
- this.isCustomSelect = false;
485
- this.amountInfo = {};
486
- this.limitStylingAppends = false;
487
- this.setClientStyling = () => {
488
- let sheet = document.createElement('style');
489
- sheet.innerHTML = this.clientStyling;
490
- this.stylingContainer.prepend(sheet);
491
- };
492
- this.setClientStylingURL = () => {
493
- let cssFile = document.createElement('style');
494
- setTimeout(() => {
495
- cssFile.innerHTML = this.clientStylingUrlContent;
496
- this.stylingContainer.prepend(cssFile);
497
- }, 1);
498
- };
499
- }
500
- /**
501
- * @TODO find a better way to implement click outside the custom select, so that we don't have to use the 'data-cluster' attribute on each element
502
- */
503
- checkForClickOutside(ev) {
504
- if (ev.composedPath()[0].getAttribute('data-cluster') !== 'SelectComponent') {
505
- this.isCustomSelect = false;
506
- }
507
- }
508
- connectedCallback() {
509
- let url = new URL(`${this.endpoint}/games/${this.gameId}`);
510
- fetch(url.href)
511
- .then((response) => {
512
- if (response.ok) {
513
- return response.json();
514
- }
515
- else {
516
- // Throw error
517
- this.hasErrors = true;
518
- }
519
- })
520
- .then((data) => {
521
- this.isLoading = false;
522
- this.gameData = data;
523
- this.grids = [...Array(data.rules.boards.length).keys()];
524
- this.amountInfo = this.gameData.rules.stakes[0]; // initial value for select
525
- })
526
- .catch((err) => {
527
- this.isLoading = false;
528
- this.hasErrors = true;
529
- console.error('Error!', err);
530
- });
531
- }
532
- componentDidRender() {
533
- // start custom styling area
534
- if (!this.limitStylingAppends && this.stylingContainer) {
535
- if (this.clientStyling)
536
- this.setClientStyling();
537
- if (this.clientStylingUrlContent)
538
- this.setClientStylingURL();
539
- this.limitStylingAppends = true;
540
- }
541
- // end custom styling area
542
- }
543
- multiplierChangeHandler(e) {
544
- this.multiplier = e.target ? e.target.checked : false;
545
- this.multiplierChange.emit(this.multiplier);
546
- }
547
- drawsChangeHandler(event) {
548
- this.ticket = Object.assign(Object.assign({}, this.ticket), { draws: event });
549
- this.ticketCompleted.emit(this.ticket);
550
- }
551
- gridFilledHandler(event) {
552
- this.ticket = Object.assign(Object.assign({}, event.detail), { draws: this.numberOfDraws });
553
- this.ticketDone = true;
554
- this.ticketCompleted.emit(this.ticket);
555
- }
556
- toggleAutoSelection() {
557
- this.ticketDone = true;
558
- this.autoSelection.emit(this.ticketId);
559
- }
560
- toggleResetSelection() {
561
- this.ticketDone = false;
562
- this.resetSelection.emit(this.ticketId);
563
- }
564
- changeStake(ticketid, amount) {
565
- this.stakeChange.emit({
566
- ticketId: ticketid,
567
- stake: amount
568
- });
569
- }
570
- toggleClass() {
571
- this.isCustomSelect = !this.isCustomSelect;
572
- }
573
- setDropdownItem(item) {
574
- this.amountInfo = {
575
- amount: item.amount,
576
- currency: item.currency
577
- };
578
- this.isCustomSelect = false;
579
- this.changeStake(this.ticketId, item.amount);
580
- }
581
- render() {
582
- if (this.isLoading) {
583
- return (index.h("div", null, index.h("p", null, translate$1('loading', this.language))));
584
- }
585
- else {
586
- if (this.hasErrors) {
587
- return (index.h("div", null, index.h("p", null, translate$1('error', this.language))));
588
- }
589
- else {
590
- const { rules } = this.gameData;
591
- return (index.h("div", { class: "TicketContainer", ref: el => this.stylingContainer = el }, index.h("p", { class: "TicketTitle" }, this.gameData.name), this.resetButton && this.ticketDone &&
592
- index.h("div", { class: "ButtonContainer" }, index.h("a", { class: "ResetButton", onClick: () => this.toggleResetSelection() }, translate$1('resetButton', this.language))), this.autoPick && !this.ticketDone &&
593
- index.h("div", { class: "ButtonContainer" }, index.h("a", { class: "AutoButton", onClick: () => this.toggleAutoSelection() }, translate$1('autoButton', this.language))), this.grids.map((item, index$1) => index.h("div", { class: "TicketGridBullets" }, index.h("p", { class: "TicketGridTitle" }, translate$1('grid', this.language), " ", item), index.h("lottery-grid", { "grid-index": index$1, "maximum-allowed": rules.boards[index$1].maximumAllowed, "minimum-allowed": rules.boards[index$1].minimumAllowed, "total-numbers": rules.boards[index$1].totalNumbers, selectable: true, "reset-button": true, "auto-pick": true, "game-id": this.gameId, "ticket-id": this.ticketId, language: this.language, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }))), rules.multiplier &&
594
- index.h("div", null, index.h("label", { class: "Toggle" }, index.h("label", { class: "Label" }, translate$1('multiplier', this.language), ": "), index.h("input", { class: "ToggleCheckbox", type: "checkbox", onInput: (e) => this.multiplierChangeHandler(e) }), index.h("div", { class: "ToggleSwitch" }))), this.multipleDraws &&
595
- index.h("div", { class: "TicketDraws" }, index.h("label", { class: "Label" }, translate$1('numberOfDraws', this.language), ": "), index.h("div", { class: "NumberInput" }, index.h("button", { onClick: () => this.numberOfDraws > 1 ? this.numberOfDraws-- : this.numberOfDraws = 1, class: "Minus" }, "-"), index.h("input", { class: "InputDefault", min: "1", value: this.numberOfDraws, type: "number" }), index.h("button", { onClick: () => this.numberOfDraws++, class: "Plus" }, "+"))), index.h("div", null, index.h("label", { class: "Label" }, translate$1('wagerPerDraw', this.language), ": "), index.h("div", { class: "WagerInput" }, rules.stakes.length > 1 ?
596
- (index.h("div", { "data-cluster": "SelectComponent", class: this.isCustomSelect ? "SelectWrapper SelectActive" : "SelectWrapper" }, index.h("div", { "data-cluster": "SelectComponent", class: "SelectButton", onClick: () => this.toggleClass() }, index.h("span", { "data-cluster": "SelectComponent" }, this.amountInfo.amount, " ", this.amountInfo.currency), index.h("span", { "data-cluster": "SelectComponent", class: "SelectExpand" }, "\u25BC")), index.h("div", { "data-cluster": "SelectComponent", class: "SelectContent" }, index.h("ul", { "data-cluster": "SelectComponent", class: "SelectOptions" }, rules.stakes.map((item) => index.h("li", { "data-cluster": "SelectComponent", class: this.amountInfo.amount == item.amount ? 'SelectedValue' : '', value: item.amount, onClick: () => this.setDropdownItem(item) }, item.amount, " ", item.currency)))))) : (index.h("div", null, index.h("input", { min: "1", value: rules.stakes[0].amount, type: "number", disabled: true }), index.h("p", { class: "WagerInputTitle" }, rules.stakes[0].currency)))))));
597
- }
598
- }
599
- }
600
- static get watchers() { return {
601
- "numberOfDraws": ["drawsChangeHandler"]
602
- }; }
434
+ checkForClickOutside(ev) {
435
+ if (ev.composedPath()[0].getAttribute('data-cluster') !== 'SelectComponent') {
436
+ this.isCustomSelect = false;
437
+ }
438
+ }
439
+ connectedCallback() {
440
+ let url = new URL(`${this.endpoint}/games/${this.gameId}`);
441
+ fetch(url.href)
442
+ .then((response) => {
443
+ if (response.ok) {
444
+ return response.json();
445
+ }
446
+ else {
447
+ // Throw error
448
+ this.hasErrors = true;
449
+ }
450
+ })
451
+ .then((data) => {
452
+ this.isLoading = false;
453
+ this.gameData = data;
454
+ this.grids = [...Array(this.gameData.type.boards.length).keys()];
455
+ this.amountInfo = this.gameData.type.stakes[0]; // initial value for select
456
+ })
457
+ .catch((err) => {
458
+ this.isLoading = false;
459
+ this.hasErrors = true;
460
+ console.error('Error!', err);
461
+ });
462
+ }
463
+ componentDidRender() {
464
+ // start custom styling area
465
+ if (!this.limitStylingAppends && this.stylingContainer) {
466
+ if (this.clientStyling)
467
+ this.setClientStyling();
468
+ if (this.clientStylingUrlContent)
469
+ this.setClientStylingURL();
470
+ this.limitStylingAppends = true;
471
+ }
472
+ // end custom styling area
473
+ }
474
+ multiplierChangeHandler(e) {
475
+ this.multiplier = e.target ? e.target.checked : false;
476
+ this.multiplierChange.emit(this.multiplier);
477
+ }
478
+ drawsChangeHandler(event) {
479
+ this.ticket = Object.assign(Object.assign({}, this.ticket), { draws: event });
480
+ this.ticketCompleted.emit(this.ticket);
481
+ }
482
+ gridFilledHandler(event) {
483
+ this.ticket = Object.assign(Object.assign({}, event.detail), { draws: this.numberOfDraws });
484
+ this.ticketDone = true;
485
+ this.ticketCompleted.emit(this.ticket);
486
+ }
487
+ toggleAutoSelection() {
488
+ this.ticketDone = true;
489
+ this.autoSelection.emit(this.ticketId);
490
+ }
491
+ toggleResetSelection() {
492
+ this.ticketDone = false;
493
+ this.resetSelection.emit(this.ticketId);
494
+ }
495
+ changeStake(ticketid, amount) {
496
+ this.stakeChange.emit({
497
+ ticketId: ticketid,
498
+ stake: amount
499
+ });
500
+ }
501
+ toggleClass() {
502
+ this.isCustomSelect = !this.isCustomSelect;
503
+ }
504
+ setDropdownItem(item) {
505
+ this.amountInfo = {
506
+ value: item.value,
507
+ currency: item.currency
508
+ };
509
+ this.isCustomSelect = false;
510
+ this.changeStake(this.ticketId, item.amount);
511
+ }
512
+ render() {
513
+ if (this.isLoading) {
514
+ return (index.h("div", null, index.h("p", null, translate$1('loading', this.language))));
515
+ }
516
+ else {
517
+ if (this.hasErrors) {
518
+ return (index.h("div", null, index.h("p", null, translate$1('error', this.language))));
519
+ }
520
+ else {
521
+ const { type } = this.gameData;
522
+ return (index.h("div", { class: "TicketContainer", ref: el => this.stylingContainer = el }, index.h("p", { class: "TicketTitle" }, this.gameData.name), this.resetButton && this.ticketDone &&
523
+ index.h("div", { class: "ButtonContainer" }, index.h("a", { class: "ResetButton", onClick: () => this.toggleResetSelection() }, translate$1('resetButton', this.language))), this.autoPick && !this.ticketDone &&
524
+ index.h("div", { class: "ButtonContainer" }, index.h("a", { class: "AutoButton", onClick: () => this.toggleAutoSelection() }, translate$1('autoButton', this.language))), this.grids.map((_, index$1) => index.h("div", { class: "TicketGridBullets" }, index.h("p", { class: "TicketGridTitle" }, translate$1('grid', this.language), " ", index$1 + 1), index.h("lottery-grid", { "grid-index": index$1, "maximum-allowed": type.boards[index$1].maximumAllowed, "minimum-allowed": type.boards[index$1].minimumAllowed, "total-numbers": type.boards[index$1].highNumber - type.boards[index$1].lowNumber + 1, selectable: true, "reset-button": true, "auto-pick": true, "game-id": this.gameId, "ticket-id": this.ticketId, language: this.language, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }))), type.multiplier &&
525
+ index.h("div", null, index.h("label", { class: "Toggle" }, index.h("label", { class: "Label" }, translate$1('multiplier', this.language), ": "), index.h("input", { class: "ToggleCheckbox", type: "checkbox", onInput: (e) => this.multiplierChangeHandler(e) }), index.h("div", { class: "ToggleSwitch" }))), this.multipleDraws &&
526
+ index.h("div", { class: "TicketDraws" }, index.h("label", { class: "Label" }, translate$1('numberOfDraws', this.language), ": "), index.h("div", { class: "NumberInput" }, index.h("button", { onClick: () => this.numberOfDraws > 1 ? this.numberOfDraws-- : this.numberOfDraws = 1, class: "Minus" }, "-"), index.h("input", { class: "InputDefault", min: "1", value: this.numberOfDraws, type: "number" }), index.h("button", { onClick: () => this.numberOfDraws++, class: "Plus" }, "+"))), index.h("div", null, index.h("label", { class: "Label" }, translate$1('wagerPerDraw', this.language), ": "), index.h("div", { class: "WagerInput" }, type.stakes.length > 1 ?
527
+ (index.h("div", { "data-cluster": "SelectComponent", class: this.isCustomSelect ? "SelectWrapper SelectActive" : "SelectWrapper" }, index.h("div", { "data-cluster": "SelectComponent", class: "SelectButton", onClick: () => this.toggleClass() }, index.h("span", { "data-cluster": "SelectComponent" }, this.amountInfo.value, " ", this.amountInfo.currency), index.h("span", { "data-cluster": "SelectComponent", class: "SelectExpand" }, "\u25BC")), index.h("div", { "data-cluster": "SelectComponent", class: "SelectContent" }, index.h("ul", { "data-cluster": "SelectComponent", class: "SelectOptions" }, type.stakes.map((item) => index.h("li", { "data-cluster": "SelectComponent", class: this.amountInfo.value == item.value ? 'SelectedValue' : '', value: item.value, onClick: () => this.setDropdownItem(item) }, item.value, " ", item.currency)))))) : (index.h("div", null, index.h("input", { min: "1", value: type.stakes[0].amount, type: "number", disabled: true }), index.h("p", { class: "WagerInputTitle" }, type.stakes[0].currency)))))));
528
+ }
529
+ }
530
+ }
531
+ static get watchers() { return {
532
+ "numberOfDraws": ["drawsChangeHandler"]
533
+ }; }
603
534
  };
604
- LotteryTicket.style = lotteryTicketCss;
535
+ LotteryTicket.style = LotteryTicketStyle0;
605
536
 
606
537
  const DEFAULT_LANGUAGE = 'en';
607
- const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar'];
538
+ const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hr'];
608
539
  const TRANSLATIONS = {
609
- en: {
610
- ticket: 'Ticket',
611
- },
612
- ro: {
613
- ticket: 'Bilet',
614
- },
615
- fr: {
616
- ticket: 'Billet'
617
- },
618
- ar: {
619
- ticket: 'تذكرة',
620
- }
540
+ en: {
541
+ ticket: 'Ticket',
542
+ },
543
+ ro: {
544
+ ticket: 'Bilet',
545
+ },
546
+ fr: {
547
+ ticket: 'Billet'
548
+ },
549
+ ar: {
550
+ ticket: 'تذكرة',
551
+ },
552
+ hr: {
553
+ ticket: 'Listić',
554
+ }
621
555
  };
622
556
  const translate = (key, customLang) => {
623
- const lang = customLang;
624
- return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
557
+ const lang = customLang;
558
+ return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
625
559
  };
626
560
 
627
- const lotteryTicketControllerCss = ":host{display:block}";
561
+ const lotteryTicketControllerCss = ":host{font-family:\"Roboto\", system-ui, -apple-system, \"Segoe UI\", Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\";font-size:0.8rem}*,*::before,*::after{margin:0;padding:0;list-style:none;outline:none;box-sizing:border-box}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}.player-account-gaming-limits-popup-2{background:var(--emfe-w-color-black, #000000);color:var(--emfe-w-color-white, #000)}.Title{font-weight:800;font-size:18px}button{display:block;font-size:0.75rem;padding:12px 0;border:0;border-radius:2px;cursor:pointer}button.PrimaryButtonStyle{font-size:14px;color:#fff;background:rgb(122, 195, 23)}button.SecondaryButtonStyle{border:1px solid #999;color:#666;background:#fff}.LinkButton{display:inline;padding:0;color:#3366CC;text-decoration:underline;background-color:rgba(0, 0, 0, 0)}.ResultIconWrapper{display:flex;flex-direction:column;align-items:center;margin:12px 0}.ResultIconWrapper svg{height:auto;width:60px;margin:12px}.ResultIconWrapper p{color:#666}.Overlay{position:absolute;top:0;left:0;width:100vw;height:100vh;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center}.ModalContainer{position:fixed;top:30vh;width:320px;height:auto;padding:18px 14px;background:#fff;border-radius:4px}.InitialWrapper{display:flex;flex-direction:column;gap:12px}.AdditionalInformation{margin:10px 0;font-size:14px}.TermsConditions{font-size:12px}.ExpandButton{font-size:14px;background-color:#fff;border:0;padding:0;margin-top:-10px;color:#999;display:flex;justify-content:center;align-items:center;cursor:pointer}.ExpandButton svg{width:28px;height:auto;margin-left:-4px}.LeftAlign{text-align:left;font-size:16px}.CenterAlign{text-align:center}.SetLimitSection{display:flex;flex-direction:column;gap:6px}.DepositTextSection{display:flex;justify-content:space-between}.DepositInputSection{height:32px;display:flex;gap:4px}.DepositInput{flex-grow:1;padding:0 6px}.SubmitDepositButton{flex-grow:1;font-size:0.75rem;padding:0}.SubmitDepositButton[disabled]{align-items:center;color:#ccc;cursor:not-allowed;background:#fff;border:#ccc 1px solid}.Hidden{display:none}.Extended{transform:rotate(180deg)}";
562
+ const LotteryTicketControllerStyle0 = lotteryTicketControllerCss;
628
563
 
629
564
  const LotteryTicketController = class {
630
- constructor(hostRef) {
631
- index.registerInstance(this, hostRef);
632
- this.deleteTicketEvent = index.createEvent(this, "deleteTicket", 7);
633
- /**
634
- * Endpoint URL for the source of data (NorWAy standard)
635
- */
636
- this.endpoint = '';
637
- /**
638
- * Ticket number
639
- */
640
- this.ticketId = 1;
641
- /**
642
- * Activates postMessages as events for actions from the widget
643
- */
644
- this.postMessage = false;
645
- /**
646
- * Name of the event emitter by the action button
647
- */
648
- this.eventName = 'deleteTicketAction';
649
- /**
650
- * Collapsed
651
- */
652
- this.collapsed = true;
653
- /**
654
- * Number of grids?
655
- */
656
- this.numberOfGrids = 1;
657
- /**
658
- * This toggles if the last ticket added should be expanded or not
659
- */
660
- this.last = false;
661
- /**
662
- * Language
663
- */
664
- this.language = 'en';
665
- /**
666
- * Shows the auto-pick button
667
- */
668
- this.autoPick = false;
669
- /**
670
- * Shows the reset button
671
- */
672
- this.resetButton = false;
673
- /**
674
- * Client custom styling via string
675
- */
676
- this.clientStyling = '';
677
- /**
678
- * Client custom styling via url content
679
- */
680
- this.clientStylingUrlContent = '';
681
- this.limitStylingAppends = false;
682
- this.setClientStyling = () => {
683
- let sheet = document.createElement('style');
684
- sheet.innerHTML = this.clientStyling;
685
- this.stylingContainer.prepend(sheet);
686
- };
687
- this.setClientStylingURL = () => {
688
- let cssFile = document.createElement('style');
689
- setTimeout(() => {
690
- cssFile.innerHTML = this.clientStylingUrlContent;
691
- this.stylingContainer.prepend(cssFile);
692
- }, 1);
693
- };
694
- }
695
- // @TODO fix the `any` type
696
- helperAccordionActionHandler() {
697
- if (this.postMessage) {
698
- window.postMessage({ type: this.eventName }, window.location.href);
699
- }
700
- this.deleteTicketEvent.emit({
701
- ticketId: this.ticketId
702
- });
703
- }
704
- componentDidRender() {
705
- // start custom styling area
706
- if (!this.limitStylingAppends && this.stylingContainer) {
707
- if (this.clientStyling)
708
- this.setClientStyling();
709
- if (this.clientStylingUrlContent)
710
- this.setClientStylingURL();
711
- this.limitStylingAppends = true;
712
- }
713
- // end custom styling area
714
- }
715
- render() {
716
- return (index.h("div", { class: "LotteryTicketControllerContainer", ref: el => this.stylingContainer = el }, index.h("helper-accordion", { "header-title": `${translate('ticket', this.language)} ${this.ticketId}`, "header-subtitle": this.ticketDescription, footer: true, "delete-tab": true, collapsed: !this.last || this.collapsed, language: this.language, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, index.h("div", { slot: "accordionContent" }, index.h("lottery-ticket", { endpoint: this.endpoint, "game-id": this.gameId, "ticket-id": this.ticketId, "number-of-grids": this.numberOfGrids, language: this.language, "reset-button": this.resetButton, "auto-pick": this.autoPick, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })))));
717
- }
565
+ constructor(hostRef) {
566
+ index.registerInstance(this, hostRef);
567
+ this.deleteTicketEvent = index.createEvent(this, "deleteTicket", 7);
568
+ this.setClientStyling = () => {
569
+ let sheet = document.createElement('style');
570
+ sheet.innerHTML = this.clientStyling;
571
+ this.stylingContainer.prepend(sheet);
572
+ };
573
+ this.setClientStylingURL = () => {
574
+ let cssFile = document.createElement('style');
575
+ setTimeout(() => {
576
+ cssFile.innerHTML = this.clientStylingUrlContent;
577
+ this.stylingContainer.prepend(cssFile);
578
+ }, 1);
579
+ };
580
+ this.endpoint = '';
581
+ this.ticketId = 1;
582
+ this.ticketDescription = undefined;
583
+ this.gameId = undefined;
584
+ this.postMessage = false;
585
+ this.eventName = 'deleteTicketAction';
586
+ this.collapsed = true;
587
+ this.numberOfGrids = 1;
588
+ this.last = false;
589
+ this.language = 'en';
590
+ this.autoPick = false;
591
+ this.resetButton = false;
592
+ this.totalControllers = 1;
593
+ this.clientStyling = '';
594
+ this.clientStylingUrlContent = '';
595
+ this.limitStylingAppends = false;
596
+ }
597
+ // @TODO fix the `any` type
598
+ helperAccordionActionHandler() {
599
+ if (this.postMessage) {
600
+ window.postMessage({ type: this.eventName }, window.location.href);
601
+ }
602
+ this.deleteTicketEvent.emit({
603
+ ticketId: this.ticketId
604
+ });
605
+ }
606
+ componentDidRender() {
607
+ // start custom styling area
608
+ if (!this.limitStylingAppends && this.stylingContainer) {
609
+ if (this.clientStyling)
610
+ this.setClientStyling();
611
+ if (this.clientStylingUrlContent)
612
+ this.setClientStylingURL();
613
+ this.limitStylingAppends = true;
614
+ }
615
+ // end custom styling area
616
+ }
617
+ render() {
618
+ console.log('ticket id:', this.ticketId);
619
+ return (index.h("div", { key: '203c89c4b240cd7c99eb3d37fa3a4dbc17ed18e3', class: "LotteryTicketControllerContainer", ref: el => this.stylingContainer = el }, index.h("helper-accordion", { key: 'ad9801b15a1718ff7470ab3084c4b569ad23f6e3', "header-title": `${translate('ticket', this.language)} ${this.ticketId}`, "header-subtitle": this.ticketDescription, footer: true, "delete-tab": this.totalControllers !== 1, collapsed: !this.last || this.collapsed, language: this.language, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, index.h("div", { key: 'b9c618987e848d4b44fee6941f8b5c9696bd44e8', slot: "accordionContent" }, index.h("lottery-ticket", { key: '8acdc3d3cce5b654e7cddd71576c2e993881786f', endpoint: this.endpoint, "game-id": this.gameId, "ticket-id": this.ticketId, "number-of-grids": this.numberOfGrids, language: this.language, "reset-button": this.resetButton, "auto-pick": this.autoPick, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })))));
620
+ }
718
621
  };
719
- LotteryTicketController.style = lotteryTicketControllerCss;
622
+ LotteryTicketController.style = LotteryTicketControllerStyle0;
720
623
 
721
- exports.helper_accordion = Accordion;
624
+ exports.helper_accordion = HelperAccordion;
722
625
  exports.lottery_bullet = LotteryBullet;
723
626
  exports.lottery_grid = LotteryGrid;
724
627
  exports.lottery_ticket = LotteryTicket;