@everymatrix/casino-categories 1.13.16 → 1.13.18

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.
@@ -584,7 +584,7 @@ function ur(e){let t,r,n,i,o,s,a,c,p,v,T,H,_,C,B,A,L,S=/*category*/e[24].name+""
584
584
  return e[15](/*category*/e[24])}return{c(){t=g("div"),r=g("img"),o=d(),s=g("div"),a=g("p"),c=m(S),p=d(),v=g("p"),T=m(P),H=d(),_=m(N),C=d(),h(r.src,n=/*category*/e[24].icon)||y(r,"src",n),y(r,"alt",i=/*category*/e[24].name),y(r,"class","CategoryImage"),y(s,"class","CategoryTextContainer"),y(t,"class",B="Category "+(/*activecategory*/e[0]===/*category*/e[24].id?"Active":""))},m(e,n){u(e,t,n),l(t,r),l(t,o),l(t,s),l(s,a),l(a,c),l(s,p),l(s,v),l(v,T),l(v,H),l(v,_),l(t,C),A||(L=E(t,"click",w),A=!0)},p(o,s){e=o,/*otherCategories*/16&s&&!h(r.src,n=/*category*/e[24].icon)&&y(r,"src",n),/*otherCategories*/16&s&&i!==(i=/*category*/e[24].name)&&y(r,"alt",i),/*otherCategories*/16&s&&S!==(S=/*category*/e[24].name+"")&&b(c,S),/*otherCategories*/16&s&&P!==(P=/*category*/e[24].games.count+"")&&b(T,P),/*$_*/32&s&&N!==(N=/*$_*/e[5]("games")+"")&&b(_,N),/*activecategory, otherCategories*/17&s&&B!==(B="Category "+(/*activecategory*/e[0]===/*category*/e[24].id?"Active":""))&&y(t,"class",B)},d(e){e&&f(t),A=!1,L()}}}function fr(t){let r;function n(e,t){/*isLoading*/
585
585
  return e[2]?cr:hr}let i=n(t),o=i(t);return{c(){r=g("div"),o.c(),this.c=e},m(e,n){u(e,r,n),o.m(r,null),
586
586
  /*div_binding*/t[16](r)},p(e,[t]){i===(i=n(e))&&o?o.p(e,t):(o.d(1),o=i(e),o&&(o.c(),o.m(r,null)))},i:e,o:e,d(e){e&&f(r),o.d(),
587
- /*div_binding*/t[16](null)}}}function pr(e,t,r){let n;var i,o;i=nr,o=e=>r(5,n=e),e.$$.on_destroy.push(c(i,o));let s,{endpoint:a=""}=t,{datasource:h=""}=t,{lang:l="en"}=t,{activecategory:u=""}=t,{excludedflags:f=""}=t,{clientstyling:p=""}=t,{clientstylingurl:g=""}=t,{translationurl:m=""}=t,d=!1;const E=[];let y=[],b=[];Object.keys(or).forEach((e=>{ir(e,or[e])}));const v=e=>{window.postMessage({type:"OpenGameCategory",categoryId:e})},T=()=>{var e;e=l,Xt.set(e)};return e.$$set=e=>{"endpoint"in e&&r(7,a=e.endpoint),"datasource"in e&&r(8,h=e.datasource),"lang"in e&&r(9,l=e.lang),"activecategory"in e&&r(0,u=e.activecategory),"excludedflags"in e&&r(10,f=e.excludedflags),"clientstyling"in e&&r(11,p=e.clientstyling),"clientstylingurl"in e&&r(12,g=e.clientstylingurl),"translationurl"in e&&r(13,m=e.translationurl)},e.$$.update=()=>{/*endpoint, datasource*/384&e.$$.dirty&&a&&h&&(()=>{r(2,d=!0);const e=new URL(`${a}/casino/groups/${h}`);e.searchParams.append("language",l),fetch(e).then((e=>e.json())).then((e=>{r(2,d=!1);const t=f.split(",").map((e=>e.trim()));E.push(...e.items);
587
+ /*div_binding*/t[16](null)}}}function pr(e,t,r){let n;var i,o;i=nr,o=e=>r(5,n=e),e.$$.on_destroy.push(c(i,o));let s,{endpoint:a=""}=t,{datasource:h=""}=t,{lang:l="en"}=t,{activecategory:u=""}=t,{excludedflags:f=""}=t,{clientstyling:p=""}=t,{clientstylingurl:g=""}=t,{translationurl:m=""}=t,d=!1;const E=[];let y=[],b=[];Object.keys(or).forEach((e=>{ir(e,or[e])}));const v=e=>{window.postMessage({type:"OpenGameCategory",categoryId:e},window.location.href)},T=()=>{var e;e=l,Xt.set(e)};return e.$$set=e=>{"endpoint"in e&&r(7,a=e.endpoint),"datasource"in e&&r(8,h=e.datasource),"lang"in e&&r(9,l=e.lang),"activecategory"in e&&r(0,u=e.activecategory),"excludedflags"in e&&r(10,f=e.excludedflags),"clientstyling"in e&&r(11,p=e.clientstyling),"clientstylingurl"in e&&r(12,g=e.clientstylingurl),"translationurl"in e&&r(13,m=e.translationurl)},e.$$.update=()=>{/*endpoint, datasource*/384&e.$$.dirty&&a&&h&&(()=>{r(2,d=!0);const e=new URL(`${a}/casino/groups/${h}`);e.searchParams.append("language",l),fetch(e).then((e=>e.json())).then((e=>{r(2,d=!1);const t=f.split(",").map((e=>e.trim()));E.push(...e.items);
588
588
  // remove those items which have a flag matching the excluded flags
589
589
  const n=E.filter((e=>!t.some((t=>{var r;return(null===(r=e.flags)||void 0===r?void 0:r.indexOf(t))>=0}))));r(3,y=n.filter((e=>!0===e.isTopCategory))),r(4,b=n.filter((e=>!1===e.isTopCategory)))}))})(),/*translationurl*/8192&e.$$.dirty&&m&&fetch(m).then((e=>e.json())).then((e=>{Object.keys(e).forEach((t=>{ir(t,e[t])}))})).catch((e=>{console.log(e)})),/*lang*/512&e.$$.dirty&&l&&T(),/*clientstyling, customStylingContainer*/2050&e.$$.dirty&&p&&s&&(()=>{let e=document.createElement("style");e.innerHTML=p,s.appendChild(e)})(),/*clientstylingurl, customStylingContainer*/4098&e.$$.dirty&&g&&s&&(()=>{let e=new URL(g),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{s.appendChild(t)}),1),setTimeout((()=>{}),500)}))})()},[u,s,d,y,b,n,v,a,h,l,f,p,g,m,e=>v(e.id),e=>v(e.id),function(e){_[e?"unshift":"push"]((()=>{s=e,r(1,s)}))}]}class gr extends G{constructor(e){super();const t=document.createElement("style");t.textContent="*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}.CasinoCategories{display:flex;flex-direction:column;gap:1rem;padding:10px 60px}.CategoryTitle{font-weight:500;position:relative;right:30px;margin:10px 0;font-size:18px;color:var(--emfe-w-casino-typography, var(--emfe-w-color-white, #FFFFFF))}.Category{border-radius:7px;display:flex;align-items:center;gap:16px;max-width:300px}.Category.Active{box-shadow:15px 15px 30px var(--emfe-w-color-gray-100, #E6E6E6)}.CategoryTextContainer{display:flex;flex-direction:column;justify-content:center;gap:10px;font-size:15px;color:var(--emfe-w-casino-typography, var(--emfe-w-color-white, #FFFFFF))}.CategoryTextContainer p:first-child{font-weight:600;color:var(--emfe-w-casino-typography, var(--emfe-w-color-white, #FFFFFF))}.CategoryTextContainer p:last-child{color:var(--emfe-w-color-gray-150, #828282);font-weight:300}.CategoryImage{border-radius:4px;object-fit:cover;height:64px;width:64px;font-weight:100}.Message{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);font-weight:600}",this.shadowRoot.appendChild(t),U(this,{target:this.shadowRoot,props:v(this.attributes),customElement:!0},pr,fr,o,{endpoint:7,datasource:8,lang:9,activecategory:0,excludedflags:10,clientstyling:11,clientstylingurl:12,translationurl:13},null),e&&(e.target&&u(e.target,this,e.anchor),e.props&&(this.$set(e.props),w()))}static get observedAttributes(){return["endpoint","datasource","lang","activecategory","excludedflags","clientstyling","clientstylingurl","translationurl"]}get endpoint(){return this.$$.ctx[7]}set endpoint(e){this.$$set({endpoint:e}),w()}get datasource(){return this.$$.ctx[8]}set datasource(e){this.$$set({datasource:e}),w()}get lang(){return this.$$.ctx[9]}set lang(e){this.$$set({lang:e}),w()}get activecategory(){return this.$$.ctx[0]}set activecategory(e){this.$$set({activecategory:e}),w()}get excludedflags(){return this.$$.ctx[10]}set excludedflags(e){this.$$set({excludedflags:e}),w()}get clientstyling(){return this.$$.ctx[11]}set clientstyling(e){this.$$set({clientstyling:e}),w()}get clientstylingurl(){return this.$$.ctx[12]}set clientstylingurl(e){this.$$set({clientstylingurl:e}),w()}get translationurl(){return this.$$.ctx[13]}set translationurl(e){this.$$set({translationurl:e}),w()}}return!customElements.get("casino-categories")&&customElements.define("casino-categories",gr),gr}));
590
590
  //# sourceMappingURL=casino-categories.js.map