@streamlayer/react 1.21.1 → 1.21.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/advertisement.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/insight.js +1 -1
- package/lib/cjs/notification.js +1 -1
- package/lib/cjs/pause-ad.js +1 -1
- package/lib/cjs/points.js +1 -1
- package/lib/cjs/provider.js +14 -14
- package/lib/cjs/useStreamLayerApp2.js +1 -1
- package/lib/classic/cjs/advertisement.js +1 -1
- package/lib/classic/cjs/index.js +1 -1
- package/lib/classic/cjs/insight.js +1 -1
- package/lib/classic/cjs/notification.js +1 -1
- package/lib/classic/cjs/pause-ad.js +1 -1
- package/lib/classic/cjs/points.js +1 -1
- package/lib/classic/cjs/provider.js +9 -9
- package/lib/classic/cjs/useStreamLayerApp2.js +1 -1
- package/lib/classic/es/advertisement.js +3 -4
- package/lib/classic/es/index.js +9 -10
- package/lib/classic/es/insight.js +7 -8
- package/lib/classic/es/notification.js +3 -4
- package/lib/classic/es/pause-ad.js +34 -35
- package/lib/classic/es/points.js +3 -4
- package/lib/classic/es/provider.js +2071 -2067
- package/lib/classic/es/useStreamLayerApp2.js +1 -1
- package/lib/dist/cjs/gamification-feature2.js +1 -1
- package/lib/dist/cjs/index.js +1 -1
- package/lib/dist/cjs/masters.js +22 -22
- package/lib/dist/es/gamification-feature2.js +72 -73
- package/lib/dist/es/index.js +6 -7
- package/lib/dist/es/masters.js +3111 -3096
- package/lib/es/advertisement.js +3 -4
- package/lib/es/index.js +9 -10
- package/lib/es/insight.js +7 -8
- package/lib/es/notification.js +3 -4
- package/lib/es/pause-ad.js +34 -35
- package/lib/es/points.js +3 -4
- package/lib/es/provider.js +2040 -2025
- package/lib/es/useStreamLayerApp2.js +1 -1
- package/package.json +14 -15
|
@@ -13,4 +13,4 @@
|
|
|
13
13
|
`),a=`
|
|
14
14
|
`+n+(i.length?o("│"):" ")+" ";return n+c.join(a)+`
|
|
15
15
|
`+i.map(function(s,r){var u=r===i.length-1,V=s.nodes&&s.nodes.length,R=n+(u?" ":o("│"))+" ";return n+o(u?"└":"├")+o("─")+o(V?"┬":"─")+" "+e(s,R,l).slice(n.length+2)}).join("")};const Vb=ub,mi=Symbol("avvio.TimeTree.untrackNode"),Pn=Symbol("avvio.TimeTree.trackNode"),gi=Symbol("avvio.TimeTree.getParent"),hi=Symbol("avvio.TimeTree.getNode"),Wi=Symbol("avvio.TimeTree.addNode");let bb=class{constructor(){this.root=null,this.tableId=new Map,this.tableLabel=new Map}[Pn](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])}[mi](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)}[gi](e){if(e===null)return this.root;const t=this.tableLabel.get(e);return t.id?t:t[t.length-1]}[hi](e){return this.tableId.get(e)}[Wi](e,t,n){if(e===null)return this.root={id:"root",label:t,start:n,nodes:[]},this[Pn](this.root),this.root.id;const l=this[gi](e),o=`${t}-${Math.random()}`,i={id:o,parent:e,start:n,label:t,nodes:[]};return l.nodes.push(i),this[Pn](i),o}start(e,t,n=Date.now()){return this[Wi](e,t,n)}stop(e,t=Date.now()){const n=this[hi](e);n&&(n.stop=t,n.diff=n.stop-n.start||0,this[mi](n))}toJSON(){return Object.assign({},this.root)}prittyPrint(){const e=n=>(n.label=`${n.label} ${n.diff} ms`,n.nodes.length>0&&(n.nodes=n.nodes.map(l=>e(l))),n),t=e(this.toJSON());return Vb(t)}};var Rb=bb,$l={exports:{}},Xl={exports:{}},_n,Zi;function Ab(){if(Zi)return _n;Zi=1;var e=1e3,t=e*60,n=t*60,l=n*24,o=l*7,i=l*365.25;_n=function(u,V){V=V||{};var R=typeof u;if(R==="string"&&u.length>0)return c(u);if(R==="number"&&isFinite(u))return V.long?s(u):a(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function c(u){if(u=String(u),!(u.length>100)){var V=/^(-?(?:\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(V){var R=parseFloat(V[1]),g=(V[2]||"ms").toLowerCase();switch(g){case"years":case"year":case"yrs":case"yr":case"y":return R*i;case"weeks":case"week":case"w":return R*o;case"days":case"day":case"d":return R*l;case"hours":case"hour":case"hrs":case"hr":case"h":return R*n;case"minutes":case"minute":case"mins":case"min":case"m":return R*t;case"seconds":case"second":case"secs":case"sec":case"s":return R*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return R;default:return}}}}function a(u){var V=Math.abs(u);return V>=l?Math.round(u/l)+"d":V>=n?Math.round(u/n)+"h":V>=t?Math.round(u/t)+"m":V>=e?Math.round(u/e)+"s":u+"ms"}function s(u){var V=Math.abs(u);return V>=l?r(u,V,l,"day"):V>=n?r(u,V,n,"hour"):V>=t?r(u,V,t,"minute"):V>=e?r(u,V,e,"second"):u+" ms"}function r(u,V,R,g){var h=V>=R*1.5;return Math.round(u/R)+" "+g+(h?"s":"")}return _n}function mb(e){n.debug=n,n.default=n,n.coerce=s,n.disable=i,n.enable=o,n.enabled=c,n.humanize=Ab(),n.destroy=r,Object.keys(e).forEach(u=>{n[u]=e[u]}),n.names=[],n.skips=[],n.formatters={};function t(u){let V=0;for(let R=0;R<u.length;R++)V=(V<<5)-V+u.charCodeAt(R),V|=0;return n.colors[Math.abs(V)%n.colors.length]}n.selectColor=t;function n(u){let V,R=null,g,h;function X(...p){if(!X.enabled)return;const W=X,A=Number(new Date),F=A-(V||A);W.diff=F,W.prev=V,W.curr=A,V=A,p[0]=n.coerce(p[0]),typeof p[0]!="string"&&p.unshift("%O");let y=0;p[0]=p[0].replace(/%([a-zA-Z%])/g,(N,U)=>{if(N==="%%")return"%";y++;const S=n.formatters[U];if(typeof S=="function"){const M=p[y];N=S.call(W,M),p.splice(y,1),y--}return N}),n.formatArgs.call(W,p),(W.log||n.log).apply(W,p)}return X.namespace=u,X.useColors=n.useColors(),X.color=n.selectColor(u),X.extend=l,X.destroy=n.destroy,Object.defineProperty(X,"enabled",{enumerable:!0,configurable:!1,get:()=>R!==null?R:(g!==n.namespaces&&(g=n.namespaces,h=n.enabled(u)),h),set:p=>{R=p}}),typeof n.init=="function"&&n.init(X),X}function l(u,V){const R=n(this.namespace+(typeof V>"u"?":":V)+u);return R.log=this.log,R}function o(u){n.save(u),n.namespaces=u,n.names=[],n.skips=[];let V;const R=(typeof u=="string"?u:"").split(/[\s,]+/),g=R.length;for(V=0;V<g;V++)R[V]&&(u=R[V].replace(/\*/g,".*?"),u[0]==="-"?n.skips.push(new RegExp("^"+u.slice(1)+"$")):n.names.push(new RegExp("^"+u+"$")))}function i(){const u=[...n.names.map(a),...n.skips.map(a).map(V=>"-"+V)].join(",");return n.enable(""),u}function c(u){if(u[u.length-1]==="*")return!0;let V,R;for(V=0,R=n.skips.length;V<R;V++)if(n.skips[V].test(u))return!1;for(V=0,R=n.names.length;V<R;V++)if(n.names[V].test(u))return!0;return!1}function a(u){return u.toString().substring(2,u.toString().length-2).replace(/\.\*\?$/,"*")}function s(u){return u instanceof Error?u.stack||u.message:u}function r(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}var gb=mb;(function(e,t){t.formatArgs=l,t.save=o,t.load=i,t.useColors=n,t.storage=c(),t.destroy=(()=>{let s=!1;return()=>{s||(s=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function l(s){if(s[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+s[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;s.splice(1,0,r,"color: inherit");let u=0,V=0;s[0].replace(/%[a-zA-Z%]/g,R=>{R!=="%%"&&(u++,R==="%c"&&(V=u))}),s.splice(V,0,r)}t.log=console.debug||console.log||(()=>{});function o(s){try{s?t.storage.setItem("debug",s):t.storage.removeItem("debug")}catch{}}function i(){let s;try{s=t.storage.getItem("debug")}catch{}return!s&&typeof B<"u"&&"env"in B&&(s=B.env.DEBUG),s}function c(){try{return localStorage}catch{}}e.exports=gb(t);const{formatters:a}=e.exports;a.j=function(s){try{return JSON.stringify(s)}catch(r){return"[UnexpectedJSONParseError]: "+r.message}}})(Xl,Xl.exports);var wc=Xl.exports;const hb=mc,Wb=yc.EventEmitter,Zb=Nn.inherits,be=wc("avvio"),{AVV_ERR_READY_TIMEOUT:Eb}=Lc,qn=Symbol.for("plugin-meta");function Gb(e,t){return e[qn]&&e[qn].name?e[qn].name:typeof t<"u"&&typeof t!="function"&&t.name?t.name:e.name?e.name:e.toString().split(`
|
|
16
|
-
`).slice(0,2).map(n=>n.trim()).join(" -- ")}function Xb(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function ft(e,t,n,l,o){this.started=!1,this.func=t,this.opts=n,this.onFinish=null,this.parent=e,this.timeout=o===void 0?e._timeout:o,this.name=Gb(t,n),this.isAfter=l,this.q=hb(e,pb,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}Zb(ft,Wb);ft.prototype.exec=function(e,t){const n=this.func;let l=!1;const o=this.name;if(this.parent._error&&!this.isAfter){be("skipping loading of plugin as parent errored and it is not an after",o),B.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(s){return be("override errored",o),t(s)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,be("exec",o);let i;const c=s=>{if(l){be("loading complete",o);return}this._error=s,be(s?"exec errored":"exec completed",o),l=!0,i&&clearTimeout(i),t(s)};this.timeout>0&&(be("setting up timeout",o,this.timeout),i=setTimeout(function(){be("timed out",o),i=null;const s=new Eb(o);s.fn=n,c(s)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const a=n(this.server,this.opts,c);a&&typeof a.then=="function"&&(be("exec: resolving promise",o),a.then(()=>B.nextTick(c),s=>B.nextTick(c,s)))};ft.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,l)=>{this._error=n,this.q.pause(),n?(be("rejecting promise",this.name,n),this._promise.reject(n)):(be("resolving promise",this.name),this._promise.resolve()),this._promise=null,B.nextTick(l,n)}),this.q.resume()};let t;return this._promise?t=Promise.resolve():(this._promise=Xb(),t=this._promise.promise,this.server?e():this.on("start",e)),t};ft.prototype.enqueue=function(e,t){be("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};ft.prototype.finish=function(e,t){be("finish",this.name,e);const n=()=>{this.loaded||(be("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,t(e))};if(e){this._promise&&(this._promise.reject(e),this._promise=null),n();return}const l=()=>{if(be("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const o=()=>{be("wrap"),queueMicrotask(l)};this._promise.resolve(),this._promise.promise.then(o,o),this._promise=null}else n();else be("delayed",this.name),this.q.drain=()=>{be("drain",this.name),this.q.drain=yb,queueMicrotask(l)}};queueMicrotask(l),this.q.resume()};function pb(e,t){const n=this;B.nextTick(eo.bind(n),e,t)}function eo(e,t){if(typeof e.func.then=="function"){e.func.then(l=>{typeof l.default=="function"&&(l=l.default),e.func=l,eo.call(this,e,t)},t);return}const n=this._current[0];this._current.unshift(e),e.exec(n&&n.server||this._server,l=>{e.finish(l,o=>{this._current.shift(),t(o)})})}function yb(){}$l.exports=ft;$l.exports.loadPlugin=eo;var Fb=$l.exports;const Ei=mc,Sb=yc.EventEmitter,Yb=Nn.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:$n,AVV_ERR_CALLBACK_NOT_FN:zt,AVV_ERR_PLUGIN_NOT_VALID:Nb,AVV_ERR_ROOT_PLG_BOOTED:Ib,AVV_ERR_READY_TIMEOUT:Ub}=Lc,Bb=Rb,pl=Fb,Ut=wc("avvio"),pn=Symbol("kAvvio"),el=Symbol("kThenifyDoNotWrap");function fb(e,t,n){const l=t.expose||{},o=l.use||"use",i=l.after||"after",c=l.ready||"ready",a=l.onClose||"onClose",s=l.close||"close";if(e[o])throw new $n(o);if(e[i])throw new $n(i);if(e[c])throw new $n(c);e[o]=function(r,u){return n.use(r,u),this},Object.defineProperty(e,"then",{get:xc.bind(n)}),e[pn]=!0,e[i]=function(r){return typeof r!="function"?n._loadRegistered():(n.after(tl(r,this)),this)},e[c]=function(r){if(r&&typeof r!="function")throw new zt(c,typeof r);return n.ready(r?tl(r,this):void 0)},e[a]=function(r){if(typeof r!="function")throw new zt(a,typeof r);return n.onClose(vb(r,this)),this},e[s]=function(r){if(r&&typeof r!="function")throw new zt(s,typeof r);return r?(n.close(tl(r,this)),this):n.close()}}function Ve(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 Ve)){const l=new Ve(e,t,n);return e&&fb(e,t,l),l}t.autostart!==!1&&(t.autostart=!0),e=e||this,this._timeout=Number(t.timeout)||0,this._server=e,this._current=[],this._error=null,this._isOnCloseHandlerKey=Symbol("isOnCloseHandler"),this._lastUsed=null,this.setMaxListeners(0),n&&this.once("start",n),this.started=!1,this.booted=!1,this.pluginTree=new Bb,this._readyQ=Ei(this,Mc,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=Gi},this._closeQ=Ei(this,Qb,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=Gi},this._doStart=null,this._root=new pl(this,Cb.bind(this),t,!1,0),this._root.once("start",(l,o,i)=>{const c=this.pluginTree.start(null,o,i);this._root.once("loaded",(a,s,r)=>{this.pluginTree.stop(c,r)})}),pl.loadPlugin.call(this,this._root,l=>{Ut("root plugin ready");try{this.emit("preReady"),this._root=null}catch(o){l=l||this._error||o}if(l){if(this._error=l,this._readyQ.length()===0)throw l}else this.booted=!0;this._readyQ.resume()})}function Cb(e,t,n){this._doStart=n,t.autostart&&this.start()}Yb(Ve,Sb);Ve.prototype.start=function(){return this.started=!0,B.nextTick(this._doStart),this};Ve.prototype.override=function(e,t,n){return e};function Jb(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new Nb(typeof e);return e}Ve.prototype[pn]=!0;Ve.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};Ve.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(Ve.prototype,"then",{get:xc});Ve.prototype._addPlugin=function(e,t,n){if(e=Jb(e),t=t||{},this.booted)throw new Ib;const l=this._current[0],o=new pl(this,e,t,n);if(o.once("start",(i,c,a)=>{const s=this.pluginTree.start(l.name,c,a);o.once("loaded",(r,u,V)=>{this.pluginTree.stop(s,V)})}),l.loaded)throw new Error(o.name,l.name);return l.enqueue(o,i=>{i&&(this._error=i)}),o};Ve.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,l,o){Mc.call(this,e,o)}return this};Ve.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};Ve.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new zt("close",typeof e)}else t=new Promise(function(n,l){e=function(o){if(o)return l(o);n()}});return this.ready(()=>{this._error=null,this._closeQ.push(e),B.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};Ve.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(o),this.start();const l=this._current[0].server;function o(i,c,a){i?n(i):t(l),B.nextTick(a)}})};Ve.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};Ve.prototype.toJSON=function(){return this.pluginTree.toJSON()};function Gi(){}function xc(){if(this.booted){Ut("thenify returning null because we are already booted");return}if(this[el]){this[el]=!1;return}return Ut("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[el]=!0,e(this._server)),t)}function Mc(e,t){const n=this._server,l=this._error;let o;if(this._error=null,e.length===0)this._error=l,o=e(),o&&!o[pn]&&typeof o.then=="function"?o.then(()=>B.nextTick(t),i=>B.nextTick(t,i)):B.nextTick(t);else if(e.length===1)o=e(l),o&&!o[pn]&&typeof o.then=="function"?o.then(()=>B.nextTick(t),i=>B.nextTick(t,i)):B.nextTick(t);else if(this._timeout===0){const i=c=>{this._error=c,t(this._error)};e.length===2?e(l,i):e(l,n,i)}else Tb.call(this,e,l,n,t)}function Tb(e,t,n,l){const o=e.name;Ut("setting up ready timeout",o,this._timeout);let i=setTimeout(()=>{Ut("timed out",o),i=null;const a=new Ub(o);a.fn=e,this._error=a,l(a)},this._timeout);e.length===2?e(t,c.bind(this)):e(t,n,c.bind(this));function c(a){i&&(clearTimeout(i),this._error=a,l(this._error))}}function Qb(e,t){const n=this._server,l=e[this._isOnCloseHandlerKey];if(e.length===0||e.length===1){let o;l?o=e(n):o=e(this._error),o&&typeof o.then=="function"?(Ut("resolving close/onClose promise"),o.then(()=>B.nextTick(t),i=>B.nextTick(t,i))):B.nextTick(t)}else e.length===2?e(l?n:this._error,t):l?e(n,t):e(this._error,n,t)}function vb(e,t){return n.bind(t);function n(l,o){let i;e.length===0?(i=e(),i&&i.then?i.then(function(){B.nextTick(o)},o):B.nextTick(o)):e.length===1?(i=e(this),i&&i.then?i.then(function(){B.nextTick(o)},o):B.nextTick(o)):e(this,o)}}function tl(e,t){return n.bind(t);function n(l,o){let i;e?e.length===0?(i=e(),i&&i.then?i.then(function(){B.nextTick(o,l)},o):B.nextTick(o,l)):e.length===1?(i=e(l),i&&i.then?i.then(function(){B.nextTick(o)},o):B.nextTick(o)):e.length===2?e(l,o):e(l,this,o):B.nextTick(o)}}Ll.exports=Ve;Ll.exports.express=function(e){return Ve(e,{expose:{use:"load"}})};var kb=Ll.exports;const zb=Ru(kb);(function(){if(window.requestAnimationFrame&&window.cancelAnimationFrame)return;const e=["webkit","moz","ms","o"];for(const t of e)window.requestAnimationFrame=window.requestAnimationFrame||window[`${t}RequestAnimationFrame`],window.cancelAnimationFrame=window.cancelAnimationFrame||window[`${t}CancelAnimationFrame`]||window[`${t}CancelRequestAnimationFrame`];if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){let t=0;const n=!!(window.performance&&window.performance.now);window.requestAnimationFrame=function(l){const o=n?window.performance.now():new Date().getTime(),i=Math.max(0,16-(o-t)),c=window.setTimeout(function(){l(o+i)},i);return t=o+i,c},window.cancelAnimationFrame=clearTimeout}})();function Kb(e,t=!0,n=!0,l={friendsTab:"enabled"}){const o=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",i=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",c=zb(Object.create({}),{autostart:!1});return c.use(Md,{hideFriends:l.hideFriends,skipOnboarding:l.skipOnboarding,betPack:l.betPack,friendsTab:l.friendsTab,theme:l.theme,themeMode:l.themeMode}),c.use(vd,{onDeepLinkHandled:l==null?void 0:l.onDeepLinkHandled}),c.use(Ld,{videoPlayerController:l==null?void 0:l.videoPlayerController}),c.use(xd,{onContentActivate:l==null?void 0:l.onContentActivate,withAd:l==null?void 0:l.withAd,withAdNotification:l==null?void 0:l.withAdNotification}),c.use(od,{sdkKey:e,host:o,analyticsHost:i,version:l==null?void 0:l.version,webOS:l==null?void 0:l.webOS}),c.use(rd),c.use(Kd),c.use(nu),c.use(Ud),c.use(bu),c.after((a,s,r)=>{if(a)throw a;s.ready(),r()}),n&&c.after(async(a,s,r)=>{if(a)throw a;await s.sdk.initializeApp(),r()}),c.onClose(()=>{console.log("close StreamLayer instance")}),c}const Lb=({sdkKey:e,plugins:t,production:n,autoEnable:l,onDeepLinkHandled:o,videoPlayerController:i,onContentActivate:c,hideFriends:a,skipOnboarding:s,withAdNotification:r,withAd:u,friendsTab:V,betPack:R,webOS:g})=>{const[h,X]=oo.useState(null);return oo.useEffect(()=>{let p=!1;if(!e)return console.error("streamlayer sdk key should be provided"),X(A=>(A!==null&&typeof A.disableApp=="function"&&A.disableApp(),null)),()=>{p=!0};const W=Kb(e,n,l,{version:"1.21.1",onDeepLinkHandled:o,videoPlayerController:i,onContentActivate:c,skipOnboarding:s,withAdNotification:r,withAd:u,hideFriends:a,friendsTab:V,betPack:R,webOS:g});if(t)for(const A of t)W.use(A);return W.ready().then(A=>{p||(X(A.sdk),typeof window<"u")}).catch(A=>console.log(A)),()=>{p=!0,W.close(function(A){if(A)throw A})}},[e,n]),h};exports.AdUnit=pe;exports.AutoPlayVideo=$s;exports.CloseTimerAuto=_s;exports.CtaIconMode=vs;exports.InvitationFrom=rl;exports.NotificationEnabled=sl;exports.NotificationPromotionImagePosition=Cs;exports.NotificationPromotionMode=Bs;exports.NotificationSponsorLogoMode=Ts;exports.NotificationUseContentMedia=Ds;exports.PickHistoryStatus=Tt;exports.PlayVideoMuted=tr;exports.PromotionButtonType=Ks;exports.PromotionLogoMode=ws;exports.PromotionType=T;exports.QuestionImages=Is;exports.QuestionStatus=ue;exports.QuestionType=f;exports.SdkOverlayType=O;exports.global=dl;exports.useStreamLayerApp=Lb;
|
|
16
|
+
`).slice(0,2).map(n=>n.trim()).join(" -- ")}function Xb(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function ft(e,t,n,l,o){this.started=!1,this.func=t,this.opts=n,this.onFinish=null,this.parent=e,this.timeout=o===void 0?e._timeout:o,this.name=Gb(t,n),this.isAfter=l,this.q=hb(e,pb,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}Zb(ft,Wb);ft.prototype.exec=function(e,t){const n=this.func;let l=!1;const o=this.name;if(this.parent._error&&!this.isAfter){be("skipping loading of plugin as parent errored and it is not an after",o),B.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(s){return be("override errored",o),t(s)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,be("exec",o);let i;const c=s=>{if(l){be("loading complete",o);return}this._error=s,be(s?"exec errored":"exec completed",o),l=!0,i&&clearTimeout(i),t(s)};this.timeout>0&&(be("setting up timeout",o,this.timeout),i=setTimeout(function(){be("timed out",o),i=null;const s=new Eb(o);s.fn=n,c(s)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const a=n(this.server,this.opts,c);a&&typeof a.then=="function"&&(be("exec: resolving promise",o),a.then(()=>B.nextTick(c),s=>B.nextTick(c,s)))};ft.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,l)=>{this._error=n,this.q.pause(),n?(be("rejecting promise",this.name,n),this._promise.reject(n)):(be("resolving promise",this.name),this._promise.resolve()),this._promise=null,B.nextTick(l,n)}),this.q.resume()};let t;return this._promise?t=Promise.resolve():(this._promise=Xb(),t=this._promise.promise,this.server?e():this.on("start",e)),t};ft.prototype.enqueue=function(e,t){be("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};ft.prototype.finish=function(e,t){be("finish",this.name,e);const n=()=>{this.loaded||(be("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,t(e))};if(e){this._promise&&(this._promise.reject(e),this._promise=null),n();return}const l=()=>{if(be("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const o=()=>{be("wrap"),queueMicrotask(l)};this._promise.resolve(),this._promise.promise.then(o,o),this._promise=null}else n();else be("delayed",this.name),this.q.drain=()=>{be("drain",this.name),this.q.drain=yb,queueMicrotask(l)}};queueMicrotask(l),this.q.resume()};function pb(e,t){const n=this;B.nextTick(eo.bind(n),e,t)}function eo(e,t){if(typeof e.func.then=="function"){e.func.then(l=>{typeof l.default=="function"&&(l=l.default),e.func=l,eo.call(this,e,t)},t);return}const n=this._current[0];this._current.unshift(e),e.exec(n&&n.server||this._server,l=>{e.finish(l,o=>{this._current.shift(),t(o)})})}function yb(){}$l.exports=ft;$l.exports.loadPlugin=eo;var Fb=$l.exports;const Ei=mc,Sb=yc.EventEmitter,Yb=Nn.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:$n,AVV_ERR_CALLBACK_NOT_FN:zt,AVV_ERR_PLUGIN_NOT_VALID:Nb,AVV_ERR_ROOT_PLG_BOOTED:Ib,AVV_ERR_READY_TIMEOUT:Ub}=Lc,Bb=Rb,pl=Fb,Ut=wc("avvio"),pn=Symbol("kAvvio"),el=Symbol("kThenifyDoNotWrap");function fb(e,t,n){const l=t.expose||{},o=l.use||"use",i=l.after||"after",c=l.ready||"ready",a=l.onClose||"onClose",s=l.close||"close";if(e[o])throw new $n(o);if(e[i])throw new $n(i);if(e[c])throw new $n(c);e[o]=function(r,u){return n.use(r,u),this},Object.defineProperty(e,"then",{get:xc.bind(n)}),e[pn]=!0,e[i]=function(r){return typeof r!="function"?n._loadRegistered():(n.after(tl(r,this)),this)},e[c]=function(r){if(r&&typeof r!="function")throw new zt(c,typeof r);return n.ready(r?tl(r,this):void 0)},e[a]=function(r){if(typeof r!="function")throw new zt(a,typeof r);return n.onClose(vb(r,this)),this},e[s]=function(r){if(r&&typeof r!="function")throw new zt(s,typeof r);return r?(n.close(tl(r,this)),this):n.close()}}function Ve(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 Ve)){const l=new Ve(e,t,n);return e&&fb(e,t,l),l}t.autostart!==!1&&(t.autostart=!0),e=e||this,this._timeout=Number(t.timeout)||0,this._server=e,this._current=[],this._error=null,this._isOnCloseHandlerKey=Symbol("isOnCloseHandler"),this._lastUsed=null,this.setMaxListeners(0),n&&this.once("start",n),this.started=!1,this.booted=!1,this.pluginTree=new Bb,this._readyQ=Ei(this,Mc,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=Gi},this._closeQ=Ei(this,Qb,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=Gi},this._doStart=null,this._root=new pl(this,Cb.bind(this),t,!1,0),this._root.once("start",(l,o,i)=>{const c=this.pluginTree.start(null,o,i);this._root.once("loaded",(a,s,r)=>{this.pluginTree.stop(c,r)})}),pl.loadPlugin.call(this,this._root,l=>{Ut("root plugin ready");try{this.emit("preReady"),this._root=null}catch(o){l=l||this._error||o}if(l){if(this._error=l,this._readyQ.length()===0)throw l}else this.booted=!0;this._readyQ.resume()})}function Cb(e,t,n){this._doStart=n,t.autostart&&this.start()}Yb(Ve,Sb);Ve.prototype.start=function(){return this.started=!0,B.nextTick(this._doStart),this};Ve.prototype.override=function(e,t,n){return e};function Jb(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new Nb(typeof e);return e}Ve.prototype[pn]=!0;Ve.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};Ve.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(Ve.prototype,"then",{get:xc});Ve.prototype._addPlugin=function(e,t,n){if(e=Jb(e),t=t||{},this.booted)throw new Ib;const l=this._current[0],o=new pl(this,e,t,n);if(o.once("start",(i,c,a)=>{const s=this.pluginTree.start(l.name,c,a);o.once("loaded",(r,u,V)=>{this.pluginTree.stop(s,V)})}),l.loaded)throw new Error(o.name,l.name);return l.enqueue(o,i=>{i&&(this._error=i)}),o};Ve.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,l,o){Mc.call(this,e,o)}return this};Ve.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};Ve.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new zt("close",typeof e)}else t=new Promise(function(n,l){e=function(o){if(o)return l(o);n()}});return this.ready(()=>{this._error=null,this._closeQ.push(e),B.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};Ve.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(o),this.start();const l=this._current[0].server;function o(i,c,a){i?n(i):t(l),B.nextTick(a)}})};Ve.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};Ve.prototype.toJSON=function(){return this.pluginTree.toJSON()};function Gi(){}function xc(){if(this.booted){Ut("thenify returning null because we are already booted");return}if(this[el]){this[el]=!1;return}return Ut("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[el]=!0,e(this._server)),t)}function Mc(e,t){const n=this._server,l=this._error;let o;if(this._error=null,e.length===0)this._error=l,o=e(),o&&!o[pn]&&typeof o.then=="function"?o.then(()=>B.nextTick(t),i=>B.nextTick(t,i)):B.nextTick(t);else if(e.length===1)o=e(l),o&&!o[pn]&&typeof o.then=="function"?o.then(()=>B.nextTick(t),i=>B.nextTick(t,i)):B.nextTick(t);else if(this._timeout===0){const i=c=>{this._error=c,t(this._error)};e.length===2?e(l,i):e(l,n,i)}else Tb.call(this,e,l,n,t)}function Tb(e,t,n,l){const o=e.name;Ut("setting up ready timeout",o,this._timeout);let i=setTimeout(()=>{Ut("timed out",o),i=null;const a=new Ub(o);a.fn=e,this._error=a,l(a)},this._timeout);e.length===2?e(t,c.bind(this)):e(t,n,c.bind(this));function c(a){i&&(clearTimeout(i),this._error=a,l(this._error))}}function Qb(e,t){const n=this._server,l=e[this._isOnCloseHandlerKey];if(e.length===0||e.length===1){let o;l?o=e(n):o=e(this._error),o&&typeof o.then=="function"?(Ut("resolving close/onClose promise"),o.then(()=>B.nextTick(t),i=>B.nextTick(t,i))):B.nextTick(t)}else e.length===2?e(l?n:this._error,t):l?e(n,t):e(this._error,n,t)}function vb(e,t){return n.bind(t);function n(l,o){let i;e.length===0?(i=e(),i&&i.then?i.then(function(){B.nextTick(o)},o):B.nextTick(o)):e.length===1?(i=e(this),i&&i.then?i.then(function(){B.nextTick(o)},o):B.nextTick(o)):e(this,o)}}function tl(e,t){return n.bind(t);function n(l,o){let i;e?e.length===0?(i=e(),i&&i.then?i.then(function(){B.nextTick(o,l)},o):B.nextTick(o,l)):e.length===1?(i=e(l),i&&i.then?i.then(function(){B.nextTick(o)},o):B.nextTick(o)):e.length===2?e(l,o):e(l,this,o):B.nextTick(o)}}Ll.exports=Ve;Ll.exports.express=function(e){return Ve(e,{expose:{use:"load"}})};var kb=Ll.exports;const zb=Ru(kb);(function(){if(window.requestAnimationFrame&&window.cancelAnimationFrame)return;const e=["webkit","moz","ms","o"];for(const t of e)window.requestAnimationFrame=window.requestAnimationFrame||window[`${t}RequestAnimationFrame`],window.cancelAnimationFrame=window.cancelAnimationFrame||window[`${t}CancelAnimationFrame`]||window[`${t}CancelRequestAnimationFrame`];if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){let t=0;const n=!!(window.performance&&window.performance.now);window.requestAnimationFrame=function(l){const o=n?window.performance.now():new Date().getTime(),i=Math.max(0,16-(o-t)),c=window.setTimeout(function(){l(o+i)},i);return t=o+i,c},window.cancelAnimationFrame=clearTimeout}})();function Kb(e,t=!0,n=!0,l={friendsTab:"enabled"}){const o=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",i=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",c=zb(Object.create({}),{autostart:!1});return c.use(Md,{hideFriends:l.hideFriends,skipOnboarding:l.skipOnboarding,betPack:l.betPack,friendsTab:l.friendsTab,theme:l.theme,themeMode:l.themeMode}),c.use(vd,{onDeepLinkHandled:l==null?void 0:l.onDeepLinkHandled}),c.use(Ld,{videoPlayerController:l==null?void 0:l.videoPlayerController}),c.use(xd,{onContentActivate:l==null?void 0:l.onContentActivate,withAd:l==null?void 0:l.withAd,withAdNotification:l==null?void 0:l.withAdNotification}),c.use(od,{sdkKey:e,host:o,analyticsHost:i,version:l==null?void 0:l.version,webOS:l==null?void 0:l.webOS}),c.use(rd),c.use(Kd),c.use(nu),c.use(Ud),c.use(bu),c.after((a,s,r)=>{if(a)throw a;s.ready(),r()}),n&&c.after(async(a,s,r)=>{if(a)throw a;await s.sdk.initializeApp(),r()}),c.onClose(()=>{console.log("close StreamLayer instance")}),c}const Lb=({sdkKey:e,plugins:t,production:n,autoEnable:l,onDeepLinkHandled:o,videoPlayerController:i,onContentActivate:c,hideFriends:a,skipOnboarding:s,withAdNotification:r,withAd:u,friendsTab:V,betPack:R,webOS:g})=>{const[h,X]=oo.useState(null);return oo.useEffect(()=>{let p=!1;if(!e)return console.error("streamlayer sdk key should be provided"),X(A=>(A!==null&&typeof A.disableApp=="function"&&A.disableApp(),null)),()=>{p=!0};const W=Kb(e,n,l,{version:"1.21.3",onDeepLinkHandled:o,videoPlayerController:i,onContentActivate:c,skipOnboarding:s,withAdNotification:r,withAd:u,hideFriends:a,friendsTab:V,betPack:R,webOS:g});if(t)for(const A of t)W.use(A);return W.ready().then(A=>{p||(X(A.sdk),typeof window<"u")}).catch(A=>console.log(A)),()=>{p=!0,W.close(function(A){if(A)throw A})}},[e,n]),h};exports.AdUnit=pe;exports.AutoPlayVideo=$s;exports.CloseTimerAuto=_s;exports.CtaIconMode=vs;exports.InvitationFrom=rl;exports.NotificationEnabled=sl;exports.NotificationPromotionImagePosition=Cs;exports.NotificationPromotionMode=Bs;exports.NotificationSponsorLogoMode=Ts;exports.NotificationUseContentMedia=Ds;exports.PickHistoryStatus=Tt;exports.PlayVideoMuted=tr;exports.PromotionButtonType=Ks;exports.PromotionLogoMode=ws;exports.PromotionType=T;exports.QuestionImages=Is;exports.QuestionStatus=ue;exports.QuestionType=f;exports.SdkOverlayType=O;exports.global=dl;exports.useStreamLayerApp=Lb;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx as Y, jsxs as pe, Fragment as to } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect as It, useState as Lo, useRef as wi, useCallback as nn } from "react";
|
|
3
|
-
import "@nanostores/react";
|
|
4
|
-
import "nanostores";
|
|
5
3
|
import { n as ai, s as J, i as Ht, O as Fr, B as gm, q as fm, k as mm, e as bs, y as io, E as ym, r as _m, t as bm, u as Tm, c as vm, d as Sm, a as Ni, h as Em } from "./provider.js";
|
|
4
|
+
import "nanostores";
|
|
6
5
|
import "lodash.throttle";
|
|
7
6
|
import "react-dom";
|
|
8
7
|
import "react-countup";
|
|
@@ -34371,7 +34370,7 @@ const l2 = (i) => {
|
|
|
34371
34370
|
containerId: A.containerId,
|
|
34372
34371
|
muted: m
|
|
34373
34372
|
});
|
|
34374
|
-
},
|
|
34373
|
+
}, L2 = ({
|
|
34375
34374
|
event: i,
|
|
34376
34375
|
sidebar: e,
|
|
34377
34376
|
banner: t,
|
|
@@ -34406,6 +34405,6 @@ const l2 = (i) => {
|
|
|
34406
34405
|
] }) : null;
|
|
34407
34406
|
};
|
|
34408
34407
|
export {
|
|
34409
|
-
|
|
34408
|
+
L2 as StreamLayerSDKAdvertisement,
|
|
34410
34409
|
_2 as StreamLayerSDKAdvertisementUI
|
|
34411
34410
|
};
|
package/lib/classic/es/index.js
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import { S as
|
|
1
|
+
import { S as s, a as y, b as L, h as p, u as c, d as f, c as u } from "./provider.js";
|
|
2
2
|
import "nanostores";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
|
-
import "@nanostores/react";
|
|
6
5
|
import "lodash.throttle";
|
|
7
6
|
import "react-dom";
|
|
8
7
|
import "react-countup";
|
|
9
|
-
import { StreamLayerSDKNotification as
|
|
8
|
+
import { StreamLayerSDKNotification as K, StreamLayerSDKNotificationUI as d } from "./notification.js";
|
|
10
9
|
export {
|
|
11
|
-
|
|
10
|
+
s as StreamLayerProvider,
|
|
12
11
|
y as StreamLayerSDKEvent,
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
K as StreamLayerSDKNotification,
|
|
13
|
+
d as StreamLayerSDKNotificationUI,
|
|
15
14
|
L as StreamLayerSDKReact,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
p as StreamLayerThemeProvider,
|
|
16
|
+
c as useStreamLayer,
|
|
17
|
+
f as useStreamLayerTheme,
|
|
18
|
+
u as useStreamLayerUI
|
|
20
19
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { jsx as u, jsxs as
|
|
1
|
+
import { jsx as u, jsxs as p } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as l, useEffect as h } from "react";
|
|
3
|
-
import "@nanostores/react";
|
|
4
|
-
import "nanostores";
|
|
5
3
|
import { e as m, s as f, T as S, u as I, d as g, h as v, a as k } from "./provider.js";
|
|
4
|
+
import "nanostores";
|
|
6
5
|
import "lodash.throttle";
|
|
7
6
|
import "react-dom";
|
|
8
7
|
import "react-countup";
|
|
@@ -19,7 +18,7 @@ const Q = () => S, L = /* @__PURE__ */ f(Q())({
|
|
|
19
18
|
hideHeader: a,
|
|
20
19
|
insightId: t
|
|
21
20
|
}) => {
|
|
22
|
-
const s = l(""),
|
|
21
|
+
const s = l(""), c = m(e.openedQuestion.$store);
|
|
23
22
|
return h(() => t ? (!i || e.isOpenedQuestion(t) || (s.current = t, e.getFeedItem(t).then((r) => {
|
|
24
23
|
var d;
|
|
25
24
|
s.current === t && ((d = r == null ? void 0 : r.attributes) == null ? void 0 : d.attributes.case) === "insight" && e.openQuestion(t, r);
|
|
@@ -31,7 +30,7 @@ const Q = () => S, L = /* @__PURE__ */ f(Q())({
|
|
|
31
30
|
var d;
|
|
32
31
|
r && ((d = r.feedItem) == null ? void 0 : d.type) === "insight" && (!i || e.isOpenedQuestion(r.feedItem.id) || (s.current = r.feedItem.id, e.openQuestion(r.feedItem.id, r.feedItem))), !r && s.current && (e.closeQuestion(s.current), s.current = "");
|
|
33
32
|
}), () => {
|
|
34
|
-
}), [e, i, t]),
|
|
33
|
+
}), [e, i, t]), c ? /* @__PURE__ */ u(L, {
|
|
35
34
|
sdk: n,
|
|
36
35
|
skipAutoClose: o,
|
|
37
36
|
hideHeader: a,
|
|
@@ -56,7 +55,7 @@ const Q = () => S, L = /* @__PURE__ */ f(Q())({
|
|
|
56
55
|
gamification: t,
|
|
57
56
|
skipAutoClose: i
|
|
58
57
|
}) : null;
|
|
59
|
-
},
|
|
58
|
+
}, O = ({
|
|
60
59
|
event: e,
|
|
61
60
|
theme: n,
|
|
62
61
|
hideHeader: i,
|
|
@@ -64,7 +63,7 @@ const Q = () => S, L = /* @__PURE__ */ f(Q())({
|
|
|
64
63
|
persistent: a
|
|
65
64
|
}) => {
|
|
66
65
|
const t = I(), s = g();
|
|
67
|
-
return t ? /* @__PURE__ */
|
|
66
|
+
return t ? /* @__PURE__ */ p("div", { className: "StreamLayerSDK", children: [
|
|
68
67
|
/* @__PURE__ */ u(v, { customTheme: n ?? s.theme, themeMode: s.themeMode, children: /* @__PURE__ */ u(
|
|
69
68
|
A,
|
|
70
69
|
{
|
|
@@ -78,6 +77,6 @@ const Q = () => S, L = /* @__PURE__ */ f(Q())({
|
|
|
78
77
|
] }) : null;
|
|
79
78
|
};
|
|
80
79
|
export {
|
|
81
|
-
|
|
80
|
+
O as StreamLayerSDKInsight,
|
|
82
81
|
A as StreamLayerSDKInsightUI
|
|
83
82
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsxs as l, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { useState as w, useRef as _, useEffect as y, useCallback as As, useMemo as hs } from "react";
|
|
3
|
-
import "@nanostores/react";
|
|
4
|
-
import "nanostores";
|
|
5
3
|
import { s as n, B as A, D as Is, v as $s, x as K, w as G, z as gs, E as ws, O as x, y as ys, f as Ts, e as bs, i as Cs, N as O, u as fs, d as ks, c as Ns, h as qs } from "./provider.js";
|
|
4
|
+
import "nanostores";
|
|
6
5
|
import "lodash.throttle";
|
|
7
6
|
import "react-dom";
|
|
8
7
|
import "react-countup";
|
|
@@ -999,11 +998,11 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
999
998
|
webos: i
|
|
1000
999
|
}
|
|
1001
1000
|
) : c && /* @__PURE__ */ s(se, { ...c.data, action: c.action });
|
|
1002
|
-
},
|
|
1001
|
+
}, Mo = ({ theme: e }) => {
|
|
1003
1002
|
const i = fs(), t = ks(), o = Ns();
|
|
1004
1003
|
return i && (o.appNotification || o.onboardingNotification) ? o.app && !o.onboardingNotification ? null : /* @__PURE__ */ s("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ s(qs, { customTheme: e ?? t.theme, themeMode: t.themeMode, children: /* @__PURE__ */ s(fo, { sdk: i }) }) }) : null;
|
|
1005
1004
|
};
|
|
1006
1005
|
export {
|
|
1007
|
-
|
|
1006
|
+
Mo as StreamLayerSDKNotification,
|
|
1008
1007
|
fo as StreamLayerSDKNotificationUI
|
|
1009
1008
|
};
|
|
@@ -2,18 +2,17 @@ import { jsx as l, jsxs as L } from "react/jsx-runtime";
|
|
|
2
2
|
import { j as K, k as M, i as k, s as m, l as _, n as $, e as F, u as N, d as j, h as q } from "./provider.js";
|
|
3
3
|
import "nanostores";
|
|
4
4
|
import { useRef as D, useCallback as I, useState as R, useEffect as T, Component as O } from "react";
|
|
5
|
-
import "@nanostores/react";
|
|
6
5
|
import "lodash.throttle";
|
|
7
6
|
import "react-dom";
|
|
8
7
|
import "react-countup";
|
|
9
8
|
import { c as z } from "./vast-client.min-B0NUra1B.js";
|
|
10
9
|
const G = {}, J = new z(), w = M(G), E = K("ui:gam-static"), U = (e) => new Promise((s, t) => {
|
|
11
|
-
const
|
|
12
|
-
|
|
10
|
+
const o = new Image();
|
|
11
|
+
o.onload = () => s(e), o.onerror = () => t(), o.src = e;
|
|
13
12
|
}), V = () => {
|
|
14
13
|
const e = D(0);
|
|
15
14
|
return [I(async (s) => {
|
|
16
|
-
var t,
|
|
15
|
+
var t, o, r, c, d, n, h, i, y, g, f;
|
|
17
16
|
if ((t = w.get()[s]) != null && t.imageSrc)
|
|
18
17
|
return { success: !0 };
|
|
19
18
|
const v = Date.now();
|
|
@@ -25,39 +24,39 @@ const G = {}, J = new z(), w = M(G), E = K("ui:gam-static"), U = (e) => new Prom
|
|
|
25
24
|
});
|
|
26
25
|
const u = await J.get(s);
|
|
27
26
|
if (E.debug(u, "parsedVAST"), e.current === v && w.get()[s].url) {
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
30
|
-
E.debug(
|
|
31
|
-
const p =
|
|
27
|
+
const a = u.ads.find((p) => p.creatives.length > 0);
|
|
28
|
+
if (a) {
|
|
29
|
+
E.debug(a, "validAd");
|
|
30
|
+
const p = a.creatives.find((A) => A.type === "nonlinear");
|
|
32
31
|
if (p) {
|
|
33
32
|
E.debug(p, "nonlinear");
|
|
34
|
-
const A = (r = (
|
|
33
|
+
const A = (r = (o = p.variations) == null ? void 0 : o[0]) == null ? void 0 : r.staticResource, C = (d = (c = p.variations) == null ? void 0 : c[0]) == null ? void 0 : d.nonlinearClickThroughURLTemplate;
|
|
35
34
|
if (A)
|
|
36
35
|
return await U(A), w.setKey(s, {
|
|
37
|
-
id:
|
|
36
|
+
id: a.id || "",
|
|
38
37
|
url: s,
|
|
39
38
|
imageSrc: A,
|
|
40
39
|
adUrl: C
|
|
41
40
|
}), k.emit("exposedPauseAd", {
|
|
42
41
|
action: "loaded",
|
|
43
42
|
payload: {
|
|
44
|
-
id:
|
|
43
|
+
id: a.id || ""
|
|
45
44
|
}
|
|
46
45
|
}), { success: !0 };
|
|
47
46
|
}
|
|
48
|
-
const P =
|
|
47
|
+
const P = a.creatives.find((A) => A.type === "companion");
|
|
49
48
|
E.debug(P, "companion");
|
|
50
49
|
const b = (y = (i = (h = (n = P == null ? void 0 : P.variations) == null ? void 0 : n[0]) == null ? void 0 : h.staticResources) == null ? void 0 : i[0]) == null ? void 0 : y.url, S = (f = (g = P == null ? void 0 : P.variations) == null ? void 0 : g[0]) == null ? void 0 : f.companionClickThroughURLTemplate;
|
|
51
50
|
if (b)
|
|
52
51
|
return await U(b), w.setKey(s, {
|
|
53
|
-
id:
|
|
52
|
+
id: a.id || "",
|
|
54
53
|
url: s,
|
|
55
54
|
imageSrc: b,
|
|
56
55
|
adUrl: S
|
|
57
56
|
}), k.emit("exposedPauseAd", {
|
|
58
57
|
action: "loaded",
|
|
59
58
|
payload: {
|
|
60
|
-
id:
|
|
59
|
+
id: a.id || ""
|
|
61
60
|
}
|
|
62
61
|
}), { success: !0 };
|
|
63
62
|
}
|
|
@@ -111,9 +110,9 @@ const G = {}, J = new z(), w = M(G), E = K("ui:gam-static"), U = (e) => new Prom
|
|
|
111
110
|
name: "ExternalAdContainer",
|
|
112
111
|
class: "e1dpvfl1",
|
|
113
112
|
propsAsIs: !1
|
|
114
|
-
}),
|
|
113
|
+
}), ae = ({ vastUrl: e, isDesktop: s }) => {
|
|
115
114
|
var t;
|
|
116
|
-
const [,
|
|
115
|
+
const [, o] = V(), r = F(o, { keys: [e] });
|
|
117
116
|
return T(() => {
|
|
118
117
|
r && r[e] && r[e].imageSrc && r[e].id && k.emit("exposedPauseAd", {
|
|
119
118
|
action: "rendered",
|
|
@@ -138,10 +137,10 @@ const G = {}, J = new z(), w = M(G), E = K("ui:gam-static"), U = (e) => new Prom
|
|
|
138
137
|
children: /* @__PURE__ */ l(B, { src: r[e].imageSrc })
|
|
139
138
|
}
|
|
140
139
|
) : null;
|
|
141
|
-
},
|
|
140
|
+
}, oe = ({ isClosing: e, title: s, caption: t, onPlay: o, onClose: r, vastUrl: c, options: d, isDesktop: n }) => {
|
|
142
141
|
const h = (d == null ? void 0 : d.showPauseButton) ?? !0, { ref: i, focusSelf: y } = _.useFocusable({
|
|
143
142
|
focusKey: "sl-pause-ad-play",
|
|
144
|
-
onEnterRelease:
|
|
143
|
+
onEnterRelease: o,
|
|
145
144
|
isFocusBoundary: !0,
|
|
146
145
|
forceFocus: !0
|
|
147
146
|
});
|
|
@@ -168,19 +167,19 @@ const G = {}, J = new z(), w = M(G), E = K("ui:gam-static"), U = (e) => new Prom
|
|
|
168
167
|
ee,
|
|
169
168
|
{
|
|
170
169
|
ref: i,
|
|
171
|
-
onClick:
|
|
170
|
+
onClick: o,
|
|
172
171
|
onMouseEnter: () => i.current.focus(),
|
|
173
172
|
"aria-label": "Resume playback"
|
|
174
173
|
}
|
|
175
174
|
) }),
|
|
176
175
|
/* @__PURE__ */ l(se, { className: "SL_PauseAdSidebar", children: /* @__PURE__ */ L(re, { children: [
|
|
177
|
-
c && /* @__PURE__ */ l(
|
|
176
|
+
c && /* @__PURE__ */ l(ae, { isDesktop: n, vastUrl: c }),
|
|
178
177
|
/* @__PURE__ */ l(te, { children: "ADVERTISEMENT" })
|
|
179
178
|
] }) })
|
|
180
179
|
] }) });
|
|
181
|
-
}, ne = ({ showPauseAd: e, vastUrls: s, title: t, caption:
|
|
182
|
-
const i = (n == null ? void 0 : n.pauseAdDelay) ?? 5e3, [y, g] = R(!1), [f, v] = R(!1), u = D(),
|
|
183
|
-
p.current =
|
|
180
|
+
}, ne = ({ showPauseAd: e, vastUrls: s, title: t, caption: o, sdk: r, onClose: c, onRender: d, options: n, isDesktop: h }) => {
|
|
181
|
+
const i = (n == null ? void 0 : n.pauseAdDelay) ?? 5e3, [y, g] = R(!1), [f, v] = R(!1), u = D(), a = s == null ? void 0 : s[0].url, p = D(a);
|
|
182
|
+
p.current = a;
|
|
184
183
|
const [P, b] = V(), S = I(() => {
|
|
185
184
|
c && (k.emit("exposedPauseAd", {
|
|
186
185
|
action: "closed",
|
|
@@ -190,14 +189,14 @@ const G = {}, J = new z(), w = M(G), E = K("ui:gam-static"), U = (e) => new Prom
|
|
|
190
189
|
r.controlVideoPlayer({ play: !0 });
|
|
191
190
|
}, [r]);
|
|
192
191
|
return T(() => {
|
|
193
|
-
if (e &&
|
|
192
|
+
if (e && a) {
|
|
194
193
|
k.emit("exposedPauseAd", {
|
|
195
194
|
action: "enabled",
|
|
196
195
|
payload: {}
|
|
197
|
-
}), P(
|
|
198
|
-
p.current ===
|
|
196
|
+
}), P(a).then((x) => {
|
|
197
|
+
p.current === a && (x == null ? void 0 : x.success) !== !0 && (clearTimeout(u.current), S == null || S());
|
|
199
198
|
}).catch(() => {
|
|
200
|
-
p.current ===
|
|
199
|
+
p.current === a && (clearTimeout(u.current), S == null || S());
|
|
201
200
|
});
|
|
202
201
|
const C = () => {
|
|
203
202
|
const x = b.get()[p.current];
|
|
@@ -218,19 +217,19 @@ const G = {}, J = new z(), w = M(G), E = K("ui:gam-static"), U = (e) => new Prom
|
|
|
218
217
|
return () => {
|
|
219
218
|
u.current && clearTimeout(u.current);
|
|
220
219
|
};
|
|
221
|
-
}, [b, P, S, i, e,
|
|
220
|
+
}, [b, P, S, i, e, a]), T(() => {
|
|
222
221
|
d == null || d({ rendered: y });
|
|
223
222
|
}, [y, d]), T(() => () => {
|
|
224
223
|
d == null || d({ rendered: !1 });
|
|
225
224
|
}, [d]), y ? /* @__PURE__ */ l(
|
|
226
|
-
|
|
225
|
+
oe,
|
|
227
226
|
{
|
|
228
227
|
onClose: S,
|
|
229
228
|
isClosing: f,
|
|
230
229
|
title: t,
|
|
231
|
-
caption:
|
|
230
|
+
caption: o,
|
|
232
231
|
onPlay: A,
|
|
233
|
-
vastUrl:
|
|
232
|
+
vastUrl: a,
|
|
234
233
|
options: n,
|
|
235
234
|
isDesktop: h
|
|
236
235
|
}
|
|
@@ -239,7 +238,7 @@ const G = {}, J = new z(), w = M(G), E = K("ui:gam-static"), U = (e) => new Prom
|
|
|
239
238
|
showPauseAd: e,
|
|
240
239
|
pauseAdVastUrl: s,
|
|
241
240
|
videoPlayerController: t,
|
|
242
|
-
onRenderPauseAd:
|
|
241
|
+
onRenderPauseAd: o,
|
|
243
242
|
onClosePauseAd: r,
|
|
244
243
|
children: c,
|
|
245
244
|
options: d
|
|
@@ -263,7 +262,7 @@ const G = {}, J = new z(), w = M(G), E = K("ui:gam-static"), U = (e) => new Prom
|
|
|
263
262
|
showPauseAd: e,
|
|
264
263
|
vastUrls: s,
|
|
265
264
|
onClose: r,
|
|
266
|
-
onRender:
|
|
265
|
+
onRender: o,
|
|
267
266
|
options: d,
|
|
268
267
|
isDesktop: !0
|
|
269
268
|
}
|
|
@@ -272,7 +271,7 @@ const G = {}, J = new z(), w = M(G), E = K("ui:gam-static"), U = (e) => new Prom
|
|
|
272
271
|
}
|
|
273
272
|
) }) : c;
|
|
274
273
|
};
|
|
275
|
-
class
|
|
274
|
+
class ye extends O {
|
|
276
275
|
constructor(s) {
|
|
277
276
|
super(s), this.state = { hasError: !1 };
|
|
278
277
|
}
|
|
@@ -287,5 +286,5 @@ class fe extends O {
|
|
|
287
286
|
}
|
|
288
287
|
}
|
|
289
288
|
export {
|
|
290
|
-
|
|
289
|
+
ye as StreamLayerPauseAd
|
|
291
290
|
};
|
package/lib/classic/es/points.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsxs as m, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { useState as u, useEffect as d } from "react";
|
|
3
|
-
import "@nanostores/react";
|
|
4
|
-
import "nanostores";
|
|
5
3
|
import { s as a, B as y, m as h, f as S, e as f, F as c, i as r, u as v, d as g, h as k } from "./provider.js";
|
|
4
|
+
import "nanostores";
|
|
6
5
|
import "lodash.throttle";
|
|
7
6
|
import "react-dom";
|
|
8
7
|
import "react-countup";
|
|
@@ -68,10 +67,10 @@ const I = /* @__PURE__ */ a("div")({
|
|
|
68
67
|
return null;
|
|
69
68
|
const e = s.getFeature(A.GAMES);
|
|
70
69
|
return e ? /* @__PURE__ */ t(C, { gamification: e }) : null;
|
|
71
|
-
},
|
|
70
|
+
}, R = ({ theme: s }) => {
|
|
72
71
|
const e = v(), o = g();
|
|
73
72
|
return e ? /* @__PURE__ */ t("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ t(k, { customTheme: s ?? o.theme, themeMode: o.themeMode, children: /* @__PURE__ */ t(j, { sdk: e }) }) }) : null;
|
|
74
73
|
};
|
|
75
74
|
export {
|
|
76
|
-
|
|
75
|
+
R as StreamLayerSDKPoints
|
|
77
76
|
};
|