@everymatrix/loyalty-shop 0.2.9 → 0.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. package/components/{LoyaltyPagination-Cw2snZwZ.js → LoyaltyPagination-BNBJcXKk.js} +1993 -2000
  2. package/components/{LoyaltyPagination-CyjgdUPo.js → LoyaltyPagination-BP3AxeDj.js} +465 -470
  3. package/components/LoyaltyPagination-BpErkHgK.cjs +14 -0
  4. package/components/LoyaltyPagination-CnoIs1uw.cjs +14 -0
  5. package/components/{LoyaltyPointsCard-njx77PMq.cjs → LoyaltyPointsCard-C16D2R5K.cjs} +1 -1
  6. package/components/{LoyaltyPointsCard-Xb627em8.cjs → LoyaltyPointsCard-C5qTjR-v.cjs} +1 -1
  7. package/components/{LoyaltyPointsCard-CFk3DpjI.js → LoyaltyPointsCard-DmE0ayL6.js} +1 -1
  8. package/components/{LoyaltyPointsCard-DTOQlcMH.js → LoyaltyPointsCard-Dz8Tgtc6.js} +1 -1
  9. package/components/{LoyaltyShop-BKubFlFr.js → LoyaltyShop-BR3Bcw_U.js} +7 -7
  10. package/components/{LoyaltyShop-D_Oyu_cp.cjs → LoyaltyShop-Bvon_isa.cjs} +5 -5
  11. package/components/{LoyaltyShop-8d3N_F-0.cjs → LoyaltyShop-C4Jmxgps.cjs} +5 -5
  12. package/components/{LoyaltyShop-Dfybp9ut.js → LoyaltyShop-FyZaT4Go.js} +7 -7
  13. package/components/{LoyaltyShopItem-DEz9OVzD.cjs → LoyaltyShopItem-C8gpofzS.cjs} +1 -1
  14. package/components/{LoyaltyShopItem-BXrrNl9f.js → LoyaltyShopItem-D_INMfUe.js} +3 -3
  15. package/components/{LoyaltyShopItem-CqY63kaT.js → LoyaltyShopItem-DkUT2Hhc.js} +3 -3
  16. package/components/{LoyaltyShopItem-CGOptttz.cjs → LoyaltyShopItem-Dy7fBUI9.cjs} +1 -1
  17. package/es2015/loyalty-shop.cjs +1 -1
  18. package/es2015/loyalty-shop.js +2 -2
  19. package/esnext/loyalty-shop.cjs +1 -1
  20. package/esnext/loyalty-shop.js +2 -2
  21. package/package.json +1 -1
  22. package/components/LoyaltyPagination-B7JqsoUi.cjs +0 -14
  23. package/components/LoyaltyPagination-BRav_RW5.cjs +0 -14
@@ -1,4 +1,4 @@
1
- typeof globalThis.HTMLElement>"u"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const e=require("./LoyaltyPagination-B7JqsoUi.cjs"),_e=require("./LoyaltyShopItem-CGOptttz.cjs");if(typeof window<"u"){let h=function(n){return function(...i){try{return n.apply(this,i)}catch(r){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"))return!1;throw r}}};customElements.define=h(customElements.define),Promise.resolve().then(()=>require("./LoyaltyPagination-B7JqsoUi.cjs")).then(n=>n.LoyaltyPagination_ce).then(n=>{const i=n.default||n;customElements.get("loyalty-pagination")||customElements.define("loyalty-pagination",i.element||i)}).catch(n=>{console.error("BOOT ERROR:",n)})}if(typeof window<"u"){let h=function(n){return function(...i){try{return n.apply(this,i)}catch(r){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"))return!1;throw r}}};customElements.define=h(customElements.define),Promise.resolve().then(()=>require("./LoyaltyShopItem-CGOptttz.cjs")).then(n=>n.LoyaltyShopItem_ce).then(n=>{const i=n.default||n;customElements.get("loyalty-shop-item")||customElements.define("loyalty-shop-item",i.element||i)}).catch(n=>{console.error("BOOT ERROR:",n)})}const be={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."}},ve="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 ke=e.from_html('<div class="loyalty-shop__item loyalty-shop__item--skeleton"><div class="loyalty-shop__item-image skeleton-box"></div> <div class="loyalty-shop__item-title skeleton-line"></div> <div class="loyalty-shop__item-points skeleton-line skeleton-line--short"></div> <div class="loyalty-shop__item-button-skeleton skeleton-box"></div></div>'),Ee=e.from_html('<div class="loyalty-shop__grid loyalty-shop__grid--skeleton"></div>'),we=e.from_html('<div class="loyalty-shop__unavailable"> </div>'),xe=e.from_html('<div><div role="button" tabindex="0" class="loyalty-shop__item-image-container"><img class="loyalty-shop__item-image"/></div> <span class="loyalty-shop__item-title"> </span> <span class="loyalty-shop__item-points"> </span> <button class="loyalty-shop__item-button" type="button"> </button></div>'),Se=e.from_html('<div class="load-more-sentinel" aria-hidden="true"></div>'),Ie=e.from_html('<div class="loyalty-shop__grid"></div> <!> <!>',1),Le=e.from_html('<div class="loyalty-shop"><!></div>');const Te={hash:"svelte-1f1q033",code:`.loyalty-shop {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 {color:var(--text-subtle, #dfe3e8);font-size:14px;padding:24px 0;text-align:center;}.loyalty-shop__grid {display:grid;gap:16px;grid-template-columns:repeat(2, 1fr);margin:0;}.loyalty-shop__item {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 {opacity:1;}.loyalty-shop__item-image {width:100%;height:82px;border-radius:6px;}.loyalty-shop__item-title {color:var(--text-default, #ffffff);font-size:12px;font-weight:400;}.loyalty-shop__item-points {color:var(--text-subtle, #dfe3e8);font-size:14px;font-weight:400;}.loyalty-shop__item-button {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:disabled {opacity:0.4;cursor:default;}.loyalty-shop-container {display:flex;flex-direction:column;gap:12px;}.skeleton-box {background:linear-gradient(
1
+ typeof globalThis.HTMLElement>"u"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const e=require("./LoyaltyPagination-CnoIs1uw.cjs"),_e=require("./LoyaltyShopItem-Dy7fBUI9.cjs");if(typeof window<"u"){let h=function(n){return function(...i){try{return n.apply(this,i)}catch(r){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"))return!1;throw r}}};customElements.define=h(customElements.define),Promise.resolve().then(()=>require("./LoyaltyPagination-CnoIs1uw.cjs")).then(n=>n.LoyaltyPagination_ce).then(n=>{const i=n.default||n;customElements.get("loyalty-pagination")||customElements.define("loyalty-pagination",i.element||i)}).catch(n=>{console.error("BOOT ERROR:",n)})}if(typeof window<"u"){let h=function(n){return function(...i){try{return n.apply(this,i)}catch(r){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"))return!1;throw r}}};customElements.define=h(customElements.define),Promise.resolve().then(()=>require("./LoyaltyShopItem-Dy7fBUI9.cjs")).then(n=>n.LoyaltyShopItem_ce).then(n=>{const i=n.default||n;customElements.get("loyalty-shop-item")||customElements.define("loyalty-shop-item",i.element||i)}).catch(n=>{console.error("BOOT ERROR:",n)})}const be={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."}},ve="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 ke=e.from_html('<div class="loyalty-shop__item loyalty-shop__item--skeleton"><div class="loyalty-shop__item-image skeleton-box"></div> <div class="loyalty-shop__item-title skeleton-line"></div> <div class="loyalty-shop__item-points skeleton-line skeleton-line--short"></div> <div class="loyalty-shop__item-button-skeleton skeleton-box"></div></div>'),Ee=e.from_html('<div class="loyalty-shop__grid loyalty-shop__grid--skeleton"></div>'),we=e.from_html('<div class="loyalty-shop__unavailable"> </div>'),xe=e.from_html('<div><div role="button" tabindex="0" class="loyalty-shop__item-image-container"><img class="loyalty-shop__item-image"/></div> <span class="loyalty-shop__item-title"> </span> <span class="loyalty-shop__item-points"> </span> <button class="loyalty-shop__item-button" type="button"> </button></div>'),Se=e.from_html('<div class="load-more-sentinel" aria-hidden="true"></div>'),Ie=e.from_html('<div class="loyalty-shop__grid"></div> <!> <!>',1),Le=e.from_html('<div class="loyalty-shop"><!></div>');const Te={hash:"svelte-1f1q033",code:`.loyalty-shop {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 {color:var(--text-subtle, #dfe3e8);font-size:14px;padding:24px 0;text-align:center;}.loyalty-shop__grid {display:grid;gap:16px;grid-template-columns:repeat(2, 1fr);margin:0;}.loyalty-shop__item {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 {opacity:1;}.loyalty-shop__item-image {display:block;width:100%;height:auto;aspect-ratio:9 / 10;object-fit:cover;border-radius:6px;}.loyalty-shop__item-title {color:var(--text-default, #ffffff);font-size:12px;font-weight:400;}.loyalty-shop__item-points {color:var(--text-subtle, #dfe3e8);font-size:14px;font-weight:400;}.loyalty-shop__item-button {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:disabled {opacity:0.4;cursor:default;}.loyalty-shop-container {display:flex;flex-direction:column;gap:12px;}.skeleton-box {background:linear-gradient(
2
2
  90deg,
3
3
  var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 0%,
4
4
  color-mix(in srgb, var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 80%, white) 50%,
@@ -10,7 +10,7 @@ typeof globalThis.HTMLElement>"u"&&(globalThis.HTMLElement=class{},globalThis.cu
10
10
  color-mix(in srgb, var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 80%, white) 50%,
11
11
  var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 100%
12
12
  );background-size:200% 100%;
13
- animation: shimmer 3s linear infinite;}.skeleton-line--short {width:40%;}.loyalty-shop__item--skeleton {display:flex;flex-direction:column;}.loyalty-shop__item--skeleton .loyalty-shop__item-image {width:100%;height:82px;border-radius:6px;}.loyalty-shop__item--skeleton .loyalty-shop__item-title {width:90%;}.loyalty-shop__item--skeleton .loyalty-shop__item-points {width:40%;}.loyalty-shop__item-button-skeleton {margin-top:auto;width:100%;height:40px;border-radius:6px;}.loyalty-shop__item-image-container {cursor:pointer;}
13
+ animation: shimmer 3s linear infinite;}.skeleton-line--short {width:40%;}.loyalty-shop__item--skeleton {display:flex;flex-direction:column;}.loyalty-shop__item--skeleton .loyalty-shop__item-image {width:100%;height:auto;aspect-ratio:9 / 10;border-radius:6px;}.loyalty-shop__item--skeleton .loyalty-shop__item-title {width:90%;}.loyalty-shop__item--skeleton .loyalty-shop__item-points {width:40%;}.loyalty-shop__item-button-skeleton {margin-top:auto;width:100%;height:40px;border-radius:6px;}.loyalty-shop__item-image-container {cursor:pointer;}
14
14
 
15
15
  @keyframes shimmer {
16
16
  0% {
@@ -22,6 +22,6 @@ typeof globalThis.HTMLElement>"u"&&(globalThis.HTMLElement=class{},globalThis.cu
22
22
  }
23
23
  }
24
24
 
25
- @media (min-width: 768px) {.loyalty-shop__grid {grid-template-columns:repeat(4, 1fr);justify-content:start;margin:0;}.loyalty-shop__item {width:100%;height:100%;box-sizing:border-box;}.loyalty-shop__item-image {height:200px;}.loyalty-shop__item--skeleton .loyalty-shop__item-image {height:200px;}
26
- }`};function z(h,n){e.push(n,!0),e.append_styles(h,Te);const i=()=>e.store_get(e.$format,"$_",r),[r,E]=e.setup_stores(),p=e.prop(n,"apiEndpoint",7,""),c=e.prop(n,"userSession",7,""),m=e.prop(n,"locale",7,""),s=e.prop(n,"limitItem",7,e.ITEMS_LIMIT_DEFAULT),x=e.prop(n,"translationUrl");e.setupI18n({withLocale:m(),translations:{}});const Y=async()=>{try{const t=new URL(x(),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(([l,v])=>{e.addNewMessages(l,v)})}catch(t){console.error("loyalty shop translation url err:",t)}};Object.entries(be).forEach(([t,o])=>{e.addNewMessages(t,o)});let u=e.state(e.proxy([])),_=e.state(void 0),S=e.state(0),y=e.state(0),b=e.state(e.proxy(e.MOBILE_LOAD_ITEMS)),C=e.state(!1),R=e.state(!1),w=e.state(void 0),f=e.state(!1),I=e.state(void 0),L=0;const Z=e.user_derived(()=>typeof s()=="number"?s():parseInt(s(),e.ITEMS_LIMIT_DEFAULT)||e.ITEMS_LIMIT_DEFAULT),B=()=>{if(!p()||!c())return;e.set(C,!0),e.set(R,!1);const t=++L,o=e.get(f)&&e.get(y)>0;e.fetchShopRewards({apiEndpoint:p(),userSession:c(),locale:m()},e.get(y),e.get(b)).then(a=>{if(t!==L)return;const l=a.data??[];e.set(S,a.total??0,!0),o?e.set(u,[...e.get(u),...l],!0):e.set(u,l,!0)}).catch(a=>{t===L&&(e.set(R,!0),console.error("Failed to load shop rewards:",a))}).finally(()=>{t===L&&e.set(C,!1)})};e.user_effect(()=>{p(),c(),m(),e.get(y),e.get(b),B()}),e.user_effect(()=>{const t=window.matchMedia("(max-width: 767px)"),o=a=>{e.set(f,a.matches,!0)};return e.set(f,t.matches,!0),t.addEventListener("change",o),()=>t.removeEventListener("change",o)}),e.user_effect(()=>{e.set(b,e.get(f)?e.MOBILE_LOAD_ITEMS:e.get(Z),!0)}),e.user_effect(()=>{if(!e.get(f)||!e.get(I))return;const t=new IntersectionObserver(o=>{o.some(a=>a.isIntersecting)&&e.get(u).length<e.get(S)&&e.set(y,e.get(y)+e.get(b))},{rootMargin:"200px"});return t.observe(e.get(I)),()=>t.disconnect()}),e.user_pre_effect(()=>{x()&&Y()});const J=t=>t.presentation?.assets?.[0]??ve,N=t=>t.displayName??t.presentation?.displayName??"",O=t=>t.available==="true",W=t=>{e.get(w)||!O(t)||e.sendRedeemRewardRequested(N(t),t.id)},G=async t=>{if(!(!p()||e.get(w))){e.set(w,t,!0);try{await e.redeemReward({apiEndpoint:p(),userSession:c()},t),e.sendRedeemRewardSuccess(t),e.dispatchRedeemRewardButton(),B()}catch(o){e.sendRedeemRewardFailed(t,o)}finally{e.set(w,void 0)}}};e.user_effect(()=>{const t=o=>{const{type:a,id:l,source:v}=o.data??{};switch(a){case e.EVENT_TYPES.REDEEM_REWARD_CONFIRMED:if(e.get(_))break;l&&e.get(u).some(T=>T.id===l)&&G(l);break;case e.EVENT_TYPES.BACK_BUTTON_CLICKED:v===e.SOURCE&&e.set(_,void 0);break}};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)});const Q=()=>e.get(u).length?i()("generalError"):i()("noContent"),X=t=>{e.set(y,t,!0)},$=t=>{e.sendRewardItemClicked(t.displayName||t.presentation.displayName,t.id)},j=t=>{e.set(_,t,!0),$(t)},ee=t=>o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),j(t))};var te={get apiEndpoint(){return p()},set apiEndpoint(t=""){p(t),e.flushSync()},get userSession(){return c()},set userSession(t=""){c(t),e.flushSync()},get locale(){return m()},set locale(t=""){m(t),e.flushSync()},get limitItem(){return s()},set limitItem(t=e.ITEMS_LIMIT_DEFAULT){s(t),e.flushSync()},get translationUrl(){return x()},set translationUrl(t){x(t),e.flushSync()}},P=Le(),ne=e.child(P);{var oe=t=>{_e.LoyaltyShopItem(t,{get itemId(){return e.get(_).id},get elevateReward(){return e.get(_)},get apiEndpoint(){return p()},get userSession(){return c()},get locale(){return m()}})},ae=t=>{var o=Ee();e.each(o,21,()=>Array(e.get(b)),e.index,(a,l,v,T)=>{var U=ke();e.append(a,U)}),e.reset(o),e.append(t,o)},ie=t=>{var o=we(),a=e.only_child(o,!0);e.template_effect(l=>e.set_text(a,l),[()=>Q()]),e.append(t,o)},re=t=>{var o=Ie(),a=e.first_child(o);e.each(a,21,()=>e.get(u),g=>g.id,(g,d)=>{var k=xe();let F;var M=e.child(k),le=e.user_derived(()=>ee(e.get(d))),q=e.only_child(M),V=e.sibling(M,2),de=e.only_child(V,!0),H=e.sibling(V,2),pe=e.only_child(H),D=e.sibling(H,2),ce=e.only_child(D,!0);e.reset(k),e.template_effect((A,ge,ue,me,he,ye,fe)=>{F=e.set_class(k,1,"loyalty-shop__item",null,F,{"loyalty-shop__item--unavailable":A}),e.set_attribute(q,"src",ge),e.set_attribute(q,"alt",ue),e.set_text(de,me),e.set_text(pe,`${e.get(d).points??""}
27
- ${he??""}`),D.disabled=ye,e.set_text(ce,fe)},[()=>!O(e.get(d)),()=>J(e.get(d)),()=>N(e.get(d)),()=>N(e.get(d)),()=>i()("tokens"),()=>!O(e.get(d))||e.get(w)===e.get(d).id,()=>i()("buyNow")]),e.delegated("click",M,()=>j(e.get(d))),e.delegated("keydown",M,function(...A){e.get(le)?.apply(this,A)}),e.delegated("click",D,()=>W(e.get(d))),e.append(g,k)}),e.reset(a);var l=e.sibling(a,2);{var v=g=>{e.LoyaltyPagination(g,{get offset(){return e.get(y)},get limit(){return e.get(b)},get total(){return e.get(S)},onPageChange:X,get locale(){return m()}})};e.if_block(l,g=>{e.get(f)||g(v)})}var T=e.sibling(l,2);{var U=g=>{var d=Se();e.bind_this(d,k=>e.set(I,k),()=>e.get(I)),e.append(g,d)};e.if_block(T,g=>{e.get(f)&&e.get(u).length<e.get(S)&&g(U)})}e.append(t,o)};e.if_block(ne,t=>{e.get(_)?t(oe):e.get(C)&&e.get(u).length===0?t(ae,1):!e.get(u).length||e.get(R)?t(ie,2):t(re,-1)})}e.reset(P),e.append(h,P);var se=e.pop(te);return E(),se}e.delegate(["click","keydown"]);e.create_custom_element(z,{apiEndpoint:{},userSession:{},locale:{},limitItem:{},translationUrl:{}},[],[],{mode:"open"});function K(h,n){e.push(n,!0);let i=e.prop(n,"apiEndpoint",7,""),r=e.prop(n,"userSession",7,""),E=e.prop(n,"locale",7,""),p=e.prop(n,"limitItem",7,e.ITEMS_LIMIT_DEFAULT),c=e.prop(n,"translationUrl");var m={get apiEndpoint(){return i()},set apiEndpoint(s=""){i(s),e.flushSync()},get userSession(){return r()},set userSession(s=""){r(s),e.flushSync()},get locale(){return E()},set locale(s=""){E(s),e.flushSync()},get limitItem(){return p()},set limitItem(s=e.ITEMS_LIMIT_DEFAULT){p(s),e.flushSync()},get translationUrl(){return c()},set translationUrl(s){c(s),e.flushSync()}};return z(h,{get apiEndpoint(){return i()},get userSession(){return r()},get locale(){return E()},get limitItem(){return p()},get translationUrl(){return c()}}),e.pop(m)}customElements.define("loyalty-shop",e.create_custom_element(K,{apiEndpoint:{},userSession:{},locale:{},limitItem:{},translationUrl:{}},[],[]));const Me=Object.freeze(Object.defineProperty({__proto__:null,default:K},Symbol.toStringTag,{value:"Module"}));exports.LoyaltyShop=z;exports.LoyaltyShop_ce=Me;
25
+ @media (min-width: 768px) {.loyalty-shop__grid {grid-template-columns:repeat(4, 1fr);justify-content:start;margin:0;}.loyalty-shop__item {width:100%;height:100%;box-sizing:border-box;}
26
+ }`};function z(h,n){e.push(n,!0),e.append_styles(h,Te);const i=()=>e.store_get(e.$format,"$_",r),[r,E]=e.setup_stores(),c=e.prop(n,"apiEndpoint",7,""),p=e.prop(n,"userSession",7,""),m=e.prop(n,"locale",7,""),s=e.prop(n,"limitItem",7,e.ITEMS_LIMIT_DEFAULT),x=e.prop(n,"translationUrl");e.setupI18n({withLocale:m(),translations:{}});const Y=async()=>{try{const t=new URL(x(),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(([l,v])=>{e.addNewMessages(l,v)})}catch(t){console.error("loyalty shop translation url err:",t)}};Object.entries(be).forEach(([t,o])=>{e.addNewMessages(t,o)});let g=e.state(e.proxy([])),_=e.state(void 0),S=e.state(0),y=e.state(0),b=e.state(e.proxy(e.MOBILE_LOAD_ITEMS)),C=e.state(!1),R=e.state(!1),w=e.state(void 0),f=e.state(!1),I=e.state(void 0),L=0;const Z=e.user_derived(()=>typeof s()=="number"?s():parseInt(s(),e.ITEMS_LIMIT_DEFAULT)||e.ITEMS_LIMIT_DEFAULT),B=()=>{if(!c()||!p())return;e.set(C,!0),e.set(R,!1);const t=++L,o=e.get(f)&&e.get(y)>0;e.fetchShopRewards({apiEndpoint:c(),userSession:p(),locale:m()},e.get(y),e.get(b)).then(a=>{if(t!==L)return;const l=a.data??[];e.set(S,a.total??0,!0),o?e.set(g,[...e.get(g),...l],!0):e.set(g,l,!0)}).catch(a=>{t===L&&(e.set(R,!0),console.error("Failed to load shop rewards:",a))}).finally(()=>{t===L&&e.set(C,!1)})};e.user_effect(()=>{c(),p(),m(),e.get(y),e.get(b),B()}),e.user_effect(()=>{const t=window.matchMedia("(max-width: 767px)"),o=a=>{e.set(f,a.matches,!0)};return e.set(f,t.matches,!0),t.addEventListener("change",o),()=>t.removeEventListener("change",o)}),e.user_effect(()=>{e.set(b,e.get(f)?e.MOBILE_LOAD_ITEMS:e.get(Z),!0)}),e.user_effect(()=>{if(!e.get(f)||!e.get(I))return;const t=new IntersectionObserver(o=>{o.some(a=>a.isIntersecting)&&e.get(g).length<e.get(S)&&e.set(y,e.get(y)+e.get(b))},{rootMargin:"200px"});return t.observe(e.get(I)),()=>t.disconnect()}),e.user_pre_effect(()=>{x()&&Y()});const J=t=>t.presentation?.assets?.[0]??ve,N=t=>t.displayName??t.presentation?.displayName??"",O=t=>t.available==="true",W=t=>{e.get(w)||!O(t)||e.sendRedeemRewardRequested(N(t),t.id)},G=async t=>{if(!(!c()||e.get(w))){e.set(w,t,!0);try{await e.redeemReward({apiEndpoint:c(),userSession:p()},t),e.sendRedeemRewardSuccess(t),e.dispatchRedeemRewardButton(),B()}catch(o){e.sendRedeemRewardFailed(t,o)}finally{e.set(w,void 0)}}};e.user_effect(()=>{const t=o=>{const{type:a,id:l,source:v}=o.data??{};switch(a){case e.EVENT_TYPES.REDEEM_REWARD_CONFIRMED:if(e.get(_))break;l&&e.get(g).some(T=>T.id===l)&&G(l);break;case e.EVENT_TYPES.BACK_BUTTON_CLICKED:v===e.SOURCE&&e.set(_,void 0);break}};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)});const Q=()=>e.get(g).length?i()("generalError"):i()("noContent"),X=t=>{e.set(y,t,!0)},$=t=>{e.sendRewardItemClicked(t.displayName||t.presentation.displayName,t.id)},j=t=>{e.set(_,t,!0),$(t)},ee=t=>o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),j(t))};var te={get apiEndpoint(){return c()},set apiEndpoint(t=""){c(t),e.flushSync()},get userSession(){return p()},set userSession(t=""){p(t),e.flushSync()},get locale(){return m()},set locale(t=""){m(t),e.flushSync()},get limitItem(){return s()},set limitItem(t=e.ITEMS_LIMIT_DEFAULT){s(t),e.flushSync()},get translationUrl(){return x()},set translationUrl(t){x(t),e.flushSync()}},P=Le(),ne=e.child(P);{var oe=t=>{_e.LoyaltyShopItem(t,{get itemId(){return e.get(_).id},get elevateReward(){return e.get(_)},get apiEndpoint(){return c()},get userSession(){return p()},get locale(){return m()}})},ae=t=>{var o=Ee();e.each(o,21,()=>Array(e.get(b)),e.index,(a,l,v,T)=>{var U=ke();e.append(a,U)}),e.reset(o),e.append(t,o)},ie=t=>{var o=we(),a=e.only_child(o,!0);e.template_effect(l=>e.set_text(a,l),[()=>Q()]),e.append(t,o)},re=t=>{var o=Ie(),a=e.first_child(o);e.each(a,21,()=>e.get(g),u=>u.id,(u,d)=>{var k=xe();let F;var M=e.child(k),le=e.user_derived(()=>ee(e.get(d))),q=e.only_child(M),V=e.sibling(M,2),de=e.only_child(V,!0),H=e.sibling(V,2),ce=e.only_child(H),D=e.sibling(H,2),pe=e.only_child(D,!0);e.reset(k),e.template_effect((A,ue,ge,me,he,ye,fe)=>{F=e.set_class(k,1,"loyalty-shop__item",null,F,{"loyalty-shop__item--unavailable":A}),e.set_attribute(q,"src",ue),e.set_attribute(q,"alt",ge),e.set_text(de,me),e.set_text(ce,`${e.get(d).points??""}
27
+ ${he??""}`),D.disabled=ye,e.set_text(pe,fe)},[()=>!O(e.get(d)),()=>J(e.get(d)),()=>N(e.get(d)),()=>N(e.get(d)),()=>i()("tokens"),()=>!O(e.get(d))||e.get(w)===e.get(d).id,()=>i()("buyNow")]),e.delegated("click",M,()=>j(e.get(d))),e.delegated("keydown",M,function(...A){e.get(le)?.apply(this,A)}),e.delegated("click",D,()=>W(e.get(d))),e.append(u,k)}),e.reset(a);var l=e.sibling(a,2);{var v=u=>{e.LoyaltyPagination(u,{get offset(){return e.get(y)},get limit(){return e.get(b)},get total(){return e.get(S)},onPageChange:X,get locale(){return m()}})};e.if_block(l,u=>{e.get(f)||u(v)})}var T=e.sibling(l,2);{var U=u=>{var d=Se();e.bind_this(d,k=>e.set(I,k),()=>e.get(I)),e.append(u,d)};e.if_block(T,u=>{e.get(f)&&e.get(g).length<e.get(S)&&u(U)})}e.append(t,o)};e.if_block(ne,t=>{e.get(_)?t(oe):e.get(C)&&e.get(g).length===0?t(ae,1):!e.get(g).length||e.get(R)?t(ie,2):t(re,-1)})}e.reset(P),e.append(h,P);var se=e.pop(te);return E(),se}e.delegate(["click","keydown"]);e.create_custom_element(z,{apiEndpoint:{},userSession:{},locale:{},limitItem:{},translationUrl:{}},[],[],{mode:"open"});function K(h,n){e.push(n,!0);let i=e.prop(n,"apiEndpoint",7,""),r=e.prop(n,"userSession",7,""),E=e.prop(n,"locale",7,""),c=e.prop(n,"limitItem",7,e.ITEMS_LIMIT_DEFAULT),p=e.prop(n,"translationUrl");var m={get apiEndpoint(){return i()},set apiEndpoint(s=""){i(s),e.flushSync()},get userSession(){return r()},set userSession(s=""){r(s),e.flushSync()},get locale(){return E()},set locale(s=""){E(s),e.flushSync()},get limitItem(){return c()},set limitItem(s=e.ITEMS_LIMIT_DEFAULT){c(s),e.flushSync()},get translationUrl(){return p()},set translationUrl(s){p(s),e.flushSync()}};return z(h,{get apiEndpoint(){return i()},get userSession(){return r()},get locale(){return E()},get limitItem(){return c()},get translationUrl(){return p()}}),e.pop(m)}customElements.define("loyalty-shop",e.create_custom_element(K,{apiEndpoint:{},userSession:{},locale:{},limitItem:{},translationUrl:{}},[],[]));const Me=Object.freeze(Object.defineProperty({__proto__:null,default:K},Symbol.toStringTag,{value:"Module"}));exports.LoyaltyShop=z;exports.LoyaltyShop_ce=Me;
@@ -1,5 +1,5 @@
1
- import { z as qe, c as me, p as ge, a as Fe, b as y, s as Ze, d as oe, A as h, B as se, P as ie, E as T, m as t, F as r, C as Je, H as re, S as We, i as G, h as w, j as he, Q as R, R as Ye, u as le, I as Ge, J as Qe, K as Xe, L as $e, w as x, k as f, l as et, n as de, r as j, T as ue, U as tt, o as M, t as ce, v as V, g as nt, q as O, x as at, $ as ot, V as st, O as pe, M as Q, W as it, X as rt, N as lt, Y as dt } from "./LoyaltyPagination-CyjgdUPo.js";
2
- import { L as ut } from "./LoyaltyShopItem-BXrrNl9f.js";
1
+ import { z as qe, c as me, p as ge, a as Fe, b as y, s as Ze, d as oe, A as h, B as se, P as ie, E as T, m as t, F as r, C as Je, H as re, S as We, i as G, h as w, j as he, Q as R, R as Ye, u as le, I as Ge, J as Qe, K as Xe, L as $e, w as x, k as f, l as et, n as de, r as j, T as ue, U as tt, o as M, t as ce, v as V, g as nt, q as O, x as at, $ as ot, V as st, O as pe, M as Q, W as it, X as rt, N as lt, Y as dt } from "./LoyaltyPagination-BP3AxeDj.js";
2
+ import { L as ut } from "./LoyaltyShopItem-D_INMfUe.js";
3
3
  typeof globalThis.HTMLElement > "u" && (globalThis.HTMLElement = class {
4
4
  }, globalThis.customElements = { define() {
5
5
  }, get() {
@@ -17,7 +17,7 @@ if (typeof window < "u") {
17
17
  }
18
18
  };
19
19
  };
20
- customElements.define = _(customElements.define), import("./LoyaltyPagination-CyjgdUPo.js").then((n) => n.Z).then((n) => {
20
+ customElements.define = _(customElements.define), import("./LoyaltyPagination-BP3AxeDj.js").then((n) => n.Z).then((n) => {
21
21
  const s = n.default || n;
22
22
  customElements.get("loyalty-pagination") || customElements.define("loyalty-pagination", s.element || s);
23
23
  }).catch((n) => {
@@ -36,7 +36,7 @@ if (typeof window < "u") {
36
36
  }
37
37
  };
38
38
  };
39
- customElements.define = _(customElements.define), import("./LoyaltyShopItem-BXrrNl9f.js").then((n) => n.a).then((n) => {
39
+ customElements.define = _(customElements.define), import("./LoyaltyShopItem-D_INMfUe.js").then((n) => n.a).then((n) => {
40
40
  const s = n.default || n;
41
41
  customElements.get("loyalty-shop-item") || customElements.define("loyalty-shop-item", s.element || s);
42
42
  }).catch((n) => {
@@ -104,7 +104,7 @@ const ct = {
104
104
  var mt = x('<div class="loyalty-shop__item loyalty-shop__item--skeleton"><div class="loyalty-shop__item-image skeleton-box"></div> <div class="loyalty-shop__item-title skeleton-line"></div> <div class="loyalty-shop__item-points skeleton-line skeleton-line--short"></div> <div class="loyalty-shop__item-button-skeleton skeleton-box"></div></div>'), gt = x('<div class="loyalty-shop__grid loyalty-shop__grid--skeleton"></div>'), ht = x('<div class="loyalty-shop__unavailable"> </div>'), yt = x('<div><div role="button" tabindex="0" class="loyalty-shop__item-image-container"><img class="loyalty-shop__item-image"/></div> <span class="loyalty-shop__item-title"> </span> <span class="loyalty-shop__item-points"> </span> <button class="loyalty-shop__item-button" type="button"> </button></div>'), ft = x('<div class="load-more-sentinel" aria-hidden="true"></div>'), bt = x('<div class="loyalty-shop__grid"></div> <!> <!>', 1), _t = x('<div class="loyalty-shop"><!></div>');
105
105
  const vt = {
106
106
  hash: "svelte-1f1q033",
107
- code: `.loyalty-shop {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 {color:var(--text-subtle, #dfe3e8);font-size:14px;padding:24px 0;text-align:center;}.loyalty-shop__grid {display:grid;gap:16px;grid-template-columns:repeat(2, 1fr);margin:0;}.loyalty-shop__item {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 {opacity:1;}.loyalty-shop__item-image {width:100%;height:82px;border-radius:6px;}.loyalty-shop__item-title {color:var(--text-default, #ffffff);font-size:12px;font-weight:400;}.loyalty-shop__item-points {color:var(--text-subtle, #dfe3e8);font-size:14px;font-weight:400;}.loyalty-shop__item-button {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:disabled {opacity:0.4;cursor:default;}.loyalty-shop-container {display:flex;flex-direction:column;gap:12px;}.skeleton-box {background:linear-gradient(
107
+ code: `.loyalty-shop {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 {color:var(--text-subtle, #dfe3e8);font-size:14px;padding:24px 0;text-align:center;}.loyalty-shop__grid {display:grid;gap:16px;grid-template-columns:repeat(2, 1fr);margin:0;}.loyalty-shop__item {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 {opacity:1;}.loyalty-shop__item-image {display:block;width:100%;height:auto;aspect-ratio:9 / 10;object-fit:cover;border-radius:6px;}.loyalty-shop__item-title {color:var(--text-default, #ffffff);font-size:12px;font-weight:400;}.loyalty-shop__item-points {color:var(--text-subtle, #dfe3e8);font-size:14px;font-weight:400;}.loyalty-shop__item-button {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:disabled {opacity:0.4;cursor:default;}.loyalty-shop-container {display:flex;flex-direction:column;gap:12px;}.skeleton-box {background:linear-gradient(
108
108
  90deg,
109
109
  var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 0%,
110
110
  color-mix(in srgb, var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 80%, white) 50%,
@@ -116,7 +116,7 @@ const vt = {
116
116
  color-mix(in srgb, var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 80%, white) 50%,
117
117
  var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 100%
118
118
  );background-size:200% 100%;
119
- animation: shimmer 3s linear infinite;}.skeleton-line--short {width:40%;}.loyalty-shop__item--skeleton {display:flex;flex-direction:column;}.loyalty-shop__item--skeleton .loyalty-shop__item-image {width:100%;height:82px;border-radius:6px;}.loyalty-shop__item--skeleton .loyalty-shop__item-title {width:90%;}.loyalty-shop__item--skeleton .loyalty-shop__item-points {width:40%;}.loyalty-shop__item-button-skeleton {margin-top:auto;width:100%;height:40px;border-radius:6px;}.loyalty-shop__item-image-container {cursor:pointer;}
119
+ animation: shimmer 3s linear infinite;}.skeleton-line--short {width:40%;}.loyalty-shop__item--skeleton {display:flex;flex-direction:column;}.loyalty-shop__item--skeleton .loyalty-shop__item-image {width:100%;height:auto;aspect-ratio:9 / 10;border-radius:6px;}.loyalty-shop__item--skeleton .loyalty-shop__item-title {width:90%;}.loyalty-shop__item--skeleton .loyalty-shop__item-points {width:40%;}.loyalty-shop__item-button-skeleton {margin-top:auto;width:100%;height:40px;border-radius:6px;}.loyalty-shop__item-image-container {cursor:pointer;}
120
120
 
121
121
  @keyframes shimmer {
122
122
  0% {
@@ -128,7 +128,7 @@ const vt = {
128
128
  }
129
129
  }
130
130
 
131
- @media (min-width: 768px) {.loyalty-shop__grid {grid-template-columns:repeat(4, 1fr);justify-content:start;margin:0;}.loyalty-shop__item {width:100%;height:100%;box-sizing:border-box;}.loyalty-shop__item-image {height:200px;}.loyalty-shop__item--skeleton .loyalty-shop__item-image {height:200px;}
131
+ @media (min-width: 768px) {.loyalty-shop__grid {grid-template-columns:repeat(4, 1fr);justify-content:start;margin:0;}.loyalty-shop__item {width:100%;height:100%;box-sizing:border-box;}
132
132
  }`
133
133
  };
134
134
  function ye(_, n) {
@@ -1,4 +1,4 @@
1
- var M=(y,o,r)=>new Promise((d,g)=>{var c=l=>{try{p(r.next(l))}catch(s){g(s)}},u=l=>{try{p(r.throw(l))}catch(s){g(s)}},p=l=>l.done?d(l.value):Promise.resolve(l.value).then(c,u);p((r=r.apply(y,o)).next())});typeof globalThis.HTMLElement=="undefined"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const e=require("./LoyaltyPagination-BRav_RW5.cjs"),K=require("./LoyaltyPointsCard-njx77PMq.cjs");if(typeof window!="undefined"){let y=function(o){return function(...r){try{return o.apply(this,r)}catch(d){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"))return!1;throw d}}};customElements.define=y(customElements.define),Promise.resolve().then(()=>require("./LoyaltyPointsCard-njx77PMq.cjs")).then(o=>o.LoyaltyPointsCard_ce).then(o=>{const r=o.default||o;customElements.get("loyalty-points-card")||customElements.define("loyalty-points-card",r.element||r)}).catch(o=>{console.error("BOOT ERROR:",o)})}const W={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"}},Y="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 Q=e.from_html('<img class="loyalty-shop-item__image"/>'),X=e.from_html('<div class="loyalty-shop-item__card loyalty-shop-item__card--description"><p class="loyalty-shop-item__description"> </p></div>'),$=e.from_html('<div class="loyalty-shop-item"><div class="loyalty-shop-item__card"><!> <span class="loyalty-shop-item__title"> </span> <span class="loyalty-shop-item__points"> </span> <button class="loyalty-shop-item__button" type="button"> </button></div> <!> <!></div>');const ee={hash:"svelte-ravnpu",code:`.loyalty-shop-item {display:flex;flex-direction:column;gap:12px;}.loyalty-shop-item__card {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 {min-height:120px;}.loyalty-shop-item__image {width:100%;height:170px;border-radius:6px;}.loyalty-shop-item__title {color:var(--text-default, #ffffff);font-size:12px;font-weight:400;}.loyalty-shop-item__points {color:var(--text-subtle, #dfe3e8);font-size:14px;font-weight:400;}.loyalty-shop-item__button {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:disabled {opacity:0.4;cursor:default;}.loyalty-shop-item__description {color:var(--text-subtle, #dfe3e8);font-size:12px;line-height:1.4;margin:0;font-weight:500;min-height:120px;}
1
+ var M=(y,o,r)=>new Promise((d,g)=>{var c=l=>{try{p(r.next(l))}catch(s){g(s)}},u=l=>{try{p(r.throw(l))}catch(s){g(s)}},p=l=>l.done?d(l.value):Promise.resolve(l.value).then(c,u);p((r=r.apply(y,o)).next())});typeof globalThis.HTMLElement=="undefined"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const e=require("./LoyaltyPagination-BpErkHgK.cjs"),K=require("./LoyaltyPointsCard-C16D2R5K.cjs");if(typeof window!="undefined"){let y=function(o){return function(...r){try{return o.apply(this,r)}catch(d){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"))return!1;throw d}}};customElements.define=y(customElements.define),Promise.resolve().then(()=>require("./LoyaltyPointsCard-C16D2R5K.cjs")).then(o=>o.LoyaltyPointsCard_ce).then(o=>{const r=o.default||o;customElements.get("loyalty-points-card")||customElements.define("loyalty-points-card",r.element||r)}).catch(o=>{console.error("BOOT ERROR:",o)})}const W={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"}},Y="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 Q=e.from_html('<img class="loyalty-shop-item__image"/>'),X=e.from_html('<div class="loyalty-shop-item__card loyalty-shop-item__card--description"><p class="loyalty-shop-item__description"> </p></div>'),$=e.from_html('<div class="loyalty-shop-item"><div class="loyalty-shop-item__card"><!> <span class="loyalty-shop-item__title"> </span> <span class="loyalty-shop-item__points"> </span> <button class="loyalty-shop-item__button" type="button"> </button></div> <!> <!></div>');const ee={hash:"svelte-ravnpu",code:`.loyalty-shop-item {display:flex;flex-direction:column;gap:12px;}.loyalty-shop-item__card {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 {min-height:120px;}.loyalty-shop-item__image {width:100%;height:170px;border-radius:6px;}.loyalty-shop-item__title {color:var(--text-default, #ffffff);font-size:12px;font-weight:400;}.loyalty-shop-item__points {color:var(--text-subtle, #dfe3e8);font-size:14px;font-weight:400;}.loyalty-shop-item__button {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:disabled {opacity:0.4;cursor:default;}.loyalty-shop-item__description {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 {height:clamp(170px, 30vw, 400px);object-fit:cover;}
4
4
  }`};function S(y,o){e.push(o,!0),e.append_styles(y,ee);const r=()=>e.store_get(e.$format,"$_",d),[d,g]=e.setup_stores(),c=e.prop(o,"apiEndpoint",7,""),u=e.prop(o,"userSession",7,""),p=e.prop(o,"locale",7,""),l=e.prop(o,"itemId",7,""),s=e.prop(o,"elevateReward"),b=e.prop(o,"translationUrl");e.setupI18n({withLocale:p(),translations:{}}),Object.entries(W).forEach(([t,n])=>{e.addNewMessages(t,n)});let i=e.state(e.proxy(s())),v=e.state(!1),E=e.state("");const k=e.user_derived(()=>{var t,n,a,m;return(m=(a=(n=(t=e.get(i))==null?void 0:t.presentation)==null?void 0:n.assets)==null?void 0:a[0])!=null?m:""}),R=e.user_derived(()=>{var t,n,a,m,_;return(_=(m=(n=(t=e.get(i))==null?void 0:t.presentation)==null?void 0:n.displayName)!=null?m:(a=e.get(i))==null?void 0:a.displayName)!=null?_:""}),I=e.user_derived(()=>{var t,n,a;return(a=(n=(t=e.get(i))==null?void 0:t.presentation)==null?void 0:n.description)!=null?a:""}),N=e.user_derived(()=>{var t;return((t=e.get(i))==null?void 0:t.available)==="true"}),P=()=>{let t=new URL(b(),window.location.href);fetch(t.href).then(n=>n.json()).then(n=>{Object.keys(n).forEach(a=>{e.addNewMessages(a,n[a])})}).catch(n=>{console.log("loyalty shop item translation url err:",n)})};e.user_pre_effect(()=>{b()&&P()}),e.user_effect(()=>{if(s()){e.set(i,s(),!0);return}if(!c()||!l())return;let t=!1;return e.fetchShopItem({apiEndpoint:c(),userSession:u(),locale:p()},l()).then(n=>{t||e.set(i,n,!0)}).catch(n=>console.error("Failed to load shop item:",n)),()=>{t=!0}});const z=()=>{e.get(v)||!e.get(N)||!e.get(i)||e.sendRedeemRewardRequested(e.get(i).displayName||e.get(i).presentation.displayName,e.get(i).id)},V=()=>M(this,null,function*(){var n;if(!c()||!e.get(i)||e.get(v))return;e.set(v,!0),e.set(E,"");const t=e.get(i).id;try{yield e.redeemReward({apiEndpoint:c(),userSession:u()},t),e.sendRedeemRewardSuccess(t),e.dispatchRedeemRewardButton()}catch(a){e.set(E,(n=a==null?void 0:a.message)!=null?n:"Redeem failed",!0),e.sendRedeemRewardFailed(t,a)}finally{e.set(v,!1)}});e.user_effect(()=>{const t=n=>{var a,m,_;((a=n.data)==null?void 0:a.type)===e.EVENT_TYPES.REDEEM_REWARD_CONFIRMED&&((m=n.data)==null?void 0:m.id)===((_=e.get(i))==null?void 0:_.id)&&V()};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)});var j={get apiEndpoint(){return c()},set apiEndpoint(t=""){c(t),e.flushSync()},get userSession(){return u()},set userSession(t=""){u(t),e.flushSync()},get locale(){return p()},set locale(t=""){p(t),e.flushSync()},get itemId(){return l()},set itemId(t=""){l(t),e.flushSync()},get elevateReward(){return s()},set elevateReward(t){s(t),e.flushSync()},get translationUrl(){return b()},set translationUrl(t){b(t),e.flushSync()}},T=e.comment(),D=e.first_child(T);{var A=t=>{var n=$(),a=e.child(n),m=e.child(a);{var _=h=>{var f=Q();e.template_effect(()=>{e.set_attribute(f,"src",e.get(k)||Y),e.set_attribute(f,"alt",e.get(R))}),e.append(h,f)};e.if_block(m,h=>{e.get(k)&&h(_)})}var L=e.sibling(m,2),H=e.only_child(L,!0),C=e.sibling(L,2),q=e.only_child(C),x=e.sibling(C,2),Z=e.only_child(x,!0);e.reset(a);var U=e.sibling(a,2);K.LoyaltyPointsCard(U,{get apiEndpoint(){return c()},get userSession(){return u()},get locale(){return p()}});var F=e.sibling(U,2);{var J=h=>{var f=X(),w=e.child(f),G=e.only_child(w,!0);e.reset(f),e.template_effect(()=>e.set_text(G,e.get(I))),e.append(h,f)};e.if_block(F,h=>{e.get(I)&&h(J)})}e.reset(n),e.template_effect((h,f)=>{var w;e.set_text(H,e.get(R)),e.set_text(q,`${(w=e.get(i).points)!=null?w:""}
@@ -1,5 +1,5 @@
1
- import { z as me, c as G, p as K, a as fe, b as r, s as he, d as Z, A as N, B as ye, C as ge, E as J, F as _, G as _e, H as ve, 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-CyjgdUPo.js";
2
- import { L as Ce } from "./LoyaltyPointsCard-DTOQlcMH.js";
1
+ import { z as me, c as G, p as K, a as fe, b as r, s as he, d as Z, A as N, B as ye, C as ge, E as J, F as _, G as _e, H as ve, 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-BP3AxeDj.js";
2
+ import { L as Ce } from "./LoyaltyPointsCard-Dz8Tgtc6.js";
3
3
  typeof globalThis.HTMLElement > "u" && (globalThis.HTMLElement = class {
4
4
  }, globalThis.customElements = { define() {
5
5
  }, get() {
@@ -17,7 +17,7 @@ if (typeof window < "u") {
17
17
  }
18
18
  };
19
19
  };
20
- customElements.define = h(customElements.define), import("./LoyaltyPointsCard-DTOQlcMH.js").then((a) => a.a).then((a) => {
20
+ customElements.define = h(customElements.define), import("./LoyaltyPointsCard-Dz8Tgtc6.js").then((a) => a.a).then((a) => {
21
21
  const l = a.default || a;
22
22
  customElements.get("loyalty-points-card") || customElements.define("loyalty-points-card", l.element || l);
23
23
  }).catch((a) => {
@@ -14,8 +14,8 @@ var q = (_, a, r) => new Promise((d, v) => {
14
14
  }, u = (l) => l.done ? d(l.value) : Promise.resolve(l.value).then(c, f);
15
15
  u((r = r.apply(_, a)).next());
16
16
  });
17
- import { z as fe, c as Y, p as Q, a as he, b as p, s as ye, d as G, A as C, B as ge, C as _e, E as K, F as b, G as ve, 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-Cw2snZwZ.js";
18
- import { L as Ue } from "./LoyaltyPointsCard-CFk3DpjI.js";
17
+ import { z as fe, c as Y, p as Q, a as he, b as p, s as ye, d as G, A as C, B as ge, C as _e, E as K, F as b, G as ve, 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-BNBJcXKk.js";
18
+ import { L as Ue } from "./LoyaltyPointsCard-DmE0ayL6.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 = _(customElements.define), import("./LoyaltyPointsCard-CFk3DpjI.js").then((a) => a.a).then((a) => {
36
+ customElements.define = _(customElements.define), import("./LoyaltyPointsCard-DmE0ayL6.js").then((a) => a.a).then((a) => {
37
37
  const r = a.default || a;
38
38
  customElements.get("loyalty-points-card") || customElements.define("loyalty-points-card", r.element || r);
39
39
  }).catch((a) => {
@@ -1,4 +1,4 @@
1
- typeof globalThis.HTMLElement>"u"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const e=require("./LoyaltyPagination-B7JqsoUi.cjs"),G=require("./LoyaltyPointsCard-Xb627em8.cjs");if(typeof window<"u"){let m=function(n){return function(...s){try{return n.apply(this,s)}catch(i){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"))return!1;throw i}}};customElements.define=m(customElements.define),Promise.resolve().then(()=>require("./LoyaltyPointsCard-Xb627em8.cjs")).then(n=>n.LoyaltyPointsCard_ce).then(n=>{const s=n.default||n;customElements.get("loyalty-points-card")||customElements.define("loyalty-points-card",s.element||s)}).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"/>'),Q=e.from_html('<div class="loyalty-shop-item__card loyalty-shop-item__card--description"><p class="loyalty-shop-item__description"> </p></div>'),X=e.from_html('<div class="loyalty-shop-item"><div class="loyalty-shop-item__card"><!> <span class="loyalty-shop-item__title"> </span> <span class="loyalty-shop-item__points"> </span> <button class="loyalty-shop-item__button" type="button"> </button></div> <!> <!></div>');const $={hash:"svelte-ravnpu",code:`.loyalty-shop-item {display:flex;flex-direction:column;gap:12px;}.loyalty-shop-item__card {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 {min-height:120px;}.loyalty-shop-item__image {width:100%;height:170px;border-radius:6px;}.loyalty-shop-item__title {color:var(--text-default, #ffffff);font-size:12px;font-weight:400;}.loyalty-shop-item__points {color:var(--text-subtle, #dfe3e8);font-size:14px;font-weight:400;}.loyalty-shop-item__button {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:disabled {opacity:0.4;cursor:default;}.loyalty-shop-item__description {color:var(--text-subtle, #dfe3e8);font-size:12px;line-height:1.4;margin:0;font-weight:500;min-height:120px;}
1
+ typeof globalThis.HTMLElement>"u"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const e=require("./LoyaltyPagination-CnoIs1uw.cjs"),G=require("./LoyaltyPointsCard-C5qTjR-v.cjs");if(typeof window<"u"){let m=function(n){return function(...s){try{return n.apply(this,s)}catch(i){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"))return!1;throw i}}};customElements.define=m(customElements.define),Promise.resolve().then(()=>require("./LoyaltyPointsCard-C5qTjR-v.cjs")).then(n=>n.LoyaltyPointsCard_ce).then(n=>{const s=n.default||n;customElements.get("loyalty-points-card")||customElements.define("loyalty-points-card",s.element||s)}).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"/>'),Q=e.from_html('<div class="loyalty-shop-item__card loyalty-shop-item__card--description"><p class="loyalty-shop-item__description"> </p></div>'),X=e.from_html('<div class="loyalty-shop-item"><div class="loyalty-shop-item__card"><!> <span class="loyalty-shop-item__title"> </span> <span class="loyalty-shop-item__points"> </span> <button class="loyalty-shop-item__button" type="button"> </button></div> <!> <!></div>');const $={hash:"svelte-ravnpu",code:`.loyalty-shop-item {display:flex;flex-direction:column;gap:12px;}.loyalty-shop-item__card {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 {min-height:120px;}.loyalty-shop-item__image {width:100%;height:170px;border-radius:6px;}.loyalty-shop-item__title {color:var(--text-default, #ffffff);font-size:12px;font-weight:400;}.loyalty-shop-item__points {color:var(--text-subtle, #dfe3e8);font-size:14px;font-weight:400;}.loyalty-shop-item__button {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:disabled {opacity:0.4;cursor:default;}.loyalty-shop-item__description {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 {height:clamp(170px, 30vw, 400px);object-fit:cover;}
4
4
  }`};function b(m,n){e.push(n,!0),e.append_styles(m,$);const s=()=>e.store_get(e.$format,"$_",i),[i,y]=e.setup_stores(),l=e.prop(n,"apiEndpoint",7,""),d=e.prop(n,"userSession",7,""),c=e.prop(n,"locale",7,""),h=e.prop(n,"itemId",7,""),a=e.prop(n,"elevateReward"),_=e.prop(n,"translationUrl");e.setupI18n({withLocale:c(),translations:{}}),Object.entries(K).forEach(([t,o])=>{e.addNewMessages(t,o)});let r=e.state(e.proxy(a())),g=e.state(!1),w=e.state("");const x=e.user_derived(()=>e.get(r)?.presentation?.assets?.[0]??""),S=e.user_derived(()=>e.get(r)?.presentation?.displayName??e.get(r)?.displayName??""),E=e.user_derived(()=>e.get(r)?.presentation?.description??""),k=e.user_derived(()=>e.get(r)?.available==="true"),U=()=>{let t=new URL(_(),window.location.href);fetch(t.href).then(o=>o.json()).then(o=>{Object.keys(o).forEach(f=>{e.addNewMessages(f,o[f])})}).catch(o=>{console.log("loyalty shop item translation url err:",o)})};e.user_pre_effect(()=>{_()&&U()}),e.user_effect(()=>{if(a()){e.set(r,a(),!0);return}if(!l()||!h())return;let t=!1;return e.fetchShopItem({apiEndpoint:l(),userSession:d(),locale:c()},h()).then(o=>{t||e.set(r,o,!0)}).catch(o=>console.error("Failed to load shop item:",o)),()=>{t=!0}});const M=()=>{e.get(g)||!e.get(k)||!e.get(r)||e.sendRedeemRewardRequested(e.get(r).displayName||e.get(r).presentation.displayName,e.get(r).id)},O=async()=>{if(!l()||!e.get(r)||e.get(g))return;e.set(g,!0),e.set(w,"");const t=e.get(r).id;try{await e.redeemReward({apiEndpoint:l(),userSession:d()},t),e.sendRedeemRewardSuccess(t),e.dispatchRedeemRewardButton()}catch(o){e.set(w,o?.message??"Redeem failed",!0),e.sendRedeemRewardFailed(t,o)}finally{e.set(g,!1)}};e.user_effect(()=>{const t=o=>{o.data?.type===e.EVENT_TYPES.REDEEM_REWARD_CONFIRMED&&o.data?.id===e.get(r)?.id&&O()};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)});var P={get apiEndpoint(){return l()},set apiEndpoint(t=""){l(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 a()},set elevateReward(t){a(t),e.flushSync()},get translationUrl(){return _()},set translationUrl(t){_(t),e.flushSync()}},R=e.comment(),z=e.first_child(R);{var V=t=>{var o=X(),f=e.child(o),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),v=e.sibling(T,2),H=e.only_child(v,!0);e.reset(f);var L=e.sibling(f,2);G.LoyaltyPointsCard(L,{get apiEndpoint(){return l()},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(o),e.template_effect((p,u)=>{e.set_text(A,e.get(S)),e.set_text(B,`${e.get(r).points??""}
@@ -1 +1 @@
1
- typeof globalThis.HTMLElement=="undefined"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const s=require("../components/LoyaltyShop-D_Oyu_cp.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-D_Oyu_cp.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;
1
+ typeof globalThis.HTMLElement=="undefined"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const s=require("../components/LoyaltyShop-Bvon_isa.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-Bvon_isa.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;
@@ -1,4 +1,4 @@
1
- import { L as a } from "../components/LoyaltyShop-BKubFlFr.js";
1
+ import { L as a } from "../components/LoyaltyShop-BR3Bcw_U.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-BKubFlFr.js").then((e) => e.a).then((e) => {
19
+ customElements.define = s(customElements.define), import("../components/LoyaltyShop-BR3Bcw_U.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) => {
@@ -1 +1 @@
1
- typeof globalThis.HTMLElement>"u"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const s=require("../components/LoyaltyShop-8d3N_F-0.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-8d3N_F-0.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;
1
+ typeof globalThis.HTMLElement>"u"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const s=require("../components/LoyaltyShop-C4Jmxgps.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-C4Jmxgps.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;
@@ -1,4 +1,4 @@
1
- import { L as a } from "../components/LoyaltyShop-Dfybp9ut.js";
1
+ import { L as a } from "../components/LoyaltyShop-FyZaT4Go.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-Dfybp9ut.js").then((e) => e.a).then((e) => {
19
+ customElements.define = s(customElements.define), import("../components/LoyaltyShop-FyZaT4Go.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/loyalty-shop",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "type": "module",
5
5
  "main": "./esnext/loyalty-shop.cjs",
6
6
  "module": "./esnext/loyalty-shop.js",