@everymatrix/loyalty-shop 0.1.11 → 0.1.12
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.
- package/components/{LoyaltyPagination-BcRXvso4.js → LoyaltyPagination-B-q5gKJj.js} +2429 -2837
- package/components/LoyaltyPagination-Boz7CVJt.cjs +16 -0
- package/components/LoyaltyPagination-CEvN3M3n.cjs +16 -0
- package/components/LoyaltyPagination-Z_igiBkY.js +6754 -0
- package/components/LoyaltyPointsCard-BhdXzF1P.cjs +18 -0
- package/components/LoyaltyPointsCard-DRKV1-dq.js +254 -0
- package/components/LoyaltyPointsCard-Dh-TnTTL.cjs +18 -0
- package/components/{LoyaltyPointsCard-DMYnP3nm.js → LoyaltyPointsCard-yCHI1R_t.js} +42 -36
- package/components/LoyaltyShop-BsZThRDe.cjs +27 -0
- package/components/LoyaltyShop-CtNpYAKa.js +517 -0
- package/components/LoyaltyShop-Cx8CxsMn.cjs +27 -0
- package/components/{LoyaltyShop-DV-j5py7.js → LoyaltyShop-DoIx97J9.js} +261 -223
- package/components/LoyaltyShopItem-BRiUNphq.cjs +5 -0
- package/components/{LoyaltyShopItem-BRu06lmS.js → LoyaltyShopItem-C2xuJLoW.js} +82 -74
- package/components/LoyaltyShopItem-D_oViqJP.cjs +5 -0
- package/components/LoyaltyShopItem-bXQ_G5NK.js +355 -0
- package/es2015/loyalty-shop.cjs +1 -0
- package/es2015/loyalty-shop.js +28 -0
- package/esnext/loyalty-shop.cjs +1 -1
- package/esnext/loyalty-shop.js +7 -2
- package/package.json +5 -2
- package/components/LoyaltyPagination-CiEOz3pr.cjs +0 -16
- package/components/LoyaltyPointsCard-BcX6gbsm.cjs +0 -18
- package/components/LoyaltyShop-CJ-9FkKC.cjs +0 -27
- package/components/LoyaltyShopItem-Dd0M-wKW.cjs +0 -5
|
@@ -0,0 +1,517 @@
|
|
|
1
|
+
var le = (h, n, s) => new Promise((r, x) => {
|
|
2
|
+
var u = (o) => {
|
|
3
|
+
try {
|
|
4
|
+
p(s.next(o));
|
|
5
|
+
} catch (E) {
|
|
6
|
+
x(E);
|
|
7
|
+
}
|
|
8
|
+
}, c = (o) => {
|
|
9
|
+
try {
|
|
10
|
+
p(s.throw(o));
|
|
11
|
+
} catch (E) {
|
|
12
|
+
x(E);
|
|
13
|
+
}
|
|
14
|
+
}, p = (o) => o.done ? r(o.value) : Promise.resolve(o.value).then(u, c);
|
|
15
|
+
p((s = s.apply(h, n)).next());
|
|
16
|
+
});
|
|
17
|
+
import { y as et, c as Ee, p as qe, a as tt, b as _, s as nt, d as ge, z as y, A as he, N as ve, C as D, m as t, E as i, B as at, G as ye, S as st, i as j, h as k, j as Se, O as z, P as ot, u as _e, H as lt, I as rt, J as it, K as dt, v as T, k as b, l as ut, n as N, r as w, f as be, g as re, Q as ke, R as ct, t as we, q as G, o as V, T as pt, M as xe, L as mt, w as ft, $ as gt, U as ht, V as vt, W as yt } from "./LoyaltyPagination-Z_igiBkY.js";
|
|
18
|
+
import { L as _t } from "./LoyaltyShopItem-bXQ_G5NK.js";
|
|
19
|
+
typeof globalThis.HTMLElement == "undefined" && (globalThis.HTMLElement = class {
|
|
20
|
+
}, globalThis.customElements = { define() {
|
|
21
|
+
}, get() {
|
|
22
|
+
}, whenDefined() {
|
|
23
|
+
} });
|
|
24
|
+
if (typeof window != "undefined") {
|
|
25
|
+
let h = function(n) {
|
|
26
|
+
return function(...s) {
|
|
27
|
+
try {
|
|
28
|
+
return n.apply(this, s);
|
|
29
|
+
} catch (r) {
|
|
30
|
+
if (r instanceof DOMException && r.message.includes("has already been used with this registry") || r instanceof Error && r.message.includes("Cannot define multiple custom elements with the same tag name"))
|
|
31
|
+
return !1;
|
|
32
|
+
throw r;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
customElements.define = h(customElements.define), import("./LoyaltyPagination-Z_igiBkY.js").then((n) => n.X).then((n) => {
|
|
37
|
+
const s = n.default || n;
|
|
38
|
+
customElements.get("loyalty-pagination") || customElements.define("loyalty-pagination", s.element || s);
|
|
39
|
+
}).catch((n) => {
|
|
40
|
+
console.error("BOOT ERROR:", n);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
if (typeof window != "undefined") {
|
|
44
|
+
let h = function(n) {
|
|
45
|
+
return function(...s) {
|
|
46
|
+
try {
|
|
47
|
+
return n.apply(this, s);
|
|
48
|
+
} catch (r) {
|
|
49
|
+
if (r instanceof DOMException && r.message.includes("has already been used with this registry") || r instanceof Error && r.message.includes("Cannot define multiple custom elements with the same tag name"))
|
|
50
|
+
return !1;
|
|
51
|
+
throw r;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
customElements.define = h(customElements.define), import("./LoyaltyShopItem-bXQ_G5NK.js").then((n) => n.a).then((n) => {
|
|
56
|
+
const s = n.default || n;
|
|
57
|
+
customElements.get("loyalty-shop-item") || customElements.define("loyalty-shop-item", s.element || s);
|
|
58
|
+
}).catch((n) => {
|
|
59
|
+
console.error("BOOT ERROR:", n);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
const bt = {
|
|
63
|
+
en: {
|
|
64
|
+
loading: "Loading…",
|
|
65
|
+
noContent: "There are no bonus items available for redemption.",
|
|
66
|
+
networkProblem: "Network problem. Please reload.",
|
|
67
|
+
tokens: "Tokens",
|
|
68
|
+
buyNow: "Buy Now",
|
|
69
|
+
generalError: "Something went wrong... Please try again."
|
|
70
|
+
},
|
|
71
|
+
tr: {
|
|
72
|
+
loading: "Yükleniyor…",
|
|
73
|
+
noContent: "Kullanılabilir bonus öğesi bulunmamaktadır.",
|
|
74
|
+
networkProblem: "Ağ sorunu. Lütfen yeniden yükleyin.",
|
|
75
|
+
tokens: "Tokens",
|
|
76
|
+
buyNow: "Satın Al",
|
|
77
|
+
generalError: "Bir sorun oluştu, lütfen tekrar deneyin."
|
|
78
|
+
},
|
|
79
|
+
da: {
|
|
80
|
+
loading: "Indlæser…",
|
|
81
|
+
noContent: "Der er ingen bonusgenstande tilgængelige til indløsning.",
|
|
82
|
+
networkProblem: "Netværksproblem. Genindlæs venligst siden.",
|
|
83
|
+
tokens: "Tokens",
|
|
84
|
+
buyNow: "Køb nu",
|
|
85
|
+
generalError: "Noget gik galt. Prøv venligst igen."
|
|
86
|
+
},
|
|
87
|
+
de: {
|
|
88
|
+
loading: "Wird geladen…",
|
|
89
|
+
noContent: "Es sind keine Bonusartikel zum Einlösen verfügbar.",
|
|
90
|
+
networkProblem: "Netzwerkproblem. Bitte lade die Seite neu.",
|
|
91
|
+
tokens: "Token",
|
|
92
|
+
buyNow: "Jetzt kaufen",
|
|
93
|
+
generalError: "Etwas ist schiefgelaufen. Bitte versuche es erneut."
|
|
94
|
+
},
|
|
95
|
+
nl: {
|
|
96
|
+
loading: "Laden…",
|
|
97
|
+
noContent: "Er zijn geen bonusitems beschikbaar om in te wisselen.",
|
|
98
|
+
networkProblem: "Netwerkprobleem. Laad de pagina opnieuw.",
|
|
99
|
+
tokens: "Tokens",
|
|
100
|
+
buyNow: "Nu kopen",
|
|
101
|
+
generalError: "Er is iets misgegaan. Probeer het opnieuw."
|
|
102
|
+
},
|
|
103
|
+
fr: {
|
|
104
|
+
loading: "Chargement…",
|
|
105
|
+
noContent: "Aucun bonus n'est disponible pour être échangé.",
|
|
106
|
+
networkProblem: "Problème de réseau. Veuillez recharger la page.",
|
|
107
|
+
tokens: "Jetons",
|
|
108
|
+
buyNow: "Acheter",
|
|
109
|
+
generalError: "Une erreur s'est produite. Veuillez réessayer."
|
|
110
|
+
},
|
|
111
|
+
hu: {
|
|
112
|
+
loading: "Betöltés…",
|
|
113
|
+
noContent: "Nincsenek beváltható bónuszok.",
|
|
114
|
+
networkProblem: "Hálózati probléma. Kérjük, töltsd újra az oldalt.",
|
|
115
|
+
tokens: "Tokenek",
|
|
116
|
+
buyNow: "Vásárlás",
|
|
117
|
+
generalError: "Hiba történt. Kérjük, próbáld újra."
|
|
118
|
+
}
|
|
119
|
+
}, kt = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='800px'%20height='800px'%20viewBox='0%200%20120%20120'%20fill='none'%3e%3crect%20width='120'%20height='120'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M33.2503%2038.4816C33.2603%2037.0472%2034.4199%2035.8864%2035.8543%2035.875H83.1463C84.5848%2035.875%2085.7503%2037.0431%2085.7503%2038.4816V80.5184C85.7403%2081.9528%2084.5807%2083.1136%2083.1463%2083.125H35.8543C34.4158%2083.1236%2033.2503%2081.957%2033.2503%2080.5184V38.4816ZM80.5006%2041.1251H38.5006V77.8751L62.8921%2053.4783C63.9172%2052.4536%2065.5788%2052.4536%2066.6039%2053.4783L80.5006%2067.4013V41.1251ZM43.75%2051.6249C43.75%2054.5244%2046.1005%2056.8749%2049%2056.8749C51.8995%2056.8749%2054.25%2054.5244%2054.25%2051.6249C54.25%2048.7254%2051.8995%2046.3749%2049%2046.3749C46.1005%2046.3749%2043.75%2048.7254%2043.75%2051.6249Z'%20fill='%23687787'/%3e%3c/svg%3e";
|
|
120
|
+
var wt = T('<div class="loyalty-shop__item loyalty-shop__item--skeleton svelte-1f1q033"><div class="loyalty-shop__item-image skeleton-box svelte-1f1q033"></div> <div class="loyalty-shop__item-title skeleton-line svelte-1f1q033"></div> <div class="loyalty-shop__item-points skeleton-line skeleton-line--short svelte-1f1q033"></div> <div class="loyalty-shop__item-button-skeleton skeleton-box svelte-1f1q033"></div></div>'), xt = T('<div class="loyalty-shop__grid loyalty-shop__grid--skeleton svelte-1f1q033"></div>'), Et = T('<div class="loyalty-shop__unavailable svelte-1f1q033"> </div>'), qt = T('<div><div role="button" tabindex="0" class="loyalty-shop__item-image-container svelte-1f1q033"><img class="loyalty-shop__item-image svelte-1f1q033"/></div> <span class="loyalty-shop__item-title svelte-1f1q033"> </span> <span class="loyalty-shop__item-points svelte-1f1q033"> </span> <button class="loyalty-shop__item-button svelte-1f1q033" type="button"> </button></div>'), St = T('<div class="load-more-sentinel svelte-1f1q033" aria-hidden="true"></div>'), It = T('<div class="loyalty-shop__grid svelte-1f1q033"></div> <!> <!>', 1), Ct = T('<div class="loyalty-shop svelte-1f1q033"><!></div>');
|
|
121
|
+
const Rt = {
|
|
122
|
+
hash: "svelte-1f1q033",
|
|
123
|
+
code: `.loyalty-shop.svelte-1f1q033 {padding:16px;border-radius:6px;border:1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));background-color:var(--app-container-bg-default, #022652);width:100%;box-sizing:border-box;display:flex;flex-direction:column;gap:16px;}.loyalty-shop__unavailable.svelte-1f1q033 {color:var(--text-subtle, #dfe3e8);font-size:14px;padding:24px 0;text-align:center;}.loyalty-shop__grid.svelte-1f1q033 {display:grid;gap:16px;grid-template-columns:repeat(2, 1fr);margin:0;}.loyalty-shop__item.svelte-1f1q033 {display:flex;flex-direction:column;gap:8px;padding:16px;border-radius:10px;border:1px solid var(--border-default, rgba(251, 251, 251, 0.15));background-color:var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1));}.loyalty-shop__item--unavailable.svelte-1f1q033 {opacity:1;}.loyalty-shop__item-image.svelte-1f1q033 {width:100%;height:82px;border-radius:6px;}.loyalty-shop__item-title.svelte-1f1q033 {color:var(--text-default, #ffffff);font-size:12px;font-weight:400;}.loyalty-shop__item-points.svelte-1f1q033 {color:var(--text-subtle, #dfe3e8);font-size:14px;font-weight:400;}.loyalty-shop__item-button.svelte-1f1q033 {margin-top:auto;width:100%;height:37px;padding:8px 16px;border:none;border-radius:6px;background:var(--button-primary-bg-default, #ffcc00);color:var(--button-primary-text-default, #261d00);font-size:12px;font-weight:400;cursor:pointer;}.loyalty-shop__item-button.svelte-1f1q033:disabled {opacity:0.4;cursor:default;}.skeleton-box.svelte-1f1q033 {background:linear-gradient(
|
|
124
|
+
90deg,
|
|
125
|
+
var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 0%,
|
|
126
|
+
color-mix(in srgb, var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 80%, white) 50%,
|
|
127
|
+
var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 100%
|
|
128
|
+
);background-size:200% 100%;
|
|
129
|
+
animation: svelte-1f1q033-shimmer 3s linear infinite;border-radius:6px;}.skeleton-line.svelte-1f1q033 {height:14px;border-radius:6px;background:linear-gradient(
|
|
130
|
+
90deg,
|
|
131
|
+
var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 0%,
|
|
132
|
+
color-mix(in srgb, var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 80%, white) 50%,
|
|
133
|
+
var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 100%
|
|
134
|
+
);background-size:200% 100%;
|
|
135
|
+
animation: svelte-1f1q033-shimmer 3s linear infinite;}.skeleton-line--short.svelte-1f1q033 {width:40%;}.loyalty-shop__item--skeleton.svelte-1f1q033 {display:flex;flex-direction:column;}.loyalty-shop__item--skeleton.svelte-1f1q033 .loyalty-shop__item-image:where(.svelte-1f1q033) {width:100%;height:82px;border-radius:6px;}.loyalty-shop__item--skeleton.svelte-1f1q033 .loyalty-shop__item-title:where(.svelte-1f1q033) {width:90%;}.loyalty-shop__item--skeleton.svelte-1f1q033 .loyalty-shop__item-points:where(.svelte-1f1q033) {width:40%;}.loyalty-shop__item-button-skeleton.svelte-1f1q033 {margin-top:auto;width:100%;height:40px;border-radius:6px;}.loyalty-shop__item-image-container.svelte-1f1q033 {cursor:pointer;}
|
|
136
|
+
|
|
137
|
+
@keyframes svelte-1f1q033-shimmer {
|
|
138
|
+
0% {
|
|
139
|
+
background-position: 200% 0;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
100% {
|
|
143
|
+
background-position: -200% 0;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
@media (min-width: 768px) {.loyalty-shop__grid.svelte-1f1q033 {grid-template-columns:repeat(4, 1fr);justify-content:start;margin:0;}.loyalty-shop__item.svelte-1f1q033 {width:100%;height:100%;box-sizing:border-box;}.loyalty-shop__item-image.svelte-1f1q033 {height:200px;}.loyalty-shop__item--skeleton.svelte-1f1q033 .loyalty-shop__item-image:where(.svelte-1f1q033) {height:200px;}
|
|
148
|
+
}`
|
|
149
|
+
};
|
|
150
|
+
function Ie(h, n) {
|
|
151
|
+
qe(n, !0), tt(h, Rt);
|
|
152
|
+
const s = () => ft(gt, "$_", r), [r, x] = ut(), u = _(n, "apiEndpoint", 7, ""), c = _(n, "userSession", 7, ""), p = _(n, "locale", 7, ""), o = _(n, "limitItem", 7, z), E = _(n, "translationUrl");
|
|
153
|
+
nt({ withLocale: p(), translations: {} });
|
|
154
|
+
const Re = () => le(this, null, function* () {
|
|
155
|
+
try {
|
|
156
|
+
const e = new URL(E(), window.location.href), a = yield fetch(e.href);
|
|
157
|
+
if (!a.ok)
|
|
158
|
+
throw new Error("Failed to fetch translations");
|
|
159
|
+
const l = yield a.json();
|
|
160
|
+
Object.entries(l).forEach(([d, q]) => {
|
|
161
|
+
ge(d, q);
|
|
162
|
+
});
|
|
163
|
+
} catch (e) {
|
|
164
|
+
console.error("loyalty shop translation url err:", e);
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
Object.entries(bt).forEach(([e, a]) => {
|
|
168
|
+
ge(e, a);
|
|
169
|
+
});
|
|
170
|
+
let v = y(he([])), P = y(void 0), H = y(0), C = y(0), M = y(he(ve)), Y = y(!1), Q = y(!1), U = y(void 0), R = y(!1), K = y(void 0), F = 0;
|
|
171
|
+
const Le = _e(() => typeof o() == "number" ? o() : parseInt(o(), z) || z), ie = () => {
|
|
172
|
+
if (!u() || !c())
|
|
173
|
+
return;
|
|
174
|
+
i(Y, !0), i(Q, !1);
|
|
175
|
+
const e = ++F, a = t(R) && t(C) > 0;
|
|
176
|
+
ot(
|
|
177
|
+
{
|
|
178
|
+
apiEndpoint: u(),
|
|
179
|
+
userSession: c(),
|
|
180
|
+
locale: p()
|
|
181
|
+
},
|
|
182
|
+
t(C),
|
|
183
|
+
t(M)
|
|
184
|
+
).then((l) => {
|
|
185
|
+
var q, f;
|
|
186
|
+
if (e !== F)
|
|
187
|
+
return;
|
|
188
|
+
const d = (q = l.data) != null ? q : [];
|
|
189
|
+
i(H, (f = l.total) != null ? f : 0, !0), a ? i(v, [...t(v), ...d], !0) : i(v, d, !0);
|
|
190
|
+
}).catch((l) => {
|
|
191
|
+
e === F && (i(Q, !0), console.error("Failed to load shop rewards:", l));
|
|
192
|
+
}).finally(() => {
|
|
193
|
+
e === F && i(Y, !1);
|
|
194
|
+
});
|
|
195
|
+
};
|
|
196
|
+
D(() => {
|
|
197
|
+
u(), c(), p(), t(C), t(M), ie();
|
|
198
|
+
}), D(() => {
|
|
199
|
+
const e = window.matchMedia("(max-width: 767px)"), a = (l) => {
|
|
200
|
+
i(R, l.matches, !0);
|
|
201
|
+
};
|
|
202
|
+
return i(R, e.matches, !0), e.addEventListener("change", a), () => e.removeEventListener("change", a);
|
|
203
|
+
}), D(() => {
|
|
204
|
+
i(M, t(R) ? ve : t(Le), !0);
|
|
205
|
+
}), D(() => {
|
|
206
|
+
if (!t(R) || !t(K)) return;
|
|
207
|
+
const e = new IntersectionObserver(
|
|
208
|
+
(a) => {
|
|
209
|
+
a.some((l) => l.isIntersecting) && t(v).length < t(H) && i(C, t(C) + t(M));
|
|
210
|
+
},
|
|
211
|
+
{ rootMargin: "200px" }
|
|
212
|
+
);
|
|
213
|
+
return e.observe(t(K)), () => e.disconnect();
|
|
214
|
+
}), at(() => {
|
|
215
|
+
E() && Re();
|
|
216
|
+
});
|
|
217
|
+
const Ne = (e) => {
|
|
218
|
+
var a, l, d;
|
|
219
|
+
return (d = (l = (a = e.presentation) == null ? void 0 : a.assets) == null ? void 0 : l[0]) != null ? d : kt;
|
|
220
|
+
}, X = (e) => {
|
|
221
|
+
var a, l, d;
|
|
222
|
+
return (d = (l = e.displayName) != null ? l : (a = e.presentation) == null ? void 0 : a.displayName) != null ? d : "";
|
|
223
|
+
}, $ = (e) => e.available === "true", Te = (e) => {
|
|
224
|
+
t(U) || !$(e) || mt(X(e), e.id);
|
|
225
|
+
}, Me = (e) => le(this, null, function* () {
|
|
226
|
+
if (!(!u() || t(U))) {
|
|
227
|
+
i(U, e, !0);
|
|
228
|
+
try {
|
|
229
|
+
yield lt({ apiEndpoint: u(), userSession: c() }, e), rt(e), it(), ie();
|
|
230
|
+
} catch (a) {
|
|
231
|
+
dt(e, a);
|
|
232
|
+
} finally {
|
|
233
|
+
i(U, void 0);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
D(() => {
|
|
238
|
+
const e = (a) => {
|
|
239
|
+
var f;
|
|
240
|
+
const { type: l, id: d, source: q } = (f = a.data) != null ? f : {};
|
|
241
|
+
switch (l) {
|
|
242
|
+
case ye.REDEEM_REWARD_CONFIRMED:
|
|
243
|
+
d && t(v).some((S) => S.id === d) && Me(d);
|
|
244
|
+
break;
|
|
245
|
+
case ye.BACK_BUTTON_CLICKED:
|
|
246
|
+
q === st && i(P, void 0);
|
|
247
|
+
break;
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
return window.addEventListener("message", e), () => window.removeEventListener("message", e);
|
|
251
|
+
});
|
|
252
|
+
const Oe = () => t(v).length ? s()("generalError") : s()("noContent"), ze = (e) => {
|
|
253
|
+
i(C, e, !0);
|
|
254
|
+
}, Pe = (e) => {
|
|
255
|
+
ht(e.displayName || e.presentation.displayName, e.id);
|
|
256
|
+
}, de = (e) => {
|
|
257
|
+
i(P, e, !0), Pe(e);
|
|
258
|
+
}, Ue = (e) => (a) => {
|
|
259
|
+
(a.key === "Enter" || a.key === " ") && (a.preventDefault(), de(e));
|
|
260
|
+
};
|
|
261
|
+
var Be = {
|
|
262
|
+
get apiEndpoint() {
|
|
263
|
+
return u();
|
|
264
|
+
},
|
|
265
|
+
set apiEndpoint(e = "") {
|
|
266
|
+
u(e), b();
|
|
267
|
+
},
|
|
268
|
+
get userSession() {
|
|
269
|
+
return c();
|
|
270
|
+
},
|
|
271
|
+
set userSession(e = "") {
|
|
272
|
+
c(e), b();
|
|
273
|
+
},
|
|
274
|
+
get locale() {
|
|
275
|
+
return p();
|
|
276
|
+
},
|
|
277
|
+
set locale(e = "") {
|
|
278
|
+
p(e), b();
|
|
279
|
+
},
|
|
280
|
+
get limitItem() {
|
|
281
|
+
return o();
|
|
282
|
+
},
|
|
283
|
+
set limitItem(e = z) {
|
|
284
|
+
o(e), b();
|
|
285
|
+
},
|
|
286
|
+
get translationUrl() {
|
|
287
|
+
return E();
|
|
288
|
+
},
|
|
289
|
+
set translationUrl(e) {
|
|
290
|
+
E(e), b();
|
|
291
|
+
}
|
|
292
|
+
}, ee = Ct(), Ae = N(ee);
|
|
293
|
+
{
|
|
294
|
+
var De = (e) => {
|
|
295
|
+
_t(e, {
|
|
296
|
+
get itemId() {
|
|
297
|
+
return t(P).id;
|
|
298
|
+
},
|
|
299
|
+
get elevateReward() {
|
|
300
|
+
return t(P);
|
|
301
|
+
},
|
|
302
|
+
get apiEndpoint() {
|
|
303
|
+
return u();
|
|
304
|
+
},
|
|
305
|
+
get userSession() {
|
|
306
|
+
return c();
|
|
307
|
+
},
|
|
308
|
+
get locale() {
|
|
309
|
+
return p();
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
}, je = (e) => {
|
|
313
|
+
var a = be(), l = re(a);
|
|
314
|
+
{
|
|
315
|
+
var d = (f) => {
|
|
316
|
+
var S = xt();
|
|
317
|
+
ke(S, 21, () => Array(t(M)), ct, (te, ue, ce, L) => {
|
|
318
|
+
var I = wt();
|
|
319
|
+
k(te, I);
|
|
320
|
+
}), w(S), k(f, S);
|
|
321
|
+
}, q = (f) => {
|
|
322
|
+
var S = be(), te = re(S);
|
|
323
|
+
{
|
|
324
|
+
var ue = (L) => {
|
|
325
|
+
var I = Et(), B = N(I, !0);
|
|
326
|
+
w(I), we((J) => G(B, J), [Oe]), k(L, I);
|
|
327
|
+
}, ce = (L) => {
|
|
328
|
+
var I = It(), B = re(I);
|
|
329
|
+
ke(B, 21, () => t(v), (g) => g.id, (g, m) => {
|
|
330
|
+
var O = qt();
|
|
331
|
+
let pe;
|
|
332
|
+
var A = N(O);
|
|
333
|
+
A.__click = () => de(t(m));
|
|
334
|
+
var Je = _e(() => Ue(t(m)));
|
|
335
|
+
A.__keydown = function(...se) {
|
|
336
|
+
var Z;
|
|
337
|
+
(Z = t(Je)) == null || Z.apply(this, se);
|
|
338
|
+
};
|
|
339
|
+
var me = N(A);
|
|
340
|
+
w(A);
|
|
341
|
+
var ne = V(A, 2), We = N(ne, !0);
|
|
342
|
+
w(ne);
|
|
343
|
+
var ae = V(ne, 2), Ze = N(ae);
|
|
344
|
+
w(ae);
|
|
345
|
+
var W = V(ae, 2);
|
|
346
|
+
W.__click = () => Te(t(m));
|
|
347
|
+
var Ge = N(W, !0);
|
|
348
|
+
w(W), w(O), we(
|
|
349
|
+
(se, Z, Ye, Qe, oe, Xe, $e) => {
|
|
350
|
+
var fe;
|
|
351
|
+
pe = pt(O, 1, "loyalty-shop__item svelte-1f1q033", null, pe, se), xe(me, "src", Z), xe(me, "alt", Ye), G(We, Qe), G(Ze, `${(fe = t(m).points) != null ? fe : ""}
|
|
352
|
+
${oe != null ? oe : ""}`), W.disabled = Xe, G(Ge, $e);
|
|
353
|
+
},
|
|
354
|
+
[
|
|
355
|
+
() => ({
|
|
356
|
+
"loyalty-shop__item--unavailable": !$(t(m))
|
|
357
|
+
}),
|
|
358
|
+
() => Ne(t(m)),
|
|
359
|
+
() => X(t(m)),
|
|
360
|
+
() => X(t(m)),
|
|
361
|
+
() => s()("tokens"),
|
|
362
|
+
() => !$(t(m)) || t(U) === t(m).id,
|
|
363
|
+
() => s()("buyNow")
|
|
364
|
+
]
|
|
365
|
+
), k(g, O);
|
|
366
|
+
}), w(B);
|
|
367
|
+
var J = V(B, 2);
|
|
368
|
+
{
|
|
369
|
+
var He = (g) => {
|
|
370
|
+
vt(g, {
|
|
371
|
+
get offset() {
|
|
372
|
+
return t(C);
|
|
373
|
+
},
|
|
374
|
+
get limit() {
|
|
375
|
+
return t(M);
|
|
376
|
+
},
|
|
377
|
+
get total() {
|
|
378
|
+
return t(H);
|
|
379
|
+
},
|
|
380
|
+
onPageChange: ze,
|
|
381
|
+
get locale() {
|
|
382
|
+
return p();
|
|
383
|
+
}
|
|
384
|
+
});
|
|
385
|
+
};
|
|
386
|
+
j(J, (g) => {
|
|
387
|
+
t(R) || g(He);
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
var Ke = V(J, 2);
|
|
391
|
+
{
|
|
392
|
+
var Fe = (g) => {
|
|
393
|
+
var m = St();
|
|
394
|
+
yt(m, (O) => i(K, O), () => t(K)), k(g, m);
|
|
395
|
+
};
|
|
396
|
+
j(Ke, (g) => {
|
|
397
|
+
t(R) && t(v).length < t(H) && g(Fe);
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
k(L, I);
|
|
401
|
+
};
|
|
402
|
+
j(
|
|
403
|
+
te,
|
|
404
|
+
(L) => {
|
|
405
|
+
!t(v).length || t(Q) ? L(ue) : L(ce, !1);
|
|
406
|
+
},
|
|
407
|
+
!0
|
|
408
|
+
);
|
|
409
|
+
}
|
|
410
|
+
k(f, S);
|
|
411
|
+
};
|
|
412
|
+
j(
|
|
413
|
+
l,
|
|
414
|
+
(f) => {
|
|
415
|
+
t(Y) && t(v).length === 0 ? f(d) : f(q, !1);
|
|
416
|
+
},
|
|
417
|
+
!0
|
|
418
|
+
);
|
|
419
|
+
}
|
|
420
|
+
k(e, a);
|
|
421
|
+
};
|
|
422
|
+
j(Ae, (e) => {
|
|
423
|
+
t(P) ? e(De) : e(je, !1);
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
w(ee), k(h, ee);
|
|
427
|
+
var Ve = Se(Be);
|
|
428
|
+
return x(), Ve;
|
|
429
|
+
}
|
|
430
|
+
et(["click", "keydown"]);
|
|
431
|
+
Ee(
|
|
432
|
+
Ie,
|
|
433
|
+
{
|
|
434
|
+
apiEndpoint: {},
|
|
435
|
+
userSession: {},
|
|
436
|
+
locale: {},
|
|
437
|
+
limitItem: {},
|
|
438
|
+
translationUrl: {}
|
|
439
|
+
},
|
|
440
|
+
[],
|
|
441
|
+
[],
|
|
442
|
+
!0
|
|
443
|
+
);
|
|
444
|
+
function Ce(h, n) {
|
|
445
|
+
qe(n, !0);
|
|
446
|
+
let s = _(n, "apiEndpoint", 7, ""), r = _(n, "userSession", 7, ""), x = _(n, "locale", 7, ""), u = _(n, "limitItem", 7, z), c = _(n, "translationUrl");
|
|
447
|
+
var p = {
|
|
448
|
+
get apiEndpoint() {
|
|
449
|
+
return s();
|
|
450
|
+
},
|
|
451
|
+
set apiEndpoint(o = "") {
|
|
452
|
+
s(o), b();
|
|
453
|
+
},
|
|
454
|
+
get userSession() {
|
|
455
|
+
return r();
|
|
456
|
+
},
|
|
457
|
+
set userSession(o = "") {
|
|
458
|
+
r(o), b();
|
|
459
|
+
},
|
|
460
|
+
get locale() {
|
|
461
|
+
return x();
|
|
462
|
+
},
|
|
463
|
+
set locale(o = "") {
|
|
464
|
+
x(o), b();
|
|
465
|
+
},
|
|
466
|
+
get limitItem() {
|
|
467
|
+
return u();
|
|
468
|
+
},
|
|
469
|
+
set limitItem(o = z) {
|
|
470
|
+
u(o), b();
|
|
471
|
+
},
|
|
472
|
+
get translationUrl() {
|
|
473
|
+
return c();
|
|
474
|
+
},
|
|
475
|
+
set translationUrl(o) {
|
|
476
|
+
c(o), b();
|
|
477
|
+
}
|
|
478
|
+
};
|
|
479
|
+
return Ie(h, {
|
|
480
|
+
get apiEndpoint() {
|
|
481
|
+
return s();
|
|
482
|
+
},
|
|
483
|
+
get userSession() {
|
|
484
|
+
return r();
|
|
485
|
+
},
|
|
486
|
+
get locale() {
|
|
487
|
+
return x();
|
|
488
|
+
},
|
|
489
|
+
get limitItem() {
|
|
490
|
+
return u();
|
|
491
|
+
},
|
|
492
|
+
get translationUrl() {
|
|
493
|
+
return c();
|
|
494
|
+
}
|
|
495
|
+
}), Se(p);
|
|
496
|
+
}
|
|
497
|
+
customElements.define("loyalty-shop", Ee(
|
|
498
|
+
Ce,
|
|
499
|
+
{
|
|
500
|
+
apiEndpoint: {},
|
|
501
|
+
userSession: {},
|
|
502
|
+
locale: {},
|
|
503
|
+
limitItem: {},
|
|
504
|
+
translationUrl: {}
|
|
505
|
+
},
|
|
506
|
+
[],
|
|
507
|
+
[],
|
|
508
|
+
!1
|
|
509
|
+
));
|
|
510
|
+
const Mt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
511
|
+
__proto__: null,
|
|
512
|
+
default: Ce
|
|
513
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
514
|
+
export {
|
|
515
|
+
Ie as L,
|
|
516
|
+
Mt as a
|
|
517
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
typeof globalThis.HTMLElement>"u"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const e=require("./LoyaltyPagination-Boz7CVJt.cjs"),qe=require("./LoyaltyShopItem-BRiUNphq.cjs");if(typeof window<"u"){let m=function(n){return function(...s){try{return n.apply(this,s)}catch(l){if(l instanceof DOMException&&l.message.includes("has already been used with this registry")||l instanceof Error&&l.message.includes("Cannot define multiple custom elements with the same tag name"))return!1;throw l}}};customElements.define=m(customElements.define),Promise.resolve().then(()=>require("./LoyaltyPagination-Boz7CVJt.cjs")).then(n=>n.LoyaltyPagination_ce).then(n=>{const s=n.default||n;customElements.get("loyalty-pagination")||customElements.define("loyalty-pagination",s.element||s)}).catch(n=>{console.error("BOOT ERROR:",n)})}if(typeof window<"u"){let m=function(n){return function(...s){try{return n.apply(this,s)}catch(l){if(l instanceof DOMException&&l.message.includes("has already been used with this registry")||l instanceof Error&&l.message.includes("Cannot define multiple custom elements with the same tag name"))return!1;throw l}}};customElements.define=m(customElements.define),Promise.resolve().then(()=>require("./LoyaltyShopItem-BRiUNphq.cjs")).then(n=>n.LoyaltyShopItem_ce).then(n=>{const s=n.default||n;customElements.get("loyalty-shop-item")||customElements.define("loyalty-shop-item",s.element||s)}).catch(n=>{console.error("BOOT ERROR:",n)})}const Ie={en:{loading:"Loading…",noContent:"There are no bonus items available for redemption.",networkProblem:"Network problem. Please reload.",tokens:"Tokens",buyNow:"Buy Now",generalError:"Something went wrong... Please try again."},tr:{loading:"Yükleniyor…",noContent:"Kullanılabilir bonus öğesi bulunmamaktadır.",networkProblem:"Ağ sorunu. Lütfen yeniden yükleyin.",tokens:"Tokens",buyNow:"Satın Al",generalError:"Bir sorun oluştu, lütfen tekrar deneyin."},da:{loading:"Indlæser…",noContent:"Der er ingen bonusgenstande tilgængelige til indløsning.",networkProblem:"Netværksproblem. Genindlæs venligst siden.",tokens:"Tokens",buyNow:"Køb nu",generalError:"Noget gik galt. Prøv venligst igen."},de:{loading:"Wird geladen…",noContent:"Es sind keine Bonusartikel zum Einlösen verfügbar.",networkProblem:"Netzwerkproblem. Bitte lade die Seite neu.",tokens:"Token",buyNow:"Jetzt kaufen",generalError:"Etwas ist schiefgelaufen. Bitte versuche es erneut."},nl:{loading:"Laden…",noContent:"Er zijn geen bonusitems beschikbaar om in te wisselen.",networkProblem:"Netwerkprobleem. Laad de pagina opnieuw.",tokens:"Tokens",buyNow:"Nu kopen",generalError:"Er is iets misgegaan. Probeer het opnieuw."},fr:{loading:"Chargement…",noContent:"Aucun bonus n'est disponible pour être échangé.",networkProblem:"Problème de réseau. Veuillez recharger la page.",tokens:"Jetons",buyNow:"Acheter",generalError:"Une erreur s'est produite. Veuillez réessayer."},hu:{loading:"Betöltés…",noContent:"Nincsenek beváltható bónuszok.",networkProblem:"Hálózati probléma. Kérjük, töltsd újra az oldalt.",tokens:"Tokenek",buyNow:"Vásárlás",generalError:"Hiba történt. Kérjük, próbáld újra."}},Le="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='800px'%20height='800px'%20viewBox='0%200%20120%20120'%20fill='none'%3e%3crect%20width='120'%20height='120'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M33.2503%2038.4816C33.2603%2037.0472%2034.4199%2035.8864%2035.8543%2035.875H83.1463C84.5848%2035.875%2085.7503%2037.0431%2085.7503%2038.4816V80.5184C85.7403%2081.9528%2084.5807%2083.1136%2083.1463%2083.125H35.8543C34.4158%2083.1236%2033.2503%2081.957%2033.2503%2080.5184V38.4816ZM80.5006%2041.1251H38.5006V77.8751L62.8921%2053.4783C63.9172%2052.4536%2065.5788%2052.4536%2066.6039%2053.4783L80.5006%2067.4013V41.1251ZM43.75%2051.6249C43.75%2054.5244%2046.1005%2056.8749%2049%2056.8749C51.8995%2056.8749%2054.25%2054.5244%2054.25%2051.6249C54.25%2048.7254%2051.8995%2046.3749%2049%2046.3749C46.1005%2046.3749%2043.75%2048.7254%2043.75%2051.6249Z'%20fill='%23687787'/%3e%3c/svg%3e";var Te=e.from_html('<div class="loyalty-shop__item loyalty-shop__item--skeleton svelte-1f1q033"><div class="loyalty-shop__item-image skeleton-box svelte-1f1q033"></div> <div class="loyalty-shop__item-title skeleton-line svelte-1f1q033"></div> <div class="loyalty-shop__item-points skeleton-line skeleton-line--short svelte-1f1q033"></div> <div class="loyalty-shop__item-button-skeleton skeleton-box svelte-1f1q033"></div></div>'),Me=e.from_html('<div class="loyalty-shop__grid loyalty-shop__grid--skeleton svelte-1f1q033"></div>'),Ce=e.from_html('<div class="loyalty-shop__unavailable svelte-1f1q033"> </div>'),Re=e.from_html('<div><div role="button" tabindex="0" class="loyalty-shop__item-image-container svelte-1f1q033"><img class="loyalty-shop__item-image svelte-1f1q033"/></div> <span class="loyalty-shop__item-title svelte-1f1q033"> </span> <span class="loyalty-shop__item-points svelte-1f1q033"> </span> <button class="loyalty-shop__item-button svelte-1f1q033" type="button"> </button></div>'),Ne=e.from_html('<div class="load-more-sentinel svelte-1f1q033" aria-hidden="true"></div>'),Oe=e.from_html('<div class="loyalty-shop__grid svelte-1f1q033"></div> <!> <!>',1),Pe=e.from_html('<div class="loyalty-shop svelte-1f1q033"><!></div>');const Ue={hash:"svelte-1f1q033",code:`.loyalty-shop.svelte-1f1q033 {padding:16px;border-radius:6px;border:1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));background-color:var(--app-container-bg-default, #022652);width:100%;box-sizing:border-box;display:flex;flex-direction:column;gap:16px;}.loyalty-shop__unavailable.svelte-1f1q033 {color:var(--text-subtle, #dfe3e8);font-size:14px;padding:24px 0;text-align:center;}.loyalty-shop__grid.svelte-1f1q033 {display:grid;gap:16px;grid-template-columns:repeat(2, 1fr);margin:0;}.loyalty-shop__item.svelte-1f1q033 {display:flex;flex-direction:column;gap:8px;padding:16px;border-radius:10px;border:1px solid var(--border-default, rgba(251, 251, 251, 0.15));background-color:var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1));}.loyalty-shop__item--unavailable.svelte-1f1q033 {opacity:1;}.loyalty-shop__item-image.svelte-1f1q033 {width:100%;height:82px;border-radius:6px;}.loyalty-shop__item-title.svelte-1f1q033 {color:var(--text-default, #ffffff);font-size:12px;font-weight:400;}.loyalty-shop__item-points.svelte-1f1q033 {color:var(--text-subtle, #dfe3e8);font-size:14px;font-weight:400;}.loyalty-shop__item-button.svelte-1f1q033 {margin-top:auto;width:100%;height:37px;padding:8px 16px;border:none;border-radius:6px;background:var(--button-primary-bg-default, #ffcc00);color:var(--button-primary-text-default, #261d00);font-size:12px;font-weight:400;cursor:pointer;}.loyalty-shop__item-button.svelte-1f1q033:disabled {opacity:0.4;cursor:default;}.skeleton-box.svelte-1f1q033 {background:linear-gradient(
|
|
2
|
+
90deg,
|
|
3
|
+
var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 0%,
|
|
4
|
+
color-mix(in srgb, var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 80%, white) 50%,
|
|
5
|
+
var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 100%
|
|
6
|
+
);background-size:200% 100%;
|
|
7
|
+
animation: svelte-1f1q033-shimmer 3s linear infinite;border-radius:6px;}.skeleton-line.svelte-1f1q033 {height:14px;border-radius:6px;background:linear-gradient(
|
|
8
|
+
90deg,
|
|
9
|
+
var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 0%,
|
|
10
|
+
color-mix(in srgb, var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 80%, white) 50%,
|
|
11
|
+
var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 100%
|
|
12
|
+
);background-size:200% 100%;
|
|
13
|
+
animation: svelte-1f1q033-shimmer 3s linear infinite;}.skeleton-line--short.svelte-1f1q033 {width:40%;}.loyalty-shop__item--skeleton.svelte-1f1q033 {display:flex;flex-direction:column;}.loyalty-shop__item--skeleton.svelte-1f1q033 .loyalty-shop__item-image:where(.svelte-1f1q033) {width:100%;height:82px;border-radius:6px;}.loyalty-shop__item--skeleton.svelte-1f1q033 .loyalty-shop__item-title:where(.svelte-1f1q033) {width:90%;}.loyalty-shop__item--skeleton.svelte-1f1q033 .loyalty-shop__item-points:where(.svelte-1f1q033) {width:40%;}.loyalty-shop__item-button-skeleton.svelte-1f1q033 {margin-top:auto;width:100%;height:40px;border-radius:6px;}.loyalty-shop__item-image-container.svelte-1f1q033 {cursor:pointer;}
|
|
14
|
+
|
|
15
|
+
@keyframes svelte-1f1q033-shimmer {
|
|
16
|
+
0% {
|
|
17
|
+
background-position: 200% 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
100% {
|
|
21
|
+
background-position: -200% 0;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@media (min-width: 768px) {.loyalty-shop__grid.svelte-1f1q033 {grid-template-columns:repeat(4, 1fr);justify-content:start;margin:0;}.loyalty-shop__item.svelte-1f1q033 {width:100%;height:100%;box-sizing:border-box;}.loyalty-shop__item-image.svelte-1f1q033 {height:200px;}.loyalty-shop__item--skeleton.svelte-1f1q033 .loyalty-shop__item-image:where(.svelte-1f1q033) {height:200px;}
|
|
26
|
+
}`};function K(m,n){e.push(n,!0),e.append_styles(m,Ue);const s=()=>e.store_get(e.$format,"$_",l),[l,x]=e.setup_stores(),d=e.prop(n,"apiEndpoint",7,""),c=e.prop(n,"userSession",7,""),f=e.prop(n,"locale",7,""),r=e.prop(n,"limitItem",7,e.ITEMS_LIMIT_DEFAULT),M=e.prop(n,"translationUrl");e.setupI18n({withLocale:f(),translations:{}});const $=async()=>{try{const t=new URL(M(),window.location.href),o=await fetch(t.href);if(!o.ok)throw new Error("Failed to fetch translations");const a=await o.json();Object.entries(a).forEach(([g,I])=>{e.addNewMessages(g,I)})}catch(t){console.error("loyalty shop translation url err:",t)}};Object.entries(Ie).forEach(([t,o])=>{e.addNewMessages(t,o)});let u=e.state(e.proxy([])),S=e.state(void 0),C=e.state(0),_=e.state(0),k=e.state(e.proxy(e.MOBILE_LOAD_ITEMS)),U=e.state(!1),D=e.state(!1),q=e.state(void 0),v=e.state(!1),R=e.state(void 0),N=0;const ee=e.user_derived(()=>typeof r()=="number"?r():parseInt(r(),e.ITEMS_LIMIT_DEFAULT)||e.ITEMS_LIMIT_DEFAULT),Y=()=>{if(!d()||!c())return;e.set(U,!0),e.set(D,!1);const t=++N,o=e.get(v)&&e.get(_)>0;e.fetchShopRewards({apiEndpoint:d(),userSession:c(),locale:f()},e.get(_),e.get(k)).then(a=>{if(t!==N)return;const g=a.data??[];e.set(C,a.total??0,!0),o?e.set(u,[...e.get(u),...g],!0):e.set(u,g,!0)}).catch(a=>{t===N&&(e.set(D,!0),console.error("Failed to load shop rewards:",a))}).finally(()=>{t===N&&e.set(U,!1)})};e.user_effect(()=>{d(),c(),f(),e.get(_),e.get(k),Y()}),e.user_effect(()=>{const t=window.matchMedia("(max-width: 767px)"),o=a=>{e.set(v,a.matches,!0)};return e.set(v,t.matches,!0),t.addEventListener("change",o),()=>t.removeEventListener("change",o)}),e.user_effect(()=>{e.set(k,e.get(v)?e.MOBILE_LOAD_ITEMS:e.get(ee),!0)}),e.user_effect(()=>{if(!e.get(v)||!e.get(R))return;const t=new IntersectionObserver(o=>{o.some(a=>a.isIntersecting)&&e.get(u).length<e.get(C)&&e.set(_,e.get(_)+e.get(k))},{rootMargin:"200px"});return t.observe(e.get(R)),()=>t.disconnect()}),e.user_pre_effect(()=>{M()&&$()});const te=t=>t.presentation?.assets?.[0]??Le,A=t=>t.displayName??t.presentation?.displayName??"",z=t=>t.available==="true",ne=t=>{e.get(q)||!z(t)||e.sendRedeemRewardRequested(A(t),t.id)},oe=async t=>{if(!(!d()||e.get(q))){e.set(q,t,!0);try{await e.redeemReward({apiEndpoint:d(),userSession:c()},t),e.sendRedeemRewardSuccess(t),e.dispatchRedeemRewardButton(),Y()}catch(o){e.sendRedeemRewardFailed(t,o)}finally{e.set(q,void 0)}}};e.user_effect(()=>{const t=o=>{const{type:a,id:g,source:I}=o.data??{};switch(a){case e.EVENT_TYPES.REDEEM_REWARD_CONFIRMED:g&&e.get(u).some(h=>h.id===g)&&oe(g);break;case e.EVENT_TYPES.BACK_BUTTON_CLICKED:I===e.SOURCE&&e.set(S,void 0);break}};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)});const se=()=>e.get(u).length?s()("generalError"):s()("noContent"),le=t=>{e.set(_,t,!0)},re=t=>{e.sendRewardItemClicked(t.displayName||t.presentation.displayName,t.id)},Z=t=>{e.set(S,t,!0),re(t)},ae=t=>o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),Z(t))};var ie={get apiEndpoint(){return d()},set apiEndpoint(t=""){d(t),e.flushSync()},get userSession(){return c()},set userSession(t=""){c(t),e.flushSync()},get locale(){return f()},set locale(t=""){f(t),e.flushSync()},get limitItem(){return r()},set limitItem(t=e.ITEMS_LIMIT_DEFAULT){r(t),e.flushSync()},get translationUrl(){return M()},set translationUrl(t){M(t),e.flushSync()}},B=Pe(),de=e.child(B);{var ce=t=>{qe.LoyaltyShopItem(t,{get itemId(){return e.get(S).id},get elevateReward(){return e.get(S)},get apiEndpoint(){return d()},get userSession(){return c()},get locale(){return f()}})},pe=t=>{var o=e.comment(),a=e.first_child(o);{var g=h=>{var w=Me();e.each(w,21,()=>Array(e.get(k)),e.index,(j,J,W,b)=>{var y=Te();e.append(j,y)}),e.reset(w),e.append(h,w)},I=h=>{var w=e.comment(),j=e.first_child(w);{var J=b=>{var y=Ce(),L=e.child(y,!0);e.reset(y),e.template_effect(O=>e.set_text(L,O),[se]),e.append(b,y)},W=b=>{var y=Oe(),L=e.first_child(y);e.each(L,21,()=>e.get(u),p=>p.id,(p,i)=>{var E=Re();let G;var T=e.child(E);T.__click=()=>Z(e.get(i));var he=e.user_derived(()=>ae(e.get(i)));T.__keydown=function(...H){e.get(he)?.apply(this,H)};var Q=e.child(T);e.reset(T);var F=e.sibling(T,2),ye=e.child(F,!0);e.reset(F);var V=e.sibling(F,2),_e=e.child(V);e.reset(V);var P=e.sibling(V,2);P.__click=()=>ne(e.get(i));var ve=e.child(P,!0);e.reset(P),e.reset(E),e.template_effect((H,be,ke,we,Ee,xe,Se)=>{G=e.set_class(E,1,"loyalty-shop__item svelte-1f1q033",null,G,H),e.set_attribute(Q,"src",be),e.set_attribute(Q,"alt",ke),e.set_text(ye,we),e.set_text(_e,`${e.get(i).points??""}
|
|
27
|
+
${Ee??""}`),P.disabled=xe,e.set_text(ve,Se)},[()=>({"loyalty-shop__item--unavailable":!z(e.get(i))}),()=>te(e.get(i)),()=>A(e.get(i)),()=>A(e.get(i)),()=>s()("tokens"),()=>!z(e.get(i))||e.get(q)===e.get(i).id,()=>s()("buyNow")]),e.append(p,E)}),e.reset(L);var O=e.sibling(L,2);{var ge=p=>{e.LoyaltyPagination(p,{get offset(){return e.get(_)},get limit(){return e.get(k)},get total(){return e.get(C)},onPageChange:le,get locale(){return f()}})};e.if_block(O,p=>{e.get(v)||p(ge)})}var fe=e.sibling(O,2);{var me=p=>{var i=Ne();e.bind_this(i,E=>e.set(R,E),()=>e.get(R)),e.append(p,i)};e.if_block(fe,p=>{e.get(v)&&e.get(u).length<e.get(C)&&p(me)})}e.append(b,y)};e.if_block(j,b=>{!e.get(u).length||e.get(D)?b(J):b(W,!1)},!0)}e.append(h,w)};e.if_block(a,h=>{e.get(U)&&e.get(u).length===0?h(g):h(I,!1)},!0)}e.append(t,o)};e.if_block(de,t=>{e.get(S)?t(ce):t(pe,!1)})}e.reset(B),e.append(m,B);var ue=e.pop(ie);return x(),ue}e.delegate(["click","keydown"]);e.create_custom_element(K,{apiEndpoint:{},userSession:{},locale:{},limitItem:{},translationUrl:{}},[],[],!0);function X(m,n){e.push(n,!0);let s=e.prop(n,"apiEndpoint",7,""),l=e.prop(n,"userSession",7,""),x=e.prop(n,"locale",7,""),d=e.prop(n,"limitItem",7,e.ITEMS_LIMIT_DEFAULT),c=e.prop(n,"translationUrl");var f={get apiEndpoint(){return s()},set apiEndpoint(r=""){s(r),e.flushSync()},get userSession(){return l()},set userSession(r=""){l(r),e.flushSync()},get locale(){return x()},set locale(r=""){x(r),e.flushSync()},get limitItem(){return d()},set limitItem(r=e.ITEMS_LIMIT_DEFAULT){d(r),e.flushSync()},get translationUrl(){return c()},set translationUrl(r){c(r),e.flushSync()}};return K(m,{get apiEndpoint(){return s()},get userSession(){return l()},get locale(){return x()},get limitItem(){return d()},get translationUrl(){return c()}}),e.pop(f)}customElements.define("loyalty-shop",e.create_custom_element(X,{apiEndpoint:{},userSession:{},locale:{},limitItem:{},translationUrl:{}},[],[],!1));const De=Object.freeze(Object.defineProperty({__proto__:null,default:X},Symbol.toStringTag,{value:"Module"}));exports.LoyaltyShop=K;exports.LoyaltyShop_ce=De;
|