@everymatrix/loyalty-shop 0.2.0 → 0.2.2
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-B2XwqERr.cjs +14 -0
- package/components/LoyaltyPagination-B8amLojn.cjs +14 -0
- package/components/{LoyaltyPagination-CvGlrsHL.js → LoyaltyPagination-BqHc2i2H.js} +2841 -2576
- package/components/LoyaltyPagination-DOu-qNFO.js +7260 -0
- package/components/LoyaltyPointsCard-BjF9SVWO.js +249 -0
- package/components/LoyaltyPointsCard-C2Xj_0zZ.cjs +18 -0
- package/components/{LoyaltyPointsCard-4xMK1Yj3.js → LoyaltyPointsCard-DKq6yH_i.js} +60 -59
- package/components/LoyaltyPointsCard-DO9GoE9Q.cjs +18 -0
- package/components/{LoyaltyShop-BolB3kh1.js → LoyaltyShop-CBH93UYT.js} +168 -169
- package/components/LoyaltyShop-CCeVtHJ7.cjs +27 -0
- package/components/LoyaltyShop-CnX4zXMd.cjs +27 -0
- package/components/LoyaltyShop-aSar2Vkc.js +478 -0
- package/components/LoyaltyShopItem-BvxV4bEm.cjs +5 -0
- package/components/LoyaltyShopItem-CYoPPSZj.cjs +5 -0
- package/components/{LoyaltyShopItem-BF51hsPa.js → LoyaltyShopItem-DL7R43c_.js} +115 -109
- package/components/LoyaltyShopItem-bzNnPlQa.js +353 -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 +10 -4
- package/components/LoyaltyPagination-BfDVbl1b.js +0 -138
- package/components/LoyaltyPagination-BqAUwwMS.cjs +0 -16
- package/components/LoyaltyPagination-Ct4i2m7L.cjs +0 -12
- package/components/LoyaltyPagination-UwvULUW0.js +0 -137
- package/components/LoyaltyPointsCard-Cqwkhg0M.cjs +0 -18
- package/components/LoyaltyShop-B-D5synj.js +0 -6724
- package/components/LoyaltyShop-CIrwO8kv.cjs +0 -31
- package/components/LoyaltyShop-ChhuDPwH.js +0 -6624
- package/components/LoyaltyShop-DLj15-su.cjs +0 -27
- package/components/LoyaltyShopItem-lB3kVETK.cjs +0 -5
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { L as
|
|
1
|
+
import { z as me, c as G, p as K, a as ve, b as o, s as fe, d as Z, A as N, B as he, C as ye, E as J, F as g, G as ge, H as _e, m as t, f as we, g as be, i as T, h as E, j as W, I as xe, J as Ee, K as Re, L as ke, k as i, l as Se, n as L, q as b, o as R, r as C, t as U, v as k, M as Ie, w as M, u as S, x as Ne, $ as Te, N as Le, O as q } from "./LoyaltyPagination-BqHc2i2H.js";
|
|
2
|
+
import { L as Ce } from "./LoyaltyPointsCard-DKq6yH_i.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
|
|
9
|
+
let f = function(a) {
|
|
5
10
|
return function(...l) {
|
|
6
11
|
try {
|
|
7
|
-
return
|
|
12
|
+
return a.apply(this, l);
|
|
8
13
|
} catch (d) {
|
|
9
14
|
if (d instanceof DOMException && d.message.includes("has already been used with this registry") || d instanceof Error && d.message.includes("Cannot define multiple custom elements with the same tag name"))
|
|
10
15
|
return !1;
|
|
@@ -12,14 +17,14 @@ if (typeof window < "u") {
|
|
|
12
17
|
}
|
|
13
18
|
};
|
|
14
19
|
};
|
|
15
|
-
customElements.define =
|
|
16
|
-
const l =
|
|
20
|
+
customElements.define = f(customElements.define), import("./LoyaltyPointsCard-DKq6yH_i.js").then((a) => a.a).then((a) => {
|
|
21
|
+
const l = a.default || a;
|
|
17
22
|
customElements.get("loyalty-points-card") || customElements.define("loyalty-points-card", l.element || l);
|
|
18
|
-
}).catch((
|
|
19
|
-
console.error("BOOT ERROR:",
|
|
23
|
+
}).catch((a) => {
|
|
24
|
+
console.error("BOOT ERROR:", a);
|
|
20
25
|
});
|
|
21
26
|
}
|
|
22
|
-
const
|
|
27
|
+
const Ue = {
|
|
23
28
|
en: {
|
|
24
29
|
tokens: "Tokens",
|
|
25
30
|
buyNow: "Buy Now",
|
|
@@ -55,68 +60,73 @@ const Te = {
|
|
|
55
60
|
buyNow: "Vásárlás",
|
|
56
61
|
back: "Vissza"
|
|
57
62
|
}
|
|
58
|
-
},
|
|
59
|
-
var Oe = M('<img class="loyalty-shop-item__image svelte-ravnpu"/>'),
|
|
60
|
-
const
|
|
63
|
+
}, Me = "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";
|
|
64
|
+
var Oe = M('<img class="loyalty-shop-item__image svelte-ravnpu"/>'), ze = M('<div class="loyalty-shop-item__card loyalty-shop-item__card--description svelte-ravnpu"><p class="loyalty-shop-item__description svelte-ravnpu"> </p></div>'), je = M('<div class="loyalty-shop-item svelte-ravnpu"><div class="loyalty-shop-item__card svelte-ravnpu"><!> <span class="loyalty-shop-item__title svelte-ravnpu"> </span> <span class="loyalty-shop-item__points svelte-ravnpu"> </span> <button class="loyalty-shop-item__button svelte-ravnpu" type="button"> </button></div> <!> <!></div>');
|
|
65
|
+
const Ve = {
|
|
61
66
|
hash: "svelte-ravnpu",
|
|
62
67
|
code: `.loyalty-shop-item.svelte-ravnpu {display:flex;flex-direction:column;gap:12px;}.loyalty-shop-item__card.svelte-ravnpu {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-default, #022652);}.loyalty-shop-item__card--description.svelte-ravnpu {min-height:120px;}.loyalty-shop-item__image.svelte-ravnpu {width:100%;height:170px;border-radius:6px;}.loyalty-shop-item__title.svelte-ravnpu {color:var(--text-default, #ffffff);font-size:12px;font-weight:400;}.loyalty-shop-item__points.svelte-ravnpu {color:var(--text-subtle, #dfe3e8);font-size:14px;font-weight:400;}.loyalty-shop-item__button.svelte-ravnpu {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-ravnpu:disabled {opacity:0.4;cursor:default;}.loyalty-shop-item__description.svelte-ravnpu {color:var(--text-subtle, #dfe3e8);font-size:12px;line-height:1.4;margin:0;font-weight:500;min-height:120px;}
|
|
63
68
|
|
|
64
69
|
@media (min-width: 768px) {.loyalty-shop-item__image.svelte-ravnpu {height:clamp(170px, 30vw, 400px);object-fit:cover;}
|
|
65
70
|
}`
|
|
66
71
|
};
|
|
67
|
-
function Y(
|
|
68
|
-
K(
|
|
69
|
-
const l = () =>
|
|
70
|
-
|
|
72
|
+
function Y(f, a) {
|
|
73
|
+
K(a, !0), ve(f, Ve);
|
|
74
|
+
const l = () => Ne(Te, "$_", d), [d, _] = Se(), u = o(a, "apiEndpoint", 7, ""), c = o(a, "userSession", 7, ""), p = o(a, "locale", 7, ""), h = o(a, "itemId", 7, ""), n = o(a, "elevateReward"), x = o(a, "translationUrl");
|
|
75
|
+
fe({ withLocale: p(), translations: {} }), Object.entries(Ue).forEach(([e, s]) => {
|
|
71
76
|
Z(e, s);
|
|
72
77
|
});
|
|
73
|
-
let
|
|
74
|
-
const
|
|
75
|
-
let e = new URL(
|
|
78
|
+
let r = N(he(n())), w = N(!1), O = N("");
|
|
79
|
+
const z = S(() => t(r)?.presentation?.assets?.[0] ?? ""), j = S(() => t(r)?.presentation?.displayName ?? t(r)?.displayName ?? ""), V = S(() => t(r)?.presentation?.description ?? ""), A = S(() => t(r)?.available === "true"), X = () => {
|
|
80
|
+
let e = new URL(x(), window.location.href);
|
|
76
81
|
fetch(e.href).then((s) => s.json()).then((s) => {
|
|
77
|
-
Object.keys(s).forEach((
|
|
78
|
-
Z(
|
|
82
|
+
Object.keys(s).forEach((y) => {
|
|
83
|
+
Z(y, s[y]);
|
|
79
84
|
});
|
|
80
85
|
}).catch((s) => {
|
|
81
86
|
console.log("loyalty shop item translation url err:", s);
|
|
82
87
|
});
|
|
83
88
|
};
|
|
84
|
-
|
|
85
|
-
|
|
89
|
+
ye(() => {
|
|
90
|
+
x() && X();
|
|
86
91
|
}), J(() => {
|
|
87
|
-
if (
|
|
88
|
-
|
|
92
|
+
if (n()) {
|
|
93
|
+
g(r, n(), !0);
|
|
89
94
|
return;
|
|
90
95
|
}
|
|
91
|
-
!u() || !
|
|
96
|
+
if (!u() || !h())
|
|
97
|
+
return;
|
|
98
|
+
let e = !1;
|
|
99
|
+
return ge(
|
|
92
100
|
{
|
|
93
101
|
apiEndpoint: u(),
|
|
94
|
-
userSession:
|
|
95
|
-
locale:
|
|
102
|
+
userSession: c(),
|
|
103
|
+
locale: p()
|
|
96
104
|
},
|
|
97
|
-
|
|
98
|
-
).then((
|
|
99
|
-
|
|
100
|
-
}).catch((
|
|
105
|
+
h()
|
|
106
|
+
).then((s) => {
|
|
107
|
+
e || g(r, s, !0);
|
|
108
|
+
}).catch((s) => console.error("Failed to load shop item:", s)), () => {
|
|
109
|
+
e = !0;
|
|
110
|
+
};
|
|
101
111
|
});
|
|
102
112
|
const $ = () => {
|
|
103
|
-
|
|
113
|
+
t(w) || !t(A) || !t(r) || Le(t(r).displayName || t(r).presentation.displayName, t(r).id);
|
|
104
114
|
}, ee = async () => {
|
|
105
|
-
if (!u() || !
|
|
115
|
+
if (!u() || !t(r) || t(w))
|
|
106
116
|
return;
|
|
107
|
-
w
|
|
108
|
-
const e =
|
|
117
|
+
g(w, !0), g(O, "");
|
|
118
|
+
const e = t(r).id;
|
|
109
119
|
try {
|
|
110
|
-
await
|
|
120
|
+
await xe({ apiEndpoint: u(), userSession: c() }, e), Ee(e), Re();
|
|
111
121
|
} catch (s) {
|
|
112
|
-
|
|
122
|
+
g(O, s?.message ?? "Redeem failed", !0), ke(e, s);
|
|
113
123
|
} finally {
|
|
114
|
-
w
|
|
124
|
+
g(w, !1);
|
|
115
125
|
}
|
|
116
126
|
};
|
|
117
127
|
J(() => {
|
|
118
128
|
const e = (s) => {
|
|
119
|
-
s.data?.type ===
|
|
129
|
+
s.data?.type === _e.REDEEM_REWARD_CONFIRMED && s.data?.id === t(r)?.id && ee();
|
|
120
130
|
};
|
|
121
131
|
return window.addEventListener("message", e), () => window.removeEventListener("message", e);
|
|
122
132
|
});
|
|
@@ -128,95 +138,91 @@ function Y(y, t) {
|
|
|
128
138
|
u(e), i();
|
|
129
139
|
},
|
|
130
140
|
get userSession() {
|
|
131
|
-
return
|
|
141
|
+
return c();
|
|
132
142
|
},
|
|
133
143
|
set userSession(e = "") {
|
|
134
|
-
|
|
144
|
+
c(e), i();
|
|
135
145
|
},
|
|
136
146
|
get locale() {
|
|
137
|
-
return
|
|
147
|
+
return p();
|
|
138
148
|
},
|
|
139
149
|
set locale(e = "") {
|
|
140
|
-
|
|
150
|
+
p(e), i();
|
|
141
151
|
},
|
|
142
152
|
get itemId() {
|
|
143
|
-
return
|
|
153
|
+
return h();
|
|
144
154
|
},
|
|
145
155
|
set itemId(e = "") {
|
|
146
|
-
|
|
156
|
+
h(e), i();
|
|
147
157
|
},
|
|
148
158
|
get elevateReward() {
|
|
149
|
-
return
|
|
159
|
+
return n();
|
|
150
160
|
},
|
|
151
161
|
set elevateReward(e) {
|
|
152
|
-
|
|
162
|
+
n(e), i();
|
|
153
163
|
},
|
|
154
164
|
get translationUrl() {
|
|
155
|
-
return
|
|
165
|
+
return x();
|
|
156
166
|
},
|
|
157
167
|
set translationUrl(e) {
|
|
158
|
-
|
|
168
|
+
x(e), i();
|
|
159
169
|
}
|
|
160
|
-
},
|
|
170
|
+
}, B = we(), ae = be(B);
|
|
161
171
|
{
|
|
162
172
|
var se = (e) => {
|
|
163
|
-
var s =
|
|
173
|
+
var s = je(), y = L(s), D = L(y);
|
|
164
174
|
{
|
|
165
|
-
var
|
|
175
|
+
var re = (m) => {
|
|
166
176
|
var v = Oe();
|
|
167
|
-
|
|
168
|
-
q(v, "src",
|
|
169
|
-
}),
|
|
177
|
+
U(() => {
|
|
178
|
+
q(v, "src", t(z) || Me), q(v, "alt", t(j));
|
|
179
|
+
}), E(m, v);
|
|
170
180
|
};
|
|
171
|
-
|
|
172
|
-
|
|
181
|
+
T(D, (m) => {
|
|
182
|
+
t(z) && m(re);
|
|
173
183
|
});
|
|
174
184
|
}
|
|
175
|
-
var
|
|
176
|
-
|
|
177
|
-
var
|
|
178
|
-
|
|
179
|
-
var k = x(L, 2), le = f(k, !0);
|
|
180
|
-
h(k), h(_);
|
|
181
|
-
var H = x(_, 2);
|
|
182
|
-
Le(H, {
|
|
185
|
+
var H = b(D, 2), oe = R(H, !0), F = b(H, 2), ie = R(F), I = b(F, 2), le = R(I, !0);
|
|
186
|
+
C(y);
|
|
187
|
+
var P = b(y, 2);
|
|
188
|
+
Ce(P, {
|
|
183
189
|
get apiEndpoint() {
|
|
184
190
|
return u();
|
|
185
191
|
},
|
|
186
192
|
get userSession() {
|
|
187
|
-
return
|
|
193
|
+
return c();
|
|
188
194
|
},
|
|
189
195
|
get locale() {
|
|
190
|
-
return
|
|
196
|
+
return p();
|
|
191
197
|
}
|
|
192
198
|
});
|
|
193
|
-
var de =
|
|
199
|
+
var de = b(P, 2);
|
|
194
200
|
{
|
|
195
201
|
var ue = (m) => {
|
|
196
|
-
var v =
|
|
197
|
-
|
|
202
|
+
var v = ze(), ce = L(v), pe = R(ce, !0);
|
|
203
|
+
C(v), U(() => k(pe, t(V))), E(m, v);
|
|
198
204
|
};
|
|
199
|
-
|
|
200
|
-
|
|
205
|
+
T(de, (m) => {
|
|
206
|
+
t(V) && m(ue);
|
|
201
207
|
});
|
|
202
208
|
}
|
|
203
|
-
|
|
209
|
+
C(s), U(
|
|
204
210
|
(m, v) => {
|
|
205
|
-
|
|
206
|
-
${m ?? ""}`),
|
|
211
|
+
k(oe, t(j)), k(ie, `${t(r).points ?? ""}
|
|
212
|
+
${m ?? ""}`), I.disabled = !t(A) || t(w), k(le, v);
|
|
207
213
|
},
|
|
208
214
|
[() => l()("tokens"), () => l()("buyNow")]
|
|
209
|
-
),
|
|
215
|
+
), Ie("click", I, $), E(e, s);
|
|
210
216
|
};
|
|
211
|
-
|
|
212
|
-
|
|
217
|
+
T(ae, (e) => {
|
|
218
|
+
t(r) && e(se);
|
|
213
219
|
});
|
|
214
220
|
}
|
|
215
|
-
|
|
216
|
-
var
|
|
217
|
-
return
|
|
221
|
+
E(f, B);
|
|
222
|
+
var ne = W(te);
|
|
223
|
+
return _(), ne;
|
|
218
224
|
}
|
|
219
|
-
|
|
225
|
+
me(["click"]);
|
|
220
226
|
G(
|
|
221
227
|
Y,
|
|
222
228
|
{
|
|
@@ -231,48 +237,48 @@ G(
|
|
|
231
237
|
[],
|
|
232
238
|
{ mode: "open" }
|
|
233
239
|
);
|
|
234
|
-
function Q(
|
|
235
|
-
K(
|
|
236
|
-
let l = o(
|
|
237
|
-
var
|
|
240
|
+
function Q(f, a) {
|
|
241
|
+
K(a, !0);
|
|
242
|
+
let l = o(a, "apiEndpoint", 7, ""), d = o(a, "userSession", 7, ""), _ = o(a, "locale", 7, ""), u = o(a, "itemId", 7, ""), c = o(a, "elevateReward"), p = o(a, "translationUrl");
|
|
243
|
+
var h = {
|
|
238
244
|
get apiEndpoint() {
|
|
239
245
|
return l();
|
|
240
246
|
},
|
|
241
|
-
set apiEndpoint(
|
|
242
|
-
l(
|
|
247
|
+
set apiEndpoint(n = "") {
|
|
248
|
+
l(n), i();
|
|
243
249
|
},
|
|
244
250
|
get userSession() {
|
|
245
251
|
return d();
|
|
246
252
|
},
|
|
247
|
-
set userSession(
|
|
248
|
-
d(
|
|
253
|
+
set userSession(n = "") {
|
|
254
|
+
d(n), i();
|
|
249
255
|
},
|
|
250
256
|
get locale() {
|
|
251
|
-
return
|
|
257
|
+
return _();
|
|
252
258
|
},
|
|
253
|
-
set locale(
|
|
254
|
-
|
|
259
|
+
set locale(n = "") {
|
|
260
|
+
_(n), i();
|
|
255
261
|
},
|
|
256
262
|
get itemId() {
|
|
257
263
|
return u();
|
|
258
264
|
},
|
|
259
|
-
set itemId(
|
|
260
|
-
u(
|
|
265
|
+
set itemId(n = "") {
|
|
266
|
+
u(n), i();
|
|
261
267
|
},
|
|
262
268
|
get elevateReward() {
|
|
263
|
-
return
|
|
269
|
+
return c();
|
|
264
270
|
},
|
|
265
|
-
set elevateReward(
|
|
266
|
-
|
|
271
|
+
set elevateReward(n) {
|
|
272
|
+
c(n), i();
|
|
267
273
|
},
|
|
268
274
|
get translationUrl() {
|
|
269
|
-
return
|
|
275
|
+
return p();
|
|
270
276
|
},
|
|
271
|
-
set translationUrl(
|
|
272
|
-
|
|
277
|
+
set translationUrl(n) {
|
|
278
|
+
p(n), i();
|
|
273
279
|
}
|
|
274
280
|
};
|
|
275
|
-
return Y(
|
|
281
|
+
return Y(f, {
|
|
276
282
|
get apiEndpoint() {
|
|
277
283
|
return l();
|
|
278
284
|
},
|
|
@@ -280,18 +286,18 @@ function Q(y, t) {
|
|
|
280
286
|
return d();
|
|
281
287
|
},
|
|
282
288
|
get locale() {
|
|
283
|
-
return
|
|
289
|
+
return _();
|
|
284
290
|
},
|
|
285
291
|
get itemId() {
|
|
286
292
|
return u();
|
|
287
293
|
},
|
|
288
294
|
get elevateReward() {
|
|
289
|
-
return
|
|
295
|
+
return c();
|
|
290
296
|
},
|
|
291
297
|
get translationUrl() {
|
|
292
|
-
return
|
|
298
|
+
return p();
|
|
293
299
|
}
|
|
294
|
-
}), W(
|
|
300
|
+
}), W(h);
|
|
295
301
|
}
|
|
296
302
|
customElements.define("loyalty-shop-item", G(
|
|
297
303
|
Q,
|
|
@@ -306,11 +312,11 @@ customElements.define("loyalty-shop-item", G(
|
|
|
306
312
|
[],
|
|
307
313
|
[]
|
|
308
314
|
));
|
|
309
|
-
const
|
|
315
|
+
const De = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
310
316
|
__proto__: null,
|
|
311
317
|
default: Q
|
|
312
318
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
313
319
|
export {
|
|
314
320
|
Y as L,
|
|
315
|
-
|
|
321
|
+
De as a
|
|
316
322
|
};
|