@everymatrix/player-elevate-points-history 1.43.4 → 1.45.0

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 (87) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/bonus-pagination-limits_6.cjs.entry.js +769 -931
  3. package/dist/cjs/index-c769d3e9.js +1651 -0
  4. package/dist/cjs/loader.cjs.js +7 -13
  5. package/dist/cjs/{player-elevate-card-items-574f7423.js → player-elevate-card-items-e7f7d092.js} +171 -285
  6. package/dist/cjs/player-elevate-card.cjs.entry.js +59 -70
  7. package/dist/cjs/player-elevate-loyaltycard.cjs.entry.js +66 -77
  8. package/dist/cjs/player-elevate-points-history.cjs.js +17 -11
  9. package/dist/collection/collection-manifest.json +3 -3
  10. package/dist/collection/components/player-elevate-points-history/index.js +1 -0
  11. package/dist/collection/components/player-elevate-points-history/player-elevate-points-history.css +4 -4
  12. package/dist/collection/components/player-elevate-points-history/player-elevate-points-history.js +389 -396
  13. package/dist/collection/renders/renderTabs.js +7 -9
  14. package/dist/collection/renders/renderTopBar.js +4 -12
  15. package/dist/collection/renders/renderWallets.js +27 -38
  16. package/dist/collection/utils/business.js +12 -12
  17. package/dist/collection/utils/fetch.js +13 -13
  18. package/dist/collection/utils/translation.js +32 -32
  19. package/dist/collection/utils/types.js +3 -3
  20. package/dist/collection/utils/util.js +12 -12
  21. package/dist/collection/utils/utils.js +3 -0
  22. package/dist/esm/app-globals-0f993ce5.js +3 -0
  23. package/dist/esm/bonus-pagination-limits_6.entry.js +769 -931
  24. package/dist/esm/index-e7bde614.js +1621 -0
  25. package/dist/esm/loader.js +7 -13
  26. package/dist/esm/{player-elevate-card-items-2bf82f60.js → player-elevate-card-items-4cabbcc6.js} +172 -285
  27. package/dist/esm/player-elevate-card.entry.js +59 -70
  28. package/dist/esm/player-elevate-loyaltycard.entry.js +66 -77
  29. package/dist/esm/player-elevate-points-history.js +14 -11
  30. package/dist/player-elevate-points-history/p-0f3449ca.entry.js +1 -0
  31. package/dist/player-elevate-points-history/p-212a0bb7.entry.js +1 -0
  32. package/dist/player-elevate-points-history/p-409b8855.entry.js +1 -0
  33. package/dist/player-elevate-points-history/p-8a361039.js +1 -0
  34. package/dist/player-elevate-points-history/p-e1255160.js +1 -0
  35. package/dist/player-elevate-points-history/p-f547f5dc.js +2 -0
  36. package/dist/player-elevate-points-history/player-elevate-points-history.esm.js +1 -1
  37. package/dist/stencil.config.dev.js +17 -0
  38. package/dist/stencil.config.js +12 -26
  39. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/player-elevate-points-history/.stencil/packages/stencil/player-elevate-points-history/stencil.config.d.ts +2 -0
  40. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/player-elevate-points-history/.stencil/packages/stencil/player-elevate-points-history/stencil.config.dev.d.ts +2 -0
  41. package/dist/types/components/player-elevate-points-history/index.d.ts +1 -0
  42. package/dist/types/components/player-elevate-points-history/player-elevate-points-history.d.ts +63 -63
  43. package/dist/types/components.d.ts +16 -1
  44. package/dist/types/stencil-public-runtime.d.ts +142 -33
  45. package/dist/types/utils/translation.d.ts +33 -33
  46. package/dist/types/utils/types.d.ts +32 -32
  47. package/dist/types/utils/utils.d.ts +1 -0
  48. package/loader/cdn.js +1 -3
  49. package/loader/index.cjs.js +1 -3
  50. package/loader/index.d.ts +13 -1
  51. package/loader/index.es2017.js +1 -3
  52. package/loader/index.js +1 -3
  53. package/loader/package.json +1 -0
  54. package/package.json +14 -13
  55. package/dist/assets/back.svg +0 -3
  56. package/dist/assets/menu.svg +0 -5
  57. package/dist/cjs/index-974f5239.js +0 -1686
  58. package/dist/components/bonus-pagination-limits.js +0 -6
  59. package/dist/components/bonus-pagination-limits2.js +0 -111
  60. package/dist/components/bonus-pagination-nav.js +0 -6
  61. package/dist/components/bonus-pagination-nav2.js +0 -219
  62. package/dist/components/general-styling-wrapper.js +0 -6
  63. package/dist/components/general-styling-wrapper2.js +0 -104
  64. package/dist/components/index.d.ts +0 -26
  65. package/dist/components/index.js +0 -1
  66. package/dist/components/player-elevate-card-data.js +0 -6
  67. package/dist/components/player-elevate-card-data2.js +0 -636
  68. package/dist/components/player-elevate-card-items.js +0 -2250
  69. package/dist/components/player-elevate-card.js +0 -127
  70. package/dist/components/player-elevate-loyaltycard.js +0 -133
  71. package/dist/components/player-elevate-pointcard.js +0 -6
  72. package/dist/components/player-elevate-pointcard2.js +0 -133
  73. package/dist/components/player-elevate-points-history.d.ts +0 -11
  74. package/dist/components/player-elevate-points-history.js +0 -471
  75. package/dist/esm/index-18159ab2.js +0 -1657
  76. package/dist/esm/polyfills/core-js.js +0 -11
  77. package/dist/esm/polyfills/css-shim.js +0 -1
  78. package/dist/esm/polyfills/dom.js +0 -79
  79. package/dist/esm/polyfills/es5-html-element.js +0 -1
  80. package/dist/esm/polyfills/index.js +0 -34
  81. package/dist/esm/polyfills/system.js +0 -6
  82. package/dist/player-elevate-points-history/p-2639efd0.js +0 -1
  83. package/dist/player-elevate-points-history/p-2d512640.entry.js +0 -1
  84. package/dist/player-elevate-points-history/p-3073cebd.js +0 -1
  85. package/dist/player-elevate-points-history/p-309d0acb.entry.js +0 -1
  86. package/dist/player-elevate-points-history/p-977d72c7.entry.js +0 -1
  87. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/player-elevate-points-history/.stencil/packages/player-elevate-points-history/stencil.config.d.ts +0 -2
@@ -1,471 +0,0 @@
1
- import { h, Fragment, proxyCustomElement, HTMLElement as HTMLElement$1, createEvent } from '@stencil/core/internal/client';
2
- import { d as defineCustomElement$6 } from './bonus-pagination-limits2.js';
3
- import { d as defineCustomElement$5 } from './bonus-pagination-nav2.js';
4
- import { d as defineCustomElement$4 } from './general-styling-wrapper2.js';
5
- import { d as defineCustomElement$3 } from './player-elevate-card-data2.js';
6
- import { d as defineCustomElement$2 } from './player-elevate-pointcard2.js';
7
-
8
- var WalletType;
9
- (function (WalletType) {
10
- WalletType["spendable"] = "spendable";
11
- WalletType["loyalty"] = "loyalty";
12
- WalletType["history"] = "history";
13
- })(WalletType || (WalletType = {}));
14
-
15
- const translation = {
16
- en: {
17
- tabTitle: {
18
- [WalletType.spendable]: 'Coins',
19
- [WalletType.loyalty]: 'XP',
20
- [WalletType.history]: 'Conversion History'
21
- },
22
- barTitle: {
23
- [WalletType.spendable]: 'Coins History',
24
- [WalletType.loyalty]: 'Experience Points History',
25
- [WalletType.history]: 'Conversion History'
26
- },
27
- bonus: 'Bonus',
28
- noContent: 'No Content',
29
- redeem: 'Redeem',
30
- reload: 'Reload',
31
- reloadMsgWhenError: 'Network Problem, please ',
32
- pointType: {
33
- registration: 'Registration',
34
- cancelledRegistration: 'Cancelled Registration',
35
- expiredRegistration: 'Expired Registration',
36
- manual: 'Manual',
37
- cancelledManual: 'Cancelled Manual',
38
- expiredManual: 'Expired Manual',
39
- wageringByRealMoney: 'Real Money Wager',
40
- wageringByBonusMoney: 'Bonus Money Wager',
41
- cancelledWageringByRealMoney: 'Cancelled Real Money Wager',
42
- cancelledWageringByBonusMoney: 'Cancelled Bonus Money Wager',
43
- expiredWageringByRealMoney: 'Expired Real Money Wager',
44
- expiredWageringByBonusMoney: 'Expired Bonus Money Wager',
45
- levelExpired: 'Level Expiration',
46
- bonus: 'Bonus Redeem',
47
- }
48
- }
49
- };
50
-
51
- const getUrl = (path, params = {}) => {
52
- return path + '?' + Object.keys(params).map(key => `${key}=${params[key]}`).join('&');
53
- };
54
- const fetcher = async (input, init = {}) => {
55
- let res;
56
- // @ts-ignore
57
- res = await fetch(input, init);
58
- res = await res.text();
59
- try {
60
- res = JSON.parse(res);
61
- }
62
- catch (e) {
63
- console.error(e);
64
- throw e;
65
- }
66
- return res;
67
- };
68
-
69
- const getWallets = async (endpoint, language, type, session, pageSetting) => {
70
- const params = {
71
- type,
72
- language,
73
- pagination: `offset=${pageSetting.offset},limit=${pageSetting.limit}`
74
- };
75
- const url = getUrl(endpoint + getUriByWalletType(params.type), params);
76
- const res = await fetcher(url, {
77
- headers: {
78
- 'x-SessionId': session
79
- }
80
- });
81
- return res;
82
- };
83
- const getUriByWalletType = (type) => `/v1/elevate/${type == WalletType.history ? 'redeemHistory' : 'pointsHistory'}`;
84
-
85
- const renderWallets = (locale, wallets, pageSetting) => wallets && (h(Fragment, null,
86
- h("div", { class: "Records" }, wallets.map(wallet => (h("div", { class: "RecordContainer" },
87
- h("div", { class: "Row" },
88
- h("div", { class: "Title" }, locale.pointType[wallet.pointType] || wallet.pointType),
89
- h("div", { class: `Amount ${getAmountConfig(wallet.points).class}` },
90
- getAmountConfig(wallet.points).symbol,
91
- wallet.points)),
92
- wallet.payload && wallet.payload.displayName &&
93
- h("div", { class: "Row Desc", innerHTML: wallet.payload.displayName['*'] }),
94
- h("div", { class: "Row" },
95
- h("div", { class: "DateTime" }, formatDate(new Date(wallet.modified)))))))),
96
- h("div", { class: "PaginationContainer" },
97
- h("bonus-pagination-nav", { offset: pageSetting.offset, limit: pageSetting.limit, displayPageNumbers: pageSetting.displayPageNumbers, tableId: pageSetting.tableId, secondaryArrowsActive: pageSetting.secondaryArrowsActive, total: pageSetting.total }))));
98
- const getAmountConfig = (amount) => {
99
- if (amount > 0) {
100
- return {
101
- class: 'Positive',
102
- symbol: '+'
103
- };
104
- }
105
- else {
106
- return {
107
- class: 'Negative',
108
- symbol: ''
109
- };
110
- }
111
- };
112
- const padTo2Digits = (num) => {
113
- return num.toString().padStart(2, '0');
114
- };
115
- const formatDate = (date) => {
116
- return ([
117
- date.getFullYear(),
118
- padTo2Digits(date.getMonth() + 1),
119
- padTo2Digits(date.getDate()),
120
- ].join('-') +
121
- ' ' +
122
- [
123
- padTo2Digits(date.getHours()),
124
- padTo2Digits(date.getMinutes()),
125
- padTo2Digits(date.getSeconds()),
126
- ].join(':'));
127
- };
128
-
129
- const backSvg = `<svg width="9" height="15" viewBox="0 0 9 15" fill="none" xmlns="http://www.w3.org/2000/svg">
130
- <path d="M7.75 1L1.25 7.5L7.75 14" stroke="#242424" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
131
- </svg>
132
- `;
133
-
134
- const menuSvg = `<svg width="30" height="8" viewBox="0 0 30 8" fill="none" xmlns="http://www.w3.org/2000/svg">
135
- <circle cx="4" cy="4" r="4" fill="black"/>
136
- <circle cx="15" cy="4" r="4" fill="black"/>
137
- <circle cx="26" cy="4" r="4" fill="black"/>
138
- </svg>
139
- `;
140
-
141
- const renderTopBar = (locale, type, pageSetting) => h("div", { class: "TopBarContainer" },
142
- h("div", { class: "BackImageContainer" },
143
- h("span", { class: "BackImage", innerHTML: backSvg })),
144
- h("div", { class: "TitleContainer" },
145
- h("div", { class: "Title", title: locale.barTitle[type] }, locale.barTitle[type]),
146
- h("div", { class: 'Limits' },
147
- h("bonus-pagination-limits", { pageLimitOptions: pageSetting.pageLimitOptions, limit: pageSetting.limit }))),
148
- h("div", null,
149
- h("span", { class: "MenuImage", innerHTML: menuSvg })));
150
-
151
- const renderTabs = (locale, type, onChangeTab) => h("div", { class: "Tabs Row" }, Object.keys(WalletType).map(key => {
152
- const isActive = key === type;
153
- const cssActive = isActive ? 'active' : '';
154
- return (h("div", null,
155
- h("div", { class: `TabText ${cssActive}`, onClick: () => {
156
- onChangeTab(key);
157
- } }, locale.tabTitle[key]),
158
- h("div", { class: `TabBorderBottom ${cssActive}` })));
159
- }));
160
-
161
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
162
-
163
- function createCommonjsModule(fn, basedir, module) {
164
- return module = {
165
- path: basedir,
166
- exports: {},
167
- require: function (path, base) {
168
- return commonjsRequire();
169
- }
170
- }, fn(module, module.exports), module.exports;
171
- }
172
-
173
- function commonjsRequire () {
174
- throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
175
- }
176
-
177
- createCommonjsModule(function (module, exports) {
178
- !function(t,e){module.exports=e();}(commonjsGlobal,(function(){function t(){}function e(t){return t()}function n(){return Object.create(null)}function i(t){t.forEach(e);}function s(t){return "function"==typeof t}function o(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function l(t,e,n){t.insertBefore(e,n||null);}function r(t){t.parentNode&&t.parentNode.removeChild(t);}function c(t){const e={};for(const n of t)e[n.name]=n.value;return e}let a;function d(t){a=t;}const u=[],f=[];let p=[];const h=[],$=Promise.resolve();let m=!1;function g(t){p.push(t);}
179
- // flush() calls callbacks in this order:
180
- // 1. All beforeUpdate callbacks, in order: parents before children
181
- // 2. All bind:this callbacks, in reverse order: children before parents.
182
- // 3. All afterUpdate callbacks, in order: parents before children. EXCEPT
183
- // for afterUpdates called during the initial onMount, which are called in
184
- // reverse order: children before parents.
185
- // Since callbacks might update component values, which could trigger another
186
- // call to flush(), the following steps guard against this:
187
- // 1. During beforeUpdate, any updated components will be added to the
188
- // dirty_components array and will cause a reentrant call to flush(). Because
189
- // the flush index is kept outside the function, the reentrant call will pick
190
- // up where the earlier call left off and go through all dirty components. The
191
- // current_component value is saved and restored so that the reentrant call will
192
- // not interfere with the "parent" flush() call.
193
- // 2. bind:this callbacks cannot trigger new flush() calls.
194
- // 3. During afterUpdate, any updated components will NOT have their afterUpdate
195
- // callback called a second time; the seen_callbacks set, outside the flush()
196
- // function, guarantees this behavior.
197
- const y=new Set;let b=0;// Do *not* move this inside the flush() function
198
- function x(){
199
- // Do not reenter flush while dirty components are updated, as this can
200
- // result in an infinite loop. Instead, let the inner flush handle it.
201
- // Reentrancy is ok afterwards for bindings etc.
202
- if(0!==b)return;const t=a;do{
203
- // first, call beforeUpdate functions
204
- // and update components
205
- try{for(;b<u.length;){const t=u[b];b++,d(t),v(t.$$);}}catch(t){
206
- // reset dirty state to not end up in a deadlocked state and then rethrow
207
- throw u.length=0,b=0,t}for(d(null),u.length=0,b=0;f.length;)f.pop()();
208
- // then, once components are updated, call
209
- // afterUpdate functions. This may cause
210
- // subsequent updates...
211
- for(let t=0;t<p.length;t+=1){const e=p[t];y.has(e)||(
212
- // ...so guard against infinite loops
213
- y.add(e),e());}p.length=0;}while(u.length);for(;h.length;)h.pop()();m=!1,y.clear(),d(t);}function v(t){if(null!==t.fragment){t.update(),i(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(g);}}
214
- /**
215
- * Useful for example to execute remaining `afterUpdate` callbacks before executing `destroy`.
216
- */const _=new Set;function k(t,e){const n=t.$$;null!==n.fragment&&(!function(t){const e=[],n=[];p.forEach((i=>-1===t.indexOf(i)?e.push(i):n.push(i))),n.forEach((t=>t())),p=e;}(n.after_update),i(n.on_destroy),n.fragment&&n.fragment.d(e),
217
- // TODO null out other refs, including component.$$ (but need to
218
- // preserve final state?)
219
- n.on_destroy=n.fragment=null,n.ctx=[]);}function E(t,e){-1===t.$$.dirty[0]&&(u.push(t),m||(m=!0,$.then(x)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31;}function C(o,l,c,u,f,p,h,$=[-1]){const m=a;d(o);const y=o.$$={fragment:null,ctx:[],
220
- // state
221
- props:p,update:t,not_equal:f,bound:n(),
222
- // lifecycle
223
- on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(l.context||(m?m.$$.context:[])),
224
- // everything else
225
- callbacks:n(),dirty:$,skip_bound:!1,root:l.target||m.$$.root};h&&h(y.root);let b=!1;if(y.ctx=c?c(o,l.props||{},((t,e,...n)=>{const i=n.length?n[0]:e;return y.ctx&&f(y.ctx[t],y.ctx[t]=i)&&(!y.skip_bound&&y.bound[t]&&y.bound[t](i),b&&E(o,t)),e})):[],y.update(),b=!0,i(y.before_update),
226
- // `false` as a special case of no DOM component
227
- y.fragment=!!u&&u(y.ctx),l.target){if(l.hydrate){const t=function(t){return Array.from(t.childNodes)}(l.target);
228
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
229
- y.fragment&&y.fragment.l(t),t.forEach(r);}else
230
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
231
- y.fragment&&y.fragment.c();l.intro&&((v=o.$$.fragment)&&v.i&&(_.delete(v),v.i(k))),function(t,n,o,l){const{fragment:r,after_update:c}=t.$$;r&&r.m(n,o),l||
232
- // onMount happens before the initial afterUpdate
233
- g((()=>{const n=t.$$.on_mount.map(e).filter(s);
234
- // if the component was destroyed immediately
235
- // it will update the `$$.on_destroy` reference to `null`.
236
- // the destructured on_destroy may still reference to the old array
237
- t.$$.on_destroy?t.$$.on_destroy.push(...n):
238
- // Edge case - component was destroyed immediately,
239
- // most likely as a result of a binding initialising
240
- i(n),t.$$.on_mount=[];})),c.forEach(g);}(o,l.target,l.anchor,l.customElement),x();}var v,k;d(m);}let w;
241
- /* src/GeneralAnimationLoading.svelte generated by Svelte v3.59.2 */
242
- function L(e){let n;return {c(){var e;e="div",n=document.createElement(e),n.innerHTML='<section class="LoaderContainer" part="LoaderContainer"><div class="lds-ellipsis"><div></div><div></div><div></div><div></div></div></section>',this.c=t;},m(t,i){l(t,n,i),
243
- /*div5_binding*/e[3](n);},p:t,i:t,o:t,d(t){t&&r(n)
244
- /*div5_binding*/,e[3](null);}}}function T(t,e,n){let i,{clientstyling:s=""}=e,{clientstylingurl:o=""}=e;return t.$$set=t=>{"clientstyling"in t&&n(1,s=t.clientstyling),"clientstylingurl"in t&&n(2,o=t.clientstylingurl);},t.$$.update=()=>{/*clientstyling, customStylingContainer*/3&t.$$.dirty&&s&&i&&(()=>{let t=document.createElement("style");t.innerHTML=s,i.appendChild(t);})(),/*clientstylingurl, customStylingContainer*/5&t.$$.dirty&&o&&i&&(()=>{let t=new URL(o),e=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{e.innerHTML=t,setTimeout((()=>{i.appendChild(e);}),1),setTimeout((()=>{}),500);}));})();},[i,s,o,function(t){f[t?"unshift":"push"]((()=>{i=t,n(0,i);}));}]}"function"==typeof HTMLElement&&(w=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(e).filter(s);
245
- // @ts-ignore todo: improve typings
246
- for(const t in this.$$.slotted)
247
- // @ts-ignore todo: improve typings
248
- this.appendChild(this.$$.slotted[t]);}attributeChangedCallback(t,e,n){this[t]=n;}disconnectedCallback(){i(this.$$.on_disconnect);}$destroy(){k(this,1),this.$destroy=t;}$on(e,n){
249
- // TODO should this delegate to addEventListener?
250
- if(!s(n))return t;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(n),()=>{const t=i.indexOf(n);-1!==t&&i.splice(t,1);}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1);}});class M extends w{constructor(t){super();const e=document.createElement("style");e.textContent=".LoaderContainer{display:flex;justify-content:center}.lds-ellipsis{display:inline-block;position:relative;width:80px;height:80px}.lds-ellipsis div{position:absolute;top:33px;width:13px;height:13px;border-radius:50%;background:#d1d1d1;animation-timing-function:cubic-bezier(0, 1, 1, 0)}.lds-ellipsis div:nth-child(1){left:8px;animation:lds-ellipsis1 0.6s infinite}.lds-ellipsis div:nth-child(2){left:8px;animation:lds-ellipsis2 0.6s infinite}.lds-ellipsis div:nth-child(3){left:32px;animation:lds-ellipsis2 0.6s infinite}.lds-ellipsis div:nth-child(4){left:56px;animation:lds-ellipsis3 0.6s infinite}@keyframes lds-ellipsis1{0%{transform:scale(0)}100%{transform:scale(1)}}@keyframes lds-ellipsis3{0%{transform:scale(1)}100%{transform:scale(0)}}@keyframes lds-ellipsis2{0%{transform:translate(0, 0)}100%{transform:translate(24px, 0)}}",this.shadowRoot.appendChild(e),C(this,{target:this.shadowRoot,props:c(this.attributes),customElement:!0},T,L,o,{clientstyling:1,clientstylingurl:2},null),t&&(t.target&&l(t.target,this,t.anchor),t.props&&(this.$set(t.props),x()));}static get observedAttributes(){return ["clientstyling","clientstylingurl"]}get clientstyling(){return this.$$.ctx[1]}set clientstyling(t){this.$$set({clientstyling:t}),x();}get clientstylingurl(){return this.$$.ctx[2]}set clientstylingurl(t){this.$$set({clientstylingurl:t}),x();}}return !customElements.get("general-animation-loading")&&customElements.define("general-animation-loading",M),M}));
251
- //# sourceMappingURL=general-animation-loading.js.map
252
- });
253
-
254
- const playerElevatePointsHistoryCss = ":host{display:block}main{max-width:420px}main player-elevate-pointcard{width:100%;height:220px}.PlayerElevatePointsDetaisContainer{background:#FFFFFF;padding:20px 10px 0;margin-top:-100px;position:relative;min-height:360px}.PlayerElevatePointsDetaisContainer .ReloadMsg{padding:20px}.PlayerElevatePointsDetaisContainer .ReloadMsg a.Reload{cursor:pointer}.TitleContainer{font-size:20px;font-weight:500;line-height:25px;letter-spacing:0em;text-align:left;display:flex;justify-content:space-between}.TopBarContainer{display:flex;align-items:center;justify-content:space-between}.TopBarContainer .TitleContainer{width:100%}.TopBarContainer .Title{background:#303030;padding:5px 16px;color:#FFFFFF;box-shadow:0px 4px 13px 0px #00000040;border-radius:8px;width:fit-content;margin-left:7px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.PaginationContainer{display:flex;justify-content:center}.MonthStat{margin-top:25px;display:none;font-size:16px;font-weight:500;line-height:19px;letter-spacing:0px;text-align:left;color:#242424}.MonthStat .Amount{color:#53B65A}.BackImageContainer{width:35px;height:35px;flex:0 0 35px;border-radius:6px;text-align:center;line-height:35px;box-shadow:0px 4px 40px 0px #8A959E33;display:none}.Records{margin-top:16px}.MenuImage,.BackImage{cursor:pointer;display:none}.Row{display:flex;justify-content:space-between;align-items:center}.Row:nth-child(n+2){margin-top:3px}.Tabs.Row{justify-content:space-around;margin-top:20px}.Tabs.Row .TabText{font-size:16px;margin:10px 15px;color:#9C9C9C;cursor:pointer}.Tabs.Row .TabText.active{color:#242424;font-weight:600}.Tabs.Row .TabBorderBottom{height:5px;border-radius:4px;background:transparent}.Tabs.Row .TabBorderBottom.active{background:#242424}.RecordContainer{margin:5px 0;padding:10px;box-shadow:0px 0px 8px 0px #0000001A;border-radius:5px}.RecordContainer .Title{color:#242424;font-size:16px;font-weight:600;line-height:19px;letter-spacing:0px;text-align:left}.RecordContainer .Amount{font-size:16px;font-weight:600;line-height:19px;letter-spacing:0px;text-align:left}.RecordContainer .Amount.Positive{color:#53B65A}.RecordContainer .Amount.Negative{color:#B41E2D}.RecordContainer .DateTime{color:#9C9C9C;font-size:16px;font-weight:400;line-height:19px;letter-spacing:0px;text-align:left}.RecordContainer .Tag{font-size:12px;font-weight:500;line-height:14px;letter-spacing:0em;text-align:center;color:#767171;padding:8px 30px;border-radius:8px;box-shadow:0px 2px 4px 0px #00000040}.NoContent{font-size:16px;color:var(--emfe-w-color-black-100, #afafaf);text-align:center;height:120px;line-height:120px}";
255
-
256
- const PlayerElevatePointsHistory$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
257
- constructor() {
258
- super();
259
- this.__registerHost();
260
- this.__attachShadow();
261
- this.paginationReset = createEvent(this, "paginationReset", 7);
262
- /**
263
- * Customize pagination: Activate pagination secondary arrows
264
- */
265
- this.secondaryArrowsActive = true;
266
- /**
267
- * Customize pagination: Activate pagination numbered navigation
268
- */
269
- this.displayPageNumbers = false;
270
- /**
271
- * Customize page list options, default: 10,25,50
272
- */
273
- this.pageLimitOptions = '10,25,50';
274
- /**
275
- * Language of the widget
276
- */
277
- this.language = 'en';
278
- /**
279
- * Client custom styling via string
280
- */
281
- this.clientStyling = '';
282
- /**
283
- * Client custom styling via url
284
- */
285
- this.clientStylingUrl = '';
286
- /**
287
- * translation via url
288
- */
289
- this.translationUrl = '';
290
- this.locale = translation['en'];
291
- this.type = WalletType.spendable;
292
- this.pointsWallets = {};
293
- }
294
- switchTab(type) {
295
- var _a, _b;
296
- this.type = type;
297
- if (this.pointsWallets[type] || !((_a = this.pointsWallets[type]) === null || _a === void 0 ? void 0 : _a.isLoadFailed)) {
298
- return;
299
- }
300
- this.paginationReset.emit({ limit: ((_b = this.pointsWallets[type]) === null || _b === void 0 ? void 0 : _b.pageSetting.limit) || this.limit, tableId: this.type });
301
- }
302
- getPageSettingByType(type) {
303
- return this.pointsWallets[type] ? this.pointsWallets[type].pageSetting : {
304
- limit: this.limit, total: 0, offset: 0, tableId: type,
305
- secondaryArrowsActive: this.secondaryArrowsActive,
306
- displayPageNumbers: this.displayPageNumbers,
307
- pageLimitOptions: this.pageLimitOptions || undefined
308
- };
309
- }
310
- loadWallets(renderer) {
311
- if (!this.pointsWallets[this.type] || this.pointsWallets[this.type].isLoading) {
312
- return h("general-animation-loading", null);
313
- }
314
- else {
315
- if (this.pointsWallets[this.type].wallets.length === 0) {
316
- return (h("div", { class: "NoContent" }, this.locale.noContent));
317
- }
318
- else {
319
- return renderer();
320
- }
321
- }
322
- }
323
- render() {
324
- var _a, _b;
325
- const pageSetting = this.getPageSettingByType(this.type);
326
- return (h("main", null, h("general-styling-wrapper", { clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl,
327
- // @ts-ignore
328
- targetTranslations: translation, translationUrl: this.translationUrl }), h("player-elevate-pointcard", { playerAvatarUrl: this.playerAvatarUrl, endpoint: this.endpoint, session: this.session, language: this.language, clientStylingUrl: this.clientStylingUrl, clientStyling: this.clientStyling, translationUrl: this.translationUrl }), h("div", { class: "PlayerElevatePointsDetaisContainer" }, [
329
- renderTopBar(this.locale, this.type, pageSetting),
330
- renderTabs(this.locale, this.type, (type) => this.switchTab(type)),
331
- ((_a = this.pointsWallets[this.type]) === null || _a === void 0 ? void 0 : _a.isLoadFailed)
332
- ? h("div", { class: 'ReloadMsg' }, this.locale['reloadMsgWhenError'], h("a", { class: 'Reload', onClick: () => { this.updateWallets(); } }, this.locale['reload']))
333
- : this.loadWallets(renderWallets.bind(this, this.locale, ((_b = this.pointsWallets[this.type]) === null || _b === void 0 ? void 0 : _b.wallets) || [], pageSetting))
334
- ])));
335
- }
336
- walletTypeChangedHandler() {
337
- //do not reload when loaded tab switched back
338
- if (this.pointsWallets[this.type]) {
339
- return;
340
- }
341
- this.updateWallets();
342
- }
343
- async updateWallets() {
344
- let pageSetting = this.pointsWallets[this.type]
345
- ? this.pointsWallets[this.type].pageSetting
346
- : this.getPageSettingByType(this.type);
347
- try {
348
- const walletsDetail = await getWallets(this.endpoint, this.language, this.type, this.session, pageSetting);
349
- const wallets = walletsDetail.data || [];
350
- if (walletsDetail.success) {
351
- pageSetting.total = walletsDetail.total;
352
- this.pointsWallets[this.type] = Object.assign(Object.assign({}, this.pointsWallets[this.type]), { wallets,
353
- pageSetting });
354
- this.pointsWallets = Object.assign({}, this.pointsWallets);
355
- }
356
- else {
357
- console.error(walletsDetail);
358
- this.pointsWallets[this.type].isLoadFailed = true;
359
- //pageSetting.total = 0;
360
- }
361
- }
362
- catch (e) {
363
- console.error(e);
364
- this.pointsWallets[this.type].isLoadFailed = true;
365
- }
366
- }
367
- reloadPageByTypeHandler(event) {
368
- if (event.detail.tableId != this.type) {
369
- return;
370
- }
371
- //reset all wallets when limit changed
372
- //otherwise fetch new data with new offset when offset changed
373
- if (this.limit != event.detail.limit) {
374
- this.pointsWallets = {};
375
- this.limit = event.detail.limit;
376
- }
377
- else {
378
- let pageSetting = this.pointsWallets[this.type].pageSetting || this.getPageSettingByType(this.type);
379
- pageSetting.offset = event.detail.offset;
380
- this.pointsWallets[this.type].pageSetting = pageSetting;
381
- }
382
- this.updateWallets();
383
- }
384
- setLimit() {
385
- try {
386
- const pageLimits = this.pageLimitOptions.split(',').map((item) => {
387
- return parseInt(item);
388
- });
389
- if (pageLimits.includes(this.limit)) ;
390
- else {
391
- this.limit = pageLimits[0];
392
- }
393
- }
394
- catch (e) {
395
- console.error('Error when parse PageLimitOptions', e);
396
- this.limit = 10;
397
- }
398
- }
399
- async componentWillLoad() {
400
- this.setLimit();
401
- this.updateWallets();
402
- }
403
- static get assetsDirs() { return ["static"]; }
404
- static get watchers() { return {
405
- "type": ["walletTypeChangedHandler"],
406
- "endpoint": ["updateWallets"],
407
- "language": ["updateWallets"],
408
- "session": ["updateWallets"]
409
- }; }
410
- static get style() { return playerElevatePointsHistoryCss; }
411
- }, [1, "player-elevate-points-history", {
412
- "playerAvatarUrl": [513, "player-avatar-url"],
413
- "session": [513],
414
- "endpoint": [513],
415
- "limit": [1538],
416
- "secondaryArrowsActive": [1540, "secondary-arrows-active"],
417
- "displayPageNumbers": [1540, "display-page-numbers"],
418
- "pageLimitOptions": [1537, "page-limit-options"],
419
- "language": [513],
420
- "clientStyling": [513, "client-styling"],
421
- "clientStylingUrl": [513, "client-styling-url"],
422
- "translationUrl": [513, "translation-url"],
423
- "locale": [32],
424
- "type": [32],
425
- "pageSetting": [32],
426
- "pointsWallets": [32]
427
- }, [[0, "reloadPageByType", "reloadPageByTypeHandler"]]]);
428
- function defineCustomElement$1() {
429
- if (typeof customElements === "undefined") {
430
- return;
431
- }
432
- const components = ["player-elevate-points-history", "bonus-pagination-limits", "bonus-pagination-nav", "general-styling-wrapper", "player-elevate-card-data", "player-elevate-pointcard"];
433
- components.forEach(tagName => { switch (tagName) {
434
- case "player-elevate-points-history":
435
- if (!customElements.get(tagName)) {
436
- customElements.define(tagName, PlayerElevatePointsHistory$1);
437
- }
438
- break;
439
- case "bonus-pagination-limits":
440
- if (!customElements.get(tagName)) {
441
- defineCustomElement$6();
442
- }
443
- break;
444
- case "bonus-pagination-nav":
445
- if (!customElements.get(tagName)) {
446
- defineCustomElement$5();
447
- }
448
- break;
449
- case "general-styling-wrapper":
450
- if (!customElements.get(tagName)) {
451
- defineCustomElement$4();
452
- }
453
- break;
454
- case "player-elevate-card-data":
455
- if (!customElements.get(tagName)) {
456
- defineCustomElement$3();
457
- }
458
- break;
459
- case "player-elevate-pointcard":
460
- if (!customElements.get(tagName)) {
461
- defineCustomElement$2();
462
- }
463
- break;
464
- } });
465
- }
466
- defineCustomElement$1();
467
-
468
- const PlayerElevatePointsHistory = PlayerElevatePointsHistory$1;
469
- const defineCustomElement = defineCustomElement$1;
470
-
471
- export { PlayerElevatePointsHistory, defineCustomElement };