@mkody/twitch-emoticons 2.9.4 → 2.9.6
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/.jsdoc.json +12 -5
- package/.nvmrc +1 -1
- package/SECURITY.md +3 -2
- package/dist/TwitchEmoticons.min.js +11 -11
- package/dist/TwitchEmoticons.min.js.map +4 -4
- package/docs/BTTVEmote.html +71 -71
- package/docs/Channel.html +18 -18
- package/docs/Collection.html +22 -22
- package/docs/Emote.html +30 -30
- package/docs/EmoteFetcher.html +382 -382
- package/docs/EmoteParser.html +1 -1
- package/docs/FFZEmote.html +81 -81
- package/docs/SevenTVEmote.html +76 -76
- package/docs/TwitchEmote.html +67 -67
- package/docs/index.html +2 -2
- package/docs/struct_BTTVEmote.js.html +1 -1
- package/docs/struct_Channel.js.html +1 -1
- package/docs/struct_Emote.js.html +1 -1
- package/docs/struct_EmoteFetcher.js.html +1 -1
- package/docs/struct_EmoteParser.js.html +1 -1
- package/docs/struct_FFZEmote.js.html +1 -1
- package/docs/struct_SevenTVEmote.js.html +1 -1
- package/docs/struct_TwitchEmote.js.html +1 -1
- package/docs/util_Collection.js.html +1 -1
- package/package.json +9 -9
- package/test/SevenTV.test.js +4 -4
- package/test/__snapshots__/ToFromObject.test.js.snap +1 -1
- package/typings/index.d.ts +3 -3
- package/docs/SevenTV.html +0 -1191
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
var es=Object.defineProperty;var mw=Object.getOwnPropertyDescriptor;var yw=Object.getOwnPropertyNames;var fw=Object.prototype.hasOwnProperty;var n=(i,e)=>es(i,"name",{value:e,configurable:!0});var gw=(i,e)=>()=>(i&&(e=i(i=0)),e);var u=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),bw=(i,e)=>{for(var t in e)es(i,t,{get:e[t],enumerable:!0})},xw=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of yw(e))!fw.call(i,a)&&a!==t&&es(i,a,{get:()=>e[a],enumerable:!(r=mw(e,a))||r.enumerable});return i};var x=i=>xw(es({},"__esModule",{value:!0}),i);var wr=u((eU,K_)=>{var ku=class i{static{n(this,"Emote")}constructor(e,t,r){if(new.target.name===i.name)throw new Error("Base Emote class cannot be used");this.fetcher=e.fetcher,this.channel=e,this.id=t,this.type=null,this._setup(r)}_setup(e){this.code=e.code}toLink(){return null}toString(){return this.code}toObject(){return{code:this.code,id:this.id,channel_id:this.channel.channel_id}}};K_.exports=ku});var It=u((rU,J_)=>{J_.exports={Twitch:{CDN:n((i,e)=>`https://static-cdn.jtvnw.net/emoticons/v2/${i}/default/dark/${e+1}.0`,"CDN")},BTTV:{Global:"https://api.betterttv.net/3/cached/emotes/global",Channel:n(i=>`https://api.betterttv.net/3/cached/users/twitch/${i}`,"Channel"),CDN:n((i,e)=>`https://cdn.betterttv.net/emote/${i}/${e+1}x.webp`,"CDN")},SevenTV:{Global:"https://7tv.io/v3/emote-sets/global",Channel:n(i=>`https://7tv.io/v3/users/twitch/${i}`,"Channel"),CDN:n((i,e)=>`https://cdn.7tv.app/emote/${i}/${e}`,"CDN")},FFZ:{sets:{Global:3,Modifiers:1532818},Set:n(i=>`https://api.frankerfacez.com/v1/set/${i}`,"Set"),Channel:n(i=>`https://api.frankerfacez.com/v1/room/id/${i}`,"Channel"),CDN:n((i,e)=>`https://cdn.frankerfacez.com/emote/${i}/${e}`,"CDN"),CDNAnimated:n((i,e)=>`https://cdn.frankerfacez.com/emote/${i}/animated/${e}.webp`,"CDNAnimated")},Templates:{html:'<img alt="{name}" title="{name}" class="twitch-emote twitch-emote-{size}" src="{link}">',markdown:'',bbcode:"[img]{link}[/img]",plain:"{link}"}}});var Lu=u((nU,Z_)=>{var ww=wr(),vw=It(),Mu=class i extends ww{static{n(this,"BTTVEmote")}constructor(e,t,r){super(e,t,r),this.type="bttv"}get owner(){return this.fetcher.channels.get(this.ownerName)}_setup(e){super._setup(e),this.ownerName="user"in e?e.user.name:null,this.animated=e.animated,this.imageType="webp"}toLink(e=0){return vw.BTTV.CDN(this.id,e)}toObject(){return Object.assign({},super.toObject(),{animated:this.animated,ownerName:this.ownerName,type:this.type})}static fromObject(e,t=null){return new i(t,e.id,{code:e.code,animated:e.animated,user:{name:e.ownerName}})}};Z_.exports=Mu});var ts=u((sU,X_)=>{var Fu=class extends Map{static{n(this,"Collection")}find(e,t){if(typeof e=="string"){if(typeof t>"u")return null;for(let r of this.values())if(r[e]===t)return r;return null}if(typeof e=="function"){let r=0;for(let a of this.values()){if(e(a,r,this))return a;r++}return null}return null}filter(e,t){t&&(e=e.bind(t));let r=new this.constructor,a=0;for(let[s,o]of this)e(o,a,this)&&r.set(s,o),a++;return r}map(e,t){t&&(e=e.bind(t));let r=new Array(this.size),a=0;for(let s of this.values())r[a]=e(s,a,this),a++;return r}};X_.exports=Fu});var Qu=u((lU,Y_)=>{var Sw=ts(),Nu=class{static{n(this,"Channel")}constructor(e,t){this.fetcher=e,this.channel_id=t,this.emotes=new Sw}fetchBTTVEmotes(){return this.fetcher.fetchBTTVEmotes(this.id)}fetchFFZEmotes(){return this.fetcher.fetchFFZEmotes(this.id)}fetchSevenTVEmotes(){return this.fetcher.fetchSevenTVEmotes(this.id)}};Y_.exports=Nu});var Wu=u((cU,tm)=>{var Hw=wr(),em=It(),Gu=class i extends Hw{static{n(this,"FFZEmote")}constructor(e,t,r){super(e,t,r),this.type="ffz"}get owner(){return this.fetcher.channels.get(this.ownerName)}_setup(e){super._setup(e),this.code=e.name,this.ownerName="owner"in e?e.owner.name:null,this.sizes="animated"in e?Object.keys(e.animated):Object.keys(e.urls),this.animated="animated"in e,this.imageType="animated"in e?"webp":"png",this.modifier=e.modifier&&(e.modifier_flags&1)!==0}toLink(e=0){return e=this.sizes[e],this.animated?em.FFZ.CDNAnimated(this.id,e):em.FFZ.CDN(this.id,e)}toObject(){return Object.assign({},super.toObject(),{animated:this.animated,sizes:this.sizes,ownerName:this.ownerName,type:this.type,modifier:this.modifier})}static fromObject(e,t=null){let r=e.sizes.reduce((a,s)=>(a[s]=s,a),{});return new i(t,e.id,{code:e.code,name:e.code,urls:r,...e.animated?{animated:r}:{},owner:{name:e.ownerName},modifier:e.modifier,modifier_flags:e.modifier})}};tm.exports=Gu});var $u=u((hU,rm)=>{var Cw=wr(),qw=It(),Vu=class i extends Cw{static{n(this,"SevenTVEmote")}constructor(e,t,r){super(e,t,r),this.type="7tv"}get owner(){return this.fetcher.channels.get(this.ownerName)}_setup(e){super._setup(e),this.code=e.name,this.ownerName="owner"in e.data?e.data.owner.display_name:null,this.sizes=e.data.host.files.filter(t=>t.format===this.channel.format.toUpperCase()).map(t=>t.name),this.animated=e.data.animated,this.imageType=this.channel.format}toLink(e=0){return e=this.sizes[e],qw.SevenTV.CDN(this.id,e)}toObject(){return Object.assign({},super.toObject(),{animated:this.animated,sizes:this.sizes,ownerName:this.ownerName,type:this.type,imageType:this.imageType})}static fromObject(e,t){let r=e.sizes.map(a=>({format:t.format.toUpperCase(),name:a}));return new i(t,e.id,{code:e.code,name:e.code,data:{animated:e.animated,owner:{display_name:e.ownerName},host:{files:r}}})}};rm.exports=Vu});var Ku=u((_U,im)=>{var Ew=wr(),Pw=It(),zu=class i extends Ew{static{n(this,"TwitchEmote")}constructor(e,t,r){super(e,t,r),this.type="twitch"}get owner(){return this.channel}_setup(e){super._setup(e),this.set=e.emoticon_set,this.animated="animated"in e.formats,this.imageType="animated"in e.formats?"gif":"png"}toLink(e=0){return Pw.Twitch.CDN(this.id,e)}toObject(){return Object.assign({},super.toObject(),{animated:this.animated,set:this.set,type:this.type})}static fromObject(e,t=null){return new i(t,e.id,{code:e.code,animated:e.animated,emoticon_set:e.set,formats:e.animated?{animated:e.animated}:{}})}};im.exports=zu});var Gm=u((yU,Qm)=>{"use strict";function xm(i,e){return n(function(){return i.apply(e,arguments)},"wrap")}n(xm,"bind");var{toString:Aw}=Object.prototype,{getPrototypeOf:sc}=Object,{iterator:ls,toStringTag:wm}=Symbol,us=(i=>e=>{let t=Aw.call(e);return i[t]||(i[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),Ze=n(i=>(i=i.toLowerCase(),e=>us(e)===i),"kindOfTest"),cs=n(i=>e=>typeof e===i,"typeOfTest"),{isArray:Cr}=Array,vr=cs("undefined");function pi(i){return i!==null&&!vr(i)&&i.constructor!==null&&!vr(i.constructor)&&Ce(i.constructor.isBuffer)&&i.constructor.isBuffer(i)}n(pi,"isBuffer");var vm=Ze("ArrayBuffer");function Dw(i){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(i):e=i&&i.buffer&&vm(i.buffer),e}n(Dw,"isArrayBufferView");var Iw=cs("string"),Ce=cs("function"),Sm=cs("number"),_i=n(i=>i!==null&&typeof i=="object","isObject"),Tw=n(i=>i===!0||i===!1,"isBoolean"),is=n(i=>{if(us(i)!=="object")return!1;let e=sc(i);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(wm in i)&&!(ls in i)},"isPlainObject"),Rw=n(i=>{if(!_i(i)||pi(i))return!1;try{return Object.keys(i).length===0&&Object.getPrototypeOf(i)===Object.prototype}catch{return!1}},"isEmptyObject"),Uw=Ze("Date"),Bw=Ze("File"),Ow=Ze("Blob"),jw=Ze("FileList"),kw=n(i=>_i(i)&&Ce(i.pipe),"isStream"),Mw=n(i=>{let e;return i&&(typeof FormData=="function"&&i instanceof FormData||Ce(i.append)&&((e=us(i))==="formdata"||e==="object"&&Ce(i.toString)&&i.toString()==="[object FormData]"))},"isFormData"),Lw=Ze("URLSearchParams"),[Fw,Nw,Qw,Gw]=["ReadableStream","Request","Response","Headers"].map(Ze),Ww=n(i=>i.trim?i.trim():i.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),"trim");function mi(i,e,{allOwnKeys:t=!1}={}){if(i===null||typeof i>"u")return;let r,a;if(typeof i!="object"&&(i=[i]),Cr(i))for(r=0,a=i.length;r<a;r++)e.call(null,i[r],r,i);else{if(pi(i))return;let s=t?Object.getOwnPropertyNames(i):Object.keys(i),o=s.length,l;for(r=0;r<o;r++)l=s[r],e.call(null,i[l],l,i)}}n(mi,"forEach");function Hm(i,e){if(pi(i))return null;e=e.toLowerCase();let t=Object.keys(i),r=t.length,a;for(;r-- >0;)if(a=t[r],e===a.toLowerCase())return a;return null}n(Hm,"findKey");var er=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Cm=n(i=>!vr(i)&&i!==er,"isContextDefined");function Yu(){let{caseless:i,skipUndefined:e}=Cm(this)&&this||{},t={},r=n((a,s)=>{let o=i&&Hm(t,s)||s;is(t[o])&&is(a)?t[o]=Yu(t[o],a):is(a)?t[o]=Yu({},a):Cr(a)?t[o]=a.slice():(!e||!vr(a))&&(t[o]=a)},"assignValue");for(let a=0,s=arguments.length;a<s;a++)arguments[a]&&mi(arguments[a],r);return t}n(Yu,"merge");var Vw=n((i,e,t,{allOwnKeys:r}={})=>(mi(e,(a,s)=>{t&&Ce(a)?i[s]=xm(a,t):i[s]=a},{allOwnKeys:r}),i),"extend"),$w=n(i=>(i.charCodeAt(0)===65279&&(i=i.slice(1)),i),"stripBOM"),zw=n((i,e,t,r)=>{i.prototype=Object.create(e.prototype,r),i.prototype.constructor=i,Object.defineProperty(i,"super",{value:e.prototype}),t&&Object.assign(i.prototype,t)},"inherits"),Kw=n((i,e,t,r)=>{let a,s,o,l={};if(e=e||{},i==null)return e;do{for(a=Object.getOwnPropertyNames(i),s=a.length;s-- >0;)o=a[s],(!r||r(o,i,e))&&!l[o]&&(e[o]=i[o],l[o]=!0);i=t!==!1&&sc(i)}while(i&&(!t||t(i,e))&&i!==Object.prototype);return e},"toFlatObject"),Jw=n((i,e,t)=>{i=String(i),(t===void 0||t>i.length)&&(t=i.length),t-=e.length;let r=i.indexOf(e,t);return r!==-1&&r===t},"endsWith"),Zw=n(i=>{if(!i)return null;if(Cr(i))return i;let e=i.length;if(!Sm(e))return null;let t=new Array(e);for(;e-- >0;)t[e]=i[e];return t},"toArray"),Xw=(i=>e=>i&&e instanceof i)(typeof Uint8Array<"u"&&sc(Uint8Array)),Yw=n((i,e)=>{let r=(i&&i[ls]).call(i),a;for(;(a=r.next())&&!a.done;){let s=a.value;e.call(i,s[0],s[1])}},"forEachEntry"),ev=n((i,e)=>{let t,r=[];for(;(t=i.exec(e))!==null;)r.push(t);return r},"matchAll"),tv=Ze("HTMLFormElement"),rv=n(i=>i.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,n(function(t,r,a){return r.toUpperCase()+a},"replacer")),"toCamelCase"),nm=(({hasOwnProperty:i})=>(e,t)=>i.call(e,t))(Object.prototype),iv=Ze("RegExp"),qm=n((i,e)=>{let t=Object.getOwnPropertyDescriptors(i),r={};mi(t,(a,s)=>{let o;(o=e(a,s,i))!==!1&&(r[s]=o||a)}),Object.defineProperties(i,r)},"reduceDescriptors"),nv=n(i=>{qm(i,(e,t)=>{if(Ce(i)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;let r=i[t];if(Ce(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},"freezeMethods"),av=n((i,e)=>{let t={},r=n(a=>{a.forEach(s=>{t[s]=!0})},"define");return Cr(i)?r(i):r(String(i).split(e)),t},"toObjectSet"),sv=n(()=>{},"noop"),ov=n((i,e)=>i!=null&&Number.isFinite(i=+i)?i:e,"toFiniteNumber");function lv(i){return!!(i&&Ce(i.append)&&i[wm]==="FormData"&&i[ls])}n(lv,"isSpecCompliantForm");var uv=n(i=>{let e=new Array(10),t=n((r,a)=>{if(_i(r)){if(e.indexOf(r)>=0)return;if(pi(r))return r;if(!("toJSON"in r)){e[a]=r;let s=Cr(r)?[]:{};return mi(r,(o,l)=>{let c=t(o,a+1);!vr(c)&&(s[l]=c)}),e[a]=void 0,s}}return r},"visit");return t(i,0)},"toJSONObject"),cv=Ze("AsyncFunction"),dv=n(i=>i&&(_i(i)||Ce(i))&&Ce(i.then)&&Ce(i.catch),"isThenable"),Em=((i,e)=>i?setImmediate:e?((t,r)=>(er.addEventListener("message",({source:a,data:s})=>{a===er&&s===t&&r.length&&r.shift()()},!1),a=>{r.push(a),er.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",Ce(er.postMessage)),hv=typeof queueMicrotask<"u"?queueMicrotask.bind(er):typeof process<"u"&&process.nextTick||Em,pv=n(i=>i!=null&&Ce(i[ls]),"isIterable"),_={isArray:Cr,isArrayBuffer:vm,isBuffer:pi,isFormData:Mw,isArrayBufferView:Dw,isString:Iw,isNumber:Sm,isBoolean:Tw,isObject:_i,isPlainObject:is,isEmptyObject:Rw,isReadableStream:Fw,isRequest:Nw,isResponse:Qw,isHeaders:Gw,isUndefined:vr,isDate:Uw,isFile:Bw,isBlob:Ow,isRegExp:iv,isFunction:Ce,isStream:kw,isURLSearchParams:Lw,isTypedArray:Xw,isFileList:jw,forEach:mi,merge:Yu,extend:Vw,trim:Ww,stripBOM:$w,inherits:zw,toFlatObject:Kw,kindOf:us,kindOfTest:Ze,endsWith:Jw,toArray:Zw,forEachEntry:Yw,matchAll:ev,isHTMLForm:tv,hasOwnProperty:nm,hasOwnProp:nm,reduceDescriptors:qm,freezeMethods:nv,toObjectSet:av,toCamelCase:rv,noop:sv,toFiniteNumber:ov,findKey:Hm,global:er,isContextDefined:Cm,isSpecCompliantForm:lv,toJSONObject:uv,isAsyncFn:cv,isThenable:dv,setImmediate:Em,asap:hv,isIterable:pv};function T(i,e,t,r,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=i,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),r&&(this.request=r),a&&(this.response=a,this.status=a.status?a.status:null)}n(T,"AxiosError");_.inherits(T,Error,{toJSON:n(function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:_.toJSONObject(this.config),code:this.code,status:this.status}},"toJSON")});var Pm=T.prototype,Am={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(i=>{Am[i]={value:i}});Object.defineProperties(T,Am);Object.defineProperty(Pm,"isAxiosError",{value:!0});T.from=(i,e,t,r,a,s)=>{let o=Object.create(Pm);_.toFlatObject(i,o,n(function(p){return p!==Error.prototype},"filter"),h=>h!=="isAxiosError");let l=i&&i.message?i.message:"Error",c=e==null&&i?i.code:e;return T.call(o,l,c,t,r,a),i&&o.cause==null&&Object.defineProperty(o,"cause",{value:i,configurable:!0}),o.name=i&&i.name||"Error",s&&Object.assign(o,s),o};var _v=null;function ec(i){return _.isPlainObject(i)||_.isArray(i)}n(ec,"isVisitable");function Dm(i){return _.endsWith(i,"[]")?i.slice(0,-2):i}n(Dm,"removeBrackets");function am(i,e,t){return i?i.concat(e).map(n(function(a,s){return a=Dm(a),!t&&s?"["+a+"]":a},"each")).join(t?".":""):e}n(am,"renderKey");function mv(i){return _.isArray(i)&&!i.some(ec)}n(mv,"isFlatArray");var yv=_.toFlatObject(_,{},null,n(function(e){return/^is[A-Z]/.test(e)},"filter"));function ds(i,e,t){if(!_.isObject(i))throw new TypeError("target must be an object");e=e||new FormData,t=_.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,n(function(q,v){return!_.isUndefined(v[q])},"defined"));let r=t.metaTokens,a=t.visitor||p,s=t.dots,o=t.indexes,c=(t.Blob||typeof Blob<"u"&&Blob)&&_.isSpecCompliantForm(e);if(!_.isFunction(a))throw new TypeError("visitor must be a function");function h(y){if(y===null)return"";if(_.isDate(y))return y.toISOString();if(_.isBoolean(y))return y.toString();if(!c&&_.isBlob(y))throw new T("Blob is not supported. Use a Buffer instead.");return _.isArrayBuffer(y)||_.isTypedArray(y)?c&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}n(h,"convertValue");function p(y,q,v){let B=y;if(y&&!v&&typeof y=="object"){if(_.endsWith(q,"{}"))q=r?q:q.slice(0,-2),y=JSON.stringify(y);else if(_.isArray(y)&&mv(y)||(_.isFileList(y)||_.endsWith(q,"[]"))&&(B=_.toArray(y)))return q=Dm(q),B.forEach(n(function(z,k){!(_.isUndefined(z)||z===null)&&e.append(o===!0?am([q],k,s):o===null?q:q+"[]",h(z))},"each")),!1}return ec(y)?!0:(e.append(am(v,q,s),h(y)),!1)}n(p,"defaultVisitor");let w=[],E=Object.assign(yv,{defaultVisitor:p,convertValue:h,isVisitable:ec});function P(y,q){if(!_.isUndefined(y)){if(w.indexOf(y)!==-1)throw Error("Circular reference detected in "+q.join("."));w.push(y),_.forEach(y,n(function(B,ge){(!(_.isUndefined(B)||B===null)&&a.call(e,B,_.isString(ge)?ge.trim():ge,q,E))===!0&&P(B,q?q.concat(ge):[ge])},"each")),w.pop()}}if(n(P,"build"),!_.isObject(i))throw new TypeError("data must be an object");return P(i),e}n(ds,"toFormData");function sm(i){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(i).replace(/[!'()~]|%20|%00/g,n(function(r){return e[r]},"replacer"))}n(sm,"encode$1");function oc(i,e){this._pairs=[],i&&ds(i,this,e)}n(oc,"AxiosURLSearchParams");var Im=oc.prototype;Im.append=n(function(e,t){this._pairs.push([e,t])},"append");Im.toString=n(function(e){let t=e?function(r){return e.call(this,r,sm)}:sm;return this._pairs.map(n(function(a){return t(a[0])+"="+t(a[1])},"each"),"").join("&")},"toString");function fv(i){return encodeURIComponent(i).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}n(fv,"encode");function Tm(i,e,t){if(!e)return i;let r=t&&t.encode||fv;_.isFunction(t)&&(t={serialize:t});let a=t&&t.serialize,s;if(a?s=a(e,t):s=_.isURLSearchParams(e)?e.toString():new oc(e,t).toString(r),s){let o=i.indexOf("#");o!==-1&&(i=i.slice(0,o)),i+=(i.indexOf("?")===-1?"?":"&")+s}return i}n(Tm,"buildURL");var tc=class{static{n(this,"InterceptorManager")}constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){_.forEach(this.handlers,n(function(r){r!==null&&e(r)},"forEachHandler"))}},om=tc,Rm={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},gv=typeof URLSearchParams<"u"?URLSearchParams:oc,bv=typeof FormData<"u"?FormData:null,xv=typeof Blob<"u"?Blob:null,wv={isBrowser:!0,classes:{URLSearchParams:gv,FormData:bv,Blob:xv},protocols:["http","https","file","blob","url","data"]},lc=typeof window<"u"&&typeof document<"u",rc=typeof navigator=="object"&&navigator||void 0,vv=lc&&(!rc||["ReactNative","NativeScript","NS"].indexOf(rc.product)<0),Sv=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Hv=lc&&window.location.href||"http://localhost",Cv=Object.freeze({__proto__:null,hasBrowserEnv:lc,hasStandardBrowserWebWorkerEnv:Sv,hasStandardBrowserEnv:vv,navigator:rc,origin:Hv}),we={...Cv,...wv};function qv(i,e){return ds(i,new we.classes.URLSearchParams,{visitor:n(function(t,r,a,s){return we.isNode&&_.isBuffer(t)?(this.append(r,t.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},"visitor"),...e})}n(qv,"toURLEncodedForm");function Ev(i){return _.matchAll(/\w+|\[(\w*)]/g,i).map(e=>e[0]==="[]"?"":e[1]||e[0])}n(Ev,"parsePropPath");function Pv(i){let e={},t=Object.keys(i),r,a=t.length,s;for(r=0;r<a;r++)s=t[r],e[s]=i[s];return e}n(Pv,"arrayToObject");function Um(i){function e(t,r,a,s){let o=t[s++];if(o==="__proto__")return!0;let l=Number.isFinite(+o),c=s>=t.length;return o=!o&&_.isArray(a)?a.length:o,c?(_.hasOwnProp(a,o)?a[o]=[a[o],r]:a[o]=r,!l):((!a[o]||!_.isObject(a[o]))&&(a[o]=[]),e(t,r,a[o],s)&&_.isArray(a[o])&&(a[o]=Pv(a[o])),!l)}if(n(e,"buildPath"),_.isFormData(i)&&_.isFunction(i.entries)){let t={};return _.forEachEntry(i,(r,a)=>{e(Ev(r),a,t,0)}),t}return null}n(Um,"formDataToJSON");function Av(i,e,t){if(_.isString(i))try{return(e||JSON.parse)(i),_.trim(i)}catch(r){if(r.name!=="SyntaxError")throw r}return(t||JSON.stringify)(i)}n(Av,"stringifySafely");var uc={transitional:Rm,adapter:["xhr","http","fetch"],transformRequest:[n(function(e,t){let r=t.getContentType()||"",a=r.indexOf("application/json")>-1,s=_.isObject(e);if(s&&_.isHTMLForm(e)&&(e=new FormData(e)),_.isFormData(e))return a?JSON.stringify(Um(e)):e;if(_.isArrayBuffer(e)||_.isBuffer(e)||_.isStream(e)||_.isFile(e)||_.isBlob(e)||_.isReadableStream(e))return e;if(_.isArrayBufferView(e))return e.buffer;if(_.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let l;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return qv(e,this.formSerializer).toString();if((l=_.isFileList(e))||r.indexOf("multipart/form-data")>-1){let c=this.env&&this.env.FormData;return ds(l?{"files[]":e}:e,c&&new c,this.formSerializer)}}return s||a?(t.setContentType("application/json",!1),Av(e)):e},"transformRequest")],transformResponse:[n(function(e){let t=this.transitional||uc.transitional,r=t&&t.forcedJSONParsing,a=this.responseType==="json";if(_.isResponse(e)||_.isReadableStream(e))return e;if(e&&_.isString(e)&&(r&&!this.responseType||a)){let o=!(t&&t.silentJSONParsing)&&a;try{return JSON.parse(e,this.parseReviver)}catch(l){if(o)throw l.name==="SyntaxError"?T.from(l,T.ERR_BAD_RESPONSE,this,null,this.response):l}}return e},"transformResponse")],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:we.classes.FormData,Blob:we.classes.Blob},validateStatus:n(function(e){return e>=200&&e<300},"validateStatus"),headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};_.forEach(["delete","get","head","post","put","patch"],i=>{uc.headers[i]={}});var cc=uc,Dv=_.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Iv=n(i=>{let e={},t,r,a;return i&&i.split(`
|
|
2
|
-
`).forEach(n(function(o){a=o.indexOf(":"),t=o.substring(0,a).trim().toLowerCase(),r=o.substring(a+1).trim(),!(!t||e[t]&&Dv[t])&&(t==="set-cookie"?e[t]?e[t].push(r):e[t]=[r]:e[t]=e[t]?e[t]+", "+r:r)},"parser")),e},"parseHeaders"),
|
|
3
|
-
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let r=new this(e);return t.forEach(a=>r.set(a)),r}static accessor(e){let r=(this[lm]=this[lm]={accessors:{}}).accessors,a=this.prototype;function s(o){let l=hi(o);r[l]||(Bv(a,o),r[l]=!0)}return n(s,"defineAccessor"),_.isArray(e)?e.forEach(s):s(e),this}};Sr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);_.reduceDescriptors(Sr.prototype,({value:i},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:n(()=>i,"get"),set(r){this[t]=r}}});_.freezeMethods(Sr);var Je=Sr;function Zu(i,e){let t=this||cc,r=e||t,a=Je.from(r.headers),s=r.data;return _.forEach(i,n(function(l){s=l.call(t,s,a.normalize(),e?e.status:void 0)},"transform")),a.normalize(),s}n(Zu,"transformData");function Bm(i){return!!(i&&i.__CANCEL__)}n(Bm,"isCancel");function qr(i,e,t){T.call(this,i??"canceled",T.ERR_CANCELED,e,t),this.name="CanceledError"}n(qr,"CanceledError");_.inherits(qr,T,{__CANCEL__:!0});function Om(i,e,t){let r=t.config.validateStatus;!t.status||!r||r(t.status)?i(t):e(new T("Request failed with status code "+t.status,[T.ERR_BAD_REQUEST,T.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}n(Om,"settle");function Ov(i){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(i);return e&&e[1]||""}n(Ov,"parseProtocol");function jv(i,e){i=i||10;let t=new Array(i),r=new Array(i),a=0,s=0,o;return e=e!==void 0?e:1e3,n(function(c){let h=Date.now(),p=r[s];o||(o=h),t[a]=c,r[a]=h;let w=s,E=0;for(;w!==a;)E+=t[w++],w=w%i;if(a=(a+1)%i,a===s&&(s=(s+1)%i),h-o<e)return;let P=p&&h-p;return P?Math.round(E*1e3/P):void 0},"push")}n(jv,"speedometer");function kv(i,e){let t=0,r=1e3/e,a,s,o=n((h,p=Date.now())=>{t=p,a=null,s&&(clearTimeout(s),s=null),i(...h)},"invoke");return[n((...h)=>{let p=Date.now(),w=p-t;w>=r?o(h,p):(a=h,s||(s=setTimeout(()=>{s=null,o(a)},r-w)))},"throttled"),n(()=>a&&o(a),"flush")]}n(kv,"throttle");var os=n((i,e,t=3)=>{let r=0,a=jv(50,250);return kv(s=>{let o=s.loaded,l=s.lengthComputable?s.total:void 0,c=o-r,h=a(c),p=o<=l;r=o;let w={loaded:o,total:l,progress:l?o/l:void 0,bytes:c,rate:h||void 0,estimated:h&&l&&p?(l-o)/h:void 0,event:s,lengthComputable:l!=null,[e?"download":"upload"]:!0};i(w)},t)},"progressEventReducer"),um=n((i,e)=>{let t=i!=null;return[r=>e[0]({lengthComputable:t,total:i,loaded:r}),e[1]]},"progressEventDecorator"),cm=n(i=>(...e)=>_.asap(()=>i(...e)),"asyncDecorator"),Mv=we.hasStandardBrowserEnv?((i,e)=>t=>(t=new URL(t,we.origin),i.protocol===t.protocol&&i.host===t.host&&(e||i.port===t.port)))(new URL(we.origin),we.navigator&&/(msie|trident)/i.test(we.navigator.userAgent)):()=>!0,Lv=we.hasStandardBrowserEnv?{write(i,e,t,r,a,s){let o=[i+"="+encodeURIComponent(e)];_.isNumber(t)&&o.push("expires="+new Date(t).toGMTString()),_.isString(r)&&o.push("path="+r),_.isString(a)&&o.push("domain="+a),s===!0&&o.push("secure"),document.cookie=o.join("; ")},read(i){let e=document.cookie.match(new RegExp("(^|;\\s*)("+i+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(i){this.write(i,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Fv(i){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(i)}n(Fv,"isAbsoluteURL");function Nv(i,e){return e?i.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):i}n(Nv,"combineURLs");function jm(i,e,t){let r=!Fv(e);return i&&(r||t==!1)?Nv(i,e):e}n(jm,"buildFullPath");var dm=n(i=>i instanceof Je?{...i}:i,"headersToObject");function tr(i,e){e=e||{};let t={};function r(h,p,w,E){return _.isPlainObject(h)&&_.isPlainObject(p)?_.merge.call({caseless:E},h,p):_.isPlainObject(p)?_.merge({},p):_.isArray(p)?p.slice():p}n(r,"getMergedValue");function a(h,p,w,E){if(_.isUndefined(p)){if(!_.isUndefined(h))return r(void 0,h,w,E)}else return r(h,p,w,E)}n(a,"mergeDeepProperties");function s(h,p){if(!_.isUndefined(p))return r(void 0,p)}n(s,"valueFromConfig2");function o(h,p){if(_.isUndefined(p)){if(!_.isUndefined(h))return r(void 0,h)}else return r(void 0,p)}n(o,"defaultToConfig2");function l(h,p,w){if(w in e)return r(h,p);if(w in i)return r(void 0,h)}n(l,"mergeDirectKeys");let c={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:l,headers:n((h,p,w)=>a(dm(h),dm(p),w,!0),"headers")};return _.forEach(Object.keys({...i,...e}),n(function(p){let w=c[p]||a,E=w(i[p],e[p],p);_.isUndefined(E)&&w!==l||(t[p]=E)},"computeConfigValue")),t}n(tr,"mergeConfig");var km=n(i=>{let e=tr({},i),{data:t,withXSRFToken:r,xsrfHeaderName:a,xsrfCookieName:s,headers:o,auth:l}=e;if(e.headers=o=Je.from(o),e.url=Tm(jm(e.baseURL,e.url,e.allowAbsoluteUrls),i.params,i.paramsSerializer),l&&o.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),_.isFormData(t)){if(we.hasStandardBrowserEnv||we.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(_.isFunction(t.getHeaders)){let c=t.getHeaders(),h=["content-type","content-length"];Object.entries(c).forEach(([p,w])=>{h.includes(p.toLowerCase())&&o.set(p,w)})}}if(we.hasStandardBrowserEnv&&(r&&_.isFunction(r)&&(r=r(e)),r||r!==!1&&Mv(e.url))){let c=a&&s&&Lv.read(s);c&&o.set(a,c)}return e},"resolveConfig"),Qv=typeof XMLHttpRequest<"u",Gv=Qv&&function(i){return new Promise(n(function(t,r){let a=km(i),s=a.data,o=Je.from(a.headers).normalize(),{responseType:l,onUploadProgress:c,onDownloadProgress:h}=a,p,w,E,P,y;function q(){P&&P(),y&&y(),a.cancelToken&&a.cancelToken.unsubscribe(p),a.signal&&a.signal.removeEventListener("abort",p)}n(q,"done");let v=new XMLHttpRequest;v.open(a.method.toUpperCase(),a.url,!0),v.timeout=a.timeout;function B(){if(!v)return;let z=Je.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),Ue={data:!l||l==="text"||l==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:z,config:i,request:v};Om(n(function(J){t(J),q()},"_resolve"),n(function(J){r(J),q()},"_reject"),Ue),v=null}n(B,"onloadend"),"onloadend"in v?v.onloadend=B:v.onreadystatechange=n(function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)||setTimeout(B)},"handleLoad"),v.onabort=n(function(){v&&(r(new T("Request aborted",T.ECONNABORTED,i,v)),v=null)},"handleAbort"),v.onerror=n(function(k){let Ue=k&&k.message?k.message:"Network Error",yt=new T(Ue,T.ERR_NETWORK,i,v);yt.event=k||null,r(yt),v=null},"handleError"),v.ontimeout=n(function(){let k=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded",Ue=a.transitional||Rm;a.timeoutErrorMessage&&(k=a.timeoutErrorMessage),r(new T(k,Ue.clarifyTimeoutError?T.ETIMEDOUT:T.ECONNABORTED,i,v)),v=null},"handleTimeout"),s===void 0&&o.setContentType(null),"setRequestHeader"in v&&_.forEach(o.toJSON(),n(function(k,Ue){v.setRequestHeader(Ue,k)},"setRequestHeader")),_.isUndefined(a.withCredentials)||(v.withCredentials=!!a.withCredentials),l&&l!=="json"&&(v.responseType=a.responseType),h&&([E,y]=os(h,!0),v.addEventListener("progress",E)),c&&v.upload&&([w,P]=os(c),v.upload.addEventListener("progress",w),v.upload.addEventListener("loadend",P)),(a.cancelToken||a.signal)&&(p=n(z=>{v&&(r(!z||z.type?new qr(null,i,v):z),v.abort(),v=null)},"onCanceled"),a.cancelToken&&a.cancelToken.subscribe(p),a.signal&&(a.signal.aborted?p():a.signal.addEventListener("abort",p)));let ge=Ov(a.url);if(ge&&we.protocols.indexOf(ge)===-1){r(new T("Unsupported protocol "+ge+":",T.ERR_BAD_REQUEST,i));return}v.send(s||null)},"dispatchXhrRequest"))},Wv=n((i,e)=>{let{length:t}=i=i?i.filter(Boolean):[];if(e||t){let r=new AbortController,a,s=n(function(h){if(!a){a=!0,l();let p=h instanceof Error?h:this.reason;r.abort(p instanceof T?p:new qr(p instanceof Error?p.message:p))}},"onabort"),o=e&&setTimeout(()=>{o=null,s(new T(`timeout ${e} of ms exceeded`,T.ETIMEDOUT))},e),l=n(()=>{i&&(o&&clearTimeout(o),o=null,i.forEach(h=>{h.unsubscribe?h.unsubscribe(s):h.removeEventListener("abort",s)}),i=null)},"unsubscribe");i.forEach(h=>h.addEventListener("abort",s));let{signal:c}=r;return c.unsubscribe=()=>_.asap(l),c}},"composeSignals"),Vv=Wv,$v=n(function*(i,e){let t=i.byteLength;if(!e||t<e){yield i;return}let r=0,a;for(;r<t;)a=r+e,yield i.slice(r,a),r=a},"streamChunk"),zv=n(async function*(i,e){for await(let t of Kv(i))yield*$v(t,e)},"readBytes"),Kv=n(async function*(i){if(i[Symbol.asyncIterator]){yield*i;return}let e=i.getReader();try{for(;;){let{done:t,value:r}=await e.read();if(t)break;yield r}}finally{await e.cancel()}},"readStream"),hm=n((i,e,t,r)=>{let a=zv(i,e),s=0,o,l=n(c=>{o||(o=!0,r&&r(c))},"_onFinish");return new ReadableStream({async pull(c){try{let{done:h,value:p}=await a.next();if(h){l(),c.close();return}let w=p.byteLength;if(t){let E=s+=w;t(E)}c.enqueue(new Uint8Array(p))}catch(h){throw l(h),h}},cancel(c){return l(c),a.return()}},{highWaterMark:2})},"trackStream"),pm=64*1024,{isFunction:rs}=_,Jv=(({Request:i,Response:e})=>({Request:i,Response:e}))(_.global),{ReadableStream:_m,TextEncoder:mm}=_.global,ym=n((i,...e)=>{try{return!!i(...e)}catch{return!1}},"test"),Zv=n(i=>{i=_.merge.call({skipUndefined:!0},Jv,i);let{fetch:e,Request:t,Response:r}=i,a=e?rs(e):typeof fetch=="function",s=rs(t),o=rs(r);if(!a)return!1;let l=a&&rs(_m),c=a&&(typeof mm=="function"?(y=>q=>y.encode(q))(new mm):async y=>new Uint8Array(await new t(y).arrayBuffer())),h=s&&l&&ym(()=>{let y=!1,q=new t(we.origin,{body:new _m,method:"POST",get duplex(){return y=!0,"half"}}).headers.has("Content-Type");return y&&!q}),p=o&&l&&ym(()=>_.isReadableStream(new r("").body)),w={stream:p&&(y=>y.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(y=>{!w[y]&&(w[y]=(q,v)=>{let B=q&&q[y];if(B)return B.call(q);throw new T(`Response type '${y}' is not supported`,T.ERR_NOT_SUPPORT,v)})});let E=n(async y=>{if(y==null)return 0;if(_.isBlob(y))return y.size;if(_.isSpecCompliantForm(y))return(await new t(we.origin,{method:"POST",body:y}).arrayBuffer()).byteLength;if(_.isArrayBufferView(y)||_.isArrayBuffer(y))return y.byteLength;if(_.isURLSearchParams(y)&&(y=y+""),_.isString(y))return(await c(y)).byteLength},"getBodyLength"),P=n(async(y,q)=>{let v=_.toFiniteNumber(y.getContentLength());return v??E(q)},"resolveBodyLength");return async y=>{let{url:q,method:v,data:B,signal:ge,cancelToken:z,timeout:k,onDownloadProgress:Ue,onUploadProgress:yt,responseType:J,headers:di,withCredentials:Pt="same-origin",fetchOptions:f}=km(y),H=e||fetch;J=J?(J+"").toLowerCase():"text";let I=Vv([ge,z&&z.toAbortSignal()],k),X=null,$=I&&I.unsubscribe&&(()=>{I.unsubscribe()}),O;try{if(yt&&h&&v!=="get"&&v!=="head"&&(O=await P(di,B))!==0){let Dt=new t(q,{method:"POST",body:B,duplex:"half"}),xr;if(_.isFormData(B)&&(xr=Dt.headers.get("content-type"))&&di.setContentType(xr),Dt.body){let[ju,Ya]=um(O,os(cm(yt)));B=hm(Dt.body,pm,ju,Ya)}}_.isString(Pt)||(Pt=Pt?"include":"omit");let He=s&&"credentials"in t.prototype,At={...f,signal:I,method:v.toUpperCase(),headers:di.normalize().toJSON(),body:B,duplex:"half",credentials:He?Pt:void 0};X=s&&new t(q,At);let Le=await(s?H(X,f):H(q,At)),$_=p&&(J==="stream"||J==="response");if(p&&(Ue||$_&&$)){let Dt={};["status","statusText","headers"].forEach(z_=>{Dt[z_]=Le[z_]});let xr=_.toFiniteNumber(Le.headers.get("content-length")),[ju,Ya]=Ue&&um(xr,os(cm(Ue),!0))||[];Le=new r(hm(Le.body,pm,ju,()=>{Ya&&Ya(),$&&$()}),Dt)}J=J||"text";let _w=await w[_.findKey(w,J)||"text"](Le,y);return!$_&&$&&$(),await new Promise((Dt,xr)=>{Om(Dt,xr,{data:_w,headers:Je.from(Le.headers),status:Le.status,statusText:Le.statusText,config:y,request:X})})}catch(He){throw $&&$(),He&&He.name==="TypeError"&&/Load failed|fetch/i.test(He.message)?Object.assign(new T("Network Error",T.ERR_NETWORK,y,X),{cause:He.cause||He}):T.from(He,He&&He.code,y,X)}}},"factory"),Xv=new Map,Mm=n(i=>{let e=i?i.env:{},{fetch:t,Request:r,Response:a}=e,s=[r,a,t],o=s.length,l=o,c,h,p=Xv;for(;l--;)c=s[l],h=p.get(c),h===void 0&&p.set(c,h=l?new Map:Zv(e)),p=h;return h},"getFetch");Mm();var ic={http:_v,xhr:Gv,fetch:{get:Mm}};_.forEach(ic,(i,e)=>{if(i){try{Object.defineProperty(i,"name",{value:e})}catch{}Object.defineProperty(i,"adapterName",{value:e})}});var fm=n(i=>`- ${i}`,"renderReason"),Yv=n(i=>_.isFunction(i)||i===null||i===!1,"isResolvedHandle"),Lm={getAdapter:n((i,e)=>{i=_.isArray(i)?i:[i];let{length:t}=i,r,a,s={};for(let o=0;o<t;o++){r=i[o];let l;if(a=r,!Yv(r)&&(a=ic[(l=String(r)).toLowerCase()],a===void 0))throw new T(`Unknown adapter '${l}'`);if(a&&(_.isFunction(a)||(a=a.get(e))))break;s[l||"#"+o]=a}if(!a){let o=Object.entries(s).map(([c,h])=>`adapter ${c} `+(h===!1?"is not supported by the environment":"is not available in the build")),l=t?o.length>1?`since :
|
|
4
|
-
`+o.map(
|
|
5
|
-
`):" "+
|
|
6
|
-
`+s):r.stack=s}catch{}}throw r}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=tr(this.defaults,t);let{transitional:r,paramsSerializer:a,headers:s}=t;r!==void 0&&as.assertOptions(r,{silentJSONParsing:at.transitional(at.boolean),forcedJSONParsing:at.transitional(at.boolean),clarifyTimeoutError:at.transitional(at.boolean)},!1),a!=null&&(_.isFunction(a)?t.paramsSerializer={serialize:a}:as.assertOptions(a,{encode:at.function,serialize:at.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),as.assertOptions(t,{baseUrl:at.spelling("baseURL"),withXsrfToken:at.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=s&&_.merge(s.common,s[t.method]);s&&_.forEach(["delete","get","head","post","put","patch","common"],y=>{delete s[y]}),t.headers=Je.concat(o,s);let l=[],c=!0;this.interceptors.request.forEach(n(function(q){typeof q.runWhen=="function"&&q.runWhen(t)===!1||(c=c&&q.synchronous,l.unshift(q.fulfilled,q.rejected))},"unshiftRequestInterceptors"));let h=[];this.interceptors.response.forEach(n(function(q){h.push(q.fulfilled,q.rejected)},"pushResponseInterceptors"));let p,w=0,E;if(!c){let y=[gm.bind(this),void 0];for(y.unshift(...l),y.push(...h),E=y.length,p=Promise.resolve(t);w<E;)p=p.then(y[w++],y[w++]);return p}E=l.length;let P=t;for(;w<E;){let y=l[w++],q=l[w++];try{P=y(P)}catch(v){q.call(this,v);break}}try{p=gm.call(this,P)}catch(y){return Promise.reject(y)}for(w=0,E=h.length;w<E;)p=p.then(h[w++],h[w++]);return p}getUri(e){e=tr(this.defaults,e);let t=jm(e.baseURL,e.url,e.allowAbsoluteUrls);return Tm(t,e.params,e.paramsSerializer)}};_.forEach(["delete","get","head","options"],n(function(e){Hr.prototype[e]=function(t,r){return this.request(tr(r||{},{method:e,url:t,data:(r||{}).data}))}},"forEachMethodNoData"));_.forEach(["post","put","patch"],n(function(e){function t(r){return n(function(s,o,l){return this.request(tr(l||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))},"httpMethod")}n(t,"generateHTTPMethod"),Hr.prototype[e]=t(),Hr.prototype[e+"Form"]=t(!0)},"forEachMethodWithData"));var ss=Hr,nc=class i{static{n(this,"CancelToken")}constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(n(function(s){t=s},"promiseExecutor"));let r=this;this.promise.then(a=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](a);r._listeners=null}),this.promise.then=a=>{let s,o=new Promise(l=>{r.subscribe(l),s=l}).then(a);return o.cancel=n(function(){r.unsubscribe(s)},"reject"),o},e(n(function(s,o,l){r.reason||(r.reason=new qr(s,o,l),t(r.reason))},"cancel"))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=n(r=>{e.abort(r)},"abort");return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new i(n(function(a){e=a},"executor")),cancel:e}}},tS=nc;function rS(i){return n(function(t){return i.apply(null,t)},"wrap")}n(rS,"spread");function iS(i){return _.isObject(i)&&i.isAxiosError===!0}n(iS,"isAxiosError");var ac={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ac).forEach(([i,e])=>{ac[e]=i});var nS=ac;function Nm(i){let e=new ss(i),t=xm(ss.prototype.request,e);return _.extend(t,ss.prototype,e,{allOwnKeys:!0}),_.extend(t,e,null,{allOwnKeys:!0}),t.create=n(function(a){return Nm(tr(i,a))},"create"),t}n(Nm,"createInstance");var ae=Nm(cc);ae.Axios=ss;ae.CanceledError=qr;ae.CancelToken=tS;ae.isCancel=Bm;ae.VERSION=Fm;ae.toFormData=ds;ae.AxiosError=T;ae.Cancel=ae.CanceledError;ae.all=n(function(e){return Promise.all(e)},"all");ae.spread=rS;ae.isAxiosError=iS;ae.mergeConfig=tr;ae.AxiosHeaders=Je;ae.formToJSON=i=>Um(_.isHTMLForm(i)?new FormData(i):i);ae.getAdapter=Lm.getAdapter;ae.HttpStatusCode=nS;ae.default=ae;Qm.exports=ae});var g={};bw(g,{__addDisposableResource:()=>my,__assign:()=>ps,__asyncDelegator:()=>oy,__asyncGenerator:()=>sy,__asyncValues:()=>ly,__await:()=>Er,__awaiter:()=>ey,__classPrivateFieldGet:()=>hy,__classPrivateFieldIn:()=>_y,__classPrivateFieldSet:()=>py,__createBinding:()=>ms,__decorate:()=>$m,__disposeResources:()=>yy,__esDecorate:()=>Km,__exportStar:()=>ry,__extends:()=>Wm,__generator:()=>ty,__importDefault:()=>dy,__importStar:()=>cy,__makeTemplateObject:()=>uy,__metadata:()=>Ym,__param:()=>zm,__propKey:()=>Zm,__read:()=>pc,__rest:()=>Vm,__rewriteRelativeImportExtension:()=>fy,__runInitializers:()=>Jm,__setFunctionName:()=>Xm,__spread:()=>iy,__spreadArray:()=>ay,__spreadArrays:()=>ny,__values:()=>_s,default:()=>oS});function Wm(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");dc(i,e);function t(){this.constructor=i}n(t,"__"),i.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Vm(i,e){var t={};for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&e.indexOf(r)<0&&(t[r]=i[r]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(i);a<r.length;a++)e.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(i,r[a])&&(t[r[a]]=i[r[a]]);return t}function $m(i,e,t,r){var a=arguments.length,s=a<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,r);else for(var l=i.length-1;l>=0;l--)(o=i[l])&&(s=(a<3?o(s):a>3?o(e,t,s):o(e,t))||s);return a>3&&s&&Object.defineProperty(e,t,s),s}function zm(i,e){return function(t,r){e(t,r,i)}}function Km(i,e,t,r,a,s){function o(B){if(B!==void 0&&typeof B!="function")throw new TypeError("Function expected");return B}n(o,"accept");for(var l=r.kind,c=l==="getter"?"get":l==="setter"?"set":"value",h=!e&&i?r.static?i:i.prototype:null,p=e||(h?Object.getOwnPropertyDescriptor(h,r.name):{}),w,E=!1,P=t.length-1;P>=0;P--){var y={};for(var q in r)y[q]=q==="access"?{}:r[q];for(var q in r.access)y.access[q]=r.access[q];y.addInitializer=function(B){if(E)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(B||null))};var v=(0,t[P])(l==="accessor"?{get:p.get,set:p.set}:p[c],y);if(l==="accessor"){if(v===void 0)continue;if(v===null||typeof v!="object")throw new TypeError("Object expected");(w=o(v.get))&&(p.get=w),(w=o(v.set))&&(p.set=w),(w=o(v.init))&&a.unshift(w)}else(w=o(v))&&(l==="field"?a.unshift(w):p[c]=w)}h&&Object.defineProperty(h,r.name,p),E=!0}function Jm(i,e,t){for(var r=arguments.length>2,a=0;a<e.length;a++)t=r?e[a].call(i,t):e[a].call(i);return r?t:void 0}function Zm(i){return typeof i=="symbol"?i:"".concat(i)}function Xm(i,e,t){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(i,"name",{configurable:!0,value:t?"".concat(t," ",e):e})}function Ym(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)}function ey(i,e,t,r){function a(s){return s instanceof t?s:new t(function(o){o(s)})}return n(a,"adopt"),new(t||(t=Promise))(function(s,o){function l(p){try{h(r.next(p))}catch(w){o(w)}}n(l,"fulfilled");function c(p){try{h(r.throw(p))}catch(w){o(w)}}n(c,"rejected");function h(p){p.done?s(p.value):a(p.value).then(l,c)}n(h,"step"),h((r=r.apply(i,e||[])).next())})}function ty(i,e){var t={label:0,sent:n(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},r,a,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=l(0),o.throw=l(1),o.return=l(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(h){return function(p){return c([h,p])}}function c(h){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,h[0]&&(t=0)),t;)try{if(r=1,a&&(s=h[0]&2?a.return:h[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,h[1])).done)return s;switch(a=0,s&&(h=[h[0]&2,s.value]),h[0]){case 0:case 1:s=h;break;case 4:return t.label++,{value:h[1],done:!1};case 5:t.label++,a=h[1],h=[0];continue;case 7:h=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(h[0]===6||h[0]===2)){t=0;continue}if(h[0]===3&&(!s||h[1]>s[0]&&h[1]<s[3])){t.label=h[1];break}if(h[0]===6&&t.label<s[1]){t.label=s[1],s=h;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(h);break}s[2]&&t.ops.pop(),t.trys.pop();continue}h=e.call(i,t)}catch(p){h=[6,p],a=0}finally{r=s=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function ry(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&ms(e,i,t)}function _s(i){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&i[e],r=0;if(t)return t.call(i);if(i&&typeof i.length=="number")return{next:n(function(){return i&&r>=i.length&&(i=void 0),{value:i&&i[r++],done:!i}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function pc(i,e){var t=typeof Symbol=="function"&&i[Symbol.iterator];if(!t)return i;var r=t.call(i),a,s=[],o;try{for(;(e===void 0||e-- >0)&&!(a=r.next()).done;)s.push(a.value)}catch(l){o={error:l}}finally{try{a&&!a.done&&(t=r.return)&&t.call(r)}finally{if(o)throw o.error}}return s}function iy(){for(var i=[],e=0;e<arguments.length;e++)i=i.concat(pc(arguments[e]));return i}function ny(){for(var i=0,e=0,t=arguments.length;e<t;e++)i+=arguments[e].length;for(var r=Array(i),a=0,e=0;e<t;e++)for(var s=arguments[e],o=0,l=s.length;o<l;o++,a++)r[a]=s[o];return r}function ay(i,e,t){if(t||arguments.length===2)for(var r=0,a=e.length,s;r<a;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return i.concat(s||Array.prototype.slice.call(e))}function Er(i){return this instanceof Er?(this.v=i,this):new Er(i)}function sy(i,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(i,e||[]),a,s=[];return a=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),l("next"),l("throw"),l("return",o),a[Symbol.asyncIterator]=function(){return this},a;function o(P){return function(y){return Promise.resolve(y).then(P,w)}}function l(P,y){r[P]&&(a[P]=function(q){return new Promise(function(v,B){s.push([P,q,v,B])>1||c(P,q)})},y&&(a[P]=y(a[P])))}function c(P,y){try{h(r[P](y))}catch(q){E(s[0][3],q)}}function h(P){P.value instanceof Er?Promise.resolve(P.value.v).then(p,w):E(s[0][2],P)}function p(P){c("next",P)}function w(P){c("throw",P)}function E(P,y){P(y),s.shift(),s.length&&c(s[0][0],s[0][1])}}function oy(i){var e,t;return e={},r("next"),r("throw",function(a){throw a}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(a,s){e[a]=i[a]?function(o){return(t=!t)?{value:Er(i[a](o)),done:!1}:s?s(o):o}:s}}function ly(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=i[Symbol.asyncIterator],t;return e?e.call(i):(i=typeof _s=="function"?_s(i):i[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(s){t[s]=i[s]&&function(o){return new Promise(function(l,c){o=i[s](o),a(l,c,o.done,o.value)})}}function a(s,o,l,c){Promise.resolve(c).then(function(h){s({value:h,done:l})},o)}}function uy(i,e){return Object.defineProperty?Object.defineProperty(i,"raw",{value:e}):i.raw=e,i}function cy(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t=hc(i),r=0;r<t.length;r++)t[r]!=="default"&&ms(e,i,t[r]);return aS(e,i),e}function dy(i){return i&&i.__esModule?i:{default:i}}function hy(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)}function py(i,e,t,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!a:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(i,t):a?a.value=t:e.set(i,t),t}function _y(i,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof i=="function"?e===i:i.has(e)}function my(i,e,t){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var r,a;if(t){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=e[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=e[Symbol.dispose],t&&(a=r)}if(typeof r!="function")throw new TypeError("Object not disposable.");a&&(r=n(function(){try{a.call(this)}catch(s){return Promise.reject(s)}},"dispose")),i.stack.push({value:e,dispose:r,async:t})}else t&&i.stack.push({async:!0});return e}function yy(i){function e(s){i.error=i.hasError?new sS(s,i.error,"An error was suppressed during disposal."):s,i.hasError=!0}n(e,"fail");var t,r=0;function a(){for(;t=i.stack.pop();)try{if(!t.async&&r===1)return r=0,i.stack.push(t),Promise.resolve().then(a);if(t.dispose){var s=t.dispose.call(t.value);if(t.async)return r|=2,Promise.resolve(s).then(a,function(o){return e(o),a()})}else r|=1}catch(o){e(o)}if(r===1)return i.hasError?Promise.reject(i.error):Promise.resolve();if(i.hasError)throw i.error}return n(a,"next"),a()}function fy(i,e){return typeof i=="string"&&/^\.\.?\//.test(i)?i.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(t,r,a,s,o){return r?e?".jsx":".js":a&&(!s||!o)?t:a+s+"."+o.toLowerCase()+"js"}):i}var dc,ps,ms,aS,hc,sS,oS,b=gw(()=>{dc=n(function(i,e){return dc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])},dc(i,e)},"extendStatics");n(Wm,"__extends");ps=n(function(){return ps=Object.assign||n(function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},"__assign"),ps.apply(this,arguments)},"__assign");n(Vm,"__rest");n($m,"__decorate");n(zm,"__param");n(Km,"__esDecorate");n(Jm,"__runInitializers");n(Zm,"__propKey");n(Xm,"__setFunctionName");n(Ym,"__metadata");n(ey,"__awaiter");n(ty,"__generator");ms=Object.create?(function(i,e,t,r){r===void 0&&(r=t);var a=Object.getOwnPropertyDescriptor(e,t);(!a||("get"in a?!e.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:n(function(){return e[t]},"get")}),Object.defineProperty(i,r,a)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]});n(ry,"__exportStar");n(_s,"__values");n(pc,"__read");n(iy,"__spread");n(ny,"__spreadArrays");n(ay,"__spreadArray");n(Er,"__await");n(sy,"__asyncGenerator");n(oy,"__asyncDelegator");n(ly,"__asyncValues");n(uy,"__makeTemplateObject");aS=Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e},hc=n(function(i){return hc=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},hc(i)},"ownKeys");n(cy,"__importStar");n(dy,"__importDefault");n(hy,"__classPrivateFieldGet");n(py,"__classPrivateFieldSet");n(_y,"__classPrivateFieldIn");n(my,"__addDisposableResource");sS=typeof SuppressedError=="function"?SuppressedError:function(i,e,t){var r=new Error(t);return r.name="SuppressedError",r.error=i,r.suppressed=e,r};n(yy,"__disposeResources");n(fy,"__rewriteRelativeImportExtension");oS={__extends:Wm,__assign:ps,__rest:Vm,__decorate:$m,__param:zm,__esDecorate:Km,__runInitializers:Jm,__propKey:Zm,__setFunctionName:Xm,__metadata:Ym,__awaiter:ey,__generator:ty,__createBinding:ms,__exportStar:ry,__values:_s,__read:pc,__spread:iy,__spreadArrays:ny,__spreadArray:ay,__await:Er,__asyncGenerator:sy,__asyncDelegator:oy,__asyncValues:ly,__makeTemplateObject:uy,__importStar:cy,__importDefault:dy,__classPrivateFieldGet:hy,__classPrivateFieldSet:py,__classPrivateFieldIn:_y,__addDisposableResource:my,__disposeResources:yy,__rewriteRelativeImportExtension:fy}});var yi=u((bU,gy)=>{gy.exports.isNode=!1});var rr=u(Rt=>{"use strict";var Tt;Object.defineProperty(Rt,"__esModule",{value:!0});Rt.LogLevelToConsoleFunction=Rt.resolveLogLevel=Rt.LogLevel=void 0;var lS=yi(),qe;(function(i){i[i.CRITICAL=0]="CRITICAL",i[i.ERROR=1]="ERROR",i[i.WARNING=2]="WARNING",i[i.INFO=3]="INFO",i[i.DEBUG=4]="DEBUG",i[i.TRACE=7]="TRACE"})(qe||(qe={}));Rt.LogLevel=qe;function uS(i){if(typeof i=="number"){if(Object.prototype.hasOwnProperty.call(qe,i))return i;var e=Object.keys(qe).map(function(r){return parseInt(r,10)}).filter(function(r){return!isNaN(r)&&r<i});return e.length?Math.max.apply(Math,e):qe.WARNING}var t=i.replace(/\d+$/,"").toUpperCase();if(!Object.prototype.hasOwnProperty.call(qe,t))throw new Error("Unknown log level string: ".concat(i));return qe[t]}n(uS,"resolveLogLevel");Rt.resolveLogLevel=uS;var cS=lS.isNode?console.log.bind(console):console.debug.bind(console);Rt.LogLevelToConsoleFunction=(Tt={},Tt[qe.CRITICAL]=console.error.bind(console),Tt[qe.ERROR]=console.error.bind(console),Tt[qe.WARNING]=console.warn.bind(console),Tt[qe.INFO]=console.info.bind(console),Tt[qe.DEBUG]=cS.bind(console),Tt[qe.TRACE]=console.trace.bind(console),Tt)});var by=u(ys=>{"use strict";Object.defineProperty(ys,"__esModule",{value:!0});ys.Enumerable=void 0;function dS(i){return i===void 0&&(i=!0),function(e,t){Object.defineProperty(e,t,{get:n(function(){},"get"),set:n(function(r){Object.defineProperty(this,t,{value:r,writable:!0,enumerable:i})},"set"),enumerable:i})}}n(dS,"Enumerable");ys.Enumerable=dS});var wy=u(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});fs.flatten=void 0;var xy=(b(),x(g));function hS(i){var e;return(e=[]).concat.apply(e,xy.__spreadArray([],xy.__read(i),!1))}n(hS,"flatten");fs.flatten=hS});var vy=u(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.immutableSplice=void 0;var Pr=(b(),x(g));function pS(i,e,t){for(var r=[],a=3;a<arguments.length;a++)r[a-3]=arguments[a];return Pr.__spreadArray(Pr.__spreadArray(Pr.__spreadArray([],Pr.__read(i.slice(0,e)),!1),Pr.__read(r),!1),Pr.__read(i.slice(e+t)),!1)}n(pS,"immutableSplice");gs.immutableSplice=pS});var Sy=u(bs=>{"use strict";Object.defineProperty(bs,"__esModule",{value:!0});bs.partitionedFlatMap=void 0;var _c=(b(),x(g));function _S(i,e,t){var r,a,s,o={};try{for(var l=_c.__values(i),c=l.next();!c.done;c=l.next()){var h=c.value,p=e(h),w=t(h);Array.isArray(w)||(w=[w]),Object.prototype.hasOwnProperty.call(o,p)?(s=o[p]).push.apply(s,_c.__spreadArray([],_c.__read(w),!1)):o[p]=w}}catch(E){r={error:E}}finally{try{c&&!c.done&&(a=l.return)&&a.call(l)}finally{if(r)throw r.error}}return o}n(_S,"partitionedFlatMap");bs.partitionedFlatMap=_S});var Cy=u(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});Ar.resolveConfigValueSync=Ar.resolveConfigValue=void 0;var Hy=(b(),x(g));function mS(i){return Hy.__awaiter(this,void 0,void 0,function(){return Hy.__generator(this,function(e){switch(e.label){case 0:return typeof i!="function"?[3,2]:[4,i()];case 1:return[2,e.sent()];case 2:return[2,i]}})})}n(mS,"resolveConfigValue");Ar.resolveConfigValue=mS;function yS(i){return typeof i=="function"?i():i}n(yS,"resolveConfigValueSync");Ar.resolveConfigValueSync=yS});var qy=u(xs=>{"use strict";Object.defineProperty(xs,"__esModule",{value:!0});xs.deprecateClass=void 0;var mc=(b(),x(g));function fS(i,e){var t=!1;return(function(r){mc.__extends(a,r);function a(){for(var s=[],o=0;o<arguments.length;o++)s[o]=arguments[o];return t||(console.warn(e),t=!0),r.apply(this,mc.__spreadArray([],mc.__read(s),!1))||this}return n(a,"class_1"),a})(i)}n(fS,"deprecateClass");xs.deprecateClass=fS});var Py=u(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.match=ir.eq=void 0;var Ey=n(function(i){return{otherwise:n(function(){return i},"otherwise"),on:n(function(){return Ey(i)},"on")}},"matched"),yc=n(function(i){return{on:n(function(e,t){return e(i)?Ey(t(i)):yc(i)},"on"),otherwise:n(function(e){return e(i)},"otherwise")}},"match");ir.match=yc;var gS=n(function(i){return function(e){return i===e}},"eq");ir.eq=gS;yc.eq=ir.eq});var Dy=u(ws=>{"use strict";Object.defineProperty(ws,"__esModule",{value:!0});ws.fibWithLimit=void 0;var Ay=(b(),x(g));function bS(i){var e,t,r;return Ay.__generator(this,function(a){switch(a.label){case 0:e=0,t=1,a.label=1;case 1:return e<i?[4,e]:[3,3];case 2:return a.sent(),r=Ay.__read([t,e+t],2),e=r[0],t=r[1],[3,1];case 3:return[4,i];case 4:return a.sent(),[3,3];case 5:return[2]}})}n(bS,"fibWithLimit");ws.fibWithLimit=bS});var Ss=u(vs=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});vs.arrayToObject=void 0;var Iy=(b(),x(g));function xS(i,e){return Object.assign.apply(Object,Iy.__spreadArray([{}],Iy.__read(i.map(e)),!1))}n(xS,"arrayToObject");vs.arrayToObject=xS});var Ty=u(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.entriesToObject=void 0;var wS=(b(),x(g)),vS=Ss();function SS(i){return(0,vS.arrayToObject)(i,function(e){var t,r=wS.__read(e,2),a=r[0],s=r[1];return t={},t[a]=s,t})}n(SS,"entriesToObject");Hs.entriesToObject=SS});var Ry=u(Cs=>{"use strict";Object.defineProperty(Cs,"__esModule",{value:!0});Cs.forEachObjectEntry=void 0;var HS=(b(),x(g));function CS(i,e){Object.entries(i).forEach(function(t){var r=HS.__read(t,2),a=r[0],s=r[1];return e(s,a)})}n(CS,"forEachObjectEntry");Cs.forEachObjectEntry=CS});var Uy=u(qs=>{"use strict";Object.defineProperty(qs,"__esModule",{value:!0});qs.groupBy=void 0;var qS=(b(),x(g));function ES(i,e){var t,r,a;if(typeof e!="function"){var s=e;e=n((function(w){return w[s].toString()}),"keyFn")}var o={};try{for(var l=qS.__values(i),c=l.next();!c.done;c=l.next()){var h=c.value,p=e(h);((a=o[p])!==null&&a!==void 0?a:o[p]=[]).push(h)}}catch(w){t={error:w}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}return o}n(ES,"groupBy");qs.groupBy=ES});var By=u(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.indexBy=void 0;var PS=Ss();function AS(i,e){if(typeof e!="function"){var t=e;e=n((function(r){return r[t].toString()}),"keyFn")}return(0,PS.arrayToObject)(i,function(r){var a;return a={},a[e(r)]=r,a})}n(AS,"indexBy");Es.indexBy=AS});var Oy=u(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});Ps.mapObject=void 0;var fc=(b(),x(g));function DS(i,e){var t=Object.entries(i).map(function(r){var a,s=fc.__read(r,2),o=s[0],l=s[1];return a={},a[o]=e(l,o),a});return Object.assign.apply(Object,fc.__spreadArray([{}],fc.__read(t),!1))}n(DS,"mapObject");Ps.mapObject=DS});var gc=u(Ds=>{"use strict";Object.defineProperty(Ds,"__esModule",{value:!0});Ds.pick=void 0;var As=(b(),x(g));function IS(i,e){return Object.assign.apply(Object,As.__spreadArray([{}],As.__read(Object.entries(i).filter(function(t){var r=As.__read(t,1),a=r[0];return e.includes(a)}).map(function(t){var r,a=As.__read(t,2),s=a[0],o=a[1];return r={},r[s]=o,r})),!1))}n(IS,"pick");Ds.pick=IS});var jy=u(Is=>{"use strict";Object.defineProperty(Is,"__esModule",{value:!0});Is.omit=void 0;var TS=gc();function RS(i,e){return(0,TS.pick)(i,Object.keys(i).filter(function(t){return!e.includes(t)}))}n(RS,"omit");Is.omit=RS});var ky=u(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.mapOptional=Ut.mapNullable=Ut.isNullish=void 0;function bc(i){return i==null}n(bc,"isNullish");Ut.isNullish=bc;function US(i,e){return bc(i)?null:e(i)}n(US,"mapNullable");Ut.mapNullable=US;function BS(i,e){return bc(i)?void 0:e(i)}n(BS,"mapOptional");Ut.mapOptional=BS});var Ly=u(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.delay=void 0;var My=(b(),x(g));function OS(i){return My.__awaiter(this,void 0,void 0,function(){return My.__generator(this,function(e){switch(e.label){case 0:return[4,new Promise(function(t){return setTimeout(t,i)})];case 1:return e.sent(),[2]}})})}n(OS,"delay");Ts.delay=OS});var Fy=u(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.promiseWithResolvers=void 0;function jS(){var i,e,t=new Promise(function(r,a){i=r,e=a});return{promise:t,resolve:i,reject:e}}n(jS,"promiseWithResolvers");Rs.promiseWithResolvers=jS});var Ny=u(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});Us.padLeft=void 0;function kS(i,e,t){if(typeof i=="number"&&(i=i.toString()),e=e-i.length,e<=0)return i;t===void 0&&(t=" ");var r="";do(e&1)===1&&(r+=t),e>>=1,e&&(t+=t);while(e);return r+i}n(kS,"padLeft");Us.padLeft=kS});var Qy=u(Bs=>{"use strict";Object.defineProperty(Bs,"__esModule",{value:!0});Bs.splitWithLimit=void 0;var xc=(b(),x(g));function MS(i,e,t){var r=i.split(e);return r.length<=t?r:xc.__spreadArray(xc.__spreadArray([],xc.__read(r.slice(0,t-1)),!1),[r.slice(t-1).join(e)],!1)}n(MS,"splitWithLimit");Bs.splitWithLimit=MS});var Gy=u(Dr=>{"use strict";Object.defineProperty(Dr,"__esModule",{value:!0});Dr.utf8Substring=Dr.utf8Length=void 0;var Os=(b(),x(g));function LS(i){return Os.__spreadArray([],Os.__read(i),!1).length}n(LS,"utf8Length");Dr.utf8Length=LS;function FS(i,e,t){return Os.__spreadArray([],Os.__read(i),!1).slice(e,t).join("")}n(FS,"utf8Substring");Dr.utf8Substring=FS});var C=u(A=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0});A.utf8Substring=A.utf8Length=A.splitWithLimit=A.padLeft=A.promiseWithResolvers=A.delay=A.mapOptional=A.mapNullable=A.isNullish=A.pick=A.omit=A.mapObject=A.indexBy=A.groupBy=A.forEachObjectEntry=A.entriesToObject=A.arrayToObject=A.fibWithLimit=A.eq=A.match=A.deprecateClass=A.resolveConfigValueSync=A.resolveConfigValue=A.partitionedFlatMap=A.immutableSplice=A.flatten=A.Enumerable=void 0;var NS=by();Object.defineProperty(A,"Enumerable",{enumerable:!0,get:n(function(){return NS.Enumerable},"get")});var QS=wy();Object.defineProperty(A,"flatten",{enumerable:!0,get:n(function(){return QS.flatten},"get")});var GS=vy();Object.defineProperty(A,"immutableSplice",{enumerable:!0,get:n(function(){return GS.immutableSplice},"get")});var WS=Sy();Object.defineProperty(A,"partitionedFlatMap",{enumerable:!0,get:n(function(){return WS.partitionedFlatMap},"get")});var Wy=Cy();Object.defineProperty(A,"resolveConfigValue",{enumerable:!0,get:n(function(){return Wy.resolveConfigValue},"get")});Object.defineProperty(A,"resolveConfigValueSync",{enumerable:!0,get:n(function(){return Wy.resolveConfigValueSync},"get")});var VS=qy();Object.defineProperty(A,"deprecateClass",{enumerable:!0,get:n(function(){return VS.deprecateClass},"get")});var Vy=Py();Object.defineProperty(A,"match",{enumerable:!0,get:n(function(){return Vy.match},"get")});Object.defineProperty(A,"eq",{enumerable:!0,get:n(function(){return Vy.eq},"get")});var $S=Dy();Object.defineProperty(A,"fibWithLimit",{enumerable:!0,get:n(function(){return $S.fibWithLimit},"get")});var zS=Ss();Object.defineProperty(A,"arrayToObject",{enumerable:!0,get:n(function(){return zS.arrayToObject},"get")});var KS=Ty();Object.defineProperty(A,"entriesToObject",{enumerable:!0,get:n(function(){return KS.entriesToObject},"get")});var JS=Ry();Object.defineProperty(A,"forEachObjectEntry",{enumerable:!0,get:n(function(){return JS.forEachObjectEntry},"get")});var ZS=Uy();Object.defineProperty(A,"groupBy",{enumerable:!0,get:n(function(){return ZS.groupBy},"get")});var XS=By();Object.defineProperty(A,"indexBy",{enumerable:!0,get:n(function(){return XS.indexBy},"get")});var YS=Oy();Object.defineProperty(A,"mapObject",{enumerable:!0,get:n(function(){return YS.mapObject},"get")});var e0=jy();Object.defineProperty(A,"omit",{enumerable:!0,get:n(function(){return e0.omit},"get")});var t0=gc();Object.defineProperty(A,"pick",{enumerable:!0,get:n(function(){return t0.pick},"get")});var wc=ky();Object.defineProperty(A,"isNullish",{enumerable:!0,get:n(function(){return wc.isNullish},"get")});Object.defineProperty(A,"mapNullable",{enumerable:!0,get:n(function(){return wc.mapNullable},"get")});Object.defineProperty(A,"mapOptional",{enumerable:!0,get:n(function(){return wc.mapOptional},"get")});var r0=Ly();Object.defineProperty(A,"delay",{enumerable:!0,get:n(function(){return r0.delay},"get")});var i0=Fy();Object.defineProperty(A,"promiseWithResolvers",{enumerable:!0,get:n(function(){return i0.promiseWithResolvers},"get")});var n0=Ny();Object.defineProperty(A,"padLeft",{enumerable:!0,get:n(function(){return n0.padLeft},"get")});var a0=Qy();Object.defineProperty(A,"splitWithLimit",{enumerable:!0,get:n(function(){return a0.splitWithLimit},"get")});var $y=Gy();Object.defineProperty(A,"utf8Length",{enumerable:!0,get:n(function(){return $y.utf8Length},"get")});Object.defineProperty(A,"utf8Substring",{enumerable:!0,get:n(function(){return $y.utf8Substring},"get")})});var Cc=u(ks=>{"use strict";var vc,Sc;Object.defineProperty(ks,"__esModule",{value:!0});ks.getMinLogLevelFromEnv=void 0;var s0=rr(),js=typeof process>"u"?[]:(Sc=(vc=process.env.LOGGING)===null||vc===void 0?void 0:vc.split(";").map(function(i){var e=i.split("=",2),t=e[0],r=e[1];return r?[t==="default"?void 0:t.split(":"),(0,s0.resolveLogLevel)(r)]:null}).filter(function(i){return!!i}).sort(function(i,e){var t,r,a=i[0],s=e[0];return((t=s?.length)!==null&&t!==void 0?t:0)-((r=a?.length)!==null&&r!==void 0?r:0)}))!==null&&Sc!==void 0?Sc:[],Hc=js.findIndex(function(i){var e=i[0];return!e}),zy=void 0;Hc!==-1&&(zy=js[Hc][1],js.splice(Hc));function o0(i,e){return e.length<=i.length&&e.every(function(t,r){return t===i[r]})}n(o0,"isPrefix");function l0(i){for(var e=i.split(":"),t=0,r=js;t<r.length;t++){var a=r[t],s=a[0],o=a[1];if(o0(e,s))return o}return zy}n(l0,"getMinLogLevelFromEnv");ks.getMinLogLevelFromEnv=l0});var qc=u(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});Ms.BaseLogger=void 0;var u0=C(),c0=yi(),d0=Cc(),Bt=rr(),h0=(function(){function i(e){var t=e.name,r=e.minLevel,a=e.emoji,s=a===void 0?!1:a,o=e.colors,l=e.timestamps,c=l===void 0?c0.isNode:l,h,p;this._name=t,this._minLevel=(p=(h=(0,u0.mapOptional)(r,function(w){return(0,Bt.resolveLogLevel)(w)}))!==null&&h!==void 0?h:(0,d0.getMinLogLevelFromEnv)(t))!==null&&p!==void 0?p:Bt.LogLevel.WARNING,this._emoji=s,this._colors=o,this._timestamps=c}return n(i,"BaseLogger"),i.prototype.crit=function(e){this.log(Bt.LogLevel.CRITICAL,e)},i.prototype.error=function(e){this.log(Bt.LogLevel.ERROR,e)},i.prototype.warn=function(e){this.log(Bt.LogLevel.WARNING,e)},i.prototype.info=function(e){this.log(Bt.LogLevel.INFO,e)},i.prototype.debug=function(e){this.log(Bt.LogLevel.DEBUG,e)},i.prototype.trace=function(e){this.log(Bt.LogLevel.TRACE,e)},i})();Ms.BaseLogger=h0});var Ky=u(Ls=>{"use strict";Object.defineProperty(Ls,"__esModule",{value:!0});Ls.BrowserLogger=void 0;var p0=(b(),x(g)),_0=rr(),m0=qc(),y0=(function(i){p0.__extends(e,i);function e(){return i!==null&&i.apply(this,arguments)||this}return n(e,"BrowserLogger"),e.prototype.log=function(t,r){if(!(t>this._minLevel)){var a=_0.LogLevelToConsoleFunction[t],s="[".concat(this._name,"] ").concat(r);this._timestamps&&(s="[".concat(new Date().toISOString(),"] ").concat(r)),a(s)}},e})(m0.BaseLogger);Ls.BrowserLogger=y0});var Jy=u(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});Fs.CustomLoggerWrapper=void 0;var f0=C(),g0=Cc(),Be=rr(),b0=(function(){function i(e){var t=e.name,r=e.minLevel,a=e.custom,s;this._minLevel=(s=(0,f0.mapOptional)(r,function(o){return(0,Be.resolveLogLevel)(o)}))!==null&&s!==void 0?s:(0,g0.getMinLogLevelFromEnv)(t),this._override=typeof a=="function"?{log:a}:a}return n(i,"CustomLoggerWrapper"),i.prototype.log=function(e,t){this._shouldLog(e)&&this._override.log(e,t)},i.prototype.crit=function(e){this._override.crit?this._shouldLog(Be.LogLevel.CRITICAL)&&this._override.crit(e):this.log(Be.LogLevel.CRITICAL,e)},i.prototype.error=function(e){this._override.error?this._shouldLog(Be.LogLevel.ERROR)&&this._override.error(e):this.log(Be.LogLevel.ERROR,e)},i.prototype.warn=function(e){this._override.warn?this._shouldLog(Be.LogLevel.WARNING)&&this._override.warn(e):this.log(Be.LogLevel.WARNING,e)},i.prototype.info=function(e){this._override.info?this._shouldLog(Be.LogLevel.INFO)&&this._override.info(e):this.log(Be.LogLevel.INFO,e)},i.prototype.debug=function(e){this._override.debug?this._shouldLog(Be.LogLevel.DEBUG)&&this._override.debug(e):this.log(Be.LogLevel.DEBUG,e)},i.prototype.trace=function(e){this._override.trace?this._shouldLog(Be.LogLevel.TRACE)&&this._override.trace(e):this.log(Be.LogLevel.TRACE,e)},i.prototype._shouldLog=function(e){return this._minLevel===void 0||this._minLevel>=e},i})();Fs.CustomLoggerWrapper=b0});var Zy=u(Ee=>{"use strict";var Ot,jt,kt;Object.defineProperty(Ee,"__esModule",{value:!0});Ee.NodeLogger=Ee.LogLevelToBackgroundColor=Ee.LogLevelToColor=Ee.LogLevelToEmoji=void 0;var x0=(b(),x(g)),ne=rr(),w0=qc();Ee.LogLevelToEmoji=(Ot={},Ot[ne.LogLevel.CRITICAL]="\u{1F6D1}",Ot[ne.LogLevel.ERROR]="\u274C",Ot[ne.LogLevel.WARNING]="\u26A0\uFE0F ",Ot[ne.LogLevel.INFO]="\u2139\uFE0F ",Ot[ne.LogLevel.DEBUG]="\u{1F41E}",Ot[ne.LogLevel.TRACE]="\u{1F43E}",Ot);var v0={black:30,red:31,green:32,yellow:33,blue:34,magenta:35,cyan:36,white:37,blackBright:90,redBright:91,greenBright:92,yellowBright:93,blueBright:94,magentaBright:95,cyanBright:96,whiteBright:97},S0={bgBlack:40,bgRed:41,bgGreen:42,bgYellow:43,bgBlue:44,bgMagenta:45,bgCyan:46,bgWhite:47,bgBlackBright:100,bgRedBright:101,bgGreenBright:102,bgYellowBright:103,bgBlueBright:104,bgMagentaBright:105,bgCyanBright:106,bgWhiteBright:107};function Ns(i,e,t){return function(r){return"\x1B[".concat(i,"m").concat(t?t(r):r,"\x1B[").concat(e,"m")}}n(Ns,"createGenericWrapper");function st(i){return Ns(v0[i],39)}n(st,"createColorWrapper");function fi(i,e){return Ns(S0[i],49,e)}n(fi,"createBgWrapper");Ee.LogLevelToColor=(jt={},jt[ne.LogLevel.CRITICAL]=st("red"),jt[ne.LogLevel.ERROR]=st("redBright"),jt[ne.LogLevel.WARNING]=st("yellow"),jt[ne.LogLevel.INFO]=st("blue"),jt[ne.LogLevel.DEBUG]=st("magenta"),jt[ne.LogLevel.TRACE]=Ns(0,0),jt);Ee.LogLevelToBackgroundColor=(kt={},kt[ne.LogLevel.CRITICAL]=fi("bgRed",st("white")),kt[ne.LogLevel.ERROR]=fi("bgRedBright",st("white")),kt[ne.LogLevel.WARNING]=fi("bgYellow",st("black")),kt[ne.LogLevel.INFO]=fi("bgBlue",st("white")),kt[ne.LogLevel.DEBUG]=fi("bgMagenta",st("black")),kt[ne.LogLevel.TRACE]=Ns(7,27),kt);var H0=(function(i){x0.__extends(e,i);function e(){return i!==null&&i.apply(this,arguments)||this}return n(e,"NodeLogger"),e.prototype.log=function(t,r){var a,s,o;if(!(t>this._minLevel)){var l=ne.LogLevelToConsoleFunction[t],c="";if(this._timestamps&&(c+="[".concat(new Date().toISOString(),"] ")),this._emoji){var h=Ee.LogLevelToEmoji[t];c+="".concat(h," ")}var p=(o=(a=this._colors)!==null&&a!==void 0?a:(s=process.stdout)===null||s===void 0?void 0:s.isTTY)!==null&&o!==void 0?o:!0;p?c+="".concat(Ee.LogLevelToBackgroundColor[t](this._name)," ").concat(Ee.LogLevelToBackgroundColor[t](ne.LogLevel[t])," ").concat(Ee.LogLevelToColor[t](r)):c+="[".concat(this._name,":").concat(ne.LogLevel[t].toLowerCase(),"] ").concat(r),l(c)}},e})(w0.BaseLogger);Ee.NodeLogger=H0});var Xy=u(Qs=>{"use strict";Object.defineProperty(Qs,"__esModule",{value:!0});Qs.createLogger=void 0;var C0=yi(),q0=Ky(),E0=Jy(),P0=Zy();function A0(i){return i.custom?new E0.CustomLoggerWrapper(i):C0.isNode?new P0.NodeLogger(i):new q0.BrowserLogger(i)}n(A0,"createLogger");Qs.createLogger=A0});var gi=u(Ir=>{"use strict";Object.defineProperty(Ir,"__esModule",{value:!0});Ir.LogLevel=Ir.createLogger=void 0;var D0=Xy();Object.defineProperty(Ir,"createLogger",{enumerable:!0,get:n(function(){return D0.createLogger},"get")});var I0=rr();Object.defineProperty(Ir,"LogLevel",{enumerable:!0,get:n(function(){return I0.LogLevel},"get")})});var Ws=u(Gs=>{"use strict";Object.defineProperty(Gs,"__esModule",{value:!0});Gs.CustomError=void 0;var Ec=class extends Error{static{n(this,"CustomError")}constructor(...e){var t;super(...e),Object.setPrototypeOf(this,new.target.prototype),(t=Error.captureStackTrace)===null||t===void 0||t.call(Error,this,new.target.constructor)}get name(){return this.constructor.name}};Gs.CustomError=Ec});var $s=u(Vs=>{"use strict";Object.defineProperty(Vs,"__esModule",{value:!0});Vs.RateLimiterDestroyedError=void 0;var T0=Ws(),Pc=class extends T0.CustomError{static{n(this,"RateLimiterDestroyedError")}};Vs.RateLimiterDestroyedError=Pc});var bi=u(zs=>{"use strict";Object.defineProperty(zs,"__esModule",{value:!0});zs.RateLimitReachedError=void 0;var R0=Ws(),Ac=class extends R0.CustomError{static{n(this,"RateLimitReachedError")}};zs.RateLimitReachedError=Ac});var Ic=u(Ks=>{"use strict";Object.defineProperty(Ks,"__esModule",{value:!0});Ks.RetryAfterError=void 0;var U0=Ws(),Dc=class extends U0.CustomError{static{n(this,"RetryAfterError")}constructor(e){super(`Need to retry after ${e} ms`),this._retryAt=Date.now()+e}get retryAt(){return this._retryAt}};Ks.RetryAfterError=Dc});var Yy=u(Js=>{"use strict";Object.defineProperty(Js,"__esModule",{value:!0});Js.NullRateLimiter=void 0;var Tc=class{static{n(this,"NullRateLimiter")}constructor(e){this._callback=e}async request(e){return await this._callback(e)}clear(){}pause(){}resume(){}};Js.NullRateLimiter=Tc});var Uc=u(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});Zs.ResponseBasedRateLimiter=void 0;var B0=gi(),O0=C(),j0=bi(),ef=Ic(),Rc=class{static{n(this,"ResponseBasedRateLimiter")}constructor({logger:e}){this._queue=[],this._batchRunning=!1,this._paused=!1,this._logger=(0,B0.createLogger)({name:"rate-limiter",emoji:!0,...e})}async request(e,t){return this._logger.trace("request start"),await new Promise((r,a)=>{var s;let o={req:e,resolve:r,reject:a,limitReachedBehavior:(s=t?.limitReachedBehavior)!==null&&s!==void 0?s:"enqueue"};this._batchRunning||this._nextBatchTimer||this._paused?(this._logger.trace(`request queued batchRunning:${this._batchRunning.toString()} hasNextBatchTimer:${(!!this._nextBatchTimer).toString()} paused:${this._paused.toString()}`),this._queue.push(o)):this._runRequestBatch([o])})}clear(){this._queue=[]}pause(){this._paused=!0}resume(){this._paused=!1,this._runNextBatch()}get stats(){var e,t,r,a,s;return{lastKnownLimit:(t=(e=this._parameters)===null||e===void 0?void 0:e.limit)!==null&&t!==void 0?t:null,lastKnownRemainingRequests:(a=(r=this._parameters)===null||r===void 0?void 0:r.remaining)!==null&&a!==void 0?a:null,lastKnownResetDate:(0,O0.mapNullable)((s=this._parameters)===null||s===void 0?void 0:s.resetsAt,o=>new Date(o))}}async _runRequestBatch(e){this._logger.trace(`runRequestBatch start specs:${e.length}`),this._batchRunning=!0,this._parameters&&this._logger.debug(`Remaining requests: ${this._parameters.remaining}`),this._logger.debug(`Doing ${e.length} requests, new queue length is ${this._queue.length}`);let t=e.map(async o=>{let{req:l,resolve:c,reject:h}=o;try{let p=await this.doRequest(l),w=this.needsToRetryAfter(p);if(w!==null)throw this._queue.unshift(o),this._logger.info(`Retrying after ${w} ms`),new ef.RetryAfterError(w);let E=this.getParametersFromResponse(p);return c(p),E}catch(p){if(p instanceof ef.RetryAfterError)throw p;h(p);return}}),r=await Promise.allSettled(t),a=r.filter(o=>o.status==="rejected"),s=Date.now();if(a.length){this._logger.trace("runRequestBatch some rejected");let l=Math.max(s,...a.map(c=>c.reason.retryAt))-s;this._logger.warn(`Waiting for ${l} ms because the rate limit was exceeded`),this._nextBatchTimer=setTimeout(()=>{this._parameters=void 0,this._runNextBatch()},l)}else{this._logger.trace("runRequestBatch none rejected");let o=r.filter(l=>l.status==="fulfilled"&&l.value!==void 0).map(l=>l.value).reduce((l,c)=>l?c.remaining<l.remaining?c:l:c,void 0);if(this._batchRunning=!1,o)if(this._parameters=o,o.resetsAt<s||o.remaining>0)this._logger.trace("runRequestBatch canRunMore"),this._runNextBatch();else{let l=o.resetsAt-s;this._logger.trace(`runRequestBatch delay:${l}`),this._logger.warn(`Waiting for ${l} ms because the rate limit was reached`),this._queue=this._queue.filter(c=>{switch(c.limitReachedBehavior){case"enqueue":return!0;case"null":return c.resolve(null),!1;case"throw":return c.reject(new j0.RateLimitReachedError("Request removed from queue because the rate limit was reached")),!1;default:throw new Error("this should never happen")}}),this._nextBatchTimer=setTimeout(()=>{this._parameters=void 0,this._runNextBatch()},l)}}this._logger.trace("runRequestBatch end")}_runNextBatch(){if(this._paused)return;this._logger.trace("runNextBatch start"),this._nextBatchTimer&&(clearTimeout(this._nextBatchTimer),this._nextBatchTimer=void 0);let e=this._parameters?Math.min(this._parameters.remaining,this._parameters.limit/10):1,t=this._queue.splice(0,e);t.length&&this._runRequestBatch(t),this._logger.trace("runNextBatch end")}};Zs.ResponseBasedRateLimiter=Rc});var tf=u(Xs=>{"use strict";Object.defineProperty(Xs,"__esModule",{value:!0});Xs.PartitionedRateLimiter=void 0;var k0=Uc(),Bc=class{static{n(this,"PartitionedRateLimiter")}constructor(e){this._children=new Map,this._paused=!1,this._partitionKeyCallback=e.getPartitionKey,this._createChildCallback=e.createChild}async request(e,t){let r=this._partitionKeyCallback(e);return await this._getChild(r).request(e,t)}clear(){for(let e of this._children.values())e.clear()}pause(){this._paused=!0;for(let e of this._children.values())e.pause()}resume(){this._paused=!1;for(let e of this._children.values())e.resume()}getChildStats(e){if(!this._children.has(e))return null;let t=this._children.get(e);return t instanceof k0.ResponseBasedRateLimiter?t.stats:null}_getChild(e){if(this._children.has(e))return this._children.get(e);let t=this._createChildCallback(e);return this._paused&&t.pause(),this._children.set(e,t),t}};Xs.PartitionedRateLimiter=Bc});var nf=u(Ys=>{"use strict";Object.defineProperty(Ys,"__esModule",{value:!0});Ys.PartitionedTimeBasedRateLimiter=void 0;var M0=gi(),L0=bi(),rf=$s(),Oc=class{static{n(this,"PartitionedTimeBasedRateLimiter")}constructor({logger:e,bucketSize:t,timeFrame:r,doRequest:a,getPartitionKey:s}){this._partitionedQueue=new Map,this._usedFromBucket=new Map,this._counterTimers=new Set,this._paused=!1,this._destroyed=!1,this._logger=(0,M0.createLogger)({name:"rate-limiter",emoji:!0,...e}),this._bucketSize=t,this._timeFrame=r,this._callback=a,this._partitionKeyCallback=s}async request(e,t){return await new Promise((r,a)=>{var s,o;if(this._destroyed){a(new rf.RateLimiterDestroyedError("Rate limiter was destroyed"));return}let l={req:e,resolve:r,reject:a,limitReachedBehavior:(s=t?.limitReachedBehavior)!==null&&s!==void 0?s:"enqueue"},c=this._partitionKeyCallback(e),h=(o=this._usedFromBucket.get(c))!==null&&o!==void 0?o:0;if(h>=this._bucketSize||this._paused)switch(l.limitReachedBehavior){case"enqueue":{let p=this._getPartitionedQueue(c);p.push(l),h+p.length>=this._bucketSize?this._logger.warn(`Rate limit of ${this._bucketSize} for ${c?`partition ${c}`:"default partition"} was reached, waiting for ${this._paused?"the limiter to be unpaused":"a free bucket entry"}; queue size is ${p.length}`):this._logger.info(`Enqueueing request for ${c?`partition ${c}`:"default partition"} because the rate limiter is paused; queue size is ${p.length}`);break}case"null":{l.resolve(null),this._paused?this._logger.info(`Returning null for request for ${c?`partition ${c}`:"default partition"} because the rate limiter is paused`):this._logger.warn(`Rate limit of ${this._bucketSize} for ${c?`partition ${c}`:"default partition"} was reached, dropping request and returning null`);break}case"throw":{l.reject(new L0.RateLimitReachedError(`Request dropped because ${this._paused?"the rate limiter is paused":`the rate limit for ${c?`partition ${c}`:"default partition"} was reached`}`));break}default:throw new Error("this should never happen")}else this._runRequest(l,c)})}clear(){this._partitionedQueue.clear()}pause(){this._paused=!0}resume(){this._paused=!1;for(let e of this._partitionedQueue.keys())this._runNextRequest(e)}destroy(){this._paused=!1,this._destroyed=!0,this._counterTimers.forEach(e=>{clearTimeout(e)});for(let e of this._partitionedQueue.values())for(let t of e)t.reject(new rf.RateLimiterDestroyedError("Rate limiter was destroyed"));this._partitionedQueue.clear()}_getPartitionedQueue(e){if(this._partitionedQueue.has(e))return this._partitionedQueue.get(e);let t=[];return this._partitionedQueue.set(e,t),t}async _runRequest(e,t){var r;let a=this._getPartitionedQueue(t);this._logger.debug(`doing a request for ${t?`partition ${t}`:"default partition"}, new queue length is ${a.length}`),this._usedFromBucket.set(t,((r=this._usedFromBucket.get(t))!==null&&r!==void 0?r:0)+1);let{req:s,resolve:o,reject:l}=e;try{o(await this._callback(s))}catch(c){l(c)}finally{let c=setTimeout(()=>{this._counterTimers.delete(c);let h=this._usedFromBucket.get(t)-1;this._usedFromBucket.set(t,h),a.length&&h<this._bucketSize&&this._runNextRequest(t)},this._timeFrame);this._counterTimers.add(c)}}_runNextRequest(e){if(this._paused)return;let r=this._getPartitionedQueue(e).shift();r&&this._runRequest(r,e)}};Ys.PartitionedTimeBasedRateLimiter=Oc});var kc=u(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.TimeBasedRateLimiter=void 0;var F0=gi(),N0=bi(),af=$s(),jc=class{static{n(this,"TimeBasedRateLimiter")}constructor({logger:e,bucketSize:t,timeFrame:r,doRequest:a}){this._queue=[],this._usedFromBucket=0,this._counterTimers=new Set,this._paused=!1,this._destroyed=!1,this._logger=(0,F0.createLogger)({name:"rate-limiter",emoji:!0,...e}),this._bucketSize=t,this._timeFrame=r,this._callback=a}async request(e,t){return await new Promise((r,a)=>{var s;if(this._destroyed){a(new af.RateLimiterDestroyedError("Rate limiter was destroyed"));return}let o={req:e,resolve:r,reject:a,limitReachedBehavior:(s=t?.limitReachedBehavior)!==null&&s!==void 0?s:"enqueue"};if(this._usedFromBucket>=this._bucketSize||this._paused)switch(o.limitReachedBehavior){case"enqueue":{this._queue.push(o),this._usedFromBucket+this._queue.length>=this._bucketSize?this._logger.warn(`Rate limit of ${this._bucketSize} was reached, waiting for ${this._paused?"the limiter to be unpaused":"a free bucket entry"}; queue size is ${this._queue.length}`):this._logger.info(`Enqueueing request because the rate limiter is paused; queue size is ${this._queue.length}`);break}case"null":{o.resolve(null),this._logger.warn(`Rate limit of ${this._bucketSize} was reached, dropping request and returning null`),this._paused?this._logger.info("Returning null for request because the rate limiter is paused"):this._logger.warn(`Rate limit of ${this._bucketSize} was reached, dropping request and returning null`);break}case"throw":{o.reject(new N0.RateLimitReachedError(`Request dropped because ${this._paused?"the rate limiter is paused":"the rate limit was reached"}`));break}default:throw new Error("this should never happen")}else this._runRequest(o)})}clear(){this._queue=[]}pause(){this._paused=!0}resume(){this._paused=!1,this._runNextRequest()}destroy(){this._paused=!1,this._destroyed=!0,this._counterTimers.forEach(e=>{clearTimeout(e)});for(let e of this._queue)e.reject(new af.RateLimiterDestroyedError("Rate limiter was destroyed"));this._queue=[]}async _runRequest(e){this._logger.debug(`doing a request, new queue length is ${this._queue.length}`),this._usedFromBucket+=1;let{req:t,resolve:r,reject:a}=e;try{r(await this._callback(t))}catch(s){a(s)}finally{let s=setTimeout(()=>{this._counterTimers.delete(s),this._usedFromBucket-=1,this._queue.length&&this._usedFromBucket<this._bucketSize&&this._runNextRequest()},this._timeFrame);this._counterTimers.add(s)}}_runNextRequest(){if(this._paused)return;let e=this._queue.shift();e&&this._runRequest(e)}};eo.TimeBasedRateLimiter=jc});var sf=u(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.TimedPassthruRateLimiter=void 0;var Q0=kc(),Mc=class extends Q0.TimeBasedRateLimiter{static{n(this,"TimedPassthruRateLimiter")}constructor(e,t){super({...t,async doRequest(r,a){return await e.request(r,a)}})}};to.TimedPassthruRateLimiter=Mc});var ro=u(se=>{"use strict";Object.defineProperty(se,"__esModule",{value:!0});se.TimedPassthruRateLimiter=se.TimeBasedRateLimiter=se.ResponseBasedRateLimiter=se.PartitionedTimeBasedRateLimiter=se.PartitionedRateLimiter=se.NullRateLimiter=se.RetryAfterError=se.RateLimitReachedError=se.RateLimiterDestroyedError=void 0;var G0=$s();Object.defineProperty(se,"RateLimiterDestroyedError",{enumerable:!0,get:n(function(){return G0.RateLimiterDestroyedError},"get")});var W0=bi();Object.defineProperty(se,"RateLimitReachedError",{enumerable:!0,get:n(function(){return W0.RateLimitReachedError},"get")});var V0=Ic();Object.defineProperty(se,"RetryAfterError",{enumerable:!0,get:n(function(){return V0.RetryAfterError},"get")});var $0=Yy();Object.defineProperty(se,"NullRateLimiter",{enumerable:!0,get:n(function(){return $0.NullRateLimiter},"get")});var z0=tf();Object.defineProperty(se,"PartitionedRateLimiter",{enumerable:!0,get:n(function(){return z0.PartitionedRateLimiter},"get")});var K0=nf();Object.defineProperty(se,"PartitionedTimeBasedRateLimiter",{enumerable:!0,get:n(function(){return K0.PartitionedTimeBasedRateLimiter},"get")});var J0=Uc();Object.defineProperty(se,"ResponseBasedRateLimiter",{enumerable:!0,get:n(function(){return J0.ResponseBasedRateLimiter},"get")});var Z0=kc();Object.defineProperty(se,"TimeBasedRateLimiter",{enumerable:!0,get:n(function(){return Z0.TimeBasedRateLimiter},"get")});var X0=sf();Object.defineProperty(se,"TimedPassthruRateLimiter",{enumerable:!0,get:n(function(){return X0.TimedPassthruRateLimiter},"get")})});var uf=u((ft,lf)=>{var of=typeof self<"u"?self:ft,io=(function(){function i(){this.fetch=!1,this.DOMException=of.DOMException}return n(i,"F"),i.prototype=of,new i})();(function(i){var e=(function(t){var r={searchParams:"URLSearchParams"in i,iterable:"Symbol"in i&&"iterator"in Symbol,blob:"FileReader"in i&&"Blob"in i&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:"FormData"in i,arrayBuffer:"ArrayBuffer"in i};function a(f){return f&&DataView.prototype.isPrototypeOf(f)}if(n(a,"isDataView"),r.arrayBuffer)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],o=ArrayBuffer.isView||function(f){return f&&s.indexOf(Object.prototype.toString.call(f))>-1};function l(f){if(typeof f!="string"&&(f=String(f)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(f))throw new TypeError("Invalid character in header field name");return f.toLowerCase()}n(l,"normalizeName");function c(f){return typeof f!="string"&&(f=String(f)),f}n(c,"normalizeValue");function h(f){var H={next:n(function(){var I=f.shift();return{done:I===void 0,value:I}},"next")};return r.iterable&&(H[Symbol.iterator]=function(){return H}),H}n(h,"iteratorFor");function p(f){this.map={},f instanceof p?f.forEach(function(H,I){this.append(I,H)},this):Array.isArray(f)?f.forEach(function(H){this.append(H[0],H[1])},this):f&&Object.getOwnPropertyNames(f).forEach(function(H){this.append(H,f[H])},this)}n(p,"Headers"),p.prototype.append=function(f,H){f=l(f),H=c(H);var I=this.map[f];this.map[f]=I?I+", "+H:H},p.prototype.delete=function(f){delete this.map[l(f)]},p.prototype.get=function(f){return f=l(f),this.has(f)?this.map[f]:null},p.prototype.has=function(f){return this.map.hasOwnProperty(l(f))},p.prototype.set=function(f,H){this.map[l(f)]=c(H)},p.prototype.forEach=function(f,H){for(var I in this.map)this.map.hasOwnProperty(I)&&f.call(H,this.map[I],I,this)},p.prototype.keys=function(){var f=[];return this.forEach(function(H,I){f.push(I)}),h(f)},p.prototype.values=function(){var f=[];return this.forEach(function(H){f.push(H)}),h(f)},p.prototype.entries=function(){var f=[];return this.forEach(function(H,I){f.push([I,H])}),h(f)},r.iterable&&(p.prototype[Symbol.iterator]=p.prototype.entries);function w(f){if(f.bodyUsed)return Promise.reject(new TypeError("Already read"));f.bodyUsed=!0}n(w,"consumed");function E(f){return new Promise(function(H,I){f.onload=function(){H(f.result)},f.onerror=function(){I(f.error)}})}n(E,"fileReaderReady");function P(f){var H=new FileReader,I=E(H);return H.readAsArrayBuffer(f),I}n(P,"readBlobAsArrayBuffer");function y(f){var H=new FileReader,I=E(H);return H.readAsText(f),I}n(y,"readBlobAsText");function q(f){for(var H=new Uint8Array(f),I=new Array(H.length),X=0;X<H.length;X++)I[X]=String.fromCharCode(H[X]);return I.join("")}n(q,"readArrayBufferAsText");function v(f){if(f.slice)return f.slice(0);var H=new Uint8Array(f.byteLength);return H.set(new Uint8Array(f)),H.buffer}n(v,"bufferClone");function B(){return this.bodyUsed=!1,this._initBody=function(f){this._bodyInit=f,f?typeof f=="string"?this._bodyText=f:r.blob&&Blob.prototype.isPrototypeOf(f)?this._bodyBlob=f:r.formData&&FormData.prototype.isPrototypeOf(f)?this._bodyFormData=f:r.searchParams&&URLSearchParams.prototype.isPrototypeOf(f)?this._bodyText=f.toString():r.arrayBuffer&&r.blob&&a(f)?(this._bodyArrayBuffer=v(f.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):r.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(f)||o(f))?this._bodyArrayBuffer=v(f):this._bodyText=f=Object.prototype.toString.call(f):this._bodyText="",this.headers.get("content-type")||(typeof f=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r.searchParams&&URLSearchParams.prototype.isPrototypeOf(f)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r.blob&&(this.blob=function(){var f=w(this);if(f)return f;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?w(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(P)}),this.text=function(){var f=w(this);if(f)return f;if(this._bodyBlob)return y(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(q(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},r.formData&&(this.formData=function(){return this.text().then(Ue)}),this.json=function(){return this.text().then(JSON.parse)},this}n(B,"Body");var ge=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function z(f){var H=f.toUpperCase();return ge.indexOf(H)>-1?H:f}n(z,"normalizeMethod");function k(f,H){H=H||{};var I=H.body;if(f instanceof k){if(f.bodyUsed)throw new TypeError("Already read");this.url=f.url,this.credentials=f.credentials,H.headers||(this.headers=new p(f.headers)),this.method=f.method,this.mode=f.mode,this.signal=f.signal,!I&&f._bodyInit!=null&&(I=f._bodyInit,f.bodyUsed=!0)}else this.url=String(f);if(this.credentials=H.credentials||this.credentials||"same-origin",(H.headers||!this.headers)&&(this.headers=new p(H.headers)),this.method=z(H.method||this.method||"GET"),this.mode=H.mode||this.mode||null,this.signal=H.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&I)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(I)}n(k,"Request"),k.prototype.clone=function(){return new k(this,{body:this._bodyInit})};function Ue(f){var H=new FormData;return f.trim().split("&").forEach(function(I){if(I){var X=I.split("="),$=X.shift().replace(/\+/g," "),O=X.join("=").replace(/\+/g," ");H.append(decodeURIComponent($),decodeURIComponent(O))}}),H}n(Ue,"decode");function yt(f){var H=new p,I=f.replace(/\r?\n[\t ]+/g," ");return I.split(/\r?\n/).forEach(function(X){var $=X.split(":"),O=$.shift().trim();if(O){var He=$.join(":").trim();H.append(O,He)}}),H}n(yt,"parseHeaders"),B.call(k.prototype);function J(f,H){H||(H={}),this.type="default",this.status=H.status===void 0?200:H.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in H?H.statusText:"OK",this.headers=new p(H.headers),this.url=H.url||"",this._initBody(f)}n(J,"Response"),B.call(J.prototype),J.prototype.clone=function(){return new J(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},J.error=function(){var f=new J(null,{status:0,statusText:""});return f.type="error",f};var di=[301,302,303,307,308];J.redirect=function(f,H){if(di.indexOf(H)===-1)throw new RangeError("Invalid status code");return new J(null,{status:H,headers:{location:f}})},t.DOMException=i.DOMException;try{new t.DOMException}catch{t.DOMException=function(H,I){this.message=H,this.name=I;var X=Error(H);this.stack=X.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function Pt(f,H){return new Promise(function(I,X){var $=new k(f,H);if($.signal&&$.signal.aborted)return X(new t.DOMException("Aborted","AbortError"));var O=new XMLHttpRequest;function He(){O.abort()}n(He,"abortXhr"),O.onload=function(){var At={status:O.status,statusText:O.statusText,headers:yt(O.getAllResponseHeaders()||"")};At.url="responseURL"in O?O.responseURL:At.headers.get("X-Request-URL");var Le="response"in O?O.response:O.responseText;I(new J(Le,At))},O.onerror=function(){X(new TypeError("Network request failed"))},O.ontimeout=function(){X(new TypeError("Network request failed"))},O.onabort=function(){X(new t.DOMException("Aborted","AbortError"))},O.open($.method,$.url,!0),$.credentials==="include"?O.withCredentials=!0:$.credentials==="omit"&&(O.withCredentials=!1),"responseType"in O&&r.blob&&(O.responseType="blob"),$.headers.forEach(function(At,Le){O.setRequestHeader(Le,At)}),$.signal&&($.signal.addEventListener("abort",He),O.onreadystatechange=function(){O.readyState===4&&$.signal.removeEventListener("abort",He)}),O.send(typeof $._bodyInit>"u"?null:$._bodyInit)})}return n(Pt,"fetch"),Pt.polyfill=!0,i.fetch||(i.fetch=Pt,i.Headers=p,i.Request=k,i.Response=J),t.Headers=p,t.Request=k,t.Response=J,t.fetch=Pt,Object.defineProperty(t,"__esModule",{value:!0}),t})({})})(io);io.fetch.ponyfill=!0;delete io.fetch.polyfill;var Tr=io;ft=Tr.fetch;ft.default=Tr.fetch;ft.fetch=Tr.fetch;ft.Headers=Tr.Headers;ft.Request=Tr.Request;ft.Response=Tr.Response;lf.exports=ft});var no=u((ZB,df)=>{"use strict";var Lc=Object.prototype.hasOwnProperty,Rr=Array.isArray,ot=(function(){for(var i=[],e=0;e<256;++e)i.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return i})(),Y0=n(function(e){for(;e.length>1;){var t=e.pop(),r=t.obj[t.prop];if(Rr(r)){for(var a=[],s=0;s<r.length;++s)typeof r[s]<"u"&&a.push(r[s]);t.obj[t.prop]=a}}},"compactQueue"),cf=n(function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},a=0;a<e.length;++a)typeof e[a]<"u"&&(r[a]=e[a]);return r},"arrayToObject"),eH=n(function i(e,t,r){if(!t)return e;if(typeof t!="object"){if(Rr(e))e.push(t);else if(e&&typeof e=="object")(r&&(r.plainObjects||r.allowPrototypes)||!Lc.call(Object.prototype,t))&&(e[t]=!0);else return[e,t];return e}if(!e||typeof e!="object")return[e].concat(t);var a=e;return Rr(e)&&!Rr(t)&&(a=cf(e,r)),Rr(e)&&Rr(t)?(t.forEach(function(s,o){if(Lc.call(e,o)){var l=e[o];l&&typeof l=="object"&&s&&typeof s=="object"?e[o]=i(l,s,r):e.push(s)}else e[o]=s}),e):Object.keys(t).reduce(function(s,o){var l=t[o];return Lc.call(s,o)?s[o]=i(s[o],l,r):s[o]=l,s},a)},"merge"),tH=n(function(e,t){return Object.keys(t).reduce(function(r,a){return r[a]=t[a],r},e)},"assignSingleSource"),rH=n(function(i,e,t){var r=i.replace(/\+/g," ");if(t==="iso-8859-1")return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch{return r}},"decode"),iH=n(function(e,t,r){if(e.length===0)return e;var a=e;if(typeof e=="symbol"?a=Symbol.prototype.toString.call(e):typeof e!="string"&&(a=String(e)),r==="iso-8859-1")return escape(a).replace(/%u[0-9a-f]{4}/gi,function(c){return"%26%23"+parseInt(c.slice(2),16)+"%3B"});for(var s="",o=0;o<a.length;++o){var l=a.charCodeAt(o);if(l===45||l===46||l===95||l===126||l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122){s+=a.charAt(o);continue}if(l<128){s=s+ot[l];continue}if(l<2048){s=s+(ot[192|l>>6]+ot[128|l&63]);continue}if(l<55296||l>=57344){s=s+(ot[224|l>>12]+ot[128|l>>6&63]+ot[128|l&63]);continue}o+=1,l=65536+((l&1023)<<10|a.charCodeAt(o)&1023),s+=ot[240|l>>18]+ot[128|l>>12&63]+ot[128|l>>6&63]+ot[128|l&63]}return s},"encode"),nH=n(function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],a=0;a<t.length;++a)for(var s=t[a],o=s.obj[s.prop],l=Object.keys(o),c=0;c<l.length;++c){var h=l[c],p=o[h];typeof p=="object"&&p!==null&&r.indexOf(p)===-1&&(t.push({obj:o,prop:h}),r.push(p))}return Y0(t),e},"compact"),aH=n(function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},"isRegExp"),sH=n(function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},"isBuffer"),oH=n(function(e,t){return[].concat(e,t)},"combine");df.exports={arrayToObject:cf,assign:tH,combine:oH,compact:nH,decode:rH,encode:iH,isBuffer:sH,isRegExp:aH,merge:eH}});var Fc=u((YB,pf)=>{"use strict";var lH=String.prototype.replace,uH=/%20/g,cH=no(),hf={RFC1738:"RFC1738",RFC3986:"RFC3986"};pf.exports=cH.assign({default:hf.RFC3986,formatters:{RFC1738:n(function(i){return lH.call(i,uH,"+")},"RFC1738"),RFC3986:n(function(i){return String(i)},"RFC3986")}},hf)});var gf=u((tO,ff)=>{"use strict";var yf=no(),xi=Fc(),dH=Object.prototype.hasOwnProperty,_f={brackets:n(function(e){return e+"[]"},"brackets"),comma:"comma",indices:n(function(e,t){return e+"["+t+"]"},"indices"),repeat:n(function(e){return e},"repeat")},Ur=Array.isArray,hH=Array.prototype.push,Nc=n(function(i,e){hH.apply(i,Ur(e)?e:[e])},"pushToArray"),pH=Date.prototype.toISOString,mf=xi.default,ve={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:yf.encode,encodeValuesOnly:!1,format:mf,formatter:xi.formatters[mf],indices:!1,serializeDate:n(function(e){return pH.call(e)},"serializeDate"),skipNulls:!1,strictNullHandling:!1},_H=n(function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},"isNonNullishPrimitive"),mH=n(function i(e,t,r,a,s,o,l,c,h,p,w,E,P){var y=e;if(typeof l=="function"?y=l(t,y):y instanceof Date?y=p(y):r==="comma"&&Ur(y)&&(y=y.join(",")),y===null){if(a)return o&&!E?o(t,ve.encoder,P,"key"):t;y=""}if(_H(y)||yf.isBuffer(y)){if(o){var q=E?t:o(t,ve.encoder,P,"key");return[w(q)+"="+w(o(y,ve.encoder,P,"value"))]}return[w(t)+"="+w(String(y))]}var v=[];if(typeof y>"u")return v;var B;if(Ur(l))B=l;else{var ge=Object.keys(y);B=c?ge.sort(c):ge}for(var z=0;z<B.length;++z){var k=B[z];s&&y[k]===null||(Ur(y)?Nc(v,i(y[k],typeof r=="function"?r(t,k):t,r,a,s,o,l,c,h,p,w,E,P)):Nc(v,i(y[k],t+(h?"."+k:"["+k+"]"),r,a,s,o,l,c,h,p,w,E,P)))}return v},"stringify"),yH=n(function(e){if(!e)return ve;if(e.encoder!==null&&e.encoder!==void 0&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var t=e.charset||ve.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=xi.default;if(typeof e.format<"u"){if(!dH.call(xi.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var a=xi.formatters[r],s=ve.filter;return(typeof e.filter=="function"||Ur(e.filter))&&(s=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:ve.addQueryPrefix,allowDots:typeof e.allowDots>"u"?ve.allowDots:!!e.allowDots,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:ve.charsetSentinel,delimiter:typeof e.delimiter>"u"?ve.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:ve.encode,encoder:typeof e.encoder=="function"?e.encoder:ve.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:ve.encodeValuesOnly,filter:s,formatter:a,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:ve.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:ve.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:ve.strictNullHandling}},"normalizeStringifyOptions");ff.exports=function(i,e){var t=i,r=yH(e),a,s;typeof r.filter=="function"?(s=r.filter,t=s("",t)):Ur(r.filter)&&(s=r.filter,a=s);var o=[];if(typeof t!="object"||t===null)return"";var l;e&&e.arrayFormat in _f?l=e.arrayFormat:e&&"indices"in e?l=e.indices?"indices":"repeat":l="indices";var c=_f[l];a||(a=Object.keys(t)),r.sort&&a.sort(r.sort);for(var h=0;h<a.length;++h){var p=a[h];r.skipNulls&&t[p]===null||Nc(o,mH(t[p],p,c,r.strictNullHandling,r.skipNulls,r.encode?r.encoder:null,r.filter,r.sort,r.allowDots,r.serializeDate,r.formatter,r.encodeValuesOnly,r.charset))}var w=o.join(r.delimiter),E=r.addQueryPrefix===!0?"?":"";return r.charsetSentinel&&(r.charset==="iso-8859-1"?E+="utf8=%26%2310003%3B&":E+="utf8=%E2%9C%93&"),w.length>0?E+w:""}});var vf=u((iO,wf)=>{"use strict";var wi=no(),Qc=Object.prototype.hasOwnProperty,bf=Array.isArray,be={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:wi.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},fH=n(function(i){return i.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},"interpretNumericEntities"),xf=n(function(i,e){return i&&typeof i=="string"&&e.comma&&i.indexOf(",")>-1?i.split(","):i},"parseArrayValue"),gH=n(function(e,t){if(bf(e)){for(var r=[],a=0;a<e.length;a+=1)r.push(t(e[a]));return r}return t(e)},"maybeMap"),bH="utf8=%26%2310003%3B",xH="utf8=%E2%9C%93",wH=n(function(e,t){var r={},a=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,s=t.parameterLimit===1/0?void 0:t.parameterLimit,o=a.split(t.delimiter,s),l=-1,c,h=t.charset;if(t.charsetSentinel)for(c=0;c<o.length;++c)o[c].indexOf("utf8=")===0&&(o[c]===xH?h="utf-8":o[c]===bH&&(h="iso-8859-1"),l=c,c=o.length);for(c=0;c<o.length;++c)if(c!==l){var p=o[c],w=p.indexOf("]="),E=w===-1?p.indexOf("="):w+1,P,y;E===-1?(P=t.decoder(p,be.decoder,h,"key"),y=t.strictNullHandling?null:""):(P=t.decoder(p.slice(0,E),be.decoder,h,"key"),y=gH(xf(p.slice(E+1),t),function(q){return t.decoder(q,be.decoder,h,"value")})),y&&t.interpretNumericEntities&&h==="iso-8859-1"&&(y=fH(y)),p.indexOf("[]=")>-1&&(y=bf(y)?[y]:y),Qc.call(r,P)?r[P]=wi.combine(r[P],y):r[P]=y}return r},"parseQueryStringValues"),vH=n(function(i,e,t,r){for(var a=r?e:xf(e,t),s=i.length-1;s>=0;--s){var o,l=i[s];if(l==="[]"&&t.parseArrays)o=[].concat(a);else{o=t.plainObjects?Object.create(null):{};var c=l.charAt(0)==="["&&l.charAt(l.length-1)==="]"?l.slice(1,-1):l,h=parseInt(c,10);!t.parseArrays&&c===""?o={0:a}:!isNaN(h)&&l!==c&&String(h)===c&&h>=0&&t.parseArrays&&h<=t.arrayLimit?(o=[],o[h]=a):o[c]=a}a=o}return a},"parseObject"),SH=n(function(e,t,r,a){if(e){var s=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/,l=/(\[[^[\]]*])/g,c=r.depth>0&&o.exec(s),h=c?s.slice(0,c.index):s,p=[];if(h){if(!r.plainObjects&&Qc.call(Object.prototype,h)&&!r.allowPrototypes)return;p.push(h)}for(var w=0;r.depth>0&&(c=l.exec(s))!==null&&w<r.depth;){if(w+=1,!r.plainObjects&&Qc.call(Object.prototype,c[1].slice(1,-1))&&!r.allowPrototypes)return;p.push(c[1])}return c&&p.push("["+s.slice(c.index)+"]"),vH(p,t,r,a)}},"parseQueryStringKeys"),HH=n(function(e){if(!e)return be;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=typeof e.charset>"u"?be.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?be.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:be.allowPrototypes,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:be.arrayLimit,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:be.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:be.comma,decoder:typeof e.decoder=="function"?e.decoder:be.decoder,delimiter:typeof e.delimiter=="string"||wi.isRegExp(e.delimiter)?e.delimiter:be.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:be.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:be.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:be.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:be.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:be.strictNullHandling}},"normalizeParseOptions");wf.exports=function(i,e){var t=HH(e);if(i===""||i===null||typeof i>"u")return t.plainObjects?Object.create(null):{};for(var r=typeof i=="string"?wH(i,t):i,a=t.plainObjects?Object.create(null):{},s=Object.keys(r),o=0;o<s.length;++o){var l=s[o],c=SH(l,r[l],t,typeof i=="string");a=wi.merge(a,c,t)}return wi.compact(a)}});var Gc=u((aO,Sf)=>{"use strict";var CH=gf(),qH=vf(),EH=Fc();Sf.exports={formats:EH,parse:qH,stringify:CH}});var Cf=u(Hf=>{function gt(i){if(typeof i!="object")return i;var e,t,r=Object.prototype.toString.call(i);if(r==="[object Object]"){if(i.constructor!==Object&&typeof i.constructor=="function"){t=new i.constructor;for(e in i)i.hasOwnProperty(e)&&t[e]!==i[e]&&(t[e]=gt(i[e]))}else{t={};for(e in i)e==="__proto__"?Object.defineProperty(t,e,{value:gt(i[e]),configurable:!0,enumerable:!0,writable:!0}):t[e]=gt(i[e])}return t}if(r==="[object Array]"){for(e=i.length,t=Array(e);e--;)t[e]=gt(i[e]);return t}return r==="[object Set]"?(t=new Set,i.forEach(function(a){t.add(gt(a))}),t):r==="[object Map]"?(t=new Map,i.forEach(function(a,s){t.set(gt(s),gt(a))}),t):r==="[object Date]"?new Date(+i):r==="[object RegExp]"?(t=new RegExp(i.source,i.flags),t.lastIndex=i.lastIndex,t):r==="[object DataView]"?new i.constructor(gt(i.buffer)):r==="[object ArrayBuffer]"?i.slice(0):r.slice(-6)==="Array]"?new i.constructor(i):i}n(gt,"klona");Hf.klona=gt});var Vc=u(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.DataObject=lt.getRawData=lt.rawDataSymbol=void 0;var PH=Cf();lt.rawDataSymbol=Symbol("twurpleRawData");function AH(i){return(0,PH.klona)(i[lt.rawDataSymbol])}n(AH,"getRawData");lt.getRawData=AH;var Wc=class{static{n(this,"DataObject")}constructor(e){this[lt.rawDataSymbol]=e}};lt.DataObject=Wc});var so=u(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.CustomError=void 0;var $c=class extends Error{static{n(this,"CustomError")}constructor(e,t){var r;super(e,t),Object.setPrototypeOf(this,new.target.prototype),(r=Error.captureStackTrace)===null||r===void 0||r.call(Error,this,new.target.constructor)}get name(){return this.constructor.name}};ao.CustomError=$c});var Kc=u(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.RelationAssertionError=void 0;var DH=so(),zc=class extends DH.CustomError{static{n(this,"RelationAssertionError")}constructor(){super("Relation returned null - this may be a library bug or a race condition in your own code")}};oo.RelationAssertionError=zc});var qf=u(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.checkRelationAssertion=void 0;var IH=Kc();function TH(i){if(i==null)throw new IH.RelationAssertionError;return i}n(TH,"checkRelationAssertion");lo.checkRelationAssertion=TH});var Jc=u(uo=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});uo.rtfm=void 0;function RH(i,e,t){return r=>{let a=t?function(){return`[${e}#${this[t]} - please check https://twurple.js.org/reference/${i}/classes/${e}.html for available properties]`}:function(){return`[${e} - please check https://twurple.js.org/reference/${i}/classes/${e}.html for available properties]`};Object.defineProperty(r.prototype,Symbol.for("nodejs.util.inspect.custom"),{value:a,enumerable:!1})}}n(RH,"rtfm");uo.rtfm=RH});var Ef=u(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.HelixExtension=void 0;var UH=(b(),x(g)),D=Vc(),BH=Jc(),Zc=class extends D.DataObject{static{n(this,"HelixExtension")}get authorName(){return this[D.rawDataSymbol].author_name}get bitsEnabled(){return this[D.rawDataSymbol].bits_enabled}get installable(){return this[D.rawDataSymbol].can_install}get configurationLocation(){return this[D.rawDataSymbol].configuration_location}get description(){return this[D.rawDataSymbol].description}get tosUrl(){return this[D.rawDataSymbol].eula_tos_url}get hasChatSupport(){return this[D.rawDataSymbol].has_chat_support}get iconUrl(){return this[D.rawDataSymbol].icon_url}getIconUrl(e){return this[D.rawDataSymbol].icon_urls[e]}get id(){return this[D.rawDataSymbol].id}get name(){return this[D.rawDataSymbol].name}get privacyPolicyUrl(){return this[D.rawDataSymbol].privacy_policy_url}get requestsIdentityLink(){return this[D.rawDataSymbol].request_identity_link}get screenshotUrls(){return this[D.rawDataSymbol].screenshot_urls}get state(){return this[D.rawDataSymbol].state}get subscriptionsSupportLevel(){return this[D.rawDataSymbol].subscriptions_support_level}get summary(){return this[D.rawDataSymbol].summary}get supportEmail(){return this[D.rawDataSymbol].support_email}get version(){return this[D.rawDataSymbol].version}get viewerSummary(){return this[D.rawDataSymbol].viewer_summary}get viewerSummery(){return this[D.rawDataSymbol].viewer_summary}get allowedConfigUrls(){return this[D.rawDataSymbol].allowlisted_config_urls}get allowedPanelUrls(){return this[D.rawDataSymbol].allowlisted_panel_urls}get mobileViewerUrl(){var e,t;return(t=(e=this[D.rawDataSymbol].views.mobile)===null||e===void 0?void 0:e.viewer_url)!==null&&t!==void 0?t:null}get panelViewerUrl(){var e,t;return(t=(e=this[D.rawDataSymbol].views.panel)===null||e===void 0?void 0:e.viewer_url)!==null&&t!==void 0?t:null}get panelHeight(){var e,t;return(t=(e=this[D.rawDataSymbol].views.panel)===null||e===void 0?void 0:e.height)!==null&&t!==void 0?t:null}get panelCanLinkExternalContent(){var e,t;return(t=(e=this[D.rawDataSymbol].views.panel)===null||e===void 0?void 0:e.can_link_external_content)!==null&&t!==void 0?t:null}get overlayViewerUrl(){var e,t;return(t=(e=this[D.rawDataSymbol].views.video_overlay)===null||e===void 0?void 0:e.viewer_url)!==null&&t!==void 0?t:null}get overlayCanLinkExternalContent(){var e,t;return(t=(e=this[D.rawDataSymbol].views.video_overlay)===null||e===void 0?void 0:e.can_link_external_content)!==null&&t!==void 0?t:null}get componentViewerUrl(){var e,t;return(t=(e=this[D.rawDataSymbol].views.component)===null||e===void 0?void 0:e.viewer_url)!==null&&t!==void 0?t:null}get componentAspectWidth(){var e,t;return(t=(e=this[D.rawDataSymbol].views.component)===null||e===void 0?void 0:e.aspect_width)!==null&&t!==void 0?t:null}get componentAspectHeight(){var e,t;return(t=(e=this[D.rawDataSymbol].views.component)===null||e===void 0?void 0:e.aspect_height)!==null&&t!==void 0?t:null}get componentAspectRatioX(){var e,t;return(t=(e=this[D.rawDataSymbol].views.component)===null||e===void 0?void 0:e.aspect_ratio_x)!==null&&t!==void 0?t:null}get componentAspectRatioY(){var e,t;return(t=(e=this[D.rawDataSymbol].views.component)===null||e===void 0?void 0:e.aspect_ratio_y)!==null&&t!==void 0?t:null}get componentAutoScales(){var e,t;return(t=(e=this[D.rawDataSymbol].views.component)===null||e===void 0?void 0:e.autoscale)!==null&&t!==void 0?t:null}get componentScalePixels(){var e,t;return(t=(e=this[D.rawDataSymbol].views.component)===null||e===void 0?void 0:e.scale_pixels)!==null&&t!==void 0?t:null}get componentTargetHeight(){var e,t;return(t=(e=this[D.rawDataSymbol].views.component)===null||e===void 0?void 0:e.target_height)!==null&&t!==void 0?t:null}get componentSize(){var e,t;return(t=(e=this[D.rawDataSymbol].views.component)===null||e===void 0?void 0:e.size)!==null&&t!==void 0?t:null}get componentZoom(){var e,t;return(t=(e=this[D.rawDataSymbol].views.component)===null||e===void 0?void 0:e.zoom)!==null&&t!==void 0?t:null}get componentZoomPixels(){var e,t;return(t=(e=this[D.rawDataSymbol].views.component)===null||e===void 0?void 0:e.zoom_pixels)!==null&&t!==void 0?t:null}get componentCanLinkExternalContent(){var e,t;return(t=(e=this[D.rawDataSymbol].views.component)===null||e===void 0?void 0:e.can_link_external_content)!==null&&t!==void 0?t:null}get configViewerUrl(){var e,t;return(t=(e=this[D.rawDataSymbol].views.config)===null||e===void 0?void 0:e.viewer_url)!==null&&t!==void 0?t:null}get configCanLinkExternalContent(){var e,t;return(t=(e=this[D.rawDataSymbol].views.config)===null||e===void 0?void 0:e.can_link_external_content)!==null&&t!==void 0?t:null}};vi.HelixExtension=Zc;vi.HelixExtension=Zc=UH.__decorate([(0,BH.rtfm)("api","HelixExtension","id")],Zc)});var Pf=u(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.HellFreezesOverError=void 0;var OH=so(),Xc=class extends OH.CustomError{static{n(this,"HellFreezesOverError")}constructor(e){super(`${e} - this should never happen, please file a bug in the GitHub issue tracker`)}};co.HellFreezesOverError=Xc});var Af=u(Br=>{"use strict";Object.defineProperty(Br,"__esModule",{value:!0});Br.extractUserName=Br.extractUserId=void 0;function jH(i){return typeof i=="string"?i:typeof i=="number"?i.toString(10):i.id}n(jH,"extractUserId");Br.extractUserId=jH;function kH(i){return typeof i=="string"?i:i.name}n(kH,"extractUserName");Br.extractUserName=kH});var m=u(K=>{"use strict";Object.defineProperty(K,"__esModule",{value:!0});K.extractUserName=K.extractUserId=K.RelationAssertionError=K.HellFreezesOverError=K.CustomError=K.HelixExtension=K.rtfm=K.checkRelationAssertion=K.rawDataSymbol=K.getRawData=K.DataObject=void 0;var Yc=Vc();Object.defineProperty(K,"DataObject",{enumerable:!0,get:n(function(){return Yc.DataObject},"get")});Object.defineProperty(K,"getRawData",{enumerable:!0,get:n(function(){return Yc.getRawData},"get")});Object.defineProperty(K,"rawDataSymbol",{enumerable:!0,get:n(function(){return Yc.rawDataSymbol},"get")});var MH=qf();Object.defineProperty(K,"checkRelationAssertion",{enumerable:!0,get:n(function(){return MH.checkRelationAssertion},"get")});var LH=Jc();Object.defineProperty(K,"rtfm",{enumerable:!0,get:n(function(){return LH.rtfm},"get")});var FH=Ef();Object.defineProperty(K,"HelixExtension",{enumerable:!0,get:n(function(){return FH.HelixExtension},"get")});var NH=so();Object.defineProperty(K,"CustomError",{enumerable:!0,get:n(function(){return NH.CustomError},"get")});var QH=Pf();Object.defineProperty(K,"HellFreezesOverError",{enumerable:!0,get:n(function(){return QH.HellFreezesOverError},"get")});var GH=Kc();Object.defineProperty(K,"RelationAssertionError",{enumerable:!0,get:n(function(){return GH.RelationAssertionError},"get")});var Df=Af();Object.defineProperty(K,"extractUserId",{enumerable:!0,get:n(function(){return Df.extractUserId},"get")});Object.defineProperty(K,"extractUserName",{enumerable:!0,get:n(function(){return Df.extractUserName},"get")})});var td=u(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.HttpStatusCodeError=void 0;var WH=m(),ed=class extends WH.CustomError{static{n(this,"HttpStatusCodeError")}constructor(e,t,r,a,s,o){super(`Encountered HTTP status code ${e}: ${t}
|
|
1
|
+
var ts=Object.defineProperty;var mw=Object.getOwnPropertyDescriptor;var yw=Object.getOwnPropertyNames;var fw=Object.prototype.hasOwnProperty;var n=(i,e)=>ts(i,"name",{value:e,configurable:!0});var gw=(i,e)=>()=>(i&&(e=i(i=0)),e);var u=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),bw=(i,e)=>{for(var t in e)ts(i,t,{get:e[t],enumerable:!0})},xw=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of yw(e))!fw.call(i,a)&&a!==t&&ts(i,a,{get:()=>e[a],enumerable:!(r=mw(e,a))||r.enumerable});return i};var x=i=>xw(ts({},"__esModule",{value:!0}),i);var vr=u((tU,X_)=>{var Mu=class i{static{n(this,"Emote")}constructor(e,t,r){if(new.target.name===i.name)throw new Error("Base Emote class cannot be used");this.fetcher=e.fetcher,this.channel=e,this.id=t,this.type=null,this._setup(r)}_setup(e){this.code=e.code}toLink(){return null}toString(){return this.code}toObject(){return{code:this.code,id:this.id,channel_id:this.channel.channel_id}}};X_.exports=Mu});var Tt=u((iU,Y_)=>{Y_.exports={Twitch:{CDN:n((i,e)=>`https://static-cdn.jtvnw.net/emoticons/v2/${i}/default/dark/${e+1}.0`,"CDN")},BTTV:{Global:"https://api.betterttv.net/3/cached/emotes/global",Channel:n(i=>`https://api.betterttv.net/3/cached/users/twitch/${i}`,"Channel"),CDN:n((i,e)=>`https://cdn.betterttv.net/emote/${i}/${e+1}x.webp`,"CDN")},SevenTV:{Global:"https://7tv.io/v3/emote-sets/global",Channel:n(i=>`https://7tv.io/v3/users/twitch/${i}`,"Channel"),CDN:n((i,e)=>`https://cdn.7tv.app/emote/${i}/${e}`,"CDN")},FFZ:{sets:{Global:3,Modifiers:1532818},Set:n(i=>`https://api.frankerfacez.com/v1/set/${i}`,"Set"),Channel:n(i=>`https://api.frankerfacez.com/v1/room/id/${i}`,"Channel"),CDN:n((i,e)=>`https://cdn.frankerfacez.com/emote/${i}/${e}`,"CDN"),CDNAnimated:n((i,e)=>`https://cdn.frankerfacez.com/emote/${i}/animated/${e}.webp`,"CDNAnimated")},Templates:{html:'<img alt="{name}" title="{name}" class="twitch-emote twitch-emote-{size}" src="{link}">',markdown:'',bbcode:"[img]{link}[/img]",plain:"{link}"}}});var Fu=u((aU,em)=>{var ww=vr(),vw=Tt(),Lu=class i extends ww{static{n(this,"BTTVEmote")}constructor(e,t,r){super(e,t,r),this.type="bttv"}get owner(){return this.fetcher.channels.get(this.ownerName)}_setup(e){super._setup(e),this.ownerName="user"in e?e.user.name:null,this.animated=e.animated,this.imageType="webp"}toLink(e=0){return vw.BTTV.CDN(this.id,e)}toObject(){return Object.assign({},super.toObject(),{animated:this.animated,ownerName:this.ownerName,type:this.type})}static fromObject(e,t=null){return new i(t,e.id,{code:e.code,animated:e.animated,user:{name:e.ownerName}})}};em.exports=Lu});var rs=u((oU,tm)=>{var Nu=class extends Map{static{n(this,"Collection")}find(e,t){if(typeof e=="string"){if(typeof t>"u")return null;for(let r of this.values())if(r[e]===t)return r;return null}if(typeof e=="function"){let r=0;for(let a of this.values()){if(e(a,r,this))return a;r++}return null}return null}filter(e,t){t&&(e=e.bind(t));let r=new this.constructor,a=0;for(let[s,o]of this)e(o,a,this)&&r.set(s,o),a++;return r}map(e,t){t&&(e=e.bind(t));let r=new Array(this.size),a=0;for(let s of this.values())r[a]=e(s,a,this),a++;return r}};tm.exports=Nu});var Gu=u((uU,rm)=>{var Sw=rs(),Qu=class{static{n(this,"Channel")}constructor(e,t){this.fetcher=e,this.channel_id=t,this.emotes=new Sw}fetchBTTVEmotes(){return this.fetcher.fetchBTTVEmotes(this.id)}fetchFFZEmotes(){return this.fetcher.fetchFFZEmotes(this.id)}fetchSevenTVEmotes(){return this.fetcher.fetchSevenTVEmotes(this.id)}};rm.exports=Qu});var Vu=u((dU,nm)=>{var Hw=vr(),im=Tt(),Wu=class i extends Hw{static{n(this,"FFZEmote")}constructor(e,t,r){super(e,t,r),this.type="ffz"}get owner(){return this.fetcher.channels.get(this.ownerName)}_setup(e){super._setup(e),this.code=e.name,this.ownerName="owner"in e?e.owner.name:null,this.sizes="animated"in e?Object.keys(e.animated):Object.keys(e.urls),this.animated="animated"in e,this.imageType="animated"in e?"webp":"png",this.modifier=e.modifier&&(e.modifier_flags&1)!==0}toLink(e=0){return e=this.sizes[e],this.animated?im.FFZ.CDNAnimated(this.id,e):im.FFZ.CDN(this.id,e)}toObject(){return Object.assign({},super.toObject(),{animated:this.animated,sizes:this.sizes,ownerName:this.ownerName,type:this.type,modifier:this.modifier})}static fromObject(e,t=null){let r=e.sizes.reduce((a,s)=>(a[s]=s,a),{});return new i(t,e.id,{code:e.code,name:e.code,urls:r,...e.animated?{animated:r}:{},owner:{name:e.ownerName},modifier:e.modifier,modifier_flags:e.modifier})}};nm.exports=Wu});var zu=u((pU,am)=>{var Cw=vr(),qw=Tt(),$u=class i extends Cw{static{n(this,"SevenTVEmote")}constructor(e,t,r){super(e,t,r),this.type="7tv"}get owner(){return this.fetcher.channels.get(this.ownerName)}_setup(e){super._setup(e),this.code=e.name,this.ownerName="owner"in e.data?e.data.owner.display_name:null,this.sizes=e.data.host.files.filter(t=>t.format===this.channel.format.toUpperCase()).map(t=>t.name),this.animated=e.data.animated,this.imageType=this.channel.format}toLink(e=0){return e=this.sizes[e],qw.SevenTV.CDN(this.id,e)}toObject(){return Object.assign({},super.toObject(),{animated:this.animated,sizes:this.sizes,ownerName:this.ownerName,type:this.type,imageType:this.imageType})}static fromObject(e,t){let r=e.sizes.map(a=>({format:t.format.toUpperCase(),name:a}));return new i(t,e.id,{code:e.code,name:e.code,data:{animated:e.animated,owner:{display_name:e.ownerName},host:{files:r}}})}};am.exports=$u});var Ju=u((mU,sm)=>{var Ew=vr(),Pw=Tt(),Ku=class i extends Ew{static{n(this,"TwitchEmote")}constructor(e,t,r){super(e,t,r),this.type="twitch"}get owner(){return this.channel}_setup(e){super._setup(e),this.set=e.emoticon_set,this.animated="animated"in e.formats,this.imageType="animated"in e.formats?"gif":"png"}toLink(e=0){return Pw.Twitch.CDN(this.id,e)}toObject(){return Object.assign({},super.toObject(),{animated:this.animated,set:this.set,type:this.type})}static fromObject(e,t=null){return new i(t,e.id,{code:e.code,animated:e.animated,emoticon_set:e.set,formats:e.animated?{animated:e.animated}:{}})}};sm.exports=Ku});var Gm=u((fU,Qm)=>{"use strict";function Sm(i,e){return n(function(){return i.apply(e,arguments)},"wrap")}n(Sm,"bind");var{toString:Aw}=Object.prototype,{getPrototypeOf:oc}=Object,{iterator:us,toStringTag:Hm}=Symbol,cs=(i=>e=>{let t=Aw.call(e);return i[t]||(i[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),Ye=n(i=>(i=i.toLowerCase(),e=>cs(e)===i),"kindOfTest"),ds=n(i=>e=>typeof e===i,"typeOfTest"),{isArray:qr}=Array,Sr=ds("undefined");function pi(i){return i!==null&&!Sr(i)&&i.constructor!==null&&!Sr(i.constructor)&&qe(i.constructor.isBuffer)&&i.constructor.isBuffer(i)}n(pi,"isBuffer");var Cm=Ye("ArrayBuffer");function Dw(i){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(i):e=i&&i.buffer&&Cm(i.buffer),e}n(Dw,"isArrayBufferView");var Iw=ds("string"),qe=ds("function"),qm=ds("number"),_i=n(i=>i!==null&&typeof i=="object","isObject"),Tw=n(i=>i===!0||i===!1,"isBoolean"),ns=n(i=>{if(cs(i)!=="object")return!1;let e=oc(i);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Hm in i)&&!(us in i)},"isPlainObject"),Rw=n(i=>{if(!_i(i)||pi(i))return!1;try{return Object.keys(i).length===0&&Object.getPrototypeOf(i)===Object.prototype}catch{return!1}},"isEmptyObject"),Uw=Ye("Date"),Ow=Ye("File"),Bw=Ye("Blob"),jw=Ye("FileList"),kw=n(i=>_i(i)&&qe(i.pipe),"isStream"),Mw=n(i=>{let e;return i&&(typeof FormData=="function"&&i instanceof FormData||qe(i.append)&&((e=cs(i))==="formdata"||e==="object"&&qe(i.toString)&&i.toString()==="[object FormData]"))},"isFormData"),Lw=Ye("URLSearchParams"),[Fw,Nw,Qw,Gw]=["ReadableStream","Request","Response","Headers"].map(Ye),Ww=n(i=>i.trim?i.trim():i.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),"trim");function mi(i,e,{allOwnKeys:t=!1}={}){if(i===null||typeof i>"u")return;let r,a;if(typeof i!="object"&&(i=[i]),qr(i))for(r=0,a=i.length;r<a;r++)e.call(null,i[r],r,i);else{if(pi(i))return;let s=t?Object.getOwnPropertyNames(i):Object.keys(i),o=s.length,l;for(r=0;r<o;r++)l=s[r],e.call(null,i[l],l,i)}}n(mi,"forEach");function Em(i,e){if(pi(i))return null;e=e.toLowerCase();let t=Object.keys(i),r=t.length,a;for(;r-- >0;)if(a=t[r],e===a.toLowerCase())return a;return null}n(Em,"findKey");var tr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Pm=n(i=>!Sr(i)&&i!==tr,"isContextDefined");function ec(){let{caseless:i,skipUndefined:e}=Pm(this)&&this||{},t={},r=n((a,s)=>{if(s==="__proto__"||s==="constructor"||s==="prototype")return;let o=i&&Em(t,s)||s;ns(t[o])&&ns(a)?t[o]=ec(t[o],a):ns(a)?t[o]=ec({},a):qr(a)?t[o]=a.slice():(!e||!Sr(a))&&(t[o]=a)},"assignValue");for(let a=0,s=arguments.length;a<s;a++)arguments[a]&&mi(arguments[a],r);return t}n(ec,"merge");var Vw=n((i,e,t,{allOwnKeys:r}={})=>(mi(e,(a,s)=>{t&&qe(a)?Object.defineProperty(i,s,{value:Sm(a,t),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(i,s,{value:a,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),i),"extend"),$w=n(i=>(i.charCodeAt(0)===65279&&(i=i.slice(1)),i),"stripBOM"),zw=n((i,e,t,r)=>{i.prototype=Object.create(e.prototype,r),Object.defineProperty(i.prototype,"constructor",{value:i,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(i,"super",{value:e.prototype}),t&&Object.assign(i.prototype,t)},"inherits"),Kw=n((i,e,t,r)=>{let a,s,o,l={};if(e=e||{},i==null)return e;do{for(a=Object.getOwnPropertyNames(i),s=a.length;s-- >0;)o=a[s],(!r||r(o,i,e))&&!l[o]&&(e[o]=i[o],l[o]=!0);i=t!==!1&&oc(i)}while(i&&(!t||t(i,e))&&i!==Object.prototype);return e},"toFlatObject"),Jw=n((i,e,t)=>{i=String(i),(t===void 0||t>i.length)&&(t=i.length),t-=e.length;let r=i.indexOf(e,t);return r!==-1&&r===t},"endsWith"),Zw=n(i=>{if(!i)return null;if(qr(i))return i;let e=i.length;if(!qm(e))return null;let t=new Array(e);for(;e-- >0;)t[e]=i[e];return t},"toArray"),Xw=(i=>e=>i&&e instanceof i)(typeof Uint8Array<"u"&&oc(Uint8Array)),Yw=n((i,e)=>{let r=(i&&i[us]).call(i),a;for(;(a=r.next())&&!a.done;){let s=a.value;e.call(i,s[0],s[1])}},"forEachEntry"),ev=n((i,e)=>{let t,r=[];for(;(t=i.exec(e))!==null;)r.push(t);return r},"matchAll"),tv=Ye("HTMLFormElement"),rv=n(i=>i.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,n(function(t,r,a){return r.toUpperCase()+a},"replacer")),"toCamelCase"),om=(({hasOwnProperty:i})=>(e,t)=>i.call(e,t))(Object.prototype),iv=Ye("RegExp"),Am=n((i,e)=>{let t=Object.getOwnPropertyDescriptors(i),r={};mi(t,(a,s)=>{let o;(o=e(a,s,i))!==!1&&(r[s]=o||a)}),Object.defineProperties(i,r)},"reduceDescriptors"),nv=n(i=>{Am(i,(e,t)=>{if(qe(i)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;let r=i[t];if(qe(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},"freezeMethods"),av=n((i,e)=>{let t={},r=n(a=>{a.forEach(s=>{t[s]=!0})},"define");return qr(i)?r(i):r(String(i).split(e)),t},"toObjectSet"),sv=n(()=>{},"noop"),ov=n((i,e)=>i!=null&&Number.isFinite(i=+i)?i:e,"toFiniteNumber");function lv(i){return!!(i&&qe(i.append)&&i[Hm]==="FormData"&&i[us])}n(lv,"isSpecCompliantForm");var uv=n(i=>{let e=new Array(10),t=n((r,a)=>{if(_i(r)){if(e.indexOf(r)>=0)return;if(pi(r))return r;if(!("toJSON"in r)){e[a]=r;let s=qr(r)?[]:{};return mi(r,(o,l)=>{let d=t(o,a+1);!Sr(d)&&(s[l]=d)}),e[a]=void 0,s}}return r},"visit");return t(i,0)},"toJSONObject"),cv=Ye("AsyncFunction"),dv=n(i=>i&&(_i(i)||qe(i))&&qe(i.then)&&qe(i.catch),"isThenable"),Dm=((i,e)=>i?setImmediate:e?((t,r)=>(tr.addEventListener("message",({source:a,data:s})=>{a===tr&&s===t&&r.length&&r.shift()()},!1),a=>{r.push(a),tr.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",qe(tr.postMessage)),hv=typeof queueMicrotask<"u"?queueMicrotask.bind(tr):typeof process<"u"&&process.nextTick||Dm,pv=n(i=>i!=null&&qe(i[us]),"isIterable"),m={isArray:qr,isArrayBuffer:Cm,isBuffer:pi,isFormData:Mw,isArrayBufferView:Dw,isString:Iw,isNumber:qm,isBoolean:Tw,isObject:_i,isPlainObject:ns,isEmptyObject:Rw,isReadableStream:Fw,isRequest:Nw,isResponse:Qw,isHeaders:Gw,isUndefined:Sr,isDate:Uw,isFile:Ow,isBlob:Bw,isRegExp:iv,isFunction:qe,isStream:kw,isURLSearchParams:Lw,isTypedArray:Xw,isFileList:jw,forEach:mi,merge:ec,extend:Vw,trim:Ww,stripBOM:$w,inherits:zw,toFlatObject:Kw,kindOf:cs,kindOfTest:Ye,endsWith:Jw,toArray:Zw,forEachEntry:Yw,matchAll:ev,isHTMLForm:tv,hasOwnProperty:om,hasOwnProp:om,reduceDescriptors:Am,freezeMethods:nv,toObjectSet:av,toCamelCase:rv,noop:sv,toFiniteNumber:ov,findKey:Em,global:tr,isContextDefined:Pm,isSpecCompliantForm:lv,toJSONObject:uv,isAsyncFn:cv,isThenable:dv,setImmediate:Dm,asap:hv,isIterable:pv},Ce=class i extends Error{static{n(this,"AxiosError")}static from(e,t,r,a,s,o){let l=new i(e.message,t||e.code,r,a,s);return l.cause=e,l.name=e.name,o&&Object.assign(l,o),l}constructor(e,t,r,a,s){super(e),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),r&&(this.config=r),a&&(this.request=a),s&&(this.response=s,this.status=s.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:m.toJSONObject(this.config),code:this.code,status:this.status}}};Ce.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";Ce.ERR_BAD_OPTION="ERR_BAD_OPTION";Ce.ECONNABORTED="ECONNABORTED";Ce.ETIMEDOUT="ETIMEDOUT";Ce.ERR_NETWORK="ERR_NETWORK";Ce.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";Ce.ERR_DEPRECATED="ERR_DEPRECATED";Ce.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";Ce.ERR_BAD_REQUEST="ERR_BAD_REQUEST";Ce.ERR_CANCELED="ERR_CANCELED";Ce.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";Ce.ERR_INVALID_URL="ERR_INVALID_URL";var O=Ce,_v=null;function tc(i){return m.isPlainObject(i)||m.isArray(i)}n(tc,"isVisitable");function Im(i){return m.endsWith(i,"[]")?i.slice(0,-2):i}n(Im,"removeBrackets");function lm(i,e,t){return i?i.concat(e).map(n(function(a,s){return a=Im(a),!t&&s?"["+a+"]":a},"each")).join(t?".":""):e}n(lm,"renderKey");function mv(i){return m.isArray(i)&&!i.some(tc)}n(mv,"isFlatArray");var yv=m.toFlatObject(m,{},null,n(function(e){return/^is[A-Z]/.test(e)},"filter"));function hs(i,e,t){if(!m.isObject(i))throw new TypeError("target must be an object");e=e||new FormData,t=m.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,n(function(q,v){return!m.isUndefined(v[q])},"defined"));let r=t.metaTokens,a=t.visitor||h,s=t.dots,o=t.indexes,d=(t.Blob||typeof Blob<"u"&&Blob)&&m.isSpecCompliantForm(e);if(!m.isFunction(a))throw new TypeError("visitor must be a function");function p(y){if(y===null)return"";if(m.isDate(y))return y.toISOString();if(m.isBoolean(y))return y.toString();if(!d&&m.isBlob(y))throw new O("Blob is not supported. Use a Buffer instead.");return m.isArrayBuffer(y)||m.isTypedArray(y)?d&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}n(p,"convertValue");function h(y,q,v){let U=y;if(y&&!v&&typeof y=="object"){if(m.endsWith(q,"{}"))q=r?q:q.slice(0,-2),y=JSON.stringify(y);else if(m.isArray(y)&&mv(y)||(m.isFileList(y)||m.endsWith(q,"[]"))&&(U=m.toArray(y)))return q=Im(q),U.forEach(n(function(z,k){!(m.isUndefined(z)||z===null)&&e.append(o===!0?lm([q],k,s):o===null?q:q+"[]",p(z))},"each")),!1}return tc(y)?!0:(e.append(lm(v,q,s),p(y)),!1)}n(h,"defaultVisitor");let w=[],E=Object.assign(yv,{defaultVisitor:h,convertValue:p,isVisitable:tc});function P(y,q){if(!m.isUndefined(y)){if(w.indexOf(y)!==-1)throw Error("Circular reference detected in "+q.join("."));w.push(y),m.forEach(y,n(function(U,be){(!(m.isUndefined(U)||U===null)&&a.call(e,U,m.isString(be)?be.trim():be,q,E))===!0&&P(U,q?q.concat(be):[be])},"each")),w.pop()}}if(n(P,"build"),!m.isObject(i))throw new TypeError("data must be an object");return P(i),e}n(hs,"toFormData");function um(i){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(i).replace(/[!'()~]|%20|%00/g,n(function(r){return e[r]},"replacer"))}n(um,"encode$1");function lc(i,e){this._pairs=[],i&&hs(i,this,e)}n(lc,"AxiosURLSearchParams");var Tm=lc.prototype;Tm.append=n(function(e,t){this._pairs.push([e,t])},"append");Tm.toString=n(function(e){let t=e?function(r){return e.call(this,r,um)}:um;return this._pairs.map(n(function(a){return t(a[0])+"="+t(a[1])},"each"),"").join("&")},"toString");function fv(i){return encodeURIComponent(i).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}n(fv,"encode");function Rm(i,e,t){if(!e)return i;let r=t&&t.encode||fv,a=m.isFunction(t)?{serialize:t}:t,s=a&&a.serialize,o;if(s?o=s(e,a):o=m.isURLSearchParams(e)?e.toString():new lc(e,a).toString(r),o){let l=i.indexOf("#");l!==-1&&(i=i.slice(0,l)),i+=(i.indexOf("?")===-1?"?":"&")+o}return i}n(Rm,"buildURL");var rc=class{static{n(this,"InterceptorManager")}constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){m.forEach(this.handlers,n(function(r){r!==null&&e(r)},"forEachHandler"))}},cm=rc,uc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},gv=typeof URLSearchParams<"u"?URLSearchParams:lc,bv=typeof FormData<"u"?FormData:null,xv=typeof Blob<"u"?Blob:null,wv={isBrowser:!0,classes:{URLSearchParams:gv,FormData:bv,Blob:xv},protocols:["http","https","file","blob","url","data"]},cc=typeof window<"u"&&typeof document<"u",ic=typeof navigator=="object"&&navigator||void 0,vv=cc&&(!ic||["ReactNative","NativeScript","NS"].indexOf(ic.product)<0),Sv=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Hv=cc&&window.location.href||"http://localhost",Cv=Object.freeze({__proto__:null,hasBrowserEnv:cc,hasStandardBrowserWebWorkerEnv:Sv,hasStandardBrowserEnv:vv,navigator:ic,origin:Hv}),ve={...Cv,...wv};function qv(i,e){return hs(i,new ve.classes.URLSearchParams,{visitor:n(function(t,r,a,s){return ve.isNode&&m.isBuffer(t)?(this.append(r,t.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},"visitor"),...e})}n(qv,"toURLEncodedForm");function Ev(i){return m.matchAll(/\w+|\[(\w*)]/g,i).map(e=>e[0]==="[]"?"":e[1]||e[0])}n(Ev,"parsePropPath");function Pv(i){let e={},t=Object.keys(i),r,a=t.length,s;for(r=0;r<a;r++)s=t[r],e[s]=i[s];return e}n(Pv,"arrayToObject");function Um(i){function e(t,r,a,s){let o=t[s++];if(o==="__proto__")return!0;let l=Number.isFinite(+o),d=s>=t.length;return o=!o&&m.isArray(a)?a.length:o,d?(m.hasOwnProp(a,o)?a[o]=[a[o],r]:a[o]=r,!l):((!a[o]||!m.isObject(a[o]))&&(a[o]=[]),e(t,r,a[o],s)&&m.isArray(a[o])&&(a[o]=Pv(a[o])),!l)}if(n(e,"buildPath"),m.isFormData(i)&&m.isFunction(i.entries)){let t={};return m.forEachEntry(i,(r,a)=>{e(Ev(r),a,t,0)}),t}return null}n(Um,"formDataToJSON");function Av(i,e,t){if(m.isString(i))try{return(e||JSON.parse)(i),m.trim(i)}catch(r){if(r.name!=="SyntaxError")throw r}return(t||JSON.stringify)(i)}n(Av,"stringifySafely");var dc={transitional:uc,adapter:["xhr","http","fetch"],transformRequest:[n(function(e,t){let r=t.getContentType()||"",a=r.indexOf("application/json")>-1,s=m.isObject(e);if(s&&m.isHTMLForm(e)&&(e=new FormData(e)),m.isFormData(e))return a?JSON.stringify(Um(e)):e;if(m.isArrayBuffer(e)||m.isBuffer(e)||m.isStream(e)||m.isFile(e)||m.isBlob(e)||m.isReadableStream(e))return e;if(m.isArrayBufferView(e))return e.buffer;if(m.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let l;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return qv(e,this.formSerializer).toString();if((l=m.isFileList(e))||r.indexOf("multipart/form-data")>-1){let d=this.env&&this.env.FormData;return hs(l?{"files[]":e}:e,d&&new d,this.formSerializer)}}return s||a?(t.setContentType("application/json",!1),Av(e)):e},"transformRequest")],transformResponse:[n(function(e){let t=this.transitional||dc.transitional,r=t&&t.forcedJSONParsing,a=this.responseType==="json";if(m.isResponse(e)||m.isReadableStream(e))return e;if(e&&m.isString(e)&&(r&&!this.responseType||a)){let o=!(t&&t.silentJSONParsing)&&a;try{return JSON.parse(e,this.parseReviver)}catch(l){if(o)throw l.name==="SyntaxError"?O.from(l,O.ERR_BAD_RESPONSE,this,null,this.response):l}}return e},"transformResponse")],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ve.classes.FormData,Blob:ve.classes.Blob},validateStatus:n(function(e){return e>=200&&e<300},"validateStatus"),headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};m.forEach(["delete","get","head","post","put","patch"],i=>{dc.headers[i]={}});var hc=dc,Dv=m.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Iv=n(i=>{let e={},t,r,a;return i&&i.split(`
|
|
2
|
+
`).forEach(n(function(o){a=o.indexOf(":"),t=o.substring(0,a).trim().toLowerCase(),r=o.substring(a+1).trim(),!(!t||e[t]&&Dv[t])&&(t==="set-cookie"?e[t]?e[t].push(r):e[t]=[r]:e[t]=e[t]?e[t]+", "+r:r)},"parser")),e},"parseHeaders"),dm=Symbol("internals");function hi(i){return i&&String(i).trim().toLowerCase()}n(hi,"normalizeHeader");function as(i){return i===!1||i==null?i:m.isArray(i)?i.map(as):String(i)}n(as,"normalizeValue");function Tv(i){let e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,r;for(;r=t.exec(i);)e[r[1]]=r[2];return e}n(Tv,"parseTokens");var Rv=n(i=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(i.trim()),"isValidHeaderName");function Zu(i,e,t,r,a){if(m.isFunction(r))return r.call(this,e,t);if(a&&(e=t),!!m.isString(e)){if(m.isString(r))return e.indexOf(r)!==-1;if(m.isRegExp(r))return r.test(e)}}n(Zu,"matchHeaderValue");function Uv(i){return i.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}n(Uv,"formatHeader");function Ov(i,e){let t=m.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(i,r+t,{value:n(function(a,s,o){return this[r].call(this,e,a,s,o)},"value"),configurable:!0})})}n(Ov,"buildAccessors");var Hr=class{static{n(this,"AxiosHeaders")}constructor(e){e&&this.set(e)}set(e,t,r){let a=this;function s(l,d,p){let h=hi(d);if(!h)throw new Error("header name must be a non-empty string");let w=m.findKey(a,h);(!w||a[w]===void 0||p===!0||p===void 0&&a[w]!==!1)&&(a[w||d]=as(l))}n(s,"setHeader");let o=n((l,d)=>m.forEach(l,(p,h)=>s(p,h,d)),"setHeaders");if(m.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(m.isString(e)&&(e=e.trim())&&!Rv(e))o(Iv(e),t);else if(m.isObject(e)&&m.isIterable(e)){let l={},d,p;for(let h of e){if(!m.isArray(h))throw TypeError("Object iterator must return a key-value pair");l[p=h[0]]=(d=l[p])?m.isArray(d)?[...d,h[1]]:[d,h[1]]:h[1]}o(l,t)}else e!=null&&s(t,e,r);return this}get(e,t){if(e=hi(e),e){let r=m.findKey(this,e);if(r){let a=this[r];if(!t)return a;if(t===!0)return Tv(a);if(m.isFunction(t))return t.call(this,a,r);if(m.isRegExp(t))return t.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=hi(e),e){let r=m.findKey(this,e);return!!(r&&this[r]!==void 0&&(!t||Zu(this,this[r],r,t)))}return!1}delete(e,t){let r=this,a=!1;function s(o){if(o=hi(o),o){let l=m.findKey(r,o);l&&(!t||Zu(r,r[l],l,t))&&(delete r[l],a=!0)}}return n(s,"deleteHeader"),m.isArray(e)?e.forEach(s):s(e),a}clear(e){let t=Object.keys(this),r=t.length,a=!1;for(;r--;){let s=t[r];(!e||Zu(this,this[s],s,e,!0))&&(delete this[s],a=!0)}return a}normalize(e){let t=this,r={};return m.forEach(this,(a,s)=>{let o=m.findKey(r,s);if(o){t[o]=as(a),delete t[s];return}let l=e?Uv(s):String(s).trim();l!==s&&delete t[s],t[l]=as(a),r[l]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return m.forEach(this,(r,a)=>{r!=null&&r!==!1&&(t[a]=e&&m.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
|
|
3
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let r=new this(e);return t.forEach(a=>r.set(a)),r}static accessor(e){let r=(this[dm]=this[dm]={accessors:{}}).accessors,a=this.prototype;function s(o){let l=hi(o);r[l]||(Ov(a,o),r[l]=!0)}return n(s,"defineAccessor"),m.isArray(e)?e.forEach(s):s(e),this}};Hr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);m.reduceDescriptors(Hr.prototype,({value:i},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:n(()=>i,"get"),set(r){this[t]=r}}});m.freezeMethods(Hr);var Xe=Hr;function Xu(i,e){let t=this||hc,r=e||t,a=Xe.from(r.headers),s=r.data;return m.forEach(i,n(function(l){s=l.call(t,s,a.normalize(),e?e.status:void 0)},"transform")),a.normalize(),s}n(Xu,"transformData");function Om(i){return!!(i&&i.__CANCEL__)}n(Om,"isCancel");var nc=class extends O{static{n(this,"CanceledError")}constructor(e,t,r){super(e??"canceled",O.ERR_CANCELED,t,r),this.name="CanceledError",this.__CANCEL__=!0}},yi=nc;function Bm(i,e,t){let r=t.config.validateStatus;!t.status||!r||r(t.status)?i(t):e(new O("Request failed with status code "+t.status,[O.ERR_BAD_REQUEST,O.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}n(Bm,"settle");function Bv(i){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(i);return e&&e[1]||""}n(Bv,"parseProtocol");function jv(i,e){i=i||10;let t=new Array(i),r=new Array(i),a=0,s=0,o;return e=e!==void 0?e:1e3,n(function(d){let p=Date.now(),h=r[s];o||(o=p),t[a]=d,r[a]=p;let w=s,E=0;for(;w!==a;)E+=t[w++],w=w%i;if(a=(a+1)%i,a===s&&(s=(s+1)%i),p-o<e)return;let P=h&&p-h;return P?Math.round(E*1e3/P):void 0},"push")}n(jv,"speedometer");function kv(i,e){let t=0,r=1e3/e,a,s,o=n((p,h=Date.now())=>{t=h,a=null,s&&(clearTimeout(s),s=null),i(...p)},"invoke");return[n((...p)=>{let h=Date.now(),w=h-t;w>=r?o(p,h):(a=p,s||(s=setTimeout(()=>{s=null,o(a)},r-w)))},"throttled"),n(()=>a&&o(a),"flush")]}n(kv,"throttle");var ls=n((i,e,t=3)=>{let r=0,a=jv(50,250);return kv(s=>{let o=s.loaded,l=s.lengthComputable?s.total:void 0,d=o-r,p=a(d),h=o<=l;r=o;let w={loaded:o,total:l,progress:l?o/l:void 0,bytes:d,rate:p||void 0,estimated:p&&l&&h?(l-o)/p:void 0,event:s,lengthComputable:l!=null,[e?"download":"upload"]:!0};i(w)},t)},"progressEventReducer"),hm=n((i,e)=>{let t=i!=null;return[r=>e[0]({lengthComputable:t,total:i,loaded:r}),e[1]]},"progressEventDecorator"),pm=n(i=>(...e)=>m.asap(()=>i(...e)),"asyncDecorator"),Mv=ve.hasStandardBrowserEnv?((i,e)=>t=>(t=new URL(t,ve.origin),i.protocol===t.protocol&&i.host===t.host&&(e||i.port===t.port)))(new URL(ve.origin),ve.navigator&&/(msie|trident)/i.test(ve.navigator.userAgent)):()=>!0,Lv=ve.hasStandardBrowserEnv?{write(i,e,t,r,a,s,o){if(typeof document>"u")return;let l=[`${i}=${encodeURIComponent(e)}`];m.isNumber(t)&&l.push(`expires=${new Date(t).toUTCString()}`),m.isString(r)&&l.push(`path=${r}`),m.isString(a)&&l.push(`domain=${a}`),s===!0&&l.push("secure"),m.isString(o)&&l.push(`SameSite=${o}`),document.cookie=l.join("; ")},read(i){if(typeof document>"u")return null;let e=document.cookie.match(new RegExp("(?:^|; )"+i+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(i){this.write(i,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Fv(i){return typeof i!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(i)}n(Fv,"isAbsoluteURL");function Nv(i,e){return e?i.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):i}n(Nv,"combineURLs");function jm(i,e,t){let r=!Fv(e);return i&&(r||t==!1)?Nv(i,e):e}n(jm,"buildFullPath");var _m=n(i=>i instanceof Xe?{...i}:i,"headersToObject");function rr(i,e){e=e||{};let t={};function r(p,h,w,E){return m.isPlainObject(p)&&m.isPlainObject(h)?m.merge.call({caseless:E},p,h):m.isPlainObject(h)?m.merge({},h):m.isArray(h)?h.slice():h}n(r,"getMergedValue");function a(p,h,w,E){if(m.isUndefined(h)){if(!m.isUndefined(p))return r(void 0,p,w,E)}else return r(p,h,w,E)}n(a,"mergeDeepProperties");function s(p,h){if(!m.isUndefined(h))return r(void 0,h)}n(s,"valueFromConfig2");function o(p,h){if(m.isUndefined(h)){if(!m.isUndefined(p))return r(void 0,p)}else return r(void 0,h)}n(o,"defaultToConfig2");function l(p,h,w){if(w in e)return r(p,h);if(w in i)return r(void 0,p)}n(l,"mergeDirectKeys");let d={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:l,headers:n((p,h,w)=>a(_m(p),_m(h),w,!0),"headers")};return m.forEach(Object.keys({...i,...e}),n(function(h){if(h==="__proto__"||h==="constructor"||h==="prototype")return;let w=m.hasOwnProp(d,h)?d[h]:a,E=w(i[h],e[h],h);m.isUndefined(E)&&w!==l||(t[h]=E)},"computeConfigValue")),t}n(rr,"mergeConfig");var km=n(i=>{let e=rr({},i),{data:t,withXSRFToken:r,xsrfHeaderName:a,xsrfCookieName:s,headers:o,auth:l}=e;if(e.headers=o=Xe.from(o),e.url=Rm(jm(e.baseURL,e.url,e.allowAbsoluteUrls),i.params,i.paramsSerializer),l&&o.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),m.isFormData(t)){if(ve.hasStandardBrowserEnv||ve.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(m.isFunction(t.getHeaders)){let d=t.getHeaders(),p=["content-type","content-length"];Object.entries(d).forEach(([h,w])=>{p.includes(h.toLowerCase())&&o.set(h,w)})}}if(ve.hasStandardBrowserEnv&&(r&&m.isFunction(r)&&(r=r(e)),r||r!==!1&&Mv(e.url))){let d=a&&s&&Lv.read(s);d&&o.set(a,d)}return e},"resolveConfig"),Qv=typeof XMLHttpRequest<"u",Gv=Qv&&function(i){return new Promise(n(function(t,r){let a=km(i),s=a.data,o=Xe.from(a.headers).normalize(),{responseType:l,onUploadProgress:d,onDownloadProgress:p}=a,h,w,E,P,y;function q(){P&&P(),y&&y(),a.cancelToken&&a.cancelToken.unsubscribe(h),a.signal&&a.signal.removeEventListener("abort",h)}n(q,"done");let v=new XMLHttpRequest;v.open(a.method.toUpperCase(),a.url,!0),v.timeout=a.timeout;function U(){if(!v)return;let z=Xe.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),Oe={data:!l||l==="text"||l==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:z,config:i,request:v};Bm(n(function(J){t(J),q()},"_resolve"),n(function(J){r(J),q()},"_reject"),Oe),v=null}n(U,"onloadend"),"onloadend"in v?v.onloadend=U:v.onreadystatechange=n(function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)||setTimeout(U)},"handleLoad"),v.onabort=n(function(){v&&(r(new O("Request aborted",O.ECONNABORTED,i,v)),v=null)},"handleAbort"),v.onerror=n(function(k){let Oe=k&&k.message?k.message:"Network Error",ft=new O(Oe,O.ERR_NETWORK,i,v);ft.event=k||null,r(ft),v=null},"handleError"),v.ontimeout=n(function(){let k=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded",Oe=a.transitional||uc;a.timeoutErrorMessage&&(k=a.timeoutErrorMessage),r(new O(k,Oe.clarifyTimeoutError?O.ETIMEDOUT:O.ECONNABORTED,i,v)),v=null},"handleTimeout"),s===void 0&&o.setContentType(null),"setRequestHeader"in v&&m.forEach(o.toJSON(),n(function(k,Oe){v.setRequestHeader(Oe,k)},"setRequestHeader")),m.isUndefined(a.withCredentials)||(v.withCredentials=!!a.withCredentials),l&&l!=="json"&&(v.responseType=a.responseType),p&&([E,y]=ls(p,!0),v.addEventListener("progress",E)),d&&v.upload&&([w,P]=ls(d),v.upload.addEventListener("progress",w),v.upload.addEventListener("loadend",P)),(a.cancelToken||a.signal)&&(h=n(z=>{v&&(r(!z||z.type?new yi(null,i,v):z),v.abort(),v=null)},"onCanceled"),a.cancelToken&&a.cancelToken.subscribe(h),a.signal&&(a.signal.aborted?h():a.signal.addEventListener("abort",h)));let be=Bv(a.url);if(be&&ve.protocols.indexOf(be)===-1){r(new O("Unsupported protocol "+be+":",O.ERR_BAD_REQUEST,i));return}v.send(s||null)},"dispatchXhrRequest"))},Wv=n((i,e)=>{let{length:t}=i=i?i.filter(Boolean):[];if(e||t){let r=new AbortController,a,s=n(function(p){if(!a){a=!0,l();let h=p instanceof Error?p:this.reason;r.abort(h instanceof O?h:new yi(h instanceof Error?h.message:h))}},"onabort"),o=e&&setTimeout(()=>{o=null,s(new O(`timeout of ${e}ms exceeded`,O.ETIMEDOUT))},e),l=n(()=>{i&&(o&&clearTimeout(o),o=null,i.forEach(p=>{p.unsubscribe?p.unsubscribe(s):p.removeEventListener("abort",s)}),i=null)},"unsubscribe");i.forEach(p=>p.addEventListener("abort",s));let{signal:d}=r;return d.unsubscribe=()=>m.asap(l),d}},"composeSignals"),Vv=Wv,$v=n(function*(i,e){let t=i.byteLength;if(!e||t<e){yield i;return}let r=0,a;for(;r<t;)a=r+e,yield i.slice(r,a),r=a},"streamChunk"),zv=n(async function*(i,e){for await(let t of Kv(i))yield*$v(t,e)},"readBytes"),Kv=n(async function*(i){if(i[Symbol.asyncIterator]){yield*i;return}let e=i.getReader();try{for(;;){let{done:t,value:r}=await e.read();if(t)break;yield r}}finally{await e.cancel()}},"readStream"),mm=n((i,e,t,r)=>{let a=zv(i,e),s=0,o,l=n(d=>{o||(o=!0,r&&r(d))},"_onFinish");return new ReadableStream({async pull(d){try{let{done:p,value:h}=await a.next();if(p){l(),d.close();return}let w=h.byteLength;if(t){let E=s+=w;t(E)}d.enqueue(new Uint8Array(h))}catch(p){throw l(p),p}},cancel(d){return l(d),a.return()}},{highWaterMark:2})},"trackStream"),ym=64*1024,{isFunction:is}=m,Jv=(({Request:i,Response:e})=>({Request:i,Response:e}))(m.global),{ReadableStream:fm,TextEncoder:gm}=m.global,bm=n((i,...e)=>{try{return!!i(...e)}catch{return!1}},"test"),Zv=n(i=>{i=m.merge.call({skipUndefined:!0},Jv,i);let{fetch:e,Request:t,Response:r}=i,a=e?is(e):typeof fetch=="function",s=is(t),o=is(r);if(!a)return!1;let l=a&&is(fm),d=a&&(typeof gm=="function"?(y=>q=>y.encode(q))(new gm):async y=>new Uint8Array(await new t(y).arrayBuffer())),p=s&&l&&bm(()=>{let y=!1,q=new t(ve.origin,{body:new fm,method:"POST",get duplex(){return y=!0,"half"}}).headers.has("Content-Type");return y&&!q}),h=o&&l&&bm(()=>m.isReadableStream(new r("").body)),w={stream:h&&(y=>y.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(y=>{!w[y]&&(w[y]=(q,v)=>{let U=q&&q[y];if(U)return U.call(q);throw new O(`Response type '${y}' is not supported`,O.ERR_NOT_SUPPORT,v)})});let E=n(async y=>{if(y==null)return 0;if(m.isBlob(y))return y.size;if(m.isSpecCompliantForm(y))return(await new t(ve.origin,{method:"POST",body:y}).arrayBuffer()).byteLength;if(m.isArrayBufferView(y)||m.isArrayBuffer(y))return y.byteLength;if(m.isURLSearchParams(y)&&(y=y+""),m.isString(y))return(await d(y)).byteLength},"getBodyLength"),P=n(async(y,q)=>{let v=m.toFiniteNumber(y.getContentLength());return v??E(q)},"resolveBodyLength");return async y=>{let{url:q,method:v,data:U,signal:be,cancelToken:z,timeout:k,onDownloadProgress:Oe,onUploadProgress:ft,responseType:J,headers:di,withCredentials:At="same-origin",fetchOptions:f}=km(y),H=e||fetch;J=J?(J+"").toLowerCase():"text";let I=Vv([be,z&&z.toAbortSignal()],k),X=null,$=I&&I.unsubscribe&&(()=>{I.unsubscribe()}),B;try{if(ft&&p&&v!=="get"&&v!=="head"&&(B=await P(di,U))!==0){let It=new t(q,{method:"POST",body:U,duplex:"half"}),wr;if(m.isFormData(U)&&(wr=It.headers.get("content-type"))&&di.setContentType(wr),It.body){let[ku,es]=hm(B,ls(pm(ft)));U=mm(It.body,ym,ku,es)}}m.isString(At)||(At=At?"include":"omit");let he=s&&"credentials"in t.prototype,Dt={...f,signal:I,method:v.toUpperCase(),headers:di.normalize().toJSON(),body:U,duplex:"half",credentials:he?At:void 0};X=s&&new t(q,Dt);let Fe=await(s?H(X,f):H(q,Dt)),J_=h&&(J==="stream"||J==="response");if(h&&(Oe||J_&&$)){let It={};["status","statusText","headers"].forEach(Z_=>{It[Z_]=Fe[Z_]});let wr=m.toFiniteNumber(Fe.headers.get("content-length")),[ku,es]=Oe&&hm(wr,ls(pm(Oe),!0))||[];Fe=new r(mm(Fe.body,ym,ku,()=>{es&&es(),$&&$()}),It)}J=J||"text";let _w=await w[m.findKey(w,J)||"text"](Fe,y);return!J_&&$&&$(),await new Promise((It,wr)=>{Bm(It,wr,{data:_w,headers:Xe.from(Fe.headers),status:Fe.status,statusText:Fe.statusText,config:y,request:X})})}catch(he){throw $&&$(),he&&he.name==="TypeError"&&/Load failed|fetch/i.test(he.message)?Object.assign(new O("Network Error",O.ERR_NETWORK,y,X,he&&he.response),{cause:he.cause||he}):O.from(he,he&&he.code,y,X,he&&he.response)}}},"factory"),Xv=new Map,Mm=n(i=>{let e=i&&i.env||{},{fetch:t,Request:r,Response:a}=e,s=[r,a,t],o=s.length,l=o,d,p,h=Xv;for(;l--;)d=s[l],p=h.get(d),p===void 0&&h.set(d,p=l?new Map:Zv(e)),h=p;return p},"getFetch");Mm();var pc={http:_v,xhr:Gv,fetch:{get:Mm}};m.forEach(pc,(i,e)=>{if(i){try{Object.defineProperty(i,"name",{value:e})}catch{}Object.defineProperty(i,"adapterName",{value:e})}});var xm=n(i=>`- ${i}`,"renderReason"),Yv=n(i=>m.isFunction(i)||i===null||i===!1,"isResolvedHandle");function eS(i,e){i=m.isArray(i)?i:[i];let{length:t}=i,r,a,s={};for(let o=0;o<t;o++){r=i[o];let l;if(a=r,!Yv(r)&&(a=pc[(l=String(r)).toLowerCase()],a===void 0))throw new O(`Unknown adapter '${l}'`);if(a&&(m.isFunction(a)||(a=a.get(e))))break;s[l||"#"+o]=a}if(!a){let o=Object.entries(s).map(([d,p])=>`adapter ${d} `+(p===!1?"is not supported by the environment":"is not available in the build")),l=t?o.length>1?`since :
|
|
4
|
+
`+o.map(xm).join(`
|
|
5
|
+
`):" "+xm(o[0]):"as no adapter specified";throw new O("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return a}n(eS,"getAdapter");var Lm={getAdapter:eS,adapters:pc};function Yu(i){if(i.cancelToken&&i.cancelToken.throwIfRequested(),i.signal&&i.signal.aborted)throw new yi(null,i)}n(Yu,"throwIfCancellationRequested");function wm(i){return Yu(i),i.headers=Xe.from(i.headers),i.data=Xu.call(i,i.transformRequest),["post","put","patch"].indexOf(i.method)!==-1&&i.headers.setContentType("application/x-www-form-urlencoded",!1),Lm.getAdapter(i.adapter||hc.adapter,i)(i).then(n(function(r){return Yu(i),r.data=Xu.call(i,i.transformResponse,r),r.headers=Xe.from(r.headers),r},"onAdapterResolution"),n(function(r){return Om(r)||(Yu(i),r&&r.response&&(r.response.data=Xu.call(i,i.transformResponse,r.response),r.response.headers=Xe.from(r.response.headers))),Promise.reject(r)},"onAdapterRejection"))}n(wm,"dispatchRequest");var Fm="1.13.5",ps={};["object","boolean","number","function","string","symbol"].forEach((i,e)=>{ps[i]=n(function(r){return typeof r===i||"a"+(e<1?"n ":" ")+i},"validator")});var vm={};ps.transitional=n(function(e,t,r){function a(s,o){return"[Axios v"+Fm+"] Transitional option '"+s+"'"+o+(r?". "+r:"")}return n(a,"formatMessage"),(s,o,l)=>{if(e===!1)throw new O(a(o," has been removed"+(t?" in "+t:"")),O.ERR_DEPRECATED);return t&&!vm[o]&&(vm[o]=!0,console.warn(a(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(s,o,l):!0}},"transitional");ps.spelling=n(function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)},"spelling");function tS(i,e,t){if(typeof i!="object")throw new O("options must be an object",O.ERR_BAD_OPTION_VALUE);let r=Object.keys(i),a=r.length;for(;a-- >0;){let s=r[a],o=e[s];if(o){let l=i[s],d=l===void 0||o(l,s,i);if(d!==!0)throw new O("option "+s+" must be "+d,O.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new O("Unknown option "+s,O.ERR_BAD_OPTION)}}n(tS,"assertOptions");var ss={assertOptions:tS,validators:ps},Ne=ss.validators,Cr=class{static{n(this,"Axios")}constructor(e){this.defaults=e||{},this.interceptors={request:new cm,response:new cm}}async request(e,t){try{return await this._request(e,t)}catch(r){if(r instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;let s=a.stack?a.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
6
|
+
`+s):r.stack=s}catch{}}throw r}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=rr(this.defaults,t);let{transitional:r,paramsSerializer:a,headers:s}=t;r!==void 0&&ss.assertOptions(r,{silentJSONParsing:Ne.transitional(Ne.boolean),forcedJSONParsing:Ne.transitional(Ne.boolean),clarifyTimeoutError:Ne.transitional(Ne.boolean),legacyInterceptorReqResOrdering:Ne.transitional(Ne.boolean)},!1),a!=null&&(m.isFunction(a)?t.paramsSerializer={serialize:a}:ss.assertOptions(a,{encode:Ne.function,serialize:Ne.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),ss.assertOptions(t,{baseUrl:Ne.spelling("baseURL"),withXsrfToken:Ne.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=s&&m.merge(s.common,s[t.method]);s&&m.forEach(["delete","get","head","post","put","patch","common"],y=>{delete s[y]}),t.headers=Xe.concat(o,s);let l=[],d=!0;this.interceptors.request.forEach(n(function(q){if(typeof q.runWhen=="function"&&q.runWhen(t)===!1)return;d=d&&q.synchronous;let v=t.transitional||uc;v&&v.legacyInterceptorReqResOrdering?l.unshift(q.fulfilled,q.rejected):l.push(q.fulfilled,q.rejected)},"unshiftRequestInterceptors"));let p=[];this.interceptors.response.forEach(n(function(q){p.push(q.fulfilled,q.rejected)},"pushResponseInterceptors"));let h,w=0,E;if(!d){let y=[wm.bind(this),void 0];for(y.unshift(...l),y.push(...p),E=y.length,h=Promise.resolve(t);w<E;)h=h.then(y[w++],y[w++]);return h}E=l.length;let P=t;for(;w<E;){let y=l[w++],q=l[w++];try{P=y(P)}catch(v){q.call(this,v);break}}try{h=wm.call(this,P)}catch(y){return Promise.reject(y)}for(w=0,E=p.length;w<E;)h=h.then(p[w++],p[w++]);return h}getUri(e){e=rr(this.defaults,e);let t=jm(e.baseURL,e.url,e.allowAbsoluteUrls);return Rm(t,e.params,e.paramsSerializer)}};m.forEach(["delete","get","head","options"],n(function(e){Cr.prototype[e]=function(t,r){return this.request(rr(r||{},{method:e,url:t,data:(r||{}).data}))}},"forEachMethodNoData"));m.forEach(["post","put","patch"],n(function(e){function t(r){return n(function(s,o,l){return this.request(rr(l||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))},"httpMethod")}n(t,"generateHTTPMethod"),Cr.prototype[e]=t(),Cr.prototype[e+"Form"]=t(!0)},"forEachMethodWithData"));var os=Cr,ac=class i{static{n(this,"CancelToken")}constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(n(function(s){t=s},"promiseExecutor"));let r=this;this.promise.then(a=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](a);r._listeners=null}),this.promise.then=a=>{let s,o=new Promise(l=>{r.subscribe(l),s=l}).then(a);return o.cancel=n(function(){r.unsubscribe(s)},"reject"),o},e(n(function(s,o,l){r.reason||(r.reason=new yi(s,o,l),t(r.reason))},"cancel"))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=n(r=>{e.abort(r)},"abort");return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new i(n(function(a){e=a},"executor")),cancel:e}}},rS=ac;function iS(i){return n(function(t){return i.apply(null,t)},"wrap")}n(iS,"spread");function nS(i){return m.isObject(i)&&i.isAxiosError===!0}n(nS,"isAxiosError");var sc={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(sc).forEach(([i,e])=>{sc[e]=i});var aS=sc;function Nm(i){let e=new os(i),t=Sm(os.prototype.request,e);return m.extend(t,os.prototype,e,{allOwnKeys:!0}),m.extend(t,e,null,{allOwnKeys:!0}),t.create=n(function(a){return Nm(rr(i,a))},"create"),t}n(Nm,"createInstance");var ae=Nm(hc);ae.Axios=os;ae.CanceledError=yi;ae.CancelToken=rS;ae.isCancel=Om;ae.VERSION=Fm;ae.toFormData=hs;ae.AxiosError=O;ae.Cancel=ae.CanceledError;ae.all=n(function(e){return Promise.all(e)},"all");ae.spread=iS;ae.isAxiosError=nS;ae.mergeConfig=rr;ae.AxiosHeaders=Xe;ae.formToJSON=i=>Um(m.isHTMLForm(i)?new FormData(i):i);ae.getAdapter=Lm.getAdapter;ae.HttpStatusCode=aS;ae.default=ae;Qm.exports=ae});var g={};bw(g,{__addDisposableResource:()=>my,__assign:()=>_s,__asyncDelegator:()=>oy,__asyncGenerator:()=>sy,__asyncValues:()=>ly,__await:()=>Er,__awaiter:()=>ey,__classPrivateFieldGet:()=>hy,__classPrivateFieldIn:()=>_y,__classPrivateFieldSet:()=>py,__createBinding:()=>ys,__decorate:()=>$m,__disposeResources:()=>yy,__esDecorate:()=>Km,__exportStar:()=>ry,__extends:()=>Wm,__generator:()=>ty,__importDefault:()=>dy,__importStar:()=>cy,__makeTemplateObject:()=>uy,__metadata:()=>Ym,__param:()=>zm,__propKey:()=>Zm,__read:()=>yc,__rest:()=>Vm,__rewriteRelativeImportExtension:()=>fy,__runInitializers:()=>Jm,__setFunctionName:()=>Xm,__spread:()=>iy,__spreadArray:()=>ay,__spreadArrays:()=>ny,__values:()=>ms,default:()=>lS});function Wm(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");_c(i,e);function t(){this.constructor=i}n(t,"__"),i.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Vm(i,e){var t={};for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&e.indexOf(r)<0&&(t[r]=i[r]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(i);a<r.length;a++)e.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(i,r[a])&&(t[r[a]]=i[r[a]]);return t}function $m(i,e,t,r){var a=arguments.length,s=a<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,r);else for(var l=i.length-1;l>=0;l--)(o=i[l])&&(s=(a<3?o(s):a>3?o(e,t,s):o(e,t))||s);return a>3&&s&&Object.defineProperty(e,t,s),s}function zm(i,e){return function(t,r){e(t,r,i)}}function Km(i,e,t,r,a,s){function o(U){if(U!==void 0&&typeof U!="function")throw new TypeError("Function expected");return U}n(o,"accept");for(var l=r.kind,d=l==="getter"?"get":l==="setter"?"set":"value",p=!e&&i?r.static?i:i.prototype:null,h=e||(p?Object.getOwnPropertyDescriptor(p,r.name):{}),w,E=!1,P=t.length-1;P>=0;P--){var y={};for(var q in r)y[q]=q==="access"?{}:r[q];for(var q in r.access)y.access[q]=r.access[q];y.addInitializer=function(U){if(E)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(U||null))};var v=(0,t[P])(l==="accessor"?{get:h.get,set:h.set}:h[d],y);if(l==="accessor"){if(v===void 0)continue;if(v===null||typeof v!="object")throw new TypeError("Object expected");(w=o(v.get))&&(h.get=w),(w=o(v.set))&&(h.set=w),(w=o(v.init))&&a.unshift(w)}else(w=o(v))&&(l==="field"?a.unshift(w):h[d]=w)}p&&Object.defineProperty(p,r.name,h),E=!0}function Jm(i,e,t){for(var r=arguments.length>2,a=0;a<e.length;a++)t=r?e[a].call(i,t):e[a].call(i);return r?t:void 0}function Zm(i){return typeof i=="symbol"?i:"".concat(i)}function Xm(i,e,t){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(i,"name",{configurable:!0,value:t?"".concat(t," ",e):e})}function Ym(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)}function ey(i,e,t,r){function a(s){return s instanceof t?s:new t(function(o){o(s)})}return n(a,"adopt"),new(t||(t=Promise))(function(s,o){function l(h){try{p(r.next(h))}catch(w){o(w)}}n(l,"fulfilled");function d(h){try{p(r.throw(h))}catch(w){o(w)}}n(d,"rejected");function p(h){h.done?s(h.value):a(h.value).then(l,d)}n(p,"step"),p((r=r.apply(i,e||[])).next())})}function ty(i,e){var t={label:0,sent:n(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},r,a,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=l(0),o.throw=l(1),o.return=l(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(p){return function(h){return d([p,h])}}function d(p){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,p[0]&&(t=0)),t;)try{if(r=1,a&&(s=p[0]&2?a.return:p[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,p[1])).done)return s;switch(a=0,s&&(p=[p[0]&2,s.value]),p[0]){case 0:case 1:s=p;break;case 4:return t.label++,{value:p[1],done:!1};case 5:t.label++,a=p[1],p=[0];continue;case 7:p=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(p[0]===6||p[0]===2)){t=0;continue}if(p[0]===3&&(!s||p[1]>s[0]&&p[1]<s[3])){t.label=p[1];break}if(p[0]===6&&t.label<s[1]){t.label=s[1],s=p;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(p);break}s[2]&&t.ops.pop(),t.trys.pop();continue}p=e.call(i,t)}catch(h){p=[6,h],a=0}finally{r=s=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}function ry(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&ys(e,i,t)}function ms(i){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&i[e],r=0;if(t)return t.call(i);if(i&&typeof i.length=="number")return{next:n(function(){return i&&r>=i.length&&(i=void 0),{value:i&&i[r++],done:!i}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function yc(i,e){var t=typeof Symbol=="function"&&i[Symbol.iterator];if(!t)return i;var r=t.call(i),a,s=[],o;try{for(;(e===void 0||e-- >0)&&!(a=r.next()).done;)s.push(a.value)}catch(l){o={error:l}}finally{try{a&&!a.done&&(t=r.return)&&t.call(r)}finally{if(o)throw o.error}}return s}function iy(){for(var i=[],e=0;e<arguments.length;e++)i=i.concat(yc(arguments[e]));return i}function ny(){for(var i=0,e=0,t=arguments.length;e<t;e++)i+=arguments[e].length;for(var r=Array(i),a=0,e=0;e<t;e++)for(var s=arguments[e],o=0,l=s.length;o<l;o++,a++)r[a]=s[o];return r}function ay(i,e,t){if(t||arguments.length===2)for(var r=0,a=e.length,s;r<a;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return i.concat(s||Array.prototype.slice.call(e))}function Er(i){return this instanceof Er?(this.v=i,this):new Er(i)}function sy(i,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(i,e||[]),a,s=[];return a=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),l("next"),l("throw"),l("return",o),a[Symbol.asyncIterator]=function(){return this},a;function o(P){return function(y){return Promise.resolve(y).then(P,w)}}function l(P,y){r[P]&&(a[P]=function(q){return new Promise(function(v,U){s.push([P,q,v,U])>1||d(P,q)})},y&&(a[P]=y(a[P])))}function d(P,y){try{p(r[P](y))}catch(q){E(s[0][3],q)}}function p(P){P.value instanceof Er?Promise.resolve(P.value.v).then(h,w):E(s[0][2],P)}function h(P){d("next",P)}function w(P){d("throw",P)}function E(P,y){P(y),s.shift(),s.length&&d(s[0][0],s[0][1])}}function oy(i){var e,t;return e={},r("next"),r("throw",function(a){throw a}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(a,s){e[a]=i[a]?function(o){return(t=!t)?{value:Er(i[a](o)),done:!1}:s?s(o):o}:s}}function ly(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=i[Symbol.asyncIterator],t;return e?e.call(i):(i=typeof ms=="function"?ms(i):i[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(s){t[s]=i[s]&&function(o){return new Promise(function(l,d){o=i[s](o),a(l,d,o.done,o.value)})}}function a(s,o,l,d){Promise.resolve(d).then(function(p){s({value:p,done:l})},o)}}function uy(i,e){return Object.defineProperty?Object.defineProperty(i,"raw",{value:e}):i.raw=e,i}function cy(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t=mc(i),r=0;r<t.length;r++)t[r]!=="default"&&ys(e,i,t[r]);return sS(e,i),e}function dy(i){return i&&i.__esModule?i:{default:i}}function hy(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)}function py(i,e,t,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!a:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(i,t):a?a.value=t:e.set(i,t),t}function _y(i,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof i=="function"?e===i:i.has(e)}function my(i,e,t){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var r,a;if(t){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=e[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=e[Symbol.dispose],t&&(a=r)}if(typeof r!="function")throw new TypeError("Object not disposable.");a&&(r=n(function(){try{a.call(this)}catch(s){return Promise.reject(s)}},"dispose")),i.stack.push({value:e,dispose:r,async:t})}else t&&i.stack.push({async:!0});return e}function yy(i){function e(s){i.error=i.hasError?new oS(s,i.error,"An error was suppressed during disposal."):s,i.hasError=!0}n(e,"fail");var t,r=0;function a(){for(;t=i.stack.pop();)try{if(!t.async&&r===1)return r=0,i.stack.push(t),Promise.resolve().then(a);if(t.dispose){var s=t.dispose.call(t.value);if(t.async)return r|=2,Promise.resolve(s).then(a,function(o){return e(o),a()})}else r|=1}catch(o){e(o)}if(r===1)return i.hasError?Promise.reject(i.error):Promise.resolve();if(i.hasError)throw i.error}return n(a,"next"),a()}function fy(i,e){return typeof i=="string"&&/^\.\.?\//.test(i)?i.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(t,r,a,s,o){return r?e?".jsx":".js":a&&(!s||!o)?t:a+s+"."+o.toLowerCase()+"js"}):i}var _c,_s,ys,sS,mc,oS,lS,b=gw(()=>{_c=n(function(i,e){return _c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])},_c(i,e)},"extendStatics");n(Wm,"__extends");_s=n(function(){return _s=Object.assign||n(function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},"__assign"),_s.apply(this,arguments)},"__assign");n(Vm,"__rest");n($m,"__decorate");n(zm,"__param");n(Km,"__esDecorate");n(Jm,"__runInitializers");n(Zm,"__propKey");n(Xm,"__setFunctionName");n(Ym,"__metadata");n(ey,"__awaiter");n(ty,"__generator");ys=Object.create?(function(i,e,t,r){r===void 0&&(r=t);var a=Object.getOwnPropertyDescriptor(e,t);(!a||("get"in a?!e.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:n(function(){return e[t]},"get")}),Object.defineProperty(i,r,a)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]});n(ry,"__exportStar");n(ms,"__values");n(yc,"__read");n(iy,"__spread");n(ny,"__spreadArrays");n(ay,"__spreadArray");n(Er,"__await");n(sy,"__asyncGenerator");n(oy,"__asyncDelegator");n(ly,"__asyncValues");n(uy,"__makeTemplateObject");sS=Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e},mc=n(function(i){return mc=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},mc(i)},"ownKeys");n(cy,"__importStar");n(dy,"__importDefault");n(hy,"__classPrivateFieldGet");n(py,"__classPrivateFieldSet");n(_y,"__classPrivateFieldIn");n(my,"__addDisposableResource");oS=typeof SuppressedError=="function"?SuppressedError:function(i,e,t){var r=new Error(t);return r.name="SuppressedError",r.error=i,r.suppressed=e,r};n(yy,"__disposeResources");n(fy,"__rewriteRelativeImportExtension");lS={__extends:Wm,__assign:_s,__rest:Vm,__decorate:$m,__param:zm,__esDecorate:Km,__runInitializers:Jm,__propKey:Zm,__setFunctionName:Xm,__metadata:Ym,__awaiter:ey,__generator:ty,__createBinding:ys,__exportStar:ry,__values:ms,__read:yc,__spread:iy,__spreadArrays:ny,__spreadArray:ay,__await:Er,__asyncGenerator:sy,__asyncDelegator:oy,__asyncValues:ly,__makeTemplateObject:uy,__importStar:cy,__importDefault:dy,__classPrivateFieldGet:hy,__classPrivateFieldSet:py,__classPrivateFieldIn:_y,__addDisposableResource:my,__disposeResources:yy,__rewriteRelativeImportExtension:fy}});var fi=u((xU,gy)=>{gy.exports.isNode=!1});var ir=u(Ut=>{"use strict";var Rt;Object.defineProperty(Ut,"__esModule",{value:!0});Ut.LogLevelToConsoleFunction=Ut.resolveLogLevel=Ut.LogLevel=void 0;var uS=fi(),Ee;(function(i){i[i.CRITICAL=0]="CRITICAL",i[i.ERROR=1]="ERROR",i[i.WARNING=2]="WARNING",i[i.INFO=3]="INFO",i[i.DEBUG=4]="DEBUG",i[i.TRACE=7]="TRACE"})(Ee||(Ee={}));Ut.LogLevel=Ee;function cS(i){if(typeof i=="number"){if(Object.prototype.hasOwnProperty.call(Ee,i))return i;var e=Object.keys(Ee).map(function(r){return parseInt(r,10)}).filter(function(r){return!isNaN(r)&&r<i});return e.length?Math.max.apply(Math,e):Ee.WARNING}var t=i.replace(/\d+$/,"").toUpperCase();if(!Object.prototype.hasOwnProperty.call(Ee,t))throw new Error("Unknown log level string: ".concat(i));return Ee[t]}n(cS,"resolveLogLevel");Ut.resolveLogLevel=cS;var dS=uS.isNode?console.log.bind(console):console.debug.bind(console);Ut.LogLevelToConsoleFunction=(Rt={},Rt[Ee.CRITICAL]=console.error.bind(console),Rt[Ee.ERROR]=console.error.bind(console),Rt[Ee.WARNING]=console.warn.bind(console),Rt[Ee.INFO]=console.info.bind(console),Rt[Ee.DEBUG]=dS.bind(console),Rt[Ee.TRACE]=console.trace.bind(console),Rt)});var by=u(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});fs.Enumerable=void 0;function hS(i){return i===void 0&&(i=!0),function(e,t){Object.defineProperty(e,t,{get:n(function(){},"get"),set:n(function(r){Object.defineProperty(this,t,{value:r,writable:!0,enumerable:i})},"set"),enumerable:i})}}n(hS,"Enumerable");fs.Enumerable=hS});var wy=u(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.flatten=void 0;var xy=(b(),x(g));function pS(i){var e;return(e=[]).concat.apply(e,xy.__spreadArray([],xy.__read(i),!1))}n(pS,"flatten");gs.flatten=pS});var vy=u(bs=>{"use strict";Object.defineProperty(bs,"__esModule",{value:!0});bs.immutableSplice=void 0;var Pr=(b(),x(g));function _S(i,e,t){for(var r=[],a=3;a<arguments.length;a++)r[a-3]=arguments[a];return Pr.__spreadArray(Pr.__spreadArray(Pr.__spreadArray([],Pr.__read(i.slice(0,e)),!1),Pr.__read(r),!1),Pr.__read(i.slice(e+t)),!1)}n(_S,"immutableSplice");bs.immutableSplice=_S});var Sy=u(xs=>{"use strict";Object.defineProperty(xs,"__esModule",{value:!0});xs.partitionedFlatMap=void 0;var fc=(b(),x(g));function mS(i,e,t){var r,a,s,o={};try{for(var l=fc.__values(i),d=l.next();!d.done;d=l.next()){var p=d.value,h=e(p),w=t(p);Array.isArray(w)||(w=[w]),Object.prototype.hasOwnProperty.call(o,h)?(s=o[h]).push.apply(s,fc.__spreadArray([],fc.__read(w),!1)):o[h]=w}}catch(E){r={error:E}}finally{try{d&&!d.done&&(a=l.return)&&a.call(l)}finally{if(r)throw r.error}}return o}n(mS,"partitionedFlatMap");xs.partitionedFlatMap=mS});var Cy=u(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});Ar.resolveConfigValueSync=Ar.resolveConfigValue=void 0;var Hy=(b(),x(g));function yS(i){return Hy.__awaiter(this,void 0,void 0,function(){return Hy.__generator(this,function(e){switch(e.label){case 0:return typeof i!="function"?[3,2]:[4,i()];case 1:return[2,e.sent()];case 2:return[2,i]}})})}n(yS,"resolveConfigValue");Ar.resolveConfigValue=yS;function fS(i){return typeof i=="function"?i():i}n(fS,"resolveConfigValueSync");Ar.resolveConfigValueSync=fS});var qy=u(ws=>{"use strict";Object.defineProperty(ws,"__esModule",{value:!0});ws.deprecateClass=void 0;var gc=(b(),x(g));function gS(i,e){var t=!1;return(function(r){gc.__extends(a,r);function a(){for(var s=[],o=0;o<arguments.length;o++)s[o]=arguments[o];return t||(console.warn(e),t=!0),r.apply(this,gc.__spreadArray([],gc.__read(s),!1))||this}return n(a,"class_1"),a})(i)}n(gS,"deprecateClass");ws.deprecateClass=gS});var Py=u(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.match=nr.eq=void 0;var Ey=n(function(i){return{otherwise:n(function(){return i},"otherwise"),on:n(function(){return Ey(i)},"on")}},"matched"),bc=n(function(i){return{on:n(function(e,t){return e(i)?Ey(t(i)):bc(i)},"on"),otherwise:n(function(e){return e(i)},"otherwise")}},"match");nr.match=bc;var bS=n(function(i){return function(e){return i===e}},"eq");nr.eq=bS;bc.eq=nr.eq});var Dy=u(vs=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});vs.fibWithLimit=void 0;var Ay=(b(),x(g));function xS(i){var e,t,r;return Ay.__generator(this,function(a){switch(a.label){case 0:e=0,t=1,a.label=1;case 1:return e<i?[4,e]:[3,3];case 2:return a.sent(),r=Ay.__read([t,e+t],2),e=r[0],t=r[1],[3,1];case 3:return[4,i];case 4:return a.sent(),[3,3];case 5:return[2]}})}n(xS,"fibWithLimit");vs.fibWithLimit=xS});var Hs=u(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});Ss.arrayToObject=void 0;var Iy=(b(),x(g));function wS(i,e){return Object.assign.apply(Object,Iy.__spreadArray([{}],Iy.__read(i.map(e)),!1))}n(wS,"arrayToObject");Ss.arrayToObject=wS});var Ty=u(Cs=>{"use strict";Object.defineProperty(Cs,"__esModule",{value:!0});Cs.entriesToObject=void 0;var vS=(b(),x(g)),SS=Hs();function HS(i){return(0,SS.arrayToObject)(i,function(e){var t,r=vS.__read(e,2),a=r[0],s=r[1];return t={},t[a]=s,t})}n(HS,"entriesToObject");Cs.entriesToObject=HS});var Ry=u(qs=>{"use strict";Object.defineProperty(qs,"__esModule",{value:!0});qs.forEachObjectEntry=void 0;var CS=(b(),x(g));function qS(i,e){Object.entries(i).forEach(function(t){var r=CS.__read(t,2),a=r[0],s=r[1];return e(s,a)})}n(qS,"forEachObjectEntry");qs.forEachObjectEntry=qS});var Uy=u(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.groupBy=void 0;var ES=(b(),x(g));function PS(i,e){var t,r,a;if(typeof e!="function"){var s=e;e=n((function(w){return w[s].toString()}),"keyFn")}var o={};try{for(var l=ES.__values(i),d=l.next();!d.done;d=l.next()){var p=d.value,h=e(p);((a=o[h])!==null&&a!==void 0?a:o[h]=[]).push(p)}}catch(w){t={error:w}}finally{try{d&&!d.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}return o}n(PS,"groupBy");Es.groupBy=PS});var Oy=u(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});Ps.indexBy=void 0;var AS=Hs();function DS(i,e){if(typeof e!="function"){var t=e;e=n((function(r){return r[t].toString()}),"keyFn")}return(0,AS.arrayToObject)(i,function(r){var a;return a={},a[e(r)]=r,a})}n(DS,"indexBy");Ps.indexBy=DS});var By=u(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.mapObject=void 0;var xc=(b(),x(g));function IS(i,e){var t=Object.entries(i).map(function(r){var a,s=xc.__read(r,2),o=s[0],l=s[1];return a={},a[o]=e(l,o),a});return Object.assign.apply(Object,xc.__spreadArray([{}],xc.__read(t),!1))}n(IS,"mapObject");As.mapObject=IS});var wc=u(Is=>{"use strict";Object.defineProperty(Is,"__esModule",{value:!0});Is.pick=void 0;var Ds=(b(),x(g));function TS(i,e){return Object.assign.apply(Object,Ds.__spreadArray([{}],Ds.__read(Object.entries(i).filter(function(t){var r=Ds.__read(t,1),a=r[0];return e.includes(a)}).map(function(t){var r,a=Ds.__read(t,2),s=a[0],o=a[1];return r={},r[s]=o,r})),!1))}n(TS,"pick");Is.pick=TS});var jy=u(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.omit=void 0;var RS=wc();function US(i,e){return(0,RS.pick)(i,Object.keys(i).filter(function(t){return!e.includes(t)}))}n(US,"omit");Ts.omit=US});var ky=u(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.mapOptional=Ot.mapNullable=Ot.isNullish=void 0;function vc(i){return i==null}n(vc,"isNullish");Ot.isNullish=vc;function OS(i,e){return vc(i)?null:e(i)}n(OS,"mapNullable");Ot.mapNullable=OS;function BS(i,e){return vc(i)?void 0:e(i)}n(BS,"mapOptional");Ot.mapOptional=BS});var Ly=u(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.delay=void 0;var My=(b(),x(g));function jS(i){return My.__awaiter(this,void 0,void 0,function(){return My.__generator(this,function(e){switch(e.label){case 0:return[4,new Promise(function(t){return setTimeout(t,i)})];case 1:return e.sent(),[2]}})})}n(jS,"delay");Rs.delay=jS});var Fy=u(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});Us.promiseWithResolvers=void 0;function kS(){var i,e,t=new Promise(function(r,a){i=r,e=a});return{promise:t,resolve:i,reject:e}}n(kS,"promiseWithResolvers");Us.promiseWithResolvers=kS});var Ny=u(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.padLeft=void 0;function MS(i,e,t){if(typeof i=="number"&&(i=i.toString()),e=e-i.length,e<=0)return i;t===void 0&&(t=" ");var r="";do(e&1)===1&&(r+=t),e>>=1,e&&(t+=t);while(e);return r+i}n(MS,"padLeft");Os.padLeft=MS});var Qy=u(Bs=>{"use strict";Object.defineProperty(Bs,"__esModule",{value:!0});Bs.splitWithLimit=void 0;var Sc=(b(),x(g));function LS(i,e,t){var r=i.split(e);return r.length<=t?r:Sc.__spreadArray(Sc.__spreadArray([],Sc.__read(r.slice(0,t-1)),!1),[r.slice(t-1).join(e)],!1)}n(LS,"splitWithLimit");Bs.splitWithLimit=LS});var Gy=u(Dr=>{"use strict";Object.defineProperty(Dr,"__esModule",{value:!0});Dr.utf8Substring=Dr.utf8Length=void 0;var js=(b(),x(g));function FS(i){return js.__spreadArray([],js.__read(i),!1).length}n(FS,"utf8Length");Dr.utf8Length=FS;function NS(i,e,t){return js.__spreadArray([],js.__read(i),!1).slice(e,t).join("")}n(NS,"utf8Substring");Dr.utf8Substring=NS});var C=u(A=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0});A.utf8Substring=A.utf8Length=A.splitWithLimit=A.padLeft=A.promiseWithResolvers=A.delay=A.mapOptional=A.mapNullable=A.isNullish=A.pick=A.omit=A.mapObject=A.indexBy=A.groupBy=A.forEachObjectEntry=A.entriesToObject=A.arrayToObject=A.fibWithLimit=A.eq=A.match=A.deprecateClass=A.resolveConfigValueSync=A.resolveConfigValue=A.partitionedFlatMap=A.immutableSplice=A.flatten=A.Enumerable=void 0;var QS=by();Object.defineProperty(A,"Enumerable",{enumerable:!0,get:n(function(){return QS.Enumerable},"get")});var GS=wy();Object.defineProperty(A,"flatten",{enumerable:!0,get:n(function(){return GS.flatten},"get")});var WS=vy();Object.defineProperty(A,"immutableSplice",{enumerable:!0,get:n(function(){return WS.immutableSplice},"get")});var VS=Sy();Object.defineProperty(A,"partitionedFlatMap",{enumerable:!0,get:n(function(){return VS.partitionedFlatMap},"get")});var Wy=Cy();Object.defineProperty(A,"resolveConfigValue",{enumerable:!0,get:n(function(){return Wy.resolveConfigValue},"get")});Object.defineProperty(A,"resolveConfigValueSync",{enumerable:!0,get:n(function(){return Wy.resolveConfigValueSync},"get")});var $S=qy();Object.defineProperty(A,"deprecateClass",{enumerable:!0,get:n(function(){return $S.deprecateClass},"get")});var Vy=Py();Object.defineProperty(A,"match",{enumerable:!0,get:n(function(){return Vy.match},"get")});Object.defineProperty(A,"eq",{enumerable:!0,get:n(function(){return Vy.eq},"get")});var zS=Dy();Object.defineProperty(A,"fibWithLimit",{enumerable:!0,get:n(function(){return zS.fibWithLimit},"get")});var KS=Hs();Object.defineProperty(A,"arrayToObject",{enumerable:!0,get:n(function(){return KS.arrayToObject},"get")});var JS=Ty();Object.defineProperty(A,"entriesToObject",{enumerable:!0,get:n(function(){return JS.entriesToObject},"get")});var ZS=Ry();Object.defineProperty(A,"forEachObjectEntry",{enumerable:!0,get:n(function(){return ZS.forEachObjectEntry},"get")});var XS=Uy();Object.defineProperty(A,"groupBy",{enumerable:!0,get:n(function(){return XS.groupBy},"get")});var YS=Oy();Object.defineProperty(A,"indexBy",{enumerable:!0,get:n(function(){return YS.indexBy},"get")});var e0=By();Object.defineProperty(A,"mapObject",{enumerable:!0,get:n(function(){return e0.mapObject},"get")});var t0=jy();Object.defineProperty(A,"omit",{enumerable:!0,get:n(function(){return t0.omit},"get")});var r0=wc();Object.defineProperty(A,"pick",{enumerable:!0,get:n(function(){return r0.pick},"get")});var Hc=ky();Object.defineProperty(A,"isNullish",{enumerable:!0,get:n(function(){return Hc.isNullish},"get")});Object.defineProperty(A,"mapNullable",{enumerable:!0,get:n(function(){return Hc.mapNullable},"get")});Object.defineProperty(A,"mapOptional",{enumerable:!0,get:n(function(){return Hc.mapOptional},"get")});var i0=Ly();Object.defineProperty(A,"delay",{enumerable:!0,get:n(function(){return i0.delay},"get")});var n0=Fy();Object.defineProperty(A,"promiseWithResolvers",{enumerable:!0,get:n(function(){return n0.promiseWithResolvers},"get")});var a0=Ny();Object.defineProperty(A,"padLeft",{enumerable:!0,get:n(function(){return a0.padLeft},"get")});var s0=Qy();Object.defineProperty(A,"splitWithLimit",{enumerable:!0,get:n(function(){return s0.splitWithLimit},"get")});var $y=Gy();Object.defineProperty(A,"utf8Length",{enumerable:!0,get:n(function(){return $y.utf8Length},"get")});Object.defineProperty(A,"utf8Substring",{enumerable:!0,get:n(function(){return $y.utf8Substring},"get")})});var Pc=u(Ms=>{"use strict";var Cc,qc;Object.defineProperty(Ms,"__esModule",{value:!0});Ms.getMinLogLevelFromEnv=void 0;var o0=ir(),ks=typeof process>"u"?[]:(qc=(Cc=process.env.LOGGING)===null||Cc===void 0?void 0:Cc.split(";").map(function(i){var e=i.split("=",2),t=e[0],r=e[1];return r?[t==="default"?void 0:t.split(":"),(0,o0.resolveLogLevel)(r)]:null}).filter(function(i){return!!i}).sort(function(i,e){var t,r,a=i[0],s=e[0];return((t=s?.length)!==null&&t!==void 0?t:0)-((r=a?.length)!==null&&r!==void 0?r:0)}))!==null&&qc!==void 0?qc:[],Ec=ks.findIndex(function(i){var e=i[0];return!e}),zy=void 0;Ec!==-1&&(zy=ks[Ec][1],ks.splice(Ec));function l0(i,e){return e.length<=i.length&&e.every(function(t,r){return t===i[r]})}n(l0,"isPrefix");function u0(i){for(var e=i.split(":"),t=0,r=ks;t<r.length;t++){var a=r[t],s=a[0],o=a[1];if(l0(e,s))return o}return zy}n(u0,"getMinLogLevelFromEnv");Ms.getMinLogLevelFromEnv=u0});var Ac=u(Ls=>{"use strict";Object.defineProperty(Ls,"__esModule",{value:!0});Ls.BaseLogger=void 0;var c0=C(),d0=fi(),h0=Pc(),Bt=ir(),p0=(function(){function i(e){var t=e.name,r=e.minLevel,a=e.emoji,s=a===void 0?!1:a,o=e.colors,l=e.timestamps,d=l===void 0?d0.isNode:l,p,h;this._name=t,this._minLevel=(h=(p=(0,c0.mapOptional)(r,function(w){return(0,Bt.resolveLogLevel)(w)}))!==null&&p!==void 0?p:(0,h0.getMinLogLevelFromEnv)(t))!==null&&h!==void 0?h:Bt.LogLevel.WARNING,this._emoji=s,this._colors=o,this._timestamps=d}return n(i,"BaseLogger"),i.prototype.crit=function(e){this.log(Bt.LogLevel.CRITICAL,e)},i.prototype.error=function(e){this.log(Bt.LogLevel.ERROR,e)},i.prototype.warn=function(e){this.log(Bt.LogLevel.WARNING,e)},i.prototype.info=function(e){this.log(Bt.LogLevel.INFO,e)},i.prototype.debug=function(e){this.log(Bt.LogLevel.DEBUG,e)},i.prototype.trace=function(e){this.log(Bt.LogLevel.TRACE,e)},i})();Ls.BaseLogger=p0});var Ky=u(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});Fs.BrowserLogger=void 0;var _0=(b(),x(g)),m0=ir(),y0=Ac(),f0=(function(i){_0.__extends(e,i);function e(){return i!==null&&i.apply(this,arguments)||this}return n(e,"BrowserLogger"),e.prototype.log=function(t,r){if(!(t>this._minLevel)){var a=m0.LogLevelToConsoleFunction[t],s="[".concat(this._name,"] ").concat(r);this._timestamps&&(s="[".concat(new Date().toISOString(),"] ").concat(r)),a(s)}},e})(y0.BaseLogger);Fs.BrowserLogger=f0});var Jy=u(Ns=>{"use strict";Object.defineProperty(Ns,"__esModule",{value:!0});Ns.CustomLoggerWrapper=void 0;var g0=C(),b0=Pc(),Be=ir(),x0=(function(){function i(e){var t=e.name,r=e.minLevel,a=e.custom,s;this._minLevel=(s=(0,g0.mapOptional)(r,function(o){return(0,Be.resolveLogLevel)(o)}))!==null&&s!==void 0?s:(0,b0.getMinLogLevelFromEnv)(t),this._override=typeof a=="function"?{log:a}:a}return n(i,"CustomLoggerWrapper"),i.prototype.log=function(e,t){this._shouldLog(e)&&this._override.log(e,t)},i.prototype.crit=function(e){this._override.crit?this._shouldLog(Be.LogLevel.CRITICAL)&&this._override.crit(e):this.log(Be.LogLevel.CRITICAL,e)},i.prototype.error=function(e){this._override.error?this._shouldLog(Be.LogLevel.ERROR)&&this._override.error(e):this.log(Be.LogLevel.ERROR,e)},i.prototype.warn=function(e){this._override.warn?this._shouldLog(Be.LogLevel.WARNING)&&this._override.warn(e):this.log(Be.LogLevel.WARNING,e)},i.prototype.info=function(e){this._override.info?this._shouldLog(Be.LogLevel.INFO)&&this._override.info(e):this.log(Be.LogLevel.INFO,e)},i.prototype.debug=function(e){this._override.debug?this._shouldLog(Be.LogLevel.DEBUG)&&this._override.debug(e):this.log(Be.LogLevel.DEBUG,e)},i.prototype.trace=function(e){this._override.trace?this._shouldLog(Be.LogLevel.TRACE)&&this._override.trace(e):this.log(Be.LogLevel.TRACE,e)},i.prototype._shouldLog=function(e){return this._minLevel===void 0||this._minLevel>=e},i})();Ns.CustomLoggerWrapper=x0});var Zy=u(Pe=>{"use strict";var jt,kt,Mt;Object.defineProperty(Pe,"__esModule",{value:!0});Pe.NodeLogger=Pe.LogLevelToBackgroundColor=Pe.LogLevelToColor=Pe.LogLevelToEmoji=void 0;var w0=(b(),x(g)),ne=ir(),v0=Ac();Pe.LogLevelToEmoji=(jt={},jt[ne.LogLevel.CRITICAL]="\u{1F6D1}",jt[ne.LogLevel.ERROR]="\u274C",jt[ne.LogLevel.WARNING]="\u26A0\uFE0F ",jt[ne.LogLevel.INFO]="\u2139\uFE0F ",jt[ne.LogLevel.DEBUG]="\u{1F41E}",jt[ne.LogLevel.TRACE]="\u{1F43E}",jt);var S0={black:30,red:31,green:32,yellow:33,blue:34,magenta:35,cyan:36,white:37,blackBright:90,redBright:91,greenBright:92,yellowBright:93,blueBright:94,magentaBright:95,cyanBright:96,whiteBright:97},H0={bgBlack:40,bgRed:41,bgGreen:42,bgYellow:43,bgBlue:44,bgMagenta:45,bgCyan:46,bgWhite:47,bgBlackBright:100,bgRedBright:101,bgGreenBright:102,bgYellowBright:103,bgBlueBright:104,bgMagentaBright:105,bgCyanBright:106,bgWhiteBright:107};function Qs(i,e,t){return function(r){return"\x1B[".concat(i,"m").concat(t?t(r):r,"\x1B[").concat(e,"m")}}n(Qs,"createGenericWrapper");function ot(i){return Qs(S0[i],39)}n(ot,"createColorWrapper");function gi(i,e){return Qs(H0[i],49,e)}n(gi,"createBgWrapper");Pe.LogLevelToColor=(kt={},kt[ne.LogLevel.CRITICAL]=ot("red"),kt[ne.LogLevel.ERROR]=ot("redBright"),kt[ne.LogLevel.WARNING]=ot("yellow"),kt[ne.LogLevel.INFO]=ot("blue"),kt[ne.LogLevel.DEBUG]=ot("magenta"),kt[ne.LogLevel.TRACE]=Qs(0,0),kt);Pe.LogLevelToBackgroundColor=(Mt={},Mt[ne.LogLevel.CRITICAL]=gi("bgRed",ot("white")),Mt[ne.LogLevel.ERROR]=gi("bgRedBright",ot("white")),Mt[ne.LogLevel.WARNING]=gi("bgYellow",ot("black")),Mt[ne.LogLevel.INFO]=gi("bgBlue",ot("white")),Mt[ne.LogLevel.DEBUG]=gi("bgMagenta",ot("black")),Mt[ne.LogLevel.TRACE]=Qs(7,27),Mt);var C0=(function(i){w0.__extends(e,i);function e(){return i!==null&&i.apply(this,arguments)||this}return n(e,"NodeLogger"),e.prototype.log=function(t,r){var a,s,o;if(!(t>this._minLevel)){var l=ne.LogLevelToConsoleFunction[t],d="";if(this._timestamps&&(d+="[".concat(new Date().toISOString(),"] ")),this._emoji){var p=Pe.LogLevelToEmoji[t];d+="".concat(p," ")}var h=(o=(a=this._colors)!==null&&a!==void 0?a:(s=process.stdout)===null||s===void 0?void 0:s.isTTY)!==null&&o!==void 0?o:!0;h?d+="".concat(Pe.LogLevelToBackgroundColor[t](this._name)," ").concat(Pe.LogLevelToBackgroundColor[t](ne.LogLevel[t])," ").concat(Pe.LogLevelToColor[t](r)):d+="[".concat(this._name,":").concat(ne.LogLevel[t].toLowerCase(),"] ").concat(r),l(d)}},e})(v0.BaseLogger);Pe.NodeLogger=C0});var Xy=u(Gs=>{"use strict";Object.defineProperty(Gs,"__esModule",{value:!0});Gs.createLogger=void 0;var q0=fi(),E0=Ky(),P0=Jy(),A0=Zy();function D0(i){return i.custom?new P0.CustomLoggerWrapper(i):q0.isNode?new A0.NodeLogger(i):new E0.BrowserLogger(i)}n(D0,"createLogger");Gs.createLogger=D0});var bi=u(Ir=>{"use strict";Object.defineProperty(Ir,"__esModule",{value:!0});Ir.LogLevel=Ir.createLogger=void 0;var I0=Xy();Object.defineProperty(Ir,"createLogger",{enumerable:!0,get:n(function(){return I0.createLogger},"get")});var T0=ir();Object.defineProperty(Ir,"LogLevel",{enumerable:!0,get:n(function(){return T0.LogLevel},"get")})});var Vs=u(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});Ws.CustomError=void 0;var Dc=class extends Error{static{n(this,"CustomError")}constructor(...e){var t;super(...e),Object.setPrototypeOf(this,new.target.prototype),(t=Error.captureStackTrace)===null||t===void 0||t.call(Error,this,new.target.constructor)}get name(){return this.constructor.name}};Ws.CustomError=Dc});var zs=u($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});$s.RateLimiterDestroyedError=void 0;var R0=Vs(),Ic=class extends R0.CustomError{static{n(this,"RateLimiterDestroyedError")}};$s.RateLimiterDestroyedError=Ic});var xi=u(Ks=>{"use strict";Object.defineProperty(Ks,"__esModule",{value:!0});Ks.RateLimitReachedError=void 0;var U0=Vs(),Tc=class extends U0.CustomError{static{n(this,"RateLimitReachedError")}};Ks.RateLimitReachedError=Tc});var Uc=u(Js=>{"use strict";Object.defineProperty(Js,"__esModule",{value:!0});Js.RetryAfterError=void 0;var O0=Vs(),Rc=class extends O0.CustomError{static{n(this,"RetryAfterError")}constructor(e){super(`Need to retry after ${e} ms`),this._retryAt=Date.now()+e}get retryAt(){return this._retryAt}};Js.RetryAfterError=Rc});var Yy=u(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});Zs.NullRateLimiter=void 0;var Oc=class{static{n(this,"NullRateLimiter")}constructor(e){this._callback=e}async request(e){return await this._callback(e)}clear(){}pause(){}resume(){}};Zs.NullRateLimiter=Oc});var jc=u(Xs=>{"use strict";Object.defineProperty(Xs,"__esModule",{value:!0});Xs.ResponseBasedRateLimiter=void 0;var B0=bi(),j0=C(),k0=xi(),ef=Uc(),Bc=class{static{n(this,"ResponseBasedRateLimiter")}constructor({logger:e}){this._queue=[],this._batchRunning=!1,this._paused=!1,this._logger=(0,B0.createLogger)({name:"rate-limiter",emoji:!0,...e})}async request(e,t){return this._logger.trace("request start"),await new Promise((r,a)=>{var s;let o={req:e,resolve:r,reject:a,limitReachedBehavior:(s=t?.limitReachedBehavior)!==null&&s!==void 0?s:"enqueue"};this._batchRunning||this._nextBatchTimer||this._paused?(this._logger.trace(`request queued batchRunning:${this._batchRunning.toString()} hasNextBatchTimer:${(!!this._nextBatchTimer).toString()} paused:${this._paused.toString()}`),this._queue.push(o)):this._runRequestBatch([o])})}clear(){this._queue=[]}pause(){this._paused=!0}resume(){this._paused=!1,this._runNextBatch()}get stats(){var e,t,r,a,s;return{lastKnownLimit:(t=(e=this._parameters)===null||e===void 0?void 0:e.limit)!==null&&t!==void 0?t:null,lastKnownRemainingRequests:(a=(r=this._parameters)===null||r===void 0?void 0:r.remaining)!==null&&a!==void 0?a:null,lastKnownResetDate:(0,j0.mapNullable)((s=this._parameters)===null||s===void 0?void 0:s.resetsAt,o=>new Date(o))}}async _runRequestBatch(e){this._logger.trace(`runRequestBatch start specs:${e.length}`),this._batchRunning=!0,this._parameters&&this._logger.debug(`Remaining requests: ${this._parameters.remaining}`),this._logger.debug(`Doing ${e.length} requests, new queue length is ${this._queue.length}`);let t=e.map(async o=>{let{req:l,resolve:d,reject:p}=o;try{let h=await this.doRequest(l),w=this.needsToRetryAfter(h);if(w!==null)throw this._queue.unshift(o),this._logger.info(`Retrying after ${w} ms`),new ef.RetryAfterError(w);let E=this.getParametersFromResponse(h);return d(h),E}catch(h){if(h instanceof ef.RetryAfterError)throw h;p(h);return}}),r=await Promise.allSettled(t),a=r.filter(o=>o.status==="rejected"),s=Date.now();if(a.length){this._logger.trace("runRequestBatch some rejected");let l=Math.max(s,...a.map(d=>d.reason.retryAt))-s;this._logger.warn(`Waiting for ${l} ms because the rate limit was exceeded`),this._nextBatchTimer=setTimeout(()=>{this._parameters=void 0,this._runNextBatch()},l)}else{this._logger.trace("runRequestBatch none rejected");let o=r.filter(l=>l.status==="fulfilled"&&l.value!==void 0).map(l=>l.value).reduce((l,d)=>l?d.remaining<l.remaining?d:l:d,void 0);if(this._batchRunning=!1,o)if(this._parameters=o,o.resetsAt<s||o.remaining>0)this._logger.trace("runRequestBatch canRunMore"),this._runNextBatch();else{let l=o.resetsAt-s;this._logger.trace(`runRequestBatch delay:${l}`),this._logger.warn(`Waiting for ${l} ms because the rate limit was reached`),this._queue=this._queue.filter(d=>{switch(d.limitReachedBehavior){case"enqueue":return!0;case"null":return d.resolve(null),!1;case"throw":return d.reject(new k0.RateLimitReachedError("Request removed from queue because the rate limit was reached")),!1;default:throw new Error("this should never happen")}}),this._nextBatchTimer=setTimeout(()=>{this._parameters=void 0,this._runNextBatch()},l)}}this._logger.trace("runRequestBatch end")}_runNextBatch(){if(this._paused)return;this._logger.trace("runNextBatch start"),this._nextBatchTimer&&(clearTimeout(this._nextBatchTimer),this._nextBatchTimer=void 0);let e=this._parameters?Math.min(this._parameters.remaining,this._parameters.limit/10):1,t=this._queue.splice(0,e);t.length&&this._runRequestBatch(t),this._logger.trace("runNextBatch end")}};Xs.ResponseBasedRateLimiter=Bc});var tf=u(Ys=>{"use strict";Object.defineProperty(Ys,"__esModule",{value:!0});Ys.PartitionedRateLimiter=void 0;var M0=jc(),kc=class{static{n(this,"PartitionedRateLimiter")}constructor(e){this._children=new Map,this._paused=!1,this._partitionKeyCallback=e.getPartitionKey,this._createChildCallback=e.createChild}async request(e,t){let r=this._partitionKeyCallback(e);return await this._getChild(r).request(e,t)}clear(){for(let e of this._children.values())e.clear()}pause(){this._paused=!0;for(let e of this._children.values())e.pause()}resume(){this._paused=!1;for(let e of this._children.values())e.resume()}getChildStats(e){if(!this._children.has(e))return null;let t=this._children.get(e);return t instanceof M0.ResponseBasedRateLimiter?t.stats:null}_getChild(e){if(this._children.has(e))return this._children.get(e);let t=this._createChildCallback(e);return this._paused&&t.pause(),this._children.set(e,t),t}};Ys.PartitionedRateLimiter=kc});var nf=u(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.PartitionedTimeBasedRateLimiter=void 0;var L0=bi(),F0=xi(),rf=zs(),Mc=class{static{n(this,"PartitionedTimeBasedRateLimiter")}constructor({logger:e,bucketSize:t,timeFrame:r,doRequest:a,getPartitionKey:s}){this._partitionedQueue=new Map,this._usedFromBucket=new Map,this._counterTimers=new Set,this._paused=!1,this._destroyed=!1,this._logger=(0,L0.createLogger)({name:"rate-limiter",emoji:!0,...e}),this._bucketSize=t,this._timeFrame=r,this._callback=a,this._partitionKeyCallback=s}async request(e,t){return await new Promise((r,a)=>{var s,o;if(this._destroyed){a(new rf.RateLimiterDestroyedError("Rate limiter was destroyed"));return}let l={req:e,resolve:r,reject:a,limitReachedBehavior:(s=t?.limitReachedBehavior)!==null&&s!==void 0?s:"enqueue"},d=this._partitionKeyCallback(e),p=(o=this._usedFromBucket.get(d))!==null&&o!==void 0?o:0;if(p>=this._bucketSize||this._paused)switch(l.limitReachedBehavior){case"enqueue":{let h=this._getPartitionedQueue(d);h.push(l),p+h.length>=this._bucketSize?this._logger.warn(`Rate limit of ${this._bucketSize} for ${d?`partition ${d}`:"default partition"} was reached, waiting for ${this._paused?"the limiter to be unpaused":"a free bucket entry"}; queue size is ${h.length}`):this._logger.info(`Enqueueing request for ${d?`partition ${d}`:"default partition"} because the rate limiter is paused; queue size is ${h.length}`);break}case"null":{l.resolve(null),this._paused?this._logger.info(`Returning null for request for ${d?`partition ${d}`:"default partition"} because the rate limiter is paused`):this._logger.warn(`Rate limit of ${this._bucketSize} for ${d?`partition ${d}`:"default partition"} was reached, dropping request and returning null`);break}case"throw":{l.reject(new F0.RateLimitReachedError(`Request dropped because ${this._paused?"the rate limiter is paused":`the rate limit for ${d?`partition ${d}`:"default partition"} was reached`}`));break}default:throw new Error("this should never happen")}else this._runRequest(l,d)})}clear(){this._partitionedQueue.clear()}pause(){this._paused=!0}resume(){this._paused=!1;for(let e of this._partitionedQueue.keys())this._runNextRequest(e)}destroy(){this._paused=!1,this._destroyed=!0,this._counterTimers.forEach(e=>{clearTimeout(e)});for(let e of this._partitionedQueue.values())for(let t of e)t.reject(new rf.RateLimiterDestroyedError("Rate limiter was destroyed"));this._partitionedQueue.clear()}_getPartitionedQueue(e){if(this._partitionedQueue.has(e))return this._partitionedQueue.get(e);let t=[];return this._partitionedQueue.set(e,t),t}async _runRequest(e,t){var r;let a=this._getPartitionedQueue(t);this._logger.debug(`doing a request for ${t?`partition ${t}`:"default partition"}, new queue length is ${a.length}`),this._usedFromBucket.set(t,((r=this._usedFromBucket.get(t))!==null&&r!==void 0?r:0)+1);let{req:s,resolve:o,reject:l}=e;try{o(await this._callback(s))}catch(d){l(d)}finally{let d=setTimeout(()=>{this._counterTimers.delete(d);let p=this._usedFromBucket.get(t)-1;this._usedFromBucket.set(t,p),a.length&&p<this._bucketSize&&this._runNextRequest(t)},this._timeFrame);this._counterTimers.add(d)}}_runNextRequest(e){if(this._paused)return;let r=this._getPartitionedQueue(e).shift();r&&this._runRequest(r,e)}};eo.PartitionedTimeBasedRateLimiter=Mc});var Fc=u(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.TimeBasedRateLimiter=void 0;var N0=bi(),Q0=xi(),af=zs(),Lc=class{static{n(this,"TimeBasedRateLimiter")}constructor({logger:e,bucketSize:t,timeFrame:r,doRequest:a}){this._queue=[],this._usedFromBucket=0,this._counterTimers=new Set,this._paused=!1,this._destroyed=!1,this._logger=(0,N0.createLogger)({name:"rate-limiter",emoji:!0,...e}),this._bucketSize=t,this._timeFrame=r,this._callback=a}async request(e,t){return await new Promise((r,a)=>{var s;if(this._destroyed){a(new af.RateLimiterDestroyedError("Rate limiter was destroyed"));return}let o={req:e,resolve:r,reject:a,limitReachedBehavior:(s=t?.limitReachedBehavior)!==null&&s!==void 0?s:"enqueue"};if(this._usedFromBucket>=this._bucketSize||this._paused)switch(o.limitReachedBehavior){case"enqueue":{this._queue.push(o),this._usedFromBucket+this._queue.length>=this._bucketSize?this._logger.warn(`Rate limit of ${this._bucketSize} was reached, waiting for ${this._paused?"the limiter to be unpaused":"a free bucket entry"}; queue size is ${this._queue.length}`):this._logger.info(`Enqueueing request because the rate limiter is paused; queue size is ${this._queue.length}`);break}case"null":{o.resolve(null),this._logger.warn(`Rate limit of ${this._bucketSize} was reached, dropping request and returning null`),this._paused?this._logger.info("Returning null for request because the rate limiter is paused"):this._logger.warn(`Rate limit of ${this._bucketSize} was reached, dropping request and returning null`);break}case"throw":{o.reject(new Q0.RateLimitReachedError(`Request dropped because ${this._paused?"the rate limiter is paused":"the rate limit was reached"}`));break}default:throw new Error("this should never happen")}else this._runRequest(o)})}clear(){this._queue=[]}pause(){this._paused=!0}resume(){this._paused=!1,this._runNextRequest()}destroy(){this._paused=!1,this._destroyed=!0,this._counterTimers.forEach(e=>{clearTimeout(e)});for(let e of this._queue)e.reject(new af.RateLimiterDestroyedError("Rate limiter was destroyed"));this._queue=[]}async _runRequest(e){this._logger.debug(`doing a request, new queue length is ${this._queue.length}`),this._usedFromBucket+=1;let{req:t,resolve:r,reject:a}=e;try{r(await this._callback(t))}catch(s){a(s)}finally{let s=setTimeout(()=>{this._counterTimers.delete(s),this._usedFromBucket-=1,this._queue.length&&this._usedFromBucket<this._bucketSize&&this._runNextRequest()},this._timeFrame);this._counterTimers.add(s)}}_runNextRequest(){if(this._paused)return;let e=this._queue.shift();e&&this._runRequest(e)}};to.TimeBasedRateLimiter=Lc});var sf=u(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.TimedPassthruRateLimiter=void 0;var G0=Fc(),Nc=class extends G0.TimeBasedRateLimiter{static{n(this,"TimedPassthruRateLimiter")}constructor(e,t){super({...t,async doRequest(r,a){return await e.request(r,a)}})}};ro.TimedPassthruRateLimiter=Nc});var io=u(se=>{"use strict";Object.defineProperty(se,"__esModule",{value:!0});se.TimedPassthruRateLimiter=se.TimeBasedRateLimiter=se.ResponseBasedRateLimiter=se.PartitionedTimeBasedRateLimiter=se.PartitionedRateLimiter=se.NullRateLimiter=se.RetryAfterError=se.RateLimitReachedError=se.RateLimiterDestroyedError=void 0;var W0=zs();Object.defineProperty(se,"RateLimiterDestroyedError",{enumerable:!0,get:n(function(){return W0.RateLimiterDestroyedError},"get")});var V0=xi();Object.defineProperty(se,"RateLimitReachedError",{enumerable:!0,get:n(function(){return V0.RateLimitReachedError},"get")});var $0=Uc();Object.defineProperty(se,"RetryAfterError",{enumerable:!0,get:n(function(){return $0.RetryAfterError},"get")});var z0=Yy();Object.defineProperty(se,"NullRateLimiter",{enumerable:!0,get:n(function(){return z0.NullRateLimiter},"get")});var K0=tf();Object.defineProperty(se,"PartitionedRateLimiter",{enumerable:!0,get:n(function(){return K0.PartitionedRateLimiter},"get")});var J0=nf();Object.defineProperty(se,"PartitionedTimeBasedRateLimiter",{enumerable:!0,get:n(function(){return J0.PartitionedTimeBasedRateLimiter},"get")});var Z0=jc();Object.defineProperty(se,"ResponseBasedRateLimiter",{enumerable:!0,get:n(function(){return Z0.ResponseBasedRateLimiter},"get")});var X0=Fc();Object.defineProperty(se,"TimeBasedRateLimiter",{enumerable:!0,get:n(function(){return X0.TimeBasedRateLimiter},"get")});var Y0=sf();Object.defineProperty(se,"TimedPassthruRateLimiter",{enumerable:!0,get:n(function(){return Y0.TimedPassthruRateLimiter},"get")})});var uf=u((gt,lf)=>{var of=typeof self<"u"?self:gt,no=(function(){function i(){this.fetch=!1,this.DOMException=of.DOMException}return n(i,"F"),i.prototype=of,new i})();(function(i){var e=(function(t){var r={searchParams:"URLSearchParams"in i,iterable:"Symbol"in i&&"iterator"in Symbol,blob:"FileReader"in i&&"Blob"in i&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:"FormData"in i,arrayBuffer:"ArrayBuffer"in i};function a(f){return f&&DataView.prototype.isPrototypeOf(f)}if(n(a,"isDataView"),r.arrayBuffer)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],o=ArrayBuffer.isView||function(f){return f&&s.indexOf(Object.prototype.toString.call(f))>-1};function l(f){if(typeof f!="string"&&(f=String(f)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(f))throw new TypeError("Invalid character in header field name");return f.toLowerCase()}n(l,"normalizeName");function d(f){return typeof f!="string"&&(f=String(f)),f}n(d,"normalizeValue");function p(f){var H={next:n(function(){var I=f.shift();return{done:I===void 0,value:I}},"next")};return r.iterable&&(H[Symbol.iterator]=function(){return H}),H}n(p,"iteratorFor");function h(f){this.map={},f instanceof h?f.forEach(function(H,I){this.append(I,H)},this):Array.isArray(f)?f.forEach(function(H){this.append(H[0],H[1])},this):f&&Object.getOwnPropertyNames(f).forEach(function(H){this.append(H,f[H])},this)}n(h,"Headers"),h.prototype.append=function(f,H){f=l(f),H=d(H);var I=this.map[f];this.map[f]=I?I+", "+H:H},h.prototype.delete=function(f){delete this.map[l(f)]},h.prototype.get=function(f){return f=l(f),this.has(f)?this.map[f]:null},h.prototype.has=function(f){return this.map.hasOwnProperty(l(f))},h.prototype.set=function(f,H){this.map[l(f)]=d(H)},h.prototype.forEach=function(f,H){for(var I in this.map)this.map.hasOwnProperty(I)&&f.call(H,this.map[I],I,this)},h.prototype.keys=function(){var f=[];return this.forEach(function(H,I){f.push(I)}),p(f)},h.prototype.values=function(){var f=[];return this.forEach(function(H){f.push(H)}),p(f)},h.prototype.entries=function(){var f=[];return this.forEach(function(H,I){f.push([I,H])}),p(f)},r.iterable&&(h.prototype[Symbol.iterator]=h.prototype.entries);function w(f){if(f.bodyUsed)return Promise.reject(new TypeError("Already read"));f.bodyUsed=!0}n(w,"consumed");function E(f){return new Promise(function(H,I){f.onload=function(){H(f.result)},f.onerror=function(){I(f.error)}})}n(E,"fileReaderReady");function P(f){var H=new FileReader,I=E(H);return H.readAsArrayBuffer(f),I}n(P,"readBlobAsArrayBuffer");function y(f){var H=new FileReader,I=E(H);return H.readAsText(f),I}n(y,"readBlobAsText");function q(f){for(var H=new Uint8Array(f),I=new Array(H.length),X=0;X<H.length;X++)I[X]=String.fromCharCode(H[X]);return I.join("")}n(q,"readArrayBufferAsText");function v(f){if(f.slice)return f.slice(0);var H=new Uint8Array(f.byteLength);return H.set(new Uint8Array(f)),H.buffer}n(v,"bufferClone");function U(){return this.bodyUsed=!1,this._initBody=function(f){this._bodyInit=f,f?typeof f=="string"?this._bodyText=f:r.blob&&Blob.prototype.isPrototypeOf(f)?this._bodyBlob=f:r.formData&&FormData.prototype.isPrototypeOf(f)?this._bodyFormData=f:r.searchParams&&URLSearchParams.prototype.isPrototypeOf(f)?this._bodyText=f.toString():r.arrayBuffer&&r.blob&&a(f)?(this._bodyArrayBuffer=v(f.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):r.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(f)||o(f))?this._bodyArrayBuffer=v(f):this._bodyText=f=Object.prototype.toString.call(f):this._bodyText="",this.headers.get("content-type")||(typeof f=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r.searchParams&&URLSearchParams.prototype.isPrototypeOf(f)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r.blob&&(this.blob=function(){var f=w(this);if(f)return f;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?w(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(P)}),this.text=function(){var f=w(this);if(f)return f;if(this._bodyBlob)return y(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(q(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},r.formData&&(this.formData=function(){return this.text().then(Oe)}),this.json=function(){return this.text().then(JSON.parse)},this}n(U,"Body");var be=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function z(f){var H=f.toUpperCase();return be.indexOf(H)>-1?H:f}n(z,"normalizeMethod");function k(f,H){H=H||{};var I=H.body;if(f instanceof k){if(f.bodyUsed)throw new TypeError("Already read");this.url=f.url,this.credentials=f.credentials,H.headers||(this.headers=new h(f.headers)),this.method=f.method,this.mode=f.mode,this.signal=f.signal,!I&&f._bodyInit!=null&&(I=f._bodyInit,f.bodyUsed=!0)}else this.url=String(f);if(this.credentials=H.credentials||this.credentials||"same-origin",(H.headers||!this.headers)&&(this.headers=new h(H.headers)),this.method=z(H.method||this.method||"GET"),this.mode=H.mode||this.mode||null,this.signal=H.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&I)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(I)}n(k,"Request"),k.prototype.clone=function(){return new k(this,{body:this._bodyInit})};function Oe(f){var H=new FormData;return f.trim().split("&").forEach(function(I){if(I){var X=I.split("="),$=X.shift().replace(/\+/g," "),B=X.join("=").replace(/\+/g," ");H.append(decodeURIComponent($),decodeURIComponent(B))}}),H}n(Oe,"decode");function ft(f){var H=new h,I=f.replace(/\r?\n[\t ]+/g," ");return I.split(/\r?\n/).forEach(function(X){var $=X.split(":"),B=$.shift().trim();if(B){var he=$.join(":").trim();H.append(B,he)}}),H}n(ft,"parseHeaders"),U.call(k.prototype);function J(f,H){H||(H={}),this.type="default",this.status=H.status===void 0?200:H.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in H?H.statusText:"OK",this.headers=new h(H.headers),this.url=H.url||"",this._initBody(f)}n(J,"Response"),U.call(J.prototype),J.prototype.clone=function(){return new J(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},J.error=function(){var f=new J(null,{status:0,statusText:""});return f.type="error",f};var di=[301,302,303,307,308];J.redirect=function(f,H){if(di.indexOf(H)===-1)throw new RangeError("Invalid status code");return new J(null,{status:H,headers:{location:f}})},t.DOMException=i.DOMException;try{new t.DOMException}catch{t.DOMException=function(H,I){this.message=H,this.name=I;var X=Error(H);this.stack=X.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function At(f,H){return new Promise(function(I,X){var $=new k(f,H);if($.signal&&$.signal.aborted)return X(new t.DOMException("Aborted","AbortError"));var B=new XMLHttpRequest;function he(){B.abort()}n(he,"abortXhr"),B.onload=function(){var Dt={status:B.status,statusText:B.statusText,headers:ft(B.getAllResponseHeaders()||"")};Dt.url="responseURL"in B?B.responseURL:Dt.headers.get("X-Request-URL");var Fe="response"in B?B.response:B.responseText;I(new J(Fe,Dt))},B.onerror=function(){X(new TypeError("Network request failed"))},B.ontimeout=function(){X(new TypeError("Network request failed"))},B.onabort=function(){X(new t.DOMException("Aborted","AbortError"))},B.open($.method,$.url,!0),$.credentials==="include"?B.withCredentials=!0:$.credentials==="omit"&&(B.withCredentials=!1),"responseType"in B&&r.blob&&(B.responseType="blob"),$.headers.forEach(function(Dt,Fe){B.setRequestHeader(Fe,Dt)}),$.signal&&($.signal.addEventListener("abort",he),B.onreadystatechange=function(){B.readyState===4&&$.signal.removeEventListener("abort",he)}),B.send(typeof $._bodyInit>"u"?null:$._bodyInit)})}return n(At,"fetch"),At.polyfill=!0,i.fetch||(i.fetch=At,i.Headers=h,i.Request=k,i.Response=J),t.Headers=h,t.Request=k,t.Response=J,t.fetch=At,Object.defineProperty(t,"__esModule",{value:!0}),t})({})})(no);no.fetch.ponyfill=!0;delete no.fetch.polyfill;var Tr=no;gt=Tr.fetch;gt.default=Tr.fetch;gt.fetch=Tr.fetch;gt.Headers=Tr.Headers;gt.Request=Tr.Request;gt.Response=Tr.Response;lf.exports=gt});var ao=u((XO,df)=>{"use strict";var Qc=Object.prototype.hasOwnProperty,Rr=Array.isArray,lt=(function(){for(var i=[],e=0;e<256;++e)i.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return i})(),eH=n(function(e){for(;e.length>1;){var t=e.pop(),r=t.obj[t.prop];if(Rr(r)){for(var a=[],s=0;s<r.length;++s)typeof r[s]<"u"&&a.push(r[s]);t.obj[t.prop]=a}}},"compactQueue"),cf=n(function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},a=0;a<e.length;++a)typeof e[a]<"u"&&(r[a]=e[a]);return r},"arrayToObject"),tH=n(function i(e,t,r){if(!t)return e;if(typeof t!="object"){if(Rr(e))e.push(t);else if(e&&typeof e=="object")(r&&(r.plainObjects||r.allowPrototypes)||!Qc.call(Object.prototype,t))&&(e[t]=!0);else return[e,t];return e}if(!e||typeof e!="object")return[e].concat(t);var a=e;return Rr(e)&&!Rr(t)&&(a=cf(e,r)),Rr(e)&&Rr(t)?(t.forEach(function(s,o){if(Qc.call(e,o)){var l=e[o];l&&typeof l=="object"&&s&&typeof s=="object"?e[o]=i(l,s,r):e.push(s)}else e[o]=s}),e):Object.keys(t).reduce(function(s,o){var l=t[o];return Qc.call(s,o)?s[o]=i(s[o],l,r):s[o]=l,s},a)},"merge"),rH=n(function(e,t){return Object.keys(t).reduce(function(r,a){return r[a]=t[a],r},e)},"assignSingleSource"),iH=n(function(i,e,t){var r=i.replace(/\+/g," ");if(t==="iso-8859-1")return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch{return r}},"decode"),nH=n(function(e,t,r){if(e.length===0)return e;var a=e;if(typeof e=="symbol"?a=Symbol.prototype.toString.call(e):typeof e!="string"&&(a=String(e)),r==="iso-8859-1")return escape(a).replace(/%u[0-9a-f]{4}/gi,function(d){return"%26%23"+parseInt(d.slice(2),16)+"%3B"});for(var s="",o=0;o<a.length;++o){var l=a.charCodeAt(o);if(l===45||l===46||l===95||l===126||l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122){s+=a.charAt(o);continue}if(l<128){s=s+lt[l];continue}if(l<2048){s=s+(lt[192|l>>6]+lt[128|l&63]);continue}if(l<55296||l>=57344){s=s+(lt[224|l>>12]+lt[128|l>>6&63]+lt[128|l&63]);continue}o+=1,l=65536+((l&1023)<<10|a.charCodeAt(o)&1023),s+=lt[240|l>>18]+lt[128|l>>12&63]+lt[128|l>>6&63]+lt[128|l&63]}return s},"encode"),aH=n(function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],a=0;a<t.length;++a)for(var s=t[a],o=s.obj[s.prop],l=Object.keys(o),d=0;d<l.length;++d){var p=l[d],h=o[p];typeof h=="object"&&h!==null&&r.indexOf(h)===-1&&(t.push({obj:o,prop:p}),r.push(h))}return eH(t),e},"compact"),sH=n(function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},"isRegExp"),oH=n(function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},"isBuffer"),lH=n(function(e,t){return[].concat(e,t)},"combine");df.exports={arrayToObject:cf,assign:rH,combine:lH,compact:aH,decode:iH,encode:nH,isBuffer:oH,isRegExp:sH,merge:tH}});var Gc=u((eB,pf)=>{"use strict";var uH=String.prototype.replace,cH=/%20/g,dH=ao(),hf={RFC1738:"RFC1738",RFC3986:"RFC3986"};pf.exports=dH.assign({default:hf.RFC3986,formatters:{RFC1738:n(function(i){return uH.call(i,cH,"+")},"RFC1738"),RFC3986:n(function(i){return String(i)},"RFC3986")}},hf)});var gf=u((rB,ff)=>{"use strict";var yf=ao(),wi=Gc(),hH=Object.prototype.hasOwnProperty,_f={brackets:n(function(e){return e+"[]"},"brackets"),comma:"comma",indices:n(function(e,t){return e+"["+t+"]"},"indices"),repeat:n(function(e){return e},"repeat")},Ur=Array.isArray,pH=Array.prototype.push,Wc=n(function(i,e){pH.apply(i,Ur(e)?e:[e])},"pushToArray"),_H=Date.prototype.toISOString,mf=wi.default,Se={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:yf.encode,encodeValuesOnly:!1,format:mf,formatter:wi.formatters[mf],indices:!1,serializeDate:n(function(e){return _H.call(e)},"serializeDate"),skipNulls:!1,strictNullHandling:!1},mH=n(function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},"isNonNullishPrimitive"),yH=n(function i(e,t,r,a,s,o,l,d,p,h,w,E,P){var y=e;if(typeof l=="function"?y=l(t,y):y instanceof Date?y=h(y):r==="comma"&&Ur(y)&&(y=y.join(",")),y===null){if(a)return o&&!E?o(t,Se.encoder,P,"key"):t;y=""}if(mH(y)||yf.isBuffer(y)){if(o){var q=E?t:o(t,Se.encoder,P,"key");return[w(q)+"="+w(o(y,Se.encoder,P,"value"))]}return[w(t)+"="+w(String(y))]}var v=[];if(typeof y>"u")return v;var U;if(Ur(l))U=l;else{var be=Object.keys(y);U=d?be.sort(d):be}for(var z=0;z<U.length;++z){var k=U[z];s&&y[k]===null||(Ur(y)?Wc(v,i(y[k],typeof r=="function"?r(t,k):t,r,a,s,o,l,d,p,h,w,E,P)):Wc(v,i(y[k],t+(p?"."+k:"["+k+"]"),r,a,s,o,l,d,p,h,w,E,P)))}return v},"stringify"),fH=n(function(e){if(!e)return Se;if(e.encoder!==null&&e.encoder!==void 0&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var t=e.charset||Se.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=wi.default;if(typeof e.format<"u"){if(!hH.call(wi.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var a=wi.formatters[r],s=Se.filter;return(typeof e.filter=="function"||Ur(e.filter))&&(s=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:Se.addQueryPrefix,allowDots:typeof e.allowDots>"u"?Se.allowDots:!!e.allowDots,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Se.charsetSentinel,delimiter:typeof e.delimiter>"u"?Se.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:Se.encode,encoder:typeof e.encoder=="function"?e.encoder:Se.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:Se.encodeValuesOnly,filter:s,formatter:a,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:Se.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:Se.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Se.strictNullHandling}},"normalizeStringifyOptions");ff.exports=function(i,e){var t=i,r=fH(e),a,s;typeof r.filter=="function"?(s=r.filter,t=s("",t)):Ur(r.filter)&&(s=r.filter,a=s);var o=[];if(typeof t!="object"||t===null)return"";var l;e&&e.arrayFormat in _f?l=e.arrayFormat:e&&"indices"in e?l=e.indices?"indices":"repeat":l="indices";var d=_f[l];a||(a=Object.keys(t)),r.sort&&a.sort(r.sort);for(var p=0;p<a.length;++p){var h=a[p];r.skipNulls&&t[h]===null||Wc(o,yH(t[h],h,d,r.strictNullHandling,r.skipNulls,r.encode?r.encoder:null,r.filter,r.sort,r.allowDots,r.serializeDate,r.formatter,r.encodeValuesOnly,r.charset))}var w=o.join(r.delimiter),E=r.addQueryPrefix===!0?"?":"";return r.charsetSentinel&&(r.charset==="iso-8859-1"?E+="utf8=%26%2310003%3B&":E+="utf8=%E2%9C%93&"),w.length>0?E+w:""}});var vf=u((nB,wf)=>{"use strict";var vi=ao(),Vc=Object.prototype.hasOwnProperty,bf=Array.isArray,xe={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:vi.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},gH=n(function(i){return i.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},"interpretNumericEntities"),xf=n(function(i,e){return i&&typeof i=="string"&&e.comma&&i.indexOf(",")>-1?i.split(","):i},"parseArrayValue"),bH=n(function(e,t){if(bf(e)){for(var r=[],a=0;a<e.length;a+=1)r.push(t(e[a]));return r}return t(e)},"maybeMap"),xH="utf8=%26%2310003%3B",wH="utf8=%E2%9C%93",vH=n(function(e,t){var r={},a=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,s=t.parameterLimit===1/0?void 0:t.parameterLimit,o=a.split(t.delimiter,s),l=-1,d,p=t.charset;if(t.charsetSentinel)for(d=0;d<o.length;++d)o[d].indexOf("utf8=")===0&&(o[d]===wH?p="utf-8":o[d]===xH&&(p="iso-8859-1"),l=d,d=o.length);for(d=0;d<o.length;++d)if(d!==l){var h=o[d],w=h.indexOf("]="),E=w===-1?h.indexOf("="):w+1,P,y;E===-1?(P=t.decoder(h,xe.decoder,p,"key"),y=t.strictNullHandling?null:""):(P=t.decoder(h.slice(0,E),xe.decoder,p,"key"),y=bH(xf(h.slice(E+1),t),function(q){return t.decoder(q,xe.decoder,p,"value")})),y&&t.interpretNumericEntities&&p==="iso-8859-1"&&(y=gH(y)),h.indexOf("[]=")>-1&&(y=bf(y)?[y]:y),Vc.call(r,P)?r[P]=vi.combine(r[P],y):r[P]=y}return r},"parseQueryStringValues"),SH=n(function(i,e,t,r){for(var a=r?e:xf(e,t),s=i.length-1;s>=0;--s){var o,l=i[s];if(l==="[]"&&t.parseArrays)o=[].concat(a);else{o=t.plainObjects?Object.create(null):{};var d=l.charAt(0)==="["&&l.charAt(l.length-1)==="]"?l.slice(1,-1):l,p=parseInt(d,10);!t.parseArrays&&d===""?o={0:a}:!isNaN(p)&&l!==d&&String(p)===d&&p>=0&&t.parseArrays&&p<=t.arrayLimit?(o=[],o[p]=a):o[d]=a}a=o}return a},"parseObject"),HH=n(function(e,t,r,a){if(e){var s=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/,l=/(\[[^[\]]*])/g,d=r.depth>0&&o.exec(s),p=d?s.slice(0,d.index):s,h=[];if(p){if(!r.plainObjects&&Vc.call(Object.prototype,p)&&!r.allowPrototypes)return;h.push(p)}for(var w=0;r.depth>0&&(d=l.exec(s))!==null&&w<r.depth;){if(w+=1,!r.plainObjects&&Vc.call(Object.prototype,d[1].slice(1,-1))&&!r.allowPrototypes)return;h.push(d[1])}return d&&h.push("["+s.slice(d.index)+"]"),SH(h,t,r,a)}},"parseQueryStringKeys"),CH=n(function(e){if(!e)return xe;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=typeof e.charset>"u"?xe.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?xe.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:xe.allowPrototypes,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:xe.arrayLimit,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:xe.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:xe.comma,decoder:typeof e.decoder=="function"?e.decoder:xe.decoder,delimiter:typeof e.delimiter=="string"||vi.isRegExp(e.delimiter)?e.delimiter:xe.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:xe.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:xe.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:xe.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:xe.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:xe.strictNullHandling}},"normalizeParseOptions");wf.exports=function(i,e){var t=CH(e);if(i===""||i===null||typeof i>"u")return t.plainObjects?Object.create(null):{};for(var r=typeof i=="string"?vH(i,t):i,a=t.plainObjects?Object.create(null):{},s=Object.keys(r),o=0;o<s.length;++o){var l=s[o],d=HH(l,r[l],t,typeof i=="string");a=vi.merge(a,d,t)}return vi.compact(a)}});var $c=u((sB,Sf)=>{"use strict";var qH=gf(),EH=vf(),PH=Gc();Sf.exports={formats:PH,parse:EH,stringify:qH}});var Cf=u(Hf=>{function bt(i){if(typeof i!="object")return i;var e,t,r=Object.prototype.toString.call(i);if(r==="[object Object]"){if(i.constructor!==Object&&typeof i.constructor=="function"){t=new i.constructor;for(e in i)i.hasOwnProperty(e)&&t[e]!==i[e]&&(t[e]=bt(i[e]))}else{t={};for(e in i)e==="__proto__"?Object.defineProperty(t,e,{value:bt(i[e]),configurable:!0,enumerable:!0,writable:!0}):t[e]=bt(i[e])}return t}if(r==="[object Array]"){for(e=i.length,t=Array(e);e--;)t[e]=bt(i[e]);return t}return r==="[object Set]"?(t=new Set,i.forEach(function(a){t.add(bt(a))}),t):r==="[object Map]"?(t=new Map,i.forEach(function(a,s){t.set(bt(s),bt(a))}),t):r==="[object Date]"?new Date(+i):r==="[object RegExp]"?(t=new RegExp(i.source,i.flags),t.lastIndex=i.lastIndex,t):r==="[object DataView]"?new i.constructor(bt(i.buffer)):r==="[object ArrayBuffer]"?i.slice(0):r.slice(-6)==="Array]"?new i.constructor(i):i}n(bt,"klona");Hf.klona=bt});var Kc=u(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.DataObject=ut.getRawData=ut.rawDataSymbol=void 0;var AH=Cf();ut.rawDataSymbol=Symbol("twurpleRawData");function DH(i){return(0,AH.klona)(i[ut.rawDataSymbol])}n(DH,"getRawData");ut.getRawData=DH;var zc=class{static{n(this,"DataObject")}constructor(e){this[ut.rawDataSymbol]=e}};ut.DataObject=zc});var oo=u(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.CustomError=void 0;var Jc=class extends Error{static{n(this,"CustomError")}constructor(e,t){var r;super(e,t),Object.setPrototypeOf(this,new.target.prototype),(r=Error.captureStackTrace)===null||r===void 0||r.call(Error,this,new.target.constructor)}get name(){return this.constructor.name}};so.CustomError=Jc});var Xc=u(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.RelationAssertionError=void 0;var IH=oo(),Zc=class extends IH.CustomError{static{n(this,"RelationAssertionError")}constructor(){super("Relation returned null - this may be a library bug or a race condition in your own code")}};lo.RelationAssertionError=Zc});var qf=u(uo=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});uo.checkRelationAssertion=void 0;var TH=Xc();function RH(i){if(i==null)throw new TH.RelationAssertionError;return i}n(RH,"checkRelationAssertion");uo.checkRelationAssertion=RH});var Yc=u(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.rtfm=void 0;function UH(i,e,t){return r=>{let a=t?function(){return`[${e}#${this[t]} - please check https://twurple.js.org/reference/${i}/classes/${e}.html for available properties]`}:function(){return`[${e} - please check https://twurple.js.org/reference/${i}/classes/${e}.html for available properties]`};Object.defineProperty(r.prototype,Symbol.for("nodejs.util.inspect.custom"),{value:a,enumerable:!1})}}n(UH,"rtfm");co.rtfm=UH});var Ef=u(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.HelixExtension=void 0;var OH=(b(),x(g)),D=Kc(),BH=Yc(),ed=class extends D.DataObject{static{n(this,"HelixExtension")}get authorName(){return this[D.rawDataSymbol].author_name}get bitsEnabled(){return this[D.rawDataSymbol].bits_enabled}get installable(){return this[D.rawDataSymbol].can_install}get configurationLocation(){return this[D.rawDataSymbol].configuration_location}get description(){return this[D.rawDataSymbol].description}get tosUrl(){return this[D.rawDataSymbol].eula_tos_url}get hasChatSupport(){return this[D.rawDataSymbol].has_chat_support}get iconUrl(){return this[D.rawDataSymbol].icon_url}getIconUrl(e){return this[D.rawDataSymbol].icon_urls[e]}get id(){return this[D.rawDataSymbol].id}get name(){return this[D.rawDataSymbol].name}get privacyPolicyUrl(){return this[D.rawDataSymbol].privacy_policy_url}get requestsIdentityLink(){return this[D.rawDataSymbol].request_identity_link}get screenshotUrls(){return this[D.rawDataSymbol].screenshot_urls}get state(){return this[D.rawDataSymbol].state}get subscriptionsSupportLevel(){return this[D.rawDataSymbol].subscriptions_support_level}get summary(){return this[D.rawDataSymbol].summary}get supportEmail(){return this[D.rawDataSymbol].support_email}get version(){return this[D.rawDataSymbol].version}get viewerSummary(){return this[D.rawDataSymbol].viewer_summary}get viewerSummery(){return this[D.rawDataSymbol].viewer_summary}get allowedConfigUrls(){return this[D.rawDataSymbol].allowlisted_config_urls}get allowedPanelUrls(){return this[D.rawDataSymbol].allowlisted_panel_urls}get mobileViewerUrl(){var e,t;return(t=(e=this[D.rawDataSymbol].views.mobile)===null||e===void 0?void 0:e.viewer_url)!==null&&t!==void 0?t:null}get panelViewerUrl(){var e,t;return(t=(e=this[D.rawDataSymbol].views.panel)===null||e===void 0?void 0:e.viewer_url)!==null&&t!==void 0?t:null}get panelHeight(){var e,t;return(t=(e=this[D.rawDataSymbol].views.panel)===null||e===void 0?void 0:e.height)!==null&&t!==void 0?t:null}get panelCanLinkExternalContent(){var e,t;return(t=(e=this[D.rawDataSymbol].views.panel)===null||e===void 0?void 0:e.can_link_external_content)!==null&&t!==void 0?t:null}get overlayViewerUrl(){var e,t;return(t=(e=this[D.rawDataSymbol].views.video_overlay)===null||e===void 0?void 0:e.viewer_url)!==null&&t!==void 0?t:null}get overlayCanLinkExternalContent(){var e,t;return(t=(e=this[D.rawDataSymbol].views.video_overlay)===null||e===void 0?void 0:e.can_link_external_content)!==null&&t!==void 0?t:null}get componentViewerUrl(){var e,t;return(t=(e=this[D.rawDataSymbol].views.component)===null||e===void 0?void 0:e.viewer_url)!==null&&t!==void 0?t:null}get componentAspectWidth(){var e,t;return(t=(e=this[D.rawDataSymbol].views.component)===null||e===void 0?void 0:e.aspect_width)!==null&&t!==void 0?t:null}get componentAspectHeight(){var e,t;return(t=(e=this[D.rawDataSymbol].views.component)===null||e===void 0?void 0:e.aspect_height)!==null&&t!==void 0?t:null}get componentAspectRatioX(){var e,t;return(t=(e=this[D.rawDataSymbol].views.component)===null||e===void 0?void 0:e.aspect_ratio_x)!==null&&t!==void 0?t:null}get componentAspectRatioY(){var e,t;return(t=(e=this[D.rawDataSymbol].views.component)===null||e===void 0?void 0:e.aspect_ratio_y)!==null&&t!==void 0?t:null}get componentAutoScales(){var e,t;return(t=(e=this[D.rawDataSymbol].views.component)===null||e===void 0?void 0:e.autoscale)!==null&&t!==void 0?t:null}get componentScalePixels(){var e,t;return(t=(e=this[D.rawDataSymbol].views.component)===null||e===void 0?void 0:e.scale_pixels)!==null&&t!==void 0?t:null}get componentTargetHeight(){var e,t;return(t=(e=this[D.rawDataSymbol].views.component)===null||e===void 0?void 0:e.target_height)!==null&&t!==void 0?t:null}get componentSize(){var e,t;return(t=(e=this[D.rawDataSymbol].views.component)===null||e===void 0?void 0:e.size)!==null&&t!==void 0?t:null}get componentZoom(){var e,t;return(t=(e=this[D.rawDataSymbol].views.component)===null||e===void 0?void 0:e.zoom)!==null&&t!==void 0?t:null}get componentZoomPixels(){var e,t;return(t=(e=this[D.rawDataSymbol].views.component)===null||e===void 0?void 0:e.zoom_pixels)!==null&&t!==void 0?t:null}get componentCanLinkExternalContent(){var e,t;return(t=(e=this[D.rawDataSymbol].views.component)===null||e===void 0?void 0:e.can_link_external_content)!==null&&t!==void 0?t:null}get configViewerUrl(){var e,t;return(t=(e=this[D.rawDataSymbol].views.config)===null||e===void 0?void 0:e.viewer_url)!==null&&t!==void 0?t:null}get configCanLinkExternalContent(){var e,t;return(t=(e=this[D.rawDataSymbol].views.config)===null||e===void 0?void 0:e.can_link_external_content)!==null&&t!==void 0?t:null}};Si.HelixExtension=ed;Si.HelixExtension=ed=OH.__decorate([(0,BH.rtfm)("api","HelixExtension","id")],ed)});var Pf=u(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.HellFreezesOverError=void 0;var jH=oo(),td=class extends jH.CustomError{static{n(this,"HellFreezesOverError")}constructor(e){super(`${e} - this should never happen, please file a bug in the GitHub issue tracker`)}};ho.HellFreezesOverError=td});var Af=u(Or=>{"use strict";Object.defineProperty(Or,"__esModule",{value:!0});Or.extractUserName=Or.extractUserId=void 0;function kH(i){return typeof i=="string"?i:typeof i=="number"?i.toString(10):i.id}n(kH,"extractUserId");Or.extractUserId=kH;function MH(i){return typeof i=="string"?i:i.name}n(MH,"extractUserName");Or.extractUserName=MH});var _=u(K=>{"use strict";Object.defineProperty(K,"__esModule",{value:!0});K.extractUserName=K.extractUserId=K.RelationAssertionError=K.HellFreezesOverError=K.CustomError=K.HelixExtension=K.rtfm=K.checkRelationAssertion=K.rawDataSymbol=K.getRawData=K.DataObject=void 0;var rd=Kc();Object.defineProperty(K,"DataObject",{enumerable:!0,get:n(function(){return rd.DataObject},"get")});Object.defineProperty(K,"getRawData",{enumerable:!0,get:n(function(){return rd.getRawData},"get")});Object.defineProperty(K,"rawDataSymbol",{enumerable:!0,get:n(function(){return rd.rawDataSymbol},"get")});var LH=qf();Object.defineProperty(K,"checkRelationAssertion",{enumerable:!0,get:n(function(){return LH.checkRelationAssertion},"get")});var FH=Yc();Object.defineProperty(K,"rtfm",{enumerable:!0,get:n(function(){return FH.rtfm},"get")});var NH=Ef();Object.defineProperty(K,"HelixExtension",{enumerable:!0,get:n(function(){return NH.HelixExtension},"get")});var QH=oo();Object.defineProperty(K,"CustomError",{enumerable:!0,get:n(function(){return QH.CustomError},"get")});var GH=Pf();Object.defineProperty(K,"HellFreezesOverError",{enumerable:!0,get:n(function(){return GH.HellFreezesOverError},"get")});var WH=Xc();Object.defineProperty(K,"RelationAssertionError",{enumerable:!0,get:n(function(){return WH.RelationAssertionError},"get")});var Df=Af();Object.defineProperty(K,"extractUserId",{enumerable:!0,get:n(function(){return Df.extractUserId},"get")});Object.defineProperty(K,"extractUserName",{enumerable:!0,get:n(function(){return Df.extractUserName},"get")})});var nd=u(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.HttpStatusCodeError=void 0;var VH=_(),id=class extends VH.CustomError{static{n(this,"HttpStatusCodeError")}constructor(e,t,r,a,s,o){super(`Encountered HTTP status code ${e}: ${t}
|
|
7
7
|
|
|
8
8
|
URL: ${r}
|
|
9
9
|
Method: ${a}
|
|
10
10
|
Body:
|
|
11
|
-
${!o&&s.length>150?`${s.slice(0,147)}...`:s}`),this._statusCode=e,this._url=r,this._method=a,this._body=s}get statusCode(){return this._statusCode}get url(){return this._url}get method(){return this._method}get body(){return this._body}};ho.HttpStatusCodeError=ed});var rd=u(Or=>{"use strict";Object.defineProperty(Or,"__esModule",{value:!0});Or.transformTwitchApiResponse=Or.handleTwitchApiResponseError=void 0;var VH=Gc(),$H=td();async function zH(i,e){var t;if(!i.ok){let r=i.headers.get("Content-Type")==="application/json",a=r?JSON.stringify(await i.json(),null,2):await i.text(),s=(0,VH.stringify)(e.query,{arrayFormat:"repeat",addQueryPrefix:!0}),o=`${e.url}${s}`;throw new $H.HttpStatusCodeError(i.status,i.statusText,o,(t=e.method)!==null&&t!==void 0?t:"GET",a,r)}}n(zH,"handleTwitchApiResponseError");Or.handleTwitchApiResponseError=zH;async function KH(i){if(i.status===204)return;let e=await i.text();if(e)return JSON.parse(e)}n(KH,"transformTwitchApiResponse");Or.transformTwitchApiResponse=KH});var If=u(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.getTwitchApiUrl=void 0;function JH(i,e,t){switch(e){case"helix":{let r=i.replace(/^\//,"");return t?r==="eventsub/subscriptions"?`http://localhost:${t}/${r}`:`http://localhost:${t}/mock/${r}`:`https://api.twitch.tv/helix/${r}`}case"auth":return`https://id.twitch.tv/oauth2/${i.replace(/^\//,"")}`;case"custom":return i;default:return i}}n(JH,"getTwitchApiUrl");po.getTwitchApiUrl=JH});var Bf=u(jr=>{"use strict";Object.defineProperty(jr,"__esModule",{value:!0});jr.callTwitchApi=jr.callTwitchApiRaw=void 0;var Tf=uf(),ZH=Gc(),Rf=rd(),XH=If();async function Uf(i,e,t,r,a={},s){var o,l;let c=(o=i.type)!==null&&o!==void 0?o:"helix",h=(0,XH.getTwitchApiUrl)(i.url,c,s),p=(0,ZH.stringify)(i.query,{arrayFormat:"repeat",addQueryPrefix:!0}),w=new Tf.Headers({Accept:"application/json"}),E;i.jsonBody&&(E=JSON.stringify(i.jsonBody),w.append("Content-Type","application/json")),e&&c!=="auth"&&w.append("Client-ID",e),t&&w.append("Authorization",`${c==="helix"?r??"Bearer":"OAuth"} ${t}`);let P={...a,method:(l=i.method)!==null&&l!==void 0?l:"GET",headers:w,body:E};return await(0,Tf.default)(`${h}${p}`,P)}n(Uf,"callTwitchApiRaw");jr.callTwitchApiRaw=Uf;async function YH(i,e,t,r,a={}){let s=await Uf(i,e,t,r,a);return await(0,Rf.handleTwitchApiResponseError)(s,i),await(0,Rf.transformTwitchApiResponse)(s)}n(YH,"callTwitchApi");jr.callTwitchApi=YH});var Of=u(_o=>{"use strict";Object.defineProperty(_o,"__esModule",{value:!0});_o.createBroadcasterQuery=void 0;var eC=m();function tC(i){return{broadcaster_id:(0,eC.extractUserId)(i)}}n(tC,"createBroadcasterQuery");_o.createBroadcasterQuery=tC});var Y=u(Pe=>{"use strict";Object.defineProperty(Pe,"__esModule",{value:!0});Pe.HttpStatusCodeError=Pe.transformTwitchApiResponse=Pe.handleTwitchApiResponseError=Pe.createBroadcasterQuery=Pe.callTwitchApiRaw=Pe.callTwitchApi=void 0;var jf=Bf();Object.defineProperty(Pe,"callTwitchApi",{enumerable:!0,get:n(function(){return jf.callTwitchApi},"get")});Object.defineProperty(Pe,"callTwitchApiRaw",{enumerable:!0,get:n(function(){return jf.callTwitchApiRaw},"get")});var rC=Of();Object.defineProperty(Pe,"createBroadcasterQuery",{enumerable:!0,get:n(function(){return rC.createBroadcasterQuery},"get")});var kf=rd();Object.defineProperty(Pe,"handleTwitchApiResponseError",{enumerable:!0,get:n(function(){return kf.handleTwitchApiResponseError},"get")});Object.defineProperty(Pe,"transformTwitchApiResponse",{enumerable:!0,get:n(function(){return kf.transformTwitchApiResponse},"get")});var iC=td();Object.defineProperty(Pe,"HttpStatusCodeError",{enumerable:!0,get:n(function(){return iC.HttpStatusCodeError},"get")})});var nd=u(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.ConfigError=void 0;var nC=m(),id=class extends nC.CustomError{static{n(this,"ConfigError")}};mo.ConfigError=id});var Mf=u(yo=>{"use strict";Object.defineProperty(yo,"__esModule",{value:!0});yo.HelixRateLimiter=void 0;var aC=ro(),sC=Y(),ad=class extends aC.ResponseBasedRateLimiter{static{n(this,"HelixRateLimiter")}async doRequest({options:e,clientId:t,accessToken:r,authorizationType:a,fetchOptions:s,mockServerPort:o}){return await(0,sC.callTwitchApiRaw)(e,t,r,a,s,o)}needsToRetryAfter(e){return e.status===429&&(!e.headers.has("ratelimit-remaining")||Number(e.headers.get("ratelimit-remaining"))===0)?+e.headers.get("ratelimit-reset")*1e3-Date.now():null}getParametersFromResponse(e){let{headers:t}=e;return{limit:+t.get("ratelimit-limit"),remaining:+t.get("ratelimit-remaining"),resetsAt:+t.get("ratelimit-reset")*1e3}}};yo.HelixRateLimiter=ad});var Si=u(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.createCacheKey=void 0;function oC(i){switch(typeof i){case"undefined":return"";case"object":{if(i===null)return"";if("cacheKey"in i)return i.cacheKey;let e=JSON.stringify(i);if(e!=="{}")return e}default:return i.toString()}}n(oC,"createSingleCacheKey");function lC(i,e,t){return[i,...e.map(oC)].join("/")+(t?"/":"")}n(lC,"createCacheKey");fo.createCacheKey=lC});var Lf=u(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});go.Cacheable=void 0;var uC=Si(),bt=Symbol("cache");function cC(i){var e,t;return t=class extends i{static{n(this,"_b")}constructor(){super(...arguments),this[e]=new Map}getFromCache(r){if(this._cleanCache(),this[bt].has(r)){let a=this[bt].get(r);if(a)return a.value}}setCache(r,a,s){this[bt].set(r,{value:a,expires:Date.now()+s*1e3})}removeFromCache(r,a){let s=this._getInternalCacheKey(r,a);a?this[bt].forEach((o,l)=>{l.startsWith(s)&&this[bt].delete(l)}):this[bt].delete(s)}_cleanCache(){let r=Date.now();this[bt].forEach((a,s)=>{a.expires<r&&this[bt].delete(s)})}_getInternalCacheKey(r,a){if(typeof r=="string"){let s=r;return s.endsWith("/")||(s+="/"),s}else{let s=r.shift();return(0,uC.createCacheKey)(s,r,a)}}},e=bt,t}n(cC,"Cacheable");go.Cacheable=cC});var Ff=u(bo=>{"use strict";Object.defineProperty(bo,"__esModule",{value:!0});bo.Cached=void 0;var dC=Si();function hC(i=1/0,e=!1){return function(t,r,a){let s=a.value;return a.value=async function(...o){let l=(0,dC.createCacheKey)(r,o),c=this.getFromCache(l);if(c)return c;let h=await s.apply(this,o);return(h!=null||e)&&this.setCache(l,h,i),h},a}}n(hC,"Cached");bo.Cached=hC});var Nf=u(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});xo.CachedGetter=void 0;var pC=Si();function _C(i=1/0){return function(e,t,r){if(r.get){let a=r.get;r.get=function(){let s=(0,pC.createCacheKey)(t,[]),o=this.getFromCache(s);if(o)return o;let l=a.call(this);return this.setCache(s,l,i),l}}return r}}n(_C,"CachedGetter");xo.CachedGetter=_C});var Qf=u(wo=>{"use strict";Object.defineProperty(wo,"__esModule",{value:!0});wo.ClearsCache=void 0;function mC(i,e){return function(t,r,a){let s=a.value;return a.value=async function(...o){let l=await s.apply(this,o),c=e===void 0?o.slice():o.slice(0,e);return this.removeFromCache([i,...c],!0),l},a}}n(mC,"ClearsCache");wo.ClearsCache=mC});var Hi=u(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.createCacheKey=Fe.ClearsCache=Fe.CachedGetter=Fe.Cached=Fe.Cacheable=void 0;var yC=Lf();Object.defineProperty(Fe,"Cacheable",{enumerable:!0,get:n(function(){return yC.Cacheable},"get")});var fC=Ff();Object.defineProperty(Fe,"Cached",{enumerable:!0,get:n(function(){return fC.Cached},"get")});var gC=Nf();Object.defineProperty(Fe,"CachedGetter",{enumerable:!0,get:n(function(){return gC.CachedGetter},"get")});var bC=Qf();Object.defineProperty(Fe,"ClearsCache",{enumerable:!0,get:n(function(){return bC.ClearsCache},"get")});var xC=Si();Object.defineProperty(Fe,"createCacheKey",{enumerable:!0,get:n(function(){return xC.createCacheKey},"get")})});var od=u(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.Listener=void 0;var sd=class{static{n(this,"Listener")}constructor(e,t,r,a=!1){this.owner=e,this.event=t,this.listener=r,this._internal=a}unbind(){this.owner.removeListener(this)}};vo.Listener=sd});var Gf=u(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});So.EventEmitter=void 0;var wC=od(),ld=class{static{n(this,"EventEmitter")}constructor(){this._eventListeners=new Map,this._internalEventListeners=new Map}on(e,t){return this._addListener(!1,e,t)}addListener(e,t){return this._addListener(!1,e,t)}removeListener(e,t){this._removeListener(!1,e,t)}registerEvent(){let e=n(t=>this.addListener(e,t),"eventBinder");return e}emit(e,...t){if(this._eventListeners.has(e))for(let r of this._eventListeners.get(e))r(...t);if(this._internalEventListeners.has(e))for(let r of this._internalEventListeners.get(e))r(...t)}registerInternalEvent(){let e=n(t=>this.addInternalListener(e,t),"eventBinder");return e}addInternalListener(e,t){return this._addListener(!0,e,t)}removeInternalListener(e,t){this._removeListener(!0,e,t)}_addListener(e,t,r){let a=e?this._eventListeners:this._internalEventListeners;return a.has(t)?a.get(t).push(r):a.set(t,[r]),new wC.Listener(this,t,r,e)}_removeListener(e,t,r){let a=e?this._eventListeners:this._internalEventListeners;if(!t)a.clear();else if(typeof t=="object"){let s=t;this._removeListener(s._internal,s.event,s.listener)}else{let s=t;if(a.has(s))if(r){let o=a.get(s),l=0;for(;(l=o.indexOf(r))!==-1;)o.splice(l,1)}else a.delete(s)}}};So.EventEmitter=ld});var ud=u(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.Listener=kr.EventEmitter=void 0;var vC=Gf();Object.defineProperty(kr,"EventEmitter",{enumerable:!0,get:n(function(){return vC.EventEmitter},"get")});var SC=od();Object.defineProperty(kr,"Listener",{enumerable:!0,get:n(function(){return SC.Listener},"get")})});var Ho=u(Mr=>{"use strict";Object.defineProperty(Mr,"__esModule",{value:!0});Mr.accessTokenIsExpired=Mr.getExpiryDateOfAccessToken=void 0;var cd=C(),HC=6e4;function Wf(i){return(0,cd.mapNullable)(i.expiresIn,e=>i.obtainmentTimestamp+e*1e3-HC)}n(Wf,"getExpiryMillis");function CC(i){return(0,cd.mapNullable)(Wf(i),e=>new Date(e))}n(CC,"getExpiryDateOfAccessToken");Mr.getExpiryDateOfAccessToken=CC;function qC(i){var e;return(e=(0,cd.mapNullable)(Wf(i),t=>Date.now()>t))!==null&&e!==void 0?e:!1}n(qC,"accessTokenIsExpired");Mr.accessTokenIsExpired=qC});var qo=u(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});Co.InvalidTokenError=void 0;var EC=m(),dd=class extends EC.CustomError{static{n(this,"InvalidTokenError")}constructor(e){super("Invalid token supplied",e)}};Co.InvalidTokenError=dd});var Po=u(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.InvalidTokenTypeError=void 0;var PC=m(),hd=class extends PC.CustomError{static{n(this,"InvalidTokenTypeError")}};Eo.InvalidTokenTypeError=hd});var Vf=u(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.createRevokeTokenQuery=ut.createRefreshTokenQuery=ut.createGetAppTokenQuery=ut.createExchangeCodeQuery=void 0;function AC(i,e,t,r){return{grant_type:"authorization_code",client_id:i,client_secret:e,code:t,redirect_uri:r}}n(AC,"createExchangeCodeQuery");ut.createExchangeCodeQuery=AC;function DC(i,e){return{grant_type:"client_credentials",client_id:i,client_secret:e}}n(DC,"createGetAppTokenQuery");ut.createGetAppTokenQuery=DC;function IC(i,e,t){return{grant_type:"refresh_token",client_id:i,client_secret:e,refresh_token:t}}n(IC,"createRefreshTokenQuery");ut.createRefreshTokenQuery=IC;function TC(i,e){return{client_id:i,token:e}}n(TC,"createRevokeTokenQuery");ut.createRevokeTokenQuery=TC});var _d=u(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.TokenInfo=void 0;var RC=(b(),x(g)),UC=C(),nr=m(),pd=class extends nr.DataObject{static{n(this,"TokenInfo")}constructor(e){super(e),this._obtainmentDate=new Date}get clientId(){return this[nr.rawDataSymbol].client_id}get userId(){var e;return(e=this[nr.rawDataSymbol].user_id)!==null&&e!==void 0?e:null}get userName(){var e;return(e=this[nr.rawDataSymbol].login)!==null&&e!==void 0?e:null}get scopes(){return this[nr.rawDataSymbol].scopes}get expiryDate(){return(0,UC.mapNullable)(this[nr.rawDataSymbol].expires_in,e=>new Date(this._obtainmentDate.getTime()+e*1e3))}};Ci.TokenInfo=pd;Ci.TokenInfo=pd=RC.__decorate([(0,nr.rtfm)("auth","TokenInfo","clientId")],pd)});var Ei=u(ee=>{"use strict";Object.defineProperty(ee,"__esModule",{value:!0});ee.loadAndCompareTokenInfo=ee.compareScopeSets=ee.compareScopes=ee.getValidTokenFromProviderForIntent=ee.getValidTokenFromProviderForUser=ee.getTokenInfo=ee.revokeToken=ee.refreshUserToken=ee.getAppToken=ee.exchangeCode=void 0;var Lr=Y(),qi=qo(),BC=Po(),Ao=Vf(),OC=_d();function md(i){var e,t;return{accessToken:i.access_token,refreshToken:i.refresh_token||null,scope:(e=i.scope)!==null&&e!==void 0?e:[],expiresIn:(t=i.expires_in)!==null&&t!==void 0?t:null,obtainmentTimestamp:Date.now()}}n(md,"createAccessTokenFromData");async function jC(i,e,t,r){return md(await(0,Lr.callTwitchApi)({type:"auth",url:"token",method:"POST",query:(0,Ao.createExchangeCodeQuery)(i,e,t,r)}))}n(jC,"exchangeCode");ee.exchangeCode=jC;async function kC(i,e){return md(await(0,Lr.callTwitchApi)({type:"auth",url:"token",method:"POST",query:(0,Ao.createGetAppTokenQuery)(i,e)}))}n(kC,"getAppToken");ee.getAppToken=kC;async function MC(i,e,t){return md(await(0,Lr.callTwitchApi)({type:"auth",url:"token",method:"POST",query:(0,Ao.createRefreshTokenQuery)(i,e,t)}))}n(MC,"refreshUserToken");ee.refreshUserToken=MC;async function LC(i,e){await(0,Lr.callTwitchApi)({type:"auth",url:"revoke",method:"POST",query:(0,Ao.createRevokeTokenQuery)(i,e)})}n(LC,"revokeToken");ee.revokeToken=LC;async function Fr(i,e){try{let t=await(0,Lr.callTwitchApi)({type:"auth",url:"validate"},e,i);return new OC.TokenInfo(t)}catch(t){throw t instanceof Lr.HttpStatusCodeError&&t.statusCode===401?new qi.InvalidTokenError({cause:t}):t}}n(Fr,"getTokenInfo");ee.getTokenInfo=Fr;async function FC(i,e,t,r){let a=null,s=!1;try{let o=await i.getAccessTokenForUser(e,t);if(o){s=!0;let l=await Fr(o.accessToken);return{accessToken:o,tokenInfo:l}}}catch(o){o instanceof qi.InvalidTokenError?a=o:r?.error(`Retrieving an access token failed: ${o.message}`)}if(s&&(r?.warn("No valid token available; trying to refresh"),i.refreshAccessTokenForUser))try{let o=await i.refreshAccessTokenForUser(e),l=await Fr(o.accessToken);return{accessToken:o,tokenInfo:l}}catch(o){o instanceof qi.InvalidTokenError?a=o:r?.error(`Refreshing the access token failed: ${o.message}`)}throw a??new Error("Could not retrieve a valid token")}n(FC,"getValidTokenFromProviderForUser");ee.getValidTokenFromProviderForUser=FC;async function NC(i,e,t,r){let a=null,s=!1;if(!i.getAccessTokenForIntent)throw new BC.InvalidTokenTypeError("This call requires an AuthProvider that supports intents.\nPlease use an auth provider that does, such as `RefreshingAuthProvider`.");try{let o=await i.getAccessTokenForIntent(e,t);if(o){s=!0;let l=await Fr(o.accessToken);return{accessToken:o,tokenInfo:l}}}catch(o){o instanceof qi.InvalidTokenError?a=o:r?.error(`Retrieving an access token failed: ${o.message}`)}if(s&&(r?.warn("No valid token available; trying to refresh"),i.refreshAccessTokenForIntent))try{let o=await i.refreshAccessTokenForIntent(e),l=await Fr(o.accessToken);return{accessToken:o,tokenInfo:l}}catch(o){o instanceof qi.InvalidTokenError?a=o:r?.error(`Refreshing the access token failed: ${o.message}`)}throw a??new Error("Could not retrieve a valid token")}n(NC,"getValidTokenFromProviderForIntent");ee.getValidTokenFromProviderForIntent=NC;var QC=new Map([["channel_commercial",["channel:edit:commercial"]],["channel_editor",["channel:manage:broadcast"]],["channel_read",["channel:read:stream_key"]],["channel_subscriptions",["channel:read:subscriptions"]],["user_blocks_read",["user:read:blocked_users"]],["user_blocks_edit",["user:manage:blocked_users"]],["user_follows_edit",["user:edit:follows"]],["user_read",["user:read:email"]],["user_subscriptions",["user:read:subscriptions"]],["user:edit:broadcast",["channel:manage:broadcast","channel:manage:extensions"]]]);function $f(i,e){if(e?.length){let t=new Set(i.flatMap(r=>{var a;return[r,...(a=QC.get(r))!==null&&a!==void 0?a:[]]}));if(e.every(r=>!t.has(r))){let r=e.join(", ");throw new Error(`This token does not have any of the requested scopes (${r}) and can not be upgraded.
|
|
11
|
+
${!o&&s.length>150?`${s.slice(0,147)}...`:s}`),this._statusCode=e,this._url=r,this._method=a,this._body=s}get statusCode(){return this._statusCode}get url(){return this._url}get method(){return this._method}get body(){return this._body}};po.HttpStatusCodeError=id});var ad=u(Br=>{"use strict";Object.defineProperty(Br,"__esModule",{value:!0});Br.transformTwitchApiResponse=Br.handleTwitchApiResponseError=void 0;var $H=$c(),zH=nd();async function KH(i,e){var t;if(!i.ok){let r=i.headers.get("Content-Type")==="application/json",a=r?JSON.stringify(await i.json(),null,2):await i.text(),s=(0,$H.stringify)(e.query,{arrayFormat:"repeat",addQueryPrefix:!0}),o=`${e.url}${s}`;throw new zH.HttpStatusCodeError(i.status,i.statusText,o,(t=e.method)!==null&&t!==void 0?t:"GET",a,r)}}n(KH,"handleTwitchApiResponseError");Br.handleTwitchApiResponseError=KH;async function JH(i){if(i.status===204)return;let e=await i.text();if(e)return JSON.parse(e)}n(JH,"transformTwitchApiResponse");Br.transformTwitchApiResponse=JH});var If=u(_o=>{"use strict";Object.defineProperty(_o,"__esModule",{value:!0});_o.getTwitchApiUrl=void 0;function ZH(i,e,t){switch(e){case"helix":{let r=i.replace(/^\//,"");return t?r==="eventsub/subscriptions"?`http://localhost:${t}/${r}`:`http://localhost:${t}/mock/${r}`:`https://api.twitch.tv/helix/${r}`}case"auth":return`https://id.twitch.tv/oauth2/${i.replace(/^\//,"")}`;case"custom":return i;default:return i}}n(ZH,"getTwitchApiUrl");_o.getTwitchApiUrl=ZH});var Of=u(jr=>{"use strict";Object.defineProperty(jr,"__esModule",{value:!0});jr.callTwitchApi=jr.callTwitchApiRaw=void 0;var Tf=uf(),XH=$c(),Rf=ad(),YH=If();async function Uf(i,e,t,r,a={},s){var o,l;let d=(o=i.type)!==null&&o!==void 0?o:"helix",p=(0,YH.getTwitchApiUrl)(i.url,d,s),h=(0,XH.stringify)(i.query,{arrayFormat:"repeat",addQueryPrefix:!0}),w=new Tf.Headers({Accept:"application/json"}),E;i.jsonBody&&(E=JSON.stringify(i.jsonBody),w.append("Content-Type","application/json")),e&&d!=="auth"&&w.append("Client-ID",e),t&&w.append("Authorization",`${d==="helix"?r??"Bearer":"OAuth"} ${t}`);let P={...a,method:(l=i.method)!==null&&l!==void 0?l:"GET",headers:w,body:E};return await(0,Tf.default)(`${p}${h}`,P)}n(Uf,"callTwitchApiRaw");jr.callTwitchApiRaw=Uf;async function eC(i,e,t,r,a={}){let s=await Uf(i,e,t,r,a);return await(0,Rf.handleTwitchApiResponseError)(s,i),await(0,Rf.transformTwitchApiResponse)(s)}n(eC,"callTwitchApi");jr.callTwitchApi=eC});var Bf=u(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.createBroadcasterQuery=void 0;var tC=_();function rC(i){return{broadcaster_id:(0,tC.extractUserId)(i)}}n(rC,"createBroadcasterQuery");mo.createBroadcasterQuery=rC});var Y=u(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.HttpStatusCodeError=Ae.transformTwitchApiResponse=Ae.handleTwitchApiResponseError=Ae.createBroadcasterQuery=Ae.callTwitchApiRaw=Ae.callTwitchApi=void 0;var jf=Of();Object.defineProperty(Ae,"callTwitchApi",{enumerable:!0,get:n(function(){return jf.callTwitchApi},"get")});Object.defineProperty(Ae,"callTwitchApiRaw",{enumerable:!0,get:n(function(){return jf.callTwitchApiRaw},"get")});var iC=Bf();Object.defineProperty(Ae,"createBroadcasterQuery",{enumerable:!0,get:n(function(){return iC.createBroadcasterQuery},"get")});var kf=ad();Object.defineProperty(Ae,"handleTwitchApiResponseError",{enumerable:!0,get:n(function(){return kf.handleTwitchApiResponseError},"get")});Object.defineProperty(Ae,"transformTwitchApiResponse",{enumerable:!0,get:n(function(){return kf.transformTwitchApiResponse},"get")});var nC=nd();Object.defineProperty(Ae,"HttpStatusCodeError",{enumerable:!0,get:n(function(){return nC.HttpStatusCodeError},"get")})});var od=u(yo=>{"use strict";Object.defineProperty(yo,"__esModule",{value:!0});yo.ConfigError=void 0;var aC=_(),sd=class extends aC.CustomError{static{n(this,"ConfigError")}};yo.ConfigError=sd});var Mf=u(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.HelixRateLimiter=void 0;var sC=io(),oC=Y(),ld=class extends sC.ResponseBasedRateLimiter{static{n(this,"HelixRateLimiter")}async doRequest({options:e,clientId:t,accessToken:r,authorizationType:a,fetchOptions:s,mockServerPort:o}){return await(0,oC.callTwitchApiRaw)(e,t,r,a,s,o)}needsToRetryAfter(e){return e.status===429&&(!e.headers.has("ratelimit-remaining")||Number(e.headers.get("ratelimit-remaining"))===0)?+e.headers.get("ratelimit-reset")*1e3-Date.now():null}getParametersFromResponse(e){let{headers:t}=e;return{limit:+t.get("ratelimit-limit"),remaining:+t.get("ratelimit-remaining"),resetsAt:+t.get("ratelimit-reset")*1e3}}};fo.HelixRateLimiter=ld});var Hi=u(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});go.createCacheKey=void 0;function lC(i){switch(typeof i){case"undefined":return"";case"object":{if(i===null)return"";if("cacheKey"in i)return i.cacheKey;let e=JSON.stringify(i);if(e!=="{}")return e}default:return i.toString()}}n(lC,"createSingleCacheKey");function uC(i,e,t){return[i,...e.map(lC)].join("/")+(t?"/":"")}n(uC,"createCacheKey");go.createCacheKey=uC});var Lf=u(bo=>{"use strict";Object.defineProperty(bo,"__esModule",{value:!0});bo.Cacheable=void 0;var cC=Hi(),xt=Symbol("cache");function dC(i){var e,t;return t=class extends i{static{n(this,"_b")}constructor(){super(...arguments),this[e]=new Map}getFromCache(r){if(this._cleanCache(),this[xt].has(r)){let a=this[xt].get(r);if(a)return a.value}}setCache(r,a,s){this[xt].set(r,{value:a,expires:Date.now()+s*1e3})}removeFromCache(r,a){let s=this._getInternalCacheKey(r,a);a?this[xt].forEach((o,l)=>{l.startsWith(s)&&this[xt].delete(l)}):this[xt].delete(s)}_cleanCache(){let r=Date.now();this[xt].forEach((a,s)=>{a.expires<r&&this[xt].delete(s)})}_getInternalCacheKey(r,a){if(typeof r=="string"){let s=r;return s.endsWith("/")||(s+="/"),s}else{let s=r.shift();return(0,cC.createCacheKey)(s,r,a)}}},e=xt,t}n(dC,"Cacheable");bo.Cacheable=dC});var Ff=u(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});xo.Cached=void 0;var hC=Hi();function pC(i=1/0,e=!1){return function(t,r,a){let s=a.value;return a.value=async function(...o){let l=(0,hC.createCacheKey)(r,o),d=this.getFromCache(l);if(d)return d;let p=await s.apply(this,o);return(p!=null||e)&&this.setCache(l,p,i),p},a}}n(pC,"Cached");xo.Cached=pC});var Nf=u(wo=>{"use strict";Object.defineProperty(wo,"__esModule",{value:!0});wo.CachedGetter=void 0;var _C=Hi();function mC(i=1/0){return function(e,t,r){if(r.get){let a=r.get;r.get=function(){let s=(0,_C.createCacheKey)(t,[]),o=this.getFromCache(s);if(o)return o;let l=a.call(this);return this.setCache(s,l,i),l}}return r}}n(mC,"CachedGetter");wo.CachedGetter=mC});var Qf=u(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.ClearsCache=void 0;function yC(i,e){return function(t,r,a){let s=a.value;return a.value=async function(...o){let l=await s.apply(this,o),d=e===void 0?o.slice():o.slice(0,e);return this.removeFromCache([i,...d],!0),l},a}}n(yC,"ClearsCache");vo.ClearsCache=yC});var Ci=u(Qe=>{"use strict";Object.defineProperty(Qe,"__esModule",{value:!0});Qe.createCacheKey=Qe.ClearsCache=Qe.CachedGetter=Qe.Cached=Qe.Cacheable=void 0;var fC=Lf();Object.defineProperty(Qe,"Cacheable",{enumerable:!0,get:n(function(){return fC.Cacheable},"get")});var gC=Ff();Object.defineProperty(Qe,"Cached",{enumerable:!0,get:n(function(){return gC.Cached},"get")});var bC=Nf();Object.defineProperty(Qe,"CachedGetter",{enumerable:!0,get:n(function(){return bC.CachedGetter},"get")});var xC=Qf();Object.defineProperty(Qe,"ClearsCache",{enumerable:!0,get:n(function(){return xC.ClearsCache},"get")});var wC=Hi();Object.defineProperty(Qe,"createCacheKey",{enumerable:!0,get:n(function(){return wC.createCacheKey},"get")})});var cd=u(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});So.Listener=void 0;var ud=class{static{n(this,"Listener")}constructor(e,t,r,a=!1){this.owner=e,this.event=t,this.listener=r,this._internal=a}unbind(){this.owner.removeListener(this)}};So.Listener=ud});var Gf=u(Ho=>{"use strict";Object.defineProperty(Ho,"__esModule",{value:!0});Ho.EventEmitter=void 0;var vC=cd(),dd=class{static{n(this,"EventEmitter")}constructor(){this._eventListeners=new Map,this._internalEventListeners=new Map}on(e,t){return this._addListener(!1,e,t)}addListener(e,t){return this._addListener(!1,e,t)}removeListener(e,t){this._removeListener(!1,e,t)}registerEvent(){let e=n(t=>this.addListener(e,t),"eventBinder");return e}emit(e,...t){if(this._eventListeners.has(e))for(let r of this._eventListeners.get(e))r(...t);if(this._internalEventListeners.has(e))for(let r of this._internalEventListeners.get(e))r(...t)}registerInternalEvent(){let e=n(t=>this.addInternalListener(e,t),"eventBinder");return e}addInternalListener(e,t){return this._addListener(!0,e,t)}removeInternalListener(e,t){this._removeListener(!0,e,t)}_addListener(e,t,r){let a=e?this._eventListeners:this._internalEventListeners;return a.has(t)?a.get(t).push(r):a.set(t,[r]),new vC.Listener(this,t,r,e)}_removeListener(e,t,r){let a=e?this._eventListeners:this._internalEventListeners;if(!t)a.clear();else if(typeof t=="object"){let s=t;this._removeListener(s._internal,s.event,s.listener)}else{let s=t;if(a.has(s))if(r){let o=a.get(s),l=0;for(;(l=o.indexOf(r))!==-1;)o.splice(l,1)}else a.delete(s)}}};Ho.EventEmitter=dd});var hd=u(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.Listener=kr.EventEmitter=void 0;var SC=Gf();Object.defineProperty(kr,"EventEmitter",{enumerable:!0,get:n(function(){return SC.EventEmitter},"get")});var HC=cd();Object.defineProperty(kr,"Listener",{enumerable:!0,get:n(function(){return HC.Listener},"get")})});var Co=u(Mr=>{"use strict";Object.defineProperty(Mr,"__esModule",{value:!0});Mr.accessTokenIsExpired=Mr.getExpiryDateOfAccessToken=void 0;var pd=C(),CC=6e4;function Wf(i){return(0,pd.mapNullable)(i.expiresIn,e=>i.obtainmentTimestamp+e*1e3-CC)}n(Wf,"getExpiryMillis");function qC(i){return(0,pd.mapNullable)(Wf(i),e=>new Date(e))}n(qC,"getExpiryDateOfAccessToken");Mr.getExpiryDateOfAccessToken=qC;function EC(i){var e;return(e=(0,pd.mapNullable)(Wf(i),t=>Date.now()>t))!==null&&e!==void 0?e:!1}n(EC,"accessTokenIsExpired");Mr.accessTokenIsExpired=EC});var Eo=u(qo=>{"use strict";Object.defineProperty(qo,"__esModule",{value:!0});qo.InvalidTokenError=void 0;var PC=_(),_d=class extends PC.CustomError{static{n(this,"InvalidTokenError")}constructor(e){super("Invalid token supplied",e)}};qo.InvalidTokenError=_d});var Ao=u(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.InvalidTokenTypeError=void 0;var AC=_(),md=class extends AC.CustomError{static{n(this,"InvalidTokenTypeError")}};Po.InvalidTokenTypeError=md});var Vf=u(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.createRevokeTokenQuery=ct.createRefreshTokenQuery=ct.createGetAppTokenQuery=ct.createExchangeCodeQuery=void 0;function DC(i,e,t,r){return{grant_type:"authorization_code",client_id:i,client_secret:e,code:t,redirect_uri:r}}n(DC,"createExchangeCodeQuery");ct.createExchangeCodeQuery=DC;function IC(i,e){return{grant_type:"client_credentials",client_id:i,client_secret:e}}n(IC,"createGetAppTokenQuery");ct.createGetAppTokenQuery=IC;function TC(i,e,t){return{grant_type:"refresh_token",client_id:i,client_secret:e,refresh_token:t}}n(TC,"createRefreshTokenQuery");ct.createRefreshTokenQuery=TC;function RC(i,e){return{client_id:i,token:e}}n(RC,"createRevokeTokenQuery");ct.createRevokeTokenQuery=RC});var fd=u(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.TokenInfo=void 0;var UC=(b(),x(g)),OC=C(),ar=_(),yd=class extends ar.DataObject{static{n(this,"TokenInfo")}constructor(e){super(e),this._obtainmentDate=new Date}get clientId(){return this[ar.rawDataSymbol].client_id}get userId(){var e;return(e=this[ar.rawDataSymbol].user_id)!==null&&e!==void 0?e:null}get userName(){var e;return(e=this[ar.rawDataSymbol].login)!==null&&e!==void 0?e:null}get scopes(){return this[ar.rawDataSymbol].scopes}get expiryDate(){return(0,OC.mapNullable)(this[ar.rawDataSymbol].expires_in,e=>new Date(this._obtainmentDate.getTime()+e*1e3))}};qi.TokenInfo=yd;qi.TokenInfo=yd=UC.__decorate([(0,ar.rtfm)("auth","TokenInfo","clientId")],yd)});var Pi=u(ee=>{"use strict";Object.defineProperty(ee,"__esModule",{value:!0});ee.loadAndCompareTokenInfo=ee.compareScopeSets=ee.compareScopes=ee.getValidTokenFromProviderForIntent=ee.getValidTokenFromProviderForUser=ee.getTokenInfo=ee.revokeToken=ee.refreshUserToken=ee.getAppToken=ee.exchangeCode=void 0;var Lr=Y(),Ei=Eo(),BC=Ao(),Do=Vf(),jC=fd();function gd(i){var e,t;return{accessToken:i.access_token,refreshToken:i.refresh_token||null,scope:(e=i.scope)!==null&&e!==void 0?e:[],expiresIn:(t=i.expires_in)!==null&&t!==void 0?t:null,obtainmentTimestamp:Date.now()}}n(gd,"createAccessTokenFromData");async function kC(i,e,t,r){return gd(await(0,Lr.callTwitchApi)({type:"auth",url:"token",method:"POST",query:(0,Do.createExchangeCodeQuery)(i,e,t,r)}))}n(kC,"exchangeCode");ee.exchangeCode=kC;async function MC(i,e){return gd(await(0,Lr.callTwitchApi)({type:"auth",url:"token",method:"POST",query:(0,Do.createGetAppTokenQuery)(i,e)}))}n(MC,"getAppToken");ee.getAppToken=MC;async function LC(i,e,t){return gd(await(0,Lr.callTwitchApi)({type:"auth",url:"token",method:"POST",query:(0,Do.createRefreshTokenQuery)(i,e,t)}))}n(LC,"refreshUserToken");ee.refreshUserToken=LC;async function FC(i,e){await(0,Lr.callTwitchApi)({type:"auth",url:"revoke",method:"POST",query:(0,Do.createRevokeTokenQuery)(i,e)})}n(FC,"revokeToken");ee.revokeToken=FC;async function Fr(i,e){try{let t=await(0,Lr.callTwitchApi)({type:"auth",url:"validate"},e,i);return new jC.TokenInfo(t)}catch(t){throw t instanceof Lr.HttpStatusCodeError&&t.statusCode===401?new Ei.InvalidTokenError({cause:t}):t}}n(Fr,"getTokenInfo");ee.getTokenInfo=Fr;async function NC(i,e,t,r){let a=null,s=!1;try{let o=await i.getAccessTokenForUser(e,t);if(o){s=!0;let l=await Fr(o.accessToken);return{accessToken:o,tokenInfo:l}}}catch(o){o instanceof Ei.InvalidTokenError?a=o:r?.error(`Retrieving an access token failed: ${o.message}`)}if(s&&(r?.warn("No valid token available; trying to refresh"),i.refreshAccessTokenForUser))try{let o=await i.refreshAccessTokenForUser(e),l=await Fr(o.accessToken);return{accessToken:o,tokenInfo:l}}catch(o){o instanceof Ei.InvalidTokenError?a=o:r?.error(`Refreshing the access token failed: ${o.message}`)}throw a??new Error("Could not retrieve a valid token")}n(NC,"getValidTokenFromProviderForUser");ee.getValidTokenFromProviderForUser=NC;async function QC(i,e,t,r){let a=null,s=!1;if(!i.getAccessTokenForIntent)throw new BC.InvalidTokenTypeError("This call requires an AuthProvider that supports intents.\nPlease use an auth provider that does, such as `RefreshingAuthProvider`.");try{let o=await i.getAccessTokenForIntent(e,t);if(o){s=!0;let l=await Fr(o.accessToken);return{accessToken:o,tokenInfo:l}}}catch(o){o instanceof Ei.InvalidTokenError?a=o:r?.error(`Retrieving an access token failed: ${o.message}`)}if(s&&(r?.warn("No valid token available; trying to refresh"),i.refreshAccessTokenForIntent))try{let o=await i.refreshAccessTokenForIntent(e),l=await Fr(o.accessToken);return{accessToken:o,tokenInfo:l}}catch(o){o instanceof Ei.InvalidTokenError?a=o:r?.error(`Refreshing the access token failed: ${o.message}`)}throw a??new Error("Could not retrieve a valid token")}n(QC,"getValidTokenFromProviderForIntent");ee.getValidTokenFromProviderForIntent=QC;var GC=new Map([["channel_commercial",["channel:edit:commercial"]],["channel_editor",["channel:manage:broadcast"]],["channel_read",["channel:read:stream_key"]],["channel_subscriptions",["channel:read:subscriptions"]],["user_blocks_read",["user:read:blocked_users"]],["user_blocks_edit",["user:manage:blocked_users"]],["user_follows_edit",["user:edit:follows"]],["user_read",["user:read:email"]],["user_subscriptions",["user:read:subscriptions"]],["user:edit:broadcast",["channel:manage:broadcast","channel:manage:extensions"]]]);function $f(i,e){if(e?.length){let t=new Set(i.flatMap(r=>{var a;return[r,...(a=GC.get(r))!==null&&a!==void 0?a:[]]}));if(e.every(r=>!t.has(r))){let r=e.join(", ");throw new Error(`This token does not have any of the requested scopes (${r}) and can not be upgraded.
|
|
12
12
|
If you need dynamically upgrading scopes, please implement the AuthProvider interface accordingly:
|
|
13
13
|
|
|
14
|
-
https://twurple.js.org/reference/auth/interfaces/AuthProvider.html`)}}}n($f,"compareScopes");ee.compareScopes=$f;function zf(i,e){for(let t of e)$f(i,t)}n(zf,"compareScopeSets");ee.compareScopeSets=zf;async function
|
|
14
|
+
https://twurple.js.org/reference/auth/interfaces/AuthProvider.html`)}}}n($f,"compareScopes");ee.compareScopes=$f;function zf(i,e){for(let t of e)$f(i,t)}n(zf,"compareScopeSets");ee.compareScopeSets=zf;async function WC(i,e,t,r,a){if(a?.length||!t){let s=await Fr(e,i);if(!s.userId)throw new Error("Trying to use an app access token as a user access token");let o=r??s.scopes;return a&&zf(o,a.filter(l=>!!l)),[o,s.userId]}return[r,t]}n(WC,"loadAndCompareTokenInfo");ee.loadAndCompareTokenInfo=WC});var To=u(Io=>{"use strict";Object.defineProperty(Io,"__esModule",{value:!0});Io.TokenFetcher=void 0;var Kf=C(),bd=class{static{n(this,"TokenFetcher")}constructor(e){this._newTokenScopeSets=[],this._newTokenPromise=null,this._queuedScopeSets=[],this._queueExecutor=null,this._queuePromise=null,this._executor=e}async fetch(...e){var t;let r=e.filter(l=>!!l);if(this._newTokenPromise){if(!r.length)return await this._newTokenPromise;if(this._queueExecutor?this._queuedScopeSets.push(...r):this._queuedScopeSets=[...r],!this._queuePromise){let{promise:l,resolve:d,reject:p}=(0,Kf.promiseWithResolvers)();this._queuePromise=l,this._queueExecutor=async()=>{var h;if(this._queuePromise){this._newTokenScopeSets=this._queuedScopeSets,this._queuedScopeSets=[],this._newTokenPromise=this._queuePromise,this._queuePromise=null,this._queueExecutor=null;try{d(await this._executor(this._newTokenScopeSets))}catch(w){p(w)}finally{this._newTokenPromise=null,this._newTokenScopeSets=[],(h=this._queueExecutor)===null||h===void 0||h.call(this)}}}}return await this._queuePromise}this._newTokenScopeSets=[...r];let{promise:a,resolve:s,reject:o}=(0,Kf.promiseWithResolvers)();this._newTokenPromise=a;try{s(await this._executor(this._newTokenScopeSets))}catch(l){o(l)}finally{this._newTokenPromise=null,this._newTokenScopeSets=[],(t=this._queueExecutor)===null||t===void 0||t.call(this)}return await a}};Io.TokenFetcher=bd});var Zf=u(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai.AppTokenAuthProvider=void 0;var Ro=(b(),x(g)),xd=C(),Jf=_(),VC=Co(),$C=Pi(),zC=To(),Nr=class{static{n(this,"AppTokenAuthProvider")}constructor(e,t,r=[]){this._clientId=e,this._clientSecret=t,this._impliedScopes=r,this._fetcher=new zC.TokenFetcher(async a=>await this._fetch(a))}get clientId(){return this._clientId}get currentScopes(){return this._impliedScopes}async getAccessTokenForUser(e,...t){if(t.every(r=>{var a;return(a=r?.some(s=>this._impliedScopes.includes(s)))!==null&&a!==void 0?a:!0}))return{...await this.getAppAccessToken(),userId:(0,Jf.extractUserId)(e)};throw new Error("Can not get user access token for AppTokenAuthProvider")}getCurrentScopesForUser(){return this._impliedScopes}async getAnyAccessToken(){return await this._fetcher.fetch()}async getAppAccessToken(e=!1){return e&&(this._token=void 0),await this._fetcher.fetch()}async _fetch(e){if(e.length>0)for(let t of e)if(this._impliedScopes.length){if(t.every(r=>!this._impliedScopes.includes(r)))throw new Error(`One of the scopes ${t.join(", ")} requested but only the scope ${this._impliedScopes.join(", ")} is implied`)}else throw new Error(`One of the scopes ${t.join(", ")} requested but the client credentials flow does not support scopes`);return!this._token||(0,VC.accessTokenIsExpired)(this._token)?this._token=await(0,$C.getAppToken)(this._clientId,this._clientSecret):this._token}};Ai.AppTokenAuthProvider=Nr;Ro.__decorate([(0,xd.Enumerable)(!1)],Nr.prototype,"_clientSecret",void 0);Ro.__decorate([(0,xd.Enumerable)(!1)],Nr.prototype,"_token",void 0);Ro.__decorate([(0,xd.Enumerable)(!1)],Nr.prototype,"_fetcher",void 0);Ai.AppTokenAuthProvider=Nr=Ro.__decorate([(0,Jf.rtfm)("auth","AppTokenAuthProvider","clientId")],Nr)});var vd=u(Uo=>{"use strict";Object.defineProperty(Uo,"__esModule",{value:!0});Uo.CachedRefreshFailureError=void 0;var KC=_(),wd=class extends KC.CustomError{static{n(this,"CachedRefreshFailureError")}constructor(e){super(`The user context for the user ${e} has been disabled.
|
|
15
15
|
This happened because the access token became invalid (e.g. by expiry) and refreshing it failed (e.g. because the account's password was changed).
|
|
16
16
|
|
|
17
|
-
Use .addUser(), .addUserForToken() or .addUserForCode() for the same user context to re-enable the user with a new, valid token.`),this.userId=e}};
|
|
17
|
+
Use .addUser(), .addUserForToken() or .addUserForCode() for the same user context to re-enable the user with a new, valid token.`),this.userId=e}};Uo.CachedRefreshFailureError=wd});var Hd=u(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});Oo.IntermediateUserRemovalError=void 0;var JC=_(),Sd=class extends JC.CustomError{static{n(this,"IntermediateUserRemovalError")}constructor(e){super(`User ${e} was removed while trying to fetch a token.
|
|
18
18
|
|
|
19
|
-
Make sure you're not executing any actions when you want to remove a user.`),this.userId=e}};Uo.IntermediateUserRemovalError=xd});var Sd=u(Bo=>{"use strict";Object.defineProperty(Bo,"__esModule",{value:!0});Bo.UnknownIntentError=void 0;var JC=m(),vd=class extends JC.CustomError{static{n(this,"UnknownIntentError")}constructor(e){super(`Unknown intent: ${e}`),this.intent=e}};Bo.UnknownIntentError=vd});var eg=u(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.RefreshingAuthProvider=void 0;var Qr=(b(),x(g)),Ai=C(),ZC=ud(),Ne=m(),Hd=Ho(),Xf=bd(),XC=wd(),Cd=qo(),YC=Po(),eq=Sd(),ct=Ei(),Yf=Io(),Mt=class extends ZC.EventEmitter{static{n(this,"RefreshingAuthProvider")}constructor(e){var t;super(),this._userAccessTokens=new Map,this._userTokenFetchers=new Map,this._intentToUserId=new Map,this._userIdToIntents=new Map,this._cachedRefreshFailures=new Set,this.onRefresh=this.registerEvent(),this.onRefreshFailure=this.registerEvent(),this._clientId=e.clientId,this._clientSecret=e.clientSecret,this._redirectUri=e.redirectUri,this._appImpliedScopes=(t=e.appImpliedScopes)!==null&&t!==void 0?t:[],this._appTokenFetcher=new Yf.TokenFetcher(async r=>await this._fetchAppToken(r))}addUser(e,t,r){let a=(0,Ne.extractUserId)(e);if(!t.refreshToken)throw new Error(`Trying to add user ${a} without refresh token`);this._cachedRefreshFailures.delete(a),this._userAccessTokens.set(a,{...t,userId:a}),this._userTokenFetchers.has(a)||this._userTokenFetchers.set(a,new Yf.TokenFetcher(async s=>await this._fetchUserToken(a,s))),r&&this.addIntentsToUser(e,r)}async addUserForToken(e,t){let r=null;if(e.accessToken&&!(0,Hd.accessTokenIsExpired)(e))try{let l=await(0,ct.getTokenInfo)(e.accessToken);r=[e,l]}catch(l){if(!(l instanceof Cd.InvalidTokenError))throw l}if(!r){if(!e.refreshToken)throw new Cd.InvalidTokenError;let l=await(0,ct.refreshUserToken)(this._clientId,this._clientSecret,e.refreshToken),c=await(0,ct.getTokenInfo)(l.accessToken);this.emit(this.onRefresh,c.userId,l),r=[l,c]}let[a,s]=r;if(!s.userId)throw new YC.InvalidTokenTypeError("Could not determine a user ID for your token; you might be trying to disguise an app token as a user token.");let o=a.scope?a:{...a,scope:s.scopes};return this.addUser(s.userId,o,t),s.userId}async addUserForCode(e,t){if(!this._redirectUri)throw new Error("This method requires you to pass a `redirectUri` as a configuration property");let r=await(0,ct.exchangeCode)(this._clientId,this._clientSecret,e,this._redirectUri);return await this.addUserForToken(r,t)}hasUser(e){return this._userTokenFetchers.has((0,Ne.extractUserId)(e))}removeUser(e){let t=(0,Ne.extractUserId)(e);if(this._userIdToIntents.has(t)){let r=this._userIdToIntents.get(t);for(let a of r)this._intentToUserId.delete(a);this._userIdToIntents.delete(t)}this._userAccessTokens.delete(t),this._userTokenFetchers.delete(t),this._cachedRefreshFailures.delete(t)}addIntentsToUser(e,t){let r=(0,Ne.extractUserId)(e);if(!this._userAccessTokens.has(r))throw new Error("Trying to add intents to a user that was not added to this provider");for(let a of t)this._intentToUserId.has(a)&&this._userIdToIntents.get(this._intentToUserId.get(a)).delete(a),this._intentToUserId.set(a,r),this._userIdToIntents.has(r)?this._userIdToIntents.get(r).add(a):this._userIdToIntents.set(r,new Set([a]))}getIntentsForUser(e){let t=(0,Ne.extractUserId)(e);return this._userIdToIntents.has(t)?Array.from(this._userIdToIntents.get(t)):[]}removeIntents(e){var t;for(let r of e)if(this._intentToUserId.has(r)){let a=this._intentToUserId.get(r);(t=this._userIdToIntents.get(a))===null||t===void 0||t.delete(r),this._intentToUserId.delete(r)}}async refreshAccessTokenForUser(e){let t=(0,Ne.extractUserId)(e);if(this._cachedRefreshFailures.has(t))throw new Xf.CachedRefreshFailureError(t);let r=this._userAccessTokens.get(t);if(!r)throw new Error("Trying to refresh token for user that was not added to the provider");let a=await this._refreshUserTokenWithCallback(t,r.refreshToken);return this._checkIntermediateUserRemoval(t),this._userAccessTokens.set(t,{...a,userId:t}),this.emit(this.onRefresh,t,a),{...a,userId:t}}async refreshAccessTokenForIntent(e){if(!this._intentToUserId.has(e))throw new eq.UnknownIntentError(e);let t=this._intentToUserId.get(e);return await this.refreshAccessTokenForUser(t)}get clientId(){return this._clientId}getCurrentScopesForUser(e){var t;let r=this._userAccessTokens.get((0,Ne.extractUserId)(e));if(!r)throw new Error("Trying to get scopes for user that was not added to the provider");return(t=r.scope)!==null&&t!==void 0?t:[]}async getAccessTokenForUser(e,...t){let r=(0,Ne.extractUserId)(e),a=this._userTokenFetchers.get(r);if(!a)return null;if(this._cachedRefreshFailures.has(r))throw new Xf.CachedRefreshFailureError(r);return(0,ct.compareScopeSets)(this.getCurrentScopesForUser(r),t.filter(Boolean)),await a.fetch(...t)}async getAccessTokenForIntent(e,...t){if(!this._intentToUserId.has(e))return null;let r=this._intentToUserId.get(e),a=await this.getAccessTokenForUser(r,...t);if(!a)throw new Ne.HellFreezesOverError(`Found intent ${e} corresponding to user ID ${r} but no token was found`);return{...a,userId:r}}async getAnyAccessToken(e){if(e){let t=(0,Ne.extractUserId)(e);if(this._userAccessTokens.has(t)){let r=await this.getAccessTokenForUser(t);if(!r)throw new Ne.HellFreezesOverError(`Token for user ID ${t} exists but nothing was returned by getAccessTokenForUser`);return{...r,userId:t}}}return await this.getAppAccessToken()}async getAppAccessToken(e=!1){return e&&(this._appAccessToken=void 0),await this._appTokenFetcher.fetch(...this._appImpliedScopes.map(t=>[t]))}_checkIntermediateUserRemoval(e){if(!this._userTokenFetchers.has(e))throw this._cachedRefreshFailures.delete(e),new XC.IntermediateUserRemovalError(e)}async _fetchUserToken(e,t){let r=this._userAccessTokens.get(e);if(!r)throw new Error("Trying to get token for user that was not added to the provider");if(r.accessToken&&!(0,Hd.accessTokenIsExpired)(r))try{if(r.scope)return(0,ct.compareScopeSets)(r.scope,t),r;let[s=[]]=await(0,ct.loadAndCompareTokenInfo)(this._clientId,r.accessToken,e,r.scope,t),o={...r,scope:s};return this._checkIntermediateUserRemoval(e),this._userAccessTokens.set(e,o),o}catch(s){if(!(s instanceof Cd.InvalidTokenError))throw s}this._checkIntermediateUserRemoval(e);let a=await this.refreshAccessTokenForUser(e);return(0,ct.compareScopeSets)(a.scope,t),a}async _refreshUserTokenWithCallback(e,t){try{return await(0,ct.refreshUserToken)(this.clientId,this._clientSecret,t)}catch(r){throw this._cachedRefreshFailures.add(e),this.emit(this.onRefreshFailure,e,r),r}}async _fetchAppToken(e){if(e.length>0)for(let t of e)if(this._appImpliedScopes.length){if(t.every(r=>!this._appImpliedScopes.includes(r)))throw new Error(`One of the scopes ${t.join(", ")} requested but only the scope ${this._appImpliedScopes.join(", ")} is implied`)}else throw new Error(`One of the scopes ${t.join(", ")} requested but the client credentials flow does not support scopes`);return!this._appAccessToken||(0,Hd.accessTokenIsExpired)(this._appAccessToken)?await this._refreshAppToken():this._appAccessToken}async _refreshAppToken(){return this._appAccessToken=await(0,ct.getAppToken)(this._clientId,this._clientSecret)}};Di.RefreshingAuthProvider=Mt;Qr.__decorate([(0,Ai.Enumerable)(!1)],Mt.prototype,"_clientSecret",void 0);Qr.__decorate([(0,Ai.Enumerable)(!1)],Mt.prototype,"_userAccessTokens",void 0);Qr.__decorate([(0,Ai.Enumerable)(!1)],Mt.prototype,"_userTokenFetchers",void 0);Qr.__decorate([(0,Ai.Enumerable)(!1)],Mt.prototype,"_appAccessToken",void 0);Qr.__decorate([(0,Ai.Enumerable)(!1)],Mt.prototype,"_appTokenFetcher",void 0);Di.RefreshingAuthProvider=Mt=Qr.__decorate([(0,Ne.rtfm)("auth","RefreshingAuthProvider","clientId")],Mt)});var rg=u(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.StaticAuthProvider=void 0;var qd=(b(),x(g)),tg=C(),tq=m(),rq=Ei(),Ii=class{static{n(this,"StaticAuthProvider")}constructor(e,t,r){this._clientId=e||"",this._accessToken=typeof t=="string"?{accessToken:t,refreshToken:null,scope:r??[],expiresIn:null,obtainmentTimestamp:Date.now()}:t,this._scopes=r}get clientId(){return this._clientId}async getAccessTokenForUser(e,...t){return await this._getAccessToken(t)}async getAccessTokenForIntent(e,...t){return await this._getAccessToken(t)}async getAnyAccessToken(){return await this._getAccessToken()}getCurrentScopesForUser(){var e;return(e=this._scopes)!==null&&e!==void 0?e:[]}async _getAccessToken(e){let[t,r]=await(0,rq.loadAndCompareTokenInfo)(this._clientId,this._accessToken.accessToken,this._userId,this._scopes,e);return this._scopes=t,this._userId=r,{...this._accessToken,userId:r}}};Ti.StaticAuthProvider=Ii;qd.__decorate([(0,tg.Enumerable)(!1)],Ii.prototype,"_clientId",void 0);qd.__decorate([(0,tg.Enumerable)(!1)],Ii.prototype,"_accessToken",void 0);Ti.StaticAuthProvider=Ii=qd.__decorate([(0,tq.rtfm)("auth","StaticAuthProvider","clientId")],Ii)});var Ed=u(R=>{"use strict";Object.defineProperty(R,"__esModule",{value:!0});R.UnknownIntentError=R.InvalidTokenTypeError=R.InvalidTokenError=R.IntermediateUserRemovalError=R.CachedRefreshFailureError=R.StaticAuthProvider=R.RefreshingAuthProvider=R.AppTokenAuthProvider=R.TokenInfo=R.TokenFetcher=R.revokeToken=R.refreshUserToken=R.getValidTokenFromProviderForIntent=R.getValidTokenFromProviderForUser=R.getTokenInfo=R.getAppToken=R.exchangeCode=R.getExpiryDateOfAccessToken=R.accessTokenIsExpired=void 0;var ig=Ho();Object.defineProperty(R,"accessTokenIsExpired",{enumerable:!0,get:n(function(){return ig.accessTokenIsExpired},"get")});Object.defineProperty(R,"getExpiryDateOfAccessToken",{enumerable:!0,get:n(function(){return ig.getExpiryDateOfAccessToken},"get")});var ar=Ei();Object.defineProperty(R,"exchangeCode",{enumerable:!0,get:n(function(){return ar.exchangeCode},"get")});Object.defineProperty(R,"getAppToken",{enumerable:!0,get:n(function(){return ar.getAppToken},"get")});Object.defineProperty(R,"getTokenInfo",{enumerable:!0,get:n(function(){return ar.getTokenInfo},"get")});Object.defineProperty(R,"getValidTokenFromProviderForUser",{enumerable:!0,get:n(function(){return ar.getValidTokenFromProviderForUser},"get")});Object.defineProperty(R,"getValidTokenFromProviderForIntent",{enumerable:!0,get:n(function(){return ar.getValidTokenFromProviderForIntent},"get")});Object.defineProperty(R,"refreshUserToken",{enumerable:!0,get:n(function(){return ar.refreshUserToken},"get")});Object.defineProperty(R,"revokeToken",{enumerable:!0,get:n(function(){return ar.revokeToken},"get")});var iq=Io();Object.defineProperty(R,"TokenFetcher",{enumerable:!0,get:n(function(){return iq.TokenFetcher},"get")});var nq=_d();Object.defineProperty(R,"TokenInfo",{enumerable:!0,get:n(function(){return nq.TokenInfo},"get")});var aq=Zf();Object.defineProperty(R,"AppTokenAuthProvider",{enumerable:!0,get:n(function(){return aq.AppTokenAuthProvider},"get")});var sq=eg();Object.defineProperty(R,"RefreshingAuthProvider",{enumerable:!0,get:n(function(){return sq.RefreshingAuthProvider},"get")});var oq=rg();Object.defineProperty(R,"StaticAuthProvider",{enumerable:!0,get:n(function(){return oq.StaticAuthProvider},"get")});var lq=bd();Object.defineProperty(R,"CachedRefreshFailureError",{enumerable:!0,get:n(function(){return lq.CachedRefreshFailureError},"get")});var uq=wd();Object.defineProperty(R,"IntermediateUserRemovalError",{enumerable:!0,get:n(function(){return uq.IntermediateUserRemovalError},"get")});var cq=qo();Object.defineProperty(R,"InvalidTokenError",{enumerable:!0,get:n(function(){return cq.InvalidTokenError},"get")});var dq=Po();Object.defineProperty(R,"InvalidTokenTypeError",{enumerable:!0,get:n(function(){return dq.InvalidTokenTypeError},"get")});var hq=Sd();Object.defineProperty(R,"UnknownIntentError",{enumerable:!0,get:n(function(){return hq.UnknownIntentError},"get")})});var ag=u((Lj,ng)=>{function Qe(i,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(i)),this._timeouts=i,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}n(Qe,"RetryOperation");ng.exports=Qe;Qe.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};Qe.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};Qe.prototype.retry=function(i){if(this._timeout&&clearTimeout(this._timeout),!i)return!1;var e=new Date().getTime();if(i&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(i),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(i);var t=this._timeouts.shift();if(t===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),t=this._cachedTimeouts.slice(-1);else return!1;var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},t),this._options.unref&&this._timer.unref(),!0};Qe.prototype.attempt=function(i,e){this._fn=i,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var t=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){t._operationTimeoutCb()},t._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};Qe.prototype.try=function(i){console.log("Using RetryOperation.try() is deprecated"),this.attempt(i)};Qe.prototype.start=function(i){console.log("Using RetryOperation.start() is deprecated"),this.attempt(i)};Qe.prototype.start=Qe.prototype.try;Qe.prototype.errors=function(){return this._errors};Qe.prototype.attempts=function(){return this._attempts};Qe.prototype.mainError=function(){if(this._errors.length===0)return null;for(var i={},e=null,t=0,r=0;r<this._errors.length;r++){var a=this._errors[r],s=a.message,o=(i[s]||0)+1;i[s]=o,o>=t&&(e=a,t=o)}return e}});var sg=u(sr=>{var pq=ag();sr.operation=function(i){var e=sr.timeouts(i);return new pq(e,{forever:i&&(i.forever||i.retries===1/0),unref:i&&i.unref,maxRetryTime:i&&i.maxRetryTime})};sr.timeouts=function(i){if(i instanceof Array)return[].concat(i);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var t in i)e[t]=i[t];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var r=[],a=0;a<e.retries;a++)r.push(this.createTimeout(a,e));return i&&i.forever&&!r.length&&r.push(this.createTimeout(a,e)),r.sort(function(s,o){return s-o}),r};sr.createTimeout=function(i,e){var t=e.randomize?Math.random()+1:1,r=Math.round(t*Math.max(e.minTimeout,1)*Math.pow(e.factor,i));return r=Math.min(r,e.maxTimeout),r};sr.wrap=function(i,e,t){if(e instanceof Array&&(t=e,e=null),!t){t=[];for(var r in i)typeof i[r]=="function"&&t.push(r)}for(var a=0;a<t.length;a++){var s=t[a],o=i[s];i[s]=n(function(c){var h=sr.operation(e),p=Array.prototype.slice.call(arguments,1),w=p.pop();p.push(function(E){h.retry(E)||(E&&(arguments[0]=h.mainError()),w.apply(this,arguments))}),h.attempt(function(){c.apply(i,p)})},"retryWrapper").bind(i,o),i[s].options=e}}});var lg=u((Gj,og)=>{og.exports=sg()});var ug=u(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});Oo.createBitsLeaderboardQuery=void 0;function _q(i={}){let{count:e=10,period:t="all",startDate:r,contextUserId:a}=i;return{count:e.toString(),period:t,started_at:r?.toISOString(),user_id:a}}n(_q,"createBitsLeaderboardQuery");Oo.createBitsLeaderboardQuery=_q});var G=u(ko=>{"use strict";Object.defineProperty(ko,"__esModule",{value:!0});ko.BaseApi=void 0;var mq=(b(),x(g)),yq=C(),jo=class{static{n(this,"BaseApi")}constructor(e){this._client=e}_getUserContextIdWithDefault(e){var t;return(t=this._client._getUserIdFromRequestContext(e))!==null&&t!==void 0?t:e}};ko.BaseApi=jo;mq.__decorate([(0,yq.Enumerable)(!1)],jo.prototype,"_client",void 0)});var Pd=u(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.HelixBitsLeaderboardEntry=void 0;var cg=(b(),x(g)),fq=C(),xt=m(),Mo=class extends xt.DataObject{static{n(this,"HelixBitsLeaderboardEntry")}constructor(e,t){super(e),this._client=t}get userId(){return this[xt.rawDataSymbol].user_id}get userName(){return this[xt.rawDataSymbol].user_login}get userDisplayName(){return this[xt.rawDataSymbol].user_name}get rank(){return this[xt.rawDataSymbol].rank}get amount(){return this[xt.rawDataSymbol].score}async getUser(){return(0,xt.checkRelationAssertion)(await this._client.users.getUserById(this[xt.rawDataSymbol].user_id))}};Ri.HelixBitsLeaderboardEntry=Mo;cg.__decorate([(0,fq.Enumerable)(!1)],Mo.prototype,"_client",void 0);Ri.HelixBitsLeaderboardEntry=Mo=cg.__decorate([(0,xt.rtfm)("api","HelixBitsLeaderboardEntry","userId")],Mo)});var Dd=u(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.HelixBitsLeaderboard=void 0;var Ad=(b(),x(g)),dg=Hi(),gq=C(),Lo=m(),bq=Pd(),Ui=class extends Lo.DataObject{static{n(this,"HelixBitsLeaderboard")}constructor(e,t){super(e),this._client=t}get entries(){return this[Lo.rawDataSymbol].data.map(e=>new bq.HelixBitsLeaderboardEntry(e,this._client))}get totalCount(){return this[Lo.rawDataSymbol].total}};Bi.HelixBitsLeaderboard=Ui;Ad.__decorate([(0,gq.Enumerable)(!1)],Ui.prototype,"_client",void 0);Ad.__decorate([(0,dg.CachedGetter)()],Ui.prototype,"entries",null);Bi.HelixBitsLeaderboard=Ui=Ad.__decorate([dg.Cacheable,(0,Lo.rtfm)("api","HelixBitsLeaderboard")],Ui)});var Td=u(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});ji.HelixCheermoteList=void 0;var xq=(b(),x(g)),wq=C(),Oi=m(),Id=class extends Oi.DataObject{static{n(this,"HelixCheermoteList")}constructor(e){super((0,wq.indexBy)(e,t=>t.prefix.toLowerCase()))}getCheermoteDisplayInfo(e,t,r){e=e.toLowerCase();let{background:a,state:s,scale:o}=r,{tiers:l}=this[Oi.rawDataSymbol][e],c=l.sort((h,p)=>p.min_bits-h.min_bits).find(h=>h.min_bits<=t);if(!c)throw new Oi.HellFreezesOverError(`Cheermote "${e}" does not have an applicable tier for ${t} bits`);return{url:c.images[a][s][o],color:c.color}}getPossibleNames(){return Object.keys(this[Oi.rawDataSymbol])}};ji.HelixCheermoteList=Id;ji.HelixCheermoteList=Id=xq.__decorate([(0,Oi.rtfm)("api","HelixCheermoteList")],Id)});var Bd=u(ki=>{"use strict";Object.defineProperty(ki,"__esModule",{value:!0});ki.HelixBitsApi=void 0;var vq=(b(),x(g)),hg=C(),Sq=Y(),Rd=m(),Hq=ug(),Cq=G(),qq=Dd(),Eq=Td(),Ud=class extends Cq.BaseApi{static{n(this,"HelixBitsApi")}async getLeaderboard(e,t={}){let r=await this._client.callApi({type:"helix",url:"bits/leaderboard",userId:(0,Rd.extractUserId)(e),scopes:["bits:read"],query:(0,Hq.createBitsLeaderboardQuery)(t)});return new qq.HelixBitsLeaderboard(r,this._client)}async getCheermotes(e){let t=await this._client.callApi({type:"helix",url:"bits/cheermotes",userId:(0,hg.mapOptional)(e,Rd.extractUserId),query:(0,hg.mapOptional)(e,Sq.createBroadcasterQuery)});return new Eq.HelixCheermoteList(t.data)}};ki.HelixBitsApi=Ud;ki.HelixBitsApi=Ud=vq.__decorate([(0,Rd.rtfm)("api","HelixBitsApi")],Ud)});var _g=u(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.createFollowedChannelQuery=Ge.createChannelFollowerQuery=Ge.createChannelVipUpdateQuery=Ge.createChannelCommercialBody=Ge.createChannelUpdateBody=void 0;var pg=C(),or=m();function Pq(i){var e;return{game_id:i.gameId,broadcaster_language:i.language,title:i.title,delay:(e=i.delay)===null||e===void 0?void 0:e.toString(),tags:i.tags,content_classification_labels:i.contentClassificationLabels,is_branded_content:i.isBrandedContent}}n(Pq,"createChannelUpdateBody");Ge.createChannelUpdateBody=Pq;function Aq(i,e){return{broadcaster_id:(0,or.extractUserId)(i),length:e}}n(Aq,"createChannelCommercialBody");Ge.createChannelCommercialBody=Aq;function Dq(i,e){return{broadcaster_id:(0,or.extractUserId)(i),user_id:(0,or.extractUserId)(e)}}n(Dq,"createChannelVipUpdateQuery");Ge.createChannelVipUpdateQuery=Dq;function Iq(i,e){return{broadcaster_id:(0,or.extractUserId)(i),user_id:(0,pg.mapOptional)(e,or.extractUserId)}}n(Iq,"createChannelFollowerQuery");Ge.createChannelFollowerQuery=Iq;function Tq(i,e){return{broadcaster_id:(0,pg.mapOptional)(e,or.extractUserId),user_id:(0,or.extractUserId)(i)}}n(Tq,"createFollowedChannelQuery");Ge.createFollowedChannelQuery=Tq});var Oe=u(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.createChannelUsersCheckQuery=We.createGetByIdsQuery=We.createModeratorActionQuery=We.createUserQuery=We.createSingleKeyQuery=void 0;var Fo=m();function Rq(i,e){return{[i]:e}}n(Rq,"createSingleKeyQuery");We.createSingleKeyQuery=Rq;function Uq(i){return{user_id:(0,Fo.extractUserId)(i)}}n(Uq,"createUserQuery");We.createUserQuery=Uq;function Bq(i,e){return{broadcaster_id:i,moderator_id:e}}n(Bq,"createModeratorActionQuery");We.createModeratorActionQuery=Bq;function Oq(i,e){return{broadcaster_id:(0,Fo.extractUserId)(i),id:e}}n(Oq,"createGetByIdsQuery");We.createGetByIdsQuery=Oq;function jq(i,e){return{broadcaster_id:(0,Fo.extractUserId)(i),user_id:e.map(Fo.extractUserId)}}n(jq,"createChannelUsersCheckQuery");We.createChannelUsersCheckQuery=jq});var Qo=u(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.HelixUserRelation=void 0;var mg=(b(),x(g)),kq=C(),lr=m(),No=class extends lr.DataObject{static{n(this,"HelixUserRelation")}constructor(e,t){super(e),this._client=t}get id(){return this[lr.rawDataSymbol].user_id}get name(){return this[lr.rawDataSymbol].user_login}get displayName(){return this[lr.rawDataSymbol].user_name}async getUser(){return(0,lr.checkRelationAssertion)(await this._client.users.getUserById(this[lr.rawDataSymbol].user_id))}};Mi.HelixUserRelation=No;mg.__decorate([(0,kq.Enumerable)(!1)],No.prototype,"_client",void 0);Mi.HelixUserRelation=No=mg.__decorate([(0,lr.rtfm)("api","HelixUserRelation","id")],No)});var Lt=u(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});Wo.HelixRequestBatcher=void 0;var Mq=(b(),x(g)),Od=C(),Go=class{static{n(this,"HelixRequestBatcher")}constructor(e,t,r,a,s,o=100){this._callOptions=e,this._queryParamName=t,this._matchKey=r,this._mapper=s,this._limitPerRequest=o,this._requestedIds=[],this._requestResolversById=new Map,this._waitTimer=null,this._client=a,this._delay=a._batchDelay}async request(e){let{promise:t,resolve:r,reject:a}=(0,Od.promiseWithResolvers)();return this._requestedIds.includes(e)||this._requestedIds.push(e),this._requestResolversById.has(e)?this._requestResolversById.get(e).push({resolve:r,reject:a}):this._requestResolversById.set(e,[{resolve:r,reject:a}]),this._waitTimer&&(clearTimeout(this._waitTimer),this._waitTimer=null),this._requestedIds.length>=this._limitPerRequest?this._handleBatch(this._requestedIds.splice(0,this._limitPerRequest)):this._waitTimer=setTimeout(()=>{this._handleBatch(this._requestedIds.splice(0,this._limitPerRequest))},this._delay),await t}async _handleBatch(e){var t;try{let{data:r}=await this._doRequest(e),a=(0,Od.indexBy)(r,this._matchKey);for(let s of e){for(let o of(t=this._requestResolversById.get(s))!==null&&t!==void 0?t:[])Object.prototype.hasOwnProperty.call(a,s)?o.resolve(this._mapper(a[s])):o.resolve(null);this._requestResolversById.delete(s)}}catch{await Promise.all(e.map(async a=>{var s,o;try{let l=await this._doRequest([a]);for(let c of(s=this._requestResolversById.get(a))!==null&&s!==void 0?s:[])c.resolve(l.data.length?this._mapper(l.data[0]):null)}catch(l){for(let c of(o=this._requestResolversById.get(a))!==null&&o!==void 0?o:[])c.reject(l)}this._requestResolversById.delete(a)}))}}async _doRequest(e){return await this._client.callApi({type:"helix",...this._callOptions,query:{...this._callOptions.query,[this._queryParamName]:e}})}};Wo.HelixRequestBatcher=Go;Mq.__decorate([(0,Od.Enumerable)(!1)],Go.prototype,"_client",void 0)});var oe=u(Li=>{"use strict";var jd;Object.defineProperty(Li,"__esModule",{value:!0});Li.HelixPaginatedRequest=void 0;var yg=(b(),x(g)),Lq=C(),Fq=m();Object.prototype.hasOwnProperty.call(Symbol,"asyncIterator")||(Symbol.asyncIterator=(jd=Symbol.asyncIterator)!==null&&jd!==void 0?jd:Symbol.for("Symbol.asyncIterator"));var Vo=class{static{n(this,"HelixPaginatedRequest")}constructor(e,t,r,a=100){this._callOptions=e,this._mapper=r,this._limitPerPage=a,this._isFinished=!1,this._client=t}get current(){var e;return(e=this._currentData)===null||e===void 0?void 0:e.data}async getNext(){var e;if(this._isFinished)return[];let t=await this._fetchData();return!((e=t.data)===null||e===void 0)&&e.length?this._processResult(t):(this._isFinished=!0,[])}async getAll(){this.reset();let e=[];do{let t=await this.getNext();if(!t.length)break;e.push(...t)}while(this._currentCursor);return this.reset(),e}get currentCursor(){return this._currentCursor}reset(){this._currentCursor=void 0,this._isFinished=!1,this._currentData=void 0}async*[Symbol.asyncIterator](){for(this.reset();;){let e=await this.getNext();if(!e.length)break;yield*e[Symbol.iterator]()}}async _fetchData(e={}){return await this._client.callApi({type:"helix",...this._callOptions,...e,query:{...this._callOptions.query,after:this._currentCursor,first:this._limitPerPage.toString(),...e.query}})}_processResult(e){var t;return this._currentCursor=typeof e.pagination=="string"?e.pagination:(t=e.pagination)===null||t===void 0?void 0:t.cursor,this._currentCursor===void 0&&(this._isFinished=!0),this._currentData=e,e.data.reduce((r,a)=>{let s=this._mapper(a);return Array.isArray(s)?[...r,...s]:[...r,s]},[])}};Li.HelixPaginatedRequest=Vo;yg.__decorate([(0,Lq.Enumerable)(!1)],Vo.prototype,"_client",void 0);Li.HelixPaginatedRequest=Vo=yg.__decorate([(0,Fq.rtfm)("api","HelixPaginatedRequest")],Vo)});var Gr=u(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});Fi.HelixPaginatedRequestWithTotal=void 0;var Nq=(b(),x(g)),Qq=m(),Gq=oe(),kd=class extends Gq.HelixPaginatedRequest{static{n(this,"HelixPaginatedRequestWithTotal")}async getTotalCount(){var e;return((e=this._currentData)!==null&&e!==void 0?e:await this._fetchData({query:{after:void 0}})).total}};Fi.HelixPaginatedRequestWithTotal=kd;Fi.HelixPaginatedRequestWithTotal=kd=Nq.__decorate([(0,Qq.rtfm)("api","HelixPaginatedRequestWithTotal")],kd)});var he=u(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.createPaginatedResultWithTotal=Wr.createPaginatedResult=void 0;function Wq(i,e,t){var r;let a;return{get data(){var s,o;return a??(a=(o=(s=i.data)===null||s===void 0?void 0:s.map(l=>new e(l,t)))!==null&&o!==void 0?o:[])},cursor:typeof i.pagination=="string"?i.pagination:(r=i.pagination)===null||r===void 0?void 0:r.cursor}}n(Wq,"createPaginatedResult");Wr.createPaginatedResult=Wq;function Vq(i,e,t){let r;return{get data(){var a,s;return r??(r=(s=(a=i.data)===null||a===void 0?void 0:a.map(o=>new e(o,t)))!==null&&s!==void 0?s:[])},cursor:i.pagination.cursor,total:i.total}}n(Vq,"createPaginatedResultWithTotal");Wr.createPaginatedResultWithTotal=Vq});var le=u($o=>{"use strict";Object.defineProperty($o,"__esModule",{value:!0});$o.createPaginationQuery=void 0;function $q({after:i,before:e,limit:t}={}){return{after:i,before:e,first:t?.toString()}}n($q,"createPaginationQuery");$o.createPaginationQuery=$q});var Md=u(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.HelixChannel=void 0;var fg=(b(),x(g)),zq=C(),_e=m(),zo=class extends _e.DataObject{static{n(this,"HelixChannel")}constructor(e,t){super(e),this._client=t}get id(){return this[_e.rawDataSymbol].broadcaster_id}get name(){return this[_e.rawDataSymbol].broadcaster_login}get displayName(){return this[_e.rawDataSymbol].broadcaster_name}async getBroadcaster(){return(0,_e.checkRelationAssertion)(await this._client.users.getUserById(this[_e.rawDataSymbol].broadcaster_id))}get language(){return this[_e.rawDataSymbol].broadcaster_language}get gameId(){return this[_e.rawDataSymbol].game_id}get gameName(){return this[_e.rawDataSymbol].game_name}async getGame(){return this[_e.rawDataSymbol].game_id?(0,_e.checkRelationAssertion)(await this._client.games.getGameById(this[_e.rawDataSymbol].game_id)):null}get title(){return this[_e.rawDataSymbol].title}get delay(){return this[_e.rawDataSymbol].delay}get tags(){return this[_e.rawDataSymbol].tags}get contentClassificationLabels(){return this[_e.rawDataSymbol].content_classification_labels}get isBrandedContent(){return this[_e.rawDataSymbol].is_branded_content}};Ni.HelixChannel=zo;fg.__decorate([(0,zq.Enumerable)(!1)],zo.prototype,"_client",void 0);Ni.HelixChannel=zo=fg.__decorate([(0,_e.rtfm)("api","HelixChannel","id")],zo)});var Ld=u(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});Qi.HelixChannelEditor=void 0;var gg=(b(),x(g)),Kq=C(),ur=m(),Ko=class extends ur.DataObject{static{n(this,"HelixChannelEditor")}constructor(e,t){super(e),this._client=t}get userId(){return this[ur.rawDataSymbol].user_id}get userDisplayName(){return this[ur.rawDataSymbol].user_name}async getUser(){return(0,ur.checkRelationAssertion)(await this._client.users.getUserById(this[ur.rawDataSymbol].user_id))}get creationDate(){return new Date(this[ur.rawDataSymbol].created_at)}};Qi.HelixChannelEditor=Ko;gg.__decorate([(0,Kq.Enumerable)(!1)],Ko.prototype,"_client",void 0);Qi.HelixChannelEditor=Ko=gg.__decorate([(0,ur.rtfm)("api","HelixChannelEditor","userId")],Ko)});var Fd=u(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.HelixChannelFollower=void 0;var bg=(b(),x(g)),Jq=C(),Ft=m(),Jo=class extends Ft.DataObject{static{n(this,"HelixChannelFollower")}constructor(e,t){super(e),this._client=t}get userId(){return this[Ft.rawDataSymbol].user_id}get userName(){return this[Ft.rawDataSymbol].user_login}get userDisplayName(){return this[Ft.rawDataSymbol].user_name}async getUser(){return(0,Ft.checkRelationAssertion)(await this._client.users.getUserById(this[Ft.rawDataSymbol].user_id))}get followDate(){return new Date(this[Ft.rawDataSymbol].followed_at)}};Gi.HelixChannelFollower=Jo;bg.__decorate([(0,Jq.Enumerable)(!1)],Jo.prototype,"_client",void 0);Gi.HelixChannelFollower=Jo=bg.__decorate([(0,Ft.rtfm)("api","HelixChannelFollower","userId")],Jo)});var Nd=u(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.HelixFollowedChannel=void 0;var xg=(b(),x(g)),Zq=C(),Nt=m(),Zo=class extends Nt.DataObject{static{n(this,"HelixFollowedChannel")}constructor(e,t){super(e),this._client=t}get broadcasterId(){return this[Nt.rawDataSymbol].broadcaster_id}get broadcasterName(){return this[Nt.rawDataSymbol].broadcaster_login}get broadcasterDisplayName(){return this[Nt.rawDataSymbol].broadcaster_name}async getBroadcaster(){return(0,Nt.checkRelationAssertion)(await this._client.users.getUserById(this[Nt.rawDataSymbol].broadcaster_id))}get followDate(){return new Date(this[Nt.rawDataSymbol].followed_at)}};Wi.HelixFollowedChannel=Zo;xg.__decorate([(0,Zq.Enumerable)(!1)],Zo.prototype,"_client",void 0);Wi.HelixFollowedChannel=Zo=xg.__decorate([(0,Nt.rtfm)("api","HelixFollowedChannel","broadcasterId")],Zo)});var Gd=u(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.HelixAdSchedule=void 0;var Xq=(b(),x(g)),Xe=m(),Qd=class extends Xe.DataObject{static{n(this,"HelixAdSchedule")}get snoozeCount(){return this[Xe.rawDataSymbol].snooze_count}get snoozeRefreshDate(){return this[Xe.rawDataSymbol].snooze_refresh_at?new Date(this[Xe.rawDataSymbol].snooze_refresh_at*1e3):null}get nextAdDate(){return this[Xe.rawDataSymbol].next_ad_at?new Date(this[Xe.rawDataSymbol].next_ad_at*1e3):null}get duration(){return this[Xe.rawDataSymbol].duration}get lastAdDate(){return this[Xe.rawDataSymbol].last_ad_at?new Date(this[Xe.rawDataSymbol].last_ad_at*1e3):null}get prerollFreeTime(){return this[Xe.rawDataSymbol].preroll_free_time}};Vi.HelixAdSchedule=Qd;Vi.HelixAdSchedule=Qd=Xq.__decorate([(0,Xe.rtfm)("api","HelixAdSchedule")],Qd)});var wg=u(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.HelixSnoozeNextAdResult=void 0;var Yq=(b(),x(g)),$i=m(),Wd=class extends $i.DataObject{static{n(this,"HelixSnoozeNextAdResult")}get snoozeCount(){return this[$i.rawDataSymbol].snooze_count}get snoozeRefreshDate(){return new Date(this[$i.rawDataSymbol].snooze_refresh_at*1e3)}get nextAdDate(){return new Date(this[$i.rawDataSymbol].next_ad_at*1e3)}};zi.HelixSnoozeNextAdResult=Wd;zi.HelixSnoozeNextAdResult=Wd=Yq.__decorate([(0,$i.rtfm)("api","HelixSnoozeNextAdResult")],Wd)});var Kd=u(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});Ki.HelixChannelApi=void 0;var qg=(b(),x(g)),Eg=C(),cr=Y(),ue=m(),wt=_g(),vg=Oe(),Vd=Qo(),eE=Lt(),tE=oe(),Sg=Gr(),$d=he(),Xo=le(),rE=G(),zd=Md(),iE=Ld(),Hg=Fd(),Cg=Nd(),nE=Gd(),aE=wg(),Yo=class extends rE.BaseApi{static{n(this,"HelixChannelApi")}constructor(){super(...arguments),this._getChannelByIdBatcher=new eE.HelixRequestBatcher({url:"channels"},"broadcaster_id","broadcaster_id",this._client,e=>new zd.HelixChannel(e,this._client))}async getChannelInfoById(e){let t=(0,ue.extractUserId)(e),r=await this._client.callApi({type:"helix",url:"channels",userId:t,query:(0,cr.createBroadcasterQuery)(t)});return(0,Eg.mapNullable)(r.data[0],a=>new zd.HelixChannel(a,this._client))}async getChannelInfoByIdBatched(e){return await this._getChannelByIdBatcher.request((0,ue.extractUserId)(e))}async getChannelInfoByIds(e){let t=e.map(ue.extractUserId);return(await this._client.callApi({type:"helix",url:"channels",query:(0,vg.createSingleKeyQuery)("broadcaster_id",t)})).data.map(a=>new zd.HelixChannel(a,this._client))}async updateChannelInfo(e,t){await this._client.callApi({type:"helix",url:"channels",method:"PATCH",userId:(0,ue.extractUserId)(e),scopes:["channel:manage:broadcast"],query:(0,cr.createBroadcasterQuery)(e),jsonBody:(0,wt.createChannelUpdateBody)(t)})}async startChannelCommercial(e,t){await this._client.callApi({type:"helix",url:"channels/commercial",method:"POST",userId:(0,ue.extractUserId)(e),scopes:["channel:edit:commercial"],jsonBody:(0,wt.createChannelCommercialBody)(e,t)})}async getChannelEditors(e){return(await this._client.callApi({type:"helix",url:"channels/editors",userId:(0,ue.extractUserId)(e),scopes:["channel:read:editors"],query:(0,cr.createBroadcasterQuery)(e)})).data.map(r=>new iE.HelixChannelEditor(r,this._client))}async getVips(e,t){let r=await this._client.callApi({type:"helix",url:"channels/vips",userId:(0,ue.extractUserId)(e),scopes:["channel:read:vips","channel:manage:vips"],query:{...(0,cr.createBroadcasterQuery)(e),...(0,Xo.createPaginationQuery)(t)}});return(0,$d.createPaginatedResult)(r,Vd.HelixUserRelation,this._client)}getVipsPaginated(e){return new tE.HelixPaginatedRequest({url:"channels/vips",userId:(0,ue.extractUserId)(e),scopes:["channel:read:vips","channel:manage:vips"],query:(0,cr.createBroadcasterQuery)(e)},this._client,t=>new Vd.HelixUserRelation(t,this._client))}async checkVipForUsers(e,t){return(await this._client.callApi({type:"helix",url:"channels/vips",userId:(0,ue.extractUserId)(e),scopes:["channel:read:vips","channel:manage:vips"],query:(0,vg.createChannelUsersCheckQuery)(e,t)})).data.map(a=>new Vd.HelixUserRelation(a,this._client))}async checkVipForUser(e,t){let r=(0,ue.extractUserId)(t);return(await this.checkVipForUsers(e,[r])).some(s=>s.id===r)}async addVip(e,t){await this._client.callApi({type:"helix",url:"channels/vips",method:"POST",userId:(0,ue.extractUserId)(e),scopes:["channel:manage:vips"],query:(0,wt.createChannelVipUpdateQuery)(e,t)})}async removeVip(e,t){await this._client.callApi({type:"helix",url:"channels/vips",method:"DELETE",userId:(0,ue.extractUserId)(e),scopes:["channel:manage:vips"],query:(0,wt.createChannelVipUpdateQuery)(e,t)})}async getChannelFollowerCount(e){return(await this._client.callApi({type:"helix",url:"channels/followers",method:"GET",userId:(0,ue.extractUserId)(e),query:{...(0,wt.createChannelFollowerQuery)(e),...(0,Xo.createPaginationQuery)({limit:1})}})).total}async getChannelFollowers(e,t,r){let a=await this._client.callApi({type:"helix",url:"channels/followers",method:"GET",userId:(0,ue.extractUserId)(e),canOverrideScopedUserContext:!0,scopes:["moderator:read:followers"],query:{...(0,wt.createChannelFollowerQuery)(e,t),...(0,Xo.createPaginationQuery)(r)}});return(0,$d.createPaginatedResultWithTotal)(a,Hg.HelixChannelFollower,this._client)}getChannelFollowersPaginated(e){return new Sg.HelixPaginatedRequestWithTotal({url:"channels/followers",method:"GET",userId:(0,ue.extractUserId)(e),canOverrideScopedUserContext:!0,scopes:["moderator:read:followers"],query:(0,wt.createChannelFollowerQuery)(e)},this._client,t=>new Hg.HelixChannelFollower(t,this._client))}async getFollowedChannels(e,t,r){let a=await this._client.callApi({type:"helix",url:"channels/followed",method:"GET",userId:(0,ue.extractUserId)(e),scopes:["user:read:follows"],query:{...(0,wt.createFollowedChannelQuery)(e,t),...(0,Xo.createPaginationQuery)(r)}});return(0,$d.createPaginatedResultWithTotal)(a,Cg.HelixFollowedChannel,this._client)}getFollowedChannelsPaginated(e,t){return new Sg.HelixPaginatedRequestWithTotal({url:"channels/followed",method:"GET",userId:(0,ue.extractUserId)(e),scopes:["user:read:follows"],query:(0,wt.createFollowedChannelQuery)(e,t)},this._client,r=>new Cg.HelixFollowedChannel(r,this._client))}async getAdSchedule(e){let t=await this._client.callApi({type:"helix",url:"channels/ads",method:"GET",userId:(0,ue.extractUserId)(e),scopes:["channel:read:ads"],query:(0,cr.createBroadcasterQuery)(e)});return new nE.HelixAdSchedule(t.data[0])}async snoozeNextAd(e){let t=await this._client.callApi({type:"helix",url:"channels/ads/schedule/snooze",method:"POST",userId:(0,ue.extractUserId)(e),scopes:["channel:manage:ads"],query:(0,cr.createBroadcasterQuery)(e)});return new aE.HelixSnoozeNextAdResult(t.data[0])}};Ki.HelixChannelApi=Yo;qg.__decorate([(0,Eg.Enumerable)(!1)],Yo.prototype,"_getChannelByIdBatcher",void 0);Ki.HelixChannelApi=Yo=qg.__decorate([(0,ue.rtfm)("api","HelixChannelApi")],Yo)});var Pg=u(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.createRedemptionsForBroadcasterQuery=Ve.createRewardRedemptionsByIdsQuery=Ve.createCustomRewardBody=Ve.createCustomRewardChangeQuery=Ve.createCustomRewardsQuery=void 0;var el=m();function sE(i,e){return{broadcaster_id:(0,el.extractUserId)(i),only_manageable_rewards:e?.toString()}}n(sE,"createCustomRewardsQuery");Ve.createCustomRewardsQuery=sE;function oE(i,e){return{broadcaster_id:(0,el.extractUserId)(i),id:e}}n(oE,"createCustomRewardChangeQuery");Ve.createCustomRewardChangeQuery=oE;function lE(i){var e,t,r;let a={title:i.title,cost:i.cost,prompt:i.prompt,background_color:i.backgroundColor,is_enabled:i.isEnabled,is_user_input_required:i.userInputRequired,should_redemptions_skip_request_queue:i.autoFulfill};return i.maxRedemptionsPerStream!==void 0&&(a.is_max_per_stream_enabled=!!i.maxRedemptionsPerStream,a.max_per_stream=(e=i.maxRedemptionsPerStream)!==null&&e!==void 0?e:0),i.maxRedemptionsPerUserPerStream!==void 0&&(a.is_max_per_user_per_stream_enabled=!!i.maxRedemptionsPerUserPerStream,a.max_per_user_per_stream=(t=i.maxRedemptionsPerUserPerStream)!==null&&t!==void 0?t:0),i.globalCooldown!==void 0&&(a.is_global_cooldown_enabled=!!i.globalCooldown,a.global_cooldown_seconds=(r=i.globalCooldown)!==null&&r!==void 0?r:0),"isPaused"in i&&(a.is_paused=i.isPaused),a}n(lE,"createCustomRewardBody");Ve.createCustomRewardBody=lE;function uE(i,e,t){return{broadcaster_id:(0,el.extractUserId)(i),reward_id:e,id:t}}n(uE,"createRewardRedemptionsByIdsQuery");Ve.createRewardRedemptionsByIdsQuery=uE;function cE(i,e,t,r){return{broadcaster_id:(0,el.extractUserId)(i),reward_id:e,status:t,sort:r.newestFirst?"NEWEST":"OLDEST"}}n(cE,"createRedemptionsForBroadcasterQuery");Ve.createRedemptionsForBroadcasterQuery=cE});var Jd=u(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.HelixCustomReward=void 0;var Ag=(b(),x(g)),dE=C(),M=m(),tl=class extends M.DataObject{static{n(this,"HelixCustomReward")}constructor(e,t){super(e),this._client=t}get id(){return this[M.rawDataSymbol].id}get broadcasterId(){return this[M.rawDataSymbol].broadcaster_id}get broadcasterName(){return this[M.rawDataSymbol].broadcaster_login}get broadcasterDisplayName(){return this[M.rawDataSymbol].broadcaster_name}async getBroadcaster(){return(0,M.checkRelationAssertion)(await this._client.users.getUserById(this[M.rawDataSymbol].broadcaster_id))}getImageUrl(e){var t,r;let a=`url_${e}x`;return(r=(t=this[M.rawDataSymbol].image)===null||t===void 0?void 0:t[a])!==null&&r!==void 0?r:this[M.rawDataSymbol].default_image[a]}get backgroundColor(){return this[M.rawDataSymbol].background_color}get isEnabled(){return this[M.rawDataSymbol].is_enabled}get cost(){return this[M.rawDataSymbol].cost}get title(){return this[M.rawDataSymbol].title}get prompt(){return this[M.rawDataSymbol].prompt}get userInputRequired(){return this[M.rawDataSymbol].is_user_input_required}get maxRedemptionsPerStream(){return this[M.rawDataSymbol].max_per_stream_setting.is_enabled?this[M.rawDataSymbol].max_per_stream_setting.max_per_stream:null}get maxRedemptionsPerUserPerStream(){return this[M.rawDataSymbol].max_per_user_per_stream_setting.is_enabled?this[M.rawDataSymbol].max_per_user_per_stream_setting.max_per_user_per_stream:null}get globalCooldown(){return this[M.rawDataSymbol].global_cooldown_setting.is_enabled?this[M.rawDataSymbol].global_cooldown_setting.global_cooldown_seconds:null}get isPaused(){return this[M.rawDataSymbol].is_paused}get isInStock(){return this[M.rawDataSymbol].is_in_stock}get redemptionsThisStream(){return this[M.rawDataSymbol].redemptions_redeemed_current_stream}get autoFulfill(){return this[M.rawDataSymbol].should_redemptions_skip_request_queue}get cooldownExpiryDate(){return this[M.rawDataSymbol].cooldown_expires_at?new Date(this[M.rawDataSymbol].cooldown_expires_at):null}};Ji.HelixCustomReward=tl;Ag.__decorate([(0,dE.Enumerable)(!1)],tl.prototype,"_client",void 0);Ji.HelixCustomReward=tl=Ag.__decorate([(0,M.rtfm)("api","HelixCustomReward","id")],tl)});var Zd=u(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});Zi.HelixCustomRewardRedemption=void 0;var Dg=(b(),x(g)),hE=C(),Q=m(),rl=class extends Q.DataObject{static{n(this,"HelixCustomRewardRedemption")}constructor(e,t){super(e),this._client=t}get id(){return this[Q.rawDataSymbol].id}get broadcasterId(){return this[Q.rawDataSymbol].broadcaster_id}get broadcasterName(){return this[Q.rawDataSymbol].broadcaster_login}get broadcasterDisplayName(){return this[Q.rawDataSymbol].broadcaster_name}async getBroadcaster(){return(0,Q.checkRelationAssertion)(await this._client.users.getUserById(this[Q.rawDataSymbol].broadcaster_id))}get userId(){return this[Q.rawDataSymbol].user_id}get userName(){return this[Q.rawDataSymbol].user_login}get userDisplayName(){return this[Q.rawDataSymbol].user_name}async getUser(){return(0,Q.checkRelationAssertion)(await this._client.users.getUserById(this[Q.rawDataSymbol].user_id))}get userInput(){return this[Q.rawDataSymbol].user_input}get isFulfilled(){return this[Q.rawDataSymbol].status==="FULFILLED"}get isCanceled(){return this[Q.rawDataSymbol].status==="CANCELED"}get redemptionDate(){return new Date(this[Q.rawDataSymbol].redeemed_at)}get rewardId(){return this[Q.rawDataSymbol].reward.id}get rewardTitle(){return this[Q.rawDataSymbol].reward.title}get rewardPrompt(){return this[Q.rawDataSymbol].reward.prompt}get rewardCost(){return this[Q.rawDataSymbol].reward.cost}async getReward(){return(0,Q.checkRelationAssertion)(await this._client.channelPoints.getCustomRewardById(this[Q.rawDataSymbol].broadcaster_id,this[Q.rawDataSymbol].reward.id))}async updateStatus(e){return(await this._client.channelPoints.updateRedemptionStatusByIds(this[Q.rawDataSymbol].broadcaster_id,this[Q.rawDataSymbol].reward.id,[this[Q.rawDataSymbol].id],e))[0]}};Zi.HelixCustomRewardRedemption=rl;Dg.__decorate([(0,hE.Enumerable)(!1)],rl.prototype,"_client",void 0);Zi.HelixCustomRewardRedemption=rl=Dg.__decorate([(0,Q.rtfm)("api","HelixCustomRewardRedemption","id")],rl)});var Yd=u(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.HelixChannelPointsApi=void 0;var pE=(b(),x(g)),_E=Y(),dt=m(),vt=Pg(),mE=Oe(),yE=oe(),fE=he(),gE=le(),bE=G(),il=Jd(),nl=Zd(),Xd=class extends bE.BaseApi{static{n(this,"HelixChannelPointsApi")}async getCustomRewards(e,t){return(await this._client.callApi({type:"helix",url:"channel_points/custom_rewards",userId:(0,dt.extractUserId)(e),scopes:["channel:read:redemptions","channel:manage:redemptions"],query:(0,vt.createCustomRewardsQuery)(e,t)})).data.map(a=>new il.HelixCustomReward(a,this._client))}async getCustomRewardsByIds(e,t){return t.length?(await this._client.callApi({type:"helix",url:"channel_points/custom_rewards",userId:(0,dt.extractUserId)(e),scopes:["channel:read:redemptions","channel:manage:redemptions"],query:(0,mE.createGetByIdsQuery)(e,t)})).data.map(a=>new il.HelixCustomReward(a,this._client)):[]}async getCustomRewardById(e,t){let r=await this.getCustomRewardsByIds(e,[t]);return r.length?r[0]:null}async createCustomReward(e,t){let r=await this._client.callApi({type:"helix",url:"channel_points/custom_rewards",method:"POST",userId:(0,dt.extractUserId)(e),scopes:["channel:manage:redemptions"],query:(0,_E.createBroadcasterQuery)(e),jsonBody:(0,vt.createCustomRewardBody)(t)});return new il.HelixCustomReward(r.data[0],this._client)}async updateCustomReward(e,t,r){let a=await this._client.callApi({type:"helix",url:"channel_points/custom_rewards",method:"PATCH",userId:(0,dt.extractUserId)(e),scopes:["channel:manage:redemptions"],query:(0,vt.createCustomRewardChangeQuery)(e,t),jsonBody:(0,vt.createCustomRewardBody)(r)});return new il.HelixCustomReward(a.data[0],this._client)}async deleteCustomReward(e,t){await this._client.callApi({type:"helix",url:"channel_points/custom_rewards",method:"DELETE",userId:(0,dt.extractUserId)(e),scopes:["channel:manage:redemptions"],query:(0,vt.createCustomRewardChangeQuery)(e,t)})}async getRedemptionsByIds(e,t,r){return r.length?(await this._client.callApi({type:"helix",url:"channel_points/custom_rewards/redemptions",userId:(0,dt.extractUserId)(e),scopes:["channel:read:redemptions","channel:manage:redemptions"],query:(0,vt.createRewardRedemptionsByIdsQuery)(e,t,r)})).data.map(s=>new nl.HelixCustomRewardRedemption(s,this._client)):[]}async getRedemptionById(e,t,r){let a=await this.getRedemptionsByIds(e,t,[r]);return a.length?a[0]:null}async getRedemptionsForBroadcaster(e,t,r,a){let s=await this._client.callApi({type:"helix",url:"channel_points/custom_rewards/redemptions",userId:(0,dt.extractUserId)(e),scopes:["channel:read:redemptions","channel:manage:redemptions"],query:{...(0,vt.createRedemptionsForBroadcasterQuery)(e,t,r,a),...(0,gE.createPaginationQuery)(a)}});return(0,fE.createPaginatedResult)(s,nl.HelixCustomRewardRedemption,this._client)}getRedemptionsForBroadcasterPaginated(e,t,r,a){return new yE.HelixPaginatedRequest({url:"channel_points/custom_rewards/redemptions",userId:(0,dt.extractUserId)(e),scopes:["channel:read:redemptions","channel:manage:redemptions"],query:(0,vt.createRedemptionsForBroadcasterQuery)(e,t,r,a)},this._client,s=>new nl.HelixCustomRewardRedemption(s,this._client),50)}async updateRedemptionStatusByIds(e,t,r,a){return r.length?(await this._client.callApi({type:"helix",url:"channel_points/custom_rewards/redemptions",method:"PATCH",userId:(0,dt.extractUserId)(e),scopes:["channel:manage:redemptions"],query:(0,vt.createRewardRedemptionsByIdsQuery)(e,t,r),jsonBody:{status:a}})).data.map(o=>new nl.HelixCustomRewardRedemption(o,this._client)):[]}};Xi.HelixChannelPointsApi=Xd;Xi.HelixChannelPointsApi=Xd=pE.__decorate([(0,dt.rtfm)("api","HelixChannelPointsApi")],Xd)});var al=u(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.HelixCharityCampaignAmount=void 0;var xE=(b(),x(g)),Yi=m(),eh=class extends Yi.DataObject{static{n(this,"HelixCharityCampaignAmount")}get value(){return this[Yi.rawDataSymbol].value}get decimalPlaces(){return this[Yi.rawDataSymbol].decimal_places}get localizedValue(){return this.value/10**this.decimalPlaces}get currency(){return this[Yi.rawDataSymbol].currency}};en.HelixCharityCampaignAmount=eh;en.HelixCharityCampaignAmount=eh=xE.__decorate([(0,Yi.rtfm)("api","HelixCharityCampaignAmount")],eh)});var th=u(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});tn.HelixCharityCampaign=void 0;var Tg=(b(),x(g)),wE=C(),Ae=m(),Ig=al(),sl=class extends Ae.DataObject{static{n(this,"HelixCharityCampaign")}constructor(e,t){super(e),this._client=t}get id(){return this[Ae.rawDataSymbol].id}get broadcasterId(){return this[Ae.rawDataSymbol].broadcaster_id}get broadcasterName(){return this[Ae.rawDataSymbol].broadcaster_login}get broadcasterDisplayName(){return this[Ae.rawDataSymbol].broadcaster_name}async getBroadcaster(){return(0,Ae.checkRelationAssertion)(await this._client.users.getUserById(this[Ae.rawDataSymbol].broadcaster_id))}get charityName(){return this[Ae.rawDataSymbol].charity_name}get charityDescription(){return this[Ae.rawDataSymbol].charity_description}get charityLogo(){return this[Ae.rawDataSymbol].charity_logo}get charityWebsite(){return this[Ae.rawDataSymbol].charity_website}get currentAmount(){return new Ig.HelixCharityCampaignAmount(this[Ae.rawDataSymbol].current_amount)}get targetAmount(){return new Ig.HelixCharityCampaignAmount(this[Ae.rawDataSymbol].target_amount)}};tn.HelixCharityCampaign=sl;Tg.__decorate([(0,wE.Enumerable)(!1)],sl.prototype,"_client",void 0);tn.HelixCharityCampaign=sl=Tg.__decorate([(0,Ae.rtfm)("api","HelixCharityCampaign","id")],sl)});var rh=u(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.HelixCharityCampaignDonation=void 0;var Rg=(b(),x(g)),vE=C(),St=m(),SE=al(),ol=class extends St.DataObject{static{n(this,"HelixCharityCampaignDonation")}constructor(e,t){super(e),this._client=t}get campaignId(){return this[St.rawDataSymbol].campaign_id}get donorId(){return this[St.rawDataSymbol].user_id}get donorName(){return this[St.rawDataSymbol].user_login}get donorDisplayName(){return this[St.rawDataSymbol].user_name}async getDonor(){return(0,St.checkRelationAssertion)(await this._client.users.getUserById(this[St.rawDataSymbol].user_id))}get amount(){return new SE.HelixCharityCampaignAmount(this[St.rawDataSymbol].amount)}};rn.HelixCharityCampaignDonation=ol;Rg.__decorate([(0,vE.Enumerable)(!1)],ol.prototype,"_client",void 0);rn.HelixCharityCampaignDonation=ol=Rg.__decorate([(0,St.rtfm)("api","HelixCharityCampaignDonation")],ol)});var ah=u(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.HelixCharityApi=void 0;var HE=(b(),x(g)),Ug=Y(),ih=m(),CE=he(),qE=le(),EE=G(),PE=th(),AE=rh(),nh=class extends EE.BaseApi{static{n(this,"HelixCharityApi")}async getCharityCampaign(e){let t=await this._client.callApi({type:"helix",url:"charity/campaigns",method:"GET",userId:(0,ih.extractUserId)(e),scopes:["channel:read:charity"],query:(0,Ug.createBroadcasterQuery)(e)});return new PE.HelixCharityCampaign(t.data[0],this._client)}async getCharityCampaignDonations(e,t){let r=await this._client.callApi({type:"helix",url:"charity/donations",userId:(0,ih.extractUserId)(e),scopes:["channel:read:charity"],query:{...(0,Ug.createBroadcasterQuery)(e),...(0,qE.createPaginationQuery)(t)}});return(0,CE.createPaginatedResult)(r,AE.HelixCharityCampaignDonation,this._client)}};nn.HelixCharityApi=nh;nn.HelixCharityApi=nh=HE.__decorate([(0,ih.rtfm)("api","HelixCharityApi")],nh)});var Bg=u(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.createSendChatMessageAsAppBody=De.createSendChatMessageBody=De.createSendChatMessageQuery=De.createShoutoutQuery=De.createChatColorUpdateQuery=De.createChatSettingsUpdateBody=void 0;var sh=m();function DE(i){return{slow_mode:i.slowModeEnabled,slow_mode_wait_time:i.slowModeDelay,follower_mode:i.followerOnlyModeEnabled,follower_mode_duration:i.followerOnlyModeDelay,subscriber_mode:i.subscriberOnlyModeEnabled,emote_mode:i.emoteOnlyModeEnabled,unique_chat_mode:i.uniqueChatModeEnabled,non_moderator_chat_delay:i.nonModeratorChatDelayEnabled,non_moderator_chat_delay_duration:i.nonModeratorChatDelay}}n(DE,"createChatSettingsUpdateBody");De.createChatSettingsUpdateBody=DE;function IE(i,e){return{user_id:(0,sh.extractUserId)(i),color:e}}n(IE,"createChatColorUpdateQuery");De.createChatColorUpdateQuery=IE;function TE(i,e,t){return{from_broadcaster_id:(0,sh.extractUserId)(i),to_broadcaster_id:(0,sh.extractUserId)(e),moderator_id:t}}n(TE,"createShoutoutQuery");De.createShoutoutQuery=TE;function RE(i,e){return{broadcaster_id:i,sender_id:e}}n(RE,"createSendChatMessageQuery");De.createSendChatMessageQuery=RE;function UE(i,e){return{message:i,reply_parent_message_id:e?.replyParentMessageId}}n(UE,"createSendChatMessageBody");De.createSendChatMessageBody=UE;function BE(i,e){return{message:i,reply_parent_message_id:e?.replyParentMessageId,for_source_only:e?.forSourceOnly}}n(BE,"createSendChatMessageAsAppBody");De.createSendChatMessageAsAppBody=BE});var lh=u(ll=>{"use strict";Object.defineProperty(ll,"__esModule",{value:!0});ll.HelixEmoteBase=void 0;var Ye=m(),oh=class extends Ye.DataObject{static{n(this,"HelixEmoteBase")}get id(){return this[Ye.rawDataSymbol].id}get name(){return this[Ye.rawDataSymbol].name}get formats(){return this[Ye.rawDataSymbol].format}get scales(){return this[Ye.rawDataSymbol].scale}get themeModes(){return this[Ye.rawDataSymbol].theme_mode}getStaticImageUrl(e="1.0",t="light"){return this[Ye.rawDataSymbol].format.includes("static")&&this[Ye.rawDataSymbol].scale.includes(e)?this.getFormattedImageUrl(e,"static",t):null}getAnimatedImageUrl(e="1.0",t="light"){return this[Ye.rawDataSymbol].format.includes("animated")&&this[Ye.rawDataSymbol].scale.includes(e)?this.getFormattedImageUrl(e,"animated",t):null}getFormattedImageUrl(e="1.0",t="static",r="light"){return`https://static-cdn.jtvnw.net/emoticons/v2/${this[Ye.rawDataSymbol].id}/${t}/${r}/${e}`}};ll.HelixEmoteBase=oh});var sn=u(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.HelixEmote=void 0;var OE=(b(),x(g)),Og=m(),jE=lh(),uh=class extends jE.HelixEmoteBase{static{n(this,"HelixEmote")}getImageUrl(e){return this[Og.rawDataSymbol].images[`url_${e}x`]}};an.HelixEmote=uh;an.HelixEmote=uh=OE.__decorate([(0,Og.rtfm)("api","HelixEmote","id")],uh)});var ch=u(ln=>{"use strict";Object.defineProperty(ln,"__esModule",{value:!0});ln.HelixChannelEmote=void 0;var jg=(b(),x(g)),kE=C(),on=m(),ME=sn(),ul=class extends ME.HelixEmote{static{n(this,"HelixChannelEmote")}constructor(e,t){super(e),this._client=t}get tier(){return this[on.rawDataSymbol].tier||null}get type(){return this[on.rawDataSymbol].emote_type}get emoteSetId(){return this[on.rawDataSymbol].emote_set_id}async getAllEmotesFromSet(){return await this._client.chat.getEmotesFromSets([this[on.rawDataSymbol].emote_set_id])}};ln.HelixChannelEmote=ul;jg.__decorate([(0,kE.Enumerable)(!1)],ul.prototype,"_client",void 0);ln.HelixChannelEmote=ul=jg.__decorate([(0,on.rtfm)("api","HelixChannelEmote","id")],ul)});var hh=u(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.HelixChatBadgeVersion=void 0;var LE=(b(),x(g)),Qt=m(),dh=class extends Qt.DataObject{static{n(this,"HelixChatBadgeVersion")}get id(){return this[Qt.rawDataSymbol].id}getImageUrl(e){return this[Qt.rawDataSymbol][`image_url_${e}x`]}get title(){return this[Qt.rawDataSymbol].title}get description(){return this[Qt.rawDataSymbol].description}get clickAction(){return this[Qt.rawDataSymbol].click_action}get clickUrl(){return this[Qt.rawDataSymbol].click_url}};un.HelixChatBadgeVersion=dh;un.HelixChatBadgeVersion=dh=LE.__decorate([(0,Qt.rtfm)("api","HelixChatBadgeVersion","id")],dh)});var ph=u(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.HelixChatBadgeSet=void 0;var kg=(b(),x(g)),Mg=Hi(),cl=m(),FE=hh(),dl=class extends cl.DataObject{static{n(this,"HelixChatBadgeSet")}get id(){return this[cl.rawDataSymbol].set_id}get versions(){return this[cl.rawDataSymbol].versions.map(e=>new FE.HelixChatBadgeVersion(e))}getVersion(e){var t;return(t=this.versions.find(r=>r.id===e))!==null&&t!==void 0?t:null}};cn.HelixChatBadgeSet=dl;kg.__decorate([(0,Mg.CachedGetter)()],dl.prototype,"versions",null);cn.HelixChatBadgeSet=dl=kg.__decorate([Mg.Cacheable,(0,cl.rtfm)("api","HelixChatBadgeSet","id")],dl)});var _h=u(dn=>{"use strict";Object.defineProperty(dn,"__esModule",{value:!0});dn.HelixChatChatter=void 0;var Lg=(b(),x(g)),NE=C(),dr=m(),hl=class extends dr.DataObject{static{n(this,"HelixChatChatter")}constructor(e,t){super(e),this._client=t}get userId(){return this[dr.rawDataSymbol].user_id}get userName(){return this[dr.rawDataSymbol].user_login}get userDisplayName(){return this[dr.rawDataSymbol].user_name}async getUser(){return(0,dr.checkRelationAssertion)(await this._client.users.getUserById(this[dr.rawDataSymbol].user_id))}};dn.HelixChatChatter=hl;Lg.__decorate([(0,NE.Enumerable)(!1)],hl.prototype,"_client",void 0);dn.HelixChatChatter=hl=Lg.__decorate([(0,dr.rtfm)("api","HelixChatChatter")],hl)});var pl=u(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.HelixChatSettings=void 0;var QE=(b(),x(g)),ht=m(),mh=class extends ht.DataObject{static{n(this,"HelixChatSettings")}get broadcasterId(){return this[ht.rawDataSymbol].broadcaster_id}get slowModeEnabled(){return this[ht.rawDataSymbol].slow_mode}get slowModeDelay(){return this[ht.rawDataSymbol].slow_mode_wait_time}get followerOnlyModeEnabled(){return this[ht.rawDataSymbol].follower_mode}get followerOnlyModeDelay(){return this[ht.rawDataSymbol].follower_mode_duration}get subscriberOnlyModeEnabled(){return this[ht.rawDataSymbol].subscriber_mode}get emoteOnlyModeEnabled(){return this[ht.rawDataSymbol].emote_mode}get uniqueChatModeEnabled(){return this[ht.rawDataSymbol].unique_chat_mode}};hn.HelixChatSettings=mh;hn.HelixChatSettings=mh=QE.__decorate([(0,ht.rtfm)("api","HelixChatSettings","broadcasterId")],mh)});var yh=u(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.HelixEmoteFromSet=void 0;var Fg=(b(),x(g)),GE=C(),hr=m(),WE=sn(),_l=class extends WE.HelixEmote{static{n(this,"HelixEmoteFromSet")}constructor(e,t){super(e),this._client=t}get type(){return this[hr.rawDataSymbol].emote_type}get emoteSetId(){return this[hr.rawDataSymbol].emote_set_id}get ownerId(){switch(this[hr.rawDataSymbol].owner_id){case"0":case"twitch":return null;default:return this[hr.rawDataSymbol].owner_id}}async getOwner(){switch(this[hr.rawDataSymbol].owner_id){case"0":case"twitch":return null;default:return await this._client.users.getUserById(this[hr.rawDataSymbol].owner_id)}}};pn.HelixEmoteFromSet=_l;Fg.__decorate([(0,GE.Enumerable)(!1)],_l.prototype,"_client",void 0);pn.HelixEmoteFromSet=_l=Fg.__decorate([(0,hr.rtfm)("api","HelixEmoteFromSet","id")],_l)});var fh=u(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.HelixUserEmote=void 0;var Ng=(b(),x(g)),Gt=m(),VE=lh(),$E=C(),ml=class extends VE.HelixEmoteBase{static{n(this,"HelixUserEmote")}constructor(e,t){super(e),this._client=t}get type(){return this[Gt.rawDataSymbol].emote_type}get emoteSetId(){return this[Gt.rawDataSymbol].emote_set_id||null}get ownerId(){return this[Gt.rawDataSymbol].owner_id||null}async getAllEmotesFromSet(){return this[Gt.rawDataSymbol].emote_set_id?await this._client.chat.getEmotesFromSets([this[Gt.rawDataSymbol].emote_set_id]):null}async getOwner(){return this[Gt.rawDataSymbol].owner_id?await this._client.users.getUserById(this[Gt.rawDataSymbol].owner_id):null}};_n.HelixUserEmote=ml;Ng.__decorate([(0,$E.Enumerable)(!1)],ml.prototype,"_client",void 0);_n.HelixUserEmote=ml=Ng.__decorate([(0,Gt.rtfm)("api","HelixUserEmote","id")],ml)});var xh=u(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.HelixPrivilegedChatSettings=void 0;var zE=(b(),x(g)),gh=m(),KE=pl(),bh=class extends KE.HelixChatSettings{static{n(this,"HelixPrivilegedChatSettings")}get nonModeratorChatDelayEnabled(){return this[gh.rawDataSymbol].non_moderator_chat_delay}get nonModeratorChatDelay(){return this[gh.rawDataSymbol].non_moderator_chat_delay_duration}};mn.HelixPrivilegedChatSettings=bh;mn.HelixPrivilegedChatSettings=bh=zE.__decorate([(0,gh.rtfm)("api","HelixPrivilegedChatSettings","broadcasterId")],bh)});var vh=u(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.HelixSentChatMessage=void 0;var JE=(b(),x(g)),Vr=m(),wh=class extends Vr.DataObject{static{n(this,"HelixSentChatMessage")}get id(){return this[Vr.rawDataSymbol].message_id}get isSent(){return this[Vr.rawDataSymbol].is_sent}get dropReasonCode(){var e;return(e=this[Vr.rawDataSymbol].drop_reason)===null||e===void 0?void 0:e.code}get dropReasonMessage(){var e;return(e=this[Vr.rawDataSymbol].drop_reason)===null||e===void 0?void 0:e.message}};yn.HelixSentChatMessage=wh;yn.HelixSentChatMessage=wh=JE.__decorate([(0,Vr.rtfm)("api","HelixSentChatMessage","id")],wh)});var Qg=u(yl=>{"use strict";Object.defineProperty(yl,"__esModule",{value:!0});yl.createSharedChatSessionQuery=void 0;var ZE=m();function XE(i){return{broadcaster_id:(0,ZE.extractUserId)(i)}}n(XE,"createSharedChatSessionQuery");yl.createSharedChatSessionQuery=XE});var Sh=u(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.HelixSharedChatSessionParticipant=void 0;var Gg=(b(),x(g)),YE=C(),fn=m(),fl=class extends fn.DataObject{static{n(this,"HelixSharedChatSessionParticipant")}constructor(e,t){super(e),this._client=t}get broadcasterId(){return this[fn.rawDataSymbol].broadcaster_id}async getBroadcaster(){return(0,fn.checkRelationAssertion)(await this._client.users.getUserById(this[fn.rawDataSymbol].broadcaster_id))}};gn.HelixSharedChatSessionParticipant=fl;Gg.__decorate([(0,YE.Enumerable)(!1)],fl.prototype,"_client",void 0);gn.HelixSharedChatSessionParticipant=fl=Gg.__decorate([(0,fn.rtfm)("api","HelixSharedChatSessionParticipant","broadcasterId")],fl)});var Hh=u(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.HelixSharedChatSession=void 0;var Wg=(b(),x(g)),eP=C(),Ht=m(),tP=Sh(),gl=class extends Ht.DataObject{static{n(this,"HelixSharedChatSession")}constructor(e,t){super(e),this._client=t}get sessionId(){return this[Ht.rawDataSymbol].session_id}get hostBroadcasterId(){return this[Ht.rawDataSymbol].host_broadcaster_id}async getHostBroadcaster(){return(0,Ht.checkRelationAssertion)(await this._client.users.getUserById(this[Ht.rawDataSymbol].host_broadcaster_id))}get participants(){return this[Ht.rawDataSymbol].participants.map(e=>new tP.HelixSharedChatSessionParticipant(e,this._client))}get createdDate(){return new Date(this[Ht.rawDataSymbol].created_at)}get updatedDate(){return new Date(this[Ht.rawDataSymbol].updated_at)}};bn.HelixSharedChatSession=gl;Wg.__decorate([(0,eP.Enumerable)(!1)],gl.prototype,"_client",void 0);bn.HelixSharedChatSession=gl=Wg.__decorate([(0,Ht.rtfm)("api","HelixSharedChatSession","sessionId")],gl)});var Eh=u(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.HelixChatApi=void 0;var rP=(b(),x(g)),Ch=Y(),Z=m(),pr=Bg(),Wt=Oe(),iP=oe(),nP=Gr(),Vg=he(),$g=le(),aP=G(),sP=ch(),zg=ph(),Kg=_h(),oP=pl(),lP=sn(),uP=yh(),Jg=fh(),Zg=xh(),Xg=vh(),cP=Qg(),dP=Hh(),qh=class extends aP.BaseApi{static{n(this,"HelixChatApi")}async getChatters(e,t){let r=(0,Z.extractUserId)(e),a=await this._client.callApi({type:"helix",url:"chat/chatters",userId:r,canOverrideScopedUserContext:!0,scopes:["moderator:read:chatters"],query:{...this._createModeratorActionQuery(r),...(0,$g.createPaginationQuery)(t)}});return(0,Vg.createPaginatedResultWithTotal)(a,Kg.HelixChatChatter,this._client)}getChattersPaginated(e){let t=(0,Z.extractUserId)(e);return new nP.HelixPaginatedRequestWithTotal({url:"chat/chatters",userId:t,canOverrideScopedUserContext:!0,scopes:["moderator:read:chatters"],query:this._createModeratorActionQuery(t)},this._client,r=>new Kg.HelixChatChatter(r,this._client),1e3)}async getGlobalBadges(){return(await this._client.callApi({type:"helix",url:"chat/badges/global"})).data.map(t=>new zg.HelixChatBadgeSet(t))}async getChannelBadges(e){return(await this._client.callApi({type:"helix",url:"chat/badges",userId:(0,Z.extractUserId)(e),query:(0,Ch.createBroadcasterQuery)(e)})).data.map(r=>new zg.HelixChatBadgeSet(r))}async getGlobalEmotes(){return(await this._client.callApi({type:"helix",url:"chat/emotes/global"})).data.map(t=>new lP.HelixEmote(t))}async getChannelEmotes(e){return(await this._client.callApi({type:"helix",url:"chat/emotes",userId:(0,Z.extractUserId)(e),query:(0,Ch.createBroadcasterQuery)(e)})).data.map(r=>new sP.HelixChannelEmote(r,this._client))}async getEmotesFromSets(e){return(await this._client.callApi({type:"helix",url:"chat/emotes/set",query:(0,Wt.createSingleKeyQuery)("emote_set_id",e)})).data.map(r=>new uP.HelixEmoteFromSet(r,this._client))}async getUserEmotes(e,t){let r=(0,Z.extractUserId)(e),a=await this._client.callApi({type:"helix",url:"chat/emotes/user",userId:(0,Z.extractUserId)(e),scopes:["user:read:emotes"],query:{...(0,Wt.createSingleKeyQuery)("user_id",r),...(0,Wt.createSingleKeyQuery)("broadcasterId",t?.broadcaster?(0,Z.extractUserId)(t.broadcaster):void 0),...(0,$g.createPaginationQuery)(t)}});return(0,Vg.createPaginatedResult)(a,Jg.HelixUserEmote,this._client)}getUserEmotesPaginated(e,t){let r=(0,Z.extractUserId)(e);return new iP.HelixPaginatedRequest({url:"chat/emotes/user",userId:r,scopes:["user:read:emotes"],query:{...(0,Wt.createSingleKeyQuery)("user_id",r),...(0,Wt.createSingleKeyQuery)("broadcasterId",t?(0,Z.extractUserId)(t):void 0)}},this._client,a=>new Jg.HelixUserEmote(a,this._client))}async getSettings(e){let t=await this._client.callApi({type:"helix",url:"chat/settings",userId:(0,Z.extractUserId)(e),query:(0,Ch.createBroadcasterQuery)(e)});return new oP.HelixChatSettings(t.data[0])}async getSettingsPrivileged(e){let t=(0,Z.extractUserId)(e),r=await this._client.callApi({type:"helix",url:"chat/settings",userId:t,canOverrideScopedUserContext:!0,scopes:["moderator:read:chat_settings"],query:this._createModeratorActionQuery(t)});return new Zg.HelixPrivilegedChatSettings(r.data[0])}async updateSettings(e,t){let r=(0,Z.extractUserId)(e),a=await this._client.callApi({type:"helix",url:"chat/settings",method:"PATCH",userId:r,canOverrideScopedUserContext:!0,scopes:["moderator:manage:chat_settings"],query:this._createModeratorActionQuery(r),jsonBody:(0,pr.createChatSettingsUpdateBody)(t)});return new Zg.HelixPrivilegedChatSettings(a.data[0])}async sendChatMessage(e,t,r){let a=(0,Z.extractUserId)(e),s=await this._client.callApi({type:"helix",url:"chat/messages",method:"POST",userId:a,canOverrideScopedUserContext:!0,scopes:["user:write:chat"],query:(0,pr.createSendChatMessageQuery)(a,this._getUserContextIdWithDefault(a)),jsonBody:(0,pr.createSendChatMessageBody)(t,r)});return new Xg.HelixSentChatMessage(s.data[0])}async sendChatMessageAsApp(e,t,r,a){let s=(0,Z.extractUserId)(e),o=(0,Z.extractUserId)(t),l=await this._client.callApi({type:"helix",url:"chat/messages",method:"POST",forceType:"app",query:(0,pr.createSendChatMessageQuery)(o,s),jsonBody:(0,pr.createSendChatMessageAsAppBody)(r,a)});return new Xg.HelixSentChatMessage(l.data[0])}async sendAnnouncement(e,t){let r=(0,Z.extractUserId)(e);await this._client.callApi({type:"helix",url:"chat/announcements",method:"POST",userId:r,canOverrideScopedUserContext:!0,scopes:["moderator:manage:announcements"],query:this._createModeratorActionQuery(r),jsonBody:{message:t.message,color:t.color}})}async getColorsForUsers(e){let t=await this._client.callApi({type:"helix",url:"chat/color",query:(0,Wt.createSingleKeyQuery)("user_id",e.map(Z.extractUserId))});return new Map(t.data.map(r=>[r.user_id,r.color||null]))}async getColorForUser(e){let t=await this._client.callApi({type:"helix",url:"chat/color",userId:(0,Z.extractUserId)(e),query:(0,Wt.createSingleKeyQuery)("user_id",(0,Z.extractUserId)(e))});if(t.data.length)return t.data[0].color||null}async setColorForUser(e,t){await this._client.callApi({type:"helix",url:"chat/color",method:"PUT",userId:(0,Z.extractUserId)(e),scopes:["user:manage:chat_color"],query:(0,pr.createChatColorUpdateQuery)(e,t)})}async shoutoutUser(e,t){let r=(0,Z.extractUserId)(e);await this._client.callApi({type:"helix",url:"chat/shoutouts",method:"POST",userId:r,canOverrideScopedUserContext:!0,scopes:["moderator:manage:shoutouts"],query:(0,pr.createShoutoutQuery)(e,t,this._getUserContextIdWithDefault(r))})}async getSharedChatSession(e){let t=(0,Z.extractUserId)(e),r=await this._client.callApi({type:"helix",url:"shared_chat/session",userId:t,query:(0,cP.createSharedChatSessionQuery)(t)});return r.data.length===0?null:new dP.HelixSharedChatSession(r.data[0],this._client)}_createModeratorActionQuery(e){return(0,Wt.createModeratorActionQuery)(e,this._getUserContextIdWithDefault(e))}};xn.HelixChatApi=qh;xn.HelixChatApi=qh=rP.__decorate([(0,Z.rtfm)("api","HelixChatApi")],qh)});var Yg=u($r=>{"use strict";Object.defineProperty($r,"__esModule",{value:!0});$r.createClipQuery=$r.createClipCreateQuery=void 0;var hP=m();function pP(i,e){return{broadcaster_id:(0,hP.extractUserId)(i),has_delay:e.toString()}}n(pP,"createClipCreateQuery");$r.createClipCreateQuery=pP;function _P(i){let{filterType:e,ids:t,startDate:r,endDate:a,isFeatured:s}=i;return{[e]:t,started_at:r,ended_at:a,is_featured:s?.toString()}}n(_P,"createClipQuery");$r.createClipQuery=_P});var Ph=u(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.HelixClip=void 0;var eb=(b(),x(g)),mP=C(),L=m(),bl=class extends L.DataObject{static{n(this,"HelixClip")}constructor(e,t){super(e),this._client=t}get id(){return this[L.rawDataSymbol].id}get url(){return this[L.rawDataSymbol].url}get embedUrl(){return this[L.rawDataSymbol].embed_url}get broadcasterId(){return this[L.rawDataSymbol].broadcaster_id}get broadcasterDisplayName(){return this[L.rawDataSymbol].broadcaster_name}async getBroadcaster(){return(0,L.checkRelationAssertion)(await this._client.users.getUserById(this[L.rawDataSymbol].broadcaster_id))}get creatorId(){return this[L.rawDataSymbol].creator_id}get creatorDisplayName(){return this[L.rawDataSymbol].creator_name}async getCreator(){return(0,L.checkRelationAssertion)(await this._client.users.getUserById(this[L.rawDataSymbol].creator_id))}get videoId(){return this[L.rawDataSymbol].video_id}async getVideo(){return(0,L.checkRelationAssertion)(await this._client.videos.getVideoById(this[L.rawDataSymbol].video_id))}get gameId(){return this[L.rawDataSymbol].game_id}async getGame(){return this[L.rawDataSymbol].game_id?(0,L.checkRelationAssertion)(await this._client.games.getGameById(this[L.rawDataSymbol].game_id)):null}get language(){return this[L.rawDataSymbol].language}get title(){return this[L.rawDataSymbol].title}get views(){return this[L.rawDataSymbol].view_count}get creationDate(){return new Date(this[L.rawDataSymbol].created_at)}get thumbnailUrl(){return this[L.rawDataSymbol].thumbnail_url}get duration(){return this[L.rawDataSymbol].duration}get vodOffset(){return this[L.rawDataSymbol].vod_offset}get isFeatured(){return this[L.rawDataSymbol].is_featured}};wn.HelixClip=bl;eb.__decorate([(0,mP.Enumerable)(!1)],bl.prototype,"_client",void 0);wn.HelixClip=bl=eb.__decorate([(0,L.rtfm)("api","HelixClip","id")],bl)});var Ih=u(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.HelixClipApi=void 0;var tb=(b(),x(g)),yP=C(),zr=m(),Ah=Yg(),fP=Lt(),gP=oe(),bP=he(),xP=le(),wP=G(),Dh=Ph(),xl=class extends wP.BaseApi{static{n(this,"HelixClipApi")}constructor(){super(...arguments),this._getClipByIdBatcher=new fP.HelixRequestBatcher({url:"clips"},"id","id",this._client,e=>new Dh.HelixClip(e,this._client))}async getClipsForBroadcaster(e,t={}){return await this._getClips({...t,filterType:"broadcaster_id",ids:(0,zr.extractUserId)(e),userId:(0,zr.extractUserId)(e)})}getClipsForBroadcasterPaginated(e,t={}){return this._getClipsPaginated({...t,filterType:"broadcaster_id",ids:(0,zr.extractUserId)(e),userId:(0,zr.extractUserId)(e)})}async getClipsForGame(e,t={}){return await this._getClips({...t,filterType:"game_id",ids:e})}getClipsForGamePaginated(e,t={}){return this._getClipsPaginated({...t,filterType:"game_id",ids:e})}async getClipsByIds(e){return(await this._getClips({filterType:"id",ids:e})).data}async getClipById(e){let t=await this.getClipsByIds([e]);return t.length?t[0]:null}async getClipByIdBatched(e){return await this._getClipByIdBatcher.request(e)}async createClip(e){let{channel:t,createAfterDelay:r=!1}=e;return(await this._client.callApi({type:"helix",url:"clips",method:"POST",userId:(0,zr.extractUserId)(t),scopes:["clips:edit"],canOverrideScopedUserContext:!0,query:(0,Ah.createClipCreateQuery)(t,r)})).data[0].id}async _getClips(e){if(!e.ids.length)return{data:[]};let t=await this._client.callApi({type:"helix",url:"clips",userId:e.userId,query:{...(0,Ah.createClipQuery)(e),...(0,xP.createPaginationQuery)(e)}});return(0,bP.createPaginatedResult)(t,Dh.HelixClip,this._client)}_getClipsPaginated(e){return new gP.HelixPaginatedRequest({url:"clips",userId:e.userId,query:(0,Ah.createClipQuery)(e)},this._client,t=>new Dh.HelixClip(t,this._client))}};vn.HelixClipApi=xl;tb.__decorate([(0,yP.Enumerable)(!1)],xl.prototype,"_getClipByIdBatcher",void 0);vn.HelixClipApi=xl=tb.__decorate([(0,zr.rtfm)("api","HelixClipApi")],xl)});var Rh=u(vl=>{"use strict";Object.defineProperty(vl,"__esModule",{value:!0});vl.HelixContentClassificationLabel=void 0;var wl=m(),Th=class extends wl.DataObject{static{n(this,"HelixContentClassificationLabel")}get id(){return this[wl.rawDataSymbol].id}get name(){return this[wl.rawDataSymbol].name}get description(){return this[wl.rawDataSymbol].description}};vl.HelixContentClassificationLabel=Th});var Bh=u(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.HelixContentClassificationLabelApi=void 0;var vP=(b(),x(g)),SP=m(),HP=G(),CP=Rh(),Uh=class extends HP.BaseApi{static{n(this,"HelixContentClassificationLabelApi")}async getAll(e){return(await this._client.callApi({url:"content_classification_labels",query:{locale:e}})).data.map(r=>new CP.HelixContentClassificationLabel(r))}};Sn.HelixContentClassificationLabelApi=Uh;Sn.HelixContentClassificationLabelApi=Uh=vP.__decorate([(0,SP.rtfm)("api","HelixContentClassificationLabelApi")],Uh)});var rb=u(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.createDropsEntitlementUpdateBody=Kr.createDropsEntitlementQuery=void 0;var qP=C(),EP=m();function PP(i,e){return{user_id:e?(0,qP.mapOptional)(i.user,EP.extractUserId):void 0,game_id:i.gameId,fulfillment_status:i.fulfillmentStatus}}n(PP,"createDropsEntitlementQuery");Kr.createDropsEntitlementQuery=PP;function AP(i,e){return{fulfillment_status:e,entitlement_ids:i}}n(AP,"createDropsEntitlementUpdateBody");Kr.createDropsEntitlementUpdateBody=AP});var Oh=u(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.HelixDropsEntitlement=void 0;var ib=(b(),x(g)),DP=C(),je=m(),Sl=class extends je.DataObject{static{n(this,"HelixDropsEntitlement")}constructor(e,t){super(e),this._client=t}get id(){return this[je.rawDataSymbol].id}get rewardId(){return this[je.rawDataSymbol].benefit_id}get grantDate(){return new Date(this[je.rawDataSymbol].timestamp)}get userId(){return this[je.rawDataSymbol].user_id}async getUser(){return(0,je.checkRelationAssertion)(await this._client.users.getUserById(this[je.rawDataSymbol].user_id))}get gameId(){return this[je.rawDataSymbol].game_id}async getGame(){return(0,je.checkRelationAssertion)(await this._client.games.getGameById(this[je.rawDataSymbol].game_id))}get fulfillmentStatus(){return this[je.rawDataSymbol].fulfillment_status}get updateDate(){return new Date(this[je.rawDataSymbol].last_updated)}};Hn.HelixDropsEntitlement=Sl;ib.__decorate([(0,DP.Enumerable)(!1)],Sl.prototype,"_client",void 0);Hn.HelixDropsEntitlement=Sl=ib.__decorate([(0,je.rtfm)("api","HelixDropsEntitlement")],Sl)});var Lh=u(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});Cn.HelixEntitlementApi=void 0;var nb=(b(),x(g)),kh=C(),Mh=m(),jh=rb(),IP=Lt(),TP=oe(),RP=he(),UP=le(),BP=G(),Hl=Oh(),Cl=class extends BP.BaseApi{static{n(this,"HelixEntitlementApi")}constructor(){super(...arguments),this._getDropsEntitlementByIdBatcher=new IP.HelixRequestBatcher({url:"entitlements/drops"},"id","id",this._client,e=>new Hl.HelixDropsEntitlement(e,this._client))}async getDropsEntitlements(e,t=!1){let r=await this._client.callApi({type:"helix",url:"entitlements/drops",userId:(0,kh.mapOptional)(e.user,Mh.extractUserId),forceType:e.user&&t?"app":void 0,query:{...(0,jh.createDropsEntitlementQuery)(e,t),...(0,UP.createPaginationQuery)(e)}});return(0,RP.createPaginatedResult)(r,Hl.HelixDropsEntitlement,this._client)}getDropsEntitlementsPaginated(e,t=!1){return new TP.HelixPaginatedRequest({url:"entitlements/drops",userId:(0,kh.mapOptional)(e.user,Mh.extractUserId),forceType:e.user&&t?"app":void 0,query:(0,jh.createDropsEntitlementQuery)(e,t)},this._client,r=>new Hl.HelixDropsEntitlement(r,this._client))}async getDropsEntitlementsByIds(e){return(await this._client.callApi({type:"helix",url:"entitlements/drops",query:{id:e}})).data.map(r=>new Hl.HelixDropsEntitlement(r,this._client))}async getDropsEntitlementById(e){var t;return(t=(await this.getDropsEntitlementsByIds([e]))[0])!==null&&t!==void 0?t:null}async getDropsEntitlementByIdBatched(e){return await this._getDropsEntitlementByIdBatcher.request(e)}async updateDropsEntitlements(e,t){let r=await this._client.callApi({type:"helix",url:"entitlements/drops",method:"PATCH",jsonBody:(0,jh.createDropsEntitlementUpdateBody)(e,t)});return new Map(r.data.flatMap(a=>a.ids.map(s=>[s,a.status])))}};Cn.HelixEntitlementApi=Cl;nb.__decorate([(0,kh.Enumerable)(!1)],Cl.prototype,"_getDropsEntitlementByIdBatcher",void 0);Cn.HelixEntitlementApi=Cl=nb.__decorate([(0,Mh.rtfm)("api","HelixEntitlementApi")],Cl)});var sb=u(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.createEventSubConduitShardsUpdateCondition=me.createEventSubConduitUpdateCondition=me.createEventSubConduitCondition=me.createEventSubDropEntitlementGrantCondition=me.createEventSubUserCondition=me.createEventSubModeratorCondition=me.createEventSubRewardCondition=me.createEventSubBroadcasterCondition=void 0;var ab=m();function OP(i){return{broadcaster_user_id:(0,ab.extractUserId)(i)}}n(OP,"createEventSubBroadcasterCondition");me.createEventSubBroadcasterCondition=OP;function jP(i,e){return{broadcaster_user_id:(0,ab.extractUserId)(i),reward_id:e}}n(jP,"createEventSubRewardCondition");me.createEventSubRewardCondition=jP;function kP(i,e){return{broadcaster_user_id:i,moderator_user_id:e}}n(kP,"createEventSubModeratorCondition");me.createEventSubModeratorCondition=kP;function MP(i,e){return{broadcaster_user_id:i,user_id:e}}n(MP,"createEventSubUserCondition");me.createEventSubUserCondition=MP;function LP(i){return{organization_id:i.organizationId,category_id:i.categoryId,campaign_id:i.campaignId}}n(LP,"createEventSubDropEntitlementGrantCondition");me.createEventSubDropEntitlementGrantCondition=LP;function FP(i,e){return{conduit_id:i,status:e}}n(FP,"createEventSubConduitCondition");me.createEventSubConduitCondition=FP;function NP(i,e){return{id:i,shard_count:e.toString()}}n(NP,"createEventSubConduitUpdateCondition");me.createEventSubConduitUpdateCondition=NP;function QP(i,e){return{conduit_id:i,shards:e}}n(QP,"createEventSubConduitShardsUpdateCondition");me.createEventSubConduitShardsUpdateCondition=QP});var El=u(qn=>{"use strict";Object.defineProperty(qn,"__esModule",{value:!0});qn.HelixEventSubSubscription=void 0;var ob=(b(),x(g)),GP=C(),$e=m(),ql=class extends $e.DataObject{static{n(this,"HelixEventSubSubscription")}constructor(e,t){super(e),this._client=t}get id(){return this[$e.rawDataSymbol].id}get status(){return this[$e.rawDataSymbol].status}get type(){return this[$e.rawDataSymbol].type}get cost(){return this[$e.rawDataSymbol].cost}get condition(){return this[$e.rawDataSymbol].condition}get creationDate(){return new Date(this[$e.rawDataSymbol].created_at)}get transportMethod(){return this[$e.rawDataSymbol].transport.method}async unsubscribe(){await this._client.eventSub.deleteSubscription(this[$e.rawDataSymbol].id)}get _transport(){return this[$e.rawDataSymbol].transport}set _status(e){this[$e.rawDataSymbol].status=e}};qn.HelixEventSubSubscription=ql;ob.__decorate([(0,GP.Enumerable)(!1)],ql.prototype,"_client",void 0);qn.HelixEventSubSubscription=ql=ob.__decorate([(0,$e.rtfm)("api","HelixEventSubSubscription","id")],ql)});var Nh=u(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.HelixPaginatedEventSubSubscriptionsRequest=void 0;var WP=(b(),x(g)),VP=m(),$P=Gr(),zP=El(),Fh=class extends $P.HelixPaginatedRequestWithTotal{static{n(this,"HelixPaginatedEventSubSubscriptionsRequest")}constructor(e,t,r){super({url:"eventsub/subscriptions",userId:t,query:e},r,a=>new zP.HelixEventSubSubscription(a,r))}async getTotalCost(){var e;return((e=this._currentData)!==null&&e!==void 0?e:await this._fetchData({query:{after:void 0}})).total_cost}async getMaxTotalCost(){var e;return((e=this._currentData)!==null&&e!==void 0?e:await this._fetchData({query:{after:void 0}})).max_total_cost}};En.HelixPaginatedEventSubSubscriptionsRequest=Fh;En.HelixPaginatedEventSubSubscriptionsRequest=Fh=WP.__decorate([(0,VP.rtfm)("api","HelixPaginatedEventSubSubscriptionsRequest")],Fh)});var Qh=u(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.HelixEventSubConduit=void 0;var lb=(b(),x(g)),KP=C(),_r=m(),Pl=class extends _r.DataObject{static{n(this,"HelixEventSubConduit")}constructor(e,t){super(e),this._client=t}get id(){return this[_r.rawDataSymbol].id}get shardCount(){return this[_r.rawDataSymbol].shard_count}async update(e){return await this._client.eventSub.updateConduit(this[_r.rawDataSymbol].id,e)}async delete(){await this._client.eventSub.deleteConduit(this[_r.rawDataSymbol].id)}async getShards(){return await this._client.eventSub.getConduitShards(this[_r.rawDataSymbol].id)}};Pn.HelixEventSubConduit=Pl;lb.__decorate([(0,KP.Enumerable)(!1)],Pl.prototype,"_client",void 0);Pn.HelixEventSubConduit=Pl=lb.__decorate([(0,_r.rtfm)("api","HelixEventSubConduit")],Pl)});var Wh=u(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.HelixEventSubConduitShard=void 0;var JP=(b(),x(g)),An=m(),Gh=class extends An.DataObject{static{n(this,"HelixEventSubConduitShard")}get id(){return this[An.rawDataSymbol].id}get status(){return this[An.rawDataSymbol].status}get transportMethod(){return this[An.rawDataSymbol].transport.method}};Dn.HelixEventSubConduitShard=Gh;Dn.HelixEventSubConduitShard=Gh=JP.__decorate([(0,An.rtfm)("api","HelixEventSubConduitShard")],Gh)});var Kh=u(Un=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});Un.HelixEventSubApi=void 0;var ZP=(b(),x(g)),XP=C(),U=m(),S=sb(),et=Oe(),YP=oe(),In=he(),Tn=le(),eA=G(),Rn=El(),Al=Nh(),Vh=Qh(),$h=Wh(),zh=class extends eA.BaseApi{static{n(this,"HelixEventSubApi")}async getSubscriptions(e){let t=await this._client.callApi({type:"helix",url:"eventsub/subscriptions",query:(0,Tn.createPaginationQuery)(e)});return{...(0,In.createPaginatedResultWithTotal)(t,Rn.HelixEventSubSubscription,this._client),totalCost:t.total_cost,maxTotalCost:t.max_total_cost}}getSubscriptionsPaginated(){return new Al.HelixPaginatedEventSubSubscriptionsRequest({},void 0,this._client)}async getSubscriptionsForStatus(e,t){let r=await this._client.callApi({type:"helix",url:"eventsub/subscriptions",query:{...(0,Tn.createPaginationQuery)(t),status:e}});return{...(0,In.createPaginatedResultWithTotal)(r,Rn.HelixEventSubSubscription,this._client),totalCost:r.total_cost,maxTotalCost:r.max_total_cost}}getSubscriptionsForStatusPaginated(e){return new Al.HelixPaginatedEventSubSubscriptionsRequest({status:e},void 0,this._client)}async getSubscriptionsForType(e,t){let r=await this._client.callApi({type:"helix",url:"eventsub/subscriptions",query:{...(0,Tn.createPaginationQuery)(t),type:e}});return{...(0,In.createPaginatedResultWithTotal)(r,Rn.HelixEventSubSubscription,this._client),totalCost:r.total_cost,maxTotalCost:r.max_total_cost}}getSubscriptionsForTypePaginated(e){return new Al.HelixPaginatedEventSubSubscriptionsRequest({type:e},void 0,this._client)}async getSubscriptionsForUser(e,t){let r=await this._client.callApi({type:"helix",url:"eventsub/subscriptions",userId:(0,U.extractUserId)(e),query:{...(0,et.createSingleKeyQuery)("user_id",(0,U.extractUserId)(e)),...(0,Tn.createPaginationQuery)(t)}});return{...(0,In.createPaginatedResultWithTotal)(r,Rn.HelixEventSubSubscription,this._client),totalCost:r.total_cost,maxTotalCost:r.max_total_cost}}getSubscriptionsForUserPaginated(e){let t=(0,U.extractUserId)(e);return new Al.HelixPaginatedEventSubSubscriptionsRequest((0,et.createSingleKeyQuery)("user_id",t),t,this._client)}async createSubscription(e,t,r,a,s,o,l,c){let h=a.method==="webhook"||a.method==="conduit",p=h?void 0:o;if(!h&&!s)throw new Error(`Transport ${a.method} can only handle subscriptions with user context`);let w={type:e,version:t,condition:r,transport:a};c&&(w.is_batching_enabled=!0);let E=await this._client.callApi({type:"helix",url:"eventsub/subscriptions",method:"POST",scopes:p,userId:(0,XP.mapOptional)(s,U.extractUserId),canOverrideScopedUserContext:l,forceType:h?"app":"user",jsonBody:w});return new Rn.HelixEventSubSubscription(E.data[0],this._client)}async deleteSubscription(e){await this._client.callApi({type:"helix",url:"eventsub/subscriptions",method:"DELETE",query:{id:e}})}async deleteAllSubscriptions(){await this._deleteSubscriptionsWithCondition()}async deleteBrokenSubscriptions(){await this._deleteSubscriptionsWithCondition(e=>e.status!=="enabled"&&e.status!=="webhook_callback_verification_pending")}async subscribeToStreamOnlineEvents(e,t){return await this.createSubscription("stream.online","1",(0,S.createEventSubBroadcasterCondition)(e),t,e)}async subscribeToStreamOfflineEvents(e,t){return await this.createSubscription("stream.offline","1",(0,S.createEventSubBroadcasterCondition)(e),t,e)}async subscribeToChannelUpdateEvents(e,t){return await this.createSubscription("channel.update","2",(0,S.createEventSubBroadcasterCondition)(e),t,e)}async subscribeToChannelFollowEvents(e,t){let r=(0,U.extractUserId)(e);return await this.createSubscription("channel.follow","2",(0,S.createEventSubModeratorCondition)(r,this._getUserContextIdWithDefault(r)),t,r,["moderator:read:followers"],!0)}async subscribeToChannelSubscriptionEvents(e,t){return await this.createSubscription("channel.subscribe","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:subscriptions"])}async subscribeToChannelSubscriptionGiftEvents(e,t){return await this.createSubscription("channel.subscription.gift","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:subscriptions"])}async subscribeToChannelSubscriptionMessageEvents(e,t){return await this.createSubscription("channel.subscription.message","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:subscriptions"])}async subscribeToChannelSubscriptionEndEvents(e,t){return await this.createSubscription("channel.subscription.end","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:subscriptions"])}async subscribeToChannelCheerEvents(e,t){return await this.createSubscription("channel.cheer","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["bits:read"])}async subscribeToChannelCharityCampaignStartEvents(e,t){return await this.createSubscription("channel.charity_campaign.start","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:charity"])}async subscribeToChannelCharityCampaignStopEvents(e,t){return await this.createSubscription("channel.charity_campaign.stop","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:charity"])}async subscribeToChannelCharityDonationEvents(e,t){return await this.createSubscription("channel.charity_campaign.donate","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:charity"])}async subscribeToChannelCharityCampaignProgressEvents(e,t){return await this.createSubscription("channel.charity_campaign.progress","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:charity"])}async subscribeToChannelBanEvents(e,t){return await this.createSubscription("channel.ban","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:moderate"])}async subscribeToChannelUnbanEvents(e,t){return await this.createSubscription("channel.unban","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:moderate"])}async subscribeToChannelShieldModeBeginEvents(e,t){let r=(0,U.extractUserId)(e);return await this.createSubscription("channel.shield_mode.begin","1",(0,S.createEventSubModeratorCondition)(r,this._getUserContextIdWithDefault(r)),t,r,["moderator:read:shield_mode","moderator:manage:shield_mode"],!0)}async subscribeToChannelShieldModeEndEvents(e,t){let r=(0,U.extractUserId)(e);return await this.createSubscription("channel.shield_mode.end","1",(0,S.createEventSubModeratorCondition)(r,this._getUserContextIdWithDefault(r)),t,r,["moderator:read:shield_mode","moderator:manage:shield_mode"],!0)}async subscribeToChannelModeratorAddEvents(e,t){return await this.createSubscription("channel.moderator.add","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["moderation:read"])}async subscribeToChannelModeratorRemoveEvents(e,t){return await this.createSubscription("channel.moderator.remove","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["moderation:read"])}async subscribeToChannelRaidEventsFrom(e,t){return await this.createSubscription("channel.raid","1",(0,et.createSingleKeyQuery)("from_broadcaster_user_id",(0,U.extractUserId)(e)),t,e)}async subscribeToChannelRaidEventsTo(e,t){return await this.createSubscription("channel.raid","1",(0,et.createSingleKeyQuery)("to_broadcaster_user_id",(0,U.extractUserId)(e)),t,e)}async subscribeToChannelRewardAddEvents(e,t){return await this.createSubscription("channel.channel_points_custom_reward.add","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:redemptions","channel:manage:redemptions"])}async subscribeToChannelRewardUpdateEvents(e,t){return await this.createSubscription("channel.channel_points_custom_reward.update","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:redemptions","channel:manage:redemptions"])}async subscribeToChannelRewardUpdateEventsForReward(e,t,r){return await this.createSubscription("channel.channel_points_custom_reward.update","1",(0,S.createEventSubRewardCondition)(e,t),r,e,["channel:read:redemptions","channel:manage:redemptions"])}async subscribeToChannelRewardRemoveEvents(e,t){return await this.createSubscription("channel.channel_points_custom_reward.remove","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:redemptions","channel:manage:redemptions"])}async subscribeToChannelRewardRemoveEventsForReward(e,t,r){return await this.createSubscription("channel.channel_points_custom_reward.remove","1",(0,S.createEventSubRewardCondition)(e,t),r,e,["channel:read:redemptions","channel:manage:redemptions"])}async subscribeToChannelRedemptionAddEvents(e,t){return await this.createSubscription("channel.channel_points_custom_reward_redemption.add","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:redemptions","channel:manage:redemptions"])}async subscribeToChannelRedemptionAddEventsForReward(e,t,r){return await this.createSubscription("channel.channel_points_custom_reward_redemption.add","1",(0,S.createEventSubRewardCondition)(e,t),r,e,["channel:read:redemptions","channel:manage:redemptions"])}async subscribeToChannelRedemptionUpdateEvents(e,t){return await this.createSubscription("channel.channel_points_custom_reward_redemption.update","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:redemptions","channel:manage:redemptions"])}async subscribeToChannelRedemptionUpdateEventsForReward(e,t,r){return await this.createSubscription("channel.channel_points_custom_reward_redemption.update","1",(0,S.createEventSubRewardCondition)(e,t),r,e,["channel:read:redemptions","channel:manage:redemptions"])}async subscribeToChannelAutomaticRewardRedemptionAddEvents(e,t){return await this.createSubscription("channel.channel_points_automatic_reward_redemption.add","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:redemptions","channel:manage:redemptions"])}async subscribeToChannelAutomaticRewardRedemptionAddV2Events(e,t){return await this.createSubscription("channel.channel_points_automatic_reward_redemption.add","2",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:redemptions","channel:manage:redemptions"])}async subscribeToChannelPollBeginEvents(e,t){return await this.createSubscription("channel.poll.begin","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:polls","channel:manage:polls"])}async subscribeToChannelPollProgressEvents(e,t){return await this.createSubscription("channel.poll.progress","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:polls","channel:manage:polls"])}async subscribeToChannelPollEndEvents(e,t){return await this.createSubscription("channel.poll.end","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:polls","channel:manage:polls"])}async subscribeToChannelPredictionBeginEvents(e,t){return await this.createSubscription("channel.prediction.begin","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:predictions","channel:manage:predictions"])}async subscribeToChannelPredictionProgressEvents(e,t){return await this.createSubscription("channel.prediction.progress","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:predictions","channel:manage:predictions"])}async subscribeToChannelPredictionLockEvents(e,t){return await this.createSubscription("channel.prediction.lock","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:predictions","channel:manage:predictions"])}async subscribeToChannelPredictionEndEvents(e,t){return await this.createSubscription("channel.prediction.end","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:predictions","channel:manage:predictions"])}async subscribeToChannelGoalBeginEvents(e,t){return await this.createSubscription("channel.goal.begin","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:goals"])}async subscribeToChannelGoalProgressEvents(e,t){return await this.createSubscription("channel.goal.progress","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:goals"])}async subscribeToChannelGoalEndEvents(e,t){return await this.createSubscription("channel.goal.end","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:goals"])}async subscribeToChannelHypeTrainBeginEvents(e,t){return await this.createSubscription("channel.hype_train.begin","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:hype_train"])}async subscribeToChannelHypeTrainProgressEvents(e,t){return await this.createSubscription("channel.hype_train.progress","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:hype_train"])}async subscribeToChannelHypeTrainEndEvents(e,t){return await this.createSubscription("channel.hype_train.end","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:hype_train"])}async subscribeToChannelHypeTrainBeginV2Events(e,t){return await this.createSubscription("channel.hype_train.begin","2",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:hype_train"])}async subscribeToChannelHypeTrainProgressV2Events(e,t){return await this.createSubscription("channel.hype_train.progress","2",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:hype_train"])}async subscribeToChannelHypeTrainEndV2Events(e,t){return await this.createSubscription("channel.hype_train.end","2",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:hype_train"])}async subscribeToChannelShoutoutCreateEvents(e,t){let r=(0,U.extractUserId)(e);return await this.createSubscription("channel.shoutout.create","1",(0,S.createEventSubModeratorCondition)(r,this._getUserContextIdWithDefault(r)),t,r,["moderator:read:shoutouts","moderator:manage:shoutouts"],!0)}async subscribeToChannelShoutoutReceiveEvents(e,t){let r=(0,U.extractUserId)(e);return await this.createSubscription("channel.shoutout.receive","1",(0,S.createEventSubModeratorCondition)(r,this._getUserContextIdWithDefault(r)),t,r,["moderator:read:shoutouts","moderator:manage:shoutouts"],!0)}async subscribeToChannelAdBreakBeginEvents(e,t){return await this.createSubscription("channel.ad_break.begin","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:ads"])}async subscribeToChannelChatClearEvents(e,t){let r=(0,U.extractUserId)(e);return await this.createSubscription("channel.chat.clear","1",(0,S.createEventSubUserCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["user:read:chat"],!0)}async subscribeToChannelChatClearUserMessagesEvents(e,t){let r=(0,U.extractUserId)(e);return await this.createSubscription("channel.chat.clear_user_messages","1",(0,S.createEventSubUserCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["user:read:chat"],!0)}async subscribeToChannelChatMessageDeleteEvents(e,t){let r=(0,U.extractUserId)(e);return await this.createSubscription("channel.chat.message_delete","1",(0,S.createEventSubUserCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["user:read:chat"],!0)}async subscribeToChannelChatNotificationEvents(e,t){let r=(0,U.extractUserId)(e);return await this.createSubscription("channel.chat.notification","1",(0,S.createEventSubUserCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["user:read:chat"],!0)}async subscribeToChannelChatMessageEvents(e,t){let r=(0,U.extractUserId)(e);return await this.createSubscription("channel.chat.message","1",(0,S.createEventSubUserCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["user:read:chat"],!0)}async subscribeToChannelChatSettingsUpdateEvents(e,t){let r=(0,U.extractUserId)(e);return await this.createSubscription("channel.chat_settings.update","1",(0,S.createEventSubUserCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["user:read:chat"],!0)}async subscribeToChannelUnbanRequestCreateEvents(e,t){let r=(0,U.extractUserId)(e);return await this.createSubscription("channel.unban_request.create","1",(0,S.createEventSubModeratorCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["moderator:read:unban_requests","moderator:manage:unban_requests"],!0)}async subscribeToChannelUnbanRequestResolveEvents(e,t){let r=(0,U.extractUserId)(e);return await this.createSubscription("channel.unban_request.resolve","1",(0,S.createEventSubModeratorCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["moderator:read:unban_requests","moderator:manage:unban_requests"],!0)}async subscribeToChannelModerateEvents(e,t){let r=(0,U.extractUserId)(e);return await this.createSubscription("channel.moderate","2",(0,S.createEventSubModeratorCondition)(r,this._getUserContextIdWithDefault(r)),t,e,[],!0)}async subscribeToChannelWarningAcknowledgeEvents(e,t){let r=(0,U.extractUserId)(e);return await this.createSubscription("channel.warning.acknowledge","1",(0,S.createEventSubModeratorCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["moderator:read:warnings","moderator:manage:warnings"],!0)}async subscribeToChannelWarningSendEvents(e,t){let r=(0,U.extractUserId)(e);return await this.createSubscription("channel.warning.send","1",(0,S.createEventSubModeratorCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["moderator:read:warnings","moderator:manage:warnings"],!0)}async subscribeToChannelVipAddEvents(e,t){return await this.createSubscription("channel.vip.add","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:vips","channel:manage:vips"])}async subscribeToChannelVipRemoveEvents(e,t){return await this.createSubscription("channel.vip.remove","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:vips","channel:manage:vips"])}async subscribeToExtensionBitsTransactionCreateEvents(e,t){return await this.createSubscription("extension.bits_transaction.create","1",(0,et.createSingleKeyQuery)("extension_client_id",e),t)}async subscribeToUserAuthorizationGrantEvents(e,t){return await this.createSubscription("user.authorization.grant","1",(0,et.createSingleKeyQuery)("client_id",e),t)}async subscribeToUserAuthorizationRevokeEvents(e,t){return await this.createSubscription("user.authorization.revoke","1",(0,et.createSingleKeyQuery)("client_id",e),t)}async subscribeToUserUpdateEvents(e,t,r){return await this.createSubscription("user.update","1",(0,et.createSingleKeyQuery)("user_id",(0,U.extractUserId)(e)),t,e,r?["user:read:email"]:void 0)}async subscribeToUserWhisperMessageEvents(e,t){return await this.createSubscription("user.whisper.message","1",(0,et.createSingleKeyQuery)("user_id",(0,U.extractUserId)(e)),t,e,["user:read:whispers","user:manage:whispers"])}async subscribeToDropEntitlementGrantEvents(e,t){return await this.createSubscription("drop.entitlement.grant","1",(0,S.createEventSubDropEntitlementGrantCondition)(e),t,void 0,void 0,!1,!0)}async subscribeToAutoModMessageHoldEvents(e,t){let r=(0,U.extractUserId)(e);return await this.createSubscription("automod.message.hold","1",(0,S.createEventSubModeratorCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["moderator:manage:automod"],!0)}async subscribeToAutoModMessageUpdateEvents(e,t){let r=(0,U.extractUserId)(e);return await this.createSubscription("automod.message.update","1",(0,S.createEventSubModeratorCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["moderator:manage:automod"],!0)}async subscribeToAutoModMessageHoldV2Events(e,t){let r=(0,U.extractUserId)(e);return await this.createSubscription("automod.message.hold","2",(0,S.createEventSubModeratorCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["moderator:manage:automod"],!0)}async subscribeToAutoModMessageUpdateV2Events(e,t){let r=(0,U.extractUserId)(e);return await this.createSubscription("automod.message.update","2",(0,S.createEventSubModeratorCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["moderator:manage:automod"],!0)}async subscribeToAutoModSettingsUpdateEvents(e,t){let r=(0,U.extractUserId)(e);return await this.createSubscription("automod.settings.update","1",(0,S.createEventSubModeratorCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["moderator:read:automod_settings"],!0)}async subscribeToAutoModTermsUpdateEvents(e,t){let r=(0,U.extractUserId)(e);return await this.createSubscription("automod.terms.update","1",(0,S.createEventSubModeratorCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["moderator:manage:automod"],!0)}async subscribeToChannelChatUserMessageHoldEvents(e,t){let r=(0,U.extractUserId)(e);return await this.createSubscription("channel.chat.user_message_hold","1",(0,S.createEventSubUserCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["user:read:chat"],!0)}async subscribeToChannelChatUserMessageUpdateEvents(e,t){let r=(0,U.extractUserId)(e);return await this.createSubscription("channel.chat.user_message_update","1",(0,S.createEventSubUserCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["user:read:chat"],!0)}async subscribeToChannelSuspiciousUserUpdateEvents(e,t){let r=(0,U.extractUserId)(e);return await this.createSubscription("channel.suspicious_user.update","1",(0,S.createEventSubModeratorCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["moderator:read:suspicious_users"],!0)}async subscribeToChannelSuspiciousUserMessageEvents(e,t){let r=(0,U.extractUserId)(e);return await this.createSubscription("channel.suspicious_user.message","1",(0,S.createEventSubModeratorCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["moderator:read:suspicious_users"],!0)}async subscribeToChannelSharedChatSessionBeginEvents(e,t){let r=(0,U.extractUserId)(e);return await this.createSubscription("channel.shared_chat.begin","1",(0,S.createEventSubBroadcasterCondition)(r),t,r)}async subscribeToChannelSharedChatSessionUpdateEvents(e,t){let r=(0,U.extractUserId)(e);return await this.createSubscription("channel.shared_chat.update","1",(0,S.createEventSubBroadcasterCondition)(r),t,r)}async subscribeToChannelSharedChatSessionEndEvents(e,t){let r=(0,U.extractUserId)(e);return await this.createSubscription("channel.shared_chat.end","1",(0,S.createEventSubBroadcasterCondition)(r),t,r)}async subscribeToChannelBitsUseEvents(e,t){let r=(0,U.extractUserId)(e);return await this.createSubscription("channel.bits.use","1",(0,S.createEventSubBroadcasterCondition)(r),t,r,["bits:read"])}async getConduits(){return(await this._client.callApi({type:"helix",url:"eventsub/conduits"})).data.map(t=>new Vh.HelixEventSubConduit(t,this._client))}async createConduit(e){let t=await this._client.callApi({type:"helix",url:"eventsub/conduits",method:"POST",query:{...(0,et.createSingleKeyQuery)("shard_count",e.toString())}});return new Vh.HelixEventSubConduit(t.data[0],this._client)}async updateConduit(e,t){let r=await this._client.callApi({type:"helix",url:"eventsub/conduits",method:"PATCH",query:(0,S.createEventSubConduitUpdateCondition)(e,t)});return new Vh.HelixEventSubConduit(r.data[0],this._client)}async deleteConduit(e){await this._client.callApi({type:"helix",url:"eventsub/conduits",method:"DELETE",query:{...(0,et.createSingleKeyQuery)("id",e)}})}async getConduitShards(e,t,r){let a=await this._client.callApi({type:"helix",url:"eventsub/conduits/shards",query:{...(0,S.createEventSubConduitCondition)(e,t),...(0,Tn.createPaginationQuery)(r)}});return{...(0,In.createPaginatedResult)(a,$h.HelixEventSubConduitShard,this._client)}}getConduitShardsPaginated(e,t){return new YP.HelixPaginatedRequest({url:"eventsub/conduits/shards",query:(0,S.createEventSubConduitCondition)(e,t)},this._client,r=>new $h.HelixEventSubConduitShard(r))}async updateConduitShards(e,t){return(await this._client.callApi({type:"helix",url:"eventsub/conduits/shards",method:"PATCH",jsonBody:(0,S.createEventSubConduitShardsUpdateCondition)(e,t)})).data.map(a=>new $h.HelixEventSubConduitShard(a))}async _deleteSubscriptionsWithCondition(e){let t=this.getSubscriptionsPaginated();for await(let r of t)(!e||e(r))&&await r.unsubscribe()}};Un.HelixEventSubApi=zh;Un.HelixEventSubApi=zh=ZP.__decorate([(0,U.rtfm)("api","HelixEventSubApi")],zh)});var ub=u(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.createExtensionTransactionQuery=Vt.createExtensionProductBody=Vt.createReleasedExtensionFilter=void 0;function tA(i,e){return{extension_id:i,extension_version:e}}n(tA,"createReleasedExtensionFilter");Vt.createReleasedExtensionFilter=tA;function rA(i){return{sku:i.sku,cost:{amount:i.cost,type:"bits"},display_name:i.displayName,in_development:i.inDevelopment,expiration:i.expirationDate,is_broadcast:i.broadcast}}n(rA,"createExtensionProductBody");Vt.createExtensionProductBody=rA;function iA(i,e){return{extension_id:i,id:e.transactionIds}}n(iA,"createExtensionTransactionQuery");Vt.createExtensionTransactionQuery=iA});var Jh=u(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.HelixChannelReference=void 0;var cb=(b(),x(g)),nA=C(),Ie=m(),Dl=class extends Ie.DataObject{static{n(this,"HelixChannelReference")}constructor(e,t){super(e),this._client=t}get id(){return this[Ie.rawDataSymbol].broadcaster_id}get displayName(){return this[Ie.rawDataSymbol].broadcaster_name}async getChannel(){return(0,Ie.checkRelationAssertion)(await this._client.channels.getChannelInfoById(this[Ie.rawDataSymbol].broadcaster_id))}async getBroadcaster(){return(0,Ie.checkRelationAssertion)(await this._client.users.getUserById(this[Ie.rawDataSymbol].broadcaster_id))}get gameId(){return this[Ie.rawDataSymbol].game_id}get gameName(){return this[Ie.rawDataSymbol].game_name}async getGame(){return this[Ie.rawDataSymbol].game_id?(0,Ie.checkRelationAssertion)(await this._client.games.getGameById(this[Ie.rawDataSymbol].game_id)):null}get title(){return this[Ie.rawDataSymbol].title}};Bn.HelixChannelReference=Dl;cb.__decorate([(0,nA.Enumerable)(!1)],Dl.prototype,"_client",void 0);Bn.HelixChannelReference=Dl=cb.__decorate([(0,Ie.rtfm)("api","HelixChannelReference","id")],Dl)});var Xh=u(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.HelixExtensionBitsProduct=void 0;var aA=(b(),x(g)),sA=C(),$t=m(),Zh=class extends $t.DataObject{static{n(this,"HelixExtensionBitsProduct")}get sku(){return this[$t.rawDataSymbol].sku}get cost(){return this[$t.rawDataSymbol].cost.amount}get displayName(){return this[$t.rawDataSymbol].display_name}get inDevelopment(){return this[$t.rawDataSymbol].in_development}get isBroadcast(){return this[$t.rawDataSymbol].is_broadcast}get expirationDate(){return(0,sA.mapNullable)(this[$t.rawDataSymbol].expiration,e=>new Date(e))}};On.HelixExtensionBitsProduct=Zh;On.HelixExtensionBitsProduct=Zh=aA.__decorate([(0,$t.rtfm)("api","HelixExtensionBitsProduct","sku")],Zh)});var Yh=u(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.HelixExtensionTransaction=void 0;var db=(b(),x(g)),oA=C(),pe=m(),Il=class extends pe.DataObject{static{n(this,"HelixExtensionTransaction")}constructor(e,t){super(e),this._client=t}get id(){return this[pe.rawDataSymbol].id}get transactionDate(){return new Date(this[pe.rawDataSymbol].timestamp)}get broadcasterId(){return this[pe.rawDataSymbol].broadcaster_id}get broadcasterName(){return this[pe.rawDataSymbol].broadcaster_name}get broadcasterDisplayName(){return this[pe.rawDataSymbol].broadcaster_name}async getBroadcaster(){return(0,pe.checkRelationAssertion)(await this._client.users.getUserById(this[pe.rawDataSymbol].broadcaster_id))}get userId(){return this[pe.rawDataSymbol].user_id}get userName(){return this[pe.rawDataSymbol].user_login}get userDisplayName(){return this[pe.rawDataSymbol].user_name}async getUser(){return(0,pe.checkRelationAssertion)(await this._client.users.getUserById(this[pe.rawDataSymbol].user_id))}get productType(){return this[pe.rawDataSymbol].product_type}get productSku(){return this[pe.rawDataSymbol].product_data.sku}get productCost(){return this[pe.rawDataSymbol].product_data.cost.amount}get productDisplayName(){return this[pe.rawDataSymbol].product_data.displayName}get productInDevelopment(){return this[pe.rawDataSymbol].product_data.inDevelopment}};jn.HelixExtensionTransaction=Il;db.__decorate([(0,oA.Enumerable)(!1)],Il.prototype,"_client",void 0);jn.HelixExtensionTransaction=Il=db.__decorate([(0,pe.rtfm)("api","HelixExtensionTransaction","id")],Il)});var rp=u(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.HelixExtensionsApi=void 0;var lA=(b(),x(g)),gb=m(),Tl=ub(),ep=Oe(),hb=oe(),pb=he(),_b=le(),uA=G(),mb=Jh(),yb=Xh(),fb=Yh(),tp=class extends uA.BaseApi{static{n(this,"HelixExtensionsApi")}async getReleasedExtension(e,t){let r=await this._client.callApi({type:"helix",url:"extensions/released",query:(0,Tl.createReleasedExtensionFilter)(e,t)});return new gb.HelixExtension(r.data[0])}async getLiveChannelsWithExtension(e,t){let r=await this._client.callApi({type:"helix",url:"extensions/live",query:{...(0,ep.createSingleKeyQuery)("extension_id",e),...(0,_b.createPaginationQuery)(t)}});return(0,pb.createPaginatedResult)(r,mb.HelixChannelReference,this._client)}getLiveChannelsWithExtensionPaginated(e){return new hb.HelixPaginatedRequest({url:"extensions/live",query:(0,ep.createSingleKeyQuery)("extension_id",e)},this._client,t=>new mb.HelixChannelReference(t,this._client))}async getExtensionBitsProducts(e){return(await this._client.callApi({type:"helix",url:"bits/extensions",forceType:"app",query:(0,ep.createSingleKeyQuery)("should_include_all",e?.toString())})).data.map(r=>new yb.HelixExtensionBitsProduct(r))}async putExtensionBitsProduct(e){let t=await this._client.callApi({type:"helix",url:"bits/extensions",method:"PUT",forceType:"app",jsonBody:(0,Tl.createExtensionProductBody)(e)});return new yb.HelixExtensionBitsProduct(t.data[0])}async getExtensionTransactions(e,t={}){let r=await this._client.callApi({type:"helix",url:"extensions/transactions",forceType:"app",query:{...(0,Tl.createExtensionTransactionQuery)(e,t),...(0,_b.createPaginationQuery)(t)}});return(0,pb.createPaginatedResult)(r,fb.HelixExtensionTransaction,this._client)}getExtensionTransactionsPaginated(e,t={}){return new hb.HelixPaginatedRequest({url:"extensions/transactions",forceType:"app",query:(0,Tl.createExtensionTransactionQuery)(e,t)},this._client,r=>new fb.HelixExtensionTransaction(r,this._client))}};kn.HelixExtensionsApi=tp;kn.HelixExtensionsApi=tp=lA.__decorate([(0,gb.rtfm)("api","HelixExtensionsApi")],tp)});var Ul=u(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Mn.HelixGame=void 0;var bb=(b(),x(g)),cA=C(),Ct=m(),Rl=class extends Ct.DataObject{static{n(this,"HelixGame")}constructor(e,t){super(e),this._client=t}get id(){return this[Ct.rawDataSymbol].id}get name(){return this[Ct.rawDataSymbol].name}get boxArtUrl(){return this[Ct.rawDataSymbol].box_art_url}get igdbId(){return this[Ct.rawDataSymbol].igdb_id||null}getBoxArtUrl(e,t){return this[Ct.rawDataSymbol].box_art_url.replace("{width}",e.toString()).replace("{height}",t.toString())}async getStreams(e){return await this._client.streams.getStreams({...e,game:this[Ct.rawDataSymbol].id})}getStreamsPaginated(){return this._client.streams.getStreamsPaginated({game:this[Ct.rawDataSymbol].id})}};Mn.HelixGame=Rl;bb.__decorate([(0,cA.Enumerable)(!1)],Rl.prototype,"_client",void 0);Mn.HelixGame=Rl=bb.__decorate([(0,Ct.rtfm)("api","HelixGame","id")],Rl)});var ap=u(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.HelixGameApi=void 0;var Bl=(b(),x(g)),np=C(),dA=m(),ip=Lt(),hA=oe(),pA=he(),_A=le(),mA=G(),Jr=Ul(),Zr=class extends mA.BaseApi{static{n(this,"HelixGameApi")}constructor(){super(...arguments),this._getGameByIdBatcher=new ip.HelixRequestBatcher({url:"games"},"id","id",this._client,e=>new Jr.HelixGame(e,this._client)),this._getGameByNameBatcher=new ip.HelixRequestBatcher({url:"games"},"name","name",this._client,e=>new Jr.HelixGame(e,this._client)),this._getGameByIgdbIdBatcher=new ip.HelixRequestBatcher({url:"games"},"igdb_id","igdb_id",this._client,e=>new Jr.HelixGame(e,this._client))}async getGamesByIds(e){return await this._getGames("id",e)}async getGamesByNames(e){return await this._getGames("name",e)}async getGamesByIgdbIds(e){return await this._getGames("igdb_id",e)}async getGameById(e){var t;return(t=(await this._getGames("id",[e]))[0])!==null&&t!==void 0?t:null}async getGameByName(e){var t;return(t=(await this._getGames("name",[e]))[0])!==null&&t!==void 0?t:null}async getGameByIgdbId(e){var t;return(t=(await this._getGames("igdb_id",[e]))[0])!==null&&t!==void 0?t:null}async getGameByIdBatched(e){return await this._getGameByIdBatcher.request(e)}async getGameByNameBatched(e){return await this._getGameByNameBatcher.request(e)}async getGameByIgdbIdBatched(e){return await this._getGameByIgdbIdBatcher.request(e)}async getTopGames(e){let t=await this._client.callApi({type:"helix",url:"games/top",query:(0,_A.createPaginationQuery)(e)});return(0,pA.createPaginatedResult)(t,Jr.HelixGame,this._client)}getTopGamesPaginated(){return new hA.HelixPaginatedRequest({url:"games/top"},this._client,e=>new Jr.HelixGame(e,this._client))}async _getGames(e,t){return t.length?(await this._client.callApi({type:"helix",url:"games",query:{[e]:t}})).data.map(a=>new Jr.HelixGame(a,this._client)):[]}};Ln.HelixGameApi=Zr;Bl.__decorate([(0,np.Enumerable)(!1)],Zr.prototype,"_getGameByIdBatcher",void 0);Bl.__decorate([(0,np.Enumerable)(!1)],Zr.prototype,"_getGameByNameBatcher",void 0);Bl.__decorate([(0,np.Enumerable)(!1)],Zr.prototype,"_getGameByIgdbIdBatcher",void 0);Ln.HelixGameApi=Zr=Bl.__decorate([(0,dA.rtfm)("api","HelixGameApi")],Zr)});var sp=u(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.HelixGoal=void 0;var xb=(b(),x(g)),yA=C(),ke=m(),Ol=class extends ke.DataObject{static{n(this,"HelixGoal")}constructor(e,t){super(e),this._client=t}get id(){return this[ke.rawDataSymbol].id}get broadcasterId(){return this[ke.rawDataSymbol].broadcaster_id}get broadcasterDisplayName(){return this[ke.rawDataSymbol].broadcaster_name}get broadcasterName(){return this[ke.rawDataSymbol].broadcaster_login}async getBroadcaster(){return(0,ke.checkRelationAssertion)(await this._client.users.getUserById(this[ke.rawDataSymbol].broadcaster_id))}get type(){return this[ke.rawDataSymbol].type}get description(){return this[ke.rawDataSymbol].description}get currentAmount(){return this[ke.rawDataSymbol].current_amount}get targetAmount(){return this[ke.rawDataSymbol].target_amount}get creationDate(){return this[ke.rawDataSymbol].created_at}};Fn.HelixGoal=Ol;xb.__decorate([(0,yA.Enumerable)(!1)],Ol.prototype,"_client",void 0);Fn.HelixGoal=Ol=xb.__decorate([(0,ke.rtfm)("api","HelixGoal","id")],Ol)});var lp=u(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.HelixGoalApi=void 0;var fA=(b(),x(g)),gA=Y(),wb=m(),bA=G(),xA=sp(),op=class extends bA.BaseApi{static{n(this,"HelixGoalApi")}async getGoals(e){return(await this._client.callApi({type:"helix",url:"goals",userId:(0,wb.extractUserId)(e),scopes:["channel:read:goals"],query:(0,gA.createBroadcasterQuery)(e)})).data.map(r=>new xA.HelixGoal(r,this._client))}};Nn.HelixGoalApi=op;Nn.HelixGoalApi=op=fA.__decorate([(0,wb.rtfm)("api","HelixGoalApi")],op)});var up=u(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.HelixHypeTrainContribution=void 0;var vb=(b(),x(g)),wA=C(),mr=m(),jl=class extends mr.DataObject{static{n(this,"HelixHypeTrainContribution")}constructor(e,t){super(e),this._client=t}get userId(){return this[mr.rawDataSymbol].user}async getUser(){return(0,mr.checkRelationAssertion)(await this._client.users.getUserById(this[mr.rawDataSymbol].user))}get type(){return this[mr.rawDataSymbol].type}get total(){return this[mr.rawDataSymbol].total}};Qn.HelixHypeTrainContribution=jl;vb.__decorate([(0,wA.Enumerable)(!1)],jl.prototype,"_client",void 0);Qn.HelixHypeTrainContribution=jl=vb.__decorate([(0,mr.rtfm)("api","HelixHypeTrainContribution","userId")],jl)});var cp=u(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.HelixHypeTrainEvent=void 0;var Hb=(b(),x(g)),vA=C(),ye=m(),Sb=up(),kl=class extends ye.DataObject{static{n(this,"HelixHypeTrainEvent")}constructor(e,t){super(e),this._client=t}get eventId(){return this[ye.rawDataSymbol].id}get eventType(){return this[ye.rawDataSymbol].event_type}get eventDate(){return new Date(this[ye.rawDataSymbol].event_timestamp)}get eventVersion(){return this[ye.rawDataSymbol].version}get id(){return this[ye.rawDataSymbol].event_data.id}get broadcasterId(){return this[ye.rawDataSymbol].event_data.broadcaster_id}async getBroadcaster(){return(0,ye.checkRelationAssertion)(await this._client.users.getUserById(this[ye.rawDataSymbol].event_data.broadcaster_id))}get level(){return this[ye.rawDataSymbol].event_data.level}get startDate(){return new Date(this[ye.rawDataSymbol].event_data.started_at)}get expiryDate(){return new Date(this[ye.rawDataSymbol].event_data.expires_at)}get cooldownDate(){return new Date(this[ye.rawDataSymbol].event_data.cooldown_end_time)}get total(){return this[ye.rawDataSymbol].event_data.total}get goal(){return this[ye.rawDataSymbol].event_data.goal}get lastContribution(){return new Sb.HelixHypeTrainContribution(this[ye.rawDataSymbol].event_data.last_contribution,this._client)}get topContributions(){return this[ye.rawDataSymbol].event_data.top_contributions.map(e=>new Sb.HelixHypeTrainContribution(e,this._client))}};Gn.HelixHypeTrainEvent=kl;Hb.__decorate([(0,vA.Enumerable)(!1)],kl.prototype,"_client",void 0);Gn.HelixHypeTrainEvent=kl=Hb.__decorate([(0,ye.rtfm)("api","HelixHypeTrainEvent","id")],kl)});var hp=u(Ml=>{"use strict";Object.defineProperty(Ml,"__esModule",{value:!0});Ml.HelixHypeTrainApi=void 0;var Cb=Y(),qb=m(),SA=oe(),HA=he(),CA=le(),qA=G(),Eb=cp(),dp=class extends qA.BaseApi{static{n(this,"HelixHypeTrainApi")}async getHypeTrainEventsForBroadcaster(e,t){let r=await this._client.callApi({type:"helix",url:"hypetrain/events",userId:(0,qb.extractUserId)(e),scopes:["channel:read:hype_train"],query:{...(0,Cb.createBroadcasterQuery)(e),...(0,CA.createPaginationQuery)(t)}});return(0,HA.createPaginatedResult)(r,Eb.HelixHypeTrainEvent,this._client)}getHypeTrainEventsForBroadcasterPaginated(e){return new SA.HelixPaginatedRequest({url:"hypetrain/events",userId:(0,qb.extractUserId)(e),scopes:["channel:read:hype_train"],query:(0,Cb.createBroadcasterQuery)(e)},this._client,t=>new Eb.HelixHypeTrainEvent(t,this._client))}};Ml.HelixHypeTrainApi=dp});var Pb=u(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.createWarnUserBody=ce.createCheckAutoModStatusBody=ce.createUpdateShieldModeStatusBody=ce.createBanUserBody=ce.createAutoModSettingsBody=ce.createAutoModProcessBody=ce.createResolveUnbanRequestQuery=ce.createModeratorModifyQuery=ce.createModerationUserListQuery=void 0;var zt=m();function EA(i,e){return{broadcaster_id:(0,zt.extractUserId)(i),user_id:e?.userId}}n(EA,"createModerationUserListQuery");ce.createModerationUserListQuery=EA;function PA(i,e){return{broadcaster_id:(0,zt.extractUserId)(i),user_id:(0,zt.extractUserId)(e)}}n(PA,"createModeratorModifyQuery");ce.createModeratorModifyQuery=PA;function AA(i,e,t,r,a){return{unban_request_id:t,broadcaster_id:(0,zt.extractUserId)(i),moderator_id:(0,zt.extractUserId)(e),status:r?"approved":"denied",resolution_text:a}}n(AA,"createResolveUnbanRequestQuery");ce.createResolveUnbanRequestQuery=AA;function DA(i,e,t){return{user_id:(0,zt.extractUserId)(i),msg_id:e,action:t?"ALLOW":"DENY"}}n(DA,"createAutoModProcessBody");ce.createAutoModProcessBody=DA;function IA(i){return{overall_level:i.overallLevel,aggression:i.aggression,bullying:i.bullying,disability:i.disability,misogyny:i.misogyny,race_ethnicity_or_religion:i.raceEthnicityOrReligion,sex_based_terms:i.sexBasedTerms,sexuality_sex_or_gender:i.sexualitySexOrGender,swearing:i.swearing}}n(IA,"createAutoModSettingsBody");ce.createAutoModSettingsBody=IA;function TA(i){return{data:{duration:i.duration,reason:i.reason,user_id:(0,zt.extractUserId)(i.user)}}}n(TA,"createBanUserBody");ce.createBanUserBody=TA;function RA(i){return{is_active:i}}n(RA,"createUpdateShieldModeStatusBody");ce.createUpdateShieldModeStatusBody=RA;function UA(i){return{data:i.map(e=>({msg_id:e.messageId,msg_text:e.messageText}))}}n(UA,"createCheckAutoModStatusBody");ce.createCheckAutoModStatusBody=UA;function BA(i,e){return{data:{user_id:(0,zt.extractUserId)(i),reason:e}}}n(BA,"createWarnUserBody");ce.createWarnUserBody=BA});var Ab=u(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.HelixAutoModSettings=void 0;var OA=(b(),x(g)),Te=m(),pp=class extends Te.DataObject{static{n(this,"HelixAutoModSettings")}get broadcasterId(){return this[Te.rawDataSymbol].broadcaster_id}get moderatorId(){return this[Te.rawDataSymbol].moderator_id}get overallLevel(){return this[Te.rawDataSymbol].overall_level?this[Te.rawDataSymbol].overall_level:null}get disability(){return this[Te.rawDataSymbol].disability}get aggression(){return this[Te.rawDataSymbol].aggression}get sexualitySexOrGender(){return this[Te.rawDataSymbol].sexuality_sex_or_gender}get misogyny(){return this[Te.rawDataSymbol].misogyny}get bullying(){return this[Te.rawDataSymbol].bullying}get swearing(){return this[Te.rawDataSymbol].swearing}get raceEthnicityOrReligion(){return this[Te.rawDataSymbol].race_ethnicity_or_religion}get sexBasedTerms(){return this[Te.rawDataSymbol].sex_based_terms}};Wn.HelixAutoModSettings=pp;Wn.HelixAutoModSettings=pp=OA.__decorate([(0,Te.rtfm)("api","HelixAutoModSettings","broadcasterId")],pp)});var Db=u(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.HelixAutoModStatus=void 0;var jA=(b(),x(g)),Ll=m(),_p=class extends Ll.DataObject{static{n(this,"HelixAutoModStatus")}get messageId(){return this[Ll.rawDataSymbol].msg_id}get isPermitted(){return this[Ll.rawDataSymbol].is_permitted}};Vn.HelixAutoModStatus=_p;Vn.HelixAutoModStatus=_p=jA.__decorate([(0,Ll.rtfm)("api","HelixAutoModStatus","messageId")],_p)});var Fl=u(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.HelixBanUser=void 0;var mp=(b(),x(g)),yp=C(),qt=m(),$n=class extends qt.DataObject{static{n(this,"HelixBanUser")}constructor(e,t,r){super(e),this._expiryTimestamp=t,this._client=r}get creationDate(){return new Date(this[qt.rawDataSymbol].created_at)}get expiryDate(){return(0,yp.mapNullable)(this._expiryTimestamp,e=>new Date(e))}get moderatorId(){return this[qt.rawDataSymbol].moderator_id}async getModerator(){return(0,qt.checkRelationAssertion)(await this._client.users.getUserById(this[qt.rawDataSymbol].moderator_id))}get userId(){return this[qt.rawDataSymbol].user_id}async getUser(){return(0,qt.checkRelationAssertion)(await this._client.users.getUserById(this[qt.rawDataSymbol].user_id))}};zn.HelixBanUser=$n;mp.__decorate([(0,yp.Enumerable)(!1)],$n.prototype,"_client",void 0);mp.__decorate([(0,yp.Enumerable)(!1)],$n.prototype,"_expiryTimestamp",void 0);zn.HelixBanUser=$n=mp.__decorate([(0,qt.rtfm)("api","HelixBanUser","userId")],$n)});var gp=u(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.HelixBan=void 0;var kA=(b(),x(g)),Xr=m(),MA=Fl(),fp=class extends MA.HelixBanUser{static{n(this,"HelixBan")}constructor(e,t){super(e,e.expires_at||null,t)}get userName(){return this[Xr.rawDataSymbol].user_login}get userDisplayName(){return this[Xr.rawDataSymbol].user_name}get moderatorName(){return this[Xr.rawDataSymbol].moderator_login}get moderatorDisplayName(){return this[Xr.rawDataSymbol].moderator_name}get reason(){return this[Xr.rawDataSymbol].reason||null}};Kn.HelixBan=fp;Kn.HelixBan=fp=kA.__decorate([(0,Xr.rtfm)("api","HelixBan","userId")],fp)});var xp=u(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.HelixBlockedTerm=void 0;var LA=(b(),x(g)),pt=m(),bp=class extends pt.DataObject{static{n(this,"HelixBlockedTerm")}get broadcasterId(){return this[pt.rawDataSymbol].broadcaster_id}get creationDate(){return new Date(this[pt.rawDataSymbol].created_at)}get expirationDate(){return this[pt.rawDataSymbol].expires_at?new Date(this[pt.rawDataSymbol].expires_at):null}get id(){return this[pt.rawDataSymbol].id}get moderatorId(){return this[pt.rawDataSymbol].moderator_id}get text(){return this[pt.rawDataSymbol].text}get updatedDate(){return new Date(this[pt.rawDataSymbol].updated_at)}};Jn.HelixBlockedTerm=bp;Jn.HelixBlockedTerm=bp=LA.__decorate([(0,pt.rtfm)("api","HelixBlockedTerm","id")],bp)});var wp=u(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.HelixModeratedChannel=void 0;var Ib=(b(),x(g)),FA=C(),Et=m(),Nl=class extends Et.DataObject{static{n(this,"HelixModeratedChannel")}constructor(e,t){super(e),this._client=t}get id(){return this[Et.rawDataSymbol].broadcaster_id}get name(){return this[Et.rawDataSymbol].broadcaster_login}get displayName(){return this[Et.rawDataSymbol].broadcaster_name}async getChannel(){return(0,Et.checkRelationAssertion)(await this._client.channels.getChannelInfoById(this[Et.rawDataSymbol].broadcaster_id))}async getBroadcaster(){return(0,Et.checkRelationAssertion)(await this._client.users.getUserById(this[Et.rawDataSymbol].broadcaster_id))}};Zn.HelixModeratedChannel=Nl;Ib.__decorate([(0,FA.Enumerable)(!1)],Nl.prototype,"_client",void 0);Zn.HelixModeratedChannel=Nl=Ib.__decorate([(0,Et.rtfm)("api","HelixModeratedChannel","id")],Nl)});var vp=u(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.HelixModerator=void 0;var Tb=(b(),x(g)),NA=C(),yr=m(),Ql=class extends yr.DataObject{static{n(this,"HelixModerator")}constructor(e,t){super(e),this._client=t}get userId(){return this[yr.rawDataSymbol].user_id}get userName(){return this[yr.rawDataSymbol].user_login}get userDisplayName(){return this[yr.rawDataSymbol].user_name}async getUser(){return(0,yr.checkRelationAssertion)(await this._client.users.getUserById(this[yr.rawDataSymbol].user_id))}};Xn.HelixModerator=Ql;Tb.__decorate([(0,NA.Enumerable)(!1)],Ql.prototype,"_client",void 0);Xn.HelixModerator=Ql=Tb.__decorate([(0,yr.rtfm)("api","HelixModerator","userId")],Ql)});var Sp=u(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.HelixShieldModeStatus=void 0;var Rb=(b(),x(g)),QA=C(),_t=m(),Gl=class extends _t.DataObject{static{n(this,"HelixShieldModeStatus")}constructor(e,t){super(e),this._client=t}get isActive(){return this[_t.rawDataSymbol].is_active}get moderatorId(){return this[_t.rawDataSymbol].moderator_id}get moderatorName(){return this[_t.rawDataSymbol].moderator_login}get moderatorDisplayName(){return this[_t.rawDataSymbol].moderator_name}async getModerator(){return(0,_t.checkRelationAssertion)(await this._client.users.getUserById(this[_t.rawDataSymbol].moderator_id))}get lastActivationDate(){return this[_t.rawDataSymbol].last_activated_at===""?null:new Date(this[_t.rawDataSymbol].last_activated_at)}};Yn.HelixShieldModeStatus=Gl;Rb.__decorate([(0,QA.Enumerable)(!1)],Gl.prototype,"_client",void 0);Yn.HelixShieldModeStatus=Gl=Rb.__decorate([(0,_t.rtfm)("api","HelixShieldModeStatus")],Gl)});var Hp=u(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});ea.HelixUnbanRequest=void 0;var Ub=(b(),x(g)),Bb=C(),te=m(),Wl=class extends te.DataObject{static{n(this,"HelixUnbanRequest")}constructor(e,t){super(e),this._client=t}get id(){return this[te.rawDataSymbol].id}get broadcasterId(){return this[te.rawDataSymbol].broadcaster_id}get broadcasterName(){return this[te.rawDataSymbol].broadcaster_id}get broadcasterDisplayName(){return this[te.rawDataSymbol].broadcaster_id}async getBroadcaster(){return(0,te.checkRelationAssertion)(await this._client.users.getUserById(this[te.rawDataSymbol].broadcaster_id))}get moderatorId(){return this[te.rawDataSymbol].moderator_id}get moderatorName(){return this[te.rawDataSymbol].moderator_login}get moderatorDisplayName(){return this[te.rawDataSymbol].moderator_name}async getModerator(){return(0,te.checkRelationAssertion)(await this._client.users.getUserById(this[te.rawDataSymbol].moderator_id))}get userId(){return this[te.rawDataSymbol].user_id}get userName(){return this[te.rawDataSymbol].user_login}get userDisplayName(){return this[te.rawDataSymbol].user_name}async getUser(){return(0,te.checkRelationAssertion)(await this._client.users.getUserById(this[te.rawDataSymbol].user_id))}get message(){return this[te.rawDataSymbol].text}get creationDate(){return new Date(this[te.rawDataSymbol].created_at)}get resolutionMessage(){return this[te.rawDataSymbol].resolution_text||null}get resolutionDate(){return(0,Bb.mapNullable)(this[te.rawDataSymbol].resolved_at,e=>new Date(e))}};ea.HelixUnbanRequest=Wl;Ub.__decorate([(0,Bb.Enumerable)(!1)],Wl.prototype,"_client",void 0);ea.HelixUnbanRequest=Wl=Ub.__decorate([(0,te.rtfm)("api","HelixUnbanRequest","id")],Wl)});var Cp=u(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.HelixWarning=void 0;var Ob=(b(),x(g)),GA=C(),ze=m(),Vl=class extends ze.DataObject{static{n(this,"HelixWarning")}constructor(e,t){super(e),this._client=t}get broadcasterId(){return this[ze.rawDataSymbol].user_id}async getBroadcaster(){return(0,ze.checkRelationAssertion)(await this._client.users.getUserById(this[ze.rawDataSymbol].broadcaster_id))}get moderatorId(){return this[ze.rawDataSymbol].moderator_id}async getModerator(){return(0,ze.checkRelationAssertion)(await this._client.users.getUserById(this[ze.rawDataSymbol].moderator_id))}get userId(){return this[ze.rawDataSymbol].user_id}async getUser(){return(0,ze.checkRelationAssertion)(await this._client.users.getUserById(this[ze.rawDataSymbol].user_id))}get reason(){return this[ze.rawDataSymbol].reason}};ta.HelixWarning=Vl;Ob.__decorate([(0,GA.Enumerable)(!1)],Vl.prototype,"_client",void 0);ta.HelixWarning=Vl=Ob.__decorate([(0,ze.rtfm)("api","HelixWarning","userId")],Vl)});var Ap=u(na=>{"use strict";Object.defineProperty(na,"__esModule",{value:!0});na.HelixModerationApi=void 0;var WA=(b(),x(g)),qp=Y(),F=m(),fr=Oe(),tt=Pb(),$l=oe(),ra=he(),ia=le(),VA=G(),jb=Ab(),$A=Db(),kb=gp(),zA=Fl(),Mb=xp(),Lb=wp(),Fb=vp(),Nb=Sp(),Ep=Hp(),KA=Cp(),Pp=class extends VA.BaseApi{static{n(this,"HelixModerationApi")}async getBannedUsers(e,t){let r=await this._client.callApi({type:"helix",url:"moderation/banned",userId:(0,F.extractUserId)(e),scopes:["moderation:read"],query:{...(0,tt.createModerationUserListQuery)(e,t),...(0,ia.createPaginationQuery)(t)}});return(0,ra.createPaginatedResult)(r,kb.HelixBan,this._client)}getBannedUsersPaginated(e){return new $l.HelixPaginatedRequest({url:"moderation/banned",userId:(0,F.extractUserId)(e),scopes:["moderation:read"],query:(0,qp.createBroadcasterQuery)(e)},this._client,t=>new kb.HelixBan(t,this._client),50)}async checkUserBan(e,t){let r=(0,F.extractUserId)(t);return(await this.getBannedUsers(e,{userId:r})).data.some(s=>s.userId===r)}async getModerators(e,t){let r=await this._client.callApi({type:"helix",url:"moderation/moderators",userId:(0,F.extractUserId)(e),scopes:["moderation:read","channel:manage:moderators"],query:{...(0,tt.createModerationUserListQuery)(e,t),...(0,ia.createPaginationQuery)(t)}});return(0,ra.createPaginatedResult)(r,Fb.HelixModerator,this._client)}getModeratorsPaginated(e){return new $l.HelixPaginatedRequest({url:"moderation/moderators",userId:(0,F.extractUserId)(e),scopes:["moderation:read","channel:manage:moderators"],query:(0,qp.createBroadcasterQuery)(e)},this._client,t=>new Fb.HelixModerator(t,this._client))}async getModeratedChannels(e,t){let r=(0,F.extractUserId)(e),a=await this._client.callApi({type:"helix",url:"moderation/channels",userId:r,scopes:["user:read:moderated_channels"],query:{...(0,fr.createSingleKeyQuery)("user_id",r),...(0,ia.createPaginationQuery)(t)}});return(0,ra.createPaginatedResult)(a,Lb.HelixModeratedChannel,this._client)}getModeratedChannelsPaginated(e){let t=(0,F.extractUserId)(e);return new $l.HelixPaginatedRequest({url:"moderation/channels",userId:t,scopes:["user:read:moderated_channels"],query:(0,fr.createSingleKeyQuery)("user_id",t)},this._client,r=>new Lb.HelixModeratedChannel(r,this._client))}async checkUserMod(e,t){let r=(0,F.extractUserId)(t);return(await this.getModerators(e,{userId:r})).data.some(s=>s.userId===r)}async addModerator(e,t){await this._client.callApi({type:"helix",url:"moderation/moderators",method:"POST",userId:(0,F.extractUserId)(e),scopes:["channel:manage:moderators"],query:(0,tt.createModeratorModifyQuery)(e,t)})}async removeModerator(e,t){await this._client.callApi({type:"helix",url:"moderation/moderators",method:"DELETE",userId:(0,F.extractUserId)(e),scopes:["channel:manage:moderators"],query:(0,tt.createModeratorModifyQuery)(e,t)})}async checkAutoModStatus(e,t){return(await this._client.callApi({type:"helix",url:"moderation/enforcements/status",method:"POST",userId:(0,F.extractUserId)(e),scopes:["moderation:read"],query:(0,qp.createBroadcasterQuery)(e),jsonBody:(0,tt.createCheckAutoModStatusBody)(t)})).data.map(a=>new $A.HelixAutoModStatus(a))}async processHeldAutoModMessage(e,t,r){await this._client.callApi({type:"helix",url:"moderation/automod/message",method:"POST",userId:(0,F.extractUserId)(e),scopes:["moderator:manage:automod"],jsonBody:(0,tt.createAutoModProcessBody)(e,t,r)})}async getAutoModSettings(e){let t=(0,F.extractUserId)(e);return(await this._client.callApi({type:"helix",url:"moderation/automod/settings",userId:t,scopes:["moderator:read:automod_settings"],canOverrideScopedUserContext:!0,query:this._createModeratorActionQuery(t)})).data.map(a=>new jb.HelixAutoModSettings(a))}async updateAutoModSettings(e,t){let r=(0,F.extractUserId)(e);return(await this._client.callApi({type:"helix",url:"moderation/automod/settings",method:"PUT",userId:r,scopes:["moderator:manage:automod_settings"],canOverrideScopedUserContext:!0,query:this._createModeratorActionQuery(r),jsonBody:(0,tt.createAutoModSettingsBody)(t)})).data.map(s=>new jb.HelixAutoModSettings(s))}async banUser(e,t){let r=(0,F.extractUserId)(e);return(await this._client.callApi({type:"helix",url:"moderation/bans",method:"POST",userId:r,scopes:["moderator:manage:banned_users"],canOverrideScopedUserContext:!0,query:this._createModeratorActionQuery(r),jsonBody:(0,tt.createBanUserBody)(t)})).data.map(s=>new zA.HelixBanUser(s,s.end_time,this._client))}async unbanUser(e,t){let r=(0,F.extractUserId)(e);await this._client.callApi({type:"helix",url:"moderation/bans",method:"DELETE",userId:r,scopes:["moderator:manage:banned_users"],canOverrideScopedUserContext:!0,query:{...this._createModeratorActionQuery(r),...(0,fr.createSingleKeyQuery)("user_id",(0,F.extractUserId)(t))}})}async getBlockedTerms(e,t){let r=(0,F.extractUserId)(e),a=await this._client.callApi({type:"helix",url:"moderation/blocked_terms",userId:r,scopes:["moderator:read:blocked_terms"],canOverrideScopedUserContext:!0,query:{...this._createModeratorActionQuery(r),...(0,ia.createPaginationQuery)(t)}});return(0,ra.createPaginatedResult)(a,Mb.HelixBlockedTerm,this._client)}async addBlockedTerm(e,t){let r=(0,F.extractUserId)(e);return(await this._client.callApi({type:"helix",url:"moderation/blocked_terms",method:"POST",userId:r,scopes:["moderator:manage:blocked_terms"],canOverrideScopedUserContext:!0,query:this._createModeratorActionQuery(r),jsonBody:{text:t}})).data.map(s=>new Mb.HelixBlockedTerm(s))}async removeBlockedTerm(e,t,r){let a=(0,F.extractUserId)(e);await this._client.callApi({type:"helix",url:"moderation/blocked_terms",method:"DELETE",userId:a,scopes:["moderator:manage:blocked_terms"],canOverrideScopedUserContext:!0,query:{...this._createModeratorActionQuery(a),id:r}})}async deleteChatMessages(e,t){let r=(0,F.extractUserId)(e);await this._client.callApi({type:"helix",url:"moderation/chat",method:"DELETE",userId:r,scopes:["moderator:manage:chat_messages"],canOverrideScopedUserContext:!0,query:{...this._createModeratorActionQuery(r),...(0,fr.createSingleKeyQuery)("message_id",t)}})}async getShieldModeStatus(e){let t=(0,F.extractUserId)(e),r=await this._client.callApi({type:"helix",url:"moderation/shield_mode",method:"GET",userId:t,scopes:["moderator:read:shield_mode","moderator:manage:shield_mode"],canOverrideScopedUserContext:!0,query:this._createModeratorActionQuery(t)});return new Nb.HelixShieldModeStatus(r.data[0],this._client)}async updateShieldModeStatus(e,t){let r=(0,F.extractUserId)(e),a=await this._client.callApi({type:"helix",url:"moderation/shield_mode",method:"PUT",userId:r,scopes:["moderator:manage:shield_mode"],canOverrideScopedUserContext:!0,query:this._createModeratorActionQuery(r),jsonBody:(0,tt.createUpdateShieldModeStatusBody)(t)});return new Nb.HelixShieldModeStatus(a.data[0],this._client)}async getUnbanRequests(e,t,r){let a=(0,F.extractUserId)(e),s=await this._client.callApi({type:"helix",url:"moderation/unban_requests",method:"GET",userId:a,scopes:["moderator:read:unban_requests","moderator:manage:unban_requests"],canOverrideScopedUserContext:!0,query:{...this._createModeratorActionQuery(a),...(0,fr.createSingleKeyQuery)("status",t),...(0,ia.createPaginationQuery)(r)}});return(0,ra.createPaginatedResult)(s,Ep.HelixUnbanRequest,this._client)}getUnbanRequestsPaginated(e,t){let r=(0,F.extractUserId)(e);return new $l.HelixPaginatedRequest({url:"moderation/unban_requests",method:"GET",userId:r,scopes:["moderator:read:unban_requests","moderator:manage:unban_requests"],canOverrideScopedUserContext:!0,query:{...this._createModeratorActionQuery(r),...(0,fr.createSingleKeyQuery)("status",t)}},this._client,a=>new Ep.HelixUnbanRequest(a,this._client))}async resolveUnbanRequest(e,t,r,a){let s=(0,F.extractUserId)(e),o=await this._client.callApi({type:"helix",url:"moderation/unban_requests",method:"PATCH",userId:s,scopes:["moderator:manage:unban_requests"],canOverrideScopedUserContext:!0,query:(0,tt.createResolveUnbanRequestQuery)(s,this._getUserContextIdWithDefault(s),t,r,a?.slice(0,500))});return new Ep.HelixUnbanRequest(o.data[0],this._client)}async warnUser(e,t,r){let a=(0,F.extractUserId)(e),s=await this._client.callApi({type:"helix",url:"moderation/warnings",method:"POST",userId:a,scopes:["moderator:manage:warnings"],canOverrideScopedUserContext:!0,query:this._createModeratorActionQuery(a),jsonBody:(0,tt.createWarnUserBody)(t,r.slice(0,500))});return new KA.HelixWarning(s.data[0],this._client)}_createModeratorActionQuery(e){return(0,fr.createModeratorActionQuery)(e,this._getUserContextIdWithDefault(e))}};na.HelixModerationApi=Pp;na.HelixModerationApi=Pp=WA.__decorate([(0,F.rtfm)("api","HelixModerationApi")],Pp)});var Gb=u(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.createPollEndBody=Yr.createPollBody=void 0;var Qb=m();function JA(i,e){var t;return{broadcaster_id:(0,Qb.extractUserId)(i),title:e.title,choices:e.choices.map(r=>({title:r})),duration:e.duration,channel_points_voting_enabled:e.channelPointsPerVote!=null,channel_points_per_vote:(t=e.channelPointsPerVote)!==null&&t!==void 0?t:0}}n(JA,"createPollBody");Yr.createPollBody=JA;function ZA(i,e,t){return{broadcaster_id:(0,Qb.extractUserId)(i),id:e,status:t?"TERMINATED":"ARCHIVED"}}n(ZA,"createPollEndBody");Yr.createPollEndBody=ZA});var Ip=u(aa=>{"use strict";Object.defineProperty(aa,"__esModule",{value:!0});aa.HelixPollChoice=void 0;var XA=(b(),x(g)),ei=m(),Dp=class extends ei.DataObject{static{n(this,"HelixPollChoice")}get id(){return this[ei.rawDataSymbol].id}get title(){return this[ei.rawDataSymbol].title}get totalVotes(){return this[ei.rawDataSymbol].votes}get channelPointsVotes(){return this[ei.rawDataSymbol].channel_points_votes}};aa.HelixPollChoice=Dp;aa.HelixPollChoice=Dp=XA.__decorate([(0,ei.rtfm)("api","HelixPollChoice","id")],Dp)});var Tp=u(sa=>{"use strict";Object.defineProperty(sa,"__esModule",{value:!0});sa.HelixPoll=void 0;var Wb=(b(),x(g)),YA=C(),Se=m(),eD=Ip(),zl=class extends Se.DataObject{static{n(this,"HelixPoll")}constructor(e,t){super(e),this._client=t}get id(){return this[Se.rawDataSymbol].id}get broadcasterId(){return this[Se.rawDataSymbol].broadcaster_id}get broadcasterName(){return this[Se.rawDataSymbol].broadcaster_login}get broadcasterDisplayName(){return this[Se.rawDataSymbol].broadcaster_name}async getBroadcaster(){return(0,Se.checkRelationAssertion)(await this._client.users.getUserById(this[Se.rawDataSymbol].broadcaster_id))}get title(){return this[Se.rawDataSymbol].title}get isChannelPointsVotingEnabled(){return this[Se.rawDataSymbol].channel_points_voting_enabled}get channelPointsPerVote(){return this[Se.rawDataSymbol].channel_points_per_vote}get status(){return this[Se.rawDataSymbol].status}get durationInSeconds(){return this[Se.rawDataSymbol].duration}get startDate(){return new Date(this[Se.rawDataSymbol].started_at)}get endDate(){return new Date(this.startDate.getTime()+this[Se.rawDataSymbol].duration*1e3)}get choices(){return this[Se.rawDataSymbol].choices.map(e=>new eD.HelixPollChoice(e))}};sa.HelixPoll=zl;Wb.__decorate([(0,YA.Enumerable)(!1)],zl.prototype,"_client",void 0);sa.HelixPoll=zl=Wb.__decorate([(0,Se.rtfm)("api","HelixPoll","id")],zl)});var Up=u(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});la.HelixPollApi=void 0;var tD=(b(),x(g)),Vb=Y(),ti=m(),rD=Oe(),$b=Gb(),iD=oe(),nD=he(),aD=le(),sD=G(),oa=Tp(),Rp=class extends sD.BaseApi{static{n(this,"HelixPollApi")}async getPolls(e,t){let r=await this._client.callApi({type:"helix",url:"polls",userId:(0,ti.extractUserId)(e),scopes:["channel:read:polls","channel:manage:polls"],query:{...(0,Vb.createBroadcasterQuery)(e),...(0,aD.createPaginationQuery)(t)}});return(0,nD.createPaginatedResult)(r,oa.HelixPoll,this._client)}getPollsPaginated(e){return new iD.HelixPaginatedRequest({url:"polls",userId:(0,ti.extractUserId)(e),scopes:["channel:read:polls","channel:manage:polls"],query:(0,Vb.createBroadcasterQuery)(e)},this._client,t=>new oa.HelixPoll(t,this._client),20)}async getPollsByIds(e,t){return t.length?(await this._client.callApi({type:"helix",url:"polls",userId:(0,ti.extractUserId)(e),scopes:["channel:read:polls","channel:manage:polls"],query:(0,rD.createGetByIdsQuery)(e,t)})).data.map(a=>new oa.HelixPoll(a,this._client)):[]}async getPollById(e,t){let r=await this.getPollsByIds(e,[t]);return r.length?r[0]:null}async createPoll(e,t){let r=await this._client.callApi({type:"helix",url:"polls",method:"POST",userId:(0,ti.extractUserId)(e),scopes:["channel:manage:polls"],jsonBody:(0,$b.createPollBody)(e,t)});return new oa.HelixPoll(r.data[0],this._client)}async endPoll(e,t,r=!0){let a=await this._client.callApi({type:"helix",url:"polls",method:"PATCH",userId:(0,ti.extractUserId)(e),scopes:["channel:manage:polls"],jsonBody:(0,$b.createPollEndBody)(e,t,r)});return new oa.HelixPoll(a.data[0],this._client)}};la.HelixPollApi=Rp;la.HelixPollApi=Rp=tD.__decorate([(0,ti.rtfm)("api","HelixPollApi")],Rp)});var Kb=u(ri=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});ri.createEndPredictionBody=ri.createPredictionBody=void 0;var zb=m();function oD(i,e){return{broadcaster_id:(0,zb.extractUserId)(i),title:e.title,outcomes:e.outcomes.map(t=>({title:t})),prediction_window:e.autoLockAfter}}n(oD,"createPredictionBody");ri.createPredictionBody=oD;function lD(i,e,t,r){return{broadcaster_id:(0,zb.extractUserId)(i),id:e,status:t,winning_outcome_id:r}}n(lD,"createEndPredictionBody");ri.createEndPredictionBody=lD});var Bp=u(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});ua.HelixPredictor=void 0;var Jb=(b(),x(g)),uD=C(),Kt=m(),Kl=class extends Kt.DataObject{static{n(this,"HelixPredictor")}constructor(e,t){super(e),this._client=t}get userId(){return this[Kt.rawDataSymbol].user_id}get userName(){return this[Kt.rawDataSymbol].user_login}get userDisplayName(){return this[Kt.rawDataSymbol].user_name}async getUser(){return await this._client.users.getUserById(this[Kt.rawDataSymbol].user_id)}get channelPointsUsed(){return this[Kt.rawDataSymbol].channel_points_used}get channelPointsWon(){return this[Kt.rawDataSymbol].channel_points_won}};ua.HelixPredictor=Kl;Jb.__decorate([(0,uD.Enumerable)(!1)],Kl.prototype,"_client",void 0);ua.HelixPredictor=Kl=Jb.__decorate([(0,Kt.rtfm)("api","HelixPredictor","userId")],Kl)});var Op=u(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});ca.HelixPredictionOutcome=void 0;var Zb=(b(),x(g)),cD=C(),Jt=m(),dD=Bp(),Jl=class extends Jt.DataObject{static{n(this,"HelixPredictionOutcome")}constructor(e,t){super(e),this._client=t}get id(){return this[Jt.rawDataSymbol].id}get title(){return this[Jt.rawDataSymbol].title}get users(){return this[Jt.rawDataSymbol].users}get totalChannelPoints(){return this[Jt.rawDataSymbol].channel_points}get color(){return this[Jt.rawDataSymbol].color}get topPredictors(){var e,t;return(t=(e=this[Jt.rawDataSymbol].top_predictors)===null||e===void 0?void 0:e.map(r=>new dD.HelixPredictor(r,this._client)))!==null&&t!==void 0?t:[]}};ca.HelixPredictionOutcome=Jl;Zb.__decorate([(0,cD.Enumerable)(!1)],Jl.prototype,"_client",void 0);ca.HelixPredictionOutcome=Jl=Zb.__decorate([(0,Jt.rtfm)("api","HelixPredictionOutcome","id")],Jl)});var jp=u(da=>{"use strict";Object.defineProperty(da,"__esModule",{value:!0});da.HelixPrediction=void 0;var Yb=(b(),x(g)),hD=C(),re=m(),Xb=Op(),Zl=class extends re.DataObject{static{n(this,"HelixPrediction")}constructor(e,t){super(e),this._client=t}get id(){return this[re.rawDataSymbol].id}get broadcasterId(){return this[re.rawDataSymbol].broadcaster_id}get broadcasterName(){return this[re.rawDataSymbol].broadcaster_login}get broadcasterDisplayName(){return this[re.rawDataSymbol].broadcaster_name}async getBroadcaster(){return(0,re.checkRelationAssertion)(await this._client.users.getUserById(this[re.rawDataSymbol].broadcaster_id))}get title(){return this[re.rawDataSymbol].title}get status(){return this[re.rawDataSymbol].status}get autoLockAfter(){return this[re.rawDataSymbol].prediction_window}get creationDate(){return new Date(this[re.rawDataSymbol].created_at)}get endDate(){return this[re.rawDataSymbol].ended_at?new Date(this[re.rawDataSymbol].ended_at):null}get lockDate(){return this[re.rawDataSymbol].locked_at?new Date(this[re.rawDataSymbol].locked_at):null}get outcomes(){return this[re.rawDataSymbol].outcomes.map(e=>new Xb.HelixPredictionOutcome(e,this._client))}get winningOutcomeId(){return this[re.rawDataSymbol].winning_outcome_id||null}get winningOutcome(){if(!this[re.rawDataSymbol].winning_outcome_id)return null;let e=this[re.rawDataSymbol].outcomes.find(t=>t.id===this[re.rawDataSymbol].winning_outcome_id);if(!e)throw new re.HellFreezesOverError("Winning outcome not found in outcomes array");return new Xb.HelixPredictionOutcome(e,this._client)}};da.HelixPrediction=Zl;Yb.__decorate([(0,hD.Enumerable)(!1)],Zl.prototype,"_client",void 0);da.HelixPrediction=Zl=Yb.__decorate([(0,re.rtfm)("api","HelixPrediction","id")],Zl)});var Mp=u(pa=>{"use strict";Object.defineProperty(pa,"__esModule",{value:!0});pa.HelixPredictionApi=void 0;var pD=(b(),x(g)),ex=Y(),ii=m(),_D=Oe(),tx=Kb(),mD=oe(),yD=he(),fD=le(),gD=G(),ha=jp(),kp=class extends gD.BaseApi{static{n(this,"HelixPredictionApi")}async getPredictions(e,t){let r=await this._client.callApi({type:"helix",url:"predictions",userId:(0,ii.extractUserId)(e),scopes:["channel:read:predictions"],query:{...(0,ex.createBroadcasterQuery)(e),...(0,fD.createPaginationQuery)(t)}});return(0,yD.createPaginatedResult)(r,ha.HelixPrediction,this._client)}getPredictionsPaginated(e){return new mD.HelixPaginatedRequest({url:"predictions",userId:(0,ii.extractUserId)(e),scopes:["channel:read:predictions"],query:(0,ex.createBroadcasterQuery)(e)},this._client,t=>new ha.HelixPrediction(t,this._client),20)}async getPredictionsByIds(e,t){return t.length?(await this._client.callApi({type:"helix",url:"predictions",userId:(0,ii.extractUserId)(e),scopes:["channel:read:predictions"],query:(0,_D.createGetByIdsQuery)(e,t)})).data.map(a=>new ha.HelixPrediction(a,this._client)):[]}async getPredictionById(e,t){let r=await this.getPredictionsByIds(e,[t]);return r.length?r[0]:null}async createPrediction(e,t){let r=await this._client.callApi({type:"helix",url:"predictions",method:"POST",userId:(0,ii.extractUserId)(e),scopes:["channel:manage:predictions"],jsonBody:(0,tx.createPredictionBody)(e,t)});return new ha.HelixPrediction(r.data[0],this._client)}async lockPrediction(e,t){return await this._endPrediction(e,t,"LOCKED")}async resolvePrediction(e,t,r){return await this._endPrediction(e,t,"RESOLVED",r)}async cancelPrediction(e,t){return await this._endPrediction(e,t,"CANCELED")}async _endPrediction(e,t,r,a){let s=await this._client.callApi({type:"helix",url:"predictions",method:"PATCH",userId:(0,ii.extractUserId)(e),scopes:["channel:manage:predictions"],jsonBody:(0,tx.createEndPredictionBody)(e,t,r,a)});return new ha.HelixPrediction(s.data[0],this._client)}};pa.HelixPredictionApi=kp;pa.HelixPredictionApi=kp=pD.__decorate([(0,ii.rtfm)("api","HelixPredictionApi")],kp)});var ix=u(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});Xl.createRaidStartQuery=void 0;var rx=m();function bD(i,e){return{from_broadcaster_id:(0,rx.extractUserId)(i),to_broadcaster_id:(0,rx.extractUserId)(e)}}n(bD,"createRaidStartQuery");Xl.createRaidStartQuery=bD});var Fp=u(_a=>{"use strict";Object.defineProperty(_a,"__esModule",{value:!0});_a.HelixRaid=void 0;var xD=(b(),x(g)),Yl=m(),Lp=class extends Yl.DataObject{static{n(this,"HelixRaid")}get creationDate(){return new Date(this[Yl.rawDataSymbol].created_at)}get targetIsMature(){return this[Yl.rawDataSymbol].is_mature}};_a.HelixRaid=Lp;_a.HelixRaid=Lp=xD.__decorate([(0,Yl.rtfm)("api","HelixRaid")],Lp)});var Gp=u(ma=>{"use strict";Object.defineProperty(ma,"__esModule",{value:!0});ma.HelixRaidApi=void 0;var wD=(b(),x(g)),vD=Y(),Np=m(),SD=ix(),HD=G(),CD=Fp(),Qp=class extends HD.BaseApi{static{n(this,"HelixRaidApi")}async startRaid(e,t){let r=await this._client.callApi({type:"helix",url:"raids",method:"POST",userId:(0,Np.extractUserId)(e),scopes:["channel:manage:raids"],query:(0,SD.createRaidStartQuery)(e,t)});return new CD.HelixRaid(r.data[0])}async cancelRaid(e){await this._client.callApi({type:"helix",url:"raids",method:"DELETE",userId:(0,Np.extractUserId)(e),scopes:["channel:manage:raids"],query:(0,vD.createBroadcasterQuery)(e)})}};ma.HelixRaidApi=Qp;ma.HelixRaidApi=Qp=wD.__decorate([(0,Np.rtfm)("api","HelixRaidApi")],Qp)});var Wp=u(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});Ke.createScheduleSegmentUpdateBody=Ke.createScheduleSegmentModifyQuery=Ke.createScheduleSegmentBody=Ke.createScheduleSettingsUpdateQuery=Ke.createScheduleQuery=void 0;var eu=m();function qD(i,e){var t;return{broadcaster_id:(0,eu.extractUserId)(i),start_time:e?.startDate,utc_offset:(t=e?.utcOffset)===null||t===void 0?void 0:t.toString()}}n(qD,"createScheduleQuery");Ke.createScheduleQuery=qD;function ED(i,e){return e.vacation?{broadcaster_id:(0,eu.extractUserId)(i),is_vacation_enabled:"true",vacation_start_time:e.vacation.startDate,vacation_end_time:e.vacation.endDate,timezone:e.vacation.timezone}:{broadcaster_id:(0,eu.extractUserId)(i),is_vacation_enabled:"false"}}n(ED,"createScheduleSettingsUpdateQuery");Ke.createScheduleSettingsUpdateQuery=ED;function PD(i){return{start_time:i.startDate,timezone:i.timezone,is_recurring:i.isRecurring,duration:i.duration,category_id:i.categoryId,title:i.title}}n(PD,"createScheduleSegmentBody");Ke.createScheduleSegmentBody=PD;function AD(i,e){return{broadcaster_id:(0,eu.extractUserId)(i),id:e}}n(AD,"createScheduleSegmentModifyQuery");Ke.createScheduleSegmentModifyQuery=AD;function DD(i){return{start_time:i.startDate,timezone:i.timezone,is_canceled:i.isCanceled,duration:i.duration,category_id:i.categoryId,title:i.title}}n(DD,"createScheduleSegmentUpdateBody");Ke.createScheduleSegmentUpdateBody=DD});var fa=u(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});ya.HelixScheduleSegment=void 0;var nx=(b(),x(g)),ax=C(),rt=m(),tu=class extends rt.DataObject{static{n(this,"HelixScheduleSegment")}constructor(e,t){super(e),this._client=t}get id(){return this[rt.rawDataSymbol].id}get startDate(){return new Date(this[rt.rawDataSymbol].start_time)}get endDate(){return new Date(this[rt.rawDataSymbol].end_time)}get title(){return this[rt.rawDataSymbol].title}get cancelEndDate(){return(0,ax.mapNullable)(this[rt.rawDataSymbol].canceled_until,e=>new Date(e))}get categoryId(){var e,t;return(t=(e=this[rt.rawDataSymbol].category)===null||e===void 0?void 0:e.id)!==null&&t!==void 0?t:null}get categoryName(){var e,t;return(t=(e=this[rt.rawDataSymbol].category)===null||e===void 0?void 0:e.name)!==null&&t!==void 0?t:null}async getCategory(){var e;let t=(e=this[rt.rawDataSymbol].category)===null||e===void 0?void 0:e.id;return t?await this._client.games.getGameById(t):null}get isRecurring(){return this[rt.rawDataSymbol].is_recurring}};ya.HelixScheduleSegment=tu;nx.__decorate([(0,ax.Enumerable)(!1)],tu.prototype,"_client",void 0);ya.HelixScheduleSegment=tu=nx.__decorate([(0,rt.rtfm)("api","HelixScheduleSegment","id")],tu)});var $p=u(ga=>{"use strict";Object.defineProperty(ga,"__esModule",{value:!0});ga.HelixPaginatedScheduleSegmentRequest=void 0;var ID=(b(),x(g)),TD=m(),RD=Wp(),UD=oe(),BD=fa(),Vp=class extends UD.HelixPaginatedRequest{static{n(this,"HelixPaginatedScheduleSegmentRequest")}constructor(e,t,r){super({url:"schedule",query:(0,RD.createScheduleQuery)(e,r)},t,a=>new BD.HelixScheduleSegment(a,t),25)}async _fetchData(e={}){var t;let r=await super._fetchData(e);return{data:(t=r.data.segments)!==null&&t!==void 0?t:[],pagination:r.pagination}}};ga.HelixPaginatedScheduleSegmentRequest=Vp;ga.HelixPaginatedScheduleSegmentRequest=Vp=ID.__decorate([(0,TD.rtfm)("api","HelixPaginatedScheduleSegmentRequest")],Vp)});var zp=u(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});ba.HelixSchedule=void 0;var sx=(b(),x(g)),OD=C(),mt=m(),jD=fa(),ru=class extends mt.DataObject{static{n(this,"HelixSchedule")}constructor(e,t){super(e),this._client=t}get segments(){var e,t;return(t=(e=this[mt.rawDataSymbol].segments)===null||e===void 0?void 0:e.map(r=>new jD.HelixScheduleSegment(r,this._client)))!==null&&t!==void 0?t:[]}get broadcasterId(){return this[mt.rawDataSymbol].broadcaster_id}get broadcasterName(){return this[mt.rawDataSymbol].broadcaster_login}get broadcasterDisplayName(){return this[mt.rawDataSymbol].broadcaster_name}async getBroadcaster(){return(0,mt.checkRelationAssertion)(await this._client.users.getUserById(this[mt.rawDataSymbol].broadcaster_id))}get vacationStartDate(){var e;let t=(e=this[mt.rawDataSymbol].vacation)===null||e===void 0?void 0:e.start_time;return t?new Date(t):null}get vacationEndDate(){var e;let t=(e=this[mt.rawDataSymbol].vacation)===null||e===void 0?void 0:e.end_time;return t?new Date(t):null}};ba.HelixSchedule=ru;sx.__decorate([(0,OD.Enumerable)(!1)],ru.prototype,"_client",void 0);ba.HelixSchedule=ru=sx.__decorate([(0,mt.rtfm)("api","HelixSchedule","broadcasterId")],ru)});var Zp=u(iu=>{"use strict";Object.defineProperty(iu,"__esModule",{value:!0});iu.HelixScheduleApi=void 0;var ox=Y(),ni=m(),kD=Oe(),ai=Wp(),MD=le(),LD=G(),FD=$p(),ND=zp(),Kp=fa(),Jp=class extends LD.BaseApi{static{n(this,"HelixScheduleApi")}async getSchedule(e,t){let r=await this._client.callApi({type:"helix",url:"schedule",userId:(0,ni.extractUserId)(e),query:{...(0,ai.createScheduleQuery)(e,t),...(0,MD.createPaginationQuery)(t)}});return{data:new ND.HelixSchedule(r.data,this._client),cursor:r.pagination.cursor}}getScheduleSegmentsPaginated(e,t){return new FD.HelixPaginatedScheduleSegmentRequest(e,this._client,t)}async getScheduleSegmentsByIds(e,t){var r,a;return(a=(r=(await this._client.callApi({type:"helix",url:"schedule",userId:(0,ni.extractUserId)(e),query:(0,kD.createGetByIdsQuery)(e,t)})).data.segments)===null||r===void 0?void 0:r.map(o=>new Kp.HelixScheduleSegment(o,this._client)))!==null&&a!==void 0?a:[]}async getScheduleSegmentById(e,t){let r=await this.getScheduleSegmentsByIds(e,[t]);return r.length?r[0]:null}async getScheduleAsIcal(e){return await this._client.callApi({type:"helix",url:"schedule/icalendar",query:(0,ox.createBroadcasterQuery)(e)})}async updateScheduleSettings(e,t){await this._client.callApi({type:"helix",url:"schedule/settings",method:"PATCH",userId:(0,ni.extractUserId)(e),scopes:["channel:manage:schedule"],query:(0,ai.createScheduleSettingsUpdateQuery)(e,t)})}async createScheduleSegment(e,t){let r=await this._client.callApi({type:"helix",url:"schedule/segment",method:"POST",userId:(0,ni.extractUserId)(e),scopes:["channel:manage:schedule"],query:(0,ox.createBroadcasterQuery)(e),jsonBody:(0,ai.createScheduleSegmentBody)(t)});return new Kp.HelixScheduleSegment(r.data.segments[0],this._client)}async updateScheduleSegment(e,t,r){let a=await this._client.callApi({type:"helix",url:"schedule/segment",method:"PATCH",userId:(0,ni.extractUserId)(e),scopes:["channel:manage:schedule"],query:(0,ai.createScheduleSegmentModifyQuery)(e,t),jsonBody:(0,ai.createScheduleSegmentUpdateBody)(r)});return new Kp.HelixScheduleSegment(a.data.segments[0],this._client)}async deleteScheduleSegment(e,t){await this._client.callApi({type:"helix",url:"schedule/segment",method:"DELETE",userId:(0,ni.extractUserId)(e),scopes:["channel:manage:schedule"],query:(0,ai.createScheduleSegmentModifyQuery)(e,t)})}};iu.HelixScheduleApi=Jp});var lx=u(nu=>{"use strict";Object.defineProperty(nu,"__esModule",{value:!0});nu.createSearchChannelsQuery=void 0;function QD(i,e){var t;return{query:i,live_only:(t=e.liveOnly)===null||t===void 0?void 0:t.toString()}}n(QD,"createSearchChannelsQuery");nu.createSearchChannelsQuery=QD});var Xp=u(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});xa.HelixChannelSearchResult=void 0;var ux=(b(),x(g)),GD=C(),fe=m(),au=class extends fe.DataObject{static{n(this,"HelixChannelSearchResult")}constructor(e,t){super(e),this._client=t}get language(){return this[fe.rawDataSymbol].broadcaster_language}get id(){return this[fe.rawDataSymbol].id}get name(){return this[fe.rawDataSymbol].broadcaster_login}get displayName(){return this[fe.rawDataSymbol].display_name}async getUser(){return(0,fe.checkRelationAssertion)(await this._client.users.getUserById(this[fe.rawDataSymbol].id))}get gameId(){return this[fe.rawDataSymbol].game_id}get gameName(){return this[fe.rawDataSymbol].game_name}async getGame(){return this[fe.rawDataSymbol].game_id?(0,fe.checkRelationAssertion)(await this._client.games.getGameById(this[fe.rawDataSymbol].game_id)):null}get isLive(){return this[fe.rawDataSymbol].is_live}get tags(){return this[fe.rawDataSymbol].tags}get thumbnailUrl(){return this[fe.rawDataSymbol].thumbnail_url}get startDate(){return this[fe.rawDataSymbol].is_live?new Date(this[fe.rawDataSymbol].started_at):null}};xa.HelixChannelSearchResult=au;ux.__decorate([(0,GD.Enumerable)(!1)],au.prototype,"_client",void 0);xa.HelixChannelSearchResult=au=ux.__decorate([(0,fe.rtfm)("api","HelixChannelSearchResult","id")],au)});var e_=u(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});wa.HelixSearchApi=void 0;var WD=(b(),x(g)),VD=m(),cx=lx(),dx=oe(),hx=he(),px=le(),$D=G(),_x=Ul(),mx=Xp(),Yp=class extends $D.BaseApi{static{n(this,"HelixSearchApi")}async searchCategories(e,t){let r=await this._client.callApi({type:"helix",url:"search/categories",query:{query:e,...(0,px.createPaginationQuery)(t)}});return(0,hx.createPaginatedResult)(r,_x.HelixGame,this._client)}searchCategoriesPaginated(e){return new dx.HelixPaginatedRequest({url:"search/categories",query:{query:e}},this._client,t=>new _x.HelixGame(t,this._client))}async searchChannels(e,t={}){let r=await this._client.callApi({type:"helix",url:"search/channels",query:{...(0,cx.createSearchChannelsQuery)(e,t),...(0,px.createPaginationQuery)(t)}});return(0,hx.createPaginatedResult)(r,mx.HelixChannelSearchResult,this._client)}searchChannelsPaginated(e,t={}){return new dx.HelixPaginatedRequest({url:"search/channels",query:(0,cx.createSearchChannelsQuery)(e,t)},this._client,r=>new mx.HelixChannelSearchResult(r,this._client))}};wa.HelixSearchApi=Yp;wa.HelixSearchApi=Yp=WD.__decorate([(0,VD.rtfm)("api","HelixSearchApi")],Yp)});var r_=u(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});su.StreamNotLiveError=void 0;var zD=m(),t_=class extends zD.CustomError{static{n(this,"StreamNotLiveError")}constructor(e){super("Your stream needs to be live to do this",e)}};su.StreamNotLiveError=t_});var yx=u(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.createVideoQuery=Zt.createStreamMarkerBody=Zt.createStreamQuery=void 0;var KD=m();function JD(i){return{game_id:i.game,language:i.language,type:i.type,user_id:i.userId,user_login:i.userName}}n(JD,"createStreamQuery");Zt.createStreamQuery=JD;function ZD(i,e){return{user_id:(0,KD.extractUserId)(i),description:e}}n(ZD,"createStreamMarkerBody");Zt.createStreamMarkerBody=ZD;function XD(i){return{video_id:i}}n(XD,"createVideoQuery");Zt.createVideoQuery=XD});var i_=u(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});va.HelixStream=void 0;var fx=(b(),x(g)),YD=C(),ie=m(),ou=class extends ie.DataObject{static{n(this,"HelixStream")}constructor(e,t){super(e),this._client=t}get id(){return this[ie.rawDataSymbol].id}get userId(){return this[ie.rawDataSymbol].user_id}get userName(){return this[ie.rawDataSymbol].user_login}get userDisplayName(){return this[ie.rawDataSymbol].user_name}async getUser(){return(0,ie.checkRelationAssertion)(await this._client.users.getUserById(this[ie.rawDataSymbol].user_id))}get gameId(){return this[ie.rawDataSymbol].game_id}get gameName(){return this[ie.rawDataSymbol].game_name}async getGame(){return this[ie.rawDataSymbol].game_id?(0,ie.checkRelationAssertion)(await this._client.games.getGameById(this[ie.rawDataSymbol].game_id)):null}get type(){return this[ie.rawDataSymbol].type}get title(){return this[ie.rawDataSymbol].title}get viewers(){return this[ie.rawDataSymbol].viewer_count}get startDate(){return new Date(this[ie.rawDataSymbol].started_at)}get language(){return this[ie.rawDataSymbol].language}get thumbnailUrl(){return this[ie.rawDataSymbol].thumbnail_url}getThumbnailUrl(e,t){return this[ie.rawDataSymbol].thumbnail_url.replace("{width}",e.toString()).replace("{height}",t.toString())}get tags(){return this[ie.rawDataSymbol].tags}get isMature(){return this[ie.rawDataSymbol].is_mature}};va.HelixStream=ou;fx.__decorate([(0,YD.Enumerable)(!1)],ou.prototype,"_client",void 0);va.HelixStream=ou=fx.__decorate([(0,ie.rtfm)("api","HelixStream","id")],ou)});var uu=u(Sa=>{"use strict";Object.defineProperty(Sa,"__esModule",{value:!0});Sa.HelixStreamMarker=void 0;var gx=(b(),x(g)),eI=C(),si=m(),lu=class extends si.DataObject{static{n(this,"HelixStreamMarker")}constructor(e,t){super(e),this._client=t}get id(){return this[si.rawDataSymbol].id}get creationDate(){return new Date(this[si.rawDataSymbol].created_at)}get description(){return this[si.rawDataSymbol].description}get positionInSeconds(){return this[si.rawDataSymbol].position_seconds}};Sa.HelixStreamMarker=lu;gx.__decorate([(0,eI.Enumerable)(!1)],lu.prototype,"_client",void 0);Sa.HelixStreamMarker=lu=gx.__decorate([(0,si.rtfm)("api","HelixStreamMarker","id")],lu)});var s_=u(Ha=>{"use strict";Object.defineProperty(Ha,"__esModule",{value:!0});Ha.HelixStreamMarkerWithVideo=void 0;var tI=(b(),x(g)),n_=m(),rI=uu(),a_=class extends rI.HelixStreamMarker{static{n(this,"HelixStreamMarkerWithVideo")}constructor(e,t,r){super(e,r),this._videoId=t}get url(){return this[n_.rawDataSymbol].URL}get videoId(){return this._videoId}async getVideo(){return(0,n_.checkRelationAssertion)(await this._client.videos.getVideoById(this._videoId))}};Ha.HelixStreamMarkerWithVideo=a_;Ha.HelixStreamMarkerWithVideo=a_=tI.__decorate([(0,n_.rtfm)("api","HelixStreamMarkerWithVideo","id")],a_)});var l_=u(Ea=>{"use strict";var li;Object.defineProperty(Ea,"__esModule",{value:!0});Ea.HelixStreamApi=void 0;var o_=(b(),x(g)),Ca=C(),bx=Y(),Re=m(),iI=r_(),cu=Oe(),oi=yx(),xx=Lt(),du=oe(),wx=he(),hu=le(),nI=G(),gr=i_(),aI=uu(),sI=s_(),qa=li=class extends nI.BaseApi{static{n(this,"HelixStreamApi")}constructor(){super(...arguments),this._getStreamByUserIdBatcher=new xx.HelixRequestBatcher({url:"streams"},"user_id","user_id",this._client,e=>new gr.HelixStream(e,this._client)),this._getStreamByUserNameBatcher=new xx.HelixRequestBatcher({url:"streams"},"user_login","user_login",this._client,e=>new gr.HelixStream(e,this._client))}async getStreams(e={}){let t=await this._client.callApi({url:"streams",type:"helix",query:{...(0,oi.createStreamQuery)(e),...(0,hu.createPaginationQuery)(e)}});return(0,wx.createPaginatedResult)(t,gr.HelixStream,this._client)}getStreamsPaginated(e={}){return new du.HelixPaginatedRequest({url:"streams",query:(0,oi.createStreamQuery)(e)},this._client,t=>new gr.HelixStream(t,this._client))}async getStreamsByUserNames(e){return(await this.getStreams({userName:e.map(Re.extractUserName)})).data}async getStreamByUserName(e){var t;return(t=(await this.getStreamsByUserNames([e]))[0])!==null&&t!==void 0?t:null}async getStreamByUserNameBatched(e){return await this._getStreamByUserNameBatcher.request((0,Re.extractUserName)(e))}async getStreamsByUserIds(e){return(await this.getStreams({userId:e.map(Re.extractUserId)})).data}async getStreamByUserId(e){let t=(0,Re.extractUserId)(e),r=await this._client.callApi({url:"streams",type:"helix",userId:t,query:(0,oi.createStreamQuery)({userId:t})});return(0,Ca.mapNullable)(r.data[0],a=>new gr.HelixStream(a,this._client))}async getStreamByUserIdBatched(e){return await this._getStreamByUserIdBatcher.request((0,Re.extractUserId)(e))}async getStreamMarkersForUser(e,t){var r;let a=await this._client.callApi({url:"streams/markers",type:"helix",query:{...(0,cu.createUserQuery)(e),...(0,hu.createPaginationQuery)(t)},userId:(0,Re.extractUserId)(e),scopes:["user:read:broadcast"],canOverrideScopedUserContext:!0});return{data:(0,Ca.flatten)(a.data.map(s=>li._mapGetStreamMarkersResult(s,this._client))),cursor:(r=a.pagination)===null||r===void 0?void 0:r.cursor}}getStreamMarkersForUserPaginated(e){return new du.HelixPaginatedRequest({url:"streams/markers",query:(0,cu.createUserQuery)(e),userId:(0,Re.extractUserId)(e),scopes:["user:read:broadcast"],canOverrideScopedUserContext:!0},this._client,t=>li._mapGetStreamMarkersResult(t,this._client))}async getStreamMarkersForVideo(e,t,r){var a;let s=await this._client.callApi({url:"streams/markers",type:"helix",query:{...(0,oi.createVideoQuery)(t),...(0,hu.createPaginationQuery)(r)},userId:(0,Re.extractUserId)(e),scopes:["user:read:broadcast"],canOverrideScopedUserContext:!0});return{data:(0,Ca.flatten)(s.data.map(o=>li._mapGetStreamMarkersResult(o,this._client))),cursor:(a=s.pagination)===null||a===void 0?void 0:a.cursor}}getStreamMarkersForVideoPaginated(e,t){return new du.HelixPaginatedRequest({url:"streams/markers",query:(0,oi.createVideoQuery)(t),userId:(0,Re.extractUserId)(e),scopes:["user:read:broadcast"],canOverrideScopedUserContext:!0},this._client,r=>li._mapGetStreamMarkersResult(r,this._client))}async createStreamMarker(e,t){try{let r=await this._client.callApi({url:"streams/markers",method:"POST",type:"helix",userId:(0,Re.extractUserId)(e),scopes:["channel:manage:broadcast"],canOverrideScopedUserContext:!0,jsonBody:(0,oi.createStreamMarkerBody)(e,t)});return new aI.HelixStreamMarker(r.data[0],this._client)}catch(r){throw r instanceof bx.HttpStatusCodeError&&r.statusCode===404?new iI.StreamNotLiveError({cause:r}):r}}async getStreamKey(e){let t=(0,Re.extractUserId)(e);return(await this._client.callApi({type:"helix",url:"streams/key",userId:t,scopes:["channel:read:stream_key"],query:(0,bx.createBroadcasterQuery)(e)})).data[0].stream_key}async getFollowedStreams(e,t){let r=(0,Re.extractUserId)(e),a=await this._client.callApi({type:"helix",url:"streams/followed",userId:r,scopes:["user:read:follows"],query:{...(0,cu.createSingleKeyQuery)("user_id",r),...(0,hu.createPaginationQuery)(t)}});return(0,wx.createPaginatedResult)(a,gr.HelixStream,this._client)}getFollowedStreamsPaginated(e){let t=(0,Re.extractUserId)(e);return new du.HelixPaginatedRequest({url:"streams/followed",userId:t,scopes:["user:read:follows"],query:(0,cu.createSingleKeyQuery)("user_id",t)},this._client,r=>new gr.HelixStream(r,this._client))}static _mapGetStreamMarkersResult(e,t){return e.videos.reduce((r,a)=>[...r,...a.markers.map(s=>new sI.HelixStreamMarkerWithVideo(s,a.video_id,t))],[])}};Ea.HelixStreamApi=qa;o_.__decorate([(0,Ca.Enumerable)(!1)],qa.prototype,"_getStreamByUserIdBatcher",void 0);o_.__decorate([(0,Ca.Enumerable)(!1)],qa.prototype,"_getStreamByUserNameBatcher",void 0);Ea.HelixStreamApi=qa=li=o_.__decorate([(0,Re.rtfm)("api","HelixStreamApi")],qa)});var Sx=u(pu=>{"use strict";Object.defineProperty(pu,"__esModule",{value:!0});pu.createSubscriptionCheckQuery=void 0;var vx=m();function oI(i,e){return{broadcaster_id:(0,vx.extractUserId)(i),user_id:(0,vx.extractUserId)(e)}}n(oI,"createSubscriptionCheckQuery");pu.createSubscriptionCheckQuery=oI});var mu=u(Pa=>{"use strict";Object.defineProperty(Pa,"__esModule",{value:!0});Pa.HelixUserSubscription=void 0;var Hx=(b(),x(g)),lI=C(),Xt=m(),_u=class extends Xt.DataObject{static{n(this,"HelixUserSubscription")}constructor(e,t){super(e),this._client=t}get broadcasterId(){return this[Xt.rawDataSymbol].broadcaster_id}get broadcasterName(){return this[Xt.rawDataSymbol].broadcaster_login}get broadcasterDisplayName(){return this[Xt.rawDataSymbol].broadcaster_name}async getBroadcaster(){return await this._client.users.getUserById(this[Xt.rawDataSymbol].broadcaster_id)}get isGift(){return this[Xt.rawDataSymbol].is_gift}get tier(){return this[Xt.rawDataSymbol].tier}};Pa.HelixUserSubscription=_u;Hx.__decorate([(0,lI.Enumerable)(!1)],_u.prototype,"_client",void 0);Pa.HelixUserSubscription=_u=Hx.__decorate([(0,Xt.rtfm)("api","HelixUserSubscription","broadcasterId")],_u)});var yu=u(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});Aa.HelixSubscription=void 0;var uI=(b(),x(g)),de=m(),cI=mu(),u_=class extends cI.HelixUserSubscription{static{n(this,"HelixSubscription")}get broadcasterId(){return this[de.rawDataSymbol].broadcaster_id}get broadcasterName(){return this[de.rawDataSymbol].broadcaster_login}get broadcasterDisplayName(){return this[de.rawDataSymbol].broadcaster_name}async getBroadcaster(){return(0,de.checkRelationAssertion)(await this._client.users.getUserById(this[de.rawDataSymbol].broadcaster_id))}get gifterId(){return this[de.rawDataSymbol].is_gift?this[de.rawDataSymbol].gifter_id:null}get gifterName(){return this[de.rawDataSymbol].is_gift?this[de.rawDataSymbol].gifter_login:null}get gifterDisplayName(){return this[de.rawDataSymbol].is_gift?this[de.rawDataSymbol].gifter_name:null}async getGifter(){return this[de.rawDataSymbol].is_gift?(0,de.checkRelationAssertion)(await this._client.users.getUserById(this[de.rawDataSymbol].gifter_id)):null}get userId(){return this[de.rawDataSymbol].user_id}get userName(){return this[de.rawDataSymbol].user_login}get userDisplayName(){return this[de.rawDataSymbol].user_name}async getUser(){return(0,de.checkRelationAssertion)(await this._client.users.getUserById(this[de.rawDataSymbol].user_id))}};Aa.HelixSubscription=u_;Aa.HelixSubscription=u_=uI.__decorate([(0,de.rtfm)("api","HelixSubscription","userId")],u_)});var d_=u(Da=>{"use strict";Object.defineProperty(Da,"__esModule",{value:!0});Da.HelixPaginatedSubscriptionsRequest=void 0;var dI=(b(),x(g)),hI=Y(),Cx=m(),pI=Gr(),_I=yu(),c_=class extends pI.HelixPaginatedRequestWithTotal{static{n(this,"HelixPaginatedSubscriptionsRequest")}constructor(e,t){super({url:"subscriptions",scopes:["channel:read:subscriptions"],userId:(0,Cx.extractUserId)(e),query:(0,hI.createBroadcasterQuery)(e)},t,r=>new _I.HelixSubscription(r,t))}async getPoints(){var e;return((e=this._currentData)!==null&&e!==void 0?e:await this._fetchData({query:{after:void 0}})).points}};Da.HelixPaginatedSubscriptionsRequest=c_;Da.HelixPaginatedSubscriptionsRequest=c_=dI.__decorate([(0,Cx.rtfm)("api","HelixPaginatedSubscriptionsRequest")],c_)});var p_=u(Ia=>{"use strict";Object.defineProperty(Ia,"__esModule",{value:!0});Ia.HelixSubscriptionApi=void 0;var mI=(b(),x(g)),qx=Y(),fu=m(),yI=Oe(),fI=Sx(),gI=he(),bI=le(),xI=G(),wI=d_(),Ex=yu(),vI=mu(),h_=class extends xI.BaseApi{static{n(this,"HelixSubscriptionApi")}async getSubscriptions(e,t){let r=await this._client.callApi({url:"subscriptions",scopes:["channel:read:subscriptions"],type:"helix",userId:(0,fu.extractUserId)(e),query:{...(0,qx.createBroadcasterQuery)(e),...(0,bI.createPaginationQuery)(t)}});return{...(0,gI.createPaginatedResultWithTotal)(r,Ex.HelixSubscription,this._client),points:r.points}}getSubscriptionsPaginated(e){return new wI.HelixPaginatedSubscriptionsRequest(e,this._client)}async getSubscriptionsForUsers(e,t){return(await this._client.callApi({type:"helix",url:"subscriptions",userId:(0,fu.extractUserId)(e),scopes:["channel:read:subscriptions"],query:(0,yI.createChannelUsersCheckQuery)(e,t)})).data.map(a=>new Ex.HelixSubscription(a,this._client))}async getSubscriptionForUser(e,t){let r=await this.getSubscriptionsForUsers(e,[t]);return r.length?r[0]:null}async checkUserSubscription(e,t){try{let r=await this._client.callApi({type:"helix",url:"subscriptions/user",userId:(0,fu.extractUserId)(e),scopes:["user:read:subscriptions"],query:(0,fI.createSubscriptionCheckQuery)(t,e)});return new vI.HelixUserSubscription(r.data[0],this._client)}catch(r){if(r instanceof qx.HttpStatusCodeError&&r.statusCode===404)return null;throw r}}};Ia.HelixSubscriptionApi=h_;Ia.HelixSubscriptionApi=h_=mI.__decorate([(0,fu.rtfm)("api","HelixSubscriptionApi")],h_)});var bu=u(Ta=>{"use strict";Object.defineProperty(Ta,"__esModule",{value:!0});Ta.HelixTeam=void 0;var Px=(b(),x(g)),SI=C(),it=m(),gu=class extends it.DataObject{static{n(this,"HelixTeam")}constructor(e,t){super(e),this._client=t}get id(){return this[it.rawDataSymbol].id}get name(){return this[it.rawDataSymbol].team_name}get displayName(){return this[it.rawDataSymbol].team_display_name}get backgroundImageUrl(){return this[it.rawDataSymbol].background_image_url}get bannerUrl(){return this[it.rawDataSymbol].banner}get creationDate(){return new Date(this[it.rawDataSymbol].created_at)}get updateDate(){return new Date(this[it.rawDataSymbol].updated_at)}get info(){return this[it.rawDataSymbol].info}get logoThumbnailUrl(){return this[it.rawDataSymbol].thumbnail_url}async getUserRelations(){return(await this._client.teams.getTeamById(this.id)).userRelations}};Ta.HelixTeam=gu;Px.__decorate([(0,SI.Enumerable)(!1)],gu.prototype,"_client",void 0);Ta.HelixTeam=gu=Px.__decorate([(0,it.rtfm)("api","HelixTeam","id")],gu)});var m_=u(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});Ra.HelixTeamWithUsers=void 0;var HI=(b(),x(g)),Ax=m(),CI=Qo(),qI=bu(),__=class extends qI.HelixTeam{static{n(this,"HelixTeamWithUsers")}get userRelations(){return this[Ax.rawDataSymbol].users.map(e=>new CI.HelixUserRelation(e,this._client))}};Ra.HelixTeamWithUsers=__;Ra.HelixTeamWithUsers=__=HI.__decorate([(0,Ax.rtfm)("api","HelixTeamWithUsers","id")],__)});var g_=u(Ua=>{"use strict";Object.defineProperty(Ua,"__esModule",{value:!0});Ua.HelixTeamApi=void 0;var EI=(b(),x(g)),y_=Y(),Ix=m(),PI=G(),AI=bu(),Dx=m_(),f_=class extends PI.BaseApi{static{n(this,"HelixTeamApi")}async getTeamsForBroadcaster(e){var t,r;return(r=(t=(await this._client.callApi({type:"helix",url:"teams/channel",userId:(0,Ix.extractUserId)(e),query:(0,y_.createBroadcasterQuery)(e)})).data)===null||t===void 0?void 0:t.map(s=>new AI.HelixTeam(s,this._client)))!==null&&r!==void 0?r:[]}async getTeamById(e){try{let t=await this._client.callApi({type:"helix",url:"teams",query:{id:e}});return new Dx.HelixTeamWithUsers(t.data[0],this._client)}catch(t){if(t instanceof y_.HttpStatusCodeError&&t.statusCode===500)return null;throw t}}async getTeamByName(e){try{let t=await this._client.callApi({type:"helix",url:"teams",query:{name:e}});return new Dx.HelixTeamWithUsers(t.data[0],this._client)}catch(t){if(t instanceof y_.HttpStatusCodeError&&t.statusCode===404)return null;throw t}}};Ua.HelixTeamApi=f_;Ua.HelixTeamApi=f_=EI.__decorate([(0,Ix.rtfm)("api","HelixTeamApi")],f_)});var Rx=u(ui=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});ui.createUserBlockDeleteQuery=ui.createUserBlockCreateQuery=void 0;var Tx=m();function DI(i,e){return{target_user_id:(0,Tx.extractUserId)(i),source_context:e.sourceContext,reason:e.reason}}n(DI,"createUserBlockCreateQuery");ui.createUserBlockCreateQuery=DI;function II(i){return{target_user_id:(0,Tx.extractUserId)(i)}}n(II,"createUserBlockDeleteQuery");ui.createUserBlockDeleteQuery=II});var vu=u(wu=>{"use strict";Object.defineProperty(wu,"__esModule",{value:!0});wu.HelixBaseExtension=void 0;var xu=m(),b_=class extends xu.DataObject{static{n(this,"HelixBaseExtension")}get id(){return this[xu.rawDataSymbol].id}get version(){return this[xu.rawDataSymbol].version}get name(){return this[xu.rawDataSymbol].name}};wu.HelixBaseExtension=b_});var w_=u(Ba=>{"use strict";Object.defineProperty(Ba,"__esModule",{value:!0});Ba.HelixInstalledExtension=void 0;var TI=(b(),x(g)),RI=m(),UI=vu(),x_=class extends UI.HelixBaseExtension{static{n(this,"HelixInstalledExtension")}constructor(e,t,r){super(r),this._slotType=e,this._slotId=t}get slotType(){return this._slotType}get slotId(){return this._slotId}};Ba.HelixInstalledExtension=x_;Ba.HelixInstalledExtension=x_=TI.__decorate([(0,RI.rtfm)("api","HelixInstalledExtension","id")],x_)});var H_=u(ja=>{"use strict";Object.defineProperty(ja,"__esModule",{value:!0});ja.HelixInstalledExtensionList=void 0;var BI=(b(),x(g)),Oa=m(),v_=w_(),S_=class extends Oa.DataObject{static{n(this,"HelixInstalledExtensionList")}getExtensionAtSlot(e,t){let r=this[Oa.rawDataSymbol][e][t];return r.active?new v_.HelixInstalledExtension(e,t,r):null}getExtensionsForSlotType(e){return[...Object.entries(this[Oa.rawDataSymbol][e])].filter(t=>t[1].active).map(([t,r])=>new v_.HelixInstalledExtension(e,t,r))}getAllExtensions(){return[...Object.entries(this[Oa.rawDataSymbol])].flatMap(([e,t])=>[...Object.entries(t)].filter(r=>r[1].active).map(([r,a])=>new v_.HelixInstalledExtension(e,r,a)))}};ja.HelixInstalledExtensionList=S_;ja.HelixInstalledExtensionList=S_=BI.__decorate([(0,Oa.rtfm)("api","HelixInstalledExtensionList")],S_)});var E_=u(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});ka.HelixUserExtension=void 0;var OI=(b(),x(g)),C_=m(),jI=vu(),q_=class extends jI.HelixBaseExtension{static{n(this,"HelixUserExtension")}get canActivate(){return this[C_.rawDataSymbol].can_activate}get types(){return this[C_.rawDataSymbol].type}};ka.HelixUserExtension=q_;ka.HelixUserExtension=q_=OI.__decorate([(0,C_.rtfm)("api","HelixUserExtension","id")],q_)});var Hu=u(Ma=>{"use strict";Object.defineProperty(Ma,"__esModule",{value:!0});Ma.HelixUser=void 0;var Ux=(b(),x(g)),kI=C(),nt=m(),Su=class extends nt.DataObject{static{n(this,"HelixUser")}constructor(e,t){super(e),this._client=t}get id(){return this[nt.rawDataSymbol].id}get name(){return this[nt.rawDataSymbol].login}get displayName(){return this[nt.rawDataSymbol].display_name}get description(){return this[nt.rawDataSymbol].description}get type(){return this[nt.rawDataSymbol].type}get broadcasterType(){return this[nt.rawDataSymbol].broadcaster_type}get profilePictureUrl(){return this[nt.rawDataSymbol].profile_image_url}get offlinePlaceholderUrl(){return this[nt.rawDataSymbol].offline_image_url}get creationDate(){return new Date(this[nt.rawDataSymbol].created_at)}async getStream(){return await this._client.streams.getStreamByUserId(this)}async getFollowedChannels(){return await this._client.channels.getFollowedChannels(this)}async getFollowedChannel(e){var t;return(t=(await this._client.channels.getFollowedChannels(this,e)).data[0])!==null&&t!==void 0?t:null}async follows(e){return await this.getFollowedChannel(e)!==null}async getChannelFollowers(){return await this._client.channels.getChannelFollowers(this)}async getChannelFollower(e){var t;return(t=(await this._client.channels.getChannelFollowers(this,e)).data[0])!==null&&t!==void 0?t:null}async isFollowedBy(e){return await this.getChannelFollower(e)!==null}async getSubscriptionTo(e){return await this._client.subscriptions.checkUserSubscription(this,e)}async isSubscribedTo(e){return await this.getSubscriptionTo(e)!==null}async getSubscriber(e){return await this._client.subscriptions.getSubscriptionForUser(this,e)}async hasSubscriber(e){return await this.getSubscriber(e)!==null}};Ma.HelixUser=Su;Ux.__decorate([(0,kI.Enumerable)(!1)],Su.prototype,"_client",void 0);Ma.HelixUser=Su=Ux.__decorate([(0,nt.rtfm)("api","HelixUser","id")],Su)});var A_=u(La=>{"use strict";Object.defineProperty(La,"__esModule",{value:!0});La.HelixPrivilegedUser=void 0;var MI=(b(),x(g)),Bx=m(),LI=Hu(),P_=class extends LI.HelixUser{static{n(this,"HelixPrivilegedUser")}get email(){return this[Bx.rawDataSymbol].email}async setDescription(e){return await this._client.users.updateAuthenticatedUser(this,{description:e})}};La.HelixPrivilegedUser=P_;La.HelixPrivilegedUser=P_=MI.__decorate([(0,Bx.rtfm)("api","HelixPrivilegedUser","id")],P_)});var D_=u(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});Fa.HelixUserBlock=void 0;var Ox=(b(),x(g)),FI=C(),br=m(),Cu=class extends br.DataObject{static{n(this,"HelixUserBlock")}constructor(e,t){super(e),this._client=t}get userId(){return this[br.rawDataSymbol].user_id}get userName(){return this[br.rawDataSymbol].user_login}get userDisplayName(){return this[br.rawDataSymbol].display_name}async getUser(){return(0,br.checkRelationAssertion)(await this._client.users.getUserById(this[br.rawDataSymbol].user_id))}};Fa.HelixUserBlock=Cu;Ox.__decorate([(0,FI.Enumerable)(!1)],Cu.prototype,"_client",void 0);Fa.HelixUserBlock=Cu=Ox.__decorate([(0,br.rtfm)("api","HelixUserBlock","userId")],Cu)});var R_=u(Qa=>{"use strict";Object.defineProperty(Qa,"__esModule",{value:!0});Qa.HelixUserApi=void 0;var I_=(b(),x(g)),T_=C(),jx=Y(),xe=m(),NI=Oe(),kx=Rx(),Mx=Lt(),QI=oe(),GI=he(),WI=le(),VI=G(),Lx=H_(),$I=E_(),Fx=A_(),qu=Hu(),Nx=D_(),Na=class extends VI.BaseApi{static{n(this,"HelixUserApi")}constructor(){super(...arguments),this._getUserByIdBatcher=new Mx.HelixRequestBatcher({url:"users"},"id","id",this._client,e=>new qu.HelixUser(e,this._client)),this._getUserByNameBatcher=new Mx.HelixRequestBatcher({url:"users"},"login","login",this._client,e=>new qu.HelixUser(e,this._client))}async getUsersByIds(e){return await this._getUsers("id",e.map(xe.extractUserId))}async getUsersByNames(e){return await this._getUsers("login",e.map(xe.extractUserName))}async getUserById(e){let t=(0,xe.extractUserId)(e),r=await this._client.callApi({type:"helix",url:"users",userId:t,query:{id:t}});return(0,T_.mapNullable)(r.data[0],a=>new qu.HelixUser(a,this._client))}async getUserByIdBatched(e){return await this._getUserByIdBatcher.request((0,xe.extractUserId)(e))}async getUserByName(e){let t=await this._getUsers("login",[(0,xe.extractUserName)(e)]);return t.length?t[0]:null}async getUserByNameBatched(e){return await this._getUserByNameBatcher.request((0,xe.extractUserName)(e))}async getAuthenticatedUser(e,t=!1){var r;let a=await this._client.callApi({type:"helix",url:"users",forceType:"user",userId:(0,xe.extractUserId)(e),scopes:t?["user:read:email"]:void 0});if(!(!((r=a.data)===null||r===void 0)&&r.length))throw new xe.HellFreezesOverError("Could not get authenticated user");return new Fx.HelixPrivilegedUser(a.data[0],this._client)}async updateAuthenticatedUser(e,t){let r=await this._client.callApi({type:"helix",url:"users",method:"PUT",userId:(0,xe.extractUserId)(e),scopes:["user:edit"],query:{description:t.description}});return new Fx.HelixPrivilegedUser(r.data[0],this._client)}async getBlocks(e,t){let r=await this._client.callApi({type:"helix",url:"users/blocks",userId:(0,xe.extractUserId)(e),scopes:["user:read:blocked_users"],query:{...(0,jx.createBroadcasterQuery)(e),...(0,WI.createPaginationQuery)(t)}});return(0,GI.createPaginatedResult)(r,Nx.HelixUserBlock,this._client)}getBlocksPaginated(e){return new QI.HelixPaginatedRequest({url:"users/blocks",userId:(0,xe.extractUserId)(e),scopes:["user:read:blocked_users"],query:(0,jx.createBroadcasterQuery)(e)},this._client,t=>new Nx.HelixUserBlock(t,this._client))}async createBlock(e,t,r={}){await this._client.callApi({type:"helix",url:"users/blocks",method:"PUT",userId:(0,xe.extractUserId)(e),scopes:["user:manage:blocked_users"],query:(0,kx.createUserBlockCreateQuery)(t,r)})}async deleteBlock(e,t){await this._client.callApi({type:"helix",url:"users/blocks",method:"DELETE",userId:(0,xe.extractUserId)(e),scopes:["user:manage:blocked_users"],query:(0,kx.createUserBlockDeleteQuery)(t)})}async getExtensionsForAuthenticatedUser(e,t=!1){return(await this._client.callApi({type:"helix",url:"users/extensions/list",userId:(0,xe.extractUserId)(e),scopes:t?["channel:manage:extensions"]:["user:read:broadcast","channel:manage:extensions"]})).data.map(a=>new $I.HelixUserExtension(a))}async getActiveExtensions(e,t=!1){let r=(0,xe.extractUserId)(e),a=await this._client.callApi({type:"helix",url:"users/extensions",userId:r,scopes:t?["user:read:broadcast","channel:manage:extensions"]:void 0,query:(0,NI.createSingleKeyQuery)("user_id",r)});return new Lx.HelixInstalledExtensionList(a.data)}async updateActiveExtensionsForAuthenticatedUser(e,t){let r=await this._client.callApi({type:"helix",url:"users/extensions",method:"PUT",userId:(0,xe.extractUserId)(e),scopes:["channel:manage:extensions"],jsonBody:{data:t}});return new Lx.HelixInstalledExtensionList(r.data)}async _getUsers(e,t){if(t.length===0)return[];let r={[e]:t};return(await this._client.callApi({type:"helix",url:"users",query:r})).data.map(s=>new qu.HelixUser(s,this._client))}};Qa.HelixUserApi=Na;I_.__decorate([(0,T_.Enumerable)(!1)],Na.prototype,"_getUserByIdBatcher",void 0);I_.__decorate([(0,T_.Enumerable)(!1)],Na.prototype,"_getUserByNameBatcher",void 0);Qa.HelixUserApi=Na=I_.__decorate([(0,xe.rtfm)("api","HelixUserApi")],Na)});var B_=u(Wa=>{"use strict";Object.defineProperty(Wa,"__esModule",{value:!0});Wa.HelixVideo=void 0;var U_=(b(),x(g)),Qx=Hi(),zI=C(),j=m(),Ga=class extends j.DataObject{static{n(this,"HelixVideo")}constructor(e,t){super(e),this._client=t}get id(){return this[j.rawDataSymbol].id}get userId(){return this[j.rawDataSymbol].user_id}get userName(){return this[j.rawDataSymbol].user_login}get userDisplayName(){return this[j.rawDataSymbol].user_name}async getUser(){return(0,j.checkRelationAssertion)(await this._client.users.getUserById(this[j.rawDataSymbol].user_id))}get title(){return this[j.rawDataSymbol].title}get description(){return this[j.rawDataSymbol].description}get creationDate(){return new Date(this[j.rawDataSymbol].created_at)}get publishDate(){return new Date(this[j.rawDataSymbol].published_at)}get url(){return this[j.rawDataSymbol].url}get thumbnailUrl(){return this[j.rawDataSymbol].thumbnail_url}getThumbnailUrl(e,t){return this[j.rawDataSymbol].thumbnail_url.replace("%{width}",e.toString()).replace("%{height}",t.toString())}get isPublic(){return this[j.rawDataSymbol].viewable==="public"}get views(){return this[j.rawDataSymbol].view_count}get language(){return this[j.rawDataSymbol].language}get type(){return this[j.rawDataSymbol].type}get duration(){return this[j.rawDataSymbol].duration}get durationInSeconds(){let e=this[j.rawDataSymbol].duration.match(/\d+[hms]/g);if(!e)throw new j.HellFreezesOverError(`Could not parse duration string: ${this[j.rawDataSymbol].duration}`);return e.map(t=>{let r=/(\d+)([hms])/.exec(t);if(!r)throw new j.HellFreezesOverError(`Could not parse partial duration string: ${t}`);let[,a,s]=r;return parseInt(a,10)*{h:3600,m:60,s:1}[s]}).reduce((t,r)=>t+r)}get streamId(){return this[j.rawDataSymbol].stream_id}get mutedSegmentData(){var e,t;return(t=(e=this[j.rawDataSymbol].muted_segments)===null||e===void 0?void 0:e.slice())!==null&&t!==void 0?t:[]}isMutedAt(e,t,r=!1){if(this[j.rawDataSymbol].muted_segments===null)return!1;if(t==null)return this[j.rawDataSymbol].muted_segments.some(s=>s.offset<=e&&e<=s.offset+s.duration);let a=e+t;return r?this[j.rawDataSymbol].muted_segments.some(s=>{let o=s.offset+s.duration;return e<o&&s.offset<a}):this[j.rawDataSymbol].muted_segments.some(s=>{let o=s.offset+s.duration;return s.offset<=e&&a<=o})}};Wa.HelixVideo=Ga;U_.__decorate([(0,zI.Enumerable)(!1)],Ga.prototype,"_client",void 0);U_.__decorate([(0,Qx.CachedGetter)()],Ga.prototype,"durationInSeconds",null);Wa.HelixVideo=Ga=U_.__decorate([Qx.Cacheable,(0,j.rtfm)("api","HelixVideo","id")],Ga)});var j_=u(Va=>{"use strict";var Eu;Object.defineProperty(Va,"__esModule",{value:!0});Va.HelixVideoApi=void 0;var Gx=(b(),x(g)),KI=C(),Pu=m(),JI=Lt(),ZI=oe(),XI=he(),YI=le(),e1=G(),O_=B_(),Au=Eu=class extends e1.BaseApi{static{n(this,"HelixVideoApi")}constructor(){super(...arguments),this._getVideoByIdBatcher=new JI.HelixRequestBatcher({url:"videos"},"id","id",this._client,e=>new O_.HelixVideo(e,this._client))}async getVideosByIds(e){return(await this._getVideos("id",e)).data}async getVideoById(e){let t=await this.getVideosByIds([e]);return t.length?t[0]:null}async getVideoByIdBatched(e){return await this._getVideoByIdBatcher.request(e)}async getVideosByUser(e,t={}){let r=(0,Pu.extractUserId)(e);return await this._getVideos("user_id",[r],t)}getVideosByUserPaginated(e,t={}){let r=(0,Pu.extractUserId)(e);return this._getVideosPaginated("user_id",[r],t)}async getVideosByGame(e,t={}){return await this._getVideos("game_id",[e],t)}getVideosByGamePaginated(e,t={}){return this._getVideosPaginated("game_id",[e],t)}async deleteVideosByIds(e,t){await this._client.callApi({type:"helix",url:"videos",method:"DELETE",scopes:["channel:manage:videos"],userId:(0,Pu.extractUserId)(e),query:{id:t}})}async _getVideos(e,t,r={}){if(!t.length)return{data:[]};let a=await this._client.callApi({type:"helix",url:"videos",userId:e==="user_id"?t[0]:void 0,query:{...Eu._makeVideosQuery(e,t,r),...(0,YI.createPaginationQuery)(r)}});return(0,XI.createPaginatedResult)(a,O_.HelixVideo,this._client)}_getVideosPaginated(e,t,r={}){return new ZI.HelixPaginatedRequest({url:"videos",userId:e==="user_id"?t[0]:void 0,query:Eu._makeVideosQuery(e,t,r)},this._client,a=>new O_.HelixVideo(a,this._client))}static _makeVideosQuery(e,t,r={}){let{language:a,period:s,orderBy:o,type:l}=r;return{[e]:t,language:a,period:s,sort:o,type:l}}};Va.HelixVideoApi=Au;Gx.__decorate([(0,KI.Enumerable)(!1)],Au.prototype,"_getVideoByIdBatcher",void 0);Va.HelixVideoApi=Au=Eu=Gx.__decorate([(0,Pu.rtfm)("api","HelixVideoApi")],Au)});var Vx=u(Du=>{"use strict";Object.defineProperty(Du,"__esModule",{value:!0});Du.createWhisperQuery=void 0;var Wx=m();function t1(i,e){return{from_user_id:(0,Wx.extractUserId)(i),to_user_id:(0,Wx.extractUserId)(e)}}n(t1,"createWhisperQuery");Du.createWhisperQuery=t1});var M_=u($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});$a.HelixWhisperApi=void 0;var r1=(b(),x(g)),$x=m(),i1=Vx(),n1=G(),k_=class extends n1.BaseApi{static{n(this,"HelixWhisperApi")}async sendWhisper(e,t,r){await this._client.callApi({type:"helix",url:"whispers",method:"POST",userId:(0,$x.extractUserId)(e),scopes:["user:manage:whispers"],query:(0,i1.createWhisperQuery)(e,t),jsonBody:{message:r}})}};$a.HelixWhisperApi=k_;$a.HelixWhisperApi=k_=r1.__decorate([(0,$x.rtfm)("api","HelixWhisperApi")],k_)});var F_=u(Iu=>{"use strict";Object.defineProperty(Iu,"__esModule",{value:!0});Iu.ApiReportedRequest=void 0;var L_=class{static{n(this,"ApiReportedRequest")}constructor(e,t,r){this._options=e,this._httpStatus=t,this._resolvedUserId=r}get options(){return this._options}get httpStatus(){return this._httpStatus}get resolvedUserId(){return this._resolvedUserId}};Iu.ApiReportedRequest=L_});var Ru=u(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});za.BaseApiClient=void 0;var W=(b(),x(g)),V=Hi(),a1=ro(),s1=C(),o1=ud(),ci=Y(),Tu=Ed(),zx=m(),l1=lg(),u1=Bd(),c1=Kd(),d1=Yd(),h1=ah(),p1=Eh(),_1=Ih(),m1=Bh(),y1=Lh(),f1=Kh(),g1=rp(),b1=ap(),x1=lp(),w1=hp(),v1=Ap(),S1=Up(),H1=Mp(),C1=Gp(),q1=Zp(),E1=e_(),P1=l_(),A1=p_(),D1=g_(),I1=R_(),T1=j_(),R1=M_(),U1=F_(),N=class extends o1.EventEmitter{static{n(this,"BaseApiClient")}constructor(e,t,r){super(),this.onRequest=this.registerEvent(),this._config=e,this._logger=t,this._rateLimiter=r}async requestScopesForUser(e,t){await this._config.authProvider.getAccessTokenForUser(e,...t.map(r=>[r]))}async getTokenInfo(){try{let e=await this.callApi({type:"auth",url:"validate"});return new Tu.TokenInfo(e)}catch(e){throw e instanceof ci.HttpStatusCodeError&&e.statusCode===401?new Tu.InvalidTokenError({cause:e}):e}}async callApi(e){var t;let{authProvider:r}=this._config;if(!((t=e.auth)!==null&&t!==void 0?t:!0))return await(0,ci.callTwitchApi)(e,r.clientId,void 0,void 0,this._config.fetchOptions);let s=!1;if(e.forceType)switch(e.forceType){case"app":{if(!r.getAppAccessToken)throw new Error("Tried to make an API call that requires an app access token but your auth provider does not support that");let c=await r.getAppAccessToken();return await this._callApiUsingInitialToken(e,c)}case"user":{s=!0;break}default:throw new zx.HellFreezesOverError(`Unknown forced token type: ${e.forceType}`)}if(e.scopes&&(s=!0),s){let c=e.canOverrideScopedUserContext?this._getUserIdFromRequestContext(e.userId):e.userId;if(!c)throw new Error("Tried to make an API call with a user context but no context user ID");let h=await r.getAccessTokenForUser(c,e.scopes);if(!h)throw new Error(`Tried to make an API call with a user context for user ID ${c} but no token was found`);if((0,Tu.accessTokenIsExpired)(h)&&r.refreshAccessTokenForUser){let p=await r.refreshAccessTokenForUser(c);return await this._callApiUsingInitialToken(e,p,!0)}return await this._callApiUsingInitialToken(e,h)}let o=this._getUserIdFromRequestContext(e.userId),l=o===null?await r.getAnyAccessToken():await r.getAnyAccessToken(o??e.userId);if((0,Tu.accessTokenIsExpired)(l)&&l.userId&&r.refreshAccessTokenForUser){let c=await r.refreshAccessTokenForUser(l.userId);return await this._callApiUsingInitialToken(e,c,!0)}return await this._callApiUsingInitialToken(e,l)}get bits(){return new u1.HelixBitsApi(this)}get channels(){return new c1.HelixChannelApi(this)}get channelPoints(){return new d1.HelixChannelPointsApi(this)}get charity(){return new h1.HelixCharityApi(this)}get chat(){return new p1.HelixChatApi(this)}get clips(){return new _1.HelixClipApi(this)}get contentClassificationLabels(){return new m1.HelixContentClassificationLabelApi(this)}get entitlements(){return new y1.HelixEntitlementApi(this)}get eventSub(){return new f1.HelixEventSubApi(this)}get extensions(){return new g1.HelixExtensionsApi(this)}get games(){return new b1.HelixGameApi(this)}get hypeTrain(){return new w1.HelixHypeTrainApi(this)}get goals(){return new x1.HelixGoalApi(this)}get moderation(){return new v1.HelixModerationApi(this)}get polls(){return new S1.HelixPollApi(this)}get predictions(){return new H1.HelixPredictionApi(this)}get raids(){return new C1.HelixRaidApi(this)}get schedule(){return new q1.HelixScheduleApi(this)}get search(){return new E1.HelixSearchApi(this)}get streams(){return new P1.HelixStreamApi(this)}get subscriptions(){return new A1.HelixSubscriptionApi(this)}get teams(){return new D1.HelixTeamApi(this)}get users(){return new I1.HelixUserApi(this)}get videos(){return new T1.HelixVideoApi(this)}get whispers(){return new R1.HelixWhisperApi(this)}get rateLimiterStats(){return this._rateLimiter instanceof a1.ResponseBasedRateLimiter?this._rateLimiter.stats:null}get _authProvider(){return this._config.authProvider}get _mockServerPort(){return this._config.mockServerPort}get _batchDelay(){var e;return(e=this._config.batchDelay)!==null&&e!==void 0?e:0}_getUserIdFromRequestContext(e){return e}async _callApiUsingInitialToken(e,t,r=!1){var a;let{authProvider:s}=this._config,{authorizationType:o}=s,l=await this._callApiInternal(e,s.clientId,t.accessToken,o);if(l.status===401&&!r){if(t.userId){if(s.refreshAccessTokenForUser){let c=await s.refreshAccessTokenForUser(t.userId);l=await this._callApiInternal(e,s.clientId,c.accessToken,o)}}else if(s.getAppAccessToken){let c=await s.getAppAccessToken(!0);l=await this._callApiInternal(e,s.clientId,c.accessToken,o)}}return this.emit(this.onRequest,new U1.ApiReportedRequest(e,l.status,(a=t.userId)!==null&&a!==void 0?a:null)),await(0,ci.handleTwitchApiResponseError)(l,e),await(0,ci.transformTwitchApiResponse)(l)}async _callApiInternal(e,t,r,a){var s,o,l;let{fetchOptions:c,mockServerPort:h}=this._config,p=(s=e.type)!==null&&s!==void 0?s:"helix";this._logger.debug(`Calling ${p} API: ${(o=e.method)!==null&&o!==void 0?o:"GET"} ${e.url}`),this._logger.trace(`Query: ${JSON.stringify(e.query)}`),e.jsonBody&&this._logger.trace(`Request body: ${JSON.stringify(e.jsonBody)}`);let w=l1.operation({retries:3,minTimeout:500,factor:2}),{promise:E,resolve:P,reject:y}=(0,s1.promiseWithResolvers)();w.attempt(async()=>{try{let v=p==="helix"?await this._rateLimiter.request({options:e,clientId:t,accessToken:r,authorizationType:a,fetchOptions:c,mockServerPort:h}):await(0,ci.callTwitchApiRaw)(e,t,r,a,c,h);!v.ok&&v.status>=500&&v.status<600&&await(0,ci.handleTwitchApiResponseError)(v,e),P(v)}catch(v){if(w.retry(v))return;y(w.mainError())}});let q=await E;return this._logger.debug(`Called ${p} API: ${(l=e.method)!==null&&l!==void 0?l:"GET"} ${e.url} - result: ${q.status}`),q}};za.BaseApiClient=N;W.__decorate([(0,V.CachedGetter)()],N.prototype,"bits",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"channels",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"channelPoints",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"charity",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"chat",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"clips",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"contentClassificationLabels",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"entitlements",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"eventSub",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"extensions",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"games",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"hypeTrain",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"goals",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"moderation",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"polls",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"predictions",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"raids",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"schedule",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"search",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"streams",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"subscriptions",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"teams",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"users",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"videos",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"whispers",null);za.BaseApiClient=N=W.__decorate([V.Cacheable,(0,zx.rtfm)("api","ApiClient")],N)});var Kx=u(Ka=>{"use strict";Object.defineProperty(Ka,"__esModule",{value:!0});Ka.NoContextApiClient=void 0;var B1=(b(),x(g)),O1=m(),j1=Ru(),N_=class extends j1.BaseApiClient{static{n(this,"NoContextApiClient")}_getUserIdFromRequestContext(){return null}};Ka.NoContextApiClient=N_;Ka.NoContextApiClient=N_=B1.__decorate([(0,O1.rtfm)("api","ApiClient")],N_)});var Jx=u(Ja=>{"use strict";Object.defineProperty(Ja,"__esModule",{value:!0});Ja.UserContextApiClient=void 0;var k1=(b(),x(g)),M1=m(),L1=Ru(),Q_=class extends L1.BaseApiClient{static{n(this,"UserContextApiClient")}constructor(e,t,r,a){super(e,t,r),this._userId=a}_getUserIdFromRequestContext(){return this._userId}};Ja.UserContextApiClient=Q_;Ja.UserContextApiClient=Q_=k1.__decorate([(0,M1.rtfm)("api","ApiClient")],Q_)});var ew=u(Za=>{"use strict";Object.defineProperty(Za,"__esModule",{value:!0});Za.ApiClient=void 0;var F1=(b(),x(g)),N1=yi(),Q1=gi(),Zx=ro(),G1=Y(),Yx=m(),W1=nd(),V1=Mf(),$1=Ru(),z1=Kx(),Xx=Jx(),G_=class extends $1.BaseApiClient{static{n(this,"ApiClient")}constructor(e){if(!e.authProvider)throw new W1.ConfigError("No auth provider given. Please supply the `authProvider` option.");let t={name:"twurple:api:rate-limiter",...e.logger};super(e,(0,Q1.createLogger)({name:"twurple:api:client",...e.logger}),N1.isNode?new Zx.PartitionedRateLimiter({getPartitionKey:n(r=>{var a;return(a=r.userId)!==null&&a!==void 0?a:null},"getPartitionKey"),createChild:n(()=>new V1.HelixRateLimiter({logger:t}),"createChild")}):new Zx.PartitionedTimeBasedRateLimiter({logger:t,bucketSize:800,timeFrame:64e3,doRequest:n(async({options:r,clientId:a,accessToken:s,authorizationType:o,fetchOptions:l,mockServerPort:c})=>await(0,G1.callTwitchApiRaw)(r,a,s,o,l,c),"doRequest"),getPartitionKey:n(r=>{var a;return(a=r.userId)!==null&&a!==void 0?a:null},"getPartitionKey")}))}async asUser(e,t){let r=new Xx.UserContextApiClient(this._config,this._logger,this._rateLimiter,(0,Yx.extractUserId)(e));return await t(r)}async asIntent(e,t){if(!this._authProvider.getAccessTokenForIntent)throw new Error("Trying to use intents with an auth provider that does not support them");for(let r of e){let a=await this._authProvider.getAccessTokenForIntent(r);if(a){let s=new Xx.UserContextApiClient(this._config,this._logger,this._rateLimiter,a.userId);return await t(s)}}throw new Error(`Intents [${e.join(", ")}] not found in auth provider`)}async withoutUser(e){let t=new z1.NoContextApiClient(this._config,this._logger,this._rateLimiter);return await e(t)}};Za.ApiClient=G_;Za.ApiClient=G_=F1.__decorate([(0,Yx.rtfm)("api","ApiClient")],G_)});var rw=u(Xa=>{"use strict";Object.defineProperty(Xa,"__esModule",{value:!0});Xa.HelixFollow=void 0;var tw=(b(),x(g)),K1=C(),Me=m(),Uu=class extends Me.DataObject{static{n(this,"HelixFollow")}constructor(e,t){super(e),this._client=t}get userId(){return this[Me.rawDataSymbol].from_id}get userName(){return this[Me.rawDataSymbol].from_login}get userDisplayName(){return this[Me.rawDataSymbol].from_name}async getUser(){return(0,Me.checkRelationAssertion)(await this._client.users.getUserById(this[Me.rawDataSymbol].from_id))}get followedUserId(){return this[Me.rawDataSymbol].to_id}get followedUserName(){return this[Me.rawDataSymbol].to_login}get followedUserDisplayName(){return this[Me.rawDataSymbol].to_name}async getFollowedUser(){return(0,Me.checkRelationAssertion)(await this._client.users.getUserById(this[Me.rawDataSymbol].to_id))}get followDate(){return new Date(this[Me.rawDataSymbol].followed_at)}};Xa.HelixFollow=Uu;tw.__decorate([(0,K1.Enumerable)(!1)],Uu.prototype,"_client",void 0);Xa.HelixFollow=Uu=tw.__decorate([(0,Me.rtfm)("api","HelixFollow")],Uu)});var iw=u(d=>{"use strict";Object.defineProperty(d,"__esModule",{value:!0});d.HelixGoal=d.HelixGoalApi=d.HelixGame=d.HelixGameApi=d.HelixExtensionTransaction=d.HelixExtensionBitsProduct=d.HelixExtensionsApi=d.HelixPaginatedEventSubSubscriptionsRequest=d.HelixEventSubSubscription=d.HelixEventSubConduitShard=d.HelixEventSubConduit=d.HelixEventSubApi=d.HelixDropsEntitlement=d.HelixEntitlementApi=d.HelixContentClassificationLabel=d.HelixContentClassificationLabelApi=d.HelixClip=d.HelixClipApi=d.HelixSharedChatSession=d.HelixSharedChatSessionParticipant=d.HelixSentChatMessage=d.HelixPrivilegedChatSettings=d.HelixUserEmote=d.HelixEmoteFromSet=d.HelixChannelEmote=d.HelixEmote=d.HelixChatChatter=d.HelixChatSettings=d.HelixChatBadgeVersion=d.HelixChatBadgeSet=d.HelixChatApi=d.HelixCharityCampaignAmount=d.HelixCharityCampaignDonation=d.HelixCharityCampaign=d.HelixCharityApi=d.HelixCustomRewardRedemption=d.HelixCustomReward=d.HelixChannelPointsApi=d.HelixChannelReference=d.HelixFollowedChannel=d.HelixChannelFollower=d.HelixChannelEditor=d.HelixChannel=d.HelixAdSchedule=d.HelixChannelApi=d.HelixCheermoteList=d.HelixBitsLeaderboardEntry=d.HelixBitsLeaderboard=d.HelixBitsApi=d.ApiClient=void 0;d.HelixVideo=d.HelixVideoApi=d.HelixUserExtension=d.HelixInstalledExtensionList=d.HelixInstalledExtension=d.HelixBaseExtension=d.HelixUser=d.HelixPrivilegedUser=d.HelixFollow=d.HelixUserBlock=d.HelixUserApi=d.HelixTeamWithUsers=d.HelixTeam=d.HelixTeamApi=d.HelixUserSubscription=d.HelixSubscription=d.HelixSubscriptionApi=d.HelixPaginatedSubscriptionsRequest=d.HelixStreamMarkerWithVideo=d.HelixStreamMarker=d.HelixStream=d.HelixStreamApi=d.HelixChannelSearchResult=d.HelixSearchApi=d.HelixPaginatedScheduleSegmentRequest=d.HelixScheduleSegment=d.HelixSchedule=d.HelixScheduleApi=d.HelixUserRelation=d.HelixRaid=d.HelixRaidApi=d.HelixPredictor=d.HelixPredictionOutcome=d.HelixPrediction=d.HelixPredictionApi=d.HelixPollChoice=d.HelixPoll=d.HelixPollApi=d.HelixWarning=d.HelixUnbanRequest=d.HelixShieldModeStatus=d.HelixBlockedTerm=d.HelixBanUser=d.HelixModeratedChannel=d.HelixModerator=d.HelixBan=d.HelixModerationApi=d.HelixHypeTrainEvent=d.HelixHypeTrainContribution=d.HelixHypeTrainApi=void 0;d.HellFreezesOverError=d.HelixExtension=d.extractUserName=d.extractUserId=d.HelixPaginatedRequestWithTotal=d.HelixPaginatedRequest=d.ApiReportedRequest=d.StreamNotLiveError=d.ConfigError=d.HelixWhisperApi=void 0;var J1=ew();Object.defineProperty(d,"ApiClient",{enumerable:!0,get:n(function(){return J1.ApiClient},"get")});var Z1=Bd();Object.defineProperty(d,"HelixBitsApi",{enumerable:!0,get:n(function(){return Z1.HelixBitsApi},"get")});var X1=Dd();Object.defineProperty(d,"HelixBitsLeaderboard",{enumerable:!0,get:n(function(){return X1.HelixBitsLeaderboard},"get")});var Y1=Pd();Object.defineProperty(d,"HelixBitsLeaderboardEntry",{enumerable:!0,get:n(function(){return Y1.HelixBitsLeaderboardEntry},"get")});var eT=Td();Object.defineProperty(d,"HelixCheermoteList",{enumerable:!0,get:n(function(){return eT.HelixCheermoteList},"get")});var tT=Kd();Object.defineProperty(d,"HelixChannelApi",{enumerable:!0,get:n(function(){return tT.HelixChannelApi},"get")});var rT=Gd();Object.defineProperty(d,"HelixAdSchedule",{enumerable:!0,get:n(function(){return rT.HelixAdSchedule},"get")});var iT=Md();Object.defineProperty(d,"HelixChannel",{enumerable:!0,get:n(function(){return iT.HelixChannel},"get")});var nT=Ld();Object.defineProperty(d,"HelixChannelEditor",{enumerable:!0,get:n(function(){return nT.HelixChannelEditor},"get")});var aT=Fd();Object.defineProperty(d,"HelixChannelFollower",{enumerable:!0,get:n(function(){return aT.HelixChannelFollower},"get")});var sT=Nd();Object.defineProperty(d,"HelixFollowedChannel",{enumerable:!0,get:n(function(){return sT.HelixFollowedChannel},"get")});var oT=Jh();Object.defineProperty(d,"HelixChannelReference",{enumerable:!0,get:n(function(){return oT.HelixChannelReference},"get")});var lT=Yd();Object.defineProperty(d,"HelixChannelPointsApi",{enumerable:!0,get:n(function(){return lT.HelixChannelPointsApi},"get")});var uT=Jd();Object.defineProperty(d,"HelixCustomReward",{enumerable:!0,get:n(function(){return uT.HelixCustomReward},"get")});var cT=Zd();Object.defineProperty(d,"HelixCustomRewardRedemption",{enumerable:!0,get:n(function(){return cT.HelixCustomRewardRedemption},"get")});var dT=ah();Object.defineProperty(d,"HelixCharityApi",{enumerable:!0,get:n(function(){return dT.HelixCharityApi},"get")});var hT=th();Object.defineProperty(d,"HelixCharityCampaign",{enumerable:!0,get:n(function(){return hT.HelixCharityCampaign},"get")});var pT=rh();Object.defineProperty(d,"HelixCharityCampaignDonation",{enumerable:!0,get:n(function(){return pT.HelixCharityCampaignDonation},"get")});var _T=al();Object.defineProperty(d,"HelixCharityCampaignAmount",{enumerable:!0,get:n(function(){return _T.HelixCharityCampaignAmount},"get")});var mT=Eh();Object.defineProperty(d,"HelixChatApi",{enumerable:!0,get:n(function(){return mT.HelixChatApi},"get")});var yT=ph();Object.defineProperty(d,"HelixChatBadgeSet",{enumerable:!0,get:n(function(){return yT.HelixChatBadgeSet},"get")});var fT=hh();Object.defineProperty(d,"HelixChatBadgeVersion",{enumerable:!0,get:n(function(){return fT.HelixChatBadgeVersion},"get")});var gT=pl();Object.defineProperty(d,"HelixChatSettings",{enumerable:!0,get:n(function(){return gT.HelixChatSettings},"get")});var bT=_h();Object.defineProperty(d,"HelixChatChatter",{enumerable:!0,get:n(function(){return bT.HelixChatChatter},"get")});var xT=sn();Object.defineProperty(d,"HelixEmote",{enumerable:!0,get:n(function(){return xT.HelixEmote},"get")});var wT=ch();Object.defineProperty(d,"HelixChannelEmote",{enumerable:!0,get:n(function(){return wT.HelixChannelEmote},"get")});var vT=yh();Object.defineProperty(d,"HelixEmoteFromSet",{enumerable:!0,get:n(function(){return vT.HelixEmoteFromSet},"get")});var ST=fh();Object.defineProperty(d,"HelixUserEmote",{enumerable:!0,get:n(function(){return ST.HelixUserEmote},"get")});var HT=xh();Object.defineProperty(d,"HelixPrivilegedChatSettings",{enumerable:!0,get:n(function(){return HT.HelixPrivilegedChatSettings},"get")});var CT=vh();Object.defineProperty(d,"HelixSentChatMessage",{enumerable:!0,get:n(function(){return CT.HelixSentChatMessage},"get")});var qT=Sh();Object.defineProperty(d,"HelixSharedChatSessionParticipant",{enumerable:!0,get:n(function(){return qT.HelixSharedChatSessionParticipant},"get")});var ET=Hh();Object.defineProperty(d,"HelixSharedChatSession",{enumerable:!0,get:n(function(){return ET.HelixSharedChatSession},"get")});var PT=Ih();Object.defineProperty(d,"HelixClipApi",{enumerable:!0,get:n(function(){return PT.HelixClipApi},"get")});var AT=Ph();Object.defineProperty(d,"HelixClip",{enumerable:!0,get:n(function(){return AT.HelixClip},"get")});var DT=Bh();Object.defineProperty(d,"HelixContentClassificationLabelApi",{enumerable:!0,get:n(function(){return DT.HelixContentClassificationLabelApi},"get")});var IT=Rh();Object.defineProperty(d,"HelixContentClassificationLabel",{enumerable:!0,get:n(function(){return IT.HelixContentClassificationLabel},"get")});var TT=Lh();Object.defineProperty(d,"HelixEntitlementApi",{enumerable:!0,get:n(function(){return TT.HelixEntitlementApi},"get")});var RT=Oh();Object.defineProperty(d,"HelixDropsEntitlement",{enumerable:!0,get:n(function(){return RT.HelixDropsEntitlement},"get")});var UT=Kh();Object.defineProperty(d,"HelixEventSubApi",{enumerable:!0,get:n(function(){return UT.HelixEventSubApi},"get")});var BT=Qh();Object.defineProperty(d,"HelixEventSubConduit",{enumerable:!0,get:n(function(){return BT.HelixEventSubConduit},"get")});var OT=Wh();Object.defineProperty(d,"HelixEventSubConduitShard",{enumerable:!0,get:n(function(){return OT.HelixEventSubConduitShard},"get")});var jT=El();Object.defineProperty(d,"HelixEventSubSubscription",{enumerable:!0,get:n(function(){return jT.HelixEventSubSubscription},"get")});var kT=Nh();Object.defineProperty(d,"HelixPaginatedEventSubSubscriptionsRequest",{enumerable:!0,get:n(function(){return kT.HelixPaginatedEventSubSubscriptionsRequest},"get")});var MT=rp();Object.defineProperty(d,"HelixExtensionsApi",{enumerable:!0,get:n(function(){return MT.HelixExtensionsApi},"get")});var LT=Xh();Object.defineProperty(d,"HelixExtensionBitsProduct",{enumerable:!0,get:n(function(){return LT.HelixExtensionBitsProduct},"get")});var FT=Yh();Object.defineProperty(d,"HelixExtensionTransaction",{enumerable:!0,get:n(function(){return FT.HelixExtensionTransaction},"get")});var NT=ap();Object.defineProperty(d,"HelixGameApi",{enumerable:!0,get:n(function(){return NT.HelixGameApi},"get")});var QT=Ul();Object.defineProperty(d,"HelixGame",{enumerable:!0,get:n(function(){return QT.HelixGame},"get")});var GT=lp();Object.defineProperty(d,"HelixGoalApi",{enumerable:!0,get:n(function(){return GT.HelixGoalApi},"get")});var WT=sp();Object.defineProperty(d,"HelixGoal",{enumerable:!0,get:n(function(){return WT.HelixGoal},"get")});var VT=hp();Object.defineProperty(d,"HelixHypeTrainApi",{enumerable:!0,get:n(function(){return VT.HelixHypeTrainApi},"get")});var $T=up();Object.defineProperty(d,"HelixHypeTrainContribution",{enumerable:!0,get:n(function(){return $T.HelixHypeTrainContribution},"get")});var zT=cp();Object.defineProperty(d,"HelixHypeTrainEvent",{enumerable:!0,get:n(function(){return zT.HelixHypeTrainEvent},"get")});var KT=Ap();Object.defineProperty(d,"HelixModerationApi",{enumerable:!0,get:n(function(){return KT.HelixModerationApi},"get")});var JT=gp();Object.defineProperty(d,"HelixBan",{enumerable:!0,get:n(function(){return JT.HelixBan},"get")});var ZT=vp();Object.defineProperty(d,"HelixModerator",{enumerable:!0,get:n(function(){return ZT.HelixModerator},"get")});var XT=wp();Object.defineProperty(d,"HelixModeratedChannel",{enumerable:!0,get:n(function(){return XT.HelixModeratedChannel},"get")});var YT=Fl();Object.defineProperty(d,"HelixBanUser",{enumerable:!0,get:n(function(){return YT.HelixBanUser},"get")});var eR=xp();Object.defineProperty(d,"HelixBlockedTerm",{enumerable:!0,get:n(function(){return eR.HelixBlockedTerm},"get")});var tR=Sp();Object.defineProperty(d,"HelixShieldModeStatus",{enumerable:!0,get:n(function(){return tR.HelixShieldModeStatus},"get")});var rR=Hp();Object.defineProperty(d,"HelixUnbanRequest",{enumerable:!0,get:n(function(){return rR.HelixUnbanRequest},"get")});var iR=Cp();Object.defineProperty(d,"HelixWarning",{enumerable:!0,get:n(function(){return iR.HelixWarning},"get")});var nR=Up();Object.defineProperty(d,"HelixPollApi",{enumerable:!0,get:n(function(){return nR.HelixPollApi},"get")});var aR=Tp();Object.defineProperty(d,"HelixPoll",{enumerable:!0,get:n(function(){return aR.HelixPoll},"get")});var sR=Ip();Object.defineProperty(d,"HelixPollChoice",{enumerable:!0,get:n(function(){return sR.HelixPollChoice},"get")});var oR=Mp();Object.defineProperty(d,"HelixPredictionApi",{enumerable:!0,get:n(function(){return oR.HelixPredictionApi},"get")});var lR=jp();Object.defineProperty(d,"HelixPrediction",{enumerable:!0,get:n(function(){return lR.HelixPrediction},"get")});var uR=Op();Object.defineProperty(d,"HelixPredictionOutcome",{enumerable:!0,get:n(function(){return uR.HelixPredictionOutcome},"get")});var cR=Bp();Object.defineProperty(d,"HelixPredictor",{enumerable:!0,get:n(function(){return cR.HelixPredictor},"get")});var dR=Gp();Object.defineProperty(d,"HelixRaidApi",{enumerable:!0,get:n(function(){return dR.HelixRaidApi},"get")});var hR=Fp();Object.defineProperty(d,"HelixRaid",{enumerable:!0,get:n(function(){return hR.HelixRaid},"get")});var pR=Qo();Object.defineProperty(d,"HelixUserRelation",{enumerable:!0,get:n(function(){return pR.HelixUserRelation},"get")});var _R=Zp();Object.defineProperty(d,"HelixScheduleApi",{enumerable:!0,get:n(function(){return _R.HelixScheduleApi},"get")});var mR=zp();Object.defineProperty(d,"HelixSchedule",{enumerable:!0,get:n(function(){return mR.HelixSchedule},"get")});var yR=fa();Object.defineProperty(d,"HelixScheduleSegment",{enumerable:!0,get:n(function(){return yR.HelixScheduleSegment},"get")});var fR=$p();Object.defineProperty(d,"HelixPaginatedScheduleSegmentRequest",{enumerable:!0,get:n(function(){return fR.HelixPaginatedScheduleSegmentRequest},"get")});var gR=e_();Object.defineProperty(d,"HelixSearchApi",{enumerable:!0,get:n(function(){return gR.HelixSearchApi},"get")});var bR=Xp();Object.defineProperty(d,"HelixChannelSearchResult",{enumerable:!0,get:n(function(){return bR.HelixChannelSearchResult},"get")});var xR=l_();Object.defineProperty(d,"HelixStreamApi",{enumerable:!0,get:n(function(){return xR.HelixStreamApi},"get")});var wR=i_();Object.defineProperty(d,"HelixStream",{enumerable:!0,get:n(function(){return wR.HelixStream},"get")});var vR=uu();Object.defineProperty(d,"HelixStreamMarker",{enumerable:!0,get:n(function(){return vR.HelixStreamMarker},"get")});var SR=s_();Object.defineProperty(d,"HelixStreamMarkerWithVideo",{enumerable:!0,get:n(function(){return SR.HelixStreamMarkerWithVideo},"get")});var HR=d_();Object.defineProperty(d,"HelixPaginatedSubscriptionsRequest",{enumerable:!0,get:n(function(){return HR.HelixPaginatedSubscriptionsRequest},"get")});var CR=p_();Object.defineProperty(d,"HelixSubscriptionApi",{enumerable:!0,get:n(function(){return CR.HelixSubscriptionApi},"get")});var qR=yu();Object.defineProperty(d,"HelixSubscription",{enumerable:!0,get:n(function(){return qR.HelixSubscription},"get")});var ER=mu();Object.defineProperty(d,"HelixUserSubscription",{enumerable:!0,get:n(function(){return ER.HelixUserSubscription},"get")});var PR=g_();Object.defineProperty(d,"HelixTeamApi",{enumerable:!0,get:n(function(){return PR.HelixTeamApi},"get")});var AR=bu();Object.defineProperty(d,"HelixTeam",{enumerable:!0,get:n(function(){return AR.HelixTeam},"get")});var DR=m_();Object.defineProperty(d,"HelixTeamWithUsers",{enumerable:!0,get:n(function(){return DR.HelixTeamWithUsers},"get")});var IR=R_();Object.defineProperty(d,"HelixUserApi",{enumerable:!0,get:n(function(){return IR.HelixUserApi},"get")});var TR=D_();Object.defineProperty(d,"HelixUserBlock",{enumerable:!0,get:n(function(){return TR.HelixUserBlock},"get")});var RR=rw();Object.defineProperty(d,"HelixFollow",{enumerable:!0,get:n(function(){return RR.HelixFollow},"get")});var UR=A_();Object.defineProperty(d,"HelixPrivilegedUser",{enumerable:!0,get:n(function(){return UR.HelixPrivilegedUser},"get")});var BR=Hu();Object.defineProperty(d,"HelixUser",{enumerable:!0,get:n(function(){return BR.HelixUser},"get")});var OR=vu();Object.defineProperty(d,"HelixBaseExtension",{enumerable:!0,get:n(function(){return OR.HelixBaseExtension},"get")});var jR=w_();Object.defineProperty(d,"HelixInstalledExtension",{enumerable:!0,get:n(function(){return jR.HelixInstalledExtension},"get")});var kR=H_();Object.defineProperty(d,"HelixInstalledExtensionList",{enumerable:!0,get:n(function(){return kR.HelixInstalledExtensionList},"get")});var MR=E_();Object.defineProperty(d,"HelixUserExtension",{enumerable:!0,get:n(function(){return MR.HelixUserExtension},"get")});var LR=j_();Object.defineProperty(d,"HelixVideoApi",{enumerable:!0,get:n(function(){return LR.HelixVideoApi},"get")});var FR=B_();Object.defineProperty(d,"HelixVideo",{enumerable:!0,get:n(function(){return FR.HelixVideo},"get")});var NR=M_();Object.defineProperty(d,"HelixWhisperApi",{enumerable:!0,get:n(function(){return NR.HelixWhisperApi},"get")});var QR=nd();Object.defineProperty(d,"ConfigError",{enumerable:!0,get:n(function(){return QR.ConfigError},"get")});var GR=r_();Object.defineProperty(d,"StreamNotLiveError",{enumerable:!0,get:n(function(){return GR.StreamNotLiveError},"get")});var WR=F_();Object.defineProperty(d,"ApiReportedRequest",{enumerable:!0,get:n(function(){return WR.ApiReportedRequest},"get")});var VR=oe();Object.defineProperty(d,"HelixPaginatedRequest",{enumerable:!0,get:n(function(){return VR.HelixPaginatedRequest},"get")});var $R=Gr();Object.defineProperty(d,"HelixPaginatedRequestWithTotal",{enumerable:!0,get:n(function(){return $R.HelixPaginatedRequestWithTotal},"get")});var Bu=m();Object.defineProperty(d,"extractUserId",{enumerable:!0,get:n(function(){return Bu.extractUserId},"get")});Object.defineProperty(d,"extractUserName",{enumerable:!0,get:n(function(){return Bu.extractUserName},"get")});Object.defineProperty(d,"HelixExtension",{enumerable:!0,get:n(function(){return Bu.HelixExtension},"get")});Object.defineProperty(d,"HellFreezesOverError",{enumerable:!0,get:n(function(){return Bu.HellFreezesOverError},"get")})});var cw=u((VG,uw)=>{var nw=Lu(),zR=Qu(),aw=ts(),Yt=It(),sw=Wu(),ow=$u(),lw=Ku(),Ou=Gm(),{ApiClient:KR}=iw(),{AppTokenAuthProvider:JR}=Ed(),W_=class{static{n(this,"EmoteFetcher")}constructor(e,t,r){if(r&&r.apiClient)this.apiClient=r.apiClient;else if(e!==void 0&&t!==void 0){let a=new JR(e,t);this.apiClient=new KR({authProvider:a})}this.emotes=new aw,this.channels=new aw,this.ffzModifiersFetched=!1}get globalChannel(){return this.channels.get(null)}_setupChannel(e,t=null){let r=this.channels.get(e);return r||(r=new zR(this,e),this.channels.set(e,r)),t&&(r.format=t),r}_getRawTwitchEmotes(e){if(!this.apiClient)throw new Error("Client id or client secret not provided.");return e?this.apiClient.chat.getChannelEmotes(e):this.apiClient.chat.getGlobalEmotes()}_cacheTwitchEmote(e,t,r=null){let a=this._setupChannel(e),s=r||new lw(a,t.id,t);return this.emotes.set(s.code,s),a.emotes.set(s.code,s),s}_getRawBTTVEmotes(e){let t=e?Yt.BTTV.Channel(e):Yt.BTTV.Global;return Ou.get(t).then(r=>r.data instanceof Array?r.data:[...r.data.channelEmotes,...r.data.sharedEmotes])}_cacheBTTVEmote(e,t,r=null){let a=this._setupChannel(e),s=r||new nw(a,t.id,t);return this.emotes.set(s.code,s),a.emotes.set(s.code,s),s}_getRawFFZEmoteSet(e){let t=Yt.FFZ.Set(e);return Ou.get(t).then(r=>r.data.set.emoticons)}_getRawFFZEmotes(e){let t=Yt.FFZ.Channel(e);return Ou.get(t).then(r=>{let a=[];for(let s of Object.keys(r.data.sets)){let o=r.data.sets[s];a.push(...o.emoticons)}return a})}_cacheFFZEmote(e,t,r=null){let a=this._setupChannel(e),s=r||new sw(a,t.id,t);return this.emotes.set(s.code,s),a.emotes.set(s.code,s),s}_getRawSevenTVEmotes(e){let t=e?Yt.SevenTV.Channel(e):Yt.SevenTV.Global;return Ou.get(t).then(r=>r.data)}_cacheSevenTVEmote(e,t,r,a=null){let s=this._setupChannel(e,r),o=a||new ow(s,t.id,t);return this.emotes.set(o.code,o),s.emotes.set(o.code,o),o}fetchTwitchEmotes(e=null){return this._getRawTwitchEmotes(e).then(t=>{for(let r of t)this._cacheTwitchEmote(e,{code:r.name,id:r.id,formats:r.formats});return this.channels.get(e).emotes.filter(r=>r.type==="twitch")})}fetchBTTVEmotes(e=null){return this._getRawBTTVEmotes(e).then(t=>{for(let r of t)this._cacheBTTVEmote(e,r);return this.channels.get(e).emotes.filter(r=>r.type==="bttv")})}async fetchFFZEmotes(e=null){return this.ffzModifiersFetched||(this.ffzModifiersFetched=!0,await this._getRawFFZEmoteSet(Yt.FFZ.sets.Modifiers).then(t=>{for(let r of t)this._cacheFFZEmote(null,r)})),e?this._getRawFFZEmotes(e).then(t=>{for(let r of t)this._cacheFFZEmote(e,r);return this.channels.get(e).emotes.filter(r=>r.type==="ffz")}):this._getRawFFZEmoteSet(Yt.FFZ.sets.Global).then(t=>{for(let r of t)this._cacheFFZEmote(e,r);return this.channels.get(e).emotes.filter(r=>r.type==="ffz")})}fetchSevenTVEmotes(e=null,t="webp"){return this._getRawSevenTVEmotes(e).then(r=>{if("emotes"in r)for(let a of r.emotes)this._cacheSevenTVEmote(e,a,t);else for(let a of r.emote_set.emotes)this._cacheSevenTVEmote(e,a,t);return this.channels.get(e).emotes.filter(a=>a.type==="7tv")})}fromObject(e){let t=[],r={bttv:{class:nw,cache:n((a,s,o)=>this._cacheBTTVEmote(s,null,o),"cache")},ffz:{class:sw,cache:n((a,s,o)=>this._cacheFFZEmote(s,null,o),"cache")},"7tv":{class:ow,cache:n((a,s,o)=>this._cacheSevenTVEmote(s,null,a.imageType,o),"cache")},twitch:{class:lw,cache:n((a,s,o)=>this._cacheTwitchEmote(s,null,o),"cache")}};for(let a of e){let{type:s}=a;if(!Object.keys(r).includes(s))throw new TypeError(`Unknown type: ${s}`);let o=r[s].class;this._setupChannel(a.channel_id,s==="7tv"?a.imageType:null);let l=o.fromObject(a,this.channels.get(a.channel_id));r[s].cache(a,a.channel_id,l),t.push(l)}return t}};uw.exports=W_});var hw=u((zG,dw)=>{var ZR=It(),V_=class{static{n(this,"EmoteParser")}constructor(e,t={}){this.fetcher=e,this.options=Object.assign({template:"",type:"markdown",match:/:(.+?):/g},t),this._validateOptions(this.options)}_validateOptions(e){if(e.template&&typeof e.template!="string")throw new TypeError("Template must be a string");if(!["markdown","html","bbcode","plain"].includes(e.type))throw new TypeError("Parse type must be one of `markdown`, `html`, `bbcode`, or `plain`");if(!(e.match instanceof RegExp)||!e.match.global)throw new TypeError("Match must be a global RegExp.")}parse(e,t=0){return e.replace(this.options.match,(a,s)=>{let o=this.fetcher.emotes.get(s);if(!o)return a;if(o.modifier)return"";let l=this.options.template||ZR.Templates[this.options.type],c=o.toLink(t);return l.replace(/{link}/g,c).replace(/{name}/g,o.code).replace(/{size}/g,t).replace(/{creator}/g,o.ownerName||"global")})}};dw.exports=V_});var XR=u((JG,pw)=>{pw.exports={BTTVEmote:Lu(),Channel:Qu(),Collection:ts(),Constants:It(),Emote:wr(),EmoteFetcher:cw(),EmoteParser:hw(),FFZEmote:Wu(),SevenTVEmote:$u(),TwitchEmote:Ku()}});export default XR();
|
|
19
|
+
Make sure you're not executing any actions when you want to remove a user.`),this.userId=e}};Oo.IntermediateUserRemovalError=Sd});var qd=u(Bo=>{"use strict";Object.defineProperty(Bo,"__esModule",{value:!0});Bo.UnknownIntentError=void 0;var ZC=_(),Cd=class extends ZC.CustomError{static{n(this,"UnknownIntentError")}constructor(e){super(`Unknown intent: ${e}`),this.intent=e}};Bo.UnknownIntentError=Cd});var eg=u(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.RefreshingAuthProvider=void 0;var Qr=(b(),x(g)),Di=C(),XC=hd(),Ge=_(),Ed=Co(),Xf=vd(),YC=Hd(),Pd=Eo(),eq=Ao(),tq=qd(),dt=Pi(),Yf=To(),Lt=class extends XC.EventEmitter{static{n(this,"RefreshingAuthProvider")}constructor(e){var t;super(),this._userAccessTokens=new Map,this._userTokenFetchers=new Map,this._intentToUserId=new Map,this._userIdToIntents=new Map,this._cachedRefreshFailures=new Set,this.onRefresh=this.registerEvent(),this.onRefreshFailure=this.registerEvent(),this._clientId=e.clientId,this._clientSecret=e.clientSecret,this._redirectUri=e.redirectUri,this._appImpliedScopes=(t=e.appImpliedScopes)!==null&&t!==void 0?t:[],this._appTokenFetcher=new Yf.TokenFetcher(async r=>await this._fetchAppToken(r))}addUser(e,t,r){let a=(0,Ge.extractUserId)(e);if(!t.refreshToken)throw new Error(`Trying to add user ${a} without refresh token`);this._cachedRefreshFailures.delete(a),this._userAccessTokens.set(a,{...t,userId:a}),this._userTokenFetchers.has(a)||this._userTokenFetchers.set(a,new Yf.TokenFetcher(async s=>await this._fetchUserToken(a,s))),r&&this.addIntentsToUser(e,r)}async addUserForToken(e,t){let r=null;if(e.accessToken&&!(0,Ed.accessTokenIsExpired)(e))try{let l=await(0,dt.getTokenInfo)(e.accessToken);r=[e,l]}catch(l){if(!(l instanceof Pd.InvalidTokenError))throw l}if(!r){if(!e.refreshToken)throw new Pd.InvalidTokenError;let l=await(0,dt.refreshUserToken)(this._clientId,this._clientSecret,e.refreshToken),d=await(0,dt.getTokenInfo)(l.accessToken);this.emit(this.onRefresh,d.userId,l),r=[l,d]}let[a,s]=r;if(!s.userId)throw new eq.InvalidTokenTypeError("Could not determine a user ID for your token; you might be trying to disguise an app token as a user token.");let o=a.scope?a:{...a,scope:s.scopes};return this.addUser(s.userId,o,t),s.userId}async addUserForCode(e,t){if(!this._redirectUri)throw new Error("This method requires you to pass a `redirectUri` as a configuration property");let r=await(0,dt.exchangeCode)(this._clientId,this._clientSecret,e,this._redirectUri);return await this.addUserForToken(r,t)}hasUser(e){return this._userTokenFetchers.has((0,Ge.extractUserId)(e))}removeUser(e){let t=(0,Ge.extractUserId)(e);if(this._userIdToIntents.has(t)){let r=this._userIdToIntents.get(t);for(let a of r)this._intentToUserId.delete(a);this._userIdToIntents.delete(t)}this._userAccessTokens.delete(t),this._userTokenFetchers.delete(t),this._cachedRefreshFailures.delete(t)}addIntentsToUser(e,t){let r=(0,Ge.extractUserId)(e);if(!this._userAccessTokens.has(r))throw new Error("Trying to add intents to a user that was not added to this provider");for(let a of t)this._intentToUserId.has(a)&&this._userIdToIntents.get(this._intentToUserId.get(a)).delete(a),this._intentToUserId.set(a,r),this._userIdToIntents.has(r)?this._userIdToIntents.get(r).add(a):this._userIdToIntents.set(r,new Set([a]))}getIntentsForUser(e){let t=(0,Ge.extractUserId)(e);return this._userIdToIntents.has(t)?Array.from(this._userIdToIntents.get(t)):[]}removeIntents(e){var t;for(let r of e)if(this._intentToUserId.has(r)){let a=this._intentToUserId.get(r);(t=this._userIdToIntents.get(a))===null||t===void 0||t.delete(r),this._intentToUserId.delete(r)}}async refreshAccessTokenForUser(e){let t=(0,Ge.extractUserId)(e);if(this._cachedRefreshFailures.has(t))throw new Xf.CachedRefreshFailureError(t);let r=this._userAccessTokens.get(t);if(!r)throw new Error("Trying to refresh token for user that was not added to the provider");let a=await this._refreshUserTokenWithCallback(t,r.refreshToken);return this._checkIntermediateUserRemoval(t),this._userAccessTokens.set(t,{...a,userId:t}),this.emit(this.onRefresh,t,a),{...a,userId:t}}async refreshAccessTokenForIntent(e){if(!this._intentToUserId.has(e))throw new tq.UnknownIntentError(e);let t=this._intentToUserId.get(e);return await this.refreshAccessTokenForUser(t)}get clientId(){return this._clientId}getCurrentScopesForUser(e){var t;let r=this._userAccessTokens.get((0,Ge.extractUserId)(e));if(!r)throw new Error("Trying to get scopes for user that was not added to the provider");return(t=r.scope)!==null&&t!==void 0?t:[]}async getAccessTokenForUser(e,...t){let r=(0,Ge.extractUserId)(e),a=this._userTokenFetchers.get(r);if(!a)return null;if(this._cachedRefreshFailures.has(r))throw new Xf.CachedRefreshFailureError(r);return(0,dt.compareScopeSets)(this.getCurrentScopesForUser(r),t.filter(Boolean)),await a.fetch(...t)}async getAccessTokenForIntent(e,...t){if(!this._intentToUserId.has(e))return null;let r=this._intentToUserId.get(e),a=await this.getAccessTokenForUser(r,...t);if(!a)throw new Ge.HellFreezesOverError(`Found intent ${e} corresponding to user ID ${r} but no token was found`);return{...a,userId:r}}async getAnyAccessToken(e){if(e){let t=(0,Ge.extractUserId)(e);if(this._userAccessTokens.has(t)){let r=await this.getAccessTokenForUser(t);if(!r)throw new Ge.HellFreezesOverError(`Token for user ID ${t} exists but nothing was returned by getAccessTokenForUser`);return{...r,userId:t}}}return await this.getAppAccessToken()}async getAppAccessToken(e=!1){return e&&(this._appAccessToken=void 0),await this._appTokenFetcher.fetch(...this._appImpliedScopes.map(t=>[t]))}_checkIntermediateUserRemoval(e){if(!this._userTokenFetchers.has(e))throw this._cachedRefreshFailures.delete(e),new YC.IntermediateUserRemovalError(e)}async _fetchUserToken(e,t){let r=this._userAccessTokens.get(e);if(!r)throw new Error("Trying to get token for user that was not added to the provider");if(r.accessToken&&!(0,Ed.accessTokenIsExpired)(r))try{if(r.scope)return(0,dt.compareScopeSets)(r.scope,t),r;let[s=[]]=await(0,dt.loadAndCompareTokenInfo)(this._clientId,r.accessToken,e,r.scope,t),o={...r,scope:s};return this._checkIntermediateUserRemoval(e),this._userAccessTokens.set(e,o),o}catch(s){if(!(s instanceof Pd.InvalidTokenError))throw s}this._checkIntermediateUserRemoval(e);let a=await this.refreshAccessTokenForUser(e);return(0,dt.compareScopeSets)(a.scope,t),a}async _refreshUserTokenWithCallback(e,t){try{return await(0,dt.refreshUserToken)(this.clientId,this._clientSecret,t)}catch(r){throw this._cachedRefreshFailures.add(e),this.emit(this.onRefreshFailure,e,r),r}}async _fetchAppToken(e){if(e.length>0)for(let t of e)if(this._appImpliedScopes.length){if(t.every(r=>!this._appImpliedScopes.includes(r)))throw new Error(`One of the scopes ${t.join(", ")} requested but only the scope ${this._appImpliedScopes.join(", ")} is implied`)}else throw new Error(`One of the scopes ${t.join(", ")} requested but the client credentials flow does not support scopes`);return!this._appAccessToken||(0,Ed.accessTokenIsExpired)(this._appAccessToken)?await this._refreshAppToken():this._appAccessToken}async _refreshAppToken(){return this._appAccessToken=await(0,dt.getAppToken)(this._clientId,this._clientSecret)}};Ii.RefreshingAuthProvider=Lt;Qr.__decorate([(0,Di.Enumerable)(!1)],Lt.prototype,"_clientSecret",void 0);Qr.__decorate([(0,Di.Enumerable)(!1)],Lt.prototype,"_userAccessTokens",void 0);Qr.__decorate([(0,Di.Enumerable)(!1)],Lt.prototype,"_userTokenFetchers",void 0);Qr.__decorate([(0,Di.Enumerable)(!1)],Lt.prototype,"_appAccessToken",void 0);Qr.__decorate([(0,Di.Enumerable)(!1)],Lt.prototype,"_appTokenFetcher",void 0);Ii.RefreshingAuthProvider=Lt=Qr.__decorate([(0,Ge.rtfm)("auth","RefreshingAuthProvider","clientId")],Lt)});var rg=u(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.StaticAuthProvider=void 0;var Ad=(b(),x(g)),tg=C(),rq=_(),iq=Pi(),Ti=class{static{n(this,"StaticAuthProvider")}constructor(e,t,r){this._clientId=e||"",this._accessToken=typeof t=="string"?{accessToken:t,refreshToken:null,scope:r??[],expiresIn:null,obtainmentTimestamp:Date.now()}:t,this._scopes=r}get clientId(){return this._clientId}async getAccessTokenForUser(e,...t){return await this._getAccessToken(t)}async getAccessTokenForIntent(e,...t){return await this._getAccessToken(t)}async getAnyAccessToken(){return await this._getAccessToken()}getCurrentScopesForUser(){var e;return(e=this._scopes)!==null&&e!==void 0?e:[]}async _getAccessToken(e){let[t,r]=await(0,iq.loadAndCompareTokenInfo)(this._clientId,this._accessToken.accessToken,this._userId,this._scopes,e);return this._scopes=t,this._userId=r,{...this._accessToken,userId:r}}};Ri.StaticAuthProvider=Ti;Ad.__decorate([(0,tg.Enumerable)(!1)],Ti.prototype,"_clientId",void 0);Ad.__decorate([(0,tg.Enumerable)(!1)],Ti.prototype,"_accessToken",void 0);Ri.StaticAuthProvider=Ti=Ad.__decorate([(0,rq.rtfm)("auth","StaticAuthProvider","clientId")],Ti)});var Dd=u(T=>{"use strict";Object.defineProperty(T,"__esModule",{value:!0});T.UnknownIntentError=T.InvalidTokenTypeError=T.InvalidTokenError=T.IntermediateUserRemovalError=T.CachedRefreshFailureError=T.StaticAuthProvider=T.RefreshingAuthProvider=T.AppTokenAuthProvider=T.TokenInfo=T.TokenFetcher=T.revokeToken=T.refreshUserToken=T.getValidTokenFromProviderForIntent=T.getValidTokenFromProviderForUser=T.getTokenInfo=T.getAppToken=T.exchangeCode=T.getExpiryDateOfAccessToken=T.accessTokenIsExpired=void 0;var ig=Co();Object.defineProperty(T,"accessTokenIsExpired",{enumerable:!0,get:n(function(){return ig.accessTokenIsExpired},"get")});Object.defineProperty(T,"getExpiryDateOfAccessToken",{enumerable:!0,get:n(function(){return ig.getExpiryDateOfAccessToken},"get")});var sr=Pi();Object.defineProperty(T,"exchangeCode",{enumerable:!0,get:n(function(){return sr.exchangeCode},"get")});Object.defineProperty(T,"getAppToken",{enumerable:!0,get:n(function(){return sr.getAppToken},"get")});Object.defineProperty(T,"getTokenInfo",{enumerable:!0,get:n(function(){return sr.getTokenInfo},"get")});Object.defineProperty(T,"getValidTokenFromProviderForUser",{enumerable:!0,get:n(function(){return sr.getValidTokenFromProviderForUser},"get")});Object.defineProperty(T,"getValidTokenFromProviderForIntent",{enumerable:!0,get:n(function(){return sr.getValidTokenFromProviderForIntent},"get")});Object.defineProperty(T,"refreshUserToken",{enumerable:!0,get:n(function(){return sr.refreshUserToken},"get")});Object.defineProperty(T,"revokeToken",{enumerable:!0,get:n(function(){return sr.revokeToken},"get")});var nq=To();Object.defineProperty(T,"TokenFetcher",{enumerable:!0,get:n(function(){return nq.TokenFetcher},"get")});var aq=fd();Object.defineProperty(T,"TokenInfo",{enumerable:!0,get:n(function(){return aq.TokenInfo},"get")});var sq=Zf();Object.defineProperty(T,"AppTokenAuthProvider",{enumerable:!0,get:n(function(){return sq.AppTokenAuthProvider},"get")});var oq=eg();Object.defineProperty(T,"RefreshingAuthProvider",{enumerable:!0,get:n(function(){return oq.RefreshingAuthProvider},"get")});var lq=rg();Object.defineProperty(T,"StaticAuthProvider",{enumerable:!0,get:n(function(){return lq.StaticAuthProvider},"get")});var uq=vd();Object.defineProperty(T,"CachedRefreshFailureError",{enumerable:!0,get:n(function(){return uq.CachedRefreshFailureError},"get")});var cq=Hd();Object.defineProperty(T,"IntermediateUserRemovalError",{enumerable:!0,get:n(function(){return cq.IntermediateUserRemovalError},"get")});var dq=Eo();Object.defineProperty(T,"InvalidTokenError",{enumerable:!0,get:n(function(){return dq.InvalidTokenError},"get")});var hq=Ao();Object.defineProperty(T,"InvalidTokenTypeError",{enumerable:!0,get:n(function(){return hq.InvalidTokenTypeError},"get")});var pq=qd();Object.defineProperty(T,"UnknownIntentError",{enumerable:!0,get:n(function(){return pq.UnknownIntentError},"get")})});var ag=u((Fj,ng)=>{function We(i,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(i)),this._timeouts=i,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}n(We,"RetryOperation");ng.exports=We;We.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};We.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};We.prototype.retry=function(i){if(this._timeout&&clearTimeout(this._timeout),!i)return!1;var e=new Date().getTime();if(i&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(i),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(i);var t=this._timeouts.shift();if(t===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),t=this._cachedTimeouts.slice(-1);else return!1;var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},t),this._options.unref&&this._timer.unref(),!0};We.prototype.attempt=function(i,e){this._fn=i,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var t=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){t._operationTimeoutCb()},t._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};We.prototype.try=function(i){console.log("Using RetryOperation.try() is deprecated"),this.attempt(i)};We.prototype.start=function(i){console.log("Using RetryOperation.start() is deprecated"),this.attempt(i)};We.prototype.start=We.prototype.try;We.prototype.errors=function(){return this._errors};We.prototype.attempts=function(){return this._attempts};We.prototype.mainError=function(){if(this._errors.length===0)return null;for(var i={},e=null,t=0,r=0;r<this._errors.length;r++){var a=this._errors[r],s=a.message,o=(i[s]||0)+1;i[s]=o,o>=t&&(e=a,t=o)}return e}});var sg=u(or=>{var _q=ag();or.operation=function(i){var e=or.timeouts(i);return new _q(e,{forever:i&&(i.forever||i.retries===1/0),unref:i&&i.unref,maxRetryTime:i&&i.maxRetryTime})};or.timeouts=function(i){if(i instanceof Array)return[].concat(i);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var t in i)e[t]=i[t];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var r=[],a=0;a<e.retries;a++)r.push(this.createTimeout(a,e));return i&&i.forever&&!r.length&&r.push(this.createTimeout(a,e)),r.sort(function(s,o){return s-o}),r};or.createTimeout=function(i,e){var t=e.randomize?Math.random()+1:1,r=Math.round(t*Math.max(e.minTimeout,1)*Math.pow(e.factor,i));return r=Math.min(r,e.maxTimeout),r};or.wrap=function(i,e,t){if(e instanceof Array&&(t=e,e=null),!t){t=[];for(var r in i)typeof i[r]=="function"&&t.push(r)}for(var a=0;a<t.length;a++){var s=t[a],o=i[s];i[s]=n(function(d){var p=or.operation(e),h=Array.prototype.slice.call(arguments,1),w=h.pop();h.push(function(E){p.retry(E)||(E&&(arguments[0]=p.mainError()),w.apply(this,arguments))}),p.attempt(function(){d.apply(i,h)})},"retryWrapper").bind(i,o),i[s].options=e}}});var lg=u((Wj,og)=>{og.exports=sg()});var ug=u(jo=>{"use strict";Object.defineProperty(jo,"__esModule",{value:!0});jo.createBitsLeaderboardQuery=void 0;function mq(i={}){let{count:e=10,period:t="all",startDate:r,contextUserId:a}=i;return{count:e.toString(),period:t,started_at:r?.toISOString(),user_id:a}}n(mq,"createBitsLeaderboardQuery");jo.createBitsLeaderboardQuery=mq});var G=u(Mo=>{"use strict";Object.defineProperty(Mo,"__esModule",{value:!0});Mo.BaseApi=void 0;var yq=(b(),x(g)),fq=C(),ko=class{static{n(this,"BaseApi")}constructor(e){this._client=e}_getUserContextIdWithDefault(e){var t;return(t=this._client._getUserIdFromRequestContext(e))!==null&&t!==void 0?t:e}};Mo.BaseApi=ko;yq.__decorate([(0,fq.Enumerable)(!1)],ko.prototype,"_client",void 0)});var Id=u(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.HelixBitsLeaderboardEntry=void 0;var cg=(b(),x(g)),gq=C(),wt=_(),Lo=class extends wt.DataObject{static{n(this,"HelixBitsLeaderboardEntry")}constructor(e,t){super(e),this._client=t}get userId(){return this[wt.rawDataSymbol].user_id}get userName(){return this[wt.rawDataSymbol].user_login}get userDisplayName(){return this[wt.rawDataSymbol].user_name}get rank(){return this[wt.rawDataSymbol].rank}get amount(){return this[wt.rawDataSymbol].score}async getUser(){return(0,wt.checkRelationAssertion)(await this._client.users.getUserById(this[wt.rawDataSymbol].user_id))}};Ui.HelixBitsLeaderboardEntry=Lo;cg.__decorate([(0,gq.Enumerable)(!1)],Lo.prototype,"_client",void 0);Ui.HelixBitsLeaderboardEntry=Lo=cg.__decorate([(0,wt.rtfm)("api","HelixBitsLeaderboardEntry","userId")],Lo)});var Rd=u(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.HelixBitsLeaderboard=void 0;var Td=(b(),x(g)),dg=Ci(),bq=C(),Fo=_(),xq=Id(),Oi=class extends Fo.DataObject{static{n(this,"HelixBitsLeaderboard")}constructor(e,t){super(e),this._client=t}get entries(){return this[Fo.rawDataSymbol].data.map(e=>new xq.HelixBitsLeaderboardEntry(e,this._client))}get totalCount(){return this[Fo.rawDataSymbol].total}};Bi.HelixBitsLeaderboard=Oi;Td.__decorate([(0,bq.Enumerable)(!1)],Oi.prototype,"_client",void 0);Td.__decorate([(0,dg.CachedGetter)()],Oi.prototype,"entries",null);Bi.HelixBitsLeaderboard=Oi=Td.__decorate([dg.Cacheable,(0,Fo.rtfm)("api","HelixBitsLeaderboard")],Oi)});var Od=u(ki=>{"use strict";Object.defineProperty(ki,"__esModule",{value:!0});ki.HelixCheermoteList=void 0;var wq=(b(),x(g)),vq=C(),ji=_(),Ud=class extends ji.DataObject{static{n(this,"HelixCheermoteList")}constructor(e){super((0,vq.indexBy)(e,t=>t.prefix.toLowerCase()))}getCheermoteDisplayInfo(e,t,r){e=e.toLowerCase();let{background:a,state:s,scale:o}=r,{tiers:l}=this[ji.rawDataSymbol][e],d=l.sort((p,h)=>h.min_bits-p.min_bits).find(p=>p.min_bits<=t);if(!d)throw new ji.HellFreezesOverError(`Cheermote "${e}" does not have an applicable tier for ${t} bits`);return{url:d.images[a][s][o],color:d.color}}getPossibleNames(){return Object.keys(this[ji.rawDataSymbol])}};ki.HelixCheermoteList=Ud;ki.HelixCheermoteList=Ud=wq.__decorate([(0,ji.rtfm)("api","HelixCheermoteList")],Ud)});var kd=u(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.HelixBitsApi=void 0;var Sq=(b(),x(g)),hg=C(),Hq=Y(),Bd=_(),Cq=ug(),qq=G(),Eq=Rd(),Pq=Od(),jd=class extends qq.BaseApi{static{n(this,"HelixBitsApi")}async getLeaderboard(e,t={}){let r=await this._client.callApi({type:"helix",url:"bits/leaderboard",userId:(0,Bd.extractUserId)(e),scopes:["bits:read"],query:(0,Cq.createBitsLeaderboardQuery)(t)});return new Eq.HelixBitsLeaderboard(r,this._client)}async getCheermotes(e){let t=await this._client.callApi({type:"helix",url:"bits/cheermotes",userId:(0,hg.mapOptional)(e,Bd.extractUserId),query:(0,hg.mapOptional)(e,Hq.createBroadcasterQuery)});return new Pq.HelixCheermoteList(t.data)}};Mi.HelixBitsApi=jd;Mi.HelixBitsApi=jd=Sq.__decorate([(0,Bd.rtfm)("api","HelixBitsApi")],jd)});var _g=u(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.createFollowedChannelQuery=Ve.createChannelFollowerQuery=Ve.createChannelVipUpdateQuery=Ve.createChannelCommercialBody=Ve.createChannelUpdateBody=void 0;var pg=C(),lr=_();function Aq(i){var e;return{game_id:i.gameId,broadcaster_language:i.language,title:i.title,delay:(e=i.delay)===null||e===void 0?void 0:e.toString(),tags:i.tags,content_classification_labels:i.contentClassificationLabels,is_branded_content:i.isBrandedContent}}n(Aq,"createChannelUpdateBody");Ve.createChannelUpdateBody=Aq;function Dq(i,e){return{broadcaster_id:(0,lr.extractUserId)(i),length:e}}n(Dq,"createChannelCommercialBody");Ve.createChannelCommercialBody=Dq;function Iq(i,e){return{broadcaster_id:(0,lr.extractUserId)(i),user_id:(0,lr.extractUserId)(e)}}n(Iq,"createChannelVipUpdateQuery");Ve.createChannelVipUpdateQuery=Iq;function Tq(i,e){return{broadcaster_id:(0,lr.extractUserId)(i),user_id:(0,pg.mapOptional)(e,lr.extractUserId)}}n(Tq,"createChannelFollowerQuery");Ve.createChannelFollowerQuery=Tq;function Rq(i,e){return{broadcaster_id:(0,pg.mapOptional)(e,lr.extractUserId),user_id:(0,lr.extractUserId)(i)}}n(Rq,"createFollowedChannelQuery");Ve.createFollowedChannelQuery=Rq});var je=u($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.createChannelUsersCheckQuery=$e.createGetByIdsQuery=$e.createModeratorActionQuery=$e.createUserQuery=$e.createSingleKeyQuery=void 0;var No=_();function Uq(i,e){return{[i]:e}}n(Uq,"createSingleKeyQuery");$e.createSingleKeyQuery=Uq;function Oq(i){return{user_id:(0,No.extractUserId)(i)}}n(Oq,"createUserQuery");$e.createUserQuery=Oq;function Bq(i,e){return{broadcaster_id:i,moderator_id:e}}n(Bq,"createModeratorActionQuery");$e.createModeratorActionQuery=Bq;function jq(i,e){return{broadcaster_id:(0,No.extractUserId)(i),id:e}}n(jq,"createGetByIdsQuery");$e.createGetByIdsQuery=jq;function kq(i,e){return{broadcaster_id:(0,No.extractUserId)(i),user_id:e.map(No.extractUserId)}}n(kq,"createChannelUsersCheckQuery");$e.createChannelUsersCheckQuery=kq});var Go=u(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});Li.HelixUserRelation=void 0;var mg=(b(),x(g)),Mq=C(),ur=_(),Qo=class extends ur.DataObject{static{n(this,"HelixUserRelation")}constructor(e,t){super(e),this._client=t}get id(){return this[ur.rawDataSymbol].user_id}get name(){return this[ur.rawDataSymbol].user_login}get displayName(){return this[ur.rawDataSymbol].user_name}async getUser(){return(0,ur.checkRelationAssertion)(await this._client.users.getUserById(this[ur.rawDataSymbol].user_id))}};Li.HelixUserRelation=Qo;mg.__decorate([(0,Mq.Enumerable)(!1)],Qo.prototype,"_client",void 0);Li.HelixUserRelation=Qo=mg.__decorate([(0,ur.rtfm)("api","HelixUserRelation","id")],Qo)});var Ft=u(Vo=>{"use strict";Object.defineProperty(Vo,"__esModule",{value:!0});Vo.HelixRequestBatcher=void 0;var Lq=(b(),x(g)),Md=C(),Wo=class{static{n(this,"HelixRequestBatcher")}constructor(e,t,r,a,s,o=100){this._callOptions=e,this._queryParamName=t,this._matchKey=r,this._mapper=s,this._limitPerRequest=o,this._requestedIds=[],this._requestResolversById=new Map,this._waitTimer=null,this._client=a,this._delay=a._batchDelay}async request(e){let{promise:t,resolve:r,reject:a}=(0,Md.promiseWithResolvers)();return this._requestedIds.includes(e)||this._requestedIds.push(e),this._requestResolversById.has(e)?this._requestResolversById.get(e).push({resolve:r,reject:a}):this._requestResolversById.set(e,[{resolve:r,reject:a}]),this._waitTimer&&(clearTimeout(this._waitTimer),this._waitTimer=null),this._requestedIds.length>=this._limitPerRequest?this._handleBatch(this._requestedIds.splice(0,this._limitPerRequest)):this._waitTimer=setTimeout(()=>{this._handleBatch(this._requestedIds.splice(0,this._limitPerRequest))},this._delay),await t}async _handleBatch(e){var t;try{let{data:r}=await this._doRequest(e),a=(0,Md.indexBy)(r,this._matchKey);for(let s of e){for(let o of(t=this._requestResolversById.get(s))!==null&&t!==void 0?t:[])Object.prototype.hasOwnProperty.call(a,s)?o.resolve(this._mapper(a[s])):o.resolve(null);this._requestResolversById.delete(s)}}catch{await Promise.all(e.map(async a=>{var s,o;try{let l=await this._doRequest([a]);for(let d of(s=this._requestResolversById.get(a))!==null&&s!==void 0?s:[])d.resolve(l.data.length?this._mapper(l.data[0]):null)}catch(l){for(let d of(o=this._requestResolversById.get(a))!==null&&o!==void 0?o:[])d.reject(l)}this._requestResolversById.delete(a)}))}}async _doRequest(e){return await this._client.callApi({type:"helix",...this._callOptions,query:{...this._callOptions.query,[this._queryParamName]:e}})}};Vo.HelixRequestBatcher=Wo;Lq.__decorate([(0,Md.Enumerable)(!1)],Wo.prototype,"_client",void 0)});var oe=u(Fi=>{"use strict";var Ld;Object.defineProperty(Fi,"__esModule",{value:!0});Fi.HelixPaginatedRequest=void 0;var yg=(b(),x(g)),Fq=C(),Nq=_();Object.prototype.hasOwnProperty.call(Symbol,"asyncIterator")||(Symbol.asyncIterator=(Ld=Symbol.asyncIterator)!==null&&Ld!==void 0?Ld:Symbol.for("Symbol.asyncIterator"));var $o=class{static{n(this,"HelixPaginatedRequest")}constructor(e,t,r,a=100){this._callOptions=e,this._mapper=r,this._limitPerPage=a,this._isFinished=!1,this._client=t}get current(){var e;return(e=this._currentData)===null||e===void 0?void 0:e.data}async getNext(){var e;if(this._isFinished)return[];let t=await this._fetchData();return!((e=t.data)===null||e===void 0)&&e.length?this._processResult(t):(this._isFinished=!0,[])}async getAll(){this.reset();let e=[];do{let t=await this.getNext();if(!t.length)break;e.push(...t)}while(this._currentCursor);return this.reset(),e}get currentCursor(){return this._currentCursor}reset(){this._currentCursor=void 0,this._isFinished=!1,this._currentData=void 0}async*[Symbol.asyncIterator](){for(this.reset();;){let e=await this.getNext();if(!e.length)break;yield*e[Symbol.iterator]()}}async _fetchData(e={}){return await this._client.callApi({type:"helix",...this._callOptions,...e,query:{...this._callOptions.query,after:this._currentCursor,first:this._limitPerPage.toString(),...e.query}})}_processResult(e){var t;return this._currentCursor=typeof e.pagination=="string"?e.pagination:(t=e.pagination)===null||t===void 0?void 0:t.cursor,this._currentCursor===void 0&&(this._isFinished=!0),this._currentData=e,e.data.reduce((r,a)=>{let s=this._mapper(a);return Array.isArray(s)?[...r,...s]:[...r,s]},[])}};Fi.HelixPaginatedRequest=$o;yg.__decorate([(0,Fq.Enumerable)(!1)],$o.prototype,"_client",void 0);Fi.HelixPaginatedRequest=$o=yg.__decorate([(0,Nq.rtfm)("api","HelixPaginatedRequest")],$o)});var Gr=u(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.HelixPaginatedRequestWithTotal=void 0;var Qq=(b(),x(g)),Gq=_(),Wq=oe(),Fd=class extends Wq.HelixPaginatedRequest{static{n(this,"HelixPaginatedRequestWithTotal")}async getTotalCount(){var e;return((e=this._currentData)!==null&&e!==void 0?e:await this._fetchData({query:{after:void 0}})).total}};Ni.HelixPaginatedRequestWithTotal=Fd;Ni.HelixPaginatedRequestWithTotal=Fd=Qq.__decorate([(0,Gq.rtfm)("api","HelixPaginatedRequestWithTotal")],Fd)});var pe=u(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.createPaginatedResultWithTotal=Wr.createPaginatedResult=void 0;function Vq(i,e,t){var r;let a;return{get data(){var s,o;return a??(a=(o=(s=i.data)===null||s===void 0?void 0:s.map(l=>new e(l,t)))!==null&&o!==void 0?o:[])},cursor:typeof i.pagination=="string"?i.pagination:(r=i.pagination)===null||r===void 0?void 0:r.cursor}}n(Vq,"createPaginatedResult");Wr.createPaginatedResult=Vq;function $q(i,e,t){let r;return{get data(){var a,s;return r??(r=(s=(a=i.data)===null||a===void 0?void 0:a.map(o=>new e(o,t)))!==null&&s!==void 0?s:[])},cursor:i.pagination.cursor,total:i.total}}n($q,"createPaginatedResultWithTotal");Wr.createPaginatedResultWithTotal=$q});var le=u(zo=>{"use strict";Object.defineProperty(zo,"__esModule",{value:!0});zo.createPaginationQuery=void 0;function zq({after:i,before:e,limit:t}={}){return{after:i,before:e,first:t?.toString()}}n(zq,"createPaginationQuery");zo.createPaginationQuery=zq});var Nd=u(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});Qi.HelixChannel=void 0;var fg=(b(),x(g)),Kq=C(),me=_(),Ko=class extends me.DataObject{static{n(this,"HelixChannel")}constructor(e,t){super(e),this._client=t}get id(){return this[me.rawDataSymbol].broadcaster_id}get name(){return this[me.rawDataSymbol].broadcaster_login}get displayName(){return this[me.rawDataSymbol].broadcaster_name}async getBroadcaster(){return(0,me.checkRelationAssertion)(await this._client.users.getUserById(this[me.rawDataSymbol].broadcaster_id))}get language(){return this[me.rawDataSymbol].broadcaster_language}get gameId(){return this[me.rawDataSymbol].game_id}get gameName(){return this[me.rawDataSymbol].game_name}async getGame(){return this[me.rawDataSymbol].game_id?(0,me.checkRelationAssertion)(await this._client.games.getGameById(this[me.rawDataSymbol].game_id)):null}get title(){return this[me.rawDataSymbol].title}get delay(){return this[me.rawDataSymbol].delay}get tags(){return this[me.rawDataSymbol].tags}get contentClassificationLabels(){return this[me.rawDataSymbol].content_classification_labels}get isBrandedContent(){return this[me.rawDataSymbol].is_branded_content}};Qi.HelixChannel=Ko;fg.__decorate([(0,Kq.Enumerable)(!1)],Ko.prototype,"_client",void 0);Qi.HelixChannel=Ko=fg.__decorate([(0,me.rtfm)("api","HelixChannel","id")],Ko)});var Qd=u(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.HelixChannelEditor=void 0;var gg=(b(),x(g)),Jq=C(),cr=_(),Jo=class extends cr.DataObject{static{n(this,"HelixChannelEditor")}constructor(e,t){super(e),this._client=t}get userId(){return this[cr.rawDataSymbol].user_id}get userDisplayName(){return this[cr.rawDataSymbol].user_name}async getUser(){return(0,cr.checkRelationAssertion)(await this._client.users.getUserById(this[cr.rawDataSymbol].user_id))}get creationDate(){return new Date(this[cr.rawDataSymbol].created_at)}};Gi.HelixChannelEditor=Jo;gg.__decorate([(0,Jq.Enumerable)(!1)],Jo.prototype,"_client",void 0);Gi.HelixChannelEditor=Jo=gg.__decorate([(0,cr.rtfm)("api","HelixChannelEditor","userId")],Jo)});var Gd=u(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.HelixChannelFollower=void 0;var bg=(b(),x(g)),Zq=C(),Nt=_(),Zo=class extends Nt.DataObject{static{n(this,"HelixChannelFollower")}constructor(e,t){super(e),this._client=t}get userId(){return this[Nt.rawDataSymbol].user_id}get userName(){return this[Nt.rawDataSymbol].user_login}get userDisplayName(){return this[Nt.rawDataSymbol].user_name}async getUser(){return(0,Nt.checkRelationAssertion)(await this._client.users.getUserById(this[Nt.rawDataSymbol].user_id))}get followDate(){return new Date(this[Nt.rawDataSymbol].followed_at)}};Wi.HelixChannelFollower=Zo;bg.__decorate([(0,Zq.Enumerable)(!1)],Zo.prototype,"_client",void 0);Wi.HelixChannelFollower=Zo=bg.__decorate([(0,Nt.rtfm)("api","HelixChannelFollower","userId")],Zo)});var Wd=u(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.HelixFollowedChannel=void 0;var xg=(b(),x(g)),Xq=C(),Qt=_(),Xo=class extends Qt.DataObject{static{n(this,"HelixFollowedChannel")}constructor(e,t){super(e),this._client=t}get broadcasterId(){return this[Qt.rawDataSymbol].broadcaster_id}get broadcasterName(){return this[Qt.rawDataSymbol].broadcaster_login}get broadcasterDisplayName(){return this[Qt.rawDataSymbol].broadcaster_name}async getBroadcaster(){return(0,Qt.checkRelationAssertion)(await this._client.users.getUserById(this[Qt.rawDataSymbol].broadcaster_id))}get followDate(){return new Date(this[Qt.rawDataSymbol].followed_at)}};Vi.HelixFollowedChannel=Xo;xg.__decorate([(0,Xq.Enumerable)(!1)],Xo.prototype,"_client",void 0);Vi.HelixFollowedChannel=Xo=xg.__decorate([(0,Qt.rtfm)("api","HelixFollowedChannel","broadcasterId")],Xo)});var $d=u($i=>{"use strict";Object.defineProperty($i,"__esModule",{value:!0});$i.HelixAdSchedule=void 0;var Yq=(b(),x(g)),et=_(),Vd=class extends et.DataObject{static{n(this,"HelixAdSchedule")}get snoozeCount(){return this[et.rawDataSymbol].snooze_count}get snoozeRefreshDate(){return this[et.rawDataSymbol].snooze_refresh_at?new Date(this[et.rawDataSymbol].snooze_refresh_at*1e3):null}get nextAdDate(){return this[et.rawDataSymbol].next_ad_at?new Date(this[et.rawDataSymbol].next_ad_at*1e3):null}get duration(){return this[et.rawDataSymbol].duration}get lastAdDate(){return this[et.rawDataSymbol].last_ad_at?new Date(this[et.rawDataSymbol].last_ad_at*1e3):null}get prerollFreeTime(){return this[et.rawDataSymbol].preroll_free_time}};$i.HelixAdSchedule=Vd;$i.HelixAdSchedule=Vd=Yq.__decorate([(0,et.rtfm)("api","HelixAdSchedule")],Vd)});var wg=u(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});Ki.HelixSnoozeNextAdResult=void 0;var eE=(b(),x(g)),zi=_(),zd=class extends zi.DataObject{static{n(this,"HelixSnoozeNextAdResult")}get snoozeCount(){return this[zi.rawDataSymbol].snooze_count}get snoozeRefreshDate(){return new Date(this[zi.rawDataSymbol].snooze_refresh_at*1e3)}get nextAdDate(){return new Date(this[zi.rawDataSymbol].next_ad_at*1e3)}};Ki.HelixSnoozeNextAdResult=zd;Ki.HelixSnoozeNextAdResult=zd=eE.__decorate([(0,zi.rtfm)("api","HelixSnoozeNextAdResult")],zd)});var Xd=u(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.HelixChannelApi=void 0;var qg=(b(),x(g)),Eg=C(),dr=Y(),ue=_(),vt=_g(),vg=je(),Kd=Go(),tE=Ft(),rE=oe(),Sg=Gr(),Jd=pe(),Yo=le(),iE=G(),Zd=Nd(),nE=Qd(),Hg=Gd(),Cg=Wd(),aE=$d(),sE=wg(),el=class extends iE.BaseApi{static{n(this,"HelixChannelApi")}constructor(){super(...arguments),this._getChannelByIdBatcher=new tE.HelixRequestBatcher({url:"channels"},"broadcaster_id","broadcaster_id",this._client,e=>new Zd.HelixChannel(e,this._client))}async getChannelInfoById(e){let t=(0,ue.extractUserId)(e),r=await this._client.callApi({type:"helix",url:"channels",userId:t,query:(0,dr.createBroadcasterQuery)(t)});return(0,Eg.mapNullable)(r.data[0],a=>new Zd.HelixChannel(a,this._client))}async getChannelInfoByIdBatched(e){return await this._getChannelByIdBatcher.request((0,ue.extractUserId)(e))}async getChannelInfoByIds(e){let t=e.map(ue.extractUserId);return(await this._client.callApi({type:"helix",url:"channels",query:(0,vg.createSingleKeyQuery)("broadcaster_id",t)})).data.map(a=>new Zd.HelixChannel(a,this._client))}async updateChannelInfo(e,t){await this._client.callApi({type:"helix",url:"channels",method:"PATCH",userId:(0,ue.extractUserId)(e),scopes:["channel:manage:broadcast"],query:(0,dr.createBroadcasterQuery)(e),jsonBody:(0,vt.createChannelUpdateBody)(t)})}async startChannelCommercial(e,t){await this._client.callApi({type:"helix",url:"channels/commercial",method:"POST",userId:(0,ue.extractUserId)(e),scopes:["channel:edit:commercial"],jsonBody:(0,vt.createChannelCommercialBody)(e,t)})}async getChannelEditors(e){return(await this._client.callApi({type:"helix",url:"channels/editors",userId:(0,ue.extractUserId)(e),scopes:["channel:read:editors"],query:(0,dr.createBroadcasterQuery)(e)})).data.map(r=>new nE.HelixChannelEditor(r,this._client))}async getVips(e,t){let r=await this._client.callApi({type:"helix",url:"channels/vips",userId:(0,ue.extractUserId)(e),scopes:["channel:read:vips","channel:manage:vips"],query:{...(0,dr.createBroadcasterQuery)(e),...(0,Yo.createPaginationQuery)(t)}});return(0,Jd.createPaginatedResult)(r,Kd.HelixUserRelation,this._client)}getVipsPaginated(e){return new rE.HelixPaginatedRequest({url:"channels/vips",userId:(0,ue.extractUserId)(e),scopes:["channel:read:vips","channel:manage:vips"],query:(0,dr.createBroadcasterQuery)(e)},this._client,t=>new Kd.HelixUserRelation(t,this._client))}async checkVipForUsers(e,t){return(await this._client.callApi({type:"helix",url:"channels/vips",userId:(0,ue.extractUserId)(e),scopes:["channel:read:vips","channel:manage:vips"],query:(0,vg.createChannelUsersCheckQuery)(e,t)})).data.map(a=>new Kd.HelixUserRelation(a,this._client))}async checkVipForUser(e,t){let r=(0,ue.extractUserId)(t);return(await this.checkVipForUsers(e,[r])).some(s=>s.id===r)}async addVip(e,t){await this._client.callApi({type:"helix",url:"channels/vips",method:"POST",userId:(0,ue.extractUserId)(e),scopes:["channel:manage:vips"],query:(0,vt.createChannelVipUpdateQuery)(e,t)})}async removeVip(e,t){await this._client.callApi({type:"helix",url:"channels/vips",method:"DELETE",userId:(0,ue.extractUserId)(e),scopes:["channel:manage:vips"],query:(0,vt.createChannelVipUpdateQuery)(e,t)})}async getChannelFollowerCount(e){return(await this._client.callApi({type:"helix",url:"channels/followers",method:"GET",userId:(0,ue.extractUserId)(e),query:{...(0,vt.createChannelFollowerQuery)(e),...(0,Yo.createPaginationQuery)({limit:1})}})).total}async getChannelFollowers(e,t,r){let a=await this._client.callApi({type:"helix",url:"channels/followers",method:"GET",userId:(0,ue.extractUserId)(e),canOverrideScopedUserContext:!0,scopes:["moderator:read:followers"],query:{...(0,vt.createChannelFollowerQuery)(e,t),...(0,Yo.createPaginationQuery)(r)}});return(0,Jd.createPaginatedResultWithTotal)(a,Hg.HelixChannelFollower,this._client)}getChannelFollowersPaginated(e){return new Sg.HelixPaginatedRequestWithTotal({url:"channels/followers",method:"GET",userId:(0,ue.extractUserId)(e),canOverrideScopedUserContext:!0,scopes:["moderator:read:followers"],query:(0,vt.createChannelFollowerQuery)(e)},this._client,t=>new Hg.HelixChannelFollower(t,this._client))}async getFollowedChannels(e,t,r){let a=await this._client.callApi({type:"helix",url:"channels/followed",method:"GET",userId:(0,ue.extractUserId)(e),scopes:["user:read:follows"],query:{...(0,vt.createFollowedChannelQuery)(e,t),...(0,Yo.createPaginationQuery)(r)}});return(0,Jd.createPaginatedResultWithTotal)(a,Cg.HelixFollowedChannel,this._client)}getFollowedChannelsPaginated(e,t){return new Sg.HelixPaginatedRequestWithTotal({url:"channels/followed",method:"GET",userId:(0,ue.extractUserId)(e),scopes:["user:read:follows"],query:(0,vt.createFollowedChannelQuery)(e,t)},this._client,r=>new Cg.HelixFollowedChannel(r,this._client))}async getAdSchedule(e){let t=await this._client.callApi({type:"helix",url:"channels/ads",method:"GET",userId:(0,ue.extractUserId)(e),scopes:["channel:read:ads"],query:(0,dr.createBroadcasterQuery)(e)});return new aE.HelixAdSchedule(t.data[0])}async snoozeNextAd(e){let t=await this._client.callApi({type:"helix",url:"channels/ads/schedule/snooze",method:"POST",userId:(0,ue.extractUserId)(e),scopes:["channel:manage:ads"],query:(0,dr.createBroadcasterQuery)(e)});return new sE.HelixSnoozeNextAdResult(t.data[0])}};Ji.HelixChannelApi=el;qg.__decorate([(0,Eg.Enumerable)(!1)],el.prototype,"_getChannelByIdBatcher",void 0);Ji.HelixChannelApi=el=qg.__decorate([(0,ue.rtfm)("api","HelixChannelApi")],el)});var Pg=u(ze=>{"use strict";Object.defineProperty(ze,"__esModule",{value:!0});ze.createRedemptionsForBroadcasterQuery=ze.createRewardRedemptionsByIdsQuery=ze.createCustomRewardBody=ze.createCustomRewardChangeQuery=ze.createCustomRewardsQuery=void 0;var tl=_();function oE(i,e){return{broadcaster_id:(0,tl.extractUserId)(i),only_manageable_rewards:e?.toString()}}n(oE,"createCustomRewardsQuery");ze.createCustomRewardsQuery=oE;function lE(i,e){return{broadcaster_id:(0,tl.extractUserId)(i),id:e}}n(lE,"createCustomRewardChangeQuery");ze.createCustomRewardChangeQuery=lE;function uE(i){var e,t,r;let a={title:i.title,cost:i.cost,prompt:i.prompt,background_color:i.backgroundColor,is_enabled:i.isEnabled,is_user_input_required:i.userInputRequired,should_redemptions_skip_request_queue:i.autoFulfill};return i.maxRedemptionsPerStream!==void 0&&(a.is_max_per_stream_enabled=!!i.maxRedemptionsPerStream,a.max_per_stream=(e=i.maxRedemptionsPerStream)!==null&&e!==void 0?e:0),i.maxRedemptionsPerUserPerStream!==void 0&&(a.is_max_per_user_per_stream_enabled=!!i.maxRedemptionsPerUserPerStream,a.max_per_user_per_stream=(t=i.maxRedemptionsPerUserPerStream)!==null&&t!==void 0?t:0),i.globalCooldown!==void 0&&(a.is_global_cooldown_enabled=!!i.globalCooldown,a.global_cooldown_seconds=(r=i.globalCooldown)!==null&&r!==void 0?r:0),"isPaused"in i&&(a.is_paused=i.isPaused),a}n(uE,"createCustomRewardBody");ze.createCustomRewardBody=uE;function cE(i,e,t){return{broadcaster_id:(0,tl.extractUserId)(i),reward_id:e,id:t}}n(cE,"createRewardRedemptionsByIdsQuery");ze.createRewardRedemptionsByIdsQuery=cE;function dE(i,e,t,r){return{broadcaster_id:(0,tl.extractUserId)(i),reward_id:e,status:t,sort:r.newestFirst?"NEWEST":"OLDEST"}}n(dE,"createRedemptionsForBroadcasterQuery");ze.createRedemptionsForBroadcasterQuery=dE});var Yd=u(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});Zi.HelixCustomReward=void 0;var Ag=(b(),x(g)),hE=C(),M=_(),rl=class extends M.DataObject{static{n(this,"HelixCustomReward")}constructor(e,t){super(e),this._client=t}get id(){return this[M.rawDataSymbol].id}get broadcasterId(){return this[M.rawDataSymbol].broadcaster_id}get broadcasterName(){return this[M.rawDataSymbol].broadcaster_login}get broadcasterDisplayName(){return this[M.rawDataSymbol].broadcaster_name}async getBroadcaster(){return(0,M.checkRelationAssertion)(await this._client.users.getUserById(this[M.rawDataSymbol].broadcaster_id))}getImageUrl(e){var t,r;let a=`url_${e}x`;return(r=(t=this[M.rawDataSymbol].image)===null||t===void 0?void 0:t[a])!==null&&r!==void 0?r:this[M.rawDataSymbol].default_image[a]}get backgroundColor(){return this[M.rawDataSymbol].background_color}get isEnabled(){return this[M.rawDataSymbol].is_enabled}get cost(){return this[M.rawDataSymbol].cost}get title(){return this[M.rawDataSymbol].title}get prompt(){return this[M.rawDataSymbol].prompt}get userInputRequired(){return this[M.rawDataSymbol].is_user_input_required}get maxRedemptionsPerStream(){return this[M.rawDataSymbol].max_per_stream_setting.is_enabled?this[M.rawDataSymbol].max_per_stream_setting.max_per_stream:null}get maxRedemptionsPerUserPerStream(){return this[M.rawDataSymbol].max_per_user_per_stream_setting.is_enabled?this[M.rawDataSymbol].max_per_user_per_stream_setting.max_per_user_per_stream:null}get globalCooldown(){return this[M.rawDataSymbol].global_cooldown_setting.is_enabled?this[M.rawDataSymbol].global_cooldown_setting.global_cooldown_seconds:null}get isPaused(){return this[M.rawDataSymbol].is_paused}get isInStock(){return this[M.rawDataSymbol].is_in_stock}get redemptionsThisStream(){return this[M.rawDataSymbol].redemptions_redeemed_current_stream}get autoFulfill(){return this[M.rawDataSymbol].should_redemptions_skip_request_queue}get cooldownExpiryDate(){return this[M.rawDataSymbol].cooldown_expires_at?new Date(this[M.rawDataSymbol].cooldown_expires_at):null}};Zi.HelixCustomReward=rl;Ag.__decorate([(0,hE.Enumerable)(!1)],rl.prototype,"_client",void 0);Zi.HelixCustomReward=rl=Ag.__decorate([(0,M.rtfm)("api","HelixCustomReward","id")],rl)});var eh=u(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.HelixCustomRewardRedemption=void 0;var Dg=(b(),x(g)),pE=C(),Q=_(),il=class extends Q.DataObject{static{n(this,"HelixCustomRewardRedemption")}constructor(e,t){super(e),this._client=t}get id(){return this[Q.rawDataSymbol].id}get broadcasterId(){return this[Q.rawDataSymbol].broadcaster_id}get broadcasterName(){return this[Q.rawDataSymbol].broadcaster_login}get broadcasterDisplayName(){return this[Q.rawDataSymbol].broadcaster_name}async getBroadcaster(){return(0,Q.checkRelationAssertion)(await this._client.users.getUserById(this[Q.rawDataSymbol].broadcaster_id))}get userId(){return this[Q.rawDataSymbol].user_id}get userName(){return this[Q.rawDataSymbol].user_login}get userDisplayName(){return this[Q.rawDataSymbol].user_name}async getUser(){return(0,Q.checkRelationAssertion)(await this._client.users.getUserById(this[Q.rawDataSymbol].user_id))}get userInput(){return this[Q.rawDataSymbol].user_input}get isFulfilled(){return this[Q.rawDataSymbol].status==="FULFILLED"}get isCanceled(){return this[Q.rawDataSymbol].status==="CANCELED"}get redemptionDate(){return new Date(this[Q.rawDataSymbol].redeemed_at)}get rewardId(){return this[Q.rawDataSymbol].reward.id}get rewardTitle(){return this[Q.rawDataSymbol].reward.title}get rewardPrompt(){return this[Q.rawDataSymbol].reward.prompt}get rewardCost(){return this[Q.rawDataSymbol].reward.cost}async getReward(){return(0,Q.checkRelationAssertion)(await this._client.channelPoints.getCustomRewardById(this[Q.rawDataSymbol].broadcaster_id,this[Q.rawDataSymbol].reward.id))}async updateStatus(e){return(await this._client.channelPoints.updateRedemptionStatusByIds(this[Q.rawDataSymbol].broadcaster_id,this[Q.rawDataSymbol].reward.id,[this[Q.rawDataSymbol].id],e))[0]}};Xi.HelixCustomRewardRedemption=il;Dg.__decorate([(0,pE.Enumerable)(!1)],il.prototype,"_client",void 0);Xi.HelixCustomRewardRedemption=il=Dg.__decorate([(0,Q.rtfm)("api","HelixCustomRewardRedemption","id")],il)});var rh=u(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.HelixChannelPointsApi=void 0;var _E=(b(),x(g)),mE=Y(),ht=_(),St=Pg(),yE=je(),fE=oe(),gE=pe(),bE=le(),xE=G(),nl=Yd(),al=eh(),th=class extends xE.BaseApi{static{n(this,"HelixChannelPointsApi")}async getCustomRewards(e,t){return(await this._client.callApi({type:"helix",url:"channel_points/custom_rewards",userId:(0,ht.extractUserId)(e),scopes:["channel:read:redemptions","channel:manage:redemptions"],query:(0,St.createCustomRewardsQuery)(e,t)})).data.map(a=>new nl.HelixCustomReward(a,this._client))}async getCustomRewardsByIds(e,t){return t.length?(await this._client.callApi({type:"helix",url:"channel_points/custom_rewards",userId:(0,ht.extractUserId)(e),scopes:["channel:read:redemptions","channel:manage:redemptions"],query:(0,yE.createGetByIdsQuery)(e,t)})).data.map(a=>new nl.HelixCustomReward(a,this._client)):[]}async getCustomRewardById(e,t){let r=await this.getCustomRewardsByIds(e,[t]);return r.length?r[0]:null}async createCustomReward(e,t){let r=await this._client.callApi({type:"helix",url:"channel_points/custom_rewards",method:"POST",userId:(0,ht.extractUserId)(e),scopes:["channel:manage:redemptions"],query:(0,mE.createBroadcasterQuery)(e),jsonBody:(0,St.createCustomRewardBody)(t)});return new nl.HelixCustomReward(r.data[0],this._client)}async updateCustomReward(e,t,r){let a=await this._client.callApi({type:"helix",url:"channel_points/custom_rewards",method:"PATCH",userId:(0,ht.extractUserId)(e),scopes:["channel:manage:redemptions"],query:(0,St.createCustomRewardChangeQuery)(e,t),jsonBody:(0,St.createCustomRewardBody)(r)});return new nl.HelixCustomReward(a.data[0],this._client)}async deleteCustomReward(e,t){await this._client.callApi({type:"helix",url:"channel_points/custom_rewards",method:"DELETE",userId:(0,ht.extractUserId)(e),scopes:["channel:manage:redemptions"],query:(0,St.createCustomRewardChangeQuery)(e,t)})}async getRedemptionsByIds(e,t,r){return r.length?(await this._client.callApi({type:"helix",url:"channel_points/custom_rewards/redemptions",userId:(0,ht.extractUserId)(e),scopes:["channel:read:redemptions","channel:manage:redemptions"],query:(0,St.createRewardRedemptionsByIdsQuery)(e,t,r)})).data.map(s=>new al.HelixCustomRewardRedemption(s,this._client)):[]}async getRedemptionById(e,t,r){let a=await this.getRedemptionsByIds(e,t,[r]);return a.length?a[0]:null}async getRedemptionsForBroadcaster(e,t,r,a){let s=await this._client.callApi({type:"helix",url:"channel_points/custom_rewards/redemptions",userId:(0,ht.extractUserId)(e),scopes:["channel:read:redemptions","channel:manage:redemptions"],query:{...(0,St.createRedemptionsForBroadcasterQuery)(e,t,r,a),...(0,bE.createPaginationQuery)(a)}});return(0,gE.createPaginatedResult)(s,al.HelixCustomRewardRedemption,this._client)}getRedemptionsForBroadcasterPaginated(e,t,r,a){return new fE.HelixPaginatedRequest({url:"channel_points/custom_rewards/redemptions",userId:(0,ht.extractUserId)(e),scopes:["channel:read:redemptions","channel:manage:redemptions"],query:(0,St.createRedemptionsForBroadcasterQuery)(e,t,r,a)},this._client,s=>new al.HelixCustomRewardRedemption(s,this._client),50)}async updateRedemptionStatusByIds(e,t,r,a){return r.length?(await this._client.callApi({type:"helix",url:"channel_points/custom_rewards/redemptions",method:"PATCH",userId:(0,ht.extractUserId)(e),scopes:["channel:manage:redemptions"],query:(0,St.createRewardRedemptionsByIdsQuery)(e,t,r),jsonBody:{status:a}})).data.map(o=>new al.HelixCustomRewardRedemption(o,this._client)):[]}};Yi.HelixChannelPointsApi=th;Yi.HelixChannelPointsApi=th=_E.__decorate([(0,ht.rtfm)("api","HelixChannelPointsApi")],th)});var sl=u(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});tn.HelixCharityCampaignAmount=void 0;var wE=(b(),x(g)),en=_(),ih=class extends en.DataObject{static{n(this,"HelixCharityCampaignAmount")}get value(){return this[en.rawDataSymbol].value}get decimalPlaces(){return this[en.rawDataSymbol].decimal_places}get localizedValue(){return this.value/10**this.decimalPlaces}get currency(){return this[en.rawDataSymbol].currency}};tn.HelixCharityCampaignAmount=ih;tn.HelixCharityCampaignAmount=ih=wE.__decorate([(0,en.rtfm)("api","HelixCharityCampaignAmount")],ih)});var nh=u(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.HelixCharityCampaign=void 0;var Tg=(b(),x(g)),vE=C(),De=_(),Ig=sl(),ol=class extends De.DataObject{static{n(this,"HelixCharityCampaign")}constructor(e,t){super(e),this._client=t}get id(){return this[De.rawDataSymbol].id}get broadcasterId(){return this[De.rawDataSymbol].broadcaster_id}get broadcasterName(){return this[De.rawDataSymbol].broadcaster_login}get broadcasterDisplayName(){return this[De.rawDataSymbol].broadcaster_name}async getBroadcaster(){return(0,De.checkRelationAssertion)(await this._client.users.getUserById(this[De.rawDataSymbol].broadcaster_id))}get charityName(){return this[De.rawDataSymbol].charity_name}get charityDescription(){return this[De.rawDataSymbol].charity_description}get charityLogo(){return this[De.rawDataSymbol].charity_logo}get charityWebsite(){return this[De.rawDataSymbol].charity_website}get currentAmount(){return new Ig.HelixCharityCampaignAmount(this[De.rawDataSymbol].current_amount)}get targetAmount(){return new Ig.HelixCharityCampaignAmount(this[De.rawDataSymbol].target_amount)}};rn.HelixCharityCampaign=ol;Tg.__decorate([(0,vE.Enumerable)(!1)],ol.prototype,"_client",void 0);rn.HelixCharityCampaign=ol=Tg.__decorate([(0,De.rtfm)("api","HelixCharityCampaign","id")],ol)});var ah=u(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.HelixCharityCampaignDonation=void 0;var Rg=(b(),x(g)),SE=C(),Ht=_(),HE=sl(),ll=class extends Ht.DataObject{static{n(this,"HelixCharityCampaignDonation")}constructor(e,t){super(e),this._client=t}get campaignId(){return this[Ht.rawDataSymbol].campaign_id}get donorId(){return this[Ht.rawDataSymbol].user_id}get donorName(){return this[Ht.rawDataSymbol].user_login}get donorDisplayName(){return this[Ht.rawDataSymbol].user_name}async getDonor(){return(0,Ht.checkRelationAssertion)(await this._client.users.getUserById(this[Ht.rawDataSymbol].user_id))}get amount(){return new HE.HelixCharityCampaignAmount(this[Ht.rawDataSymbol].amount)}};nn.HelixCharityCampaignDonation=ll;Rg.__decorate([(0,SE.Enumerable)(!1)],ll.prototype,"_client",void 0);nn.HelixCharityCampaignDonation=ll=Rg.__decorate([(0,Ht.rtfm)("api","HelixCharityCampaignDonation")],ll)});var lh=u(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.HelixCharityApi=void 0;var CE=(b(),x(g)),Ug=Y(),sh=_(),qE=pe(),EE=le(),PE=G(),AE=nh(),DE=ah(),oh=class extends PE.BaseApi{static{n(this,"HelixCharityApi")}async getCharityCampaign(e){let t=await this._client.callApi({type:"helix",url:"charity/campaigns",method:"GET",userId:(0,sh.extractUserId)(e),scopes:["channel:read:charity"],query:(0,Ug.createBroadcasterQuery)(e)});return new AE.HelixCharityCampaign(t.data[0],this._client)}async getCharityCampaignDonations(e,t){let r=await this._client.callApi({type:"helix",url:"charity/donations",userId:(0,sh.extractUserId)(e),scopes:["channel:read:charity"],query:{...(0,Ug.createBroadcasterQuery)(e),...(0,EE.createPaginationQuery)(t)}});return(0,qE.createPaginatedResult)(r,DE.HelixCharityCampaignDonation,this._client)}};an.HelixCharityApi=oh;an.HelixCharityApi=oh=CE.__decorate([(0,sh.rtfm)("api","HelixCharityApi")],oh)});var Og=u(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.createSendChatMessageAsAppBody=Ie.createSendChatMessageBody=Ie.createSendChatMessageQuery=Ie.createShoutoutQuery=Ie.createChatColorUpdateQuery=Ie.createChatSettingsUpdateBody=void 0;var uh=_();function IE(i){return{slow_mode:i.slowModeEnabled,slow_mode_wait_time:i.slowModeDelay,follower_mode:i.followerOnlyModeEnabled,follower_mode_duration:i.followerOnlyModeDelay,subscriber_mode:i.subscriberOnlyModeEnabled,emote_mode:i.emoteOnlyModeEnabled,unique_chat_mode:i.uniqueChatModeEnabled,non_moderator_chat_delay:i.nonModeratorChatDelayEnabled,non_moderator_chat_delay_duration:i.nonModeratorChatDelay}}n(IE,"createChatSettingsUpdateBody");Ie.createChatSettingsUpdateBody=IE;function TE(i,e){return{user_id:(0,uh.extractUserId)(i),color:e}}n(TE,"createChatColorUpdateQuery");Ie.createChatColorUpdateQuery=TE;function RE(i,e,t){return{from_broadcaster_id:(0,uh.extractUserId)(i),to_broadcaster_id:(0,uh.extractUserId)(e),moderator_id:t}}n(RE,"createShoutoutQuery");Ie.createShoutoutQuery=RE;function UE(i,e){return{broadcaster_id:i,sender_id:e}}n(UE,"createSendChatMessageQuery");Ie.createSendChatMessageQuery=UE;function OE(i,e){return{message:i,reply_parent_message_id:e?.replyParentMessageId}}n(OE,"createSendChatMessageBody");Ie.createSendChatMessageBody=OE;function BE(i,e){return{message:i,reply_parent_message_id:e?.replyParentMessageId,for_source_only:e?.forSourceOnly}}n(BE,"createSendChatMessageAsAppBody");Ie.createSendChatMessageAsAppBody=BE});var dh=u(ul=>{"use strict";Object.defineProperty(ul,"__esModule",{value:!0});ul.HelixEmoteBase=void 0;var tt=_(),ch=class extends tt.DataObject{static{n(this,"HelixEmoteBase")}get id(){return this[tt.rawDataSymbol].id}get name(){return this[tt.rawDataSymbol].name}get formats(){return this[tt.rawDataSymbol].format}get scales(){return this[tt.rawDataSymbol].scale}get themeModes(){return this[tt.rawDataSymbol].theme_mode}getStaticImageUrl(e="1.0",t="light"){return this[tt.rawDataSymbol].format.includes("static")&&this[tt.rawDataSymbol].scale.includes(e)?this.getFormattedImageUrl(e,"static",t):null}getAnimatedImageUrl(e="1.0",t="light"){return this[tt.rawDataSymbol].format.includes("animated")&&this[tt.rawDataSymbol].scale.includes(e)?this.getFormattedImageUrl(e,"animated",t):null}getFormattedImageUrl(e="1.0",t="static",r="light"){return`https://static-cdn.jtvnw.net/emoticons/v2/${this[tt.rawDataSymbol].id}/${t}/${r}/${e}`}};ul.HelixEmoteBase=ch});var on=u(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});sn.HelixEmote=void 0;var jE=(b(),x(g)),Bg=_(),kE=dh(),hh=class extends kE.HelixEmoteBase{static{n(this,"HelixEmote")}getImageUrl(e){return this[Bg.rawDataSymbol].images[`url_${e}x`]}};sn.HelixEmote=hh;sn.HelixEmote=hh=jE.__decorate([(0,Bg.rtfm)("api","HelixEmote","id")],hh)});var ph=u(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.HelixChannelEmote=void 0;var jg=(b(),x(g)),ME=C(),ln=_(),LE=on(),cl=class extends LE.HelixEmote{static{n(this,"HelixChannelEmote")}constructor(e,t){super(e),this._client=t}get tier(){return this[ln.rawDataSymbol].tier||null}get type(){return this[ln.rawDataSymbol].emote_type}get emoteSetId(){return this[ln.rawDataSymbol].emote_set_id}async getAllEmotesFromSet(){return await this._client.chat.getEmotesFromSets([this[ln.rawDataSymbol].emote_set_id])}};un.HelixChannelEmote=cl;jg.__decorate([(0,ME.Enumerable)(!1)],cl.prototype,"_client",void 0);un.HelixChannelEmote=cl=jg.__decorate([(0,ln.rtfm)("api","HelixChannelEmote","id")],cl)});var mh=u(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.HelixChatBadgeVersion=void 0;var FE=(b(),x(g)),Gt=_(),_h=class extends Gt.DataObject{static{n(this,"HelixChatBadgeVersion")}get id(){return this[Gt.rawDataSymbol].id}getImageUrl(e){return this[Gt.rawDataSymbol][`image_url_${e}x`]}get title(){return this[Gt.rawDataSymbol].title}get description(){return this[Gt.rawDataSymbol].description}get clickAction(){return this[Gt.rawDataSymbol].click_action}get clickUrl(){return this[Gt.rawDataSymbol].click_url}};cn.HelixChatBadgeVersion=_h;cn.HelixChatBadgeVersion=_h=FE.__decorate([(0,Gt.rtfm)("api","HelixChatBadgeVersion","id")],_h)});var yh=u(dn=>{"use strict";Object.defineProperty(dn,"__esModule",{value:!0});dn.HelixChatBadgeSet=void 0;var kg=(b(),x(g)),Mg=Ci(),dl=_(),NE=mh(),hl=class extends dl.DataObject{static{n(this,"HelixChatBadgeSet")}get id(){return this[dl.rawDataSymbol].set_id}get versions(){return this[dl.rawDataSymbol].versions.map(e=>new NE.HelixChatBadgeVersion(e))}getVersion(e){var t;return(t=this.versions.find(r=>r.id===e))!==null&&t!==void 0?t:null}};dn.HelixChatBadgeSet=hl;kg.__decorate([(0,Mg.CachedGetter)()],hl.prototype,"versions",null);dn.HelixChatBadgeSet=hl=kg.__decorate([Mg.Cacheable,(0,dl.rtfm)("api","HelixChatBadgeSet","id")],hl)});var fh=u(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.HelixChatChatter=void 0;var Lg=(b(),x(g)),QE=C(),hr=_(),pl=class extends hr.DataObject{static{n(this,"HelixChatChatter")}constructor(e,t){super(e),this._client=t}get userId(){return this[hr.rawDataSymbol].user_id}get userName(){return this[hr.rawDataSymbol].user_login}get userDisplayName(){return this[hr.rawDataSymbol].user_name}async getUser(){return(0,hr.checkRelationAssertion)(await this._client.users.getUserById(this[hr.rawDataSymbol].user_id))}};hn.HelixChatChatter=pl;Lg.__decorate([(0,QE.Enumerable)(!1)],pl.prototype,"_client",void 0);hn.HelixChatChatter=pl=Lg.__decorate([(0,hr.rtfm)("api","HelixChatChatter")],pl)});var _l=u(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.HelixChatSettings=void 0;var GE=(b(),x(g)),pt=_(),gh=class extends pt.DataObject{static{n(this,"HelixChatSettings")}get broadcasterId(){return this[pt.rawDataSymbol].broadcaster_id}get slowModeEnabled(){return this[pt.rawDataSymbol].slow_mode}get slowModeDelay(){return this[pt.rawDataSymbol].slow_mode_wait_time}get followerOnlyModeEnabled(){return this[pt.rawDataSymbol].follower_mode}get followerOnlyModeDelay(){return this[pt.rawDataSymbol].follower_mode_duration}get subscriberOnlyModeEnabled(){return this[pt.rawDataSymbol].subscriber_mode}get emoteOnlyModeEnabled(){return this[pt.rawDataSymbol].emote_mode}get uniqueChatModeEnabled(){return this[pt.rawDataSymbol].unique_chat_mode}};pn.HelixChatSettings=gh;pn.HelixChatSettings=gh=GE.__decorate([(0,pt.rtfm)("api","HelixChatSettings","broadcasterId")],gh)});var bh=u(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.HelixEmoteFromSet=void 0;var Fg=(b(),x(g)),WE=C(),pr=_(),VE=on(),ml=class extends VE.HelixEmote{static{n(this,"HelixEmoteFromSet")}constructor(e,t){super(e),this._client=t}get type(){return this[pr.rawDataSymbol].emote_type}get emoteSetId(){return this[pr.rawDataSymbol].emote_set_id}get ownerId(){switch(this[pr.rawDataSymbol].owner_id){case"0":case"twitch":return null;default:return this[pr.rawDataSymbol].owner_id}}async getOwner(){switch(this[pr.rawDataSymbol].owner_id){case"0":case"twitch":return null;default:return await this._client.users.getUserById(this[pr.rawDataSymbol].owner_id)}}};_n.HelixEmoteFromSet=ml;Fg.__decorate([(0,WE.Enumerable)(!1)],ml.prototype,"_client",void 0);_n.HelixEmoteFromSet=ml=Fg.__decorate([(0,pr.rtfm)("api","HelixEmoteFromSet","id")],ml)});var xh=u(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.HelixUserEmote=void 0;var Ng=(b(),x(g)),Wt=_(),$E=dh(),zE=C(),yl=class extends $E.HelixEmoteBase{static{n(this,"HelixUserEmote")}constructor(e,t){super(e),this._client=t}get type(){return this[Wt.rawDataSymbol].emote_type}get emoteSetId(){return this[Wt.rawDataSymbol].emote_set_id||null}get ownerId(){return this[Wt.rawDataSymbol].owner_id||null}async getAllEmotesFromSet(){return this[Wt.rawDataSymbol].emote_set_id?await this._client.chat.getEmotesFromSets([this[Wt.rawDataSymbol].emote_set_id]):null}async getOwner(){return this[Wt.rawDataSymbol].owner_id?await this._client.users.getUserById(this[Wt.rawDataSymbol].owner_id):null}};mn.HelixUserEmote=yl;Ng.__decorate([(0,zE.Enumerable)(!1)],yl.prototype,"_client",void 0);mn.HelixUserEmote=yl=Ng.__decorate([(0,Wt.rtfm)("api","HelixUserEmote","id")],yl)});var Sh=u(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.HelixPrivilegedChatSettings=void 0;var KE=(b(),x(g)),wh=_(),JE=_l(),vh=class extends JE.HelixChatSettings{static{n(this,"HelixPrivilegedChatSettings")}get nonModeratorChatDelayEnabled(){return this[wh.rawDataSymbol].non_moderator_chat_delay}get nonModeratorChatDelay(){return this[wh.rawDataSymbol].non_moderator_chat_delay_duration}};yn.HelixPrivilegedChatSettings=vh;yn.HelixPrivilegedChatSettings=vh=KE.__decorate([(0,wh.rtfm)("api","HelixPrivilegedChatSettings","broadcasterId")],vh)});var Ch=u(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.HelixSentChatMessage=void 0;var ZE=(b(),x(g)),Vr=_(),Hh=class extends Vr.DataObject{static{n(this,"HelixSentChatMessage")}get id(){return this[Vr.rawDataSymbol].message_id}get isSent(){return this[Vr.rawDataSymbol].is_sent}get dropReasonCode(){var e;return(e=this[Vr.rawDataSymbol].drop_reason)===null||e===void 0?void 0:e.code}get dropReasonMessage(){var e;return(e=this[Vr.rawDataSymbol].drop_reason)===null||e===void 0?void 0:e.message}};fn.HelixSentChatMessage=Hh;fn.HelixSentChatMessage=Hh=ZE.__decorate([(0,Vr.rtfm)("api","HelixSentChatMessage","id")],Hh)});var Qg=u(fl=>{"use strict";Object.defineProperty(fl,"__esModule",{value:!0});fl.createSharedChatSessionQuery=void 0;var XE=_();function YE(i){return{broadcaster_id:(0,XE.extractUserId)(i)}}n(YE,"createSharedChatSessionQuery");fl.createSharedChatSessionQuery=YE});var qh=u(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.HelixSharedChatSessionParticipant=void 0;var Gg=(b(),x(g)),eP=C(),gn=_(),gl=class extends gn.DataObject{static{n(this,"HelixSharedChatSessionParticipant")}constructor(e,t){super(e),this._client=t}get broadcasterId(){return this[gn.rawDataSymbol].broadcaster_id}async getBroadcaster(){return(0,gn.checkRelationAssertion)(await this._client.users.getUserById(this[gn.rawDataSymbol].broadcaster_id))}};bn.HelixSharedChatSessionParticipant=gl;Gg.__decorate([(0,eP.Enumerable)(!1)],gl.prototype,"_client",void 0);bn.HelixSharedChatSessionParticipant=gl=Gg.__decorate([(0,gn.rtfm)("api","HelixSharedChatSessionParticipant","broadcasterId")],gl)});var Eh=u(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.HelixSharedChatSession=void 0;var Wg=(b(),x(g)),tP=C(),Ct=_(),rP=qh(),bl=class extends Ct.DataObject{static{n(this,"HelixSharedChatSession")}constructor(e,t){super(e),this._client=t}get sessionId(){return this[Ct.rawDataSymbol].session_id}get hostBroadcasterId(){return this[Ct.rawDataSymbol].host_broadcaster_id}async getHostBroadcaster(){return(0,Ct.checkRelationAssertion)(await this._client.users.getUserById(this[Ct.rawDataSymbol].host_broadcaster_id))}get participants(){return this[Ct.rawDataSymbol].participants.map(e=>new rP.HelixSharedChatSessionParticipant(e,this._client))}get createdDate(){return new Date(this[Ct.rawDataSymbol].created_at)}get updatedDate(){return new Date(this[Ct.rawDataSymbol].updated_at)}};xn.HelixSharedChatSession=bl;Wg.__decorate([(0,tP.Enumerable)(!1)],bl.prototype,"_client",void 0);xn.HelixSharedChatSession=bl=Wg.__decorate([(0,Ct.rtfm)("api","HelixSharedChatSession","sessionId")],bl)});var Dh=u(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.HelixChatApi=void 0;var iP=(b(),x(g)),Ph=Y(),Z=_(),_r=Og(),Vt=je(),nP=oe(),aP=Gr(),Vg=pe(),$g=le(),sP=G(),oP=ph(),zg=yh(),Kg=fh(),lP=_l(),uP=on(),cP=bh(),Jg=xh(),Zg=Sh(),Xg=Ch(),dP=Qg(),hP=Eh(),Ah=class extends sP.BaseApi{static{n(this,"HelixChatApi")}async getChatters(e,t){let r=(0,Z.extractUserId)(e),a=await this._client.callApi({type:"helix",url:"chat/chatters",userId:r,canOverrideScopedUserContext:!0,scopes:["moderator:read:chatters"],query:{...this._createModeratorActionQuery(r),...(0,$g.createPaginationQuery)(t)}});return(0,Vg.createPaginatedResultWithTotal)(a,Kg.HelixChatChatter,this._client)}getChattersPaginated(e){let t=(0,Z.extractUserId)(e);return new aP.HelixPaginatedRequestWithTotal({url:"chat/chatters",userId:t,canOverrideScopedUserContext:!0,scopes:["moderator:read:chatters"],query:this._createModeratorActionQuery(t)},this._client,r=>new Kg.HelixChatChatter(r,this._client),1e3)}async getGlobalBadges(){return(await this._client.callApi({type:"helix",url:"chat/badges/global"})).data.map(t=>new zg.HelixChatBadgeSet(t))}async getChannelBadges(e){return(await this._client.callApi({type:"helix",url:"chat/badges",userId:(0,Z.extractUserId)(e),query:(0,Ph.createBroadcasterQuery)(e)})).data.map(r=>new zg.HelixChatBadgeSet(r))}async getGlobalEmotes(){return(await this._client.callApi({type:"helix",url:"chat/emotes/global"})).data.map(t=>new uP.HelixEmote(t))}async getChannelEmotes(e){return(await this._client.callApi({type:"helix",url:"chat/emotes",userId:(0,Z.extractUserId)(e),query:(0,Ph.createBroadcasterQuery)(e)})).data.map(r=>new oP.HelixChannelEmote(r,this._client))}async getEmotesFromSets(e){return(await this._client.callApi({type:"helix",url:"chat/emotes/set",query:(0,Vt.createSingleKeyQuery)("emote_set_id",e)})).data.map(r=>new cP.HelixEmoteFromSet(r,this._client))}async getUserEmotes(e,t){let r=(0,Z.extractUserId)(e),a=await this._client.callApi({type:"helix",url:"chat/emotes/user",userId:(0,Z.extractUserId)(e),scopes:["user:read:emotes"],query:{...(0,Vt.createSingleKeyQuery)("user_id",r),...(0,Vt.createSingleKeyQuery)("broadcasterId",t?.broadcaster?(0,Z.extractUserId)(t.broadcaster):void 0),...(0,$g.createPaginationQuery)(t)}});return(0,Vg.createPaginatedResult)(a,Jg.HelixUserEmote,this._client)}getUserEmotesPaginated(e,t){let r=(0,Z.extractUserId)(e);return new nP.HelixPaginatedRequest({url:"chat/emotes/user",userId:r,scopes:["user:read:emotes"],query:{...(0,Vt.createSingleKeyQuery)("user_id",r),...(0,Vt.createSingleKeyQuery)("broadcasterId",t?(0,Z.extractUserId)(t):void 0)}},this._client,a=>new Jg.HelixUserEmote(a,this._client))}async getSettings(e){let t=await this._client.callApi({type:"helix",url:"chat/settings",userId:(0,Z.extractUserId)(e),query:(0,Ph.createBroadcasterQuery)(e)});return new lP.HelixChatSettings(t.data[0])}async getSettingsPrivileged(e){let t=(0,Z.extractUserId)(e),r=await this._client.callApi({type:"helix",url:"chat/settings",userId:t,canOverrideScopedUserContext:!0,scopes:["moderator:read:chat_settings"],query:this._createModeratorActionQuery(t)});return new Zg.HelixPrivilegedChatSettings(r.data[0])}async updateSettings(e,t){let r=(0,Z.extractUserId)(e),a=await this._client.callApi({type:"helix",url:"chat/settings",method:"PATCH",userId:r,canOverrideScopedUserContext:!0,scopes:["moderator:manage:chat_settings"],query:this._createModeratorActionQuery(r),jsonBody:(0,_r.createChatSettingsUpdateBody)(t)});return new Zg.HelixPrivilegedChatSettings(a.data[0])}async sendChatMessage(e,t,r){let a=(0,Z.extractUserId)(e),s=await this._client.callApi({type:"helix",url:"chat/messages",method:"POST",userId:a,canOverrideScopedUserContext:!0,scopes:["user:write:chat"],query:(0,_r.createSendChatMessageQuery)(a,this._getUserContextIdWithDefault(a)),jsonBody:(0,_r.createSendChatMessageBody)(t,r)});return new Xg.HelixSentChatMessage(s.data[0])}async sendChatMessageAsApp(e,t,r,a){let s=(0,Z.extractUserId)(e),o=(0,Z.extractUserId)(t),l=await this._client.callApi({type:"helix",url:"chat/messages",method:"POST",forceType:"app",query:(0,_r.createSendChatMessageQuery)(o,s),jsonBody:(0,_r.createSendChatMessageAsAppBody)(r,a)});return new Xg.HelixSentChatMessage(l.data[0])}async sendAnnouncement(e,t){let r=(0,Z.extractUserId)(e);await this._client.callApi({type:"helix",url:"chat/announcements",method:"POST",userId:r,canOverrideScopedUserContext:!0,scopes:["moderator:manage:announcements"],query:this._createModeratorActionQuery(r),jsonBody:{message:t.message,color:t.color}})}async getColorsForUsers(e){let t=await this._client.callApi({type:"helix",url:"chat/color",query:(0,Vt.createSingleKeyQuery)("user_id",e.map(Z.extractUserId))});return new Map(t.data.map(r=>[r.user_id,r.color||null]))}async getColorForUser(e){let t=await this._client.callApi({type:"helix",url:"chat/color",userId:(0,Z.extractUserId)(e),query:(0,Vt.createSingleKeyQuery)("user_id",(0,Z.extractUserId)(e))});if(t.data.length)return t.data[0].color||null}async setColorForUser(e,t){await this._client.callApi({type:"helix",url:"chat/color",method:"PUT",userId:(0,Z.extractUserId)(e),scopes:["user:manage:chat_color"],query:(0,_r.createChatColorUpdateQuery)(e,t)})}async shoutoutUser(e,t){let r=(0,Z.extractUserId)(e);await this._client.callApi({type:"helix",url:"chat/shoutouts",method:"POST",userId:r,canOverrideScopedUserContext:!0,scopes:["moderator:manage:shoutouts"],query:(0,_r.createShoutoutQuery)(e,t,this._getUserContextIdWithDefault(r))})}async getSharedChatSession(e){let t=(0,Z.extractUserId)(e),r=await this._client.callApi({type:"helix",url:"shared_chat/session",userId:t,query:(0,dP.createSharedChatSessionQuery)(t)});return r.data.length===0?null:new hP.HelixSharedChatSession(r.data[0],this._client)}_createModeratorActionQuery(e){return(0,Vt.createModeratorActionQuery)(e,this._getUserContextIdWithDefault(e))}};wn.HelixChatApi=Ah;wn.HelixChatApi=Ah=iP.__decorate([(0,Z.rtfm)("api","HelixChatApi")],Ah)});var Yg=u($r=>{"use strict";Object.defineProperty($r,"__esModule",{value:!0});$r.createClipQuery=$r.createClipCreateQuery=void 0;var pP=_();function _P(i,e){return{broadcaster_id:(0,pP.extractUserId)(i),has_delay:e.toString()}}n(_P,"createClipCreateQuery");$r.createClipCreateQuery=_P;function mP(i){let{filterType:e,ids:t,startDate:r,endDate:a,isFeatured:s}=i;return{[e]:t,started_at:r,ended_at:a,is_featured:s?.toString()}}n(mP,"createClipQuery");$r.createClipQuery=mP});var Ih=u(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.HelixClip=void 0;var eb=(b(),x(g)),yP=C(),L=_(),xl=class extends L.DataObject{static{n(this,"HelixClip")}constructor(e,t){super(e),this._client=t}get id(){return this[L.rawDataSymbol].id}get url(){return this[L.rawDataSymbol].url}get embedUrl(){return this[L.rawDataSymbol].embed_url}get broadcasterId(){return this[L.rawDataSymbol].broadcaster_id}get broadcasterDisplayName(){return this[L.rawDataSymbol].broadcaster_name}async getBroadcaster(){return(0,L.checkRelationAssertion)(await this._client.users.getUserById(this[L.rawDataSymbol].broadcaster_id))}get creatorId(){return this[L.rawDataSymbol].creator_id}get creatorDisplayName(){return this[L.rawDataSymbol].creator_name}async getCreator(){return(0,L.checkRelationAssertion)(await this._client.users.getUserById(this[L.rawDataSymbol].creator_id))}get videoId(){return this[L.rawDataSymbol].video_id}async getVideo(){return(0,L.checkRelationAssertion)(await this._client.videos.getVideoById(this[L.rawDataSymbol].video_id))}get gameId(){return this[L.rawDataSymbol].game_id}async getGame(){return this[L.rawDataSymbol].game_id?(0,L.checkRelationAssertion)(await this._client.games.getGameById(this[L.rawDataSymbol].game_id)):null}get language(){return this[L.rawDataSymbol].language}get title(){return this[L.rawDataSymbol].title}get views(){return this[L.rawDataSymbol].view_count}get creationDate(){return new Date(this[L.rawDataSymbol].created_at)}get thumbnailUrl(){return this[L.rawDataSymbol].thumbnail_url}get duration(){return this[L.rawDataSymbol].duration}get vodOffset(){return this[L.rawDataSymbol].vod_offset}get isFeatured(){return this[L.rawDataSymbol].is_featured}};vn.HelixClip=xl;eb.__decorate([(0,yP.Enumerable)(!1)],xl.prototype,"_client",void 0);vn.HelixClip=xl=eb.__decorate([(0,L.rtfm)("api","HelixClip","id")],xl)});var Uh=u(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.HelixClipApi=void 0;var tb=(b(),x(g)),fP=C(),zr=_(),Th=Yg(),gP=Ft(),bP=oe(),xP=pe(),wP=le(),vP=G(),Rh=Ih(),wl=class extends vP.BaseApi{static{n(this,"HelixClipApi")}constructor(){super(...arguments),this._getClipByIdBatcher=new gP.HelixRequestBatcher({url:"clips"},"id","id",this._client,e=>new Rh.HelixClip(e,this._client))}async getClipsForBroadcaster(e,t={}){return await this._getClips({...t,filterType:"broadcaster_id",ids:(0,zr.extractUserId)(e),userId:(0,zr.extractUserId)(e)})}getClipsForBroadcasterPaginated(e,t={}){return this._getClipsPaginated({...t,filterType:"broadcaster_id",ids:(0,zr.extractUserId)(e),userId:(0,zr.extractUserId)(e)})}async getClipsForGame(e,t={}){return await this._getClips({...t,filterType:"game_id",ids:e})}getClipsForGamePaginated(e,t={}){return this._getClipsPaginated({...t,filterType:"game_id",ids:e})}async getClipsByIds(e){return(await this._getClips({filterType:"id",ids:e})).data}async getClipById(e){let t=await this.getClipsByIds([e]);return t.length?t[0]:null}async getClipByIdBatched(e){return await this._getClipByIdBatcher.request(e)}async createClip(e){let{channel:t,createAfterDelay:r=!1}=e;return(await this._client.callApi({type:"helix",url:"clips",method:"POST",userId:(0,zr.extractUserId)(t),scopes:["clips:edit"],canOverrideScopedUserContext:!0,query:(0,Th.createClipCreateQuery)(t,r)})).data[0].id}async _getClips(e){if(!e.ids.length)return{data:[]};let t=await this._client.callApi({type:"helix",url:"clips",userId:e.userId,query:{...(0,Th.createClipQuery)(e),...(0,wP.createPaginationQuery)(e)}});return(0,xP.createPaginatedResult)(t,Rh.HelixClip,this._client)}_getClipsPaginated(e){return new bP.HelixPaginatedRequest({url:"clips",userId:e.userId,query:(0,Th.createClipQuery)(e)},this._client,t=>new Rh.HelixClip(t,this._client))}};Sn.HelixClipApi=wl;tb.__decorate([(0,fP.Enumerable)(!1)],wl.prototype,"_getClipByIdBatcher",void 0);Sn.HelixClipApi=wl=tb.__decorate([(0,zr.rtfm)("api","HelixClipApi")],wl)});var Bh=u(Sl=>{"use strict";Object.defineProperty(Sl,"__esModule",{value:!0});Sl.HelixContentClassificationLabel=void 0;var vl=_(),Oh=class extends vl.DataObject{static{n(this,"HelixContentClassificationLabel")}get id(){return this[vl.rawDataSymbol].id}get name(){return this[vl.rawDataSymbol].name}get description(){return this[vl.rawDataSymbol].description}};Sl.HelixContentClassificationLabel=Oh});var kh=u(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.HelixContentClassificationLabelApi=void 0;var SP=(b(),x(g)),HP=_(),CP=G(),qP=Bh(),jh=class extends CP.BaseApi{static{n(this,"HelixContentClassificationLabelApi")}async getAll(e){return(await this._client.callApi({url:"content_classification_labels",query:{locale:e}})).data.map(r=>new qP.HelixContentClassificationLabel(r))}};Hn.HelixContentClassificationLabelApi=jh;Hn.HelixContentClassificationLabelApi=jh=SP.__decorate([(0,HP.rtfm)("api","HelixContentClassificationLabelApi")],jh)});var rb=u(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.createDropsEntitlementUpdateBody=Kr.createDropsEntitlementQuery=void 0;var EP=C(),PP=_();function AP(i,e){return{user_id:e?(0,EP.mapOptional)(i.user,PP.extractUserId):void 0,game_id:i.gameId,fulfillment_status:i.fulfillmentStatus}}n(AP,"createDropsEntitlementQuery");Kr.createDropsEntitlementQuery=AP;function DP(i,e){return{fulfillment_status:e,entitlement_ids:i}}n(DP,"createDropsEntitlementUpdateBody");Kr.createDropsEntitlementUpdateBody=DP});var Mh=u(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});Cn.HelixDropsEntitlement=void 0;var ib=(b(),x(g)),IP=C(),ke=_(),Hl=class extends ke.DataObject{static{n(this,"HelixDropsEntitlement")}constructor(e,t){super(e),this._client=t}get id(){return this[ke.rawDataSymbol].id}get rewardId(){return this[ke.rawDataSymbol].benefit_id}get grantDate(){return new Date(this[ke.rawDataSymbol].timestamp)}get userId(){return this[ke.rawDataSymbol].user_id}async getUser(){return(0,ke.checkRelationAssertion)(await this._client.users.getUserById(this[ke.rawDataSymbol].user_id))}get gameId(){return this[ke.rawDataSymbol].game_id}async getGame(){return(0,ke.checkRelationAssertion)(await this._client.games.getGameById(this[ke.rawDataSymbol].game_id))}get fulfillmentStatus(){return this[ke.rawDataSymbol].fulfillment_status}get updateDate(){return new Date(this[ke.rawDataSymbol].last_updated)}};Cn.HelixDropsEntitlement=Hl;ib.__decorate([(0,IP.Enumerable)(!1)],Hl.prototype,"_client",void 0);Cn.HelixDropsEntitlement=Hl=ib.__decorate([(0,ke.rtfm)("api","HelixDropsEntitlement")],Hl)});var Qh=u(qn=>{"use strict";Object.defineProperty(qn,"__esModule",{value:!0});qn.HelixEntitlementApi=void 0;var nb=(b(),x(g)),Fh=C(),Nh=_(),Lh=rb(),TP=Ft(),RP=oe(),UP=pe(),OP=le(),BP=G(),Cl=Mh(),ql=class extends BP.BaseApi{static{n(this,"HelixEntitlementApi")}constructor(){super(...arguments),this._getDropsEntitlementByIdBatcher=new TP.HelixRequestBatcher({url:"entitlements/drops"},"id","id",this._client,e=>new Cl.HelixDropsEntitlement(e,this._client))}async getDropsEntitlements(e,t=!1){let r=await this._client.callApi({type:"helix",url:"entitlements/drops",userId:(0,Fh.mapOptional)(e.user,Nh.extractUserId),forceType:e.user&&t?"app":void 0,query:{...(0,Lh.createDropsEntitlementQuery)(e,t),...(0,OP.createPaginationQuery)(e)}});return(0,UP.createPaginatedResult)(r,Cl.HelixDropsEntitlement,this._client)}getDropsEntitlementsPaginated(e,t=!1){return new RP.HelixPaginatedRequest({url:"entitlements/drops",userId:(0,Fh.mapOptional)(e.user,Nh.extractUserId),forceType:e.user&&t?"app":void 0,query:(0,Lh.createDropsEntitlementQuery)(e,t)},this._client,r=>new Cl.HelixDropsEntitlement(r,this._client))}async getDropsEntitlementsByIds(e){return(await this._client.callApi({type:"helix",url:"entitlements/drops",query:{id:e}})).data.map(r=>new Cl.HelixDropsEntitlement(r,this._client))}async getDropsEntitlementById(e){var t;return(t=(await this.getDropsEntitlementsByIds([e]))[0])!==null&&t!==void 0?t:null}async getDropsEntitlementByIdBatched(e){return await this._getDropsEntitlementByIdBatcher.request(e)}async updateDropsEntitlements(e,t){let r=await this._client.callApi({type:"helix",url:"entitlements/drops",method:"PATCH",jsonBody:(0,Lh.createDropsEntitlementUpdateBody)(e,t)});return new Map(r.data.flatMap(a=>a.ids.map(s=>[s,a.status])))}};qn.HelixEntitlementApi=ql;nb.__decorate([(0,Fh.Enumerable)(!1)],ql.prototype,"_getDropsEntitlementByIdBatcher",void 0);qn.HelixEntitlementApi=ql=nb.__decorate([(0,Nh.rtfm)("api","HelixEntitlementApi")],ql)});var sb=u(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.createEventSubConduitShardsUpdateCondition=ye.createEventSubConduitUpdateCondition=ye.createEventSubConduitCondition=ye.createEventSubDropEntitlementGrantCondition=ye.createEventSubUserCondition=ye.createEventSubModeratorCondition=ye.createEventSubRewardCondition=ye.createEventSubBroadcasterCondition=void 0;var ab=_();function jP(i){return{broadcaster_user_id:(0,ab.extractUserId)(i)}}n(jP,"createEventSubBroadcasterCondition");ye.createEventSubBroadcasterCondition=jP;function kP(i,e){return{broadcaster_user_id:(0,ab.extractUserId)(i),reward_id:e}}n(kP,"createEventSubRewardCondition");ye.createEventSubRewardCondition=kP;function MP(i,e){return{broadcaster_user_id:i,moderator_user_id:e}}n(MP,"createEventSubModeratorCondition");ye.createEventSubModeratorCondition=MP;function LP(i,e){return{broadcaster_user_id:i,user_id:e}}n(LP,"createEventSubUserCondition");ye.createEventSubUserCondition=LP;function FP(i){return{organization_id:i.organizationId,category_id:i.categoryId,campaign_id:i.campaignId}}n(FP,"createEventSubDropEntitlementGrantCondition");ye.createEventSubDropEntitlementGrantCondition=FP;function NP(i,e){return{conduit_id:i,status:e}}n(NP,"createEventSubConduitCondition");ye.createEventSubConduitCondition=NP;function QP(i,e){return{id:i,shard_count:e.toString()}}n(QP,"createEventSubConduitUpdateCondition");ye.createEventSubConduitUpdateCondition=QP;function GP(i,e){return{conduit_id:i,shards:e}}n(GP,"createEventSubConduitShardsUpdateCondition");ye.createEventSubConduitShardsUpdateCondition=GP});var Pl=u(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.HelixEventSubSubscription=void 0;var ob=(b(),x(g)),WP=C(),Ke=_(),El=class extends Ke.DataObject{static{n(this,"HelixEventSubSubscription")}constructor(e,t){super(e),this._client=t}get id(){return this[Ke.rawDataSymbol].id}get status(){return this[Ke.rawDataSymbol].status}get type(){return this[Ke.rawDataSymbol].type}get cost(){return this[Ke.rawDataSymbol].cost}get condition(){return this[Ke.rawDataSymbol].condition}get creationDate(){return new Date(this[Ke.rawDataSymbol].created_at)}get transportMethod(){return this[Ke.rawDataSymbol].transport.method}async unsubscribe(){await this._client.eventSub.deleteSubscription(this[Ke.rawDataSymbol].id)}get _transport(){return this[Ke.rawDataSymbol].transport}set _status(e){this[Ke.rawDataSymbol].status=e}};En.HelixEventSubSubscription=El;ob.__decorate([(0,WP.Enumerable)(!1)],El.prototype,"_client",void 0);En.HelixEventSubSubscription=El=ob.__decorate([(0,Ke.rtfm)("api","HelixEventSubSubscription","id")],El)});var Wh=u(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.HelixPaginatedEventSubSubscriptionsRequest=void 0;var VP=(b(),x(g)),$P=_(),zP=Gr(),KP=Pl(),Gh=class extends zP.HelixPaginatedRequestWithTotal{static{n(this,"HelixPaginatedEventSubSubscriptionsRequest")}constructor(e,t,r){super({url:"eventsub/subscriptions",userId:t,query:e},r,a=>new KP.HelixEventSubSubscription(a,r))}async getTotalCost(){var e;return((e=this._currentData)!==null&&e!==void 0?e:await this._fetchData({query:{after:void 0}})).total_cost}async getMaxTotalCost(){var e;return((e=this._currentData)!==null&&e!==void 0?e:await this._fetchData({query:{after:void 0}})).max_total_cost}};Pn.HelixPaginatedEventSubSubscriptionsRequest=Gh;Pn.HelixPaginatedEventSubSubscriptionsRequest=Gh=VP.__decorate([(0,$P.rtfm)("api","HelixPaginatedEventSubSubscriptionsRequest")],Gh)});var Vh=u(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.HelixEventSubConduit=void 0;var lb=(b(),x(g)),JP=C(),mr=_(),Al=class extends mr.DataObject{static{n(this,"HelixEventSubConduit")}constructor(e,t){super(e),this._client=t}get id(){return this[mr.rawDataSymbol].id}get shardCount(){return this[mr.rawDataSymbol].shard_count}async update(e){return await this._client.eventSub.updateConduit(this[mr.rawDataSymbol].id,e)}async delete(){await this._client.eventSub.deleteConduit(this[mr.rawDataSymbol].id)}async getShards(){return await this._client.eventSub.getConduitShards(this[mr.rawDataSymbol].id)}};An.HelixEventSubConduit=Al;lb.__decorate([(0,JP.Enumerable)(!1)],Al.prototype,"_client",void 0);An.HelixEventSubConduit=Al=lb.__decorate([(0,mr.rtfm)("api","HelixEventSubConduit")],Al)});var zh=u(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.HelixEventSubConduitShard=void 0;var ZP=(b(),x(g)),Dn=_(),$h=class extends Dn.DataObject{static{n(this,"HelixEventSubConduitShard")}get id(){return this[Dn.rawDataSymbol].id}get status(){return this[Dn.rawDataSymbol].status}get transportMethod(){return this[Dn.rawDataSymbol].transport.method}};In.HelixEventSubConduitShard=$h;In.HelixEventSubConduitShard=$h=ZP.__decorate([(0,Dn.rtfm)("api","HelixEventSubConduitShard")],$h)});var Xh=u(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.HelixEventSubApi=void 0;var XP=(b(),x(g)),YP=C(),R=_(),S=sb(),rt=je(),eA=oe(),Tn=pe(),Rn=le(),tA=G(),Un=Pl(),Dl=Wh(),Kh=Vh(),Jh=zh(),Zh=class extends tA.BaseApi{static{n(this,"HelixEventSubApi")}async getSubscriptions(e){let t=await this._client.callApi({type:"helix",url:"eventsub/subscriptions",query:(0,Rn.createPaginationQuery)(e)});return{...(0,Tn.createPaginatedResultWithTotal)(t,Un.HelixEventSubSubscription,this._client),totalCost:t.total_cost,maxTotalCost:t.max_total_cost}}getSubscriptionsPaginated(){return new Dl.HelixPaginatedEventSubSubscriptionsRequest({},void 0,this._client)}async getSubscriptionsForStatus(e,t){let r=await this._client.callApi({type:"helix",url:"eventsub/subscriptions",query:{...(0,Rn.createPaginationQuery)(t),status:e}});return{...(0,Tn.createPaginatedResultWithTotal)(r,Un.HelixEventSubSubscription,this._client),totalCost:r.total_cost,maxTotalCost:r.max_total_cost}}getSubscriptionsForStatusPaginated(e){return new Dl.HelixPaginatedEventSubSubscriptionsRequest({status:e},void 0,this._client)}async getSubscriptionsForType(e,t){let r=await this._client.callApi({type:"helix",url:"eventsub/subscriptions",query:{...(0,Rn.createPaginationQuery)(t),type:e}});return{...(0,Tn.createPaginatedResultWithTotal)(r,Un.HelixEventSubSubscription,this._client),totalCost:r.total_cost,maxTotalCost:r.max_total_cost}}getSubscriptionsForTypePaginated(e){return new Dl.HelixPaginatedEventSubSubscriptionsRequest({type:e},void 0,this._client)}async getSubscriptionsForUser(e,t){let r=await this._client.callApi({type:"helix",url:"eventsub/subscriptions",userId:(0,R.extractUserId)(e),query:{...(0,rt.createSingleKeyQuery)("user_id",(0,R.extractUserId)(e)),...(0,Rn.createPaginationQuery)(t)}});return{...(0,Tn.createPaginatedResultWithTotal)(r,Un.HelixEventSubSubscription,this._client),totalCost:r.total_cost,maxTotalCost:r.max_total_cost}}getSubscriptionsForUserPaginated(e){let t=(0,R.extractUserId)(e);return new Dl.HelixPaginatedEventSubSubscriptionsRequest((0,rt.createSingleKeyQuery)("user_id",t),t,this._client)}async createSubscription(e,t,r,a,s,o,l,d){let p=a.method==="webhook"||a.method==="conduit",h=p?void 0:o;if(!p&&!s)throw new Error(`Transport ${a.method} can only handle subscriptions with user context`);let w={type:e,version:t,condition:r,transport:a};d&&(w.is_batching_enabled=!0);let E=await this._client.callApi({type:"helix",url:"eventsub/subscriptions",method:"POST",scopes:h,userId:(0,YP.mapOptional)(s,R.extractUserId),canOverrideScopedUserContext:l,forceType:p?"app":"user",jsonBody:w});return new Un.HelixEventSubSubscription(E.data[0],this._client)}async deleteSubscription(e){await this._client.callApi({type:"helix",url:"eventsub/subscriptions",method:"DELETE",query:{id:e}})}async deleteAllSubscriptions(){await this._deleteSubscriptionsWithCondition()}async deleteBrokenSubscriptions(){await this._deleteSubscriptionsWithCondition(e=>e.status!=="enabled"&&e.status!=="webhook_callback_verification_pending")}async subscribeToStreamOnlineEvents(e,t){return await this.createSubscription("stream.online","1",(0,S.createEventSubBroadcasterCondition)(e),t,e)}async subscribeToStreamOfflineEvents(e,t){return await this.createSubscription("stream.offline","1",(0,S.createEventSubBroadcasterCondition)(e),t,e)}async subscribeToChannelUpdateEvents(e,t){return await this.createSubscription("channel.update","2",(0,S.createEventSubBroadcasterCondition)(e),t,e)}async subscribeToChannelFollowEvents(e,t){let r=(0,R.extractUserId)(e);return await this.createSubscription("channel.follow","2",(0,S.createEventSubModeratorCondition)(r,this._getUserContextIdWithDefault(r)),t,r,["moderator:read:followers"],!0)}async subscribeToChannelSubscriptionEvents(e,t){return await this.createSubscription("channel.subscribe","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:subscriptions"])}async subscribeToChannelSubscriptionGiftEvents(e,t){return await this.createSubscription("channel.subscription.gift","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:subscriptions"])}async subscribeToChannelSubscriptionMessageEvents(e,t){return await this.createSubscription("channel.subscription.message","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:subscriptions"])}async subscribeToChannelSubscriptionEndEvents(e,t){return await this.createSubscription("channel.subscription.end","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:subscriptions"])}async subscribeToChannelCheerEvents(e,t){return await this.createSubscription("channel.cheer","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["bits:read"])}async subscribeToChannelCharityCampaignStartEvents(e,t){return await this.createSubscription("channel.charity_campaign.start","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:charity"])}async subscribeToChannelCharityCampaignStopEvents(e,t){return await this.createSubscription("channel.charity_campaign.stop","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:charity"])}async subscribeToChannelCharityDonationEvents(e,t){return await this.createSubscription("channel.charity_campaign.donate","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:charity"])}async subscribeToChannelCharityCampaignProgressEvents(e,t){return await this.createSubscription("channel.charity_campaign.progress","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:charity"])}async subscribeToChannelBanEvents(e,t){return await this.createSubscription("channel.ban","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:moderate"])}async subscribeToChannelUnbanEvents(e,t){return await this.createSubscription("channel.unban","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:moderate"])}async subscribeToChannelShieldModeBeginEvents(e,t){let r=(0,R.extractUserId)(e);return await this.createSubscription("channel.shield_mode.begin","1",(0,S.createEventSubModeratorCondition)(r,this._getUserContextIdWithDefault(r)),t,r,["moderator:read:shield_mode","moderator:manage:shield_mode"],!0)}async subscribeToChannelShieldModeEndEvents(e,t){let r=(0,R.extractUserId)(e);return await this.createSubscription("channel.shield_mode.end","1",(0,S.createEventSubModeratorCondition)(r,this._getUserContextIdWithDefault(r)),t,r,["moderator:read:shield_mode","moderator:manage:shield_mode"],!0)}async subscribeToChannelModeratorAddEvents(e,t){return await this.createSubscription("channel.moderator.add","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["moderation:read"])}async subscribeToChannelModeratorRemoveEvents(e,t){return await this.createSubscription("channel.moderator.remove","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["moderation:read"])}async subscribeToChannelRaidEventsFrom(e,t){return await this.createSubscription("channel.raid","1",(0,rt.createSingleKeyQuery)("from_broadcaster_user_id",(0,R.extractUserId)(e)),t,e)}async subscribeToChannelRaidEventsTo(e,t){return await this.createSubscription("channel.raid","1",(0,rt.createSingleKeyQuery)("to_broadcaster_user_id",(0,R.extractUserId)(e)),t,e)}async subscribeToChannelRewardAddEvents(e,t){return await this.createSubscription("channel.channel_points_custom_reward.add","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:redemptions","channel:manage:redemptions"])}async subscribeToChannelRewardUpdateEvents(e,t){return await this.createSubscription("channel.channel_points_custom_reward.update","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:redemptions","channel:manage:redemptions"])}async subscribeToChannelRewardUpdateEventsForReward(e,t,r){return await this.createSubscription("channel.channel_points_custom_reward.update","1",(0,S.createEventSubRewardCondition)(e,t),r,e,["channel:read:redemptions","channel:manage:redemptions"])}async subscribeToChannelRewardRemoveEvents(e,t){return await this.createSubscription("channel.channel_points_custom_reward.remove","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:redemptions","channel:manage:redemptions"])}async subscribeToChannelRewardRemoveEventsForReward(e,t,r){return await this.createSubscription("channel.channel_points_custom_reward.remove","1",(0,S.createEventSubRewardCondition)(e,t),r,e,["channel:read:redemptions","channel:manage:redemptions"])}async subscribeToChannelRedemptionAddEvents(e,t){return await this.createSubscription("channel.channel_points_custom_reward_redemption.add","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:redemptions","channel:manage:redemptions"])}async subscribeToChannelRedemptionAddEventsForReward(e,t,r){return await this.createSubscription("channel.channel_points_custom_reward_redemption.add","1",(0,S.createEventSubRewardCondition)(e,t),r,e,["channel:read:redemptions","channel:manage:redemptions"])}async subscribeToChannelRedemptionUpdateEvents(e,t){return await this.createSubscription("channel.channel_points_custom_reward_redemption.update","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:redemptions","channel:manage:redemptions"])}async subscribeToChannelRedemptionUpdateEventsForReward(e,t,r){return await this.createSubscription("channel.channel_points_custom_reward_redemption.update","1",(0,S.createEventSubRewardCondition)(e,t),r,e,["channel:read:redemptions","channel:manage:redemptions"])}async subscribeToChannelAutomaticRewardRedemptionAddEvents(e,t){return await this.createSubscription("channel.channel_points_automatic_reward_redemption.add","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:redemptions","channel:manage:redemptions"])}async subscribeToChannelAutomaticRewardRedemptionAddV2Events(e,t){return await this.createSubscription("channel.channel_points_automatic_reward_redemption.add","2",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:redemptions","channel:manage:redemptions"])}async subscribeToChannelPollBeginEvents(e,t){return await this.createSubscription("channel.poll.begin","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:polls","channel:manage:polls"])}async subscribeToChannelPollProgressEvents(e,t){return await this.createSubscription("channel.poll.progress","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:polls","channel:manage:polls"])}async subscribeToChannelPollEndEvents(e,t){return await this.createSubscription("channel.poll.end","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:polls","channel:manage:polls"])}async subscribeToChannelPredictionBeginEvents(e,t){return await this.createSubscription("channel.prediction.begin","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:predictions","channel:manage:predictions"])}async subscribeToChannelPredictionProgressEvents(e,t){return await this.createSubscription("channel.prediction.progress","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:predictions","channel:manage:predictions"])}async subscribeToChannelPredictionLockEvents(e,t){return await this.createSubscription("channel.prediction.lock","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:predictions","channel:manage:predictions"])}async subscribeToChannelPredictionEndEvents(e,t){return await this.createSubscription("channel.prediction.end","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:predictions","channel:manage:predictions"])}async subscribeToChannelGoalBeginEvents(e,t){return await this.createSubscription("channel.goal.begin","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:goals"])}async subscribeToChannelGoalProgressEvents(e,t){return await this.createSubscription("channel.goal.progress","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:goals"])}async subscribeToChannelGoalEndEvents(e,t){return await this.createSubscription("channel.goal.end","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:goals"])}async subscribeToChannelHypeTrainBeginEvents(e,t){return await this.createSubscription("channel.hype_train.begin","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:hype_train"])}async subscribeToChannelHypeTrainProgressEvents(e,t){return await this.createSubscription("channel.hype_train.progress","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:hype_train"])}async subscribeToChannelHypeTrainEndEvents(e,t){return await this.createSubscription("channel.hype_train.end","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:hype_train"])}async subscribeToChannelHypeTrainBeginV2Events(e,t){return await this.createSubscription("channel.hype_train.begin","2",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:hype_train"])}async subscribeToChannelHypeTrainProgressV2Events(e,t){return await this.createSubscription("channel.hype_train.progress","2",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:hype_train"])}async subscribeToChannelHypeTrainEndV2Events(e,t){return await this.createSubscription("channel.hype_train.end","2",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:hype_train"])}async subscribeToChannelShoutoutCreateEvents(e,t){let r=(0,R.extractUserId)(e);return await this.createSubscription("channel.shoutout.create","1",(0,S.createEventSubModeratorCondition)(r,this._getUserContextIdWithDefault(r)),t,r,["moderator:read:shoutouts","moderator:manage:shoutouts"],!0)}async subscribeToChannelShoutoutReceiveEvents(e,t){let r=(0,R.extractUserId)(e);return await this.createSubscription("channel.shoutout.receive","1",(0,S.createEventSubModeratorCondition)(r,this._getUserContextIdWithDefault(r)),t,r,["moderator:read:shoutouts","moderator:manage:shoutouts"],!0)}async subscribeToChannelAdBreakBeginEvents(e,t){return await this.createSubscription("channel.ad_break.begin","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:ads"])}async subscribeToChannelChatClearEvents(e,t){let r=(0,R.extractUserId)(e);return await this.createSubscription("channel.chat.clear","1",(0,S.createEventSubUserCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["user:read:chat"],!0)}async subscribeToChannelChatClearUserMessagesEvents(e,t){let r=(0,R.extractUserId)(e);return await this.createSubscription("channel.chat.clear_user_messages","1",(0,S.createEventSubUserCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["user:read:chat"],!0)}async subscribeToChannelChatMessageDeleteEvents(e,t){let r=(0,R.extractUserId)(e);return await this.createSubscription("channel.chat.message_delete","1",(0,S.createEventSubUserCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["user:read:chat"],!0)}async subscribeToChannelChatNotificationEvents(e,t){let r=(0,R.extractUserId)(e);return await this.createSubscription("channel.chat.notification","1",(0,S.createEventSubUserCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["user:read:chat"],!0)}async subscribeToChannelChatMessageEvents(e,t){let r=(0,R.extractUserId)(e);return await this.createSubscription("channel.chat.message","1",(0,S.createEventSubUserCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["user:read:chat"],!0)}async subscribeToChannelChatSettingsUpdateEvents(e,t){let r=(0,R.extractUserId)(e);return await this.createSubscription("channel.chat_settings.update","1",(0,S.createEventSubUserCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["user:read:chat"],!0)}async subscribeToChannelUnbanRequestCreateEvents(e,t){let r=(0,R.extractUserId)(e);return await this.createSubscription("channel.unban_request.create","1",(0,S.createEventSubModeratorCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["moderator:read:unban_requests","moderator:manage:unban_requests"],!0)}async subscribeToChannelUnbanRequestResolveEvents(e,t){let r=(0,R.extractUserId)(e);return await this.createSubscription("channel.unban_request.resolve","1",(0,S.createEventSubModeratorCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["moderator:read:unban_requests","moderator:manage:unban_requests"],!0)}async subscribeToChannelModerateEvents(e,t){let r=(0,R.extractUserId)(e);return await this.createSubscription("channel.moderate","2",(0,S.createEventSubModeratorCondition)(r,this._getUserContextIdWithDefault(r)),t,e,[],!0)}async subscribeToChannelWarningAcknowledgeEvents(e,t){let r=(0,R.extractUserId)(e);return await this.createSubscription("channel.warning.acknowledge","1",(0,S.createEventSubModeratorCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["moderator:read:warnings","moderator:manage:warnings"],!0)}async subscribeToChannelWarningSendEvents(e,t){let r=(0,R.extractUserId)(e);return await this.createSubscription("channel.warning.send","1",(0,S.createEventSubModeratorCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["moderator:read:warnings","moderator:manage:warnings"],!0)}async subscribeToChannelVipAddEvents(e,t){return await this.createSubscription("channel.vip.add","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:vips","channel:manage:vips"])}async subscribeToChannelVipRemoveEvents(e,t){return await this.createSubscription("channel.vip.remove","1",(0,S.createEventSubBroadcasterCondition)(e),t,e,["channel:read:vips","channel:manage:vips"])}async subscribeToExtensionBitsTransactionCreateEvents(e,t){return await this.createSubscription("extension.bits_transaction.create","1",(0,rt.createSingleKeyQuery)("extension_client_id",e),t)}async subscribeToUserAuthorizationGrantEvents(e,t){return await this.createSubscription("user.authorization.grant","1",(0,rt.createSingleKeyQuery)("client_id",e),t)}async subscribeToUserAuthorizationRevokeEvents(e,t){return await this.createSubscription("user.authorization.revoke","1",(0,rt.createSingleKeyQuery)("client_id",e),t)}async subscribeToUserUpdateEvents(e,t,r){return await this.createSubscription("user.update","1",(0,rt.createSingleKeyQuery)("user_id",(0,R.extractUserId)(e)),t,e,r?["user:read:email"]:void 0)}async subscribeToUserWhisperMessageEvents(e,t){return await this.createSubscription("user.whisper.message","1",(0,rt.createSingleKeyQuery)("user_id",(0,R.extractUserId)(e)),t,e,["user:read:whispers","user:manage:whispers"])}async subscribeToDropEntitlementGrantEvents(e,t){return await this.createSubscription("drop.entitlement.grant","1",(0,S.createEventSubDropEntitlementGrantCondition)(e),t,void 0,void 0,!1,!0)}async subscribeToAutoModMessageHoldEvents(e,t){let r=(0,R.extractUserId)(e);return await this.createSubscription("automod.message.hold","1",(0,S.createEventSubModeratorCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["moderator:manage:automod"],!0)}async subscribeToAutoModMessageUpdateEvents(e,t){let r=(0,R.extractUserId)(e);return await this.createSubscription("automod.message.update","1",(0,S.createEventSubModeratorCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["moderator:manage:automod"],!0)}async subscribeToAutoModMessageHoldV2Events(e,t){let r=(0,R.extractUserId)(e);return await this.createSubscription("automod.message.hold","2",(0,S.createEventSubModeratorCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["moderator:manage:automod"],!0)}async subscribeToAutoModMessageUpdateV2Events(e,t){let r=(0,R.extractUserId)(e);return await this.createSubscription("automod.message.update","2",(0,S.createEventSubModeratorCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["moderator:manage:automod"],!0)}async subscribeToAutoModSettingsUpdateEvents(e,t){let r=(0,R.extractUserId)(e);return await this.createSubscription("automod.settings.update","1",(0,S.createEventSubModeratorCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["moderator:read:automod_settings"],!0)}async subscribeToAutoModTermsUpdateEvents(e,t){let r=(0,R.extractUserId)(e);return await this.createSubscription("automod.terms.update","1",(0,S.createEventSubModeratorCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["moderator:manage:automod"],!0)}async subscribeToChannelChatUserMessageHoldEvents(e,t){let r=(0,R.extractUserId)(e);return await this.createSubscription("channel.chat.user_message_hold","1",(0,S.createEventSubUserCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["user:read:chat"],!0)}async subscribeToChannelChatUserMessageUpdateEvents(e,t){let r=(0,R.extractUserId)(e);return await this.createSubscription("channel.chat.user_message_update","1",(0,S.createEventSubUserCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["user:read:chat"],!0)}async subscribeToChannelSuspiciousUserUpdateEvents(e,t){let r=(0,R.extractUserId)(e);return await this.createSubscription("channel.suspicious_user.update","1",(0,S.createEventSubModeratorCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["moderator:read:suspicious_users"],!0)}async subscribeToChannelSuspiciousUserMessageEvents(e,t){let r=(0,R.extractUserId)(e);return await this.createSubscription("channel.suspicious_user.message","1",(0,S.createEventSubModeratorCondition)(r,this._getUserContextIdWithDefault(r)),t,e,["moderator:read:suspicious_users"],!0)}async subscribeToChannelSharedChatSessionBeginEvents(e,t){let r=(0,R.extractUserId)(e);return await this.createSubscription("channel.shared_chat.begin","1",(0,S.createEventSubBroadcasterCondition)(r),t,r)}async subscribeToChannelSharedChatSessionUpdateEvents(e,t){let r=(0,R.extractUserId)(e);return await this.createSubscription("channel.shared_chat.update","1",(0,S.createEventSubBroadcasterCondition)(r),t,r)}async subscribeToChannelSharedChatSessionEndEvents(e,t){let r=(0,R.extractUserId)(e);return await this.createSubscription("channel.shared_chat.end","1",(0,S.createEventSubBroadcasterCondition)(r),t,r)}async subscribeToChannelBitsUseEvents(e,t){let r=(0,R.extractUserId)(e);return await this.createSubscription("channel.bits.use","1",(0,S.createEventSubBroadcasterCondition)(r),t,r,["bits:read"])}async getConduits(){return(await this._client.callApi({type:"helix",url:"eventsub/conduits"})).data.map(t=>new Kh.HelixEventSubConduit(t,this._client))}async createConduit(e){let t=await this._client.callApi({type:"helix",url:"eventsub/conduits",method:"POST",query:{...(0,rt.createSingleKeyQuery)("shard_count",e.toString())}});return new Kh.HelixEventSubConduit(t.data[0],this._client)}async updateConduit(e,t){let r=await this._client.callApi({type:"helix",url:"eventsub/conduits",method:"PATCH",query:(0,S.createEventSubConduitUpdateCondition)(e,t)});return new Kh.HelixEventSubConduit(r.data[0],this._client)}async deleteConduit(e){await this._client.callApi({type:"helix",url:"eventsub/conduits",method:"DELETE",query:{...(0,rt.createSingleKeyQuery)("id",e)}})}async getConduitShards(e,t,r){let a=await this._client.callApi({type:"helix",url:"eventsub/conduits/shards",query:{...(0,S.createEventSubConduitCondition)(e,t),...(0,Rn.createPaginationQuery)(r)}});return{...(0,Tn.createPaginatedResult)(a,Jh.HelixEventSubConduitShard,this._client)}}getConduitShardsPaginated(e,t){return new eA.HelixPaginatedRequest({url:"eventsub/conduits/shards",query:(0,S.createEventSubConduitCondition)(e,t)},this._client,r=>new Jh.HelixEventSubConduitShard(r))}async updateConduitShards(e,t){return(await this._client.callApi({type:"helix",url:"eventsub/conduits/shards",method:"PATCH",jsonBody:(0,S.createEventSubConduitShardsUpdateCondition)(e,t)})).data.map(a=>new Jh.HelixEventSubConduitShard(a))}async _deleteSubscriptionsWithCondition(e){let t=this.getSubscriptionsPaginated();for await(let r of t)(!e||e(r))&&await r.unsubscribe()}};On.HelixEventSubApi=Zh;On.HelixEventSubApi=Zh=XP.__decorate([(0,R.rtfm)("api","HelixEventSubApi")],Zh)});var ub=u($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.createExtensionTransactionQuery=$t.createExtensionProductBody=$t.createReleasedExtensionFilter=void 0;function rA(i,e){return{extension_id:i,extension_version:e}}n(rA,"createReleasedExtensionFilter");$t.createReleasedExtensionFilter=rA;function iA(i){return{sku:i.sku,cost:{amount:i.cost,type:"bits"},display_name:i.displayName,in_development:i.inDevelopment,expiration:i.expirationDate,is_broadcast:i.broadcast}}n(iA,"createExtensionProductBody");$t.createExtensionProductBody=iA;function nA(i,e){return{extension_id:i,id:e.transactionIds}}n(nA,"createExtensionTransactionQuery");$t.createExtensionTransactionQuery=nA});var Yh=u(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.HelixChannelReference=void 0;var cb=(b(),x(g)),aA=C(),Te=_(),Il=class extends Te.DataObject{static{n(this,"HelixChannelReference")}constructor(e,t){super(e),this._client=t}get id(){return this[Te.rawDataSymbol].broadcaster_id}get displayName(){return this[Te.rawDataSymbol].broadcaster_name}async getChannel(){return(0,Te.checkRelationAssertion)(await this._client.channels.getChannelInfoById(this[Te.rawDataSymbol].broadcaster_id))}async getBroadcaster(){return(0,Te.checkRelationAssertion)(await this._client.users.getUserById(this[Te.rawDataSymbol].broadcaster_id))}get gameId(){return this[Te.rawDataSymbol].game_id}get gameName(){return this[Te.rawDataSymbol].game_name}async getGame(){return this[Te.rawDataSymbol].game_id?(0,Te.checkRelationAssertion)(await this._client.games.getGameById(this[Te.rawDataSymbol].game_id)):null}get title(){return this[Te.rawDataSymbol].title}};Bn.HelixChannelReference=Il;cb.__decorate([(0,aA.Enumerable)(!1)],Il.prototype,"_client",void 0);Bn.HelixChannelReference=Il=cb.__decorate([(0,Te.rtfm)("api","HelixChannelReference","id")],Il)});var tp=u(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.HelixExtensionBitsProduct=void 0;var sA=(b(),x(g)),oA=C(),zt=_(),ep=class extends zt.DataObject{static{n(this,"HelixExtensionBitsProduct")}get sku(){return this[zt.rawDataSymbol].sku}get cost(){return this[zt.rawDataSymbol].cost.amount}get displayName(){return this[zt.rawDataSymbol].display_name}get inDevelopment(){return this[zt.rawDataSymbol].in_development}get isBroadcast(){return this[zt.rawDataSymbol].is_broadcast}get expirationDate(){return(0,oA.mapNullable)(this[zt.rawDataSymbol].expiration,e=>new Date(e))}};jn.HelixExtensionBitsProduct=ep;jn.HelixExtensionBitsProduct=ep=sA.__decorate([(0,zt.rtfm)("api","HelixExtensionBitsProduct","sku")],ep)});var rp=u(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.HelixExtensionTransaction=void 0;var db=(b(),x(g)),lA=C(),_e=_(),Tl=class extends _e.DataObject{static{n(this,"HelixExtensionTransaction")}constructor(e,t){super(e),this._client=t}get id(){return this[_e.rawDataSymbol].id}get transactionDate(){return new Date(this[_e.rawDataSymbol].timestamp)}get broadcasterId(){return this[_e.rawDataSymbol].broadcaster_id}get broadcasterName(){return this[_e.rawDataSymbol].broadcaster_name}get broadcasterDisplayName(){return this[_e.rawDataSymbol].broadcaster_name}async getBroadcaster(){return(0,_e.checkRelationAssertion)(await this._client.users.getUserById(this[_e.rawDataSymbol].broadcaster_id))}get userId(){return this[_e.rawDataSymbol].user_id}get userName(){return this[_e.rawDataSymbol].user_login}get userDisplayName(){return this[_e.rawDataSymbol].user_name}async getUser(){return(0,_e.checkRelationAssertion)(await this._client.users.getUserById(this[_e.rawDataSymbol].user_id))}get productType(){return this[_e.rawDataSymbol].product_type}get productSku(){return this[_e.rawDataSymbol].product_data.sku}get productCost(){return this[_e.rawDataSymbol].product_data.cost.amount}get productDisplayName(){return this[_e.rawDataSymbol].product_data.displayName}get productInDevelopment(){return this[_e.rawDataSymbol].product_data.inDevelopment}};kn.HelixExtensionTransaction=Tl;db.__decorate([(0,lA.Enumerable)(!1)],Tl.prototype,"_client",void 0);kn.HelixExtensionTransaction=Tl=db.__decorate([(0,_e.rtfm)("api","HelixExtensionTransaction","id")],Tl)});var ap=u(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Mn.HelixExtensionsApi=void 0;var uA=(b(),x(g)),gb=_(),Rl=ub(),ip=je(),hb=oe(),pb=pe(),_b=le(),cA=G(),mb=Yh(),yb=tp(),fb=rp(),np=class extends cA.BaseApi{static{n(this,"HelixExtensionsApi")}async getReleasedExtension(e,t){let r=await this._client.callApi({type:"helix",url:"extensions/released",query:(0,Rl.createReleasedExtensionFilter)(e,t)});return new gb.HelixExtension(r.data[0])}async getLiveChannelsWithExtension(e,t){let r=await this._client.callApi({type:"helix",url:"extensions/live",query:{...(0,ip.createSingleKeyQuery)("extension_id",e),...(0,_b.createPaginationQuery)(t)}});return(0,pb.createPaginatedResult)(r,mb.HelixChannelReference,this._client)}getLiveChannelsWithExtensionPaginated(e){return new hb.HelixPaginatedRequest({url:"extensions/live",query:(0,ip.createSingleKeyQuery)("extension_id",e)},this._client,t=>new mb.HelixChannelReference(t,this._client))}async getExtensionBitsProducts(e){return(await this._client.callApi({type:"helix",url:"bits/extensions",forceType:"app",query:(0,ip.createSingleKeyQuery)("should_include_all",e?.toString())})).data.map(r=>new yb.HelixExtensionBitsProduct(r))}async putExtensionBitsProduct(e){let t=await this._client.callApi({type:"helix",url:"bits/extensions",method:"PUT",forceType:"app",jsonBody:(0,Rl.createExtensionProductBody)(e)});return new yb.HelixExtensionBitsProduct(t.data[0])}async getExtensionTransactions(e,t={}){let r=await this._client.callApi({type:"helix",url:"extensions/transactions",forceType:"app",query:{...(0,Rl.createExtensionTransactionQuery)(e,t),...(0,_b.createPaginationQuery)(t)}});return(0,pb.createPaginatedResult)(r,fb.HelixExtensionTransaction,this._client)}getExtensionTransactionsPaginated(e,t={}){return new hb.HelixPaginatedRequest({url:"extensions/transactions",forceType:"app",query:(0,Rl.createExtensionTransactionQuery)(e,t)},this._client,r=>new fb.HelixExtensionTransaction(r,this._client))}};Mn.HelixExtensionsApi=np;Mn.HelixExtensionsApi=np=uA.__decorate([(0,gb.rtfm)("api","HelixExtensionsApi")],np)});var Ol=u(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.HelixGame=void 0;var bb=(b(),x(g)),dA=C(),qt=_(),Ul=class extends qt.DataObject{static{n(this,"HelixGame")}constructor(e,t){super(e),this._client=t}get id(){return this[qt.rawDataSymbol].id}get name(){return this[qt.rawDataSymbol].name}get boxArtUrl(){return this[qt.rawDataSymbol].box_art_url}get igdbId(){return this[qt.rawDataSymbol].igdb_id||null}getBoxArtUrl(e,t){return this[qt.rawDataSymbol].box_art_url.replace("{width}",e.toString()).replace("{height}",t.toString())}async getStreams(e){return await this._client.streams.getStreams({...e,game:this[qt.rawDataSymbol].id})}getStreamsPaginated(){return this._client.streams.getStreamsPaginated({game:this[qt.rawDataSymbol].id})}};Ln.HelixGame=Ul;bb.__decorate([(0,dA.Enumerable)(!1)],Ul.prototype,"_client",void 0);Ln.HelixGame=Ul=bb.__decorate([(0,qt.rtfm)("api","HelixGame","id")],Ul)});var lp=u(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.HelixGameApi=void 0;var Bl=(b(),x(g)),op=C(),hA=_(),sp=Ft(),pA=oe(),_A=pe(),mA=le(),yA=G(),Jr=Ol(),Zr=class extends yA.BaseApi{static{n(this,"HelixGameApi")}constructor(){super(...arguments),this._getGameByIdBatcher=new sp.HelixRequestBatcher({url:"games"},"id","id",this._client,e=>new Jr.HelixGame(e,this._client)),this._getGameByNameBatcher=new sp.HelixRequestBatcher({url:"games"},"name","name",this._client,e=>new Jr.HelixGame(e,this._client)),this._getGameByIgdbIdBatcher=new sp.HelixRequestBatcher({url:"games"},"igdb_id","igdb_id",this._client,e=>new Jr.HelixGame(e,this._client))}async getGamesByIds(e){return await this._getGames("id",e)}async getGamesByNames(e){return await this._getGames("name",e)}async getGamesByIgdbIds(e){return await this._getGames("igdb_id",e)}async getGameById(e){var t;return(t=(await this._getGames("id",[e]))[0])!==null&&t!==void 0?t:null}async getGameByName(e){var t;return(t=(await this._getGames("name",[e]))[0])!==null&&t!==void 0?t:null}async getGameByIgdbId(e){var t;return(t=(await this._getGames("igdb_id",[e]))[0])!==null&&t!==void 0?t:null}async getGameByIdBatched(e){return await this._getGameByIdBatcher.request(e)}async getGameByNameBatched(e){return await this._getGameByNameBatcher.request(e)}async getGameByIgdbIdBatched(e){return await this._getGameByIgdbIdBatcher.request(e)}async getTopGames(e){let t=await this._client.callApi({type:"helix",url:"games/top",query:(0,mA.createPaginationQuery)(e)});return(0,_A.createPaginatedResult)(t,Jr.HelixGame,this._client)}getTopGamesPaginated(){return new pA.HelixPaginatedRequest({url:"games/top"},this._client,e=>new Jr.HelixGame(e,this._client))}async _getGames(e,t){return t.length?(await this._client.callApi({type:"helix",url:"games",query:{[e]:t}})).data.map(a=>new Jr.HelixGame(a,this._client)):[]}};Fn.HelixGameApi=Zr;Bl.__decorate([(0,op.Enumerable)(!1)],Zr.prototype,"_getGameByIdBatcher",void 0);Bl.__decorate([(0,op.Enumerable)(!1)],Zr.prototype,"_getGameByNameBatcher",void 0);Bl.__decorate([(0,op.Enumerable)(!1)],Zr.prototype,"_getGameByIgdbIdBatcher",void 0);Fn.HelixGameApi=Zr=Bl.__decorate([(0,hA.rtfm)("api","HelixGameApi")],Zr)});var up=u(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.HelixGoal=void 0;var xb=(b(),x(g)),fA=C(),Me=_(),jl=class extends Me.DataObject{static{n(this,"HelixGoal")}constructor(e,t){super(e),this._client=t}get id(){return this[Me.rawDataSymbol].id}get broadcasterId(){return this[Me.rawDataSymbol].broadcaster_id}get broadcasterDisplayName(){return this[Me.rawDataSymbol].broadcaster_name}get broadcasterName(){return this[Me.rawDataSymbol].broadcaster_login}async getBroadcaster(){return(0,Me.checkRelationAssertion)(await this._client.users.getUserById(this[Me.rawDataSymbol].broadcaster_id))}get type(){return this[Me.rawDataSymbol].type}get description(){return this[Me.rawDataSymbol].description}get currentAmount(){return this[Me.rawDataSymbol].current_amount}get targetAmount(){return this[Me.rawDataSymbol].target_amount}get creationDate(){return this[Me.rawDataSymbol].created_at}};Nn.HelixGoal=jl;xb.__decorate([(0,fA.Enumerable)(!1)],jl.prototype,"_client",void 0);Nn.HelixGoal=jl=xb.__decorate([(0,Me.rtfm)("api","HelixGoal","id")],jl)});var dp=u(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.HelixGoalApi=void 0;var gA=(b(),x(g)),bA=Y(),wb=_(),xA=G(),wA=up(),cp=class extends xA.BaseApi{static{n(this,"HelixGoalApi")}async getGoals(e){return(await this._client.callApi({type:"helix",url:"goals",userId:(0,wb.extractUserId)(e),scopes:["channel:read:goals"],query:(0,bA.createBroadcasterQuery)(e)})).data.map(r=>new wA.HelixGoal(r,this._client))}};Qn.HelixGoalApi=cp;Qn.HelixGoalApi=cp=gA.__decorate([(0,wb.rtfm)("api","HelixGoalApi")],cp)});var hp=u(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.HelixHypeTrainContribution=void 0;var vb=(b(),x(g)),vA=C(),yr=_(),kl=class extends yr.DataObject{static{n(this,"HelixHypeTrainContribution")}constructor(e,t){super(e),this._client=t}get userId(){return this[yr.rawDataSymbol].user}async getUser(){return(0,yr.checkRelationAssertion)(await this._client.users.getUserById(this[yr.rawDataSymbol].user))}get type(){return this[yr.rawDataSymbol].type}get total(){return this[yr.rawDataSymbol].total}};Gn.HelixHypeTrainContribution=kl;vb.__decorate([(0,vA.Enumerable)(!1)],kl.prototype,"_client",void 0);Gn.HelixHypeTrainContribution=kl=vb.__decorate([(0,yr.rtfm)("api","HelixHypeTrainContribution","userId")],kl)});var pp=u(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.HelixHypeTrainEvent=void 0;var Hb=(b(),x(g)),SA=C(),fe=_(),Sb=hp(),Ml=class extends fe.DataObject{static{n(this,"HelixHypeTrainEvent")}constructor(e,t){super(e),this._client=t}get eventId(){return this[fe.rawDataSymbol].id}get eventType(){return this[fe.rawDataSymbol].event_type}get eventDate(){return new Date(this[fe.rawDataSymbol].event_timestamp)}get eventVersion(){return this[fe.rawDataSymbol].version}get id(){return this[fe.rawDataSymbol].event_data.id}get broadcasterId(){return this[fe.rawDataSymbol].event_data.broadcaster_id}async getBroadcaster(){return(0,fe.checkRelationAssertion)(await this._client.users.getUserById(this[fe.rawDataSymbol].event_data.broadcaster_id))}get level(){return this[fe.rawDataSymbol].event_data.level}get startDate(){return new Date(this[fe.rawDataSymbol].event_data.started_at)}get expiryDate(){return new Date(this[fe.rawDataSymbol].event_data.expires_at)}get cooldownDate(){return new Date(this[fe.rawDataSymbol].event_data.cooldown_end_time)}get total(){return this[fe.rawDataSymbol].event_data.total}get goal(){return this[fe.rawDataSymbol].event_data.goal}get lastContribution(){return new Sb.HelixHypeTrainContribution(this[fe.rawDataSymbol].event_data.last_contribution,this._client)}get topContributions(){return this[fe.rawDataSymbol].event_data.top_contributions.map(e=>new Sb.HelixHypeTrainContribution(e,this._client))}};Wn.HelixHypeTrainEvent=Ml;Hb.__decorate([(0,SA.Enumerable)(!1)],Ml.prototype,"_client",void 0);Wn.HelixHypeTrainEvent=Ml=Hb.__decorate([(0,fe.rtfm)("api","HelixHypeTrainEvent","id")],Ml)});var mp=u(Ll=>{"use strict";Object.defineProperty(Ll,"__esModule",{value:!0});Ll.HelixHypeTrainApi=void 0;var Cb=Y(),qb=_(),HA=oe(),CA=pe(),qA=le(),EA=G(),Eb=pp(),_p=class extends EA.BaseApi{static{n(this,"HelixHypeTrainApi")}async getHypeTrainEventsForBroadcaster(e,t){let r=await this._client.callApi({type:"helix",url:"hypetrain/events",userId:(0,qb.extractUserId)(e),scopes:["channel:read:hype_train"],query:{...(0,Cb.createBroadcasterQuery)(e),...(0,qA.createPaginationQuery)(t)}});return(0,CA.createPaginatedResult)(r,Eb.HelixHypeTrainEvent,this._client)}getHypeTrainEventsForBroadcasterPaginated(e){return new HA.HelixPaginatedRequest({url:"hypetrain/events",userId:(0,qb.extractUserId)(e),scopes:["channel:read:hype_train"],query:(0,Cb.createBroadcasterQuery)(e)},this._client,t=>new Eb.HelixHypeTrainEvent(t,this._client))}};Ll.HelixHypeTrainApi=_p});var Pb=u(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.createWarnUserBody=ce.createCheckAutoModStatusBody=ce.createUpdateShieldModeStatusBody=ce.createBanUserBody=ce.createAutoModSettingsBody=ce.createAutoModProcessBody=ce.createResolveUnbanRequestQuery=ce.createModeratorModifyQuery=ce.createModerationUserListQuery=void 0;var Kt=_();function PA(i,e){return{broadcaster_id:(0,Kt.extractUserId)(i),user_id:e?.userId}}n(PA,"createModerationUserListQuery");ce.createModerationUserListQuery=PA;function AA(i,e){return{broadcaster_id:(0,Kt.extractUserId)(i),user_id:(0,Kt.extractUserId)(e)}}n(AA,"createModeratorModifyQuery");ce.createModeratorModifyQuery=AA;function DA(i,e,t,r,a){return{unban_request_id:t,broadcaster_id:(0,Kt.extractUserId)(i),moderator_id:(0,Kt.extractUserId)(e),status:r?"approved":"denied",resolution_text:a}}n(DA,"createResolveUnbanRequestQuery");ce.createResolveUnbanRequestQuery=DA;function IA(i,e,t){return{user_id:(0,Kt.extractUserId)(i),msg_id:e,action:t?"ALLOW":"DENY"}}n(IA,"createAutoModProcessBody");ce.createAutoModProcessBody=IA;function TA(i){return{overall_level:i.overallLevel,aggression:i.aggression,bullying:i.bullying,disability:i.disability,misogyny:i.misogyny,race_ethnicity_or_religion:i.raceEthnicityOrReligion,sex_based_terms:i.sexBasedTerms,sexuality_sex_or_gender:i.sexualitySexOrGender,swearing:i.swearing}}n(TA,"createAutoModSettingsBody");ce.createAutoModSettingsBody=TA;function RA(i){return{data:{duration:i.duration,reason:i.reason,user_id:(0,Kt.extractUserId)(i.user)}}}n(RA,"createBanUserBody");ce.createBanUserBody=RA;function UA(i){return{is_active:i}}n(UA,"createUpdateShieldModeStatusBody");ce.createUpdateShieldModeStatusBody=UA;function OA(i){return{data:i.map(e=>({msg_id:e.messageId,msg_text:e.messageText}))}}n(OA,"createCheckAutoModStatusBody");ce.createCheckAutoModStatusBody=OA;function BA(i,e){return{data:{user_id:(0,Kt.extractUserId)(i),reason:e}}}n(BA,"createWarnUserBody");ce.createWarnUserBody=BA});var Ab=u(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.HelixAutoModSettings=void 0;var jA=(b(),x(g)),Re=_(),yp=class extends Re.DataObject{static{n(this,"HelixAutoModSettings")}get broadcasterId(){return this[Re.rawDataSymbol].broadcaster_id}get moderatorId(){return this[Re.rawDataSymbol].moderator_id}get overallLevel(){return this[Re.rawDataSymbol].overall_level?this[Re.rawDataSymbol].overall_level:null}get disability(){return this[Re.rawDataSymbol].disability}get aggression(){return this[Re.rawDataSymbol].aggression}get sexualitySexOrGender(){return this[Re.rawDataSymbol].sexuality_sex_or_gender}get misogyny(){return this[Re.rawDataSymbol].misogyny}get bullying(){return this[Re.rawDataSymbol].bullying}get swearing(){return this[Re.rawDataSymbol].swearing}get raceEthnicityOrReligion(){return this[Re.rawDataSymbol].race_ethnicity_or_religion}get sexBasedTerms(){return this[Re.rawDataSymbol].sex_based_terms}};Vn.HelixAutoModSettings=yp;Vn.HelixAutoModSettings=yp=jA.__decorate([(0,Re.rtfm)("api","HelixAutoModSettings","broadcasterId")],yp)});var Db=u($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.HelixAutoModStatus=void 0;var kA=(b(),x(g)),Fl=_(),fp=class extends Fl.DataObject{static{n(this,"HelixAutoModStatus")}get messageId(){return this[Fl.rawDataSymbol].msg_id}get isPermitted(){return this[Fl.rawDataSymbol].is_permitted}};$n.HelixAutoModStatus=fp;$n.HelixAutoModStatus=fp=kA.__decorate([(0,Fl.rtfm)("api","HelixAutoModStatus","messageId")],fp)});var Nl=u(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.HelixBanUser=void 0;var gp=(b(),x(g)),bp=C(),Et=_(),zn=class extends Et.DataObject{static{n(this,"HelixBanUser")}constructor(e,t,r){super(e),this._expiryTimestamp=t,this._client=r}get creationDate(){return new Date(this[Et.rawDataSymbol].created_at)}get expiryDate(){return(0,bp.mapNullable)(this._expiryTimestamp,e=>new Date(e))}get moderatorId(){return this[Et.rawDataSymbol].moderator_id}async getModerator(){return(0,Et.checkRelationAssertion)(await this._client.users.getUserById(this[Et.rawDataSymbol].moderator_id))}get userId(){return this[Et.rawDataSymbol].user_id}async getUser(){return(0,Et.checkRelationAssertion)(await this._client.users.getUserById(this[Et.rawDataSymbol].user_id))}};Kn.HelixBanUser=zn;gp.__decorate([(0,bp.Enumerable)(!1)],zn.prototype,"_client",void 0);gp.__decorate([(0,bp.Enumerable)(!1)],zn.prototype,"_expiryTimestamp",void 0);Kn.HelixBanUser=zn=gp.__decorate([(0,Et.rtfm)("api","HelixBanUser","userId")],zn)});var wp=u(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.HelixBan=void 0;var MA=(b(),x(g)),Xr=_(),LA=Nl(),xp=class extends LA.HelixBanUser{static{n(this,"HelixBan")}constructor(e,t){super(e,e.expires_at||null,t)}get userName(){return this[Xr.rawDataSymbol].user_login}get userDisplayName(){return this[Xr.rawDataSymbol].user_name}get moderatorName(){return this[Xr.rawDataSymbol].moderator_login}get moderatorDisplayName(){return this[Xr.rawDataSymbol].moderator_name}get reason(){return this[Xr.rawDataSymbol].reason||null}};Jn.HelixBan=xp;Jn.HelixBan=xp=MA.__decorate([(0,Xr.rtfm)("api","HelixBan","userId")],xp)});var Sp=u(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.HelixBlockedTerm=void 0;var FA=(b(),x(g)),_t=_(),vp=class extends _t.DataObject{static{n(this,"HelixBlockedTerm")}get broadcasterId(){return this[_t.rawDataSymbol].broadcaster_id}get creationDate(){return new Date(this[_t.rawDataSymbol].created_at)}get expirationDate(){return this[_t.rawDataSymbol].expires_at?new Date(this[_t.rawDataSymbol].expires_at):null}get id(){return this[_t.rawDataSymbol].id}get moderatorId(){return this[_t.rawDataSymbol].moderator_id}get text(){return this[_t.rawDataSymbol].text}get updatedDate(){return new Date(this[_t.rawDataSymbol].updated_at)}};Zn.HelixBlockedTerm=vp;Zn.HelixBlockedTerm=vp=FA.__decorate([(0,_t.rtfm)("api","HelixBlockedTerm","id")],vp)});var Hp=u(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.HelixModeratedChannel=void 0;var Ib=(b(),x(g)),NA=C(),Pt=_(),Ql=class extends Pt.DataObject{static{n(this,"HelixModeratedChannel")}constructor(e,t){super(e),this._client=t}get id(){return this[Pt.rawDataSymbol].broadcaster_id}get name(){return this[Pt.rawDataSymbol].broadcaster_login}get displayName(){return this[Pt.rawDataSymbol].broadcaster_name}async getChannel(){return(0,Pt.checkRelationAssertion)(await this._client.channels.getChannelInfoById(this[Pt.rawDataSymbol].broadcaster_id))}async getBroadcaster(){return(0,Pt.checkRelationAssertion)(await this._client.users.getUserById(this[Pt.rawDataSymbol].broadcaster_id))}};Xn.HelixModeratedChannel=Ql;Ib.__decorate([(0,NA.Enumerable)(!1)],Ql.prototype,"_client",void 0);Xn.HelixModeratedChannel=Ql=Ib.__decorate([(0,Pt.rtfm)("api","HelixModeratedChannel","id")],Ql)});var Cp=u(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.HelixModerator=void 0;var Tb=(b(),x(g)),QA=C(),fr=_(),Gl=class extends fr.DataObject{static{n(this,"HelixModerator")}constructor(e,t){super(e),this._client=t}get userId(){return this[fr.rawDataSymbol].user_id}get userName(){return this[fr.rawDataSymbol].user_login}get userDisplayName(){return this[fr.rawDataSymbol].user_name}async getUser(){return(0,fr.checkRelationAssertion)(await this._client.users.getUserById(this[fr.rawDataSymbol].user_id))}};Yn.HelixModerator=Gl;Tb.__decorate([(0,QA.Enumerable)(!1)],Gl.prototype,"_client",void 0);Yn.HelixModerator=Gl=Tb.__decorate([(0,fr.rtfm)("api","HelixModerator","userId")],Gl)});var qp=u(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});ea.HelixShieldModeStatus=void 0;var Rb=(b(),x(g)),GA=C(),mt=_(),Wl=class extends mt.DataObject{static{n(this,"HelixShieldModeStatus")}constructor(e,t){super(e),this._client=t}get isActive(){return this[mt.rawDataSymbol].is_active}get moderatorId(){return this[mt.rawDataSymbol].moderator_id}get moderatorName(){return this[mt.rawDataSymbol].moderator_login}get moderatorDisplayName(){return this[mt.rawDataSymbol].moderator_name}async getModerator(){return(0,mt.checkRelationAssertion)(await this._client.users.getUserById(this[mt.rawDataSymbol].moderator_id))}get lastActivationDate(){return this[mt.rawDataSymbol].last_activated_at===""?null:new Date(this[mt.rawDataSymbol].last_activated_at)}};ea.HelixShieldModeStatus=Wl;Rb.__decorate([(0,GA.Enumerable)(!1)],Wl.prototype,"_client",void 0);ea.HelixShieldModeStatus=Wl=Rb.__decorate([(0,mt.rtfm)("api","HelixShieldModeStatus")],Wl)});var Ep=u(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.HelixUnbanRequest=void 0;var Ub=(b(),x(g)),Ob=C(),te=_(),Vl=class extends te.DataObject{static{n(this,"HelixUnbanRequest")}constructor(e,t){super(e),this._client=t}get id(){return this[te.rawDataSymbol].id}get broadcasterId(){return this[te.rawDataSymbol].broadcaster_id}get broadcasterName(){return this[te.rawDataSymbol].broadcaster_id}get broadcasterDisplayName(){return this[te.rawDataSymbol].broadcaster_id}async getBroadcaster(){return(0,te.checkRelationAssertion)(await this._client.users.getUserById(this[te.rawDataSymbol].broadcaster_id))}get moderatorId(){return this[te.rawDataSymbol].moderator_id}get moderatorName(){return this[te.rawDataSymbol].moderator_login}get moderatorDisplayName(){return this[te.rawDataSymbol].moderator_name}async getModerator(){return(0,te.checkRelationAssertion)(await this._client.users.getUserById(this[te.rawDataSymbol].moderator_id))}get userId(){return this[te.rawDataSymbol].user_id}get userName(){return this[te.rawDataSymbol].user_login}get userDisplayName(){return this[te.rawDataSymbol].user_name}async getUser(){return(0,te.checkRelationAssertion)(await this._client.users.getUserById(this[te.rawDataSymbol].user_id))}get message(){return this[te.rawDataSymbol].text}get creationDate(){return new Date(this[te.rawDataSymbol].created_at)}get resolutionMessage(){return this[te.rawDataSymbol].resolution_text||null}get resolutionDate(){return(0,Ob.mapNullable)(this[te.rawDataSymbol].resolved_at,e=>new Date(e))}};ta.HelixUnbanRequest=Vl;Ub.__decorate([(0,Ob.Enumerable)(!1)],Vl.prototype,"_client",void 0);ta.HelixUnbanRequest=Vl=Ub.__decorate([(0,te.rtfm)("api","HelixUnbanRequest","id")],Vl)});var Pp=u(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});ra.HelixWarning=void 0;var Bb=(b(),x(g)),WA=C(),Je=_(),$l=class extends Je.DataObject{static{n(this,"HelixWarning")}constructor(e,t){super(e),this._client=t}get broadcasterId(){return this[Je.rawDataSymbol].user_id}async getBroadcaster(){return(0,Je.checkRelationAssertion)(await this._client.users.getUserById(this[Je.rawDataSymbol].broadcaster_id))}get moderatorId(){return this[Je.rawDataSymbol].moderator_id}async getModerator(){return(0,Je.checkRelationAssertion)(await this._client.users.getUserById(this[Je.rawDataSymbol].moderator_id))}get userId(){return this[Je.rawDataSymbol].user_id}async getUser(){return(0,Je.checkRelationAssertion)(await this._client.users.getUserById(this[Je.rawDataSymbol].user_id))}get reason(){return this[Je.rawDataSymbol].reason}};ra.HelixWarning=$l;Bb.__decorate([(0,WA.Enumerable)(!1)],$l.prototype,"_client",void 0);ra.HelixWarning=$l=Bb.__decorate([(0,Je.rtfm)("api","HelixWarning","userId")],$l)});var Tp=u(aa=>{"use strict";Object.defineProperty(aa,"__esModule",{value:!0});aa.HelixModerationApi=void 0;var VA=(b(),x(g)),Ap=Y(),F=_(),gr=je(),it=Pb(),zl=oe(),ia=pe(),na=le(),$A=G(),jb=Ab(),zA=Db(),kb=wp(),KA=Nl(),Mb=Sp(),Lb=Hp(),Fb=Cp(),Nb=qp(),Dp=Ep(),JA=Pp(),Ip=class extends $A.BaseApi{static{n(this,"HelixModerationApi")}async getBannedUsers(e,t){let r=await this._client.callApi({type:"helix",url:"moderation/banned",userId:(0,F.extractUserId)(e),scopes:["moderation:read"],query:{...(0,it.createModerationUserListQuery)(e,t),...(0,na.createPaginationQuery)(t)}});return(0,ia.createPaginatedResult)(r,kb.HelixBan,this._client)}getBannedUsersPaginated(e){return new zl.HelixPaginatedRequest({url:"moderation/banned",userId:(0,F.extractUserId)(e),scopes:["moderation:read"],query:(0,Ap.createBroadcasterQuery)(e)},this._client,t=>new kb.HelixBan(t,this._client),50)}async checkUserBan(e,t){let r=(0,F.extractUserId)(t);return(await this.getBannedUsers(e,{userId:r})).data.some(s=>s.userId===r)}async getModerators(e,t){let r=await this._client.callApi({type:"helix",url:"moderation/moderators",userId:(0,F.extractUserId)(e),scopes:["moderation:read","channel:manage:moderators"],query:{...(0,it.createModerationUserListQuery)(e,t),...(0,na.createPaginationQuery)(t)}});return(0,ia.createPaginatedResult)(r,Fb.HelixModerator,this._client)}getModeratorsPaginated(e){return new zl.HelixPaginatedRequest({url:"moderation/moderators",userId:(0,F.extractUserId)(e),scopes:["moderation:read","channel:manage:moderators"],query:(0,Ap.createBroadcasterQuery)(e)},this._client,t=>new Fb.HelixModerator(t,this._client))}async getModeratedChannels(e,t){let r=(0,F.extractUserId)(e),a=await this._client.callApi({type:"helix",url:"moderation/channels",userId:r,scopes:["user:read:moderated_channels"],query:{...(0,gr.createSingleKeyQuery)("user_id",r),...(0,na.createPaginationQuery)(t)}});return(0,ia.createPaginatedResult)(a,Lb.HelixModeratedChannel,this._client)}getModeratedChannelsPaginated(e){let t=(0,F.extractUserId)(e);return new zl.HelixPaginatedRequest({url:"moderation/channels",userId:t,scopes:["user:read:moderated_channels"],query:(0,gr.createSingleKeyQuery)("user_id",t)},this._client,r=>new Lb.HelixModeratedChannel(r,this._client))}async checkUserMod(e,t){let r=(0,F.extractUserId)(t);return(await this.getModerators(e,{userId:r})).data.some(s=>s.userId===r)}async addModerator(e,t){await this._client.callApi({type:"helix",url:"moderation/moderators",method:"POST",userId:(0,F.extractUserId)(e),scopes:["channel:manage:moderators"],query:(0,it.createModeratorModifyQuery)(e,t)})}async removeModerator(e,t){await this._client.callApi({type:"helix",url:"moderation/moderators",method:"DELETE",userId:(0,F.extractUserId)(e),scopes:["channel:manage:moderators"],query:(0,it.createModeratorModifyQuery)(e,t)})}async checkAutoModStatus(e,t){return(await this._client.callApi({type:"helix",url:"moderation/enforcements/status",method:"POST",userId:(0,F.extractUserId)(e),scopes:["moderation:read"],query:(0,Ap.createBroadcasterQuery)(e),jsonBody:(0,it.createCheckAutoModStatusBody)(t)})).data.map(a=>new zA.HelixAutoModStatus(a))}async processHeldAutoModMessage(e,t,r){await this._client.callApi({type:"helix",url:"moderation/automod/message",method:"POST",userId:(0,F.extractUserId)(e),scopes:["moderator:manage:automod"],jsonBody:(0,it.createAutoModProcessBody)(e,t,r)})}async getAutoModSettings(e){let t=(0,F.extractUserId)(e);return(await this._client.callApi({type:"helix",url:"moderation/automod/settings",userId:t,scopes:["moderator:read:automod_settings"],canOverrideScopedUserContext:!0,query:this._createModeratorActionQuery(t)})).data.map(a=>new jb.HelixAutoModSettings(a))}async updateAutoModSettings(e,t){let r=(0,F.extractUserId)(e);return(await this._client.callApi({type:"helix",url:"moderation/automod/settings",method:"PUT",userId:r,scopes:["moderator:manage:automod_settings"],canOverrideScopedUserContext:!0,query:this._createModeratorActionQuery(r),jsonBody:(0,it.createAutoModSettingsBody)(t)})).data.map(s=>new jb.HelixAutoModSettings(s))}async banUser(e,t){let r=(0,F.extractUserId)(e);return(await this._client.callApi({type:"helix",url:"moderation/bans",method:"POST",userId:r,scopes:["moderator:manage:banned_users"],canOverrideScopedUserContext:!0,query:this._createModeratorActionQuery(r),jsonBody:(0,it.createBanUserBody)(t)})).data.map(s=>new KA.HelixBanUser(s,s.end_time,this._client))}async unbanUser(e,t){let r=(0,F.extractUserId)(e);await this._client.callApi({type:"helix",url:"moderation/bans",method:"DELETE",userId:r,scopes:["moderator:manage:banned_users"],canOverrideScopedUserContext:!0,query:{...this._createModeratorActionQuery(r),...(0,gr.createSingleKeyQuery)("user_id",(0,F.extractUserId)(t))}})}async getBlockedTerms(e,t){let r=(0,F.extractUserId)(e),a=await this._client.callApi({type:"helix",url:"moderation/blocked_terms",userId:r,scopes:["moderator:read:blocked_terms"],canOverrideScopedUserContext:!0,query:{...this._createModeratorActionQuery(r),...(0,na.createPaginationQuery)(t)}});return(0,ia.createPaginatedResult)(a,Mb.HelixBlockedTerm,this._client)}async addBlockedTerm(e,t){let r=(0,F.extractUserId)(e);return(await this._client.callApi({type:"helix",url:"moderation/blocked_terms",method:"POST",userId:r,scopes:["moderator:manage:blocked_terms"],canOverrideScopedUserContext:!0,query:this._createModeratorActionQuery(r),jsonBody:{text:t}})).data.map(s=>new Mb.HelixBlockedTerm(s))}async removeBlockedTerm(e,t,r){let a=(0,F.extractUserId)(e);await this._client.callApi({type:"helix",url:"moderation/blocked_terms",method:"DELETE",userId:a,scopes:["moderator:manage:blocked_terms"],canOverrideScopedUserContext:!0,query:{...this._createModeratorActionQuery(a),id:r}})}async deleteChatMessages(e,t){let r=(0,F.extractUserId)(e);await this._client.callApi({type:"helix",url:"moderation/chat",method:"DELETE",userId:r,scopes:["moderator:manage:chat_messages"],canOverrideScopedUserContext:!0,query:{...this._createModeratorActionQuery(r),...(0,gr.createSingleKeyQuery)("message_id",t)}})}async getShieldModeStatus(e){let t=(0,F.extractUserId)(e),r=await this._client.callApi({type:"helix",url:"moderation/shield_mode",method:"GET",userId:t,scopes:["moderator:read:shield_mode","moderator:manage:shield_mode"],canOverrideScopedUserContext:!0,query:this._createModeratorActionQuery(t)});return new Nb.HelixShieldModeStatus(r.data[0],this._client)}async updateShieldModeStatus(e,t){let r=(0,F.extractUserId)(e),a=await this._client.callApi({type:"helix",url:"moderation/shield_mode",method:"PUT",userId:r,scopes:["moderator:manage:shield_mode"],canOverrideScopedUserContext:!0,query:this._createModeratorActionQuery(r),jsonBody:(0,it.createUpdateShieldModeStatusBody)(t)});return new Nb.HelixShieldModeStatus(a.data[0],this._client)}async getUnbanRequests(e,t,r){let a=(0,F.extractUserId)(e),s=await this._client.callApi({type:"helix",url:"moderation/unban_requests",method:"GET",userId:a,scopes:["moderator:read:unban_requests","moderator:manage:unban_requests"],canOverrideScopedUserContext:!0,query:{...this._createModeratorActionQuery(a),...(0,gr.createSingleKeyQuery)("status",t),...(0,na.createPaginationQuery)(r)}});return(0,ia.createPaginatedResult)(s,Dp.HelixUnbanRequest,this._client)}getUnbanRequestsPaginated(e,t){let r=(0,F.extractUserId)(e);return new zl.HelixPaginatedRequest({url:"moderation/unban_requests",method:"GET",userId:r,scopes:["moderator:read:unban_requests","moderator:manage:unban_requests"],canOverrideScopedUserContext:!0,query:{...this._createModeratorActionQuery(r),...(0,gr.createSingleKeyQuery)("status",t)}},this._client,a=>new Dp.HelixUnbanRequest(a,this._client))}async resolveUnbanRequest(e,t,r,a){let s=(0,F.extractUserId)(e),o=await this._client.callApi({type:"helix",url:"moderation/unban_requests",method:"PATCH",userId:s,scopes:["moderator:manage:unban_requests"],canOverrideScopedUserContext:!0,query:(0,it.createResolveUnbanRequestQuery)(s,this._getUserContextIdWithDefault(s),t,r,a?.slice(0,500))});return new Dp.HelixUnbanRequest(o.data[0],this._client)}async warnUser(e,t,r){let a=(0,F.extractUserId)(e),s=await this._client.callApi({type:"helix",url:"moderation/warnings",method:"POST",userId:a,scopes:["moderator:manage:warnings"],canOverrideScopedUserContext:!0,query:this._createModeratorActionQuery(a),jsonBody:(0,it.createWarnUserBody)(t,r.slice(0,500))});return new JA.HelixWarning(s.data[0],this._client)}_createModeratorActionQuery(e){return(0,gr.createModeratorActionQuery)(e,this._getUserContextIdWithDefault(e))}};aa.HelixModerationApi=Ip;aa.HelixModerationApi=Ip=VA.__decorate([(0,F.rtfm)("api","HelixModerationApi")],Ip)});var Gb=u(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.createPollEndBody=Yr.createPollBody=void 0;var Qb=_();function ZA(i,e){var t;return{broadcaster_id:(0,Qb.extractUserId)(i),title:e.title,choices:e.choices.map(r=>({title:r})),duration:e.duration,channel_points_voting_enabled:e.channelPointsPerVote!=null,channel_points_per_vote:(t=e.channelPointsPerVote)!==null&&t!==void 0?t:0}}n(ZA,"createPollBody");Yr.createPollBody=ZA;function XA(i,e,t){return{broadcaster_id:(0,Qb.extractUserId)(i),id:e,status:t?"TERMINATED":"ARCHIVED"}}n(XA,"createPollEndBody");Yr.createPollEndBody=XA});var Up=u(sa=>{"use strict";Object.defineProperty(sa,"__esModule",{value:!0});sa.HelixPollChoice=void 0;var YA=(b(),x(g)),ei=_(),Rp=class extends ei.DataObject{static{n(this,"HelixPollChoice")}get id(){return this[ei.rawDataSymbol].id}get title(){return this[ei.rawDataSymbol].title}get totalVotes(){return this[ei.rawDataSymbol].votes}get channelPointsVotes(){return this[ei.rawDataSymbol].channel_points_votes}};sa.HelixPollChoice=Rp;sa.HelixPollChoice=Rp=YA.__decorate([(0,ei.rtfm)("api","HelixPollChoice","id")],Rp)});var Op=u(oa=>{"use strict";Object.defineProperty(oa,"__esModule",{value:!0});oa.HelixPoll=void 0;var Wb=(b(),x(g)),eD=C(),He=_(),tD=Up(),Kl=class extends He.DataObject{static{n(this,"HelixPoll")}constructor(e,t){super(e),this._client=t}get id(){return this[He.rawDataSymbol].id}get broadcasterId(){return this[He.rawDataSymbol].broadcaster_id}get broadcasterName(){return this[He.rawDataSymbol].broadcaster_login}get broadcasterDisplayName(){return this[He.rawDataSymbol].broadcaster_name}async getBroadcaster(){return(0,He.checkRelationAssertion)(await this._client.users.getUserById(this[He.rawDataSymbol].broadcaster_id))}get title(){return this[He.rawDataSymbol].title}get isChannelPointsVotingEnabled(){return this[He.rawDataSymbol].channel_points_voting_enabled}get channelPointsPerVote(){return this[He.rawDataSymbol].channel_points_per_vote}get status(){return this[He.rawDataSymbol].status}get durationInSeconds(){return this[He.rawDataSymbol].duration}get startDate(){return new Date(this[He.rawDataSymbol].started_at)}get endDate(){return new Date(this.startDate.getTime()+this[He.rawDataSymbol].duration*1e3)}get choices(){return this[He.rawDataSymbol].choices.map(e=>new tD.HelixPollChoice(e))}};oa.HelixPoll=Kl;Wb.__decorate([(0,eD.Enumerable)(!1)],Kl.prototype,"_client",void 0);oa.HelixPoll=Kl=Wb.__decorate([(0,He.rtfm)("api","HelixPoll","id")],Kl)});var jp=u(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});ua.HelixPollApi=void 0;var rD=(b(),x(g)),Vb=Y(),ti=_(),iD=je(),$b=Gb(),nD=oe(),aD=pe(),sD=le(),oD=G(),la=Op(),Bp=class extends oD.BaseApi{static{n(this,"HelixPollApi")}async getPolls(e,t){let r=await this._client.callApi({type:"helix",url:"polls",userId:(0,ti.extractUserId)(e),scopes:["channel:read:polls","channel:manage:polls"],query:{...(0,Vb.createBroadcasterQuery)(e),...(0,sD.createPaginationQuery)(t)}});return(0,aD.createPaginatedResult)(r,la.HelixPoll,this._client)}getPollsPaginated(e){return new nD.HelixPaginatedRequest({url:"polls",userId:(0,ti.extractUserId)(e),scopes:["channel:read:polls","channel:manage:polls"],query:(0,Vb.createBroadcasterQuery)(e)},this._client,t=>new la.HelixPoll(t,this._client),20)}async getPollsByIds(e,t){return t.length?(await this._client.callApi({type:"helix",url:"polls",userId:(0,ti.extractUserId)(e),scopes:["channel:read:polls","channel:manage:polls"],query:(0,iD.createGetByIdsQuery)(e,t)})).data.map(a=>new la.HelixPoll(a,this._client)):[]}async getPollById(e,t){let r=await this.getPollsByIds(e,[t]);return r.length?r[0]:null}async createPoll(e,t){let r=await this._client.callApi({type:"helix",url:"polls",method:"POST",userId:(0,ti.extractUserId)(e),scopes:["channel:manage:polls"],jsonBody:(0,$b.createPollBody)(e,t)});return new la.HelixPoll(r.data[0],this._client)}async endPoll(e,t,r=!0){let a=await this._client.callApi({type:"helix",url:"polls",method:"PATCH",userId:(0,ti.extractUserId)(e),scopes:["channel:manage:polls"],jsonBody:(0,$b.createPollEndBody)(e,t,r)});return new la.HelixPoll(a.data[0],this._client)}};ua.HelixPollApi=Bp;ua.HelixPollApi=Bp=rD.__decorate([(0,ti.rtfm)("api","HelixPollApi")],Bp)});var Kb=u(ri=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});ri.createEndPredictionBody=ri.createPredictionBody=void 0;var zb=_();function lD(i,e){return{broadcaster_id:(0,zb.extractUserId)(i),title:e.title,outcomes:e.outcomes.map(t=>({title:t})),prediction_window:e.autoLockAfter}}n(lD,"createPredictionBody");ri.createPredictionBody=lD;function uD(i,e,t,r){return{broadcaster_id:(0,zb.extractUserId)(i),id:e,status:t,winning_outcome_id:r}}n(uD,"createEndPredictionBody");ri.createEndPredictionBody=uD});var kp=u(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});ca.HelixPredictor=void 0;var Jb=(b(),x(g)),cD=C(),Jt=_(),Jl=class extends Jt.DataObject{static{n(this,"HelixPredictor")}constructor(e,t){super(e),this._client=t}get userId(){return this[Jt.rawDataSymbol].user_id}get userName(){return this[Jt.rawDataSymbol].user_login}get userDisplayName(){return this[Jt.rawDataSymbol].user_name}async getUser(){return await this._client.users.getUserById(this[Jt.rawDataSymbol].user_id)}get channelPointsUsed(){return this[Jt.rawDataSymbol].channel_points_used}get channelPointsWon(){return this[Jt.rawDataSymbol].channel_points_won}};ca.HelixPredictor=Jl;Jb.__decorate([(0,cD.Enumerable)(!1)],Jl.prototype,"_client",void 0);ca.HelixPredictor=Jl=Jb.__decorate([(0,Jt.rtfm)("api","HelixPredictor","userId")],Jl)});var Mp=u(da=>{"use strict";Object.defineProperty(da,"__esModule",{value:!0});da.HelixPredictionOutcome=void 0;var Zb=(b(),x(g)),dD=C(),Zt=_(),hD=kp(),Zl=class extends Zt.DataObject{static{n(this,"HelixPredictionOutcome")}constructor(e,t){super(e),this._client=t}get id(){return this[Zt.rawDataSymbol].id}get title(){return this[Zt.rawDataSymbol].title}get users(){return this[Zt.rawDataSymbol].users}get totalChannelPoints(){return this[Zt.rawDataSymbol].channel_points}get color(){return this[Zt.rawDataSymbol].color}get topPredictors(){var e,t;return(t=(e=this[Zt.rawDataSymbol].top_predictors)===null||e===void 0?void 0:e.map(r=>new hD.HelixPredictor(r,this._client)))!==null&&t!==void 0?t:[]}};da.HelixPredictionOutcome=Zl;Zb.__decorate([(0,dD.Enumerable)(!1)],Zl.prototype,"_client",void 0);da.HelixPredictionOutcome=Zl=Zb.__decorate([(0,Zt.rtfm)("api","HelixPredictionOutcome","id")],Zl)});var Lp=u(ha=>{"use strict";Object.defineProperty(ha,"__esModule",{value:!0});ha.HelixPrediction=void 0;var Yb=(b(),x(g)),pD=C(),re=_(),Xb=Mp(),Xl=class extends re.DataObject{static{n(this,"HelixPrediction")}constructor(e,t){super(e),this._client=t}get id(){return this[re.rawDataSymbol].id}get broadcasterId(){return this[re.rawDataSymbol].broadcaster_id}get broadcasterName(){return this[re.rawDataSymbol].broadcaster_login}get broadcasterDisplayName(){return this[re.rawDataSymbol].broadcaster_name}async getBroadcaster(){return(0,re.checkRelationAssertion)(await this._client.users.getUserById(this[re.rawDataSymbol].broadcaster_id))}get title(){return this[re.rawDataSymbol].title}get status(){return this[re.rawDataSymbol].status}get autoLockAfter(){return this[re.rawDataSymbol].prediction_window}get creationDate(){return new Date(this[re.rawDataSymbol].created_at)}get endDate(){return this[re.rawDataSymbol].ended_at?new Date(this[re.rawDataSymbol].ended_at):null}get lockDate(){return this[re.rawDataSymbol].locked_at?new Date(this[re.rawDataSymbol].locked_at):null}get outcomes(){return this[re.rawDataSymbol].outcomes.map(e=>new Xb.HelixPredictionOutcome(e,this._client))}get winningOutcomeId(){return this[re.rawDataSymbol].winning_outcome_id||null}get winningOutcome(){if(!this[re.rawDataSymbol].winning_outcome_id)return null;let e=this[re.rawDataSymbol].outcomes.find(t=>t.id===this[re.rawDataSymbol].winning_outcome_id);if(!e)throw new re.HellFreezesOverError("Winning outcome not found in outcomes array");return new Xb.HelixPredictionOutcome(e,this._client)}};ha.HelixPrediction=Xl;Yb.__decorate([(0,pD.Enumerable)(!1)],Xl.prototype,"_client",void 0);ha.HelixPrediction=Xl=Yb.__decorate([(0,re.rtfm)("api","HelixPrediction","id")],Xl)});var Np=u(_a=>{"use strict";Object.defineProperty(_a,"__esModule",{value:!0});_a.HelixPredictionApi=void 0;var _D=(b(),x(g)),ex=Y(),ii=_(),mD=je(),tx=Kb(),yD=oe(),fD=pe(),gD=le(),bD=G(),pa=Lp(),Fp=class extends bD.BaseApi{static{n(this,"HelixPredictionApi")}async getPredictions(e,t){let r=await this._client.callApi({type:"helix",url:"predictions",userId:(0,ii.extractUserId)(e),scopes:["channel:read:predictions"],query:{...(0,ex.createBroadcasterQuery)(e),...(0,gD.createPaginationQuery)(t)}});return(0,fD.createPaginatedResult)(r,pa.HelixPrediction,this._client)}getPredictionsPaginated(e){return new yD.HelixPaginatedRequest({url:"predictions",userId:(0,ii.extractUserId)(e),scopes:["channel:read:predictions"],query:(0,ex.createBroadcasterQuery)(e)},this._client,t=>new pa.HelixPrediction(t,this._client),20)}async getPredictionsByIds(e,t){return t.length?(await this._client.callApi({type:"helix",url:"predictions",userId:(0,ii.extractUserId)(e),scopes:["channel:read:predictions"],query:(0,mD.createGetByIdsQuery)(e,t)})).data.map(a=>new pa.HelixPrediction(a,this._client)):[]}async getPredictionById(e,t){let r=await this.getPredictionsByIds(e,[t]);return r.length?r[0]:null}async createPrediction(e,t){let r=await this._client.callApi({type:"helix",url:"predictions",method:"POST",userId:(0,ii.extractUserId)(e),scopes:["channel:manage:predictions"],jsonBody:(0,tx.createPredictionBody)(e,t)});return new pa.HelixPrediction(r.data[0],this._client)}async lockPrediction(e,t){return await this._endPrediction(e,t,"LOCKED")}async resolvePrediction(e,t,r){return await this._endPrediction(e,t,"RESOLVED",r)}async cancelPrediction(e,t){return await this._endPrediction(e,t,"CANCELED")}async _endPrediction(e,t,r,a){let s=await this._client.callApi({type:"helix",url:"predictions",method:"PATCH",userId:(0,ii.extractUserId)(e),scopes:["channel:manage:predictions"],jsonBody:(0,tx.createEndPredictionBody)(e,t,r,a)});return new pa.HelixPrediction(s.data[0],this._client)}};_a.HelixPredictionApi=Fp;_a.HelixPredictionApi=Fp=_D.__decorate([(0,ii.rtfm)("api","HelixPredictionApi")],Fp)});var ix=u(Yl=>{"use strict";Object.defineProperty(Yl,"__esModule",{value:!0});Yl.createRaidStartQuery=void 0;var rx=_();function xD(i,e){return{from_broadcaster_id:(0,rx.extractUserId)(i),to_broadcaster_id:(0,rx.extractUserId)(e)}}n(xD,"createRaidStartQuery");Yl.createRaidStartQuery=xD});var Gp=u(ma=>{"use strict";Object.defineProperty(ma,"__esModule",{value:!0});ma.HelixRaid=void 0;var wD=(b(),x(g)),eu=_(),Qp=class extends eu.DataObject{static{n(this,"HelixRaid")}get creationDate(){return new Date(this[eu.rawDataSymbol].created_at)}get targetIsMature(){return this[eu.rawDataSymbol].is_mature}};ma.HelixRaid=Qp;ma.HelixRaid=Qp=wD.__decorate([(0,eu.rtfm)("api","HelixRaid")],Qp)});var $p=u(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});ya.HelixRaidApi=void 0;var vD=(b(),x(g)),SD=Y(),Wp=_(),HD=ix(),CD=G(),qD=Gp(),Vp=class extends CD.BaseApi{static{n(this,"HelixRaidApi")}async startRaid(e,t){let r=await this._client.callApi({type:"helix",url:"raids",method:"POST",userId:(0,Wp.extractUserId)(e),scopes:["channel:manage:raids"],query:(0,HD.createRaidStartQuery)(e,t)});return new qD.HelixRaid(r.data[0])}async cancelRaid(e){await this._client.callApi({type:"helix",url:"raids",method:"DELETE",userId:(0,Wp.extractUserId)(e),scopes:["channel:manage:raids"],query:(0,SD.createBroadcasterQuery)(e)})}};ya.HelixRaidApi=Vp;ya.HelixRaidApi=Vp=vD.__decorate([(0,Wp.rtfm)("api","HelixRaidApi")],Vp)});var zp=u(Ze=>{"use strict";Object.defineProperty(Ze,"__esModule",{value:!0});Ze.createScheduleSegmentUpdateBody=Ze.createScheduleSegmentModifyQuery=Ze.createScheduleSegmentBody=Ze.createScheduleSettingsUpdateQuery=Ze.createScheduleQuery=void 0;var tu=_();function ED(i,e){var t;return{broadcaster_id:(0,tu.extractUserId)(i),start_time:e?.startDate,utc_offset:(t=e?.utcOffset)===null||t===void 0?void 0:t.toString()}}n(ED,"createScheduleQuery");Ze.createScheduleQuery=ED;function PD(i,e){return e.vacation?{broadcaster_id:(0,tu.extractUserId)(i),is_vacation_enabled:"true",vacation_start_time:e.vacation.startDate,vacation_end_time:e.vacation.endDate,timezone:e.vacation.timezone}:{broadcaster_id:(0,tu.extractUserId)(i),is_vacation_enabled:"false"}}n(PD,"createScheduleSettingsUpdateQuery");Ze.createScheduleSettingsUpdateQuery=PD;function AD(i){return{start_time:i.startDate,timezone:i.timezone,is_recurring:i.isRecurring,duration:i.duration,category_id:i.categoryId,title:i.title}}n(AD,"createScheduleSegmentBody");Ze.createScheduleSegmentBody=AD;function DD(i,e){return{broadcaster_id:(0,tu.extractUserId)(i),id:e}}n(DD,"createScheduleSegmentModifyQuery");Ze.createScheduleSegmentModifyQuery=DD;function ID(i){return{start_time:i.startDate,timezone:i.timezone,is_canceled:i.isCanceled,duration:i.duration,category_id:i.categoryId,title:i.title}}n(ID,"createScheduleSegmentUpdateBody");Ze.createScheduleSegmentUpdateBody=ID});var ga=u(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});fa.HelixScheduleSegment=void 0;var nx=(b(),x(g)),ax=C(),nt=_(),ru=class extends nt.DataObject{static{n(this,"HelixScheduleSegment")}constructor(e,t){super(e),this._client=t}get id(){return this[nt.rawDataSymbol].id}get startDate(){return new Date(this[nt.rawDataSymbol].start_time)}get endDate(){return new Date(this[nt.rawDataSymbol].end_time)}get title(){return this[nt.rawDataSymbol].title}get cancelEndDate(){return(0,ax.mapNullable)(this[nt.rawDataSymbol].canceled_until,e=>new Date(e))}get categoryId(){var e,t;return(t=(e=this[nt.rawDataSymbol].category)===null||e===void 0?void 0:e.id)!==null&&t!==void 0?t:null}get categoryName(){var e,t;return(t=(e=this[nt.rawDataSymbol].category)===null||e===void 0?void 0:e.name)!==null&&t!==void 0?t:null}async getCategory(){var e;let t=(e=this[nt.rawDataSymbol].category)===null||e===void 0?void 0:e.id;return t?await this._client.games.getGameById(t):null}get isRecurring(){return this[nt.rawDataSymbol].is_recurring}};fa.HelixScheduleSegment=ru;nx.__decorate([(0,ax.Enumerable)(!1)],ru.prototype,"_client",void 0);fa.HelixScheduleSegment=ru=nx.__decorate([(0,nt.rtfm)("api","HelixScheduleSegment","id")],ru)});var Jp=u(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});ba.HelixPaginatedScheduleSegmentRequest=void 0;var TD=(b(),x(g)),RD=_(),UD=zp(),OD=oe(),BD=ga(),Kp=class extends OD.HelixPaginatedRequest{static{n(this,"HelixPaginatedScheduleSegmentRequest")}constructor(e,t,r){super({url:"schedule",query:(0,UD.createScheduleQuery)(e,r)},t,a=>new BD.HelixScheduleSegment(a,t),25)}async _fetchData(e={}){var t;let r=await super._fetchData(e);return{data:(t=r.data.segments)!==null&&t!==void 0?t:[],pagination:r.pagination}}};ba.HelixPaginatedScheduleSegmentRequest=Kp;ba.HelixPaginatedScheduleSegmentRequest=Kp=TD.__decorate([(0,RD.rtfm)("api","HelixPaginatedScheduleSegmentRequest")],Kp)});var Zp=u(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});xa.HelixSchedule=void 0;var sx=(b(),x(g)),jD=C(),yt=_(),kD=ga(),iu=class extends yt.DataObject{static{n(this,"HelixSchedule")}constructor(e,t){super(e),this._client=t}get segments(){var e,t;return(t=(e=this[yt.rawDataSymbol].segments)===null||e===void 0?void 0:e.map(r=>new kD.HelixScheduleSegment(r,this._client)))!==null&&t!==void 0?t:[]}get broadcasterId(){return this[yt.rawDataSymbol].broadcaster_id}get broadcasterName(){return this[yt.rawDataSymbol].broadcaster_login}get broadcasterDisplayName(){return this[yt.rawDataSymbol].broadcaster_name}async getBroadcaster(){return(0,yt.checkRelationAssertion)(await this._client.users.getUserById(this[yt.rawDataSymbol].broadcaster_id))}get vacationStartDate(){var e;let t=(e=this[yt.rawDataSymbol].vacation)===null||e===void 0?void 0:e.start_time;return t?new Date(t):null}get vacationEndDate(){var e;let t=(e=this[yt.rawDataSymbol].vacation)===null||e===void 0?void 0:e.end_time;return t?new Date(t):null}};xa.HelixSchedule=iu;sx.__decorate([(0,jD.Enumerable)(!1)],iu.prototype,"_client",void 0);xa.HelixSchedule=iu=sx.__decorate([(0,yt.rtfm)("api","HelixSchedule","broadcasterId")],iu)});var e_=u(nu=>{"use strict";Object.defineProperty(nu,"__esModule",{value:!0});nu.HelixScheduleApi=void 0;var ox=Y(),ni=_(),MD=je(),ai=zp(),LD=le(),FD=G(),ND=Jp(),QD=Zp(),Xp=ga(),Yp=class extends FD.BaseApi{static{n(this,"HelixScheduleApi")}async getSchedule(e,t){let r=await this._client.callApi({type:"helix",url:"schedule",userId:(0,ni.extractUserId)(e),query:{...(0,ai.createScheduleQuery)(e,t),...(0,LD.createPaginationQuery)(t)}});return{data:new QD.HelixSchedule(r.data,this._client),cursor:r.pagination.cursor}}getScheduleSegmentsPaginated(e,t){return new ND.HelixPaginatedScheduleSegmentRequest(e,this._client,t)}async getScheduleSegmentsByIds(e,t){var r,a;return(a=(r=(await this._client.callApi({type:"helix",url:"schedule",userId:(0,ni.extractUserId)(e),query:(0,MD.createGetByIdsQuery)(e,t)})).data.segments)===null||r===void 0?void 0:r.map(o=>new Xp.HelixScheduleSegment(o,this._client)))!==null&&a!==void 0?a:[]}async getScheduleSegmentById(e,t){let r=await this.getScheduleSegmentsByIds(e,[t]);return r.length?r[0]:null}async getScheduleAsIcal(e){return await this._client.callApi({type:"helix",url:"schedule/icalendar",query:(0,ox.createBroadcasterQuery)(e)})}async updateScheduleSettings(e,t){await this._client.callApi({type:"helix",url:"schedule/settings",method:"PATCH",userId:(0,ni.extractUserId)(e),scopes:["channel:manage:schedule"],query:(0,ai.createScheduleSettingsUpdateQuery)(e,t)})}async createScheduleSegment(e,t){let r=await this._client.callApi({type:"helix",url:"schedule/segment",method:"POST",userId:(0,ni.extractUserId)(e),scopes:["channel:manage:schedule"],query:(0,ox.createBroadcasterQuery)(e),jsonBody:(0,ai.createScheduleSegmentBody)(t)});return new Xp.HelixScheduleSegment(r.data.segments[0],this._client)}async updateScheduleSegment(e,t,r){let a=await this._client.callApi({type:"helix",url:"schedule/segment",method:"PATCH",userId:(0,ni.extractUserId)(e),scopes:["channel:manage:schedule"],query:(0,ai.createScheduleSegmentModifyQuery)(e,t),jsonBody:(0,ai.createScheduleSegmentUpdateBody)(r)});return new Xp.HelixScheduleSegment(a.data.segments[0],this._client)}async deleteScheduleSegment(e,t){await this._client.callApi({type:"helix",url:"schedule/segment",method:"DELETE",userId:(0,ni.extractUserId)(e),scopes:["channel:manage:schedule"],query:(0,ai.createScheduleSegmentModifyQuery)(e,t)})}};nu.HelixScheduleApi=Yp});var lx=u(au=>{"use strict";Object.defineProperty(au,"__esModule",{value:!0});au.createSearchChannelsQuery=void 0;function GD(i,e){var t;return{query:i,live_only:(t=e.liveOnly)===null||t===void 0?void 0:t.toString()}}n(GD,"createSearchChannelsQuery");au.createSearchChannelsQuery=GD});var t_=u(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});wa.HelixChannelSearchResult=void 0;var ux=(b(),x(g)),WD=C(),ge=_(),su=class extends ge.DataObject{static{n(this,"HelixChannelSearchResult")}constructor(e,t){super(e),this._client=t}get language(){return this[ge.rawDataSymbol].broadcaster_language}get id(){return this[ge.rawDataSymbol].id}get name(){return this[ge.rawDataSymbol].broadcaster_login}get displayName(){return this[ge.rawDataSymbol].display_name}async getUser(){return(0,ge.checkRelationAssertion)(await this._client.users.getUserById(this[ge.rawDataSymbol].id))}get gameId(){return this[ge.rawDataSymbol].game_id}get gameName(){return this[ge.rawDataSymbol].game_name}async getGame(){return this[ge.rawDataSymbol].game_id?(0,ge.checkRelationAssertion)(await this._client.games.getGameById(this[ge.rawDataSymbol].game_id)):null}get isLive(){return this[ge.rawDataSymbol].is_live}get tags(){return this[ge.rawDataSymbol].tags}get thumbnailUrl(){return this[ge.rawDataSymbol].thumbnail_url}get startDate(){return this[ge.rawDataSymbol].is_live?new Date(this[ge.rawDataSymbol].started_at):null}};wa.HelixChannelSearchResult=su;ux.__decorate([(0,WD.Enumerable)(!1)],su.prototype,"_client",void 0);wa.HelixChannelSearchResult=su=ux.__decorate([(0,ge.rtfm)("api","HelixChannelSearchResult","id")],su)});var i_=u(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});va.HelixSearchApi=void 0;var VD=(b(),x(g)),$D=_(),cx=lx(),dx=oe(),hx=pe(),px=le(),zD=G(),_x=Ol(),mx=t_(),r_=class extends zD.BaseApi{static{n(this,"HelixSearchApi")}async searchCategories(e,t){let r=await this._client.callApi({type:"helix",url:"search/categories",query:{query:e,...(0,px.createPaginationQuery)(t)}});return(0,hx.createPaginatedResult)(r,_x.HelixGame,this._client)}searchCategoriesPaginated(e){return new dx.HelixPaginatedRequest({url:"search/categories",query:{query:e}},this._client,t=>new _x.HelixGame(t,this._client))}async searchChannels(e,t={}){let r=await this._client.callApi({type:"helix",url:"search/channels",query:{...(0,cx.createSearchChannelsQuery)(e,t),...(0,px.createPaginationQuery)(t)}});return(0,hx.createPaginatedResult)(r,mx.HelixChannelSearchResult,this._client)}searchChannelsPaginated(e,t={}){return new dx.HelixPaginatedRequest({url:"search/channels",query:(0,cx.createSearchChannelsQuery)(e,t)},this._client,r=>new mx.HelixChannelSearchResult(r,this._client))}};va.HelixSearchApi=r_;va.HelixSearchApi=r_=VD.__decorate([(0,$D.rtfm)("api","HelixSearchApi")],r_)});var a_=u(ou=>{"use strict";Object.defineProperty(ou,"__esModule",{value:!0});ou.StreamNotLiveError=void 0;var KD=_(),n_=class extends KD.CustomError{static{n(this,"StreamNotLiveError")}constructor(e){super("Your stream needs to be live to do this",e)}};ou.StreamNotLiveError=n_});var yx=u(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.createVideoQuery=Xt.createStreamMarkerBody=Xt.createStreamQuery=void 0;var JD=_();function ZD(i){return{game_id:i.game,language:i.language,type:i.type,user_id:i.userId,user_login:i.userName}}n(ZD,"createStreamQuery");Xt.createStreamQuery=ZD;function XD(i,e){return{user_id:(0,JD.extractUserId)(i),description:e}}n(XD,"createStreamMarkerBody");Xt.createStreamMarkerBody=XD;function YD(i){return{video_id:i}}n(YD,"createVideoQuery");Xt.createVideoQuery=YD});var s_=u(Sa=>{"use strict";Object.defineProperty(Sa,"__esModule",{value:!0});Sa.HelixStream=void 0;var fx=(b(),x(g)),eI=C(),ie=_(),lu=class extends ie.DataObject{static{n(this,"HelixStream")}constructor(e,t){super(e),this._client=t}get id(){return this[ie.rawDataSymbol].id}get userId(){return this[ie.rawDataSymbol].user_id}get userName(){return this[ie.rawDataSymbol].user_login}get userDisplayName(){return this[ie.rawDataSymbol].user_name}async getUser(){return(0,ie.checkRelationAssertion)(await this._client.users.getUserById(this[ie.rawDataSymbol].user_id))}get gameId(){return this[ie.rawDataSymbol].game_id}get gameName(){return this[ie.rawDataSymbol].game_name}async getGame(){return this[ie.rawDataSymbol].game_id?(0,ie.checkRelationAssertion)(await this._client.games.getGameById(this[ie.rawDataSymbol].game_id)):null}get type(){return this[ie.rawDataSymbol].type}get title(){return this[ie.rawDataSymbol].title}get viewers(){return this[ie.rawDataSymbol].viewer_count}get startDate(){return new Date(this[ie.rawDataSymbol].started_at)}get language(){return this[ie.rawDataSymbol].language}get thumbnailUrl(){return this[ie.rawDataSymbol].thumbnail_url}getThumbnailUrl(e,t){return this[ie.rawDataSymbol].thumbnail_url.replace("{width}",e.toString()).replace("{height}",t.toString())}get tags(){return this[ie.rawDataSymbol].tags}get isMature(){return this[ie.rawDataSymbol].is_mature}};Sa.HelixStream=lu;fx.__decorate([(0,eI.Enumerable)(!1)],lu.prototype,"_client",void 0);Sa.HelixStream=lu=fx.__decorate([(0,ie.rtfm)("api","HelixStream","id")],lu)});var cu=u(Ha=>{"use strict";Object.defineProperty(Ha,"__esModule",{value:!0});Ha.HelixStreamMarker=void 0;var gx=(b(),x(g)),tI=C(),si=_(),uu=class extends si.DataObject{static{n(this,"HelixStreamMarker")}constructor(e,t){super(e),this._client=t}get id(){return this[si.rawDataSymbol].id}get creationDate(){return new Date(this[si.rawDataSymbol].created_at)}get description(){return this[si.rawDataSymbol].description}get positionInSeconds(){return this[si.rawDataSymbol].position_seconds}};Ha.HelixStreamMarker=uu;gx.__decorate([(0,tI.Enumerable)(!1)],uu.prototype,"_client",void 0);Ha.HelixStreamMarker=uu=gx.__decorate([(0,si.rtfm)("api","HelixStreamMarker","id")],uu)});var u_=u(Ca=>{"use strict";Object.defineProperty(Ca,"__esModule",{value:!0});Ca.HelixStreamMarkerWithVideo=void 0;var rI=(b(),x(g)),o_=_(),iI=cu(),l_=class extends iI.HelixStreamMarker{static{n(this,"HelixStreamMarkerWithVideo")}constructor(e,t,r){super(e,r),this._videoId=t}get url(){return this[o_.rawDataSymbol].URL}get videoId(){return this._videoId}async getVideo(){return(0,o_.checkRelationAssertion)(await this._client.videos.getVideoById(this._videoId))}};Ca.HelixStreamMarkerWithVideo=l_;Ca.HelixStreamMarkerWithVideo=l_=rI.__decorate([(0,o_.rtfm)("api","HelixStreamMarkerWithVideo","id")],l_)});var d_=u(Pa=>{"use strict";var li;Object.defineProperty(Pa,"__esModule",{value:!0});Pa.HelixStreamApi=void 0;var c_=(b(),x(g)),qa=C(),bx=Y(),Ue=_(),nI=a_(),du=je(),oi=yx(),xx=Ft(),hu=oe(),wx=pe(),pu=le(),aI=G(),br=s_(),sI=cu(),oI=u_(),Ea=li=class extends aI.BaseApi{static{n(this,"HelixStreamApi")}constructor(){super(...arguments),this._getStreamByUserIdBatcher=new xx.HelixRequestBatcher({url:"streams"},"user_id","user_id",this._client,e=>new br.HelixStream(e,this._client)),this._getStreamByUserNameBatcher=new xx.HelixRequestBatcher({url:"streams"},"user_login","user_login",this._client,e=>new br.HelixStream(e,this._client))}async getStreams(e={}){let t=await this._client.callApi({url:"streams",type:"helix",query:{...(0,oi.createStreamQuery)(e),...(0,pu.createPaginationQuery)(e)}});return(0,wx.createPaginatedResult)(t,br.HelixStream,this._client)}getStreamsPaginated(e={}){return new hu.HelixPaginatedRequest({url:"streams",query:(0,oi.createStreamQuery)(e)},this._client,t=>new br.HelixStream(t,this._client))}async getStreamsByUserNames(e){return(await this.getStreams({userName:e.map(Ue.extractUserName)})).data}async getStreamByUserName(e){var t;return(t=(await this.getStreamsByUserNames([e]))[0])!==null&&t!==void 0?t:null}async getStreamByUserNameBatched(e){return await this._getStreamByUserNameBatcher.request((0,Ue.extractUserName)(e))}async getStreamsByUserIds(e){return(await this.getStreams({userId:e.map(Ue.extractUserId)})).data}async getStreamByUserId(e){let t=(0,Ue.extractUserId)(e),r=await this._client.callApi({url:"streams",type:"helix",userId:t,query:(0,oi.createStreamQuery)({userId:t})});return(0,qa.mapNullable)(r.data[0],a=>new br.HelixStream(a,this._client))}async getStreamByUserIdBatched(e){return await this._getStreamByUserIdBatcher.request((0,Ue.extractUserId)(e))}async getStreamMarkersForUser(e,t){var r;let a=await this._client.callApi({url:"streams/markers",type:"helix",query:{...(0,du.createUserQuery)(e),...(0,pu.createPaginationQuery)(t)},userId:(0,Ue.extractUserId)(e),scopes:["user:read:broadcast"],canOverrideScopedUserContext:!0});return{data:(0,qa.flatten)(a.data.map(s=>li._mapGetStreamMarkersResult(s,this._client))),cursor:(r=a.pagination)===null||r===void 0?void 0:r.cursor}}getStreamMarkersForUserPaginated(e){return new hu.HelixPaginatedRequest({url:"streams/markers",query:(0,du.createUserQuery)(e),userId:(0,Ue.extractUserId)(e),scopes:["user:read:broadcast"],canOverrideScopedUserContext:!0},this._client,t=>li._mapGetStreamMarkersResult(t,this._client))}async getStreamMarkersForVideo(e,t,r){var a;let s=await this._client.callApi({url:"streams/markers",type:"helix",query:{...(0,oi.createVideoQuery)(t),...(0,pu.createPaginationQuery)(r)},userId:(0,Ue.extractUserId)(e),scopes:["user:read:broadcast"],canOverrideScopedUserContext:!0});return{data:(0,qa.flatten)(s.data.map(o=>li._mapGetStreamMarkersResult(o,this._client))),cursor:(a=s.pagination)===null||a===void 0?void 0:a.cursor}}getStreamMarkersForVideoPaginated(e,t){return new hu.HelixPaginatedRequest({url:"streams/markers",query:(0,oi.createVideoQuery)(t),userId:(0,Ue.extractUserId)(e),scopes:["user:read:broadcast"],canOverrideScopedUserContext:!0},this._client,r=>li._mapGetStreamMarkersResult(r,this._client))}async createStreamMarker(e,t){try{let r=await this._client.callApi({url:"streams/markers",method:"POST",type:"helix",userId:(0,Ue.extractUserId)(e),scopes:["channel:manage:broadcast"],canOverrideScopedUserContext:!0,jsonBody:(0,oi.createStreamMarkerBody)(e,t)});return new sI.HelixStreamMarker(r.data[0],this._client)}catch(r){throw r instanceof bx.HttpStatusCodeError&&r.statusCode===404?new nI.StreamNotLiveError({cause:r}):r}}async getStreamKey(e){let t=(0,Ue.extractUserId)(e);return(await this._client.callApi({type:"helix",url:"streams/key",userId:t,scopes:["channel:read:stream_key"],query:(0,bx.createBroadcasterQuery)(e)})).data[0].stream_key}async getFollowedStreams(e,t){let r=(0,Ue.extractUserId)(e),a=await this._client.callApi({type:"helix",url:"streams/followed",userId:r,scopes:["user:read:follows"],query:{...(0,du.createSingleKeyQuery)("user_id",r),...(0,pu.createPaginationQuery)(t)}});return(0,wx.createPaginatedResult)(a,br.HelixStream,this._client)}getFollowedStreamsPaginated(e){let t=(0,Ue.extractUserId)(e);return new hu.HelixPaginatedRequest({url:"streams/followed",userId:t,scopes:["user:read:follows"],query:(0,du.createSingleKeyQuery)("user_id",t)},this._client,r=>new br.HelixStream(r,this._client))}static _mapGetStreamMarkersResult(e,t){return e.videos.reduce((r,a)=>[...r,...a.markers.map(s=>new oI.HelixStreamMarkerWithVideo(s,a.video_id,t))],[])}};Pa.HelixStreamApi=Ea;c_.__decorate([(0,qa.Enumerable)(!1)],Ea.prototype,"_getStreamByUserIdBatcher",void 0);c_.__decorate([(0,qa.Enumerable)(!1)],Ea.prototype,"_getStreamByUserNameBatcher",void 0);Pa.HelixStreamApi=Ea=li=c_.__decorate([(0,Ue.rtfm)("api","HelixStreamApi")],Ea)});var Sx=u(_u=>{"use strict";Object.defineProperty(_u,"__esModule",{value:!0});_u.createSubscriptionCheckQuery=void 0;var vx=_();function lI(i,e){return{broadcaster_id:(0,vx.extractUserId)(i),user_id:(0,vx.extractUserId)(e)}}n(lI,"createSubscriptionCheckQuery");_u.createSubscriptionCheckQuery=lI});var yu=u(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});Aa.HelixUserSubscription=void 0;var Hx=(b(),x(g)),uI=C(),Yt=_(),mu=class extends Yt.DataObject{static{n(this,"HelixUserSubscription")}constructor(e,t){super(e),this._client=t}get broadcasterId(){return this[Yt.rawDataSymbol].broadcaster_id}get broadcasterName(){return this[Yt.rawDataSymbol].broadcaster_login}get broadcasterDisplayName(){return this[Yt.rawDataSymbol].broadcaster_name}async getBroadcaster(){return await this._client.users.getUserById(this[Yt.rawDataSymbol].broadcaster_id)}get isGift(){return this[Yt.rawDataSymbol].is_gift}get tier(){return this[Yt.rawDataSymbol].tier}};Aa.HelixUserSubscription=mu;Hx.__decorate([(0,uI.Enumerable)(!1)],mu.prototype,"_client",void 0);Aa.HelixUserSubscription=mu=Hx.__decorate([(0,Yt.rtfm)("api","HelixUserSubscription","broadcasterId")],mu)});var fu=u(Da=>{"use strict";Object.defineProperty(Da,"__esModule",{value:!0});Da.HelixSubscription=void 0;var cI=(b(),x(g)),de=_(),dI=yu(),h_=class extends dI.HelixUserSubscription{static{n(this,"HelixSubscription")}get broadcasterId(){return this[de.rawDataSymbol].broadcaster_id}get broadcasterName(){return this[de.rawDataSymbol].broadcaster_login}get broadcasterDisplayName(){return this[de.rawDataSymbol].broadcaster_name}async getBroadcaster(){return(0,de.checkRelationAssertion)(await this._client.users.getUserById(this[de.rawDataSymbol].broadcaster_id))}get gifterId(){return this[de.rawDataSymbol].is_gift?this[de.rawDataSymbol].gifter_id:null}get gifterName(){return this[de.rawDataSymbol].is_gift?this[de.rawDataSymbol].gifter_login:null}get gifterDisplayName(){return this[de.rawDataSymbol].is_gift?this[de.rawDataSymbol].gifter_name:null}async getGifter(){return this[de.rawDataSymbol].is_gift?(0,de.checkRelationAssertion)(await this._client.users.getUserById(this[de.rawDataSymbol].gifter_id)):null}get userId(){return this[de.rawDataSymbol].user_id}get userName(){return this[de.rawDataSymbol].user_login}get userDisplayName(){return this[de.rawDataSymbol].user_name}async getUser(){return(0,de.checkRelationAssertion)(await this._client.users.getUserById(this[de.rawDataSymbol].user_id))}};Da.HelixSubscription=h_;Da.HelixSubscription=h_=cI.__decorate([(0,de.rtfm)("api","HelixSubscription","userId")],h_)});var __=u(Ia=>{"use strict";Object.defineProperty(Ia,"__esModule",{value:!0});Ia.HelixPaginatedSubscriptionsRequest=void 0;var hI=(b(),x(g)),pI=Y(),Cx=_(),_I=Gr(),mI=fu(),p_=class extends _I.HelixPaginatedRequestWithTotal{static{n(this,"HelixPaginatedSubscriptionsRequest")}constructor(e,t){super({url:"subscriptions",scopes:["channel:read:subscriptions"],userId:(0,Cx.extractUserId)(e),query:(0,pI.createBroadcasterQuery)(e)},t,r=>new mI.HelixSubscription(r,t))}async getPoints(){var e;return((e=this._currentData)!==null&&e!==void 0?e:await this._fetchData({query:{after:void 0}})).points}};Ia.HelixPaginatedSubscriptionsRequest=p_;Ia.HelixPaginatedSubscriptionsRequest=p_=hI.__decorate([(0,Cx.rtfm)("api","HelixPaginatedSubscriptionsRequest")],p_)});var y_=u(Ta=>{"use strict";Object.defineProperty(Ta,"__esModule",{value:!0});Ta.HelixSubscriptionApi=void 0;var yI=(b(),x(g)),qx=Y(),gu=_(),fI=je(),gI=Sx(),bI=pe(),xI=le(),wI=G(),vI=__(),Ex=fu(),SI=yu(),m_=class extends wI.BaseApi{static{n(this,"HelixSubscriptionApi")}async getSubscriptions(e,t){let r=await this._client.callApi({url:"subscriptions",scopes:["channel:read:subscriptions"],type:"helix",userId:(0,gu.extractUserId)(e),query:{...(0,qx.createBroadcasterQuery)(e),...(0,xI.createPaginationQuery)(t)}});return{...(0,bI.createPaginatedResultWithTotal)(r,Ex.HelixSubscription,this._client),points:r.points}}getSubscriptionsPaginated(e){return new vI.HelixPaginatedSubscriptionsRequest(e,this._client)}async getSubscriptionsForUsers(e,t){return(await this._client.callApi({type:"helix",url:"subscriptions",userId:(0,gu.extractUserId)(e),scopes:["channel:read:subscriptions"],query:(0,fI.createChannelUsersCheckQuery)(e,t)})).data.map(a=>new Ex.HelixSubscription(a,this._client))}async getSubscriptionForUser(e,t){let r=await this.getSubscriptionsForUsers(e,[t]);return r.length?r[0]:null}async checkUserSubscription(e,t){try{let r=await this._client.callApi({type:"helix",url:"subscriptions/user",userId:(0,gu.extractUserId)(e),scopes:["user:read:subscriptions"],query:(0,gI.createSubscriptionCheckQuery)(t,e)});return new SI.HelixUserSubscription(r.data[0],this._client)}catch(r){if(r instanceof qx.HttpStatusCodeError&&r.statusCode===404)return null;throw r}}};Ta.HelixSubscriptionApi=m_;Ta.HelixSubscriptionApi=m_=yI.__decorate([(0,gu.rtfm)("api","HelixSubscriptionApi")],m_)});var xu=u(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});Ra.HelixTeam=void 0;var Px=(b(),x(g)),HI=C(),at=_(),bu=class extends at.DataObject{static{n(this,"HelixTeam")}constructor(e,t){super(e),this._client=t}get id(){return this[at.rawDataSymbol].id}get name(){return this[at.rawDataSymbol].team_name}get displayName(){return this[at.rawDataSymbol].team_display_name}get backgroundImageUrl(){return this[at.rawDataSymbol].background_image_url}get bannerUrl(){return this[at.rawDataSymbol].banner}get creationDate(){return new Date(this[at.rawDataSymbol].created_at)}get updateDate(){return new Date(this[at.rawDataSymbol].updated_at)}get info(){return this[at.rawDataSymbol].info}get logoThumbnailUrl(){return this[at.rawDataSymbol].thumbnail_url}async getUserRelations(){return(await this._client.teams.getTeamById(this.id)).userRelations}};Ra.HelixTeam=bu;Px.__decorate([(0,HI.Enumerable)(!1)],bu.prototype,"_client",void 0);Ra.HelixTeam=bu=Px.__decorate([(0,at.rtfm)("api","HelixTeam","id")],bu)});var g_=u(Ua=>{"use strict";Object.defineProperty(Ua,"__esModule",{value:!0});Ua.HelixTeamWithUsers=void 0;var CI=(b(),x(g)),Ax=_(),qI=Go(),EI=xu(),f_=class extends EI.HelixTeam{static{n(this,"HelixTeamWithUsers")}get userRelations(){return this[Ax.rawDataSymbol].users.map(e=>new qI.HelixUserRelation(e,this._client))}};Ua.HelixTeamWithUsers=f_;Ua.HelixTeamWithUsers=f_=CI.__decorate([(0,Ax.rtfm)("api","HelixTeamWithUsers","id")],f_)});var w_=u(Oa=>{"use strict";Object.defineProperty(Oa,"__esModule",{value:!0});Oa.HelixTeamApi=void 0;var PI=(b(),x(g)),b_=Y(),Ix=_(),AI=G(),DI=xu(),Dx=g_(),x_=class extends AI.BaseApi{static{n(this,"HelixTeamApi")}async getTeamsForBroadcaster(e){var t,r;return(r=(t=(await this._client.callApi({type:"helix",url:"teams/channel",userId:(0,Ix.extractUserId)(e),query:(0,b_.createBroadcasterQuery)(e)})).data)===null||t===void 0?void 0:t.map(s=>new DI.HelixTeam(s,this._client)))!==null&&r!==void 0?r:[]}async getTeamById(e){try{let t=await this._client.callApi({type:"helix",url:"teams",query:{id:e}});return new Dx.HelixTeamWithUsers(t.data[0],this._client)}catch(t){if(t instanceof b_.HttpStatusCodeError&&t.statusCode===500)return null;throw t}}async getTeamByName(e){try{let t=await this._client.callApi({type:"helix",url:"teams",query:{name:e}});return new Dx.HelixTeamWithUsers(t.data[0],this._client)}catch(t){if(t instanceof b_.HttpStatusCodeError&&t.statusCode===404)return null;throw t}}};Oa.HelixTeamApi=x_;Oa.HelixTeamApi=x_=PI.__decorate([(0,Ix.rtfm)("api","HelixTeamApi")],x_)});var Rx=u(ui=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});ui.createUserBlockDeleteQuery=ui.createUserBlockCreateQuery=void 0;var Tx=_();function II(i,e){return{target_user_id:(0,Tx.extractUserId)(i),source_context:e.sourceContext,reason:e.reason}}n(II,"createUserBlockCreateQuery");ui.createUserBlockCreateQuery=II;function TI(i){return{target_user_id:(0,Tx.extractUserId)(i)}}n(TI,"createUserBlockDeleteQuery");ui.createUserBlockDeleteQuery=TI});var Su=u(vu=>{"use strict";Object.defineProperty(vu,"__esModule",{value:!0});vu.HelixBaseExtension=void 0;var wu=_(),v_=class extends wu.DataObject{static{n(this,"HelixBaseExtension")}get id(){return this[wu.rawDataSymbol].id}get version(){return this[wu.rawDataSymbol].version}get name(){return this[wu.rawDataSymbol].name}};vu.HelixBaseExtension=v_});var H_=u(Ba=>{"use strict";Object.defineProperty(Ba,"__esModule",{value:!0});Ba.HelixInstalledExtension=void 0;var RI=(b(),x(g)),UI=_(),OI=Su(),S_=class extends OI.HelixBaseExtension{static{n(this,"HelixInstalledExtension")}constructor(e,t,r){super(r),this._slotType=e,this._slotId=t}get slotType(){return this._slotType}get slotId(){return this._slotId}};Ba.HelixInstalledExtension=S_;Ba.HelixInstalledExtension=S_=RI.__decorate([(0,UI.rtfm)("api","HelixInstalledExtension","id")],S_)});var E_=u(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});ka.HelixInstalledExtensionList=void 0;var BI=(b(),x(g)),ja=_(),C_=H_(),q_=class extends ja.DataObject{static{n(this,"HelixInstalledExtensionList")}getExtensionAtSlot(e,t){let r=this[ja.rawDataSymbol][e][t];return r.active?new C_.HelixInstalledExtension(e,t,r):null}getExtensionsForSlotType(e){return[...Object.entries(this[ja.rawDataSymbol][e])].filter(t=>t[1].active).map(([t,r])=>new C_.HelixInstalledExtension(e,t,r))}getAllExtensions(){return[...Object.entries(this[ja.rawDataSymbol])].flatMap(([e,t])=>[...Object.entries(t)].filter(r=>r[1].active).map(([r,a])=>new C_.HelixInstalledExtension(e,r,a)))}};ka.HelixInstalledExtensionList=q_;ka.HelixInstalledExtensionList=q_=BI.__decorate([(0,ja.rtfm)("api","HelixInstalledExtensionList")],q_)});var D_=u(Ma=>{"use strict";Object.defineProperty(Ma,"__esModule",{value:!0});Ma.HelixUserExtension=void 0;var jI=(b(),x(g)),P_=_(),kI=Su(),A_=class extends kI.HelixBaseExtension{static{n(this,"HelixUserExtension")}get canActivate(){return this[P_.rawDataSymbol].can_activate}get types(){return this[P_.rawDataSymbol].type}};Ma.HelixUserExtension=A_;Ma.HelixUserExtension=A_=jI.__decorate([(0,P_.rtfm)("api","HelixUserExtension","id")],A_)});var Cu=u(La=>{"use strict";Object.defineProperty(La,"__esModule",{value:!0});La.HelixUser=void 0;var Ux=(b(),x(g)),MI=C(),st=_(),Hu=class extends st.DataObject{static{n(this,"HelixUser")}constructor(e,t){super(e),this._client=t}get id(){return this[st.rawDataSymbol].id}get name(){return this[st.rawDataSymbol].login}get displayName(){return this[st.rawDataSymbol].display_name}get description(){return this[st.rawDataSymbol].description}get type(){return this[st.rawDataSymbol].type}get broadcasterType(){return this[st.rawDataSymbol].broadcaster_type}get profilePictureUrl(){return this[st.rawDataSymbol].profile_image_url}get offlinePlaceholderUrl(){return this[st.rawDataSymbol].offline_image_url}get creationDate(){return new Date(this[st.rawDataSymbol].created_at)}async getStream(){return await this._client.streams.getStreamByUserId(this)}async getFollowedChannels(){return await this._client.channels.getFollowedChannels(this)}async getFollowedChannel(e){var t;return(t=(await this._client.channels.getFollowedChannels(this,e)).data[0])!==null&&t!==void 0?t:null}async follows(e){return await this.getFollowedChannel(e)!==null}async getChannelFollowers(){return await this._client.channels.getChannelFollowers(this)}async getChannelFollower(e){var t;return(t=(await this._client.channels.getChannelFollowers(this,e)).data[0])!==null&&t!==void 0?t:null}async isFollowedBy(e){return await this.getChannelFollower(e)!==null}async getSubscriptionTo(e){return await this._client.subscriptions.checkUserSubscription(this,e)}async isSubscribedTo(e){return await this.getSubscriptionTo(e)!==null}async getSubscriber(e){return await this._client.subscriptions.getSubscriptionForUser(this,e)}async hasSubscriber(e){return await this.getSubscriber(e)!==null}};La.HelixUser=Hu;Ux.__decorate([(0,MI.Enumerable)(!1)],Hu.prototype,"_client",void 0);La.HelixUser=Hu=Ux.__decorate([(0,st.rtfm)("api","HelixUser","id")],Hu)});var T_=u(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});Fa.HelixPrivilegedUser=void 0;var LI=(b(),x(g)),Ox=_(),FI=Cu(),I_=class extends FI.HelixUser{static{n(this,"HelixPrivilegedUser")}get email(){return this[Ox.rawDataSymbol].email}async setDescription(e){return await this._client.users.updateAuthenticatedUser(this,{description:e})}};Fa.HelixPrivilegedUser=I_;Fa.HelixPrivilegedUser=I_=LI.__decorate([(0,Ox.rtfm)("api","HelixPrivilegedUser","id")],I_)});var R_=u(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});Na.HelixUserBlock=void 0;var Bx=(b(),x(g)),NI=C(),xr=_(),qu=class extends xr.DataObject{static{n(this,"HelixUserBlock")}constructor(e,t){super(e),this._client=t}get userId(){return this[xr.rawDataSymbol].user_id}get userName(){return this[xr.rawDataSymbol].user_login}get userDisplayName(){return this[xr.rawDataSymbol].display_name}async getUser(){return(0,xr.checkRelationAssertion)(await this._client.users.getUserById(this[xr.rawDataSymbol].user_id))}};Na.HelixUserBlock=qu;Bx.__decorate([(0,NI.Enumerable)(!1)],qu.prototype,"_client",void 0);Na.HelixUserBlock=qu=Bx.__decorate([(0,xr.rtfm)("api","HelixUserBlock","userId")],qu)});var B_=u(Ga=>{"use strict";Object.defineProperty(Ga,"__esModule",{value:!0});Ga.HelixUserApi=void 0;var U_=(b(),x(g)),O_=C(),jx=Y(),we=_(),QI=je(),kx=Rx(),Mx=Ft(),GI=oe(),WI=pe(),VI=le(),$I=G(),Lx=E_(),zI=D_(),Fx=T_(),Eu=Cu(),Nx=R_(),Qa=class extends $I.BaseApi{static{n(this,"HelixUserApi")}constructor(){super(...arguments),this._getUserByIdBatcher=new Mx.HelixRequestBatcher({url:"users"},"id","id",this._client,e=>new Eu.HelixUser(e,this._client)),this._getUserByNameBatcher=new Mx.HelixRequestBatcher({url:"users"},"login","login",this._client,e=>new Eu.HelixUser(e,this._client))}async getUsersByIds(e){return await this._getUsers("id",e.map(we.extractUserId))}async getUsersByNames(e){return await this._getUsers("login",e.map(we.extractUserName))}async getUserById(e){let t=(0,we.extractUserId)(e),r=await this._client.callApi({type:"helix",url:"users",userId:t,query:{id:t}});return(0,O_.mapNullable)(r.data[0],a=>new Eu.HelixUser(a,this._client))}async getUserByIdBatched(e){return await this._getUserByIdBatcher.request((0,we.extractUserId)(e))}async getUserByName(e){let t=await this._getUsers("login",[(0,we.extractUserName)(e)]);return t.length?t[0]:null}async getUserByNameBatched(e){return await this._getUserByNameBatcher.request((0,we.extractUserName)(e))}async getAuthenticatedUser(e,t=!1){var r;let a=await this._client.callApi({type:"helix",url:"users",forceType:"user",userId:(0,we.extractUserId)(e),scopes:t?["user:read:email"]:void 0});if(!(!((r=a.data)===null||r===void 0)&&r.length))throw new we.HellFreezesOverError("Could not get authenticated user");return new Fx.HelixPrivilegedUser(a.data[0],this._client)}async updateAuthenticatedUser(e,t){let r=await this._client.callApi({type:"helix",url:"users",method:"PUT",userId:(0,we.extractUserId)(e),scopes:["user:edit"],query:{description:t.description}});return new Fx.HelixPrivilegedUser(r.data[0],this._client)}async getBlocks(e,t){let r=await this._client.callApi({type:"helix",url:"users/blocks",userId:(0,we.extractUserId)(e),scopes:["user:read:blocked_users"],query:{...(0,jx.createBroadcasterQuery)(e),...(0,VI.createPaginationQuery)(t)}});return(0,WI.createPaginatedResult)(r,Nx.HelixUserBlock,this._client)}getBlocksPaginated(e){return new GI.HelixPaginatedRequest({url:"users/blocks",userId:(0,we.extractUserId)(e),scopes:["user:read:blocked_users"],query:(0,jx.createBroadcasterQuery)(e)},this._client,t=>new Nx.HelixUserBlock(t,this._client))}async createBlock(e,t,r={}){await this._client.callApi({type:"helix",url:"users/blocks",method:"PUT",userId:(0,we.extractUserId)(e),scopes:["user:manage:blocked_users"],query:(0,kx.createUserBlockCreateQuery)(t,r)})}async deleteBlock(e,t){await this._client.callApi({type:"helix",url:"users/blocks",method:"DELETE",userId:(0,we.extractUserId)(e),scopes:["user:manage:blocked_users"],query:(0,kx.createUserBlockDeleteQuery)(t)})}async getExtensionsForAuthenticatedUser(e,t=!1){return(await this._client.callApi({type:"helix",url:"users/extensions/list",userId:(0,we.extractUserId)(e),scopes:t?["channel:manage:extensions"]:["user:read:broadcast","channel:manage:extensions"]})).data.map(a=>new zI.HelixUserExtension(a))}async getActiveExtensions(e,t=!1){let r=(0,we.extractUserId)(e),a=await this._client.callApi({type:"helix",url:"users/extensions",userId:r,scopes:t?["user:read:broadcast","channel:manage:extensions"]:void 0,query:(0,QI.createSingleKeyQuery)("user_id",r)});return new Lx.HelixInstalledExtensionList(a.data)}async updateActiveExtensionsForAuthenticatedUser(e,t){let r=await this._client.callApi({type:"helix",url:"users/extensions",method:"PUT",userId:(0,we.extractUserId)(e),scopes:["channel:manage:extensions"],jsonBody:{data:t}});return new Lx.HelixInstalledExtensionList(r.data)}async _getUsers(e,t){if(t.length===0)return[];let r={[e]:t};return(await this._client.callApi({type:"helix",url:"users",query:r})).data.map(s=>new Eu.HelixUser(s,this._client))}};Ga.HelixUserApi=Qa;U_.__decorate([(0,O_.Enumerable)(!1)],Qa.prototype,"_getUserByIdBatcher",void 0);U_.__decorate([(0,O_.Enumerable)(!1)],Qa.prototype,"_getUserByNameBatcher",void 0);Ga.HelixUserApi=Qa=U_.__decorate([(0,we.rtfm)("api","HelixUserApi")],Qa)});var k_=u(Va=>{"use strict";Object.defineProperty(Va,"__esModule",{value:!0});Va.HelixVideo=void 0;var j_=(b(),x(g)),Qx=Ci(),KI=C(),j=_(),Wa=class extends j.DataObject{static{n(this,"HelixVideo")}constructor(e,t){super(e),this._client=t}get id(){return this[j.rawDataSymbol].id}get userId(){return this[j.rawDataSymbol].user_id}get userName(){return this[j.rawDataSymbol].user_login}get userDisplayName(){return this[j.rawDataSymbol].user_name}async getUser(){return(0,j.checkRelationAssertion)(await this._client.users.getUserById(this[j.rawDataSymbol].user_id))}get title(){return this[j.rawDataSymbol].title}get description(){return this[j.rawDataSymbol].description}get creationDate(){return new Date(this[j.rawDataSymbol].created_at)}get publishDate(){return new Date(this[j.rawDataSymbol].published_at)}get url(){return this[j.rawDataSymbol].url}get thumbnailUrl(){return this[j.rawDataSymbol].thumbnail_url}getThumbnailUrl(e,t){return this[j.rawDataSymbol].thumbnail_url.replace("%{width}",e.toString()).replace("%{height}",t.toString())}get isPublic(){return this[j.rawDataSymbol].viewable==="public"}get views(){return this[j.rawDataSymbol].view_count}get language(){return this[j.rawDataSymbol].language}get type(){return this[j.rawDataSymbol].type}get duration(){return this[j.rawDataSymbol].duration}get durationInSeconds(){let e=this[j.rawDataSymbol].duration.match(/\d+[hms]/g);if(!e)throw new j.HellFreezesOverError(`Could not parse duration string: ${this[j.rawDataSymbol].duration}`);return e.map(t=>{let r=/(\d+)([hms])/.exec(t);if(!r)throw new j.HellFreezesOverError(`Could not parse partial duration string: ${t}`);let[,a,s]=r;return parseInt(a,10)*{h:3600,m:60,s:1}[s]}).reduce((t,r)=>t+r)}get streamId(){return this[j.rawDataSymbol].stream_id}get mutedSegmentData(){var e,t;return(t=(e=this[j.rawDataSymbol].muted_segments)===null||e===void 0?void 0:e.slice())!==null&&t!==void 0?t:[]}isMutedAt(e,t,r=!1){if(this[j.rawDataSymbol].muted_segments===null)return!1;if(t==null)return this[j.rawDataSymbol].muted_segments.some(s=>s.offset<=e&&e<=s.offset+s.duration);let a=e+t;return r?this[j.rawDataSymbol].muted_segments.some(s=>{let o=s.offset+s.duration;return e<o&&s.offset<a}):this[j.rawDataSymbol].muted_segments.some(s=>{let o=s.offset+s.duration;return s.offset<=e&&a<=o})}};Va.HelixVideo=Wa;j_.__decorate([(0,KI.Enumerable)(!1)],Wa.prototype,"_client",void 0);j_.__decorate([(0,Qx.CachedGetter)()],Wa.prototype,"durationInSeconds",null);Va.HelixVideo=Wa=j_.__decorate([Qx.Cacheable,(0,j.rtfm)("api","HelixVideo","id")],Wa)});var L_=u($a=>{"use strict";var Pu;Object.defineProperty($a,"__esModule",{value:!0});$a.HelixVideoApi=void 0;var Gx=(b(),x(g)),JI=C(),Au=_(),ZI=Ft(),XI=oe(),YI=pe(),e1=le(),t1=G(),M_=k_(),Du=Pu=class extends t1.BaseApi{static{n(this,"HelixVideoApi")}constructor(){super(...arguments),this._getVideoByIdBatcher=new ZI.HelixRequestBatcher({url:"videos"},"id","id",this._client,e=>new M_.HelixVideo(e,this._client))}async getVideosByIds(e){return(await this._getVideos("id",e)).data}async getVideoById(e){let t=await this.getVideosByIds([e]);return t.length?t[0]:null}async getVideoByIdBatched(e){return await this._getVideoByIdBatcher.request(e)}async getVideosByUser(e,t={}){let r=(0,Au.extractUserId)(e);return await this._getVideos("user_id",[r],t)}getVideosByUserPaginated(e,t={}){let r=(0,Au.extractUserId)(e);return this._getVideosPaginated("user_id",[r],t)}async getVideosByGame(e,t={}){return await this._getVideos("game_id",[e],t)}getVideosByGamePaginated(e,t={}){return this._getVideosPaginated("game_id",[e],t)}async deleteVideosByIds(e,t){await this._client.callApi({type:"helix",url:"videos",method:"DELETE",scopes:["channel:manage:videos"],userId:(0,Au.extractUserId)(e),query:{id:t}})}async _getVideos(e,t,r={}){if(!t.length)return{data:[]};let a=await this._client.callApi({type:"helix",url:"videos",userId:e==="user_id"?t[0]:void 0,query:{...Pu._makeVideosQuery(e,t,r),...(0,e1.createPaginationQuery)(r)}});return(0,YI.createPaginatedResult)(a,M_.HelixVideo,this._client)}_getVideosPaginated(e,t,r={}){return new XI.HelixPaginatedRequest({url:"videos",userId:e==="user_id"?t[0]:void 0,query:Pu._makeVideosQuery(e,t,r)},this._client,a=>new M_.HelixVideo(a,this._client))}static _makeVideosQuery(e,t,r={}){let{language:a,period:s,orderBy:o,type:l}=r;return{[e]:t,language:a,period:s,sort:o,type:l}}};$a.HelixVideoApi=Du;Gx.__decorate([(0,JI.Enumerable)(!1)],Du.prototype,"_getVideoByIdBatcher",void 0);$a.HelixVideoApi=Du=Pu=Gx.__decorate([(0,Au.rtfm)("api","HelixVideoApi")],Du)});var Vx=u(Iu=>{"use strict";Object.defineProperty(Iu,"__esModule",{value:!0});Iu.createWhisperQuery=void 0;var Wx=_();function r1(i,e){return{from_user_id:(0,Wx.extractUserId)(i),to_user_id:(0,Wx.extractUserId)(e)}}n(r1,"createWhisperQuery");Iu.createWhisperQuery=r1});var N_=u(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});za.HelixWhisperApi=void 0;var i1=(b(),x(g)),$x=_(),n1=Vx(),a1=G(),F_=class extends a1.BaseApi{static{n(this,"HelixWhisperApi")}async sendWhisper(e,t,r){await this._client.callApi({type:"helix",url:"whispers",method:"POST",userId:(0,$x.extractUserId)(e),scopes:["user:manage:whispers"],query:(0,n1.createWhisperQuery)(e,t),jsonBody:{message:r}})}};za.HelixWhisperApi=F_;za.HelixWhisperApi=F_=i1.__decorate([(0,$x.rtfm)("api","HelixWhisperApi")],F_)});var G_=u(Tu=>{"use strict";Object.defineProperty(Tu,"__esModule",{value:!0});Tu.ApiReportedRequest=void 0;var Q_=class{static{n(this,"ApiReportedRequest")}constructor(e,t,r){this._options=e,this._httpStatus=t,this._resolvedUserId=r}get options(){return this._options}get httpStatus(){return this._httpStatus}get resolvedUserId(){return this._resolvedUserId}};Tu.ApiReportedRequest=Q_});var Uu=u(Ka=>{"use strict";Object.defineProperty(Ka,"__esModule",{value:!0});Ka.BaseApiClient=void 0;var W=(b(),x(g)),V=Ci(),s1=io(),o1=C(),l1=hd(),ci=Y(),Ru=Dd(),zx=_(),u1=lg(),c1=kd(),d1=Xd(),h1=rh(),p1=lh(),_1=Dh(),m1=Uh(),y1=kh(),f1=Qh(),g1=Xh(),b1=ap(),x1=lp(),w1=dp(),v1=mp(),S1=Tp(),H1=jp(),C1=Np(),q1=$p(),E1=e_(),P1=i_(),A1=d_(),D1=y_(),I1=w_(),T1=B_(),R1=L_(),U1=N_(),O1=G_(),N=class extends l1.EventEmitter{static{n(this,"BaseApiClient")}constructor(e,t,r){super(),this.onRequest=this.registerEvent(),this._config=e,this._logger=t,this._rateLimiter=r}async requestScopesForUser(e,t){await this._config.authProvider.getAccessTokenForUser(e,...t.map(r=>[r]))}async getTokenInfo(){try{let e=await this.callApi({type:"auth",url:"validate"});return new Ru.TokenInfo(e)}catch(e){throw e instanceof ci.HttpStatusCodeError&&e.statusCode===401?new Ru.InvalidTokenError({cause:e}):e}}async callApi(e){var t;let{authProvider:r}=this._config;if(!((t=e.auth)!==null&&t!==void 0?t:!0))return await(0,ci.callTwitchApi)(e,r.clientId,void 0,void 0,this._config.fetchOptions);let s=!1;if(e.forceType)switch(e.forceType){case"app":{if(!r.getAppAccessToken)throw new Error("Tried to make an API call that requires an app access token but your auth provider does not support that");let d=await r.getAppAccessToken();return await this._callApiUsingInitialToken(e,d)}case"user":{s=!0;break}default:throw new zx.HellFreezesOverError(`Unknown forced token type: ${e.forceType}`)}if(e.scopes&&(s=!0),s){let d=e.canOverrideScopedUserContext?this._getUserIdFromRequestContext(e.userId):e.userId;if(!d)throw new Error("Tried to make an API call with a user context but no context user ID");let p=await r.getAccessTokenForUser(d,e.scopes);if(!p)throw new Error(`Tried to make an API call with a user context for user ID ${d} but no token was found`);if((0,Ru.accessTokenIsExpired)(p)&&r.refreshAccessTokenForUser){let h=await r.refreshAccessTokenForUser(d);return await this._callApiUsingInitialToken(e,h,!0)}return await this._callApiUsingInitialToken(e,p)}let o=this._getUserIdFromRequestContext(e.userId),l=o===null?await r.getAnyAccessToken():await r.getAnyAccessToken(o??e.userId);if((0,Ru.accessTokenIsExpired)(l)&&l.userId&&r.refreshAccessTokenForUser){let d=await r.refreshAccessTokenForUser(l.userId);return await this._callApiUsingInitialToken(e,d,!0)}return await this._callApiUsingInitialToken(e,l)}get bits(){return new c1.HelixBitsApi(this)}get channels(){return new d1.HelixChannelApi(this)}get channelPoints(){return new h1.HelixChannelPointsApi(this)}get charity(){return new p1.HelixCharityApi(this)}get chat(){return new _1.HelixChatApi(this)}get clips(){return new m1.HelixClipApi(this)}get contentClassificationLabels(){return new y1.HelixContentClassificationLabelApi(this)}get entitlements(){return new f1.HelixEntitlementApi(this)}get eventSub(){return new g1.HelixEventSubApi(this)}get extensions(){return new b1.HelixExtensionsApi(this)}get games(){return new x1.HelixGameApi(this)}get hypeTrain(){return new v1.HelixHypeTrainApi(this)}get goals(){return new w1.HelixGoalApi(this)}get moderation(){return new S1.HelixModerationApi(this)}get polls(){return new H1.HelixPollApi(this)}get predictions(){return new C1.HelixPredictionApi(this)}get raids(){return new q1.HelixRaidApi(this)}get schedule(){return new E1.HelixScheduleApi(this)}get search(){return new P1.HelixSearchApi(this)}get streams(){return new A1.HelixStreamApi(this)}get subscriptions(){return new D1.HelixSubscriptionApi(this)}get teams(){return new I1.HelixTeamApi(this)}get users(){return new T1.HelixUserApi(this)}get videos(){return new R1.HelixVideoApi(this)}get whispers(){return new U1.HelixWhisperApi(this)}get rateLimiterStats(){return this._rateLimiter instanceof s1.ResponseBasedRateLimiter?this._rateLimiter.stats:null}get _authProvider(){return this._config.authProvider}get _mockServerPort(){return this._config.mockServerPort}get _batchDelay(){var e;return(e=this._config.batchDelay)!==null&&e!==void 0?e:0}_getUserIdFromRequestContext(e){return e}async _callApiUsingInitialToken(e,t,r=!1){var a;let{authProvider:s}=this._config,{authorizationType:o}=s,l=await this._callApiInternal(e,s.clientId,t.accessToken,o);if(l.status===401&&!r){if(t.userId){if(s.refreshAccessTokenForUser){let d=await s.refreshAccessTokenForUser(t.userId);l=await this._callApiInternal(e,s.clientId,d.accessToken,o)}}else if(s.getAppAccessToken){let d=await s.getAppAccessToken(!0);l=await this._callApiInternal(e,s.clientId,d.accessToken,o)}}return this.emit(this.onRequest,new O1.ApiReportedRequest(e,l.status,(a=t.userId)!==null&&a!==void 0?a:null)),await(0,ci.handleTwitchApiResponseError)(l,e),await(0,ci.transformTwitchApiResponse)(l)}async _callApiInternal(e,t,r,a){var s,o,l;let{fetchOptions:d,mockServerPort:p}=this._config,h=(s=e.type)!==null&&s!==void 0?s:"helix";this._logger.debug(`Calling ${h} API: ${(o=e.method)!==null&&o!==void 0?o:"GET"} ${e.url}`),this._logger.trace(`Query: ${JSON.stringify(e.query)}`),e.jsonBody&&this._logger.trace(`Request body: ${JSON.stringify(e.jsonBody)}`);let w=u1.operation({retries:3,minTimeout:500,factor:2}),{promise:E,resolve:P,reject:y}=(0,o1.promiseWithResolvers)();w.attempt(async()=>{try{let v=h==="helix"?await this._rateLimiter.request({options:e,clientId:t,accessToken:r,authorizationType:a,fetchOptions:d,mockServerPort:p}):await(0,ci.callTwitchApiRaw)(e,t,r,a,d,p);!v.ok&&v.status>=500&&v.status<600&&await(0,ci.handleTwitchApiResponseError)(v,e),P(v)}catch(v){if(w.retry(v))return;y(w.mainError())}});let q=await E;return this._logger.debug(`Called ${h} API: ${(l=e.method)!==null&&l!==void 0?l:"GET"} ${e.url} - result: ${q.status}`),q}};Ka.BaseApiClient=N;W.__decorate([(0,V.CachedGetter)()],N.prototype,"bits",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"channels",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"channelPoints",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"charity",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"chat",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"clips",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"contentClassificationLabels",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"entitlements",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"eventSub",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"extensions",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"games",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"hypeTrain",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"goals",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"moderation",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"polls",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"predictions",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"raids",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"schedule",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"search",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"streams",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"subscriptions",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"teams",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"users",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"videos",null);W.__decorate([(0,V.CachedGetter)()],N.prototype,"whispers",null);Ka.BaseApiClient=N=W.__decorate([V.Cacheable,(0,zx.rtfm)("api","ApiClient")],N)});var Kx=u(Ja=>{"use strict";Object.defineProperty(Ja,"__esModule",{value:!0});Ja.NoContextApiClient=void 0;var B1=(b(),x(g)),j1=_(),k1=Uu(),W_=class extends k1.BaseApiClient{static{n(this,"NoContextApiClient")}_getUserIdFromRequestContext(){return null}};Ja.NoContextApiClient=W_;Ja.NoContextApiClient=W_=B1.__decorate([(0,j1.rtfm)("api","ApiClient")],W_)});var Jx=u(Za=>{"use strict";Object.defineProperty(Za,"__esModule",{value:!0});Za.UserContextApiClient=void 0;var M1=(b(),x(g)),L1=_(),F1=Uu(),V_=class extends F1.BaseApiClient{static{n(this,"UserContextApiClient")}constructor(e,t,r,a){super(e,t,r),this._userId=a}_getUserIdFromRequestContext(){return this._userId}};Za.UserContextApiClient=V_;Za.UserContextApiClient=V_=M1.__decorate([(0,L1.rtfm)("api","ApiClient")],V_)});var ew=u(Xa=>{"use strict";Object.defineProperty(Xa,"__esModule",{value:!0});Xa.ApiClient=void 0;var N1=(b(),x(g)),Q1=fi(),G1=bi(),Zx=io(),W1=Y(),Yx=_(),V1=od(),$1=Mf(),z1=Uu(),K1=Kx(),Xx=Jx(),$_=class extends z1.BaseApiClient{static{n(this,"ApiClient")}constructor(e){if(!e.authProvider)throw new V1.ConfigError("No auth provider given. Please supply the `authProvider` option.");let t={name:"twurple:api:rate-limiter",...e.logger};super(e,(0,G1.createLogger)({name:"twurple:api:client",...e.logger}),Q1.isNode?new Zx.PartitionedRateLimiter({getPartitionKey:n(r=>{var a;return(a=r.userId)!==null&&a!==void 0?a:null},"getPartitionKey"),createChild:n(()=>new $1.HelixRateLimiter({logger:t}),"createChild")}):new Zx.PartitionedTimeBasedRateLimiter({logger:t,bucketSize:800,timeFrame:64e3,doRequest:n(async({options:r,clientId:a,accessToken:s,authorizationType:o,fetchOptions:l,mockServerPort:d})=>await(0,W1.callTwitchApiRaw)(r,a,s,o,l,d),"doRequest"),getPartitionKey:n(r=>{var a;return(a=r.userId)!==null&&a!==void 0?a:null},"getPartitionKey")}))}async asUser(e,t){let r=new Xx.UserContextApiClient(this._config,this._logger,this._rateLimiter,(0,Yx.extractUserId)(e));return await t(r)}async asIntent(e,t){if(!this._authProvider.getAccessTokenForIntent)throw new Error("Trying to use intents with an auth provider that does not support them");for(let r of e){let a=await this._authProvider.getAccessTokenForIntent(r);if(a){let s=new Xx.UserContextApiClient(this._config,this._logger,this._rateLimiter,a.userId);return await t(s)}}throw new Error(`Intents [${e.join(", ")}] not found in auth provider`)}async withoutUser(e){let t=new K1.NoContextApiClient(this._config,this._logger,this._rateLimiter);return await e(t)}};Xa.ApiClient=$_;Xa.ApiClient=$_=N1.__decorate([(0,Yx.rtfm)("api","ApiClient")],$_)});var rw=u(Ya=>{"use strict";Object.defineProperty(Ya,"__esModule",{value:!0});Ya.HelixFollow=void 0;var tw=(b(),x(g)),J1=C(),Le=_(),Ou=class extends Le.DataObject{static{n(this,"HelixFollow")}constructor(e,t){super(e),this._client=t}get userId(){return this[Le.rawDataSymbol].from_id}get userName(){return this[Le.rawDataSymbol].from_login}get userDisplayName(){return this[Le.rawDataSymbol].from_name}async getUser(){return(0,Le.checkRelationAssertion)(await this._client.users.getUserById(this[Le.rawDataSymbol].from_id))}get followedUserId(){return this[Le.rawDataSymbol].to_id}get followedUserName(){return this[Le.rawDataSymbol].to_login}get followedUserDisplayName(){return this[Le.rawDataSymbol].to_name}async getFollowedUser(){return(0,Le.checkRelationAssertion)(await this._client.users.getUserById(this[Le.rawDataSymbol].to_id))}get followDate(){return new Date(this[Le.rawDataSymbol].followed_at)}};Ya.HelixFollow=Ou;tw.__decorate([(0,J1.Enumerable)(!1)],Ou.prototype,"_client",void 0);Ya.HelixFollow=Ou=tw.__decorate([(0,Le.rtfm)("api","HelixFollow")],Ou)});var iw=u(c=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});c.HelixGoal=c.HelixGoalApi=c.HelixGame=c.HelixGameApi=c.HelixExtensionTransaction=c.HelixExtensionBitsProduct=c.HelixExtensionsApi=c.HelixPaginatedEventSubSubscriptionsRequest=c.HelixEventSubSubscription=c.HelixEventSubConduitShard=c.HelixEventSubConduit=c.HelixEventSubApi=c.HelixDropsEntitlement=c.HelixEntitlementApi=c.HelixContentClassificationLabel=c.HelixContentClassificationLabelApi=c.HelixClip=c.HelixClipApi=c.HelixSharedChatSession=c.HelixSharedChatSessionParticipant=c.HelixSentChatMessage=c.HelixPrivilegedChatSettings=c.HelixUserEmote=c.HelixEmoteFromSet=c.HelixChannelEmote=c.HelixEmote=c.HelixChatChatter=c.HelixChatSettings=c.HelixChatBadgeVersion=c.HelixChatBadgeSet=c.HelixChatApi=c.HelixCharityCampaignAmount=c.HelixCharityCampaignDonation=c.HelixCharityCampaign=c.HelixCharityApi=c.HelixCustomRewardRedemption=c.HelixCustomReward=c.HelixChannelPointsApi=c.HelixChannelReference=c.HelixFollowedChannel=c.HelixChannelFollower=c.HelixChannelEditor=c.HelixChannel=c.HelixAdSchedule=c.HelixChannelApi=c.HelixCheermoteList=c.HelixBitsLeaderboardEntry=c.HelixBitsLeaderboard=c.HelixBitsApi=c.ApiClient=void 0;c.HelixVideo=c.HelixVideoApi=c.HelixUserExtension=c.HelixInstalledExtensionList=c.HelixInstalledExtension=c.HelixBaseExtension=c.HelixUser=c.HelixPrivilegedUser=c.HelixFollow=c.HelixUserBlock=c.HelixUserApi=c.HelixTeamWithUsers=c.HelixTeam=c.HelixTeamApi=c.HelixUserSubscription=c.HelixSubscription=c.HelixSubscriptionApi=c.HelixPaginatedSubscriptionsRequest=c.HelixStreamMarkerWithVideo=c.HelixStreamMarker=c.HelixStream=c.HelixStreamApi=c.HelixChannelSearchResult=c.HelixSearchApi=c.HelixPaginatedScheduleSegmentRequest=c.HelixScheduleSegment=c.HelixSchedule=c.HelixScheduleApi=c.HelixUserRelation=c.HelixRaid=c.HelixRaidApi=c.HelixPredictor=c.HelixPredictionOutcome=c.HelixPrediction=c.HelixPredictionApi=c.HelixPollChoice=c.HelixPoll=c.HelixPollApi=c.HelixWarning=c.HelixUnbanRequest=c.HelixShieldModeStatus=c.HelixBlockedTerm=c.HelixBanUser=c.HelixModeratedChannel=c.HelixModerator=c.HelixBan=c.HelixModerationApi=c.HelixHypeTrainEvent=c.HelixHypeTrainContribution=c.HelixHypeTrainApi=void 0;c.HellFreezesOverError=c.HelixExtension=c.extractUserName=c.extractUserId=c.HelixPaginatedRequestWithTotal=c.HelixPaginatedRequest=c.ApiReportedRequest=c.StreamNotLiveError=c.ConfigError=c.HelixWhisperApi=void 0;var Z1=ew();Object.defineProperty(c,"ApiClient",{enumerable:!0,get:n(function(){return Z1.ApiClient},"get")});var X1=kd();Object.defineProperty(c,"HelixBitsApi",{enumerable:!0,get:n(function(){return X1.HelixBitsApi},"get")});var Y1=Rd();Object.defineProperty(c,"HelixBitsLeaderboard",{enumerable:!0,get:n(function(){return Y1.HelixBitsLeaderboard},"get")});var eT=Id();Object.defineProperty(c,"HelixBitsLeaderboardEntry",{enumerable:!0,get:n(function(){return eT.HelixBitsLeaderboardEntry},"get")});var tT=Od();Object.defineProperty(c,"HelixCheermoteList",{enumerable:!0,get:n(function(){return tT.HelixCheermoteList},"get")});var rT=Xd();Object.defineProperty(c,"HelixChannelApi",{enumerable:!0,get:n(function(){return rT.HelixChannelApi},"get")});var iT=$d();Object.defineProperty(c,"HelixAdSchedule",{enumerable:!0,get:n(function(){return iT.HelixAdSchedule},"get")});var nT=Nd();Object.defineProperty(c,"HelixChannel",{enumerable:!0,get:n(function(){return nT.HelixChannel},"get")});var aT=Qd();Object.defineProperty(c,"HelixChannelEditor",{enumerable:!0,get:n(function(){return aT.HelixChannelEditor},"get")});var sT=Gd();Object.defineProperty(c,"HelixChannelFollower",{enumerable:!0,get:n(function(){return sT.HelixChannelFollower},"get")});var oT=Wd();Object.defineProperty(c,"HelixFollowedChannel",{enumerable:!0,get:n(function(){return oT.HelixFollowedChannel},"get")});var lT=Yh();Object.defineProperty(c,"HelixChannelReference",{enumerable:!0,get:n(function(){return lT.HelixChannelReference},"get")});var uT=rh();Object.defineProperty(c,"HelixChannelPointsApi",{enumerable:!0,get:n(function(){return uT.HelixChannelPointsApi},"get")});var cT=Yd();Object.defineProperty(c,"HelixCustomReward",{enumerable:!0,get:n(function(){return cT.HelixCustomReward},"get")});var dT=eh();Object.defineProperty(c,"HelixCustomRewardRedemption",{enumerable:!0,get:n(function(){return dT.HelixCustomRewardRedemption},"get")});var hT=lh();Object.defineProperty(c,"HelixCharityApi",{enumerable:!0,get:n(function(){return hT.HelixCharityApi},"get")});var pT=nh();Object.defineProperty(c,"HelixCharityCampaign",{enumerable:!0,get:n(function(){return pT.HelixCharityCampaign},"get")});var _T=ah();Object.defineProperty(c,"HelixCharityCampaignDonation",{enumerable:!0,get:n(function(){return _T.HelixCharityCampaignDonation},"get")});var mT=sl();Object.defineProperty(c,"HelixCharityCampaignAmount",{enumerable:!0,get:n(function(){return mT.HelixCharityCampaignAmount},"get")});var yT=Dh();Object.defineProperty(c,"HelixChatApi",{enumerable:!0,get:n(function(){return yT.HelixChatApi},"get")});var fT=yh();Object.defineProperty(c,"HelixChatBadgeSet",{enumerable:!0,get:n(function(){return fT.HelixChatBadgeSet},"get")});var gT=mh();Object.defineProperty(c,"HelixChatBadgeVersion",{enumerable:!0,get:n(function(){return gT.HelixChatBadgeVersion},"get")});var bT=_l();Object.defineProperty(c,"HelixChatSettings",{enumerable:!0,get:n(function(){return bT.HelixChatSettings},"get")});var xT=fh();Object.defineProperty(c,"HelixChatChatter",{enumerable:!0,get:n(function(){return xT.HelixChatChatter},"get")});var wT=on();Object.defineProperty(c,"HelixEmote",{enumerable:!0,get:n(function(){return wT.HelixEmote},"get")});var vT=ph();Object.defineProperty(c,"HelixChannelEmote",{enumerable:!0,get:n(function(){return vT.HelixChannelEmote},"get")});var ST=bh();Object.defineProperty(c,"HelixEmoteFromSet",{enumerable:!0,get:n(function(){return ST.HelixEmoteFromSet},"get")});var HT=xh();Object.defineProperty(c,"HelixUserEmote",{enumerable:!0,get:n(function(){return HT.HelixUserEmote},"get")});var CT=Sh();Object.defineProperty(c,"HelixPrivilegedChatSettings",{enumerable:!0,get:n(function(){return CT.HelixPrivilegedChatSettings},"get")});var qT=Ch();Object.defineProperty(c,"HelixSentChatMessage",{enumerable:!0,get:n(function(){return qT.HelixSentChatMessage},"get")});var ET=qh();Object.defineProperty(c,"HelixSharedChatSessionParticipant",{enumerable:!0,get:n(function(){return ET.HelixSharedChatSessionParticipant},"get")});var PT=Eh();Object.defineProperty(c,"HelixSharedChatSession",{enumerable:!0,get:n(function(){return PT.HelixSharedChatSession},"get")});var AT=Uh();Object.defineProperty(c,"HelixClipApi",{enumerable:!0,get:n(function(){return AT.HelixClipApi},"get")});var DT=Ih();Object.defineProperty(c,"HelixClip",{enumerable:!0,get:n(function(){return DT.HelixClip},"get")});var IT=kh();Object.defineProperty(c,"HelixContentClassificationLabelApi",{enumerable:!0,get:n(function(){return IT.HelixContentClassificationLabelApi},"get")});var TT=Bh();Object.defineProperty(c,"HelixContentClassificationLabel",{enumerable:!0,get:n(function(){return TT.HelixContentClassificationLabel},"get")});var RT=Qh();Object.defineProperty(c,"HelixEntitlementApi",{enumerable:!0,get:n(function(){return RT.HelixEntitlementApi},"get")});var UT=Mh();Object.defineProperty(c,"HelixDropsEntitlement",{enumerable:!0,get:n(function(){return UT.HelixDropsEntitlement},"get")});var OT=Xh();Object.defineProperty(c,"HelixEventSubApi",{enumerable:!0,get:n(function(){return OT.HelixEventSubApi},"get")});var BT=Vh();Object.defineProperty(c,"HelixEventSubConduit",{enumerable:!0,get:n(function(){return BT.HelixEventSubConduit},"get")});var jT=zh();Object.defineProperty(c,"HelixEventSubConduitShard",{enumerable:!0,get:n(function(){return jT.HelixEventSubConduitShard},"get")});var kT=Pl();Object.defineProperty(c,"HelixEventSubSubscription",{enumerable:!0,get:n(function(){return kT.HelixEventSubSubscription},"get")});var MT=Wh();Object.defineProperty(c,"HelixPaginatedEventSubSubscriptionsRequest",{enumerable:!0,get:n(function(){return MT.HelixPaginatedEventSubSubscriptionsRequest},"get")});var LT=ap();Object.defineProperty(c,"HelixExtensionsApi",{enumerable:!0,get:n(function(){return LT.HelixExtensionsApi},"get")});var FT=tp();Object.defineProperty(c,"HelixExtensionBitsProduct",{enumerable:!0,get:n(function(){return FT.HelixExtensionBitsProduct},"get")});var NT=rp();Object.defineProperty(c,"HelixExtensionTransaction",{enumerable:!0,get:n(function(){return NT.HelixExtensionTransaction},"get")});var QT=lp();Object.defineProperty(c,"HelixGameApi",{enumerable:!0,get:n(function(){return QT.HelixGameApi},"get")});var GT=Ol();Object.defineProperty(c,"HelixGame",{enumerable:!0,get:n(function(){return GT.HelixGame},"get")});var WT=dp();Object.defineProperty(c,"HelixGoalApi",{enumerable:!0,get:n(function(){return WT.HelixGoalApi},"get")});var VT=up();Object.defineProperty(c,"HelixGoal",{enumerable:!0,get:n(function(){return VT.HelixGoal},"get")});var $T=mp();Object.defineProperty(c,"HelixHypeTrainApi",{enumerable:!0,get:n(function(){return $T.HelixHypeTrainApi},"get")});var zT=hp();Object.defineProperty(c,"HelixHypeTrainContribution",{enumerable:!0,get:n(function(){return zT.HelixHypeTrainContribution},"get")});var KT=pp();Object.defineProperty(c,"HelixHypeTrainEvent",{enumerable:!0,get:n(function(){return KT.HelixHypeTrainEvent},"get")});var JT=Tp();Object.defineProperty(c,"HelixModerationApi",{enumerable:!0,get:n(function(){return JT.HelixModerationApi},"get")});var ZT=wp();Object.defineProperty(c,"HelixBan",{enumerable:!0,get:n(function(){return ZT.HelixBan},"get")});var XT=Cp();Object.defineProperty(c,"HelixModerator",{enumerable:!0,get:n(function(){return XT.HelixModerator},"get")});var YT=Hp();Object.defineProperty(c,"HelixModeratedChannel",{enumerable:!0,get:n(function(){return YT.HelixModeratedChannel},"get")});var eR=Nl();Object.defineProperty(c,"HelixBanUser",{enumerable:!0,get:n(function(){return eR.HelixBanUser},"get")});var tR=Sp();Object.defineProperty(c,"HelixBlockedTerm",{enumerable:!0,get:n(function(){return tR.HelixBlockedTerm},"get")});var rR=qp();Object.defineProperty(c,"HelixShieldModeStatus",{enumerable:!0,get:n(function(){return rR.HelixShieldModeStatus},"get")});var iR=Ep();Object.defineProperty(c,"HelixUnbanRequest",{enumerable:!0,get:n(function(){return iR.HelixUnbanRequest},"get")});var nR=Pp();Object.defineProperty(c,"HelixWarning",{enumerable:!0,get:n(function(){return nR.HelixWarning},"get")});var aR=jp();Object.defineProperty(c,"HelixPollApi",{enumerable:!0,get:n(function(){return aR.HelixPollApi},"get")});var sR=Op();Object.defineProperty(c,"HelixPoll",{enumerable:!0,get:n(function(){return sR.HelixPoll},"get")});var oR=Up();Object.defineProperty(c,"HelixPollChoice",{enumerable:!0,get:n(function(){return oR.HelixPollChoice},"get")});var lR=Np();Object.defineProperty(c,"HelixPredictionApi",{enumerable:!0,get:n(function(){return lR.HelixPredictionApi},"get")});var uR=Lp();Object.defineProperty(c,"HelixPrediction",{enumerable:!0,get:n(function(){return uR.HelixPrediction},"get")});var cR=Mp();Object.defineProperty(c,"HelixPredictionOutcome",{enumerable:!0,get:n(function(){return cR.HelixPredictionOutcome},"get")});var dR=kp();Object.defineProperty(c,"HelixPredictor",{enumerable:!0,get:n(function(){return dR.HelixPredictor},"get")});var hR=$p();Object.defineProperty(c,"HelixRaidApi",{enumerable:!0,get:n(function(){return hR.HelixRaidApi},"get")});var pR=Gp();Object.defineProperty(c,"HelixRaid",{enumerable:!0,get:n(function(){return pR.HelixRaid},"get")});var _R=Go();Object.defineProperty(c,"HelixUserRelation",{enumerable:!0,get:n(function(){return _R.HelixUserRelation},"get")});var mR=e_();Object.defineProperty(c,"HelixScheduleApi",{enumerable:!0,get:n(function(){return mR.HelixScheduleApi},"get")});var yR=Zp();Object.defineProperty(c,"HelixSchedule",{enumerable:!0,get:n(function(){return yR.HelixSchedule},"get")});var fR=ga();Object.defineProperty(c,"HelixScheduleSegment",{enumerable:!0,get:n(function(){return fR.HelixScheduleSegment},"get")});var gR=Jp();Object.defineProperty(c,"HelixPaginatedScheduleSegmentRequest",{enumerable:!0,get:n(function(){return gR.HelixPaginatedScheduleSegmentRequest},"get")});var bR=i_();Object.defineProperty(c,"HelixSearchApi",{enumerable:!0,get:n(function(){return bR.HelixSearchApi},"get")});var xR=t_();Object.defineProperty(c,"HelixChannelSearchResult",{enumerable:!0,get:n(function(){return xR.HelixChannelSearchResult},"get")});var wR=d_();Object.defineProperty(c,"HelixStreamApi",{enumerable:!0,get:n(function(){return wR.HelixStreamApi},"get")});var vR=s_();Object.defineProperty(c,"HelixStream",{enumerable:!0,get:n(function(){return vR.HelixStream},"get")});var SR=cu();Object.defineProperty(c,"HelixStreamMarker",{enumerable:!0,get:n(function(){return SR.HelixStreamMarker},"get")});var HR=u_();Object.defineProperty(c,"HelixStreamMarkerWithVideo",{enumerable:!0,get:n(function(){return HR.HelixStreamMarkerWithVideo},"get")});var CR=__();Object.defineProperty(c,"HelixPaginatedSubscriptionsRequest",{enumerable:!0,get:n(function(){return CR.HelixPaginatedSubscriptionsRequest},"get")});var qR=y_();Object.defineProperty(c,"HelixSubscriptionApi",{enumerable:!0,get:n(function(){return qR.HelixSubscriptionApi},"get")});var ER=fu();Object.defineProperty(c,"HelixSubscription",{enumerable:!0,get:n(function(){return ER.HelixSubscription},"get")});var PR=yu();Object.defineProperty(c,"HelixUserSubscription",{enumerable:!0,get:n(function(){return PR.HelixUserSubscription},"get")});var AR=w_();Object.defineProperty(c,"HelixTeamApi",{enumerable:!0,get:n(function(){return AR.HelixTeamApi},"get")});var DR=xu();Object.defineProperty(c,"HelixTeam",{enumerable:!0,get:n(function(){return DR.HelixTeam},"get")});var IR=g_();Object.defineProperty(c,"HelixTeamWithUsers",{enumerable:!0,get:n(function(){return IR.HelixTeamWithUsers},"get")});var TR=B_();Object.defineProperty(c,"HelixUserApi",{enumerable:!0,get:n(function(){return TR.HelixUserApi},"get")});var RR=R_();Object.defineProperty(c,"HelixUserBlock",{enumerable:!0,get:n(function(){return RR.HelixUserBlock},"get")});var UR=rw();Object.defineProperty(c,"HelixFollow",{enumerable:!0,get:n(function(){return UR.HelixFollow},"get")});var OR=T_();Object.defineProperty(c,"HelixPrivilegedUser",{enumerable:!0,get:n(function(){return OR.HelixPrivilegedUser},"get")});var BR=Cu();Object.defineProperty(c,"HelixUser",{enumerable:!0,get:n(function(){return BR.HelixUser},"get")});var jR=Su();Object.defineProperty(c,"HelixBaseExtension",{enumerable:!0,get:n(function(){return jR.HelixBaseExtension},"get")});var kR=H_();Object.defineProperty(c,"HelixInstalledExtension",{enumerable:!0,get:n(function(){return kR.HelixInstalledExtension},"get")});var MR=E_();Object.defineProperty(c,"HelixInstalledExtensionList",{enumerable:!0,get:n(function(){return MR.HelixInstalledExtensionList},"get")});var LR=D_();Object.defineProperty(c,"HelixUserExtension",{enumerable:!0,get:n(function(){return LR.HelixUserExtension},"get")});var FR=L_();Object.defineProperty(c,"HelixVideoApi",{enumerable:!0,get:n(function(){return FR.HelixVideoApi},"get")});var NR=k_();Object.defineProperty(c,"HelixVideo",{enumerable:!0,get:n(function(){return NR.HelixVideo},"get")});var QR=N_();Object.defineProperty(c,"HelixWhisperApi",{enumerable:!0,get:n(function(){return QR.HelixWhisperApi},"get")});var GR=od();Object.defineProperty(c,"ConfigError",{enumerable:!0,get:n(function(){return GR.ConfigError},"get")});var WR=a_();Object.defineProperty(c,"StreamNotLiveError",{enumerable:!0,get:n(function(){return WR.StreamNotLiveError},"get")});var VR=G_();Object.defineProperty(c,"ApiReportedRequest",{enumerable:!0,get:n(function(){return VR.ApiReportedRequest},"get")});var $R=oe();Object.defineProperty(c,"HelixPaginatedRequest",{enumerable:!0,get:n(function(){return $R.HelixPaginatedRequest},"get")});var zR=Gr();Object.defineProperty(c,"HelixPaginatedRequestWithTotal",{enumerable:!0,get:n(function(){return zR.HelixPaginatedRequestWithTotal},"get")});var Bu=_();Object.defineProperty(c,"extractUserId",{enumerable:!0,get:n(function(){return Bu.extractUserId},"get")});Object.defineProperty(c,"extractUserName",{enumerable:!0,get:n(function(){return Bu.extractUserName},"get")});Object.defineProperty(c,"HelixExtension",{enumerable:!0,get:n(function(){return Bu.HelixExtension},"get")});Object.defineProperty(c,"HellFreezesOverError",{enumerable:!0,get:n(function(){return Bu.HellFreezesOverError},"get")})});var cw=u(($G,uw)=>{var nw=Fu(),KR=Gu(),aw=rs(),er=Tt(),sw=Vu(),ow=zu(),lw=Ju(),ju=Gm(),{ApiClient:JR}=iw(),{AppTokenAuthProvider:ZR}=Dd(),z_=class{static{n(this,"EmoteFetcher")}constructor(e,t,r){if(r&&r.apiClient)this.apiClient=r.apiClient;else if(e!==void 0&&t!==void 0){let a=new ZR(e,t);this.apiClient=new JR({authProvider:a})}this.emotes=new aw,this.channels=new aw,this.ffzModifiersFetched=!1}get globalChannel(){return this.channels.get(null)}_setupChannel(e,t=null){let r=this.channels.get(e);return r||(r=new KR(this,e),this.channels.set(e,r)),t&&(r.format=t),r}_getRawTwitchEmotes(e){if(!this.apiClient)throw new Error("Client id or client secret not provided.");return e?this.apiClient.chat.getChannelEmotes(e):this.apiClient.chat.getGlobalEmotes()}_cacheTwitchEmote(e,t,r=null){let a=this._setupChannel(e),s=r||new lw(a,t.id,t);return this.emotes.set(s.code,s),a.emotes.set(s.code,s),s}_getRawBTTVEmotes(e){let t=e?er.BTTV.Channel(e):er.BTTV.Global;return ju.get(t).then(r=>r.data instanceof Array?r.data:[...r.data.channelEmotes,...r.data.sharedEmotes])}_cacheBTTVEmote(e,t,r=null){let a=this._setupChannel(e),s=r||new nw(a,t.id,t);return this.emotes.set(s.code,s),a.emotes.set(s.code,s),s}_getRawFFZEmoteSet(e){let t=er.FFZ.Set(e);return ju.get(t).then(r=>r.data.set.emoticons)}_getRawFFZEmotes(e){let t=er.FFZ.Channel(e);return ju.get(t).then(r=>{let a=[];for(let s of Object.keys(r.data.sets)){let o=r.data.sets[s];a.push(...o.emoticons)}return a})}_cacheFFZEmote(e,t,r=null){let a=this._setupChannel(e),s=r||new sw(a,t.id,t);return this.emotes.set(s.code,s),a.emotes.set(s.code,s),s}_getRawSevenTVEmotes(e){let t=e?er.SevenTV.Channel(e):er.SevenTV.Global;return ju.get(t).then(r=>r.data)}_cacheSevenTVEmote(e,t,r,a=null){let s=this._setupChannel(e,r),o=a||new ow(s,t.id,t);return this.emotes.set(o.code,o),s.emotes.set(o.code,o),o}fetchTwitchEmotes(e=null){return this._getRawTwitchEmotes(e).then(t=>{for(let r of t)this._cacheTwitchEmote(e,{code:r.name,id:r.id,formats:r.formats});return this.channels.get(e).emotes.filter(r=>r.type==="twitch")})}fetchBTTVEmotes(e=null){return this._getRawBTTVEmotes(e).then(t=>{for(let r of t)this._cacheBTTVEmote(e,r);return this.channels.get(e).emotes.filter(r=>r.type==="bttv")})}async fetchFFZEmotes(e=null){return this.ffzModifiersFetched||(this.ffzModifiersFetched=!0,await this._getRawFFZEmoteSet(er.FFZ.sets.Modifiers).then(t=>{for(let r of t)this._cacheFFZEmote(null,r)})),e?this._getRawFFZEmotes(e).then(t=>{for(let r of t)this._cacheFFZEmote(e,r);return this.channels.get(e).emotes.filter(r=>r.type==="ffz")}):this._getRawFFZEmoteSet(er.FFZ.sets.Global).then(t=>{for(let r of t)this._cacheFFZEmote(e,r);return this.channels.get(e).emotes.filter(r=>r.type==="ffz")})}fetchSevenTVEmotes(e=null,t="webp"){return this._getRawSevenTVEmotes(e).then(r=>{if("emotes"in r)for(let a of r.emotes)this._cacheSevenTVEmote(e,a,t);else for(let a of r.emote_set.emotes)this._cacheSevenTVEmote(e,a,t);return this.channels.get(e).emotes.filter(a=>a.type==="7tv")})}fromObject(e){let t=[],r={bttv:{class:nw,cache:n((a,s,o)=>this._cacheBTTVEmote(s,null,o),"cache")},ffz:{class:sw,cache:n((a,s,o)=>this._cacheFFZEmote(s,null,o),"cache")},"7tv":{class:ow,cache:n((a,s,o)=>this._cacheSevenTVEmote(s,null,a.imageType,o),"cache")},twitch:{class:lw,cache:n((a,s,o)=>this._cacheTwitchEmote(s,null,o),"cache")}};for(let a of e){let{type:s}=a;if(!Object.keys(r).includes(s))throw new TypeError(`Unknown type: ${s}`);let o=r[s].class;this._setupChannel(a.channel_id,s==="7tv"?a.imageType:null);let l=o.fromObject(a,this.channels.get(a.channel_id));r[s].cache(a,a.channel_id,l),t.push(l)}return t}};uw.exports=z_});var hw=u((KG,dw)=>{var XR=Tt(),K_=class{static{n(this,"EmoteParser")}constructor(e,t={}){this.fetcher=e,this.options=Object.assign({template:"",type:"markdown",match:/:(.+?):/g},t),this._validateOptions(this.options)}_validateOptions(e){if(e.template&&typeof e.template!="string")throw new TypeError("Template must be a string");if(!["markdown","html","bbcode","plain"].includes(e.type))throw new TypeError("Parse type must be one of `markdown`, `html`, `bbcode`, or `plain`");if(!(e.match instanceof RegExp)||!e.match.global)throw new TypeError("Match must be a global RegExp.")}parse(e,t=0){return e.replace(this.options.match,(a,s)=>{let o=this.fetcher.emotes.get(s);if(!o)return a;if(o.modifier)return"";let l=this.options.template||XR.Templates[this.options.type],d=o.toLink(t);return l.replace(/{link}/g,d).replace(/{name}/g,o.code).replace(/{size}/g,t).replace(/{creator}/g,o.ownerName||"global")})}};dw.exports=K_});var YR=u((ZG,pw)=>{pw.exports={BTTVEmote:Fu(),Channel:Gu(),Collection:rs(),Constants:Tt(),Emote:vr(),EmoteFetcher:cw(),EmoteParser:hw(),FFZEmote:Vu(),SevenTVEmote:zu(),TwitchEmote:Ju()}});export default YR();
|
|
20
20
|
/*! Bundled license information:
|
|
21
21
|
|
|
22
22
|
axios/dist/browser/axios.cjs:
|
|
23
|
-
(*! Axios v1.
|
|
23
|
+
(*! Axios v1.13.5 Copyright (c) 2026 Matt Zabriskie and contributors *)
|
|
24
24
|
*/
|
|
25
25
|
//# sourceMappingURL=TwitchEmoticons.min.js.map
|