@streamlayer/react 1.18.2 → 1.18.3

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.
@@ -14,4 +14,4 @@
14
14
  `),c=`
15
15
  `+n+(i.length?o("│"):" ")+" ";return n+a.join(c)+`
16
16
  `+i.map(function(s,r){var d=r===i.length-1,b=s.nodes&&s.nodes.length,h=n+(d?" ":o("│"))+" ";return n+o(d?"└":"├")+o("─")+o(b?"┬":"─")+" "+e(s,h,l).slice(n.length+2)}).join("")};const fR=FR,sc=Symbol("avvio.TimeTree.untrackNode"),Ql=Symbol("avvio.TimeTree.trackNode"),rc=Symbol("avvio.TimeTree.getParent"),dc=Symbol("avvio.TimeTree.getNode"),uc=Symbol("avvio.TimeTree.addNode");let NR=class{constructor(){this.root=null,this.tableId=new Map,this.tableLabel=new Map}[Ql](e){this.tableId.set(e.id,e),this.tableLabel.has(e.label)?this.tableLabel.get(e.label).push(e):this.tableLabel.set(e.label,[e])}[sc](e){this.tableId.delete(e.id);const t=this.tableLabel.get(e.label);if(t.id){this.tableLabel.delete(e.label);return}t.pop(),t.length===0&&this.tableLabel.delete(e.label)}[rc](e){if(e===null)return this.root;const t=this.tableLabel.get(e);return t.id?t:t[t.length-1]}[dc](e){return this.tableId.get(e)}[uc](e,t,n){if(e===null)return this.root={id:"root",label:t,start:n,nodes:[]},this[Ql](this.root),this.root.id;const l=this[rc](e),o=`${t}-${Math.random()}`,i={id:o,parent:e,start:n,label:t,nodes:[]};return l.nodes.push(i),this[Ql](i),o}start(e,t,n=Date.now()){return this[uc](e,t,n)}stop(e,t=Date.now()){const n=this[dc](e);n&&(n.stop=t,n.diff=n.stop-n.start||0,this[sc](n))}toJSON(){return Object.assign({},this.root)}prittyPrint(){const e=n=>(n.label=`${n.label} ${n.diff} ms`,n.nodes.length>0&&(n.nodes=n.nodes.map(l=>e(l))),n),t=e(this.toJSON());return fR(t)}};var YR=NR,ri={exports:{}},Wo={exports:{}},zl,bc;function IR(){if(bc)return zl;bc=1;var e=1e3,t=e*60,n=t*60,l=n*24,o=l*7,i=l*365.25;zl=function(d,b){b=b||{};var h=typeof d;if(h==="string"&&d.length>0)return a(d);if(h==="number"&&isFinite(d))return b.long?s(d):c(d);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(d))};function a(d){if(d=String(d),!(d.length>100)){var b=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(d);if(b){var h=parseFloat(b[1]),V=(b[2]||"ms").toLowerCase();switch(V){case"years":case"year":case"yrs":case"yr":case"y":return h*i;case"weeks":case"week":case"w":return h*o;case"days":case"day":case"d":return h*l;case"hours":case"hour":case"hrs":case"hr":case"h":return h*n;case"minutes":case"minute":case"mins":case"min":case"m":return h*t;case"seconds":case"second":case"secs":case"sec":case"s":return h*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return h;default:return}}}}function c(d){var b=Math.abs(d);return b>=l?Math.round(d/l)+"d":b>=n?Math.round(d/n)+"h":b>=t?Math.round(d/t)+"m":b>=e?Math.round(d/e)+"s":d+"ms"}function s(d){var b=Math.abs(d);return b>=l?r(d,b,l,"day"):b>=n?r(d,b,n,"hour"):b>=t?r(d,b,t,"minute"):b>=e?r(d,b,e,"second"):d+" ms"}function r(d,b,h,V){var m=b>=h*1.5;return Math.round(d/h)+" "+V+(m?"s":"")}return zl}function UR(e){n.debug=n,n.default=n,n.coerce=s,n.disable=i,n.enable=o,n.enabled=a,n.humanize=IR(),n.destroy=r,Object.keys(e).forEach(d=>{n[d]=e[d]}),n.names=[],n.skips=[],n.formatters={};function t(d){let b=0;for(let h=0;h<d.length;h++)b=(b<<5)-b+d.charCodeAt(h),b|=0;return n.colors[Math.abs(b)%n.colors.length]}n.selectColor=t;function n(d){let b,h=null,V,m;function Z(...y){if(!Z.enabled)return;const A=Z,W=Number(new Date),S=W-(b||W);A.diff=S,A.prev=b,A.curr=W,b=W,y[0]=n.coerce(y[0]),typeof y[0]!="string"&&y.unshift("%O");let p=0;y[0]=y[0].replace(/%([a-zA-Z%])/g,(f,N)=>{if(f==="%%")return"%";p++;const F=n.formatters[N];if(typeof F=="function"){const U=y[p];f=F.call(A,U),y.splice(p,1),p--}return f}),n.formatArgs.call(A,y),(A.log||n.log).apply(A,y)}return Z.namespace=d,Z.useColors=n.useColors(),Z.color=n.selectColor(d),Z.extend=l,Z.destroy=n.destroy,Object.defineProperty(Z,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(V!==n.namespaces&&(V=n.namespaces,m=n.enabled(d)),m),set:y=>{h=y}}),typeof n.init=="function"&&n.init(Z),Z}function l(d,b){const h=n(this.namespace+(typeof b>"u"?":":b)+d);return h.log=this.log,h}function o(d){n.save(d),n.namespaces=d,n.names=[],n.skips=[];let b;const h=(typeof d=="string"?d:"").split(/[\s,]+/),V=h.length;for(b=0;b<V;b++)h[b]&&(d=h[b].replace(/\*/g,".*?"),d[0]==="-"?n.skips.push(new RegExp("^"+d.slice(1)+"$")):n.names.push(new RegExp("^"+d+"$")))}function i(){const d=[...n.names.map(c),...n.skips.map(c).map(b=>"-"+b)].join(",");return n.enable(""),d}function a(d){if(d[d.length-1]==="*")return!0;let b,h;for(b=0,h=n.skips.length;b<h;b++)if(n.skips[b].test(d))return!1;for(b=0,h=n.names.length;b<h;b++)if(n.names[b].test(d))return!0;return!1}function c(d){return d.toString().substring(2,d.toString().length-2).replace(/\.\*\?$/,"*")}function s(d){return d instanceof Error?d.stack||d.message:d}function r(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}var BR=UR;(function(e,t){t.formatArgs=l,t.save=o,t.load=i,t.useColors=n,t.storage=a(),t.destroy=(()=>{let s=!1;return()=>{s||(s=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function l(s){if(s[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+s[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;s.splice(1,0,r,"color: inherit");let d=0,b=0;s[0].replace(/%[a-zA-Z%]/g,h=>{h!=="%%"&&(d++,h==="%c"&&(b=d))}),s.splice(b,0,r)}t.log=console.debug||console.log||(()=>{});function o(s){try{s?t.storage.setItem("debug",s):t.storage.removeItem("debug")}catch{}}function i(){let s;try{s=t.storage.getItem("debug")}catch{}return!s&&typeof B<"u"&&"env"in B&&(s=B.env.DEBUG),s}function a(){try{return localStorage}catch{}}e.exports=BR(t);const{formatters:c}=e.exports;c.j=function(s){try{return JSON.stringify(s)}catch(r){return"[UnexpectedJSONParseError]: "+r.message}}})(Wo,Wo.exports);var Wr=Wo.exports;const CR=Hs,JR=tr.EventEmitter,vR=rl.inherits,Ze=Wr("avvio"),{AVV_ERR_READY_TIMEOUT:TR}=gr,wl=Symbol.for("plugin-meta");function kR(e,t){return e[wl]&&e[wl].name?e[wl].name:typeof t<"u"&&typeof t!="function"&&t.name?t.name:e.name?e.name:e.toString().split(`
17
- `).slice(0,2).map(n=>n.trim()).join(" -- ")}function QR(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function jt(e,t,n,l,o){this.started=!1,this.func=t,this.opts=n,this.onFinish=null,this.parent=e,this.timeout=o===void 0?e._timeout:o,this.name=kR(t,n),this.isAfter=l,this.q=CR(e,zR,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}vR(jt,JR);jt.prototype.exec=function(e,t){const n=this.func;let l=!1;const o=this.name;if(this.parent._error&&!this.isAfter){Ze("skipping loading of plugin as parent errored and it is not an after",o),B.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(s){return Ze("override errored",o),t(s)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,Ze("exec",o);let i;const a=s=>{if(l){Ze("loading complete",o);return}this._error=s,Ze(s?"exec errored":"exec completed",o),l=!0,i&&clearTimeout(i),t(s)};this.timeout>0&&(Ze("setting up timeout",o,this.timeout),i=setTimeout(function(){Ze("timed out",o),i=null;const s=new TR(o);s.fn=n,a(s)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const c=n(this.server,this.opts,a);c&&typeof c.then=="function"&&(Ze("exec: resolving promise",o),c.then(()=>B.nextTick(a),s=>B.nextTick(a,s)))};jt.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,l)=>{this._error=n,this.q.pause(),n?(Ze("rejecting promise",this.name,n),this._promise.reject(n)):(Ze("resolving promise",this.name),this._promise.resolve()),this._promise=null,B.nextTick(l,n)}),this.q.resume()};let t;return this._promise?t=Promise.resolve():(this._promise=QR(),t=this._promise.promise,this.server?e():this.on("start",e)),t};jt.prototype.enqueue=function(e,t){Ze("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};jt.prototype.finish=function(e,t){Ze("finish",this.name,e);const n=()=>{this.loaded||(Ze("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,t(e))};if(e){this._promise&&(this._promise.reject(e),this._promise=null),n();return}const l=()=>{if(Ze("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const o=()=>{Ze("wrap"),queueMicrotask(l)};this._promise.resolve(),this._promise.promise.then(o,o),this._promise=null}else n();else Ze("delayed",this.name),this.q.drain=()=>{Ze("drain",this.name),this.q.drain=wR,queueMicrotask(l)}};queueMicrotask(l),this.q.resume()};function zR(e,t){const n=this;B.nextTick(di.bind(n),e,t)}function di(e,t){if(typeof e.func.then=="function"){e.func.then(l=>{typeof l.default=="function"&&(l=l.default),e.func=l,di.call(this,e,t)},t);return}const n=this._current[0];this._current.unshift(e),e.exec(n&&n.server||this._server,l=>{e.finish(l,o=>{this._current.shift(),t(o)})})}function wR(){}ri.exports=jt;ri.exports.loadPlugin=di;var KR=ri.exports;const Vc=Hs,LR=tr.EventEmitter,xR=rl.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:Kl,AVV_ERR_CALLBACK_NOT_FN:nn,AVV_ERR_PLUGIN_NOT_VALID:MR,AVV_ERR_ROOT_PLG_BOOTED:HR,AVV_ERR_READY_TIMEOUT:OR}=gr,DR=YR,Zo=KR,Ht=Wr("avvio"),qn=Symbol("kAvvio"),Ll=Symbol("kThenifyDoNotWrap");function jR(e,t,n){const l=t.expose||{},o=l.use||"use",i=l.after||"after",a=l.ready||"ready",c=l.onClose||"onClose",s=l.close||"close";if(e[o])throw new Kl(o);if(e[i])throw new Kl(i);if(e[a])throw new Kl(a);e[o]=function(r,d){return n.use(r,d),this},Object.defineProperty(e,"then",{get:Zr.bind(n)}),e[qn]=!0,e[i]=function(r){return typeof r!="function"?n._loadRegistered():(n.after(xl(r,this)),this)},e[a]=function(r){if(r&&typeof r!="function")throw new nn(a,typeof r);return n.ready(r?xl(r,this):void 0)},e[c]=function(r){if(typeof r!="function")throw new nn(c,typeof r);return n.onClose(eg(r,this)),this},e[s]=function(r){if(r&&typeof r!="function")throw new nn(s,typeof r);return r?(n.close(xl(r,this)),this):n.close()}}function Re(e,t,n){if(typeof e=="function"&&arguments.length===1&&(n=e,t={},e=null),typeof t=="function"&&(n=t,t={}),t=t||{},!(this instanceof Re)){const l=new Re(e,t,n);return e&&jR(e,t,l),l}t.autostart!==!1&&(t.autostart=!0),e=e||this,this._timeout=Number(t.timeout)||0,this._server=e,this._current=[],this._error=null,this._isOnCloseHandlerKey=Symbol("isOnCloseHandler"),this._lastUsed=null,this.setMaxListeners(0),n&&this.once("start",n),this.started=!1,this.booted=!1,this.pluginTree=new DR,this._readyQ=Vc(this,Er,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=hc},this._closeQ=Vc(this,$R,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=hc},this._doStart=null,this._root=new Zo(this,PR.bind(this),t,!1,0),this._root.once("start",(l,o,i)=>{const a=this.pluginTree.start(null,o,i);this._root.once("loaded",(c,s,r)=>{this.pluginTree.stop(a,r)})}),Zo.loadPlugin.call(this,this._root,l=>{Ht("root plugin ready");try{this.emit("preReady"),this._root=null}catch(o){l=l||this._error||o}if(l){if(this._error=l,this._readyQ.length()===0)throw l}else this.booted=!0;this._readyQ.resume()})}function PR(e,t,n){this._doStart=n,t.autostart&&this.start()}xR(Re,LR);Re.prototype.start=function(){return this.started=!0,B.nextTick(this._doStart),this};Re.prototype.override=function(e,t,n){return e};function _R(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new MR(typeof e);return e}Re.prototype[qn]=!0;Re.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};Re.prototype._loadRegistered=function(){const e=this._current[0];return!this.started&&!this.booted&&B.nextTick(()=>this._root.q.resume()),e?e.loadedSoFar():Promise.resolve()};Object.defineProperty(Re.prototype,"then",{get:Zr});Re.prototype._addPlugin=function(e,t,n){if(e=_R(e),t=t||{},this.booted)throw new HR;const l=this._current[0],o=new Zo(this,e,t,n);if(o.once("start",(i,a,c)=>{const s=this.pluginTree.start(l.name,a,c);o.once("loaded",(r,d,b)=>{this.pluginTree.stop(s,b)})}),l.loaded)throw new Error(o.name,l.name);return l.enqueue(o,i=>{i&&(this._error=i)}),o};Re.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,l,o){Er.call(this,e,o)}return this};Re.prototype.onClose=function(e){if(typeof e!="function")throw new Error("not a function");e[this._isOnCloseHandlerKey]=!0,this._closeQ.unshift(e,t.bind(this));function t(n){n&&(this._error=n)}return this};Re.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new nn("close",typeof e)}else t=new Promise(function(n,l){e=function(o){if(o)return l(o);n()}});return this.ready(()=>{this._error=null,this._closeQ.push(e),B.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};Re.prototype.ready=function(e){if(e){if(typeof e!="function")throw new nn("ready",typeof e);this._readyQ.push(e),queueMicrotask(this.start.bind(this));return}return new Promise((t,n)=>{this._readyQ.push(o),this.start();const l=this._current[0].server;function o(i,a,c){i?n(i):t(l),B.nextTick(c)}})};Re.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};Re.prototype.toJSON=function(){return this.pluginTree.toJSON()};function hc(){}function Zr(){if(this.booted){Ht("thenify returning null because we are already booted");return}if(this[Ll]){this[Ll]=!1;return}return Ht("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[Ll]=!0,e(this._server)),t)}function Er(e,t){const n=this._server,l=this._error;let o;if(this._error=null,e.length===0)this._error=l,o=e(),o&&!o[qn]&&typeof o.then=="function"?o.then(()=>B.nextTick(t),i=>B.nextTick(t,i)):B.nextTick(t);else if(e.length===1)o=e(l),o&&!o[qn]&&typeof o.then=="function"?o.then(()=>B.nextTick(t),i=>B.nextTick(t,i)):B.nextTick(t);else if(this._timeout===0){const i=a=>{this._error=a,t(this._error)};e.length===2?e(l,i):e(l,n,i)}else qR.call(this,e,l,n,t)}function qR(e,t,n,l){const o=e.name;Ht("setting up ready timeout",o,this._timeout);let i=setTimeout(()=>{Ht("timed out",o),i=null;const c=new OR(o);c.fn=e,this._error=c,l(c)},this._timeout);e.length===2?e(t,a.bind(this)):e(t,n,a.bind(this));function a(c){i&&(clearTimeout(i),this._error=c,l(this._error))}}function $R(e,t){const n=this._server,l=e[this._isOnCloseHandlerKey];if(e.length===0||e.length===1){let o;l?o=e(n):o=e(this._error),o&&typeof o.then=="function"?(Ht("resolving close/onClose promise"),o.then(()=>B.nextTick(t),i=>B.nextTick(t,i))):B.nextTick(t)}else e.length===2?e(l?n:this._error,t):l?e(n,t):e(this._error,n,t)}function eg(e,t){return n.bind(t);function n(l,o){let i;e.length===0?(i=e(),i&&i.then?i.then(function(){B.nextTick(o)},o):B.nextTick(o)):e.length===1?(i=e(this),i&&i.then?i.then(function(){B.nextTick(o)},o):B.nextTick(o)):e(this,o)}}function xl(e,t){return n.bind(t);function n(l,o){let i;e?e.length===0?(i=e(),i&&i.then?i.then(function(){B.nextTick(o,l)},o):B.nextTick(o,l)):e.length===1?(i=e(l),i&&i.then?i.then(function(){B.nextTick(o)},o):B.nextTick(o)):e.length===2?e(l,o):e(l,this,o):B.nextTick(o)}}qo.exports=Re;qo.exports.express=function(e){return Re(e,{expose:{use:"load"}})};var tg=qo.exports;const ng=Ym(tg);(function(){if(window.requestAnimationFrame&&window.cancelAnimationFrame)return;const e=["webkit","moz","ms","o"];for(const t of e)window.requestAnimationFrame=window.requestAnimationFrame||window[`${t}RequestAnimationFrame`],window.cancelAnimationFrame=window.cancelAnimationFrame||window[`${t}CancelAnimationFrame`]||window[`${t}CancelRequestAnimationFrame`];if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){let t=0;const n=!!(window.performance&&window.performance.now);window.requestAnimationFrame=function(l){const o=n?window.performance.now():new Date().getTime(),i=Math.max(0,16-(o-t)),a=window.setTimeout(function(){l(o+i)},i);return t=o+i,a},window.cancelAnimationFrame=clearTimeout}})();function lg(e,t=!0,n=!0,l={friendsTab:"enabled"}){const o=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",i=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",a=ng(Object.create({}),{autostart:!1});return a.use(cm,{hideFriends:l.hideFriends,skipOnboarding:l.skipOnboarding,betPack:l.betPack,friendsTab:l.friendsTab,theme:l.theme,themeMode:l.themeMode}),a.use(em,{onDeepLinkHandled:l==null?void 0:l.onDeepLinkHandled}),a.use(om,{videoPlayerController:l==null?void 0:l.videoPlayerController}),a.use(am,{onContentActivate:l==null?void 0:l.onContentActivate,withAd:l==null?void 0:l.withAd,withAdNotification:l==null?void 0:l.withAdNotification}),a.use(Zh,{sdkKey:e,host:o,analyticsHost:i,version:l==null?void 0:l.version,webOS:l==null?void 0:l.webOS}),a.use(Xh),a.use(lm),a.use(gm),a.use(Oh),a.use(Nm),a.after((c,s,r)=>{if(c)throw c;s.ready(),r()}),n&&a.after(async(c,s,r)=>{if(c)throw c;await s.sdk.initializeApp(),r()}),a.onClose(()=>{console.log("close")}),a}const og=({sdkKey:e,plugins:t,production:n,autoEnable:l,onDeepLinkHandled:o,videoPlayerController:i,onContentActivate:a,hideFriends:c,skipOnboarding:s,withAdNotification:r,withAd:d,friendsTab:b,betPack:h,webOS:V})=>{const[m,Z]=bi.useState(null);return bi.useEffect(()=>{let y=!1;if(!e)return console.error("streamlayer sdk key should be provided"),Z(W=>(W!==null&&typeof W.disableApp=="function"&&W.disableApp(),null)),()=>{y=!0};const A=lg(e,n,l,{version:"1.18.2",onDeepLinkHandled:o,videoPlayerController:i,onContentActivate:a,skipOnboarding:s,withAdNotification:r,withAd:d,hideFriends:c,friendsTab:b,betPack:h,webOS:V});if(t)for(const W of t)A.use(W);return A.ready().then(W=>{y||(Z(W.sdk),typeof window<"u")}).catch(W=>console.log(W)),()=>{y=!0,A.close(function(W){if(W)throw W})}},[e,n]),m};exports.AdUnit=fe;exports.AutoPlayVideo=Du;exports.CloseTimerAuto=Hu;exports.ConnectError=x;exports.CtaIconMode=Bu;exports.InvitationFrom=to;exports.NotificationEnabled=eo;exports.NotificationPromotionImagePosition=Nu;exports.NotificationPromotionMode=Fu;exports.NotificationSponsorLogoMode=Iu;exports.NotificationUseContentMedia=Lu;exports.PickHistoryStatus=qt;exports.PlayVideoMuted=Pu;exports.PromotionButtonType=vu;exports.PromotionLogoMode=ku;exports.PromotionType=k;exports.QuestionImages=Xu;exports.QuestionStatus=be;exports.QuestionType=C;exports.SdkOverlayType=ee;exports.createContextKey=oo;exports.global=io;exports.pino_1=Ec;exports.unsafeStringify=Vs;exports.useStreamLayerApp=og;exports.v4=sn;
17
+ `).slice(0,2).map(n=>n.trim()).join(" -- ")}function QR(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function jt(e,t,n,l,o){this.started=!1,this.func=t,this.opts=n,this.onFinish=null,this.parent=e,this.timeout=o===void 0?e._timeout:o,this.name=kR(t,n),this.isAfter=l,this.q=CR(e,zR,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}vR(jt,JR);jt.prototype.exec=function(e,t){const n=this.func;let l=!1;const o=this.name;if(this.parent._error&&!this.isAfter){Ze("skipping loading of plugin as parent errored and it is not an after",o),B.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(s){return Ze("override errored",o),t(s)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,Ze("exec",o);let i;const a=s=>{if(l){Ze("loading complete",o);return}this._error=s,Ze(s?"exec errored":"exec completed",o),l=!0,i&&clearTimeout(i),t(s)};this.timeout>0&&(Ze("setting up timeout",o,this.timeout),i=setTimeout(function(){Ze("timed out",o),i=null;const s=new TR(o);s.fn=n,a(s)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const c=n(this.server,this.opts,a);c&&typeof c.then=="function"&&(Ze("exec: resolving promise",o),c.then(()=>B.nextTick(a),s=>B.nextTick(a,s)))};jt.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,l)=>{this._error=n,this.q.pause(),n?(Ze("rejecting promise",this.name,n),this._promise.reject(n)):(Ze("resolving promise",this.name),this._promise.resolve()),this._promise=null,B.nextTick(l,n)}),this.q.resume()};let t;return this._promise?t=Promise.resolve():(this._promise=QR(),t=this._promise.promise,this.server?e():this.on("start",e)),t};jt.prototype.enqueue=function(e,t){Ze("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};jt.prototype.finish=function(e,t){Ze("finish",this.name,e);const n=()=>{this.loaded||(Ze("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,t(e))};if(e){this._promise&&(this._promise.reject(e),this._promise=null),n();return}const l=()=>{if(Ze("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const o=()=>{Ze("wrap"),queueMicrotask(l)};this._promise.resolve(),this._promise.promise.then(o,o),this._promise=null}else n();else Ze("delayed",this.name),this.q.drain=()=>{Ze("drain",this.name),this.q.drain=wR,queueMicrotask(l)}};queueMicrotask(l),this.q.resume()};function zR(e,t){const n=this;B.nextTick(di.bind(n),e,t)}function di(e,t){if(typeof e.func.then=="function"){e.func.then(l=>{typeof l.default=="function"&&(l=l.default),e.func=l,di.call(this,e,t)},t);return}const n=this._current[0];this._current.unshift(e),e.exec(n&&n.server||this._server,l=>{e.finish(l,o=>{this._current.shift(),t(o)})})}function wR(){}ri.exports=jt;ri.exports.loadPlugin=di;var KR=ri.exports;const Vc=Hs,LR=tr.EventEmitter,xR=rl.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:Kl,AVV_ERR_CALLBACK_NOT_FN:nn,AVV_ERR_PLUGIN_NOT_VALID:MR,AVV_ERR_ROOT_PLG_BOOTED:HR,AVV_ERR_READY_TIMEOUT:OR}=gr,DR=YR,Zo=KR,Ht=Wr("avvio"),qn=Symbol("kAvvio"),Ll=Symbol("kThenifyDoNotWrap");function jR(e,t,n){const l=t.expose||{},o=l.use||"use",i=l.after||"after",a=l.ready||"ready",c=l.onClose||"onClose",s=l.close||"close";if(e[o])throw new Kl(o);if(e[i])throw new Kl(i);if(e[a])throw new Kl(a);e[o]=function(r,d){return n.use(r,d),this},Object.defineProperty(e,"then",{get:Zr.bind(n)}),e[qn]=!0,e[i]=function(r){return typeof r!="function"?n._loadRegistered():(n.after(xl(r,this)),this)},e[a]=function(r){if(r&&typeof r!="function")throw new nn(a,typeof r);return n.ready(r?xl(r,this):void 0)},e[c]=function(r){if(typeof r!="function")throw new nn(c,typeof r);return n.onClose(eg(r,this)),this},e[s]=function(r){if(r&&typeof r!="function")throw new nn(s,typeof r);return r?(n.close(xl(r,this)),this):n.close()}}function Re(e,t,n){if(typeof e=="function"&&arguments.length===1&&(n=e,t={},e=null),typeof t=="function"&&(n=t,t={}),t=t||{},!(this instanceof Re)){const l=new Re(e,t,n);return e&&jR(e,t,l),l}t.autostart!==!1&&(t.autostart=!0),e=e||this,this._timeout=Number(t.timeout)||0,this._server=e,this._current=[],this._error=null,this._isOnCloseHandlerKey=Symbol("isOnCloseHandler"),this._lastUsed=null,this.setMaxListeners(0),n&&this.once("start",n),this.started=!1,this.booted=!1,this.pluginTree=new DR,this._readyQ=Vc(this,Er,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=hc},this._closeQ=Vc(this,$R,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=hc},this._doStart=null,this._root=new Zo(this,PR.bind(this),t,!1,0),this._root.once("start",(l,o,i)=>{const a=this.pluginTree.start(null,o,i);this._root.once("loaded",(c,s,r)=>{this.pluginTree.stop(a,r)})}),Zo.loadPlugin.call(this,this._root,l=>{Ht("root plugin ready");try{this.emit("preReady"),this._root=null}catch(o){l=l||this._error||o}if(l){if(this._error=l,this._readyQ.length()===0)throw l}else this.booted=!0;this._readyQ.resume()})}function PR(e,t,n){this._doStart=n,t.autostart&&this.start()}xR(Re,LR);Re.prototype.start=function(){return this.started=!0,B.nextTick(this._doStart),this};Re.prototype.override=function(e,t,n){return e};function _R(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new MR(typeof e);return e}Re.prototype[qn]=!0;Re.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};Re.prototype._loadRegistered=function(){const e=this._current[0];return!this.started&&!this.booted&&B.nextTick(()=>this._root.q.resume()),e?e.loadedSoFar():Promise.resolve()};Object.defineProperty(Re.prototype,"then",{get:Zr});Re.prototype._addPlugin=function(e,t,n){if(e=_R(e),t=t||{},this.booted)throw new HR;const l=this._current[0],o=new Zo(this,e,t,n);if(o.once("start",(i,a,c)=>{const s=this.pluginTree.start(l.name,a,c);o.once("loaded",(r,d,b)=>{this.pluginTree.stop(s,b)})}),l.loaded)throw new Error(o.name,l.name);return l.enqueue(o,i=>{i&&(this._error=i)}),o};Re.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,l,o){Er.call(this,e,o)}return this};Re.prototype.onClose=function(e){if(typeof e!="function")throw new Error("not a function");e[this._isOnCloseHandlerKey]=!0,this._closeQ.unshift(e,t.bind(this));function t(n){n&&(this._error=n)}return this};Re.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new nn("close",typeof e)}else t=new Promise(function(n,l){e=function(o){if(o)return l(o);n()}});return this.ready(()=>{this._error=null,this._closeQ.push(e),B.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};Re.prototype.ready=function(e){if(e){if(typeof e!="function")throw new nn("ready",typeof e);this._readyQ.push(e),queueMicrotask(this.start.bind(this));return}return new Promise((t,n)=>{this._readyQ.push(o),this.start();const l=this._current[0].server;function o(i,a,c){i?n(i):t(l),B.nextTick(c)}})};Re.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};Re.prototype.toJSON=function(){return this.pluginTree.toJSON()};function hc(){}function Zr(){if(this.booted){Ht("thenify returning null because we are already booted");return}if(this[Ll]){this[Ll]=!1;return}return Ht("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[Ll]=!0,e(this._server)),t)}function Er(e,t){const n=this._server,l=this._error;let o;if(this._error=null,e.length===0)this._error=l,o=e(),o&&!o[qn]&&typeof o.then=="function"?o.then(()=>B.nextTick(t),i=>B.nextTick(t,i)):B.nextTick(t);else if(e.length===1)o=e(l),o&&!o[qn]&&typeof o.then=="function"?o.then(()=>B.nextTick(t),i=>B.nextTick(t,i)):B.nextTick(t);else if(this._timeout===0){const i=a=>{this._error=a,t(this._error)};e.length===2?e(l,i):e(l,n,i)}else qR.call(this,e,l,n,t)}function qR(e,t,n,l){const o=e.name;Ht("setting up ready timeout",o,this._timeout);let i=setTimeout(()=>{Ht("timed out",o),i=null;const c=new OR(o);c.fn=e,this._error=c,l(c)},this._timeout);e.length===2?e(t,a.bind(this)):e(t,n,a.bind(this));function a(c){i&&(clearTimeout(i),this._error=c,l(this._error))}}function $R(e,t){const n=this._server,l=e[this._isOnCloseHandlerKey];if(e.length===0||e.length===1){let o;l?o=e(n):o=e(this._error),o&&typeof o.then=="function"?(Ht("resolving close/onClose promise"),o.then(()=>B.nextTick(t),i=>B.nextTick(t,i))):B.nextTick(t)}else e.length===2?e(l?n:this._error,t):l?e(n,t):e(this._error,n,t)}function eg(e,t){return n.bind(t);function n(l,o){let i;e.length===0?(i=e(),i&&i.then?i.then(function(){B.nextTick(o)},o):B.nextTick(o)):e.length===1?(i=e(this),i&&i.then?i.then(function(){B.nextTick(o)},o):B.nextTick(o)):e(this,o)}}function xl(e,t){return n.bind(t);function n(l,o){let i;e?e.length===0?(i=e(),i&&i.then?i.then(function(){B.nextTick(o,l)},o):B.nextTick(o,l)):e.length===1?(i=e(l),i&&i.then?i.then(function(){B.nextTick(o)},o):B.nextTick(o)):e.length===2?e(l,o):e(l,this,o):B.nextTick(o)}}qo.exports=Re;qo.exports.express=function(e){return Re(e,{expose:{use:"load"}})};var tg=qo.exports;const ng=Ym(tg);(function(){if(window.requestAnimationFrame&&window.cancelAnimationFrame)return;const e=["webkit","moz","ms","o"];for(const t of e)window.requestAnimationFrame=window.requestAnimationFrame||window[`${t}RequestAnimationFrame`],window.cancelAnimationFrame=window.cancelAnimationFrame||window[`${t}CancelAnimationFrame`]||window[`${t}CancelRequestAnimationFrame`];if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){let t=0;const n=!!(window.performance&&window.performance.now);window.requestAnimationFrame=function(l){const o=n?window.performance.now():new Date().getTime(),i=Math.max(0,16-(o-t)),a=window.setTimeout(function(){l(o+i)},i);return t=o+i,a},window.cancelAnimationFrame=clearTimeout}})();function lg(e,t=!0,n=!0,l={friendsTab:"enabled"}){const o=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",i=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",a=ng(Object.create({}),{autostart:!1});return a.use(cm,{hideFriends:l.hideFriends,skipOnboarding:l.skipOnboarding,betPack:l.betPack,friendsTab:l.friendsTab,theme:l.theme,themeMode:l.themeMode}),a.use(em,{onDeepLinkHandled:l==null?void 0:l.onDeepLinkHandled}),a.use(om,{videoPlayerController:l==null?void 0:l.videoPlayerController}),a.use(am,{onContentActivate:l==null?void 0:l.onContentActivate,withAd:l==null?void 0:l.withAd,withAdNotification:l==null?void 0:l.withAdNotification}),a.use(Zh,{sdkKey:e,host:o,analyticsHost:i,version:l==null?void 0:l.version,webOS:l==null?void 0:l.webOS}),a.use(Xh),a.use(lm),a.use(gm),a.use(Oh),a.use(Nm),a.after((c,s,r)=>{if(c)throw c;s.ready(),r()}),n&&a.after(async(c,s,r)=>{if(c)throw c;await s.sdk.initializeApp(),r()}),a.onClose(()=>{console.log("close")}),a}const og=({sdkKey:e,plugins:t,production:n,autoEnable:l,onDeepLinkHandled:o,videoPlayerController:i,onContentActivate:a,hideFriends:c,skipOnboarding:s,withAdNotification:r,withAd:d,friendsTab:b,betPack:h,webOS:V})=>{const[m,Z]=bi.useState(null);return bi.useEffect(()=>{let y=!1;if(!e)return console.error("streamlayer sdk key should be provided"),Z(W=>(W!==null&&typeof W.disableApp=="function"&&W.disableApp(),null)),()=>{y=!0};const A=lg(e,n,l,{version:"1.18.3",onDeepLinkHandled:o,videoPlayerController:i,onContentActivate:a,skipOnboarding:s,withAdNotification:r,withAd:d,hideFriends:c,friendsTab:b,betPack:h,webOS:V});if(t)for(const W of t)A.use(W);return A.ready().then(W=>{y||(Z(W.sdk),typeof window<"u")}).catch(W=>console.log(W)),()=>{y=!0,A.close(function(W){if(W)throw W})}},[e,n]),m};exports.AdUnit=fe;exports.AutoPlayVideo=Du;exports.CloseTimerAuto=Hu;exports.ConnectError=x;exports.CtaIconMode=Bu;exports.InvitationFrom=to;exports.NotificationEnabled=eo;exports.NotificationPromotionImagePosition=Nu;exports.NotificationPromotionMode=Fu;exports.NotificationSponsorLogoMode=Iu;exports.NotificationUseContentMedia=Lu;exports.PickHistoryStatus=qt;exports.PlayVideoMuted=Pu;exports.PromotionButtonType=vu;exports.PromotionLogoMode=ku;exports.PromotionType=k;exports.QuestionImages=Xu;exports.QuestionStatus=be;exports.QuestionType=C;exports.SdkOverlayType=ee;exports.createContextKey=oo;exports.global=io;exports.pino_1=Ec;exports.unsafeStringify=Vs;exports.useStreamLayerApp=og;exports.v4=sn;
@@ -14,4 +14,4 @@
14
14
  `),c=`
15
15
  `+n+(i.length?o("│"):" ")+" ";return n+a.join(c)+`
16
16
  `+i.map(function(s,r){var d=r===i.length-1,b=s.nodes&&s.nodes.length,h=n+(d?" ":o("│"))+" ";return n+o(d?"└":"├")+o("─")+o(b?"┬":"─")+" "+e(s,h,l).slice(n.length+2)}).join("")};const fR=FR,sc=Symbol("avvio.TimeTree.untrackNode"),Ql=Symbol("avvio.TimeTree.trackNode"),rc=Symbol("avvio.TimeTree.getParent"),dc=Symbol("avvio.TimeTree.getNode"),uc=Symbol("avvio.TimeTree.addNode");let NR=class{constructor(){this.root=null,this.tableId=new Map,this.tableLabel=new Map}[Ql](e){this.tableId.set(e.id,e),this.tableLabel.has(e.label)?this.tableLabel.get(e.label).push(e):this.tableLabel.set(e.label,[e])}[sc](e){this.tableId.delete(e.id);const t=this.tableLabel.get(e.label);if(t.id){this.tableLabel.delete(e.label);return}t.pop(),t.length===0&&this.tableLabel.delete(e.label)}[rc](e){if(e===null)return this.root;const t=this.tableLabel.get(e);return t.id?t:t[t.length-1]}[dc](e){return this.tableId.get(e)}[uc](e,t,n){if(e===null)return this.root={id:"root",label:t,start:n,nodes:[]},this[Ql](this.root),this.root.id;const l=this[rc](e),o=`${t}-${Math.random()}`,i={id:o,parent:e,start:n,label:t,nodes:[]};return l.nodes.push(i),this[Ql](i),o}start(e,t,n=Date.now()){return this[uc](e,t,n)}stop(e,t=Date.now()){const n=this[dc](e);n&&(n.stop=t,n.diff=n.stop-n.start||0,this[sc](n))}toJSON(){return Object.assign({},this.root)}prittyPrint(){const e=n=>(n.label=`${n.label} ${n.diff} ms`,n.nodes.length>0&&(n.nodes=n.nodes.map(l=>e(l))),n),t=e(this.toJSON());return fR(t)}};var YR=NR,ri={exports:{}},Wo={exports:{}},zl,bc;function IR(){if(bc)return zl;bc=1;var e=1e3,t=e*60,n=t*60,l=n*24,o=l*7,i=l*365.25;zl=function(d,b){b=b||{};var h=typeof d;if(h==="string"&&d.length>0)return a(d);if(h==="number"&&isFinite(d))return b.long?s(d):c(d);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(d))};function a(d){if(d=String(d),!(d.length>100)){var b=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(d);if(b){var h=parseFloat(b[1]),V=(b[2]||"ms").toLowerCase();switch(V){case"years":case"year":case"yrs":case"yr":case"y":return h*i;case"weeks":case"week":case"w":return h*o;case"days":case"day":case"d":return h*l;case"hours":case"hour":case"hrs":case"hr":case"h":return h*n;case"minutes":case"minute":case"mins":case"min":case"m":return h*t;case"seconds":case"second":case"secs":case"sec":case"s":return h*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return h;default:return}}}}function c(d){var b=Math.abs(d);return b>=l?Math.round(d/l)+"d":b>=n?Math.round(d/n)+"h":b>=t?Math.round(d/t)+"m":b>=e?Math.round(d/e)+"s":d+"ms"}function s(d){var b=Math.abs(d);return b>=l?r(d,b,l,"day"):b>=n?r(d,b,n,"hour"):b>=t?r(d,b,t,"minute"):b>=e?r(d,b,e,"second"):d+" ms"}function r(d,b,h,V){var m=b>=h*1.5;return Math.round(d/h)+" "+V+(m?"s":"")}return zl}function UR(e){n.debug=n,n.default=n,n.coerce=s,n.disable=i,n.enable=o,n.enabled=a,n.humanize=IR(),n.destroy=r,Object.keys(e).forEach(d=>{n[d]=e[d]}),n.names=[],n.skips=[],n.formatters={};function t(d){let b=0;for(let h=0;h<d.length;h++)b=(b<<5)-b+d.charCodeAt(h),b|=0;return n.colors[Math.abs(b)%n.colors.length]}n.selectColor=t;function n(d){let b,h=null,V,m;function Z(...y){if(!Z.enabled)return;const A=Z,W=Number(new Date),S=W-(b||W);A.diff=S,A.prev=b,A.curr=W,b=W,y[0]=n.coerce(y[0]),typeof y[0]!="string"&&y.unshift("%O");let p=0;y[0]=y[0].replace(/%([a-zA-Z%])/g,(f,N)=>{if(f==="%%")return"%";p++;const F=n.formatters[N];if(typeof F=="function"){const U=y[p];f=F.call(A,U),y.splice(p,1),p--}return f}),n.formatArgs.call(A,y),(A.log||n.log).apply(A,y)}return Z.namespace=d,Z.useColors=n.useColors(),Z.color=n.selectColor(d),Z.extend=l,Z.destroy=n.destroy,Object.defineProperty(Z,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(V!==n.namespaces&&(V=n.namespaces,m=n.enabled(d)),m),set:y=>{h=y}}),typeof n.init=="function"&&n.init(Z),Z}function l(d,b){const h=n(this.namespace+(typeof b>"u"?":":b)+d);return h.log=this.log,h}function o(d){n.save(d),n.namespaces=d,n.names=[],n.skips=[];let b;const h=(typeof d=="string"?d:"").split(/[\s,]+/),V=h.length;for(b=0;b<V;b++)h[b]&&(d=h[b].replace(/\*/g,".*?"),d[0]==="-"?n.skips.push(new RegExp("^"+d.slice(1)+"$")):n.names.push(new RegExp("^"+d+"$")))}function i(){const d=[...n.names.map(c),...n.skips.map(c).map(b=>"-"+b)].join(",");return n.enable(""),d}function a(d){if(d[d.length-1]==="*")return!0;let b,h;for(b=0,h=n.skips.length;b<h;b++)if(n.skips[b].test(d))return!1;for(b=0,h=n.names.length;b<h;b++)if(n.names[b].test(d))return!0;return!1}function c(d){return d.toString().substring(2,d.toString().length-2).replace(/\.\*\?$/,"*")}function s(d){return d instanceof Error?d.stack||d.message:d}function r(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}var BR=UR;(function(e,t){t.formatArgs=l,t.save=o,t.load=i,t.useColors=n,t.storage=a(),t.destroy=(()=>{let s=!1;return()=>{s||(s=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function l(s){if(s[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+s[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;s.splice(1,0,r,"color: inherit");let d=0,b=0;s[0].replace(/%[a-zA-Z%]/g,h=>{h!=="%%"&&(d++,h==="%c"&&(b=d))}),s.splice(b,0,r)}t.log=console.debug||console.log||(()=>{});function o(s){try{s?t.storage.setItem("debug",s):t.storage.removeItem("debug")}catch{}}function i(){let s;try{s=t.storage.getItem("debug")}catch{}return!s&&typeof B<"u"&&"env"in B&&(s=B.env.DEBUG),s}function a(){try{return localStorage}catch{}}e.exports=BR(t);const{formatters:c}=e.exports;c.j=function(s){try{return JSON.stringify(s)}catch(r){return"[UnexpectedJSONParseError]: "+r.message}}})(Wo,Wo.exports);var Wr=Wo.exports;const CR=Hs,JR=tr.EventEmitter,vR=rl.inherits,Ze=Wr("avvio"),{AVV_ERR_READY_TIMEOUT:TR}=gr,wl=Symbol.for("plugin-meta");function kR(e,t){return e[wl]&&e[wl].name?e[wl].name:typeof t<"u"&&typeof t!="function"&&t.name?t.name:e.name?e.name:e.toString().split(`
17
- `).slice(0,2).map(n=>n.trim()).join(" -- ")}function QR(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function jt(e,t,n,l,o){this.started=!1,this.func=t,this.opts=n,this.onFinish=null,this.parent=e,this.timeout=o===void 0?e._timeout:o,this.name=kR(t,n),this.isAfter=l,this.q=CR(e,zR,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}vR(jt,JR);jt.prototype.exec=function(e,t){const n=this.func;let l=!1;const o=this.name;if(this.parent._error&&!this.isAfter){Ze("skipping loading of plugin as parent errored and it is not an after",o),B.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(s){return Ze("override errored",o),t(s)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,Ze("exec",o);let i;const a=s=>{if(l){Ze("loading complete",o);return}this._error=s,Ze(s?"exec errored":"exec completed",o),l=!0,i&&clearTimeout(i),t(s)};this.timeout>0&&(Ze("setting up timeout",o,this.timeout),i=setTimeout(function(){Ze("timed out",o),i=null;const s=new TR(o);s.fn=n,a(s)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const c=n(this.server,this.opts,a);c&&typeof c.then=="function"&&(Ze("exec: resolving promise",o),c.then(()=>B.nextTick(a),s=>B.nextTick(a,s)))};jt.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,l)=>{this._error=n,this.q.pause(),n?(Ze("rejecting promise",this.name,n),this._promise.reject(n)):(Ze("resolving promise",this.name),this._promise.resolve()),this._promise=null,B.nextTick(l,n)}),this.q.resume()};let t;return this._promise?t=Promise.resolve():(this._promise=QR(),t=this._promise.promise,this.server?e():this.on("start",e)),t};jt.prototype.enqueue=function(e,t){Ze("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};jt.prototype.finish=function(e,t){Ze("finish",this.name,e);const n=()=>{this.loaded||(Ze("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,t(e))};if(e){this._promise&&(this._promise.reject(e),this._promise=null),n();return}const l=()=>{if(Ze("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const o=()=>{Ze("wrap"),queueMicrotask(l)};this._promise.resolve(),this._promise.promise.then(o,o),this._promise=null}else n();else Ze("delayed",this.name),this.q.drain=()=>{Ze("drain",this.name),this.q.drain=wR,queueMicrotask(l)}};queueMicrotask(l),this.q.resume()};function zR(e,t){const n=this;B.nextTick(di.bind(n),e,t)}function di(e,t){if(typeof e.func.then=="function"){e.func.then(l=>{typeof l.default=="function"&&(l=l.default),e.func=l,di.call(this,e,t)},t);return}const n=this._current[0];this._current.unshift(e),e.exec(n&&n.server||this._server,l=>{e.finish(l,o=>{this._current.shift(),t(o)})})}function wR(){}ri.exports=jt;ri.exports.loadPlugin=di;var KR=ri.exports;const Vc=Hs,LR=tr.EventEmitter,xR=rl.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:Kl,AVV_ERR_CALLBACK_NOT_FN:nn,AVV_ERR_PLUGIN_NOT_VALID:MR,AVV_ERR_ROOT_PLG_BOOTED:HR,AVV_ERR_READY_TIMEOUT:OR}=gr,DR=YR,Zo=KR,Ht=Wr("avvio"),qn=Symbol("kAvvio"),Ll=Symbol("kThenifyDoNotWrap");function jR(e,t,n){const l=t.expose||{},o=l.use||"use",i=l.after||"after",a=l.ready||"ready",c=l.onClose||"onClose",s=l.close||"close";if(e[o])throw new Kl(o);if(e[i])throw new Kl(i);if(e[a])throw new Kl(a);e[o]=function(r,d){return n.use(r,d),this},Object.defineProperty(e,"then",{get:Zr.bind(n)}),e[qn]=!0,e[i]=function(r){return typeof r!="function"?n._loadRegistered():(n.after(xl(r,this)),this)},e[a]=function(r){if(r&&typeof r!="function")throw new nn(a,typeof r);return n.ready(r?xl(r,this):void 0)},e[c]=function(r){if(typeof r!="function")throw new nn(c,typeof r);return n.onClose(eg(r,this)),this},e[s]=function(r){if(r&&typeof r!="function")throw new nn(s,typeof r);return r?(n.close(xl(r,this)),this):n.close()}}function Re(e,t,n){if(typeof e=="function"&&arguments.length===1&&(n=e,t={},e=null),typeof t=="function"&&(n=t,t={}),t=t||{},!(this instanceof Re)){const l=new Re(e,t,n);return e&&jR(e,t,l),l}t.autostart!==!1&&(t.autostart=!0),e=e||this,this._timeout=Number(t.timeout)||0,this._server=e,this._current=[],this._error=null,this._isOnCloseHandlerKey=Symbol("isOnCloseHandler"),this._lastUsed=null,this.setMaxListeners(0),n&&this.once("start",n),this.started=!1,this.booted=!1,this.pluginTree=new DR,this._readyQ=Vc(this,Er,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=hc},this._closeQ=Vc(this,$R,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=hc},this._doStart=null,this._root=new Zo(this,PR.bind(this),t,!1,0),this._root.once("start",(l,o,i)=>{const a=this.pluginTree.start(null,o,i);this._root.once("loaded",(c,s,r)=>{this.pluginTree.stop(a,r)})}),Zo.loadPlugin.call(this,this._root,l=>{Ht("root plugin ready");try{this.emit("preReady"),this._root=null}catch(o){l=l||this._error||o}if(l){if(this._error=l,this._readyQ.length()===0)throw l}else this.booted=!0;this._readyQ.resume()})}function PR(e,t,n){this._doStart=n,t.autostart&&this.start()}xR(Re,LR);Re.prototype.start=function(){return this.started=!0,B.nextTick(this._doStart),this};Re.prototype.override=function(e,t,n){return e};function _R(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new MR(typeof e);return e}Re.prototype[qn]=!0;Re.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};Re.prototype._loadRegistered=function(){const e=this._current[0];return!this.started&&!this.booted&&B.nextTick(()=>this._root.q.resume()),e?e.loadedSoFar():Promise.resolve()};Object.defineProperty(Re.prototype,"then",{get:Zr});Re.prototype._addPlugin=function(e,t,n){if(e=_R(e),t=t||{},this.booted)throw new HR;const l=this._current[0],o=new Zo(this,e,t,n);if(o.once("start",(i,a,c)=>{const s=this.pluginTree.start(l.name,a,c);o.once("loaded",(r,d,b)=>{this.pluginTree.stop(s,b)})}),l.loaded)throw new Error(o.name,l.name);return l.enqueue(o,i=>{i&&(this._error=i)}),o};Re.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,l,o){Er.call(this,e,o)}return this};Re.prototype.onClose=function(e){if(typeof e!="function")throw new Error("not a function");e[this._isOnCloseHandlerKey]=!0,this._closeQ.unshift(e,t.bind(this));function t(n){n&&(this._error=n)}return this};Re.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new nn("close",typeof e)}else t=new Promise(function(n,l){e=function(o){if(o)return l(o);n()}});return this.ready(()=>{this._error=null,this._closeQ.push(e),B.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};Re.prototype.ready=function(e){if(e){if(typeof e!="function")throw new nn("ready",typeof e);this._readyQ.push(e),queueMicrotask(this.start.bind(this));return}return new Promise((t,n)=>{this._readyQ.push(o),this.start();const l=this._current[0].server;function o(i,a,c){i?n(i):t(l),B.nextTick(c)}})};Re.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};Re.prototype.toJSON=function(){return this.pluginTree.toJSON()};function hc(){}function Zr(){if(this.booted){Ht("thenify returning null because we are already booted");return}if(this[Ll]){this[Ll]=!1;return}return Ht("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[Ll]=!0,e(this._server)),t)}function Er(e,t){const n=this._server,l=this._error;let o;if(this._error=null,e.length===0)this._error=l,o=e(),o&&!o[qn]&&typeof o.then=="function"?o.then(()=>B.nextTick(t),i=>B.nextTick(t,i)):B.nextTick(t);else if(e.length===1)o=e(l),o&&!o[qn]&&typeof o.then=="function"?o.then(()=>B.nextTick(t),i=>B.nextTick(t,i)):B.nextTick(t);else if(this._timeout===0){const i=a=>{this._error=a,t(this._error)};e.length===2?e(l,i):e(l,n,i)}else qR.call(this,e,l,n,t)}function qR(e,t,n,l){const o=e.name;Ht("setting up ready timeout",o,this._timeout);let i=setTimeout(()=>{Ht("timed out",o),i=null;const c=new OR(o);c.fn=e,this._error=c,l(c)},this._timeout);e.length===2?e(t,a.bind(this)):e(t,n,a.bind(this));function a(c){i&&(clearTimeout(i),this._error=c,l(this._error))}}function $R(e,t){const n=this._server,l=e[this._isOnCloseHandlerKey];if(e.length===0||e.length===1){let o;l?o=e(n):o=e(this._error),o&&typeof o.then=="function"?(Ht("resolving close/onClose promise"),o.then(()=>B.nextTick(t),i=>B.nextTick(t,i))):B.nextTick(t)}else e.length===2?e(l?n:this._error,t):l?e(n,t):e(this._error,n,t)}function eg(e,t){return n.bind(t);function n(l,o){let i;e.length===0?(i=e(),i&&i.then?i.then(function(){B.nextTick(o)},o):B.nextTick(o)):e.length===1?(i=e(this),i&&i.then?i.then(function(){B.nextTick(o)},o):B.nextTick(o)):e(this,o)}}function xl(e,t){return n.bind(t);function n(l,o){let i;e?e.length===0?(i=e(),i&&i.then?i.then(function(){B.nextTick(o,l)},o):B.nextTick(o,l)):e.length===1?(i=e(l),i&&i.then?i.then(function(){B.nextTick(o)},o):B.nextTick(o)):e.length===2?e(l,o):e(l,this,o):B.nextTick(o)}}qo.exports=Re;qo.exports.express=function(e){return Re(e,{expose:{use:"load"}})};var tg=qo.exports;const ng=Ym(tg);(function(){if(window.requestAnimationFrame&&window.cancelAnimationFrame)return;const e=["webkit","moz","ms","o"];for(const t of e)window.requestAnimationFrame=window.requestAnimationFrame||window[`${t}RequestAnimationFrame`],window.cancelAnimationFrame=window.cancelAnimationFrame||window[`${t}CancelAnimationFrame`]||window[`${t}CancelRequestAnimationFrame`];if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){let t=0;const n=!!(window.performance&&window.performance.now);window.requestAnimationFrame=function(l){const o=n?window.performance.now():new Date().getTime(),i=Math.max(0,16-(o-t)),a=window.setTimeout(function(){l(o+i)},i);return t=o+i,a},window.cancelAnimationFrame=clearTimeout}})();function lg(e,t=!0,n=!0,l={friendsTab:"enabled"}){const o=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",i=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",a=ng(Object.create({}),{autostart:!1});return a.use(cm,{hideFriends:l.hideFriends,skipOnboarding:l.skipOnboarding,betPack:l.betPack,friendsTab:l.friendsTab,theme:l.theme,themeMode:l.themeMode}),a.use(em,{onDeepLinkHandled:l==null?void 0:l.onDeepLinkHandled}),a.use(om,{videoPlayerController:l==null?void 0:l.videoPlayerController}),a.use(am,{onContentActivate:l==null?void 0:l.onContentActivate,withAd:l==null?void 0:l.withAd,withAdNotification:l==null?void 0:l.withAdNotification}),a.use(Zh,{sdkKey:e,host:o,analyticsHost:i,version:l==null?void 0:l.version,webOS:l==null?void 0:l.webOS}),a.use(Xh),a.use(lm),a.use(gm),a.use(Oh),a.use(Nm),a.after((c,s,r)=>{if(c)throw c;s.ready(),r()}),n&&a.after(async(c,s,r)=>{if(c)throw c;await s.sdk.initializeApp(),r()}),a.onClose(()=>{console.log("close")}),a}const og=({sdkKey:e,plugins:t,production:n,autoEnable:l,onDeepLinkHandled:o,videoPlayerController:i,onContentActivate:a,hideFriends:c,skipOnboarding:s,withAdNotification:r,withAd:d,friendsTab:b,betPack:h,webOS:V})=>{const[m,Z]=bi.useState(null);return bi.useEffect(()=>{let y=!1;if(!e)return console.error("streamlayer sdk key should be provided"),Z(W=>(W!==null&&typeof W.disableApp=="function"&&W.disableApp(),null)),()=>{y=!0};const A=lg(e,n,l,{version:"1.18.2",onDeepLinkHandled:o,videoPlayerController:i,onContentActivate:a,skipOnboarding:s,withAdNotification:r,withAd:d,hideFriends:c,friendsTab:b,betPack:h,webOS:V});if(t)for(const W of t)A.use(W);return A.ready().then(W=>{y||(Z(W.sdk),typeof window<"u")}).catch(W=>console.log(W)),()=>{y=!0,A.close(function(W){if(W)throw W})}},[e,n]),m};exports.AdUnit=fe;exports.AutoPlayVideo=Du;exports.CloseTimerAuto=Hu;exports.ConnectError=x;exports.CtaIconMode=Bu;exports.InvitationFrom=to;exports.NotificationEnabled=eo;exports.NotificationPromotionImagePosition=Nu;exports.NotificationPromotionMode=Fu;exports.NotificationSponsorLogoMode=Iu;exports.NotificationUseContentMedia=Lu;exports.PickHistoryStatus=qt;exports.PlayVideoMuted=Pu;exports.PromotionButtonType=vu;exports.PromotionLogoMode=ku;exports.PromotionType=k;exports.QuestionImages=Xu;exports.QuestionStatus=be;exports.QuestionType=C;exports.SdkOverlayType=ee;exports.createContextKey=oo;exports.global=io;exports.pino_1=Ec;exports.unsafeStringify=Vs;exports.useStreamLayerApp=og;exports.v4=sn;
17
+ `).slice(0,2).map(n=>n.trim()).join(" -- ")}function QR(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function jt(e,t,n,l,o){this.started=!1,this.func=t,this.opts=n,this.onFinish=null,this.parent=e,this.timeout=o===void 0?e._timeout:o,this.name=kR(t,n),this.isAfter=l,this.q=CR(e,zR,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}vR(jt,JR);jt.prototype.exec=function(e,t){const n=this.func;let l=!1;const o=this.name;if(this.parent._error&&!this.isAfter){Ze("skipping loading of plugin as parent errored and it is not an after",o),B.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(s){return Ze("override errored",o),t(s)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,Ze("exec",o);let i;const a=s=>{if(l){Ze("loading complete",o);return}this._error=s,Ze(s?"exec errored":"exec completed",o),l=!0,i&&clearTimeout(i),t(s)};this.timeout>0&&(Ze("setting up timeout",o,this.timeout),i=setTimeout(function(){Ze("timed out",o),i=null;const s=new TR(o);s.fn=n,a(s)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const c=n(this.server,this.opts,a);c&&typeof c.then=="function"&&(Ze("exec: resolving promise",o),c.then(()=>B.nextTick(a),s=>B.nextTick(a,s)))};jt.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,l)=>{this._error=n,this.q.pause(),n?(Ze("rejecting promise",this.name,n),this._promise.reject(n)):(Ze("resolving promise",this.name),this._promise.resolve()),this._promise=null,B.nextTick(l,n)}),this.q.resume()};let t;return this._promise?t=Promise.resolve():(this._promise=QR(),t=this._promise.promise,this.server?e():this.on("start",e)),t};jt.prototype.enqueue=function(e,t){Ze("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};jt.prototype.finish=function(e,t){Ze("finish",this.name,e);const n=()=>{this.loaded||(Ze("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,t(e))};if(e){this._promise&&(this._promise.reject(e),this._promise=null),n();return}const l=()=>{if(Ze("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const o=()=>{Ze("wrap"),queueMicrotask(l)};this._promise.resolve(),this._promise.promise.then(o,o),this._promise=null}else n();else Ze("delayed",this.name),this.q.drain=()=>{Ze("drain",this.name),this.q.drain=wR,queueMicrotask(l)}};queueMicrotask(l),this.q.resume()};function zR(e,t){const n=this;B.nextTick(di.bind(n),e,t)}function di(e,t){if(typeof e.func.then=="function"){e.func.then(l=>{typeof l.default=="function"&&(l=l.default),e.func=l,di.call(this,e,t)},t);return}const n=this._current[0];this._current.unshift(e),e.exec(n&&n.server||this._server,l=>{e.finish(l,o=>{this._current.shift(),t(o)})})}function wR(){}ri.exports=jt;ri.exports.loadPlugin=di;var KR=ri.exports;const Vc=Hs,LR=tr.EventEmitter,xR=rl.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:Kl,AVV_ERR_CALLBACK_NOT_FN:nn,AVV_ERR_PLUGIN_NOT_VALID:MR,AVV_ERR_ROOT_PLG_BOOTED:HR,AVV_ERR_READY_TIMEOUT:OR}=gr,DR=YR,Zo=KR,Ht=Wr("avvio"),qn=Symbol("kAvvio"),Ll=Symbol("kThenifyDoNotWrap");function jR(e,t,n){const l=t.expose||{},o=l.use||"use",i=l.after||"after",a=l.ready||"ready",c=l.onClose||"onClose",s=l.close||"close";if(e[o])throw new Kl(o);if(e[i])throw new Kl(i);if(e[a])throw new Kl(a);e[o]=function(r,d){return n.use(r,d),this},Object.defineProperty(e,"then",{get:Zr.bind(n)}),e[qn]=!0,e[i]=function(r){return typeof r!="function"?n._loadRegistered():(n.after(xl(r,this)),this)},e[a]=function(r){if(r&&typeof r!="function")throw new nn(a,typeof r);return n.ready(r?xl(r,this):void 0)},e[c]=function(r){if(typeof r!="function")throw new nn(c,typeof r);return n.onClose(eg(r,this)),this},e[s]=function(r){if(r&&typeof r!="function")throw new nn(s,typeof r);return r?(n.close(xl(r,this)),this):n.close()}}function Re(e,t,n){if(typeof e=="function"&&arguments.length===1&&(n=e,t={},e=null),typeof t=="function"&&(n=t,t={}),t=t||{},!(this instanceof Re)){const l=new Re(e,t,n);return e&&jR(e,t,l),l}t.autostart!==!1&&(t.autostart=!0),e=e||this,this._timeout=Number(t.timeout)||0,this._server=e,this._current=[],this._error=null,this._isOnCloseHandlerKey=Symbol("isOnCloseHandler"),this._lastUsed=null,this.setMaxListeners(0),n&&this.once("start",n),this.started=!1,this.booted=!1,this.pluginTree=new DR,this._readyQ=Vc(this,Er,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=hc},this._closeQ=Vc(this,$R,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=hc},this._doStart=null,this._root=new Zo(this,PR.bind(this),t,!1,0),this._root.once("start",(l,o,i)=>{const a=this.pluginTree.start(null,o,i);this._root.once("loaded",(c,s,r)=>{this.pluginTree.stop(a,r)})}),Zo.loadPlugin.call(this,this._root,l=>{Ht("root plugin ready");try{this.emit("preReady"),this._root=null}catch(o){l=l||this._error||o}if(l){if(this._error=l,this._readyQ.length()===0)throw l}else this.booted=!0;this._readyQ.resume()})}function PR(e,t,n){this._doStart=n,t.autostart&&this.start()}xR(Re,LR);Re.prototype.start=function(){return this.started=!0,B.nextTick(this._doStart),this};Re.prototype.override=function(e,t,n){return e};function _R(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new MR(typeof e);return e}Re.prototype[qn]=!0;Re.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};Re.prototype._loadRegistered=function(){const e=this._current[0];return!this.started&&!this.booted&&B.nextTick(()=>this._root.q.resume()),e?e.loadedSoFar():Promise.resolve()};Object.defineProperty(Re.prototype,"then",{get:Zr});Re.prototype._addPlugin=function(e,t,n){if(e=_R(e),t=t||{},this.booted)throw new HR;const l=this._current[0],o=new Zo(this,e,t,n);if(o.once("start",(i,a,c)=>{const s=this.pluginTree.start(l.name,a,c);o.once("loaded",(r,d,b)=>{this.pluginTree.stop(s,b)})}),l.loaded)throw new Error(o.name,l.name);return l.enqueue(o,i=>{i&&(this._error=i)}),o};Re.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,l,o){Er.call(this,e,o)}return this};Re.prototype.onClose=function(e){if(typeof e!="function")throw new Error("not a function");e[this._isOnCloseHandlerKey]=!0,this._closeQ.unshift(e,t.bind(this));function t(n){n&&(this._error=n)}return this};Re.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new nn("close",typeof e)}else t=new Promise(function(n,l){e=function(o){if(o)return l(o);n()}});return this.ready(()=>{this._error=null,this._closeQ.push(e),B.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};Re.prototype.ready=function(e){if(e){if(typeof e!="function")throw new nn("ready",typeof e);this._readyQ.push(e),queueMicrotask(this.start.bind(this));return}return new Promise((t,n)=>{this._readyQ.push(o),this.start();const l=this._current[0].server;function o(i,a,c){i?n(i):t(l),B.nextTick(c)}})};Re.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};Re.prototype.toJSON=function(){return this.pluginTree.toJSON()};function hc(){}function Zr(){if(this.booted){Ht("thenify returning null because we are already booted");return}if(this[Ll]){this[Ll]=!1;return}return Ht("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[Ll]=!0,e(this._server)),t)}function Er(e,t){const n=this._server,l=this._error;let o;if(this._error=null,e.length===0)this._error=l,o=e(),o&&!o[qn]&&typeof o.then=="function"?o.then(()=>B.nextTick(t),i=>B.nextTick(t,i)):B.nextTick(t);else if(e.length===1)o=e(l),o&&!o[qn]&&typeof o.then=="function"?o.then(()=>B.nextTick(t),i=>B.nextTick(t,i)):B.nextTick(t);else if(this._timeout===0){const i=a=>{this._error=a,t(this._error)};e.length===2?e(l,i):e(l,n,i)}else qR.call(this,e,l,n,t)}function qR(e,t,n,l){const o=e.name;Ht("setting up ready timeout",o,this._timeout);let i=setTimeout(()=>{Ht("timed out",o),i=null;const c=new OR(o);c.fn=e,this._error=c,l(c)},this._timeout);e.length===2?e(t,a.bind(this)):e(t,n,a.bind(this));function a(c){i&&(clearTimeout(i),this._error=c,l(this._error))}}function $R(e,t){const n=this._server,l=e[this._isOnCloseHandlerKey];if(e.length===0||e.length===1){let o;l?o=e(n):o=e(this._error),o&&typeof o.then=="function"?(Ht("resolving close/onClose promise"),o.then(()=>B.nextTick(t),i=>B.nextTick(t,i))):B.nextTick(t)}else e.length===2?e(l?n:this._error,t):l?e(n,t):e(this._error,n,t)}function eg(e,t){return n.bind(t);function n(l,o){let i;e.length===0?(i=e(),i&&i.then?i.then(function(){B.nextTick(o)},o):B.nextTick(o)):e.length===1?(i=e(this),i&&i.then?i.then(function(){B.nextTick(o)},o):B.nextTick(o)):e(this,o)}}function xl(e,t){return n.bind(t);function n(l,o){let i;e?e.length===0?(i=e(),i&&i.then?i.then(function(){B.nextTick(o,l)},o):B.nextTick(o,l)):e.length===1?(i=e(l),i&&i.then?i.then(function(){B.nextTick(o)},o):B.nextTick(o)):e.length===2?e(l,o):e(l,this,o):B.nextTick(o)}}qo.exports=Re;qo.exports.express=function(e){return Re(e,{expose:{use:"load"}})};var tg=qo.exports;const ng=Ym(tg);(function(){if(window.requestAnimationFrame&&window.cancelAnimationFrame)return;const e=["webkit","moz","ms","o"];for(const t of e)window.requestAnimationFrame=window.requestAnimationFrame||window[`${t}RequestAnimationFrame`],window.cancelAnimationFrame=window.cancelAnimationFrame||window[`${t}CancelAnimationFrame`]||window[`${t}CancelRequestAnimationFrame`];if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){let t=0;const n=!!(window.performance&&window.performance.now);window.requestAnimationFrame=function(l){const o=n?window.performance.now():new Date().getTime(),i=Math.max(0,16-(o-t)),a=window.setTimeout(function(){l(o+i)},i);return t=o+i,a},window.cancelAnimationFrame=clearTimeout}})();function lg(e,t=!0,n=!0,l={friendsTab:"enabled"}){const o=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",i=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",a=ng(Object.create({}),{autostart:!1});return a.use(cm,{hideFriends:l.hideFriends,skipOnboarding:l.skipOnboarding,betPack:l.betPack,friendsTab:l.friendsTab,theme:l.theme,themeMode:l.themeMode}),a.use(em,{onDeepLinkHandled:l==null?void 0:l.onDeepLinkHandled}),a.use(om,{videoPlayerController:l==null?void 0:l.videoPlayerController}),a.use(am,{onContentActivate:l==null?void 0:l.onContentActivate,withAd:l==null?void 0:l.withAd,withAdNotification:l==null?void 0:l.withAdNotification}),a.use(Zh,{sdkKey:e,host:o,analyticsHost:i,version:l==null?void 0:l.version,webOS:l==null?void 0:l.webOS}),a.use(Xh),a.use(lm),a.use(gm),a.use(Oh),a.use(Nm),a.after((c,s,r)=>{if(c)throw c;s.ready(),r()}),n&&a.after(async(c,s,r)=>{if(c)throw c;await s.sdk.initializeApp(),r()}),a.onClose(()=>{console.log("close")}),a}const og=({sdkKey:e,plugins:t,production:n,autoEnable:l,onDeepLinkHandled:o,videoPlayerController:i,onContentActivate:a,hideFriends:c,skipOnboarding:s,withAdNotification:r,withAd:d,friendsTab:b,betPack:h,webOS:V})=>{const[m,Z]=bi.useState(null);return bi.useEffect(()=>{let y=!1;if(!e)return console.error("streamlayer sdk key should be provided"),Z(W=>(W!==null&&typeof W.disableApp=="function"&&W.disableApp(),null)),()=>{y=!0};const A=lg(e,n,l,{version:"1.18.3",onDeepLinkHandled:o,videoPlayerController:i,onContentActivate:a,skipOnboarding:s,withAdNotification:r,withAd:d,hideFriends:c,friendsTab:b,betPack:h,webOS:V});if(t)for(const W of t)A.use(W);return A.ready().then(W=>{y||(Z(W.sdk),typeof window<"u")}).catch(W=>console.log(W)),()=>{y=!0,A.close(function(W){if(W)throw W})}},[e,n]),m};exports.AdUnit=fe;exports.AutoPlayVideo=Du;exports.CloseTimerAuto=Hu;exports.ConnectError=x;exports.CtaIconMode=Bu;exports.InvitationFrom=to;exports.NotificationEnabled=eo;exports.NotificationPromotionImagePosition=Nu;exports.NotificationPromotionMode=Fu;exports.NotificationSponsorLogoMode=Iu;exports.NotificationUseContentMedia=Lu;exports.PickHistoryStatus=qt;exports.PlayVideoMuted=Pu;exports.PromotionButtonType=vu;exports.PromotionLogoMode=ku;exports.PromotionType=k;exports.QuestionImages=Xu;exports.QuestionStatus=be;exports.QuestionType=C;exports.SdkOverlayType=ee;exports.createContextKey=oo;exports.global=io;exports.pino_1=Ec;exports.unsafeStringify=Vs;exports.useStreamLayerApp=og;exports.v4=sn;
@@ -10860,7 +10860,7 @@ const sg = ({
10860
10860
  y = !0;
10861
10861
  };
10862
10862
  const m = DR(e, n, l, {
10863
- version: "1.18.2",
10863
+ version: "1.18.3",
10864
10864
  onDeepLinkHandled: o,
10865
10865
  videoPlayerController: i,
10866
10866
  onContentActivate: a,
@@ -98,4 +98,4 @@ Error generating stack: `+a.message+`
98
98
  `),l=`
99
99
  `+n+(a.length?i("│"):" ")+" ";return n+s.join(l)+`
100
100
  `+a.map(function(o,c){var u=c===a.length-1,d=o.nodes&&o.nodes.length,m=n+(u?" ":i("│"))+" ";return n+i(u?"└":"├")+i("─")+i(d?"┬":"─")+" "+e(o,m,r).slice(n.length+2)}).join("")};const qD=$D,Fm=Symbol("avvio.TimeTree.untrackNode"),a2=Symbol("avvio.TimeTree.trackNode"),Nm=Symbol("avvio.TimeTree.getParent"),Gm=Symbol("avvio.TimeTree.getNode"),Xm=Symbol("avvio.TimeTree.addNode");let eP=class{constructor(){this.root=null,this.tableId=new Map,this.tableLabel=new Map}[a2](e){this.tableId.set(e.id,e),this.tableLabel.has(e.label)?this.tableLabel.get(e.label).push(e):this.tableLabel.set(e.label,[e])}[Fm](e){this.tableId.delete(e.id);const t=this.tableLabel.get(e.label);if(t.id){this.tableLabel.delete(e.label);return}t.pop(),t.length===0&&this.tableLabel.delete(e.label)}[Nm](e){if(e===null)return this.root;const t=this.tableLabel.get(e);return t.id?t:t[t.length-1]}[Gm](e){return this.tableId.get(e)}[Xm](e,t,n){if(e===null)return this.root={id:"root",label:t,start:n,nodes:[]},this[a2](this.root),this.root.id;const r=this[Nm](e),i=`${t}-${Math.random()}`,a={id:i,parent:e,start:n,label:t,nodes:[]};return r.nodes.push(a),this[a2](a),i}start(e,t,n=Date.now()){return this[Xm](e,t,n)}stop(e,t=Date.now()){const n=this[Gm](e);n&&(n.stop=t,n.diff=n.stop-n.start||0,this[Fm](n))}toJSON(){return Object.assign({},this.root)}prittyPrint(){const e=n=>(n.label=`${n.label} ${n.diff} ms`,n.nodes.length>0&&(n.nodes=n.nodes.map(r=>e(r))),n),t=e(this.toJSON());return qD(t)}};var tP=eP,q3={exports:{}},Ku={exports:{}},s2,wm;function nP(){if(wm)return s2;wm=1;var e=1e3,t=e*60,n=t*60,r=n*24,i=r*7,a=r*365.25;s2=function(u,d){d=d||{};var m=typeof u;if(m==="string"&&u.length>0)return s(u);if(m==="number"&&isFinite(u))return d.long?o(u):l(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function s(u){if(u=String(u),!(u.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(u);if(d){var m=parseFloat(d[1]),g=(d[2]||"ms").toLowerCase();switch(g){case"years":case"year":case"yrs":case"yr":case"y":return m*a;case"weeks":case"week":case"w":return m*i;case"days":case"day":case"d":return m*r;case"hours":case"hour":case"hrs":case"hr":case"h":return m*n;case"minutes":case"minute":case"mins":case"min":case"m":return m*t;case"seconds":case"second":case"secs":case"sec":case"s":return m*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return m;default:return}}}}function l(u){var d=Math.abs(u);return d>=r?Math.round(u/r)+"d":d>=n?Math.round(u/n)+"h":d>=t?Math.round(u/t)+"m":d>=e?Math.round(u/e)+"s":u+"ms"}function o(u){var d=Math.abs(u);return d>=r?c(u,d,r,"day"):d>=n?c(u,d,n,"hour"):d>=t?c(u,d,t,"minute"):d>=e?c(u,d,e,"second"):u+" ms"}function c(u,d,m,g){var y=d>=m*1.5;return Math.round(u/m)+" "+g+(y?"s":"")}return s2}function rP(e){n.debug=n,n.default=n,n.coerce=o,n.disable=a,n.enable=i,n.enabled=s,n.humanize=nP(),n.destroy=c,Object.keys(e).forEach(u=>{n[u]=e[u]}),n.names=[],n.skips=[],n.formatters={};function t(u){let d=0;for(let m=0;m<u.length;m++)d=(d<<5)-d+u.charCodeAt(m),d|=0;return n.colors[Math.abs(d)%n.colors.length]}n.selectColor=t;function n(u){let d,m=null,g,y;function A(...E){if(!A.enabled)return;const f=A,h=Number(new Date),b=h-(d||h);f.diff=b,f.prev=d,f.curr=h,d=h,E[0]=n.coerce(E[0]),typeof E[0]!="string"&&E.unshift("%O");let V=0;E[0]=E[0].replace(/%([a-zA-Z%])/g,(C,S)=>{if(C==="%%")return"%";V++;const I=n.formatters[S];if(typeof I=="function"){const X=E[V];C=I.call(f,X),E.splice(V,1),V--}return C}),n.formatArgs.call(f,E),(f.log||n.log).apply(f,E)}return A.namespace=u,A.useColors=n.useColors(),A.color=n.selectColor(u),A.extend=r,A.destroy=n.destroy,Object.defineProperty(A,"enabled",{enumerable:!0,configurable:!1,get:()=>m!==null?m:(g!==n.namespaces&&(g=n.namespaces,y=n.enabled(u)),y),set:E=>{m=E}}),typeof n.init=="function"&&n.init(A),A}function r(u,d){const m=n(this.namespace+(typeof d>"u"?":":d)+u);return m.log=this.log,m}function i(u){n.save(u),n.namespaces=u,n.names=[],n.skips=[];let d;const m=(typeof u=="string"?u:"").split(/[\s,]+/),g=m.length;for(d=0;d<g;d++)m[d]&&(u=m[d].replace(/\*/g,".*?"),u[0]==="-"?n.skips.push(new RegExp("^"+u.slice(1)+"$")):n.names.push(new RegExp("^"+u+"$")))}function a(){const u=[...n.names.map(l),...n.skips.map(l).map(d=>"-"+d)].join(",");return n.enable(""),u}function s(u){if(u[u.length-1]==="*")return!0;let d,m;for(d=0,m=n.skips.length;d<m;d++)if(n.skips[d].test(u))return!1;for(d=0,m=n.names.length;d<m;d++)if(n.names[d].test(u))return!0;return!1}function l(u){return u.toString().substring(2,u.toString().length-2).replace(/\.\*\?$/,"*")}function o(u){return u instanceof Error?u.stack||u.message:u}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}var iP=rP;(function(e,t){t.formatArgs=r,t.save=i,t.load=a,t.useColors=n,t.storage=s(),t.destroy=(()=>{let o=!1;return()=>{o||(o=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(o){if(o[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+o[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const c="color: "+this.color;o.splice(1,0,c,"color: inherit");let u=0,d=0;o[0].replace(/%[a-zA-Z%]/g,m=>{m!=="%%"&&(u++,m==="%c"&&(d=u))}),o.splice(d,0,c)}t.log=console.debug||console.log||(()=>{});function i(o){try{o?t.storage.setItem("debug",o):t.storage.removeItem("debug")}catch{}}function a(){let o;try{o=t.storage.getItem("debug")}catch{}return!o&&typeof me<"u"&&"env"in me&&(o=me.env.DEBUG),o}function s(){try{return localStorage}catch{}}e.exports=iP(t);const{formatters:l}=e.exports;l.j=function(o){try{return JSON.stringify(o)}catch(c){return"[UnexpectedJSONParseError]: "+c.message}}})(Ku,Ku.exports);var S7=Ku.exports;const aP=$b,sP=l7.EventEmitter,lP=q1.inherits,gt=S7("avvio"),{AVV_ERR_READY_TIMEOUT:oP}=v7,l2=Symbol.for("plugin-meta");function cP(e,t){return e[l2]&&e[l2].name?e[l2].name:typeof t<"u"&&typeof t!="function"&&t.name?t.name:e.name?e.name:e.toString().split(`
101
- `).slice(0,2).map(n=>n.trim()).join(" -- ")}function uP(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function La(e,t,n,r,i){this.started=!1,this.func=t,this.opts=n,this.onFinish=null,this.parent=e,this.timeout=i===void 0?e._timeout:i,this.name=cP(t,n),this.isAfter=r,this.q=aP(e,dP,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}lP(La,sP);La.prototype.exec=function(e,t){const n=this.func;let r=!1;const i=this.name;if(this.parent._error&&!this.isAfter){gt("skipping loading of plugin as parent errored and it is not an after",i),me.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(o){return gt("override errored",i),t(o)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,gt("exec",i);let a;const s=o=>{if(r){gt("loading complete",i);return}this._error=o,gt(o?"exec errored":"exec completed",i),r=!0,a&&clearTimeout(a),t(o)};this.timeout>0&&(gt("setting up timeout",i,this.timeout),a=setTimeout(function(){gt("timed out",i),a=null;const o=new oP(i);o.fn=n,s(o)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const l=n(this.server,this.opts,s);l&&typeof l.then=="function"&&(gt("exec: resolving promise",i),l.then(()=>me.nextTick(s),o=>me.nextTick(s,o)))};La.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,r)=>{this._error=n,this.q.pause(),n?(gt("rejecting promise",this.name,n),this._promise.reject(n)):(gt("resolving promise",this.name),this._promise.resolve()),this._promise=null,me.nextTick(r,n)}),this.q.resume()};let t;return this._promise?t=Promise.resolve():(this._promise=uP(),t=this._promise.promise,this.server?e():this.on("start",e)),t};La.prototype.enqueue=function(e,t){gt("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};La.prototype.finish=function(e,t){gt("finish",this.name,e);const n=()=>{this.loaded||(gt("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,t(e))};if(e){this._promise&&(this._promise.reject(e),this._promise=null),n();return}const r=()=>{if(gt("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const i=()=>{gt("wrap"),queueMicrotask(r)};this._promise.resolve(),this._promise.promise.then(i,i),this._promise=null}else n();else gt("delayed",this.name),this.q.drain=()=>{gt("drain",this.name),this.q.drain=pP,queueMicrotask(r)}};queueMicrotask(r),this.q.resume()};function dP(e,t){const n=this;me.nextTick(e5.bind(n),e,t)}function e5(e,t){if(typeof e.func.then=="function"){e.func.then(r=>{typeof r.default=="function"&&(r=r.default),e.func=r,e5.call(this,e,t)},t);return}const n=this._current[0];this._current.unshift(e),e.exec(n&&n.server||this._server,r=>{e.finish(r,i=>{this._current.shift(),t(i)})})}function pP(){}q3.exports=La;q3.exports.loadPlugin=e5;var hP=q3.exports;const Um=$b,fP=l7.EventEmitter,mP=q1.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:o2,AVV_ERR_CALLBACK_NOT_FN:Rs,AVV_ERR_PLUGIN_NOT_VALID:gP,AVV_ERR_ROOT_PLG_BOOTED:bP,AVV_ERR_READY_TIMEOUT:yP}=v7,VP=tP,Ou=hP,Ia=S7("avvio"),y1=Symbol("kAvvio"),c2=Symbol("kThenifyDoNotWrap");function AP(e,t,n){const r=t.expose||{},i=r.use||"use",a=r.after||"after",s=r.ready||"ready",l=r.onClose||"onClose",o=r.close||"close";if(e[i])throw new o2(i);if(e[a])throw new o2(a);if(e[s])throw new o2(s);e[i]=function(c,u){return n.use(c,u),this},Object.defineProperty(e,"then",{get:W7.bind(n)}),e[y1]=!0,e[a]=function(c){return typeof c!="function"?n._loadRegistered():(n.after(u2(c,this)),this)},e[s]=function(c){if(c&&typeof c!="function")throw new Rs(s,typeof c);return n.ready(c?u2(c,this):void 0)},e[l]=function(c){if(typeof c!="function")throw new Rs(l,typeof c);return n.onClose(SP(c,this)),this},e[o]=function(c){if(c&&typeof c!="function")throw new Rs(o,typeof c);return c?(n.close(u2(c,this)),this):n.close()}}function ht(e,t,n){if(typeof e=="function"&&arguments.length===1&&(n=e,t={},e=null),typeof t=="function"&&(n=t,t={}),t=t||{},!(this instanceof ht)){const r=new ht(e,t,n);return e&&AP(e,t,r),r}t.autostart!==!1&&(t.autostart=!0),e=e||this,this._timeout=Number(t.timeout)||0,this._server=e,this._current=[],this._error=null,this._isOnCloseHandlerKey=Symbol("isOnCloseHandler"),this._lastUsed=null,this.setMaxListeners(0),n&&this.once("start",n),this.started=!1,this.booted=!1,this.pluginTree=new VP,this._readyQ=Um(this,Z7,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=Bm},this._closeQ=Um(this,vP,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=Bm},this._doStart=null,this._root=new Ou(this,RP.bind(this),t,!1,0),this._root.once("start",(r,i,a)=>{const s=this.pluginTree.start(null,i,a);this._root.once("loaded",(l,o,c)=>{this.pluginTree.stop(s,c)})}),Ou.loadPlugin.call(this,this._root,r=>{Ia("root plugin ready");try{this.emit("preReady"),this._root=null}catch(i){r=r||this._error||i}if(r){if(this._error=r,this._readyQ.length()===0)throw r}else this.booted=!0;this._readyQ.resume()})}function RP(e,t,n){this._doStart=n,t.autostart&&this.start()}mP(ht,fP);ht.prototype.start=function(){return this.started=!0,me.nextTick(this._doStart),this};ht.prototype.override=function(e,t,n){return e};function EP(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new gP(typeof e);return e}ht.prototype[y1]=!0;ht.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};ht.prototype._loadRegistered=function(){const e=this._current[0];return!this.started&&!this.booted&&me.nextTick(()=>this._root.q.resume()),e?e.loadedSoFar():Promise.resolve()};Object.defineProperty(ht.prototype,"then",{get:W7});ht.prototype._addPlugin=function(e,t,n){if(e=EP(e),t=t||{},this.booted)throw new bP;const r=this._current[0],i=new Ou(this,e,t,n);if(i.once("start",(a,s,l)=>{const o=this.pluginTree.start(r.name,s,l);i.once("loaded",(c,u,d)=>{this.pluginTree.stop(o,d)})}),r.loaded)throw new Error(i.name,r.name);return r.enqueue(i,a=>{a&&(this._error=a)}),i};ht.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,r,i){Z7.call(this,e,i)}return this};ht.prototype.onClose=function(e){if(typeof e!="function")throw new Error("not a function");e[this._isOnCloseHandlerKey]=!0,this._closeQ.unshift(e,t.bind(this));function t(n){n&&(this._error=n)}return this};ht.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new Rs("close",typeof e)}else t=new Promise(function(n,r){e=function(i){if(i)return r(i);n()}});return this.ready(()=>{this._error=null,this._closeQ.push(e),me.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};ht.prototype.ready=function(e){if(e){if(typeof e!="function")throw new Rs("ready",typeof e);this._readyQ.push(e),queueMicrotask(this.start.bind(this));return}return new Promise((t,n)=>{this._readyQ.push(i),this.start();const r=this._current[0].server;function i(a,s,l){a?n(a):t(r),me.nextTick(l)}})};ht.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};ht.prototype.toJSON=function(){return this.pluginTree.toJSON()};function Bm(){}function W7(){if(this.booted){Ia("thenify returning null because we are already booted");return}if(this[c2]){this[c2]=!1;return}return Ia("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[c2]=!0,e(this._server)),t)}function Z7(e,t){const n=this._server,r=this._error;let i;if(this._error=null,e.length===0)this._error=r,i=e(),i&&!i[y1]&&typeof i.then=="function"?i.then(()=>me.nextTick(t),a=>me.nextTick(t,a)):me.nextTick(t);else if(e.length===1)i=e(r),i&&!i[y1]&&typeof i.then=="function"?i.then(()=>me.nextTick(t),a=>me.nextTick(t,a)):me.nextTick(t);else if(this._timeout===0){const a=s=>{this._error=s,t(this._error)};e.length===2?e(r,a):e(r,n,a)}else CP.call(this,e,r,n,t)}function CP(e,t,n,r){const i=e.name;Ia("setting up ready timeout",i,this._timeout);let a=setTimeout(()=>{Ia("timed out",i),a=null;const l=new yP(i);l.fn=e,this._error=l,r(l)},this._timeout);e.length===2?e(t,s.bind(this)):e(t,n,s.bind(this));function s(l){a&&(clearTimeout(a),this._error=l,r(this._error))}}function vP(e,t){const n=this._server,r=e[this._isOnCloseHandlerKey];if(e.length===0||e.length===1){let i;r?i=e(n):i=e(this._error),i&&typeof i.then=="function"?(Ia("resolving close/onClose promise"),i.then(()=>me.nextTick(t),a=>me.nextTick(t,a))):me.nextTick(t)}else e.length===2?e(r?n:this._error,t):r?e(n,t):e(this._error,n,t)}function SP(e,t){return n.bind(t);function n(r,i){let a;e.length===0?(a=e(),a&&a.then?a.then(function(){me.nextTick(i)},i):me.nextTick(i)):e.length===1?(a=e(this),a&&a.then?a.then(function(){me.nextTick(i)},i):me.nextTick(i)):e(this,i)}}function u2(e,t){return n.bind(t);function n(r,i){let a;e?e.length===0?(a=e(),a&&a.then?a.then(function(){me.nextTick(i,r)},i):me.nextTick(i,r)):e.length===1?(a=e(r),a&&a.then?a.then(function(){me.nextTick(i)},i):me.nextTick(i)):e.length===2?e(r,i):e(r,this,i):me.nextTick(i)}}z3.exports=ht;z3.exports.express=function(e){return ht(e,{expose:{use:"load"}})};var WP=z3.exports;const ZP=tj(WP);(function(){if(window.requestAnimationFrame&&window.cancelAnimationFrame)return;const e=["webkit","moz","ms","o"];for(const t of e)window.requestAnimationFrame=window.requestAnimationFrame||window[`${t}RequestAnimationFrame`],window.cancelAnimationFrame=window.cancelAnimationFrame||window[`${t}CancelAnimationFrame`]||window[`${t}CancelRequestAnimationFrame`];if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){let t=0;const n=!!(window.performance&&window.performance.now);window.requestAnimationFrame=function(r){const i=n?window.performance.now():new Date().getTime(),a=Math.max(0,16-(i-t)),s=window.setTimeout(function(){r(i+a)},a);return t=i+a,s},window.cancelAnimationFrame=clearTimeout}})();function IP(e,t=!0,n=!0,r={friendsTab:"enabled"}){const i=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",a=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",s=ZP(Object.create({}),{autostart:!1});return s.use(X_,{hideFriends:r.hideFriends,skipOnboarding:r.skipOnboarding,betPack:r.betPack,friendsTab:r.friendsTab,theme:r.theme,themeMode:r.themeMode}),s.use(S_,{onDeepLinkHandled:r==null?void 0:r.onDeepLinkHandled}),s.use(F_,{videoPlayerController:r==null?void 0:r.videoPlayerController}),s.use(G_,{onContentActivate:r==null?void 0:r.onContentActivate,withAd:r==null?void 0:r.withAd,withAdNotification:r==null?void 0:r.withAdNotification}),s.use(KH,{sdkKey:e,host:i,analyticsHost:a,version:r==null?void 0:r.version,webOS:r==null?void 0:r.webOS}),s.use(DH),s.use(I_),s.use(M_),s.use(y_),s.use(ej),s.after((l,o,c)=>{if(l)throw l;o.ready(),c()}),n&&s.after(async(l,o,c)=>{if(l)throw l;await o.sdk.initializeApp(),c()}),s.onClose(()=>{console.log("close")}),s}const FP=({sdkKey:e,plugins:t,production:n,autoEnable:r,onDeepLinkHandled:i,videoPlayerController:a,onContentActivate:s,hideFriends:l,skipOnboarding:o,withAdNotification:c,withAd:u,friendsTab:d,betPack:m,webOS:g})=>{const[y,A]=Z.useState(null);return Z.useEffect(()=>{let E=!1;if(!e)return console.error("streamlayer sdk key should be provided"),A(h=>(h!==null&&typeof h.disableApp=="function"&&h.disableApp(),null)),()=>{E=!0};const f=IP(e,n,r,{version:"1.18.2",onDeepLinkHandled:i,videoPlayerController:a,onContentActivate:s,skipOnboarding:o,withAdNotification:c,withAd:u,hideFriends:l,friendsTab:d,betPack:m,webOS:g});if(t)for(const h of t)f.use(h);return f.ready().then(h=>{E||(A(h.sdk),typeof window<"u")}).catch(h=>console.log(h)),()=>{E=!0,f.close(function(h){if(h)throw h})}},[e,n]),y},t5=({event:e,internal:t})=>{const n=sl(),r=GP();return Z.useEffect(()=>(n&&(e&&(n.createEventSession(e,t),r&&(r.current=e)),!e&&(r!=null&&r.current)&&(n.createEventSession("",t),r.current="")),()=>{n&&n.disableApp()}),[e,t,r,n]),null};var I7=(e=>(e[e.UNSET=0]="UNSET",e[e.CONNECTED=1]="CONNECTED",e[e.READY=2]="READY",e))(I7||{});const NP={status:0,sdk:null},ic=Z.createContext(NP),F7=({sdkKey:e,theme:t,themeMode:n,plugins:r,children:i,event:a,production:s=!0,autoEnable:l=!0,withAdNotification:o,withAd:c=!0,betPack:u=!1,hideFriends:d,skipOnboarding:m,friendsTab:g="enabled",onDeepLinkHandled:y,videoPlayerController:A,onContentActivate:E,containerId:f,webOS:h})=>{const b=FP({sdkKey:e,plugins:r,production:s,autoEnable:l,onDeepLinkHandled:y,videoPlayerController:A,onContentActivate:E,hideFriends:d,skipOnboarding:m,withAdNotification:o,withAd:c,friendsTab:g,betPack:u,webOS:h}),V=Z.useRef(""),C=Z.useMemo(()=>b?{sdk:b,status:2,event:V}:{status:1,sdk:null,event:V},[b]);return Z.useEffect(()=>{b&&(b.options.setKey("friendsTab",g),b.options.setKey("theme",t),b.options.setKey("themeMode",n),b.options.setKey("skipOnboarding",m),b.options.setKey("betPack",u),b.options.setKey("containerId",f))},[b,g,t,n,m,u,f]),Z.useEffect(()=>()=>{y&&(b==null||b.removeDeepLinkHandler(y)),A&&(b==null||b.removeVideoPlayerController(A))},[b]),Z.useEffect(()=>{localStorage.getItem("SL_DEBUG")&&console.log("StreamLayerProvider mounted with props:",{sdkKey:!!e,onDeepLinkHandled:!!y,videoPlayerController:!!A})},[e,y,A]),p.jsxs(ic.Provider,{value:C,children:[a!==void 0&&p.jsx(t5,{event:a}),i]})},sl=()=>{const{sdk:e}=Z.useContext(ic);return e},GP=()=>{const{event:e}=Z.useContext(ic);return e},Ym=e=>{const t=e.target;t instanceof Element&&t.getAttribute("data-a")==="intr"&&ma.emit("interactions",{action:"tap",payload:{}})},XP=()=>{const e=sl();return Z.useEffect(()=>(document==null||document.addEventListener("click",Ym),()=>{document==null||document.removeEventListener("click",Ym)}),[]),e?p.jsx(d6,{sdk:e}):null},wP=({sdkKey:e,plugins:t,children:n,event:r,onDeepLinkHandled:i,videoPlayerController:a,production:s=!0})=>p.jsxs(F7,{sdkKey:e,plugins:t,production:s,autoEnable:!0,onDeepLinkHandled:i,videoPlayerController:a,friendsTab:"disabled",skipOnboarding:!0,hideFriends:!0,children:[p.jsx(t5,{event:r}),n]}),UP=({betPack:e,useContainer:t})=>{const{sdk:n,status:r}=Z.useContext(ic);return r===I7.UNSET?(console.error("Wrap app in `StreamLayerProvider`"),null):n?p.jsx("div",{className:"StreamLayerSDK",children:p.jsx(x3,{style:{height:"100%"},children:p.jsx(tO,{sdk:n,betPack:e,useContainer:t})})}):null};class BP extends Z.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,n){console.error(t,n.componentStack)}render(){return this.state.hasError?null:p.jsx(UP,{...this.props})}}const YP=({token:e,schema:t})=>{const n=sl();return Z.useEffect(()=>{e&&t&&n&&n.authorizationBypass(t,e),n&&(n.withAuth=!0)},[e,t,n]),null},TP=({event:e,sdkKey:t,token:n,deviceId:r,production:i=!1,theme:a,themeMode:s="light",children:l})=>{const[o,c]=Z.useState(!1);return Z.useEffect(()=>{n&&(new Fb().setToken(n),c(!0))},[n]),Z.useEffect(()=>{r&&localStorage.setItem("sl-device-id",r)},[r]),o?p.jsxs(F7,{sdkKey:t,production:i,theme:a,themeMode:s,betPack:!0,friendsTab:"disabled",hideFriends:!0,skipOnboarding:!0,autoEnable:!0,children:[p.jsx(t5,{event:e,internal:!1}),p.jsx("div",{className:"StreamLayerSDK",children:p.jsx(x3,{children:l})})]}):null},xP=({production:e})=>{const[t,n]=Z.useState();return Z.useEffect(()=>{const{hostname:r,search:i}=window.location,a=new URLSearchParams(i);n({sdkKey:a.get("_slrk")||"",event:a.get("_slre")||"",token:a.get("_slrt")||"",deviceId:a.get("_slrd")||"",theme:a.get("theme")||"",themeMode:a.get("themeMode")==="dark"?"dark":"light",production:e??!(r.includes("next.")||r==="localhost")})},[e]),t?p.jsx(TP,{...t,children:p.jsx(XP,{})}):null},kP=()=>{const e=sl();return e?p.jsx("div",{className:"StreamLayerSDK",children:p.jsx(x3,{children:p.jsx(dO,{sdk:e})})}):null};exports.A=vt;exports.B1=se;exports.BetPackStandalone=xP;exports.C=Lz;exports.C$1=QU;exports.I=B3;exports.InfiniteScroll=Xu;exports.InvitationFrom=Co;exports.M=Zb;exports.MastersStreamLayerProvider=wP;exports.MastersStreamLayerSDKReact=BP;exports.S=OU;exports.StreamLayerLogin=YP;exports.StreamLayerSDKPoints=kP;exports.T=Wb;exports.cx_default=pt;exports.d=HU;exports.f=z4;exports.k=Cb;exports.l=zU;exports.m=JU;exports.n=Yd;exports.p=hO;exports.s=Ab;exports.styled_default=R;exports.useStore=Ne;exports.useStreamLayer=sl;exports.useTransition=Uy;exports.z=vb;
101
+ `).slice(0,2).map(n=>n.trim()).join(" -- ")}function uP(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function La(e,t,n,r,i){this.started=!1,this.func=t,this.opts=n,this.onFinish=null,this.parent=e,this.timeout=i===void 0?e._timeout:i,this.name=cP(t,n),this.isAfter=r,this.q=aP(e,dP,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}lP(La,sP);La.prototype.exec=function(e,t){const n=this.func;let r=!1;const i=this.name;if(this.parent._error&&!this.isAfter){gt("skipping loading of plugin as parent errored and it is not an after",i),me.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(o){return gt("override errored",i),t(o)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,gt("exec",i);let a;const s=o=>{if(r){gt("loading complete",i);return}this._error=o,gt(o?"exec errored":"exec completed",i),r=!0,a&&clearTimeout(a),t(o)};this.timeout>0&&(gt("setting up timeout",i,this.timeout),a=setTimeout(function(){gt("timed out",i),a=null;const o=new oP(i);o.fn=n,s(o)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const l=n(this.server,this.opts,s);l&&typeof l.then=="function"&&(gt("exec: resolving promise",i),l.then(()=>me.nextTick(s),o=>me.nextTick(s,o)))};La.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,r)=>{this._error=n,this.q.pause(),n?(gt("rejecting promise",this.name,n),this._promise.reject(n)):(gt("resolving promise",this.name),this._promise.resolve()),this._promise=null,me.nextTick(r,n)}),this.q.resume()};let t;return this._promise?t=Promise.resolve():(this._promise=uP(),t=this._promise.promise,this.server?e():this.on("start",e)),t};La.prototype.enqueue=function(e,t){gt("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};La.prototype.finish=function(e,t){gt("finish",this.name,e);const n=()=>{this.loaded||(gt("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,t(e))};if(e){this._promise&&(this._promise.reject(e),this._promise=null),n();return}const r=()=>{if(gt("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const i=()=>{gt("wrap"),queueMicrotask(r)};this._promise.resolve(),this._promise.promise.then(i,i),this._promise=null}else n();else gt("delayed",this.name),this.q.drain=()=>{gt("drain",this.name),this.q.drain=pP,queueMicrotask(r)}};queueMicrotask(r),this.q.resume()};function dP(e,t){const n=this;me.nextTick(e5.bind(n),e,t)}function e5(e,t){if(typeof e.func.then=="function"){e.func.then(r=>{typeof r.default=="function"&&(r=r.default),e.func=r,e5.call(this,e,t)},t);return}const n=this._current[0];this._current.unshift(e),e.exec(n&&n.server||this._server,r=>{e.finish(r,i=>{this._current.shift(),t(i)})})}function pP(){}q3.exports=La;q3.exports.loadPlugin=e5;var hP=q3.exports;const Um=$b,fP=l7.EventEmitter,mP=q1.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:o2,AVV_ERR_CALLBACK_NOT_FN:Rs,AVV_ERR_PLUGIN_NOT_VALID:gP,AVV_ERR_ROOT_PLG_BOOTED:bP,AVV_ERR_READY_TIMEOUT:yP}=v7,VP=tP,Ou=hP,Ia=S7("avvio"),y1=Symbol("kAvvio"),c2=Symbol("kThenifyDoNotWrap");function AP(e,t,n){const r=t.expose||{},i=r.use||"use",a=r.after||"after",s=r.ready||"ready",l=r.onClose||"onClose",o=r.close||"close";if(e[i])throw new o2(i);if(e[a])throw new o2(a);if(e[s])throw new o2(s);e[i]=function(c,u){return n.use(c,u),this},Object.defineProperty(e,"then",{get:W7.bind(n)}),e[y1]=!0,e[a]=function(c){return typeof c!="function"?n._loadRegistered():(n.after(u2(c,this)),this)},e[s]=function(c){if(c&&typeof c!="function")throw new Rs(s,typeof c);return n.ready(c?u2(c,this):void 0)},e[l]=function(c){if(typeof c!="function")throw new Rs(l,typeof c);return n.onClose(SP(c,this)),this},e[o]=function(c){if(c&&typeof c!="function")throw new Rs(o,typeof c);return c?(n.close(u2(c,this)),this):n.close()}}function ht(e,t,n){if(typeof e=="function"&&arguments.length===1&&(n=e,t={},e=null),typeof t=="function"&&(n=t,t={}),t=t||{},!(this instanceof ht)){const r=new ht(e,t,n);return e&&AP(e,t,r),r}t.autostart!==!1&&(t.autostart=!0),e=e||this,this._timeout=Number(t.timeout)||0,this._server=e,this._current=[],this._error=null,this._isOnCloseHandlerKey=Symbol("isOnCloseHandler"),this._lastUsed=null,this.setMaxListeners(0),n&&this.once("start",n),this.started=!1,this.booted=!1,this.pluginTree=new VP,this._readyQ=Um(this,Z7,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=Bm},this._closeQ=Um(this,vP,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=Bm},this._doStart=null,this._root=new Ou(this,RP.bind(this),t,!1,0),this._root.once("start",(r,i,a)=>{const s=this.pluginTree.start(null,i,a);this._root.once("loaded",(l,o,c)=>{this.pluginTree.stop(s,c)})}),Ou.loadPlugin.call(this,this._root,r=>{Ia("root plugin ready");try{this.emit("preReady"),this._root=null}catch(i){r=r||this._error||i}if(r){if(this._error=r,this._readyQ.length()===0)throw r}else this.booted=!0;this._readyQ.resume()})}function RP(e,t,n){this._doStart=n,t.autostart&&this.start()}mP(ht,fP);ht.prototype.start=function(){return this.started=!0,me.nextTick(this._doStart),this};ht.prototype.override=function(e,t,n){return e};function EP(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new gP(typeof e);return e}ht.prototype[y1]=!0;ht.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};ht.prototype._loadRegistered=function(){const e=this._current[0];return!this.started&&!this.booted&&me.nextTick(()=>this._root.q.resume()),e?e.loadedSoFar():Promise.resolve()};Object.defineProperty(ht.prototype,"then",{get:W7});ht.prototype._addPlugin=function(e,t,n){if(e=EP(e),t=t||{},this.booted)throw new bP;const r=this._current[0],i=new Ou(this,e,t,n);if(i.once("start",(a,s,l)=>{const o=this.pluginTree.start(r.name,s,l);i.once("loaded",(c,u,d)=>{this.pluginTree.stop(o,d)})}),r.loaded)throw new Error(i.name,r.name);return r.enqueue(i,a=>{a&&(this._error=a)}),i};ht.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,r,i){Z7.call(this,e,i)}return this};ht.prototype.onClose=function(e){if(typeof e!="function")throw new Error("not a function");e[this._isOnCloseHandlerKey]=!0,this._closeQ.unshift(e,t.bind(this));function t(n){n&&(this._error=n)}return this};ht.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new Rs("close",typeof e)}else t=new Promise(function(n,r){e=function(i){if(i)return r(i);n()}});return this.ready(()=>{this._error=null,this._closeQ.push(e),me.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};ht.prototype.ready=function(e){if(e){if(typeof e!="function")throw new Rs("ready",typeof e);this._readyQ.push(e),queueMicrotask(this.start.bind(this));return}return new Promise((t,n)=>{this._readyQ.push(i),this.start();const r=this._current[0].server;function i(a,s,l){a?n(a):t(r),me.nextTick(l)}})};ht.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};ht.prototype.toJSON=function(){return this.pluginTree.toJSON()};function Bm(){}function W7(){if(this.booted){Ia("thenify returning null because we are already booted");return}if(this[c2]){this[c2]=!1;return}return Ia("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[c2]=!0,e(this._server)),t)}function Z7(e,t){const n=this._server,r=this._error;let i;if(this._error=null,e.length===0)this._error=r,i=e(),i&&!i[y1]&&typeof i.then=="function"?i.then(()=>me.nextTick(t),a=>me.nextTick(t,a)):me.nextTick(t);else if(e.length===1)i=e(r),i&&!i[y1]&&typeof i.then=="function"?i.then(()=>me.nextTick(t),a=>me.nextTick(t,a)):me.nextTick(t);else if(this._timeout===0){const a=s=>{this._error=s,t(this._error)};e.length===2?e(r,a):e(r,n,a)}else CP.call(this,e,r,n,t)}function CP(e,t,n,r){const i=e.name;Ia("setting up ready timeout",i,this._timeout);let a=setTimeout(()=>{Ia("timed out",i),a=null;const l=new yP(i);l.fn=e,this._error=l,r(l)},this._timeout);e.length===2?e(t,s.bind(this)):e(t,n,s.bind(this));function s(l){a&&(clearTimeout(a),this._error=l,r(this._error))}}function vP(e,t){const n=this._server,r=e[this._isOnCloseHandlerKey];if(e.length===0||e.length===1){let i;r?i=e(n):i=e(this._error),i&&typeof i.then=="function"?(Ia("resolving close/onClose promise"),i.then(()=>me.nextTick(t),a=>me.nextTick(t,a))):me.nextTick(t)}else e.length===2?e(r?n:this._error,t):r?e(n,t):e(this._error,n,t)}function SP(e,t){return n.bind(t);function n(r,i){let a;e.length===0?(a=e(),a&&a.then?a.then(function(){me.nextTick(i)},i):me.nextTick(i)):e.length===1?(a=e(this),a&&a.then?a.then(function(){me.nextTick(i)},i):me.nextTick(i)):e(this,i)}}function u2(e,t){return n.bind(t);function n(r,i){let a;e?e.length===0?(a=e(),a&&a.then?a.then(function(){me.nextTick(i,r)},i):me.nextTick(i,r)):e.length===1?(a=e(r),a&&a.then?a.then(function(){me.nextTick(i)},i):me.nextTick(i)):e.length===2?e(r,i):e(r,this,i):me.nextTick(i)}}z3.exports=ht;z3.exports.express=function(e){return ht(e,{expose:{use:"load"}})};var WP=z3.exports;const ZP=tj(WP);(function(){if(window.requestAnimationFrame&&window.cancelAnimationFrame)return;const e=["webkit","moz","ms","o"];for(const t of e)window.requestAnimationFrame=window.requestAnimationFrame||window[`${t}RequestAnimationFrame`],window.cancelAnimationFrame=window.cancelAnimationFrame||window[`${t}CancelAnimationFrame`]||window[`${t}CancelRequestAnimationFrame`];if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){let t=0;const n=!!(window.performance&&window.performance.now);window.requestAnimationFrame=function(r){const i=n?window.performance.now():new Date().getTime(),a=Math.max(0,16-(i-t)),s=window.setTimeout(function(){r(i+a)},a);return t=i+a,s},window.cancelAnimationFrame=clearTimeout}})();function IP(e,t=!0,n=!0,r={friendsTab:"enabled"}){const i=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",a=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",s=ZP(Object.create({}),{autostart:!1});return s.use(X_,{hideFriends:r.hideFriends,skipOnboarding:r.skipOnboarding,betPack:r.betPack,friendsTab:r.friendsTab,theme:r.theme,themeMode:r.themeMode}),s.use(S_,{onDeepLinkHandled:r==null?void 0:r.onDeepLinkHandled}),s.use(F_,{videoPlayerController:r==null?void 0:r.videoPlayerController}),s.use(G_,{onContentActivate:r==null?void 0:r.onContentActivate,withAd:r==null?void 0:r.withAd,withAdNotification:r==null?void 0:r.withAdNotification}),s.use(KH,{sdkKey:e,host:i,analyticsHost:a,version:r==null?void 0:r.version,webOS:r==null?void 0:r.webOS}),s.use(DH),s.use(I_),s.use(M_),s.use(y_),s.use(ej),s.after((l,o,c)=>{if(l)throw l;o.ready(),c()}),n&&s.after(async(l,o,c)=>{if(l)throw l;await o.sdk.initializeApp(),c()}),s.onClose(()=>{console.log("close")}),s}const FP=({sdkKey:e,plugins:t,production:n,autoEnable:r,onDeepLinkHandled:i,videoPlayerController:a,onContentActivate:s,hideFriends:l,skipOnboarding:o,withAdNotification:c,withAd:u,friendsTab:d,betPack:m,webOS:g})=>{const[y,A]=Z.useState(null);return Z.useEffect(()=>{let E=!1;if(!e)return console.error("streamlayer sdk key should be provided"),A(h=>(h!==null&&typeof h.disableApp=="function"&&h.disableApp(),null)),()=>{E=!0};const f=IP(e,n,r,{version:"1.18.3",onDeepLinkHandled:i,videoPlayerController:a,onContentActivate:s,skipOnboarding:o,withAdNotification:c,withAd:u,hideFriends:l,friendsTab:d,betPack:m,webOS:g});if(t)for(const h of t)f.use(h);return f.ready().then(h=>{E||(A(h.sdk),typeof window<"u")}).catch(h=>console.log(h)),()=>{E=!0,f.close(function(h){if(h)throw h})}},[e,n]),y},t5=({event:e,internal:t})=>{const n=sl(),r=GP();return Z.useEffect(()=>(n&&(e&&(n.createEventSession(e,t),r&&(r.current=e)),!e&&(r!=null&&r.current)&&(n.createEventSession("",t),r.current="")),()=>{n&&n.disableApp()}),[e,t,r,n]),null};var I7=(e=>(e[e.UNSET=0]="UNSET",e[e.CONNECTED=1]="CONNECTED",e[e.READY=2]="READY",e))(I7||{});const NP={status:0,sdk:null},ic=Z.createContext(NP),F7=({sdkKey:e,theme:t,themeMode:n,plugins:r,children:i,event:a,production:s=!0,autoEnable:l=!0,withAdNotification:o,withAd:c=!0,betPack:u=!1,hideFriends:d,skipOnboarding:m,friendsTab:g="enabled",onDeepLinkHandled:y,videoPlayerController:A,onContentActivate:E,containerId:f,webOS:h})=>{const b=FP({sdkKey:e,plugins:r,production:s,autoEnable:l,onDeepLinkHandled:y,videoPlayerController:A,onContentActivate:E,hideFriends:d,skipOnboarding:m,withAdNotification:o,withAd:c,friendsTab:g,betPack:u,webOS:h}),V=Z.useRef(""),C=Z.useMemo(()=>b?{sdk:b,status:2,event:V}:{status:1,sdk:null,event:V},[b]);return Z.useEffect(()=>{b&&(b.options.setKey("friendsTab",g),b.options.setKey("theme",t),b.options.setKey("themeMode",n),b.options.setKey("skipOnboarding",m),b.options.setKey("betPack",u),b.options.setKey("containerId",f))},[b,g,t,n,m,u,f]),Z.useEffect(()=>()=>{y&&(b==null||b.removeDeepLinkHandler(y)),A&&(b==null||b.removeVideoPlayerController(A))},[b]),Z.useEffect(()=>{localStorage.getItem("SL_DEBUG")&&console.log("StreamLayerProvider mounted with props:",{sdkKey:!!e,onDeepLinkHandled:!!y,videoPlayerController:!!A})},[e,y,A]),p.jsxs(ic.Provider,{value:C,children:[a!==void 0&&p.jsx(t5,{event:a}),i]})},sl=()=>{const{sdk:e}=Z.useContext(ic);return e},GP=()=>{const{event:e}=Z.useContext(ic);return e},Ym=e=>{const t=e.target;t instanceof Element&&t.getAttribute("data-a")==="intr"&&ma.emit("interactions",{action:"tap",payload:{}})},XP=()=>{const e=sl();return Z.useEffect(()=>(document==null||document.addEventListener("click",Ym),()=>{document==null||document.removeEventListener("click",Ym)}),[]),e?p.jsx(d6,{sdk:e}):null},wP=({sdkKey:e,plugins:t,children:n,event:r,onDeepLinkHandled:i,videoPlayerController:a,production:s=!0})=>p.jsxs(F7,{sdkKey:e,plugins:t,production:s,autoEnable:!0,onDeepLinkHandled:i,videoPlayerController:a,friendsTab:"disabled",skipOnboarding:!0,hideFriends:!0,children:[p.jsx(t5,{event:r}),n]}),UP=({betPack:e,useContainer:t})=>{const{sdk:n,status:r}=Z.useContext(ic);return r===I7.UNSET?(console.error("Wrap app in `StreamLayerProvider`"),null):n?p.jsx("div",{className:"StreamLayerSDK",children:p.jsx(x3,{style:{height:"100%"},children:p.jsx(tO,{sdk:n,betPack:e,useContainer:t})})}):null};class BP extends Z.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,n){console.error(t,n.componentStack)}render(){return this.state.hasError?null:p.jsx(UP,{...this.props})}}const YP=({token:e,schema:t})=>{const n=sl();return Z.useEffect(()=>{e&&t&&n&&n.authorizationBypass(t,e),n&&(n.withAuth=!0)},[e,t,n]),null},TP=({event:e,sdkKey:t,token:n,deviceId:r,production:i=!1,theme:a,themeMode:s="light",children:l})=>{const[o,c]=Z.useState(!1);return Z.useEffect(()=>{n&&(new Fb().setToken(n),c(!0))},[n]),Z.useEffect(()=>{r&&localStorage.setItem("sl-device-id",r)},[r]),o?p.jsxs(F7,{sdkKey:t,production:i,theme:a,themeMode:s,betPack:!0,friendsTab:"disabled",hideFriends:!0,skipOnboarding:!0,autoEnable:!0,children:[p.jsx(t5,{event:e,internal:!1}),p.jsx("div",{className:"StreamLayerSDK",children:p.jsx(x3,{children:l})})]}):null},xP=({production:e})=>{const[t,n]=Z.useState();return Z.useEffect(()=>{const{hostname:r,search:i}=window.location,a=new URLSearchParams(i);n({sdkKey:a.get("_slrk")||"",event:a.get("_slre")||"",token:a.get("_slrt")||"",deviceId:a.get("_slrd")||"",theme:a.get("theme")||"",themeMode:a.get("themeMode")==="dark"?"dark":"light",production:e??!(r.includes("next.")||r==="localhost")})},[e]),t?p.jsx(TP,{...t,children:p.jsx(XP,{})}):null},kP=()=>{const e=sl();return e?p.jsx("div",{className:"StreamLayerSDK",children:p.jsx(x3,{children:p.jsx(dO,{sdk:e})})}):null};exports.A=vt;exports.B1=se;exports.BetPackStandalone=xP;exports.C=Lz;exports.C$1=QU;exports.I=B3;exports.InfiniteScroll=Xu;exports.InvitationFrom=Co;exports.M=Zb;exports.MastersStreamLayerProvider=wP;exports.MastersStreamLayerSDKReact=BP;exports.S=OU;exports.StreamLayerLogin=YP;exports.StreamLayerSDKPoints=kP;exports.T=Wb;exports.cx_default=pt;exports.d=HU;exports.f=z4;exports.k=Cb;exports.l=zU;exports.m=JU;exports.n=Yd;exports.p=hO;exports.s=Ab;exports.styled_default=R;exports.useStore=Ne;exports.useStreamLayer=sl;exports.useTransition=Uy;exports.z=vb;
@@ -27273,7 +27273,7 @@ const L$ = ({
27273
27273
  E = !0;
27274
27274
  };
27275
27275
  const h = T$(e, n, r, {
27276
- version: "1.18.2",
27276
+ version: "1.18.3",
27277
27277
  onDeepLinkHandled: i,
27278
27278
  videoPlayerController: a,
27279
27279
  onContentActivate: l,