@livelike/embet 0.0.36 → 0.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/embet.esm.min.js CHANGED
@@ -1,4 +1,4 @@
1
- /* emBET SDK Version 0.0.36 */
1
+ /* emBET SDK Version 0.1.0 */
2
2
  !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,9 +385,9 @@ found at http://polymer.github.io/PATENTS.txt
385
385
  * subject to an additional IP rights grant found at
386
386
  * http://polymer.github.io/PATENTS.txt
387
387
  */
388
- const Qo=new WeakMap,es=(e=>(...t)=>{const n=e(...t);return lo.set(n,!0),n})((e=>t=>{const n=Qo.get(t);if(void 0===e&&t instanceof ko){if(void 0!==n||!Qo.has(t)){const e=t.committer.name;t.committer.element.removeAttribute(e)}}else e!==n&&t.setValue(e);Qo.set(t,e)}));function ts(e){try{return JSON.parse(e)}catch(e){return null}}const ns=(()=>{let e=!1;return(t,n)=>{e||(customElements.get(t)?(e=!0,console.warn(`${t} has already been registered.`)):customElements.define(t,n))}})(),is=e=>t=>{ns(e,t)};function rs(e){return parseInt(e.repeat(2/e.length),16)}const os=e=>/^([A-Fa-f0-9]{3,4}){1,2}$/.test(e);function ss(e){if(os(e)){const t=Math.floor(e.length/3),n=e.match(new RegExp(`.{${t}}`,"g")).map(rs),i=n[3]||0===n[3]?(n[3]/255).toFixed(2):1;return`rgba(${n[0]}, ${n[1]}, ${n[2]}, ${i})`}return e}function as(e){return Object.keys(e).forEach((t=>{const n=e[t]instanceof Array;if("fontFamily"===t)e[t]=n?e[t].join(" "):e[t];else if("object"!=typeof e[t]||n)if(n){const n=e[t].map((e=>e+"px"));e[t]=n.join(" ")}else-1!==t.toLowerCase().indexOf("color")?e[t]="rgb"===e[t].slice(0,3)?e[t]:ss(e[t]):"fontSize"!==t&&"borderWidth"!==t||String(e[t]).match(/px/gi)||(e[t]=`${e[t]}px`);else"background"===t?function(e,t){const n=e[t];"fill"===n.format?e[t]=os(n.color)?ss(n.color):n.color:"uniformGradient"===n.format&&(e[t]=`linear-gradient(90deg, ${ss(n.colors[0])}, ${ss(n.colors[1])})`)}(e,t):as(e[t])})),e}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"],"custom-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 Zo{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 jo`<style>round-timer{position:absolute;margin:12px}.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")||"16px"};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([Ho({type:Number})],hs.prototype,"timeout",void 0),ds([Ho({type:Number})],hs.prototype,"timeLeft",void 0),ds([Ho({type:Number})],hs.prototype,"newTime",void 0),ds([Ho({type:Number})],hs.prototype,"percent",void 0),ds([Ho({type:Number})],hs.prototype,"value",void 0),ds([Ho({type:Object})],hs.prototype,"owner",void 0),ds([Ho({type:Object})],hs.prototype,"themeStyles",void 0),hs=ds([is("round-timer")],hs);const ps=e=>class extends e{constructor(){super(...arguments),this.widgetPayload={id:""},this.updateThemeStyles=e=>{this.themeStyles=Object.assign(Object.assign({},this.themeStyles),e)},this.themeUpdated=e=>{const t=as(e.detail.theme.widgets[this.kind.split("-")[1]||this.kind]);this.updateThemeStyles(t),this.requestUpdate()},this.themeHandler=e=>{e.theme&&this.applyThemeHandler(e),e.customCss&&this.applyCSSHandler(e),e.customStyles&&this.applyStyleHandler(e),e.resize&&this.applyResizeHandler(e)},this.applyThemeHandler=e=>{const t=this.kind||this.widgetPayload.kind;!this.widgetPayload.kind&&(this.widgetPayload.kind=t);const n=as(JSON.parse(JSON.stringify(e.theme)));Vr.applyTheme(e.theme),this.themeStyles=n.widgets[t.split("-")[1]||t]},this.applyCSSHandler=e=>{const t=document.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("href",e.customCss),this.appendChild(t)},this.applyStyleHandler=e=>{this.customStyles=e.customStyles},this.applyResizeHandler=e=>{var t,n,i,r;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.parseCustomData=e=>{this.customDataParsed&&this.customDataParsed(e),!this.type&&e.widgetType?this.type=e.widgetType.toUpperCase().split("-").join(" "):!this.type&&e.type&&(this.type=e.type),!this.timeout&&e.timeout&&(this.timeout=e.timeout),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||[],this.themeHandler(e)},this.widgetHeader=e=>{const t="round"===this.timer&&this.themeStyles?U`<round-timer .timeout="${this.customData.timeout||this.timeout}" .themeStyles="${this.themeStyles}" .owner="${this}"></round-timer>`:null;return U`<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 U`<style>.dismiss-button{background:0 0;border:none;position:absolute;top:14px;right:12px;${n}}.dismiss-button:hover{cursor:pointer}${e.customStyles}</style><button class="dismiss-button" @click="${i}"><svg height="21px" width="21px" 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=e=>cs(e,n);return U`<style>.embet-widget livelike-widget-footer{display:flex;flex-direction:column;border-radius:0;padding:0 16px 8px 16px;${a("footer")}}.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:4px}.embet-widget .footer-text{height:12px;text-align:center;font-size:12px;color:#999;white-space:nowrap;margin-bottom:6px}.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;${a("sponsor")}}.embet-widget .footer-legal{width:100%}.embet-widget .bet-button{border-radius:3rem;padding:10px;white-space:nowrap;border-width:2px;border-style:solid;${a("betButton")}}.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)?U`<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?U`<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?U`<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?U`<livelike-timer class="custom-timer"></livelike-timer>`:null;return U`${e}${t}`}}static get properties(){return{custom_data:{type:String},customData:{type:Object},type:{type:String},sponsors:{type:Array},placeBetUrl:{type:String},placeBetLabel:{type:String},legalLogoSrc:{type:String},themeStyles:{type:Object},customStyles:{type:String},timer:{type:String,reflect:!0},timeout:{type:Number,reflect:!0}}}connectedCallback(){super.connectedCallback(),!this.customData&&(this.customData=ts(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(Mi)){render(){const e=this.text&&this.image_url&&U`<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&&U`<div class="widget-media"><img src="${this.image_url}"></div>`,n=this.text&&!this.image_url&&U`<div class="widget-caption-container"><span class="widget-caption">${this.text}</span></div>`;return this.link_url&&U`<livelike-footer><a class="widget-link" href="${this.link_url}" target="_blank">${this.link_label}</a></livelike-footer>`,U`<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([Ho({type:String})],gs.prototype,"title",void 0),fs([Ho({type:String})],gs.prototype,"text",void 0),fs([Ho({type:String})],gs.prototype,"image_url",void 0),fs([Ho({type:String})],gs.prototype,"link_url",void 0),fs([Ho({type:String})],gs.prototype,"link_label",void 0),gs=fs([is("embet-alert")],gs);const ms=(e,t)=>{const n=e.reduce(((e,t)=>e+t.vote_count),0);return n>0?Math.round(t.vote_count/n*100):0},vs=(e,t)=>{if(e){const n=e.find((e=>e.description===t.description));if(n)return U`<div class="bet-details">${n.bet}</div>`}},ys=(e,t,n,i)=>U`
388
+ const Qo=new WeakMap,es=(e=>(...t)=>{const n=e(...t);return lo.set(n,!0),n})((e=>t=>{const n=Qo.get(t);if(void 0===e&&t instanceof ko){if(void 0!==n||!Qo.has(t)){const e=t.committer.name;t.committer.element.removeAttribute(e)}}else e!==n&&t.setValue(e);Qo.set(t,e)}));function ts(e){try{return JSON.parse(e)}catch(e){return null}}const ns=(()=>{let e=!1;return(t,n)=>{e||(customElements.get(t)?(e=!0,console.warn(`${t} has already been registered.`)):customElements.define(t,n))}})(),is=e=>t=>{ns(e,t)};function rs(e){return parseInt(e.repeat(2/e.length),16)}const os=e=>/^([A-Fa-f0-9]{3,4}){1,2}$/.test(e);function ss(e){if(os(e)){const t=Math.floor(e.length/3),n=e.match(new RegExp(`.{${t}}`,"g")).map(rs),i=n[3]||0===n[3]?(n[3]/255).toFixed(2):1;return`rgba(${n[0]}, ${n[1]}, ${n[2]}, ${i})`}return e}function as(e){return Object.keys(e).forEach((t=>{const n=e[t]instanceof Array;if("fontFamily"===t)e[t]=n?e[t].join(" "):e[t];else if("object"!=typeof e[t]||n)if(n){const n=e[t].map((e=>e+"px"));e[t]=n.join(" ")}else-1!==t.toLowerCase().indexOf("color")?e[t]="rgb"===e[t].slice(0,3)?e[t]:ss(e[t]):"fontSize"!==t&&"borderWidth"!==t||String(e[t]).match(/px/gi)||(e[t]=`${e[t]}px`);else"background"===t?function(e,t){const n=e[t];"fill"===n.format?e[t]=os(n.color)?ss(n.color):n.color:"uniformGradient"===n.format&&(e[t]=`linear-gradient(${n.direction||0}deg, ${ss(n.colors[0])}, ${ss(n.colors[1])})`)}(e,t):as(e[t])})),e}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","paddingTop","paddingBottom"],".image-grid":["gap","padding"],"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"],".widget-header div.center":[...ls,"paddingLeft","paddingRight","paddingTop","paddingBottom"],".live-total-text-options":["paddingLeft","paddingRight","paddingTop","paddingBottom"],"livelike-option:not(:last-child)":["marginLeft","marginRight","marginTop","marginBottom"],"livelike-option":[],"livelike-progress":["paddingLeft","paddingRight","paddingTop","paddingBottom"],"custom-progress":["paddingLeft","paddingRight","paddingTop","paddingBottom"],".percentage-container":["fontSize","lineHeight","paddingRight"],".percentage-text":["fontSize","lineHeight"],"livelike-timer":["height"],"round-timer":[],".insights":ls,".middle-circle":[...ls,"height","width"],".progress-spinner":["height","width"],".alert-media":["height",""],".alert-caption":ls};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 Zo{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")||"#ffffff",o=(null===(t=null===(e=this.themeStyles)||void 0===e?void 0:e.header)||void 0===t?void 0:t.background)||"#3F7FBF",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 jo`<style>round-timer{position:absolute;top:12px;left:12px}.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")||"16px"};font-weight:${i("fontWeight")};font-family:${i("fontFamily")};color:${i("color")||i("fontColor")};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([Ho({type:Number})],hs.prototype,"timeout",void 0),ds([Ho({type:Number})],hs.prototype,"timeLeft",void 0),ds([Ho({type:Number})],hs.prototype,"newTime",void 0),ds([Ho({type:Number})],hs.prototype,"percent",void 0),ds([Ho({type:Number})],hs.prototype,"value",void 0),ds([Ho({type:Object})],hs.prototype,"owner",void 0),ds([Ho({type:Object})],hs.prototype,"themeStyles",void 0),hs=ds([is("round-timer")],hs);const ps=e=>class extends e{constructor(){super(...arguments),this.widgetPayload={id:""},this.updateThemeStyles=e=>{this.themeStyles=Object.assign(Object.assign({},this.themeStyles),e)},this.themeUpdated=e=>{const t=as(e.detail.theme.widgets[this.kind.split("-")[1]||this.kind]);this.updateThemeStyles(t),this.requestUpdate()},this.parseCustomData=e=>{this.customDataParsed&&this.customDataParsed(e),!this.type&&e.widgetType?this.type=e.widgetType.toUpperCase().split("-").join(" "):!this.type&&e.type&&(this.type=e.type),!this.timeout&&e.timeout&&(this.timeout=e.timeout),this.timer=e.timer||"bar",!this.placeBetUrl&&e.placeBetUrl&&(this.placeBetUrl=e.placeBetUrl),!this.placeBetLabel&&e.placeBetLabel&&(this.placeBetLabel=e.placeBetLabel),!this.legalLogoSrc&&e.legalLogoSrc&&(this.legalLogoSrc=e.legalLogoSrc),this.sponsors=e.sponsors||this.widgetPayload.sponsors||[],this.themeHandler(e)},this.themeHandler=e=>{e.theme&&this.applyThemeHandler(e),e.customCss&&this.applyCSSHandler(e),e.customStyles&&this.applyStyleHandler(e),e.resize&&this.applyResizeHandler(e)},this.applyThemeHandler=e=>{const t=this.kind||this.widgetPayload.kind;!this.widgetPayload.kind&&(this.widgetPayload.kind=t);const n=as(JSON.parse(JSON.stringify(e.theme)));Vr.applyTheme(e.theme),this.themeStyles=n.widgets[t.split("-")[1]||t]},this.applyCSSHandler=e=>{const t=document.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("href",e.customCss),this.appendChild(t)},this.applyStyleHandler=e=>{this.customStyles=e.customStyles},this.applyResizeHandler=e=>{this.resizeObserver=new ResizeObserver((({baseWidth:e})=>t=>t.forEach((t=>{const n=t.target;if(n){const i=document.body.offsetWidth,r=i/e,o=Math.round(t.contentRect.width),s=i/r;Object.keys(us).forEach((e=>{us[e].forEach((t=>{n.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]),a=i[1];if(r&&!isNaN(r)&&0!==r){e.dataset[t]||(e.dataset[t]=r.toFixed(2));const n=Number(e.dataset[t])*o/s;n>0&&(e.style[t]=n.toFixed(2).toString()+a)}}}))}))}))}})))({baseWidth:e.baseWidth||400})),this.resizeObserver.observe(this)},this.widgetHeader=e=>{const t="round"===this.timer&&this.themeStyles?U`<round-timer .timeout="${this.customData.timeout||this.timeout}" .themeStyles="${this.themeStyles}" .owner="${this}"></round-timer>`:null;return U`<div 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 U`<style>.dismiss-button{background:0 0;border:none;position:absolute;top:14px;right:12px;${n}}.dismiss-button:hover{cursor:pointer}${e.customStyles}</style><button class="dismiss-button" @click="${i}"><svg height="21px" width="21px" 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)}</div>`},this.widgetFooter=()=>{const e=this.legalLogoSrc||this.placeBetUrl||this.sponsors&&this.sponsors.length?function(e,t,n,i){var r;return U`<livelike-widget-footer><div class="bet-footer-row">${(null===(r=null==n?void 0:n[0])||void 0===r?void 0:r.logo_url)?U`<div class="footer-container"><div class="footer-text">SPONSORED BY</div><img class="footer-sponsor" src="${n[0].logo_url}" alt="${n[0].name}"></div>`:null} ${e?U`<div class="footer-container"><button class="bet-button"><a target="_blank" href="${e}">${t}</a></button></div>`:null}</div><div class="bet-footer-row">${i?U`<div class="footer-container"><img class="footer-legal" src="${i}"></div>`:null}</div></livelike-widget-footer>`}(this.placeBetUrl,this.placeBetLabel,this.sponsors,this.legalLogoSrc):null,t="bar"===this.timer?U`<livelike-timer class="custom-timer"></livelike-timer>`:null;return U`${e}${t}`}}static get properties(){return{custom_data:{type:String},customData:{type:Object},type:{type:String},sponsors:{type:Array},placeBetUrl:{type:String},placeBetLabel:{type:String},legalLogoSrc:{type:String},themeStyles:{type:Object},customStyles:{type:String},timer:{type:String,reflect:!0},timeout:{type:Number,reflect:!0}}}connectedCallback(){super.connectedCallback(),!this.customData&&(this.customData=ts(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()}))}))}},fs=e=>{var t;const n=t=>cs(t,e);return U`<style>livelike-widget-root.embet-widget{font-family:sans-serif;border:solid 0;${n("root")}}.embet-widget .widget-header{border-radius:0}.embet-widget .widget-header .center{width:100%;text-align:center;padding:16px 16px 8px 16px;font-size:22px;box-sizing:border-box;background:#3f7fbf;${n("header")}}.embet-widget .widget-tagline{font-weight:700;padding-bottom:10px;text-transform:uppercase}.embet-widget livelike-widget-body{border-radius:0;${n("body")}}.embet-widget livelike-title{text-align:center;text-transform:uppercase;font-weight:700;display:block;width:100%;padding:0;${n("title")}}.embet-widget .option-container{padding:12px 16px 16px 16px;height:100%;align-items:stretch;display:flex;flex-direction:column}.embet-widget livelike-option{padding:0;box-shadow:5px 5px 10px 1px rgba(0,0,0,.2);align-items:unset;box-sizing:border-box;border:2px solid #bebEBEB2;font-size:16px;transition:background 1s ease;${n("unselectedOption")}}.embet-widget .option-container[interacted] livelike-option,[variation=square] .embet-widget .image-grid[interacted] livelike-option{background:#323232B2;border:2px solid #bebEBEB2}.embet-widget .option-container livelike-option[selected],[variation=square] .embet-widget .image-grid[interacted] livelike-option[selected]{border:2px solid #00fa00B2;${n("selectedOption")}}.embet-widget livelike-option:not(:last-of-type){margin-bottom:12px}.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:45%;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{z-index:10;padding:8px}.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;transition:opacity 1s ease}.embet-widget .progress-percentage-container{position:absolute;bottom:0;width:100%;height:100%;opacity:0;transition:opacity .5s ease}.embet-widget .progress-percentage-container.show{opacity:1}.embet-widget .custom-percentage{text-align:center;${n("selectedOptionPercentage")}}.embet-widget livelike-timer{height:${((null===(t=null==e?void 0:e.timer)||void 0===t?void 0:t.height)||3)+"px"}}[variation=inline] .embet-widget .option-container{display:flex;flex-direction:row}[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 8px}[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;gap:12px}[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-radius:6px;flex-grow:1}[variation=square] .image-bet-container{display:flex;flex-direction:column;width:100%;justify-content:center}[variation=square] .percentage-container{z-index:5}[variation=square] livelike-description{text-align:center;flex-grow:0;z-index:1}[variation=square] .bet-details{padding:4px}[variation=square] .image-bet-container.no-image{justify-content:end;height:72px}[variation=bar] .option-image-wrap.no-image{height:55px}.animated-container{display:flex}.animated-wrapper{display:flex;flex-direction:column;width:100%}.animated-drawer{height:0;transition:height .4s ease-in-out;${n("animatedBet")}}.animated-container.show .animated-drawer{height:100%}.animated-content{opacity:0;height:100%;transition:opacity .5s .5s ease-in-out}.animated-container.show .animated-content{opacity:1}.insights{padding:0 16px 12px 16px;background:#000;color:#fff;${n("insights")}}.insight-body-text{text-align:center;overflow-wrap:break-word;padding-bottom:8px;${n("insightBodyText")}}.insight-table{border-collapse:collapse;width:100%;padding-bottom:8px;${n("insightTable")}}.insight-table tr[idx='0']{border-bottom:1px solid #ddd}.insight-table td{text-align:center}.insight-table tr:not([idx='0']) td{padding:2px 0 2px 0;${n("insightTableCell")}}.insight-table .highlighted{background-color:#ffffff30;${n("insightTableCellHighlighted")}}.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}.embet-widget livelike-widget-footer{display:flex;flex-direction:column;border-radius:0;padding:0 16px 8px 16px;${n("footer")}}.embet-widget livelike-widget-footer .bet-footer-row{display:flex;justify-content:center;align-items:flex-end}.embet-widget .footer-container{width:50%;display:flex;flex-direction:column;justify-content:center;margin:4px}.embet-widget .footer-text{text-align:center;font-size:12px;color:#999;white-space:nowrap;margin-bottom:6px;${n("sponsorText")}}.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}.embet-widget .footer-legal{width:100%}.embet-widget .bet-button{border-radius:3rem;padding:10px;white-space:nowrap;border-width:2px;border-style:solid;${n("betButton")}}.embet-widget .bet-button:hover{cursor:pointer}.embet-widget .bet-button a{text-decoration:none;font-weight:700;color:inherit}.alert-media-caption-container{display:flex;flex-direction:column;align-items:center;padding:8px 16px;gap:8px}.alert-media{height:140px}</style>`};var gs=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 ms=class extends(ps(Mi)){render(){const e=this.image_url?U`<img class="alert-media" src="${this.image_url}" alt="alert-image">`:null,t=this.text?U`<span class="alert-caption">${this.text}</span>`:null,n=U`<div class="alert-media-caption-container">${e} ${t}</div>`;return U`<template>${fs(this.themeStyles)}<style>embet-alert{display:block;max-width:400px;min-width:280px}${this.customStyles}</style><livelike-widget-root class="embet-widget"><div class="inner">${this.widgetHeader({title:this.title})}<livelike-widget-body>${n}</livelike-widget-body>${this.widgetFooter()}</div></livelike-widget-root></template>`}};gs([Ho({type:String})],ms.prototype,"title",void 0),gs([Ho({type:String})],ms.prototype,"text",void 0),gs([Ho({type:String})],ms.prototype,"image_url",void 0),gs([Ho({type:String})],ms.prototype,"link_url",void 0),gs([Ho({type:String})],ms.prototype,"link_label",void 0),gs([Ho({type:Object})],ms.prototype,"themeStyles",void 0),ms=gs([is("embet-alert")],ms);const vs=(e,t)=>{const n=e.reduce(((e,t)=>e+t.vote_count),0);return n>0?Math.round(t.vote_count/n*100):0},ys=(e,t)=>{if(e){const n=e.find((e=>e.description===t.description));if(n)return U`<div class="bet-details">${n.bet}</div>`}},bs=(e,t,n,i)=>U`
389
389
  <div class="option-container" ?interacted=${n}>
390
- ${e&&e.map(((n,r)=>{const o=ms(e,n),s=e=>cs(e,i),a=n.image_url?U`<livelike-image src=${n.image_url} height="40px"></livelike-image>`:null;return U`
390
+ ${e&&e.map(((n,r)=>{const o=vs(e,n),s=e=>cs(e,i),a=n.image_url?U`<livelike-image src=${n.image_url} height="40px"></livelike-image>`:null;return U`
391
391
  <style>
392
392
  [variation='bar'] .option-container .inline-option-${r} .custom-progress {
393
393
  position: absolute;
@@ -399,19 +399,20 @@ const Qo=new WeakMap,es=(e=>(...t)=>{const n=e(...t);return lo.set(n,!0),n})((e=
399
399
  transition: width 0.5s ease-in;
400
400
  ${s("unselectedOptionBar")}
401
401
  }
402
- [variation='bar'] .option-container .inline-option-${r} .progress-percentage-container.show .custom-progress {
403
- width: ${o}%;
404
- }
405
402
  [variation='bar'] .option-container .inline-option-${r}[selected] .custom-progress {
406
403
  background-color: rgba(0, 225, 0, 0.9);
407
404
  ${s("selectedOptionBar")}
408
405
  }
406
+ [variation='bar'] .option-container .inline-option-${r} .progress-percentage-container.show .custom-progress {
407
+ border-radius: 3px 0 0 3px;
408
+ width: ${o}%;
409
+ }
409
410
  </style>
410
411
  <livelike-option index=${r} .option=${n} class="inline-option-${r}">
411
412
  <div class="option-image-wrap ${n.image_url?"":"no-image"}">
412
413
  ${a}
413
414
  <livelike-description .description=${n.description}></livelike-description>
414
- ${vs(t,n)}
415
+ ${ys(t,n)}
415
416
  <div class="progress-percentage-container">
416
417
  <div class="custom-progress"></div>
417
418
  <div class="percentage-container">
@@ -422,7 +423,7 @@ const Qo=new WeakMap,es=(e=>(...t)=>{const n=e(...t);return lo.set(n,!0),n})((e=
422
423
  </livelike-option>
423
424
  `}))}
424
425
  </div>
425
- `,bs=(e,t,n,i)=>U`
426
+ `,ws=(e,t,n,i)=>U`
426
427
  <style>
427
428
  [variation='square'] .image-grid {
428
429
  grid-template-columns: repeat(${e.length}, 1fr);
@@ -434,7 +435,7 @@ const Qo=new WeakMap,es=(e=>(...t)=>{const n=e(...t);return lo.set(n,!0),n})((e=
434
435
  // }
435
436
  </style>
436
437
  <div class="image-grid" ?interacted=${n}>
437
- ${e&&e.map(((n,r)=>{const o=ms(e,n),s=e=>cs(e,i),a=n.image_url?U`<livelike-image src=${n.image_url} height="40px"></livelike-image>`:null;return U`
438
+ ${e&&e.map(((n,r)=>{const o=vs(e,n),s=e=>cs(e,i),a=n.image_url?U`<livelike-image src=${n.image_url} height="40px"></livelike-image>`:null;return U`
438
439
  <style>
439
440
  [variation='square'] .image-grid .square-option-${r} .custom-progress {
440
441
  position: absolute;
@@ -445,33 +446,34 @@ const Qo=new WeakMap,es=(e=>(...t)=>{const n=e(...t);return lo.set(n,!0),n})((e=
445
446
  transition: height 0.5s ease-in;
446
447
  ${s("unselectedOptionBar")}
447
448
  }
448
- [variation='square'] .image-grid .square-option-${r} .progress-percentage-container.show .custom-progress {
449
- height: ${o}%;
450
- }
451
449
  [variation='square'] .image-grid .square-option-${r}[selected] .custom-progress {
452
450
  background-color: rgba(0, 225, 0, 0.9);
453
451
  ${s("selectedOptionBar")}
454
452
  }
453
+ [variation='square'] .image-grid .square-option-${r} .progress-percentage-container.show .custom-progress {
454
+ border-radius: 0 0 3px 3px;
455
+ height: ${o}%;
456
+ }
455
457
  </style>
456
458
  <livelike-option index=${r} .option=${n} class="square-option-${r}">
457
459
  <div class="image-bet-container ${a?"":"no-image"}">
458
460
  ${a}
459
461
  <livelike-description></livelike-description>
460
462
  </div>
461
- ${vs(t,n)}
463
+ ${ys(t,n)}
462
464
  <div class="progress-percentage-container">
463
465
  <div class="custom-progress"></div>
464
466
  <div class="percentage-container">
465
- <span class="custom-percentage">${o}% of votes</span>
467
+ <span class="custom-percentage">${o}%<br />of votes</span>
466
468
  </div>
467
469
  </div>
468
470
  </livelike-option>
469
471
  `}))}
470
472
  </div>
471
- `,ws=(e,t,n,i)=>{var r,o;return U`
473
+ `,ks=(e,t,n,i)=>{var r,o;return U`
472
474
  <div class="option-container" ?interacted=${n}>
473
475
  <livelike-image src=${e[0].image_url} height="60px"></livelike-image>
474
- <div class="live-total-text-options">${e&&e.map(((n,r)=>{const o=ms(e,n),s=e=>cs(e,i);return U`
476
+ <div class="live-total-text-options">${e&&e.map(((n,r)=>{const o=vs(e,n),s=e=>cs(e,i);return U`
475
477
  <style>
476
478
  [variation='inline'] .option-container .inline-option-${r} .custom-progress {
477
479
  position: absolute;
@@ -482,18 +484,19 @@ const Qo=new WeakMap,es=(e=>(...t)=>{const n=e(...t);return lo.set(n,!0),n})((e=
482
484
  transition: width 0.5s ease-in;
483
485
  ${s("unselectedOptionBar")}
484
486
  }
485
- [variation='inline'] .option-container .inline-option-${r} .progress-percentage-container.show .custom-progress {
486
- width: ${o}%;
487
- }
488
487
  [variation='inline'] .option-container .inline-option-${r}[selected] .custom-progress {
489
488
  background-color: rgba(0, 225, 0, 0.9);
490
489
  ${s("selectedOptionBar")}
491
490
  }
491
+ [variation='inline'] .option-container .inline-option-${r} .progress-percentage-container.show .custom-progress {
492
+ border-radius: 3px 0 0 3px;
493
+ width: ${o}%;
494
+ }
492
495
  </style>
493
496
  <livelike-option index=${r} .option=${n} class="inline-option-${r}">
494
497
  <div class="option-image-wrap">
495
498
  <livelike-description .description=${n.description}></livelike-description>
496
- ${vs(t,n)}
499
+ ${ys(t,n)}
497
500
  <div class="progress-percentage-container">
498
501
  <div class="custom-progress"></div>
499
502
  <div class="percentage-container">
@@ -508,4 +511,4 @@ const Qo=new WeakMap,es=(e=>(...t)=>{const n=e(...t);return lo.set(n,!0),n})((e=
508
511
  height="60px"
509
512
  ></livelike-image>
510
513
  </div>
511
- `};var ks=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 _s extends(ps(Ci)){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.animateOptionContent(1e3))},this.customDataParsed=e=>{this.variation=e.widgetVariation,e.betDetails&&(this.betDetails=e.betDetails),this.animateBetContent(e.animationDelay)},this.animateOptionContent=e=>{const t=void 0!==e?e:0;String(t)&&null!==t&&setTimeout((()=>{const e=this.querySelectorAll(".progress-percentage-container");for(const t of e)t.classList.add("show")}),t)},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()}))}))}updated(e){super.updated(e),e.has("phase")&&"results"===this.phase&&(this.voted=!0,this.animateOptionContent(500))}render(){const e=this.type?U`<div class="widget-tagline">${this.type}</div>`:null,t=this.customData&&this.customData.bodyText?U`<div class="insight-body-text">${this.customData.bodyText}</div>`:null,n=this.insightsRenderer?U`<div class="insights">${t} ${this.insightsRenderer(this.customData)}</div>`:null,i="LIVE AT BAT"===this.type||"LIVE STATS ODDS"===this.type;return U`<template>${(e=>{const t=t=>cs(t,e);return U`<style>livelike-widget-root.embet-widget{font-family:sans-serif;${t("root")}}.embet-widget livelike-widget-header{border-radius:0}.embet-widget livelike-widget-header .center{width:100%;text-align:center;padding:16px 16px 8px 16px;font-size:22px;${t("header")}}.embet-widget .widget-tagline{font-weight:700;padding-bottom:10px;text-transform:uppercase}.embet-widget livelike-widget-body{border-radius:0}.embet-widget livelike-title{text-align:center;text-transform:uppercase;font-weight:700;display:block;width:100%;padding:0;${t("title")}}.embet-widget .option-container{padding:12px 16px 16px 16px;height:100%;align-items:stretch;display:flex;flex-direction:column}.embet-widget livelike-option{padding:0;box-shadow:5px 5px 10px 1px rgba(0,0,0,.2);align-items:unset;box-sizing:border-box;border:2px solid #bebEBEB2;font-size:16px;transition:background 1s ease;${t("unselectedOption")}}.embet-widget .option-container[interacted] livelike-option,[variation=square] .embet-widget .image-grid[interacted] livelike-option{background:#323232B2;border:2px solid #bebEBEB2}.embet-widget .option-container livelike-option[selected],[variation=square] .embet-widget .image-grid[interacted] livelike-option[selected]{border:2px solid #00fa00B2;${t("selectedOption")}}.embet-widget livelike-option:not(:last-of-type){margin-bottom:12px}.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:45%;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:8px}.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;transition:opacity 1s ease}.embet-widget .progress-percentage-container{position:absolute;bottom:0;width:100%;height:100%;opacity:0;transition:opacity .5s ease}.embet-widget .progress-percentage-container.show{opacity:1}.embet-widget .custom-percentage{${t("selectedOptionPercentage")}}.embet-widget livelike-timer{height:3px}[variation=inline] .embet-widget .option-container{flex-direction:row}[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 8px}[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:12px;grid-row-gap:12px}[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-radius:6px;flex-grow:1}[variation=square] .image-bet-container{display:flex;flex-direction:column;width:100%;justify-content:center}[variation=square] .percentage-container{z-index:5}[variation=square] livelike-description{text-align:center;flex-grow:0;z-index:1}[variation=square] .bet-details{padding:4px}[variation=square] .image-bet-container.no-image{justify-content:end;height:72px}[variation=bar] .option-image-wrap.no-image{height:55px}.animated-container{display:flex}.animated-wrapper{display:flex;flex-direction:column;width:100%}.animated-drawer{height:0;transition:height .4s ease-in-out;${t("animatedBet")}}.animated-container.show .animated-drawer{height:100%}.animated-content{opacity:0;height:100%;transition:opacity .5s .5s ease-in-out}.animated-container.show .animated-content{opacity:1}.insights{padding:0 16px 12px 16px;background:#000;color:#fff;${t("insights")}}.insight-body-text{text-align:center;overflow-wrap:break-word;padding-bottom:8px;${t("insightBodyText")}}.insight-table{border-collapse:collapse;width:100%;padding-bottom:8px;${t("insightTable")}}.insight-table tr[idx='0']{border-bottom:1px solid #ddd}.insight-table td{text-align:center}.insight-table tr:not([idx='0']) td{padding:2px 0 2px 0;${t("insightTableCell")}}.insight-table .highlighted{background-color:#ffffff30;${t("insightTableCellHighlighted")}}.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>`})(this.themeStyles)}<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%"}}</style><livelike-widget-root class="embet-widget">${this.widgetHeader({title:e})} ${n}<div class="animated-container ${i?"":"show"}"><div class="animated-wrapper"><div class="animated-drawer"><div class="animated-content"><livelike-widget-body><livelike-title></livelike-title>${this.variation&&(r=this.options,o=this.betDetails,s=this.variation,a=this.voted,c=this.themeStyles,(0,{bar:ys,square:bs,inline:ws}[s])(r,o,a,c))} ${this.widgetFooter()}</livelike-widget-body></div></div></div></div></livelike-widget-root></template>`;var r,o,s,a,c}}ks([Ho({type:Boolean})],_s.prototype,"voted",void 0),ks([Ho({type:Object})],_s.prototype,"customData",void 0),ks([Ho({type:String})],_s.prototype,"type",void 0),ks([Ho({type:Array})],_s.prototype,"sponsors",void 0),ks([Ho({type:String})],_s.prototype,"placeBetUrl",void 0),ks([Ho({type:Boolean})],_s.prototype,"allowDismiss",void 0),ks([Ho({type:Object})],_s.prototype,"themeStyles",void 0),ks([Ho({type:String})],_s.prototype,"customStyles",void 0),ks([Ho({type:Array})],_s.prototype,"options",void 0),ks([Ho({type:Array})],_s.prototype,"betDetails",void 0),ks([Ho({type:String,reflect:!0})],_s.prototype,"variation",void 0),ks([Ho({type:String,reflect:!0})],_s.prototype,"timer",void 0),ks([Ho({type:Number,reflect:!0})],_s.prototype,"timeout",void 0);var Ps=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 xs=e=>{return e.table?(e=>{const t=e.reduce(((e,t)=>(e[t.rowIndex]=[...e[t.rowIndex]||[],t],e)),[]).map((e=>e.sort(((e,t)=>e.columnIndex-t.columnIndex)))),n=e=>U`<td class="${e.isHighlighted?"highlighted":""}">${e.value}</td>`;return U`<table class="insight-table">${t.length?t.map(((e,t)=>U`<tr idx="${t}">${e.map(n)}</tr>`)):null}</table>`})(e.table):e.stats?(t=e.stats,U`<div class="bar-table">${t?t.map((e=>{const t=t=>Math.round(t/(e.valOne+e.valTwo)*100),n=t(e.valOne),i=t(e.valTwo);return U`<div class="progress-container"><div class="label-container"><div class="label left">${e.valOne}</div><div class="bar-title">${e.title}</div><div class="label right">${e.valTwo}</div></div><div class="bar-container"><div class="bar-wrap left"><div class="progress-bar left" role="progressbar" style="width:${n}"></div></div><div class="bar-wrap right"><div class="progress-bar right" role="progressbar" style="width:${i}"></div></div></div></div>`})):null}</div>`):null;var t};let Ss=class extends _s{};Ss=Ps([is("live-total")],Ss);let Os=class extends _s{};Os=Ps([is("live-spread")],Os);let Ts=class extends _s{};Ts=Ps([is("live-moneyline")],Ts);let Cs=class extends _s{constructor(){super(...arguments),this.insightsRenderer=xs}};Cs=Ps([is("live-at-bat")],Cs);let Es=class extends _s{constructor(){super(...arguments),this.insightsRenderer=xs}};Es=Ps([is("live-stats-odds")],Es);var Rs=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 As=class extends Zo{constructor(){super(...arguments),this.predictionRenderer=e=>{const t=e.type?e.type.toLowerCase().split(" ").join("-"):e.widgetType,n=document.createElement(t);return n.customData=e,n},this.alertRenderer=e=>{const t=document.createElement("embet-alert");return 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=ts(e.custom_data);if(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 jo`<style>embet-widgets{display:block}</style><livelike-widgets .mode="${es(this.mode)}"></livelike-widgets>`}};var Ms,js;Rs([(Ms="livelike-widgets",(e,t)=>{const n={get(){return this.renderRoot.querySelector(Ms)},enumerable:!0,configurable:!0};if(js){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(Ms)),this[r]}}return void 0!==t?Vo(n,e,t):Go(n,e)})],As.prototype,"widgetContainer",void 0),Rs([Ho({type:String})],As.prototype,"customid",void 0),Rs([Ho({type:String})],As.prototype,"programid",void 0),Rs([Ho({type:String})],As.prototype,"mode",void 0),As=Rs([is("embet-widgets")],As);const{LiveLike:Ls,userProfile:Ns,init:Us,displayPreviewWidget:Is}=Yr;var Ds=Object.assign(Object.assign({},Ls._config),{version:"0.0.35"}),$s=Ls._$$,Bs=Us,Fs=Ns,Ks=Is,qs=Ls.applyTheme,zs=Ls.addMessageListener,Hs=Ls.removeMessageListener,Vs=Ls.createUserProfile,Gs=Ls.getUserProfile,Ws=Ls.getMessageCount,Ys=Ls.getMessageList,Js=Ls.sendMessage,Xs=Ls.prepareOutgoingChatMessage,Zs=Ls.updateUserProfile,Qs=Ls.registerWidgetMode,ea=Ls.getWidget,ta=Ls.getPostedWidgets,na=Ls.addWidgetListener,ia=Ls.removeWidgetListener,ra=Ls.updateChatRoom,oa=Ls.getChatRoom,sa=Ls.createChatRoom,aa=Ls.joinChatRoom,ca=Ls.leaveChatRoom,la=Ls.getChatUserMutedStatus,ua=Ls.getChatRoomMemberships,da=Ls.getProfileChatRoomMemberships,ha=Ls.getLeaderboards,pa=Ls.getLeaderboard,fa=Ls.getLeaderboardEntries,ga=Ls.getLeaderboardProfileRank,ma=Ls.applyLocalization,va=Ls.getWidgetInteractions,ya=Ls.getSponsors,ba=Ls.getProfileBadges,wa=Ls.getApplicationBadges,ka=Ls.getBadgeProgress,_a={_config:Ds,_$$:$s,init:Bs,userProfile:Fs,displayPreviewWidget:Ks,applyTheme:qs,addMessageListener:zs,removeMessageListener:Hs,createUserProfile:Vs,getUserProfile:Gs,getMessageCount:Ws,getMessageList:Ys,sendMessage:Js,prepareOutgoingChatMessage:Xs,updateUserProfile:Zs,registerWidgetMode:Qs,getWidget:ea,getPostedWidgets:ta,addWidgetListener:na,removeWidgetListener:ia,updateChatRoom:ra,getChatRoom:oa,createChatRoom:sa,joinChatRoom:aa,leaveChatRoom:ca,getChatUserMutedStatus:la,getChatRoomMemberships:ua,getProfileChatRoomMemberships:da,getLeaderboards:ha,getLeaderboard:pa,getLeaderboardEntries:fa,getLeaderboardProfileRank:ga,applyLocalization:ma,getWidgetInteractions:va,getSponsors:ya,getProfileBadges:ba,getApplicationBadges:wa,getBadgeProgress:ka};export{$s as _$$,Ds as _config,zs as addMessageListener,na as addWidgetListener,ma as applyLocalization,qs as applyTheme,sa as createChatRoom,Vs as createUserProfile,_a as default,Ks as displayPreviewWidget,wa as getApplicationBadges,ka as getBadgeProgress,oa as getChatRoom,ua as getChatRoomMemberships,la as getChatUserMutedStatus,pa as getLeaderboard,fa as getLeaderboardEntries,ga as getLeaderboardProfileRank,ha as getLeaderboards,Ws as getMessageCount,Ys as getMessageList,ta as getPostedWidgets,ba as getProfileBadges,da as getProfileChatRoomMemberships,ya as getSponsors,Gs as getUserProfile,ea as getWidget,va as getWidgetInteractions,Bs as init,aa as joinChatRoom,ca as leaveChatRoom,Xs as prepareOutgoingChatMessage,Qs as registerWidgetMode,Hs as removeMessageListener,ia as removeWidgetListener,Js as sendMessage,ra as updateChatRoom,Zs as updateUserProfile,Fs as userProfile};
514
+ `};var _s=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 Ps extends(ps(Ci)){constructor(){super(...arguments),this.defaultVoteHide=!1,this.hideVoteInResults=!1,this.kind="image-prediction",this.widgetPayload={id:""},this.allowDismiss=!0,this.voteCallback=e=>{e.detail&&e.detail.item&&e.detail.item.id&&!this.voted&&(this.voted=!0,this.animateOptionContent(1e3))},this.customDataParsed=e=>{this.variation=e.widgetVariation,e.betDetails&&(this.betDetails=e.betDetails),this.animateBetContent(e.animationDelay)},this.animateOptionContent=e=>{const t=void 0!==e?e:0;String(t)&&null!==t&&setTimeout((()=>{const e=this.querySelectorAll(".progress-percentage-container");for(const t of e)t.classList.add("show")}),t)},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)}}realTimeVotesSimulator(){setInterval((()=>{for(let e=0;e<=2;e++)this.options[e].vote_count+=Math.floor(100*Math.random());this.requestUpdate()}),2e3)}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()}))}))}updated(e){super.updated(e),e.has("phase")&&"results"===this.phase&&(this.voted=!0,this.animateOptionContent(500))}render(){const e=this.type?U`<div class="widget-tagline">${this.type}</div>`:null,t=this.customData&&this.customData.bodyText?U`<div class="insight-body-text">${this.customData.bodyText}</div>`:null,n=this.insightsRenderer?U`<div class="insights">${t} ${this.insightsRenderer(this.customData)}</div>`:null,i="LIVE AT BAT"===this.type||"LIVE STATS ODDS"===this.type;return U`<template>${fs(this.themeStyles)}<style>live-at-bat,live-moneyline,live-spread,live-stats-odds,live-total{display:block;max-width:400px;min-width:280px}.embet-widget{height:${this.customData&&this.customData.widgetHeight||"100%"}}${this.customStyles}</style><livelike-widget-root class="embet-widget">${this.widgetHeader({title:e})} ${n}<div class="animated-container ${i?"":"show"}"><div class="animated-wrapper"><div class="animated-drawer"><div class="animated-content"><livelike-widget-body><livelike-title></livelike-title>${this.variation&&(r=this.options,o=this.betDetails,s=this.variation,a=this.voted,c=this.themeStyles,(0,{bar:bs,square:ws,inline:ks}[s])(r,o,a,c))}</livelike-widget-body>${this.widgetFooter()}</div></div></div></div></livelike-widget-root></template>`;var r,o,s,a,c}}_s([Ho({type:Boolean})],Ps.prototype,"voted",void 0),_s([Ho({type:Object})],Ps.prototype,"customData",void 0),_s([Ho({type:String})],Ps.prototype,"type",void 0),_s([Ho({type:Array})],Ps.prototype,"sponsors",void 0),_s([Ho({type:String})],Ps.prototype,"placeBetUrl",void 0),_s([Ho({type:Boolean})],Ps.prototype,"allowDismiss",void 0),_s([Ho({type:Object})],Ps.prototype,"themeStyles",void 0),_s([Ho({type:String})],Ps.prototype,"customStyles",void 0),_s([Ho({type:Array})],Ps.prototype,"options",void 0),_s([Ho({type:Array})],Ps.prototype,"betDetails",void 0),_s([Ho({type:String,reflect:!0})],Ps.prototype,"variation",void 0),_s([Ho({type:String,reflect:!0})],Ps.prototype,"timer",void 0),_s([Ho({type:Number,reflect:!0})],Ps.prototype,"timeout",void 0);var xs=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 Ss=e=>{return e.table?(e=>{const t=e.reduce(((e,t)=>(e[t.rowIndex]=[...e[t.rowIndex]||[],t],e)),[]).map((e=>e.sort(((e,t)=>e.columnIndex-t.columnIndex)))),n=e=>U`<td class="${e.isHighlighted?"highlighted":""}">${e.value}</td>`;return U`<table class="insight-table">${t.length?t.map(((e,t)=>U`<tr idx="${t}">${e.map(n)}</tr>`)):null}</table>`})(e.table):e.stats?(t=e.stats,U`<div class="bar-table">${t?t.map((e=>{const t=t=>Math.round(t/(e.valOne+e.valTwo)*100),n=t(e.valOne),i=t(e.valTwo);return U`<div class="progress-container"><div class="label-container"><div class="label left">${e.valOne}</div><div class="bar-title">${e.title}</div><div class="label right">${e.valTwo}</div></div><div class="bar-container"><div class="bar-wrap left"><div class="progress-bar left" role="progressbar" style="width:${n}"></div></div><div class="bar-wrap right"><div class="progress-bar right" role="progressbar" style="width:${i}"></div></div></div></div>`})):null}</div>`):null;var t};let Os=class extends Ps{};Os=xs([is("live-total")],Os);let Ts=class extends Ps{};Ts=xs([is("live-spread")],Ts);let Cs=class extends Ps{};Cs=xs([is("live-moneyline")],Cs);let Es=class extends Ps{constructor(){super(...arguments),this.insightsRenderer=Ss}};Es=xs([is("live-at-bat")],Es);let Rs=class extends Ps{constructor(){super(...arguments),this.insightsRenderer=Ss}};Rs=xs([is("live-stats-odds")],Rs);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 Ms=class extends Zo{constructor(){super(...arguments),this.predictionRenderer=e=>{const t=e.type?e.type.toLowerCase().split(" ").join("-"):e.widgetType,n=document.createElement(t);return n.customData=e,n},this.alertRenderer=e=>{const t=document.createElement("embet-alert");return 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=ts(e.custom_data);if(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 jo`<style>embet-widgets{display:block}</style><livelike-widgets .mode="${es(this.mode)}"></livelike-widgets>`}};var js,Ls;As([(js="livelike-widgets",(e,t)=>{const n={get(){return this.renderRoot.querySelector(js)},enumerable:!0,configurable:!0};if(Ls){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(js)),this[r]}}return void 0!==t?Vo(n,e,t):Go(n,e)})],Ms.prototype,"widgetContainer",void 0),As([Ho({type:String})],Ms.prototype,"customid",void 0),As([Ho({type:String})],Ms.prototype,"programid",void 0),As([Ho({type:String})],Ms.prototype,"mode",void 0),Ms=As([is("embet-widgets")],Ms);const{LiveLike:Ns,userProfile:Us,init:Is,displayPreviewWidget:Ds}=Yr;var $s=Object.assign(Object.assign({},Ns._config),{version:"0.1.0"}),Bs=Ns._$$,Fs=Is,Ks=Us,qs=Ds,zs=Ns.applyTheme,Hs=Ns.addMessageListener,Vs=Ns.removeMessageListener,Gs=Ns.createUserProfile,Ws=Ns.getUserProfile,Ys=Ns.getMessageCount,Js=Ns.getMessageList,Xs=Ns.sendMessage,Zs=Ns.prepareOutgoingChatMessage,Qs=Ns.updateUserProfile,ea=Ns.registerWidgetMode,ta=Ns.getWidget,na=Ns.getPostedWidgets,ia=Ns.addWidgetListener,ra=Ns.removeWidgetListener,oa=Ns.updateChatRoom,sa=Ns.getChatRoom,aa=Ns.createChatRoom,ca=Ns.joinChatRoom,la=Ns.leaveChatRoom,ua=Ns.getChatUserMutedStatus,da=Ns.getChatRoomMemberships,ha=Ns.getProfileChatRoomMemberships,pa=Ns.getLeaderboards,fa=Ns.getLeaderboard,ga=Ns.getLeaderboardEntries,ma=Ns.getLeaderboardProfileRank,va=Ns.applyLocalization,ya=Ns.getWidgetInteractions,ba=Ns.getSponsors,wa=Ns.getProfileBadges,ka=Ns.getApplicationBadges,_a=Ns.getBadgeProgress,Pa={_config:$s,_$$:Bs,init:Fs,userProfile:Ks,displayPreviewWidget:qs,applyTheme:zs,addMessageListener:Hs,removeMessageListener:Vs,createUserProfile:Gs,getUserProfile:Ws,getMessageCount:Ys,getMessageList:Js,sendMessage:Xs,prepareOutgoingChatMessage:Zs,updateUserProfile:Qs,registerWidgetMode:ea,getWidget:ta,getPostedWidgets:na,addWidgetListener:ia,removeWidgetListener:ra,updateChatRoom:oa,getChatRoom:sa,createChatRoom:aa,joinChatRoom:ca,leaveChatRoom:la,getChatUserMutedStatus:ua,getChatRoomMemberships:da,getProfileChatRoomMemberships:ha,getLeaderboards:pa,getLeaderboard:fa,getLeaderboardEntries:ga,getLeaderboardProfileRank:ma,applyLocalization:va,getWidgetInteractions:ya,getSponsors:ba,getProfileBadges:wa,getApplicationBadges:ka,getBadgeProgress:_a};export{Bs as _$$,$s as _config,Hs as addMessageListener,ia as addWidgetListener,va as applyLocalization,zs as applyTheme,aa as createChatRoom,Gs as createUserProfile,Pa as default,qs as displayPreviewWidget,ka as getApplicationBadges,_a as getBadgeProgress,sa as getChatRoom,da as getChatRoomMemberships,ua as getChatUserMutedStatus,fa as getLeaderboard,ga as getLeaderboardEntries,ma as getLeaderboardProfileRank,pa as getLeaderboards,Ys as getMessageCount,Js as getMessageList,na as getPostedWidgets,wa as getProfileBadges,ha as getProfileChatRoomMemberships,ba as getSponsors,Ws as getUserProfile,ta as getWidget,ya as getWidgetInteractions,Fs as init,ca as joinChatRoom,la as leaveChatRoom,Zs as prepareOutgoingChatMessage,ea as registerWidgetMode,Vs as removeMessageListener,ra as removeWidgetListener,Xs as sendMessage,oa as updateChatRoom,Qs as updateUserProfile,Ks as userProfile};