@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.
@@ -1,44 +1,49 @@
1
- import { y as Ke, c as pe, p as me, a as He, b as h, s as Fe, d as ae, z as f, A as oe, O as ie, C as M, m as t, E as r, B as Je, G as re, S as We, i as X, h as x, j as ge, P as R, Q as Ye, u as le, H as Ze, I as Ge, J as Qe, K as Xe, v as q, k as v, l as $e, n as E, r as b, R as de, T as et, t as ue, q as V, g as tt, o as z, w as nt, $ as st, U as at, N as ce, L as $, V as ot, W as it, M as rt, X as lt } from "./LoyaltyPagination-BcRXvso4.js";
2
- import { L as dt } from "./LoyaltyShopItem-BRu06lmS.js";
1
+ import { y as Xe, c as be, p as ke, a as $e, b as h, s as et, d as ce, z as g, A as pe, N as me, C as A, m as t, E as l, B as tt, G as fe, S as nt, i as D, h as _, j as we, O as T, P as at, u as ge, H as st, I as ot, J as lt, K as rt, v as C, k as v, l as it, n as I, r as b, f as he, g as se, Q as ve, R as dt, t as ye, q as Z, o as j, T as ut, M as _e, L as ct, w as pt, $ as mt, U as ft, V as gt, W as ht } from "./LoyaltyPagination-B-q5gKJj.js";
2
+ import { L as vt } from "./LoyaltyShopItem-C2xuJLoW.js";
3
+ typeof globalThis.HTMLElement > "u" && (globalThis.HTMLElement = class {
4
+ }, globalThis.customElements = { define() {
5
+ }, get() {
6
+ }, whenDefined() {
7
+ } });
3
8
  if (typeof window < "u") {
4
- let _ = function(n) {
5
- return function(...o) {
9
+ let k = function(n) {
10
+ return function(...s) {
6
11
  try {
7
- return n.apply(this, o);
8
- } catch (i) {
9
- if (i instanceof DOMException && i.message.includes("has already been used with this registry") || i instanceof Error && i.message.includes("Cannot define multiple custom elements with the same tag name"))
12
+ return n.apply(this, s);
13
+ } catch (o) {
14
+ if (o instanceof DOMException && o.message.includes("has already been used with this registry") || o instanceof Error && o.message.includes("Cannot define multiple custom elements with the same tag name"))
10
15
  return !1;
11
- throw i;
16
+ throw o;
12
17
  }
13
18
  };
14
19
  };
15
- customElements.define = _(customElements.define), import("./LoyaltyPagination-BcRXvso4.js").then((n) => n.Y).then((n) => {
16
- const o = n.default || n;
17
- customElements.get("loyalty-pagination") || customElements.define("loyalty-pagination", o.element || o);
20
+ customElements.define = k(customElements.define), import("./LoyaltyPagination-B-q5gKJj.js").then((n) => n.X).then((n) => {
21
+ const s = n.default || n;
22
+ customElements.get("loyalty-pagination") || customElements.define("loyalty-pagination", s.element || s);
18
23
  }).catch((n) => {
19
24
  console.error("BOOT ERROR:", n);
20
25
  });
21
26
  }
22
27
  if (typeof window < "u") {
23
- let _ = function(n) {
24
- return function(...o) {
28
+ let k = function(n) {
29
+ return function(...s) {
25
30
  try {
26
- return n.apply(this, o);
27
- } catch (i) {
28
- if (i instanceof DOMException && i.message.includes("has already been used with this registry") || i instanceof Error && i.message.includes("Cannot define multiple custom elements with the same tag name"))
31
+ return n.apply(this, s);
32
+ } catch (o) {
33
+ if (o instanceof DOMException && o.message.includes("has already been used with this registry") || o instanceof Error && o.message.includes("Cannot define multiple custom elements with the same tag name"))
29
34
  return !1;
30
- throw i;
35
+ throw o;
31
36
  }
32
37
  };
33
38
  };
34
- customElements.define = _(customElements.define), import("./LoyaltyShopItem-BRu06lmS.js").then((n) => n.a).then((n) => {
35
- const o = n.default || n;
36
- customElements.get("loyalty-shop-item") || customElements.define("loyalty-shop-item", o.element || o);
39
+ customElements.define = k(customElements.define), import("./LoyaltyShopItem-C2xuJLoW.js").then((n) => n.a).then((n) => {
40
+ const s = n.default || n;
41
+ customElements.get("loyalty-shop-item") || customElements.define("loyalty-shop-item", s.element || s);
37
42
  }).catch((n) => {
38
43
  console.error("BOOT ERROR:", n);
39
44
  });
40
45
  }
41
- const ut = {
46
+ const yt = {
42
47
  en: {
43
48
  loading: "Loading…",
44
49
  noContent: "There are no bonus items available for redemption.",
@@ -95,9 +100,9 @@ const ut = {
95
100
  buyNow: "Vásárlás",
96
101
  generalError: "Hiba történt. Kérjük, próbáld újra."
97
102
  }
98
- }, ct = "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";
99
- var pt = q('<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>'), mt = q('<div class="loyalty-shop__grid loyalty-shop__grid--skeleton svelte-1f1q033"></div>'), gt = q('<div class="loyalty-shop__unavailable svelte-1f1q033"> </div>'), ft = q('<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>'), ht = q('<div class="load-more-sentinel svelte-1f1q033" aria-hidden="true"></div>'), vt = q('<div class="loyalty-shop__grid svelte-1f1q033"></div> <!> <!>', 1), yt = q('<div class="loyalty-shop svelte-1f1q033"><!></div>');
100
- const bt = {
103
+ }, _t = "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";
104
+ var bt = C('<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>'), kt = C('<div class="loyalty-shop__grid loyalty-shop__grid--skeleton svelte-1f1q033"></div>'), wt = C('<div class="loyalty-shop__unavailable svelte-1f1q033"> </div>'), xt = C('<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>'), Et = C('<div class="load-more-sentinel svelte-1f1q033" aria-hidden="true"></div>'), qt = C('<div class="loyalty-shop__grid svelte-1f1q033"></div> <!> <!>', 1), St = C('<div class="loyalty-shop svelte-1f1q033"><!></div>');
105
+ const It = {
101
106
  hash: "svelte-1f1q033",
102
107
  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(
103
108
  90deg,
@@ -126,121 +131,121 @@ const bt = {
126
131
  @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;}
127
132
  }`
128
133
  };
129
- function fe(_, n) {
130
- me(n, !0), He(_, bt);
131
- const o = () => nt(st, "$_", i), [i, L] = $e(), c = h(n, "apiEndpoint", 7, ""), p = h(n, "userSession", 7, ""), y = h(n, "locale", 7, ""), l = h(n, "limitItem", 7, R), P = h(n, "translationUrl");
132
- Fe({ withLocale: y(), translations: {} });
133
- const ve = async () => {
134
+ function xe(k, n) {
135
+ ke(n, !0), $e(k, It);
136
+ const s = () => pt(mt, "$_", o), [o, M] = it(), u = h(n, "apiEndpoint", 7, ""), c = h(n, "userSession", 7, ""), y = h(n, "locale", 7, ""), r = h(n, "limitItem", 7, T), V = h(n, "translationUrl");
137
+ et({ withLocale: y(), translations: {} });
138
+ const qe = async () => {
134
139
  try {
135
- const e = new URL(P(), window.location.href), s = await fetch(e.href);
136
- if (!s.ok)
140
+ const e = new URL(V(), window.location.href), a = await fetch(e.href);
141
+ if (!a.ok)
137
142
  throw new Error("Failed to fetch translations");
138
- const a = await s.json();
139
- Object.entries(a).forEach(([d, I]) => {
140
- ae(d, I);
143
+ const i = await a.json();
144
+ Object.entries(i).forEach(([f, P]) => {
145
+ ce(f, P);
141
146
  });
142
147
  } catch (e) {
143
148
  console.error("loyalty shop translation url err:", e);
144
149
  }
145
150
  };
146
- Object.entries(ut).forEach(([e, s]) => {
147
- ae(e, s);
151
+ Object.entries(yt).forEach(([e, a]) => {
152
+ ce(e, a);
148
153
  });
149
- let g = f(oe([])), N = f(void 0), U = f(0), k = f(0), S = f(oe(ie)), K = f(!1), H = f(!1), O = f(void 0), w = f(!1), B = f(void 0), A = 0;
150
- const ye = le(() => typeof l() == "number" ? l() : parseInt(l(), R) || R), ee = () => {
151
- if (!c() || !p())
154
+ let m = g(pe([])), O = g(void 0), H = g(0), E = g(0), R = g(pe(me)), G = g(!1), Y = g(!1), z = g(void 0), q = g(!1), K = g(void 0), F = 0;
155
+ const Se = ge(() => typeof r() == "number" ? r() : parseInt(r(), T) || T), oe = () => {
156
+ if (!u() || !c())
152
157
  return;
153
- r(K, !0), r(H, !1);
154
- const e = ++A, s = t(w) && t(k) > 0;
155
- Ye(
158
+ l(G, !0), l(Y, !1);
159
+ const e = ++F, a = t(q) && t(E) > 0;
160
+ at(
156
161
  {
157
- apiEndpoint: c(),
158
- userSession: p(),
162
+ apiEndpoint: u(),
163
+ userSession: c(),
159
164
  locale: y()
160
165
  },
161
- t(k),
162
- t(S)
163
- ).then((a) => {
164
- if (e !== A)
166
+ t(E),
167
+ t(R)
168
+ ).then((i) => {
169
+ if (e !== F)
165
170
  return;
166
- const d = a.data ?? [];
167
- r(U, a.total ?? 0, !0), s ? r(g, [...t(g), ...d], !0) : r(g, d, !0);
168
- }).catch((a) => {
169
- e === A && (r(H, !0), console.error("Failed to load shop rewards:", a));
171
+ const f = i.data ?? [];
172
+ l(H, i.total ?? 0, !0), a ? l(m, [...t(m), ...f], !0) : l(m, f, !0);
173
+ }).catch((i) => {
174
+ e === F && (l(Y, !0), console.error("Failed to load shop rewards:", i));
170
175
  }).finally(() => {
171
- e === A && r(K, !1);
176
+ e === F && l(G, !1);
172
177
  });
173
178
  };
174
- M(() => {
175
- c(), p(), y(), t(k), t(S), ee();
176
- }), M(() => {
177
- const e = window.matchMedia("(max-width: 767px)"), s = (a) => {
178
- r(w, a.matches, !0);
179
+ A(() => {
180
+ u(), c(), y(), t(E), t(R), oe();
181
+ }), A(() => {
182
+ const e = window.matchMedia("(max-width: 767px)"), a = (i) => {
183
+ l(q, i.matches, !0);
179
184
  };
180
- return r(w, e.matches, !0), e.addEventListener("change", s), () => e.removeEventListener("change", s);
181
- }), M(() => {
182
- r(S, t(w) ? ie : t(ye), !0);
183
- }), M(() => {
184
- if (!t(w) || !t(B)) return;
185
+ return l(q, e.matches, !0), e.addEventListener("change", a), () => e.removeEventListener("change", a);
186
+ }), A(() => {
187
+ l(R, t(q) ? me : t(Se), !0);
188
+ }), A(() => {
189
+ if (!t(q) || !t(K)) return;
185
190
  const e = new IntersectionObserver(
186
- (s) => {
187
- s.some((a) => a.isIntersecting) && t(g).length < t(U) && r(k, t(k) + t(S));
191
+ (a) => {
192
+ a.some((i) => i.isIntersecting) && t(m).length < t(H) && l(E, t(E) + t(R));
188
193
  },
189
194
  { rootMargin: "200px" }
190
195
  );
191
- return e.observe(t(B)), () => e.disconnect();
192
- }), Je(() => {
193
- P() && ve();
196
+ return e.observe(t(K)), () => e.disconnect();
197
+ }), tt(() => {
198
+ V() && qe();
194
199
  });
195
- const be = (e) => e.presentation?.assets?.[0] ?? ct, F = (e) => e.displayName ?? e.presentation?.displayName ?? "", J = (e) => e.available === "true", _e = (e) => {
196
- t(O) || !J(e) || rt(F(e), e.id);
197
- }, ke = async (e) => {
198
- if (!(!c() || t(O))) {
199
- r(O, e, !0);
200
+ const Ie = (e) => e.presentation?.assets?.[0] ?? _t, Q = (e) => e.displayName ?? e.presentation?.displayName ?? "", X = (e) => e.available === "true", Ce = (e) => {
201
+ t(z) || !X(e) || ct(Q(e), e.id);
202
+ }, Re = async (e) => {
203
+ if (!(!u() || t(z))) {
204
+ l(z, e, !0);
200
205
  try {
201
- await Ze({ apiEndpoint: c(), userSession: p() }, e), Ge(e), Qe(), ee();
202
- } catch (s) {
203
- Xe(e, s);
206
+ await st({ apiEndpoint: u(), userSession: c() }, e), ot(e), lt(), oe();
207
+ } catch (a) {
208
+ rt(e, a);
204
209
  } finally {
205
- r(O, void 0);
210
+ l(z, void 0);
206
211
  }
207
212
  }
208
213
  };
209
- M(() => {
210
- const e = (s) => {
211
- const { type: a, id: d, source: I } = s.data ?? {};
212
- switch (a) {
213
- case re.REDEEM_REWARD_CONFIRMED:
214
- d && t(g).some((D) => D.id === d) && ke(d);
214
+ A(() => {
215
+ const e = (a) => {
216
+ const { type: i, id: f, source: P } = a.data ?? {};
217
+ switch (i) {
218
+ case fe.REDEEM_REWARD_CONFIRMED:
219
+ f && t(m).some((w) => w.id === f) && Re(f);
215
220
  break;
216
- case re.BACK_BUTTON_CLICKED:
217
- I === We && r(N, void 0);
221
+ case fe.BACK_BUTTON_CLICKED:
222
+ P === nt && l(O, void 0);
218
223
  break;
219
224
  }
220
225
  };
221
226
  return window.addEventListener("message", e), () => window.removeEventListener("message", e);
222
227
  });
223
- const we = () => t(g).length ? o()("generalError") : o()("noContent"), xe = (e) => {
224
- r(k, e, !0);
225
- }, Ee = (e) => {
226
- lt(e.displayName || e.presentation.displayName, e.id);
227
- }, te = (e) => {
228
- r(N, e, !0), Ee(e);
229
- }, qe = (e) => (s) => {
230
- (s.key === "Enter" || s.key === " ") && (s.preventDefault(), te(e));
228
+ const Le = () => t(m).length ? s()("generalError") : s()("noContent"), Ne = (e) => {
229
+ l(E, e, !0);
230
+ }, Te = (e) => {
231
+ ft(e.displayName || e.presentation.displayName, e.id);
232
+ }, le = (e) => {
233
+ l(O, e, !0), Te(e);
234
+ }, Me = (e) => (a) => {
235
+ (a.key === "Enter" || a.key === " ") && (a.preventDefault(), le(e));
231
236
  };
232
- var Se = {
237
+ var Oe = {
233
238
  get apiEndpoint() {
234
- return c();
239
+ return u();
235
240
  },
236
241
  set apiEndpoint(e = "") {
237
- c(e), v();
242
+ u(e), v();
238
243
  },
239
244
  get userSession() {
240
- return p();
245
+ return c();
241
246
  },
242
247
  set userSession(e = "") {
243
- p(e), v();
248
+ c(e), v();
244
249
  },
245
250
  get locale() {
246
251
  return y();
@@ -249,124 +254,156 @@ function fe(_, n) {
249
254
  y(e), v();
250
255
  },
251
256
  get limitItem() {
252
- return l();
257
+ return r();
253
258
  },
254
- set limitItem(e = R) {
255
- l(e), v();
259
+ set limitItem(e = T) {
260
+ r(e), v();
256
261
  },
257
262
  get translationUrl() {
258
- return P();
263
+ return V();
259
264
  },
260
265
  set translationUrl(e) {
261
- P(e), v();
266
+ V(e), v();
262
267
  }
263
- }, W = yt(), Ie = E(W);
268
+ }, $ = St(), ze = I($);
264
269
  {
265
- var Ce = (e) => {
266
- dt(e, {
270
+ var Pe = (e) => {
271
+ vt(e, {
267
272
  get itemId() {
268
- return t(N).id;
273
+ return t(O).id;
269
274
  },
270
275
  get elevateReward() {
271
- return t(N);
276
+ return t(O);
272
277
  },
273
278
  get apiEndpoint() {
274
- return c();
279
+ return u();
275
280
  },
276
281
  get userSession() {
277
- return p();
282
+ return c();
278
283
  },
279
284
  get locale() {
280
285
  return y();
281
286
  }
282
287
  });
283
- }, Re = (e) => {
284
- var s = mt();
285
- de(s, 21, () => Array(t(S)), et, (a, d, I, D) => {
286
- var Y = pt();
287
- x(a, Y);
288
- }), b(s), x(e, s);
289
- }, Le = (e) => {
290
- var s = gt(), a = E(s, !0);
291
- b(s), ue((d) => V(a, d), [() => we()]), x(e, s);
292
- }, Ne = (e) => {
293
- var s = vt(), a = tt(s);
294
- de(a, 21, () => t(g), (m) => m.id, (m, u) => {
295
- var C = ft();
296
- let ne;
297
- var T = E(C), Te = le(() => qe(t(u))), se = E(T);
298
- b(T);
299
- var Z = z(T, 2), Me = E(Z, !0);
300
- b(Z);
301
- var G = z(Z, 2), ze = E(G);
302
- b(G);
303
- var j = z(G, 2), Pe = E(j, !0);
304
- b(j), b(C), ue(
305
- (Q, Ue, Be, Ae, De, je, Ve) => {
306
- ne = at(C, 1, "loyalty-shop__item svelte-1f1q033", null, ne, Q), ce(se, "src", Ue), ce(se, "alt", Be), V(Me, Ae), V(ze, `${t(u).points ?? ""}
307
- ${De ?? ""}`), j.disabled = je, V(Pe, Ve);
308
- },
309
- [
310
- () => ({
311
- "loyalty-shop__item--unavailable": !J(t(u))
312
- }),
313
- () => be(t(u)),
314
- () => F(t(u)),
315
- () => F(t(u)),
316
- () => o()("tokens"),
317
- () => !J(t(u)) || t(O) === t(u).id,
318
- () => o()("buyNow")
319
- ]
320
- ), $("click", T, () => te(t(u))), $("keydown", T, function(...Q) {
321
- t(Te)?.apply(this, Q);
322
- }), $("click", j, () => _e(t(u))), x(m, C);
323
- }), b(a);
324
- var d = z(a, 2);
325
- {
326
- var I = (m) => {
327
- ot(m, {
328
- get offset() {
329
- return t(k);
330
- },
331
- get limit() {
332
- return t(S);
333
- },
334
- get total() {
335
- return t(U);
336
- },
337
- onPageChange: xe,
338
- get locale() {
339
- return y();
340
- }
341
- });
342
- };
343
- X(d, (m) => {
344
- t(w) || m(I);
345
- });
346
- }
347
- var D = z(d, 2);
288
+ }, Ue = (e) => {
289
+ var a = he(), i = se(a);
348
290
  {
349
- var Y = (m) => {
350
- var u = ht();
351
- it(u, (C) => r(B, C), () => t(B)), x(m, u);
291
+ var f = (w) => {
292
+ var L = kt();
293
+ ve(L, 21, () => Array(t(R)), dt, (ee, re, ie, S) => {
294
+ var x = bt();
295
+ _(ee, x);
296
+ }), b(L), _(w, L);
297
+ }, P = (w) => {
298
+ var L = he(), ee = se(L);
299
+ {
300
+ var re = (S) => {
301
+ var x = wt(), U = I(x, !0);
302
+ b(x), ye((J) => Z(U, J), [Le]), _(S, x);
303
+ }, ie = (S) => {
304
+ var x = qt(), U = se(x);
305
+ ve(U, 21, () => t(m), (p) => p.id, (p, d) => {
306
+ var N = xt();
307
+ let de;
308
+ var B = I(N);
309
+ B.__click = () => le(t(d));
310
+ var Ve = ge(() => Me(t(d)));
311
+ B.__keydown = function(...ae) {
312
+ t(Ve)?.apply(this, ae);
313
+ };
314
+ var ue = I(B);
315
+ b(B);
316
+ var te = j(B, 2), He = I(te, !0);
317
+ b(te);
318
+ var ne = j(te, 2), Ke = I(ne);
319
+ b(ne);
320
+ var W = j(ne, 2);
321
+ W.__click = () => Ce(t(d));
322
+ var Fe = I(W, !0);
323
+ b(W), b(N), ye(
324
+ (ae, Je, We, Ze, Ge, Ye, Qe) => {
325
+ de = ut(N, 1, "loyalty-shop__item svelte-1f1q033", null, de, ae), _e(ue, "src", Je), _e(ue, "alt", We), Z(He, Ze), Z(Ke, `${t(d).points ?? ""}
326
+ ${Ge ?? ""}`), W.disabled = Ye, Z(Fe, Qe);
327
+ },
328
+ [
329
+ () => ({
330
+ "loyalty-shop__item--unavailable": !X(t(d))
331
+ }),
332
+ () => Ie(t(d)),
333
+ () => Q(t(d)),
334
+ () => Q(t(d)),
335
+ () => s()("tokens"),
336
+ () => !X(t(d)) || t(z) === t(d).id,
337
+ () => s()("buyNow")
338
+ ]
339
+ ), _(p, N);
340
+ }), b(U);
341
+ var J = j(U, 2);
342
+ {
343
+ var Ae = (p) => {
344
+ gt(p, {
345
+ get offset() {
346
+ return t(E);
347
+ },
348
+ get limit() {
349
+ return t(R);
350
+ },
351
+ get total() {
352
+ return t(H);
353
+ },
354
+ onPageChange: Ne,
355
+ get locale() {
356
+ return y();
357
+ }
358
+ });
359
+ };
360
+ D(J, (p) => {
361
+ t(q) || p(Ae);
362
+ });
363
+ }
364
+ var De = j(J, 2);
365
+ {
366
+ var je = (p) => {
367
+ var d = Et();
368
+ ht(d, (N) => l(K, N), () => t(K)), _(p, d);
369
+ };
370
+ D(De, (p) => {
371
+ t(q) && t(m).length < t(H) && p(je);
372
+ });
373
+ }
374
+ _(S, x);
375
+ };
376
+ D(
377
+ ee,
378
+ (S) => {
379
+ !t(m).length || t(Y) ? S(re) : S(ie, !1);
380
+ },
381
+ !0
382
+ );
383
+ }
384
+ _(w, L);
352
385
  };
353
- X(D, (m) => {
354
- t(w) && t(g).length < t(U) && m(Y);
355
- });
386
+ D(
387
+ i,
388
+ (w) => {
389
+ t(G) && t(m).length === 0 ? w(f) : w(P, !1);
390
+ },
391
+ !0
392
+ );
356
393
  }
357
- x(e, s);
394
+ _(e, a);
358
395
  };
359
- X(Ie, (e) => {
360
- t(N) ? e(Ce) : t(K) && t(g).length === 0 ? e(Re, 1) : !t(g).length || t(H) ? e(Le, 2) : e(Ne, -1);
396
+ D(ze, (e) => {
397
+ t(O) ? e(Pe) : e(Ue, !1);
361
398
  });
362
399
  }
363
- b(W), x(_, W);
364
- var Oe = ge(Se);
365
- return L(), Oe;
400
+ b($), _(k, $);
401
+ var Be = we(Oe);
402
+ return M(), Be;
366
403
  }
367
- Ke(["click", "keydown"]);
368
- pe(
369
- fe,
404
+ Xe(["click", "keydown"]);
405
+ be(
406
+ xe,
370
407
  {
371
408
  apiEndpoint: {},
372
409
  userSession: {},
@@ -376,63 +413,63 @@ pe(
376
413
  },
377
414
  [],
378
415
  [],
379
- { mode: "open" }
416
+ !0
380
417
  );
381
- function he(_, n) {
382
- me(n, !0);
383
- let o = h(n, "apiEndpoint", 7, ""), i = h(n, "userSession", 7, ""), L = h(n, "locale", 7, ""), c = h(n, "limitItem", 7, R), p = h(n, "translationUrl");
418
+ function Ee(k, n) {
419
+ ke(n, !0);
420
+ let s = h(n, "apiEndpoint", 7, ""), o = h(n, "userSession", 7, ""), M = h(n, "locale", 7, ""), u = h(n, "limitItem", 7, T), c = h(n, "translationUrl");
384
421
  var y = {
385
422
  get apiEndpoint() {
386
- return o();
423
+ return s();
387
424
  },
388
- set apiEndpoint(l = "") {
389
- o(l), v();
425
+ set apiEndpoint(r = "") {
426
+ s(r), v();
390
427
  },
391
428
  get userSession() {
392
- return i();
429
+ return o();
393
430
  },
394
- set userSession(l = "") {
395
- i(l), v();
431
+ set userSession(r = "") {
432
+ o(r), v();
396
433
  },
397
434
  get locale() {
398
- return L();
435
+ return M();
399
436
  },
400
- set locale(l = "") {
401
- L(l), v();
437
+ set locale(r = "") {
438
+ M(r), v();
402
439
  },
403
440
  get limitItem() {
404
- return c();
441
+ return u();
405
442
  },
406
- set limitItem(l = R) {
407
- c(l), v();
443
+ set limitItem(r = T) {
444
+ u(r), v();
408
445
  },
409
446
  get translationUrl() {
410
- return p();
447
+ return c();
411
448
  },
412
- set translationUrl(l) {
413
- p(l), v();
449
+ set translationUrl(r) {
450
+ c(r), v();
414
451
  }
415
452
  };
416
- return fe(_, {
453
+ return xe(k, {
417
454
  get apiEndpoint() {
418
- return o();
455
+ return s();
419
456
  },
420
457
  get userSession() {
421
- return i();
458
+ return o();
422
459
  },
423
460
  get locale() {
424
- return L();
461
+ return M();
425
462
  },
426
463
  get limitItem() {
427
- return c();
464
+ return u();
428
465
  },
429
466
  get translationUrl() {
430
- return p();
467
+ return c();
431
468
  }
432
- }), ge(y);
469
+ }), we(y);
433
470
  }
434
- customElements.define("loyalty-shop", pe(
435
- he,
471
+ customElements.define("loyalty-shop", be(
472
+ Ee,
436
473
  {
437
474
  apiEndpoint: {},
438
475
  userSession: {},
@@ -441,13 +478,14 @@ customElements.define("loyalty-shop", pe(
441
478
  translationUrl: {}
442
479
  },
443
480
  [],
444
- []
481
+ [],
482
+ !1
445
483
  ));
446
- const wt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
484
+ const Lt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
447
485
  __proto__: null,
448
- default: he
486
+ default: Ee
449
487
  }, Symbol.toStringTag, { value: "Module" }));
450
488
  export {
451
- fe as L,
452
- wt as a
489
+ xe as L,
490
+ Lt as a
453
491
  };