@streamlayer/react 0.34.4 → 0.34.5
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/dist/cjs/masters.js
CHANGED
|
@@ -172,7 +172,7 @@ You might need to use a local HTTP server (instead of file://): https://reactjs.
|
|
|
172
172
|
*
|
|
173
173
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
174
174
|
* @license MIT
|
|
175
|
-
*/(function(n){const a=l2,s=I6,f=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;n.Buffer=v,n.SlowBuffer=se,n.INSPECT_MAX_BYTES=50;const u=2147483647;n.kMaxLength=u,v.TYPED_ARRAY_SUPPORT=y(),!v.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function y(){try{const l=new Uint8Array(1),d={foo:function(){return 42}};return Object.setPrototypeOf(d,Uint8Array.prototype),Object.setPrototypeOf(l,d),l.foo()===42}catch{return!1}}Object.defineProperty(v.prototype,"parent",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.buffer}}),Object.defineProperty(v.prototype,"offset",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.byteOffset}});function g(l){if(l>u)throw new RangeError('The value "'+l+'" is invalid for option "size"');const d=new Uint8Array(l);return Object.setPrototypeOf(d,v.prototype),d}function v(l,d,m){if(typeof l=="number"){if(typeof d=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return R(l)}return E(l,d,m)}v.poolSize=8192;function E(l,d,m){if(typeof l=="string")return A(l,d);if(ArrayBuffer.isView(l))return V(l);if(l==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof l);if(Mt(l,ArrayBuffer)||l&&Mt(l.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Mt(l,SharedArrayBuffer)||l&&Mt(l.buffer,SharedArrayBuffer)))return G(l,d,m);if(typeof l=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const b=l.valueOf&&l.valueOf();if(b!=null&&b!==l)return v.from(b,d,m);const I=ae(l);if(I)return I;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof l[Symbol.toPrimitive]=="function")return v.from(l[Symbol.toPrimitive]("string"),d,m);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof l)}v.from=function(l,d,m){return E(l,d,m)},Object.setPrototypeOf(v.prototype,Uint8Array.prototype),Object.setPrototypeOf(v,Uint8Array);function _(l){if(typeof l!="number")throw new TypeError('"size" argument must be of type number');if(l<0)throw new RangeError('The value "'+l+'" is invalid for option "size"')}function L(l,d,m){return _(l),l<=0?g(l):d!==void 0?typeof m=="string"?g(l).fill(d,m):g(l).fill(d):g(l)}v.alloc=function(l,d,m){return L(l,d,m)};function R(l){return _(l),g(l<0?0:Q(l)|0)}v.allocUnsafe=function(l){return R(l)},v.allocUnsafeSlow=function(l){return R(l)};function A(l,d){if((typeof d!="string"||d==="")&&(d="utf8"),!v.isEncoding(d))throw new TypeError("Unknown encoding: "+d);const m=ee(l,d)|0;let b=g(m);const I=b.write(l,d);return I!==m&&(b=b.slice(0,I)),b}function U(l){const d=l.length<0?0:Q(l.length)|0,m=g(d);for(let b=0;b<d;b+=1)m[b]=l[b]&255;return m}function V(l){if(Mt(l,Uint8Array)){const d=new Uint8Array(l);return G(d.buffer,d.byteOffset,d.byteLength)}return U(l)}function G(l,d,m){if(d<0||l.byteLength<d)throw new RangeError('"offset" is outside of buffer bounds');if(l.byteLength<d+(m||0))throw new RangeError('"length" is outside of buffer bounds');let b;return d===void 0&&m===void 0?b=new Uint8Array(l):m===void 0?b=new Uint8Array(l,d):b=new Uint8Array(l,d,m),Object.setPrototypeOf(b,v.prototype),b}function ae(l){if(v.isBuffer(l)){const d=Q(l.length)|0,m=g(d);return m.length===0||l.copy(m,0,0,d),m}if(l.length!==void 0)return typeof l.length!="number"||On(l.length)?g(0):U(l);if(l.type==="Buffer"&&Array.isArray(l.data))return U(l.data)}function Q(l){if(l>=u)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+u.toString(16)+" bytes");return l|0}function se(l){return+l!=l&&(l=0),v.alloc(+l)}v.isBuffer=function(l){return l!=null&&l._isBuffer===!0&&l!==v.prototype},v.compare=function(l,d){if(Mt(l,Uint8Array)&&(l=v.from(l,l.offset,l.byteLength)),Mt(d,Uint8Array)&&(d=v.from(d,d.offset,d.byteLength)),!v.isBuffer(l)||!v.isBuffer(d))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(l===d)return 0;let m=l.length,b=d.length;for(let I=0,x=Math.min(m,b);I<x;++I)if(l[I]!==d[I]){m=l[I],b=d[I];break}return m<b?-1:b<m?1:0},v.isEncoding=function(l){switch(String(l).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},v.concat=function(l,d){if(!Array.isArray(l))throw new TypeError('"list" argument must be an Array of Buffers');if(l.length===0)return v.alloc(0);let m;if(d===void 0)for(d=0,m=0;m<l.length;++m)d+=l[m].length;const b=v.allocUnsafe(d);let I=0;for(m=0;m<l.length;++m){let x=l[m];if(Mt(x,Uint8Array))I+x.length>b.length?(v.isBuffer(x)||(x=v.from(x)),x.copy(b,I)):Uint8Array.prototype.set.call(b,x,I);else if(v.isBuffer(x))x.copy(b,I);else throw new TypeError('"list" argument must be an Array of Buffers');I+=x.length}return b};function ee(l,d){if(v.isBuffer(l))return l.length;if(ArrayBuffer.isView(l)||Mt(l,ArrayBuffer))return l.byteLength;if(typeof l!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof l);const m=l.length,b=arguments.length>2&&arguments[2]===!0;if(!b&&m===0)return 0;let I=!1;for(;;)switch(d){case"ascii":case"latin1":case"binary":return m;case"utf8":case"utf-8":return rn(l).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m*2;case"hex":return m>>>1;case"base64":return qn(l).length;default:if(I)return b?-1:rn(l).length;d=(""+d).toLowerCase(),I=!0}}v.byteLength=ee;function ue(l,d,m){let b=!1;if((d===void 0||d<0)&&(d=0),d>this.length||((m===void 0||m>this.length)&&(m=this.length),m<=0)||(m>>>=0,d>>>=0,m<=d))return"";for(l||(l="utf8");;)switch(l){case"hex":return Be(this,d,m);case"utf8":case"utf-8":return at(this,d,m);case"ascii":return En(this,d,m);case"latin1":case"binary":return Ce(this,d,m);case"base64":return qe(this,d,m);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Le(this,d,m);default:if(b)throw new TypeError("Unknown encoding: "+l);l=(l+"").toLowerCase(),b=!0}}v.prototype._isBuffer=!0;function J(l,d,m){const b=l[d];l[d]=l[m],l[m]=b}v.prototype.swap16=function(){const l=this.length;if(l%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let d=0;d<l;d+=2)J(this,d,d+1);return this},v.prototype.swap32=function(){const l=this.length;if(l%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let d=0;d<l;d+=4)J(this,d,d+3),J(this,d+1,d+2);return this},v.prototype.swap64=function(){const l=this.length;if(l%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let d=0;d<l;d+=8)J(this,d,d+7),J(this,d+1,d+6),J(this,d+2,d+5),J(this,d+3,d+4);return this},v.prototype.toString=function(){const l=this.length;return l===0?"":arguments.length===0?at(this,0,l):ue.apply(this,arguments)},v.prototype.toLocaleString=v.prototype.toString,v.prototype.equals=function(l){if(!v.isBuffer(l))throw new TypeError("Argument must be a Buffer");return this===l?!0:v.compare(this,l)===0},v.prototype.inspect=function(){let l="";const d=n.INSPECT_MAX_BYTES;return l=this.toString("hex",0,d).replace(/(.{2})/g,"$1 ").trim(),this.length>d&&(l+=" ... "),"<Buffer "+l+">"},f&&(v.prototype[f]=v.prototype.inspect),v.prototype.compare=function(l,d,m,b,I){if(Mt(l,Uint8Array)&&(l=v.from(l,l.offset,l.byteLength)),!v.isBuffer(l))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof l);if(d===void 0&&(d=0),m===void 0&&(m=l?l.length:0),b===void 0&&(b=0),I===void 0&&(I=this.length),d<0||m>l.length||b<0||I>this.length)throw new RangeError("out of range index");if(b>=I&&d>=m)return 0;if(b>=I)return-1;if(d>=m)return 1;if(d>>>=0,m>>>=0,b>>>=0,I>>>=0,this===l)return 0;let x=I-b,j=m-d;const Te=Math.min(x,j),Pe=this.slice(b,I),_e=l.slice(d,m);for(let Ae=0;Ae<Te;++Ae)if(Pe[Ae]!==_e[Ae]){x=Pe[Ae],j=_e[Ae];break}return x<j?-1:j<x?1:0};function ye(l,d,m,b,I){if(l.length===0)return-1;if(typeof m=="string"?(b=m,m=0):m>2147483647?m=2147483647:m<-2147483648&&(m=-2147483648),m=+m,On(m)&&(m=I?0:l.length-1),m<0&&(m=l.length+m),m>=l.length){if(I)return-1;m=l.length-1}else if(m<0)if(I)m=0;else return-1;if(typeof d=="string"&&(d=v.from(d,b)),v.isBuffer(d))return d.length===0?-1:fe(l,d,m,b,I);if(typeof d=="number")return d=d&255,typeof Uint8Array.prototype.indexOf=="function"?I?Uint8Array.prototype.indexOf.call(l,d,m):Uint8Array.prototype.lastIndexOf.call(l,d,m):fe(l,[d],m,b,I);throw new TypeError("val must be string, number or Buffer")}function fe(l,d,m,b,I){let x=1,j=l.length,Te=d.length;if(b!==void 0&&(b=String(b).toLowerCase(),b==="ucs2"||b==="ucs-2"||b==="utf16le"||b==="utf-16le")){if(l.length<2||d.length<2)return-1;x=2,j/=2,Te/=2,m/=2}function Pe(Ae,Oe){return x===1?Ae[Oe]:Ae.readUInt16BE(Oe*x)}let _e;if(I){let Ae=-1;for(_e=m;_e<j;_e++)if(Pe(l,_e)===Pe(d,Ae===-1?0:_e-Ae)){if(Ae===-1&&(Ae=_e),_e-Ae+1===Te)return Ae*x}else Ae!==-1&&(_e-=_e-Ae),Ae=-1}else for(m+Te>j&&(m=j-Te),_e=m;_e>=0;_e--){let Ae=!0;for(let Oe=0;Oe<Te;Oe++)if(Pe(l,_e+Oe)!==Pe(d,Oe)){Ae=!1;break}if(Ae)return _e}return-1}v.prototype.includes=function(l,d,m){return this.indexOf(l,d,m)!==-1},v.prototype.indexOf=function(l,d,m){return ye(this,l,d,m,!0)},v.prototype.lastIndexOf=function(l,d,m){return ye(this,l,d,m,!1)};function Ue(l,d,m,b){m=Number(m)||0;const I=l.length-m;b?(b=Number(b),b>I&&(b=I)):b=I;const x=d.length;b>x/2&&(b=x/2);let j;for(j=0;j<b;++j){const Te=parseInt(d.substr(j*2,2),16);if(On(Te))return j;l[m+j]=Te}return j}function He(l,d,m,b){return on(rn(d,l.length-m),l,m,b)}function gt(l,d,m,b){return on(rr(d),l,m,b)}function dt(l,d,m,b){return on(qn(d),l,m,b)}function vt(l,d,m,b){return on(ve(d,l.length-m),l,m,b)}v.prototype.write=function(l,d,m,b){if(d===void 0)b="utf8",m=this.length,d=0;else if(m===void 0&&typeof d=="string")b=d,m=this.length,d=0;else if(isFinite(d))d=d>>>0,isFinite(m)?(m=m>>>0,b===void 0&&(b="utf8")):(b=m,m=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const I=this.length-d;if((m===void 0||m>I)&&(m=I),l.length>0&&(m<0||d<0)||d>this.length)throw new RangeError("Attempt to write outside buffer bounds");b||(b="utf8");let x=!1;for(;;)switch(b){case"hex":return Ue(this,l,d,m);case"utf8":case"utf-8":return He(this,l,d,m);case"ascii":case"latin1":case"binary":return gt(this,l,d,m);case"base64":return dt(this,l,d,m);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return vt(this,l,d,m);default:if(x)throw new TypeError("Unknown encoding: "+b);b=(""+b).toLowerCase(),x=!0}},v.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function qe(l,d,m){return d===0&&m===l.length?a.fromByteArray(l):a.fromByteArray(l.slice(d,m))}function at(l,d,m){m=Math.min(l.length,m);const b=[];let I=d;for(;I<m;){const x=l[I];let j=null,Te=x>239?4:x>223?3:x>191?2:1;if(I+Te<=m){let Pe,_e,Ae,Oe;switch(Te){case 1:x<128&&(j=x);break;case 2:Pe=l[I+1],(Pe&192)===128&&(Oe=(x&31)<<6|Pe&63,Oe>127&&(j=Oe));break;case 3:Pe=l[I+1],_e=l[I+2],(Pe&192)===128&&(_e&192)===128&&(Oe=(x&15)<<12|(Pe&63)<<6|_e&63,Oe>2047&&(Oe<55296||Oe>57343)&&(j=Oe));break;case 4:Pe=l[I+1],_e=l[I+2],Ae=l[I+3],(Pe&192)===128&&(_e&192)===128&&(Ae&192)===128&&(Oe=(x&15)<<18|(Pe&63)<<12|(_e&63)<<6|Ae&63,Oe>65535&&Oe<1114112&&(j=Oe))}}j===null?(j=65533,Te=1):j>65535&&(j-=65536,b.push(j>>>10&1023|55296),j=56320|j&1023),b.push(j),I+=Te}return Ut(b)}const _t=4096;function Ut(l){const d=l.length;if(d<=_t)return String.fromCharCode.apply(String,l);let m="",b=0;for(;b<d;)m+=String.fromCharCode.apply(String,l.slice(b,b+=_t));return m}function En(l,d,m){let b="";m=Math.min(l.length,m);for(let I=d;I<m;++I)b+=String.fromCharCode(l[I]&127);return b}function Ce(l,d,m){let b="";m=Math.min(l.length,m);for(let I=d;I<m;++I)b+=String.fromCharCode(l[I]);return b}function Be(l,d,m){const b=l.length;(!d||d<0)&&(d=0),(!m||m<0||m>b)&&(m=b);let I="";for(let x=d;x<m;++x)I+=ra[l[x]];return I}function Le(l,d,m){const b=l.slice(d,m);let I="";for(let x=0;x<b.length-1;x+=2)I+=String.fromCharCode(b[x]+b[x+1]*256);return I}v.prototype.slice=function(l,d){const m=this.length;l=~~l,d=d===void 0?m:~~d,l<0?(l+=m,l<0&&(l=0)):l>m&&(l=m),d<0?(d+=m,d<0&&(d=0)):d>m&&(d=m),d<l&&(d=l);const b=this.subarray(l,d);return Object.setPrototypeOf(b,v.prototype),b};function Ne(l,d,m){if(l%1!==0||l<0)throw new RangeError("offset is not uint");if(l+d>m)throw new RangeError("Trying to access beyond buffer length")}v.prototype.readUintLE=v.prototype.readUIntLE=function(l,d,m){l=l>>>0,d=d>>>0,m||Ne(l,d,this.length);let b=this[l],I=1,x=0;for(;++x<d&&(I*=256);)b+=this[l+x]*I;return b},v.prototype.readUintBE=v.prototype.readUIntBE=function(l,d,m){l=l>>>0,d=d>>>0,m||Ne(l,d,this.length);let b=this[l+--d],I=1;for(;d>0&&(I*=256);)b+=this[l+--d]*I;return b},v.prototype.readUint8=v.prototype.readUInt8=function(l,d){return l=l>>>0,d||Ne(l,1,this.length),this[l]},v.prototype.readUint16LE=v.prototype.readUInt16LE=function(l,d){return l=l>>>0,d||Ne(l,2,this.length),this[l]|this[l+1]<<8},v.prototype.readUint16BE=v.prototype.readUInt16BE=function(l,d){return l=l>>>0,d||Ne(l,2,this.length),this[l]<<8|this[l+1]},v.prototype.readUint32LE=v.prototype.readUInt32LE=function(l,d){return l=l>>>0,d||Ne(l,4,this.length),(this[l]|this[l+1]<<8|this[l+2]<<16)+this[l+3]*16777216},v.prototype.readUint32BE=v.prototype.readUInt32BE=function(l,d){return l=l>>>0,d||Ne(l,4,this.length),this[l]*16777216+(this[l+1]<<16|this[l+2]<<8|this[l+3])},v.prototype.readBigUInt64LE=At(function(l){l=l>>>0,kt(l,"offset");const d=this[l],m=this[l+7];(d===void 0||m===void 0)&&Ot(l,this.length-8);const b=d+this[++l]*2**8+this[++l]*2**16+this[++l]*2**24,I=this[++l]+this[++l]*2**8+this[++l]*2**16+m*2**24;return BigInt(b)+(BigInt(I)<<BigInt(32))}),v.prototype.readBigUInt64BE=At(function(l){l=l>>>0,kt(l,"offset");const d=this[l],m=this[l+7];(d===void 0||m===void 0)&&Ot(l,this.length-8);const b=d*2**24+this[++l]*2**16+this[++l]*2**8+this[++l],I=this[++l]*2**24+this[++l]*2**16+this[++l]*2**8+m;return(BigInt(b)<<BigInt(32))+BigInt(I)}),v.prototype.readIntLE=function(l,d,m){l=l>>>0,d=d>>>0,m||Ne(l,d,this.length);let b=this[l],I=1,x=0;for(;++x<d&&(I*=256);)b+=this[l+x]*I;return I*=128,b>=I&&(b-=Math.pow(2,8*d)),b},v.prototype.readIntBE=function(l,d,m){l=l>>>0,d=d>>>0,m||Ne(l,d,this.length);let b=d,I=1,x=this[l+--b];for(;b>0&&(I*=256);)x+=this[l+--b]*I;return I*=128,x>=I&&(x-=Math.pow(2,8*d)),x},v.prototype.readInt8=function(l,d){return l=l>>>0,d||Ne(l,1,this.length),this[l]&128?(255-this[l]+1)*-1:this[l]},v.prototype.readInt16LE=function(l,d){l=l>>>0,d||Ne(l,2,this.length);const m=this[l]|this[l+1]<<8;return m&32768?m|4294901760:m},v.prototype.readInt16BE=function(l,d){l=l>>>0,d||Ne(l,2,this.length);const m=this[l+1]|this[l]<<8;return m&32768?m|4294901760:m},v.prototype.readInt32LE=function(l,d){return l=l>>>0,d||Ne(l,4,this.length),this[l]|this[l+1]<<8|this[l+2]<<16|this[l+3]<<24},v.prototype.readInt32BE=function(l,d){return l=l>>>0,d||Ne(l,4,this.length),this[l]<<24|this[l+1]<<16|this[l+2]<<8|this[l+3]},v.prototype.readBigInt64LE=At(function(l){l=l>>>0,kt(l,"offset");const d=this[l],m=this[l+7];(d===void 0||m===void 0)&&Ot(l,this.length-8);const b=this[l+4]+this[l+5]*2**8+this[l+6]*2**16+(m<<24);return(BigInt(b)<<BigInt(32))+BigInt(d+this[++l]*2**8+this[++l]*2**16+this[++l]*2**24)}),v.prototype.readBigInt64BE=At(function(l){l=l>>>0,kt(l,"offset");const d=this[l],m=this[l+7];(d===void 0||m===void 0)&&Ot(l,this.length-8);const b=(d<<24)+this[++l]*2**16+this[++l]*2**8+this[++l];return(BigInt(b)<<BigInt(32))+BigInt(this[++l]*2**24+this[++l]*2**16+this[++l]*2**8+m)}),v.prototype.readFloatLE=function(l,d){return l=l>>>0,d||Ne(l,4,this.length),s.read(this,l,!0,23,4)},v.prototype.readFloatBE=function(l,d){return l=l>>>0,d||Ne(l,4,this.length),s.read(this,l,!1,23,4)},v.prototype.readDoubleLE=function(l,d){return l=l>>>0,d||Ne(l,8,this.length),s.read(this,l,!0,52,8)},v.prototype.readDoubleBE=function(l,d){return l=l>>>0,d||Ne(l,8,this.length),s.read(this,l,!1,52,8)};function Y(l,d,m,b,I,x){if(!v.isBuffer(l))throw new TypeError('"buffer" argument must be a Buffer instance');if(d>I||d<x)throw new RangeError('"value" argument is out of bounds');if(m+b>l.length)throw new RangeError("Index out of range")}v.prototype.writeUintLE=v.prototype.writeUIntLE=function(l,d,m,b){if(l=+l,d=d>>>0,m=m>>>0,!b){const j=Math.pow(2,8*m)-1;Y(this,l,d,m,j,0)}let I=1,x=0;for(this[d]=l&255;++x<m&&(I*=256);)this[d+x]=l/I&255;return d+m},v.prototype.writeUintBE=v.prototype.writeUIntBE=function(l,d,m,b){if(l=+l,d=d>>>0,m=m>>>0,!b){const j=Math.pow(2,8*m)-1;Y(this,l,d,m,j,0)}let I=m-1,x=1;for(this[d+I]=l&255;--I>=0&&(x*=256);)this[d+I]=l/x&255;return d+m},v.prototype.writeUint8=v.prototype.writeUInt8=function(l,d,m){return l=+l,d=d>>>0,m||Y(this,l,d,1,255,0),this[d]=l&255,d+1},v.prototype.writeUint16LE=v.prototype.writeUInt16LE=function(l,d,m){return l=+l,d=d>>>0,m||Y(this,l,d,2,65535,0),this[d]=l&255,this[d+1]=l>>>8,d+2},v.prototype.writeUint16BE=v.prototype.writeUInt16BE=function(l,d,m){return l=+l,d=d>>>0,m||Y(this,l,d,2,65535,0),this[d]=l>>>8,this[d+1]=l&255,d+2},v.prototype.writeUint32LE=v.prototype.writeUInt32LE=function(l,d,m){return l=+l,d=d>>>0,m||Y(this,l,d,4,4294967295,0),this[d+3]=l>>>24,this[d+2]=l>>>16,this[d+1]=l>>>8,this[d]=l&255,d+4},v.prototype.writeUint32BE=v.prototype.writeUInt32BE=function(l,d,m){return l=+l,d=d>>>0,m||Y(this,l,d,4,4294967295,0),this[d]=l>>>24,this[d+1]=l>>>16,this[d+2]=l>>>8,this[d+3]=l&255,d+4};function ce(l,d,m,b,I){nn(d,b,I,l,m,7);let x=Number(d&BigInt(4294967295));l[m++]=x,x=x>>8,l[m++]=x,x=x>>8,l[m++]=x,x=x>>8,l[m++]=x;let j=Number(d>>BigInt(32)&BigInt(4294967295));return l[m++]=j,j=j>>8,l[m++]=j,j=j>>8,l[m++]=j,j=j>>8,l[m++]=j,m}function we(l,d,m,b,I){nn(d,b,I,l,m,7);let x=Number(d&BigInt(4294967295));l[m+7]=x,x=x>>8,l[m+6]=x,x=x>>8,l[m+5]=x,x=x>>8,l[m+4]=x;let j=Number(d>>BigInt(32)&BigInt(4294967295));return l[m+3]=j,j=j>>8,l[m+2]=j,j=j>>8,l[m+1]=j,j=j>>8,l[m]=j,m+8}v.prototype.writeBigUInt64LE=At(function(l,d=0){return ce(this,l,d,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeBigUInt64BE=At(function(l,d=0){return we(this,l,d,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeIntLE=function(l,d,m,b){if(l=+l,d=d>>>0,!b){const Te=Math.pow(2,8*m-1);Y(this,l,d,m,Te-1,-Te)}let I=0,x=1,j=0;for(this[d]=l&255;++I<m&&(x*=256);)l<0&&j===0&&this[d+I-1]!==0&&(j=1),this[d+I]=(l/x>>0)-j&255;return d+m},v.prototype.writeIntBE=function(l,d,m,b){if(l=+l,d=d>>>0,!b){const Te=Math.pow(2,8*m-1);Y(this,l,d,m,Te-1,-Te)}let I=m-1,x=1,j=0;for(this[d+I]=l&255;--I>=0&&(x*=256);)l<0&&j===0&&this[d+I+1]!==0&&(j=1),this[d+I]=(l/x>>0)-j&255;return d+m},v.prototype.writeInt8=function(l,d,m){return l=+l,d=d>>>0,m||Y(this,l,d,1,127,-128),l<0&&(l=255+l+1),this[d]=l&255,d+1},v.prototype.writeInt16LE=function(l,d,m){return l=+l,d=d>>>0,m||Y(this,l,d,2,32767,-32768),this[d]=l&255,this[d+1]=l>>>8,d+2},v.prototype.writeInt16BE=function(l,d,m){return l=+l,d=d>>>0,m||Y(this,l,d,2,32767,-32768),this[d]=l>>>8,this[d+1]=l&255,d+2},v.prototype.writeInt32LE=function(l,d,m){return l=+l,d=d>>>0,m||Y(this,l,d,4,2147483647,-2147483648),this[d]=l&255,this[d+1]=l>>>8,this[d+2]=l>>>16,this[d+3]=l>>>24,d+4},v.prototype.writeInt32BE=function(l,d,m){return l=+l,d=d>>>0,m||Y(this,l,d,4,2147483647,-2147483648),l<0&&(l=4294967295+l+1),this[d]=l>>>24,this[d+1]=l>>>16,this[d+2]=l>>>8,this[d+3]=l&255,d+4},v.prototype.writeBigInt64LE=At(function(l,d=0){return ce(this,l,d,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),v.prototype.writeBigInt64BE=At(function(l,d=0){return we(this,l,d,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ze(l,d,m,b,I,x){if(m+b>l.length)throw new RangeError("Index out of range");if(m<0)throw new RangeError("Index out of range")}function ft(l,d,m,b,I){return d=+d,m=m>>>0,I||Ze(l,d,m,4),s.write(l,d,m,b,23,4),m+4}v.prototype.writeFloatLE=function(l,d,m){return ft(this,l,d,!0,m)},v.prototype.writeFloatBE=function(l,d,m){return ft(this,l,d,!1,m)};function pt(l,d,m,b,I){return d=+d,m=m>>>0,I||Ze(l,d,m,8),s.write(l,d,m,b,52,8),m+8}v.prototype.writeDoubleLE=function(l,d,m){return pt(this,l,d,!0,m)},v.prototype.writeDoubleBE=function(l,d,m){return pt(this,l,d,!1,m)},v.prototype.copy=function(l,d,m,b){if(!v.isBuffer(l))throw new TypeError("argument should be a Buffer");if(m||(m=0),!b&&b!==0&&(b=this.length),d>=l.length&&(d=l.length),d||(d=0),b>0&&b<m&&(b=m),b===m||l.length===0||this.length===0)return 0;if(d<0)throw new RangeError("targetStart out of bounds");if(m<0||m>=this.length)throw new RangeError("Index out of range");if(b<0)throw new RangeError("sourceEnd out of bounds");b>this.length&&(b=this.length),l.length-d<b-m&&(b=l.length-d+m);const I=b-m;return this===l&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(d,m,b):Uint8Array.prototype.set.call(l,this.subarray(m,b),d),I},v.prototype.fill=function(l,d,m,b){if(typeof l=="string"){if(typeof d=="string"?(b=d,d=0,m=this.length):typeof m=="string"&&(b=m,m=this.length),b!==void 0&&typeof b!="string")throw new TypeError("encoding must be a string");if(typeof b=="string"&&!v.isEncoding(b))throw new TypeError("Unknown encoding: "+b);if(l.length===1){const x=l.charCodeAt(0);(b==="utf8"&&x<128||b==="latin1")&&(l=x)}}else typeof l=="number"?l=l&255:typeof l=="boolean"&&(l=Number(l));if(d<0||this.length<d||this.length<m)throw new RangeError("Out of range index");if(m<=d)return this;d=d>>>0,m=m===void 0?this.length:m>>>0,l||(l=0);let I;if(typeof l=="number")for(I=d;I<m;++I)this[I]=l;else{const x=v.isBuffer(l)?l:v.from(l,b),j=x.length;if(j===0)throw new TypeError('The value "'+l+'" is invalid for argument "value"');for(I=0;I<m-d;++I)this[I+d]=x[I%j]}return this};const Ge={};function rt(l,d,m){Ge[l]=class extends m{constructor(){super(),Object.defineProperty(this,"message",{value:d.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${l}]`,this.stack,delete this.name}get code(){return l}set code(b){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:b,writable:!0})}toString(){return`${this.name} [${l}]: ${this.message}`}}}rt("ERR_BUFFER_OUT_OF_BOUNDS",function(l){return l?`${l} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),rt("ERR_INVALID_ARG_TYPE",function(l,d){return`The "${l}" argument must be of type number. Received type ${typeof d}`},TypeError),rt("ERR_OUT_OF_RANGE",function(l,d,m){let b=`The value of "${l}" is out of range.`,I=m;return Number.isInteger(m)&&Math.abs(m)>2**32?I=St(String(m)):typeof m=="bigint"&&(I=String(m),(m>BigInt(2)**BigInt(32)||m<-(BigInt(2)**BigInt(32)))&&(I=St(I)),I+="n"),b+=` It must be ${d}. Received ${I}`,b},RangeError);function St(l){let d="",m=l.length;const b=l[0]==="-"?1:0;for(;m>=b+4;m-=3)d=`_${l.slice(m-3,m)}${d}`;return`${l.slice(0,m)}${d}`}function Qt(l,d,m){kt(d,"offset"),(l[d]===void 0||l[d+m]===void 0)&&Ot(d,l.length-(m+1))}function nn(l,d,m,b,I,x){if(l>m||l<d){const j=typeof d=="bigint"?"n":"";let Te;throw x>3?d===0||d===BigInt(0)?Te=`>= 0${j} and < 2${j} ** ${(x+1)*8}${j}`:Te=`>= -(2${j} ** ${(x+1)*8-1}${j}) and < 2 ** ${(x+1)*8-1}${j}`:Te=`>= ${d}${j} and <= ${m}${j}`,new Ge.ERR_OUT_OF_RANGE("value",Te,l)}Qt(b,I,x)}function kt(l,d){if(typeof l!="number")throw new Ge.ERR_INVALID_ARG_TYPE(d,"number",l)}function Ot(l,d,m){throw Math.floor(l)!==l?(kt(l,m),new Ge.ERR_OUT_OF_RANGE(m||"offset","an integer",l)):d<0?new Ge.ERR_BUFFER_OUT_OF_BOUNDS:new Ge.ERR_OUT_OF_RANGE(m||"offset",`>= ${m?1:0} and <= ${d}`,l)}const Tn=/[^+/0-9A-Za-z-_]/g;function Cn(l){if(l=l.split("=")[0],l=l.trim().replace(Tn,""),l.length<2)return"";for(;l.length%4!==0;)l=l+"=";return l}function rn(l,d){d=d||1/0;let m;const b=l.length;let I=null;const x=[];for(let j=0;j<b;++j){if(m=l.charCodeAt(j),m>55295&&m<57344){if(!I){if(m>56319){(d-=3)>-1&&x.push(239,191,189);continue}else if(j+1===b){(d-=3)>-1&&x.push(239,191,189);continue}I=m;continue}if(m<56320){(d-=3)>-1&&x.push(239,191,189),I=m;continue}m=(I-55296<<10|m-56320)+65536}else I&&(d-=3)>-1&&x.push(239,191,189);if(I=null,m<128){if((d-=1)<0)break;x.push(m)}else if(m<2048){if((d-=2)<0)break;x.push(m>>6|192,m&63|128)}else if(m<65536){if((d-=3)<0)break;x.push(m>>12|224,m>>6&63|128,m&63|128)}else if(m<1114112){if((d-=4)<0)break;x.push(m>>18|240,m>>12&63|128,m>>6&63|128,m&63|128)}else throw new Error("Invalid code point")}return x}function rr(l){const d=[];for(let m=0;m<l.length;++m)d.push(l.charCodeAt(m)&255);return d}function ve(l,d){let m,b,I;const x=[];for(let j=0;j<l.length&&!((d-=2)<0);++j)m=l.charCodeAt(j),b=m>>8,I=m%256,x.push(I),x.push(b);return x}function qn(l){return a.toByteArray(Cn(l))}function on(l,d,m,b){let I;for(I=0;I<b&&!(I+m>=d.length||I>=l.length);++I)d[I+m]=l[I];return I}function Mt(l,d){return l instanceof d||l!=null&&l.constructor!=null&&l.constructor.name!=null&&l.constructor.name===d.name}function On(l){return l!==l}const ra=function(){const l="0123456789abcdef",d=new Array(256);for(let m=0;m<16;++m){const b=m*16;for(let I=0;I<16;++I)d[b+I]=l[m]+l[I]}return d}();function At(l){return typeof BigInt>"u"?Br:l}function Br(){throw new Error("BigInt not supported")}})(TS);var bS={exports:{}},Hn=bS.exports={},Gi,Qi;function QT(){throw new Error("setTimeout has not been defined")}function HT(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Gi=setTimeout:Gi=QT}catch{Gi=QT}try{typeof clearTimeout=="function"?Qi=clearTimeout:Qi=HT}catch{Qi=HT}})();function wS(n){if(Gi===setTimeout)return setTimeout(n,0);if((Gi===QT||!Gi)&&setTimeout)return Gi=setTimeout,setTimeout(n,0);try{return Gi(n,0)}catch{try{return Gi.call(null,n,0)}catch{return Gi.call(this,n,0)}}}function J$(n){if(Qi===clearTimeout)return clearTimeout(n);if((Qi===HT||!Qi)&&clearTimeout)return Qi=clearTimeout,clearTimeout(n);try{return Qi(n)}catch{try{return Qi.call(null,n)}catch{return Qi.call(this,n)}}}var Js=[],dp=!1,Uc,_y=-1;function Z$(){!dp||!Uc||(dp=!1,Uc.length?Js=Uc.concat(Js):_y=-1,Js.length&&SS())}function SS(){if(!dp){var n=wS(Z$);dp=!0;for(var a=Js.length;a;){for(Uc=Js,Js=[];++_y<a;)Uc&&Uc[_y].run();_y=-1,a=Js.length}Uc=null,dp=!1,J$(n)}}Hn.nextTick=function(n){var a=new Array(arguments.length-1);if(arguments.length>1)for(var s=1;s<arguments.length;s++)a[s-1]=arguments[s];Js.push(new ES(n,a)),Js.length===1&&!dp&&wS(SS)};function ES(n,a){this.fun=n,this.array=a}ES.prototype.run=function(){this.fun.apply(null,this.array)};Hn.title="browser";Hn.browser=!0;Hn.env={};Hn.argv=[];Hn.version="";Hn.versions={};function rl(){}Hn.on=rl;Hn.addListener=rl;Hn.once=rl;Hn.off=rl;Hn.removeListener=rl;Hn.removeAllListeners=rl;Hn.emit=rl;Hn.prependListener=rl;Hn.prependOnceListener=rl;Hn.listeners=function(n){return[]};Hn.binding=function(n){throw new Error("process.binding is not supported")};Hn.cwd=function(){return"/"};Hn.chdir=function(n){throw new Error("process.chdir is not supported")};Hn.umask=function(){return 0};var X$=bS.exports;(function(n){Object.defineProperty(n,Symbol.toStringTag,{value:"Module"});const a=TS,s=X$,f=g=>g&&g.__esModule?g:{default:g},u=f(s),y=globalThis||void 0||self;Object.defineProperty(n,"Buffer",{enumerable:!0,get:()=>a.Buffer}),Object.defineProperty(n,"process",{enumerable:!0,get:()=>u.default}),n.global=y})(It);class eG{}window.slStore=Object.create(null);const tG=(n,a)=>sR(n,a,{mount:({storeName:s})=>{window.slStore[s]||(window.slStore[s]={mounted:!0,history:[{type:"mount"}]}),window.slStore[s].store=n},unmount:({storeName:s})=>{var f;window.slStore[s].mounted=!1,(f=window.slStore[s])==null||f.history.push({type:"unmount"})},change:({actionName:s,storeName:f,changed:u,newValue:y,oldValue:g,valueMessage:v})=>{var E;(E=window.slStore[f])==null||E.history.push({type:"change",changed:u,newValue:y,oldValue:g,diff:g7({...g},{...y},{cyclesFix:!1}),actionName:s,valueMessage:v})},action:{start:({actionName:s,args:f,storeName:u})=>{var y;(y=window.slStore[u])==null||y.history.push({type:"action:start",actionName:s,args:f,storeName:u})},error:({actionName:s,error:f,storeName:u})=>{var y;(y=window.slStore[u])==null||y.history.push({type:"action:error",actionName:s,error:f})},end:({actionName:s,storeName:f})=>{var u;(u=window.slStore[f])==null||u.history.push({type:"action:end",actionName:s})}}});class u2{constructor(a,s){Z(this,"store");Z(this,"name");this.store=a,this.name=s,tG(this.store,this.name)}getStore(){return this.store}}const nG=n=>{const a=Object.keys(n);return h7(a.map(s=>n[s].getStore()),(...s)=>Object.fromEntries(a.map((f,u)=>[f,s[u]])))};class H1 extends u2{constructor(){super(...arguments);Z(this,"getValues",()=>this.getStore().get());Z(this,"getValue",s=>this.getStore().get()[s]);Z(this,"setValue",(s,f)=>this.getStore().setKey(s,f));Z(this,"subscribe",(...s)=>this.getStore().subscribe(...s));Z(this,"unsubscribe",()=>this.getStore().off())}}const iu=n=>RT(n);var Qs;(function(n){n.ORGANIZATION="ORGANIZATION",n.STREAM="STREAM"})(Qs||(Qs={}));const rG={[tr.BETTING]:"betting",[tr.GAMES]:"games",[tr.PUBLIC_CHAT]:"publicChat",[tr.TWITTER]:"twitter"};var fp;(function(n){n.Ready="ready",n.Suspended="suspended"})(fp||(fp={}));class NS{constructor({settings:a,...s},f){Z(this,"status");Z(this,"source");Z(this,"config");Z(this,"settings");Z(this,"listeners",new Set);Z(this,"settingsKey");Z(this,"enable",()=>{this.status.set(fp.Ready)});Z(this,"disable",()=>{this.status.set(fp.Suspended)});Z(this,"setFeatureConfig",({settings:a,...s})=>{var u;let f;for(f in s)this.config.setValue(f,s[f]);if(((u=a==null?void 0:a.overlaySettings)==null?void 0:u.case)!==void 0&&(a==null?void 0:a.overlaySettings.case)===this.settingsKey){const y=a.overlaySettings.value;if(y!==void 0){let g;for(g in y)y[g]!==0&&y[g]!==""&&this.settings.setValue(g,y[g])}}});Z(this,"update",(a,s)=>{this.source===Qs.STREAM&&s===Qs.ORGANIZATION||(this.setFeatureConfig(a),this.source=s)});this.settingsKey=rG[s.type],this.status=uu(fp.Suspended),this.config=new H1(iu(s),`feature:config:${this.settingsKey}`),this.settingsKey!==void 0&&(a==null?void 0:a.overlaySettings.case)===this.settingsKey?this.settings=new H1(iu(a.overlaySettings.value),`feature:settings:${this.settingsKey}`):this.settings=new H1(iu({}),`feature:settings:${this.settingsKey}`),this.source=f}get featureConfig(){return this.config.getStore()}get featureSettings(){return this.settings.getStore()}registerEventListener(a){this.listeners.add(a)}fireEvent(a){for(const s of this.listeners.values())try{s.onEvent(a)}catch(f){console.error(f)}}}class ri extends u2{constructor(){super(...arguments);Z(this,"getValue",()=>this.getStore().get());Z(this,"setValue",s=>this.getStore().set(s));Z(this,"subscribe",s=>this.getStore().subscribe(s));Z(this,"unsubscribe",()=>this.getStore().off())}getValues(){throw new Error("not implemented")}listen(s){return this.getStore().listen(s)}get(){return this.getStore().get()}}const Qa=n=>uu(n);class Ji extends u2{constructor(s,f,u){super(s,`api:${f}`);Z(this,"atomStore");Z(this,"getAtomStore",()=>this.atomStore);Z(this,"getValue",async()=>{const s=this.getStore();if(s.value===void 0)throw new Error("no store");return await s.value.promise,s.get().data});Z(this,"getValues",()=>{throw new Error("not implemented")});Z(this,"setValue",s=>this.getStore().set({loading:!1,data:s==null?void 0:s.data}));Z(this,"subscribe",s=>this.getStore().subscribe(s));Z(this,"unsubscribe",()=>{throw new Error("not implemented")});Z(this,"invalidate",()=>{this.store.invalidate()});Z(this,"listen",s=>this.getStore().listen(s));Z(this,"key",()=>this.getStore().key);Z(this,"off",()=>this.getStore().off());this.atomStore=uu(),u&&s.subscribe(y=>{const g=this.atomStore.get(),v=u(y,g);g!==v&&this.atomStore.set(v)})}get(){throw new Error("not implemented")}}async function*aG(n,a){for await(const s of a){n.response.message=s,n.received_at=Date.now();const f={type:"__GRPC_DEVTOOLS_EXTENSION__",data:n};window.postMessage(f),yield s}}const oG=()=>n=>async a=>{const s={name:a.url,stream:a.stream,sent_at:Date.now(),request:{header:Object.fromEntries(a.header.entries())},response:{}};try{const f=await n(a);if(s.received_at=Date.now(),s.response.header=Object.fromEntries(f.header.entries()),s.response.trailer=Object.fromEntries(f.trailer.entries()),a.stream){s.request.message=a.message;const u={type:"__GRPC_DEVTOOLS_EXTENSION__",data:{...s,stream:!1}};return window.postMessage(u),{...f,message:aG(s,f.message)}}else{s.request.message=a.message,s.response.message=f.message,s.latency=s.received_at-s.sent_at;const u={type:"__GRPC_DEVTOOLS_EXTENSION__",data:s};window.postMessage(u)}return f}catch(f){s.received_at=Date.now(),s.request.message=a.message,s.response.trailer={"grpc-status":f.code,"grpc-message":f.rawMessage},s.response.message=f.rawMessage,s.latency=s.received_at-s.sent_at;const u={type:"__GRPC_DEVTOOLS_EXTENSION__",data:s};throw window.postMessage(u),f}};window.dispatchEvent(new CustomEvent("grpc_devtools_loaded"));var ti;(function(n){n.Init="init",n.Ready="ready",n.Connecting="connecting",n.Connected="connected",n.Disconnected="disconnected",n.Failed="failed",n.Reconnect="reconnect",n.Reconnecting="reconnecting"})(ti||(ti={}));class iG{constructor(a,s,f,u){Z(this,"params");Z(this,"streamCancel");Z(this,"method");Z(this,"options");Z(this,"headers");Z(this,"listeners");Z(this,"state");Z(this,"store");Z(this,"paramsListener");Z(this,"reconnectTimeout");Z(this,"attempt",0);Z(this,"updateState",a=>{this.state.setValue("status",a),this.state.setValue("ts",new Date),this.addStateLog(`status => ${a}`)});Z(this,"addStateLog",a=>{const s=this.state.getStore().get().log;this.state.setValue("log",[...s,`${new Date().toLocaleString()}: ${a}`])});Z(this,"addListener",(a,s)=>this.listeners.has(a)?(this.addStateLog(`listener '${a}' not added, already exists`),!1):(this.listeners.set(a,s),this.addStateLog(`listener '${a}' added`),!0));Z(this,"removeListener",a=>{this.listeners.delete(a),this.addStateLog(`listener '${a}' removed`)});Z(this,"connect",()=>{this.updateState(ti.Connecting),this.streamCancel&&(this.addStateLog("disconnect prev connection"),this.streamCancel.abort(),this.streamCancel=void 0);const a="get"in this.params&&typeof this.params.get=="function"?this.params.get():this.params;(async()=>{this.streamCancel=new AbortController;try{const s={headers:this.headers.getValues(),signal:this.streamCancel.signal},f=this.method(a,s);for await(const u of f)this.attempt=0,this.onData(u)}catch(s){s instanceof nr&&s.code!=fn.Canceled&&this.onStreamError(s)}})(),this.updateState(ti.Connected)});Z(this,"disconnect",()=>{var a;this.streamCancel&&this.streamCancel.abort(),this.listeners.clear(),(a=this.paramsListener)==null||a.call(this),clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0,this.updateState(ti.Disconnected)});Z(this,"reconnect",()=>{if(this.reconnectTimeout)this.addStateLog("already reconnecting");else if(this.attempt<this.options.reconnectMaxAttempts){this.updateState(ti.Reconnect);const a=Math.min(this.options.reconnectMaxDelay,Math.pow(2,this.attempt)*this.options.reconnectDelay),s=Math.round(a*(1+Math.random())/2);this.reconnectTimeout=setTimeout(()=>{this.attempt++,this.updateState(ti.Reconnecting),this.addStateLog(`reconnect attempt ${this.attempt} after ${s}ms`),this.connect(),this.reconnectTimeout=void 0},s)}else this.addStateLog("max reconnect attempts reached"),this.disconnect()});Z(this,"getStore",()=>{var a;return(a=this.store)==null?void 0:a.getStore()});Z(this,"onData",a=>{try{this.addStateLog(`received data => ${JSON.stringify(a)}`),this.store&&this.store.setValue(a);for(const[,s]of this.listeners)s(a);this.addStateLog(`data routed to ${this.listeners.size} listeners`)}catch(s){this.addStateLog(`error process data => ${s}`)}});Z(this,"onStreamError",a=>{if(this.addStateLog(`error => ${a?JSON.stringify(a):"undefined"}}`),a!==void 0){if(a instanceof nr&&a.code!==fn.Canceled){this.updateState(ti.Failed),this.state.setValue("error",a),this.reconnect();return}this.disconnect()}});const y={status:ti.Init,ts:new Date,log:[]};this.state=new H1(iu(y),`subscription:${u.name}:state`),this.options={...u,reconnectDelay:u.reconnectDelay??1e3,reconnectMaxDelay:u.reconnectMaxDelay??3e4,reconnectMaxAttempts:u.reconnectMaxAttempts??10,withStore:u.withStore??!1},this.headers=a,this.listeners=new Map,this.params=f,this.method=s,u.withStore&&(this.store=new ri(Qa(null),`subscription:${u.name}:store`)),"subscribe"in f&&typeof f.subscribe=="function"&&(this.paramsListener=f.subscribe(g=>{this.state.getValue("status")===ti.Connected&&(this.addStateLog(`params updated, reconnect => ${JSON.stringify(g)}`),this.reconnect())})),this.updateState(ti.Ready)}}class sG{constructor(a){Z(this,"toJsonOptions",{emitDefaultValues:!1,enumAsInteger:!0,useProtoFieldName:!1});Z(this,"transport");Z(this,"nanoquery");Z(this,"host");Z(this,"interceptors",[]);Z(this,"$headers");Z(this,"clients");Z(this,"callbackClients");Z(this,"subscriptions");Z(this,"addSubscription",(a,s,f)=>{const u=this.subscriptions.get(s);if(u)return u;const y=new iG(this.$headers,a,s,f);return this.subscriptions.set(s,y),y});Z(this,"removeSubscription",a=>{a.disconnect(),this.subscriptions.delete(a.params)});Z(this,"disconnect",()=>{for(const[a,s]of this.subscriptions)s.disconnect(),this.subscriptions.delete(a)});Z(this,"registerInterceptor",a=>{this.interceptors.push(a)});Z(this,"removeInterceptor",a=>{this.interceptors=this.interceptors.filter(s=>s!==a)});Z(this,"getClient",a=>{const s=a.typeName;if(this.clients.has(s))return this.clients.get(s);const f=vB(a,this.transport);return this.clients.set(s,f),f});Z(this,"createPromiseClient",(a,{params:s=[],method:f})=>{const u=this.getClient(a),y=a.methods[f].name,g=[a.typeName,y.charAt(0).toLowerCase()+y.slice(1),...Array.isArray(s)?s:[s]],v=[a.typeName,y.charAt(0).toLowerCase()+y.slice(1)];return{client:u,queryKey:g,queryKeyStr:v.join("")}});Z(this,"createStreamClient",a=>({client:this.getClient(a)}));Z(this,"setSdkKey",a=>{this.$headers.setValue("sdk",a)});Z(this,"setAuth",(a,s)=>{this.$headers.setValue("authorization",a),this.$headers.setValue("sl-user-id",s)});Z(this,"setHeader",(a,s)=>this.$headers.setValue(a,s));Z(this,"getHeader",a=>this.$headers.getValue(a));Z(this,"getHeaders",()=>this.$headers.getValues());Z(this,"initInterceptors",()=>{if(this.interceptors.length!==0)return;const a=s=>f=>{const u=this.$headers.getValues();for(const y in u)f.header.set(y,u[y]);return s(f)};this.interceptors.push(a),this.interceptors.push(oG())});var y,g;this.host=a,this.$headers=new H1(iu({"sl-device-id":((g=(y=It.process)==null?void 0:y.env)==null?void 0:g.NX_DEVICE_ID)||"sdk-web-dev"}),"transport:headers"),this.initInterceptors(),this.clients=new Map,this.callbackClients=new Map,this.subscriptions=new Map;const[s,f,u]=YB();this.nanoquery={createFetcherStore:s,createMutatorStore:f,utils:u},this.transport=FB({baseUrl:a,interceptors:this.interceptors,useBinaryFormat:!0})}}const lG=(n,a)=>{const{client:s,queryKey:f}=a.createPromiseClient(iY,{method:"retrieveEventId",params:[n]});return a.nanoquery.createFetcherStore(f,{fetcher:async(u,y,g)=>{var v;if(!g||typeof g!="string")return"";try{return((v=(await s.retrieveEventId({id:g})).data)==null?void 0:v.id)||""}catch{return""}}})},uG=(n,a)=>{const{client:s,queryKey:f}=a.createPromiseClient(eh,{method:"getStream",params:[n]});return a.nanoquery.createFetcherStore(f,{fetcher:async(u,y,g)=>{var v;return g?(v=(await s.getStream({id:g})).data)==null?void 0:v.attributes:void 0}})},cG=(n,a)=>{const{queryKey:s,client:f}=a.createPromiseClient(hS,{method:"me",params:[n]});return a.nanoquery.createFetcherStore(s,{fetcher:()=>f.me({})})},dG=n=>{const{client:a}=n.createPromiseClient(hS,{method:"bypassAuth"});return({userKey:s,schema:f,init:u})=>a.bypassAuth({userKey:s,schema:f,init:u})},fG=(n,a)=>{const{client:s,queryKey:f}=a.createPromiseClient(eh,{method:"get",params:[n]});return a.nanoquery.createFetcherStore(f,{fetcher:async()=>{var u;return(u=(await s.get({})).data)==null?void 0:u.attributes}})},pG=(n,a)=>{const{client:s,queryKey:f}=a.createPromiseClient(eh,{method:"getOrganization",params:[n]});return a.nanoquery.createFetcherStore(f,{fetcher:async()=>{const u=await s.getOrganization({});return u.data?{...u.data.attributes,id:u.data.id}:void 0}})},mG=(n,a)=>{const{client:s,queryKey:f}=a.createPromiseClient(eh,{method:"getOrganizationAdvertising",params:[n]});return a.nanoquery.createFetcherStore(f,{fetcher:async()=>{var u;return(u=(await s.getOrganizationAdvertising({})).data)==null?void 0:u.attributes}})},hG=(n,a,s)=>{n.transport=new sG(a.host),n.sdk.host=n.transport.host,n.transport.setSdkKey(a.sdkKey),s()};class _6{constructor(a="main"){Z(this,"delimiter",":");Z(this,"prefix");Z(this,"clear",()=>{for(const a in window.localStorage)a.startsWith(this.prefix)&&window.localStorage.removeItem(a)});Z(this,"generateKey",a=>`${this.prefix}${this.delimiter}${a.join(this.delimiter)}`);Z(this,"write",(...a)=>{const s=a.pop()||"";window.localStorage.setItem(this.generateKey(a),s)});Z(this,"read",(...a)=>{const s=window.localStorage.getItem(this.generateKey(a));return s===null?void 0:s});Z(this,"remove",(...a)=>{window.localStorage.removeItem(this.generateKey(a))});this.prefix=`sl-sdk${this.delimiter}${a}`}}var Ys;(function(n){n.SCHEMA="schema",n.EXTERNAL_TOKEN="eToken",n.TOKEN="token"})(Ys||(Ys={}));class op extends _6{constructor(){super("user");Z(this,"setSchema",s=>{this.write(Ys.SCHEMA,s)});Z(this,"getSchema",()=>this.read(Ys.SCHEMA));Z(this,"setToken",s=>{this.write(Ys.TOKEN,s)});Z(this,"getToken",()=>this.read(Ys.TOKEN));Z(this,"setExternalToken",s=>{this.write(Ys.EXTERNAL_TOKEN,s)});Z(this,"getExternalToken",()=>this.read(Ys.EXTERNAL_TOKEN));Z(this,"removeToken",()=>{this.remove(Ys.TOKEN)})}}var Hs;(function(n){n.DISABLED="disabled",n.INITIALIZATION="initialization",n.READY="ready",n.FAILED="failed",n.SUSPENDED="suspended"})(Hs||(Hs={}));const gG=n=>{const a=new op,s=new ri(Qa(a.getExternalToken()),"userKey"),f=new ri(Qa(a.getToken()),"userToken"),u=new Ji(cG(f.getStore(),n),"user",({data:g,error:v,loading:E},_)=>{var L;if(!v)return(L=g==null?void 0:g.data)!=null&&L.id?g.data.id:E===!1?void 0:_}),y=new Ji(fG(f.getStore(),n),"userSettings");return{userKey:s,userToken:f,user:u,userSettings:y}},yG=n=>{const a=new ri(Qa(void 0),"providerStreamId"),s=new Ji(lG(a.getStore(),n),"slStreamId",u=>u==null?void 0:u.data),f=new Ji(uG(s.getAtomStore(),n),"streamSettings");return s.getAtomStore().listen(u=>{(u===""||u===void 0)&&f.getStore().mutate(void 0)}),{providerStreamId:a,slStreamId:s,streamSettings:f}},vG=n=>{const a=new ri(Qa(void 0),"enabled"),s=new ri(Qa(Hs.DISABLED),"status"),f=new Ji(pG(a.getStore(),n),"organizationSettings",v=>{var E;return(E=v==null?void 0:v.data)==null?void 0:E.id}),u=new Ji(mG(f.getAtomStore(),n),"organizationAdvertising"),y=gG(n),g=yG(n);return{enabled:a,status:s,providerStreamId:g.providerStreamId,slStreamId:g.slStreamId,streamSettings:g.streamSettings,user:y.user,userKey:y.userKey,userToken:y.userToken,userSettings:y.userSettings,organizationSettings:f,organizationAdvertising:u}};class TG extends u2{constructor(s){const f=vG(s),u=nG(f);super(u,"core");Z(this,"stores");Z(this,"subscribe",s=>{let f;for(f in this.stores){const u=s[f];f in s&&u!==void 0&&this.stores[f].subscribe(s[f])}});Z(this,"unsubscribe",()=>this.getStore().off());this.stores=f}getValue(){throw new Error("Not implemented")}getValues(){return this.stores}setValue(){throw new Error("Not implemented")}}class kG extends eG{constructor(s,f){super();Z(this,"$coreStore");Z(this,"transport");Z(this,"bypassLogin");Z(this,"me",async()=>{var s;return this.$coreStore.getValues().user.invalidate(),(s=await this.$coreStore.getValues().user.getValue())==null?void 0:s.data});Z(this,"login",async(s,f)=>{var v,E;this.$coreStore.getValues().userKey.setValue(f);const u=await this.bypassLogin({schema:s,userKey:f,init:!1}),y=(v=u.meta)==null?void 0:v.jwt,g=(E=u.data)==null?void 0:E.id;if(!y||!g)throw new Error("internal: token missing");return this.$coreStore.getValues().user.getStore().mutate(u),this.saveUser(y,g),y});Z(this,"isAuthenticated",()=>this.me());Z(this,"logout",()=>{this.$coreStore.getValues().user.setValue(),this.$coreStore.getValues().userKey.setValue(),this.$coreStore.getValues().userToken.setValue(),this.transport.setAuth("",""),new op().clear()});Z(this,"softLogout",()=>{const s=new op;this.transport.setAuth("",""),s.setToken(""),this.reLogin()});Z(this,"reLogin",()=>{const s=new op,f=s.getToken(),u=s.getExternalToken();if(this.$coreStore.getValues().userKey.setValue(u),f)return this.saveUser(f,""),this.me().then(y=>{if(y!=null&&y.id){const g=y.id;this.saveUser(f,g)}});if(u&&!f){const y=s.getSchema();y&&u&&this.login(y,u).catch(()=>{this.logout()})}});Z(this,"saveUser",(s,f)=>{this.transport.setAuth(s,f),this.$coreStore.getValues().userToken.setValue(s),new op().setToken(s)});Z(this,"connect",()=>{this.transport.registerInterceptor(s=>async f=>{try{return await s(f)}catch(u){throw u.code&&(u.code===7||u.code===16)&&this.transport.getHeader("authorization")&&this.softLogout(),u}})});this.$coreStore=s,this.transport=f,this.bypassLogin=dG(this.transport),this.connect()}}const Y1=new op,bG=(n,a,s)=>{n.auth=new kG(n.store,n.transport),n.stores.status.listen(f=>{f===Hs.READY&&n.auth.reLogin()}),n.sdk.userId=n.stores.user.getAtomStore,n.sdk.authorizationBypass=async(f,u)=>{if(!(Y1.getSchema()===f&&Y1.getExternalToken()===u&&n.transport.getHeader("authorization")))try{await n.auth.login(f,u),Y1.setSchema(f),Y1.setExternalToken(u)}catch{n.sdk.logout()}},n.sdk.logout=()=>{n.auth.logout(),Y1.clear()},n.sdk.getUserStore=()=>n.stores.user.getStore(),n.sdk.isUserAuthorized=()=>n.auth.isAuthenticated(),s()},wG=(n,a,s)=>{n.store=new TG(n.transport),n.stores=n.store.getValues(),n.sdk.enabled=n.stores.enabled.getStore(),n.sdk.status=n.stores.status.getStore(),n.sdk.sdkStore=Object.fromEntries(Object.entries(n.stores).map(([f,u])=>[f,u.getStore()])),n.sdk.organizationStore=()=>n.stores.organizationSettings.getStore(),n.sdk.streamStore=()=>n.stores.streamSettings.getStore(),n.storeUnsubscribe=()=>{n.store.unsubscribe()},s()},SG=(n,a,s)=>{n.sdk=Object.create(null),n.sdk.initializeApp=async f=>{if(n.contextConfig=f,n.stores.enabled.get()==="on")return{enabled:!0};n.storeSubscribe(),n.stores.enabled.setValue("on"),n.stores.status.setValue(Hs.INITIALIZATION);try{const u=await n.stores.organizationSettings.getValue();return u?(n.stores.status.setValue(Hs.READY),{enabled:!!u}):(n.stores.status.setValue(Hs.FAILED),{err:"failed"})}catch(u){return n.stores.enabled.setValue(),n.stores.status.setValue(Hs.FAILED),{err:`${u}`}}},n.sdk.disableApp=()=>{n.stores.enabled.get()==="on"&&(n.stores.enabled.setValue(),n.stores.status.setValue(Hs.DISABLED),n.sdk.closeFeature(!0),n.storeUnsubscribe(),n.transport.disconnect())},n.sdk.createEventSession=f=>{n.stores.providerStreamId.setValue(f)},s()},EG=C7({level:"trace",enabled:!1,browser:{write:n=>{console.log(n)}}}),MS=(n,a)=>EG.child({name:n},a),NG=(n,a,s)=>{const{client:f,queryKey:u}=s.createPromiseClient(yS,{method:"summary",params:[n,a]});return s.nanoquery.createFetcherStore(u,{fetcher:async(y,g,v,E)=>{var _;return(_=(await f.summary({eventId:v,userId:E})).data)==null?void 0:_.attributes}})},MG=n=>{const{client:a}=n.createPromiseClient(yS,{method:"list"});return s=>a.list(s)},IG=(n,a)=>{const{client:s,queryKey:f}=a.createPromiseClient(nl,{method:"get",params:[n]});return a.nanoquery.createFetcherStore(f,{fetcher:async(u,y,g)=>{var v;return(v=(await s.get({eventId:g})).data)==null?void 0:v.attributes}})},_G=(n,a)=>{const{client:s,queryKey:f}=a.createPromiseClient(nl,{method:"syncQuestion",params:[n]});return a.nanoquery.createFetcherStore(f,{fetcher:async(u,y,g)=>{var v;return g?(v=(await s.syncQuestion({filter:{eventId:g}})).data)==null?void 0:v.attributes:void 0}})},CG=(n,a)=>{const{client:s}=a.createStreamClient(nl),f=uu({eventId:n.get()||"",feedId:""});return n.subscribe((u="")=>{f.set({eventId:u,feedId:""})}),a.addSubscription(s.subscription,f,{name:"feedSubscription"})},OG=(n,a)=>{const{client:s}=a.createStreamClient(nl);return a.addSubscription(s.questionSubscription,{questionId:n},{name:"questionSubscription"})},IS=async(n,a)=>{var f,u;const{client:s}=a.createPromiseClient(nl,{method:"questionByUser",params:[n]});return(u=(f=(await s.questionByUser({questionId:n})).data)==null?void 0:f.attributes)==null?void 0:u.question},AG=(n,a)=>{const{client:s,queryKey:f}=a.createPromiseClient(nl,{method:"list",params:[n]});return a.nanoquery.createFetcherStore(f,{fetcher:async(u,y,g)=>g?(await s.list({eventId:g,filter:{statuses:[lo.ACTIVE,lo.RESOLVED]}})).data:[]})};var C6={exports:{}};const xG=Object.getPrototypeOf({});function O6(n){function a(Q){return Q!=="constructor"&&Q!=="prototype"&&Q!=="__proto__"}function s(Q){let se=0;const ee=Q.length,ue=new Array(ee);for(se=0;se<ee;++se)ue[se]=U(Q[se]);return ue}function f(Q){const se={};if(E&&Object.getPrototypeOf(Q)!==xG)return E(Q);const ee=v(Q);let ue,J,ye;for(ue=0,J=ee.length;ue<J;++ue)a(ye=ee[ue])&&(se[ye]=U(Q[ye]));return se}function u(Q,se){const ee=Q.length,ue=se.length;let J=0;const ye=new Array(ee+ue);for(J=0;J<ee;++J)ye[J]=U(Q[J]);for(J=0;J<ue;++J)ye[J+ee]=U(se[J]);return ye}const y=Object.prototype.propertyIsEnumerable;function g(Q){const se=Object.keys(Q),ee=Object.getOwnPropertySymbols(Q);for(let ue=0,J=ee.length;ue<J;++ue)y.call(Q,ee[ue])&&se.push(ee[ue]);return se}const v=n&&n.symbols?g:Object.keys,E=typeof(n==null?void 0:n.cloneProtoObject)=="function"?n.cloneProtoObject:void 0;function _(Q){return typeof Q=="object"&&Q!==null&&!(Q instanceof RegExp)&&!(Q instanceof Date)}function L(Q){return typeof Q!="object"||Q===null}const R=typeof It.Buffer<"u"?Q=>typeof Q!="object"||Q===null||Q instanceof RegExp||Q instanceof Date||Q instanceof It.Buffer:Q=>typeof Q!="object"||Q===null||Q instanceof RegExp||Q instanceof Date,A=n&&typeof n.mergeArray=="function"?n.mergeArray({clone:U,deepmerge:G,getKeys:v,isMergeableObject:_}):u;function U(Q){return _(Q)?Array.isArray(Q)?s(Q):f(Q):Q}function V(Q,se){const ee={},ue=v(Q),J=v(se);let ye,fe,Ue;for(ye=0,fe=ue.length;ye<fe;++ye)a(Ue=ue[ye])&&J.indexOf(Ue)===-1&&(ee[Ue]=U(Q[Ue]));for(ye=0,fe=J.length;ye<fe;++ye)a(Ue=J[ye])&&(Ue in Q&&(ue.indexOf(Ue)!==-1&&(ee[Ue]=G(Q[Ue],se[Ue])),!0)||(ee[Ue]=U(se[Ue])));return ee}function G(Q,se){const ee=Array.isArray(se),ue=Array.isArray(Q);return L(se)?se:R(Q)?U(se):ee&&ue?A(Q,se):ee!==ue?U(se):V(Q,se)}function ae(){switch(arguments.length){case 0:return{};case 1:return U(arguments[0]);case 2:return G(arguments[0],arguments[1])}let Q;for(let se=0,ee=arguments.length;se<ee;++se)Q=G(Q,arguments[se]);return Q}return n&&n.all?ae:G}C6.exports=O6;C6.exports.default=O6;var LG=C6.exports.deepmerge=O6;const RG=n=>(a,s)=>{let f=0;const u=a.length,y=s.length,g=Math.max(u,y),v=new Array(g);for(f=0;f<g;++f)f<y?v[f]=n.deepmerge(a[f],s[f]):v[f]=n.clone(a[f]);return v},DG=LG({mergeArray:RG}),UG=(n,a,s)=>{const f=h7([a,s],(y,g)=>{if(y){if(g.data)return g.data.find(v=>v.id===y);console.error("Feed list is not loaded yet. Issue with the opened question.")}}),u=iu({data:void 0,loading:void 0,error:void 0});return f.subscribe(async y=>{if(y&&y.type==="question"){u.setKey("loading",!0);const g=await IS(y.id,n);u.set({data:g,loading:!1});return}u.set({data:void 0,loading:!1})}),{$store:f,$extendedStore:u,updateExtendedQuestion:y=>{const g=u.get().data;if(g)for(const v of(y==null?void 0:y.answers)||[])v.youVoted!==!0&&delete v.youVoted;u.set({data:DG(g,y)})}}};class PG{constructor(a){Z(this,"slStreamId");Z(this,"organizationId");Z(this,"userId");Z(this,"openedQuestionId");Z(this,"openedQuestion");Z(this,"activeQuestionId");Z(this,"feedList");Z(this,"moderationId");Z(this,"moderation");Z(this,"feedSubscription");Z(this,"questionSubscription");Z(this,"notifications");Z(this,"log");Z(this,"getCurrentSessionId",a=>{const s=a.eventId||this.slStreamId.get()||"",f=a.userId||this.userId.get()||"",u=a.organizationId||this.organizationId.get()||"",y=a.entity||"",g=a.prefix||"";return[u,s,f,g,y].join(":")});Z(this,"disconnect",()=>{var a;(a=this.feedSubscription)==null||a.disconnect()});Z(this,"openQuestion",a=>{this.openedQuestionId.set(a),this.notifications.markAsViewed(this.getCurrentSessionId({prefix:"notification",entity:a}))});Z(this,"closeQuestion",a=>{this.openedQuestionId.set(void 0),a&&this.notifications.markAsViewed(this.getCurrentSessionId({prefix:"notification",entity:a}))});this.log=MS("gamification-background"),this.slStreamId=a.stores.slStreamId.getAtomStore(),this.organizationId=a.stores.organizationSettings.getAtomStore(),this.userId=a.stores.user.getAtomStore(),this.moderationId=new ri(Qa(void 0),"moderationId").getStore(),this.openedQuestionId=new ri(Qa(void 0),"openedQuestionId").getStore(),this.notifications=a.notifications,this.moderation=new Ji(IG(this.slStreamId,a.transport),"gamification:moderation"),this.feedList=new Ji(AG(this.slStreamId,a.transport),"gamification:feedList"),this.activeQuestionId=new Ji(_G(this.slStreamId,a.transport),"gamification:activeQuestionId"),this.openedQuestion=UG(a.transport,this.openedQuestionId,this.feedList.getStore()),this.openedQuestionId.listen(s=>{this.log.debug({questionId:s},"received question"),s?(this.questionSubscription=OG(s,a.transport),this.questionSubscription.addListener("feed-subscription-opened-question",f=>{window.requestAnimationFrame(()=>{var u,y;this.openedQuestion.updateExtendedQuestion((y=(u=f.data)==null?void 0:u.attributes)==null?void 0:y.question)})}),this.questionSubscription.connect()):(this.log.info("cleanup on close question"),this.questionSubscription!==void 0&&(a.transport.removeSubscription(this.questionSubscription),this.questionSubscription=void 0))}),this.feedSubscription=CG(this.slStreamId,a.transport),this.feedSubscription.addListener("feed-subscription-active-question",s=>{window.requestAnimationFrame(()=>{var u;const f=this.activeQuestionId.getStore();f&&f.mutate((u=s.data)==null?void 0:u.attributes)})}),this.feedSubscription.connect()}}class jG{constructor(a){Z(this,"notificationsList");Z(this,"notifications");Z(this,"store");Z(this,"timeouts");Z(this,"waitingQueue");Z(this,"activeQueue");Z(this,"options");Z(this,"logger");Z(this,"addToQueue",a=>{if(this.store.has(a.id)){this.logger.debug({notification:a},"skip existed notification: %o");return}const s=a.close,f=a.action;if(this.store.set(a.id,{...a,close:(...u)=>{s&&s(...u),this.closeNotification(a.id)},action:(...u)=>{f&&f(...u),this.closeNotification(a.id)}}),this.waitingQueue.add(a.id),this.activeQueue.size===this.options.concurrency){const[u]=this.activeQueue;this.closeNotification(u)}else this.tickWaitingQueue()});Z(this,"tickWaitingQueue",()=>{if(this.activeQueue.size<this.options.concurrency){const[a]=this.waitingQueue;if(!a)return;this.activeQueue.add(a),this.waitingQueue.delete(a),this.logger.debug({job:a},"waiting queue tick"),this.tickActiveQueue(a)}else this.logger.debug({queueSize:this.activeQueue.size,concurrency:this.options.concurrency},"waiting queue tick skipped")});Z(this,"tickActiveQueue",a=>{if(!a)return;const s=this.store.get(a);if(!s){this.logger.debug({notificationId:a},"active queue tick skipped, notification not exist");return}const f=setTimeout(()=>{const u=a,y=new Map(this.notifications.getValue());y.set(s.id,s),this.notifications.setValue(y);const g=setTimeout(()=>{this.logger.debug({notificationId:u,delay:s.autoHideDuration||5e3},"notification hiding by autoHideDuration"),this.closeNotification(u)},s.autoHideDuration||5e3);this.timeouts.set(u,g),this.logger.debug({notificationId:u,queue:[...y.values()]},"notification displayed")},s.delay||0);this.timeouts.set(a,f),this.logger.debug({notificationId:a},"active queue tick completed"),this.tickWaitingQueue()});Z(this,"closeNotification",a=>{const s=new Map(this.notifications.getValue()),f=s.get(a);if(f){f.hiding=!(this.waitingQueue.size>=this.options.concurrency),this.notifications.setValue(s);const u=setTimeout(()=>{const y=new Map(this.notifications.getValue());y.delete(a),this.notifications.setValue(y);const g=this.timeouts.get(a);g!==void 0&&(clearTimeout(g),this.timeouts.delete(a)),this.logger.debug({notificationId:a},"notification hidden")},this.options.animationDelay||0);this.timeouts.set(a,u)}this.store.delete(a),this.activeQueue.delete(a),this.waitingQueue.delete(a),this.tickWaitingQueue(),this.logger.debug({notificationId:a},"notification hiding")});this.options=a,this.logger=MS("notifications"),this.store=new Map,this.timeouts=new Map,this.waitingQueue=new Set,this.activeQueue=new Set,this.notifications=new ri(Qa(new Map),"notifications-queue"),this.notificationsList=this.notifications.getStore()}}var By;(function(n){n.OPENED="opened"})(By||(By={}));class zG extends _6{constructor(){super("notification");Z(this,"setOpened",s=>{this.write(By.OPENED,s,"true")});Z(this,"isOpened",s=>this.read(By.OPENED,s));Z(this,"clearNotification",()=>{this.clear()})}}var Pc;(function(n){n[n.ONBOARDING=1]="ONBOARDING",n[n.QUESTION=2]="QUESTION",n[n.QUESTION_RESOLVED=3]="QUESTION_RESOLVED"})(Pc||(Pc={}));class BG{constructor(a={}){Z(this,"queue");Z(this,"storage");Z(this,"add",a=>{this.storage.isOpened(a.id)||this.queue.addToQueue(a)});Z(this,"close",a=>{this.queue.closeNotification(a),this.markAsViewed(a)});Z(this,"getQueueStore",()=>this.queue.notificationsList);Z(this,"markAsViewed",a=>{this.storage.setOpened(a)});this.storage=new zG,this.queue=new jG({concurrency:1,animationDelay:1600,...a})}}const FG=(n,a,s)=>{n.notifications=new BG,n.addNotification=n.notifications.add,n.sdk.getNotificationsStore=()=>n.notifications.getQueueStore(),s()},VG=(n,a)=>{const{client:s}=n.createPromiseClient(nl,{method:"submitAnswer"});return s.submitAnswer({data:a})},YG=(n,a)=>{const{client:s}=n.createPromiseClient(nl,{method:"submitInplay"});return s.submitInplay({data:{eventId:+a}})},$G=(n,a)=>{const{client:s}=n.createPromiseClient(nl,{method:"skipQuestion"});return s.skipQuestion({data:{id:a}})};var Fy;(function(n){n.ONBOARDING="onboarding"})(Fy||(Fy={}));class _S extends _6{constructor(){super("gamification");Z(this,"saveOnboardingStatus",({userId:s,eventId:f,organizationId:u},y)=>{this.write(Fy.ONBOARDING,u,s,f,y)});Z(this,"getOnboardingStatus",({userId:s,eventId:f,organizationId:u})=>this.read(Fy.ONBOARDING,u,s,f))}}const sw={pageSize:10},GG=(n,a,s)=>{let f=0;const u=Qa({pageSize:(s==null?void 0:s.pageSize)||sw.pageSize,page:0}),y=iu({data:[],hasMore:!0,loading:void 0,error:void 0}),g=MG(n),v=async L=>{if(L){y.setKey("loading",!0);const R={eventId:L,pagination:{page:0,pageSize:(s==null?void 0:s.pageSize)||sw.pageSize}},A=await g(R);y.set({data:A.data.map(U=>U.attributes),hasMore:!0,loading:!1}),A.meta&&(f=Math.round(A.meta.count/A.meta.pageSize)),u.set(R.pagination)}},E=()=>{v(a.get())},_=L=>{const R=u.get(),A=L||R.page+1;A<=f&&u.set({...R,page:A})};return e2(y,()=>{const L=a.listen(v),R=u.listen(async A=>{const U=a.get();if(A.page>0&&U)if(A.page<f){y.setKey("loading",!0);const V=await g({eventId:U,pagination:A}),G=y.get().data||[];y.set({data:[...G,...V.data.map(ae=>ae.attributes)],loading:!1,hasMore:!0})}else y.setKey("hasMore",!1)});return()=>{L(),R()}}),{$store:y,fetchMore:_,invalidate:E}},QG=(n,a)=>{const{client:s,queryKey:f}=n.createPromiseClient(eh,{method:"generateDeepLink",params:a});return n.nanoquery.createFetcherStore(f,{fetcher:async(u,y,g)=>{var v;return g?(v=(await s.generateDeepLink({data:{eventId:g}})).data)==null?void 0:v.attributes:{}}})},HG=(n,{web:a,mobile:s})=>{const{client:f}=n.createPromiseClient(F$,{method:"generate"});return f.generate({web:a,mobile:s})},qG=(n,a,s)=>{const f=iu({});return e2(f,()=>QG(n,[a]).subscribe(async({data:u})=>{var g;const y=u==null?void 0:u.url;if(y){f.setKey("loading",!0);const v=`${window.location.host+window.location.pathname}%23sl_eid=${a.get()}&sl_uid=${s.get()}`,E=await HG(n,{web:v,mobile:y});f.set({data:(g=E.data)==null?void 0:g.link,loading:!1})}})),{$store:f,fetch}};var Pr;(function(n){n.Unset="unset",n.Required="required",n.Optional="optional",n.Completed="completed",n.Disabled="disabled",n.Unavailable="unavailable"})(Pr||(Pr={}));const WG=(n,a,s,f)=>{const u=new _S,y=Qa(Pr.Unset),g=()=>{const{inplayGame:E}=n.featureSettings.get(),_=a.getCurrentSessionId({prefix:"onboarding"});E&&f.add({type:Pc.ONBOARDING,id:_,action:n.openFeature,close:()=>{f.markAsViewed(_)},delay:1e3,autoHideDuration:1e6,data:{questionType:Jt.UNSET,onboarding:{...E}}})};y.subscribe(E=>{(E===Pr.Optional||Pr.Required)&&g(),E===Pr.Completed&&a.activeQuestionId.invalidate()});const v=async()=>{var A,U,V,G,ae;const E=a.userId.get();if(!E){y.set(Pr.Unset);return}u.getOnboardingStatus({userId:E,organizationId:a.organizationId.get()||"",eventId:a.slStreamId.get()||""})===Pr.Completed&&y.set(Pr.Completed);const _=await a.moderation.getValue();if(y.get()===Pr.Completed)return;const L=!!((A=_==null?void 0:_.options)!=null&&A.onboardingEnabled&&((V=(U=n.featureSettings.get().inplayGame)==null?void 0:U.onboarding)!=null&&V.completed)),R=!!((ae=(G=n.featureSettings.get().inplayGame)==null?void 0:G.titleCard)!=null&&ae.optIn);L?R?y.set(Pr.Required):y.set(Pr.Optional):R?y.set(Pr.Unavailable):y.set(Pr.Disabled)};return v(),a.userId.subscribe(E=>{E&&v()}),a.moderation.subscribe(E=>{E.data&&v()}),{$store:y,submitInplay:async()=>{const E=a.slStreamId.get();if(E){await YG(s,E),y.set(Pr.Completed),u.saveOnboardingStatus({organizationId:a.organizationId.get()||"",userId:a.userId.get()||"",eventId:E},Pr.Completed);const _=a.getCurrentSessionId({prefix:"onboarding"});f.close(_)}}}},KG=new Set([Jt.POLL,Jt.PREDICTION,Jt.TRIVIA]);class JG extends NS{constructor(s,f,u){super(s,f);Z(this,"userSummary");Z(this,"feedList");Z(this,"leaderboardId");Z(this,"leaderboardList");Z(this,"deepLink");Z(this,"onboardingStatus");Z(this,"openedQuestion");Z(this,"currentUserId");Z(this,"openedUser");Z(this,"closeFeature");Z(this,"openFeature");Z(this,"notifications");Z(this,"transport");Z(this,"background");Z(this,"storage");Z(this,"connect",s=>{this.userSummary.invalidate(),this.leaderboardList.invalidate(),this.feedList.invalidate(),this.background.feedSubscription.addListener("feed-subscription-prediction-close",f=>{window.requestAnimationFrame(async()=>{var E,_;const u=(_=(E=f.data)==null?void 0:E.attributes)==null?void 0:_.question;if(!u)return;const{status:y,type:g,id:v}=u;if(y===lo.RESOLVED&&g===Jt.PREDICTION){const L=this.background.getCurrentSessionId({prefix:`notification-id:${v}`}),R=await IS(v,s),A=R==null?void 0:R.answers.find(({correct:V})=>V),U=R==null?void 0:R.answers.find(({youVoted:V})=>V);if(!U)return;this.notifications.add({type:Pc.QUESTION_RESOLVED,action:()=>this.openQuestion(v),close:()=>this.closeQuestion(v),autoHideDuration:35e3,id:L,data:{questionType:Jt.PREDICTION,question:{title:A!=null&&A.youVoted?`Congratulations! You answered correctly! You won ${A.points} pts!`:`Better luck next time! Correct: ${A==null?void 0:A.text}!`,votedAnswer:{title:U==null?void 0:U.text,points:U==null?void 0:U.points},correctAnswerTitle:A==null?void 0:A.text,correct:A==null?void 0:A.youVoted,predictionResult:y===lo.RESOLVED,questionTitle:R==null?void 0:R.subject}}}),this.userSummary.invalidate()}})}),this.background.feedSubscription.addListener("feed-subscription-questions-list",()=>{window.requestAnimationFrame(()=>{var f;(f=this.feedList)==null||f.invalidate()})})});Z(this,"disconnect",()=>{this.background.feedSubscription.removeListener("feed-subscription-questions-list")});Z(this,"submitAnswer",async(s,f)=>{await VG(this.transport,{questionId:s,answerId:f}),this.feedList.invalidate(),this.userSummary.invalidate()});Z(this,"skipQuestion",async s=>{await $G(this.transport,s),this.feedList.invalidate(),this.userSummary.invalidate()});Z(this,"openQuestion",s=>(this.openFeature(),this.background.openQuestion(s)));Z(this,"closeQuestion",s=>this.background.closeQuestion(s));Z(this,"openUser",s=>{var u;const f=(u=this.leaderboardList.$store.get().data)==null?void 0:u.find(y=>y.userId===s);this.openedUser.set(f)});Z(this,"closeUser",()=>{this.openedUser.set(void 0)});this.background=new PG(u),this.storage=new _S,this.userSummary=new Ji(NG(this.background.slStreamId,this.background.userId,u.transport),"gamification:userSummary"),this.feedList=this.background.feedList,this.currentUserId=this.background.userId,this.openedUser=Qa(void 0),this.leaderboardId=new ri(Qa(this.settings.getValue("pinnedLeaderboardId")),"pinnedLeaderboardId").getStore(),this.onboardingStatus=WG(this,this.background,u.transport,u.notifications),this.notifications=u.notifications,this.transport=u.transport,this.closeFeature=()=>u.sdk.closeFeature(!0),this.openFeature=()=>u.sdk.openFeature(tr.GAMES),this.openedQuestion=this.background.openedQuestion,this.deepLink=qG(this.transport,this.background.slStreamId,this.background.userId),this.leaderboardList=GG(this.transport,this.background.slStreamId),this.status.subscribe(y=>{y===fp.Ready?this.connect(u.transport):this.disconnect()}),this.background.activeQuestionId.listen(y=>{var v,E,_,L,R,A,U,V,G,ae,Q,se;const g=this.onboardingStatus.$store.get();if(y&&y.data&&g&&((v=y.data.question)==null?void 0:v.id)!==void 0&&y.data.question.notification!==void 0&&((_=(E=y.data.question)==null?void 0:E.bypassNotifications)==null?void 0:_.inAppSilence)!==Xw.ON&&y.data.question.status===lo.ACTIVE){if(KG.has(y.data.question.type)){const ee=(R=(L=this.settings.getValues().inplayGame)==null?void 0:L.titleCard)==null?void 0:R.optIn,ue=g===Pr.Completed;ee!==void 0&&(!ee||ue)&&this.notifications.add({type:Pc.QUESTION,action:()=>{var J;return((J=y.data)==null?void 0:J.question)&&this.openQuestion(y.data.question.id)},close:()=>{var J;return((J=y.data)==null?void 0:J.question)&&this.closeQuestion(y.data.question.id)},autoHideDuration:1e3*60,id:this.background.getCurrentSessionId({prefix:"notification",entity:y.data.question.id}),data:{questionType:y.data.question.type,question:{title:y.data.question.notification.title}}})}else if(y.data.question.type===Jt.FACTOID){const ee=(A=y.data.question.options)==null?void 0:A.options.value,ue={heading:y.data.question.notification.title,body:y.data.question.notification.body,image:y.data.question.notification.image,video:{id:((U=ee==null?void 0:ee.video)==null?void 0:U.id)||"",url:((V=ee==null?void 0:ee.video)==null?void 0:V.url)||"",thumbnailUrl:((G=ee==null?void 0:ee.video)==null?void 0:G.thumbnailUrl)||""},webLink:{label:"",url:""}};this.notifications.add({type:Pc.QUESTION,action:()=>{var J;return((J=y.data)==null?void 0:J.question)&&this.openQuestion(y.data.question.id)},close:()=>{var J;return((J=y.data)==null?void 0:J.question)&&this.closeQuestion(y.data.question.id)},autoHideDuration:1e3*120,id:this.background.getCurrentSessionId({prefix:"notification",entity:y.data.question.id}),data:{questionType:y.data.question.type,insight:ue}})}else if(y.data.question.type===Jt.TWEET){const ee=(ae=y.data.question.options)==null?void 0:ae.options.value,ue={title:y.data.question.notification.title,body:y.data.question.notification.body,image:y.data.question.notification.image,account:((Q=ee==null?void 0:ee.tweetMeta)==null?void 0:Q.account)||"",accountVerified:!!((se=ee==null?void 0:ee.tweetMeta)!=null&&se.accountVerified)};this.notifications.add({type:Pc.QUESTION,action:()=>{var J;return((J=y.data)==null?void 0:J.question)&&this.openQuestion(y.data.question.id)},close:()=>{var J;return((J=y.data)==null?void 0:J.question)&&this.closeQuestion(y.data.question.id)},autoHideDuration:1e3*120,id:this.background.getCurrentSessionId({prefix:"notification",entity:y.data.question.id}),data:{questionType:y.data.question.type,tweet:ue}})}}})}}const ZG={[tr.GAMES]:!0};class XG extends NS{constructor(a,s){super(a,s)}}const eQ=(n,a,s)=>n.type===tr.GAMES?new JG(n,a,s):new XG(n,a),tQ=(n,a,s)=>{n.features=new Map,n.activeFeature=new ri(Qa(tr.UNSET),"activeFeature"),n.sdk.getFeatures=()=>n.features,n.sdk.getFeature=f=>n.features.get(f),n.sdk.getActiveFeature=()=>n.activeFeature.getStore(),n.sdk.openFeature=f=>{n.activeFeature.setValue(f)},n.sdk.closeFeature=(f=!1)=>{if(f){const u=n.activeFeature.getValue();n.activeFeature.setValue(tr.UNSET),u&&n.features.delete(u)}},n.initFeature=(f,u=Qs.ORGANIZATION)=>{if(f.type in ZG&&!n.features.has(f.type)){const y=eQ(f,u,n);n.features.set(f.type,y)}},n.updateFeature=(f,u)=>{var y;(y=n.features.get(f.type))==null||y.update(f,u)},n.destroyFeature=f=>{n.features.delete(f.type)},n.reinitializeFeatures=async()=>{const f=await n.stores.organizationSettings.getValue();n.features.clear();for(const u of(f==null?void 0:f.overlays)||[])n.initFeature(u,Qs.ORGANIZATION)},n.stores.providerStreamId.listen(f=>{f||n.reinitializeFeatures()}),n.storeSubscribe=()=>{const f=(y,g)=>{var v;if(g!=null&&g.overlays&&!((v=n.contextConfig)!=null&&v.skipOrganizationSettings&&y===Qs.ORGANIZATION))for(const E of g.overlays)E.sdkEnable===!0&&(n.features.has(E.type)?n.updateFeature(E,y):n.initFeature(E,y))},u={organizationSettings:y=>{if(y.data)try{f(Qs.ORGANIZATION,y.data)}catch(g){console.log(g)}},streamSettings:y=>{if(y.data)try{f(Qs.STREAM,y.data)}catch(g){console.log(g)}}};n.store.subscribe(u)},s()};var A6={exports:{}},x6={exports:{}};function nQ(n){var a=new n,s=a;function f(){var y=a;return y.next?a=y.next:(a=new n,s=a),y.next=null,y}function u(y){s.next=y,s=y}return{get:f,release:u}}var rQ=nQ,aQ=rQ;function CS(n,a,s){if(typeof n=="function"&&(s=a,a=n,n=null),s<1)throw new Error("fastqueue concurrency must be greater than 1");var f=aQ(oQ),u=null,y=null,g=0,v=null,E={push:G,drain:Io,saturated:Io,pause:L,paused:!1,concurrency:s,running:_,resume:U,idle:V,length:R,getQueue:A,unshift:ae,empty:Io,kill:se,killAndDrain:ee,error:ue};return E;function _(){return g}function L(){E.paused=!0}function R(){for(var J=u,ye=0;J;)J=J.next,ye++;return ye}function A(){for(var J=u,ye=[];J;)ye.push(J.value),J=J.next;return ye}function U(){if(E.paused){E.paused=!1;for(var J=0;J<E.concurrency;J++)g++,Q()}}function V(){return g===0&&E.length()===0}function G(J,ye){var fe=f.get();fe.context=n,fe.release=Q,fe.value=J,fe.callback=ye||Io,fe.errorHandler=v,g===E.concurrency||E.paused?y?(y.next=fe,y=fe):(u=fe,y=fe,E.saturated()):(g++,a.call(n,fe.value,fe.worked))}function ae(J,ye){var fe=f.get();fe.context=n,fe.release=Q,fe.value=J,fe.callback=ye||Io,g===E.concurrency||E.paused?u?(fe.next=u,u=fe):(u=fe,y=fe,E.saturated()):(g++,a.call(n,fe.value,fe.worked))}function Q(J){J&&f.release(J);var ye=u;ye?E.paused?g--:(y===u&&(y=null),u=ye.next,ye.next=null,a.call(n,ye.value,ye.worked),y===null&&E.empty()):--g===0&&E.drain()}function se(){u=null,y=null,E.drain=Io}function ee(){u=null,y=null,E.drain(),E.drain=Io}function ue(J){v=J}}function Io(){}function oQ(){this.value=null,this.callback=Io,this.next=null,this.release=Io,this.context=null,this.errorHandler=null;var n=this;this.worked=function(a,s){var f=n.callback,u=n.errorHandler,y=n.value;n.value=null,n.callback=Io,n.errorHandler&&u(a,y),f.call(n.context,a,s),n.release(n)}}function iQ(n,a,s){typeof n=="function"&&(s=a,a=n,n=null);function f(L,R){a.call(this,L).then(function(A){R(null,A)},R)}var u=CS(n,f,s),y=u.push,g=u.unshift;return u.push=v,u.unshift=E,u.drained=_,u;function v(L){var R=new Promise(function(A,U){y(L,function(V,G){if(V){U(V);return}A(G)})});return R.catch(Io),R}function E(L){var R=new Promise(function(A,U){g(L,function(V,G){if(V){U(V);return}A(G)})});return R.catch(Io),R}function _(){if(u.idle())return new Promise(function(A){A()});var L=u.drain,R=new Promise(function(A){u.drain=function(){L(),A()}});return R}}x6.exports=CS;x6.exports.promise=iQ;var OS=x6.exports,L6={exports:{}},pp=typeof Reflect=="object"?Reflect:null,lw=pp&&typeof pp.apply=="function"?pp.apply:function(n,a,s){return Function.prototype.apply.call(n,a,s)},Cy;pp&&typeof pp.ownKeys=="function"?Cy=pp.ownKeys:Object.getOwnPropertySymbols?Cy=function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Cy=function(n){return Object.getOwnPropertyNames(n)};function sQ(n){console&&console.warn&&console.warn(n)}var AS=Number.isNaN||function(n){return n!==n};function an(){an.init.call(this)}L6.exports=an;L6.exports.once=dQ;an.EventEmitter=an;an.prototype._events=void 0;an.prototype._eventsCount=0;an.prototype._maxListeners=void 0;var uw=10;function c2(n){if(typeof n!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n)}Object.defineProperty(an,"defaultMaxListeners",{enumerable:!0,get:function(){return uw},set:function(n){if(typeof n!="number"||n<0||AS(n))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+n+".");uw=n}});an.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};an.prototype.setMaxListeners=function(n){if(typeof n!="number"||n<0||AS(n))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+n+".");return this._maxListeners=n,this};function xS(n){return n._maxListeners===void 0?an.defaultMaxListeners:n._maxListeners}an.prototype.getMaxListeners=function(){return xS(this)};an.prototype.emit=function(n){for(var a=[],s=1;s<arguments.length;s++)a.push(arguments[s]);var f=n==="error",u=this._events;if(u!==void 0)f=f&&u.error===void 0;else if(!f)return!1;if(f){var y;if(a.length>0&&(y=a[0]),y instanceof Error)throw y;var g=new Error("Unhandled error."+(y?" ("+y.message+")":""));throw g.context=y,g}var v=u[n];if(v===void 0)return!1;if(typeof v=="function")lw(v,this,a);else for(var E=v.length,_=PS(v,E),s=0;s<E;++s)lw(_[s],this,a);return!0};function LS(n,a,s,f){var u,y,g;if(c2(s),y=n._events,y===void 0?(y=n._events=Object.create(null),n._eventsCount=0):(y.newListener!==void 0&&(n.emit("newListener",a,s.listener?s.listener:s),y=n._events),g=y[a]),g===void 0)g=y[a]=s,++n._eventsCount;else if(typeof g=="function"?g=y[a]=f?[s,g]:[g,s]:f?g.unshift(s):g.push(s),u=xS(n),u>0&&g.length>u&&!g.warned){g.warned=!0;var v=new Error("Possible EventEmitter memory leak detected. "+g.length+" "+String(a)+" listeners added. Use emitter.setMaxListeners() to increase limit");v.name="MaxListenersExceededWarning",v.emitter=n,v.type=a,v.count=g.length,sQ(v)}return n}an.prototype.addListener=function(n,a){return LS(this,n,a,!1)};an.prototype.on=an.prototype.addListener;an.prototype.prependListener=function(n,a){return LS(this,n,a,!0)};function lQ(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function RS(n,a,s){var f={fired:!1,wrapFn:void 0,target:n,type:a,listener:s},u=lQ.bind(f);return u.listener=s,f.wrapFn=u,u}an.prototype.once=function(n,a){return c2(a),this.on(n,RS(this,n,a)),this};an.prototype.prependOnceListener=function(n,a){return c2(a),this.prependListener(n,RS(this,n,a)),this};an.prototype.removeListener=function(n,a){var s,f,u,y,g;if(c2(a),f=this._events,f===void 0)return this;if(s=f[n],s===void 0)return this;if(s===a||s.listener===a)--this._eventsCount===0?this._events=Object.create(null):(delete f[n],f.removeListener&&this.emit("removeListener",n,s.listener||a));else if(typeof s!="function"){for(u=-1,y=s.length-1;y>=0;y--)if(s[y]===a||s[y].listener===a){g=s[y].listener,u=y;break}if(u<0)return this;u===0?s.shift():uQ(s,u),s.length===1&&(f[n]=s[0]),f.removeListener!==void 0&&this.emit("removeListener",n,g||a)}return this};an.prototype.off=an.prototype.removeListener;an.prototype.removeAllListeners=function(n){var a,s,f;if(s=this._events,s===void 0)return this;if(s.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):s[n]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete s[n]),this;if(arguments.length===0){var u=Object.keys(s),y;for(f=0;f<u.length;++f)y=u[f],y!=="removeListener"&&this.removeAllListeners(y);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(a=s[n],typeof a=="function")this.removeListener(n,a);else if(a!==void 0)for(f=a.length-1;f>=0;f--)this.removeListener(n,a[f]);return this};function DS(n,a,s){var f=n._events;if(f===void 0)return[];var u=f[a];return u===void 0?[]:typeof u=="function"?s?[u.listener||u]:[u]:s?cQ(u):PS(u,u.length)}an.prototype.listeners=function(n){return DS(this,n,!0)};an.prototype.rawListeners=function(n){return DS(this,n,!1)};an.listenerCount=function(n,a){return typeof n.listenerCount=="function"?n.listenerCount(a):US.call(n,a)};an.prototype.listenerCount=US;function US(n){var a=this._events;if(a!==void 0){var s=a[n];if(typeof s=="function")return 1;if(s!==void 0)return s.length}return 0}an.prototype.eventNames=function(){return this._eventsCount>0?Cy(this._events):[]};function PS(n,a){for(var s=new Array(a),f=0;f<a;++f)s[f]=n[f];return s}function uQ(n,a){for(;a+1<n.length;a++)n[a]=n[a+1];n.pop()}function cQ(n){for(var a=new Array(n.length),s=0;s<a.length;++s)a[s]=n[s].listener||n[s];return a}function dQ(n,a){return new Promise(function(s,f){function u(g){n.removeListener(a,y),f(g)}function y(){typeof n.removeListener=="function"&&n.removeListener("error",u),s([].slice.call(arguments))}jS(n,a,y,{once:!0}),a!=="error"&&fQ(n,u,{once:!0})})}function fQ(n,a,s){typeof n.on=="function"&&jS(n,"error",a,s)}function jS(n,a,s,f){if(typeof n.on=="function")f.once?n.once(a,s):n.on(a,s);else if(typeof n.addEventListener=="function")n.addEventListener(a,function u(y){f.once&&n.removeEventListener(a,u),s(y)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof n)}var zS=L6.exports,d2={},BS={},FS=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var n={},a=Symbol("test"),s=Object(a);if(typeof a=="string"||Object.prototype.toString.call(a)!=="[object Symbol]"||Object.prototype.toString.call(s)!=="[object Symbol]")return!1;var f=42;n[a]=f;for(a in n)return!1;if(typeof Object.keys=="function"&&Object.keys(n).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(n).length!==0)return!1;var u=Object.getOwnPropertySymbols(n);if(u.length!==1||u[0]!==a||!Object.prototype.propertyIsEnumerable.call(n,a))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var y=Object.getOwnPropertyDescriptor(n,a);if(y.value!==f||y.enumerable!==!0)return!1}return!0},pQ=FS,R6=function(){return pQ()&&!!Symbol.toStringTag},cw=typeof Symbol<"u"&&Symbol,mQ=FS,hQ=function(){return typeof cw!="function"||typeof Symbol!="function"||typeof cw("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:mQ()},dw={foo:{}},gQ=Object,yQ=function(){return{__proto__:dw}.foo===dw.foo&&!({__proto__:null}instanceof gQ)},vQ="Function.prototype.bind called on incompatible ",TQ=Object.prototype.toString,kQ=Math.max,bQ="[object Function]",fw=function(n,a){for(var s=[],f=0;f<n.length;f+=1)s[f]=n[f];for(var u=0;u<a.length;u+=1)s[u+n.length]=a[u];return s},wQ=function(n,a){for(var s=[],f=a||0,u=0;f<n.length;f+=1,u+=1)s[u]=n[f];return s},SQ=function(n,a){for(var s="",f=0;f<n.length;f+=1)s+=n[f],f+1<n.length&&(s+=a);return s},EQ=function(n){var a=this;if(typeof a!="function"||TQ.apply(a)!==bQ)throw new TypeError(vQ+a);for(var s=wQ(arguments,1),f,u=function(){if(this instanceof f){var _=a.apply(this,fw(s,arguments));return Object(_)===_?_:this}return a.apply(n,fw(s,arguments))},y=kQ(0,a.length-s.length),g=[],v=0;v<y;v++)g[v]="$"+v;if(f=Function("binder","return function ("+SQ(g,",")+"){ return binder.apply(this,arguments); }")(u),a.prototype){var E=function(){};E.prototype=a.prototype,f.prototype=new E,E.prototype=null}return f},NQ=EQ,VS=Function.prototype.bind||NQ,pw={}.hasOwnProperty,dT=Function.prototype.call,MQ=dT.bind?dT.bind(pw):function(n,a){return dT.call(pw,n,a)},zt,gp=SyntaxError,YS=Function,mp=TypeError,fT=function(n){try{return YS('"use strict"; return ('+n+").constructor;")()}catch{}},jc=Object.getOwnPropertyDescriptor;if(jc)try{jc({},"")}catch{jc=null}var pT=function(){throw new mp},IQ=jc?function(){try{return arguments.callee,pT}catch{try{return jc(arguments,"callee").get}catch{return pT}}}():pT,tp=hQ(),_Q=yQ(),wr=Object.getPrototypeOf||(_Q?function(n){return n.__proto__}:null),rp={},CQ=typeof Uint8Array>"u"||!wr?zt:wr(Uint8Array),zc={"%AggregateError%":typeof AggregateError>"u"?zt:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?zt:ArrayBuffer,"%ArrayIteratorPrototype%":tp&&wr?wr([][Symbol.iterator]()):zt,"%AsyncFromSyncIteratorPrototype%":zt,"%AsyncFunction%":rp,"%AsyncGenerator%":rp,"%AsyncGeneratorFunction%":rp,"%AsyncIteratorPrototype%":rp,"%Atomics%":typeof Atomics>"u"?zt:Atomics,"%BigInt%":typeof BigInt>"u"?zt:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?zt:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?zt:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?zt:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?zt:Float32Array,"%Float64Array%":typeof Float64Array>"u"?zt:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?zt:FinalizationRegistry,"%Function%":YS,"%GeneratorFunction%":rp,"%Int8Array%":typeof Int8Array>"u"?zt:Int8Array,"%Int16Array%":typeof Int16Array>"u"?zt:Int16Array,"%Int32Array%":typeof Int32Array>"u"?zt:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":tp&&wr?wr(wr([][Symbol.iterator]())):zt,"%JSON%":typeof JSON=="object"?JSON:zt,"%Map%":typeof Map>"u"?zt:Map,"%MapIteratorPrototype%":typeof Map>"u"||!tp||!wr?zt:wr(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?zt:Promise,"%Proxy%":typeof Proxy>"u"?zt:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?zt:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?zt:Set,"%SetIteratorPrototype%":typeof Set>"u"||!tp||!wr?zt:wr(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?zt:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":tp&&wr?wr(""[Symbol.iterator]()):zt,"%Symbol%":tp?Symbol:zt,"%SyntaxError%":gp,"%ThrowTypeError%":IQ,"%TypedArray%":CQ,"%TypeError%":mp,"%Uint8Array%":typeof Uint8Array>"u"?zt:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?zt:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?zt:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?zt:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?zt:WeakMap,"%WeakRef%":typeof WeakRef>"u"?zt:WeakRef,"%WeakSet%":typeof WeakSet>"u"?zt:WeakSet};if(wr)try{null.error}catch(n){var OQ=wr(wr(n));zc["%Error.prototype%"]=OQ}var AQ=function n(a){var s;if(a==="%AsyncFunction%")s=fT("async function () {}");else if(a==="%GeneratorFunction%")s=fT("function* () {}");else if(a==="%AsyncGeneratorFunction%")s=fT("async function* () {}");else if(a==="%AsyncGenerator%"){var f=n("%AsyncGeneratorFunction%");f&&(s=f.prototype)}else if(a==="%AsyncIteratorPrototype%"){var u=n("%AsyncGenerator%");u&&wr&&(s=wr(u.prototype))}return zc[a]=s,s},mw={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},th=VS,Vy=MQ,xQ=th.call(Function.call,Array.prototype.concat),LQ=th.call(Function.apply,Array.prototype.splice),hw=th.call(Function.call,String.prototype.replace),Yy=th.call(Function.call,String.prototype.slice),RQ=th.call(Function.call,RegExp.prototype.exec),DQ=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,UQ=/\\(\\)?/g,PQ=function(n){var a=Yy(n,0,1),s=Yy(n,-1);if(a==="%"&&s!=="%")throw new gp("invalid intrinsic syntax, expected closing `%`");if(s==="%"&&a!=="%")throw new gp("invalid intrinsic syntax, expected opening `%`");var f=[];return hw(n,DQ,function(u,y,g,v){f[f.length]=g?hw(v,UQ,"$1"):y||u}),f},jQ=function(n,a){var s=n,f;if(Vy(mw,s)&&(f=mw[s],s="%"+f[0]+"%"),Vy(zc,s)){var u=zc[s];if(u===rp&&(u=AQ(s)),typeof u>"u"&&!a)throw new mp("intrinsic "+n+" exists, but is not available. Please file an issue!");return{alias:f,name:s,value:u}}throw new gp("intrinsic "+n+" does not exist!")},wp=function(n,a){if(typeof n!="string"||n.length===0)throw new mp("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof a!="boolean")throw new mp('"allowMissing" argument must be a boolean');if(RQ(/^%?[^%]*%?$/,n)===null)throw new gp("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var s=PQ(n),f=s.length>0?s[0]:"",u=jQ("%"+f+"%",a),y=u.name,g=u.value,v=!1,E=u.alias;E&&(f=E[0],LQ(s,xQ([0,1],E)));for(var _=1,L=!0;_<s.length;_+=1){var R=s[_],A=Yy(R,0,1),U=Yy(R,-1);if((A==='"'||A==="'"||A==="`"||U==='"'||U==="'"||U==="`")&&A!==U)throw new gp("property names with quotes must have matching quotes");if((R==="constructor"||!L)&&(v=!0),f+="."+R,y="%"+f+"%",Vy(zc,y))g=zc[y];else if(g!=null){if(!(R in g)){if(!a)throw new mp("base intrinsic for "+n+" exists, but the property is not available.");return}if(jc&&_+1>=s.length){var V=jc(g,R);L=!!V,L&&"get"in V&&!("originalValue"in V.get)?g=V.get:g=g[R]}else L=Vy(g,R),g=g[R];L&&!v&&(zc[y]=g)}}return g},$S={exports:{}},zQ=wp,qT=zQ("%Object.defineProperty%",!0),WT=function(){if(qT)try{return qT({},"a",{value:1}),!0}catch{return!1}return!1};WT.hasArrayLengthDefineBug=function(){if(!WT())return null;try{return qT([],"length",{value:1}).length!==1}catch{return!0}};var GS=WT,BQ=wp,Oy=BQ("%Object.getOwnPropertyDescriptor%",!0);if(Oy)try{Oy([],"length")}catch{Oy=null}var D6=Oy,FQ=GS(),U6=wp,q1=FQ&&U6("%Object.defineProperty%",!0);if(q1)try{q1({},"a",{value:1})}catch{q1=!1}var VQ=U6("%SyntaxError%"),np=U6("%TypeError%"),gw=D6,YQ=function(n,a,s){if(!n||typeof n!="object"&&typeof n!="function")throw new np("`obj` must be an object or a function`");if(typeof a!="string"&&typeof a!="symbol")throw new np("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new np("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new np("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new np("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new np("`loose`, if provided, must be a boolean");var f=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,y=arguments.length>5?arguments[5]:null,g=arguments.length>6?arguments[6]:!1,v=!!gw&&gw(n,a);if(q1)q1(n,a,{configurable:y===null&&v?v.configurable:!y,enumerable:f===null&&v?v.enumerable:!f,value:s,writable:u===null&&v?v.writable:!u});else if(g||!f&&!u&&!y)n[a]=s;else throw new VQ("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},QS=wp,yw=YQ,$Q=GS(),vw=D6,Tw=QS("%TypeError%"),GQ=QS("%Math.floor%"),QQ=function(n,a){if(typeof n!="function")throw new Tw("`fn` is not a function");if(typeof a!="number"||a<0||a>4294967295||GQ(a)!==a)throw new Tw("`length` must be a positive 32-bit integer");var s=arguments.length>2&&!!arguments[2],f=!0,u=!0;if("length"in n&&vw){var y=vw(n,"length");y&&!y.configurable&&(f=!1),y&&!y.writable&&(u=!1)}return(f||u||!s)&&($Q?yw(n,"length",a,!0,!0):yw(n,"length",a)),n};(function(n){var a=VS,s=wp,f=QQ,u=s("%TypeError%"),y=s("%Function.prototype.apply%"),g=s("%Function.prototype.call%"),v=s("%Reflect.apply%",!0)||a.call(g,y),E=s("%Object.defineProperty%",!0),_=s("%Math.max%");if(E)try{E({},"a",{value:1})}catch{E=null}n.exports=function(R){if(typeof R!="function")throw new u("a function is required");var A=v(a,g,arguments);return f(A,1+_(0,R.length-(arguments.length-1)),!0)};var L=function(){return v(a,y,arguments)};E?E(n.exports,"apply",{value:L}):n.exports.apply=L})($S);var HS=$S.exports,qS=wp,WS=HS,HQ=WS(qS("String.prototype.indexOf")),KS=function(n,a){var s=qS(n,!!a);return typeof s=="function"&&HQ(n,".prototype.")>-1?WS(s):s},qQ=R6(),WQ=KS,KT=WQ("Object.prototype.toString"),f2=function(n){return qQ&&n&&typeof n=="object"&&Symbol.toStringTag in n?!1:KT(n)==="[object Arguments]"},JS=function(n){return f2(n)?!0:n!==null&&typeof n=="object"&&typeof n.length=="number"&&n.length>=0&&KT(n)!=="[object Array]"&&KT(n.callee)==="[object Function]"},KQ=function(){return f2(arguments)}();f2.isLegacyArguments=JS;var JQ=KQ?f2:JS,ZQ=Object.prototype.toString,XQ=Function.prototype.toString,eH=/^\s*(?:function)?\*/,ZS=R6(),mT=Object.getPrototypeOf,tH=function(){if(!ZS)return!1;try{return Function("return function*() {}")()}catch{}},hT,nH=function(n){if(typeof n!="function")return!1;if(eH.test(XQ.call(n)))return!0;if(!ZS){var a=ZQ.call(n);return a==="[object GeneratorFunction]"}if(!mT)return!1;if(typeof hT>"u"){var s=tH();hT=s?mT(s):!1}return mT(n)===hT},XS=Function.prototype.toString,ip=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,JT,Ay;if(typeof ip=="function"&&typeof Object.defineProperty=="function")try{JT=Object.defineProperty({},"length",{get:function(){throw Ay}}),Ay={},ip(function(){throw 42},null,JT)}catch(n){n!==Ay&&(ip=null)}else ip=null;var rH=/^\s*class\b/,ZT=function(n){try{var a=XS.call(n);return rH.test(a)}catch{return!1}},gT=function(n){try{return ZT(n)?!1:(XS.call(n),!0)}catch{return!1}},xy=Object.prototype.toString,aH="[object Object]",oH="[object Function]",iH="[object GeneratorFunction]",sH="[object HTMLAllCollection]",lH="[object HTML document.all class]",uH="[object HTMLCollection]",cH=typeof Symbol=="function"&&!!Symbol.toStringTag,dH=!(0 in[,]),XT=function(){return!1};if(typeof document=="object"){var fH=document.all;xy.call(fH)===xy.call(document.all)&&(XT=function(n){if((dH||!n)&&(typeof n>"u"||typeof n=="object"))try{var a=xy.call(n);return(a===sH||a===lH||a===uH||a===aH)&&n("")==null}catch{}return!1})}var pH=ip?function(n){if(XT(n))return!0;if(!n||typeof n!="function"&&typeof n!="object")return!1;try{ip(n,null,JT)}catch(a){if(a!==Ay)return!1}return!ZT(n)&&gT(n)}:function(n){if(XT(n))return!0;if(!n||typeof n!="function"&&typeof n!="object")return!1;if(cH)return gT(n);if(ZT(n))return!1;var a=xy.call(n);return a!==oH&&a!==iH&&!/^\[object HTML/.test(a)?!1:gT(n)},mH=pH,hH=Object.prototype.toString,eE=Object.prototype.hasOwnProperty,gH=function(n,a,s){for(var f=0,u=n.length;f<u;f++)eE.call(n,f)&&(s==null?a(n[f],f,n):a.call(s,n[f],f,n))},yH=function(n,a,s){for(var f=0,u=n.length;f<u;f++)s==null?a(n.charAt(f),f,n):a.call(s,n.charAt(f),f,n)},vH=function(n,a,s){for(var f in n)eE.call(n,f)&&(s==null?a(n[f],f,n):a.call(s,n[f],f,n))},TH=function(n,a,s){if(!mH(a))throw new TypeError("iterator must be a function");var f;arguments.length>=3&&(f=s),hH.call(n)==="[object Array]"?gH(n,a,f):typeof n=="string"?yH(n,a,f):vH(n,a,f)},kH=TH,yT=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],bH=typeof globalThis>"u"?vS:globalThis,wH=function(){for(var n=[],a=0;a<yT.length;a++)typeof bH[yT[a]]=="function"&&(n[n.length]=yT[a]);return n},$y=kH,SH=wH,kw=HS,P6=KS,Ly=D6,EH=P6("Object.prototype.toString"),tE=R6(),bw=typeof globalThis>"u"?vS:globalThis,e6=SH(),j6=P6("String.prototype.slice"),vT=Object.getPrototypeOf,NH=P6("Array.prototype.indexOf",!0)||function(n,a){for(var s=0;s<n.length;s+=1)if(n[s]===a)return s;return-1},Gy={__proto__:null};tE&&Ly&&vT?$y(e6,function(n){var a=new bw[n];if(Symbol.toStringTag in a){var s=vT(a),f=Ly(s,Symbol.toStringTag);if(!f){var u=vT(s);f=Ly(u,Symbol.toStringTag)}Gy["$"+n]=kw(f.get)}}):$y(e6,function(n){var a=new bw[n],s=a.slice||a.set;s&&(Gy["$"+n]=kw(s))});var MH=function(n){var a=!1;return $y(Gy,function(s,f){if(!a)try{"$"+s(n)===f&&(a=j6(f,1))}catch{}}),a},IH=function(n){var a=!1;return $y(Gy,function(s,f){if(!a)try{s(n),a=j6(f,1)}catch{}}),a},nE=function(n){if(!n||typeof n!="object")return!1;if(!tE){var a=j6(EH(n),8,-1);return NH(e6,a)>-1?a:a!=="Object"?!1:IH(n)}return Ly?MH(n):null},_H=nE,CH=function(n){return!!_H(n)};(function(n){var a=JQ,s=nH,f=nE,u=CH;function y(ve){return ve.call.bind(ve)}var g=typeof BigInt<"u",v=typeof Symbol<"u",E=y(Object.prototype.toString),_=y(Number.prototype.valueOf),L=y(String.prototype.valueOf),R=y(Boolean.prototype.valueOf);if(g)var A=y(BigInt.prototype.valueOf);if(v)var U=y(Symbol.prototype.valueOf);function V(ve,qn){if(typeof ve!="object")return!1;try{return qn(ve),!0}catch{return!1}}n.isArgumentsObject=a,n.isGeneratorFunction=s,n.isTypedArray=u;function G(ve){return typeof Promise<"u"&&ve instanceof Promise||ve!==null&&typeof ve=="object"&&typeof ve.then=="function"&&typeof ve.catch=="function"}n.isPromise=G;function ae(ve){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(ve):u(ve)||ce(ve)}n.isArrayBufferView=ae;function Q(ve){return f(ve)==="Uint8Array"}n.isUint8Array=Q;function se(ve){return f(ve)==="Uint8ClampedArray"}n.isUint8ClampedArray=se;function ee(ve){return f(ve)==="Uint16Array"}n.isUint16Array=ee;function ue(ve){return f(ve)==="Uint32Array"}n.isUint32Array=ue;function J(ve){return f(ve)==="Int8Array"}n.isInt8Array=J;function ye(ve){return f(ve)==="Int16Array"}n.isInt16Array=ye;function fe(ve){return f(ve)==="Int32Array"}n.isInt32Array=fe;function Ue(ve){return f(ve)==="Float32Array"}n.isFloat32Array=Ue;function He(ve){return f(ve)==="Float64Array"}n.isFloat64Array=He;function gt(ve){return f(ve)==="BigInt64Array"}n.isBigInt64Array=gt;function dt(ve){return f(ve)==="BigUint64Array"}n.isBigUint64Array=dt;function vt(ve){return E(ve)==="[object Map]"}vt.working=typeof Map<"u"&&vt(new Map);function qe(ve){return typeof Map>"u"?!1:vt.working?vt(ve):ve instanceof Map}n.isMap=qe;function at(ve){return E(ve)==="[object Set]"}at.working=typeof Set<"u"&&at(new Set);function _t(ve){return typeof Set>"u"?!1:at.working?at(ve):ve instanceof Set}n.isSet=_t;function Ut(ve){return E(ve)==="[object WeakMap]"}Ut.working=typeof WeakMap<"u"&&Ut(new WeakMap);function En(ve){return typeof WeakMap>"u"?!1:Ut.working?Ut(ve):ve instanceof WeakMap}n.isWeakMap=En;function Ce(ve){return E(ve)==="[object WeakSet]"}Ce.working=typeof WeakSet<"u"&&Ce(new WeakSet);function Be(ve){return Ce(ve)}n.isWeakSet=Be;function Le(ve){return E(ve)==="[object ArrayBuffer]"}Le.working=typeof ArrayBuffer<"u"&&Le(new ArrayBuffer);function Ne(ve){return typeof ArrayBuffer>"u"?!1:Le.working?Le(ve):ve instanceof ArrayBuffer}n.isArrayBuffer=Ne;function Y(ve){return E(ve)==="[object DataView]"}Y.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&Y(new DataView(new ArrayBuffer(1),0,1));function ce(ve){return typeof DataView>"u"?!1:Y.working?Y(ve):ve instanceof DataView}n.isDataView=ce;var we=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function Ze(ve){return E(ve)==="[object SharedArrayBuffer]"}function ft(ve){return typeof we>"u"?!1:(typeof Ze.working>"u"&&(Ze.working=Ze(new we)),Ze.working?Ze(ve):ve instanceof we)}n.isSharedArrayBuffer=ft;function pt(ve){return E(ve)==="[object AsyncFunction]"}n.isAsyncFunction=pt;function Ge(ve){return E(ve)==="[object Map Iterator]"}n.isMapIterator=Ge;function rt(ve){return E(ve)==="[object Set Iterator]"}n.isSetIterator=rt;function St(ve){return E(ve)==="[object Generator]"}n.isGeneratorObject=St;function Qt(ve){return E(ve)==="[object WebAssembly.Module]"}n.isWebAssemblyCompiledModule=Qt;function nn(ve){return V(ve,_)}n.isNumberObject=nn;function kt(ve){return V(ve,L)}n.isStringObject=kt;function Ot(ve){return V(ve,R)}n.isBooleanObject=Ot;function Tn(ve){return g&&V(ve,A)}n.isBigIntObject=Tn;function Cn(ve){return v&&V(ve,U)}n.isSymbolObject=Cn;function rn(ve){return nn(ve)||kt(ve)||Ot(ve)||Tn(ve)||Cn(ve)}n.isBoxedPrimitive=rn;function rr(ve){return typeof Uint8Array<"u"&&(Ne(ve)||ft(ve))}n.isAnyArrayBuffer=rr,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(ve){Object.defineProperty(n,ve,{enumerable:!1,value:function(){throw new Error(ve+" is not supported in userland")}})})})(BS);var OH=function(n){return n&&typeof n=="object"&&typeof n.copy=="function"&&typeof n.fill=="function"&&typeof n.readUInt8=="function"},t6={exports:{}};typeof Object.create=="function"?t6.exports=function(n,a){a&&(n.super_=a,n.prototype=Object.create(a.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}))}:t6.exports=function(n,a){if(a){n.super_=a;var s=function(){};s.prototype=a.prototype,n.prototype=new s,n.prototype.constructor=n}};var AH=t6.exports;(function(n){var a=Object.getOwnPropertyDescriptors||function(Y){for(var ce=Object.keys(Y),we={},Ze=0;Ze<ce.length;Ze++)we[ce[Ze]]=Object.getOwnPropertyDescriptor(Y,ce[Ze]);return we},s=/%[sdj%]/g;n.format=function(Y){if(!J(Y)){for(var ce=[],we=0;we<arguments.length;we++)ce.push(g(arguments[we]));return ce.join(" ")}for(var we=1,Ze=arguments,ft=Ze.length,pt=String(Y).replace(s,function(St){if(St==="%%")return"%";if(we>=ft)return St;switch(St){case"%s":return String(Ze[we++]);case"%d":return Number(Ze[we++]);case"%j":try{return JSON.stringify(Ze[we++])}catch{return"[Circular]"}default:return St}}),Ge=Ze[we];we<ft;Ge=Ze[++we])se(Ge)||!He(Ge)?pt+=" "+Ge:pt+=" "+g(Ge);return pt},n.deprecate=function(Y,ce){if(typeof It.process<"u"&&It.process.noDeprecation===!0)return Y;if(typeof It.process>"u")return function(){return n.deprecate(Y,ce).apply(this,arguments)};var we=!1;function Ze(){if(!we){if(It.process.throwDeprecation)throw new Error(ce);It.process.traceDeprecation?console.trace(ce):console.error(ce),we=!0}return Y.apply(this,arguments)}return Ze};var f={},u=/^$/;if(It.process.env.NODE_DEBUG){var y=It.process.env.NODE_DEBUG;y=y.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),u=new RegExp("^"+y+"$","i")}n.debuglog=function(Y){if(Y=Y.toUpperCase(),!f[Y])if(u.test(Y)){var ce=It.process.pid;f[Y]=function(){var we=n.format.apply(n,arguments);console.error("%s %d: %s",Y,ce,we)}}else f[Y]=function(){};return f[Y]};function g(Y,ce){var we={seen:[],stylize:E};return arguments.length>=3&&(we.depth=arguments[2]),arguments.length>=4&&(we.colors=arguments[3]),Q(ce)?we.showHidden=ce:ce&&n._extend(we,ce),fe(we.showHidden)&&(we.showHidden=!1),fe(we.depth)&&(we.depth=2),fe(we.colors)&&(we.colors=!1),fe(we.customInspect)&&(we.customInspect=!0),we.colors&&(we.stylize=v),L(we,Y,we.depth)}n.inspect=g,g.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},g.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function v(Y,ce){var we=g.styles[ce];return we?"\x1B["+g.colors[we][0]+"m"+Y+"\x1B["+g.colors[we][1]+"m":Y}function E(Y,ce){return Y}function _(Y){var ce={};return Y.forEach(function(we,Ze){ce[we]=!0}),ce}function L(Y,ce,we){if(Y.customInspect&&ce&&vt(ce.inspect)&&ce.inspect!==n.inspect&&!(ce.constructor&&ce.constructor.prototype===ce)){var Ze=ce.inspect(we,Y);return J(Ze)||(Ze=L(Y,Ze,we)),Ze}var ft=R(Y,ce);if(ft)return ft;var pt=Object.keys(ce),Ge=_(pt);if(Y.showHidden&&(pt=Object.getOwnPropertyNames(ce)),dt(ce)&&(pt.indexOf("message")>=0||pt.indexOf("description")>=0))return A(ce);if(pt.length===0){if(vt(ce)){var rt=ce.name?": "+ce.name:"";return Y.stylize("[Function"+rt+"]","special")}if(Ue(ce))return Y.stylize(RegExp.prototype.toString.call(ce),"regexp");if(gt(ce))return Y.stylize(Date.prototype.toString.call(ce),"date");if(dt(ce))return A(ce)}var St="",Qt=!1,nn=["{","}"];if(ae(ce)&&(Qt=!0,nn=["[","]"]),vt(ce)){var kt=ce.name?": "+ce.name:"";St=" [Function"+kt+"]"}if(Ue(ce)&&(St=" "+RegExp.prototype.toString.call(ce)),gt(ce)&&(St=" "+Date.prototype.toUTCString.call(ce)),dt(ce)&&(St=" "+A(ce)),pt.length===0&&(!Qt||ce.length==0))return nn[0]+St+nn[1];if(we<0)return Ue(ce)?Y.stylize(RegExp.prototype.toString.call(ce),"regexp"):Y.stylize("[Object]","special");Y.seen.push(ce);var Ot;return Qt?Ot=U(Y,ce,we,Ge,pt):Ot=pt.map(function(Tn){return V(Y,ce,we,Ge,Tn,Qt)}),Y.seen.pop(),G(Ot,St,nn)}function R(Y,ce){if(fe(ce))return Y.stylize("undefined","undefined");if(J(ce)){var we="'"+JSON.stringify(ce).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return Y.stylize(we,"string")}if(ue(ce))return Y.stylize(""+ce,"number");if(Q(ce))return Y.stylize(""+ce,"boolean");if(se(ce))return Y.stylize("null","null")}function A(Y){return"["+Error.prototype.toString.call(Y)+"]"}function U(Y,ce,we,Ze,ft){for(var pt=[],Ge=0,rt=ce.length;Ge<rt;++Ge)Ce(ce,String(Ge))?pt.push(V(Y,ce,we,Ze,String(Ge),!0)):pt.push("");return ft.forEach(function(St){St.match(/^\d+$/)||pt.push(V(Y,ce,we,Ze,St,!0))}),pt}function V(Y,ce,we,Ze,ft,pt){var Ge,rt,St;if(St=Object.getOwnPropertyDescriptor(ce,ft)||{value:ce[ft]},St.get?St.set?rt=Y.stylize("[Getter/Setter]","special"):rt=Y.stylize("[Getter]","special"):St.set&&(rt=Y.stylize("[Setter]","special")),Ce(Ze,ft)||(Ge="["+ft+"]"),rt||(Y.seen.indexOf(St.value)<0?(se(we)?rt=L(Y,St.value,null):rt=L(Y,St.value,we-1),rt.indexOf(`
|
|
175
|
+
*/(function(n){const a=l2,s=I6,f=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;n.Buffer=v,n.SlowBuffer=se,n.INSPECT_MAX_BYTES=50;const u=2147483647;n.kMaxLength=u,v.TYPED_ARRAY_SUPPORT=y(),!v.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function y(){try{const l=new Uint8Array(1),d={foo:function(){return 42}};return Object.setPrototypeOf(d,Uint8Array.prototype),Object.setPrototypeOf(l,d),l.foo()===42}catch{return!1}}Object.defineProperty(v.prototype,"parent",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.buffer}}),Object.defineProperty(v.prototype,"offset",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.byteOffset}});function g(l){if(l>u)throw new RangeError('The value "'+l+'" is invalid for option "size"');const d=new Uint8Array(l);return Object.setPrototypeOf(d,v.prototype),d}function v(l,d,m){if(typeof l=="number"){if(typeof d=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return R(l)}return E(l,d,m)}v.poolSize=8192;function E(l,d,m){if(typeof l=="string")return A(l,d);if(ArrayBuffer.isView(l))return V(l);if(l==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof l);if(Mt(l,ArrayBuffer)||l&&Mt(l.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Mt(l,SharedArrayBuffer)||l&&Mt(l.buffer,SharedArrayBuffer)))return G(l,d,m);if(typeof l=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const b=l.valueOf&&l.valueOf();if(b!=null&&b!==l)return v.from(b,d,m);const I=ae(l);if(I)return I;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof l[Symbol.toPrimitive]=="function")return v.from(l[Symbol.toPrimitive]("string"),d,m);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof l)}v.from=function(l,d,m){return E(l,d,m)},Object.setPrototypeOf(v.prototype,Uint8Array.prototype),Object.setPrototypeOf(v,Uint8Array);function _(l){if(typeof l!="number")throw new TypeError('"size" argument must be of type number');if(l<0)throw new RangeError('The value "'+l+'" is invalid for option "size"')}function L(l,d,m){return _(l),l<=0?g(l):d!==void 0?typeof m=="string"?g(l).fill(d,m):g(l).fill(d):g(l)}v.alloc=function(l,d,m){return L(l,d,m)};function R(l){return _(l),g(l<0?0:Q(l)|0)}v.allocUnsafe=function(l){return R(l)},v.allocUnsafeSlow=function(l){return R(l)};function A(l,d){if((typeof d!="string"||d==="")&&(d="utf8"),!v.isEncoding(d))throw new TypeError("Unknown encoding: "+d);const m=ee(l,d)|0;let b=g(m);const I=b.write(l,d);return I!==m&&(b=b.slice(0,I)),b}function U(l){const d=l.length<0?0:Q(l.length)|0,m=g(d);for(let b=0;b<d;b+=1)m[b]=l[b]&255;return m}function V(l){if(Mt(l,Uint8Array)){const d=new Uint8Array(l);return G(d.buffer,d.byteOffset,d.byteLength)}return U(l)}function G(l,d,m){if(d<0||l.byteLength<d)throw new RangeError('"offset" is outside of buffer bounds');if(l.byteLength<d+(m||0))throw new RangeError('"length" is outside of buffer bounds');let b;return d===void 0&&m===void 0?b=new Uint8Array(l):m===void 0?b=new Uint8Array(l,d):b=new Uint8Array(l,d,m),Object.setPrototypeOf(b,v.prototype),b}function ae(l){if(v.isBuffer(l)){const d=Q(l.length)|0,m=g(d);return m.length===0||l.copy(m,0,0,d),m}if(l.length!==void 0)return typeof l.length!="number"||On(l.length)?g(0):U(l);if(l.type==="Buffer"&&Array.isArray(l.data))return U(l.data)}function Q(l){if(l>=u)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+u.toString(16)+" bytes");return l|0}function se(l){return+l!=l&&(l=0),v.alloc(+l)}v.isBuffer=function(l){return l!=null&&l._isBuffer===!0&&l!==v.prototype},v.compare=function(l,d){if(Mt(l,Uint8Array)&&(l=v.from(l,l.offset,l.byteLength)),Mt(d,Uint8Array)&&(d=v.from(d,d.offset,d.byteLength)),!v.isBuffer(l)||!v.isBuffer(d))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(l===d)return 0;let m=l.length,b=d.length;for(let I=0,x=Math.min(m,b);I<x;++I)if(l[I]!==d[I]){m=l[I],b=d[I];break}return m<b?-1:b<m?1:0},v.isEncoding=function(l){switch(String(l).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},v.concat=function(l,d){if(!Array.isArray(l))throw new TypeError('"list" argument must be an Array of Buffers');if(l.length===0)return v.alloc(0);let m;if(d===void 0)for(d=0,m=0;m<l.length;++m)d+=l[m].length;const b=v.allocUnsafe(d);let I=0;for(m=0;m<l.length;++m){let x=l[m];if(Mt(x,Uint8Array))I+x.length>b.length?(v.isBuffer(x)||(x=v.from(x)),x.copy(b,I)):Uint8Array.prototype.set.call(b,x,I);else if(v.isBuffer(x))x.copy(b,I);else throw new TypeError('"list" argument must be an Array of Buffers');I+=x.length}return b};function ee(l,d){if(v.isBuffer(l))return l.length;if(ArrayBuffer.isView(l)||Mt(l,ArrayBuffer))return l.byteLength;if(typeof l!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof l);const m=l.length,b=arguments.length>2&&arguments[2]===!0;if(!b&&m===0)return 0;let I=!1;for(;;)switch(d){case"ascii":case"latin1":case"binary":return m;case"utf8":case"utf-8":return rn(l).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m*2;case"hex":return m>>>1;case"base64":return qn(l).length;default:if(I)return b?-1:rn(l).length;d=(""+d).toLowerCase(),I=!0}}v.byteLength=ee;function ue(l,d,m){let b=!1;if((d===void 0||d<0)&&(d=0),d>this.length||((m===void 0||m>this.length)&&(m=this.length),m<=0)||(m>>>=0,d>>>=0,m<=d))return"";for(l||(l="utf8");;)switch(l){case"hex":return Be(this,d,m);case"utf8":case"utf-8":return at(this,d,m);case"ascii":return En(this,d,m);case"latin1":case"binary":return Ce(this,d,m);case"base64":return qe(this,d,m);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Le(this,d,m);default:if(b)throw new TypeError("Unknown encoding: "+l);l=(l+"").toLowerCase(),b=!0}}v.prototype._isBuffer=!0;function J(l,d,m){const b=l[d];l[d]=l[m],l[m]=b}v.prototype.swap16=function(){const l=this.length;if(l%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let d=0;d<l;d+=2)J(this,d,d+1);return this},v.prototype.swap32=function(){const l=this.length;if(l%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let d=0;d<l;d+=4)J(this,d,d+3),J(this,d+1,d+2);return this},v.prototype.swap64=function(){const l=this.length;if(l%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let d=0;d<l;d+=8)J(this,d,d+7),J(this,d+1,d+6),J(this,d+2,d+5),J(this,d+3,d+4);return this},v.prototype.toString=function(){const l=this.length;return l===0?"":arguments.length===0?at(this,0,l):ue.apply(this,arguments)},v.prototype.toLocaleString=v.prototype.toString,v.prototype.equals=function(l){if(!v.isBuffer(l))throw new TypeError("Argument must be a Buffer");return this===l?!0:v.compare(this,l)===0},v.prototype.inspect=function(){let l="";const d=n.INSPECT_MAX_BYTES;return l=this.toString("hex",0,d).replace(/(.{2})/g,"$1 ").trim(),this.length>d&&(l+=" ... "),"<Buffer "+l+">"},f&&(v.prototype[f]=v.prototype.inspect),v.prototype.compare=function(l,d,m,b,I){if(Mt(l,Uint8Array)&&(l=v.from(l,l.offset,l.byteLength)),!v.isBuffer(l))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof l);if(d===void 0&&(d=0),m===void 0&&(m=l?l.length:0),b===void 0&&(b=0),I===void 0&&(I=this.length),d<0||m>l.length||b<0||I>this.length)throw new RangeError("out of range index");if(b>=I&&d>=m)return 0;if(b>=I)return-1;if(d>=m)return 1;if(d>>>=0,m>>>=0,b>>>=0,I>>>=0,this===l)return 0;let x=I-b,j=m-d;const Te=Math.min(x,j),Pe=this.slice(b,I),_e=l.slice(d,m);for(let Ae=0;Ae<Te;++Ae)if(Pe[Ae]!==_e[Ae]){x=Pe[Ae],j=_e[Ae];break}return x<j?-1:j<x?1:0};function ye(l,d,m,b,I){if(l.length===0)return-1;if(typeof m=="string"?(b=m,m=0):m>2147483647?m=2147483647:m<-2147483648&&(m=-2147483648),m=+m,On(m)&&(m=I?0:l.length-1),m<0&&(m=l.length+m),m>=l.length){if(I)return-1;m=l.length-1}else if(m<0)if(I)m=0;else return-1;if(typeof d=="string"&&(d=v.from(d,b)),v.isBuffer(d))return d.length===0?-1:fe(l,d,m,b,I);if(typeof d=="number")return d=d&255,typeof Uint8Array.prototype.indexOf=="function"?I?Uint8Array.prototype.indexOf.call(l,d,m):Uint8Array.prototype.lastIndexOf.call(l,d,m):fe(l,[d],m,b,I);throw new TypeError("val must be string, number or Buffer")}function fe(l,d,m,b,I){let x=1,j=l.length,Te=d.length;if(b!==void 0&&(b=String(b).toLowerCase(),b==="ucs2"||b==="ucs-2"||b==="utf16le"||b==="utf-16le")){if(l.length<2||d.length<2)return-1;x=2,j/=2,Te/=2,m/=2}function Pe(Ae,Oe){return x===1?Ae[Oe]:Ae.readUInt16BE(Oe*x)}let _e;if(I){let Ae=-1;for(_e=m;_e<j;_e++)if(Pe(l,_e)===Pe(d,Ae===-1?0:_e-Ae)){if(Ae===-1&&(Ae=_e),_e-Ae+1===Te)return Ae*x}else Ae!==-1&&(_e-=_e-Ae),Ae=-1}else for(m+Te>j&&(m=j-Te),_e=m;_e>=0;_e--){let Ae=!0;for(let Oe=0;Oe<Te;Oe++)if(Pe(l,_e+Oe)!==Pe(d,Oe)){Ae=!1;break}if(Ae)return _e}return-1}v.prototype.includes=function(l,d,m){return this.indexOf(l,d,m)!==-1},v.prototype.indexOf=function(l,d,m){return ye(this,l,d,m,!0)},v.prototype.lastIndexOf=function(l,d,m){return ye(this,l,d,m,!1)};function Ue(l,d,m,b){m=Number(m)||0;const I=l.length-m;b?(b=Number(b),b>I&&(b=I)):b=I;const x=d.length;b>x/2&&(b=x/2);let j;for(j=0;j<b;++j){const Te=parseInt(d.substr(j*2,2),16);if(On(Te))return j;l[m+j]=Te}return j}function He(l,d,m,b){return on(rn(d,l.length-m),l,m,b)}function gt(l,d,m,b){return on(rr(d),l,m,b)}function dt(l,d,m,b){return on(qn(d),l,m,b)}function vt(l,d,m,b){return on(ve(d,l.length-m),l,m,b)}v.prototype.write=function(l,d,m,b){if(d===void 0)b="utf8",m=this.length,d=0;else if(m===void 0&&typeof d=="string")b=d,m=this.length,d=0;else if(isFinite(d))d=d>>>0,isFinite(m)?(m=m>>>0,b===void 0&&(b="utf8")):(b=m,m=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const I=this.length-d;if((m===void 0||m>I)&&(m=I),l.length>0&&(m<0||d<0)||d>this.length)throw new RangeError("Attempt to write outside buffer bounds");b||(b="utf8");let x=!1;for(;;)switch(b){case"hex":return Ue(this,l,d,m);case"utf8":case"utf-8":return He(this,l,d,m);case"ascii":case"latin1":case"binary":return gt(this,l,d,m);case"base64":return dt(this,l,d,m);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return vt(this,l,d,m);default:if(x)throw new TypeError("Unknown encoding: "+b);b=(""+b).toLowerCase(),x=!0}},v.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function qe(l,d,m){return d===0&&m===l.length?a.fromByteArray(l):a.fromByteArray(l.slice(d,m))}function at(l,d,m){m=Math.min(l.length,m);const b=[];let I=d;for(;I<m;){const x=l[I];let j=null,Te=x>239?4:x>223?3:x>191?2:1;if(I+Te<=m){let Pe,_e,Ae,Oe;switch(Te){case 1:x<128&&(j=x);break;case 2:Pe=l[I+1],(Pe&192)===128&&(Oe=(x&31)<<6|Pe&63,Oe>127&&(j=Oe));break;case 3:Pe=l[I+1],_e=l[I+2],(Pe&192)===128&&(_e&192)===128&&(Oe=(x&15)<<12|(Pe&63)<<6|_e&63,Oe>2047&&(Oe<55296||Oe>57343)&&(j=Oe));break;case 4:Pe=l[I+1],_e=l[I+2],Ae=l[I+3],(Pe&192)===128&&(_e&192)===128&&(Ae&192)===128&&(Oe=(x&15)<<18|(Pe&63)<<12|(_e&63)<<6|Ae&63,Oe>65535&&Oe<1114112&&(j=Oe))}}j===null?(j=65533,Te=1):j>65535&&(j-=65536,b.push(j>>>10&1023|55296),j=56320|j&1023),b.push(j),I+=Te}return Ut(b)}const _t=4096;function Ut(l){const d=l.length;if(d<=_t)return String.fromCharCode.apply(String,l);let m="",b=0;for(;b<d;)m+=String.fromCharCode.apply(String,l.slice(b,b+=_t));return m}function En(l,d,m){let b="";m=Math.min(l.length,m);for(let I=d;I<m;++I)b+=String.fromCharCode(l[I]&127);return b}function Ce(l,d,m){let b="";m=Math.min(l.length,m);for(let I=d;I<m;++I)b+=String.fromCharCode(l[I]);return b}function Be(l,d,m){const b=l.length;(!d||d<0)&&(d=0),(!m||m<0||m>b)&&(m=b);let I="";for(let x=d;x<m;++x)I+=ra[l[x]];return I}function Le(l,d,m){const b=l.slice(d,m);let I="";for(let x=0;x<b.length-1;x+=2)I+=String.fromCharCode(b[x]+b[x+1]*256);return I}v.prototype.slice=function(l,d){const m=this.length;l=~~l,d=d===void 0?m:~~d,l<0?(l+=m,l<0&&(l=0)):l>m&&(l=m),d<0?(d+=m,d<0&&(d=0)):d>m&&(d=m),d<l&&(d=l);const b=this.subarray(l,d);return Object.setPrototypeOf(b,v.prototype),b};function Ne(l,d,m){if(l%1!==0||l<0)throw new RangeError("offset is not uint");if(l+d>m)throw new RangeError("Trying to access beyond buffer length")}v.prototype.readUintLE=v.prototype.readUIntLE=function(l,d,m){l=l>>>0,d=d>>>0,m||Ne(l,d,this.length);let b=this[l],I=1,x=0;for(;++x<d&&(I*=256);)b+=this[l+x]*I;return b},v.prototype.readUintBE=v.prototype.readUIntBE=function(l,d,m){l=l>>>0,d=d>>>0,m||Ne(l,d,this.length);let b=this[l+--d],I=1;for(;d>0&&(I*=256);)b+=this[l+--d]*I;return b},v.prototype.readUint8=v.prototype.readUInt8=function(l,d){return l=l>>>0,d||Ne(l,1,this.length),this[l]},v.prototype.readUint16LE=v.prototype.readUInt16LE=function(l,d){return l=l>>>0,d||Ne(l,2,this.length),this[l]|this[l+1]<<8},v.prototype.readUint16BE=v.prototype.readUInt16BE=function(l,d){return l=l>>>0,d||Ne(l,2,this.length),this[l]<<8|this[l+1]},v.prototype.readUint32LE=v.prototype.readUInt32LE=function(l,d){return l=l>>>0,d||Ne(l,4,this.length),(this[l]|this[l+1]<<8|this[l+2]<<16)+this[l+3]*16777216},v.prototype.readUint32BE=v.prototype.readUInt32BE=function(l,d){return l=l>>>0,d||Ne(l,4,this.length),this[l]*16777216+(this[l+1]<<16|this[l+2]<<8|this[l+3])},v.prototype.readBigUInt64LE=At(function(l){l=l>>>0,kt(l,"offset");const d=this[l],m=this[l+7];(d===void 0||m===void 0)&&Ot(l,this.length-8);const b=d+this[++l]*2**8+this[++l]*2**16+this[++l]*2**24,I=this[++l]+this[++l]*2**8+this[++l]*2**16+m*2**24;return BigInt(b)+(BigInt(I)<<BigInt(32))}),v.prototype.readBigUInt64BE=At(function(l){l=l>>>0,kt(l,"offset");const d=this[l],m=this[l+7];(d===void 0||m===void 0)&&Ot(l,this.length-8);const b=d*2**24+this[++l]*2**16+this[++l]*2**8+this[++l],I=this[++l]*2**24+this[++l]*2**16+this[++l]*2**8+m;return(BigInt(b)<<BigInt(32))+BigInt(I)}),v.prototype.readIntLE=function(l,d,m){l=l>>>0,d=d>>>0,m||Ne(l,d,this.length);let b=this[l],I=1,x=0;for(;++x<d&&(I*=256);)b+=this[l+x]*I;return I*=128,b>=I&&(b-=Math.pow(2,8*d)),b},v.prototype.readIntBE=function(l,d,m){l=l>>>0,d=d>>>0,m||Ne(l,d,this.length);let b=d,I=1,x=this[l+--b];for(;b>0&&(I*=256);)x+=this[l+--b]*I;return I*=128,x>=I&&(x-=Math.pow(2,8*d)),x},v.prototype.readInt8=function(l,d){return l=l>>>0,d||Ne(l,1,this.length),this[l]&128?(255-this[l]+1)*-1:this[l]},v.prototype.readInt16LE=function(l,d){l=l>>>0,d||Ne(l,2,this.length);const m=this[l]|this[l+1]<<8;return m&32768?m|4294901760:m},v.prototype.readInt16BE=function(l,d){l=l>>>0,d||Ne(l,2,this.length);const m=this[l+1]|this[l]<<8;return m&32768?m|4294901760:m},v.prototype.readInt32LE=function(l,d){return l=l>>>0,d||Ne(l,4,this.length),this[l]|this[l+1]<<8|this[l+2]<<16|this[l+3]<<24},v.prototype.readInt32BE=function(l,d){return l=l>>>0,d||Ne(l,4,this.length),this[l]<<24|this[l+1]<<16|this[l+2]<<8|this[l+3]},v.prototype.readBigInt64LE=At(function(l){l=l>>>0,kt(l,"offset");const d=this[l],m=this[l+7];(d===void 0||m===void 0)&&Ot(l,this.length-8);const b=this[l+4]+this[l+5]*2**8+this[l+6]*2**16+(m<<24);return(BigInt(b)<<BigInt(32))+BigInt(d+this[++l]*2**8+this[++l]*2**16+this[++l]*2**24)}),v.prototype.readBigInt64BE=At(function(l){l=l>>>0,kt(l,"offset");const d=this[l],m=this[l+7];(d===void 0||m===void 0)&&Ot(l,this.length-8);const b=(d<<24)+this[++l]*2**16+this[++l]*2**8+this[++l];return(BigInt(b)<<BigInt(32))+BigInt(this[++l]*2**24+this[++l]*2**16+this[++l]*2**8+m)}),v.prototype.readFloatLE=function(l,d){return l=l>>>0,d||Ne(l,4,this.length),s.read(this,l,!0,23,4)},v.prototype.readFloatBE=function(l,d){return l=l>>>0,d||Ne(l,4,this.length),s.read(this,l,!1,23,4)},v.prototype.readDoubleLE=function(l,d){return l=l>>>0,d||Ne(l,8,this.length),s.read(this,l,!0,52,8)},v.prototype.readDoubleBE=function(l,d){return l=l>>>0,d||Ne(l,8,this.length),s.read(this,l,!1,52,8)};function Y(l,d,m,b,I,x){if(!v.isBuffer(l))throw new TypeError('"buffer" argument must be a Buffer instance');if(d>I||d<x)throw new RangeError('"value" argument is out of bounds');if(m+b>l.length)throw new RangeError("Index out of range")}v.prototype.writeUintLE=v.prototype.writeUIntLE=function(l,d,m,b){if(l=+l,d=d>>>0,m=m>>>0,!b){const j=Math.pow(2,8*m)-1;Y(this,l,d,m,j,0)}let I=1,x=0;for(this[d]=l&255;++x<m&&(I*=256);)this[d+x]=l/I&255;return d+m},v.prototype.writeUintBE=v.prototype.writeUIntBE=function(l,d,m,b){if(l=+l,d=d>>>0,m=m>>>0,!b){const j=Math.pow(2,8*m)-1;Y(this,l,d,m,j,0)}let I=m-1,x=1;for(this[d+I]=l&255;--I>=0&&(x*=256);)this[d+I]=l/x&255;return d+m},v.prototype.writeUint8=v.prototype.writeUInt8=function(l,d,m){return l=+l,d=d>>>0,m||Y(this,l,d,1,255,0),this[d]=l&255,d+1},v.prototype.writeUint16LE=v.prototype.writeUInt16LE=function(l,d,m){return l=+l,d=d>>>0,m||Y(this,l,d,2,65535,0),this[d]=l&255,this[d+1]=l>>>8,d+2},v.prototype.writeUint16BE=v.prototype.writeUInt16BE=function(l,d,m){return l=+l,d=d>>>0,m||Y(this,l,d,2,65535,0),this[d]=l>>>8,this[d+1]=l&255,d+2},v.prototype.writeUint32LE=v.prototype.writeUInt32LE=function(l,d,m){return l=+l,d=d>>>0,m||Y(this,l,d,4,4294967295,0),this[d+3]=l>>>24,this[d+2]=l>>>16,this[d+1]=l>>>8,this[d]=l&255,d+4},v.prototype.writeUint32BE=v.prototype.writeUInt32BE=function(l,d,m){return l=+l,d=d>>>0,m||Y(this,l,d,4,4294967295,0),this[d]=l>>>24,this[d+1]=l>>>16,this[d+2]=l>>>8,this[d+3]=l&255,d+4};function ce(l,d,m,b,I){nn(d,b,I,l,m,7);let x=Number(d&BigInt(4294967295));l[m++]=x,x=x>>8,l[m++]=x,x=x>>8,l[m++]=x,x=x>>8,l[m++]=x;let j=Number(d>>BigInt(32)&BigInt(4294967295));return l[m++]=j,j=j>>8,l[m++]=j,j=j>>8,l[m++]=j,j=j>>8,l[m++]=j,m}function we(l,d,m,b,I){nn(d,b,I,l,m,7);let x=Number(d&BigInt(4294967295));l[m+7]=x,x=x>>8,l[m+6]=x,x=x>>8,l[m+5]=x,x=x>>8,l[m+4]=x;let j=Number(d>>BigInt(32)&BigInt(4294967295));return l[m+3]=j,j=j>>8,l[m+2]=j,j=j>>8,l[m+1]=j,j=j>>8,l[m]=j,m+8}v.prototype.writeBigUInt64LE=At(function(l,d=0){return ce(this,l,d,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeBigUInt64BE=At(function(l,d=0){return we(this,l,d,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeIntLE=function(l,d,m,b){if(l=+l,d=d>>>0,!b){const Te=Math.pow(2,8*m-1);Y(this,l,d,m,Te-1,-Te)}let I=0,x=1,j=0;for(this[d]=l&255;++I<m&&(x*=256);)l<0&&j===0&&this[d+I-1]!==0&&(j=1),this[d+I]=(l/x>>0)-j&255;return d+m},v.prototype.writeIntBE=function(l,d,m,b){if(l=+l,d=d>>>0,!b){const Te=Math.pow(2,8*m-1);Y(this,l,d,m,Te-1,-Te)}let I=m-1,x=1,j=0;for(this[d+I]=l&255;--I>=0&&(x*=256);)l<0&&j===0&&this[d+I+1]!==0&&(j=1),this[d+I]=(l/x>>0)-j&255;return d+m},v.prototype.writeInt8=function(l,d,m){return l=+l,d=d>>>0,m||Y(this,l,d,1,127,-128),l<0&&(l=255+l+1),this[d]=l&255,d+1},v.prototype.writeInt16LE=function(l,d,m){return l=+l,d=d>>>0,m||Y(this,l,d,2,32767,-32768),this[d]=l&255,this[d+1]=l>>>8,d+2},v.prototype.writeInt16BE=function(l,d,m){return l=+l,d=d>>>0,m||Y(this,l,d,2,32767,-32768),this[d]=l>>>8,this[d+1]=l&255,d+2},v.prototype.writeInt32LE=function(l,d,m){return l=+l,d=d>>>0,m||Y(this,l,d,4,2147483647,-2147483648),this[d]=l&255,this[d+1]=l>>>8,this[d+2]=l>>>16,this[d+3]=l>>>24,d+4},v.prototype.writeInt32BE=function(l,d,m){return l=+l,d=d>>>0,m||Y(this,l,d,4,2147483647,-2147483648),l<0&&(l=4294967295+l+1),this[d]=l>>>24,this[d+1]=l>>>16,this[d+2]=l>>>8,this[d+3]=l&255,d+4},v.prototype.writeBigInt64LE=At(function(l,d=0){return ce(this,l,d,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),v.prototype.writeBigInt64BE=At(function(l,d=0){return we(this,l,d,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ze(l,d,m,b,I,x){if(m+b>l.length)throw new RangeError("Index out of range");if(m<0)throw new RangeError("Index out of range")}function ft(l,d,m,b,I){return d=+d,m=m>>>0,I||Ze(l,d,m,4),s.write(l,d,m,b,23,4),m+4}v.prototype.writeFloatLE=function(l,d,m){return ft(this,l,d,!0,m)},v.prototype.writeFloatBE=function(l,d,m){return ft(this,l,d,!1,m)};function pt(l,d,m,b,I){return d=+d,m=m>>>0,I||Ze(l,d,m,8),s.write(l,d,m,b,52,8),m+8}v.prototype.writeDoubleLE=function(l,d,m){return pt(this,l,d,!0,m)},v.prototype.writeDoubleBE=function(l,d,m){return pt(this,l,d,!1,m)},v.prototype.copy=function(l,d,m,b){if(!v.isBuffer(l))throw new TypeError("argument should be a Buffer");if(m||(m=0),!b&&b!==0&&(b=this.length),d>=l.length&&(d=l.length),d||(d=0),b>0&&b<m&&(b=m),b===m||l.length===0||this.length===0)return 0;if(d<0)throw new RangeError("targetStart out of bounds");if(m<0||m>=this.length)throw new RangeError("Index out of range");if(b<0)throw new RangeError("sourceEnd out of bounds");b>this.length&&(b=this.length),l.length-d<b-m&&(b=l.length-d+m);const I=b-m;return this===l&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(d,m,b):Uint8Array.prototype.set.call(l,this.subarray(m,b),d),I},v.prototype.fill=function(l,d,m,b){if(typeof l=="string"){if(typeof d=="string"?(b=d,d=0,m=this.length):typeof m=="string"&&(b=m,m=this.length),b!==void 0&&typeof b!="string")throw new TypeError("encoding must be a string");if(typeof b=="string"&&!v.isEncoding(b))throw new TypeError("Unknown encoding: "+b);if(l.length===1){const x=l.charCodeAt(0);(b==="utf8"&&x<128||b==="latin1")&&(l=x)}}else typeof l=="number"?l=l&255:typeof l=="boolean"&&(l=Number(l));if(d<0||this.length<d||this.length<m)throw new RangeError("Out of range index");if(m<=d)return this;d=d>>>0,m=m===void 0?this.length:m>>>0,l||(l=0);let I;if(typeof l=="number")for(I=d;I<m;++I)this[I]=l;else{const x=v.isBuffer(l)?l:v.from(l,b),j=x.length;if(j===0)throw new TypeError('The value "'+l+'" is invalid for argument "value"');for(I=0;I<m-d;++I)this[I+d]=x[I%j]}return this};const Ge={};function rt(l,d,m){Ge[l]=class extends m{constructor(){super(),Object.defineProperty(this,"message",{value:d.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${l}]`,this.stack,delete this.name}get code(){return l}set code(b){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:b,writable:!0})}toString(){return`${this.name} [${l}]: ${this.message}`}}}rt("ERR_BUFFER_OUT_OF_BOUNDS",function(l){return l?`${l} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),rt("ERR_INVALID_ARG_TYPE",function(l,d){return`The "${l}" argument must be of type number. Received type ${typeof d}`},TypeError),rt("ERR_OUT_OF_RANGE",function(l,d,m){let b=`The value of "${l}" is out of range.`,I=m;return Number.isInteger(m)&&Math.abs(m)>2**32?I=St(String(m)):typeof m=="bigint"&&(I=String(m),(m>BigInt(2)**BigInt(32)||m<-(BigInt(2)**BigInt(32)))&&(I=St(I)),I+="n"),b+=` It must be ${d}. Received ${I}`,b},RangeError);function St(l){let d="",m=l.length;const b=l[0]==="-"?1:0;for(;m>=b+4;m-=3)d=`_${l.slice(m-3,m)}${d}`;return`${l.slice(0,m)}${d}`}function Qt(l,d,m){kt(d,"offset"),(l[d]===void 0||l[d+m]===void 0)&&Ot(d,l.length-(m+1))}function nn(l,d,m,b,I,x){if(l>m||l<d){const j=typeof d=="bigint"?"n":"";let Te;throw x>3?d===0||d===BigInt(0)?Te=`>= 0${j} and < 2${j} ** ${(x+1)*8}${j}`:Te=`>= -(2${j} ** ${(x+1)*8-1}${j}) and < 2 ** ${(x+1)*8-1}${j}`:Te=`>= ${d}${j} and <= ${m}${j}`,new Ge.ERR_OUT_OF_RANGE("value",Te,l)}Qt(b,I,x)}function kt(l,d){if(typeof l!="number")throw new Ge.ERR_INVALID_ARG_TYPE(d,"number",l)}function Ot(l,d,m){throw Math.floor(l)!==l?(kt(l,m),new Ge.ERR_OUT_OF_RANGE(m||"offset","an integer",l)):d<0?new Ge.ERR_BUFFER_OUT_OF_BOUNDS:new Ge.ERR_OUT_OF_RANGE(m||"offset",`>= ${m?1:0} and <= ${d}`,l)}const Tn=/[^+/0-9A-Za-z-_]/g;function Cn(l){if(l=l.split("=")[0],l=l.trim().replace(Tn,""),l.length<2)return"";for(;l.length%4!==0;)l=l+"=";return l}function rn(l,d){d=d||1/0;let m;const b=l.length;let I=null;const x=[];for(let j=0;j<b;++j){if(m=l.charCodeAt(j),m>55295&&m<57344){if(!I){if(m>56319){(d-=3)>-1&&x.push(239,191,189);continue}else if(j+1===b){(d-=3)>-1&&x.push(239,191,189);continue}I=m;continue}if(m<56320){(d-=3)>-1&&x.push(239,191,189),I=m;continue}m=(I-55296<<10|m-56320)+65536}else I&&(d-=3)>-1&&x.push(239,191,189);if(I=null,m<128){if((d-=1)<0)break;x.push(m)}else if(m<2048){if((d-=2)<0)break;x.push(m>>6|192,m&63|128)}else if(m<65536){if((d-=3)<0)break;x.push(m>>12|224,m>>6&63|128,m&63|128)}else if(m<1114112){if((d-=4)<0)break;x.push(m>>18|240,m>>12&63|128,m>>6&63|128,m&63|128)}else throw new Error("Invalid code point")}return x}function rr(l){const d=[];for(let m=0;m<l.length;++m)d.push(l.charCodeAt(m)&255);return d}function ve(l,d){let m,b,I;const x=[];for(let j=0;j<l.length&&!((d-=2)<0);++j)m=l.charCodeAt(j),b=m>>8,I=m%256,x.push(I),x.push(b);return x}function qn(l){return a.toByteArray(Cn(l))}function on(l,d,m,b){let I;for(I=0;I<b&&!(I+m>=d.length||I>=l.length);++I)d[I+m]=l[I];return I}function Mt(l,d){return l instanceof d||l!=null&&l.constructor!=null&&l.constructor.name!=null&&l.constructor.name===d.name}function On(l){return l!==l}const ra=function(){const l="0123456789abcdef",d=new Array(256);for(let m=0;m<16;++m){const b=m*16;for(let I=0;I<16;++I)d[b+I]=l[m]+l[I]}return d}();function At(l){return typeof BigInt>"u"?Br:l}function Br(){throw new Error("BigInt not supported")}})(TS);var bS={exports:{}},Hn=bS.exports={},Gi,Qi;function QT(){throw new Error("setTimeout has not been defined")}function HT(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Gi=setTimeout:Gi=QT}catch{Gi=QT}try{typeof clearTimeout=="function"?Qi=clearTimeout:Qi=HT}catch{Qi=HT}})();function wS(n){if(Gi===setTimeout)return setTimeout(n,0);if((Gi===QT||!Gi)&&setTimeout)return Gi=setTimeout,setTimeout(n,0);try{return Gi(n,0)}catch{try{return Gi.call(null,n,0)}catch{return Gi.call(this,n,0)}}}function J$(n){if(Qi===clearTimeout)return clearTimeout(n);if((Qi===HT||!Qi)&&clearTimeout)return Qi=clearTimeout,clearTimeout(n);try{return Qi(n)}catch{try{return Qi.call(null,n)}catch{return Qi.call(this,n)}}}var Js=[],dp=!1,Uc,_y=-1;function Z$(){!dp||!Uc||(dp=!1,Uc.length?Js=Uc.concat(Js):_y=-1,Js.length&&SS())}function SS(){if(!dp){var n=wS(Z$);dp=!0;for(var a=Js.length;a;){for(Uc=Js,Js=[];++_y<a;)Uc&&Uc[_y].run();_y=-1,a=Js.length}Uc=null,dp=!1,J$(n)}}Hn.nextTick=function(n){var a=new Array(arguments.length-1);if(arguments.length>1)for(var s=1;s<arguments.length;s++)a[s-1]=arguments[s];Js.push(new ES(n,a)),Js.length===1&&!dp&&wS(SS)};function ES(n,a){this.fun=n,this.array=a}ES.prototype.run=function(){this.fun.apply(null,this.array)};Hn.title="browser";Hn.browser=!0;Hn.env={};Hn.argv=[];Hn.version="";Hn.versions={};function rl(){}Hn.on=rl;Hn.addListener=rl;Hn.once=rl;Hn.off=rl;Hn.removeListener=rl;Hn.removeAllListeners=rl;Hn.emit=rl;Hn.prependListener=rl;Hn.prependOnceListener=rl;Hn.listeners=function(n){return[]};Hn.binding=function(n){throw new Error("process.binding is not supported")};Hn.cwd=function(){return"/"};Hn.chdir=function(n){throw new Error("process.chdir is not supported")};Hn.umask=function(){return 0};var X$=bS.exports;(function(n){Object.defineProperty(n,Symbol.toStringTag,{value:"Module"});const a=TS,s=X$,f=g=>g&&g.__esModule?g:{default:g},u=f(s),y=globalThis||void 0||self;Object.defineProperty(n,"Buffer",{enumerable:!0,get:()=>a.Buffer}),Object.defineProperty(n,"process",{enumerable:!0,get:()=>u.default}),n.global=y})(It);class eG{}window.slStore=Object.create(null);const tG=(n,a)=>sR(n,a,{mount:({storeName:s})=>{window.slStore[s]||(window.slStore[s]={mounted:!0,history:[{type:"mount"}]}),window.slStore[s].store=n},unmount:({storeName:s})=>{var f;window.slStore[s].mounted=!1,(f=window.slStore[s])==null||f.history.push({type:"unmount"})},change:({actionName:s,storeName:f,changed:u,newValue:y,oldValue:g,valueMessage:v})=>{var E;(E=window.slStore[f])==null||E.history.push({type:"change",changed:u,newValue:y,oldValue:g,diff:g7({...g},{...y},{cyclesFix:!1}),actionName:s,valueMessage:v})},action:{start:({actionName:s,args:f,storeName:u})=>{var y;(y=window.slStore[u])==null||y.history.push({type:"action:start",actionName:s,args:f,storeName:u})},error:({actionName:s,error:f,storeName:u})=>{var y;(y=window.slStore[u])==null||y.history.push({type:"action:error",actionName:s,error:f})},end:({actionName:s,storeName:f})=>{var u;(u=window.slStore[f])==null||u.history.push({type:"action:end",actionName:s})}}});class u2{constructor(a,s){Z(this,"store");Z(this,"name");this.store=a,this.name=s,tG(this.store,this.name)}getStore(){return this.store}}const nG=n=>{const a=Object.keys(n);return h7(a.map(s=>n[s].getStore()),(...s)=>Object.fromEntries(a.map((f,u)=>[f,s[u]])))};class H1 extends u2{constructor(){super(...arguments);Z(this,"getValues",()=>this.getStore().get());Z(this,"getValue",s=>this.getStore().get()[s]);Z(this,"setValue",(s,f)=>this.getStore().setKey(s,f));Z(this,"subscribe",(...s)=>this.getStore().subscribe(...s));Z(this,"unsubscribe",()=>this.getStore().off())}}const iu=n=>RT(n);var Qs;(function(n){n.ORGANIZATION="ORGANIZATION",n.STREAM="STREAM"})(Qs||(Qs={}));const rG={[tr.BETTING]:"betting",[tr.GAMES]:"games",[tr.PUBLIC_CHAT]:"publicChat",[tr.TWITTER]:"twitter"};var fp;(function(n){n.Ready="ready",n.Suspended="suspended"})(fp||(fp={}));class NS{constructor({settings:a,...s},f){Z(this,"status");Z(this,"source");Z(this,"config");Z(this,"settings");Z(this,"listeners",new Set);Z(this,"settingsKey");Z(this,"enable",()=>{this.status.set(fp.Ready)});Z(this,"disable",()=>{this.status.set(fp.Suspended)});Z(this,"setFeatureConfig",({settings:a,...s})=>{var u;let f;for(f in s)this.config.setValue(f,s[f]);if(((u=a==null?void 0:a.overlaySettings)==null?void 0:u.case)!==void 0&&(a==null?void 0:a.overlaySettings.case)===this.settingsKey){const y=a.overlaySettings.value;if(y!==void 0){let g;for(g in y)y[g]!==0&&y[g]!==""&&this.settings.setValue(g,y[g])}}});Z(this,"update",(a,s)=>{this.source===Qs.STREAM&&s===Qs.ORGANIZATION||(this.setFeatureConfig(a),this.source=s)});this.settingsKey=rG[s.type],this.status=uu(fp.Suspended),this.config=new H1(iu(s),`feature:config:${this.settingsKey}`),this.settingsKey!==void 0&&(a==null?void 0:a.overlaySettings.case)===this.settingsKey?this.settings=new H1(iu(a.overlaySettings.value),`feature:settings:${this.settingsKey}`):this.settings=new H1(iu({}),`feature:settings:${this.settingsKey}`),this.source=f}get featureConfig(){return this.config.getStore()}get featureSettings(){return this.settings.getStore()}registerEventListener(a){this.listeners.add(a)}fireEvent(a){for(const s of this.listeners.values())try{s.onEvent(a)}catch(f){console.error(f)}}}class ri extends u2{constructor(){super(...arguments);Z(this,"getValue",()=>this.getStore().get());Z(this,"setValue",s=>this.getStore().set(s));Z(this,"subscribe",s=>this.getStore().subscribe(s));Z(this,"unsubscribe",()=>this.getStore().off())}getValues(){throw new Error("not implemented")}listen(s){return this.getStore().listen(s)}get(){return this.getStore().get()}}const Qa=n=>uu(n);class Ji extends u2{constructor(s,f,u){super(s,`api:${f}`);Z(this,"atomStore");Z(this,"getAtomStore",()=>this.atomStore);Z(this,"getValue",async()=>{const s=this.getStore();if(s.value===void 0)throw new Error("no store");return await s.value.promise,s.get().data});Z(this,"getValues",()=>{throw new Error("not implemented")});Z(this,"setValue",s=>this.getStore().set({loading:!1,data:s==null?void 0:s.data}));Z(this,"subscribe",s=>this.getStore().subscribe(s));Z(this,"unsubscribe",()=>{throw new Error("not implemented")});Z(this,"invalidate",()=>{this.store.invalidate()});Z(this,"listen",s=>this.getStore().listen(s));Z(this,"key",()=>this.getStore().key);Z(this,"off",()=>this.getStore().off());this.atomStore=uu(),u&&s.subscribe(y=>{const g=this.atomStore.get(),v=u(y,g);g!==v&&this.atomStore.set(v)})}get(){throw new Error("not implemented")}}async function*aG(n,a){for await(const s of a){n.response.message=s,n.received_at=Date.now();const f={type:"__GRPC_DEVTOOLS_EXTENSION__",data:n};window.postMessage(f),yield s}}const oG=()=>n=>async a=>{const s={name:a.url,stream:a.stream,sent_at:Date.now(),request:{header:Object.fromEntries(a.header.entries())},response:{}};try{const f=await n(a);if(s.received_at=Date.now(),s.response.header=Object.fromEntries(f.header.entries()),s.response.trailer=Object.fromEntries(f.trailer.entries()),a.stream){s.request.message=a.message;const u={type:"__GRPC_DEVTOOLS_EXTENSION__",data:{...s,stream:!1}};return window.postMessage(u),{...f,message:aG(s,f.message)}}else{s.request.message=a.message,s.response.message=f.message,s.latency=s.received_at-s.sent_at;const u={type:"__GRPC_DEVTOOLS_EXTENSION__",data:s};window.postMessage(u)}return f}catch(f){s.received_at=Date.now(),s.request.message=a.message,s.response.trailer={"grpc-status":f.code,"grpc-message":f.rawMessage},s.response.message=f.rawMessage,s.latency=s.received_at-s.sent_at;const u={type:"__GRPC_DEVTOOLS_EXTENSION__",data:s};throw window.postMessage(u),f}};window.dispatchEvent(new CustomEvent("grpc_devtools_loaded"));var ti;(function(n){n.Init="init",n.Ready="ready",n.Connecting="connecting",n.Connected="connected",n.Disconnected="disconnected",n.Failed="failed",n.Reconnect="reconnect",n.Reconnecting="reconnecting"})(ti||(ti={}));class iG{constructor(a,s,f,u){Z(this,"params");Z(this,"streamCancel");Z(this,"method");Z(this,"options");Z(this,"headers");Z(this,"listeners");Z(this,"state");Z(this,"store");Z(this,"paramsListener");Z(this,"reconnectTimeout");Z(this,"attempt",0);Z(this,"updateState",a=>{this.state.setValue("status",a),this.state.setValue("ts",new Date),this.addStateLog(`status => ${a}`)});Z(this,"addStateLog",a=>{const s=this.state.getStore().get().log;this.state.setValue("log",[...s,`${new Date().toLocaleString()}: ${a}`])});Z(this,"addListener",(a,s)=>this.listeners.has(a)?(this.addStateLog(`listener '${a}' not added, already exists`),!1):(this.listeners.set(a,s),this.addStateLog(`listener '${a}' added`),!0));Z(this,"removeListener",a=>{this.listeners.delete(a),this.addStateLog(`listener '${a}' removed`)});Z(this,"connect",()=>{this.updateState(ti.Connecting),this.streamCancel&&(this.addStateLog("disconnect prev connection"),this.streamCancel.abort(),this.streamCancel=void 0);const a="get"in this.params&&typeof this.params.get=="function"?this.params.get():this.params;(async()=>{this.streamCancel=new AbortController;try{const s={headers:this.headers.getValues(),signal:this.streamCancel.signal},f=this.method(a,s);for await(const u of f)this.attempt=0,this.onData(u)}catch(s){s instanceof nr&&s.code!=fn.Canceled&&this.onStreamError(s)}})(),this.updateState(ti.Connected)});Z(this,"disconnect",()=>{var a;this.streamCancel&&this.streamCancel.abort(),this.listeners.clear(),(a=this.paramsListener)==null||a.call(this),clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0,this.updateState(ti.Disconnected)});Z(this,"reconnect",()=>{if(this.reconnectTimeout)this.addStateLog("already reconnecting");else if(this.attempt<this.options.reconnectMaxAttempts){this.updateState(ti.Reconnect);const a=Math.min(this.options.reconnectMaxDelay,Math.pow(2,this.attempt)*this.options.reconnectDelay),s=Math.round(a*(1+Math.random())/2);this.reconnectTimeout=setTimeout(()=>{this.attempt++,this.updateState(ti.Reconnecting),this.addStateLog(`reconnect attempt ${this.attempt} after ${s}ms`),this.connect(),this.reconnectTimeout=void 0},s)}else this.addStateLog("max reconnect attempts reached"),this.disconnect()});Z(this,"getStore",()=>{var a;return(a=this.store)==null?void 0:a.getStore()});Z(this,"onData",a=>{try{this.addStateLog(`received data => ${JSON.stringify(a)}`),this.store&&this.store.setValue(a);for(const[,s]of this.listeners)s(a);this.addStateLog(`data routed to ${this.listeners.size} listeners`)}catch(s){this.addStateLog(`error process data => ${s}`)}});Z(this,"onStreamError",a=>{if(this.addStateLog(`error => ${a?JSON.stringify(a):"undefined"}}`),a!==void 0){if(a instanceof nr&&a.code!==fn.Canceled){this.updateState(ti.Failed),this.state.setValue("error",a),this.reconnect();return}this.disconnect()}});const y={status:ti.Init,ts:new Date,log:[]};this.state=new H1(iu(y),`subscription:${u.name}:state`),this.options={...u,reconnectDelay:u.reconnectDelay??1e3,reconnectMaxDelay:u.reconnectMaxDelay??3e4,reconnectMaxAttempts:u.reconnectMaxAttempts??10,withStore:u.withStore??!1},this.headers=a,this.listeners=new Map,this.params=f,this.method=s,u.withStore&&(this.store=new ri(Qa(null),`subscription:${u.name}:store`)),"subscribe"in f&&typeof f.subscribe=="function"&&(this.paramsListener=f.subscribe(g=>{this.state.getValue("status")===ti.Connected&&(this.addStateLog(`params updated, reconnect => ${JSON.stringify(g)}`),this.reconnect())})),this.updateState(ti.Ready)}}class sG{constructor(a){Z(this,"toJsonOptions",{emitDefaultValues:!1,enumAsInteger:!0,useProtoFieldName:!1});Z(this,"transport");Z(this,"nanoquery");Z(this,"host");Z(this,"interceptors",[]);Z(this,"$headers");Z(this,"clients");Z(this,"callbackClients");Z(this,"subscriptions");Z(this,"addSubscription",(a,s,f)=>{const u=this.subscriptions.get(s);if(u)return u;const y=new iG(this.$headers,a,s,f);return this.subscriptions.set(s,y),y});Z(this,"removeSubscription",a=>{a.disconnect(),this.subscriptions.delete(a.params)});Z(this,"disconnect",()=>{for(const[a,s]of this.subscriptions)s.disconnect(),this.subscriptions.delete(a)});Z(this,"registerInterceptor",a=>{this.interceptors.push(a)});Z(this,"removeInterceptor",a=>{this.interceptors=this.interceptors.filter(s=>s!==a)});Z(this,"getClient",a=>{const s=a.typeName;if(this.clients.has(s))return this.clients.get(s);const f=vB(a,this.transport);return this.clients.set(s,f),f});Z(this,"createPromiseClient",(a,{params:s=[],method:f})=>{const u=this.getClient(a),y=a.methods[f].name,g=[a.typeName,y.charAt(0).toLowerCase()+y.slice(1),...Array.isArray(s)?s:[s]],v=[a.typeName,y.charAt(0).toLowerCase()+y.slice(1)];return{client:u,queryKey:g,queryKeyStr:v.join("")}});Z(this,"createStreamClient",a=>({client:this.getClient(a)}));Z(this,"setSdkKey",a=>{this.$headers.setValue("sdk",a)});Z(this,"setAuth",(a,s)=>{this.$headers.setValue("authorization",a),this.$headers.setValue("sl-user-id",s)});Z(this,"setHeader",(a,s)=>this.$headers.setValue(a,s));Z(this,"getHeader",a=>this.$headers.getValue(a));Z(this,"getHeaders",()=>this.$headers.getValues());Z(this,"initInterceptors",()=>{if(this.interceptors.length!==0)return;const a=s=>f=>{const u=this.$headers.getValues();for(const y in u)f.header.set(y,u[y]);return s(f)};this.interceptors.push(a),this.interceptors.push(oG())});var y,g;this.host=a,this.$headers=new H1(iu({"sl-device-id":((g=(y=It.process)==null?void 0:y.env)==null?void 0:g.NX_DEVICE_ID)||"sdk-web-dev"}),"transport:headers"),this.initInterceptors(),this.clients=new Map,this.callbackClients=new Map,this.subscriptions=new Map;const[s,f,u]=YB();this.nanoquery={createFetcherStore:s,createMutatorStore:f,utils:u},this.transport=FB({baseUrl:a,interceptors:this.interceptors,useBinaryFormat:!0})}}const lG=(n,a)=>{const{client:s,queryKey:f}=a.createPromiseClient(iY,{method:"retrieveEventId",params:[n]});return a.nanoquery.createFetcherStore(f,{fetcher:async(u,y,g)=>{var v;if(!g||typeof g!="string")return"";try{return((v=(await s.retrieveEventId({id:g})).data)==null?void 0:v.id)||""}catch{return""}}})},uG=(n,a)=>{const{client:s,queryKey:f}=a.createPromiseClient(eh,{method:"getStream",params:[n]});return a.nanoquery.createFetcherStore(f,{fetcher:async(u,y,g)=>{var v;return g?(v=(await s.getStream({id:g})).data)==null?void 0:v.attributes:void 0}})},cG=(n,a)=>{const{queryKey:s,client:f}=a.createPromiseClient(hS,{method:"me",params:[n]});return a.nanoquery.createFetcherStore(s,{fetcher:()=>f.me({})})},dG=n=>{const{client:a}=n.createPromiseClient(hS,{method:"bypassAuth"});return({userKey:s,schema:f,init:u})=>a.bypassAuth({userKey:s,schema:f,init:u})},fG=(n,a)=>{const{client:s,queryKey:f}=a.createPromiseClient(eh,{method:"get",params:[n]});return a.nanoquery.createFetcherStore(f,{fetcher:async()=>{var u;return(u=(await s.get({})).data)==null?void 0:u.attributes}})},pG=(n,a)=>{const{client:s,queryKey:f}=a.createPromiseClient(eh,{method:"getOrganization",params:[n]});return a.nanoquery.createFetcherStore(f,{fetcher:async()=>{const u=await s.getOrganization({});return u.data?{...u.data.attributes,id:u.data.id}:void 0}})},mG=(n,a)=>{const{client:s,queryKey:f}=a.createPromiseClient(eh,{method:"getOrganizationAdvertising",params:[n]});return a.nanoquery.createFetcherStore(f,{fetcher:async()=>{var u;return(u=(await s.getOrganizationAdvertising({})).data)==null?void 0:u.attributes}})},hG=(n,a,s)=>{n.transport=new sG(a.host),n.sdk.host=n.transport.host,n.transport.setSdkKey(a.sdkKey),s()};class _6{constructor(a="main"){Z(this,"delimiter",":");Z(this,"prefix");Z(this,"clear",()=>{for(const a in window.localStorage)a.startsWith(this.prefix)&&window.localStorage.removeItem(a)});Z(this,"generateKey",a=>`${this.prefix}${this.delimiter}${a.join(this.delimiter)}`);Z(this,"write",(...a)=>{const s=a.pop()||"";window.localStorage.setItem(this.generateKey(a),s)});Z(this,"read",(...a)=>{const s=window.localStorage.getItem(this.generateKey(a));return s===null?void 0:s});Z(this,"remove",(...a)=>{window.localStorage.removeItem(this.generateKey(a))});this.prefix=`sl-sdk${this.delimiter}${a}`}}var Ys;(function(n){n.SCHEMA="schema",n.EXTERNAL_TOKEN="eToken",n.TOKEN="token"})(Ys||(Ys={}));class op extends _6{constructor(){super("user");Z(this,"setSchema",s=>{this.write(Ys.SCHEMA,s)});Z(this,"getSchema",()=>this.read(Ys.SCHEMA));Z(this,"setToken",s=>{this.write(Ys.TOKEN,s)});Z(this,"getToken",()=>this.read(Ys.TOKEN));Z(this,"setExternalToken",s=>{this.write(Ys.EXTERNAL_TOKEN,s)});Z(this,"getExternalToken",()=>this.read(Ys.EXTERNAL_TOKEN));Z(this,"removeToken",()=>{this.remove(Ys.TOKEN)})}}var Hs;(function(n){n.DISABLED="disabled",n.INITIALIZATION="initialization",n.READY="ready",n.FAILED="failed",n.SUSPENDED="suspended"})(Hs||(Hs={}));const gG=n=>{const a=new op,s=new ri(Qa(a.getExternalToken()),"userKey"),f=new ri(Qa(a.getToken()),"userToken"),u=new Ji(cG(f.getStore(),n),"user",({data:g,error:v,loading:E},_)=>{var L;if(!v)return(L=g==null?void 0:g.data)!=null&&L.id?g.data.id:E===!1?void 0:_}),y=new Ji(fG(f.getStore(),n),"userSettings");return{userKey:s,userToken:f,user:u,userSettings:y}},yG=n=>{const a=new ri(Qa(void 0),"providerStreamId"),s=new Ji(lG(a.getStore(),n),"slStreamId",u=>u==null?void 0:u.data),f=new Ji(uG(s.getAtomStore(),n),"streamSettings");return s.getAtomStore().listen(u=>{(u===""||u===void 0)&&f.getStore().mutate(void 0)}),{providerStreamId:a,slStreamId:s,streamSettings:f}},vG=n=>{const a=new ri(Qa(void 0),"enabled"),s=new ri(Qa(Hs.DISABLED),"status"),f=new Ji(pG(a.getStore(),n),"organizationSettings",v=>{var E;return(E=v==null?void 0:v.data)==null?void 0:E.id}),u=new Ji(mG(f.getAtomStore(),n),"organizationAdvertising"),y=gG(n),g=yG(n);return{enabled:a,status:s,providerStreamId:g.providerStreamId,slStreamId:g.slStreamId,streamSettings:g.streamSettings,user:y.user,userKey:y.userKey,userToken:y.userToken,userSettings:y.userSettings,organizationSettings:f,organizationAdvertising:u}};class TG extends u2{constructor(s){const f=vG(s),u=nG(f);super(u,"core");Z(this,"stores");Z(this,"subscribe",s=>{let f;for(f in this.stores){const u=s[f];f in s&&u!==void 0&&this.stores[f].subscribe(s[f])}});Z(this,"unsubscribe",()=>this.getStore().off());this.stores=f}getValue(){throw new Error("Not implemented")}getValues(){return this.stores}setValue(){throw new Error("Not implemented")}}class kG extends eG{constructor(s,f){super();Z(this,"$coreStore");Z(this,"transport");Z(this,"bypassLogin");Z(this,"me",async()=>{var s;return this.$coreStore.getValues().user.invalidate(),(s=await this.$coreStore.getValues().user.getValue())==null?void 0:s.data});Z(this,"login",async(s,f)=>{var v,E;this.$coreStore.getValues().userKey.setValue(f);const u=await this.bypassLogin({schema:s,userKey:f,init:!1}),y=(v=u.meta)==null?void 0:v.jwt,g=(E=u.data)==null?void 0:E.id;if(!y||!g)throw new Error("internal: token missing");return this.$coreStore.getValues().user.getStore().mutate(u),this.saveUser(y,g),y});Z(this,"isAuthenticated",()=>this.me());Z(this,"logout",()=>{this.$coreStore.getValues().user.setValue(),this.$coreStore.getValues().userKey.setValue(),this.$coreStore.getValues().userToken.setValue(),this.transport.setAuth("",""),new op().clear()});Z(this,"softLogout",()=>{const s=new op;this.transport.setAuth("",""),s.setToken(""),this.reLogin()});Z(this,"reLogin",()=>{const s=new op,f=s.getToken(),u=s.getExternalToken();if(this.$coreStore.getValues().userKey.setValue(u),f)return this.saveUser(f,""),this.me().then(y=>{if(y!=null&&y.id){const g=y.id;this.saveUser(f,g)}});if(u&&!f){const y=s.getSchema();y&&u&&this.login(y,u).catch(()=>{this.logout()})}});Z(this,"saveUser",(s,f)=>{this.transport.setAuth(s,f),this.$coreStore.getValues().userToken.setValue(s),new op().setToken(s)});Z(this,"connect",()=>{this.transport.registerInterceptor(s=>async f=>{try{return await s(f)}catch(u){throw u.code&&(u.code===7||u.code===16)&&this.transport.getHeader("authorization")&&this.softLogout(),u}})});this.$coreStore=s,this.transport=f,this.bypassLogin=dG(this.transport),this.connect()}}const Y1=new op,bG=(n,a,s)=>{n.auth=new kG(n.store,n.transport),n.stores.status.listen(f=>{f===Hs.READY&&n.auth.reLogin()}),n.sdk.userId=n.stores.user.getAtomStore,n.sdk.authorizationBypass=async(f,u)=>{if(!(Y1.getSchema()===f&&Y1.getExternalToken()===u&&n.transport.getHeader("authorization")))try{await n.auth.login(f,u),Y1.setSchema(f),Y1.setExternalToken(u)}catch{n.sdk.logout()}},n.sdk.logout=()=>{n.auth.logout(),Y1.clear()},n.sdk.getUserStore=()=>n.stores.user.getStore(),n.sdk.isUserAuthorized=()=>n.auth.isAuthenticated(),s()},wG=(n,a,s)=>{n.store=new TG(n.transport),n.stores=n.store.getValues(),n.sdk.enabled=n.stores.enabled.getStore(),n.sdk.status=n.stores.status.getStore(),n.sdk.sdkStore=Object.fromEntries(Object.entries(n.stores).map(([f,u])=>[f,u.getStore()])),n.sdk.organizationStore=()=>n.stores.organizationSettings.getStore(),n.sdk.streamStore=()=>n.stores.streamSettings.getStore(),n.storeUnsubscribe=()=>{n.store.unsubscribe()},s()},SG=(n,a,s)=>{n.sdk=Object.create(null),n.sdk.initializeApp=async f=>{if(n.contextConfig=f,n.stores.enabled.get()==="on")return{enabled:!0};n.storeSubscribe(),n.stores.enabled.setValue("on"),n.stores.status.setValue(Hs.INITIALIZATION);try{const u=await n.stores.organizationSettings.getValue();return u?(n.stores.status.setValue(Hs.READY),{enabled:!!u}):(n.stores.status.setValue(Hs.FAILED),{err:"failed"})}catch(u){return n.stores.enabled.setValue(),n.stores.status.setValue(Hs.FAILED),{err:`${u}`}}},n.sdk.disableApp=()=>{n.stores.enabled.get()==="on"&&(n.stores.enabled.setValue(),n.stores.status.setValue(Hs.DISABLED),n.sdk.closeFeature(!0),n.storeUnsubscribe(),n.transport.disconnect())},n.sdk.createEventSession=f=>{n.stores.providerStreamId.setValue(f)},s()},EG=C7({level:"trace",enabled:!1,browser:{write:n=>{console.log(n)}}}),MS=(n,a)=>EG.child({name:n},a),NG=(n,a,s)=>{const{client:f,queryKey:u}=s.createPromiseClient(yS,{method:"summary",params:[n,a]});return s.nanoquery.createFetcherStore(u,{fetcher:async(y,g,v,E)=>{var _;return(_=(await f.summary({eventId:v,userId:E})).data)==null?void 0:_.attributes}})},MG=n=>{const{client:a}=n.createPromiseClient(yS,{method:"list"});return s=>a.list(s)},IG=(n,a)=>{const{client:s,queryKey:f}=a.createPromiseClient(nl,{method:"get",params:[n]});return a.nanoquery.createFetcherStore(f,{fetcher:async(u,y,g)=>{var v;return(v=(await s.get({eventId:g})).data)==null?void 0:v.attributes}})},_G=(n,a)=>{const{client:s,queryKey:f}=a.createPromiseClient(nl,{method:"syncQuestion",params:[n]});return a.nanoquery.createFetcherStore(f,{fetcher:async(u,y,g)=>{var v;return g?(v=(await s.syncQuestion({filter:{eventId:g}})).data)==null?void 0:v.attributes:void 0}})},CG=(n,a)=>{const{client:s}=a.createStreamClient(nl),f=uu({eventId:n.get()||"",feedId:""});return n.subscribe((u="")=>{f.set({eventId:u,feedId:""})}),a.addSubscription(s.subscription,f,{name:"feedSubscription"})},OG=(n,a)=>{const{client:s}=a.createStreamClient(nl);return a.addSubscription(s.questionSubscription,{questionId:n},{name:"questionSubscription"})},IS=async(n,a)=>{var f,u;const{client:s}=a.createPromiseClient(nl,{method:"questionByUser",params:[n]});return(u=(f=(await s.questionByUser({questionId:n})).data)==null?void 0:f.attributes)==null?void 0:u.question},AG=(n,a)=>{const{client:s,queryKey:f}=a.createPromiseClient(nl,{method:"list",params:[n]});return a.nanoquery.createFetcherStore(f,{fetcher:async(u,y,g)=>g?(await s.list({eventId:g,filter:{statuses:[lo.ACTIVE,lo.RESOLVED]}})).data:[]})};var C6={exports:{}};const xG=Object.getPrototypeOf({});function O6(n){function a(Q){return Q!=="constructor"&&Q!=="prototype"&&Q!=="__proto__"}function s(Q){let se=0;const ee=Q.length,ue=new Array(ee);for(se=0;se<ee;++se)ue[se]=U(Q[se]);return ue}function f(Q){const se={};if(E&&Object.getPrototypeOf(Q)!==xG)return E(Q);const ee=v(Q);let ue,J,ye;for(ue=0,J=ee.length;ue<J;++ue)a(ye=ee[ue])&&(se[ye]=U(Q[ye]));return se}function u(Q,se){const ee=Q.length,ue=se.length;let J=0;const ye=new Array(ee+ue);for(J=0;J<ee;++J)ye[J]=U(Q[J]);for(J=0;J<ue;++J)ye[J+ee]=U(se[J]);return ye}const y=Object.prototype.propertyIsEnumerable;function g(Q){const se=Object.keys(Q),ee=Object.getOwnPropertySymbols(Q);for(let ue=0,J=ee.length;ue<J;++ue)y.call(Q,ee[ue])&&se.push(ee[ue]);return se}const v=n&&n.symbols?g:Object.keys,E=typeof(n==null?void 0:n.cloneProtoObject)=="function"?n.cloneProtoObject:void 0;function _(Q){return typeof Q=="object"&&Q!==null&&!(Q instanceof RegExp)&&!(Q instanceof Date)}function L(Q){return typeof Q!="object"||Q===null}const R=typeof It.Buffer<"u"?Q=>typeof Q!="object"||Q===null||Q instanceof RegExp||Q instanceof Date||Q instanceof It.Buffer:Q=>typeof Q!="object"||Q===null||Q instanceof RegExp||Q instanceof Date,A=n&&typeof n.mergeArray=="function"?n.mergeArray({clone:U,deepmerge:G,getKeys:v,isMergeableObject:_}):u;function U(Q){return _(Q)?Array.isArray(Q)?s(Q):f(Q):Q}function V(Q,se){const ee={},ue=v(Q),J=v(se);let ye,fe,Ue;for(ye=0,fe=ue.length;ye<fe;++ye)a(Ue=ue[ye])&&J.indexOf(Ue)===-1&&(ee[Ue]=U(Q[Ue]));for(ye=0,fe=J.length;ye<fe;++ye)a(Ue=J[ye])&&(Ue in Q&&(ue.indexOf(Ue)!==-1&&(ee[Ue]=G(Q[Ue],se[Ue])),!0)||(ee[Ue]=U(se[Ue])));return ee}function G(Q,se){const ee=Array.isArray(se),ue=Array.isArray(Q);return L(se)?se:R(Q)?U(se):ee&&ue?A(Q,se):ee!==ue?U(se):V(Q,se)}function ae(){switch(arguments.length){case 0:return{};case 1:return U(arguments[0]);case 2:return G(arguments[0],arguments[1])}let Q;for(let se=0,ee=arguments.length;se<ee;++se)Q=G(Q,arguments[se]);return Q}return n&&n.all?ae:G}C6.exports=O6;C6.exports.default=O6;var LG=C6.exports.deepmerge=O6;const RG=n=>(a,s)=>{let f=0;const u=a.length,y=s.length,g=Math.max(u,y),v=new Array(g);for(f=0;f<g;++f)f<y?v[f]=n.deepmerge(a[f],s[f]):v[f]=n.clone(a[f]);return v},DG=LG({mergeArray:RG}),UG=(n,a,s)=>{const f=h7([a,s],(y,g)=>{if(y){if(g.data)return g.data.find(v=>v.id===y);console.error("Feed list is not loaded yet. Issue with the opened question.")}}),u=iu({data:void 0,loading:void 0,error:void 0});return f.subscribe(async y=>{if(y&&y.type==="question"){u.setKey("loading",!0);const g=await IS(y.id,n);u.set({data:g,loading:!1});return}u.set({data:void 0,loading:!1})}),{$store:f,$extendedStore:u,updateExtendedQuestion:y=>{const g=u.get().data;if(g)for(const v of(y==null?void 0:y.answers)||[])v.youVoted!==!0&&delete v.youVoted;u.set({data:DG(g,y)})}}};class PG{constructor(a){Z(this,"slStreamId");Z(this,"organizationId");Z(this,"userId");Z(this,"openedQuestionId");Z(this,"openedQuestion");Z(this,"activeQuestionId");Z(this,"feedList");Z(this,"moderationId");Z(this,"moderation");Z(this,"feedSubscription");Z(this,"questionSubscription");Z(this,"notifications");Z(this,"log");Z(this,"getCurrentSessionId",a=>{const s=a.eventId||this.slStreamId.get()||"",f=a.userId||this.userId.get()||"",u=a.organizationId||this.organizationId.get()||"",y=a.entity||"",g=a.prefix||"";return[u,s,f,g,y].join(":")});Z(this,"disconnect",()=>{var a;(a=this.feedSubscription)==null||a.disconnect()});Z(this,"openQuestion",a=>{this.openedQuestionId.set(a),this.notifications.markAsViewed(this.getCurrentSessionId({prefix:"notification",entity:a}))});Z(this,"closeQuestion",a=>{this.openedQuestionId.set(void 0),a&&this.notifications.markAsViewed(this.getCurrentSessionId({prefix:"notification",entity:a}))});this.log=MS("gamification-background"),this.slStreamId=a.stores.slStreamId.getAtomStore(),this.organizationId=a.stores.organizationSettings.getAtomStore(),this.userId=a.stores.user.getAtomStore(),this.moderationId=new ri(Qa(void 0),"moderationId").getStore(),this.openedQuestionId=new ri(Qa(void 0),"openedQuestionId").getStore(),this.notifications=a.notifications,this.moderation=new Ji(IG(this.slStreamId,a.transport),"gamification:moderation"),this.feedList=new Ji(AG(this.slStreamId,a.transport),"gamification:feedList"),this.activeQuestionId=new Ji(_G(this.slStreamId,a.transport),"gamification:activeQuestionId"),this.openedQuestion=UG(a.transport,this.openedQuestionId,this.feedList.getStore()),this.openedQuestionId.listen(s=>{this.log.debug({questionId:s},"received question"),s?(this.questionSubscription=OG(s,a.transport),this.questionSubscription.addListener("feed-subscription-opened-question",f=>{window.requestAnimationFrame(()=>{var u,y;this.openedQuestion.updateExtendedQuestion((y=(u=f.data)==null?void 0:u.attributes)==null?void 0:y.question)})}),this.questionSubscription.connect()):(this.log.info("cleanup on close question"),this.questionSubscription!==void 0&&(a.transport.removeSubscription(this.questionSubscription),this.questionSubscription=void 0))}),this.feedSubscription=CG(this.slStreamId,a.transport),this.feedSubscription.addListener("feed-subscription-active-question",s=>{window.requestAnimationFrame(()=>{var u;const f=this.activeQuestionId.getStore();f&&f.mutate((u=s.data)==null?void 0:u.attributes)})}),this.feedSubscription.connect()}}class jG{constructor(a){Z(this,"notificationsList");Z(this,"notifications");Z(this,"store");Z(this,"timeouts");Z(this,"waitingQueue");Z(this,"activeQueue");Z(this,"options");Z(this,"logger");Z(this,"addToQueue",a=>{if(this.store.has(a.id)){this.logger.debug({notification:a},"skip existed notification: %o");return}const s=a.close,f=a.action;if(this.store.set(a.id,{...a,close:(...u)=>{s&&s(...u),this.closeNotification(a.id)},action:(...u)=>{f&&f(...u),this.closeNotification(a.id)}}),this.waitingQueue.add(a.id),this.activeQueue.size===this.options.concurrency){const[u]=this.activeQueue;this.closeNotification(u)}else this.tickWaitingQueue()});Z(this,"tickWaitingQueue",()=>{if(this.activeQueue.size<this.options.concurrency){const[a]=this.waitingQueue;if(!a)return;this.activeQueue.add(a),this.waitingQueue.delete(a),this.logger.debug({job:a},"waiting queue tick"),this.tickActiveQueue(a)}else this.logger.debug({queueSize:this.activeQueue.size,concurrency:this.options.concurrency},"waiting queue tick skipped")});Z(this,"tickActiveQueue",a=>{if(!a)return;const s=this.store.get(a);if(!s){this.logger.debug({notificationId:a},"active queue tick skipped, notification not exist");return}const f=setTimeout(()=>{const u=a,y=new Map(this.notifications.getValue());y.set(s.id,s),this.notifications.setValue(y);const g=setTimeout(()=>{this.logger.debug({notificationId:u,delay:s.autoHideDuration||5e3},"notification hiding by autoHideDuration"),this.closeNotification(u)},s.autoHideDuration||5e3);this.timeouts.set(u,g),this.logger.debug({notificationId:u,queue:[...y.values()]},"notification displayed")},s.delay||0);this.timeouts.set(a,f),this.logger.debug({notificationId:a},"active queue tick completed"),this.tickWaitingQueue()});Z(this,"closeNotification",a=>{const s=new Map(this.notifications.getValue()),f=s.get(a);if(f){f.hiding=!(this.waitingQueue.size>=this.options.concurrency),this.notifications.setValue(s);const u=setTimeout(()=>{const y=new Map(this.notifications.getValue());y.delete(a),this.notifications.setValue(y);const g=this.timeouts.get(a);g!==void 0&&(clearTimeout(g),this.timeouts.delete(a)),this.logger.debug({notificationId:a},"notification hidden")},this.options.animationDelay||0);this.timeouts.set(a,u)}this.store.delete(a),this.activeQueue.delete(a),this.waitingQueue.delete(a),this.tickWaitingQueue(),this.logger.debug({notificationId:a},"notification hiding")});this.options=a,this.logger=MS("notifications"),this.store=new Map,this.timeouts=new Map,this.waitingQueue=new Set,this.activeQueue=new Set,this.notifications=new ri(Qa(new Map),"notifications-queue"),this.notificationsList=this.notifications.getStore()}}var By;(function(n){n.OPENED="opened"})(By||(By={}));class zG extends _6{constructor(){super("notification");Z(this,"setOpened",s=>{this.write(By.OPENED,s,"true")});Z(this,"isOpened",s=>this.read(By.OPENED,s));Z(this,"clearNotification",()=>{this.clear()})}}var Pc;(function(n){n[n.ONBOARDING=1]="ONBOARDING",n[n.QUESTION=2]="QUESTION",n[n.QUESTION_RESOLVED=3]="QUESTION_RESOLVED"})(Pc||(Pc={}));class BG{constructor(a={}){Z(this,"queue");Z(this,"storage");Z(this,"add",a=>{this.storage.isOpened(a.id)||this.queue.addToQueue(a)});Z(this,"close",a=>{this.queue.closeNotification(a),this.markAsViewed(a)});Z(this,"getQueueStore",()=>this.queue.notificationsList);Z(this,"markAsViewed",a=>{this.storage.setOpened(a)});this.storage=new zG,this.queue=new jG({concurrency:1,animationDelay:1600,...a})}}const FG=(n,a,s)=>{n.notifications=new BG,n.addNotification=n.notifications.add,n.sdk.getNotificationsStore=()=>n.notifications.getQueueStore(),s()},VG=(n,a)=>{const{client:s}=n.createPromiseClient(nl,{method:"submitAnswer"});return s.submitAnswer({data:a})},YG=(n,a)=>{const{client:s}=n.createPromiseClient(nl,{method:"submitInplay"});return s.submitInplay({data:{eventId:+a}})},$G=(n,a)=>{const{client:s}=n.createPromiseClient(nl,{method:"skipQuestion"});return s.skipQuestion({data:{id:a}})};var Fy;(function(n){n.ONBOARDING="onboarding"})(Fy||(Fy={}));class _S extends _6{constructor(){super("gamification");Z(this,"saveOnboardingStatus",({userId:s,eventId:f,organizationId:u},y)=>{this.write(Fy.ONBOARDING,u,s,f,y)});Z(this,"getOnboardingStatus",({userId:s,eventId:f,organizationId:u})=>this.read(Fy.ONBOARDING,u,s,f))}}const sw={pageSize:10},GG=(n,a,s)=>{let f=0;const u=Qa({pageSize:(s==null?void 0:s.pageSize)||sw.pageSize,page:0}),y=iu({data:[],hasMore:!0,loading:void 0,error:void 0}),g=MG(n),v=async L=>{if(L){y.setKey("loading",!0);const R={eventId:L,pagination:{page:0,pageSize:(s==null?void 0:s.pageSize)||sw.pageSize}},A=await g(R);y.set({data:A.data.map(U=>U.attributes),hasMore:!0,loading:!1}),A.meta&&(f=Math.round(A.meta.count/A.meta.pageSize)),u.set(R.pagination)}},E=()=>{v(a.get())},_=L=>{const R=u.get(),A=L||R.page+1;A<=f&&u.set({...R,page:A})};return e2(y,()=>{const L=a.listen(v),R=u.listen(async A=>{const U=a.get();if(A.page>0&&U)if(A.page<f){y.setKey("loading",!0);const V=await g({eventId:U,pagination:A}),G=y.get().data||[];y.set({data:[...G,...V.data.map(ae=>ae.attributes)],loading:!1,hasMore:!0})}else y.setKey("hasMore",!1)});return()=>{L(),R()}}),{$store:y,fetchMore:_,invalidate:E}},QG=(n,a)=>{const{client:s,queryKey:f}=n.createPromiseClient(eh,{method:"generateDeepLink",params:a});return n.nanoquery.createFetcherStore(f,{fetcher:async(u,y,g)=>{var v;return g?(v=(await s.generateDeepLink({data:{eventId:g}})).data)==null?void 0:v.attributes:{}}})},HG=(n,{web:a,mobile:s})=>{const{client:f}=n.createPromiseClient(F$,{method:"generate"});return f.generate({web:a,mobile:s})},qG=(n,a,s)=>{const f=iu({});return e2(f,()=>QG(n,[a]).subscribe(async({data:u})=>{var g;const y=u==null?void 0:u.url;if(y){f.setKey("loading",!0);const v=`${window.location.host+window.location.pathname}%23sl_eid=${a.get()}&sl_uid=${s.get()}`,E=await HG(n,{web:v,mobile:y});f.set({data:(g=E.data)==null?void 0:g.link,loading:!1})}})),{$store:f,fetch}};var Pr;(function(n){n.Unset="unset",n.Required="required",n.Optional="optional",n.Completed="completed",n.Disabled="disabled",n.Unavailable="unavailable"})(Pr||(Pr={}));const WG=(n,a,s,f)=>{const u=new _S,y=Qa(Pr.Unset),g=()=>{const{inplayGame:E}=n.featureSettings.get(),_=a.getCurrentSessionId({prefix:"onboarding"});E&&E.enable&&f.add({type:Pc.ONBOARDING,id:_,action:n.openFeature,close:()=>{f.markAsViewed(_)},delay:1e3,autoHideDuration:1e6,data:{questionType:Jt.UNSET,onboarding:{...E}}})};y.subscribe(E=>{(E===Pr.Optional||Pr.Required)&&g(),E===Pr.Completed&&a.activeQuestionId.invalidate()});const v=async()=>{var A,U,V,G,ae;const E=a.userId.get();if(!E){y.set(Pr.Unset);return}u.getOnboardingStatus({userId:E,organizationId:a.organizationId.get()||"",eventId:a.slStreamId.get()||""})===Pr.Completed&&y.set(Pr.Completed);const _=await a.moderation.getValue();if(y.get()===Pr.Completed)return;const L=!!((A=_==null?void 0:_.options)!=null&&A.onboardingEnabled&&((V=(U=n.featureSettings.get().inplayGame)==null?void 0:U.onboarding)!=null&&V.completed)),R=!!((ae=(G=n.featureSettings.get().inplayGame)==null?void 0:G.titleCard)!=null&&ae.optIn);L?R?y.set(Pr.Required):y.set(Pr.Optional):R?y.set(Pr.Unavailable):y.set(Pr.Disabled)};return v(),a.userId.subscribe(E=>{E&&v()}),a.moderation.subscribe(E=>{E.data&&v()}),{$store:y,submitInplay:async()=>{const E=a.slStreamId.get();if(E){await YG(s,E),y.set(Pr.Completed),u.saveOnboardingStatus({organizationId:a.organizationId.get()||"",userId:a.userId.get()||"",eventId:E},Pr.Completed);const _=a.getCurrentSessionId({prefix:"onboarding"});f.close(_)}}}},KG=new Set([Jt.POLL,Jt.PREDICTION,Jt.TRIVIA]);class JG extends NS{constructor(s,f,u){super(s,f);Z(this,"userSummary");Z(this,"feedList");Z(this,"leaderboardId");Z(this,"leaderboardList");Z(this,"deepLink");Z(this,"onboardingStatus");Z(this,"openedQuestion");Z(this,"currentUserId");Z(this,"openedUser");Z(this,"closeFeature");Z(this,"openFeature");Z(this,"notifications");Z(this,"transport");Z(this,"background");Z(this,"storage");Z(this,"connect",s=>{this.userSummary.invalidate(),this.leaderboardList.invalidate(),this.feedList.invalidate(),this.background.feedSubscription.addListener("feed-subscription-prediction-close",f=>{window.requestAnimationFrame(async()=>{var E,_;const u=(_=(E=f.data)==null?void 0:E.attributes)==null?void 0:_.question;if(!u)return;const{status:y,type:g,id:v}=u;if(y===lo.RESOLVED&&g===Jt.PREDICTION){const L=this.background.getCurrentSessionId({prefix:`notification-id:${v}`}),R=await IS(v,s),A=R==null?void 0:R.answers.find(({correct:V})=>V),U=R==null?void 0:R.answers.find(({youVoted:V})=>V);if(!U)return;this.notifications.add({type:Pc.QUESTION_RESOLVED,action:()=>this.openQuestion(v),close:()=>this.closeQuestion(v),autoHideDuration:35e3,id:L,data:{questionType:Jt.PREDICTION,question:{title:A!=null&&A.youVoted?`Congratulations! You answered correctly! You won ${A.points} pts!`:`Better luck next time! Correct: ${A==null?void 0:A.text}!`,votedAnswer:{title:U==null?void 0:U.text,points:U==null?void 0:U.points},correctAnswerTitle:A==null?void 0:A.text,correct:A==null?void 0:A.youVoted,predictionResult:y===lo.RESOLVED,questionTitle:R==null?void 0:R.subject}}}),this.userSummary.invalidate()}})}),this.background.feedSubscription.addListener("feed-subscription-questions-list",()=>{window.requestAnimationFrame(()=>{var f;(f=this.feedList)==null||f.invalidate()})})});Z(this,"disconnect",()=>{this.background.feedSubscription.removeListener("feed-subscription-questions-list")});Z(this,"submitAnswer",async(s,f)=>{await VG(this.transport,{questionId:s,answerId:f}),this.feedList.invalidate(),this.userSummary.invalidate()});Z(this,"skipQuestion",async s=>{await $G(this.transport,s),this.feedList.invalidate(),this.userSummary.invalidate()});Z(this,"openQuestion",s=>(this.openFeature(),this.background.openQuestion(s)));Z(this,"closeQuestion",s=>this.background.closeQuestion(s));Z(this,"openUser",s=>{var u;const f=(u=this.leaderboardList.$store.get().data)==null?void 0:u.find(y=>y.userId===s);this.openedUser.set(f)});Z(this,"closeUser",()=>{this.openedUser.set(void 0)});this.background=new PG(u),this.storage=new _S,this.userSummary=new Ji(NG(this.background.slStreamId,this.background.userId,u.transport),"gamification:userSummary"),this.feedList=this.background.feedList,this.currentUserId=this.background.userId,this.openedUser=Qa(void 0),this.leaderboardId=new ri(Qa(this.settings.getValue("pinnedLeaderboardId")),"pinnedLeaderboardId").getStore(),this.onboardingStatus=WG(this,this.background,u.transport,u.notifications),this.notifications=u.notifications,this.transport=u.transport,this.closeFeature=()=>u.sdk.closeFeature(!0),this.openFeature=()=>u.sdk.openFeature(tr.GAMES),this.openedQuestion=this.background.openedQuestion,this.deepLink=qG(this.transport,this.background.slStreamId,this.background.userId),this.leaderboardList=GG(this.transport,this.background.slStreamId),this.status.subscribe(y=>{y===fp.Ready?this.connect(u.transport):this.disconnect()}),this.background.activeQuestionId.listen(y=>{var v,E,_,L,R,A,U,V,G,ae,Q,se;const g=this.onboardingStatus.$store.get();if(y&&y.data&&g&&((v=y.data.question)==null?void 0:v.id)!==void 0&&y.data.question.notification!==void 0&&((_=(E=y.data.question)==null?void 0:E.bypassNotifications)==null?void 0:_.inAppSilence)!==Xw.ON&&y.data.question.status===lo.ACTIVE){if(KG.has(y.data.question.type)){const ee=(R=(L=this.settings.getValues().inplayGame)==null?void 0:L.titleCard)==null?void 0:R.optIn,ue=g===Pr.Completed;ee!==void 0&&(!ee||ue)&&this.notifications.add({type:Pc.QUESTION,action:()=>{var J;return((J=y.data)==null?void 0:J.question)&&this.openQuestion(y.data.question.id)},close:()=>{var J;return((J=y.data)==null?void 0:J.question)&&this.closeQuestion(y.data.question.id)},autoHideDuration:1e3*60,id:this.background.getCurrentSessionId({prefix:"notification",entity:y.data.question.id}),data:{questionType:y.data.question.type,question:{title:y.data.question.notification.title}}})}else if(y.data.question.type===Jt.FACTOID){const ee=(A=y.data.question.options)==null?void 0:A.options.value,ue={heading:y.data.question.notification.title,body:y.data.question.notification.body,image:y.data.question.notification.image,video:{id:((U=ee==null?void 0:ee.video)==null?void 0:U.id)||"",url:((V=ee==null?void 0:ee.video)==null?void 0:V.url)||"",thumbnailUrl:((G=ee==null?void 0:ee.video)==null?void 0:G.thumbnailUrl)||""},webLink:{label:"",url:""}};this.notifications.add({type:Pc.QUESTION,action:()=>{var J;return((J=y.data)==null?void 0:J.question)&&this.openQuestion(y.data.question.id)},close:()=>{var J;return((J=y.data)==null?void 0:J.question)&&this.closeQuestion(y.data.question.id)},autoHideDuration:1e3*120,id:this.background.getCurrentSessionId({prefix:"notification",entity:y.data.question.id}),data:{questionType:y.data.question.type,insight:ue}})}else if(y.data.question.type===Jt.TWEET){const ee=(ae=y.data.question.options)==null?void 0:ae.options.value,ue={title:y.data.question.notification.title,body:y.data.question.notification.body,image:y.data.question.notification.image,account:((Q=ee==null?void 0:ee.tweetMeta)==null?void 0:Q.account)||"",accountVerified:!!((se=ee==null?void 0:ee.tweetMeta)!=null&&se.accountVerified)};this.notifications.add({type:Pc.QUESTION,action:()=>{var J;return((J=y.data)==null?void 0:J.question)&&this.openQuestion(y.data.question.id)},close:()=>{var J;return((J=y.data)==null?void 0:J.question)&&this.closeQuestion(y.data.question.id)},autoHideDuration:1e3*120,id:this.background.getCurrentSessionId({prefix:"notification",entity:y.data.question.id}),data:{questionType:y.data.question.type,tweet:ue}})}}})}}const ZG={[tr.GAMES]:!0};class XG extends NS{constructor(a,s){super(a,s)}}const eQ=(n,a,s)=>n.type===tr.GAMES?new JG(n,a,s):new XG(n,a),tQ=(n,a,s)=>{n.features=new Map,n.activeFeature=new ri(Qa(tr.UNSET),"activeFeature"),n.sdk.getFeatures=()=>n.features,n.sdk.getFeature=f=>n.features.get(f),n.sdk.getActiveFeature=()=>n.activeFeature.getStore(),n.sdk.openFeature=f=>{n.activeFeature.setValue(f)},n.sdk.closeFeature=(f=!1)=>{if(f){const u=n.activeFeature.getValue();n.activeFeature.setValue(tr.UNSET),u&&n.features.delete(u)}},n.initFeature=(f,u=Qs.ORGANIZATION)=>{if(f.type in ZG&&!n.features.has(f.type)){const y=eQ(f,u,n);n.features.set(f.type,y)}},n.updateFeature=(f,u)=>{var y;(y=n.features.get(f.type))==null||y.update(f,u)},n.destroyFeature=f=>{n.features.delete(f.type)},n.reinitializeFeatures=async()=>{const f=await n.stores.organizationSettings.getValue();n.features.clear();for(const u of(f==null?void 0:f.overlays)||[])n.initFeature(u,Qs.ORGANIZATION)},n.stores.providerStreamId.listen(f=>{f||n.reinitializeFeatures()}),n.storeSubscribe=()=>{const f=(y,g)=>{var v;if(g!=null&&g.overlays&&!((v=n.contextConfig)!=null&&v.skipOrganizationSettings&&y===Qs.ORGANIZATION))for(const E of g.overlays)E.sdkEnable===!0&&(n.features.has(E.type)?n.updateFeature(E,y):n.initFeature(E,y))},u={organizationSettings:y=>{if(y.data)try{f(Qs.ORGANIZATION,y.data)}catch(g){console.log(g)}},streamSettings:y=>{if(y.data)try{f(Qs.STREAM,y.data)}catch(g){console.log(g)}}};n.store.subscribe(u)},s()};var A6={exports:{}},x6={exports:{}};function nQ(n){var a=new n,s=a;function f(){var y=a;return y.next?a=y.next:(a=new n,s=a),y.next=null,y}function u(y){s.next=y,s=y}return{get:f,release:u}}var rQ=nQ,aQ=rQ;function CS(n,a,s){if(typeof n=="function"&&(s=a,a=n,n=null),s<1)throw new Error("fastqueue concurrency must be greater than 1");var f=aQ(oQ),u=null,y=null,g=0,v=null,E={push:G,drain:Io,saturated:Io,pause:L,paused:!1,concurrency:s,running:_,resume:U,idle:V,length:R,getQueue:A,unshift:ae,empty:Io,kill:se,killAndDrain:ee,error:ue};return E;function _(){return g}function L(){E.paused=!0}function R(){for(var J=u,ye=0;J;)J=J.next,ye++;return ye}function A(){for(var J=u,ye=[];J;)ye.push(J.value),J=J.next;return ye}function U(){if(E.paused){E.paused=!1;for(var J=0;J<E.concurrency;J++)g++,Q()}}function V(){return g===0&&E.length()===0}function G(J,ye){var fe=f.get();fe.context=n,fe.release=Q,fe.value=J,fe.callback=ye||Io,fe.errorHandler=v,g===E.concurrency||E.paused?y?(y.next=fe,y=fe):(u=fe,y=fe,E.saturated()):(g++,a.call(n,fe.value,fe.worked))}function ae(J,ye){var fe=f.get();fe.context=n,fe.release=Q,fe.value=J,fe.callback=ye||Io,g===E.concurrency||E.paused?u?(fe.next=u,u=fe):(u=fe,y=fe,E.saturated()):(g++,a.call(n,fe.value,fe.worked))}function Q(J){J&&f.release(J);var ye=u;ye?E.paused?g--:(y===u&&(y=null),u=ye.next,ye.next=null,a.call(n,ye.value,ye.worked),y===null&&E.empty()):--g===0&&E.drain()}function se(){u=null,y=null,E.drain=Io}function ee(){u=null,y=null,E.drain(),E.drain=Io}function ue(J){v=J}}function Io(){}function oQ(){this.value=null,this.callback=Io,this.next=null,this.release=Io,this.context=null,this.errorHandler=null;var n=this;this.worked=function(a,s){var f=n.callback,u=n.errorHandler,y=n.value;n.value=null,n.callback=Io,n.errorHandler&&u(a,y),f.call(n.context,a,s),n.release(n)}}function iQ(n,a,s){typeof n=="function"&&(s=a,a=n,n=null);function f(L,R){a.call(this,L).then(function(A){R(null,A)},R)}var u=CS(n,f,s),y=u.push,g=u.unshift;return u.push=v,u.unshift=E,u.drained=_,u;function v(L){var R=new Promise(function(A,U){y(L,function(V,G){if(V){U(V);return}A(G)})});return R.catch(Io),R}function E(L){var R=new Promise(function(A,U){g(L,function(V,G){if(V){U(V);return}A(G)})});return R.catch(Io),R}function _(){if(u.idle())return new Promise(function(A){A()});var L=u.drain,R=new Promise(function(A){u.drain=function(){L(),A()}});return R}}x6.exports=CS;x6.exports.promise=iQ;var OS=x6.exports,L6={exports:{}},pp=typeof Reflect=="object"?Reflect:null,lw=pp&&typeof pp.apply=="function"?pp.apply:function(n,a,s){return Function.prototype.apply.call(n,a,s)},Cy;pp&&typeof pp.ownKeys=="function"?Cy=pp.ownKeys:Object.getOwnPropertySymbols?Cy=function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Cy=function(n){return Object.getOwnPropertyNames(n)};function sQ(n){console&&console.warn&&console.warn(n)}var AS=Number.isNaN||function(n){return n!==n};function an(){an.init.call(this)}L6.exports=an;L6.exports.once=dQ;an.EventEmitter=an;an.prototype._events=void 0;an.prototype._eventsCount=0;an.prototype._maxListeners=void 0;var uw=10;function c2(n){if(typeof n!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n)}Object.defineProperty(an,"defaultMaxListeners",{enumerable:!0,get:function(){return uw},set:function(n){if(typeof n!="number"||n<0||AS(n))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+n+".");uw=n}});an.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};an.prototype.setMaxListeners=function(n){if(typeof n!="number"||n<0||AS(n))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+n+".");return this._maxListeners=n,this};function xS(n){return n._maxListeners===void 0?an.defaultMaxListeners:n._maxListeners}an.prototype.getMaxListeners=function(){return xS(this)};an.prototype.emit=function(n){for(var a=[],s=1;s<arguments.length;s++)a.push(arguments[s]);var f=n==="error",u=this._events;if(u!==void 0)f=f&&u.error===void 0;else if(!f)return!1;if(f){var y;if(a.length>0&&(y=a[0]),y instanceof Error)throw y;var g=new Error("Unhandled error."+(y?" ("+y.message+")":""));throw g.context=y,g}var v=u[n];if(v===void 0)return!1;if(typeof v=="function")lw(v,this,a);else for(var E=v.length,_=PS(v,E),s=0;s<E;++s)lw(_[s],this,a);return!0};function LS(n,a,s,f){var u,y,g;if(c2(s),y=n._events,y===void 0?(y=n._events=Object.create(null),n._eventsCount=0):(y.newListener!==void 0&&(n.emit("newListener",a,s.listener?s.listener:s),y=n._events),g=y[a]),g===void 0)g=y[a]=s,++n._eventsCount;else if(typeof g=="function"?g=y[a]=f?[s,g]:[g,s]:f?g.unshift(s):g.push(s),u=xS(n),u>0&&g.length>u&&!g.warned){g.warned=!0;var v=new Error("Possible EventEmitter memory leak detected. "+g.length+" "+String(a)+" listeners added. Use emitter.setMaxListeners() to increase limit");v.name="MaxListenersExceededWarning",v.emitter=n,v.type=a,v.count=g.length,sQ(v)}return n}an.prototype.addListener=function(n,a){return LS(this,n,a,!1)};an.prototype.on=an.prototype.addListener;an.prototype.prependListener=function(n,a){return LS(this,n,a,!0)};function lQ(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function RS(n,a,s){var f={fired:!1,wrapFn:void 0,target:n,type:a,listener:s},u=lQ.bind(f);return u.listener=s,f.wrapFn=u,u}an.prototype.once=function(n,a){return c2(a),this.on(n,RS(this,n,a)),this};an.prototype.prependOnceListener=function(n,a){return c2(a),this.prependListener(n,RS(this,n,a)),this};an.prototype.removeListener=function(n,a){var s,f,u,y,g;if(c2(a),f=this._events,f===void 0)return this;if(s=f[n],s===void 0)return this;if(s===a||s.listener===a)--this._eventsCount===0?this._events=Object.create(null):(delete f[n],f.removeListener&&this.emit("removeListener",n,s.listener||a));else if(typeof s!="function"){for(u=-1,y=s.length-1;y>=0;y--)if(s[y]===a||s[y].listener===a){g=s[y].listener,u=y;break}if(u<0)return this;u===0?s.shift():uQ(s,u),s.length===1&&(f[n]=s[0]),f.removeListener!==void 0&&this.emit("removeListener",n,g||a)}return this};an.prototype.off=an.prototype.removeListener;an.prototype.removeAllListeners=function(n){var a,s,f;if(s=this._events,s===void 0)return this;if(s.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):s[n]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete s[n]),this;if(arguments.length===0){var u=Object.keys(s),y;for(f=0;f<u.length;++f)y=u[f],y!=="removeListener"&&this.removeAllListeners(y);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(a=s[n],typeof a=="function")this.removeListener(n,a);else if(a!==void 0)for(f=a.length-1;f>=0;f--)this.removeListener(n,a[f]);return this};function DS(n,a,s){var f=n._events;if(f===void 0)return[];var u=f[a];return u===void 0?[]:typeof u=="function"?s?[u.listener||u]:[u]:s?cQ(u):PS(u,u.length)}an.prototype.listeners=function(n){return DS(this,n,!0)};an.prototype.rawListeners=function(n){return DS(this,n,!1)};an.listenerCount=function(n,a){return typeof n.listenerCount=="function"?n.listenerCount(a):US.call(n,a)};an.prototype.listenerCount=US;function US(n){var a=this._events;if(a!==void 0){var s=a[n];if(typeof s=="function")return 1;if(s!==void 0)return s.length}return 0}an.prototype.eventNames=function(){return this._eventsCount>0?Cy(this._events):[]};function PS(n,a){for(var s=new Array(a),f=0;f<a;++f)s[f]=n[f];return s}function uQ(n,a){for(;a+1<n.length;a++)n[a]=n[a+1];n.pop()}function cQ(n){for(var a=new Array(n.length),s=0;s<a.length;++s)a[s]=n[s].listener||n[s];return a}function dQ(n,a){return new Promise(function(s,f){function u(g){n.removeListener(a,y),f(g)}function y(){typeof n.removeListener=="function"&&n.removeListener("error",u),s([].slice.call(arguments))}jS(n,a,y,{once:!0}),a!=="error"&&fQ(n,u,{once:!0})})}function fQ(n,a,s){typeof n.on=="function"&&jS(n,"error",a,s)}function jS(n,a,s,f){if(typeof n.on=="function")f.once?n.once(a,s):n.on(a,s);else if(typeof n.addEventListener=="function")n.addEventListener(a,function u(y){f.once&&n.removeEventListener(a,u),s(y)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof n)}var zS=L6.exports,d2={},BS={},FS=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var n={},a=Symbol("test"),s=Object(a);if(typeof a=="string"||Object.prototype.toString.call(a)!=="[object Symbol]"||Object.prototype.toString.call(s)!=="[object Symbol]")return!1;var f=42;n[a]=f;for(a in n)return!1;if(typeof Object.keys=="function"&&Object.keys(n).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(n).length!==0)return!1;var u=Object.getOwnPropertySymbols(n);if(u.length!==1||u[0]!==a||!Object.prototype.propertyIsEnumerable.call(n,a))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var y=Object.getOwnPropertyDescriptor(n,a);if(y.value!==f||y.enumerable!==!0)return!1}return!0},pQ=FS,R6=function(){return pQ()&&!!Symbol.toStringTag},cw=typeof Symbol<"u"&&Symbol,mQ=FS,hQ=function(){return typeof cw!="function"||typeof Symbol!="function"||typeof cw("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:mQ()},dw={foo:{}},gQ=Object,yQ=function(){return{__proto__:dw}.foo===dw.foo&&!({__proto__:null}instanceof gQ)},vQ="Function.prototype.bind called on incompatible ",TQ=Object.prototype.toString,kQ=Math.max,bQ="[object Function]",fw=function(n,a){for(var s=[],f=0;f<n.length;f+=1)s[f]=n[f];for(var u=0;u<a.length;u+=1)s[u+n.length]=a[u];return s},wQ=function(n,a){for(var s=[],f=a||0,u=0;f<n.length;f+=1,u+=1)s[u]=n[f];return s},SQ=function(n,a){for(var s="",f=0;f<n.length;f+=1)s+=n[f],f+1<n.length&&(s+=a);return s},EQ=function(n){var a=this;if(typeof a!="function"||TQ.apply(a)!==bQ)throw new TypeError(vQ+a);for(var s=wQ(arguments,1),f,u=function(){if(this instanceof f){var _=a.apply(this,fw(s,arguments));return Object(_)===_?_:this}return a.apply(n,fw(s,arguments))},y=kQ(0,a.length-s.length),g=[],v=0;v<y;v++)g[v]="$"+v;if(f=Function("binder","return function ("+SQ(g,",")+"){ return binder.apply(this,arguments); }")(u),a.prototype){var E=function(){};E.prototype=a.prototype,f.prototype=new E,E.prototype=null}return f},NQ=EQ,VS=Function.prototype.bind||NQ,pw={}.hasOwnProperty,dT=Function.prototype.call,MQ=dT.bind?dT.bind(pw):function(n,a){return dT.call(pw,n,a)},zt,gp=SyntaxError,YS=Function,mp=TypeError,fT=function(n){try{return YS('"use strict"; return ('+n+").constructor;")()}catch{}},jc=Object.getOwnPropertyDescriptor;if(jc)try{jc({},"")}catch{jc=null}var pT=function(){throw new mp},IQ=jc?function(){try{return arguments.callee,pT}catch{try{return jc(arguments,"callee").get}catch{return pT}}}():pT,tp=hQ(),_Q=yQ(),wr=Object.getPrototypeOf||(_Q?function(n){return n.__proto__}:null),rp={},CQ=typeof Uint8Array>"u"||!wr?zt:wr(Uint8Array),zc={"%AggregateError%":typeof AggregateError>"u"?zt:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?zt:ArrayBuffer,"%ArrayIteratorPrototype%":tp&&wr?wr([][Symbol.iterator]()):zt,"%AsyncFromSyncIteratorPrototype%":zt,"%AsyncFunction%":rp,"%AsyncGenerator%":rp,"%AsyncGeneratorFunction%":rp,"%AsyncIteratorPrototype%":rp,"%Atomics%":typeof Atomics>"u"?zt:Atomics,"%BigInt%":typeof BigInt>"u"?zt:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?zt:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?zt:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?zt:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?zt:Float32Array,"%Float64Array%":typeof Float64Array>"u"?zt:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?zt:FinalizationRegistry,"%Function%":YS,"%GeneratorFunction%":rp,"%Int8Array%":typeof Int8Array>"u"?zt:Int8Array,"%Int16Array%":typeof Int16Array>"u"?zt:Int16Array,"%Int32Array%":typeof Int32Array>"u"?zt:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":tp&&wr?wr(wr([][Symbol.iterator]())):zt,"%JSON%":typeof JSON=="object"?JSON:zt,"%Map%":typeof Map>"u"?zt:Map,"%MapIteratorPrototype%":typeof Map>"u"||!tp||!wr?zt:wr(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?zt:Promise,"%Proxy%":typeof Proxy>"u"?zt:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?zt:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?zt:Set,"%SetIteratorPrototype%":typeof Set>"u"||!tp||!wr?zt:wr(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?zt:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":tp&&wr?wr(""[Symbol.iterator]()):zt,"%Symbol%":tp?Symbol:zt,"%SyntaxError%":gp,"%ThrowTypeError%":IQ,"%TypedArray%":CQ,"%TypeError%":mp,"%Uint8Array%":typeof Uint8Array>"u"?zt:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?zt:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?zt:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?zt:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?zt:WeakMap,"%WeakRef%":typeof WeakRef>"u"?zt:WeakRef,"%WeakSet%":typeof WeakSet>"u"?zt:WeakSet};if(wr)try{null.error}catch(n){var OQ=wr(wr(n));zc["%Error.prototype%"]=OQ}var AQ=function n(a){var s;if(a==="%AsyncFunction%")s=fT("async function () {}");else if(a==="%GeneratorFunction%")s=fT("function* () {}");else if(a==="%AsyncGeneratorFunction%")s=fT("async function* () {}");else if(a==="%AsyncGenerator%"){var f=n("%AsyncGeneratorFunction%");f&&(s=f.prototype)}else if(a==="%AsyncIteratorPrototype%"){var u=n("%AsyncGenerator%");u&&wr&&(s=wr(u.prototype))}return zc[a]=s,s},mw={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},th=VS,Vy=MQ,xQ=th.call(Function.call,Array.prototype.concat),LQ=th.call(Function.apply,Array.prototype.splice),hw=th.call(Function.call,String.prototype.replace),Yy=th.call(Function.call,String.prototype.slice),RQ=th.call(Function.call,RegExp.prototype.exec),DQ=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,UQ=/\\(\\)?/g,PQ=function(n){var a=Yy(n,0,1),s=Yy(n,-1);if(a==="%"&&s!=="%")throw new gp("invalid intrinsic syntax, expected closing `%`");if(s==="%"&&a!=="%")throw new gp("invalid intrinsic syntax, expected opening `%`");var f=[];return hw(n,DQ,function(u,y,g,v){f[f.length]=g?hw(v,UQ,"$1"):y||u}),f},jQ=function(n,a){var s=n,f;if(Vy(mw,s)&&(f=mw[s],s="%"+f[0]+"%"),Vy(zc,s)){var u=zc[s];if(u===rp&&(u=AQ(s)),typeof u>"u"&&!a)throw new mp("intrinsic "+n+" exists, but is not available. Please file an issue!");return{alias:f,name:s,value:u}}throw new gp("intrinsic "+n+" does not exist!")},wp=function(n,a){if(typeof n!="string"||n.length===0)throw new mp("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof a!="boolean")throw new mp('"allowMissing" argument must be a boolean');if(RQ(/^%?[^%]*%?$/,n)===null)throw new gp("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var s=PQ(n),f=s.length>0?s[0]:"",u=jQ("%"+f+"%",a),y=u.name,g=u.value,v=!1,E=u.alias;E&&(f=E[0],LQ(s,xQ([0,1],E)));for(var _=1,L=!0;_<s.length;_+=1){var R=s[_],A=Yy(R,0,1),U=Yy(R,-1);if((A==='"'||A==="'"||A==="`"||U==='"'||U==="'"||U==="`")&&A!==U)throw new gp("property names with quotes must have matching quotes");if((R==="constructor"||!L)&&(v=!0),f+="."+R,y="%"+f+"%",Vy(zc,y))g=zc[y];else if(g!=null){if(!(R in g)){if(!a)throw new mp("base intrinsic for "+n+" exists, but the property is not available.");return}if(jc&&_+1>=s.length){var V=jc(g,R);L=!!V,L&&"get"in V&&!("originalValue"in V.get)?g=V.get:g=g[R]}else L=Vy(g,R),g=g[R];L&&!v&&(zc[y]=g)}}return g},$S={exports:{}},zQ=wp,qT=zQ("%Object.defineProperty%",!0),WT=function(){if(qT)try{return qT({},"a",{value:1}),!0}catch{return!1}return!1};WT.hasArrayLengthDefineBug=function(){if(!WT())return null;try{return qT([],"length",{value:1}).length!==1}catch{return!0}};var GS=WT,BQ=wp,Oy=BQ("%Object.getOwnPropertyDescriptor%",!0);if(Oy)try{Oy([],"length")}catch{Oy=null}var D6=Oy,FQ=GS(),U6=wp,q1=FQ&&U6("%Object.defineProperty%",!0);if(q1)try{q1({},"a",{value:1})}catch{q1=!1}var VQ=U6("%SyntaxError%"),np=U6("%TypeError%"),gw=D6,YQ=function(n,a,s){if(!n||typeof n!="object"&&typeof n!="function")throw new np("`obj` must be an object or a function`");if(typeof a!="string"&&typeof a!="symbol")throw new np("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new np("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new np("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new np("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new np("`loose`, if provided, must be a boolean");var f=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,y=arguments.length>5?arguments[5]:null,g=arguments.length>6?arguments[6]:!1,v=!!gw&&gw(n,a);if(q1)q1(n,a,{configurable:y===null&&v?v.configurable:!y,enumerable:f===null&&v?v.enumerable:!f,value:s,writable:u===null&&v?v.writable:!u});else if(g||!f&&!u&&!y)n[a]=s;else throw new VQ("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},QS=wp,yw=YQ,$Q=GS(),vw=D6,Tw=QS("%TypeError%"),GQ=QS("%Math.floor%"),QQ=function(n,a){if(typeof n!="function")throw new Tw("`fn` is not a function");if(typeof a!="number"||a<0||a>4294967295||GQ(a)!==a)throw new Tw("`length` must be a positive 32-bit integer");var s=arguments.length>2&&!!arguments[2],f=!0,u=!0;if("length"in n&&vw){var y=vw(n,"length");y&&!y.configurable&&(f=!1),y&&!y.writable&&(u=!1)}return(f||u||!s)&&($Q?yw(n,"length",a,!0,!0):yw(n,"length",a)),n};(function(n){var a=VS,s=wp,f=QQ,u=s("%TypeError%"),y=s("%Function.prototype.apply%"),g=s("%Function.prototype.call%"),v=s("%Reflect.apply%",!0)||a.call(g,y),E=s("%Object.defineProperty%",!0),_=s("%Math.max%");if(E)try{E({},"a",{value:1})}catch{E=null}n.exports=function(R){if(typeof R!="function")throw new u("a function is required");var A=v(a,g,arguments);return f(A,1+_(0,R.length-(arguments.length-1)),!0)};var L=function(){return v(a,y,arguments)};E?E(n.exports,"apply",{value:L}):n.exports.apply=L})($S);var HS=$S.exports,qS=wp,WS=HS,HQ=WS(qS("String.prototype.indexOf")),KS=function(n,a){var s=qS(n,!!a);return typeof s=="function"&&HQ(n,".prototype.")>-1?WS(s):s},qQ=R6(),WQ=KS,KT=WQ("Object.prototype.toString"),f2=function(n){return qQ&&n&&typeof n=="object"&&Symbol.toStringTag in n?!1:KT(n)==="[object Arguments]"},JS=function(n){return f2(n)?!0:n!==null&&typeof n=="object"&&typeof n.length=="number"&&n.length>=0&&KT(n)!=="[object Array]"&&KT(n.callee)==="[object Function]"},KQ=function(){return f2(arguments)}();f2.isLegacyArguments=JS;var JQ=KQ?f2:JS,ZQ=Object.prototype.toString,XQ=Function.prototype.toString,eH=/^\s*(?:function)?\*/,ZS=R6(),mT=Object.getPrototypeOf,tH=function(){if(!ZS)return!1;try{return Function("return function*() {}")()}catch{}},hT,nH=function(n){if(typeof n!="function")return!1;if(eH.test(XQ.call(n)))return!0;if(!ZS){var a=ZQ.call(n);return a==="[object GeneratorFunction]"}if(!mT)return!1;if(typeof hT>"u"){var s=tH();hT=s?mT(s):!1}return mT(n)===hT},XS=Function.prototype.toString,ip=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,JT,Ay;if(typeof ip=="function"&&typeof Object.defineProperty=="function")try{JT=Object.defineProperty({},"length",{get:function(){throw Ay}}),Ay={},ip(function(){throw 42},null,JT)}catch(n){n!==Ay&&(ip=null)}else ip=null;var rH=/^\s*class\b/,ZT=function(n){try{var a=XS.call(n);return rH.test(a)}catch{return!1}},gT=function(n){try{return ZT(n)?!1:(XS.call(n),!0)}catch{return!1}},xy=Object.prototype.toString,aH="[object Object]",oH="[object Function]",iH="[object GeneratorFunction]",sH="[object HTMLAllCollection]",lH="[object HTML document.all class]",uH="[object HTMLCollection]",cH=typeof Symbol=="function"&&!!Symbol.toStringTag,dH=!(0 in[,]),XT=function(){return!1};if(typeof document=="object"){var fH=document.all;xy.call(fH)===xy.call(document.all)&&(XT=function(n){if((dH||!n)&&(typeof n>"u"||typeof n=="object"))try{var a=xy.call(n);return(a===sH||a===lH||a===uH||a===aH)&&n("")==null}catch{}return!1})}var pH=ip?function(n){if(XT(n))return!0;if(!n||typeof n!="function"&&typeof n!="object")return!1;try{ip(n,null,JT)}catch(a){if(a!==Ay)return!1}return!ZT(n)&&gT(n)}:function(n){if(XT(n))return!0;if(!n||typeof n!="function"&&typeof n!="object")return!1;if(cH)return gT(n);if(ZT(n))return!1;var a=xy.call(n);return a!==oH&&a!==iH&&!/^\[object HTML/.test(a)?!1:gT(n)},mH=pH,hH=Object.prototype.toString,eE=Object.prototype.hasOwnProperty,gH=function(n,a,s){for(var f=0,u=n.length;f<u;f++)eE.call(n,f)&&(s==null?a(n[f],f,n):a.call(s,n[f],f,n))},yH=function(n,a,s){for(var f=0,u=n.length;f<u;f++)s==null?a(n.charAt(f),f,n):a.call(s,n.charAt(f),f,n)},vH=function(n,a,s){for(var f in n)eE.call(n,f)&&(s==null?a(n[f],f,n):a.call(s,n[f],f,n))},TH=function(n,a,s){if(!mH(a))throw new TypeError("iterator must be a function");var f;arguments.length>=3&&(f=s),hH.call(n)==="[object Array]"?gH(n,a,f):typeof n=="string"?yH(n,a,f):vH(n,a,f)},kH=TH,yT=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],bH=typeof globalThis>"u"?vS:globalThis,wH=function(){for(var n=[],a=0;a<yT.length;a++)typeof bH[yT[a]]=="function"&&(n[n.length]=yT[a]);return n},$y=kH,SH=wH,kw=HS,P6=KS,Ly=D6,EH=P6("Object.prototype.toString"),tE=R6(),bw=typeof globalThis>"u"?vS:globalThis,e6=SH(),j6=P6("String.prototype.slice"),vT=Object.getPrototypeOf,NH=P6("Array.prototype.indexOf",!0)||function(n,a){for(var s=0;s<n.length;s+=1)if(n[s]===a)return s;return-1},Gy={__proto__:null};tE&&Ly&&vT?$y(e6,function(n){var a=new bw[n];if(Symbol.toStringTag in a){var s=vT(a),f=Ly(s,Symbol.toStringTag);if(!f){var u=vT(s);f=Ly(u,Symbol.toStringTag)}Gy["$"+n]=kw(f.get)}}):$y(e6,function(n){var a=new bw[n],s=a.slice||a.set;s&&(Gy["$"+n]=kw(s))});var MH=function(n){var a=!1;return $y(Gy,function(s,f){if(!a)try{"$"+s(n)===f&&(a=j6(f,1))}catch{}}),a},IH=function(n){var a=!1;return $y(Gy,function(s,f){if(!a)try{s(n),a=j6(f,1)}catch{}}),a},nE=function(n){if(!n||typeof n!="object")return!1;if(!tE){var a=j6(EH(n),8,-1);return NH(e6,a)>-1?a:a!=="Object"?!1:IH(n)}return Ly?MH(n):null},_H=nE,CH=function(n){return!!_H(n)};(function(n){var a=JQ,s=nH,f=nE,u=CH;function y(ve){return ve.call.bind(ve)}var g=typeof BigInt<"u",v=typeof Symbol<"u",E=y(Object.prototype.toString),_=y(Number.prototype.valueOf),L=y(String.prototype.valueOf),R=y(Boolean.prototype.valueOf);if(g)var A=y(BigInt.prototype.valueOf);if(v)var U=y(Symbol.prototype.valueOf);function V(ve,qn){if(typeof ve!="object")return!1;try{return qn(ve),!0}catch{return!1}}n.isArgumentsObject=a,n.isGeneratorFunction=s,n.isTypedArray=u;function G(ve){return typeof Promise<"u"&&ve instanceof Promise||ve!==null&&typeof ve=="object"&&typeof ve.then=="function"&&typeof ve.catch=="function"}n.isPromise=G;function ae(ve){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(ve):u(ve)||ce(ve)}n.isArrayBufferView=ae;function Q(ve){return f(ve)==="Uint8Array"}n.isUint8Array=Q;function se(ve){return f(ve)==="Uint8ClampedArray"}n.isUint8ClampedArray=se;function ee(ve){return f(ve)==="Uint16Array"}n.isUint16Array=ee;function ue(ve){return f(ve)==="Uint32Array"}n.isUint32Array=ue;function J(ve){return f(ve)==="Int8Array"}n.isInt8Array=J;function ye(ve){return f(ve)==="Int16Array"}n.isInt16Array=ye;function fe(ve){return f(ve)==="Int32Array"}n.isInt32Array=fe;function Ue(ve){return f(ve)==="Float32Array"}n.isFloat32Array=Ue;function He(ve){return f(ve)==="Float64Array"}n.isFloat64Array=He;function gt(ve){return f(ve)==="BigInt64Array"}n.isBigInt64Array=gt;function dt(ve){return f(ve)==="BigUint64Array"}n.isBigUint64Array=dt;function vt(ve){return E(ve)==="[object Map]"}vt.working=typeof Map<"u"&&vt(new Map);function qe(ve){return typeof Map>"u"?!1:vt.working?vt(ve):ve instanceof Map}n.isMap=qe;function at(ve){return E(ve)==="[object Set]"}at.working=typeof Set<"u"&&at(new Set);function _t(ve){return typeof Set>"u"?!1:at.working?at(ve):ve instanceof Set}n.isSet=_t;function Ut(ve){return E(ve)==="[object WeakMap]"}Ut.working=typeof WeakMap<"u"&&Ut(new WeakMap);function En(ve){return typeof WeakMap>"u"?!1:Ut.working?Ut(ve):ve instanceof WeakMap}n.isWeakMap=En;function Ce(ve){return E(ve)==="[object WeakSet]"}Ce.working=typeof WeakSet<"u"&&Ce(new WeakSet);function Be(ve){return Ce(ve)}n.isWeakSet=Be;function Le(ve){return E(ve)==="[object ArrayBuffer]"}Le.working=typeof ArrayBuffer<"u"&&Le(new ArrayBuffer);function Ne(ve){return typeof ArrayBuffer>"u"?!1:Le.working?Le(ve):ve instanceof ArrayBuffer}n.isArrayBuffer=Ne;function Y(ve){return E(ve)==="[object DataView]"}Y.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&Y(new DataView(new ArrayBuffer(1),0,1));function ce(ve){return typeof DataView>"u"?!1:Y.working?Y(ve):ve instanceof DataView}n.isDataView=ce;var we=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function Ze(ve){return E(ve)==="[object SharedArrayBuffer]"}function ft(ve){return typeof we>"u"?!1:(typeof Ze.working>"u"&&(Ze.working=Ze(new we)),Ze.working?Ze(ve):ve instanceof we)}n.isSharedArrayBuffer=ft;function pt(ve){return E(ve)==="[object AsyncFunction]"}n.isAsyncFunction=pt;function Ge(ve){return E(ve)==="[object Map Iterator]"}n.isMapIterator=Ge;function rt(ve){return E(ve)==="[object Set Iterator]"}n.isSetIterator=rt;function St(ve){return E(ve)==="[object Generator]"}n.isGeneratorObject=St;function Qt(ve){return E(ve)==="[object WebAssembly.Module]"}n.isWebAssemblyCompiledModule=Qt;function nn(ve){return V(ve,_)}n.isNumberObject=nn;function kt(ve){return V(ve,L)}n.isStringObject=kt;function Ot(ve){return V(ve,R)}n.isBooleanObject=Ot;function Tn(ve){return g&&V(ve,A)}n.isBigIntObject=Tn;function Cn(ve){return v&&V(ve,U)}n.isSymbolObject=Cn;function rn(ve){return nn(ve)||kt(ve)||Ot(ve)||Tn(ve)||Cn(ve)}n.isBoxedPrimitive=rn;function rr(ve){return typeof Uint8Array<"u"&&(Ne(ve)||ft(ve))}n.isAnyArrayBuffer=rr,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(ve){Object.defineProperty(n,ve,{enumerable:!1,value:function(){throw new Error(ve+" is not supported in userland")}})})})(BS);var OH=function(n){return n&&typeof n=="object"&&typeof n.copy=="function"&&typeof n.fill=="function"&&typeof n.readUInt8=="function"},t6={exports:{}};typeof Object.create=="function"?t6.exports=function(n,a){a&&(n.super_=a,n.prototype=Object.create(a.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}))}:t6.exports=function(n,a){if(a){n.super_=a;var s=function(){};s.prototype=a.prototype,n.prototype=new s,n.prototype.constructor=n}};var AH=t6.exports;(function(n){var a=Object.getOwnPropertyDescriptors||function(Y){for(var ce=Object.keys(Y),we={},Ze=0;Ze<ce.length;Ze++)we[ce[Ze]]=Object.getOwnPropertyDescriptor(Y,ce[Ze]);return we},s=/%[sdj%]/g;n.format=function(Y){if(!J(Y)){for(var ce=[],we=0;we<arguments.length;we++)ce.push(g(arguments[we]));return ce.join(" ")}for(var we=1,Ze=arguments,ft=Ze.length,pt=String(Y).replace(s,function(St){if(St==="%%")return"%";if(we>=ft)return St;switch(St){case"%s":return String(Ze[we++]);case"%d":return Number(Ze[we++]);case"%j":try{return JSON.stringify(Ze[we++])}catch{return"[Circular]"}default:return St}}),Ge=Ze[we];we<ft;Ge=Ze[++we])se(Ge)||!He(Ge)?pt+=" "+Ge:pt+=" "+g(Ge);return pt},n.deprecate=function(Y,ce){if(typeof It.process<"u"&&It.process.noDeprecation===!0)return Y;if(typeof It.process>"u")return function(){return n.deprecate(Y,ce).apply(this,arguments)};var we=!1;function Ze(){if(!we){if(It.process.throwDeprecation)throw new Error(ce);It.process.traceDeprecation?console.trace(ce):console.error(ce),we=!0}return Y.apply(this,arguments)}return Ze};var f={},u=/^$/;if(It.process.env.NODE_DEBUG){var y=It.process.env.NODE_DEBUG;y=y.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),u=new RegExp("^"+y+"$","i")}n.debuglog=function(Y){if(Y=Y.toUpperCase(),!f[Y])if(u.test(Y)){var ce=It.process.pid;f[Y]=function(){var we=n.format.apply(n,arguments);console.error("%s %d: %s",Y,ce,we)}}else f[Y]=function(){};return f[Y]};function g(Y,ce){var we={seen:[],stylize:E};return arguments.length>=3&&(we.depth=arguments[2]),arguments.length>=4&&(we.colors=arguments[3]),Q(ce)?we.showHidden=ce:ce&&n._extend(we,ce),fe(we.showHidden)&&(we.showHidden=!1),fe(we.depth)&&(we.depth=2),fe(we.colors)&&(we.colors=!1),fe(we.customInspect)&&(we.customInspect=!0),we.colors&&(we.stylize=v),L(we,Y,we.depth)}n.inspect=g,g.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},g.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function v(Y,ce){var we=g.styles[ce];return we?"\x1B["+g.colors[we][0]+"m"+Y+"\x1B["+g.colors[we][1]+"m":Y}function E(Y,ce){return Y}function _(Y){var ce={};return Y.forEach(function(we,Ze){ce[we]=!0}),ce}function L(Y,ce,we){if(Y.customInspect&&ce&&vt(ce.inspect)&&ce.inspect!==n.inspect&&!(ce.constructor&&ce.constructor.prototype===ce)){var Ze=ce.inspect(we,Y);return J(Ze)||(Ze=L(Y,Ze,we)),Ze}var ft=R(Y,ce);if(ft)return ft;var pt=Object.keys(ce),Ge=_(pt);if(Y.showHidden&&(pt=Object.getOwnPropertyNames(ce)),dt(ce)&&(pt.indexOf("message")>=0||pt.indexOf("description")>=0))return A(ce);if(pt.length===0){if(vt(ce)){var rt=ce.name?": "+ce.name:"";return Y.stylize("[Function"+rt+"]","special")}if(Ue(ce))return Y.stylize(RegExp.prototype.toString.call(ce),"regexp");if(gt(ce))return Y.stylize(Date.prototype.toString.call(ce),"date");if(dt(ce))return A(ce)}var St="",Qt=!1,nn=["{","}"];if(ae(ce)&&(Qt=!0,nn=["[","]"]),vt(ce)){var kt=ce.name?": "+ce.name:"";St=" [Function"+kt+"]"}if(Ue(ce)&&(St=" "+RegExp.prototype.toString.call(ce)),gt(ce)&&(St=" "+Date.prototype.toUTCString.call(ce)),dt(ce)&&(St=" "+A(ce)),pt.length===0&&(!Qt||ce.length==0))return nn[0]+St+nn[1];if(we<0)return Ue(ce)?Y.stylize(RegExp.prototype.toString.call(ce),"regexp"):Y.stylize("[Object]","special");Y.seen.push(ce);var Ot;return Qt?Ot=U(Y,ce,we,Ge,pt):Ot=pt.map(function(Tn){return V(Y,ce,we,Ge,Tn,Qt)}),Y.seen.pop(),G(Ot,St,nn)}function R(Y,ce){if(fe(ce))return Y.stylize("undefined","undefined");if(J(ce)){var we="'"+JSON.stringify(ce).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return Y.stylize(we,"string")}if(ue(ce))return Y.stylize(""+ce,"number");if(Q(ce))return Y.stylize(""+ce,"boolean");if(se(ce))return Y.stylize("null","null")}function A(Y){return"["+Error.prototype.toString.call(Y)+"]"}function U(Y,ce,we,Ze,ft){for(var pt=[],Ge=0,rt=ce.length;Ge<rt;++Ge)Ce(ce,String(Ge))?pt.push(V(Y,ce,we,Ze,String(Ge),!0)):pt.push("");return ft.forEach(function(St){St.match(/^\d+$/)||pt.push(V(Y,ce,we,Ze,St,!0))}),pt}function V(Y,ce,we,Ze,ft,pt){var Ge,rt,St;if(St=Object.getOwnPropertyDescriptor(ce,ft)||{value:ce[ft]},St.get?St.set?rt=Y.stylize("[Getter/Setter]","special"):rt=Y.stylize("[Getter]","special"):St.set&&(rt=Y.stylize("[Setter]","special")),Ce(Ze,ft)||(Ge="["+ft+"]"),rt||(Y.seen.indexOf(St.value)<0?(se(we)?rt=L(Y,St.value,null):rt=L(Y,St.value,we-1),rt.indexOf(`
|
|
176
176
|
`)>-1&&(pt?rt=rt.split(`
|
|
177
177
|
`).map(function(Qt){return" "+Qt}).join(`
|
|
178
178
|
`).slice(2):rt=`
|
package/lib/dist/es/masters.js
CHANGED
|
@@ -40663,7 +40663,7 @@ var Pr;
|
|
|
40663
40663
|
const sQ = (n, a, s, f) => {
|
|
40664
40664
|
const u = new IS(), y = qa(Pr.Unset), g = () => {
|
|
40665
40665
|
const { inplayGame: E } = n.featureSettings.get(), _ = a.getCurrentSessionId({ prefix: "onboarding" });
|
|
40666
|
-
E && f.add({
|
|
40666
|
+
E && E.enable && f.add({
|
|
40667
40667
|
type: Vc.ONBOARDING,
|
|
40668
40668
|
id: _,
|
|
40669
40669
|
action: n.openFeature,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamlayer/react",
|
|
3
|
-
"version": "0.34.
|
|
3
|
+
"version": "0.34.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "StreamLayer, Inc (https://streamlayer.io)",
|
|
6
6
|
"maintainers": [
|
|
@@ -54,15 +54,15 @@
|
|
|
54
54
|
}
|
|
55
55
|
],
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@streamlayer/feature-gamification": "^0.
|
|
57
|
+
"@streamlayer/feature-gamification": "^0.33.0",
|
|
58
58
|
"@streamlayer/sdk-web": "^0.29.5",
|
|
59
59
|
"@streamlayer/sdk-web-api": "^0.0.1",
|
|
60
60
|
"@streamlayer/sdk-web-core": "^0.0.1",
|
|
61
|
-
"@streamlayer/sdk-web-features": "^0.11.
|
|
61
|
+
"@streamlayer/sdk-web-features": "^0.11.6",
|
|
62
62
|
"@streamlayer/sdk-web-interfaces": "^0.18.21",
|
|
63
63
|
"@streamlayer/sdk-web-logger": "^0.0.1",
|
|
64
|
-
"@streamlayer/sdk-web-storage": "^0.0.4",
|
|
65
64
|
"@streamlayer/sdk-web-notifications": "^0.0.5",
|
|
65
|
+
"@streamlayer/sdk-web-storage": "^0.0.4",
|
|
66
66
|
"@streamlayer/sdk-web-types": "^0.1.0"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"size-limit": "^11.0.0",
|
|
120
120
|
"url-loader": "^4.1.1",
|
|
121
121
|
"vite-plugin-dts": "^3.6.3",
|
|
122
|
-
"@streamlayer/react-ui": "^0.88.
|
|
122
|
+
"@streamlayer/react-ui": "^0.88.1"
|
|
123
123
|
},
|
|
124
124
|
"scripts": {
|
|
125
125
|
"size-limit": "size-limit"
|