(()=>{var Ot=Object.create;var rt=Object.defineProperty;var At=Object.getOwnPropertyDescriptor;var xt=Object.getOwnPropertyNames;var jt=Object.getPrototypeOf,Et=Object.prototype.hasOwnProperty;var _t=s=>rt(s,"__esModule",{value:!0});var kt=(s,t)=>()=>(t||s((t={exports:{}}).exports,t),t.exports);var Pt=(s,t,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of xt(t))!Et.call(s,e)&&e!=="default"&&rt(s,e,{get:()=>t[e],enumerable:!(n=At(t,e))||n.enumerable});return s},St=s=>Pt(_t(rt(s!=null?Ot(jt(s)):{},"default",s&&s.__esModule&&"default"in s?{get:()=>s.default,enumerable:!0}:{value:s,enumerable:!0})),s);var ft=kt((zt,ut)=>{ut.exports=function(s){var t={};function n(e){if(t[e])return t[e].exports;var i=t[e]={i:e,l:!1,exports:{}};return s[e].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=s,n.c=t,n.d=function(e,i,d){n.o(e,i)||Object.defineProperty(e,i,{enumerable:!0,get:d})},n.r=function(e){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,i){if(1&i&&(e=n(e)),8&i||4&i&&typeof e=="object"&&e&&e.__esModule)return e;var d=Object.create(null);if(n.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:e}),2&i&&typeof e!="string")for(var u in e)n.d(d,u,function(p){return e[p]}.bind(null,u));return d},n.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(i,"a",i),i},n.o=function(e,i){return Object.prototype.hasOwnProperty.call(e,i)},n.p="",n(n.s=7)}([function(s,t,n){var e;s.exports=(e=e||function(i,d){var u=Object.create||function(){function o(){}return function(f){var w;return o.prototype=f,w=new o,o.prototype=null,w}}(),p={},v=p.lib={},y=v.Base={extend:function(o){var f=u(this);return o&&f.mixIn(o),f.hasOwnProperty("init")&&this.init!==f.init||(f.init=function(){f.$super.init.apply(this,arguments)}),f.init.prototype=f,f.$super=this,f},create:function(){var o=this.extend();return o.init.apply(o,arguments),o},init:function(){},mixIn:function(o){for(var f in o)o.hasOwnProperty(f)&&(this[f]=o[f]);o.hasOwnProperty("toString")&&(this.toString=o.toString)},clone:function(){return this.init.prototype.extend(this)}},m=v.WordArray=y.extend({init:function(o,f){o=this.words=o||[],this.sigBytes=f??4*o.length},toString:function(o){return(o||E).stringify(this)},concat:function(o){var f=this.words,w=o.words,g=this.sigBytes,x=o.sigBytes;if(this.clamp(),g%4)for(var b=0;b<x;b++){var _=w[b>>>2]>>>24-b%4*8&255;f[g+b>>>2]|=_<<24-(g+b)%4*8}else for(var b=0;b<x;b+=4)f[g+b>>>2]=w[b>>>2];return this.sigBytes+=x,this},clamp:function(){var o=this.words,f=this.sigBytes;o[f>>>2]&=4294967295<<32-f%4*8,o.length=i.ceil(f/4)},clone:function(){var o=y.clone.call(this);return o.words=this.words.slice(0),o},random:function(o){for(var f,w=[],g=function(_){var _=_,R=987654321,B=4294967295;return function(){var D=((R=36969*(65535&R)+(R>>16)&B)<<16)+(_=18e3*(65535&_)+(_>>16)&B)&B;return D/=4294967296,(D+=.5)*(i.random()>.5?1:-1)}},x=0;x<o;x+=4){var b=g(4294967296*(f||i.random()));f=987654071*b(),w.push(4294967296*b()|0)}return new m.init(w,o)}}),j=p.enc={},E=j.Hex={stringify:function(o){for(var f=o.words,w=o.sigBytes,g=[],x=0;x<w;x++){var b=f[x>>>2]>>>24-x%4*8&255;g.push((b>>>4).toString(16)),g.push((15&b).toString(16))}return g.join("")},parse:function(o){for(var f=o.length,w=[],g=0;g<f;g+=2)w[g>>>3]|=parseInt(o.substr(g,2),16)<<24-g%8*4;return new m.init(w,f/2)}},O=j.Latin1={stringify:function(o){for(var f=o.words,w=o.sigBytes,g=[],x=0;x<w;x++){var b=f[x>>>2]>>>24-x%4*8&255;g.push(String.fromCharCode(b))}return g.join("")},parse:function(o){for(var f=o.length,w=[],g=0;g<f;g++)w[g>>>2]|=(255&o.charCodeAt(g))<<24-g%4*8;return new m.init(w,f)}},S=j.Utf8={stringify:function(o){try{return decodeURIComponent(escape(O.stringify(o)))}catch(f){throw new Error("Malformed UTF-8 data")}},parse:function(o){return O.parse(unescape(encodeURIComponent(o)))}},k=v.BufferedBlockAlgorithm=y.extend({reset:function(){this._data=new m.init,this._nDataBytes=0},_append:function(o){typeof o=="string"&&(o=S.parse(o)),this._data.concat(o),this._nDataBytes+=o.sigBytes},_process:function(o){var f=this._data,w=f.words,g=f.sigBytes,x=this.blockSize,b=4*x,_=g/b,R=(_=o?i.ceil(_):i.max((0|_)-this._minBufferSize,0))*x,B=i.min(4*R,g);if(R){for(var D=0;D<R;D+=x)this._doProcessBlock(w,D);var Q=w.splice(0,R);f.sigBytes-=B}return new m.init(Q,B)},clone:function(){var o=y.clone.call(this);return o._data=this._data.clone(),o},_minBufferSize:0}),P=(v.Hasher=k.extend({cfg:y.extend(),init:function(o){this.cfg=this.cfg.extend(o),this.reset()},reset:function(){k.reset.call(this),this._doReset()},update:function(o){return this._append(o),this._process(),this},finalize:function(o){o&&this._append(o);var f=this._doFinalize();return f},blockSize:16,_createHelper:function(o){return function(f,w){return new o.init(w).finalize(f)}},_createHmacHelper:function(o){return function(f,w){return new P.HMAC.init(o,w).finalize(f)}}}),p.algo={});return p}(Math),e)},function(s,t,n){var e,i,d=n(5),u=n(6),p=0,v=0;s.exports=function(y,m,j){var E=m&&j||0,O=m||[],S=(y=y||{}).node||e,k=y.clockseq!==void 0?y.clockseq:i;if(S==null||k==null){var P=d();S==null&&(S=e=[1|P[0],P[1],P[2],P[3],P[4],P[5]]),k==null&&(k=i=16383&(P[6]<<8|P[7]))}var o=y.msecs!==void 0?y.msecs:new Date().getTime(),f=y.nsecs!==void 0?y.nsecs:v+1,w=o-p+(f-v)/1e4;if(w<0&&y.clockseq===void 0&&(k=k+1&16383),(w<0||o>p)&&y.nsecs===void 0&&(f=0),f>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");p=o,v=f,i=k;var g=(1e4*(268435455&(o+=122192928e5))+f)%4294967296;O[E++]=g>>>24&255,O[E++]=g>>>16&255,O[E++]=g>>>8&255,O[E++]=255&g;var x=o/4294967296*1e4&268435455;O[E++]=x>>>8&255,O[E++]=255&x,O[E++]=x>>>24&15|16,O[E++]=x>>>16&255,O[E++]=k>>>8|128,O[E++]=255&k;for(var b=0;b<6;++b)O[E+b]=S[b];return m||u(O)}},function(s,t,n){var e,i,d;s.exports=(e=n(0),d=(i=e).lib.WordArray,i.enc.Base64={stringify:function(u){var p=u.words,v=u.sigBytes,y=this._map;u.clamp();for(var m=[],j=0;j<v;j+=3)for(var E=(p[j>>>2]>>>24-j%4*8&255)<<16|(p[j+1>>>2]>>>24-(j+1)%4*8&255)<<8|p[j+2>>>2]>>>24-(j+2)%4*8&255,O=0;O<4&&j+.75*O<v;O++)m.push(y.charAt(E>>>6*(3-O)&63));var S=y.charAt(64);if(S)for(;m.length%4;)m.push(S);return m.join("")},parse:function(u){var p=u.length,v=this._map,y=this._reverseMap;if(!y){y=this._reverseMap=[];for(var m=0;m<v.length;m++)y[v.charCodeAt(m)]=m}var j=v.charAt(64);if(j){var E=u.indexOf(j);E!==-1&&(p=E)}return function(O,S,k){for(var P=[],o=0,f=0;f<S;f++)if(f%4){var w=k[O.charCodeAt(f-1)]<<f%4*2,g=k[O.charCodeAt(f)]>>>6-f%4*2;P[o>>>2]|=(w|g)<<24-o%4*8,o++}return d.create(P,o)}(u,p,y)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},e.enc.Base64)},function(s,t,n){var e;s.exports=(e=n(0),e.enc.Utf8)},,function(s,t){var n=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof window.msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto);if(n){var e=new Uint8Array(16);s.exports=function(){return n(e),e}}else{var i=new Array(16);s.exports=function(){for(var d,u=0;u<16;u++)(3&u)==0&&(d=4294967296*Math.random()),i[u]=d>>>((3&u)<<3)&255;return i}}},function(s,t){for(var n=[],e=0;e<256;++e)n[e]=(e+256).toString(16).substr(1);s.exports=function(i,d){var u=d||0,p=n;return[p[i[u++]],p[i[u++]],p[i[u++]],p[i[u++]],"-",p[i[u++]],p[i[u++]],"-",p[i[u++]],p[i[u++]],"-",p[i[u++]],p[i[u++]],"-",p[i[u++]],p[i[u++]],p[i[u++]],p[i[u++]],p[i[u++]],p[i[u++]]].join("")}},function(s,t,n){"use strict";n.r(t);var e=n(1),i=n.n(e),d=n(2),u=n.n(d),p=n(3),v=n.n(p);function y(r,a,c){return a in r?Object.defineProperty(r,a,{value:c,enumerable:!0,configurable:!0,writable:!0}):r[a]=c,r}var m,j="application/x-www-form-urlencoded; charset=UTF-8",E=function(){function r(a){var c=this;y(this,"spadeURI",void 0),y(this,"reportEvent",function(l,h){h===void 0&&(h={});var A=r.PrepareEvent(l);if(h.useBeacon&&"sendBeacon"in navigator){var I=new Blob([A],{type:j});navigator.sendBeacon(c.spadeURI,I)}else fetch(c.spadeURI,{body:A,headers:{"Content-Type":j},method:"POST",mode:"no-cors"})}),this.spadeURI=a}return r.PrepareEvent=function(a){var c=v.a.parse(JSON.stringify([a]));return"data="+u.a.stringify(c)},r}();function O(){if(window.screen&&window.screen.orientation&&window.screen.orientation.type)return window.screen.orientation.type.split("-")[0];if(typeof window.orientation=="number"){var r=Math.abs(window.orientation);return 45<r&&r<135?m.Landscape:m.Portrait}var a=document.documentElement&&document.documentElement.clientWidth,c=document.documentElement&&document.documentElement.clientHeight;return a&&c?a>c?m.Landscape:m.Portrait:m.Landscape}function S(r){r===void 0&&(r=window.document.referrer);try{return new URL(r).host}catch(a){return""}}function k(r){r===void 0&&(r=window.document.referrer);var a=S(r);return a?(a.match(/([^.]+\.[^.]+)$/)||[])[1]:""}function P(r,a,c){return a in r?Object.defineProperty(r,a,{value:c,enumerable:!0,configurable:!0,writable:!0}):r[a]=c,r}(function(r){r.Portrait="portrait",r.Landscape="landscape"})(m||(m={}));var o,f=function(){function r(c,l){P(this,"middleware",void 0),P(this,"serializer",void 0),this.middleware=c,this.serializer=l||function(h){return h}}var a=r.prototype;return a.getLogOutput=function(c,l){return this.serializer(this.getLogObject(c,l))},a.getLogObject=function(c,l){return this.middleware.reduce(function(h,A){return A(h)},{level:c,message:l,time:Date.now()})},r}();function w(r,a){var c=Object.keys(r);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(r);a&&(l=l.filter(function(h){return Object.getOwnPropertyDescriptor(r,h).enumerable})),c.push.apply(c,l)}return c}function g(r){for(var a=1;a<arguments.length;a++){var c=arguments[a]!=null?arguments[a]:{};a%2?w(c,!0).forEach(function(l){x(r,l,c[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(c)):w(c).forEach(function(l){Object.defineProperty(r,l,Object.getOwnPropertyDescriptor(c,l))})}return r}function x(r,a,c){return a in r?Object.defineProperty(r,a,{value:c,enumerable:!0,configurable:!0,writable:!0}):r[a]=c,r}function b(r){return r.message,function(a,c){if(a==null)return{};var l,h,A={},I=Object.keys(a);for(h=0;h<I.length;h++)l=I[h],c.indexOf(l)>=0||(A[l]=a[l]);return A}(r,["message"])}(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR"})(o||(o={}));var _=typeof console!="undefined",R=new(function(r){var a,c;function l(){for(var A,I,G,z,X=arguments.length,Y=new Array(X),M=0;M<X;M++)Y[M]=arguments[M];return A=r.call.apply(r,[this].concat(Y))||this,I=function(Z){if(Z===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Z}(A),G="debugLogMethod",z=console.debug?"debug":"log",G in I?Object.defineProperty(I,G,{value:z,enumerable:!0,configurable:!0,writable:!0}):I[G]=z,A}c=r,(a=l).prototype=Object.create(c.prototype),a.prototype.constructor=a,a.__proto__=c;var h=l.prototype;return h.debug=function(A){_&&console[this.debugLogMethod](this.getLogOutput(o.DEBUG,A))},h.log=function(A){_&&console.log(this.getLogOutput(o.DEBUG,A))},h.info=function(A){_&&console.info(this.getLogOutput(o.INFO,A))},h.warn=function(A){_&&console.warn(this.getLogOutput(o.WARNING,A))},h.error=function(A){_&&console.error(this.getLogOutput(o.ERROR,A))},l}(f))([function(r){return Array.isArray(r.message)&&r.message.every(function(a){return typeof a=="string"})?g({message:r.message.join(" ")},b(r)):r},function(r){return r.message instanceof Object&&r.message.message?g({},r.message,{},b(r)):r},function(r){return r.message instanceof Object&&r.message.event?g({},r.message,{},b(r)):r}],function(r){return typeof window!="undefined"?r:JSON.stringify(r)}),B=new(function(){function r(c){var l,h,A;A=void 0,(h="loggers")in(l=this)?Object.defineProperty(l,h,{value:A,enumerable:!0,configurable:!0,writable:!0}):l[h]=A,this.loggers=c}var a=r.prototype;return a.register=function(c){this.loggers.push(c)},a.setLoggers=function(c){this.loggers=c},a.debug=function(c){this.loggers.forEach(function(l){return l.debug(c)})},a.log=function(c){this.loggers.forEach(function(l){return l.log(c)})},a.info=function(c){this.loggers.forEach(function(l){return l.info(c)})},a.warn=function(c){this.loggers.forEach(function(l){return l.warn(c)})},a.error=function(c){this.loggers.forEach(function(l){return l.error(c)})},r}())([R]),D=function(){function r(){}return r.prototype.reportEvent=function(a){B.log(a)},r}();function Q(r,a,c){return a in r?Object.defineProperty(r,a,{value:c,enumerable:!0,configurable:!0,writable:!0}):r[a]=c,r}var ht=function(r){var a=this;Q(this,"reporters",void 0),Q(this,"reportEvent",function(c,l){a.reporters.forEach(function(h){h.reportEvent(c,l)})}),this.reporters=r};function ot(r,a){var c=Object.keys(r);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(r);a&&(l=l.filter(function(h){return Object.getOwnPropertyDescriptor(r,h).enumerable})),c.push.apply(c,l)}return c}function st(r){for(var a=1;a<arguments.length;a++){var c=arguments[a]!=null?arguments[a]:{};a%2?ot(c,!0).forEach(function(l){N(r,l,c[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(c)):ot(c).forEach(function(l){Object.defineProperty(r,l,Object.getOwnPropertyDescriptor(c,l))})}return r}function at(r,a){for(var c=0;c<a.length;c++){var l=a[c];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(r,l.key,l)}}function N(r,a,c){return a in r?Object.defineProperty(r,a,{value:c,enumerable:!0,configurable:!0,writable:!0}):r[a]=c,r}var mt=function(){function r(h){var A=this,I=h.appVersion,G=h.clientApp,z=h.debugSpade,X=h.deviceID,Y=h.language,M=h.platform,Z=h.sessionID,vt=h.spadeURI;N(this,"staticProperties",void 0),N(this,"debugSpade",void 0),N(this,"reporter",void 0),N(this,"reportEvent",function(ct,yt){var bt=st({},ct,{properties:st({},A.staticProperties,{},A.dynamicProperties,{},ct.properties||{})});A.reporter.reportEvent(bt,yt)}),this.debugSpade=z||!1,this.staticProperties={app_session_id:Z,app_version:I,browser:window.navigator.userAgent,client_app:G,device_id:X,domain:window.location.hostname,host:window.location.protocol+"//"+window.location.hostname,language:Y.toLowerCase(),platform:M,referrer:window.document.referrer||"",referrer_domain:k(),referrer_host:S()},this.reporter=new ht([new D,new E(vt)])}var a,c,l;return a=r,(c=[{key:"dynamicProperties",get:function(){return{orientation:O(),url:window.document.location?window.document.location.href:void 0,viewport_height:window.innerHeight,viewport_width:window.innerWidth}}}])&&at(a.prototype,c),l&&at(a,l),r}();n.d(t,"generateUid",function(){return wt}),n.d(t,"SpadeReporter",function(){return E}),n.d(t,"AppReporter",function(){return mt});var wt=function(){return i()()}}])});function K(s){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var e in n)s[e]=n[e]}return s}var Ct={read:function(s){return s[0]==='"'&&(s=s.slice(1,-1)),s.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(s){return encodeURIComponent(s).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function nt(s,t){function n(i,d,u){if(typeof document!="undefined"){u=K({},t,u),typeof u.expires=="number"&&(u.expires=new Date(Date.now()+u.expires*864e5)),u.expires&&(u.expires=u.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var p="";for(var v in u)!u[v]||(p+="; "+v,u[v]!==!0&&(p+="="+u[v].split(";")[0]));return document.cookie=i+"="+s.write(d,i)+p}}function e(i){if(!(typeof document=="undefined"||arguments.length&&!i)){for(var d=document.cookie?document.cookie.split("; "):[],u={},p=0;p<d.length;p++){var v=d[p].split("="),y=v.slice(1).join("=");try{var m=decodeURIComponent(v[0]);if(u[m]=s.read(y,m),i===m)break}catch(j){}}return i?u[i]:u}}return Object.create({set:n,get:e,remove:function(i,d){n(i,"",K({},d,{expires:-1}))},withAttributes:function(i){return nt(this.converter,K({},this.attributes,i))},withConverter:function(i){return nt(K({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(s)}})}var It=nt(Ct,{path:"/"}),T=It;var tt=St(ft());var lt=async()=>{try{let s=T.get("twilight-user"),t=decodeURIComponent(s);return JSON.parse(t)}catch(s){return null}},Rt=s=>s.split("&").reduce((t,n)=>{let[e,i]=n.split("=").map(d=>decodeURIComponent(d));return e?{...t,[e]:i}:t},{}),pt=async()=>{let{search:s}=window.location,t=Rt(s.slice(1)),n=Object.keys(t),e=/^(tt|utm)_(.*)$/i;return n.reduce((i,d)=>{let[u,p,v]=e.exec(d)||[];return v?{...i,[v]:t[d]}:i},{})},it=async s=>new Promise((t,n)=>{let e=document.createElement("script");e.async=!0,e.src=s,e.onload=()=>t(s),e.onerror=()=>n(s),document.head.appendChild(e)});var dt=(s,t)=>{let n=T.get(s)||(0,tt.generateUid)();return T.set(s,n,t),n},Ut=()=>dt("ttv-m7g-id",{expires:365}),Bt=()=>dt("ttv-m7g-sid"),Dt=new tt.AppReporter({language:window.navigator.language,deviceID:Ut(),sessionID:Bt(),spadeURI:"https://spade.twitch.tv/track",platform:"web"}),Lt=async()=>{let s=await lt();return s?{user_id:s.id}:{}},gt=async(s,t,n)=>{let[e,i]=await Promise.all([pt(),Lt()]),d={event:s,properties:{action:t,...e,...i,...n}};return Dt.reportEvent(d)};var U=class{static register(t){t.register(new this(t))}analytics=null;hosts=[/\.twitch\.tv$/];paths=[];get isValidHost(){let{hosts:t,hostname:n}=this;return t.length>0?t.find(i=>i.test(n))!==void 0:!0}get isValidPath(){let{paths:t,pathname:n}=this;return t.length>0?t.find(i=>i.test(n))!==void 0:!0}get hostname(){let{location:t}=window,{hostname:n}=t;return n}get pathname(){let{location:t}=window,{pathname:n}=t;return n}get isActive(){let{isValidPath:t,isValidHost:n}=this;return t&&n}constructor(t){this.analytics=t}init(){}trackEvent(t,n,e){gt(t,n,e)}};window.Element&&!Element.prototype.closest&&(Element.prototype.closest=function(s){var t=(this.document||this.ownerDocument).querySelectorAll(s),n,e=this;do for(n=t.length;--n>=0&&t.item(n)!==e;);while(n<0&&(e=e.parentElement));return e});var Gt=s=>{document.addEventListener("click",async t=>{let{watchers:n}=s,{target:e,metaKey:i}=t,{href:d,tagName:u}=e,p=[];for(let v=0,y=n.length;v<y;v++){let[m,j]=n[v],E=e.closest(m);if(typeof j!="function"&&(j=()=>null),E)try{let{tagName:O}=E;(O==="A"||u==="A")&&(d=d||E.href,(!i||e.target)&&t.preventDefault()),p.push(j(E))}catch(O){console.error({error:O})}}d&&t.defaultPrevented&&Promise.all(p).then(()=>window.location=d)},!0)},et=class{watchers=[];site=null;constructor(){Gt(this)}get version(){return"930b30f8e71a576e49eb5c377da07d3add3dc771"}mount(t,n){let{version:e}=this,i=u=>this.push(u),d=t[n];return t[n]={push:i,version:e},d instanceof Array&&d.forEach(i),(...u)=>i(u)}waitForLoad(t){document.readyState!=="loading"?t():document.addEventListener("DOMContentLoaded",t)}register(t){if(t instanceof U){let{site:n}=this;!n&&t.isActive&&(this.site=t,this.init())}}watch(t,n){this.watchers.push([t,n])}trackClick(t,n,e,i){this.site&&this.watch(t,d=>{let u={};typeof i=="function"&&(u={...i(d)}),this.site.trackEvent(n,e,u)})}push(t){if(this.site&&t instanceof Array){let[n,...e]=t;switch(n){case"pageView":case"page_view":this.site.trackEvent(...e);break;case"trackClick":case"track_click":this.trackClick(...e);break;default:console.warn("invalid action",{action:n,params:e});break}}}init(){let{site:t}=this;t&&t.init()}};var C=class extends U{gId=null;version="3";debug=!1;async init(){let{gId:t,version:n}=this;if(t)switch(n){case"4":return this.initGoogleAnalytics4(t);default:return this.initGoogleAnalytics3(t)}}async initGoogleAnalytics3(t){window.GoogleAnalyticsObject="ga",window.ga=window.ga||function(){(window.ga.q=window.ga.q||[]).push(arguments)},window.ga.l=1*new Date().valueOf(),it("https://www.google-analytics.com/analytics.js"),this.send("create",t,"auto")}initGoogleAnalytics4(t){window.dataLayer=window.dataLayer||[],window.gtag=window.gtag||function(){window.dataLayer.push(arguments)},it(`https://www.googletagmanager.com/gtag/js?id=${t}`),this.send("js",new Date),this.send("config",t,{send_page_view:!0})}send(...t){let{gId:n,version:e,debug:i}=this;switch(i&&console.log(`[${n}] GA`,e,...t),e){case"4":return window.gtag(...t);case"3":return window.ga(...t)}}};var V=class extends C{gId="G-YBFZLQVW9C";version="4";paths=[/^\/p\/((.{2}(-.{2})?)\/)?artists\/?/]};var F=class extends C{gId="UA-117261801-7";version="3";hosts=[/rivals-marketing-bucket-i1h3o2vxw6iv/,/twitchrivals\.com$/,/rivals-marketing-bucket-rtuehvgk6alr/,/^mirthful-tank/];async init(){super.init(),this.send("require","displayfeatures"),this.send("require","linkid"),this.send("set","anonymizeIp",!0),this.send("set","forceSSL",!0),this.send("send","pageview")}};var W=class extends C{gId="UA-117261801-1";version="3";paths=[/^\/p\/((.{2}(-.{2})?)\/)?(about|stream|watch|company)\/?/]};var q=class extends C{gId="UA-117261801-1";version="4";paths=[/^\/p\/((.{2}(-.{2})?)\/)?(giftcard)\/?/,/^\/((.{2}(-.{2})?)\/)?(giftcard)\/?/];init(){super.init(...arguments),this.send("config","AW-704866395"),this.analytics.watch('.giftcards--landing [href="https://www.twitch.tv/giftcard/buy?ref_=gc_twitch_landing"]',()=>{this.send("event","conversion",{send_to:"AW-704866395/XC7ACJGcuoIDENvQjdAC"})})}};var $=class extends C{gId="G-V1D2K8C98G";version="4";paths=[/^\/jobs\/?/]};var H=class extends U{paths=[/^\/p\/stream\/sports-accelerator\/?/];getElementEventAttributes(t){return t.getAttributeNames().reduce((n,e)=>{var i=/^tw-(.*)$/.exec(e);if(i){var d=i[1],u=t.getAttribute(e);u==="Learn More \u2193"&&(u="Learn More"),n[d]=u}return n},{})}init(){super.init(...arguments),this.trackEvent("sports_page","pageview"),this.analytics.watch('[tw-event="click"]',t=>{let{event:n,...e}=this.getElementEventAttributes(t);this.trackEvent("sports_page",n,e)})}};var J=class extends U{hosts=[/^www\.twitchcon\.com$/,/^twitchcon\.com$/,/twitchcon-bucket-ly2pnnotca5g/];getElementEventAttributes(t){return t.getAttributeNames().reduce((n,e)=>{var i=/^tw-(.*)$/.exec(e);if(i){var d=i[1],u=t.getAttribute(e);n[d]=u}return n},{})}init(){super.init(...arguments),this.trackEvent("twitchcon","pageview"),this.analytics.watch('[tw-event="click"]',t=>{let{event:n,...e}=this.getElementEventAttributes(t);this.trackEvent("twitchcon",n,e)})}};var L=new et;window.tw=L.mount(window,"_tw");J.register(L);H.register(L);$.register(L);V.register(L);q.register(L);W.register(L);F.register(L);})();
/*! js-cookie v3.0.1 | MIT */
//# sourceMappingURL=tw.js.map
