@livelike/embet 0.0.30 → 0.0.31
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/CHANGELOG.md +4 -1
- package/embet.cjs.js +8 -7
- package/embet.cjs.min.js +3 -3
- package/embet.esm.js +286 -286
- package/embet.esm.min.js +3 -3
- package/embet.umd.js +8 -7
- package/embet.umd.min.js +3 -3
- package/package.json +1 -1
package/embet.umd.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* emBET SDK Version 0.0.
|
|
1
|
+
/* emBET SDK Version 0.0.31 */
|
|
2
2
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).embet={})}(this,(function(e){"use strict";!function(){if(void 0===window.Reflect||void 0===window.customElements||window.customElements.polyfillWrapFlushCallback)return;const e=HTMLElement,t=function(){return Reflect.construct(e,[],this.constructor)};window.HTMLElement=t,HTMLElement.prototype=e.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,e)}();
|
|
3
3
|
/**
|
|
4
4
|
* @license
|
|
@@ -385,7 +385,7 @@ const Yo=(e,t)=>"method"===t.kind&&t.descriptor&&!("value"in t.descriptor)?Objec
|
|
|
385
385
|
* subject to an additional IP rights grant found at
|
|
386
386
|
* http://polymer.github.io/PATENTS.txt
|
|
387
387
|
*/
|
|
388
|
-
const rs=new WeakMap,os=(e=>(...t)=>{const n=e(...t);return fo.set(n,!0),n})((e=>t=>{const n=rs.get(t);if(void 0===e&&t instanceof So){if(void 0!==n||!rs.has(t)){const e=t.committer.name;t.committer.element.removeAttribute(e)}}else e!==n&&t.setValue(e);rs.set(t,e)})),ss=(()=>{let e=!1;return(t,n)=>{e||(customElements.get(t)?(e=!0,console.warn(`${t} has already been registered.`)):customElements.define(t,n))}})(),as=e=>t=>{ss(e,t)};const cs=(e,t)=>t&&t[e]?function(e){let t="";return e&&Object.keys(e).forEach((n=>{const i="fontColor"===n?"color":(e=>e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase())(n);t+=`${i}: ${e[n]};\n`})),t}(t[e]):"";const ls=["fontSize","lineHeight","paddingLeft","paddingRight","paddingTop","paddingBottom"],us={".widget-tagline":ls,"livelike-title":ls,"livelike-description":ls,".bet-details":ls,".footer-text":["fontSize","lineHeight","height","marginLeft","marginRight","marginTop","marginBottom"],".bet-button":["fontSize","lineHeight","paddingLeft","paddingRight","paddingTop","paddingBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],".dismiss-button":["lineHeight","top","right","height"],".dismiss-button svg":["height","width"],"livelike-image img":["height","paddingLeft"],"livelike-widget-body .option-container":["paddingLeft","paddingRight","paddingTop","paddingBottom"],"livelike-widget-footer":["paddingLeft","paddingRight","paddingTop","paddingBottom"],".footer-container":["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom"],".footer-sponsor":["lineHeight","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth","maxHeight"],".footer-sponsor img":["paddingLeft","paddingRight","paddingTop","paddingBottom"],"livelike-widget-header div.center":["paddingLeft","paddingRight","paddingTop","paddingBottom"],".live-total-text-options":["paddingLeft","paddingRight","paddingTop","paddingBottom"],"livelike-option:not(:last-child)":["marginLeft","marginRight","marginTop","marginBottom"],"livelike-option":["borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],"livelike-progress":["paddingLeft","paddingRight","paddingTop","paddingBottom"],".percentage-container":["fontSize","lineHeight","paddingRight"],".percentage-text":["fontSize","lineHeight"],"livelike-timer":["height"]};var ds=function(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};let hs=class extends is{constructor(){super(...arguments),this.start=()=>{const e=(new Date).getTime(),t=()=>{this.timeLeft=this.timeout-((new Date).getTime()-e);const n=100*(1-this.timeLeft/this.timeout);this.percent=n>100?100:n,void 0===this.value&&this.timeLeft>0&&"interactive"===this.owner.phase&&requestAnimationFrame(t)};t()}}createRenderRoot(){return this}firstUpdated(){if(void 0===this.value){this.start(),this.newTime=this.timeout/1e3;const e=setInterval((()=>{void 0===this.value?this.newTime-=1:this.newTime=this.timeout/1e3,0!==this.newTime&&void 0===this.value||clearInterval(e)}),1e3)}}render(){var e,t;const n=void 0!==this.value?this.value:this.percent,i=e=>{var t,n;return null===(n=null===(t=this.themeStyles)||void 0===t?void 0:t.roundTimer)||void 0===n?void 0:n[e]},r=i("background"),o=null===(t=null===(e=this.themeStyles)||void 0===e?void 0:e.header)||void 0===t?void 0:t.background,s=`conic-gradient(#58585896 ${n}%, ${r} ${n}%)`,a=this.newTime>0?"":"transparent",c=i("height")||30,l=c-2*i("barWidth"),u=l||0===l?l:24;return Io`<style>round-timer{position:absolute;margin:10px}.timer-container{position:relative;display:flex;justify-content:center;align-items:center}.progress-spinner{border-radius:50%;height:${c+"px"};width:${c+"px"};background:${s}}.middle-circle{position:absolute;border-radius:50%;height:${u+"px"};width:${u+"px"};background-color:${o};display:flex;align-items:center;justify-content:center;font-size:${i("fontSize")};font-weight:${i("fontWeight")};font-family:${i("fontFamily")};color:${i("color")};transition:color .5s ease}.middle-circle.transparent{color:transparent}</style><div class="timer-container"><div class="middle-circle ${a}">${this.newTime}</div><div class="progress-spinner"></div></div>`}};ds([Jo({type:Number})],hs.prototype,"timeout",void 0),ds([Jo({type:Number})],hs.prototype,"timeLeft",void 0),ds([Jo({type:Number})],hs.prototype,"newTime",void 0),ds([Jo({type:Number})],hs.prototype,"percent",void 0),ds([Jo({type:Number})],hs.prototype,"value",void 0),ds([Jo({type:Object})],hs.prototype,"owner",void 0),ds([Jo({type:Object})],hs.prototype,"themeStyles",void 0),hs=ds([as("round-timer")],hs);const ps=e=>class extends e{constructor(){super(...arguments),this.widgetPayload={id:""},this.allowDismiss=!0,this.timer="bar",this.updateThemeStyles=e=>{this.themeStyles=Object.assign(Object.assign({},this.themeStyles),e)},this.themeUpdated=e=>{this.requestUpdate()},this.parseCustomData=e=>{if(this.customDataParsed&&this.customDataParsed(e),!this.timeout&&e.timeout&&(this.timeout=e.timeout),!this.timer&&e.timer&&(this.timer=e.timer),this.placeBetUrl||(this.placeBetUrl=e.placeBetUrl),this.placeBetLabel||(this.placeBetLabel=e.placeBetLabel),this.legalLogoSrc||(this.legalLogoSrc=e.legalLogoSrc),this.sponsors=e.sponsors||this.widgetPayload.sponsors||[],e.theme&&e.theme.widgets){Wr.applyTheme(e.theme);const t=this.kind||this.widgetPayload.kind;!this.widgetPayload.kind&&(this.widgetPayload.kind=t),this.themeStyles=e.theme.widgets[t.split("-")[1]]}if(e.customCss){const t=document.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("href",e.customCss),this.appendChild(t)}var t,n,i,r;e.customStyles&&(this.customStyles=e.customStyles),e.resize&&(this.resizeObserver=new ResizeObserver((t=e.widgetWidthPercentage,n=e.parentContainer,i=e.parentFullscreenWidth,r=e.wrapperContainer,e=>e.forEach((e=>{var o,s;const a=e.target;if(a){const c=Number(i)||1920,l=(null===(o=document.querySelector(n))||void 0===o?void 0:o.offsetWidth)||document.body.offsetWidth,u=((null===(s=document.querySelector(r))||void 0===s?void 0:s.offsetWidth)||document.body.offsetWidth)/c,d=Math.round(e.contentRect.width),h=l/u*(Number(t)||1);Object.keys(us).forEach((e=>{us[e].forEach((t=>{a.querySelectorAll(e).forEach((e=>{const n=getComputedStyle(e)[t];if(n){const i=n.split(/^(-?[0-9]*.?[0-9]+)(.+)$/).filter((e=>0!==e.length)),r=Number(i[0]),o=i[1];if(r&&!isNaN(r)&&0!==r){e.dataset[t]||(e.dataset[t]=r.toFixed(2));const n=Number(e.dataset[t])*d/h;n>0&&(e.style[t]=n.toFixed(2).toString()+o)}}}))}))}))}})))),this.resizeObserver.observe(this))},this.widgetHeader=e=>{const t="round"===this.timer&&this.themeStyles?D`<round-timer .timeout="${this.customData.timeout||this.timeout}" .themeStyles="${this.themeStyles}" .owner="${this}"></round-timer>`:null;return D`<livelike-widget-header class="widget-header" slot="header">${t}<div class="center">${e.title} ${e.subTitle||""}</div>${function(e){const t=e.themeStyles&&e.themeStyles.dismiss&&e.themeStyles.dismiss.color,n=cs("dismiss",e.themeStyles),i=e.allowDismiss?e.widgetDismissClick:()=>null;return D`<style>.dismiss-button{background:0 0;border:none;position:absolute;top:12px;right:16px;${n}}.dismiss-button:hover{cursor:pointer}${e.customStyles}</style><button class="dismiss-button" @click="${i}"><svg height="18px" width="18px" viewBox="0 0 28 28"><polygon points="28,22.398 19.594,14 28,5.602 22.398,0 14,8.402 5.598,0 0,5.602 8.398,14 0,22.398 5.598,28 14,19.598 22.398,28" style="fill:${t||"#979797"}"/></svg></button>`}(this)}</livelike-widget-header>`},this.widgetFooter=()=>{const e=this.placeBetUrl||this.sponsors&&this.sponsors.length?function(e,t,n,i,r,o){var s;const a=cs("footer",n),c=cs("betButton",n),l=cs("sponsor",n);return D`<style>.embet-widget livelike-widget-footer{display:flex;flex-direction:column;border-radius:0;padding:10px 16px;${a}}.embet-widget livelike-widget-footer .bet-footer-row{display:flex;justify-content:center}.embet-widget .footer-container{width:50%;display:flex;flex-direction:column;justify-content:center;margin:5px;padding:5px}.embet-widget .footer-text{height:12px;text-align:center;font-size:12px;color:#999;white-space:nowrap;margin-bottom:10px}.embet-widget .footer-sponsor{object-fit:contain;box-sizing:border-box;width:100%;height:100%;padding:4px 10px;border:2px solid rgba(255,255,255,.2);max-height:40px;${l}}.embet-widget .footer-legal{max-height:40px}.embet-widget .bet-button{border-radius:3rem;padding:10px;white-space:nowrap;border-width:2px;border-style:solid;${c}}.embet-widget .bet-button:hover{cursor:pointer}.embet-widget .bet-button a{text-decoration:none;font-weight:700;color:inherit}${r}</style><livelike-widget-footer><div class="bet-footer-row">${(null===(s=null==i?void 0:i[0])||void 0===s?void 0:s.logo_url)?D`<div class="footer-container"><div class="footer-text">SPONSORED BY</div><img class="footer-sponsor" src="${i[0].logo_url}" alt="${i[0].name}"></div>`:null} ${e?D`<div class="footer-container"><div class="footer-text"></div><button class="bet-button"><a target="_blank" href="${e}">${t}</a></button></div>`:null}</div><div class="bet-footer-row">${o?D`<div class="footer-container"><img class="footer-legal" src="${o}"></div>`:null}</div></livelike-widget-footer>`}(this.placeBetUrl,this.placeBetLabel,this.themeStyles,this.sponsors,this.customStyles,this.legalLogoSrc):null,t="bar"===this.timer?D`<livelike-timer class="custom-timer"></livelike-timer>`:null;return D`${e}${t}`}}static get properties(){return{custom_data:{type:Object},sponsors:{type:Array},placeBetUrl:{type:String},placeBetLabel:{type:String},legalLogoSrc:{type:String},allowDismiss:{type:Boolean},themeStyles:{type:Object},customStyles:{type:String},timer:{type:String,reflect:!0},timeout:{type:Number,reflect:!0}}}connectedCallback(){super.connectedCallback(),!this.customData&&(this.customData=this.custom_data||this.widgetPayload.custom_data),this.customData&&this.parseCustomData(this.customData),document.addEventListener("livelike-theme-updated",this.themeUpdated)}disconnectedCallbck(){super.disconnectedCallback(),document.removeEventListener("livelike-theme-updated",this.themeUpdated)}firstUpdated(){super.firstUpdated(),this.updateComplete.then((()=>{const e=this.querySelector("livelike-widget-root");e.updateComplete.then((()=>{const t=e.shadowRoot.querySelector("livelike-widget-bylines");t&&t.remove();const n=e.shadowRoot.querySelector("livelike-widget-reactions");n&&n.remove()}))}))}};var fs=function(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};let gs=class extends(ps(Li)){render(){const e=this.text&&this.image_url&&D`<figure class="widget-captioned-media"><figcaption class="widget-caption media-caption">${this.text}</figcaption><img class="widget-media" src="${this.image_url}" alt="${this.text}"></figure>`,t=!this.text&&this.image_url&&D`<div class="widget-media"><img src="${this.image_url}"></div>`,n=this.text&&!this.image_url&&D`<div class="widget-caption-container"><span class="widget-caption">${this.text}</span></div>`;return this.link_url&&D`<livelike-footer><a class="widget-link" href="${this.link_url}" target="_blank">${this.link_label}</a></livelike-footer>`,D`<template><style>.widget-captioned-media,.widget-media{padding:16px}.widget-caption-container{text-align:center}${this.customStyles}</style><livelike-widget-root class="embet-widget">${this.widgetHeader({title:this.title})}<livelike-widget-body>${e||t||n||null} ${this.widgetFooter()}</livelike-widget-body></livelike-widget-root></template>`}};fs([Jo({type:String})],gs.prototype,"title",void 0),fs([Jo({type:String})],gs.prototype,"text",void 0),fs([Jo({type:String})],gs.prototype,"image_url",void 0),fs([Jo({type:String})],gs.prototype,"link_url",void 0),fs([Jo({type:String})],gs.prototype,"link_label",void 0),gs=fs([as("embet-alert")],gs);const ms=D`<style>.embet-widget livelike-widget-header{border-radius:0}.embet-widget livelike-widget-header .center{width:100%;text-align:center;padding-top:1rem}.embet-widget .widget-tagline{font-size:18px;font-weight:700;padding-bottom:10px;text-transform:uppercase}.embet-widget .widget-body-text{font-size:18px;padding:18px}.embet-widget livelike-title{text-align:center;text-transform:uppercase;font-weight:700;padding:0;display:block;width:100%}.embet-widget livelike-widget-body{border-radius:0}.embet-widget .option-container{padding:1rem;height:100%;align-items:stretch;display:flex;flex-direction:column}.embet-widget livelike-option{height:50%;border-width:2px;border-style:solid;border-radius:0;padding:0;box-shadow:5px 5px 10px 1px rgba(0,0,0,.2);align-items:unset;box-sizing:border-box}.embet-widget .option-container[interacted] livelike-option{background:rgba(50,50,50,.7);border:2px solid rgba(190,190,190,.7)}.embet-widget .option-container[interacted] livelike-option[selected]{border:2px solid rgba(0,250,0,.7)}.embet-widget livelike-option:not(:last-of-type){margin-bottom:1rem}.embet-widget livelike-option .option-image-wrap{display:flex;width:100%;position:relative;box-sizing:border-box}.embet-widget livelike-option .percentage-container{position:absolute;display:flex;transform:translate(-50%,-50%);top:50%;left:50%;white-space:nowrap}.embet-widget livelike-description{word-break:unset;align-self:center;padding:0 .5rem;text-align:initial}.embet-widget .bet-details{padding:0 .5rem;align-self:center}.embet-widget livelike-image img{padding-left:6px}.embet-widget livelike-percentage{padding:0 5px 0 0}.embet-widget livelike-progress{height:calc(100% + 1px);background:rgba(160,160,160,.7);border-radius:0;box-sizing:border-box}.embet-widget livelike-progress[selected]{background:rgba(0,225,0,.7)}.embet-widget .image-grid[interacted] .bet-details,.embet-widget .image-grid[interacted] img,.embet-widget .image-grid[interacted] livelike-description,.embet-widget .option-container[interacted] .bet-details,.embet-widget .option-container[interacted] livelike-description,[variation=bar] .embet-widget .option-container[interacted] livelike-image,[variation=square] .embet-widget .option-container[interacted] livelike-image{opacity:.2}.embet-widget livelike-timer{height:3px}[variation=inline] .embet-widget .option-container{flex-direction:row}[variation=inline] .embet-widget livelike-image img{padding-left:0}[variation=inline] .embet-widget .bet-details,[variation=inline] .embet-widget livelike-descrption{padding:8px}[variation=inline] .live-total-text-options{display:flex;flex-direction:column;width:100%;padding:0 10px}[variation=square] .embet-widget livelike-option:not(:last-of-type){margin-bottom:0}[variation=square] .embet-widget livelike-option{display:flex;flex-direction:column;justify-content:center}[variation=square] .image-grid{padding:16px;display:grid;grid-column-gap:8px;grid-row-gap:8px}[variation=square] .embet-widget .square-option-0,[variation=square] .embet-widget .square-option-1,[variation=square] .embet-widget .square-option-2,[variation=square] .embet-widget .square-option-3{height:100%;border:none;box-shadow:0 0 0 1px #c1c2ca;border-radius:6px;flex-grow:1;transition:all .2s ease}[variation=square] .embet-widget .square-option-0:after,[variation=square] .embet-widget .square-option-1:after,[variation=square] .embet-widget .square-option-2:after,[variation=square] .embet-widget .square-option-3:after{content:'';width:100%;height:100%;z-index:4;position:absolute;border-radius:6px;transition:all .2s ease}[variation=square] .image-bet-container{display:flex;padding-top:4px;font-size:16px!important;width:100%;justify-content:center}[variation=square] .percentage-container{z-index:5}[variation=square] livelike-description{font-size:16px;text-align:center;flex-grow:0;z-index:1}[variation=square] .bet-details{padding:4px}[variation=square] .image-bet-container.no-image{height:50px}[variation=bar] .option-image-wrap.no-image{height:40px}.animated-container{display:flex}.animated-wrapper{display:flex;flex-direction:column;width:100%}.animated-drawer{height:0;transition-property:height;transition-duration:.5s;transition-timing-function:ease-in-out}.animated-container.show .animated-drawer{height:100%}.animated-content{opacity:0;height:100%}.animated-container.show .animated-content{opacity:1;transition-property:opacity;transition-duration:.5s;transition-delay:.5s;transition-timing-function:ease}.embet-widget .insights{padding-bottom:16px}.insight-table{border-collapse:collapse;margin:0 auto}.insight-table tr[idx='0']{border-bottom:1px solid #ddd}.insight-table tr:not([idx='0']) td{padding:4px 16px}.insight-table td{text-align:center}.label-container{display:flex;justify-content:space-between;padding:4px 0 1px 0}.bar-container{display:flex}.bar-wrap{width:100%;background:grey}.bar-wrap.left{transform:rotate(180deg)}.progress-bar{height:3px}.progress-bar.left{background:orange}.progress-bar.right{background:#00f}</style>`;var vs=function(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};class ys extends(ps(Ei)){constructor(){super(...arguments),this.defaultVoteHide=!1,this.hideVoteInResults=!1,this.kind="image-prediction",this.widgetPayload={id:""},this.allowDismiss=!0,this.timer="bar",this.voteCallback=e=>{e.detail&&e.detail.item&&e.detail.item.id&&!this.voted&&(this.voted=!0)},this.customDataParsed=e=>{this.variation=e.widgetVariation||{"LIVE MONEYLINE":"bar","LIVE SPREAD":"square","LIVE TOTAL":"inline","LIVE AT BAT":"square","LIVE STATS ODDS":"square"}[e.type],this.animateBetContent(e.animationDelay)},this.animateBetContent=e=>{const t=void 0!==e?e:0;String(t)&&null!==t&&setTimeout((()=>{var e;return null===(e=this.querySelector(".animated-container"))||void 0===e?void 0:e.classList.add("show")}),t)}}connectedCallback(){super.connectedCallback(),this.addEventListener("interacted",this.voteCallback)}disconnectedCallbck(){super.disconnectedCallback(),this.removeEventListener("interacted",this.voteCallback)}firstUpdated(){super.firstUpdated(),this.widgetPayload.options&&(this.options=this.widgetPayload.options),this.updateComplete.then((()=>{const e=this.querySelector("livelike-widget-root");e.updateComplete.then((()=>{const t=e.shadowRoot.querySelector("livelike-widget-bylines");t&&t.remove();const n=e.shadowRoot.querySelector("livelike-widget-reactions");n&&n.remove()}))}))}render(){var e,t,n,i;const r=this.customData&&this.customData.type?D`<div class="widget-tagline">${this.customData.type}</div>`:null,o=this.customData&&this.customData.bodyText?D`<div class="widget-body-text">${this.customData.bodyText}</div>`:null,s=this.insightsRenderer?D`<div class="insights">${this.insightsRenderer(this.customData)}</div>`:null,a=null===(t=null===(e=this.themeStyles)||void 0===e?void 0:e.insights)||void 0===t?void 0:t.background,c=null===(i=null===(n=this.themeStyles)||void 0===n?void 0:n.animatedBet)||void 0===i?void 0:i.background,l="LIVE AT BAT"===this.customData.type||"LIVE STATS ODDS"===this.customData.type;return D`<template>${ms}<style>${this.customStyles}live-at-bat,live-moneyline,live-spread,live-stats-odds,live-total{display:block}.embet-widget{height:${this.customData&&this.customData.widgetHeight||"100%"}}.embet-widget .insights{background:${a}}.animated-drawer{background:${c}}</style><livelike-widget-root class="embet-widget">${this.widgetHeader({title:r,subTitle:o})} ${s}<div class="animated-container ${l?"":"show"}"><div class="animated-wrapper"><div class="animated-drawer"><div class="animated-content"><livelike-widget-body><livelike-title></livelike-title>${this.variation&&this.optionsRenderer(this.options,this.customData,this.voted,this.variation)} ${this.widgetFooter()}</livelike-widget-body></div></div></div></div></livelike-widget-root></template>`}}vs([Jo({type:Boolean})],ys.prototype,"voted",void 0),vs([Jo({type:Object})],ys.prototype,"customData",void 0),vs([Jo({type:Object})],ys.prototype,"custom_data",void 0),vs([Jo({type:Array})],ys.prototype,"sponsors",void 0),vs([Jo({type:String})],ys.prototype,"place_bet_url",void 0),vs([Jo({type:String})],ys.prototype,"placeBetUrl",void 0),vs([Jo({type:Boolean})],ys.prototype,"allowDismiss",void 0),vs([Jo({type:Object})],ys.prototype,"themeStyles",void 0),vs([Jo({type:String})],ys.prototype,"customStyles",void 0),vs([Jo({type:Array})],ys.prototype,"options",void 0),vs([Jo({type:String,reflect:!0})],ys.prototype,"variation",void 0),vs([Jo({type:String,reflect:!0})],ys.prototype,"timer",void 0),vs([Jo({type:Number,reflect:!0})],ys.prototype,"timeout",void 0);var bs=function(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};const ws=(e,t)=>{const n=e.reduce(((e,t)=>e+t.vote_count),0);return n>0?Math.round(t.vote_count/n*100):0},ks=(e,t)=>{if(e&&e.betDetails){const n=e.betDetails.find((e=>e.description===t.description));if(n)return D` <div class="bet-details">${n.bet}</div> `}},_s=(e,t,n)=>D`
|
|
388
|
+
const rs=new WeakMap,os=(e=>(...t)=>{const n=e(...t);return fo.set(n,!0),n})((e=>t=>{const n=rs.get(t);if(void 0===e&&t instanceof So){if(void 0!==n||!rs.has(t)){const e=t.committer.name;t.committer.element.removeAttribute(e)}}else e!==n&&t.setValue(e);rs.set(t,e)})),ss=(()=>{let e=!1;return(t,n)=>{e||(customElements.get(t)?(e=!0,console.warn(`${t} has already been registered.`)):customElements.define(t,n))}})(),as=e=>t=>{ss(e,t)};const cs=(e,t)=>t&&t[e]?function(e){let t="";return e&&Object.keys(e).forEach((n=>{const i="fontColor"===n?"color":(e=>e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase())(n);t+=`${i}: ${e[n]};\n`})),t}(t[e]):"";const ls=["fontSize","lineHeight","paddingLeft","paddingRight","paddingTop","paddingBottom"],us={".widget-tagline":ls,"livelike-title":ls,"livelike-description":ls,".bet-details":ls,".footer-text":["fontSize","lineHeight","height","marginLeft","marginRight","marginTop","marginBottom"],".bet-button":["fontSize","lineHeight","paddingLeft","paddingRight","paddingTop","paddingBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],".dismiss-button":["lineHeight","top","right","height"],".dismiss-button svg":["height","width"],"livelike-image img":["height","paddingLeft"],"livelike-widget-body .option-container":["paddingLeft","paddingRight","paddingTop","paddingBottom"],"livelike-widget-footer":["paddingLeft","paddingRight","paddingTop","paddingBottom"],".footer-container":["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom"],".footer-sponsor":["lineHeight","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth","maxHeight"],".footer-sponsor img":["paddingLeft","paddingRight","paddingTop","paddingBottom"],"livelike-widget-header div.center":["paddingLeft","paddingRight","paddingTop","paddingBottom"],".live-total-text-options":["paddingLeft","paddingRight","paddingTop","paddingBottom"],"livelike-option:not(:last-child)":["marginLeft","marginRight","marginTop","marginBottom"],"livelike-option":["borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],"livelike-progress":["paddingLeft","paddingRight","paddingTop","paddingBottom"],".percentage-container":["fontSize","lineHeight","paddingRight"],".percentage-text":["fontSize","lineHeight"],"livelike-timer":["height"]};var ds=function(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};let hs=class extends is{constructor(){super(...arguments),this.start=()=>{const e=(new Date).getTime(),t=()=>{this.timeLeft=this.timeout-((new Date).getTime()-e);const n=100*(1-this.timeLeft/this.timeout);this.percent=n>100?100:n,void 0===this.value&&this.timeLeft>0&&"interactive"===this.owner.phase&&requestAnimationFrame(t)};t()}}createRenderRoot(){return this}firstUpdated(){if(void 0===this.value){this.start(),this.newTime=this.timeout/1e3;const e=setInterval((()=>{void 0===this.value?this.newTime-=1:this.newTime=this.timeout/1e3,0!==this.newTime&&void 0===this.value||clearInterval(e)}),1e3)}}render(){var e,t;const n=void 0!==this.value?this.value:this.percent,i=e=>{var t,n;return null===(n=null===(t=this.themeStyles)||void 0===t?void 0:t.roundTimer)||void 0===n?void 0:n[e]},r=i("background"),o=null===(t=null===(e=this.themeStyles)||void 0===e?void 0:e.header)||void 0===t?void 0:t.background,s=`conic-gradient(#58585896 ${n}%, ${r} ${n}%)`,a=this.newTime>0?"":"transparent",c=i("height")||30,l=c-2*i("barWidth"),u=l||0===l?l:24;return Io`<style>round-timer{position:absolute;margin:10px}.timer-container{position:relative;display:flex;justify-content:center;align-items:center}.progress-spinner{border-radius:50%;height:${c+"px"};width:${c+"px"};background:${s}}.middle-circle{position:absolute;border-radius:50%;height:${u+"px"};width:${u+"px"};background-color:${o};display:flex;align-items:center;justify-content:center;font-size:${i("fontSize")};font-weight:${i("fontWeight")};font-family:${i("fontFamily")};color:${i("color")};transition:color .5s ease}.middle-circle.transparent{color:transparent}</style><div class="timer-container"><div class="middle-circle ${a}">${this.newTime}</div><div class="progress-spinner"></div></div>`}};ds([Jo({type:Number})],hs.prototype,"timeout",void 0),ds([Jo({type:Number})],hs.prototype,"timeLeft",void 0),ds([Jo({type:Number})],hs.prototype,"newTime",void 0),ds([Jo({type:Number})],hs.prototype,"percent",void 0),ds([Jo({type:Number})],hs.prototype,"value",void 0),ds([Jo({type:Object})],hs.prototype,"owner",void 0),ds([Jo({type:Object})],hs.prototype,"themeStyles",void 0),hs=ds([as("round-timer")],hs);const ps=e=>class extends e{constructor(){super(...arguments),this.widgetPayload={id:""},this.allowDismiss=!0,this.timer="bar",this.updateThemeStyles=e=>{this.themeStyles=Object.assign(Object.assign({},this.themeStyles),e)},this.themeUpdated=e=>{this.requestUpdate()},this.parseCustomData=e=>{if(this.customDataParsed&&this.customDataParsed(e),!this.timeout&&e.timeout&&(this.timeout=e.timeout),!this.timer&&e.timer&&(this.timer=e.timer),this.placeBetUrl||(this.placeBetUrl=e.placeBetUrl),this.placeBetLabel||(this.placeBetLabel=e.placeBetLabel),this.legalLogoSrc||(this.legalLogoSrc=e.legalLogoSrc),this.sponsors=e.sponsors||this.widgetPayload.sponsors||[],e.theme&&e.theme.widgets){Wr.applyTheme(e.theme);const t=this.kind||this.widgetPayload.kind;!this.widgetPayload.kind&&(this.widgetPayload.kind=t),this.themeStyles=e.theme.widgets[t.split("-")[1]]}if(e.customCss){const t=document.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("href",e.customCss),this.appendChild(t)}var t,n,i,r;e.customStyles&&(this.customStyles=e.customStyles),e.resize&&(this.resizeObserver=new ResizeObserver((t=e.widgetWidthPercentage,n=e.parentContainer,i=e.parentFullscreenWidth,r=e.wrapperContainer,e=>e.forEach((e=>{var o,s;const a=e.target;if(a){const c=Number(i)||1920,l=(null===(o=document.querySelector(n))||void 0===o?void 0:o.offsetWidth)||document.body.offsetWidth,u=((null===(s=document.querySelector(r))||void 0===s?void 0:s.offsetWidth)||document.body.offsetWidth)/c,d=Math.round(e.contentRect.width),h=l/u*(Number(t)||1);Object.keys(us).forEach((e=>{us[e].forEach((t=>{a.querySelectorAll(e).forEach((e=>{const n=getComputedStyle(e)[t];if(n){const i=n.split(/^(-?[0-9]*.?[0-9]+)(.+)$/).filter((e=>0!==e.length)),r=Number(i[0]),o=i[1];if(r&&!isNaN(r)&&0!==r){e.dataset[t]||(e.dataset[t]=r.toFixed(2));const n=Number(e.dataset[t])*d/h;n>0&&(e.style[t]=n.toFixed(2).toString()+o)}}}))}))}))}})))),this.resizeObserver.observe(this))},this.widgetHeader=e=>{const t="round"===this.timer&&this.themeStyles?D`<round-timer .timeout="${this.customData.timeout||this.timeout}" .themeStyles="${this.themeStyles}" .owner="${this}"></round-timer>`:null;return D`<livelike-widget-header class="widget-header" slot="header">${t}<div class="center">${e.title} ${e.subTitle||""}</div>${function(e){const t=e.themeStyles&&e.themeStyles.dismiss&&e.themeStyles.dismiss.color,n=cs("dismiss",e.themeStyles),i=e.allowDismiss?e.widgetDismissClick:()=>null;return D`<style>.dismiss-button{background:0 0;border:none;position:absolute;top:12px;right:16px;${n}}.dismiss-button:hover{cursor:pointer}${e.customStyles}</style><button class="dismiss-button" @click="${i}"><svg height="18px" width="18px" viewBox="0 0 28 28"><polygon points="28,22.398 19.594,14 28,5.602 22.398,0 14,8.402 5.598,0 0,5.602 8.398,14 0,22.398 5.598,28 14,19.598 22.398,28" style="fill:${t||"#979797"}"/></svg></button>`}(this)}</livelike-widget-header>`},this.widgetFooter=()=>{const e=this.legalLogoSrc||this.placeBetUrl||this.sponsors&&this.sponsors.length?function(e,t,n,i,r,o){var s;const a=cs("footer",n),c=cs("betButton",n),l=cs("sponsor",n);return D`<style>.embet-widget livelike-widget-footer{display:flex;flex-direction:column;border-radius:0;padding:10px 16px;${a}}.embet-widget livelike-widget-footer .bet-footer-row{display:flex;justify-content:center}.embet-widget .footer-container{width:50%;display:flex;flex-direction:column;justify-content:center;margin:5px;padding:5px}.embet-widget .footer-text{height:12px;text-align:center;font-size:12px;color:#999;white-space:nowrap;margin-bottom:10px}.embet-widget .footer-sponsor{object-fit:contain;box-sizing:border-box;width:100%;height:100%;padding:4px 10px;border:2px solid rgba(255,255,255,.2);max-height:40px;${l}}.embet-widget .footer-legal{max-height:40px}.embet-widget .bet-button{border-radius:3rem;padding:10px;white-space:nowrap;border-width:2px;border-style:solid;${c}}.embet-widget .bet-button:hover{cursor:pointer}.embet-widget .bet-button a{text-decoration:none;font-weight:700;color:inherit}${r}</style><livelike-widget-footer><div class="bet-footer-row">${(null===(s=null==i?void 0:i[0])||void 0===s?void 0:s.logo_url)?D`<div class="footer-container"><div class="footer-text">SPONSORED BY</div><img class="footer-sponsor" src="${i[0].logo_url}" alt="${i[0].name}"></div>`:null} ${e?D`<div class="footer-container"><div class="footer-text"></div><button class="bet-button"><a target="_blank" href="${e}">${t}</a></button></div>`:null}</div><div class="bet-footer-row">${o?D`<div class="footer-container"><img class="footer-legal" src="${o}"></div>`:null}</div></livelike-widget-footer>`}(this.placeBetUrl,this.placeBetLabel,this.themeStyles,this.sponsors,this.customStyles,this.legalLogoSrc):null,t="bar"===this.timer?D`<livelike-timer class="custom-timer"></livelike-timer>`:null;return D`${e}${t}`}}static get properties(){return{custom_data:{type:Object},sponsors:{type:Array},placeBetUrl:{type:String},placeBetLabel:{type:String},legalLogoSrc:{type:String},allowDismiss:{type:Boolean},themeStyles:{type:Object},customStyles:{type:String},timer:{type:String,reflect:!0},timeout:{type:Number,reflect:!0}}}connectedCallback(){super.connectedCallback(),!this.customData&&(this.customData=this.custom_data||this.widgetPayload.custom_data),this.customData&&this.parseCustomData(this.customData),document.addEventListener("livelike-theme-updated",this.themeUpdated)}disconnectedCallbck(){super.disconnectedCallback(),document.removeEventListener("livelike-theme-updated",this.themeUpdated)}firstUpdated(){super.firstUpdated(),this.updateComplete.then((()=>{const e=this.querySelector("livelike-widget-root");e.updateComplete.then((()=>{const t=e.shadowRoot.querySelector("livelike-widget-bylines");t&&t.remove();const n=e.shadowRoot.querySelector("livelike-widget-reactions");n&&n.remove()}))}))}};var fs=function(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};let gs=class extends(ps(Li)){render(){const e=this.text&&this.image_url&&D`<figure class="widget-captioned-media"><figcaption class="widget-caption media-caption">${this.text}</figcaption><img class="widget-media" src="${this.image_url}" alt="${this.text}"></figure>`,t=!this.text&&this.image_url&&D`<div class="widget-media"><img src="${this.image_url}"></div>`,n=this.text&&!this.image_url&&D`<div class="widget-caption-container"><span class="widget-caption">${this.text}</span></div>`;return this.link_url&&D`<livelike-footer><a class="widget-link" href="${this.link_url}" target="_blank">${this.link_label}</a></livelike-footer>`,D`<template><style>.widget-captioned-media,.widget-media{padding:16px}.widget-caption-container{text-align:center}${this.customStyles}</style><livelike-widget-root class="embet-widget">${this.widgetHeader({title:this.title})}<livelike-widget-body>${e||t||n||null} ${this.widgetFooter()}</livelike-widget-body></livelike-widget-root></template>`}};fs([Jo({type:String})],gs.prototype,"title",void 0),fs([Jo({type:String})],gs.prototype,"text",void 0),fs([Jo({type:String})],gs.prototype,"image_url",void 0),fs([Jo({type:String})],gs.prototype,"link_url",void 0),fs([Jo({type:String})],gs.prototype,"link_label",void 0),gs=fs([as("embet-alert")],gs);const ms=D`<style>.embet-widget livelike-widget-header{border-radius:0}.embet-widget livelike-widget-header .center{width:100%;text-align:center;padding-top:1rem}.embet-widget .widget-tagline{font-size:18px;font-weight:700;padding-bottom:10px;text-transform:uppercase}.embet-widget .widget-body-text{font-size:18px;padding:18px}.embet-widget livelike-title{text-align:center;text-transform:uppercase;font-weight:700;padding:0;display:block;width:100%}.embet-widget livelike-widget-body{border-radius:0}.embet-widget .option-container{padding:1rem;height:100%;align-items:stretch;display:flex;flex-direction:column}.embet-widget livelike-option{height:50%;border-width:2px;border-style:solid;border-radius:0;padding:0;box-shadow:5px 5px 10px 1px rgba(0,0,0,.2);align-items:unset;box-sizing:border-box}.embet-widget .option-container[interacted] livelike-option{background:rgba(50,50,50,.7);border:2px solid rgba(190,190,190,.7)}.embet-widget .option-container[interacted] livelike-option[selected]{border:2px solid rgba(0,250,0,.7)}.embet-widget livelike-option:not(:last-of-type){margin-bottom:1rem}.embet-widget livelike-option .option-image-wrap{display:flex;width:100%;position:relative;box-sizing:border-box}.embet-widget livelike-option .percentage-container{position:absolute;display:flex;transform:translate(-50%,-50%);top:50%;left:50%;white-space:nowrap}.embet-widget livelike-description{word-break:unset;align-self:center;padding:0 .5rem;text-align:initial}.embet-widget .bet-details{padding:0 .5rem;align-self:center}.embet-widget livelike-image img{padding-left:6px}.embet-widget livelike-percentage{padding:0 5px 0 0}.embet-widget livelike-progress{height:calc(100% + 1px);background:rgba(160,160,160,.7);border-radius:0;box-sizing:border-box}.embet-widget livelike-progress[selected]{background:rgba(0,225,0,.7)}.embet-widget .image-grid[interacted] .bet-details,.embet-widget .image-grid[interacted] img,.embet-widget .image-grid[interacted] livelike-description,.embet-widget .option-container[interacted] .bet-details,.embet-widget .option-container[interacted] livelike-description,[variation=bar] .embet-widget .option-container[interacted] livelike-image,[variation=square] .embet-widget .option-container[interacted] livelike-image{opacity:.2}.embet-widget livelike-timer{height:3px}[variation=inline] .embet-widget .option-container{flex-direction:row}[variation=inline] .embet-widget livelike-image img{padding-left:0}[variation=inline] .embet-widget .bet-details,[variation=inline] .embet-widget livelike-descrption{padding:8px}[variation=inline] .live-total-text-options{display:flex;flex-direction:column;width:100%;padding:0 10px}[variation=square] .embet-widget livelike-option:not(:last-of-type){margin-bottom:0}[variation=square] .embet-widget livelike-option{display:flex;flex-direction:column;justify-content:center}[variation=square] .image-grid{padding:16px;display:grid;grid-column-gap:8px;grid-row-gap:8px}[variation=square] .embet-widget .square-option-0,[variation=square] .embet-widget .square-option-1,[variation=square] .embet-widget .square-option-2,[variation=square] .embet-widget .square-option-3{height:100%;border:none;box-shadow:0 0 0 1px #c1c2ca;border-radius:6px;flex-grow:1;transition:all .2s ease}[variation=square] .embet-widget .square-option-0:after,[variation=square] .embet-widget .square-option-1:after,[variation=square] .embet-widget .square-option-2:after,[variation=square] .embet-widget .square-option-3:after{content:'';width:100%;height:100%;z-index:4;position:absolute;border-radius:6px;transition:all .2s ease}[variation=square] .image-bet-container{display:flex;padding-top:4px;font-size:16px!important;width:100%;justify-content:center}[variation=square] .percentage-container{z-index:5}[variation=square] livelike-description{font-size:16px;text-align:center;flex-grow:0;z-index:1}[variation=square] .bet-details{padding:4px}[variation=square] .image-bet-container.no-image{height:50px}[variation=bar] .option-image-wrap.no-image{height:40px}.animated-container{display:flex}.animated-wrapper{display:flex;flex-direction:column;width:100%}.animated-drawer{height:0;transition-property:height;transition-duration:.5s;transition-timing-function:ease-in-out}.animated-container.show .animated-drawer{height:100%}.animated-content{opacity:0;height:100%}.animated-container.show .animated-content{opacity:1;transition-property:opacity;transition-duration:.5s;transition-delay:.5s;transition-timing-function:ease}.embet-widget .insights{padding-bottom:16px}.insight-table{border-collapse:collapse;margin:0 auto}.insight-table tr[idx='0']{border-bottom:1px solid #ddd}.insight-table tr:not([idx='0']) td{padding:4px 16px}.insight-table td{text-align:center}.label-container{display:flex;justify-content:space-between;padding:4px 0 1px 0}.bar-container{display:flex}.bar-wrap{width:100%;background:grey}.bar-wrap.left{transform:rotate(180deg)}.progress-bar{height:3px}.progress-bar.left{background:orange}.progress-bar.right{background:#00f}</style>`;var vs=function(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};class ys extends(ps(Ei)){constructor(){super(...arguments),this.defaultVoteHide=!1,this.hideVoteInResults=!1,this.kind="image-prediction",this.widgetPayload={id:""},this.allowDismiss=!0,this.timer="bar",this.voteCallback=e=>{e.detail&&e.detail.item&&e.detail.item.id&&!this.voted&&(this.voted=!0)},this.customDataParsed=e=>{this.variation=e.widgetVariation||{"LIVE MONEYLINE":"bar","LIVE SPREAD":"square","LIVE TOTAL":"inline","LIVE AT BAT":"square","LIVE STATS ODDS":"square"}[e.type],this.animateBetContent(e.animationDelay)},this.animateBetContent=e=>{const t=void 0!==e?e:0;String(t)&&null!==t&&setTimeout((()=>{var e;return null===(e=this.querySelector(".animated-container"))||void 0===e?void 0:e.classList.add("show")}),t)}}connectedCallback(){super.connectedCallback(),this.addEventListener("interacted",this.voteCallback)}disconnectedCallbck(){super.disconnectedCallback(),this.removeEventListener("interacted",this.voteCallback)}firstUpdated(){super.firstUpdated(),this.widgetPayload.options&&(this.options=this.widgetPayload.options),this.updateComplete.then((()=>{const e=this.querySelector("livelike-widget-root");e.updateComplete.then((()=>{const t=e.shadowRoot.querySelector("livelike-widget-bylines");t&&t.remove();const n=e.shadowRoot.querySelector("livelike-widget-reactions");n&&n.remove()}))}))}render(){var e,t,n,i;const r=this.customData&&this.customData.type?D`<div class="widget-tagline">${this.customData.type}</div>`:null,o=this.customData&&this.customData.bodyText?D`<div class="widget-body-text">${this.customData.bodyText}</div>`:null,s=this.insightsRenderer?D`<div class="insights">${this.insightsRenderer(this.customData)}</div>`:null,a=null===(t=null===(e=this.themeStyles)||void 0===e?void 0:e.insights)||void 0===t?void 0:t.background,c=null===(i=null===(n=this.themeStyles)||void 0===n?void 0:n.animatedBet)||void 0===i?void 0:i.background,l="LIVE AT BAT"===this.customData.type||"LIVE STATS ODDS"===this.customData.type;return D`<template>${ms}<style>${this.customStyles}live-at-bat,live-moneyline,live-spread,live-stats-odds,live-total{display:block}.embet-widget{height:${this.customData&&this.customData.widgetHeight||"100%"}}.embet-widget .insights{background:${a}}.animated-drawer{background:${c}}</style><livelike-widget-root class="embet-widget">${this.widgetHeader({title:r,subTitle:o})} ${s}<div class="animated-container ${l?"":"show"}"><div class="animated-wrapper"><div class="animated-drawer"><div class="animated-content"><livelike-widget-body><livelike-title></livelike-title>${this.variation&&this.optionsRenderer(this.options,this.customData,this.voted,this.variation)} ${this.widgetFooter()}</livelike-widget-body></div></div></div></div></livelike-widget-root></template>`}}vs([Jo({type:Boolean})],ys.prototype,"voted",void 0),vs([Jo({type:Object})],ys.prototype,"customData",void 0),vs([Jo({type:Object})],ys.prototype,"custom_data",void 0),vs([Jo({type:Array})],ys.prototype,"sponsors",void 0),vs([Jo({type:String})],ys.prototype,"place_bet_url",void 0),vs([Jo({type:String})],ys.prototype,"placeBetUrl",void 0),vs([Jo({type:Boolean})],ys.prototype,"allowDismiss",void 0),vs([Jo({type:Object})],ys.prototype,"themeStyles",void 0),vs([Jo({type:String})],ys.prototype,"customStyles",void 0),vs([Jo({type:Array})],ys.prototype,"options",void 0),vs([Jo({type:String,reflect:!0})],ys.prototype,"variation",void 0),vs([Jo({type:String,reflect:!0})],ys.prototype,"timer",void 0),vs([Jo({type:Number,reflect:!0})],ys.prototype,"timeout",void 0);var bs=function(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};const ws=(e,t)=>{const n=e.reduce(((e,t)=>e+t.vote_count),0);return n>0?Math.round(t.vote_count/n*100):0},ks=(e,t)=>{if(e&&e.betDetails){const n=e.betDetails.find((e=>e.description===t.description));if(n)return D` <div class="bet-details">${n.bet}</div> `}},_s=(e,t,n)=>D`
|
|
389
389
|
<div class="option-container" ?interacted=${n}>
|
|
390
390
|
${e&&e.map(((i,r)=>{const o=ws(e,i),s=i.image_url?D`<livelike-image src=${i.image_url} height="40px"></livelike-image>`:null;return D`
|
|
391
391
|
<livelike-option index=${r} .option=${i}>
|
|
@@ -499,4 +499,4 @@ const rs=new WeakMap,os=(e=>(...t)=>{const n=e(...t);return fo.set(n,!0),n})((e=
|
|
|
499
499
|
></div>
|
|
500
500
|
</div>
|
|
501
501
|
</div>
|
|
502
|
-
</div>`})):null}</div>`):null;var t};let Ts=class extends ys{constructor(){super(...arguments),this.optionsRenderer=Ss}};Ts=bs([as("live-total")],Ts);let Cs=class extends ys{constructor(){super(...arguments),this.optionsRenderer=Ss}};Cs=bs([as("live-spread")],Cs);let Rs=class extends ys{constructor(){super(...arguments),this.optionsRenderer=Ss}};Rs=bs([as("live-moneyline")],Rs);let Es=class extends ys{constructor(){super(...arguments),this.optionsRenderer=Ss,this.insightsRenderer=Os}};Es=bs([as("live-at-bat")],Es);let Ms=class extends ys{constructor(){super(...arguments),this.optionsRenderer=Ss,this.insightsRenderer=Os}};Ms=bs([as("live-stats-odds")],Ms);var As=function(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};let js=class extends is{constructor(){super(...arguments),this.predictionRenderer=e=>{const t=e.type.toLowerCase().split(" ").join("-"),n=document.createElement(t);return n.customData=e,n.custom_data=e,n},this.alertRenderer=e=>{const t=document.createElement("embet-alert");return t.custom_data=e,t.customData=e,t},this.getProgramFromCustomId=e=>{const t=window.LiveLike._$$;if(t&&t.ready){const n=(e,t)=>t&&encodeURI(t.replace(/{(.*?)}/g,e)),i=t.clientId,r=t.appResource[i].program_custom_id_url_template,o=n(e,r);return fetch(o).then((e=>e.json())).then((e=>{this.programid=e.id,this.widgetContainer.programid=e.id}))}return setTimeout((()=>this.getProgramFromCustomId(e)),100)},this.displayPublishedWidget=({id:e,mode:
|
|
502
|
+
</div>`})):null}</div>`):null;var t};let Ts=class extends ys{constructor(){super(...arguments),this.optionsRenderer=Ss}};Ts=bs([as("live-total")],Ts);let Cs=class extends ys{constructor(){super(...arguments),this.optionsRenderer=Ss}};Cs=bs([as("live-spread")],Cs);let Rs=class extends ys{constructor(){super(...arguments),this.optionsRenderer=Ss}};Rs=bs([as("live-moneyline")],Rs);let Es=class extends ys{constructor(){super(...arguments),this.optionsRenderer=Ss,this.insightsRenderer=Os}};Es=bs([as("live-at-bat")],Es);let Ms=class extends ys{constructor(){super(...arguments),this.optionsRenderer=Ss,this.insightsRenderer=Os}};Ms=bs([as("live-stats-odds")],Ms);var As=function(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};let js=class extends is{constructor(){super(...arguments),this.predictionRenderer=e=>{const t=e.type.toLowerCase().split(" ").join("-"),n=document.createElement(t);return n.customData=e,n.custom_data=e,n},this.alertRenderer=e=>{const t=document.createElement("embet-alert");return t.custom_data=e,t.customData=e,t},this.getProgramFromCustomId=e=>{const t=window.LiveLike._$$;if(t&&t.ready){const n=(e,t)=>t&&encodeURI(t.replace(/{(.*?)}/g,e)),i=t.clientId,r=t.appResource[i].program_custom_id_url_template,o=n(e,r);return fetch(o).then((e=>e.json())).then((e=>{this.programid=e.id,this.widgetContainer.programid=e.id}))}return setTimeout((()=>this.getProgramFromCustomId(e)),100)},this.displayPublishedWidget=({id:e,kind:t,mode:n})=>this.widgetContainer.createWidgetElement({id:e,kind:t||"image-prediction",mode:n})}createRenderRoot(){return this}firstUpdated(){return this.widgetContainer.customWidgetRenderer=({widgetPayload:e})=>{const t=Yr(e.custom_data);if(t){if((e=>{const t=Xr.custom_data&&Xr.custom_data.segmentation,n=e&&e.segmentation;return t&&n?Object.keys(t).every((e=>n[e]&&n[e]===t[e])):{}})(t)){if("image-prediction"===e.kind||"text-prediction"===e.kind)return this.predictionRenderer(t);if("alert"===e.kind)return this.alertRenderer(t)}}},null}updated(e){e.forEach(((e,t)=>{"customid"===t&&this.customid&&this.getProgramFromCustomId(this.customid),"programid"===t&&this.programid&&!this.customid&&(this.widgetContainer.programid=this.programid)}))}render(){return Io`<style>embet-widgets{display:block}</style><livelike-widgets .mode="${os(this.mode)}"></livelike-widgets>`}};var Ls,Ns;As([(Ls="livelike-widgets",(e,t)=>{const n={get(){return this.renderRoot.querySelector(Ls)},enumerable:!0,configurable:!0};if(Ns){const i=void 0!==t?t:e.key,r="symbol"==typeof i?Symbol():`__${i}`;n.get=function(){return void 0===this[r]&&(this[r]=this.renderRoot.querySelector(Ls)),this[r]}}return void 0!==t?Xo(n,e,t):Zo(n,e)})],js.prototype,"widgetContainer",void 0),As([Jo({type:String})],js.prototype,"customid",void 0),As([Jo({type:String})],js.prototype,"programid",void 0),As([Jo({type:String})],js.prototype,"mode",void 0),js=As([as("embet-widgets")],js);const{LiveLike:Us,userProfile:Is,init:Ds,displayPreviewWidget:$s}=Zr;var Bs=Object.assign(Object.assign({},Us._config),{version:"0.0.31"}),Fs=Us._$$,qs=Ds,Ks=Is,zs=$s,Hs=Us.applyTheme,Vs=Us.addMessageListener,Gs=Us.removeMessageListener,Ws=Us.createUserProfile,Ys=Us.getUserProfile,Js=Us.getMessageCount,Xs=Us.getMessageList,Zs=Us.sendMessage,Qs=Us.prepareOutgoingChatMessage,ea=Us.updateUserProfile,ta=Us.registerWidgetMode,na=Us.getWidget,ia=Us.getPostedWidgets,ra=Us.addWidgetListener,oa=Us.removeWidgetListener,sa=Us.updateChatRoom,aa=Us.getChatRoom,ca=Us.createChatRoom,la=Us.joinChatRoom,ua=Us.leaveChatRoom,da=Us.getChatUserMutedStatus,ha=Us.getChatRoomMemberships,pa=Us.getProfileChatRoomMemberships,fa=Us.getLeaderboards,ga=Us.getLeaderboard,ma=Us.getLeaderboardEntries,va=Us.getLeaderboardProfileRank,ya=Us.applyLocalization,ba=Us.getWidgetInteractions,wa=Us.getSponsors,ka=Us.getProfileBadges,_a=Us.getApplicationBadges,Pa=Us.getBadgeProgress,xa={_config:Bs,_$$:Fs,init:qs,userProfile:Ks,displayPreviewWidget:zs,applyTheme:Hs,addMessageListener:Vs,removeMessageListener:Gs,createUserProfile:Ws,getUserProfile:Ys,getMessageCount:Js,getMessageList:Xs,sendMessage:Zs,prepareOutgoingChatMessage:Qs,updateUserProfile:ea,registerWidgetMode:ta,getWidget:na,getPostedWidgets:ia,addWidgetListener:ra,removeWidgetListener:oa,updateChatRoom:sa,getChatRoom:aa,createChatRoom:ca,joinChatRoom:la,leaveChatRoom:ua,getChatUserMutedStatus:da,getChatRoomMemberships:ha,getProfileChatRoomMemberships:pa,getLeaderboards:fa,getLeaderboard:ga,getLeaderboardEntries:ma,getLeaderboardProfileRank:va,applyLocalization:ya,getWidgetInteractions:ba,getSponsors:wa,getProfileBadges:ka,getApplicationBadges:_a,getBadgeProgress:Pa};e._$$=Fs,e._config=Bs,e.addMessageListener=Vs,e.addWidgetListener=ra,e.applyLocalization=ya,e.applyTheme=Hs,e.createChatRoom=ca,e.createUserProfile=Ws,e.default=xa,e.displayPreviewWidget=zs,e.getApplicationBadges=_a,e.getBadgeProgress=Pa,e.getChatRoom=aa,e.getChatRoomMemberships=ha,e.getChatUserMutedStatus=da,e.getLeaderboard=ga,e.getLeaderboardEntries=ma,e.getLeaderboardProfileRank=va,e.getLeaderboards=fa,e.getMessageCount=Js,e.getMessageList=Xs,e.getPostedWidgets=ia,e.getProfileBadges=ka,e.getProfileChatRoomMemberships=pa,e.getSponsors=wa,e.getUserProfile=Ys,e.getWidget=na,e.getWidgetInteractions=ba,e.init=qs,e.joinChatRoom=la,e.leaveChatRoom=ua,e.prepareOutgoingChatMessage=Qs,e.registerWidgetMode=ta,e.removeMessageListener=Gs,e.removeWidgetListener=oa,e.sendMessage=Zs,e.updateChatRoom=sa,e.updateUserProfile=ea,e.userProfile=Ks,Object.defineProperty(e,"__esModule",{value:!0})}));
|