@everymatrix/loyalty-shop 0.1.22 → 0.1.24
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-BISbknCY.cjs +14 -0
- package/components/{LoyaltyPagination-o3rQCgms.js → LoyaltyPagination-BZk1S01e.js} +1493 -1467
- package/components/{LoyaltyPagination-D7m97E0W.js → LoyaltyPagination-CfB2kCYx.js} +819 -793
- package/components/LoyaltyPagination-n22faI_k.cjs +14 -0
- package/components/{LoyaltyPointsCard-5kjF6xRz.cjs → LoyaltyPointsCard-Bk2oWu8Y.cjs} +1 -1
- package/components/{LoyaltyPointsCard-46BqNZEK.cjs → LoyaltyPointsCard-C4TY5Odb.cjs} +1 -1
- package/components/{LoyaltyPointsCard-SZEIZzo0.js → LoyaltyPointsCard-DgrWMn_V.js} +1 -1
- package/components/{LoyaltyPointsCard-CdBEe40I.js → LoyaltyPointsCard-jP0P8jiI.js} +1 -1
- package/components/{LoyaltyShop-DGLy6Hu5.cjs → LoyaltyShop-9D4_2iLM.cjs} +3 -3
- package/components/{LoyaltyShop-B2lSw5jy.cjs → LoyaltyShop-BYXBV-P0.cjs} +3 -3
- package/components/{LoyaltyShop-DGAZjo_P.js → LoyaltyShop-CUN0MKDN.js} +29 -27
- package/components/{LoyaltyShop-_bWN39Rn.js → LoyaltyShop-D-Gsl4ZM.js} +38 -36
- package/components/{LoyaltyShopItem-DpFV9qnk.cjs → LoyaltyShopItem-CC3RrQxC.cjs} +3 -3
- package/components/{LoyaltyShopItem-CtZFkxzA.js → LoyaltyShopItem-DF8vUi7m.js} +45 -40
- package/components/{LoyaltyShopItem-PkfmBV5A.cjs → LoyaltyShopItem-WgDbYlQa.cjs} +3 -3
- package/components/{LoyaltyShopItem-DxwkafBG.js → LoyaltyShopItem-bTc7oBXE.js} +26 -21
- package/es2015/loyalty-shop.cjs +1 -1
- package/es2015/loyalty-shop.js +2 -2
- package/esnext/loyalty-shop.cjs +1 -1
- package/esnext/loyalty-shop.js +2 -2
- package/package.json +1 -1
- package/components/LoyaltyPagination-ChnSUs6d.cjs +0 -14
- package/components/LoyaltyPagination-DzmuO9_8.cjs +0 -14
|
@@ -1,15 +1,15 @@
|
|
|
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
|
|
2
|
-
import { L as Ce } from "./LoyaltyPointsCard-
|
|
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-CfB2kCYx.js";
|
|
2
|
+
import { L as Ce } from "./LoyaltyPointsCard-DgrWMn_V.js";
|
|
3
3
|
typeof globalThis.HTMLElement > "u" && (globalThis.HTMLElement = class {
|
|
4
4
|
}, globalThis.customElements = { define() {
|
|
5
5
|
}, get() {
|
|
6
6
|
}, whenDefined() {
|
|
7
7
|
} });
|
|
8
8
|
if (typeof window < "u") {
|
|
9
|
-
let f = function(
|
|
9
|
+
let f = function(a) {
|
|
10
10
|
return function(...l) {
|
|
11
11
|
try {
|
|
12
|
-
return
|
|
12
|
+
return a.apply(this, l);
|
|
13
13
|
} catch (d) {
|
|
14
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"))
|
|
15
15
|
return !1;
|
|
@@ -17,11 +17,11 @@ if (typeof window < "u") {
|
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
|
-
customElements.define = f(customElements.define), import("./LoyaltyPointsCard-
|
|
21
|
-
const l =
|
|
20
|
+
customElements.define = f(customElements.define), import("./LoyaltyPointsCard-DgrWMn_V.js").then((a) => a.a).then((a) => {
|
|
21
|
+
const l = a.default || a;
|
|
22
22
|
customElements.get("loyalty-points-card") || customElements.define("loyalty-points-card", l.element || l);
|
|
23
|
-
}).catch((
|
|
24
|
-
console.error("BOOT ERROR:",
|
|
23
|
+
}).catch((a) => {
|
|
24
|
+
console.error("BOOT ERROR:", a);
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
const Ue = {
|
|
@@ -69,15 +69,15 @@ const Ve = {
|
|
|
69
69
|
@media (min-width: 768px) {.loyalty-shop-item__image.svelte-ravnpu {height:clamp(170px, 30vw, 400px);object-fit:cover;}
|
|
70
70
|
}`
|
|
71
71
|
};
|
|
72
|
-
function Y(f,
|
|
73
|
-
K(
|
|
74
|
-
const l = () => Ne(Te, "$_", d), [d, _] = Se(), u = o(
|
|
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
75
|
fe({ withLocale: p(), translations: {} }), Object.entries(Ue).forEach(([e, s]) => {
|
|
76
76
|
Z(e, s);
|
|
77
77
|
});
|
|
78
|
-
let r = N(he(n())),
|
|
79
|
-
const z = S(() =>
|
|
80
|
-
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);
|
|
81
81
|
fetch(e.href).then((s) => s.json()).then((s) => {
|
|
82
82
|
Object.keys(s).forEach((y) => {
|
|
83
83
|
Z(y, s[y]);
|
|
@@ -87,41 +87,46 @@ function Y(f, t) {
|
|
|
87
87
|
});
|
|
88
88
|
};
|
|
89
89
|
ye(() => {
|
|
90
|
-
|
|
90
|
+
x() && X();
|
|
91
91
|
}), J(() => {
|
|
92
92
|
if (n()) {
|
|
93
93
|
g(r, n(), !0);
|
|
94
94
|
return;
|
|
95
95
|
}
|
|
96
|
-
!u() || !h()
|
|
96
|
+
if (!u() || !h())
|
|
97
|
+
return;
|
|
98
|
+
let e = !1;
|
|
99
|
+
return ge(
|
|
97
100
|
{
|
|
98
101
|
apiEndpoint: u(),
|
|
99
102
|
userSession: c(),
|
|
100
103
|
locale: p()
|
|
101
104
|
},
|
|
102
105
|
h()
|
|
103
|
-
).then((
|
|
104
|
-
g(r,
|
|
105
|
-
}).catch((
|
|
106
|
+
).then((s) => {
|
|
107
|
+
e || g(r, s, !0);
|
|
108
|
+
}).catch((s) => console.error("Failed to load shop item:", s)), () => {
|
|
109
|
+
e = !0;
|
|
110
|
+
};
|
|
106
111
|
});
|
|
107
112
|
const $ = () => {
|
|
108
|
-
|
|
113
|
+
t(w) || !t(A) || !t(r) || Le(t(r).displayName || t(r).presentation.displayName, t(r).id);
|
|
109
114
|
}, ee = async () => {
|
|
110
|
-
if (!u() || !
|
|
115
|
+
if (!u() || !t(r) || t(w))
|
|
111
116
|
return;
|
|
112
|
-
g(
|
|
113
|
-
const e =
|
|
117
|
+
g(w, !0), g(O, "");
|
|
118
|
+
const e = t(r).id;
|
|
114
119
|
try {
|
|
115
120
|
await xe({ apiEndpoint: u(), userSession: c() }, e), Ee(e), Re();
|
|
116
121
|
} catch (s) {
|
|
117
122
|
g(O, s?.message ?? "Redeem failed", !0), ke(e, s);
|
|
118
123
|
} finally {
|
|
119
|
-
g(
|
|
124
|
+
g(w, !1);
|
|
120
125
|
}
|
|
121
126
|
};
|
|
122
127
|
J(() => {
|
|
123
128
|
const e = (s) => {
|
|
124
|
-
s.data?.type === _e.REDEEM_REWARD_CONFIRMED && s.data?.id ===
|
|
129
|
+
s.data?.type === _e.REDEEM_REWARD_CONFIRMED && s.data?.id === t(r)?.id && ee();
|
|
125
130
|
};
|
|
126
131
|
return window.addEventListener("message", e), () => window.removeEventListener("message", e);
|
|
127
132
|
});
|
|
@@ -157,10 +162,10 @@ function Y(f, t) {
|
|
|
157
162
|
n(e), i();
|
|
158
163
|
},
|
|
159
164
|
get translationUrl() {
|
|
160
|
-
return
|
|
165
|
+
return x();
|
|
161
166
|
},
|
|
162
167
|
set translationUrl(e) {
|
|
163
|
-
|
|
168
|
+
x(e), i();
|
|
164
169
|
}
|
|
165
170
|
}, B = we(), ae = be(B);
|
|
166
171
|
{
|
|
@@ -170,16 +175,16 @@ function Y(f, t) {
|
|
|
170
175
|
var re = (m) => {
|
|
171
176
|
var v = Oe();
|
|
172
177
|
U(() => {
|
|
173
|
-
q(v, "src",
|
|
178
|
+
q(v, "src", t(z) || Me), q(v, "alt", t(j));
|
|
174
179
|
}), E(m, v);
|
|
175
180
|
};
|
|
176
181
|
T(D, (m) => {
|
|
177
|
-
|
|
182
|
+
t(z) && m(re);
|
|
178
183
|
});
|
|
179
184
|
}
|
|
180
|
-
var 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);
|
|
181
186
|
C(y);
|
|
182
|
-
var P =
|
|
187
|
+
var P = b(y, 2);
|
|
183
188
|
Ce(P, {
|
|
184
189
|
get apiEndpoint() {
|
|
185
190
|
return u();
|
|
@@ -191,26 +196,26 @@ function Y(f, t) {
|
|
|
191
196
|
return p();
|
|
192
197
|
}
|
|
193
198
|
});
|
|
194
|
-
var de =
|
|
199
|
+
var de = b(P, 2);
|
|
195
200
|
{
|
|
196
201
|
var ue = (m) => {
|
|
197
202
|
var v = ze(), ce = L(v), pe = R(ce, !0);
|
|
198
|
-
C(v), U(() => k(pe,
|
|
203
|
+
C(v), U(() => k(pe, t(V))), E(m, v);
|
|
199
204
|
};
|
|
200
205
|
T(de, (m) => {
|
|
201
|
-
|
|
206
|
+
t(V) && m(ue);
|
|
202
207
|
});
|
|
203
208
|
}
|
|
204
209
|
C(s), U(
|
|
205
210
|
(m, v) => {
|
|
206
|
-
k(oe,
|
|
207
|
-
${m ?? ""}`), I.disabled = !
|
|
211
|
+
k(oe, t(j)), k(ie, `${t(r).points ?? ""}
|
|
212
|
+
${m ?? ""}`), I.disabled = !t(A) || t(w), k(le, v);
|
|
208
213
|
},
|
|
209
214
|
[() => l()("tokens"), () => l()("buyNow")]
|
|
210
215
|
), Ie("click", I, $), E(e, s);
|
|
211
216
|
};
|
|
212
217
|
T(ae, (e) => {
|
|
213
|
-
|
|
218
|
+
t(r) && e(se);
|
|
214
219
|
});
|
|
215
220
|
}
|
|
216
221
|
E(f, B);
|
|
@@ -232,9 +237,9 @@ G(
|
|
|
232
237
|
[],
|
|
233
238
|
{ mode: "open" }
|
|
234
239
|
);
|
|
235
|
-
function Q(f,
|
|
236
|
-
K(
|
|
237
|
-
let l = o(
|
|
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");
|
|
238
243
|
var h = {
|
|
239
244
|
get apiEndpoint() {
|
|
240
245
|
return l();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
typeof globalThis.HTMLElement>"u"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const e=require("./LoyaltyPagination-
|
|
1
|
+
typeof globalThis.HTMLElement>"u"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const e=require("./LoyaltyPagination-BISbknCY.cjs"),G=require("./LoyaltyPointsCard-C4TY5Odb.cjs");if(typeof window<"u"){let m=function(n){return function(...o){try{return n.apply(this,o)}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("./LoyaltyPointsCard-C4TY5Odb.cjs")).then(n=>n.LoyaltyPointsCard_ce).then(n=>{const o=n.default||n;customElements.get("loyalty-points-card")||customElements.define("loyalty-points-card",o.element||o)}).catch(n=>{console.error("BOOT ERROR:",n)})}const K={en:{tokens:"Tokens",buyNow:"Buy Now",back:"Back"},tr:{tokens:"Tokens",buyNow:"Şimdi Satın Al",back:"Geri"},da:{tokens:"Tokens",buyNow:"Køb nu",back:"Tilbage"},de:{tokens:"Token",buyNow:"Jetzt kaufen",back:"Zurück"},nl:{tokens:"Tokens",buyNow:"Nu kopen",back:"Terug"},fr:{tokens:"Jetons",buyNow:"Acheter",back:"Retour"},hu:{tokens:"Tokenek",buyNow:"Vásárlás",back:"Vissza"}},W="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 Y=e.from_html('<img class="loyalty-shop-item__image svelte-ravnpu"/>'),Q=e.from_html('<div class="loyalty-shop-item__card loyalty-shop-item__card--description svelte-ravnpu"><p class="loyalty-shop-item__description svelte-ravnpu"> </p></div>'),X=e.from_html('<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>');const $={hash:"svelte-ravnpu",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;}
|
|
2
2
|
|
|
3
3
|
@media (min-width: 768px) {.loyalty-shop-item__image.svelte-ravnpu {height:clamp(170px, 30vw, 400px);object-fit:cover;}
|
|
4
|
-
}`};function b(m,n){e.push(n,!0),e.append_styles(m,$);const o=()=>e.store_get(e.$format,"$_",l),[l,
|
|
5
|
-
${
|
|
4
|
+
}`};function b(m,n){e.push(n,!0),e.append_styles(m,$);const o=()=>e.store_get(e.$format,"$_",l),[l,y]=e.setup_stores(),i=e.prop(n,"apiEndpoint",7,""),d=e.prop(n,"userSession",7,""),c=e.prop(n,"locale",7,""),h=e.prop(n,"itemId",7,""),r=e.prop(n,"elevateReward"),v=e.prop(n,"translationUrl");e.setupI18n({withLocale:c(),translations:{}}),Object.entries(K).forEach(([t,a])=>{e.addNewMessages(t,a)});let s=e.state(e.proxy(r())),g=e.state(!1),w=e.state("");const x=e.user_derived(()=>e.get(s)?.presentation?.assets?.[0]??""),S=e.user_derived(()=>e.get(s)?.presentation?.displayName??e.get(s)?.displayName??""),E=e.user_derived(()=>e.get(s)?.presentation?.description??""),k=e.user_derived(()=>e.get(s)?.available==="true"),U=()=>{let t=new URL(v(),window.location.href);fetch(t.href).then(a=>a.json()).then(a=>{Object.keys(a).forEach(f=>{e.addNewMessages(f,a[f])})}).catch(a=>{console.log("loyalty shop item translation url err:",a)})};e.user_pre_effect(()=>{v()&&U()}),e.user_effect(()=>{if(r()){e.set(s,r(),!0);return}if(!i()||!h())return;let t=!1;return e.fetchShopItem({apiEndpoint:i(),userSession:d(),locale:c()},h()).then(a=>{t||e.set(s,a,!0)}).catch(a=>console.error("Failed to load shop item:",a)),()=>{t=!0}});const M=()=>{e.get(g)||!e.get(k)||!e.get(s)||e.sendRedeemRewardRequested(e.get(s).displayName||e.get(s).presentation.displayName,e.get(s).id)},O=async()=>{if(!i()||!e.get(s)||e.get(g))return;e.set(g,!0),e.set(w,"");const t=e.get(s).id;try{await e.redeemReward({apiEndpoint:i(),userSession:d()},t),e.sendRedeemRewardSuccess(t),e.dispatchRedeemRewardButton()}catch(a){e.set(w,a?.message??"Redeem failed",!0),e.sendRedeemRewardFailed(t,a)}finally{e.set(g,!1)}};e.user_effect(()=>{const t=a=>{a.data?.type===e.EVENT_TYPES.REDEEM_REWARD_CONFIRMED&&a.data?.id===e.get(s)?.id&&O()};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)});var P={get apiEndpoint(){return i()},set apiEndpoint(t=""){i(t),e.flushSync()},get userSession(){return d()},set userSession(t=""){d(t),e.flushSync()},get locale(){return c()},set locale(t=""){c(t),e.flushSync()},get itemId(){return h()},set itemId(t=""){h(t),e.flushSync()},get elevateReward(){return r()},set elevateReward(t){r(t),e.flushSync()},get translationUrl(){return v()},set translationUrl(t){v(t),e.flushSync()}},R=e.comment(),z=e.first_child(R);{var V=t=>{var a=X(),f=e.child(a),I=e.child(f);{var D=p=>{var u=Y();e.template_effect(()=>{e.set_attribute(u,"src",e.get(x)||W),e.set_attribute(u,"alt",e.get(S))}),e.append(p,u)};e.if_block(I,p=>{e.get(x)&&p(D)})}var N=e.sibling(I,2),A=e.only_child(N,!0),T=e.sibling(N,2),B=e.only_child(T),_=e.sibling(T,2),H=e.only_child(_,!0);e.reset(f);var L=e.sibling(f,2);G.LoyaltyPointsCard(L,{get apiEndpoint(){return i()},get userSession(){return d()},get locale(){return c()}});var q=e.sibling(L,2);{var Z=p=>{var u=Q(),F=e.child(u),J=e.only_child(F,!0);e.reset(u),e.template_effect(()=>e.set_text(J,e.get(E))),e.append(p,u)};e.if_block(q,p=>{e.get(E)&&p(Z)})}e.reset(a),e.template_effect((p,u)=>{e.set_text(A,e.get(S)),e.set_text(B,`${e.get(s).points??""}
|
|
5
|
+
${p??""}`),_.disabled=!e.get(k)||e.get(g),e.set_text(H,u)},[()=>o()("tokens"),()=>o()("buyNow")]),e.delegated("click",_,M),e.append(t,a)};e.if_block(z,t=>{e.get(s)&&t(V)})}e.append(m,R);var j=e.pop(P);return y(),j}e.delegate(["click"]);e.create_custom_element(b,{apiEndpoint:{},userSession:{},locale:{},itemId:{},elevateReward:{},translationUrl:{}},[],[],{mode:"open"});function C(m,n){e.push(n,!0);let o=e.prop(n,"apiEndpoint",7,""),l=e.prop(n,"userSession",7,""),y=e.prop(n,"locale",7,""),i=e.prop(n,"itemId",7,""),d=e.prop(n,"elevateReward"),c=e.prop(n,"translationUrl");var h={get apiEndpoint(){return o()},set apiEndpoint(r=""){o(r),e.flushSync()},get userSession(){return l()},set userSession(r=""){l(r),e.flushSync()},get locale(){return y()},set locale(r=""){y(r),e.flushSync()},get itemId(){return i()},set itemId(r=""){i(r),e.flushSync()},get elevateReward(){return d()},set elevateReward(r){d(r),e.flushSync()},get translationUrl(){return c()},set translationUrl(r){c(r),e.flushSync()}};return b(m,{get apiEndpoint(){return o()},get userSession(){return l()},get locale(){return y()},get itemId(){return i()},get elevateReward(){return d()},get translationUrl(){return c()}}),e.pop(h)}customElements.define("loyalty-shop-item",e.create_custom_element(C,{apiEndpoint:{},userSession:{},locale:{},itemId:{},elevateReward:{},translationUrl:{}},[],[]));const ee=Object.freeze(Object.defineProperty({__proto__:null,default:C},Symbol.toStringTag,{value:"Module"}));exports.LoyaltyShopItem=b;exports.LoyaltyShopItem_ce=ee;
|
|
@@ -14,8 +14,8 @@ var q = (g, a, o) => new Promise((d, _) => {
|
|
|
14
14
|
}, c = (l) => l.done ? d(l.value) : Promise.resolve(l.value).then(u, v);
|
|
15
15
|
c((o = o.apply(g, a)).next());
|
|
16
16
|
});
|
|
17
|
-
import { z as ve, c as Y, p as Q, a as fe, b as p, s as he, d as G, A as C, B as ye, C as ge, E as K, F as b, G as _e, H as we, m as s, f as be, g as xe, i as U, h as S, j as X, I as Ee, J as Re, K as ke, L as Se, k as m, l as Ie, n as M, q as
|
|
18
|
-
import { L as Ue } from "./LoyaltyPointsCard-
|
|
17
|
+
import { z as ve, c as Y, p as Q, a as fe, b as p, s as he, d as G, A as C, B as ye, C as ge, E as K, F as b, G as _e, H as we, m as s, f as be, g as xe, i as U, h as S, j as X, I as Ee, J as Re, K as ke, L as Se, k as m, l as Ie, n as M, q as E, o as I, r as O, t as z, v as N, M as Ne, w as j, u as T, x as Te, $ as Le, N as Ce, O as W } from "./LoyaltyPagination-BZk1S01e.js";
|
|
18
|
+
import { L as Ue } from "./LoyaltyPointsCard-jP0P8jiI.js";
|
|
19
19
|
typeof globalThis.HTMLElement == "undefined" && (globalThis.HTMLElement = class {
|
|
20
20
|
}, globalThis.customElements = { define() {
|
|
21
21
|
}, get() {
|
|
@@ -33,7 +33,7 @@ if (typeof window != "undefined") {
|
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
};
|
|
36
|
-
customElements.define = g(customElements.define), import("./LoyaltyPointsCard-
|
|
36
|
+
customElements.define = g(customElements.define), import("./LoyaltyPointsCard-jP0P8jiI.js").then((a) => a.a).then((a) => {
|
|
37
37
|
const o = a.default || a;
|
|
38
38
|
customElements.get("loyalty-points-card") || customElements.define("loyalty-points-card", o.element || o);
|
|
39
39
|
}).catch((a) => {
|
|
@@ -87,11 +87,11 @@ const Ae = {
|
|
|
87
87
|
};
|
|
88
88
|
function $(g, a) {
|
|
89
89
|
Q(a, !0), fe(g, Ae);
|
|
90
|
-
const o = () => Te(Le, "$_", d), [d, _] = Ie(), u = p(a, "apiEndpoint", 7, ""), v = p(a, "userSession", 7, ""), c = p(a, "locale", 7, ""), l = p(a, "itemId", 7, ""), r = p(a, "elevateReward"),
|
|
90
|
+
const o = () => Te(Le, "$_", d), [d, _] = Ie(), u = p(a, "apiEndpoint", 7, ""), v = p(a, "userSession", 7, ""), c = p(a, "locale", 7, ""), l = p(a, "itemId", 7, ""), r = p(a, "elevateReward"), R = p(a, "translationUrl");
|
|
91
91
|
he({ withLocale: c(), translations: {} }), Object.entries(Me).forEach(([e, t]) => {
|
|
92
92
|
G(e, t);
|
|
93
93
|
});
|
|
94
|
-
let i = C(ye(r())),
|
|
94
|
+
let i = C(ye(r())), x = C(!1), V = C("");
|
|
95
95
|
const A = T(() => {
|
|
96
96
|
var e, t, n, f;
|
|
97
97
|
return (f = (n = (t = (e = s(i)) == null ? void 0 : e.presentation) == null ? void 0 : t.assets) == null ? void 0 : n[0]) != null ? f : "";
|
|
@@ -105,7 +105,7 @@ function $(g, a) {
|
|
|
105
105
|
var e;
|
|
106
106
|
return ((e = s(i)) == null ? void 0 : e.available) === "true";
|
|
107
107
|
}), te = () => {
|
|
108
|
-
let e = new URL(
|
|
108
|
+
let e = new URL(R(), window.location.href);
|
|
109
109
|
fetch(e.href).then((t) => t.json()).then((t) => {
|
|
110
110
|
Object.keys(t).forEach((n) => {
|
|
111
111
|
G(n, t[n]);
|
|
@@ -115,37 +115,42 @@ function $(g, a) {
|
|
|
115
115
|
});
|
|
116
116
|
};
|
|
117
117
|
ge(() => {
|
|
118
|
-
|
|
118
|
+
R() && te();
|
|
119
119
|
}), K(() => {
|
|
120
120
|
if (r()) {
|
|
121
121
|
b(i, r(), !0);
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
|
-
!u() || !l()
|
|
124
|
+
if (!u() || !l())
|
|
125
|
+
return;
|
|
126
|
+
let e = !1;
|
|
127
|
+
return _e(
|
|
125
128
|
{
|
|
126
129
|
apiEndpoint: u(),
|
|
127
130
|
userSession: v(),
|
|
128
131
|
locale: c()
|
|
129
132
|
},
|
|
130
133
|
l()
|
|
131
|
-
).then((
|
|
132
|
-
b(i,
|
|
133
|
-
}).catch((
|
|
134
|
+
).then((t) => {
|
|
135
|
+
e || b(i, t, !0);
|
|
136
|
+
}).catch((t) => console.error("Failed to load shop item:", t)), () => {
|
|
137
|
+
e = !0;
|
|
138
|
+
};
|
|
134
139
|
});
|
|
135
140
|
const ae = () => {
|
|
136
|
-
s(
|
|
141
|
+
s(x) || !s(H) || !s(i) || Ce(s(i).displayName || s(i).presentation.displayName, s(i).id);
|
|
137
142
|
}, se = () => q(this, null, function* () {
|
|
138
143
|
var t;
|
|
139
|
-
if (!u() || !s(i))
|
|
144
|
+
if (!u() || !s(i) || s(x))
|
|
140
145
|
return;
|
|
141
|
-
b(
|
|
146
|
+
b(x, !0), b(V, "");
|
|
142
147
|
const e = s(i).id;
|
|
143
148
|
try {
|
|
144
149
|
yield Ee({ apiEndpoint: u(), userSession: v() }, e), Re(e), ke();
|
|
145
150
|
} catch (n) {
|
|
146
151
|
b(V, (t = n == null ? void 0 : n.message) != null ? t : "Redeem failed", !0), Se(e, n);
|
|
147
152
|
} finally {
|
|
148
|
-
b(
|
|
153
|
+
b(x, !1);
|
|
149
154
|
}
|
|
150
155
|
});
|
|
151
156
|
K(() => {
|
|
@@ -187,10 +192,10 @@ function $(g, a) {
|
|
|
187
192
|
r(e), m();
|
|
188
193
|
},
|
|
189
194
|
get translationUrl() {
|
|
190
|
-
return
|
|
195
|
+
return R();
|
|
191
196
|
},
|
|
192
197
|
set translationUrl(e) {
|
|
193
|
-
|
|
198
|
+
R(e), m();
|
|
194
199
|
}
|
|
195
200
|
}, F = be(), re = xe(F);
|
|
196
201
|
{
|
|
@@ -207,9 +212,9 @@ function $(g, a) {
|
|
|
207
212
|
s(A) && h(w);
|
|
208
213
|
});
|
|
209
214
|
}
|
|
210
|
-
var P =
|
|
215
|
+
var P = E(f, 2), le = I(P, !0), Z = E(P, 2), de = I(Z), L = E(Z, 2), ue = I(L, !0);
|
|
211
216
|
O(n);
|
|
212
|
-
var J =
|
|
217
|
+
var J = E(n, 2);
|
|
213
218
|
Ue(J, {
|
|
214
219
|
get apiEndpoint() {
|
|
215
220
|
return u();
|
|
@@ -221,7 +226,7 @@ function $(g, a) {
|
|
|
221
226
|
return c();
|
|
222
227
|
}
|
|
223
228
|
});
|
|
224
|
-
var ce =
|
|
229
|
+
var ce = E(J, 2);
|
|
225
230
|
{
|
|
226
231
|
var pe = (h) => {
|
|
227
232
|
var y = je(), k = M(y), me = I(k, !0);
|
|
@@ -235,7 +240,7 @@ function $(g, a) {
|
|
|
235
240
|
(h, y) => {
|
|
236
241
|
var k;
|
|
237
242
|
N(le, s(B)), N(de, `${(k = s(i).points) != null ? k : ""}
|
|
238
|
-
${h != null ? h : ""}`), L.disabled = !s(H) || s(
|
|
243
|
+
${h != null ? h : ""}`), L.disabled = !s(H) || s(x), N(ue, y);
|
|
239
244
|
},
|
|
240
245
|
[() => o()("tokens"), () => o()("buyNow")]
|
|
241
246
|
), Ne("click", L, ae), S(e, t);
|
package/es2015/loyalty-shop.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
typeof globalThis.HTMLElement=="undefined"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const s=require("../components/LoyaltyShop-
|
|
1
|
+
typeof globalThis.HTMLElement=="undefined"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const s=require("../components/LoyaltyShop-BYXBV-P0.cjs");if(typeof window!="undefined"){let o=function(e){return function(...n){try{return e.apply(this,n)}catch(t){if(t instanceof DOMException&&t.message.includes("has already been used with this registry")||t instanceof Error&&t.message.includes("Cannot define multiple custom elements with the same tag name"))return!1;throw t}}};customElements.define=o(customElements.define),Promise.resolve().then(()=>require("../components/LoyaltyShop-BYXBV-P0.cjs")).then(e=>e.LoyaltyShop_ce).then(e=>{const n=e.default||e;customElements.get("loyalty-shop")||customElements.define("loyalty-shop",n.element||n)}).catch(e=>{console.error("BOOT ERROR:",e)})}module.exports=s.LoyaltyShop;
|
package/es2015/loyalty-shop.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { L as a } from "../components/LoyaltyShop-
|
|
1
|
+
import { L as a } from "../components/LoyaltyShop-CUN0MKDN.js";
|
|
2
2
|
typeof globalThis.HTMLElement == "undefined" && (globalThis.HTMLElement = class {
|
|
3
3
|
}, globalThis.customElements = { define() {
|
|
4
4
|
}, get() {
|
|
@@ -16,7 +16,7 @@ if (typeof window != "undefined") {
|
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
|
-
customElements.define = s(customElements.define), import("../components/LoyaltyShop-
|
|
19
|
+
customElements.define = s(customElements.define), import("../components/LoyaltyShop-CUN0MKDN.js").then((e) => e.a).then((e) => {
|
|
20
20
|
const n = e.default || e;
|
|
21
21
|
customElements.get("loyalty-shop") || customElements.define("loyalty-shop", n.element || n);
|
|
22
22
|
}).catch((e) => {
|
package/esnext/loyalty-shop.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
typeof globalThis.HTMLElement>"u"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const s=require("../components/LoyaltyShop-
|
|
1
|
+
typeof globalThis.HTMLElement>"u"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const s=require("../components/LoyaltyShop-9D4_2iLM.cjs");if(typeof window<"u"){let o=function(e){return function(...n){try{return e.apply(this,n)}catch(t){if(t instanceof DOMException&&t.message.includes("has already been used with this registry")||t instanceof Error&&t.message.includes("Cannot define multiple custom elements with the same tag name"))return!1;throw t}}};customElements.define=o(customElements.define),Promise.resolve().then(()=>require("../components/LoyaltyShop-9D4_2iLM.cjs")).then(e=>e.LoyaltyShop_ce).then(e=>{const n=e.default||e;customElements.get("loyalty-shop")||customElements.define("loyalty-shop",n.element||n)}).catch(e=>{console.error("BOOT ERROR:",e)})}module.exports=s.LoyaltyShop;
|
package/esnext/loyalty-shop.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { L as a } from "../components/LoyaltyShop-
|
|
1
|
+
import { L as a } from "../components/LoyaltyShop-D-Gsl4ZM.js";
|
|
2
2
|
typeof globalThis.HTMLElement > "u" && (globalThis.HTMLElement = class {
|
|
3
3
|
}, globalThis.customElements = { define() {
|
|
4
4
|
}, get() {
|
|
@@ -16,7 +16,7 @@ if (typeof window < "u") {
|
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
|
-
customElements.define = s(customElements.define), import("../components/LoyaltyShop-
|
|
19
|
+
customElements.define = s(customElements.define), import("../components/LoyaltyShop-D-Gsl4ZM.js").then((e) => e.a).then((e) => {
|
|
20
20
|
const n = e.default || e;
|
|
21
21
|
customElements.get("loyalty-shop") || customElements.define("loyalty-shop", n.element || n);
|
|
22
22
|
}).catch((e) => {
|