@everymatrix/bonus-elevate-shop 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 (76) hide show
  1. package/dist/bonus-elevate-shop/bonus-elevate-shop.esm.js +1 -0
  2. package/dist/bonus-elevate-shop/index.esm.js +0 -0
  3. package/dist/bonus-elevate-shop/p-0b8ef56a.entry.js +1 -0
  4. package/dist/bonus-elevate-shop/p-248310cb.js +2 -0
  5. package/dist/bonus-elevate-shop/p-3feb3345.entry.js +1 -0
  6. package/dist/bonus-elevate-shop/p-5048c470.entry.js +1 -0
  7. package/dist/bonus-elevate-shop/p-e1255160.js +1 -0
  8. package/dist/bonus-elevate-shop/p-e5a4fd7f.js +1 -0
  9. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  10. package/dist/cjs/bonus-elevate-shop.cjs.js +25 -0
  11. package/dist/cjs/bonus-elevate-shop_4.cjs.entry.js +730 -0
  12. package/dist/cjs/index-950597be.js +1650 -0
  13. package/dist/cjs/index.cjs.js +2 -0
  14. package/dist/cjs/loader.cjs.js +15 -0
  15. package/dist/cjs/player-elevate-card-items-94136a9c.js +2364 -0
  16. package/dist/cjs/player-elevate-card.cjs.entry.js +74 -0
  17. package/dist/cjs/player-elevate-loyaltycard.cjs.entry.js +81 -0
  18. package/dist/collection/collection-manifest.json +28 -0
  19. package/dist/collection/components/bonus-elevate-shop/bonus-elevate-shop.css +92 -0
  20. package/dist/collection/components/bonus-elevate-shop/bonus-elevate-shop.js +247 -0
  21. package/dist/collection/components/bonus-elevate-shop/index.js +1 -0
  22. package/dist/collection/index.js +1 -0
  23. package/dist/collection/renders/renderGifts.js +30 -0
  24. package/dist/collection/static/avaliable.false.svg +47 -0
  25. package/dist/collection/static/avaliable.true.svg +47 -0
  26. package/dist/collection/utils/fetch.js +29 -0
  27. package/dist/collection/utils/translation.js +7 -0
  28. package/dist/collection/utils/types.js +1 -0
  29. package/dist/collection/utils/utils.js +3 -0
  30. package/dist/esm/app-globals-0f993ce5.js +3 -0
  31. package/dist/esm/bonus-elevate-shop.js +20 -0
  32. package/dist/esm/bonus-elevate-shop_4.entry.js +723 -0
  33. package/dist/esm/index-a343bbd8.js +1620 -0
  34. package/dist/esm/index.js +1 -0
  35. package/dist/esm/loader.js +11 -0
  36. package/dist/esm/player-elevate-card-items-ea0abf0a.js +2351 -0
  37. package/dist/esm/player-elevate-card.entry.js +70 -0
  38. package/dist/esm/player-elevate-loyaltycard.entry.js +77 -0
  39. package/dist/index.cjs.js +1 -0
  40. package/dist/index.js +1 -0
  41. package/dist/static/button-default.svg +42 -0
  42. package/dist/static/button-disabled.svg +4 -0
  43. package/dist/static/button-hover.svg +4 -0
  44. package/dist/static/button-level.svg +27 -0
  45. package/dist/static/button-pressed.svg +18 -0
  46. package/dist/static/button-redeem.svg +36 -0
  47. package/dist/static/card-ground-over.png +0 -0
  48. package/dist/static/card-ground-over.svg +903 -0
  49. package/dist/static/card-ground.png +0 -0
  50. package/dist/static/card-ground.svg +34 -0
  51. package/dist/static/info.svg +4 -0
  52. package/dist/static/level-badge.png +0 -0
  53. package/dist/static/level-percent.svg +80 -0
  54. package/dist/static/tips-info.svg +21 -0
  55. package/dist/static/user.svg +3 -0
  56. package/dist/stencil.config.dev.js +17 -0
  57. package/dist/stencil.config.js +17 -0
  58. package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/bonus-elevate-shop/.stencil/packages/stencil/bonus-elevate-shop/stencil.config.d.ts +2 -0
  59. package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/bonus-elevate-shop/.stencil/packages/stencil/bonus-elevate-shop/stencil.config.dev.d.ts +2 -0
  60. package/dist/types/components/bonus-elevate-shop/bonus-elevate-shop.d.ts +45 -0
  61. package/dist/types/components/bonus-elevate-shop/index.d.ts +1 -0
  62. package/dist/types/components.d.ts +101 -0
  63. package/dist/types/index.d.ts +1 -0
  64. package/dist/types/renders/renderGifts.d.ts +3 -0
  65. package/dist/types/stencil-public-runtime.d.ts +1674 -0
  66. package/dist/types/utils/fetch.d.ts +3 -0
  67. package/dist/types/utils/translation.d.ts +8 -0
  68. package/dist/types/utils/types.d.ts +12 -0
  69. package/dist/types/utils/utils.d.ts +1 -0
  70. package/loader/cdn.js +1 -0
  71. package/loader/index.cjs.js +1 -0
  72. package/loader/index.d.ts +24 -0
  73. package/loader/index.es2017.js +1 -0
  74. package/loader/index.js +2 -0
  75. package/loader/package.json +11 -0
  76. package/package.json +31 -0
@@ -0,0 +1,730 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-950597be.js');
6
+ const playerElevateCardItems = require('./player-elevate-card-items-94136a9c.js');
7
+
8
+ const getUrl = (path, params = {}) => {
9
+ return path + '?' + Object.keys(params).map(key => `${key}=${params[key]}`).join('&');
10
+ };
11
+ const fetcher = async (input, init = {}) => {
12
+ let res;
13
+ // @ts-ignore
14
+ res = await fetch(input, init);
15
+ res = await res.text();
16
+ try {
17
+ res = JSON.parse(res);
18
+ }
19
+ catch (e) {
20
+ console.error(e);
21
+ }
22
+ return res;
23
+ };
24
+ async function fetchNorwayApi(path, params = {}, init = {}) {
25
+ const { endpoint, language, session } = this;
26
+ const fetchParams = params;
27
+ if (!init.method || init.method === 'GET') {
28
+ fetchParams.language = language;
29
+ }
30
+ const url = getUrl(`${endpoint}${path}`, fetchParams);
31
+ if (!init.headers)
32
+ init.headers = {};
33
+ init.headers['x-SessionId'] = session;
34
+ const res = await fetcher(url, init);
35
+ return res;
36
+ }
37
+
38
+ const translation = {
39
+ en: {
40
+ Points: 'Points',
41
+ Point: 'Point',
42
+ noContent: 'No Content',
43
+ }
44
+ };
45
+
46
+ const avaliableTrueSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDYiIGhlaWdodD0iNDYiIHZpZXdCb3g9IjAgMCA0NiA0NiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA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l8xODNfNjQ5NyIgeDE9IjQyIiB5MT0iMzgiIHgyPSIyNy4wNTU4IiB5Mj0iMzQuMzE1NiIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgo8c3RvcCBzdG9wLWNvbG9yPSJ3aGl0ZSIgc3RvcC1vcGFjaXR5PSIwLjUiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSJ3aGl0ZSIgc3RvcC1vcGFjaXR5PSIwIi8+CjwvbGluZWFyR3JhZGllbnQ+CjwvZGVmcz4KPC9zdmc+Cg==';
49
+
50
+ const getStatusData = (gift, redeem) => {
51
+ switch (gift.available) {
52
+ case "true":
53
+ return {
54
+ extraClass: ' active',
55
+ onClick: () => redeem(gift.id),
56
+ icon: avaliableTrueSvg
57
+ };
58
+ case "false":
59
+ return {
60
+ extraClass: ' deactive',
61
+ onClick: () => { },
62
+ icon: avaliableFalseSvg
63
+ };
64
+ }
65
+ };
66
+ const renderGifts = (gifts, locale, redeem) => {
67
+ return (index.h("div", { class: "Gifts FlexLayout" }, gifts.map(gift => {
68
+ var _a;
69
+ const statusData = getStatusData(gift, redeem);
70
+ const presentation = gift.presentation;
71
+ const getPropForBackgroundImage = (asset) => asset ?
72
+ { backgroundImage: `url('${asset}')` } :
73
+ {};
74
+ return (index.h("div", { class: "Gift" },
75
+ index.h("div", { class: "ImgContainer", onClick: () => window.postMessage({ type: 'BEEShopImgClicked', itemId: gift.id }, window.location.href), style: Object.assign({}, getPropForBackgroundImage(((_a = presentation.assets) === null || _a === void 0 ? void 0 : _a.length) > 0 ? presentation.assets[0] : '')) }),
76
+ index.h("div", { class: "InfoContainer" },
77
+ index.h("div", null,
78
+ index.h("div", { class: "Point" },
79
+ gift.points,
80
+ " ",
81
+ gift.points === 1 ? locale.Point : locale.Points),
82
+ index.h("div", { class: "Title" }, (presentation === null || presentation === void 0 ? void 0 : presentation.displayName) || gift.displayName),
83
+ index.h("div", { class: "Description" }, (presentation === null || presentation === void 0 ? void 0 : presentation.description) || '')),
84
+ index.h("div", { class: "AvaliableWrap" + statusData.extraClass, onClick: () => statusData.onClick() },
85
+ index.h("span", { innerHTML: statusData.icon })))));
86
+ })));
87
+ };
88
+
89
+ var GeneralAnimationLoadingVIKkNY2X = {};
90
+
91
+ (function (exports) {
92
+ var V=Object.defineProperty,z=Object.defineProperties;var F=Object.getOwnPropertyDescriptors;var N=Object.getOwnPropertySymbols;var G=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable;var v=(e,t,n)=>t in e?V(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P=(e,t)=>{for(var n in t||(t={}))G.call(t,n)&&v(e,n,t[n]);if(N)for(var n of N(t))q.call(t,n)&&v(e,n,t[n]);return e},M=(e,t)=>z(e,F(t));var $=(e,t,n)=>v(e,typeof t!="symbol"?t+"":t,n);var T=(e,t,n)=>new Promise((i,l)=>{var s=o=>{try{u(n.next(o));}catch(r){l(r);}},c=o=>{try{u(n.throw(o));}catch(r){l(r);}},u=o=>o.done?i(o.value):Promise.resolve(o.value).then(s,c);u((n=n.apply(e,t)).next());});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function g(){}function H(e){return e()}function B(){return Object.create(null)}function b(e){e.forEach(H);}function I(e){return typeof e=="function"}function K(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}function Q(e){return Object.keys(e).length===0}function W(e,t){e.appendChild(t);}function X(e,t,n){const i=Y(e);if(!i.getElementById(t)){const l=L("style");l.id=t,l.textContent=n,Z(i,l);}}function Y(e){if(!e)return document;const t=e.getRootNode?e.getRootNode():e.ownerDocument;return t&&t.host?t:e.ownerDocument}function Z(e,t){return W(e.head||e,t),t.sheet}function U(e,t,n){e.insertBefore(t,n||null);}function C(e){e.parentNode&&e.parentNode.removeChild(e);}function L(e){return document.createElement(e)}function tt(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n);}function et(e){return Array.from(e.childNodes)}function nt(e){const t={};return e.childNodes.forEach(n=>{t[n.slot||"default"]=!0;}),t}let j;function _(e){j=e;}const h=[],w=[];let m=[];const R=[],st=Promise.resolve();let k=!1;function it(){k||(k=!0,st.then(y));}function E(e){m.push(e);}const x=new Set;let a=0;function y(){if(a!==0)return;const e=j;do{try{for(;a<h.length;){const t=h[a];a++,_(t),rt(t.$$);}}catch(t){throw h.length=0,a=0,t}for(_(null),h.length=0,a=0;w.length;)w.pop()();for(let t=0;t<m.length;t+=1){const n=m[t];x.has(n)||(x.add(n),n());}m.length=0;}while(h.length);for(;R.length;)R.pop()();k=!1,x.clear(),_(e);}function rt(e){if(e.fragment!==null){e.update(),b(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(E);}}function lt(e){const t=[],n=[];m.forEach(i=>e.indexOf(i)===-1?t.push(i):n.push(i)),n.forEach(i=>i()),m=t;}const ct=new Set;function ot(e,t){e&&e.i&&(ct.delete(e),e.i(t));}function ut(e,t,n){const{fragment:i,after_update:l}=e.$$;i&&i.m(t,n),E(()=>{const s=e.$$.on_mount.map(H).filter(I);e.$$.on_destroy?e.$$.on_destroy.push(...s):b(s),e.$$.on_mount=[];}),l.forEach(E);}function dt(e,t){const n=e.$$;n.fragment!==null&&(lt(n.after_update),b(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[]);}function $t(e,t){e.$$.dirty[0]===-1&&(h.push(e),it(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31;}function ft(e,t,n,i,l,s,c=null,u=[-1]){const o=j;_(e);const r=e.$$={fragment:null,ctx:[],props:s,update:g,not_equal:l,bound:B(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(o?o.$$.context:[])),callbacks:B(),dirty:u,skip_bound:!1,root:t.target||o.$$.root};c&&c(r.root);let f=!1;if(r.ctx=n?n(e,t.props||{},(d,O,...S)=>{const A=S.length?S[0]:O;return r.ctx&&l(r.ctx[d],r.ctx[d]=A)&&(!r.skip_bound&&r.bound[d]&&r.bound[d](A),f&&$t(e,d)),O}):[],r.update(),f=!0,b(r.before_update),r.fragment=i?i(r.ctx):!1,t.target){if(t.hydrate){const d=et(t.target);r.fragment&&r.fragment.l(d),d.forEach(C);}else r.fragment&&r.fragment.c();t.intro&&ot(e.$$.fragment),ut(e,t.target,t.anchor),y();}_(o);}let D;typeof HTMLElement=="function"&&(D=class extends HTMLElement{constructor(t,n,i){super();$(this,"$$ctor");$(this,"$$s");$(this,"$$c");$(this,"$$cn",!1);$(this,"$$d",{});$(this,"$$r",!1);$(this,"$$p_d",{});$(this,"$$l",{});$(this,"$$l_u",new Map);this.$$ctor=t,this.$$s=n,i&&this.attachShadow({mode:"open"});}addEventListener(t,n,i){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(n),this.$$c){const l=this.$$c.$on(t,n);this.$$l_u.set(n,l);}super.addEventListener(t,n,i);}removeEventListener(t,n,i){if(super.removeEventListener(t,n,i),this.$$c){const l=this.$$l_u.get(n);l&&(l(),this.$$l_u.delete(n));}}connectedCallback(){return T(this,null,function*(){if(this.$$cn=!0,!this.$$c){let t=function(s){return ()=>{let c;return {c:function(){c=L("slot"),s!=="default"&&tt(c,"name",s);},m:function(r,f){U(r,c,f);},d:function(r){r&&C(c);}}}};if(yield Promise.resolve(),!this.$$cn||this.$$c)return;const n={},i=nt(this);for(const s of this.$$s)s in i&&(n[s]=[t(s)]);for(const s of this.attributes){const c=this.$$g_p(s.name);c in this.$$d||(this.$$d[c]=p(c,s.value,this.$$p_d,"toProp"));}for(const s in this.$$p_d)!(s in this.$$d)&&this[s]!==void 0&&(this.$$d[s]=this[s],delete this[s]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:M(P({},this.$$d),{$$slots:n,$$scope:{ctx:[]}})});const l=()=>{this.$$r=!0;for(const s in this.$$p_d)if(this.$$d[s]=this.$$c.$$.ctx[this.$$c.$$.props[s]],this.$$p_d[s].reflect){const c=p(s,this.$$d[s],this.$$p_d,"toAttribute");c==null?this.removeAttribute(this.$$p_d[s].attribute||s):this.setAttribute(this.$$p_d[s].attribute||s,c);}this.$$r=!1;};this.$$c.$$.after_update.push(l),l();for(const s in this.$$l)for(const c of this.$$l[s]){const u=this.$$c.$on(s,c);this.$$l_u.set(c,u);}this.$$l={};}})}attributeChangedCallback(t,n,i){var l;this.$$r||(t=this.$$g_p(t),this.$$d[t]=p(t,i,this.$$p_d,"toProp"),(l=this.$$c)==null||l.$set({[t]:this.$$d[t]}));}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$c=void 0);});}$$g_p(t){return Object.keys(this.$$p_d).find(n=>this.$$p_d[n].attribute===t||!this.$$p_d[n].attribute&&n.toLowerCase()===t)||t}});function p(e,t,n,i){var s;const l=(s=n[e])==null?void 0:s.type;if(t=l==="Boolean"&&typeof t!="boolean"?t!=null:t,!i||!n[e])return t;if(i==="toAttribute")switch(l){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t==null?null:t;default:return t}else switch(l){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function at(e,t,n,i,l,s){let c=class extends D{constructor(){super(e,n,l),this.$$p_d=t;}static get observedAttributes(){return Object.keys(t).map(u=>(t[u].attribute||u).toLowerCase())}};return Object.keys(t).forEach(u=>{Object.defineProperty(c.prototype,u,{get(){return this.$$c&&u in this.$$c?this.$$c[u]:this.$$d[u]},set(o){var r;o=p(u,o,t),this.$$d[u]=o,(r=this.$$c)==null||r.$set({[u]:o});}});}),i.forEach(u=>{Object.defineProperty(c.prototype,u,{get(){var o;return (o=this.$$c)==null?void 0:o[u]}});}),e.element=c,c}class ht{constructor(){$(this,"$$");$(this,"$$set");}$destroy(){dt(this,1),this.$destroy=g;}$on(t,n){if(!I(n))return g;const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(n),()=>{const l=i.indexOf(n);l!==-1&&i.splice(l,1);}}$set(t){this.$$set&&!Q(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1);}}const gt="4";typeof window!="undefined"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(gt);function mt(e){X(e,"svelte-g6m3er",".LoaderContainer.svelte-g6m3er.svelte-g6m3er{display:flex;justify-content:center}.lds-ellipsis.svelte-g6m3er.svelte-g6m3er{display:inline-block;position:relative;width:80px;height:80px}.lds-ellipsis.svelte-g6m3er div.svelte-g6m3er{position:absolute;top:33px;width:13px;height:13px;border-radius:50%;background:#d1d1d1;animation-timing-function:cubic-bezier(0, 1, 1, 0)}.lds-ellipsis.svelte-g6m3er div.svelte-g6m3er:nth-child(1){left:8px;animation:svelte-g6m3er-lds-ellipsis1 0.6s infinite}.lds-ellipsis.svelte-g6m3er div.svelte-g6m3er:nth-child(2){left:8px;animation:svelte-g6m3er-lds-ellipsis2 0.6s infinite}.lds-ellipsis.svelte-g6m3er div.svelte-g6m3er:nth-child(3){left:32px;animation:svelte-g6m3er-lds-ellipsis2 0.6s infinite}.lds-ellipsis.svelte-g6m3er div.svelte-g6m3er:nth-child(4){left:56px;animation:svelte-g6m3er-lds-ellipsis3 0.6s infinite}@keyframes svelte-g6m3er-lds-ellipsis1{0%{transform:scale(0)}100%{transform:scale(1)}}@keyframes svelte-g6m3er-lds-ellipsis3{0%{transform:scale(1)}100%{transform:scale(0)}}@keyframes svelte-g6m3er-lds-ellipsis2{0%{transform:translate(0, 0)}100%{transform:translate(24px, 0)}}");}function _t(e){let t;return {c(){t=L("div"),t.innerHTML='<section class="LoaderContainer svelte-g6m3er" part="LoaderContainer"><div class="lds-ellipsis svelte-g6m3er"><div class="svelte-g6m3er"></div><div class="svelte-g6m3er"></div><div class="svelte-g6m3er"></div><div class="svelte-g6m3er"></div></div></section>';},m(n,i){U(n,t,i),e[3](t);},p:g,i:g,o:g,d(n){n&&C(t),e[3](null);}}}function pt(e,t,n){let{clientstyling:i=""}=t,{clientstylingurl:l=""}=t,s;const c=()=>{let r=document.createElement("style");r.innerHTML=i,s.appendChild(r);},u=()=>{let r=new URL(l),f=document.createElement("style");fetch(r.href).then(d=>d.text()).then(d=>{f.innerHTML=d,setTimeout(()=>{s.appendChild(f);},1),setTimeout(()=>{},500);});};function o(r){w[r?"unshift":"push"](()=>{s=r,n(0,s);});}return e.$$set=r=>{"clientstyling"in r&&n(1,i=r.clientstyling),"clientstylingurl"in r&&n(2,l=r.clientstylingurl);},e.$$.update=()=>{e.$$.dirty&3&&i&&s&&c(),e.$$.dirty&5&&l&&s&&u();},[s,i,l,o]}class J extends ht{constructor(t){super(),ft(this,t,pt,_t,K,{clientstyling:1,clientstylingurl:2},mt);}get clientstyling(){return this.$$.ctx[1]}set clientstyling(t){this.$$set({clientstyling:t}),y();}get clientstylingurl(){return this.$$.ctx[2]}set clientstylingurl(t){this.$$set({clientstylingurl:t}),y();}}at(J,{clientstyling:{},clientstylingurl:{}},[],[],!0);exports.default=J;
93
+ }(GeneralAnimationLoadingVIKkNY2X));
94
+
95
+ if(typeof window!="undefined"){let n=function(t){return function(...i){try{return t.apply(this,i)}catch(e){if(e instanceof DOMException&&e.message.includes("has already been used with this registry")||e.message.includes("Cannot define multiple custom elements with the same tag name"))return !1;throw e}}};customElements.define=n(customElements.define),Promise.resolve().then(()=>GeneralAnimationLoadingVIKkNY2X).then(({default:t})=>{!customElements.get("general-animation-loading")&&customElements.define("general-animation-loading",t.element);});}
96
+
97
+ const bonusElevateShopCss = ":host{display:block}svg circle{shape-rendering:crispEdges}.MainContainer{max-width:420px}.MainContainer player-elevate-pointcard{width:100%;height:220px}.Gifts{display:flex;justify-content:space-between;padding:15px;padding-left:-8px;padding-right:-8px;flex:0 0 45.1282051282%;flex-wrap:wrap;justify-content:flex-start;background:var(--emfe-w-color-white, #FFFFFF);color:var(--emfe-w-color-black-150, #000000);font-weight:500;gap:10px;margin-top:-100px;position:relative;min-height:200px}.InfoContainer{display:flex;margin-top:17px;justify-content:space-between}.Gift{display:block;margin-bottom:10px;padding:8px;box-shadow:0px 18px 45px 0px var(--emfe-w-color-black-150, rgba(167, 167, 167, 0.2));border-radius:11px;background:var(--emfe-w-color-white, #FFFFFF)}.Gift .ImgContainer{width:160px;height:107px;border-radius:11px;box-shadow:0px 2px 6px 0px var(--emfe-w-color-black-200, rgba(0, 0, 0, 0.2509803922));cursor:pointer;background-size:cover;background-position:center center;background-repeat:no-repeat}.Gift .Point{font-size:20px}.Gift .Title,.Gift .Description{padding-left:3px}.Gift .Title{font-size:14px;margin-top:10px}.Gift .Description{font-size:12px;color:var(--emfe-w-color-black-100, #767171)}.Gift .AvaliableWrap{align-self:self-end}.Gift .AvaliableWrap.active{cursor:pointer}.Gift .AvaliableWrap.deactive{cursor:not-allowed}.Gift .AvaliableWrap span svg{width:var(--emfe-w-elevate-avaliable-button-size, 46px)}.NoContent{font-size:16px;color:var(--emfe-w-color-black-100, #afafaf);text-align:center;height:120px;line-height:120px}";
98
+ const BonusElevateShopStyle0 = bonusElevateShopCss;
99
+
100
+ const BonusElevateShop = class {
101
+ constructor(hostRef) {
102
+ index.registerInstance(this, hostRef);
103
+ this.redeemGiftButton = index.createEvent(this, "redeemGiftButton", 7);
104
+ this.bindedHandler = this.handleMessage.bind(this);
105
+ this.session = undefined;
106
+ this.endpoint = undefined;
107
+ this.language = 'en';
108
+ this.clientStyling = '';
109
+ this.clientStylingUrl = '';
110
+ this.translationUrl = '';
111
+ this.locale = translation['en'];
112
+ this.gifts = [];
113
+ this.isLoading = true;
114
+ }
115
+ async updateGifts() {
116
+ this.isLoading = true;
117
+ if (this.session) {
118
+ const res = await fetchNorwayApi.bind(this, '/v1/elevate/shop', {}).call();
119
+ this.gifts = res.data || [];
120
+ }
121
+ else {
122
+ this.gifts = [];
123
+ }
124
+ this.isLoading = false;
125
+ }
126
+ redeemGiftConfirm(id) {
127
+ const shopItem = this.gifts.filter((gift) => {
128
+ return gift.id === id;
129
+ })[0];
130
+ window.postMessage({ type: 'BEERedeemConfirm', shopItem }, window.location.href);
131
+ }
132
+ disconnectedCallback() {
133
+ window.removeEventListener('message', this.bindedHandler, false);
134
+ }
135
+ async redeemGift(id) {
136
+ const res = await fetchNorwayApi.bind(this, '/v1/elevate/redeem', {}, {
137
+ method: 'PUT',
138
+ body: JSON.stringify({ giftID: id }),
139
+ headers: {
140
+ 'Content-Type': 'application/json-patch+json',
141
+ }
142
+ }).call();
143
+ if (res.success) {
144
+ this.redeemGiftButton.emit();
145
+ window.postMessage({ type: 'BEEGiftRedeem', itemId: id }, window.location.href);
146
+ }
147
+ else {
148
+ window.postMessage({ type: 'BEEGiftRedeemFailed', itemId: id, err: res }, window.location.href);
149
+ }
150
+ }
151
+ loadGifts(renderer) {
152
+ if (this.isLoading) {
153
+ return index.h("general-animation-loading", null);
154
+ }
155
+ else {
156
+ if (this.gifts.length === 0) {
157
+ return (index.h("div", { class: "NoContent" }, this.locale.noContent));
158
+ }
159
+ else {
160
+ return renderer();
161
+ }
162
+ }
163
+ }
164
+ render() {
165
+ return (index.h("main", { key: 'd659585662c983efd2eeb69a3880ec8328ad8351', class: "MainContainer" }, index.h("general-styling-wrapper", { key: 'a9b2650455ecd27849e55553eb1679dddce7b7cd', clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, targetTranslations: translation, translationUrl: this.translationUrl }), index.h("player-elevate-pointcard", { key: 'f042fb5c3fcb5d5c03059507a1201d1e56dfd5d4', endpoint: this.endpoint, session: this.session, language: this.language, clientStylingUrl: this.clientStylingUrl, clientStyling: this.clientStyling, translationUrl: this.translationUrl }), this.loadGifts(renderGifts.bind(this, this.gifts, this.locale, this.redeemGiftConfirm.bind(this)))));
166
+ }
167
+ handleMessage(message) {
168
+ if (message.data.type === "bee-redeem-confirmed" && message.data.id) {
169
+ this.redeemGift(message.data.id);
170
+ }
171
+ }
172
+ async componentDidLoad() {
173
+ this.updateGifts();
174
+ window.addEventListener('message', this.bindedHandler, false);
175
+ }
176
+ static get assetsDirs() { return ["static"]; }
177
+ static get watchers() { return {
178
+ "endpoint": ["updateGifts"],
179
+ "language": ["updateGifts"],
180
+ "session": ["updateGifts"]
181
+ }; }
182
+ };
183
+ BonusElevateShop.style = BonusElevateShopStyle0;
184
+
185
+ const mergeTranslations = (url, target) => {
186
+ return new Promise((resolve) => {
187
+ fetch(url)
188
+ .then((res) => res.json())
189
+ .then((data) => {
190
+ Object.keys(data).forEach((item) => {
191
+ target[item] = target[item] ? target[item] : {};
192
+ for (let key in data[item]) {
193
+ target[item][key] = data[item][key];
194
+ }
195
+ });
196
+ resolve(true);
197
+ });
198
+ });
199
+ };
200
+
201
+ const generalStylingWrapperCss = ":host{display:block}";
202
+ const GeneralStylingWrapperStyle0 = generalStylingWrapperCss;
203
+
204
+ const GeneralStylingWrapper = class {
205
+ constructor(hostRef) {
206
+ index.registerInstance(this, hostRef);
207
+ this.stylingAppends = false;
208
+ this.setClientStyling = () => {
209
+ let sheet = document.createElement('style');
210
+ sheet.innerHTML = this.clientStyling;
211
+ this.el.prepend(sheet);
212
+ };
213
+ this.setClientStylingURL = () => {
214
+ let url = new URL(this.clientStylingUrl);
215
+ let cssFile = document.createElement('style');
216
+ fetch(url.href)
217
+ .then((res) => res.text())
218
+ .then((data) => {
219
+ cssFile.innerHTML = data;
220
+ setTimeout(() => {
221
+ this.el.prepend(cssFile);
222
+ }, 1);
223
+ })
224
+ .catch((err) => {
225
+ console.log('error ', err);
226
+ });
227
+ };
228
+ this.clientStyling = '';
229
+ this.clientStylingUrl = '';
230
+ this.translationUrl = '';
231
+ this.targetTranslations = undefined;
232
+ }
233
+ componentDidRender() {
234
+ // start custom styling area
235
+ if (!this.stylingAppends) {
236
+ if (this.clientStyling)
237
+ this.setClientStyling();
238
+ if (this.clientStylingUrl)
239
+ this.setClientStylingURL();
240
+ this.stylingAppends = true;
241
+ }
242
+ // end custom styling area
243
+ }
244
+ async componentWillLoad() {
245
+ const promises = [];
246
+ if (this.translationUrl) {
247
+ const translationPromise = mergeTranslations(this.translationUrl, this.targetTranslations);
248
+ promises.push(translationPromise);
249
+ }
250
+ return await Promise.all(promises);
251
+ }
252
+ render() {
253
+ return (index.h("div", { key: '4d3414408c7662f88331dbe655966237f74d6958', class: "StyleShell" }, index.h("slot", { key: '1d004644d84602c4314bdf5dfc26b55b160f57df', name: "mainContent" })));
254
+ }
255
+ get el() { return index.getElement(this); }
256
+ };
257
+ GeneralStylingWrapper.style = GeneralStylingWrapperStyle0;
258
+
259
+ /**
260
+ * @name startOfDay
261
+ * @category Day Helpers
262
+ * @summary Return the start of a day for the given date.
263
+ *
264
+ * @description
265
+ * Return the start of a day for the given date.
266
+ * The result will be in the local timezone.
267
+ *
268
+ * @param {Date|Number} date - the original date
269
+ * @returns {Date} the start of a day
270
+ * @throws {TypeError} 1 argument required
271
+ *
272
+ * @example
273
+ * // The start of a day for 2 September 2014 11:55:00:
274
+ * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))
275
+ * //=> Tue Sep 02 2014 00:00:00
276
+ */
277
+ function startOfDay(dirtyDate) {
278
+ playerElevateCardItems.requiredArgs(1, arguments);
279
+ var date = playerElevateCardItems.toDate(dirtyDate);
280
+ date.setHours(0, 0, 0, 0);
281
+ return date;
282
+ }
283
+
284
+ var MILLISECONDS_IN_DAY = 86400000;
285
+
286
+ /**
287
+ * @name differenceInCalendarDays
288
+ * @category Day Helpers
289
+ * @summary Get the number of calendar days between the given dates.
290
+ *
291
+ * @description
292
+ * Get the number of calendar days between the given dates. This means that the times are removed
293
+ * from the dates and then the difference in days is calculated.
294
+ *
295
+ * @param {Date|Number} dateLeft - the later date
296
+ * @param {Date|Number} dateRight - the earlier date
297
+ * @returns {Number} the number of calendar days
298
+ * @throws {TypeError} 2 arguments required
299
+ *
300
+ * @example
301
+ * // How many calendar days are between
302
+ * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?
303
+ * const result = differenceInCalendarDays(
304
+ * new Date(2012, 6, 2, 0, 0),
305
+ * new Date(2011, 6, 2, 23, 0)
306
+ * )
307
+ * //=> 366
308
+ * // How many calendar days are between
309
+ * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?
310
+ * const result = differenceInCalendarDays(
311
+ * new Date(2011, 6, 3, 0, 1),
312
+ * new Date(2011, 6, 2, 23, 59)
313
+ * )
314
+ * //=> 1
315
+ */
316
+ function differenceInCalendarDays(dirtyDateLeft, dirtyDateRight) {
317
+ playerElevateCardItems.requiredArgs(2, arguments);
318
+ var startOfDayLeft = startOfDay(dirtyDateLeft);
319
+ var startOfDayRight = startOfDay(dirtyDateRight);
320
+ var timestampLeft = startOfDayLeft.getTime() - playerElevateCardItems.getTimezoneOffsetInMilliseconds(startOfDayLeft);
321
+ var timestampRight = startOfDayRight.getTime() - playerElevateCardItems.getTimezoneOffsetInMilliseconds(startOfDayRight);
322
+
323
+ // Round the number of days to the nearest integer
324
+ // because the number of milliseconds in a day is not constant
325
+ // (e.g. it's different in the day of the daylight saving time clock shift)
326
+ return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_DAY);
327
+ }
328
+
329
+ /**
330
+ * Days in 1 week.
331
+ *
332
+ * @name daysInWeek
333
+ * @constant
334
+ * @type {number}
335
+ * @default
336
+ */
337
+
338
+ /**
339
+ * Milliseconds in 1 hour
340
+ *
341
+ * @name millisecondsInHour
342
+ * @constant
343
+ * @type {number}
344
+ * @default
345
+ */
346
+ var millisecondsInHour = 3600000;
347
+
348
+ /**
349
+ * @name differenceInMilliseconds
350
+ * @category Millisecond Helpers
351
+ * @summary Get the number of milliseconds between the given dates.
352
+ *
353
+ * @description
354
+ * Get the number of milliseconds between the given dates.
355
+ *
356
+ * @param {Date|Number} dateLeft - the later date
357
+ * @param {Date|Number} dateRight - the earlier date
358
+ * @returns {Number} the number of milliseconds
359
+ * @throws {TypeError} 2 arguments required
360
+ *
361
+ * @example
362
+ * // How many milliseconds are between
363
+ * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?
364
+ * const result = differenceInMilliseconds(
365
+ * new Date(2014, 6, 2, 12, 30, 21, 700),
366
+ * new Date(2014, 6, 2, 12, 30, 20, 600)
367
+ * )
368
+ * //=> 1100
369
+ */
370
+ function differenceInMilliseconds(dateLeft, dateRight) {
371
+ playerElevateCardItems.requiredArgs(2, arguments);
372
+ return playerElevateCardItems.toDate(dateLeft).getTime() - playerElevateCardItems.toDate(dateRight).getTime();
373
+ }
374
+
375
+ var roundingMap = {
376
+ ceil: Math.ceil,
377
+ round: Math.round,
378
+ floor: Math.floor,
379
+ trunc: function trunc(value) {
380
+ return value < 0 ? Math.ceil(value) : Math.floor(value);
381
+ } // Math.trunc is not supported by IE
382
+ };
383
+
384
+ var defaultRoundingMethod = 'trunc';
385
+ function getRoundingMethod(method) {
386
+ return method ? roundingMap[method] : roundingMap[defaultRoundingMethod];
387
+ }
388
+
389
+ /**
390
+ * @name differenceInHours
391
+ * @category Hour Helpers
392
+ * @summary Get the number of hours between the given dates.
393
+ *
394
+ * @description
395
+ * Get the number of hours between the given dates.
396
+ *
397
+ * @param {Date|Number} dateLeft - the later date
398
+ * @param {Date|Number} dateRight - the earlier date
399
+ * @param {Object} [options] - an object with options.
400
+ * @param {String} [options.roundingMethod='trunc'] - a rounding method (`ceil`, `floor`, `round` or `trunc`)
401
+ * @returns {Number} the number of hours
402
+ * @throws {TypeError} 2 arguments required
403
+ *
404
+ * @example
405
+ * // How many hours are between 2 July 2014 06:50:00 and 2 July 2014 19:00:00?
406
+ * const result = differenceInHours(
407
+ * new Date(2014, 6, 2, 19, 0),
408
+ * new Date(2014, 6, 2, 6, 50)
409
+ * )
410
+ * //=> 12
411
+ */
412
+ function differenceInHours(dateLeft, dateRight, options) {
413
+ playerElevateCardItems.requiredArgs(2, arguments);
414
+ var diff = differenceInMilliseconds(dateLeft, dateRight) / millisecondsInHour;
415
+ return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
416
+ }
417
+
418
+ /**
419
+ * @name isBefore
420
+ * @category Common Helpers
421
+ * @summary Is the first date before the second one?
422
+ *
423
+ * @description
424
+ * Is the first date before the second one?
425
+ *
426
+ * @param {Date|Number} date - the date that should be before the other one to return true
427
+ * @param {Date|Number} dateToCompare - the date to compare with
428
+ * @returns {Boolean} the first date is before the second date
429
+ * @throws {TypeError} 2 arguments required
430
+ *
431
+ * @example
432
+ * // Is 10 July 1989 before 11 February 1987?
433
+ * const result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))
434
+ * //=> false
435
+ */
436
+ function isBefore(dirtyDate, dirtyDateToCompare) {
437
+ playerElevateCardItems.requiredArgs(2, arguments);
438
+ var date = playerElevateCardItems.toDate(dirtyDate);
439
+ var dateToCompare = playerElevateCardItems.toDate(dirtyDateToCompare);
440
+ return date.getTime() < dateToCompare.getTime();
441
+ }
442
+
443
+ function updateProgressSvg(progressElementRef, percent) {
444
+ const svgElement = progressElementRef.querySelector('#total_level');
445
+ const endLockWidth = 17, pointR = 6.5;
446
+ //Total Widget of the progress
447
+ const barWidth = svgElement.getBBox().width;
448
+ //The filled width according to current progress
449
+ const levelPercent = percent > 1 ? 1 : percent;
450
+ const widthOnBar = (levelPercent * barWidth - endLockWidth) < 0 ? 0 : levelPercent * barWidth - endLockWidth;
451
+ //update bar's width, widthOnBar
452
+ const levelBar = progressElementRef.querySelector('#current_level');
453
+ //update filters, x = widthOnBar
454
+ const levelFilter = progressElementRef.querySelector('#filter_current_level');
455
+ //update circle, widthOnBar+10
456
+ const levelCircle = progressElementRef.querySelector('#circle_current_level');
457
+ svgElement.setAttribute('viewbox', `0 0 ${widthOnBar} 28`);
458
+ levelBar.setAttribute('width', `${widthOnBar}`);
459
+ levelCircle.setAttribute('cx', `${(widthOnBar < pointR ? pointR : widthOnBar)}`);
460
+ levelFilter.setAttribute('x', `${widthOnBar - 8}`);
461
+ //update lock location
462
+ const endLockElement = progressElementRef.querySelector('#lock');
463
+ // wrapper of endLock, include ball and heatfilter1_d_305_23
464
+ const filter1 = progressElementRef.querySelector('#filter_heart_ball');
465
+ // ball in endlockfilter2_i_305_23
466
+ const filter2 = progressElementRef.querySelector('#filter_ball');
467
+ // heart in endlockfilter3_d_305_23
468
+ const filter3 = progressElementRef.querySelector('#filter_heart');
469
+ //wrapper of lockfilter4_d_305_23
470
+ const filterLock = progressElementRef.querySelector('#filter_lock');
471
+ // shadow of ball paint0_linear_305_23
472
+ const paint0 = progressElementRef.querySelector('#paint0_linear_ball');
473
+ //paint in lockpaint1_linear_305_23
474
+ const paint1 = progressElementRef.querySelector('#paint1_linear_lock');
475
+ // box of lock and heart, for move position dynamically
476
+ const lockBox = progressElementRef.querySelector('#lock_box');
477
+ const heartBox = progressElementRef.querySelector('#heart_box');
478
+ const rightPaddingOfLockWidth = 10, cxOfEndLockEle = barWidth - rightPaddingOfLockWidth;
479
+ //set cx of lockElement
480
+ endLockElement.setAttribute('cx', `${cxOfEndLockEle}`);
481
+ //set cx of sub Elements
482
+ paint1.setAttribute('x1', `${cxOfEndLockEle}`);
483
+ paint1.setAttribute('x2', `${cxOfEndLockEle}`);
484
+ paint0.setAttribute('x1', `${cxOfEndLockEle - 6}`);
485
+ paint0.setAttribute('x2', `${cxOfEndLockEle - 6 + 11.2}`);
486
+ filterLock.setAttribute('x', `${cxOfEndLockEle - 6}`);
487
+ filter3.setAttribute('x', `${cxOfEndLockEle - 6 - 2}`);
488
+ filter2.setAttribute('x', `${cxOfEndLockEle - 6 - 2 - 2}`);
489
+ filter1.setAttribute('x', `${cxOfEndLockEle - 6 - 2 - 2 - 4}`);
490
+ lockBox.setAttribute('x', `${cxOfEndLockEle - 6}`);
491
+ heartBox.setAttribute('x', `${cxOfEndLockEle - 6}`);
492
+ svgElement.parentElement.style.opacity = '1';
493
+ }
494
+
495
+ const playerElevateCardDataCss = ":host {\n display: block;\n width: 360px;\n height: 230px;\n}\n\n.ElevateCardWrapper {\n contain: layout inline-size;\n width: 100%;\n height: fit-content;\n min-height: 218px;\n}\n\n.Outer {\n container-type: inline-size;\n font-size: 12px;\n background-size: cover;\n background-repeat: no-repeat;\n line-height: initial;\n width: 100%;\n height: 100%;\n}\n\n.Dark {\n color: var(--emfe-w-color-gray150, #efefef);\n}\n\n.Light {\n color: var(--emfe-w-color-black, #0e0e0e);\n}\n\n@container (min-width: 381px) {\n .Outer {\n background-size: cover;\n }\n .Outer .OuterCover {\n min-height: 190px;\n }\n}\n@container (min-width: 260px) {\n .Outer {\n background-size: contain;\n }\n}\n.OuterCover {\n width: 100%;\n height: 100%;\n content: \"\";\n background-repeat: no-repeat;\n background-size: cover;\n border-radius: 15px;\n}\n\n.Inner {\n display: flex;\n flex-direction: column;\n min-height: 158px;\n}\n.Inner .Content {\n padding: 15px;\n flex-wrap: wrap;\n gap: 8px;\n}\n.Inner .Row {\n display: flex;\n flex-direction: row;\n}\n.Inner .CardCell {\n display: flex;\n}\n.Inner .LevelProgress svg {\n transition: opacity 0.4s;\n}\n.Inner .LevelInfo {\n display: flex;\n flex-direction: column;\n}\n.Inner .LevelInfo .ElevateLevel .LevelName {\n height: 28px;\n border-radius: 5px;\n line-height: 28px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.Inner .LevelInfo.Level0 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emfe-w-elevate-color-level0button-shadow, rgba(191, 84, 6, 0.75));\n background: linear-gradient(180deg, var(--emfe-w-elevate-color-level0-bg0, #E2792C) 0%, var(--emfe-w-elevate-color-level0-bg1, rgba(242, 151, 99, 0)) 100%);\n}\n.Inner .LevelInfo.Level1 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emfe-w-elevate-color-level1button-shadow, rgba(151, 151, 151, 0.75));\n background: linear-gradient(180deg, var(--emfe-w-elevate-color-level1-bg0, #BEBFED) 0%, var(--emfe-w-elevate-color-level1-bg1, rgba(216, 217, 233, 0)) 100%);\n}\n.Inner .LevelInfo.Level2 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emfe-w-elevate-color-level2button-shadow, rgba(191, 120, 6, 0.75));\n background: linear-gradient(180deg, var(--emfe-w-elevate-color-level2-bg0, #FCC410) 0%, var(--emfe-w-elevate-color-level2-bg1, rgba(255, 189, 43, 0)) 100%);\n}\n.Inner .LevelInfo.Level3 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emfe-w-elevate-color-level3button-shadow, rgba(65, 6, 191, 0.75));\n background: linear-gradient(180deg, var(--emfe-w-elevate-color-level3-bg0, #B1A2DB) 0%, var(--emfe-w-elevate-color-level3-bg1, rgba(203, 202, 245, 0)) 100%);\n}\n.Inner .LevelInfo.Level4 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emfe-w-elevate-color-level4button-shadow, rgba(65, 6, 191, 0.75));\n background: linear-gradient(180deg, var(--emfe-w-elevate-color-level4-bg0, #B1A2DB) 0%, var(--emfe-w-elevate-color-level4-bg1, rgba(203, 202, 245, 0)) 100%);\n}\n.Inner .LevelInfo .ElevateLevel {\n display: flex;\n}\n.Inner .LevelInfo {\n flex: 1;\n flex-grow: 1;\n min-width: 150px;\n}\n.Inner .PlayerImg {\n width: 29%;\n margin: auto;\n max-width: 100px;\n min-width: 30px;\n order: 0;\n}\n.Inner .PlayerAvatar {\n max-width: 100px;\n flex-basis: 100px;\n height: auto;\n margin: auto;\n padding-top: 10px;\n}\n.Inner .PlayerAvatar .Avatar, .Inner .PlayerAvatar .Badge {\n width: 100%;\n height: 100%;\n}\n.Inner .PlayerAvatar .Avatar {\n border-radius: 50%;\n background-size: contain;\n background-repeat: no-repeat;\n}\n.Inner .ElevateLevel .ExpirationDate {\n max-width: 138px;\n min-width: 118px;\n}\n.Inner .PlayerName, .Inner .RedeemButton, .Inner .ElevateLevel {\n text-transform: capitalize;\n width: 100%;\n}\n.Inner .PlayerName {\n font-size: 16px;\n}\n.Inner .Row .PointsInfo {\n display: table;\n font-weight: 600;\n}\n.Inner .Row .Redeem {\n justify-content: flex-end;\n margin-left: auto;\n}\n.Inner .Row .Redeem:hover {\n color: var(--emfe-w-elevate-color-redeem-hover, #00ABA4);\n cursor: pointer;\n}\n.Inner .Row .RedeemButton:hover span {\n color: var(emfe-w-elevate-color-redeem-text-hover, #f1f1f1);\n font-weight: bold;\n}\n.Inner .Row .RedeemButton {\n width: 95px;\n height: 35px;\n display: flex;\n align-items: center;\n border-radius: 10px;\n background: var(--emfe-w-elevate-color-redeem-bg, linear-gradient(0deg, #26CC37, #26CC37)), linear-gradient(117.99deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.89%), linear-gradient(283.85deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.47%), linear-gradient(268.18deg, rgba(255, 255, 255, 0.6) -17.36%, rgba(239, 239, 239, 0) 15.78%);\n box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.2509803922);\n}\n.Inner .Row .RedeemButton span {\n color: var(--emfe-w-color-white, #fff);\n line-height: 18px;\n font-size: 15px;\n text-align: center;\n width: 100%;\n}\n.Inner .Row .Points {\n font-size: large;\n vertical-align: middle;\n}\n.Inner .Row .Points .XP {\n font-size: x-small;\n}\n.Inner .Row .ExpirationPoints {\n font-size: small;\n text-align: right;\n font-weight: bold;\n color: var(--emfe-w-color-red, #9e595f);\n}";
496
+ const PlayerElevateCardDataStyle0 = playerElevateCardDataCss;
497
+
498
+ const PlayerElevateCardData = class {
499
+ constructor(hostRef) {
500
+ index.registerInstance(this, hostRef);
501
+ this.playerElevateLeveLoaded = index.createEvent(this, "playerElevateLeveLoaded", 7);
502
+ this.params = undefined;
503
+ this.playerElevateLevel = undefined;
504
+ this.pointExpireString = undefined;
505
+ }
506
+ handleWindowResizs() {
507
+ this.initLevelProgressbar();
508
+ }
509
+ onParamsChanged() {
510
+ this.loadElevateInfo();
511
+ }
512
+ onRedeemClick() {
513
+ window.postMessage({ type: 'BEERedeemClicked' }, window.location.href);
514
+ }
515
+ loadLevels() {
516
+ let url = new URL(`${this.params.endpoint}/v1/elevate/levels?language=${this.params.language}`);
517
+ return new Promise((resolve, reject) => {
518
+ return fetch(url.href, {
519
+ method: 'GET',
520
+ })
521
+ .then((res) => res.json())
522
+ .then((res) => {
523
+ this.levels = res.data;
524
+ resolve(true);
525
+ })
526
+ .catch((err) => {
527
+ reject(err);
528
+ });
529
+ });
530
+ }
531
+ calcuatePointsToBeExpired(walletTotalInfo) {
532
+ let pointExpireInfoAsString = '';
533
+ if (!walletTotalInfo || !walletTotalInfo.aboutToExpire ||
534
+ walletTotalInfo.aboutToExpire.length == 0 ||
535
+ walletTotalInfo.aboutToExpire[0].points <= 0) {
536
+ return pointExpireInfoAsString;
537
+ }
538
+ walletTotalInfo.aboutToExpire.sort((expire1, expire2) => {
539
+ return isBefore(new Date(expire1.expireTime), new Date(expire2.expireTime))
540
+ ? -1
541
+ : 1;
542
+ });
543
+ const aboutToExpire = walletTotalInfo.aboutToExpire[0];
544
+ const daysToExpried = differenceInCalendarDays(new Date(aboutToExpire.expireTime), new Date());
545
+ let hoursToExpired = 0, expiredTranslationKey = daysToExpried === 0 ? 'pointsToBeExpiredDay' : 'pointsToBeExpired';
546
+ if (daysToExpried == 0) {
547
+ hoursToExpired = differenceInHours(new Date(aboutToExpire.expireTime), new Date());
548
+ expiredTranslationKey = hoursToExpired > 1 ? 'pointsToBeExpiredHours' : 'pointsToBeExpiredHour';
549
+ }
550
+ pointExpireInfoAsString = playerElevateCardItems.translateWithParams(expiredTranslationKey, {
551
+ expirationPoints: aboutToExpire.points,
552
+ expireDay: daysToExpried,
553
+ });
554
+ return pointExpireInfoAsString;
555
+ }
556
+ loadPlayerLevelInfo() {
557
+ let url = new URL(`${this.params.endpoint}/v1/elevate/playerInfo?language=${this.params.language}`);
558
+ return new Promise((resolve, reject) => {
559
+ return fetch(url.href, {
560
+ method: 'GET',
561
+ headers: {
562
+ 'X-Sessionid': this.params.session,
563
+ 'Content-Type': 'application/json',
564
+ },
565
+ })
566
+ .then((res) => res.json())
567
+ .then((res) => {
568
+ var _a, _b, _c;
569
+ if (!res.success) {
570
+ console.error('Exception when fetch user elevateinfo, ', res.errorCode, res.errorMessage);
571
+ reject(true);
572
+ return;
573
+ }
574
+ let playerElevateInfo = res.data;
575
+ this.playerElevateLevel = playerElevateInfo.level;
576
+ this.playerElevateLevel.name = this.playerElevateLevel.presentation.displayName || this.playerElevateLevel.name;
577
+ this.playerElevateLevel.spendablePoints = ((_a = playerElevateInfo.spendableWallet) === null || _a === void 0 ? void 0 : _a.total.points) || 0;
578
+ this.playerElevateLeveLoaded.emit({ elevateLevel: this.playerElevateLevel });
579
+ const spendableTotal = (_b = res.data.spendableWallet) === null || _b === void 0 ? void 0 : _b.total;
580
+ const loyaltyWalletTotal = (_c = res.data.loyaltyWallet) === null || _c === void 0 ? void 0 : _c.total;
581
+ this.playerElevateLeveLoaded.emit({
582
+ elevateLevelWalletTotal: spendableTotal,
583
+ loyaltyWalletTotal
584
+ });
585
+ let spExpireInfoAsString = this.calcuatePointsToBeExpired(spendableTotal);
586
+ let xpExpireInfoAsString = this.calcuatePointsToBeExpired(loyaltyWalletTotal);
587
+ if (spExpireInfoAsString || xpExpireInfoAsString) {
588
+ this.playerElevateLeveLoaded.emit({
589
+ pointExpireString: spExpireInfoAsString,
590
+ xpExpireString: xpExpireInfoAsString
591
+ });
592
+ }
593
+ resolve(this.playerElevateLevel);
594
+ })
595
+ .catch((err) => {
596
+ console.log('error ', err);
597
+ reject(true);
598
+ });
599
+ });
600
+ }
601
+ setLoyaltyProgress(percent) {
602
+ updateProgressSvg(this.loyaltyProgressEle, percent);
603
+ }
604
+ initLevelProgressbar() {
605
+ setTimeout(() => {
606
+ this.loyaltyProgressEle =
607
+ this.elevateCardRef.parentElement.querySelector('#LevelProgress');
608
+ if (!this.loyaltyProgressEle) {
609
+ return;
610
+ }
611
+ this.setLoyaltyProgress(!this.playerElevateLevel.nextLevel
612
+ ? 1 : (this.playerElevateLevel.loyaltyPoints / this.playerElevateLevel.nextLevel.entryPoints));
613
+ this.params['playerElevateLevel'] = this.playerElevateLevel;
614
+ }, 80);
615
+ }
616
+ componentDidRender() {
617
+ this.initLevelProgressbar();
618
+ }
619
+ loadElevateInfo() {
620
+ if (!this.params.endpoint || !this.params.session) {
621
+ return;
622
+ }
623
+ const promises = [];
624
+ promises.push(this.loadPlayerLevelInfo());
625
+ if (this.params.calculateLevelFlag) {
626
+ promises.push(this.loadLevels());
627
+ }
628
+ Promise.all(promises).then((res) => {
629
+ console.log('elevate-init', res);
630
+ this.initLevelProgressbar();
631
+ if (!this.levels) {
632
+ return;
633
+ }
634
+ this.levels.sort((level1, level2) => {
635
+ return level1.firstEntryPoints > level2.firstEntryPoints ? 1 : -1;
636
+ });
637
+ const playerPoints = this.playerElevateLevel.loyaltyPoints;
638
+ let playerLevelNumber = 0;
639
+ this.levels.forEach((elevateLevel, idx) => {
640
+ if (playerPoints > elevateLevel.firstEntryPoints) {
641
+ playerLevelNumber = idx;
642
+ }
643
+ });
644
+ this.playerElevateLeveLoaded.emit({
645
+ calculatedLevelFlag: playerLevelNumber,
646
+ });
647
+ });
648
+ }
649
+ componentWillLoad() {
650
+ this.loadElevateInfo();
651
+ }
652
+ get elevateCardRef() { return index.getElement(this); }
653
+ static get watchers() { return {
654
+ "params": ["onParamsChanged"]
655
+ }; }
656
+ };
657
+ PlayerElevateCardData.style = PlayerElevateCardDataStyle0;
658
+
659
+ const playerElevatePointcardCss = ":host{display:block}.PointsCard .Inner .Row .ExpirationPoints{text-align:left}.PointsCard .Inner .PlayerAvatar .Avatar{display:none}.PointsCard .Inner .PlayerAvatar .Badge{border-radius:50%;background-size:contain;width:100%;height:100%;position:inherit}.PointsCard .Inner .PointsTxt{display:flex;flex-direction:row;justify-content:space-between}.PointsCard .Inner .DetailButton{background:linear-gradient(283.85deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.47%), linear-gradient(117.99deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.89%), linear-gradient(268.18deg, rgba(255, 255, 255, 0.6) -17.36%, rgba(239, 239, 239, 0) 15.78%), linear-gradient(0deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.6));border-radius:5px;box-shadow:0px 4px 4px 0px rgba(0, 0, 0, 0.25);border:2px solid;font-size:11px;width:108px;padding:4px;cursor:pointer;margin-top:5px;height:16px;min-width:45px;text-align:center}.PointsCard .Inner .DetailButton span{color:var(--emfe-w-color-gray-150, #6D6D6D)}.PointsCard .Inner .DetailButton span{display:inline-block;vertical-align:middle}.PointsCard .Inner .DetailButton:hover span{color:var(--emfe-w-color-gray-150, #6D6D6D)}.PointsCard .Inner .LevelInfo{gap:15px;width:70%}.PointsCard .Inner .LevelInfo .PointsTxt{font-size:15px}.PointsCard .Inner .LevelInfo .PointsTxt.Label{display:none}.PointsCard .Inner .LevelInfo .PointsTxt.SPPoints{padding-top:15px}.PointsCard .Inner .LevelInfo .PointsTxt .TC{font-size:x-small;color:var(--emw--color-gray-300, #58586B);display:flex;align-content:center;height:100%;flex-wrap:wrap;text-decoration:underline;cursor:pointer;display:none}";
660
+ const PlayerElevatePointcardStyle0 = playerElevatePointcardCss;
661
+
662
+ const PlayerElevatePointcard = class {
663
+ constructor(hostRef) {
664
+ index.registerInstance(this, hostRef);
665
+ this.isPointDetailCard = this.buttonType === 'earningRule';
666
+ this.endpoint = undefined;
667
+ this.theme = 'Dark';
668
+ this.session = undefined;
669
+ this.playerAvatarUrl = undefined;
670
+ this.language = 'en';
671
+ this.playerName = undefined;
672
+ this.cardTitle = undefined;
673
+ this.buttonType = 'earningRule';
674
+ this.dateFormat = 'yyyy-MM-dd';
675
+ this.clientStyling = '';
676
+ this.clientStylingUrl = '';
677
+ this.translationUrl = '';
678
+ this.pointExpireString = undefined;
679
+ this.playerElevateLevel = undefined;
680
+ this.elevateWalletTotal = undefined;
681
+ this.elevateSPTotal = undefined;
682
+ }
683
+ onSessionOrEndpointChange() {
684
+ this.paramProxy = Object.assign(Object.assign({}, this.paramProxy), { session: this.session, endpoint: this.endpoint, language: this.language });
685
+ }
686
+ playerElevateLeveLoadedHandler(event) {
687
+ if (!event.detail) {
688
+ return;
689
+ }
690
+ if (event.detail['elevateLevelWalletTotal']) {
691
+ this.elevateWalletTotal = event.detail['elevateLevelWalletTotal'];
692
+ this.elevateSPTotal = event.detail['loyaltyWalletTotal'];
693
+ }
694
+ if (event.detail['elevateLevel']) {
695
+ this.playerElevateLevel = event.detail['elevateLevel'];
696
+ }
697
+ if (event.detail['pointExpireString']) {
698
+ this.pointExpireString = event.detail.pointExpireString;
699
+ }
700
+ }
701
+ onDetailsClick() {
702
+ window.postMessage({ type: this.isPointDetailCard ? 'BEEPointRulesClicked' : 'BEEDetailsClicked',
703
+ path: this.isPointDetailCard ? 'player-elevate-level' : 'player-elevate-point-details' }, window.location.href);
704
+ }
705
+ componentWillLoad() {
706
+ this.paramProxy = {
707
+ endpoint: this.endpoint,
708
+ session: this.session,
709
+ language: this.language,
710
+ };
711
+ }
712
+ render() {
713
+ const backgroundOuterImagePath = index.getAssetPath('../static/card-ground.svg');
714
+ const backgroundInnerImagePath = index.getAssetPath('../static/card-ground-over.svg');
715
+ return (index.h("div", { key: '13461fc9cf8b777337a539c15da4bb2781f5a837', class: `ElevateCardWrapper ${this.theme}` }, index.h("div", { key: '526e72c0ada871f74ba4a07f0a125bc25840c09c', class: "PointsCard Outer ", style: { 'backgroundImage': `url(${backgroundOuterImagePath}` } }, index.h("general-styling-wrapper", { key: '95e358ceb8fa3c247660f7ca15a4684b132874be', clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, targetTranslations: playerElevateCardItems.TRANSLATIONS, translationUrl: this.translationUrl }), index.h("player-elevate-card-data", { key: '24c765d743446ac597a9dcc9cd22515e7e39e6db', params: this.paramProxy }), index.h("div", { key: '309db4bbfc244a7fb97827774d9d4383109ca0d7', class: 'OuterCover Inner', style: { 'backgroundImage': `url(${backgroundInnerImagePath}` } }, index.h("div", { key: '9d5614ded2f73b505e60900675a7d95b3cfbcbc6', class: 'Content Row' }, this.playerElevateLevel && (index.h(index.Fragment, { key: '9a17e809083e61aad19f7ffef5d5ee5885ae8b4d' }, index.h("div", { key: '47068df3c0070ee2785b0d0201b08766fe0d71e8', class: "PlayerImg" }, index.h(playerElevateCardItems.PlayerAvatar, { key: '40115f8b190d871c85f9531fbf0bafb8fbd739e2', onlyBadge: true, loyaltyIconUrl: this.playerElevateLevel.presentation.asset })), index.h("div", { key: '278cd70c23ecb48655e90810af570ce5366d13d5', class: `LevelInfo ${this.playerElevateLevel.name}` }, index.h("div", { key: 'ce682ff881c5b12ed0b736ffcc67ad07b3713999', class: "PointsTxt Label" }, this.cardTitle ? this.cardTitle : playerElevateCardItems.translate('spendablePoints')), index.h("div", { key: 'eeebc5c468cf6e3d566f708fd47a19956ad9defe', class: 'PointsTxt SPPoints' }, index.h(playerElevateCardItems.PlayerPoints, { key: 'ad58990b7fa789cf2d5c524191447196e97c8a16', spendablePoints: this.playerElevateLevel.spendablePoints, language: this.language }), index.h("a", { key: '0dbdd6cd84e1cb43dac4485f4e3eec3130d6c65c', class: "TC", onClick: () => {
716
+ this.onDetailsClick();
717
+ } }, playerElevateCardItems.translate('termAndConditions', this.language))), this.pointExpireString && (index.h("div", { key: '45c3267d390995fabe34974913adf97b112cf8c2', class: 'ExpirationPoints' }, this.pointExpireString, " "))))))))));
718
+ }
719
+ static get watchers() { return {
720
+ "session": ["onSessionOrEndpointChange"],
721
+ "endpoint": ["onSessionOrEndpointChange"],
722
+ "language": ["onSessionOrEndpointChange"]
723
+ }; }
724
+ };
725
+ PlayerElevatePointcard.style = PlayerElevatePointcardStyle0;
726
+
727
+ exports.bonus_elevate_shop = BonusElevateShop;
728
+ exports.general_styling_wrapper = GeneralStylingWrapper;
729
+ exports.player_elevate_card_data = PlayerElevateCardData;
730
+ exports.player_elevate_pointcard = PlayerElevatePointcard;