@streamlayer/react 1.13.0 → 1.13.1
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+(o.length?s("│"):" ")+" ";return n+r.join(c)+`
|
|
16
16
|
`+o.map(function(l,m){var u=m===o.length-1,d=l.nodes&&l.nodes.length,y=n+(u?" ":s("│"))+" ";return n+s(u?"└":"├")+s("─")+s(d?"┬":"─")+" "+e(l,y,a).slice(n.length+2)}).join("")};const US=CS,vr=Symbol("avvio.TimeTree.untrackNode"),Ra=Symbol("avvio.TimeTree.trackNode"),Ar=Symbol("avvio.TimeTree.getParent"),Rr=Symbol("avvio.TimeTree.getNode"),wr=Symbol("avvio.TimeTree.addNode");let FS=class{constructor(){this.root=null,this.tableId=new Map,this.tableLabel=new Map}[Ra](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])}[vr](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)}[Ar](e){if(e===null)return this.root;const t=this.tableLabel.get(e);return t.id?t:t[t.length-1]}[Rr](e){return this.tableId.get(e)}[wr](e,t,n){if(e===null)return this.root={id:"root",label:t,start:n,nodes:[]},this[Ra](this.root),this.root.id;const a=this[Ar](e),s=`${t}-${Math.random()}`,o={id:s,parent:e,start:n,label:t,nodes:[]};return a.nodes.push(o),this[Ra](o),s}start(e,t,n=Date.now()){return this[wr](e,t,n)}stop(e,t=Date.now()){const n=this[Rr](e);n&&(n.stop=t,n.diff=n.stop-n.start||0,this[vr](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(a=>e(a))),n),t=e(this.toJSON());return US(t)}};var BS=FS,Hs={exports:{}},cs={exports:{}},wa,Lr;function GS(){if(Lr)return wa;Lr=1;var e=1e3,t=e*60,n=t*60,a=n*24,s=a*7,o=a*365.25;wa=function(u,d){d=d||{};var y=typeof u;if(y==="string"&&u.length>0)return r(u);if(y==="number"&&isFinite(u))return d.long?l(u):c(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function r(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 y=parseFloat(d[1]),T=(d[2]||"ms").toLowerCase();switch(T){case"years":case"year":case"yrs":case"yr":case"y":return y*o;case"weeks":case"week":case"w":return y*s;case"days":case"day":case"d":return y*a;case"hours":case"hour":case"hrs":case"hr":case"h":return y*n;case"minutes":case"minute":case"mins":case"min":case"m":return y*t;case"seconds":case"second":case"secs":case"sec":case"s":return y*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return y;default:return}}}}function c(u){var d=Math.abs(u);return d>=a?Math.round(u/a)+"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 l(u){var d=Math.abs(u);return d>=a?m(u,d,a,"day"):d>=n?m(u,d,n,"hour"):d>=t?m(u,d,t,"minute"):d>=e?m(u,d,e,"second"):u+" ms"}function m(u,d,y,T){var f=d>=y*1.5;return Math.round(u/y)+" "+T+(f?"s":"")}return wa}function VS(e){n.debug=n,n.default=n,n.coerce=l,n.disable=o,n.enable=s,n.enabled=r,n.humanize=GS(),n.destroy=m,Object.keys(e).forEach(u=>{n[u]=e[u]}),n.names=[],n.skips=[],n.formatters={};function t(u){let d=0;for(let y=0;y<u.length;y++)d=(d<<5)-d+u.charCodeAt(y),d|=0;return n.colors[Math.abs(d)%n.colors.length]}n.selectColor=t;function n(u){let d,y=null,T,f;function g(...h){if(!g.enabled)return;const _=g,O=Number(new Date),A=O-(d||O);_.diff=A,_.prev=d,_.curr=O,d=O,h[0]=n.coerce(h[0]),typeof h[0]!="string"&&h.unshift("%O");let w=0;h[0]=h[0].replace(/%([a-zA-Z%])/g,(v,P)=>{if(v==="%%")return"%";w++;const I=n.formatters[P];if(typeof I=="function"){const F=h[w];v=I.call(_,F),h.splice(w,1),w--}return v}),n.formatArgs.call(_,h),(_.log||n.log).apply(_,h)}return g.namespace=u,g.useColors=n.useColors(),g.color=n.selectColor(u),g.extend=a,g.destroy=n.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>y!==null?y:(T!==n.namespaces&&(T=n.namespaces,f=n.enabled(u)),f),set:h=>{y=h}}),typeof n.init=="function"&&n.init(g),g}function a(u,d){const y=n(this.namespace+(typeof d>"u"?":":d)+u);return y.log=this.log,y}function s(u){n.save(u),n.namespaces=u,n.names=[],n.skips=[];let d;const y=(typeof u=="string"?u:"").split(/[\s,]+/),T=y.length;for(d=0;d<T;d++)y[d]&&(u=y[d].replace(/\*/g,".*?"),u[0]==="-"?n.skips.push(new RegExp("^"+u.slice(1)+"$")):n.names.push(new RegExp("^"+u+"$")))}function o(){const u=[...n.names.map(c),...n.skips.map(c).map(d=>"-"+d)].join(",");return n.enable(""),u}function r(u){if(u[u.length-1]==="*")return!0;let d,y;for(d=0,y=n.skips.length;d<y;d++)if(n.skips[d].test(u))return!1;for(d=0,y=n.names.length;d<y;d++)if(n.names[d].test(u))return!0;return!1}function c(u){return u.toString().substring(2,u.toString().length-2).replace(/\.\*\?$/,"*")}function l(u){return u instanceof Error?u.stack||u.message:u}function m(){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 qS=VS;(function(e,t){t.formatArgs=a,t.save=s,t.load=o,t.useColors=n,t.storage=r(),t.destroy=(()=>{let l=!1;return()=>{l||(l=!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 a(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const m="color: "+this.color;l.splice(1,0,m,"color: inherit");let u=0,d=0;l[0].replace(/%[a-zA-Z%]/g,y=>{y!=="%%"&&(u++,y==="%c"&&(d=u))}),l.splice(d,0,m)}t.log=console.debug||console.log||(()=>{});function s(l){try{l?t.storage.setItem("debug",l):t.storage.removeItem("debug")}catch{}}function o(){let l;try{l=t.storage.getItem("debug")}catch{}return!l&&typeof B<"u"&&"env"in B&&(l=B.env.DEBUG),l}function r(){try{return localStorage}catch{}}e.exports=qS(t);const{formatters:c}=e.exports;c.j=function(l){try{return JSON.stringify(l)}catch(m){return"[UnexpectedJSONParseError]: "+m.message}}})(cs,cs.exports);var Vc=cs.exports;const xS=pc,HS=Ec.EventEmitter,QS=ta.inherits,pe=Vc("avvio"),{AVV_ERR_READY_TIMEOUT:YS}=Gc,La=Symbol.for("plugin-meta");function jS(e,t){return e[La]&&e[La].name?e[La].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 $S(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function qt(e,t,n,a,s){this.started=!1,this.func=t,this.opts=n,this.onFinish=null,this.parent=e,this.timeout=s===void 0?e._timeout:s,this.name=jS(t,n),this.isAfter=a,this.q=xS(e,KS,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}QS(qt,HS);qt.prototype.exec=function(e,t){const n=this.func;let a=!1;const s=this.name;if(this.parent._error&&!this.isAfter){pe("skipping loading of plugin as parent errored and it is not an after",s),B.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(l){return pe("override errored",s),t(l)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,pe("exec",s);let o;const r=l=>{if(a){pe("loading complete",s);return}this._error=l,pe(l?"exec errored":"exec completed",s),a=!0,o&&clearTimeout(o),t(l)};this.timeout>0&&(pe("setting up timeout",s,this.timeout),o=setTimeout(function(){pe("timed out",s),o=null;const l=new YS(s);l.fn=n,r(l)},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,r);c&&typeof c.then=="function"&&(pe("exec: resolving promise",s),c.then(()=>B.nextTick(r),l=>B.nextTick(r,l)))};qt.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,a)=>{this._error=n,this.q.pause(),n?(pe("rejecting promise",this.name,n),this._promise.reject(n)):(pe("resolving promise",this.name),this._promise.resolve()),this._promise=null,B.nextTick(a,n)}),this.q.resume()};let t;return this._promise?t=Promise.resolve():(this._promise=$S(),t=this._promise.promise,this.server?e():this.on("start",e)),t};qt.prototype.enqueue=function(e,t){pe("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};qt.prototype.finish=function(e,t){pe("finish",this.name,e);const n=()=>{this.loaded||(pe("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 a=()=>{if(pe("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const s=()=>{pe("wrap"),queueMicrotask(a)};this._promise.resolve(),this._promise.promise.then(s,s),this._promise=null}else n();else pe("delayed",this.name),this.q.drain=()=>{pe("drain",this.name),this.q.drain=WS,queueMicrotask(a)}};queueMicrotask(a),this.q.resume()};function KS(e,t){const n=this;B.nextTick(Qs.bind(n),e,t)}function Qs(e,t){if(typeof e.func.then=="function"){e.func.then(a=>{typeof a.default=="function"&&(a=a.default),e.func=a,Qs.call(this,e,t)},t);return}const n=this._current[0];this._current.unshift(e),e.exec(n&&n.server||this._server,a=>{e.finish(a,s=>{this._current.shift(),t(s)})})}function WS(){}Hs.exports=qt;Hs.exports.loadPlugin=Qs;var zS=Hs.exports;const Pr=pc,JS=Ec.EventEmitter,XS=ta.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:Pa,AVV_ERR_CALLBACK_NOT_FN:zt,AVV_ERR_PLUGIN_NOT_VALID:ZS,AVV_ERR_ROOT_PLG_BOOTED:eE,AVV_ERR_READY_TIMEOUT:tE}=Gc,nE=BS,ls=zS,Bt=Vc("avvio"),Hn=Symbol("kAvvio"),Ma=Symbol("kThenifyDoNotWrap");function aE(e,t,n){const a=t.expose||{},s=a.use||"use",o=a.after||"after",r=a.ready||"ready",c=a.onClose||"onClose",l=a.close||"close";if(e[s])throw new Pa(s);if(e[o])throw new Pa(o);if(e[r])throw new Pa(r);e[s]=function(m,u){return n.use(m,u),this},Object.defineProperty(e,"then",{get:qc.bind(n)}),e[Hn]=!0,e[o]=function(m){return typeof m!="function"?n._loadRegistered():(n.after(Da(m,this)),this)},e[r]=function(m){if(m&&typeof m!="function")throw new zt(r,typeof m);return n.ready(m?Da(m,this):void 0)},e[c]=function(m){if(typeof m!="function")throw new zt(c,typeof m);return n.onClose(cE(m,this)),this},e[l]=function(m){if(m&&typeof m!="function")throw new zt(l,typeof m);return m?(n.close(Da(m,this)),this):n.close()}}function me(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 me)){const a=new me(e,t,n);return e&&aE(e,t,a),a}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 nE,this._readyQ=Pr(this,xc,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=Mr},this._closeQ=Pr(this,iE,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=Mr},this._doStart=null,this._root=new ls(this,sE.bind(this),t,!1,0),this._root.once("start",(a,s,o)=>{const r=this.pluginTree.start(null,s,o);this._root.once("loaded",(c,l,m)=>{this.pluginTree.stop(r,m)})}),ls.loadPlugin.call(this,this._root,a=>{Bt("root plugin ready");try{this.emit("preReady"),this._root=null}catch(s){a=a||this._error||s}if(a){if(this._error=a,this._readyQ.length()===0)throw a}else this.booted=!0;this._readyQ.resume()})}function sE(e,t,n){this._doStart=n,t.autostart&&this.start()}XS(me,JS);me.prototype.start=function(){return this.started=!0,B.nextTick(this._doStart),this};me.prototype.override=function(e,t,n){return e};function oE(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new ZS(typeof e);return e}me.prototype[Hn]=!0;me.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};me.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(me.prototype,"then",{get:qc});me.prototype._addPlugin=function(e,t,n){if(e=oE(e),t=t||{},this.booted)throw new eE;const a=this._current[0],s=new ls(this,e,t,n);if(s.once("start",(o,r,c)=>{const l=this.pluginTree.start(a.name,r,c);s.once("loaded",(m,u,d)=>{this.pluginTree.stop(l,d)})}),a.loaded)throw new Error(s.name,a.name);return a.enqueue(s,o=>{o&&(this._error=o)}),s};me.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,a,s){xc.call(this,e,s)}return this};me.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};me.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new zt("close",typeof e)}else t=new Promise(function(n,a){e=function(s){if(s)return a(s);n()}});return this.ready(()=>{this._error=null,this._closeQ.push(e),B.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};me.prototype.ready=function(e){if(e){if(typeof e!="function")throw new zt("ready",typeof e);this._readyQ.push(e),queueMicrotask(this.start.bind(this));return}return new Promise((t,n)=>{this._readyQ.push(s),this.start();const a=this._current[0].server;function s(o,r,c){o?n(o):t(a),B.nextTick(c)}})};me.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};me.prototype.toJSON=function(){return this.pluginTree.toJSON()};function Mr(){}function qc(){if(this.booted){Bt("thenify returning null because we are already booted");return}if(this[Ma]){this[Ma]=!1;return}return Bt("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[Ma]=!0,e(this._server)),t)}function xc(e,t){const n=this._server,a=this._error;let s;if(this._error=null,e.length===0)this._error=a,s=e(),s&&!s[Hn]&&typeof s.then=="function"?s.then(()=>B.nextTick(t),o=>B.nextTick(t,o)):B.nextTick(t);else if(e.length===1)s=e(a),s&&!s[Hn]&&typeof s.then=="function"?s.then(()=>B.nextTick(t),o=>B.nextTick(t,o)):B.nextTick(t);else if(this._timeout===0){const o=r=>{this._error=r,t(this._error)};e.length===2?e(a,o):e(a,n,o)}else rE.call(this,e,a,n,t)}function rE(e,t,n,a){const s=e.name;Bt("setting up ready timeout",s,this._timeout);let o=setTimeout(()=>{Bt("timed out",s),o=null;const c=new tE(s);c.fn=e,this._error=c,a(c)},this._timeout);e.length===2?e(t,r.bind(this)):e(t,n,r.bind(this));function r(c){o&&(clearTimeout(o),this._error=c,a(this._error))}}function iE(e,t){const n=this._server,a=e[this._isOnCloseHandlerKey];if(e.length===0||e.length===1){let s;a?s=e(n):s=e(this._error),s&&typeof s.then=="function"?(Bt("resolving close/onClose promise"),s.then(()=>B.nextTick(t),o=>B.nextTick(t,o))):B.nextTick(t)}else e.length===2?e(a?n:this._error,t):a?e(n,t):e(this._error,n,t)}function cE(e,t){return n.bind(t);function n(a,s){let o;e.length===0?(o=e(),o&&o.then?o.then(function(){B.nextTick(s)},s):B.nextTick(s)):e.length===1?(o=e(this),o&&o.then?o.then(function(){B.nextTick(s)},s):B.nextTick(s)):e(this,s)}}function Da(e,t){return n.bind(t);function n(a,s){let o;e?e.length===0?(o=e(),o&&o.then?o.then(function(){B.nextTick(s,a)},s):B.nextTick(s,a)):e.length===1?(o=e(a),o&&o.then?o.then(function(){B.nextTick(s)},s):B.nextTick(s)):e.length===2?e(a,s):e(a,this,s):B.nextTick(s)}}Ps.exports=me;Ps.exports.express=function(e){return me(e,{expose:{use:"load"}})};var lE=Ps.exports;const mE=Bh(lE);(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(a){const s=n?window.performance.now():new Date().getTime(),o=Math.max(0,16-(s-t)),r=window.setTimeout(function(){a(s+o)},o);return t=s+o,r},window.cancelAnimationFrame=clearTimeout}})();function uE(e,t=!0,n=!0,a={friendsTab:"enabled"}){const s=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",o=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",r=mE(Object.create({}),{autostart:!1});return r.use(Th,{hideFriends:a.hideFriends,skipOnboarding:a.skipOnboarding,friendsTab:a.friendsTab,theme:a.theme,themeMode:a.themeMode}),r.use(ih,{onDeepLinkHandled:a==null?void 0:a.onDeepLinkHandled}),r.use(uh,{videoPlayerController:a==null?void 0:a.videoPlayerController}),r.use(ph,{onContentActivate:a==null?void 0:a.onContentActivate,withAd:a==null?void 0:a.withAd,withAdNotification:a==null?void 0:a.withAdNotification}),r.use(Ok,{sdkKey:e,host:s,analyticsHost:o,version:a==null?void 0:a.version}),r.use(Lk),r.use(mh),r.use(vh),r.use(Zk),r.use(Fh),r.after((c,l,m)=>{if(c)throw c;l.ready(),m()}),n&&r.after(async(c,l,m)=>{if(c)throw c;await l.sdk.initializeApp(),m()}),r.onClose(()=>{console.log("close")}),r}const dE=({sdkKey:e,plugins:t,production:n,autoEnable:a,onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r,hideFriends:c,skipOnboarding:l,withAdNotification:m,withAd:u,friendsTab:d})=>{const[y,T]=js.useState(null);return js.useEffect(()=>{let f=!1;if(!e)return console.error("streamlayer sdk key should be provided"),T(h=>(h!==null&&typeof h.disableApp=="function"&&h.disableApp(),null)),()=>{f=!0};const g=uE(e,n,a,{version:"1.13.0",onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r,skipOnboarding:l,withAdNotification:m,withAd:u,hideFriends:c,friendsTab:d});if(t)for(const h of t)g.use(h);return g.ready().then(h=>{f||(T(h.sdk),typeof window<"u")}).catch(h=>console.log(h)),()=>{f=!0,g.close(function(h){if(h)throw h})}},[e,n]),y};exports.AutoPlayVideo=Yn;exports.CloseTimerAuto=di;exports.ConnectError=j;exports.CtaIconMode=ci;exports.InvitationFrom=Dn;exports.NotificationEnabled=Pn;exports.NotificationPromotionImagePosition=ri;exports.NotificationPromotionMode=oi;exports.NotificationSponsorLogoMode=ii;exports.PickHistoryStatus=Ot;exports.PromotionButtonType=mi;exports.PromotionLogoMode=ui;exports.PromotionType=oe;exports.QuestionImages=rt;exports.QuestionStatus=te;exports.QuestionType=M;exports.SdkOverlayType=$;exports.createContextKey=Ya;exports.global=ja;exports.pino_1=Vr;exports.useStreamLayerApp=dE;
|
|
17
|
+
`).slice(0,2).map(n=>n.trim()).join(" -- ")}function $S(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function qt(e,t,n,a,s){this.started=!1,this.func=t,this.opts=n,this.onFinish=null,this.parent=e,this.timeout=s===void 0?e._timeout:s,this.name=jS(t,n),this.isAfter=a,this.q=xS(e,KS,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}QS(qt,HS);qt.prototype.exec=function(e,t){const n=this.func;let a=!1;const s=this.name;if(this.parent._error&&!this.isAfter){pe("skipping loading of plugin as parent errored and it is not an after",s),B.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(l){return pe("override errored",s),t(l)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,pe("exec",s);let o;const r=l=>{if(a){pe("loading complete",s);return}this._error=l,pe(l?"exec errored":"exec completed",s),a=!0,o&&clearTimeout(o),t(l)};this.timeout>0&&(pe("setting up timeout",s,this.timeout),o=setTimeout(function(){pe("timed out",s),o=null;const l=new YS(s);l.fn=n,r(l)},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,r);c&&typeof c.then=="function"&&(pe("exec: resolving promise",s),c.then(()=>B.nextTick(r),l=>B.nextTick(r,l)))};qt.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,a)=>{this._error=n,this.q.pause(),n?(pe("rejecting promise",this.name,n),this._promise.reject(n)):(pe("resolving promise",this.name),this._promise.resolve()),this._promise=null,B.nextTick(a,n)}),this.q.resume()};let t;return this._promise?t=Promise.resolve():(this._promise=$S(),t=this._promise.promise,this.server?e():this.on("start",e)),t};qt.prototype.enqueue=function(e,t){pe("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};qt.prototype.finish=function(e,t){pe("finish",this.name,e);const n=()=>{this.loaded||(pe("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 a=()=>{if(pe("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const s=()=>{pe("wrap"),queueMicrotask(a)};this._promise.resolve(),this._promise.promise.then(s,s),this._promise=null}else n();else pe("delayed",this.name),this.q.drain=()=>{pe("drain",this.name),this.q.drain=WS,queueMicrotask(a)}};queueMicrotask(a),this.q.resume()};function KS(e,t){const n=this;B.nextTick(Qs.bind(n),e,t)}function Qs(e,t){if(typeof e.func.then=="function"){e.func.then(a=>{typeof a.default=="function"&&(a=a.default),e.func=a,Qs.call(this,e,t)},t);return}const n=this._current[0];this._current.unshift(e),e.exec(n&&n.server||this._server,a=>{e.finish(a,s=>{this._current.shift(),t(s)})})}function WS(){}Hs.exports=qt;Hs.exports.loadPlugin=Qs;var zS=Hs.exports;const Pr=pc,JS=Ec.EventEmitter,XS=ta.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:Pa,AVV_ERR_CALLBACK_NOT_FN:zt,AVV_ERR_PLUGIN_NOT_VALID:ZS,AVV_ERR_ROOT_PLG_BOOTED:eE,AVV_ERR_READY_TIMEOUT:tE}=Gc,nE=BS,ls=zS,Bt=Vc("avvio"),Hn=Symbol("kAvvio"),Ma=Symbol("kThenifyDoNotWrap");function aE(e,t,n){const a=t.expose||{},s=a.use||"use",o=a.after||"after",r=a.ready||"ready",c=a.onClose||"onClose",l=a.close||"close";if(e[s])throw new Pa(s);if(e[o])throw new Pa(o);if(e[r])throw new Pa(r);e[s]=function(m,u){return n.use(m,u),this},Object.defineProperty(e,"then",{get:qc.bind(n)}),e[Hn]=!0,e[o]=function(m){return typeof m!="function"?n._loadRegistered():(n.after(Da(m,this)),this)},e[r]=function(m){if(m&&typeof m!="function")throw new zt(r,typeof m);return n.ready(m?Da(m,this):void 0)},e[c]=function(m){if(typeof m!="function")throw new zt(c,typeof m);return n.onClose(cE(m,this)),this},e[l]=function(m){if(m&&typeof m!="function")throw new zt(l,typeof m);return m?(n.close(Da(m,this)),this):n.close()}}function me(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 me)){const a=new me(e,t,n);return e&&aE(e,t,a),a}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 nE,this._readyQ=Pr(this,xc,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=Mr},this._closeQ=Pr(this,iE,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=Mr},this._doStart=null,this._root=new ls(this,sE.bind(this),t,!1,0),this._root.once("start",(a,s,o)=>{const r=this.pluginTree.start(null,s,o);this._root.once("loaded",(c,l,m)=>{this.pluginTree.stop(r,m)})}),ls.loadPlugin.call(this,this._root,a=>{Bt("root plugin ready");try{this.emit("preReady"),this._root=null}catch(s){a=a||this._error||s}if(a){if(this._error=a,this._readyQ.length()===0)throw a}else this.booted=!0;this._readyQ.resume()})}function sE(e,t,n){this._doStart=n,t.autostart&&this.start()}XS(me,JS);me.prototype.start=function(){return this.started=!0,B.nextTick(this._doStart),this};me.prototype.override=function(e,t,n){return e};function oE(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new ZS(typeof e);return e}me.prototype[Hn]=!0;me.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};me.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(me.prototype,"then",{get:qc});me.prototype._addPlugin=function(e,t,n){if(e=oE(e),t=t||{},this.booted)throw new eE;const a=this._current[0],s=new ls(this,e,t,n);if(s.once("start",(o,r,c)=>{const l=this.pluginTree.start(a.name,r,c);s.once("loaded",(m,u,d)=>{this.pluginTree.stop(l,d)})}),a.loaded)throw new Error(s.name,a.name);return a.enqueue(s,o=>{o&&(this._error=o)}),s};me.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,a,s){xc.call(this,e,s)}return this};me.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};me.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new zt("close",typeof e)}else t=new Promise(function(n,a){e=function(s){if(s)return a(s);n()}});return this.ready(()=>{this._error=null,this._closeQ.push(e),B.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};me.prototype.ready=function(e){if(e){if(typeof e!="function")throw new zt("ready",typeof e);this._readyQ.push(e),queueMicrotask(this.start.bind(this));return}return new Promise((t,n)=>{this._readyQ.push(s),this.start();const a=this._current[0].server;function s(o,r,c){o?n(o):t(a),B.nextTick(c)}})};me.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};me.prototype.toJSON=function(){return this.pluginTree.toJSON()};function Mr(){}function qc(){if(this.booted){Bt("thenify returning null because we are already booted");return}if(this[Ma]){this[Ma]=!1;return}return Bt("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[Ma]=!0,e(this._server)),t)}function xc(e,t){const n=this._server,a=this._error;let s;if(this._error=null,e.length===0)this._error=a,s=e(),s&&!s[Hn]&&typeof s.then=="function"?s.then(()=>B.nextTick(t),o=>B.nextTick(t,o)):B.nextTick(t);else if(e.length===1)s=e(a),s&&!s[Hn]&&typeof s.then=="function"?s.then(()=>B.nextTick(t),o=>B.nextTick(t,o)):B.nextTick(t);else if(this._timeout===0){const o=r=>{this._error=r,t(this._error)};e.length===2?e(a,o):e(a,n,o)}else rE.call(this,e,a,n,t)}function rE(e,t,n,a){const s=e.name;Bt("setting up ready timeout",s,this._timeout);let o=setTimeout(()=>{Bt("timed out",s),o=null;const c=new tE(s);c.fn=e,this._error=c,a(c)},this._timeout);e.length===2?e(t,r.bind(this)):e(t,n,r.bind(this));function r(c){o&&(clearTimeout(o),this._error=c,a(this._error))}}function iE(e,t){const n=this._server,a=e[this._isOnCloseHandlerKey];if(e.length===0||e.length===1){let s;a?s=e(n):s=e(this._error),s&&typeof s.then=="function"?(Bt("resolving close/onClose promise"),s.then(()=>B.nextTick(t),o=>B.nextTick(t,o))):B.nextTick(t)}else e.length===2?e(a?n:this._error,t):a?e(n,t):e(this._error,n,t)}function cE(e,t){return n.bind(t);function n(a,s){let o;e.length===0?(o=e(),o&&o.then?o.then(function(){B.nextTick(s)},s):B.nextTick(s)):e.length===1?(o=e(this),o&&o.then?o.then(function(){B.nextTick(s)},s):B.nextTick(s)):e(this,s)}}function Da(e,t){return n.bind(t);function n(a,s){let o;e?e.length===0?(o=e(),o&&o.then?o.then(function(){B.nextTick(s,a)},s):B.nextTick(s,a)):e.length===1?(o=e(a),o&&o.then?o.then(function(){B.nextTick(s)},s):B.nextTick(s)):e.length===2?e(a,s):e(a,this,s):B.nextTick(s)}}Ps.exports=me;Ps.exports.express=function(e){return me(e,{expose:{use:"load"}})};var lE=Ps.exports;const mE=Bh(lE);(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(a){const s=n?window.performance.now():new Date().getTime(),o=Math.max(0,16-(s-t)),r=window.setTimeout(function(){a(s+o)},o);return t=s+o,r},window.cancelAnimationFrame=clearTimeout}})();function uE(e,t=!0,n=!0,a={friendsTab:"enabled"}){const s=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",o=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",r=mE(Object.create({}),{autostart:!1});return r.use(Th,{hideFriends:a.hideFriends,skipOnboarding:a.skipOnboarding,friendsTab:a.friendsTab,theme:a.theme,themeMode:a.themeMode}),r.use(ih,{onDeepLinkHandled:a==null?void 0:a.onDeepLinkHandled}),r.use(uh,{videoPlayerController:a==null?void 0:a.videoPlayerController}),r.use(ph,{onContentActivate:a==null?void 0:a.onContentActivate,withAd:a==null?void 0:a.withAd,withAdNotification:a==null?void 0:a.withAdNotification}),r.use(Ok,{sdkKey:e,host:s,analyticsHost:o,version:a==null?void 0:a.version}),r.use(Lk),r.use(mh),r.use(vh),r.use(Zk),r.use(Fh),r.after((c,l,m)=>{if(c)throw c;l.ready(),m()}),n&&r.after(async(c,l,m)=>{if(c)throw c;await l.sdk.initializeApp(),m()}),r.onClose(()=>{console.log("close")}),r}const dE=({sdkKey:e,plugins:t,production:n,autoEnable:a,onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r,hideFriends:c,skipOnboarding:l,withAdNotification:m,withAd:u,friendsTab:d})=>{const[y,T]=js.useState(null);return js.useEffect(()=>{let f=!1;if(!e)return console.error("streamlayer sdk key should be provided"),T(h=>(h!==null&&typeof h.disableApp=="function"&&h.disableApp(),null)),()=>{f=!0};const g=uE(e,n,a,{version:"1.13.1",onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r,skipOnboarding:l,withAdNotification:m,withAd:u,hideFriends:c,friendsTab:d});if(t)for(const h of t)g.use(h);return g.ready().then(h=>{f||(T(h.sdk),typeof window<"u")}).catch(h=>console.log(h)),()=>{f=!0,g.close(function(h){if(h)throw h})}},[e,n]),y};exports.AutoPlayVideo=Yn;exports.CloseTimerAuto=di;exports.ConnectError=j;exports.CtaIconMode=ci;exports.InvitationFrom=Dn;exports.NotificationEnabled=Pn;exports.NotificationPromotionImagePosition=ri;exports.NotificationPromotionMode=oi;exports.NotificationSponsorLogoMode=ii;exports.PickHistoryStatus=Ot;exports.PromotionButtonType=mi;exports.PromotionLogoMode=ui;exports.PromotionType=oe;exports.QuestionImages=rt;exports.QuestionStatus=te;exports.QuestionType=M;exports.SdkOverlayType=$;exports.createContextKey=Ya;exports.global=ja;exports.pino_1=Vr;exports.useStreamLayerApp=dE;
|
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
`),c=`
|
|
15
15
|
`+n+(o.length?s("│"):" ")+" ";return n+r.join(c)+`
|
|
16
16
|
`+o.map(function(l,m){var u=m===o.length-1,d=l.nodes&&l.nodes.length,y=n+(u?" ":s("│"))+" ";return n+s(u?"└":"├")+s("─")+s(d?"┬":"─")+" "+e(l,y,a).slice(n.length+2)}).join("")};const US=CS,vr=Symbol("avvio.TimeTree.untrackNode"),Ra=Symbol("avvio.TimeTree.trackNode"),Ar=Symbol("avvio.TimeTree.getParent"),Rr=Symbol("avvio.TimeTree.getNode"),wr=Symbol("avvio.TimeTree.addNode");let FS=class{constructor(){this.root=null,this.tableId=new Map,this.tableLabel=new Map}[Ra](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])}[vr](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)}[Ar](e){if(e===null)return this.root;const t=this.tableLabel.get(e);return t.id?t:t[t.length-1]}[Rr](e){return this.tableId.get(e)}[wr](e,t,n){if(e===null)return this.root={id:"root",label:t,start:n,nodes:[]},this[Ra](this.root),this.root.id;const a=this[Ar](e),s=`${t}-${Math.random()}`,o={id:s,parent:e,start:n,label:t,nodes:[]};return a.nodes.push(o),this[Ra](o),s}start(e,t,n=Date.now()){return this[wr](e,t,n)}stop(e,t=Date.now()){const n=this[Rr](e);n&&(n.stop=t,n.diff=n.stop-n.start||0,this[vr](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(a=>e(a))),n),t=e(this.toJSON());return US(t)}};var BS=FS,Hs={exports:{}},cs={exports:{}},wa,Lr;function GS(){if(Lr)return wa;Lr=1;var e=1e3,t=e*60,n=t*60,a=n*24,s=a*7,o=a*365.25;wa=function(u,d){d=d||{};var y=typeof u;if(y==="string"&&u.length>0)return r(u);if(y==="number"&&isFinite(u))return d.long?l(u):c(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function r(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 y=parseFloat(d[1]),T=(d[2]||"ms").toLowerCase();switch(T){case"years":case"year":case"yrs":case"yr":case"y":return y*o;case"weeks":case"week":case"w":return y*s;case"days":case"day":case"d":return y*a;case"hours":case"hour":case"hrs":case"hr":case"h":return y*n;case"minutes":case"minute":case"mins":case"min":case"m":return y*t;case"seconds":case"second":case"secs":case"sec":case"s":return y*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return y;default:return}}}}function c(u){var d=Math.abs(u);return d>=a?Math.round(u/a)+"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 l(u){var d=Math.abs(u);return d>=a?m(u,d,a,"day"):d>=n?m(u,d,n,"hour"):d>=t?m(u,d,t,"minute"):d>=e?m(u,d,e,"second"):u+" ms"}function m(u,d,y,T){var f=d>=y*1.5;return Math.round(u/y)+" "+T+(f?"s":"")}return wa}function VS(e){n.debug=n,n.default=n,n.coerce=l,n.disable=o,n.enable=s,n.enabled=r,n.humanize=GS(),n.destroy=m,Object.keys(e).forEach(u=>{n[u]=e[u]}),n.names=[],n.skips=[],n.formatters={};function t(u){let d=0;for(let y=0;y<u.length;y++)d=(d<<5)-d+u.charCodeAt(y),d|=0;return n.colors[Math.abs(d)%n.colors.length]}n.selectColor=t;function n(u){let d,y=null,T,f;function g(...h){if(!g.enabled)return;const _=g,O=Number(new Date),A=O-(d||O);_.diff=A,_.prev=d,_.curr=O,d=O,h[0]=n.coerce(h[0]),typeof h[0]!="string"&&h.unshift("%O");let w=0;h[0]=h[0].replace(/%([a-zA-Z%])/g,(v,P)=>{if(v==="%%")return"%";w++;const I=n.formatters[P];if(typeof I=="function"){const F=h[w];v=I.call(_,F),h.splice(w,1),w--}return v}),n.formatArgs.call(_,h),(_.log||n.log).apply(_,h)}return g.namespace=u,g.useColors=n.useColors(),g.color=n.selectColor(u),g.extend=a,g.destroy=n.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>y!==null?y:(T!==n.namespaces&&(T=n.namespaces,f=n.enabled(u)),f),set:h=>{y=h}}),typeof n.init=="function"&&n.init(g),g}function a(u,d){const y=n(this.namespace+(typeof d>"u"?":":d)+u);return y.log=this.log,y}function s(u){n.save(u),n.namespaces=u,n.names=[],n.skips=[];let d;const y=(typeof u=="string"?u:"").split(/[\s,]+/),T=y.length;for(d=0;d<T;d++)y[d]&&(u=y[d].replace(/\*/g,".*?"),u[0]==="-"?n.skips.push(new RegExp("^"+u.slice(1)+"$")):n.names.push(new RegExp("^"+u+"$")))}function o(){const u=[...n.names.map(c),...n.skips.map(c).map(d=>"-"+d)].join(",");return n.enable(""),u}function r(u){if(u[u.length-1]==="*")return!0;let d,y;for(d=0,y=n.skips.length;d<y;d++)if(n.skips[d].test(u))return!1;for(d=0,y=n.names.length;d<y;d++)if(n.names[d].test(u))return!0;return!1}function c(u){return u.toString().substring(2,u.toString().length-2).replace(/\.\*\?$/,"*")}function l(u){return u instanceof Error?u.stack||u.message:u}function m(){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 qS=VS;(function(e,t){t.formatArgs=a,t.save=s,t.load=o,t.useColors=n,t.storage=r(),t.destroy=(()=>{let l=!1;return()=>{l||(l=!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 a(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const m="color: "+this.color;l.splice(1,0,m,"color: inherit");let u=0,d=0;l[0].replace(/%[a-zA-Z%]/g,y=>{y!=="%%"&&(u++,y==="%c"&&(d=u))}),l.splice(d,0,m)}t.log=console.debug||console.log||(()=>{});function s(l){try{l?t.storage.setItem("debug",l):t.storage.removeItem("debug")}catch{}}function o(){let l;try{l=t.storage.getItem("debug")}catch{}return!l&&typeof B<"u"&&"env"in B&&(l=B.env.DEBUG),l}function r(){try{return localStorage}catch{}}e.exports=qS(t);const{formatters:c}=e.exports;c.j=function(l){try{return JSON.stringify(l)}catch(m){return"[UnexpectedJSONParseError]: "+m.message}}})(cs,cs.exports);var Vc=cs.exports;const xS=pc,HS=Ec.EventEmitter,QS=ta.inherits,pe=Vc("avvio"),{AVV_ERR_READY_TIMEOUT:YS}=Gc,La=Symbol.for("plugin-meta");function jS(e,t){return e[La]&&e[La].name?e[La].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 $S(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function qt(e,t,n,a,s){this.started=!1,this.func=t,this.opts=n,this.onFinish=null,this.parent=e,this.timeout=s===void 0?e._timeout:s,this.name=jS(t,n),this.isAfter=a,this.q=xS(e,KS,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}QS(qt,HS);qt.prototype.exec=function(e,t){const n=this.func;let a=!1;const s=this.name;if(this.parent._error&&!this.isAfter){pe("skipping loading of plugin as parent errored and it is not an after",s),B.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(l){return pe("override errored",s),t(l)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,pe("exec",s);let o;const r=l=>{if(a){pe("loading complete",s);return}this._error=l,pe(l?"exec errored":"exec completed",s),a=!0,o&&clearTimeout(o),t(l)};this.timeout>0&&(pe("setting up timeout",s,this.timeout),o=setTimeout(function(){pe("timed out",s),o=null;const l=new YS(s);l.fn=n,r(l)},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,r);c&&typeof c.then=="function"&&(pe("exec: resolving promise",s),c.then(()=>B.nextTick(r),l=>B.nextTick(r,l)))};qt.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,a)=>{this._error=n,this.q.pause(),n?(pe("rejecting promise",this.name,n),this._promise.reject(n)):(pe("resolving promise",this.name),this._promise.resolve()),this._promise=null,B.nextTick(a,n)}),this.q.resume()};let t;return this._promise?t=Promise.resolve():(this._promise=$S(),t=this._promise.promise,this.server?e():this.on("start",e)),t};qt.prototype.enqueue=function(e,t){pe("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};qt.prototype.finish=function(e,t){pe("finish",this.name,e);const n=()=>{this.loaded||(pe("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 a=()=>{if(pe("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const s=()=>{pe("wrap"),queueMicrotask(a)};this._promise.resolve(),this._promise.promise.then(s,s),this._promise=null}else n();else pe("delayed",this.name),this.q.drain=()=>{pe("drain",this.name),this.q.drain=WS,queueMicrotask(a)}};queueMicrotask(a),this.q.resume()};function KS(e,t){const n=this;B.nextTick(Qs.bind(n),e,t)}function Qs(e,t){if(typeof e.func.then=="function"){e.func.then(a=>{typeof a.default=="function"&&(a=a.default),e.func=a,Qs.call(this,e,t)},t);return}const n=this._current[0];this._current.unshift(e),e.exec(n&&n.server||this._server,a=>{e.finish(a,s=>{this._current.shift(),t(s)})})}function WS(){}Hs.exports=qt;Hs.exports.loadPlugin=Qs;var zS=Hs.exports;const Pr=pc,JS=Ec.EventEmitter,XS=ta.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:Pa,AVV_ERR_CALLBACK_NOT_FN:zt,AVV_ERR_PLUGIN_NOT_VALID:ZS,AVV_ERR_ROOT_PLG_BOOTED:eE,AVV_ERR_READY_TIMEOUT:tE}=Gc,nE=BS,ls=zS,Bt=Vc("avvio"),Hn=Symbol("kAvvio"),Ma=Symbol("kThenifyDoNotWrap");function aE(e,t,n){const a=t.expose||{},s=a.use||"use",o=a.after||"after",r=a.ready||"ready",c=a.onClose||"onClose",l=a.close||"close";if(e[s])throw new Pa(s);if(e[o])throw new Pa(o);if(e[r])throw new Pa(r);e[s]=function(m,u){return n.use(m,u),this},Object.defineProperty(e,"then",{get:qc.bind(n)}),e[Hn]=!0,e[o]=function(m){return typeof m!="function"?n._loadRegistered():(n.after(Da(m,this)),this)},e[r]=function(m){if(m&&typeof m!="function")throw new zt(r,typeof m);return n.ready(m?Da(m,this):void 0)},e[c]=function(m){if(typeof m!="function")throw new zt(c,typeof m);return n.onClose(cE(m,this)),this},e[l]=function(m){if(m&&typeof m!="function")throw new zt(l,typeof m);return m?(n.close(Da(m,this)),this):n.close()}}function me(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 me)){const a=new me(e,t,n);return e&&aE(e,t,a),a}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 nE,this._readyQ=Pr(this,xc,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=Mr},this._closeQ=Pr(this,iE,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=Mr},this._doStart=null,this._root=new ls(this,sE.bind(this),t,!1,0),this._root.once("start",(a,s,o)=>{const r=this.pluginTree.start(null,s,o);this._root.once("loaded",(c,l,m)=>{this.pluginTree.stop(r,m)})}),ls.loadPlugin.call(this,this._root,a=>{Bt("root plugin ready");try{this.emit("preReady"),this._root=null}catch(s){a=a||this._error||s}if(a){if(this._error=a,this._readyQ.length()===0)throw a}else this.booted=!0;this._readyQ.resume()})}function sE(e,t,n){this._doStart=n,t.autostart&&this.start()}XS(me,JS);me.prototype.start=function(){return this.started=!0,B.nextTick(this._doStart),this};me.prototype.override=function(e,t,n){return e};function oE(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new ZS(typeof e);return e}me.prototype[Hn]=!0;me.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};me.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(me.prototype,"then",{get:qc});me.prototype._addPlugin=function(e,t,n){if(e=oE(e),t=t||{},this.booted)throw new eE;const a=this._current[0],s=new ls(this,e,t,n);if(s.once("start",(o,r,c)=>{const l=this.pluginTree.start(a.name,r,c);s.once("loaded",(m,u,d)=>{this.pluginTree.stop(l,d)})}),a.loaded)throw new Error(s.name,a.name);return a.enqueue(s,o=>{o&&(this._error=o)}),s};me.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,a,s){xc.call(this,e,s)}return this};me.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};me.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new zt("close",typeof e)}else t=new Promise(function(n,a){e=function(s){if(s)return a(s);n()}});return this.ready(()=>{this._error=null,this._closeQ.push(e),B.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};me.prototype.ready=function(e){if(e){if(typeof e!="function")throw new zt("ready",typeof e);this._readyQ.push(e),queueMicrotask(this.start.bind(this));return}return new Promise((t,n)=>{this._readyQ.push(s),this.start();const a=this._current[0].server;function s(o,r,c){o?n(o):t(a),B.nextTick(c)}})};me.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};me.prototype.toJSON=function(){return this.pluginTree.toJSON()};function Mr(){}function qc(){if(this.booted){Bt("thenify returning null because we are already booted");return}if(this[Ma]){this[Ma]=!1;return}return Bt("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[Ma]=!0,e(this._server)),t)}function xc(e,t){const n=this._server,a=this._error;let s;if(this._error=null,e.length===0)this._error=a,s=e(),s&&!s[Hn]&&typeof s.then=="function"?s.then(()=>B.nextTick(t),o=>B.nextTick(t,o)):B.nextTick(t);else if(e.length===1)s=e(a),s&&!s[Hn]&&typeof s.then=="function"?s.then(()=>B.nextTick(t),o=>B.nextTick(t,o)):B.nextTick(t);else if(this._timeout===0){const o=r=>{this._error=r,t(this._error)};e.length===2?e(a,o):e(a,n,o)}else rE.call(this,e,a,n,t)}function rE(e,t,n,a){const s=e.name;Bt("setting up ready timeout",s,this._timeout);let o=setTimeout(()=>{Bt("timed out",s),o=null;const c=new tE(s);c.fn=e,this._error=c,a(c)},this._timeout);e.length===2?e(t,r.bind(this)):e(t,n,r.bind(this));function r(c){o&&(clearTimeout(o),this._error=c,a(this._error))}}function iE(e,t){const n=this._server,a=e[this._isOnCloseHandlerKey];if(e.length===0||e.length===1){let s;a?s=e(n):s=e(this._error),s&&typeof s.then=="function"?(Bt("resolving close/onClose promise"),s.then(()=>B.nextTick(t),o=>B.nextTick(t,o))):B.nextTick(t)}else e.length===2?e(a?n:this._error,t):a?e(n,t):e(this._error,n,t)}function cE(e,t){return n.bind(t);function n(a,s){let o;e.length===0?(o=e(),o&&o.then?o.then(function(){B.nextTick(s)},s):B.nextTick(s)):e.length===1?(o=e(this),o&&o.then?o.then(function(){B.nextTick(s)},s):B.nextTick(s)):e(this,s)}}function Da(e,t){return n.bind(t);function n(a,s){let o;e?e.length===0?(o=e(),o&&o.then?o.then(function(){B.nextTick(s,a)},s):B.nextTick(s,a)):e.length===1?(o=e(a),o&&o.then?o.then(function(){B.nextTick(s)},s):B.nextTick(s)):e.length===2?e(a,s):e(a,this,s):B.nextTick(s)}}Ps.exports=me;Ps.exports.express=function(e){return me(e,{expose:{use:"load"}})};var lE=Ps.exports;const mE=Bh(lE);(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(a){const s=n?window.performance.now():new Date().getTime(),o=Math.max(0,16-(s-t)),r=window.setTimeout(function(){a(s+o)},o);return t=s+o,r},window.cancelAnimationFrame=clearTimeout}})();function uE(e,t=!0,n=!0,a={friendsTab:"enabled"}){const s=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",o=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",r=mE(Object.create({}),{autostart:!1});return r.use(Th,{hideFriends:a.hideFriends,skipOnboarding:a.skipOnboarding,friendsTab:a.friendsTab,theme:a.theme,themeMode:a.themeMode}),r.use(ih,{onDeepLinkHandled:a==null?void 0:a.onDeepLinkHandled}),r.use(uh,{videoPlayerController:a==null?void 0:a.videoPlayerController}),r.use(ph,{onContentActivate:a==null?void 0:a.onContentActivate,withAd:a==null?void 0:a.withAd,withAdNotification:a==null?void 0:a.withAdNotification}),r.use(Ok,{sdkKey:e,host:s,analyticsHost:o,version:a==null?void 0:a.version}),r.use(Lk),r.use(mh),r.use(vh),r.use(Zk),r.use(Fh),r.after((c,l,m)=>{if(c)throw c;l.ready(),m()}),n&&r.after(async(c,l,m)=>{if(c)throw c;await l.sdk.initializeApp(),m()}),r.onClose(()=>{console.log("close")}),r}const dE=({sdkKey:e,plugins:t,production:n,autoEnable:a,onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r,hideFriends:c,skipOnboarding:l,withAdNotification:m,withAd:u,friendsTab:d})=>{const[y,T]=js.useState(null);return js.useEffect(()=>{let f=!1;if(!e)return console.error("streamlayer sdk key should be provided"),T(h=>(h!==null&&typeof h.disableApp=="function"&&h.disableApp(),null)),()=>{f=!0};const g=uE(e,n,a,{version:"1.13.0",onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r,skipOnboarding:l,withAdNotification:m,withAd:u,hideFriends:c,friendsTab:d});if(t)for(const h of t)g.use(h);return g.ready().then(h=>{f||(T(h.sdk),typeof window<"u")}).catch(h=>console.log(h)),()=>{f=!0,g.close(function(h){if(h)throw h})}},[e,n]),y};exports.AutoPlayVideo=Yn;exports.CloseTimerAuto=di;exports.ConnectError=j;exports.CtaIconMode=ci;exports.InvitationFrom=Dn;exports.NotificationEnabled=Pn;exports.NotificationPromotionImagePosition=ri;exports.NotificationPromotionMode=oi;exports.NotificationSponsorLogoMode=ii;exports.PickHistoryStatus=Ot;exports.PromotionButtonType=mi;exports.PromotionLogoMode=ui;exports.PromotionType=oe;exports.QuestionImages=rt;exports.QuestionStatus=te;exports.QuestionType=M;exports.SdkOverlayType=$;exports.createContextKey=Ya;exports.global=ja;exports.pino_1=Vr;exports.useStreamLayerApp=dE;
|
|
17
|
+
`).slice(0,2).map(n=>n.trim()).join(" -- ")}function $S(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function qt(e,t,n,a,s){this.started=!1,this.func=t,this.opts=n,this.onFinish=null,this.parent=e,this.timeout=s===void 0?e._timeout:s,this.name=jS(t,n),this.isAfter=a,this.q=xS(e,KS,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}QS(qt,HS);qt.prototype.exec=function(e,t){const n=this.func;let a=!1;const s=this.name;if(this.parent._error&&!this.isAfter){pe("skipping loading of plugin as parent errored and it is not an after",s),B.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(l){return pe("override errored",s),t(l)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,pe("exec",s);let o;const r=l=>{if(a){pe("loading complete",s);return}this._error=l,pe(l?"exec errored":"exec completed",s),a=!0,o&&clearTimeout(o),t(l)};this.timeout>0&&(pe("setting up timeout",s,this.timeout),o=setTimeout(function(){pe("timed out",s),o=null;const l=new YS(s);l.fn=n,r(l)},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,r);c&&typeof c.then=="function"&&(pe("exec: resolving promise",s),c.then(()=>B.nextTick(r),l=>B.nextTick(r,l)))};qt.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,a)=>{this._error=n,this.q.pause(),n?(pe("rejecting promise",this.name,n),this._promise.reject(n)):(pe("resolving promise",this.name),this._promise.resolve()),this._promise=null,B.nextTick(a,n)}),this.q.resume()};let t;return this._promise?t=Promise.resolve():(this._promise=$S(),t=this._promise.promise,this.server?e():this.on("start",e)),t};qt.prototype.enqueue=function(e,t){pe("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};qt.prototype.finish=function(e,t){pe("finish",this.name,e);const n=()=>{this.loaded||(pe("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 a=()=>{if(pe("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const s=()=>{pe("wrap"),queueMicrotask(a)};this._promise.resolve(),this._promise.promise.then(s,s),this._promise=null}else n();else pe("delayed",this.name),this.q.drain=()=>{pe("drain",this.name),this.q.drain=WS,queueMicrotask(a)}};queueMicrotask(a),this.q.resume()};function KS(e,t){const n=this;B.nextTick(Qs.bind(n),e,t)}function Qs(e,t){if(typeof e.func.then=="function"){e.func.then(a=>{typeof a.default=="function"&&(a=a.default),e.func=a,Qs.call(this,e,t)},t);return}const n=this._current[0];this._current.unshift(e),e.exec(n&&n.server||this._server,a=>{e.finish(a,s=>{this._current.shift(),t(s)})})}function WS(){}Hs.exports=qt;Hs.exports.loadPlugin=Qs;var zS=Hs.exports;const Pr=pc,JS=Ec.EventEmitter,XS=ta.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:Pa,AVV_ERR_CALLBACK_NOT_FN:zt,AVV_ERR_PLUGIN_NOT_VALID:ZS,AVV_ERR_ROOT_PLG_BOOTED:eE,AVV_ERR_READY_TIMEOUT:tE}=Gc,nE=BS,ls=zS,Bt=Vc("avvio"),Hn=Symbol("kAvvio"),Ma=Symbol("kThenifyDoNotWrap");function aE(e,t,n){const a=t.expose||{},s=a.use||"use",o=a.after||"after",r=a.ready||"ready",c=a.onClose||"onClose",l=a.close||"close";if(e[s])throw new Pa(s);if(e[o])throw new Pa(o);if(e[r])throw new Pa(r);e[s]=function(m,u){return n.use(m,u),this},Object.defineProperty(e,"then",{get:qc.bind(n)}),e[Hn]=!0,e[o]=function(m){return typeof m!="function"?n._loadRegistered():(n.after(Da(m,this)),this)},e[r]=function(m){if(m&&typeof m!="function")throw new zt(r,typeof m);return n.ready(m?Da(m,this):void 0)},e[c]=function(m){if(typeof m!="function")throw new zt(c,typeof m);return n.onClose(cE(m,this)),this},e[l]=function(m){if(m&&typeof m!="function")throw new zt(l,typeof m);return m?(n.close(Da(m,this)),this):n.close()}}function me(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 me)){const a=new me(e,t,n);return e&&aE(e,t,a),a}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 nE,this._readyQ=Pr(this,xc,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=Mr},this._closeQ=Pr(this,iE,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=Mr},this._doStart=null,this._root=new ls(this,sE.bind(this),t,!1,0),this._root.once("start",(a,s,o)=>{const r=this.pluginTree.start(null,s,o);this._root.once("loaded",(c,l,m)=>{this.pluginTree.stop(r,m)})}),ls.loadPlugin.call(this,this._root,a=>{Bt("root plugin ready");try{this.emit("preReady"),this._root=null}catch(s){a=a||this._error||s}if(a){if(this._error=a,this._readyQ.length()===0)throw a}else this.booted=!0;this._readyQ.resume()})}function sE(e,t,n){this._doStart=n,t.autostart&&this.start()}XS(me,JS);me.prototype.start=function(){return this.started=!0,B.nextTick(this._doStart),this};me.prototype.override=function(e,t,n){return e};function oE(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new ZS(typeof e);return e}me.prototype[Hn]=!0;me.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};me.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(me.prototype,"then",{get:qc});me.prototype._addPlugin=function(e,t,n){if(e=oE(e),t=t||{},this.booted)throw new eE;const a=this._current[0],s=new ls(this,e,t,n);if(s.once("start",(o,r,c)=>{const l=this.pluginTree.start(a.name,r,c);s.once("loaded",(m,u,d)=>{this.pluginTree.stop(l,d)})}),a.loaded)throw new Error(s.name,a.name);return a.enqueue(s,o=>{o&&(this._error=o)}),s};me.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,a,s){xc.call(this,e,s)}return this};me.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};me.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new zt("close",typeof e)}else t=new Promise(function(n,a){e=function(s){if(s)return a(s);n()}});return this.ready(()=>{this._error=null,this._closeQ.push(e),B.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};me.prototype.ready=function(e){if(e){if(typeof e!="function")throw new zt("ready",typeof e);this._readyQ.push(e),queueMicrotask(this.start.bind(this));return}return new Promise((t,n)=>{this._readyQ.push(s),this.start();const a=this._current[0].server;function s(o,r,c){o?n(o):t(a),B.nextTick(c)}})};me.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};me.prototype.toJSON=function(){return this.pluginTree.toJSON()};function Mr(){}function qc(){if(this.booted){Bt("thenify returning null because we are already booted");return}if(this[Ma]){this[Ma]=!1;return}return Bt("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[Ma]=!0,e(this._server)),t)}function xc(e,t){const n=this._server,a=this._error;let s;if(this._error=null,e.length===0)this._error=a,s=e(),s&&!s[Hn]&&typeof s.then=="function"?s.then(()=>B.nextTick(t),o=>B.nextTick(t,o)):B.nextTick(t);else if(e.length===1)s=e(a),s&&!s[Hn]&&typeof s.then=="function"?s.then(()=>B.nextTick(t),o=>B.nextTick(t,o)):B.nextTick(t);else if(this._timeout===0){const o=r=>{this._error=r,t(this._error)};e.length===2?e(a,o):e(a,n,o)}else rE.call(this,e,a,n,t)}function rE(e,t,n,a){const s=e.name;Bt("setting up ready timeout",s,this._timeout);let o=setTimeout(()=>{Bt("timed out",s),o=null;const c=new tE(s);c.fn=e,this._error=c,a(c)},this._timeout);e.length===2?e(t,r.bind(this)):e(t,n,r.bind(this));function r(c){o&&(clearTimeout(o),this._error=c,a(this._error))}}function iE(e,t){const n=this._server,a=e[this._isOnCloseHandlerKey];if(e.length===0||e.length===1){let s;a?s=e(n):s=e(this._error),s&&typeof s.then=="function"?(Bt("resolving close/onClose promise"),s.then(()=>B.nextTick(t),o=>B.nextTick(t,o))):B.nextTick(t)}else e.length===2?e(a?n:this._error,t):a?e(n,t):e(this._error,n,t)}function cE(e,t){return n.bind(t);function n(a,s){let o;e.length===0?(o=e(),o&&o.then?o.then(function(){B.nextTick(s)},s):B.nextTick(s)):e.length===1?(o=e(this),o&&o.then?o.then(function(){B.nextTick(s)},s):B.nextTick(s)):e(this,s)}}function Da(e,t){return n.bind(t);function n(a,s){let o;e?e.length===0?(o=e(),o&&o.then?o.then(function(){B.nextTick(s,a)},s):B.nextTick(s,a)):e.length===1?(o=e(a),o&&o.then?o.then(function(){B.nextTick(s)},s):B.nextTick(s)):e.length===2?e(a,s):e(a,this,s):B.nextTick(s)}}Ps.exports=me;Ps.exports.express=function(e){return me(e,{expose:{use:"load"}})};var lE=Ps.exports;const mE=Bh(lE);(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(a){const s=n?window.performance.now():new Date().getTime(),o=Math.max(0,16-(s-t)),r=window.setTimeout(function(){a(s+o)},o);return t=s+o,r},window.cancelAnimationFrame=clearTimeout}})();function uE(e,t=!0,n=!0,a={friendsTab:"enabled"}){const s=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",o=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",r=mE(Object.create({}),{autostart:!1});return r.use(Th,{hideFriends:a.hideFriends,skipOnboarding:a.skipOnboarding,friendsTab:a.friendsTab,theme:a.theme,themeMode:a.themeMode}),r.use(ih,{onDeepLinkHandled:a==null?void 0:a.onDeepLinkHandled}),r.use(uh,{videoPlayerController:a==null?void 0:a.videoPlayerController}),r.use(ph,{onContentActivate:a==null?void 0:a.onContentActivate,withAd:a==null?void 0:a.withAd,withAdNotification:a==null?void 0:a.withAdNotification}),r.use(Ok,{sdkKey:e,host:s,analyticsHost:o,version:a==null?void 0:a.version}),r.use(Lk),r.use(mh),r.use(vh),r.use(Zk),r.use(Fh),r.after((c,l,m)=>{if(c)throw c;l.ready(),m()}),n&&r.after(async(c,l,m)=>{if(c)throw c;await l.sdk.initializeApp(),m()}),r.onClose(()=>{console.log("close")}),r}const dE=({sdkKey:e,plugins:t,production:n,autoEnable:a,onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r,hideFriends:c,skipOnboarding:l,withAdNotification:m,withAd:u,friendsTab:d})=>{const[y,T]=js.useState(null);return js.useEffect(()=>{let f=!1;if(!e)return console.error("streamlayer sdk key should be provided"),T(h=>(h!==null&&typeof h.disableApp=="function"&&h.disableApp(),null)),()=>{f=!0};const g=uE(e,n,a,{version:"1.13.1",onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r,skipOnboarding:l,withAdNotification:m,withAd:u,hideFriends:c,friendsTab:d});if(t)for(const h of t)g.use(h);return g.ready().then(h=>{f||(T(h.sdk),typeof window<"u")}).catch(h=>console.log(h)),()=>{f=!0,g.close(function(h){if(h)throw h})}},[e,n]),y};exports.AutoPlayVideo=Yn;exports.CloseTimerAuto=di;exports.ConnectError=j;exports.CtaIconMode=ci;exports.InvitationFrom=Dn;exports.NotificationEnabled=Pn;exports.NotificationPromotionImagePosition=ri;exports.NotificationPromotionMode=oi;exports.NotificationSponsorLogoMode=ii;exports.PickHistoryStatus=Ot;exports.PromotionButtonType=mi;exports.PromotionLogoMode=ui;exports.PromotionType=oe;exports.QuestionImages=rt;exports.QuestionStatus=te;exports.QuestionType=M;exports.SdkOverlayType=$;exports.createContextKey=Ya;exports.global=ja;exports.pino_1=Vr;exports.useStreamLayerApp=dE;
|
|
@@ -18353,7 +18353,7 @@ const fE = ({
|
|
|
18353
18353
|
f = !0;
|
|
18354
18354
|
};
|
|
18355
18355
|
const g = pE(e, n, a, {
|
|
18356
|
-
version: "1.13.
|
|
18356
|
+
version: "1.13.1",
|
|
18357
18357
|
onDeepLinkHandled: s,
|
|
18358
18358
|
videoPlayerController: o,
|
|
18359
18359
|
onContentActivate: r,
|
package/lib/dist/cjs/masters.js
CHANGED
|
@@ -90,4 +90,4 @@ Error generating stack: `+s.message+`
|
|
|
90
90
|
`),o=`
|
|
91
91
|
`+n+(s.length?r("│"):" ")+" ";return n+i.join(o)+`
|
|
92
92
|
`+s.map(function(l,c){var d=c===s.length-1,p=l.nodes&&l.nodes.length,f=n+(d?" ":r("│"))+" ";return n+r(d?"└":"├")+r("─")+r(p?"┬":"─")+" "+e(l,f,a).slice(n.length+2)}).join("")};const XB=JB,mf=Symbol("avvio.TimeTree.untrackNode"),Rc=Symbol("avvio.TimeTree.trackNode"),pf=Symbol("avvio.TimeTree.getParent"),ff=Symbol("avvio.TimeTree.getNode"),hf=Symbol("avvio.TimeTree.addNode");let eH=class{constructor(){this.root=null,this.tableId=new Map,this.tableLabel=new Map}[Rc](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])}[mf](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)}[pf](e){if(e===null)return this.root;const t=this.tableLabel.get(e);return t.id?t:t[t.length-1]}[ff](e){return this.tableId.get(e)}[hf](e,t,n){if(e===null)return this.root={id:"root",label:t,start:n,nodes:[]},this[Rc](this.root),this.root.id;const a=this[pf](e),r=`${t}-${Math.random()}`,s={id:r,parent:e,start:n,label:t,nodes:[]};return a.nodes.push(s),this[Rc](s),r}start(e,t,n=Date.now()){return this[hf](e,t,n)}stop(e,t=Date.now()){const n=this[ff](e);n&&(n.stop=t,n.diff=n.stop-n.start||0,this[mf](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(a=>e(a))),n),t=e(this.toJSON());return XB(t)}};var tH=eH,r0={exports:{}},T2={exports:{}},xc,gf;function nH(){if(gf)return xc;gf=1;var e=1e3,t=e*60,n=t*60,a=n*24,r=a*7,s=a*365.25;xc=function(d,p){p=p||{};var f=typeof d;if(f==="string"&&d.length>0)return i(d);if(f==="number"&&isFinite(d))return p.long?l(d):o(d);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(d))};function i(d){if(d=String(d),!(d.length>100)){var p=/^(-?(?:\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(p){var f=parseFloat(p[1]),y=(p[2]||"ms").toLowerCase();switch(y){case"years":case"year":case"yrs":case"yr":case"y":return f*s;case"weeks":case"week":case"w":return f*r;case"days":case"day":case"d":return f*a;case"hours":case"hour":case"hrs":case"hr":case"h":return f*n;case"minutes":case"minute":case"mins":case"min":case"m":return f*t;case"seconds":case"second":case"secs":case"sec":case"s":return f*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return f;default:return}}}}function o(d){var p=Math.abs(d);return p>=a?Math.round(d/a)+"d":p>=n?Math.round(d/n)+"h":p>=t?Math.round(d/t)+"m":p>=e?Math.round(d/e)+"s":d+"ms"}function l(d){var p=Math.abs(d);return p>=a?c(d,p,a,"day"):p>=n?c(d,p,n,"hour"):p>=t?c(d,p,t,"minute"):p>=e?c(d,p,e,"second"):d+" ms"}function c(d,p,f,y){var T=p>=f*1.5;return Math.round(d/f)+" "+y+(T?"s":"")}return xc}function aH(e){n.debug=n,n.default=n,n.coerce=l,n.disable=s,n.enable=r,n.enabled=i,n.humanize=nH(),n.destroy=c,Object.keys(e).forEach(d=>{n[d]=e[d]}),n.names=[],n.skips=[],n.formatters={};function t(d){let p=0;for(let f=0;f<d.length;f++)p=(p<<5)-p+d.charCodeAt(f),p|=0;return n.colors[Math.abs(p)%n.colors.length]}n.selectColor=t;function n(d){let p,f=null,y,T;function v(...S){if(!v.enabled)return;const h=v,g=Number(new Date),k=g-(p||g);h.diff=k,h.prev=p,h.curr=g,p=g,S[0]=n.coerce(S[0]),typeof S[0]!="string"&&S.unshift("%O");let E=0;S[0]=S[0].replace(/%([a-zA-Z%])/g,(w,O)=>{if(w==="%%")return"%";E++;const N=n.formatters[O];if(typeof N=="function"){const P=S[E];w=N.call(h,P),S.splice(E,1),E--}return w}),n.formatArgs.call(h,S),(h.log||n.log).apply(h,S)}return v.namespace=d,v.useColors=n.useColors(),v.color=n.selectColor(d),v.extend=a,v.destroy=n.destroy,Object.defineProperty(v,"enabled",{enumerable:!0,configurable:!1,get:()=>f!==null?f:(y!==n.namespaces&&(y=n.namespaces,T=n.enabled(d)),T),set:S=>{f=S}}),typeof n.init=="function"&&n.init(v),v}function a(d,p){const f=n(this.namespace+(typeof p>"u"?":":p)+d);return f.log=this.log,f}function r(d){n.save(d),n.namespaces=d,n.names=[],n.skips=[];let p;const f=(typeof d=="string"?d:"").split(/[\s,]+/),y=f.length;for(p=0;p<y;p++)f[p]&&(d=f[p].replace(/\*/g,".*?"),d[0]==="-"?n.skips.push(new RegExp("^"+d.slice(1)+"$")):n.names.push(new RegExp("^"+d+"$")))}function s(){const d=[...n.names.map(o),...n.skips.map(o).map(p=>"-"+p)].join(",");return n.enable(""),d}function i(d){if(d[d.length-1]==="*")return!0;let p,f;for(p=0,f=n.skips.length;p<f;p++)if(n.skips[p].test(d))return!1;for(p=0,f=n.names.length;p<f;p++)if(n.names[p].test(d))return!0;return!1}function o(d){return d.toString().substring(2,d.toString().length-2).replace(/\.\*\?$/,"*")}function l(d){return d instanceof Error?d.stack||d.message:d}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 rH=aH;(function(e,t){t.formatArgs=a,t.save=r,t.load=s,t.useColors=n,t.storage=i(),t.destroy=(()=>{let l=!1;return()=>{l||(l=!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 a(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const c="color: "+this.color;l.splice(1,0,c,"color: inherit");let d=0,p=0;l[0].replace(/%[a-zA-Z%]/g,f=>{f!=="%%"&&(d++,f==="%c"&&(p=d))}),l.splice(p,0,c)}t.log=console.debug||console.log||(()=>{});function r(l){try{l?t.storage.setItem("debug",l):t.storage.removeItem("debug")}catch{}}function s(){let l;try{l=t.storage.getItem("debug")}catch{}return!l&&typeof ae<"u"&&"env"in ae&&(l=ae.env.DEBUG),l}function i(){try{return localStorage}catch{}}e.exports=rH(t);const{formatters:o}=e.exports;o.j=function(l){try{return JSON.stringify(l)}catch(c){return"[UnexpectedJSONParseError]: "+c.message}}})(T2,T2.exports);var Y9=T2.exports;const sH=S9,iH=A9.EventEmitter,oH=c1.inherits,tt=Y9("avvio"),{AVV_ERR_READY_TIMEOUT:lH}=Q9,Pc=Symbol.for("plugin-meta");function cH(e,t){return e[Pc]&&e[Pc].name?e[Pc].name:typeof t<"u"&&typeof t!="function"&&t.name?t.name:e.name?e.name:e.toString().split(`
|
|
93
|
-
`).slice(0,2).map(n=>n.trim()).join(" -- ")}function uH(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function ms(e,t,n,a,r){this.started=!1,this.func=t,this.opts=n,this.onFinish=null,this.parent=e,this.timeout=r===void 0?e._timeout:r,this.name=cH(t,n),this.isAfter=a,this.q=sH(e,dH,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}oH(ms,iH);ms.prototype.exec=function(e,t){const n=this.func;let a=!1;const r=this.name;if(this.parent._error&&!this.isAfter){tt("skipping loading of plugin as parent errored and it is not an after",r),ae.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(l){return tt("override errored",r),t(l)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,tt("exec",r);let s;const i=l=>{if(a){tt("loading complete",r);return}this._error=l,tt(l?"exec errored":"exec completed",r),a=!0,s&&clearTimeout(s),t(l)};this.timeout>0&&(tt("setting up timeout",r,this.timeout),s=setTimeout(function(){tt("timed out",r),s=null;const l=new lH(r);l.fn=n,i(l)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const o=n(this.server,this.opts,i);o&&typeof o.then=="function"&&(tt("exec: resolving promise",r),o.then(()=>ae.nextTick(i),l=>ae.nextTick(i,l)))};ms.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,a)=>{this._error=n,this.q.pause(),n?(tt("rejecting promise",this.name,n),this._promise.reject(n)):(tt("resolving promise",this.name),this._promise.resolve()),this._promise=null,ae.nextTick(a,n)}),this.q.resume()};let t;return this._promise?t=Promise.resolve():(this._promise=uH(),t=this._promise.promise,this.server?e():this.on("start",e)),t};ms.prototype.enqueue=function(e,t){tt("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};ms.prototype.finish=function(e,t){tt("finish",this.name,e);const n=()=>{this.loaded||(tt("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 a=()=>{if(tt("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const r=()=>{tt("wrap"),queueMicrotask(a)};this._promise.resolve(),this._promise.promise.then(r,r),this._promise=null}else n();else tt("delayed",this.name),this.q.drain=()=>{tt("drain",this.name),this.q.drain=mH,queueMicrotask(a)}};queueMicrotask(a),this.q.resume()};function dH(e,t){const n=this;ae.nextTick(s0.bind(n),e,t)}function s0(e,t){if(typeof e.func.then=="function"){e.func.then(a=>{typeof a.default=="function"&&(a=a.default),e.func=a,s0.call(this,e,t)},t);return}const n=this._current[0];this._current.unshift(e),e.exec(n&&n.server||this._server,a=>{e.finish(a,r=>{this._current.shift(),t(r)})})}function mH(){}r0.exports=ms;r0.exports.loadPlugin=s0;var pH=r0.exports;const yf=S9,fH=A9.EventEmitter,hH=c1.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:Mc,AVV_ERR_CALLBACK_NOT_FN:zs,AVV_ERR_PLUGIN_NOT_VALID:gH,AVV_ERR_ROOT_PLG_BOOTED:yH,AVV_ERR_READY_TIMEOUT:TH}=Q9,vH=tH,v2=pH,ss=Y9("avvio"),Nl=Symbol("kAvvio"),Dc=Symbol("kThenifyDoNotWrap");function kH(e,t,n){const a=t.expose||{},r=a.use||"use",s=a.after||"after",i=a.ready||"ready",o=a.onClose||"onClose",l=a.close||"close";if(e[r])throw new Mc(r);if(e[s])throw new Mc(s);if(e[i])throw new Mc(i);e[r]=function(c,d){return n.use(c,d),this},Object.defineProperty(e,"then",{get:K9.bind(n)}),e[Nl]=!0,e[s]=function(c){return typeof c!="function"?n._loadRegistered():(n.after($c(c,this)),this)},e[i]=function(c){if(c&&typeof c!="function")throw new zs(i,typeof c);return n.ready(c?$c(c,this):void 0)},e[o]=function(c){if(typeof c!="function")throw new zs(o,typeof c);return n.onClose(_H(c,this)),this},e[l]=function(c){if(c&&typeof c!="function")throw new zs(l,typeof c);return c?(n.close($c(c,this)),this):n.close()}}function Ke(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 Ke)){const a=new Ke(e,t,n);return e&&kH(e,t,a),a}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 vH,this._readyQ=yf(this,Z9,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=Tf},this._closeQ=yf(this,EH,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=Tf},this._doStart=null,this._root=new v2(this,bH.bind(this),t,!1,0),this._root.once("start",(a,r,s)=>{const i=this.pluginTree.start(null,r,s);this._root.once("loaded",(o,l,c)=>{this.pluginTree.stop(i,c)})}),v2.loadPlugin.call(this,this._root,a=>{ss("root plugin ready");try{this.emit("preReady"),this._root=null}catch(r){a=a||this._error||r}if(a){if(this._error=a,this._readyQ.length()===0)throw a}else this.booted=!0;this._readyQ.resume()})}function bH(e,t,n){this._doStart=n,t.autostart&&this.start()}hH(Ke,fH);Ke.prototype.start=function(){return this.started=!0,ae.nextTick(this._doStart),this};Ke.prototype.override=function(e,t,n){return e};function SH(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new gH(typeof e);return e}Ke.prototype[Nl]=!0;Ke.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};Ke.prototype._loadRegistered=function(){const e=this._current[0];return!this.started&&!this.booted&&ae.nextTick(()=>this._root.q.resume()),e?e.loadedSoFar():Promise.resolve()};Object.defineProperty(Ke.prototype,"then",{get:K9});Ke.prototype._addPlugin=function(e,t,n){if(e=SH(e),t=t||{},this.booted)throw new yH;const a=this._current[0],r=new v2(this,e,t,n);if(r.once("start",(s,i,o)=>{const l=this.pluginTree.start(a.name,i,o);r.once("loaded",(c,d,p)=>{this.pluginTree.stop(l,p)})}),a.loaded)throw new Error(r.name,a.name);return a.enqueue(r,s=>{s&&(this._error=s)}),r};Ke.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,a,r){Z9.call(this,e,r)}return this};Ke.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};Ke.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new zs("close",typeof e)}else t=new Promise(function(n,a){e=function(r){if(r)return a(r);n()}});return this.ready(()=>{this._error=null,this._closeQ.push(e),ae.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};Ke.prototype.ready=function(e){if(e){if(typeof e!="function")throw new zs("ready",typeof e);this._readyQ.push(e),queueMicrotask(this.start.bind(this));return}return new Promise((t,n)=>{this._readyQ.push(r),this.start();const a=this._current[0].server;function r(s,i,o){s?n(s):t(a),ae.nextTick(o)}})};Ke.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};Ke.prototype.toJSON=function(){return this.pluginTree.toJSON()};function Tf(){}function K9(){if(this.booted){ss("thenify returning null because we are already booted");return}if(this[Dc]){this[Dc]=!1;return}return ss("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[Dc]=!0,e(this._server)),t)}function Z9(e,t){const n=this._server,a=this._error;let r;if(this._error=null,e.length===0)this._error=a,r=e(),r&&!r[Nl]&&typeof r.then=="function"?r.then(()=>ae.nextTick(t),s=>ae.nextTick(t,s)):ae.nextTick(t);else if(e.length===1)r=e(a),r&&!r[Nl]&&typeof r.then=="function"?r.then(()=>ae.nextTick(t),s=>ae.nextTick(t,s)):ae.nextTick(t);else if(this._timeout===0){const s=i=>{this._error=i,t(this._error)};e.length===2?e(a,s):e(a,n,s)}else CH.call(this,e,a,n,t)}function CH(e,t,n,a){const r=e.name;ss("setting up ready timeout",r,this._timeout);let s=setTimeout(()=>{ss("timed out",r),s=null;const o=new TH(r);o.fn=e,this._error=o,a(o)},this._timeout);e.length===2?e(t,i.bind(this)):e(t,n,i.bind(this));function i(o){s&&(clearTimeout(s),this._error=o,a(this._error))}}function EH(e,t){const n=this._server,a=e[this._isOnCloseHandlerKey];if(e.length===0||e.length===1){let r;a?r=e(n):r=e(this._error),r&&typeof r.then=="function"?(ss("resolving close/onClose promise"),r.then(()=>ae.nextTick(t),s=>ae.nextTick(t,s))):ae.nextTick(t)}else e.length===2?e(a?n:this._error,t):a?e(n,t):e(this._error,n,t)}function _H(e,t){return n.bind(t);function n(a,r){let s;e.length===0?(s=e(),s&&s.then?s.then(function(){ae.nextTick(r)},r):ae.nextTick(r)):e.length===1?(s=e(this),s&&s.then?s.then(function(){ae.nextTick(r)},r):ae.nextTick(r)):e(this,r)}}function $c(e,t){return n.bind(t);function n(a,r){let s;e?e.length===0?(s=e(),s&&s.then?s.then(function(){ae.nextTick(r,a)},r):ae.nextTick(r,a)):e.length===1?(s=e(a),s&&s.then?s.then(function(){ae.nextTick(r)},r):ae.nextTick(r)):e.length===2?e(a,r):e(a,this,r):ae.nextTick(r)}}Wd.exports=Ke;Wd.exports.express=function(e){return Ke(e,{expose:{use:"load"}})};var wH=Wd.exports;const IH=tU(wH);(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(a){const r=n?window.performance.now():new Date().getTime(),s=Math.max(0,16-(r-t)),i=window.setTimeout(function(){a(r+s)},s);return t=r+s,i},window.cancelAnimationFrame=clearTimeout}})();function OH(e,t=!0,n=!0,a={friendsTab:"enabled"}){const r=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",s=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",i=IH(Object.create({}),{autostart:!1});return i.use(AV,{hideFriends:a.hideFriends,skipOnboarding:a.skipOnboarding,friendsTab:a.friendsTab,theme:a.theme,themeMode:a.themeMode}),i.use(EV,{onDeepLinkHandled:a==null?void 0:a.onDeepLinkHandled}),i.use(OV,{videoPlayerController:a==null?void 0:a.videoPlayerController}),i.use(LV,{onContentActivate:a==null?void 0:a.onContentActivate,withAd:a==null?void 0:a.withAd,withAdNotification:a==null?void 0:a.withAdNotification}),i.use(Hj,{sdkKey:e,host:r,analyticsHost:s,version:a==null?void 0:a.version}),i.use(Qj),i.use(IV),i.use(qV),i.use(gV),i.use(eU),i.after((o,l,c)=>{if(o)throw o;l.ready(),c()}),n&&i.after(async(o,l,c)=>{if(o)throw o;await l.sdk.initializeApp(),c()}),i.onClose(()=>{console.log("close")}),i}const NH=({sdkKey:e,plugins:t,production:n,autoEnable:a,onDeepLinkHandled:r,videoPlayerController:s,onContentActivate:i,hideFriends:o,skipOnboarding:l,withAdNotification:c,withAd:d,friendsTab:p})=>{const[f,y]=I.useState(null);return I.useEffect(()=>{let T=!1;if(!e)return console.error("streamlayer sdk key should be provided"),y(S=>(S!==null&&typeof S.disableApp=="function"&&S.disableApp(),null)),()=>{T=!0};const v=OH(e,n,a,{version:"1.13.0",onDeepLinkHandled:r,videoPlayerController:s,onContentActivate:i,skipOnboarding:l,withAdNotification:c,withAd:d,hideFriends:o,friendsTab:p});if(t)for(const S of t)v.use(S);return v.ready().then(S=>{T||(y(S.sdk),typeof window<"u")}).catch(S=>console.log(S)),()=>{T=!0,v.close(function(S){if(S)throw S})}},[e,n]),f},J9=({event:e})=>{const t=ps(),n=AH();return I.useEffect(()=>(t&&(e&&(t.createEventSession(e),n&&(n.current=e)),!e&&(n!=null&&n.current)&&(t.createEventSession(""),n.current="")),()=>{t&&t.disableApp()}),[e,n,t]),null};var X9=(e=>(e[e.UNSET=0]="UNSET",e[e.CONNECTED=1]="CONNECTED",e[e.READY=2]="READY",e))(X9||{});const LH={status:0,sdk:null},f1=I.createContext(LH),e7=({sdkKey:e,theme:t,themeMode:n,plugins:a,children:r,event:s,production:i=!0,autoEnable:o=!0,withAdNotification:l,withAd:c=!0,hideFriends:d,skipOnboarding:p,friendsTab:f="enabled",onDeepLinkHandled:y,videoPlayerController:T,onContentActivate:v})=>{const S=NH({sdkKey:e,plugins:a,production:i,autoEnable:o,onDeepLinkHandled:y,videoPlayerController:T,onContentActivate:v,hideFriends:d,skipOnboarding:p,withAdNotification:l,withAd:c,friendsTab:f}),h=I.useRef(""),g=I.useMemo(()=>S?{sdk:S,status:2,event:h}:{status:1,sdk:null,event:h},[S]);return I.useEffect(()=>{S&&(S.options.setKey("friendsTab",f),S.options.setKey("theme",t),S.options.setKey("themeMode",n))},[S,f,t,n]),I.useEffect(()=>()=>{y&&(S==null||S.removeDeepLinkHandler(y)),T&&(S==null||S.removeVideoPlayerController(T))},[S]),I.useEffect(()=>{localStorage.getItem("SL_DEBUG")&&console.log("StreamLayerProvider mounted with props:",{sdkKey:!!e,onDeepLinkHandled:!!y,videoPlayerController:!!T})},[e,y,T]),u.jsxs(f1.Provider,{value:g,children:[s!==void 0&&u.jsx(J9,{event:s}),r]})},ps=()=>{const{sdk:e}=I.useContext(f1);return e},AH=()=>{const{event:e}=I.useContext(f1);return e},RH=()=>{const e=ps();return e?u.jsx(w4,{sdk:e}):null},xH=({close:e,onEvent:t})=>{const n=ps();return n?u.jsx(_4,{sdk:n,onEvent:t,close:e}):null},PH=({sdkKey:e,plugins:t,children:n,event:a,onDeepLinkHandled:r,videoPlayerController:s,production:i=!0})=>u.jsxs(e7,{sdkKey:e,plugins:t,production:i,autoEnable:!0,onDeepLinkHandled:r,videoPlayerController:s,friendsTab:"disabled",skipOnboarding:!0,hideFriends:!0,children:[u.jsx(J9,{event:a}),n]}),MH=({betPack:e})=>{const{sdk:t,status:n}=I.useContext(f1);return n===X9.UNSET?(console.error("Wrap app in `StreamLayerProvider`"),null):t?u.jsx("div",{className:"StreamLayerSDK",children:u.jsx(Vd,{style:{height:"100%"},children:u.jsx(yP,{sdk:t,betPack:e})})}):null};class DH extends I.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:u.jsx(MH,{...this.props})}}const $H=({token:e,schema:t})=>{const n=ps();return I.useEffect(()=>{e&&t&&n&&n.authorizationBypass(t,e),n&&(n.withAuth=!0)},[e,t,n]),null},t7=({event:e,sdkKey:t,token:n,deviceId:a,production:r=!1,theme:s,themeMode:i="light",children:o})=>{const[l,c]=I.useState(!1);return I.useEffect(()=>{n&&(new q5().setToken(n),c(!0))},[n]),I.useEffect(()=>{a&&localStorage.setItem("sl-device-id",a)},[a]),l?u.jsx(e7,{sdkKey:t,event:e,production:r,theme:s,themeMode:i,skipOnboarding:!0,autoEnable:!0,children:u.jsx("div",{className:"StreamLayerSDK",children:u.jsx(Vd,{children:o})})}):null},FH=({onEvent:e,close:t,...n})=>u.jsx(t7,{...n,children:u.jsx(xH,{close:t,onEvent:e})}),jH=({production:e})=>{const[t,n]=I.useState();return I.useEffect(()=>{const{hostname:a,search:r}=window.location,s=new URLSearchParams(r);n({sdkKey:s.get("_slrk")||"",event:s.get("_slre")||"",token:s.get("_slrt")||"",deviceId:s.get("_slrd")||"",theme:s.get("theme")||"",themeMode:s.get("themeMode")==="dark"?"dark":"light",production:e??!(a.includes("next.")||a==="localhost")})},[e]),t?u.jsx(t7,{...t,children:u.jsx(RH,{})}):null},VH=()=>{const e=ps();return e?u.jsx("div",{className:"StreamLayerSDK",children:u.jsx(Vd,{children:u.jsx(IP,{sdk:e})})}):null};exports.A=nA;exports.A$1=nt;exports.BetPack=FH;exports.BetPackStandalone=jH;exports.C=RS;exports.I=$d;exports.InfiniteScroll=t2;exports.InvitationFrom=Qs;exports.M=B5;exports.MastersStreamLayerProvider=PH;exports.MastersStreamLayerSDKReact=DH;exports.S=PS;exports.StreamLayerLogin=$H;exports.StreamLayerSDKPoints=VH;exports.T=U5;exports.Z1=X;exports.cx_default=ht;exports.d=MS;exports.g=T6;exports.k=F5;exports.l=LS;exports.m=NS;exports.n=j2;exports.p=NP;exports.s=M5;exports.styled_default=b;exports.useStore=he;exports.useStreamLayer=ps;exports.useTransition=K7;exports.z=j5;
|
|
93
|
+
`).slice(0,2).map(n=>n.trim()).join(" -- ")}function uH(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function ms(e,t,n,a,r){this.started=!1,this.func=t,this.opts=n,this.onFinish=null,this.parent=e,this.timeout=r===void 0?e._timeout:r,this.name=cH(t,n),this.isAfter=a,this.q=sH(e,dH,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}oH(ms,iH);ms.prototype.exec=function(e,t){const n=this.func;let a=!1;const r=this.name;if(this.parent._error&&!this.isAfter){tt("skipping loading of plugin as parent errored and it is not an after",r),ae.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(l){return tt("override errored",r),t(l)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,tt("exec",r);let s;const i=l=>{if(a){tt("loading complete",r);return}this._error=l,tt(l?"exec errored":"exec completed",r),a=!0,s&&clearTimeout(s),t(l)};this.timeout>0&&(tt("setting up timeout",r,this.timeout),s=setTimeout(function(){tt("timed out",r),s=null;const l=new lH(r);l.fn=n,i(l)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const o=n(this.server,this.opts,i);o&&typeof o.then=="function"&&(tt("exec: resolving promise",r),o.then(()=>ae.nextTick(i),l=>ae.nextTick(i,l)))};ms.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,a)=>{this._error=n,this.q.pause(),n?(tt("rejecting promise",this.name,n),this._promise.reject(n)):(tt("resolving promise",this.name),this._promise.resolve()),this._promise=null,ae.nextTick(a,n)}),this.q.resume()};let t;return this._promise?t=Promise.resolve():(this._promise=uH(),t=this._promise.promise,this.server?e():this.on("start",e)),t};ms.prototype.enqueue=function(e,t){tt("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};ms.prototype.finish=function(e,t){tt("finish",this.name,e);const n=()=>{this.loaded||(tt("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 a=()=>{if(tt("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const r=()=>{tt("wrap"),queueMicrotask(a)};this._promise.resolve(),this._promise.promise.then(r,r),this._promise=null}else n();else tt("delayed",this.name),this.q.drain=()=>{tt("drain",this.name),this.q.drain=mH,queueMicrotask(a)}};queueMicrotask(a),this.q.resume()};function dH(e,t){const n=this;ae.nextTick(s0.bind(n),e,t)}function s0(e,t){if(typeof e.func.then=="function"){e.func.then(a=>{typeof a.default=="function"&&(a=a.default),e.func=a,s0.call(this,e,t)},t);return}const n=this._current[0];this._current.unshift(e),e.exec(n&&n.server||this._server,a=>{e.finish(a,r=>{this._current.shift(),t(r)})})}function mH(){}r0.exports=ms;r0.exports.loadPlugin=s0;var pH=r0.exports;const yf=S9,fH=A9.EventEmitter,hH=c1.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:Mc,AVV_ERR_CALLBACK_NOT_FN:zs,AVV_ERR_PLUGIN_NOT_VALID:gH,AVV_ERR_ROOT_PLG_BOOTED:yH,AVV_ERR_READY_TIMEOUT:TH}=Q9,vH=tH,v2=pH,ss=Y9("avvio"),Nl=Symbol("kAvvio"),Dc=Symbol("kThenifyDoNotWrap");function kH(e,t,n){const a=t.expose||{},r=a.use||"use",s=a.after||"after",i=a.ready||"ready",o=a.onClose||"onClose",l=a.close||"close";if(e[r])throw new Mc(r);if(e[s])throw new Mc(s);if(e[i])throw new Mc(i);e[r]=function(c,d){return n.use(c,d),this},Object.defineProperty(e,"then",{get:K9.bind(n)}),e[Nl]=!0,e[s]=function(c){return typeof c!="function"?n._loadRegistered():(n.after($c(c,this)),this)},e[i]=function(c){if(c&&typeof c!="function")throw new zs(i,typeof c);return n.ready(c?$c(c,this):void 0)},e[o]=function(c){if(typeof c!="function")throw new zs(o,typeof c);return n.onClose(_H(c,this)),this},e[l]=function(c){if(c&&typeof c!="function")throw new zs(l,typeof c);return c?(n.close($c(c,this)),this):n.close()}}function Ke(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 Ke)){const a=new Ke(e,t,n);return e&&kH(e,t,a),a}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 vH,this._readyQ=yf(this,Z9,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=Tf},this._closeQ=yf(this,EH,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=Tf},this._doStart=null,this._root=new v2(this,bH.bind(this),t,!1,0),this._root.once("start",(a,r,s)=>{const i=this.pluginTree.start(null,r,s);this._root.once("loaded",(o,l,c)=>{this.pluginTree.stop(i,c)})}),v2.loadPlugin.call(this,this._root,a=>{ss("root plugin ready");try{this.emit("preReady"),this._root=null}catch(r){a=a||this._error||r}if(a){if(this._error=a,this._readyQ.length()===0)throw a}else this.booted=!0;this._readyQ.resume()})}function bH(e,t,n){this._doStart=n,t.autostart&&this.start()}hH(Ke,fH);Ke.prototype.start=function(){return this.started=!0,ae.nextTick(this._doStart),this};Ke.prototype.override=function(e,t,n){return e};function SH(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new gH(typeof e);return e}Ke.prototype[Nl]=!0;Ke.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};Ke.prototype._loadRegistered=function(){const e=this._current[0];return!this.started&&!this.booted&&ae.nextTick(()=>this._root.q.resume()),e?e.loadedSoFar():Promise.resolve()};Object.defineProperty(Ke.prototype,"then",{get:K9});Ke.prototype._addPlugin=function(e,t,n){if(e=SH(e),t=t||{},this.booted)throw new yH;const a=this._current[0],r=new v2(this,e,t,n);if(r.once("start",(s,i,o)=>{const l=this.pluginTree.start(a.name,i,o);r.once("loaded",(c,d,p)=>{this.pluginTree.stop(l,p)})}),a.loaded)throw new Error(r.name,a.name);return a.enqueue(r,s=>{s&&(this._error=s)}),r};Ke.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,a,r){Z9.call(this,e,r)}return this};Ke.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};Ke.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new zs("close",typeof e)}else t=new Promise(function(n,a){e=function(r){if(r)return a(r);n()}});return this.ready(()=>{this._error=null,this._closeQ.push(e),ae.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};Ke.prototype.ready=function(e){if(e){if(typeof e!="function")throw new zs("ready",typeof e);this._readyQ.push(e),queueMicrotask(this.start.bind(this));return}return new Promise((t,n)=>{this._readyQ.push(r),this.start();const a=this._current[0].server;function r(s,i,o){s?n(s):t(a),ae.nextTick(o)}})};Ke.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};Ke.prototype.toJSON=function(){return this.pluginTree.toJSON()};function Tf(){}function K9(){if(this.booted){ss("thenify returning null because we are already booted");return}if(this[Dc]){this[Dc]=!1;return}return ss("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[Dc]=!0,e(this._server)),t)}function Z9(e,t){const n=this._server,a=this._error;let r;if(this._error=null,e.length===0)this._error=a,r=e(),r&&!r[Nl]&&typeof r.then=="function"?r.then(()=>ae.nextTick(t),s=>ae.nextTick(t,s)):ae.nextTick(t);else if(e.length===1)r=e(a),r&&!r[Nl]&&typeof r.then=="function"?r.then(()=>ae.nextTick(t),s=>ae.nextTick(t,s)):ae.nextTick(t);else if(this._timeout===0){const s=i=>{this._error=i,t(this._error)};e.length===2?e(a,s):e(a,n,s)}else CH.call(this,e,a,n,t)}function CH(e,t,n,a){const r=e.name;ss("setting up ready timeout",r,this._timeout);let s=setTimeout(()=>{ss("timed out",r),s=null;const o=new TH(r);o.fn=e,this._error=o,a(o)},this._timeout);e.length===2?e(t,i.bind(this)):e(t,n,i.bind(this));function i(o){s&&(clearTimeout(s),this._error=o,a(this._error))}}function EH(e,t){const n=this._server,a=e[this._isOnCloseHandlerKey];if(e.length===0||e.length===1){let r;a?r=e(n):r=e(this._error),r&&typeof r.then=="function"?(ss("resolving close/onClose promise"),r.then(()=>ae.nextTick(t),s=>ae.nextTick(t,s))):ae.nextTick(t)}else e.length===2?e(a?n:this._error,t):a?e(n,t):e(this._error,n,t)}function _H(e,t){return n.bind(t);function n(a,r){let s;e.length===0?(s=e(),s&&s.then?s.then(function(){ae.nextTick(r)},r):ae.nextTick(r)):e.length===1?(s=e(this),s&&s.then?s.then(function(){ae.nextTick(r)},r):ae.nextTick(r)):e(this,r)}}function $c(e,t){return n.bind(t);function n(a,r){let s;e?e.length===0?(s=e(),s&&s.then?s.then(function(){ae.nextTick(r,a)},r):ae.nextTick(r,a)):e.length===1?(s=e(a),s&&s.then?s.then(function(){ae.nextTick(r)},r):ae.nextTick(r)):e.length===2?e(a,r):e(a,this,r):ae.nextTick(r)}}Wd.exports=Ke;Wd.exports.express=function(e){return Ke(e,{expose:{use:"load"}})};var wH=Wd.exports;const IH=tU(wH);(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(a){const r=n?window.performance.now():new Date().getTime(),s=Math.max(0,16-(r-t)),i=window.setTimeout(function(){a(r+s)},s);return t=r+s,i},window.cancelAnimationFrame=clearTimeout}})();function OH(e,t=!0,n=!0,a={friendsTab:"enabled"}){const r=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",s=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",i=IH(Object.create({}),{autostart:!1});return i.use(AV,{hideFriends:a.hideFriends,skipOnboarding:a.skipOnboarding,friendsTab:a.friendsTab,theme:a.theme,themeMode:a.themeMode}),i.use(EV,{onDeepLinkHandled:a==null?void 0:a.onDeepLinkHandled}),i.use(OV,{videoPlayerController:a==null?void 0:a.videoPlayerController}),i.use(LV,{onContentActivate:a==null?void 0:a.onContentActivate,withAd:a==null?void 0:a.withAd,withAdNotification:a==null?void 0:a.withAdNotification}),i.use(Hj,{sdkKey:e,host:r,analyticsHost:s,version:a==null?void 0:a.version}),i.use(Qj),i.use(IV),i.use(qV),i.use(gV),i.use(eU),i.after((o,l,c)=>{if(o)throw o;l.ready(),c()}),n&&i.after(async(o,l,c)=>{if(o)throw o;await l.sdk.initializeApp(),c()}),i.onClose(()=>{console.log("close")}),i}const NH=({sdkKey:e,plugins:t,production:n,autoEnable:a,onDeepLinkHandled:r,videoPlayerController:s,onContentActivate:i,hideFriends:o,skipOnboarding:l,withAdNotification:c,withAd:d,friendsTab:p})=>{const[f,y]=I.useState(null);return I.useEffect(()=>{let T=!1;if(!e)return console.error("streamlayer sdk key should be provided"),y(S=>(S!==null&&typeof S.disableApp=="function"&&S.disableApp(),null)),()=>{T=!0};const v=OH(e,n,a,{version:"1.13.1",onDeepLinkHandled:r,videoPlayerController:s,onContentActivate:i,skipOnboarding:l,withAdNotification:c,withAd:d,hideFriends:o,friendsTab:p});if(t)for(const S of t)v.use(S);return v.ready().then(S=>{T||(y(S.sdk),typeof window<"u")}).catch(S=>console.log(S)),()=>{T=!0,v.close(function(S){if(S)throw S})}},[e,n]),f},J9=({event:e})=>{const t=ps(),n=AH();return I.useEffect(()=>(t&&(e&&(t.createEventSession(e),n&&(n.current=e)),!e&&(n!=null&&n.current)&&(t.createEventSession(""),n.current="")),()=>{t&&t.disableApp()}),[e,n,t]),null};var X9=(e=>(e[e.UNSET=0]="UNSET",e[e.CONNECTED=1]="CONNECTED",e[e.READY=2]="READY",e))(X9||{});const LH={status:0,sdk:null},f1=I.createContext(LH),e7=({sdkKey:e,theme:t,themeMode:n,plugins:a,children:r,event:s,production:i=!0,autoEnable:o=!0,withAdNotification:l,withAd:c=!0,hideFriends:d,skipOnboarding:p,friendsTab:f="enabled",onDeepLinkHandled:y,videoPlayerController:T,onContentActivate:v})=>{const S=NH({sdkKey:e,plugins:a,production:i,autoEnable:o,onDeepLinkHandled:y,videoPlayerController:T,onContentActivate:v,hideFriends:d,skipOnboarding:p,withAdNotification:l,withAd:c,friendsTab:f}),h=I.useRef(""),g=I.useMemo(()=>S?{sdk:S,status:2,event:h}:{status:1,sdk:null,event:h},[S]);return I.useEffect(()=>{S&&(S.options.setKey("friendsTab",f),S.options.setKey("theme",t),S.options.setKey("themeMode",n))},[S,f,t,n]),I.useEffect(()=>()=>{y&&(S==null||S.removeDeepLinkHandler(y)),T&&(S==null||S.removeVideoPlayerController(T))},[S]),I.useEffect(()=>{localStorage.getItem("SL_DEBUG")&&console.log("StreamLayerProvider mounted with props:",{sdkKey:!!e,onDeepLinkHandled:!!y,videoPlayerController:!!T})},[e,y,T]),u.jsxs(f1.Provider,{value:g,children:[s!==void 0&&u.jsx(J9,{event:s}),r]})},ps=()=>{const{sdk:e}=I.useContext(f1);return e},AH=()=>{const{event:e}=I.useContext(f1);return e},RH=()=>{const e=ps();return e?u.jsx(w4,{sdk:e}):null},xH=({close:e,onEvent:t})=>{const n=ps();return n?u.jsx(_4,{sdk:n,onEvent:t,close:e}):null},PH=({sdkKey:e,plugins:t,children:n,event:a,onDeepLinkHandled:r,videoPlayerController:s,production:i=!0})=>u.jsxs(e7,{sdkKey:e,plugins:t,production:i,autoEnable:!0,onDeepLinkHandled:r,videoPlayerController:s,friendsTab:"disabled",skipOnboarding:!0,hideFriends:!0,children:[u.jsx(J9,{event:a}),n]}),MH=({betPack:e})=>{const{sdk:t,status:n}=I.useContext(f1);return n===X9.UNSET?(console.error("Wrap app in `StreamLayerProvider`"),null):t?u.jsx("div",{className:"StreamLayerSDK",children:u.jsx(Vd,{style:{height:"100%"},children:u.jsx(yP,{sdk:t,betPack:e})})}):null};class DH extends I.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:u.jsx(MH,{...this.props})}}const $H=({token:e,schema:t})=>{const n=ps();return I.useEffect(()=>{e&&t&&n&&n.authorizationBypass(t,e),n&&(n.withAuth=!0)},[e,t,n]),null},t7=({event:e,sdkKey:t,token:n,deviceId:a,production:r=!1,theme:s,themeMode:i="light",children:o})=>{const[l,c]=I.useState(!1);return I.useEffect(()=>{n&&(new q5().setToken(n),c(!0))},[n]),I.useEffect(()=>{a&&localStorage.setItem("sl-device-id",a)},[a]),l?u.jsx(e7,{sdkKey:t,event:e,production:r,theme:s,themeMode:i,skipOnboarding:!0,autoEnable:!0,children:u.jsx("div",{className:"StreamLayerSDK",children:u.jsx(Vd,{children:o})})}):null},FH=({onEvent:e,close:t,...n})=>u.jsx(t7,{...n,children:u.jsx(xH,{close:t,onEvent:e})}),jH=({production:e})=>{const[t,n]=I.useState();return I.useEffect(()=>{const{hostname:a,search:r}=window.location,s=new URLSearchParams(r);n({sdkKey:s.get("_slrk")||"",event:s.get("_slre")||"",token:s.get("_slrt")||"",deviceId:s.get("_slrd")||"",theme:s.get("theme")||"",themeMode:s.get("themeMode")==="dark"?"dark":"light",production:e??!(a.includes("next.")||a==="localhost")})},[e]),t?u.jsx(t7,{...t,children:u.jsx(RH,{})}):null},VH=()=>{const e=ps();return e?u.jsx("div",{className:"StreamLayerSDK",children:u.jsx(Vd,{children:u.jsx(IP,{sdk:e})})}):null};exports.A=nA;exports.A$1=nt;exports.BetPack=FH;exports.BetPackStandalone=jH;exports.C=RS;exports.I=$d;exports.InfiniteScroll=t2;exports.InvitationFrom=Qs;exports.M=B5;exports.MastersStreamLayerProvider=PH;exports.MastersStreamLayerSDKReact=DH;exports.S=PS;exports.StreamLayerLogin=$H;exports.StreamLayerSDKPoints=VH;exports.T=U5;exports.Z1=X;exports.cx_default=ht;exports.d=MS;exports.g=T6;exports.k=F5;exports.l=LS;exports.m=NS;exports.n=j2;exports.p=NP;exports.s=M5;exports.styled_default=b;exports.useStore=he;exports.useStreamLayer=ps;exports.useTransition=K7;exports.z=j5;
|
package/lib/dist/es/masters.js
CHANGED
|
@@ -32011,7 +32011,7 @@ const FG = ({
|
|
|
32011
32011
|
T = !0;
|
|
32012
32012
|
};
|
|
32013
32013
|
const v = $G(e, n, a, {
|
|
32014
|
-
version: "1.13.
|
|
32014
|
+
version: "1.13.1",
|
|
32015
32015
|
onDeepLinkHandled: r,
|
|
32016
32016
|
videoPlayerController: i,
|
|
32017
32017
|
onContentActivate: s,
|
|
@@ -18353,7 +18353,7 @@ const fE = ({
|
|
|
18353
18353
|
f = !0;
|
|
18354
18354
|
};
|
|
18355
18355
|
const g = pE(e, n, a, {
|
|
18356
|
-
version: "1.13.
|
|
18356
|
+
version: "1.13.1",
|
|
18357
18357
|
onDeepLinkHandled: s,
|
|
18358
18358
|
videoPlayerController: o,
|
|
18359
18359
|
onContentActivate: r,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamlayer/react",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "StreamLayer, Inc (https://streamlayer.io)",
|
|
6
6
|
"maintainers": [
|
|
@@ -123,18 +123,18 @@
|
|
|
123
123
|
}
|
|
124
124
|
],
|
|
125
125
|
"dependencies": {
|
|
126
|
-
"@streamlayer/feature-gamification": "^1.15.
|
|
127
|
-
"@streamlayer/sdk-web": "^1.9.
|
|
128
|
-
"@streamlayer/sdk-web-analytics": "^1.6.
|
|
129
|
-
"@streamlayer/sdk-web-api": "^1.7.
|
|
130
|
-
"@streamlayer/sdk-web-core": "^1.11.
|
|
131
|
-
"@streamlayer/sdk-web-features": "^1.0.
|
|
132
|
-
"@streamlayer/sdk-web-interfaces": "^1.4.
|
|
133
|
-
"@streamlayer/sdk-web-logger": "^1.0.
|
|
134
|
-
"@streamlayer/sdk-web-notifications": "^1.3.
|
|
135
|
-
"@streamlayer/sdk-web-storage": "^1.0.
|
|
136
|
-
"@streamlayer/react-polyfills": "^0.1.
|
|
137
|
-
"@streamlayer/sdk-web-types": "^1.10.
|
|
126
|
+
"@streamlayer/feature-gamification": "^1.15.1",
|
|
127
|
+
"@streamlayer/sdk-web": "^1.9.1",
|
|
128
|
+
"@streamlayer/sdk-web-analytics": "^1.6.3",
|
|
129
|
+
"@streamlayer/sdk-web-api": "^1.7.3",
|
|
130
|
+
"@streamlayer/sdk-web-core": "^1.11.1",
|
|
131
|
+
"@streamlayer/sdk-web-features": "^1.0.46",
|
|
132
|
+
"@streamlayer/sdk-web-interfaces": "^1.4.12",
|
|
133
|
+
"@streamlayer/sdk-web-logger": "^1.0.46",
|
|
134
|
+
"@streamlayer/sdk-web-notifications": "^1.3.8",
|
|
135
|
+
"@streamlayer/sdk-web-storage": "^1.0.46",
|
|
136
|
+
"@streamlayer/react-polyfills": "^0.1.6",
|
|
137
|
+
"@streamlayer/sdk-web-types": "^1.10.3"
|
|
138
138
|
},
|
|
139
139
|
"peerDependencies": {
|
|
140
140
|
"@bufbuild/protobuf": "^1.10.0",
|
|
@@ -192,7 +192,7 @@
|
|
|
192
192
|
"size-limit": "^11.1.6",
|
|
193
193
|
"url-loader": "^4.1.1",
|
|
194
194
|
"vite-plugin-dts": "^4.2.3",
|
|
195
|
-
"@streamlayer/react-ui": "^1.19.
|
|
195
|
+
"@streamlayer/react-ui": "^1.19.1"
|
|
196
196
|
},
|
|
197
197
|
"scripts": {
|
|
198
198
|
"size-limit": "size-limit"
|