@everymatrix/lottery-game-page 0.1.5 → 0.1.9

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 (73) hide show
  1. package/dist/cjs/helper-accordion.cjs.entry.js +92 -0
  2. package/dist/cjs/{lottery-draw-results.cjs.entry.js → helper-filters_2.cjs.entry.js} +131 -2
  3. package/dist/cjs/helper-modal.cjs.entry.js +1 -1
  4. package/dist/cjs/helper-pagination.cjs.entry.js +188 -0
  5. package/dist/cjs/helper-tab.cjs.entry.js +36 -0
  6. package/dist/cjs/helper-tabs.cjs.entry.js +38 -0
  7. package/dist/cjs/{index-614098f4.js → index-5701a895.js} +47 -1
  8. package/dist/cjs/loader.cjs.js +2 -2
  9. package/dist/cjs/lottery-bullet_2.cjs.entry.js +202 -0
  10. package/dist/cjs/lottery-draw-results-history.cjs.entry.js +161 -0
  11. package/dist/cjs/lottery-game-details.cjs.entry.js +19 -0
  12. package/dist/cjs/lottery-game-page.cjs.entry.js +1 -4
  13. package/dist/cjs/lottery-game-page.cjs.js +2 -2
  14. package/dist/cjs/lottery-ticket-controller.cjs.entry.js +69 -0
  15. package/dist/cjs/lottery-ticket.cjs.entry.js +169 -0
  16. package/dist/collection/collection-manifest.json +61 -0
  17. package/dist/components/helper-accordion.js +6 -0
  18. package/dist/components/helper-accordion2.js +116 -0
  19. package/dist/components/helper-filters.js +6 -0
  20. package/dist/components/helper-filters2.js +166 -0
  21. package/dist/components/helper-pagination.js +216 -0
  22. package/dist/components/helper-tab.js +6 -0
  23. package/dist/components/helper-tab2.js +52 -0
  24. package/dist/components/helper-tabs.js +6 -0
  25. package/dist/components/helper-tabs2.js +63 -0
  26. package/dist/components/lottery-bullet.js +6 -0
  27. package/dist/components/lottery-bullet2.js +57 -0
  28. package/dist/components/lottery-draw-results-history.js +6 -0
  29. package/dist/components/lottery-draw-results-history2.js +216 -0
  30. package/dist/components/lottery-draw-results2.js +13 -2
  31. package/dist/components/lottery-game-details.js +6 -0
  32. package/dist/components/lottery-game-details2.js +49 -0
  33. package/dist/components/lottery-game-page.js +64 -7
  34. package/dist/components/lottery-grid.js +6 -0
  35. package/dist/components/lottery-grid2.js +197 -0
  36. package/dist/components/lottery-ticket-controller.js +6 -0
  37. package/dist/components/lottery-ticket-controller2.js +118 -0
  38. package/dist/components/lottery-ticket.js +6 -0
  39. package/dist/components/lottery-ticket2.js +209 -0
  40. package/dist/esm/helper-accordion.entry.js +88 -0
  41. package/dist/esm/{lottery-draw-results.entry.js → helper-filters_2.entry.js} +131 -3
  42. package/dist/esm/helper-modal.entry.js +1 -1
  43. package/dist/esm/helper-pagination.entry.js +184 -0
  44. package/dist/esm/helper-tab.entry.js +32 -0
  45. package/dist/esm/helper-tabs.entry.js +34 -0
  46. package/dist/esm/{index-0fa076cd.js → index-ade3d0ab.js} +47 -1
  47. package/dist/esm/loader.js +2 -2
  48. package/dist/esm/lottery-bullet_2.entry.js +197 -0
  49. package/dist/esm/lottery-draw-results-history.entry.js +157 -0
  50. package/dist/esm/lottery-game-details.entry.js +15 -0
  51. package/dist/esm/lottery-game-page.entry.js +1 -4
  52. package/dist/esm/lottery-game-page.js +2 -2
  53. package/dist/esm/lottery-ticket-controller.entry.js +65 -0
  54. package/dist/esm/lottery-ticket.entry.js +165 -0
  55. package/dist/lottery-game-page/lottery-game-page.esm.js +1 -1
  56. package/dist/lottery-game-page/p-07cca45e.entry.js +1 -0
  57. package/dist/lottery-game-page/p-1196396b.entry.js +1 -0
  58. package/dist/lottery-game-page/p-2197c8ae.entry.js +1 -0
  59. package/dist/lottery-game-page/p-2a4e9984.entry.js +1 -0
  60. package/dist/lottery-game-page/p-4b390390.entry.js +1 -0
  61. package/dist/lottery-game-page/p-4bfd0112.entry.js +1 -0
  62. package/dist/lottery-game-page/p-5e12dbf9.entry.js +1 -0
  63. package/dist/lottery-game-page/p-a10368b2.entry.js +1 -0
  64. package/dist/lottery-game-page/p-a26ebf45.entry.js +1 -0
  65. package/dist/lottery-game-page/p-b301a9d4.js +1 -0
  66. package/dist/lottery-game-page/{p-6183a920.entry.js → p-d4b6a11a.entry.js} +1 -1
  67. package/dist/lottery-game-page/p-dd63fcc6.entry.js +1 -0
  68. package/dist/lottery-game-page/p-f59dc9e1.entry.js +1 -0
  69. package/dist/stencil.config.js +0 -1
  70. package/package.json +2 -2
  71. package/dist/lottery-game-page/p-2d7ccc96.js +0 -1
  72. package/dist/lottery-game-page/p-9ca649d9.entry.js +0 -1
  73. package/dist/lottery-game-page/p-e98ee83a.entry.js +0 -1
@@ -0,0 +1,92 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-5701a895.js');
6
+
7
+ const DEFAULT_LANGUAGE = 'en';
8
+ const SUPPORTED_LANGUAGES = ['ro', 'en'];
9
+ const TRANSLATIONS = {
10
+ en: {
11
+ deleteTicket: 'Delete ticket'
12
+ },
13
+ ro: {
14
+ deleteTicket: 'Sterge biletul'
15
+ },
16
+ };
17
+ const translate = (key, customLang) => {
18
+ const lang = customLang;
19
+ return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
20
+ };
21
+
22
+ 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:4px 4px 0 0;background:#009993;display:flex;gap:30px;border:1px solid #009993;padding:8px 10px;user-select:none}.Header:hover{background:#00ABA4}.Header .Title,.Header .Subtitle,.Header .Description{margin:0;font-size:14px;color:#fff}.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}";
23
+
24
+ const Accordion = class {
25
+ constructor(hostRef) {
26
+ index.registerInstance(this, hostRef);
27
+ this.accordionEvent = index.createEvent(this, "helperAccordionAction", 7);
28
+ /**
29
+ * Flag for ticket history
30
+ */
31
+ this.ticketHistoryFlag = false;
32
+ /**
33
+ * Title (top header)
34
+ */
35
+ this.headerTitle = '';
36
+ /**
37
+ * SubTitle (top header)
38
+ */
39
+ this.headerSubtitle = '';
40
+ /**
41
+ * Description
42
+ */
43
+ this.description = '';
44
+ /**
45
+ * Enables footer content
46
+ */
47
+ this.footer = false;
48
+ /**
49
+ * Enables footer button for tab deletion
50
+ */
51
+ this.deleteTab = false;
52
+ /**
53
+ * Activates postMessages as events for actions from the widget
54
+ */
55
+ this.postMessage = false;
56
+ /**
57
+ * Name of the event emitter by the action button
58
+ */
59
+ this.eventName = 'helperAccordionAction';
60
+ /**
61
+ * Collapsed
62
+ */
63
+ this.collapsed = true;
64
+ /**
65
+ * Language
66
+ */
67
+ this.language = 'en';
68
+ }
69
+ // @TODO fix the `any` type :)
70
+ connectedCallback() {
71
+ this.showContent = !this.collapsed;
72
+ }
73
+ toggleContent() {
74
+ this.showContent = !this.showContent;
75
+ }
76
+ deleteAction() {
77
+ if (this.postMessage) {
78
+ // @TODO maybe change the name type, this one sucks
79
+ window.postMessage({ type: this.eventName }, window.location.href);
80
+ }
81
+ this.accordionEvent.emit();
82
+ }
83
+ render() {
84
+ return (index.h("div", { class: "Wrapper" }, 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" }, this.description), index.h("span", { class: "Expand", onClick: () => this.toggleContent() }, this.showContent ? '<' : '>')), this.showContent &&
85
+ index.h("div", null, index.h("div", { class: "Content" }, index.h("slot", { name: 'accordionContent' }), this.footer && this.showContent &&
86
+ index.h("div", null, this.deleteTab &&
87
+ index.h("span", { class: "ActionButton", onClick: () => this.deleteAction() }, translate('deleteTicket', this.language)))))));
88
+ }
89
+ };
90
+ Accordion.style = helperAccordionCss;
91
+
92
+ exports.helper_accordion = Accordion;
@@ -2,8 +2,136 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-614098f4.js');
6
- require('@everymatrix/lottery-grid');
5
+ const index = require('./index-5701a895.js');
6
+
7
+ const DEFAULT_LANGUAGE$1 = 'en';
8
+ const SUPPORTED_LANGUAGES$1 = ['ro', 'en'];
9
+ const TRANSLATIONS$1 = {
10
+ en: {
11
+ filterOpen: 'Filter',
12
+ filterClear: 'Clear',
13
+ filterModalTicketTitle: 'Ticket Results',
14
+ filterModalDrawTitle: 'Draws Results History',
15
+ filterTicketPlaceholder: 'Search for a ticket ID',
16
+ filterDrawPlaceholder: 'Search for a draw ID',
17
+ filterDateRangePlaceholder: 'Date Range',
18
+ filterModalButton: 'Search',
19
+ filterFromCalendar: 'From',
20
+ filterToCalendar: 'To',
21
+ filterOrDate: 'or search by date'
22
+ },
23
+ ro: {
24
+ filterOpen: 'Filtrare',
25
+ filterClear: 'Stergere',
26
+ filterModalTicketTitle: 'Rezultatele biletelor',
27
+ filterModalDrawTitle: 'Rezultatele draw-urilor',
28
+ filterTicketPlaceholder: 'Cauta ID bilet',
29
+ filterDrawPlaceholder: 'Cauta ID draw',
30
+ filterDateRangePlaceholder: 'Perioada',
31
+ filterModalButton: 'Cauta',
32
+ filterOrDate: 'sau cauta dupa data'
33
+ },
34
+ };
35
+ const translate$1 = (key, customLang) => {
36
+ const lang = customLang;
37
+ return TRANSLATIONS$1[lang !== undefined && SUPPORTED_LANGUAGES$1.includes(lang) ? lang : DEFAULT_LANGUAGE$1][key];
38
+ };
39
+
40
+ const helperFiltersCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.FilterButtonsWrapper{display:flex;justify-content:flex-end;gap:5px}.FilterButtonsWrapper .FilterOpen{cursor:pointer;border-radius:4px;padding:8px 15px;width:max-content;border:1px solid #00958f;background:#00958f;color:#FFF;font-size:12px;transition:all 0.2s linear;text-align:center;letter-spacing:0}.FilterButtonsWrapper .FilterOpen:hover{background:#00958f;color:#FFF}.FilterButtonsWrapper .FilterClear{cursor:pointer;border-radius:4px;padding:8px 15px;width:max-content;border:1px solid #00958f;background:#FFF;color:#000;font-size:12px;transition:all 0.2s linear;text-align:center;letter-spacing:0}.FilterButtonsWrapper .FilterClear:hover{background:#00958f;color:#FFF}.FilterModalHeader,.FilterModalBody,.FilterModalFooter{display:flex;flex-direction:column;gap:5px;align-items:center;margin:20px 0}.FilterModalHeader .FilterModalTitle,.FilterModalBody .FilterModalTitle,.FilterModalFooter .FilterModalTitle{margin:0;padding:0;font-weight:700;font-size:16px;color:#009993;text-transform:uppercase}.FilterModalHeader .FilterModalSearch,.FilterModalBody .FilterModalSearch,.FilterModalFooter .FilterModalSearch{border-radius:4px;background:#e8ebef;color:#263445;width:100%;height:26px;max-width:280px;padding:5px;font-size:15px;border:none;outline:#009993}.FilterModalHeader .FilterCalendarWrapper,.FilterModalBody .FilterCalendarWrapper,.FilterModalFooter .FilterCalendarWrapper{display:flex;gap:5px}.FilterModalHeader .FilterCalendarWrapper .VaadinDatePicker,.FilterModalBody .FilterCalendarWrapper .VaadinDatePicker,.FilterModalFooter .FilterCalendarWrapper .VaadinDatePicker{width:50%;max-width:143px}.FilterModalHeader .FilterModalButton,.FilterModalBody .FilterModalButton,.FilterModalFooter .FilterModalButton{cursor:pointer;border-radius:4px;padding:8px 60px;width:max-content;margin:5px;border:1px solid #00958f;background:#00958f;color:#FFF;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.FilterModalHeader .FilterModalButton:hover,.FilterModalBody .FilterModalButton:hover,.FilterModalFooter .FilterModalButton:hover{background:#00958f;color:#FFF}.FilterModalHeader p,.FilterModalBody p,.FilterModalFooter p{margin:5px 0}";
41
+
42
+ const HelperFilters = class {
43
+ constructor(hostRef) {
44
+ index.registerInstance(this, hostRef);
45
+ this.filterDraw = index.createEvent(this, "filterDraw", 7);
46
+ this.filterSelection = index.createEvent(this, "filterSelection", 7);
47
+ this.filterSelectionReset = index.createEvent(this, "filterSelectionReset", 7);
48
+ /**
49
+ * Check if show the filter option by id
50
+ */
51
+ this.showFilterId = true;
52
+ /**
53
+ * Choose if filter by draw ID or ticket ID. By default is draw ID.
54
+ */
55
+ this.activateTicketSearch = false;
56
+ /**
57
+ * Game ID
58
+ */
59
+ this.gameId = '';
60
+ /**
61
+ * Player ID
62
+ */
63
+ this.playerId = '';
64
+ /**
65
+ * Session ID
66
+ */
67
+ this.session = '';
68
+ /**
69
+ * Instead of customEvents the widget triggers postMessages
70
+ */
71
+ this.postMessage = false;
72
+ /**
73
+ * Language
74
+ */
75
+ this.language = 'en';
76
+ this.showFilterModal = false;
77
+ this.showClearButton = false;
78
+ this.filterData = {};
79
+ this.filterDataReset = { ticketDrawId: '', filterFromCalendar: '', filterToCalendar: '' };
80
+ }
81
+ // reset field values each time the filter modal opens
82
+ componentDidRender() {
83
+ this.filterData.ticketDrawId = null;
84
+ this.filterData.filterFromCalendar = null;
85
+ this.filterData.filterToCalendar = null;
86
+ // @TODO: to way binding?
87
+ if (document.getElementById('#FilterById'))
88
+ document.getElementById('#FilterById').value = '';
89
+ }
90
+ filterSelectionHandler(event) {
91
+ if (this.postMessage)
92
+ window.postMessage({ type: 'filterSelection', event }, window.location.href);
93
+ if (this.filterData.ticketDrawId)
94
+ this.filterDraw.emit(event);
95
+ if (this.filterData.filterFromCalendar || this.filterData.filterToCalendar)
96
+ this.filterSelection.emit(event);
97
+ }
98
+ filterSelectionResetHandler(event) {
99
+ if (this.postMessage)
100
+ window.postMessage({ type: 'filterSelectionReset', event }, window.location.href);
101
+ this.filterSelectionReset.emit(event);
102
+ }
103
+ modalCloseEvent() {
104
+ this.showFilterModal = false;
105
+ }
106
+ // Toggle filter modal
107
+ toggleFilterModal() {
108
+ this.showFilterModal = true;
109
+ }
110
+ // Filter search
111
+ filterSearch() {
112
+ this.modalCloseEvent();
113
+ this.showClearButton = true;
114
+ this.filterSelectionHandler(this.filterData);
115
+ }
116
+ resetSearch() {
117
+ this.showClearButton = false;
118
+ this.filterSelectionResetHandler(this.filterDataReset);
119
+ this.filterData = {};
120
+ }
121
+ handleTicketDrawId(event) {
122
+ this.filterData.ticketDrawId = event.target.value;
123
+ }
124
+ handleFilterFrom(event) {
125
+ this.filterData.filterFromCalendar = new Date(event.target.value).toISOString();
126
+ }
127
+ handleFilterTo(event) {
128
+ this.filterData.filterToCalendar = new Date(event.target.value).toISOString();
129
+ }
130
+ render() {
131
+ return (index.h("div", { class: "HelperFilters" }, index.h("div", { class: "FilterButtonsWrapper" }, index.h("button", { class: "FilterOpen", onClick: () => this.toggleFilterModal() }, translate$1('filterOpen', this.language)), this.showClearButton ? index.h("button", { class: "FilterClear", onClick: () => this.resetSearch() }, translate$1('filterClear', this.language)) : null), index.h("helper-modal", { "title-modal": "Filter Modal", visible: this.showFilterModal }, index.h("div", { class: "FilterModalHeader" }, index.h("h3", { class: "FilterModalTitle" }, this.activateTicketSearch ? translate$1('filterModalTicketTitle', this.language) : translate$1('filterModalDrawTitle', this.language))), index.h("div", { class: "FilterModalBody" }, index.h("input", { id: "FilterById", type: "text", value: this.filterData.ticketDrawId, onInput: (event) => this.handleTicketDrawId(event), class: "FilterModalSearch", placeholder: this.activateTicketSearch ? translate$1('filterTicketPlaceholder', this.language) : translate$1('filterDrawPlaceholder', this.language) }), index.h("p", null, translate$1('filterOrDate', this.language)), index.h("div", { class: "FilterCalendarWrapper" })), index.h("div", { class: "FilterModalFooter" }, index.h("button", { class: "FilterModalButton", onClick: () => this.filterSearch() }, translate$1('filterModalButton', this.language))))));
132
+ }
133
+ };
134
+ HelperFilters.style = helperFiltersCss;
7
135
 
8
136
  const DEFAULT_LANGUAGE = 'en';
9
137
  const SUPPORTED_LANGUAGES = ['ro', 'en'];
@@ -185,4 +313,5 @@ const LotteryDrawResults = class {
185
313
  };
186
314
  LotteryDrawResults.style = lotteryDrawResultsCss;
187
315
 
316
+ exports.helper_filters = HelperFilters;
188
317
  exports.lottery_draw_results = LotteryDrawResults;
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-614098f4.js');
5
+ const index = require('./index-5701a895.js');
6
6
 
7
7
  /**
8
8
  * @name isMobile
@@ -0,0 +1,188 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-5701a895.js');
6
+
7
+ /**
8
+ * @name isMobile
9
+ * @description A method that returns if the browser used to access the app is from a mobile device or not
10
+ * @param {String} userAgent window.navigator.userAgent
11
+ * @returns {Boolean} true or false
12
+ */
13
+ const isMobile = (userAgent) => {
14
+ return !!(userAgent.toLowerCase().match(/android/i) ||
15
+ userAgent.toLowerCase().match(/blackberry|bb/i) ||
16
+ userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||
17
+ userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
18
+ };
19
+
20
+ const DEFAULT_LANGUAGE = 'en';
21
+ const SUPPORTED_LANGUAGES = ['ro', 'en'];
22
+ const TRANSLATIONS = {
23
+ en: {
24
+ firstPage: 'First',
25
+ previousPage: 'Previous',
26
+ nextPage: 'Next',
27
+ lastPage: 'Last'
28
+ },
29
+ ro: {
30
+ firstPage: 'Prima',
31
+ previousPage: 'Anterior',
32
+ nextPage: 'Urmatoarea',
33
+ lastPage: 'Ultima'
34
+ },
35
+ };
36
+ const translate = (key, customLang) => {
37
+ const lang = customLang;
38
+ return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
39
+ };
40
+
41
+ const helperPaginationCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}#PaginationContainer{width:100%;margin-top:20px;display:inline-flex;justify-content:space-between;align-items:center}.LeftItems button:not(:first-child),.RightItems button:not(:last-child){margin:0 10px}.LeftItems button,.RightItems button{padding:0;background-color:#009993;border-color:#009993}.PaginationArea{display:inline-flex;gap:10px;list-style:none}.PaginationArea li{margin:0;padding:0}.PaginationArea li button{width:24px;height:24px;display:flex;border:0;padding:0;justify-content:center;align-items:center;background-color:transparent;color:#000;cursor:pointer;pointer-events:all}.PaginationItem.ActiveItem button{background:#009993;border-color:#009993;color:#fff}.PaginationItem.ActiveItem button:disabled{pointer-events:none;cursor:not-allowed}.PaginationItem button:hover,.PaginationItem button:active{background:#009993;border-color:#009993;color:#fff;opacity:0.8}button{width:100px;height:32px;border:1px solid #524e52;border-radius:5px;background:#524e52;color:#fff;font-size:14px;font:inherit;cursor:pointer;transition:all 0.1s linear;text-transform:uppercase;text-align:center;letter-spacing:0}button:hover,button:active{background:#004D4A;border-color:#004D4A}button:disabled{background-color:#ccc;border-color:#ccc;color:#fff;cursor:not-allowed}@media screen and (max-width: 720px){button{width:90px;font-size:12px}}@media screen and (max-width: 480px){button{width:70px;font-size:10px}.paginationArea{padding:5px}}@media screen and (max-width: 320px){button{width:58px;font-size:10px}.paginationArea{padding:5px;gap:5px}}@media (hover: none){.paginationItem button:hover{background:inherit;border-color:inherit;color:inherit;opacity:1}.paginationItem.activeItem button:hover{background:#009993;border-color:#009993;color:#fff}}";
42
+
43
+ const HelperPagination = class {
44
+ constructor(hostRef) {
45
+ index.registerInstance(this, hostRef);
46
+ this.hpPageChange = index.createEvent(this, "hpPageChange", 7);
47
+ /**
48
+ * First page boolean value - determines if the page is disabled or active
49
+ */
50
+ this.firstPage = false;
51
+ /**
52
+ * Previous page boolean value - determines if the page is disabled or active
53
+ */
54
+ this.previousPage = false;
55
+ /**
56
+ * The received offset
57
+ */
58
+ this.offset = 0;
59
+ /**
60
+ * The received limit for the number of pages
61
+ */
62
+ this.limit = 1;
63
+ /**
64
+ * The received total number of pages
65
+ */
66
+ this.total = 1;
67
+ /**
68
+ * Language
69
+ */
70
+ this.language = 'en';
71
+ /**
72
+ * In component working variable for the array of pages
73
+ */
74
+ this.pagesArray = [];
75
+ /**
76
+ * In component working variable for last page
77
+ */
78
+ this.endInt = 0;
79
+ this.userAgent = window.navigator.userAgent;
80
+ this.currentPage = 1;
81
+ /**
82
+ * Navigation logic
83
+ */
84
+ this.navigateTo = (navigationPage) => {
85
+ switch (navigationPage) {
86
+ case 'firstPage':
87
+ this.offsetInt = 0;
88
+ break;
89
+ case 'lastPage':
90
+ this.offsetInt = this.endInt * this.limitInt;
91
+ break;
92
+ case 'previousPage':
93
+ this.offsetInt -= 10;
94
+ break;
95
+ case 'nextPage':
96
+ this.offsetInt += 10;
97
+ break;
98
+ case 'fivePagesBack':
99
+ this.offsetInt -= 30;
100
+ this.offsetInt = this.offsetInt < 0 ? 0 : this.offsetInt;
101
+ break;
102
+ case 'fivePagesForward':
103
+ this.offsetInt += 30;
104
+ this.offsetInt = this.offsetInt / 10 >= this.endInt ? this.endInt * 10 : this.offsetInt;
105
+ break;
106
+ }
107
+ this.hpPageChange.emit({ offset: this.offsetInt, limit: this.limitInt, total: this.totalInt });
108
+ };
109
+ /**
110
+ * Handle navigation from here
111
+ */
112
+ this.paginationNavigation = (pageNumber, index) => {
113
+ if (!isNaN(pageNumber)) {
114
+ if (pageNumber === 1) {
115
+ this.offsetInt = pageNumber - 1;
116
+ }
117
+ else {
118
+ this.offsetInt = (pageNumber - 1) * 10;
119
+ }
120
+ }
121
+ else {
122
+ if (index === 0 && this.currentPage <= 4) {
123
+ this.navigateTo('firstPage');
124
+ }
125
+ else if (index === 0 && this.currentPage > 4) {
126
+ this.navigateTo('fivePagesBack');
127
+ }
128
+ else if (index === 4 && this.endInt - this.currentPage >= 2) {
129
+ this.navigateTo('fivePagesForward');
130
+ }
131
+ }
132
+ this.currentPage = this.offsetInt;
133
+ this.hpPageChange.emit({ offset: this.offsetInt, limit: this.limitInt, total: this.totalInt });
134
+ };
135
+ }
136
+ componentWillRender() {
137
+ this.offsetInt = this.offset;
138
+ this.currentPage = this.offsetInt / this.limitInt + 1;
139
+ this.limitInt = this.limit;
140
+ this.totalInt = this.total;
141
+ this.endInt = (Math.ceil(this.totalInt / this.limitInt) - 1);
142
+ this.lastPage = (this.offsetInt >= this.endInt * this.limitInt) ? false : true;
143
+ /**
144
+ * Construct numbered navigation area based on current page position
145
+ */
146
+ if (this.currentPage === 1 || this.currentPage === 2) {
147
+ this.pagesArray = Array.from({ length: 4 }, (_, i) => i + 1);
148
+ this.pagesArray.push('...');
149
+ }
150
+ else if (this.currentPage >= 3 && ((this.endInt - this.currentPage) >= 2)) {
151
+ this.pagesArray = Array.from({ length: 3 }, (_, i) => this.currentPage + i - 1);
152
+ this.pagesArray.push('...');
153
+ this.pagesArray.unshift('...');
154
+ }
155
+ else if ((this.endInt - this.currentPage) < 3) {
156
+ this.pagesArray = Array.from({ length: 4 }, (_, i) => this.endInt - 2 + i);
157
+ this.pagesArray.unshift('...');
158
+ }
159
+ }
160
+ render() {
161
+ /**
162
+ * Center navigation area
163
+ */
164
+ let navigationArea = index.h("ul", { class: "PaginationArea" }, this.pagesArray.map((item, index$1) => {
165
+ return (index.h("li", { class: 'PaginationItem' + (item === this.currentPage ? ' ActiveItem' : ' ') + ' ' + (isMobile(this.userAgent) ? 'MobileButtons' : '') }, index.h("button", { disabled: item === this.currentPage ? true : false, onClick: this.paginationNavigation.bind(this, item, index$1) }, index.h("span", null, item))));
166
+ }));
167
+ /**
168
+ * Left navigation area
169
+ */
170
+ let buttonsLeftSide = index.h("div", { class: "LeftItems" }, index.h("button", { disabled: !this.previousPage, onClick: this.navigateTo.bind(this, 'firstPage') }, translate('firstPage', this.language)), index.h("button", { disabled: !this.previousPage ? true : false, onClick: this.navigateTo.bind(this, 'previousPage') }, translate('previousPage', this.language)));
171
+ if (isMobile(this.userAgent)) {
172
+ buttonsLeftSide =
173
+ index.h("div", { class: "LeftItems" }, index.h("button", { disabled: !this.previousPage ? true : false, onClick: this.navigateTo.bind(this, 'previousPage') }, translate('previousPage', this.language)));
174
+ }
175
+ /**
176
+ * Right navigation area
177
+ */
178
+ let buttonsRightSide = index.h("div", { class: "RightItems" }, index.h("button", { disabled: !this.lastPage ? true : false, onClick: this.navigateTo.bind(this, 'nextPage') }, translate('nextPage', this.language)), index.h("button", { disabled: !this.lastPage ? true : false, onClick: this.navigateTo.bind(this, 'lastPage') }, translate('lastPage', this.language)));
179
+ if (isMobile(this.userAgent)) {
180
+ buttonsRightSide =
181
+ index.h("div", { class: "RightItems" }, index.h("button", { disabled: !this.lastPage ? true : false, onClick: this.navigateTo.bind(this, 'nextPage') }, translate('nextPage', this.language)));
182
+ }
183
+ return (index.h("div", { id: "PaginationContainer" }, buttonsLeftSide, navigationArea, buttonsRightSide));
184
+ }
185
+ };
186
+ HelperPagination.style = helperPaginationCss;
187
+
188
+ exports.helper_pagination = HelperPagination;
@@ -0,0 +1,36 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-5701a895.js');
6
+
7
+ const helperTabCss = ":host{display:block}.TabContent{font-size:14px;color:#000;font-weight:normal}";
8
+
9
+ const HelperTab = class {
10
+ constructor(hostRef) {
11
+ index.registerInstance(this, hostRef);
12
+ /**
13
+ * Selected index
14
+ */
15
+ this.selectedIndex = 0;
16
+ this.tabContent = '';
17
+ }
18
+ connectedCallback() {
19
+ /**
20
+ * fetch(cmsEndpoint + / + / + selectedIndex)
21
+ */
22
+ }
23
+ render() {
24
+ this.tabContent = index.h("div", { class: "TabContent" }, "Each play includes one set of numbers from 1 to 21 with a selectable number of 8 and a second, 4-digit set of numbers, with a minimum selection of 1. Draws are held every 5 minutes and the winnings are automatically credited to your account.");
25
+ if (this.selectedIndex + 1 == 2) {
26
+ this.tabContent = index.h("div", { class: "TabContent" }, index.h("ol", null, index.h("li", null, "Register or Login"), index.h("li", null, "Buy tickets. Select 'Buy Tickets' to pick your numbers. Want us to automatically generate random numbers for you? Choose \u201CI feel lucky\u201D."), index.h("li", null, "Review and Complete your purchase. Once you've chosen your total number of plays, and confirmed your number of selections, review your ticket details and complete your purchase!")));
27
+ }
28
+ else if (this.selectedIndex + 1 == 3) {
29
+ this.tabContent = index.h("div", { class: "TabContent" }, index.h("ul", null, index.h("li", null, "What are my odds of winning?"), index.h("li", null, "How can I find out if I\u2019ve won a draw game?"), index.h("li", null, "How do I claim my prize?")));
30
+ }
31
+ return (this.tabContent);
32
+ }
33
+ };
34
+ HelperTab.style = helperTabCss;
35
+
36
+ exports.helper_tab = HelperTab;
@@ -0,0 +1,38 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-5701a895.js');
6
+
7
+ const helperTabsCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.Tabs{display:flex;gap:10px;overflow-x:auto}.TabButton{cursor:pointer;width:auto;border-radius:4px;padding:8px 15px;margin:5px 0 10px;border:1px solid #009993;background:#FFF;color:#000;font-size:12px;transition:all 0.2s linear;text-align:center;letter-spacing:0;white-space:nowrap}.TabButton:hover{background:#F1F1F1}.TabButton.Active{background:#009993;color:#FFF}";
8
+
9
+ const HelperTabs = class {
10
+ constructor(hostRef) {
11
+ index.registerInstance(this, hostRef);
12
+ /**
13
+ * Tell me if it is disabled
14
+ */
15
+ this.disabled = false;
16
+ /**
17
+ * Tell me what tab is selected
18
+ */
19
+ this.selected = false;
20
+ /**
21
+ * Default selected index
22
+ */
23
+ this.selectedIndex = 0;
24
+ /**
25
+ * Tabs details
26
+ */
27
+ this.tabs = [{ label: 'How to Play' }, { label: 'About' }, { label: 'FAQs' }];
28
+ }
29
+ connectedCallback() {
30
+ }
31
+ render() {
32
+ return (index.h("div", null, index.h("div", { class: "Tabs" }, this.tabs.map((tab, index$1) => index.h("button", { class: 'TabButton' + (this.selectedIndex == index$1 ? ' Active' : ''), onClick: () => this.selectedIndex = index$1 }, tab.label))), index.h("div", null, index.h("helper-tab", { selectedIndex: this.selectedIndex }))));
33
+ }
34
+ get host() { return index.getElement(this); }
35
+ };
36
+ HelperTabs.style = helperTabsCss;
37
+
38
+ exports.helper_tabs = HelperTabs;
@@ -50,7 +50,7 @@ const supportsConstructibleStylesheets = /*@__PURE__*/ (() => {
50
50
  const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
51
51
  if (listeners) {
52
52
  listeners.map(([flags, name, method]) => {
53
- const target = elm;
53
+ const target = getHostListenerTarget(elm, flags) ;
54
54
  const handler = hostListenerProxy(hostRef, method);
55
55
  const opts = hostListenerOpts(flags);
56
56
  plt.ael(target, name, handler, opts);
@@ -74,6 +74,13 @@ const hostListenerProxy = (hostRef, methodName) => (ev) => {
74
74
  consoleError(e);
75
75
  }
76
76
  };
77
+ const getHostListenerTarget = (elm, flags) => {
78
+ if (flags & 4 /* TargetDocument */)
79
+ return doc;
80
+ if (flags & 8 /* TargetWindow */)
81
+ return win;
82
+ return elm;
83
+ };
77
84
  // prettier-ignore
78
85
  const hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
79
86
  const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
@@ -619,6 +626,9 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
619
626
  }
620
627
  }
621
628
  }
629
+ {
630
+ promise = then(promise, () => safeCall(instance, 'componentWillRender'));
631
+ }
622
632
  endSchedule();
623
633
  return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
624
634
  };
@@ -686,7 +696,11 @@ const postUpdateComponent = (hostRef) => {
686
696
  const tagName = hostRef.$cmpMeta$.$tagName$;
687
697
  const elm = hostRef.$hostElement$;
688
698
  const endPostUpdate = createTime('postUpdate', tagName);
699
+ const instance = hostRef.$lazyInstance$ ;
689
700
  const ancestorComponent = hostRef.$ancestorComponent$;
701
+ {
702
+ safeCall(instance, 'componentDidRender');
703
+ }
690
704
  if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
691
705
  hostRef.$flags$ |= 64 /* hasLoadedComponent */;
692
706
  {
@@ -795,6 +809,7 @@ const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propNam
795
809
  const setValue = (ref, propName, newVal, cmpMeta) => {
796
810
  // check our new property value against our internal value
797
811
  const hostRef = getHostRef(ref);
812
+ const elm = hostRef.$hostElement$ ;
798
813
  const oldVal = hostRef.$instanceValues$.get(propName);
799
814
  const flags = hostRef.$flags$;
800
815
  const instance = hostRef.$lazyInstance$ ;
@@ -807,6 +822,22 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
807
822
  // set our new value!
808
823
  hostRef.$instanceValues$.set(propName, newVal);
809
824
  if (instance) {
825
+ // get an array of method names of watch functions to call
826
+ if (cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
827
+ const watchMethods = cmpMeta.$watchers$[propName];
828
+ if (watchMethods) {
829
+ // this instance is watching for when this property changed
830
+ watchMethods.map((watchMethodName) => {
831
+ try {
832
+ // fire off each of the watch methods that are watching this property
833
+ instance[watchMethodName](newVal, oldVal, propName);
834
+ }
835
+ catch (e) {
836
+ consoleError(e, elm);
837
+ }
838
+ });
839
+ }
840
+ }
810
841
  if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
811
842
  // looks like this value actually changed, so we've got work to do!
812
843
  // but only if we've already rendered, otherwise just chill out
@@ -819,6 +850,9 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
819
850
  };
820
851
  const proxyComponent = (Cstr, cmpMeta, flags) => {
821
852
  if (cmpMeta.$members$) {
853
+ if (Cstr.watchers) {
854
+ cmpMeta.$watchers$ = Cstr.watchers;
855
+ }
822
856
  // It's better to have a const than two Object.entries()
823
857
  const members = Object.entries(cmpMeta.$members$);
824
858
  const prototype = Cstr.prototype;
@@ -926,6 +960,12 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
926
960
  endLoad();
927
961
  }
928
962
  if (!Cstr.isProxied) {
963
+ // we've never proxied this Constructor before
964
+ // let's add the getters/setters to its prototype before
965
+ // the first time we create an instance of the implementation
966
+ {
967
+ cmpMeta.$watchers$ = Cstr.watchers;
968
+ }
929
969
  proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
930
970
  Cstr.isProxied = true;
931
971
  }
@@ -949,6 +989,9 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
949
989
  {
950
990
  hostRef.$flags$ &= ~8 /* isConstructingInstance */;
951
991
  }
992
+ {
993
+ hostRef.$flags$ |= 128 /* isWatchReady */;
994
+ }
952
995
  endNewInstance();
953
996
  fireConnectedCallback(hostRef.$lazyInstance$);
954
997
  }
@@ -1078,6 +1121,9 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1078
1121
  {
1079
1122
  cmpMeta.$attrsToReflect$ = [];
1080
1123
  }
1124
+ {
1125
+ cmpMeta.$watchers$ = {};
1126
+ }
1081
1127
  const tagName = cmpMeta.$tagName$;
1082
1128
  const HostElement = class extends HTMLElement {
1083
1129
  // StencilLazyHost