@everymatrix/casino-providers 1.0.16 → 1.1.0
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/dist/casino-providers.js
CHANGED
|
@@ -571,17 +571,17 @@ e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"}
|
|
|
571
571
|
***************************************************************************** */function Gt(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}const Dt={fallbackLocale:null,loadingDelay:200,formats:{number:{scientific:{notation:"scientific"},engineering:{notation:"engineering"},compactLong:{notation:"compact",compactDisplay:"long"},compactShort:{notation:"compact",compactDisplay:"short"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},warnOnMissingMessages:!0,handleMissingMessage:void 0,ignoreTag:!0};function $t(){return Dt}const Ft=$(!1);let kt;const xt=$(null);function jt(e){return e.split("-").map(((e,t,r)=>r.slice(0,t+1).join("-"))).reverse()}function Vt(e,t=$t().fallbackLocale){const r=jt(e);return t?[...new Set([...r,...jt(t)])]:r}function Xt(){return null!=kt?kt:void 0}xt.subscribe((e=>{kt=null!=e?e:void 0,"undefined"!=typeof window&&null!=e&&document.documentElement.setAttribute("lang",e)}));const Kt=Object.assign(Object.assign({},xt),{set:e=>{if(e&&function(e){if(null==e)return;const t=Vt(e);for(let e=0;e<t.length;e++){const r=t[e];if(Nt(r))return r}}(e)&&Mt(e)){const{loadingDelay:t}=$t();let r;return"undefined"!=typeof window&&null!=Xt()&&t?r=window.setTimeout((()=>Ft.set(!0)),t):Ft.set(!0),Ut(e).then((()=>{xt.set(e)})).finally((()=>{clearTimeout(r),Ft.set(!1)}))}return xt.set(e)}}),Yt=e=>{const t=Object.create(null);return r=>{const n=JSON.stringify(r);return n in t?t[n]:t[n]=e(r)}},zt=(e,t)=>{const{formats:r}=$t();if(e in r&&t in r[e])return r[e][t];throw new Error(`[svelte-i18n] Unknown "${t}" ${e} format.`)},Zt=Yt((e=>{var{locale:t,format:r}=e,n=Gt(e,["locale","format"]);if(null==t)throw new Error('[svelte-i18n] A "locale" must be set to format numbers');return r&&(n=zt("number",r)),new Intl.NumberFormat(t,n)})),Wt=Yt((e=>{var{locale:t,format:r}=e,n=Gt(e,["locale","format"]);if(null==t)throw new Error('[svelte-i18n] A "locale" must be set to format dates');return r?n=zt("date",r):0===Object.keys(n).length&&(n=zt("date","short")),new Intl.DateTimeFormat(t,n)})),Qt=Yt((e=>{var{locale:t,format:r}=e,n=Gt(e,["locale","format"]);if(null==t)throw new Error('[svelte-i18n] A "locale" must be set to format time values');return r?n=zt("time",r):0===Object.keys(n).length&&(n=zt("time","short")),new Intl.DateTimeFormat(t,n)})),Jt=Yt(((e,t=Xt())=>new Pt(e,t,$t().formats,{ignoreTag:$t().ignoreTag}))),qt=(e,t={})=>{var r,n,i,o;let s=t;"object"==typeof e&&(s=e,e=s.id);const{values:a,locale:l=Xt(),default:h}=s;if(null==l)throw new Error("[svelte-i18n] Cannot format a message without first setting the initial locale.");let u=At(e,l);if(u){if("string"!=typeof u)return console.warn(`[svelte-i18n] Message with id "${e}" must be of type "string", found: "${typeof u}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.`),u}else u=null!==(o=null!==(i=null===(n=(r=$t()).handleMissingMessage)||void 0===n?void 0:n.call(r,{locale:l,id:e,defaultValue:h}))&&void 0!==i?i:h)&&void 0!==o?o:e;if(!a)return u;let c=u;try{c=Jt(u,l).format(a)}catch(t){console.warn(`[svelte-i18n] Message "${e}" has syntax error:`,t.message)}return c},er=(e,t)=>((e={})=>{var{locale:t=Xt()}=e,r=Gt(e,["locale"]);return Qt(Object.assign({locale:t},r))})(t).format(e),tr=(e,t)=>((e={})=>{var{locale:t=Xt()}=e,r=Gt(e,["locale"]);return Wt(Object.assign({locale:t},r))})(t).format(e),rr=(e,t)=>((e={})=>{var{locale:t=Xt()}=e,r=Gt(e,["locale"]);return Zt(Object.assign({locale:t},r))})(t).format(e),nr=(e,t=Xt())=>At(e,t),ir=F([Kt,Lt],(()=>qt));function or(e,t){It(e,t)}
|
|
572
572
|
/* src/CasinoProviders.svelte generated by Svelte v3.48.0 */
|
|
573
573
|
function sr(e,t,r){const n=e.slice();return n[21]=t[r],n}function ar(e,t,r){const n=e.slice();return n[21]=t[r],n}
|
|
574
|
-
// (
|
|
574
|
+
// (78:4) {:else}
|
|
575
575
|
function lr(e){let t,r,n,i,o,s,a,l,h=/*$_*/e[4]("Translations.popularProviders")+"",b=/*$_*/e[4]("Translations.otherProviders")+"",v=/*topProviders*/e[1],T=[];for(let t=0;t<v.length;t+=1)T[t]=ur(ar(e,v,t));let H=/*otherProviders*/e[2],P=[];for(let t=0;t<H.length;t+=1)P[t]=cr(sr(e,H,t));return{c(){t=m("h4"),r=g(h),n=d();for(let e=0;e<T.length;e+=1)T[e].c();i=d(),o=m("h4"),s=g(b),a=d();for(let e=0;e<P.length;e+=1)P[e].c();l=g(""),E(t,"class","ProviderTitle"),E(o,"class","ProviderTitle")},m(e,h){c(e,t,h),u(t,r),c(e,n,h);for(let t=0;t<T.length;t+=1)T[t].m(e,h);c(e,i,h),c(e,o,h),u(o,s),c(e,a,h);for(let t=0;t<P.length;t+=1)P[t].m(e,h);c(e,l,h)},p(e,t){if(/*$_*/16&t&&h!==(h=/*$_*/e[4]("Translations.popularProviders")+"")&&y(r,h),/*openGameProviderPage, topProviders, $_*/50&t){let r;for(v=/*topProviders*/e[1],r=0;r<v.length;r+=1){const n=ar(e,v,r);T[r]?T[r].p(n,t):(T[r]=ur(n),T[r].c(),T[r].m(i.parentNode,i))}for(;r<T.length;r+=1)T[r].d(1);T.length=v.length}if(/*$_*/16&t&&b!==(b=/*$_*/e[4]("Translations.otherProviders")+"")&&y(s,b),/*openGameProviderPage, otherProviders, $_*/52&t){let r;for(H=/*otherProviders*/e[2],r=0;r<H.length;r+=1){const n=sr(e,H,r);P[r]?P[r].p(n,t):(P[r]=cr(n),P[r].c(),P[r].m(l.parentNode,l))}for(;r<P.length;r+=1)P[r].d(1);P.length=H.length}},d(e){e&&p(t),e&&p(n),f(T,e),e&&p(i),e&&p(o),e&&p(a),f(P,e),e&&p(l)}}}
|
|
576
|
-
// (
|
|
576
|
+
// (76:4) {#if isLoading === true}
|
|
577
577
|
function hr(e){let t,r,n=/*$_*/e[4]("Translations.loading")+"";return{c(){t=m("p"),r=g(n),E(t,"class","Message")},m(e,n){c(e,t,n),u(t,r)},p(e,t){/*$_*/16&t&&n!==(n=/*$_*/e[4]("Translations.loading")+"")&&y(r,n)},d(e){e&&p(t)}}}
|
|
578
|
-
// (
|
|
578
|
+
// (80:6) {#each topProviders as provider}
|
|
579
579
|
function ur(e){let t,r,n,i,o,s,a,h,f,v,T,H,P,_,B,A=/*provider*/e[21].name+"",S=/*provider*/e[21].games.count+"",L=/*$_*/e[4]("Translations.games")+"";function N(){/*click_handler*/
|
|
580
580
|
return e[12](/*provider*/e[21])}return{c(){t=m("div"),r=m("img"),o=d(),s=m("div"),a=m("p"),h=g(A),f=d(),v=m("p"),T=g(S),H=d(),P=g(L),l(r.src,n=/*provider*/e[21].logo)||E(r,"src",n),E(r,"alt",i=/*provider*/e[21].name),E(r,"class","ProviderImage"),E(s,"class","ProviderTextContainer"),E(t,"class","Provider")},m(e,n){c(e,t,n),u(t,r),u(t,o),u(t,s),u(s,a),u(a,h),u(s,f),u(s,v),u(v,T),u(v,H),u(v,P),_||(B=b(t,"click",N),_=!0)},p(t,o){e=t,/*topProviders*/2&o&&!l(r.src,n=/*provider*/e[21].logo)&&E(r,"src",n),/*topProviders*/2&o&&i!==(i=/*provider*/e[21].name)&&E(r,"alt",i),/*topProviders*/2&o&&A!==(A=/*provider*/e[21].name+"")&&y(h,A),/*topProviders*/2&o&&S!==(S=/*provider*/e[21].games.count+"")&&y(T,S),/*$_*/16&o&&L!==(L=/*$_*/e[4]("Translations.games")+"")&&y(P,L)},d(e){e&&p(t),_=!1,B()}}}
|
|
581
|
-
// (
|
|
581
|
+
// (90:6) {#each otherProviders as provider}
|
|
582
582
|
function cr(e){let t,r,n,i,o,s,a,h,f,v,T,H,P,_,B,A,S=/*provider*/e[21].name+"",L=/*provider*/e[21].games.count+"",N=/*$_*/e[4]("Translations.games")+"";function O(){/*click_handler_1*/
|
|
583
|
-
return e[13](/*provider*/e[21])}return{c(){t=m("div"),r=m("img"),o=d(),s=m("div"),a=m("p"),h=g(S),f=d(),v=m("p"),T=g(L),H=d(),P=g(N),_=d(),l(r.src,n=/*provider*/e[21].logo)||E(r,"src",n),E(r,"alt",i=/*provider*/e[21].name),E(r,"class","ProviderImage"),E(s,"class","ProviderTextContainer"),E(t,"class","Provider")},m(e,n){c(e,t,n),u(t,r),u(t,o),u(t,s),u(s,a),u(a,h),u(s,f),u(s,v),u(v,T),u(v,H),u(v,P),u(t,_),B||(A=b(t,"click",O),B=!0)},p(t,o){e=t,/*otherProviders*/4&o&&!l(r.src,n=/*provider*/e[21].logo)&&E(r,"src",n),/*otherProviders*/4&o&&i!==(i=/*provider*/e[21].name)&&E(r,"alt",i),/*otherProviders*/4&o&&S!==(S=/*provider*/e[21].name+"")&&y(h,S),/*otherProviders*/4&o&&L!==(L=/*provider*/e[21].games.count+"")&&y(T,L),/*$_*/16&o&&N!==(N=/*$_*/e[4]("Translations.games")+"")&&y(P,N)},d(e){e&&p(t),B=!1,A()}}}function pr(t){let r
|
|
584
|
-
return!0===e[3]?hr:lr}let
|
|
585
|
-
/*
|
|
586
|
-
/*
|
|
583
|
+
return e[13](/*provider*/e[21])}return{c(){t=m("div"),r=m("img"),o=d(),s=m("div"),a=m("p"),h=g(S),f=d(),v=m("p"),T=g(L),H=d(),P=g(N),_=d(),l(r.src,n=/*provider*/e[21].logo)||E(r,"src",n),E(r,"alt",i=/*provider*/e[21].name),E(r,"class","ProviderImage"),E(s,"class","ProviderTextContainer"),E(t,"class","Provider")},m(e,n){c(e,t,n),u(t,r),u(t,o),u(t,s),u(s,a),u(a,h),u(s,f),u(s,v),u(v,T),u(v,H),u(v,P),u(t,_),B||(A=b(t,"click",O),B=!0)},p(t,o){e=t,/*otherProviders*/4&o&&!l(r.src,n=/*provider*/e[21].logo)&&E(r,"src",n),/*otherProviders*/4&o&&i!==(i=/*provider*/e[21].name)&&E(r,"alt",i),/*otherProviders*/4&o&&S!==(S=/*provider*/e[21].name+"")&&y(h,S),/*otherProviders*/4&o&&L!==(L=/*provider*/e[21].games.count+"")&&y(T,L),/*$_*/16&o&&N!==(N=/*$_*/e[4]("Translations.games")+"")&&y(P,N)},d(e){e&&p(t),B=!1,A()}}}function pr(t){let r;function n(e,t){/*isLoading*/
|
|
584
|
+
return!0===e[3]?hr:lr}let i=n(t),o=i(t);return{c(){r=m("div"),o.c(),this.c=e,E(r,"class","CasinoProviders")},m(e,n){c(e,r,n),o.m(r,null),
|
|
585
|
+
/*div_binding*/t[14](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&&p(r),o.d(),
|
|
586
|
+
/*div_binding*/t[14](null)}}}function fr(e,t,r){let n;var i,o;i=ir,o=e=>r(4,n=e),e.$$.on_destroy.push(h(i,o));let s,{endpoint:a=""}=t,{datasource:l=""}=t,{lang:u="en"}=t,{clientstyling:c=""}=t,{clientstylingurl:p=""}=t,{translationUrl:f=""}=t,m=[],g=[],d=[],b=!1;Object.keys(G).forEach((e=>{or(e,G[e])}));const E=(e,t,r)=>{window.postMessage({type:"OpenGameProvider",providerId:e,providerName:t,providerLogo:r})},y=()=>{var e;e=u,Kt.set(e)};return e.$$set=e=>{"endpoint"in e&&r(6,a=e.endpoint),"datasource"in e&&r(7,l=e.datasource),"lang"in e&&r(8,u=e.lang),"clientstyling"in e&&r(9,c=e.clientstyling),"clientstylingurl"in e&&r(10,p=e.clientstylingurl),"translationUrl"in e&&r(11,f=e.translationUrl)},e.$$.update=()=>{/*endpoint, lang, datasource*/448&e.$$.dirty&&a&&u&&l&&(()=>{r(3,b=!0);const e=new URL(`${a}/casino/vendors`);e.searchParams.append("datasource",l),e.searchParams.append("language",u),e.searchParams.append("fields","id,name,displayName,subVendors,isTopVendor,logo,games"),fetch(e).then((e=>e.json())).then((e=>{r(3,b=!1),m=e.items.map((e=>e)),r(1,g=m.filter((e=>!0===e.isTopVendor))),r(2,d=m.filter((e=>!1===e.isTopVendor)));let t=[];t=m.flatMap((e=>e.subVendors)),d.push(...t.filter((e=>e.games.count>0)))}))})(),/*lang*/256&e.$$.dirty&&u&&y(),/*translationUrl*/2048&e.$$.dirty&&f&&fetch(f).then((e=>e.json())).then((e=>{Object.keys(e).forEach((t=>{or(t,e[t])}))})).catch((e=>{console.log(e)})),/*clientstyling, customStylingContainer*/513&e.$$.dirty&&c&&s&&(()=>{let e=document.createElement("style");e.innerHTML=c,s.appendChild(e)})(),/*clientstylingurl, customStylingContainer*/1025&e.$$.dirty&&p&&s&&(()=>{let e=new URL(p),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{s.appendChild(t)}),1)}))})()},[s,g,d,b,n,E,a,l,u,c,p,f,e=>E(e.id,e.name,e.logo),e=>E(e.id,e.name,e.logo),function(e){P[e?"unshift":"push"]((()=>{s=e,r(0,s)}))}]}F([Kt],(()=>er)),F([Kt],(()=>tr)),F([Kt],(()=>rr)),F([Kt,Lt],(()=>nr));class mr extends U{constructor(e){super(),this.shadowRoot.innerHTML="<style>:host{font-family:system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'}*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}.CasinoProviders{display:flex;flex-direction:column;gap:1rem;padding:10px 60px}.ProviderTitle{font-weight:500;position:relative;right:30px;margin:10px 0}.Provider{border-radius:7px;display:flex;align-items:center;gap:16px;max-width:300px}.ProviderTextContainer{display:flex;flex-direction:column;justify-content:center;gap:10px;font-size:15px}.ProviderTextContainer p:first-child{font-weight:600}.ProviderTextContainer p:last-child{color:#828282;font-weight:300}.ProviderImage{border-radius:4px;object-fit:contain;height:64px;width:64px;font-weight:100;border:.5px solid #e4e2e2;overflow:hidden;object-fit:contain}.Message{font-weight:600;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}</style>",R(this,{target:this.shadowRoot,props:v(this.attributes),customElement:!0},fr,pr,o,{endpoint:6,datasource:7,lang:8,clientstyling:9,clientstylingurl:10,translationUrl:11},null),e&&(e.target&&c(e.target,this,e.anchor),e.props&&(this.$set(e.props),I()))}static get observedAttributes(){return["endpoint","datasource","lang","clientstyling","clientstylingurl","translationUrl"]}get endpoint(){return this.$$.ctx[6]}set endpoint(e){this.$$set({endpoint:e}),I()}get datasource(){return this.$$.ctx[7]}set datasource(e){this.$$set({datasource:e}),I()}get lang(){return this.$$.ctx[8]}set lang(e){this.$$set({lang:e}),I()}get clientstyling(){return this.$$.ctx[9]}set clientstyling(e){this.$$set({clientstyling:e}),I()}get clientstylingurl(){return this.$$.ctx[10]}set clientstylingurl(e){this.$$set({clientstylingurl:e}),I()}get translationUrl(){return this.$$.ctx[11]}set translationUrl(e){this.$$set({translationUrl:e}),I()}}return!customElements.get("casino-providers")&&customElements.define("casino-providers",mr),mr}));
|
|
587
587
|
//# sourceMappingURL=casino-providers.js.map
|