obi-sdk 0.18.24 → 0.18.26

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/dist/index.js CHANGED
@@ -1,62 +1,128 @@
1
- (function(){"use strict";function hf(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var uo={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,A="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(A=!1));function i(o,c,l){this.fn=o,this.context=c,this.once=l||!1}function r(o,c,l,u,d){if(typeof l!="function")throw new TypeError("The listener must be a function");var h=new i(l,u||o,d),g=A?A+c:c;return o._events[g]?o._events[g].fn?o._events[g]=[o._events[g],h]:o._events[g].push(h):(o._events[g]=h,o._eventsCount++),o}function s(o,c){--o._eventsCount===0?o._events=new n:delete o._events[c]}function a(){this._events=new n,this._eventsCount=0}a.prototype.eventNames=function(){var c=[],l,u;if(this._eventsCount===0)return c;for(u in l=this._events)e.call(l,u)&&c.push(A?u.slice(1):u);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(l)):c},a.prototype.listeners=function(c){var l=A?A+c:c,u=this._events[l];if(!u)return[];if(u.fn)return[u.fn];for(var d=0,h=u.length,g=new Array(h);d<h;d++)g[d]=u[d].fn;return g},a.prototype.listenerCount=function(c){var l=A?A+c:c,u=this._events[l];return u?u.fn?1:u.length:0},a.prototype.emit=function(c,l,u,d,h,g){var f=A?A+c:c;if(!this._events[f])return!1;var m=this._events[f],B=arguments.length,b,U;if(m.fn){switch(m.once&&this.removeListener(c,m.fn,void 0,!0),B){case 1:return m.fn.call(m.context),!0;case 2:return m.fn.call(m.context,l),!0;case 3:return m.fn.call(m.context,l,u),!0;case 4:return m.fn.call(m.context,l,u,d),!0;case 5:return m.fn.call(m.context,l,u,d,h),!0;case 6:return m.fn.call(m.context,l,u,d,h,g),!0}for(U=1,b=new Array(B-1);U<B;U++)b[U-1]=arguments[U];m.fn.apply(m.context,b)}else{var C=m.length,w;for(U=0;U<C;U++)switch(m[U].once&&this.removeListener(c,m[U].fn,void 0,!0),B){case 1:m[U].fn.call(m[U].context);break;case 2:m[U].fn.call(m[U].context,l);break;case 3:m[U].fn.call(m[U].context,l,u);break;case 4:m[U].fn.call(m[U].context,l,u,d);break;default:if(!b)for(w=1,b=new Array(B-1);w<B;w++)b[w-1]=arguments[w];m[U].fn.apply(m[U].context,b)}}return!0},a.prototype.on=function(c,l,u){return r(this,c,l,u,!1)},a.prototype.once=function(c,l,u){return r(this,c,l,u,!0)},a.prototype.removeListener=function(c,l,u,d){var h=A?A+c:c;if(!this._events[h])return this;if(!l)return s(this,h),this;var g=this._events[h];if(g.fn)g.fn===l&&(!d||g.once)&&(!u||g.context===u)&&s(this,h);else{for(var f=0,m=[],B=g.length;f<B;f++)(g[f].fn!==l||d&&!g[f].once||u&&g[f].context!==u)&&m.push(g[f]);m.length?this._events[h]=m.length===1?m[0]:m:s(this,h)}return this},a.prototype.removeAllListeners=function(c){var l;return c?(l=A?A+c:c,this._events[l]&&s(this,l)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=A,a.EventEmitter=a,t.exports=a})(uo);var ff=uo.exports;const kr=hf(ff);/*!
1
+ (function(){"use strict";function GC(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Qp={exports:{}};(function(n){var e=Object.prototype.hasOwnProperty,t="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(t=!1));function i(a,c,u){this.fn=a,this.context=c,this.once=u||!1}function A(a,c,u,l,d){if(typeof u!="function")throw new TypeError("The listener must be a function");var h=new i(u,l||a,d),f=t?t+c:c;return a._events[f]?a._events[f].fn?a._events[f]=[a._events[f],h]:a._events[f].push(h):(a._events[f]=h,a._eventsCount++),a}function s(a,c){--a._eventsCount===0?a._events=new r:delete a._events[c]}function o(){this._events=new r,this._eventsCount=0}o.prototype.eventNames=function(){var c=[],u,l;if(this._eventsCount===0)return c;for(l in u=this._events)e.call(u,l)&&c.push(t?l.slice(1):l);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(u)):c},o.prototype.listeners=function(c){var u=t?t+c:c,l=this._events[u];if(!l)return[];if(l.fn)return[l.fn];for(var d=0,h=l.length,f=new Array(h);d<h;d++)f[d]=l[d].fn;return f},o.prototype.listenerCount=function(c){var u=t?t+c:c,l=this._events[u];return l?l.fn?1:l.length:0},o.prototype.emit=function(c,u,l,d,h,f){var p=t?t+c:c;if(!this._events[p])return!1;var g=this._events[p],v=arguments.length,y,b;if(g.fn){switch(g.once&&this.removeListener(c,g.fn,void 0,!0),v){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,u),!0;case 3:return g.fn.call(g.context,u,l),!0;case 4:return g.fn.call(g.context,u,l,d),!0;case 5:return g.fn.call(g.context,u,l,d,h),!0;case 6:return g.fn.call(g.context,u,l,d,h,f),!0}for(b=1,y=new Array(v-1);b<v;b++)y[b-1]=arguments[b];g.fn.apply(g.context,y)}else{var B=g.length,w;for(b=0;b<B;b++)switch(g[b].once&&this.removeListener(c,g[b].fn,void 0,!0),v){case 1:g[b].fn.call(g[b].context);break;case 2:g[b].fn.call(g[b].context,u);break;case 3:g[b].fn.call(g[b].context,u,l);break;case 4:g[b].fn.call(g[b].context,u,l,d);break;default:if(!y)for(w=1,y=new Array(v-1);w<v;w++)y[w-1]=arguments[w];g[b].fn.apply(g[b].context,y)}}return!0},o.prototype.on=function(c,u,l){return A(this,c,u,l,!1)},o.prototype.once=function(c,u,l){return A(this,c,u,l,!0)},o.prototype.removeListener=function(c,u,l,d){var h=t?t+c:c;if(!this._events[h])return this;if(!u)return s(this,h),this;var f=this._events[h];if(f.fn)f.fn===u&&(!d||f.once)&&(!l||f.context===l)&&s(this,h);else{for(var p=0,g=[],v=f.length;p<v;p++)(f[p].fn!==u||d&&!f[p].once||l&&f[p].context!==l)&&g.push(f[p]);g.length?this._events[h]=g.length===1?g[0]:g:s(this,h)}return this},o.prototype.removeAllListeners=function(c){var u;return c?(u=t?t+c:c,this._events[u]&&s(this,u)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=t,o.EventEmitter=o,n.exports=o})(Qp);var jC=Qp.exports;const Hc=GC(jC);/*!
2
2
  * html2canvas-pro 1.5.11 <https://yorickshan.github.io/html2canvas-pro/>
3
3
  * Copyright (c) 2024-present yorickshan and html2canvas-pro contributors
4
4
  * Released under MIT License
5
- */var Tr=function(t,e){return Tr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,n){A.__proto__=n}||function(A,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(A[i]=n[i])},Tr(t,e)};function iA(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Tr(t,e);function A(){this.constructor=t}t.prototype=e===null?Object.create(e):(A.prototype=e.prototype,new A)}var Fr=function(){return Fr=Object.assign||function(e){for(var A,n=1,i=arguments.length;n<i;n++){A=arguments[n];for(var r in A)Object.prototype.hasOwnProperty.call(A,r)&&(e[r]=A[r])}return e},Fr.apply(this,arguments)};function Re(t,e,A,n){function i(r){return r instanceof A?r:new A(function(s){s(r)})}return new(A||(A=Promise))(function(r,s){function a(l){try{c(n.next(l))}catch(u){s(u)}}function o(l){try{c(n.throw(l))}catch(u){s(u)}}function c(l){l.done?r(l.value):i(l.value).then(a,o)}c((n=n.apply(t,e||[])).next())})}function xe(t,e){var A={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,i,r,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(l){return o([c,l])}}function o(c){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(A=0)),A;)try{if(n=1,i&&(r=c[0]&2?i.return:c[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,c[1])).done)return r;switch(i=0,r&&(c=[c[0]&2,r.value]),c[0]){case 0:case 1:r=c;break;case 4:return A.label++,{value:c[1],done:!1};case 5:A.label++,i=c[1],c=[0];continue;case 7:c=A.ops.pop(),A.trys.pop();continue;default:if(r=A.trys,!(r=r.length>0&&r[r.length-1])&&(c[0]===6||c[0]===2)){A=0;continue}if(c[0]===3&&(!r||c[1]>r[0]&&c[1]<r[3])){A.label=c[1];break}if(c[0]===6&&A.label<r[1]){A.label=r[1],r=c;break}if(r&&A.label<r[2]){A.label=r[2],A.ops.push(c);break}r[2]&&A.ops.pop(),A.trys.pop();continue}c=e.call(t,A)}catch(l){c=[6,l],i=0}finally{n=r=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Dn(t,e,A){if(A||arguments.length===2)for(var n=0,i=e.length,r;n<i;n++)(r||!(n in e))&&(r||(r=Array.prototype.slice.call(e,0,n)),r[n]=e[n]);return t.concat(r||Array.prototype.slice.call(e))}typeof SuppressedError=="function"&&SuppressedError;for(var EA=function(){function t(e,A,n,i){this.left=e,this.top=A,this.width=n,this.height=i}return t.prototype.add=function(e,A,n,i){return new t(this.left+e,this.top+A,this.width+n,this.height+i)},t.fromClientRect=function(e,A){return new t(A.left+e.windowBounds.left,A.top+e.windowBounds.top,A.width,A.height)},t.fromDOMRectList=function(e,A){var n=Array.from(A).find(function(i){return i.width!==0});return n?new t(n.left+e.windowBounds.left,n.top+e.windowBounds.top,n.width,n.height):t.EMPTY},t.EMPTY=new t(0,0,0,0),t}(),Hn=function(t,e){return EA.fromClientRect(t,e.getBoundingClientRect())},gf=function(t){var e=t.body,A=t.documentElement;if(!e||!A)throw new Error("Unable to get document size");var n=Math.max(Math.max(e.scrollWidth,A.scrollWidth),Math.max(e.offsetWidth,A.offsetWidth),Math.max(e.clientWidth,A.clientWidth)),i=Math.max(Math.max(e.scrollHeight,A.scrollHeight),Math.max(e.offsetHeight,A.offsetHeight),Math.max(e.clientHeight,A.clientHeight));return new EA(0,0,n,i)},On=function(t){for(var e=[],A=0,n=t.length;A<n;){var i=t.charCodeAt(A++);if(i>=55296&&i<=56319&&A<n){var r=t.charCodeAt(A++);(r&64512)===56320?e.push(((i&1023)<<10)+(r&1023)+65536):(e.push(i),A--)}else e.push(i)}return e},he=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,t);var A=t.length;if(!A)return"";for(var n=[],i=-1,r="";++i<A;){var s=t[i];s<=65535?n.push(s):(s-=65536,n.push((s>>10)+55296,s%1024+56320)),(i+1===A||n.length>16384)&&(r+=String.fromCharCode.apply(String,n),n.length=0)}return r},ho="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pf=typeof Uint8Array>"u"?[]:new Uint8Array(256),Mn=0;Mn<ho.length;Mn++)pf[ho.charCodeAt(Mn)]=Mn;for(var fo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$t=typeof Uint8Array>"u"?[]:new Uint8Array(256),Nn=0;Nn<fo.length;Nn++)$t[fo.charCodeAt(Nn)]=Nn;for(var mf=function(t){var e=t.length*.75,A=t.length,n,i=0,r,s,a,o;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);var c=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(e):new Array(e),l=Array.isArray(c)?c:new Uint8Array(c);for(n=0;n<A;n+=4)r=$t[t.charCodeAt(n)],s=$t[t.charCodeAt(n+1)],a=$t[t.charCodeAt(n+2)],o=$t[t.charCodeAt(n+3)],l[i++]=r<<2|s>>4,l[i++]=(s&15)<<4|a>>2,l[i++]=(a&3)<<6|o&63;return c},Bf=function(t){for(var e=t.length,A=[],n=0;n<e;n+=2)A.push(t[n+1]<<8|t[n]);return A},vf=function(t){for(var e=t.length,A=[],n=0;n<e;n+=4)A.push(t[n+3]<<24|t[n+2]<<16|t[n+1]<<8|t[n]);return A},rt=5,Ir=6+5,xr=2,Cf=Ir-rt,go=65536>>rt,wf=1<<rt,_r=wf-1,bf=1024>>rt,yf=go+bf,Uf=yf,Qf=32,Ef=Uf+Qf,Sf=65536>>Ir,kf=1<<Cf,Tf=kf-1,po=function(t,e,A){return t.slice?t.slice(e,A):new Uint16Array(Array.prototype.slice.call(t,e,A))},Ff=function(t,e,A){return t.slice?t.slice(e,A):new Uint32Array(Array.prototype.slice.call(t,e,A))},If=function(t,e){var A=mf(t),n=Array.isArray(A)?vf(A):new Uint32Array(A),i=Array.isArray(A)?Bf(A):new Uint16Array(A),r=24,s=po(i,r/2,n[4]/2),a=n[5]===2?po(i,(r+n[4])/2):Ff(n,Math.ceil((r+n[4])/4));return new xf(n[0],n[1],n[2],n[3],s,a)},xf=function(){function t(e,A,n,i,r,s){this.initialValue=e,this.errorValue=A,this.highStart=n,this.highValueIndex=i,this.index=r,this.data=s}return t.prototype.get=function(e){var A;if(e>=0){if(e<55296||e>56319&&e<=65535)return A=this.index[e>>rt],A=(A<<xr)+(e&_r),this.data[A];if(e<=65535)return A=this.index[go+(e-55296>>rt)],A=(A<<xr)+(e&_r),this.data[A];if(e<this.highStart)return A=Ef-Sf+(e>>Ir),A=this.index[A],A+=e>>rt&Tf,A=this.index[A],A=(A<<xr)+(e&_r),this.data[A];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},t}(),mo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_f=typeof Uint8Array>"u"?[]:new Uint8Array(256),Kn=0;Kn<mo.length;Kn++)_f[mo.charCodeAt(Kn)]=Kn;var Pf="KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADGAM4A0wDbAOEA6QDxAPkAAQEJAQ8BFwF1AH0AHAEkASwBNAE6AUIBQQFJAVEBWQFhAWgBcAF4ATAAgAGGAY4BlQGXAZ8BpwGvAbUBvQHFAc0B0wHbAeMB6wHxAfkBAQIJAvEBEQIZAiECKQIxAjgCQAJGAk4CVgJeAmQCbAJ0AnwCgQKJApECmQKgAqgCsAK4ArwCxAIwAMwC0wLbAjAA4wLrAvMC+AIAAwcDDwMwABcDHQMlAy0DNQN1AD0DQQNJA0kDSQNRA1EDVwNZA1kDdQB1AGEDdQBpA20DdQN1AHsDdQCBA4kDkQN1AHUAmQOhA3UAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AKYDrgN1AHUAtgO+A8YDzgPWAxcD3gPjA+sD8wN1AHUA+wMDBAkEdQANBBUEHQQlBCoEFwMyBDgEYABABBcDSARQBFgEYARoBDAAcAQzAXgEgASIBJAEdQCXBHUAnwSnBK4EtgS6BMIEyAR1AHUAdQB1AHUAdQCVANAEYABgAGAAYABgAGAAYABgANgEYADcBOQEYADsBPQE/AQEBQwFFAUcBSQFLAU0BWQEPAVEBUsFUwVbBWAAYgVgAGoFcgV6BYIFigWRBWAAmQWfBaYFYABgAGAAYABgAKoFYACxBbAFuQW6BcEFwQXHBcEFwQXPBdMF2wXjBeoF8gX6BQIGCgYSBhoGIgYqBjIGOgZgAD4GRgZMBmAAUwZaBmAAYABgAGAAYABgAGAAYABgAGAAYABgAGIGYABpBnAGYABgAGAAYABgAGAAYABgAGAAYAB4Bn8GhQZgAGAAYAB1AHcDFQSLBmAAYABgAJMGdQA9A3UAmwajBqsGqwaVALMGuwbDBjAAywbSBtIG1QbSBtIG0gbSBtIG0gbdBuMG6wbzBvsGAwcLBxMHAwcbByMHJwcsBywHMQcsB9IGOAdAB0gHTgfSBkgHVgfSBtIG0gbSBtIG0gbSBtIG0gbSBiwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdbB2MHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB2kH0gZwB64EdQB1AHUAdQB1AHUAdQB1AHUHfQdgAIUHjQd1AHUAlQedB2AAYAClB6sHYACzB7YHvgfGB3UAzgfWBzMB3gfmB1EB7gf1B/0HlQENAQUIDQh1ABUIHQglCBcDLQg1CD0IRQhNCEEDUwh1AHUAdQBbCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIcAh3CHoIMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIgggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4JdQCECYoJjgmWCXUAngkwAGAAYABxAHUApgn3A64JtAl1ALkJdQDACTAAMAAwADAAdQB1AHUAdQB1AHUAdQB1AHUAowYNBMUIMAAwADAAMADICcsJ0wnZCRUE4QkwAOkJ8An4CTAAMAB1AAAKvwh1AAgKDwoXCh8KdQAwACcKLgp1ADYKqAmICT4KRgowADAAdQB1AE4KMAB1AFYKdQBeCnUAZQowADAAMAAwADAAMAAwADAAMAAVBHUAbQowADAAdQC5CXUKMAAwAHwBxAijBogEMgF9CoQKiASMCpQKmgqIBKIKqgquCogEDQG2Cr4KxgrLCjAAMADTCtsKCgHjCusK8Qr5CgELMAAwADAAMAB1AIsECQsRC3UANAEZCzAAMAAwADAAMAB1ACELKQswAHUANAExCzkLdQBBC0kLMABRC1kLMAAwADAAMAAwADAAdQBhCzAAMAAwAGAAYABpC3ELdwt/CzAAMACHC4sLkwubC58Lpwt1AK4Ltgt1APsDMAAwADAAMAAwADAAMAAwAL4LwwvLC9IL1wvdCzAAMADlC+kL8Qv5C/8LSQswADAAMAAwADAAMAAwADAAMAAHDDAAMAAwADAAMAAODBYMHgx1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1ACYMMAAwADAAdQB1AHUALgx1AHUAdQB1AHUAdQA2DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AD4MdQBGDHUAdQB1AHUAdQB1AEkMdQB1AHUAdQB1AFAMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQBYDHUAdQB1AF8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUA+wMVBGcMMAAwAHwBbwx1AHcMfwyHDI8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAYABgAJcMMAAwADAAdQB1AJ8MlQClDDAAMACtDCwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB7UMLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AA0EMAC9DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsBywHLAcsBywHLAcsBywHLQcwAMEMyAwsBywHLAcsBywHLAcsBywHLAcsBywHzAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1ANQM2QzhDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABgAGAAYABgAGAAYABgAOkMYADxDGAA+AwADQYNYABhCWAAYAAODTAAMAAwADAAFg1gAGAAHg37AzAAMAAwADAAYABgACYNYAAsDTQNPA1gAEMNPg1LDWAAYABgAGAAYABgAGAAYABgAGAAUg1aDYsGVglhDV0NcQBnDW0NdQ15DWAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAlQCBDZUAiA2PDZcNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAnw2nDTAAMAAwADAAMAAwAHUArw23DTAAMAAwADAAMAAwADAAMAAwADAAMAB1AL8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQDHDTAAYABgAM8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA1w11ANwNMAAwAD0B5A0wADAAMAAwADAAMADsDfQN/A0EDgwOFA4wABsOMAAwADAAMAAwADAAMAAwANIG0gbSBtIG0gbSBtIG0gYjDigOwQUuDsEFMw7SBjoO0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGQg5KDlIOVg7SBtIGXg5lDm0OdQ7SBtIGfQ6EDooOjQ6UDtIGmg6hDtIG0gaoDqwO0ga0DrwO0gZgAGAAYADEDmAAYAAkBtIGzA5gANIOYADaDokO0gbSBt8O5w7SBu8O0gb1DvwO0gZgAGAAxA7SBtIG0gbSBtIGYABgAGAAYAAED2AAsAUMD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHJA8sBywHLAcsBywHLAccDywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywPLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAc0D9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHPA/SBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gYUD0QPlQCVAJUAMAAwADAAMACVAJUAlQCVAJUAlQCVAEwPMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA//8EAAQABAAEAAQABAAEAAQABAANAAMAAQABAAIABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACgATABcAHgAbABoAHgAXABYAEgAeABsAGAAPABgAHABLAEsASwBLAEsASwBLAEsASwBLABgAGAAeAB4AHgATAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAGwASAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWAA0AEQAeAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAFAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJABYAGgAbABsAGwAeAB0AHQAeAE8AFwAeAA0AHgAeABoAGwBPAE8ADgBQAB0AHQAdAE8ATwAXAE8ATwBPABYAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQACsAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQACsAKwAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQACsAHgAeAB4AHgAeAB4AHgAOAB4AKwANAA0ADQANAA0ADQANAAkADQANAA0ACAAEAAsABAAEAA0ACQANAA0ADAAdAB0AHgAXABcAFgAXABcAFwAWABcAHQAdAB4AHgAUABQAFAANAAEAAQAEAAQABAAEAAQACQAaABoAGgAaABoAGgAaABoAHgAXABcAHQAVABUAHgAeAB4AHgAeAB4AGAAWABEAFQAVABUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ADQAeAA0ADQANAA0AHgANAA0ADQAHAB4AHgAeAB4AKwAEAAQABAAEAAQABAAEAAQABAAEAFAAUAArACsATwBQAFAAUABQAFAAHgAeAB4AFgARAE8AUABPAE8ATwBPAFAAUABQAFAAUAAeAB4AHgAWABEAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArABsAGwAbABsAGwAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGgAbABsAGwAbABoAGwAbABoAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAFAAGgAeAB0AHgBQAB4AGgAeAB4AHgAeAB4AHgAeAB4AHgBPAB4AUAAbAB4AHgBQAFAAUABQAFAAHgAeAB4AHQAdAB4AUAAeAFAAHgBQAB4AUABPAFAAUAAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgBQAFAAUABQAE8ATwBQAFAAUABQAFAATwBQAFAATwBQAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAUABQAFAATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABPAB4AHgArACsAKwArAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAdAB4AHgAeAB0AHQAeAB4AHQAeAB4AHgAdAB4AHQAbABsAHgAdAB4AHgAeAB4AHQAeAB4AHQAdAB0AHQAeAB4AHQAeAB0AHgAdAB0AHQAdAB0AHQAeAB0AHgAeAB4AHgAeAB0AHQAdAB0AHgAeAB4AHgAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB0AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAdAB0AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHQAdAB0AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHQAdAB4AHgAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AJQAlAB0AHQAlAB4AJQAlACUAIAAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAeAB0AJQAdAB0AHgAdAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAdAB0AHQAdACUAHgAlACUAJQAdACUAJQAdAB0AHQAlACUAHQAdACUAHQAdACUAJQAlAB4AHQAeAB4AHgAeAB0AHQAlAB0AHQAdAB0AHQAdACUAJQAlACUAJQAdACUAJQAgACUAHQAdACUAJQAlACUAJQAlACUAJQAeAB4AHgAlACUAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AFwAXABcAFwAXABcAHgATABMAJQAeAB4AHgAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARABYAEQAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwAlACUAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACsAKwArACsAKwArACsAKwArACsAKwArAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBPAE8ATwBPAE8ATwBPAE8AJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAKwArAFAAKwArAFAAUAArACsAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAHgAeAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACAAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABcAFwAXABUAFQAVAB4AHgAeAB4AJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAgACUAJQAgACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA==",Bo=50,Rf=1,vo=2,Co=3,Lf=4,Df=5,wo=7,bo=8,yo=9,LA=10,Pr=11,Uo=12,Rr=13,Hf=14,en=15,Lr=16,Vn=17,An=18,Of=19,Qo=20,Dr=21,tn=22,Hr=23,yt=24,Xe=25,nn=26,rn=27,Ut=28,Mf=29,st=30,Nf=31,Gn=32,jn=33,Or=34,Mr=35,Nr=36,sn=37,Kr=38,Wn=39,Jn=40,Vr=41,Eo=42,Kf=43,Vf=[9001,65288],So="!",G="×",Xn="÷",Gr=If(Pf),SA=[st,Nr],jr=[Rf,vo,Co,Df],ko=[LA,bo],To=[rn,nn],Gf=jr.concat(ko),Fo=[Kr,Wn,Jn,Or,Mr],jf=[en,Rr],Wf=function(t,e){e===void 0&&(e="strict");var A=[],n=[],i=[];return t.forEach(function(r,s){var a=Gr.get(r);if(a>Bo?(i.push(!0),a-=Bo):i.push(!1),["normal","auto","loose"].indexOf(e)!==-1&&[8208,8211,12316,12448].indexOf(r)!==-1)return n.push(s),A.push(Lr);if(a===Lf||a===Pr){if(s===0)return n.push(s),A.push(st);var o=A[s-1];return Gf.indexOf(o)===-1?(n.push(n[s-1]),A.push(o)):(n.push(s),A.push(st))}if(n.push(s),a===Nf)return A.push(e==="strict"?Dr:sn);if(a===Eo||a===Mf)return A.push(st);if(a===Kf)return r>=131072&&r<=196605||r>=196608&&r<=262141?A.push(sn):A.push(st);A.push(a)}),[n,A,i]},Wr=function(t,e,A,n){var i=n[A];if(Array.isArray(t)?t.indexOf(i)!==-1:t===i)for(var r=A;r<=n.length;){r++;var s=n[r];if(s===e)return!0;if(s!==LA)break}if(i===LA)for(var r=A;r>0;){r--;var a=n[r];if(Array.isArray(t)?t.indexOf(a)!==-1:t===a)for(var o=A;o<=n.length;){o++;var s=n[o];if(s===e)return!0;if(s!==LA)break}if(a!==LA)break}return!1},Io=function(t,e){for(var A=t;A>=0;){var n=e[A];if(n===LA)A--;else return n}return 0},Jf=function(t,e,A,n,i){if(A[n]===0)return G;var r=n-1;if(Array.isArray(i)&&i[r]===!0)return G;var s=r-1,a=r+1,o=e[r],c=s>=0?e[s]:0,l=e[a];if(o===vo&&l===Co)return G;if(jr.indexOf(o)!==-1)return So;if(jr.indexOf(l)!==-1||ko.indexOf(l)!==-1)return G;if(Io(r,e)===bo)return Xn;if(Gr.get(t[r])===Pr||(o===Gn||o===jn)&&Gr.get(t[a])===Pr||o===wo||l===wo||o===yo||[LA,Rr,en].indexOf(o)===-1&&l===yo||[Vn,An,Of,yt,Ut].indexOf(l)!==-1||Io(r,e)===tn||Wr(Hr,tn,r,e)||Wr([Vn,An],Dr,r,e)||Wr(Uo,Uo,r,e))return G;if(o===LA)return Xn;if(o===Hr||l===Hr)return G;if(l===Lr||o===Lr)return Xn;if([Rr,en,Dr].indexOf(l)!==-1||o===Hf||c===Nr&&jf.indexOf(o)!==-1||o===Ut&&l===Nr||l===Qo||SA.indexOf(l)!==-1&&o===Xe||SA.indexOf(o)!==-1&&l===Xe||o===rn&&[sn,Gn,jn].indexOf(l)!==-1||[sn,Gn,jn].indexOf(o)!==-1&&l===nn||SA.indexOf(o)!==-1&&To.indexOf(l)!==-1||To.indexOf(o)!==-1&&SA.indexOf(l)!==-1||[rn,nn].indexOf(o)!==-1&&(l===Xe||[tn,en].indexOf(l)!==-1&&e[a+1]===Xe)||[tn,en].indexOf(o)!==-1&&l===Xe||o===Xe&&[Xe,Ut,yt].indexOf(l)!==-1)return G;if([Xe,Ut,yt,Vn,An].indexOf(l)!==-1)for(var u=r;u>=0;){var d=e[u];if(d===Xe)return G;if([Ut,yt].indexOf(d)!==-1)u--;else break}if([rn,nn].indexOf(l)!==-1)for(var u=[Vn,An].indexOf(o)!==-1?s:r;u>=0;){var d=e[u];if(d===Xe)return G;if([Ut,yt].indexOf(d)!==-1)u--;else break}if(Kr===o&&[Kr,Wn,Or,Mr].indexOf(l)!==-1||[Wn,Or].indexOf(o)!==-1&&[Wn,Jn].indexOf(l)!==-1||[Jn,Mr].indexOf(o)!==-1&&l===Jn||Fo.indexOf(o)!==-1&&[Qo,nn].indexOf(l)!==-1||Fo.indexOf(l)!==-1&&o===rn||SA.indexOf(o)!==-1&&SA.indexOf(l)!==-1||o===yt&&SA.indexOf(l)!==-1||SA.concat(Xe).indexOf(o)!==-1&&l===tn&&Vf.indexOf(t[a])===-1||SA.concat(Xe).indexOf(l)!==-1&&o===An)return G;if(o===Vr&&l===Vr){for(var h=A[r],g=1;h>0&&(h--,e[h]===Vr);)g++;if(g%2!==0)return G}return o===Gn&&l===jn?G:Xn},Xf=function(t,e){e||(e={lineBreak:"normal",wordBreak:"normal"});var A=Wf(t,e.lineBreak),n=A[0],i=A[1],r=A[2];(e.wordBreak==="break-all"||e.wordBreak==="break-word")&&(i=i.map(function(a){return[Xe,st,Eo].indexOf(a)!==-1?sn:a}));var s=e.wordBreak==="keep-all"?r.map(function(a,o){return a&&t[o]>=19968&&t[o]<=40959}):void 0;return[n,i,s]},qf=function(){function t(e,A,n,i){this.codePoints=e,this.required=A===So,this.start=n,this.end=i}return t.prototype.slice=function(){return he.apply(void 0,this.codePoints.slice(this.start,this.end))},t}(),Yf=function(t,e){var A=On(t),n=Xf(A,e),i=n[0],r=n[1],s=n[2],a=A.length,o=0,c=0;return{next:function(){if(c>=a)return{done:!0,value:null};for(var l=G;c<a&&(l=Jf(A,r,i,++c,s))===G;);if(l!==G||c===a){var u=new qf(A,l,o,c);return o=c,{value:u,done:!1}}return{done:!0,value:null}}}},zf=1,Zf=2,an=4,xo=8,qn=10,_o=47,on=92,$f=9,eg=32,Yn=34,cn=61,Ag=35,tg=36,ng=37,zn=39,Zn=40,ln=41,ig=95,De=45,rg=33,sg=60,ag=62,og=64,cg=91,lg=93,ug=61,dg=123,$n=63,hg=125,Po=124,fg=126,gg=128,Ro=65533,Jr=42,at=43,pg=44,mg=58,Bg=59,un=46,vg=0,Cg=8,wg=11,bg=14,yg=31,Ug=127,pA=-1,Lo=48,Do=97,Ho=101,Qg=102,Eg=117,Sg=122,Oo=65,Mo=69,No=70,kg=85,Tg=90,_e=function(t){return t>=Lo&&t<=57},Fg=function(t){return t>=55296&&t<=57343},Qt=function(t){return _e(t)||t>=Oo&&t<=No||t>=Do&&t<=Qg},Ig=function(t){return t>=Do&&t<=Sg},xg=function(t){return t>=Oo&&t<=Tg},_g=function(t){return Ig(t)||xg(t)},Pg=function(t){return t>=gg},ei=function(t){return t===qn||t===$f||t===eg},Ai=function(t){return _g(t)||Pg(t)||t===ig},Ko=function(t){return Ai(t)||_e(t)||t===De},Rg=function(t){return t>=vg&&t<=Cg||t===wg||t>=bg&&t<=yg||t===Ug},DA=function(t,e){return t!==on?!1:e!==qn},ti=function(t,e,A){return t===De?Ai(e)||DA(e,A):Ai(t)?!0:!!(t===on&&DA(t,e))},Xr=function(t,e,A){return t===at||t===De?_e(e)?!0:e===un&&_e(A):_e(t===un?e:t)},Lg=function(t){var e=0,A=1;(t[e]===at||t[e]===De)&&(t[e]===De&&(A=-1),e++);for(var n=[];_e(t[e]);)n.push(t[e++]);var i=n.length?parseInt(he.apply(void 0,n),10):0;t[e]===un&&e++;for(var r=[];_e(t[e]);)r.push(t[e++]);var s=r.length,a=s?parseInt(he.apply(void 0,r),10):0;(t[e]===Mo||t[e]===Ho)&&e++;var o=1;(t[e]===at||t[e]===De)&&(t[e]===De&&(o=-1),e++);for(var c=[];_e(t[e]);)c.push(t[e++]);var l=c.length?parseInt(he.apply(void 0,c),10):0;return A*(i+a*Math.pow(10,-s))*Math.pow(10,o*l)},Dg={type:2},Hg={type:3},Og={type:4},Mg={type:13},Ng={type:8},Kg={type:21},Vg={type:9},Gg={type:10},jg={type:11},Wg={type:12},Jg={type:14},ni={type:23},Xg={type:1},qg={type:25},Yg={type:24},zg={type:26},Zg={type:27},$g={type:28},ep={type:29},Ap={type:31},qr={type:32},Vo=function(){function t(){this._value=[]}return t.prototype.write=function(e){this._value=this._value.concat(On(e))},t.prototype.read=function(){for(var e=[],A=this.consumeToken();A!==qr;)e.push(A),A=this.consumeToken();return e},t.prototype.consumeToken=function(){var e=this.consumeCodePoint();switch(e){case Yn:return this.consumeStringToken(Yn);case Ag:var A=this.peekCodePoint(0),n=this.peekCodePoint(1),i=this.peekCodePoint(2);if(Ko(A)||DA(n,i)){var r=ti(A,n,i)?Zf:zf,s=this.consumeName();return{type:5,value:s,flags:r}}break;case tg:if(this.peekCodePoint(0)===cn)return this.consumeCodePoint(),Mg;break;case zn:return this.consumeStringToken(zn);case Zn:return Dg;case ln:return Hg;case Jr:if(this.peekCodePoint(0)===cn)return this.consumeCodePoint(),Jg;break;case at:if(Xr(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case pg:return Og;case De:var a=e,o=this.peekCodePoint(0),c=this.peekCodePoint(1);if(Xr(a,o,c))return this.reconsumeCodePoint(e),this.consumeNumericToken();if(ti(a,o,c))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();if(o===De&&c===ag)return this.consumeCodePoint(),this.consumeCodePoint(),Yg;break;case un:if(Xr(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case _o:if(this.peekCodePoint(0)===Jr)for(this.consumeCodePoint();;){var l=this.consumeCodePoint();if(l===Jr&&(l=this.consumeCodePoint(),l===_o))return this.consumeToken();if(l===pA)return this.consumeToken()}break;case mg:return zg;case Bg:return Zg;case sg:if(this.peekCodePoint(0)===rg&&this.peekCodePoint(1)===De&&this.peekCodePoint(2)===De)return this.consumeCodePoint(),this.consumeCodePoint(),qg;break;case og:var u=this.peekCodePoint(0),d=this.peekCodePoint(1),h=this.peekCodePoint(2);if(ti(u,d,h)){var s=this.consumeName();return{type:7,value:s}}break;case cg:return $g;case on:if(DA(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();break;case lg:return ep;case ug:if(this.peekCodePoint(0)===cn)return this.consumeCodePoint(),Ng;break;case dg:return jg;case hg:return Wg;case Eg:case kg:var g=this.peekCodePoint(0),f=this.peekCodePoint(1);return g===at&&(Qt(f)||f===$n)&&(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(e),this.consumeIdentLikeToken();case Po:if(this.peekCodePoint(0)===cn)return this.consumeCodePoint(),Vg;if(this.peekCodePoint(0)===Po)return this.consumeCodePoint(),Kg;break;case fg:if(this.peekCodePoint(0)===cn)return this.consumeCodePoint(),Gg;break;case pA:return qr}return ei(e)?(this.consumeWhiteSpace(),Ap):_e(e)?(this.reconsumeCodePoint(e),this.consumeNumericToken()):Ai(e)?(this.reconsumeCodePoint(e),this.consumeIdentLikeToken()):{type:6,value:he(e)}},t.prototype.consumeCodePoint=function(){var e=this._value.shift();return typeof e>"u"?-1:e},t.prototype.reconsumeCodePoint=function(e){this._value.unshift(e)},t.prototype.peekCodePoint=function(e){return e>=this._value.length?-1:this._value[e]},t.prototype.consumeUnicodeRangeToken=function(){for(var e=[],A=this.consumeCodePoint();Qt(A)&&e.length<6;)e.push(A),A=this.consumeCodePoint();for(var n=!1;A===$n&&e.length<6;)e.push(A),A=this.consumeCodePoint(),n=!0;if(n){var i=parseInt(he.apply(void 0,e.map(function(o){return o===$n?Lo:o})),16),r=parseInt(he.apply(void 0,e.map(function(o){return o===$n?No:o})),16);return{type:30,start:i,end:r}}var s=parseInt(he.apply(void 0,e),16);if(this.peekCodePoint(0)===De&&Qt(this.peekCodePoint(1))){this.consumeCodePoint(),A=this.consumeCodePoint();for(var a=[];Qt(A)&&a.length<6;)a.push(A),A=this.consumeCodePoint();var r=parseInt(he.apply(void 0,a),16);return{type:30,start:s,end:r}}else return{type:30,start:s,end:s}},t.prototype.consumeIdentLikeToken=function(){var e=this.consumeName();return e.toLowerCase()==="url"&&this.peekCodePoint(0)===Zn?(this.consumeCodePoint(),this.consumeUrlToken()):this.peekCodePoint(0)===Zn?(this.consumeCodePoint(),{type:19,value:e}):{type:20,value:e}},t.prototype.consumeUrlToken=function(){var e=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===pA)return{type:22,value:""};var A=this.peekCodePoint(0);if(A===zn||A===Yn){var n=this.consumeStringToken(this.consumeCodePoint());return n.type===0&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===pA||this.peekCodePoint(0)===ln)?(this.consumeCodePoint(),{type:22,value:n.value}):(this.consumeBadUrlRemnants(),ni)}for(;;){var i=this.consumeCodePoint();if(i===pA||i===ln)return{type:22,value:he.apply(void 0,e)};if(ei(i))return this.consumeWhiteSpace(),this.peekCodePoint(0)===pA||this.peekCodePoint(0)===ln?(this.consumeCodePoint(),{type:22,value:he.apply(void 0,e)}):(this.consumeBadUrlRemnants(),ni);if(i===Yn||i===zn||i===Zn||Rg(i))return this.consumeBadUrlRemnants(),ni;if(i===on)if(DA(i,this.peekCodePoint(0)))e.push(this.consumeEscapedCodePoint());else return this.consumeBadUrlRemnants(),ni;else e.push(i)}},t.prototype.consumeWhiteSpace=function(){for(;ei(this.peekCodePoint(0));)this.consumeCodePoint()},t.prototype.consumeBadUrlRemnants=function(){for(;;){var e=this.consumeCodePoint();if(e===ln||e===pA)return;DA(e,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},t.prototype.consumeStringSlice=function(e){for(var A=5e4,n="";e>0;){var i=Math.min(A,e);n+=he.apply(void 0,this._value.splice(0,i)),e-=i}return this._value.shift(),n},t.prototype.consumeStringToken=function(e){var A="",n=0;do{var i=this._value[n];if(i===pA||i===void 0||i===e)return A+=this.consumeStringSlice(n),{type:0,value:A};if(i===qn)return this._value.splice(0,n),Xg;if(i===on){var r=this._value[n+1];r!==pA&&r!==void 0&&(r===qn?(A+=this.consumeStringSlice(n),n=-1,this._value.shift()):DA(i,r)&&(A+=this.consumeStringSlice(n),A+=he(this.consumeEscapedCodePoint()),n=-1))}n++}while(!0)},t.prototype.consumeNumber=function(){var e=[],A=an,n=this.peekCodePoint(0);for((n===at||n===De)&&e.push(this.consumeCodePoint());_e(this.peekCodePoint(0));)e.push(this.consumeCodePoint());n=this.peekCodePoint(0);var i=this.peekCodePoint(1);if(n===un&&_e(i))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),A=xo;_e(this.peekCodePoint(0));)e.push(this.consumeCodePoint());n=this.peekCodePoint(0),i=this.peekCodePoint(1);var r=this.peekCodePoint(2);if((n===Mo||n===Ho)&&((i===at||i===De)&&_e(r)||_e(i)))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),A=xo;_e(this.peekCodePoint(0));)e.push(this.consumeCodePoint());return[Lg(e),A]},t.prototype.consumeNumericToken=function(){var e=this.consumeNumber(),A=e[0],n=e[1],i=this.peekCodePoint(0),r=this.peekCodePoint(1),s=this.peekCodePoint(2);if(ti(i,r,s)){var a=this.consumeName();return{type:15,number:A,flags:n,unit:a}}return i===ng?(this.consumeCodePoint(),{type:16,number:A,flags:n}):{type:17,number:A,flags:n}},t.prototype.consumeEscapedCodePoint=function(){var e=this.consumeCodePoint();if(Qt(e)){for(var A=he(e);Qt(this.peekCodePoint(0))&&A.length<6;)A+=he(this.consumeCodePoint());ei(this.peekCodePoint(0))&&this.consumeCodePoint();var n=parseInt(A,16);return n===0||Fg(n)||n>1114111?Ro:n}return e===pA?Ro:e},t.prototype.consumeName=function(){for(var e="";;){var A=this.consumeCodePoint();if(Ko(A))e+=he(A);else if(DA(A,this.peekCodePoint(0)))e+=he(this.consumeEscapedCodePoint());else return this.reconsumeCodePoint(A),e}},t}(),Go=function(){function t(e){this._tokens=e}return t.create=function(e){var A=new Vo;return A.write(e),new t(A.read())},t.parseValue=function(e){return t.create(e).parseComponentValue()},t.parseValues=function(e){return t.create(e).parseComponentValues()},t.prototype.parseComponentValue=function(){for(var e=this.consumeToken();e.type===31;)e=this.consumeToken();if(e.type===32)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(e);var A=this.consumeComponentValue();do e=this.consumeToken();while(e.type===31);if(e.type===32)return A;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},t.prototype.parseComponentValues=function(){for(var e=[];;){var A=this.consumeComponentValue();if(A.type===32)return e;e.push(A),e.push()}},t.prototype.consumeComponentValue=function(){var e=this.consumeToken();switch(e.type){case 11:case 28:case 2:return this.consumeSimpleBlock(e.type);case 19:return this.consumeFunction(e)}return e},t.prototype.consumeSimpleBlock=function(e){for(var A={type:e,values:[]},n=this.consumeToken();;){if(n.type===32||np(n,e))return A;this.reconsumeToken(n),A.values.push(this.consumeComponentValue()),n=this.consumeToken()}},t.prototype.consumeFunction=function(e){for(var A={name:e.value,values:[],type:18};;){var n=this.consumeToken();if(n.type===32||n.type===3)return A;this.reconsumeToken(n),A.values.push(this.consumeComponentValue())}},t.prototype.consumeToken=function(){var e=this._tokens.shift();return typeof e>"u"?qr:e},t.prototype.reconsumeToken=function(e){this._tokens.unshift(e)},t}(),HA=function(t){return t.type===15},me=function(t){return t.type===17},j=function(t){return t.type===20},tp=function(t){return t.type===0},Yr=function(t,e){return j(t)&&t.value===e},jo=function(t){return t.type!==31},Ee=function(t){return t.type!==31&&t.type!==4},mA=function(t){var e=[],A=[];return t.forEach(function(n){if(n.type===4){if(A.length===0)throw new Error("Error parsing function args, zero tokens for arg");e.push(A),A=[];return}n.type!==31&&A.push(n)}),A.length&&e.push(A),e},np=function(t,e){return e===11&&t.type===12||e===28&&t.type===29?!0:e===2&&t.type===3},OA=function(t){return t.type===17||t.type===15},ne=function(t){return t.type===16||OA(t)},Wo=function(t){return t.length>1?[t[0],t[1]]:[t[0]]},Se={type:17,number:0,flags:an},zr={type:16,number:50,flags:an},MA={type:16,number:100,flags:an},dn=function(t,e,A){var n=t[0],i=t[1];return[$(n,e),$(typeof i<"u"?i:n,A)]},$=function(t,e){if(t.type===16)return t.number/100*e;if(HA(t))switch(t.unit){case"rem":case"em":return 16*t.number;case"px":default:return t.number}return t.number},Jo="deg",Xo="grad",qo="rad",Yo="turn",ii={name:"angle",parse:function(t,e){if(e.type===15)switch(e.unit){case Jo:return Math.PI*e.number/180;case Xo:return Math.PI/200*e.number;case qo:return e.number;case Yo:return Math.PI*2*e.number}throw new Error("Unsupported angle type")}},zo=function(t){return t.type===15&&(t.unit===Jo||t.unit===Xo||t.unit===qo||t.unit===Yo)},Zo=function(t){var e=t.filter(j).map(function(A){return A.value}).join(" ");switch(e){case"to bottom right":case"to right bottom":case"left top":case"top left":return[Se,Se];case"to top":case"bottom":return ze(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[Se,MA];case"to right":case"left":return ze(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[MA,MA];case"to bottom":case"top":return ze(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[MA,Se];case"to left":case"right":return ze(270)}return 0},ze=function(t){return Math.PI*t/180},NA=function(t){return(255&t)===0},Ue=function(t){var e=255&t,A=255&t>>8,n=255&t>>16,i=255&t>>24;return e<255?"rgba(".concat(i,",").concat(n,",").concat(A,",").concat(e/255,")"):"rgb(".concat(i,",").concat(n,",").concat(A,")")},BA=function(t,e,A,n){return(t<<24|e<<16|A<<8|Math.round(n*255)<<0)>>>0},ri=function(t,e){if(t.type===17)return t.number;if(t.type===16){var A=e===3?1:255;return e===3?t.number/100*A:Math.round(t.number/100*A)}return 0},ot=function(t){return(t[0].type===20?t[0].value:"unknown")==="from"},ce=function(t,e,A){return Math.min(Math.max(t,e),A)},He=function(t,e){return[t[0]*e[0]+t[1]*e[1]+t[2]*e[2],t[3]*e[0]+t[4]*e[1]+t[5]*e[2],t[6]*e[0]+t[7]*e[1]+t[8]*e[2]]},ip=function(t){return BA(ce(Math.round(t[0]*255),0,255),ce(Math.round(t[1]*255),0,255),ce(Math.round(t[2]*255),0,255),ce(t[3],0,1))},Zr=function(t){var e=t[0],A=t[1],n=t[2],i=t[3],r=ct([e,A,n]);return BA(ce(Math.round(r[0]*255),0,255),ce(Math.round(r[1]*255),0,255),ce(Math.round(r[2]*255),0,255),i)},hn=function(t){var e=KA([t[0],t[1],t[2]]);return Zr([e[0],e[1],e[2],t[3]])},rp=function(t,e){if(ot(e.filter(Ee)))throw new Error("Relative color not supported for lab()");var A=si(e),n=A[0],i=A[1],r=A[2],s=A[3],a=ct(KA(ci([n,i,r])));return BA(ce(Math.round(a[0]*255),0,255),ce(Math.round(a[1]*255),0,255),ce(Math.round(a[2]*255),0,255),s)},sp=function(t,e){if(ot(e.filter(Ee)))throw new Error("Relative color not supported for oklab()");var A=si(e),n=A[0],i=A[1],r=A[2],s=A[3],a=ct(KA(oi([n,i,r])));return BA(ce(Math.round(a[0]*255),0,255),ce(Math.round(a[1]*255),0,255),ce(Math.round(a[2]*255),0,255),s)},ap=function(t,e){if(ot(e.filter(Ee)))throw new Error("Relative color not supported for oklch()");var A=tc(e),n=A[0],i=A[1],r=A[2],s=A[3],a=ct(KA(oi(ai([n,i,r]))));return BA(ce(Math.round(a[0]*255),0,255),ce(Math.round(a[1]*255),0,255),ce(Math.round(a[2]*255),0,255),s)},op=function(t,e){if(ot(e.filter(Ee)))throw new Error("Relative color not supported for lch()");var A=Ac(e),n=A[0],i=A[1],r=A[2],s=A[3],a=ct(KA(ci(ai([n,i,r]))));return BA(ce(Math.round(a[0]*255),0,255),ce(Math.round(a[1]*255),0,255),ce(Math.round(a[2]*255),0,255),s)},$o=function(t,e){var A=e.filter(Ee),n=A[0],i=A[1],r=A[2],s=A[3],a=(n.type===17?ze(n.number):ii.parse(t,n))/(Math.PI*2),o=ne(i)?i.number/100:0,c=ne(r)?r.number/100:0,l=typeof s<"u"&&ne(s)?$(s,1):1;return[a,o,c,l]},ec=function(t,e){if(ot(e))throw new Error("Relative color not supported for hsl()");var A=$o(t,e),n=A[0],i=A[1],r=A[2],s=A[3],a=ic([n,i,r]);return BA(a[0]*255,a[1]*255,a[2]*255,i===0?1:s)},Ac=function(t){var e=t.filter(Ee),A=ne(e[0])?e[0].number:0,n=ne(e[1])?e[1].number:0,i=me(e[2])||HA(e[2])?e[2].number:0,r=typeof e[4]<"u"&&ne(e[4])?$(e[4],1):1;return[A,n,i,r]},si=function(t){var e=t.filter(Ee),A=e[0].type===16?e[0].number/100:me(e[0])?e[0].number:0,n=e[1].type===16?e[1].number/100:me(e[1])?e[1].number:0,i=me(e[2])||HA(e[2])?e[2].number:0,r=typeof e[4]<"u"&&ne(e[4])?$(e[4],1):1;return[A,n,i,r]},tc=function(t){var e=t.filter(Ee),A=e[0].type===16?e[0].number/100:me(e[0])?e[0].number:0,n=e[1].type===16?e[1].number/100:me(e[1])?e[1].number:0,i=me(e[2])||HA(e[2])?e[2].number:0,r=typeof e[4]<"u"&&ne(e[4])?$(e[4],1):1;return[A,n,i,r]},nc=function(t){return He([1.0479297925449969,.022946870601609652,-.05019226628920524,.02962780877005599,.9904344267538799,-.017073799063418826,-.009243040646204504,.015055191490298152,.7518742814281371],t)},$r=function(t){return He([.955473421488075,-.02309845494876471,.06325924320057072,-.0283697093338637,1.0099953980813041,.021041441191917323,.012314014864481998,-.020507649298898964,1.330365926242124],t)},es=function(t,e,A){return A<0&&(A+=1),A>=1&&(A-=1),A<1/6?(e-t)*A*6+t:A<1/2?e:A<2/3?(e-t)*6*(2/3-A)+t:t},ic=function(t){var e=t[0],A=t[1],n=t[2];if(A===0)return[n*255,n*255,n*255];var i=n<=.5?n*(A+1):n+A-n*A,r=n*2-i,s=es(r,i,e+1/3),a=es(r,i,e),o=es(r,i,e-1/3);return[s,a,o]},ai=function(t){var e=t[0],A=t[1],n=t[2];return A<0&&(A=0),isNaN(n)&&(n=0),[e,A*Math.cos(n*Math.PI/180),A*Math.sin(n*Math.PI/180)]},oi=function(t){var e=He([1,.3963377773761749,.2158037573099136,1,-.1055613458156586,-.0638541728258133,1,-.0894841775298119,-1.2914855480194092],t),A=e.map(function(n){return Math.pow(n,3)});return He([1.2268798758459243,-.5578149944602171,.2813910456659647,-.0405757452148008,1.112286803280317,-.0717110580655164,-.0763729366746601,-.4214933324022432,1.5869240198367816],A)},ci=function(t){var e=(t[0]+16)/116,A=t[1]/500+e,n=e-t[2]/200,i=24389/27,r=24/116,s=[(A>r?Math.pow(A,3):(116*A-16)/i)*.3457/.3585,t[0]>8?Math.pow(e,3):t[0]/i,(n>r?Math.pow(n,3):(116*n-16)/i)*(1-.3457-.3585)/.3585];return $r([s[0],s[1],s[2]])},cp=function(t,e){var A=e.filter(Ee);if(A.length===3){var n=A.map(ri),i=n[0],r=n[1],s=n[2],a=ts([i/255,r/255,s/255]),o=As([a[0],a[1],a[2]]),c=o[0],l=o[1],u=o[2];return[c,l,u,1]}if(A.length===4){var d=A.map(ri),i=d[0],r=d[1],s=d[2],h=d[3],a=ts([i/255,r/255,s/255]),g=As([a[0],a[1],a[2]]),c=g[0],l=g[1],u=g[2];return[c,l,u,h]}return[0,0,0,1]},lp=function(t,e){var A=$o(t,e),n=A[0],i=A[1],r=A[2],s=A[3],a=ts(ic([n,i,r])),o=As([a[0],a[1],a[2]]),c=o[0],l=o[1],u=o[2];return[c,l,u,s]},up=function(t,e){var A=si(e),n=A[0],i=A[1],r=A[2],s=A[3],a=ci([n,i,r]),o=a[0],c=a[1],l=a[2];return[o,c,l,s]},dp=function(t,e){var A=Ac(e),n=A[0],i=A[1],r=A[2],s=A[3],a=ci(ai([n,i,r])),o=a[0],c=a[1],l=a[2];return[o,c,l,s]},hp=function(t,e){var A=tc(e),n=A[0],i=A[1],r=A[2],s=A[3],a=oi(ai([n,i,r])),o=a[0],c=a[1],l=a[2];return[o,c,l,s]},fp=function(t,e){var A=si(e),n=A[0],i=A[1],r=A[2],s=A[3],a=oi([n,i,r]),o=a[0],c=a[1],l=a[2];return[o,c,l,s]},gp=function(t){return $r([t[0],t[1],t[2]])},rc=function(t){return t},pp=function(t){var e=nc([t[0],t[2],t[3]]),A=e[0],n=e[1],i=e[2];return[A,n,i,t[3]]},sc=function(t){return hn([t[0],t[1],t[2],t[3]])},mp=function(t){var e=gp([t[0],t[1],t[2]]);return hn([e[0],e[1],e[2],t[3]])},KA=function(t){return He([3.2409699419045226,-1.537383177570094,-.4986107602930034,-.9692436362808796,1.8759675015077202,.04155505740717559,.05563007969699366,-.20397695888897652,1.0569715142428786],t)},As=function(t){return He([.41239079926595934,.357584339383878,.1804807884018343,.21263900587151027,.715168678767756,.07219231536073371,.01933081871559182,.11919477979462598,.9505321522496607],t)},ct=function(t){return t.map(function(e){var A=e<0?-1:1,n=Math.abs(e);return n>.0031308?A*(1.055*Math.pow(n,1/2.4)-.055):12.92*e})},ts=function(t){return t.map(function(e){var A=e<0?-1:1,n=Math.abs(e);return n<=.04045?e/12.92:A*Math.pow((n+.055)/1.055,2.4)})},Bp=function(t){var e=ct(KA([t[0],t[1],t[2]])),A=e[0],n=e[1],i=e[2];return[A,n,i,t[3]]},vp=function(t){var e=KA([t[0],t[1],t[2]]),A=e[0],n=e[1],i=e[2];return[ce(Math.round(A*255),0,255),ce(Math.round(n*255),0,255),ce(Math.round(i*255),0,255),t[3]]},Cp=function(t){return He([.4865709486482162,.26566769316909306,.1982172852343625,.2289745640697488,.6917385218365064,.079286914093745,0,.04511338185890264,1.043944368900976],t)},wp=function(t){return He([2.493496911941425,-.9313836179191239,-.40271078445071684,-.8294889695615747,1.7626640603183463,.023624685841943577,.03584583024378447,-.07617238926804182,.9568845240076872],t)},bp=function(t){return t.map(function(e){var A=e<0?-1:1,n=e*A;return n<=.04045?e/12.92:A*Math.pow((e+.055)/1.055,2.4)||0})},yp=function(t){return ct(t)},Up=function(t){var e=bp([t[0],t[1],t[2]]);return Cp([e[0],e[1],e[2]])},Qp=function(t){var e=yp(wp([t[0],t[1],t[2]])),A=e[0],n=e[1],i=e[2];return[A,n,i,t[3]]},Ep=function(t){var e=Up([t[0],t[1],t[2]]);return hn([e[0],e[1],e[2],t[3]])},Sp=function(t){return He([2.0415879038107465,-.5650069742788596,-.34473135077832956,-.9692436362808795,1.8759675015077202,.04155505740717557,.013444280632031142,-.11836239223101838,1.0151749943912054],t)},kp=function(t){return He([.5766690429101305,.1855582379065463,.1882286462349947,.29734497525053605,.6273635662554661,.0752914584939978,.02703136138641234,.07068885253582723,.9913375368376388],t)},Tp=function(t){var e=t.map(function(A){var n=A<0?-1:1,i=Math.abs(A);return n*Math.pow(i,2.19921875)});return[e[0],e[1],e[2]]},Fp=function(t){var e=t.map(function(A){var n=A<0?-1:1,i=Math.abs(A);return n*Math.pow(i,.4547069271758437)});return[e[0],e[1],e[2]]},Ip=function(t){var e=Fp(Sp([t[0],t[1],t[2]])),A=e[0],n=e[1],i=e[2];return[A,n,i,t[3]]},xp=function(t){var e=KA(kp(Tp([t[0],t[1],t[2]])));return Zr([e[0],e[1],e[2],t[3]])},_p=function(t){return He([.7977666449006423,.13518129740053308,.0313477341283922,.2880748288194013,.711835234241873,8993693872564e-17,0,0,.8251046025104602],t)},Pp=function(t){return He([1.3457868816471583,-.25557208737979464,-.05110186497554526,-.5446307051249019,1.5082477428451468,.02052744743642139,0,0,1.2119675456389452],t)},Rp=function(t){return t.map(function(e){return e<16/512?e/16:Math.pow(e,1.8)})},Lp=function(t){return t.map(function(e){return e>1/512?Math.pow(e,1/1.8):e*16})},Dp=function(t){var e=Rp([t[0],t[1],t[2]]);return $r(_p([e[0],e[1],e[2]]))},Hp=function(t){var e=Lp(Pp(nc([t[0],t[1],t[2]]))),A=e[0],n=e[1],i=e[2];return[A,n,i,t[3]]},Op=function(t){var e=Dp([t[0],t[1],t[2]]);return hn([e[0],e[1],e[2],t[3]])},li=1.09929682680944,ac=.018053968510807,Mp=function(t){return t.map(function(e){return e<ac*4.5?e/4.5:Math.pow((e+li-1)/li,1/.45)})},Np=function(t){return t.map(function(e){return e>=ac?li*Math.pow(e,.45)-(li-1):4.5*e})},Kp=function(t){return He([.6369580483012914,.14461690358620832,.1688809751641721,.2627002120112671,.6779980715188708,.05930171646986196,0,.028072693049087428,1.060985057710791],t)},Vp=function(t){return He([1.716651187971268,-.355670783776392,-.25336628137366,-.666684351832489,1.616481236634939,.0157685458139111,.017639857445311,-.042770613257809,.942103121235474],t)},Gp=function(t){var e=Mp([t[0],t[1],t[2]]);return Kp([e[0],e[1],e[2]])},jp=function(t){var e=Np(Vp([t[0],t[1],t[2]])),A=e[0],n=e[1],i=e[2];return[A,n,i,t[3]]},Wp=function(t){var e=Gp([t[0],t[1],t[2]]);return hn([e[0],e[1],e[2],t[3]])},VA={name:"color",parse:function(t,e){if(e.type===18){var A=Yp[e.name];if(typeof A>"u")throw new Error('Attempting to parse an unsupported color function "'.concat(e.name,'"'));return A(t,e.values)}if(e.type===5){var n=oc(e),i=n[0],r=n[1],s=n[2],a=n[3];return BA(i,r,s,a)}if(e.type===20){var o=vA[e.value.toUpperCase()];if(typeof o<"u")return o}return vA.TRANSPARENT}},oc=function(t){if(t.value.length===3){var e=t.value.substring(0,1),A=t.value.substring(1,2),n=t.value.substring(2,3);return[parseInt(e+e,16),parseInt(A+A,16),parseInt(n+n,16),1]}if(t.value.length===4){var e=t.value.substring(0,1),A=t.value.substring(1,2),n=t.value.substring(2,3),i=t.value.substring(3,4);return[parseInt(e+e,16),parseInt(A+A,16),parseInt(n+n,16),parseInt(i+i,16)/255]}if(t.value.length===6){var e=t.value.substring(0,2),A=t.value.substring(2,4),n=t.value.substring(4,6);return[parseInt(e,16),parseInt(A,16),parseInt(n,16),1]}if(t.value.length===8){var e=t.value.substring(0,2),A=t.value.substring(2,4),n=t.value.substring(4,6),i=t.value.substring(6,8);return[parseInt(e,16),parseInt(A,16),parseInt(n,16),parseInt(i,16)/255]}return[0,0,0,1]},cc=function(t,e){var A=e.filter(Ee);if(ot(A))throw new Error("Relative color not supported for rgb()");if(A.length===3){var n=A.map(ri),i=n[0],r=n[1],s=n[2];return BA(i,r,s,1)}if(A.length===4){var a=A.map(ri),i=a[0],r=a[1],s=a[2],o=a[3];return BA(i,r,s,o)}return 0},Jp=function(t,e){var A=e.filter(Ee),n=A[0].type===20?A[0].value:"unknown",i=!ot(A);if(i){var r=n,s=lc[r];if(typeof s>"u")throw new Error('Attempting to parse an unsupported color space "'.concat(r,'" for color() function'));var a=me(A[1])?A[1].number:0,o=me(A[2])?A[2].number:0,c=me(A[3])?A[3].number:0,l=A.length>4&&A[4].type===6&&A[4].value==="/"&&me(A[5])?A[5].number:1;return s([a,o,c,l])}else{var u=function(N,V){if(me(V))return V.number;var Fe=function(we){return we==="r"||we==="x"?0:we==="g"||we==="y"?1:2};if(j(V)){var ve=Fe(V.value);return N[ve]}var Ce=function(we){for(var nA=we.filter(Ee),Ye="(",Ie=0,it=nA;Ie<it.length;Ie++){var We=it[Ie];Ye+=We.type===18&&We.name==="calc"?Ce(We.values):me(We)?We.number:We.type===6||j(We)?We.value:""}return Ye+=")",Ye};if(V.type===18){var tA=V.values.filter(Ee);if(V.name==="calc"){var Le=Ce(tA).replace(/r|x/,N[0].toString()).replace(/g|y/,N[1].toString()).replace(/b|z/,N[2].toString());return new Function("return "+Le)()}}return null},d=A[1].type===18?A[1].name:j(A[1])||A[1].type===5?"rgb":"unknown",h=j(A[2])?A[2].value:"unknown",g=A[1].type===18?A[1].values:j(A[1])?[A[1]]:[];if(j(A[1])){var f=vA[A[1].value.toUpperCase()];if(typeof f>"u")throw new Error("Attempting to use unknown color in relative color 'from'");var m=Et(t,A[1].value),B=255&m,b=255&m>>8,U=255&m>>16,C=255&m>>24;g=[{type:17,number:C,flags:1},{type:17,number:U,flags:1},{type:17,number:b,flags:1},{type:17,number:B>1?B/255:B,flags:1}]}else if(A[1].type===5){var w=oc(A[1]),C=w[0],U=w[1],b=w[2],B=w[3];g=[{type:17,number:C,flags:1},{type:17,number:U,flags:1},{type:17,number:b,flags:1},{type:17,number:B>1?B/255:B,flags:1}]}if(g.length===0)throw new Error("Attempting to use unknown color in relative color 'from'");if(h==="unknown")throw new Error("Attempting to use unknown colorspace in relative color 'to'");var y=Xp[d],E=qp[h],F=lc[h];if(typeof y>"u")throw new Error('Attempting to parse an unsupported color space "'.concat(d,'" for color() function'));if(typeof E>"u")throw new Error('Attempting to parse an unsupported color space "'.concat(h,'" for color() function'));var S=y(t,g),x=E(S),a=u(x,A[3]),o=u(x,A[4]),c=u(x,A[5]),l=A.length>6&&A[6].type===6&&A[6].value==="/"&&me(A[7])?A[7].number:1;if(a===null||o===null||c===null)throw new Error("Invalid relative color in color() function");return F([a,o,c,l])}},lc={srgb:ip,"srgb-linear":Zr,"display-p3":Ep,"a98-rgb":xp,"prophoto-rgb":Op,xyz:sc,"xyz-d50":mp,"xyz-d65":sc,rec2020:Wp},Xp={rgb:cp,hsl:lp,lab:up,lch:dp,oklab:fp,oklch:hp},qp={srgb:Bp,"srgb-linear":vp,"display-p3":Qp,"a98-rgb":Ip,"prophoto-rgb":Hp,xyz:rc,"xyz-d50":pp,"xyz-d65":rc,rec2020:jp},Yp={hsl:ec,hsla:ec,rgb:cc,rgba:cc,lch:op,oklch:ap,oklab:sp,lab:rp,color:Jp},Et=function(t,e){return VA.parse(t,Go.create(e).parseComponentValue())},vA={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},zp={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(t,e){return e.map(function(A){if(j(A))switch(A.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},Zp={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},ui=function(t,e){var A=VA.parse(t,e[0]),n=e[1];return n&&ne(n)?{color:A,stop:n}:{color:A,stop:null}},uc=function(t,e){var A=t[0],n=t[t.length-1];A.stop===null&&(A.stop=Se),n.stop===null&&(n.stop=MA);for(var i=[],r=0,s=0;s<t.length;s++){var a=t[s].stop;if(a!==null){var o=$(a,e);o>r?i.push(o):i.push(r),r=o}else i.push(null)}for(var c=null,s=0;s<i.length;s++){var l=i[s];if(l===null)c===null&&(c=s);else if(c!==null){for(var u=s-c,d=i[c-1],h=(l-d)/(u+1),g=1;g<=u;g++)i[c+g-1]=h*g;c=null}}return t.map(function(f,m){var B=f.color;return{color:B,stop:Math.max(Math.min(1,i[m]/e),0)}})},$p=function(t,e,A){var n=e/2,i=A/2,r=$(t[0],e)-n,s=i-$(t[1],A);return(Math.atan2(s,r)+Math.PI*2)%(Math.PI*2)},em=function(t,e,A){var n=typeof t=="number"?t:$p(t,e,A),i=Math.abs(e*Math.sin(n))+Math.abs(A*Math.cos(n)),r=e/2,s=A/2,a=i/2,o=Math.sin(n-Math.PI/2)*a,c=Math.cos(n-Math.PI/2)*a;return[i,r-c,r+c,s-o,s+o]},rA=function(t,e){return Math.sqrt(t*t+e*e)},dc=function(t,e,A,n,i){var r=[[0,0],[0,e],[t,0],[t,e]];return r.reduce(function(s,a){var o=a[0],c=a[1],l=rA(A-o,n-c);return(i?l<s.optimumDistance:l>s.optimumDistance)?{optimumCorner:a,optimumDistance:l}:s},{optimumDistance:i?1/0:-1/0,optimumCorner:null}).optimumCorner},Am=function(t,e,A,n,i){var r=0,s=0;switch(t.size){case 0:t.shape===0?r=s=Math.min(Math.abs(e),Math.abs(e-n),Math.abs(A),Math.abs(A-i)):t.shape===1&&(r=Math.min(Math.abs(e),Math.abs(e-n)),s=Math.min(Math.abs(A),Math.abs(A-i)));break;case 2:if(t.shape===0)r=s=Math.min(rA(e,A),rA(e,A-i),rA(e-n,A),rA(e-n,A-i));else if(t.shape===1){var a=Math.min(Math.abs(A),Math.abs(A-i))/Math.min(Math.abs(e),Math.abs(e-n)),o=dc(n,i,e,A,!0),c=o[0],l=o[1];r=rA(c-e,(l-A)/a),s=a*r}break;case 1:t.shape===0?r=s=Math.max(Math.abs(e),Math.abs(e-n),Math.abs(A),Math.abs(A-i)):t.shape===1&&(r=Math.max(Math.abs(e),Math.abs(e-n)),s=Math.max(Math.abs(A),Math.abs(A-i)));break;case 3:if(t.shape===0)r=s=Math.max(rA(e,A),rA(e,A-i),rA(e-n,A),rA(e-n,A-i));else if(t.shape===1){var a=Math.max(Math.abs(A),Math.abs(A-i))/Math.max(Math.abs(e),Math.abs(e-n)),u=dc(n,i,e,A,!1),c=u[0],l=u[1];r=rA(c-e,(l-A)/a),s=a*r}break}return Array.isArray(t.size)&&(r=$(t.size[0],n),s=t.size.length===2?$(t.size[1],i):r),[r,s]},tm=function(t,e){var A=ze(180),n=[];return mA(e).forEach(function(i,r){if(r===0){var s=i[0];if(s.type===20&&s.value==="to"){A=Zo(i);return}else if(zo(s)){A=ii.parse(t,s);return}}var a=ui(t,i);n.push(a)}),{angle:A,stops:n,type:1}},di=function(t,e){var A=ze(180),n=[];return mA(e).forEach(function(i,r){if(r===0){var s=i[0];if(s.type===20&&["top","left","right","bottom"].indexOf(s.value)!==-1){A=Zo(i);return}else if(zo(s)){A=(ii.parse(t,s)+ze(270))%ze(360);return}}var a=ui(t,i);n.push(a)}),{angle:A,stops:n,type:1}},nm=function(t,e){var A=ze(180),n=[],i=1,r=0,s=3,a=[];return mA(e).forEach(function(o,c){var l=o[0];if(c===0){if(j(l)&&l.value==="linear"){i=1;return}else if(j(l)&&l.value==="radial"){i=2;return}}if(l.type===18){if(l.name==="from"){var u=VA.parse(t,l.values[0]);n.push({stop:Se,color:u})}else if(l.name==="to"){var u=VA.parse(t,l.values[0]);n.push({stop:MA,color:u})}else if(l.name==="color-stop"){var d=l.values.filter(Ee);if(d.length===2){var u=VA.parse(t,d[1]),h=d[0];me(h)&&n.push({stop:{type:16,number:h.number*100,flags:h.flags},color:u})}}}}),i===1?{angle:(A+ze(180))%ze(360),stops:n,type:i}:{size:s,shape:r,stops:n,position:a,type:i}},hc="closest-side",fc="farthest-side",gc="closest-corner",pc="farthest-corner",mc="circle",Bc="ellipse",vc="cover",Cc="contain",im=function(t,e){var A=0,n=3,i=[],r=[];return mA(e).forEach(function(s,a){var o=!0;if(a===0){var c=!1;o=s.reduce(function(u,d){if(c)if(j(d))switch(d.value){case"center":return r.push(zr),u;case"top":case"left":return r.push(Se),u;case"right":case"bottom":return r.push(MA),u}else(ne(d)||OA(d))&&r.push(d);else if(j(d))switch(d.value){case mc:return A=0,!1;case Bc:return A=1,!1;case"at":return c=!0,!1;case hc:return n=0,!1;case vc:case fc:return n=1,!1;case Cc:case gc:return n=2,!1;case pc:return n=3,!1}else if(OA(d)||ne(d))return Array.isArray(n)||(n=[]),n.push(d),!1;return u},o)}if(o){var l=ui(t,s);i.push(l)}}),{size:n,shape:A,stops:i,position:r,type:2}},hi=function(t,e){var A=0,n=3,i=[],r=[];return mA(e).forEach(function(s,a){var o=!0;if(a===0?o=s.reduce(function(l,u){if(j(u))switch(u.value){case"center":return r.push(zr),!1;case"top":case"left":return r.push(Se),!1;case"right":case"bottom":return r.push(MA),!1}else if(ne(u)||OA(u))return r.push(u),!1;return l},o):a===1&&(o=s.reduce(function(l,u){if(j(u))switch(u.value){case mc:return A=0,!1;case Bc:return A=1,!1;case Cc:case hc:return n=0,!1;case fc:return n=1,!1;case gc:return n=2,!1;case vc:case pc:return n=3,!1}else if(OA(u)||ne(u))return Array.isArray(n)||(n=[]),n.push(u),!1;return l},o)),o){var c=ui(t,s);i.push(c)}}),{size:n,shape:A,stops:i,position:r,type:2}},rm=function(t){return t.type===1},sm=function(t){return t.type===2},ns={name:"image",parse:function(t,e){if(e.type===22){var A={url:e.value,type:0};return t.cache.addImage(e.value),A}if(e.type===18){var n=wc[e.name];if(typeof n>"u")throw new Error('Attempting to parse an unsupported image function "'.concat(e.name,'"'));return n(t,e.values)}throw new Error("Unsupported image type ".concat(e.type))}};function am(t){return!(t.type===20&&t.value==="none")&&(t.type!==18||!!wc[t.name])}var wc={"linear-gradient":tm,"-moz-linear-gradient":di,"-ms-linear-gradient":di,"-o-linear-gradient":di,"-webkit-linear-gradient":di,"radial-gradient":im,"-moz-radial-gradient":hi,"-ms-radial-gradient":hi,"-o-radial-gradient":hi,"-webkit-radial-gradient":hi,"-webkit-gradient":nm},om={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(t,e){if(e.length===0)return[];var A=e[0];return A.type===20&&A.value==="none"?[]:e.filter(function(n){return Ee(n)&&am(n)}).map(function(n){return ns.parse(t,n)})}},cm={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(t,e){return e.map(function(A){if(j(A))switch(A.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},lm={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(t,e){return mA(e).map(function(A){return A.filter(ne)}).map(Wo)}},um={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(t,e){return mA(e).map(function(A){return A.filter(j).map(function(n){return n.value}).join(" ")}).map(dm)}},dm=function(t){switch(t){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;case"repeat":default:return 0}},St;(function(t){t.AUTO="auto",t.CONTAIN="contain",t.COVER="cover"})(St||(St={}));var hm={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(t,e){return mA(e).map(function(A){return A.filter(fm)})}},fm=function(t){return j(t)||ne(t)},fi=function(t){return{name:"border-".concat(t,"-color"),initialValue:"transparent",prefix:!1,type:3,format:"color"}},gm=fi("top"),pm=fi("right"),mm=fi("bottom"),Bm=fi("left"),gi=function(t){return{name:"border-radius-".concat(t),initialValue:"0 0",prefix:!1,type:1,parse:function(e,A){return Wo(A.filter(ne))}}},vm=gi("top-left"),Cm=gi("top-right"),wm=gi("bottom-right"),bm=gi("bottom-left"),pi=function(t){return{name:"border-".concat(t,"-style"),initialValue:"solid",prefix:!1,type:2,parse:function(e,A){switch(A){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},ym=pi("top"),Um=pi("right"),Qm=pi("bottom"),Em=pi("left"),mi=function(t){return{name:"border-".concat(t,"-width"),initialValue:"0",type:0,prefix:!1,parse:function(e,A){return HA(A)?A.number:0}}},Sm=mi("top"),km=mi("right"),Tm=mi("bottom"),Fm=mi("left"),Im={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},xm={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(t,e){switch(e){case"rtl":return 1;case"ltr":default:return 0}}},_m={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(t,e){return e.filter(j).reduce(function(A,n){return A|Pm(n.value)},0)}},Pm=function(t){switch(t){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},Rm={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(t,e){switch(e){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},Lm={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(t,e){return e.type===20&&e.value==="normal"?0:e.type===17||e.type===15?e.number:0}},Bi;(function(t){t.NORMAL="normal",t.STRICT="strict"})(Bi||(Bi={}));var Dm={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(t,e){switch(e){case"strict":return Bi.STRICT;case"normal":default:return Bi.NORMAL}}},Hm={name:"line-height",initialValue:"normal",prefix:!1,type:4},bc=function(t,e){return j(t)&&t.value==="normal"?1.2*e:t.type===17?e*t.number:ne(t)?$(t,e):e},Om={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(t,e){return e.type===20&&e.value==="none"?null:ns.parse(t,e)}},Mm={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(t,e){switch(e){case"inside":return 0;case"outside":default:return 1}}},is={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(t,e){switch(e){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":return 22;case"hebrew":return 52;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;case"none":default:return-1}}},vi=function(t){return{name:"margin-".concat(t),initialValue:"0",prefix:!1,type:4}},Nm=vi("top"),Km=vi("right"),Vm=vi("bottom"),Gm=vi("left"),jm={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(t,e){return e.filter(j).map(function(A){switch(A.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;case"visible":default:return 0}})}},Wm={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(t,e){switch(e){case"break-word":return"break-word";case"normal":default:return"normal"}}},Ci=function(t){return{name:"padding-".concat(t),initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},Jm=Ci("top"),Xm=Ci("right"),qm=Ci("bottom"),Ym=Ci("left"),zm={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(t,e){switch(e){case"right":return 2;case"center":case"justify":return 1;case"left":default:return 0}}},Zm={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(t,e){switch(e){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},$m={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(t,e){return e.length===1&&Yr(e[0],"none")?[]:mA(e).map(function(A){for(var n={color:vA.TRANSPARENT,offsetX:Se,offsetY:Se,blur:Se},i=0,r=0;r<A.length;r++){var s=A[r];OA(s)?(i===0?n.offsetX=s:i===1?n.offsetY=s:n.blur=s,i++):n.color=VA.parse(t,s)}return n})}},e0={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(t,e){switch(e){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},A0={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(t,e){if(e.type===20&&e.value==="none")return null;if(e.type===18){var A=i0[e.name];if(typeof A>"u")throw new Error('Attempting to parse an unsupported transform function "'.concat(e.name,'"'));return A(e.values)}return null}},t0=function(t){var e=t.filter(function(A){return A.type===17}).map(function(A){return A.number});return e.length===6?e:null},n0=function(t){var e=t.filter(function(o){return o.type===17}).map(function(o){return o.number}),A=e[0],n=e[1];e[2],e[3];var i=e[4],r=e[5];e[6],e[7],e[8],e[9],e[10],e[11];var s=e[12],a=e[13];return e[14],e[15],e.length===16?[A,n,i,r,s,a]:null},i0={matrix:t0,matrix3d:n0},yc={type:16,number:50,flags:an},r0=[yc,yc],s0={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(t,e){var A=e.filter(ne);return A.length!==2?r0:[A[0],A[1]]}},a0={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(t,e){switch(e){case"hidden":return 1;case"collapse":return 2;case"visible":default:return 0}}},fn;(function(t){t.NORMAL="normal",t.BREAK_ALL="break-all",t.KEEP_ALL="keep-all"})(fn||(fn={}));for(var o0={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(t,e){switch(e){case"break-all":return fn.BREAK_ALL;case"keep-all":return fn.KEEP_ALL;case"normal":default:return fn.NORMAL}}},c0={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(t,e){if(e.type===20)return{auto:!0,order:0};if(me(e))return{auto:!1,order:e.number};throw new Error("Invalid z-index number parsed")}},Uc={name:"time",parse:function(t,e){if(e.type===15)switch(e.unit.toLowerCase()){case"s":return 1e3*e.number;case"ms":return e.number}throw new Error("Unsupported time type")}},l0={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(t,e){return me(e)?e.number:1}},u0={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},d0={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(t,e){return e.filter(j).map(function(A){switch(A.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0}).filter(function(A){return A!==0})}},h0={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(t,e){var A=[],n=[];return e.forEach(function(i){switch(i.type){case 20:case 0:A.push(i.value);break;case 17:A.push(i.number.toString());break;case 4:n.push(A.join(" ")),A.length=0;break}}),A.length&&n.push(A.join(" ")),n.map(function(i){return i.indexOf(" ")===-1?i:"'".concat(i,"'")})}},f0={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},g0={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(t,e){if(me(e))return e.number;if(j(e))switch(e.value){case"bold":return 700;case"normal":default:return 400}return 400}},p0={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(t,e){return e.filter(j).map(function(A){return A.value})}},m0={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(t,e){switch(e){case"oblique":return"oblique";case"italic":return"italic";case"normal":default:return"normal"}}},be=function(t,e){return(t&e)!==0},B0={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(t,e){if(e.length===0)return[];var A=e[0];return A.type===20&&A.value==="none"?[]:e}},v0={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(t,e){if(e.length===0)return null;var A=e[0];if(A.type===20&&A.value==="none")return null;for(var n=[],i=e.filter(jo),r=0;r<i.length;r++){var s=i[r],a=i[r+1];if(s.type===20){var o=a&&me(a)?a.number:1;n.push({counter:s.value,increment:o})}}return n}},C0={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(t,e){if(e.length===0)return[];for(var A=[],n=e.filter(jo),i=0;i<n.length;i++){var r=n[i],s=n[i+1];if(j(r)&&r.value!=="none"){var a=s&&me(s)?s.number:0;A.push({counter:r.value,reset:a})}}return A}},w0={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(t,e){return e.filter(HA).map(function(A){return Uc.parse(t,A)})}},b0={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(t,e){if(e.length===0)return null;var A=e[0];if(A.type===20&&A.value==="none")return null;var n=[],i=e.filter(tp);if(i.length%2!==0)return null;for(var r=0;r<i.length;r+=2){var s=i[r].value,a=i[r+1].value;n.push({open:s,close:a})}return n}},Qc=function(t,e,A){if(!t)return"";var n=t[Math.min(e,t.length-1)];return n?A?n.open:n.close:""},y0={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(t,e){return e.length===1&&Yr(e[0],"none")?[]:mA(e).map(function(A){for(var n={color:255,offsetX:Se,offsetY:Se,blur:Se,spread:Se,inset:!1},i=0,r=0;r<A.length;r++){var s=A[r];Yr(s,"inset")?n.inset=!0:OA(s)?(i===0?n.offsetX=s:i===1?n.offsetY=s:i===2?n.blur=s:n.spread=s,i++):n.color=VA.parse(t,s)}return n})}},U0={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(t,e){var A=[0,1,2],n=[];return e.filter(j).forEach(function(i){switch(i.value){case"stroke":n.push(1);break;case"fill":n.push(0);break;case"markers":n.push(2);break}}),A.forEach(function(i){n.indexOf(i)===-1&&n.push(i)}),n}},Q0={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},E0={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(t,e){return HA(e)?e.number:0}},S0={name:"objectFit",initialValue:"fill",prefix:!1,type:1,parse:function(t,e){return e.filter(j).reduce(function(A,n){return A|k0(n.value)},0)}},k0=function(t){switch(t){case"contain":return 2;case"cover":return 4;case"none":return 8;case"scale-down":return 16}return 0},T0=function(){function t(e,A){var n,i;this.animationDuration=O(e,w0,A.animationDuration),this.backgroundClip=O(e,zp,A.backgroundClip),this.backgroundColor=O(e,Zp,A.backgroundColor),this.backgroundImage=O(e,om,A.backgroundImage),this.backgroundOrigin=O(e,cm,A.backgroundOrigin),this.backgroundPosition=O(e,lm,A.backgroundPosition),this.backgroundRepeat=O(e,um,A.backgroundRepeat),this.backgroundSize=O(e,hm,A.backgroundSize),this.borderTopColor=O(e,gm,A.borderTopColor),this.borderRightColor=O(e,pm,A.borderRightColor),this.borderBottomColor=O(e,mm,A.borderBottomColor),this.borderLeftColor=O(e,Bm,A.borderLeftColor),this.borderTopLeftRadius=O(e,vm,A.borderTopLeftRadius),this.borderTopRightRadius=O(e,Cm,A.borderTopRightRadius),this.borderBottomRightRadius=O(e,wm,A.borderBottomRightRadius),this.borderBottomLeftRadius=O(e,bm,A.borderBottomLeftRadius),this.borderTopStyle=O(e,ym,A.borderTopStyle),this.borderRightStyle=O(e,Um,A.borderRightStyle),this.borderBottomStyle=O(e,Qm,A.borderBottomStyle),this.borderLeftStyle=O(e,Em,A.borderLeftStyle),this.borderTopWidth=O(e,Sm,A.borderTopWidth),this.borderRightWidth=O(e,km,A.borderRightWidth),this.borderBottomWidth=O(e,Tm,A.borderBottomWidth),this.borderLeftWidth=O(e,Fm,A.borderLeftWidth),this.boxShadow=O(e,y0,A.boxShadow),this.color=O(e,Im,A.color),this.direction=O(e,xm,A.direction),this.display=O(e,_m,A.display),this.float=O(e,Rm,A.cssFloat),this.fontFamily=O(e,h0,A.fontFamily),this.fontSize=O(e,f0,A.fontSize),this.fontStyle=O(e,m0,A.fontStyle),this.fontVariant=O(e,p0,A.fontVariant),this.fontWeight=O(e,g0,A.fontWeight),this.letterSpacing=O(e,Lm,A.letterSpacing),this.lineBreak=O(e,Dm,A.lineBreak),this.lineHeight=O(e,Hm,A.lineHeight),this.listStyleImage=O(e,Om,A.listStyleImage),this.listStylePosition=O(e,Mm,A.listStylePosition),this.listStyleType=O(e,is,A.listStyleType),this.marginTop=O(e,Nm,A.marginTop),this.marginRight=O(e,Km,A.marginRight),this.marginBottom=O(e,Vm,A.marginBottom),this.marginLeft=O(e,Gm,A.marginLeft),this.opacity=O(e,l0,A.opacity);var r=O(e,jm,A.overflow);this.overflowX=r[0],this.overflowY=r[r.length>1?1:0],this.overflowWrap=O(e,Wm,A.overflowWrap),this.paddingTop=O(e,Jm,A.paddingTop),this.paddingRight=O(e,Xm,A.paddingRight),this.paddingBottom=O(e,qm,A.paddingBottom),this.paddingLeft=O(e,Ym,A.paddingLeft),this.paintOrder=O(e,U0,A.paintOrder),this.position=O(e,Zm,A.position),this.textAlign=O(e,zm,A.textAlign),this.textDecorationColor=O(e,u0,(n=A.textDecorationColor)!==null&&n!==void 0?n:A.color),this.textDecorationLine=O(e,d0,(i=A.textDecorationLine)!==null&&i!==void 0?i:A.textDecoration),this.textShadow=O(e,$m,A.textShadow),this.textTransform=O(e,e0,A.textTransform),this.transform=O(e,A0,A.transform),this.transformOrigin=O(e,s0,A.transformOrigin),this.visibility=O(e,a0,A.visibility),this.webkitTextStrokeColor=O(e,Q0,A.webkitTextStrokeColor),this.webkitTextStrokeWidth=O(e,E0,A.webkitTextStrokeWidth),this.wordBreak=O(e,o0,A.wordBreak),this.zIndex=O(e,c0,A.zIndex),this.objectFit=O(e,S0,A.objectFit)}return t.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&this.visibility===0},t.prototype.isTransparent=function(){return NA(this.backgroundColor)},t.prototype.isTransformed=function(){return this.transform!==null},t.prototype.isPositioned=function(){return this.position!==0},t.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},t.prototype.isFloating=function(){return this.float!==0},t.prototype.isInlineLevel=function(){return be(this.display,4)||be(this.display,33554432)||be(this.display,268435456)||be(this.display,536870912)||be(this.display,67108864)||be(this.display,134217728)},t}(),F0=function(){function t(e,A){this.content=O(e,B0,A.content),this.quotes=O(e,b0,A.quotes)}return t}(),Ec=function(){function t(e,A){this.counterIncrement=O(e,v0,A.counterIncrement),this.counterReset=O(e,C0,A.counterReset)}return t}(),O=function(t,e,A){var n=new Vo,i=A!==null&&typeof A<"u"?A.toString():e.initialValue;n.write(i);var r=new Go(n.read());switch(e.type){case 2:var s=r.parseComponentValue();return e.parse(t,j(s)?s.value:e.initialValue);case 0:return e.parse(t,r.parseComponentValue());case 1:return e.parse(t,r.parseComponentValues());case 4:return r.parseComponentValue();case 3:switch(e.format){case"angle":return ii.parse(t,r.parseComponentValue());case"color":return VA.parse(t,r.parseComponentValue());case"image":return ns.parse(t,r.parseComponentValue());case"length":var a=r.parseComponentValue();return OA(a)?a:Se;case"length-percentage":var o=r.parseComponentValue();return ne(o)?o:Se;case"time":return Uc.parse(t,r.parseComponentValue())}break}},I0="data-html2canvas-debug",x0=function(t){var e=t.getAttribute(I0);switch(e){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}},rs=function(t,e){var A=x0(t);return A===1||e===A},CA=function(){function t(e,A){this.context=e,this.textNodes=[],this.elements=[],this.flags=0,rs(A,3),this.styles=new T0(e,window.getComputedStyle(A,null)),vs(A)&&(this.styles.animationDuration.some(function(n){return n>0})&&(A.style.animationDuration="0s"),this.styles.transform!==null&&(A.style.transform="none")),this.bounds=Hn(this.context,A),rs(A,4)&&(this.flags|=16)}return t}(),_0="AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=",Sc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",gn=typeof Uint8Array>"u"?[]:new Uint8Array(256),wi=0;wi<Sc.length;wi++)gn[Sc.charCodeAt(wi)]=wi;for(var P0=function(t){var e=t.length*.75,A=t.length,n,i=0,r,s,a,o;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);var c=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(e):new Array(e),l=Array.isArray(c)?c:new Uint8Array(c);for(n=0;n<A;n+=4)r=gn[t.charCodeAt(n)],s=gn[t.charCodeAt(n+1)],a=gn[t.charCodeAt(n+2)],o=gn[t.charCodeAt(n+3)],l[i++]=r<<2|s>>4,l[i++]=(s&15)<<4|a>>2,l[i++]=(a&3)<<6|o&63;return c},R0=function(t){for(var e=t.length,A=[],n=0;n<e;n+=2)A.push(t[n+1]<<8|t[n]);return A},L0=function(t){for(var e=t.length,A=[],n=0;n<e;n+=4)A.push(t[n+3]<<24|t[n+2]<<16|t[n+1]<<8|t[n]);return A},lt=5,ss=6+5,as=2,D0=ss-lt,kc=65536>>lt,H0=1<<lt,os=H0-1,O0=1024>>lt,M0=kc+O0,N0=M0,K0=32,V0=N0+K0,G0=65536>>ss,j0=1<<D0,W0=j0-1,Tc=function(t,e,A){return t.slice?t.slice(e,A):new Uint16Array(Array.prototype.slice.call(t,e,A))},J0=function(t,e,A){return t.slice?t.slice(e,A):new Uint32Array(Array.prototype.slice.call(t,e,A))},X0=function(t,e){var A=P0(t),n=Array.isArray(A)?L0(A):new Uint32Array(A),i=Array.isArray(A)?R0(A):new Uint16Array(A),r=24,s=Tc(i,r/2,n[4]/2),a=n[5]===2?Tc(i,(r+n[4])/2):J0(n,Math.ceil((r+n[4])/4));return new q0(n[0],n[1],n[2],n[3],s,a)},q0=function(){function t(e,A,n,i,r,s){this.initialValue=e,this.errorValue=A,this.highStart=n,this.highValueIndex=i,this.index=r,this.data=s}return t.prototype.get=function(e){var A;if(e>=0){if(e<55296||e>56319&&e<=65535)return A=this.index[e>>lt],A=(A<<as)+(e&os),this.data[A];if(e<=65535)return A=this.index[kc+(e-55296>>lt)],A=(A<<as)+(e&os),this.data[A];if(e<this.highStart)return A=V0-G0+(e>>ss),A=this.index[A],A+=e>>lt&W0,A=this.index[A],A=(A<<as)+(e&os),this.data[A];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},t}(),Fc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Y0=typeof Uint8Array>"u"?[]:new Uint8Array(256),bi=0;bi<Fc.length;bi++)Y0[Fc.charCodeAt(bi)]=bi;var z0=1,cs=2,ls=3,Ic=4,xc=5,Z0=7,_c=8,us=9,ds=10,Pc=11,Rc=12,Lc=13,Dc=14,hs=15,$0=function(t){for(var e=[],A=0,n=t.length;A<n;){var i=t.charCodeAt(A++);if(i>=55296&&i<=56319&&A<n){var r=t.charCodeAt(A++);(r&64512)===56320?e.push(((i&1023)<<10)+(r&1023)+65536):(e.push(i),A--)}else e.push(i)}return e},eB=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,t);var A=t.length;if(!A)return"";for(var n=[],i=-1,r="";++i<A;){var s=t[i];s<=65535?n.push(s):(s-=65536,n.push((s>>10)+55296,s%1024+56320)),(i+1===A||n.length>16384)&&(r+=String.fromCharCode.apply(String,n),n.length=0)}return r},AB=X0(_0),Ze="×",fs="÷",tB=function(t){return AB.get(t)},nB=function(t,e,A){var n=A-2,i=e[n],r=e[A-1],s=e[A];if(r===cs&&s===ls)return Ze;if(r===cs||r===ls||r===Ic||s===cs||s===ls||s===Ic)return fs;if(r===_c&&[_c,us,Pc,Rc].indexOf(s)!==-1||(r===Pc||r===us)&&(s===us||s===ds)||(r===Rc||r===ds)&&s===ds||s===Lc||s===xc||s===Z0||r===z0)return Ze;if(r===Lc&&s===Dc){for(;i===xc;)i=e[--n];if(i===Dc)return Ze}if(r===hs&&s===hs){for(var a=0;i===hs;)a++,i=e[--n];if(a%2===0)return Ze}return fs},iB=function(t){var e=$0(t),A=e.length,n=0,i=0,r=e.map(tB);return{next:function(){if(n>=A)return{done:!0,value:null};for(var s=Ze;n<A&&(s=nB(e,r,++n))===Ze;);if(s!==Ze||n===A){var a=eB.apply(null,e.slice(i,n));return i=n,{value:a,done:!1}}return{done:!0,value:null}}}},rB=function(t){for(var e=iB(t),A=[],n;!(n=e.next()).done;)n.value&&A.push(n.value.slice());return A},sB=function(t){var e=123;if(t.createRange){var A=t.createRange();if(A.getBoundingClientRect){var n=t.createElement("boundtest");n.style.height="".concat(e,"px"),n.style.display="block",t.body.appendChild(n),A.selectNode(n);var i=A.getBoundingClientRect(),r=Math.round(i.height);if(t.body.removeChild(n),r===e)return!0}}return!1},aB=function(t){var e=t.createElement("boundtest");e.style.width="50px",e.style.display="block",e.style.fontSize="12px",e.style.letterSpacing="0px",e.style.wordSpacing="0px",t.body.appendChild(e);var A=t.createRange();e.innerHTML=typeof"".repeat=="function"?"&#128104;".repeat(10):"";var n=e.firstChild,i=On(n.data).map(function(o){return he(o)}),r=0,s={},a=i.every(function(o,c){A.setStart(n,r),A.setEnd(n,r+o.length);var l=A.getBoundingClientRect();r+=o.length;var u=l.x>s.x||l.y>s.y;return s=l,c===0?!0:u});return t.body.removeChild(e),a},oB=function(){return typeof new Image().crossOrigin<"u"},cB=function(){return typeof new XMLHttpRequest().responseType=="string"},lB=function(t){var e=new Image,A=t.createElement("canvas"),n=A.getContext("2d");if(!n)return!1;e.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{n.drawImage(e,0,0),A.toDataURL()}catch{return!1}return!0},Hc=function(t){return t[0]===0&&t[1]===255&&t[2]===0&&t[3]===255},uB=function(t){var e=t.createElement("canvas"),A=100;e.width=A,e.height=A;var n=e.getContext("2d");if(!n)return Promise.reject(!1);n.fillStyle="rgb(0, 255, 0)",n.fillRect(0,0,A,A);var i=new Image,r=e.toDataURL();i.src=r;var s=gs(A,A,0,0,i);return n.fillStyle="red",n.fillRect(0,0,A,A),Oc(s).then(function(a){n.drawImage(a,0,0);var o=n.getImageData(0,0,A,A).data;n.fillStyle="red",n.fillRect(0,0,A,A);var c=t.createElement("div");return c.style.backgroundImage="url(".concat(r,")"),c.style.height="".concat(A,"px"),Hc(o)?Oc(gs(A,A,0,0,c)):Promise.reject(!1)}).then(function(a){return n.drawImage(a,0,0),Hc(n.getImageData(0,0,A,A).data)}).catch(function(){return!1})},gs=function(t,e,A,n,i){var r="http://www.w3.org/2000/svg",s=document.createElementNS(r,"svg"),a=document.createElementNS(r,"foreignObject");return s.setAttributeNS(null,"width",t.toString()),s.setAttributeNS(null,"height",e.toString()),a.setAttributeNS(null,"width","100%"),a.setAttributeNS(null,"height","100%"),a.setAttributeNS(null,"x",A.toString()),a.setAttributeNS(null,"y",n.toString()),a.setAttributeNS(null,"externalResourcesRequired","true"),s.appendChild(a),a.appendChild(i),s},Oc=function(t){return new Promise(function(e,A){var n=new Image;n.onload=function(){return e(n)},n.onerror=A,n.src="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent(new XMLSerializer().serializeToString(t)))})},ke={get SUPPORT_RANGE_BOUNDS(){var t=sB(document);return Object.defineProperty(ke,"SUPPORT_RANGE_BOUNDS",{value:t}),t},get SUPPORT_WORD_BREAKING(){var t=ke.SUPPORT_RANGE_BOUNDS&&aB(document);return Object.defineProperty(ke,"SUPPORT_WORD_BREAKING",{value:t}),t},get SUPPORT_SVG_DRAWING(){var t=lB(document);return Object.defineProperty(ke,"SUPPORT_SVG_DRAWING",{value:t}),t},get SUPPORT_FOREIGNOBJECT_DRAWING(){var t=typeof Array.from=="function"&&typeof window.fetch=="function"?uB(document):Promise.resolve(!1);return Object.defineProperty(ke,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:t}),t},get SUPPORT_CORS_IMAGES(){var t=oB();return Object.defineProperty(ke,"SUPPORT_CORS_IMAGES",{value:t}),t},get SUPPORT_RESPONSE_TYPE(){var t=cB();return Object.defineProperty(ke,"SUPPORT_RESPONSE_TYPE",{value:t}),t},get SUPPORT_CORS_XHR(){var t="withCredentials"in new XMLHttpRequest;return Object.defineProperty(ke,"SUPPORT_CORS_XHR",{value:t}),t},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var t=!!(typeof Intl<"u"&&Intl.Segmenter);return Object.defineProperty(ke,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:t}),t}},pn=function(){function t(e,A){this.text=e,this.bounds=A}return t}(),dB=function(t,e,A,n){var i=gB(e,A),r=[],s=0;return i.forEach(function(a){if(A.textDecorationLine.length||a.trim().length>0)if(ke.SUPPORT_RANGE_BOUNDS){var o=Mc(n,s,a.length).getClientRects();if(o.length>1){var c=ps(a),l=0;c.forEach(function(d){r.push(new pn(d,EA.fromDOMRectList(t,Mc(n,l+s,d.length).getClientRects()))),l+=d.length})}else r.push(new pn(a,EA.fromDOMRectList(t,o)))}else{var u=n.splitText(a.length);r.push(new pn(a,hB(t,n))),n=u}else ke.SUPPORT_RANGE_BOUNDS||(n=n.splitText(a.length));s+=a.length}),r},hB=function(t,e){var A=e.ownerDocument;if(A){var n=A.createElement("html2canvaswrapper");n.appendChild(e.cloneNode(!0));var i=e.parentNode;if(i){i.replaceChild(n,e);var r=Hn(t,n);return n.firstChild&&i.replaceChild(n.firstChild,n),r}}return EA.EMPTY},Mc=function(t,e,A){var n=t.ownerDocument;if(!n)throw new Error("Node has no owner document");var i=n.createRange();return i.setStart(t,e),i.setEnd(t,e+A),i},ps=function(t){if(ke.SUPPORT_NATIVE_TEXT_SEGMENTATION){var e=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(e.segment(t)).map(function(A){return A.segment})}return rB(t)},fB=function(t,e){if(ke.SUPPORT_NATIVE_TEXT_SEGMENTATION){var A=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(A.segment(t)).map(function(n){return n.segment})}return mB(t,e)},gB=function(t,e){return e.letterSpacing!==0?ps(t):fB(t,e)},pB=[32,160,4961,65792,65793,4153,4241],mB=function(t,e){for(var A=Yf(t,{lineBreak:e.lineBreak,wordBreak:e.overflowWrap==="break-word"?"break-word":e.wordBreak}),n=[],i,r=function(){if(i.value){var s=i.value.slice(),a=On(s),o="";a.forEach(function(c){pB.indexOf(c)===-1?o+=he(c):(o.length&&n.push(o),n.push(he(c)),o="")}),o.length&&n.push(o)}};!(i=A.next()).done;)r();return n},BB=function(){function t(e,A,n){this.text=vB(A.data,n.textTransform),this.textBounds=dB(e,this.text,n,A)}return t}(),vB=function(t,e){switch(e){case 1:return t.toLowerCase();case 3:return t.replace(CB,wB);case 2:return t.toUpperCase();default:return t}},CB=/(^|\s|:|-|\(|\))([a-z])/g,wB=function(t,e,A){return t.length>0?e+A.toUpperCase():t},Nc=function(t){iA(e,t);function e(A,n){var i=t.call(this,A,n)||this;return i.src=n.currentSrc||n.src,i.intrinsicWidth=n.naturalWidth,i.intrinsicHeight=n.naturalHeight,i.context.cache.addImage(i.src),i}return e}(CA),Kc=function(t){iA(e,t);function e(A,n){var i=t.call(this,A,n)||this;return i.canvas=n,i.intrinsicWidth=n.width,i.intrinsicHeight=n.height,i}return e}(CA),Vc=function(t){iA(e,t);function e(A,n){var i=t.call(this,A,n)||this,r=new XMLSerializer,s=Hn(A,n);return n.setAttribute("width","".concat(s.width,"px")),n.setAttribute("height","".concat(s.height,"px")),i.svg="data:image/svg+xml,".concat(encodeURIComponent(r.serializeToString(n))),i.intrinsicWidth=n.width.baseVal.value,i.intrinsicHeight=n.height.baseVal.value,i.context.cache.addImage(i.svg),i}return e}(CA),Gc=function(t){iA(e,t);function e(A,n){var i=t.call(this,A,n)||this;return i.value=n.value,i}return e}(CA),ms=function(t){iA(e,t);function e(A,n){var i=t.call(this,A,n)||this;return i.start=n.start,i.reversed=typeof n.reversed=="boolean"&&n.reversed===!0,i}return e}(CA),bB=[{type:15,flags:0,unit:"px",number:3}],yB=[{type:16,flags:0,number:50}],UB=function(t){return t.width>t.height?new EA(t.left+(t.width-t.height)/2,t.top,t.height,t.height):t.width<t.height?new EA(t.left,t.top+(t.height-t.width)/2,t.width,t.width):t},QB=function(t){var e=t.type===EB?new Array(t.value.length+1).join("•"):t.value;return e.length===0?t.placeholder||"":e},yi="checkbox",Ui="radio",EB="password",jc=707406591,Bs=function(t){iA(e,t);function e(A,n){var i=t.call(this,A,n)||this;switch(i.type=n.type.toLowerCase(),i.checked=n.checked,i.value=QB(n),(i.type===yi||i.type===Ui)&&(i.styles.backgroundColor=3739148031,i.styles.borderTopColor=i.styles.borderRightColor=i.styles.borderBottomColor=i.styles.borderLeftColor=2779096575,i.styles.borderTopWidth=i.styles.borderRightWidth=i.styles.borderBottomWidth=i.styles.borderLeftWidth=1,i.styles.borderTopStyle=i.styles.borderRightStyle=i.styles.borderBottomStyle=i.styles.borderLeftStyle=1,i.styles.backgroundClip=[0],i.styles.backgroundOrigin=[0],i.bounds=UB(i.bounds)),i.type){case yi:i.styles.borderTopRightRadius=i.styles.borderTopLeftRadius=i.styles.borderBottomRightRadius=i.styles.borderBottomLeftRadius=bB;break;case Ui:i.styles.borderTopRightRadius=i.styles.borderTopLeftRadius=i.styles.borderBottomRightRadius=i.styles.borderBottomLeftRadius=yB;break}return i}return e}(CA),Wc=function(t){iA(e,t);function e(A,n){var i=t.call(this,A,n)||this,r=n.options[n.selectedIndex||0];return i.value=r&&r.text||"",i}return e}(CA),Jc=function(t){iA(e,t);function e(A,n){var i=t.call(this,A,n)||this;return i.value=n.value,i}return e}(CA),Xc=function(t){iA(e,t);function e(A,n){var i=t.call(this,A,n)||this;i.src=n.src,i.width=parseInt(n.width,10)||0,i.height=parseInt(n.height,10)||0,i.backgroundColor=i.styles.backgroundColor;try{if(n.contentWindow&&n.contentWindow.document&&n.contentWindow.document.documentElement){i.tree=Yc(A,n.contentWindow.document.documentElement);var r=n.contentWindow.document.documentElement?Et(A,getComputedStyle(n.contentWindow.document.documentElement).backgroundColor):vA.TRANSPARENT,s=n.contentWindow.document.body?Et(A,getComputedStyle(n.contentWindow.document.body).backgroundColor):vA.TRANSPARENT;i.backgroundColor=NA(r)?NA(s)?i.styles.backgroundColor:s:r}}catch{}return i}return e}(CA),SB=["OL","UL","MENU"],Qi=function(t,e,A,n){for(var i=e.firstChild,r=void 0;i;i=r)if(r=i.nextSibling,zc(i)&&i.data.length>0)A.textNodes.push(new BB(t,i,A.styles));else if(kt(i))if(nl(i)&&i.assignedNodes)i.assignedNodes().forEach(function(a){return Qi(t,a,A,n)});else{var s=qc(t,i);s.styles.isVisible()&&(kB(i,s,n)?s.flags|=4:TB(s.styles)&&(s.flags|=2),SB.indexOf(i.tagName)!==-1&&(s.flags|=8),A.elements.push(s),i.slot,i.shadowRoot?Qi(t,i.shadowRoot,s,n):!Si(i)&&!Zc(i)&&!ki(i)&&Qi(t,i,s,n))}},qc=function(t,e){return ws(e)?new Nc(t,e):$c(e)?new Kc(t,e):Zc(e)?new Vc(t,e):FB(e)?new Gc(t,e):IB(e)?new ms(t,e):xB(e)?new Bs(t,e):ki(e)?new Wc(t,e):Si(e)?new Jc(t,e):Al(e)?new Xc(t,e):new CA(t,e)},Yc=function(t,e){var A=qc(t,e);return A.flags|=4,Qi(t,e,A,A),A},kB=function(t,e,A){return e.styles.isPositionedWithZIndex()||e.styles.opacity<1||e.styles.isTransformed()||Cs(t)&&A.styles.isTransparent()},TB=function(t){return t.isPositioned()||t.isFloating()},zc=function(t){return t.nodeType===Node.TEXT_NODE},kt=function(t){return t.nodeType===Node.ELEMENT_NODE},vs=function(t){return kt(t)&&typeof t.style<"u"&&!Ei(t)},Ei=function(t){return typeof t.className=="object"},FB=function(t){return t.tagName==="LI"},IB=function(t){return t.tagName==="OL"},xB=function(t){return t.tagName==="INPUT"},_B=function(t){return t.tagName==="HTML"},Zc=function(t){return t.tagName==="svg"},Cs=function(t){return t.tagName==="BODY"},$c=function(t){return t.tagName==="CANVAS"},el=function(t){return t.tagName==="VIDEO"},ws=function(t){return t.tagName==="IMG"},Al=function(t){return t.tagName==="IFRAME"},tl=function(t){return t.tagName==="STYLE"},PB=function(t){return t.tagName==="SCRIPT"},Si=function(t){return t.tagName==="TEXTAREA"},ki=function(t){return t.tagName==="SELECT"},nl=function(t){return t.tagName==="SLOT"},il=function(t){return t.tagName.indexOf("-")>0},RB=function(){function t(){this.counters={}}return t.prototype.getCounterValue=function(e){var A=this.counters[e];return A&&A.length?A[A.length-1]:1},t.prototype.getCounterValues=function(e){var A=this.counters[e];return A||[]},t.prototype.pop=function(e){var A=this;e.forEach(function(n){return A.counters[n].pop()})},t.prototype.parse=function(e){var A=this,n=e.counterIncrement,i=e.counterReset,r=!0;n!==null&&n.forEach(function(a){var o=A.counters[a.counter];o&&a.increment!==0&&(r=!1,o.length||o.push(1),o[Math.max(0,o.length-1)]+=a.increment)});var s=[];return r&&i.forEach(function(a){var o=A.counters[a.counter];s.push(a.counter),o||(o=A.counters[a.counter]=[]),o.push(a.reset)}),s},t}(),rl={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},sl={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},LB={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},DB={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},Tt=function(t,e,A,n,i,r){return t<e||t>A?Bn(t,i,r.length>0):n.integers.reduce(function(s,a,o){for(;t>=a;)t-=a,s+=n.values[o];return s},"")+r},al=function(t,e,A,n){var i="";do A||t--,i=n(t)+i,t/=e;while(t*e>=e);return i},fe=function(t,e,A,n,i){var r=A-e+1;return(t<0?"-":"")+(al(Math.abs(t),r,n,function(s){return he(Math.floor(s%r)+e)})+i)},ut=function(t,e,A){A===void 0&&(A=". ");var n=e.length;return al(Math.abs(t),n,!1,function(i){return e[Math.floor(i%n)]})+A},Ft=1,GA=2,jA=4,mn=8,kA=function(t,e,A,n,i,r){if(t<-9999||t>9999)return Bn(t,4,i.length>0);var s=Math.abs(t),a=i;if(s===0)return e[0]+a;for(var o=0;s>0&&o<=4;o++){var c=s%10;c===0&&be(r,Ft)&&a!==""?a=e[c]+a:c>1||c===1&&o===0||c===1&&o===1&&be(r,GA)||c===1&&o===1&&be(r,jA)&&t>100||c===1&&o>1&&be(r,mn)?a=e[c]+(o>0?A[o-1]:"")+a:c===1&&o>0&&(a=A[o-1]+a),s=Math.floor(s/10)}return(t<0?n:"")+a},ol="十百千萬",cl="拾佰仟萬",ll="マイナス",bs="마이너스",Bn=function(t,e,A){var n=A?". ":"",i=A?"、":"",r=A?", ":"",s=A?" ":"";switch(e){case 0:return"•"+s;case 1:return"◦"+s;case 2:return"◾"+s;case 5:var a=fe(t,48,57,!0,n);return a.length<4?"0".concat(a):a;case 4:return ut(t,"〇一二三四五六七八九",i);case 6:return Tt(t,1,3999,rl,3,n).toLowerCase();case 7:return Tt(t,1,3999,rl,3,n);case 8:return fe(t,945,969,!1,n);case 9:return fe(t,97,122,!1,n);case 10:return fe(t,65,90,!1,n);case 11:return fe(t,1632,1641,!0,n);case 12:case 49:return Tt(t,1,9999,sl,3,n);case 35:return Tt(t,1,9999,sl,3,n).toLowerCase();case 13:return fe(t,2534,2543,!0,n);case 14:case 30:return fe(t,6112,6121,!0,n);case 15:return ut(t,"子丑寅卯辰巳午未申酉戌亥",i);case 16:return ut(t,"甲乙丙丁戊己庚辛壬癸",i);case 17:case 48:return kA(t,"零一二三四五六七八九",ol,"負",i,GA|jA|mn);case 47:return kA(t,"零壹貳參肆伍陸柒捌玖",cl,"負",i,Ft|GA|jA|mn);case 42:return kA(t,"零一二三四五六七八九",ol,"负",i,GA|jA|mn);case 41:return kA(t,"零壹贰叁肆伍陆柒捌玖",cl,"负",i,Ft|GA|jA|mn);case 26:return kA(t,"〇一二三四五六七八九","十百千万",ll,i,0);case 25:return kA(t,"零壱弐参四伍六七八九","拾百千万",ll,i,Ft|GA|jA);case 31:return kA(t,"영일이삼사오육칠팔구","십백천만",bs,r,Ft|GA|jA);case 33:return kA(t,"零一二三四五六七八九","十百千萬",bs,r,0);case 32:return kA(t,"零壹貳參四五六七八九","拾百千",bs,r,Ft|GA|jA);case 18:return fe(t,2406,2415,!0,n);case 20:return Tt(t,1,19999,DB,3,n);case 21:return fe(t,2790,2799,!0,n);case 22:return fe(t,2662,2671,!0,n);case 52:return Tt(t,1,10999,LB,3,n);case 23:return ut(t,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return ut(t,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return fe(t,3302,3311,!0,n);case 28:return ut(t,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",i);case 29:return ut(t,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",i);case 34:return fe(t,3792,3801,!0,n);case 37:return fe(t,6160,6169,!0,n);case 38:return fe(t,4160,4169,!0,n);case 39:return fe(t,2918,2927,!0,n);case 40:return fe(t,1776,1785,!0,n);case 43:return fe(t,3046,3055,!0,n);case 44:return fe(t,3174,3183,!0,n);case 45:return fe(t,3664,3673,!0,n);case 46:return fe(t,3872,3881,!0,n);case 3:default:return fe(t,48,57,!0,n)}},ul="data-html2canvas-ignore",dl=function(){function t(e,A,n){if(this.context=e,this.options=n,this.scrolledElements=[],this.referenceElement=A,this.counters=new RB,this.quoteDepth=0,!A.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(A.ownerDocument.documentElement,!1)}return t.prototype.toIFrame=function(e,A){var n=this,i=HB(e,A);if(!i.contentWindow)return Promise.reject("Unable to find iframe window");var r=e.defaultView.pageXOffset,s=e.defaultView.pageYOffset,a=i.contentWindow,o=a.document,c=NB(i).then(function(){return Re(n,void 0,void 0,function(){var u,d;return xe(this,function(h){switch(h.label){case 0:return this.scrolledElements.forEach(jB),a&&(a.scrollTo(A.left,A.top),/(iPad|iPhone|iPod)/g.test(navigator.userAgent)&&(a.scrollY!==A.top||a.scrollX!==A.left)&&(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(a.scrollX-A.left,a.scrollY-A.top,0,0))),u=this.options.onclone,d=this.clonedReferenceElement,typeof d>"u"?[2,Promise.reject("Error finding the ".concat(this.referenceElement.nodeName," in the cloned document"))]:o.fonts&&o.fonts.ready?[4,o.fonts.ready]:[3,2];case 1:h.sent(),h.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,MB(o)]:[3,4];case 3:h.sent(),h.label=4;case 4:return typeof u=="function"?[2,Promise.resolve().then(function(){return u(o,d)}).then(function(){return i})]:[2,i]}})})}),l=o.adoptNode(this.documentElement);return YB(l,o),o.open(),o.write("".concat(VB(document.doctype),"<html></html>")),GB(this.referenceElement.ownerDocument,r,s),o.replaceChild(l,o.documentElement),o.close(),c},t.prototype.createElementClone=function(e){if(rs(e,2),$c(e))return this.createCanvasClone(e);if(el(e))return this.createVideoClone(e);if(tl(e))return this.createStyleClone(e);var A=e.cloneNode(!1);return ws(A)&&(ws(e)&&e.currentSrc&&e.currentSrc!==e.src&&(A.src=e.currentSrc,A.srcset=""),A.loading==="lazy"&&(A.loading="eager")),il(A)?this.createCustomElementClone(A):A},t.prototype.createCustomElementClone=function(e){var A=document.createElement("html2canvascustomelement");return ys(e.style,A),A},t.prototype.createStyleClone=function(e){try{var A=e.sheet;if(A&&A.cssRules){var n=[].slice.call(A.cssRules,0).reduce(function(r,s){return s&&typeof s.cssText=="string"?r+s.cssText:r},""),i=e.cloneNode(!1);return i.textContent=n,i}}catch(r){if(this.context.logger.error("Unable to access cssRules property",r),r.name!=="SecurityError")throw r}return e.cloneNode(!1)},t.prototype.createCanvasClone=function(e){var A;if(this.options.inlineImages&&e.ownerDocument){var n=e.ownerDocument.createElement("img");try{return n.src=e.toDataURL(),n}catch{this.context.logger.info("Unable to inline canvas contents, canvas is tainted",e)}}var i=e.cloneNode(!1);try{i.width=e.width,i.height=e.height;var r=e.getContext("2d"),s=i.getContext("2d",{willReadFrequently:!0});if(s)if(!this.options.allowTaint&&r)s.putImageData(r.getImageData(0,0,e.width,e.height),0,0);else{var a=(A=e.getContext("webgl2"))!==null&&A!==void 0?A:e.getContext("webgl");if(a){var o=a.getContextAttributes();(o==null?void 0:o.preserveDrawingBuffer)===!1&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",e)}s.drawImage(e,0,0)}return i}catch{this.context.logger.info("Unable to clone canvas as it is tainted",e)}return i},t.prototype.createVideoClone=function(e){var A=e.ownerDocument.createElement("canvas");A.width=e.offsetWidth,A.height=e.offsetHeight;var n=A.getContext("2d");try{return n&&(n.drawImage(e,0,0,A.width,A.height),this.options.allowTaint||n.getImageData(0,0,A.width,A.height)),A}catch{this.context.logger.info("Unable to clone video as it is tainted",e)}var i=e.ownerDocument.createElement("canvas");return i.width=e.offsetWidth,i.height=e.offsetHeight,i},t.prototype.appendChildNode=function(e,A,n){(!kt(A)||!PB(A)&&!A.hasAttribute(ul)&&(typeof this.options.ignoreElements!="function"||!this.options.ignoreElements(A)))&&(!this.options.copyStyles||!kt(A)||!tl(A))&&e.appendChild(this.cloneNode(A,n))},t.prototype.cloneChildNodes=function(e,A,n){for(var i=this,r=e.shadowRoot?e.shadowRoot.firstChild:e.firstChild;r;r=r.nextSibling)if(kt(r)&&nl(r)&&typeof r.assignedNodes=="function"){var s=r.assignedNodes();s.length&&s.forEach(function(a){return i.appendChildNode(A,a,n)})}else this.appendChildNode(A,r,n)},t.prototype.cloneNode=function(e,A){if(zc(e))return document.createTextNode(e.data);if(!e.ownerDocument)return e.cloneNode(!1);var n=e.ownerDocument.defaultView;if(n&&kt(e)&&(vs(e)||Ei(e))){var i=this.createElementClone(e);i.style.transitionProperty="none";var r=n.getComputedStyle(e),s=n.getComputedStyle(e,":before"),a=n.getComputedStyle(e,":after");this.referenceElement===e&&vs(i)&&(this.clonedReferenceElement=i),Cs(i)&&XB(i);var o=this.counters.parse(new Ec(this.context,r)),c=this.resolvePseudoContent(e,i,s,vn.BEFORE);il(e)&&(A=!0),el(e)||this.cloneChildNodes(e,i,A),c&&i.insertBefore(c,i.firstChild);var l=this.resolvePseudoContent(e,i,a,vn.AFTER);return l&&i.appendChild(l),this.counters.pop(o),(r&&(this.options.copyStyles||Ei(e))&&!Al(e)||A)&&ys(r,i),(e.scrollTop!==0||e.scrollLeft!==0)&&this.scrolledElements.push([i,e.scrollLeft,e.scrollTop]),(Si(e)||ki(e))&&(Si(i)||ki(i))&&(i.value=e.value),i}return e.cloneNode(!1)},t.prototype.resolvePseudoContent=function(e,A,n,i){var r=this;if(n){var s=n.content,a=A.ownerDocument;if(!(!a||!s||s==="none"||s==="-moz-alt-content"||n.display==="none")){this.counters.parse(new Ec(this.context,n));var o=new F0(this.context,n),c=a.createElement("html2canvaspseudoelement");ys(n,c),o.content.forEach(function(u){if(u.type===0)c.appendChild(a.createTextNode(u.value));else if(u.type===22){var d=a.createElement("img");d.src=u.value,d.style.opacity="1",c.appendChild(d)}else if(u.type===18){if(u.name==="attr"){var h=u.values.filter(j);h.length&&c.appendChild(a.createTextNode(e.getAttribute(h[0].value)||""))}else if(u.name==="counter"){var g=u.values.filter(Ee),f=g[0],m=g[1];if(f&&j(f)){var B=r.counters.getCounterValue(f.value),b=m&&j(m)?is.parse(r.context,m.value):3;c.appendChild(a.createTextNode(Bn(B,b,!1)))}}else if(u.name==="counters"){var U=u.values.filter(Ee),f=U[0],C=U[1],m=U[2];if(f&&j(f)){var w=r.counters.getCounterValues(f.value),y=m&&j(m)?is.parse(r.context,m.value):3,E=C&&C.type===0?C.value:"",F=w.map(function(R){return Bn(R,y,!1)}).join(E);c.appendChild(a.createTextNode(F))}}}else if(u.type===20)switch(u.value){case"open-quote":c.appendChild(a.createTextNode(Qc(o.quotes,r.quoteDepth++,!0)));break;case"close-quote":c.appendChild(a.createTextNode(Qc(o.quotes,--r.quoteDepth,!1)));break;default:c.appendChild(a.createTextNode(u.value))}}),c.className="".concat(Us," ").concat(Qs);var l=i===vn.BEFORE?" ".concat(Us):" ".concat(Qs);return Ei(A)?A.className.baseValue+=l:A.className+=l,c}}},t.destroy=function(e){return e.parentNode?(e.parentNode.removeChild(e),!0):!1},t}(),vn;(function(t){t[t.BEFORE=0]="BEFORE",t[t.AFTER=1]="AFTER"})(vn||(vn={}));var HB=function(t,e){var A=t.createElement("iframe");return A.className="html2canvas-container",A.style.visibility="hidden",A.style.position="fixed",A.style.left="-10000px",A.style.top="0px",A.style.border="0",A.width=e.width.toString(),A.height=e.height.toString(),A.scrolling="no",A.setAttribute(ul,"true"),t.body.appendChild(A),A},OB=function(t){return new Promise(function(e){if(t.complete){e();return}if(!t.src){e();return}t.onload=e,t.onerror=e})},MB=function(t){return Promise.all([].slice.call(t.images,0).map(OB))},NB=function(t){return new Promise(function(e,A){var n=t.contentWindow;if(!n)return A("No window assigned for iframe");var i=n.document;n.onload=t.onload=function(){n.onload=t.onload=null;var r=setInterval(function(){i.body.childNodes.length>0&&i.readyState==="complete"&&(clearInterval(r),e(t))},50)}})},KB=["all","d","content"],ys=function(t,e){for(var A=t.length-1;A>=0;A--){var n=t.item(A);KB.indexOf(n)===-1&&e.style.setProperty(n,t.getPropertyValue(n))}return e},VB=function(t){var e="";return t&&(e+="<!DOCTYPE ",t.name&&(e+=t.name),t.internalSubset&&(e+=t.internalSubset),t.publicId&&(e+='"'.concat(t.publicId,'"')),t.systemId&&(e+='"'.concat(t.systemId,'"')),e+=">"),e},GB=function(t,e,A){t&&t.defaultView&&(e!==t.defaultView.pageXOffset||A!==t.defaultView.pageYOffset)&&t.defaultView.scrollTo(e,A)},jB=function(t){var e=t[0],A=t[1],n=t[2];e.scrollLeft=A,e.scrollTop=n},WB=":before",JB=":after",Us="___html2canvas___pseudoelement_before",Qs="___html2canvas___pseudoelement_after",hl=`{
5
+ */var Nc=function(n,e){return Nc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])},Nc(n,e)};function tn(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Nc(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Kc=function(){return Kc=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var A in t)Object.prototype.hasOwnProperty.call(t,A)&&(e[A]=t[A])}return e},Kc.apply(this,arguments)};function Ut(n,e,t,r){function i(A){return A instanceof t?A:new t(function(s){s(A)})}return new(t||(t=Promise))(function(A,s){function o(u){try{c(r.next(u))}catch(l){s(l)}}function a(u){try{c(r.throw(u))}catch(l){s(l)}}function c(u){u.done?A(u.value):i(u.value).then(o,a)}c((r=r.apply(n,e||[])).next())})}function Bt(n,e){var t={label:0,sent:function(){if(A[0]&1)throw A[1];return A[1]},trys:[],ops:[]},r,i,A,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(c){return function(u){return a([c,u])}}function a(c){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(t=0)),t;)try{if(r=1,i&&(A=c[0]&2?i.return:c[0]?i.throw||((A=i.return)&&A.call(i),0):i.next)&&!(A=A.call(i,c[1])).done)return A;switch(i=0,A&&(c=[c[0]&2,A.value]),c[0]){case 0:case 1:A=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,i=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(A=t.trys,!(A=A.length>0&&A[A.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!A||c[1]>A[0]&&c[1]<A[3])){t.label=c[1];break}if(c[0]===6&&t.label<A[1]){t.label=A[1],A=c;break}if(A&&t.label<A[2]){t.label=A[2],t.ops.push(c);break}A[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(n,t)}catch(u){c=[6,u],i=0}finally{r=A=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Ts(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,A;r<i;r++)(A||!(r in e))&&(A||(A=Array.prototype.slice.call(e,0,r)),A[r]=e[r]);return n.concat(A||Array.prototype.slice.call(e))}typeof SuppressedError=="function"&&SuppressedError;for(var Qn=function(){function n(e,t,r,i){this.left=e,this.top=t,this.width=r,this.height=i}return n.prototype.add=function(e,t,r,i){return new n(this.left+e,this.top+t,this.width+r,this.height+i)},n.fromClientRect=function(e,t){return new n(t.left+e.windowBounds.left,t.top+e.windowBounds.top,t.width,t.height)},n.fromDOMRectList=function(e,t){var r=Array.from(t).find(function(i){return i.width!==0});return r?new n(r.left+e.windowBounds.left,r.top+e.windowBounds.top,r.width,r.height):n.EMPTY},n.EMPTY=new n(0,0,0,0),n}(),Is=function(n,e){return Qn.fromClientRect(n,e.getBoundingClientRect())},WC=function(n){var e=n.body,t=n.documentElement;if(!e||!t)throw new Error("Unable to get document size");var r=Math.max(Math.max(e.scrollWidth,t.scrollWidth),Math.max(e.offsetWidth,t.offsetWidth),Math.max(e.clientWidth,t.clientWidth)),i=Math.max(Math.max(e.scrollHeight,t.scrollHeight),Math.max(e.offsetHeight,t.offsetHeight),Math.max(e.clientHeight,t.clientHeight));return new Qn(0,0,r,i)},Fs=function(n){for(var e=[],t=0,r=n.length;t<r;){var i=n.charCodeAt(t++);if(i>=55296&&i<=56319&&t<r){var A=n.charCodeAt(t++);(A&64512)===56320?e.push(((i&1023)<<10)+(A&1023)+65536):(e.push(i),t--)}else e.push(i)}return e},$e=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,n);var t=n.length;if(!t)return"";for(var r=[],i=-1,A="";++i<t;){var s=n[i];s<=65535?r.push(s):(s-=65536,r.push((s>>10)+55296,s%1024+56320)),(i+1===t||r.length>16384)&&(A+=String.fromCharCode.apply(String,r),r.length=0)}return A},Rp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",qC=typeof Uint8Array>"u"?[]:new Uint8Array(256),xs=0;xs<Rp.length;xs++)qC[Rp.charCodeAt(xs)]=xs;for(var Pp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",lA=typeof Uint8Array>"u"?[]:new Uint8Array(256),Qs=0;Qs<Pp.length;Qs++)lA[Pp.charCodeAt(Qs)]=Qs;for(var JC=function(n){var e=n.length*.75,t=n.length,r,i=0,A,s,o,a;n[n.length-1]==="="&&(e--,n[n.length-2]==="="&&e--);var c=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(e):new Array(e),u=Array.isArray(c)?c:new Uint8Array(c);for(r=0;r<t;r+=4)A=lA[n.charCodeAt(r)],s=lA[n.charCodeAt(r+1)],o=lA[n.charCodeAt(r+2)],a=lA[n.charCodeAt(r+3)],u[i++]=A<<2|s>>4,u[i++]=(s&15)<<4|o>>2,u[i++]=(o&3)<<6|a&63;return c},zC=function(n){for(var e=n.length,t=[],r=0;r<e;r+=2)t.push(n[r+1]<<8|n[r]);return t},XC=function(n){for(var e=n.length,t=[],r=0;r<e;r+=4)t.push(n[r+3]<<24|n[r+2]<<16|n[r+1]<<8|n[r]);return t},Qr=5,Vc=6+5,Gc=2,YC=Vc-Qr,Op=65536>>Qr,ZC=1<<Qr,jc=ZC-1,$C=1024>>Qr,e_=Op+$C,t_=e_,n_=32,r_=t_+n_,i_=65536>>Vc,A_=1<<YC,s_=A_-1,Mp=function(n,e,t){return n.slice?n.slice(e,t):new Uint16Array(Array.prototype.slice.call(n,e,t))},o_=function(n,e,t){return n.slice?n.slice(e,t):new Uint32Array(Array.prototype.slice.call(n,e,t))},a_=function(n,e){var t=JC(n),r=Array.isArray(t)?XC(t):new Uint32Array(t),i=Array.isArray(t)?zC(t):new Uint16Array(t),A=24,s=Mp(i,A/2,r[4]/2),o=r[5]===2?Mp(i,(A+r[4])/2):o_(r,Math.ceil((A+r[4])/4));return new c_(r[0],r[1],r[2],r[3],s,o)},c_=function(){function n(e,t,r,i,A,s){this.initialValue=e,this.errorValue=t,this.highStart=r,this.highValueIndex=i,this.index=A,this.data=s}return n.prototype.get=function(e){var t;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=this.index[e>>Qr],t=(t<<Gc)+(e&jc),this.data[t];if(e<=65535)return t=this.index[Op+(e-55296>>Qr)],t=(t<<Gc)+(e&jc),this.data[t];if(e<this.highStart)return t=r_-i_+(e>>Vc),t=this.index[t],t+=e>>Qr&s_,t=this.index[t],t=(t<<Gc)+(e&jc),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},n}(),Lp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u_=typeof Uint8Array>"u"?[]:new Uint8Array(256),Rs=0;Rs<Lp.length;Rs++)u_[Lp.charCodeAt(Rs)]=Rs;var l_="KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADGAM4A0wDbAOEA6QDxAPkAAQEJAQ8BFwF1AH0AHAEkASwBNAE6AUIBQQFJAVEBWQFhAWgBcAF4ATAAgAGGAY4BlQGXAZ8BpwGvAbUBvQHFAc0B0wHbAeMB6wHxAfkBAQIJAvEBEQIZAiECKQIxAjgCQAJGAk4CVgJeAmQCbAJ0AnwCgQKJApECmQKgAqgCsAK4ArwCxAIwAMwC0wLbAjAA4wLrAvMC+AIAAwcDDwMwABcDHQMlAy0DNQN1AD0DQQNJA0kDSQNRA1EDVwNZA1kDdQB1AGEDdQBpA20DdQN1AHsDdQCBA4kDkQN1AHUAmQOhA3UAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AKYDrgN1AHUAtgO+A8YDzgPWAxcD3gPjA+sD8wN1AHUA+wMDBAkEdQANBBUEHQQlBCoEFwMyBDgEYABABBcDSARQBFgEYARoBDAAcAQzAXgEgASIBJAEdQCXBHUAnwSnBK4EtgS6BMIEyAR1AHUAdQB1AHUAdQCVANAEYABgAGAAYABgAGAAYABgANgEYADcBOQEYADsBPQE/AQEBQwFFAUcBSQFLAU0BWQEPAVEBUsFUwVbBWAAYgVgAGoFcgV6BYIFigWRBWAAmQWfBaYFYABgAGAAYABgAKoFYACxBbAFuQW6BcEFwQXHBcEFwQXPBdMF2wXjBeoF8gX6BQIGCgYSBhoGIgYqBjIGOgZgAD4GRgZMBmAAUwZaBmAAYABgAGAAYABgAGAAYABgAGAAYABgAGIGYABpBnAGYABgAGAAYABgAGAAYABgAGAAYAB4Bn8GhQZgAGAAYAB1AHcDFQSLBmAAYABgAJMGdQA9A3UAmwajBqsGqwaVALMGuwbDBjAAywbSBtIG1QbSBtIG0gbSBtIG0gbdBuMG6wbzBvsGAwcLBxMHAwcbByMHJwcsBywHMQcsB9IGOAdAB0gHTgfSBkgHVgfSBtIG0gbSBtIG0gbSBtIG0gbSBiwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdbB2MHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB2kH0gZwB64EdQB1AHUAdQB1AHUAdQB1AHUHfQdgAIUHjQd1AHUAlQedB2AAYAClB6sHYACzB7YHvgfGB3UAzgfWBzMB3gfmB1EB7gf1B/0HlQENAQUIDQh1ABUIHQglCBcDLQg1CD0IRQhNCEEDUwh1AHUAdQBbCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIcAh3CHoIMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIgggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4JdQCECYoJjgmWCXUAngkwAGAAYABxAHUApgn3A64JtAl1ALkJdQDACTAAMAAwADAAdQB1AHUAdQB1AHUAdQB1AHUAowYNBMUIMAAwADAAMADICcsJ0wnZCRUE4QkwAOkJ8An4CTAAMAB1AAAKvwh1AAgKDwoXCh8KdQAwACcKLgp1ADYKqAmICT4KRgowADAAdQB1AE4KMAB1AFYKdQBeCnUAZQowADAAMAAwADAAMAAwADAAMAAVBHUAbQowADAAdQC5CXUKMAAwAHwBxAijBogEMgF9CoQKiASMCpQKmgqIBKIKqgquCogEDQG2Cr4KxgrLCjAAMADTCtsKCgHjCusK8Qr5CgELMAAwADAAMAB1AIsECQsRC3UANAEZCzAAMAAwADAAMAB1ACELKQswAHUANAExCzkLdQBBC0kLMABRC1kLMAAwADAAMAAwADAAdQBhCzAAMAAwAGAAYABpC3ELdwt/CzAAMACHC4sLkwubC58Lpwt1AK4Ltgt1APsDMAAwADAAMAAwADAAMAAwAL4LwwvLC9IL1wvdCzAAMADlC+kL8Qv5C/8LSQswADAAMAAwADAAMAAwADAAMAAHDDAAMAAwADAAMAAODBYMHgx1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1ACYMMAAwADAAdQB1AHUALgx1AHUAdQB1AHUAdQA2DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AD4MdQBGDHUAdQB1AHUAdQB1AEkMdQB1AHUAdQB1AFAMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQBYDHUAdQB1AF8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUA+wMVBGcMMAAwAHwBbwx1AHcMfwyHDI8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAYABgAJcMMAAwADAAdQB1AJ8MlQClDDAAMACtDCwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB7UMLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AA0EMAC9DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsBywHLAcsBywHLAcsBywHLQcwAMEMyAwsBywHLAcsBywHLAcsBywHLAcsBywHzAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1ANQM2QzhDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABgAGAAYABgAGAAYABgAOkMYADxDGAA+AwADQYNYABhCWAAYAAODTAAMAAwADAAFg1gAGAAHg37AzAAMAAwADAAYABgACYNYAAsDTQNPA1gAEMNPg1LDWAAYABgAGAAYABgAGAAYABgAGAAUg1aDYsGVglhDV0NcQBnDW0NdQ15DWAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAlQCBDZUAiA2PDZcNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAnw2nDTAAMAAwADAAMAAwAHUArw23DTAAMAAwADAAMAAwADAAMAAwADAAMAB1AL8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQDHDTAAYABgAM8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA1w11ANwNMAAwAD0B5A0wADAAMAAwADAAMADsDfQN/A0EDgwOFA4wABsOMAAwADAAMAAwADAAMAAwANIG0gbSBtIG0gbSBtIG0gYjDigOwQUuDsEFMw7SBjoO0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGQg5KDlIOVg7SBtIGXg5lDm0OdQ7SBtIGfQ6EDooOjQ6UDtIGmg6hDtIG0gaoDqwO0ga0DrwO0gZgAGAAYADEDmAAYAAkBtIGzA5gANIOYADaDokO0gbSBt8O5w7SBu8O0gb1DvwO0gZgAGAAxA7SBtIG0gbSBtIGYABgAGAAYAAED2AAsAUMD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHJA8sBywHLAcsBywHLAccDywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywPLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAc0D9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHPA/SBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gYUD0QPlQCVAJUAMAAwADAAMACVAJUAlQCVAJUAlQCVAEwPMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA//8EAAQABAAEAAQABAAEAAQABAANAAMAAQABAAIABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACgATABcAHgAbABoAHgAXABYAEgAeABsAGAAPABgAHABLAEsASwBLAEsASwBLAEsASwBLABgAGAAeAB4AHgATAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAGwASAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWAA0AEQAeAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAFAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJABYAGgAbABsAGwAeAB0AHQAeAE8AFwAeAA0AHgAeABoAGwBPAE8ADgBQAB0AHQAdAE8ATwAXAE8ATwBPABYAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQACsAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQACsAKwAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQACsAHgAeAB4AHgAeAB4AHgAOAB4AKwANAA0ADQANAA0ADQANAAkADQANAA0ACAAEAAsABAAEAA0ACQANAA0ADAAdAB0AHgAXABcAFgAXABcAFwAWABcAHQAdAB4AHgAUABQAFAANAAEAAQAEAAQABAAEAAQACQAaABoAGgAaABoAGgAaABoAHgAXABcAHQAVABUAHgAeAB4AHgAeAB4AGAAWABEAFQAVABUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ADQAeAA0ADQANAA0AHgANAA0ADQAHAB4AHgAeAB4AKwAEAAQABAAEAAQABAAEAAQABAAEAFAAUAArACsATwBQAFAAUABQAFAAHgAeAB4AFgARAE8AUABPAE8ATwBPAFAAUABQAFAAUAAeAB4AHgAWABEAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArABsAGwAbABsAGwAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGgAbABsAGwAbABoAGwAbABoAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAFAAGgAeAB0AHgBQAB4AGgAeAB4AHgAeAB4AHgAeAB4AHgBPAB4AUAAbAB4AHgBQAFAAUABQAFAAHgAeAB4AHQAdAB4AUAAeAFAAHgBQAB4AUABPAFAAUAAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgBQAFAAUABQAE8ATwBQAFAAUABQAFAATwBQAFAATwBQAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAUABQAFAATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABPAB4AHgArACsAKwArAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAdAB4AHgAeAB0AHQAeAB4AHQAeAB4AHgAdAB4AHQAbABsAHgAdAB4AHgAeAB4AHQAeAB4AHQAdAB0AHQAeAB4AHQAeAB0AHgAdAB0AHQAdAB0AHQAeAB0AHgAeAB4AHgAeAB0AHQAdAB0AHgAeAB4AHgAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB0AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAdAB0AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHQAdAB0AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHQAdAB4AHgAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AJQAlAB0AHQAlAB4AJQAlACUAIAAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAeAB0AJQAdAB0AHgAdAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAdAB0AHQAdACUAHgAlACUAJQAdACUAJQAdAB0AHQAlACUAHQAdACUAHQAdACUAJQAlAB4AHQAeAB4AHgAeAB0AHQAlAB0AHQAdAB0AHQAdACUAJQAlACUAJQAdACUAJQAgACUAHQAdACUAJQAlACUAJQAlACUAJQAeAB4AHgAlACUAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AFwAXABcAFwAXABcAHgATABMAJQAeAB4AHgAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARABYAEQAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwAlACUAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACsAKwArACsAKwArACsAKwArACsAKwArAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBPAE8ATwBPAE8ATwBPAE8AJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAKwArAFAAKwArAFAAUAArACsAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAHgAeAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACAAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABcAFwAXABUAFQAVAB4AHgAeAB4AJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAgACUAJQAgACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA==",Dp=50,d_=1,Hp=2,Np=3,h_=4,p_=5,Kp=7,Vp=8,Gp=9,Yn=10,Wc=11,jp=12,qc=13,f_=14,dA=15,Jc=16,Ps=17,hA=18,g_=19,Wp=20,zc=21,pA=22,Xc=23,li=24,Gt=25,fA=26,gA=27,di=28,m_=29,Rr=30,v_=31,Os=32,Ms=33,Yc=34,Zc=35,$c=36,mA=37,eu=38,Ls=39,Ds=40,tu=41,qp=42,y_=43,w_=[9001,65288],Jp="!",ie="×",Hs="÷",nu=a_(l_),Rn=[Rr,$c],ru=[d_,Hp,Np,p_],zp=[Yn,Vp],Xp=[gA,fA],b_=ru.concat(zp),Yp=[eu,Ls,Ds,Yc,Zc],B_=[dA,qc],C_=function(n,e){e===void 0&&(e="strict");var t=[],r=[],i=[];return n.forEach(function(A,s){var o=nu.get(A);if(o>Dp?(i.push(!0),o-=Dp):i.push(!1),["normal","auto","loose"].indexOf(e)!==-1&&[8208,8211,12316,12448].indexOf(A)!==-1)return r.push(s),t.push(Jc);if(o===h_||o===Wc){if(s===0)return r.push(s),t.push(Rr);var a=t[s-1];return b_.indexOf(a)===-1?(r.push(r[s-1]),t.push(a)):(r.push(s),t.push(Rr))}if(r.push(s),o===v_)return t.push(e==="strict"?zc:mA);if(o===qp||o===m_)return t.push(Rr);if(o===y_)return A>=131072&&A<=196605||A>=196608&&A<=262141?t.push(mA):t.push(Rr);t.push(o)}),[r,t,i]},iu=function(n,e,t,r){var i=r[t];if(Array.isArray(n)?n.indexOf(i)!==-1:n===i)for(var A=t;A<=r.length;){A++;var s=r[A];if(s===e)return!0;if(s!==Yn)break}if(i===Yn)for(var A=t;A>0;){A--;var o=r[A];if(Array.isArray(n)?n.indexOf(o)!==-1:n===o)for(var a=t;a<=r.length;){a++;var s=r[a];if(s===e)return!0;if(s!==Yn)break}if(o!==Yn)break}return!1},Zp=function(n,e){for(var t=n;t>=0;){var r=e[t];if(r===Yn)t--;else return r}return 0},__=function(n,e,t,r,i){if(t[r]===0)return ie;var A=r-1;if(Array.isArray(i)&&i[A]===!0)return ie;var s=A-1,o=A+1,a=e[A],c=s>=0?e[s]:0,u=e[o];if(a===Hp&&u===Np)return ie;if(ru.indexOf(a)!==-1)return Jp;if(ru.indexOf(u)!==-1||zp.indexOf(u)!==-1)return ie;if(Zp(A,e)===Vp)return Hs;if(nu.get(n[A])===Wc||(a===Os||a===Ms)&&nu.get(n[o])===Wc||a===Kp||u===Kp||a===Gp||[Yn,qc,dA].indexOf(a)===-1&&u===Gp||[Ps,hA,g_,li,di].indexOf(u)!==-1||Zp(A,e)===pA||iu(Xc,pA,A,e)||iu([Ps,hA],zc,A,e)||iu(jp,jp,A,e))return ie;if(a===Yn)return Hs;if(a===Xc||u===Xc)return ie;if(u===Jc||a===Jc)return Hs;if([qc,dA,zc].indexOf(u)!==-1||a===f_||c===$c&&B_.indexOf(a)!==-1||a===di&&u===$c||u===Wp||Rn.indexOf(u)!==-1&&a===Gt||Rn.indexOf(a)!==-1&&u===Gt||a===gA&&[mA,Os,Ms].indexOf(u)!==-1||[mA,Os,Ms].indexOf(a)!==-1&&u===fA||Rn.indexOf(a)!==-1&&Xp.indexOf(u)!==-1||Xp.indexOf(a)!==-1&&Rn.indexOf(u)!==-1||[gA,fA].indexOf(a)!==-1&&(u===Gt||[pA,dA].indexOf(u)!==-1&&e[o+1]===Gt)||[pA,dA].indexOf(a)!==-1&&u===Gt||a===Gt&&[Gt,di,li].indexOf(u)!==-1)return ie;if([Gt,di,li,Ps,hA].indexOf(u)!==-1)for(var l=A;l>=0;){var d=e[l];if(d===Gt)return ie;if([di,li].indexOf(d)!==-1)l--;else break}if([gA,fA].indexOf(u)!==-1)for(var l=[Ps,hA].indexOf(a)!==-1?s:A;l>=0;){var d=e[l];if(d===Gt)return ie;if([di,li].indexOf(d)!==-1)l--;else break}if(eu===a&&[eu,Ls,Yc,Zc].indexOf(u)!==-1||[Ls,Yc].indexOf(a)!==-1&&[Ls,Ds].indexOf(u)!==-1||[Ds,Zc].indexOf(a)!==-1&&u===Ds||Yp.indexOf(a)!==-1&&[Wp,fA].indexOf(u)!==-1||Yp.indexOf(u)!==-1&&a===gA||Rn.indexOf(a)!==-1&&Rn.indexOf(u)!==-1||a===li&&Rn.indexOf(u)!==-1||Rn.concat(Gt).indexOf(a)!==-1&&u===pA&&w_.indexOf(n[o])===-1||Rn.concat(Gt).indexOf(u)!==-1&&a===hA)return ie;if(a===tu&&u===tu){for(var h=t[A],f=1;h>0&&(h--,e[h]===tu);)f++;if(f%2!==0)return ie}return a===Os&&u===Ms?ie:Hs},S_=function(n,e){e||(e={lineBreak:"normal",wordBreak:"normal"});var t=C_(n,e.lineBreak),r=t[0],i=t[1],A=t[2];(e.wordBreak==="break-all"||e.wordBreak==="break-word")&&(i=i.map(function(o){return[Gt,Rr,qp].indexOf(o)!==-1?mA:o}));var s=e.wordBreak==="keep-all"?A.map(function(o,a){return o&&n[a]>=19968&&n[a]<=40959}):void 0;return[r,i,s]},k_=function(){function n(e,t,r,i){this.codePoints=e,this.required=t===Jp,this.start=r,this.end=i}return n.prototype.slice=function(){return $e.apply(void 0,this.codePoints.slice(this.start,this.end))},n}(),E_=function(n,e){var t=Fs(n),r=S_(t,e),i=r[0],A=r[1],s=r[2],o=t.length,a=0,c=0;return{next:function(){if(c>=o)return{done:!0,value:null};for(var u=ie;c<o&&(u=__(t,A,i,++c,s))===ie;);if(u!==ie||c===o){var l=new k_(t,u,a,c);return a=c,{value:l,done:!1}}return{done:!0,value:null}}}},U_=1,T_=2,vA=4,$p=8,Ns=10,ef=47,yA=92,I_=9,F_=32,Ks=34,wA=61,x_=35,Q_=36,R_=37,Vs=39,Gs=40,bA=41,P_=95,Rt=45,O_=33,M_=60,L_=62,D_=64,H_=91,N_=93,K_=61,V_=123,js=63,G_=125,tf=124,j_=126,W_=128,nf=65533,Au=42,Pr=43,q_=44,J_=58,z_=59,BA=46,X_=0,Y_=8,Z_=11,$_=14,eS=31,tS=127,mn=-1,rf=48,Af=97,sf=101,nS=102,rS=117,iS=122,of=65,af=69,cf=70,AS=85,sS=90,Ct=function(n){return n>=rf&&n<=57},oS=function(n){return n>=55296&&n<=57343},hi=function(n){return Ct(n)||n>=of&&n<=cf||n>=Af&&n<=nS},aS=function(n){return n>=Af&&n<=iS},cS=function(n){return n>=of&&n<=sS},uS=function(n){return aS(n)||cS(n)},lS=function(n){return n>=W_},Ws=function(n){return n===Ns||n===I_||n===F_},qs=function(n){return uS(n)||lS(n)||n===P_},uf=function(n){return qs(n)||Ct(n)||n===Rt},dS=function(n){return n>=X_&&n<=Y_||n===Z_||n>=$_&&n<=eS||n===tS},Zn=function(n,e){return n!==yA?!1:e!==Ns},Js=function(n,e,t){return n===Rt?qs(e)||Zn(e,t):qs(n)?!0:!!(n===yA&&Zn(n,e))},su=function(n,e,t){return n===Pr||n===Rt?Ct(e)?!0:e===BA&&Ct(t):Ct(n===BA?e:n)},hS=function(n){var e=0,t=1;(n[e]===Pr||n[e]===Rt)&&(n[e]===Rt&&(t=-1),e++);for(var r=[];Ct(n[e]);)r.push(n[e++]);var i=r.length?parseInt($e.apply(void 0,r),10):0;n[e]===BA&&e++;for(var A=[];Ct(n[e]);)A.push(n[e++]);var s=A.length,o=s?parseInt($e.apply(void 0,A),10):0;(n[e]===af||n[e]===sf)&&e++;var a=1;(n[e]===Pr||n[e]===Rt)&&(n[e]===Rt&&(a=-1),e++);for(var c=[];Ct(n[e]);)c.push(n[e++]);var u=c.length?parseInt($e.apply(void 0,c),10):0;return t*(i+o*Math.pow(10,-s))*Math.pow(10,a*u)},pS={type:2},fS={type:3},gS={type:4},mS={type:13},vS={type:8},yS={type:21},wS={type:9},bS={type:10},BS={type:11},CS={type:12},_S={type:14},zs={type:23},SS={type:1},kS={type:25},ES={type:24},US={type:26},TS={type:27},IS={type:28},FS={type:29},xS={type:31},ou={type:32},lf=function(){function n(){this._value=[]}return n.prototype.write=function(e){this._value=this._value.concat(Fs(e))},n.prototype.read=function(){for(var e=[],t=this.consumeToken();t!==ou;)e.push(t),t=this.consumeToken();return e},n.prototype.consumeToken=function(){var e=this.consumeCodePoint();switch(e){case Ks:return this.consumeStringToken(Ks);case x_:var t=this.peekCodePoint(0),r=this.peekCodePoint(1),i=this.peekCodePoint(2);if(uf(t)||Zn(r,i)){var A=Js(t,r,i)?T_:U_,s=this.consumeName();return{type:5,value:s,flags:A}}break;case Q_:if(this.peekCodePoint(0)===wA)return this.consumeCodePoint(),mS;break;case Vs:return this.consumeStringToken(Vs);case Gs:return pS;case bA:return fS;case Au:if(this.peekCodePoint(0)===wA)return this.consumeCodePoint(),_S;break;case Pr:if(su(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case q_:return gS;case Rt:var o=e,a=this.peekCodePoint(0),c=this.peekCodePoint(1);if(su(o,a,c))return this.reconsumeCodePoint(e),this.consumeNumericToken();if(Js(o,a,c))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();if(a===Rt&&c===L_)return this.consumeCodePoint(),this.consumeCodePoint(),ES;break;case BA:if(su(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case ef:if(this.peekCodePoint(0)===Au)for(this.consumeCodePoint();;){var u=this.consumeCodePoint();if(u===Au&&(u=this.consumeCodePoint(),u===ef))return this.consumeToken();if(u===mn)return this.consumeToken()}break;case J_:return US;case z_:return TS;case M_:if(this.peekCodePoint(0)===O_&&this.peekCodePoint(1)===Rt&&this.peekCodePoint(2)===Rt)return this.consumeCodePoint(),this.consumeCodePoint(),kS;break;case D_:var l=this.peekCodePoint(0),d=this.peekCodePoint(1),h=this.peekCodePoint(2);if(Js(l,d,h)){var s=this.consumeName();return{type:7,value:s}}break;case H_:return IS;case yA:if(Zn(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();break;case N_:return FS;case K_:if(this.peekCodePoint(0)===wA)return this.consumeCodePoint(),vS;break;case V_:return BS;case G_:return CS;case rS:case AS:var f=this.peekCodePoint(0),p=this.peekCodePoint(1);return f===Pr&&(hi(p)||p===js)&&(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(e),this.consumeIdentLikeToken();case tf:if(this.peekCodePoint(0)===wA)return this.consumeCodePoint(),wS;if(this.peekCodePoint(0)===tf)return this.consumeCodePoint(),yS;break;case j_:if(this.peekCodePoint(0)===wA)return this.consumeCodePoint(),bS;break;case mn:return ou}return Ws(e)?(this.consumeWhiteSpace(),xS):Ct(e)?(this.reconsumeCodePoint(e),this.consumeNumericToken()):qs(e)?(this.reconsumeCodePoint(e),this.consumeIdentLikeToken()):{type:6,value:$e(e)}},n.prototype.consumeCodePoint=function(){var e=this._value.shift();return typeof e>"u"?-1:e},n.prototype.reconsumeCodePoint=function(e){this._value.unshift(e)},n.prototype.peekCodePoint=function(e){return e>=this._value.length?-1:this._value[e]},n.prototype.consumeUnicodeRangeToken=function(){for(var e=[],t=this.consumeCodePoint();hi(t)&&e.length<6;)e.push(t),t=this.consumeCodePoint();for(var r=!1;t===js&&e.length<6;)e.push(t),t=this.consumeCodePoint(),r=!0;if(r){var i=parseInt($e.apply(void 0,e.map(function(a){return a===js?rf:a})),16),A=parseInt($e.apply(void 0,e.map(function(a){return a===js?cf:a})),16);return{type:30,start:i,end:A}}var s=parseInt($e.apply(void 0,e),16);if(this.peekCodePoint(0)===Rt&&hi(this.peekCodePoint(1))){this.consumeCodePoint(),t=this.consumeCodePoint();for(var o=[];hi(t)&&o.length<6;)o.push(t),t=this.consumeCodePoint();var A=parseInt($e.apply(void 0,o),16);return{type:30,start:s,end:A}}else return{type:30,start:s,end:s}},n.prototype.consumeIdentLikeToken=function(){var e=this.consumeName();return e.toLowerCase()==="url"&&this.peekCodePoint(0)===Gs?(this.consumeCodePoint(),this.consumeUrlToken()):this.peekCodePoint(0)===Gs?(this.consumeCodePoint(),{type:19,value:e}):{type:20,value:e}},n.prototype.consumeUrlToken=function(){var e=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===mn)return{type:22,value:""};var t=this.peekCodePoint(0);if(t===Vs||t===Ks){var r=this.consumeStringToken(this.consumeCodePoint());return r.type===0&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===mn||this.peekCodePoint(0)===bA)?(this.consumeCodePoint(),{type:22,value:r.value}):(this.consumeBadUrlRemnants(),zs)}for(;;){var i=this.consumeCodePoint();if(i===mn||i===bA)return{type:22,value:$e.apply(void 0,e)};if(Ws(i))return this.consumeWhiteSpace(),this.peekCodePoint(0)===mn||this.peekCodePoint(0)===bA?(this.consumeCodePoint(),{type:22,value:$e.apply(void 0,e)}):(this.consumeBadUrlRemnants(),zs);if(i===Ks||i===Vs||i===Gs||dS(i))return this.consumeBadUrlRemnants(),zs;if(i===yA)if(Zn(i,this.peekCodePoint(0)))e.push(this.consumeEscapedCodePoint());else return this.consumeBadUrlRemnants(),zs;else e.push(i)}},n.prototype.consumeWhiteSpace=function(){for(;Ws(this.peekCodePoint(0));)this.consumeCodePoint()},n.prototype.consumeBadUrlRemnants=function(){for(;;){var e=this.consumeCodePoint();if(e===bA||e===mn)return;Zn(e,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},n.prototype.consumeStringSlice=function(e){for(var t=5e4,r="";e>0;){var i=Math.min(t,e);r+=$e.apply(void 0,this._value.splice(0,i)),e-=i}return this._value.shift(),r},n.prototype.consumeStringToken=function(e){var t="",r=0;do{var i=this._value[r];if(i===mn||i===void 0||i===e)return t+=this.consumeStringSlice(r),{type:0,value:t};if(i===Ns)return this._value.splice(0,r),SS;if(i===yA){var A=this._value[r+1];A!==mn&&A!==void 0&&(A===Ns?(t+=this.consumeStringSlice(r),r=-1,this._value.shift()):Zn(i,A)&&(t+=this.consumeStringSlice(r),t+=$e(this.consumeEscapedCodePoint()),r=-1))}r++}while(!0)},n.prototype.consumeNumber=function(){var e=[],t=vA,r=this.peekCodePoint(0);for((r===Pr||r===Rt)&&e.push(this.consumeCodePoint());Ct(this.peekCodePoint(0));)e.push(this.consumeCodePoint());r=this.peekCodePoint(0);var i=this.peekCodePoint(1);if(r===BA&&Ct(i))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=$p;Ct(this.peekCodePoint(0));)e.push(this.consumeCodePoint());r=this.peekCodePoint(0),i=this.peekCodePoint(1);var A=this.peekCodePoint(2);if((r===af||r===sf)&&((i===Pr||i===Rt)&&Ct(A)||Ct(i)))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=$p;Ct(this.peekCodePoint(0));)e.push(this.consumeCodePoint());return[hS(e),t]},n.prototype.consumeNumericToken=function(){var e=this.consumeNumber(),t=e[0],r=e[1],i=this.peekCodePoint(0),A=this.peekCodePoint(1),s=this.peekCodePoint(2);if(Js(i,A,s)){var o=this.consumeName();return{type:15,number:t,flags:r,unit:o}}return i===R_?(this.consumeCodePoint(),{type:16,number:t,flags:r}):{type:17,number:t,flags:r}},n.prototype.consumeEscapedCodePoint=function(){var e=this.consumeCodePoint();if(hi(e)){for(var t=$e(e);hi(this.peekCodePoint(0))&&t.length<6;)t+=$e(this.consumeCodePoint());Ws(this.peekCodePoint(0))&&this.consumeCodePoint();var r=parseInt(t,16);return r===0||oS(r)||r>1114111?nf:r}return e===mn?nf:e},n.prototype.consumeName=function(){for(var e="";;){var t=this.consumeCodePoint();if(uf(t))e+=$e(t);else if(Zn(t,this.peekCodePoint(0)))e+=$e(this.consumeEscapedCodePoint());else return this.reconsumeCodePoint(t),e}},n}(),df=function(){function n(e){this._tokens=e}return n.create=function(e){var t=new lf;return t.write(e),new n(t.read())},n.parseValue=function(e){return n.create(e).parseComponentValue()},n.parseValues=function(e){return n.create(e).parseComponentValues()},n.prototype.parseComponentValue=function(){for(var e=this.consumeToken();e.type===31;)e=this.consumeToken();if(e.type===32)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(e);var t=this.consumeComponentValue();do e=this.consumeToken();while(e.type===31);if(e.type===32)return t;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},n.prototype.parseComponentValues=function(){for(var e=[];;){var t=this.consumeComponentValue();if(t.type===32)return e;e.push(t),e.push()}},n.prototype.consumeComponentValue=function(){var e=this.consumeToken();switch(e.type){case 11:case 28:case 2:return this.consumeSimpleBlock(e.type);case 19:return this.consumeFunction(e)}return e},n.prototype.consumeSimpleBlock=function(e){for(var t={type:e,values:[]},r=this.consumeToken();;){if(r.type===32||RS(r,e))return t;this.reconsumeToken(r),t.values.push(this.consumeComponentValue()),r=this.consumeToken()}},n.prototype.consumeFunction=function(e){for(var t={name:e.value,values:[],type:18};;){var r=this.consumeToken();if(r.type===32||r.type===3)return t;this.reconsumeToken(r),t.values.push(this.consumeComponentValue())}},n.prototype.consumeToken=function(){var e=this._tokens.shift();return typeof e>"u"?ou:e},n.prototype.reconsumeToken=function(e){this._tokens.unshift(e)},n}(),$n=function(n){return n.type===15},st=function(n){return n.type===17},ae=function(n){return n.type===20},QS=function(n){return n.type===0},au=function(n,e){return ae(n)&&n.value===e},hf=function(n){return n.type!==31},gt=function(n){return n.type!==31&&n.type!==4},vn=function(n){var e=[],t=[];return n.forEach(function(r){if(r.type===4){if(t.length===0)throw new Error("Error parsing function args, zero tokens for arg");e.push(t),t=[];return}r.type!==31&&t.push(r)}),t.length&&e.push(t),e},RS=function(n,e){return e===11&&n.type===12||e===28&&n.type===29?!0:e===2&&n.type===3},er=function(n){return n.type===17||n.type===15},Re=function(n){return n.type===16||er(n)},pf=function(n){return n.length>1?[n[0],n[1]]:[n[0]]},mt={type:17,number:0,flags:vA},cu={type:16,number:50,flags:vA},tr={type:16,number:100,flags:vA},CA=function(n,e,t){var r=n[0],i=n[1];return[Se(r,e),Se(typeof i<"u"?i:r,t)]},Se=function(n,e){if(n.type===16)return n.number/100*e;if($n(n))switch(n.unit){case"rem":case"em":return 16*n.number;case"px":default:return n.number}return n.number},ff="deg",gf="grad",mf="rad",vf="turn",Xs={name:"angle",parse:function(n,e){if(e.type===15)switch(e.unit){case ff:return Math.PI*e.number/180;case gf:return Math.PI/200*e.number;case mf:return e.number;case vf:return Math.PI*2*e.number}throw new Error("Unsupported angle type")}},yf=function(n){return n.type===15&&(n.unit===ff||n.unit===gf||n.unit===mf||n.unit===vf)},wf=function(n){var e=n.filter(ae).map(function(t){return t.value}).join(" ");switch(e){case"to bottom right":case"to right bottom":case"left top":case"top left":return[mt,mt];case"to top":case"bottom":return Wt(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[mt,tr];case"to right":case"left":return Wt(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[tr,tr];case"to bottom":case"top":return Wt(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[tr,mt];case"to left":case"right":return Wt(270)}return 0},Wt=function(n){return Math.PI*n/180},nr=function(n){return(255&n)===0},ht=function(n){var e=255&n,t=255&n>>8,r=255&n>>16,i=255&n>>24;return e<255?"rgba(".concat(i,",").concat(r,",").concat(t,",").concat(e/255,")"):"rgb(".concat(i,",").concat(r,",").concat(t,")")},yn=function(n,e,t,r){return(n<<24|e<<16|t<<8|Math.round(r*255)<<0)>>>0},Ys=function(n,e){if(n.type===17)return n.number;if(n.type===16){var t=e===3?1:255;return e===3?n.number/100*t:Math.round(n.number/100*t)}return 0},Or=function(n){return(n[0].type===20?n[0].value:"unknown")==="from"},qe=function(n,e,t){return Math.min(Math.max(n,e),t)},Pt=function(n,e){return[n[0]*e[0]+n[1]*e[1]+n[2]*e[2],n[3]*e[0]+n[4]*e[1]+n[5]*e[2],n[6]*e[0]+n[7]*e[1]+n[8]*e[2]]},PS=function(n){return yn(qe(Math.round(n[0]*255),0,255),qe(Math.round(n[1]*255),0,255),qe(Math.round(n[2]*255),0,255),qe(n[3],0,1))},uu=function(n){var e=n[0],t=n[1],r=n[2],i=n[3],A=Mr([e,t,r]);return yn(qe(Math.round(A[0]*255),0,255),qe(Math.round(A[1]*255),0,255),qe(Math.round(A[2]*255),0,255),i)},_A=function(n){var e=rr([n[0],n[1],n[2]]);return uu([e[0],e[1],e[2],n[3]])},OS=function(n,e){if(Or(e.filter(gt)))throw new Error("Relative color not supported for lab()");var t=Zs(e),r=t[0],i=t[1],A=t[2],s=t[3],o=Mr(rr(to([r,i,A])));return yn(qe(Math.round(o[0]*255),0,255),qe(Math.round(o[1]*255),0,255),qe(Math.round(o[2]*255),0,255),s)},MS=function(n,e){if(Or(e.filter(gt)))throw new Error("Relative color not supported for oklab()");var t=Zs(e),r=t[0],i=t[1],A=t[2],s=t[3],o=Mr(rr(eo([r,i,A])));return yn(qe(Math.round(o[0]*255),0,255),qe(Math.round(o[1]*255),0,255),qe(Math.round(o[2]*255),0,255),s)},LS=function(n,e){if(Or(e.filter(gt)))throw new Error("Relative color not supported for oklch()");var t=_f(e),r=t[0],i=t[1],A=t[2],s=t[3],o=Mr(rr(eo($s([r,i,A]))));return yn(qe(Math.round(o[0]*255),0,255),qe(Math.round(o[1]*255),0,255),qe(Math.round(o[2]*255),0,255),s)},DS=function(n,e){if(Or(e.filter(gt)))throw new Error("Relative color not supported for lch()");var t=Cf(e),r=t[0],i=t[1],A=t[2],s=t[3],o=Mr(rr(to($s([r,i,A]))));return yn(qe(Math.round(o[0]*255),0,255),qe(Math.round(o[1]*255),0,255),qe(Math.round(o[2]*255),0,255),s)},bf=function(n,e){var t=e.filter(gt),r=t[0],i=t[1],A=t[2],s=t[3],o=(r.type===17?Wt(r.number):Xs.parse(n,r))/(Math.PI*2),a=Re(i)?i.number/100:0,c=Re(A)?A.number/100:0,u=typeof s<"u"&&Re(s)?Se(s,1):1;return[o,a,c,u]},Bf=function(n,e){if(Or(e))throw new Error("Relative color not supported for hsl()");var t=bf(n,e),r=t[0],i=t[1],A=t[2],s=t[3],o=kf([r,i,A]);return yn(o[0]*255,o[1]*255,o[2]*255,i===0?1:s)},Cf=function(n){var e=n.filter(gt),t=Re(e[0])?e[0].number:0,r=Re(e[1])?e[1].number:0,i=st(e[2])||$n(e[2])?e[2].number:0,A=typeof e[4]<"u"&&Re(e[4])?Se(e[4],1):1;return[t,r,i,A]},Zs=function(n){var e=n.filter(gt),t=e[0].type===16?e[0].number/100:st(e[0])?e[0].number:0,r=e[1].type===16?e[1].number/100:st(e[1])?e[1].number:0,i=st(e[2])||$n(e[2])?e[2].number:0,A=typeof e[4]<"u"&&Re(e[4])?Se(e[4],1):1;return[t,r,i,A]},_f=function(n){var e=n.filter(gt),t=e[0].type===16?e[0].number/100:st(e[0])?e[0].number:0,r=e[1].type===16?e[1].number/100:st(e[1])?e[1].number:0,i=st(e[2])||$n(e[2])?e[2].number:0,A=typeof e[4]<"u"&&Re(e[4])?Se(e[4],1):1;return[t,r,i,A]},Sf=function(n){return Pt([1.0479297925449969,.022946870601609652,-.05019226628920524,.02962780877005599,.9904344267538799,-.017073799063418826,-.009243040646204504,.015055191490298152,.7518742814281371],n)},lu=function(n){return Pt([.955473421488075,-.02309845494876471,.06325924320057072,-.0283697093338637,1.0099953980813041,.021041441191917323,.012314014864481998,-.020507649298898964,1.330365926242124],n)},du=function(n,e,t){return t<0&&(t+=1),t>=1&&(t-=1),t<1/6?(e-n)*t*6+n:t<1/2?e:t<2/3?(e-n)*6*(2/3-t)+n:n},kf=function(n){var e=n[0],t=n[1],r=n[2];if(t===0)return[r*255,r*255,r*255];var i=r<=.5?r*(t+1):r+t-r*t,A=r*2-i,s=du(A,i,e+1/3),o=du(A,i,e),a=du(A,i,e-1/3);return[s,o,a]},$s=function(n){var e=n[0],t=n[1],r=n[2];return t<0&&(t=0),isNaN(r)&&(r=0),[e,t*Math.cos(r*Math.PI/180),t*Math.sin(r*Math.PI/180)]},eo=function(n){var e=Pt([1,.3963377773761749,.2158037573099136,1,-.1055613458156586,-.0638541728258133,1,-.0894841775298119,-1.2914855480194092],n),t=e.map(function(r){return Math.pow(r,3)});return Pt([1.2268798758459243,-.5578149944602171,.2813910456659647,-.0405757452148008,1.112286803280317,-.0717110580655164,-.0763729366746601,-.4214933324022432,1.5869240198367816],t)},to=function(n){var e=(n[0]+16)/116,t=n[1]/500+e,r=e-n[2]/200,i=24389/27,A=24/116,s=[(t>A?Math.pow(t,3):(116*t-16)/i)*.3457/.3585,n[0]>8?Math.pow(e,3):n[0]/i,(r>A?Math.pow(r,3):(116*r-16)/i)*(1-.3457-.3585)/.3585];return lu([s[0],s[1],s[2]])},HS=function(n,e){var t=e.filter(gt);if(t.length===3){var r=t.map(Ys),i=r[0],A=r[1],s=r[2],o=pu([i/255,A/255,s/255]),a=hu([o[0],o[1],o[2]]),c=a[0],u=a[1],l=a[2];return[c,u,l,1]}if(t.length===4){var d=t.map(Ys),i=d[0],A=d[1],s=d[2],h=d[3],o=pu([i/255,A/255,s/255]),f=hu([o[0],o[1],o[2]]),c=f[0],u=f[1],l=f[2];return[c,u,l,h]}return[0,0,0,1]},NS=function(n,e){var t=bf(n,e),r=t[0],i=t[1],A=t[2],s=t[3],o=pu(kf([r,i,A])),a=hu([o[0],o[1],o[2]]),c=a[0],u=a[1],l=a[2];return[c,u,l,s]},KS=function(n,e){var t=Zs(e),r=t[0],i=t[1],A=t[2],s=t[3],o=to([r,i,A]),a=o[0],c=o[1],u=o[2];return[a,c,u,s]},VS=function(n,e){var t=Cf(e),r=t[0],i=t[1],A=t[2],s=t[3],o=to($s([r,i,A])),a=o[0],c=o[1],u=o[2];return[a,c,u,s]},GS=function(n,e){var t=_f(e),r=t[0],i=t[1],A=t[2],s=t[3],o=eo($s([r,i,A])),a=o[0],c=o[1],u=o[2];return[a,c,u,s]},jS=function(n,e){var t=Zs(e),r=t[0],i=t[1],A=t[2],s=t[3],o=eo([r,i,A]),a=o[0],c=o[1],u=o[2];return[a,c,u,s]},WS=function(n){return lu([n[0],n[1],n[2]])},Ef=function(n){return n},qS=function(n){var e=Sf([n[0],n[2],n[3]]),t=e[0],r=e[1],i=e[2];return[t,r,i,n[3]]},Uf=function(n){return _A([n[0],n[1],n[2],n[3]])},JS=function(n){var e=WS([n[0],n[1],n[2]]);return _A([e[0],e[1],e[2],n[3]])},rr=function(n){return Pt([3.2409699419045226,-1.537383177570094,-.4986107602930034,-.9692436362808796,1.8759675015077202,.04155505740717559,.05563007969699366,-.20397695888897652,1.0569715142428786],n)},hu=function(n){return Pt([.41239079926595934,.357584339383878,.1804807884018343,.21263900587151027,.715168678767756,.07219231536073371,.01933081871559182,.11919477979462598,.9505321522496607],n)},Mr=function(n){return n.map(function(e){var t=e<0?-1:1,r=Math.abs(e);return r>.0031308?t*(1.055*Math.pow(r,1/2.4)-.055):12.92*e})},pu=function(n){return n.map(function(e){var t=e<0?-1:1,r=Math.abs(e);return r<=.04045?e/12.92:t*Math.pow((r+.055)/1.055,2.4)})},zS=function(n){var e=Mr(rr([n[0],n[1],n[2]])),t=e[0],r=e[1],i=e[2];return[t,r,i,n[3]]},XS=function(n){var e=rr([n[0],n[1],n[2]]),t=e[0],r=e[1],i=e[2];return[qe(Math.round(t*255),0,255),qe(Math.round(r*255),0,255),qe(Math.round(i*255),0,255),n[3]]},YS=function(n){return Pt([.4865709486482162,.26566769316909306,.1982172852343625,.2289745640697488,.6917385218365064,.079286914093745,0,.04511338185890264,1.043944368900976],n)},ZS=function(n){return Pt([2.493496911941425,-.9313836179191239,-.40271078445071684,-.8294889695615747,1.7626640603183463,.023624685841943577,.03584583024378447,-.07617238926804182,.9568845240076872],n)},$S=function(n){return n.map(function(e){var t=e<0?-1:1,r=e*t;return r<=.04045?e/12.92:t*Math.pow((e+.055)/1.055,2.4)||0})},ek=function(n){return Mr(n)},tk=function(n){var e=$S([n[0],n[1],n[2]]);return YS([e[0],e[1],e[2]])},nk=function(n){var e=ek(ZS([n[0],n[1],n[2]])),t=e[0],r=e[1],i=e[2];return[t,r,i,n[3]]},rk=function(n){var e=tk([n[0],n[1],n[2]]);return _A([e[0],e[1],e[2],n[3]])},ik=function(n){return Pt([2.0415879038107465,-.5650069742788596,-.34473135077832956,-.9692436362808795,1.8759675015077202,.04155505740717557,.013444280632031142,-.11836239223101838,1.0151749943912054],n)},Ak=function(n){return Pt([.5766690429101305,.1855582379065463,.1882286462349947,.29734497525053605,.6273635662554661,.0752914584939978,.02703136138641234,.07068885253582723,.9913375368376388],n)},sk=function(n){var e=n.map(function(t){var r=t<0?-1:1,i=Math.abs(t);return r*Math.pow(i,2.19921875)});return[e[0],e[1],e[2]]},ok=function(n){var e=n.map(function(t){var r=t<0?-1:1,i=Math.abs(t);return r*Math.pow(i,.4547069271758437)});return[e[0],e[1],e[2]]},ak=function(n){var e=ok(ik([n[0],n[1],n[2]])),t=e[0],r=e[1],i=e[2];return[t,r,i,n[3]]},ck=function(n){var e=rr(Ak(sk([n[0],n[1],n[2]])));return uu([e[0],e[1],e[2],n[3]])},uk=function(n){return Pt([.7977666449006423,.13518129740053308,.0313477341283922,.2880748288194013,.711835234241873,8993693872564e-17,0,0,.8251046025104602],n)},lk=function(n){return Pt([1.3457868816471583,-.25557208737979464,-.05110186497554526,-.5446307051249019,1.5082477428451468,.02052744743642139,0,0,1.2119675456389452],n)},dk=function(n){return n.map(function(e){return e<16/512?e/16:Math.pow(e,1.8)})},hk=function(n){return n.map(function(e){return e>1/512?Math.pow(e,1/1.8):e*16})},pk=function(n){var e=dk([n[0],n[1],n[2]]);return lu(uk([e[0],e[1],e[2]]))},fk=function(n){var e=hk(lk(Sf([n[0],n[1],n[2]]))),t=e[0],r=e[1],i=e[2];return[t,r,i,n[3]]},gk=function(n){var e=pk([n[0],n[1],n[2]]);return _A([e[0],e[1],e[2],n[3]])},no=1.09929682680944,Tf=.018053968510807,mk=function(n){return n.map(function(e){return e<Tf*4.5?e/4.5:Math.pow((e+no-1)/no,1/.45)})},vk=function(n){return n.map(function(e){return e>=Tf?no*Math.pow(e,.45)-(no-1):4.5*e})},yk=function(n){return Pt([.6369580483012914,.14461690358620832,.1688809751641721,.2627002120112671,.6779980715188708,.05930171646986196,0,.028072693049087428,1.060985057710791],n)},wk=function(n){return Pt([1.716651187971268,-.355670783776392,-.25336628137366,-.666684351832489,1.616481236634939,.0157685458139111,.017639857445311,-.042770613257809,.942103121235474],n)},bk=function(n){var e=mk([n[0],n[1],n[2]]);return yk([e[0],e[1],e[2]])},Bk=function(n){var e=vk(wk([n[0],n[1],n[2]])),t=e[0],r=e[1],i=e[2];return[t,r,i,n[3]]},Ck=function(n){var e=bk([n[0],n[1],n[2]]);return _A([e[0],e[1],e[2],n[3]])},ir={name:"color",parse:function(n,e){if(e.type===18){var t=Ek[e.name];if(typeof t>"u")throw new Error('Attempting to parse an unsupported color function "'.concat(e.name,'"'));return t(n,e.values)}if(e.type===5){var r=If(e),i=r[0],A=r[1],s=r[2],o=r[3];return yn(i,A,s,o)}if(e.type===20){var a=wn[e.value.toUpperCase()];if(typeof a<"u")return a}return wn.TRANSPARENT}},If=function(n){if(n.value.length===3){var e=n.value.substring(0,1),t=n.value.substring(1,2),r=n.value.substring(2,3);return[parseInt(e+e,16),parseInt(t+t,16),parseInt(r+r,16),1]}if(n.value.length===4){var e=n.value.substring(0,1),t=n.value.substring(1,2),r=n.value.substring(2,3),i=n.value.substring(3,4);return[parseInt(e+e,16),parseInt(t+t,16),parseInt(r+r,16),parseInt(i+i,16)/255]}if(n.value.length===6){var e=n.value.substring(0,2),t=n.value.substring(2,4),r=n.value.substring(4,6);return[parseInt(e,16),parseInt(t,16),parseInt(r,16),1]}if(n.value.length===8){var e=n.value.substring(0,2),t=n.value.substring(2,4),r=n.value.substring(4,6),i=n.value.substring(6,8);return[parseInt(e,16),parseInt(t,16),parseInt(r,16),parseInt(i,16)/255]}return[0,0,0,1]},Ff=function(n,e){var t=e.filter(gt);if(Or(t))throw new Error("Relative color not supported for rgb()");if(t.length===3){var r=t.map(Ys),i=r[0],A=r[1],s=r[2];return yn(i,A,s,1)}if(t.length===4){var o=t.map(Ys),i=o[0],A=o[1],s=o[2],a=o[3];return yn(i,A,s,a)}return 0},_k=function(n,e){var t=e.filter(gt),r=t[0].type===20?t[0].value:"unknown",i=!Or(t);if(i){var A=r,s=xf[A];if(typeof s>"u")throw new Error('Attempting to parse an unsupported color space "'.concat(A,'" for color() function'));var o=st(t[1])?t[1].number:0,a=st(t[2])?t[2].number:0,c=st(t[3])?t[3].number:0,u=t.length>4&&t[4].type===6&&t[4].value==="/"&&st(t[5])?t[5].number:1;return s([o,a,c,u])}else{var l=function(N,q){if(st(q))return q.number;var ge=function(be){return be==="r"||be==="x"?0:be==="g"||be==="y"?1:2};if(ae(q)){var Y=ge(q.value);return N[Y]}var re=function(be){for(var dt=be.filter(gt),Qe="(",De=0,te=dt;De<te.length;De++){var Ze=te[De];Qe+=Ze.type===18&&Ze.name==="calc"?re(Ze.values):st(Ze)?Ze.number:Ze.type===6||ae(Ze)?Ze.value:""}return Qe+=")",Qe};if(q.type===18){var xe=q.values.filter(gt);if(q.name==="calc"){var je=re(xe).replace(/r|x/,N[0].toString()).replace(/g|y/,N[1].toString()).replace(/b|z/,N[2].toString());return new Function("return "+je)()}}return null},d=t[1].type===18?t[1].name:ae(t[1])||t[1].type===5?"rgb":"unknown",h=ae(t[2])?t[2].value:"unknown",f=t[1].type===18?t[1].values:ae(t[1])?[t[1]]:[];if(ae(t[1])){var p=wn[t[1].value.toUpperCase()];if(typeof p>"u")throw new Error("Attempting to use unknown color in relative color 'from'");var g=pi(n,t[1].value),v=255&g,y=255&g>>8,b=255&g>>16,B=255&g>>24;f=[{type:17,number:B,flags:1},{type:17,number:b,flags:1},{type:17,number:y,flags:1},{type:17,number:v>1?v/255:v,flags:1}]}else if(t[1].type===5){var w=If(t[1]),B=w[0],b=w[1],y=w[2],v=w[3];f=[{type:17,number:B,flags:1},{type:17,number:b,flags:1},{type:17,number:y,flags:1},{type:17,number:v>1?v/255:v,flags:1}]}if(f.length===0)throw new Error("Attempting to use unknown color in relative color 'from'");if(h==="unknown")throw new Error("Attempting to use unknown colorspace in relative color 'to'");var _=Sk[d],k=kk[h],T=xf[h];if(typeof _>"u")throw new Error('Attempting to parse an unsupported color space "'.concat(d,'" for color() function'));if(typeof k>"u")throw new Error('Attempting to parse an unsupported color space "'.concat(h,'" for color() function'));var I=_(n,f),x=k(I),o=l(x,t[3]),a=l(x,t[4]),c=l(x,t[5]),u=t.length>6&&t[6].type===6&&t[6].value==="/"&&st(t[7])?t[7].number:1;if(o===null||a===null||c===null)throw new Error("Invalid relative color in color() function");return T([o,a,c,u])}},xf={srgb:PS,"srgb-linear":uu,"display-p3":rk,"a98-rgb":ck,"prophoto-rgb":gk,xyz:Uf,"xyz-d50":JS,"xyz-d65":Uf,rec2020:Ck},Sk={rgb:HS,hsl:NS,lab:KS,lch:VS,oklab:jS,oklch:GS},kk={srgb:zS,"srgb-linear":XS,"display-p3":nk,"a98-rgb":ak,"prophoto-rgb":fk,xyz:Ef,"xyz-d50":qS,"xyz-d65":Ef,rec2020:Bk},Ek={hsl:Bf,hsla:Bf,rgb:Ff,rgba:Ff,lch:DS,oklch:LS,oklab:MS,lab:OS,color:_k},pi=function(n,e){return ir.parse(n,df.create(e).parseComponentValue())},wn={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},Uk={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(n,e){return e.map(function(t){if(ae(t))switch(t.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},Tk={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},ro=function(n,e){var t=ir.parse(n,e[0]),r=e[1];return r&&Re(r)?{color:t,stop:r}:{color:t,stop:null}},Qf=function(n,e){var t=n[0],r=n[n.length-1];t.stop===null&&(t.stop=mt),r.stop===null&&(r.stop=tr);for(var i=[],A=0,s=0;s<n.length;s++){var o=n[s].stop;if(o!==null){var a=Se(o,e);a>A?i.push(a):i.push(A),A=a}else i.push(null)}for(var c=null,s=0;s<i.length;s++){var u=i[s];if(u===null)c===null&&(c=s);else if(c!==null){for(var l=s-c,d=i[c-1],h=(u-d)/(l+1),f=1;f<=l;f++)i[c+f-1]=h*f;c=null}}return n.map(function(p,g){var v=p.color;return{color:v,stop:Math.max(Math.min(1,i[g]/e),0)}})},Ik=function(n,e,t){var r=e/2,i=t/2,A=Se(n[0],e)-r,s=i-Se(n[1],t);return(Math.atan2(s,A)+Math.PI*2)%(Math.PI*2)},Fk=function(n,e,t){var r=typeof n=="number"?n:Ik(n,e,t),i=Math.abs(e*Math.sin(r))+Math.abs(t*Math.cos(r)),A=e/2,s=t/2,o=i/2,a=Math.sin(r-Math.PI/2)*o,c=Math.cos(r-Math.PI/2)*o;return[i,A-c,A+c,s-a,s+a]},nn=function(n,e){return Math.sqrt(n*n+e*e)},Rf=function(n,e,t,r,i){var A=[[0,0],[0,e],[n,0],[n,e]];return A.reduce(function(s,o){var a=o[0],c=o[1],u=nn(t-a,r-c);return(i?u<s.optimumDistance:u>s.optimumDistance)?{optimumCorner:o,optimumDistance:u}:s},{optimumDistance:i?1/0:-1/0,optimumCorner:null}).optimumCorner},xk=function(n,e,t,r,i){var A=0,s=0;switch(n.size){case 0:n.shape===0?A=s=Math.min(Math.abs(e),Math.abs(e-r),Math.abs(t),Math.abs(t-i)):n.shape===1&&(A=Math.min(Math.abs(e),Math.abs(e-r)),s=Math.min(Math.abs(t),Math.abs(t-i)));break;case 2:if(n.shape===0)A=s=Math.min(nn(e,t),nn(e,t-i),nn(e-r,t),nn(e-r,t-i));else if(n.shape===1){var o=Math.min(Math.abs(t),Math.abs(t-i))/Math.min(Math.abs(e),Math.abs(e-r)),a=Rf(r,i,e,t,!0),c=a[0],u=a[1];A=nn(c-e,(u-t)/o),s=o*A}break;case 1:n.shape===0?A=s=Math.max(Math.abs(e),Math.abs(e-r),Math.abs(t),Math.abs(t-i)):n.shape===1&&(A=Math.max(Math.abs(e),Math.abs(e-r)),s=Math.max(Math.abs(t),Math.abs(t-i)));break;case 3:if(n.shape===0)A=s=Math.max(nn(e,t),nn(e,t-i),nn(e-r,t),nn(e-r,t-i));else if(n.shape===1){var o=Math.max(Math.abs(t),Math.abs(t-i))/Math.max(Math.abs(e),Math.abs(e-r)),l=Rf(r,i,e,t,!1),c=l[0],u=l[1];A=nn(c-e,(u-t)/o),s=o*A}break}return Array.isArray(n.size)&&(A=Se(n.size[0],r),s=n.size.length===2?Se(n.size[1],i):A),[A,s]},Qk=function(n,e){var t=Wt(180),r=[];return vn(e).forEach(function(i,A){if(A===0){var s=i[0];if(s.type===20&&s.value==="to"){t=wf(i);return}else if(yf(s)){t=Xs.parse(n,s);return}}var o=ro(n,i);r.push(o)}),{angle:t,stops:r,type:1}},io=function(n,e){var t=Wt(180),r=[];return vn(e).forEach(function(i,A){if(A===0){var s=i[0];if(s.type===20&&["top","left","right","bottom"].indexOf(s.value)!==-1){t=wf(i);return}else if(yf(s)){t=(Xs.parse(n,s)+Wt(270))%Wt(360);return}}var o=ro(n,i);r.push(o)}),{angle:t,stops:r,type:1}},Rk=function(n,e){var t=Wt(180),r=[],i=1,A=0,s=3,o=[];return vn(e).forEach(function(a,c){var u=a[0];if(c===0){if(ae(u)&&u.value==="linear"){i=1;return}else if(ae(u)&&u.value==="radial"){i=2;return}}if(u.type===18){if(u.name==="from"){var l=ir.parse(n,u.values[0]);r.push({stop:mt,color:l})}else if(u.name==="to"){var l=ir.parse(n,u.values[0]);r.push({stop:tr,color:l})}else if(u.name==="color-stop"){var d=u.values.filter(gt);if(d.length===2){var l=ir.parse(n,d[1]),h=d[0];st(h)&&r.push({stop:{type:16,number:h.number*100,flags:h.flags},color:l})}}}}),i===1?{angle:(t+Wt(180))%Wt(360),stops:r,type:i}:{size:s,shape:A,stops:r,position:o,type:i}},Pf="closest-side",Of="farthest-side",Mf="closest-corner",Lf="farthest-corner",Df="circle",Hf="ellipse",Nf="cover",Kf="contain",Pk=function(n,e){var t=0,r=3,i=[],A=[];return vn(e).forEach(function(s,o){var a=!0;if(o===0){var c=!1;a=s.reduce(function(l,d){if(c)if(ae(d))switch(d.value){case"center":return A.push(cu),l;case"top":case"left":return A.push(mt),l;case"right":case"bottom":return A.push(tr),l}else(Re(d)||er(d))&&A.push(d);else if(ae(d))switch(d.value){case Df:return t=0,!1;case Hf:return t=1,!1;case"at":return c=!0,!1;case Pf:return r=0,!1;case Nf:case Of:return r=1,!1;case Kf:case Mf:return r=2,!1;case Lf:return r=3,!1}else if(er(d)||Re(d))return Array.isArray(r)||(r=[]),r.push(d),!1;return l},a)}if(a){var u=ro(n,s);i.push(u)}}),{size:r,shape:t,stops:i,position:A,type:2}},Ao=function(n,e){var t=0,r=3,i=[],A=[];return vn(e).forEach(function(s,o){var a=!0;if(o===0?a=s.reduce(function(u,l){if(ae(l))switch(l.value){case"center":return A.push(cu),!1;case"top":case"left":return A.push(mt),!1;case"right":case"bottom":return A.push(tr),!1}else if(Re(l)||er(l))return A.push(l),!1;return u},a):o===1&&(a=s.reduce(function(u,l){if(ae(l))switch(l.value){case Df:return t=0,!1;case Hf:return t=1,!1;case Kf:case Pf:return r=0,!1;case Of:return r=1,!1;case Mf:return r=2,!1;case Nf:case Lf:return r=3,!1}else if(er(l)||Re(l))return Array.isArray(r)||(r=[]),r.push(l),!1;return u},a)),a){var c=ro(n,s);i.push(c)}}),{size:r,shape:t,stops:i,position:A,type:2}},Ok=function(n){return n.type===1},Mk=function(n){return n.type===2},fu={name:"image",parse:function(n,e){if(e.type===22){var t={url:e.value,type:0};return n.cache.addImage(e.value),t}if(e.type===18){var r=Vf[e.name];if(typeof r>"u")throw new Error('Attempting to parse an unsupported image function "'.concat(e.name,'"'));return r(n,e.values)}throw new Error("Unsupported image type ".concat(e.type))}};function Lk(n){return!(n.type===20&&n.value==="none")&&(n.type!==18||!!Vf[n.name])}var Vf={"linear-gradient":Qk,"-moz-linear-gradient":io,"-ms-linear-gradient":io,"-o-linear-gradient":io,"-webkit-linear-gradient":io,"radial-gradient":Pk,"-moz-radial-gradient":Ao,"-ms-radial-gradient":Ao,"-o-radial-gradient":Ao,"-webkit-radial-gradient":Ao,"-webkit-gradient":Rk},Dk={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(n,e){if(e.length===0)return[];var t=e[0];return t.type===20&&t.value==="none"?[]:e.filter(function(r){return gt(r)&&Lk(r)}).map(function(r){return fu.parse(n,r)})}},Hk={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(n,e){return e.map(function(t){if(ae(t))switch(t.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},Nk={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(n,e){return vn(e).map(function(t){return t.filter(Re)}).map(pf)}},Kk={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(n,e){return vn(e).map(function(t){return t.filter(ae).map(function(r){return r.value}).join(" ")}).map(Vk)}},Vk=function(n){switch(n){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;case"repeat":default:return 0}},fi;(function(n){n.AUTO="auto",n.CONTAIN="contain",n.COVER="cover"})(fi||(fi={}));var Gk={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(n,e){return vn(e).map(function(t){return t.filter(jk)})}},jk=function(n){return ae(n)||Re(n)},so=function(n){return{name:"border-".concat(n,"-color"),initialValue:"transparent",prefix:!1,type:3,format:"color"}},Wk=so("top"),qk=so("right"),Jk=so("bottom"),zk=so("left"),oo=function(n){return{name:"border-radius-".concat(n),initialValue:"0 0",prefix:!1,type:1,parse:function(e,t){return pf(t.filter(Re))}}},Xk=oo("top-left"),Yk=oo("top-right"),Zk=oo("bottom-right"),$k=oo("bottom-left"),ao=function(n){return{name:"border-".concat(n,"-style"),initialValue:"solid",prefix:!1,type:2,parse:function(e,t){switch(t){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},eE=ao("top"),tE=ao("right"),nE=ao("bottom"),rE=ao("left"),co=function(n){return{name:"border-".concat(n,"-width"),initialValue:"0",type:0,prefix:!1,parse:function(e,t){return $n(t)?t.number:0}}},iE=co("top"),AE=co("right"),sE=co("bottom"),oE=co("left"),aE={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},cE={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(n,e){switch(e){case"rtl":return 1;case"ltr":default:return 0}}},uE={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(n,e){return e.filter(ae).reduce(function(t,r){return t|lE(r.value)},0)}},lE=function(n){switch(n){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},dE={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(n,e){switch(e){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},hE={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(n,e){return e.type===20&&e.value==="normal"?0:e.type===17||e.type===15?e.number:0}},uo;(function(n){n.NORMAL="normal",n.STRICT="strict"})(uo||(uo={}));var pE={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(n,e){switch(e){case"strict":return uo.STRICT;case"normal":default:return uo.NORMAL}}},fE={name:"line-height",initialValue:"normal",prefix:!1,type:4},Gf=function(n,e){return ae(n)&&n.value==="normal"?1.2*e:n.type===17?e*n.number:Re(n)?Se(n,e):e},gE={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(n,e){return e.type===20&&e.value==="none"?null:fu.parse(n,e)}},mE={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(n,e){switch(e){case"inside":return 0;case"outside":default:return 1}}},gu={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(n,e){switch(e){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":return 22;case"hebrew":return 52;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;case"none":default:return-1}}},lo=function(n){return{name:"margin-".concat(n),initialValue:"0",prefix:!1,type:4}},vE=lo("top"),yE=lo("right"),wE=lo("bottom"),bE=lo("left"),BE={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(n,e){return e.filter(ae).map(function(t){switch(t.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;case"visible":default:return 0}})}},CE={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(n,e){switch(e){case"break-word":return"break-word";case"normal":default:return"normal"}}},ho=function(n){return{name:"padding-".concat(n),initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},_E=ho("top"),SE=ho("right"),kE=ho("bottom"),EE=ho("left"),UE={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(n,e){switch(e){case"right":return 2;case"center":case"justify":return 1;case"left":default:return 0}}},TE={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(n,e){switch(e){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},IE={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(n,e){return e.length===1&&au(e[0],"none")?[]:vn(e).map(function(t){for(var r={color:wn.TRANSPARENT,offsetX:mt,offsetY:mt,blur:mt},i=0,A=0;A<t.length;A++){var s=t[A];er(s)?(i===0?r.offsetX=s:i===1?r.offsetY=s:r.blur=s,i++):r.color=ir.parse(n,s)}return r})}},FE={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(n,e){switch(e){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},xE={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(n,e){if(e.type===20&&e.value==="none")return null;if(e.type===18){var t=PE[e.name];if(typeof t>"u")throw new Error('Attempting to parse an unsupported transform function "'.concat(e.name,'"'));return t(e.values)}return null}},QE=function(n){var e=n.filter(function(t){return t.type===17}).map(function(t){return t.number});return e.length===6?e:null},RE=function(n){var e=n.filter(function(a){return a.type===17}).map(function(a){return a.number}),t=e[0],r=e[1];e[2],e[3];var i=e[4],A=e[5];e[6],e[7],e[8],e[9],e[10],e[11];var s=e[12],o=e[13];return e[14],e[15],e.length===16?[t,r,i,A,s,o]:null},PE={matrix:QE,matrix3d:RE},jf={type:16,number:50,flags:vA},OE=[jf,jf],ME={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(n,e){var t=e.filter(Re);return t.length!==2?OE:[t[0],t[1]]}},LE={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(n,e){switch(e){case"hidden":return 1;case"collapse":return 2;case"visible":default:return 0}}},SA;(function(n){n.NORMAL="normal",n.BREAK_ALL="break-all",n.KEEP_ALL="keep-all"})(SA||(SA={}));for(var DE={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(n,e){switch(e){case"break-all":return SA.BREAK_ALL;case"keep-all":return SA.KEEP_ALL;case"normal":default:return SA.NORMAL}}},HE={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(n,e){if(e.type===20)return{auto:!0,order:0};if(st(e))return{auto:!1,order:e.number};throw new Error("Invalid z-index number parsed")}},Wf={name:"time",parse:function(n,e){if(e.type===15)switch(e.unit.toLowerCase()){case"s":return 1e3*e.number;case"ms":return e.number}throw new Error("Unsupported time type")}},NE={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(n,e){return st(e)?e.number:1}},KE={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},VE={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(n,e){return e.filter(ae).map(function(t){switch(t.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0}).filter(function(t){return t!==0})}},GE={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(n,e){var t=[],r=[];return e.forEach(function(i){switch(i.type){case 20:case 0:t.push(i.value);break;case 17:t.push(i.number.toString());break;case 4:r.push(t.join(" ")),t.length=0;break}}),t.length&&r.push(t.join(" ")),r.map(function(i){return i.indexOf(" ")===-1?i:"'".concat(i,"'")})}},jE={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},WE={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(n,e){if(st(e))return e.number;if(ae(e))switch(e.value){case"bold":return 700;case"normal":default:return 400}return 400}},qE={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(n,e){return e.filter(ae).map(function(t){return t.value})}},JE={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(n,e){switch(e){case"oblique":return"oblique";case"italic":return"italic";case"normal":default:return"normal"}}},ct=function(n,e){return(n&e)!==0},zE={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(n,e){if(e.length===0)return[];var t=e[0];return t.type===20&&t.value==="none"?[]:e}},XE={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(n,e){if(e.length===0)return null;var t=e[0];if(t.type===20&&t.value==="none")return null;for(var r=[],i=e.filter(hf),A=0;A<i.length;A++){var s=i[A],o=i[A+1];if(s.type===20){var a=o&&st(o)?o.number:1;r.push({counter:s.value,increment:a})}}return r}},YE={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(n,e){if(e.length===0)return[];for(var t=[],r=e.filter(hf),i=0;i<r.length;i++){var A=r[i],s=r[i+1];if(ae(A)&&A.value!=="none"){var o=s&&st(s)?s.number:0;t.push({counter:A.value,reset:o})}}return t}},ZE={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(n,e){return e.filter($n).map(function(t){return Wf.parse(n,t)})}},$E={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(n,e){if(e.length===0)return null;var t=e[0];if(t.type===20&&t.value==="none")return null;var r=[],i=e.filter(QS);if(i.length%2!==0)return null;for(var A=0;A<i.length;A+=2){var s=i[A].value,o=i[A+1].value;r.push({open:s,close:o})}return r}},qf=function(n,e,t){if(!n)return"";var r=n[Math.min(e,n.length-1)];return r?t?r.open:r.close:""},eU={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(n,e){return e.length===1&&au(e[0],"none")?[]:vn(e).map(function(t){for(var r={color:255,offsetX:mt,offsetY:mt,blur:mt,spread:mt,inset:!1},i=0,A=0;A<t.length;A++){var s=t[A];au(s,"inset")?r.inset=!0:er(s)?(i===0?r.offsetX=s:i===1?r.offsetY=s:i===2?r.blur=s:r.spread=s,i++):r.color=ir.parse(n,s)}return r})}},tU={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(n,e){var t=[0,1,2],r=[];return e.filter(ae).forEach(function(i){switch(i.value){case"stroke":r.push(1);break;case"fill":r.push(0);break;case"markers":r.push(2);break}}),t.forEach(function(i){r.indexOf(i)===-1&&r.push(i)}),r}},nU={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},rU={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(n,e){return $n(e)?e.number:0}},iU={name:"objectFit",initialValue:"fill",prefix:!1,type:1,parse:function(n,e){return e.filter(ae).reduce(function(t,r){return t|AU(r.value)},0)}},AU=function(n){switch(n){case"contain":return 2;case"cover":return 4;case"none":return 8;case"scale-down":return 16}return 0},sU=function(){function n(e,t){var r,i;this.animationDuration=j(e,ZE,t.animationDuration),this.backgroundClip=j(e,Uk,t.backgroundClip),this.backgroundColor=j(e,Tk,t.backgroundColor),this.backgroundImage=j(e,Dk,t.backgroundImage),this.backgroundOrigin=j(e,Hk,t.backgroundOrigin),this.backgroundPosition=j(e,Nk,t.backgroundPosition),this.backgroundRepeat=j(e,Kk,t.backgroundRepeat),this.backgroundSize=j(e,Gk,t.backgroundSize),this.borderTopColor=j(e,Wk,t.borderTopColor),this.borderRightColor=j(e,qk,t.borderRightColor),this.borderBottomColor=j(e,Jk,t.borderBottomColor),this.borderLeftColor=j(e,zk,t.borderLeftColor),this.borderTopLeftRadius=j(e,Xk,t.borderTopLeftRadius),this.borderTopRightRadius=j(e,Yk,t.borderTopRightRadius),this.borderBottomRightRadius=j(e,Zk,t.borderBottomRightRadius),this.borderBottomLeftRadius=j(e,$k,t.borderBottomLeftRadius),this.borderTopStyle=j(e,eE,t.borderTopStyle),this.borderRightStyle=j(e,tE,t.borderRightStyle),this.borderBottomStyle=j(e,nE,t.borderBottomStyle),this.borderLeftStyle=j(e,rE,t.borderLeftStyle),this.borderTopWidth=j(e,iE,t.borderTopWidth),this.borderRightWidth=j(e,AE,t.borderRightWidth),this.borderBottomWidth=j(e,sE,t.borderBottomWidth),this.borderLeftWidth=j(e,oE,t.borderLeftWidth),this.boxShadow=j(e,eU,t.boxShadow),this.color=j(e,aE,t.color),this.direction=j(e,cE,t.direction),this.display=j(e,uE,t.display),this.float=j(e,dE,t.cssFloat),this.fontFamily=j(e,GE,t.fontFamily),this.fontSize=j(e,jE,t.fontSize),this.fontStyle=j(e,JE,t.fontStyle),this.fontVariant=j(e,qE,t.fontVariant),this.fontWeight=j(e,WE,t.fontWeight),this.letterSpacing=j(e,hE,t.letterSpacing),this.lineBreak=j(e,pE,t.lineBreak),this.lineHeight=j(e,fE,t.lineHeight),this.listStyleImage=j(e,gE,t.listStyleImage),this.listStylePosition=j(e,mE,t.listStylePosition),this.listStyleType=j(e,gu,t.listStyleType),this.marginTop=j(e,vE,t.marginTop),this.marginRight=j(e,yE,t.marginRight),this.marginBottom=j(e,wE,t.marginBottom),this.marginLeft=j(e,bE,t.marginLeft),this.opacity=j(e,NE,t.opacity);var A=j(e,BE,t.overflow);this.overflowX=A[0],this.overflowY=A[A.length>1?1:0],this.overflowWrap=j(e,CE,t.overflowWrap),this.paddingTop=j(e,_E,t.paddingTop),this.paddingRight=j(e,SE,t.paddingRight),this.paddingBottom=j(e,kE,t.paddingBottom),this.paddingLeft=j(e,EE,t.paddingLeft),this.paintOrder=j(e,tU,t.paintOrder),this.position=j(e,TE,t.position),this.textAlign=j(e,UE,t.textAlign),this.textDecorationColor=j(e,KE,(r=t.textDecorationColor)!==null&&r!==void 0?r:t.color),this.textDecorationLine=j(e,VE,(i=t.textDecorationLine)!==null&&i!==void 0?i:t.textDecoration),this.textShadow=j(e,IE,t.textShadow),this.textTransform=j(e,FE,t.textTransform),this.transform=j(e,xE,t.transform),this.transformOrigin=j(e,ME,t.transformOrigin),this.visibility=j(e,LE,t.visibility),this.webkitTextStrokeColor=j(e,nU,t.webkitTextStrokeColor),this.webkitTextStrokeWidth=j(e,rU,t.webkitTextStrokeWidth),this.wordBreak=j(e,DE,t.wordBreak),this.zIndex=j(e,HE,t.zIndex),this.objectFit=j(e,iU,t.objectFit)}return n.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&this.visibility===0},n.prototype.isTransparent=function(){return nr(this.backgroundColor)},n.prototype.isTransformed=function(){return this.transform!==null},n.prototype.isPositioned=function(){return this.position!==0},n.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},n.prototype.isFloating=function(){return this.float!==0},n.prototype.isInlineLevel=function(){return ct(this.display,4)||ct(this.display,33554432)||ct(this.display,268435456)||ct(this.display,536870912)||ct(this.display,67108864)||ct(this.display,134217728)},n}(),oU=function(){function n(e,t){this.content=j(e,zE,t.content),this.quotes=j(e,$E,t.quotes)}return n}(),Jf=function(){function n(e,t){this.counterIncrement=j(e,XE,t.counterIncrement),this.counterReset=j(e,YE,t.counterReset)}return n}(),j=function(n,e,t){var r=new lf,i=t!==null&&typeof t<"u"?t.toString():e.initialValue;r.write(i);var A=new df(r.read());switch(e.type){case 2:var s=A.parseComponentValue();return e.parse(n,ae(s)?s.value:e.initialValue);case 0:return e.parse(n,A.parseComponentValue());case 1:return e.parse(n,A.parseComponentValues());case 4:return A.parseComponentValue();case 3:switch(e.format){case"angle":return Xs.parse(n,A.parseComponentValue());case"color":return ir.parse(n,A.parseComponentValue());case"image":return fu.parse(n,A.parseComponentValue());case"length":var o=A.parseComponentValue();return er(o)?o:mt;case"length-percentage":var a=A.parseComponentValue();return Re(a)?a:mt;case"time":return Wf.parse(n,A.parseComponentValue())}break}},aU="data-html2canvas-debug",cU=function(n){var e=n.getAttribute(aU);switch(e){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}},mu=function(n,e){var t=cU(n);return t===1||e===t},bn=function(){function n(e,t){this.context=e,this.textNodes=[],this.elements=[],this.flags=0,mu(t,3),this.styles=new sU(e,window.getComputedStyle(t,null)),Fu(t)&&(this.styles.animationDuration.some(function(r){return r>0})&&(t.style.animationDuration="0s"),this.styles.transform!==null&&(t.style.transform="none")),this.bounds=Is(this.context,t),mu(t,4)&&(this.flags|=16)}return n}(),uU="AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=",zf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",kA=typeof Uint8Array>"u"?[]:new Uint8Array(256),po=0;po<zf.length;po++)kA[zf.charCodeAt(po)]=po;for(var lU=function(n){var e=n.length*.75,t=n.length,r,i=0,A,s,o,a;n[n.length-1]==="="&&(e--,n[n.length-2]==="="&&e--);var c=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(e):new Array(e),u=Array.isArray(c)?c:new Uint8Array(c);for(r=0;r<t;r+=4)A=kA[n.charCodeAt(r)],s=kA[n.charCodeAt(r+1)],o=kA[n.charCodeAt(r+2)],a=kA[n.charCodeAt(r+3)],u[i++]=A<<2|s>>4,u[i++]=(s&15)<<4|o>>2,u[i++]=(o&3)<<6|a&63;return c},dU=function(n){for(var e=n.length,t=[],r=0;r<e;r+=2)t.push(n[r+1]<<8|n[r]);return t},hU=function(n){for(var e=n.length,t=[],r=0;r<e;r+=4)t.push(n[r+3]<<24|n[r+2]<<16|n[r+1]<<8|n[r]);return t},Lr=5,vu=6+5,yu=2,pU=vu-Lr,Xf=65536>>Lr,fU=1<<Lr,wu=fU-1,gU=1024>>Lr,mU=Xf+gU,vU=mU,yU=32,wU=vU+yU,bU=65536>>vu,BU=1<<pU,CU=BU-1,Yf=function(n,e,t){return n.slice?n.slice(e,t):new Uint16Array(Array.prototype.slice.call(n,e,t))},_U=function(n,e,t){return n.slice?n.slice(e,t):new Uint32Array(Array.prototype.slice.call(n,e,t))},SU=function(n,e){var t=lU(n),r=Array.isArray(t)?hU(t):new Uint32Array(t),i=Array.isArray(t)?dU(t):new Uint16Array(t),A=24,s=Yf(i,A/2,r[4]/2),o=r[5]===2?Yf(i,(A+r[4])/2):_U(r,Math.ceil((A+r[4])/4));return new kU(r[0],r[1],r[2],r[3],s,o)},kU=function(){function n(e,t,r,i,A,s){this.initialValue=e,this.errorValue=t,this.highStart=r,this.highValueIndex=i,this.index=A,this.data=s}return n.prototype.get=function(e){var t;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=this.index[e>>Lr],t=(t<<yu)+(e&wu),this.data[t];if(e<=65535)return t=this.index[Xf+(e-55296>>Lr)],t=(t<<yu)+(e&wu),this.data[t];if(e<this.highStart)return t=wU-bU+(e>>vu),t=this.index[t],t+=e>>Lr&CU,t=this.index[t],t=(t<<yu)+(e&wu),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},n}(),Zf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",EU=typeof Uint8Array>"u"?[]:new Uint8Array(256),fo=0;fo<Zf.length;fo++)EU[Zf.charCodeAt(fo)]=fo;var UU=1,bu=2,Bu=3,$f=4,eg=5,TU=7,tg=8,Cu=9,_u=10,ng=11,rg=12,ig=13,Ag=14,Su=15,IU=function(n){for(var e=[],t=0,r=n.length;t<r;){var i=n.charCodeAt(t++);if(i>=55296&&i<=56319&&t<r){var A=n.charCodeAt(t++);(A&64512)===56320?e.push(((i&1023)<<10)+(A&1023)+65536):(e.push(i),t--)}else e.push(i)}return e},FU=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,n);var t=n.length;if(!t)return"";for(var r=[],i=-1,A="";++i<t;){var s=n[i];s<=65535?r.push(s):(s-=65536,r.push((s>>10)+55296,s%1024+56320)),(i+1===t||r.length>16384)&&(A+=String.fromCharCode.apply(String,r),r.length=0)}return A},xU=SU(uU),qt="×",ku="÷",QU=function(n){return xU.get(n)},RU=function(n,e,t){var r=t-2,i=e[r],A=e[t-1],s=e[t];if(A===bu&&s===Bu)return qt;if(A===bu||A===Bu||A===$f||s===bu||s===Bu||s===$f)return ku;if(A===tg&&[tg,Cu,ng,rg].indexOf(s)!==-1||(A===ng||A===Cu)&&(s===Cu||s===_u)||(A===rg||A===_u)&&s===_u||s===ig||s===eg||s===TU||A===UU)return qt;if(A===ig&&s===Ag){for(;i===eg;)i=e[--r];if(i===Ag)return qt}if(A===Su&&s===Su){for(var o=0;i===Su;)o++,i=e[--r];if(o%2===0)return qt}return ku},PU=function(n){var e=IU(n),t=e.length,r=0,i=0,A=e.map(QU);return{next:function(){if(r>=t)return{done:!0,value:null};for(var s=qt;r<t&&(s=RU(e,A,++r))===qt;);if(s!==qt||r===t){var o=FU.apply(null,e.slice(i,r));return i=r,{value:o,done:!1}}return{done:!0,value:null}}}},OU=function(n){for(var e=PU(n),t=[],r;!(r=e.next()).done;)r.value&&t.push(r.value.slice());return t},MU=function(n){var e=123;if(n.createRange){var t=n.createRange();if(t.getBoundingClientRect){var r=n.createElement("boundtest");r.style.height="".concat(e,"px"),r.style.display="block",n.body.appendChild(r),t.selectNode(r);var i=t.getBoundingClientRect(),A=Math.round(i.height);if(n.body.removeChild(r),A===e)return!0}}return!1},LU=function(n){var e=n.createElement("boundtest");e.style.width="50px",e.style.display="block",e.style.fontSize="12px",e.style.letterSpacing="0px",e.style.wordSpacing="0px",n.body.appendChild(e);var t=n.createRange();e.innerHTML=typeof"".repeat=="function"?"&#128104;".repeat(10):"";var r=e.firstChild,i=Fs(r.data).map(function(a){return $e(a)}),A=0,s={},o=i.every(function(a,c){t.setStart(r,A),t.setEnd(r,A+a.length);var u=t.getBoundingClientRect();A+=a.length;var l=u.x>s.x||u.y>s.y;return s=u,c===0?!0:l});return n.body.removeChild(e),o},DU=function(){return typeof new Image().crossOrigin<"u"},HU=function(){return typeof new XMLHttpRequest().responseType=="string"},NU=function(n){var e=new Image,t=n.createElement("canvas"),r=t.getContext("2d");if(!r)return!1;e.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{r.drawImage(e,0,0),t.toDataURL()}catch{return!1}return!0},sg=function(n){return n[0]===0&&n[1]===255&&n[2]===0&&n[3]===255},KU=function(n){var e=n.createElement("canvas"),t=100;e.width=t,e.height=t;var r=e.getContext("2d");if(!r)return Promise.reject(!1);r.fillStyle="rgb(0, 255, 0)",r.fillRect(0,0,t,t);var i=new Image,A=e.toDataURL();i.src=A;var s=Eu(t,t,0,0,i);return r.fillStyle="red",r.fillRect(0,0,t,t),og(s).then(function(o){r.drawImage(o,0,0);var a=r.getImageData(0,0,t,t).data;r.fillStyle="red",r.fillRect(0,0,t,t);var c=n.createElement("div");return c.style.backgroundImage="url(".concat(A,")"),c.style.height="".concat(t,"px"),sg(a)?og(Eu(t,t,0,0,c)):Promise.reject(!1)}).then(function(o){return r.drawImage(o,0,0),sg(r.getImageData(0,0,t,t).data)}).catch(function(){return!1})},Eu=function(n,e,t,r,i){var A="http://www.w3.org/2000/svg",s=document.createElementNS(A,"svg"),o=document.createElementNS(A,"foreignObject");return s.setAttributeNS(null,"width",n.toString()),s.setAttributeNS(null,"height",e.toString()),o.setAttributeNS(null,"width","100%"),o.setAttributeNS(null,"height","100%"),o.setAttributeNS(null,"x",t.toString()),o.setAttributeNS(null,"y",r.toString()),o.setAttributeNS(null,"externalResourcesRequired","true"),s.appendChild(o),o.appendChild(i),s},og=function(n){return new Promise(function(e,t){var r=new Image;r.onload=function(){return e(r)},r.onerror=t,r.src="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent(new XMLSerializer().serializeToString(n)))})},vt={get SUPPORT_RANGE_BOUNDS(){var n=MU(document);return Object.defineProperty(vt,"SUPPORT_RANGE_BOUNDS",{value:n}),n},get SUPPORT_WORD_BREAKING(){var n=vt.SUPPORT_RANGE_BOUNDS&&LU(document);return Object.defineProperty(vt,"SUPPORT_WORD_BREAKING",{value:n}),n},get SUPPORT_SVG_DRAWING(){var n=NU(document);return Object.defineProperty(vt,"SUPPORT_SVG_DRAWING",{value:n}),n},get SUPPORT_FOREIGNOBJECT_DRAWING(){var n=typeof Array.from=="function"&&typeof window.fetch=="function"?KU(document):Promise.resolve(!1);return Object.defineProperty(vt,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:n}),n},get SUPPORT_CORS_IMAGES(){var n=DU();return Object.defineProperty(vt,"SUPPORT_CORS_IMAGES",{value:n}),n},get SUPPORT_RESPONSE_TYPE(){var n=HU();return Object.defineProperty(vt,"SUPPORT_RESPONSE_TYPE",{value:n}),n},get SUPPORT_CORS_XHR(){var n="withCredentials"in new XMLHttpRequest;return Object.defineProperty(vt,"SUPPORT_CORS_XHR",{value:n}),n},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var n=!!(typeof Intl<"u"&&Intl.Segmenter);return Object.defineProperty(vt,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:n}),n}},EA=function(){function n(e,t){this.text=e,this.bounds=t}return n}(),VU=function(n,e,t,r){var i=WU(e,t),A=[],s=0;return i.forEach(function(o){if(t.textDecorationLine.length||o.trim().length>0)if(vt.SUPPORT_RANGE_BOUNDS){var a=ag(r,s,o.length).getClientRects();if(a.length>1){var c=Uu(o),u=0;c.forEach(function(d){A.push(new EA(d,Qn.fromDOMRectList(n,ag(r,u+s,d.length).getClientRects()))),u+=d.length})}else A.push(new EA(o,Qn.fromDOMRectList(n,a)))}else{var l=r.splitText(o.length);A.push(new EA(o,GU(n,r))),r=l}else vt.SUPPORT_RANGE_BOUNDS||(r=r.splitText(o.length));s+=o.length}),A},GU=function(n,e){var t=e.ownerDocument;if(t){var r=t.createElement("html2canvaswrapper");r.appendChild(e.cloneNode(!0));var i=e.parentNode;if(i){i.replaceChild(r,e);var A=Is(n,r);return r.firstChild&&i.replaceChild(r.firstChild,r),A}}return Qn.EMPTY},ag=function(n,e,t){var r=n.ownerDocument;if(!r)throw new Error("Node has no owner document");var i=r.createRange();return i.setStart(n,e),i.setEnd(n,e+t),i},Uu=function(n){if(vt.SUPPORT_NATIVE_TEXT_SEGMENTATION){var e=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(e.segment(n)).map(function(t){return t.segment})}return OU(n)},jU=function(n,e){if(vt.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(t.segment(n)).map(function(r){return r.segment})}return JU(n,e)},WU=function(n,e){return e.letterSpacing!==0?Uu(n):jU(n,e)},qU=[32,160,4961,65792,65793,4153,4241],JU=function(n,e){for(var t=E_(n,{lineBreak:e.lineBreak,wordBreak:e.overflowWrap==="break-word"?"break-word":e.wordBreak}),r=[],i,A=function(){if(i.value){var s=i.value.slice(),o=Fs(s),a="";o.forEach(function(c){qU.indexOf(c)===-1?a+=$e(c):(a.length&&r.push(a),r.push($e(c)),a="")}),a.length&&r.push(a)}};!(i=t.next()).done;)A();return r},zU=function(){function n(e,t,r){this.text=XU(t.data,r.textTransform),this.textBounds=VU(e,this.text,r,t)}return n}(),XU=function(n,e){switch(e){case 1:return n.toLowerCase();case 3:return n.replace(YU,ZU);case 2:return n.toUpperCase();default:return n}},YU=/(^|\s|:|-|\(|\))([a-z])/g,ZU=function(n,e,t){return n.length>0?e+t.toUpperCase():n},cg=function(n){tn(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.src=r.currentSrc||r.src,i.intrinsicWidth=r.naturalWidth,i.intrinsicHeight=r.naturalHeight,i.context.cache.addImage(i.src),i}return e}(bn),ug=function(n){tn(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.canvas=r,i.intrinsicWidth=r.width,i.intrinsicHeight=r.height,i}return e}(bn),lg=function(n){tn(e,n);function e(t,r){var i=n.call(this,t,r)||this,A=new XMLSerializer,s=Is(t,r);return r.setAttribute("width","".concat(s.width,"px")),r.setAttribute("height","".concat(s.height,"px")),i.svg="data:image/svg+xml,".concat(encodeURIComponent(A.serializeToString(r))),i.intrinsicWidth=r.width.baseVal.value,i.intrinsicHeight=r.height.baseVal.value,i.context.cache.addImage(i.svg),i}return e}(bn),dg=function(n){tn(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.value=r.value,i}return e}(bn),Tu=function(n){tn(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.start=r.start,i.reversed=typeof r.reversed=="boolean"&&r.reversed===!0,i}return e}(bn),$U=[{type:15,flags:0,unit:"px",number:3}],e1=[{type:16,flags:0,number:50}],t1=function(n){return n.width>n.height?new Qn(n.left+(n.width-n.height)/2,n.top,n.height,n.height):n.width<n.height?new Qn(n.left,n.top+(n.height-n.width)/2,n.width,n.width):n},n1=function(n){var e=n.type===r1?new Array(n.value.length+1).join("•"):n.value;return e.length===0?n.placeholder||"":e},go="checkbox",mo="radio",r1="password",hg=707406591,Iu=function(n){tn(e,n);function e(t,r){var i=n.call(this,t,r)||this;switch(i.type=r.type.toLowerCase(),i.checked=r.checked,i.value=n1(r),(i.type===go||i.type===mo)&&(i.styles.backgroundColor=3739148031,i.styles.borderTopColor=i.styles.borderRightColor=i.styles.borderBottomColor=i.styles.borderLeftColor=2779096575,i.styles.borderTopWidth=i.styles.borderRightWidth=i.styles.borderBottomWidth=i.styles.borderLeftWidth=1,i.styles.borderTopStyle=i.styles.borderRightStyle=i.styles.borderBottomStyle=i.styles.borderLeftStyle=1,i.styles.backgroundClip=[0],i.styles.backgroundOrigin=[0],i.bounds=t1(i.bounds)),i.type){case go:i.styles.borderTopRightRadius=i.styles.borderTopLeftRadius=i.styles.borderBottomRightRadius=i.styles.borderBottomLeftRadius=$U;break;case mo:i.styles.borderTopRightRadius=i.styles.borderTopLeftRadius=i.styles.borderBottomRightRadius=i.styles.borderBottomLeftRadius=e1;break}return i}return e}(bn),pg=function(n){tn(e,n);function e(t,r){var i=n.call(this,t,r)||this,A=r.options[r.selectedIndex||0];return i.value=A&&A.text||"",i}return e}(bn),fg=function(n){tn(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.value=r.value,i}return e}(bn),gg=function(n){tn(e,n);function e(t,r){var i=n.call(this,t,r)||this;i.src=r.src,i.width=parseInt(r.width,10)||0,i.height=parseInt(r.height,10)||0,i.backgroundColor=i.styles.backgroundColor;try{if(r.contentWindow&&r.contentWindow.document&&r.contentWindow.document.documentElement){i.tree=vg(t,r.contentWindow.document.documentElement);var A=r.contentWindow.document.documentElement?pi(t,getComputedStyle(r.contentWindow.document.documentElement).backgroundColor):wn.TRANSPARENT,s=r.contentWindow.document.body?pi(t,getComputedStyle(r.contentWindow.document.body).backgroundColor):wn.TRANSPARENT;i.backgroundColor=nr(A)?nr(s)?i.styles.backgroundColor:s:A}}catch{}return i}return e}(bn),i1=["OL","UL","MENU"],vo=function(n,e,t,r){for(var i=e.firstChild,A=void 0;i;i=A)if(A=i.nextSibling,yg(i)&&i.data.length>0)t.textNodes.push(new zU(n,i,t.styles));else if(gi(i))if(Sg(i)&&i.assignedNodes)i.assignedNodes().forEach(function(o){return vo(n,o,t,r)});else{var s=mg(n,i);s.styles.isVisible()&&(A1(i,s,r)?s.flags|=4:s1(s.styles)&&(s.flags|=2),i1.indexOf(i.tagName)!==-1&&(s.flags|=8),t.elements.push(s),i.slot,i.shadowRoot?vo(n,i.shadowRoot,s,r):!wo(i)&&!wg(i)&&!bo(i)&&vo(n,i,s,r))}},mg=function(n,e){return Qu(e)?new cg(n,e):bg(e)?new ug(n,e):wg(e)?new lg(n,e):o1(e)?new dg(n,e):a1(e)?new Tu(n,e):c1(e)?new Iu(n,e):bo(e)?new pg(n,e):wo(e)?new fg(n,e):Cg(e)?new gg(n,e):new bn(n,e)},vg=function(n,e){var t=mg(n,e);return t.flags|=4,vo(n,e,t,t),t},A1=function(n,e,t){return e.styles.isPositionedWithZIndex()||e.styles.opacity<1||e.styles.isTransformed()||xu(n)&&t.styles.isTransparent()},s1=function(n){return n.isPositioned()||n.isFloating()},yg=function(n){return n.nodeType===Node.TEXT_NODE},gi=function(n){return n.nodeType===Node.ELEMENT_NODE},Fu=function(n){return gi(n)&&typeof n.style<"u"&&!yo(n)},yo=function(n){return typeof n.className=="object"},o1=function(n){return n.tagName==="LI"},a1=function(n){return n.tagName==="OL"},c1=function(n){return n.tagName==="INPUT"},u1=function(n){return n.tagName==="HTML"},wg=function(n){return n.tagName==="svg"},xu=function(n){return n.tagName==="BODY"},bg=function(n){return n.tagName==="CANVAS"},Bg=function(n){return n.tagName==="VIDEO"},Qu=function(n){return n.tagName==="IMG"},Cg=function(n){return n.tagName==="IFRAME"},_g=function(n){return n.tagName==="STYLE"},l1=function(n){return n.tagName==="SCRIPT"},wo=function(n){return n.tagName==="TEXTAREA"},bo=function(n){return n.tagName==="SELECT"},Sg=function(n){return n.tagName==="SLOT"},kg=function(n){return n.tagName.indexOf("-")>0},d1=function(){function n(){this.counters={}}return n.prototype.getCounterValue=function(e){var t=this.counters[e];return t&&t.length?t[t.length-1]:1},n.prototype.getCounterValues=function(e){var t=this.counters[e];return t||[]},n.prototype.pop=function(e){var t=this;e.forEach(function(r){return t.counters[r].pop()})},n.prototype.parse=function(e){var t=this,r=e.counterIncrement,i=e.counterReset,A=!0;r!==null&&r.forEach(function(o){var a=t.counters[o.counter];a&&o.increment!==0&&(A=!1,a.length||a.push(1),a[Math.max(0,a.length-1)]+=o.increment)});var s=[];return A&&i.forEach(function(o){var a=t.counters[o.counter];s.push(o.counter),a||(a=t.counters[o.counter]=[]),a.push(o.reset)}),s},n}(),Eg={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},Ug={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},h1={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},p1={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},mi=function(n,e,t,r,i,A){return n<e||n>t?TA(n,i,A.length>0):r.integers.reduce(function(s,o,a){for(;n>=o;)n-=o,s+=r.values[a];return s},"")+A},Tg=function(n,e,t,r){var i="";do t||n--,i=r(n)+i,n/=e;while(n*e>=e);return i},et=function(n,e,t,r,i){var A=t-e+1;return(n<0?"-":"")+(Tg(Math.abs(n),A,r,function(s){return $e(Math.floor(s%A)+e)})+i)},Dr=function(n,e,t){t===void 0&&(t=". ");var r=e.length;return Tg(Math.abs(n),r,!1,function(i){return e[Math.floor(i%r)]})+t},vi=1,Ar=2,sr=4,UA=8,Pn=function(n,e,t,r,i,A){if(n<-9999||n>9999)return TA(n,4,i.length>0);var s=Math.abs(n),o=i;if(s===0)return e[0]+o;for(var a=0;s>0&&a<=4;a++){var c=s%10;c===0&&ct(A,vi)&&o!==""?o=e[c]+o:c>1||c===1&&a===0||c===1&&a===1&&ct(A,Ar)||c===1&&a===1&&ct(A,sr)&&n>100||c===1&&a>1&&ct(A,UA)?o=e[c]+(a>0?t[a-1]:"")+o:c===1&&a>0&&(o=t[a-1]+o),s=Math.floor(s/10)}return(n<0?r:"")+o},Ig="十百千萬",Fg="拾佰仟萬",xg="マイナス",Ru="마이너스",TA=function(n,e,t){var r=t?". ":"",i=t?"、":"",A=t?", ":"",s=t?" ":"";switch(e){case 0:return"•"+s;case 1:return"◦"+s;case 2:return"◾"+s;case 5:var o=et(n,48,57,!0,r);return o.length<4?"0".concat(o):o;case 4:return Dr(n,"〇一二三四五六七八九",i);case 6:return mi(n,1,3999,Eg,3,r).toLowerCase();case 7:return mi(n,1,3999,Eg,3,r);case 8:return et(n,945,969,!1,r);case 9:return et(n,97,122,!1,r);case 10:return et(n,65,90,!1,r);case 11:return et(n,1632,1641,!0,r);case 12:case 49:return mi(n,1,9999,Ug,3,r);case 35:return mi(n,1,9999,Ug,3,r).toLowerCase();case 13:return et(n,2534,2543,!0,r);case 14:case 30:return et(n,6112,6121,!0,r);case 15:return Dr(n,"子丑寅卯辰巳午未申酉戌亥",i);case 16:return Dr(n,"甲乙丙丁戊己庚辛壬癸",i);case 17:case 48:return Pn(n,"零一二三四五六七八九",Ig,"負",i,Ar|sr|UA);case 47:return Pn(n,"零壹貳參肆伍陸柒捌玖",Fg,"負",i,vi|Ar|sr|UA);case 42:return Pn(n,"零一二三四五六七八九",Ig,"负",i,Ar|sr|UA);case 41:return Pn(n,"零壹贰叁肆伍陆柒捌玖",Fg,"负",i,vi|Ar|sr|UA);case 26:return Pn(n,"〇一二三四五六七八九","十百千万",xg,i,0);case 25:return Pn(n,"零壱弐参四伍六七八九","拾百千万",xg,i,vi|Ar|sr);case 31:return Pn(n,"영일이삼사오육칠팔구","십백천만",Ru,A,vi|Ar|sr);case 33:return Pn(n,"零一二三四五六七八九","十百千萬",Ru,A,0);case 32:return Pn(n,"零壹貳參四五六七八九","拾百千",Ru,A,vi|Ar|sr);case 18:return et(n,2406,2415,!0,r);case 20:return mi(n,1,19999,p1,3,r);case 21:return et(n,2790,2799,!0,r);case 22:return et(n,2662,2671,!0,r);case 52:return mi(n,1,10999,h1,3,r);case 23:return Dr(n,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return Dr(n,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return et(n,3302,3311,!0,r);case 28:return Dr(n,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",i);case 29:return Dr(n,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",i);case 34:return et(n,3792,3801,!0,r);case 37:return et(n,6160,6169,!0,r);case 38:return et(n,4160,4169,!0,r);case 39:return et(n,2918,2927,!0,r);case 40:return et(n,1776,1785,!0,r);case 43:return et(n,3046,3055,!0,r);case 44:return et(n,3174,3183,!0,r);case 45:return et(n,3664,3673,!0,r);case 46:return et(n,3872,3881,!0,r);case 3:default:return et(n,48,57,!0,r)}},Qg="data-html2canvas-ignore",Rg=function(){function n(e,t,r){if(this.context=e,this.options=r,this.scrolledElements=[],this.referenceElement=t,this.counters=new d1,this.quoteDepth=0,!t.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(t.ownerDocument.documentElement,!1)}return n.prototype.toIFrame=function(e,t){var r=this,i=f1(e,t);if(!i.contentWindow)return Promise.reject("Unable to find iframe window");var A=e.defaultView.pageXOffset,s=e.defaultView.pageYOffset,o=i.contentWindow,a=o.document,c=v1(i).then(function(){return Ut(r,void 0,void 0,function(){var l,d;return Bt(this,function(h){switch(h.label){case 0:return this.scrolledElements.forEach(B1),o&&(o.scrollTo(t.left,t.top),/(iPad|iPhone|iPod)/g.test(navigator.userAgent)&&(o.scrollY!==t.top||o.scrollX!==t.left)&&(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(o.scrollX-t.left,o.scrollY-t.top,0,0))),l=this.options.onclone,d=this.clonedReferenceElement,typeof d>"u"?[2,Promise.reject("Error finding the ".concat(this.referenceElement.nodeName," in the cloned document"))]:a.fonts&&a.fonts.ready?[4,a.fonts.ready]:[3,2];case 1:h.sent(),h.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,m1(a)]:[3,4];case 3:h.sent(),h.label=4;case 4:return typeof l=="function"?[2,Promise.resolve().then(function(){return l(a,d)}).then(function(){return i})]:[2,i]}})})}),u=a.adoptNode(this.documentElement);return E1(u,a),a.open(),a.write("".concat(w1(document.doctype),"<html></html>")),b1(this.referenceElement.ownerDocument,A,s),a.replaceChild(u,a.documentElement),a.close(),c},n.prototype.createElementClone=function(e){if(mu(e,2),bg(e))return this.createCanvasClone(e);if(Bg(e))return this.createVideoClone(e);if(_g(e))return this.createStyleClone(e);var t=e.cloneNode(!1);return Qu(t)&&(Qu(e)&&e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=""),t.loading==="lazy"&&(t.loading="eager")),kg(t)?this.createCustomElementClone(t):t},n.prototype.createCustomElementClone=function(e){var t=document.createElement("html2canvascustomelement");return Pu(e.style,t),t},n.prototype.createStyleClone=function(e){try{var t=e.sheet;if(t&&t.cssRules){var r=[].slice.call(t.cssRules,0).reduce(function(A,s){return s&&typeof s.cssText=="string"?A+s.cssText:A},""),i=e.cloneNode(!1);return i.textContent=r,i}}catch(A){if(this.context.logger.error("Unable to access cssRules property",A),A.name!=="SecurityError")throw A}return e.cloneNode(!1)},n.prototype.createCanvasClone=function(e){var t;if(this.options.inlineImages&&e.ownerDocument){var r=e.ownerDocument.createElement("img");try{return r.src=e.toDataURL(),r}catch{this.context.logger.info("Unable to inline canvas contents, canvas is tainted",e)}}var i=e.cloneNode(!1);try{i.width=e.width,i.height=e.height;var A=e.getContext("2d"),s=i.getContext("2d",{willReadFrequently:!0});if(s)if(!this.options.allowTaint&&A)s.putImageData(A.getImageData(0,0,e.width,e.height),0,0);else{var o=(t=e.getContext("webgl2"))!==null&&t!==void 0?t:e.getContext("webgl");if(o){var a=o.getContextAttributes();(a==null?void 0:a.preserveDrawingBuffer)===!1&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",e)}s.drawImage(e,0,0)}return i}catch{this.context.logger.info("Unable to clone canvas as it is tainted",e)}return i},n.prototype.createVideoClone=function(e){var t=e.ownerDocument.createElement("canvas");t.width=e.offsetWidth,t.height=e.offsetHeight;var r=t.getContext("2d");try{return r&&(r.drawImage(e,0,0,t.width,t.height),this.options.allowTaint||r.getImageData(0,0,t.width,t.height)),t}catch{this.context.logger.info("Unable to clone video as it is tainted",e)}var i=e.ownerDocument.createElement("canvas");return i.width=e.offsetWidth,i.height=e.offsetHeight,i},n.prototype.appendChildNode=function(e,t,r){(!gi(t)||!l1(t)&&!t.hasAttribute(Qg)&&(typeof this.options.ignoreElements!="function"||!this.options.ignoreElements(t)))&&(!this.options.copyStyles||!gi(t)||!_g(t))&&e.appendChild(this.cloneNode(t,r))},n.prototype.cloneChildNodes=function(e,t,r){for(var i=this,A=e.shadowRoot?e.shadowRoot.firstChild:e.firstChild;A;A=A.nextSibling)if(gi(A)&&Sg(A)&&typeof A.assignedNodes=="function"){var s=A.assignedNodes();s.length&&s.forEach(function(o){return i.appendChildNode(t,o,r)})}else this.appendChildNode(t,A,r)},n.prototype.cloneNode=function(e,t){if(yg(e))return document.createTextNode(e.data);if(!e.ownerDocument)return e.cloneNode(!1);var r=e.ownerDocument.defaultView;if(r&&gi(e)&&(Fu(e)||yo(e))){var i=this.createElementClone(e);i.style.transitionProperty="none";var A=r.getComputedStyle(e),s=r.getComputedStyle(e,":before"),o=r.getComputedStyle(e,":after");this.referenceElement===e&&Fu(i)&&(this.clonedReferenceElement=i),xu(i)&&S1(i);var a=this.counters.parse(new Jf(this.context,A)),c=this.resolvePseudoContent(e,i,s,IA.BEFORE);kg(e)&&(t=!0),Bg(e)||this.cloneChildNodes(e,i,t),c&&i.insertBefore(c,i.firstChild);var u=this.resolvePseudoContent(e,i,o,IA.AFTER);return u&&i.appendChild(u),this.counters.pop(a),(A&&(this.options.copyStyles||yo(e))&&!Cg(e)||t)&&Pu(A,i),(e.scrollTop!==0||e.scrollLeft!==0)&&this.scrolledElements.push([i,e.scrollLeft,e.scrollTop]),(wo(e)||bo(e))&&(wo(i)||bo(i))&&(i.value=e.value),i}return e.cloneNode(!1)},n.prototype.resolvePseudoContent=function(e,t,r,i){var A=this;if(r){var s=r.content,o=t.ownerDocument;if(!(!o||!s||s==="none"||s==="-moz-alt-content"||r.display==="none")){this.counters.parse(new Jf(this.context,r));var a=new oU(this.context,r),c=o.createElement("html2canvaspseudoelement");Pu(r,c),a.content.forEach(function(l){if(l.type===0)c.appendChild(o.createTextNode(l.value));else if(l.type===22){var d=o.createElement("img");d.src=l.value,d.style.opacity="1",c.appendChild(d)}else if(l.type===18){if(l.name==="attr"){var h=l.values.filter(ae);h.length&&c.appendChild(o.createTextNode(e.getAttribute(h[0].value)||""))}else if(l.name==="counter"){var f=l.values.filter(gt),p=f[0],g=f[1];if(p&&ae(p)){var v=A.counters.getCounterValue(p.value),y=g&&ae(g)?gu.parse(A.context,g.value):3;c.appendChild(o.createTextNode(TA(v,y,!1)))}}else if(l.name==="counters"){var b=l.values.filter(gt),p=b[0],B=b[1],g=b[2];if(p&&ae(p)){var w=A.counters.getCounterValues(p.value),_=g&&ae(g)?gu.parse(A.context,g.value):3,k=B&&B.type===0?B.value:"",T=w.map(function(F){return TA(F,_,!1)}).join(k);c.appendChild(o.createTextNode(T))}}}else if(l.type===20)switch(l.value){case"open-quote":c.appendChild(o.createTextNode(qf(a.quotes,A.quoteDepth++,!0)));break;case"close-quote":c.appendChild(o.createTextNode(qf(a.quotes,--A.quoteDepth,!1)));break;default:c.appendChild(o.createTextNode(l.value))}}),c.className="".concat(Ou," ").concat(Mu);var u=i===IA.BEFORE?" ".concat(Ou):" ".concat(Mu);return yo(t)?t.className.baseValue+=u:t.className+=u,c}}},n.destroy=function(e){return e.parentNode?(e.parentNode.removeChild(e),!0):!1},n}(),IA;(function(n){n[n.BEFORE=0]="BEFORE",n[n.AFTER=1]="AFTER"})(IA||(IA={}));var f1=function(n,e){var t=n.createElement("iframe");return t.className="html2canvas-container",t.style.visibility="hidden",t.style.position="fixed",t.style.left="-10000px",t.style.top="0px",t.style.border="0",t.width=e.width.toString(),t.height=e.height.toString(),t.scrolling="no",t.setAttribute(Qg,"true"),n.body.appendChild(t),t},g1=function(n){return new Promise(function(e){if(n.complete){e();return}if(!n.src){e();return}n.onload=e,n.onerror=e})},m1=function(n){return Promise.all([].slice.call(n.images,0).map(g1))},v1=function(n){return new Promise(function(e,t){var r=n.contentWindow;if(!r)return t("No window assigned for iframe");var i=r.document;r.onload=n.onload=function(){r.onload=n.onload=null;var A=setInterval(function(){i.body.childNodes.length>0&&i.readyState==="complete"&&(clearInterval(A),e(n))},50)}})},y1=["all","d","content"],Pu=function(n,e){for(var t=n.length-1;t>=0;t--){var r=n.item(t);y1.indexOf(r)===-1&&e.style.setProperty(r,n.getPropertyValue(r))}return e},w1=function(n){var e="";return n&&(e+="<!DOCTYPE ",n.name&&(e+=n.name),n.internalSubset&&(e+=n.internalSubset),n.publicId&&(e+='"'.concat(n.publicId,'"')),n.systemId&&(e+='"'.concat(n.systemId,'"')),e+=">"),e},b1=function(n,e,t){n&&n.defaultView&&(e!==n.defaultView.pageXOffset||t!==n.defaultView.pageYOffset)&&n.defaultView.scrollTo(e,t)},B1=function(n){var e=n[0],t=n[1],r=n[2];e.scrollLeft=t,e.scrollTop=r},C1=":before",_1=":after",Ou="___html2canvas___pseudoelement_before",Mu="___html2canvas___pseudoelement_after",Pg=`{
6
6
  content: "" !important;
7
7
  display: none !important;
8
- }`,XB=function(t){qB(t,".".concat(Us).concat(WB).concat(hl,`
9
- .`).concat(Qs).concat(JB).concat(hl))},qB=function(t,e){var A=t.ownerDocument;if(A){var n=A.createElement("style");n.textContent=e,t.appendChild(n)}},YB=function(t,e){var A,n=e.createElement("base");n.href=e.baseURI;var i=t.getElementsByTagName("head").item(0);i==null||i.insertBefore(n,(A=i==null?void 0:i.firstChild)!==null&&A!==void 0?A:null)},Es=function(){function t(){}return t.getOrigin=function(e){var A=t._link;return A?(A.href=e,A.href=A.href,A.protocol+A.hostname+A.port):"about:blank"},t.isSameOrigin=function(e){return t.getOrigin(e)===t._origin},t.setContext=function(e){t._link=e.document.createElement("a"),t._origin=t.getOrigin(e.location.href)},t._origin="about:blank",t}(),zB=function(){function t(e,A){this.context=e,this._options=A,this._cache={}}return t.prototype.addImage=function(e){var A=Promise.resolve();return this.has(e)||(ks(e)||Av(e))&&(this._cache[e]=this.loadImage(e)).catch(function(){}),A},t.prototype.match=function(e){return this._cache[e]},t.prototype.loadImage=function(e){return Re(this,void 0,void 0,function(){var A,n,i,r,s,a=this;return xe(this,function(o){switch(o.label){case 0:return typeof this._options.customIsSameOrigin!="function"?[3,2]:[4,this._options.customIsSameOrigin(e,Es.isSameOrigin)];case 1:return n=o.sent(),[3,3];case 2:n=Es.isSameOrigin(e),o.label=3;case 3:return A=n,i=!Ss(e)&&this._options.useCORS===!0&&ke.SUPPORT_CORS_IMAGES&&!A,r=!Ss(e)&&!A&&!ks(e)&&typeof this._options.proxy=="string"&&ke.SUPPORT_CORS_XHR&&!i,!A&&this._options.allowTaint===!1&&!Ss(e)&&!ks(e)&&!r&&!i?[2]:(s=e,r?[4,this.proxy(s)]:[3,5]);case 4:s=o.sent(),o.label=5;case 5:return this.context.logger.debug("Added image ".concat(e.substring(0,256))),[4,new Promise(function(c,l){var u=new Image;u.onload=function(){return c(u)},u.onerror=l,(tv(s)||i)&&(u.crossOrigin="anonymous"),u.src=s,u.complete===!0&&setTimeout(function(){return c(u)},500),a._options.imageTimeout>0&&setTimeout(function(){return l("Timed out (".concat(a._options.imageTimeout,"ms) loading image"))},a._options.imageTimeout)})];case 6:return[2,o.sent()]}})})},t.prototype.has=function(e){return typeof this._cache[e]<"u"},t.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},t.prototype.proxy=function(e){var A=this,n=this._options.proxy;if(!n)throw new Error("No proxy defined");var i=e.substring(0,256);return new Promise(function(r,s){var a=ke.SUPPORT_RESPONSE_TYPE?"blob":"text",o=new XMLHttpRequest;o.onload=function(){if(o.status===200)if(a==="text")r(o.response);else{var u=new FileReader;u.addEventListener("load",function(){return r(u.result)},!1),u.addEventListener("error",function(d){return s(d)},!1),u.readAsDataURL(o.response)}else s("Failed to proxy resource ".concat(i," with status code ").concat(o.status))},o.onerror=s;var c=n.indexOf("?")>-1?"&":"?";if(o.open("GET","".concat(n).concat(c,"url=").concat(encodeURIComponent(e),"&responseType=").concat(a)),a!=="text"&&o instanceof XMLHttpRequest&&(o.responseType=a),A._options.imageTimeout){var l=A._options.imageTimeout;o.timeout=l,o.ontimeout=function(){return s("Timed out (".concat(l,"ms) proxying ").concat(i))}}o.send()})},t}(),ZB=/^data:image\/svg\+xml/i,$B=/^data:image\/.*;base64,/i,ev=/^data:image\/.*/i,Av=function(t){return ke.SUPPORT_SVG_DRAWING||!nv(t)},Ss=function(t){return ev.test(t)},tv=function(t){return $B.test(t)},ks=function(t){return t.substr(0,4)==="blob"},nv=function(t){return t.substr(-3).toLowerCase()==="svg"||ZB.test(t)},H=function(){function t(e,A){this.type=0,this.x=e,this.y=A}return t.prototype.add=function(e,A){return new t(this.x+e,this.y+A)},t}(),It=function(t,e,A){return new H(t.x+(e.x-t.x)*A,t.y+(e.y-t.y)*A)},Ti=function(){function t(e,A,n,i){this.type=1,this.start=e,this.startControl=A,this.endControl=n,this.end=i}return t.prototype.subdivide=function(e,A){var n=It(this.start,this.startControl,e),i=It(this.startControl,this.endControl,e),r=It(this.endControl,this.end,e),s=It(n,i,e),a=It(i,r,e),o=It(s,a,e);return A?new t(this.start,n,s,o):new t(o,a,r,this.end)},t.prototype.add=function(e,A){return new t(this.start.add(e,A),this.startControl.add(e,A),this.endControl.add(e,A),this.end.add(e,A))},t.prototype.reverse=function(){return new t(this.end,this.endControl,this.startControl,this.start)},t}(),$e=function(t){return t.type===1},iv=function(){function t(e){var A=e.styles,n=e.bounds,i=dn(A.borderTopLeftRadius,n.width,n.height),r=i[0],s=i[1],a=dn(A.borderTopRightRadius,n.width,n.height),o=a[0],c=a[1],l=dn(A.borderBottomRightRadius,n.width,n.height),u=l[0],d=l[1],h=dn(A.borderBottomLeftRadius,n.width,n.height),g=h[0],f=h[1],m=[];m.push((r+o)/n.width),m.push((g+u)/n.width),m.push((s+f)/n.height),m.push((c+d)/n.height);var B=Math.max.apply(Math,m);B>1&&(r/=B,s/=B,o/=B,c/=B,u/=B,d/=B,g/=B,f/=B);var b=n.width-o,U=n.height-d,C=n.width-u,w=n.height-f,y=A.borderTopWidth,E=A.borderRightWidth,F=A.borderBottomWidth,S=A.borderLeftWidth,x=$(A.paddingTop,e.bounds.width),R=$(A.paddingRight,e.bounds.width),L=$(A.paddingBottom,e.bounds.width),M=$(A.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=r>0||s>0?re(n.left+S/3,n.top+y/3,r-S/3,s-y/3,Y.TOP_LEFT):new H(n.left+S/3,n.top+y/3),this.topRightBorderDoubleOuterBox=r>0||s>0?re(n.left+b,n.top+y/3,o-E/3,c-y/3,Y.TOP_RIGHT):new H(n.left+n.width-E/3,n.top+y/3),this.bottomRightBorderDoubleOuterBox=u>0||d>0?re(n.left+C,n.top+U,u-E/3,d-F/3,Y.BOTTOM_RIGHT):new H(n.left+n.width-E/3,n.top+n.height-F/3),this.bottomLeftBorderDoubleOuterBox=g>0||f>0?re(n.left+S/3,n.top+w,g-S/3,f-F/3,Y.BOTTOM_LEFT):new H(n.left+S/3,n.top+n.height-F/3),this.topLeftBorderDoubleInnerBox=r>0||s>0?re(n.left+S*2/3,n.top+y*2/3,r-S*2/3,s-y*2/3,Y.TOP_LEFT):new H(n.left+S*2/3,n.top+y*2/3),this.topRightBorderDoubleInnerBox=r>0||s>0?re(n.left+b,n.top+y*2/3,o-E*2/3,c-y*2/3,Y.TOP_RIGHT):new H(n.left+n.width-E*2/3,n.top+y*2/3),this.bottomRightBorderDoubleInnerBox=u>0||d>0?re(n.left+C,n.top+U,u-E*2/3,d-F*2/3,Y.BOTTOM_RIGHT):new H(n.left+n.width-E*2/3,n.top+n.height-F*2/3),this.bottomLeftBorderDoubleInnerBox=g>0||f>0?re(n.left+S*2/3,n.top+w,g-S*2/3,f-F*2/3,Y.BOTTOM_LEFT):new H(n.left+S*2/3,n.top+n.height-F*2/3),this.topLeftBorderStroke=r>0||s>0?re(n.left+S/2,n.top+y/2,r-S/2,s-y/2,Y.TOP_LEFT):new H(n.left+S/2,n.top+y/2),this.topRightBorderStroke=r>0||s>0?re(n.left+b,n.top+y/2,o-E/2,c-y/2,Y.TOP_RIGHT):new H(n.left+n.width-E/2,n.top+y/2),this.bottomRightBorderStroke=u>0||d>0?re(n.left+C,n.top+U,u-E/2,d-F/2,Y.BOTTOM_RIGHT):new H(n.left+n.width-E/2,n.top+n.height-F/2),this.bottomLeftBorderStroke=g>0||f>0?re(n.left+S/2,n.top+w,g-S/2,f-F/2,Y.BOTTOM_LEFT):new H(n.left+S/2,n.top+n.height-F/2),this.topLeftBorderBox=r>0||s>0?re(n.left,n.top,r,s,Y.TOP_LEFT):new H(n.left,n.top),this.topRightBorderBox=o>0||c>0?re(n.left+b,n.top,o,c,Y.TOP_RIGHT):new H(n.left+n.width,n.top),this.bottomRightBorderBox=u>0||d>0?re(n.left+C,n.top+U,u,d,Y.BOTTOM_RIGHT):new H(n.left+n.width,n.top+n.height),this.bottomLeftBorderBox=g>0||f>0?re(n.left,n.top+w,g,f,Y.BOTTOM_LEFT):new H(n.left,n.top+n.height),this.topLeftPaddingBox=r>0||s>0?re(n.left+S,n.top+y,Math.max(0,r-S),Math.max(0,s-y),Y.TOP_LEFT):new H(n.left+S,n.top+y),this.topRightPaddingBox=o>0||c>0?re(n.left+Math.min(b,n.width-E),n.top+y,b>n.width+E?0:Math.max(0,o-E),Math.max(0,c-y),Y.TOP_RIGHT):new H(n.left+n.width-E,n.top+y),this.bottomRightPaddingBox=u>0||d>0?re(n.left+Math.min(C,n.width-S),n.top+Math.min(U,n.height-F),Math.max(0,u-E),Math.max(0,d-F),Y.BOTTOM_RIGHT):new H(n.left+n.width-E,n.top+n.height-F),this.bottomLeftPaddingBox=g>0||f>0?re(n.left+S,n.top+Math.min(w,n.height-F),Math.max(0,g-S),Math.max(0,f-F),Y.BOTTOM_LEFT):new H(n.left+S,n.top+n.height-F),this.topLeftContentBox=r>0||s>0?re(n.left+S+M,n.top+y+x,Math.max(0,r-(S+M)),Math.max(0,s-(y+x)),Y.TOP_LEFT):new H(n.left+S+M,n.top+y+x),this.topRightContentBox=o>0||c>0?re(n.left+Math.min(b,n.width+S+M),n.top+y+x,b>n.width+S+M?0:o-S+M,c-(y+x),Y.TOP_RIGHT):new H(n.left+n.width-(E+R),n.top+y+x),this.bottomRightContentBox=u>0||d>0?re(n.left+Math.min(C,n.width-(S+M)),n.top+Math.min(U,n.height+y+x),Math.max(0,u-(E+R)),d-(F+L),Y.BOTTOM_RIGHT):new H(n.left+n.width-(E+R),n.top+n.height-(F+L)),this.bottomLeftContentBox=g>0||f>0?re(n.left+S+M,n.top+w,Math.max(0,g-(S+M)),f-(F+L),Y.BOTTOM_LEFT):new H(n.left+S+M,n.top+n.height-(F+L))}return t}(),Y;(function(t){t[t.TOP_LEFT=0]="TOP_LEFT",t[t.TOP_RIGHT=1]="TOP_RIGHT",t[t.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",t[t.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(Y||(Y={}));var re=function(t,e,A,n,i){var r=4*((Math.sqrt(2)-1)/3),s=A*r,a=n*r,o=t+A,c=e+n;switch(i){case Y.TOP_LEFT:return new Ti(new H(t,c),new H(t,c-a),new H(o-s,e),new H(o,e));case Y.TOP_RIGHT:return new Ti(new H(t,e),new H(t+s,e),new H(o,c-a),new H(o,c));case Y.BOTTOM_RIGHT:return new Ti(new H(o,e),new H(o,e+a),new H(t+s,c),new H(t,c));case Y.BOTTOM_LEFT:default:return new Ti(new H(o,c),new H(o-s,c),new H(t,e+a),new H(t,e))}},Fi=function(t){return[t.topLeftBorderBox,t.topRightBorderBox,t.bottomRightBorderBox,t.bottomLeftBorderBox]},rv=function(t){return[t.topLeftContentBox,t.topRightContentBox,t.bottomRightContentBox,t.bottomLeftContentBox]},Ii=function(t){return[t.topLeftPaddingBox,t.topRightPaddingBox,t.bottomRightPaddingBox,t.bottomLeftPaddingBox]},sv=function(){function t(e,A,n){this.offsetX=e,this.offsetY=A,this.matrix=n,this.type=0,this.target=6}return t}(),xi=function(){function t(e,A){this.path=e,this.target=A,this.type=1}return t}(),av=function(){function t(e){this.opacity=e,this.type=2,this.target=6}return t}(),ov=function(t){return t.type===0},fl=function(t){return t.type===1},cv=function(t){return t.type===2},gl=function(t,e){return t.length===e.length?t.some(function(A,n){return A===e[n]}):!1},lv=function(t,e,A,n,i){return t.map(function(r,s){switch(s){case 0:return r.add(e,A);case 1:return r.add(e+n,A);case 2:return r.add(e+n,A+i);case 3:return r.add(e,A+i)}return r})},pl=function(){function t(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return t}(),ml=function(){function t(e,A){if(this.container=e,this.parent=A,this.effects=[],this.curves=new iv(this.container),this.container.styles.opacity<1&&this.effects.push(new av(this.container.styles.opacity)),this.container.styles.transform!==null){var n=this.container.bounds.left+this.container.styles.transformOrigin[0].number,i=this.container.bounds.top+this.container.styles.transformOrigin[1].number,r=this.container.styles.transform;this.effects.push(new sv(n,i,r))}if(this.container.styles.overflowX!==0){var s=Fi(this.curves),a=Ii(this.curves);gl(s,a)?this.effects.push(new xi(s,6)):(this.effects.push(new xi(s,2)),this.effects.push(new xi(a,4)))}}return t.prototype.getEffects=function(e){for(var A=[2,3].indexOf(this.container.styles.position)===-1,n=this.parent,i=this.effects.slice(0);n;){var r=n.effects.filter(function(o){return!fl(o)});if(A||n.container.styles.position!==0||!n.parent){if(A=[2,3].indexOf(n.container.styles.position)===-1,n.container.styles.overflowX!==0){var s=Fi(n.curves),a=Ii(n.curves);gl(s,a)||i.unshift(new xi(a,6))}i.unshift.apply(i,r)}else i.unshift.apply(i,r);n=n.parent}return i.filter(function(o){return be(o.target,e)})},t}(),Ts=function(t,e,A,n){t.container.elements.forEach(function(i){var r=be(i.flags,4),s=be(i.flags,2),a=new ml(i,t);be(i.styles.display,2048)&&n.push(a);var o=be(i.flags,8)?[]:n;if(r||s){var c=r||i.styles.isPositioned()?A:e,l=new pl(a);if(i.styles.isPositioned()||i.styles.opacity<1||i.styles.isTransformed()){var u=i.styles.zIndex.order;if(u<0){var d=0;c.negativeZIndex.some(function(g,f){return u>g.element.container.styles.zIndex.order?(d=f,!1):d>0}),c.negativeZIndex.splice(d,0,l)}else if(u>0){var h=0;c.positiveZIndex.some(function(g,f){return u>=g.element.container.styles.zIndex.order?(h=f+1,!1):h>0}),c.positiveZIndex.splice(h,0,l)}else c.zeroOrAutoZIndexOrTransformedOrOpacity.push(l)}else i.styles.isFloating()?c.nonPositionedFloats.push(l):c.nonPositionedInlineLevel.push(l);Ts(a,l,r?l:A,o)}else i.styles.isInlineLevel()?e.inlineLevel.push(a):e.nonInlineLevel.push(a),Ts(a,e,A,o);be(i.flags,8)&&Bl(i,o)})},Bl=function(t,e){for(var A=t instanceof ms?t.start:1,n=t instanceof ms?t.reversed:!1,i=0;i<e.length;i++){var r=e[i];r.container instanceof Gc&&typeof r.container.value=="number"&&r.container.value!==0&&(A=r.container.value),r.listValue=Bn(A,r.container.styles.listStyleType,!0),A+=n?-1:1}},uv=function(t){var e=new ml(t,null),A=new pl(e),n=[];return Ts(e,A,A,n),Bl(e.container,n),A},vl=function(t,e){switch(e){case 0:return eA(t.topLeftBorderBox,t.topLeftPaddingBox,t.topRightBorderBox,t.topRightPaddingBox);case 1:return eA(t.topRightBorderBox,t.topRightPaddingBox,t.bottomRightBorderBox,t.bottomRightPaddingBox);case 2:return eA(t.bottomRightBorderBox,t.bottomRightPaddingBox,t.bottomLeftBorderBox,t.bottomLeftPaddingBox);case 3:default:return eA(t.bottomLeftBorderBox,t.bottomLeftPaddingBox,t.topLeftBorderBox,t.topLeftPaddingBox)}},dv=function(t,e){switch(e){case 0:return eA(t.topLeftBorderBox,t.topLeftBorderDoubleOuterBox,t.topRightBorderBox,t.topRightBorderDoubleOuterBox);case 1:return eA(t.topRightBorderBox,t.topRightBorderDoubleOuterBox,t.bottomRightBorderBox,t.bottomRightBorderDoubleOuterBox);case 2:return eA(t.bottomRightBorderBox,t.bottomRightBorderDoubleOuterBox,t.bottomLeftBorderBox,t.bottomLeftBorderDoubleOuterBox);case 3:default:return eA(t.bottomLeftBorderBox,t.bottomLeftBorderDoubleOuterBox,t.topLeftBorderBox,t.topLeftBorderDoubleOuterBox)}},hv=function(t,e){switch(e){case 0:return eA(t.topLeftBorderDoubleInnerBox,t.topLeftPaddingBox,t.topRightBorderDoubleInnerBox,t.topRightPaddingBox);case 1:return eA(t.topRightBorderDoubleInnerBox,t.topRightPaddingBox,t.bottomRightBorderDoubleInnerBox,t.bottomRightPaddingBox);case 2:return eA(t.bottomRightBorderDoubleInnerBox,t.bottomRightPaddingBox,t.bottomLeftBorderDoubleInnerBox,t.bottomLeftPaddingBox);case 3:default:return eA(t.bottomLeftBorderDoubleInnerBox,t.bottomLeftPaddingBox,t.topLeftBorderDoubleInnerBox,t.topLeftPaddingBox)}},fv=function(t,e){switch(e){case 0:return _i(t.topLeftBorderStroke,t.topRightBorderStroke);case 1:return _i(t.topRightBorderStroke,t.bottomRightBorderStroke);case 2:return _i(t.bottomRightBorderStroke,t.bottomLeftBorderStroke);case 3:default:return _i(t.bottomLeftBorderStroke,t.topLeftBorderStroke)}},_i=function(t,e){var A=[];return $e(t)?A.push(t.subdivide(.5,!1)):A.push(t),$e(e)?A.push(e.subdivide(.5,!0)):A.push(e),A},eA=function(t,e,A,n){var i=[];return $e(t)?i.push(t.subdivide(.5,!1)):i.push(t),$e(A)?i.push(A.subdivide(.5,!0)):i.push(A),$e(n)?i.push(n.subdivide(.5,!0).reverse()):i.push(n),$e(e)?i.push(e.subdivide(.5,!1).reverse()):i.push(e),i},Cl=function(t){var e=t.bounds,A=t.styles;return e.add(A.borderLeftWidth,A.borderTopWidth,-(A.borderRightWidth+A.borderLeftWidth),-(A.borderTopWidth+A.borderBottomWidth))},Pi=function(t){var e=t.styles,A=t.bounds,n=$(e.paddingLeft,A.width),i=$(e.paddingRight,A.width),r=$(e.paddingTop,A.width),s=$(e.paddingBottom,A.width);return A.add(n+e.borderLeftWidth,r+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+n+i),-(e.borderTopWidth+e.borderBottomWidth+r+s))},gv=function(t,e){return t===0?e.bounds:t===2?Pi(e):Cl(e)},pv=function(t,e){return t===0?e.bounds:t===2?Pi(e):Cl(e)},Fs=function(t,e,A){var n=gv(_t(t.styles.backgroundOrigin,e),t),i=pv(_t(t.styles.backgroundClip,e),t),r=mv(_t(t.styles.backgroundSize,e),A,n),s=r[0],a=r[1],o=dn(_t(t.styles.backgroundPosition,e),n.width-s,n.height-a),c=Bv(_t(t.styles.backgroundRepeat,e),o,r,n,i),l=Math.round(n.left+o[0]),u=Math.round(n.top+o[1]);return s=Math.max(1,s),a=Math.max(1,a),[c,l,u,s,a]},xt=function(t){return j(t)&&t.value===St.AUTO},Ri=function(t){return typeof t=="number"},mv=function(t,e,A){var n=e[0],i=e[1],r=e[2],s=t[0],a=t[1];if(!s)return[0,0];if(ne(s)&&a&&ne(a))return[$(s,A.width),$(a,A.height)];var o=Ri(r);if(j(s)&&(s.value===St.CONTAIN||s.value===St.COVER)){if(Ri(r)){var c=A.width/A.height;return c<r!=(s.value===St.COVER)?[A.width,A.width/r]:[A.height*r,A.height]}return[A.width,A.height]}var l=Ri(n),u=Ri(i),d=l||u;if(xt(s)&&(!a||xt(a))){if(l&&u)return[n,i];if(!o&&!d)return[A.width,A.height];if(d&&o){var h=l?n:i*r,g=u?i:n/r;return[h,g]}var f=l?n:A.width,m=u?i:A.height;return[f,m]}if(o){var B=0,b=0;return ne(s)?B=$(s,A.width):ne(a)&&(b=$(a,A.height)),xt(s)?B=b*r:(!a||xt(a))&&(b=B/r),[B,b]}var U=null,C=null;if(ne(s)?U=$(s,A.width):a&&ne(a)&&(C=$(a,A.height)),U!==null&&(!a||xt(a))&&(C=l&&u?U/n*i:A.height),C!==null&&xt(s)&&(U=l&&u?C/i*n:A.width),U!==null&&C!==null)return[U,C];throw new Error("Unable to calculate background-size for element")},_t=function(t,e){var A=t[e];return typeof A>"u"?t[0]:A},Bv=function(t,e,A,n,i){var r=e[0],s=e[1],a=A[0],o=A[1];switch(t){case 2:return[new H(Math.round(n.left),Math.round(n.top+s)),new H(Math.round(n.left+n.width),Math.round(n.top+s)),new H(Math.round(n.left+n.width),Math.round(o+n.top+s)),new H(Math.round(n.left),Math.round(o+n.top+s))];case 3:return[new H(Math.round(n.left+r),Math.round(n.top)),new H(Math.round(n.left+r+a),Math.round(n.top)),new H(Math.round(n.left+r+a),Math.round(n.height+n.top)),new H(Math.round(n.left+r),Math.round(n.height+n.top))];case 1:return[new H(Math.round(n.left+r),Math.round(n.top+s)),new H(Math.round(n.left+r+a),Math.round(n.top+s)),new H(Math.round(n.left+r+a),Math.round(n.top+s+o)),new H(Math.round(n.left+r),Math.round(n.top+s+o))];default:return[new H(Math.round(i.left),Math.round(i.top)),new H(Math.round(i.left+i.width),Math.round(i.top)),new H(Math.round(i.left+i.width),Math.round(i.height+i.top)),new H(Math.round(i.left),Math.round(i.height+i.top))]}},vv="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",wl="Hidden Text",Cv=function(){function t(e){this._data={},this._document=e}return t.prototype.parseMetrics=function(e,A){var n=this._document.createElement("div"),i=this._document.createElement("img"),r=this._document.createElement("span"),s=this._document.body;n.style.visibility="hidden",n.style.fontFamily=e,n.style.fontSize=A,n.style.margin="0",n.style.padding="0",n.style.whiteSpace="nowrap",s.appendChild(n),i.src=vv,i.width=1,i.height=1,i.style.margin="0",i.style.padding="0",i.style.verticalAlign="baseline",r.style.fontFamily=e,r.style.fontSize=A,r.style.margin="0",r.style.padding="0",r.appendChild(this._document.createTextNode(wl)),n.appendChild(r),n.appendChild(i);var a=i.offsetTop-r.offsetTop+2;n.removeChild(r),n.appendChild(this._document.createTextNode(wl)),n.style.lineHeight="normal",i.style.verticalAlign="super";var o=i.offsetTop-n.offsetTop+2;return s.removeChild(n),{baseline:a,middle:o}},t.prototype.getMetrics=function(e,A){var n="".concat(e," ").concat(A);return typeof this._data[n]>"u"&&(this._data[n]=this.parseMetrics(e,A)),this._data[n]},t}(),bl=function(){function t(e,A){this.context=e,this.options=A}return t}(),wv=1e4,bv=function(t){iA(e,t);function e(A,n){var i=t.call(this,A,n)||this;return i._activeEffects=[],i.canvas=n.canvas?n.canvas:document.createElement("canvas"),i.ctx=i.canvas.getContext("2d"),n.canvas||(i.canvas.width=Math.floor(n.width*n.scale),i.canvas.height=Math.floor(n.height*n.scale),i.canvas.style.width="".concat(n.width,"px"),i.canvas.style.height="".concat(n.height,"px")),i.fontMetrics=new Cv(document),i.ctx.scale(i.options.scale,i.options.scale),i.ctx.translate(-n.x,-n.y),i.ctx.textBaseline="bottom",i._activeEffects=[],i.context.logger.debug("Canvas renderer initialized (".concat(n.width,"x").concat(n.height,") with scale ").concat(n.scale)),i}return e.prototype.applyEffects=function(A){for(var n=this;this._activeEffects.length;)this.popEffect();A.forEach(function(i){return n.applyEffect(i)})},e.prototype.applyEffect=function(A){this.ctx.save(),cv(A)&&(this.ctx.globalAlpha=A.opacity),ov(A)&&(this.ctx.translate(A.offsetX,A.offsetY),this.ctx.transform(A.matrix[0],A.matrix[1],A.matrix[2],A.matrix[3],A.matrix[4],A.matrix[5]),this.ctx.translate(-A.offsetX,-A.offsetY)),fl(A)&&(this.path(A.path),this.ctx.clip()),this._activeEffects.push(A)},e.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},e.prototype.renderStack=function(A){return Re(this,void 0,void 0,function(){var n;return xe(this,function(i){switch(i.label){case 0:return n=A.element.container.styles,n.isVisible()?[4,this.renderStackContent(A)]:[3,2];case 1:i.sent(),i.label=2;case 2:return[2]}})})},e.prototype.renderNode=function(A){return Re(this,void 0,void 0,function(){return xe(this,function(n){switch(n.label){case 0:return be(A.container.flags,16),A.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(A)]:[3,3];case 1:return n.sent(),[4,this.renderNodeContent(A)];case 2:n.sent(),n.label=3;case 3:return[2]}})})},e.prototype.renderTextWithLetterSpacing=function(A,n,i){var r=this;if(n===0)navigator.userAgent.indexOf("Firefox")===-1?(this.ctx.textBaseline="ideographic",this.ctx.fillText(A.text,A.bounds.left,A.bounds.top+A.bounds.height)):this.ctx.fillText(A.text,A.bounds.left,A.bounds.top+i);else{var s=ps(A.text);s.reduce(function(a,o){return r.ctx.fillText(o,a,A.bounds.top+i),a+r.ctx.measureText(o).width},A.bounds.left)}},e.prototype.createFontStyle=function(A){var n=A.fontVariant.filter(function(s){return s==="normal"||s==="small-caps"}).join(""),i=Sv(A.fontFamily).join(", "),r=HA(A.fontSize)?"".concat(A.fontSize.number).concat(A.fontSize.unit):"".concat(A.fontSize.number,"px");return[[A.fontStyle,n,A.fontWeight,r,i].join(" "),i,r]},e.prototype.renderTextNode=function(A,n){return Re(this,void 0,void 0,function(){var i,r,s=this;return xe(this,function(a){return i=this.createFontStyle(n)[0],this.ctx.font=i,this.ctx.direction=n.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",r=n.paintOrder,A.textBounds.forEach(function(o){r.forEach(function(c){switch(c){case 0:s.ctx.fillStyle=Ue(n.color),s.renderTextWithLetterSpacing(o,n.letterSpacing,n.fontSize.number);var l=n.textShadow;if(l.length&&o.text.trim().length&&(l.slice(0).reverse().forEach(function(d){s.ctx.shadowColor=Ue(d.color),s.ctx.shadowOffsetX=d.offsetX.number*s.options.scale,s.ctx.shadowOffsetY=d.offsetY.number*s.options.scale,s.ctx.shadowBlur=d.blur.number,s.renderTextWithLetterSpacing(o,n.letterSpacing,n.fontSize.number)}),s.ctx.shadowColor="",s.ctx.shadowOffsetX=0,s.ctx.shadowOffsetY=0,s.ctx.shadowBlur=0),n.textDecorationLine.length){s.ctx.fillStyle=Ue(n.textDecorationColor||n.color);var u=1;n.textDecorationLine.forEach(function(d){switch(d){case 1:s.ctx.fillRect(o.bounds.left,o.bounds.top+o.bounds.height-u,o.bounds.width,u);break;case 2:s.ctx.fillRect(o.bounds.left,o.bounds.top,o.bounds.width,u);break;case 3:s.ctx.fillRect(o.bounds.left,o.bounds.top+(o.bounds.height/2-u/2),o.bounds.width,u);break}})}break;case 1:n.webkitTextStrokeWidth&&o.text.trim().length&&(s.ctx.strokeStyle=Ue(n.webkitTextStrokeColor),s.ctx.lineWidth=n.webkitTextStrokeWidth,s.ctx.lineJoin=window.chrome?"miter":"round",s.ctx.strokeText(o.text,o.bounds.left,o.bounds.top+o.bounds.height)),s.ctx.strokeStyle="",s.ctx.lineWidth=0,s.ctx.lineJoin="miter";break}})}),[2]})})},e.prototype.renderReplacedElement=function(A,n,i){var r=i.naturalWidth||A.intrinsicWidth,s=i.naturalHeight||A.intrinsicHeight;if(i&&r>0&&s>0){var a=Pi(A),o=Ii(n);this.path(o),this.ctx.save(),this.ctx.clip();var c=0,l=0,u=r,d=s,h=a.left,g=a.top,f=a.width,m=a.height,B=A.styles.objectFit,b=f/m,U=u/d;if(B===2)U>b?(m=f/U,g+=(a.height-m)/2):(f=m*U,h+=(a.width-f)/2);else if(B===4)U>b?(u=d*b,c+=(r-u)/2):(d=u/b,l+=(s-d)/2);else if(B===8)u>f?(c+=(u-f)/2,u=f):(h+=(f-u)/2,f=u),d>m?(l+=(d-m)/2,d=m):(g+=(m-d)/2,m=d);else if(B===16){var C=U>b?f:m*U,w=u>f?u:f;C<w?U>b?(m=f/U,g+=(a.height-m)/2):(f=m*U,h+=(a.width-f)/2):(u>f?(c+=(u-f)/2,u=f):(h+=(f-u)/2,f=u),d>m?(l+=(d-m)/2,d=m):(g+=(m-d)/2,m=d))}this.ctx.drawImage(i,c,l,u,d,h,g,f,m),this.ctx.restore()}},e.prototype.renderNodeContent=function(A){return Re(this,void 0,void 0,function(){var n,i,r,s,a,o,U,U,c,l,u,d,w,h,g,f,y,m,B,b,U,C,w,y;return xe(this,function(E){switch(E.label){case 0:this.applyEffects(A.getEffects(4)),n=A.container,i=A.curves,r=n.styles,s=0,a=n.textNodes,E.label=1;case 1:return s<a.length?(o=a[s],[4,this.renderTextNode(o,r)]):[3,4];case 2:E.sent(),E.label=3;case 3:return s++,[3,1];case 4:if(!(n instanceof Nc))return[3,8];E.label=5;case 5:return E.trys.push([5,7,,8]),[4,this.context.cache.match(n.src)];case 6:return U=E.sent(),this.renderReplacedElement(n,i,U),[3,8];case 7:return E.sent(),this.context.logger.error("Error loading image ".concat(n.src)),[3,8];case 8:if(n instanceof Kc&&this.renderReplacedElement(n,i,n.canvas),!(n instanceof Vc))return[3,12];E.label=9;case 9:return E.trys.push([9,11,,12]),[4,this.context.cache.match(n.svg)];case 10:return U=E.sent(),this.renderReplacedElement(n,i,U),[3,12];case 11:return E.sent(),this.context.logger.error("Error loading svg ".concat(n.svg.substring(0,255))),[3,12];case 12:return n instanceof Xc&&n.tree?(c=new e(this.context,{scale:this.options.scale,backgroundColor:n.backgroundColor,x:0,y:0,width:n.width,height:n.height}),[4,c.render(n.tree)]):[3,14];case 13:l=E.sent(),n.width&&n.height&&this.ctx.drawImage(l,0,0,n.width,n.height,n.bounds.left,n.bounds.top,n.bounds.width,n.bounds.height),E.label=14;case 14:if(n instanceof Bs&&(u=Math.min(n.bounds.width,n.bounds.height),n.type===yi?n.checked&&(this.ctx.save(),this.path([new H(n.bounds.left+u*.39363,n.bounds.top+u*.79),new H(n.bounds.left+u*.16,n.bounds.top+u*.5549),new H(n.bounds.left+u*.27347,n.bounds.top+u*.44071),new H(n.bounds.left+u*.39694,n.bounds.top+u*.5649),new H(n.bounds.left+u*.72983,n.bounds.top+u*.23),new H(n.bounds.left+u*.84,n.bounds.top+u*.34085),new H(n.bounds.left+u*.39363,n.bounds.top+u*.79)]),this.ctx.fillStyle=Ue(jc),this.ctx.fill(),this.ctx.restore()):n.type===Ui&&n.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(n.bounds.left+u/2,n.bounds.top+u/2,u/4,0,Math.PI*2,!0),this.ctx.fillStyle=Ue(jc),this.ctx.fill(),this.ctx.restore())),yv(n)&&n.value.length){switch(d=this.createFontStyle(r),w=d[0],h=d[1],g=d[2],f=this.fontMetrics.getMetrics(h,g).baseline,this.ctx.font=w,this.ctx.fillStyle=Ue(r.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=Qv(n.styles.textAlign),y=Pi(n),m=0,n.styles.textAlign){case 1:m+=y.width/2;break;case 2:m+=y.width;break}B=y.add(m,0,0,-y.height/2+1),this.ctx.save(),this.path([new H(y.left,y.top),new H(y.left+y.width,y.top),new H(y.left+y.width,y.top+y.height),new H(y.left,y.top+y.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new pn(n.value,B),r.letterSpacing,f),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!be(n.styles.display,2048))return[3,20];if(n.styles.listStyleImage===null)return[3,19];if(b=n.styles.listStyleImage,b.type!==0)return[3,18];U=void 0,C=b.url,E.label=15;case 15:return E.trys.push([15,17,,18]),[4,this.context.cache.match(C)];case 16:return U=E.sent(),this.ctx.drawImage(U,n.bounds.left-(U.width+10),n.bounds.top),[3,18];case 17:return E.sent(),this.context.logger.error("Error loading list-style-image ".concat(C)),[3,18];case 18:return[3,20];case 19:A.listValue&&n.styles.listStyleType!==-1&&(w=this.createFontStyle(r)[0],this.ctx.font=w,this.ctx.fillStyle=Ue(r.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",y=new EA(n.bounds.left,n.bounds.top+$(n.styles.paddingTop,n.bounds.width),n.bounds.width,bc(r.lineHeight,r.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new pn(A.listValue,y),r.letterSpacing,bc(r.lineHeight,r.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),E.label=20;case 20:return[2]}})})},e.prototype.renderStackContent=function(A){return Re(this,void 0,void 0,function(){var n,i,B,r,s,B,a,o,B,c,l,B,u,d,B,h,g,B,f,m,B;return xe(this,function(b){switch(b.label){case 0:return be(A.element.container.flags,16),[4,this.renderNodeBackgroundAndBorders(A.element)];case 1:b.sent(),n=0,i=A.negativeZIndex,b.label=2;case 2:return n<i.length?(B=i[n],[4,this.renderStack(B)]):[3,5];case 3:b.sent(),b.label=4;case 4:return n++,[3,2];case 5:return[4,this.renderNodeContent(A.element)];case 6:b.sent(),r=0,s=A.nonInlineLevel,b.label=7;case 7:return r<s.length?(B=s[r],[4,this.renderNode(B)]):[3,10];case 8:b.sent(),b.label=9;case 9:return r++,[3,7];case 10:a=0,o=A.nonPositionedFloats,b.label=11;case 11:return a<o.length?(B=o[a],[4,this.renderStack(B)]):[3,14];case 12:b.sent(),b.label=13;case 13:return a++,[3,11];case 14:c=0,l=A.nonPositionedInlineLevel,b.label=15;case 15:return c<l.length?(B=l[c],[4,this.renderStack(B)]):[3,18];case 16:b.sent(),b.label=17;case 17:return c++,[3,15];case 18:u=0,d=A.inlineLevel,b.label=19;case 19:return u<d.length?(B=d[u],[4,this.renderNode(B)]):[3,22];case 20:b.sent(),b.label=21;case 21:return u++,[3,19];case 22:h=0,g=A.zeroOrAutoZIndexOrTransformedOrOpacity,b.label=23;case 23:return h<g.length?(B=g[h],[4,this.renderStack(B)]):[3,26];case 24:b.sent(),b.label=25;case 25:return h++,[3,23];case 26:f=0,m=A.positiveZIndex,b.label=27;case 27:return f<m.length?(B=m[f],[4,this.renderStack(B)]):[3,30];case 28:b.sent(),b.label=29;case 29:return f++,[3,27];case 30:return[2]}})})},e.prototype.mask=function(A){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(A.slice(0).reverse()),this.ctx.closePath()},e.prototype.path=function(A){this.ctx.beginPath(),this.formatPath(A),this.ctx.closePath()},e.prototype.formatPath=function(A){var n=this;A.forEach(function(i,r){var s=$e(i)?i.start:i;r===0?n.ctx.moveTo(s.x,s.y):n.ctx.lineTo(s.x,s.y),$e(i)&&n.ctx.bezierCurveTo(i.startControl.x,i.startControl.y,i.endControl.x,i.endControl.y,i.end.x,i.end.y)})},e.prototype.renderRepeat=function(A,n,i,r){this.path(A),this.ctx.fillStyle=n,this.ctx.translate(i,r),this.ctx.fill(),this.ctx.translate(-i,-r)},e.prototype.resizeImage=function(A,n,i){var r,s=(r=this.canvas.ownerDocument)!==null&&r!==void 0?r:document,a=s.createElement("canvas");a.width=Math.max(1,n),a.height=Math.max(1,i);var o=a.getContext("2d");return o.drawImage(A,0,0,A.width,A.height,0,0,n,i),a},e.prototype.renderBackgroundImage=function(A){return Re(this,void 0,void 0,function(){var n,i,r,s,a,o;return xe(this,function(c){switch(c.label){case 0:n=A.styles.backgroundImage.length-1,i=function(l){var u,d,h,g,f,L,ve,Ce,N,V,x,m,L,ve,Ce,N,V,B,b,U,C,w,y,E,F,S,x,R,L,M,te,N,V,Fe,ve,Ce,tA,Le,we,nA,Ye,Ie,it,We;return xe(this,function(oe){switch(oe.label){case 0:if(l.type!==0)return[3,5];u=void 0,d=l.url,oe.label=1;case 1:return oe.trys.push([1,3,,4]),[4,r.context.cache.match(d)];case 2:return u=oe.sent(),[3,4];case 3:return oe.sent(),r.context.logger.error("Error loading background-image ".concat(d)),[3,4];case 4:return u&&(h=isNaN(u.width)||u.width===0?1:u.width,g=isNaN(u.height)||u.height===0?1:u.height,f=Fs(A,n,[h,g,h/g]),L=f[0],ve=f[1],Ce=f[2],N=f[3],V=f[4],x=r.ctx.createPattern(r.resizeImage(u,N,V),"repeat"),r.renderRepeat(L,x,ve,Ce)),[3,6];case 5:rm(l)?(m=Fs(A,n,[null,null,null]),L=m[0],ve=m[1],Ce=m[2],N=m[3],V=m[4],B=em(l.angle,N,V),b=B[0],U=B[1],C=B[2],w=B[3],y=B[4],E=document.createElement("canvas"),E.width=N,E.height=V,F=E.getContext("2d"),S=F.createLinearGradient(U,w,C,y),uc(l.stops,b||1).forEach(function(Je){return S.addColorStop(Je.stop,Ue(Je.color))}),F.fillStyle=S,F.fillRect(0,0,N,V),N>0&&V>0&&(x=r.ctx.createPattern(E,"repeat"),r.renderRepeat(L,x,ve,Ce))):sm(l)&&(R=Fs(A,n,[null,null,null]),L=R[0],M=R[1],te=R[2],N=R[3],V=R[4],Fe=l.position.length===0?[zr]:l.position,ve=$(Fe[0],N),Ce=$(Fe[Fe.length-1],V),tA=Am(l,ve,Ce,N,V),Le=tA[0],we=tA[1],Le>0&&we>0&&(nA=r.ctx.createRadialGradient(M+ve,te+Ce,0,M+ve,te+Ce,Le),uc(l.stops,Le*2).forEach(function(Je){return nA.addColorStop(Je.stop,Ue(Je.color))}),r.path(L),r.ctx.fillStyle=nA,Le!==we?(Ye=A.bounds.left+.5*A.bounds.width,Ie=A.bounds.top+.5*A.bounds.height,it=we/Le,We=1/it,r.ctx.save(),r.ctx.translate(Ye,Ie),r.ctx.transform(1,0,0,it,0,0),r.ctx.translate(-Ye,-Ie),r.ctx.fillRect(M,We*(te-Ie)+Ie,N,V*We),r.ctx.restore()):r.ctx.fill())),oe.label=6;case 6:return n--,[2]}})},r=this,s=0,a=A.styles.backgroundImage.slice(0).reverse(),c.label=1;case 1:return s<a.length?(o=a[s],[5,i(o)]):[3,4];case 2:c.sent(),c.label=3;case 3:return s++,[3,1];case 4:return[2]}})})},e.prototype.renderSolidBorder=function(A,n,i){return Re(this,void 0,void 0,function(){return xe(this,function(r){return this.path(vl(i,n)),this.ctx.fillStyle=Ue(A),this.ctx.fill(),[2]})})},e.prototype.renderDoubleBorder=function(A,n,i,r){return Re(this,void 0,void 0,function(){var s,a;return xe(this,function(o){switch(o.label){case 0:return n<3?[4,this.renderSolidBorder(A,i,r)]:[3,2];case 1:return o.sent(),[2];case 2:return s=dv(r,i),this.path(s),this.ctx.fillStyle=Ue(A),this.ctx.fill(),a=hv(r,i),this.path(a),this.ctx.fill(),[2]}})})},e.prototype.renderNodeBackgroundAndBorders=function(A){return Re(this,void 0,void 0,function(){var n,i,r,s,a,o,c,l,u=this;return xe(this,function(d){switch(d.label){case 0:return this.applyEffects(A.getEffects(2)),n=A.container.styles,i=!NA(n.backgroundColor)||n.backgroundImage.length,r=[{style:n.borderTopStyle,color:n.borderTopColor,width:n.borderTopWidth},{style:n.borderRightStyle,color:n.borderRightColor,width:n.borderRightWidth},{style:n.borderBottomStyle,color:n.borderBottomColor,width:n.borderBottomWidth},{style:n.borderLeftStyle,color:n.borderLeftColor,width:n.borderLeftWidth}],s=Uv(_t(n.backgroundClip,0),A.curves),i||n.boxShadow.length?(this.ctx.save(),this.path(s),this.ctx.clip(),NA(n.backgroundColor)||(this.ctx.fillStyle=Ue(n.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(A.container)]):[3,2];case 1:d.sent(),this.ctx.restore(),n.boxShadow.slice(0).reverse().forEach(function(h){u.ctx.save();var g=Fi(A.curves),f=h.inset?0:wv,m=lv(g,-f+(h.inset?1:-1)*h.spread.number,(h.inset?1:-1)*h.spread.number,h.spread.number*(h.inset?-2:2),h.spread.number*(h.inset?-2:2));h.inset?(u.path(g),u.ctx.clip(),u.mask(m)):(u.mask(g),u.ctx.clip(),u.path(m)),u.ctx.shadowOffsetX=h.offsetX.number+f,u.ctx.shadowOffsetY=h.offsetY.number,u.ctx.shadowColor=Ue(h.color),u.ctx.shadowBlur=h.blur.number,u.ctx.fillStyle=h.inset?Ue(h.color):"rgba(0,0,0,1)",u.ctx.fill(),u.ctx.restore()}),d.label=2;case 2:a=0,o=0,c=r,d.label=3;case 3:return o<c.length?(l=c[o],l.style!==0&&!NA(l.color)&&l.width>0?l.style!==2?[3,5]:[4,this.renderDashedDottedBorder(l.color,l.width,a,A.curves,2)]:[3,11]):[3,13];case 4:return d.sent(),[3,11];case 5:return l.style!==3?[3,7]:[4,this.renderDashedDottedBorder(l.color,l.width,a,A.curves,3)];case 6:return d.sent(),[3,11];case 7:return l.style!==4?[3,9]:[4,this.renderDoubleBorder(l.color,l.width,a,A.curves)];case 8:return d.sent(),[3,11];case 9:return[4,this.renderSolidBorder(l.color,a,A.curves)];case 10:d.sent(),d.label=11;case 11:a++,d.label=12;case 12:return o++,[3,3];case 13:return[2]}})})},e.prototype.renderDashedDottedBorder=function(A,n,i,r,s){return Re(this,void 0,void 0,function(){var a,o,c,l,u,d,h,g,f,m,B,b,U,C,w,y,w,y;return xe(this,function(E){return this.ctx.save(),a=fv(r,i),o=vl(r,i),s===2&&(this.path(o),this.ctx.clip()),$e(o[0])?(c=o[0].start.x,l=o[0].start.y):(c=o[0].x,l=o[0].y),$e(o[1])?(u=o[1].end.x,d=o[1].end.y):(u=o[1].x,d=o[1].y),i===0||i===2?h=Math.abs(c-u):h=Math.abs(l-d),this.ctx.beginPath(),s===3?this.formatPath(a):this.formatPath(o.slice(0,2)),g=n<3?n*3:n*2,f=n<3?n*2:n,s===3&&(g=n,f=n),m=!0,h<=g*2?m=!1:h<=g*2+f?(B=h/(2*g+f),g*=B,f*=B):(b=Math.floor((h+f)/(g+f)),U=(h-b*g)/(b-1),C=(h-(b+1)*g)/b,f=C<=0||Math.abs(f-U)<Math.abs(f-C)?U:C),m&&(s===3?this.ctx.setLineDash([0,g+f]):this.ctx.setLineDash([g,f])),s===3?(this.ctx.lineCap="round",this.ctx.lineWidth=n):this.ctx.lineWidth=n*2+1.1,this.ctx.strokeStyle=Ue(A),this.ctx.stroke(),this.ctx.setLineDash([]),s===2&&($e(o[0])&&(w=o[3],y=o[0],this.ctx.beginPath(),this.formatPath([new H(w.end.x,w.end.y),new H(y.start.x,y.start.y)]),this.ctx.stroke()),$e(o[1])&&(w=o[1],y=o[2],this.ctx.beginPath(),this.formatPath([new H(w.end.x,w.end.y),new H(y.start.x,y.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},e.prototype.render=function(A){return Re(this,void 0,void 0,function(){var n;return xe(this,function(i){switch(i.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=Ue(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),n=uv(A),[4,this.renderStack(n)];case 1:return i.sent(),this.applyEffects([]),[2,this.canvas]}})})},e}(bl),yv=function(t){return t instanceof Jc||t instanceof Wc?!0:t instanceof Bs&&t.type!==Ui&&t.type!==yi},Uv=function(t,e){switch(t){case 0:return Fi(e);case 2:return rv(e);case 1:default:return Ii(e)}},Qv=function(t){switch(t){case 1:return"center";case 2:return"right";case 0:default:return"left"}},Ev=["-apple-system","system-ui"],Sv=function(t){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?t.filter(function(e){return Ev.indexOf(e)===-1}):t},kv=function(t){iA(e,t);function e(A,n){var i=t.call(this,A,n)||this;return i.canvas=n.canvas?n.canvas:document.createElement("canvas"),i.ctx=i.canvas.getContext("2d"),i.options=n,i.canvas.width=Math.floor(n.width*n.scale),i.canvas.height=Math.floor(n.height*n.scale),i.canvas.style.width="".concat(n.width,"px"),i.canvas.style.height="".concat(n.height,"px"),i.ctx.scale(i.options.scale,i.options.scale),i.ctx.translate(-n.x,-n.y),i.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized (".concat(n.width,"x").concat(n.height," at ").concat(n.x,",").concat(n.y,") with scale ").concat(n.scale)),i}return e.prototype.render=function(A){return Re(this,void 0,void 0,function(){var n,i;return xe(this,function(r){switch(r.label){case 0:return n=gs(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,A),[4,Tv(n)];case 1:return i=r.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=Ue(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(i,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},e}(bl),Tv=function(t){return new Promise(function(e,A){var n=new Image;n.onload=function(){e(n)},n.onerror=A,n.src="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent(new XMLSerializer().serializeToString(t)))})},Fv=function(){function t(e){var A=e.id,n=e.enabled;this.id=A,this.enabled=n,this.start=Date.now()}return t.prototype.debug=function(){for(var e=[],A=0;A<arguments.length;A++)e[A]=arguments[A];this.enabled&&(typeof window<"u"&&window.console?(()=>{}).apply(console,Dn([this.id,"".concat(this.getTime(),"ms")],e,!1)):this.info.apply(this,e))},t.prototype.getTime=function(){return Date.now()-this.start},t.prototype.info=function(){for(var e=[],A=0;A<arguments.length;A++)e[A]=arguments[A];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,Dn([this.id,"".concat(this.getTime(),"ms")],e,!1))},t.prototype.warn=function(){for(var e=[],A=0;A<arguments.length;A++)e[A]=arguments[A];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,Dn([this.id,"".concat(this.getTime(),"ms")],e,!1)):this.info.apply(this,e))},t.prototype.error=function(){for(var e=[],A=0;A<arguments.length;A++)e[A]=arguments[A];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,Dn([this.id,"".concat(this.getTime(),"ms")],e,!1)):this.info.apply(this,e))},t.instances={},t}(),Iv=function(){function t(e,A){var n;this.windowBounds=A,this.instanceName="#".concat(t.instanceCount++),this.logger=new Fv({id:this.instanceName,enabled:e.logging}),this.cache=(n=e.cache)!==null&&n!==void 0?n:new zB(this,e)}return t.instanceCount=1,t}(),xv=function(t,e){return e===void 0&&(e={}),_v(t,e)};typeof window<"u"&&Es.setContext(window);var _v=function(t,e){return Re(void 0,void 0,void 0,function(){var A,n,i,r,s,a,o,c,l,u,d,h,g,f,m,B,b,U,C,w,E,y,E,F,S,x,R,L,M,te,N,V,Fe,ve,Ce,tA,Le,we,nA,Ye;return xe(this,function(Ie){switch(Ie.label){case 0:if(!t||typeof t!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(A=t.ownerDocument,!A)throw new Error("Element is not attached to a Document");if(n=A.defaultView,!n)throw new Error("Document is not attached to a Window");return i={allowTaint:(F=e.allowTaint)!==null&&F!==void 0?F:!1,imageTimeout:(S=e.imageTimeout)!==null&&S!==void 0?S:15e3,proxy:e.proxy,useCORS:(x=e.useCORS)!==null&&x!==void 0?x:!1,customIsSameOrigin:e.customIsSameOrigin},r=Fr({logging:(R=e.logging)!==null&&R!==void 0?R:!0,cache:e.cache},i),s={windowWidth:(L=e.windowWidth)!==null&&L!==void 0?L:n.innerWidth,windowHeight:(M=e.windowHeight)!==null&&M!==void 0?M:n.innerHeight,scrollX:(te=e.scrollX)!==null&&te!==void 0?te:n.pageXOffset,scrollY:(N=e.scrollY)!==null&&N!==void 0?N:n.pageYOffset},a=new EA(s.scrollX,s.scrollY,s.windowWidth,s.windowHeight),o=new Iv(r,a),c=(V=e.foreignObjectRendering)!==null&&V!==void 0?V:!1,l={allowTaint:(Fe=e.allowTaint)!==null&&Fe!==void 0?Fe:!1,onclone:e.onclone,ignoreElements:e.ignoreElements,inlineImages:c,copyStyles:c},o.logger.debug("Starting document clone with size ".concat(a.width,"x").concat(a.height," scrolled to ").concat(-a.left,",").concat(-a.top)),u=new dl(o,t,l),d=u.clonedReferenceElement,d?[4,u.toIFrame(A,a)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return h=Ie.sent(),g=Cs(d)||_B(d)?gf(d.ownerDocument):Hn(o,d),f=g.width,m=g.height,B=g.left,b=g.top,U=Pv(o,d,e.backgroundColor),C={canvas:e.canvas,backgroundColor:U,scale:(Ce=(ve=e.scale)!==null&&ve!==void 0?ve:n.devicePixelRatio)!==null&&Ce!==void 0?Ce:1,x:((tA=e.x)!==null&&tA!==void 0?tA:0)+B,y:((Le=e.y)!==null&&Le!==void 0?Le:0)+b,width:(we=e.width)!==null&&we!==void 0?we:Math.ceil(f),height:(nA=e.height)!==null&&nA!==void 0?nA:Math.ceil(m)},c?(o.logger.debug("Document cloned, using foreign object rendering"),E=new kv(o,C),[4,E.render(d)]):[3,3];case 2:return w=Ie.sent(),[3,5];case 3:return o.logger.debug("Document cloned, element located at ".concat(B,",").concat(b," with size ").concat(f,"x").concat(m," using computed rendering")),o.logger.debug("Starting DOM parsing"),y=Yc(o,d),U===y.styles.backgroundColor&&(y.styles.backgroundColor=vA.TRANSPARENT),o.logger.debug("Starting renderer for element at ".concat(C.x,",").concat(C.y," with size ").concat(C.width,"x").concat(C.height)),E=new bv(o,C),[4,E.render(y)];case 4:w=Ie.sent(),Ie.label=5;case 5:return(!((Ye=e.removeContainer)!==null&&Ye!==void 0)||Ye)&&(dl.destroy(h)||o.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),o.logger.debug("Finished rendering"),[2,w]}})})},Pv=function(t,e,A){var n=e.ownerDocument,i=n.documentElement?Et(t,getComputedStyle(n.documentElement).backgroundColor):vA.TRANSPARENT,r=n.body?Et(t,getComputedStyle(n.body).backgroundColor):vA.TRANSPARENT,s=typeof A=="string"?Et(t,A):A===null?vA.TRANSPARENT:4294967295;return e===n.documentElement?NA(i)?NA(r)?s:r:i:s};function Rv(t,e){return e.forEach(function(A){A&&typeof A!="string"&&!Array.isArray(A)&&Object.keys(A).forEach(function(n){if(n!=="default"&&!(n in t)){var i=Object.getOwnPropertyDescriptor(A,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return A[n]}})}})}),Object.freeze(t)}var Lv=Object.defineProperty,Dv=(t,e,A)=>e in t?Lv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:A}):t[e]=A,yl=(t,e,A)=>Dv(t,typeof e!="symbol"?e+"":e,A);let Oe=class{constructor(){yl(this,"_locking"),yl(this,"_locks"),this._locking=Promise.resolve(),this._locks=0}isLocked(){return this._locks>0}lock(){this._locks+=1;let e;const A=new Promise(i=>e=()=>{this._locks-=1,i()}),n=this._locking.then(()=>e);return this._locking=this._locking.then(()=>A),n}};function le(t,e){if(!t)throw new Error(e)}const Hv=34028234663852886e22,Ov=-34028234663852886e22,Mv=4294967295,Nv=2147483647,Kv=-2147483648;function Li(t){if(typeof t!="number")throw new Error("invalid int 32: "+typeof t);if(!Number.isInteger(t)||t>Nv||t<Kv)throw new Error("invalid int 32: "+t)}function Is(t){if(typeof t!="number")throw new Error("invalid uint 32: "+typeof t);if(!Number.isInteger(t)||t>Mv||t<0)throw new Error("invalid uint 32: "+t)}function Ul(t){if(typeof t!="number")throw new Error("invalid float 32: "+typeof t);if(Number.isFinite(t)&&(t>Hv||t<Ov))throw new Error("invalid float 32: "+t)}const Ql=Symbol("@bufbuild/protobuf/enum-type");function Vv(t){const e=t[Ql];return le(e,"missing enum type on enum object"),e}function El(t,e,A,n){t[Ql]=Sl(e,A.map(i=>({no:i.no,name:i.name,localName:t[i.no]})))}function Sl(t,e,A){const n=Object.create(null),i=Object.create(null),r=[];for(const s of e){const a=kl(s);r.push(a),n[s.name]=a,i[s.no]=a}return{typeName:t,values:r,findName(s){return n[s]},findNumber(s){return i[s]}}}function Gv(t,e,A){const n={};for(const i of e){const r=kl(i);n[r.localName]=r.no,n[r.no]=r.localName}return El(n,t,e),n}function kl(t){return"localName"in t?t:Object.assign(Object.assign({},t),{localName:t.name})}class xs{equals(e){return this.getType().runtime.util.equals(this.getType(),this,e)}clone(){return this.getType().runtime.util.clone(this)}fromBinary(e,A){const n=this.getType(),i=n.runtime.bin,r=i.makeReadOptions(A);return i.readMessage(this,r.readerFactory(e),e.byteLength,r),this}fromJson(e,A){const n=this.getType(),i=n.runtime.json,r=i.makeReadOptions(A);return i.readMessage(n,e,r,this),this}fromJsonString(e,A){let n;try{n=JSON.parse(e)}catch(i){throw new Error("cannot decode ".concat(this.getType().typeName," from JSON: ").concat(i instanceof Error?i.message:String(i)))}return this.fromJson(n,A)}toBinary(e){const A=this.getType(),n=A.runtime.bin,i=n.makeWriteOptions(e),r=i.writerFactory();return n.writeMessage(this,r,i),r.finish()}toJson(e){const A=this.getType(),n=A.runtime.json,i=n.makeWriteOptions(e);return n.writeMessage(this,i)}toJsonString(e){var A;const n=this.toJson(e);return JSON.stringify(n,null,(A=e==null?void 0:e.prettySpaces)!==null&&A!==void 0?A:0)}toJSON(){return this.toJson({emitDefaultValues:!0})}getType(){return Object.getPrototypeOf(this).constructor}}function jv(t,e,A,n){var i;const r=(i=n==null?void 0:n.localName)!==null&&i!==void 0?i:e.substring(e.lastIndexOf(".")+1),s={[r]:function(a){t.util.initFields(this),t.util.initPartial(a,this)}}[r];return Object.setPrototypeOf(s.prototype,new xs),Object.assign(s,{runtime:t,typeName:e,fields:t.util.newFieldList(A),fromBinary(a,o){return new s().fromBinary(a,o)},fromJson(a,o){return new s().fromJson(a,o)},fromJsonString(a,o){return new s().fromJsonString(a,o)},equals(a,o){return t.util.equals(s,a,o)}}),s}function Wv(){let t=0,e=0;for(let n=0;n<28;n+=7){let i=this.buf[this.pos++];if(t|=(i&127)<<n,!(i&128))return this.assertBounds(),[t,e]}let A=this.buf[this.pos++];if(t|=(A&15)<<28,e=(A&112)>>4,!(A&128))return this.assertBounds(),[t,e];for(let n=3;n<=31;n+=7){let i=this.buf[this.pos++];if(e|=(i&127)<<n,!(i&128))return this.assertBounds(),[t,e]}throw new Error("invalid varint")}function _s(t,e,A){for(let r=0;r<28;r=r+7){const s=t>>>r,a=!(!(s>>>7)&&e==0),o=(a?s|128:s)&255;if(A.push(o),!a)return}const n=t>>>28&15|(e&7)<<4,i=!!(e>>3);if(A.push((i?n|128:n)&255),!!i){for(let r=3;r<31;r=r+7){const s=e>>>r,a=!!(s>>>7),o=(a?s|128:s)&255;if(A.push(o),!a)return}A.push(e>>>31&1)}}const Di=4294967296;function Tl(t){const e=t[0]==="-";e&&(t=t.slice(1));const A=1e6;let n=0,i=0;function r(s,a){const o=Number(t.slice(s,a));i*=A,n=n*A+o,n>=Di&&(i=i+(n/Di|0),n=n%Di)}return r(-24,-18),r(-18,-12),r(-12,-6),r(-6),e?Il(n,i):Ps(n,i)}function Jv(t,e){let A=Ps(t,e);const n=A.hi&2147483648;n&&(A=Il(A.lo,A.hi));const i=Fl(A.lo,A.hi);return n?"-"+i:i}function Fl(t,e){if({lo:t,hi:e}=Xv(t,e),e<=2097151)return String(Di*e+t);const A=t&16777215,n=(t>>>24|e<<8)&16777215,i=e>>16&65535;let r=A+n*6777216+i*6710656,s=n+i*8147497,a=i*2;const o=1e7;return r>=o&&(s+=Math.floor(r/o),r%=o),s>=o&&(a+=Math.floor(s/o),s%=o),a.toString()+xl(s)+xl(r)}function Xv(t,e){return{lo:t>>>0,hi:e>>>0}}function Ps(t,e){return{lo:t|0,hi:e|0}}function Il(t,e){return e=~e,t?t=~t+1:e+=1,Ps(t,e)}const xl=t=>{const e=String(t);return"0000000".slice(e.length)+e};function _l(t,e){if(t>=0){for(;t>127;)e.push(t&127|128),t=t>>>7;e.push(t)}else{for(let A=0;A<9;A++)e.push(t&127|128),t=t>>7;e.push(1)}}function qv(){let t=this.buf[this.pos++],e=t&127;if(!(t&128))return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<7,!(t&128))return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<14,!(t&128))return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<21,!(t&128))return this.assertBounds(),e;t=this.buf[this.pos++],e|=(t&15)<<28;for(let A=5;t&128&&A<10;A++)t=this.buf[this.pos++];if(t&128)throw new Error("invalid varint");return this.assertBounds(),e>>>0}function Yv(){const t=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof t.getBigInt64=="function"&&typeof t.getBigUint64=="function"&&typeof t.setBigInt64=="function"&&typeof t.setBigUint64=="function"&&(typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){const i=BigInt("-9223372036854775808"),r=BigInt("9223372036854775807"),s=BigInt("0"),a=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(o){const c=typeof o=="bigint"?o:BigInt(o);if(c>r||c<i)throw new Error("int64 invalid: ".concat(o));return c},uParse(o){const c=typeof o=="bigint"?o:BigInt(o);if(c>a||c<s)throw new Error("uint64 invalid: ".concat(o));return c},enc(o){return t.setBigInt64(0,this.parse(o),!0),{lo:t.getInt32(0,!0),hi:t.getInt32(4,!0)}},uEnc(o){return t.setBigInt64(0,this.uParse(o),!0),{lo:t.getInt32(0,!0),hi:t.getInt32(4,!0)}},dec(o,c){return t.setInt32(0,o,!0),t.setInt32(4,c,!0),t.getBigInt64(0,!0)},uDec(o,c){return t.setInt32(0,o,!0),t.setInt32(4,c,!0),t.getBigUint64(0,!0)}}}const A=i=>le(/^-?[0-9]+$/.test(i),"int64 invalid: ".concat(i)),n=i=>le(/^[0-9]+$/.test(i),"uint64 invalid: ".concat(i));return{zero:"0",supported:!1,parse(i){return typeof i!="string"&&(i=i.toString()),A(i),i},uParse(i){return typeof i!="string"&&(i=i.toString()),n(i),i},enc(i){return typeof i!="string"&&(i=i.toString()),A(i),Tl(i)},uEnc(i){return typeof i!="string"&&(i=i.toString()),n(i),Tl(i)},dec(i,r){return Jv(i,r)},uDec(i,r){return Fl(i,r)}}}const se=Yv();var k;(function(t){t[t.DOUBLE=1]="DOUBLE",t[t.FLOAT=2]="FLOAT",t[t.INT64=3]="INT64",t[t.UINT64=4]="UINT64",t[t.INT32=5]="INT32",t[t.FIXED64=6]="FIXED64",t[t.FIXED32=7]="FIXED32",t[t.BOOL=8]="BOOL",t[t.STRING=9]="STRING",t[t.BYTES=12]="BYTES",t[t.UINT32=13]="UINT32",t[t.SFIXED32=15]="SFIXED32",t[t.SFIXED64=16]="SFIXED64",t[t.SINT32=17]="SINT32",t[t.SINT64=18]="SINT64"})(k||(k={}));var WA;(function(t){t[t.BIGINT=0]="BIGINT",t[t.STRING=1]="STRING"})(WA||(WA={}));function JA(t,e,A){if(e===A)return!0;if(t==k.BYTES){if(!(e instanceof Uint8Array)||!(A instanceof Uint8Array)||e.length!==A.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==A[n])return!1;return!0}switch(t){case k.UINT64:case k.FIXED64:case k.INT64:case k.SFIXED64:case k.SINT64:return e==A}return!1}function Pt(t,e){switch(t){case k.BOOL:return!1;case k.UINT64:case k.FIXED64:case k.INT64:case k.SFIXED64:case k.SINT64:return e==0?se.zero:"0";case k.DOUBLE:case k.FLOAT:return 0;case k.BYTES:return new Uint8Array(0);case k.STRING:return"";default:return 0}}function Pl(t,e){switch(t){case k.BOOL:return e===!1;case k.STRING:return e==="";case k.BYTES:return e instanceof Uint8Array&&!e.byteLength;default:return e==0}}var ge;(function(t){t[t.Varint=0]="Varint",t[t.Bit64=1]="Bit64",t[t.LengthDelimited=2]="LengthDelimited",t[t.StartGroup=3]="StartGroup",t[t.EndGroup=4]="EndGroup",t[t.Bit32=5]="Bit32"})(ge||(ge={}));class zv{constructor(e){this.stack=[],this.textEncoder=e??new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let e=0;for(let i=0;i<this.chunks.length;i++)e+=this.chunks[i].length;let A=new Uint8Array(e),n=0;for(let i=0;i<this.chunks.length;i++)A.set(this.chunks[i],n),n+=this.chunks[i].length;return this.chunks=[],A}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let e=this.finish(),A=this.stack.pop();if(!A)throw new Error("invalid state, fork stack empty");return this.chunks=A.chunks,this.buf=A.buf,this.uint32(e.byteLength),this.raw(e)}tag(e,A){return this.uint32((e<<3|A)>>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(Is(e);e>127;)this.buf.push(e&127|128),e=e>>>7;return this.buf.push(e),this}int32(e){return Li(e),_l(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let A=this.textEncoder.encode(e);return this.uint32(A.byteLength),this.raw(A)}float(e){Ul(e);let A=new Uint8Array(4);return new DataView(A.buffer).setFloat32(0,e,!0),this.raw(A)}double(e){let A=new Uint8Array(8);return new DataView(A.buffer).setFloat64(0,e,!0),this.raw(A)}fixed32(e){Is(e);let A=new Uint8Array(4);return new DataView(A.buffer).setUint32(0,e,!0),this.raw(A)}sfixed32(e){Li(e);let A=new Uint8Array(4);return new DataView(A.buffer).setInt32(0,e,!0),this.raw(A)}sint32(e){return Li(e),e=(e<<1^e>>31)>>>0,_l(e,this.buf),this}sfixed64(e){let A=new Uint8Array(8),n=new DataView(A.buffer),i=se.enc(e);return n.setInt32(0,i.lo,!0),n.setInt32(4,i.hi,!0),this.raw(A)}fixed64(e){let A=new Uint8Array(8),n=new DataView(A.buffer),i=se.uEnc(e);return n.setInt32(0,i.lo,!0),n.setInt32(4,i.hi,!0),this.raw(A)}int64(e){let A=se.enc(e);return _s(A.lo,A.hi,this.buf),this}sint64(e){let A=se.enc(e),n=A.hi>>31,i=A.lo<<1^n,r=(A.hi<<1|A.lo>>>31)^n;return _s(i,r,this.buf),this}uint64(e){let A=se.uEnc(e);return _s(A.lo,A.hi,this.buf),this}}class Zv{constructor(e,A){this.varint64=Wv,this.uint32=qv,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.textDecoder=A??new TextDecoder}tag(){let e=this.uint32(),A=e>>>3,n=e&7;if(A<=0||n<0||n>5)throw new Error("illegal tag: field no "+A+" wire type "+n);return[A,n]}skip(e,A){let n=this.pos;switch(e){case ge.Varint:for(;this.buf[this.pos++]&128;);break;case ge.Bit64:this.pos+=4;case ge.Bit32:this.pos+=4;break;case ge.LengthDelimited:let i=this.uint32();this.pos+=i;break;case ge.StartGroup:for(;;){const[r,s]=this.tag();if(s===ge.EndGroup){if(A!==void 0&&r!==A)throw new Error("invalid end group tag");break}this.skip(s,r)}break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(n,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return se.dec(...this.varint64())}uint64(){return se.uDec(...this.varint64())}sint64(){let[e,A]=this.varint64(),n=-(e&1);return e=(e>>>1|(A&1)<<31)^n,A=A>>>1^n,se.dec(e,A)}bool(){let[e,A]=this.varint64();return e!==0||A!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return se.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return se.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),A=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(A,A+e)}string(){return this.textDecoder.decode(this.bytes())}}function $v(t,e,A,n){let i;return{typeName:e,extendee:A,get field(){if(!i){const r=typeof n=="function"?n():n;r.name=e.split(".").pop(),r.jsonName="[".concat(e,"]"),i=t.util.newFieldList([r]).list()[0]}return i},runtime:t}}function Rl(t){const e=t.field.localName,A=Object.create(null);return A[e]=eC(t),[A,()=>A[e]]}function eC(t){const e=t.field;if(e.repeated)return[];if(e.default!==void 0)return e.default;switch(e.kind){case"enum":return e.T.values[0].no;case"scalar":return Pt(e.T,e.L);case"message":const A=e.T,n=new A;return A.fieldWrapper?A.fieldWrapper.unwrapField(n):n;case"map":throw"map fields are not allowed to be extensions"}}function AC(t,e){if(!e.repeated&&(e.kind=="enum"||e.kind=="scalar")){for(let A=t.length-1;A>=0;--A)if(t[A].no==e.no)return[t[A]];return[]}return t.filter(A=>A.no===e.no)}let TA="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Hi=[];for(let t=0;t<TA.length;t++)Hi[TA[t].charCodeAt(0)]=t;Hi["-".charCodeAt(0)]=TA.indexOf("+"),Hi["_".charCodeAt(0)]=TA.indexOf("/");const Ll={dec(t){let e=t.length*3/4;t[t.length-2]=="="?e-=2:t[t.length-1]=="="&&(e-=1);let A=new Uint8Array(e),n=0,i=0,r,s=0;for(let a=0;a<t.length;a++){if(r=Hi[t.charCodeAt(a)],r===void 0)switch(t[a]){case"=":i=0;case`
10
- `:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string.")}switch(i){case 0:s=r,i=1;break;case 1:A[n++]=s<<2|(r&48)>>4,s=r,i=2;break;case 2:A[n++]=(s&15)<<4|(r&60)>>2,s=r,i=3;break;case 3:A[n++]=(s&3)<<6|r,i=0;break}}if(i==1)throw Error("invalid base64 string.");return A.subarray(0,n)},enc(t){let e="",A=0,n,i=0;for(let r=0;r<t.length;r++)switch(n=t[r],A){case 0:e+=TA[n>>2],i=(n&3)<<4,A=1;break;case 1:e+=TA[i|n>>4],i=(n&15)<<2,A=2;break;case 2:e+=TA[i|n>>6],e+=TA[n&63],A=0;break}return A&&(e+=TA[i],e+="=",A==1&&(e+="=")),e}};function tC(t,e,A){Hl(e,t);const n=e.runtime.bin.makeReadOptions(A),i=AC(t.getType().runtime.bin.listUnknownFields(t),e.field),[r,s]=Rl(e);for(const a of i)e.runtime.bin.readField(r,n.readerFactory(a.data),e.field,a.wireType,n);return s()}function nC(t,e,A,n){Hl(e,t);const i=e.runtime.bin.makeReadOptions(n),r=e.runtime.bin.makeWriteOptions(n);if(Dl(t,e)){const c=t.getType().runtime.bin.listUnknownFields(t).filter(l=>l.no!=e.field.no);t.getType().runtime.bin.discardUnknownFields(t);for(const l of c)t.getType().runtime.bin.onUnknownField(t,l.no,l.wireType,l.data)}const s=r.writerFactory();let a=e.field;!a.opt&&!a.repeated&&(a.kind=="enum"||a.kind=="scalar")&&(a=Object.assign(Object.assign({},e.field),{opt:!0})),e.runtime.bin.writeField(a,A,s,r);const o=i.readerFactory(s.finish());for(;o.pos<o.len;){const[c,l]=o.tag(),u=o.skip(l,c);t.getType().runtime.bin.onUnknownField(t,c,l,u)}}function Dl(t,e){const A=t.getType();return e.extendee.typeName===A.typeName&&!!A.runtime.bin.listUnknownFields(t).find(n=>n.no==e.field.no)}function Hl(t,e){le(t.extendee.typeName==e.getType().typeName,"extension ".concat(t.typeName," can only be applied to message ").concat(t.extendee.typeName))}function Ol(t,e){const A=t.localName;if(t.repeated)return e[A].length>0;if(t.oneof)return e[t.oneof.localName].case===A;switch(t.kind){case"enum":case"scalar":return t.opt||t.req?e[A]!==void 0:t.kind=="enum"?e[A]!==t.T.values[0].no:!Pl(t.T,e[A]);case"message":return e[A]!==void 0;case"map":return Object.keys(e[A]).length>0}}function Ml(t,e){const A=t.localName,n=!t.opt&&!t.req;if(t.repeated)e[A]=[];else if(t.oneof)e[t.oneof.localName]={case:void 0};else switch(t.kind){case"map":e[A]={};break;case"enum":e[A]=n?t.T.values[0].no:void 0;break;case"scalar":e[A]=n?Pt(t.T,t.L):void 0;break;case"message":e[A]=void 0;break}}function dt(t,e){if(t===null||typeof t!="object"||!Object.getOwnPropertyNames(xs.prototype).every(n=>n in t&&typeof t[n]=="function"))return!1;const A=t.getType();return A===null||typeof A!="function"||!("typeName"in A)||typeof A.typeName!="string"?!1:e===void 0?!0:A.typeName==e.typeName}function Nl(t,e){return dt(e)||!t.fieldWrapper?e:t.fieldWrapper.wrapField(e)}k.DOUBLE,k.FLOAT,k.INT64,k.UINT64,k.INT32,k.UINT32,k.BOOL,k.STRING,k.BYTES;const Kl={ignoreUnknownFields:!1},Vl={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0};function iC(t){return t?Object.assign(Object.assign({},Kl),t):Kl}function rC(t){return t?Object.assign(Object.assign({},Vl),t):Vl}const Oi=Symbol(),Mi=Symbol();function sC(){return{makeReadOptions:iC,makeWriteOptions:rC,readMessage(t,e,A,n){if(e==null||Array.isArray(e)||typeof e!="object")throw new Error("cannot decode message ".concat(t.typeName," from JSON: ").concat(wA(e)));n=n??new t;const i=new Map,r=A.typeRegistry;for(const[s,a]of Object.entries(e)){const o=t.fields.findJsonName(s);if(o){if(o.oneof){if(a===null&&o.kind=="scalar")continue;const c=i.get(o.oneof);if(c!==void 0)throw new Error("cannot decode message ".concat(t.typeName,' from JSON: multiple keys for oneof "').concat(o.oneof.name,'" present: "').concat(c,'", "').concat(s,'"'));i.set(o.oneof,s)}Gl(n,a,o,A,t)}else{let c=!1;if(r!=null&&r.findExtension&&s.startsWith("[")&&s.endsWith("]")){const l=r.findExtension(s.substring(1,s.length-1));if(l&&l.extendee.typeName==t.typeName){c=!0;const[u,d]=Rl(l);Gl(u,a,l.field,A,l),nC(n,l,d(),A)}}if(!c&&!A.ignoreUnknownFields)throw new Error("cannot decode message ".concat(t.typeName,' from JSON: key "').concat(s,'" is unknown'))}}return n},writeMessage(t,e){const A=t.getType(),n={};let i;try{for(i of A.fields.byNumber()){if(!Ol(i,t)){if(i.req)throw"required field not set";if(!e.emitDefaultValues||!oC(i))continue}const s=i.oneof?t[i.oneof.localName].value:t[i.localName],a=jl(i,s,e);a!==void 0&&(n[e.useProtoFieldName?i.name:i.jsonName]=a)}const r=e.typeRegistry;if(r!=null&&r.findExtensionFor)for(const s of A.runtime.bin.listUnknownFields(t)){const a=r.findExtensionFor(A.typeName,s.no);if(a&&Dl(t,a)){const o=tC(t,a,e),c=jl(a.field,o,e);c!==void 0&&(n[a.field.jsonName]=c)}}}catch(r){const s=i?"cannot encode field ".concat(A.typeName,".").concat(i.name," to JSON"):"cannot encode message ".concat(A.typeName," to JSON"),a=r instanceof Error?r.message:String(r);throw new Error(s+(a.length>0?": ".concat(a):""))}return n},readScalar(t,e,A){return Cn(t,e,A??WA.BIGINT,!0)},writeScalar(t,e,A){if(e!==void 0&&(A||Pl(t,e)))return Ni(t,e)},debug:wA}}function wA(t){if(t===null)return"null";switch(typeof t){case"object":return Array.isArray(t)?"array":"object";case"string":return t.length>100?"string":'"'.concat(t.split('"').join('\\"'),'"');default:return String(t)}}function Gl(t,e,A,n,i){let r=A.localName;if(A.repeated){if(le(A.kind!="map"),e===null)return;if(!Array.isArray(e))throw new Error("cannot decode field ".concat(i.typeName,".").concat(A.name," from JSON: ").concat(wA(e)));const s=t[r];for(const a of e){if(a===null)throw new Error("cannot decode field ".concat(i.typeName,".").concat(A.name," from JSON: ").concat(wA(a)));switch(A.kind){case"message":s.push(A.T.fromJson(a,n));break;case"enum":const o=Rs(A.T,a,n.ignoreUnknownFields,!0);o!==Mi&&s.push(o);break;case"scalar":try{s.push(Cn(A.T,a,A.L,!0))}catch(c){let l="cannot decode field ".concat(i.typeName,".").concat(A.name," from JSON: ").concat(wA(a));throw c instanceof Error&&c.message.length>0&&(l+=": ".concat(c.message)),new Error(l)}break}}}else if(A.kind=="map"){if(e===null)return;if(typeof e!="object"||Array.isArray(e))throw new Error("cannot decode field ".concat(i.typeName,".").concat(A.name," from JSON: ").concat(wA(e)));const s=t[r];for(const[a,o]of Object.entries(e)){if(o===null)throw new Error("cannot decode field ".concat(i.typeName,".").concat(A.name," from JSON: map value null"));let c;try{c=aC(A.K,a)}catch(l){let u="cannot decode map key for field ".concat(i.typeName,".").concat(A.name," from JSON: ").concat(wA(e));throw l instanceof Error&&l.message.length>0&&(u+=": ".concat(l.message)),new Error(u)}switch(A.V.kind){case"message":s[c]=A.V.T.fromJson(o,n);break;case"enum":const l=Rs(A.V.T,o,n.ignoreUnknownFields,!0);l!==Mi&&(s[c]=l);break;case"scalar":try{s[c]=Cn(A.V.T,o,WA.BIGINT,!0)}catch(u){let d="cannot decode map value for field ".concat(i.typeName,".").concat(A.name," from JSON: ").concat(wA(e));throw u instanceof Error&&u.message.length>0&&(d+=": ".concat(u.message)),new Error(d)}break}}}else switch(A.oneof&&(t=t[A.oneof.localName]={case:r},r="value"),A.kind){case"message":const s=A.T;if(e===null&&s.typeName!="google.protobuf.Value")return;let a=t[r];dt(a)?a.fromJson(e,n):(t[r]=a=s.fromJson(e,n),s.fieldWrapper&&!A.oneof&&(t[r]=s.fieldWrapper.unwrapField(a)));break;case"enum":const o=Rs(A.T,e,n.ignoreUnknownFields,!1);switch(o){case Oi:Ml(A,t);break;case Mi:break;default:t[r]=o;break}break;case"scalar":try{const c=Cn(A.T,e,A.L,!1);switch(c){case Oi:Ml(A,t);break;default:t[r]=c;break}}catch(c){let l="cannot decode field ".concat(i.typeName,".").concat(A.name," from JSON: ").concat(wA(e));throw c instanceof Error&&c.message.length>0&&(l+=": ".concat(c.message)),new Error(l)}break}}function aC(t,e){if(t===k.BOOL)switch(e){case"true":e=!0;break;case"false":e=!1;break}return Cn(t,e,WA.BIGINT,!0).toString()}function Cn(t,e,A,n){if(e===null)return n?Pt(t,A):Oi;switch(t){case k.DOUBLE:case k.FLOAT:if(e==="NaN")return Number.NaN;if(e==="Infinity")return Number.POSITIVE_INFINITY;if(e==="-Infinity")return Number.NEGATIVE_INFINITY;if(e===""||typeof e=="string"&&e.trim().length!==e.length||typeof e!="string"&&typeof e!="number")break;const i=Number(e);if(Number.isNaN(i)||!Number.isFinite(i))break;return t==k.FLOAT&&Ul(i),i;case k.INT32:case k.FIXED32:case k.SFIXED32:case k.SINT32:case k.UINT32:let r;if(typeof e=="number"?r=e:typeof e=="string"&&e.length>0&&e.trim().length===e.length&&(r=Number(e)),r===void 0)break;return t==k.UINT32||t==k.FIXED32?Is(r):Li(r),r;case k.INT64:case k.SFIXED64:case k.SINT64:if(typeof e!="number"&&typeof e!="string")break;const s=se.parse(e);return A?s.toString():s;case k.FIXED64:case k.UINT64:if(typeof e!="number"&&typeof e!="string")break;const a=se.uParse(e);return A?a.toString():a;case k.BOOL:if(typeof e!="boolean")break;return e;case k.STRING:if(typeof e!="string")break;try{encodeURIComponent(e)}catch{throw new Error("invalid UTF8")}return e;case k.BYTES:if(e==="")return new Uint8Array(0);if(typeof e!="string")break;return Ll.dec(e)}throw new Error}function Rs(t,e,A,n){if(e===null)return t.typeName=="google.protobuf.NullValue"?0:n?t.values[0].no:Oi;switch(typeof e){case"number":if(Number.isInteger(e))return e;break;case"string":const i=t.findName(e);if(i!==void 0)return i.no;if(A)return Mi;break}throw new Error("cannot decode enum ".concat(t.typeName," from JSON: ").concat(wA(e)))}function oC(t){return t.repeated||t.kind=="map"?!0:!(t.oneof||t.kind=="message"||t.opt||t.req)}function jl(t,e,A){if(t.kind=="map"){le(typeof e=="object"&&e!=null);const n={},i=Object.entries(e);switch(t.V.kind){case"scalar":for(const[s,a]of i)n[s.toString()]=Ni(t.V.T,a);break;case"message":for(const[s,a]of i)n[s.toString()]=a.toJson(A);break;case"enum":const r=t.V.T;for(const[s,a]of i)n[s.toString()]=Ls(r,a,A.enumAsInteger);break}return A.emitDefaultValues||i.length>0?n:void 0}if(t.repeated){le(Array.isArray(e));const n=[];switch(t.kind){case"scalar":for(let i=0;i<e.length;i++)n.push(Ni(t.T,e[i]));break;case"enum":for(let i=0;i<e.length;i++)n.push(Ls(t.T,e[i],A.enumAsInteger));break;case"message":for(let i=0;i<e.length;i++)n.push(e[i].toJson(A));break}return A.emitDefaultValues||n.length>0?n:void 0}switch(t.kind){case"scalar":return Ni(t.T,e);case"enum":return Ls(t.T,e,A.enumAsInteger);case"message":return Nl(t.T,e).toJson(A)}}function Ls(t,e,A){var n;if(le(typeof e=="number"),t.typeName=="google.protobuf.NullValue")return null;if(A)return e;const i=t.findNumber(e);return(n=i==null?void 0:i.name)!==null&&n!==void 0?n:e}function Ni(t,e){switch(t){case k.INT32:case k.SFIXED32:case k.SINT32:case k.FIXED32:case k.UINT32:return le(typeof e=="number"),e;case k.FLOAT:case k.DOUBLE:return le(typeof e=="number"),Number.isNaN(e)?"NaN":e===Number.POSITIVE_INFINITY?"Infinity":e===Number.NEGATIVE_INFINITY?"-Infinity":e;case k.STRING:return le(typeof e=="string"),e;case k.BOOL:return le(typeof e=="boolean"),e;case k.UINT64:case k.FIXED64:case k.INT64:case k.SFIXED64:case k.SINT64:return le(typeof e=="bigint"||typeof e=="string"||typeof e=="number"),e.toString();case k.BYTES:return le(e instanceof Uint8Array),Ll.enc(e)}}const Rt=Symbol("@bufbuild/protobuf/unknown-fields"),Wl={readUnknownFields:!0,readerFactory:t=>new Zv(t)},Jl={writeUnknownFields:!0,writerFactory:()=>new zv};function cC(t){return t?Object.assign(Object.assign({},Wl),t):Wl}function lC(t){return t?Object.assign(Object.assign({},Jl),t):Jl}function uC(){return{makeReadOptions:cC,makeWriteOptions:lC,listUnknownFields(t){var e;return(e=t[Rt])!==null&&e!==void 0?e:[]},discardUnknownFields(t){delete t[Rt]},writeUnknownFields(t,e){const n=t[Rt];if(n)for(const i of n)e.tag(i.no,i.wireType).raw(i.data)},onUnknownField(t,e,A,n){const i=t;Array.isArray(i[Rt])||(i[Rt]=[]),i[Rt].push({no:e,wireType:A,data:n})},readMessage(t,e,A,n,i){const r=t.getType(),s=i?e.len:e.pos+A;let a,o;for(;e.pos<s&&([a,o]=e.tag(),!(i===!0&&o==ge.EndGroup));){const c=r.fields.find(a);if(!c){const l=e.skip(o,a);n.readUnknownFields&&this.onUnknownField(t,a,o,l);continue}Xl(t,e,c,o,n)}if(i&&(o!=ge.EndGroup||a!==A))throw new Error("invalid end group tag")},readField:Xl,writeMessage(t,e,A){const n=t.getType();for(const i of n.fields.byNumber()){if(!Ol(i,t)){if(i.req)throw new Error("cannot encode field ".concat(n.typeName,".").concat(i.name," to binary: required field not set"));continue}const r=i.oneof?t[i.oneof.localName].value:t[i.localName];ql(i,r,e,A)}return A.writeUnknownFields&&this.writeUnknownFields(t,e),e},writeField(t,e,A,n){e!==void 0&&ql(t,e,A,n)}}}function Xl(t,e,A,n,i){let{repeated:r,localName:s}=A;switch(A.oneof&&(t=t[A.oneof.localName],t.case!=s&&delete t.value,t.case=s,s="value"),A.kind){case"scalar":case"enum":const a=A.kind=="enum"?k.INT32:A.T;let o=Vi;if(A.kind=="scalar"&&A.L>0&&(o=hC),r){let d=t[s];if(n==ge.LengthDelimited&&a!=k.STRING&&a!=k.BYTES){let g=e.uint32()+e.pos;for(;e.pos<g;)d.push(o(e,a))}else d.push(o(e,a))}else t[s]=o(e,a);break;case"message":const c=A.T;r?t[s].push(Ki(e,new c,i,A)):dt(t[s])?Ki(e,t[s],i,A):(t[s]=Ki(e,new c,i,A),c.fieldWrapper&&!A.oneof&&!A.repeated&&(t[s]=c.fieldWrapper.unwrapField(t[s])));break;case"map":let[l,u]=dC(A,e,i);t[s][l]=u;break}}function Ki(t,e,A,n){const i=e.getType().runtime.bin,r=n==null?void 0:n.delimited;return i.readMessage(e,t,r?n.no:t.uint32(),A,r),e}function dC(t,e,A){const n=e.uint32(),i=e.pos+n;let r,s;for(;e.pos<i;){const[a]=e.tag();switch(a){case 1:r=Vi(e,t.K);break;case 2:switch(t.V.kind){case"scalar":s=Vi(e,t.V.T);break;case"enum":s=e.int32();break;case"message":s=Ki(e,new t.V.T,A,void 0);break}break}}if(r===void 0&&(r=Pt(t.K,WA.BIGINT)),typeof r!="string"&&typeof r!="number"&&(r=r.toString()),s===void 0)switch(t.V.kind){case"scalar":s=Pt(t.V.T,WA.BIGINT);break;case"enum":s=t.V.T.values[0].no;break;case"message":s=new t.V.T;break}return[r,s]}function hC(t,e){const A=Vi(t,e);return typeof A=="bigint"?A.toString():A}function Vi(t,e){switch(e){case k.STRING:return t.string();case k.BOOL:return t.bool();case k.DOUBLE:return t.double();case k.FLOAT:return t.float();case k.INT32:return t.int32();case k.INT64:return t.int64();case k.UINT64:return t.uint64();case k.FIXED64:return t.fixed64();case k.BYTES:return t.bytes();case k.FIXED32:return t.fixed32();case k.SFIXED32:return t.sfixed32();case k.SFIXED64:return t.sfixed64();case k.SINT64:return t.sint64();case k.UINT32:return t.uint32();case k.SINT32:return t.sint32()}}function ql(t,e,A,n){le(e!==void 0);const i=t.repeated;switch(t.kind){case"scalar":case"enum":let r=t.kind=="enum"?k.INT32:t.T;if(i)if(le(Array.isArray(e)),t.packed)gC(A,r,t.no,e);else for(const s of e)wn(A,r,t.no,s);else wn(A,r,t.no,e);break;case"message":if(i){le(Array.isArray(e));for(const s of e)Yl(A,n,t,s)}else Yl(A,n,t,e);break;case"map":le(typeof e=="object"&&e!=null);for(const[s,a]of Object.entries(e))fC(A,n,t,s,a);break}}function fC(t,e,A,n,i){t.tag(A.no,ge.LengthDelimited),t.fork();let r=n;switch(A.K){case k.INT32:case k.FIXED32:case k.UINT32:case k.SFIXED32:case k.SINT32:r=Number.parseInt(n);break;case k.BOOL:le(n=="true"||n=="false"),r=n=="true";break}switch(wn(t,A.K,1,r),A.V.kind){case"scalar":wn(t,A.V.T,2,i);break;case"enum":wn(t,k.INT32,2,i);break;case"message":le(i!==void 0),t.tag(2,ge.LengthDelimited).bytes(i.toBinary(e));break}t.join()}function Yl(t,e,A,n){const i=Nl(A.T,n);A.delimited?t.tag(A.no,ge.StartGroup).raw(i.toBinary(e)).tag(A.no,ge.EndGroup):t.tag(A.no,ge.LengthDelimited).bytes(i.toBinary(e))}function wn(t,e,A,n){le(n!==void 0);let[i,r]=zl(e);t.tag(A,i)[r](n)}function gC(t,e,A,n){if(!n.length)return;t.tag(A,ge.LengthDelimited).fork();let[,i]=zl(e);for(let r=0;r<n.length;r++)t[i](n[r]);t.join()}function zl(t){let e=ge.Varint;switch(t){case k.BYTES:case k.STRING:e=ge.LengthDelimited;break;case k.DOUBLE:case k.FIXED64:case k.SFIXED64:e=ge.Bit64;break;case k.FIXED32:case k.SFIXED32:case k.FLOAT:e=ge.Bit32;break}const A=k[t].toLowerCase();return[e,A]}function pC(){return{setEnumType:El,initPartial(t,e){if(t===void 0)return;const A=e.getType();for(const n of A.fields.byMember()){const i=n.localName,r=e,s=t;if(s[i]!=null)switch(n.kind){case"oneof":const a=s[i].case;if(a===void 0)continue;const o=n.findField(a);let c=s[i].value;o&&o.kind=="message"&&!dt(c,o.T)?c=new o.T(c):o&&o.kind==="scalar"&&o.T===k.BYTES&&(c=bn(c)),r[i]={case:a,value:c};break;case"scalar":case"enum":let l=s[i];n.T===k.BYTES&&(l=n.repeated?l.map(bn):bn(l)),r[i]=l;break;case"map":switch(n.V.kind){case"scalar":case"enum":if(n.V.T===k.BYTES)for(const[h,g]of Object.entries(s[i]))r[i][h]=bn(g);else Object.assign(r[i],s[i]);break;case"message":const d=n.V.T;for(const h of Object.keys(s[i])){let g=s[i][h];d.fieldWrapper||(g=new d(g)),r[i][h]=g}break}break;case"message":const u=n.T;if(n.repeated)r[i]=s[i].map(d=>dt(d,u)?d:new u(d));else{const d=s[i];u.fieldWrapper?u.typeName==="google.protobuf.BytesValue"?r[i]=bn(d):r[i]=d:r[i]=dt(d,u)?d:new u(d)}break}}},equals(t,e,A){return e===A?!0:!e||!A?!1:t.fields.byMember().every(n=>{const i=e[n.localName],r=A[n.localName];if(n.repeated){if(i.length!==r.length)return!1;switch(n.kind){case"message":return i.every((s,a)=>n.T.equals(s,r[a]));case"scalar":return i.every((s,a)=>JA(n.T,s,r[a]));case"enum":return i.every((s,a)=>JA(k.INT32,s,r[a]))}throw new Error("repeated cannot contain ".concat(n.kind))}switch(n.kind){case"message":return n.T.equals(i,r);case"enum":return JA(k.INT32,i,r);case"scalar":return JA(n.T,i,r);case"oneof":if(i.case!==r.case)return!1;const s=n.findField(i.case);if(s===void 0)return!0;switch(s.kind){case"message":return s.T.equals(i.value,r.value);case"enum":return JA(k.INT32,i.value,r.value);case"scalar":return JA(s.T,i.value,r.value)}throw new Error("oneof cannot contain ".concat(s.kind));case"map":const a=Object.keys(i).concat(Object.keys(r));switch(n.V.kind){case"message":const o=n.V.T;return a.every(l=>o.equals(i[l],r[l]));case"enum":return a.every(l=>JA(k.INT32,i[l],r[l]));case"scalar":const c=n.V.T;return a.every(l=>JA(c,i[l],r[l]))}break}})},clone(t){const e=t.getType(),A=new e,n=A;for(const i of e.fields.byMember()){const r=t[i.localName];let s;if(i.repeated)s=r.map(Gi);else if(i.kind=="map"){s=n[i.localName];for(const[a,o]of Object.entries(r))s[a]=Gi(o)}else i.kind=="oneof"?s=i.findField(r.case)?{case:r.case,value:Gi(r.value)}:{case:void 0}:s=Gi(r);n[i.localName]=s}for(const i of e.runtime.bin.listUnknownFields(t))e.runtime.bin.onUnknownField(n,i.no,i.wireType,i.data);return A}}}function Gi(t){if(t===void 0)return t;if(dt(t))return t.clone();if(t instanceof Uint8Array){const e=new Uint8Array(t.byteLength);return e.set(t),e}return t}function bn(t){return t instanceof Uint8Array?t:new Uint8Array(t)}function mC(t,e,A){return{syntax:t,json:sC(),bin:uC(),util:Object.assign(Object.assign({},pC()),{newFieldList:e,initFields:A}),makeMessageType(n,i,r){return jv(this,n,i,r)},makeEnum:Gv,makeEnumType:Sl,getEnumType:Vv,makeExtension(n,i,r){return $v(this,n,i,r)}}}class BC{constructor(e,A){this._fields=e,this._normalizer=A}findJsonName(e){if(!this.jsonNames){const A={};for(const n of this.list())A[n.jsonName]=A[n.name]=n;this.jsonNames=A}return this.jsonNames[e]}find(e){if(!this.numbers){const A={};for(const n of this.list())A[n.no]=n;this.numbers=A}return this.numbers[e]}list(){return this.all||(this.all=this._normalizer(this._fields)),this.all}byNumber(){return this.numbersAsc||(this.numbersAsc=this.list().concat().sort((e,A)=>e.no-A.no)),this.numbersAsc}byMember(){if(!this.members){this.members=[];const e=this.members;let A;for(const n of this.list())n.oneof?n.oneof!==A&&(A=n.oneof,e.push(A)):e.push(n)}return this.members}}function Zl(t,e){const A=$l(t);return e?A:UC(yC(A))}function vC(t){return Zl(t,!1)}const CC=$l;function $l(t){let e=!1;const A=[];for(let n=0;n<t.length;n++){let i=t.charAt(n);switch(i){case"_":e=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":A.push(i),e=!1;break;default:e&&(e=!1,i=i.toUpperCase()),A.push(i);break}}return A.join("")}const wC=new Set(["constructor","toString","toJSON","valueOf"]),bC=new Set(["getType","clone","equals","fromBinary","fromJson","fromJsonString","toBinary","toJson","toJsonString","toObject"]),eu=t=>"".concat(t,"$"),yC=t=>bC.has(t)?eu(t):t,UC=t=>wC.has(t)?eu(t):t;class QC{constructor(e){this.kind="oneof",this.repeated=!1,this.packed=!1,this.opt=!1,this.req=!1,this.default=void 0,this.fields=[],this.name=e,this.localName=vC(e)}addField(e){le(e.oneof===this,"field ".concat(e.name," not one of ").concat(this.name)),this.fields.push(e)}findField(e){if(!this._lookup){this._lookup=Object.create(null);for(let A=0;A<this.fields.length;A++)this._lookup[this.fields[A].localName]=this.fields[A]}return this._lookup[e]}}function EC(t,e){var A,n,i,r,s,a;const o=[];let c;for(const l of typeof t=="function"?t():t){const u=l;if(u.localName=Zl(l.name,l.oneof!==void 0),u.jsonName=(A=l.jsonName)!==null&&A!==void 0?A:CC(l.name),u.repeated=(n=l.repeated)!==null&&n!==void 0?n:!1,l.kind=="scalar"&&(u.L=(i=l.L)!==null&&i!==void 0?i:WA.BIGINT),u.delimited=(r=l.delimited)!==null&&r!==void 0?r:!1,u.req=(s=l.req)!==null&&s!==void 0?s:!1,u.opt=(a=l.opt)!==null&&a!==void 0?a:!1,l.packed===void 0&&(u.packed=l.kind=="enum"||l.kind=="scalar"&&l.T!=k.BYTES&&l.T!=k.STRING),l.oneof!==void 0){const d=typeof l.oneof=="string"?l.oneof:l.oneof.name;(!c||c.name!=d)&&(c=new QC(d)),u.oneof=c,c.addField(u)}o.push(u)}return o}const Q=mC("proto3",t=>new BC(t,e=>EC(e)),t=>{for(const e of t.getType().fields.byMember()){if(e.opt)continue;const A=e.localName,n=t;if(e.repeated){n[A]=[];continue}switch(e.kind){case"oneof":n[A]={case:void 0};break;case"enum":n[A]=0;break;case"map":n[A]={};break;case"scalar":n[A]=Pt(e.T,e.L);break}}});class Me extends xs{constructor(e){super(),this.seconds=se.zero,this.nanos=0,Q.util.initPartial(e,this)}fromJson(e,A){if(typeof e!="string")throw new Error("cannot decode google.protobuf.Timestamp from JSON: ".concat(Q.json.debug(e)));const n=e.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!n)throw new Error("cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string");const i=Date.parse(n[1]+"-"+n[2]+"-"+n[3]+"T"+n[4]+":"+n[5]+":"+n[6]+(n[8]?n[8]:"Z"));if(Number.isNaN(i))throw new Error("cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string");if(i<Date.parse("0001-01-01T00:00:00Z")||i>Date.parse("9999-12-31T23:59:59Z"))throw new Error("cannot decode message google.protobuf.Timestamp from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive");return this.seconds=se.parse(i/1e3),this.nanos=0,n[7]&&(this.nanos=parseInt("1"+n[7]+"0".repeat(9-n[7].length))-1e9),this}toJson(e){const A=Number(this.seconds)*1e3;if(A<Date.parse("0001-01-01T00:00:00Z")||A>Date.parse("9999-12-31T23:59:59Z"))throw new Error("cannot encode google.protobuf.Timestamp to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive");if(this.nanos<0)throw new Error("cannot encode google.protobuf.Timestamp to JSON: nanos must not be negative");let n="Z";if(this.nanos>0){const i=(this.nanos+1e9).toString().substring(1);i.substring(3)==="000000"?n="."+i.substring(0,3)+"Z":i.substring(6)==="000"?n="."+i.substring(0,6)+"Z":n="."+i+"Z"}return new Date(A).toISOString().replace(".000Z",n)}toDate(){return new Date(Number(this.seconds)*1e3+Math.ceil(this.nanos/1e6))}static now(){return Me.fromDate(new Date)}static fromDate(e){const A=e.getTime();return new Me({seconds:se.parse(Math.floor(A/1e3)),nanos:A%1e3*1e6})}static fromBinary(e,A){return new Me().fromBinary(e,A)}static fromJson(e,A){return new Me().fromJson(e,A)}static fromJsonString(e,A){return new Me().fromJsonString(e,A)}static equals(e,A){return Q.util.equals(Me,e,A)}}Me.runtime=Q,Me.typeName="google.protobuf.Timestamp",Me.fields=Q.util.newFieldList(()=>[{no:1,name:"seconds",kind:"scalar",T:3},{no:2,name:"nanos",kind:"scalar",T:5}]);const SC=Q.makeMessageType("livekit.MetricsBatch",()=>[{no:1,name:"timestamp_ms",kind:"scalar",T:3},{no:2,name:"normalized_timestamp",kind:"message",T:Me},{no:3,name:"str_data",kind:"scalar",T:9,repeated:!0},{no:4,name:"time_series",kind:"message",T:kC,repeated:!0},{no:5,name:"events",kind:"message",T:FC,repeated:!0}]),kC=Q.makeMessageType("livekit.TimeSeriesMetric",()=>[{no:1,name:"label",kind:"scalar",T:13},{no:2,name:"participant_identity",kind:"scalar",T:13},{no:3,name:"track_sid",kind:"scalar",T:13},{no:4,name:"samples",kind:"message",T:TC,repeated:!0},{no:5,name:"rid",kind:"scalar",T:13}]),TC=Q.makeMessageType("livekit.MetricSample",()=>[{no:1,name:"timestamp_ms",kind:"scalar",T:3},{no:2,name:"normalized_timestamp",kind:"message",T:Me},{no:3,name:"value",kind:"scalar",T:2}]),FC=Q.makeMessageType("livekit.EventMetric",()=>[{no:1,name:"label",kind:"scalar",T:13},{no:2,name:"participant_identity",kind:"scalar",T:13},{no:3,name:"track_sid",kind:"scalar",T:13},{no:4,name:"start_timestamp_ms",kind:"scalar",T:3},{no:5,name:"end_timestamp_ms",kind:"scalar",T:3,opt:!0},{no:6,name:"normalized_start_timestamp",kind:"message",T:Me},{no:7,name:"normalized_end_timestamp",kind:"message",T:Me,opt:!0},{no:8,name:"metadata",kind:"scalar",T:9},{no:9,name:"rid",kind:"scalar",T:13}]),Au=Q.makeEnum("livekit.BackupCodecPolicy",[{no:0,name:"PREFER_REGRESSION"},{no:1,name:"SIMULCAST"},{no:2,name:"REGRESSION"}]),sA=Q.makeEnum("livekit.TrackType",[{no:0,name:"AUDIO"},{no:1,name:"VIDEO"},{no:2,name:"DATA"}]),Be=Q.makeEnum("livekit.TrackSource",[{no:0,name:"UNKNOWN"},{no:1,name:"CAMERA"},{no:2,name:"MICROPHONE"},{no:3,name:"SCREEN_SHARE"},{no:4,name:"SCREEN_SHARE_AUDIO"}]),Lt=Q.makeEnum("livekit.VideoQuality",[{no:0,name:"LOW"},{no:1,name:"MEDIUM"},{no:2,name:"HIGH"},{no:3,name:"OFF"}]),yn=Q.makeEnum("livekit.ConnectionQuality",[{no:0,name:"POOR"},{no:1,name:"GOOD"},{no:2,name:"EXCELLENT"},{no:3,name:"LOST"}]),Un=Q.makeEnum("livekit.ClientConfigSetting",[{no:0,name:"UNSET"},{no:1,name:"DISABLED"},{no:2,name:"ENABLED"}]),aA=Q.makeEnum("livekit.DisconnectReason",[{no:0,name:"UNKNOWN_REASON"},{no:1,name:"CLIENT_INITIATED"},{no:2,name:"DUPLICATE_IDENTITY"},{no:3,name:"SERVER_SHUTDOWN"},{no:4,name:"PARTICIPANT_REMOVED"},{no:5,name:"ROOM_DELETED"},{no:6,name:"STATE_MISMATCH"},{no:7,name:"JOIN_FAILURE"},{no:8,name:"MIGRATION"},{no:9,name:"SIGNAL_CLOSE"},{no:10,name:"ROOM_CLOSED"},{no:11,name:"USER_UNAVAILABLE"},{no:12,name:"USER_REJECTED"},{no:13,name:"SIP_TRUNK_FAILURE"},{no:14,name:"CONNECTION_TIMEOUT"}]),Dt=Q.makeEnum("livekit.ReconnectReason",[{no:0,name:"RR_UNKNOWN"},{no:1,name:"RR_SIGNAL_DISCONNECTED"},{no:2,name:"RR_PUBLISHER_FAILED"},{no:3,name:"RR_SUBSCRIBER_FAILED"},{no:4,name:"RR_SWITCH_CANDIDATE"}]),IC=Q.makeEnum("livekit.SubscriptionError",[{no:0,name:"SE_UNKNOWN"},{no:1,name:"SE_CODEC_UNSUPPORTED"},{no:2,name:"SE_TRACK_NOTFOUND"}]),oA=Q.makeEnum("livekit.AudioTrackFeature",[{no:0,name:"TF_STEREO"},{no:1,name:"TF_NO_DTX"},{no:2,name:"TF_AUTO_GAIN_CONTROL"},{no:3,name:"TF_ECHO_CANCELLATION"},{no:4,name:"TF_NOISE_SUPPRESSION"},{no:5,name:"TF_ENHANCED_NOISE_CANCELLATION"},{no:6,name:"TF_PRECONNECT_BUFFER"}]),ji=Q.makeMessageType("livekit.Room",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"empty_timeout",kind:"scalar",T:13},{no:14,name:"departure_timeout",kind:"scalar",T:13},{no:4,name:"max_participants",kind:"scalar",T:13},{no:5,name:"creation_time",kind:"scalar",T:3},{no:15,name:"creation_time_ms",kind:"scalar",T:3},{no:6,name:"turn_password",kind:"scalar",T:9},{no:7,name:"enabled_codecs",kind:"message",T:Wi,repeated:!0},{no:8,name:"metadata",kind:"scalar",T:9},{no:9,name:"num_participants",kind:"scalar",T:13},{no:11,name:"num_publishers",kind:"scalar",T:13},{no:10,name:"active_recording",kind:"scalar",T:8},{no:13,name:"version",kind:"message",T:fu}]),Wi=Q.makeMessageType("livekit.Codec",()=>[{no:1,name:"mime",kind:"scalar",T:9},{no:2,name:"fmtp_line",kind:"scalar",T:9}]),xC=Q.makeMessageType("livekit.ParticipantPermission",()=>[{no:1,name:"can_subscribe",kind:"scalar",T:8},{no:2,name:"can_publish",kind:"scalar",T:8},{no:3,name:"can_publish_data",kind:"scalar",T:8},{no:9,name:"can_publish_sources",kind:"enum",T:Q.getEnumType(Be),repeated:!0},{no:7,name:"hidden",kind:"scalar",T:8},{no:8,name:"recorder",kind:"scalar",T:8},{no:10,name:"can_update_metadata",kind:"scalar",T:8},{no:11,name:"agent",kind:"scalar",T:8},{no:12,name:"can_subscribe_metrics",kind:"scalar",T:8}]),ht=Q.makeMessageType("livekit.ParticipantInfo",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"identity",kind:"scalar",T:9},{no:3,name:"state",kind:"enum",T:Q.getEnumType(Ht)},{no:4,name:"tracks",kind:"message",T:Ot,repeated:!0},{no:5,name:"metadata",kind:"scalar",T:9},{no:6,name:"joined_at",kind:"scalar",T:3},{no:17,name:"joined_at_ms",kind:"scalar",T:3},{no:9,name:"name",kind:"scalar",T:9},{no:10,name:"version",kind:"scalar",T:13},{no:11,name:"permission",kind:"message",T:xC},{no:12,name:"region",kind:"scalar",T:9},{no:13,name:"is_publisher",kind:"scalar",T:8},{no:14,name:"kind",kind:"enum",T:Q.getEnumType(Ji)},{no:15,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:16,name:"disconnect_reason",kind:"enum",T:Q.getEnumType(aA)},{no:18,name:"kind_details",kind:"enum",T:Q.getEnumType(_C),repeated:!0}]),Ht=Q.makeEnum("livekit.ParticipantInfo.State",[{no:0,name:"JOINING"},{no:1,name:"JOINED"},{no:2,name:"ACTIVE"},{no:3,name:"DISCONNECTED"}]),Ji=Q.makeEnum("livekit.ParticipantInfo.Kind",[{no:0,name:"STANDARD"},{no:1,name:"INGRESS"},{no:2,name:"EGRESS"},{no:3,name:"SIP"},{no:4,name:"AGENT"}]),_C=Q.makeEnum("livekit.ParticipantInfo.KindDetail",[{no:0,name:"CLOUD_AGENT"},{no:1,name:"FORWARDED"}]),qe=Q.makeEnum("livekit.Encryption.Type",[{no:0,name:"NONE"},{no:1,name:"GCM"},{no:2,name:"CUSTOM"}]),PC=Q.makeMessageType("livekit.SimulcastCodecInfo",()=>[{no:1,name:"mime_type",kind:"scalar",T:9},{no:2,name:"mid",kind:"scalar",T:9},{no:3,name:"cid",kind:"scalar",T:9},{no:4,name:"layers",kind:"message",T:ft,repeated:!0}]),Ot=Q.makeMessageType("livekit.TrackInfo",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:Q.getEnumType(sA)},{no:3,name:"name",kind:"scalar",T:9},{no:4,name:"muted",kind:"scalar",T:8},{no:5,name:"width",kind:"scalar",T:13},{no:6,name:"height",kind:"scalar",T:13},{no:7,name:"simulcast",kind:"scalar",T:8},{no:8,name:"disable_dtx",kind:"scalar",T:8},{no:9,name:"source",kind:"enum",T:Q.getEnumType(Be)},{no:10,name:"layers",kind:"message",T:ft,repeated:!0},{no:11,name:"mime_type",kind:"scalar",T:9},{no:12,name:"mid",kind:"scalar",T:9},{no:13,name:"codecs",kind:"message",T:PC,repeated:!0},{no:14,name:"stereo",kind:"scalar",T:8},{no:15,name:"disable_red",kind:"scalar",T:8},{no:16,name:"encryption",kind:"enum",T:Q.getEnumType(qe)},{no:17,name:"stream",kind:"scalar",T:9},{no:18,name:"version",kind:"message",T:fu},{no:19,name:"audio_features",kind:"enum",T:Q.getEnumType(oA),repeated:!0},{no:20,name:"backup_codec_policy",kind:"enum",T:Q.getEnumType(Au)}]),ft=Q.makeMessageType("livekit.VideoLayer",()=>[{no:1,name:"quality",kind:"enum",T:Q.getEnumType(Lt)},{no:2,name:"width",kind:"scalar",T:13},{no:3,name:"height",kind:"scalar",T:13},{no:4,name:"bitrate",kind:"scalar",T:13},{no:5,name:"ssrc",kind:"scalar",T:13}]),Ne=Q.makeMessageType("livekit.DataPacket",()=>[{no:1,name:"kind",kind:"enum",T:Q.getEnumType(X)},{no:4,name:"participant_identity",kind:"scalar",T:9},{no:5,name:"destination_identities",kind:"scalar",T:9,repeated:!0},{no:2,name:"user",kind:"message",T:nu,oneof:"value"},{no:3,name:"speaker",kind:"message",T:RC,oneof:"value"},{no:6,name:"sip_dtmf",kind:"message",T:iu,oneof:"value"},{no:7,name:"transcription",kind:"message",T:LC,oneof:"value"},{no:8,name:"metrics",kind:"message",T:SC,oneof:"value"},{no:9,name:"chat_message",kind:"message",T:Ds,oneof:"value"},{no:10,name:"rpc_request",kind:"message",T:ru,oneof:"value"},{no:11,name:"rpc_ack",kind:"message",T:su,oneof:"value"},{no:12,name:"rpc_response",kind:"message",T:au,oneof:"value"},{no:13,name:"stream_header",kind:"message",T:Os,oneof:"value"},{no:14,name:"stream_chunk",kind:"message",T:Ms,oneof:"value"},{no:15,name:"stream_trailer",kind:"message",T:Ns,oneof:"value"}]),X=Q.makeEnum("livekit.DataPacket.Kind",[{no:0,name:"RELIABLE"},{no:1,name:"LOSSY"}]),RC=Q.makeMessageType("livekit.ActiveSpeakerUpdate",()=>[{no:1,name:"speakers",kind:"message",T:tu,repeated:!0}]),tu=Q.makeMessageType("livekit.SpeakerInfo",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"level",kind:"scalar",T:2},{no:3,name:"active",kind:"scalar",T:8}]),nu=Q.makeMessageType("livekit.UserPacket",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:5,name:"participant_identity",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",T:12},{no:3,name:"destination_sids",kind:"scalar",T:9,repeated:!0},{no:6,name:"destination_identities",kind:"scalar",T:9,repeated:!0},{no:4,name:"topic",kind:"scalar",T:9,opt:!0},{no:8,name:"id",kind:"scalar",T:9,opt:!0},{no:9,name:"start_time",kind:"scalar",T:4,opt:!0},{no:10,name:"end_time",kind:"scalar",T:4,opt:!0},{no:11,name:"nonce",kind:"scalar",T:12}]),iu=Q.makeMessageType("livekit.SipDTMF",()=>[{no:3,name:"code",kind:"scalar",T:13},{no:4,name:"digit",kind:"scalar",T:9}]),LC=Q.makeMessageType("livekit.Transcription",()=>[{no:2,name:"transcribed_participant_identity",kind:"scalar",T:9},{no:3,name:"track_id",kind:"scalar",T:9},{no:4,name:"segments",kind:"message",T:DC,repeated:!0}]),DC=Q.makeMessageType("livekit.TranscriptionSegment",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"text",kind:"scalar",T:9},{no:3,name:"start_time",kind:"scalar",T:4},{no:4,name:"end_time",kind:"scalar",T:4},{no:5,name:"final",kind:"scalar",T:8},{no:6,name:"language",kind:"scalar",T:9}]),Ds=Q.makeMessageType("livekit.ChatMessage",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"timestamp",kind:"scalar",T:3},{no:3,name:"edit_timestamp",kind:"scalar",T:3,opt:!0},{no:4,name:"message",kind:"scalar",T:9},{no:5,name:"deleted",kind:"scalar",T:8},{no:6,name:"generated",kind:"scalar",T:8}]),ru=Q.makeMessageType("livekit.RpcRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"method",kind:"scalar",T:9},{no:3,name:"payload",kind:"scalar",T:9},{no:4,name:"response_timeout_ms",kind:"scalar",T:13},{no:5,name:"version",kind:"scalar",T:13}]),su=Q.makeMessageType("livekit.RpcAck",()=>[{no:1,name:"request_id",kind:"scalar",T:9}]),au=Q.makeMessageType("livekit.RpcResponse",()=>[{no:1,name:"request_id",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",T:9,oneof:"value"},{no:3,name:"error",kind:"message",T:ou,oneof:"value"}]),ou=Q.makeMessageType("livekit.RpcError",()=>[{no:1,name:"code",kind:"scalar",T:13},{no:2,name:"message",kind:"scalar",T:9},{no:3,name:"data",kind:"scalar",T:9}]),cu=Q.makeMessageType("livekit.ParticipantTracks",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sids",kind:"scalar",T:9,repeated:!0}]),HC=Q.makeMessageType("livekit.ServerInfo",()=>[{no:1,name:"edition",kind:"enum",T:Q.getEnumType(lu)},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"protocol",kind:"scalar",T:5},{no:4,name:"region",kind:"scalar",T:9},{no:5,name:"node_id",kind:"scalar",T:9},{no:6,name:"debug_info",kind:"scalar",T:9},{no:7,name:"agent_protocol",kind:"scalar",T:5}]),lu=Q.makeEnum("livekit.ServerInfo.Edition",[{no:0,name:"Standard"},{no:1,name:"Cloud"}]),OC=Q.makeMessageType("livekit.ClientInfo",()=>[{no:1,name:"sdk",kind:"enum",T:Q.getEnumType(uu)},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"protocol",kind:"scalar",T:5},{no:4,name:"os",kind:"scalar",T:9},{no:5,name:"os_version",kind:"scalar",T:9},{no:6,name:"device_model",kind:"scalar",T:9},{no:7,name:"browser",kind:"scalar",T:9},{no:8,name:"browser_version",kind:"scalar",T:9},{no:9,name:"address",kind:"scalar",T:9},{no:10,name:"network",kind:"scalar",T:9},{no:11,name:"other_sdks",kind:"scalar",T:9}]),uu=Q.makeEnum("livekit.ClientInfo.SDK",[{no:0,name:"UNKNOWN"},{no:1,name:"JS"},{no:2,name:"SWIFT"},{no:3,name:"ANDROID"},{no:4,name:"FLUTTER"},{no:5,name:"GO"},{no:6,name:"UNITY"},{no:7,name:"REACT_NATIVE"},{no:8,name:"RUST"},{no:9,name:"PYTHON"},{no:10,name:"CPP"},{no:11,name:"UNITY_WEB"},{no:12,name:"NODE"},{no:13,name:"UNREAL"}]),du=Q.makeMessageType("livekit.ClientConfiguration",()=>[{no:1,name:"video",kind:"message",T:hu},{no:2,name:"screen",kind:"message",T:hu},{no:3,name:"resume_connection",kind:"enum",T:Q.getEnumType(Un)},{no:4,name:"disabled_codecs",kind:"message",T:MC},{no:5,name:"force_relay",kind:"enum",T:Q.getEnumType(Un)}]),hu=Q.makeMessageType("livekit.VideoConfiguration",()=>[{no:1,name:"hardware_encoder",kind:"enum",T:Q.getEnumType(Un)}]),MC=Q.makeMessageType("livekit.DisabledCodecs",()=>[{no:1,name:"codecs",kind:"message",T:Wi,repeated:!0},{no:2,name:"publish",kind:"message",T:Wi,repeated:!0}]),fu=Q.makeMessageType("livekit.TimedVersion",()=>[{no:1,name:"unix_micro",kind:"scalar",T:3},{no:2,name:"ticks",kind:"scalar",T:5}]),Hs=Q.makeEnum("livekit.DataStream.OperationType",[{no:0,name:"CREATE"},{no:1,name:"UPDATE"},{no:2,name:"DELETE"},{no:3,name:"REACTION"}]),gu=Q.makeMessageType("livekit.DataStream.TextHeader",()=>[{no:1,name:"operation_type",kind:"enum",T:Q.getEnumType(Hs)},{no:2,name:"version",kind:"scalar",T:5},{no:3,name:"reply_to_stream_id",kind:"scalar",T:9},{no:4,name:"attached_stream_ids",kind:"scalar",T:9,repeated:!0},{no:5,name:"generated",kind:"scalar",T:8}],{localName:"DataStream_TextHeader"}),pu=Q.makeMessageType("livekit.DataStream.ByteHeader",()=>[{no:1,name:"name",kind:"scalar",T:9}],{localName:"DataStream_ByteHeader"}),Os=Q.makeMessageType("livekit.DataStream.Header",()=>[{no:1,name:"stream_id",kind:"scalar",T:9},{no:2,name:"timestamp",kind:"scalar",T:3},{no:3,name:"topic",kind:"scalar",T:9},{no:4,name:"mime_type",kind:"scalar",T:9},{no:5,name:"total_length",kind:"scalar",T:4,opt:!0},{no:7,name:"encryption_type",kind:"enum",T:Q.getEnumType(qe)},{no:8,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:9,name:"text_header",kind:"message",T:gu,oneof:"content_header"},{no:10,name:"byte_header",kind:"message",T:pu,oneof:"content_header"}],{localName:"DataStream_Header"}),Ms=Q.makeMessageType("livekit.DataStream.Chunk",()=>[{no:1,name:"stream_id",kind:"scalar",T:9},{no:2,name:"chunk_index",kind:"scalar",T:4},{no:3,name:"content",kind:"scalar",T:12},{no:4,name:"version",kind:"scalar",T:5},{no:5,name:"iv",kind:"scalar",T:12,opt:!0}],{localName:"DataStream_Chunk"}),Ns=Q.makeMessageType("livekit.DataStream.Trailer",()=>[{no:1,name:"stream_id",kind:"scalar",T:9},{no:2,name:"reason",kind:"scalar",T:9},{no:3,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}}],{localName:"DataStream_Trailer"}),cA=Q.makeEnum("livekit.SignalTarget",[{no:0,name:"PUBLISHER"},{no:1,name:"SUBSCRIBER"}]),Ks=Q.makeEnum("livekit.StreamState",[{no:0,name:"ACTIVE"},{no:1,name:"PAUSED"}]),NC=Q.makeEnum("livekit.CandidateProtocol",[{no:0,name:"UDP"},{no:1,name:"TCP"},{no:2,name:"TLS"}]),KC=Q.makeMessageType("livekit.SignalRequest",()=>[{no:1,name:"offer",kind:"message",T:gt,oneof:"message"},{no:2,name:"answer",kind:"message",T:gt,oneof:"message"},{no:3,name:"trickle",kind:"message",T:js,oneof:"message"},{no:4,name:"add_track",kind:"message",T:Gs,oneof:"message"},{no:5,name:"mute",kind:"message",T:Ws,oneof:"message"},{no:6,name:"subscription",kind:"message",T:Xi,oneof:"message"},{no:7,name:"track_setting",kind:"message",T:Bu,oneof:"message"},{no:8,name:"leave",kind:"message",T:qi,oneof:"message"},{no:10,name:"update_layers",kind:"message",T:Cu,oneof:"message"},{no:11,name:"subscription_permission",kind:"message",T:Uu,oneof:"message"},{no:12,name:"sync_state",kind:"message",T:Qu,oneof:"message"},{no:13,name:"simulate",kind:"message",T:bA,oneof:"message"},{no:14,name:"ping",kind:"scalar",T:3,oneof:"message"},{no:15,name:"update_metadata",kind:"message",T:wu,oneof:"message"},{no:16,name:"ping_req",kind:"message",T:Su,oneof:"message"},{no:17,name:"update_audio_track",kind:"message",T:vu,oneof:"message"},{no:18,name:"update_video_track",kind:"message",T:JC,oneof:"message"}]),mu=Q.makeMessageType("livekit.SignalResponse",()=>[{no:1,name:"join",kind:"message",T:VC,oneof:"message"},{no:2,name:"answer",kind:"message",T:gt,oneof:"message"},{no:3,name:"offer",kind:"message",T:gt,oneof:"message"},{no:4,name:"trickle",kind:"message",T:js,oneof:"message"},{no:5,name:"update",kind:"message",T:WC,oneof:"message"},{no:6,name:"track_published",kind:"message",T:Js,oneof:"message"},{no:8,name:"leave",kind:"message",T:qi,oneof:"message"},{no:9,name:"mute",kind:"message",T:Ws,oneof:"message"},{no:10,name:"speakers_changed",kind:"message",T:XC,oneof:"message"},{no:11,name:"room_update",kind:"message",T:qC,oneof:"message"},{no:12,name:"connection_quality",kind:"message",T:zC,oneof:"message"},{no:13,name:"stream_state_update",kind:"message",T:$C,oneof:"message"},{no:14,name:"subscribed_quality_update",kind:"message",T:Aw,oneof:"message"},{no:15,name:"subscription_permission_update",kind:"message",T:tw,oneof:"message"},{no:16,name:"refresh_token",kind:"scalar",T:9,oneof:"message"},{no:17,name:"track_unpublished",kind:"message",T:jC,oneof:"message"},{no:18,name:"pong",kind:"scalar",T:3,oneof:"message"},{no:19,name:"reconnect",kind:"message",T:GC,oneof:"message"},{no:20,name:"pong_resp",kind:"message",T:iw,oneof:"message"},{no:21,name:"subscription_response",kind:"message",T:aw,oneof:"message"},{no:22,name:"request_response",kind:"message",T:ow,oneof:"message"},{no:23,name:"track_subscribed",kind:"message",T:cw,oneof:"message"},{no:24,name:"room_moved",kind:"message",T:nw,oneof:"message"}]),Vs=Q.makeMessageType("livekit.SimulcastCodec",()=>[{no:1,name:"codec",kind:"scalar",T:9},{no:2,name:"cid",kind:"scalar",T:9}]),Gs=Q.makeMessageType("livekit.AddTrackRequest",()=>[{no:1,name:"cid",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"type",kind:"enum",T:Q.getEnumType(sA)},{no:4,name:"width",kind:"scalar",T:13},{no:5,name:"height",kind:"scalar",T:13},{no:6,name:"muted",kind:"scalar",T:8},{no:7,name:"disable_dtx",kind:"scalar",T:8},{no:8,name:"source",kind:"enum",T:Q.getEnumType(Be)},{no:9,name:"layers",kind:"message",T:ft,repeated:!0},{no:10,name:"simulcast_codecs",kind:"message",T:Vs,repeated:!0},{no:11,name:"sid",kind:"scalar",T:9},{no:12,name:"stereo",kind:"scalar",T:8},{no:13,name:"disable_red",kind:"scalar",T:8},{no:14,name:"encryption",kind:"enum",T:Q.getEnumType(qe)},{no:15,name:"stream",kind:"scalar",T:9},{no:16,name:"backup_codec_policy",kind:"enum",T:Q.getEnumType(Au)},{no:17,name:"audio_features",kind:"enum",T:Q.getEnumType(oA),repeated:!0}]),js=Q.makeMessageType("livekit.TrickleRequest",()=>[{no:1,name:"candidateInit",kind:"scalar",T:9},{no:2,name:"target",kind:"enum",T:Q.getEnumType(cA)},{no:3,name:"final",kind:"scalar",T:8}]),Ws=Q.makeMessageType("livekit.MuteTrackRequest",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"muted",kind:"scalar",T:8}]),VC=Q.makeMessageType("livekit.JoinResponse",()=>[{no:1,name:"room",kind:"message",T:ji},{no:2,name:"participant",kind:"message",T:ht},{no:3,name:"other_participants",kind:"message",T:ht,repeated:!0},{no:4,name:"server_version",kind:"scalar",T:9},{no:5,name:"ice_servers",kind:"message",T:bu,repeated:!0},{no:6,name:"subscriber_primary",kind:"scalar",T:8},{no:7,name:"alternative_url",kind:"scalar",T:9},{no:8,name:"client_configuration",kind:"message",T:du},{no:9,name:"server_region",kind:"scalar",T:9},{no:10,name:"ping_timeout",kind:"scalar",T:5},{no:11,name:"ping_interval",kind:"scalar",T:5},{no:12,name:"server_info",kind:"message",T:HC},{no:13,name:"sif_trailer",kind:"scalar",T:12},{no:14,name:"enabled_publish_codecs",kind:"message",T:Wi,repeated:!0},{no:15,name:"fast_publish",kind:"scalar",T:8}]),GC=Q.makeMessageType("livekit.ReconnectResponse",()=>[{no:1,name:"ice_servers",kind:"message",T:bu,repeated:!0},{no:2,name:"client_configuration",kind:"message",T:du}]),Js=Q.makeMessageType("livekit.TrackPublishedResponse",()=>[{no:1,name:"cid",kind:"scalar",T:9},{no:2,name:"track",kind:"message",T:Ot}]),jC=Q.makeMessageType("livekit.TrackUnpublishedResponse",()=>[{no:1,name:"track_sid",kind:"scalar",T:9}]),gt=Q.makeMessageType("livekit.SessionDescription",()=>[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"sdp",kind:"scalar",T:9}]),WC=Q.makeMessageType("livekit.ParticipantUpdate",()=>[{no:1,name:"participants",kind:"message",T:ht,repeated:!0}]),Xi=Q.makeMessageType("livekit.UpdateSubscription",()=>[{no:1,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:2,name:"subscribe",kind:"scalar",T:8},{no:3,name:"participant_tracks",kind:"message",T:cu,repeated:!0}]),Bu=Q.makeMessageType("livekit.UpdateTrackSettings",()=>[{no:1,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:3,name:"disabled",kind:"scalar",T:8},{no:4,name:"quality",kind:"enum",T:Q.getEnumType(Lt)},{no:5,name:"width",kind:"scalar",T:13},{no:6,name:"height",kind:"scalar",T:13},{no:7,name:"fps",kind:"scalar",T:13},{no:8,name:"priority",kind:"scalar",T:13}]),vu=Q.makeMessageType("livekit.UpdateLocalAudioTrack",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"features",kind:"enum",T:Q.getEnumType(oA),repeated:!0}]),JC=Q.makeMessageType("livekit.UpdateLocalVideoTrack",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"width",kind:"scalar",T:13},{no:3,name:"height",kind:"scalar",T:13}]),qi=Q.makeMessageType("livekit.LeaveRequest",()=>[{no:1,name:"can_reconnect",kind:"scalar",T:8},{no:2,name:"reason",kind:"enum",T:Q.getEnumType(aA)},{no:3,name:"action",kind:"enum",T:Q.getEnumType(Mt)},{no:4,name:"regions",kind:"message",T:rw}]),Mt=Q.makeEnum("livekit.LeaveRequest.Action",[{no:0,name:"DISCONNECT"},{no:1,name:"RESUME"},{no:2,name:"RECONNECT"}]),Cu=Q.makeMessageType("livekit.UpdateVideoLayers",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"layers",kind:"message",T:ft,repeated:!0}]),wu=Q.makeMessageType("livekit.UpdateParticipantMetadata",()=>[{no:1,name:"metadata",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:4,name:"request_id",kind:"scalar",T:13}]),bu=Q.makeMessageType("livekit.ICEServer",()=>[{no:1,name:"urls",kind:"scalar",T:9,repeated:!0},{no:2,name:"username",kind:"scalar",T:9},{no:3,name:"credential",kind:"scalar",T:9}]),XC=Q.makeMessageType("livekit.SpeakersChanged",()=>[{no:1,name:"speakers",kind:"message",T:tu,repeated:!0}]),qC=Q.makeMessageType("livekit.RoomUpdate",()=>[{no:1,name:"room",kind:"message",T:ji}]),YC=Q.makeMessageType("livekit.ConnectionQualityInfo",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"quality",kind:"enum",T:Q.getEnumType(yn)},{no:3,name:"score",kind:"scalar",T:2}]),zC=Q.makeMessageType("livekit.ConnectionQualityUpdate",()=>[{no:1,name:"updates",kind:"message",T:YC,repeated:!0}]),ZC=Q.makeMessageType("livekit.StreamStateInfo",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sid",kind:"scalar",T:9},{no:3,name:"state",kind:"enum",T:Q.getEnumType(Ks)}]),$C=Q.makeMessageType("livekit.StreamStateUpdate",()=>[{no:1,name:"stream_states",kind:"message",T:ZC,repeated:!0}]),Xs=Q.makeMessageType("livekit.SubscribedQuality",()=>[{no:1,name:"quality",kind:"enum",T:Q.getEnumType(Lt)},{no:2,name:"enabled",kind:"scalar",T:8}]),ew=Q.makeMessageType("livekit.SubscribedCodec",()=>[{no:1,name:"codec",kind:"scalar",T:9},{no:2,name:"qualities",kind:"message",T:Xs,repeated:!0}]),Aw=Q.makeMessageType("livekit.SubscribedQualityUpdate",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"subscribed_qualities",kind:"message",T:Xs,repeated:!0},{no:3,name:"subscribed_codecs",kind:"message",T:ew,repeated:!0}]),yu=Q.makeMessageType("livekit.TrackPermission",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"all_tracks",kind:"scalar",T:8},{no:3,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:4,name:"participant_identity",kind:"scalar",T:9}]),Uu=Q.makeMessageType("livekit.SubscriptionPermission",()=>[{no:1,name:"all_participants",kind:"scalar",T:8},{no:2,name:"track_permissions",kind:"message",T:yu,repeated:!0}]),tw=Q.makeMessageType("livekit.SubscriptionPermissionUpdate",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sid",kind:"scalar",T:9},{no:3,name:"allowed",kind:"scalar",T:8}]),nw=Q.makeMessageType("livekit.RoomMovedResponse",()=>[{no:1,name:"room",kind:"message",T:ji},{no:2,name:"token",kind:"scalar",T:9},{no:3,name:"participant",kind:"message",T:ht},{no:4,name:"other_participants",kind:"message",T:ht,repeated:!0}]),Qu=Q.makeMessageType("livekit.SyncState",()=>[{no:1,name:"answer",kind:"message",T:gt},{no:2,name:"subscription",kind:"message",T:Xi},{no:3,name:"publish_tracks",kind:"message",T:Js,repeated:!0},{no:4,name:"data_channels",kind:"message",T:Eu,repeated:!0},{no:5,name:"offer",kind:"message",T:gt},{no:6,name:"track_sids_disabled",kind:"scalar",T:9,repeated:!0}]),Eu=Q.makeMessageType("livekit.DataChannelInfo",()=>[{no:1,name:"label",kind:"scalar",T:9},{no:2,name:"id",kind:"scalar",T:13},{no:3,name:"target",kind:"enum",T:Q.getEnumType(cA)}]),bA=Q.makeMessageType("livekit.SimulateScenario",()=>[{no:1,name:"speaker_update",kind:"scalar",T:5,oneof:"scenario"},{no:2,name:"node_failure",kind:"scalar",T:8,oneof:"scenario"},{no:3,name:"migration",kind:"scalar",T:8,oneof:"scenario"},{no:4,name:"server_leave",kind:"scalar",T:8,oneof:"scenario"},{no:5,name:"switch_candidate_protocol",kind:"enum",T:Q.getEnumType(NC),oneof:"scenario"},{no:6,name:"subscriber_bandwidth",kind:"scalar",T:3,oneof:"scenario"},{no:7,name:"disconnect_signal_on_resume",kind:"scalar",T:8,oneof:"scenario"},{no:8,name:"disconnect_signal_on_resume_no_messages",kind:"scalar",T:8,oneof:"scenario"},{no:9,name:"leave_request_full_reconnect",kind:"scalar",T:8,oneof:"scenario"}]),Su=Q.makeMessageType("livekit.Ping",()=>[{no:1,name:"timestamp",kind:"scalar",T:3},{no:2,name:"rtt",kind:"scalar",T:3}]),iw=Q.makeMessageType("livekit.Pong",()=>[{no:1,name:"last_ping_timestamp",kind:"scalar",T:3},{no:2,name:"timestamp",kind:"scalar",T:3}]),rw=Q.makeMessageType("livekit.RegionSettings",()=>[{no:1,name:"regions",kind:"message",T:sw,repeated:!0}]),sw=Q.makeMessageType("livekit.RegionInfo",()=>[{no:1,name:"region",kind:"scalar",T:9},{no:2,name:"url",kind:"scalar",T:9},{no:3,name:"distance",kind:"scalar",T:3}]),aw=Q.makeMessageType("livekit.SubscriptionResponse",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"err",kind:"enum",T:Q.getEnumType(IC)}]),ow=Q.makeMessageType("livekit.RequestResponse",()=>[{no:1,name:"request_id",kind:"scalar",T:13},{no:2,name:"reason",kind:"enum",T:Q.getEnumType(qs)},{no:3,name:"message",kind:"scalar",T:9}]),qs=Q.makeEnum("livekit.RequestResponse.Reason",[{no:0,name:"OK"},{no:1,name:"NOT_FOUND"},{no:2,name:"NOT_ALLOWED"},{no:3,name:"LIMIT_EXCEEDED"}]),cw=Q.makeMessageType("livekit.TrackSubscribed",()=>[{no:1,name:"track_sid",kind:"scalar",T:9}]);function lw(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Yi={exports:{}},uw=Yi.exports,ku;function dw(){return ku||(ku=1,function(t){(function(e,A){t.exports?t.exports=A():e.log=A()})(uw,function(){var e=function(){},A="undefined",n=typeof window!==A&&typeof window.navigator!==A&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"],r={},s=null;function a(f,m){var B=f[m];if(typeof B.bind=="function")return B.bind(f);try{return Function.prototype.bind.call(B,f)}catch{return function(){return Function.prototype.apply.apply(B,[f,arguments])}}}function o(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function c(f){return f==="debug"&&(f="log"),typeof console===A?!1:f==="trace"&&n?o:console[f]!==void 0?a(console,f):console.log!==void 0?a(console,"log"):e}function l(){for(var f=this.getLevel(),m=0;m<i.length;m++){var B=i[m];this[B]=m<f?e:this.methodFactory(B,f,this.name)}if(this.log=this.debug,typeof console===A&&f<this.levels.SILENT)return"No console available for logging"}function u(f){return function(){typeof console!==A&&(l.call(this),this[f].apply(this,arguments))}}function d(f,m,B){return c(f)||u.apply(this,arguments)}function h(f,m){var B=this,b,U,C,w="loglevel";typeof f=="string"?w+=":"+f:typeof f=="symbol"&&(w=void 0);function y(R){var L=(i[R]||"silent").toUpperCase();if(!(typeof window===A||!w)){try{window.localStorage[w]=L;return}catch{}try{window.document.cookie=encodeURIComponent(w)+"="+L+";"}catch{}}}function E(){var R;if(!(typeof window===A||!w)){try{R=window.localStorage[w]}catch{}if(typeof R===A)try{var L=window.document.cookie,M=encodeURIComponent(w),te=L.indexOf(M+"=");te!==-1&&(R=/^([^;]+)/.exec(L.slice(te+M.length+1))[1])}catch{}return B.levels[R]===void 0&&(R=void 0),R}}function F(){if(!(typeof window===A||!w)){try{window.localStorage.removeItem(w)}catch{}try{window.document.cookie=encodeURIComponent(w)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function S(R){var L=R;if(typeof L=="string"&&B.levels[L.toUpperCase()]!==void 0&&(L=B.levels[L.toUpperCase()]),typeof L=="number"&&L>=0&&L<=B.levels.SILENT)return L;throw new TypeError("log.setLevel() called with invalid level: "+R)}B.name=f,B.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},B.methodFactory=m||d,B.getLevel=function(){return C??U??b},B.setLevel=function(R,L){return C=S(R),L!==!1&&y(C),l.call(B)},B.setDefaultLevel=function(R){U=S(R),E()||B.setLevel(R,!1)},B.resetLevel=function(){C=null,F(),l.call(B)},B.enableAll=function(R){B.setLevel(B.levels.TRACE,R)},B.disableAll=function(R){B.setLevel(B.levels.SILENT,R)},B.rebuild=function(){if(s!==B&&(b=S(s.getLevel())),l.call(B),s===B)for(var R in r)r[R].rebuild()},b=S(s?s.getLevel():"WARN");var x=E();x!=null&&(C=S(x)),l.call(B)}s=new h,s.getLogger=function(m){if(typeof m!="symbol"&&typeof m!="string"||m==="")throw new TypeError("You must supply a name when creating a logger.");var B=r[m];return B||(B=r[m]=new h(m,s.methodFactory)),B};var g=typeof window!==A?window.log:void 0;return s.noConflict=function(){return typeof window!==A&&window.log===s&&(window.log=g),s},s.getLoggers=function(){return r},s.default=s,s})}(Yi)),Yi.exports}var zi=dw(),Ys;(function(t){t[t.trace=0]="trace",t[t.debug=1]="debug",t[t.info=2]="info",t[t.warn=3]="warn",t[t.error=4]="error",t[t.silent=5]="silent"})(Ys||(Ys={}));var lA;(function(t){t.Default="livekit",t.Room="livekit-room",t.Participant="livekit-participant",t.Track="livekit-track",t.Publication="livekit-track-publication",t.Engine="livekit-engine",t.Signal="livekit-signal",t.PCManager="livekit-pc-manager",t.PCTransport="livekit-pc-transport",t.E2EE="lk-e2ee"})(lA||(lA={}));let W=zi.getLogger("livekit");Object.values(lA).map(t=>zi.getLogger(t)),W.setDefaultLevel(Ys.info);function FA(t){const e=zi.getLogger(t);return e.setDefaultLevel(W.getLevel()),e}const hw=zi.getLogger("lk-e2ee"),Qn=7e3,fw=[0,300,2*2*300,3*3*300,4*4*300,Qn,Qn,Qn,Qn,Qn];class gw{constructor(e){this._retryDelays=e!==void 0?[...e]:fw}nextRetryDelayInMs(e){if(e.retryCount>=this._retryDelays.length)return null;const A=this._retryDelays[e.retryCount];return e.retryCount<=1?A:A+Math.random()*1e3}}function pw(t,e){var A={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(A[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(A[n[i]]=t[n[i]]);return A}function v(t,e,A,n){function i(r){return r instanceof A?r:new A(function(s){s(r)})}return new(A||(A=Promise))(function(r,s){function a(l){try{c(n.next(l))}catch(u){s(u)}}function o(l){try{c(n.throw(l))}catch(u){s(u)}}function c(l){l.done?r(l.value):i(l.value).then(a,o)}c((n=n.apply(t,e||[])).next())})}function Tu(t){var e=typeof Symbol=="function"&&Symbol.iterator,A=e&&t[e],n=0;if(A)return A.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function XA(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],A;return e?e.call(t):(t=typeof Tu=="function"?Tu(t):t[Symbol.iterator](),A={},n("next"),n("throw"),n("return"),A[Symbol.asyncIterator]=function(){return this},A);function n(r){A[r]=t[r]&&function(s){return new Promise(function(a,o){s=t[r](s),i(a,o,s.done,s.value)})}}function i(r,s,a,o){Promise.resolve(o).then(function(c){r({value:c,done:a})},s)}}typeof SuppressedError=="function"&&SuppressedError;var Zi={exports:{}},Fu;function mw(){if(Fu)return Zi.exports;Fu=1;var t=typeof Reflect=="object"?Reflect:null,e=t&&typeof t.apply=="function"?t.apply:function(w,y,E){return Function.prototype.apply.call(w,y,E)},A;t&&typeof t.ownKeys=="function"?A=t.ownKeys:Object.getOwnPropertySymbols?A=function(w){return Object.getOwnPropertyNames(w).concat(Object.getOwnPropertySymbols(w))}:A=function(w){return Object.getOwnPropertyNames(w)};function n(C){console&&console.warn&&console.warn(C)}var i=Number.isNaN||function(w){return w!==w};function r(){r.init.call(this)}Zi.exports=r,Zi.exports.once=B,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._eventsCount=0,r.prototype._maxListeners=void 0;var s=10;function a(C){if(typeof C!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof C)}Object.defineProperty(r,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(C){if(typeof C!="number"||C<0||i(C))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+C+".");s=C}}),r.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},r.prototype.setMaxListeners=function(w){if(typeof w!="number"||w<0||i(w))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+w+".");return this._maxListeners=w,this};function o(C){return C._maxListeners===void 0?r.defaultMaxListeners:C._maxListeners}r.prototype.getMaxListeners=function(){return o(this)},r.prototype.emit=function(w){for(var y=[],E=1;E<arguments.length;E++)y.push(arguments[E]);var F=w==="error",S=this._events;if(S!==void 0)F=F&&S.error===void 0;else if(!F)return!1;if(F){var x;if(y.length>0&&(x=y[0]),x instanceof Error)throw x;var R=new Error("Unhandled error."+(x?" ("+x.message+")":""));throw R.context=x,R}var L=S[w];if(L===void 0)return!1;if(typeof L=="function")e(L,this,y);else for(var M=L.length,te=g(L,M),E=0;E<M;++E)e(te[E],this,y);return!0};function c(C,w,y,E){var F,S,x;if(a(y),S=C._events,S===void 0?(S=C._events=Object.create(null),C._eventsCount=0):(S.newListener!==void 0&&(C.emit("newListener",w,y.listener?y.listener:y),S=C._events),x=S[w]),x===void 0)x=S[w]=y,++C._eventsCount;else if(typeof x=="function"?x=S[w]=E?[y,x]:[x,y]:E?x.unshift(y):x.push(y),F=o(C),F>0&&x.length>F&&!x.warned){x.warned=!0;var R=new Error("Possible EventEmitter memory leak detected. "+x.length+" "+String(w)+" listeners added. Use emitter.setMaxListeners() to increase limit");R.name="MaxListenersExceededWarning",R.emitter=C,R.type=w,R.count=x.length,n(R)}return C}r.prototype.addListener=function(w,y){return c(this,w,y,!1)},r.prototype.on=r.prototype.addListener,r.prototype.prependListener=function(w,y){return c(this,w,y,!0)};function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function u(C,w,y){var E={fired:!1,wrapFn:void 0,target:C,type:w,listener:y},F=l.bind(E);return F.listener=y,E.wrapFn=F,F}r.prototype.once=function(w,y){return a(y),this.on(w,u(this,w,y)),this},r.prototype.prependOnceListener=function(w,y){return a(y),this.prependListener(w,u(this,w,y)),this},r.prototype.removeListener=function(w,y){var E,F,S,x,R;if(a(y),F=this._events,F===void 0)return this;if(E=F[w],E===void 0)return this;if(E===y||E.listener===y)--this._eventsCount===0?this._events=Object.create(null):(delete F[w],F.removeListener&&this.emit("removeListener",w,E.listener||y));else if(typeof E!="function"){for(S=-1,x=E.length-1;x>=0;x--)if(E[x]===y||E[x].listener===y){R=E[x].listener,S=x;break}if(S<0)return this;S===0?E.shift():f(E,S),E.length===1&&(F[w]=E[0]),F.removeListener!==void 0&&this.emit("removeListener",w,R||y)}return this},r.prototype.off=r.prototype.removeListener,r.prototype.removeAllListeners=function(w){var y,E,F;if(E=this._events,E===void 0)return this;if(E.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):E[w]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete E[w]),this;if(arguments.length===0){var S=Object.keys(E),x;for(F=0;F<S.length;++F)x=S[F],x!=="removeListener"&&this.removeAllListeners(x);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(y=E[w],typeof y=="function")this.removeListener(w,y);else if(y!==void 0)for(F=y.length-1;F>=0;F--)this.removeListener(w,y[F]);return this};function d(C,w,y){var E=C._events;if(E===void 0)return[];var F=E[w];return F===void 0?[]:typeof F=="function"?y?[F.listener||F]:[F]:y?m(F):g(F,F.length)}r.prototype.listeners=function(w){return d(this,w,!0)},r.prototype.rawListeners=function(w){return d(this,w,!1)},r.listenerCount=function(C,w){return typeof C.listenerCount=="function"?C.listenerCount(w):h.call(C,w)},r.prototype.listenerCount=h;function h(C){var w=this._events;if(w!==void 0){var y=w[C];if(typeof y=="function")return 1;if(y!==void 0)return y.length}return 0}r.prototype.eventNames=function(){return this._eventsCount>0?A(this._events):[]};function g(C,w){for(var y=new Array(w),E=0;E<w;++E)y[E]=C[E];return y}function f(C,w){for(;w+1<C.length;w++)C[w]=C[w+1];C.pop()}function m(C){for(var w=new Array(C.length),y=0;y<w.length;++y)w[y]=C[y].listener||C[y];return w}function B(C,w){return new Promise(function(y,E){function F(x){C.removeListener(w,S),E(x)}function S(){typeof C.removeListener=="function"&&C.removeListener("error",F),y([].slice.call(arguments))}U(C,w,S,{once:!0}),w!=="error"&&b(C,F,{once:!0})})}function b(C,w,y){typeof C.on=="function"&&U(C,"error",w,y)}function U(C,w,y,E){if(typeof C.on=="function")E.once?C.once(w,y):C.on(w,y);else if(typeof C.addEventListener=="function")C.addEventListener(w,function F(S){E.once&&C.removeEventListener(w,F),y(S)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof C)}return Zi.exports}var yA=mw();let Iu=!0,xu=!0;function $i(t,e,A){const n=t.match(e);return n&&n.length>=A&&parseInt(n[A],10)}function pt(t,e,A){if(!t.RTCPeerConnection)return;const n=t.RTCPeerConnection.prototype,i=n.addEventListener;n.addEventListener=function(s,a){if(s!==e)return i.apply(this,arguments);const o=c=>{const l=A(c);l&&(a.handleEvent?a.handleEvent(l):a(l))};return this._eventMap=this._eventMap||{},this._eventMap[e]||(this._eventMap[e]=new Map),this._eventMap[e].set(a,o),i.apply(this,[s,o])};const r=n.removeEventListener;n.removeEventListener=function(s,a){if(s!==e||!this._eventMap||!this._eventMap[e])return r.apply(this,arguments);if(!this._eventMap[e].has(a))return r.apply(this,arguments);const o=this._eventMap[e].get(a);return this._eventMap[e].delete(a),this._eventMap[e].size===0&&delete this._eventMap[e],Object.keys(this._eventMap).length===0&&delete this._eventMap,r.apply(this,[s,o])},Object.defineProperty(n,"on"+e,{get(){return this["_on"+e]},set(s){this["_on"+e]&&(this.removeEventListener(e,this["_on"+e]),delete this["_on"+e]),s&&this.addEventListener(e,this["_on"+e]=s)},enumerable:!0,configurable:!0})}function Bw(t){return typeof t!="boolean"?new Error("Argument type: "+typeof t+". Please use a boolean."):(Iu=t,t?"adapter.js logging disabled":"adapter.js logging enabled")}function vw(t){return typeof t!="boolean"?new Error("Argument type: "+typeof t+". Please use a boolean."):(xu=!t,"adapter.js deprecation warnings "+(t?"disabled":"enabled"))}function _u(){if(typeof window=="object"){if(Iu)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function zs(t,e){xu&&console.warn(t+" is deprecated, please use "+e+" instead.")}function Cw(t){const e={browser:null,version:null};if(typeof t>"u"||!t.navigator||!t.navigator.userAgent)return e.browser="Not a browser.",e;const{navigator:A}=t;if(A.userAgentData&&A.userAgentData.brands){const n=A.userAgentData.brands.find(i=>i.brand==="Chromium");if(n)return{browser:"chrome",version:parseInt(n.version,10)}}if(A.mozGetUserMedia)e.browser="firefox",e.version=$i(A.userAgent,/Firefox\/(\d+)\./,1);else if(A.webkitGetUserMedia||t.isSecureContext===!1&&t.webkitRTCPeerConnection)e.browser="chrome",e.version=$i(A.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.RTCPeerConnection&&A.userAgent.match(/AppleWebKit\/(\d+)\./))e.browser="safari",e.version=$i(A.userAgent,/AppleWebKit\/(\d+)\./,1),e.supportsUnifiedPlan=t.RTCRtpTransceiver&&"currentDirection"in t.RTCRtpTransceiver.prototype;else return e.browser="Not a supported browser.",e;return e}function Pu(t){return Object.prototype.toString.call(t)==="[object Object]"}function Ru(t){return Pu(t)?Object.keys(t).reduce(function(e,A){const n=Pu(t[A]),i=n?Ru(t[A]):t[A],r=n&&!Object.keys(i).length;return i===void 0||r?e:Object.assign(e,{[A]:i})},{}):t}function Zs(t,e,A){!e||A.has(e.id)||(A.set(e.id,e),Object.keys(e).forEach(n=>{n.endsWith("Id")?Zs(t,t.get(e[n]),A):n.endsWith("Ids")&&e[n].forEach(i=>{Zs(t,t.get(i),A)})}))}function Lu(t,e,A){const n=A?"outbound-rtp":"inbound-rtp",i=new Map;if(e===null)return i;const r=[];return t.forEach(s=>{s.type==="track"&&s.trackIdentifier===e.id&&r.push(s)}),r.forEach(s=>{t.forEach(a=>{a.type===n&&a.trackId===s.id&&Zs(t,a,i)})}),i}const Du=_u;function Hu(t,e){const A=t&&t.navigator;if(!A.mediaDevices)return;const n=function(a){if(typeof a!="object"||a.mandatory||a.optional)return a;const o={};return Object.keys(a).forEach(c=>{if(c==="require"||c==="advanced"||c==="mediaSource")return;const l=typeof a[c]=="object"?a[c]:{ideal:a[c]};l.exact!==void 0&&typeof l.exact=="number"&&(l.min=l.max=l.exact);const u=function(d,h){return d?d+h.charAt(0).toUpperCase()+h.slice(1):h==="deviceId"?"sourceId":h};if(l.ideal!==void 0){o.optional=o.optional||[];let d={};typeof l.ideal=="number"?(d[u("min",c)]=l.ideal,o.optional.push(d),d={},d[u("max",c)]=l.ideal,o.optional.push(d)):(d[u("",c)]=l.ideal,o.optional.push(d))}l.exact!==void 0&&typeof l.exact!="number"?(o.mandatory=o.mandatory||{},o.mandatory[u("",c)]=l.exact):["min","max"].forEach(d=>{l[d]!==void 0&&(o.mandatory=o.mandatory||{},o.mandatory[u(d,c)]=l[d])})}),a.advanced&&(o.optional=(o.optional||[]).concat(a.advanced)),o},i=function(a,o){if(e.version>=61)return o(a);if(a=JSON.parse(JSON.stringify(a)),a&&typeof a.audio=="object"){const c=function(l,u,d){u in l&&!(d in l)&&(l[d]=l[u],delete l[u])};a=JSON.parse(JSON.stringify(a)),c(a.audio,"autoGainControl","googAutoGainControl"),c(a.audio,"noiseSuppression","googNoiseSuppression"),a.audio=n(a.audio)}if(a&&typeof a.video=="object"){let c=a.video.facingMode;c=c&&(typeof c=="object"?c:{ideal:c});const l=e.version<66;if(c&&(c.exact==="user"||c.exact==="environment"||c.ideal==="user"||c.ideal==="environment")&&!(A.mediaDevices.getSupportedConstraints&&A.mediaDevices.getSupportedConstraints().facingMode&&!l)){delete a.video.facingMode;let u;if(c.exact==="environment"||c.ideal==="environment"?u=["back","rear"]:(c.exact==="user"||c.ideal==="user")&&(u=["front"]),u)return A.mediaDevices.enumerateDevices().then(d=>{d=d.filter(g=>g.kind==="videoinput");let h=d.find(g=>u.some(f=>g.label.toLowerCase().includes(f)));return!h&&d.length&&u.includes("back")&&(h=d[d.length-1]),h&&(a.video.deviceId=c.exact?{exact:h.deviceId}:{ideal:h.deviceId}),a.video=n(a.video),Du("chrome: "+JSON.stringify(a)),o(a)})}a.video=n(a.video)}return Du("chrome: "+JSON.stringify(a)),o(a)},r=function(a){return e.version>=64?a:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[a.name]||a.name,message:a.message,constraint:a.constraint||a.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}},s=function(a,o,c){i(a,l=>{A.webkitGetUserMedia(l,o,u=>{c&&c(r(u))})})};if(A.getUserMedia=s.bind(A),A.mediaDevices.getUserMedia){const a=A.mediaDevices.getUserMedia.bind(A.mediaDevices);A.mediaDevices.getUserMedia=function(o){return i(o,c=>a(c).then(l=>{if(c.audio&&!l.getAudioTracks().length||c.video&&!l.getVideoTracks().length)throw l.getTracks().forEach(u=>{u.stop()}),new DOMException("","NotFoundError");return l},l=>Promise.reject(r(l))))}}}function Ou(t){t.MediaStream=t.MediaStream||t.webkitMediaStream}function Mu(t){if(typeof t=="object"&&t.RTCPeerConnection&&!("ontrack"in t.RTCPeerConnection.prototype)){Object.defineProperty(t.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(A){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=A)},enumerable:!0,configurable:!0});const e=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=n=>{n.stream.addEventListener("addtrack",i=>{let r;t.RTCPeerConnection.prototype.getReceivers?r=this.getReceivers().find(a=>a.track&&a.track.id===i.track.id):r={track:i.track};const s=new Event("track");s.track=i.track,s.receiver=r,s.transceiver={receiver:r},s.streams=[n.stream],this.dispatchEvent(s)}),n.stream.getTracks().forEach(i=>{let r;t.RTCPeerConnection.prototype.getReceivers?r=this.getReceivers().find(a=>a.track&&a.track.id===i.id):r={track:i};const s=new Event("track");s.track=i,s.receiver=r,s.transceiver={receiver:r},s.streams=[n.stream],this.dispatchEvent(s)})},this.addEventListener("addstream",this._ontrackpoly)),e.apply(this,arguments)}}else pt(t,"track",e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e))}function Nu(t){if(typeof t=="object"&&t.RTCPeerConnection&&!("getSenders"in t.RTCPeerConnection.prototype)&&"createDTMFSender"in t.RTCPeerConnection.prototype){const e=function(i,r){return{track:r,get dtmf(){return this._dtmf===void 0&&(r.kind==="audio"?this._dtmf=i.createDTMFSender(r):this._dtmf=null),this._dtmf},_pc:i}};if(!t.RTCPeerConnection.prototype.getSenders){t.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const i=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addTrack=function(a,o){let c=i.apply(this,arguments);return c||(c=e(this,a),this._senders.push(c)),c};const r=t.RTCPeerConnection.prototype.removeTrack;t.RTCPeerConnection.prototype.removeTrack=function(a){r.apply(this,arguments);const o=this._senders.indexOf(a);o!==-1&&this._senders.splice(o,1)}}const A=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(r){this._senders=this._senders||[],A.apply(this,[r]),r.getTracks().forEach(s=>{this._senders.push(e(this,s))})};const n=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(r){this._senders=this._senders||[],n.apply(this,[r]),r.getTracks().forEach(s=>{const a=this._senders.find(o=>o.track===s);a&&this._senders.splice(this._senders.indexOf(a),1)})}}else if(typeof t=="object"&&t.RTCPeerConnection&&"getSenders"in t.RTCPeerConnection.prototype&&"createDTMFSender"in t.RTCPeerConnection.prototype&&t.RTCRtpSender&&!("dtmf"in t.RTCRtpSender.prototype)){const e=t.RTCPeerConnection.prototype.getSenders;t.RTCPeerConnection.prototype.getSenders=function(){const n=e.apply(this,[]);return n.forEach(i=>i._pc=this),n},Object.defineProperty(t.RTCRtpSender.prototype,"dtmf",{get(){return this._dtmf===void 0&&(this.track.kind==="audio"?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function Ku(t){if(!(typeof t=="object"&&t.RTCPeerConnection&&t.RTCRtpSender&&t.RTCRtpReceiver))return;if(!("getStats"in t.RTCRtpSender.prototype)){const A=t.RTCPeerConnection.prototype.getSenders;A&&(t.RTCPeerConnection.prototype.getSenders=function(){const r=A.apply(this,[]);return r.forEach(s=>s._pc=this),r});const n=t.RTCPeerConnection.prototype.addTrack;n&&(t.RTCPeerConnection.prototype.addTrack=function(){const r=n.apply(this,arguments);return r._pc=this,r}),t.RTCRtpSender.prototype.getStats=function(){const r=this;return this._pc.getStats().then(s=>Lu(s,r.track,!0))}}if(!("getStats"in t.RTCRtpReceiver.prototype)){const A=t.RTCPeerConnection.prototype.getReceivers;A&&(t.RTCPeerConnection.prototype.getReceivers=function(){const i=A.apply(this,[]);return i.forEach(r=>r._pc=this),i}),pt(t,"track",n=>(n.receiver._pc=n.srcElement,n)),t.RTCRtpReceiver.prototype.getStats=function(){const i=this;return this._pc.getStats().then(r=>Lu(r,i.track,!1))}}if(!("getStats"in t.RTCRtpSender.prototype&&"getStats"in t.RTCRtpReceiver.prototype))return;const e=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof t.MediaStreamTrack){const n=arguments[0];let i,r,s;return this.getSenders().forEach(a=>{a.track===n&&(i?s=!0:i=a)}),this.getReceivers().forEach(a=>(a.track===n&&(r?s=!0:r=a),a.track===n)),s||i&&r?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):i?i.getStats():r?r.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return e.apply(this,arguments)}}function Vu(t){t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(s=>this._shimmedLocalStreams[s][0])};const e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addTrack=function(s,a){if(!a)return e.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const o=e.apply(this,arguments);return this._shimmedLocalStreams[a.id]?this._shimmedLocalStreams[a.id].indexOf(o)===-1&&this._shimmedLocalStreams[a.id].push(o):this._shimmedLocalStreams[a.id]=[a,o],o};const A=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(s){this._shimmedLocalStreams=this._shimmedLocalStreams||{},s.getTracks().forEach(c=>{if(this.getSenders().find(u=>u.track===c))throw new DOMException("Track already exists.","InvalidAccessError")});const a=this.getSenders();A.apply(this,arguments);const o=this.getSenders().filter(c=>a.indexOf(c)===-1);this._shimmedLocalStreams[s.id]=[s].concat(o)};const n=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(s){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[s.id],n.apply(this,arguments)};const i=t.RTCPeerConnection.prototype.removeTrack;t.RTCPeerConnection.prototype.removeTrack=function(s){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},s&&Object.keys(this._shimmedLocalStreams).forEach(a=>{const o=this._shimmedLocalStreams[a].indexOf(s);o!==-1&&this._shimmedLocalStreams[a].splice(o,1),this._shimmedLocalStreams[a].length===1&&delete this._shimmedLocalStreams[a]}),i.apply(this,arguments)}}function Gu(t,e){if(!t.RTCPeerConnection)return;if(t.RTCPeerConnection.prototype.addTrack&&e.version>=65)return Vu(t);const A=t.RTCPeerConnection.prototype.getLocalStreams;t.RTCPeerConnection.prototype.getLocalStreams=function(){const l=A.apply(this);return this._reverseStreams=this._reverseStreams||{},l.map(u=>this._reverseStreams[u.id])};const n=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(l){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},l.getTracks().forEach(u=>{if(this.getSenders().find(h=>h.track===u))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[l.id]){const u=new t.MediaStream(l.getTracks());this._streams[l.id]=u,this._reverseStreams[u.id]=l,l=u}n.apply(this,[l])};const i=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(l){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[l.id]||l]),delete this._reverseStreams[this._streams[l.id]?this._streams[l.id].id:l.id],delete this._streams[l.id]},t.RTCPeerConnection.prototype.addTrack=function(l,u){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const d=[].slice.call(arguments,1);if(d.length!==1||!d[0].getTracks().find(f=>f===l))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find(f=>f.track===l))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const g=this._streams[u.id];if(g)g.addTrack(l),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const f=new t.MediaStream([l]);this._streams[u.id]=f,this._reverseStreams[f.id]=u,this.addStream(f)}return this.getSenders().find(f=>f.track===l)};function r(c,l){let u=l.sdp;return Object.keys(c._reverseStreams||[]).forEach(d=>{const h=c._reverseStreams[d],g=c._streams[h.id];u=u.replace(new RegExp(g.id,"g"),h.id)}),new RTCSessionDescription({type:l.type,sdp:u})}function s(c,l){let u=l.sdp;return Object.keys(c._reverseStreams||[]).forEach(d=>{const h=c._reverseStreams[d],g=c._streams[h.id];u=u.replace(new RegExp(h.id,"g"),g.id)}),new RTCSessionDescription({type:l.type,sdp:u})}["createOffer","createAnswer"].forEach(function(c){const l=t.RTCPeerConnection.prototype[c],u={[c](){const d=arguments;return arguments.length&&typeof arguments[0]=="function"?l.apply(this,[g=>{const f=r(this,g);d[0].apply(null,[f])},g=>{d[1]&&d[1].apply(null,g)},arguments[2]]):l.apply(this,arguments).then(g=>r(this,g))}};t.RTCPeerConnection.prototype[c]=u[c]});const a=t.RTCPeerConnection.prototype.setLocalDescription;t.RTCPeerConnection.prototype.setLocalDescription=function(){return!arguments.length||!arguments[0].type?a.apply(this,arguments):(arguments[0]=s(this,arguments[0]),a.apply(this,arguments))};const o=Object.getOwnPropertyDescriptor(t.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(t.RTCPeerConnection.prototype,"localDescription",{get(){const c=o.get.apply(this);return c.type===""?c:r(this,c)}}),t.RTCPeerConnection.prototype.removeTrack=function(l){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!l._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(l._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};let d;Object.keys(this._streams).forEach(h=>{this._streams[h].getTracks().find(f=>l.track===f)&&(d=this._streams[h])}),d&&(d.getTracks().length===1?this.removeStream(this._reverseStreams[d.id]):d.removeTrack(l.track),this.dispatchEvent(new Event("negotiationneeded")))}}function $s(t,e){!t.RTCPeerConnection&&t.webkitRTCPeerConnection&&(t.RTCPeerConnection=t.webkitRTCPeerConnection),t.RTCPeerConnection&&e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(A){const n=t.RTCPeerConnection.prototype[A],i={[A](){return arguments[0]=new(A==="addIceCandidate"?t.RTCIceCandidate:t.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};t.RTCPeerConnection.prototype[A]=i[A]})}function ju(t,e){pt(t,"negotiationneeded",A=>{const n=A.target;if(!((e.version<72||n.getConfiguration&&n.getConfiguration().sdpSemantics==="plan-b")&&n.signalingState!=="stable"))return A})}var Wu=Object.freeze({__proto__:null,fixNegotiationNeeded:ju,shimAddTrackRemoveTrack:Gu,shimAddTrackRemoveTrackWithNative:Vu,shimGetSendersWithDtmf:Nu,shimGetUserMedia:Hu,shimMediaStream:Ou,shimOnTrack:Mu,shimPeerConnection:$s,shimSenderReceiverGetStats:Ku});function Ju(t,e){const A=t&&t.navigator,n=t&&t.MediaStreamTrack;if(A.getUserMedia=function(i,r,s){zs("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),A.mediaDevices.getUserMedia(i).then(r,s)},!(e.version>55&&"autoGainControl"in A.mediaDevices.getSupportedConstraints())){const i=function(s,a,o){a in s&&!(o in s)&&(s[o]=s[a],delete s[a])},r=A.mediaDevices.getUserMedia.bind(A.mediaDevices);if(A.mediaDevices.getUserMedia=function(s){return typeof s=="object"&&typeof s.audio=="object"&&(s=JSON.parse(JSON.stringify(s)),i(s.audio,"autoGainControl","mozAutoGainControl"),i(s.audio,"noiseSuppression","mozNoiseSuppression")),r(s)},n&&n.prototype.getSettings){const s=n.prototype.getSettings;n.prototype.getSettings=function(){const a=s.apply(this,arguments);return i(a,"mozAutoGainControl","autoGainControl"),i(a,"mozNoiseSuppression","noiseSuppression"),a}}if(n&&n.prototype.applyConstraints){const s=n.prototype.applyConstraints;n.prototype.applyConstraints=function(a){return this.kind==="audio"&&typeof a=="object"&&(a=JSON.parse(JSON.stringify(a)),i(a,"autoGainControl","mozAutoGainControl"),i(a,"noiseSuppression","mozNoiseSuppression")),s.apply(this,[a])}}}}function ww(t,e){t.navigator.mediaDevices&&"getDisplayMedia"in t.navigator.mediaDevices||t.navigator.mediaDevices&&(t.navigator.mediaDevices.getDisplayMedia=function(n){if(!(n&&n.video)){const i=new DOMException("getDisplayMedia without video constraints is undefined");return i.name="NotFoundError",i.code=8,Promise.reject(i)}return n.video===!0?n.video={mediaSource:e}:n.video.mediaSource=e,t.navigator.mediaDevices.getUserMedia(n)})}function Xu(t){typeof t=="object"&&t.RTCTrackEvent&&"receiver"in t.RTCTrackEvent.prototype&&!("transceiver"in t.RTCTrackEvent.prototype)&&Object.defineProperty(t.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function ea(t,e){if(typeof t!="object"||!(t.RTCPeerConnection||t.mozRTCPeerConnection))return;!t.RTCPeerConnection&&t.mozRTCPeerConnection&&(t.RTCPeerConnection=t.mozRTCPeerConnection),e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(i){const r=t.RTCPeerConnection.prototype[i],s={[i](){return arguments[0]=new(i==="addIceCandidate"?t.RTCIceCandidate:t.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};t.RTCPeerConnection.prototype[i]=s[i]});const A={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},n=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){const[r,s,a]=arguments;return n.apply(this,[r||null]).then(o=>{if(e.version<53&&!s)try{o.forEach(c=>{c.type=A[c.type]||c.type})}catch(c){if(c.name!=="TypeError")throw c;o.forEach((l,u)=>{o.set(u,Object.assign({},l,{type:A[l.type]||l.type}))})}return o}).then(s,a)}}function qu(t){if(!(typeof t=="object"&&t.RTCPeerConnection&&t.RTCRtpSender)||t.RTCRtpSender&&"getStats"in t.RTCRtpSender.prototype)return;const e=t.RTCPeerConnection.prototype.getSenders;e&&(t.RTCPeerConnection.prototype.getSenders=function(){const i=e.apply(this,[]);return i.forEach(r=>r._pc=this),i});const A=t.RTCPeerConnection.prototype.addTrack;A&&(t.RTCPeerConnection.prototype.addTrack=function(){const i=A.apply(this,arguments);return i._pc=this,i}),t.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function Yu(t){if(!(typeof t=="object"&&t.RTCPeerConnection&&t.RTCRtpSender)||t.RTCRtpSender&&"getStats"in t.RTCRtpReceiver.prototype)return;const e=t.RTCPeerConnection.prototype.getReceivers;e&&(t.RTCPeerConnection.prototype.getReceivers=function(){const n=e.apply(this,[]);return n.forEach(i=>i._pc=this),n}),pt(t,"track",A=>(A.receiver._pc=A.srcElement,A)),t.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function zu(t){!t.RTCPeerConnection||"removeStream"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.removeStream=function(A){zs("removeStream","removeTrack"),this.getSenders().forEach(n=>{n.track&&A.getTracks().includes(n.track)&&this.removeTrack(n)})})}function Zu(t){t.DataChannel&&!t.RTCDataChannel&&(t.RTCDataChannel=t.DataChannel)}function $u(t){if(!(typeof t=="object"&&t.RTCPeerConnection))return;const e=t.RTCPeerConnection.prototype.addTransceiver;e&&(t.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let n=arguments[1]&&arguments[1].sendEncodings;n===void 0&&(n=[]),n=[...n];const i=n.length>0;i&&n.forEach(s=>{if("rid"in s&&!/^[a-z0-9]{0,16}$/i.test(s.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in s&&!(parseFloat(s.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in s&&!(parseFloat(s.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")});const r=e.apply(this,arguments);if(i){const{sender:s}=r,a=s.getParameters();(!("encodings"in a)||a.encodings.length===1&&Object.keys(a.encodings[0]).length===0)&&(a.encodings=n,s.sendEncodings=n,this.setParametersPromises.push(s.setParameters(a).then(()=>{delete s.sendEncodings}).catch(()=>{delete s.sendEncodings})))}return r})}function ed(t){if(!(typeof t=="object"&&t.RTCRtpSender))return;const e=t.RTCRtpSender.prototype.getParameters;e&&(t.RTCRtpSender.prototype.getParameters=function(){const n=e.apply(this,arguments);return"encodings"in n||(n.encodings=[].concat(this.sendEncodings||[{}])),n})}function Ad(t){if(!(typeof t=="object"&&t.RTCPeerConnection))return;const e=t.RTCPeerConnection.prototype.createOffer;t.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>e.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):e.apply(this,arguments)}}function td(t){if(!(typeof t=="object"&&t.RTCPeerConnection))return;const e=t.RTCPeerConnection.prototype.createAnswer;t.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>e.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):e.apply(this,arguments)}}var nd=Object.freeze({__proto__:null,shimAddTransceiver:$u,shimCreateAnswer:td,shimCreateOffer:Ad,shimGetDisplayMedia:ww,shimGetParameters:ed,shimGetUserMedia:Ju,shimOnTrack:Xu,shimPeerConnection:ea,shimRTCDataChannel:Zu,shimReceiverGetStats:Yu,shimRemoveStream:zu,shimSenderGetStats:qu});function id(t){if(!(typeof t!="object"||!t.RTCPeerConnection)){if("getLocalStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in t.RTCPeerConnection.prototype)){const e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addStream=function(n){this._localStreams||(this._localStreams=[]),this._localStreams.includes(n)||this._localStreams.push(n),n.getAudioTracks().forEach(i=>e.call(this,i,n)),n.getVideoTracks().forEach(i=>e.call(this,i,n))},t.RTCPeerConnection.prototype.addTrack=function(n){for(var i=arguments.length,r=new Array(i>1?i-1:0),s=1;s<i;s++)r[s-1]=arguments[s];return r&&r.forEach(a=>{this._localStreams?this._localStreams.includes(a)||this._localStreams.push(a):this._localStreams=[a]}),e.apply(this,arguments)}}"removeStream"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.removeStream=function(A){this._localStreams||(this._localStreams=[]);const n=this._localStreams.indexOf(A);if(n===-1)return;this._localStreams.splice(n,1);const i=A.getTracks();this.getSenders().forEach(r=>{i.includes(r.track)&&this.removeTrack(r)})})}}function rd(t){if(!(typeof t!="object"||!t.RTCPeerConnection)&&("getRemoteStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in t.RTCPeerConnection.prototype))){Object.defineProperty(t.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(A){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=A),this.addEventListener("track",this._onaddstreampoly=n=>{n.streams.forEach(i=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(i))return;this._remoteStreams.push(i);const r=new Event("addstream");r.stream=i,this.dispatchEvent(r)})})}});const e=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){const n=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(i){i.streams.forEach(r=>{if(n._remoteStreams||(n._remoteStreams=[]),n._remoteStreams.indexOf(r)>=0)return;n._remoteStreams.push(r);const s=new Event("addstream");s.stream=r,n.dispatchEvent(s)})}),e.apply(n,arguments)}}}function sd(t){if(typeof t!="object"||!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype,A=e.createOffer,n=e.createAnswer,i=e.setLocalDescription,r=e.setRemoteDescription,s=e.addIceCandidate;e.createOffer=function(c,l){const u=arguments.length>=2?arguments[2]:arguments[0],d=A.apply(this,[u]);return l?(d.then(c,l),Promise.resolve()):d},e.createAnswer=function(c,l){const u=arguments.length>=2?arguments[2]:arguments[0],d=n.apply(this,[u]);return l?(d.then(c,l),Promise.resolve()):d};let a=function(o,c,l){const u=i.apply(this,[o]);return l?(u.then(c,l),Promise.resolve()):u};e.setLocalDescription=a,a=function(o,c,l){const u=r.apply(this,[o]);return l?(u.then(c,l),Promise.resolve()):u},e.setRemoteDescription=a,a=function(o,c,l){const u=s.apply(this,[o]);return l?(u.then(c,l),Promise.resolve()):u},e.addIceCandidate=a}function ad(t){const e=t&&t.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){const A=e.mediaDevices,n=A.getUserMedia.bind(A);e.mediaDevices.getUserMedia=i=>n(od(i))}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=(function(n,i,r){e.mediaDevices.getUserMedia(n).then(i,r)}).bind(e))}function od(t){return t&&t.video!==void 0?Object.assign({},t,{video:Ru(t.video)}):t}function cd(t){if(!t.RTCPeerConnection)return;const e=t.RTCPeerConnection;t.RTCPeerConnection=function(n,i){if(n&&n.iceServers){const r=[];for(let s=0;s<n.iceServers.length;s++){let a=n.iceServers[s];a.urls===void 0&&a.url?(zs("RTCIceServer.url","RTCIceServer.urls"),a=JSON.parse(JSON.stringify(a)),a.urls=a.url,delete a.url,r.push(a)):r.push(n.iceServers[s])}n.iceServers=r}return new e(n,i)},t.RTCPeerConnection.prototype=e.prototype,"generateCertificate"in e&&Object.defineProperty(t.RTCPeerConnection,"generateCertificate",{get(){return e.generateCertificate}})}function ld(t){typeof t=="object"&&t.RTCTrackEvent&&"receiver"in t.RTCTrackEvent.prototype&&!("transceiver"in t.RTCTrackEvent.prototype)&&Object.defineProperty(t.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function ud(t){const e=t.RTCPeerConnection.prototype.createOffer;t.RTCPeerConnection.prototype.createOffer=function(n){if(n){typeof n.offerToReceiveAudio<"u"&&(n.offerToReceiveAudio=!!n.offerToReceiveAudio);const i=this.getTransceivers().find(s=>s.receiver.track.kind==="audio");n.offerToReceiveAudio===!1&&i?i.direction==="sendrecv"?i.setDirection?i.setDirection("sendonly"):i.direction="sendonly":i.direction==="recvonly"&&(i.setDirection?i.setDirection("inactive"):i.direction="inactive"):n.offerToReceiveAudio===!0&&!i&&this.addTransceiver("audio",{direction:"recvonly"}),typeof n.offerToReceiveVideo<"u"&&(n.offerToReceiveVideo=!!n.offerToReceiveVideo);const r=this.getTransceivers().find(s=>s.receiver.track.kind==="video");n.offerToReceiveVideo===!1&&r?r.direction==="sendrecv"?r.setDirection?r.setDirection("sendonly"):r.direction="sendonly":r.direction==="recvonly"&&(r.setDirection?r.setDirection("inactive"):r.direction="inactive"):n.offerToReceiveVideo===!0&&!r&&this.addTransceiver("video",{direction:"recvonly"})}return e.apply(this,arguments)}}function dd(t){typeof t!="object"||t.AudioContext||(t.AudioContext=t.webkitAudioContext)}var hd=Object.freeze({__proto__:null,shimAudioContext:dd,shimCallbacksAPI:sd,shimConstraints:od,shimCreateOfferLegacy:ud,shimGetUserMedia:ad,shimLocalStreamsAPI:id,shimRTCIceServerUrls:cd,shimRemoteStreamsAPI:rd,shimTrackEventTransceiver:ld}),Aa={exports:{}},fd;function bw(){return fd||(fd=1,function(t){const e={};e.generateIdentifier=function(){return Math.random().toString(36).substring(2,12)},e.localCName=e.generateIdentifier(),e.splitLines=function(A){return A.trim().split(`
11
- `).map(n=>n.trim())},e.splitSections=function(A){return A.split(`
12
- m=`).map((i,r)=>(r>0?"m="+i:i).trim()+`\r
13
- `)},e.getDescription=function(A){const n=e.splitSections(A);return n&&n[0]},e.getMediaSections=function(A){const n=e.splitSections(A);return n.shift(),n},e.matchPrefix=function(A,n){return e.splitLines(A).filter(i=>i.indexOf(n)===0)},e.parseCandidate=function(A){let n;A.indexOf("a=candidate:")===0?n=A.substring(12).split(" "):n=A.substring(10).split(" ");const i={foundation:n[0],component:{1:"rtp",2:"rtcp"}[n[1]]||n[1],protocol:n[2].toLowerCase(),priority:parseInt(n[3],10),ip:n[4],address:n[4],port:parseInt(n[5],10),type:n[7]};for(let r=8;r<n.length;r+=2)switch(n[r]){case"raddr":i.relatedAddress=n[r+1];break;case"rport":i.relatedPort=parseInt(n[r+1],10);break;case"tcptype":i.tcpType=n[r+1];break;case"ufrag":i.ufrag=n[r+1],i.usernameFragment=n[r+1];break;default:i[n[r]]===void 0&&(i[n[r]]=n[r+1]);break}return i},e.writeCandidate=function(A){const n=[];n.push(A.foundation);const i=A.component;i==="rtp"?n.push(1):i==="rtcp"?n.push(2):n.push(i),n.push(A.protocol.toUpperCase()),n.push(A.priority),n.push(A.address||A.ip),n.push(A.port);const r=A.type;return n.push("typ"),n.push(r),r!=="host"&&A.relatedAddress&&A.relatedPort&&(n.push("raddr"),n.push(A.relatedAddress),n.push("rport"),n.push(A.relatedPort)),A.tcpType&&A.protocol.toLowerCase()==="tcp"&&(n.push("tcptype"),n.push(A.tcpType)),(A.usernameFragment||A.ufrag)&&(n.push("ufrag"),n.push(A.usernameFragment||A.ufrag)),"candidate:"+n.join(" ")},e.parseIceOptions=function(A){return A.substring(14).split(" ")},e.parseRtpMap=function(A){let n=A.substring(9).split(" ");const i={payloadType:parseInt(n.shift(),10)};return n=n[0].split("/"),i.name=n[0],i.clockRate=parseInt(n[1],10),i.channels=n.length===3?parseInt(n[2],10):1,i.numChannels=i.channels,i},e.writeRtpMap=function(A){let n=A.payloadType;A.preferredPayloadType!==void 0&&(n=A.preferredPayloadType);const i=A.channels||A.numChannels||1;return"a=rtpmap:"+n+" "+A.name+"/"+A.clockRate+(i!==1?"/"+i:"")+`\r
14
- `},e.parseExtmap=function(A){const n=A.substring(9).split(" ");return{id:parseInt(n[0],10),direction:n[0].indexOf("/")>0?n[0].split("/")[1]:"sendrecv",uri:n[1],attributes:n.slice(2).join(" ")}},e.writeExtmap=function(A){return"a=extmap:"+(A.id||A.preferredId)+(A.direction&&A.direction!=="sendrecv"?"/"+A.direction:"")+" "+A.uri+(A.attributes?" "+A.attributes:"")+`\r
15
- `},e.parseFmtp=function(A){const n={};let i;const r=A.substring(A.indexOf(" ")+1).split(";");for(let s=0;s<r.length;s++)i=r[s].trim().split("="),n[i[0].trim()]=i[1];return n},e.writeFmtp=function(A){let n="",i=A.payloadType;if(A.preferredPayloadType!==void 0&&(i=A.preferredPayloadType),A.parameters&&Object.keys(A.parameters).length){const r=[];Object.keys(A.parameters).forEach(s=>{A.parameters[s]!==void 0?r.push(s+"="+A.parameters[s]):r.push(s)}),n+="a=fmtp:"+i+" "+r.join(";")+`\r
16
- `}return n},e.parseRtcpFb=function(A){const n=A.substring(A.indexOf(" ")+1).split(" ");return{type:n.shift(),parameter:n.join(" ")}},e.writeRtcpFb=function(A){let n="",i=A.payloadType;return A.preferredPayloadType!==void 0&&(i=A.preferredPayloadType),A.rtcpFeedback&&A.rtcpFeedback.length&&A.rtcpFeedback.forEach(r=>{n+="a=rtcp-fb:"+i+" "+r.type+(r.parameter&&r.parameter.length?" "+r.parameter:"")+`\r
17
- `}),n},e.parseSsrcMedia=function(A){const n=A.indexOf(" "),i={ssrc:parseInt(A.substring(7,n),10)},r=A.indexOf(":",n);return r>-1?(i.attribute=A.substring(n+1,r),i.value=A.substring(r+1)):i.attribute=A.substring(n+1),i},e.parseSsrcGroup=function(A){const n=A.substring(13).split(" ");return{semantics:n.shift(),ssrcs:n.map(i=>parseInt(i,10))}},e.getMid=function(A){const n=e.matchPrefix(A,"a=mid:")[0];if(n)return n.substring(6)},e.parseFingerprint=function(A){const n=A.substring(14).split(" ");return{algorithm:n[0].toLowerCase(),value:n[1].toUpperCase()}},e.getDtlsParameters=function(A,n){return{role:"auto",fingerprints:e.matchPrefix(A+n,"a=fingerprint:").map(e.parseFingerprint)}},e.writeDtlsParameters=function(A,n){let i="a=setup:"+n+`\r
18
- `;return A.fingerprints.forEach(r=>{i+="a=fingerprint:"+r.algorithm+" "+r.value+`\r
19
- `}),i},e.parseCryptoLine=function(A){const n=A.substring(9).split(" ");return{tag:parseInt(n[0],10),cryptoSuite:n[1],keyParams:n[2],sessionParams:n.slice(3)}},e.writeCryptoLine=function(A){return"a=crypto:"+A.tag+" "+A.cryptoSuite+" "+(typeof A.keyParams=="object"?e.writeCryptoKeyParams(A.keyParams):A.keyParams)+(A.sessionParams?" "+A.sessionParams.join(" "):"")+`\r
20
- `},e.parseCryptoKeyParams=function(A){if(A.indexOf("inline:")!==0)return null;const n=A.substring(7).split("|");return{keyMethod:"inline",keySalt:n[0],lifeTime:n[1],mkiValue:n[2]?n[2].split(":")[0]:void 0,mkiLength:n[2]?n[2].split(":")[1]:void 0}},e.writeCryptoKeyParams=function(A){return A.keyMethod+":"+A.keySalt+(A.lifeTime?"|"+A.lifeTime:"")+(A.mkiValue&&A.mkiLength?"|"+A.mkiValue+":"+A.mkiLength:"")},e.getCryptoParameters=function(A,n){return e.matchPrefix(A+n,"a=crypto:").map(e.parseCryptoLine)},e.getIceParameters=function(A,n){const i=e.matchPrefix(A+n,"a=ice-ufrag:")[0],r=e.matchPrefix(A+n,"a=ice-pwd:")[0];return i&&r?{usernameFragment:i.substring(12),password:r.substring(10)}:null},e.writeIceParameters=function(A){let n="a=ice-ufrag:"+A.usernameFragment+`\r
21
- a=ice-pwd:`+A.password+`\r
22
- `;return A.iceLite&&(n+=`a=ice-lite\r
23
- `),n},e.parseRtpParameters=function(A){const n={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},r=e.splitLines(A)[0].split(" ");n.profile=r[2];for(let a=3;a<r.length;a++){const o=r[a],c=e.matchPrefix(A,"a=rtpmap:"+o+" ")[0];if(c){const l=e.parseRtpMap(c),u=e.matchPrefix(A,"a=fmtp:"+o+" ");switch(l.parameters=u.length?e.parseFmtp(u[0]):{},l.rtcpFeedback=e.matchPrefix(A,"a=rtcp-fb:"+o+" ").map(e.parseRtcpFb),n.codecs.push(l),l.name.toUpperCase()){case"RED":case"ULPFEC":n.fecMechanisms.push(l.name.toUpperCase());break}}}e.matchPrefix(A,"a=extmap:").forEach(a=>{n.headerExtensions.push(e.parseExtmap(a))});const s=e.matchPrefix(A,"a=rtcp-fb:* ").map(e.parseRtcpFb);return n.codecs.forEach(a=>{s.forEach(o=>{a.rtcpFeedback.find(l=>l.type===o.type&&l.parameter===o.parameter)||a.rtcpFeedback.push(o)})}),n},e.writeRtpDescription=function(A,n){let i="";i+="m="+A+" ",i+=n.codecs.length>0?"9":"0",i+=" "+(n.profile||"UDP/TLS/RTP/SAVPF")+" ",i+=n.codecs.map(s=>s.preferredPayloadType!==void 0?s.preferredPayloadType:s.payloadType).join(" ")+`\r
8
+ }`,S1=function(n){k1(n,".".concat(Ou).concat(C1).concat(Pg,`
9
+ .`).concat(Mu).concat(_1).concat(Pg))},k1=function(n,e){var t=n.ownerDocument;if(t){var r=t.createElement("style");r.textContent=e,n.appendChild(r)}},E1=function(n,e){var t,r=e.createElement("base");r.href=e.baseURI;var i=n.getElementsByTagName("head").item(0);i==null||i.insertBefore(r,(t=i==null?void 0:i.firstChild)!==null&&t!==void 0?t:null)},Lu=function(){function n(){}return n.getOrigin=function(e){var t=n._link;return t?(t.href=e,t.href=t.href,t.protocol+t.hostname+t.port):"about:blank"},n.isSameOrigin=function(e){return n.getOrigin(e)===n._origin},n.setContext=function(e){n._link=e.document.createElement("a"),n._origin=n.getOrigin(e.location.href)},n._origin="about:blank",n}(),U1=function(){function n(e,t){this.context=e,this._options=t,this._cache={}}return n.prototype.addImage=function(e){var t=Promise.resolve();return this.has(e)||(Hu(e)||x1(e))&&(this._cache[e]=this.loadImage(e)).catch(function(){}),t},n.prototype.match=function(e){return this._cache[e]},n.prototype.loadImage=function(e){return Ut(this,void 0,void 0,function(){var t,r,i,A,s,o=this;return Bt(this,function(a){switch(a.label){case 0:return typeof this._options.customIsSameOrigin!="function"?[3,2]:[4,this._options.customIsSameOrigin(e,Lu.isSameOrigin)];case 1:return r=a.sent(),[3,3];case 2:r=Lu.isSameOrigin(e),a.label=3;case 3:return t=r,i=!Du(e)&&this._options.useCORS===!0&&vt.SUPPORT_CORS_IMAGES&&!t,A=!Du(e)&&!t&&!Hu(e)&&typeof this._options.proxy=="string"&&vt.SUPPORT_CORS_XHR&&!i,!t&&this._options.allowTaint===!1&&!Du(e)&&!Hu(e)&&!A&&!i?[2]:(s=e,A?[4,this.proxy(s)]:[3,5]);case 4:s=a.sent(),a.label=5;case 5:return this.context.logger.debug("Added image ".concat(e.substring(0,256))),[4,new Promise(function(c,u){var l=new Image;l.onload=function(){return c(l)},l.onerror=u,(Q1(s)||i)&&(l.crossOrigin="anonymous"),l.src=s,l.complete===!0&&setTimeout(function(){return c(l)},500),o._options.imageTimeout>0&&setTimeout(function(){return u("Timed out (".concat(o._options.imageTimeout,"ms) loading image"))},o._options.imageTimeout)})];case 6:return[2,a.sent()]}})})},n.prototype.has=function(e){return typeof this._cache[e]<"u"},n.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},n.prototype.proxy=function(e){var t=this,r=this._options.proxy;if(!r)throw new Error("No proxy defined");var i=e.substring(0,256);return new Promise(function(A,s){var o=vt.SUPPORT_RESPONSE_TYPE?"blob":"text",a=new XMLHttpRequest;a.onload=function(){if(a.status===200)if(o==="text")A(a.response);else{var l=new FileReader;l.addEventListener("load",function(){return A(l.result)},!1),l.addEventListener("error",function(d){return s(d)},!1),l.readAsDataURL(a.response)}else s("Failed to proxy resource ".concat(i," with status code ").concat(a.status))},a.onerror=s;var c=r.indexOf("?")>-1?"&":"?";if(a.open("GET","".concat(r).concat(c,"url=").concat(encodeURIComponent(e),"&responseType=").concat(o)),o!=="text"&&a instanceof XMLHttpRequest&&(a.responseType=o),t._options.imageTimeout){var u=t._options.imageTimeout;a.timeout=u,a.ontimeout=function(){return s("Timed out (".concat(u,"ms) proxying ").concat(i))}}a.send()})},n}(),T1=/^data:image\/svg\+xml/i,I1=/^data:image\/.*;base64,/i,F1=/^data:image\/.*/i,x1=function(n){return vt.SUPPORT_SVG_DRAWING||!R1(n)},Du=function(n){return F1.test(n)},Q1=function(n){return I1.test(n)},Hu=function(n){return n.substr(0,4)==="blob"},R1=function(n){return n.substr(-3).toLowerCase()==="svg"||T1.test(n)},G=function(){function n(e,t){this.type=0,this.x=e,this.y=t}return n.prototype.add=function(e,t){return new n(this.x+e,this.y+t)},n}(),yi=function(n,e,t){return new G(n.x+(e.x-n.x)*t,n.y+(e.y-n.y)*t)},Bo=function(){function n(e,t,r,i){this.type=1,this.start=e,this.startControl=t,this.endControl=r,this.end=i}return n.prototype.subdivide=function(e,t){var r=yi(this.start,this.startControl,e),i=yi(this.startControl,this.endControl,e),A=yi(this.endControl,this.end,e),s=yi(r,i,e),o=yi(i,A,e),a=yi(s,o,e);return t?new n(this.start,r,s,a):new n(a,o,A,this.end)},n.prototype.add=function(e,t){return new n(this.start.add(e,t),this.startControl.add(e,t),this.endControl.add(e,t),this.end.add(e,t))},n.prototype.reverse=function(){return new n(this.end,this.endControl,this.startControl,this.start)},n}(),Jt=function(n){return n.type===1},P1=function(){function n(e){var t=e.styles,r=e.bounds,i=CA(t.borderTopLeftRadius,r.width,r.height),A=i[0],s=i[1],o=CA(t.borderTopRightRadius,r.width,r.height),a=o[0],c=o[1],u=CA(t.borderBottomRightRadius,r.width,r.height),l=u[0],d=u[1],h=CA(t.borderBottomLeftRadius,r.width,r.height),f=h[0],p=h[1],g=[];g.push((A+a)/r.width),g.push((f+l)/r.width),g.push((s+p)/r.height),g.push((c+d)/r.height);var v=Math.max.apply(Math,g);v>1&&(A/=v,s/=v,a/=v,c/=v,l/=v,d/=v,f/=v,p/=v);var y=r.width-a,b=r.height-d,B=r.width-l,w=r.height-p,_=t.borderTopWidth,k=t.borderRightWidth,T=t.borderBottomWidth,I=t.borderLeftWidth,x=Se(t.paddingTop,e.bounds.width),F=Se(t.paddingRight,e.bounds.width),Q=Se(t.paddingBottom,e.bounds.width),D=Se(t.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=A>0||s>0?He(r.left+I/3,r.top+_/3,A-I/3,s-_/3,Be.TOP_LEFT):new G(r.left+I/3,r.top+_/3),this.topRightBorderDoubleOuterBox=A>0||s>0?He(r.left+y,r.top+_/3,a-k/3,c-_/3,Be.TOP_RIGHT):new G(r.left+r.width-k/3,r.top+_/3),this.bottomRightBorderDoubleOuterBox=l>0||d>0?He(r.left+B,r.top+b,l-k/3,d-T/3,Be.BOTTOM_RIGHT):new G(r.left+r.width-k/3,r.top+r.height-T/3),this.bottomLeftBorderDoubleOuterBox=f>0||p>0?He(r.left+I/3,r.top+w,f-I/3,p-T/3,Be.BOTTOM_LEFT):new G(r.left+I/3,r.top+r.height-T/3),this.topLeftBorderDoubleInnerBox=A>0||s>0?He(r.left+I*2/3,r.top+_*2/3,A-I*2/3,s-_*2/3,Be.TOP_LEFT):new G(r.left+I*2/3,r.top+_*2/3),this.topRightBorderDoubleInnerBox=A>0||s>0?He(r.left+y,r.top+_*2/3,a-k*2/3,c-_*2/3,Be.TOP_RIGHT):new G(r.left+r.width-k*2/3,r.top+_*2/3),this.bottomRightBorderDoubleInnerBox=l>0||d>0?He(r.left+B,r.top+b,l-k*2/3,d-T*2/3,Be.BOTTOM_RIGHT):new G(r.left+r.width-k*2/3,r.top+r.height-T*2/3),this.bottomLeftBorderDoubleInnerBox=f>0||p>0?He(r.left+I*2/3,r.top+w,f-I*2/3,p-T*2/3,Be.BOTTOM_LEFT):new G(r.left+I*2/3,r.top+r.height-T*2/3),this.topLeftBorderStroke=A>0||s>0?He(r.left+I/2,r.top+_/2,A-I/2,s-_/2,Be.TOP_LEFT):new G(r.left+I/2,r.top+_/2),this.topRightBorderStroke=A>0||s>0?He(r.left+y,r.top+_/2,a-k/2,c-_/2,Be.TOP_RIGHT):new G(r.left+r.width-k/2,r.top+_/2),this.bottomRightBorderStroke=l>0||d>0?He(r.left+B,r.top+b,l-k/2,d-T/2,Be.BOTTOM_RIGHT):new G(r.left+r.width-k/2,r.top+r.height-T/2),this.bottomLeftBorderStroke=f>0||p>0?He(r.left+I/2,r.top+w,f-I/2,p-T/2,Be.BOTTOM_LEFT):new G(r.left+I/2,r.top+r.height-T/2),this.topLeftBorderBox=A>0||s>0?He(r.left,r.top,A,s,Be.TOP_LEFT):new G(r.left,r.top),this.topRightBorderBox=a>0||c>0?He(r.left+y,r.top,a,c,Be.TOP_RIGHT):new G(r.left+r.width,r.top),this.bottomRightBorderBox=l>0||d>0?He(r.left+B,r.top+b,l,d,Be.BOTTOM_RIGHT):new G(r.left+r.width,r.top+r.height),this.bottomLeftBorderBox=f>0||p>0?He(r.left,r.top+w,f,p,Be.BOTTOM_LEFT):new G(r.left,r.top+r.height),this.topLeftPaddingBox=A>0||s>0?He(r.left+I,r.top+_,Math.max(0,A-I),Math.max(0,s-_),Be.TOP_LEFT):new G(r.left+I,r.top+_),this.topRightPaddingBox=a>0||c>0?He(r.left+Math.min(y,r.width-k),r.top+_,y>r.width+k?0:Math.max(0,a-k),Math.max(0,c-_),Be.TOP_RIGHT):new G(r.left+r.width-k,r.top+_),this.bottomRightPaddingBox=l>0||d>0?He(r.left+Math.min(B,r.width-I),r.top+Math.min(b,r.height-T),Math.max(0,l-k),Math.max(0,d-T),Be.BOTTOM_RIGHT):new G(r.left+r.width-k,r.top+r.height-T),this.bottomLeftPaddingBox=f>0||p>0?He(r.left+I,r.top+Math.min(w,r.height-T),Math.max(0,f-I),Math.max(0,p-T),Be.BOTTOM_LEFT):new G(r.left+I,r.top+r.height-T),this.topLeftContentBox=A>0||s>0?He(r.left+I+D,r.top+_+x,Math.max(0,A-(I+D)),Math.max(0,s-(_+x)),Be.TOP_LEFT):new G(r.left+I+D,r.top+_+x),this.topRightContentBox=a>0||c>0?He(r.left+Math.min(y,r.width+I+D),r.top+_+x,y>r.width+I+D?0:a-I+D,c-(_+x),Be.TOP_RIGHT):new G(r.left+r.width-(k+F),r.top+_+x),this.bottomRightContentBox=l>0||d>0?He(r.left+Math.min(B,r.width-(I+D)),r.top+Math.min(b,r.height+_+x),Math.max(0,l-(k+F)),d-(T+Q),Be.BOTTOM_RIGHT):new G(r.left+r.width-(k+F),r.top+r.height-(T+Q)),this.bottomLeftContentBox=f>0||p>0?He(r.left+I+D,r.top+w,Math.max(0,f-(I+D)),p-(T+Q),Be.BOTTOM_LEFT):new G(r.left+I+D,r.top+r.height-(T+Q))}return n}(),Be;(function(n){n[n.TOP_LEFT=0]="TOP_LEFT",n[n.TOP_RIGHT=1]="TOP_RIGHT",n[n.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",n[n.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(Be||(Be={}));var He=function(n,e,t,r,i){var A=4*((Math.sqrt(2)-1)/3),s=t*A,o=r*A,a=n+t,c=e+r;switch(i){case Be.TOP_LEFT:return new Bo(new G(n,c),new G(n,c-o),new G(a-s,e),new G(a,e));case Be.TOP_RIGHT:return new Bo(new G(n,e),new G(n+s,e),new G(a,c-o),new G(a,c));case Be.BOTTOM_RIGHT:return new Bo(new G(a,e),new G(a,e+o),new G(n+s,c),new G(n,c));case Be.BOTTOM_LEFT:default:return new Bo(new G(a,c),new G(a-s,c),new G(n,e+o),new G(n,e))}},Co=function(n){return[n.topLeftBorderBox,n.topRightBorderBox,n.bottomRightBorderBox,n.bottomLeftBorderBox]},O1=function(n){return[n.topLeftContentBox,n.topRightContentBox,n.bottomRightContentBox,n.bottomLeftContentBox]},_o=function(n){return[n.topLeftPaddingBox,n.topRightPaddingBox,n.bottomRightPaddingBox,n.bottomLeftPaddingBox]},M1=function(){function n(e,t,r){this.offsetX=e,this.offsetY=t,this.matrix=r,this.type=0,this.target=6}return n}(),So=function(){function n(e,t){this.path=e,this.target=t,this.type=1}return n}(),L1=function(){function n(e){this.opacity=e,this.type=2,this.target=6}return n}(),D1=function(n){return n.type===0},Og=function(n){return n.type===1},H1=function(n){return n.type===2},Mg=function(n,e){return n.length===e.length?n.some(function(t,r){return t===e[r]}):!1},N1=function(n,e,t,r,i){return n.map(function(A,s){switch(s){case 0:return A.add(e,t);case 1:return A.add(e+r,t);case 2:return A.add(e+r,t+i);case 3:return A.add(e,t+i)}return A})},Lg=function(){function n(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return n}(),Dg=function(){function n(e,t){if(this.container=e,this.parent=t,this.effects=[],this.curves=new P1(this.container),this.container.styles.opacity<1&&this.effects.push(new L1(this.container.styles.opacity)),this.container.styles.transform!==null){var r=this.container.bounds.left+this.container.styles.transformOrigin[0].number,i=this.container.bounds.top+this.container.styles.transformOrigin[1].number,A=this.container.styles.transform;this.effects.push(new M1(r,i,A))}if(this.container.styles.overflowX!==0){var s=Co(this.curves),o=_o(this.curves);Mg(s,o)?this.effects.push(new So(s,6)):(this.effects.push(new So(s,2)),this.effects.push(new So(o,4)))}}return n.prototype.getEffects=function(e){for(var t=[2,3].indexOf(this.container.styles.position)===-1,r=this.parent,i=this.effects.slice(0);r;){var A=r.effects.filter(function(a){return!Og(a)});if(t||r.container.styles.position!==0||!r.parent){if(t=[2,3].indexOf(r.container.styles.position)===-1,r.container.styles.overflowX!==0){var s=Co(r.curves),o=_o(r.curves);Mg(s,o)||i.unshift(new So(o,6))}i.unshift.apply(i,A)}else i.unshift.apply(i,A);r=r.parent}return i.filter(function(a){return ct(a.target,e)})},n}(),Nu=function(n,e,t,r){n.container.elements.forEach(function(i){var A=ct(i.flags,4),s=ct(i.flags,2),o=new Dg(i,n);ct(i.styles.display,2048)&&r.push(o);var a=ct(i.flags,8)?[]:r;if(A||s){var c=A||i.styles.isPositioned()?t:e,u=new Lg(o);if(i.styles.isPositioned()||i.styles.opacity<1||i.styles.isTransformed()){var l=i.styles.zIndex.order;if(l<0){var d=0;c.negativeZIndex.some(function(f,p){return l>f.element.container.styles.zIndex.order?(d=p,!1):d>0}),c.negativeZIndex.splice(d,0,u)}else if(l>0){var h=0;c.positiveZIndex.some(function(f,p){return l>=f.element.container.styles.zIndex.order?(h=p+1,!1):h>0}),c.positiveZIndex.splice(h,0,u)}else c.zeroOrAutoZIndexOrTransformedOrOpacity.push(u)}else i.styles.isFloating()?c.nonPositionedFloats.push(u):c.nonPositionedInlineLevel.push(u);Nu(o,u,A?u:t,a)}else i.styles.isInlineLevel()?e.inlineLevel.push(o):e.nonInlineLevel.push(o),Nu(o,e,t,a);ct(i.flags,8)&&Hg(i,a)})},Hg=function(n,e){for(var t=n instanceof Tu?n.start:1,r=n instanceof Tu?n.reversed:!1,i=0;i<e.length;i++){var A=e[i];A.container instanceof dg&&typeof A.container.value=="number"&&A.container.value!==0&&(t=A.container.value),A.listValue=TA(t,A.container.styles.listStyleType,!0),t+=r?-1:1}},K1=function(n){var e=new Dg(n,null),t=new Lg(e),r=[];return Nu(e,t,t,r),Hg(e.container,r),t},Ng=function(n,e){switch(e){case 0:return zt(n.topLeftBorderBox,n.topLeftPaddingBox,n.topRightBorderBox,n.topRightPaddingBox);case 1:return zt(n.topRightBorderBox,n.topRightPaddingBox,n.bottomRightBorderBox,n.bottomRightPaddingBox);case 2:return zt(n.bottomRightBorderBox,n.bottomRightPaddingBox,n.bottomLeftBorderBox,n.bottomLeftPaddingBox);case 3:default:return zt(n.bottomLeftBorderBox,n.bottomLeftPaddingBox,n.topLeftBorderBox,n.topLeftPaddingBox)}},V1=function(n,e){switch(e){case 0:return zt(n.topLeftBorderBox,n.topLeftBorderDoubleOuterBox,n.topRightBorderBox,n.topRightBorderDoubleOuterBox);case 1:return zt(n.topRightBorderBox,n.topRightBorderDoubleOuterBox,n.bottomRightBorderBox,n.bottomRightBorderDoubleOuterBox);case 2:return zt(n.bottomRightBorderBox,n.bottomRightBorderDoubleOuterBox,n.bottomLeftBorderBox,n.bottomLeftBorderDoubleOuterBox);case 3:default:return zt(n.bottomLeftBorderBox,n.bottomLeftBorderDoubleOuterBox,n.topLeftBorderBox,n.topLeftBorderDoubleOuterBox)}},G1=function(n,e){switch(e){case 0:return zt(n.topLeftBorderDoubleInnerBox,n.topLeftPaddingBox,n.topRightBorderDoubleInnerBox,n.topRightPaddingBox);case 1:return zt(n.topRightBorderDoubleInnerBox,n.topRightPaddingBox,n.bottomRightBorderDoubleInnerBox,n.bottomRightPaddingBox);case 2:return zt(n.bottomRightBorderDoubleInnerBox,n.bottomRightPaddingBox,n.bottomLeftBorderDoubleInnerBox,n.bottomLeftPaddingBox);case 3:default:return zt(n.bottomLeftBorderDoubleInnerBox,n.bottomLeftPaddingBox,n.topLeftBorderDoubleInnerBox,n.topLeftPaddingBox)}},j1=function(n,e){switch(e){case 0:return ko(n.topLeftBorderStroke,n.topRightBorderStroke);case 1:return ko(n.topRightBorderStroke,n.bottomRightBorderStroke);case 2:return ko(n.bottomRightBorderStroke,n.bottomLeftBorderStroke);case 3:default:return ko(n.bottomLeftBorderStroke,n.topLeftBorderStroke)}},ko=function(n,e){var t=[];return Jt(n)?t.push(n.subdivide(.5,!1)):t.push(n),Jt(e)?t.push(e.subdivide(.5,!0)):t.push(e),t},zt=function(n,e,t,r){var i=[];return Jt(n)?i.push(n.subdivide(.5,!1)):i.push(n),Jt(t)?i.push(t.subdivide(.5,!0)):i.push(t),Jt(r)?i.push(r.subdivide(.5,!0).reverse()):i.push(r),Jt(e)?i.push(e.subdivide(.5,!1).reverse()):i.push(e),i},Kg=function(n){var e=n.bounds,t=n.styles;return e.add(t.borderLeftWidth,t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth),-(t.borderTopWidth+t.borderBottomWidth))},Eo=function(n){var e=n.styles,t=n.bounds,r=Se(e.paddingLeft,t.width),i=Se(e.paddingRight,t.width),A=Se(e.paddingTop,t.width),s=Se(e.paddingBottom,t.width);return t.add(r+e.borderLeftWidth,A+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+r+i),-(e.borderTopWidth+e.borderBottomWidth+A+s))},W1=function(n,e){return n===0?e.bounds:n===2?Eo(e):Kg(e)},q1=function(n,e){return n===0?e.bounds:n===2?Eo(e):Kg(e)},Ku=function(n,e,t){var r=W1(bi(n.styles.backgroundOrigin,e),n),i=q1(bi(n.styles.backgroundClip,e),n),A=J1(bi(n.styles.backgroundSize,e),t,r),s=A[0],o=A[1],a=CA(bi(n.styles.backgroundPosition,e),r.width-s,r.height-o),c=z1(bi(n.styles.backgroundRepeat,e),a,A,r,i),u=Math.round(r.left+a[0]),l=Math.round(r.top+a[1]);return s=Math.max(1,s),o=Math.max(1,o),[c,u,l,s,o]},wi=function(n){return ae(n)&&n.value===fi.AUTO},Uo=function(n){return typeof n=="number"},J1=function(n,e,t){var r=e[0],i=e[1],A=e[2],s=n[0],o=n[1];if(!s)return[0,0];if(Re(s)&&o&&Re(o))return[Se(s,t.width),Se(o,t.height)];var a=Uo(A);if(ae(s)&&(s.value===fi.CONTAIN||s.value===fi.COVER)){if(Uo(A)){var c=t.width/t.height;return c<A!=(s.value===fi.COVER)?[t.width,t.width/A]:[t.height*A,t.height]}return[t.width,t.height]}var u=Uo(r),l=Uo(i),d=u||l;if(wi(s)&&(!o||wi(o))){if(u&&l)return[r,i];if(!a&&!d)return[t.width,t.height];if(d&&a){var h=u?r:i*A,f=l?i:r/A;return[h,f]}var p=u?r:t.width,g=l?i:t.height;return[p,g]}if(a){var v=0,y=0;return Re(s)?v=Se(s,t.width):Re(o)&&(y=Se(o,t.height)),wi(s)?v=y*A:(!o||wi(o))&&(y=v/A),[v,y]}var b=null,B=null;if(Re(s)?b=Se(s,t.width):o&&Re(o)&&(B=Se(o,t.height)),b!==null&&(!o||wi(o))&&(B=u&&l?b/r*i:t.height),B!==null&&wi(s)&&(b=u&&l?B/i*r:t.width),b!==null&&B!==null)return[b,B];throw new Error("Unable to calculate background-size for element")},bi=function(n,e){var t=n[e];return typeof t>"u"?n[0]:t},z1=function(n,e,t,r,i){var A=e[0],s=e[1],o=t[0],a=t[1];switch(n){case 2:return[new G(Math.round(r.left),Math.round(r.top+s)),new G(Math.round(r.left+r.width),Math.round(r.top+s)),new G(Math.round(r.left+r.width),Math.round(a+r.top+s)),new G(Math.round(r.left),Math.round(a+r.top+s))];case 3:return[new G(Math.round(r.left+A),Math.round(r.top)),new G(Math.round(r.left+A+o),Math.round(r.top)),new G(Math.round(r.left+A+o),Math.round(r.height+r.top)),new G(Math.round(r.left+A),Math.round(r.height+r.top))];case 1:return[new G(Math.round(r.left+A),Math.round(r.top+s)),new G(Math.round(r.left+A+o),Math.round(r.top+s)),new G(Math.round(r.left+A+o),Math.round(r.top+s+a)),new G(Math.round(r.left+A),Math.round(r.top+s+a))];default:return[new G(Math.round(i.left),Math.round(i.top)),new G(Math.round(i.left+i.width),Math.round(i.top)),new G(Math.round(i.left+i.width),Math.round(i.height+i.top)),new G(Math.round(i.left),Math.round(i.height+i.top))]}},X1="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",Vg="Hidden Text",Y1=function(){function n(e){this._data={},this._document=e}return n.prototype.parseMetrics=function(e,t){var r=this._document.createElement("div"),i=this._document.createElement("img"),A=this._document.createElement("span"),s=this._document.body;r.style.visibility="hidden",r.style.fontFamily=e,r.style.fontSize=t,r.style.margin="0",r.style.padding="0",r.style.whiteSpace="nowrap",s.appendChild(r),i.src=X1,i.width=1,i.height=1,i.style.margin="0",i.style.padding="0",i.style.verticalAlign="baseline",A.style.fontFamily=e,A.style.fontSize=t,A.style.margin="0",A.style.padding="0",A.appendChild(this._document.createTextNode(Vg)),r.appendChild(A),r.appendChild(i);var o=i.offsetTop-A.offsetTop+2;r.removeChild(A),r.appendChild(this._document.createTextNode(Vg)),r.style.lineHeight="normal",i.style.verticalAlign="super";var a=i.offsetTop-r.offsetTop+2;return s.removeChild(r),{baseline:o,middle:a}},n.prototype.getMetrics=function(e,t){var r="".concat(e," ").concat(t);return typeof this._data[r]>"u"&&(this._data[r]=this.parseMetrics(e,t)),this._data[r]},n}(),Gg=function(){function n(e,t){this.context=e,this.options=t}return n}(),Z1=1e4,$1=function(n){tn(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i._activeEffects=[],i.canvas=r.canvas?r.canvas:document.createElement("canvas"),i.ctx=i.canvas.getContext("2d"),r.canvas||(i.canvas.width=Math.floor(r.width*r.scale),i.canvas.height=Math.floor(r.height*r.scale),i.canvas.style.width="".concat(r.width,"px"),i.canvas.style.height="".concat(r.height,"px")),i.fontMetrics=new Y1(document),i.ctx.scale(i.options.scale,i.options.scale),i.ctx.translate(-r.x,-r.y),i.ctx.textBaseline="bottom",i._activeEffects=[],i.context.logger.debug("Canvas renderer initialized (".concat(r.width,"x").concat(r.height,") with scale ").concat(r.scale)),i}return e.prototype.applyEffects=function(t){for(var r=this;this._activeEffects.length;)this.popEffect();t.forEach(function(i){return r.applyEffect(i)})},e.prototype.applyEffect=function(t){this.ctx.save(),H1(t)&&(this.ctx.globalAlpha=t.opacity),D1(t)&&(this.ctx.translate(t.offsetX,t.offsetY),this.ctx.transform(t.matrix[0],t.matrix[1],t.matrix[2],t.matrix[3],t.matrix[4],t.matrix[5]),this.ctx.translate(-t.offsetX,-t.offsetY)),Og(t)&&(this.path(t.path),this.ctx.clip()),this._activeEffects.push(t)},e.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},e.prototype.renderStack=function(t){return Ut(this,void 0,void 0,function(){var r;return Bt(this,function(i){switch(i.label){case 0:return r=t.element.container.styles,r.isVisible()?[4,this.renderStackContent(t)]:[3,2];case 1:i.sent(),i.label=2;case 2:return[2]}})})},e.prototype.renderNode=function(t){return Ut(this,void 0,void 0,function(){return Bt(this,function(r){switch(r.label){case 0:return ct(t.container.flags,16),t.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(t)]:[3,3];case 1:return r.sent(),[4,this.renderNodeContent(t)];case 2:r.sent(),r.label=3;case 3:return[2]}})})},e.prototype.renderTextWithLetterSpacing=function(t,r,i){var A=this;if(r===0)navigator.userAgent.indexOf("Firefox")===-1?(this.ctx.textBaseline="ideographic",this.ctx.fillText(t.text,t.bounds.left,t.bounds.top+t.bounds.height)):this.ctx.fillText(t.text,t.bounds.left,t.bounds.top+i);else{var s=Uu(t.text);s.reduce(function(o,a){return A.ctx.fillText(a,o,t.bounds.top+i),o+A.ctx.measureText(a).width},t.bounds.left)}},e.prototype.createFontStyle=function(t){var r=t.fontVariant.filter(function(s){return s==="normal"||s==="small-caps"}).join(""),i=iT(t.fontFamily).join(", "),A=$n(t.fontSize)?"".concat(t.fontSize.number).concat(t.fontSize.unit):"".concat(t.fontSize.number,"px");return[[t.fontStyle,r,t.fontWeight,A,i].join(" "),i,A]},e.prototype.renderTextNode=function(t,r){return Ut(this,void 0,void 0,function(){var i,A,s=this;return Bt(this,function(o){return i=this.createFontStyle(r)[0],this.ctx.font=i,this.ctx.direction=r.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",A=r.paintOrder,t.textBounds.forEach(function(a){A.forEach(function(c){switch(c){case 0:s.ctx.fillStyle=ht(r.color),s.renderTextWithLetterSpacing(a,r.letterSpacing,r.fontSize.number);var u=r.textShadow;if(u.length&&a.text.trim().length&&(u.slice(0).reverse().forEach(function(d){s.ctx.shadowColor=ht(d.color),s.ctx.shadowOffsetX=d.offsetX.number*s.options.scale,s.ctx.shadowOffsetY=d.offsetY.number*s.options.scale,s.ctx.shadowBlur=d.blur.number,s.renderTextWithLetterSpacing(a,r.letterSpacing,r.fontSize.number)}),s.ctx.shadowColor="",s.ctx.shadowOffsetX=0,s.ctx.shadowOffsetY=0,s.ctx.shadowBlur=0),r.textDecorationLine.length){s.ctx.fillStyle=ht(r.textDecorationColor||r.color);var l=1;r.textDecorationLine.forEach(function(d){switch(d){case 1:s.ctx.fillRect(a.bounds.left,a.bounds.top+a.bounds.height-l,a.bounds.width,l);break;case 2:s.ctx.fillRect(a.bounds.left,a.bounds.top,a.bounds.width,l);break;case 3:s.ctx.fillRect(a.bounds.left,a.bounds.top+(a.bounds.height/2-l/2),a.bounds.width,l);break}})}break;case 1:r.webkitTextStrokeWidth&&a.text.trim().length&&(s.ctx.strokeStyle=ht(r.webkitTextStrokeColor),s.ctx.lineWidth=r.webkitTextStrokeWidth,s.ctx.lineJoin=window.chrome?"miter":"round",s.ctx.strokeText(a.text,a.bounds.left,a.bounds.top+a.bounds.height)),s.ctx.strokeStyle="",s.ctx.lineWidth=0,s.ctx.lineJoin="miter";break}})}),[2]})})},e.prototype.renderReplacedElement=function(t,r,i){var A=i.naturalWidth||t.intrinsicWidth,s=i.naturalHeight||t.intrinsicHeight;if(i&&A>0&&s>0){var o=Eo(t),a=_o(r);this.path(a),this.ctx.save(),this.ctx.clip();var c=0,u=0,l=A,d=s,h=o.left,f=o.top,p=o.width,g=o.height,v=t.styles.objectFit,y=p/g,b=l/d;if(v===2)b>y?(g=p/b,f+=(o.height-g)/2):(p=g*b,h+=(o.width-p)/2);else if(v===4)b>y?(l=d*y,c+=(A-l)/2):(d=l/y,u+=(s-d)/2);else if(v===8)l>p?(c+=(l-p)/2,l=p):(h+=(p-l)/2,p=l),d>g?(u+=(d-g)/2,d=g):(f+=(g-d)/2,g=d);else if(v===16){var B=b>y?p:g*b,w=l>p?l:p;B<w?b>y?(g=p/b,f+=(o.height-g)/2):(p=g*b,h+=(o.width-p)/2):(l>p?(c+=(l-p)/2,l=p):(h+=(p-l)/2,p=l),d>g?(u+=(d-g)/2,d=g):(f+=(g-d)/2,g=d))}this.ctx.drawImage(i,c,u,l,d,h,f,p,g),this.ctx.restore()}},e.prototype.renderNodeContent=function(t){return Ut(this,void 0,void 0,function(){var r,i,A,s,o,a,b,b,c,u,l,d,w,h,f,p,_,g,v,y,b,B,w,_;return Bt(this,function(k){switch(k.label){case 0:this.applyEffects(t.getEffects(4)),r=t.container,i=t.curves,A=r.styles,s=0,o=r.textNodes,k.label=1;case 1:return s<o.length?(a=o[s],[4,this.renderTextNode(a,A)]):[3,4];case 2:k.sent(),k.label=3;case 3:return s++,[3,1];case 4:if(!(r instanceof cg))return[3,8];k.label=5;case 5:return k.trys.push([5,7,,8]),[4,this.context.cache.match(r.src)];case 6:return b=k.sent(),this.renderReplacedElement(r,i,b),[3,8];case 7:return k.sent(),this.context.logger.error("Error loading image ".concat(r.src)),[3,8];case 8:if(r instanceof ug&&this.renderReplacedElement(r,i,r.canvas),!(r instanceof lg))return[3,12];k.label=9;case 9:return k.trys.push([9,11,,12]),[4,this.context.cache.match(r.svg)];case 10:return b=k.sent(),this.renderReplacedElement(r,i,b),[3,12];case 11:return k.sent(),this.context.logger.error("Error loading svg ".concat(r.svg.substring(0,255))),[3,12];case 12:return r instanceof gg&&r.tree?(c=new e(this.context,{scale:this.options.scale,backgroundColor:r.backgroundColor,x:0,y:0,width:r.width,height:r.height}),[4,c.render(r.tree)]):[3,14];case 13:u=k.sent(),r.width&&r.height&&this.ctx.drawImage(u,0,0,r.width,r.height,r.bounds.left,r.bounds.top,r.bounds.width,r.bounds.height),k.label=14;case 14:if(r instanceof Iu&&(l=Math.min(r.bounds.width,r.bounds.height),r.type===go?r.checked&&(this.ctx.save(),this.path([new G(r.bounds.left+l*.39363,r.bounds.top+l*.79),new G(r.bounds.left+l*.16,r.bounds.top+l*.5549),new G(r.bounds.left+l*.27347,r.bounds.top+l*.44071),new G(r.bounds.left+l*.39694,r.bounds.top+l*.5649),new G(r.bounds.left+l*.72983,r.bounds.top+l*.23),new G(r.bounds.left+l*.84,r.bounds.top+l*.34085),new G(r.bounds.left+l*.39363,r.bounds.top+l*.79)]),this.ctx.fillStyle=ht(hg),this.ctx.fill(),this.ctx.restore()):r.type===mo&&r.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(r.bounds.left+l/2,r.bounds.top+l/2,l/4,0,Math.PI*2,!0),this.ctx.fillStyle=ht(hg),this.ctx.fill(),this.ctx.restore())),eT(r)&&r.value.length){switch(d=this.createFontStyle(A),w=d[0],h=d[1],f=d[2],p=this.fontMetrics.getMetrics(h,f).baseline,this.ctx.font=w,this.ctx.fillStyle=ht(A.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=nT(r.styles.textAlign),_=Eo(r),g=0,r.styles.textAlign){case 1:g+=_.width/2;break;case 2:g+=_.width;break}v=_.add(g,0,0,-_.height/2+1),this.ctx.save(),this.path([new G(_.left,_.top),new G(_.left+_.width,_.top),new G(_.left+_.width,_.top+_.height),new G(_.left,_.top+_.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new EA(r.value,v),A.letterSpacing,p),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!ct(r.styles.display,2048))return[3,20];if(r.styles.listStyleImage===null)return[3,19];if(y=r.styles.listStyleImage,y.type!==0)return[3,18];b=void 0,B=y.url,k.label=15;case 15:return k.trys.push([15,17,,18]),[4,this.context.cache.match(B)];case 16:return b=k.sent(),this.ctx.drawImage(b,r.bounds.left-(b.width+10),r.bounds.top),[3,18];case 17:return k.sent(),this.context.logger.error("Error loading list-style-image ".concat(B)),[3,18];case 18:return[3,20];case 19:t.listValue&&r.styles.listStyleType!==-1&&(w=this.createFontStyle(A)[0],this.ctx.font=w,this.ctx.fillStyle=ht(A.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",_=new Qn(r.bounds.left,r.bounds.top+Se(r.styles.paddingTop,r.bounds.width),r.bounds.width,Gf(A.lineHeight,A.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new EA(t.listValue,_),A.letterSpacing,Gf(A.lineHeight,A.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),k.label=20;case 20:return[2]}})})},e.prototype.renderStackContent=function(t){return Ut(this,void 0,void 0,function(){var r,i,v,A,s,v,o,a,v,c,u,v,l,d,v,h,f,v,p,g,v;return Bt(this,function(y){switch(y.label){case 0:return ct(t.element.container.flags,16),[4,this.renderNodeBackgroundAndBorders(t.element)];case 1:y.sent(),r=0,i=t.negativeZIndex,y.label=2;case 2:return r<i.length?(v=i[r],[4,this.renderStack(v)]):[3,5];case 3:y.sent(),y.label=4;case 4:return r++,[3,2];case 5:return[4,this.renderNodeContent(t.element)];case 6:y.sent(),A=0,s=t.nonInlineLevel,y.label=7;case 7:return A<s.length?(v=s[A],[4,this.renderNode(v)]):[3,10];case 8:y.sent(),y.label=9;case 9:return A++,[3,7];case 10:o=0,a=t.nonPositionedFloats,y.label=11;case 11:return o<a.length?(v=a[o],[4,this.renderStack(v)]):[3,14];case 12:y.sent(),y.label=13;case 13:return o++,[3,11];case 14:c=0,u=t.nonPositionedInlineLevel,y.label=15;case 15:return c<u.length?(v=u[c],[4,this.renderStack(v)]):[3,18];case 16:y.sent(),y.label=17;case 17:return c++,[3,15];case 18:l=0,d=t.inlineLevel,y.label=19;case 19:return l<d.length?(v=d[l],[4,this.renderNode(v)]):[3,22];case 20:y.sent(),y.label=21;case 21:return l++,[3,19];case 22:h=0,f=t.zeroOrAutoZIndexOrTransformedOrOpacity,y.label=23;case 23:return h<f.length?(v=f[h],[4,this.renderStack(v)]):[3,26];case 24:y.sent(),y.label=25;case 25:return h++,[3,23];case 26:p=0,g=t.positiveZIndex,y.label=27;case 27:return p<g.length?(v=g[p],[4,this.renderStack(v)]):[3,30];case 28:y.sent(),y.label=29;case 29:return p++,[3,27];case 30:return[2]}})})},e.prototype.mask=function(t){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(t.slice(0).reverse()),this.ctx.closePath()},e.prototype.path=function(t){this.ctx.beginPath(),this.formatPath(t),this.ctx.closePath()},e.prototype.formatPath=function(t){var r=this;t.forEach(function(i,A){var s=Jt(i)?i.start:i;A===0?r.ctx.moveTo(s.x,s.y):r.ctx.lineTo(s.x,s.y),Jt(i)&&r.ctx.bezierCurveTo(i.startControl.x,i.startControl.y,i.endControl.x,i.endControl.y,i.end.x,i.end.y)})},e.prototype.renderRepeat=function(t,r,i,A){this.path(t),this.ctx.fillStyle=r,this.ctx.translate(i,A),this.ctx.fill(),this.ctx.translate(-i,-A)},e.prototype.resizeImage=function(t,r,i){var A,s=(A=this.canvas.ownerDocument)!==null&&A!==void 0?A:document,o=s.createElement("canvas");o.width=Math.max(1,r),o.height=Math.max(1,i);var a=o.getContext("2d");return a.drawImage(t,0,0,t.width,t.height,0,0,r,i),o},e.prototype.renderBackgroundImage=function(t){return Ut(this,void 0,void 0,function(){var r,i,A,s,o,a;return Bt(this,function(c){switch(c.label){case 0:r=t.styles.backgroundImage.length-1,i=function(u){var l,d,h,f,p,Q,Y,re,N,q,x,g,Q,Y,re,N,q,v,y,b,B,w,_,k,T,I,x,F,Q,D,X,N,q,ge,Y,re,xe,je,be,dt,Qe,De,te,Ze;return Bt(this,function(ye){switch(ye.label){case 0:if(u.type!==0)return[3,5];l=void 0,d=u.url,ye.label=1;case 1:return ye.trys.push([1,3,,4]),[4,A.context.cache.match(d)];case 2:return l=ye.sent(),[3,4];case 3:return ye.sent(),A.context.logger.error("Error loading background-image ".concat(d)),[3,4];case 4:return l&&(h=isNaN(l.width)||l.width===0?1:l.width,f=isNaN(l.height)||l.height===0?1:l.height,p=Ku(t,r,[h,f,h/f]),Q=p[0],Y=p[1],re=p[2],N=p[3],q=p[4],x=A.ctx.createPattern(A.resizeImage(l,N,q),"repeat"),A.renderRepeat(Q,x,Y,re)),[3,6];case 5:Ok(u)?(g=Ku(t,r,[null,null,null]),Q=g[0],Y=g[1],re=g[2],N=g[3],q=g[4],v=Fk(u.angle,N,q),y=v[0],b=v[1],B=v[2],w=v[3],_=v[4],k=document.createElement("canvas"),k.width=N,k.height=q,T=k.getContext("2d"),I=T.createLinearGradient(b,w,B,_),Qf(u.stops,y||1).forEach(function(At){return I.addColorStop(At.stop,ht(At.color))}),T.fillStyle=I,T.fillRect(0,0,N,q),N>0&&q>0&&(x=A.ctx.createPattern(k,"repeat"),A.renderRepeat(Q,x,Y,re))):Mk(u)&&(F=Ku(t,r,[null,null,null]),Q=F[0],D=F[1],X=F[2],N=F[3],q=F[4],ge=u.position.length===0?[cu]:u.position,Y=Se(ge[0],N),re=Se(ge[ge.length-1],q),xe=xk(u,Y,re,N,q),je=xe[0],be=xe[1],je>0&&be>0&&(dt=A.ctx.createRadialGradient(D+Y,X+re,0,D+Y,X+re,je),Qf(u.stops,je*2).forEach(function(At){return dt.addColorStop(At.stop,ht(At.color))}),A.path(Q),A.ctx.fillStyle=dt,je!==be?(Qe=t.bounds.left+.5*t.bounds.width,De=t.bounds.top+.5*t.bounds.height,te=be/je,Ze=1/te,A.ctx.save(),A.ctx.translate(Qe,De),A.ctx.transform(1,0,0,te,0,0),A.ctx.translate(-Qe,-De),A.ctx.fillRect(D,Ze*(X-De)+De,N,q*Ze),A.ctx.restore()):A.ctx.fill())),ye.label=6;case 6:return r--,[2]}})},A=this,s=0,o=t.styles.backgroundImage.slice(0).reverse(),c.label=1;case 1:return s<o.length?(a=o[s],[5,i(a)]):[3,4];case 2:c.sent(),c.label=3;case 3:return s++,[3,1];case 4:return[2]}})})},e.prototype.renderSolidBorder=function(t,r,i){return Ut(this,void 0,void 0,function(){return Bt(this,function(A){return this.path(Ng(i,r)),this.ctx.fillStyle=ht(t),this.ctx.fill(),[2]})})},e.prototype.renderDoubleBorder=function(t,r,i,A){return Ut(this,void 0,void 0,function(){var s,o;return Bt(this,function(a){switch(a.label){case 0:return r<3?[4,this.renderSolidBorder(t,i,A)]:[3,2];case 1:return a.sent(),[2];case 2:return s=V1(A,i),this.path(s),this.ctx.fillStyle=ht(t),this.ctx.fill(),o=G1(A,i),this.path(o),this.ctx.fill(),[2]}})})},e.prototype.renderNodeBackgroundAndBorders=function(t){return Ut(this,void 0,void 0,function(){var r,i,A,s,o,a,c,u,l=this;return Bt(this,function(d){switch(d.label){case 0:return this.applyEffects(t.getEffects(2)),r=t.container.styles,i=!nr(r.backgroundColor)||r.backgroundImage.length,A=[{style:r.borderTopStyle,color:r.borderTopColor,width:r.borderTopWidth},{style:r.borderRightStyle,color:r.borderRightColor,width:r.borderRightWidth},{style:r.borderBottomStyle,color:r.borderBottomColor,width:r.borderBottomWidth},{style:r.borderLeftStyle,color:r.borderLeftColor,width:r.borderLeftWidth}],s=tT(bi(r.backgroundClip,0),t.curves),i||r.boxShadow.length?(this.ctx.save(),this.path(s),this.ctx.clip(),nr(r.backgroundColor)||(this.ctx.fillStyle=ht(r.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(t.container)]):[3,2];case 1:d.sent(),this.ctx.restore(),r.boxShadow.slice(0).reverse().forEach(function(h){l.ctx.save();var f=Co(t.curves),p=h.inset?0:Z1,g=N1(f,-p+(h.inset?1:-1)*h.spread.number,(h.inset?1:-1)*h.spread.number,h.spread.number*(h.inset?-2:2),h.spread.number*(h.inset?-2:2));h.inset?(l.path(f),l.ctx.clip(),l.mask(g)):(l.mask(f),l.ctx.clip(),l.path(g)),l.ctx.shadowOffsetX=h.offsetX.number+p,l.ctx.shadowOffsetY=h.offsetY.number,l.ctx.shadowColor=ht(h.color),l.ctx.shadowBlur=h.blur.number,l.ctx.fillStyle=h.inset?ht(h.color):"rgba(0,0,0,1)",l.ctx.fill(),l.ctx.restore()}),d.label=2;case 2:o=0,a=0,c=A,d.label=3;case 3:return a<c.length?(u=c[a],u.style!==0&&!nr(u.color)&&u.width>0?u.style!==2?[3,5]:[4,this.renderDashedDottedBorder(u.color,u.width,o,t.curves,2)]:[3,11]):[3,13];case 4:return d.sent(),[3,11];case 5:return u.style!==3?[3,7]:[4,this.renderDashedDottedBorder(u.color,u.width,o,t.curves,3)];case 6:return d.sent(),[3,11];case 7:return u.style!==4?[3,9]:[4,this.renderDoubleBorder(u.color,u.width,o,t.curves)];case 8:return d.sent(),[3,11];case 9:return[4,this.renderSolidBorder(u.color,o,t.curves)];case 10:d.sent(),d.label=11;case 11:o++,d.label=12;case 12:return a++,[3,3];case 13:return[2]}})})},e.prototype.renderDashedDottedBorder=function(t,r,i,A,s){return Ut(this,void 0,void 0,function(){var o,a,c,u,l,d,h,f,p,g,v,y,b,B,w,_,w,_;return Bt(this,function(k){return this.ctx.save(),o=j1(A,i),a=Ng(A,i),s===2&&(this.path(a),this.ctx.clip()),Jt(a[0])?(c=a[0].start.x,u=a[0].start.y):(c=a[0].x,u=a[0].y),Jt(a[1])?(l=a[1].end.x,d=a[1].end.y):(l=a[1].x,d=a[1].y),i===0||i===2?h=Math.abs(c-l):h=Math.abs(u-d),this.ctx.beginPath(),s===3?this.formatPath(o):this.formatPath(a.slice(0,2)),f=r<3?r*3:r*2,p=r<3?r*2:r,s===3&&(f=r,p=r),g=!0,h<=f*2?g=!1:h<=f*2+p?(v=h/(2*f+p),f*=v,p*=v):(y=Math.floor((h+p)/(f+p)),b=(h-y*f)/(y-1),B=(h-(y+1)*f)/y,p=B<=0||Math.abs(p-b)<Math.abs(p-B)?b:B),g&&(s===3?this.ctx.setLineDash([0,f+p]):this.ctx.setLineDash([f,p])),s===3?(this.ctx.lineCap="round",this.ctx.lineWidth=r):this.ctx.lineWidth=r*2+1.1,this.ctx.strokeStyle=ht(t),this.ctx.stroke(),this.ctx.setLineDash([]),s===2&&(Jt(a[0])&&(w=a[3],_=a[0],this.ctx.beginPath(),this.formatPath([new G(w.end.x,w.end.y),new G(_.start.x,_.start.y)]),this.ctx.stroke()),Jt(a[1])&&(w=a[1],_=a[2],this.ctx.beginPath(),this.formatPath([new G(w.end.x,w.end.y),new G(_.start.x,_.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},e.prototype.render=function(t){return Ut(this,void 0,void 0,function(){var r;return Bt(this,function(i){switch(i.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=ht(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),r=K1(t),[4,this.renderStack(r)];case 1:return i.sent(),this.applyEffects([]),[2,this.canvas]}})})},e}(Gg),eT=function(n){return n instanceof fg||n instanceof pg?!0:n instanceof Iu&&n.type!==mo&&n.type!==go},tT=function(n,e){switch(n){case 0:return Co(e);case 2:return O1(e);case 1:default:return _o(e)}},nT=function(n){switch(n){case 1:return"center";case 2:return"right";case 0:default:return"left"}},rT=["-apple-system","system-ui"],iT=function(n){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?n.filter(function(e){return rT.indexOf(e)===-1}):n},AT=function(n){tn(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.canvas=r.canvas?r.canvas:document.createElement("canvas"),i.ctx=i.canvas.getContext("2d"),i.options=r,i.canvas.width=Math.floor(r.width*r.scale),i.canvas.height=Math.floor(r.height*r.scale),i.canvas.style.width="".concat(r.width,"px"),i.canvas.style.height="".concat(r.height,"px"),i.ctx.scale(i.options.scale,i.options.scale),i.ctx.translate(-r.x,-r.y),i.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized (".concat(r.width,"x").concat(r.height," at ").concat(r.x,",").concat(r.y,") with scale ").concat(r.scale)),i}return e.prototype.render=function(t){return Ut(this,void 0,void 0,function(){var r,i;return Bt(this,function(A){switch(A.label){case 0:return r=Eu(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,t),[4,sT(r)];case 1:return i=A.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=ht(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(i,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},e}(Gg),sT=function(n){return new Promise(function(e,t){var r=new Image;r.onload=function(){e(r)},r.onerror=t,r.src="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent(new XMLSerializer().serializeToString(n)))})},oT=function(){function n(e){var t=e.id,r=e.enabled;this.id=t,this.enabled=r,this.start=Date.now()}return n.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console?(()=>{}).apply(console,Ts([this.id,"".concat(this.getTime(),"ms")],e,!1)):this.info.apply(this,e))},n.prototype.getTime=function(){return Date.now()-this.start},n.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,Ts([this.id,"".concat(this.getTime(),"ms")],e,!1))},n.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,Ts([this.id,"".concat(this.getTime(),"ms")],e,!1)):this.info.apply(this,e))},n.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,Ts([this.id,"".concat(this.getTime(),"ms")],e,!1)):this.info.apply(this,e))},n.instances={},n}(),aT=function(){function n(e,t){var r;this.windowBounds=t,this.instanceName="#".concat(n.instanceCount++),this.logger=new oT({id:this.instanceName,enabled:e.logging}),this.cache=(r=e.cache)!==null&&r!==void 0?r:new U1(this,e)}return n.instanceCount=1,n}(),cT=function(n,e){return e===void 0&&(e={}),uT(n,e)};typeof window<"u"&&Lu.setContext(window);var uT=function(n,e){return Ut(void 0,void 0,void 0,function(){var t,r,i,A,s,o,a,c,u,l,d,h,f,p,g,v,y,b,B,w,k,_,k,T,I,x,F,Q,D,X,N,q,ge,Y,re,xe,je,be,dt,Qe;return Bt(this,function(De){switch(De.label){case 0:if(!n||typeof n!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(t=n.ownerDocument,!t)throw new Error("Element is not attached to a Document");if(r=t.defaultView,!r)throw new Error("Document is not attached to a Window");return i={allowTaint:(T=e.allowTaint)!==null&&T!==void 0?T:!1,imageTimeout:(I=e.imageTimeout)!==null&&I!==void 0?I:15e3,proxy:e.proxy,useCORS:(x=e.useCORS)!==null&&x!==void 0?x:!1,customIsSameOrigin:e.customIsSameOrigin},A=Kc({logging:(F=e.logging)!==null&&F!==void 0?F:!0,cache:e.cache},i),s={windowWidth:(Q=e.windowWidth)!==null&&Q!==void 0?Q:r.innerWidth,windowHeight:(D=e.windowHeight)!==null&&D!==void 0?D:r.innerHeight,scrollX:(X=e.scrollX)!==null&&X!==void 0?X:r.pageXOffset,scrollY:(N=e.scrollY)!==null&&N!==void 0?N:r.pageYOffset},o=new Qn(s.scrollX,s.scrollY,s.windowWidth,s.windowHeight),a=new aT(A,o),c=(q=e.foreignObjectRendering)!==null&&q!==void 0?q:!1,u={allowTaint:(ge=e.allowTaint)!==null&&ge!==void 0?ge:!1,onclone:e.onclone,ignoreElements:e.ignoreElements,inlineImages:c,copyStyles:c},a.logger.debug("Starting document clone with size ".concat(o.width,"x").concat(o.height," scrolled to ").concat(-o.left,",").concat(-o.top)),l=new Rg(a,n,u),d=l.clonedReferenceElement,d?[4,l.toIFrame(t,o)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return h=De.sent(),f=xu(d)||u1(d)?WC(d.ownerDocument):Is(a,d),p=f.width,g=f.height,v=f.left,y=f.top,b=lT(a,d,e.backgroundColor),B={canvas:e.canvas,backgroundColor:b,scale:(re=(Y=e.scale)!==null&&Y!==void 0?Y:r.devicePixelRatio)!==null&&re!==void 0?re:1,x:((xe=e.x)!==null&&xe!==void 0?xe:0)+v,y:((je=e.y)!==null&&je!==void 0?je:0)+y,width:(be=e.width)!==null&&be!==void 0?be:Math.ceil(p),height:(dt=e.height)!==null&&dt!==void 0?dt:Math.ceil(g)},c?(a.logger.debug("Document cloned, using foreign object rendering"),k=new AT(a,B),[4,k.render(d)]):[3,3];case 2:return w=De.sent(),[3,5];case 3:return a.logger.debug("Document cloned, element located at ".concat(v,",").concat(y," with size ").concat(p,"x").concat(g," using computed rendering")),a.logger.debug("Starting DOM parsing"),_=vg(a,d),b===_.styles.backgroundColor&&(_.styles.backgroundColor=wn.TRANSPARENT),a.logger.debug("Starting renderer for element at ".concat(B.x,",").concat(B.y," with size ").concat(B.width,"x").concat(B.height)),k=new $1(a,B),[4,k.render(_)];case 4:w=De.sent(),De.label=5;case 5:return(!((Qe=e.removeContainer)!==null&&Qe!==void 0)||Qe)&&(Rg.destroy(h)||a.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),a.logger.debug("Finished rendering"),[2,w]}})})},lT=function(n,e,t){var r=e.ownerDocument,i=r.documentElement?pi(n,getComputedStyle(r.documentElement).backgroundColor):wn.TRANSPARENT,A=r.body?pi(n,getComputedStyle(r.body).backgroundColor):wn.TRANSPARENT,s=typeof t=="string"?pi(n,t):t===null?wn.TRANSPARENT:4294967295;return e===r.documentElement?nr(i)?nr(A)?s:A:i:s};function dT(n,e){return e.forEach(function(t){t&&typeof t!="string"&&!Array.isArray(t)&&Object.keys(t).forEach(function(r){if(r!=="default"&&!(r in n)){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}})}),Object.freeze(n)}var hT=Object.defineProperty,pT=(n,e,t)=>e in n?hT(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,jg=(n,e,t)=>pT(n,typeof e!="symbol"?e+"":e,t);let Ot=class{constructor(){jg(this,"_locking"),jg(this,"_locks"),this._locking=Promise.resolve(),this._locks=0}isLocked(){return this._locks>0}lock(){this._locks+=1;let e;const t=new Promise(i=>e=()=>{this._locks-=1,i()}),r=this._locking.then(()=>e);return this._locking=this._locking.then(()=>t),r}};function Je(n,e){if(!n)throw new Error(e)}const fT=34028234663852886e22,gT=-34028234663852886e22,mT=4294967295,vT=2147483647,yT=-2147483648;function To(n){if(typeof n!="number")throw new Error("invalid int 32: "+typeof n);if(!Number.isInteger(n)||n>vT||n<yT)throw new Error("invalid int 32: "+n)}function Vu(n){if(typeof n!="number")throw new Error("invalid uint 32: "+typeof n);if(!Number.isInteger(n)||n>mT||n<0)throw new Error("invalid uint 32: "+n)}function Wg(n){if(typeof n!="number")throw new Error("invalid float 32: "+typeof n);if(Number.isFinite(n)&&(n>fT||n<gT))throw new Error("invalid float 32: "+n)}const qg=Symbol("@bufbuild/protobuf/enum-type");function wT(n){const e=n[qg];return Je(e,"missing enum type on enum object"),e}function Jg(n,e,t,r){n[qg]=zg(e,t.map(i=>({no:i.no,name:i.name,localName:n[i.no]})))}function zg(n,e,t){const r=Object.create(null),i=Object.create(null),A=[];for(const s of e){const o=Xg(s);A.push(o),r[s.name]=o,i[s.no]=o}return{typeName:n,values:A,findName(s){return r[s]},findNumber(s){return i[s]}}}function bT(n,e,t){const r={};for(const i of e){const A=Xg(i);r[A.localName]=A.no,r[A.no]=A.localName}return Jg(r,n,e),r}function Xg(n){return"localName"in n?n:Object.assign(Object.assign({},n),{localName:n.name})}class Gu{equals(e){return this.getType().runtime.util.equals(this.getType(),this,e)}clone(){return this.getType().runtime.util.clone(this)}fromBinary(e,t){const r=this.getType(),i=r.runtime.bin,A=i.makeReadOptions(t);return i.readMessage(this,A.readerFactory(e),e.byteLength,A),this}fromJson(e,t){const r=this.getType(),i=r.runtime.json,A=i.makeReadOptions(t);return i.readMessage(r,e,A,this),this}fromJsonString(e,t){let r;try{r=JSON.parse(e)}catch(i){throw new Error("cannot decode ".concat(this.getType().typeName," from JSON: ").concat(i instanceof Error?i.message:String(i)))}return this.fromJson(r,t)}toBinary(e){const t=this.getType(),r=t.runtime.bin,i=r.makeWriteOptions(e),A=i.writerFactory();return r.writeMessage(this,A,i),A.finish()}toJson(e){const t=this.getType(),r=t.runtime.json,i=r.makeWriteOptions(e);return r.writeMessage(this,i)}toJsonString(e){var t;const r=this.toJson(e);return JSON.stringify(r,null,(t=e==null?void 0:e.prettySpaces)!==null&&t!==void 0?t:0)}toJSON(){return this.toJson({emitDefaultValues:!0})}getType(){return Object.getPrototypeOf(this).constructor}}function BT(n,e,t,r){var i;const A=(i=r==null?void 0:r.localName)!==null&&i!==void 0?i:e.substring(e.lastIndexOf(".")+1),s={[A]:function(o){n.util.initFields(this),n.util.initPartial(o,this)}}[A];return Object.setPrototypeOf(s.prototype,new Gu),Object.assign(s,{runtime:n,typeName:e,fields:n.util.newFieldList(t),fromBinary(o,a){return new s().fromBinary(o,a)},fromJson(o,a){return new s().fromJson(o,a)},fromJsonString(o,a){return new s().fromJsonString(o,a)},equals(o,a){return n.util.equals(s,o,a)}}),s}function CT(){let n=0,e=0;for(let r=0;r<28;r+=7){let i=this.buf[this.pos++];if(n|=(i&127)<<r,!(i&128))return this.assertBounds(),[n,e]}let t=this.buf[this.pos++];if(n|=(t&15)<<28,e=(t&112)>>4,!(t&128))return this.assertBounds(),[n,e];for(let r=3;r<=31;r+=7){let i=this.buf[this.pos++];if(e|=(i&127)<<r,!(i&128))return this.assertBounds(),[n,e]}throw new Error("invalid varint")}function ju(n,e,t){for(let A=0;A<28;A=A+7){const s=n>>>A,o=!(!(s>>>7)&&e==0),a=(o?s|128:s)&255;if(t.push(a),!o)return}const r=n>>>28&15|(e&7)<<4,i=!!(e>>3);if(t.push((i?r|128:r)&255),!!i){for(let A=3;A<31;A=A+7){const s=e>>>A,o=!!(s>>>7),a=(o?s|128:s)&255;if(t.push(a),!o)return}t.push(e>>>31&1)}}const Io=4294967296;function Yg(n){const e=n[0]==="-";e&&(n=n.slice(1));const t=1e6;let r=0,i=0;function A(s,o){const a=Number(n.slice(s,o));i*=t,r=r*t+a,r>=Io&&(i=i+(r/Io|0),r=r%Io)}return A(-24,-18),A(-18,-12),A(-12,-6),A(-6),e?$g(r,i):Wu(r,i)}function _T(n,e){let t=Wu(n,e);const r=t.hi&2147483648;r&&(t=$g(t.lo,t.hi));const i=Zg(t.lo,t.hi);return r?"-"+i:i}function Zg(n,e){if({lo:n,hi:e}=ST(n,e),e<=2097151)return String(Io*e+n);const t=n&16777215,r=(n>>>24|e<<8)&16777215,i=e>>16&65535;let A=t+r*6777216+i*6710656,s=r+i*8147497,o=i*2;const a=1e7;return A>=a&&(s+=Math.floor(A/a),A%=a),s>=a&&(o+=Math.floor(s/a),s%=a),o.toString()+em(s)+em(A)}function ST(n,e){return{lo:n>>>0,hi:e>>>0}}function Wu(n,e){return{lo:n|0,hi:e|0}}function $g(n,e){return e=~e,n?n=~n+1:e+=1,Wu(n,e)}const em=n=>{const e=String(n);return"0000000".slice(e.length)+e};function tm(n,e){if(n>=0){for(;n>127;)e.push(n&127|128),n=n>>>7;e.push(n)}else{for(let t=0;t<9;t++)e.push(n&127|128),n=n>>7;e.push(1)}}function kT(){let n=this.buf[this.pos++],e=n&127;if(!(n&128))return this.assertBounds(),e;if(n=this.buf[this.pos++],e|=(n&127)<<7,!(n&128))return this.assertBounds(),e;if(n=this.buf[this.pos++],e|=(n&127)<<14,!(n&128))return this.assertBounds(),e;if(n=this.buf[this.pos++],e|=(n&127)<<21,!(n&128))return this.assertBounds(),e;n=this.buf[this.pos++],e|=(n&15)<<28;for(let t=5;n&128&&t<10;t++)n=this.buf[this.pos++];if(n&128)throw new Error("invalid varint");return this.assertBounds(),e>>>0}function ET(){const n=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof n.getBigInt64=="function"&&typeof n.getBigUint64=="function"&&typeof n.setBigInt64=="function"&&typeof n.setBigUint64=="function"&&(typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){const i=BigInt("-9223372036854775808"),A=BigInt("9223372036854775807"),s=BigInt("0"),o=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(a){const c=typeof a=="bigint"?a:BigInt(a);if(c>A||c<i)throw new Error("int64 invalid: ".concat(a));return c},uParse(a){const c=typeof a=="bigint"?a:BigInt(a);if(c>o||c<s)throw new Error("uint64 invalid: ".concat(a));return c},enc(a){return n.setBigInt64(0,this.parse(a),!0),{lo:n.getInt32(0,!0),hi:n.getInt32(4,!0)}},uEnc(a){return n.setBigInt64(0,this.uParse(a),!0),{lo:n.getInt32(0,!0),hi:n.getInt32(4,!0)}},dec(a,c){return n.setInt32(0,a,!0),n.setInt32(4,c,!0),n.getBigInt64(0,!0)},uDec(a,c){return n.setInt32(0,a,!0),n.setInt32(4,c,!0),n.getBigUint64(0,!0)}}}const t=i=>Je(/^-?[0-9]+$/.test(i),"int64 invalid: ".concat(i)),r=i=>Je(/^[0-9]+$/.test(i),"uint64 invalid: ".concat(i));return{zero:"0",supported:!1,parse(i){return typeof i!="string"&&(i=i.toString()),t(i),i},uParse(i){return typeof i!="string"&&(i=i.toString()),r(i),i},enc(i){return typeof i!="string"&&(i=i.toString()),t(i),Yg(i)},uEnc(i){return typeof i!="string"&&(i=i.toString()),r(i),Yg(i)},dec(i,A){return _T(i,A)},uDec(i,A){return Zg(i,A)}}}const Ne=ET();var R;(function(n){n[n.DOUBLE=1]="DOUBLE",n[n.FLOAT=2]="FLOAT",n[n.INT64=3]="INT64",n[n.UINT64=4]="UINT64",n[n.INT32=5]="INT32",n[n.FIXED64=6]="FIXED64",n[n.FIXED32=7]="FIXED32",n[n.BOOL=8]="BOOL",n[n.STRING=9]="STRING",n[n.BYTES=12]="BYTES",n[n.UINT32=13]="UINT32",n[n.SFIXED32=15]="SFIXED32",n[n.SFIXED64=16]="SFIXED64",n[n.SINT32=17]="SINT32",n[n.SINT64=18]="SINT64"})(R||(R={}));var or;(function(n){n[n.BIGINT=0]="BIGINT",n[n.STRING=1]="STRING"})(or||(or={}));function ar(n,e,t){if(e===t)return!0;if(n==R.BYTES){if(!(e instanceof Uint8Array)||!(t instanceof Uint8Array)||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}switch(n){case R.UINT64:case R.FIXED64:case R.INT64:case R.SFIXED64:case R.SINT64:return e==t}return!1}function Bi(n,e){switch(n){case R.BOOL:return!1;case R.UINT64:case R.FIXED64:case R.INT64:case R.SFIXED64:case R.SINT64:return e==0?Ne.zero:"0";case R.DOUBLE:case R.FLOAT:return 0;case R.BYTES:return new Uint8Array(0);case R.STRING:return"";default:return 0}}function nm(n,e){switch(n){case R.BOOL:return e===!1;case R.STRING:return e==="";case R.BYTES:return e instanceof Uint8Array&&!e.byteLength;default:return e==0}}var tt;(function(n){n[n.Varint=0]="Varint",n[n.Bit64=1]="Bit64",n[n.LengthDelimited=2]="LengthDelimited",n[n.StartGroup=3]="StartGroup",n[n.EndGroup=4]="EndGroup",n[n.Bit32=5]="Bit32"})(tt||(tt={}));class UT{constructor(e){this.stack=[],this.textEncoder=e??new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let e=0;for(let i=0;i<this.chunks.length;i++)e+=this.chunks[i].length;let t=new Uint8Array(e),r=0;for(let i=0;i<this.chunks.length;i++)t.set(this.chunks[i],r),r+=this.chunks[i].length;return this.chunks=[],t}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let e=this.finish(),t=this.stack.pop();if(!t)throw new Error("invalid state, fork stack empty");return this.chunks=t.chunks,this.buf=t.buf,this.uint32(e.byteLength),this.raw(e)}tag(e,t){return this.uint32((e<<3|t)>>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(Vu(e);e>127;)this.buf.push(e&127|128),e=e>>>7;return this.buf.push(e),this}int32(e){return To(e),tm(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let t=this.textEncoder.encode(e);return this.uint32(t.byteLength),this.raw(t)}float(e){Wg(e);let t=new Uint8Array(4);return new DataView(t.buffer).setFloat32(0,e,!0),this.raw(t)}double(e){let t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),this.raw(t)}fixed32(e){Vu(e);let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),this.raw(t)}sfixed32(e){To(e);let t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!0),this.raw(t)}sint32(e){return To(e),e=(e<<1^e>>31)>>>0,tm(e,this.buf),this}sfixed64(e){let t=new Uint8Array(8),r=new DataView(t.buffer),i=Ne.enc(e);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(t)}fixed64(e){let t=new Uint8Array(8),r=new DataView(t.buffer),i=Ne.uEnc(e);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(t)}int64(e){let t=Ne.enc(e);return ju(t.lo,t.hi,this.buf),this}sint64(e){let t=Ne.enc(e),r=t.hi>>31,i=t.lo<<1^r,A=(t.hi<<1|t.lo>>>31)^r;return ju(i,A,this.buf),this}uint64(e){let t=Ne.uEnc(e);return ju(t.lo,t.hi,this.buf),this}}class TT{constructor(e,t){this.varint64=CT,this.uint32=kT,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.textDecoder=t??new TextDecoder}tag(){let e=this.uint32(),t=e>>>3,r=e&7;if(t<=0||r<0||r>5)throw new Error("illegal tag: field no "+t+" wire type "+r);return[t,r]}skip(e,t){let r=this.pos;switch(e){case tt.Varint:for(;this.buf[this.pos++]&128;);break;case tt.Bit64:this.pos+=4;case tt.Bit32:this.pos+=4;break;case tt.LengthDelimited:let i=this.uint32();this.pos+=i;break;case tt.StartGroup:for(;;){const[A,s]=this.tag();if(s===tt.EndGroup){if(t!==void 0&&A!==t)throw new Error("invalid end group tag");break}this.skip(s,A)}break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(r,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return Ne.dec(...this.varint64())}uint64(){return Ne.uDec(...this.varint64())}sint64(){let[e,t]=this.varint64(),r=-(e&1);return e=(e>>>1|(t&1)<<31)^r,t=t>>>1^r,Ne.dec(e,t)}bool(){let[e,t]=this.varint64();return e!==0||t!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return Ne.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return Ne.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(){return this.textDecoder.decode(this.bytes())}}function IT(n,e,t,r){let i;return{typeName:e,extendee:t,get field(){if(!i){const A=typeof r=="function"?r():r;A.name=e.split(".").pop(),A.jsonName="[".concat(e,"]"),i=n.util.newFieldList([A]).list()[0]}return i},runtime:n}}function rm(n){const e=n.field.localName,t=Object.create(null);return t[e]=FT(n),[t,()=>t[e]]}function FT(n){const e=n.field;if(e.repeated)return[];if(e.default!==void 0)return e.default;switch(e.kind){case"enum":return e.T.values[0].no;case"scalar":return Bi(e.T,e.L);case"message":const t=e.T,r=new t;return t.fieldWrapper?t.fieldWrapper.unwrapField(r):r;case"map":throw"map fields are not allowed to be extensions"}}function xT(n,e){if(!e.repeated&&(e.kind=="enum"||e.kind=="scalar")){for(let t=n.length-1;t>=0;--t)if(n[t].no==e.no)return[n[t]];return[]}return n.filter(t=>t.no===e.no)}let On="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Fo=[];for(let n=0;n<On.length;n++)Fo[On[n].charCodeAt(0)]=n;Fo["-".charCodeAt(0)]=On.indexOf("+"),Fo["_".charCodeAt(0)]=On.indexOf("/");const im={dec(n){let e=n.length*3/4;n[n.length-2]=="="?e-=2:n[n.length-1]=="="&&(e-=1);let t=new Uint8Array(e),r=0,i=0,A,s=0;for(let o=0;o<n.length;o++){if(A=Fo[n.charCodeAt(o)],A===void 0)switch(n[o]){case"=":i=0;case`
10
+ `:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string.")}switch(i){case 0:s=A,i=1;break;case 1:t[r++]=s<<2|(A&48)>>4,s=A,i=2;break;case 2:t[r++]=(s&15)<<4|(A&60)>>2,s=A,i=3;break;case 3:t[r++]=(s&3)<<6|A,i=0;break}}if(i==1)throw Error("invalid base64 string.");return t.subarray(0,r)},enc(n){let e="",t=0,r,i=0;for(let A=0;A<n.length;A++)switch(r=n[A],t){case 0:e+=On[r>>2],i=(r&3)<<4,t=1;break;case 1:e+=On[i|r>>4],i=(r&15)<<2,t=2;break;case 2:e+=On[i|r>>6],e+=On[r&63],t=0;break}return t&&(e+=On[i],e+="=",t==1&&(e+="=")),e}};function QT(n,e,t){sm(e,n);const r=e.runtime.bin.makeReadOptions(t),i=xT(n.getType().runtime.bin.listUnknownFields(n),e.field),[A,s]=rm(e);for(const o of i)e.runtime.bin.readField(A,r.readerFactory(o.data),e.field,o.wireType,r);return s()}function RT(n,e,t,r){sm(e,n);const i=e.runtime.bin.makeReadOptions(r),A=e.runtime.bin.makeWriteOptions(r);if(Am(n,e)){const c=n.getType().runtime.bin.listUnknownFields(n).filter(u=>u.no!=e.field.no);n.getType().runtime.bin.discardUnknownFields(n);for(const u of c)n.getType().runtime.bin.onUnknownField(n,u.no,u.wireType,u.data)}const s=A.writerFactory();let o=e.field;!o.opt&&!o.repeated&&(o.kind=="enum"||o.kind=="scalar")&&(o=Object.assign(Object.assign({},e.field),{opt:!0})),e.runtime.bin.writeField(o,t,s,A);const a=i.readerFactory(s.finish());for(;a.pos<a.len;){const[c,u]=a.tag(),l=a.skip(u,c);n.getType().runtime.bin.onUnknownField(n,c,u,l)}}function Am(n,e){const t=n.getType();return e.extendee.typeName===t.typeName&&!!t.runtime.bin.listUnknownFields(n).find(r=>r.no==e.field.no)}function sm(n,e){Je(n.extendee.typeName==e.getType().typeName,"extension ".concat(n.typeName," can only be applied to message ").concat(n.extendee.typeName))}function om(n,e){const t=n.localName;if(n.repeated)return e[t].length>0;if(n.oneof)return e[n.oneof.localName].case===t;switch(n.kind){case"enum":case"scalar":return n.opt||n.req?e[t]!==void 0:n.kind=="enum"?e[t]!==n.T.values[0].no:!nm(n.T,e[t]);case"message":return e[t]!==void 0;case"map":return Object.keys(e[t]).length>0}}function am(n,e){const t=n.localName,r=!n.opt&&!n.req;if(n.repeated)e[t]=[];else if(n.oneof)e[n.oneof.localName]={case:void 0};else switch(n.kind){case"map":e[t]={};break;case"enum":e[t]=r?n.T.values[0].no:void 0;break;case"scalar":e[t]=r?Bi(n.T,n.L):void 0;break;case"message":e[t]=void 0;break}}function Hr(n,e){if(n===null||typeof n!="object"||!Object.getOwnPropertyNames(Gu.prototype).every(r=>r in n&&typeof n[r]=="function"))return!1;const t=n.getType();return t===null||typeof t!="function"||!("typeName"in t)||typeof t.typeName!="string"?!1:e===void 0?!0:t.typeName==e.typeName}function cm(n,e){return Hr(e)||!n.fieldWrapper?e:n.fieldWrapper.wrapField(e)}R.DOUBLE,R.FLOAT,R.INT64,R.UINT64,R.INT32,R.UINT32,R.BOOL,R.STRING,R.BYTES;const um={ignoreUnknownFields:!1},lm={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0};function PT(n){return n?Object.assign(Object.assign({},um),n):um}function OT(n){return n?Object.assign(Object.assign({},lm),n):lm}const xo=Symbol(),Qo=Symbol();function MT(){return{makeReadOptions:PT,makeWriteOptions:OT,readMessage(n,e,t,r){if(e==null||Array.isArray(e)||typeof e!="object")throw new Error("cannot decode message ".concat(n.typeName," from JSON: ").concat(Bn(e)));r=r??new n;const i=new Map,A=t.typeRegistry;for(const[s,o]of Object.entries(e)){const a=n.fields.findJsonName(s);if(a){if(a.oneof){if(o===null&&a.kind=="scalar")continue;const c=i.get(a.oneof);if(c!==void 0)throw new Error("cannot decode message ".concat(n.typeName,' from JSON: multiple keys for oneof "').concat(a.oneof.name,'" present: "').concat(c,'", "').concat(s,'"'));i.set(a.oneof,s)}dm(r,o,a,t,n)}else{let c=!1;if(A!=null&&A.findExtension&&s.startsWith("[")&&s.endsWith("]")){const u=A.findExtension(s.substring(1,s.length-1));if(u&&u.extendee.typeName==n.typeName){c=!0;const[l,d]=rm(u);dm(l,o,u.field,t,u),RT(r,u,d(),t)}}if(!c&&!t.ignoreUnknownFields)throw new Error("cannot decode message ".concat(n.typeName,' from JSON: key "').concat(s,'" is unknown'))}}return r},writeMessage(n,e){const t=n.getType(),r={};let i;try{for(i of t.fields.byNumber()){if(!om(i,n)){if(i.req)throw"required field not set";if(!e.emitDefaultValues||!DT(i))continue}const s=i.oneof?n[i.oneof.localName].value:n[i.localName],o=hm(i,s,e);o!==void 0&&(r[e.useProtoFieldName?i.name:i.jsonName]=o)}const A=e.typeRegistry;if(A!=null&&A.findExtensionFor)for(const s of t.runtime.bin.listUnknownFields(n)){const o=A.findExtensionFor(t.typeName,s.no);if(o&&Am(n,o)){const a=QT(n,o,e),c=hm(o.field,a,e);c!==void 0&&(r[o.field.jsonName]=c)}}}catch(A){const s=i?"cannot encode field ".concat(t.typeName,".").concat(i.name," to JSON"):"cannot encode message ".concat(t.typeName," to JSON"),o=A instanceof Error?A.message:String(A);throw new Error(s+(o.length>0?": ".concat(o):""))}return r},readScalar(n,e,t){return FA(n,e,t??or.BIGINT,!0)},writeScalar(n,e,t){if(e!==void 0&&(t||nm(n,e)))return Ro(n,e)},debug:Bn}}function Bn(n){if(n===null)return"null";switch(typeof n){case"object":return Array.isArray(n)?"array":"object";case"string":return n.length>100?"string":'"'.concat(n.split('"').join('\\"'),'"');default:return String(n)}}function dm(n,e,t,r,i){let A=t.localName;if(t.repeated){if(Je(t.kind!="map"),e===null)return;if(!Array.isArray(e))throw new Error("cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(Bn(e)));const s=n[A];for(const o of e){if(o===null)throw new Error("cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(Bn(o)));switch(t.kind){case"message":s.push(t.T.fromJson(o,r));break;case"enum":const a=qu(t.T,o,r.ignoreUnknownFields,!0);a!==Qo&&s.push(a);break;case"scalar":try{s.push(FA(t.T,o,t.L,!0))}catch(c){let u="cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(Bn(o));throw c instanceof Error&&c.message.length>0&&(u+=": ".concat(c.message)),new Error(u)}break}}}else if(t.kind=="map"){if(e===null)return;if(typeof e!="object"||Array.isArray(e))throw new Error("cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(Bn(e)));const s=n[A];for(const[o,a]of Object.entries(e)){if(a===null)throw new Error("cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: map value null"));let c;try{c=LT(t.K,o)}catch(u){let l="cannot decode map key for field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(Bn(e));throw u instanceof Error&&u.message.length>0&&(l+=": ".concat(u.message)),new Error(l)}switch(t.V.kind){case"message":s[c]=t.V.T.fromJson(a,r);break;case"enum":const u=qu(t.V.T,a,r.ignoreUnknownFields,!0);u!==Qo&&(s[c]=u);break;case"scalar":try{s[c]=FA(t.V.T,a,or.BIGINT,!0)}catch(l){let d="cannot decode map value for field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(Bn(e));throw l instanceof Error&&l.message.length>0&&(d+=": ".concat(l.message)),new Error(d)}break}}}else switch(t.oneof&&(n=n[t.oneof.localName]={case:A},A="value"),t.kind){case"message":const s=t.T;if(e===null&&s.typeName!="google.protobuf.Value")return;let o=n[A];Hr(o)?o.fromJson(e,r):(n[A]=o=s.fromJson(e,r),s.fieldWrapper&&!t.oneof&&(n[A]=s.fieldWrapper.unwrapField(o)));break;case"enum":const a=qu(t.T,e,r.ignoreUnknownFields,!1);switch(a){case xo:am(t,n);break;case Qo:break;default:n[A]=a;break}break;case"scalar":try{const c=FA(t.T,e,t.L,!1);switch(c){case xo:am(t,n);break;default:n[A]=c;break}}catch(c){let u="cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(Bn(e));throw c instanceof Error&&c.message.length>0&&(u+=": ".concat(c.message)),new Error(u)}break}}function LT(n,e){if(n===R.BOOL)switch(e){case"true":e=!0;break;case"false":e=!1;break}return FA(n,e,or.BIGINT,!0).toString()}function FA(n,e,t,r){if(e===null)return r?Bi(n,t):xo;switch(n){case R.DOUBLE:case R.FLOAT:if(e==="NaN")return Number.NaN;if(e==="Infinity")return Number.POSITIVE_INFINITY;if(e==="-Infinity")return Number.NEGATIVE_INFINITY;if(e===""||typeof e=="string"&&e.trim().length!==e.length||typeof e!="string"&&typeof e!="number")break;const i=Number(e);if(Number.isNaN(i)||!Number.isFinite(i))break;return n==R.FLOAT&&Wg(i),i;case R.INT32:case R.FIXED32:case R.SFIXED32:case R.SINT32:case R.UINT32:let A;if(typeof e=="number"?A=e:typeof e=="string"&&e.length>0&&e.trim().length===e.length&&(A=Number(e)),A===void 0)break;return n==R.UINT32||n==R.FIXED32?Vu(A):To(A),A;case R.INT64:case R.SFIXED64:case R.SINT64:if(typeof e!="number"&&typeof e!="string")break;const s=Ne.parse(e);return t?s.toString():s;case R.FIXED64:case R.UINT64:if(typeof e!="number"&&typeof e!="string")break;const o=Ne.uParse(e);return t?o.toString():o;case R.BOOL:if(typeof e!="boolean")break;return e;case R.STRING:if(typeof e!="string")break;try{encodeURIComponent(e)}catch{throw new Error("invalid UTF8")}return e;case R.BYTES:if(e==="")return new Uint8Array(0);if(typeof e!="string")break;return im.dec(e)}throw new Error}function qu(n,e,t,r){if(e===null)return n.typeName=="google.protobuf.NullValue"?0:r?n.values[0].no:xo;switch(typeof e){case"number":if(Number.isInteger(e))return e;break;case"string":const i=n.findName(e);if(i!==void 0)return i.no;if(t)return Qo;break}throw new Error("cannot decode enum ".concat(n.typeName," from JSON: ").concat(Bn(e)))}function DT(n){return n.repeated||n.kind=="map"?!0:!(n.oneof||n.kind=="message"||n.opt||n.req)}function hm(n,e,t){if(n.kind=="map"){Je(typeof e=="object"&&e!=null);const r={},i=Object.entries(e);switch(n.V.kind){case"scalar":for(const[s,o]of i)r[s.toString()]=Ro(n.V.T,o);break;case"message":for(const[s,o]of i)r[s.toString()]=o.toJson(t);break;case"enum":const A=n.V.T;for(const[s,o]of i)r[s.toString()]=Ju(A,o,t.enumAsInteger);break}return t.emitDefaultValues||i.length>0?r:void 0}if(n.repeated){Je(Array.isArray(e));const r=[];switch(n.kind){case"scalar":for(let i=0;i<e.length;i++)r.push(Ro(n.T,e[i]));break;case"enum":for(let i=0;i<e.length;i++)r.push(Ju(n.T,e[i],t.enumAsInteger));break;case"message":for(let i=0;i<e.length;i++)r.push(e[i].toJson(t));break}return t.emitDefaultValues||r.length>0?r:void 0}switch(n.kind){case"scalar":return Ro(n.T,e);case"enum":return Ju(n.T,e,t.enumAsInteger);case"message":return cm(n.T,e).toJson(t)}}function Ju(n,e,t){var r;if(Je(typeof e=="number"),n.typeName=="google.protobuf.NullValue")return null;if(t)return e;const i=n.findNumber(e);return(r=i==null?void 0:i.name)!==null&&r!==void 0?r:e}function Ro(n,e){switch(n){case R.INT32:case R.SFIXED32:case R.SINT32:case R.FIXED32:case R.UINT32:return Je(typeof e=="number"),e;case R.FLOAT:case R.DOUBLE:return Je(typeof e=="number"),Number.isNaN(e)?"NaN":e===Number.POSITIVE_INFINITY?"Infinity":e===Number.NEGATIVE_INFINITY?"-Infinity":e;case R.STRING:return Je(typeof e=="string"),e;case R.BOOL:return Je(typeof e=="boolean"),e;case R.UINT64:case R.FIXED64:case R.INT64:case R.SFIXED64:case R.SINT64:return Je(typeof e=="bigint"||typeof e=="string"||typeof e=="number"),e.toString();case R.BYTES:return Je(e instanceof Uint8Array),im.enc(e)}}const Ci=Symbol("@bufbuild/protobuf/unknown-fields"),pm={readUnknownFields:!0,readerFactory:n=>new TT(n)},fm={writeUnknownFields:!0,writerFactory:()=>new UT};function HT(n){return n?Object.assign(Object.assign({},pm),n):pm}function NT(n){return n?Object.assign(Object.assign({},fm),n):fm}function KT(){return{makeReadOptions:HT,makeWriteOptions:NT,listUnknownFields(n){var e;return(e=n[Ci])!==null&&e!==void 0?e:[]},discardUnknownFields(n){delete n[Ci]},writeUnknownFields(n,e){const r=n[Ci];if(r)for(const i of r)e.tag(i.no,i.wireType).raw(i.data)},onUnknownField(n,e,t,r){const i=n;Array.isArray(i[Ci])||(i[Ci]=[]),i[Ci].push({no:e,wireType:t,data:r})},readMessage(n,e,t,r,i){const A=n.getType(),s=i?e.len:e.pos+t;let o,a;for(;e.pos<s&&([o,a]=e.tag(),!(i===!0&&a==tt.EndGroup));){const c=A.fields.find(o);if(!c){const u=e.skip(a,o);r.readUnknownFields&&this.onUnknownField(n,o,a,u);continue}gm(n,e,c,a,r)}if(i&&(a!=tt.EndGroup||o!==t))throw new Error("invalid end group tag")},readField:gm,writeMessage(n,e,t){const r=n.getType();for(const i of r.fields.byNumber()){if(!om(i,n)){if(i.req)throw new Error("cannot encode field ".concat(r.typeName,".").concat(i.name," to binary: required field not set"));continue}const A=i.oneof?n[i.oneof.localName].value:n[i.localName];mm(i,A,e,t)}return t.writeUnknownFields&&this.writeUnknownFields(n,e),e},writeField(n,e,t,r){e!==void 0&&mm(n,e,t,r)}}}function gm(n,e,t,r,i){let{repeated:A,localName:s}=t;switch(t.oneof&&(n=n[t.oneof.localName],n.case!=s&&delete n.value,n.case=s,s="value"),t.kind){case"scalar":case"enum":const o=t.kind=="enum"?R.INT32:t.T;let a=Oo;if(t.kind=="scalar"&&t.L>0&&(a=GT),A){let d=n[s];if(r==tt.LengthDelimited&&o!=R.STRING&&o!=R.BYTES){let f=e.uint32()+e.pos;for(;e.pos<f;)d.push(a(e,o))}else d.push(a(e,o))}else n[s]=a(e,o);break;case"message":const c=t.T;A?n[s].push(Po(e,new c,i,t)):Hr(n[s])?Po(e,n[s],i,t):(n[s]=Po(e,new c,i,t),c.fieldWrapper&&!t.oneof&&!t.repeated&&(n[s]=c.fieldWrapper.unwrapField(n[s])));break;case"map":let[u,l]=VT(t,e,i);n[s][u]=l;break}}function Po(n,e,t,r){const i=e.getType().runtime.bin,A=r==null?void 0:r.delimited;return i.readMessage(e,n,A?r.no:n.uint32(),t,A),e}function VT(n,e,t){const r=e.uint32(),i=e.pos+r;let A,s;for(;e.pos<i;){const[o]=e.tag();switch(o){case 1:A=Oo(e,n.K);break;case 2:switch(n.V.kind){case"scalar":s=Oo(e,n.V.T);break;case"enum":s=e.int32();break;case"message":s=Po(e,new n.V.T,t,void 0);break}break}}if(A===void 0&&(A=Bi(n.K,or.BIGINT)),typeof A!="string"&&typeof A!="number"&&(A=A.toString()),s===void 0)switch(n.V.kind){case"scalar":s=Bi(n.V.T,or.BIGINT);break;case"enum":s=n.V.T.values[0].no;break;case"message":s=new n.V.T;break}return[A,s]}function GT(n,e){const t=Oo(n,e);return typeof t=="bigint"?t.toString():t}function Oo(n,e){switch(e){case R.STRING:return n.string();case R.BOOL:return n.bool();case R.DOUBLE:return n.double();case R.FLOAT:return n.float();case R.INT32:return n.int32();case R.INT64:return n.int64();case R.UINT64:return n.uint64();case R.FIXED64:return n.fixed64();case R.BYTES:return n.bytes();case R.FIXED32:return n.fixed32();case R.SFIXED32:return n.sfixed32();case R.SFIXED64:return n.sfixed64();case R.SINT64:return n.sint64();case R.UINT32:return n.uint32();case R.SINT32:return n.sint32()}}function mm(n,e,t,r){Je(e!==void 0);const i=n.repeated;switch(n.kind){case"scalar":case"enum":let A=n.kind=="enum"?R.INT32:n.T;if(i)if(Je(Array.isArray(e)),n.packed)WT(t,A,n.no,e);else for(const s of e)xA(t,A,n.no,s);else xA(t,A,n.no,e);break;case"message":if(i){Je(Array.isArray(e));for(const s of e)vm(t,r,n,s)}else vm(t,r,n,e);break;case"map":Je(typeof e=="object"&&e!=null);for(const[s,o]of Object.entries(e))jT(t,r,n,s,o);break}}function jT(n,e,t,r,i){n.tag(t.no,tt.LengthDelimited),n.fork();let A=r;switch(t.K){case R.INT32:case R.FIXED32:case R.UINT32:case R.SFIXED32:case R.SINT32:A=Number.parseInt(r);break;case R.BOOL:Je(r=="true"||r=="false"),A=r=="true";break}switch(xA(n,t.K,1,A),t.V.kind){case"scalar":xA(n,t.V.T,2,i);break;case"enum":xA(n,R.INT32,2,i);break;case"message":Je(i!==void 0),n.tag(2,tt.LengthDelimited).bytes(i.toBinary(e));break}n.join()}function vm(n,e,t,r){const i=cm(t.T,r);t.delimited?n.tag(t.no,tt.StartGroup).raw(i.toBinary(e)).tag(t.no,tt.EndGroup):n.tag(t.no,tt.LengthDelimited).bytes(i.toBinary(e))}function xA(n,e,t,r){Je(r!==void 0);let[i,A]=ym(e);n.tag(t,i)[A](r)}function WT(n,e,t,r){if(!r.length)return;n.tag(t,tt.LengthDelimited).fork();let[,i]=ym(e);for(let A=0;A<r.length;A++)n[i](r[A]);n.join()}function ym(n){let e=tt.Varint;switch(n){case R.BYTES:case R.STRING:e=tt.LengthDelimited;break;case R.DOUBLE:case R.FIXED64:case R.SFIXED64:e=tt.Bit64;break;case R.FIXED32:case R.SFIXED32:case R.FLOAT:e=tt.Bit32;break}const t=R[n].toLowerCase();return[e,t]}function qT(){return{setEnumType:Jg,initPartial(n,e){if(n===void 0)return;const t=e.getType();for(const r of t.fields.byMember()){const i=r.localName,A=e,s=n;if(s[i]!=null)switch(r.kind){case"oneof":const o=s[i].case;if(o===void 0)continue;const a=r.findField(o);let c=s[i].value;a&&a.kind=="message"&&!Hr(c,a.T)?c=new a.T(c):a&&a.kind==="scalar"&&a.T===R.BYTES&&(c=QA(c)),A[i]={case:o,value:c};break;case"scalar":case"enum":let u=s[i];r.T===R.BYTES&&(u=r.repeated?u.map(QA):QA(u)),A[i]=u;break;case"map":switch(r.V.kind){case"scalar":case"enum":if(r.V.T===R.BYTES)for(const[h,f]of Object.entries(s[i]))A[i][h]=QA(f);else Object.assign(A[i],s[i]);break;case"message":const d=r.V.T;for(const h of Object.keys(s[i])){let f=s[i][h];d.fieldWrapper||(f=new d(f)),A[i][h]=f}break}break;case"message":const l=r.T;if(r.repeated)A[i]=s[i].map(d=>Hr(d,l)?d:new l(d));else{const d=s[i];l.fieldWrapper?l.typeName==="google.protobuf.BytesValue"?A[i]=QA(d):A[i]=d:A[i]=Hr(d,l)?d:new l(d)}break}}},equals(n,e,t){return e===t?!0:!e||!t?!1:n.fields.byMember().every(r=>{const i=e[r.localName],A=t[r.localName];if(r.repeated){if(i.length!==A.length)return!1;switch(r.kind){case"message":return i.every((s,o)=>r.T.equals(s,A[o]));case"scalar":return i.every((s,o)=>ar(r.T,s,A[o]));case"enum":return i.every((s,o)=>ar(R.INT32,s,A[o]))}throw new Error("repeated cannot contain ".concat(r.kind))}switch(r.kind){case"message":return r.T.equals(i,A);case"enum":return ar(R.INT32,i,A);case"scalar":return ar(r.T,i,A);case"oneof":if(i.case!==A.case)return!1;const s=r.findField(i.case);if(s===void 0)return!0;switch(s.kind){case"message":return s.T.equals(i.value,A.value);case"enum":return ar(R.INT32,i.value,A.value);case"scalar":return ar(s.T,i.value,A.value)}throw new Error("oneof cannot contain ".concat(s.kind));case"map":const o=Object.keys(i).concat(Object.keys(A));switch(r.V.kind){case"message":const a=r.V.T;return o.every(u=>a.equals(i[u],A[u]));case"enum":return o.every(u=>ar(R.INT32,i[u],A[u]));case"scalar":const c=r.V.T;return o.every(u=>ar(c,i[u],A[u]))}break}})},clone(n){const e=n.getType(),t=new e,r=t;for(const i of e.fields.byMember()){const A=n[i.localName];let s;if(i.repeated)s=A.map(Mo);else if(i.kind=="map"){s=r[i.localName];for(const[o,a]of Object.entries(A))s[o]=Mo(a)}else i.kind=="oneof"?s=i.findField(A.case)?{case:A.case,value:Mo(A.value)}:{case:void 0}:s=Mo(A);r[i.localName]=s}for(const i of e.runtime.bin.listUnknownFields(n))e.runtime.bin.onUnknownField(r,i.no,i.wireType,i.data);return t}}}function Mo(n){if(n===void 0)return n;if(Hr(n))return n.clone();if(n instanceof Uint8Array){const e=new Uint8Array(n.byteLength);return e.set(n),e}return n}function QA(n){return n instanceof Uint8Array?n:new Uint8Array(n)}function JT(n,e,t){return{syntax:n,json:MT(),bin:KT(),util:Object.assign(Object.assign({},qT()),{newFieldList:e,initFields:t}),makeMessageType(r,i,A){return BT(this,r,i,A)},makeEnum:bT,makeEnumType:zg,getEnumType:wT,makeExtension(r,i,A){return IT(this,r,i,A)}}}class zT{constructor(e,t){this._fields=e,this._normalizer=t}findJsonName(e){if(!this.jsonNames){const t={};for(const r of this.list())t[r.jsonName]=t[r.name]=r;this.jsonNames=t}return this.jsonNames[e]}find(e){if(!this.numbers){const t={};for(const r of this.list())t[r.no]=r;this.numbers=t}return this.numbers[e]}list(){return this.all||(this.all=this._normalizer(this._fields)),this.all}byNumber(){return this.numbersAsc||(this.numbersAsc=this.list().concat().sort((e,t)=>e.no-t.no)),this.numbersAsc}byMember(){if(!this.members){this.members=[];const e=this.members;let t;for(const r of this.list())r.oneof?r.oneof!==t&&(t=r.oneof,e.push(t)):e.push(r)}return this.members}}function wm(n,e){const t=bm(n);return e?t:tI(eI(t))}function XT(n){return wm(n,!1)}const YT=bm;function bm(n){let e=!1;const t=[];for(let r=0;r<n.length;r++){let i=n.charAt(r);switch(i){case"_":e=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":t.push(i),e=!1;break;default:e&&(e=!1,i=i.toUpperCase()),t.push(i);break}}return t.join("")}const ZT=new Set(["constructor","toString","toJSON","valueOf"]),$T=new Set(["getType","clone","equals","fromBinary","fromJson","fromJsonString","toBinary","toJson","toJsonString","toObject"]),Bm=n=>"".concat(n,"$"),eI=n=>$T.has(n)?Bm(n):n,tI=n=>ZT.has(n)?Bm(n):n;class nI{constructor(e){this.kind="oneof",this.repeated=!1,this.packed=!1,this.opt=!1,this.req=!1,this.default=void 0,this.fields=[],this.name=e,this.localName=XT(e)}addField(e){Je(e.oneof===this,"field ".concat(e.name," not one of ").concat(this.name)),this.fields.push(e)}findField(e){if(!this._lookup){this._lookup=Object.create(null);for(let t=0;t<this.fields.length;t++)this._lookup[this.fields[t].localName]=this.fields[t]}return this._lookup[e]}}function rI(n,e){var t,r,i,A,s,o;const a=[];let c;for(const u of typeof n=="function"?n():n){const l=u;if(l.localName=wm(u.name,u.oneof!==void 0),l.jsonName=(t=u.jsonName)!==null&&t!==void 0?t:YT(u.name),l.repeated=(r=u.repeated)!==null&&r!==void 0?r:!1,u.kind=="scalar"&&(l.L=(i=u.L)!==null&&i!==void 0?i:or.BIGINT),l.delimited=(A=u.delimited)!==null&&A!==void 0?A:!1,l.req=(s=u.req)!==null&&s!==void 0?s:!1,l.opt=(o=u.opt)!==null&&o!==void 0?o:!1,u.packed===void 0&&(l.packed=u.kind=="enum"||u.kind=="scalar"&&u.T!=R.BYTES&&u.T!=R.STRING),u.oneof!==void 0){const d=typeof u.oneof=="string"?u.oneof:u.oneof.name;(!c||c.name!=d)&&(c=new nI(d)),l.oneof=c,c.addField(l)}a.push(l)}return a}const U=JT("proto3",n=>new zT(n,e=>rI(e)),n=>{for(const e of n.getType().fields.byMember()){if(e.opt)continue;const t=e.localName,r=n;if(e.repeated){r[t]=[];continue}switch(e.kind){case"oneof":r[t]={case:void 0};break;case"enum":r[t]=0;break;case"map":r[t]={};break;case"scalar":r[t]=Bi(e.T,e.L);break}}});class Mt extends Gu{constructor(e){super(),this.seconds=Ne.zero,this.nanos=0,U.util.initPartial(e,this)}fromJson(e,t){if(typeof e!="string")throw new Error("cannot decode google.protobuf.Timestamp from JSON: ".concat(U.json.debug(e)));const r=e.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!r)throw new Error("cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string");const i=Date.parse(r[1]+"-"+r[2]+"-"+r[3]+"T"+r[4]+":"+r[5]+":"+r[6]+(r[8]?r[8]:"Z"));if(Number.isNaN(i))throw new Error("cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string");if(i<Date.parse("0001-01-01T00:00:00Z")||i>Date.parse("9999-12-31T23:59:59Z"))throw new Error("cannot decode message google.protobuf.Timestamp from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive");return this.seconds=Ne.parse(i/1e3),this.nanos=0,r[7]&&(this.nanos=parseInt("1"+r[7]+"0".repeat(9-r[7].length))-1e9),this}toJson(e){const t=Number(this.seconds)*1e3;if(t<Date.parse("0001-01-01T00:00:00Z")||t>Date.parse("9999-12-31T23:59:59Z"))throw new Error("cannot encode google.protobuf.Timestamp to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive");if(this.nanos<0)throw new Error("cannot encode google.protobuf.Timestamp to JSON: nanos must not be negative");let r="Z";if(this.nanos>0){const i=(this.nanos+1e9).toString().substring(1);i.substring(3)==="000000"?r="."+i.substring(0,3)+"Z":i.substring(6)==="000"?r="."+i.substring(0,6)+"Z":r="."+i+"Z"}return new Date(t).toISOString().replace(".000Z",r)}toDate(){return new Date(Number(this.seconds)*1e3+Math.ceil(this.nanos/1e6))}static now(){return Mt.fromDate(new Date)}static fromDate(e){const t=e.getTime();return new Mt({seconds:Ne.parse(Math.floor(t/1e3)),nanos:t%1e3*1e6})}static fromBinary(e,t){return new Mt().fromBinary(e,t)}static fromJson(e,t){return new Mt().fromJson(e,t)}static fromJsonString(e,t){return new Mt().fromJsonString(e,t)}static equals(e,t){return U.util.equals(Mt,e,t)}}Mt.runtime=U,Mt.typeName="google.protobuf.Timestamp",Mt.fields=U.util.newFieldList(()=>[{no:1,name:"seconds",kind:"scalar",T:3},{no:2,name:"nanos",kind:"scalar",T:5}]);const iI=U.makeMessageType("livekit.MetricsBatch",()=>[{no:1,name:"timestamp_ms",kind:"scalar",T:3},{no:2,name:"normalized_timestamp",kind:"message",T:Mt},{no:3,name:"str_data",kind:"scalar",T:9,repeated:!0},{no:4,name:"time_series",kind:"message",T:AI,repeated:!0},{no:5,name:"events",kind:"message",T:oI,repeated:!0}]),AI=U.makeMessageType("livekit.TimeSeriesMetric",()=>[{no:1,name:"label",kind:"scalar",T:13},{no:2,name:"participant_identity",kind:"scalar",T:13},{no:3,name:"track_sid",kind:"scalar",T:13},{no:4,name:"samples",kind:"message",T:sI,repeated:!0},{no:5,name:"rid",kind:"scalar",T:13}]),sI=U.makeMessageType("livekit.MetricSample",()=>[{no:1,name:"timestamp_ms",kind:"scalar",T:3},{no:2,name:"normalized_timestamp",kind:"message",T:Mt},{no:3,name:"value",kind:"scalar",T:2}]),oI=U.makeMessageType("livekit.EventMetric",()=>[{no:1,name:"label",kind:"scalar",T:13},{no:2,name:"participant_identity",kind:"scalar",T:13},{no:3,name:"track_sid",kind:"scalar",T:13},{no:4,name:"start_timestamp_ms",kind:"scalar",T:3},{no:5,name:"end_timestamp_ms",kind:"scalar",T:3,opt:!0},{no:6,name:"normalized_start_timestamp",kind:"message",T:Mt},{no:7,name:"normalized_end_timestamp",kind:"message",T:Mt,opt:!0},{no:8,name:"metadata",kind:"scalar",T:9},{no:9,name:"rid",kind:"scalar",T:13}]),Cm=U.makeEnum("livekit.BackupCodecPolicy",[{no:0,name:"PREFER_REGRESSION"},{no:1,name:"SIMULCAST"},{no:2,name:"REGRESSION"}]),rn=U.makeEnum("livekit.TrackType",[{no:0,name:"AUDIO"},{no:1,name:"VIDEO"},{no:2,name:"DATA"}]),ot=U.makeEnum("livekit.TrackSource",[{no:0,name:"UNKNOWN"},{no:1,name:"CAMERA"},{no:2,name:"MICROPHONE"},{no:3,name:"SCREEN_SHARE"},{no:4,name:"SCREEN_SHARE_AUDIO"}]),_i=U.makeEnum("livekit.VideoQuality",[{no:0,name:"LOW"},{no:1,name:"MEDIUM"},{no:2,name:"HIGH"},{no:3,name:"OFF"}]),RA=U.makeEnum("livekit.ConnectionQuality",[{no:0,name:"POOR"},{no:1,name:"GOOD"},{no:2,name:"EXCELLENT"},{no:3,name:"LOST"}]),PA=U.makeEnum("livekit.ClientConfigSetting",[{no:0,name:"UNSET"},{no:1,name:"DISABLED"},{no:2,name:"ENABLED"}]),An=U.makeEnum("livekit.DisconnectReason",[{no:0,name:"UNKNOWN_REASON"},{no:1,name:"CLIENT_INITIATED"},{no:2,name:"DUPLICATE_IDENTITY"},{no:3,name:"SERVER_SHUTDOWN"},{no:4,name:"PARTICIPANT_REMOVED"},{no:5,name:"ROOM_DELETED"},{no:6,name:"STATE_MISMATCH"},{no:7,name:"JOIN_FAILURE"},{no:8,name:"MIGRATION"},{no:9,name:"SIGNAL_CLOSE"},{no:10,name:"ROOM_CLOSED"},{no:11,name:"USER_UNAVAILABLE"},{no:12,name:"USER_REJECTED"},{no:13,name:"SIP_TRUNK_FAILURE"},{no:14,name:"CONNECTION_TIMEOUT"}]),Si=U.makeEnum("livekit.ReconnectReason",[{no:0,name:"RR_UNKNOWN"},{no:1,name:"RR_SIGNAL_DISCONNECTED"},{no:2,name:"RR_PUBLISHER_FAILED"},{no:3,name:"RR_SUBSCRIBER_FAILED"},{no:4,name:"RR_SWITCH_CANDIDATE"}]),aI=U.makeEnum("livekit.SubscriptionError",[{no:0,name:"SE_UNKNOWN"},{no:1,name:"SE_CODEC_UNSUPPORTED"},{no:2,name:"SE_TRACK_NOTFOUND"}]),sn=U.makeEnum("livekit.AudioTrackFeature",[{no:0,name:"TF_STEREO"},{no:1,name:"TF_NO_DTX"},{no:2,name:"TF_AUTO_GAIN_CONTROL"},{no:3,name:"TF_ECHO_CANCELLATION"},{no:4,name:"TF_NOISE_SUPPRESSION"},{no:5,name:"TF_ENHANCED_NOISE_CANCELLATION"},{no:6,name:"TF_PRECONNECT_BUFFER"}]),Lo=U.makeMessageType("livekit.Room",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"empty_timeout",kind:"scalar",T:13},{no:14,name:"departure_timeout",kind:"scalar",T:13},{no:4,name:"max_participants",kind:"scalar",T:13},{no:5,name:"creation_time",kind:"scalar",T:3},{no:15,name:"creation_time_ms",kind:"scalar",T:3},{no:6,name:"turn_password",kind:"scalar",T:9},{no:7,name:"enabled_codecs",kind:"message",T:Do,repeated:!0},{no:8,name:"metadata",kind:"scalar",T:9},{no:9,name:"num_participants",kind:"scalar",T:13},{no:11,name:"num_publishers",kind:"scalar",T:13},{no:10,name:"active_recording",kind:"scalar",T:8},{no:13,name:"version",kind:"message",T:Om}]),Do=U.makeMessageType("livekit.Codec",()=>[{no:1,name:"mime",kind:"scalar",T:9},{no:2,name:"fmtp_line",kind:"scalar",T:9}]),cI=U.makeMessageType("livekit.ParticipantPermission",()=>[{no:1,name:"can_subscribe",kind:"scalar",T:8},{no:2,name:"can_publish",kind:"scalar",T:8},{no:3,name:"can_publish_data",kind:"scalar",T:8},{no:9,name:"can_publish_sources",kind:"enum",T:U.getEnumType(ot),repeated:!0},{no:7,name:"hidden",kind:"scalar",T:8},{no:8,name:"recorder",kind:"scalar",T:8},{no:10,name:"can_update_metadata",kind:"scalar",T:8},{no:11,name:"agent",kind:"scalar",T:8},{no:12,name:"can_subscribe_metrics",kind:"scalar",T:8}]),Nr=U.makeMessageType("livekit.ParticipantInfo",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"identity",kind:"scalar",T:9},{no:3,name:"state",kind:"enum",T:U.getEnumType(ki)},{no:4,name:"tracks",kind:"message",T:Ei,repeated:!0},{no:5,name:"metadata",kind:"scalar",T:9},{no:6,name:"joined_at",kind:"scalar",T:3},{no:17,name:"joined_at_ms",kind:"scalar",T:3},{no:9,name:"name",kind:"scalar",T:9},{no:10,name:"version",kind:"scalar",T:13},{no:11,name:"permission",kind:"message",T:cI},{no:12,name:"region",kind:"scalar",T:9},{no:13,name:"is_publisher",kind:"scalar",T:8},{no:14,name:"kind",kind:"enum",T:U.getEnumType(Ho)},{no:15,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:16,name:"disconnect_reason",kind:"enum",T:U.getEnumType(An)},{no:18,name:"kind_details",kind:"enum",T:U.getEnumType(uI),repeated:!0}]),ki=U.makeEnum("livekit.ParticipantInfo.State",[{no:0,name:"JOINING"},{no:1,name:"JOINED"},{no:2,name:"ACTIVE"},{no:3,name:"DISCONNECTED"}]),Ho=U.makeEnum("livekit.ParticipantInfo.Kind",[{no:0,name:"STANDARD"},{no:1,name:"INGRESS"},{no:2,name:"EGRESS"},{no:3,name:"SIP"},{no:4,name:"AGENT"}]),uI=U.makeEnum("livekit.ParticipantInfo.KindDetail",[{no:0,name:"CLOUD_AGENT"},{no:1,name:"FORWARDED"}]),jt=U.makeEnum("livekit.Encryption.Type",[{no:0,name:"NONE"},{no:1,name:"GCM"},{no:2,name:"CUSTOM"}]),lI=U.makeMessageType("livekit.SimulcastCodecInfo",()=>[{no:1,name:"mime_type",kind:"scalar",T:9},{no:2,name:"mid",kind:"scalar",T:9},{no:3,name:"cid",kind:"scalar",T:9},{no:4,name:"layers",kind:"message",T:Kr,repeated:!0}]),Ei=U.makeMessageType("livekit.TrackInfo",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:U.getEnumType(rn)},{no:3,name:"name",kind:"scalar",T:9},{no:4,name:"muted",kind:"scalar",T:8},{no:5,name:"width",kind:"scalar",T:13},{no:6,name:"height",kind:"scalar",T:13},{no:7,name:"simulcast",kind:"scalar",T:8},{no:8,name:"disable_dtx",kind:"scalar",T:8},{no:9,name:"source",kind:"enum",T:U.getEnumType(ot)},{no:10,name:"layers",kind:"message",T:Kr,repeated:!0},{no:11,name:"mime_type",kind:"scalar",T:9},{no:12,name:"mid",kind:"scalar",T:9},{no:13,name:"codecs",kind:"message",T:lI,repeated:!0},{no:14,name:"stereo",kind:"scalar",T:8},{no:15,name:"disable_red",kind:"scalar",T:8},{no:16,name:"encryption",kind:"enum",T:U.getEnumType(jt)},{no:17,name:"stream",kind:"scalar",T:9},{no:18,name:"version",kind:"message",T:Om},{no:19,name:"audio_features",kind:"enum",T:U.getEnumType(sn),repeated:!0},{no:20,name:"backup_codec_policy",kind:"enum",T:U.getEnumType(Cm)}]),Kr=U.makeMessageType("livekit.VideoLayer",()=>[{no:1,name:"quality",kind:"enum",T:U.getEnumType(_i)},{no:2,name:"width",kind:"scalar",T:13},{no:3,name:"height",kind:"scalar",T:13},{no:4,name:"bitrate",kind:"scalar",T:13},{no:5,name:"ssrc",kind:"scalar",T:13}]),Lt=U.makeMessageType("livekit.DataPacket",()=>[{no:1,name:"kind",kind:"enum",T:U.getEnumType(he)},{no:4,name:"participant_identity",kind:"scalar",T:9},{no:5,name:"destination_identities",kind:"scalar",T:9,repeated:!0},{no:2,name:"user",kind:"message",T:Sm,oneof:"value"},{no:3,name:"speaker",kind:"message",T:dI,oneof:"value"},{no:6,name:"sip_dtmf",kind:"message",T:km,oneof:"value"},{no:7,name:"transcription",kind:"message",T:hI,oneof:"value"},{no:8,name:"metrics",kind:"message",T:iI,oneof:"value"},{no:9,name:"chat_message",kind:"message",T:zu,oneof:"value"},{no:10,name:"rpc_request",kind:"message",T:Em,oneof:"value"},{no:11,name:"rpc_ack",kind:"message",T:Um,oneof:"value"},{no:12,name:"rpc_response",kind:"message",T:Tm,oneof:"value"},{no:13,name:"stream_header",kind:"message",T:Yu,oneof:"value"},{no:14,name:"stream_chunk",kind:"message",T:Zu,oneof:"value"},{no:15,name:"stream_trailer",kind:"message",T:$u,oneof:"value"}]),he=U.makeEnum("livekit.DataPacket.Kind",[{no:0,name:"RELIABLE"},{no:1,name:"LOSSY"}]),dI=U.makeMessageType("livekit.ActiveSpeakerUpdate",()=>[{no:1,name:"speakers",kind:"message",T:_m,repeated:!0}]),_m=U.makeMessageType("livekit.SpeakerInfo",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"level",kind:"scalar",T:2},{no:3,name:"active",kind:"scalar",T:8}]),Sm=U.makeMessageType("livekit.UserPacket",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:5,name:"participant_identity",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",T:12},{no:3,name:"destination_sids",kind:"scalar",T:9,repeated:!0},{no:6,name:"destination_identities",kind:"scalar",T:9,repeated:!0},{no:4,name:"topic",kind:"scalar",T:9,opt:!0},{no:8,name:"id",kind:"scalar",T:9,opt:!0},{no:9,name:"start_time",kind:"scalar",T:4,opt:!0},{no:10,name:"end_time",kind:"scalar",T:4,opt:!0},{no:11,name:"nonce",kind:"scalar",T:12}]),km=U.makeMessageType("livekit.SipDTMF",()=>[{no:3,name:"code",kind:"scalar",T:13},{no:4,name:"digit",kind:"scalar",T:9}]),hI=U.makeMessageType("livekit.Transcription",()=>[{no:2,name:"transcribed_participant_identity",kind:"scalar",T:9},{no:3,name:"track_id",kind:"scalar",T:9},{no:4,name:"segments",kind:"message",T:pI,repeated:!0}]),pI=U.makeMessageType("livekit.TranscriptionSegment",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"text",kind:"scalar",T:9},{no:3,name:"start_time",kind:"scalar",T:4},{no:4,name:"end_time",kind:"scalar",T:4},{no:5,name:"final",kind:"scalar",T:8},{no:6,name:"language",kind:"scalar",T:9}]),zu=U.makeMessageType("livekit.ChatMessage",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"timestamp",kind:"scalar",T:3},{no:3,name:"edit_timestamp",kind:"scalar",T:3,opt:!0},{no:4,name:"message",kind:"scalar",T:9},{no:5,name:"deleted",kind:"scalar",T:8},{no:6,name:"generated",kind:"scalar",T:8}]),Em=U.makeMessageType("livekit.RpcRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"method",kind:"scalar",T:9},{no:3,name:"payload",kind:"scalar",T:9},{no:4,name:"response_timeout_ms",kind:"scalar",T:13},{no:5,name:"version",kind:"scalar",T:13}]),Um=U.makeMessageType("livekit.RpcAck",()=>[{no:1,name:"request_id",kind:"scalar",T:9}]),Tm=U.makeMessageType("livekit.RpcResponse",()=>[{no:1,name:"request_id",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",T:9,oneof:"value"},{no:3,name:"error",kind:"message",T:Im,oneof:"value"}]),Im=U.makeMessageType("livekit.RpcError",()=>[{no:1,name:"code",kind:"scalar",T:13},{no:2,name:"message",kind:"scalar",T:9},{no:3,name:"data",kind:"scalar",T:9}]),Fm=U.makeMessageType("livekit.ParticipantTracks",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sids",kind:"scalar",T:9,repeated:!0}]),fI=U.makeMessageType("livekit.ServerInfo",()=>[{no:1,name:"edition",kind:"enum",T:U.getEnumType(xm)},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"protocol",kind:"scalar",T:5},{no:4,name:"region",kind:"scalar",T:9},{no:5,name:"node_id",kind:"scalar",T:9},{no:6,name:"debug_info",kind:"scalar",T:9},{no:7,name:"agent_protocol",kind:"scalar",T:5}]),xm=U.makeEnum("livekit.ServerInfo.Edition",[{no:0,name:"Standard"},{no:1,name:"Cloud"}]),gI=U.makeMessageType("livekit.ClientInfo",()=>[{no:1,name:"sdk",kind:"enum",T:U.getEnumType(Qm)},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"protocol",kind:"scalar",T:5},{no:4,name:"os",kind:"scalar",T:9},{no:5,name:"os_version",kind:"scalar",T:9},{no:6,name:"device_model",kind:"scalar",T:9},{no:7,name:"browser",kind:"scalar",T:9},{no:8,name:"browser_version",kind:"scalar",T:9},{no:9,name:"address",kind:"scalar",T:9},{no:10,name:"network",kind:"scalar",T:9},{no:11,name:"other_sdks",kind:"scalar",T:9}]),Qm=U.makeEnum("livekit.ClientInfo.SDK",[{no:0,name:"UNKNOWN"},{no:1,name:"JS"},{no:2,name:"SWIFT"},{no:3,name:"ANDROID"},{no:4,name:"FLUTTER"},{no:5,name:"GO"},{no:6,name:"UNITY"},{no:7,name:"REACT_NATIVE"},{no:8,name:"RUST"},{no:9,name:"PYTHON"},{no:10,name:"CPP"},{no:11,name:"UNITY_WEB"},{no:12,name:"NODE"},{no:13,name:"UNREAL"}]),Rm=U.makeMessageType("livekit.ClientConfiguration",()=>[{no:1,name:"video",kind:"message",T:Pm},{no:2,name:"screen",kind:"message",T:Pm},{no:3,name:"resume_connection",kind:"enum",T:U.getEnumType(PA)},{no:4,name:"disabled_codecs",kind:"message",T:mI},{no:5,name:"force_relay",kind:"enum",T:U.getEnumType(PA)}]),Pm=U.makeMessageType("livekit.VideoConfiguration",()=>[{no:1,name:"hardware_encoder",kind:"enum",T:U.getEnumType(PA)}]),mI=U.makeMessageType("livekit.DisabledCodecs",()=>[{no:1,name:"codecs",kind:"message",T:Do,repeated:!0},{no:2,name:"publish",kind:"message",T:Do,repeated:!0}]),Om=U.makeMessageType("livekit.TimedVersion",()=>[{no:1,name:"unix_micro",kind:"scalar",T:3},{no:2,name:"ticks",kind:"scalar",T:5}]),Xu=U.makeEnum("livekit.DataStream.OperationType",[{no:0,name:"CREATE"},{no:1,name:"UPDATE"},{no:2,name:"DELETE"},{no:3,name:"REACTION"}]),Mm=U.makeMessageType("livekit.DataStream.TextHeader",()=>[{no:1,name:"operation_type",kind:"enum",T:U.getEnumType(Xu)},{no:2,name:"version",kind:"scalar",T:5},{no:3,name:"reply_to_stream_id",kind:"scalar",T:9},{no:4,name:"attached_stream_ids",kind:"scalar",T:9,repeated:!0},{no:5,name:"generated",kind:"scalar",T:8}],{localName:"DataStream_TextHeader"}),Lm=U.makeMessageType("livekit.DataStream.ByteHeader",()=>[{no:1,name:"name",kind:"scalar",T:9}],{localName:"DataStream_ByteHeader"}),Yu=U.makeMessageType("livekit.DataStream.Header",()=>[{no:1,name:"stream_id",kind:"scalar",T:9},{no:2,name:"timestamp",kind:"scalar",T:3},{no:3,name:"topic",kind:"scalar",T:9},{no:4,name:"mime_type",kind:"scalar",T:9},{no:5,name:"total_length",kind:"scalar",T:4,opt:!0},{no:7,name:"encryption_type",kind:"enum",T:U.getEnumType(jt)},{no:8,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:9,name:"text_header",kind:"message",T:Mm,oneof:"content_header"},{no:10,name:"byte_header",kind:"message",T:Lm,oneof:"content_header"}],{localName:"DataStream_Header"}),Zu=U.makeMessageType("livekit.DataStream.Chunk",()=>[{no:1,name:"stream_id",kind:"scalar",T:9},{no:2,name:"chunk_index",kind:"scalar",T:4},{no:3,name:"content",kind:"scalar",T:12},{no:4,name:"version",kind:"scalar",T:5},{no:5,name:"iv",kind:"scalar",T:12,opt:!0}],{localName:"DataStream_Chunk"}),$u=U.makeMessageType("livekit.DataStream.Trailer",()=>[{no:1,name:"stream_id",kind:"scalar",T:9},{no:2,name:"reason",kind:"scalar",T:9},{no:3,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}}],{localName:"DataStream_Trailer"}),on=U.makeEnum("livekit.SignalTarget",[{no:0,name:"PUBLISHER"},{no:1,name:"SUBSCRIBER"}]),el=U.makeEnum("livekit.StreamState",[{no:0,name:"ACTIVE"},{no:1,name:"PAUSED"}]),vI=U.makeEnum("livekit.CandidateProtocol",[{no:0,name:"UDP"},{no:1,name:"TCP"},{no:2,name:"TLS"}]),yI=U.makeMessageType("livekit.SignalRequest",()=>[{no:1,name:"offer",kind:"message",T:Vr,oneof:"message"},{no:2,name:"answer",kind:"message",T:Vr,oneof:"message"},{no:3,name:"trickle",kind:"message",T:rl,oneof:"message"},{no:4,name:"add_track",kind:"message",T:nl,oneof:"message"},{no:5,name:"mute",kind:"message",T:il,oneof:"message"},{no:6,name:"subscription",kind:"message",T:No,oneof:"message"},{no:7,name:"track_setting",kind:"message",T:Hm,oneof:"message"},{no:8,name:"leave",kind:"message",T:Ko,oneof:"message"},{no:10,name:"update_layers",kind:"message",T:Km,oneof:"message"},{no:11,name:"subscription_permission",kind:"message",T:Wm,oneof:"message"},{no:12,name:"sync_state",kind:"message",T:qm,oneof:"message"},{no:13,name:"simulate",kind:"message",T:Cn,oneof:"message"},{no:14,name:"ping",kind:"scalar",T:3,oneof:"message"},{no:15,name:"update_metadata",kind:"message",T:Vm,oneof:"message"},{no:16,name:"ping_req",kind:"message",T:zm,oneof:"message"},{no:17,name:"update_audio_track",kind:"message",T:Nm,oneof:"message"},{no:18,name:"update_video_track",kind:"message",T:_I,oneof:"message"}]),Dm=U.makeMessageType("livekit.SignalResponse",()=>[{no:1,name:"join",kind:"message",T:wI,oneof:"message"},{no:2,name:"answer",kind:"message",T:Vr,oneof:"message"},{no:3,name:"offer",kind:"message",T:Vr,oneof:"message"},{no:4,name:"trickle",kind:"message",T:rl,oneof:"message"},{no:5,name:"update",kind:"message",T:CI,oneof:"message"},{no:6,name:"track_published",kind:"message",T:Al,oneof:"message"},{no:8,name:"leave",kind:"message",T:Ko,oneof:"message"},{no:9,name:"mute",kind:"message",T:il,oneof:"message"},{no:10,name:"speakers_changed",kind:"message",T:SI,oneof:"message"},{no:11,name:"room_update",kind:"message",T:kI,oneof:"message"},{no:12,name:"connection_quality",kind:"message",T:UI,oneof:"message"},{no:13,name:"stream_state_update",kind:"message",T:II,oneof:"message"},{no:14,name:"subscribed_quality_update",kind:"message",T:xI,oneof:"message"},{no:15,name:"subscription_permission_update",kind:"message",T:QI,oneof:"message"},{no:16,name:"refresh_token",kind:"scalar",T:9,oneof:"message"},{no:17,name:"track_unpublished",kind:"message",T:BI,oneof:"message"},{no:18,name:"pong",kind:"scalar",T:3,oneof:"message"},{no:19,name:"reconnect",kind:"message",T:bI,oneof:"message"},{no:20,name:"pong_resp",kind:"message",T:PI,oneof:"message"},{no:21,name:"subscription_response",kind:"message",T:LI,oneof:"message"},{no:22,name:"request_response",kind:"message",T:DI,oneof:"message"},{no:23,name:"track_subscribed",kind:"message",T:HI,oneof:"message"},{no:24,name:"room_moved",kind:"message",T:RI,oneof:"message"}]),tl=U.makeMessageType("livekit.SimulcastCodec",()=>[{no:1,name:"codec",kind:"scalar",T:9},{no:2,name:"cid",kind:"scalar",T:9}]),nl=U.makeMessageType("livekit.AddTrackRequest",()=>[{no:1,name:"cid",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"type",kind:"enum",T:U.getEnumType(rn)},{no:4,name:"width",kind:"scalar",T:13},{no:5,name:"height",kind:"scalar",T:13},{no:6,name:"muted",kind:"scalar",T:8},{no:7,name:"disable_dtx",kind:"scalar",T:8},{no:8,name:"source",kind:"enum",T:U.getEnumType(ot)},{no:9,name:"layers",kind:"message",T:Kr,repeated:!0},{no:10,name:"simulcast_codecs",kind:"message",T:tl,repeated:!0},{no:11,name:"sid",kind:"scalar",T:9},{no:12,name:"stereo",kind:"scalar",T:8},{no:13,name:"disable_red",kind:"scalar",T:8},{no:14,name:"encryption",kind:"enum",T:U.getEnumType(jt)},{no:15,name:"stream",kind:"scalar",T:9},{no:16,name:"backup_codec_policy",kind:"enum",T:U.getEnumType(Cm)},{no:17,name:"audio_features",kind:"enum",T:U.getEnumType(sn),repeated:!0}]),rl=U.makeMessageType("livekit.TrickleRequest",()=>[{no:1,name:"candidateInit",kind:"scalar",T:9},{no:2,name:"target",kind:"enum",T:U.getEnumType(on)},{no:3,name:"final",kind:"scalar",T:8}]),il=U.makeMessageType("livekit.MuteTrackRequest",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"muted",kind:"scalar",T:8}]),wI=U.makeMessageType("livekit.JoinResponse",()=>[{no:1,name:"room",kind:"message",T:Lo},{no:2,name:"participant",kind:"message",T:Nr},{no:3,name:"other_participants",kind:"message",T:Nr,repeated:!0},{no:4,name:"server_version",kind:"scalar",T:9},{no:5,name:"ice_servers",kind:"message",T:Gm,repeated:!0},{no:6,name:"subscriber_primary",kind:"scalar",T:8},{no:7,name:"alternative_url",kind:"scalar",T:9},{no:8,name:"client_configuration",kind:"message",T:Rm},{no:9,name:"server_region",kind:"scalar",T:9},{no:10,name:"ping_timeout",kind:"scalar",T:5},{no:11,name:"ping_interval",kind:"scalar",T:5},{no:12,name:"server_info",kind:"message",T:fI},{no:13,name:"sif_trailer",kind:"scalar",T:12},{no:14,name:"enabled_publish_codecs",kind:"message",T:Do,repeated:!0},{no:15,name:"fast_publish",kind:"scalar",T:8}]),bI=U.makeMessageType("livekit.ReconnectResponse",()=>[{no:1,name:"ice_servers",kind:"message",T:Gm,repeated:!0},{no:2,name:"client_configuration",kind:"message",T:Rm}]),Al=U.makeMessageType("livekit.TrackPublishedResponse",()=>[{no:1,name:"cid",kind:"scalar",T:9},{no:2,name:"track",kind:"message",T:Ei}]),BI=U.makeMessageType("livekit.TrackUnpublishedResponse",()=>[{no:1,name:"track_sid",kind:"scalar",T:9}]),Vr=U.makeMessageType("livekit.SessionDescription",()=>[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"sdp",kind:"scalar",T:9}]),CI=U.makeMessageType("livekit.ParticipantUpdate",()=>[{no:1,name:"participants",kind:"message",T:Nr,repeated:!0}]),No=U.makeMessageType("livekit.UpdateSubscription",()=>[{no:1,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:2,name:"subscribe",kind:"scalar",T:8},{no:3,name:"participant_tracks",kind:"message",T:Fm,repeated:!0}]),Hm=U.makeMessageType("livekit.UpdateTrackSettings",()=>[{no:1,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:3,name:"disabled",kind:"scalar",T:8},{no:4,name:"quality",kind:"enum",T:U.getEnumType(_i)},{no:5,name:"width",kind:"scalar",T:13},{no:6,name:"height",kind:"scalar",T:13},{no:7,name:"fps",kind:"scalar",T:13},{no:8,name:"priority",kind:"scalar",T:13}]),Nm=U.makeMessageType("livekit.UpdateLocalAudioTrack",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"features",kind:"enum",T:U.getEnumType(sn),repeated:!0}]),_I=U.makeMessageType("livekit.UpdateLocalVideoTrack",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"width",kind:"scalar",T:13},{no:3,name:"height",kind:"scalar",T:13}]),Ko=U.makeMessageType("livekit.LeaveRequest",()=>[{no:1,name:"can_reconnect",kind:"scalar",T:8},{no:2,name:"reason",kind:"enum",T:U.getEnumType(An)},{no:3,name:"action",kind:"enum",T:U.getEnumType(Ui)},{no:4,name:"regions",kind:"message",T:OI}]),Ui=U.makeEnum("livekit.LeaveRequest.Action",[{no:0,name:"DISCONNECT"},{no:1,name:"RESUME"},{no:2,name:"RECONNECT"}]),Km=U.makeMessageType("livekit.UpdateVideoLayers",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"layers",kind:"message",T:Kr,repeated:!0}]),Vm=U.makeMessageType("livekit.UpdateParticipantMetadata",()=>[{no:1,name:"metadata",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:4,name:"request_id",kind:"scalar",T:13}]),Gm=U.makeMessageType("livekit.ICEServer",()=>[{no:1,name:"urls",kind:"scalar",T:9,repeated:!0},{no:2,name:"username",kind:"scalar",T:9},{no:3,name:"credential",kind:"scalar",T:9}]),SI=U.makeMessageType("livekit.SpeakersChanged",()=>[{no:1,name:"speakers",kind:"message",T:_m,repeated:!0}]),kI=U.makeMessageType("livekit.RoomUpdate",()=>[{no:1,name:"room",kind:"message",T:Lo}]),EI=U.makeMessageType("livekit.ConnectionQualityInfo",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"quality",kind:"enum",T:U.getEnumType(RA)},{no:3,name:"score",kind:"scalar",T:2}]),UI=U.makeMessageType("livekit.ConnectionQualityUpdate",()=>[{no:1,name:"updates",kind:"message",T:EI,repeated:!0}]),TI=U.makeMessageType("livekit.StreamStateInfo",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sid",kind:"scalar",T:9},{no:3,name:"state",kind:"enum",T:U.getEnumType(el)}]),II=U.makeMessageType("livekit.StreamStateUpdate",()=>[{no:1,name:"stream_states",kind:"message",T:TI,repeated:!0}]),sl=U.makeMessageType("livekit.SubscribedQuality",()=>[{no:1,name:"quality",kind:"enum",T:U.getEnumType(_i)},{no:2,name:"enabled",kind:"scalar",T:8}]),FI=U.makeMessageType("livekit.SubscribedCodec",()=>[{no:1,name:"codec",kind:"scalar",T:9},{no:2,name:"qualities",kind:"message",T:sl,repeated:!0}]),xI=U.makeMessageType("livekit.SubscribedQualityUpdate",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"subscribed_qualities",kind:"message",T:sl,repeated:!0},{no:3,name:"subscribed_codecs",kind:"message",T:FI,repeated:!0}]),jm=U.makeMessageType("livekit.TrackPermission",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"all_tracks",kind:"scalar",T:8},{no:3,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:4,name:"participant_identity",kind:"scalar",T:9}]),Wm=U.makeMessageType("livekit.SubscriptionPermission",()=>[{no:1,name:"all_participants",kind:"scalar",T:8},{no:2,name:"track_permissions",kind:"message",T:jm,repeated:!0}]),QI=U.makeMessageType("livekit.SubscriptionPermissionUpdate",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sid",kind:"scalar",T:9},{no:3,name:"allowed",kind:"scalar",T:8}]),RI=U.makeMessageType("livekit.RoomMovedResponse",()=>[{no:1,name:"room",kind:"message",T:Lo},{no:2,name:"token",kind:"scalar",T:9},{no:3,name:"participant",kind:"message",T:Nr},{no:4,name:"other_participants",kind:"message",T:Nr,repeated:!0}]),qm=U.makeMessageType("livekit.SyncState",()=>[{no:1,name:"answer",kind:"message",T:Vr},{no:2,name:"subscription",kind:"message",T:No},{no:3,name:"publish_tracks",kind:"message",T:Al,repeated:!0},{no:4,name:"data_channels",kind:"message",T:Jm,repeated:!0},{no:5,name:"offer",kind:"message",T:Vr},{no:6,name:"track_sids_disabled",kind:"scalar",T:9,repeated:!0}]),Jm=U.makeMessageType("livekit.DataChannelInfo",()=>[{no:1,name:"label",kind:"scalar",T:9},{no:2,name:"id",kind:"scalar",T:13},{no:3,name:"target",kind:"enum",T:U.getEnumType(on)}]),Cn=U.makeMessageType("livekit.SimulateScenario",()=>[{no:1,name:"speaker_update",kind:"scalar",T:5,oneof:"scenario"},{no:2,name:"node_failure",kind:"scalar",T:8,oneof:"scenario"},{no:3,name:"migration",kind:"scalar",T:8,oneof:"scenario"},{no:4,name:"server_leave",kind:"scalar",T:8,oneof:"scenario"},{no:5,name:"switch_candidate_protocol",kind:"enum",T:U.getEnumType(vI),oneof:"scenario"},{no:6,name:"subscriber_bandwidth",kind:"scalar",T:3,oneof:"scenario"},{no:7,name:"disconnect_signal_on_resume",kind:"scalar",T:8,oneof:"scenario"},{no:8,name:"disconnect_signal_on_resume_no_messages",kind:"scalar",T:8,oneof:"scenario"},{no:9,name:"leave_request_full_reconnect",kind:"scalar",T:8,oneof:"scenario"}]),zm=U.makeMessageType("livekit.Ping",()=>[{no:1,name:"timestamp",kind:"scalar",T:3},{no:2,name:"rtt",kind:"scalar",T:3}]),PI=U.makeMessageType("livekit.Pong",()=>[{no:1,name:"last_ping_timestamp",kind:"scalar",T:3},{no:2,name:"timestamp",kind:"scalar",T:3}]),OI=U.makeMessageType("livekit.RegionSettings",()=>[{no:1,name:"regions",kind:"message",T:MI,repeated:!0}]),MI=U.makeMessageType("livekit.RegionInfo",()=>[{no:1,name:"region",kind:"scalar",T:9},{no:2,name:"url",kind:"scalar",T:9},{no:3,name:"distance",kind:"scalar",T:3}]),LI=U.makeMessageType("livekit.SubscriptionResponse",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"err",kind:"enum",T:U.getEnumType(aI)}]),DI=U.makeMessageType("livekit.RequestResponse",()=>[{no:1,name:"request_id",kind:"scalar",T:13},{no:2,name:"reason",kind:"enum",T:U.getEnumType(ol)},{no:3,name:"message",kind:"scalar",T:9}]),ol=U.makeEnum("livekit.RequestResponse.Reason",[{no:0,name:"OK"},{no:1,name:"NOT_FOUND"},{no:2,name:"NOT_ALLOWED"},{no:3,name:"LIMIT_EXCEEDED"}]),HI=U.makeMessageType("livekit.TrackSubscribed",()=>[{no:1,name:"track_sid",kind:"scalar",T:9}]);function NI(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Vo={exports:{}},KI=Vo.exports,Xm;function VI(){return Xm||(Xm=1,function(n){(function(e,t){n.exports?n.exports=t():e.log=t()})(KI,function(){var e=function(){},t="undefined",r=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"],A={},s=null;function o(p,g){var v=p[g];if(typeof v.bind=="function")return v.bind(p);try{return Function.prototype.bind.call(v,p)}catch{return function(){return Function.prototype.apply.apply(v,[p,arguments])}}}function a(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function c(p){return p==="debug"&&(p="log"),typeof console===t?!1:p==="trace"&&r?a:console[p]!==void 0?o(console,p):console.log!==void 0?o(console,"log"):e}function u(){for(var p=this.getLevel(),g=0;g<i.length;g++){var v=i[g];this[v]=g<p?e:this.methodFactory(v,p,this.name)}if(this.log=this.debug,typeof console===t&&p<this.levels.SILENT)return"No console available for logging"}function l(p){return function(){typeof console!==t&&(u.call(this),this[p].apply(this,arguments))}}function d(p,g,v){return c(p)||l.apply(this,arguments)}function h(p,g){var v=this,y,b,B,w="loglevel";typeof p=="string"?w+=":"+p:typeof p=="symbol"&&(w=void 0);function _(F){var Q=(i[F]||"silent").toUpperCase();if(!(typeof window===t||!w)){try{window.localStorage[w]=Q;return}catch{}try{window.document.cookie=encodeURIComponent(w)+"="+Q+";"}catch{}}}function k(){var F;if(!(typeof window===t||!w)){try{F=window.localStorage[w]}catch{}if(typeof F===t)try{var Q=window.document.cookie,D=encodeURIComponent(w),X=Q.indexOf(D+"=");X!==-1&&(F=/^([^;]+)/.exec(Q.slice(X+D.length+1))[1])}catch{}return v.levels[F]===void 0&&(F=void 0),F}}function T(){if(!(typeof window===t||!w)){try{window.localStorage.removeItem(w)}catch{}try{window.document.cookie=encodeURIComponent(w)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function I(F){var Q=F;if(typeof Q=="string"&&v.levels[Q.toUpperCase()]!==void 0&&(Q=v.levels[Q.toUpperCase()]),typeof Q=="number"&&Q>=0&&Q<=v.levels.SILENT)return Q;throw new TypeError("log.setLevel() called with invalid level: "+F)}v.name=p,v.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},v.methodFactory=g||d,v.getLevel=function(){return B??b??y},v.setLevel=function(F,Q){return B=I(F),Q!==!1&&_(B),u.call(v)},v.setDefaultLevel=function(F){b=I(F),k()||v.setLevel(F,!1)},v.resetLevel=function(){B=null,T(),u.call(v)},v.enableAll=function(F){v.setLevel(v.levels.TRACE,F)},v.disableAll=function(F){v.setLevel(v.levels.SILENT,F)},v.rebuild=function(){if(s!==v&&(y=I(s.getLevel())),u.call(v),s===v)for(var F in A)A[F].rebuild()},y=I(s?s.getLevel():"WARN");var x=k();x!=null&&(B=I(x)),u.call(v)}s=new h,s.getLogger=function(g){if(typeof g!="symbol"&&typeof g!="string"||g==="")throw new TypeError("You must supply a name when creating a logger.");var v=A[g];return v||(v=A[g]=new h(g,s.methodFactory)),v};var f=typeof window!==t?window.log:void 0;return s.noConflict=function(){return typeof window!==t&&window.log===s&&(window.log=f),s},s.getLoggers=function(){return A},s.default=s,s})}(Vo)),Vo.exports}var Go=VI(),al;(function(n){n[n.trace=0]="trace",n[n.debug=1]="debug",n[n.info=2]="info",n[n.warn=3]="warn",n[n.error=4]="error",n[n.silent=5]="silent"})(al||(al={}));var an;(function(n){n.Default="livekit",n.Room="livekit-room",n.Participant="livekit-participant",n.Track="livekit-track",n.Publication="livekit-track-publication",n.Engine="livekit-engine",n.Signal="livekit-signal",n.PCManager="livekit-pc-manager",n.PCTransport="livekit-pc-transport",n.E2EE="lk-e2ee"})(an||(an={}));let ce=Go.getLogger("livekit");Object.values(an).map(n=>Go.getLogger(n)),ce.setDefaultLevel(al.info);function Mn(n){const e=Go.getLogger(n);return e.setDefaultLevel(ce.getLevel()),e}const GI=Go.getLogger("lk-e2ee"),OA=7e3,jI=[0,300,2*2*300,3*3*300,4*4*300,OA,OA,OA,OA,OA];class WI{constructor(e){this._retryDelays=e!==void 0?[...e]:jI}nextRetryDelayInMs(e){if(e.retryCount>=this._retryDelays.length)return null;const t=this._retryDelays[e.retryCount];return e.retryCount<=1?t:t+Math.random()*1e3}}function qI(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t}function S(n,e,t,r){function i(A){return A instanceof t?A:new t(function(s){s(A)})}return new(t||(t=Promise))(function(A,s){function o(u){try{c(r.next(u))}catch(l){s(l)}}function a(u){try{c(r.throw(u))}catch(l){s(l)}}function c(u){u.done?A(u.value):i(u.value).then(o,a)}c((r=r.apply(n,e||[])).next())})}function Ym(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function cr(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof Ym=="function"?Ym(n):n[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(A){t[A]=n[A]&&function(s){return new Promise(function(o,a){s=n[A](s),i(o,a,s.done,s.value)})}}function i(A,s,o,a){Promise.resolve(a).then(function(c){A({value:c,done:o})},s)}}typeof SuppressedError=="function"&&SuppressedError;var jo={exports:{}},Zm;function JI(){if(Zm)return jo.exports;Zm=1;var n=typeof Reflect=="object"?Reflect:null,e=n&&typeof n.apply=="function"?n.apply:function(w,_,k){return Function.prototype.apply.call(w,_,k)},t;n&&typeof n.ownKeys=="function"?t=n.ownKeys:Object.getOwnPropertySymbols?t=function(w){return Object.getOwnPropertyNames(w).concat(Object.getOwnPropertySymbols(w))}:t=function(w){return Object.getOwnPropertyNames(w)};function r(B){console&&console.warn&&console.warn(B)}var i=Number.isNaN||function(w){return w!==w};function A(){A.init.call(this)}jo.exports=A,jo.exports.once=v,A.EventEmitter=A,A.prototype._events=void 0,A.prototype._eventsCount=0,A.prototype._maxListeners=void 0;var s=10;function o(B){if(typeof B!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof B)}Object.defineProperty(A,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(B){if(typeof B!="number"||B<0||i(B))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+B+".");s=B}}),A.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},A.prototype.setMaxListeners=function(w){if(typeof w!="number"||w<0||i(w))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+w+".");return this._maxListeners=w,this};function a(B){return B._maxListeners===void 0?A.defaultMaxListeners:B._maxListeners}A.prototype.getMaxListeners=function(){return a(this)},A.prototype.emit=function(w){for(var _=[],k=1;k<arguments.length;k++)_.push(arguments[k]);var T=w==="error",I=this._events;if(I!==void 0)T=T&&I.error===void 0;else if(!T)return!1;if(T){var x;if(_.length>0&&(x=_[0]),x instanceof Error)throw x;var F=new Error("Unhandled error."+(x?" ("+x.message+")":""));throw F.context=x,F}var Q=I[w];if(Q===void 0)return!1;if(typeof Q=="function")e(Q,this,_);else for(var D=Q.length,X=f(Q,D),k=0;k<D;++k)e(X[k],this,_);return!0};function c(B,w,_,k){var T,I,x;if(o(_),I=B._events,I===void 0?(I=B._events=Object.create(null),B._eventsCount=0):(I.newListener!==void 0&&(B.emit("newListener",w,_.listener?_.listener:_),I=B._events),x=I[w]),x===void 0)x=I[w]=_,++B._eventsCount;else if(typeof x=="function"?x=I[w]=k?[_,x]:[x,_]:k?x.unshift(_):x.push(_),T=a(B),T>0&&x.length>T&&!x.warned){x.warned=!0;var F=new Error("Possible EventEmitter memory leak detected. "+x.length+" "+String(w)+" listeners added. Use emitter.setMaxListeners() to increase limit");F.name="MaxListenersExceededWarning",F.emitter=B,F.type=w,F.count=x.length,r(F)}return B}A.prototype.addListener=function(w,_){return c(this,w,_,!1)},A.prototype.on=A.prototype.addListener,A.prototype.prependListener=function(w,_){return c(this,w,_,!0)};function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(B,w,_){var k={fired:!1,wrapFn:void 0,target:B,type:w,listener:_},T=u.bind(k);return T.listener=_,k.wrapFn=T,T}A.prototype.once=function(w,_){return o(_),this.on(w,l(this,w,_)),this},A.prototype.prependOnceListener=function(w,_){return o(_),this.prependListener(w,l(this,w,_)),this},A.prototype.removeListener=function(w,_){var k,T,I,x,F;if(o(_),T=this._events,T===void 0)return this;if(k=T[w],k===void 0)return this;if(k===_||k.listener===_)--this._eventsCount===0?this._events=Object.create(null):(delete T[w],T.removeListener&&this.emit("removeListener",w,k.listener||_));else if(typeof k!="function"){for(I=-1,x=k.length-1;x>=0;x--)if(k[x]===_||k[x].listener===_){F=k[x].listener,I=x;break}if(I<0)return this;I===0?k.shift():p(k,I),k.length===1&&(T[w]=k[0]),T.removeListener!==void 0&&this.emit("removeListener",w,F||_)}return this},A.prototype.off=A.prototype.removeListener,A.prototype.removeAllListeners=function(w){var _,k,T;if(k=this._events,k===void 0)return this;if(k.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):k[w]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete k[w]),this;if(arguments.length===0){var I=Object.keys(k),x;for(T=0;T<I.length;++T)x=I[T],x!=="removeListener"&&this.removeAllListeners(x);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(_=k[w],typeof _=="function")this.removeListener(w,_);else if(_!==void 0)for(T=_.length-1;T>=0;T--)this.removeListener(w,_[T]);return this};function d(B,w,_){var k=B._events;if(k===void 0)return[];var T=k[w];return T===void 0?[]:typeof T=="function"?_?[T.listener||T]:[T]:_?g(T):f(T,T.length)}A.prototype.listeners=function(w){return d(this,w,!0)},A.prototype.rawListeners=function(w){return d(this,w,!1)},A.listenerCount=function(B,w){return typeof B.listenerCount=="function"?B.listenerCount(w):h.call(B,w)},A.prototype.listenerCount=h;function h(B){var w=this._events;if(w!==void 0){var _=w[B];if(typeof _=="function")return 1;if(_!==void 0)return _.length}return 0}A.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function f(B,w){for(var _=new Array(w),k=0;k<w;++k)_[k]=B[k];return _}function p(B,w){for(;w+1<B.length;w++)B[w]=B[w+1];B.pop()}function g(B){for(var w=new Array(B.length),_=0;_<w.length;++_)w[_]=B[_].listener||B[_];return w}function v(B,w){return new Promise(function(_,k){function T(x){B.removeListener(w,I),k(x)}function I(){typeof B.removeListener=="function"&&B.removeListener("error",T),_([].slice.call(arguments))}b(B,w,I,{once:!0}),w!=="error"&&y(B,T,{once:!0})})}function y(B,w,_){typeof B.on=="function"&&b(B,"error",w,_)}function b(B,w,_,k){if(typeof B.on=="function")k.once?B.once(w,_):B.on(w,_);else if(typeof B.addEventListener=="function")B.addEventListener(w,function T(I){k.once&&B.removeEventListener(w,T),_(I)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof B)}return jo.exports}var _n=JI();let $m=!0,ev=!0;function Wo(n,e,t){const r=n.match(e);return r&&r.length>=t&&parseInt(r[t],10)}function Gr(n,e,t){if(!n.RTCPeerConnection)return;const r=n.RTCPeerConnection.prototype,i=r.addEventListener;r.addEventListener=function(s,o){if(s!==e)return i.apply(this,arguments);const a=c=>{const u=t(c);u&&(o.handleEvent?o.handleEvent(u):o(u))};return this._eventMap=this._eventMap||{},this._eventMap[e]||(this._eventMap[e]=new Map),this._eventMap[e].set(o,a),i.apply(this,[s,a])};const A=r.removeEventListener;r.removeEventListener=function(s,o){if(s!==e||!this._eventMap||!this._eventMap[e])return A.apply(this,arguments);if(!this._eventMap[e].has(o))return A.apply(this,arguments);const a=this._eventMap[e].get(o);return this._eventMap[e].delete(o),this._eventMap[e].size===0&&delete this._eventMap[e],Object.keys(this._eventMap).length===0&&delete this._eventMap,A.apply(this,[s,a])},Object.defineProperty(r,"on"+e,{get(){return this["_on"+e]},set(s){this["_on"+e]&&(this.removeEventListener(e,this["_on"+e]),delete this["_on"+e]),s&&this.addEventListener(e,this["_on"+e]=s)},enumerable:!0,configurable:!0})}function zI(n){return typeof n!="boolean"?new Error("Argument type: "+typeof n+". Please use a boolean."):($m=n,n?"adapter.js logging disabled":"adapter.js logging enabled")}function XI(n){return typeof n!="boolean"?new Error("Argument type: "+typeof n+". Please use a boolean."):(ev=!n,"adapter.js deprecation warnings "+(n?"disabled":"enabled"))}function tv(){if(typeof window=="object"){if($m)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function cl(n,e){ev&&console.warn(n+" is deprecated, please use "+e+" instead.")}function YI(n){const e={browser:null,version:null};if(typeof n>"u"||!n.navigator||!n.navigator.userAgent)return e.browser="Not a browser.",e;const{navigator:t}=n;if(t.userAgentData&&t.userAgentData.brands){const r=t.userAgentData.brands.find(i=>i.brand==="Chromium");if(r)return{browser:"chrome",version:parseInt(r.version,10)}}if(t.mozGetUserMedia)e.browser="firefox",e.version=Wo(t.userAgent,/Firefox\/(\d+)\./,1);else if(t.webkitGetUserMedia||n.isSecureContext===!1&&n.webkitRTCPeerConnection)e.browser="chrome",e.version=Wo(t.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(n.RTCPeerConnection&&t.userAgent.match(/AppleWebKit\/(\d+)\./))e.browser="safari",e.version=Wo(t.userAgent,/AppleWebKit\/(\d+)\./,1),e.supportsUnifiedPlan=n.RTCRtpTransceiver&&"currentDirection"in n.RTCRtpTransceiver.prototype;else return e.browser="Not a supported browser.",e;return e}function nv(n){return Object.prototype.toString.call(n)==="[object Object]"}function rv(n){return nv(n)?Object.keys(n).reduce(function(e,t){const r=nv(n[t]),i=r?rv(n[t]):n[t],A=r&&!Object.keys(i).length;return i===void 0||A?e:Object.assign(e,{[t]:i})},{}):n}function ul(n,e,t){!e||t.has(e.id)||(t.set(e.id,e),Object.keys(e).forEach(r=>{r.endsWith("Id")?ul(n,n.get(e[r]),t):r.endsWith("Ids")&&e[r].forEach(i=>{ul(n,n.get(i),t)})}))}function iv(n,e,t){const r=t?"outbound-rtp":"inbound-rtp",i=new Map;if(e===null)return i;const A=[];return n.forEach(s=>{s.type==="track"&&s.trackIdentifier===e.id&&A.push(s)}),A.forEach(s=>{n.forEach(o=>{o.type===r&&o.trackId===s.id&&ul(n,o,i)})}),i}const Av=tv;function sv(n,e){const t=n&&n.navigator;if(!t.mediaDevices)return;const r=function(o){if(typeof o!="object"||o.mandatory||o.optional)return o;const a={};return Object.keys(o).forEach(c=>{if(c==="require"||c==="advanced"||c==="mediaSource")return;const u=typeof o[c]=="object"?o[c]:{ideal:o[c]};u.exact!==void 0&&typeof u.exact=="number"&&(u.min=u.max=u.exact);const l=function(d,h){return d?d+h.charAt(0).toUpperCase()+h.slice(1):h==="deviceId"?"sourceId":h};if(u.ideal!==void 0){a.optional=a.optional||[];let d={};typeof u.ideal=="number"?(d[l("min",c)]=u.ideal,a.optional.push(d),d={},d[l("max",c)]=u.ideal,a.optional.push(d)):(d[l("",c)]=u.ideal,a.optional.push(d))}u.exact!==void 0&&typeof u.exact!="number"?(a.mandatory=a.mandatory||{},a.mandatory[l("",c)]=u.exact):["min","max"].forEach(d=>{u[d]!==void 0&&(a.mandatory=a.mandatory||{},a.mandatory[l(d,c)]=u[d])})}),o.advanced&&(a.optional=(a.optional||[]).concat(o.advanced)),a},i=function(o,a){if(e.version>=61)return a(o);if(o=JSON.parse(JSON.stringify(o)),o&&typeof o.audio=="object"){const c=function(u,l,d){l in u&&!(d in u)&&(u[d]=u[l],delete u[l])};o=JSON.parse(JSON.stringify(o)),c(o.audio,"autoGainControl","googAutoGainControl"),c(o.audio,"noiseSuppression","googNoiseSuppression"),o.audio=r(o.audio)}if(o&&typeof o.video=="object"){let c=o.video.facingMode;c=c&&(typeof c=="object"?c:{ideal:c});const u=e.version<66;if(c&&(c.exact==="user"||c.exact==="environment"||c.ideal==="user"||c.ideal==="environment")&&!(t.mediaDevices.getSupportedConstraints&&t.mediaDevices.getSupportedConstraints().facingMode&&!u)){delete o.video.facingMode;let l;if(c.exact==="environment"||c.ideal==="environment"?l=["back","rear"]:(c.exact==="user"||c.ideal==="user")&&(l=["front"]),l)return t.mediaDevices.enumerateDevices().then(d=>{d=d.filter(f=>f.kind==="videoinput");let h=d.find(f=>l.some(p=>f.label.toLowerCase().includes(p)));return!h&&d.length&&l.includes("back")&&(h=d[d.length-1]),h&&(o.video.deviceId=c.exact?{exact:h.deviceId}:{ideal:h.deviceId}),o.video=r(o.video),Av("chrome: "+JSON.stringify(o)),a(o)})}o.video=r(o.video)}return Av("chrome: "+JSON.stringify(o)),a(o)},A=function(o){return e.version>=64?o:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[o.name]||o.name,message:o.message,constraint:o.constraint||o.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}},s=function(o,a,c){i(o,u=>{t.webkitGetUserMedia(u,a,l=>{c&&c(A(l))})})};if(t.getUserMedia=s.bind(t),t.mediaDevices.getUserMedia){const o=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(a){return i(a,c=>o(c).then(u=>{if(c.audio&&!u.getAudioTracks().length||c.video&&!u.getVideoTracks().length)throw u.getTracks().forEach(l=>{l.stop()}),new DOMException("","NotFoundError");return u},u=>Promise.reject(A(u))))}}}function ov(n){n.MediaStream=n.MediaStream||n.webkitMediaStream}function av(n){if(typeof n=="object"&&n.RTCPeerConnection&&!("ontrack"in n.RTCPeerConnection.prototype)){Object.defineProperty(n.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(t){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=t)},enumerable:!0,configurable:!0});const e=n.RTCPeerConnection.prototype.setRemoteDescription;n.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=r=>{r.stream.addEventListener("addtrack",i=>{let A;n.RTCPeerConnection.prototype.getReceivers?A=this.getReceivers().find(o=>o.track&&o.track.id===i.track.id):A={track:i.track};const s=new Event("track");s.track=i.track,s.receiver=A,s.transceiver={receiver:A},s.streams=[r.stream],this.dispatchEvent(s)}),r.stream.getTracks().forEach(i=>{let A;n.RTCPeerConnection.prototype.getReceivers?A=this.getReceivers().find(o=>o.track&&o.track.id===i.id):A={track:i};const s=new Event("track");s.track=i,s.receiver=A,s.transceiver={receiver:A},s.streams=[r.stream],this.dispatchEvent(s)})},this.addEventListener("addstream",this._ontrackpoly)),e.apply(this,arguments)}}else Gr(n,"track",e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e))}function cv(n){if(typeof n=="object"&&n.RTCPeerConnection&&!("getSenders"in n.RTCPeerConnection.prototype)&&"createDTMFSender"in n.RTCPeerConnection.prototype){const e=function(i,A){return{track:A,get dtmf(){return this._dtmf===void 0&&(A.kind==="audio"?this._dtmf=i.createDTMFSender(A):this._dtmf=null),this._dtmf},_pc:i}};if(!n.RTCPeerConnection.prototype.getSenders){n.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const i=n.RTCPeerConnection.prototype.addTrack;n.RTCPeerConnection.prototype.addTrack=function(o,a){let c=i.apply(this,arguments);return c||(c=e(this,o),this._senders.push(c)),c};const A=n.RTCPeerConnection.prototype.removeTrack;n.RTCPeerConnection.prototype.removeTrack=function(o){A.apply(this,arguments);const a=this._senders.indexOf(o);a!==-1&&this._senders.splice(a,1)}}const t=n.RTCPeerConnection.prototype.addStream;n.RTCPeerConnection.prototype.addStream=function(A){this._senders=this._senders||[],t.apply(this,[A]),A.getTracks().forEach(s=>{this._senders.push(e(this,s))})};const r=n.RTCPeerConnection.prototype.removeStream;n.RTCPeerConnection.prototype.removeStream=function(A){this._senders=this._senders||[],r.apply(this,[A]),A.getTracks().forEach(s=>{const o=this._senders.find(a=>a.track===s);o&&this._senders.splice(this._senders.indexOf(o),1)})}}else if(typeof n=="object"&&n.RTCPeerConnection&&"getSenders"in n.RTCPeerConnection.prototype&&"createDTMFSender"in n.RTCPeerConnection.prototype&&n.RTCRtpSender&&!("dtmf"in n.RTCRtpSender.prototype)){const e=n.RTCPeerConnection.prototype.getSenders;n.RTCPeerConnection.prototype.getSenders=function(){const r=e.apply(this,[]);return r.forEach(i=>i._pc=this),r},Object.defineProperty(n.RTCRtpSender.prototype,"dtmf",{get(){return this._dtmf===void 0&&(this.track.kind==="audio"?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function uv(n){if(!(typeof n=="object"&&n.RTCPeerConnection&&n.RTCRtpSender&&n.RTCRtpReceiver))return;if(!("getStats"in n.RTCRtpSender.prototype)){const t=n.RTCPeerConnection.prototype.getSenders;t&&(n.RTCPeerConnection.prototype.getSenders=function(){const A=t.apply(this,[]);return A.forEach(s=>s._pc=this),A});const r=n.RTCPeerConnection.prototype.addTrack;r&&(n.RTCPeerConnection.prototype.addTrack=function(){const A=r.apply(this,arguments);return A._pc=this,A}),n.RTCRtpSender.prototype.getStats=function(){const A=this;return this._pc.getStats().then(s=>iv(s,A.track,!0))}}if(!("getStats"in n.RTCRtpReceiver.prototype)){const t=n.RTCPeerConnection.prototype.getReceivers;t&&(n.RTCPeerConnection.prototype.getReceivers=function(){const i=t.apply(this,[]);return i.forEach(A=>A._pc=this),i}),Gr(n,"track",r=>(r.receiver._pc=r.srcElement,r)),n.RTCRtpReceiver.prototype.getStats=function(){const i=this;return this._pc.getStats().then(A=>iv(A,i.track,!1))}}if(!("getStats"in n.RTCRtpSender.prototype&&"getStats"in n.RTCRtpReceiver.prototype))return;const e=n.RTCPeerConnection.prototype.getStats;n.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof n.MediaStreamTrack){const r=arguments[0];let i,A,s;return this.getSenders().forEach(o=>{o.track===r&&(i?s=!0:i=o)}),this.getReceivers().forEach(o=>(o.track===r&&(A?s=!0:A=o),o.track===r)),s||i&&A?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):i?i.getStats():A?A.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return e.apply(this,arguments)}}function lv(n){n.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(s=>this._shimmedLocalStreams[s][0])};const e=n.RTCPeerConnection.prototype.addTrack;n.RTCPeerConnection.prototype.addTrack=function(s,o){if(!o)return e.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const a=e.apply(this,arguments);return this._shimmedLocalStreams[o.id]?this._shimmedLocalStreams[o.id].indexOf(a)===-1&&this._shimmedLocalStreams[o.id].push(a):this._shimmedLocalStreams[o.id]=[o,a],a};const t=n.RTCPeerConnection.prototype.addStream;n.RTCPeerConnection.prototype.addStream=function(s){this._shimmedLocalStreams=this._shimmedLocalStreams||{},s.getTracks().forEach(c=>{if(this.getSenders().find(l=>l.track===c))throw new DOMException("Track already exists.","InvalidAccessError")});const o=this.getSenders();t.apply(this,arguments);const a=this.getSenders().filter(c=>o.indexOf(c)===-1);this._shimmedLocalStreams[s.id]=[s].concat(a)};const r=n.RTCPeerConnection.prototype.removeStream;n.RTCPeerConnection.prototype.removeStream=function(s){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[s.id],r.apply(this,arguments)};const i=n.RTCPeerConnection.prototype.removeTrack;n.RTCPeerConnection.prototype.removeTrack=function(s){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},s&&Object.keys(this._shimmedLocalStreams).forEach(o=>{const a=this._shimmedLocalStreams[o].indexOf(s);a!==-1&&this._shimmedLocalStreams[o].splice(a,1),this._shimmedLocalStreams[o].length===1&&delete this._shimmedLocalStreams[o]}),i.apply(this,arguments)}}function dv(n,e){if(!n.RTCPeerConnection)return;if(n.RTCPeerConnection.prototype.addTrack&&e.version>=65)return lv(n);const t=n.RTCPeerConnection.prototype.getLocalStreams;n.RTCPeerConnection.prototype.getLocalStreams=function(){const u=t.apply(this);return this._reverseStreams=this._reverseStreams||{},u.map(l=>this._reverseStreams[l.id])};const r=n.RTCPeerConnection.prototype.addStream;n.RTCPeerConnection.prototype.addStream=function(u){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},u.getTracks().forEach(l=>{if(this.getSenders().find(h=>h.track===l))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[u.id]){const l=new n.MediaStream(u.getTracks());this._streams[u.id]=l,this._reverseStreams[l.id]=u,u=l}r.apply(this,[u])};const i=n.RTCPeerConnection.prototype.removeStream;n.RTCPeerConnection.prototype.removeStream=function(u){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[u.id]||u]),delete this._reverseStreams[this._streams[u.id]?this._streams[u.id].id:u.id],delete this._streams[u.id]},n.RTCPeerConnection.prototype.addTrack=function(u,l){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const d=[].slice.call(arguments,1);if(d.length!==1||!d[0].getTracks().find(p=>p===u))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find(p=>p.track===u))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const f=this._streams[l.id];if(f)f.addTrack(u),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const p=new n.MediaStream([u]);this._streams[l.id]=p,this._reverseStreams[p.id]=l,this.addStream(p)}return this.getSenders().find(p=>p.track===u)};function A(c,u){let l=u.sdp;return Object.keys(c._reverseStreams||[]).forEach(d=>{const h=c._reverseStreams[d],f=c._streams[h.id];l=l.replace(new RegExp(f.id,"g"),h.id)}),new RTCSessionDescription({type:u.type,sdp:l})}function s(c,u){let l=u.sdp;return Object.keys(c._reverseStreams||[]).forEach(d=>{const h=c._reverseStreams[d],f=c._streams[h.id];l=l.replace(new RegExp(h.id,"g"),f.id)}),new RTCSessionDescription({type:u.type,sdp:l})}["createOffer","createAnswer"].forEach(function(c){const u=n.RTCPeerConnection.prototype[c],l={[c](){const d=arguments;return arguments.length&&typeof arguments[0]=="function"?u.apply(this,[f=>{const p=A(this,f);d[0].apply(null,[p])},f=>{d[1]&&d[1].apply(null,f)},arguments[2]]):u.apply(this,arguments).then(f=>A(this,f))}};n.RTCPeerConnection.prototype[c]=l[c]});const o=n.RTCPeerConnection.prototype.setLocalDescription;n.RTCPeerConnection.prototype.setLocalDescription=function(){return!arguments.length||!arguments[0].type?o.apply(this,arguments):(arguments[0]=s(this,arguments[0]),o.apply(this,arguments))};const a=Object.getOwnPropertyDescriptor(n.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(n.RTCPeerConnection.prototype,"localDescription",{get(){const c=a.get.apply(this);return c.type===""?c:A(this,c)}}),n.RTCPeerConnection.prototype.removeTrack=function(u){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!u._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(u._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};let d;Object.keys(this._streams).forEach(h=>{this._streams[h].getTracks().find(p=>u.track===p)&&(d=this._streams[h])}),d&&(d.getTracks().length===1?this.removeStream(this._reverseStreams[d.id]):d.removeTrack(u.track),this.dispatchEvent(new Event("negotiationneeded")))}}function ll(n,e){!n.RTCPeerConnection&&n.webkitRTCPeerConnection&&(n.RTCPeerConnection=n.webkitRTCPeerConnection),n.RTCPeerConnection&&e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(t){const r=n.RTCPeerConnection.prototype[t],i={[t](){return arguments[0]=new(t==="addIceCandidate"?n.RTCIceCandidate:n.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};n.RTCPeerConnection.prototype[t]=i[t]})}function hv(n,e){Gr(n,"negotiationneeded",t=>{const r=t.target;if(!((e.version<72||r.getConfiguration&&r.getConfiguration().sdpSemantics==="plan-b")&&r.signalingState!=="stable"))return t})}var pv=Object.freeze({__proto__:null,fixNegotiationNeeded:hv,shimAddTrackRemoveTrack:dv,shimAddTrackRemoveTrackWithNative:lv,shimGetSendersWithDtmf:cv,shimGetUserMedia:sv,shimMediaStream:ov,shimOnTrack:av,shimPeerConnection:ll,shimSenderReceiverGetStats:uv});function fv(n,e){const t=n&&n.navigator,r=n&&n.MediaStreamTrack;if(t.getUserMedia=function(i,A,s){cl("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),t.mediaDevices.getUserMedia(i).then(A,s)},!(e.version>55&&"autoGainControl"in t.mediaDevices.getSupportedConstraints())){const i=function(s,o,a){o in s&&!(a in s)&&(s[a]=s[o],delete s[o])},A=t.mediaDevices.getUserMedia.bind(t.mediaDevices);if(t.mediaDevices.getUserMedia=function(s){return typeof s=="object"&&typeof s.audio=="object"&&(s=JSON.parse(JSON.stringify(s)),i(s.audio,"autoGainControl","mozAutoGainControl"),i(s.audio,"noiseSuppression","mozNoiseSuppression")),A(s)},r&&r.prototype.getSettings){const s=r.prototype.getSettings;r.prototype.getSettings=function(){const o=s.apply(this,arguments);return i(o,"mozAutoGainControl","autoGainControl"),i(o,"mozNoiseSuppression","noiseSuppression"),o}}if(r&&r.prototype.applyConstraints){const s=r.prototype.applyConstraints;r.prototype.applyConstraints=function(o){return this.kind==="audio"&&typeof o=="object"&&(o=JSON.parse(JSON.stringify(o)),i(o,"autoGainControl","mozAutoGainControl"),i(o,"noiseSuppression","mozNoiseSuppression")),s.apply(this,[o])}}}}function ZI(n,e){n.navigator.mediaDevices&&"getDisplayMedia"in n.navigator.mediaDevices||n.navigator.mediaDevices&&(n.navigator.mediaDevices.getDisplayMedia=function(r){if(!(r&&r.video)){const i=new DOMException("getDisplayMedia without video constraints is undefined");return i.name="NotFoundError",i.code=8,Promise.reject(i)}return r.video===!0?r.video={mediaSource:e}:r.video.mediaSource=e,n.navigator.mediaDevices.getUserMedia(r)})}function gv(n){typeof n=="object"&&n.RTCTrackEvent&&"receiver"in n.RTCTrackEvent.prototype&&!("transceiver"in n.RTCTrackEvent.prototype)&&Object.defineProperty(n.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function dl(n,e){if(typeof n!="object"||!(n.RTCPeerConnection||n.mozRTCPeerConnection))return;!n.RTCPeerConnection&&n.mozRTCPeerConnection&&(n.RTCPeerConnection=n.mozRTCPeerConnection),e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(i){const A=n.RTCPeerConnection.prototype[i],s={[i](){return arguments[0]=new(i==="addIceCandidate"?n.RTCIceCandidate:n.RTCSessionDescription)(arguments[0]),A.apply(this,arguments)}};n.RTCPeerConnection.prototype[i]=s[i]});const t={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},r=n.RTCPeerConnection.prototype.getStats;n.RTCPeerConnection.prototype.getStats=function(){const[A,s,o]=arguments;return r.apply(this,[A||null]).then(a=>{if(e.version<53&&!s)try{a.forEach(c=>{c.type=t[c.type]||c.type})}catch(c){if(c.name!=="TypeError")throw c;a.forEach((u,l)=>{a.set(l,Object.assign({},u,{type:t[u.type]||u.type}))})}return a}).then(s,o)}}function mv(n){if(!(typeof n=="object"&&n.RTCPeerConnection&&n.RTCRtpSender)||n.RTCRtpSender&&"getStats"in n.RTCRtpSender.prototype)return;const e=n.RTCPeerConnection.prototype.getSenders;e&&(n.RTCPeerConnection.prototype.getSenders=function(){const i=e.apply(this,[]);return i.forEach(A=>A._pc=this),i});const t=n.RTCPeerConnection.prototype.addTrack;t&&(n.RTCPeerConnection.prototype.addTrack=function(){const i=t.apply(this,arguments);return i._pc=this,i}),n.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function vv(n){if(!(typeof n=="object"&&n.RTCPeerConnection&&n.RTCRtpSender)||n.RTCRtpSender&&"getStats"in n.RTCRtpReceiver.prototype)return;const e=n.RTCPeerConnection.prototype.getReceivers;e&&(n.RTCPeerConnection.prototype.getReceivers=function(){const r=e.apply(this,[]);return r.forEach(i=>i._pc=this),r}),Gr(n,"track",t=>(t.receiver._pc=t.srcElement,t)),n.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function yv(n){!n.RTCPeerConnection||"removeStream"in n.RTCPeerConnection.prototype||(n.RTCPeerConnection.prototype.removeStream=function(t){cl("removeStream","removeTrack"),this.getSenders().forEach(r=>{r.track&&t.getTracks().includes(r.track)&&this.removeTrack(r)})})}function wv(n){n.DataChannel&&!n.RTCDataChannel&&(n.RTCDataChannel=n.DataChannel)}function bv(n){if(!(typeof n=="object"&&n.RTCPeerConnection))return;const e=n.RTCPeerConnection.prototype.addTransceiver;e&&(n.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let r=arguments[1]&&arguments[1].sendEncodings;r===void 0&&(r=[]),r=[...r];const i=r.length>0;i&&r.forEach(s=>{if("rid"in s&&!/^[a-z0-9]{0,16}$/i.test(s.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in s&&!(parseFloat(s.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in s&&!(parseFloat(s.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")});const A=e.apply(this,arguments);if(i){const{sender:s}=A,o=s.getParameters();(!("encodings"in o)||o.encodings.length===1&&Object.keys(o.encodings[0]).length===0)&&(o.encodings=r,s.sendEncodings=r,this.setParametersPromises.push(s.setParameters(o).then(()=>{delete s.sendEncodings}).catch(()=>{delete s.sendEncodings})))}return A})}function Bv(n){if(!(typeof n=="object"&&n.RTCRtpSender))return;const e=n.RTCRtpSender.prototype.getParameters;e&&(n.RTCRtpSender.prototype.getParameters=function(){const r=e.apply(this,arguments);return"encodings"in r||(r.encodings=[].concat(this.sendEncodings||[{}])),r})}function Cv(n){if(!(typeof n=="object"&&n.RTCPeerConnection))return;const e=n.RTCPeerConnection.prototype.createOffer;n.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>e.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):e.apply(this,arguments)}}function _v(n){if(!(typeof n=="object"&&n.RTCPeerConnection))return;const e=n.RTCPeerConnection.prototype.createAnswer;n.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>e.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):e.apply(this,arguments)}}var Sv=Object.freeze({__proto__:null,shimAddTransceiver:bv,shimCreateAnswer:_v,shimCreateOffer:Cv,shimGetDisplayMedia:ZI,shimGetParameters:Bv,shimGetUserMedia:fv,shimOnTrack:gv,shimPeerConnection:dl,shimRTCDataChannel:wv,shimReceiverGetStats:vv,shimRemoveStream:yv,shimSenderGetStats:mv});function kv(n){if(!(typeof n!="object"||!n.RTCPeerConnection)){if("getLocalStreams"in n.RTCPeerConnection.prototype||(n.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in n.RTCPeerConnection.prototype)){const e=n.RTCPeerConnection.prototype.addTrack;n.RTCPeerConnection.prototype.addStream=function(r){this._localStreams||(this._localStreams=[]),this._localStreams.includes(r)||this._localStreams.push(r),r.getAudioTracks().forEach(i=>e.call(this,i,r)),r.getVideoTracks().forEach(i=>e.call(this,i,r))},n.RTCPeerConnection.prototype.addTrack=function(r){for(var i=arguments.length,A=new Array(i>1?i-1:0),s=1;s<i;s++)A[s-1]=arguments[s];return A&&A.forEach(o=>{this._localStreams?this._localStreams.includes(o)||this._localStreams.push(o):this._localStreams=[o]}),e.apply(this,arguments)}}"removeStream"in n.RTCPeerConnection.prototype||(n.RTCPeerConnection.prototype.removeStream=function(t){this._localStreams||(this._localStreams=[]);const r=this._localStreams.indexOf(t);if(r===-1)return;this._localStreams.splice(r,1);const i=t.getTracks();this.getSenders().forEach(A=>{i.includes(A.track)&&this.removeTrack(A)})})}}function Ev(n){if(!(typeof n!="object"||!n.RTCPeerConnection)&&("getRemoteStreams"in n.RTCPeerConnection.prototype||(n.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in n.RTCPeerConnection.prototype))){Object.defineProperty(n.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(t){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=t),this.addEventListener("track",this._onaddstreampoly=r=>{r.streams.forEach(i=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(i))return;this._remoteStreams.push(i);const A=new Event("addstream");A.stream=i,this.dispatchEvent(A)})})}});const e=n.RTCPeerConnection.prototype.setRemoteDescription;n.RTCPeerConnection.prototype.setRemoteDescription=function(){const r=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(i){i.streams.forEach(A=>{if(r._remoteStreams||(r._remoteStreams=[]),r._remoteStreams.indexOf(A)>=0)return;r._remoteStreams.push(A);const s=new Event("addstream");s.stream=A,r.dispatchEvent(s)})}),e.apply(r,arguments)}}}function Uv(n){if(typeof n!="object"||!n.RTCPeerConnection)return;const e=n.RTCPeerConnection.prototype,t=e.createOffer,r=e.createAnswer,i=e.setLocalDescription,A=e.setRemoteDescription,s=e.addIceCandidate;e.createOffer=function(c,u){const l=arguments.length>=2?arguments[2]:arguments[0],d=t.apply(this,[l]);return u?(d.then(c,u),Promise.resolve()):d},e.createAnswer=function(c,u){const l=arguments.length>=2?arguments[2]:arguments[0],d=r.apply(this,[l]);return u?(d.then(c,u),Promise.resolve()):d};let o=function(a,c,u){const l=i.apply(this,[a]);return u?(l.then(c,u),Promise.resolve()):l};e.setLocalDescription=o,o=function(a,c,u){const l=A.apply(this,[a]);return u?(l.then(c,u),Promise.resolve()):l},e.setRemoteDescription=o,o=function(a,c,u){const l=s.apply(this,[a]);return u?(l.then(c,u),Promise.resolve()):l},e.addIceCandidate=o}function Tv(n){const e=n&&n.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){const t=e.mediaDevices,r=t.getUserMedia.bind(t);e.mediaDevices.getUserMedia=i=>r(Iv(i))}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=(function(r,i,A){e.mediaDevices.getUserMedia(r).then(i,A)}).bind(e))}function Iv(n){return n&&n.video!==void 0?Object.assign({},n,{video:rv(n.video)}):n}function Fv(n){if(!n.RTCPeerConnection)return;const e=n.RTCPeerConnection;n.RTCPeerConnection=function(r,i){if(r&&r.iceServers){const A=[];for(let s=0;s<r.iceServers.length;s++){let o=r.iceServers[s];o.urls===void 0&&o.url?(cl("RTCIceServer.url","RTCIceServer.urls"),o=JSON.parse(JSON.stringify(o)),o.urls=o.url,delete o.url,A.push(o)):A.push(r.iceServers[s])}r.iceServers=A}return new e(r,i)},n.RTCPeerConnection.prototype=e.prototype,"generateCertificate"in e&&Object.defineProperty(n.RTCPeerConnection,"generateCertificate",{get(){return e.generateCertificate}})}function xv(n){typeof n=="object"&&n.RTCTrackEvent&&"receiver"in n.RTCTrackEvent.prototype&&!("transceiver"in n.RTCTrackEvent.prototype)&&Object.defineProperty(n.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Qv(n){const e=n.RTCPeerConnection.prototype.createOffer;n.RTCPeerConnection.prototype.createOffer=function(r){if(r){typeof r.offerToReceiveAudio<"u"&&(r.offerToReceiveAudio=!!r.offerToReceiveAudio);const i=this.getTransceivers().find(s=>s.receiver.track.kind==="audio");r.offerToReceiveAudio===!1&&i?i.direction==="sendrecv"?i.setDirection?i.setDirection("sendonly"):i.direction="sendonly":i.direction==="recvonly"&&(i.setDirection?i.setDirection("inactive"):i.direction="inactive"):r.offerToReceiveAudio===!0&&!i&&this.addTransceiver("audio",{direction:"recvonly"}),typeof r.offerToReceiveVideo<"u"&&(r.offerToReceiveVideo=!!r.offerToReceiveVideo);const A=this.getTransceivers().find(s=>s.receiver.track.kind==="video");r.offerToReceiveVideo===!1&&A?A.direction==="sendrecv"?A.setDirection?A.setDirection("sendonly"):A.direction="sendonly":A.direction==="recvonly"&&(A.setDirection?A.setDirection("inactive"):A.direction="inactive"):r.offerToReceiveVideo===!0&&!A&&this.addTransceiver("video",{direction:"recvonly"})}return e.apply(this,arguments)}}function Rv(n){typeof n!="object"||n.AudioContext||(n.AudioContext=n.webkitAudioContext)}var Pv=Object.freeze({__proto__:null,shimAudioContext:Rv,shimCallbacksAPI:Uv,shimConstraints:Iv,shimCreateOfferLegacy:Qv,shimGetUserMedia:Tv,shimLocalStreamsAPI:kv,shimRTCIceServerUrls:Fv,shimRemoteStreamsAPI:Ev,shimTrackEventTransceiver:xv}),hl={exports:{}},Ov;function $I(){return Ov||(Ov=1,function(n){const e={};e.generateIdentifier=function(){return Math.random().toString(36).substring(2,12)},e.localCName=e.generateIdentifier(),e.splitLines=function(t){return t.trim().split(`
11
+ `).map(r=>r.trim())},e.splitSections=function(t){return t.split(`
12
+ m=`).map((i,A)=>(A>0?"m="+i:i).trim()+`\r
13
+ `)},e.getDescription=function(t){const r=e.splitSections(t);return r&&r[0]},e.getMediaSections=function(t){const r=e.splitSections(t);return r.shift(),r},e.matchPrefix=function(t,r){return e.splitLines(t).filter(i=>i.indexOf(r)===0)},e.parseCandidate=function(t){let r;t.indexOf("a=candidate:")===0?r=t.substring(12).split(" "):r=t.substring(10).split(" ");const i={foundation:r[0],component:{1:"rtp",2:"rtcp"}[r[1]]||r[1],protocol:r[2].toLowerCase(),priority:parseInt(r[3],10),ip:r[4],address:r[4],port:parseInt(r[5],10),type:r[7]};for(let A=8;A<r.length;A+=2)switch(r[A]){case"raddr":i.relatedAddress=r[A+1];break;case"rport":i.relatedPort=parseInt(r[A+1],10);break;case"tcptype":i.tcpType=r[A+1];break;case"ufrag":i.ufrag=r[A+1],i.usernameFragment=r[A+1];break;default:i[r[A]]===void 0&&(i[r[A]]=r[A+1]);break}return i},e.writeCandidate=function(t){const r=[];r.push(t.foundation);const i=t.component;i==="rtp"?r.push(1):i==="rtcp"?r.push(2):r.push(i),r.push(t.protocol.toUpperCase()),r.push(t.priority),r.push(t.address||t.ip),r.push(t.port);const A=t.type;return r.push("typ"),r.push(A),A!=="host"&&t.relatedAddress&&t.relatedPort&&(r.push("raddr"),r.push(t.relatedAddress),r.push("rport"),r.push(t.relatedPort)),t.tcpType&&t.protocol.toLowerCase()==="tcp"&&(r.push("tcptype"),r.push(t.tcpType)),(t.usernameFragment||t.ufrag)&&(r.push("ufrag"),r.push(t.usernameFragment||t.ufrag)),"candidate:"+r.join(" ")},e.parseIceOptions=function(t){return t.substring(14).split(" ")},e.parseRtpMap=function(t){let r=t.substring(9).split(" ");const i={payloadType:parseInt(r.shift(),10)};return r=r[0].split("/"),i.name=r[0],i.clockRate=parseInt(r[1],10),i.channels=r.length===3?parseInt(r[2],10):1,i.numChannels=i.channels,i},e.writeRtpMap=function(t){let r=t.payloadType;t.preferredPayloadType!==void 0&&(r=t.preferredPayloadType);const i=t.channels||t.numChannels||1;return"a=rtpmap:"+r+" "+t.name+"/"+t.clockRate+(i!==1?"/"+i:"")+`\r
14
+ `},e.parseExtmap=function(t){const r=t.substring(9).split(" ");return{id:parseInt(r[0],10),direction:r[0].indexOf("/")>0?r[0].split("/")[1]:"sendrecv",uri:r[1],attributes:r.slice(2).join(" ")}},e.writeExtmap=function(t){return"a=extmap:"+(t.id||t.preferredId)+(t.direction&&t.direction!=="sendrecv"?"/"+t.direction:"")+" "+t.uri+(t.attributes?" "+t.attributes:"")+`\r
15
+ `},e.parseFmtp=function(t){const r={};let i;const A=t.substring(t.indexOf(" ")+1).split(";");for(let s=0;s<A.length;s++)i=A[s].trim().split("="),r[i[0].trim()]=i[1];return r},e.writeFmtp=function(t){let r="",i=t.payloadType;if(t.preferredPayloadType!==void 0&&(i=t.preferredPayloadType),t.parameters&&Object.keys(t.parameters).length){const A=[];Object.keys(t.parameters).forEach(s=>{t.parameters[s]!==void 0?A.push(s+"="+t.parameters[s]):A.push(s)}),r+="a=fmtp:"+i+" "+A.join(";")+`\r
16
+ `}return r},e.parseRtcpFb=function(t){const r=t.substring(t.indexOf(" ")+1).split(" ");return{type:r.shift(),parameter:r.join(" ")}},e.writeRtcpFb=function(t){let r="",i=t.payloadType;return t.preferredPayloadType!==void 0&&(i=t.preferredPayloadType),t.rtcpFeedback&&t.rtcpFeedback.length&&t.rtcpFeedback.forEach(A=>{r+="a=rtcp-fb:"+i+" "+A.type+(A.parameter&&A.parameter.length?" "+A.parameter:"")+`\r
17
+ `}),r},e.parseSsrcMedia=function(t){const r=t.indexOf(" "),i={ssrc:parseInt(t.substring(7,r),10)},A=t.indexOf(":",r);return A>-1?(i.attribute=t.substring(r+1,A),i.value=t.substring(A+1)):i.attribute=t.substring(r+1),i},e.parseSsrcGroup=function(t){const r=t.substring(13).split(" ");return{semantics:r.shift(),ssrcs:r.map(i=>parseInt(i,10))}},e.getMid=function(t){const r=e.matchPrefix(t,"a=mid:")[0];if(r)return r.substring(6)},e.parseFingerprint=function(t){const r=t.substring(14).split(" ");return{algorithm:r[0].toLowerCase(),value:r[1].toUpperCase()}},e.getDtlsParameters=function(t,r){return{role:"auto",fingerprints:e.matchPrefix(t+r,"a=fingerprint:").map(e.parseFingerprint)}},e.writeDtlsParameters=function(t,r){let i="a=setup:"+r+`\r
18
+ `;return t.fingerprints.forEach(A=>{i+="a=fingerprint:"+A.algorithm+" "+A.value+`\r
19
+ `}),i},e.parseCryptoLine=function(t){const r=t.substring(9).split(" ");return{tag:parseInt(r[0],10),cryptoSuite:r[1],keyParams:r[2],sessionParams:r.slice(3)}},e.writeCryptoLine=function(t){return"a=crypto:"+t.tag+" "+t.cryptoSuite+" "+(typeof t.keyParams=="object"?e.writeCryptoKeyParams(t.keyParams):t.keyParams)+(t.sessionParams?" "+t.sessionParams.join(" "):"")+`\r
20
+ `},e.parseCryptoKeyParams=function(t){if(t.indexOf("inline:")!==0)return null;const r=t.substring(7).split("|");return{keyMethod:"inline",keySalt:r[0],lifeTime:r[1],mkiValue:r[2]?r[2].split(":")[0]:void 0,mkiLength:r[2]?r[2].split(":")[1]:void 0}},e.writeCryptoKeyParams=function(t){return t.keyMethod+":"+t.keySalt+(t.lifeTime?"|"+t.lifeTime:"")+(t.mkiValue&&t.mkiLength?"|"+t.mkiValue+":"+t.mkiLength:"")},e.getCryptoParameters=function(t,r){return e.matchPrefix(t+r,"a=crypto:").map(e.parseCryptoLine)},e.getIceParameters=function(t,r){const i=e.matchPrefix(t+r,"a=ice-ufrag:")[0],A=e.matchPrefix(t+r,"a=ice-pwd:")[0];return i&&A?{usernameFragment:i.substring(12),password:A.substring(10)}:null},e.writeIceParameters=function(t){let r="a=ice-ufrag:"+t.usernameFragment+`\r
21
+ a=ice-pwd:`+t.password+`\r
22
+ `;return t.iceLite&&(r+=`a=ice-lite\r
23
+ `),r},e.parseRtpParameters=function(t){const r={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},A=e.splitLines(t)[0].split(" ");r.profile=A[2];for(let o=3;o<A.length;o++){const a=A[o],c=e.matchPrefix(t,"a=rtpmap:"+a+" ")[0];if(c){const u=e.parseRtpMap(c),l=e.matchPrefix(t,"a=fmtp:"+a+" ");switch(u.parameters=l.length?e.parseFmtp(l[0]):{},u.rtcpFeedback=e.matchPrefix(t,"a=rtcp-fb:"+a+" ").map(e.parseRtcpFb),r.codecs.push(u),u.name.toUpperCase()){case"RED":case"ULPFEC":r.fecMechanisms.push(u.name.toUpperCase());break}}}e.matchPrefix(t,"a=extmap:").forEach(o=>{r.headerExtensions.push(e.parseExtmap(o))});const s=e.matchPrefix(t,"a=rtcp-fb:* ").map(e.parseRtcpFb);return r.codecs.forEach(o=>{s.forEach(a=>{o.rtcpFeedback.find(u=>u.type===a.type&&u.parameter===a.parameter)||o.rtcpFeedback.push(a)})}),r},e.writeRtpDescription=function(t,r){let i="";i+="m="+t+" ",i+=r.codecs.length>0?"9":"0",i+=" "+(r.profile||"UDP/TLS/RTP/SAVPF")+" ",i+=r.codecs.map(s=>s.preferredPayloadType!==void 0?s.preferredPayloadType:s.payloadType).join(" ")+`\r
24
24
  `,i+=`c=IN IP4 0.0.0.0\r
25
25
  `,i+=`a=rtcp:9 IN IP4 0.0.0.0\r
26
- `,n.codecs.forEach(s=>{i+=e.writeRtpMap(s),i+=e.writeFmtp(s),i+=e.writeRtcpFb(s)});let r=0;return n.codecs.forEach(s=>{s.maxptime>r&&(r=s.maxptime)}),r>0&&(i+="a=maxptime:"+r+`\r
27
- `),n.headerExtensions&&n.headerExtensions.forEach(s=>{i+=e.writeExtmap(s)}),i},e.parseRtpEncodingParameters=function(A){const n=[],i=e.parseRtpParameters(A),r=i.fecMechanisms.indexOf("RED")!==-1,s=i.fecMechanisms.indexOf("ULPFEC")!==-1,a=e.matchPrefix(A,"a=ssrc:").map(d=>e.parseSsrcMedia(d)).filter(d=>d.attribute==="cname"),o=a.length>0&&a[0].ssrc;let c;const l=e.matchPrefix(A,"a=ssrc-group:FID").map(d=>d.substring(17).split(" ").map(g=>parseInt(g,10)));l.length>0&&l[0].length>1&&l[0][0]===o&&(c=l[0][1]),i.codecs.forEach(d=>{if(d.name.toUpperCase()==="RTX"&&d.parameters.apt){let h={ssrc:o,codecPayloadType:parseInt(d.parameters.apt,10)};o&&c&&(h.rtx={ssrc:c}),n.push(h),r&&(h=JSON.parse(JSON.stringify(h)),h.fec={ssrc:o,mechanism:s?"red+ulpfec":"red"},n.push(h))}}),n.length===0&&o&&n.push({ssrc:o});let u=e.matchPrefix(A,"b=");return u.length&&(u[0].indexOf("b=TIAS:")===0?u=parseInt(u[0].substring(7),10):u[0].indexOf("b=AS:")===0?u=parseInt(u[0].substring(5),10)*1e3*.95-50*40*8:u=void 0,n.forEach(d=>{d.maxBitrate=u})),n},e.parseRtcpParameters=function(A){const n={},i=e.matchPrefix(A,"a=ssrc:").map(a=>e.parseSsrcMedia(a)).filter(a=>a.attribute==="cname")[0];i&&(n.cname=i.value,n.ssrc=i.ssrc);const r=e.matchPrefix(A,"a=rtcp-rsize");n.reducedSize=r.length>0,n.compound=r.length===0;const s=e.matchPrefix(A,"a=rtcp-mux");return n.mux=s.length>0,n},e.writeRtcpParameters=function(A){let n="";return A.reducedSize&&(n+=`a=rtcp-rsize\r
28
- `),A.mux&&(n+=`a=rtcp-mux\r
29
- `),A.ssrc!==void 0&&A.cname&&(n+="a=ssrc:"+A.ssrc+" cname:"+A.cname+`\r
30
- `),n},e.parseMsid=function(A){let n;const i=e.matchPrefix(A,"a=msid:");if(i.length===1)return n=i[0].substring(7).split(" "),{stream:n[0],track:n[1]};const r=e.matchPrefix(A,"a=ssrc:").map(s=>e.parseSsrcMedia(s)).filter(s=>s.attribute==="msid");if(r.length>0)return n=r[0].value.split(" "),{stream:n[0],track:n[1]}},e.parseSctpDescription=function(A){const n=e.parseMLine(A),i=e.matchPrefix(A,"a=max-message-size:");let r;i.length>0&&(r=parseInt(i[0].substring(19),10)),isNaN(r)&&(r=65536);const s=e.matchPrefix(A,"a=sctp-port:");if(s.length>0)return{port:parseInt(s[0].substring(12),10),protocol:n.fmt,maxMessageSize:r};const a=e.matchPrefix(A,"a=sctpmap:");if(a.length>0){const o=a[0].substring(10).split(" ");return{port:parseInt(o[0],10),protocol:o[1],maxMessageSize:r}}},e.writeSctpDescription=function(A,n){let i=[];return A.protocol!=="DTLS/SCTP"?i=["m="+A.kind+" 9 "+A.protocol+" "+n.protocol+`\r
26
+ `,r.codecs.forEach(s=>{i+=e.writeRtpMap(s),i+=e.writeFmtp(s),i+=e.writeRtcpFb(s)});let A=0;return r.codecs.forEach(s=>{s.maxptime>A&&(A=s.maxptime)}),A>0&&(i+="a=maxptime:"+A+`\r
27
+ `),r.headerExtensions&&r.headerExtensions.forEach(s=>{i+=e.writeExtmap(s)}),i},e.parseRtpEncodingParameters=function(t){const r=[],i=e.parseRtpParameters(t),A=i.fecMechanisms.indexOf("RED")!==-1,s=i.fecMechanisms.indexOf("ULPFEC")!==-1,o=e.matchPrefix(t,"a=ssrc:").map(d=>e.parseSsrcMedia(d)).filter(d=>d.attribute==="cname"),a=o.length>0&&o[0].ssrc;let c;const u=e.matchPrefix(t,"a=ssrc-group:FID").map(d=>d.substring(17).split(" ").map(f=>parseInt(f,10)));u.length>0&&u[0].length>1&&u[0][0]===a&&(c=u[0][1]),i.codecs.forEach(d=>{if(d.name.toUpperCase()==="RTX"&&d.parameters.apt){let h={ssrc:a,codecPayloadType:parseInt(d.parameters.apt,10)};a&&c&&(h.rtx={ssrc:c}),r.push(h),A&&(h=JSON.parse(JSON.stringify(h)),h.fec={ssrc:a,mechanism:s?"red+ulpfec":"red"},r.push(h))}}),r.length===0&&a&&r.push({ssrc:a});let l=e.matchPrefix(t,"b=");return l.length&&(l[0].indexOf("b=TIAS:")===0?l=parseInt(l[0].substring(7),10):l[0].indexOf("b=AS:")===0?l=parseInt(l[0].substring(5),10)*1e3*.95-50*40*8:l=void 0,r.forEach(d=>{d.maxBitrate=l})),r},e.parseRtcpParameters=function(t){const r={},i=e.matchPrefix(t,"a=ssrc:").map(o=>e.parseSsrcMedia(o)).filter(o=>o.attribute==="cname")[0];i&&(r.cname=i.value,r.ssrc=i.ssrc);const A=e.matchPrefix(t,"a=rtcp-rsize");r.reducedSize=A.length>0,r.compound=A.length===0;const s=e.matchPrefix(t,"a=rtcp-mux");return r.mux=s.length>0,r},e.writeRtcpParameters=function(t){let r="";return t.reducedSize&&(r+=`a=rtcp-rsize\r
28
+ `),t.mux&&(r+=`a=rtcp-mux\r
29
+ `),t.ssrc!==void 0&&t.cname&&(r+="a=ssrc:"+t.ssrc+" cname:"+t.cname+`\r
30
+ `),r},e.parseMsid=function(t){let r;const i=e.matchPrefix(t,"a=msid:");if(i.length===1)return r=i[0].substring(7).split(" "),{stream:r[0],track:r[1]};const A=e.matchPrefix(t,"a=ssrc:").map(s=>e.parseSsrcMedia(s)).filter(s=>s.attribute==="msid");if(A.length>0)return r=A[0].value.split(" "),{stream:r[0],track:r[1]}},e.parseSctpDescription=function(t){const r=e.parseMLine(t),i=e.matchPrefix(t,"a=max-message-size:");let A;i.length>0&&(A=parseInt(i[0].substring(19),10)),isNaN(A)&&(A=65536);const s=e.matchPrefix(t,"a=sctp-port:");if(s.length>0)return{port:parseInt(s[0].substring(12),10),protocol:r.fmt,maxMessageSize:A};const o=e.matchPrefix(t,"a=sctpmap:");if(o.length>0){const a=o[0].substring(10).split(" ");return{port:parseInt(a[0],10),protocol:a[1],maxMessageSize:A}}},e.writeSctpDescription=function(t,r){let i=[];return t.protocol!=="DTLS/SCTP"?i=["m="+t.kind+" 9 "+t.protocol+" "+r.protocol+`\r
31
31
  `,`c=IN IP4 0.0.0.0\r
32
- `,"a=sctp-port:"+n.port+`\r
33
- `]:i=["m="+A.kind+" 9 "+A.protocol+" "+n.port+`\r
32
+ `,"a=sctp-port:"+r.port+`\r
33
+ `]:i=["m="+t.kind+" 9 "+t.protocol+" "+r.port+`\r
34
34
  `,`c=IN IP4 0.0.0.0\r
35
- `,"a=sctpmap:"+n.port+" "+n.protocol+` 65535\r
36
- `],n.maxMessageSize!==void 0&&i.push("a=max-message-size:"+n.maxMessageSize+`\r
37
- `),i.join("")},e.generateSessionId=function(){return Math.random().toString().substr(2,22)},e.writeSessionBoilerplate=function(A,n,i){let r;const s=n!==void 0?n:2;return A?r=A:r=e.generateSessionId(),`v=0\r
38
- o=`+(i||"thisisadapterortc")+" "+r+" "+s+` IN IP4 127.0.0.1\r
35
+ `,"a=sctpmap:"+r.port+" "+r.protocol+` 65535\r
36
+ `],r.maxMessageSize!==void 0&&i.push("a=max-message-size:"+r.maxMessageSize+`\r
37
+ `),i.join("")},e.generateSessionId=function(){return Math.random().toString().substr(2,22)},e.writeSessionBoilerplate=function(t,r,i){let A;const s=r!==void 0?r:2;return t?A=t:A=e.generateSessionId(),`v=0\r
38
+ o=`+(i||"thisisadapterortc")+" "+A+" "+s+` IN IP4 127.0.0.1\r
39
39
  s=-\r
40
40
  t=0 0\r
41
- `},e.getDirection=function(A,n){const i=e.splitLines(A);for(let r=0;r<i.length;r++)switch(i[r]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return i[r].substring(2)}return n?e.getDirection(n):"sendrecv"},e.getKind=function(A){return e.splitLines(A)[0].split(" ")[0].substring(2)},e.isRejected=function(A){return A.split(" ",2)[1]==="0"},e.parseMLine=function(A){const i=e.splitLines(A)[0].substring(2).split(" ");return{kind:i[0],port:parseInt(i[1],10),protocol:i[2],fmt:i.slice(3).join(" ")}},e.parseOLine=function(A){const i=e.matchPrefix(A,"o=")[0].substring(2).split(" ");return{username:i[0],sessionId:i[1],sessionVersion:parseInt(i[2],10),netType:i[3],addressType:i[4],address:i[5]}},e.isValidSDP=function(A){if(typeof A!="string"||A.length===0)return!1;const n=e.splitLines(A);for(let i=0;i<n.length;i++)if(n[i].length<2||n[i].charAt(1)!=="=")return!1;return!0},t.exports=e}(Aa)),Aa.exports}var gd=bw(),Nt=lw(gd),yw=Rv({__proto__:null,default:Nt},[gd]);function er(t){if(!t.RTCIceCandidate||t.RTCIceCandidate&&"foundation"in t.RTCIceCandidate.prototype)return;const e=t.RTCIceCandidate;t.RTCIceCandidate=function(n){if(typeof n=="object"&&n.candidate&&n.candidate.indexOf("a=")===0&&(n=JSON.parse(JSON.stringify(n)),n.candidate=n.candidate.substring(2)),n.candidate&&n.candidate.length){const i=new e(n),r=Nt.parseCandidate(n.candidate);for(const s in r)s in i||Object.defineProperty(i,s,{value:r[s]});return i.toJSON=function(){return{candidate:i.candidate,sdpMid:i.sdpMid,sdpMLineIndex:i.sdpMLineIndex,usernameFragment:i.usernameFragment}},i}return new e(n)},t.RTCIceCandidate.prototype=e.prototype,pt(t,"icecandidate",A=>(A.candidate&&Object.defineProperty(A,"candidate",{value:new t.RTCIceCandidate(A.candidate),writable:"false"}),A))}function ta(t){!t.RTCIceCandidate||t.RTCIceCandidate&&"relayProtocol"in t.RTCIceCandidate.prototype||pt(t,"icecandidate",e=>{if(e.candidate){const A=Nt.parseCandidate(e.candidate.candidate);A.type==="relay"&&(e.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[A.priority>>24])}return e})}function Ar(t,e){if(!t.RTCPeerConnection)return;"sctp"in t.RTCPeerConnection.prototype||Object.defineProperty(t.RTCPeerConnection.prototype,"sctp",{get(){return typeof this._sctp>"u"?null:this._sctp}});const A=function(a){if(!a||!a.sdp)return!1;const o=Nt.splitSections(a.sdp);return o.shift(),o.some(c=>{const l=Nt.parseMLine(c);return l&&l.kind==="application"&&l.protocol.indexOf("SCTP")!==-1})},n=function(a){const o=a.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(o===null||o.length<2)return-1;const c=parseInt(o[1],10);return c!==c?-1:c},i=function(a){let o=65536;return e.browser==="firefox"&&(e.version<57?a===-1?o=16384:o=2147483637:e.version<60?o=e.version===57?65535:65536:o=2147483637),o},r=function(a,o){let c=65536;e.browser==="firefox"&&e.version===57&&(c=65535);const l=Nt.matchPrefix(a.sdp,"a=max-message-size:");return l.length>0?c=parseInt(l[0].substring(19),10):e.browser==="firefox"&&o!==-1&&(c=2147483637),c},s=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,e.browser==="chrome"&&e.version>=76){const{sdpSemantics:o}=this.getConfiguration();o==="plan-b"&&Object.defineProperty(this,"sctp",{get(){return typeof this._sctp>"u"?null:this._sctp},enumerable:!0,configurable:!0})}if(A(arguments[0])){const o=n(arguments[0]),c=i(o),l=r(arguments[0],o);let u;c===0&&l===0?u=Number.POSITIVE_INFINITY:c===0||l===0?u=Math.max(c,l):u=Math.min(c,l);const d={};Object.defineProperty(d,"maxMessageSize",{get(){return u}}),this._sctp=d}return s.apply(this,arguments)}}function tr(t){if(!(t.RTCPeerConnection&&"createDataChannel"in t.RTCPeerConnection.prototype))return;function e(n,i){const r=n.send;n.send=function(){const a=arguments[0],o=a.length||a.size||a.byteLength;if(n.readyState==="open"&&i.sctp&&o>i.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+i.sctp.maxMessageSize+" bytes)");return r.apply(n,arguments)}}const A=t.RTCPeerConnection.prototype.createDataChannel;t.RTCPeerConnection.prototype.createDataChannel=function(){const i=A.apply(this,arguments);return e(i,this),i},pt(t,"datachannel",n=>(e(n.channel,n.target),n))}function na(t){if(!t.RTCPeerConnection||"connectionState"in t.RTCPeerConnection.prototype)return;const e=t.RTCPeerConnection.prototype;Object.defineProperty(e,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(e,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(A){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),A&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=A)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach(A=>{const n=e[A];e[A]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=i=>{const r=i.target;if(r._lastConnectionState!==r.connectionState){r._lastConnectionState=r.connectionState;const s=new Event("connectionstatechange",i);r.dispatchEvent(s)}return i},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),n.apply(this,arguments)}})}function ia(t,e){if(!t.RTCPeerConnection||e.browser==="chrome"&&e.version>=71||e.browser==="safari"&&e.version>=605)return;const A=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(i){if(i&&i.sdp&&i.sdp.indexOf(`
42
- a=extmap-allow-mixed`)!==-1){const r=i.sdp.split(`
41
+ `},e.getDirection=function(t,r){const i=e.splitLines(t);for(let A=0;A<i.length;A++)switch(i[A]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return i[A].substring(2)}return r?e.getDirection(r):"sendrecv"},e.getKind=function(t){return e.splitLines(t)[0].split(" ")[0].substring(2)},e.isRejected=function(t){return t.split(" ",2)[1]==="0"},e.parseMLine=function(t){const i=e.splitLines(t)[0].substring(2).split(" ");return{kind:i[0],port:parseInt(i[1],10),protocol:i[2],fmt:i.slice(3).join(" ")}},e.parseOLine=function(t){const i=e.matchPrefix(t,"o=")[0].substring(2).split(" ");return{username:i[0],sessionId:i[1],sessionVersion:parseInt(i[2],10),netType:i[3],addressType:i[4],address:i[5]}},e.isValidSDP=function(t){if(typeof t!="string"||t.length===0)return!1;const r=e.splitLines(t);for(let i=0;i<r.length;i++)if(r[i].length<2||r[i].charAt(1)!=="=")return!1;return!0},n.exports=e}(hl)),hl.exports}var Mv=$I(),Ti=NI(Mv),eF=dT({__proto__:null,default:Ti},[Mv]);function qo(n){if(!n.RTCIceCandidate||n.RTCIceCandidate&&"foundation"in n.RTCIceCandidate.prototype)return;const e=n.RTCIceCandidate;n.RTCIceCandidate=function(r){if(typeof r=="object"&&r.candidate&&r.candidate.indexOf("a=")===0&&(r=JSON.parse(JSON.stringify(r)),r.candidate=r.candidate.substring(2)),r.candidate&&r.candidate.length){const i=new e(r),A=Ti.parseCandidate(r.candidate);for(const s in A)s in i||Object.defineProperty(i,s,{value:A[s]});return i.toJSON=function(){return{candidate:i.candidate,sdpMid:i.sdpMid,sdpMLineIndex:i.sdpMLineIndex,usernameFragment:i.usernameFragment}},i}return new e(r)},n.RTCIceCandidate.prototype=e.prototype,Gr(n,"icecandidate",t=>(t.candidate&&Object.defineProperty(t,"candidate",{value:new n.RTCIceCandidate(t.candidate),writable:"false"}),t))}function pl(n){!n.RTCIceCandidate||n.RTCIceCandidate&&"relayProtocol"in n.RTCIceCandidate.prototype||Gr(n,"icecandidate",e=>{if(e.candidate){const t=Ti.parseCandidate(e.candidate.candidate);t.type==="relay"&&(e.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[t.priority>>24])}return e})}function Jo(n,e){if(!n.RTCPeerConnection)return;"sctp"in n.RTCPeerConnection.prototype||Object.defineProperty(n.RTCPeerConnection.prototype,"sctp",{get(){return typeof this._sctp>"u"?null:this._sctp}});const t=function(o){if(!o||!o.sdp)return!1;const a=Ti.splitSections(o.sdp);return a.shift(),a.some(c=>{const u=Ti.parseMLine(c);return u&&u.kind==="application"&&u.protocol.indexOf("SCTP")!==-1})},r=function(o){const a=o.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(a===null||a.length<2)return-1;const c=parseInt(a[1],10);return c!==c?-1:c},i=function(o){let a=65536;return e.browser==="firefox"&&(e.version<57?o===-1?a=16384:a=2147483637:e.version<60?a=e.version===57?65535:65536:a=2147483637),a},A=function(o,a){let c=65536;e.browser==="firefox"&&e.version===57&&(c=65535);const u=Ti.matchPrefix(o.sdp,"a=max-message-size:");return u.length>0?c=parseInt(u[0].substring(19),10):e.browser==="firefox"&&a!==-1&&(c=2147483637),c},s=n.RTCPeerConnection.prototype.setRemoteDescription;n.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,e.browser==="chrome"&&e.version>=76){const{sdpSemantics:a}=this.getConfiguration();a==="plan-b"&&Object.defineProperty(this,"sctp",{get(){return typeof this._sctp>"u"?null:this._sctp},enumerable:!0,configurable:!0})}if(t(arguments[0])){const a=r(arguments[0]),c=i(a),u=A(arguments[0],a);let l;c===0&&u===0?l=Number.POSITIVE_INFINITY:c===0||u===0?l=Math.max(c,u):l=Math.min(c,u);const d={};Object.defineProperty(d,"maxMessageSize",{get(){return l}}),this._sctp=d}return s.apply(this,arguments)}}function zo(n){if(!(n.RTCPeerConnection&&"createDataChannel"in n.RTCPeerConnection.prototype))return;function e(r,i){const A=r.send;r.send=function(){const o=arguments[0],a=o.length||o.size||o.byteLength;if(r.readyState==="open"&&i.sctp&&a>i.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+i.sctp.maxMessageSize+" bytes)");return A.apply(r,arguments)}}const t=n.RTCPeerConnection.prototype.createDataChannel;n.RTCPeerConnection.prototype.createDataChannel=function(){const i=t.apply(this,arguments);return e(i,this),i},Gr(n,"datachannel",r=>(e(r.channel,r.target),r))}function fl(n){if(!n.RTCPeerConnection||"connectionState"in n.RTCPeerConnection.prototype)return;const e=n.RTCPeerConnection.prototype;Object.defineProperty(e,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(e,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(t){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),t&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=t)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach(t=>{const r=e[t];e[t]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=i=>{const A=i.target;if(A._lastConnectionState!==A.connectionState){A._lastConnectionState=A.connectionState;const s=new Event("connectionstatechange",i);A.dispatchEvent(s)}return i},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),r.apply(this,arguments)}})}function gl(n,e){if(!n.RTCPeerConnection||e.browser==="chrome"&&e.version>=71||e.browser==="safari"&&e.version>=605)return;const t=n.RTCPeerConnection.prototype.setRemoteDescription;n.RTCPeerConnection.prototype.setRemoteDescription=function(i){if(i&&i.sdp&&i.sdp.indexOf(`
42
+ a=extmap-allow-mixed`)!==-1){const A=i.sdp.split(`
43
43
  `).filter(s=>s.trim()!=="a=extmap-allow-mixed").join(`
44
- `);t.RTCSessionDescription&&i instanceof t.RTCSessionDescription?arguments[0]=new t.RTCSessionDescription({type:i.type,sdp:r}):i.sdp=r}return A.apply(this,arguments)}}function nr(t,e){if(!(t.RTCPeerConnection&&t.RTCPeerConnection.prototype))return;const A=t.RTCPeerConnection.prototype.addIceCandidate;!A||A.length===0||(t.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?(e.browser==="chrome"&&e.version<78||e.browser==="firefox"&&e.version<68||e.browser==="safari")&&arguments[0]&&arguments[0].candidate===""?Promise.resolve():A.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function ir(t,e){if(!(t.RTCPeerConnection&&t.RTCPeerConnection.prototype))return;const A=t.RTCPeerConnection.prototype.setLocalDescription;!A||A.length===0||(t.RTCPeerConnection.prototype.setLocalDescription=function(){let i=arguments[0]||{};if(typeof i!="object"||i.type&&i.sdp)return A.apply(this,arguments);if(i={type:i.type,sdp:i.sdp},!i.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":i.type="offer";break;default:i.type="answer";break}return i.sdp||i.type!=="offer"&&i.type!=="answer"?A.apply(this,[i]):(i.type==="offer"?this.createOffer:this.createAnswer).apply(this).then(s=>A.apply(this,[s]))})}var Uw=Object.freeze({__proto__:null,removeExtmapAllowMixed:ia,shimAddIceCandidateNullOrEmpty:nr,shimConnectionState:na,shimMaxMessageSize:Ar,shimParameterlessSetLocalDescription:ir,shimRTCIceCandidate:er,shimRTCIceCandidateRelayProtocol:ta,shimSendThrowTypeError:tr});function Qw(){let{window:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimSafari:!0};const A=_u,n=Cw(t),i={browserDetails:n,commonShim:Uw,extractVersion:$i,disableLog:Bw,disableWarnings:vw,sdp:yw};switch(n.browser){case"chrome":if(!Wu||!$s||!e.shimChrome)return A("Chrome shim is not included in this adapter release."),i;if(n.version===null)return A("Chrome shim can not determine version, not shimming."),i;A("adapter.js shimming chrome."),i.browserShim=Wu,nr(t,n),ir(t),Hu(t,n),Ou(t),$s(t,n),Mu(t),Gu(t,n),Nu(t),Ku(t),ju(t,n),er(t),ta(t),na(t),Ar(t,n),tr(t),ia(t,n);break;case"firefox":if(!nd||!ea||!e.shimFirefox)return A("Firefox shim is not included in this adapter release."),i;A("adapter.js shimming firefox."),i.browserShim=nd,nr(t,n),ir(t),Ju(t,n),ea(t,n),Xu(t),zu(t),qu(t),Yu(t),Zu(t),$u(t),ed(t),Ad(t),td(t),er(t),na(t),Ar(t,n),tr(t);break;case"safari":if(!hd||!e.shimSafari)return A("Safari shim is not included in this adapter release."),i;A("adapter.js shimming safari."),i.browserShim=hd,nr(t,n),ir(t),cd(t),ud(t),sd(t),id(t),rd(t),ld(t),ad(t),dd(t),er(t),ta(t),Ar(t,n),tr(t),ia(t,n);break;default:A("Unsupported browser!");break}return i}Qw({window:typeof window>"u"?void 0:window});const Ew=10,rr="lk_e2ee",Sw={sharedKey:!1,ratchetSalt:"LKFrameEncryptionKey",ratchetWindowSize:8,failureTolerance:Ew,keyringSize:16};var qA;(function(t){t.SetKey="setKey",t.RatchetRequest="ratchetRequest",t.KeyRatcheted="keyRatcheted"})(qA||(qA={}));var pd;(function(t){t.KeyRatcheted="keyRatcheted"})(pd||(pd={}));var YA;(function(t){t.ParticipantEncryptionStatusChanged="participantEncryptionStatusChanged",t.EncryptionError="encryptionError"})(YA||(YA={}));var md;(function(t){t.Error="cryptorError"})(md||(md={}));function kw(){return Tw()||ra()}function ra(){return typeof window.RTCRtpScriptTransform<"u"}function Tw(){return typeof window.RTCRtpSender<"u"&&typeof window.RTCRtpSender.prototype.createEncodedStreams<"u"}class OU extends yA.EventEmitter{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(),this.onKeyRatcheted=(A,n,i)=>{W.debug("key ratcheted event received",{ratchetResult:A,participantId:n,keyIndex:i})},this.keyInfoMap=new Map,this.options=Object.assign(Object.assign({},Sw),e),this.on(qA.KeyRatcheted,this.onKeyRatcheted)}onSetEncryptionKey(e,A,n){const i={key:e,participantIdentity:A,keyIndex:n};if(!this.options.sharedKey&&!A)throw new Error("participant identity needs to be passed for encryption key if sharedKey option is false");this.keyInfoMap.set("".concat(A??"shared","-").concat(n??0),i),this.emit(qA.SetKey,i)}getKeys(){return Array.from(this.keyInfoMap.values())}getOptions(){return this.options}ratchetKey(e,A){this.emit(qA.RatchetRequest,e,A)}}class zA extends Error{constructor(e,A){super(A||"an error has occured"),this.name="LiveKitError",this.code=e}}var J;(function(t){t[t.NotAllowed=0]="NotAllowed",t[t.ServerUnreachable=1]="ServerUnreachable",t[t.InternalError=2]="InternalError",t[t.Cancelled=3]="Cancelled",t[t.LeaveRequest=4]="LeaveRequest"})(J||(J={}));class Ae extends zA{constructor(e,A,n,i){super(1,e),this.name="ConnectionError",this.status=n,this.reason=A,this.context=i,this.reasonName=J[A]}}class sa extends zA{constructor(e){super(21,e??"device is unsupported"),this.name="DeviceUnsupportedError"}}class IA extends zA{constructor(e){super(20,e??"track is invalid"),this.name="TrackInvalidError"}}class Fw extends zA{constructor(e){super(10,e??"unsupported server"),this.name="UnsupportedServer"}}class ye extends zA{constructor(e){super(12,e??"unexpected connection state"),this.name="UnexpectedConnectionState"}}class aa extends zA{constructor(e){super(13,e??"unable to negotiate"),this.name="NegotiationError"}}class oa extends zA{constructor(e,A){super(15,e),this.name="PublishTrackError",this.status=A}}class Bd extends zA{constructor(e,A){super(15,e),this.reason=A,this.reasonName=typeof A=="string"?A:qs[A]}}var sr;(function(t){t.PermissionDenied="PermissionDenied",t.NotFound="NotFound",t.DeviceInUse="DeviceInUse",t.Other="Other"})(sr||(sr={})),function(t){function e(A){if(A&&"name"in A)return A.name==="NotFoundError"||A.name==="DevicesNotFoundError"?t.NotFound:A.name==="NotAllowedError"||A.name==="PermissionDeniedError"?t.PermissionDenied:A.name==="NotReadableError"||A.name==="TrackStartError"?t.DeviceInUse:t.Other}t.getFailure=e}(sr||(sr={}));var vd;(function(t){t[t.InvalidKey=0]="InvalidKey",t[t.MissingKey=1]="MissingKey",t[t.InternalError=2]="InternalError"})(vd||(vd={}));var I;(function(t){t.Connected="connected",t.Reconnecting="reconnecting",t.SignalReconnecting="signalReconnecting",t.Reconnected="reconnected",t.Disconnected="disconnected",t.ConnectionStateChanged="connectionStateChanged",t.Moved="moved",t.MediaDevicesChanged="mediaDevicesChanged",t.ParticipantConnected="participantConnected",t.ParticipantDisconnected="participantDisconnected",t.TrackPublished="trackPublished",t.TrackSubscribed="trackSubscribed",t.TrackSubscriptionFailed="trackSubscriptionFailed",t.TrackUnpublished="trackUnpublished",t.TrackUnsubscribed="trackUnsubscribed",t.TrackMuted="trackMuted",t.TrackUnmuted="trackUnmuted",t.LocalTrackPublished="localTrackPublished",t.LocalTrackUnpublished="localTrackUnpublished",t.LocalAudioSilenceDetected="localAudioSilenceDetected",t.ActiveSpeakersChanged="activeSpeakersChanged",t.ParticipantMetadataChanged="participantMetadataChanged",t.ParticipantNameChanged="participantNameChanged",t.ParticipantAttributesChanged="participantAttributesChanged",t.ParticipantActive="participantActive",t.RoomMetadataChanged="roomMetadataChanged",t.DataReceived="dataReceived",t.SipDTMFReceived="sipDTMFReceived",t.TranscriptionReceived="transcriptionReceived",t.ConnectionQualityChanged="connectionQualityChanged",t.TrackStreamStateChanged="trackStreamStateChanged",t.TrackSubscriptionPermissionChanged="trackSubscriptionPermissionChanged",t.TrackSubscriptionStatusChanged="trackSubscriptionStatusChanged",t.AudioPlaybackStatusChanged="audioPlaybackChanged",t.VideoPlaybackStatusChanged="videoPlaybackChanged",t.MediaDevicesError="mediaDevicesError",t.ParticipantPermissionsChanged="participantPermissionsChanged",t.SignalConnected="signalConnected",t.RecordingStatusChanged="recordingStatusChanged",t.ParticipantEncryptionStatusChanged="participantEncryptionStatusChanged",t.EncryptionError="encryptionError",t.DCBufferStatusChanged="dcBufferStatusChanged",t.ActiveDeviceChanged="activeDeviceChanged",t.ChatMessage="chatMessage",t.LocalTrackSubscribed="localTrackSubscribed",t.MetricsReceived="metricsReceived"})(I||(I={}));var D;(function(t){t.TrackPublished="trackPublished",t.TrackSubscribed="trackSubscribed",t.TrackSubscriptionFailed="trackSubscriptionFailed",t.TrackUnpublished="trackUnpublished",t.TrackUnsubscribed="trackUnsubscribed",t.TrackMuted="trackMuted",t.TrackUnmuted="trackUnmuted",t.LocalTrackPublished="localTrackPublished",t.LocalTrackUnpublished="localTrackUnpublished",t.ParticipantMetadataChanged="participantMetadataChanged",t.ParticipantNameChanged="participantNameChanged",t.DataReceived="dataReceived",t.SipDTMFReceived="sipDTMFReceived",t.TranscriptionReceived="transcriptionReceived",t.IsSpeakingChanged="isSpeakingChanged",t.ConnectionQualityChanged="connectionQualityChanged",t.TrackStreamStateChanged="trackStreamStateChanged",t.TrackSubscriptionPermissionChanged="trackSubscriptionPermissionChanged",t.TrackSubscriptionStatusChanged="trackSubscriptionStatusChanged",t.MediaDevicesError="mediaDevicesError",t.AudioStreamAcquired="audioStreamAcquired",t.ParticipantPermissionsChanged="participantPermissionsChanged",t.PCTrackAdded="pcTrackAdded",t.AttributesChanged="attributesChanged",t.LocalTrackSubscribed="localTrackSubscribed",t.ChatMessage="chatMessage",t.Active="active"})(D||(D={}));var P;(function(t){t.TransportsCreated="transportsCreated",t.Connected="connected",t.Disconnected="disconnected",t.Resuming="resuming",t.Resumed="resumed",t.Restarting="restarting",t.Restarted="restarted",t.SignalResumed="signalResumed",t.SignalRestarted="signalRestarted",t.Closing="closing",t.MediaTrackAdded="mediaTrackAdded",t.ActiveSpeakersUpdate="activeSpeakersUpdate",t.DataPacketReceived="dataPacketReceived",t.RTPVideoMapUpdate="rtpVideoMapUpdate",t.DCBufferStatusChanged="dcBufferStatusChanged",t.ParticipantUpdate="participantUpdate",t.RoomUpdate="roomUpdate",t.SpeakersChanged="speakersChanged",t.StreamStateChanged="streamStateChanged",t.ConnectionQualityUpdate="connectionQualityUpdate",t.SubscriptionError="subscriptionError",t.SubscriptionPermissionUpdate="subscriptionPermissionUpdate",t.RemoteMute="remoteMute",t.SubscribedQualityUpdate="subscribedQualityUpdate",t.LocalTrackUnpublished="localTrackUnpublished",t.LocalTrackSubscribed="localTrackSubscribed",t.Offline="offline",t.SignalRequestResponse="signalRequestResponse",t.SignalConnected="signalConnected",t.RoomMoved="roomMoved"})(P||(P={}));var _;(function(t){t.Message="message",t.Muted="muted",t.Unmuted="unmuted",t.Restarted="restarted",t.Ended="ended",t.Subscribed="subscribed",t.Unsubscribed="unsubscribed",t.UpdateSettings="updateSettings",t.UpdateSubscription="updateSubscription",t.AudioPlaybackStarted="audioPlaybackStarted",t.AudioPlaybackFailed="audioPlaybackFailed",t.AudioSilenceDetected="audioSilenceDetected",t.VisibilityChanged="visibilityChanged",t.VideoDimensionsChanged="videoDimensionsChanged",t.VideoPlaybackStarted="videoPlaybackStarted",t.VideoPlaybackFailed="videoPlaybackFailed",t.ElementAttached="elementAttached",t.ElementDetached="elementDetached",t.UpstreamPaused="upstreamPaused",t.UpstreamResumed="upstreamResumed",t.SubscriptionPermissionChanged="subscriptionPermissionChanged",t.SubscriptionStatusChanged="subscriptionStatusChanged",t.SubscriptionFailed="subscriptionFailed",t.TrackProcessorUpdate="trackProcessorUpdate",t.AudioTrackFeatureUpdate="audioTrackFeatureUpdate",t.TranscriptionReceived="transcriptionReceived",t.TimeSyncUpdate="timeSyncUpdate"})(_||(_={}));function Iw(t){return typeof t>"u"?t:typeof structuredClone=="function"?structuredClone(t):JSON.parse(JSON.stringify(t))}const xw=/version\/(\d+(\.?_?\d+)+)/i;let ca;function uA(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(typeof t>"u"&&typeof navigator>"u")return;const A=(t??navigator.userAgent).toLowerCase();if(ca===void 0||e){const n=_w.find(i=>{let{test:r}=i;return r.test(A)});ca=n==null?void 0:n.describe(A)}return ca}const _w=[{test:/firefox|iceweasel|fxios/i,describe(t){return{name:"Firefox",version:ar(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,t),os:t.toLowerCase().includes("fxios")?"iOS":void 0,osVersion:la(t)}}},{test:/chrom|crios|crmo/i,describe(t){return{name:"Chrome",version:ar(/(?:chrome|chromium|crios|crmo)\/(\d+(\.?_?\d+)+)/i,t),os:t.toLowerCase().includes("crios")?"iOS":void 0,osVersion:la(t)}}},{test:/safari|applewebkit/i,describe(t){return{name:"Safari",version:ar(xw,t),os:t.includes("mobile/")?"iOS":"macOS",osVersion:la(t)}}}];function ar(t,e){let A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;const n=e.match(t);return n&&n.length>=A&&n[A]||""}function la(t){return t.includes("mac os")?ar(/\(.+?(\d+_\d+(:?_\d+)?)/,t,1).replace(/_/g,"."):void 0}var Pw="2.13.0";const Rw=Pw,Lw=16;class Te{}Te.setTimeout=function(){return setTimeout(...arguments)},Te.setInterval=function(){return setInterval(...arguments)},Te.clearTimeout=function(){return clearTimeout(...arguments)},Te.clearInterval=function(){return clearInterval(...arguments)};const Dw=5e3,En=[];var AA;(function(t){t[t.LOW=0]="LOW",t[t.MEDIUM=1]="MEDIUM",t[t.HIGH=2]="HIGH"})(AA||(AA={}));class T extends yA.EventEmitter{constructor(e,A){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var i;super(),this.attachedElements=[],this.isMuted=!1,this.streamState=T.StreamState.Active,this.isInBackground=!1,this._currentBitrate=0,this.log=W,this.appVisibilityChangedListener=()=>{this.backgroundTimeout&&clearTimeout(this.backgroundTimeout),document.visibilityState==="hidden"?this.backgroundTimeout=setTimeout(()=>this.handleAppVisibilityChanged(),Dw):this.handleAppVisibilityChanged()},this.log=FA((i=n.loggerName)!==null&&i!==void 0?i:lA.Track),this.loggerContextCb=n.loggerContextCb,this.setMaxListeners(100),this.kind=A,this._mediaStreamTrack=e,this._mediaStreamID=e.id,this.source=T.Source.Unknown}get logContext(){var e;return Object.assign(Object.assign({},(e=this.loggerContextCb)===null||e===void 0?void 0:e.call(this)),z(this))}get currentBitrate(){return this._currentBitrate}get mediaStreamTrack(){return this._mediaStreamTrack}get mediaStreamID(){return this._mediaStreamID}attach(e){let A="audio";this.kind===T.Kind.Video&&(A="video"),this.attachedElements.length===0&&this.kind===T.Kind.Video&&this.addAppVisibilityListener(),e||(A==="audio"&&(En.forEach(r=>{r.parentElement===null&&!e&&(e=r)}),e&&En.splice(En.indexOf(e),1)),e||(e=document.createElement(A))),this.attachedElements.includes(e)||this.attachedElements.push(e),Kt(this.mediaStreamTrack,e);const n=e.srcObject.getTracks(),i=n.some(r=>r.kind==="audio");return e.play().then(()=>{this.emit(i?_.AudioPlaybackStarted:_.VideoPlaybackStarted)}).catch(r=>{r.name==="NotAllowedError"?this.emit(i?_.AudioPlaybackFailed:_.VideoPlaybackFailed,r):r.name==="AbortError"?W.debug("".concat(i?"audio":"video"," playback aborted, likely due to new play request")):W.warn("could not playback ".concat(i?"audio":"video"),r),i&&e&&n.some(s=>s.kind==="video")&&r.name==="NotAllowedError"&&(e.muted=!0,e.play().catch(()=>{}))}),this.emit(_.ElementAttached,e),e}detach(e){try{if(e){Vt(this.mediaStreamTrack,e);const n=this.attachedElements.indexOf(e);return n>=0&&(this.attachedElements.splice(n,1),this.recycleElement(e),this.emit(_.ElementDetached,e)),e}const A=[];return this.attachedElements.forEach(n=>{Vt(this.mediaStreamTrack,n),A.push(n),this.recycleElement(n),this.emit(_.ElementDetached,n)}),this.attachedElements=[],A}finally{this.attachedElements.length===0&&this.removeAppVisibilityListener()}}stop(){this.stopMonitor(),this._mediaStreamTrack.stop()}enable(){this._mediaStreamTrack.enabled=!0}disable(){this._mediaStreamTrack.enabled=!1}stopMonitor(){this.monitorInterval&&clearInterval(this.monitorInterval),this.timeSyncHandle&&cancelAnimationFrame(this.timeSyncHandle)}updateLoggerOptions(e){e.loggerName&&(this.log=FA(e.loggerName)),e.loggerContextCb&&(this.loggerContextCb=e.loggerContextCb)}recycleElement(e){if(e instanceof HTMLAudioElement){let A=!0;e.pause(),En.forEach(n=>{n.parentElement||(A=!1)}),A&&En.push(e)}}handleAppVisibilityChanged(){return v(this,void 0,void 0,function*(){this.isInBackground=document.visibilityState==="hidden",!this.isInBackground&&this.kind===T.Kind.Video&&setTimeout(()=>this.attachedElements.forEach(e=>e.play().catch(()=>{})),0)})}addAppVisibilityListener(){Ve()?(this.isInBackground=document.visibilityState==="hidden",document.addEventListener("visibilitychange",this.appVisibilityChangedListener)):this.isInBackground=!1}removeAppVisibilityListener(){Ve()&&document.removeEventListener("visibilitychange",this.appVisibilityChangedListener)}}function Kt(t,e){let A;e.srcObject instanceof MediaStream?A=e.srcObject:A=new MediaStream;let n;t.kind==="audio"?n=A.getAudioTracks():n=A.getVideoTracks(),n.includes(t)||(n.forEach(i=>{A.removeTrack(i)}),A.addTrack(t)),(!ZA()||!(e instanceof HTMLVideoElement))&&(e.autoplay=!0),e.muted=A.getAudioTracks().length===0,e instanceof HTMLVideoElement&&(e.playsInline=!0),e.srcObject!==A&&(e.srcObject=A,(ZA()||Gt())&&e instanceof HTMLVideoElement&&setTimeout(()=>{e.srcObject=A,e.play().catch(()=>{})},0))}function Vt(t,e){if(e.srcObject instanceof MediaStream){const A=e.srcObject;A.removeTrack(t),A.getTracks().length>0?e.srcObject=A:e.srcObject=null}}(function(t){let e;(function(c){c.Audio="audio",c.Video="video",c.Unknown="unknown"})(e=t.Kind||(t.Kind={}));let A;(function(c){c.Camera="camera",c.Microphone="microphone",c.ScreenShare="screen_share",c.ScreenShareAudio="screen_share_audio",c.Unknown="unknown"})(A=t.Source||(t.Source={}));let n;(function(c){c.Active="active",c.Paused="paused",c.Unknown="unknown"})(n=t.StreamState||(t.StreamState={}));function i(c){switch(c){case e.Audio:return sA.AUDIO;case e.Video:return sA.VIDEO;default:return sA.DATA}}t.kindToProto=i;function r(c){switch(c){case sA.AUDIO:return e.Audio;case sA.VIDEO:return e.Video;default:return e.Unknown}}t.kindFromProto=r;function s(c){switch(c){case A.Camera:return Be.CAMERA;case A.Microphone:return Be.MICROPHONE;case A.ScreenShare:return Be.SCREEN_SHARE;case A.ScreenShareAudio:return Be.SCREEN_SHARE_AUDIO;default:return Be.UNKNOWN}}t.sourceToProto=s;function a(c){switch(c){case Be.CAMERA:return A.Camera;case Be.MICROPHONE:return A.Microphone;case Be.SCREEN_SHARE:return A.ScreenShare;case Be.SCREEN_SHARE_AUDIO:return A.ScreenShareAudio;default:return A.Unknown}}t.sourceFromProto=a;function o(c){switch(c){case Ks.ACTIVE:return n.Active;case Ks.PAUSED:return n.Paused;default:return n.Unknown}}t.streamStateFromProto=o})(T||(T={}));class ee{constructor(e,A,n,i,r){if(typeof e=="object")this.width=e.width,this.height=e.height,this.aspectRatio=e.aspectRatio,this.encoding={maxBitrate:e.maxBitrate,maxFramerate:e.maxFramerate,priority:e.priority};else if(A!==void 0&&n!==void 0)this.width=e,this.height=A,this.aspectRatio=e/A,this.encoding={maxBitrate:n,maxFramerate:i,priority:r};else throw new TypeError("Unsupported options: provide at least width, height and maxBitrate")}get resolution(){return{width:this.width,height:this.height,frameRate:this.encoding.maxFramerate,aspectRatio:this.aspectRatio}}}const Hw=["vp8","h264"],Ow=["vp8","h264","vp9","av1"];function Mw(t){return!!Hw.find(e=>e===t)}var Cd;(function(t){t[t.PREFER_REGRESSION=0]="PREFER_REGRESSION",t[t.SIMULCAST=1]="SIMULCAST",t[t.REGRESSION=2]="REGRESSION"})(Cd||(Cd={}));var ua;(function(t){t.telephone={maxBitrate:12e3},t.speech={maxBitrate:24e3},t.music={maxBitrate:48e3},t.musicStereo={maxBitrate:64e3},t.musicHighQuality={maxBitrate:96e3},t.musicHighQualityStereo={maxBitrate:128e3}})(ua||(ua={}));const Sn={h90:new ee(160,90,9e4,20),h180:new ee(320,180,16e4,20),h216:new ee(384,216,18e4,20),h360:new ee(640,360,45e4,20),h540:new ee(960,540,8e5,25),h720:new ee(1280,720,17e5,30),h1080:new ee(1920,1080,3e6,30),h1440:new ee(2560,1440,5e6,30),h2160:new ee(3840,2160,8e6,30)},da={h120:new ee(160,120,7e4,20),h180:new ee(240,180,125e3,20),h240:new ee(320,240,14e4,20),h360:new ee(480,360,33e4,20),h480:new ee(640,480,5e5,20),h540:new ee(720,540,6e5,25),h720:new ee(960,720,13e5,30),h1080:new ee(1440,1080,23e5,30),h1440:new ee(1920,1440,38e5,30)},ha={h360fps3:new ee(640,360,2e5,3,"medium"),h360fps15:new ee(640,360,4e5,15,"medium"),h720fps5:new ee(1280,720,8e5,5,"medium"),h720fps15:new ee(1280,720,15e5,15,"medium"),h720fps30:new ee(1280,720,2e6,30,"medium"),h1080fps15:new ee(1920,1080,25e5,15,"medium"),h1080fps30:new ee(1920,1080,5e6,30,"medium"),original:new ee(0,0,7e6,30,"medium")},Nw="|",wd="https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension";function Kw(t){const e=t.split(Nw);return e.length>1?[e[0],t.substr(e[0].length+1)]:[t,""]}function Ke(t){return v(this,void 0,void 0,function*(){return new Promise(e=>Te.setTimeout(e,t))})}function fa(){return"addTransceiver"in RTCPeerConnection.prototype}function ga(){return"addTrack"in RTCPeerConnection.prototype}function Vw(){if(!("getCapabilities"in RTCRtpSender)||ZA())return!1;const t=RTCRtpSender.getCapabilities("video");let e=!1;if(t){for(const A of t.codecs)if(A.mimeType==="video/AV1"){e=!0;break}}return e}function Gw(){if(!("getCapabilities"in RTCRtpSender)||Gt())return!1;if(ZA()){const A=uA();if(A!=null&&A.version&&mt(A.version,"16")<0)return!1}const t=RTCRtpSender.getCapabilities("video");let e=!1;if(t){for(const A of t.codecs)if(A.mimeType==="video/VP9"){e=!0;break}}return e}function kn(t){return t==="av1"||t==="vp9"}function pa(t){return document?(t||(t=document.createElement("audio")),"setSinkId"in t):!1}function jw(){return typeof RTCPeerConnection>"u"?!1:fa()||ga()}function Gt(){var t;return((t=uA())===null||t===void 0?void 0:t.name)==="Firefox"}function ZA(){var t;return((t=uA())===null||t===void 0?void 0:t.name)==="Safari"}function Ww(){const t=uA();return(t==null?void 0:t.name)==="Safari"&&t.version.startsWith("17.")}function bd(){var t,e;return Ve()?(e=(t=navigator.userAgentData)===null||t===void 0?void 0:t.mobile)!==null&&e!==void 0?e:/Tablet|iPad|Mobile|Android|BlackBerry/.test(navigator.userAgent):!1}function Jw(){const t=uA(),e="17.2";if(t)return t.name!=="Safari"&&t.os!=="iOS"||t.os==="iOS"&&t.osVersion&&mt(e,t.osVersion)>=0?!0:t.name==="Safari"&&mt(e,t.version)>=0}function Ve(){return typeof document<"u"}function UA(){return navigator.product=="ReactNative"}function ma(t){return t.hostname.endsWith(".livekit.cloud")||t.hostname.endsWith(".livekit.run")}function yd(){if(global&&global.LiveKitReactNativeGlobal)return global.LiveKitReactNativeGlobal}function Ud(){if(!UA())return;let t=yd();if(t)return t.platform}function Qd(){if(Ve())return window.devicePixelRatio;if(UA()){let t=yd();if(t)return t.devicePixelRatio}return 1}function mt(t,e){const A=t.split("."),n=e.split("."),i=Math.min(A.length,n.length);for(let r=0;r<i;++r){const s=parseInt(A[r],10),a=parseInt(n[r],10);if(s>a)return 1;if(s<a)return-1;if(r===i-1&&s===a)return 0}return t===""&&e!==""?-1:e===""?1:A.length==n.length?0:A.length<n.length?-1:1}function Xw(t){for(const e of t)e.target.handleResize(e)}function qw(t){for(const e of t)e.target.handleVisibilityChanged(e)}let Ba=null;const Ed=()=>(Ba||(Ba=new ResizeObserver(Xw)),Ba);let va=null;const Sd=()=>(va||(va=new IntersectionObserver(qw,{root:null,rootMargin:"0px"})),va);function Yw(){var t;const e=new OC({sdk:uu.JS,protocol:Lw,version:Rw});return UA()&&(e.os=(t=Ud())!==null&&t!==void 0?t:""),e}function kd(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:16,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:16,A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;const i=document.createElement("canvas");i.width=t,i.height=e;const r=i.getContext("2d");r==null||r.fillRect(0,0,i.width,i.height),n&&r&&(r.beginPath(),r.arc(t/2,e/2,50,0,Math.PI*2,!0),r.closePath(),r.fillStyle="grey",r.fill());const s=i.captureStream(),[a]=s.getTracks();if(!a)throw Error("Could not get empty media stream video track");return a.enabled=A,a}let Tn;function Ca(){if(!Tn){const t=new AudioContext,e=t.createOscillator(),A=t.createGain();A.gain.setValueAtTime(0,0);const n=t.createMediaStreamDestination();if(e.connect(A),A.connect(n),e.start(),[Tn]=n.stream.getAudioTracks(),!Tn)throw Error("Could not get empty media stream audio track");Tn.enabled=!1}return Tn.clone()}class wa{constructor(e,A){this.onFinally=A,this.promise=new Promise((n,i)=>v(this,void 0,void 0,function*(){this.resolve=n,this.reject=i,e&&(yield e(n,i))})).finally(()=>{var n;return(n=this.onFinally)===null||n===void 0?void 0:n.call(this)})}}function zw(t){return Ow.includes(t)}function $A(t){if(typeof t=="string"||typeof t=="number")return t;if(Array.isArray(t))return t[0];if(t.exact)return Array.isArray(t.exact)?t.exact[0]:t.exact;if(t.ideal)return Array.isArray(t.ideal)?t.ideal[0]:t.ideal;throw Error("could not unwrap constraint")}function Zw(t){return t.startsWith("http")?t.replace(/^(http)/,"ws"):t}function ba(t){return t.startsWith("ws")?t.replace(/^(ws)/,"http"):t}function $w(t,e){return t.segments.map(A=>{let{id:n,text:i,language:r,startTime:s,endTime:a,final:o}=A;var c;const l=(c=e.get(n))!==null&&c!==void 0?c:Date.now(),u=Date.now();return o?e.delete(n):e.set(n,l),{id:n,text:i,startTime:Number.parseInt(s.toString()),endTime:Number.parseInt(a.toString()),final:o,language:r,firstReceivedTime:l,lastReceivedTime:u}})}function eb(t){const{id:e,timestamp:A,message:n,editTimestamp:i}=t;return{id:e,timestamp:Number.parseInt(A.toString()),editTimestamp:i?Number.parseInt(i.toString()):void 0,message:n}}function Td(t){switch(t.reason){case J.LeaveRequest:return t.context;case J.Cancelled:return aA.CLIENT_INITIATED;case J.NotAllowed:return aA.USER_REJECTED;case J.ServerUnreachable:return aA.JOIN_FAILURE;default:return aA.UNKNOWN_REASON}}function or(t){return t!==void 0?Number(t):void 0}function Bt(t){return t!==void 0?BigInt(t):void 0}function jt(t){return!!t&&!(t instanceof MediaStreamTrack)&&t.isLocal}function xA(t){return!!t&&t.kind==T.Kind.Audio}function Wt(t){return!!t&&t.kind==T.Kind.Video}function et(t){return jt(t)&&Wt(t)}function vt(t){return jt(t)&&xA(t)}function ya(t){return!!t&&!t.isLocal}function Ab(t){return!!t&&!t.isLocal}function Ua(t){return ya(t)&&Wt(t)}function tb(t){return t.isLocal}function nb(t,e){const A=[];let n=new TextEncoder().encode(t);for(;n.length>e;){let i=e;for(;i>0;){const r=n[i];if(r!==void 0&&(r&192)!==128)break;i--}A.push(n.slice(0,i)),n=n.slice(i)}return n.length>0&&A.push(n),A}function Fd(t,e,A){var n,i,r,s;const{optionsWithoutProcessor:a,audioProcessor:o,videoProcessor:c}=Pd(t??{}),l=e==null?void 0:e.processor,u=A==null?void 0:A.processor,d=a??{};return d.audio===!0&&(d.audio={}),d.video===!0&&(d.video={}),d.audio&&(Qa(d.audio,e),(n=(r=d.audio).deviceId)!==null&&n!==void 0||(r.deviceId={ideal:"default"}),(o||l)&&(d.audio.processor=o??l)),d.video&&(Qa(d.video,A),(i=(s=d.video).deviceId)!==null&&i!==void 0||(s.deviceId={ideal:"default"}),(c||u)&&(d.video.processor=c??u)),d}function Qa(t,e){return Object.keys(e).forEach(A=>{t[A]===void 0&&(t[A]=e[A])}),t}function Ea(t){var e,A,n,i;const r={};if(t.video)if(typeof t.video=="object"){const s={},a=s,o=t.video;Object.keys(o).forEach(c=>{switch(c){case"resolution":Qa(a,o.resolution);break;default:a[c]=o[c]}}),r.video=s,(e=(n=r.video).deviceId)!==null&&e!==void 0||(n.deviceId={ideal:"default"})}else r.video=t.video?{deviceId:{ideal:"default"}}:!1;else r.video=!1;return t.audio?typeof t.audio=="object"?(r.audio=t.audio,(A=(i=r.audio).deviceId)!==null&&A!==void 0||(i.deviceId={ideal:"default"})):r.audio={deviceId:{ideal:"default"}}:r.audio=!1,r}function Id(t){return v(this,arguments,void 0,function(e){let A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:200;return function*(){const n=xd();if(n){const i=n.createAnalyser();i.fftSize=2048;const r=i.frequencyBinCount,s=new Uint8Array(r);n.createMediaStreamSource(new MediaStream([e.mediaStreamTrack])).connect(i),yield Ke(A),i.getByteTimeDomainData(s);const o=s.some(c=>c!==128&&c!==0);return n.close(),!o}return!1}()})}function xd(){var t;const e=typeof window<"u"&&(window.AudioContext||window.webkitAudioContext);if(e){const A=new e({latencyHint:"interactive"});if(A.state==="suspended"&&typeof window<"u"&&(!((t=window.document)===null||t===void 0)&&t.body)){const n=()=>v(this,void 0,void 0,function*(){var i;try{A.state==="suspended"&&(yield A.resume())}catch(r){console.warn("Error trying to auto-resume audio context",r)}(i=window.document.body)===null||i===void 0||i.removeEventListener("click",n)});window.document.body.addEventListener("click",n)}return A}}function ib(t){return t==="audioinput"?T.Source.Microphone:t==="videoinput"?T.Source.Camera:T.Source.Unknown}function _d(t){return t===T.Source.Microphone?"audioinput":t===T.Source.Camera?"videoinput":void 0}function rb(t){var e,A;let n=(e=t.video)!==null&&e!==void 0?e:!0;return t.resolution&&t.resolution.width>0&&t.resolution.height>0&&(n=typeof n=="boolean"?{}:n,ZA()?n=Object.assign(Object.assign({},n),{width:{max:t.resolution.width},height:{max:t.resolution.height},frameRate:t.resolution.frameRate}):n=Object.assign(Object.assign({},n),{width:{ideal:t.resolution.width},height:{ideal:t.resolution.height},frameRate:t.resolution.frameRate})),{audio:(A=t.audio)!==null&&A!==void 0?A:!1,video:n,controller:t.controller,selfBrowserSurface:t.selfBrowserSurface,surfaceSwitching:t.surfaceSwitching,systemAudio:t.systemAudio,preferCurrentTab:t.preferCurrentTab}}function cr(t){return t.split("/")[1].toLowerCase()}function sb(t){const e=[];return t.forEach(A=>{A.track!==void 0&&e.push(new Js({cid:A.track.mediaStreamID,track:A.trackInfo}))}),e}function z(t){return"mediaStreamTrack"in t?{trackID:t.sid,source:t.source,muted:t.isMuted,enabled:t.mediaStreamTrack.enabled,kind:t.kind,streamID:t.mediaStreamID,streamTrackID:t.mediaStreamTrack.id}:{trackID:t.trackSid,enabled:t.isEnabled,muted:t.isMuted,trackInfo:Object.assign({mimeType:t.mimeType,name:t.trackName,encrypted:t.isEncrypted,kind:t.kind,source:t.source},t.track?z(t.track):{})}}function ab(){return typeof RTCRtpReceiver<"u"&&"getSynchronizationSources"in RTCRtpReceiver}function ob(t,e){var A;t===void 0&&(t={}),e===void 0&&(e={});const n=[...Object.keys(e),...Object.keys(t)],i={};for(const r of n)t[r]!==e[r]&&(i[r]=(A=e[r])!==null&&A!==void 0?A:"");return i}function Pd(t){const e=Object.assign({},t);let A,n;return typeof e.audio=="object"&&e.audio.processor&&(A=e.audio.processor,e.audio=Object.assign(Object.assign({},e.audio),{processor:void 0})),typeof e.video=="object"&&e.video.processor&&(n=e.video.processor,e.video=Object.assign(Object.assign({},e.video),{processor:void 0})),{audioProcessor:A,videoProcessor:n,optionsWithoutProcessor:Iw(e)}}function cb(t){switch(t){case Be.CAMERA:return T.Source.Camera;case Be.MICROPHONE:return T.Source.Microphone;case Be.SCREEN_SHARE:return T.Source.ScreenShare;case Be.SCREEN_SHARE_AUDIO:return T.Source.ScreenShareAudio;default:return T.Source.Unknown}}class lb extends yA.EventEmitter{constructor(e){super(),this.onWorkerMessage=A=>{var n,i;const{kind:r,data:s}=A.data;switch(r){case"error":W.error(s.error.message),this.emit(YA.EncryptionError,s.error);break;case"initAck":s.enabled&&this.keyProvider.getKeys().forEach(a=>{this.postKey(a)});break;case"enable":if(s.enabled&&this.keyProvider.getKeys().forEach(a=>{this.postKey(a)}),this.encryptionEnabled!==s.enabled&&s.participantIdentity===((n=this.room)===null||n===void 0?void 0:n.localParticipant.identity))this.emit(YA.ParticipantEncryptionStatusChanged,s.enabled,this.room.localParticipant),this.encryptionEnabled=s.enabled;else if(s.participantIdentity){const a=(i=this.room)===null||i===void 0?void 0:i.getParticipantByIdentity(s.participantIdentity);if(!a)throw TypeError("couldn't set encryption status, participant not found".concat(s.participantIdentity));this.emit(YA.ParticipantEncryptionStatusChanged,s.enabled,a)}break;case"ratchetKey":this.keyProvider.emit(qA.KeyRatcheted,s.ratchetResult,s.participantIdentity,s.keyIndex);break}},this.onWorkerError=A=>{W.error("e2ee worker encountered an error:",{error:A.error}),this.emit(YA.EncryptionError,A.error)},this.keyProvider=e.keyProvider,this.worker=e.worker,this.encryptionEnabled=!1}setup(e){if(!kw())throw new sa("tried to setup end-to-end encryption on an unsupported browser");if(W.info("setting up e2ee"),e!==this.room){this.room=e,this.setupEventListeners(e,this.keyProvider);const A={kind:"init",data:{keyProviderOptions:this.keyProvider.getOptions(),loglevel:hw.getLevel()}};this.worker&&(W.info("initializing worker",{worker:this.worker}),this.worker.onmessage=this.onWorkerMessage,this.worker.onerror=this.onWorkerError,this.worker.postMessage(A))}}setParticipantCryptorEnabled(e,A){W.debug("set e2ee to ".concat(e," for participant ").concat(A)),this.postEnable(e,A)}setSifTrailer(e){!e||e.length===0?W.warn("ignoring server sent trailer as it's empty"):this.postSifTrailer(e)}setupEngine(e){e.on(P.RTPVideoMapUpdate,A=>{this.postRTPMap(A)})}setupEventListeners(e,A){e.on(I.TrackPublished,(n,i)=>this.setParticipantCryptorEnabled(n.trackInfo.encryption!==qe.NONE,i.identity)),e.on(I.ConnectionStateChanged,n=>{n===q.Connected&&e.remoteParticipants.forEach(i=>{i.trackPublications.forEach(r=>{this.setParticipantCryptorEnabled(r.trackInfo.encryption!==qe.NONE,i.identity)})})}).on(I.TrackUnsubscribed,(n,i,r)=>{var s;const a={kind:"removeTransform",data:{participantIdentity:r.identity,trackId:n.mediaStreamID}};(s=this.worker)===null||s===void 0||s.postMessage(a)}).on(I.TrackSubscribed,(n,i,r)=>{this.setupE2EEReceiver(n,r.identity,i.trackInfo)}).on(I.SignalConnected,()=>{if(!this.room)throw new TypeError("expected room to be present on signal connect");A.getKeys().forEach(n=>{this.postKey(n)}),this.setParticipantCryptorEnabled(this.room.localParticipant.isE2EEEnabled,this.room.localParticipant.identity)}),e.localParticipant.on(D.LocalTrackPublished,n=>v(this,void 0,void 0,function*(){this.setupE2EESender(n.track,n.track.sender)})),A.on(qA.SetKey,n=>this.postKey(n)).on(qA.RatchetRequest,(n,i)=>this.postRatchetRequest(n,i))}postRatchetRequest(e,A){if(!this.worker)throw Error("could not ratchet key, worker is missing");const n={kind:"ratchetRequest",data:{participantIdentity:e,keyIndex:A}};this.worker.postMessage(n)}postKey(e){let{key:A,participantIdentity:n,keyIndex:i}=e;var r;if(!this.worker)throw Error("could not set key, worker is missing");const s={kind:"setKey",data:{participantIdentity:n,isPublisher:n===((r=this.room)===null||r===void 0?void 0:r.localParticipant.identity),key:A,keyIndex:i}};this.worker.postMessage(s)}postEnable(e,A){if(this.worker){const n={kind:"enable",data:{enabled:e,participantIdentity:A}};this.worker.postMessage(n)}else throw new ReferenceError("failed to enable e2ee, worker is not ready")}postRTPMap(e){var A;if(!this.worker)throw TypeError("could not post rtp map, worker is missing");if(!(!((A=this.room)===null||A===void 0)&&A.localParticipant.identity))throw TypeError("could not post rtp map, local participant identity is missing");const n={kind:"setRTPMap",data:{map:e,participantIdentity:this.room.localParticipant.identity}};this.worker.postMessage(n)}postSifTrailer(e){if(!this.worker)throw Error("could not post SIF trailer, worker is missing");const A={kind:"setSifTrailer",data:{trailer:e}};this.worker.postMessage(A)}setupE2EEReceiver(e,A,n){if(e.receiver){if(!(n!=null&&n.mimeType)||n.mimeType==="")throw new TypeError("MimeType missing from trackInfo, cannot set up E2EE cryptor");this.handleReceiver(e.receiver,e.mediaStreamID,A,e.kind==="video"?cr(n.mimeType):void 0)}}setupE2EESender(e,A){if(!jt(e)||!A){A||W.warn("early return because sender is not ready");return}this.handleSender(A,e.mediaStreamID,void 0)}handleReceiver(e,A,n,i){return v(this,void 0,void 0,function*(){if(this.worker){if(ra()){const r={kind:"decode",participantIdentity:n,trackId:A,codec:i};e.transform=new RTCRtpScriptTransform(this.worker,r)}else{if(rr in e&&i){const o={kind:"updateCodec",data:{trackId:A,codec:i,participantIdentity:n}};this.worker.postMessage(o);return}let r=e.writableStream,s=e.readableStream;if(!r||!s){const o=e.createEncodedStreams();e.writableStream=o.writable,r=o.writable,e.readableStream=o.readable,s=o.readable}const a={kind:"decode",data:{readableStream:s,writableStream:r,trackId:A,codec:i,participantIdentity:n}};this.worker.postMessage(a,[s,r])}e[rr]=!0}})}handleSender(e,A,n){var i;if(!(rr in e||!this.worker)){if(!(!((i=this.room)===null||i===void 0)&&i.localParticipant.identity)||this.room.localParticipant.identity==="")throw TypeError("local identity needs to be known in order to set up encrypted sender");if(ra()){W.info("initialize script transform");const r={kind:"encode",participantIdentity:this.room.localParticipant.identity,trackId:A,codec:n};e.transform=new RTCRtpScriptTransform(this.worker,r)}else{W.info("initialize encoded streams");const r=e.createEncodedStreams(),s={kind:"encode",data:{readableStream:r.readable,writableStream:r.writable,codec:n,trackId:A,participantIdentity:this.room.localParticipant.identity}};this.worker.postMessage(s,[r.readable,r.writable])}e[rr]=!0}}}const Sa="default";class Qe{constructor(){this._previousDevices=[]}static getInstance(){return this.instance===void 0&&(this.instance=new Qe),this.instance}get previousDevices(){return this._previousDevices}getDevices(e){return v(this,arguments,void 0,function(A){var n=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return function*(){var r;if(((r=Qe.userMediaPromiseMap)===null||r===void 0?void 0:r.size)>0){W.debug("awaiting getUserMedia promise");try{A?yield Qe.userMediaPromiseMap.get(A):yield Promise.all(Qe.userMediaPromiseMap.values())}catch{W.warn("error waiting for media permissons")}}let s=yield navigator.mediaDevices.enumerateDevices();if(i&&!(ZA()&&n.hasDeviceInUse(A))&&(s.filter(o=>o.kind===A).length===0||s.some(o=>{const c=o.label==="",l=A?o.kind===A:!0;return c&&l}))){const o={video:A!=="audioinput"&&A!=="audiooutput",audio:A!=="videoinput"&&{deviceId:{ideal:"default"}}},c=yield navigator.mediaDevices.getUserMedia(o);s=yield navigator.mediaDevices.enumerateDevices(),c.getTracks().forEach(l=>{l.stop()})}return n._previousDevices=s,A&&(s=s.filter(a=>a.kind===A)),s}()})}normalizeDeviceId(e,A,n){return v(this,void 0,void 0,function*(){if(A!==Sa)return A;const i=yield this.getDevices(e),r=i.find(a=>a.deviceId===Sa);if(!r){W.warn("could not reliably determine default device");return}const s=i.find(a=>a.deviceId!==Sa&&a.groupId===(n??r.groupId));if(!s){W.warn("could not reliably determine default device");return}return s==null?void 0:s.deviceId})}hasDeviceInUse(e){return e?Qe.userMediaPromiseMap.has(e):Qe.userMediaPromiseMap.size>0}}Qe.mediaDeviceKinds=["audioinput","audiooutput","videoinput"],Qe.userMediaPromiseMap=new Map;var Fn;(function(t){t[t.WAITING=0]="WAITING",t[t.RUNNING=1]="RUNNING",t[t.COMPLETED=2]="COMPLETED"})(Fn||(Fn={}));class ub{constructor(){this.pendingTasks=new Map,this.taskMutex=new Oe,this.nextTaskIndex=0}run(e){return v(this,void 0,void 0,function*(){const A={id:this.nextTaskIndex++,enqueuedAt:Date.now(),status:Fn.WAITING};this.pendingTasks.set(A.id,A);const n=yield this.taskMutex.lock();try{return A.executedAt=Date.now(),A.status=Fn.RUNNING,yield e()}finally{A.status=Fn.COMPLETED,this.pendingTasks.delete(A.id),n()}})}flush(){return v(this,void 0,void 0,function*(){return this.run(()=>v(this,void 0,void 0,function*(){}))})}snapshot(){return Array.from(this.pendingTasks.values())}}function db(t,e){const A=new URL(Zw(t));return e.forEach((n,i)=>{A.searchParams.set(i,n)}),Rd(A,"rtc")}function hb(t){const e=new URL(ba(t));return Rd(e,"validate")}function fb(t){return t.endsWith("/")?t:"".concat(t,"/")}function Rd(t,e){return t.pathname="".concat(fb(t.pathname)).concat(e),t.toString()}const gb=["syncState","trickle","offer","answer","simulate","leave"];function pb(t){const e=gb.indexOf(t.case)>=0;return W.trace("request allowed to bypass queue:",{canPass:e,req:t}),e}var ie;(function(t){t[t.CONNECTING=0]="CONNECTING",t[t.CONNECTED=1]="CONNECTED",t[t.RECONNECTING=2]="RECONNECTING",t[t.DISCONNECTING=3]="DISCONNECTING",t[t.DISCONNECTED=4]="DISCONNECTED"})(ie||(ie={}));class ka{get currentState(){return this.state}get isDisconnected(){return this.state===ie.DISCONNECTING||this.state===ie.DISCONNECTED}get isEstablishingConnection(){return this.state===ie.CONNECTING||this.state===ie.RECONNECTING}getNextRequestId(){return this._requestId+=1,this._requestId}constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var n;this.rtt=0,this.state=ie.DISCONNECTED,this.log=W,this._requestId=0,this.resetCallbacks=()=>{this.onAnswer=void 0,this.onLeave=void 0,this.onLocalTrackPublished=void 0,this.onLocalTrackUnpublished=void 0,this.onNegotiateRequested=void 0,this.onOffer=void 0,this.onRemoteMuteChanged=void 0,this.onSubscribedQualityUpdate=void 0,this.onTokenRefresh=void 0,this.onTrickle=void 0,this.onClose=void 0},this.log=FA((n=A.loggerName)!==null&&n!==void 0?n:lA.Signal),this.loggerContextCb=A.loggerContextCb,this.useJSON=e,this.requestQueue=new ub,this.queuedRequests=[],this.closingLock=new Oe,this.connectionLock=new Oe,this.state=ie.DISCONNECTED}get logContext(){var e,A;return(A=(e=this.loggerContextCb)===null||e===void 0?void 0:e.call(this))!==null&&A!==void 0?A:{}}join(e,A,n,i){return v(this,void 0,void 0,function*(){return this.state=ie.CONNECTING,this.options=n,yield this.connect(e,A,n,i)})}reconnect(e,A,n,i){return v(this,void 0,void 0,function*(){if(!this.options){this.log.warn("attempted to reconnect without signal options being set, ignoring",this.logContext);return}return this.state=ie.RECONNECTING,this.clearPingInterval(),yield this.connect(e,A,Object.assign(Object.assign({},this.options),{reconnect:!0,sid:n,reconnectReason:i}))})}connect(e,A,n,i){this.connectOptions=n;const r=Yw(),s=mb(A,r,n),a=db(e,s),o=hb(a);return new Promise((c,l)=>v(this,void 0,void 0,function*(){const u=yield this.connectionLock.lock();try{const d=()=>v(this,void 0,void 0,function*(){this.close(),clearTimeout(h),l(new Ae("room connection has been cancelled (signal)",J.Cancelled))}),h=setTimeout(()=>{this.close(),l(new Ae("room connection has timed out (signal)",J.ServerUnreachable))},n.websocketTimeout);i!=null&&i.aborted&&d(),i==null||i.addEventListener("abort",d);const g=new URL(a);g.searchParams.has("access_token")&&g.searchParams.set("access_token","<redacted>"),this.log.debug("connecting to ".concat(g),Object.assign({reconnect:n.reconnect,reconnectReason:n.reconnectReason},this.logContext)),this.ws&&(yield this.close(!1)),this.ws=new WebSocket(a),this.ws.binaryType="arraybuffer",this.ws.onopen=()=>{clearTimeout(h)},this.ws.onerror=f=>v(this,void 0,void 0,function*(){if(this.state!==ie.CONNECTED){this.state=ie.DISCONNECTED,clearTimeout(h);try{const m=yield fetch(o);if(m.status.toFixed(0).startsWith("4")){const B=yield m.text();l(new Ae(B,J.NotAllowed,m.status))}else l(new Ae("Encountered unknown websocket error during connection: ".concat(f.toString()),J.InternalError,m.status))}catch(m){l(new Ae(m instanceof Error?m.message:"server was not reachable",J.ServerUnreachable))}return}this.handleWSError(f)}),this.ws.onmessage=f=>v(this,void 0,void 0,function*(){var m,B,b;let U;if(typeof f.data=="string"){const C=JSON.parse(f.data);U=mu.fromJson(C,{ignoreUnknownFields:!0})}else if(f.data instanceof ArrayBuffer)U=mu.fromBinary(new Uint8Array(f.data));else{this.log.error("could not decode websocket message: ".concat(typeof f.data),this.logContext);return}if(this.state!==ie.CONNECTED){let C=!1;if(((m=U.message)===null||m===void 0?void 0:m.case)==="join"?(this.state=ie.CONNECTED,i==null||i.removeEventListener("abort",d),this.pingTimeoutDuration=U.message.value.pingTimeout,this.pingIntervalDuration=U.message.value.pingInterval,this.pingTimeoutDuration&&this.pingTimeoutDuration>0&&(this.log.debug("ping config",Object.assign(Object.assign({},this.logContext),{timeout:this.pingTimeoutDuration,interval:this.pingIntervalDuration})),this.startPingInterval()),c(U.message.value)):this.state===ie.RECONNECTING&&U.message.case!=="leave"?(this.state=ie.CONNECTED,i==null||i.removeEventListener("abort",d),this.startPingInterval(),((B=U.message)===null||B===void 0?void 0:B.case)==="reconnect"?c(U.message.value):(this.log.debug("declaring signal reconnected without reconnect response received",this.logContext),c(void 0),C=!0)):this.isEstablishingConnection&&U.message.case==="leave"?l(new Ae("Received leave request while trying to (re)connect",J.LeaveRequest,void 0,U.message.value.reason)):n.reconnect||l(new Ae("did not receive join response, got ".concat((b=U.message)===null||b===void 0?void 0:b.case," instead"),J.InternalError)),!C)return}this.signalLatency&&(yield Ke(this.signalLatency)),this.handleSignalResponse(U)}),this.ws.onclose=f=>{this.isEstablishingConnection&&l(new Ae("Websocket got closed during a (re)connection attempt",J.InternalError)),this.log.warn("websocket closed",Object.assign(Object.assign({},this.logContext),{reason:f.reason,code:f.code,wasClean:f.wasClean,state:this.state})),this.handleOnClose(f.reason)}}finally{u()}}))}close(){return v(this,arguments,void 0,function(){var e=this;let A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return function*(){const n=yield e.closingLock.lock();try{if(e.clearPingInterval(),A&&(e.state=ie.DISCONNECTING),e.ws){e.ws.onmessage=null,e.ws.onopen=null,e.ws.onclose=null;const i=new Promise(r=>{e.ws?e.ws.onclose=()=>{r()}:r()});e.ws.readyState<e.ws.CLOSING&&(e.ws.close(),yield Promise.race([i,Ke(250)])),e.ws=void 0}}finally{A&&(e.state=ie.DISCONNECTED),n()}}()})}sendOffer(e){this.log.debug("sending offer",Object.assign(Object.assign({},this.logContext),{offerSdp:e.sdp})),this.sendRequest({case:"offer",value:lr(e)})}sendAnswer(e){return this.log.debug("sending answer",Object.assign(Object.assign({},this.logContext),{answerSdp:e.sdp})),this.sendRequest({case:"answer",value:lr(e)})}sendIceCandidate(e,A){return this.log.debug("sending ice candidate",Object.assign(Object.assign({},this.logContext),{candidate:e})),this.sendRequest({case:"trickle",value:new js({candidateInit:JSON.stringify(e),target:A})})}sendMuteTrack(e,A){return this.sendRequest({case:"mute",value:new Ws({sid:e,muted:A})})}sendAddTrack(e){return this.sendRequest({case:"addTrack",value:e})}sendUpdateLocalMetadata(e,A){return v(this,arguments,void 0,function(n,i){var r=this;let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function*(){const a=r.getNextRequestId();return yield r.sendRequest({case:"updateMetadata",value:new wu({requestId:a,metadata:n,name:i,attributes:s})}),a}()})}sendUpdateTrackSettings(e){this.sendRequest({case:"trackSetting",value:e})}sendUpdateSubscription(e){return this.sendRequest({case:"subscription",value:e})}sendSyncState(e){return this.sendRequest({case:"syncState",value:e})}sendUpdateVideoLayers(e,A){return this.sendRequest({case:"updateLayers",value:new Cu({trackSid:e,layers:A})})}sendUpdateSubscriptionPermissions(e,A){return this.sendRequest({case:"subscriptionPermission",value:new Uu({allParticipants:e,trackPermissions:A})})}sendSimulateScenario(e){return this.sendRequest({case:"simulate",value:e})}sendPing(){return Promise.all([this.sendRequest({case:"ping",value:se.parse(Date.now())}),this.sendRequest({case:"pingReq",value:new Su({timestamp:se.parse(Date.now()),rtt:se.parse(this.rtt)})})])}sendUpdateLocalAudioTrack(e,A){return this.sendRequest({case:"updateAudioTrack",value:new vu({trackSid:e,features:A})})}sendLeave(){return this.sendRequest({case:"leave",value:new qi({reason:aA.CLIENT_INITIATED,action:Mt.DISCONNECT})})}sendRequest(e){return v(this,arguments,void 0,function(A){var n=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return function*(){if(!i&&!pb(A)&&n.state===ie.RECONNECTING){n.queuedRequests.push(()=>v(n,void 0,void 0,function*(){yield this.sendRequest(A,!0)}));return}if(i||(yield n.requestQueue.flush()),n.signalLatency&&(yield Ke(n.signalLatency)),!n.ws||n.ws.readyState!==n.ws.OPEN){n.log.error("cannot send signal request before connected, type: ".concat(A==null?void 0:A.case),n.logContext);return}const s=new KC({message:A});try{n.useJSON?n.ws.send(s.toJsonString()):n.ws.send(s.toBinary())}catch(a){n.log.error("error sending signal message",Object.assign(Object.assign({},n.logContext),{error:a}))}}()})}handleSignalResponse(e){var A,n;const i=e.message;if(i==null){this.log.debug("received unsupported message",this.logContext);return}let r=!1;if(i.case==="answer"){const s=Ld(i.value);this.onAnswer&&this.onAnswer(s)}else if(i.case==="offer"){const s=Ld(i.value);this.onOffer&&this.onOffer(s)}else if(i.case==="trickle"){const s=JSON.parse(i.value.candidateInit);this.onTrickle&&this.onTrickle(s,i.value.target)}else i.case==="update"?this.onParticipantUpdate&&this.onParticipantUpdate((A=i.value.participants)!==null&&A!==void 0?A:[]):i.case==="trackPublished"?this.onLocalTrackPublished&&this.onLocalTrackPublished(i.value):i.case==="speakersChanged"?this.onSpeakersChanged&&this.onSpeakersChanged((n=i.value.speakers)!==null&&n!==void 0?n:[]):i.case==="leave"?this.onLeave&&this.onLeave(i.value):i.case==="mute"?this.onRemoteMuteChanged&&this.onRemoteMuteChanged(i.value.sid,i.value.muted):i.case==="roomUpdate"?this.onRoomUpdate&&i.value.room&&this.onRoomUpdate(i.value.room):i.case==="connectionQuality"?this.onConnectionQuality&&this.onConnectionQuality(i.value):i.case==="streamStateUpdate"?this.onStreamStateUpdate&&this.onStreamStateUpdate(i.value):i.case==="subscribedQualityUpdate"?this.onSubscribedQualityUpdate&&this.onSubscribedQualityUpdate(i.value):i.case==="subscriptionPermissionUpdate"?this.onSubscriptionPermissionUpdate&&this.onSubscriptionPermissionUpdate(i.value):i.case==="refreshToken"?this.onTokenRefresh&&this.onTokenRefresh(i.value):i.case==="trackUnpublished"?this.onLocalTrackUnpublished&&this.onLocalTrackUnpublished(i.value):i.case==="subscriptionResponse"?this.onSubscriptionError&&this.onSubscriptionError(i.value):i.case==="pong"||(i.case==="pongResp"?(this.rtt=Date.now()-Number.parseInt(i.value.lastPingTimestamp.toString()),this.resetPingTimeout(),r=!0):i.case==="requestResponse"?this.onRequestResponse&&this.onRequestResponse(i.value):i.case==="trackSubscribed"?this.onLocalTrackSubscribed&&this.onLocalTrackSubscribed(i.value.trackSid):i.case==="roomMoved"?(this.onTokenRefresh&&this.onTokenRefresh(i.value.token),this.onRoomMoved&&this.onRoomMoved(i.value)):this.log.debug("unsupported message",Object.assign(Object.assign({},this.logContext),{msgCase:i.case})));r||this.resetPingTimeout()}setReconnected(){for(;this.queuedRequests.length>0;){const e=this.queuedRequests.shift();e&&this.requestQueue.run(e)}}handleOnClose(e){return v(this,void 0,void 0,function*(){if(this.state===ie.DISCONNECTED)return;const A=this.onClose;yield this.close(),this.log.debug("websocket connection closed: ".concat(e),Object.assign(Object.assign({},this.logContext),{reason:e})),A&&A(e)})}handleWSError(e){this.log.error("websocket error",Object.assign(Object.assign({},this.logContext),{error:e}))}resetPingTimeout(){if(this.clearPingTimeout(),!this.pingTimeoutDuration){this.log.warn("ping timeout duration not set",this.logContext);return}this.pingTimeout=Te.setTimeout(()=>{this.log.warn("ping timeout triggered. last pong received at: ".concat(new Date(Date.now()-this.pingTimeoutDuration*1e3).toUTCString()),this.logContext),this.handleOnClose("ping timeout")},this.pingTimeoutDuration*1e3)}clearPingTimeout(){this.pingTimeout&&Te.clearTimeout(this.pingTimeout)}startPingInterval(){if(this.clearPingInterval(),this.resetPingTimeout(),!this.pingIntervalDuration){this.log.warn("ping interval duration not set",this.logContext);return}this.log.debug("start ping interval",this.logContext),this.pingInterval=Te.setInterval(()=>{this.sendPing()},this.pingIntervalDuration*1e3)}clearPingInterval(){this.log.debug("clearing ping interval",this.logContext),this.clearPingTimeout(),this.pingInterval&&Te.clearInterval(this.pingInterval)}}function Ld(t){const e={type:"offer",sdp:t.sdp};switch(t.type){case"answer":case"offer":case"pranswer":case"rollback":e.type=t.type;break}return e}function lr(t){return new gt({sdp:t.sdp,type:t.type})}function mb(t,e,A){var n;const i=new URLSearchParams;return i.set("access_token",t),A.reconnect&&(i.set("reconnect","1"),A.sid&&i.set("sid",A.sid)),i.set("auto_subscribe",A.autoSubscribe?"1":"0"),i.set("sdk",UA()?"reactnative":"js"),i.set("version",e.version),i.set("protocol",e.protocol.toString()),e.deviceModel&&i.set("device_model",e.deviceModel),e.os&&i.set("os",e.os),e.osVersion&&i.set("os_version",e.osVersion),e.browser&&i.set("browser",e.browser),e.browserVersion&&i.set("browser_version",e.browserVersion),A.adaptiveStream&&i.set("adaptive_stream","1"),A.reconnectReason&&i.set("reconnect_reason",A.reconnectReason.toString()),!((n=navigator.connection)===null||n===void 0)&&n.type&&i.set("network",navigator.connection.type),i}var dA={},Ta={},Fa={exports:{}},Dd;function Ia(){if(Dd)return Fa.exports;Dd=1;var t=Fa.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(e){return e.encoding?"rtpmap:%d %s/%s/%s":e.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(e){return e.address!=null?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(e){return e.subtype!=null?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(e){return"extmap:%d"+(e.direction?"/%s":"%v")+(e["encrypt-uri"]?" %s":"%v")+" %s"+(e.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(e){return e.sessionConfig!=null?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%s"},{name:"ptime",reg:/^ptime:(\d*(?:\.\d*)*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*(?:\.\d*)*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(e){var A="candidate:%s %d %s %d %s %d typ %s";return A+=e.raddr!=null?" raddr %s rport %d":"%v%v",A+=e.tcptype!=null?" tcptype %s":"%v",e.generation!=null&&(A+=" generation %d"),A+=e["network-id"]!=null?" network-id %d":"%v",A+=e["network-cost"]!=null?" network-cost %d":"%v",A}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(e){var A="ssrc:%d";return e.attribute!=null&&(A+=" %s",e.value!=null&&(A+=":%s")),A}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(e){return e.maxMessageSize!=null?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(e){return e.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(e){return"imageattr:%s %s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(e){return"simulcast:%s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"},{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(e){return"ts-refclk:%s"+(e.clksrcExt!=null?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(e){var A="mediaclk:";return A+=e.id!=null?"id=%s %s":"%v%s",A+=e.mediaClockValue!=null?"=%s":"",A+=e.rateNumerator!=null?" rate=%s":"",A+=e.rateDenominator!=null?"/%s":"",A}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};return Object.keys(t).forEach(function(e){var A=t[e];A.forEach(function(n){n.reg||(n.reg=/(.*)/),n.format||(n.format="%s")})}),Fa.exports}var Hd;function Bb(){return Hd||(Hd=1,function(t){var e=function(a){return String(Number(a))===a?Number(a):a},A=function(a,o,c,l){if(l&&!c)o[l]=e(a[1]);else for(var u=0;u<c.length;u+=1)a[u+1]!=null&&(o[c[u]]=e(a[u+1]))},n=function(a,o,c){var l=a.name&&a.names;a.push&&!o[a.push]?o[a.push]=[]:l&&!o[a.name]&&(o[a.name]={});var u=a.push?{}:l?o[a.name]:o;A(c.match(a.reg),u,a.names,a.name),a.push&&o[a.push].push(u)},i=Ia(),r=RegExp.prototype.test.bind(/^([a-z])=(.*)/);t.parse=function(a){var o={},c=[],l=o;return a.split(/(\r\n|\r|\n)/).filter(r).forEach(function(u){var d=u[0],h=u.slice(2);d==="m"&&(c.push({rtp:[],fmtp:[]}),l=c[c.length-1]);for(var g=0;g<(i[d]||[]).length;g+=1){var f=i[d][g];if(f.reg.test(h))return n(f,l,h)}}),o.media=c,o};var s=function(a,o){var c=o.split(/=(.+)/,2);return c.length===2?a[c[0]]=e(c[1]):c.length===1&&o.length>1&&(a[c[0]]=void 0),a};t.parseParams=function(a){return a.split(/;\s?/).reduce(s,{})},t.parseFmtpConfig=t.parseParams,t.parsePayloads=function(a){return a.toString().split(" ").map(Number)},t.parseRemoteCandidates=function(a){for(var o=[],c=a.split(" ").map(e),l=0;l<c.length;l+=3)o.push({component:c[l],ip:c[l+1],port:c[l+2]});return o},t.parseImageAttributes=function(a){return a.split(" ").map(function(o){return o.substring(1,o.length-1).split(",").reduce(s,{})})},t.parseSimulcastStreamList=function(a){return a.split(";").map(function(o){return o.split(",").map(function(c){var l,u=!1;return c[0]!=="~"?l=e(c):(l=e(c.substring(1,c.length)),u=!0),{scid:l,paused:u}})})}}(Ta)),Ta}var xa,Od;function vb(){if(Od)return xa;Od=1;var t=Ia(),e=/%[sdv%]/g,A=function(s){var a=1,o=arguments,c=o.length;return s.replace(e,function(l){if(a>=c)return l;var u=o[a];switch(a+=1,l){case"%%":return"%";case"%s":return String(u);case"%d":return Number(u);case"%v":return""}})},n=function(s,a,o){var c=a.format instanceof Function?a.format(a.push?o:o[a.name]):a.format,l=[s+"="+c];if(a.names)for(var u=0;u<a.names.length;u+=1){var d=a.names[u];a.name?l.push(o[a.name][d]):l.push(o[a.names[u]])}else l.push(o[a.name]);return A.apply(null,l)},i=["v","o","s","i","u","e","p","c","b","t","r","z","a"],r=["i","c","b","a"];return xa=function(s,a){a=a||{},s.version==null&&(s.version=0),s.name==null&&(s.name=" "),s.media.forEach(function(u){u.payloads==null&&(u.payloads="")});var o=a.outerOrder||i,c=a.innerOrder||r,l=[];return o.forEach(function(u){t[u].forEach(function(d){d.name in s&&s[d.name]!=null?l.push(n(u,d,s)):d.push in s&&s[d.push]!=null&&s[d.push].forEach(function(h){l.push(n(u,d,h))})})}),s.media.forEach(function(u){l.push(n("m",t.m[0],u)),c.forEach(function(d){t[d].forEach(function(h){h.name in u&&u[h.name]!=null?l.push(n(d,h,u)):h.push in u&&u[h.push]!=null&&u[h.push].forEach(function(g){l.push(n(d,h,g))})})})}),l.join(`\r
44
+ `);n.RTCSessionDescription&&i instanceof n.RTCSessionDescription?arguments[0]=new n.RTCSessionDescription({type:i.type,sdp:A}):i.sdp=A}return t.apply(this,arguments)}}function Xo(n,e){if(!(n.RTCPeerConnection&&n.RTCPeerConnection.prototype))return;const t=n.RTCPeerConnection.prototype.addIceCandidate;!t||t.length===0||(n.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?(e.browser==="chrome"&&e.version<78||e.browser==="firefox"&&e.version<68||e.browser==="safari")&&arguments[0]&&arguments[0].candidate===""?Promise.resolve():t.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function Yo(n,e){if(!(n.RTCPeerConnection&&n.RTCPeerConnection.prototype))return;const t=n.RTCPeerConnection.prototype.setLocalDescription;!t||t.length===0||(n.RTCPeerConnection.prototype.setLocalDescription=function(){let i=arguments[0]||{};if(typeof i!="object"||i.type&&i.sdp)return t.apply(this,arguments);if(i={type:i.type,sdp:i.sdp},!i.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":i.type="offer";break;default:i.type="answer";break}return i.sdp||i.type!=="offer"&&i.type!=="answer"?t.apply(this,[i]):(i.type==="offer"?this.createOffer:this.createAnswer).apply(this).then(s=>t.apply(this,[s]))})}var tF=Object.freeze({__proto__:null,removeExtmapAllowMixed:gl,shimAddIceCandidateNullOrEmpty:Xo,shimConnectionState:fl,shimMaxMessageSize:Jo,shimParameterlessSetLocalDescription:Yo,shimRTCIceCandidate:qo,shimRTCIceCandidateRelayProtocol:pl,shimSendThrowTypeError:zo});function nF(){let{window:n}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimSafari:!0};const t=tv,r=YI(n),i={browserDetails:r,commonShim:tF,extractVersion:Wo,disableLog:zI,disableWarnings:XI,sdp:eF};switch(r.browser){case"chrome":if(!pv||!ll||!e.shimChrome)return t("Chrome shim is not included in this adapter release."),i;if(r.version===null)return t("Chrome shim can not determine version, not shimming."),i;t("adapter.js shimming chrome."),i.browserShim=pv,Xo(n,r),Yo(n),sv(n,r),ov(n),ll(n,r),av(n),dv(n,r),cv(n),uv(n),hv(n,r),qo(n),pl(n),fl(n),Jo(n,r),zo(n),gl(n,r);break;case"firefox":if(!Sv||!dl||!e.shimFirefox)return t("Firefox shim is not included in this adapter release."),i;t("adapter.js shimming firefox."),i.browserShim=Sv,Xo(n,r),Yo(n),fv(n,r),dl(n,r),gv(n),yv(n),mv(n),vv(n),wv(n),bv(n),Bv(n),Cv(n),_v(n),qo(n),fl(n),Jo(n,r),zo(n);break;case"safari":if(!Pv||!e.shimSafari)return t("Safari shim is not included in this adapter release."),i;t("adapter.js shimming safari."),i.browserShim=Pv,Xo(n,r),Yo(n),Fv(n),Qv(n),Uv(n),kv(n),Ev(n),xv(n),Tv(n),Rv(n),qo(n),pl(n),Jo(n,r),zo(n),gl(n,r);break;default:t("Unsupported browser!");break}return i}nF({window:typeof window>"u"?void 0:window});const rF=10,Zo="lk_e2ee",iF={sharedKey:!1,ratchetSalt:"LKFrameEncryptionKey",ratchetWindowSize:8,failureTolerance:rF,keyringSize:16};var ur;(function(n){n.SetKey="setKey",n.RatchetRequest="ratchetRequest",n.KeyRatcheted="keyRatcheted"})(ur||(ur={}));var Lv;(function(n){n.KeyRatcheted="keyRatcheted"})(Lv||(Lv={}));var lr;(function(n){n.ParticipantEncryptionStatusChanged="participantEncryptionStatusChanged",n.EncryptionError="encryptionError"})(lr||(lr={}));var Dv;(function(n){n.Error="cryptorError"})(Dv||(Dv={}));function AF(){return sF()||ml()}function ml(){return typeof window.RTCRtpScriptTransform<"u"}function sF(){return typeof window.RTCRtpSender<"u"&&typeof window.RTCRtpSender.prototype.createEncodedStreams<"u"}class e4 extends _n.EventEmitter{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(),this.onKeyRatcheted=(t,r,i)=>{ce.debug("key ratcheted event received",{ratchetResult:t,participantId:r,keyIndex:i})},this.keyInfoMap=new Map,this.options=Object.assign(Object.assign({},iF),e),this.on(ur.KeyRatcheted,this.onKeyRatcheted)}onSetEncryptionKey(e,t,r){const i={key:e,participantIdentity:t,keyIndex:r};if(!this.options.sharedKey&&!t)throw new Error("participant identity needs to be passed for encryption key if sharedKey option is false");this.keyInfoMap.set("".concat(t??"shared","-").concat(r??0),i),this.emit(ur.SetKey,i)}getKeys(){return Array.from(this.keyInfoMap.values())}getOptions(){return this.options}ratchetKey(e,t){this.emit(ur.RatchetRequest,e,t)}}class dr extends Error{constructor(e,t){super(t||"an error has occured"),this.name="LiveKitError",this.code=e}}var le;(function(n){n[n.NotAllowed=0]="NotAllowed",n[n.ServerUnreachable=1]="ServerUnreachable",n[n.InternalError=2]="InternalError",n[n.Cancelled=3]="Cancelled",n[n.LeaveRequest=4]="LeaveRequest"})(le||(le={}));class Ie extends dr{constructor(e,t,r,i){super(1,e),this.name="ConnectionError",this.status=r,this.reason=t,this.context=i,this.reasonName=le[t]}}class vl extends dr{constructor(e){super(21,e??"device is unsupported"),this.name="DeviceUnsupportedError"}}class Ln extends dr{constructor(e){super(20,e??"track is invalid"),this.name="TrackInvalidError"}}class oF extends dr{constructor(e){super(10,e??"unsupported server"),this.name="UnsupportedServer"}}class ut extends dr{constructor(e){super(12,e??"unexpected connection state"),this.name="UnexpectedConnectionState"}}class yl extends dr{constructor(e){super(13,e??"unable to negotiate"),this.name="NegotiationError"}}class wl extends dr{constructor(e,t){super(15,e),this.name="PublishTrackError",this.status=t}}class Hv extends dr{constructor(e,t){super(15,e),this.reason=t,this.reasonName=typeof t=="string"?t:ol[t]}}var $o;(function(n){n.PermissionDenied="PermissionDenied",n.NotFound="NotFound",n.DeviceInUse="DeviceInUse",n.Other="Other"})($o||($o={})),function(n){function e(t){if(t&&"name"in t)return t.name==="NotFoundError"||t.name==="DevicesNotFoundError"?n.NotFound:t.name==="NotAllowedError"||t.name==="PermissionDeniedError"?n.PermissionDenied:t.name==="NotReadableError"||t.name==="TrackStartError"?n.DeviceInUse:n.Other}n.getFailure=e}($o||($o={}));var Nv;(function(n){n[n.InvalidKey=0]="InvalidKey",n[n.MissingKey=1]="MissingKey",n[n.InternalError=2]="InternalError"})(Nv||(Nv={}));var O;(function(n){n.Connected="connected",n.Reconnecting="reconnecting",n.SignalReconnecting="signalReconnecting",n.Reconnected="reconnected",n.Disconnected="disconnected",n.ConnectionStateChanged="connectionStateChanged",n.Moved="moved",n.MediaDevicesChanged="mediaDevicesChanged",n.ParticipantConnected="participantConnected",n.ParticipantDisconnected="participantDisconnected",n.TrackPublished="trackPublished",n.TrackSubscribed="trackSubscribed",n.TrackSubscriptionFailed="trackSubscriptionFailed",n.TrackUnpublished="trackUnpublished",n.TrackUnsubscribed="trackUnsubscribed",n.TrackMuted="trackMuted",n.TrackUnmuted="trackUnmuted",n.LocalTrackPublished="localTrackPublished",n.LocalTrackUnpublished="localTrackUnpublished",n.LocalAudioSilenceDetected="localAudioSilenceDetected",n.ActiveSpeakersChanged="activeSpeakersChanged",n.ParticipantMetadataChanged="participantMetadataChanged",n.ParticipantNameChanged="participantNameChanged",n.ParticipantAttributesChanged="participantAttributesChanged",n.ParticipantActive="participantActive",n.RoomMetadataChanged="roomMetadataChanged",n.DataReceived="dataReceived",n.SipDTMFReceived="sipDTMFReceived",n.TranscriptionReceived="transcriptionReceived",n.ConnectionQualityChanged="connectionQualityChanged",n.TrackStreamStateChanged="trackStreamStateChanged",n.TrackSubscriptionPermissionChanged="trackSubscriptionPermissionChanged",n.TrackSubscriptionStatusChanged="trackSubscriptionStatusChanged",n.AudioPlaybackStatusChanged="audioPlaybackChanged",n.VideoPlaybackStatusChanged="videoPlaybackChanged",n.MediaDevicesError="mediaDevicesError",n.ParticipantPermissionsChanged="participantPermissionsChanged",n.SignalConnected="signalConnected",n.RecordingStatusChanged="recordingStatusChanged",n.ParticipantEncryptionStatusChanged="participantEncryptionStatusChanged",n.EncryptionError="encryptionError",n.DCBufferStatusChanged="dcBufferStatusChanged",n.ActiveDeviceChanged="activeDeviceChanged",n.ChatMessage="chatMessage",n.LocalTrackSubscribed="localTrackSubscribed",n.MetricsReceived="metricsReceived"})(O||(O={}));var K;(function(n){n.TrackPublished="trackPublished",n.TrackSubscribed="trackSubscribed",n.TrackSubscriptionFailed="trackSubscriptionFailed",n.TrackUnpublished="trackUnpublished",n.TrackUnsubscribed="trackUnsubscribed",n.TrackMuted="trackMuted",n.TrackUnmuted="trackUnmuted",n.LocalTrackPublished="localTrackPublished",n.LocalTrackUnpublished="localTrackUnpublished",n.ParticipantMetadataChanged="participantMetadataChanged",n.ParticipantNameChanged="participantNameChanged",n.DataReceived="dataReceived",n.SipDTMFReceived="sipDTMFReceived",n.TranscriptionReceived="transcriptionReceived",n.IsSpeakingChanged="isSpeakingChanged",n.ConnectionQualityChanged="connectionQualityChanged",n.TrackStreamStateChanged="trackStreamStateChanged",n.TrackSubscriptionPermissionChanged="trackSubscriptionPermissionChanged",n.TrackSubscriptionStatusChanged="trackSubscriptionStatusChanged",n.MediaDevicesError="mediaDevicesError",n.AudioStreamAcquired="audioStreamAcquired",n.ParticipantPermissionsChanged="participantPermissionsChanged",n.PCTrackAdded="pcTrackAdded",n.AttributesChanged="attributesChanged",n.LocalTrackSubscribed="localTrackSubscribed",n.ChatMessage="chatMessage",n.Active="active"})(K||(K={}));var L;(function(n){n.TransportsCreated="transportsCreated",n.Connected="connected",n.Disconnected="disconnected",n.Resuming="resuming",n.Resumed="resumed",n.Restarting="restarting",n.Restarted="restarted",n.SignalResumed="signalResumed",n.SignalRestarted="signalRestarted",n.Closing="closing",n.MediaTrackAdded="mediaTrackAdded",n.ActiveSpeakersUpdate="activeSpeakersUpdate",n.DataPacketReceived="dataPacketReceived",n.RTPVideoMapUpdate="rtpVideoMapUpdate",n.DCBufferStatusChanged="dcBufferStatusChanged",n.ParticipantUpdate="participantUpdate",n.RoomUpdate="roomUpdate",n.SpeakersChanged="speakersChanged",n.StreamStateChanged="streamStateChanged",n.ConnectionQualityUpdate="connectionQualityUpdate",n.SubscriptionError="subscriptionError",n.SubscriptionPermissionUpdate="subscriptionPermissionUpdate",n.RemoteMute="remoteMute",n.SubscribedQualityUpdate="subscribedQualityUpdate",n.LocalTrackUnpublished="localTrackUnpublished",n.LocalTrackSubscribed="localTrackSubscribed",n.Offline="offline",n.SignalRequestResponse="signalRequestResponse",n.SignalConnected="signalConnected",n.RoomMoved="roomMoved"})(L||(L={}));var M;(function(n){n.Message="message",n.Muted="muted",n.Unmuted="unmuted",n.Restarted="restarted",n.Ended="ended",n.Subscribed="subscribed",n.Unsubscribed="unsubscribed",n.UpdateSettings="updateSettings",n.UpdateSubscription="updateSubscription",n.AudioPlaybackStarted="audioPlaybackStarted",n.AudioPlaybackFailed="audioPlaybackFailed",n.AudioSilenceDetected="audioSilenceDetected",n.VisibilityChanged="visibilityChanged",n.VideoDimensionsChanged="videoDimensionsChanged",n.VideoPlaybackStarted="videoPlaybackStarted",n.VideoPlaybackFailed="videoPlaybackFailed",n.ElementAttached="elementAttached",n.ElementDetached="elementDetached",n.UpstreamPaused="upstreamPaused",n.UpstreamResumed="upstreamResumed",n.SubscriptionPermissionChanged="subscriptionPermissionChanged",n.SubscriptionStatusChanged="subscriptionStatusChanged",n.SubscriptionFailed="subscriptionFailed",n.TrackProcessorUpdate="trackProcessorUpdate",n.AudioTrackFeatureUpdate="audioTrackFeatureUpdate",n.TranscriptionReceived="transcriptionReceived",n.TimeSyncUpdate="timeSyncUpdate"})(M||(M={}));function aF(n){return typeof n>"u"?n:typeof structuredClone=="function"?structuredClone(n):JSON.parse(JSON.stringify(n))}const cF=/version\/(\d+(\.?_?\d+)+)/i;let bl;function cn(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(typeof n>"u"&&typeof navigator>"u")return;const t=(n??navigator.userAgent).toLowerCase();if(bl===void 0||e){const r=uF.find(i=>{let{test:A}=i;return A.test(t)});bl=r==null?void 0:r.describe(t)}return bl}const uF=[{test:/firefox|iceweasel|fxios/i,describe(n){return{name:"Firefox",version:ea(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,n),os:n.toLowerCase().includes("fxios")?"iOS":void 0,osVersion:Bl(n)}}},{test:/chrom|crios|crmo/i,describe(n){return{name:"Chrome",version:ea(/(?:chrome|chromium|crios|crmo)\/(\d+(\.?_?\d+)+)/i,n),os:n.toLowerCase().includes("crios")?"iOS":void 0,osVersion:Bl(n)}}},{test:/safari|applewebkit/i,describe(n){return{name:"Safari",version:ea(cF,n),os:n.includes("mobile/")?"iOS":"macOS",osVersion:Bl(n)}}}];function ea(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;const r=e.match(n);return r&&r.length>=t&&r[t]||""}function Bl(n){return n.includes("mac os")?ea(/\(.+?(\d+_\d+(:?_\d+)?)/,n,1).replace(/_/g,"."):void 0}var lF="2.13.0";const dF=lF,hF=16;class yt{}yt.setTimeout=function(){return setTimeout(...arguments)},yt.setInterval=function(){return setInterval(...arguments)},yt.clearTimeout=function(){return clearTimeout(...arguments)},yt.clearInterval=function(){return clearInterval(...arguments)};const pF=5e3,MA=[];var Xt;(function(n){n[n.LOW=0]="LOW",n[n.MEDIUM=1]="MEDIUM",n[n.HIGH=2]="HIGH"})(Xt||(Xt={}));class P extends _n.EventEmitter{constructor(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var i;super(),this.attachedElements=[],this.isMuted=!1,this.streamState=P.StreamState.Active,this.isInBackground=!1,this._currentBitrate=0,this.log=ce,this.appVisibilityChangedListener=()=>{this.backgroundTimeout&&clearTimeout(this.backgroundTimeout),document.visibilityState==="hidden"?this.backgroundTimeout=setTimeout(()=>this.handleAppVisibilityChanged(),pF):this.handleAppVisibilityChanged()},this.log=Mn((i=r.loggerName)!==null&&i!==void 0?i:an.Track),this.loggerContextCb=r.loggerContextCb,this.setMaxListeners(100),this.kind=t,this._mediaStreamTrack=e,this._mediaStreamID=e.id,this.source=P.Source.Unknown}get logContext(){var e;return Object.assign(Object.assign({},(e=this.loggerContextCb)===null||e===void 0?void 0:e.call(this)),Ce(this))}get currentBitrate(){return this._currentBitrate}get mediaStreamTrack(){return this._mediaStreamTrack}get mediaStreamID(){return this._mediaStreamID}attach(e){let t="audio";this.kind===P.Kind.Video&&(t="video"),this.attachedElements.length===0&&this.kind===P.Kind.Video&&this.addAppVisibilityListener(),e||(t==="audio"&&(MA.forEach(A=>{A.parentElement===null&&!e&&(e=A)}),e&&MA.splice(MA.indexOf(e),1)),e||(e=document.createElement(t))),this.attachedElements.includes(e)||this.attachedElements.push(e),Ii(this.mediaStreamTrack,e);const r=e.srcObject.getTracks(),i=r.some(A=>A.kind==="audio");return e.play().then(()=>{this.emit(i?M.AudioPlaybackStarted:M.VideoPlaybackStarted)}).catch(A=>{A.name==="NotAllowedError"?this.emit(i?M.AudioPlaybackFailed:M.VideoPlaybackFailed,A):A.name==="AbortError"?ce.debug("".concat(i?"audio":"video"," playback aborted, likely due to new play request")):ce.warn("could not playback ".concat(i?"audio":"video"),A),i&&e&&r.some(s=>s.kind==="video")&&A.name==="NotAllowedError"&&(e.muted=!0,e.play().catch(()=>{}))}),this.emit(M.ElementAttached,e),e}detach(e){try{if(e){Fi(this.mediaStreamTrack,e);const r=this.attachedElements.indexOf(e);return r>=0&&(this.attachedElements.splice(r,1),this.recycleElement(e),this.emit(M.ElementDetached,e)),e}const t=[];return this.attachedElements.forEach(r=>{Fi(this.mediaStreamTrack,r),t.push(r),this.recycleElement(r),this.emit(M.ElementDetached,r)}),this.attachedElements=[],t}finally{this.attachedElements.length===0&&this.removeAppVisibilityListener()}}stop(){this.stopMonitor(),this._mediaStreamTrack.stop()}enable(){this._mediaStreamTrack.enabled=!0}disable(){this._mediaStreamTrack.enabled=!1}stopMonitor(){this.monitorInterval&&clearInterval(this.monitorInterval),this.timeSyncHandle&&cancelAnimationFrame(this.timeSyncHandle)}updateLoggerOptions(e){e.loggerName&&(this.log=Mn(e.loggerName)),e.loggerContextCb&&(this.loggerContextCb=e.loggerContextCb)}recycleElement(e){if(e instanceof HTMLAudioElement){let t=!0;e.pause(),MA.forEach(r=>{r.parentElement||(t=!1)}),t&&MA.push(e)}}handleAppVisibilityChanged(){return S(this,void 0,void 0,function*(){this.isInBackground=document.visibilityState==="hidden",!this.isInBackground&&this.kind===P.Kind.Video&&setTimeout(()=>this.attachedElements.forEach(e=>e.play().catch(()=>{})),0)})}addAppVisibilityListener(){Ht()?(this.isInBackground=document.visibilityState==="hidden",document.addEventListener("visibilitychange",this.appVisibilityChangedListener)):this.isInBackground=!1}removeAppVisibilityListener(){Ht()&&document.removeEventListener("visibilitychange",this.appVisibilityChangedListener)}}function Ii(n,e){let t;e.srcObject instanceof MediaStream?t=e.srcObject:t=new MediaStream;let r;n.kind==="audio"?r=t.getAudioTracks():r=t.getVideoTracks(),r.includes(n)||(r.forEach(i=>{t.removeTrack(i)}),t.addTrack(n)),(!hr()||!(e instanceof HTMLVideoElement))&&(e.autoplay=!0),e.muted=t.getAudioTracks().length===0,e instanceof HTMLVideoElement&&(e.playsInline=!0),e.srcObject!==t&&(e.srcObject=t,(hr()||xi())&&e instanceof HTMLVideoElement&&setTimeout(()=>{e.srcObject=t,e.play().catch(()=>{})},0))}function Fi(n,e){if(e.srcObject instanceof MediaStream){const t=e.srcObject;t.removeTrack(n),t.getTracks().length>0?e.srcObject=t:e.srcObject=null}}(function(n){let e;(function(c){c.Audio="audio",c.Video="video",c.Unknown="unknown"})(e=n.Kind||(n.Kind={}));let t;(function(c){c.Camera="camera",c.Microphone="microphone",c.ScreenShare="screen_share",c.ScreenShareAudio="screen_share_audio",c.Unknown="unknown"})(t=n.Source||(n.Source={}));let r;(function(c){c.Active="active",c.Paused="paused",c.Unknown="unknown"})(r=n.StreamState||(n.StreamState={}));function i(c){switch(c){case e.Audio:return rn.AUDIO;case e.Video:return rn.VIDEO;default:return rn.DATA}}n.kindToProto=i;function A(c){switch(c){case rn.AUDIO:return e.Audio;case rn.VIDEO:return e.Video;default:return e.Unknown}}n.kindFromProto=A;function s(c){switch(c){case t.Camera:return ot.CAMERA;case t.Microphone:return ot.MICROPHONE;case t.ScreenShare:return ot.SCREEN_SHARE;case t.ScreenShareAudio:return ot.SCREEN_SHARE_AUDIO;default:return ot.UNKNOWN}}n.sourceToProto=s;function o(c){switch(c){case ot.CAMERA:return t.Camera;case ot.MICROPHONE:return t.Microphone;case ot.SCREEN_SHARE:return t.ScreenShare;case ot.SCREEN_SHARE_AUDIO:return t.ScreenShareAudio;default:return t.Unknown}}n.sourceFromProto=o;function a(c){switch(c){case el.ACTIVE:return r.Active;case el.PAUSED:return r.Paused;default:return r.Unknown}}n.streamStateFromProto=a})(P||(P={}));class Ue{constructor(e,t,r,i,A){if(typeof e=="object")this.width=e.width,this.height=e.height,this.aspectRatio=e.aspectRatio,this.encoding={maxBitrate:e.maxBitrate,maxFramerate:e.maxFramerate,priority:e.priority};else if(t!==void 0&&r!==void 0)this.width=e,this.height=t,this.aspectRatio=e/t,this.encoding={maxBitrate:r,maxFramerate:i,priority:A};else throw new TypeError("Unsupported options: provide at least width, height and maxBitrate")}get resolution(){return{width:this.width,height:this.height,frameRate:this.encoding.maxFramerate,aspectRatio:this.aspectRatio}}}const fF=["vp8","h264"],gF=["vp8","h264","vp9","av1"];function mF(n){return!!fF.find(e=>e===n)}var Kv;(function(n){n[n.PREFER_REGRESSION=0]="PREFER_REGRESSION",n[n.SIMULCAST=1]="SIMULCAST",n[n.REGRESSION=2]="REGRESSION"})(Kv||(Kv={}));var Cl;(function(n){n.telephone={maxBitrate:12e3},n.speech={maxBitrate:24e3},n.music={maxBitrate:48e3},n.musicStereo={maxBitrate:64e3},n.musicHighQuality={maxBitrate:96e3},n.musicHighQualityStereo={maxBitrate:128e3}})(Cl||(Cl={}));const LA={h90:new Ue(160,90,9e4,20),h180:new Ue(320,180,16e4,20),h216:new Ue(384,216,18e4,20),h360:new Ue(640,360,45e4,20),h540:new Ue(960,540,8e5,25),h720:new Ue(1280,720,17e5,30),h1080:new Ue(1920,1080,3e6,30),h1440:new Ue(2560,1440,5e6,30),h2160:new Ue(3840,2160,8e6,30)},_l={h120:new Ue(160,120,7e4,20),h180:new Ue(240,180,125e3,20),h240:new Ue(320,240,14e4,20),h360:new Ue(480,360,33e4,20),h480:new Ue(640,480,5e5,20),h540:new Ue(720,540,6e5,25),h720:new Ue(960,720,13e5,30),h1080:new Ue(1440,1080,23e5,30),h1440:new Ue(1920,1440,38e5,30)},Sl={h360fps3:new Ue(640,360,2e5,3,"medium"),h360fps15:new Ue(640,360,4e5,15,"medium"),h720fps5:new Ue(1280,720,8e5,5,"medium"),h720fps15:new Ue(1280,720,15e5,15,"medium"),h720fps30:new Ue(1280,720,2e6,30,"medium"),h1080fps15:new Ue(1920,1080,25e5,15,"medium"),h1080fps30:new Ue(1920,1080,5e6,30,"medium"),original:new Ue(0,0,7e6,30,"medium")},vF="|",Vv="https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension";function yF(n){const e=n.split(vF);return e.length>1?[e[0],n.substr(e[0].length+1)]:[n,""]}function Dt(n){return S(this,void 0,void 0,function*(){return new Promise(e=>yt.setTimeout(e,n))})}function kl(){return"addTransceiver"in RTCPeerConnection.prototype}function El(){return"addTrack"in RTCPeerConnection.prototype}function wF(){if(!("getCapabilities"in RTCRtpSender)||hr())return!1;const n=RTCRtpSender.getCapabilities("video");let e=!1;if(n){for(const t of n.codecs)if(t.mimeType==="video/AV1"){e=!0;break}}return e}function bF(){if(!("getCapabilities"in RTCRtpSender)||xi())return!1;if(hr()){const t=cn();if(t!=null&&t.version&&jr(t.version,"16")<0)return!1}const n=RTCRtpSender.getCapabilities("video");let e=!1;if(n){for(const t of n.codecs)if(t.mimeType==="video/VP9"){e=!0;break}}return e}function DA(n){return n==="av1"||n==="vp9"}function Ul(n){return document?(n||(n=document.createElement("audio")),"setSinkId"in n):!1}function BF(){return typeof RTCPeerConnection>"u"?!1:kl()||El()}function xi(){var n;return((n=cn())===null||n===void 0?void 0:n.name)==="Firefox"}function hr(){var n;return((n=cn())===null||n===void 0?void 0:n.name)==="Safari"}function CF(){const n=cn();return(n==null?void 0:n.name)==="Safari"&&n.version.startsWith("17.")}function Gv(){var n,e;return Ht()?(e=(n=navigator.userAgentData)===null||n===void 0?void 0:n.mobile)!==null&&e!==void 0?e:/Tablet|iPad|Mobile|Android|BlackBerry/.test(navigator.userAgent):!1}function _F(){const n=cn(),e="17.2";if(n)return n.name!=="Safari"&&n.os!=="iOS"||n.os==="iOS"&&n.osVersion&&jr(e,n.osVersion)>=0?!0:n.name==="Safari"&&jr(e,n.version)>=0}function Ht(){return typeof document<"u"}function Sn(){return navigator.product=="ReactNative"}function Tl(n){return n.hostname.endsWith(".livekit.cloud")||n.hostname.endsWith(".livekit.run")}function jv(){if(global&&global.LiveKitReactNativeGlobal)return global.LiveKitReactNativeGlobal}function Wv(){if(!Sn())return;let n=jv();if(n)return n.platform}function qv(){if(Ht())return window.devicePixelRatio;if(Sn()){let n=jv();if(n)return n.devicePixelRatio}return 1}function jr(n,e){const t=n.split("."),r=e.split("."),i=Math.min(t.length,r.length);for(let A=0;A<i;++A){const s=parseInt(t[A],10),o=parseInt(r[A],10);if(s>o)return 1;if(s<o)return-1;if(A===i-1&&s===o)return 0}return n===""&&e!==""?-1:e===""?1:t.length==r.length?0:t.length<r.length?-1:1}function SF(n){for(const e of n)e.target.handleResize(e)}function kF(n){for(const e of n)e.target.handleVisibilityChanged(e)}let Il=null;const Jv=()=>(Il||(Il=new ResizeObserver(SF)),Il);let Fl=null;const zv=()=>(Fl||(Fl=new IntersectionObserver(kF,{root:null,rootMargin:"0px"})),Fl);function EF(){var n;const e=new gI({sdk:Qm.JS,protocol:hF,version:dF});return Sn()&&(e.os=(n=Wv())!==null&&n!==void 0?n:""),e}function Xv(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:16,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:16,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;const i=document.createElement("canvas");i.width=n,i.height=e;const A=i.getContext("2d");A==null||A.fillRect(0,0,i.width,i.height),r&&A&&(A.beginPath(),A.arc(n/2,e/2,50,0,Math.PI*2,!0),A.closePath(),A.fillStyle="grey",A.fill());const s=i.captureStream(),[o]=s.getTracks();if(!o)throw Error("Could not get empty media stream video track");return o.enabled=t,o}let HA;function xl(){if(!HA){const n=new AudioContext,e=n.createOscillator(),t=n.createGain();t.gain.setValueAtTime(0,0);const r=n.createMediaStreamDestination();if(e.connect(t),t.connect(r),e.start(),[HA]=r.stream.getAudioTracks(),!HA)throw Error("Could not get empty media stream audio track");HA.enabled=!1}return HA.clone()}class Ql{constructor(e,t){this.onFinally=t,this.promise=new Promise((r,i)=>S(this,void 0,void 0,function*(){this.resolve=r,this.reject=i,e&&(yield e(r,i))})).finally(()=>{var r;return(r=this.onFinally)===null||r===void 0?void 0:r.call(this)})}}function UF(n){return gF.includes(n)}function pr(n){if(typeof n=="string"||typeof n=="number")return n;if(Array.isArray(n))return n[0];if(n.exact)return Array.isArray(n.exact)?n.exact[0]:n.exact;if(n.ideal)return Array.isArray(n.ideal)?n.ideal[0]:n.ideal;throw Error("could not unwrap constraint")}function TF(n){return n.startsWith("http")?n.replace(/^(http)/,"ws"):n}function Rl(n){return n.startsWith("ws")?n.replace(/^(ws)/,"http"):n}function IF(n,e){return n.segments.map(t=>{let{id:r,text:i,language:A,startTime:s,endTime:o,final:a}=t;var c;const u=(c=e.get(r))!==null&&c!==void 0?c:Date.now(),l=Date.now();return a?e.delete(r):e.set(r,u),{id:r,text:i,startTime:Number.parseInt(s.toString()),endTime:Number.parseInt(o.toString()),final:a,language:A,firstReceivedTime:u,lastReceivedTime:l}})}function FF(n){const{id:e,timestamp:t,message:r,editTimestamp:i}=n;return{id:e,timestamp:Number.parseInt(t.toString()),editTimestamp:i?Number.parseInt(i.toString()):void 0,message:r}}function Yv(n){switch(n.reason){case le.LeaveRequest:return n.context;case le.Cancelled:return An.CLIENT_INITIATED;case le.NotAllowed:return An.USER_REJECTED;case le.ServerUnreachable:return An.JOIN_FAILURE;default:return An.UNKNOWN_REASON}}function ta(n){return n!==void 0?Number(n):void 0}function Wr(n){return n!==void 0?BigInt(n):void 0}function Qi(n){return!!n&&!(n instanceof MediaStreamTrack)&&n.isLocal}function Dn(n){return!!n&&n.kind==P.Kind.Audio}function Ri(n){return!!n&&n.kind==P.Kind.Video}function fr(n){return Qi(n)&&Ri(n)}function qr(n){return Qi(n)&&Dn(n)}function Pl(n){return!!n&&!n.isLocal}function xF(n){return!!n&&!n.isLocal}function Ol(n){return Pl(n)&&Ri(n)}function QF(n){return n.isLocal}function RF(n,e){const t=[];let r=new TextEncoder().encode(n);for(;r.length>e;){let i=e;for(;i>0;){const A=r[i];if(A!==void 0&&(A&192)!==128)break;i--}t.push(r.slice(0,i)),r=r.slice(i)}return r.length>0&&t.push(r),t}function Zv(n,e,t){var r,i,A,s;const{optionsWithoutProcessor:o,audioProcessor:a,videoProcessor:c}=n0(n??{}),u=e==null?void 0:e.processor,l=t==null?void 0:t.processor,d=o??{};return d.audio===!0&&(d.audio={}),d.video===!0&&(d.video={}),d.audio&&(Ml(d.audio,e),(r=(A=d.audio).deviceId)!==null&&r!==void 0||(A.deviceId={ideal:"default"}),(a||u)&&(d.audio.processor=a??u)),d.video&&(Ml(d.video,t),(i=(s=d.video).deviceId)!==null&&i!==void 0||(s.deviceId={ideal:"default"}),(c||l)&&(d.video.processor=c??l)),d}function Ml(n,e){return Object.keys(e).forEach(t=>{n[t]===void 0&&(n[t]=e[t])}),n}function Ll(n){var e,t,r,i;const A={};if(n.video)if(typeof n.video=="object"){const s={},o=s,a=n.video;Object.keys(a).forEach(c=>{switch(c){case"resolution":Ml(o,a.resolution);break;default:o[c]=a[c]}}),A.video=s,(e=(r=A.video).deviceId)!==null&&e!==void 0||(r.deviceId={ideal:"default"})}else A.video=n.video?{deviceId:{ideal:"default"}}:!1;else A.video=!1;return n.audio?typeof n.audio=="object"?(A.audio=n.audio,(t=(i=A.audio).deviceId)!==null&&t!==void 0||(i.deviceId={ideal:"default"})):A.audio={deviceId:{ideal:"default"}}:A.audio=!1,A}function $v(n){return S(this,arguments,void 0,function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:200;return function*(){const r=e0();if(r){const i=r.createAnalyser();i.fftSize=2048;const A=i.frequencyBinCount,s=new Uint8Array(A);r.createMediaStreamSource(new MediaStream([e.mediaStreamTrack])).connect(i),yield Dt(t),i.getByteTimeDomainData(s);const a=s.some(c=>c!==128&&c!==0);return r.close(),!a}return!1}()})}function e0(){var n;const e=typeof window<"u"&&(window.AudioContext||window.webkitAudioContext);if(e){const t=new e({latencyHint:"interactive"});if(t.state==="suspended"&&typeof window<"u"&&(!((n=window.document)===null||n===void 0)&&n.body)){const r=()=>S(this,void 0,void 0,function*(){var i;try{t.state==="suspended"&&(yield t.resume())}catch(A){console.warn("Error trying to auto-resume audio context",A)}(i=window.document.body)===null||i===void 0||i.removeEventListener("click",r)});window.document.body.addEventListener("click",r)}return t}}function PF(n){return n==="audioinput"?P.Source.Microphone:n==="videoinput"?P.Source.Camera:P.Source.Unknown}function t0(n){return n===P.Source.Microphone?"audioinput":n===P.Source.Camera?"videoinput":void 0}function OF(n){var e,t;let r=(e=n.video)!==null&&e!==void 0?e:!0;return n.resolution&&n.resolution.width>0&&n.resolution.height>0&&(r=typeof r=="boolean"?{}:r,hr()?r=Object.assign(Object.assign({},r),{width:{max:n.resolution.width},height:{max:n.resolution.height},frameRate:n.resolution.frameRate}):r=Object.assign(Object.assign({},r),{width:{ideal:n.resolution.width},height:{ideal:n.resolution.height},frameRate:n.resolution.frameRate})),{audio:(t=n.audio)!==null&&t!==void 0?t:!1,video:r,controller:n.controller,selfBrowserSurface:n.selfBrowserSurface,surfaceSwitching:n.surfaceSwitching,systemAudio:n.systemAudio,preferCurrentTab:n.preferCurrentTab}}function na(n){return n.split("/")[1].toLowerCase()}function MF(n){const e=[];return n.forEach(t=>{t.track!==void 0&&e.push(new Al({cid:t.track.mediaStreamID,track:t.trackInfo}))}),e}function Ce(n){return"mediaStreamTrack"in n?{trackID:n.sid,source:n.source,muted:n.isMuted,enabled:n.mediaStreamTrack.enabled,kind:n.kind,streamID:n.mediaStreamID,streamTrackID:n.mediaStreamTrack.id}:{trackID:n.trackSid,enabled:n.isEnabled,muted:n.isMuted,trackInfo:Object.assign({mimeType:n.mimeType,name:n.trackName,encrypted:n.isEncrypted,kind:n.kind,source:n.source},n.track?Ce(n.track):{})}}function LF(){return typeof RTCRtpReceiver<"u"&&"getSynchronizationSources"in RTCRtpReceiver}function DF(n,e){var t;n===void 0&&(n={}),e===void 0&&(e={});const r=[...Object.keys(e),...Object.keys(n)],i={};for(const A of r)n[A]!==e[A]&&(i[A]=(t=e[A])!==null&&t!==void 0?t:"");return i}function n0(n){const e=Object.assign({},n);let t,r;return typeof e.audio=="object"&&e.audio.processor&&(t=e.audio.processor,e.audio=Object.assign(Object.assign({},e.audio),{processor:void 0})),typeof e.video=="object"&&e.video.processor&&(r=e.video.processor,e.video=Object.assign(Object.assign({},e.video),{processor:void 0})),{audioProcessor:t,videoProcessor:r,optionsWithoutProcessor:aF(e)}}function HF(n){switch(n){case ot.CAMERA:return P.Source.Camera;case ot.MICROPHONE:return P.Source.Microphone;case ot.SCREEN_SHARE:return P.Source.ScreenShare;case ot.SCREEN_SHARE_AUDIO:return P.Source.ScreenShareAudio;default:return P.Source.Unknown}}class NF extends _n.EventEmitter{constructor(e){super(),this.onWorkerMessage=t=>{var r,i;const{kind:A,data:s}=t.data;switch(A){case"error":ce.error(s.error.message),this.emit(lr.EncryptionError,s.error);break;case"initAck":s.enabled&&this.keyProvider.getKeys().forEach(o=>{this.postKey(o)});break;case"enable":if(s.enabled&&this.keyProvider.getKeys().forEach(o=>{this.postKey(o)}),this.encryptionEnabled!==s.enabled&&s.participantIdentity===((r=this.room)===null||r===void 0?void 0:r.localParticipant.identity))this.emit(lr.ParticipantEncryptionStatusChanged,s.enabled,this.room.localParticipant),this.encryptionEnabled=s.enabled;else if(s.participantIdentity){const o=(i=this.room)===null||i===void 0?void 0:i.getParticipantByIdentity(s.participantIdentity);if(!o)throw TypeError("couldn't set encryption status, participant not found".concat(s.participantIdentity));this.emit(lr.ParticipantEncryptionStatusChanged,s.enabled,o)}break;case"ratchetKey":this.keyProvider.emit(ur.KeyRatcheted,s.ratchetResult,s.participantIdentity,s.keyIndex);break}},this.onWorkerError=t=>{ce.error("e2ee worker encountered an error:",{error:t.error}),this.emit(lr.EncryptionError,t.error)},this.keyProvider=e.keyProvider,this.worker=e.worker,this.encryptionEnabled=!1}setup(e){if(!AF())throw new vl("tried to setup end-to-end encryption on an unsupported browser");if(ce.info("setting up e2ee"),e!==this.room){this.room=e,this.setupEventListeners(e,this.keyProvider);const t={kind:"init",data:{keyProviderOptions:this.keyProvider.getOptions(),loglevel:GI.getLevel()}};this.worker&&(ce.info("initializing worker",{worker:this.worker}),this.worker.onmessage=this.onWorkerMessage,this.worker.onerror=this.onWorkerError,this.worker.postMessage(t))}}setParticipantCryptorEnabled(e,t){ce.debug("set e2ee to ".concat(e," for participant ").concat(t)),this.postEnable(e,t)}setSifTrailer(e){!e||e.length===0?ce.warn("ignoring server sent trailer as it's empty"):this.postSifTrailer(e)}setupEngine(e){e.on(L.RTPVideoMapUpdate,t=>{this.postRTPMap(t)})}setupEventListeners(e,t){e.on(O.TrackPublished,(r,i)=>this.setParticipantCryptorEnabled(r.trackInfo.encryption!==jt.NONE,i.identity)),e.on(O.ConnectionStateChanged,r=>{r===pe.Connected&&e.remoteParticipants.forEach(i=>{i.trackPublications.forEach(A=>{this.setParticipantCryptorEnabled(A.trackInfo.encryption!==jt.NONE,i.identity)})})}).on(O.TrackUnsubscribed,(r,i,A)=>{var s;const o={kind:"removeTransform",data:{participantIdentity:A.identity,trackId:r.mediaStreamID}};(s=this.worker)===null||s===void 0||s.postMessage(o)}).on(O.TrackSubscribed,(r,i,A)=>{this.setupE2EEReceiver(r,A.identity,i.trackInfo)}).on(O.SignalConnected,()=>{if(!this.room)throw new TypeError("expected room to be present on signal connect");t.getKeys().forEach(r=>{this.postKey(r)}),this.setParticipantCryptorEnabled(this.room.localParticipant.isE2EEEnabled,this.room.localParticipant.identity)}),e.localParticipant.on(K.LocalTrackPublished,r=>S(this,void 0,void 0,function*(){this.setupE2EESender(r.track,r.track.sender)})),t.on(ur.SetKey,r=>this.postKey(r)).on(ur.RatchetRequest,(r,i)=>this.postRatchetRequest(r,i))}postRatchetRequest(e,t){if(!this.worker)throw Error("could not ratchet key, worker is missing");const r={kind:"ratchetRequest",data:{participantIdentity:e,keyIndex:t}};this.worker.postMessage(r)}postKey(e){let{key:t,participantIdentity:r,keyIndex:i}=e;var A;if(!this.worker)throw Error("could not set key, worker is missing");const s={kind:"setKey",data:{participantIdentity:r,isPublisher:r===((A=this.room)===null||A===void 0?void 0:A.localParticipant.identity),key:t,keyIndex:i}};this.worker.postMessage(s)}postEnable(e,t){if(this.worker){const r={kind:"enable",data:{enabled:e,participantIdentity:t}};this.worker.postMessage(r)}else throw new ReferenceError("failed to enable e2ee, worker is not ready")}postRTPMap(e){var t;if(!this.worker)throw TypeError("could not post rtp map, worker is missing");if(!(!((t=this.room)===null||t===void 0)&&t.localParticipant.identity))throw TypeError("could not post rtp map, local participant identity is missing");const r={kind:"setRTPMap",data:{map:e,participantIdentity:this.room.localParticipant.identity}};this.worker.postMessage(r)}postSifTrailer(e){if(!this.worker)throw Error("could not post SIF trailer, worker is missing");const t={kind:"setSifTrailer",data:{trailer:e}};this.worker.postMessage(t)}setupE2EEReceiver(e,t,r){if(e.receiver){if(!(r!=null&&r.mimeType)||r.mimeType==="")throw new TypeError("MimeType missing from trackInfo, cannot set up E2EE cryptor");this.handleReceiver(e.receiver,e.mediaStreamID,t,e.kind==="video"?na(r.mimeType):void 0)}}setupE2EESender(e,t){if(!Qi(e)||!t){t||ce.warn("early return because sender is not ready");return}this.handleSender(t,e.mediaStreamID,void 0)}handleReceiver(e,t,r,i){return S(this,void 0,void 0,function*(){if(this.worker){if(ml()){const A={kind:"decode",participantIdentity:r,trackId:t,codec:i};e.transform=new RTCRtpScriptTransform(this.worker,A)}else{if(Zo in e&&i){const a={kind:"updateCodec",data:{trackId:t,codec:i,participantIdentity:r}};this.worker.postMessage(a);return}let A=e.writableStream,s=e.readableStream;if(!A||!s){const a=e.createEncodedStreams();e.writableStream=a.writable,A=a.writable,e.readableStream=a.readable,s=a.readable}const o={kind:"decode",data:{readableStream:s,writableStream:A,trackId:t,codec:i,participantIdentity:r}};this.worker.postMessage(o,[s,A])}e[Zo]=!0}})}handleSender(e,t,r){var i;if(!(Zo in e||!this.worker)){if(!(!((i=this.room)===null||i===void 0)&&i.localParticipant.identity)||this.room.localParticipant.identity==="")throw TypeError("local identity needs to be known in order to set up encrypted sender");if(ml()){ce.info("initialize script transform");const A={kind:"encode",participantIdentity:this.room.localParticipant.identity,trackId:t,codec:r};e.transform=new RTCRtpScriptTransform(this.worker,A)}else{ce.info("initialize encoded streams");const A=e.createEncodedStreams(),s={kind:"encode",data:{readableStream:A.readable,writableStream:A.writable,codec:r,trackId:t,participantIdentity:this.room.localParticipant.identity}};this.worker.postMessage(s,[A.readable,A.writable])}e[Zo]=!0}}}const Dl="default";class pt{constructor(){this._previousDevices=[]}static getInstance(){return this.instance===void 0&&(this.instance=new pt),this.instance}get previousDevices(){return this._previousDevices}getDevices(e){return S(this,arguments,void 0,function(t){var r=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return function*(){var A;if(((A=pt.userMediaPromiseMap)===null||A===void 0?void 0:A.size)>0){ce.debug("awaiting getUserMedia promise");try{t?yield pt.userMediaPromiseMap.get(t):yield Promise.all(pt.userMediaPromiseMap.values())}catch{ce.warn("error waiting for media permissons")}}let s=yield navigator.mediaDevices.enumerateDevices();if(i&&!(hr()&&r.hasDeviceInUse(t))&&(s.filter(a=>a.kind===t).length===0||s.some(a=>{const c=a.label==="",u=t?a.kind===t:!0;return c&&u}))){const a={video:t!=="audioinput"&&t!=="audiooutput",audio:t!=="videoinput"&&{deviceId:{ideal:"default"}}},c=yield navigator.mediaDevices.getUserMedia(a);s=yield navigator.mediaDevices.enumerateDevices(),c.getTracks().forEach(u=>{u.stop()})}return r._previousDevices=s,t&&(s=s.filter(o=>o.kind===t)),s}()})}normalizeDeviceId(e,t,r){return S(this,void 0,void 0,function*(){if(t!==Dl)return t;const i=yield this.getDevices(e),A=i.find(o=>o.deviceId===Dl);if(!A){ce.warn("could not reliably determine default device");return}const s=i.find(o=>o.deviceId!==Dl&&o.groupId===(r??A.groupId));if(!s){ce.warn("could not reliably determine default device");return}return s==null?void 0:s.deviceId})}hasDeviceInUse(e){return e?pt.userMediaPromiseMap.has(e):pt.userMediaPromiseMap.size>0}}pt.mediaDeviceKinds=["audioinput","audiooutput","videoinput"],pt.userMediaPromiseMap=new Map;var NA;(function(n){n[n.WAITING=0]="WAITING",n[n.RUNNING=1]="RUNNING",n[n.COMPLETED=2]="COMPLETED"})(NA||(NA={}));class KF{constructor(){this.pendingTasks=new Map,this.taskMutex=new Ot,this.nextTaskIndex=0}run(e){return S(this,void 0,void 0,function*(){const t={id:this.nextTaskIndex++,enqueuedAt:Date.now(),status:NA.WAITING};this.pendingTasks.set(t.id,t);const r=yield this.taskMutex.lock();try{return t.executedAt=Date.now(),t.status=NA.RUNNING,yield e()}finally{t.status=NA.COMPLETED,this.pendingTasks.delete(t.id),r()}})}flush(){return S(this,void 0,void 0,function*(){return this.run(()=>S(this,void 0,void 0,function*(){}))})}snapshot(){return Array.from(this.pendingTasks.values())}}function VF(n,e){const t=new URL(TF(n));return e.forEach((r,i)=>{t.searchParams.set(i,r)}),r0(t,"rtc")}function GF(n){const e=new URL(Rl(n));return r0(e,"validate")}function jF(n){return n.endsWith("/")?n:"".concat(n,"/")}function r0(n,e){return n.pathname="".concat(jF(n.pathname)).concat(e),n.toString()}const WF=["syncState","trickle","offer","answer","simulate","leave"];function qF(n){const e=WF.indexOf(n.case)>=0;return ce.trace("request allowed to bypass queue:",{canPass:e,req:n}),e}var Pe;(function(n){n[n.CONNECTING=0]="CONNECTING",n[n.CONNECTED=1]="CONNECTED",n[n.RECONNECTING=2]="RECONNECTING",n[n.DISCONNECTING=3]="DISCONNECTING",n[n.DISCONNECTED=4]="DISCONNECTED"})(Pe||(Pe={}));class Hl{get currentState(){return this.state}get isDisconnected(){return this.state===Pe.DISCONNECTING||this.state===Pe.DISCONNECTED}get isEstablishingConnection(){return this.state===Pe.CONNECTING||this.state===Pe.RECONNECTING}getNextRequestId(){return this._requestId+=1,this._requestId}constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r;this.rtt=0,this.state=Pe.DISCONNECTED,this.log=ce,this._requestId=0,this.resetCallbacks=()=>{this.onAnswer=void 0,this.onLeave=void 0,this.onLocalTrackPublished=void 0,this.onLocalTrackUnpublished=void 0,this.onNegotiateRequested=void 0,this.onOffer=void 0,this.onRemoteMuteChanged=void 0,this.onSubscribedQualityUpdate=void 0,this.onTokenRefresh=void 0,this.onTrickle=void 0,this.onClose=void 0},this.log=Mn((r=t.loggerName)!==null&&r!==void 0?r:an.Signal),this.loggerContextCb=t.loggerContextCb,this.useJSON=e,this.requestQueue=new KF,this.queuedRequests=[],this.closingLock=new Ot,this.connectionLock=new Ot,this.state=Pe.DISCONNECTED}get logContext(){var e,t;return(t=(e=this.loggerContextCb)===null||e===void 0?void 0:e.call(this))!==null&&t!==void 0?t:{}}join(e,t,r,i){return S(this,void 0,void 0,function*(){return this.state=Pe.CONNECTING,this.options=r,yield this.connect(e,t,r,i)})}reconnect(e,t,r,i){return S(this,void 0,void 0,function*(){if(!this.options){this.log.warn("attempted to reconnect without signal options being set, ignoring",this.logContext);return}return this.state=Pe.RECONNECTING,this.clearPingInterval(),yield this.connect(e,t,Object.assign(Object.assign({},this.options),{reconnect:!0,sid:r,reconnectReason:i}))})}connect(e,t,r,i){this.connectOptions=r;const A=EF(),s=JF(t,A,r),o=VF(e,s),a=GF(o);return new Promise((c,u)=>S(this,void 0,void 0,function*(){const l=yield this.connectionLock.lock();try{const d=()=>S(this,void 0,void 0,function*(){this.close(),clearTimeout(h),u(new Ie("room connection has been cancelled (signal)",le.Cancelled))}),h=setTimeout(()=>{this.close(),u(new Ie("room connection has timed out (signal)",le.ServerUnreachable))},r.websocketTimeout);i!=null&&i.aborted&&d(),i==null||i.addEventListener("abort",d);const f=new URL(o);f.searchParams.has("access_token")&&f.searchParams.set("access_token","<redacted>"),this.log.debug("connecting to ".concat(f),Object.assign({reconnect:r.reconnect,reconnectReason:r.reconnectReason},this.logContext)),this.ws&&(yield this.close(!1)),this.ws=new WebSocket(o),this.ws.binaryType="arraybuffer",this.ws.onopen=()=>{clearTimeout(h)},this.ws.onerror=p=>S(this,void 0,void 0,function*(){if(this.state!==Pe.CONNECTED){this.state=Pe.DISCONNECTED,clearTimeout(h);try{const g=yield fetch(a);if(g.status.toFixed(0).startsWith("4")){const v=yield g.text();u(new Ie(v,le.NotAllowed,g.status))}else u(new Ie("Encountered unknown websocket error during connection: ".concat(p.toString()),le.InternalError,g.status))}catch(g){u(new Ie(g instanceof Error?g.message:"server was not reachable",le.ServerUnreachable))}return}this.handleWSError(p)}),this.ws.onmessage=p=>S(this,void 0,void 0,function*(){var g,v,y;let b;if(typeof p.data=="string"){const B=JSON.parse(p.data);b=Dm.fromJson(B,{ignoreUnknownFields:!0})}else if(p.data instanceof ArrayBuffer)b=Dm.fromBinary(new Uint8Array(p.data));else{this.log.error("could not decode websocket message: ".concat(typeof p.data),this.logContext);return}if(this.state!==Pe.CONNECTED){let B=!1;if(((g=b.message)===null||g===void 0?void 0:g.case)==="join"?(this.state=Pe.CONNECTED,i==null||i.removeEventListener("abort",d),this.pingTimeoutDuration=b.message.value.pingTimeout,this.pingIntervalDuration=b.message.value.pingInterval,this.pingTimeoutDuration&&this.pingTimeoutDuration>0&&(this.log.debug("ping config",Object.assign(Object.assign({},this.logContext),{timeout:this.pingTimeoutDuration,interval:this.pingIntervalDuration})),this.startPingInterval()),c(b.message.value)):this.state===Pe.RECONNECTING&&b.message.case!=="leave"?(this.state=Pe.CONNECTED,i==null||i.removeEventListener("abort",d),this.startPingInterval(),((v=b.message)===null||v===void 0?void 0:v.case)==="reconnect"?c(b.message.value):(this.log.debug("declaring signal reconnected without reconnect response received",this.logContext),c(void 0),B=!0)):this.isEstablishingConnection&&b.message.case==="leave"?u(new Ie("Received leave request while trying to (re)connect",le.LeaveRequest,void 0,b.message.value.reason)):r.reconnect||u(new Ie("did not receive join response, got ".concat((y=b.message)===null||y===void 0?void 0:y.case," instead"),le.InternalError)),!B)return}this.signalLatency&&(yield Dt(this.signalLatency)),this.handleSignalResponse(b)}),this.ws.onclose=p=>{this.isEstablishingConnection&&u(new Ie("Websocket got closed during a (re)connection attempt",le.InternalError)),this.log.warn("websocket closed",Object.assign(Object.assign({},this.logContext),{reason:p.reason,code:p.code,wasClean:p.wasClean,state:this.state})),this.handleOnClose(p.reason)}}finally{l()}}))}close(){return S(this,arguments,void 0,function(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return function*(){const r=yield e.closingLock.lock();try{if(e.clearPingInterval(),t&&(e.state=Pe.DISCONNECTING),e.ws){e.ws.onmessage=null,e.ws.onopen=null,e.ws.onclose=null;const i=new Promise(A=>{e.ws?e.ws.onclose=()=>{A()}:A()});e.ws.readyState<e.ws.CLOSING&&(e.ws.close(),yield Promise.race([i,Dt(250)])),e.ws=void 0}}finally{t&&(e.state=Pe.DISCONNECTED),r()}}()})}sendOffer(e){this.log.debug("sending offer",Object.assign(Object.assign({},this.logContext),{offerSdp:e.sdp})),this.sendRequest({case:"offer",value:ra(e)})}sendAnswer(e){return this.log.debug("sending answer",Object.assign(Object.assign({},this.logContext),{answerSdp:e.sdp})),this.sendRequest({case:"answer",value:ra(e)})}sendIceCandidate(e,t){return this.log.debug("sending ice candidate",Object.assign(Object.assign({},this.logContext),{candidate:e})),this.sendRequest({case:"trickle",value:new rl({candidateInit:JSON.stringify(e),target:t})})}sendMuteTrack(e,t){return this.sendRequest({case:"mute",value:new il({sid:e,muted:t})})}sendAddTrack(e){return this.sendRequest({case:"addTrack",value:e})}sendUpdateLocalMetadata(e,t){return S(this,arguments,void 0,function(r,i){var A=this;let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function*(){const o=A.getNextRequestId();return yield A.sendRequest({case:"updateMetadata",value:new Vm({requestId:o,metadata:r,name:i,attributes:s})}),o}()})}sendUpdateTrackSettings(e){this.sendRequest({case:"trackSetting",value:e})}sendUpdateSubscription(e){return this.sendRequest({case:"subscription",value:e})}sendSyncState(e){return this.sendRequest({case:"syncState",value:e})}sendUpdateVideoLayers(e,t){return this.sendRequest({case:"updateLayers",value:new Km({trackSid:e,layers:t})})}sendUpdateSubscriptionPermissions(e,t){return this.sendRequest({case:"subscriptionPermission",value:new Wm({allParticipants:e,trackPermissions:t})})}sendSimulateScenario(e){return this.sendRequest({case:"simulate",value:e})}sendPing(){return Promise.all([this.sendRequest({case:"ping",value:Ne.parse(Date.now())}),this.sendRequest({case:"pingReq",value:new zm({timestamp:Ne.parse(Date.now()),rtt:Ne.parse(this.rtt)})})])}sendUpdateLocalAudioTrack(e,t){return this.sendRequest({case:"updateAudioTrack",value:new Nm({trackSid:e,features:t})})}sendLeave(){return this.sendRequest({case:"leave",value:new Ko({reason:An.CLIENT_INITIATED,action:Ui.DISCONNECT})})}sendRequest(e){return S(this,arguments,void 0,function(t){var r=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return function*(){if(!i&&!qF(t)&&r.state===Pe.RECONNECTING){r.queuedRequests.push(()=>S(r,void 0,void 0,function*(){yield this.sendRequest(t,!0)}));return}if(i||(yield r.requestQueue.flush()),r.signalLatency&&(yield Dt(r.signalLatency)),!r.ws||r.ws.readyState!==r.ws.OPEN){r.log.error("cannot send signal request before connected, type: ".concat(t==null?void 0:t.case),r.logContext);return}const s=new yI({message:t});try{r.useJSON?r.ws.send(s.toJsonString()):r.ws.send(s.toBinary())}catch(o){r.log.error("error sending signal message",Object.assign(Object.assign({},r.logContext),{error:o}))}}()})}handleSignalResponse(e){var t,r;const i=e.message;if(i==null){this.log.debug("received unsupported message",this.logContext);return}let A=!1;if(i.case==="answer"){const s=i0(i.value);this.onAnswer&&this.onAnswer(s)}else if(i.case==="offer"){const s=i0(i.value);this.onOffer&&this.onOffer(s)}else if(i.case==="trickle"){const s=JSON.parse(i.value.candidateInit);this.onTrickle&&this.onTrickle(s,i.value.target)}else i.case==="update"?this.onParticipantUpdate&&this.onParticipantUpdate((t=i.value.participants)!==null&&t!==void 0?t:[]):i.case==="trackPublished"?this.onLocalTrackPublished&&this.onLocalTrackPublished(i.value):i.case==="speakersChanged"?this.onSpeakersChanged&&this.onSpeakersChanged((r=i.value.speakers)!==null&&r!==void 0?r:[]):i.case==="leave"?this.onLeave&&this.onLeave(i.value):i.case==="mute"?this.onRemoteMuteChanged&&this.onRemoteMuteChanged(i.value.sid,i.value.muted):i.case==="roomUpdate"?this.onRoomUpdate&&i.value.room&&this.onRoomUpdate(i.value.room):i.case==="connectionQuality"?this.onConnectionQuality&&this.onConnectionQuality(i.value):i.case==="streamStateUpdate"?this.onStreamStateUpdate&&this.onStreamStateUpdate(i.value):i.case==="subscribedQualityUpdate"?this.onSubscribedQualityUpdate&&this.onSubscribedQualityUpdate(i.value):i.case==="subscriptionPermissionUpdate"?this.onSubscriptionPermissionUpdate&&this.onSubscriptionPermissionUpdate(i.value):i.case==="refreshToken"?this.onTokenRefresh&&this.onTokenRefresh(i.value):i.case==="trackUnpublished"?this.onLocalTrackUnpublished&&this.onLocalTrackUnpublished(i.value):i.case==="subscriptionResponse"?this.onSubscriptionError&&this.onSubscriptionError(i.value):i.case==="pong"||(i.case==="pongResp"?(this.rtt=Date.now()-Number.parseInt(i.value.lastPingTimestamp.toString()),this.resetPingTimeout(),A=!0):i.case==="requestResponse"?this.onRequestResponse&&this.onRequestResponse(i.value):i.case==="trackSubscribed"?this.onLocalTrackSubscribed&&this.onLocalTrackSubscribed(i.value.trackSid):i.case==="roomMoved"?(this.onTokenRefresh&&this.onTokenRefresh(i.value.token),this.onRoomMoved&&this.onRoomMoved(i.value)):this.log.debug("unsupported message",Object.assign(Object.assign({},this.logContext),{msgCase:i.case})));A||this.resetPingTimeout()}setReconnected(){for(;this.queuedRequests.length>0;){const e=this.queuedRequests.shift();e&&this.requestQueue.run(e)}}handleOnClose(e){return S(this,void 0,void 0,function*(){if(this.state===Pe.DISCONNECTED)return;const t=this.onClose;yield this.close(),this.log.debug("websocket connection closed: ".concat(e),Object.assign(Object.assign({},this.logContext),{reason:e})),t&&t(e)})}handleWSError(e){this.log.error("websocket error",Object.assign(Object.assign({},this.logContext),{error:e}))}resetPingTimeout(){if(this.clearPingTimeout(),!this.pingTimeoutDuration){this.log.warn("ping timeout duration not set",this.logContext);return}this.pingTimeout=yt.setTimeout(()=>{this.log.warn("ping timeout triggered. last pong received at: ".concat(new Date(Date.now()-this.pingTimeoutDuration*1e3).toUTCString()),this.logContext),this.handleOnClose("ping timeout")},this.pingTimeoutDuration*1e3)}clearPingTimeout(){this.pingTimeout&&yt.clearTimeout(this.pingTimeout)}startPingInterval(){if(this.clearPingInterval(),this.resetPingTimeout(),!this.pingIntervalDuration){this.log.warn("ping interval duration not set",this.logContext);return}this.log.debug("start ping interval",this.logContext),this.pingInterval=yt.setInterval(()=>{this.sendPing()},this.pingIntervalDuration*1e3)}clearPingInterval(){this.log.debug("clearing ping interval",this.logContext),this.clearPingTimeout(),this.pingInterval&&yt.clearInterval(this.pingInterval)}}function i0(n){const e={type:"offer",sdp:n.sdp};switch(n.type){case"answer":case"offer":case"pranswer":case"rollback":e.type=n.type;break}return e}function ra(n){return new Vr({sdp:n.sdp,type:n.type})}function JF(n,e,t){var r;const i=new URLSearchParams;return i.set("access_token",n),t.reconnect&&(i.set("reconnect","1"),t.sid&&i.set("sid",t.sid)),i.set("auto_subscribe",t.autoSubscribe?"1":"0"),i.set("sdk",Sn()?"reactnative":"js"),i.set("version",e.version),i.set("protocol",e.protocol.toString()),e.deviceModel&&i.set("device_model",e.deviceModel),e.os&&i.set("os",e.os),e.osVersion&&i.set("os_version",e.osVersion),e.browser&&i.set("browser",e.browser),e.browserVersion&&i.set("browser_version",e.browserVersion),t.adaptiveStream&&i.set("adaptive_stream","1"),t.reconnectReason&&i.set("reconnect_reason",t.reconnectReason.toString()),!((r=navigator.connection)===null||r===void 0)&&r.type&&i.set("network",navigator.connection.type),i}var un={},Nl={},Kl={exports:{}},A0;function Vl(){if(A0)return Kl.exports;A0=1;var n=Kl.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(e){return e.encoding?"rtpmap:%d %s/%s/%s":e.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(e){return e.address!=null?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(e){return e.subtype!=null?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(e){return"extmap:%d"+(e.direction?"/%s":"%v")+(e["encrypt-uri"]?" %s":"%v")+" %s"+(e.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(e){return e.sessionConfig!=null?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%s"},{name:"ptime",reg:/^ptime:(\d*(?:\.\d*)*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*(?:\.\d*)*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(e){var t="candidate:%s %d %s %d %s %d typ %s";return t+=e.raddr!=null?" raddr %s rport %d":"%v%v",t+=e.tcptype!=null?" tcptype %s":"%v",e.generation!=null&&(t+=" generation %d"),t+=e["network-id"]!=null?" network-id %d":"%v",t+=e["network-cost"]!=null?" network-cost %d":"%v",t}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(e){var t="ssrc:%d";return e.attribute!=null&&(t+=" %s",e.value!=null&&(t+=":%s")),t}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(e){return e.maxMessageSize!=null?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(e){return e.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(e){return"imageattr:%s %s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(e){return"simulcast:%s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"},{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(e){return"ts-refclk:%s"+(e.clksrcExt!=null?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(e){var t="mediaclk:";return t+=e.id!=null?"id=%s %s":"%v%s",t+=e.mediaClockValue!=null?"=%s":"",t+=e.rateNumerator!=null?" rate=%s":"",t+=e.rateDenominator!=null?"/%s":"",t}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};return Object.keys(n).forEach(function(e){var t=n[e];t.forEach(function(r){r.reg||(r.reg=/(.*)/),r.format||(r.format="%s")})}),Kl.exports}var s0;function zF(){return s0||(s0=1,function(n){var e=function(o){return String(Number(o))===o?Number(o):o},t=function(o,a,c,u){if(u&&!c)a[u]=e(o[1]);else for(var l=0;l<c.length;l+=1)o[l+1]!=null&&(a[c[l]]=e(o[l+1]))},r=function(o,a,c){var u=o.name&&o.names;o.push&&!a[o.push]?a[o.push]=[]:u&&!a[o.name]&&(a[o.name]={});var l=o.push?{}:u?a[o.name]:a;t(c.match(o.reg),l,o.names,o.name),o.push&&a[o.push].push(l)},i=Vl(),A=RegExp.prototype.test.bind(/^([a-z])=(.*)/);n.parse=function(o){var a={},c=[],u=a;return o.split(/(\r\n|\r|\n)/).filter(A).forEach(function(l){var d=l[0],h=l.slice(2);d==="m"&&(c.push({rtp:[],fmtp:[]}),u=c[c.length-1]);for(var f=0;f<(i[d]||[]).length;f+=1){var p=i[d][f];if(p.reg.test(h))return r(p,u,h)}}),a.media=c,a};var s=function(o,a){var c=a.split(/=(.+)/,2);return c.length===2?o[c[0]]=e(c[1]):c.length===1&&a.length>1&&(o[c[0]]=void 0),o};n.parseParams=function(o){return o.split(/;\s?/).reduce(s,{})},n.parseFmtpConfig=n.parseParams,n.parsePayloads=function(o){return o.toString().split(" ").map(Number)},n.parseRemoteCandidates=function(o){for(var a=[],c=o.split(" ").map(e),u=0;u<c.length;u+=3)a.push({component:c[u],ip:c[u+1],port:c[u+2]});return a},n.parseImageAttributes=function(o){return o.split(" ").map(function(a){return a.substring(1,a.length-1).split(",").reduce(s,{})})},n.parseSimulcastStreamList=function(o){return o.split(";").map(function(a){return a.split(",").map(function(c){var u,l=!1;return c[0]!=="~"?u=e(c):(u=e(c.substring(1,c.length)),l=!0),{scid:u,paused:l}})})}}(Nl)),Nl}var Gl,o0;function XF(){if(o0)return Gl;o0=1;var n=Vl(),e=/%[sdv%]/g,t=function(s){var o=1,a=arguments,c=a.length;return s.replace(e,function(u){if(o>=c)return u;var l=a[o];switch(o+=1,u){case"%%":return"%";case"%s":return String(l);case"%d":return Number(l);case"%v":return""}})},r=function(s,o,a){var c=o.format instanceof Function?o.format(o.push?a:a[o.name]):o.format,u=[s+"="+c];if(o.names)for(var l=0;l<o.names.length;l+=1){var d=o.names[l];o.name?u.push(a[o.name][d]):u.push(a[o.names[l]])}else u.push(a[o.name]);return t.apply(null,u)},i=["v","o","s","i","u","e","p","c","b","t","r","z","a"],A=["i","c","b","a"];return Gl=function(s,o){o=o||{},s.version==null&&(s.version=0),s.name==null&&(s.name=" "),s.media.forEach(function(l){l.payloads==null&&(l.payloads="")});var a=o.outerOrder||i,c=o.innerOrder||A,u=[];return a.forEach(function(l){n[l].forEach(function(d){d.name in s&&s[d.name]!=null?u.push(r(l,d,s)):d.push in s&&s[d.push]!=null&&s[d.push].forEach(function(h){u.push(r(l,d,h))})})}),s.media.forEach(function(l){u.push(r("m",n.m[0],l)),c.forEach(function(d){n[d].forEach(function(h){h.name in l&&l[h.name]!=null?u.push(r(d,h,l)):h.push in l&&l[h.push]!=null&&l[h.push].forEach(function(f){u.push(r(d,h,f))})})})}),u.join(`\r
45
45
  `)+`\r
46
- `},xa}var Md;function Cb(){if(Md)return dA;Md=1;var t=Bb(),e=vb(),A=Ia();return dA.grammar=A,dA.write=e,dA.parse=t.parse,dA.parseParams=t.parseParams,dA.parseFmtpConfig=t.parseFmtpConfig,dA.parsePayloads=t.parsePayloads,dA.parseRemoteCandidates=t.parseRemoteCandidates,dA.parseImageAttributes=t.parseImageAttributes,dA.parseSimulcastStreamList=t.parseSimulcastStreamList,dA}var At=Cb();function _a(t,e,A){var n,i,r;e===void 0&&(e=50),A===void 0&&(A={});var s=(n=A.isImmediate)!=null&&n,a=(i=A.callback)!=null&&i,o=A.maxWait,c=Date.now(),l=[];function u(){if(o!==void 0){var h=Date.now()-c;if(h+e>=o)return o-h}return e}var d=function(){var h=[].slice.call(arguments),g=this;return new Promise(function(f,m){var B=s&&r===void 0;if(r!==void 0&&clearTimeout(r),r=setTimeout(function(){if(r=void 0,c=Date.now(),!s){var U=t.apply(g,h);a&&a(U),l.forEach(function(C){return(0,C.resolve)(U)}),l=[]}},u()),B){var b=t.apply(g,h);return a&&a(b),f(b)}l.push({resolve:f,reject:m})})};return d.cancel=function(h){r!==void 0&&clearTimeout(r),l.forEach(function(g){return(0,g.reject)(h)}),l=[]},d}const wb=.7,bb=20,Jt={NegotiationStarted:"negotiationStarted",NegotiationComplete:"negotiationComplete",RTPVideoPayloadTypes:"rtpVideoPayloadTypes"};class Nd extends yA.EventEmitter{get pc(){return this._pc||(this._pc=this.createPC()),this._pc}constructor(e){let A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var n;super(),this.log=W,this.ddExtID=0,this.pendingCandidates=[],this.restartingIce=!1,this.renegotiate=!1,this.trackBitrates=[],this.remoteStereoMids=[],this.remoteNackMids=[],this.negotiate=_a(i=>v(this,void 0,void 0,function*(){this.emit(Jt.NegotiationStarted);try{yield this.createAndSendOffer()}catch(r){if(i)i(r);else throw r}}),bb),this.close=()=>{this._pc&&(this._pc.close(),this._pc.onconnectionstatechange=null,this._pc.oniceconnectionstatechange=null,this._pc.onicegatheringstatechange=null,this._pc.ondatachannel=null,this._pc.onnegotiationneeded=null,this._pc.onsignalingstatechange=null,this._pc.onicecandidate=null,this._pc.ondatachannel=null,this._pc.ontrack=null,this._pc.onconnectionstatechange=null,this._pc.oniceconnectionstatechange=null,this._pc=null)},this.log=FA((n=A.loggerName)!==null&&n!==void 0?n:lA.PCTransport),this.loggerOptions=A,this.config=e,this._pc=this.createPC()}createPC(){const e=new RTCPeerConnection(this.config);return e.onicecandidate=A=>{var n;A.candidate&&((n=this.onIceCandidate)===null||n===void 0||n.call(this,A.candidate))},e.onicecandidateerror=A=>{var n;(n=this.onIceCandidateError)===null||n===void 0||n.call(this,A)},e.oniceconnectionstatechange=()=>{var A;(A=this.onIceConnectionStateChange)===null||A===void 0||A.call(this,e.iceConnectionState)},e.onsignalingstatechange=()=>{var A;(A=this.onSignalingStatechange)===null||A===void 0||A.call(this,e.signalingState)},e.onconnectionstatechange=()=>{var A;(A=this.onConnectionStateChange)===null||A===void 0||A.call(this,e.connectionState)},e.ondatachannel=A=>{var n;(n=this.onDataChannel)===null||n===void 0||n.call(this,A)},e.ontrack=A=>{var n;(n=this.onTrack)===null||n===void 0||n.call(this,A)},e}get logContext(){var e,A;return Object.assign({},(A=(e=this.loggerOptions).loggerContextCb)===null||A===void 0?void 0:A.call(e))}get isICEConnected(){return this._pc!==null&&(this.pc.iceConnectionState==="connected"||this.pc.iceConnectionState==="completed")}addIceCandidate(e){return v(this,void 0,void 0,function*(){if(this.pc.remoteDescription&&!this.restartingIce)return this.pc.addIceCandidate(e);this.pendingCandidates.push(e)})}setRemoteDescription(e){return v(this,void 0,void 0,function*(){var A;let n;if(e.type==="offer"){let{stereoMids:i,nackMids:r}=yb(e);this.remoteStereoMids=i,this.remoteNackMids=r}else if(e.type==="answer"){const i=At.parse((A=e.sdp)!==null&&A!==void 0?A:"");i.media.forEach(r=>{r.type==="audio"&&this.trackBitrates.some(s=>{if(!s.transceiver||r.mid!=s.transceiver.mid)return!1;let a=0;if(r.rtp.some(c=>c.codec.toUpperCase()===s.codec.toUpperCase()?(a=c.payload,!0):!1),a===0)return!0;let o=!1;for(const c of r.fmtp)if(c.payload===a){c.config=c.config.split(";").filter(l=>!l.includes("maxaveragebitrate")).join(";"),s.maxbr>0&&(c.config+=";maxaveragebitrate=".concat(s.maxbr*1e3)),o=!0;break}return o||s.maxbr>0&&r.fmtp.push({payload:a,config:"maxaveragebitrate=".concat(s.maxbr*1e3)}),!0})}),n=At.write(i)}yield this.setMungedSDP(e,n,!0),this.pendingCandidates.forEach(i=>{this.pc.addIceCandidate(i)}),this.pendingCandidates=[],this.restartingIce=!1,this.renegotiate?(this.renegotiate=!1,yield this.createAndSendOffer()):e.type==="answer"&&(this.emit(Jt.NegotiationComplete),e.sdp&&At.parse(e.sdp).media.forEach(r=>{r.type==="video"&&this.emit(Jt.RTPVideoPayloadTypes,r.rtp)}))})}createAndSendOffer(e){return v(this,void 0,void 0,function*(){var A;if(this.onOffer===void 0)return;if(e!=null&&e.iceRestart&&(this.log.debug("restarting ICE",this.logContext),this.restartingIce=!0),this._pc&&this._pc.signalingState==="have-local-offer"){const r=this._pc.remoteDescription;if(e!=null&&e.iceRestart&&r)yield this._pc.setRemoteDescription(r);else{this.renegotiate=!0;return}}else if(!this._pc||this._pc.signalingState==="closed"){this.log.warn("could not createOffer with closed peer connection",this.logContext);return}this.log.debug("starting to negotiate",this.logContext);const n=yield this.pc.createOffer(e);this.log.debug("original offer",Object.assign({sdp:n.sdp},this.logContext));const i=At.parse((A=n.sdp)!==null&&A!==void 0?A:"");i.media.forEach(r=>{Vd(r),r.type==="audio"?Kd(r,[],[]):r.type==="video"&&this.trackBitrates.some(s=>{if(!r.msid||!s.cid||!r.msid.includes(s.cid))return!1;let a=0;if(r.rtp.some(c=>c.codec.toUpperCase()===s.codec.toUpperCase()?(a=c.payload,!0):!1),a===0||(kn(s.codec)&&this.ensureVideoDDExtensionForSVC(r,i),s.codec!=="av1"))return!0;const o=Math.round(s.maxbr*wb);for(const c of r.fmtp)if(c.payload===a){c.config.includes("x-google-start-bitrate")||(c.config+=";x-google-start-bitrate=".concat(o));break}return!0})}),yield this.setMungedSDP(n,At.write(i)),this.onOffer(n)})}createAndSetAnswer(){return v(this,void 0,void 0,function*(){var e;const A=yield this.pc.createAnswer(),n=At.parse((e=A.sdp)!==null&&e!==void 0?e:"");return n.media.forEach(i=>{Vd(i),i.type==="audio"&&Kd(i,this.remoteStereoMids,this.remoteNackMids)}),yield this.setMungedSDP(A,At.write(n)),A})}createDataChannel(e,A){return this.pc.createDataChannel(e,A)}addTransceiver(e,A){return this.pc.addTransceiver(e,A)}addTrack(e){if(!this._pc)throw new ye("PC closed, cannot add track");return this._pc.addTrack(e)}setTrackCodecBitrate(e){this.trackBitrates.push(e)}setConfiguration(e){var A;if(!this._pc)throw new ye("PC closed, cannot configure");return(A=this._pc)===null||A===void 0?void 0:A.setConfiguration(e)}canRemoveTrack(){var e;return!!(!((e=this._pc)===null||e===void 0)&&e.removeTrack)}removeTrack(e){var A;return(A=this._pc)===null||A===void 0?void 0:A.removeTrack(e)}getConnectionState(){var e,A;return(A=(e=this._pc)===null||e===void 0?void 0:e.connectionState)!==null&&A!==void 0?A:"closed"}getICEConnectionState(){var e,A;return(A=(e=this._pc)===null||e===void 0?void 0:e.iceConnectionState)!==null&&A!==void 0?A:"closed"}getSignallingState(){var e,A;return(A=(e=this._pc)===null||e===void 0?void 0:e.signalingState)!==null&&A!==void 0?A:"closed"}getTransceivers(){var e,A;return(A=(e=this._pc)===null||e===void 0?void 0:e.getTransceivers())!==null&&A!==void 0?A:[]}getSenders(){var e,A;return(A=(e=this._pc)===null||e===void 0?void 0:e.getSenders())!==null&&A!==void 0?A:[]}getLocalDescription(){var e;return(e=this._pc)===null||e===void 0?void 0:e.localDescription}getRemoteDescription(){var e;return(e=this.pc)===null||e===void 0?void 0:e.remoteDescription}getStats(){return this.pc.getStats()}getConnectedAddress(){return v(this,void 0,void 0,function*(){var e;if(!this._pc)return;let A="";const n=new Map,i=new Map;if((yield this._pc.getStats()).forEach(a=>{switch(a.type){case"transport":A=a.selectedCandidatePairId;break;case"candidate-pair":A===""&&a.selected&&(A=a.id),n.set(a.id,a);break;case"remote-candidate":i.set(a.id,"".concat(a.address,":").concat(a.port));break}}),A==="")return;const s=(e=n.get(A))===null||e===void 0?void 0:e.remoteCandidateId;if(s!==void 0)return i.get(s)})}setMungedSDP(e,A,n){return v(this,void 0,void 0,function*(){if(A){const i=e.sdp;e.sdp=A;try{this.log.debug("setting munged ".concat(n?"remote":"local"," description"),this.logContext),n?yield this.pc.setRemoteDescription(e):yield this.pc.setLocalDescription(e);return}catch(r){this.log.warn("not able to set ".concat(e.type,", falling back to unmodified sdp"),Object.assign(Object.assign({},this.logContext),{error:r,sdp:A})),e.sdp=i}}try{n?yield this.pc.setRemoteDescription(e):yield this.pc.setLocalDescription(e)}catch(i){let r="unknown error";i instanceof Error?r=i.message:typeof i=="string"&&(r=i);const s={error:r,sdp:e.sdp};throw!n&&this.pc.remoteDescription&&(s.remoteSdp=this.pc.remoteDescription),this.log.error("unable to set ".concat(e.type),Object.assign(Object.assign({},this.logContext),{fields:s})),new aa(r)}})}ensureVideoDDExtensionForSVC(e,A){var n,i;if(!((n=e.ext)===null||n===void 0?void 0:n.some(s=>s.uri===wd))){if(this.ddExtID===0){let s=0;A.media.forEach(a=>{var o;a.type==="video"&&((o=a.ext)===null||o===void 0||o.forEach(c=>{c.value>s&&(s=c.value)}))}),this.ddExtID=s+1}(i=e.ext)===null||i===void 0||i.push({value:this.ddExtID,uri:wd})}}}function Kd(t,e,A){let n=0;t.rtp.some(i=>i.codec==="opus"?(n=i.payload,!0):!1),n>0&&(t.rtcpFb||(t.rtcpFb=[]),A.includes(t.mid)&&!t.rtcpFb.some(i=>i.payload===n&&i.type==="nack")&&t.rtcpFb.push({payload:n,type:"nack"}),e.includes(t.mid)&&t.fmtp.some(i=>i.payload===n?(i.config.includes("stereo=1")||(i.config+=";stereo=1"),!0):!1))}function yb(t){var e;const A=[],n=[],i=At.parse((e=t.sdp)!==null&&e!==void 0?e:"");let r=0;return i.media.forEach(s=>{var a;s.type==="audio"&&(s.rtp.some(o=>o.codec==="opus"?(r=o.payload,!0):!1),!((a=s.rtcpFb)===null||a===void 0)&&a.some(o=>o.payload===r&&o.type==="nack")&&n.push(s.mid),s.fmtp.some(o=>o.payload===r?(o.config.includes("sprop-stereo=1")&&A.push(s.mid),!0):!1))}),{stereoMids:A,nackMids:n}}function Vd(t){if(t.connection){const e=t.connection.ip.indexOf(":")>=0;(t.connection.version===4&&e||t.connection.version===6&&!e)&&(t.connection.ip="0.0.0.0",t.connection.version=4)}}const Pa="vp8",Ub={audioPreset:ua.music,dtx:!0,red:!0,forceStereo:!1,simulcast:!0,screenShareEncoding:ha.h1080fps15.encoding,stopMicTrackOnMute:!1,videoCodec:Pa,backupCodec:!0},Gd={deviceId:{ideal:"default"},autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0,voiceIsolation:!0},jd={deviceId:{ideal:"default"},resolution:Sn.h720.resolution},Qb={adaptiveStream:!1,dynacast:!1,stopLocalTrackOnUnpublish:!0,reconnectPolicy:new gw,disconnectOnPageLeave:!0,webAudioMix:!1},Ra={autoSubscribe:!0,maxRetries:1,peerConnectionTimeout:15e3,websocketTimeout:15e3};var ue;(function(t){t[t.NEW=0]="NEW",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED",t[t.FAILED=3]="FAILED",t[t.CLOSING=4]="CLOSING",t[t.CLOSED=5]="CLOSED"})(ue||(ue={}));class Eb{get needsPublisher(){return this.isPublisherConnectionRequired}get needsSubscriber(){return this.isSubscriberConnectionRequired}get currentState(){return this.state}constructor(e,A,n){var i;this.peerConnectionTimeout=Ra.peerConnectionTimeout,this.log=W,this.updateState=()=>{var r;const s=this.state,a=this.requiredTransports.map(o=>o.getConnectionState());a.every(o=>o==="connected")?this.state=ue.CONNECTED:a.some(o=>o==="failed")?this.state=ue.FAILED:a.some(o=>o==="connecting")?this.state=ue.CONNECTING:a.every(o=>o==="closed")?this.state=ue.CLOSED:a.some(o=>o==="closed")?this.state=ue.CLOSING:a.every(o=>o==="new")&&(this.state=ue.NEW),s!==this.state&&(this.log.debug("pc state change: from ".concat(ue[s]," to ").concat(ue[this.state]),this.logContext),(r=this.onStateChange)===null||r===void 0||r.call(this,this.state,this.publisher.getConnectionState(),this.subscriber.getConnectionState()))},this.log=FA((i=n.loggerName)!==null&&i!==void 0?i:lA.PCManager),this.loggerOptions=n,this.isPublisherConnectionRequired=!A,this.isSubscriberConnectionRequired=A,this.publisher=new Nd(e,n),this.subscriber=new Nd(e,n),this.publisher.onConnectionStateChange=this.updateState,this.subscriber.onConnectionStateChange=this.updateState,this.publisher.onIceConnectionStateChange=this.updateState,this.subscriber.onIceConnectionStateChange=this.updateState,this.publisher.onSignalingStatechange=this.updateState,this.subscriber.onSignalingStatechange=this.updateState,this.publisher.onIceCandidate=r=>{var s;(s=this.onIceCandidate)===null||s===void 0||s.call(this,r,cA.PUBLISHER)},this.subscriber.onIceCandidate=r=>{var s;(s=this.onIceCandidate)===null||s===void 0||s.call(this,r,cA.SUBSCRIBER)},this.subscriber.onDataChannel=r=>{var s;(s=this.onDataChannel)===null||s===void 0||s.call(this,r)},this.subscriber.onTrack=r=>{var s;(s=this.onTrack)===null||s===void 0||s.call(this,r)},this.publisher.onOffer=r=>{var s;(s=this.onPublisherOffer)===null||s===void 0||s.call(this,r)},this.state=ue.NEW,this.connectionLock=new Oe,this.remoteOfferLock=new Oe}get logContext(){var e,A;return Object.assign({},(A=(e=this.loggerOptions).loggerContextCb)===null||A===void 0?void 0:A.call(e))}requirePublisher(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.isPublisherConnectionRequired=e,this.updateState()}requireSubscriber(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.isSubscriberConnectionRequired=e,this.updateState()}createAndSendPublisherOffer(e){return this.publisher.createAndSendOffer(e)}setPublisherAnswer(e){return this.publisher.setRemoteDescription(e)}removeTrack(e){return this.publisher.removeTrack(e)}close(){return v(this,void 0,void 0,function*(){if(this.publisher&&this.publisher.getSignallingState()!=="closed"){const e=this.publisher;for(const A of e.getSenders())try{e.canRemoveTrack()&&e.removeTrack(A)}catch(n){this.log.warn("could not removeTrack",Object.assign(Object.assign({},this.logContext),{error:n}))}}yield Promise.all([this.publisher.close(),this.subscriber.close()]),this.updateState()})}triggerIceRestart(){return v(this,void 0,void 0,function*(){this.subscriber.restartingIce=!0,this.needsPublisher&&(yield this.createAndSendPublisherOffer({iceRestart:!0}))})}addIceCandidate(e,A){return v(this,void 0,void 0,function*(){A===cA.PUBLISHER?yield this.publisher.addIceCandidate(e):yield this.subscriber.addIceCandidate(e)})}createSubscriberAnswerFromOffer(e){return v(this,void 0,void 0,function*(){this.log.debug("received server offer",Object.assign(Object.assign({},this.logContext),{RTCSdpType:e.type,sdp:e.sdp,signalingState:this.subscriber.getSignallingState().toString()}));const A=yield this.remoteOfferLock.lock();try{return yield this.subscriber.setRemoteDescription(e),yield this.subscriber.createAndSetAnswer()}finally{A()}})}updateConfiguration(e,A){this.publisher.setConfiguration(e),this.subscriber.setConfiguration(e),A&&this.triggerIceRestart()}ensurePCTransportConnection(e,A){return v(this,void 0,void 0,function*(){var n;const i=yield this.connectionLock.lock();try{this.isPublisherConnectionRequired&&this.publisher.getConnectionState()!=="connected"&&this.publisher.getConnectionState()!=="connecting"&&(this.log.debug("negotiation required, start negotiating",this.logContext),this.publisher.negotiate()),yield Promise.all((n=this.requiredTransports)===null||n===void 0?void 0:n.map(r=>this.ensureTransportConnected(r,e,A)))}finally{i()}})}negotiate(e){return v(this,void 0,void 0,function*(){return new Promise((A,n)=>v(this,void 0,void 0,function*(){const i=setTimeout(()=>{n("negotiation timed out")},this.peerConnectionTimeout),r=()=>{clearTimeout(i),n("negotiation aborted")};e.signal.addEventListener("abort",r),this.publisher.once(Jt.NegotiationStarted,()=>{e.signal.aborted||this.publisher.once(Jt.NegotiationComplete,()=>{clearTimeout(i),A()})}),yield this.publisher.negotiate(s=>{clearTimeout(i),n(s)})}))})}addPublisherTransceiver(e,A){return this.publisher.addTransceiver(e,A)}addPublisherTrack(e){return this.publisher.addTrack(e)}createPublisherDataChannel(e,A){return this.publisher.createDataChannel(e,A)}getConnectedAddress(e){return e===cA.PUBLISHER?this.publisher.getConnectedAddress():e===cA.SUBSCRIBER?this.publisher.getConnectedAddress():this.requiredTransports[0].getConnectedAddress()}get requiredTransports(){const e=[];return this.isPublisherConnectionRequired&&e.push(this.publisher),this.isSubscriberConnectionRequired&&e.push(this.subscriber),e}ensureTransportConnected(e,A){return v(this,arguments,void 0,function(n,i){var r=this;let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.peerConnectionTimeout;return function*(){if(n.getConnectionState()!=="connected")return new Promise((o,c)=>v(r,void 0,void 0,function*(){const l=()=>{this.log.warn("abort transport connection",this.logContext),Te.clearTimeout(u),c(new Ae("room connection has been cancelled",J.Cancelled))};i!=null&&i.signal.aborted&&l(),i==null||i.signal.addEventListener("abort",l);const u=Te.setTimeout(()=>{i==null||i.signal.removeEventListener("abort",l),c(new Ae("could not establish pc connection",J.InternalError))},s);for(;this.state!==ue.CONNECTED;)if(yield Ke(50),i!=null&&i.signal.aborted){c(new Ae("room connection has been cancelled",J.Cancelled));return}Te.clearTimeout(u),i==null||i.signal.removeEventListener("abort",l),o()}))}()})}}class de extends Error{constructor(e,A,n){super(A),this.code=e,this.message=Jd(A,de.MAX_MESSAGE_BYTES),this.data=n?Jd(n,de.MAX_DATA_BYTES):void 0}static fromProto(e){return new de(e.code,e.message,e.data)}toProto(){return new ou({code:this.code,message:this.message,data:this.data})}static builtIn(e,A){return new de(de.ErrorCode[e],de.ErrorMessage[e],A)}}de.MAX_MESSAGE_BYTES=256,de.MAX_DATA_BYTES=15360,de.ErrorCode={APPLICATION_ERROR:1500,CONNECTION_TIMEOUT:1501,RESPONSE_TIMEOUT:1502,RECIPIENT_DISCONNECTED:1503,RESPONSE_PAYLOAD_TOO_LARGE:1504,SEND_FAILED:1505,UNSUPPORTED_METHOD:1400,RECIPIENT_NOT_FOUND:1401,REQUEST_PAYLOAD_TOO_LARGE:1402,UNSUPPORTED_SERVER:1403,UNSUPPORTED_VERSION:1404},de.ErrorMessage={APPLICATION_ERROR:"Application error in method handler",CONNECTION_TIMEOUT:"Connection timeout",RESPONSE_TIMEOUT:"Response timeout",RECIPIENT_DISCONNECTED:"Recipient disconnected",RESPONSE_PAYLOAD_TOO_LARGE:"Response payload too large",SEND_FAILED:"Failed to send",UNSUPPORTED_METHOD:"Method not supported at destination",RECIPIENT_NOT_FOUND:"Recipient not found",REQUEST_PAYLOAD_TOO_LARGE:"Request payload too large",UNSUPPORTED_SERVER:"RPC not supported by server",UNSUPPORTED_VERSION:"Unsupported RPC version"};const Wd=15360;function La(t){return new TextEncoder().encode(t).length}function Jd(t,e){if(La(t)<=e)return t;let A=0,n=t.length;const i=new TextEncoder;for(;A<n;){const r=Math.floor((A+n+1)/2);i.encode(t.slice(0,r)).length<=e?A=r:n=r-1}return t.slice(0,A)}const Da=2e3;function ur(t,e){if(!e)return 0;let A,n;return"bytesReceived"in t?(A=t.bytesReceived,n=e.bytesReceived):"bytesSent"in t&&(A=t.bytesSent,n=e.bytesSent),A===void 0||n===void 0||t.timestamp===void 0||e.timestamp===void 0?0:(A-n)*8*1e3/(t.timestamp-e.timestamp)}const Sb=1e3;class Xd extends T{get sender(){return this._sender}set sender(e){this._sender=e}get constraints(){return this._constraints}constructor(e,A,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,r=arguments.length>4?arguments[4]:void 0;super(e,A,r),this.manuallyStopped=!1,this._isUpstreamPaused=!1,this.handleTrackMuteEvent=()=>this.debouncedTrackMuteHandler().catch(()=>this.log.debug("track mute bounce got cancelled by an unmute event",this.logContext)),this.debouncedTrackMuteHandler=_a(()=>v(this,void 0,void 0,function*(){yield this.pauseUpstream()}),5e3),this.handleTrackUnmuteEvent=()=>v(this,void 0,void 0,function*(){this.debouncedTrackMuteHandler.cancel("unmute"),yield this.resumeUpstream()}),this.handleEnded=()=>{this.isInBackground&&(this.reacquireTrack=!0),this._mediaStreamTrack.removeEventListener("mute",this.handleTrackMuteEvent),this._mediaStreamTrack.removeEventListener("unmute",this.handleTrackUnmuteEvent),this.emit(_.Ended,this)},this.reacquireTrack=!1,this.providedByUser=i,this.muteLock=new Oe,this.pauseUpstreamLock=new Oe,this.processorLock=new Oe,this.restartLock=new Oe,this.setMediaStreamTrack(e,!0),this._constraints=e.getConstraints(),n&&(this._constraints=n)}get id(){return this._mediaStreamTrack.id}get dimensions(){if(this.kind!==T.Kind.Video)return;const{width:e,height:A}=this._mediaStreamTrack.getSettings();if(e&&A)return{width:e,height:A}}get isUpstreamPaused(){return this._isUpstreamPaused}get isUserProvided(){return this.providedByUser}get mediaStreamTrack(){var e,A;return(A=(e=this.processor)===null||e===void 0?void 0:e.processedTrack)!==null&&A!==void 0?A:this._mediaStreamTrack}get isLocal(){return!0}getSourceTrackSettings(){return this._mediaStreamTrack.getSettings()}setMediaStreamTrack(e,A){return v(this,void 0,void 0,function*(){var n;if(e===this._mediaStreamTrack&&!A)return;this._mediaStreamTrack&&(this.attachedElements.forEach(r=>{Vt(this._mediaStreamTrack,r)}),this.debouncedTrackMuteHandler.cancel("new-track"),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.removeEventListener("mute",this.handleTrackMuteEvent),this._mediaStreamTrack.removeEventListener("unmute",this.handleTrackUnmuteEvent)),this.mediaStream=new MediaStream([e]),e&&(e.addEventListener("ended",this.handleEnded),e.addEventListener("mute",this.handleTrackMuteEvent),e.addEventListener("unmute",this.handleTrackUnmuteEvent),this._constraints=e.getConstraints());let i;if(this.processor&&e){const r=yield this.processorLock.lock();try{if(this.log.debug("restarting processor",this.logContext),this.kind==="unknown")throw TypeError("cannot set processor on track of unknown kind");this.processorElement&&(Kt(e,this.processorElement),this.processorElement.muted=!0),yield this.processor.restart({track:e,kind:this.kind,element:this.processorElement}),i=this.processor.processedTrack}finally{r()}}this.sender&&((n=this.sender.transport)===null||n===void 0?void 0:n.state)!=="closed"&&(yield this.sender.replaceTrack(i??e)),!this.providedByUser&&this._mediaStreamTrack!==e&&this._mediaStreamTrack.stop(),this._mediaStreamTrack=e,e&&(this._mediaStreamTrack.enabled=!this.isMuted,yield this.resumeUpstream(),this.attachedElements.forEach(r=>{Kt(i??e,r)}))})}waitForDimensions(){return v(this,arguments,void 0,function(){var e=this;let A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Sb;return function*(){var n;if(e.kind===T.Kind.Audio)throw new Error("cannot get dimensions for audio tracks");((n=uA())===null||n===void 0?void 0:n.os)==="iOS"&&(yield Ke(10));const i=Date.now();for(;Date.now()-i<A;){const r=e.dimensions;if(r)return r;yield Ke(50)}throw new IA("unable to get track dimensions after timeout")}()})}setDeviceId(e){return v(this,void 0,void 0,function*(){return this._constraints.deviceId===e&&this._mediaStreamTrack.getSettings().deviceId===$A(e)||(this._constraints.deviceId=e,this.isMuted)?!0:(yield this.restartTrack(),$A(e)===this._mediaStreamTrack.getSettings().deviceId)})}getDeviceId(){return v(this,arguments,void 0,function(){var e=this;let A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return function*(){if(e.source===T.Source.ScreenShare)return;const{deviceId:n,groupId:i}=e._mediaStreamTrack.getSettings(),r=e.kind===T.Kind.Audio?"audioinput":"videoinput";return A?Qe.getInstance().normalizeDeviceId(r,n,i):n}()})}mute(){return v(this,void 0,void 0,function*(){return this.setTrackMuted(!0),this})}unmute(){return v(this,void 0,void 0,function*(){return this.setTrackMuted(!1),this})}replaceTrack(e,A){return v(this,void 0,void 0,function*(){if(!this.sender)throw new IA("unable to replace an unpublished track");let n,i;return typeof A=="boolean"?n=A:A!==void 0&&(n=A.userProvidedTrack,i=A.stopProcessor),this.providedByUser=n??!0,this.log.debug("replace MediaStreamTrack",this.logContext),yield this.setMediaStreamTrack(e),i&&this.processor&&(yield this.stopProcessor()),this})}restart(e){return v(this,void 0,void 0,function*(){this.manuallyStopped=!1;const A=yield this.restartLock.lock();try{e||(e=this._constraints);const{deviceId:n,facingMode:i}=e,r=pw(e,["deviceId","facingMode"]);this.log.debug("restarting track with constraints",Object.assign(Object.assign({},this.logContext),{constraints:e}));const s={audio:!1,video:!1};this.kind===T.Kind.Video?s.video=n||i?{deviceId:n,facingMode:i}:!0:s.audio=n?{deviceId:n}:!0,this.attachedElements.forEach(c=>{Vt(this.mediaStreamTrack,c)}),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.stop();const o=(yield navigator.mediaDevices.getUserMedia(s)).getTracks()[0];return yield o.applyConstraints(r),o.addEventListener("ended",this.handleEnded),this.log.debug("re-acquired MediaStreamTrack",this.logContext),yield this.setMediaStreamTrack(o),this._constraints=e,this.emit(_.Restarted,this),this.manuallyStopped&&(this.log.warn("track was stopped during a restart, stopping restarted track",this.logContext),this.stop()),this}finally{A()}})}setTrackMuted(e){this.log.debug("setting ".concat(this.kind," track ").concat(e?"muted":"unmuted"),this.logContext),!(this.isMuted===e&&this._mediaStreamTrack.enabled!==e)&&(this.isMuted=e,this._mediaStreamTrack.enabled=!e,this.emit(e?_.Muted:_.Unmuted,this))}get needsReAcquisition(){return this._mediaStreamTrack.readyState!=="live"||this._mediaStreamTrack.muted||!this._mediaStreamTrack.enabled||this.reacquireTrack}handleAppVisibilityChanged(){const e=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return v(this,void 0,void 0,function*(){yield e.handleAppVisibilityChanged.call(this),bd()&&(this.log.debug("visibility changed, is in Background: ".concat(this.isInBackground),this.logContext),!this.isInBackground&&this.needsReAcquisition&&!this.isUserProvided&&!this.isMuted&&(this.log.debug("track needs to be reacquired, restarting ".concat(this.source),this.logContext),yield this.restart(),this.reacquireTrack=!1))})}stop(){var e;this.manuallyStopped=!0,super.stop(),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.removeEventListener("mute",this.handleTrackMuteEvent),this._mediaStreamTrack.removeEventListener("unmute",this.handleTrackUnmuteEvent),(e=this.processor)===null||e===void 0||e.destroy(),this.processor=void 0}pauseUpstream(){return v(this,void 0,void 0,function*(){var e;const A=yield this.pauseUpstreamLock.lock();try{if(this._isUpstreamPaused===!0)return;if(!this.sender){this.log.warn("unable to pause upstream for an unpublished track",this.logContext);return}this._isUpstreamPaused=!0,this.emit(_.UpstreamPaused,this);const n=uA();if((n==null?void 0:n.name)==="Safari"&&mt(n.version,"12.0")<0)throw new sa("pauseUpstream is not supported on Safari < 12.");((e=this.sender.transport)===null||e===void 0?void 0:e.state)!=="closed"&&(yield this.sender.replaceTrack(null))}finally{A()}})}resumeUpstream(){return v(this,void 0,void 0,function*(){var e;const A=yield this.pauseUpstreamLock.lock();try{if(this._isUpstreamPaused===!1)return;if(!this.sender){this.log.warn("unable to resume upstream for an unpublished track",this.logContext);return}this._isUpstreamPaused=!1,this.emit(_.UpstreamResumed,this),((e=this.sender.transport)===null||e===void 0?void 0:e.state)!=="closed"&&(yield this.sender.replaceTrack(this.mediaStreamTrack))}finally{A()}})}getRTCStatsReport(){return v(this,void 0,void 0,function*(){var e;return!((e=this.sender)===null||e===void 0)&&e.getStats?yield this.sender.getStats():void 0})}setProcessor(e){return v(this,arguments,void 0,function(A){var n=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return function*(){var r;const s=yield n.processorLock.lock();try{n.log.debug("setting up processor",n.logContext);const a=document.createElement(n.kind),o={kind:n.kind,track:n._mediaStreamTrack,element:a,audioContext:n.audioContext};if(yield A.init(o),n.log.debug("processor initialized",n.logContext),n.processor&&(yield n.stopProcessor()),n.kind==="unknown")throw TypeError("cannot set processor on track of unknown kind");if(Kt(n._mediaStreamTrack,a),a.muted=!0,a.play().catch(c=>n.log.error("failed to play processor element",Object.assign(Object.assign({},n.logContext),{error:c}))),n.processor=A,n.processorElement=a,n.processor.processedTrack){for(const c of n.attachedElements)c!==n.processorElement&&i&&(Vt(n._mediaStreamTrack,c),Kt(n.processor.processedTrack,c));yield(r=n.sender)===null||r===void 0?void 0:r.replaceTrack(n.processor.processedTrack)}n.emit(_.TrackProcessorUpdate,n.processor)}finally{s()}}()})}getProcessor(){return this.processor}stopProcessor(){return v(this,arguments,void 0,function(){var e=this;let A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return function*(){var n,i;e.processor&&(e.log.debug("stopping processor",e.logContext),(n=e.processor.processedTrack)===null||n===void 0||n.stop(),yield e.processor.destroy(),e.processor=void 0,A||((i=e.processorElement)===null||i===void 0||i.remove(),e.processorElement=void 0),yield e._mediaStreamTrack.applyConstraints(e._constraints),yield e.setMediaStreamTrack(e._mediaStreamTrack,!0),e.emit(_.TrackProcessorUpdate))}()})}}class dr extends Xd{get enhancedNoiseCancellation(){return this.isKrispNoiseFilterEnabled}constructor(e,A){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0;super(e,T.Kind.Audio,A,n,r),this.stopOnMute=!1,this.isKrispNoiseFilterEnabled=!1,this.monitorSender=()=>v(this,void 0,void 0,function*(){if(!this.sender){this._currentBitrate=0;return}let s;try{s=yield this.getSenderStats()}catch(a){this.log.error("could not get audio sender stats",Object.assign(Object.assign({},this.logContext),{error:a}));return}s&&this.prevStats&&(this._currentBitrate=ur(s,this.prevStats)),this.prevStats=s}),this.handleKrispNoiseFilterEnable=()=>{this.isKrispNoiseFilterEnabled=!0,this.log.debug("Krisp noise filter enabled",this.logContext),this.emit(_.AudioTrackFeatureUpdate,this,oA.TF_ENHANCED_NOISE_CANCELLATION,!0)},this.handleKrispNoiseFilterDisable=()=>{this.isKrispNoiseFilterEnabled=!1,this.log.debug("Krisp noise filter disabled",this.logContext),this.emit(_.AudioTrackFeatureUpdate,this,oA.TF_ENHANCED_NOISE_CANCELLATION,!1)},this.audioContext=i,this.checkForSilence()}mute(){const e=Object.create(null,{mute:{get:()=>super.mute}});return v(this,void 0,void 0,function*(){const A=yield this.muteLock.lock();try{return this.isMuted?(this.log.debug("Track already muted",this.logContext),this):(this.source===T.Source.Microphone&&this.stopOnMute&&!this.isUserProvided&&(this.log.debug("stopping mic track",this.logContext),this._mediaStreamTrack.stop()),yield e.mute.call(this),this)}finally{A()}})}unmute(){const e=Object.create(null,{unmute:{get:()=>super.unmute}});return v(this,void 0,void 0,function*(){const A=yield this.muteLock.lock();try{if(!this.isMuted)return this.log.debug("Track already unmuted",this.logContext),this;const n=this._constraints.deviceId&&this._mediaStreamTrack.getSettings().deviceId!==$A(this._constraints.deviceId);return this.source===T.Source.Microphone&&(this.stopOnMute||this._mediaStreamTrack.readyState==="ended"||n)&&!this.isUserProvided&&(this.log.debug("reacquiring mic track",this.logContext),yield this.restartTrack()),yield e.unmute.call(this),this}finally{A()}})}restartTrack(e){return v(this,void 0,void 0,function*(){let A;if(e){const n=Ea({audio:e});typeof n.audio!="boolean"&&(A=n.audio)}yield this.restart(A)})}restart(e){const A=Object.create(null,{restart:{get:()=>super.restart}});return v(this,void 0,void 0,function*(){const n=yield A.restart.call(this,e);return this.checkForSilence(),n})}startMonitor(){Ve()&&(this.monitorInterval||(this.monitorInterval=setInterval(()=>{this.monitorSender()},Da)))}setProcessor(e){return v(this,void 0,void 0,function*(){var A;const n=yield this.processorLock.lock();try{if(!UA()&&!this.audioContext)throw Error("Audio context needs to be set on LocalAudioTrack in order to enable processors");this.processor&&(yield this.stopProcessor());const i={kind:this.kind,track:this._mediaStreamTrack,audioContext:this.audioContext};this.log.debug("setting up audio processor ".concat(e.name),this.logContext),yield e.init(i),this.processor=e,this.processor.processedTrack&&(yield(A=this.sender)===null||A===void 0?void 0:A.replaceTrack(this.processor.processedTrack),this.processor.processedTrack.addEventListener("enable-lk-krisp-noise-filter",this.handleKrispNoiseFilterEnable),this.processor.processedTrack.addEventListener("disable-lk-krisp-noise-filter",this.handleKrispNoiseFilterDisable)),this.emit(_.TrackProcessorUpdate,this.processor)}finally{n()}})}setAudioContext(e){this.audioContext=e}getSenderStats(){return v(this,void 0,void 0,function*(){var e;if(!(!((e=this.sender)===null||e===void 0)&&e.getStats))return;const A=yield this.sender.getStats();let n;return A.forEach(i=>{i.type==="outbound-rtp"&&(n={type:"audio",streamId:i.id,packetsSent:i.packetsSent,packetsLost:i.packetsLost,bytesSent:i.bytesSent,timestamp:i.timestamp,roundTripTime:i.roundTripTime,jitter:i.jitter})}),n})}checkForSilence(){return v(this,void 0,void 0,function*(){const e=yield Id(this);return e&&(this.isMuted||this.log.warn("silence detected on local audio track",this.logContext),this.emit(_.AudioSilenceDetected)),e})}}function kb(t,e,A){switch(t.kind){case"audio":return new dr(t,e,!1,void 0,A);case"video":return new fr(t,e,!1,A);default:throw new IA("unsupported track type: ".concat(t.kind))}}const Tb=Object.values(Sn),Fb=Object.values(da),Ib=Object.values(ha),xb=[Sn.h180,Sn.h360],_b=[da.h180,da.h360],Pb=t=>[{scaleResolutionDownBy:2,fps:t.encoding.maxFramerate}].map(A=>{var n,i;return new ee(Math.floor(t.width/A.scaleResolutionDownBy),Math.floor(t.height/A.scaleResolutionDownBy),Math.max(15e4,Math.floor(t.encoding.maxBitrate/(Math.pow(A.scaleResolutionDownBy,2)*(((n=t.encoding.maxFramerate)!==null&&n!==void 0?n:30)/((i=A.fps)!==null&&i!==void 0?i:30))))),A.fps,t.encoding.priority)}),Ha=["q","h","f"];function Oa(t,e,A,n){var i,r;let s=n==null?void 0:n.videoEncoding;t&&(s=n==null?void 0:n.screenShareEncoding);const a=n==null?void 0:n.simulcast,o=n==null?void 0:n.scalabilityMode,c=n==null?void 0:n.videoCodec;if(!s&&!a&&!o||!e||!A)return[{}];s||(s=Lb(t,e,A,c),W.debug("using video encoding",s));const l=s.maxFramerate,u=new ee(e,A,s.maxBitrate,s.maxFramerate,s.priority);if(o&&kn(c)){const g=new hr(o),f=[];if(g.spatial>3)throw new Error("unsupported scalabilityMode: ".concat(o));const m=uA();if(ZA()||UA()||(m==null?void 0:m.name)==="Chrome"&&mt(m==null?void 0:m.version,"113")<0){const B=g.suffix=="h"?2:3;for(let b=0;b<g.spatial;b+=1)f.push({rid:Ha[2-b],maxBitrate:s.maxBitrate/Math.pow(B,b),maxFramerate:u.encoding.maxFramerate});f[0].scalabilityMode=o}else f.push({maxBitrate:s.maxBitrate,maxFramerate:u.encoding.maxFramerate,scalabilityMode:o});return u.encoding.priority&&(f[0].priority=u.encoding.priority,f[0].networkPriority=u.encoding.priority),W.debug("using svc encoding",{encodings:f}),f}if(!a)return[s];let d=[];t?d=(i=Yd(n==null?void 0:n.screenShareSimulcastLayers))!==null&&i!==void 0?i:qd(t,u):d=(r=Yd(n==null?void 0:n.videoSimulcastLayers))!==null&&r!==void 0?r:qd(t,u);let h;if(d.length>0){const g=d[0];d.length>1&&([,h]=d);const f=Math.max(e,A);if(f>=960&&h)return Ma(e,A,[g,h,u],l);if(f>=480)return Ma(e,A,[g,u],l)}return Ma(e,A,[u])}function Rb(t,e,A){var n,i,r,s;if(!A.backupCodec||A.backupCodec===!0||A.backupCodec.codec===A.videoCodec)return;e!==A.backupCodec.codec&&W.warn("requested a different codec than specified as backup",{serverRequested:e,backup:A.backupCodec.codec}),A.videoCodec=e,A.videoEncoding=A.backupCodec.encoding;const a=t.mediaStreamTrack.getSettings(),o=(n=a.width)!==null&&n!==void 0?n:(i=t.dimensions)===null||i===void 0?void 0:i.width,c=(r=a.height)!==null&&r!==void 0?r:(s=t.dimensions)===null||s===void 0?void 0:s.height;return t.source===T.Source.ScreenShare&&A.simulcast&&(A.simulcast=!1),Oa(t.source===T.Source.ScreenShare,o,c,A)}function Lb(t,e,A,n){const i=Db(t,e,A);let{encoding:r}=i[0];const s=Math.max(e,A);for(let a=0;a<i.length;a+=1){const o=i[a];if(r=o.encoding,o.width>=s)break}if(n)switch(n){case"av1":r=Object.assign({},r),r.maxBitrate=r.maxBitrate*.7;break;case"vp9":r=Object.assign({},r),r.maxBitrate=r.maxBitrate*.85;break}return r}function Db(t,e,A){if(t)return Ib;const n=e>A?e/A:A/e;return Math.abs(n-16/9)<Math.abs(n-4/3)?Tb:Fb}function qd(t,e){if(t)return Pb(e);const{width:A,height:n}=e,i=A>n?A/n:n/A;return Math.abs(i-16/9)<Math.abs(i-4/3)?xb:_b}function Ma(t,e,A,n){const i=[];if(A.forEach((r,s)=>{if(s>=Ha.length)return;const a=Math.min(t,e),c={rid:Ha[s],scaleResolutionDownBy:Math.max(1,a/Math.min(r.width,r.height)),maxBitrate:r.encoding.maxBitrate},l=n&&r.encoding.maxFramerate?Math.min(n,r.encoding.maxFramerate):r.encoding.maxFramerate;l&&(c.maxFramerate=l);const u=Gt()||s===0;r.encoding.priority&&u&&(c.priority=r.encoding.priority,c.networkPriority=r.encoding.priority),i.push(c)}),UA()&&Ud()==="ios"){let r;i.forEach(a=>{r?a.maxFramerate&&a.maxFramerate>r&&(r=a.maxFramerate):r=a.maxFramerate});let s=!0;i.forEach(a=>{var o;a.maxFramerate!=r&&(s&&(s=!1,W.info("Simulcast on iOS React-Native requires all encodings to share the same framerate.")),W.info('Setting framerate of encoding "'.concat((o=a.rid)!==null&&o!==void 0?o:"",'" to ').concat(r)),a.maxFramerate=r)})}return i}function Yd(t){if(t)return t.sort((e,A)=>{const{encoding:n}=e,{encoding:i}=A;return n.maxBitrate>i.maxBitrate?1:n.maxBitrate<i.maxBitrate?-1:n.maxBitrate===i.maxBitrate&&n.maxFramerate&&i.maxFramerate?n.maxFramerate>i.maxFramerate?1:-1:0})}class hr{constructor(e){const A=e.match(/^L(\d)T(\d)(h|_KEY|_KEY_SHIFT){0,1}$/);if(!A)throw new Error("invalid scalability mode");if(this.spatial=parseInt(A[1]),this.temporal=parseInt(A[2]),A.length>3)switch(A[3]){case"h":case"_KEY":case"_KEY_SHIFT":this.suffix=A[3]}}toString(){var e;return"L".concat(this.spatial,"T").concat(this.temporal).concat((e=this.suffix)!==null&&e!==void 0?e:"")}}function Hb(t){return t.source===T.Source.ScreenShare||t.constraints.height&&$A(t.constraints.height)>=1080?"maintain-resolution":"balanced"}const Ob=5e3;class fr extends Xd{get sender(){return this._sender}set sender(e){this._sender=e,this.degradationPreference&&this.setDegradationPreference(this.degradationPreference)}constructor(e,A){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3?arguments[3]:void 0;super(e,T.Kind.Video,A,n,i),this.simulcastCodecs=new Map,this.degradationPreference="balanced",this.monitorSender=()=>v(this,void 0,void 0,function*(){if(!this.sender){this._currentBitrate=0;return}let r;try{r=yield this.getSenderStats()}catch(a){this.log.error("could not get audio sender stats",Object.assign(Object.assign({},this.logContext),{error:a}));return}const s=new Map(r.map(a=>[a.rid,a]));if(this.prevStats){let a=0;s.forEach((o,c)=>{var l;const u=(l=this.prevStats)===null||l===void 0?void 0:l.get(c);a+=ur(o,u)}),this._currentBitrate=a}this.prevStats=s}),this.senderLock=new Oe}get isSimulcast(){return!!(this.sender&&this.sender.getParameters().encodings.length>1)}startMonitor(e){var A;if(this.signalClient=e,!Ve())return;const n=(A=this.sender)===null||A===void 0?void 0:A.getParameters();n&&(this.encodings=n.encodings),!this.monitorInterval&&(this.monitorInterval=setInterval(()=>{this.monitorSender()},Da))}stop(){this._mediaStreamTrack.getConstraints(),this.simulcastCodecs.forEach(e=>{e.mediaStreamTrack.stop()}),super.stop()}pauseUpstream(){const e=Object.create(null,{pauseUpstream:{get:()=>super.pauseUpstream}});return v(this,void 0,void 0,function*(){var A,n,i,r,s;yield e.pauseUpstream.call(this);try{for(var a=!0,o=XA(this.simulcastCodecs.values()),c;c=yield o.next(),A=c.done,!A;a=!0)r=c.value,a=!1,yield(s=r.sender)===null||s===void 0?void 0:s.replaceTrack(null)}catch(l){n={error:l}}finally{try{!a&&!A&&(i=o.return)&&(yield i.call(o))}finally{if(n)throw n.error}}})}resumeUpstream(){const e=Object.create(null,{resumeUpstream:{get:()=>super.resumeUpstream}});return v(this,void 0,void 0,function*(){var A,n,i,r,s;yield e.resumeUpstream.call(this);try{for(var a=!0,o=XA(this.simulcastCodecs.values()),c;c=yield o.next(),A=c.done,!A;a=!0){r=c.value,a=!1;const l=r;yield(s=l.sender)===null||s===void 0?void 0:s.replaceTrack(l.mediaStreamTrack)}}catch(l){n={error:l}}finally{try{!a&&!A&&(i=o.return)&&(yield i.call(o))}finally{if(n)throw n.error}}})}mute(){const e=Object.create(null,{mute:{get:()=>super.mute}});return v(this,void 0,void 0,function*(){const A=yield this.muteLock.lock();try{return this.isMuted?(this.log.debug("Track already muted",this.logContext),this):(this.source===T.Source.Camera&&!this.isUserProvided&&(this.log.debug("stopping camera track",this.logContext),this._mediaStreamTrack.stop()),yield e.mute.call(this),this)}finally{A()}})}unmute(){const e=Object.create(null,{unmute:{get:()=>super.unmute}});return v(this,void 0,void 0,function*(){const A=yield this.muteLock.lock();try{return this.isMuted?(this.source===T.Source.Camera&&!this.isUserProvided&&(this.log.debug("reacquiring camera track",this.logContext),yield this.restartTrack()),yield e.unmute.call(this),this):(this.log.debug("Track already unmuted",this.logContext),this)}finally{A()}})}setTrackMuted(e){super.setTrackMuted(e);for(const A of this.simulcastCodecs.values())A.mediaStreamTrack.enabled=!e}getSenderStats(){return v(this,void 0,void 0,function*(){var e;if(!(!((e=this.sender)===null||e===void 0)&&e.getStats))return[];const A=[],n=yield this.sender.getStats();return n.forEach(i=>{var r;if(i.type==="outbound-rtp"){const s={type:"video",streamId:i.id,frameHeight:i.frameHeight,frameWidth:i.frameWidth,framesPerSecond:i.framesPerSecond,framesSent:i.framesSent,firCount:i.firCount,pliCount:i.pliCount,nackCount:i.nackCount,packetsSent:i.packetsSent,bytesSent:i.bytesSent,qualityLimitationReason:i.qualityLimitationReason,qualityLimitationDurations:i.qualityLimitationDurations,qualityLimitationResolutionChanges:i.qualityLimitationResolutionChanges,rid:(r=i.rid)!==null&&r!==void 0?r:i.id,retransmittedPacketsSent:i.retransmittedPacketsSent,targetBitrate:i.targetBitrate,timestamp:i.timestamp},a=n.get(i.remoteId);a&&(s.jitter=a.jitter,s.packetsLost=a.packetsLost,s.roundTripTime=a.roundTripTime),A.push(s)}}),A.sort((i,r)=>{var s,a;return((s=r.frameWidth)!==null&&s!==void 0?s:0)-((a=i.frameWidth)!==null&&a!==void 0?a:0)}),A})}setPublishingQuality(e){const A=[];for(let n=AA.LOW;n<=AA.HIGH;n+=1)A.push(new Xs({quality:n,enabled:n<=e}));this.log.debug("setting publishing quality. max quality ".concat(e),this.logContext),this.setPublishingLayers(A)}restartTrack(e){return v(this,void 0,void 0,function*(){var A,n,i,r,s;let a;if(e){const u=Ea({video:e});typeof u.video!="boolean"&&(a=u.video)}yield this.restart(a);try{for(var o=!0,c=XA(this.simulcastCodecs.values()),l;l=yield c.next(),A=l.done,!A;o=!0){r=l.value,o=!1;const u=r;u.sender&&((s=u.sender.transport)===null||s===void 0?void 0:s.state)!=="closed"&&(u.mediaStreamTrack=this.mediaStreamTrack.clone(),yield u.sender.replaceTrack(u.mediaStreamTrack))}}catch(u){n={error:u}}finally{try{!o&&!A&&(i=c.return)&&(yield i.call(c))}finally{if(n)throw n.error}}})}setProcessor(e){const A=Object.create(null,{setProcessor:{get:()=>super.setProcessor}});return v(this,arguments,void 0,function(n){var i=this;let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return function*(){var s,a,o,c,l,u;if(yield A.setProcessor.call(i,n,r),!((l=i.processor)===null||l===void 0)&&l.processedTrack)try{for(var d=!0,h=XA(i.simulcastCodecs.values()),g;g=yield h.next(),s=g.done,!s;d=!0)c=g.value,d=!1,yield(u=c.sender)===null||u===void 0?void 0:u.replaceTrack(i.processor.processedTrack)}catch(f){a={error:f}}finally{try{!d&&!s&&(o=h.return)&&(yield o.call(h))}finally{if(a)throw a.error}}}()})}setDegradationPreference(e){return v(this,void 0,void 0,function*(){if(this.degradationPreference=e,this.sender)try{this.log.debug("setting degradationPreference to ".concat(e),this.logContext);const A=this.sender.getParameters();A.degradationPreference=e,this.sender.setParameters(A)}catch(A){this.log.warn("failed to set degradationPreference",Object.assign({error:A},this.logContext))}})}addSimulcastTrack(e,A){if(this.simulcastCodecs.has(e)){this.log.error("".concat(e," already added, skipping adding simulcast codec"),this.logContext);return}const n={codec:e,mediaStreamTrack:this.mediaStreamTrack.clone(),sender:void 0,encodings:A};return this.simulcastCodecs.set(e,n),n}setSimulcastTrackSender(e,A){const n=this.simulcastCodecs.get(e);n&&(n.sender=A,setTimeout(()=>{this.subscribedCodecs&&this.setPublishingCodecs(this.subscribedCodecs)},Ob))}setPublishingCodecs(e){return v(this,void 0,void 0,function*(){var A,n,i,r,s,a,o;if(this.log.debug("setting publishing codecs",Object.assign(Object.assign({},this.logContext),{codecs:e,currentCodec:this.codec})),!this.codec&&e.length>0)return yield this.setPublishingLayers(e[0].qualities),[];this.subscribedCodecs=e;const c=[];try{for(A=!0,n=XA(e);i=yield n.next(),r=i.done,!r;A=!0){o=i.value,A=!1;const l=o;if(!this.codec||this.codec===l.codec)yield this.setPublishingLayers(l.qualities);else{const u=this.simulcastCodecs.get(l.codec);if(this.log.debug("try setPublishingCodec for ".concat(l.codec),Object.assign(Object.assign({},this.logContext),{simulcastCodecInfo:u})),!u||!u.sender){for(const d of l.qualities)if(d.enabled){c.push(l.codec);break}}else u.encodings&&(this.log.debug("try setPublishingLayersForSender ".concat(l.codec),this.logContext),yield zd(u.sender,u.encodings,l.qualities,this.senderLock,this.log,this.logContext))}}}catch(l){s={error:l}}finally{try{!A&&!r&&(a=n.return)&&(yield a.call(n))}finally{if(s)throw s.error}}return c})}setPublishingLayers(e){return v(this,void 0,void 0,function*(){this.log.debug("setting publishing layers",Object.assign(Object.assign({},this.logContext),{qualities:e})),!(!this.sender||!this.encodings)&&(yield zd(this.sender,this.encodings,e,this.senderLock,this.log,this.logContext))})}handleAppVisibilityChanged(){const e=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return v(this,void 0,void 0,function*(){yield e.handleAppVisibilityChanged.call(this),bd()&&this.isInBackground&&this.source===T.Source.Camera&&(this._mediaStreamTrack.enabled=!1)})}}function zd(t,e,A,n,i,r){return v(this,void 0,void 0,function*(){const s=yield n.lock();i.debug("setPublishingLayersForSender",Object.assign(Object.assign({},r),{sender:t,qualities:A,senderEncodings:e}));try{const a=t.getParameters(),{encodings:o}=a;if(!o)return;if(o.length!==e.length){i.warn("cannot set publishing layers, encodings mismatch",Object.assign(Object.assign({},r),{encodings:o,senderEncodings:e}));return}let c=!1;const l=uA();if((l==null?void 0:l.name)==="Chrome"&&mt(l==null?void 0:l.version,"133")>0&&o[0].scalabilityMode){const d=o[0],h=new hr(d.scalabilityMode);let g=Lt.OFF;if(A.forEach(f=>{f.enabled&&(g===Lt.OFF||f.quality>g)&&(g=f.quality)}),g===Lt.OFF)d.active&&(d.active=!1,c=!0);else if(!d.active||h.spatial!==g+1){c=!0,d.active=!0;const f=new hr(e[0].scalabilityMode);h.spatial=g+1,h.suffix=f.suffix,h.spatial===1&&(h.suffix=void 0),d.scalabilityMode=h.toString(),d.scaleResolutionDownBy=Math.pow(2,2-g),e[0].maxBitrate&&(d.maxBitrate=e[0].maxBitrate/(d.scaleResolutionDownBy*d.scaleResolutionDownBy))}}else o.forEach((d,h)=>{var g;let f=(g=d.rid)!==null&&g!==void 0?g:"";f===""&&(f="q");const m=Zd(f),B=A.find(b=>b.quality===m);B&&d.active!==B.enabled&&(c=!0,d.active=B.enabled,i.debug("setting layer ".concat(B.quality," to ").concat(d.active?"enabled":"disabled"),r),Gt()&&(B.enabled?(d.scaleResolutionDownBy=e[h].scaleResolutionDownBy,d.maxBitrate=e[h].maxBitrate,d.maxFrameRate=e[h].maxFrameRate):(d.scaleResolutionDownBy=4,d.maxBitrate=10,d.maxFrameRate=2)))});c&&(a.encodings=o,i.debug("setting encodings",Object.assign(Object.assign({},r),{encodings:a.encodings})),yield t.setParameters(a))}finally{s()}})}function Zd(t){switch(t){case"f":return AA.HIGH;case"h":return AA.MEDIUM;case"q":return AA.LOW;default:return AA.HIGH}}function $d(t,e,A,n){if(!A)return[new ft({quality:AA.HIGH,width:t,height:e,bitrate:0,ssrc:0})];if(n){const i=A[0].scalabilityMode,r=new hr(i),s=[],a=r.suffix=="h"?1.5:2,o=r.suffix=="h"?2:3;for(let c=0;c<r.spatial;c+=1)s.push(new ft({quality:Math.min(AA.HIGH,r.spatial-1)-c,width:Math.ceil(t/Math.pow(a,c)),height:Math.ceil(e/Math.pow(a,c)),bitrate:A[0].maxBitrate?Math.ceil(A[0].maxBitrate/Math.pow(o,c)):0,ssrc:0}));return s}return A.map(i=>{var r,s,a;const o=(r=i.scaleResolutionDownBy)!==null&&r!==void 0?r:1;let c=Zd((s=i.rid)!==null&&s!==void 0?s:"");return new ft({quality:c,width:Math.ceil(t/o),height:Math.ceil(e/o),bitrate:(a=i.maxBitrate)!==null&&a!==void 0?a:0,ssrc:0})})}const eh="_lossy",Ah="_reliable",Mb=2*1e3,Na="leave-reconnect";var hA;(function(t){t[t.New=0]="New",t[t.Connected=1]="Connected",t[t.Disconnected=2]="Disconnected",t[t.Reconnecting=3]="Reconnecting",t[t.Closed=4]="Closed"})(hA||(hA={}));class Nb extends yA.EventEmitter{get isClosed(){return this._isClosed}get pendingReconnect(){return!!this.reconnectTimeout}constructor(e){var A;super(),this.options=e,this.rtcConfig={},this.peerConnectionTimeout=Ra.peerConnectionTimeout,this.fullReconnectOnNext=!1,this.subscriberPrimary=!1,this.pcState=hA.New,this._isClosed=!0,this.pendingTrackResolvers={},this.reconnectAttempts=0,this.reconnectStart=0,this.attemptingReconnect=!1,this.joinAttempts=0,this.maxJoinAttempts=1,this.shouldFailNext=!1,this.log=W,this.handleDataChannel=n=>v(this,[n],void 0,function(i){var r=this;let{channel:s}=i;return function*(){if(s){if(s.label===Ah)r.reliableDCSub=s;else if(s.label===eh)r.lossyDCSub=s;else return;r.log.debug("on data channel ".concat(s.id,", ").concat(s.label),r.logContext),s.onmessage=r.handleDataMessage}}()}),this.handleDataMessage=n=>v(this,void 0,void 0,function*(){var i,r;const s=yield this.dataProcessLock.lock();try{let a;if(n.data instanceof ArrayBuffer)a=n.data;else if(n.data instanceof Blob)a=yield n.data.arrayBuffer();else{this.log.error("unsupported data type",Object.assign(Object.assign({},this.logContext),{data:n.data}));return}const o=Ne.fromBinary(new Uint8Array(a));((i=o.value)===null||i===void 0?void 0:i.case)==="speaker"?this.emit(P.ActiveSpeakersUpdate,o.value.value.speakers):(((r=o.value)===null||r===void 0?void 0:r.case)==="user"&&Vb(o,o.value.value),this.emit(P.DataPacketReceived,o))}finally{s()}}),this.handleDataError=n=>{const r=n.currentTarget.maxRetransmits===0?"lossy":"reliable";if(n instanceof ErrorEvent&&n.error){const{error:s}=n.error;this.log.error("DataChannel error on ".concat(r,": ").concat(n.message),Object.assign(Object.assign({},this.logContext),{error:s}))}else this.log.error("Unknown DataChannel error on ".concat(r),Object.assign(Object.assign({},this.logContext),{event:n}))},this.handleBufferedAmountLow=n=>{const r=n.currentTarget.maxRetransmits===0?X.LOSSY:X.RELIABLE;this.updateAndEmitDCBufferStatus(r)},this.handleDisconnect=(n,i)=>{if(this._isClosed)return;this.log.warn("".concat(n," disconnected"),this.logContext),this.reconnectAttempts===0&&(this.reconnectStart=Date.now());const r=o=>{this.log.warn("could not recover connection after ".concat(this.reconnectAttempts," attempts, ").concat(o,"ms. giving up"),this.logContext),this.emit(P.Disconnected),this.close()},s=Date.now()-this.reconnectStart;let a=this.getNextRetryDelay({elapsedMs:s,retryCount:this.reconnectAttempts});if(a===null){r(s);return}n===Na&&(a=0),this.log.debug("reconnecting in ".concat(a,"ms"),this.logContext),this.clearReconnectTimeout(),this.token&&this.regionUrlProvider&&this.regionUrlProvider.updateToken(this.token),this.reconnectTimeout=Te.setTimeout(()=>this.attemptReconnect(i).finally(()=>this.reconnectTimeout=void 0),a)},this.waitForRestarted=()=>new Promise((n,i)=>{this.pcState===hA.Connected&&n();const r=()=>{this.off(P.Disconnected,s),n()},s=()=>{this.off(P.Restarted,r),i()};this.once(P.Restarted,r),this.once(P.Disconnected,s)}),this.updateAndEmitDCBufferStatus=n=>{const i=this.isBufferStatusLow(n);typeof i<"u"&&i!==this.dcBufferStatus.get(n)&&(this.dcBufferStatus.set(n,i),this.emit(P.DCBufferStatusChanged,i,n))},this.isBufferStatusLow=n=>{const i=this.dataChannelForKind(n);if(i)return i.bufferedAmount<=i.bufferedAmountLowThreshold},this.handleBrowserOnLine=()=>{this.client.currentState===ie.RECONNECTING&&(this.clearReconnectTimeout(),this.attemptReconnect(Dt.RR_SIGNAL_DISCONNECTED))},this.log=FA((A=e.loggerName)!==null&&A!==void 0?A:lA.Engine),this.loggerOptions={loggerName:e.loggerName,loggerContextCb:()=>this.logContext},this.client=new ka(void 0,this.loggerOptions),this.client.signalLatency=this.options.expSignalLatency,this.reconnectPolicy=this.options.reconnectPolicy,this.registerOnLineListener(),this.closingLock=new Oe,this.dataProcessLock=new Oe,this.dcBufferStatus=new Map([[X.LOSSY,!0],[X.RELIABLE,!0]]),this.client.onParticipantUpdate=n=>this.emit(P.ParticipantUpdate,n),this.client.onConnectionQuality=n=>this.emit(P.ConnectionQualityUpdate,n),this.client.onRoomUpdate=n=>this.emit(P.RoomUpdate,n),this.client.onSubscriptionError=n=>this.emit(P.SubscriptionError,n),this.client.onSubscriptionPermissionUpdate=n=>this.emit(P.SubscriptionPermissionUpdate,n),this.client.onSpeakersChanged=n=>this.emit(P.SpeakersChanged,n),this.client.onStreamStateUpdate=n=>this.emit(P.StreamStateChanged,n),this.client.onRequestResponse=n=>this.emit(P.SignalRequestResponse,n)}get logContext(){var e,A,n,i,r,s,a,o;return{room:(A=(e=this.latestJoinResponse)===null||e===void 0?void 0:e.room)===null||A===void 0?void 0:A.name,roomID:(i=(n=this.latestJoinResponse)===null||n===void 0?void 0:n.room)===null||i===void 0?void 0:i.sid,participant:(s=(r=this.latestJoinResponse)===null||r===void 0?void 0:r.participant)===null||s===void 0?void 0:s.identity,pID:(o=(a=this.latestJoinResponse)===null||a===void 0?void 0:a.participant)===null||o===void 0?void 0:o.sid}}join(e,A,n,i){return v(this,void 0,void 0,function*(){this.url=e,this.token=A,this.signalOpts=n,this.maxJoinAttempts=n.maxRetries;try{this.joinAttempts+=1,this.setupSignalClientCallbacks();const r=yield this.client.join(e,A,n,i);return this._isClosed=!1,this.latestJoinResponse=r,this.subscriberPrimary=r.subscriberPrimary,this.pcManager||(yield this.configure(r)),(!this.subscriberPrimary||r.fastPublish)&&this.negotiate(),this.clientConfiguration=r.clientConfiguration,setTimeout(()=>{this.emit(P.SignalConnected)},10),r}catch(r){if(r instanceof Ae&&r.reason===J.ServerUnreachable&&(this.log.warn("Couldn't connect to server, attempt ".concat(this.joinAttempts," of ").concat(this.maxJoinAttempts),this.logContext),this.joinAttempts<this.maxJoinAttempts))return this.join(e,A,n,i);throw r}})}close(){return v(this,void 0,void 0,function*(){const e=yield this.closingLock.lock();if(this.isClosed){e();return}try{this._isClosed=!0,this.joinAttempts=0,this.emit(P.Closing),this.removeAllListeners(),this.deregisterOnLineListener(),this.clearPendingReconnect(),yield this.cleanupPeerConnections(),yield this.cleanupClient()}finally{e()}})}cleanupPeerConnections(){return v(this,void 0,void 0,function*(){var e;yield(e=this.pcManager)===null||e===void 0?void 0:e.close(),this.pcManager=void 0;const A=n=>{n&&(n.close(),n.onbufferedamountlow=null,n.onclose=null,n.onclosing=null,n.onerror=null,n.onmessage=null,n.onopen=null)};A(this.lossyDC),A(this.lossyDCSub),A(this.reliableDC),A(this.reliableDCSub),this.lossyDC=void 0,this.lossyDCSub=void 0,this.reliableDC=void 0,this.reliableDCSub=void 0})}cleanupClient(){return v(this,void 0,void 0,function*(){yield this.client.close(),this.client.resetCallbacks()})}addTrack(e){if(this.pendingTrackResolvers[e.cid])throw new IA("a track with the same ID has already been published");return new Promise((A,n)=>{const i=setTimeout(()=>{delete this.pendingTrackResolvers[e.cid],n(new Ae("publication of local track timed out, no response from server",J.InternalError))},1e4);this.pendingTrackResolvers[e.cid]={resolve:r=>{clearTimeout(i),A(r)},reject:()=>{clearTimeout(i),n(new Error("Cancelled publication by calling unpublish"))}},this.client.sendAddTrack(e)})}removeTrack(e){if(e.track&&this.pendingTrackResolvers[e.track.id]){const{reject:A}=this.pendingTrackResolvers[e.track.id];A&&A(),delete this.pendingTrackResolvers[e.track.id]}try{return this.pcManager.removeTrack(e),!0}catch(A){this.log.warn("failed to remove track",Object.assign(Object.assign({},this.logContext),{error:A}))}return!1}updateMuteStatus(e,A){this.client.sendMuteTrack(e,A)}get dataSubscriberReadyState(){var e;return(e=this.reliableDCSub)===null||e===void 0?void 0:e.readyState}getConnectedServerAddress(){return v(this,void 0,void 0,function*(){var e;return(e=this.pcManager)===null||e===void 0?void 0:e.getConnectedAddress()})}setRegionUrlProvider(e){this.regionUrlProvider=e}configure(e){return v(this,void 0,void 0,function*(){var A,n;if(this.pcManager&&this.pcManager.currentState!==ue.NEW)return;this.participantSid=(A=e.participant)===null||A===void 0?void 0:A.sid;const i=this.makeRTCConfiguration(e);this.pcManager=new Eb(i,e.subscriberPrimary,this.loggerOptions),this.emit(P.TransportsCreated,this.pcManager.publisher,this.pcManager.subscriber),this.pcManager.onIceCandidate=(r,s)=>{this.client.sendIceCandidate(r,s)},this.pcManager.onPublisherOffer=r=>{this.client.sendOffer(r)},this.pcManager.onDataChannel=this.handleDataChannel,this.pcManager.onStateChange=(r,s,a)=>v(this,void 0,void 0,function*(){if(this.log.debug("primary PC state changed ".concat(r),this.logContext),["closed","disconnected","failed"].includes(s)&&(this.publisherConnectionPromise=void 0),r===ue.CONNECTED){const l=this.pcState===hA.New;this.pcState=hA.Connected,l&&this.emit(P.Connected,e)}else r===ue.FAILED&&this.pcState===hA.Connected&&(this.pcState=hA.Disconnected,this.handleDisconnect("peerconnection failed",a==="failed"?Dt.RR_SUBSCRIBER_FAILED:Dt.RR_PUBLISHER_FAILED));const o=this.client.isDisconnected||this.client.currentState===ie.RECONNECTING,c=[ue.FAILED,ue.CLOSING,ue.CLOSED].includes(r);o&&c&&!this._isClosed&&this.emit(P.Offline)}),this.pcManager.onTrack=r=>{this.emit(P.MediaTrackAdded,r.track,r.streams[0],r.receiver)},Kb((n=e.serverInfo)===null||n===void 0?void 0:n.protocol)||this.createDataChannels()})}setupSignalClientCallbacks(){this.client.onAnswer=e=>v(this,void 0,void 0,function*(){this.pcManager&&(this.log.debug("received server answer",Object.assign(Object.assign({},this.logContext),{RTCSdpType:e.type})),yield this.pcManager.setPublisherAnswer(e))}),this.client.onTrickle=(e,A)=>{this.pcManager&&(this.log.debug("got ICE candidate from peer",Object.assign(Object.assign({},this.logContext),{candidate:e,target:A})),this.pcManager.addIceCandidate(e,A))},this.client.onOffer=e=>v(this,void 0,void 0,function*(){if(!this.pcManager)return;const A=yield this.pcManager.createSubscriberAnswerFromOffer(e);this.client.sendAnswer(A)}),this.client.onLocalTrackPublished=e=>{var A;if(this.log.debug("received trackPublishedResponse",Object.assign(Object.assign({},this.logContext),{cid:e.cid,track:(A=e.track)===null||A===void 0?void 0:A.sid})),!this.pendingTrackResolvers[e.cid]){this.log.error("missing track resolver for ".concat(e.cid),Object.assign(Object.assign({},this.logContext),{cid:e.cid}));return}const{resolve:n}=this.pendingTrackResolvers[e.cid];delete this.pendingTrackResolvers[e.cid],n(e.track)},this.client.onLocalTrackUnpublished=e=>{this.emit(P.LocalTrackUnpublished,e)},this.client.onLocalTrackSubscribed=e=>{this.emit(P.LocalTrackSubscribed,e)},this.client.onTokenRefresh=e=>{this.token=e},this.client.onRemoteMuteChanged=(e,A)=>{this.emit(P.RemoteMute,e,A)},this.client.onSubscribedQualityUpdate=e=>{this.emit(P.SubscribedQualityUpdate,e)},this.client.onRoomMoved=e=>{var A;this.participantSid=(A=e.participant)===null||A===void 0?void 0:A.sid,this.emit(P.RoomMoved,e)},this.client.onClose=()=>{this.handleDisconnect("signal",Dt.RR_SIGNAL_DISCONNECTED)},this.client.onLeave=e=>{switch(this.log.debug("client leave request",Object.assign(Object.assign({},this.logContext),{reason:e==null?void 0:e.reason})),e.regions&&this.regionUrlProvider&&(this.log.debug("updating regions",this.logContext),this.regionUrlProvider.setServerReportedRegions(e.regions)),e.action){case Mt.DISCONNECT:this.emit(P.Disconnected,e==null?void 0:e.reason),this.close();break;case Mt.RECONNECT:this.fullReconnectOnNext=!0,this.handleDisconnect(Na);break;case Mt.RESUME:this.handleDisconnect(Na)}}}makeRTCConfiguration(e){var A;const n=Object.assign({},this.rtcConfig);if(!((A=this.signalOpts)===null||A===void 0)&&A.e2eeEnabled&&(this.log.debug("E2EE - setting up transports with insertable streams",this.logContext),n.encodedInsertableStreams=!0),e.iceServers&&!n.iceServers){const i=[];e.iceServers.forEach(r=>{const s={urls:r.urls};r.username&&(s.username=r.username),r.credential&&(s.credential=r.credential),i.push(s)}),n.iceServers=i}return e.clientConfiguration&&e.clientConfiguration.forceRelay===Un.ENABLED&&(n.iceTransportPolicy="relay"),n.sdpSemantics="unified-plan",n.continualGatheringPolicy="gather_continually",n}createDataChannels(){this.pcManager&&(this.lossyDC&&(this.lossyDC.onmessage=null,this.lossyDC.onerror=null),this.reliableDC&&(this.reliableDC.onmessage=null,this.reliableDC.onerror=null),this.lossyDC=this.pcManager.createPublisherDataChannel(eh,{ordered:!1,maxRetransmits:0}),this.reliableDC=this.pcManager.createPublisherDataChannel(Ah,{ordered:!0}),this.lossyDC.onmessage=this.handleDataMessage,this.reliableDC.onmessage=this.handleDataMessage,this.lossyDC.onerror=this.handleDataError,this.reliableDC.onerror=this.handleDataError,this.lossyDC.bufferedAmountLowThreshold=65535,this.reliableDC.bufferedAmountLowThreshold=65535,this.lossyDC.onbufferedamountlow=this.handleBufferedAmountLow,this.reliableDC.onbufferedamountlow=this.handleBufferedAmountLow)}createSender(e,A,n){return v(this,void 0,void 0,function*(){if(fa())return yield this.createTransceiverRTCRtpSender(e,A,n);if(ga())return this.log.warn("using add-track fallback",this.logContext),yield this.createRTCRtpSender(e.mediaStreamTrack);throw new ye("Required webRTC APIs not supported on this device")})}createSimulcastSender(e,A,n,i){return v(this,void 0,void 0,function*(){if(fa())return this.createSimulcastTransceiverSender(e,A,n,i);if(ga())return this.log.debug("using add-track fallback",this.logContext),this.createRTCRtpSender(e.mediaStreamTrack);throw new ye("Cannot stream on this device")})}createTransceiverRTCRtpSender(e,A,n){return v(this,void 0,void 0,function*(){if(!this.pcManager)throw new ye("publisher is closed");const i=[];e.mediaStream&&i.push(e.mediaStream),Wt(e)&&(e.codec=A.videoCodec);const r={direction:"sendonly",streams:i};return n&&(r.sendEncodings=n),(yield this.pcManager.addPublisherTransceiver(e.mediaStreamTrack,r)).sender})}createSimulcastTransceiverSender(e,A,n,i){return v(this,void 0,void 0,function*(){if(!this.pcManager)throw new ye("publisher is closed");const r={direction:"sendonly"};i&&(r.sendEncodings=i);const s=yield this.pcManager.addPublisherTransceiver(A.mediaStreamTrack,r);if(n.videoCodec)return e.setSimulcastTrackSender(n.videoCodec,s.sender),s.sender})}createRTCRtpSender(e){return v(this,void 0,void 0,function*(){if(!this.pcManager)throw new ye("publisher is closed");return this.pcManager.addPublisherTrack(e)})}attemptReconnect(e){return v(this,void 0,void 0,function*(){var A,n,i;if(!this._isClosed){if(this.attemptingReconnect){W.warn("already attempting reconnect, returning early",this.logContext);return}(((A=this.clientConfiguration)===null||A===void 0?void 0:A.resumeConnection)===Un.DISABLED||((i=(n=this.pcManager)===null||n===void 0?void 0:n.currentState)!==null&&i!==void 0?i:ue.NEW)===ue.NEW)&&(this.fullReconnectOnNext=!0);try{this.attemptingReconnect=!0,this.fullReconnectOnNext?yield this.restartConnection():yield this.resumeConnection(e),this.clearPendingReconnect(),this.fullReconnectOnNext=!1}catch(r){this.reconnectAttempts+=1;let s=!0;r instanceof ye?(this.log.debug("received unrecoverable error",Object.assign(Object.assign({},this.logContext),{error:r})),s=!1):r instanceof Xt||(this.fullReconnectOnNext=!0),s?this.handleDisconnect("reconnect",Dt.RR_UNKNOWN):(this.log.info("could not recover connection after ".concat(this.reconnectAttempts," attempts, ").concat(Date.now()-this.reconnectStart,"ms. giving up"),this.logContext),this.emit(P.Disconnected),yield this.close())}finally{this.attemptingReconnect=!1}}})}getNextRetryDelay(e){try{return this.reconnectPolicy.nextRetryDelayInMs(e)}catch(A){this.log.warn("encountered error in reconnect policy",Object.assign(Object.assign({},this.logContext),{error:A}))}return null}restartConnection(e){return v(this,void 0,void 0,function*(){var A,n,i;try{if(!this.url||!this.token)throw new ye("could not reconnect, url or token not saved");this.log.info("reconnecting, attempt: ".concat(this.reconnectAttempts),this.logContext),this.emit(P.Restarting),this.client.isDisconnected||(yield this.client.sendLeave()),yield this.cleanupPeerConnections(),yield this.cleanupClient();let r;try{if(!this.signalOpts)throw this.log.warn("attempted connection restart, without signal options present",this.logContext),new Xt;r=yield this.join(e??this.url,this.token,this.signalOpts)}catch(s){throw s instanceof Ae&&s.reason===J.NotAllowed?new ye("could not reconnect, token might be expired"):new Xt}if(this.shouldFailNext)throw this.shouldFailNext=!1,new Error("simulated failure");if(this.client.setReconnected(),this.emit(P.SignalRestarted,r),yield this.waitForPCReconnected(),this.client.currentState!==ie.CONNECTED)throw new Xt("Signal connection got severed during reconnect");(A=this.regionUrlProvider)===null||A===void 0||A.resetAttempts(),this.emit(P.Restarted)}catch(r){const s=yield(n=this.regionUrlProvider)===null||n===void 0?void 0:n.getNextBestRegionUrl();if(s){yield this.restartConnection(s);return}else throw(i=this.regionUrlProvider)===null||i===void 0||i.resetAttempts(),r}})}resumeConnection(e){return v(this,void 0,void 0,function*(){var A;if(!this.url||!this.token)throw new ye("could not reconnect, url or token not saved");if(!this.pcManager)throw new ye("publisher and subscriber connections unset");this.log.info("resuming signal connection, attempt ".concat(this.reconnectAttempts),this.logContext),this.emit(P.Resuming);let n;try{this.setupSignalClientCallbacks(),n=yield this.client.reconnect(this.url,this.token,this.participantSid,e)}catch(i){let r="";throw i instanceof Error&&(r=i.message,this.log.error(i.message,Object.assign(Object.assign({},this.logContext),{error:i}))),i instanceof Ae&&i.reason===J.NotAllowed?new ye("could not reconnect, token might be expired"):i instanceof Ae&&i.reason===J.LeaveRequest?i:new Xt(r)}if(this.emit(P.SignalResumed),n){const i=this.makeRTCConfiguration(n);this.pcManager.updateConfiguration(i)}else this.log.warn("Did not receive reconnect response",this.logContext);if(this.shouldFailNext)throw this.shouldFailNext=!1,new Error("simulated failure");if(yield this.pcManager.triggerIceRestart(),yield this.waitForPCReconnected(),this.client.currentState!==ie.CONNECTED)throw new Xt("Signal connection got severed during reconnect");this.client.setReconnected(),((A=this.reliableDC)===null||A===void 0?void 0:A.readyState)==="open"&&this.reliableDC.id===null&&this.createDataChannels(),this.emit(P.Resumed)})}waitForPCInitialConnection(e,A){return v(this,void 0,void 0,function*(){if(!this.pcManager)throw new ye("PC manager is closed");yield this.pcManager.ensurePCTransportConnection(A,e)})}waitForPCReconnected(){return v(this,void 0,void 0,function*(){this.pcState=hA.Reconnecting,this.log.debug("waiting for peer connection to reconnect",this.logContext);try{if(yield Ke(Mb),!this.pcManager)throw new ye("PC manager is closed");yield this.pcManager.ensurePCTransportConnection(void 0,this.peerConnectionTimeout),this.pcState=hA.Connected}catch(e){throw this.pcState=hA.Disconnected,new Ae("could not establish PC connection, ".concat(e.message),J.InternalError)}})}publishRpcResponse(e,A,n,i){return v(this,void 0,void 0,function*(){const r=new Ne({destinationIdentities:[e],kind:X.RELIABLE,value:{case:"rpcResponse",value:new au({requestId:A,value:i?{case:"error",value:i.toProto()}:{case:"payload",value:n??""}})}});yield this.sendDataPacket(r,X.RELIABLE)})}publishRpcAck(e,A){return v(this,void 0,void 0,function*(){const n=new Ne({destinationIdentities:[e],kind:X.RELIABLE,value:{case:"rpcAck",value:new su({requestId:A})}});yield this.sendDataPacket(n,X.RELIABLE)})}sendDataPacket(e,A){return v(this,void 0,void 0,function*(){const n=e.toBinary();yield this.ensurePublisherConnected(A);const i=this.dataChannelForKind(A);i&&i.send(n),this.updateAndEmitDCBufferStatus(A)})}waitForBufferStatusLow(e){return new Promise((A,n)=>v(this,void 0,void 0,function*(){if(this.isBufferStatusLow(e))A();else{const i=()=>n("Engine closed");for(this.once(P.Closing,i);!this.dcBufferStatus.get(e);)yield Ke(10);this.off(P.Closing,i),A()}}))}ensureDataTransportConnected(e){return v(this,arguments,void 0,function(A){var n=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.subscriberPrimary;return function*(){var r;if(!n.pcManager)throw new ye("PC manager is closed");const s=i?n.pcManager.subscriber:n.pcManager.publisher,a=i?"Subscriber":"Publisher";if(!s)throw new Ae("".concat(a," connection not set"),J.InternalError);let o=!1;!i&&!n.dataChannelForKind(A,i)&&(n.createDataChannels(),o=!0),!o&&!i&&!n.pcManager.publisher.isICEConnected&&n.pcManager.publisher.getICEConnectionState()!=="checking"&&(o=!0),o&&n.negotiate();const c=n.dataChannelForKind(A,i);if((c==null?void 0:c.readyState)==="open")return;const l=new Date().getTime()+n.peerConnectionTimeout;for(;new Date().getTime()<l;){if(s.isICEConnected&&((r=n.dataChannelForKind(A,i))===null||r===void 0?void 0:r.readyState)==="open")return;yield Ke(50)}throw new Ae("could not establish ".concat(a," connection, state: ").concat(s.getICEConnectionState()),J.InternalError)}()})}ensurePublisherConnected(e){return v(this,void 0,void 0,function*(){this.publisherConnectionPromise||(this.publisherConnectionPromise=this.ensureDataTransportConnected(e,!1)),yield this.publisherConnectionPromise})}verifyTransport(){return!(!this.pcManager||this.pcManager.currentState!==ue.CONNECTED||!this.client.ws||this.client.ws.readyState===WebSocket.CLOSED)}negotiate(){return v(this,void 0,void 0,function*(){return new Promise((e,A)=>v(this,void 0,void 0,function*(){if(!this.pcManager){A(new aa("PC manager is closed"));return}this.pcManager.requirePublisher(),this.pcManager.publisher.getTransceivers().length==0&&!this.lossyDC&&!this.reliableDC&&this.createDataChannels();const n=new AbortController,i=()=>{n.abort(),this.log.debug("engine disconnected while negotiation was ongoing",this.logContext),e()};this.isClosed&&A("cannot negotiate on closed engine"),this.on(P.Closing,i),this.pcManager.publisher.once(Jt.RTPVideoPayloadTypes,r=>{const s=new Map;r.forEach(a=>{const o=a.codec.toLowerCase();zw(o)&&s.set(a.payload,o)}),this.emit(P.RTPVideoMapUpdate,s)});try{yield this.pcManager.negotiate(n),e()}catch(r){r instanceof aa&&(this.fullReconnectOnNext=!0),this.handleDisconnect("negotiation",Dt.RR_UNKNOWN),A(r)}finally{this.off(P.Closing,i)}}))})}dataChannelForKind(e,A){if(A){if(e===X.LOSSY)return this.lossyDCSub;if(e===X.RELIABLE)return this.reliableDCSub}else{if(e===X.LOSSY)return this.lossyDC;if(e===X.RELIABLE)return this.reliableDC}}sendSyncState(e,A){var n,i;if(!this.pcManager){this.log.warn("sync state cannot be sent without peer connection setup",this.logContext);return}const r=this.pcManager.subscriber.getLocalDescription(),s=this.pcManager.subscriber.getRemoteDescription(),a=(i=(n=this.signalOpts)===null||n===void 0?void 0:n.autoSubscribe)!==null&&i!==void 0?i:!0,o=new Array,c=new Array;e.forEach(l=>{l.isDesired!==a&&o.push(l.trackSid),l.isEnabled||c.push(l.trackSid)}),this.client.sendSyncState(new Qu({answer:r?lr({sdp:r.sdp,type:r.type}):void 0,offer:s?lr({sdp:s.sdp,type:s.type}):void 0,subscription:new Xi({trackSids:o,subscribe:!a,participantTracks:[]}),publishTracks:sb(A),dataChannels:this.dataChannelsInfo(),trackSidsDisabled:c}))}failNext(){this.shouldFailNext=!0}dataChannelsInfo(){const e=[],A=(n,i)=>{(n==null?void 0:n.id)!==void 0&&n.id!==null&&e.push(new Eu({label:n.label,id:n.id,target:i}))};return A(this.dataChannelForKind(X.LOSSY),cA.PUBLISHER),A(this.dataChannelForKind(X.RELIABLE),cA.PUBLISHER),A(this.dataChannelForKind(X.LOSSY,!0),cA.SUBSCRIBER),A(this.dataChannelForKind(X.RELIABLE,!0),cA.SUBSCRIBER),e}clearReconnectTimeout(){this.reconnectTimeout&&Te.clearTimeout(this.reconnectTimeout)}clearPendingReconnect(){this.clearReconnectTimeout(),this.reconnectAttempts=0}registerOnLineListener(){Ve()&&window.addEventListener("online",this.handleBrowserOnLine)}deregisterOnLineListener(){Ve()&&window.removeEventListener("online",this.handleBrowserOnLine)}}class Xt extends Error{}function Kb(t){return t!==void 0&&t>13}function Vb(t,e){const A=t.participantIdentity?t.participantIdentity:e.participantIdentity;t.participantIdentity=A,e.participantIdentity=A;const n=t.destinationIdentities.length!==0?t.destinationIdentities:e.destinationIdentities;t.destinationIdentities=n,e.destinationIdentities=n}class Ka{constructor(e,A){this.lastUpdateAt=0,this.settingsCacheTime=3e3,this.attemptedRegions=[],this.serverUrl=new URL(e),this.token=A}updateToken(e){this.token=e}isCloud(){return ma(this.serverUrl)}getServerUrl(){return this.serverUrl}getNextBestRegionUrl(e){return v(this,void 0,void 0,function*(){if(!this.isCloud())throw Error("region availability is only supported for LiveKit Cloud domains");(!this.regionSettings||Date.now()-this.lastUpdateAt>this.settingsCacheTime)&&(this.regionSettings=yield this.fetchRegionSettings(e));const A=this.regionSettings.regions.filter(n=>!this.attemptedRegions.find(i=>i.url===n.url));if(A.length>0){const n=A[0];return this.attemptedRegions.push(n),W.debug("next region: ".concat(n.region)),n.url}else return null})}resetAttempts(){this.attemptedRegions=[]}fetchRegionSettings(e){return v(this,void 0,void 0,function*(){const A=yield fetch("".concat(Gb(this.serverUrl),"/regions"),{headers:{authorization:"Bearer ".concat(this.token)},signal:e});if(A.ok){const n=yield A.json();return this.lastUpdateAt=Date.now(),n}else throw new Ae("Could not fetch region settings: ".concat(A.statusText),A.status===401?J.NotAllowed:J.InternalError,A.status)})}setServerReportedRegions(e){this.regionSettings=e,this.lastUpdateAt=Date.now()}}function Gb(t){return"".concat(t.protocol.replace("ws","http"),"//").concat(t.host,"/settings")}class th{get info(){return this._info}constructor(e,A,n){this.reader=A,this.totalByteSize=n,this._info=e,this.bytesReceived=0}}class jb extends th{handleChunkReceived(e){var A;this.bytesReceived+=e.content.byteLength;const n=this.totalByteSize?this.bytesReceived/this.totalByteSize:void 0;(A=this.onProgress)===null||A===void 0||A.call(this,n)}[Symbol.asyncIterator](){const e=this.reader.getReader();return{next:()=>v(this,void 0,void 0,function*(){try{const{done:A,value:n}=yield e.read();return A?{done:!0,value:void 0}:(this.handleChunkReceived(n),{done:!1,value:n.content})}catch{return{done:!0,value:void 0}}}),return(){return v(this,void 0,void 0,function*(){return e.releaseLock(),{done:!0,value:void 0}})}}}readAll(){return v(this,void 0,void 0,function*(){var e,A,n,i;let r=new Set;try{for(var s=!0,a=XA(this),o;o=yield a.next(),e=o.done,!e;s=!0){i=o.value,s=!1;const c=i;r.add(c)}}catch(c){A={error:c}}finally{try{!s&&!e&&(n=a.return)&&(yield n.call(a))}finally{if(A)throw A.error}}return Array.from(r)})}}class Wb extends th{constructor(e,A,n){super(e,A,n),this.receivedChunks=new Map}handleChunkReceived(e){var A;const n=or(e.chunkIndex),i=this.receivedChunks.get(n);if(i&&i.version>e.version)return;this.receivedChunks.set(n,e),this.bytesReceived+=e.content.byteLength;const r=this.totalByteSize?this.bytesReceived/this.totalByteSize:void 0;(A=this.onProgress)===null||A===void 0||A.call(this,r)}[Symbol.asyncIterator](){const e=this.reader.getReader(),A=new TextDecoder;return{next:()=>v(this,void 0,void 0,function*(){try{const{done:n,value:i}=yield e.read();return n?{done:!0,value:void 0}:(this.handleChunkReceived(i),{done:!1,value:A.decode(i.content)})}catch{return{done:!0,value:void 0}}}),return(){return v(this,void 0,void 0,function*(){return e.releaseLock(),{done:!0,value:void 0}})}}}readAll(){return v(this,void 0,void 0,function*(){var e,A,n,i;let r="";try{for(var s=!0,a=XA(this),o;o=yield a.next(),e=o.done,!e;s=!0)i=o.value,s=!1,r+=i}catch(c){A={error:c}}finally{try{!s&&!e&&(n=a.return)&&(yield n.call(a))}finally{if(A)throw A.error}}return r})}}class nh{constructor(e,A,n){this.writableStream=e,this.defaultWriter=e.getWriter(),this.onClose=n,this.info=A}write(e){return this.defaultWriter.write(e)}close(){return v(this,void 0,void 0,function*(){var e;yield this.defaultWriter.close(),this.defaultWriter.releaseLock(),(e=this.onClose)===null||e===void 0||e.call(this)})}}class Jb extends nh{}class Xb extends nh{}class ih extends T{constructor(e,A,n,i,r){super(e,n,r),this.sid=A,this.receiver=i}get isLocal(){return!1}setMuted(e){this.isMuted!==e&&(this.isMuted=e,this._mediaStreamTrack.enabled=!e,this.emit(e?_.Muted:_.Unmuted,this))}setMediaStream(e){this.mediaStream=e;const A=n=>{n.track===this._mediaStreamTrack&&(e.removeEventListener("removetrack",A),this.receiver&&"playoutDelayHint"in this.receiver&&(this.receiver.playoutDelayHint=void 0),this.receiver=void 0,this._currentBitrate=0,this.emit(_.Ended,this))};e.addEventListener("removetrack",A)}start(){this.startMonitor(),super.enable()}stop(){this.stopMonitor(),super.disable()}getRTCStatsReport(){return v(this,void 0,void 0,function*(){var e;return!((e=this.receiver)===null||e===void 0)&&e.getStats?yield this.receiver.getStats():void 0})}setPlayoutDelay(e){this.receiver?"playoutDelayHint"in this.receiver?this.receiver.playoutDelayHint=e:this.log.warn("Playout delay not supported in this browser"):this.log.warn("Cannot set playout delay, track already ended")}getPlayoutDelay(){if(this.receiver){if("playoutDelayHint"in this.receiver)return this.receiver.playoutDelayHint;this.log.warn("Playout delay not supported in this browser")}else this.log.warn("Cannot get playout delay, track already ended");return 0}startMonitor(){this.monitorInterval||(this.monitorInterval=setInterval(()=>this.monitorReceiver(),Da)),ab()&&this.registerTimeSyncUpdate()}registerTimeSyncUpdate(){const e=()=>{var A;this.timeSyncHandle=requestAnimationFrame(()=>e());const n=(A=this.receiver)===null||A===void 0?void 0:A.getSynchronizationSources()[0];if(n){const{timestamp:i,rtpTimestamp:r}=n;r&&this.rtpTimestamp!==r&&(this.emit(_.TimeSyncUpdate,{timestamp:i,rtpTimestamp:r}),this.rtpTimestamp=r)}};e()}}class qb extends ih{constructor(e,A,n,i,r,s){super(e,A,T.Kind.Audio,n,s),this.monitorReceiver=()=>v(this,void 0,void 0,function*(){if(!this.receiver){this._currentBitrate=0;return}const a=yield this.getReceiverStats();a&&this.prevStats&&this.receiver&&(this._currentBitrate=ur(a,this.prevStats)),this.prevStats=a}),this.audioContext=i,this.webAudioPluginNodes=[],r&&(this.sinkId=r.deviceId)}setVolume(e){var A;for(const n of this.attachedElements)this.audioContext?(A=this.gainNode)===null||A===void 0||A.gain.setTargetAtTime(e,0,.1):n.volume=e;UA()&&this._mediaStreamTrack._setVolume(e),this.elementVolume=e}getVolume(){if(this.elementVolume)return this.elementVolume;if(UA())return 1;let e=0;return this.attachedElements.forEach(A=>{A.volume>e&&(e=A.volume)}),e}setSinkId(e){return v(this,void 0,void 0,function*(){this.sinkId=e,yield Promise.all(this.attachedElements.map(A=>{if(pa(A))return A.setSinkId(e)}))})}attach(e){const A=this.attachedElements.length===0;return e?super.attach(e):e=super.attach(),this.sinkId&&pa(e)&&e.setSinkId(this.sinkId).catch(n=>{this.log.error("Failed to set sink id on remote audio track",n,this.logContext)}),this.audioContext&&A&&(this.log.debug("using audio context mapping",this.logContext),this.connectWebAudio(this.audioContext,e),e.volume=0,e.muted=!0),this.elementVolume&&this.setVolume(this.elementVolume),e}detach(e){let A;return e?(A=super.detach(e),this.audioContext&&(this.attachedElements.length>0?this.connectWebAudio(this.audioContext,this.attachedElements[0]):this.disconnectWebAudio())):(A=super.detach(),this.disconnectWebAudio()),A}setAudioContext(e){this.audioContext=e,e&&this.attachedElements.length>0?this.connectWebAudio(e,this.attachedElements[0]):e||this.disconnectWebAudio()}setWebAudioPlugins(e){this.webAudioPluginNodes=e,this.attachedElements.length>0&&this.audioContext&&this.connectWebAudio(this.audioContext,this.attachedElements[0])}connectWebAudio(e,A){this.disconnectWebAudio(),this.sourceNode=e.createMediaStreamSource(A.srcObject);let n=this.sourceNode;this.webAudioPluginNodes.forEach(i=>{n.connect(i),n=i}),this.gainNode=e.createGain(),n.connect(this.gainNode),this.gainNode.connect(e.destination),this.elementVolume&&this.gainNode.gain.setTargetAtTime(this.elementVolume,0,.1),e.state!=="running"&&e.resume().then(()=>{e.state!=="running"&&this.emit(_.AudioPlaybackFailed,new Error("Audio Context couldn't be started automatically"))}).catch(i=>{this.emit(_.AudioPlaybackFailed,i)})}disconnectWebAudio(){var e,A;(e=this.gainNode)===null||e===void 0||e.disconnect(),(A=this.sourceNode)===null||A===void 0||A.disconnect(),this.gainNode=void 0,this.sourceNode=void 0}getReceiverStats(){return v(this,void 0,void 0,function*(){if(!this.receiver||!this.receiver.getStats)return;const e=yield this.receiver.getStats();let A;return e.forEach(n=>{n.type==="inbound-rtp"&&(A={type:"audio",streamId:n.id,timestamp:n.timestamp,jitter:n.jitter,bytesReceived:n.bytesReceived,concealedSamples:n.concealedSamples,concealmentEvents:n.concealmentEvents,silentConcealedSamples:n.silentConcealedSamples,silentConcealmentEvents:n.silentConcealmentEvents,totalAudioEnergy:n.totalAudioEnergy,totalSamplesDuration:n.totalSamplesDuration})}),A})}}const Va=100;class Yb extends ih{constructor(e,A,n,i,r){super(e,A,T.Kind.Video,n,r),this.elementInfos=[],this.monitorReceiver=()=>v(this,void 0,void 0,function*(){if(!this.receiver){this._currentBitrate=0;return}const s=yield this.getReceiverStats();s&&this.prevStats&&this.receiver&&(this._currentBitrate=ur(s,this.prevStats)),this.prevStats=s}),this.debouncedHandleResize=_a(()=>{this.updateDimensions()},Va),this.adaptiveStreamSettings=i}get isAdaptiveStream(){return this.adaptiveStreamSettings!==void 0}get mediaStreamTrack(){return this._mediaStreamTrack}setMuted(e){super.setMuted(e),this.attachedElements.forEach(A=>{e?Vt(this._mediaStreamTrack,A):Kt(this._mediaStreamTrack,A)})}attach(e){if(e?super.attach(e):e=super.attach(),this.adaptiveStreamSettings&&this.elementInfos.find(A=>A.element===e)===void 0){const A=new zb(e);this.observeElementInfo(A)}return e}observeElementInfo(e){this.adaptiveStreamSettings&&this.elementInfos.find(A=>A===e)===void 0?(e.handleResize=()=>{this.debouncedHandleResize()},e.handleVisibilityChanged=()=>{this.updateVisibility()},this.elementInfos.push(e),e.observe(),this.debouncedHandleResize(),this.updateVisibility()):this.log.warn("visibility resize observer not triggered",this.logContext)}stopObservingElementInfo(e){if(!this.isAdaptiveStream){this.log.warn("stopObservingElementInfo ignored",this.logContext);return}const A=this.elementInfos.filter(n=>n===e);for(const n of A)n.stopObserving();this.elementInfos=this.elementInfos.filter(n=>n!==e),this.updateVisibility(),this.debouncedHandleResize()}detach(e){let A=[];if(e)return this.stopObservingElement(e),super.detach(e);A=super.detach();for(const n of A)this.stopObservingElement(n);return A}getDecoderImplementation(){var e;return(e=this.prevStats)===null||e===void 0?void 0:e.decoderImplementation}getReceiverStats(){return v(this,void 0,void 0,function*(){if(!this.receiver||!this.receiver.getStats)return;const e=yield this.receiver.getStats();let A,n="",i=new Map;return e.forEach(r=>{r.type==="inbound-rtp"?(n=r.codecId,A={type:"video",streamId:r.id,framesDecoded:r.framesDecoded,framesDropped:r.framesDropped,framesReceived:r.framesReceived,packetsReceived:r.packetsReceived,packetsLost:r.packetsLost,frameWidth:r.frameWidth,frameHeight:r.frameHeight,pliCount:r.pliCount,firCount:r.firCount,nackCount:r.nackCount,jitter:r.jitter,timestamp:r.timestamp,bytesReceived:r.bytesReceived,decoderImplementation:r.decoderImplementation}):r.type==="codec"&&i.set(r.id,r)}),A&&n!==""&&i.get(n)&&(A.mimeType=i.get(n).mimeType),A})}stopObservingElement(e){const A=this.elementInfos.filter(n=>n.element===e);for(const n of A)this.stopObservingElementInfo(n)}handleAppVisibilityChanged(){const e=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return v(this,void 0,void 0,function*(){yield e.handleAppVisibilityChanged.call(this),this.isAdaptiveStream&&this.updateVisibility()})}updateVisibility(){var e,A;const n=this.elementInfos.reduce((a,o)=>Math.max(a,o.visibilityChangedAt||0),0),i=!((A=(e=this.adaptiveStreamSettings)===null||e===void 0?void 0:e.pauseVideoInBackground)!==null&&A!==void 0)||A?this.isInBackground:!1,r=this.elementInfos.some(a=>a.pictureInPicture),s=this.elementInfos.some(a=>a.visible)&&!i||r;if(this.lastVisible!==s){if(!s&&Date.now()-n<Va){Te.setTimeout(()=>{this.updateVisibility()},Va);return}this.lastVisible=s,this.emit(_.VisibilityChanged,s,this)}}updateDimensions(){var e,A;let n=0,i=0;const r=this.getPixelDensity();for(const s of this.elementInfos){const a=s.width()*r,o=s.height()*r;a+o>n+i&&(n=a,i=o)}((e=this.lastDimensions)===null||e===void 0?void 0:e.width)===n&&((A=this.lastDimensions)===null||A===void 0?void 0:A.height)===i||(this.lastDimensions={width:n,height:i},this.emit(_.VideoDimensionsChanged,this.lastDimensions,this))}getPixelDensity(){var e;const A=(e=this.adaptiveStreamSettings)===null||e===void 0?void 0:e.pixelDensity;return A==="screen"?Qd():A||(Qd()>2?2:1)}}class zb{get visible(){return this.isPiP||this.isIntersecting}get pictureInPicture(){return this.isPiP}constructor(e,A){this.onVisibilityChanged=n=>{var i;const{target:r,isIntersecting:s}=n;r===this.element&&(this.isIntersecting=s,this.isPiP=In(this.element),this.visibilityChangedAt=Date.now(),(i=this.handleVisibilityChanged)===null||i===void 0||i.call(this))},this.onEnterPiP=()=>{var n,i,r;(i=(n=window.documentPictureInPicture)===null||n===void 0?void 0:n.window)===null||i===void 0||i.addEventListener("pagehide",this.onLeavePiP),this.isPiP=In(this.element),(r=this.handleVisibilityChanged)===null||r===void 0||r.call(this)},this.onLeavePiP=()=>{var n;this.isPiP=In(this.element),(n=this.handleVisibilityChanged)===null||n===void 0||n.call(this)},this.element=e,this.isIntersecting=A??Ga(e),this.isPiP=Ve()&&In(e),this.visibilityChangedAt=0}width(){return this.element.clientWidth}height(){return this.element.clientHeight}observe(){var e,A,n;this.isIntersecting=Ga(this.element),this.isPiP=In(this.element),this.element.handleResize=()=>{var i;(i=this.handleResize)===null||i===void 0||i.call(this)},this.element.handleVisibilityChanged=this.onVisibilityChanged,Sd().observe(this.element),Ed().observe(this.element),this.element.addEventListener("enterpictureinpicture",this.onEnterPiP),this.element.addEventListener("leavepictureinpicture",this.onLeavePiP),(e=window.documentPictureInPicture)===null||e===void 0||e.addEventListener("enter",this.onEnterPiP),(n=(A=window.documentPictureInPicture)===null||A===void 0?void 0:A.window)===null||n===void 0||n.addEventListener("pagehide",this.onLeavePiP)}stopObserving(){var e,A,n,i,r;(e=Sd())===null||e===void 0||e.unobserve(this.element),(A=Ed())===null||A===void 0||A.unobserve(this.element),this.element.removeEventListener("enterpictureinpicture",this.onEnterPiP),this.element.removeEventListener("leavepictureinpicture",this.onLeavePiP),(n=window.documentPictureInPicture)===null||n===void 0||n.removeEventListener("enter",this.onEnterPiP),(r=(i=window.documentPictureInPicture)===null||i===void 0?void 0:i.window)===null||r===void 0||r.removeEventListener("pagehide",this.onLeavePiP)}}function In(t){var e,A;return document.pictureInPictureElement===t?!0:!((e=window.documentPictureInPicture)===null||e===void 0)&&e.window?Ga(t,(A=window.documentPictureInPicture)===null||A===void 0?void 0:A.window):!1}function Ga(t,e){const A=e||window;let n=t.offsetTop,i=t.offsetLeft;const r=t.offsetWidth,s=t.offsetHeight,{hidden:a}=t,{display:o}=getComputedStyle(t);for(;t.offsetParent;)t=t.offsetParent,n+=t.offsetTop,i+=t.offsetLeft;return n<A.pageYOffset+A.innerHeight&&i<A.pageXOffset+A.innerWidth&&n+s>A.pageYOffset&&i+r>A.pageXOffset&&!a&&o!=="none"}class _A extends yA.EventEmitter{constructor(e,A,n,i){var r;super(),this.metadataMuted=!1,this.encryption=qe.NONE,this.log=W,this.handleMuted=()=>{this.emit(_.Muted)},this.handleUnmuted=()=>{this.emit(_.Unmuted)},this.log=FA((r=i==null?void 0:i.loggerName)!==null&&r!==void 0?r:lA.Publication),this.loggerContextCb=this.loggerContextCb,this.setMaxListeners(100),this.kind=e,this.trackSid=A,this.trackName=n,this.source=T.Source.Unknown}setTrack(e){this.track&&(this.track.off(_.Muted,this.handleMuted),this.track.off(_.Unmuted,this.handleUnmuted)),this.track=e,e&&(e.on(_.Muted,this.handleMuted),e.on(_.Unmuted,this.handleUnmuted))}get logContext(){var e;return Object.assign(Object.assign({},(e=this.loggerContextCb)===null||e===void 0?void 0:e.call(this)),z(this))}get isMuted(){return this.metadataMuted}get isEnabled(){return!0}get isSubscribed(){return this.track!==void 0}get isEncrypted(){return this.encryption!==qe.NONE}get audioTrack(){if(xA(this.track))return this.track}get videoTrack(){if(Wt(this.track))return this.track}updateInfo(e){this.trackSid=e.sid,this.trackName=e.name,this.source=T.sourceFromProto(e.source),this.mimeType=e.mimeType,this.kind===T.Kind.Video&&e.width>0&&(this.dimensions={width:e.width,height:e.height},this.simulcasted=e.simulcast),this.encryption=e.encryption,this.trackInfo=e,this.log.debug("update publication info",Object.assign(Object.assign({},this.logContext),{info:e}))}}(function(t){(function(e){e.Desired="desired",e.Subscribed="subscribed",e.Unsubscribed="unsubscribed"})(t.SubscriptionStatus||(t.SubscriptionStatus={})),function(e){e.Allowed="allowed",e.NotAllowed="not_allowed"}(t.PermissionStatus||(t.PermissionStatus={}))})(_A||(_A={}));class ja extends _A{get isUpstreamPaused(){var e;return(e=this.track)===null||e===void 0?void 0:e.isUpstreamPaused}constructor(e,A,n,i){super(e,A.sid,A.name,i),this.track=void 0,this.handleTrackEnded=()=>{this.emit(_.Ended)},this.updateInfo(A),this.setTrack(n)}setTrack(e){this.track&&this.track.off(_.Ended,this.handleTrackEnded),super.setTrack(e),e&&e.on(_.Ended,this.handleTrackEnded)}get isMuted(){return this.track?this.track.isMuted:super.isMuted}get audioTrack(){return super.audioTrack}get videoTrack(){return super.videoTrack}get isLocal(){return!0}mute(){return v(this,void 0,void 0,function*(){var e;return(e=this.track)===null||e===void 0?void 0:e.mute()})}unmute(){return v(this,void 0,void 0,function*(){var e;return(e=this.track)===null||e===void 0?void 0:e.unmute()})}pauseUpstream(){return v(this,void 0,void 0,function*(){var e;yield(e=this.track)===null||e===void 0?void 0:e.pauseUpstream()})}resumeUpstream(){return v(this,void 0,void 0,function*(){var e;yield(e=this.track)===null||e===void 0?void 0:e.resumeUpstream()})}getTrackFeatures(){var e;if(xA(this.track)){const A=this.track.getSourceTrackSettings(),n=new Set;return A.autoGainControl&&n.add(oA.TF_AUTO_GAIN_CONTROL),A.echoCancellation&&n.add(oA.TF_ECHO_CANCELLATION),A.noiseSuppression&&n.add(oA.TF_NOISE_SUPPRESSION),A.channelCount&&A.channelCount>1&&n.add(oA.TF_STEREO),!((e=this.options)===null||e===void 0)&&e.dtx||n.add(oA.TF_NO_DTX),this.track.enhancedNoiseCancellation&&n.add(oA.TF_ENHANCED_NOISE_CANCELLATION),Array.from(n.values())}else return[]}}function gr(t,e){return v(this,void 0,void 0,function*(){t??(t={});let A=!1;const{audioProcessor:n,videoProcessor:i,optionsWithoutProcessor:r}=Pd(t);let s=r.audio,a=r.video;if(n&&typeof r.audio=="object"&&(r.audio.processor=n),i&&typeof r.video=="object"&&(r.video.processor=i),t.audio&&typeof r.audio=="object"&&typeof r.audio.deviceId=="string"){const u=r.audio.deviceId;r.audio.deviceId={exact:u},A=!0,s=Object.assign(Object.assign({},r.audio),{deviceId:{ideal:u}})}if(r.video&&typeof r.video=="object"&&typeof r.video.deviceId=="string"){const u=r.video.deviceId;r.video.deviceId={exact:u},A=!0,a=Object.assign(Object.assign({},r.video),{deviceId:{ideal:u}})}(r.audio===!0||typeof r.audio=="object"&&!r.audio.deviceId)&&(r.audio={deviceId:"default"}),r.video===!0?r.video={deviceId:"default"}:typeof r.video=="object"&&!r.video.deviceId&&(r.video.deviceId="default");const o=Fd(r,Gd,jd),c=Ea(o),l=navigator.mediaDevices.getUserMedia(c);r.audio&&(Qe.userMediaPromiseMap.set("audioinput",l),l.catch(()=>Qe.userMediaPromiseMap.delete("audioinput"))),r.video&&(Qe.userMediaPromiseMap.set("videoinput",l),l.catch(()=>Qe.userMediaPromiseMap.delete("videoinput")));try{const u=yield l;return yield Promise.all(u.getTracks().map(d=>v(this,void 0,void 0,function*(){const h=d.kind==="audio";let g=h?o.audio:o.video;(typeof g=="boolean"||!g)&&(g={});let f;const m=h?c.audio:c.video;typeof m!="boolean"&&(f=m);const B=d.getSettings().deviceId;f!=null&&f.deviceId&&$A(f.deviceId)!==B?f.deviceId=B:f||(f={deviceId:B});const b=kb(d,f,e);return b.kind===T.Kind.Video?b.source=T.Source.Camera:b.kind===T.Kind.Audio&&(b.source=T.Source.Microphone),b.mediaStream=u,xA(b)&&n?yield b.setProcessor(n):Wt(b)&&i&&(yield b.setProcessor(i)),b})))}catch(u){if(!A)throw u;return gr(Object.assign(Object.assign({},t),{audio:s,video:a}),e)}})}function Zb(t){return v(this,void 0,void 0,function*(){return(yield gr({audio:!1,video:t??!0}))[0]})}function $b(t){return v(this,void 0,void 0,function*(){return(yield gr({audio:t??!0,video:!1}))[0]})}var tt;(function(t){t.Excellent="excellent",t.Good="good",t.Poor="poor",t.Lost="lost",t.Unknown="unknown"})(tt||(tt={}));function ey(t){switch(t){case yn.EXCELLENT:return tt.Excellent;case yn.GOOD:return tt.Good;case yn.POOR:return tt.Poor;case yn.LOST:return tt.Lost;default:return tt.Unknown}}class rh extends yA.EventEmitter{get logContext(){var e,A;return Object.assign({},(A=(e=this.loggerOptions)===null||e===void 0?void 0:e.loggerContextCb)===null||A===void 0?void 0:A.call(e))}get isEncrypted(){return this.trackPublications.size>0&&Array.from(this.trackPublications.values()).every(e=>e.isEncrypted)}get isAgent(){var e;return((e=this.permissions)===null||e===void 0?void 0:e.agent)||this.kind===Ji.AGENT}get isActive(){var e;return((e=this.participantInfo)===null||e===void 0?void 0:e.state)===Ht.ACTIVE}get kind(){return this._kind}get attributes(){return Object.freeze(Object.assign({},this._attributes))}constructor(e,A,n,i,r,s){let a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:Ji.STANDARD;var o;super(),this.audioLevel=0,this.isSpeaking=!1,this._connectionQuality=tt.Unknown,this.log=W,this.log=FA((o=s==null?void 0:s.loggerName)!==null&&o!==void 0?o:lA.Participant),this.loggerOptions=s,this.setMaxListeners(100),this.sid=e,this.identity=A,this.name=n,this.metadata=i,this.audioTrackPublications=new Map,this.videoTrackPublications=new Map,this.trackPublications=new Map,this._kind=a,this._attributes=r??{}}getTrackPublications(){return Array.from(this.trackPublications.values())}getTrackPublication(e){for(const[,A]of this.trackPublications)if(A.source===e)return A}getTrackPublicationByName(e){for(const[,A]of this.trackPublications)if(A.trackName===e)return A}waitUntilActive(){return this.isActive?Promise.resolve():this.activeFuture?this.activeFuture.promise:(this.activeFuture=new wa,this.once(D.Active,()=>{var e,A;(A=(e=this.activeFuture)===null||e===void 0?void 0:e.resolve)===null||A===void 0||A.call(e),this.activeFuture=void 0}),this.activeFuture.promise)}get connectionQuality(){return this._connectionQuality}get isCameraEnabled(){var e;const A=this.getTrackPublication(T.Source.Camera);return!(!((e=A==null?void 0:A.isMuted)!==null&&e!==void 0)||e)}get isMicrophoneEnabled(){var e;const A=this.getTrackPublication(T.Source.Microphone);return!(!((e=A==null?void 0:A.isMuted)!==null&&e!==void 0)||e)}get isScreenShareEnabled(){return!!this.getTrackPublication(T.Source.ScreenShare)}get isLocal(){return!1}get joinedAt(){return this.participantInfo?new Date(Number.parseInt(this.participantInfo.joinedAt.toString())*1e3):new Date}updateInfo(e){var A;return this.participantInfo&&this.participantInfo.sid===e.sid&&this.participantInfo.version>e.version?!1:(this.identity=e.identity,this.sid=e.sid,this._setName(e.name),this._setMetadata(e.metadata),this._setAttributes(e.attributes),e.state===Ht.ACTIVE&&((A=this.participantInfo)===null||A===void 0?void 0:A.state)!==Ht.ACTIVE&&this.emit(D.Active),e.permission&&this.setPermissions(e.permission),this.participantInfo=e,!0)}_setMetadata(e){const A=this.metadata!==e,n=this.metadata;this.metadata=e,A&&this.emit(D.ParticipantMetadataChanged,n)}_setName(e){const A=this.name!==e;this.name=e,A&&this.emit(D.ParticipantNameChanged,e)}_setAttributes(e){const A=ob(this.attributes,e);this._attributes=e,Object.keys(A).length>0&&this.emit(D.AttributesChanged,A)}setPermissions(e){var A,n,i,r,s,a;const o=this.permissions,c=e.canPublish!==((A=this.permissions)===null||A===void 0?void 0:A.canPublish)||e.canSubscribe!==((n=this.permissions)===null||n===void 0?void 0:n.canSubscribe)||e.canPublishData!==((i=this.permissions)===null||i===void 0?void 0:i.canPublishData)||e.hidden!==((r=this.permissions)===null||r===void 0?void 0:r.hidden)||e.recorder!==((s=this.permissions)===null||s===void 0?void 0:s.recorder)||e.canPublishSources.length!==this.permissions.canPublishSources.length||e.canPublishSources.some((l,u)=>{var d;return l!==((d=this.permissions)===null||d===void 0?void 0:d.canPublishSources[u])})||e.canSubscribeMetrics!==((a=this.permissions)===null||a===void 0?void 0:a.canSubscribeMetrics);return this.permissions=e,c&&this.emit(D.ParticipantPermissionsChanged,o),c}setIsSpeaking(e){e!==this.isSpeaking&&(this.isSpeaking=e,e&&(this.lastSpokeAt=new Date),this.emit(D.IsSpeakingChanged,e))}setConnectionQuality(e){const A=this._connectionQuality;this._connectionQuality=ey(e),A!==this._connectionQuality&&this.emit(D.ConnectionQualityChanged,this._connectionQuality)}setDisconnected(){var e,A;this.activeFuture&&((A=(e=this.activeFuture).reject)===null||A===void 0||A.call(e,new Error("Participant disconnected")),this.activeFuture=void 0)}setAudioContext(e){this.audioContext=e,this.audioTrackPublications.forEach(A=>xA(A.track)&&A.track.setAudioContext(e))}addTrackPublication(e){e.on(_.Muted,()=>{this.emit(D.TrackMuted,e)}),e.on(_.Unmuted,()=>{this.emit(D.TrackUnmuted,e)});const A=e;switch(A.track&&(A.track.sid=e.trackSid),this.trackPublications.set(e.trackSid,e),e.kind){case T.Kind.Audio:this.audioTrackPublications.set(e.trackSid,e);break;case T.Kind.Video:this.videoTrackPublications.set(e.trackSid,e);break}}}function Ay(t){var e,A,n;if(!t.participantSid&&!t.participantIdentity)throw new Error("Invalid track permission, must provide at least one of participantIdentity and participantSid");return new yu({participantIdentity:(e=t.participantIdentity)!==null&&e!==void 0?e:"",participantSid:(A=t.participantSid)!==null&&A!==void 0?A:"",allTracks:(n=t.allowAll)!==null&&n!==void 0?n:!1,trackSids:t.allowedTrackSids||[]})}const sh=15e3;class ty extends rh{constructor(e,A,n,i,r){super(e,A,void 0,void 0,void 0,{loggerName:i.loggerName,loggerContextCb:()=>this.engine.logContext}),this.pendingPublishing=new Set,this.pendingPublishPromises=new Map,this.participantTrackPermissions=[],this.allParticipantsAllowedToSubscribe=!0,this.encryptionType=qe.NONE,this.enabledPublishVideoCodecs=[],this.pendingAcks=new Map,this.pendingResponses=new Map,this.handleReconnecting=()=>{this.reconnectFuture||(this.reconnectFuture=new wa)},this.handleReconnected=()=>{var s,a;(a=(s=this.reconnectFuture)===null||s===void 0?void 0:s.resolve)===null||a===void 0||a.call(s),this.reconnectFuture=void 0,this.updateTrackSubscriptionPermissions()},this.handleDisconnected=()=>{var s,a;this.reconnectFuture&&(this.reconnectFuture.promise.catch(o=>this.log.warn(o.message,this.logContext)),(a=(s=this.reconnectFuture)===null||s===void 0?void 0:s.reject)===null||a===void 0||a.call(s,"Got disconnected during reconnection attempt"),this.reconnectFuture=void 0)},this.handleSignalRequestResponse=s=>{const{requestId:a,reason:o,message:c}=s,l=this.pendingSignalRequests.get(a);l&&(o!==qs.OK&&l.reject(new Bd(c,o)),this.pendingSignalRequests.delete(a))},this.handleDataPacket=s=>{switch(s.value.case){case"rpcResponse":let a=s.value.value,o=null,c=null;a.value.case==="payload"?o=a.value.value:a.value.case==="error"&&(c=de.fromProto(a.value.value)),this.handleIncomingRpcResponse(a.requestId,o,c);break;case"rpcAck":let l=s.value.value;this.handleIncomingRpcAck(l.requestId);break}},this.updateTrackSubscriptionPermissions=()=>{this.log.debug("updating track subscription permissions",Object.assign(Object.assign({},this.logContext),{allParticipantsAllowed:this.allParticipantsAllowedToSubscribe,participantTrackPermissions:this.participantTrackPermissions})),this.engine.client.sendUpdateSubscriptionPermissions(this.allParticipantsAllowedToSubscribe,this.participantTrackPermissions.map(s=>Ay(s)))},this.onTrackUnmuted=s=>{this.onTrackMuted(s,s.isUpstreamPaused)},this.onTrackMuted=(s,a)=>{if(a===void 0&&(a=!0),!s.sid){this.log.error("could not update mute status for unpublished track",Object.assign(Object.assign({},this.logContext),z(s)));return}this.engine.updateMuteStatus(s.sid,a)},this.onTrackUpstreamPaused=s=>{this.log.debug("upstream paused",Object.assign(Object.assign({},this.logContext),z(s))),this.onTrackMuted(s,!0)},this.onTrackUpstreamResumed=s=>{this.log.debug("upstream resumed",Object.assign(Object.assign({},this.logContext),z(s))),this.onTrackMuted(s,s.isMuted)},this.onTrackFeatureUpdate=s=>{const a=this.audioTrackPublications.get(s.sid);if(!a){this.log.warn("Could not update local audio track settings, missing publication for track ".concat(s.sid),this.logContext);return}this.engine.client.sendUpdateLocalAudioTrack(a.trackSid,a.getTrackFeatures())},this.handleSubscribedQualityUpdate=s=>v(this,void 0,void 0,function*(){var a,o,c,l,u,d;if(!(!((u=this.roomOptions)===null||u===void 0)&&u.dynacast))return;const h=this.videoTrackPublications.get(s.trackSid);if(!h){this.log.warn("received subscribed quality update for unknown track",Object.assign(Object.assign({},this.logContext),{trackSid:s.trackSid}));return}if(s.subscribedCodecs.length>0){if(!h.videoTrack)return;const B=yield h.videoTrack.setPublishingCodecs(s.subscribedCodecs);try{for(var g=!0,f=XA(B),m;m=yield f.next(),a=m.done,!a;g=!0){l=m.value,g=!1;const b=l;Mw(b)&&(this.log.debug("publish ".concat(b," for ").concat(h.videoTrack.sid),Object.assign(Object.assign({},this.logContext),z(h))),yield this.publishAdditionalCodecForTrack(h.videoTrack,b,h.options))}}catch(b){o={error:b}}finally{try{!g&&!a&&(c=f.return)&&(yield c.call(f))}finally{if(o)throw o.error}}}else s.subscribedQualities.length>0&&(yield(d=h.videoTrack)===null||d===void 0?void 0:d.setPublishingLayers(s.subscribedQualities))}),this.handleLocalTrackUnpublished=s=>{const a=this.trackPublications.get(s.trackSid);if(!a){this.log.warn("received unpublished event for unknown track",Object.assign(Object.assign({},this.logContext),{trackSid:s.trackSid}));return}this.unpublishTrack(a.track)},this.handleTrackEnded=s=>v(this,void 0,void 0,function*(){if(s.source===T.Source.ScreenShare||s.source===T.Source.ScreenShareAudio)this.log.debug("unpublishing local track due to TrackEnded",Object.assign(Object.assign({},this.logContext),z(s))),this.unpublishTrack(s);else if(s.isUserProvided)yield s.mute();else if(vt(s)||et(s))try{if(Ve())try{const a=yield navigator==null?void 0:navigator.permissions.query({name:s.source===T.Source.Camera?"camera":"microphone"});if(a&&a.state==="denied")throw this.log.warn("user has revoked access to ".concat(s.source),Object.assign(Object.assign({},this.logContext),z(s))),a.onchange=()=>{a.state!=="denied"&&(s.isMuted||s.restartTrack(),a.onchange=null)},new Error("GetUserMedia Permission denied")}catch{}s.isMuted||(this.log.debug("track ended, attempting to use a different device",Object.assign(Object.assign({},this.logContext),z(s))),vt(s)?yield s.restartTrack({deviceId:"default"}):yield s.restartTrack())}catch{this.log.warn("could not restart track, muting instead",Object.assign(Object.assign({},this.logContext),z(s))),yield s.mute()}}),this.audioTrackPublications=new Map,this.videoTrackPublications=new Map,this.trackPublications=new Map,this.engine=n,this.roomOptions=i,this.setupEngine(n),this.activeDeviceMap=new Map([["audioinput","default"],["videoinput","default"],["audiooutput","default"]]),this.pendingSignalRequests=new Map,this.rpcHandlers=r}get lastCameraError(){return this.cameraError}get lastMicrophoneError(){return this.microphoneError}get isE2EEEnabled(){return this.encryptionType!==qe.NONE}getTrackPublication(e){const A=super.getTrackPublication(e);if(A)return A}getTrackPublicationByName(e){const A=super.getTrackPublicationByName(e);if(A)return A}setupEngine(e){this.engine=e,this.engine.on(P.RemoteMute,(A,n)=>{const i=this.trackPublications.get(A);!i||!i.track||(n?i.mute():i.unmute())}),this.engine.on(P.Connected,this.handleReconnected).on(P.SignalRestarted,this.handleReconnected).on(P.SignalResumed,this.handleReconnected).on(P.Restarting,this.handleReconnecting).on(P.Resuming,this.handleReconnecting).on(P.LocalTrackUnpublished,this.handleLocalTrackUnpublished).on(P.SubscribedQualityUpdate,this.handleSubscribedQualityUpdate).on(P.Disconnected,this.handleDisconnected).on(P.SignalRequestResponse,this.handleSignalRequestResponse).on(P.DataPacketReceived,this.handleDataPacket)}setMetadata(e){return v(this,void 0,void 0,function*(){yield this.requestMetadataUpdate({metadata:e})})}setName(e){return v(this,void 0,void 0,function*(){yield this.requestMetadataUpdate({name:e})})}setAttributes(e){return v(this,void 0,void 0,function*(){yield this.requestMetadataUpdate({attributes:e})})}requestMetadataUpdate(e){return v(this,arguments,void 0,function(A){var n=this;let{metadata:i,name:r,attributes:s}=A;return function*(){return new Promise((a,o)=>v(n,void 0,void 0,function*(){var c,l;try{let u=!1;const d=yield this.engine.client.sendUpdateLocalMetadata((c=i??this.metadata)!==null&&c!==void 0?c:"",(l=r??this.name)!==null&&l!==void 0?l:"",s),h=performance.now();for(this.pendingSignalRequests.set(d,{resolve:a,reject:g=>{o(g),u=!0},values:{name:r,metadata:i,attributes:s}});performance.now()-h<5e3&&!u;){if((!r||this.name===r)&&(!i||this.metadata===i)&&(!s||Object.entries(s).every(g=>{let[f,m]=g;return this.attributes[f]===m||m===""&&!this.attributes[f]}))){this.pendingSignalRequests.delete(d),a();return}yield Ke(50)}o(new Bd("Request to update local metadata timed out","TimeoutError"))}catch(u){u instanceof Error&&o(u)}}))}()})}setCameraEnabled(e,A,n){return this.setTrackEnabled(T.Source.Camera,e,A,n)}setMicrophoneEnabled(e,A,n){return this.setTrackEnabled(T.Source.Microphone,e,A,n)}setScreenShareEnabled(e,A,n){return this.setTrackEnabled(T.Source.ScreenShare,e,A,n)}setPermissions(e){const A=this.permissions,n=super.setPermissions(e);return n&&A&&this.emit(D.ParticipantPermissionsChanged,A),n}setE2EEEnabled(e){return v(this,void 0,void 0,function*(){this.encryptionType=e?qe.GCM:qe.NONE,yield this.republishAllTracks(void 0,!1)})}setTrackEnabled(e,A,n,i){return v(this,void 0,void 0,function*(){var r,s;this.log.debug("setTrackEnabled",Object.assign(Object.assign({},this.logContext),{source:e,enabled:A})),this.republishPromise&&(yield this.republishPromise);let a=this.getTrackPublication(e);if(A)if(a)yield a.unmute();else{let o;if(this.pendingPublishing.has(e)){const c=yield this.waitForPendingPublicationOfSource(e);return c||this.log.info("waiting for pending publication promise timed out",Object.assign(Object.assign({},this.logContext),{source:e})),yield c==null?void 0:c.unmute(),c}this.pendingPublishing.add(e);try{switch(e){case T.Source.Camera:o=yield this.createTracks({video:(r=n)!==null&&r!==void 0?r:!0});break;case T.Source.Microphone:o=yield this.createTracks({audio:(s=n)!==null&&s!==void 0?s:!0});break;case T.Source.ScreenShare:o=yield this.createScreenTracks(Object.assign({},n));break;default:throw new IA(e)}}catch(c){throw o==null||o.forEach(l=>{l.stop()}),c instanceof Error&&this.emit(D.MediaDevicesError,c),this.pendingPublishing.delete(e),c}try{const c=[];for(const u of o)this.log.info("publishing track",Object.assign(Object.assign({},this.logContext),z(u))),c.push(this.publishTrack(u,i));[a]=yield Promise.all(c)}catch(c){throw o==null||o.forEach(l=>{l.stop()}),c}finally{this.pendingPublishing.delete(e)}}else if(!(a!=null&&a.track)&&this.pendingPublishing.has(e)&&(a=yield this.waitForPendingPublicationOfSource(e),a||this.log.info("waiting for pending publication promise timed out",Object.assign(Object.assign({},this.logContext),{source:e}))),a&&a.track)if(e===T.Source.ScreenShare){a=yield this.unpublishTrack(a.track);const o=this.getTrackPublication(T.Source.ScreenShareAudio);o&&o.track&&this.unpublishTrack(o.track)}else yield a.mute();return a})}enableCameraAndMicrophone(){return v(this,void 0,void 0,function*(){if(!(this.pendingPublishing.has(T.Source.Camera)||this.pendingPublishing.has(T.Source.Microphone))){this.pendingPublishing.add(T.Source.Camera),this.pendingPublishing.add(T.Source.Microphone);try{const e=yield this.createTracks({audio:!0,video:!0});yield Promise.all(e.map(A=>this.publishTrack(A)))}finally{this.pendingPublishing.delete(T.Source.Camera),this.pendingPublishing.delete(T.Source.Microphone)}}})}createTracks(e){return v(this,void 0,void 0,function*(){var A,n;e??(e={});const i=Fd(e,(A=this.roomOptions)===null||A===void 0?void 0:A.audioCaptureDefaults,(n=this.roomOptions)===null||n===void 0?void 0:n.videoCaptureDefaults);try{return(yield gr(i,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext})).map(a=>(xA(a)&&(this.microphoneError=void 0,a.setAudioContext(this.audioContext),a.source=T.Source.Microphone,this.emit(D.AudioStreamAcquired)),Wt(a)&&(this.cameraError=void 0,a.source=T.Source.Camera),a))}catch(r){throw r instanceof Error&&(e.audio&&(this.microphoneError=r),e.video&&(this.cameraError=r)),r}})}createScreenTracks(e){return v(this,void 0,void 0,function*(){if(e===void 0&&(e={}),navigator.mediaDevices.getDisplayMedia===void 0)throw new sa("getDisplayMedia not supported");e.resolution===void 0&&!Ww()&&(e.resolution=ha.h1080fps30.resolution);const A=rb(e),n=yield navigator.mediaDevices.getDisplayMedia(A),i=n.getVideoTracks();if(i.length===0)throw new IA("no video track found");const r=new fr(i[0],void 0,!1,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});r.source=T.Source.ScreenShare,e.contentHint&&(r.mediaStreamTrack.contentHint=e.contentHint);const s=[r];if(n.getAudioTracks().length>0){this.emit(D.AudioStreamAcquired);const a=new dr(n.getAudioTracks()[0],void 0,!1,this.audioContext,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});a.source=T.Source.ScreenShareAudio,s.push(a)}return s})}publishTrack(e,A){return v(this,void 0,void 0,function*(){return this.publishOrRepublishTrack(e,A)})}publishOrRepublishTrack(e,A){return v(this,arguments,void 0,function(n,i){var r=this;let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return function*(){var a,o,c,l;vt(n)&&n.setAudioContext(r.audioContext),yield(a=r.reconnectFuture)===null||a===void 0?void 0:a.promise,r.republishPromise&&!s&&(yield r.republishPromise),jt(n)&&r.pendingPublishPromises.has(n)&&(yield r.pendingPublishPromises.get(n));let u;if(n instanceof MediaStreamTrack)u=n.getConstraints();else{u=n.constraints;let B;switch(n.source){case T.Source.Microphone:B="audioinput";break;case T.Source.Camera:B="videoinput"}B&&r.activeDeviceMap.has(B)&&(u=Object.assign(Object.assign({},u),{deviceId:r.activeDeviceMap.get(B)}))}if(n instanceof MediaStreamTrack)switch(n.kind){case"audio":n=new dr(n,u,!0,r.audioContext,{loggerName:r.roomOptions.loggerName,loggerContextCb:()=>r.logContext});break;case"video":n=new fr(n,u,!0,{loggerName:r.roomOptions.loggerName,loggerContextCb:()=>r.logContext});break;default:throw new IA("unsupported MediaStreamTrack kind ".concat(n.kind))}else n.updateLoggerOptions({loggerName:r.roomOptions.loggerName,loggerContextCb:()=>r.logContext});let d;if(r.trackPublications.forEach(B=>{B.track&&B.track===n&&(d=B)}),d)return r.log.warn("track has already been published, skipping",Object.assign(Object.assign({},r.logContext),z(d))),d;const h="channelCount"in n.mediaStreamTrack.getSettings()&&n.mediaStreamTrack.getSettings().channelCount===2||n.mediaStreamTrack.getConstraints().channelCount===2,g=(o=i==null?void 0:i.forceStereo)!==null&&o!==void 0?o:h;g&&(i||(i={}),i.dtx===void 0&&r.log.info("Opus DTX will be disabled for stereo tracks by default. Enable them explicitly to make it work.",Object.assign(Object.assign({},r.logContext),z(n))),i.red===void 0&&r.log.info("Opus RED will be disabled for stereo tracks by default. Enable them explicitly to make it work."),(c=i.dtx)!==null&&c!==void 0||(i.dtx=!1),(l=i.red)!==null&&l!==void 0||(i.red=!1));const f=Object.assign(Object.assign({},r.roomOptions.publishDefaults),i);!Jw()&&r.roomOptions.e2ee&&(r.log.info("End-to-end encryption is set up, simulcast publishing will be disabled on Safari versions and iOS browsers running iOS < v17.2",Object.assign({},r.logContext)),f.simulcast=!1),f.source&&(n.source=f.source);const m=new Promise((B,b)=>v(r,void 0,void 0,function*(){try{if(this.engine.client.currentState!==ie.CONNECTED){this.log.debug("deferring track publication until signal is connected",Object.assign(Object.assign({},this.logContext),{track:z(n)}));const U=()=>v(this,void 0,void 0,function*(){try{const C=yield this.publish(n,f,g);B(C)}catch(C){b(C)}});setTimeout(()=>{this.engine.off(P.SignalConnected,U),b(new oa("publishing rejected as engine not connected within timeout",408))},15e3),this.engine.once(P.SignalConnected,U),this.engine.on(P.Closing,()=>{this.engine.off(P.SignalConnected,U),b(new oa("publishing rejected as engine closed",499))})}else try{const U=yield this.publish(n,f,g);B(U)}catch(U){b(U)}}catch(U){b(U)}}));r.pendingPublishPromises.set(n,m);try{return yield m}catch(B){throw B}finally{r.pendingPublishPromises.delete(n)}}()})}hasPermissionsToPublish(e){if(!this.permissions)return this.log.warn("no permissions present for publishing track",Object.assign(Object.assign({},this.logContext),z(e))),!1;const{canPublish:A,canPublishSources:n}=this.permissions;return A&&(n.length===0||n.map(i=>cb(i)).includes(e.source))?!0:(this.log.warn("insufficient permissions to publish",Object.assign(Object.assign({},this.logContext),z(e))),!1)}publish(e,A,n){return v(this,void 0,void 0,function*(){var i,r,s,a,o,c,l,u,d,h;if(!this.hasPermissionsToPublish(e))throw new oa("failed to publish track, insufficient permissions",403);Array.from(this.trackPublications.values()).find(w=>jt(e)&&w.source===e.source)&&e.source!==T.Source.Unknown&&this.log.info("publishing a second track with the same source: ".concat(e.source),Object.assign(Object.assign({},this.logContext),z(e))),A.stopMicTrackOnMute&&xA(e)&&(e.stopOnMute=!0),e.source===T.Source.ScreenShare&&Gt()&&(A.simulcast=!1),A.videoCodec==="av1"&&!Vw()&&(A.videoCodec=void 0),A.videoCodec==="vp9"&&!Gw()&&(A.videoCodec=void 0),A.videoCodec===void 0&&(A.videoCodec=Pa),this.enabledPublishVideoCodecs.length>0&&(this.enabledPublishVideoCodecs.some(w=>A.videoCodec===cr(w.mime))||(A.videoCodec=cr(this.enabledPublishVideoCodecs[0].mime)));const f=A.videoCodec;e.on(_.Muted,this.onTrackMuted),e.on(_.Unmuted,this.onTrackUnmuted),e.on(_.Ended,this.handleTrackEnded),e.on(_.UpstreamPaused,this.onTrackUpstreamPaused),e.on(_.UpstreamResumed,this.onTrackUpstreamResumed),e.on(_.AudioTrackFeatureUpdate,this.onTrackFeatureUpdate);const m=new Gs({cid:e.mediaStreamTrack.id,name:A.name,type:T.kindToProto(e.kind),muted:e.isMuted,source:T.sourceToProto(e.source),disableDtx:!(!((i=A.dtx)!==null&&i!==void 0)||i),encryption:this.encryptionType,stereo:n,disableRed:this.isE2EEEnabled||!(!((r=A.red)!==null&&r!==void 0)||r),stream:A==null?void 0:A.stream,backupCodecPolicy:A==null?void 0:A.backupCodecPolicy});let B;if(e.kind===T.Kind.Video){let w={width:0,height:0};try{w=yield e.waitForDimensions()}catch{const E=(a=(s=this.roomOptions.videoCaptureDefaults)===null||s===void 0?void 0:s.resolution)!==null&&a!==void 0?a:Sn.h720.resolution;w={width:E.width,height:E.height},this.log.error("could not determine track dimensions, using defaults",Object.assign(Object.assign(Object.assign({},this.logContext),z(e)),{dims:w}))}m.width=w.width,m.height=w.height,et(e)&&(kn(f)&&(e.source===T.Source.ScreenShare&&(A.scalabilityMode="L1T3","contentHint"in e.mediaStreamTrack&&(e.mediaStreamTrack.contentHint="motion",this.log.info("forcing contentHint to motion for screenshare with SVC codecs",Object.assign(Object.assign({},this.logContext),z(e))))),A.scalabilityMode=(o=A.scalabilityMode)!==null&&o!==void 0?o:"L3T3_KEY"),m.simulcastCodecs=[new Vs({codec:f,cid:e.mediaStreamTrack.id})],A.backupCodec===!0&&(A.backupCodec={codec:Pa}),A.backupCodec&&f!==A.backupCodec.codec&&m.encryption===qe.NONE&&(this.roomOptions.dynacast||(this.roomOptions.dynacast=!0),m.simulcastCodecs.push(new Vs({codec:A.backupCodec.codec,cid:""})))),B=Oa(e.source===T.Source.ScreenShare,m.width,m.height,A),m.layers=$d(m.width,m.height,B,kn(A.videoCodec))}else e.kind===T.Kind.Audio&&(B=[{maxBitrate:(c=A.audioPreset)===null||c===void 0?void 0:c.maxBitrate,priority:(u=(l=A.audioPreset)===null||l===void 0?void 0:l.priority)!==null&&u!==void 0?u:"high",networkPriority:(h=(d=A.audioPreset)===null||d===void 0?void 0:d.priority)!==null&&h!==void 0?h:"high"}]);if(!this.engine||this.engine.isClosed)throw new ye("cannot publish track when not connected");const b=()=>v(this,void 0,void 0,function*(){var w,y,E;if(!this.engine.pcManager)throw new ye("pcManager is not ready");if(e.sender=yield this.engine.createSender(e,A,B),et(e)&&((w=A.degradationPreference)!==null&&w!==void 0||(A.degradationPreference=Hb(e)),e.setDegradationPreference(A.degradationPreference)),B)if(Gt()&&e.kind===T.Kind.Audio){let F;for(const S of this.engine.pcManager.publisher.getTransceivers())if(S.sender===e.sender){F=S;break}F&&this.engine.pcManager.publisher.setTrackCodecBitrate({transceiver:F,codec:"opus",maxbr:!((y=B[0])===null||y===void 0)&&y.maxBitrate?B[0].maxBitrate/1e3:0})}else e.codec&&kn(e.codec)&&(!((E=B[0])===null||E===void 0)&&E.maxBitrate)&&this.engine.pcManager.publisher.setTrackCodecBitrate({cid:m.cid,codec:e.codec,maxbr:B[0].maxBitrate/1e3});yield this.engine.negotiate()});let U;if(this.enabledPublishVideoCodecs.length>0)U=(yield Promise.all([this.engine.addTrack(m),b()]))[0];else{U=yield this.engine.addTrack(m);let w;if(U.codecs.forEach(y=>{w===void 0&&(w=y.mimeType)}),w&&e.kind===T.Kind.Video){const y=cr(w);y!==f&&(this.log.debug("falling back to server selected codec",Object.assign(Object.assign(Object.assign({},this.logContext),z(e)),{codec:y})),A.videoCodec=y,B=Oa(e.source===T.Source.ScreenShare,m.width,m.height,A))}yield b()}const C=new ja(e.kind,U,e,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});return C.options=A,e.sid=U.sid,this.log.debug("publishing ".concat(e.kind," with encodings"),Object.assign(Object.assign({},this.logContext),{encodings:B,trackInfo:U})),et(e)?e.startMonitor(this.engine.client):vt(e)&&e.startMonitor(),this.addTrackPublication(C),this.emit(D.LocalTrackPublished,C),C})}get isLocal(){return!0}publishAdditionalCodecForTrack(e,A,n){return v(this,void 0,void 0,function*(){var i;if(this.encryptionType!==qe.NONE)return;let r;if(this.trackPublications.forEach(h=>{h.track&&h.track===e&&(r=h)}),!r)throw new IA("track is not published");if(!et(e))throw new IA("track is not a video track");const s=Object.assign(Object.assign({},(i=this.roomOptions)===null||i===void 0?void 0:i.publishDefaults),n),a=Rb(e,A,s);if(!a){this.log.info("backup codec has been disabled, ignoring request to add additional codec for track",Object.assign(Object.assign({},this.logContext),z(e)));return}const o=e.addSimulcastTrack(A,a);if(!o)return;const c=new Gs({cid:o.mediaStreamTrack.id,type:T.kindToProto(e.kind),muted:e.isMuted,source:T.sourceToProto(e.source),sid:e.sid,simulcastCodecs:[{codec:s.videoCodec,cid:o.mediaStreamTrack.id}]});if(c.layers=$d(c.width,c.height,a),!this.engine||this.engine.isClosed)throw new ye("cannot publish track when not connected");const l=()=>v(this,void 0,void 0,function*(){yield this.engine.createSimulcastSender(e,o,s,a),yield this.engine.negotiate()}),d=(yield Promise.all([this.engine.addTrack(c),l()]))[0];this.log.debug("published ".concat(A," for track ").concat(e.sid),Object.assign(Object.assign({},this.logContext),{encodings:a,trackInfo:d}))})}unpublishTrack(e,A){return v(this,void 0,void 0,function*(){var n,i;if(jt(e)){const c=this.pendingPublishPromises.get(e);c&&(this.log.info("awaiting publish promise before attempting to unpublish",Object.assign(Object.assign({},this.logContext),z(e))),yield c)}const r=this.getPublicationForTrack(e),s=r?z(r):void 0;if(this.log.debug("unpublishing track",Object.assign(Object.assign({},this.logContext),s)),!r||!r.track){this.log.warn("track was not unpublished because no publication was found",Object.assign(Object.assign({},this.logContext),s));return}e=r.track,e.off(_.Muted,this.onTrackMuted),e.off(_.Unmuted,this.onTrackUnmuted),e.off(_.Ended,this.handleTrackEnded),e.off(_.UpstreamPaused,this.onTrackUpstreamPaused),e.off(_.UpstreamResumed,this.onTrackUpstreamResumed),e.off(_.AudioTrackFeatureUpdate,this.onTrackFeatureUpdate),A===void 0&&(A=(i=(n=this.roomOptions)===null||n===void 0?void 0:n.stopLocalTrackOnUnpublish)!==null&&i!==void 0?i:!0),A?e.stop():e.stopMonitor();let a=!1;const o=e.sender;if(e.sender=void 0,this.engine.pcManager&&this.engine.pcManager.currentState<ue.FAILED&&o)try{for(const c of this.engine.pcManager.publisher.getTransceivers())c.sender===o&&(c.direction="inactive",a=!0);if(this.engine.removeTrack(o)&&(a=!0),et(e)){for(const[,c]of e.simulcastCodecs)c.sender&&(this.engine.removeTrack(c.sender)&&(a=!0),c.sender=void 0);e.simulcastCodecs.clear()}}catch(c){this.log.warn("failed to unpublish track",Object.assign(Object.assign(Object.assign({},this.logContext),s),{error:c}))}switch(this.trackPublications.delete(r.trackSid),r.kind){case T.Kind.Audio:this.audioTrackPublications.delete(r.trackSid);break;case T.Kind.Video:this.videoTrackPublications.delete(r.trackSid);break}return this.emit(D.LocalTrackUnpublished,r),r.setTrack(void 0),a&&(yield this.engine.negotiate()),r})}unpublishTracks(e){return v(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>this.unpublishTrack(n)))).filter(n=>!!n)})}republishAllTracks(e){return v(this,arguments,void 0,function(A){var n=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return function*(){n.republishPromise&&(yield n.republishPromise),n.republishPromise=new Promise((r,s)=>v(n,void 0,void 0,function*(){try{const a=[];this.trackPublications.forEach(o=>{o.track&&(A&&(o.options=Object.assign(Object.assign({},o.options),A)),a.push(o))}),yield Promise.all(a.map(o=>v(this,void 0,void 0,function*(){const c=o.track;yield this.unpublishTrack(c,!1),i&&!c.isMuted&&c.source!==T.Source.ScreenShare&&c.source!==T.Source.ScreenShareAudio&&(vt(c)||et(c))&&!c.isUserProvided&&(this.log.debug("restarting existing track",Object.assign(Object.assign({},this.logContext),{track:o.trackSid})),yield c.restartTrack()),yield this.publishOrRepublishTrack(c,o.options,!0)}))),r()}catch(a){s(a)}finally{this.republishPromise=void 0}})),yield n.republishPromise}()})}publishData(e){return v(this,arguments,void 0,function(A){var n=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){const r=i.reliable?X.RELIABLE:X.LOSSY,s=i.destinationIdentities,a=i.topic,o=new Ne({kind:r,value:{case:"user",value:new nu({participantIdentity:n.identity,payload:A,destinationIdentities:s,topic:a})}});yield n.engine.sendDataPacket(o,r)}()})}publishDtmf(e,A){return v(this,void 0,void 0,function*(){const n=new Ne({kind:X.RELIABLE,value:{case:"sipDtmf",value:new iu({code:e,digit:A})}});yield this.engine.sendDataPacket(n,X.RELIABLE)})}sendChatMessage(e,A){return v(this,void 0,void 0,function*(){const n={id:crypto.randomUUID(),message:e,timestamp:Date.now(),attachedFiles:A==null?void 0:A.attachments},i=new Ne({value:{case:"chatMessage",value:new Ds(Object.assign(Object.assign({},n),{timestamp:se.parse(n.timestamp)}))}});return yield this.engine.sendDataPacket(i,X.RELIABLE),this.emit(D.ChatMessage,n),n})}editChatMessage(e,A){return v(this,void 0,void 0,function*(){const n=Object.assign(Object.assign({},A),{message:e,editTimestamp:Date.now()}),i=new Ne({value:{case:"chatMessage",value:new Ds(Object.assign(Object.assign({},n),{timestamp:se.parse(n.timestamp),editTimestamp:se.parse(n.editTimestamp)}))}});return yield this.engine.sendDataPacket(i,X.RELIABLE),this.emit(D.ChatMessage,n),n})}sendText(e,A){return v(this,void 0,void 0,function*(){var n;const i=crypto.randomUUID(),s=new TextEncoder().encode(e).byteLength,a=(n=A==null?void 0:A.attachments)===null||n===void 0?void 0:n.map(()=>crypto.randomUUID()),o=new Array(a?a.length+1:1).fill(0),c=(u,d)=>{var h;o[d]=u;const g=o.reduce((f,m)=>f+m,0);(h=A==null?void 0:A.onProgress)===null||h===void 0||h.call(A,g)},l=yield this.streamText({streamId:i,totalSize:s,destinationIdentities:A==null?void 0:A.destinationIdentities,topic:A==null?void 0:A.topic,attachedStreamIds:a,attributes:A==null?void 0:A.attributes});return yield l.write(e),c(1,0),yield l.close(),A!=null&&A.attachments&&a&&(yield Promise.all(A.attachments.map((u,d)=>v(this,void 0,void 0,function*(){return this._sendFile(a[d],u,{topic:A.topic,mimeType:u.type,onProgress:h=>{c(h,d+1)}})})))),l.info})}streamText(e){return v(this,void 0,void 0,function*(){var A,n;const i=(A=e==null?void 0:e.streamId)!==null&&A!==void 0?A:crypto.randomUUID(),r={id:i,mimeType:"text/plain",timestamp:Date.now(),topic:(n=e==null?void 0:e.topic)!==null&&n!==void 0?n:"",size:e==null?void 0:e.totalSize,attributes:e==null?void 0:e.attributes},s=new Os({streamId:i,mimeType:r.mimeType,topic:r.topic,timestamp:Bt(r.timestamp),totalLength:Bt(e==null?void 0:e.totalSize),attributes:r.attributes,contentHeader:{case:"textHeader",value:new gu({version:e==null?void 0:e.version,attachedStreamIds:e==null?void 0:e.attachedStreamIds,replyToStreamId:e==null?void 0:e.replyToStreamId,operationType:(e==null?void 0:e.type)==="update"?Hs.UPDATE:Hs.CREATE})}}),a=e==null?void 0:e.destinationIdentities,o=new Ne({destinationIdentities:a,value:{case:"streamHeader",value:s}});yield this.engine.sendDataPacket(o,X.RELIABLE);let c=0;const l=this,u=new WritableStream({write(g){return v(this,void 0,void 0,function*(){for(const f of nb(g,sh)){yield l.engine.waitForBufferStatusLow(X.RELIABLE);const m=new Ms({content:f,streamId:i,chunkIndex:Bt(c)}),B=new Ne({destinationIdentities:a,value:{case:"streamChunk",value:m}});yield l.engine.sendDataPacket(B,X.RELIABLE),c+=1}})},close(){return v(this,void 0,void 0,function*(){const g=new Ns({streamId:i}),f=new Ne({destinationIdentities:a,value:{case:"streamTrailer",value:g}});yield l.engine.sendDataPacket(f,X.RELIABLE)})},abort(g){console.log("Sink error:",g)}});let d=()=>v(this,void 0,void 0,function*(){yield h.close()});l.engine.once(P.Closing,d);const h=new Jb(u,r,()=>this.engine.off(P.Closing,d));return h})}sendFile(e,A){return v(this,void 0,void 0,function*(){const n=crypto.randomUUID();return yield this._sendFile(n,e,A),{id:n}})}_sendFile(e,A,n){return v(this,void 0,void 0,function*(){var i;const r=yield this.streamBytes({streamId:e,totalSize:A.size,name:A.name,mimeType:(i=n==null?void 0:n.mimeType)!==null&&i!==void 0?i:A.type,topic:n==null?void 0:n.topic,destinationIdentities:n==null?void 0:n.destinationIdentities}),s=A.stream().getReader();for(;;){const{done:a,value:o}=yield s.read();if(a)break;yield r.write(o)}return yield r.close(),r.info})}streamBytes(e){return v(this,void 0,void 0,function*(){var A,n,i,r,s;const a=(A=e==null?void 0:e.streamId)!==null&&A!==void 0?A:crypto.randomUUID(),o=e==null?void 0:e.destinationIdentities,c={id:a,mimeType:(n=e==null?void 0:e.mimeType)!==null&&n!==void 0?n:"application/octet-stream",topic:(i=e==null?void 0:e.topic)!==null&&i!==void 0?i:"",timestamp:Date.now(),attributes:e==null?void 0:e.attributes,size:e==null?void 0:e.totalSize,name:(r=e==null?void 0:e.name)!==null&&r!==void 0?r:"unknown"},l=new Os({totalLength:Bt((s=c.size)!==null&&s!==void 0?s:0),mimeType:c.mimeType,streamId:a,topic:c.topic,timestamp:Bt(Date.now()),attributes:c.attributes,contentHeader:{case:"byteHeader",value:new pu({name:c.name})}}),u=new Ne({destinationIdentities:o,value:{case:"streamHeader",value:l}});yield this.engine.sendDataPacket(u,X.RELIABLE);let d=0;const h=new Oe,g=this.engine,f=this.log,m=new WritableStream({write(b){return v(this,void 0,void 0,function*(){const U=yield h.lock();let C=0;try{for(;C<b.byteLength;){const w=b.slice(C,C+sh);yield g.waitForBufferStatusLow(X.RELIABLE);const y=new Ne({destinationIdentities:o,value:{case:"streamChunk",value:new Ms({content:w,streamId:a,chunkIndex:Bt(d)})}});yield g.sendDataPacket(y,X.RELIABLE),d+=1,C+=w.byteLength}}finally{U()}})},close(){return v(this,void 0,void 0,function*(){const b=new Ns({streamId:a}),U=new Ne({destinationIdentities:o,value:{case:"streamTrailer",value:b}});yield g.sendDataPacket(U,X.RELIABLE)})},abort(b){f.error("Sink error:",b)}});return new Xb(m,c)})}performRpc(e){return v(this,arguments,void 0,function(A){var n=this;let{destinationIdentity:i,method:r,payload:s,responseTimeout:a=1e4}=A;return function*(){return new Promise((c,l)=>v(n,void 0,void 0,function*(){var u,d,h,g;if(La(s)>Wd){l(de.builtIn("REQUEST_PAYLOAD_TOO_LARGE"));return}if(!((d=(u=this.engine.latestJoinResponse)===null||u===void 0?void 0:u.serverInfo)===null||d===void 0)&&d.version&&mt((g=(h=this.engine.latestJoinResponse)===null||h===void 0?void 0:h.serverInfo)===null||g===void 0?void 0:g.version,"1.8.0")<0){l(de.builtIn("UNSUPPORTED_SERVER"));return}const f=crypto.randomUUID();yield this.publishRpcRequest(i,f,r,s,a-2e3);const m=setTimeout(()=>{this.pendingAcks.delete(f),l(de.builtIn("CONNECTION_TIMEOUT")),this.pendingResponses.delete(f),clearTimeout(B)},2e3);this.pendingAcks.set(f,{resolve:()=>{clearTimeout(m)},participantIdentity:i});const B=setTimeout(()=>{this.pendingResponses.delete(f),l(de.builtIn("RESPONSE_TIMEOUT"))},a);this.pendingResponses.set(f,{resolve:(b,U)=>{clearTimeout(B),this.pendingAcks.has(f)&&(console.warn("RPC response received before ack",f),this.pendingAcks.delete(f),clearTimeout(m)),U?l(U):c(b??"")},participantIdentity:i})}))}()})}registerRpcMethod(e,A){this.rpcHandlers.has(e)&&this.log.warn("you're overriding the RPC handler for method ".concat(e,", in the future this will throw an error")),this.rpcHandlers.set(e,A)}unregisterRpcMethod(e){this.rpcHandlers.delete(e)}setTrackSubscriptionPermissions(e){let A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];this.participantTrackPermissions=A,this.allParticipantsAllowedToSubscribe=e,this.engine.client.isDisconnected||this.updateTrackSubscriptionPermissions()}handleIncomingRpcAck(e){const A=this.pendingAcks.get(e);A?(A.resolve(),this.pendingAcks.delete(e)):console.error("Ack received for unexpected RPC request",e)}handleIncomingRpcResponse(e,A,n){const i=this.pendingResponses.get(e);i?(i.resolve(A,n),this.pendingResponses.delete(e)):console.error("Response received for unexpected RPC request",e)}publishRpcRequest(e,A,n,i,r){return v(this,void 0,void 0,function*(){const s=new Ne({destinationIdentities:[e],kind:X.RELIABLE,value:{case:"rpcRequest",value:new ru({id:A,method:n,payload:i,responseTimeoutMs:r,version:1})}});yield this.engine.sendDataPacket(s,X.RELIABLE)})}handleParticipantDisconnected(e){for(const[A,{participantIdentity:n}]of this.pendingAcks)n===e&&this.pendingAcks.delete(A);for(const[A,{participantIdentity:n,resolve:i}]of this.pendingResponses)n===e&&(i(null,de.builtIn("RECIPIENT_DISCONNECTED")),this.pendingResponses.delete(A))}setEnabledPublishCodecs(e){this.enabledPublishVideoCodecs=e.filter(A=>A.mime.split("/")[0].toLowerCase()==="video")}updateInfo(e){return super.updateInfo(e)?(e.tracks.forEach(A=>{var n,i;const r=this.trackPublications.get(A.sid);if(r){const s=r.isMuted||((i=(n=r.track)===null||n===void 0?void 0:n.isUpstreamPaused)!==null&&i!==void 0?i:!1);s!==A.muted&&(this.log.debug("updating server mute state after reconcile",Object.assign(Object.assign(Object.assign({},this.logContext),z(r)),{mutedOnServer:s})),this.engine.client.sendMuteTrack(A.sid,s))}}),!0):!1}getPublicationForTrack(e){let A;return this.trackPublications.forEach(n=>{const i=n.track;i&&(e instanceof MediaStreamTrack?(vt(i)||et(i))&&i.mediaStreamTrack===e&&(A=n):e===i&&(A=n))}),A}waitForPendingPublicationOfSource(e){return v(this,void 0,void 0,function*(){const n=Date.now();for(;Date.now()<n+1e4;){const i=Array.from(this.pendingPublishPromises.entries()).find(r=>{let[s]=r;return s.source===e});if(i)return i[1];yield Ke(20)}})}}class ny extends _A{constructor(e,A,n,i){super(e,A.sid,A.name,i),this.track=void 0,this.allowed=!0,this.disabled=!1,this.currentVideoQuality=AA.HIGH,this.handleEnded=r=>{this.setTrack(void 0),this.emit(_.Ended,r)},this.handleVisibilityChange=r=>{this.log.debug("adaptivestream video visibility ".concat(this.trackSid,", visible=").concat(r),this.logContext),this.disabled=!r,this.emitTrackUpdate()},this.handleVideoDimensionsChange=r=>{this.log.debug("adaptivestream video dimensions ".concat(r.width,"x").concat(r.height),this.logContext),this.videoDimensions=r,this.emitTrackUpdate()},this.subscribed=n,this.updateInfo(A)}setSubscribed(e){const A=this.subscriptionStatus,n=this.permissionStatus;this.subscribed=e,e&&(this.allowed=!0);const i=new Xi({trackSids:[this.trackSid],subscribe:this.subscribed,participantTracks:[new cu({participantSid:"",trackSids:[this.trackSid]})]});this.emit(_.UpdateSubscription,i),this.emitSubscriptionUpdateIfChanged(A),this.emitPermissionUpdateIfChanged(n)}get subscriptionStatus(){return this.subscribed===!1?_A.SubscriptionStatus.Unsubscribed:super.isSubscribed?_A.SubscriptionStatus.Subscribed:_A.SubscriptionStatus.Desired}get permissionStatus(){return this.allowed?_A.PermissionStatus.Allowed:_A.PermissionStatus.NotAllowed}get isSubscribed(){return this.subscribed===!1?!1:super.isSubscribed}get isDesired(){return this.subscribed!==!1}get isEnabled(){return!this.disabled}get isLocal(){return!1}setEnabled(e){!this.isManualOperationAllowed()||this.disabled===!e||(this.disabled=!e,this.emitTrackUpdate())}setVideoQuality(e){!this.isManualOperationAllowed()||this.currentVideoQuality===e||(this.currentVideoQuality=e,this.videoDimensions=void 0,this.emitTrackUpdate())}setVideoDimensions(e){var A,n;this.isManualOperationAllowed()&&(((A=this.videoDimensions)===null||A===void 0?void 0:A.width)===e.width&&((n=this.videoDimensions)===null||n===void 0?void 0:n.height)===e.height||(Ua(this.track)&&(this.videoDimensions=e),this.currentVideoQuality=void 0,this.emitTrackUpdate()))}setVideoFPS(e){this.isManualOperationAllowed()&&Ua(this.track)&&this.fps!==e&&(this.fps=e,this.emitTrackUpdate())}get videoQuality(){return this.currentVideoQuality}setTrack(e){const A=this.subscriptionStatus,n=this.permissionStatus,i=this.track;i!==e&&(i&&(i.off(_.VideoDimensionsChanged,this.handleVideoDimensionsChange),i.off(_.VisibilityChanged,this.handleVisibilityChange),i.off(_.Ended,this.handleEnded),i.detach(),i.stopMonitor(),this.emit(_.Unsubscribed,i)),super.setTrack(e),e&&(e.sid=this.trackSid,e.on(_.VideoDimensionsChanged,this.handleVideoDimensionsChange),e.on(_.VisibilityChanged,this.handleVisibilityChange),e.on(_.Ended,this.handleEnded),this.emit(_.Subscribed,e)),this.emitPermissionUpdateIfChanged(n),this.emitSubscriptionUpdateIfChanged(A))}setAllowed(e){const A=this.subscriptionStatus,n=this.permissionStatus;this.allowed=e,this.emitPermissionUpdateIfChanged(n),this.emitSubscriptionUpdateIfChanged(A)}setSubscriptionError(e){this.emit(_.SubscriptionFailed,e)}updateInfo(e){super.updateInfo(e);const A=this.metadataMuted;this.metadataMuted=e.muted,this.track?this.track.setMuted(e.muted):A!==e.muted&&this.emit(e.muted?_.Muted:_.Unmuted)}emitSubscriptionUpdateIfChanged(e){const A=this.subscriptionStatus;e!==A&&this.emit(_.SubscriptionStatusChanged,A,e)}emitPermissionUpdateIfChanged(e){this.permissionStatus!==e&&this.emit(_.SubscriptionPermissionChanged,this.permissionStatus,e)}isManualOperationAllowed(){return this.kind===T.Kind.Video&&this.isAdaptiveStream?(this.log.warn("adaptive stream is enabled, cannot change video track settings",this.logContext),!1):this.isDesired?!0:(this.log.warn("cannot update track settings when not subscribed",this.logContext),!1)}get isAdaptiveStream(){return Ua(this.track)&&this.track.isAdaptiveStream}emitTrackUpdate(){const e=new Bu({trackSids:[this.trackSid],disabled:this.disabled,fps:this.fps});this.videoDimensions?(e.width=Math.ceil(this.videoDimensions.width),e.height=Math.ceil(this.videoDimensions.height)):this.currentVideoQuality!==void 0?e.quality=this.currentVideoQuality:e.quality=AA.HIGH,this.emit(_.UpdateSettings,e)}}class pr extends rh{static fromParticipantInfo(e,A,n){return new pr(e,A.sid,A.identity,A.name,A.metadata,A.attributes,n,A.kind)}get logContext(){return Object.assign(Object.assign({},super.logContext),{rpID:this.sid,remoteParticipant:this.identity})}constructor(e,A,n,i,r,s,a){let o=arguments.length>7&&arguments[7]!==void 0?arguments[7]:Ji.STANDARD;super(A,n||"",i,r,s,a,o),this.signalClient=e,this.trackPublications=new Map,this.audioTrackPublications=new Map,this.videoTrackPublications=new Map,this.volumeMap=new Map}addTrackPublication(e){super.addTrackPublication(e),e.on(_.UpdateSettings,A=>{this.log.debug("send update settings",Object.assign(Object.assign({},this.logContext),z(e))),this.signalClient.sendUpdateTrackSettings(A)}),e.on(_.UpdateSubscription,A=>{A.participantTracks.forEach(n=>{n.participantSid=this.sid}),this.signalClient.sendUpdateSubscription(A)}),e.on(_.SubscriptionPermissionChanged,A=>{this.emit(D.TrackSubscriptionPermissionChanged,e,A)}),e.on(_.SubscriptionStatusChanged,A=>{this.emit(D.TrackSubscriptionStatusChanged,e,A)}),e.on(_.Subscribed,A=>{this.emit(D.TrackSubscribed,A,e)}),e.on(_.Unsubscribed,A=>{this.emit(D.TrackUnsubscribed,A,e)}),e.on(_.SubscriptionFailed,A=>{this.emit(D.TrackSubscriptionFailed,e.trackSid,A)})}getTrackPublication(e){const A=super.getTrackPublication(e);if(A)return A}getTrackPublicationByName(e){const A=super.getTrackPublicationByName(e);if(A)return A}setVolume(e){let A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:T.Source.Microphone;this.volumeMap.set(A,e);const n=this.getTrackPublication(A);n&&n.track&&n.track.setVolume(e)}getVolume(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:T.Source.Microphone;const A=this.getTrackPublication(e);return A&&A.track?A.track.getVolume():this.volumeMap.get(e)}addSubscribedMediaTrack(e,A,n,i,r,s){let a=this.getTrackPublicationBySid(A);if(a||A.startsWith("TR")||this.trackPublications.forEach(l=>{!a&&e.kind===l.kind.toString()&&(a=l)}),!a){if(s===0){this.log.error("could not find published track",Object.assign(Object.assign({},this.logContext),{trackSid:A})),this.emit(D.TrackSubscriptionFailed,A);return}s===void 0&&(s=20),setTimeout(()=>{this.addSubscribedMediaTrack(e,A,n,i,r,s-1)},150);return}if(e.readyState==="ended"){this.log.error("unable to subscribe because MediaStreamTrack is ended. Do not call MediaStreamTrack.stop()",Object.assign(Object.assign({},this.logContext),z(a))),this.emit(D.TrackSubscriptionFailed,A);return}const o=e.kind==="video";let c;return o?c=new Yb(e,A,i,r):c=new qb(e,A,i,this.audioContext,this.audioOutput),c.source=a.source,c.isMuted=a.isMuted,c.setMediaStream(n),c.start(),a.setTrack(c),this.volumeMap.has(a.source)&&ya(c)&&xA(c)&&c.setVolume(this.volumeMap.get(a.source)),a}get hasMetadata(){return!!this.participantInfo}getTrackPublicationBySid(e){return this.trackPublications.get(e)}updateInfo(e){if(!super.updateInfo(e))return!1;const A=new Map,n=new Map;return e.tracks.forEach(i=>{var r,s;let a=this.getTrackPublicationBySid(i.sid);if(a)a.updateInfo(i);else{const o=T.kindFromProto(i.type);if(!o)return;a=new ny(o,i,(r=this.signalClient.connectOptions)===null||r===void 0?void 0:r.autoSubscribe,{loggerContextCb:()=>this.logContext,loggerName:(s=this.loggerOptions)===null||s===void 0?void 0:s.loggerName}),a.updateInfo(i),n.set(i.sid,a);const c=Array.from(this.trackPublications.values()).find(l=>l.source===(a==null?void 0:a.source));c&&a.source!==T.Source.Unknown&&this.log.debug("received a second track publication for ".concat(this.identity," with the same source: ").concat(a.source),Object.assign(Object.assign({},this.logContext),{oldTrack:z(c),newTrack:z(a)})),this.addTrackPublication(a)}A.set(i.sid,a)}),this.trackPublications.forEach(i=>{A.has(i.trackSid)||(this.log.trace("detected removed track on remote participant, unpublishing",Object.assign(Object.assign({},this.logContext),z(i))),this.unpublishTrack(i.trackSid,!0))}),n.forEach(i=>{this.emit(D.TrackPublished,i)}),!0}unpublishTrack(e,A){const n=this.trackPublications.get(e);if(!n)return;const{track:i}=n;switch(i&&(i.stop(),n.setTrack(void 0)),this.trackPublications.delete(e),n.kind){case T.Kind.Audio:this.audioTrackPublications.delete(e);break;case T.Kind.Video:this.videoTrackPublications.delete(e);break}A&&this.emit(D.TrackUnpublished,n)}setAudioOutput(e){return v(this,void 0,void 0,function*(){this.audioOutput=e;const A=[];this.audioTrackPublications.forEach(n=>{var i;xA(n.track)&&ya(n.track)&&A.push(n.track.setSinkId((i=e.deviceId)!==null&&i!==void 0?i:"default"))}),yield Promise.all(A)})}emit(e){for(var A=arguments.length,n=new Array(A>1?A-1:0),i=1;i<A;i++)n[i-1]=arguments[i];return this.log.trace("participant event",Object.assign(Object.assign({},this.logContext),{event:e,args:n})),super.emit(e,...n)}}var q;(function(t){t.Disconnected="disconnected",t.Connecting="connecting",t.Connected="connected",t.Reconnecting="reconnecting",t.SignalReconnecting="signalReconnecting"})(q||(q={}));const iy=4*1e3;class qt extends yA.EventEmitter{constructor(e){var A,n,i,r;if(super(),A=this,this.state=q.Disconnected,this.activeSpeakers=[],this.isE2EEEnabled=!1,this.audioEnabled=!0,this.isVideoPlaybackBlocked=!1,this.log=W,this.bufferedEvents=[],this.isResuming=!1,this.byteStreamControllers=new Map,this.textStreamControllers=new Map,this.byteStreamHandlers=new Map,this.textStreamHandlers=new Map,this.rpcHandlers=new Map,this.connect=(s,a,o)=>v(this,void 0,void 0,function*(){var c;if(!jw())throw UA()?Error("WebRTC isn't detected, have you called registerGlobals?"):Error("LiveKit doesn't seem to be supported on this browser. Try to update your browser and make sure no browser extensions are disabling webRTC.");const l=yield this.disconnectLock.lock();if(this.state===q.Connected)return this.log.info("already connected to room ".concat(this.name),this.logContext),l(),Promise.resolve();if(this.connectFuture)return l(),this.connectFuture.promise;this.setAndEmitConnectionState(q.Connecting),((c=this.regionUrlProvider)===null||c===void 0?void 0:c.getServerUrl().toString())!==s&&(this.regionUrl=void 0,this.regionUrlProvider=void 0),ma(new URL(s))&&(this.regionUrlProvider===void 0?this.regionUrlProvider=new Ka(s,a):this.regionUrlProvider.updateToken(a),this.regionUrlProvider.fetchRegionSettings().then(h=>{var g;(g=this.regionUrlProvider)===null||g===void 0||g.setServerReportedRegions(h)}).catch(h=>{this.log.warn("could not fetch region settings",Object.assign(Object.assign({},this.logContext),{error:h}))}));const u=(h,g,f)=>v(this,void 0,void 0,function*(){var m,B;this.abortController&&this.abortController.abort();const b=new AbortController;this.abortController=b,l==null||l();try{yield this.attemptConnection(f??s,a,o,b),this.abortController=void 0,h()}catch(U){if(this.regionUrlProvider&&U instanceof Ae&&U.reason!==J.Cancelled&&U.reason!==J.NotAllowed){let C=null;try{C=yield this.regionUrlProvider.getNextBestRegionUrl((m=this.abortController)===null||m===void 0?void 0:m.signal)}catch(w){if(w instanceof Ae&&(w.status===401||w.reason===J.Cancelled)){this.handleDisconnect(this.options.stopLocalTrackOnUnpublish),g(w);return}}C&&!(!((B=this.abortController)===null||B===void 0)&&B.signal.aborted)?(this.log.info("Initial connection failed with ConnectionError: ".concat(U.message,". Retrying with another region: ").concat(C),this.logContext),this.recreateEngine(),yield u(h,g,C)):(this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,Td(U)),g(U))}else{let C=aA.UNKNOWN_REASON;U instanceof Ae&&(C=Td(U)),this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,C),g(U)}}}),d=this.regionUrl;return this.regionUrl=void 0,this.connectFuture=new wa((h,g)=>{u(h,g,d)},()=>{this.clearConnectionFutures()}),this.connectFuture.promise}),this.connectSignal=(s,a,o,c,l,u)=>v(this,void 0,void 0,function*(){var d,h,g;const f=yield o.join(s,a,{autoSubscribe:c.autoSubscribe,adaptiveStream:typeof l.adaptiveStream=="object"?!0:l.adaptiveStream,maxRetries:c.maxRetries,e2eeEnabled:!!this.e2eeManager,websocketTimeout:c.websocketTimeout},u.signal);let m=f.serverInfo;if(m||(m={version:f.serverVersion,region:f.serverRegion}),this.serverInfo=m,this.log.debug("connected to Livekit Server ".concat(Object.entries(m).map(B=>{let[b,U]=B;return"".concat(b,": ").concat(U)}).join(", ")),{room:(d=f.room)===null||d===void 0?void 0:d.name,roomSid:(h=f.room)===null||h===void 0?void 0:h.sid,identity:(g=f.participant)===null||g===void 0?void 0:g.identity}),!m.version)throw new Fw("unknown server version");return m.version==="0.15.1"&&this.options.dynacast&&(this.log.debug("disabling dynacast due to server version",this.logContext),l.dynacast=!1),f}),this.applyJoinResponse=s=>{const a=s.participant;if(this.localParticipant.sid=a.sid,this.localParticipant.identity=a.identity,this.localParticipant.setEnabledPublishCodecs(s.enabledPublishCodecs),this.options.e2ee&&this.e2eeManager)try{this.e2eeManager.setSifTrailer(s.sifTrailer)}catch(o){this.log.error(o instanceof Error?o.message:"Could not set SifTrailer",Object.assign(Object.assign({},this.logContext),{error:o}))}this.handleParticipantUpdates([a,...s.otherParticipants]),s.room&&this.handleRoomUpdate(s.room)},this.attemptConnection=(s,a,o,c)=>v(this,void 0,void 0,function*(){var l,u;this.state===q.Reconnecting||this.isResuming||!((l=this.engine)===null||l===void 0)&&l.pendingReconnect?(this.log.info("Reconnection attempt replaced by new connection attempt",this.logContext),this.recreateEngine()):this.maybeCreateEngine(),!((u=this.regionUrlProvider)===null||u===void 0)&&u.isCloud()&&this.engine.setRegionUrlProvider(this.regionUrlProvider),this.acquireAudioContext(),this.connOptions=Object.assign(Object.assign({},Ra),o),this.connOptions.rtcConfig&&(this.engine.rtcConfig=this.connOptions.rtcConfig),this.connOptions.peerConnectionTimeout&&(this.engine.peerConnectionTimeout=this.connOptions.peerConnectionTimeout);try{const d=yield this.connectSignal(s,a,this.engine,this.connOptions,this.options,c);this.applyJoinResponse(d),this.setupLocalParticipantEvents(),this.emit(I.SignalConnected)}catch(d){yield this.engine.close(),this.recreateEngine();const h=new Ae("could not establish signal connection",J.ServerUnreachable);throw d instanceof Error&&(h.message="".concat(h.message,": ").concat(d.message)),d instanceof Ae&&(h.reason=d.reason,h.status=d.status),this.log.debug("error trying to establish signal connection",Object.assign(Object.assign({},this.logContext),{error:d})),h}if(c.signal.aborted)throw yield this.engine.close(),this.recreateEngine(),new Ae("Connection attempt aborted",J.Cancelled);try{yield this.engine.waitForPCInitialConnection(this.connOptions.peerConnectionTimeout,c)}catch(d){throw yield this.engine.close(),this.recreateEngine(),d}Ve()&&this.options.disconnectOnPageLeave&&(window.addEventListener("pagehide",this.onPageLeave),window.addEventListener("beforeunload",this.onPageLeave)),Ve()&&document.addEventListener("freeze",this.onPageLeave),this.setAndEmitConnectionState(q.Connected),this.emit(I.Connected),this.registerConnectionReconcile()}),this.disconnect=function(){for(var s=arguments.length,a=new Array(s),o=0;o<s;o++)a[o]=arguments[o];return v(A,[...a],void 0,function(){var c=this;let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return function*(){var u,d,h,g;const f=yield c.disconnectLock.lock();try{if(c.state===q.Disconnected){c.log.debug("already disconnected",c.logContext);return}c.log.info("disconnect from room",Object.assign({},c.logContext)),(c.state===q.Connecting||c.state===q.Reconnecting||c.isResuming)&&(c.log.warn("abort connection attempt",c.logContext),(u=c.abortController)===null||u===void 0||u.abort(),(h=(d=c.connectFuture)===null||d===void 0?void 0:d.reject)===null||h===void 0||h.call(d,new Ae("Client initiated disconnect",J.Cancelled)),c.connectFuture=void 0),!((g=c.engine)===null||g===void 0)&&g.client.isDisconnected||(yield c.engine.client.sendLeave()),c.engine&&(yield c.engine.close()),c.handleDisconnect(l,aA.CLIENT_INITIATED),c.engine=void 0}finally{f()}}()})},this.onPageLeave=()=>v(this,void 0,void 0,function*(){this.log.info("Page leave detected, disconnecting",this.logContext),yield this.disconnect()}),this.startAudio=()=>v(this,void 0,void 0,function*(){const s=[],a=uA();if(a&&a.os==="iOS"){const o="livekit-dummy-audio-el";let c=document.getElementById(o);if(!c){c=document.createElement("audio"),c.id=o,c.autoplay=!0,c.hidden=!0;const l=Ca();l.enabled=!0;const u=new MediaStream([l]);c.srcObject=u,document.addEventListener("visibilitychange",()=>{c&&(c.srcObject=document.hidden?null:u,document.hidden||(this.log.debug("page visible again, triggering startAudio to resume playback and update playback status",this.logContext),this.startAudio()))}),document.body.append(c),this.once(I.Disconnected,()=>{c==null||c.remove(),c=null})}s.push(c)}this.remoteParticipants.forEach(o=>{o.audioTrackPublications.forEach(c=>{c.track&&c.track.attachedElements.forEach(l=>{s.push(l)})})});try{yield Promise.all([this.acquireAudioContext(),...s.map(o=>(o.muted=!1,o.play()))]),this.handleAudioPlaybackStarted()}catch(o){throw this.handleAudioPlaybackFailed(o),o}}),this.startVideo=()=>v(this,void 0,void 0,function*(){const s=[];for(const a of this.remoteParticipants.values())a.videoTrackPublications.forEach(o=>{var c;(c=o.track)===null||c===void 0||c.attachedElements.forEach(l=>{s.includes(l)||s.push(l)})});yield Promise.all(s.map(a=>a.play())).then(()=>{this.handleVideoPlaybackStarted()}).catch(a=>{a.name==="NotAllowedError"?this.handleVideoPlaybackFailed():this.log.warn("Resuming video playback failed, make sure you call `startVideo` directly in a user gesture handler",this.logContext)})}),this.handleRestarting=()=>{this.clearConnectionReconcile(),this.isResuming=!1;for(const s of this.remoteParticipants.values())this.handleParticipantDisconnected(s.identity,s);this.setAndEmitConnectionState(q.Reconnecting)&&this.emit(I.Reconnecting)},this.handleSignalRestarted=s=>v(this,void 0,void 0,function*(){this.log.debug("signal reconnected to server, region ".concat(s.serverRegion),Object.assign(Object.assign({},this.logContext),{region:s.serverRegion})),this.bufferedEvents=[],this.applyJoinResponse(s);try{yield this.localParticipant.republishAllTracks(void 0,!0)}catch(a){this.log.error("error trying to re-publish tracks after reconnection",Object.assign(Object.assign({},this.logContext),{error:a}))}try{yield this.engine.waitForRestarted(),this.log.debug("fully reconnected to server",Object.assign(Object.assign({},this.logContext),{region:s.serverRegion}))}catch{return}this.setAndEmitConnectionState(q.Connected),this.emit(I.Reconnected),this.registerConnectionReconcile(),this.emitBufferedEvents()}),this.handleParticipantUpdates=s=>{s.forEach(a=>{var o;if(a.identity===this.localParticipant.identity){this.localParticipant.updateInfo(a);return}a.identity===""&&(a.identity=(o=this.sidToIdentity.get(a.sid))!==null&&o!==void 0?o:"");let c=this.remoteParticipants.get(a.identity);a.state===Ht.DISCONNECTED?this.handleParticipantDisconnected(a.identity,c):c=this.getOrCreateParticipant(a.identity,a)})},this.handleActiveSpeakersUpdate=s=>{const a=[],o={};s.forEach(c=>{if(o[c.sid]=!0,c.sid===this.localParticipant.sid)this.localParticipant.audioLevel=c.level,this.localParticipant.setIsSpeaking(!0),a.push(this.localParticipant);else{const l=this.getRemoteParticipantBySid(c.sid);l&&(l.audioLevel=c.level,l.setIsSpeaking(!0),a.push(l))}}),o[this.localParticipant.sid]||(this.localParticipant.audioLevel=0,this.localParticipant.setIsSpeaking(!1)),this.remoteParticipants.forEach(c=>{o[c.sid]||(c.audioLevel=0,c.setIsSpeaking(!1))}),this.activeSpeakers=a,this.emitWhenConnected(I.ActiveSpeakersChanged,a)},this.handleSpeakersChanged=s=>{const a=new Map;this.activeSpeakers.forEach(c=>{const l=this.remoteParticipants.get(c.identity);l&&l.sid!==c.sid||a.set(c.sid,c)}),s.forEach(c=>{let l=this.getRemoteParticipantBySid(c.sid);c.sid===this.localParticipant.sid&&(l=this.localParticipant),l&&(l.audioLevel=c.level,l.setIsSpeaking(c.active),c.active?a.set(c.sid,l):a.delete(c.sid))});const o=Array.from(a.values());o.sort((c,l)=>l.audioLevel-c.audioLevel),this.activeSpeakers=o,this.emitWhenConnected(I.ActiveSpeakersChanged,o)},this.handleStreamStateUpdate=s=>{s.streamStates.forEach(a=>{const o=this.getRemoteParticipantBySid(a.participantSid);if(!o)return;const c=o.getTrackPublicationBySid(a.trackSid);if(!c||!c.track)return;const l=T.streamStateFromProto(a.state);l!==c.track.streamState&&(c.track.streamState=l,o.emit(D.TrackStreamStateChanged,c,c.track.streamState),this.emitWhenConnected(I.TrackStreamStateChanged,c,c.track.streamState,o))})},this.handleSubscriptionPermissionUpdate=s=>{const a=this.getRemoteParticipantBySid(s.participantSid);if(!a)return;const o=a.getTrackPublicationBySid(s.trackSid);o&&o.setAllowed(s.allowed)},this.handleSubscriptionError=s=>{const a=Array.from(this.remoteParticipants.values()).find(c=>c.trackPublications.has(s.trackSid));if(!a)return;const o=a.getTrackPublicationBySid(s.trackSid);o&&o.setSubscriptionError(s.err)},this.handleDataPacket=s=>{const a=this.remoteParticipants.get(s.participantIdentity);if(s.value.case==="user")this.handleUserPacket(a,s.value.value,s.kind);else if(s.value.case==="transcription")this.handleTranscription(a,s.value.value);else if(s.value.case==="sipDtmf")this.handleSipDtmf(a,s.value.value);else if(s.value.case==="chatMessage")this.handleChatMessage(a,s.value.value);else if(s.value.case==="metrics")this.handleMetrics(s.value.value,a);else if(s.value.case==="streamHeader")this.handleStreamHeader(s.value.value,s.participantIdentity);else if(s.value.case==="streamChunk")this.handleStreamChunk(s.value.value);else if(s.value.case==="streamTrailer")this.handleStreamTrailer(s.value.value);else if(s.value.case==="rpcRequest"){const o=s.value.value;this.handleIncomingRpcRequest(s.participantIdentity,o.id,o.method,o.payload,o.responseTimeoutMs,o.version)}},this.handleUserPacket=(s,a,o)=>{this.emit(I.DataReceived,a.payload,s,o,a.topic),s==null||s.emit(D.DataReceived,a.payload,o)},this.handleSipDtmf=(s,a)=>{this.emit(I.SipDTMFReceived,a,s),s==null||s.emit(D.SipDTMFReceived,a)},this.bufferedSegments=new Map,this.handleTranscription=(s,a)=>{const o=a.transcribedParticipantIdentity===this.localParticipant.identity?this.localParticipant:this.getParticipantByIdentity(a.transcribedParticipantIdentity),c=o==null?void 0:o.trackPublications.get(a.trackId),l=$w(a,this.transcriptionReceivedTimes);c==null||c.emit(_.TranscriptionReceived,l),o==null||o.emit(D.TranscriptionReceived,l,c),this.emit(I.TranscriptionReceived,l,o,c)},this.handleChatMessage=(s,a)=>{const o=eb(a);this.emit(I.ChatMessage,o,s)},this.handleMetrics=(s,a)=>{this.emit(I.MetricsReceived,s,a)},this.handleAudioPlaybackStarted=()=>{this.canPlaybackAudio||(this.audioEnabled=!0,this.emit(I.AudioPlaybackStatusChanged,!0))},this.handleAudioPlaybackFailed=s=>{this.log.warn("could not playback audio",Object.assign(Object.assign({},this.logContext),{error:s})),this.canPlaybackAudio&&(this.audioEnabled=!1,this.emit(I.AudioPlaybackStatusChanged,!1))},this.handleVideoPlaybackStarted=()=>{this.isVideoPlaybackBlocked&&(this.isVideoPlaybackBlocked=!1,this.emit(I.VideoPlaybackStatusChanged,!0))},this.handleVideoPlaybackFailed=()=>{this.isVideoPlaybackBlocked||(this.isVideoPlaybackBlocked=!0,this.emit(I.VideoPlaybackStatusChanged,!1))},this.handleDeviceChange=()=>v(this,void 0,void 0,function*(){var s,a,o;const c=Qe.getInstance().previousDevices,l=yield Qe.getInstance().getDevices(void 0,!1),u=uA();if((u==null?void 0:u.name)==="Chrome"&&u.os!=="iOS")for(let h of l){const g=c.find(f=>f.deviceId===h.deviceId);g&&g.label!==""&&g.kind===h.kind&&g.label!==h.label&&this.getActiveDevice(h.kind)==="default"&&this.emit(I.ActiveDeviceChanged,h.kind,h.deviceId)}const d=["audiooutput","audioinput","videoinput"];for(let h of d){const g=ib(h),f=this.localParticipant.getTrackPublication(g);if(f&&(!((s=f.track)===null||s===void 0)&&s.isUserProvided))continue;const m=l.filter(b=>b.kind===h),B=this.getActiveDevice(h);if(B===((a=c.filter(b=>b.kind===h)[0])===null||a===void 0?void 0:a.deviceId)&&m.length>0&&((o=m[0])===null||o===void 0?void 0:o.deviceId)!==B){yield this.switchActiveDevice(h,m[0].deviceId);continue}h==="audioinput"&&!ZA()||h==="videoinput"||m.length>0&&!m.find(b=>b.deviceId===this.getActiveDevice(h))&&(yield this.switchActiveDevice(h,m[0].deviceId))}this.emit(I.MediaDevicesChanged)}),this.handleRoomUpdate=s=>{const a=this.roomInfo;this.roomInfo=s,a&&a.metadata!==s.metadata&&this.emitWhenConnected(I.RoomMetadataChanged,s.metadata),(a==null?void 0:a.activeRecording)!==s.activeRecording&&this.emitWhenConnected(I.RecordingStatusChanged,s.activeRecording)},this.handleConnectionQualityUpdate=s=>{s.updates.forEach(a=>{if(a.participantSid===this.localParticipant.sid){this.localParticipant.setConnectionQuality(a.quality);return}const o=this.getRemoteParticipantBySid(a.participantSid);o&&o.setConnectionQuality(a.quality)})},this.onLocalParticipantMetadataChanged=s=>{this.emit(I.ParticipantMetadataChanged,s,this.localParticipant)},this.onLocalParticipantNameChanged=s=>{this.emit(I.ParticipantNameChanged,s,this.localParticipant)},this.onLocalAttributesChanged=s=>{this.emit(I.ParticipantAttributesChanged,s,this.localParticipant)},this.onLocalTrackMuted=s=>{this.emit(I.TrackMuted,s,this.localParticipant)},this.onLocalTrackUnmuted=s=>{this.emit(I.TrackUnmuted,s,this.localParticipant)},this.onTrackProcessorUpdate=s=>{var a;(a=s==null?void 0:s.onPublish)===null||a===void 0||a.call(s,this)},this.onLocalTrackPublished=s=>v(this,void 0,void 0,function*(){var a,o,c,l,u,d;(a=s.track)===null||a===void 0||a.on(_.TrackProcessorUpdate,this.onTrackProcessorUpdate),(o=s.track)===null||o===void 0||o.on(_.Restarted,this.onLocalTrackRestarted),(u=(l=(c=s.track)===null||c===void 0?void 0:c.getProcessor())===null||l===void 0?void 0:l.onPublish)===null||u===void 0||u.call(l,this),this.emit(I.LocalTrackPublished,s,this.localParticipant),vt(s.track)&&(yield s.track.checkForSilence())&&this.emit(I.LocalAudioSilenceDetected,s);const h=yield(d=s.track)===null||d===void 0?void 0:d.getDeviceId(!1),g=_d(s.source);g&&h&&h!==this.localParticipant.activeDeviceMap.get(g)&&(this.localParticipant.activeDeviceMap.set(g,h),this.emit(I.ActiveDeviceChanged,g,h))}),this.onLocalTrackUnpublished=s=>{var a,o;(a=s.track)===null||a===void 0||a.off(_.TrackProcessorUpdate,this.onTrackProcessorUpdate),(o=s.track)===null||o===void 0||o.off(_.Restarted,this.onLocalTrackRestarted),this.emit(I.LocalTrackUnpublished,s,this.localParticipant)},this.onLocalTrackRestarted=s=>v(this,void 0,void 0,function*(){const a=yield s.getDeviceId(!1),o=_d(s.source);o&&a&&a!==this.localParticipant.activeDeviceMap.get(o)&&(this.log.debug("local track restarted, setting ".concat(o," ").concat(a," active"),this.logContext),this.localParticipant.activeDeviceMap.set(o,a),this.emit(I.ActiveDeviceChanged,o,a))}),this.onLocalConnectionQualityChanged=s=>{this.emit(I.ConnectionQualityChanged,s,this.localParticipant)},this.onMediaDevicesError=s=>{this.emit(I.MediaDevicesError,s)},this.onLocalParticipantPermissionsChanged=s=>{this.emit(I.ParticipantPermissionsChanged,s,this.localParticipant)},this.onLocalChatMessageSent=s=>{this.emit(I.ChatMessage,s,this.localParticipant)},this.setMaxListeners(100),this.remoteParticipants=new Map,this.sidToIdentity=new Map,this.options=Object.assign(Object.assign({},Qb),e),this.log=FA((n=this.options.loggerName)!==null&&n!==void 0?n:lA.Room),this.transcriptionReceivedTimes=new Map,this.options.audioCaptureDefaults=Object.assign(Object.assign({},Gd),e==null?void 0:e.audioCaptureDefaults),this.options.videoCaptureDefaults=Object.assign(Object.assign({},jd),e==null?void 0:e.videoCaptureDefaults),this.options.publishDefaults=Object.assign(Object.assign({},Ub),e==null?void 0:e.publishDefaults),this.maybeCreateEngine(),this.disconnectLock=new Oe,this.localParticipant=new ty("","",this.engine,this.options,this.rpcHandlers),this.options.videoCaptureDefaults.deviceId&&this.localParticipant.activeDeviceMap.set("videoinput",$A(this.options.videoCaptureDefaults.deviceId)),this.options.audioCaptureDefaults.deviceId&&this.localParticipant.activeDeviceMap.set("audioinput",$A(this.options.audioCaptureDefaults.deviceId)),!((i=this.options.audioOutput)===null||i===void 0)&&i.deviceId&&this.switchActiveDevice("audiooutput",$A(this.options.audioOutput.deviceId)).catch(s=>this.log.warn("Could not set audio output: ".concat(s.message),this.logContext)),this.options.e2ee&&this.setupE2EE(),Ve()){const s=new AbortController;(r=navigator.mediaDevices)===null||r===void 0||r.addEventListener("devicechange",this.handleDeviceChange,{signal:s.signal}),qt.cleanupRegistry&&qt.cleanupRegistry.register(this,()=>{s.abort()})}}registerTextStreamHandler(e,A){if(this.textStreamHandlers.has(e))throw new TypeError('A text stream handler for topic "'.concat(e,'" has already been set.'));this.textStreamHandlers.set(e,A)}unregisterTextStreamHandler(e){this.textStreamHandlers.delete(e)}registerByteStreamHandler(e,A){if(this.byteStreamHandlers.has(e))throw new TypeError('A byte stream handler for topic "'.concat(e,'" has already been set.'));this.byteStreamHandlers.set(e,A)}unregisterByteStreamHandler(e){this.byteStreamHandlers.delete(e)}registerRpcMethod(e,A){if(this.rpcHandlers.has(e))throw Error("RPC handler already registered for method ".concat(e,", unregisterRpcMethod before trying to register again"));this.rpcHandlers.set(e,A)}unregisterRpcMethod(e){this.rpcHandlers.delete(e)}handleIncomingRpcRequest(e,A,n,i,r,s){return v(this,void 0,void 0,function*(){if(yield this.engine.publishRpcAck(e,A),s!==1){yield this.engine.publishRpcResponse(e,A,null,de.builtIn("UNSUPPORTED_VERSION"));return}const a=this.rpcHandlers.get(n);if(!a){yield this.engine.publishRpcResponse(e,A,null,de.builtIn("UNSUPPORTED_METHOD"));return}let o=null,c=null;try{const l=yield a({requestId:A,callerIdentity:e,payload:i,responseTimeout:r});La(l)>Wd?(o=de.builtIn("RESPONSE_PAYLOAD_TOO_LARGE"),console.warn("RPC Response payload too large for ".concat(n))):c=l}catch(l){l instanceof de?o=l:(console.warn("Uncaught error returned by RPC handler for ".concat(n,". Returning APPLICATION_ERROR instead."),l),o=de.builtIn("APPLICATION_ERROR"))}yield this.engine.publishRpcResponse(e,A,c,o)})}setE2EEEnabled(e){return v(this,void 0,void 0,function*(){if(this.e2eeManager)yield Promise.all([this.localParticipant.setE2EEEnabled(e)]),this.localParticipant.identity!==""&&this.e2eeManager.setParticipantCryptorEnabled(e,this.localParticipant.identity);else throw Error("e2ee not configured, please set e2ee settings within the room options")})}setupE2EE(){var e;this.options.e2ee&&("e2eeManager"in this.options.e2ee?this.e2eeManager=this.options.e2ee.e2eeManager:this.e2eeManager=new lb(this.options.e2ee),this.e2eeManager.on(YA.ParticipantEncryptionStatusChanged,(A,n)=>{tb(n)&&(this.isE2EEEnabled=A),this.emit(I.ParticipantEncryptionStatusChanged,A,n)}),this.e2eeManager.on(YA.EncryptionError,A=>this.emit(I.EncryptionError,A)),(e=this.e2eeManager)===null||e===void 0||e.setup(this))}get logContext(){var e;return{room:this.name,roomID:(e=this.roomInfo)===null||e===void 0?void 0:e.sid,participant:this.localParticipant.identity,pID:this.localParticipant.sid}}get isRecording(){var e,A;return(A=(e=this.roomInfo)===null||e===void 0?void 0:e.activeRecording)!==null&&A!==void 0?A:!1}getSid(){return v(this,void 0,void 0,function*(){return this.state===q.Disconnected?"":this.roomInfo&&this.roomInfo.sid!==""?this.roomInfo.sid:new Promise((e,A)=>{const n=i=>{i.sid!==""&&(this.engine.off(P.RoomUpdate,n),e(i.sid))};this.engine.on(P.RoomUpdate,n),this.once(I.Disconnected,()=>{this.engine.off(P.RoomUpdate,n),A("Room disconnected before room server id was available")})})})}get name(){var e,A;return(A=(e=this.roomInfo)===null||e===void 0?void 0:e.name)!==null&&A!==void 0?A:""}get metadata(){var e;return(e=this.roomInfo)===null||e===void 0?void 0:e.metadata}get numParticipants(){var e,A;return(A=(e=this.roomInfo)===null||e===void 0?void 0:e.numParticipants)!==null&&A!==void 0?A:0}get numPublishers(){var e,A;return(A=(e=this.roomInfo)===null||e===void 0?void 0:e.numPublishers)!==null&&A!==void 0?A:0}maybeCreateEngine(){this.engine&&!this.engine.isClosed||(this.engine=new Nb(this.options),this.engine.on(P.ParticipantUpdate,this.handleParticipantUpdates).on(P.RoomUpdate,this.handleRoomUpdate).on(P.SpeakersChanged,this.handleSpeakersChanged).on(P.StreamStateChanged,this.handleStreamStateUpdate).on(P.ConnectionQualityUpdate,this.handleConnectionQualityUpdate).on(P.SubscriptionError,this.handleSubscriptionError).on(P.SubscriptionPermissionUpdate,this.handleSubscriptionPermissionUpdate).on(P.MediaTrackAdded,(e,A,n)=>{this.onTrackAdded(e,A,n)}).on(P.Disconnected,e=>{this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,e)}).on(P.ActiveSpeakersUpdate,this.handleActiveSpeakersUpdate).on(P.DataPacketReceived,this.handleDataPacket).on(P.Resuming,()=>{this.clearConnectionReconcile(),this.isResuming=!0,this.log.info("Resuming signal connection",this.logContext),this.setAndEmitConnectionState(q.SignalReconnecting)&&this.emit(I.SignalReconnecting)}).on(P.Resumed,()=>{this.registerConnectionReconcile(),this.isResuming=!1,this.log.info("Resumed signal connection",this.logContext),this.updateSubscriptions(),this.emitBufferedEvents(),this.setAndEmitConnectionState(q.Connected)&&this.emit(I.Reconnected)}).on(P.SignalResumed,()=>{this.bufferedEvents=[],(this.state===q.Reconnecting||this.isResuming)&&this.sendSyncState()}).on(P.Restarting,this.handleRestarting).on(P.SignalRestarted,this.handleSignalRestarted).on(P.Offline,()=>{this.setAndEmitConnectionState(q.Reconnecting)&&this.emit(I.Reconnecting)}).on(P.DCBufferStatusChanged,(e,A)=>{this.emit(I.DCBufferStatusChanged,e,A)}).on(P.LocalTrackSubscribed,e=>{const A=this.localParticipant.getTrackPublications().find(n=>{let{trackSid:i}=n;return i===e});if(!A){this.log.warn("could not find local track subscription for subscribed event",this.logContext);return}this.localParticipant.emit(D.LocalTrackSubscribed,A),this.emitWhenConnected(I.LocalTrackSubscribed,A,this.localParticipant)}).on(P.RoomMoved,e=>{this.log.debug("room moved",e),e.room&&this.handleRoomUpdate(e.room),this.remoteParticipants.forEach((A,n)=>{this.handleParticipantDisconnected(n,A)}),this.emit(I.Moved,e.room.name,e.token),e.participant?this.handleParticipantUpdates([e.participant,...e.otherParticipants]):this.handleParticipantUpdates(e.otherParticipants)}),this.localParticipant&&this.localParticipant.setupEngine(this.engine),this.e2eeManager&&this.e2eeManager.setupEngine(this.engine))}static getLocalDevices(e){let A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Qe.getInstance().getDevices(e,A)}prepareConnection(e,A){return v(this,void 0,void 0,function*(){if(this.state===q.Disconnected){this.log.debug("prepareConnection to ".concat(e),this.logContext);try{if(ma(new URL(e))&&A){this.regionUrlProvider=new Ka(e,A);const n=yield this.regionUrlProvider.getNextBestRegionUrl();n&&this.state===q.Disconnected&&(this.regionUrl=n,yield fetch(ba(n),{method:"HEAD"}),this.log.debug("prepared connection to ".concat(n),this.logContext))}else yield fetch(ba(e),{method:"HEAD"})}catch(n){this.log.warn("could not prepare connection",Object.assign(Object.assign({},this.logContext),{error:n}))}}})}getParticipantByIdentity(e){return this.localParticipant.identity===e?this.localParticipant:this.remoteParticipants.get(e)}clearConnectionFutures(){this.connectFuture=void 0}simulateScenario(e,A){return v(this,void 0,void 0,function*(){let n=()=>{},i;switch(e){case"signal-reconnect":yield this.engine.client.handleOnClose("simulate disconnect");break;case"speaker":i=new bA({scenario:{case:"speakerUpdate",value:3}});break;case"node-failure":i=new bA({scenario:{case:"nodeFailure",value:!0}});break;case"server-leave":i=new bA({scenario:{case:"serverLeave",value:!0}});break;case"migration":i=new bA({scenario:{case:"migration",value:!0}});break;case"resume-reconnect":this.engine.failNext(),yield this.engine.client.handleOnClose("simulate resume-disconnect");break;case"disconnect-signal-on-resume":n=()=>v(this,void 0,void 0,function*(){yield this.engine.client.handleOnClose("simulate resume-disconnect")}),i=new bA({scenario:{case:"disconnectSignalOnResume",value:!0}});break;case"disconnect-signal-on-resume-no-messages":n=()=>v(this,void 0,void 0,function*(){yield this.engine.client.handleOnClose("simulate resume-disconnect")}),i=new bA({scenario:{case:"disconnectSignalOnResumeNoMessages",value:!0}});break;case"full-reconnect":this.engine.fullReconnectOnNext=!0,yield this.engine.client.handleOnClose("simulate full-reconnect");break;case"force-tcp":case"force-tls":i=new bA({scenario:{case:"switchCandidateProtocol",value:e==="force-tls"?2:1}}),n=()=>v(this,void 0,void 0,function*(){const r=this.engine.client.onLeave;r&&r(new qi({reason:aA.CLIENT_INITIATED,action:Mt.RECONNECT}))});break;case"subscriber-bandwidth":if(A===void 0||typeof A!="number")throw new Error("subscriber-bandwidth requires a number as argument");i=new bA({scenario:{case:"subscriberBandwidth",value:Bt(A)}});break;case"leave-full-reconnect":i=new bA({scenario:{case:"leaveRequestFullReconnect",value:!0}})}i&&(yield this.engine.client.sendSimulateScenario(i),yield n())})}get canPlaybackAudio(){return this.audioEnabled}get canPlaybackVideo(){return!this.isVideoPlaybackBlocked}getActiveDevice(e){return this.localParticipant.activeDeviceMap.get(e)}switchActiveDevice(e,A){return v(this,arguments,void 0,function(n,i){var r=this;let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return function*(){var a,o,c,l,u,d,h,g;let f=!0,m=!1;const B=s?{exact:i}:i;if(n==="audioinput"){m=r.localParticipant.audioTrackPublications.size===0;const b=(a=r.getActiveDevice(n))!==null&&a!==void 0?a:r.options.audioCaptureDefaults.deviceId;r.options.audioCaptureDefaults.deviceId=B;const U=Array.from(r.localParticipant.audioTrackPublications.values()).filter(C=>C.source===T.Source.Microphone);try{f=(yield Promise.all(U.map(C=>{var w;return(w=C.audioTrack)===null||w===void 0?void 0:w.setDeviceId(B)}))).every(C=>C===!0)}catch(C){throw r.options.audioCaptureDefaults.deviceId=b,C}}else if(n==="videoinput"){m=r.localParticipant.videoTrackPublications.size===0;const b=(o=r.getActiveDevice(n))!==null&&o!==void 0?o:r.options.videoCaptureDefaults.deviceId;r.options.videoCaptureDefaults.deviceId=B;const U=Array.from(r.localParticipant.videoTrackPublications.values()).filter(C=>C.source===T.Source.Camera);try{f=(yield Promise.all(U.map(C=>{var w;return(w=C.videoTrack)===null||w===void 0?void 0:w.setDeviceId(B)}))).every(C=>C===!0)}catch(C){throw r.options.videoCaptureDefaults.deviceId=b,C}}else if(n==="audiooutput"){if(!pa()&&!r.options.webAudioMix||r.options.webAudioMix&&r.audioContext&&!("setSinkId"in r.audioContext))throw new Error("cannot switch audio output, setSinkId not supported");r.options.webAudioMix&&(i=(c=yield Qe.getInstance().normalizeDeviceId("audiooutput",i))!==null&&c!==void 0?c:""),(l=(g=r.options).audioOutput)!==null&&l!==void 0||(g.audioOutput={});const b=(u=r.getActiveDevice(n))!==null&&u!==void 0?u:r.options.audioOutput.deviceId;r.options.audioOutput.deviceId=i;try{r.options.webAudioMix&&((d=r.audioContext)===null||d===void 0||d.setSinkId(i)),yield Promise.all(Array.from(r.remoteParticipants.values()).map(U=>U.setAudioOutput({deviceId:i})))}catch(U){throw r.options.audioOutput.deviceId=b,U}}return(m||n==="audiooutput")&&(r.localParticipant.activeDeviceMap.set(n,n==="audiooutput"&&((h=r.options.audioOutput)===null||h===void 0?void 0:h.deviceId)||i),r.emit(I.ActiveDeviceChanged,n,i)),f}()})}setupLocalParticipantEvents(){this.localParticipant.on(D.ParticipantMetadataChanged,this.onLocalParticipantMetadataChanged).on(D.ParticipantNameChanged,this.onLocalParticipantNameChanged).on(D.AttributesChanged,this.onLocalAttributesChanged).on(D.TrackMuted,this.onLocalTrackMuted).on(D.TrackUnmuted,this.onLocalTrackUnmuted).on(D.LocalTrackPublished,this.onLocalTrackPublished).on(D.LocalTrackUnpublished,this.onLocalTrackUnpublished).on(D.ConnectionQualityChanged,this.onLocalConnectionQualityChanged).on(D.MediaDevicesError,this.onMediaDevicesError).on(D.AudioStreamAcquired,this.startAudio).on(D.ChatMessage,this.onLocalChatMessageSent).on(D.ParticipantPermissionsChanged,this.onLocalParticipantPermissionsChanged)}recreateEngine(){var e;(e=this.engine)===null||e===void 0||e.close(),this.engine=void 0,this.isResuming=!1,this.remoteParticipants.clear(),this.sidToIdentity.clear(),this.bufferedEvents=[],this.maybeCreateEngine()}onTrackAdded(e,A,n){if(this.state===q.Connecting||this.state===q.Reconnecting){const l=()=>{this.onTrackAdded(e,A,n),u()},u=()=>{this.off(I.Reconnected,l),this.off(I.Connected,l),this.off(I.Disconnected,u)};this.once(I.Reconnected,l),this.once(I.Connected,l),this.once(I.Disconnected,u);return}if(this.state===q.Disconnected){this.log.warn("skipping incoming track after Room disconnected",this.logContext);return}if(e.readyState==="ended"){this.log.info("skipping incoming track as it already ended",this.logContext);return}const i=Kw(A.id),r=i[0];let s=i[1],a=e.id;if(s&&s.startsWith("TR")&&(a=s),r===this.localParticipant.sid){this.log.warn("tried to create RemoteParticipant for local participant",this.logContext);return}const o=Array.from(this.remoteParticipants.values()).find(l=>l.sid===r);if(!o){this.log.error("Tried to add a track for a participant, that's not present. Sid: ".concat(r),this.logContext);return}let c;this.options.adaptiveStream&&(typeof this.options.adaptiveStream=="object"?c=this.options.adaptiveStream:c={}),o.addSubscribedMediaTrack(e,a,A,n,c)}handleDisconnect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,A=arguments.length>1?arguments[1]:void 0;var n;if(this.clearConnectionReconcile(),this.isResuming=!1,this.bufferedEvents=[],this.transcriptionReceivedTimes.clear(),this.state!==q.Disconnected){this.regionUrl=void 0;try{this.remoteParticipants.forEach(i=>{i.trackPublications.forEach(r=>{i.unpublishTrack(r.trackSid)})}),this.localParticipant.trackPublications.forEach(i=>{var r,s,a;i.track&&this.localParticipant.unpublishTrack(i.track,e),e?((r=i.track)===null||r===void 0||r.detach(),(s=i.track)===null||s===void 0||s.stop()):(a=i.track)===null||a===void 0||a.stopMonitor()}),this.localParticipant.off(D.ParticipantMetadataChanged,this.onLocalParticipantMetadataChanged).off(D.ParticipantNameChanged,this.onLocalParticipantNameChanged).off(D.AttributesChanged,this.onLocalAttributesChanged).off(D.TrackMuted,this.onLocalTrackMuted).off(D.TrackUnmuted,this.onLocalTrackUnmuted).off(D.LocalTrackPublished,this.onLocalTrackPublished).off(D.LocalTrackUnpublished,this.onLocalTrackUnpublished).off(D.ConnectionQualityChanged,this.onLocalConnectionQualityChanged).off(D.MediaDevicesError,this.onMediaDevicesError).off(D.AudioStreamAcquired,this.startAudio).off(D.ChatMessage,this.onLocalChatMessageSent).off(D.ParticipantPermissionsChanged,this.onLocalParticipantPermissionsChanged),this.localParticipant.trackPublications.clear(),this.localParticipant.videoTrackPublications.clear(),this.localParticipant.audioTrackPublications.clear(),this.remoteParticipants.clear(),this.sidToIdentity.clear(),this.activeSpeakers=[],this.audioContext&&typeof this.options.webAudioMix=="boolean"&&(this.audioContext.close(),this.audioContext=void 0),Ve()&&(window.removeEventListener("beforeunload",this.onPageLeave),window.removeEventListener("pagehide",this.onPageLeave),window.removeEventListener("freeze",this.onPageLeave),(n=navigator.mediaDevices)===null||n===void 0||n.removeEventListener("devicechange",this.handleDeviceChange))}finally{this.setAndEmitConnectionState(q.Disconnected),this.emit(I.Disconnected,A)}}}handleParticipantDisconnected(e,A){var n;this.remoteParticipants.delete(e),A&&(A.trackPublications.forEach(i=>{A.unpublishTrack(i.trackSid,!0)}),this.emit(I.ParticipantDisconnected,A),A.setDisconnected(),(n=this.localParticipant)===null||n===void 0||n.handleParticipantDisconnected(A.identity))}handleStreamHeader(e,A){return v(this,void 0,void 0,function*(){var n;if(e.contentHeader.case==="byteHeader"){const i=this.byteStreamHandlers.get(e.topic);if(!i){this.log.debug("ignoring incoming byte stream due to no handler for topic",e.topic);return}let r;const s={id:e.streamId,name:(n=e.contentHeader.value.name)!==null&&n!==void 0?n:"unknown",mimeType:e.mimeType,size:e.totalLength?Number(e.totalLength):void 0,topic:e.topic,timestamp:or(e.timestamp),attributes:e.attributes},a=new ReadableStream({start:o=>{r=o,this.byteStreamControllers.set(e.streamId,{info:s,controller:r,startTime:Date.now()})}});i(new jb(s,a,or(e.totalLength)),{identity:A})}else if(e.contentHeader.case==="textHeader"){const i=this.textStreamHandlers.get(e.topic);if(!i){this.log.debug("ignoring incoming text stream due to no handler for topic",e.topic);return}let r;const s={id:e.streamId,mimeType:e.mimeType,size:e.totalLength?Number(e.totalLength):void 0,topic:e.topic,timestamp:Number(e.timestamp),attributes:e.attributes},a=new ReadableStream({start:o=>{r=o,this.textStreamControllers.set(e.streamId,{info:s,controller:r,startTime:Date.now()})}});i(new Wb(s,a,or(e.totalLength)),{identity:A})}})}handleStreamChunk(e){const A=this.byteStreamControllers.get(e.streamId);A&&e.content.length>0&&A.controller.enqueue(e);const n=this.textStreamControllers.get(e.streamId);n&&e.content.length>0&&n.controller.enqueue(e)}handleStreamTrailer(e){const A=this.textStreamControllers.get(e.streamId);A&&(A.info.attributes=Object.assign(Object.assign({},A.info.attributes),e.attributes),A.controller.close(),this.textStreamControllers.delete(e.streamId));const n=this.byteStreamControllers.get(e.streamId);n&&(n.info.attributes=Object.assign(Object.assign({},n.info.attributes),e.attributes),n.controller.close(),this.byteStreamControllers.delete(e.streamId))}acquireAudioContext(){return v(this,void 0,void 0,function*(){var e,A;if(typeof this.options.webAudioMix!="boolean"&&this.options.webAudioMix.audioContext?this.audioContext=this.options.webAudioMix.audioContext:(!this.audioContext||this.audioContext.state==="closed")&&(this.audioContext=(e=xd())!==null&&e!==void 0?e:void 0),this.options.webAudioMix&&this.remoteParticipants.forEach(i=>i.setAudioContext(this.audioContext)),this.localParticipant.setAudioContext(this.audioContext),this.audioContext&&this.audioContext.state==="suspended")try{yield Promise.race([this.audioContext.resume(),Ke(200)])}catch(i){this.log.warn("Could not resume audio context",Object.assign(Object.assign({},this.logContext),{error:i}))}const n=((A=this.audioContext)===null||A===void 0?void 0:A.state)==="running";n!==this.canPlaybackAudio&&(this.audioEnabled=n,this.emit(I.AudioPlaybackStatusChanged,n))})}createParticipant(e,A){var n;let i;return A?i=pr.fromParticipantInfo(this.engine.client,A,{loggerContextCb:()=>this.logContext,loggerName:this.options.loggerName}):i=new pr(this.engine.client,"",e,void 0,void 0,void 0,{loggerContextCb:()=>this.logContext,loggerName:this.options.loggerName}),this.options.webAudioMix&&i.setAudioContext(this.audioContext),!((n=this.options.audioOutput)===null||n===void 0)&&n.deviceId&&i.setAudioOutput(this.options.audioOutput).catch(r=>this.log.warn("Could not set audio output: ".concat(r.message),this.logContext)),i}getOrCreateParticipant(e,A){if(this.remoteParticipants.has(e)){const i=this.remoteParticipants.get(e);return A&&i.updateInfo(A)&&this.sidToIdentity.set(A.sid,A.identity),i}const n=this.createParticipant(e,A);return this.remoteParticipants.set(e,n),this.sidToIdentity.set(A.sid,A.identity),this.emitWhenConnected(I.ParticipantConnected,n),n.on(D.TrackPublished,i=>{this.emitWhenConnected(I.TrackPublished,i,n)}).on(D.TrackSubscribed,(i,r)=>{i.kind===T.Kind.Audio?(i.on(_.AudioPlaybackStarted,this.handleAudioPlaybackStarted),i.on(_.AudioPlaybackFailed,this.handleAudioPlaybackFailed)):i.kind===T.Kind.Video&&(i.on(_.VideoPlaybackFailed,this.handleVideoPlaybackFailed),i.on(_.VideoPlaybackStarted,this.handleVideoPlaybackStarted)),this.emit(I.TrackSubscribed,i,r,n)}).on(D.TrackUnpublished,i=>{this.emit(I.TrackUnpublished,i,n)}).on(D.TrackUnsubscribed,(i,r)=>{this.emit(I.TrackUnsubscribed,i,r,n)}).on(D.TrackMuted,i=>{this.emitWhenConnected(I.TrackMuted,i,n)}).on(D.TrackUnmuted,i=>{this.emitWhenConnected(I.TrackUnmuted,i,n)}).on(D.ParticipantMetadataChanged,i=>{this.emitWhenConnected(I.ParticipantMetadataChanged,i,n)}).on(D.ParticipantNameChanged,i=>{this.emitWhenConnected(I.ParticipantNameChanged,i,n)}).on(D.AttributesChanged,i=>{this.emitWhenConnected(I.ParticipantAttributesChanged,i,n)}).on(D.ConnectionQualityChanged,i=>{this.emitWhenConnected(I.ConnectionQualityChanged,i,n)}).on(D.ParticipantPermissionsChanged,i=>{this.emitWhenConnected(I.ParticipantPermissionsChanged,i,n)}).on(D.TrackSubscriptionStatusChanged,(i,r)=>{this.emitWhenConnected(I.TrackSubscriptionStatusChanged,i,r,n)}).on(D.TrackSubscriptionFailed,(i,r)=>{this.emit(I.TrackSubscriptionFailed,i,n,r)}).on(D.TrackSubscriptionPermissionChanged,(i,r)=>{this.emitWhenConnected(I.TrackSubscriptionPermissionChanged,i,r,n)}).on(D.Active,()=>{this.emitWhenConnected(I.ParticipantActive,n)}),A&&n.updateInfo(A),n}sendSyncState(){const e=Array.from(this.remoteParticipants.values()).reduce((n,i)=>(n.push(...i.getTrackPublications()),n),[]),A=this.localParticipant.getTrackPublications();this.engine.sendSyncState(e,A)}updateSubscriptions(){for(const e of this.remoteParticipants.values())for(const A of e.videoTrackPublications.values())A.isSubscribed&&Ab(A)&&A.emitTrackUpdate()}getRemoteParticipantBySid(e){const A=this.sidToIdentity.get(e);if(A)return this.remoteParticipants.get(A)}registerConnectionReconcile(){this.clearConnectionReconcile();let e=0;this.connectionReconcileInterval=Te.setInterval(()=>{!this.engine||this.engine.isClosed||!this.engine.verifyTransport()?(e++,this.log.warn("detected connection state mismatch",Object.assign(Object.assign({},this.logContext),{numFailures:e,engine:this.engine?{closed:this.engine.isClosed,transportsConnected:this.engine.verifyTransport()}:void 0})),e>=3&&(this.recreateEngine(),this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,aA.STATE_MISMATCH))):e=0},iy)}clearConnectionReconcile(){this.connectionReconcileInterval&&Te.clearInterval(this.connectionReconcileInterval)}setAndEmitConnectionState(e){return e===this.state?!1:(this.state=e,this.emit(I.ConnectionStateChanged,this.state),!0)}emitBufferedEvents(){this.bufferedEvents.forEach(e=>{let[A,n]=e;this.emit(A,...n)}),this.bufferedEvents=[]}emitWhenConnected(e){for(var A=arguments.length,n=new Array(A>1?A-1:0),i=1;i<A;i++)n[i-1]=arguments[i];if(this.state===q.Reconnecting||this.isResuming||!this.engine||this.engine.pendingReconnect)this.bufferedEvents.push([e,n]);else if(this.state===q.Connected)return this.emit(e,...n);return!1}simulateParticipants(e){return v(this,void 0,void 0,function*(){var A,n;const i=Object.assign({audio:!0,video:!0,useRealTracks:!1},e.publish),r=Object.assign({count:9,audio:!1,video:!0,aspectRatios:[1.66,1.7,1.3]},e.participants);if(this.handleDisconnect(),this.roomInfo=new ji({sid:"RM_SIMULATED",name:"simulated-room",emptyTimeout:0,maxParticipants:0,creationTime:se.parse(new Date().getTime()),metadata:"",numParticipants:1,numPublishers:1,turnPassword:"",enabledCodecs:[],activeRecording:!1}),this.localParticipant.updateInfo(new ht({identity:"simulated-local",name:"local-name"})),this.setupLocalParticipantEvents(),this.emit(I.SignalConnected),this.emit(I.Connected),this.setAndEmitConnectionState(q.Connected),i.video){const s=new ja(T.Kind.Video,new Ot({source:Be.CAMERA,sid:Math.floor(Math.random()*1e4).toString(),type:sA.AUDIO,name:"video-dummy"}),new fr(i.useRealTracks?(yield window.navigator.mediaDevices.getUserMedia({video:!0})).getVideoTracks()[0]:kd(160*((A=r.aspectRatios[0])!==null&&A!==void 0?A:1),160,!0,!0),void 0,!1,{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext}),{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext});this.localParticipant.addTrackPublication(s),this.localParticipant.emit(D.LocalTrackPublished,s)}if(i.audio){const s=new ja(T.Kind.Audio,new Ot({source:Be.MICROPHONE,sid:Math.floor(Math.random()*1e4).toString(),type:sA.AUDIO}),new dr(i.useRealTracks?(yield navigator.mediaDevices.getUserMedia({audio:!0})).getAudioTracks()[0]:Ca(),void 0,!1,this.audioContext,{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext}),{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext});this.localParticipant.addTrackPublication(s),this.localParticipant.emit(D.LocalTrackPublished,s)}for(let s=0;s<r.count-1;s+=1){let a=new ht({sid:Math.floor(Math.random()*1e4).toString(),identity:"simulated-".concat(s),state:Ht.ACTIVE,tracks:[],joinedAt:se.parse(Date.now())});const o=this.getOrCreateParticipant(a.identity,a);if(r.video){const c=kd(160*((n=r.aspectRatios[s%r.aspectRatios.length])!==null&&n!==void 0?n:1),160,!1,!0),l=new Ot({source:Be.CAMERA,sid:Math.floor(Math.random()*1e4).toString(),type:sA.AUDIO});o.addSubscribedMediaTrack(c,l.sid,new MediaStream([c]),new RTCRtpReceiver),a.tracks=[...a.tracks,l]}if(r.audio){const c=Ca(),l=new Ot({source:Be.MICROPHONE,sid:Math.floor(Math.random()*1e4).toString(),type:sA.AUDIO});o.addSubscribedMediaTrack(c,l.sid,new MediaStream([c]),new RTCRtpReceiver),a.tracks=[...a.tracks,l]}o.updateInfo(a)}})}emit(e){for(var A=arguments.length,n=new Array(A>1?A-1:0),i=1;i<A;i++)n[i-1]=arguments[i];if(e!==I.ActiveSpeakersChanged&&e!==I.TranscriptionReceived){const r=ah(n).filter(s=>s!==void 0);this.log.debug("room event ".concat(e),Object.assign(Object.assign({},this.logContext),{event:e,args:r}))}return super.emit(e,...n)}}qt.cleanupRegistry=typeof FinalizationRegistry<"u"&&new FinalizationRegistry(t=>{t()});function ah(t){return t.map(e=>{if(e)return Array.isArray(e)?ah(e):typeof e=="object"?"logContext"in e?e.logContext:void 0:e})}var fA;(function(t){t[t.IDLE=0]="IDLE",t[t.RUNNING=1]="RUNNING",t[t.SKIPPED=2]="SKIPPED",t[t.SUCCESS=3]="SUCCESS",t[t.FAILED=4]="FAILED"})(fA||(fA={}));class nt extends yA.EventEmitter{constructor(e,A){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};super(),this.status=fA.IDLE,this.logs=[],this.options={},this.url=e,this.token=A,this.name=this.constructor.name,this.room=new qt(n.roomOptions),this.connectOptions=n.connectOptions,this.options=n}run(e){return v(this,void 0,void 0,function*(){if(this.status!==fA.IDLE)throw Error("check is running already");this.setStatus(fA.RUNNING);try{yield this.perform()}catch(A){A instanceof Error&&(this.options.errorsAsWarnings?this.appendWarning(A.message):this.appendError(A.message))}return yield this.disconnect(),yield new Promise(A=>setTimeout(A,500)),this.status!==fA.SKIPPED&&this.setStatus(this.isSuccess()?fA.SUCCESS:fA.FAILED),e&&e(),this.getInfo()})}isSuccess(){return!this.logs.some(e=>e.level==="error")}connect(e){return v(this,void 0,void 0,function*(){return this.room.state===q.Connected?this.room:(e||(e=this.url),yield this.room.connect(e,this.token,this.connectOptions),this.room)})}disconnect(){return v(this,void 0,void 0,function*(){this.room&&this.room.state!==q.Disconnected&&(yield this.room.disconnect(),yield new Promise(e=>setTimeout(e,500)))})}skip(){this.setStatus(fA.SKIPPED)}switchProtocol(e){return v(this,void 0,void 0,function*(){let A=!1,n=!1;if(this.room.on(I.Reconnecting,()=>{A=!0}),this.room.once(I.Reconnected,()=>{n=!0}),this.room.simulateScenario("force-".concat(e)),yield new Promise(r=>setTimeout(r,1e3)),!A)return;const i=Date.now()+1e4;for(;Date.now()<i;){if(n)return;yield Ke(100)}throw new Error("Could not reconnect using ".concat(e," protocol after 10 seconds"))})}appendMessage(e){this.logs.push({level:"info",message:e}),this.emit("update",this.getInfo())}appendWarning(e){this.logs.push({level:"warning",message:e}),this.emit("update",this.getInfo())}appendError(e){this.logs.push({level:"error",message:e}),this.emit("update",this.getInfo())}setStatus(e){this.status=e,this.emit("update",this.getInfo())}get engine(){var e;return(e=this.room)===null||e===void 0?void 0:e.engine}getInfo(){return{logs:this.logs,name:this.name,status:this.status,description:this.description}}}class ry extends nt{get description(){return"Cloud regions"}perform(){return v(this,void 0,void 0,function*(){const e=new Ka(this.url,this.token);if(!e.isCloud()){this.skip();return}const A=[],n=new Set;for(let r=0;r<3;r++){const s=yield e.getNextBestRegionUrl();if(!s)break;if(n.has(s))continue;n.add(s);const a=yield this.checkCloudRegion(s);this.appendMessage("".concat(a.region," RTT: ").concat(a.rtt,"ms, duration: ").concat(a.duration,"ms")),A.push(a)}A.sort((r,s)=>(r.duration-s.duration)*.5+(r.rtt-s.rtt)*.5);const i=A[0];this.bestStats=i,this.appendMessage("best Cloud region: ".concat(i.region))})}getInfo(){const e=super.getInfo();return e.data=this.bestStats,e}checkCloudRegion(e){return v(this,void 0,void 0,function*(){var A,n;yield this.connect(e),this.options.protocol==="tcp"&&(yield this.switchProtocol("tcp"));const i=(A=this.room.serverInfo)===null||A===void 0?void 0:A.region;if(!i)throw new Error("Region not found");const r=yield this.room.localParticipant.streamText({topic:"test"}),s=1e3,o=1e6/s,c="A".repeat(s),l=Date.now();for(let g=0;g<o;g++)yield r.write(c);yield r.close();const u=Date.now(),d=yield(n=this.room.engine.pcManager)===null||n===void 0?void 0:n.publisher.getStats(),h={region:i,rtt:1e4,duration:u-l};return d==null||d.forEach(g=>{g.type==="candidate-pair"&&g.nominated&&(h.rtt=g.currentRoundTripTime*1e3)}),yield this.disconnect(),h})}}const Wa=1e4;class sy extends nt{get description(){return"Connection via UDP vs TCP"}perform(){return v(this,void 0,void 0,function*(){const e=yield this.checkConnectionProtocol("udp"),A=yield this.checkConnectionProtocol("tcp");this.bestStats=e,e.qualityLimitationDurations.bandwidth-A.qualityLimitationDurations.bandwidth>.5||(e.packetsLost-A.packetsLost)/e.packetsSent>.01?(this.appendMessage("best connection quality via tcp"),this.bestStats=A):this.appendMessage("best connection quality via udp");const n=this.bestStats;this.appendMessage("upstream bitrate: ".concat((n.bitrateTotal/n.count/1e3/1e3).toFixed(2)," mbps")),this.appendMessage("RTT: ".concat((n.rttTotal/n.count*1e3).toFixed(2)," ms")),this.appendMessage("jitter: ".concat((n.jitterTotal/n.count*1e3).toFixed(2)," ms")),n.packetsLost>0&&this.appendWarning("packets lost: ".concat((n.packetsLost/n.packetsSent*100).toFixed(2),"%")),n.qualityLimitationDurations.bandwidth>1&&this.appendWarning("bandwidth limited ".concat((n.qualityLimitationDurations.bandwidth/(Wa/1e3)*100).toFixed(2),"%")),n.qualityLimitationDurations.cpu>0&&this.appendWarning("cpu limited ".concat((n.qualityLimitationDurations.cpu/(Wa/1e3)*100).toFixed(2),"%"))})}getInfo(){const e=super.getInfo();return e.data=this.bestStats,e}checkConnectionProtocol(e){return v(this,void 0,void 0,function*(){yield this.connect(),e==="tcp"?yield this.switchProtocol("tcp"):yield this.switchProtocol("udp");const A=document.createElement("canvas");A.width=1280,A.height=720;const n=A.getContext("2d");if(!n)throw new Error("Could not get canvas context");let i=0;const r=()=>{i=(i+1)%360,n.fillStyle="hsl(".concat(i,", 100%, 50%)"),n.fillRect(0,0,A.width,A.height),requestAnimationFrame(r)};r();const a=A.captureStream(30).getVideoTracks()[0],c=(yield this.room.localParticipant.publishTrack(a,{simulcast:!1,degradationPreference:"maintain-resolution",videoEncoding:{maxBitrate:2e6}})).track,l={protocol:e,packetsLost:0,packetsSent:0,qualityLimitationDurations:{},rttTotal:0,jitterTotal:0,bitrateTotal:0,count:0},u=setInterval(()=>v(this,void 0,void 0,function*(){const d=yield c.getRTCStatsReport();d==null||d.forEach(h=>{h.type==="outbound-rtp"?(l.packetsSent=h.packetsSent,l.qualityLimitationDurations=h.qualityLimitationDurations,l.bitrateTotal+=h.targetBitrate,l.count++):h.type==="remote-inbound-rtp"&&(l.packetsLost=h.packetsLost,l.rttTotal+=h.roundTripTime,l.jitterTotal+=h.jitter)})}),1e3);return yield new Promise(d=>setTimeout(d,Wa)),clearInterval(u),a.stop(),A.remove(),yield this.disconnect(),l})}}class ay extends nt{get description(){return"Can publish audio"}perform(){return v(this,void 0,void 0,function*(){var e;const A=yield this.connect(),n=yield $b();if(yield Id(n,1e3))throw new Error("unable to detect audio from microphone");this.appendMessage("detected audio from microphone"),A.localParticipant.publishTrack(n),yield new Promise(a=>setTimeout(a,3e3));const r=yield(e=n.sender)===null||e===void 0?void 0:e.getStats();if(!r)throw new Error("Could not get RTCStats");let s=0;if(r.forEach(a=>{a.type==="outbound-rtp"&&(a.kind==="audio"||!a.kind&&a.mediaType==="audio")&&(s=a.packetsSent)}),s===0)throw new Error("Could not determine packets are sent");this.appendMessage("published ".concat(s," audio packets"))})}}class oy extends nt{get description(){return"Can publish video"}perform(){return v(this,void 0,void 0,function*(){var e;const A=yield this.connect(),n=yield Zb();yield this.checkForVideo(n.mediaStreamTrack),A.localParticipant.publishTrack(n),yield new Promise(s=>setTimeout(s,5e3));const i=yield(e=n.sender)===null||e===void 0?void 0:e.getStats();if(!i)throw new Error("Could not get RTCStats");let r=0;if(i.forEach(s=>{s.type==="outbound-rtp"&&(s.kind==="video"||!s.kind&&s.mediaType==="video")&&(r+=s.packetsSent)}),r===0)throw new Error("Could not determine packets are sent");this.appendMessage("published ".concat(r," video packets"))})}checkForVideo(e){return v(this,void 0,void 0,function*(){const A=new MediaStream;A.addTrack(e.clone());const n=document.createElement("video");n.srcObject=A,n.muted=!0,yield new Promise(i=>{n.onplay=()=>{setTimeout(()=>{var r,s,a,o;const c=document.createElement("canvas"),l=e.getSettings(),u=(s=(r=l.width)!==null&&r!==void 0?r:n.videoWidth)!==null&&s!==void 0?s:1280,d=(o=(a=l.height)!==null&&a!==void 0?a:n.videoHeight)!==null&&o!==void 0?o:720;c.width=u,c.height=d;const h=c.getContext("2d");h.drawImage(n,0,0);const f=h.getImageData(0,0,c.width,c.height).data;let m=!0;for(let B=0;B<f.length;B+=4)if(f[B]!==0||f[B+1]!==0||f[B+2]!==0){m=!1;break}m?this.appendError("camera appears to be producing only black frames"):this.appendMessage("received video frames"),i()},1e3)},n.play()}),n.remove()})}}class cy extends nt{get description(){return"Resuming connection after interruption"}perform(){return v(this,void 0,void 0,function*(){var e;const A=yield this.connect();let n=!1,i=!1,r;const s=new Promise(c=>{setTimeout(c,5e3),r=c}),a=()=>{n=!0};A.on(I.SignalReconnecting,a).on(I.Reconnecting,a).on(I.Reconnected,()=>{i=!0,r(!0)}),(e=A.engine.client.ws)===null||e===void 0||e.close();const o=A.engine.client.onClose;if(o&&o(""),yield s,n){if(!i||A.state!==q.Connected)throw this.appendWarning("reconnection is only possible in Redis-based configurations"),new Error("Not able to reconnect")}else throw new Error("Did not attempt to reconnect")})}}class ly extends nt{get description(){return"Can connect via TURN"}perform(){return v(this,void 0,void 0,function*(){var e,A;const n=new ka,i=yield n.join(this.url,this.token,{autoSubscribe:!0,maxRetries:0,e2eeEnabled:!1,websocketTimeout:15e3});let r=!1,s=!1,a=!1;for(let o of i.iceServers)for(let c of o.urls)c.startsWith("turn:")?(s=!0,a=!0):c.startsWith("turns:")&&(s=!0,a=!0,r=!0),c.startsWith("stun:")&&(a=!0);a?s&&!r&&this.appendWarning("TURN is configured server side, but TURN/TLS is unavailable."):this.appendWarning("No STUN servers configured on server side."),yield n.close(),!((A=(e=this.connectOptions)===null||e===void 0?void 0:e.rtcConfig)===null||A===void 0)&&A.iceServers||s?yield this.room.connect(this.url,this.token,{rtcConfig:{iceTransportPolicy:"relay"}}):(this.appendWarning("No TURN servers configured."),this.skip(),yield new Promise(o=>setTimeout(o,0)))})}}class uy extends nt{get description(){return"Establishing WebRTC connection"}perform(){return v(this,void 0,void 0,function*(){let e=!1,A=!1;this.room.on(I.SignalConnected,()=>{const n=this.room.engine.client.onTrickle;this.room.engine.client.onTrickle=(i,r)=>{if(i.candidate){const s=new RTCIceCandidate(i);let a="".concat(s.protocol," ").concat(s.address,":").concat(s.port," ").concat(s.type);s.address&&(dy(s.address)?a+=" (private)":s.protocol==="tcp"&&s.tcpType==="passive"?(e=!0,a+=" (passive)"):s.protocol==="udp"&&(A=!0)),this.appendMessage(a)}n&&n(i,r)},this.room.engine.pcManager&&(this.room.engine.pcManager.subscriber.onIceCandidateError=i=>{i instanceof RTCPeerConnectionIceErrorEvent&&this.appendWarning("error with ICE candidate: ".concat(i.errorCode," ").concat(i.errorText," ").concat(i.url))})});try{yield this.connect(),W.info("now the room is connected")}catch(n){throw this.appendWarning("ports need to be open on firewall in order to connect."),n}e||this.appendWarning("Server is not configured for ICE/TCP"),A||this.appendWarning("No public IPv4 UDP candidates were found. Your server is likely not configured correctly")})}}function dy(t){const e=t.split(".");if(e.length===4){if(e[0]==="10")return!0;if(e[0]==="192"&&e[1]==="168")return!0;if(e[0]==="172"){const A=parseInt(e[1],10);if(A>=16&&A<=31)return!0}}return!1}class hy extends nt{get description(){return"Connecting to signal connection via WebSocket"}perform(){return v(this,void 0,void 0,function*(){var e,A,n;(this.url.startsWith("ws:")||this.url.startsWith("http:"))&&this.appendWarning("Server is insecure, clients may block connections to it");let i=new ka;const r=yield i.join(this.url,this.token,{autoSubscribe:!0,maxRetries:0,e2eeEnabled:!1,websocketTimeout:15e3});this.appendMessage("Connected to server, version ".concat(r.serverVersion,".")),((e=r.serverInfo)===null||e===void 0?void 0:e.edition)===lu.Cloud&&(!((A=r.serverInfo)===null||A===void 0)&&A.region)&&this.appendMessage("LiveKit Cloud: ".concat((n=r.serverInfo)===null||n===void 0?void 0:n.region)),yield i.close()})}}class MU extends yA.EventEmitter{constructor(e,A){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};super(),this.options={},this.checkResults=new Map,this.url=e,this.token=A,this.options=n}getNextCheckId(){const e=this.checkResults.size;return this.checkResults.set(e,{logs:[],status:fA.IDLE,name:"",description:""}),e}updateCheck(e,A){this.checkResults.set(e,A),this.emit("checkUpdate",e,A)}isSuccess(){return Array.from(this.checkResults.values()).every(e=>e.status!==fA.FAILED)}getResults(){return Array.from(this.checkResults.values())}createAndRunCheck(e){return v(this,void 0,void 0,function*(){const A=this.getNextCheckId(),n=new e(this.url,this.token,this.options),i=s=>{this.updateCheck(A,s)};n.on("update",i);const r=yield n.run();return n.off("update",i),r})}checkWebsocket(){return v(this,void 0,void 0,function*(){return this.createAndRunCheck(hy)})}checkWebRTC(){return v(this,void 0,void 0,function*(){return this.createAndRunCheck(uy)})}checkTURN(){return v(this,void 0,void 0,function*(){return this.createAndRunCheck(ly)})}checkReconnect(){return v(this,void 0,void 0,function*(){return this.createAndRunCheck(cy)})}checkPublishAudio(){return v(this,void 0,void 0,function*(){return this.createAndRunCheck(ay)})}checkPublishVideo(){return v(this,void 0,void 0,function*(){return this.createAndRunCheck(oy)})}checkConnectionProtocol(){return v(this,void 0,void 0,function*(){const e=yield this.createAndRunCheck(sy);if(e.data&&"protocol"in e.data){const A=e.data;this.options.protocol=A.protocol}return e})}checkCloudRegion(){return v(this,void 0,void 0,function*(){return this.createAndRunCheck(ry)})}}const fy=/\{[^{}]+\}/g;function gy(){return Math.random().toString(36).slice(2,11)}function py(t){let{baseUrl:e="",Request:A=globalThis.Request,fetch:n=globalThis.fetch,querySerializer:i,bodySerializer:r,headers:s,...a}={...t};e=uh(e);const o=[];async function c(l,u){const{baseUrl:d,fetch:h=n,Request:g=A,headers:f,params:m={},parseAs:B="json",querySerializer:b,bodySerializer:U=r??By,body:C,...w}=u||{};d&&(e=uh(d));let y=typeof i=="function"?i:lh(i);b&&(y=typeof b=="function"?b:lh({...typeof i=="object"?i:{},...b}));const E=C===void 0?void 0:U(C),F=E===void 0||E instanceof FormData?{}:{"Content-Type":"application/json"},S={redirect:"follow",...a,...w,body:E,headers:Cy(F,s,f,m.header)};let x,R,L=new A(vy(l,{baseUrl:e,params:m,querySerializer:y}),S);for(const N in w)N in L||(L[N]=w[N]);if(o.length){x=gy(),R=Object.freeze({baseUrl:e,fetch:h,parseAs:B,querySerializer:y,bodySerializer:U});for(const N of o)if(N&&typeof N=="object"&&typeof N.onRequest=="function"){const V=await N.onRequest({request:L,schemaPath:l,params:m,options:R,id:x});if(V){if(!(V instanceof A))throw new Error("onRequest: must return new Request() when modifying the request");L=V}}}let M=await h(L);if(o.length)for(let N=o.length-1;N>=0;N--){const V=o[N];if(V&&typeof V=="object"&&typeof V.onResponse=="function"){const Fe=await V.onResponse({request:L,response:M,schemaPath:l,params:m,options:R,id:x});if(Fe){if(!(Fe instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response");M=Fe}}}if(M.status===204||M.headers.get("Content-Length")==="0")return M.ok?{data:{},response:M}:{error:{},response:M};if(M.ok)return B==="stream"?{data:M.body,response:M}:{data:await M[B](),response:M};let te=await M.text();try{te=JSON.parse(te)}catch{}return{error:te,response:M}}return{GET(l,u){return c(l,{...u,method:"GET"})},PUT(l,u){return c(l,{...u,method:"PUT"})},POST(l,u){return c(l,{...u,method:"POST"})},DELETE(l,u){return c(l,{...u,method:"DELETE"})},OPTIONS(l,u){return c(l,{...u,method:"OPTIONS"})},HEAD(l,u){return c(l,{...u,method:"HEAD"})},PATCH(l,u){return c(l,{...u,method:"PATCH"})},TRACE(l,u){return c(l,{...u,method:"TRACE"})},use(...l){for(const u of l)if(u){if(typeof u!="object"||!("onRequest"in u||"onResponse"in u))throw new Error("Middleware must be an object with one of `onRequest()` or `onResponse()`");o.push(u)}},eject(...l){for(const u of l){const d=o.indexOf(u);d!==-1&&o.splice(d,1)}}}}function mr(t,e,A){if(e==null)return"";if(typeof e=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${(A==null?void 0:A.allowReserved)===!0?e:encodeURIComponent(e)}`}function oh(t,e,A){if(!e||typeof e!="object")return"";const n=[],i={simple:",",label:".",matrix:";"}[A.style]||"&";if(A.style!=="deepObject"&&A.explode===!1){for(const a in e)n.push(a,A.allowReserved===!0?e[a]:encodeURIComponent(e[a]));const s=n.join(",");switch(A.style){case"form":return`${t}=${s}`;case"label":return`.${s}`;case"matrix":return`;${t}=${s}`;default:return s}}for(const s in e){const a=A.style==="deepObject"?`${t}[${s}]`:s;n.push(mr(a,e[s],A))}const r=n.join(i);return A.style==="label"||A.style==="matrix"?`${i}${r}`:r}function ch(t,e,A){if(!Array.isArray(e))return"";if(A.explode===!1){const r={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[A.style]||",",s=(A.allowReserved===!0?e:e.map(a=>encodeURIComponent(a))).join(r);switch(A.style){case"simple":return s;case"label":return`.${s}`;case"matrix":return`;${t}=${s}`;default:return`${t}=${s}`}}const n={simple:",",label:".",matrix:";"}[A.style]||"&",i=[];for(const r of e)A.style==="simple"||A.style==="label"?i.push(A.allowReserved===!0?r:encodeURIComponent(r)):i.push(mr(t,r,A));return A.style==="label"||A.style==="matrix"?`${n}${i.join(n)}`:i.join(n)}function lh(t){return function(A){const n=[];if(A&&typeof A=="object")for(const i in A){const r=A[i];if(r!=null){if(Array.isArray(r)){if(r.length===0)continue;n.push(ch(i,r,{style:"form",explode:!0,...t==null?void 0:t.array,allowReserved:(t==null?void 0:t.allowReserved)||!1}));continue}if(typeof r=="object"){n.push(oh(i,r,{style:"deepObject",explode:!0,...t==null?void 0:t.object,allowReserved:(t==null?void 0:t.allowReserved)||!1}));continue}n.push(mr(i,r,t))}}return n.join("&")}}function my(t,e){let A=t;for(const n of t.match(fy)??[]){let i=n.substring(1,n.length-1),r=!1,s="simple";if(i.endsWith("*")&&(r=!0,i=i.substring(0,i.length-1)),i.startsWith(".")?(s="label",i=i.substring(1)):i.startsWith(";")&&(s="matrix",i=i.substring(1)),!e||e[i]===void 0||e[i]===null)continue;const a=e[i];if(Array.isArray(a)){A=A.replace(n,ch(i,a,{style:s,explode:r}));continue}if(typeof a=="object"){A=A.replace(n,oh(i,a,{style:s,explode:r}));continue}if(s==="matrix"){A=A.replace(n,`;${mr(i,a)}`);continue}A=A.replace(n,s==="label"?`.${encodeURIComponent(a)}`:encodeURIComponent(a))}return A}function By(t){return t instanceof FormData?t:JSON.stringify(t)}function vy(t,e){var i;let A=`${e.baseUrl}${t}`;(i=e.params)!=null&&i.path&&(A=my(A,e.params.path));let n=e.querySerializer(e.params.query??{});return n.startsWith("?")&&(n=n.substring(1)),n&&(A+=`?${n}`),A}function Cy(...t){const e=new Headers;for(const A of t){if(!A||typeof A!="object")continue;const n=A instanceof Headers?A.entries():Object.entries(A);for(const[i,r]of n)if(r===null)e.delete(i);else if(Array.isArray(r))for(const s of r)e.append(i,s);else r!==void 0&&e.set(i,r)}return e}function uh(t){return t.endsWith("/")?t.substring(0,t.length-1):t}const dh="Onboardee-Session-Token",hh="OnboardeeSessionToken";class fh{constructor(e){this.client=py({baseUrl:e.baseUrl,headers:e.headers,fetch:e.fetch}),this.client.use({onRequest({request:A}){if(window.localStorage){const n=window.localStorage.getItem(hh);n&&A.headers.set(dh,n)}return A},onResponse({response:A}){const n=A.headers.get(dh);return n&&window.localStorage&&window.localStorage.setItem(hh,n),A}})}setAuthToken(e){this.client.use({onRequest({request:A}){return A.headers.set("Authorization",`Bearer ${e}`),A}})}setApiToken(e){this.client.use({onRequest({request:A}){return A.headers.set("Authorization",`Token ${e}`),A}})}async getAuthUrl(e){return await this.client.GET("/api/auth/{type}",{params:{path:{type:e}}})}async getConnectUrl(e){return await this.client.GET("/api/connect/{type}",{params:{path:{type:e}}})}async logout(){return await this.client.POST("/api/logout")}async getCurrentUser(){return await this.client.GET("/api/me")}async clientInitialise(e,A={}){return await this.client.POST("/api/client/{appToken}/initialise",{params:{path:{appToken:e}},body:A})}async clientStartSession(e,A){return await this.client.POST("/api/client/{appToken}/start-session",{params:{path:{appToken:e}},body:A})}async createPresignedUploadUrl(e){return await this.client.POST("/api/files",{body:e})}async createKnowledgeBlock(e){return await this.client.POST("/api/knowledge",{body:e})}async listOnboardees(){return await this.client.GET("/api/onboardees")}async getOnboardee(e){return await this.client.GET("/api/onboardees/{id}",{params:{path:{id:e}}})}async getOnboardeeWidgetConfig(e,A){return await this.client.GET("/api/onboardees/{id}/config",{params:{path:{id:e}},signal:A})}async listPlans(){return await this.client.GET("/api/plans")}async listProducts(){return await this.client.GET("/api/products")}async getProduct(e){return await this.client.GET("/api/products/{id}",{params:{path:{id:e}}})}async getProductAnalytics(e,A,n){return await this.client.GET("/api/products/{id}/analytics",{params:{path:{id:e},query:{...A&&{start_date:A},...n&&{end_date:n}}}})}async getCourseAnalytics(e,A,n){return await this.client.GET("/api/courses/analytics",{params:{query:{...e&&{product_id:e.toString()},...A&&{start_date:A},...n&&{end_date:n}}}})}async createProduct(e){return await this.client.POST("/api/products",{body:e})}async updateProduct(e,A){return await this.client.PATCH("/api/products/{id}",{params:{path:{id:e}},body:A})}async getProductNavigationIndex(e){return await this.client.GET("/api/products/{id}/navigation-index",{params:{path:{id:e}}})}async replaceProductNavigationIndex(e,A){return await this.client.PUT("/api/products/{id}/navigation-index",{params:{path:{id:e}},body:A})}async listProductKnowledgeBlocks(e){return await this.client.GET("/api/products/{id}/knowledge-blocks",{params:{path:{id:e}}})}async createProductKnowledgeBlock(e,A){return await this.client.POST("/api/products/{id}/knowledge-blocks",{params:{path:{id:e}},body:A})}async searchProductKnowledgeBlocks(e,A,n){return await this.client.GET("/api/products/{id}/knowledge-blocks/search",{params:{path:{id:e},query:{q:A,...n&&{limit:n.toString()}}}})}async updateProductKnowledgeBlock(e,A,n){return await this.client.PATCH("/api/products/{id}/knowledge-blocks/{blockId}",{params:{path:{id:e,blockId:A}},body:n})}async deleteProductKnowledgeBlock(e,A){return await this.client.DELETE("/api/products/{id}/knowledge-blocks/{blockId}",{params:{path:{id:e,blockId:A}}})}async createPlan(e){return await this.client.POST("/api/plans",{body:e})}async getPlan(e){return await this.client.GET("/api/plans/{id}",{params:{path:{id:e}}})}async replacePlan(e,A){return await this.client.PUT("/api/plans/{id}",{params:{path:{id:e}},body:A})}async updatePlan(e,A){return await this.client.PATCH("/api/plans/{id}",{params:{path:{id:e}},body:A})}async getPlanVideoUrl(e){return await this.client.GET("/api/plans/{id}/video-url",{params:{path:{id:e}}})}async deletePlan(e){return await this.client.DELETE("/api/admin/plans/{id}",{params:{path:{id:e}}})}async publishPlanRevision(e,A){return await this.client.POST("/api/plans/{id}/publish",{params:{path:{id:e}},body:A})}async listPlanRevisions(e){return await this.client.GET("/api/plans/{id}/revisions",{params:{path:{id:e}}})}async listPlanKnowledgeBlocks(e){return await this.client.GET("/api/plans/{id}/knowledge-blocks",{params:{path:{id:e}}})}async createPlanKnowledgeBlock(e,A){return await this.client.POST("/api/plans/{id}/knowledge-blocks",{params:{path:{id:e}},body:A})}async updatePlanKnowledgeBlock(e,A,n){return await this.client.PUT("/api/plans/{id}/knowledge-blocks/{blockId}",{params:{path:{id:e,blockId:A}},body:n})}async deletePlanKnowledgeBlock(e,A){return await this.client.DELETE("/api/plans/{id}/knowledge-blocks/{blockId}",{params:{path:{id:e,blockId:A}}})}async getPlanNavigationIndex(e){return await this.client.GET("/api/plans/{id}/navigation-index",{params:{path:{id:e}}})}async replacePlanNavigationIndex(e,A){return await this.client.POST("/api/plans/{id}/navigation-index",{params:{path:{id:e}},body:A})}async getRevisionNavigationIndex(e){return await this.client.GET("/api/revisions/{id}/navigation-index",{params:{path:{id:e}}})}async replaceRevisionNavigationIndex(e,A){return await this.client.PUT("/api/revisions/{id}/navigation-index",{params:{path:{id:e}},body:A})}async getRevisionFAQ(e){return await this.client.GET("/api/revisions/{id}/faq",{params:{path:{id:e}}})}async replaceRevisionFAQ(e,A){return await this.client.PUT("/api/revisions/{id}/faq",{params:{path:{id:e}},body:A})}async listRevisionKnowledgeBlocks(e){return await this.client.GET("/api/revisions/{id}/knowledge-blocks",{params:{path:{id:e}}})}async getRevisionSteps(e){return await this.client.GET("/api/revisions/{id}/steps",{params:{path:{id:e}}})}async replaceRevisionKnowledgeBlocks(e,A){return await this.client.PUT("/api/revisions/{id}/knowledge-blocks",{params:{path:{id:e}},body:A})}async createRevisionKnowledgeBlock(e,A){return await this.client.POST("/api/revisions/{id}/knowledge-blocks",{params:{path:{id:e}},body:A})}async updateRevisionKnowledgeBlock(e,A,n){return await this.client.PUT("/api/revisions/{id}/knowledge-blocks/{blockId}",{params:{path:{id:e,blockId:A}},body:n})}async deleteRevisionKnowledgeBlock(e,A){return await this.client.DELETE("/api/revisions/{id}/knowledge-blocks/{blockId}",{params:{path:{id:e,blockId:A}}})}async listSessions(e,A){const n={token:e};return A!=null&&A.productId&&(n.product_id=A.productId),A!=null&&A.startDate&&(n.start_date=A.startDate),A!=null&&A.endDate&&(n.end_date=A.endDate),await this.client.GET("/api/sessions",{params:{query:n}})}async createSession(e){return await this.client.POST("/api/sessions",{body:e})}async getSession(e){return await this.client.GET("/api/sessions/{id}",{params:{path:{id:e}}})}async startSession(e,A){return await this.client.GET("/api/sessions/{id}/start-session",{params:{path:{id:e},query:{token:A}}})}async getSessionRecording(e){return await this.client.GET("/api/sessions/{id}/recording",{params:{path:{id:e}}})}async getSessionSummary(e){return await this.client.GET("/api/sessions/{id}/summary",{params:{path:{id:e}}})}async getSessionProductUrl(e){return await this.client.GET("/api/sessions/{id}/product-url",{params:{path:{id:e}}})}async updateSession(e,A){return await this.client.PATCH("/api/sessions/{id}",{params:{path:{id:e}},body:A})}async listUserSessions(e){const A={};return e!=null&&e.productId&&(A.product_id=e.productId),e!=null&&e.startDate&&(A.start_date=e.startDate),e!=null&&e.endDate&&(A.end_date=e.endDate),e!=null&&e.page&&(A.page=e.page),e!=null&&e.limit&&(A.limit=e.limit),e!=null&&e.courseName&&(A.course_name=e.courseName),e!=null&&e.userName&&(A.user_name=e.userName),e!=null&&e.company&&(A.company=e.company),e!=null&&e.email&&(A.email=e.email),e!=null&&e.sortBy&&(A.sort_by=e.sortBy),e!=null&&e.sortOrder&&(A.sort_order=e.sortOrder),await this.client.GET("/api/user-sessions",{params:Object.keys(A).length>0?{query:A}:void 0})}async listUserSessionsAggregate(e){const A={};return e!=null&&e.productId&&(A.product_id=e.productId),e!=null&&e.startDate&&(A.start_date=e.startDate),e!=null&&e.endDate&&(A.end_date=e.endDate),await this.client.GET("/api/user-sessions-aggregate",{params:Object.keys(A).length>0?{query:A}:void 0})}async getJoinToken(e,{clientType:A,user:n}={}){return await this.client.GET("/api/join-token",{params:{query:{token:e,...A&&{client_type:A},...n&&{user:encodeURIComponent(n)}}}})}async trackEvent(e){try{return await this.client.POST("/api/track",{body:{sent_at:new Date().toISOString(),...e}})}catch(A){console.error("[obi] error tracking event:",A)}return{}}async getSessionPlan(e){return await this.client.GET("/api/sessions/{id}/plan",{params:{path:{id:e}}})}getClient(){return this.client}}const gh="https://app.coragents.ai";class Br extends kr{constructor(e,A,n,i){super(),this.state=null,this.isPaused=!1,this.speakingState=null,this.captureScreen=null,this.sessionUuid=null,this.roomId=null,this.joinToken=null,this.roomUrl=null,this.room=null,this.agentAnalyser=null,this.userAnalyser=null,this.appToken=e,this.planId=A,this.clientType=n,this.api=i.api||new fh({baseUrl:gh}),this.identity=i.identity||null,this.roomFactory=i.roomFactory||(r=>new qt(r)),this.captureScreen=i.captureScreen||null}async start(){this.planId,this.setState("connecting"),this.speakingStateChanged("thinking");try{const A=(await this.api.clientStartSession(this.appToken,{client_type:this.clientType,onboarding_plan:this.planId})).data;if(!(A!=null&&A.url)||!(A!=null&&A.token)||!(A!=null&&A.room)||!(A!=null&&A.session_uuid))throw new Error("Invalid room info");this.sessionUuid=A==null?void 0:A.session_uuid,this.roomId=A==null?void 0:A.room,this.joinToken=A==null?void 0:A.token,this.roomUrl=A==null?void 0:A.url,await this.joinRoom(),this.setState("connected"),this.planId,this.sessionUuid}catch(e){console.error("[obi] error starting session",{error:e}),this.setState("error")}}async joinRoom({withMicrophone:e=!1,withStateRecovery:A=!1}={}){this.room=this.roomFactory({adaptiveStream:!0,dynacast:!0}),this.room.on(I.Disconnected,n=>{if(!this.room)return;let i=null;switch(n){case 12:i="invalid-room";break}this.shutdown(i)}),this.room.on(I.TrackSubscribed,n=>{n.kind==="audio"&&(n.attach(),n.source===T.Source.Microphone&&(this.agentAnalyser&&this.agentAnalyser.disconnect(),this.agentAnalyser=this.createFFT(n.mediaStream)))}),this.room.on(I.LocalTrackPublished,n=>{n.kind==="audio"&&(this.userAnalyser&&this.userAnalyser.disconnect(),this.userAnalyser=this.createFFT(n.audioTrack.mediaStream))}),this.room.on(I.ParticipantAttributesChanged,n=>{if(!n["lk.agent.state"])return;const i=n["lk.agent.state"];switch(i){case"speaking":this.speakingStateChanged("speaking");break;case"listening":this.state!=="connected"&&this.speakingStateChanged("listening");break;case"thinking":this.speakingStateChanged("thinking");break;default:console.warn("[obi] unknown speaking state",i)}}),this.room.on(I.DataReceived,async n=>{try{const i=new TextDecoder().decode(n),r=JSON.parse(i);switch(r.status||r.request||r.type){case"course_progress":typeof r.current_step=="number"&&typeof r.total_steps=="number"&&Array.isArray(r.step_names)&&this.emit("courseProgress",{currentStep:Math.max(1,r.current_step),totalSteps:Math.max(1,r.total_steps),stepNames:r.step_names});break;case"using_tool":this.speakingStateChanged("busy");break;case"using_tool_ended":this.speakingStateChanged("speaking");break;case"prompt_user":this.setState("volume-check");break;case"mic_check":this.setState("mic-check");break;case"share_mic":this.setState("mic-share");break;case"share_screen":this.setState("screen-share");break;case"navigate":this.setState("navigate");break;default:console.warn("[obi] unknown data received",r)}}catch(i){console.error("[obi] error parsing data",i)}}),this.room.localParticipant.registerRpcMethod("mic_check",async n=>(this.sessionUuid,await this.checkMicrophone()?"ok":"error")),this.room.localParticipant.registerRpcMethod("screen_capture",async n=>{if(!this.captureScreen)return console.error("[obi] no captureScreen function provided"),"error";let i=null,r=null;try{i=await this.captureScreen()}catch(s){i=null,s=s}if(!i||r)return console.error("[obi] error capturing screen",{error:r}),"error";try{return await this.room.localParticipant.sendFile(new File([i],"screen_capture.png",{type:"image/png"}),{mimeType:"image/png",topic:"screen_capture"}),"ok"}catch(s){return console.error("[obi] error sending screen capture",{error:s}),"error"}}),await this.room.connect(this.roomUrl,this.joinToken);for(let n=0;n<9&&!(this.room.state===q.Connected&&this.room.remoteParticipants.size>=1);n++)await new Promise(i=>setTimeout(i,1e3));if(!(this.room.state===q.Connected&&this.room.remoteParticipants.size>=1)){console.error("[obi] room not connected",{state:this.room.state,numParticipants:this.room.remoteParticipants.size}),this.shutdown("invalid-room");return}if(e&&await this.room.localParticipant.setMicrophoneEnabled(!0),A){let n=!1;for(const i of this.room.remoteParticipants.values())i.isSpeaking&&(n=!0);n?this.speakingState="speaking":this.speakingState="listening"}}async continue(){this.sessionUuid,this.speakingStateChanged("thinking"),await this.sendData({request:"prompt_user",success:!0})}async checkMicrophone(){let e=!1;try{e=(await navigator.permissions.query({name:"microphone"})).state==="granted"}catch(A){console.error("[obi] error checking microphone permission:",A)}return e?(this.sessionUuid,await this.room.localParticipant.setMicrophoneEnabled(!0),this.isMicShared=!0):this.sessionUuid,e&&this.clientType==="sdk"&&this.setState("in-progress"),this.emit("micCheckComplete",e),e}async shareMicrophone(){this.sessionUuid,this.speakingStateChanged("thinking");let e=null,A=null;try{e=await this.room.localParticipant.setMicrophoneEnabled(!0),this.isMicShared=!0}catch(n){n=n,this.isMicShared=!1}e?this.sessionUuid:console.error("[obi] failed to share microphone",{error:A}),await this.sendData({request:"share_mic",success:!!e}),this.clientType==="sdk"&&this.setState("in-progress")}async shareScreen(){this.sessionUuid,this.speakingStateChanged("thinking"),await this.room.localParticipant.setScreenShareEnabled(!0,{video:{displaySurface:"window"}}),await this.sendData({request:"share_screen",success:!0}),this.setState("navigate")}async pause(){this.muteMicrophone(),this.isPaused=!0,this.emit("paused"),await this.sendData({request:"pause"}),console.log("[obi] paused session",{sessionUuid:this.sessionUuid})}async unpause(){this.unmuteMicrophone(),this.isPaused=!1,this.emit("unpaused"),await this.sendData({request:"unpause"}),console.log("[obi] unpaused session",{sessionUuid:this.sessionUuid})}muteMicrophone(){this.sessionUuid,this.room.localParticipant.getTrackPublications().forEach(e=>{var A,n;e.handleMuted(),(n=(A=e.track)==null?void 0:A.mediaStream)==null||n.getTracks().forEach(i=>i.enabled=!1)})}unmuteMicrophone(){this.sessionUuid,this.room.localParticipant.getTrackPublications().forEach(e=>{var A,n;e.handleUnmuted(),(n=(A=e.track)==null?void 0:A.mediaStream)==null||n.getTracks().forEach(i=>i.enabled=!0)})}async stop(){this.emit("stopped"),await this.shutdown()}async shutdown(e=null){if(this.room){this.sessionUuid;const A=this.room;this.room=null,await A.disconnect(),this.sessionUuid}this.sessionUuid=null,this.roomId=null,this.joinToken=null,this.roomUrl=null,this.emit("shutdown",e)}async say(e){this.speakingStateChanged("thinking"),this.isPaused&&await this.unpause(),await this.sendData({request:"say",message:e})}serialise(){return JSON.stringify({state:this.state,speakingState:this.speakingState,appToken:this.appToken,planId:this.planId,clientType:this.clientType,isPaused:this.isPaused,identity:this.identity,sessionUuid:this.sessionUuid,roomId:this.roomId,joinToken:this.joinToken,roomUrl:this.roomUrl})}audioSpectrum(){return this.speakingState==="speaking"&&this.agentAnalyser?this.normaliseSpectrum(this.agentAnalyser):this.speakingState==="listening"&&this.userAnalyser?this.normaliseSpectrum(this.userAnalyser):null}normaliseSpectrum(e){const n=e.context.sampleRate/2/e.frequencyBinCount,i=new Uint8Array(e.frequencyBinCount);e.getByteFrequencyData(i);const r=[],s=50,a=5e3,o=8,c=Math.pow(a/s,1/o);for(let l=0;l<o;l++){const u=s*Math.pow(c,l),d=s*Math.pow(c,l+1),h=Math.floor(u/n),g=Math.floor(d/n),f=Math.min(g,i.length),m=Math.min(h,f);if(m<f){const B=i.slice(m,f).reduce((b,U)=>b+U,0)/(f-m)/255;r.push(B)}else r.push(0)}return r}setState(e){this.state;const A=this.state;this.state=e,this.emit("stateChanged",e,A)}static deserialise(e,A,n,i={}){const r=JSON.parse(e),s=new Br(A,r.planId,n,i);return s.state=r.state,s.speakingState=r.speakingState,s.identity=r.identity||null,s.isPaused=r.isPaused||!1,s.sessionUuid=r.sessionUuid||null,s.roomId=r.roomId||null,s.joinToken=r.joinToken||null,s.roomUrl=r.roomUrl||null,s}speakingStateChanged(e){this.speakingState;const A=this.speakingState;this.speakingState=e,this.emit("speakingStateChanged",e,A)}async sendData(e){await this.room.localParticipant.publishData(new TextEncoder().encode(JSON.stringify(e)),{reliable:!0})}createFFT(e){const A=new AudioContext,n=A.createAnalyser();return A.createMediaStreamSource(e).connect(n),n.fftSize=2048,n.smoothingTimeConstant=.6,n}}class vr extends kr{constructor(e,A,n={}){super(),this.state="loading",this.error=null,this.identity=null,this.product=null,this.plans=[],this.selectedPlan=null,this.selectedPlanUuid=null,this.showWidget=!1,this.session=null,this.captureScreen=null,this.appToken=e,this.clientType=A,this.api=n.api||new fh({baseUrl:n.apiBaseUrl||gh}),this.sessionFactory=n.sessionFactory||((i,r,s,a)=>new Br(i,r,s,a)),this.captureScreen=n.captureScreen||null}async initialise(e={}){var A,n,i,r;if(!this.appToken)throw new Error("App token is required");this.setState("loading");try{const s=await this.api.clientInitialise(this.appToken,{identity:e.identity});if(this.identity=e.identity||null,this.product=((A=s.data)==null?void 0:A.product)||null,this.plans=((n=s.data)==null?void 0:n.onboarding_plans)||[],this.selectedPlan=((i=s.data)==null?void 0:i.selected_plan)||null,this.showWidget=((r=s.data)==null?void 0:r.show_widget)||!1,e.planUuid){let a=this.plans.find(o=>o.uuid===e.planUuid)||null;if(!a)try{const o=await this.api.getSessionPlan(e.planUuid);a=this.plans.find(c=>{var l;return c.uuid===((l=o.data)==null?void 0:l.plan_uuid)})||null}catch(o){console.error("[obi] error getting session plan",o)}a?(this.selectedPlan=a,this.selectedPlanUuid=e.planUuid):console.warn("[obi] plan not found",{planUuid:e.planUuid})}this.identity,this.product,this.plans,this.selectedPlan,this.showWidget}catch(s){throw this.error=s instanceof Error?s:new Error(String(s)),this.setState("error"),s}finally{this.setState("ready")}}selectPlan(e){this.selectedPlan=e,this.selectedPlanUuid=(e==null?void 0:e.uuid)||null,this.emit("planSelected",e),this.trackEvent(e?"plan_selected":"plan_cancelled")}async startSession(e,A){return await this._stopSession(),this.session=this.sessionFactory(this.appToken,e,this.clientType,{api:this.api,identity:this.identity,captureScreen:this.captureScreen}),this.prepareSession(A),this.session.start().then(()=>{this.emit("sessionStarted",this.session)}).catch(n=>{this.session=null,console.error("[obi] error starting session",n)}),this.trackEvent("session_started"),this.session}async resumeSession(e){var A,n;return this.state,(A=this.session)==null||A.state,(n=this.session)==null||n.speakingState,this.session.captureScreen=this.captureScreen,this.prepareSession(e),this.session.joinRoom({withMicrophone:!0,withStateRecovery:!0}).then(()=>{this.emit("sessionResumed",this.session)}).catch(i=>{console.error("[obi] error joining room",{error:i}),i instanceof Error&&i.message==="Room is not connected"&&this.session.stop()}),this.trackEvent("session_resumed"),this.session}prepareSession(e){if(!this.session)throw new Error("No session to prepare");return e(this.session),this.session.on("stopped",()=>{this.emit("sessionStopped")}),this.session.on("shutdown",A=>{var n,i;(i=(n=this.session)==null?void 0:n.removeAllListeners)==null||i.call(n),this.session=null,this.selectedPlan=null,this.selectedPlanUuid=null,this.emit("sessionShutdown",A)}),this.session}async stopSession(){await this._stopSession(),this.selectedPlan&&this.selectPlan(null)}async _stopSession(){this.session&&(this.trackEvent("session_stopped"),await this.session.stop(),this.session=null)}isLoading(){return this.state==="loading"}isReady(){return this.state==="ready"}serialise(){var e;return JSON.stringify({state:this.state,appToken:this.appToken,clientType:this.clientType,identity:this.identity,product:this.product,plans:this.plans,selectedPlan:this.selectedPlan,selectedPlanUuid:this.selectedPlanUuid,showWidget:this.showWidget,session:(e=this.session)==null?void 0:e.serialise()})}static deserialise(e,A,n,i={}){const r=JSON.parse(e),s=new vr(A,n,i);return s.state=r.state,s.identity=r.identity||null,s.product=r.product||null,s.plans=r.plans||[],s.selectedPlan=r.selectedPlan||null,s.selectedPlanUuid=r.selectedPlanUuid||null,s.showWidget=r.showWidget||!1,r.session&&(s.session=Br.deserialise(r.session,A,n,{api:s.api})),s}setState(e){const A=this.state;this.state=e,this.emit("stateChanged",e,A)}trackEvent(e,A={}){var n,i,r;this.api.trackEvent({event:e,client_type:this.clientType,plan_id:(n=this.selectedPlan)==null?void 0:n.uuid,product_id:(i=this.product)==null?void 0:i.uuid,session_id:(r=this.session)==null?void 0:r.sessionUuid,...A}).then(()=>{}).catch(s=>{console.error("[obi] error tracking event",{event:e,data:A,error:s})})}}var Cr,K,ph,Ct,mh,Bh,vh,Ch,Ja,Xa,qa,wh,xn={},bh=[],wy=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,_n=Array.isArray;function PA(t,e){for(var A in e)t[A]=e[A];return t}function Ya(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function za(t,e,A){var n,i,r,s={};for(r in e)r=="key"?n=e[r]:r=="ref"?i=e[r]:s[r]=e[r];if(arguments.length>2&&(s.children=arguments.length>3?Cr.call(arguments,2):A),typeof t=="function"&&t.defaultProps!=null)for(r in t.defaultProps)s[r]==null&&(s[r]=t.defaultProps[r]);return wr(t,s,n,i,null)}function wr(t,e,A,n,i){var r={type:t,props:e,key:A,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++ph,__i:-1,__u:0};return i==null&&K.vnode!=null&&K.vnode(r),r}function Pe(t){return t.children}function RA(t,e){this.props=t,this.context=e}function Yt(t,e){if(e==null)return t.__?Yt(t.__,t.__i+1):null;for(var A;e<t.__k.length;e++)if((A=t.__k[e])!=null&&A.__e!=null)return A.__e;return typeof t.type=="function"?Yt(t):null}function yh(t){var e,A;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((A=t.__k[e])!=null&&A.__e!=null){t.__e=t.__c.base=A.__e;break}return yh(t)}}function Za(t){(!t.__d&&(t.__d=!0)&&Ct.push(t)&&!br.__r++||mh!=K.debounceRendering)&&((mh=K.debounceRendering)||Bh)(br)}function br(){for(var t,e,A,n,i,r,s,a=1;Ct.length;)Ct.length>a&&Ct.sort(vh),t=Ct.shift(),a=Ct.length,t.__d&&(A=void 0,i=(n=(e=t).__v).__e,r=[],s=[],e.__P&&((A=PA({},n)).__v=n.__v+1,K.vnode&&K.vnode(A),$a(e.__P,A,n,e.__n,e.__P.namespaceURI,32&n.__u?[i]:null,r,i??Yt(n),!!(32&n.__u),s),A.__v=n.__v,A.__.__k[A.__i]=A,kh(r,A,s),A.__e!=i&&yh(A)));br.__r=0}function Uh(t,e,A,n,i,r,s,a,o,c,l){var u,d,h,g,f,m,B=n&&n.__k||bh,b=e.length;for(o=by(A,e,B,o,b),u=0;u<b;u++)(h=A.__k[u])!=null&&(d=h.__i==-1?xn:B[h.__i]||xn,h.__i=u,m=$a(t,h,d,i,r,s,a,o,c,l),g=h.__e,h.ref&&d.ref!=h.ref&&(d.ref&&eo(d.ref,null,h),l.push(h.ref,h.__c||g,h)),f==null&&g!=null&&(f=g),4&h.__u||d.__k===h.__k?o=Qh(h,o,t):typeof h.type=="function"&&m!==void 0?o=m:g&&(o=g.nextSibling),h.__u&=-7);return A.__e=f,o}function by(t,e,A,n,i){var r,s,a,o,c,l=A.length,u=l,d=0;for(t.__k=new Array(i),r=0;r<i;r++)(s=e[r])!=null&&typeof s!="boolean"&&typeof s!="function"?(o=r+d,(s=t.__k[r]=typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?wr(null,s,null,null,null):_n(s)?wr(Pe,{children:s},null,null,null):s.constructor==null&&s.__b>0?wr(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=t,s.__b=t.__b+1,a=null,(c=s.__i=yy(s,A,o,u))!=-1&&(u--,(a=A[c])&&(a.__u|=2)),a==null||a.__v==null?(c==-1&&(i>l?d--:i<l&&d++),typeof s.type!="function"&&(s.__u|=4)):c!=o&&(c==o-1?d--:c==o+1?d++:(c>o?d--:d++,s.__u|=4))):t.__k[r]=null;if(u)for(r=0;r<l;r++)(a=A[r])!=null&&!(2&a.__u)&&(a.__e==n&&(n=Yt(a)),Fh(a,a));return n}function Qh(t,e,A){var n,i;if(typeof t.type=="function"){for(n=t.__k,i=0;n&&i<n.length;i++)n[i]&&(n[i].__=t,e=Qh(n[i],e,A));return e}t.__e!=e&&(e&&t.type&&!A.contains(e)&&(e=Yt(t)),A.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function yr(t,e){return e=e||[],t==null||typeof t=="boolean"||(_n(t)?t.some(function(A){yr(A,e)}):e.push(t)),e}function yy(t,e,A,n){var i,r,s=t.key,a=t.type,o=e[A];if(o===null&&t.key==null||o&&s==o.key&&a==o.type&&!(2&o.__u))return A;if(n>(o!=null&&!(2&o.__u)?1:0))for(i=A-1,r=A+1;i>=0||r<e.length;){if(i>=0){if((o=e[i])&&!(2&o.__u)&&s==o.key&&a==o.type)return i;i--}if(r<e.length){if((o=e[r])&&!(2&o.__u)&&s==o.key&&a==o.type)return r;r++}}return-1}function Eh(t,e,A){e[0]=="-"?t.setProperty(e,A??""):t[e]=A==null?"":typeof A!="number"||wy.test(e)?A:A+"px"}function Ur(t,e,A,n,i){var r;e:if(e=="style")if(typeof A=="string")t.style.cssText=A;else{if(typeof n=="string"&&(t.style.cssText=n=""),n)for(e in n)A&&e in A||Eh(t.style,e,"");if(A)for(e in A)n&&A[e]==n[e]||Eh(t.style,e,A[e])}else if(e[0]=="o"&&e[1]=="n")r=e!=(e=e.replace(Ch,"$1")),e=e.toLowerCase()in t||e=="onFocusOut"||e=="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+r]=A,A?n?A.u=n.u:(A.u=Ja,t.addEventListener(e,r?qa:Xa,r)):t.removeEventListener(e,r?qa:Xa,r);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=A??"";break e}catch{}typeof A=="function"||(A==null||A===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&A==1?"":A))}}function Sh(t){return function(e){if(this.l){var A=this.l[e.type+t];if(e.t==null)e.t=Ja++;else if(e.t<A.u)return;return A(K.event?K.event(e):e)}}}function $a(t,e,A,n,i,r,s,a,o,c){var l,u,d,h,g,f,m,B,b,U,C,w,y,E,F,S,x,R=e.type;if(e.constructor!=null)return null;128&A.__u&&(o=!!(32&A.__u),r=[a=e.__e=A.__e]),(l=K.__b)&&l(e);e:if(typeof R=="function")try{if(B=e.props,b="prototype"in R&&R.prototype.render,U=(l=R.contextType)&&n[l.__c],C=l?U?U.props.value:l.__:n,A.__c?m=(u=e.__c=A.__c).__=u.__E:(b?e.__c=u=new R(B,C):(e.__c=u=new RA(B,C),u.constructor=R,u.render=Qy),U&&U.sub(u),u.props=B,u.state||(u.state={}),u.context=C,u.__n=n,d=u.__d=!0,u.__h=[],u._sb=[]),b&&u.__s==null&&(u.__s=u.state),b&&R.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=PA({},u.__s)),PA(u.__s,R.getDerivedStateFromProps(B,u.__s))),h=u.props,g=u.state,u.__v=e,d)b&&R.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),b&&u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(b&&R.getDerivedStateFromProps==null&&B!==h&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(B,C),!u.__e&&u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(B,u.__s,C)===!1||e.__v==A.__v){for(e.__v!=A.__v&&(u.props=B,u.state=u.__s,u.__d=!1),e.__e=A.__e,e.__k=A.__k,e.__k.some(function(L){L&&(L.__=e)}),w=0;w<u._sb.length;w++)u.__h.push(u._sb[w]);u._sb=[],u.__h.length&&s.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(B,u.__s,C),b&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(h,g,f)})}if(u.context=C,u.props=B,u.__P=t,u.__e=!1,y=K.__r,E=0,b){for(u.state=u.__s,u.__d=!1,y&&y(e),l=u.render(u.props,u.state,u.context),F=0;F<u._sb.length;F++)u.__h.push(u._sb[F]);u._sb=[]}else do u.__d=!1,y&&y(e),l=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++E<25);u.state=u.__s,u.getChildContext!=null&&(n=PA(PA({},n),u.getChildContext())),b&&!d&&u.getSnapshotBeforeUpdate!=null&&(f=u.getSnapshotBeforeUpdate(h,g)),S=l,l!=null&&l.type===Pe&&l.key==null&&(S=Th(l.props.children)),a=Uh(t,_n(S)?S:[S],e,A,n,i,r,s,a,o,c),u.base=e.__e,e.__u&=-161,u.__h.length&&s.push(u),m&&(u.__E=u.__=null)}catch(L){if(e.__v=null,o||r!=null)if(L.then){for(e.__u|=o?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;r[r.indexOf(a)]=null,e.__e=a}else for(x=r.length;x--;)Ya(r[x]);else e.__e=A.__e,e.__k=A.__k;K.__e(L,e,A)}else r==null&&e.__v==A.__v?(e.__k=A.__k,e.__e=A.__e):a=e.__e=Uy(A.__e,e,A,n,i,r,s,o,c);return(l=K.diffed)&&l(e),128&e.__u?void 0:a}function kh(t,e,A){for(var n=0;n<A.length;n++)eo(A[n],A[++n],A[++n]);K.__c&&K.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(r){r.call(i)})}catch(r){K.__e(r,i.__v)}})}function Th(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:_n(t)?t.map(Th):PA({},t)}function Uy(t,e,A,n,i,r,s,a,o){var c,l,u,d,h,g,f,m=A.props,B=e.props,b=e.type;if(b=="svg"?i="http://www.w3.org/2000/svg":b=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),r!=null){for(c=0;c<r.length;c++)if((h=r[c])&&"setAttribute"in h==!!b&&(b?h.localName==b:h.nodeType==3)){t=h,r[c]=null;break}}if(t==null){if(b==null)return document.createTextNode(B);t=document.createElementNS(i,b,B.is&&B),a&&(K.__m&&K.__m(e,r),a=!1),r=null}if(b==null)m===B||a&&t.data==B||(t.data=B);else{if(r=r&&Cr.call(t.childNodes),m=A.props||xn,!a&&r!=null)for(m={},c=0;c<t.attributes.length;c++)m[(h=t.attributes[c]).name]=h.value;for(c in m)if(h=m[c],c!="children"){if(c=="dangerouslySetInnerHTML")u=h;else if(!(c in B)){if(c=="value"&&"defaultValue"in B||c=="checked"&&"defaultChecked"in B)continue;Ur(t,c,null,h,i)}}for(c in B)h=B[c],c=="children"?d=h:c=="dangerouslySetInnerHTML"?l=h:c=="value"?g=h:c=="checked"?f=h:a&&typeof h!="function"||m[c]===h||Ur(t,c,h,m[c],i);if(l)a||u&&(l.__html==u.__html||l.__html==t.innerHTML)||(t.innerHTML=l.__html),e.__k=[];else if(u&&(t.innerHTML=""),Uh(e.type=="template"?t.content:t,_n(d)?d:[d],e,A,n,b=="foreignObject"?"http://www.w3.org/1999/xhtml":i,r,s,r?r[0]:A.__k&&Yt(A,0),a,o),r!=null)for(c=r.length;c--;)Ya(r[c]);a||(c="value",b=="progress"&&g==null?t.removeAttribute("value"):g!=null&&(g!==t[c]||b=="progress"&&!g||b=="option"&&g!=m[c])&&Ur(t,c,g,m[c],i),c="checked",f!=null&&f!=t[c]&&Ur(t,c,f,m[c],i))}return t}function eo(t,e,A){try{if(typeof t=="function"){var n=typeof t.__u=="function";n&&t.__u(),n&&e==null||(t.__u=t(e))}else t.current=e}catch(i){K.__e(i,A)}}function Fh(t,e,A){var n,i;if(K.unmount&&K.unmount(t),(n=t.ref)&&(n.current&&n.current!=t.__e||eo(n,null,e)),(n=t.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(r){K.__e(r,e)}n.base=n.__P=null}if(n=t.__k)for(i=0;i<n.length;i++)n[i]&&Fh(n[i],e,A||typeof t.type!="function");A||Ya(t.__e),t.__c=t.__=t.__e=void 0}function Qy(t,e,A){return this.constructor(t,A)}function Ey(t,e,A){var n,i,r,s;e==document&&(e=document.documentElement),K.__&&K.__(t,e),i=(n=typeof A=="function")?null:A&&A.__k||e.__k,r=[],s=[],$a(e,t=(!n&&A||e).__k=za(Pe,null,[t]),i||xn,xn,e.namespaceURI,!n&&A?[A]:i?null:e.firstChild?Cr.call(e.childNodes):null,r,!n&&A?A:i?i.__e:e.firstChild,n,s),kh(r,t,s)}function Sy(t){function e(A){var n,i;return this.getChildContext||(n=new Set,(i={})[e.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(r){this.props.value!=r.value&&n.forEach(function(s){s.__e=!0,Za(s)})},this.sub=function(r){n.add(r);var s=r.componentWillUnmount;r.componentWillUnmount=function(){n&&n.delete(r),s&&s.call(r)}}),A.children}return e.__c="__cC"+wh++,e.__=t,e.Provider=e.__l=(e.Consumer=function(A,n){return A.children(n)}).contextType=e,e}Cr=bh.slice,K={__e:function(t,e,A,n){for(var i,r,s;e=e.__;)if((i=e.__c)&&!i.__)try{if((r=i.constructor)&&r.getDerivedStateFromError!=null&&(i.setState(r.getDerivedStateFromError(t)),s=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,n||{}),s=i.__d),s)return i.__E=i}catch(a){t=a}throw t}},ph=0,RA.prototype.setState=function(t,e){var A;A=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=PA({},this.state),typeof t=="function"&&(t=t(PA({},A),this.props)),t&&PA(A,t),t!=null&&this.__v&&(e&&this._sb.push(e),Za(this))},RA.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Za(this))},RA.prototype.render=Pe,Ct=[],Bh=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,vh=function(t,e){return t.__v.__b-e.__v.__b},br.__r=0,Ch=/(PointerCapture)$|Capture$/i,Ja=0,Xa=Sh(!1),qa=Sh(!0),wh=0;var ky=0;function p(t,e,A,n,i,r){e||(e={});var s,a,o=e;if("ref"in o)for(a in o={},e)a=="ref"?s=e[a]:o[a]=e[a];var c={type:t,props:o,key:A,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ky,__i:-1,__u:0,__source:i,__self:r};if(typeof t=="function"&&(s=t.defaultProps))for(a in s)o[a]===void 0&&(o[a]=s[a]);return K.vnode&&K.vnode(c),c}const Ty=`:root,:host{--obi-modal-padding: 48px 48px 32px;--obi-modal-background-color: #FFFFFF;--obi-modal-border-radius: 12px;--obi-modal-shadow: 0px 1px 2px rgba(0, 0, 0, .05);--obi-modal-xsmall-width: 320px;--obi-modal-xsmall-height: 240px;--obi-modal-small-width: 480px;--obi-modal-small-height: 400px;--obi-modal-medium-width: 640px;--obi-modal-medium-height: 545px;--obi-modal-large-width: 1200px;--obi-modal-large-height: 700px;--obi-font-family: "Satoshi", sans-serif;--obi-color-primary: #9500FF;--obi-color-primary-50: color-mix(in srgb, var(--obi-color-primary) 50%, white 50%);--obi-color-primary-30: color-mix(in srgb, var(--obi-color-primary) 30%, white 70%);--obi-color-tint: color-mix(in srgb, var(--obi-color-primary) 5%, white 95%);--obi-color-text: #18181B;--obi-course-color-selected: var(--obi-color-primary-50);--obi-course-color-tint: var(--obi-color-tint);--obi-course-progress-step-completed: #B3B3B3;--obi-course-progress-step-incomplete: #D9D9D9;--obi-course-progress-text-color: #757575;font-family:var(--obi-font-family);color:var(--obi-color-text)}.obi-button{font-family:var(--obi-font-family);color:var(--obi-color-text)}dialog{margin:auto;padding:0;border:none;border-radius:var(--obi-modal-border-radius);box-shadow:var(--obi-modal-shadow);background:var(--obi-modal-background-color);box-sizing:border-box}dialog>.modal-content{padding:var(--obi-modal-padding);box-sizing:border-box}dialog,dialog.modal-medium,dialog>.modal-content,dialog.modal-medium>.modal-content{width:var(--obi-modal-medium-width);min-height:var(--obi-modal-medium-height)}dialog.modal-xsmall,dialog.modal-xsmall>.modal-content{width:var(--obi-modal-xsmall-width);min-height:var(--obi-modal-xsmall-height)}dialog.modal-small,dialog.modal-small>.modal-content{width:var(--obi-modal-small-width);min-height:var(--obi-modal-small-height)}dialog.modal-large,dialog.modal-large>.modal-content{width:var(--obi-modal-large-width);min-height:var(--obi-modal-large-height)}dialog::backdrop{background:rgba(0,0,0,.5)}.tour-content{display:block;width:100%;height:100%}.tour-content .container{box-sizing:border-box;display:flex;flex-direction:column;align-items:center;padding:0;width:100%;height:100%}.tour-content .header{display:flex;flex-direction:column;align-items:center;padding:0;gap:16px;width:100%}.tour-content .title{width:100%;font-family:Satoshi,sans-serif;font-style:normal;font-weight:700;font-size:32px;line-height:90%;text-align:center;letter-spacing:-.03em;color:#18181b;margin:0}.tour-content .subtitle{width:100%;font-family:Satoshi,sans-serif;font-style:normal;font-weight:400;font-size:16px;line-height:140%;text-align:center;letter-spacing:-.01em;color:#18181b;margin:0}.tour-content .visual{width:480px;height:240px;margin-top:24px;border-radius:12px;display:flex;align-items:center;justify-content:center;position:relative}.tour-content .description{width:100%;min-height:48px;margin:24px 0 0;font-family:Satoshi,sans-serif;font-style:normal;font-weight:400;font-size:16px;line-height:140%;text-align:center;letter-spacing:-.01em;color:#18181b}.tour-content .button-container{display:flex;margin-top:24px;flex-direction:column;align-items:center;gap:16px;width:100%}.tour-content .action-button{box-sizing:border-box;display:flex;flex-direction:row;justify-content:center;align-items:center;padding:12px;gap:8px;min-width:200px;height:40px;background:#303030;border:1px solid #303030;border-radius:4px;cursor:pointer;text-decoration:none}.tour-content .action-button.disabled{opacity:.6;cursor:not-allowed}.tour-content .button-text{height:16px;font-family:Satoshi,sans-serif;font-style:normal;font-weight:400;font-size:16px;line-height:100%;color:#fbf3ff}.tour.content-area{flex:1;display:flex;flex-direction:column}.obi-close-button{position:absolute;top:24px;right:24px;width:24px;height:24px;cursor:pointer;border:none;background:none;padding:0;display:flex;align-items:center;justify-content:center;z-index:1}.obi-panel{box-sizing:border-box;padding:24px;background-color:#fff;box-shadow:0 16px 32px -4px #0000001f,0 4px 8px -2px #00000014,inset 0 1px #fff9;border-radius:12px}.obi-pill.container{width:96px;height:30px;display:flex;align-items:center;justify-content:center}.obi-pill.container .pill{display:flex;align-items:center;justify-content:center;width:48px;height:6px;opacity:.7;border-radius:3px;background-color:var(--obi-color-primary);transition:width .15s ease-in-out,height .15s ease-in-out,border-radius .15s ease-in-out}.obi-pill.container .pill.button{cursor:pointer}.obi-pill.container.user-speaking .pill{background-color:var(--obi-color-primary-30)}.obi-pill.container.active .pill{width:96px;height:30px;border-radius:15px;opacity:1}.obi-pill.container.busy,.obi-pill.container.busy .pill{width:220px}.obi-pill2.container{display:flex;align-items:center;justify-content:center}.obi-pill2.container .pill{display:flex;align-items:center;justify-content:center;width:48px;height:6px;opacity:.7;border-radius:3px;background-color:var(--obi-color-primary);transform:translateY(0);transition:width .15s ease-in-out,height .15s ease-in-out,border-radius .15s ease-in-out}.obi-pill2.container .pill.button{cursor:pointer}.obi-pill2.container:not(.active){transition:height 0s linear .15s;height:6px}.obi-pill2.container:not(.active) .pill{transform:translateY(12px);transition:transform 0s linear .15s,width .15s ease-in-out,height .15s ease-in-out,border-radius .15s ease-in-out}.obi-pill2.container.active{transition:none;height:30px}.obi-pill2.container.active .pill{transition:transform 0s,width .15s ease-in-out,height .15s ease-in-out,border-radius .15s ease-in-out;width:96px;height:30px;border-radius:15px;opacity:1}.obi-pill2.container.user-speaking .pill{background-color:var(--obi-color-primary-30)}.obi-popout{position:relative;display:inline-block}.obi-popout .obi-popout-target{cursor:pointer;display:inline-block}.obi-popout .content{position:absolute;background-color:#fff0;z-index:100;animation:popout-appear .15s ease-out}@keyframes popout-appear{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.obi-round-button-popout{z-index:600}.obi-round-button{flex:0 0 auto;display:flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:50%;padding:0;box-sizing:border-box;background-color:#fff;border:1px solid #D9D9D9;box-shadow:none}.obi-round-button:hover{cursor:pointer}.obi-round-button:disabled{box-shadow:none;background-color:#f0f0f0;color:#999;cursor:not-allowed!important;pointer-events:none}.obi-round-button-title{padding:8px 16px;border-radius:12px;background-color:#fff;color:#000;font-size:14px;font-weight:400;white-space:nowrap;box-shadow:0 4px 12px #00000026,0 2px 4px #0000001a;border:1px solid rgba(0,0,0,.08);z-index:5000;pointer-events:none;-webkit-user-select:none;user-select:none;position:relative}.obi-round-button-title:after{content:"";position:absolute;top:100%;left:50%;transform:translate(-50%);width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid white;filter:drop-shadow(0 2px 2px rgba(0,0,0,.1))}.obi-equaliser{display:flex;align-items:center;gap:2px;height:32px}.obi-equaliser .column{position:relative;display:flex;align-items:center;justify-content:center;width:5px;height:100%}.obi-equaliser .bar{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:3px;border-radius:2px;z-index:1}.obi-message{display:inline-flex;align-items:center;justify-content:center;min-width:140px;padding:0 15px;text-wrap:nowrap;font-size:16px;font-weight:400;height:30px;box-sizing:border-box;background-color:#fff;border-radius:15px;border:1px solid #D9D9D9}.obi-message.clickable{box-shadow:0 4px 6px #0000001a;cursor:pointer}.obi-loading-dots{display:flex;align-items:center;gap:2px;height:32px}.obi-loading-dots .column{position:relative;display:flex;align-items:center;justify-content:center;width:5px;height:100%}.obi-loading-dots .dot{width:3px;height:3px;border-radius:2px;position:relative;z-index:2}.obi-loading-dots .bar{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:3px;border-radius:2px;z-index:1;height:0px;animation:bounce .9s ease-in-out infinite}@keyframes bounce{0%,60%,to{height:0px}30%{height:16px}}.obi-exit-survey{position:relative;width:320px;margin:0 auto;-webkit-backdrop-filter:none;backdrop-filter:none;background:white;z-index:9999}.obi-exit-survey-container{display:flex;flex-direction:column;align-items:center;padding:0;gap:16px;width:272px;flex:none;align-self:stretch}.obi-exit-survey-header{display:flex;flex-direction:column;align-items:flex-start;padding:0;gap:4px;width:272px;flex:none;align-self:stretch}.obi-exit-survey-title{width:272px;height:22px;margin:0;font-family:Satoshi,sans-serif;font-size:16px;font-weight:600;line-height:140%;text-align:center;color:#1e1e1e;flex:none;align-self:stretch}.obi-exit-survey-subtitle{width:272px;height:20px;margin:0;font-family:Satoshi,sans-serif;font-style:normal;font-weight:400;font-size:14px;line-height:140%;text-align:center;color:#757575;flex:none;align-self:stretch}.obi-exit-survey-options{display:flex;flex-direction:column;align-items:flex-start;padding:0;gap:4px;width:272px;flex:none;align-self:stretch}.obi-exit-survey-options textarea{height:80px;resize:none;outline:none}.obi-exit-survey-button{box-sizing:border-box;display:flex;flex-direction:row;justify-content:center;align-items:center;padding:12px;gap:8px;width:272px;height:44px;border-radius:12px;cursor:pointer;font-family:Satoshi,sans-serif;font-style:normal;font-weight:400;font-size:14px;line-height:140%;flex:none;align-self:stretch;transition:all .2s ease}.obi-exit-survey-button:hover{transform:translateY(-1px);box-shadow:0 4px 8px #0000001a}.obi-exit-survey-button:active{transform:translateY(0)}.obi-exit-survey-button-continue{background:rgba(255,255,255);border:1px solid rgba(217,217,217);color:#1e1e1e}.obi-exit-survey-button-continue:hover{background:rgba(255,255,255);border-color:#d9d9d9}.obi-exit-survey-button-wrap-up{background:#303030;border:1px solid rgba(217,217,217);color:#fff;font-weight:500}.obi-exit-survey-button-wrap-up:hover{background:#404040;border-color:#d9d9d9}.obi-exit-survey-reason-button{background:rgba(255,255,255);border:1px solid rgba(217,217,217);color:#1e1e1e}.obi-exit-survey-reason-button:hover{background:rgba(255,255,255);border-color:#d9d9d9}.obi-exit-survey-reason-button-secondary{display:flex;flex-direction:row;justify-content:center;align-items:center;padding:4px 6px;gap:8px;width:272px;height:28px;border-radius:4px;cursor:pointer;border:none;background:transparent;font-family:Satoshi,sans-serif;font-style:normal;font-weight:400;font-size:14px;line-height:140%;color:#5a5a5a;flex:none;align-self:stretch;transition:all .2s ease}.obi-exit-survey-reason-button-secondary:hover{background:rgba(0,0,0,.05);color:#3a3a3a}.obi-message-input{display:inline-block;position:relative}.obi-message-input .container{width:212px;height:30px;box-sizing:border-box;background:#FFFFFF;border:1px solid var(--obi-color-primary-30);border-radius:15px;display:flex;align-items:center;flex:none;order:2;flex-grow:0;transition:height .3s ease,border-radius .3s ease;animation:expandMessageInput .2s cubic-bezier(.4,0,.2,1) 0s 1 normal both}.obi-message-input.expanded .container{height:auto;min-height:140px;border-radius:15px;align-items:flex-start;padding:8px 0;animation:expandMessageInputWide .2s cubic-bezier(.4,0,.2,1) 0s 1 normal both}.obi-message-input .field{flex:1 1 0;border:none;background:transparent;outline:none;font-family:Satoshi,sans-serif;font-style:normal;font-weight:400;font-size:14px;line-height:18px;color:#000;padding:4px 3px 0 16px;height:100%;box-sizing:border-box;min-width:0;resize:none;overflow:hidden;scrollbar-width:none;transition:padding .3s ease;animation:fadeInInputField .2s cubic-bezier(.4,0,.2,1) 0s 1 normal both}.obi-message-input.expanded .field{height:auto;min-height:120px;padding:4px 16px;overflow-y:auto;line-height:18px}.obi-message-input .field::placeholder{color:#999}.obi-message-input .field:disabled{cursor:not-allowed;opacity:.6}.obi-message-input .send{position:absolute;bottom:3px;right:4px;flex-shrink:0;width:24px;height:24px;background:var(--obi-color-primary);border:none;border-radius:9999px;display:flex;justify-content:center;align-items:center;cursor:pointer;transition:all .3s ease;color:#fff}.obi-message-input.expanded .send{width:28px;height:28px;position:relative;top:0;bottom:0;margin-right:0}.obi-message-input.expanded .button-container{display:flex;justify-content:space-between;align-items:center;width:100%;margin-top:8px}.obi-message-input .send:disabled{background:#CCCCCC;cursor:not-allowed;transform:none}.obi-message-input .container:focus-within{border-color:var(--obi-color-primary);box-shadow:0 0 0 2px #9008ff1a}@keyframes expandMessageInput{0%{width:32px}to{width:212px}}@keyframes expandMessageInputWide{0%{width:212px}to{width:340px}}@keyframes fadeInInputField{0%{opacity:0}60%{opacity:0}to{opacity:1}}.obi-course-progress{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:6px;width:100%;min-width:0;height:24px;flex:none;order:1;align-self:stretch;flex-grow:0}.obi-course-progress-steps{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:0;gap:2px;width:100%;height:6px;flex:none;order:0;align-self:stretch;flex-grow:0}.obi-course-progress-container{display:flex;flex-direction:column;justify-content:center;align-items:stretch;padding:2px 0;height:6px;flex:1;min-width:0}.obi-course-progress-step{width:100%;height:2px;background:var(--obi-course-progress-step-incomplete);border-radius:24px;flex:none;order:0;align-self:stretch;flex-grow:0}.obi-course-progress-step.completed{background:var(--obi-course-progress-step-completed)}.obi-course-progress-description{width:100%;height:14px;font-family:var(--obi-font-family);font-style:normal;font-weight:500;font-size:14px;line-height:100%;color:var(--obi-course-progress-text-color);flex:none;order:1;flex-grow:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.obi-widget-popout{z-index:400}.obi-widget-panel{display:flex;flex-direction:column;gap:8px;align-items:center;justify-content:center;min-width:222px;width:min-content;padding:12px;box-sizing:border-box;border-radius:27px;background:white;transition:background .1s ease-out .1s,box-shadow .1s ease-out .1s}.obi-widget-panel:not(.messaging){width:256px}.obi-widget-panel.tool-usage{width:384px}.obi-widget-panel:not(.expanded){background:transparent;border:none;box-shadow:none;transition:background .1s ease-out .1s,border .1s ease-out .1s,box-shadow .1s ease-out .1s}.obi-widget-panel.maximized{transform:translateY(-110px)}.obi-widget-panel .obi-widget{display:flex;align-items:center;min-width:192px;padding-left:58px;box-sizing:border-box;gap:4px}.obi-widget-panel .obi-widget.active.in-plan{padding-left:0}.obi-widget-panel .obi-widget.active.in-plan .obi-round-button{animation:fade-in-button .2s ease-out .15s both}.obi-widget-panel .obi-widget.active .obi-equaliser{animation:fade-in-equaliser .2s ease-out .15s both}@keyframes fade-in-button{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes fade-in-equaliser{0%{opacity:0}to{opacity:1}}.obi-widget-panel .obi-course-progress-container{display:none;width:100%;max-height:0;opacity:0;transform:translateY(-10px);overflow:hidden;transition:max-height .3s ease-in-out,opacity .3s ease-in-out,transform .3s ease-in-out}.obi-widget-panel:hover .obi-course-progress-container{display:block;max-width:22 0px;animation:expand-course-progress .3s ease-in-out forwards}.obi-widget-panel:hover .obi-course-progress-container.expanded{max-width:330px}@keyframes expand-course-progress{0%{max-height:0;opacity:0;transform:translateY(-10px)}to{max-height:40px;opacity:1;transform:translateY(0)}}.obi-widget-pill-text{font-size:16px;font-weight:400;color:#fff;opacity:0;animation:fade-in-pill-text .3s ease-in-out forwards}@keyframes fade-in-pill-text{0%{opacity:0}40%{opacity:0}to{opacity:1}}.obi-widget-buttons{display:flex;flex-direction:row;gap:4px}.obi-widget-out-of-plan{display:flex;align-items:center;gap:4px}.obi-widget-out-of-plan .text{font-size:16px;color:#fff;animation:fade-in-pill-text .3s ease-in-out forwards}.obi-widget-out-of-plan .round-button{display:none;animation:fade-in-button .2s ease-out .15s both}.obi-widget-out-of-plan .message{display:none}.obi-widget-out-of-plan.active:hover .round-button,.obi-widget-out-of-plan.active:hover .message,.obi-widget-out-of-plan.active.hover .round-button,.obi-widget-out-of-plan.active.hover .message{display:flex}.tour-select{display:block;font-family:Inter,sans-serif}.course-container{display:flex;padding:20px;align-items:flex-start;gap:8px;height:180px;border-radius:6px;border:1px solid rgba(0,0,0,.6);background:#fff;cursor:pointer;transition:all .2s;flex-direction:column;box-sizing:border-box;overflow:hidden}.course-container:hover{background-color:#f9fafb;border-color:#d1d5db;box-shadow:0 1px 2px #0000000d}.course-container:active{transform:scale(.98)}.course-container.selected{border-radius:6px;border:1px solid var(--obi-course-color-selected);background:var(--obi-course-color-tint)}.course-container.selected:hover{background:var(--obi-course-color-tint)}.header-row{display:flex;justify-content:space-between;align-items:flex-start;align-self:stretch;flex-shrink:0;text-align:left}.course-title{color:#000;font-family:Inter,sans-serif;font-size:20px;font-style:normal;font-weight:500;line-height:100%;letter-spacing:-.2px;margin:0}.duration{display:flex;padding:4px 12px;justify-content:center;align-items:center;gap:8px;border-radius:9999px;background:var(--obi-course-color-tint);color:#000;font-family:Inter,sans-serif;font-size:14px;font-style:normal;font-weight:500;line-height:100%;letter-spacing:-.14px;flex-shrink:0}.course-container.selected .duration{background:#fff}.course-description{flex:1 0 0;color:#0009;font-family:Inter,sans-serif;font-size:16px;font-style:normal;font-weight:400;line-height:140%;letter-spacing:-.16px;margin:0;overflow:hidden;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;text-align:left}.course-grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:4px;padding:0;flex:1 0 0;align-self:stretch;min-height:364px}.controls{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.tabs{display:flex;gap:10px}.tab{display:flex;padding:6px 12px;justify-content:center;align-items:center;align-self:stretch;border:none;background:none;cursor:pointer;font-family:Inter,sans-serif;font-size:16px;font-weight:500;color:#0006;border-bottom:2px solid transparent;transition:all .2s}.tab.active{color:#000;border-bottom:2px solid var(--obi-color-primary)}.tab:hover{color:#000}.filter{position:relative;display:flex;align-items:center;width:336px;height:40px}.filter input{color:var(--obi-color-text);caret-color:var(--obi-color-text);padding:8px 12px 8px 36px;border-radius:6px;border:1px solid rgba(0,0,0,.1);background:#fff;font-family:Inter,sans-serif;font-size:14px;line-height:20px;width:100%;height:100%;box-sizing:border-box;outline:none}.filter input:focus{outline:1px solid var(--obi-color-primary);outline-offset:-1px}.filter input::placeholder{color:#0006}.filter svg{position:absolute;left:12px;pointer-events:none}@media (max-width: 767px){.course-grid{grid-template-columns:1fr}}.loading,.error,.empty{display:flex;justify-content:center;align-items:center;margin-top:16px}.error{color:#ef4444}.tour-select-modal-container{display:flex;flex-direction:column;align-items:center;gap:24px;flex:1 0 0;align-self:stretch;font-family:Satoshi,sans-serif;color:#000;text-align:center;max-width:1200px;width:100%;min-height:600px;box-sizing:border-box}.course-list-wrapper{flex:1;overflow-y:auto;width:100%;min-height:0;max-height:424px;padding-right:3px;box-sizing:border-box}.course-list-wrapper::-webkit-scrollbar{width:3px}.course-list-wrapper::-webkit-scrollbar-track{background:transparent}.course-list-wrapper::-webkit-scrollbar-thumb{background-color:#000;border-radius:2px;min-height:20px}.course-list-wrapper::-webkit-scrollbar-thumb:hover{background-color:#333}.header{display:flex;align-items:flex-start;gap:16px;width:100%;text-align:left}.icon{display:flex;width:56px;height:56px;padding:12px;justify-content:center;align-items:center;border-radius:12px;border:1px solid var(--obi-color-primary);background:var(--obi-color-primary);box-sizing:border-box}.icon img{width:32px;height:32px;color:#fff;fill:#fff}.title-section{align-self:stretch;flex:1}.tour-select-modal-container h1{color:#18181b;font-family:Satoshi;font-size:32px;font-style:normal;font-weight:700;line-height:90%;letter-spacing:-.96px;margin:0 0 8px}.subtitle{color:#18181b;font-family:Satoshi;font-size:20px;font-style:normal;font-weight:500;line-height:90%;letter-spacing:-.6px;margin:0}.footer{display:flex;width:360px;flex-direction:column;align-items:center;gap:12px}.footer-button{display:flex;height:48px;padding:16px;justify-content:center;align-items:center;gap:8px;align-self:stretch;border-radius:6px;background:#18181b;border:none;cursor:pointer;color:#fafafa;font-family:Satoshi;font-weight:500;transition:opacity .2s ease}.footer-button:disabled{opacity:.5;cursor:not-allowed}.footer-button:not(:disabled){opacity:1}.footer-button:not(:disabled):hover{background:#27272a}.footer-text{color:#18181b;font-family:Satoshi;font-size:12px;font-style:normal;font-weight:400;line-height:100%;letter-spacing:-.12px;margin:0;text-align:center}.skeleton{background:linear-gradient(90deg,#e5e7eb 25%,#f3f4f6 50%,#e5e7eb 75%);background-size:200% 100%;animation:loading 1.5s infinite;border-radius:4px}@keyframes loading{0%{background-position:200% 0}to{background-position:-200% 0}}.skeleton-title{height:32px;width:60%;margin-bottom:12px}.skeleton-subtitle{height:20px;width:80%}
47
- `;var wt,ae,Ao,Ih,Pn=0,xh=[],pe=K,_h=pe.__b,Ph=pe.__r,Rh=pe.diffed,Lh=pe.__c,Dh=pe.unmount,Hh=pe.__;function Rn(t,e){pe.__h&&pe.__h(ae,t,Pn||e),Pn=0;var A=ae.__H||(ae.__H={__:[],__h:[]});return t>=A.__.length&&A.__.push({}),A.__[t]}function Z(t){return Pn=1,Fy(Nh,t)}function Fy(t,e,A){var n=Rn(wt++,2);if(n.t=t,!n.__c&&(n.__=[A?A(e):Nh(void 0,e),function(a){var o=n.__N?n.__N[0]:n.__[0],c=n.t(o,a);o!==c&&(n.__N=[c,n.__[1]],n.__c.setState({}))}],n.__c=ae,!ae.__f)){var i=function(a,o,c){if(!n.__c.__H)return!0;var l=n.__c.__H.__.filter(function(d){return!!d.__c});if(l.every(function(d){return!d.__N}))return!r||r.call(this,a,o,c);var u=n.__c.props!==a;return l.forEach(function(d){if(d.__N){var h=d.__[0];d.__=d.__N,d.__N=void 0,h!==d.__[0]&&(u=!0)}}),r&&r.call(this,a,o,c)||u};ae.__f=!0;var r=ae.shouldComponentUpdate,s=ae.componentWillUpdate;ae.componentWillUpdate=function(a,o,c){if(this.__e){var l=r;r=void 0,i(a,o,c),r=l}s&&s.call(this,a,o,c)},ae.shouldComponentUpdate=i}return n.__N||n.__}function Ge(t,e){var A=Rn(wt++,3);!pe.__s&&ro(A.__H,e)&&(A.__=t,A.u=e,ae.__H.__h.push(A))}function to(t,e){var A=Rn(wt++,4);!pe.__s&&ro(A.__H,e)&&(A.__=t,A.u=e,ae.__h.push(A))}function QA(t){return Pn=5,no(function(){return{current:t}},[])}function no(t,e){var A=Rn(wt++,7);return ro(A.__H,e)&&(A.__=t(),A.__H=e,A.__h=t),A.__}function Iy(t,e){return Pn=8,no(function(){return t},e)}function Oh(t){var e=ae.context[t.__c],A=Rn(wt++,9);return A.c=t,e?(A.__==null&&(A.__=!0,e.sub(ae)),e.props.value):t.__}function xy(){for(var t;t=xh.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Qr),t.__H.__h.forEach(io),t.__H.__h=[]}catch(e){t.__H.__h=[],pe.__e(e,t.__v)}}pe.__b=function(t){ae=null,_h&&_h(t)},pe.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Hh&&Hh(t,e)},pe.__r=function(t){Ph&&Ph(t),wt=0;var e=(ae=t.__c).__H;e&&(Ao===ae?(e.__h=[],ae.__h=[],e.__.forEach(function(A){A.__N&&(A.__=A.__N),A.u=A.__N=void 0})):(e.__h.forEach(Qr),e.__h.forEach(io),e.__h=[],wt=0)),Ao=ae},pe.diffed=function(t){Rh&&Rh(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(xh.push(e)!==1&&Ih===pe.requestAnimationFrame||((Ih=pe.requestAnimationFrame)||_y)(xy)),e.__H.__.forEach(function(A){A.u&&(A.__H=A.u),A.u=void 0})),Ao=ae=null},pe.__c=function(t,e){e.some(function(A){try{A.__h.forEach(Qr),A.__h=A.__h.filter(function(n){return!n.__||io(n)})}catch(n){e.some(function(i){i.__h&&(i.__h=[])}),e=[],pe.__e(n,A.__v)}}),Lh&&Lh(t,e)},pe.unmount=function(t){Dh&&Dh(t);var e,A=t.__c;A&&A.__H&&(A.__H.__.forEach(function(n){try{Qr(n)}catch(i){e=i}}),A.__H=void 0,e&&pe.__e(e,A.__v))};var Mh=typeof requestAnimationFrame=="function";function _y(t){var e,A=function(){clearTimeout(n),Mh&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(A,100);Mh&&(e=requestAnimationFrame(A))}function Qr(t){var e=ae,A=t.__c;typeof A=="function"&&(t.__c=void 0,A()),ae=e}function io(t){var e=ae;t.__c=t.__(),ae=e}function ro(t,e){return!t||t.length!==e.length||e.some(function(A,n){return A!==t[n]})}function Nh(t,e){return typeof e=="function"?e(t):e}function Py({size:t=24,color:e="#000"}){return p("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:e,"stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-x-icon lucide-x",children:[p("path",{d:"M18 6 6 18"}),p("path",{d:"m6 6 12 12"})]})}function Kh({onClose:t}){return p("button",{class:"obi-button obi-close-button",onClick:t,"aria-label":"Close",type:"button",children:p(Py,{})})}function Vh({open:t=!1,children:e,onClose:A,size:n="medium"}){const i=QA(null),r=QA(null);Ge(()=>{const c=i.current;c&&(t&&!c.open?c.showModal():!t&&c.open&&(r.current="programmatic",c.close()))},[t]);const s=c=>{const l=i.current;c.target===l&&(r.current="user-initiated",l==null||l.close())},a=c=>{c.preventDefault(),r.current||(r.current="user-initiated");const l=r.current;r.current=null,A==null||A(l)},o=()=>{var c;r.current="user-initiated",(c=i.current)==null||c.close()};return Ge(()=>{const c=i.current;if(c)return c.addEventListener("click",s),c.addEventListener("close",a),()=>{c.removeEventListener("click",s),c.removeEventListener("close",a)}},[A]),p("dialog",{ref:i,className:`modal-${n}`,children:[p(Kh,{onClose:o}),p("div",{class:"modal-content",children:t?typeof e=="function"?e():e:null})]})}function so(t){const{children:e,className:A="",...n}=t;return p("div",{className:`${A} obi-panel`,...n,children:e})}function ao({className:t="",isActive:e=!1,speakingStatus:A,onClick:n,onMouseEnter:i,onMouseLeave:r,children:s}){let a=`obi-pill container ${e&&"active"}`;return A==="user-speaking"&&(a+=" user-speaking"),A==="busy"&&(a+=" busy"),p("div",{className:a,onMouseEnter:i,onMouseLeave:r,children:p("div",{className:`obi-pill pill ${t}`,onClick:n,children:s})})}function Gh({className:t="",active:e,speakingStatus:A,onClick:n,onMouseEnter:i,onMouseLeave:r,children:s,...a}){const o=`obi-pill2 container ${e?"active":""} ${A==="user-speaking"?"user-speaking":""} ${t}`;return p("div",{className:o,...a,children:p("div",{className:"pill",onClick:n,onMouseEnter:i,onMouseLeave:r,children:s})})}function bt({type:t,size:e=24}){return p("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:Ry(t)})}function Ry(t){switch(t){case"pause":return p(Pe,{children:[p("rect",{x:"14",y:"3",width:"5",height:"18",rx:"1"}),p("rect",{x:"5",y:"3",width:"5",height:"18",rx:"1"})]});case"play":return p(Pe,{children:p("path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z"})});case"close":return p(Pe,{children:[p("path",{d:"M18 6 6 18"}),p("path",{d:"m6 6 12 12"})]});case"message":return p(Pe,{children:p("path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z"})});case"minimize":return p(Pe,{children:[p("path",{d:"m14 10 7-7"}),p("path",{d:"M20 10h-6V4"}),p("path",{d:"m3 21 7-7"}),p("path",{d:"M4 14h6v6"})]});case"voice":return p(Pe,{children:[p("path",{d:"M2 10v3"}),p("path",{d:"M6 6v11"}),p("path",{d:"M10 3v18"}),p("path",{d:"M14 8v7"}),p("path",{d:"M18 5v13"}),p("path",{d:"M22 10v3"})]});case"open":return p(Pe,{children:[p("path",{d:"M12 7v14"}),p("path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z"})]})}}const oo=Sy(null);function Ly({children:t}){const e=Oh(oo);if(!e)throw new Error("PopoutTarget must be used within a Popout component");const{controlledOpen:A,isOpen:n,setIsOpen:i,setAnimating:r,targetRef:s,trigger:a,onChange:o,delayMs:c}=e,l=QA(null),u=jh(s,r),[d,h]=Z(!1);Ge(()=>{A!==void 0&&A!==d&&(A?f():m()),h(A)},[A]),Ge(()=>()=>{l.current&&clearTimeout(l.current)},[]);function g(){l.current&&(clearTimeout(l.current),l.current=null)}function f(){g(),c>0?l.current=setTimeout(()=>{o==null||o(!0),i(!0),l.current=null},c):(o==null||o(!0),i(!0))}function m(){g(),o==null||o(!1),i(!1)}const B=()=>{a==="click"&&(n?m():f())};function b(){a==="hover"&&f()}function U(){a==="hover"&&m()}return p("div",{ref:u,class:"target",onClick:B,onMouseEnter:b,onMouseLeave:U,children:t})}function Dy({children:t}){const e=Oh(oo);if(!e)throw new Error("PopoutContent must be used within a Popout component");const{isOpen:A,animating:n,setAnimating:i,targetRef:r,contentRef:s}=e,a=jh(s,i);return to(()=>{if(A&&!n&&r.current&&s.current){const o=s.current;if(!o)return;const c=r.current;if(!c)return;const l=o.getBoundingClientRect(),u=c.getBoundingClientRect(),d=u.right-u.left;o.style.top=`${l.top-l.bottom-(8+e.offset)}px`,o.style.left=`${-(l.right-l.left-d)/2}px`}},[A,n]),A?p("div",{ref:a,class:"content",style:{opacity:n?0:1},children:t}):null}function je({trigger:t="click",open:e,onChange:A,children:n,delayMs:i=0,offset:r=0,className:s=""}){const[a,o]=Z(!1),[c,l]=Z(!1),u=QA(null),d=QA(null),h={controlledOpen:e,isOpen:a,setIsOpen:o,animating:c,setAnimating:l,targetRef:u,contentRef:d,trigger:t,onChange:A,delayMs:i,offset:r};return p(oo.Provider,{value:h,children:p("div",{class:`obi-popout ${s}`,children:n})})}je.Target=Ly,je.Content=Dy;function jh(t,e){const A=QA(null),n=QA(null),i=QA(!0),r=Iy(s=>{if(t.current=s,!s){n.current&&(n.current.disconnect(),n.current=null),i.current=!0;return}function a(){if(i.current){i.current=!1;return}A.current?clearTimeout(A.current):e(!0),A.current=setTimeout(()=>{e(!1),A.current=null},200)}n.current=new ResizeObserver(a),n.current.observe(s,{box:"border-box"})},[]);return Ge(()=>()=>{n.current&&(n.current.disconnect(),n.current=null)},[]),r}function gA({className:t,onClick:e,type:A,disabled:n,title:i}){const r={cancel:p(bt,{type:"close",size:16}),pause:p(bt,{type:"pause",size:16}),play:p(bt,{type:"play",size:16}),message:p(bt,{type:"message",size:16}),minimize:p(bt,{type:"minimize",size:16}),voice:p(bt,{type:"voice",size:16}),open:p(bt,{type:"open",size:16})}[A],s={cancel:"",pause:"",play:"",message:"",minimize:"",voice:"",open:""}[A],a=p("button",{class:`obi-button obi-round-button ${s} ${t}`,onClick:n?void 0:e,disabled:n,children:r});return i?p(je,{className:"obi-round-button-popout",trigger:"hover",delayMs:200,offset:9,children:[p(je.Target,{children:a}),p(je.Content,{children:p("div",{className:"obi-round-button-title",children:i})})]}):a}const Wh=8,Er=8,Hy=50,Oy=.7,zt=3;function Jh({getBands:t,color:e="white"}){const A=QA(null);return Ge(()=>{if(!t)return;const n=setInterval(()=>{try{const i=t();if(!A.current)return;const r=A.current.querySelectorAll(".bar"),s=i&&i.length>0?i.slice(0,Er).map(a=>{const o=Math.abs(a);return Math.min(o/Oy*Wh,Wh)||zt}):Array(Er).fill(zt);for(;s.length<Er;)s.push(zt);s.forEach((a,o)=>{if(a<zt&&(a=zt),r[o]){const c=a*2;r[o].style.height=`${c}px`,r[o].style.display=a>0?"block":"none"}})}catch(i){console.warn("Error updating equaliser:",i)}},Hy);return()=>{clearInterval(n)}},[t]),p("div",{className:"obi-equaliser",ref:A,children:Array.from({length:Er},(n,i)=>p("div",{className:"column",children:p("div",{className:"bar",style:{height:`${zt}px`,backgroundColor:e,display:"block"}})},i))})}function Ln({className:t,children:e,onClick:A}){return A?p("button",{class:`obi-button obi-message ${t} clickable`,onClick:A,children:e}):p("div",{class:`obi-message ${t}`,children:e})}const My=8;function Xh({color:t="white"}){return p("div",{className:"obi-loading-dots",children:Array.from({length:My},(e,A)=>p("div",{className:"column",children:[p("div",{className:"bar",style:{backgroundColor:t,animationDelay:`${A*.15}s`}}),p("div",{className:"dot",style:{backgroundColor:t}})]},A))})}function Ny({onContinue:t,onWrapUp:e}){return p(so,{className:"obi-exit-survey",children:p(Vy,{onContinue:t,onWrapUp:()=>{e()}})})}function Ky({onReasonSelect:t,onClose:e}){const[A,n]=Z("reason"),i=r=>{r==="other"?n("other-reason"):t(r)};return p(so,{className:`obi-exit-survey ${A==="reason"?"obi-exit-survey-reason":""}`,children:A==="reason"?p(Gy,{onReasonSelect:i}):p(jy,{onReasonSelect:i,onClose:e})})}function Vy({onContinue:t,onWrapUp:e}){return p("div",{className:"obi-exit-survey-container",children:[p("h2",{className:"obi-exit-survey-title",children:"Wrapping up early?"}),p("div",{className:"obi-exit-survey-options",children:[p("button",{className:"obi-button obi-exit-survey-button obi-exit-survey-button-continue",onClick:t,type:"button",children:"No, let's continue"}),p("button",{className:"obi-button obi-exit-survey-button obi-exit-survey-button-wrap-up",onClick:e,type:"button",children:"Yes, let's wrap up"})]})]})}function Gy({onReasonSelect:t}){return p("div",{className:"obi-exit-survey-container obi-exit-survey-reason-container",children:[p("div",{className:"obi-exit-survey-header",children:p("h2",{className:"obi-exit-survey-title obi-exit-survey-reason-title",children:"Quick feedback?"})}),p("div",{className:"obi-exit-survey-options obi-exit-survey-reason-options",children:[p("button",{className:"obi-button obi-exit-survey-button obi-exit-survey-reason-button",onClick:()=>t("testing"),type:"button",children:"Will do later"}),p("button",{className:"obi-button obi-exit-survey-button obi-exit-survey-reason-button",onClick:()=>t("no-time"),type:"button",children:"Can't talk right now"}),p("button",{className:"obi-button obi-exit-survey-button obi-exit-survey-reason-button",onClick:()=>t("format-mismatch"),type:"button",children:"Prefer written instructions"}),p("button",{className:"obi-button obi-exit-survey-button obi-exit-survey-reason-button",onClick:()=>t("technical-issue"),type:"button",children:"Experienced technical issues"}),p("button",{className:"obi-button obi-exit-survey-button obi-exit-survey-reason-button",onClick:()=>t("other"),type:"button",children:"Other"})]})]})}function jy({onReasonSelect:t,onClose:e}){return p("div",{className:"obi-exit-survey-container obi-exit-survey-reason-container",children:[p("div",{className:"obi-exit-survey-header",children:[p(Kh,{onClose:e}),p("h2",{className:"obi-exit-survey-title obi-exit-survey-reason-title",children:"Tell us more"})]}),p("div",{className:"obi-exit-survey-options obi-exit-survey-reason-options",children:[p("textarea",{className:"obi-exit-survey-button obi-exit-survey-reason-button",placeholder:"What's on your mind?"}),p("button",{className:"obi-button obi-exit-survey-button obi-exit-survey-button-wrap-up",onClick:()=>t("other-feedback"),type:"button",children:"Send feedback"})]})]})}function Wy(t,e){for(var A in e)t[A]=e[A];return t}function qh(t,e){for(var A in t)if(A!=="__source"&&!(A in e))return!0;for(var n in e)if(n!=="__source"&&t[n]!==e[n])return!0;return!1}function Yh(t,e){this.props=t,this.context=e}(Yh.prototype=new RA).isPureReactComponent=!0,Yh.prototype.shouldComponentUpdate=function(t,e){return qh(this.props,t)||qh(this.state,e)};var zh=K.__b;K.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),zh&&zh(t)};var Jy=K.__e;K.__e=function(t,e,A,n){if(t.then){for(var i,r=e;r=r.__;)if((i=r.__c)&&i.__c)return e.__e==null&&(e.__e=A.__e,e.__k=A.__k),i.__c(t,e)}Jy(t,e,A,n)};var Zh=K.unmount;function $h(t,e,A){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(n){typeof n.__c=="function"&&n.__c()}),t.__c.__H=null),(t=Wy({},t)).__c!=null&&(t.__c.__P===A&&(t.__c.__P=e),t.__c.__e=!0,t.__c=null),t.__k=t.__k&&t.__k.map(function(n){return $h(n,e,A)})),t}function ef(t,e,A){return t&&A&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(n){return ef(n,e,A)}),t.__c&&t.__c.__P===e&&(t.__e&&A.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=A)),t}function co(){this.__u=0,this.o=null,this.__b=null}function Af(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function Sr(){this.i=null,this.l=null}K.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&32&t.__u&&(t.type=null),Zh&&Zh(t)},(co.prototype=new RA).__c=function(t,e){var A=e.__c,n=this;n.o==null&&(n.o=[]),n.o.push(A);var i=Af(n.__v),r=!1,s=function(){r||(r=!0,A.__R=null,i?i(a):a())};A.__R=s;var a=function(){if(!--n.__u){if(n.state.__a){var o=n.state.__a;n.__v.__k[0]=ef(o,o.__c.__P,o.__c.__O)}var c;for(n.setState({__a:n.__b=null});c=n.o.pop();)c.forceUpdate()}};n.__u++||32&e.__u||n.setState({__a:n.__b=n.__v.__k[0]}),t.then(s,s)},co.prototype.componentWillUnmount=function(){this.o=[]},co.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var A=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=$h(this.__b,A,n.__O=n.__P)}this.__b=null}var i=e.__a&&za(Pe,null,t.fallback);return i&&(i.__u&=-33),[za(Pe,null,e.__a?null:t.children),i]};var tf=function(t,e,A){if(++A[1]===A[0]&&t.l.delete(e),t.props.revealOrder&&(t.props.revealOrder[0]!=="t"||!t.l.size))for(A=t.i;A;){for(;A.length>3;)A.pop()();if(A[1]<A[0])break;t.i=A=A[2]}};(Sr.prototype=new RA).__a=function(t){var e=this,A=Af(e.__v),n=e.l.get(t);return n[0]++,function(i){var r=function(){e.props.revealOrder?(n.push(i),tf(e,t,n)):i()};A?A(r):r()}},Sr.prototype.render=function(t){this.i=null,this.l=new Map;var e=yr(t.children);t.revealOrder&&t.revealOrder[0]==="b"&&e.reverse();for(var A=e.length;A--;)this.l.set(e[A],this.i=[1,0,this.i]);return t.children},Sr.prototype.componentDidUpdate=Sr.prototype.componentDidMount=function(){var t=this;this.l.forEach(function(e,A){tf(t,A,e)})};var Xy=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,qy=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Yy=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,zy=/[A-Z0-9]/g,Zy=typeof document<"u",$y=function(t){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(t)};RA.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(RA.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})});var nf=K.event;function eU(){}function AU(){return this.cancelBubble}function tU(){return this.defaultPrevented}K.event=function(t){return nf&&(t=nf(t)),t.persist=eU,t.isPropagationStopped=AU,t.isDefaultPrevented=tU,t.nativeEvent=t};var nU={enumerable:!1,configurable:!0,get:function(){return this.class}},rf=K.vnode;K.vnode=function(t){typeof t.type=="string"&&function(e){var A=e.props,n=e.type,i={},r=n.indexOf("-")===-1;for(var s in A){var a=A[s];if(!(s==="value"&&"defaultValue"in A&&a==null||Zy&&s==="children"&&n==="noscript"||s==="class"||s==="className")){var o=s.toLowerCase();s==="defaultValue"&&"value"in A&&A.value==null?s="value":s==="download"&&a===!0?a="":o==="translate"&&a==="no"?a=!1:o[0]==="o"&&o[1]==="n"?o==="ondoubleclick"?s="ondblclick":o!=="onchange"||n!=="input"&&n!=="textarea"||$y(A.type)?o==="onfocus"?s="onfocusin":o==="onblur"?s="onfocusout":Yy.test(s)&&(s=o):o=s="oninput":r&&qy.test(s)?s=s.replace(zy,"-$&").toLowerCase():a===null&&(a=void 0),o==="oninput"&&i[s=o]&&(s="oninputCapture"),i[s]=a}}n=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=yr(A.children).forEach(function(c){c.props.selected=i.value.indexOf(c.props.value)!=-1})),n=="select"&&i.defaultValue!=null&&(i.value=yr(A.children).forEach(function(c){c.props.selected=i.multiple?i.defaultValue.indexOf(c.props.value)!=-1:i.defaultValue==c.props.value})),A.class&&!A.className?(i.class=A.class,Object.defineProperty(i,"className",nU)):(A.className&&!A.class||A.class&&A.className)&&(i.class=i.className=A.className),e.props=i}(t),t.$$typeof=Xy,rf&&rf(t)};var sf=K.__r;K.__r=function(t){sf&&sf(t),t.__c};var af=K.diffed;K.diffed=function(t){af&&af(t);var e=t.props,A=t.__e;A!=null&&t.type==="textarea"&&"value"in e&&e.value!==A.value&&(A.value=e.value==null?"":e.value)};function iU(t){const{placeholder:e="Type your message...",value:A,defaultValue:n,onChange:i,onSend:r,onCancel:s,onExpand:a,isLoading:o=!1,disabled:c=!1,maxLength:l=500,children:u}=t,[d,h]=Z(A||n||""),[g,f]=Z((A||n||"").length>24),m=QA(null);to(()=>{g&&(a==null||a(!0))},[]);const B=A!==void 0?A:d,b=w=>{const y=w.currentTarget.value;A===void 0&&h(y),i==null||i(y)},U=w=>{w.key==="Escape"&&(h(A||n||""),f(!1),s==null||s()),w.key==="Enter"&&!w.shiftKey&&B.trim()&&(w.preventDefault(),h(A||n||""),f(!1),C()),(B||"").length>=24&&!g&&(f(!0),a==null||a(!0))};Ge(()=>{m.current&&m.current.focus()},[m.current]);const C=()=>{!B.trim()||o||c||(r==null||r(B.trim()),A===void 0&&h(""))};return p("div",{className:`obi-message-input ${g?"expanded":""}`,children:[p("div",{className:"container",children:p("textarea",{ref:m,className:"field",placeholder:e,value:B,onInput:b,onKeyDown:U,disabled:c||o,maxLength:l,rows:1})}),p("div",{className:"button-container",children:[g&&p("div",{children:u}),p("button",{className:"obi-button send",onClick:C,disabled:!B.trim()||o||c,type:"button",children:p("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p("path",{d:"M6.00016 10.6673V1.33398M6.00016 1.33398L1.3335 6.00065M6.00016 1.33398L10.6668 6.00065",stroke:"#F3F3F3","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round"})})})]})]})}function rU(t){const{currentStep:e,totalSteps:A,stepNames:n,className:i}=t,r=Array.from({length:A},(o,c)=>({isCompleted:c<e,stepNumber:c+1})),s=n[e-1]||`Step ${e}`,a=`${e}/${A} • ${s}`;return p("div",{class:`obi-course-progress ${i||""}`,children:[p("div",{class:"obi-course-progress-steps",children:r.map((o,c)=>p("div",{class:"obi-course-progress-container",children:p("div",{class:`obi-course-progress-step ${o.isCompleted?"completed":""}`})},c))}),p("div",{class:"obi-course-progress-description",children:a})]})}function sU(t){const{disabled:e,inPlan:A,isPaused:n}=t,[i,r]=Z(null),[s,a]=Z(t.isActive??t.defaultIsActive??!1),[o,c]=Z(!1),[l,u]=Z(t.cancelling??!1),[d,h]=Z(t.messaging??!1),[g,f]=Z(!1),[m,B]=Z(!1);to(()=>{t.messaging!==void 0&&h(t.messaging)},[t.messaging]);function b(){a(!0),c(!1),B(!0),t.messaging!==void 0&&h(t.messaging)}function U(){}function C(){i&&(clearTimeout(i),r(null))}function w(){r(setTimeout(()=>{a(t.defaultIsActive??!1),B(!1)},400))}function y(oe){var Je;f(!1),(Je=t.onMessage)==null||Je.call(t,oe)}function E(){h(!1),f(!1),a(!1),c(!0)}function F(){h(!1),u(!0),f(!1)}function S(){var oe;A||((oe=t.onOpen)==null||oe.call(t))}function x(){var oe;(oe=t.onMessage)==null||oe.call(t,"Okay, let's continue.")}function R(oe){var Je;t.messaging===void 0&&((Je=t.onMessagingChange)==null||Je.call(t,oe),h(oe)),oe||f(!1)}const L=t.isActive??((s||A)&&!o&&!e),M=L&&A,te=L&&A&&!g,N=t.speakingStatus==="user-speaking",V=t.speakingStatus==="thinking",Fe=t.speakingStatus==="busy",ve=L&&!A&&!l&&m,Ce=L&&A&&n&&!N&&!l,tA=L&&A&&n&&N&&!l,Le=L&&A&&!n&&N&&!l,we=L&&A&&!n&&Fe&&!l,nA=d&&N,Ye=ve||Ce||tA||Le||l,Ie=400,it=L&&A&&!g,We=ve?5:10;return!A&&!l?p(aU,{...t}):!A&&l?p(oU,{onCancelReason:oe=>{var Je;a(t.defaultIsActive??!1),u(!1),(Je=t.onCancelReason)==null||Je.call(t,oe)},onClose:()=>{a(t.defaultIsActive??!1),u(!1)}}):p(so,{className:`obi-widget-panel ${M?"expanded":""} ${g?"maximized":""} ${d?"messaging":""} ${Fe?"tool-usage":""}`,children:[p("div",{className:`obi-widget ${L?"active":""} ${A?"in-plan":""}`,onMouseEnter:C,onMouseLeave:w,children:[te&&p(gA,{type:"cancel",onClick:F,disabled:l,title:"Cancel session"}),te&&!n&&p(gA,{type:"pause",onClick:t.onPause,title:"Pause session"}),te&&n&&p(gA,{type:"play",onClick:t.onUnpause,title:"Unpause session"}),p(je,{className:"obi-widget-popout",open:Ye,trigger:null,delayMs:Ie,offset:We,children:[p(je.Target,{children:[nA&&p(iU,{value:t.message,defaultValue:"Okay, let's continue.",onCancel:()=>R(!1),onSend:y,onExpand:f,children:p("div",{className:"obi-widget-buttons",children:[p(gA,{type:"cancel",onClick:F,disabled:l,title:"Cancel session"}),!n&&p(gA,{type:"pause",onClick:t.onPause,title:"Pause session"}),n&&p(gA,{type:"play",onClick:t.onUnpause,title:"Unpause session"}),p(gA,{type:d?"voice":"message",disabled:!N||t.messaging!==void 0,onClick:()=>R(!d),title:d?"Voice input":"Text input"}),p(gA,{type:"minimize",onClick:E,title:"Minimize widget"})]})}),!nA&&p(ao,{className:L&&!A?"button":"",isActive:L,speakingStatus:t.speakingStatus,onClick:S,onMouseEnter:b,onMouseLeave:U,children:[L&&!A&&!we&&p("span",{className:"obi-widget-pill-text",children:"Tutorials"}),L&&A&&we&&p("span",{className:"obi-widget-pill-text",children:"Searching knowledge ..."}),L&&A&&!V&&!we&&p(Jh,{getBands:t.spectrum}),L&&V&&!we&&p(Xh,{})]})]}),p(je.Content,{children:p("div",{onMouseLeave:w,children:[ve&&p(Ln,{onClick:S,children:"Click to see all"}),Ce&&p(Ln,{children:"Session will pause shortly"}),tA&&p(Ln,{children:"Paused"}),Le&&p(Ln,{onClick:x,children:"Ready to continue?"}),l&&p(Ny,{onContinue:()=>{u(!1),t.messaging!==void 0&&h(t.messaging)},onWrapUp:()=>{var oe;(oe=t.onCancel)==null||oe.call(t)}})]})})]}),te&&p(gA,{type:d?"voice":"message",disabled:!N||t.messaging!==void 0,onClick:()=>R(!d),title:d?"Voice input":"Text input"}),te&&p(gA,{type:"minimize",onClick:E,title:"Minimize widget"})]}),it&&t.courseProgress&&p("div",{className:`obi-course-progress-container ${d?"expanded":""}`,children:p(rU,{currentStep:t.courseProgress.currentStep,totalSteps:t.courseProgress.totalSteps,stepNames:t.courseProgress.stepNames})})]})}function aU(t){const{disabled:e}=t,[A,n]=Z(null),[i,r]=Z(t.isActive??t.defaultIsActive??!1),[s,a]=Z(!1),[o,c]=Z(t.hovered??!1);function l(){r(!0),a(!1),c(!0)}function u(){}function d(){A&&(clearTimeout(A),n(null))}function h(){i&&n(setTimeout(()=>{r(t.defaultIsActive??!1),c(!1)},400))}function g(){r(!1),a(!0)}function f(){var C;(C=t.onOpen)==null||C.call(t)}const m=t.hovered??(o&&!s),B=t.isActive??(i&&!e&&!s),b=B&&m,U=`round-button ${B?"active":""}`;return p("div",{className:"obi-widget-out-of-plan-container",children:p("div",{className:`obi-widget-out-of-plan ${m?"hover":""} ${B?"active":""}`,onMouseEnter:d,onMouseLeave:h,children:[p("div",{className:U,style:{width:"27px",height:"30px"}}),p(je,{className:"obi-widget-popout",open:b,trigger:null,delayMs:400,offset:5,children:[p(je.Target,{children:p(Gh,{className:B?"button":"",active:B,onClick:f,onMouseEnter:l,onMouseLeave:u,children:B&&p("span",{className:"text",children:"Tutorials"})})}),p(je.Content,{children:p("div",{onMouseLeave:h,children:p(Ln,{className:"message",onClick:f,children:"Click to see all"})})})]}),p(gA,{className:U,type:"minimize",onClick:g,title:"Minimize widget"})]})})}function oU(t){return p("div",{className:"obi-widget-out-of-plan-container",children:p("div",{className:"obi-widget-out-of-plan",children:p(je,{className:"obi-widget-popout",open:!0,trigger:null,delayMs:100,offset:5,children:[p(je.Target,{children:p(Gh,{active:!1})}),p(je.Content,{children:p(Ky,{onReasonSelect:e=>{var A;(A=t.onCancelReason)==null||A.call(t,e)},onClose:()=>{var e;(e=t.onClose)==null||e.call(t)}})})]})})})}function cU({open:t=!1,children:e,onClose:A}){return p(Vh,{open:t,onClose:A,children:p("div",{className:"tour content-area",children:t?typeof e=="function"?e():e:null})})}function Zt({title:t="",subtitle:e="",agentName:A="Obi",buttonText:n="Continue",speakingState:i=null,actionDisabled:r=!1,href:s=null,centerVisual:a,description:o,button:c,onAction:l}){const[u,d]=Z(r),[h,g]=Z(!1),[f,m]=Z(i);return Ge(()=>{h||(i==="listening"&&f!=="listening"&&u&&d(!1),i!=="listening"&&!u&&d(!0)),m(i)},[i,u]),Ge(()=>{d(r)},[r]),p("div",{className:"tour-content",children:p("div",{className:"container",children:[p("div",{className:"header",children:[p("h1",{className:"title",children:t}),p("p",{className:"subtitle",children:e})]}),p("div",{className:"visual",style:{background:"var(--obi-color-tint)"},children:a}),p("div",{className:"description",children:o}),p("div",{className:"button-container",children:c||p(s?"a":"button",{className:`action-button ${u?"disabled":""}`,onClick:()=>{u||(d(!0),g(!0),l==null||l())},disabled:u,...s?{href:s,target:"_blank",rel:"noopener noreferrer"}:{type:"button"},children:p("span",{className:"button-text",children:(()=>{switch(i){case"thinking":return"Loading...";case"speaking":return`${A} is speaking`;default:return n}})()})})})]})})}function lU({logoUrl:t="",appName:e="App"}){const[A,n]=Z(!1),[i,r]=Z(!1),s=()=>{n(!0)},a=()=>{r(!0),n(!1)},o={container:{display:"block"},logoContainer:{width:"480px",height:"240px",borderRadius:"12px",display:"flex",alignItems:"center",justifyContent:"center",position:"relative",overflow:"hidden"},backgroundPattern:{position:"absolute",inset:0,zIndex:0,background:"#F5F5F5",backgroundImage:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='277' height='195' viewBox='0 0 277 195' fill='none'%3E%3Cpath opacity='0.4' d='M341.308 0.75C380.279 0.750001 411.872 24.3772 411.872 53.5229C411.872 82.6685 380.279 106.296 341.308 106.296H215.792C176.964 108.335 145.691 130.837 141.128 159.475V256.616C145.912 286.659 180.089 309.954 221.548 309.954H330.872C375.607 309.954 411.872 282.833 411.872 249.377V159.069C411.872 129.923 443.465 106.296 482.436 106.296C521.407 106.296 553 129.923 553 159.069V257.181C553 285.058 524.099 307.88 487.483 309.815C489.264 309.902 491.061 309.954 492.871 309.954C448.137 309.954 411.872 337.076 411.872 370.532C411.872 369.177 411.803 367.834 411.686 366.502C409.098 393.885 378.582 415.5 341.308 415.5H210.118C171.147 415.5 139.554 391.873 139.554 362.727C139.554 362.204 139.565 361.683 139.585 361.163C133.564 332.156 100.023 309.954 59.5488 309.954C61.4544 309.954 63.3441 309.9 65.2169 309.803C28.7434 307.76 -8.57239e-07 284.982 0 257.181V159.069C1.64632e-06 130.901 29.5078 107.89 66.6662 106.377C64.3207 106.224 61.9472 106.141 59.5488 106.141C100.012 106.141 133.54 83.951 139.575 54.9552C139.558 54.4793 139.554 54.0018 139.554 53.5229C139.554 24.3772 171.147 0.75 210.118 0.75H341.308Z' fill='white'/%3E%3C/svg%3E")`,backgroundRepeat:"no-repeat",backgroundPosition:"190px 60px",backgroundSize:"300px 225px"},logoWrapper:{background:"#888888",width:"120px",height:"120px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",zIndex:10,overflow:"hidden"},appLogo:{width:"120px",height:"120px",objectFit:"cover",display:t&&!A&&i?"block":"none"},placeholderLogo:{width:"60px",height:"60px",background:"rgba(255, 255, 255, 0.2)",borderRadius:"4px",display:!t||A||!i?"flex":"none",alignItems:"center",justifyContent:"center",color:"rgba(255, 255, 255, 0.8)",fontSize:"24px",fontWeight:"bold"}};return p("div",{style:o.container,children:p("div",{style:o.logoContainer,children:[p("div",{style:o.backgroundPattern}),p("div",{style:o.logoWrapper,children:[t&&p("img",{style:o.appLogo,src:t,alt:`${e} logo`,onError:s,onLoad:a}),p("div",{style:o.placeholderLogo,children:e.charAt(0).toUpperCase()})]})]})})}function uU({session:t,speakingState:e,onAction:A}){const n=t.appName?`Navigate to ${t.appName}`:"Navigate to app",i=t.appName?`Open ${t.appName}`:"Open app",r=t.appName?`Enjoy the tutorial in ${t.appName}`:"Enjoy the tutorial";return p(Zt,{title:n,subtitle:"Click the button below to open the app",agentName:t.agentName||"Obi",buttonText:i,speakingState:e,actionDisabled:!0,href:t.url,description:r,centerVisual:p(lU,{logoUrl:t.appLogoUrl,appName:t.appName}),onAction:A})}function of({className:t=""}){return p("svg",{width:"64",height:"64",viewBox:"0 0 256 256",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:p("path",{d:"M158.803 0L160.352 0.0399439C176.267 0.844061 188.922 13.9634 188.922 30.0311C188.922 46.6174 175.438 60.0653 158.803 60.0656H99.0263L98.9061 60.0722C78.8071 61.4795 62.6269 77.004 60.2644 96.7673L60.241 96.9704V158.93L60.2644 159.13C62.7406 179.86 80.4234 195.934 101.881 195.935H153.842C176.993 195.935 195.759 177.223 195.759 154.14V96.9138L195.799 95.3693C196.606 79.5009 209.766 66.8827 225.881 66.8827C242.515 66.8834 256 80.328 256 96.9138V159.086L255.963 160.564C255.225 175.748 243.176 187.971 228.038 189.038V189.214C207.121 190.591 190.4 207.263 189.019 228.119H188.842C187.738 243.7 174.712 256 158.803 256H96.4491C79.8147 256 66.3309 242.555 66.3302 225.969C66.3302 225.673 66.3349 225.375 66.3436 225.077H66.3503H66.3035C63.3344 206.008 47.4427 190.589 27.8321 189.231L27.8354 189.031C12.2702 187.868 0.000167669 174.905 0 159.086V96.9138L0.0367222 95.4192C0.791087 80.0787 13.0909 67.7634 28.453 66.9293C47.7697 65.3039 63.3522 50.3234 66.2969 31.4658L66.3469 31.1595L66.3369 30.85C66.3301 30.5933 66.3302 30.3238 66.3302 30.0311C66.3309 13.4454 79.8148 0.000165137 96.4491 0H158.803Z",fill:"currentColor"})})}function dU({children:t}){const e={container:{position:"relative",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},logo:{display:"flex",width:"120px",height:"120px",justifyContent:"center",alignItems:"center",aspectRatio:"1/1",borderRadius:"8px",color:"#FFFFFF",position:"relative",overflow:"hidden",background:"var(--obi-color-primary)",boxShadow:`
46
+ `},Gl}var a0;function YF(){if(a0)return un;a0=1;var n=zF(),e=XF(),t=Vl();return un.grammar=t,un.write=e,un.parse=n.parse,un.parseParams=n.parseParams,un.parseFmtpConfig=n.parseFmtpConfig,un.parsePayloads=n.parsePayloads,un.parseRemoteCandidates=n.parseRemoteCandidates,un.parseImageAttributes=n.parseImageAttributes,un.parseSimulcastStreamList=n.parseSimulcastStreamList,un}var gr=YF();function jl(n,e,t){var r,i,A;e===void 0&&(e=50),t===void 0&&(t={});var s=(r=t.isImmediate)!=null&&r,o=(i=t.callback)!=null&&i,a=t.maxWait,c=Date.now(),u=[];function l(){if(a!==void 0){var h=Date.now()-c;if(h+e>=a)return a-h}return e}var d=function(){var h=[].slice.call(arguments),f=this;return new Promise(function(p,g){var v=s&&A===void 0;if(A!==void 0&&clearTimeout(A),A=setTimeout(function(){if(A=void 0,c=Date.now(),!s){var b=n.apply(f,h);o&&o(b),u.forEach(function(B){return(0,B.resolve)(b)}),u=[]}},l()),v){var y=n.apply(f,h);return o&&o(y),p(y)}u.push({resolve:p,reject:g})})};return d.cancel=function(h){A!==void 0&&clearTimeout(A),u.forEach(function(f){return(0,f.reject)(h)}),u=[]},d}const ZF=.7,$F=20,Pi={NegotiationStarted:"negotiationStarted",NegotiationComplete:"negotiationComplete",RTPVideoPayloadTypes:"rtpVideoPayloadTypes"};class c0 extends _n.EventEmitter{get pc(){return this._pc||(this._pc=this.createPC()),this._pc}constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r;super(),this.log=ce,this.ddExtID=0,this.pendingCandidates=[],this.restartingIce=!1,this.renegotiate=!1,this.trackBitrates=[],this.remoteStereoMids=[],this.remoteNackMids=[],this.negotiate=jl(i=>S(this,void 0,void 0,function*(){this.emit(Pi.NegotiationStarted);try{yield this.createAndSendOffer()}catch(A){if(i)i(A);else throw A}}),$F),this.close=()=>{this._pc&&(this._pc.close(),this._pc.onconnectionstatechange=null,this._pc.oniceconnectionstatechange=null,this._pc.onicegatheringstatechange=null,this._pc.ondatachannel=null,this._pc.onnegotiationneeded=null,this._pc.onsignalingstatechange=null,this._pc.onicecandidate=null,this._pc.ondatachannel=null,this._pc.ontrack=null,this._pc.onconnectionstatechange=null,this._pc.oniceconnectionstatechange=null,this._pc=null)},this.log=Mn((r=t.loggerName)!==null&&r!==void 0?r:an.PCTransport),this.loggerOptions=t,this.config=e,this._pc=this.createPC()}createPC(){const e=new RTCPeerConnection(this.config);return e.onicecandidate=t=>{var r;t.candidate&&((r=this.onIceCandidate)===null||r===void 0||r.call(this,t.candidate))},e.onicecandidateerror=t=>{var r;(r=this.onIceCandidateError)===null||r===void 0||r.call(this,t)},e.oniceconnectionstatechange=()=>{var t;(t=this.onIceConnectionStateChange)===null||t===void 0||t.call(this,e.iceConnectionState)},e.onsignalingstatechange=()=>{var t;(t=this.onSignalingStatechange)===null||t===void 0||t.call(this,e.signalingState)},e.onconnectionstatechange=()=>{var t;(t=this.onConnectionStateChange)===null||t===void 0||t.call(this,e.connectionState)},e.ondatachannel=t=>{var r;(r=this.onDataChannel)===null||r===void 0||r.call(this,t)},e.ontrack=t=>{var r;(r=this.onTrack)===null||r===void 0||r.call(this,t)},e}get logContext(){var e,t;return Object.assign({},(t=(e=this.loggerOptions).loggerContextCb)===null||t===void 0?void 0:t.call(e))}get isICEConnected(){return this._pc!==null&&(this.pc.iceConnectionState==="connected"||this.pc.iceConnectionState==="completed")}addIceCandidate(e){return S(this,void 0,void 0,function*(){if(this.pc.remoteDescription&&!this.restartingIce)return this.pc.addIceCandidate(e);this.pendingCandidates.push(e)})}setRemoteDescription(e){return S(this,void 0,void 0,function*(){var t;let r;if(e.type==="offer"){let{stereoMids:i,nackMids:A}=ex(e);this.remoteStereoMids=i,this.remoteNackMids=A}else if(e.type==="answer"){const i=gr.parse((t=e.sdp)!==null&&t!==void 0?t:"");i.media.forEach(A=>{A.type==="audio"&&this.trackBitrates.some(s=>{if(!s.transceiver||A.mid!=s.transceiver.mid)return!1;let o=0;if(A.rtp.some(c=>c.codec.toUpperCase()===s.codec.toUpperCase()?(o=c.payload,!0):!1),o===0)return!0;let a=!1;for(const c of A.fmtp)if(c.payload===o){c.config=c.config.split(";").filter(u=>!u.includes("maxaveragebitrate")).join(";"),s.maxbr>0&&(c.config+=";maxaveragebitrate=".concat(s.maxbr*1e3)),a=!0;break}return a||s.maxbr>0&&A.fmtp.push({payload:o,config:"maxaveragebitrate=".concat(s.maxbr*1e3)}),!0})}),r=gr.write(i)}yield this.setMungedSDP(e,r,!0),this.pendingCandidates.forEach(i=>{this.pc.addIceCandidate(i)}),this.pendingCandidates=[],this.restartingIce=!1,this.renegotiate?(this.renegotiate=!1,yield this.createAndSendOffer()):e.type==="answer"&&(this.emit(Pi.NegotiationComplete),e.sdp&&gr.parse(e.sdp).media.forEach(A=>{A.type==="video"&&this.emit(Pi.RTPVideoPayloadTypes,A.rtp)}))})}createAndSendOffer(e){return S(this,void 0,void 0,function*(){var t;if(this.onOffer===void 0)return;if(e!=null&&e.iceRestart&&(this.log.debug("restarting ICE",this.logContext),this.restartingIce=!0),this._pc&&this._pc.signalingState==="have-local-offer"){const A=this._pc.remoteDescription;if(e!=null&&e.iceRestart&&A)yield this._pc.setRemoteDescription(A);else{this.renegotiate=!0;return}}else if(!this._pc||this._pc.signalingState==="closed"){this.log.warn("could not createOffer with closed peer connection",this.logContext);return}this.log.debug("starting to negotiate",this.logContext);const r=yield this.pc.createOffer(e);this.log.debug("original offer",Object.assign({sdp:r.sdp},this.logContext));const i=gr.parse((t=r.sdp)!==null&&t!==void 0?t:"");i.media.forEach(A=>{l0(A),A.type==="audio"?u0(A,[],[]):A.type==="video"&&this.trackBitrates.some(s=>{if(!A.msid||!s.cid||!A.msid.includes(s.cid))return!1;let o=0;if(A.rtp.some(c=>c.codec.toUpperCase()===s.codec.toUpperCase()?(o=c.payload,!0):!1),o===0||(DA(s.codec)&&this.ensureVideoDDExtensionForSVC(A,i),s.codec!=="av1"))return!0;const a=Math.round(s.maxbr*ZF);for(const c of A.fmtp)if(c.payload===o){c.config.includes("x-google-start-bitrate")||(c.config+=";x-google-start-bitrate=".concat(a));break}return!0})}),yield this.setMungedSDP(r,gr.write(i)),this.onOffer(r)})}createAndSetAnswer(){return S(this,void 0,void 0,function*(){var e;const t=yield this.pc.createAnswer(),r=gr.parse((e=t.sdp)!==null&&e!==void 0?e:"");return r.media.forEach(i=>{l0(i),i.type==="audio"&&u0(i,this.remoteStereoMids,this.remoteNackMids)}),yield this.setMungedSDP(t,gr.write(r)),t})}createDataChannel(e,t){return this.pc.createDataChannel(e,t)}addTransceiver(e,t){return this.pc.addTransceiver(e,t)}addTrack(e){if(!this._pc)throw new ut("PC closed, cannot add track");return this._pc.addTrack(e)}setTrackCodecBitrate(e){this.trackBitrates.push(e)}setConfiguration(e){var t;if(!this._pc)throw new ut("PC closed, cannot configure");return(t=this._pc)===null||t===void 0?void 0:t.setConfiguration(e)}canRemoveTrack(){var e;return!!(!((e=this._pc)===null||e===void 0)&&e.removeTrack)}removeTrack(e){var t;return(t=this._pc)===null||t===void 0?void 0:t.removeTrack(e)}getConnectionState(){var e,t;return(t=(e=this._pc)===null||e===void 0?void 0:e.connectionState)!==null&&t!==void 0?t:"closed"}getICEConnectionState(){var e,t;return(t=(e=this._pc)===null||e===void 0?void 0:e.iceConnectionState)!==null&&t!==void 0?t:"closed"}getSignallingState(){var e,t;return(t=(e=this._pc)===null||e===void 0?void 0:e.signalingState)!==null&&t!==void 0?t:"closed"}getTransceivers(){var e,t;return(t=(e=this._pc)===null||e===void 0?void 0:e.getTransceivers())!==null&&t!==void 0?t:[]}getSenders(){var e,t;return(t=(e=this._pc)===null||e===void 0?void 0:e.getSenders())!==null&&t!==void 0?t:[]}getLocalDescription(){var e;return(e=this._pc)===null||e===void 0?void 0:e.localDescription}getRemoteDescription(){var e;return(e=this.pc)===null||e===void 0?void 0:e.remoteDescription}getStats(){return this.pc.getStats()}getConnectedAddress(){return S(this,void 0,void 0,function*(){var e;if(!this._pc)return;let t="";const r=new Map,i=new Map;if((yield this._pc.getStats()).forEach(o=>{switch(o.type){case"transport":t=o.selectedCandidatePairId;break;case"candidate-pair":t===""&&o.selected&&(t=o.id),r.set(o.id,o);break;case"remote-candidate":i.set(o.id,"".concat(o.address,":").concat(o.port));break}}),t==="")return;const s=(e=r.get(t))===null||e===void 0?void 0:e.remoteCandidateId;if(s!==void 0)return i.get(s)})}setMungedSDP(e,t,r){return S(this,void 0,void 0,function*(){if(t){const i=e.sdp;e.sdp=t;try{this.log.debug("setting munged ".concat(r?"remote":"local"," description"),this.logContext),r?yield this.pc.setRemoteDescription(e):yield this.pc.setLocalDescription(e);return}catch(A){this.log.warn("not able to set ".concat(e.type,", falling back to unmodified sdp"),Object.assign(Object.assign({},this.logContext),{error:A,sdp:t})),e.sdp=i}}try{r?yield this.pc.setRemoteDescription(e):yield this.pc.setLocalDescription(e)}catch(i){let A="unknown error";i instanceof Error?A=i.message:typeof i=="string"&&(A=i);const s={error:A,sdp:e.sdp};throw!r&&this.pc.remoteDescription&&(s.remoteSdp=this.pc.remoteDescription),this.log.error("unable to set ".concat(e.type),Object.assign(Object.assign({},this.logContext),{fields:s})),new yl(A)}})}ensureVideoDDExtensionForSVC(e,t){var r,i;if(!((r=e.ext)===null||r===void 0?void 0:r.some(s=>s.uri===Vv))){if(this.ddExtID===0){let s=0;t.media.forEach(o=>{var a;o.type==="video"&&((a=o.ext)===null||a===void 0||a.forEach(c=>{c.value>s&&(s=c.value)}))}),this.ddExtID=s+1}(i=e.ext)===null||i===void 0||i.push({value:this.ddExtID,uri:Vv})}}}function u0(n,e,t){let r=0;n.rtp.some(i=>i.codec==="opus"?(r=i.payload,!0):!1),r>0&&(n.rtcpFb||(n.rtcpFb=[]),t.includes(n.mid)&&!n.rtcpFb.some(i=>i.payload===r&&i.type==="nack")&&n.rtcpFb.push({payload:r,type:"nack"}),e.includes(n.mid)&&n.fmtp.some(i=>i.payload===r?(i.config.includes("stereo=1")||(i.config+=";stereo=1"),!0):!1))}function ex(n){var e;const t=[],r=[],i=gr.parse((e=n.sdp)!==null&&e!==void 0?e:"");let A=0;return i.media.forEach(s=>{var o;s.type==="audio"&&(s.rtp.some(a=>a.codec==="opus"?(A=a.payload,!0):!1),!((o=s.rtcpFb)===null||o===void 0)&&o.some(a=>a.payload===A&&a.type==="nack")&&r.push(s.mid),s.fmtp.some(a=>a.payload===A?(a.config.includes("sprop-stereo=1")&&t.push(s.mid),!0):!1))}),{stereoMids:t,nackMids:r}}function l0(n){if(n.connection){const e=n.connection.ip.indexOf(":")>=0;(n.connection.version===4&&e||n.connection.version===6&&!e)&&(n.connection.ip="0.0.0.0",n.connection.version=4)}}const Wl="vp8",tx={audioPreset:Cl.music,dtx:!0,red:!0,forceStereo:!1,simulcast:!0,screenShareEncoding:Sl.h1080fps15.encoding,stopMicTrackOnMute:!1,videoCodec:Wl,backupCodec:!0},d0={deviceId:{ideal:"default"},autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0,voiceIsolation:!0},h0={deviceId:{ideal:"default"},resolution:LA.h720.resolution},nx={adaptiveStream:!1,dynacast:!1,stopLocalTrackOnUnpublish:!0,reconnectPolicy:new WI,disconnectOnPageLeave:!0,webAudioMix:!1},ql={autoSubscribe:!0,maxRetries:1,peerConnectionTimeout:15e3,websocketTimeout:15e3};var ze;(function(n){n[n.NEW=0]="NEW",n[n.CONNECTING=1]="CONNECTING",n[n.CONNECTED=2]="CONNECTED",n[n.FAILED=3]="FAILED",n[n.CLOSING=4]="CLOSING",n[n.CLOSED=5]="CLOSED"})(ze||(ze={}));class rx{get needsPublisher(){return this.isPublisherConnectionRequired}get needsSubscriber(){return this.isSubscriberConnectionRequired}get currentState(){return this.state}constructor(e,t,r){var i;this.peerConnectionTimeout=ql.peerConnectionTimeout,this.log=ce,this.updateState=()=>{var A;const s=this.state,o=this.requiredTransports.map(a=>a.getConnectionState());o.every(a=>a==="connected")?this.state=ze.CONNECTED:o.some(a=>a==="failed")?this.state=ze.FAILED:o.some(a=>a==="connecting")?this.state=ze.CONNECTING:o.every(a=>a==="closed")?this.state=ze.CLOSED:o.some(a=>a==="closed")?this.state=ze.CLOSING:o.every(a=>a==="new")&&(this.state=ze.NEW),s!==this.state&&(this.log.debug("pc state change: from ".concat(ze[s]," to ").concat(ze[this.state]),this.logContext),(A=this.onStateChange)===null||A===void 0||A.call(this,this.state,this.publisher.getConnectionState(),this.subscriber.getConnectionState()))},this.log=Mn((i=r.loggerName)!==null&&i!==void 0?i:an.PCManager),this.loggerOptions=r,this.isPublisherConnectionRequired=!t,this.isSubscriberConnectionRequired=t,this.publisher=new c0(e,r),this.subscriber=new c0(e,r),this.publisher.onConnectionStateChange=this.updateState,this.subscriber.onConnectionStateChange=this.updateState,this.publisher.onIceConnectionStateChange=this.updateState,this.subscriber.onIceConnectionStateChange=this.updateState,this.publisher.onSignalingStatechange=this.updateState,this.subscriber.onSignalingStatechange=this.updateState,this.publisher.onIceCandidate=A=>{var s;(s=this.onIceCandidate)===null||s===void 0||s.call(this,A,on.PUBLISHER)},this.subscriber.onIceCandidate=A=>{var s;(s=this.onIceCandidate)===null||s===void 0||s.call(this,A,on.SUBSCRIBER)},this.subscriber.onDataChannel=A=>{var s;(s=this.onDataChannel)===null||s===void 0||s.call(this,A)},this.subscriber.onTrack=A=>{var s;(s=this.onTrack)===null||s===void 0||s.call(this,A)},this.publisher.onOffer=A=>{var s;(s=this.onPublisherOffer)===null||s===void 0||s.call(this,A)},this.state=ze.NEW,this.connectionLock=new Ot,this.remoteOfferLock=new Ot}get logContext(){var e,t;return Object.assign({},(t=(e=this.loggerOptions).loggerContextCb)===null||t===void 0?void 0:t.call(e))}requirePublisher(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.isPublisherConnectionRequired=e,this.updateState()}requireSubscriber(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.isSubscriberConnectionRequired=e,this.updateState()}createAndSendPublisherOffer(e){return this.publisher.createAndSendOffer(e)}setPublisherAnswer(e){return this.publisher.setRemoteDescription(e)}removeTrack(e){return this.publisher.removeTrack(e)}close(){return S(this,void 0,void 0,function*(){if(this.publisher&&this.publisher.getSignallingState()!=="closed"){const e=this.publisher;for(const t of e.getSenders())try{e.canRemoveTrack()&&e.removeTrack(t)}catch(r){this.log.warn("could not removeTrack",Object.assign(Object.assign({},this.logContext),{error:r}))}}yield Promise.all([this.publisher.close(),this.subscriber.close()]),this.updateState()})}triggerIceRestart(){return S(this,void 0,void 0,function*(){this.subscriber.restartingIce=!0,this.needsPublisher&&(yield this.createAndSendPublisherOffer({iceRestart:!0}))})}addIceCandidate(e,t){return S(this,void 0,void 0,function*(){t===on.PUBLISHER?yield this.publisher.addIceCandidate(e):yield this.subscriber.addIceCandidate(e)})}createSubscriberAnswerFromOffer(e){return S(this,void 0,void 0,function*(){this.log.debug("received server offer",Object.assign(Object.assign({},this.logContext),{RTCSdpType:e.type,sdp:e.sdp,signalingState:this.subscriber.getSignallingState().toString()}));const t=yield this.remoteOfferLock.lock();try{return yield this.subscriber.setRemoteDescription(e),yield this.subscriber.createAndSetAnswer()}finally{t()}})}updateConfiguration(e,t){this.publisher.setConfiguration(e),this.subscriber.setConfiguration(e),t&&this.triggerIceRestart()}ensurePCTransportConnection(e,t){return S(this,void 0,void 0,function*(){var r;const i=yield this.connectionLock.lock();try{this.isPublisherConnectionRequired&&this.publisher.getConnectionState()!=="connected"&&this.publisher.getConnectionState()!=="connecting"&&(this.log.debug("negotiation required, start negotiating",this.logContext),this.publisher.negotiate()),yield Promise.all((r=this.requiredTransports)===null||r===void 0?void 0:r.map(A=>this.ensureTransportConnected(A,e,t)))}finally{i()}})}negotiate(e){return S(this,void 0,void 0,function*(){return new Promise((t,r)=>S(this,void 0,void 0,function*(){const i=setTimeout(()=>{r("negotiation timed out")},this.peerConnectionTimeout),A=()=>{clearTimeout(i),r("negotiation aborted")};e.signal.addEventListener("abort",A),this.publisher.once(Pi.NegotiationStarted,()=>{e.signal.aborted||this.publisher.once(Pi.NegotiationComplete,()=>{clearTimeout(i),t()})}),yield this.publisher.negotiate(s=>{clearTimeout(i),r(s)})}))})}addPublisherTransceiver(e,t){return this.publisher.addTransceiver(e,t)}addPublisherTrack(e){return this.publisher.addTrack(e)}createPublisherDataChannel(e,t){return this.publisher.createDataChannel(e,t)}getConnectedAddress(e){return e===on.PUBLISHER?this.publisher.getConnectedAddress():e===on.SUBSCRIBER?this.publisher.getConnectedAddress():this.requiredTransports[0].getConnectedAddress()}get requiredTransports(){const e=[];return this.isPublisherConnectionRequired&&e.push(this.publisher),this.isSubscriberConnectionRequired&&e.push(this.subscriber),e}ensureTransportConnected(e,t){return S(this,arguments,void 0,function(r,i){var A=this;let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.peerConnectionTimeout;return function*(){if(r.getConnectionState()!=="connected")return new Promise((a,c)=>S(A,void 0,void 0,function*(){const u=()=>{this.log.warn("abort transport connection",this.logContext),yt.clearTimeout(l),c(new Ie("room connection has been cancelled",le.Cancelled))};i!=null&&i.signal.aborted&&u(),i==null||i.signal.addEventListener("abort",u);const l=yt.setTimeout(()=>{i==null||i.signal.removeEventListener("abort",u),c(new Ie("could not establish pc connection",le.InternalError))},s);for(;this.state!==ze.CONNECTED;)if(yield Dt(50),i!=null&&i.signal.aborted){c(new Ie("room connection has been cancelled",le.Cancelled));return}yt.clearTimeout(l),i==null||i.signal.removeEventListener("abort",u),a()}))}()})}}class Xe extends Error{constructor(e,t,r){super(t),this.code=e,this.message=f0(t,Xe.MAX_MESSAGE_BYTES),this.data=r?f0(r,Xe.MAX_DATA_BYTES):void 0}static fromProto(e){return new Xe(e.code,e.message,e.data)}toProto(){return new Im({code:this.code,message:this.message,data:this.data})}static builtIn(e,t){return new Xe(Xe.ErrorCode[e],Xe.ErrorMessage[e],t)}}Xe.MAX_MESSAGE_BYTES=256,Xe.MAX_DATA_BYTES=15360,Xe.ErrorCode={APPLICATION_ERROR:1500,CONNECTION_TIMEOUT:1501,RESPONSE_TIMEOUT:1502,RECIPIENT_DISCONNECTED:1503,RESPONSE_PAYLOAD_TOO_LARGE:1504,SEND_FAILED:1505,UNSUPPORTED_METHOD:1400,RECIPIENT_NOT_FOUND:1401,REQUEST_PAYLOAD_TOO_LARGE:1402,UNSUPPORTED_SERVER:1403,UNSUPPORTED_VERSION:1404},Xe.ErrorMessage={APPLICATION_ERROR:"Application error in method handler",CONNECTION_TIMEOUT:"Connection timeout",RESPONSE_TIMEOUT:"Response timeout",RECIPIENT_DISCONNECTED:"Recipient disconnected",RESPONSE_PAYLOAD_TOO_LARGE:"Response payload too large",SEND_FAILED:"Failed to send",UNSUPPORTED_METHOD:"Method not supported at destination",RECIPIENT_NOT_FOUND:"Recipient not found",REQUEST_PAYLOAD_TOO_LARGE:"Request payload too large",UNSUPPORTED_SERVER:"RPC not supported by server",UNSUPPORTED_VERSION:"Unsupported RPC version"};const p0=15360;function Jl(n){return new TextEncoder().encode(n).length}function f0(n,e){if(Jl(n)<=e)return n;let t=0,r=n.length;const i=new TextEncoder;for(;t<r;){const A=Math.floor((t+r+1)/2);i.encode(n.slice(0,A)).length<=e?t=A:r=A-1}return n.slice(0,t)}const zl=2e3;function ia(n,e){if(!e)return 0;let t,r;return"bytesReceived"in n?(t=n.bytesReceived,r=e.bytesReceived):"bytesSent"in n&&(t=n.bytesSent,r=e.bytesSent),t===void 0||r===void 0||n.timestamp===void 0||e.timestamp===void 0?0:(t-r)*8*1e3/(n.timestamp-e.timestamp)}const ix=1e3;class g0 extends P{get sender(){return this._sender}set sender(e){this._sender=e}get constraints(){return this._constraints}constructor(e,t,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,A=arguments.length>4?arguments[4]:void 0;super(e,t,A),this.manuallyStopped=!1,this._isUpstreamPaused=!1,this.handleTrackMuteEvent=()=>this.debouncedTrackMuteHandler().catch(()=>this.log.debug("track mute bounce got cancelled by an unmute event",this.logContext)),this.debouncedTrackMuteHandler=jl(()=>S(this,void 0,void 0,function*(){yield this.pauseUpstream()}),5e3),this.handleTrackUnmuteEvent=()=>S(this,void 0,void 0,function*(){this.debouncedTrackMuteHandler.cancel("unmute"),yield this.resumeUpstream()}),this.handleEnded=()=>{this.isInBackground&&(this.reacquireTrack=!0),this._mediaStreamTrack.removeEventListener("mute",this.handleTrackMuteEvent),this._mediaStreamTrack.removeEventListener("unmute",this.handleTrackUnmuteEvent),this.emit(M.Ended,this)},this.reacquireTrack=!1,this.providedByUser=i,this.muteLock=new Ot,this.pauseUpstreamLock=new Ot,this.processorLock=new Ot,this.restartLock=new Ot,this.setMediaStreamTrack(e,!0),this._constraints=e.getConstraints(),r&&(this._constraints=r)}get id(){return this._mediaStreamTrack.id}get dimensions(){if(this.kind!==P.Kind.Video)return;const{width:e,height:t}=this._mediaStreamTrack.getSettings();if(e&&t)return{width:e,height:t}}get isUpstreamPaused(){return this._isUpstreamPaused}get isUserProvided(){return this.providedByUser}get mediaStreamTrack(){var e,t;return(t=(e=this.processor)===null||e===void 0?void 0:e.processedTrack)!==null&&t!==void 0?t:this._mediaStreamTrack}get isLocal(){return!0}getSourceTrackSettings(){return this._mediaStreamTrack.getSettings()}setMediaStreamTrack(e,t){return S(this,void 0,void 0,function*(){var r;if(e===this._mediaStreamTrack&&!t)return;this._mediaStreamTrack&&(this.attachedElements.forEach(A=>{Fi(this._mediaStreamTrack,A)}),this.debouncedTrackMuteHandler.cancel("new-track"),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.removeEventListener("mute",this.handleTrackMuteEvent),this._mediaStreamTrack.removeEventListener("unmute",this.handleTrackUnmuteEvent)),this.mediaStream=new MediaStream([e]),e&&(e.addEventListener("ended",this.handleEnded),e.addEventListener("mute",this.handleTrackMuteEvent),e.addEventListener("unmute",this.handleTrackUnmuteEvent),this._constraints=e.getConstraints());let i;if(this.processor&&e){const A=yield this.processorLock.lock();try{if(this.log.debug("restarting processor",this.logContext),this.kind==="unknown")throw TypeError("cannot set processor on track of unknown kind");this.processorElement&&(Ii(e,this.processorElement),this.processorElement.muted=!0),yield this.processor.restart({track:e,kind:this.kind,element:this.processorElement}),i=this.processor.processedTrack}finally{A()}}this.sender&&((r=this.sender.transport)===null||r===void 0?void 0:r.state)!=="closed"&&(yield this.sender.replaceTrack(i??e)),!this.providedByUser&&this._mediaStreamTrack!==e&&this._mediaStreamTrack.stop(),this._mediaStreamTrack=e,e&&(this._mediaStreamTrack.enabled=!this.isMuted,yield this.resumeUpstream(),this.attachedElements.forEach(A=>{Ii(i??e,A)}))})}waitForDimensions(){return S(this,arguments,void 0,function(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ix;return function*(){var r;if(e.kind===P.Kind.Audio)throw new Error("cannot get dimensions for audio tracks");((r=cn())===null||r===void 0?void 0:r.os)==="iOS"&&(yield Dt(10));const i=Date.now();for(;Date.now()-i<t;){const A=e.dimensions;if(A)return A;yield Dt(50)}throw new Ln("unable to get track dimensions after timeout")}()})}setDeviceId(e){return S(this,void 0,void 0,function*(){return this._constraints.deviceId===e&&this._mediaStreamTrack.getSettings().deviceId===pr(e)||(this._constraints.deviceId=e,this.isMuted)?!0:(yield this.restartTrack(),pr(e)===this._mediaStreamTrack.getSettings().deviceId)})}getDeviceId(){return S(this,arguments,void 0,function(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return function*(){if(e.source===P.Source.ScreenShare)return;const{deviceId:r,groupId:i}=e._mediaStreamTrack.getSettings(),A=e.kind===P.Kind.Audio?"audioinput":"videoinput";return t?pt.getInstance().normalizeDeviceId(A,r,i):r}()})}mute(){return S(this,void 0,void 0,function*(){return this.setTrackMuted(!0),this})}unmute(){return S(this,void 0,void 0,function*(){return this.setTrackMuted(!1),this})}replaceTrack(e,t){return S(this,void 0,void 0,function*(){if(!this.sender)throw new Ln("unable to replace an unpublished track");let r,i;return typeof t=="boolean"?r=t:t!==void 0&&(r=t.userProvidedTrack,i=t.stopProcessor),this.providedByUser=r??!0,this.log.debug("replace MediaStreamTrack",this.logContext),yield this.setMediaStreamTrack(e),i&&this.processor&&(yield this.stopProcessor()),this})}restart(e){return S(this,void 0,void 0,function*(){this.manuallyStopped=!1;const t=yield this.restartLock.lock();try{e||(e=this._constraints);const{deviceId:r,facingMode:i}=e,A=qI(e,["deviceId","facingMode"]);this.log.debug("restarting track with constraints",Object.assign(Object.assign({},this.logContext),{constraints:e}));const s={audio:!1,video:!1};this.kind===P.Kind.Video?s.video=r||i?{deviceId:r,facingMode:i}:!0:s.audio=r?{deviceId:r}:!0,this.attachedElements.forEach(c=>{Fi(this.mediaStreamTrack,c)}),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.stop();const a=(yield navigator.mediaDevices.getUserMedia(s)).getTracks()[0];return yield a.applyConstraints(A),a.addEventListener("ended",this.handleEnded),this.log.debug("re-acquired MediaStreamTrack",this.logContext),yield this.setMediaStreamTrack(a),this._constraints=e,this.emit(M.Restarted,this),this.manuallyStopped&&(this.log.warn("track was stopped during a restart, stopping restarted track",this.logContext),this.stop()),this}finally{t()}})}setTrackMuted(e){this.log.debug("setting ".concat(this.kind," track ").concat(e?"muted":"unmuted"),this.logContext),!(this.isMuted===e&&this._mediaStreamTrack.enabled!==e)&&(this.isMuted=e,this._mediaStreamTrack.enabled=!e,this.emit(e?M.Muted:M.Unmuted,this))}get needsReAcquisition(){return this._mediaStreamTrack.readyState!=="live"||this._mediaStreamTrack.muted||!this._mediaStreamTrack.enabled||this.reacquireTrack}handleAppVisibilityChanged(){const e=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return S(this,void 0,void 0,function*(){yield e.handleAppVisibilityChanged.call(this),Gv()&&(this.log.debug("visibility changed, is in Background: ".concat(this.isInBackground),this.logContext),!this.isInBackground&&this.needsReAcquisition&&!this.isUserProvided&&!this.isMuted&&(this.log.debug("track needs to be reacquired, restarting ".concat(this.source),this.logContext),yield this.restart(),this.reacquireTrack=!1))})}stop(){var e;this.manuallyStopped=!0,super.stop(),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.removeEventListener("mute",this.handleTrackMuteEvent),this._mediaStreamTrack.removeEventListener("unmute",this.handleTrackUnmuteEvent),(e=this.processor)===null||e===void 0||e.destroy(),this.processor=void 0}pauseUpstream(){return S(this,void 0,void 0,function*(){var e;const t=yield this.pauseUpstreamLock.lock();try{if(this._isUpstreamPaused===!0)return;if(!this.sender){this.log.warn("unable to pause upstream for an unpublished track",this.logContext);return}this._isUpstreamPaused=!0,this.emit(M.UpstreamPaused,this);const r=cn();if((r==null?void 0:r.name)==="Safari"&&jr(r.version,"12.0")<0)throw new vl("pauseUpstream is not supported on Safari < 12.");((e=this.sender.transport)===null||e===void 0?void 0:e.state)!=="closed"&&(yield this.sender.replaceTrack(null))}finally{t()}})}resumeUpstream(){return S(this,void 0,void 0,function*(){var e;const t=yield this.pauseUpstreamLock.lock();try{if(this._isUpstreamPaused===!1)return;if(!this.sender){this.log.warn("unable to resume upstream for an unpublished track",this.logContext);return}this._isUpstreamPaused=!1,this.emit(M.UpstreamResumed,this),((e=this.sender.transport)===null||e===void 0?void 0:e.state)!=="closed"&&(yield this.sender.replaceTrack(this.mediaStreamTrack))}finally{t()}})}getRTCStatsReport(){return S(this,void 0,void 0,function*(){var e;return!((e=this.sender)===null||e===void 0)&&e.getStats?yield this.sender.getStats():void 0})}setProcessor(e){return S(this,arguments,void 0,function(t){var r=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return function*(){var A;const s=yield r.processorLock.lock();try{r.log.debug("setting up processor",r.logContext);const o=document.createElement(r.kind),a={kind:r.kind,track:r._mediaStreamTrack,element:o,audioContext:r.audioContext};if(yield t.init(a),r.log.debug("processor initialized",r.logContext),r.processor&&(yield r.stopProcessor()),r.kind==="unknown")throw TypeError("cannot set processor on track of unknown kind");if(Ii(r._mediaStreamTrack,o),o.muted=!0,o.play().catch(c=>r.log.error("failed to play processor element",Object.assign(Object.assign({},r.logContext),{error:c}))),r.processor=t,r.processorElement=o,r.processor.processedTrack){for(const c of r.attachedElements)c!==r.processorElement&&i&&(Fi(r._mediaStreamTrack,c),Ii(r.processor.processedTrack,c));yield(A=r.sender)===null||A===void 0?void 0:A.replaceTrack(r.processor.processedTrack)}r.emit(M.TrackProcessorUpdate,r.processor)}finally{s()}}()})}getProcessor(){return this.processor}stopProcessor(){return S(this,arguments,void 0,function(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return function*(){var r,i;e.processor&&(e.log.debug("stopping processor",e.logContext),(r=e.processor.processedTrack)===null||r===void 0||r.stop(),yield e.processor.destroy(),e.processor=void 0,t||((i=e.processorElement)===null||i===void 0||i.remove(),e.processorElement=void 0),yield e._mediaStreamTrack.applyConstraints(e._constraints),yield e.setMediaStreamTrack(e._mediaStreamTrack,!0),e.emit(M.TrackProcessorUpdate))}()})}}class Aa extends g0{get enhancedNoiseCancellation(){return this.isKrispNoiseFilterEnabled}constructor(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3?arguments[3]:void 0,A=arguments.length>4?arguments[4]:void 0;super(e,P.Kind.Audio,t,r,A),this.stopOnMute=!1,this.isKrispNoiseFilterEnabled=!1,this.monitorSender=()=>S(this,void 0,void 0,function*(){if(!this.sender){this._currentBitrate=0;return}let s;try{s=yield this.getSenderStats()}catch(o){this.log.error("could not get audio sender stats",Object.assign(Object.assign({},this.logContext),{error:o}));return}s&&this.prevStats&&(this._currentBitrate=ia(s,this.prevStats)),this.prevStats=s}),this.handleKrispNoiseFilterEnable=()=>{this.isKrispNoiseFilterEnabled=!0,this.log.debug("Krisp noise filter enabled",this.logContext),this.emit(M.AudioTrackFeatureUpdate,this,sn.TF_ENHANCED_NOISE_CANCELLATION,!0)},this.handleKrispNoiseFilterDisable=()=>{this.isKrispNoiseFilterEnabled=!1,this.log.debug("Krisp noise filter disabled",this.logContext),this.emit(M.AudioTrackFeatureUpdate,this,sn.TF_ENHANCED_NOISE_CANCELLATION,!1)},this.audioContext=i,this.checkForSilence()}mute(){const e=Object.create(null,{mute:{get:()=>super.mute}});return S(this,void 0,void 0,function*(){const t=yield this.muteLock.lock();try{return this.isMuted?(this.log.debug("Track already muted",this.logContext),this):(this.source===P.Source.Microphone&&this.stopOnMute&&!this.isUserProvided&&(this.log.debug("stopping mic track",this.logContext),this._mediaStreamTrack.stop()),yield e.mute.call(this),this)}finally{t()}})}unmute(){const e=Object.create(null,{unmute:{get:()=>super.unmute}});return S(this,void 0,void 0,function*(){const t=yield this.muteLock.lock();try{if(!this.isMuted)return this.log.debug("Track already unmuted",this.logContext),this;const r=this._constraints.deviceId&&this._mediaStreamTrack.getSettings().deviceId!==pr(this._constraints.deviceId);return this.source===P.Source.Microphone&&(this.stopOnMute||this._mediaStreamTrack.readyState==="ended"||r)&&!this.isUserProvided&&(this.log.debug("reacquiring mic track",this.logContext),yield this.restartTrack()),yield e.unmute.call(this),this}finally{t()}})}restartTrack(e){return S(this,void 0,void 0,function*(){let t;if(e){const r=Ll({audio:e});typeof r.audio!="boolean"&&(t=r.audio)}yield this.restart(t)})}restart(e){const t=Object.create(null,{restart:{get:()=>super.restart}});return S(this,void 0,void 0,function*(){const r=yield t.restart.call(this,e);return this.checkForSilence(),r})}startMonitor(){Ht()&&(this.monitorInterval||(this.monitorInterval=setInterval(()=>{this.monitorSender()},zl)))}setProcessor(e){return S(this,void 0,void 0,function*(){var t;const r=yield this.processorLock.lock();try{if(!Sn()&&!this.audioContext)throw Error("Audio context needs to be set on LocalAudioTrack in order to enable processors");this.processor&&(yield this.stopProcessor());const i={kind:this.kind,track:this._mediaStreamTrack,audioContext:this.audioContext};this.log.debug("setting up audio processor ".concat(e.name),this.logContext),yield e.init(i),this.processor=e,this.processor.processedTrack&&(yield(t=this.sender)===null||t===void 0?void 0:t.replaceTrack(this.processor.processedTrack),this.processor.processedTrack.addEventListener("enable-lk-krisp-noise-filter",this.handleKrispNoiseFilterEnable),this.processor.processedTrack.addEventListener("disable-lk-krisp-noise-filter",this.handleKrispNoiseFilterDisable)),this.emit(M.TrackProcessorUpdate,this.processor)}finally{r()}})}setAudioContext(e){this.audioContext=e}getSenderStats(){return S(this,void 0,void 0,function*(){var e;if(!(!((e=this.sender)===null||e===void 0)&&e.getStats))return;const t=yield this.sender.getStats();let r;return t.forEach(i=>{i.type==="outbound-rtp"&&(r={type:"audio",streamId:i.id,packetsSent:i.packetsSent,packetsLost:i.packetsLost,bytesSent:i.bytesSent,timestamp:i.timestamp,roundTripTime:i.roundTripTime,jitter:i.jitter})}),r})}checkForSilence(){return S(this,void 0,void 0,function*(){const e=yield $v(this);return e&&(this.isMuted||this.log.warn("silence detected on local audio track",this.logContext),this.emit(M.AudioSilenceDetected)),e})}}function Ax(n,e,t){switch(n.kind){case"audio":return new Aa(n,e,!1,void 0,t);case"video":return new oa(n,e,!1,t);default:throw new Ln("unsupported track type: ".concat(n.kind))}}const sx=Object.values(LA),ox=Object.values(_l),ax=Object.values(Sl),cx=[LA.h180,LA.h360],ux=[_l.h180,_l.h360],lx=n=>[{scaleResolutionDownBy:2,fps:n.encoding.maxFramerate}].map(t=>{var r,i;return new Ue(Math.floor(n.width/t.scaleResolutionDownBy),Math.floor(n.height/t.scaleResolutionDownBy),Math.max(15e4,Math.floor(n.encoding.maxBitrate/(Math.pow(t.scaleResolutionDownBy,2)*(((r=n.encoding.maxFramerate)!==null&&r!==void 0?r:30)/((i=t.fps)!==null&&i!==void 0?i:30))))),t.fps,n.encoding.priority)}),Xl=["q","h","f"];function Yl(n,e,t,r){var i,A;let s=r==null?void 0:r.videoEncoding;n&&(s=r==null?void 0:r.screenShareEncoding);const o=r==null?void 0:r.simulcast,a=r==null?void 0:r.scalabilityMode,c=r==null?void 0:r.videoCodec;if(!s&&!o&&!a||!e||!t)return[{}];s||(s=hx(n,e,t,c),ce.debug("using video encoding",s));const u=s.maxFramerate,l=new Ue(e,t,s.maxBitrate,s.maxFramerate,s.priority);if(a&&DA(c)){const f=new sa(a),p=[];if(f.spatial>3)throw new Error("unsupported scalabilityMode: ".concat(a));const g=cn();if(hr()||Sn()||(g==null?void 0:g.name)==="Chrome"&&jr(g==null?void 0:g.version,"113")<0){const v=f.suffix=="h"?2:3;for(let y=0;y<f.spatial;y+=1)p.push({rid:Xl[2-y],maxBitrate:s.maxBitrate/Math.pow(v,y),maxFramerate:l.encoding.maxFramerate});p[0].scalabilityMode=a}else p.push({maxBitrate:s.maxBitrate,maxFramerate:l.encoding.maxFramerate,scalabilityMode:a});return l.encoding.priority&&(p[0].priority=l.encoding.priority,p[0].networkPriority=l.encoding.priority),ce.debug("using svc encoding",{encodings:p}),p}if(!o)return[s];let d=[];n?d=(i=v0(r==null?void 0:r.screenShareSimulcastLayers))!==null&&i!==void 0?i:m0(n,l):d=(A=v0(r==null?void 0:r.videoSimulcastLayers))!==null&&A!==void 0?A:m0(n,l);let h;if(d.length>0){const f=d[0];d.length>1&&([,h]=d);const p=Math.max(e,t);if(p>=960&&h)return Zl(e,t,[f,h,l],u);if(p>=480)return Zl(e,t,[f,l],u)}return Zl(e,t,[l])}function dx(n,e,t){var r,i,A,s;if(!t.backupCodec||t.backupCodec===!0||t.backupCodec.codec===t.videoCodec)return;e!==t.backupCodec.codec&&ce.warn("requested a different codec than specified as backup",{serverRequested:e,backup:t.backupCodec.codec}),t.videoCodec=e,t.videoEncoding=t.backupCodec.encoding;const o=n.mediaStreamTrack.getSettings(),a=(r=o.width)!==null&&r!==void 0?r:(i=n.dimensions)===null||i===void 0?void 0:i.width,c=(A=o.height)!==null&&A!==void 0?A:(s=n.dimensions)===null||s===void 0?void 0:s.height;return n.source===P.Source.ScreenShare&&t.simulcast&&(t.simulcast=!1),Yl(n.source===P.Source.ScreenShare,a,c,t)}function hx(n,e,t,r){const i=px(n,e,t);let{encoding:A}=i[0];const s=Math.max(e,t);for(let o=0;o<i.length;o+=1){const a=i[o];if(A=a.encoding,a.width>=s)break}if(r)switch(r){case"av1":A=Object.assign({},A),A.maxBitrate=A.maxBitrate*.7;break;case"vp9":A=Object.assign({},A),A.maxBitrate=A.maxBitrate*.85;break}return A}function px(n,e,t){if(n)return ax;const r=e>t?e/t:t/e;return Math.abs(r-16/9)<Math.abs(r-4/3)?sx:ox}function m0(n,e){if(n)return lx(e);const{width:t,height:r}=e,i=t>r?t/r:r/t;return Math.abs(i-16/9)<Math.abs(i-4/3)?cx:ux}function Zl(n,e,t,r){const i=[];if(t.forEach((A,s)=>{if(s>=Xl.length)return;const o=Math.min(n,e),c={rid:Xl[s],scaleResolutionDownBy:Math.max(1,o/Math.min(A.width,A.height)),maxBitrate:A.encoding.maxBitrate},u=r&&A.encoding.maxFramerate?Math.min(r,A.encoding.maxFramerate):A.encoding.maxFramerate;u&&(c.maxFramerate=u);const l=xi()||s===0;A.encoding.priority&&l&&(c.priority=A.encoding.priority,c.networkPriority=A.encoding.priority),i.push(c)}),Sn()&&Wv()==="ios"){let A;i.forEach(o=>{A?o.maxFramerate&&o.maxFramerate>A&&(A=o.maxFramerate):A=o.maxFramerate});let s=!0;i.forEach(o=>{var a;o.maxFramerate!=A&&(s&&(s=!1,ce.info("Simulcast on iOS React-Native requires all encodings to share the same framerate.")),ce.info('Setting framerate of encoding "'.concat((a=o.rid)!==null&&a!==void 0?a:"",'" to ').concat(A)),o.maxFramerate=A)})}return i}function v0(n){if(n)return n.sort((e,t)=>{const{encoding:r}=e,{encoding:i}=t;return r.maxBitrate>i.maxBitrate?1:r.maxBitrate<i.maxBitrate?-1:r.maxBitrate===i.maxBitrate&&r.maxFramerate&&i.maxFramerate?r.maxFramerate>i.maxFramerate?1:-1:0})}class sa{constructor(e){const t=e.match(/^L(\d)T(\d)(h|_KEY|_KEY_SHIFT){0,1}$/);if(!t)throw new Error("invalid scalability mode");if(this.spatial=parseInt(t[1]),this.temporal=parseInt(t[2]),t.length>3)switch(t[3]){case"h":case"_KEY":case"_KEY_SHIFT":this.suffix=t[3]}}toString(){var e;return"L".concat(this.spatial,"T").concat(this.temporal).concat((e=this.suffix)!==null&&e!==void 0?e:"")}}function fx(n){return n.source===P.Source.ScreenShare||n.constraints.height&&pr(n.constraints.height)>=1080?"maintain-resolution":"balanced"}const gx=5e3;class oa extends g0{get sender(){return this._sender}set sender(e){this._sender=e,this.degradationPreference&&this.setDegradationPreference(this.degradationPreference)}constructor(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3?arguments[3]:void 0;super(e,P.Kind.Video,t,r,i),this.simulcastCodecs=new Map,this.degradationPreference="balanced",this.monitorSender=()=>S(this,void 0,void 0,function*(){if(!this.sender){this._currentBitrate=0;return}let A;try{A=yield this.getSenderStats()}catch(o){this.log.error("could not get audio sender stats",Object.assign(Object.assign({},this.logContext),{error:o}));return}const s=new Map(A.map(o=>[o.rid,o]));if(this.prevStats){let o=0;s.forEach((a,c)=>{var u;const l=(u=this.prevStats)===null||u===void 0?void 0:u.get(c);o+=ia(a,l)}),this._currentBitrate=o}this.prevStats=s}),this.senderLock=new Ot}get isSimulcast(){return!!(this.sender&&this.sender.getParameters().encodings.length>1)}startMonitor(e){var t;if(this.signalClient=e,!Ht())return;const r=(t=this.sender)===null||t===void 0?void 0:t.getParameters();r&&(this.encodings=r.encodings),!this.monitorInterval&&(this.monitorInterval=setInterval(()=>{this.monitorSender()},zl))}stop(){this._mediaStreamTrack.getConstraints(),this.simulcastCodecs.forEach(e=>{e.mediaStreamTrack.stop()}),super.stop()}pauseUpstream(){const e=Object.create(null,{pauseUpstream:{get:()=>super.pauseUpstream}});return S(this,void 0,void 0,function*(){var t,r,i,A,s;yield e.pauseUpstream.call(this);try{for(var o=!0,a=cr(this.simulcastCodecs.values()),c;c=yield a.next(),t=c.done,!t;o=!0)A=c.value,o=!1,yield(s=A.sender)===null||s===void 0?void 0:s.replaceTrack(null)}catch(u){r={error:u}}finally{try{!o&&!t&&(i=a.return)&&(yield i.call(a))}finally{if(r)throw r.error}}})}resumeUpstream(){const e=Object.create(null,{resumeUpstream:{get:()=>super.resumeUpstream}});return S(this,void 0,void 0,function*(){var t,r,i,A,s;yield e.resumeUpstream.call(this);try{for(var o=!0,a=cr(this.simulcastCodecs.values()),c;c=yield a.next(),t=c.done,!t;o=!0){A=c.value,o=!1;const u=A;yield(s=u.sender)===null||s===void 0?void 0:s.replaceTrack(u.mediaStreamTrack)}}catch(u){r={error:u}}finally{try{!o&&!t&&(i=a.return)&&(yield i.call(a))}finally{if(r)throw r.error}}})}mute(){const e=Object.create(null,{mute:{get:()=>super.mute}});return S(this,void 0,void 0,function*(){const t=yield this.muteLock.lock();try{return this.isMuted?(this.log.debug("Track already muted",this.logContext),this):(this.source===P.Source.Camera&&!this.isUserProvided&&(this.log.debug("stopping camera track",this.logContext),this._mediaStreamTrack.stop()),yield e.mute.call(this),this)}finally{t()}})}unmute(){const e=Object.create(null,{unmute:{get:()=>super.unmute}});return S(this,void 0,void 0,function*(){const t=yield this.muteLock.lock();try{return this.isMuted?(this.source===P.Source.Camera&&!this.isUserProvided&&(this.log.debug("reacquiring camera track",this.logContext),yield this.restartTrack()),yield e.unmute.call(this),this):(this.log.debug("Track already unmuted",this.logContext),this)}finally{t()}})}setTrackMuted(e){super.setTrackMuted(e);for(const t of this.simulcastCodecs.values())t.mediaStreamTrack.enabled=!e}getSenderStats(){return S(this,void 0,void 0,function*(){var e;if(!(!((e=this.sender)===null||e===void 0)&&e.getStats))return[];const t=[],r=yield this.sender.getStats();return r.forEach(i=>{var A;if(i.type==="outbound-rtp"){const s={type:"video",streamId:i.id,frameHeight:i.frameHeight,frameWidth:i.frameWidth,framesPerSecond:i.framesPerSecond,framesSent:i.framesSent,firCount:i.firCount,pliCount:i.pliCount,nackCount:i.nackCount,packetsSent:i.packetsSent,bytesSent:i.bytesSent,qualityLimitationReason:i.qualityLimitationReason,qualityLimitationDurations:i.qualityLimitationDurations,qualityLimitationResolutionChanges:i.qualityLimitationResolutionChanges,rid:(A=i.rid)!==null&&A!==void 0?A:i.id,retransmittedPacketsSent:i.retransmittedPacketsSent,targetBitrate:i.targetBitrate,timestamp:i.timestamp},o=r.get(i.remoteId);o&&(s.jitter=o.jitter,s.packetsLost=o.packetsLost,s.roundTripTime=o.roundTripTime),t.push(s)}}),t.sort((i,A)=>{var s,o;return((s=A.frameWidth)!==null&&s!==void 0?s:0)-((o=i.frameWidth)!==null&&o!==void 0?o:0)}),t})}setPublishingQuality(e){const t=[];for(let r=Xt.LOW;r<=Xt.HIGH;r+=1)t.push(new sl({quality:r,enabled:r<=e}));this.log.debug("setting publishing quality. max quality ".concat(e),this.logContext),this.setPublishingLayers(t)}restartTrack(e){return S(this,void 0,void 0,function*(){var t,r,i,A,s;let o;if(e){const l=Ll({video:e});typeof l.video!="boolean"&&(o=l.video)}yield this.restart(o);try{for(var a=!0,c=cr(this.simulcastCodecs.values()),u;u=yield c.next(),t=u.done,!t;a=!0){A=u.value,a=!1;const l=A;l.sender&&((s=l.sender.transport)===null||s===void 0?void 0:s.state)!=="closed"&&(l.mediaStreamTrack=this.mediaStreamTrack.clone(),yield l.sender.replaceTrack(l.mediaStreamTrack))}}catch(l){r={error:l}}finally{try{!a&&!t&&(i=c.return)&&(yield i.call(c))}finally{if(r)throw r.error}}})}setProcessor(e){const t=Object.create(null,{setProcessor:{get:()=>super.setProcessor}});return S(this,arguments,void 0,function(r){var i=this;let A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return function*(){var s,o,a,c,u,l;if(yield t.setProcessor.call(i,r,A),!((u=i.processor)===null||u===void 0)&&u.processedTrack)try{for(var d=!0,h=cr(i.simulcastCodecs.values()),f;f=yield h.next(),s=f.done,!s;d=!0)c=f.value,d=!1,yield(l=c.sender)===null||l===void 0?void 0:l.replaceTrack(i.processor.processedTrack)}catch(p){o={error:p}}finally{try{!d&&!s&&(a=h.return)&&(yield a.call(h))}finally{if(o)throw o.error}}}()})}setDegradationPreference(e){return S(this,void 0,void 0,function*(){if(this.degradationPreference=e,this.sender)try{this.log.debug("setting degradationPreference to ".concat(e),this.logContext);const t=this.sender.getParameters();t.degradationPreference=e,this.sender.setParameters(t)}catch(t){this.log.warn("failed to set degradationPreference",Object.assign({error:t},this.logContext))}})}addSimulcastTrack(e,t){if(this.simulcastCodecs.has(e)){this.log.error("".concat(e," already added, skipping adding simulcast codec"),this.logContext);return}const r={codec:e,mediaStreamTrack:this.mediaStreamTrack.clone(),sender:void 0,encodings:t};return this.simulcastCodecs.set(e,r),r}setSimulcastTrackSender(e,t){const r=this.simulcastCodecs.get(e);r&&(r.sender=t,setTimeout(()=>{this.subscribedCodecs&&this.setPublishingCodecs(this.subscribedCodecs)},gx))}setPublishingCodecs(e){return S(this,void 0,void 0,function*(){var t,r,i,A,s,o,a;if(this.log.debug("setting publishing codecs",Object.assign(Object.assign({},this.logContext),{codecs:e,currentCodec:this.codec})),!this.codec&&e.length>0)return yield this.setPublishingLayers(e[0].qualities),[];this.subscribedCodecs=e;const c=[];try{for(t=!0,r=cr(e);i=yield r.next(),A=i.done,!A;t=!0){a=i.value,t=!1;const u=a;if(!this.codec||this.codec===u.codec)yield this.setPublishingLayers(u.qualities);else{const l=this.simulcastCodecs.get(u.codec);if(this.log.debug("try setPublishingCodec for ".concat(u.codec),Object.assign(Object.assign({},this.logContext),{simulcastCodecInfo:l})),!l||!l.sender){for(const d of u.qualities)if(d.enabled){c.push(u.codec);break}}else l.encodings&&(this.log.debug("try setPublishingLayersForSender ".concat(u.codec),this.logContext),yield y0(l.sender,l.encodings,u.qualities,this.senderLock,this.log,this.logContext))}}}catch(u){s={error:u}}finally{try{!t&&!A&&(o=r.return)&&(yield o.call(r))}finally{if(s)throw s.error}}return c})}setPublishingLayers(e){return S(this,void 0,void 0,function*(){this.log.debug("setting publishing layers",Object.assign(Object.assign({},this.logContext),{qualities:e})),!(!this.sender||!this.encodings)&&(yield y0(this.sender,this.encodings,e,this.senderLock,this.log,this.logContext))})}handleAppVisibilityChanged(){const e=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return S(this,void 0,void 0,function*(){yield e.handleAppVisibilityChanged.call(this),Gv()&&this.isInBackground&&this.source===P.Source.Camera&&(this._mediaStreamTrack.enabled=!1)})}}function y0(n,e,t,r,i,A){return S(this,void 0,void 0,function*(){const s=yield r.lock();i.debug("setPublishingLayersForSender",Object.assign(Object.assign({},A),{sender:n,qualities:t,senderEncodings:e}));try{const o=n.getParameters(),{encodings:a}=o;if(!a)return;if(a.length!==e.length){i.warn("cannot set publishing layers, encodings mismatch",Object.assign(Object.assign({},A),{encodings:a,senderEncodings:e}));return}let c=!1;const u=cn();if((u==null?void 0:u.name)==="Chrome"&&jr(u==null?void 0:u.version,"133")>0&&a[0].scalabilityMode){const d=a[0],h=new sa(d.scalabilityMode);let f=_i.OFF;if(t.forEach(p=>{p.enabled&&(f===_i.OFF||p.quality>f)&&(f=p.quality)}),f===_i.OFF)d.active&&(d.active=!1,c=!0);else if(!d.active||h.spatial!==f+1){c=!0,d.active=!0;const p=new sa(e[0].scalabilityMode);h.spatial=f+1,h.suffix=p.suffix,h.spatial===1&&(h.suffix=void 0),d.scalabilityMode=h.toString(),d.scaleResolutionDownBy=Math.pow(2,2-f),e[0].maxBitrate&&(d.maxBitrate=e[0].maxBitrate/(d.scaleResolutionDownBy*d.scaleResolutionDownBy))}}else a.forEach((d,h)=>{var f;let p=(f=d.rid)!==null&&f!==void 0?f:"";p===""&&(p="q");const g=w0(p),v=t.find(y=>y.quality===g);v&&d.active!==v.enabled&&(c=!0,d.active=v.enabled,i.debug("setting layer ".concat(v.quality," to ").concat(d.active?"enabled":"disabled"),A),xi()&&(v.enabled?(d.scaleResolutionDownBy=e[h].scaleResolutionDownBy,d.maxBitrate=e[h].maxBitrate,d.maxFrameRate=e[h].maxFrameRate):(d.scaleResolutionDownBy=4,d.maxBitrate=10,d.maxFrameRate=2)))});c&&(o.encodings=a,i.debug("setting encodings",Object.assign(Object.assign({},A),{encodings:o.encodings})),yield n.setParameters(o))}finally{s()}})}function w0(n){switch(n){case"f":return Xt.HIGH;case"h":return Xt.MEDIUM;case"q":return Xt.LOW;default:return Xt.HIGH}}function b0(n,e,t,r){if(!t)return[new Kr({quality:Xt.HIGH,width:n,height:e,bitrate:0,ssrc:0})];if(r){const i=t[0].scalabilityMode,A=new sa(i),s=[],o=A.suffix=="h"?1.5:2,a=A.suffix=="h"?2:3;for(let c=0;c<A.spatial;c+=1)s.push(new Kr({quality:Math.min(Xt.HIGH,A.spatial-1)-c,width:Math.ceil(n/Math.pow(o,c)),height:Math.ceil(e/Math.pow(o,c)),bitrate:t[0].maxBitrate?Math.ceil(t[0].maxBitrate/Math.pow(a,c)):0,ssrc:0}));return s}return t.map(i=>{var A,s,o;const a=(A=i.scaleResolutionDownBy)!==null&&A!==void 0?A:1;let c=w0((s=i.rid)!==null&&s!==void 0?s:"");return new Kr({quality:c,width:Math.ceil(n/a),height:Math.ceil(e/a),bitrate:(o=i.maxBitrate)!==null&&o!==void 0?o:0,ssrc:0})})}const B0="_lossy",C0="_reliable",mx=2*1e3,$l="leave-reconnect";var ln;(function(n){n[n.New=0]="New",n[n.Connected=1]="Connected",n[n.Disconnected=2]="Disconnected",n[n.Reconnecting=3]="Reconnecting",n[n.Closed=4]="Closed"})(ln||(ln={}));class vx extends _n.EventEmitter{get isClosed(){return this._isClosed}get pendingReconnect(){return!!this.reconnectTimeout}constructor(e){var t;super(),this.options=e,this.rtcConfig={},this.peerConnectionTimeout=ql.peerConnectionTimeout,this.fullReconnectOnNext=!1,this.subscriberPrimary=!1,this.pcState=ln.New,this._isClosed=!0,this.pendingTrackResolvers={},this.reconnectAttempts=0,this.reconnectStart=0,this.attemptingReconnect=!1,this.joinAttempts=0,this.maxJoinAttempts=1,this.shouldFailNext=!1,this.log=ce,this.handleDataChannel=r=>S(this,[r],void 0,function(i){var A=this;let{channel:s}=i;return function*(){if(s){if(s.label===C0)A.reliableDCSub=s;else if(s.label===B0)A.lossyDCSub=s;else return;A.log.debug("on data channel ".concat(s.id,", ").concat(s.label),A.logContext),s.onmessage=A.handleDataMessage}}()}),this.handleDataMessage=r=>S(this,void 0,void 0,function*(){var i,A;const s=yield this.dataProcessLock.lock();try{let o;if(r.data instanceof ArrayBuffer)o=r.data;else if(r.data instanceof Blob)o=yield r.data.arrayBuffer();else{this.log.error("unsupported data type",Object.assign(Object.assign({},this.logContext),{data:r.data}));return}const a=Lt.fromBinary(new Uint8Array(o));((i=a.value)===null||i===void 0?void 0:i.case)==="speaker"?this.emit(L.ActiveSpeakersUpdate,a.value.value.speakers):(((A=a.value)===null||A===void 0?void 0:A.case)==="user"&&wx(a,a.value.value),this.emit(L.DataPacketReceived,a))}finally{s()}}),this.handleDataError=r=>{const A=r.currentTarget.maxRetransmits===0?"lossy":"reliable";if(r instanceof ErrorEvent&&r.error){const{error:s}=r.error;this.log.error("DataChannel error on ".concat(A,": ").concat(r.message),Object.assign(Object.assign({},this.logContext),{error:s}))}else this.log.error("Unknown DataChannel error on ".concat(A),Object.assign(Object.assign({},this.logContext),{event:r}))},this.handleBufferedAmountLow=r=>{const A=r.currentTarget.maxRetransmits===0?he.LOSSY:he.RELIABLE;this.updateAndEmitDCBufferStatus(A)},this.handleDisconnect=(r,i)=>{if(this._isClosed)return;this.log.warn("".concat(r," disconnected"),this.logContext),this.reconnectAttempts===0&&(this.reconnectStart=Date.now());const A=a=>{this.log.warn("could not recover connection after ".concat(this.reconnectAttempts," attempts, ").concat(a,"ms. giving up"),this.logContext),this.emit(L.Disconnected),this.close()},s=Date.now()-this.reconnectStart;let o=this.getNextRetryDelay({elapsedMs:s,retryCount:this.reconnectAttempts});if(o===null){A(s);return}r===$l&&(o=0),this.log.debug("reconnecting in ".concat(o,"ms"),this.logContext),this.clearReconnectTimeout(),this.token&&this.regionUrlProvider&&this.regionUrlProvider.updateToken(this.token),this.reconnectTimeout=yt.setTimeout(()=>this.attemptReconnect(i).finally(()=>this.reconnectTimeout=void 0),o)},this.waitForRestarted=()=>new Promise((r,i)=>{this.pcState===ln.Connected&&r();const A=()=>{this.off(L.Disconnected,s),r()},s=()=>{this.off(L.Restarted,A),i()};this.once(L.Restarted,A),this.once(L.Disconnected,s)}),this.updateAndEmitDCBufferStatus=r=>{const i=this.isBufferStatusLow(r);typeof i<"u"&&i!==this.dcBufferStatus.get(r)&&(this.dcBufferStatus.set(r,i),this.emit(L.DCBufferStatusChanged,i,r))},this.isBufferStatusLow=r=>{const i=this.dataChannelForKind(r);if(i)return i.bufferedAmount<=i.bufferedAmountLowThreshold},this.handleBrowserOnLine=()=>{this.client.currentState===Pe.RECONNECTING&&(this.clearReconnectTimeout(),this.attemptReconnect(Si.RR_SIGNAL_DISCONNECTED))},this.log=Mn((t=e.loggerName)!==null&&t!==void 0?t:an.Engine),this.loggerOptions={loggerName:e.loggerName,loggerContextCb:()=>this.logContext},this.client=new Hl(void 0,this.loggerOptions),this.client.signalLatency=this.options.expSignalLatency,this.reconnectPolicy=this.options.reconnectPolicy,this.registerOnLineListener(),this.closingLock=new Ot,this.dataProcessLock=new Ot,this.dcBufferStatus=new Map([[he.LOSSY,!0],[he.RELIABLE,!0]]),this.client.onParticipantUpdate=r=>this.emit(L.ParticipantUpdate,r),this.client.onConnectionQuality=r=>this.emit(L.ConnectionQualityUpdate,r),this.client.onRoomUpdate=r=>this.emit(L.RoomUpdate,r),this.client.onSubscriptionError=r=>this.emit(L.SubscriptionError,r),this.client.onSubscriptionPermissionUpdate=r=>this.emit(L.SubscriptionPermissionUpdate,r),this.client.onSpeakersChanged=r=>this.emit(L.SpeakersChanged,r),this.client.onStreamStateUpdate=r=>this.emit(L.StreamStateChanged,r),this.client.onRequestResponse=r=>this.emit(L.SignalRequestResponse,r)}get logContext(){var e,t,r,i,A,s,o,a;return{room:(t=(e=this.latestJoinResponse)===null||e===void 0?void 0:e.room)===null||t===void 0?void 0:t.name,roomID:(i=(r=this.latestJoinResponse)===null||r===void 0?void 0:r.room)===null||i===void 0?void 0:i.sid,participant:(s=(A=this.latestJoinResponse)===null||A===void 0?void 0:A.participant)===null||s===void 0?void 0:s.identity,pID:(a=(o=this.latestJoinResponse)===null||o===void 0?void 0:o.participant)===null||a===void 0?void 0:a.sid}}join(e,t,r,i){return S(this,void 0,void 0,function*(){this.url=e,this.token=t,this.signalOpts=r,this.maxJoinAttempts=r.maxRetries;try{this.joinAttempts+=1,this.setupSignalClientCallbacks();const A=yield this.client.join(e,t,r,i);return this._isClosed=!1,this.latestJoinResponse=A,this.subscriberPrimary=A.subscriberPrimary,this.pcManager||(yield this.configure(A)),(!this.subscriberPrimary||A.fastPublish)&&this.negotiate(),this.clientConfiguration=A.clientConfiguration,setTimeout(()=>{this.emit(L.SignalConnected)},10),A}catch(A){if(A instanceof Ie&&A.reason===le.ServerUnreachable&&(this.log.warn("Couldn't connect to server, attempt ".concat(this.joinAttempts," of ").concat(this.maxJoinAttempts),this.logContext),this.joinAttempts<this.maxJoinAttempts))return this.join(e,t,r,i);throw A}})}close(){return S(this,void 0,void 0,function*(){const e=yield this.closingLock.lock();if(this.isClosed){e();return}try{this._isClosed=!0,this.joinAttempts=0,this.emit(L.Closing),this.removeAllListeners(),this.deregisterOnLineListener(),this.clearPendingReconnect(),yield this.cleanupPeerConnections(),yield this.cleanupClient()}finally{e()}})}cleanupPeerConnections(){return S(this,void 0,void 0,function*(){var e;yield(e=this.pcManager)===null||e===void 0?void 0:e.close(),this.pcManager=void 0;const t=r=>{r&&(r.close(),r.onbufferedamountlow=null,r.onclose=null,r.onclosing=null,r.onerror=null,r.onmessage=null,r.onopen=null)};t(this.lossyDC),t(this.lossyDCSub),t(this.reliableDC),t(this.reliableDCSub),this.lossyDC=void 0,this.lossyDCSub=void 0,this.reliableDC=void 0,this.reliableDCSub=void 0})}cleanupClient(){return S(this,void 0,void 0,function*(){yield this.client.close(),this.client.resetCallbacks()})}addTrack(e){if(this.pendingTrackResolvers[e.cid])throw new Ln("a track with the same ID has already been published");return new Promise((t,r)=>{const i=setTimeout(()=>{delete this.pendingTrackResolvers[e.cid],r(new Ie("publication of local track timed out, no response from server",le.InternalError))},1e4);this.pendingTrackResolvers[e.cid]={resolve:A=>{clearTimeout(i),t(A)},reject:()=>{clearTimeout(i),r(new Error("Cancelled publication by calling unpublish"))}},this.client.sendAddTrack(e)})}removeTrack(e){if(e.track&&this.pendingTrackResolvers[e.track.id]){const{reject:t}=this.pendingTrackResolvers[e.track.id];t&&t(),delete this.pendingTrackResolvers[e.track.id]}try{return this.pcManager.removeTrack(e),!0}catch(t){this.log.warn("failed to remove track",Object.assign(Object.assign({},this.logContext),{error:t}))}return!1}updateMuteStatus(e,t){this.client.sendMuteTrack(e,t)}get dataSubscriberReadyState(){var e;return(e=this.reliableDCSub)===null||e===void 0?void 0:e.readyState}getConnectedServerAddress(){return S(this,void 0,void 0,function*(){var e;return(e=this.pcManager)===null||e===void 0?void 0:e.getConnectedAddress()})}setRegionUrlProvider(e){this.regionUrlProvider=e}configure(e){return S(this,void 0,void 0,function*(){var t,r;if(this.pcManager&&this.pcManager.currentState!==ze.NEW)return;this.participantSid=(t=e.participant)===null||t===void 0?void 0:t.sid;const i=this.makeRTCConfiguration(e);this.pcManager=new rx(i,e.subscriberPrimary,this.loggerOptions),this.emit(L.TransportsCreated,this.pcManager.publisher,this.pcManager.subscriber),this.pcManager.onIceCandidate=(A,s)=>{this.client.sendIceCandidate(A,s)},this.pcManager.onPublisherOffer=A=>{this.client.sendOffer(A)},this.pcManager.onDataChannel=this.handleDataChannel,this.pcManager.onStateChange=(A,s,o)=>S(this,void 0,void 0,function*(){if(this.log.debug("primary PC state changed ".concat(A),this.logContext),["closed","disconnected","failed"].includes(s)&&(this.publisherConnectionPromise=void 0),A===ze.CONNECTED){const u=this.pcState===ln.New;this.pcState=ln.Connected,u&&this.emit(L.Connected,e)}else A===ze.FAILED&&this.pcState===ln.Connected&&(this.pcState=ln.Disconnected,this.handleDisconnect("peerconnection failed",o==="failed"?Si.RR_SUBSCRIBER_FAILED:Si.RR_PUBLISHER_FAILED));const a=this.client.isDisconnected||this.client.currentState===Pe.RECONNECTING,c=[ze.FAILED,ze.CLOSING,ze.CLOSED].includes(A);a&&c&&!this._isClosed&&this.emit(L.Offline)}),this.pcManager.onTrack=A=>{this.emit(L.MediaTrackAdded,A.track,A.streams[0],A.receiver)},yx((r=e.serverInfo)===null||r===void 0?void 0:r.protocol)||this.createDataChannels()})}setupSignalClientCallbacks(){this.client.onAnswer=e=>S(this,void 0,void 0,function*(){this.pcManager&&(this.log.debug("received server answer",Object.assign(Object.assign({},this.logContext),{RTCSdpType:e.type})),yield this.pcManager.setPublisherAnswer(e))}),this.client.onTrickle=(e,t)=>{this.pcManager&&(this.log.debug("got ICE candidate from peer",Object.assign(Object.assign({},this.logContext),{candidate:e,target:t})),this.pcManager.addIceCandidate(e,t))},this.client.onOffer=e=>S(this,void 0,void 0,function*(){if(!this.pcManager)return;const t=yield this.pcManager.createSubscriberAnswerFromOffer(e);this.client.sendAnswer(t)}),this.client.onLocalTrackPublished=e=>{var t;if(this.log.debug("received trackPublishedResponse",Object.assign(Object.assign({},this.logContext),{cid:e.cid,track:(t=e.track)===null||t===void 0?void 0:t.sid})),!this.pendingTrackResolvers[e.cid]){this.log.error("missing track resolver for ".concat(e.cid),Object.assign(Object.assign({},this.logContext),{cid:e.cid}));return}const{resolve:r}=this.pendingTrackResolvers[e.cid];delete this.pendingTrackResolvers[e.cid],r(e.track)},this.client.onLocalTrackUnpublished=e=>{this.emit(L.LocalTrackUnpublished,e)},this.client.onLocalTrackSubscribed=e=>{this.emit(L.LocalTrackSubscribed,e)},this.client.onTokenRefresh=e=>{this.token=e},this.client.onRemoteMuteChanged=(e,t)=>{this.emit(L.RemoteMute,e,t)},this.client.onSubscribedQualityUpdate=e=>{this.emit(L.SubscribedQualityUpdate,e)},this.client.onRoomMoved=e=>{var t;this.participantSid=(t=e.participant)===null||t===void 0?void 0:t.sid,this.emit(L.RoomMoved,e)},this.client.onClose=()=>{this.handleDisconnect("signal",Si.RR_SIGNAL_DISCONNECTED)},this.client.onLeave=e=>{switch(this.log.debug("client leave request",Object.assign(Object.assign({},this.logContext),{reason:e==null?void 0:e.reason})),e.regions&&this.regionUrlProvider&&(this.log.debug("updating regions",this.logContext),this.regionUrlProvider.setServerReportedRegions(e.regions)),e.action){case Ui.DISCONNECT:this.emit(L.Disconnected,e==null?void 0:e.reason),this.close();break;case Ui.RECONNECT:this.fullReconnectOnNext=!0,this.handleDisconnect($l);break;case Ui.RESUME:this.handleDisconnect($l)}}}makeRTCConfiguration(e){var t;const r=Object.assign({},this.rtcConfig);if(!((t=this.signalOpts)===null||t===void 0)&&t.e2eeEnabled&&(this.log.debug("E2EE - setting up transports with insertable streams",this.logContext),r.encodedInsertableStreams=!0),e.iceServers&&!r.iceServers){const i=[];e.iceServers.forEach(A=>{const s={urls:A.urls};A.username&&(s.username=A.username),A.credential&&(s.credential=A.credential),i.push(s)}),r.iceServers=i}return e.clientConfiguration&&e.clientConfiguration.forceRelay===PA.ENABLED&&(r.iceTransportPolicy="relay"),r.sdpSemantics="unified-plan",r.continualGatheringPolicy="gather_continually",r}createDataChannels(){this.pcManager&&(this.lossyDC&&(this.lossyDC.onmessage=null,this.lossyDC.onerror=null),this.reliableDC&&(this.reliableDC.onmessage=null,this.reliableDC.onerror=null),this.lossyDC=this.pcManager.createPublisherDataChannel(B0,{ordered:!1,maxRetransmits:0}),this.reliableDC=this.pcManager.createPublisherDataChannel(C0,{ordered:!0}),this.lossyDC.onmessage=this.handleDataMessage,this.reliableDC.onmessage=this.handleDataMessage,this.lossyDC.onerror=this.handleDataError,this.reliableDC.onerror=this.handleDataError,this.lossyDC.bufferedAmountLowThreshold=65535,this.reliableDC.bufferedAmountLowThreshold=65535,this.lossyDC.onbufferedamountlow=this.handleBufferedAmountLow,this.reliableDC.onbufferedamountlow=this.handleBufferedAmountLow)}createSender(e,t,r){return S(this,void 0,void 0,function*(){if(kl())return yield this.createTransceiverRTCRtpSender(e,t,r);if(El())return this.log.warn("using add-track fallback",this.logContext),yield this.createRTCRtpSender(e.mediaStreamTrack);throw new ut("Required webRTC APIs not supported on this device")})}createSimulcastSender(e,t,r,i){return S(this,void 0,void 0,function*(){if(kl())return this.createSimulcastTransceiverSender(e,t,r,i);if(El())return this.log.debug("using add-track fallback",this.logContext),this.createRTCRtpSender(e.mediaStreamTrack);throw new ut("Cannot stream on this device")})}createTransceiverRTCRtpSender(e,t,r){return S(this,void 0,void 0,function*(){if(!this.pcManager)throw new ut("publisher is closed");const i=[];e.mediaStream&&i.push(e.mediaStream),Ri(e)&&(e.codec=t.videoCodec);const A={direction:"sendonly",streams:i};return r&&(A.sendEncodings=r),(yield this.pcManager.addPublisherTransceiver(e.mediaStreamTrack,A)).sender})}createSimulcastTransceiverSender(e,t,r,i){return S(this,void 0,void 0,function*(){if(!this.pcManager)throw new ut("publisher is closed");const A={direction:"sendonly"};i&&(A.sendEncodings=i);const s=yield this.pcManager.addPublisherTransceiver(t.mediaStreamTrack,A);if(r.videoCodec)return e.setSimulcastTrackSender(r.videoCodec,s.sender),s.sender})}createRTCRtpSender(e){return S(this,void 0,void 0,function*(){if(!this.pcManager)throw new ut("publisher is closed");return this.pcManager.addPublisherTrack(e)})}attemptReconnect(e){return S(this,void 0,void 0,function*(){var t,r,i;if(!this._isClosed){if(this.attemptingReconnect){ce.warn("already attempting reconnect, returning early",this.logContext);return}(((t=this.clientConfiguration)===null||t===void 0?void 0:t.resumeConnection)===PA.DISABLED||((i=(r=this.pcManager)===null||r===void 0?void 0:r.currentState)!==null&&i!==void 0?i:ze.NEW)===ze.NEW)&&(this.fullReconnectOnNext=!0);try{this.attemptingReconnect=!0,this.fullReconnectOnNext?yield this.restartConnection():yield this.resumeConnection(e),this.clearPendingReconnect(),this.fullReconnectOnNext=!1}catch(A){this.reconnectAttempts+=1;let s=!0;A instanceof ut?(this.log.debug("received unrecoverable error",Object.assign(Object.assign({},this.logContext),{error:A})),s=!1):A instanceof Oi||(this.fullReconnectOnNext=!0),s?this.handleDisconnect("reconnect",Si.RR_UNKNOWN):(this.log.info("could not recover connection after ".concat(this.reconnectAttempts," attempts, ").concat(Date.now()-this.reconnectStart,"ms. giving up"),this.logContext),this.emit(L.Disconnected),yield this.close())}finally{this.attemptingReconnect=!1}}})}getNextRetryDelay(e){try{return this.reconnectPolicy.nextRetryDelayInMs(e)}catch(t){this.log.warn("encountered error in reconnect policy",Object.assign(Object.assign({},this.logContext),{error:t}))}return null}restartConnection(e){return S(this,void 0,void 0,function*(){var t,r,i;try{if(!this.url||!this.token)throw new ut("could not reconnect, url or token not saved");this.log.info("reconnecting, attempt: ".concat(this.reconnectAttempts),this.logContext),this.emit(L.Restarting),this.client.isDisconnected||(yield this.client.sendLeave()),yield this.cleanupPeerConnections(),yield this.cleanupClient();let A;try{if(!this.signalOpts)throw this.log.warn("attempted connection restart, without signal options present",this.logContext),new Oi;A=yield this.join(e??this.url,this.token,this.signalOpts)}catch(s){throw s instanceof Ie&&s.reason===le.NotAllowed?new ut("could not reconnect, token might be expired"):new Oi}if(this.shouldFailNext)throw this.shouldFailNext=!1,new Error("simulated failure");if(this.client.setReconnected(),this.emit(L.SignalRestarted,A),yield this.waitForPCReconnected(),this.client.currentState!==Pe.CONNECTED)throw new Oi("Signal connection got severed during reconnect");(t=this.regionUrlProvider)===null||t===void 0||t.resetAttempts(),this.emit(L.Restarted)}catch(A){const s=yield(r=this.regionUrlProvider)===null||r===void 0?void 0:r.getNextBestRegionUrl();if(s){yield this.restartConnection(s);return}else throw(i=this.regionUrlProvider)===null||i===void 0||i.resetAttempts(),A}})}resumeConnection(e){return S(this,void 0,void 0,function*(){var t;if(!this.url||!this.token)throw new ut("could not reconnect, url or token not saved");if(!this.pcManager)throw new ut("publisher and subscriber connections unset");this.log.info("resuming signal connection, attempt ".concat(this.reconnectAttempts),this.logContext),this.emit(L.Resuming);let r;try{this.setupSignalClientCallbacks(),r=yield this.client.reconnect(this.url,this.token,this.participantSid,e)}catch(i){let A="";throw i instanceof Error&&(A=i.message,this.log.error(i.message,Object.assign(Object.assign({},this.logContext),{error:i}))),i instanceof Ie&&i.reason===le.NotAllowed?new ut("could not reconnect, token might be expired"):i instanceof Ie&&i.reason===le.LeaveRequest?i:new Oi(A)}if(this.emit(L.SignalResumed),r){const i=this.makeRTCConfiguration(r);this.pcManager.updateConfiguration(i)}else this.log.warn("Did not receive reconnect response",this.logContext);if(this.shouldFailNext)throw this.shouldFailNext=!1,new Error("simulated failure");if(yield this.pcManager.triggerIceRestart(),yield this.waitForPCReconnected(),this.client.currentState!==Pe.CONNECTED)throw new Oi("Signal connection got severed during reconnect");this.client.setReconnected(),((t=this.reliableDC)===null||t===void 0?void 0:t.readyState)==="open"&&this.reliableDC.id===null&&this.createDataChannels(),this.emit(L.Resumed)})}waitForPCInitialConnection(e,t){return S(this,void 0,void 0,function*(){if(!this.pcManager)throw new ut("PC manager is closed");yield this.pcManager.ensurePCTransportConnection(t,e)})}waitForPCReconnected(){return S(this,void 0,void 0,function*(){this.pcState=ln.Reconnecting,this.log.debug("waiting for peer connection to reconnect",this.logContext);try{if(yield Dt(mx),!this.pcManager)throw new ut("PC manager is closed");yield this.pcManager.ensurePCTransportConnection(void 0,this.peerConnectionTimeout),this.pcState=ln.Connected}catch(e){throw this.pcState=ln.Disconnected,new Ie("could not establish PC connection, ".concat(e.message),le.InternalError)}})}publishRpcResponse(e,t,r,i){return S(this,void 0,void 0,function*(){const A=new Lt({destinationIdentities:[e],kind:he.RELIABLE,value:{case:"rpcResponse",value:new Tm({requestId:t,value:i?{case:"error",value:i.toProto()}:{case:"payload",value:r??""}})}});yield this.sendDataPacket(A,he.RELIABLE)})}publishRpcAck(e,t){return S(this,void 0,void 0,function*(){const r=new Lt({destinationIdentities:[e],kind:he.RELIABLE,value:{case:"rpcAck",value:new Um({requestId:t})}});yield this.sendDataPacket(r,he.RELIABLE)})}sendDataPacket(e,t){return S(this,void 0,void 0,function*(){const r=e.toBinary();yield this.ensurePublisherConnected(t);const i=this.dataChannelForKind(t);i&&i.send(r),this.updateAndEmitDCBufferStatus(t)})}waitForBufferStatusLow(e){return new Promise((t,r)=>S(this,void 0,void 0,function*(){if(this.isBufferStatusLow(e))t();else{const i=()=>r("Engine closed");for(this.once(L.Closing,i);!this.dcBufferStatus.get(e);)yield Dt(10);this.off(L.Closing,i),t()}}))}ensureDataTransportConnected(e){return S(this,arguments,void 0,function(t){var r=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.subscriberPrimary;return function*(){var A;if(!r.pcManager)throw new ut("PC manager is closed");const s=i?r.pcManager.subscriber:r.pcManager.publisher,o=i?"Subscriber":"Publisher";if(!s)throw new Ie("".concat(o," connection not set"),le.InternalError);let a=!1;!i&&!r.dataChannelForKind(t,i)&&(r.createDataChannels(),a=!0),!a&&!i&&!r.pcManager.publisher.isICEConnected&&r.pcManager.publisher.getICEConnectionState()!=="checking"&&(a=!0),a&&r.negotiate();const c=r.dataChannelForKind(t,i);if((c==null?void 0:c.readyState)==="open")return;const u=new Date().getTime()+r.peerConnectionTimeout;for(;new Date().getTime()<u;){if(s.isICEConnected&&((A=r.dataChannelForKind(t,i))===null||A===void 0?void 0:A.readyState)==="open")return;yield Dt(50)}throw new Ie("could not establish ".concat(o," connection, state: ").concat(s.getICEConnectionState()),le.InternalError)}()})}ensurePublisherConnected(e){return S(this,void 0,void 0,function*(){this.publisherConnectionPromise||(this.publisherConnectionPromise=this.ensureDataTransportConnected(e,!1)),yield this.publisherConnectionPromise})}verifyTransport(){return!(!this.pcManager||this.pcManager.currentState!==ze.CONNECTED||!this.client.ws||this.client.ws.readyState===WebSocket.CLOSED)}negotiate(){return S(this,void 0,void 0,function*(){return new Promise((e,t)=>S(this,void 0,void 0,function*(){if(!this.pcManager){t(new yl("PC manager is closed"));return}this.pcManager.requirePublisher(),this.pcManager.publisher.getTransceivers().length==0&&!this.lossyDC&&!this.reliableDC&&this.createDataChannels();const r=new AbortController,i=()=>{r.abort(),this.log.debug("engine disconnected while negotiation was ongoing",this.logContext),e()};this.isClosed&&t("cannot negotiate on closed engine"),this.on(L.Closing,i),this.pcManager.publisher.once(Pi.RTPVideoPayloadTypes,A=>{const s=new Map;A.forEach(o=>{const a=o.codec.toLowerCase();UF(a)&&s.set(o.payload,a)}),this.emit(L.RTPVideoMapUpdate,s)});try{yield this.pcManager.negotiate(r),e()}catch(A){A instanceof yl&&(this.fullReconnectOnNext=!0),this.handleDisconnect("negotiation",Si.RR_UNKNOWN),t(A)}finally{this.off(L.Closing,i)}}))})}dataChannelForKind(e,t){if(t){if(e===he.LOSSY)return this.lossyDCSub;if(e===he.RELIABLE)return this.reliableDCSub}else{if(e===he.LOSSY)return this.lossyDC;if(e===he.RELIABLE)return this.reliableDC}}sendSyncState(e,t){var r,i;if(!this.pcManager){this.log.warn("sync state cannot be sent without peer connection setup",this.logContext);return}const A=this.pcManager.subscriber.getLocalDescription(),s=this.pcManager.subscriber.getRemoteDescription(),o=(i=(r=this.signalOpts)===null||r===void 0?void 0:r.autoSubscribe)!==null&&i!==void 0?i:!0,a=new Array,c=new Array;e.forEach(u=>{u.isDesired!==o&&a.push(u.trackSid),u.isEnabled||c.push(u.trackSid)}),this.client.sendSyncState(new qm({answer:A?ra({sdp:A.sdp,type:A.type}):void 0,offer:s?ra({sdp:s.sdp,type:s.type}):void 0,subscription:new No({trackSids:a,subscribe:!o,participantTracks:[]}),publishTracks:MF(t),dataChannels:this.dataChannelsInfo(),trackSidsDisabled:c}))}failNext(){this.shouldFailNext=!0}dataChannelsInfo(){const e=[],t=(r,i)=>{(r==null?void 0:r.id)!==void 0&&r.id!==null&&e.push(new Jm({label:r.label,id:r.id,target:i}))};return t(this.dataChannelForKind(he.LOSSY),on.PUBLISHER),t(this.dataChannelForKind(he.RELIABLE),on.PUBLISHER),t(this.dataChannelForKind(he.LOSSY,!0),on.SUBSCRIBER),t(this.dataChannelForKind(he.RELIABLE,!0),on.SUBSCRIBER),e}clearReconnectTimeout(){this.reconnectTimeout&&yt.clearTimeout(this.reconnectTimeout)}clearPendingReconnect(){this.clearReconnectTimeout(),this.reconnectAttempts=0}registerOnLineListener(){Ht()&&window.addEventListener("online",this.handleBrowserOnLine)}deregisterOnLineListener(){Ht()&&window.removeEventListener("online",this.handleBrowserOnLine)}}class Oi extends Error{}function yx(n){return n!==void 0&&n>13}function wx(n,e){const t=n.participantIdentity?n.participantIdentity:e.participantIdentity;n.participantIdentity=t,e.participantIdentity=t;const r=n.destinationIdentities.length!==0?n.destinationIdentities:e.destinationIdentities;n.destinationIdentities=r,e.destinationIdentities=r}class ed{constructor(e,t){this.lastUpdateAt=0,this.settingsCacheTime=3e3,this.attemptedRegions=[],this.serverUrl=new URL(e),this.token=t}updateToken(e){this.token=e}isCloud(){return Tl(this.serverUrl)}getServerUrl(){return this.serverUrl}getNextBestRegionUrl(e){return S(this,void 0,void 0,function*(){if(!this.isCloud())throw Error("region availability is only supported for LiveKit Cloud domains");(!this.regionSettings||Date.now()-this.lastUpdateAt>this.settingsCacheTime)&&(this.regionSettings=yield this.fetchRegionSettings(e));const t=this.regionSettings.regions.filter(r=>!this.attemptedRegions.find(i=>i.url===r.url));if(t.length>0){const r=t[0];return this.attemptedRegions.push(r),ce.debug("next region: ".concat(r.region)),r.url}else return null})}resetAttempts(){this.attemptedRegions=[]}fetchRegionSettings(e){return S(this,void 0,void 0,function*(){const t=yield fetch("".concat(bx(this.serverUrl),"/regions"),{headers:{authorization:"Bearer ".concat(this.token)},signal:e});if(t.ok){const r=yield t.json();return this.lastUpdateAt=Date.now(),r}else throw new Ie("Could not fetch region settings: ".concat(t.statusText),t.status===401?le.NotAllowed:le.InternalError,t.status)})}setServerReportedRegions(e){this.regionSettings=e,this.lastUpdateAt=Date.now()}}function bx(n){return"".concat(n.protocol.replace("ws","http"),"//").concat(n.host,"/settings")}class _0{get info(){return this._info}constructor(e,t,r){this.reader=t,this.totalByteSize=r,this._info=e,this.bytesReceived=0}}class Bx extends _0{handleChunkReceived(e){var t;this.bytesReceived+=e.content.byteLength;const r=this.totalByteSize?this.bytesReceived/this.totalByteSize:void 0;(t=this.onProgress)===null||t===void 0||t.call(this,r)}[Symbol.asyncIterator](){const e=this.reader.getReader();return{next:()=>S(this,void 0,void 0,function*(){try{const{done:t,value:r}=yield e.read();return t?{done:!0,value:void 0}:(this.handleChunkReceived(r),{done:!1,value:r.content})}catch{return{done:!0,value:void 0}}}),return(){return S(this,void 0,void 0,function*(){return e.releaseLock(),{done:!0,value:void 0}})}}}readAll(){return S(this,void 0,void 0,function*(){var e,t,r,i;let A=new Set;try{for(var s=!0,o=cr(this),a;a=yield o.next(),e=a.done,!e;s=!0){i=a.value,s=!1;const c=i;A.add(c)}}catch(c){t={error:c}}finally{try{!s&&!e&&(r=o.return)&&(yield r.call(o))}finally{if(t)throw t.error}}return Array.from(A)})}}class Cx extends _0{constructor(e,t,r){super(e,t,r),this.receivedChunks=new Map}handleChunkReceived(e){var t;const r=ta(e.chunkIndex),i=this.receivedChunks.get(r);if(i&&i.version>e.version)return;this.receivedChunks.set(r,e),this.bytesReceived+=e.content.byteLength;const A=this.totalByteSize?this.bytesReceived/this.totalByteSize:void 0;(t=this.onProgress)===null||t===void 0||t.call(this,A)}[Symbol.asyncIterator](){const e=this.reader.getReader(),t=new TextDecoder;return{next:()=>S(this,void 0,void 0,function*(){try{const{done:r,value:i}=yield e.read();return r?{done:!0,value:void 0}:(this.handleChunkReceived(i),{done:!1,value:t.decode(i.content)})}catch{return{done:!0,value:void 0}}}),return(){return S(this,void 0,void 0,function*(){return e.releaseLock(),{done:!0,value:void 0}})}}}readAll(){return S(this,void 0,void 0,function*(){var e,t,r,i;let A="";try{for(var s=!0,o=cr(this),a;a=yield o.next(),e=a.done,!e;s=!0)i=a.value,s=!1,A+=i}catch(c){t={error:c}}finally{try{!s&&!e&&(r=o.return)&&(yield r.call(o))}finally{if(t)throw t.error}}return A})}}class S0{constructor(e,t,r){this.writableStream=e,this.defaultWriter=e.getWriter(),this.onClose=r,this.info=t}write(e){return this.defaultWriter.write(e)}close(){return S(this,void 0,void 0,function*(){var e;yield this.defaultWriter.close(),this.defaultWriter.releaseLock(),(e=this.onClose)===null||e===void 0||e.call(this)})}}class _x extends S0{}class Sx extends S0{}class k0 extends P{constructor(e,t,r,i,A){super(e,r,A),this.sid=t,this.receiver=i}get isLocal(){return!1}setMuted(e){this.isMuted!==e&&(this.isMuted=e,this._mediaStreamTrack.enabled=!e,this.emit(e?M.Muted:M.Unmuted,this))}setMediaStream(e){this.mediaStream=e;const t=r=>{r.track===this._mediaStreamTrack&&(e.removeEventListener("removetrack",t),this.receiver&&"playoutDelayHint"in this.receiver&&(this.receiver.playoutDelayHint=void 0),this.receiver=void 0,this._currentBitrate=0,this.emit(M.Ended,this))};e.addEventListener("removetrack",t)}start(){this.startMonitor(),super.enable()}stop(){this.stopMonitor(),super.disable()}getRTCStatsReport(){return S(this,void 0,void 0,function*(){var e;return!((e=this.receiver)===null||e===void 0)&&e.getStats?yield this.receiver.getStats():void 0})}setPlayoutDelay(e){this.receiver?"playoutDelayHint"in this.receiver?this.receiver.playoutDelayHint=e:this.log.warn("Playout delay not supported in this browser"):this.log.warn("Cannot set playout delay, track already ended")}getPlayoutDelay(){if(this.receiver){if("playoutDelayHint"in this.receiver)return this.receiver.playoutDelayHint;this.log.warn("Playout delay not supported in this browser")}else this.log.warn("Cannot get playout delay, track already ended");return 0}startMonitor(){this.monitorInterval||(this.monitorInterval=setInterval(()=>this.monitorReceiver(),zl)),LF()&&this.registerTimeSyncUpdate()}registerTimeSyncUpdate(){const e=()=>{var t;this.timeSyncHandle=requestAnimationFrame(()=>e());const r=(t=this.receiver)===null||t===void 0?void 0:t.getSynchronizationSources()[0];if(r){const{timestamp:i,rtpTimestamp:A}=r;A&&this.rtpTimestamp!==A&&(this.emit(M.TimeSyncUpdate,{timestamp:i,rtpTimestamp:A}),this.rtpTimestamp=A)}};e()}}class kx extends k0{constructor(e,t,r,i,A,s){super(e,t,P.Kind.Audio,r,s),this.monitorReceiver=()=>S(this,void 0,void 0,function*(){if(!this.receiver){this._currentBitrate=0;return}const o=yield this.getReceiverStats();o&&this.prevStats&&this.receiver&&(this._currentBitrate=ia(o,this.prevStats)),this.prevStats=o}),this.audioContext=i,this.webAudioPluginNodes=[],A&&(this.sinkId=A.deviceId)}setVolume(e){var t;for(const r of this.attachedElements)this.audioContext?(t=this.gainNode)===null||t===void 0||t.gain.setTargetAtTime(e,0,.1):r.volume=e;Sn()&&this._mediaStreamTrack._setVolume(e),this.elementVolume=e}getVolume(){if(this.elementVolume)return this.elementVolume;if(Sn())return 1;let e=0;return this.attachedElements.forEach(t=>{t.volume>e&&(e=t.volume)}),e}setSinkId(e){return S(this,void 0,void 0,function*(){this.sinkId=e,yield Promise.all(this.attachedElements.map(t=>{if(Ul(t))return t.setSinkId(e)}))})}attach(e){const t=this.attachedElements.length===0;return e?super.attach(e):e=super.attach(),this.sinkId&&Ul(e)&&e.setSinkId(this.sinkId).catch(r=>{this.log.error("Failed to set sink id on remote audio track",r,this.logContext)}),this.audioContext&&t&&(this.log.debug("using audio context mapping",this.logContext),this.connectWebAudio(this.audioContext,e),e.volume=0,e.muted=!0),this.elementVolume&&this.setVolume(this.elementVolume),e}detach(e){let t;return e?(t=super.detach(e),this.audioContext&&(this.attachedElements.length>0?this.connectWebAudio(this.audioContext,this.attachedElements[0]):this.disconnectWebAudio())):(t=super.detach(),this.disconnectWebAudio()),t}setAudioContext(e){this.audioContext=e,e&&this.attachedElements.length>0?this.connectWebAudio(e,this.attachedElements[0]):e||this.disconnectWebAudio()}setWebAudioPlugins(e){this.webAudioPluginNodes=e,this.attachedElements.length>0&&this.audioContext&&this.connectWebAudio(this.audioContext,this.attachedElements[0])}connectWebAudio(e,t){this.disconnectWebAudio(),this.sourceNode=e.createMediaStreamSource(t.srcObject);let r=this.sourceNode;this.webAudioPluginNodes.forEach(i=>{r.connect(i),r=i}),this.gainNode=e.createGain(),r.connect(this.gainNode),this.gainNode.connect(e.destination),this.elementVolume&&this.gainNode.gain.setTargetAtTime(this.elementVolume,0,.1),e.state!=="running"&&e.resume().then(()=>{e.state!=="running"&&this.emit(M.AudioPlaybackFailed,new Error("Audio Context couldn't be started automatically"))}).catch(i=>{this.emit(M.AudioPlaybackFailed,i)})}disconnectWebAudio(){var e,t;(e=this.gainNode)===null||e===void 0||e.disconnect(),(t=this.sourceNode)===null||t===void 0||t.disconnect(),this.gainNode=void 0,this.sourceNode=void 0}getReceiverStats(){return S(this,void 0,void 0,function*(){if(!this.receiver||!this.receiver.getStats)return;const e=yield this.receiver.getStats();let t;return e.forEach(r=>{r.type==="inbound-rtp"&&(t={type:"audio",streamId:r.id,timestamp:r.timestamp,jitter:r.jitter,bytesReceived:r.bytesReceived,concealedSamples:r.concealedSamples,concealmentEvents:r.concealmentEvents,silentConcealedSamples:r.silentConcealedSamples,silentConcealmentEvents:r.silentConcealmentEvents,totalAudioEnergy:r.totalAudioEnergy,totalSamplesDuration:r.totalSamplesDuration})}),t})}}const td=100;class Ex extends k0{constructor(e,t,r,i,A){super(e,t,P.Kind.Video,r,A),this.elementInfos=[],this.monitorReceiver=()=>S(this,void 0,void 0,function*(){if(!this.receiver){this._currentBitrate=0;return}const s=yield this.getReceiverStats();s&&this.prevStats&&this.receiver&&(this._currentBitrate=ia(s,this.prevStats)),this.prevStats=s}),this.debouncedHandleResize=jl(()=>{this.updateDimensions()},td),this.adaptiveStreamSettings=i}get isAdaptiveStream(){return this.adaptiveStreamSettings!==void 0}get mediaStreamTrack(){return this._mediaStreamTrack}setMuted(e){super.setMuted(e),this.attachedElements.forEach(t=>{e?Fi(this._mediaStreamTrack,t):Ii(this._mediaStreamTrack,t)})}attach(e){if(e?super.attach(e):e=super.attach(),this.adaptiveStreamSettings&&this.elementInfos.find(t=>t.element===e)===void 0){const t=new Ux(e);this.observeElementInfo(t)}return e}observeElementInfo(e){this.adaptiveStreamSettings&&this.elementInfos.find(t=>t===e)===void 0?(e.handleResize=()=>{this.debouncedHandleResize()},e.handleVisibilityChanged=()=>{this.updateVisibility()},this.elementInfos.push(e),e.observe(),this.debouncedHandleResize(),this.updateVisibility()):this.log.warn("visibility resize observer not triggered",this.logContext)}stopObservingElementInfo(e){if(!this.isAdaptiveStream){this.log.warn("stopObservingElementInfo ignored",this.logContext);return}const t=this.elementInfos.filter(r=>r===e);for(const r of t)r.stopObserving();this.elementInfos=this.elementInfos.filter(r=>r!==e),this.updateVisibility(),this.debouncedHandleResize()}detach(e){let t=[];if(e)return this.stopObservingElement(e),super.detach(e);t=super.detach();for(const r of t)this.stopObservingElement(r);return t}getDecoderImplementation(){var e;return(e=this.prevStats)===null||e===void 0?void 0:e.decoderImplementation}getReceiverStats(){return S(this,void 0,void 0,function*(){if(!this.receiver||!this.receiver.getStats)return;const e=yield this.receiver.getStats();let t,r="",i=new Map;return e.forEach(A=>{A.type==="inbound-rtp"?(r=A.codecId,t={type:"video",streamId:A.id,framesDecoded:A.framesDecoded,framesDropped:A.framesDropped,framesReceived:A.framesReceived,packetsReceived:A.packetsReceived,packetsLost:A.packetsLost,frameWidth:A.frameWidth,frameHeight:A.frameHeight,pliCount:A.pliCount,firCount:A.firCount,nackCount:A.nackCount,jitter:A.jitter,timestamp:A.timestamp,bytesReceived:A.bytesReceived,decoderImplementation:A.decoderImplementation}):A.type==="codec"&&i.set(A.id,A)}),t&&r!==""&&i.get(r)&&(t.mimeType=i.get(r).mimeType),t})}stopObservingElement(e){const t=this.elementInfos.filter(r=>r.element===e);for(const r of t)this.stopObservingElementInfo(r)}handleAppVisibilityChanged(){const e=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return S(this,void 0,void 0,function*(){yield e.handleAppVisibilityChanged.call(this),this.isAdaptiveStream&&this.updateVisibility()})}updateVisibility(){var e,t;const r=this.elementInfos.reduce((o,a)=>Math.max(o,a.visibilityChangedAt||0),0),i=!((t=(e=this.adaptiveStreamSettings)===null||e===void 0?void 0:e.pauseVideoInBackground)!==null&&t!==void 0)||t?this.isInBackground:!1,A=this.elementInfos.some(o=>o.pictureInPicture),s=this.elementInfos.some(o=>o.visible)&&!i||A;if(this.lastVisible!==s){if(!s&&Date.now()-r<td){yt.setTimeout(()=>{this.updateVisibility()},td);return}this.lastVisible=s,this.emit(M.VisibilityChanged,s,this)}}updateDimensions(){var e,t;let r=0,i=0;const A=this.getPixelDensity();for(const s of this.elementInfos){const o=s.width()*A,a=s.height()*A;o+a>r+i&&(r=o,i=a)}((e=this.lastDimensions)===null||e===void 0?void 0:e.width)===r&&((t=this.lastDimensions)===null||t===void 0?void 0:t.height)===i||(this.lastDimensions={width:r,height:i},this.emit(M.VideoDimensionsChanged,this.lastDimensions,this))}getPixelDensity(){var e;const t=(e=this.adaptiveStreamSettings)===null||e===void 0?void 0:e.pixelDensity;return t==="screen"?qv():t||(qv()>2?2:1)}}class Ux{get visible(){return this.isPiP||this.isIntersecting}get pictureInPicture(){return this.isPiP}constructor(e,t){this.onVisibilityChanged=r=>{var i;const{target:A,isIntersecting:s}=r;A===this.element&&(this.isIntersecting=s,this.isPiP=KA(this.element),this.visibilityChangedAt=Date.now(),(i=this.handleVisibilityChanged)===null||i===void 0||i.call(this))},this.onEnterPiP=()=>{var r,i,A;(i=(r=window.documentPictureInPicture)===null||r===void 0?void 0:r.window)===null||i===void 0||i.addEventListener("pagehide",this.onLeavePiP),this.isPiP=KA(this.element),(A=this.handleVisibilityChanged)===null||A===void 0||A.call(this)},this.onLeavePiP=()=>{var r;this.isPiP=KA(this.element),(r=this.handleVisibilityChanged)===null||r===void 0||r.call(this)},this.element=e,this.isIntersecting=t??nd(e),this.isPiP=Ht()&&KA(e),this.visibilityChangedAt=0}width(){return this.element.clientWidth}height(){return this.element.clientHeight}observe(){var e,t,r;this.isIntersecting=nd(this.element),this.isPiP=KA(this.element),this.element.handleResize=()=>{var i;(i=this.handleResize)===null||i===void 0||i.call(this)},this.element.handleVisibilityChanged=this.onVisibilityChanged,zv().observe(this.element),Jv().observe(this.element),this.element.addEventListener("enterpictureinpicture",this.onEnterPiP),this.element.addEventListener("leavepictureinpicture",this.onLeavePiP),(e=window.documentPictureInPicture)===null||e===void 0||e.addEventListener("enter",this.onEnterPiP),(r=(t=window.documentPictureInPicture)===null||t===void 0?void 0:t.window)===null||r===void 0||r.addEventListener("pagehide",this.onLeavePiP)}stopObserving(){var e,t,r,i,A;(e=zv())===null||e===void 0||e.unobserve(this.element),(t=Jv())===null||t===void 0||t.unobserve(this.element),this.element.removeEventListener("enterpictureinpicture",this.onEnterPiP),this.element.removeEventListener("leavepictureinpicture",this.onLeavePiP),(r=window.documentPictureInPicture)===null||r===void 0||r.removeEventListener("enter",this.onEnterPiP),(A=(i=window.documentPictureInPicture)===null||i===void 0?void 0:i.window)===null||A===void 0||A.removeEventListener("pagehide",this.onLeavePiP)}}function KA(n){var e,t;return document.pictureInPictureElement===n?!0:!((e=window.documentPictureInPicture)===null||e===void 0)&&e.window?nd(n,(t=window.documentPictureInPicture)===null||t===void 0?void 0:t.window):!1}function nd(n,e){const t=e||window;let r=n.offsetTop,i=n.offsetLeft;const A=n.offsetWidth,s=n.offsetHeight,{hidden:o}=n,{display:a}=getComputedStyle(n);for(;n.offsetParent;)n=n.offsetParent,r+=n.offsetTop,i+=n.offsetLeft;return r<t.pageYOffset+t.innerHeight&&i<t.pageXOffset+t.innerWidth&&r+s>t.pageYOffset&&i+A>t.pageXOffset&&!o&&a!=="none"}class Hn extends _n.EventEmitter{constructor(e,t,r,i){var A;super(),this.metadataMuted=!1,this.encryption=jt.NONE,this.log=ce,this.handleMuted=()=>{this.emit(M.Muted)},this.handleUnmuted=()=>{this.emit(M.Unmuted)},this.log=Mn((A=i==null?void 0:i.loggerName)!==null&&A!==void 0?A:an.Publication),this.loggerContextCb=this.loggerContextCb,this.setMaxListeners(100),this.kind=e,this.trackSid=t,this.trackName=r,this.source=P.Source.Unknown}setTrack(e){this.track&&(this.track.off(M.Muted,this.handleMuted),this.track.off(M.Unmuted,this.handleUnmuted)),this.track=e,e&&(e.on(M.Muted,this.handleMuted),e.on(M.Unmuted,this.handleUnmuted))}get logContext(){var e;return Object.assign(Object.assign({},(e=this.loggerContextCb)===null||e===void 0?void 0:e.call(this)),Ce(this))}get isMuted(){return this.metadataMuted}get isEnabled(){return!0}get isSubscribed(){return this.track!==void 0}get isEncrypted(){return this.encryption!==jt.NONE}get audioTrack(){if(Dn(this.track))return this.track}get videoTrack(){if(Ri(this.track))return this.track}updateInfo(e){this.trackSid=e.sid,this.trackName=e.name,this.source=P.sourceFromProto(e.source),this.mimeType=e.mimeType,this.kind===P.Kind.Video&&e.width>0&&(this.dimensions={width:e.width,height:e.height},this.simulcasted=e.simulcast),this.encryption=e.encryption,this.trackInfo=e,this.log.debug("update publication info",Object.assign(Object.assign({},this.logContext),{info:e}))}}(function(n){(function(e){e.Desired="desired",e.Subscribed="subscribed",e.Unsubscribed="unsubscribed"})(n.SubscriptionStatus||(n.SubscriptionStatus={})),function(e){e.Allowed="allowed",e.NotAllowed="not_allowed"}(n.PermissionStatus||(n.PermissionStatus={}))})(Hn||(Hn={}));class rd extends Hn{get isUpstreamPaused(){var e;return(e=this.track)===null||e===void 0?void 0:e.isUpstreamPaused}constructor(e,t,r,i){super(e,t.sid,t.name,i),this.track=void 0,this.handleTrackEnded=()=>{this.emit(M.Ended)},this.updateInfo(t),this.setTrack(r)}setTrack(e){this.track&&this.track.off(M.Ended,this.handleTrackEnded),super.setTrack(e),e&&e.on(M.Ended,this.handleTrackEnded)}get isMuted(){return this.track?this.track.isMuted:super.isMuted}get audioTrack(){return super.audioTrack}get videoTrack(){return super.videoTrack}get isLocal(){return!0}mute(){return S(this,void 0,void 0,function*(){var e;return(e=this.track)===null||e===void 0?void 0:e.mute()})}unmute(){return S(this,void 0,void 0,function*(){var e;return(e=this.track)===null||e===void 0?void 0:e.unmute()})}pauseUpstream(){return S(this,void 0,void 0,function*(){var e;yield(e=this.track)===null||e===void 0?void 0:e.pauseUpstream()})}resumeUpstream(){return S(this,void 0,void 0,function*(){var e;yield(e=this.track)===null||e===void 0?void 0:e.resumeUpstream()})}getTrackFeatures(){var e;if(Dn(this.track)){const t=this.track.getSourceTrackSettings(),r=new Set;return t.autoGainControl&&r.add(sn.TF_AUTO_GAIN_CONTROL),t.echoCancellation&&r.add(sn.TF_ECHO_CANCELLATION),t.noiseSuppression&&r.add(sn.TF_NOISE_SUPPRESSION),t.channelCount&&t.channelCount>1&&r.add(sn.TF_STEREO),!((e=this.options)===null||e===void 0)&&e.dtx||r.add(sn.TF_NO_DTX),this.track.enhancedNoiseCancellation&&r.add(sn.TF_ENHANCED_NOISE_CANCELLATION),Array.from(r.values())}else return[]}}function aa(n,e){return S(this,void 0,void 0,function*(){n??(n={});let t=!1;const{audioProcessor:r,videoProcessor:i,optionsWithoutProcessor:A}=n0(n);let s=A.audio,o=A.video;if(r&&typeof A.audio=="object"&&(A.audio.processor=r),i&&typeof A.video=="object"&&(A.video.processor=i),n.audio&&typeof A.audio=="object"&&typeof A.audio.deviceId=="string"){const l=A.audio.deviceId;A.audio.deviceId={exact:l},t=!0,s=Object.assign(Object.assign({},A.audio),{deviceId:{ideal:l}})}if(A.video&&typeof A.video=="object"&&typeof A.video.deviceId=="string"){const l=A.video.deviceId;A.video.deviceId={exact:l},t=!0,o=Object.assign(Object.assign({},A.video),{deviceId:{ideal:l}})}(A.audio===!0||typeof A.audio=="object"&&!A.audio.deviceId)&&(A.audio={deviceId:"default"}),A.video===!0?A.video={deviceId:"default"}:typeof A.video=="object"&&!A.video.deviceId&&(A.video.deviceId="default");const a=Zv(A,d0,h0),c=Ll(a),u=navigator.mediaDevices.getUserMedia(c);A.audio&&(pt.userMediaPromiseMap.set("audioinput",u),u.catch(()=>pt.userMediaPromiseMap.delete("audioinput"))),A.video&&(pt.userMediaPromiseMap.set("videoinput",u),u.catch(()=>pt.userMediaPromiseMap.delete("videoinput")));try{const l=yield u;return yield Promise.all(l.getTracks().map(d=>S(this,void 0,void 0,function*(){const h=d.kind==="audio";let f=h?a.audio:a.video;(typeof f=="boolean"||!f)&&(f={});let p;const g=h?c.audio:c.video;typeof g!="boolean"&&(p=g);const v=d.getSettings().deviceId;p!=null&&p.deviceId&&pr(p.deviceId)!==v?p.deviceId=v:p||(p={deviceId:v});const y=Ax(d,p,e);return y.kind===P.Kind.Video?y.source=P.Source.Camera:y.kind===P.Kind.Audio&&(y.source=P.Source.Microphone),y.mediaStream=l,Dn(y)&&r?yield y.setProcessor(r):Ri(y)&&i&&(yield y.setProcessor(i)),y})))}catch(l){if(!t)throw l;return aa(Object.assign(Object.assign({},n),{audio:s,video:o}),e)}})}function Tx(n){return S(this,void 0,void 0,function*(){return(yield aa({audio:!1,video:n??!0}))[0]})}function Ix(n){return S(this,void 0,void 0,function*(){return(yield aa({audio:n??!0,video:!1}))[0]})}var mr;(function(n){n.Excellent="excellent",n.Good="good",n.Poor="poor",n.Lost="lost",n.Unknown="unknown"})(mr||(mr={}));function Fx(n){switch(n){case RA.EXCELLENT:return mr.Excellent;case RA.GOOD:return mr.Good;case RA.POOR:return mr.Poor;case RA.LOST:return mr.Lost;default:return mr.Unknown}}class E0 extends _n.EventEmitter{get logContext(){var e,t;return Object.assign({},(t=(e=this.loggerOptions)===null||e===void 0?void 0:e.loggerContextCb)===null||t===void 0?void 0:t.call(e))}get isEncrypted(){return this.trackPublications.size>0&&Array.from(this.trackPublications.values()).every(e=>e.isEncrypted)}get isAgent(){var e;return((e=this.permissions)===null||e===void 0?void 0:e.agent)||this.kind===Ho.AGENT}get isActive(){var e;return((e=this.participantInfo)===null||e===void 0?void 0:e.state)===ki.ACTIVE}get kind(){return this._kind}get attributes(){return Object.freeze(Object.assign({},this._attributes))}constructor(e,t,r,i,A,s){let o=arguments.length>6&&arguments[6]!==void 0?arguments[6]:Ho.STANDARD;var a;super(),this.audioLevel=0,this.isSpeaking=!1,this._connectionQuality=mr.Unknown,this.log=ce,this.log=Mn((a=s==null?void 0:s.loggerName)!==null&&a!==void 0?a:an.Participant),this.loggerOptions=s,this.setMaxListeners(100),this.sid=e,this.identity=t,this.name=r,this.metadata=i,this.audioTrackPublications=new Map,this.videoTrackPublications=new Map,this.trackPublications=new Map,this._kind=o,this._attributes=A??{}}getTrackPublications(){return Array.from(this.trackPublications.values())}getTrackPublication(e){for(const[,t]of this.trackPublications)if(t.source===e)return t}getTrackPublicationByName(e){for(const[,t]of this.trackPublications)if(t.trackName===e)return t}waitUntilActive(){return this.isActive?Promise.resolve():this.activeFuture?this.activeFuture.promise:(this.activeFuture=new Ql,this.once(K.Active,()=>{var e,t;(t=(e=this.activeFuture)===null||e===void 0?void 0:e.resolve)===null||t===void 0||t.call(e),this.activeFuture=void 0}),this.activeFuture.promise)}get connectionQuality(){return this._connectionQuality}get isCameraEnabled(){var e;const t=this.getTrackPublication(P.Source.Camera);return!(!((e=t==null?void 0:t.isMuted)!==null&&e!==void 0)||e)}get isMicrophoneEnabled(){var e;const t=this.getTrackPublication(P.Source.Microphone);return!(!((e=t==null?void 0:t.isMuted)!==null&&e!==void 0)||e)}get isScreenShareEnabled(){return!!this.getTrackPublication(P.Source.ScreenShare)}get isLocal(){return!1}get joinedAt(){return this.participantInfo?new Date(Number.parseInt(this.participantInfo.joinedAt.toString())*1e3):new Date}updateInfo(e){var t;return this.participantInfo&&this.participantInfo.sid===e.sid&&this.participantInfo.version>e.version?!1:(this.identity=e.identity,this.sid=e.sid,this._setName(e.name),this._setMetadata(e.metadata),this._setAttributes(e.attributes),e.state===ki.ACTIVE&&((t=this.participantInfo)===null||t===void 0?void 0:t.state)!==ki.ACTIVE&&this.emit(K.Active),e.permission&&this.setPermissions(e.permission),this.participantInfo=e,!0)}_setMetadata(e){const t=this.metadata!==e,r=this.metadata;this.metadata=e,t&&this.emit(K.ParticipantMetadataChanged,r)}_setName(e){const t=this.name!==e;this.name=e,t&&this.emit(K.ParticipantNameChanged,e)}_setAttributes(e){const t=DF(this.attributes,e);this._attributes=e,Object.keys(t).length>0&&this.emit(K.AttributesChanged,t)}setPermissions(e){var t,r,i,A,s,o;const a=this.permissions,c=e.canPublish!==((t=this.permissions)===null||t===void 0?void 0:t.canPublish)||e.canSubscribe!==((r=this.permissions)===null||r===void 0?void 0:r.canSubscribe)||e.canPublishData!==((i=this.permissions)===null||i===void 0?void 0:i.canPublishData)||e.hidden!==((A=this.permissions)===null||A===void 0?void 0:A.hidden)||e.recorder!==((s=this.permissions)===null||s===void 0?void 0:s.recorder)||e.canPublishSources.length!==this.permissions.canPublishSources.length||e.canPublishSources.some((u,l)=>{var d;return u!==((d=this.permissions)===null||d===void 0?void 0:d.canPublishSources[l])})||e.canSubscribeMetrics!==((o=this.permissions)===null||o===void 0?void 0:o.canSubscribeMetrics);return this.permissions=e,c&&this.emit(K.ParticipantPermissionsChanged,a),c}setIsSpeaking(e){e!==this.isSpeaking&&(this.isSpeaking=e,e&&(this.lastSpokeAt=new Date),this.emit(K.IsSpeakingChanged,e))}setConnectionQuality(e){const t=this._connectionQuality;this._connectionQuality=Fx(e),t!==this._connectionQuality&&this.emit(K.ConnectionQualityChanged,this._connectionQuality)}setDisconnected(){var e,t;this.activeFuture&&((t=(e=this.activeFuture).reject)===null||t===void 0||t.call(e,new Error("Participant disconnected")),this.activeFuture=void 0)}setAudioContext(e){this.audioContext=e,this.audioTrackPublications.forEach(t=>Dn(t.track)&&t.track.setAudioContext(e))}addTrackPublication(e){e.on(M.Muted,()=>{this.emit(K.TrackMuted,e)}),e.on(M.Unmuted,()=>{this.emit(K.TrackUnmuted,e)});const t=e;switch(t.track&&(t.track.sid=e.trackSid),this.trackPublications.set(e.trackSid,e),e.kind){case P.Kind.Audio:this.audioTrackPublications.set(e.trackSid,e);break;case P.Kind.Video:this.videoTrackPublications.set(e.trackSid,e);break}}}function xx(n){var e,t,r;if(!n.participantSid&&!n.participantIdentity)throw new Error("Invalid track permission, must provide at least one of participantIdentity and participantSid");return new jm({participantIdentity:(e=n.participantIdentity)!==null&&e!==void 0?e:"",participantSid:(t=n.participantSid)!==null&&t!==void 0?t:"",allTracks:(r=n.allowAll)!==null&&r!==void 0?r:!1,trackSids:n.allowedTrackSids||[]})}const U0=15e3;class Qx extends E0{constructor(e,t,r,i,A){super(e,t,void 0,void 0,void 0,{loggerName:i.loggerName,loggerContextCb:()=>this.engine.logContext}),this.pendingPublishing=new Set,this.pendingPublishPromises=new Map,this.participantTrackPermissions=[],this.allParticipantsAllowedToSubscribe=!0,this.encryptionType=jt.NONE,this.enabledPublishVideoCodecs=[],this.pendingAcks=new Map,this.pendingResponses=new Map,this.handleReconnecting=()=>{this.reconnectFuture||(this.reconnectFuture=new Ql)},this.handleReconnected=()=>{var s,o;(o=(s=this.reconnectFuture)===null||s===void 0?void 0:s.resolve)===null||o===void 0||o.call(s),this.reconnectFuture=void 0,this.updateTrackSubscriptionPermissions()},this.handleDisconnected=()=>{var s,o;this.reconnectFuture&&(this.reconnectFuture.promise.catch(a=>this.log.warn(a.message,this.logContext)),(o=(s=this.reconnectFuture)===null||s===void 0?void 0:s.reject)===null||o===void 0||o.call(s,"Got disconnected during reconnection attempt"),this.reconnectFuture=void 0)},this.handleSignalRequestResponse=s=>{const{requestId:o,reason:a,message:c}=s,u=this.pendingSignalRequests.get(o);u&&(a!==ol.OK&&u.reject(new Hv(c,a)),this.pendingSignalRequests.delete(o))},this.handleDataPacket=s=>{switch(s.value.case){case"rpcResponse":let o=s.value.value,a=null,c=null;o.value.case==="payload"?a=o.value.value:o.value.case==="error"&&(c=Xe.fromProto(o.value.value)),this.handleIncomingRpcResponse(o.requestId,a,c);break;case"rpcAck":let u=s.value.value;this.handleIncomingRpcAck(u.requestId);break}},this.updateTrackSubscriptionPermissions=()=>{this.log.debug("updating track subscription permissions",Object.assign(Object.assign({},this.logContext),{allParticipantsAllowed:this.allParticipantsAllowedToSubscribe,participantTrackPermissions:this.participantTrackPermissions})),this.engine.client.sendUpdateSubscriptionPermissions(this.allParticipantsAllowedToSubscribe,this.participantTrackPermissions.map(s=>xx(s)))},this.onTrackUnmuted=s=>{this.onTrackMuted(s,s.isUpstreamPaused)},this.onTrackMuted=(s,o)=>{if(o===void 0&&(o=!0),!s.sid){this.log.error("could not update mute status for unpublished track",Object.assign(Object.assign({},this.logContext),Ce(s)));return}this.engine.updateMuteStatus(s.sid,o)},this.onTrackUpstreamPaused=s=>{this.log.debug("upstream paused",Object.assign(Object.assign({},this.logContext),Ce(s))),this.onTrackMuted(s,!0)},this.onTrackUpstreamResumed=s=>{this.log.debug("upstream resumed",Object.assign(Object.assign({},this.logContext),Ce(s))),this.onTrackMuted(s,s.isMuted)},this.onTrackFeatureUpdate=s=>{const o=this.audioTrackPublications.get(s.sid);if(!o){this.log.warn("Could not update local audio track settings, missing publication for track ".concat(s.sid),this.logContext);return}this.engine.client.sendUpdateLocalAudioTrack(o.trackSid,o.getTrackFeatures())},this.handleSubscribedQualityUpdate=s=>S(this,void 0,void 0,function*(){var o,a,c,u,l,d;if(!(!((l=this.roomOptions)===null||l===void 0)&&l.dynacast))return;const h=this.videoTrackPublications.get(s.trackSid);if(!h){this.log.warn("received subscribed quality update for unknown track",Object.assign(Object.assign({},this.logContext),{trackSid:s.trackSid}));return}if(s.subscribedCodecs.length>0){if(!h.videoTrack)return;const v=yield h.videoTrack.setPublishingCodecs(s.subscribedCodecs);try{for(var f=!0,p=cr(v),g;g=yield p.next(),o=g.done,!o;f=!0){u=g.value,f=!1;const y=u;mF(y)&&(this.log.debug("publish ".concat(y," for ").concat(h.videoTrack.sid),Object.assign(Object.assign({},this.logContext),Ce(h))),yield this.publishAdditionalCodecForTrack(h.videoTrack,y,h.options))}}catch(y){a={error:y}}finally{try{!f&&!o&&(c=p.return)&&(yield c.call(p))}finally{if(a)throw a.error}}}else s.subscribedQualities.length>0&&(yield(d=h.videoTrack)===null||d===void 0?void 0:d.setPublishingLayers(s.subscribedQualities))}),this.handleLocalTrackUnpublished=s=>{const o=this.trackPublications.get(s.trackSid);if(!o){this.log.warn("received unpublished event for unknown track",Object.assign(Object.assign({},this.logContext),{trackSid:s.trackSid}));return}this.unpublishTrack(o.track)},this.handleTrackEnded=s=>S(this,void 0,void 0,function*(){if(s.source===P.Source.ScreenShare||s.source===P.Source.ScreenShareAudio)this.log.debug("unpublishing local track due to TrackEnded",Object.assign(Object.assign({},this.logContext),Ce(s))),this.unpublishTrack(s);else if(s.isUserProvided)yield s.mute();else if(qr(s)||fr(s))try{if(Ht())try{const o=yield navigator==null?void 0:navigator.permissions.query({name:s.source===P.Source.Camera?"camera":"microphone"});if(o&&o.state==="denied")throw this.log.warn("user has revoked access to ".concat(s.source),Object.assign(Object.assign({},this.logContext),Ce(s))),o.onchange=()=>{o.state!=="denied"&&(s.isMuted||s.restartTrack(),o.onchange=null)},new Error("GetUserMedia Permission denied")}catch{}s.isMuted||(this.log.debug("track ended, attempting to use a different device",Object.assign(Object.assign({},this.logContext),Ce(s))),qr(s)?yield s.restartTrack({deviceId:"default"}):yield s.restartTrack())}catch{this.log.warn("could not restart track, muting instead",Object.assign(Object.assign({},this.logContext),Ce(s))),yield s.mute()}}),this.audioTrackPublications=new Map,this.videoTrackPublications=new Map,this.trackPublications=new Map,this.engine=r,this.roomOptions=i,this.setupEngine(r),this.activeDeviceMap=new Map([["audioinput","default"],["videoinput","default"],["audiooutput","default"]]),this.pendingSignalRequests=new Map,this.rpcHandlers=A}get lastCameraError(){return this.cameraError}get lastMicrophoneError(){return this.microphoneError}get isE2EEEnabled(){return this.encryptionType!==jt.NONE}getTrackPublication(e){const t=super.getTrackPublication(e);if(t)return t}getTrackPublicationByName(e){const t=super.getTrackPublicationByName(e);if(t)return t}setupEngine(e){this.engine=e,this.engine.on(L.RemoteMute,(t,r)=>{const i=this.trackPublications.get(t);!i||!i.track||(r?i.mute():i.unmute())}),this.engine.on(L.Connected,this.handleReconnected).on(L.SignalRestarted,this.handleReconnected).on(L.SignalResumed,this.handleReconnected).on(L.Restarting,this.handleReconnecting).on(L.Resuming,this.handleReconnecting).on(L.LocalTrackUnpublished,this.handleLocalTrackUnpublished).on(L.SubscribedQualityUpdate,this.handleSubscribedQualityUpdate).on(L.Disconnected,this.handleDisconnected).on(L.SignalRequestResponse,this.handleSignalRequestResponse).on(L.DataPacketReceived,this.handleDataPacket)}setMetadata(e){return S(this,void 0,void 0,function*(){yield this.requestMetadataUpdate({metadata:e})})}setName(e){return S(this,void 0,void 0,function*(){yield this.requestMetadataUpdate({name:e})})}setAttributes(e){return S(this,void 0,void 0,function*(){yield this.requestMetadataUpdate({attributes:e})})}requestMetadataUpdate(e){return S(this,arguments,void 0,function(t){var r=this;let{metadata:i,name:A,attributes:s}=t;return function*(){return new Promise((o,a)=>S(r,void 0,void 0,function*(){var c,u;try{let l=!1;const d=yield this.engine.client.sendUpdateLocalMetadata((c=i??this.metadata)!==null&&c!==void 0?c:"",(u=A??this.name)!==null&&u!==void 0?u:"",s),h=performance.now();for(this.pendingSignalRequests.set(d,{resolve:o,reject:f=>{a(f),l=!0},values:{name:A,metadata:i,attributes:s}});performance.now()-h<5e3&&!l;){if((!A||this.name===A)&&(!i||this.metadata===i)&&(!s||Object.entries(s).every(f=>{let[p,g]=f;return this.attributes[p]===g||g===""&&!this.attributes[p]}))){this.pendingSignalRequests.delete(d),o();return}yield Dt(50)}a(new Hv("Request to update local metadata timed out","TimeoutError"))}catch(l){l instanceof Error&&a(l)}}))}()})}setCameraEnabled(e,t,r){return this.setTrackEnabled(P.Source.Camera,e,t,r)}setMicrophoneEnabled(e,t,r){return this.setTrackEnabled(P.Source.Microphone,e,t,r)}setScreenShareEnabled(e,t,r){return this.setTrackEnabled(P.Source.ScreenShare,e,t,r)}setPermissions(e){const t=this.permissions,r=super.setPermissions(e);return r&&t&&this.emit(K.ParticipantPermissionsChanged,t),r}setE2EEEnabled(e){return S(this,void 0,void 0,function*(){this.encryptionType=e?jt.GCM:jt.NONE,yield this.republishAllTracks(void 0,!1)})}setTrackEnabled(e,t,r,i){return S(this,void 0,void 0,function*(){var A,s;this.log.debug("setTrackEnabled",Object.assign(Object.assign({},this.logContext),{source:e,enabled:t})),this.republishPromise&&(yield this.republishPromise);let o=this.getTrackPublication(e);if(t)if(o)yield o.unmute();else{let a;if(this.pendingPublishing.has(e)){const c=yield this.waitForPendingPublicationOfSource(e);return c||this.log.info("waiting for pending publication promise timed out",Object.assign(Object.assign({},this.logContext),{source:e})),yield c==null?void 0:c.unmute(),c}this.pendingPublishing.add(e);try{switch(e){case P.Source.Camera:a=yield this.createTracks({video:(A=r)!==null&&A!==void 0?A:!0});break;case P.Source.Microphone:a=yield this.createTracks({audio:(s=r)!==null&&s!==void 0?s:!0});break;case P.Source.ScreenShare:a=yield this.createScreenTracks(Object.assign({},r));break;default:throw new Ln(e)}}catch(c){throw a==null||a.forEach(u=>{u.stop()}),c instanceof Error&&this.emit(K.MediaDevicesError,c),this.pendingPublishing.delete(e),c}try{const c=[];for(const l of a)this.log.info("publishing track",Object.assign(Object.assign({},this.logContext),Ce(l))),c.push(this.publishTrack(l,i));[o]=yield Promise.all(c)}catch(c){throw a==null||a.forEach(u=>{u.stop()}),c}finally{this.pendingPublishing.delete(e)}}else if(!(o!=null&&o.track)&&this.pendingPublishing.has(e)&&(o=yield this.waitForPendingPublicationOfSource(e),o||this.log.info("waiting for pending publication promise timed out",Object.assign(Object.assign({},this.logContext),{source:e}))),o&&o.track)if(e===P.Source.ScreenShare){o=yield this.unpublishTrack(o.track);const a=this.getTrackPublication(P.Source.ScreenShareAudio);a&&a.track&&this.unpublishTrack(a.track)}else yield o.mute();return o})}enableCameraAndMicrophone(){return S(this,void 0,void 0,function*(){if(!(this.pendingPublishing.has(P.Source.Camera)||this.pendingPublishing.has(P.Source.Microphone))){this.pendingPublishing.add(P.Source.Camera),this.pendingPublishing.add(P.Source.Microphone);try{const e=yield this.createTracks({audio:!0,video:!0});yield Promise.all(e.map(t=>this.publishTrack(t)))}finally{this.pendingPublishing.delete(P.Source.Camera),this.pendingPublishing.delete(P.Source.Microphone)}}})}createTracks(e){return S(this,void 0,void 0,function*(){var t,r;e??(e={});const i=Zv(e,(t=this.roomOptions)===null||t===void 0?void 0:t.audioCaptureDefaults,(r=this.roomOptions)===null||r===void 0?void 0:r.videoCaptureDefaults);try{return(yield aa(i,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext})).map(o=>(Dn(o)&&(this.microphoneError=void 0,o.setAudioContext(this.audioContext),o.source=P.Source.Microphone,this.emit(K.AudioStreamAcquired)),Ri(o)&&(this.cameraError=void 0,o.source=P.Source.Camera),o))}catch(A){throw A instanceof Error&&(e.audio&&(this.microphoneError=A),e.video&&(this.cameraError=A)),A}})}createScreenTracks(e){return S(this,void 0,void 0,function*(){if(e===void 0&&(e={}),navigator.mediaDevices.getDisplayMedia===void 0)throw new vl("getDisplayMedia not supported");e.resolution===void 0&&!CF()&&(e.resolution=Sl.h1080fps30.resolution);const t=OF(e),r=yield navigator.mediaDevices.getDisplayMedia(t),i=r.getVideoTracks();if(i.length===0)throw new Ln("no video track found");const A=new oa(i[0],void 0,!1,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});A.source=P.Source.ScreenShare,e.contentHint&&(A.mediaStreamTrack.contentHint=e.contentHint);const s=[A];if(r.getAudioTracks().length>0){this.emit(K.AudioStreamAcquired);const o=new Aa(r.getAudioTracks()[0],void 0,!1,this.audioContext,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});o.source=P.Source.ScreenShareAudio,s.push(o)}return s})}publishTrack(e,t){return S(this,void 0,void 0,function*(){return this.publishOrRepublishTrack(e,t)})}publishOrRepublishTrack(e,t){return S(this,arguments,void 0,function(r,i){var A=this;let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return function*(){var o,a,c,u;qr(r)&&r.setAudioContext(A.audioContext),yield(o=A.reconnectFuture)===null||o===void 0?void 0:o.promise,A.republishPromise&&!s&&(yield A.republishPromise),Qi(r)&&A.pendingPublishPromises.has(r)&&(yield A.pendingPublishPromises.get(r));let l;if(r instanceof MediaStreamTrack)l=r.getConstraints();else{l=r.constraints;let v;switch(r.source){case P.Source.Microphone:v="audioinput";break;case P.Source.Camera:v="videoinput"}v&&A.activeDeviceMap.has(v)&&(l=Object.assign(Object.assign({},l),{deviceId:A.activeDeviceMap.get(v)}))}if(r instanceof MediaStreamTrack)switch(r.kind){case"audio":r=new Aa(r,l,!0,A.audioContext,{loggerName:A.roomOptions.loggerName,loggerContextCb:()=>A.logContext});break;case"video":r=new oa(r,l,!0,{loggerName:A.roomOptions.loggerName,loggerContextCb:()=>A.logContext});break;default:throw new Ln("unsupported MediaStreamTrack kind ".concat(r.kind))}else r.updateLoggerOptions({loggerName:A.roomOptions.loggerName,loggerContextCb:()=>A.logContext});let d;if(A.trackPublications.forEach(v=>{v.track&&v.track===r&&(d=v)}),d)return A.log.warn("track has already been published, skipping",Object.assign(Object.assign({},A.logContext),Ce(d))),d;const h="channelCount"in r.mediaStreamTrack.getSettings()&&r.mediaStreamTrack.getSettings().channelCount===2||r.mediaStreamTrack.getConstraints().channelCount===2,f=(a=i==null?void 0:i.forceStereo)!==null&&a!==void 0?a:h;f&&(i||(i={}),i.dtx===void 0&&A.log.info("Opus DTX will be disabled for stereo tracks by default. Enable them explicitly to make it work.",Object.assign(Object.assign({},A.logContext),Ce(r))),i.red===void 0&&A.log.info("Opus RED will be disabled for stereo tracks by default. Enable them explicitly to make it work."),(c=i.dtx)!==null&&c!==void 0||(i.dtx=!1),(u=i.red)!==null&&u!==void 0||(i.red=!1));const p=Object.assign(Object.assign({},A.roomOptions.publishDefaults),i);!_F()&&A.roomOptions.e2ee&&(A.log.info("End-to-end encryption is set up, simulcast publishing will be disabled on Safari versions and iOS browsers running iOS < v17.2",Object.assign({},A.logContext)),p.simulcast=!1),p.source&&(r.source=p.source);const g=new Promise((v,y)=>S(A,void 0,void 0,function*(){try{if(this.engine.client.currentState!==Pe.CONNECTED){this.log.debug("deferring track publication until signal is connected",Object.assign(Object.assign({},this.logContext),{track:Ce(r)}));const b=()=>S(this,void 0,void 0,function*(){try{const B=yield this.publish(r,p,f);v(B)}catch(B){y(B)}});setTimeout(()=>{this.engine.off(L.SignalConnected,b),y(new wl("publishing rejected as engine not connected within timeout",408))},15e3),this.engine.once(L.SignalConnected,b),this.engine.on(L.Closing,()=>{this.engine.off(L.SignalConnected,b),y(new wl("publishing rejected as engine closed",499))})}else try{const b=yield this.publish(r,p,f);v(b)}catch(b){y(b)}}catch(b){y(b)}}));A.pendingPublishPromises.set(r,g);try{return yield g}catch(v){throw v}finally{A.pendingPublishPromises.delete(r)}}()})}hasPermissionsToPublish(e){if(!this.permissions)return this.log.warn("no permissions present for publishing track",Object.assign(Object.assign({},this.logContext),Ce(e))),!1;const{canPublish:t,canPublishSources:r}=this.permissions;return t&&(r.length===0||r.map(i=>HF(i)).includes(e.source))?!0:(this.log.warn("insufficient permissions to publish",Object.assign(Object.assign({},this.logContext),Ce(e))),!1)}publish(e,t,r){return S(this,void 0,void 0,function*(){var i,A,s,o,a,c,u,l,d,h;if(!this.hasPermissionsToPublish(e))throw new wl("failed to publish track, insufficient permissions",403);Array.from(this.trackPublications.values()).find(w=>Qi(e)&&w.source===e.source)&&e.source!==P.Source.Unknown&&this.log.info("publishing a second track with the same source: ".concat(e.source),Object.assign(Object.assign({},this.logContext),Ce(e))),t.stopMicTrackOnMute&&Dn(e)&&(e.stopOnMute=!0),e.source===P.Source.ScreenShare&&xi()&&(t.simulcast=!1),t.videoCodec==="av1"&&!wF()&&(t.videoCodec=void 0),t.videoCodec==="vp9"&&!bF()&&(t.videoCodec=void 0),t.videoCodec===void 0&&(t.videoCodec=Wl),this.enabledPublishVideoCodecs.length>0&&(this.enabledPublishVideoCodecs.some(w=>t.videoCodec===na(w.mime))||(t.videoCodec=na(this.enabledPublishVideoCodecs[0].mime)));const p=t.videoCodec;e.on(M.Muted,this.onTrackMuted),e.on(M.Unmuted,this.onTrackUnmuted),e.on(M.Ended,this.handleTrackEnded),e.on(M.UpstreamPaused,this.onTrackUpstreamPaused),e.on(M.UpstreamResumed,this.onTrackUpstreamResumed),e.on(M.AudioTrackFeatureUpdate,this.onTrackFeatureUpdate);const g=new nl({cid:e.mediaStreamTrack.id,name:t.name,type:P.kindToProto(e.kind),muted:e.isMuted,source:P.sourceToProto(e.source),disableDtx:!(!((i=t.dtx)!==null&&i!==void 0)||i),encryption:this.encryptionType,stereo:r,disableRed:this.isE2EEEnabled||!(!((A=t.red)!==null&&A!==void 0)||A),stream:t==null?void 0:t.stream,backupCodecPolicy:t==null?void 0:t.backupCodecPolicy});let v;if(e.kind===P.Kind.Video){let w={width:0,height:0};try{w=yield e.waitForDimensions()}catch{const k=(o=(s=this.roomOptions.videoCaptureDefaults)===null||s===void 0?void 0:s.resolution)!==null&&o!==void 0?o:LA.h720.resolution;w={width:k.width,height:k.height},this.log.error("could not determine track dimensions, using defaults",Object.assign(Object.assign(Object.assign({},this.logContext),Ce(e)),{dims:w}))}g.width=w.width,g.height=w.height,fr(e)&&(DA(p)&&(e.source===P.Source.ScreenShare&&(t.scalabilityMode="L1T3","contentHint"in e.mediaStreamTrack&&(e.mediaStreamTrack.contentHint="motion",this.log.info("forcing contentHint to motion for screenshare with SVC codecs",Object.assign(Object.assign({},this.logContext),Ce(e))))),t.scalabilityMode=(a=t.scalabilityMode)!==null&&a!==void 0?a:"L3T3_KEY"),g.simulcastCodecs=[new tl({codec:p,cid:e.mediaStreamTrack.id})],t.backupCodec===!0&&(t.backupCodec={codec:Wl}),t.backupCodec&&p!==t.backupCodec.codec&&g.encryption===jt.NONE&&(this.roomOptions.dynacast||(this.roomOptions.dynacast=!0),g.simulcastCodecs.push(new tl({codec:t.backupCodec.codec,cid:""})))),v=Yl(e.source===P.Source.ScreenShare,g.width,g.height,t),g.layers=b0(g.width,g.height,v,DA(t.videoCodec))}else e.kind===P.Kind.Audio&&(v=[{maxBitrate:(c=t.audioPreset)===null||c===void 0?void 0:c.maxBitrate,priority:(l=(u=t.audioPreset)===null||u===void 0?void 0:u.priority)!==null&&l!==void 0?l:"high",networkPriority:(h=(d=t.audioPreset)===null||d===void 0?void 0:d.priority)!==null&&h!==void 0?h:"high"}]);if(!this.engine||this.engine.isClosed)throw new ut("cannot publish track when not connected");const y=()=>S(this,void 0,void 0,function*(){var w,_,k;if(!this.engine.pcManager)throw new ut("pcManager is not ready");if(e.sender=yield this.engine.createSender(e,t,v),fr(e)&&((w=t.degradationPreference)!==null&&w!==void 0||(t.degradationPreference=fx(e)),e.setDegradationPreference(t.degradationPreference)),v)if(xi()&&e.kind===P.Kind.Audio){let T;for(const I of this.engine.pcManager.publisher.getTransceivers())if(I.sender===e.sender){T=I;break}T&&this.engine.pcManager.publisher.setTrackCodecBitrate({transceiver:T,codec:"opus",maxbr:!((_=v[0])===null||_===void 0)&&_.maxBitrate?v[0].maxBitrate/1e3:0})}else e.codec&&DA(e.codec)&&(!((k=v[0])===null||k===void 0)&&k.maxBitrate)&&this.engine.pcManager.publisher.setTrackCodecBitrate({cid:g.cid,codec:e.codec,maxbr:v[0].maxBitrate/1e3});yield this.engine.negotiate()});let b;if(this.enabledPublishVideoCodecs.length>0)b=(yield Promise.all([this.engine.addTrack(g),y()]))[0];else{b=yield this.engine.addTrack(g);let w;if(b.codecs.forEach(_=>{w===void 0&&(w=_.mimeType)}),w&&e.kind===P.Kind.Video){const _=na(w);_!==p&&(this.log.debug("falling back to server selected codec",Object.assign(Object.assign(Object.assign({},this.logContext),Ce(e)),{codec:_})),t.videoCodec=_,v=Yl(e.source===P.Source.ScreenShare,g.width,g.height,t))}yield y()}const B=new rd(e.kind,b,e,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});return B.options=t,e.sid=b.sid,this.log.debug("publishing ".concat(e.kind," with encodings"),Object.assign(Object.assign({},this.logContext),{encodings:v,trackInfo:b})),fr(e)?e.startMonitor(this.engine.client):qr(e)&&e.startMonitor(),this.addTrackPublication(B),this.emit(K.LocalTrackPublished,B),B})}get isLocal(){return!0}publishAdditionalCodecForTrack(e,t,r){return S(this,void 0,void 0,function*(){var i;if(this.encryptionType!==jt.NONE)return;let A;if(this.trackPublications.forEach(h=>{h.track&&h.track===e&&(A=h)}),!A)throw new Ln("track is not published");if(!fr(e))throw new Ln("track is not a video track");const s=Object.assign(Object.assign({},(i=this.roomOptions)===null||i===void 0?void 0:i.publishDefaults),r),o=dx(e,t,s);if(!o){this.log.info("backup codec has been disabled, ignoring request to add additional codec for track",Object.assign(Object.assign({},this.logContext),Ce(e)));return}const a=e.addSimulcastTrack(t,o);if(!a)return;const c=new nl({cid:a.mediaStreamTrack.id,type:P.kindToProto(e.kind),muted:e.isMuted,source:P.sourceToProto(e.source),sid:e.sid,simulcastCodecs:[{codec:s.videoCodec,cid:a.mediaStreamTrack.id}]});if(c.layers=b0(c.width,c.height,o),!this.engine||this.engine.isClosed)throw new ut("cannot publish track when not connected");const u=()=>S(this,void 0,void 0,function*(){yield this.engine.createSimulcastSender(e,a,s,o),yield this.engine.negotiate()}),d=(yield Promise.all([this.engine.addTrack(c),u()]))[0];this.log.debug("published ".concat(t," for track ").concat(e.sid),Object.assign(Object.assign({},this.logContext),{encodings:o,trackInfo:d}))})}unpublishTrack(e,t){return S(this,void 0,void 0,function*(){var r,i;if(Qi(e)){const c=this.pendingPublishPromises.get(e);c&&(this.log.info("awaiting publish promise before attempting to unpublish",Object.assign(Object.assign({},this.logContext),Ce(e))),yield c)}const A=this.getPublicationForTrack(e),s=A?Ce(A):void 0;if(this.log.debug("unpublishing track",Object.assign(Object.assign({},this.logContext),s)),!A||!A.track){this.log.warn("track was not unpublished because no publication was found",Object.assign(Object.assign({},this.logContext),s));return}e=A.track,e.off(M.Muted,this.onTrackMuted),e.off(M.Unmuted,this.onTrackUnmuted),e.off(M.Ended,this.handleTrackEnded),e.off(M.UpstreamPaused,this.onTrackUpstreamPaused),e.off(M.UpstreamResumed,this.onTrackUpstreamResumed),e.off(M.AudioTrackFeatureUpdate,this.onTrackFeatureUpdate),t===void 0&&(t=(i=(r=this.roomOptions)===null||r===void 0?void 0:r.stopLocalTrackOnUnpublish)!==null&&i!==void 0?i:!0),t?e.stop():e.stopMonitor();let o=!1;const a=e.sender;if(e.sender=void 0,this.engine.pcManager&&this.engine.pcManager.currentState<ze.FAILED&&a)try{for(const c of this.engine.pcManager.publisher.getTransceivers())c.sender===a&&(c.direction="inactive",o=!0);if(this.engine.removeTrack(a)&&(o=!0),fr(e)){for(const[,c]of e.simulcastCodecs)c.sender&&(this.engine.removeTrack(c.sender)&&(o=!0),c.sender=void 0);e.simulcastCodecs.clear()}}catch(c){this.log.warn("failed to unpublish track",Object.assign(Object.assign(Object.assign({},this.logContext),s),{error:c}))}switch(this.trackPublications.delete(A.trackSid),A.kind){case P.Kind.Audio:this.audioTrackPublications.delete(A.trackSid);break;case P.Kind.Video:this.videoTrackPublications.delete(A.trackSid);break}return this.emit(K.LocalTrackUnpublished,A),A.setTrack(void 0),o&&(yield this.engine.negotiate()),A})}unpublishTracks(e){return S(this,void 0,void 0,function*(){return(yield Promise.all(e.map(r=>this.unpublishTrack(r)))).filter(r=>!!r)})}republishAllTracks(e){return S(this,arguments,void 0,function(t){var r=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return function*(){r.republishPromise&&(yield r.republishPromise),r.republishPromise=new Promise((A,s)=>S(r,void 0,void 0,function*(){try{const o=[];this.trackPublications.forEach(a=>{a.track&&(t&&(a.options=Object.assign(Object.assign({},a.options),t)),o.push(a))}),yield Promise.all(o.map(a=>S(this,void 0,void 0,function*(){const c=a.track;yield this.unpublishTrack(c,!1),i&&!c.isMuted&&c.source!==P.Source.ScreenShare&&c.source!==P.Source.ScreenShareAudio&&(qr(c)||fr(c))&&!c.isUserProvided&&(this.log.debug("restarting existing track",Object.assign(Object.assign({},this.logContext),{track:a.trackSid})),yield c.restartTrack()),yield this.publishOrRepublishTrack(c,a.options,!0)}))),A()}catch(o){s(o)}finally{this.republishPromise=void 0}})),yield r.republishPromise}()})}publishData(e){return S(this,arguments,void 0,function(t){var r=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){const A=i.reliable?he.RELIABLE:he.LOSSY,s=i.destinationIdentities,o=i.topic,a=new Lt({kind:A,value:{case:"user",value:new Sm({participantIdentity:r.identity,payload:t,destinationIdentities:s,topic:o})}});yield r.engine.sendDataPacket(a,A)}()})}publishDtmf(e,t){return S(this,void 0,void 0,function*(){const r=new Lt({kind:he.RELIABLE,value:{case:"sipDtmf",value:new km({code:e,digit:t})}});yield this.engine.sendDataPacket(r,he.RELIABLE)})}sendChatMessage(e,t){return S(this,void 0,void 0,function*(){const r={id:crypto.randomUUID(),message:e,timestamp:Date.now(),attachedFiles:t==null?void 0:t.attachments},i=new Lt({value:{case:"chatMessage",value:new zu(Object.assign(Object.assign({},r),{timestamp:Ne.parse(r.timestamp)}))}});return yield this.engine.sendDataPacket(i,he.RELIABLE),this.emit(K.ChatMessage,r),r})}editChatMessage(e,t){return S(this,void 0,void 0,function*(){const r=Object.assign(Object.assign({},t),{message:e,editTimestamp:Date.now()}),i=new Lt({value:{case:"chatMessage",value:new zu(Object.assign(Object.assign({},r),{timestamp:Ne.parse(r.timestamp),editTimestamp:Ne.parse(r.editTimestamp)}))}});return yield this.engine.sendDataPacket(i,he.RELIABLE),this.emit(K.ChatMessage,r),r})}sendText(e,t){return S(this,void 0,void 0,function*(){var r;const i=crypto.randomUUID(),s=new TextEncoder().encode(e).byteLength,o=(r=t==null?void 0:t.attachments)===null||r===void 0?void 0:r.map(()=>crypto.randomUUID()),a=new Array(o?o.length+1:1).fill(0),c=(l,d)=>{var h;a[d]=l;const f=a.reduce((p,g)=>p+g,0);(h=t==null?void 0:t.onProgress)===null||h===void 0||h.call(t,f)},u=yield this.streamText({streamId:i,totalSize:s,destinationIdentities:t==null?void 0:t.destinationIdentities,topic:t==null?void 0:t.topic,attachedStreamIds:o,attributes:t==null?void 0:t.attributes});return yield u.write(e),c(1,0),yield u.close(),t!=null&&t.attachments&&o&&(yield Promise.all(t.attachments.map((l,d)=>S(this,void 0,void 0,function*(){return this._sendFile(o[d],l,{topic:t.topic,mimeType:l.type,onProgress:h=>{c(h,d+1)}})})))),u.info})}streamText(e){return S(this,void 0,void 0,function*(){var t,r;const i=(t=e==null?void 0:e.streamId)!==null&&t!==void 0?t:crypto.randomUUID(),A={id:i,mimeType:"text/plain",timestamp:Date.now(),topic:(r=e==null?void 0:e.topic)!==null&&r!==void 0?r:"",size:e==null?void 0:e.totalSize,attributes:e==null?void 0:e.attributes},s=new Yu({streamId:i,mimeType:A.mimeType,topic:A.topic,timestamp:Wr(A.timestamp),totalLength:Wr(e==null?void 0:e.totalSize),attributes:A.attributes,contentHeader:{case:"textHeader",value:new Mm({version:e==null?void 0:e.version,attachedStreamIds:e==null?void 0:e.attachedStreamIds,replyToStreamId:e==null?void 0:e.replyToStreamId,operationType:(e==null?void 0:e.type)==="update"?Xu.UPDATE:Xu.CREATE})}}),o=e==null?void 0:e.destinationIdentities,a=new Lt({destinationIdentities:o,value:{case:"streamHeader",value:s}});yield this.engine.sendDataPacket(a,he.RELIABLE);let c=0;const u=this,l=new WritableStream({write(f){return S(this,void 0,void 0,function*(){for(const p of RF(f,U0)){yield u.engine.waitForBufferStatusLow(he.RELIABLE);const g=new Zu({content:p,streamId:i,chunkIndex:Wr(c)}),v=new Lt({destinationIdentities:o,value:{case:"streamChunk",value:g}});yield u.engine.sendDataPacket(v,he.RELIABLE),c+=1}})},close(){return S(this,void 0,void 0,function*(){const f=new $u({streamId:i}),p=new Lt({destinationIdentities:o,value:{case:"streamTrailer",value:f}});yield u.engine.sendDataPacket(p,he.RELIABLE)})},abort(f){console.log("Sink error:",f)}});let d=()=>S(this,void 0,void 0,function*(){yield h.close()});u.engine.once(L.Closing,d);const h=new _x(l,A,()=>this.engine.off(L.Closing,d));return h})}sendFile(e,t){return S(this,void 0,void 0,function*(){const r=crypto.randomUUID();return yield this._sendFile(r,e,t),{id:r}})}_sendFile(e,t,r){return S(this,void 0,void 0,function*(){var i;const A=yield this.streamBytes({streamId:e,totalSize:t.size,name:t.name,mimeType:(i=r==null?void 0:r.mimeType)!==null&&i!==void 0?i:t.type,topic:r==null?void 0:r.topic,destinationIdentities:r==null?void 0:r.destinationIdentities}),s=t.stream().getReader();for(;;){const{done:o,value:a}=yield s.read();if(o)break;yield A.write(a)}return yield A.close(),A.info})}streamBytes(e){return S(this,void 0,void 0,function*(){var t,r,i,A,s;const o=(t=e==null?void 0:e.streamId)!==null&&t!==void 0?t:crypto.randomUUID(),a=e==null?void 0:e.destinationIdentities,c={id:o,mimeType:(r=e==null?void 0:e.mimeType)!==null&&r!==void 0?r:"application/octet-stream",topic:(i=e==null?void 0:e.topic)!==null&&i!==void 0?i:"",timestamp:Date.now(),attributes:e==null?void 0:e.attributes,size:e==null?void 0:e.totalSize,name:(A=e==null?void 0:e.name)!==null&&A!==void 0?A:"unknown"},u=new Yu({totalLength:Wr((s=c.size)!==null&&s!==void 0?s:0),mimeType:c.mimeType,streamId:o,topic:c.topic,timestamp:Wr(Date.now()),attributes:c.attributes,contentHeader:{case:"byteHeader",value:new Lm({name:c.name})}}),l=new Lt({destinationIdentities:a,value:{case:"streamHeader",value:u}});yield this.engine.sendDataPacket(l,he.RELIABLE);let d=0;const h=new Ot,f=this.engine,p=this.log,g=new WritableStream({write(y){return S(this,void 0,void 0,function*(){const b=yield h.lock();let B=0;try{for(;B<y.byteLength;){const w=y.slice(B,B+U0);yield f.waitForBufferStatusLow(he.RELIABLE);const _=new Lt({destinationIdentities:a,value:{case:"streamChunk",value:new Zu({content:w,streamId:o,chunkIndex:Wr(d)})}});yield f.sendDataPacket(_,he.RELIABLE),d+=1,B+=w.byteLength}}finally{b()}})},close(){return S(this,void 0,void 0,function*(){const y=new $u({streamId:o}),b=new Lt({destinationIdentities:a,value:{case:"streamTrailer",value:y}});yield f.sendDataPacket(b,he.RELIABLE)})},abort(y){p.error("Sink error:",y)}});return new Sx(g,c)})}performRpc(e){return S(this,arguments,void 0,function(t){var r=this;let{destinationIdentity:i,method:A,payload:s,responseTimeout:o=1e4}=t;return function*(){return new Promise((c,u)=>S(r,void 0,void 0,function*(){var l,d,h,f;if(Jl(s)>p0){u(Xe.builtIn("REQUEST_PAYLOAD_TOO_LARGE"));return}if(!((d=(l=this.engine.latestJoinResponse)===null||l===void 0?void 0:l.serverInfo)===null||d===void 0)&&d.version&&jr((f=(h=this.engine.latestJoinResponse)===null||h===void 0?void 0:h.serverInfo)===null||f===void 0?void 0:f.version,"1.8.0")<0){u(Xe.builtIn("UNSUPPORTED_SERVER"));return}const p=crypto.randomUUID();yield this.publishRpcRequest(i,p,A,s,o-2e3);const g=setTimeout(()=>{this.pendingAcks.delete(p),u(Xe.builtIn("CONNECTION_TIMEOUT")),this.pendingResponses.delete(p),clearTimeout(v)},2e3);this.pendingAcks.set(p,{resolve:()=>{clearTimeout(g)},participantIdentity:i});const v=setTimeout(()=>{this.pendingResponses.delete(p),u(Xe.builtIn("RESPONSE_TIMEOUT"))},o);this.pendingResponses.set(p,{resolve:(y,b)=>{clearTimeout(v),this.pendingAcks.has(p)&&(console.warn("RPC response received before ack",p),this.pendingAcks.delete(p),clearTimeout(g)),b?u(b):c(y??"")},participantIdentity:i})}))}()})}registerRpcMethod(e,t){this.rpcHandlers.has(e)&&this.log.warn("you're overriding the RPC handler for method ".concat(e,", in the future this will throw an error")),this.rpcHandlers.set(e,t)}unregisterRpcMethod(e){this.rpcHandlers.delete(e)}setTrackSubscriptionPermissions(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];this.participantTrackPermissions=t,this.allParticipantsAllowedToSubscribe=e,this.engine.client.isDisconnected||this.updateTrackSubscriptionPermissions()}handleIncomingRpcAck(e){const t=this.pendingAcks.get(e);t?(t.resolve(),this.pendingAcks.delete(e)):console.error("Ack received for unexpected RPC request",e)}handleIncomingRpcResponse(e,t,r){const i=this.pendingResponses.get(e);i?(i.resolve(t,r),this.pendingResponses.delete(e)):console.error("Response received for unexpected RPC request",e)}publishRpcRequest(e,t,r,i,A){return S(this,void 0,void 0,function*(){const s=new Lt({destinationIdentities:[e],kind:he.RELIABLE,value:{case:"rpcRequest",value:new Em({id:t,method:r,payload:i,responseTimeoutMs:A,version:1})}});yield this.engine.sendDataPacket(s,he.RELIABLE)})}handleParticipantDisconnected(e){for(const[t,{participantIdentity:r}]of this.pendingAcks)r===e&&this.pendingAcks.delete(t);for(const[t,{participantIdentity:r,resolve:i}]of this.pendingResponses)r===e&&(i(null,Xe.builtIn("RECIPIENT_DISCONNECTED")),this.pendingResponses.delete(t))}setEnabledPublishCodecs(e){this.enabledPublishVideoCodecs=e.filter(t=>t.mime.split("/")[0].toLowerCase()==="video")}updateInfo(e){return super.updateInfo(e)?(e.tracks.forEach(t=>{var r,i;const A=this.trackPublications.get(t.sid);if(A){const s=A.isMuted||((i=(r=A.track)===null||r===void 0?void 0:r.isUpstreamPaused)!==null&&i!==void 0?i:!1);s!==t.muted&&(this.log.debug("updating server mute state after reconcile",Object.assign(Object.assign(Object.assign({},this.logContext),Ce(A)),{mutedOnServer:s})),this.engine.client.sendMuteTrack(t.sid,s))}}),!0):!1}getPublicationForTrack(e){let t;return this.trackPublications.forEach(r=>{const i=r.track;i&&(e instanceof MediaStreamTrack?(qr(i)||fr(i))&&i.mediaStreamTrack===e&&(t=r):e===i&&(t=r))}),t}waitForPendingPublicationOfSource(e){return S(this,void 0,void 0,function*(){const r=Date.now();for(;Date.now()<r+1e4;){const i=Array.from(this.pendingPublishPromises.entries()).find(A=>{let[s]=A;return s.source===e});if(i)return i[1];yield Dt(20)}})}}class Rx extends Hn{constructor(e,t,r,i){super(e,t.sid,t.name,i),this.track=void 0,this.allowed=!0,this.disabled=!1,this.currentVideoQuality=Xt.HIGH,this.handleEnded=A=>{this.setTrack(void 0),this.emit(M.Ended,A)},this.handleVisibilityChange=A=>{this.log.debug("adaptivestream video visibility ".concat(this.trackSid,", visible=").concat(A),this.logContext),this.disabled=!A,this.emitTrackUpdate()},this.handleVideoDimensionsChange=A=>{this.log.debug("adaptivestream video dimensions ".concat(A.width,"x").concat(A.height),this.logContext),this.videoDimensions=A,this.emitTrackUpdate()},this.subscribed=r,this.updateInfo(t)}setSubscribed(e){const t=this.subscriptionStatus,r=this.permissionStatus;this.subscribed=e,e&&(this.allowed=!0);const i=new No({trackSids:[this.trackSid],subscribe:this.subscribed,participantTracks:[new Fm({participantSid:"",trackSids:[this.trackSid]})]});this.emit(M.UpdateSubscription,i),this.emitSubscriptionUpdateIfChanged(t),this.emitPermissionUpdateIfChanged(r)}get subscriptionStatus(){return this.subscribed===!1?Hn.SubscriptionStatus.Unsubscribed:super.isSubscribed?Hn.SubscriptionStatus.Subscribed:Hn.SubscriptionStatus.Desired}get permissionStatus(){return this.allowed?Hn.PermissionStatus.Allowed:Hn.PermissionStatus.NotAllowed}get isSubscribed(){return this.subscribed===!1?!1:super.isSubscribed}get isDesired(){return this.subscribed!==!1}get isEnabled(){return!this.disabled}get isLocal(){return!1}setEnabled(e){!this.isManualOperationAllowed()||this.disabled===!e||(this.disabled=!e,this.emitTrackUpdate())}setVideoQuality(e){!this.isManualOperationAllowed()||this.currentVideoQuality===e||(this.currentVideoQuality=e,this.videoDimensions=void 0,this.emitTrackUpdate())}setVideoDimensions(e){var t,r;this.isManualOperationAllowed()&&(((t=this.videoDimensions)===null||t===void 0?void 0:t.width)===e.width&&((r=this.videoDimensions)===null||r===void 0?void 0:r.height)===e.height||(Ol(this.track)&&(this.videoDimensions=e),this.currentVideoQuality=void 0,this.emitTrackUpdate()))}setVideoFPS(e){this.isManualOperationAllowed()&&Ol(this.track)&&this.fps!==e&&(this.fps=e,this.emitTrackUpdate())}get videoQuality(){return this.currentVideoQuality}setTrack(e){const t=this.subscriptionStatus,r=this.permissionStatus,i=this.track;i!==e&&(i&&(i.off(M.VideoDimensionsChanged,this.handleVideoDimensionsChange),i.off(M.VisibilityChanged,this.handleVisibilityChange),i.off(M.Ended,this.handleEnded),i.detach(),i.stopMonitor(),this.emit(M.Unsubscribed,i)),super.setTrack(e),e&&(e.sid=this.trackSid,e.on(M.VideoDimensionsChanged,this.handleVideoDimensionsChange),e.on(M.VisibilityChanged,this.handleVisibilityChange),e.on(M.Ended,this.handleEnded),this.emit(M.Subscribed,e)),this.emitPermissionUpdateIfChanged(r),this.emitSubscriptionUpdateIfChanged(t))}setAllowed(e){const t=this.subscriptionStatus,r=this.permissionStatus;this.allowed=e,this.emitPermissionUpdateIfChanged(r),this.emitSubscriptionUpdateIfChanged(t)}setSubscriptionError(e){this.emit(M.SubscriptionFailed,e)}updateInfo(e){super.updateInfo(e);const t=this.metadataMuted;this.metadataMuted=e.muted,this.track?this.track.setMuted(e.muted):t!==e.muted&&this.emit(e.muted?M.Muted:M.Unmuted)}emitSubscriptionUpdateIfChanged(e){const t=this.subscriptionStatus;e!==t&&this.emit(M.SubscriptionStatusChanged,t,e)}emitPermissionUpdateIfChanged(e){this.permissionStatus!==e&&this.emit(M.SubscriptionPermissionChanged,this.permissionStatus,e)}isManualOperationAllowed(){return this.kind===P.Kind.Video&&this.isAdaptiveStream?(this.log.warn("adaptive stream is enabled, cannot change video track settings",this.logContext),!1):this.isDesired?!0:(this.log.warn("cannot update track settings when not subscribed",this.logContext),!1)}get isAdaptiveStream(){return Ol(this.track)&&this.track.isAdaptiveStream}emitTrackUpdate(){const e=new Hm({trackSids:[this.trackSid],disabled:this.disabled,fps:this.fps});this.videoDimensions?(e.width=Math.ceil(this.videoDimensions.width),e.height=Math.ceil(this.videoDimensions.height)):this.currentVideoQuality!==void 0?e.quality=this.currentVideoQuality:e.quality=Xt.HIGH,this.emit(M.UpdateSettings,e)}}class ca extends E0{static fromParticipantInfo(e,t,r){return new ca(e,t.sid,t.identity,t.name,t.metadata,t.attributes,r,t.kind)}get logContext(){return Object.assign(Object.assign({},super.logContext),{rpID:this.sid,remoteParticipant:this.identity})}constructor(e,t,r,i,A,s,o){let a=arguments.length>7&&arguments[7]!==void 0?arguments[7]:Ho.STANDARD;super(t,r||"",i,A,s,o,a),this.signalClient=e,this.trackPublications=new Map,this.audioTrackPublications=new Map,this.videoTrackPublications=new Map,this.volumeMap=new Map}addTrackPublication(e){super.addTrackPublication(e),e.on(M.UpdateSettings,t=>{this.log.debug("send update settings",Object.assign(Object.assign({},this.logContext),Ce(e))),this.signalClient.sendUpdateTrackSettings(t)}),e.on(M.UpdateSubscription,t=>{t.participantTracks.forEach(r=>{r.participantSid=this.sid}),this.signalClient.sendUpdateSubscription(t)}),e.on(M.SubscriptionPermissionChanged,t=>{this.emit(K.TrackSubscriptionPermissionChanged,e,t)}),e.on(M.SubscriptionStatusChanged,t=>{this.emit(K.TrackSubscriptionStatusChanged,e,t)}),e.on(M.Subscribed,t=>{this.emit(K.TrackSubscribed,t,e)}),e.on(M.Unsubscribed,t=>{this.emit(K.TrackUnsubscribed,t,e)}),e.on(M.SubscriptionFailed,t=>{this.emit(K.TrackSubscriptionFailed,e.trackSid,t)})}getTrackPublication(e){const t=super.getTrackPublication(e);if(t)return t}getTrackPublicationByName(e){const t=super.getTrackPublicationByName(e);if(t)return t}setVolume(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:P.Source.Microphone;this.volumeMap.set(t,e);const r=this.getTrackPublication(t);r&&r.track&&r.track.setVolume(e)}getVolume(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:P.Source.Microphone;const t=this.getTrackPublication(e);return t&&t.track?t.track.getVolume():this.volumeMap.get(e)}addSubscribedMediaTrack(e,t,r,i,A,s){let o=this.getTrackPublicationBySid(t);if(o||t.startsWith("TR")||this.trackPublications.forEach(u=>{!o&&e.kind===u.kind.toString()&&(o=u)}),!o){if(s===0){this.log.error("could not find published track",Object.assign(Object.assign({},this.logContext),{trackSid:t})),this.emit(K.TrackSubscriptionFailed,t);return}s===void 0&&(s=20),setTimeout(()=>{this.addSubscribedMediaTrack(e,t,r,i,A,s-1)},150);return}if(e.readyState==="ended"){this.log.error("unable to subscribe because MediaStreamTrack is ended. Do not call MediaStreamTrack.stop()",Object.assign(Object.assign({},this.logContext),Ce(o))),this.emit(K.TrackSubscriptionFailed,t);return}const a=e.kind==="video";let c;return a?c=new Ex(e,t,i,A):c=new kx(e,t,i,this.audioContext,this.audioOutput),c.source=o.source,c.isMuted=o.isMuted,c.setMediaStream(r),c.start(),o.setTrack(c),this.volumeMap.has(o.source)&&Pl(c)&&Dn(c)&&c.setVolume(this.volumeMap.get(o.source)),o}get hasMetadata(){return!!this.participantInfo}getTrackPublicationBySid(e){return this.trackPublications.get(e)}updateInfo(e){if(!super.updateInfo(e))return!1;const t=new Map,r=new Map;return e.tracks.forEach(i=>{var A,s;let o=this.getTrackPublicationBySid(i.sid);if(o)o.updateInfo(i);else{const a=P.kindFromProto(i.type);if(!a)return;o=new Rx(a,i,(A=this.signalClient.connectOptions)===null||A===void 0?void 0:A.autoSubscribe,{loggerContextCb:()=>this.logContext,loggerName:(s=this.loggerOptions)===null||s===void 0?void 0:s.loggerName}),o.updateInfo(i),r.set(i.sid,o);const c=Array.from(this.trackPublications.values()).find(u=>u.source===(o==null?void 0:o.source));c&&o.source!==P.Source.Unknown&&this.log.debug("received a second track publication for ".concat(this.identity," with the same source: ").concat(o.source),Object.assign(Object.assign({},this.logContext),{oldTrack:Ce(c),newTrack:Ce(o)})),this.addTrackPublication(o)}t.set(i.sid,o)}),this.trackPublications.forEach(i=>{t.has(i.trackSid)||(this.log.trace("detected removed track on remote participant, unpublishing",Object.assign(Object.assign({},this.logContext),Ce(i))),this.unpublishTrack(i.trackSid,!0))}),r.forEach(i=>{this.emit(K.TrackPublished,i)}),!0}unpublishTrack(e,t){const r=this.trackPublications.get(e);if(!r)return;const{track:i}=r;switch(i&&(i.stop(),r.setTrack(void 0)),this.trackPublications.delete(e),r.kind){case P.Kind.Audio:this.audioTrackPublications.delete(e);break;case P.Kind.Video:this.videoTrackPublications.delete(e);break}t&&this.emit(K.TrackUnpublished,r)}setAudioOutput(e){return S(this,void 0,void 0,function*(){this.audioOutput=e;const t=[];this.audioTrackPublications.forEach(r=>{var i;Dn(r.track)&&Pl(r.track)&&t.push(r.track.setSinkId((i=e.deviceId)!==null&&i!==void 0?i:"default"))}),yield Promise.all(t)})}emit(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return this.log.trace("participant event",Object.assign(Object.assign({},this.logContext),{event:e,args:r})),super.emit(e,...r)}}var pe;(function(n){n.Disconnected="disconnected",n.Connecting="connecting",n.Connected="connected",n.Reconnecting="reconnecting",n.SignalReconnecting="signalReconnecting"})(pe||(pe={}));const Px=4*1e3;class Mi extends _n.EventEmitter{constructor(e){var t,r,i,A;if(super(),t=this,this.state=pe.Disconnected,this.activeSpeakers=[],this.isE2EEEnabled=!1,this.audioEnabled=!0,this.isVideoPlaybackBlocked=!1,this.log=ce,this.bufferedEvents=[],this.isResuming=!1,this.byteStreamControllers=new Map,this.textStreamControllers=new Map,this.byteStreamHandlers=new Map,this.textStreamHandlers=new Map,this.rpcHandlers=new Map,this.connect=(s,o,a)=>S(this,void 0,void 0,function*(){var c;if(!BF())throw Sn()?Error("WebRTC isn't detected, have you called registerGlobals?"):Error("LiveKit doesn't seem to be supported on this browser. Try to update your browser and make sure no browser extensions are disabling webRTC.");const u=yield this.disconnectLock.lock();if(this.state===pe.Connected)return this.log.info("already connected to room ".concat(this.name),this.logContext),u(),Promise.resolve();if(this.connectFuture)return u(),this.connectFuture.promise;this.setAndEmitConnectionState(pe.Connecting),((c=this.regionUrlProvider)===null||c===void 0?void 0:c.getServerUrl().toString())!==s&&(this.regionUrl=void 0,this.regionUrlProvider=void 0),Tl(new URL(s))&&(this.regionUrlProvider===void 0?this.regionUrlProvider=new ed(s,o):this.regionUrlProvider.updateToken(o),this.regionUrlProvider.fetchRegionSettings().then(h=>{var f;(f=this.regionUrlProvider)===null||f===void 0||f.setServerReportedRegions(h)}).catch(h=>{this.log.warn("could not fetch region settings",Object.assign(Object.assign({},this.logContext),{error:h}))}));const l=(h,f,p)=>S(this,void 0,void 0,function*(){var g,v;this.abortController&&this.abortController.abort();const y=new AbortController;this.abortController=y,u==null||u();try{yield this.attemptConnection(p??s,o,a,y),this.abortController=void 0,h()}catch(b){if(this.regionUrlProvider&&b instanceof Ie&&b.reason!==le.Cancelled&&b.reason!==le.NotAllowed){let B=null;try{B=yield this.regionUrlProvider.getNextBestRegionUrl((g=this.abortController)===null||g===void 0?void 0:g.signal)}catch(w){if(w instanceof Ie&&(w.status===401||w.reason===le.Cancelled)){this.handleDisconnect(this.options.stopLocalTrackOnUnpublish),f(w);return}}B&&!(!((v=this.abortController)===null||v===void 0)&&v.signal.aborted)?(this.log.info("Initial connection failed with ConnectionError: ".concat(b.message,". Retrying with another region: ").concat(B),this.logContext),this.recreateEngine(),yield l(h,f,B)):(this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,Yv(b)),f(b))}else{let B=An.UNKNOWN_REASON;b instanceof Ie&&(B=Yv(b)),this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,B),f(b)}}}),d=this.regionUrl;return this.regionUrl=void 0,this.connectFuture=new Ql((h,f)=>{l(h,f,d)},()=>{this.clearConnectionFutures()}),this.connectFuture.promise}),this.connectSignal=(s,o,a,c,u,l)=>S(this,void 0,void 0,function*(){var d,h,f;const p=yield a.join(s,o,{autoSubscribe:c.autoSubscribe,adaptiveStream:typeof u.adaptiveStream=="object"?!0:u.adaptiveStream,maxRetries:c.maxRetries,e2eeEnabled:!!this.e2eeManager,websocketTimeout:c.websocketTimeout},l.signal);let g=p.serverInfo;if(g||(g={version:p.serverVersion,region:p.serverRegion}),this.serverInfo=g,this.log.debug("connected to Livekit Server ".concat(Object.entries(g).map(v=>{let[y,b]=v;return"".concat(y,": ").concat(b)}).join(", ")),{room:(d=p.room)===null||d===void 0?void 0:d.name,roomSid:(h=p.room)===null||h===void 0?void 0:h.sid,identity:(f=p.participant)===null||f===void 0?void 0:f.identity}),!g.version)throw new oF("unknown server version");return g.version==="0.15.1"&&this.options.dynacast&&(this.log.debug("disabling dynacast due to server version",this.logContext),u.dynacast=!1),p}),this.applyJoinResponse=s=>{const o=s.participant;if(this.localParticipant.sid=o.sid,this.localParticipant.identity=o.identity,this.localParticipant.setEnabledPublishCodecs(s.enabledPublishCodecs),this.options.e2ee&&this.e2eeManager)try{this.e2eeManager.setSifTrailer(s.sifTrailer)}catch(a){this.log.error(a instanceof Error?a.message:"Could not set SifTrailer",Object.assign(Object.assign({},this.logContext),{error:a}))}this.handleParticipantUpdates([o,...s.otherParticipants]),s.room&&this.handleRoomUpdate(s.room)},this.attemptConnection=(s,o,a,c)=>S(this,void 0,void 0,function*(){var u,l;this.state===pe.Reconnecting||this.isResuming||!((u=this.engine)===null||u===void 0)&&u.pendingReconnect?(this.log.info("Reconnection attempt replaced by new connection attempt",this.logContext),this.recreateEngine()):this.maybeCreateEngine(),!((l=this.regionUrlProvider)===null||l===void 0)&&l.isCloud()&&this.engine.setRegionUrlProvider(this.regionUrlProvider),this.acquireAudioContext(),this.connOptions=Object.assign(Object.assign({},ql),a),this.connOptions.rtcConfig&&(this.engine.rtcConfig=this.connOptions.rtcConfig),this.connOptions.peerConnectionTimeout&&(this.engine.peerConnectionTimeout=this.connOptions.peerConnectionTimeout);try{const d=yield this.connectSignal(s,o,this.engine,this.connOptions,this.options,c);this.applyJoinResponse(d),this.setupLocalParticipantEvents(),this.emit(O.SignalConnected)}catch(d){yield this.engine.close(),this.recreateEngine();const h=new Ie("could not establish signal connection",le.ServerUnreachable);throw d instanceof Error&&(h.message="".concat(h.message,": ").concat(d.message)),d instanceof Ie&&(h.reason=d.reason,h.status=d.status),this.log.debug("error trying to establish signal connection",Object.assign(Object.assign({},this.logContext),{error:d})),h}if(c.signal.aborted)throw yield this.engine.close(),this.recreateEngine(),new Ie("Connection attempt aborted",le.Cancelled);try{yield this.engine.waitForPCInitialConnection(this.connOptions.peerConnectionTimeout,c)}catch(d){throw yield this.engine.close(),this.recreateEngine(),d}Ht()&&this.options.disconnectOnPageLeave&&(window.addEventListener("pagehide",this.onPageLeave),window.addEventListener("beforeunload",this.onPageLeave)),Ht()&&document.addEventListener("freeze",this.onPageLeave),this.setAndEmitConnectionState(pe.Connected),this.emit(O.Connected),this.registerConnectionReconcile()}),this.disconnect=function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];return S(t,[...o],void 0,function(){var c=this;let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return function*(){var l,d,h,f;const p=yield c.disconnectLock.lock();try{if(c.state===pe.Disconnected){c.log.debug("already disconnected",c.logContext);return}c.log.info("disconnect from room",Object.assign({},c.logContext)),(c.state===pe.Connecting||c.state===pe.Reconnecting||c.isResuming)&&(c.log.warn("abort connection attempt",c.logContext),(l=c.abortController)===null||l===void 0||l.abort(),(h=(d=c.connectFuture)===null||d===void 0?void 0:d.reject)===null||h===void 0||h.call(d,new Ie("Client initiated disconnect",le.Cancelled)),c.connectFuture=void 0),!((f=c.engine)===null||f===void 0)&&f.client.isDisconnected||(yield c.engine.client.sendLeave()),c.engine&&(yield c.engine.close()),c.handleDisconnect(u,An.CLIENT_INITIATED),c.engine=void 0}finally{p()}}()})},this.onPageLeave=()=>S(this,void 0,void 0,function*(){this.log.info("Page leave detected, disconnecting",this.logContext),yield this.disconnect()}),this.startAudio=()=>S(this,void 0,void 0,function*(){const s=[],o=cn();if(o&&o.os==="iOS"){const a="livekit-dummy-audio-el";let c=document.getElementById(a);if(!c){c=document.createElement("audio"),c.id=a,c.autoplay=!0,c.hidden=!0;const u=xl();u.enabled=!0;const l=new MediaStream([u]);c.srcObject=l,document.addEventListener("visibilitychange",()=>{c&&(c.srcObject=document.hidden?null:l,document.hidden||(this.log.debug("page visible again, triggering startAudio to resume playback and update playback status",this.logContext),this.startAudio()))}),document.body.append(c),this.once(O.Disconnected,()=>{c==null||c.remove(),c=null})}s.push(c)}this.remoteParticipants.forEach(a=>{a.audioTrackPublications.forEach(c=>{c.track&&c.track.attachedElements.forEach(u=>{s.push(u)})})});try{yield Promise.all([this.acquireAudioContext(),...s.map(a=>(a.muted=!1,a.play()))]),this.handleAudioPlaybackStarted()}catch(a){throw this.handleAudioPlaybackFailed(a),a}}),this.startVideo=()=>S(this,void 0,void 0,function*(){const s=[];for(const o of this.remoteParticipants.values())o.videoTrackPublications.forEach(a=>{var c;(c=a.track)===null||c===void 0||c.attachedElements.forEach(u=>{s.includes(u)||s.push(u)})});yield Promise.all(s.map(o=>o.play())).then(()=>{this.handleVideoPlaybackStarted()}).catch(o=>{o.name==="NotAllowedError"?this.handleVideoPlaybackFailed():this.log.warn("Resuming video playback failed, make sure you call `startVideo` directly in a user gesture handler",this.logContext)})}),this.handleRestarting=()=>{this.clearConnectionReconcile(),this.isResuming=!1;for(const s of this.remoteParticipants.values())this.handleParticipantDisconnected(s.identity,s);this.setAndEmitConnectionState(pe.Reconnecting)&&this.emit(O.Reconnecting)},this.handleSignalRestarted=s=>S(this,void 0,void 0,function*(){this.log.debug("signal reconnected to server, region ".concat(s.serverRegion),Object.assign(Object.assign({},this.logContext),{region:s.serverRegion})),this.bufferedEvents=[],this.applyJoinResponse(s);try{yield this.localParticipant.republishAllTracks(void 0,!0)}catch(o){this.log.error("error trying to re-publish tracks after reconnection",Object.assign(Object.assign({},this.logContext),{error:o}))}try{yield this.engine.waitForRestarted(),this.log.debug("fully reconnected to server",Object.assign(Object.assign({},this.logContext),{region:s.serverRegion}))}catch{return}this.setAndEmitConnectionState(pe.Connected),this.emit(O.Reconnected),this.registerConnectionReconcile(),this.emitBufferedEvents()}),this.handleParticipantUpdates=s=>{s.forEach(o=>{var a;if(o.identity===this.localParticipant.identity){this.localParticipant.updateInfo(o);return}o.identity===""&&(o.identity=(a=this.sidToIdentity.get(o.sid))!==null&&a!==void 0?a:"");let c=this.remoteParticipants.get(o.identity);o.state===ki.DISCONNECTED?this.handleParticipantDisconnected(o.identity,c):c=this.getOrCreateParticipant(o.identity,o)})},this.handleActiveSpeakersUpdate=s=>{const o=[],a={};s.forEach(c=>{if(a[c.sid]=!0,c.sid===this.localParticipant.sid)this.localParticipant.audioLevel=c.level,this.localParticipant.setIsSpeaking(!0),o.push(this.localParticipant);else{const u=this.getRemoteParticipantBySid(c.sid);u&&(u.audioLevel=c.level,u.setIsSpeaking(!0),o.push(u))}}),a[this.localParticipant.sid]||(this.localParticipant.audioLevel=0,this.localParticipant.setIsSpeaking(!1)),this.remoteParticipants.forEach(c=>{a[c.sid]||(c.audioLevel=0,c.setIsSpeaking(!1))}),this.activeSpeakers=o,this.emitWhenConnected(O.ActiveSpeakersChanged,o)},this.handleSpeakersChanged=s=>{const o=new Map;this.activeSpeakers.forEach(c=>{const u=this.remoteParticipants.get(c.identity);u&&u.sid!==c.sid||o.set(c.sid,c)}),s.forEach(c=>{let u=this.getRemoteParticipantBySid(c.sid);c.sid===this.localParticipant.sid&&(u=this.localParticipant),u&&(u.audioLevel=c.level,u.setIsSpeaking(c.active),c.active?o.set(c.sid,u):o.delete(c.sid))});const a=Array.from(o.values());a.sort((c,u)=>u.audioLevel-c.audioLevel),this.activeSpeakers=a,this.emitWhenConnected(O.ActiveSpeakersChanged,a)},this.handleStreamStateUpdate=s=>{s.streamStates.forEach(o=>{const a=this.getRemoteParticipantBySid(o.participantSid);if(!a)return;const c=a.getTrackPublicationBySid(o.trackSid);if(!c||!c.track)return;const u=P.streamStateFromProto(o.state);u!==c.track.streamState&&(c.track.streamState=u,a.emit(K.TrackStreamStateChanged,c,c.track.streamState),this.emitWhenConnected(O.TrackStreamStateChanged,c,c.track.streamState,a))})},this.handleSubscriptionPermissionUpdate=s=>{const o=this.getRemoteParticipantBySid(s.participantSid);if(!o)return;const a=o.getTrackPublicationBySid(s.trackSid);a&&a.setAllowed(s.allowed)},this.handleSubscriptionError=s=>{const o=Array.from(this.remoteParticipants.values()).find(c=>c.trackPublications.has(s.trackSid));if(!o)return;const a=o.getTrackPublicationBySid(s.trackSid);a&&a.setSubscriptionError(s.err)},this.handleDataPacket=s=>{const o=this.remoteParticipants.get(s.participantIdentity);if(s.value.case==="user")this.handleUserPacket(o,s.value.value,s.kind);else if(s.value.case==="transcription")this.handleTranscription(o,s.value.value);else if(s.value.case==="sipDtmf")this.handleSipDtmf(o,s.value.value);else if(s.value.case==="chatMessage")this.handleChatMessage(o,s.value.value);else if(s.value.case==="metrics")this.handleMetrics(s.value.value,o);else if(s.value.case==="streamHeader")this.handleStreamHeader(s.value.value,s.participantIdentity);else if(s.value.case==="streamChunk")this.handleStreamChunk(s.value.value);else if(s.value.case==="streamTrailer")this.handleStreamTrailer(s.value.value);else if(s.value.case==="rpcRequest"){const a=s.value.value;this.handleIncomingRpcRequest(s.participantIdentity,a.id,a.method,a.payload,a.responseTimeoutMs,a.version)}},this.handleUserPacket=(s,o,a)=>{this.emit(O.DataReceived,o.payload,s,a,o.topic),s==null||s.emit(K.DataReceived,o.payload,a)},this.handleSipDtmf=(s,o)=>{this.emit(O.SipDTMFReceived,o,s),s==null||s.emit(K.SipDTMFReceived,o)},this.bufferedSegments=new Map,this.handleTranscription=(s,o)=>{const a=o.transcribedParticipantIdentity===this.localParticipant.identity?this.localParticipant:this.getParticipantByIdentity(o.transcribedParticipantIdentity),c=a==null?void 0:a.trackPublications.get(o.trackId),u=IF(o,this.transcriptionReceivedTimes);c==null||c.emit(M.TranscriptionReceived,u),a==null||a.emit(K.TranscriptionReceived,u,c),this.emit(O.TranscriptionReceived,u,a,c)},this.handleChatMessage=(s,o)=>{const a=FF(o);this.emit(O.ChatMessage,a,s)},this.handleMetrics=(s,o)=>{this.emit(O.MetricsReceived,s,o)},this.handleAudioPlaybackStarted=()=>{this.canPlaybackAudio||(this.audioEnabled=!0,this.emit(O.AudioPlaybackStatusChanged,!0))},this.handleAudioPlaybackFailed=s=>{this.log.warn("could not playback audio",Object.assign(Object.assign({},this.logContext),{error:s})),this.canPlaybackAudio&&(this.audioEnabled=!1,this.emit(O.AudioPlaybackStatusChanged,!1))},this.handleVideoPlaybackStarted=()=>{this.isVideoPlaybackBlocked&&(this.isVideoPlaybackBlocked=!1,this.emit(O.VideoPlaybackStatusChanged,!0))},this.handleVideoPlaybackFailed=()=>{this.isVideoPlaybackBlocked||(this.isVideoPlaybackBlocked=!0,this.emit(O.VideoPlaybackStatusChanged,!1))},this.handleDeviceChange=()=>S(this,void 0,void 0,function*(){var s,o,a;const c=pt.getInstance().previousDevices,u=yield pt.getInstance().getDevices(void 0,!1),l=cn();if((l==null?void 0:l.name)==="Chrome"&&l.os!=="iOS")for(let h of u){const f=c.find(p=>p.deviceId===h.deviceId);f&&f.label!==""&&f.kind===h.kind&&f.label!==h.label&&this.getActiveDevice(h.kind)==="default"&&this.emit(O.ActiveDeviceChanged,h.kind,h.deviceId)}const d=["audiooutput","audioinput","videoinput"];for(let h of d){const f=PF(h),p=this.localParticipant.getTrackPublication(f);if(p&&(!((s=p.track)===null||s===void 0)&&s.isUserProvided))continue;const g=u.filter(y=>y.kind===h),v=this.getActiveDevice(h);if(v===((o=c.filter(y=>y.kind===h)[0])===null||o===void 0?void 0:o.deviceId)&&g.length>0&&((a=g[0])===null||a===void 0?void 0:a.deviceId)!==v){yield this.switchActiveDevice(h,g[0].deviceId);continue}h==="audioinput"&&!hr()||h==="videoinput"||g.length>0&&!g.find(y=>y.deviceId===this.getActiveDevice(h))&&(yield this.switchActiveDevice(h,g[0].deviceId))}this.emit(O.MediaDevicesChanged)}),this.handleRoomUpdate=s=>{const o=this.roomInfo;this.roomInfo=s,o&&o.metadata!==s.metadata&&this.emitWhenConnected(O.RoomMetadataChanged,s.metadata),(o==null?void 0:o.activeRecording)!==s.activeRecording&&this.emitWhenConnected(O.RecordingStatusChanged,s.activeRecording)},this.handleConnectionQualityUpdate=s=>{s.updates.forEach(o=>{if(o.participantSid===this.localParticipant.sid){this.localParticipant.setConnectionQuality(o.quality);return}const a=this.getRemoteParticipantBySid(o.participantSid);a&&a.setConnectionQuality(o.quality)})},this.onLocalParticipantMetadataChanged=s=>{this.emit(O.ParticipantMetadataChanged,s,this.localParticipant)},this.onLocalParticipantNameChanged=s=>{this.emit(O.ParticipantNameChanged,s,this.localParticipant)},this.onLocalAttributesChanged=s=>{this.emit(O.ParticipantAttributesChanged,s,this.localParticipant)},this.onLocalTrackMuted=s=>{this.emit(O.TrackMuted,s,this.localParticipant)},this.onLocalTrackUnmuted=s=>{this.emit(O.TrackUnmuted,s,this.localParticipant)},this.onTrackProcessorUpdate=s=>{var o;(o=s==null?void 0:s.onPublish)===null||o===void 0||o.call(s,this)},this.onLocalTrackPublished=s=>S(this,void 0,void 0,function*(){var o,a,c,u,l,d;(o=s.track)===null||o===void 0||o.on(M.TrackProcessorUpdate,this.onTrackProcessorUpdate),(a=s.track)===null||a===void 0||a.on(M.Restarted,this.onLocalTrackRestarted),(l=(u=(c=s.track)===null||c===void 0?void 0:c.getProcessor())===null||u===void 0?void 0:u.onPublish)===null||l===void 0||l.call(u,this),this.emit(O.LocalTrackPublished,s,this.localParticipant),qr(s.track)&&(yield s.track.checkForSilence())&&this.emit(O.LocalAudioSilenceDetected,s);const h=yield(d=s.track)===null||d===void 0?void 0:d.getDeviceId(!1),f=t0(s.source);f&&h&&h!==this.localParticipant.activeDeviceMap.get(f)&&(this.localParticipant.activeDeviceMap.set(f,h),this.emit(O.ActiveDeviceChanged,f,h))}),this.onLocalTrackUnpublished=s=>{var o,a;(o=s.track)===null||o===void 0||o.off(M.TrackProcessorUpdate,this.onTrackProcessorUpdate),(a=s.track)===null||a===void 0||a.off(M.Restarted,this.onLocalTrackRestarted),this.emit(O.LocalTrackUnpublished,s,this.localParticipant)},this.onLocalTrackRestarted=s=>S(this,void 0,void 0,function*(){const o=yield s.getDeviceId(!1),a=t0(s.source);a&&o&&o!==this.localParticipant.activeDeviceMap.get(a)&&(this.log.debug("local track restarted, setting ".concat(a," ").concat(o," active"),this.logContext),this.localParticipant.activeDeviceMap.set(a,o),this.emit(O.ActiveDeviceChanged,a,o))}),this.onLocalConnectionQualityChanged=s=>{this.emit(O.ConnectionQualityChanged,s,this.localParticipant)},this.onMediaDevicesError=s=>{this.emit(O.MediaDevicesError,s)},this.onLocalParticipantPermissionsChanged=s=>{this.emit(O.ParticipantPermissionsChanged,s,this.localParticipant)},this.onLocalChatMessageSent=s=>{this.emit(O.ChatMessage,s,this.localParticipant)},this.setMaxListeners(100),this.remoteParticipants=new Map,this.sidToIdentity=new Map,this.options=Object.assign(Object.assign({},nx),e),this.log=Mn((r=this.options.loggerName)!==null&&r!==void 0?r:an.Room),this.transcriptionReceivedTimes=new Map,this.options.audioCaptureDefaults=Object.assign(Object.assign({},d0),e==null?void 0:e.audioCaptureDefaults),this.options.videoCaptureDefaults=Object.assign(Object.assign({},h0),e==null?void 0:e.videoCaptureDefaults),this.options.publishDefaults=Object.assign(Object.assign({},tx),e==null?void 0:e.publishDefaults),this.maybeCreateEngine(),this.disconnectLock=new Ot,this.localParticipant=new Qx("","",this.engine,this.options,this.rpcHandlers),this.options.videoCaptureDefaults.deviceId&&this.localParticipant.activeDeviceMap.set("videoinput",pr(this.options.videoCaptureDefaults.deviceId)),this.options.audioCaptureDefaults.deviceId&&this.localParticipant.activeDeviceMap.set("audioinput",pr(this.options.audioCaptureDefaults.deviceId)),!((i=this.options.audioOutput)===null||i===void 0)&&i.deviceId&&this.switchActiveDevice("audiooutput",pr(this.options.audioOutput.deviceId)).catch(s=>this.log.warn("Could not set audio output: ".concat(s.message),this.logContext)),this.options.e2ee&&this.setupE2EE(),Ht()){const s=new AbortController;(A=navigator.mediaDevices)===null||A===void 0||A.addEventListener("devicechange",this.handleDeviceChange,{signal:s.signal}),Mi.cleanupRegistry&&Mi.cleanupRegistry.register(this,()=>{s.abort()})}}registerTextStreamHandler(e,t){if(this.textStreamHandlers.has(e))throw new TypeError('A text stream handler for topic "'.concat(e,'" has already been set.'));this.textStreamHandlers.set(e,t)}unregisterTextStreamHandler(e){this.textStreamHandlers.delete(e)}registerByteStreamHandler(e,t){if(this.byteStreamHandlers.has(e))throw new TypeError('A byte stream handler for topic "'.concat(e,'" has already been set.'));this.byteStreamHandlers.set(e,t)}unregisterByteStreamHandler(e){this.byteStreamHandlers.delete(e)}registerRpcMethod(e,t){if(this.rpcHandlers.has(e))throw Error("RPC handler already registered for method ".concat(e,", unregisterRpcMethod before trying to register again"));this.rpcHandlers.set(e,t)}unregisterRpcMethod(e){this.rpcHandlers.delete(e)}handleIncomingRpcRequest(e,t,r,i,A,s){return S(this,void 0,void 0,function*(){if(yield this.engine.publishRpcAck(e,t),s!==1){yield this.engine.publishRpcResponse(e,t,null,Xe.builtIn("UNSUPPORTED_VERSION"));return}const o=this.rpcHandlers.get(r);if(!o){yield this.engine.publishRpcResponse(e,t,null,Xe.builtIn("UNSUPPORTED_METHOD"));return}let a=null,c=null;try{const u=yield o({requestId:t,callerIdentity:e,payload:i,responseTimeout:A});Jl(u)>p0?(a=Xe.builtIn("RESPONSE_PAYLOAD_TOO_LARGE"),console.warn("RPC Response payload too large for ".concat(r))):c=u}catch(u){u instanceof Xe?a=u:(console.warn("Uncaught error returned by RPC handler for ".concat(r,". Returning APPLICATION_ERROR instead."),u),a=Xe.builtIn("APPLICATION_ERROR"))}yield this.engine.publishRpcResponse(e,t,c,a)})}setE2EEEnabled(e){return S(this,void 0,void 0,function*(){if(this.e2eeManager)yield Promise.all([this.localParticipant.setE2EEEnabled(e)]),this.localParticipant.identity!==""&&this.e2eeManager.setParticipantCryptorEnabled(e,this.localParticipant.identity);else throw Error("e2ee not configured, please set e2ee settings within the room options")})}setupE2EE(){var e;this.options.e2ee&&("e2eeManager"in this.options.e2ee?this.e2eeManager=this.options.e2ee.e2eeManager:this.e2eeManager=new NF(this.options.e2ee),this.e2eeManager.on(lr.ParticipantEncryptionStatusChanged,(t,r)=>{QF(r)&&(this.isE2EEEnabled=t),this.emit(O.ParticipantEncryptionStatusChanged,t,r)}),this.e2eeManager.on(lr.EncryptionError,t=>this.emit(O.EncryptionError,t)),(e=this.e2eeManager)===null||e===void 0||e.setup(this))}get logContext(){var e;return{room:this.name,roomID:(e=this.roomInfo)===null||e===void 0?void 0:e.sid,participant:this.localParticipant.identity,pID:this.localParticipant.sid}}get isRecording(){var e,t;return(t=(e=this.roomInfo)===null||e===void 0?void 0:e.activeRecording)!==null&&t!==void 0?t:!1}getSid(){return S(this,void 0,void 0,function*(){return this.state===pe.Disconnected?"":this.roomInfo&&this.roomInfo.sid!==""?this.roomInfo.sid:new Promise((e,t)=>{const r=i=>{i.sid!==""&&(this.engine.off(L.RoomUpdate,r),e(i.sid))};this.engine.on(L.RoomUpdate,r),this.once(O.Disconnected,()=>{this.engine.off(L.RoomUpdate,r),t("Room disconnected before room server id was available")})})})}get name(){var e,t;return(t=(e=this.roomInfo)===null||e===void 0?void 0:e.name)!==null&&t!==void 0?t:""}get metadata(){var e;return(e=this.roomInfo)===null||e===void 0?void 0:e.metadata}get numParticipants(){var e,t;return(t=(e=this.roomInfo)===null||e===void 0?void 0:e.numParticipants)!==null&&t!==void 0?t:0}get numPublishers(){var e,t;return(t=(e=this.roomInfo)===null||e===void 0?void 0:e.numPublishers)!==null&&t!==void 0?t:0}maybeCreateEngine(){this.engine&&!this.engine.isClosed||(this.engine=new vx(this.options),this.engine.on(L.ParticipantUpdate,this.handleParticipantUpdates).on(L.RoomUpdate,this.handleRoomUpdate).on(L.SpeakersChanged,this.handleSpeakersChanged).on(L.StreamStateChanged,this.handleStreamStateUpdate).on(L.ConnectionQualityUpdate,this.handleConnectionQualityUpdate).on(L.SubscriptionError,this.handleSubscriptionError).on(L.SubscriptionPermissionUpdate,this.handleSubscriptionPermissionUpdate).on(L.MediaTrackAdded,(e,t,r)=>{this.onTrackAdded(e,t,r)}).on(L.Disconnected,e=>{this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,e)}).on(L.ActiveSpeakersUpdate,this.handleActiveSpeakersUpdate).on(L.DataPacketReceived,this.handleDataPacket).on(L.Resuming,()=>{this.clearConnectionReconcile(),this.isResuming=!0,this.log.info("Resuming signal connection",this.logContext),this.setAndEmitConnectionState(pe.SignalReconnecting)&&this.emit(O.SignalReconnecting)}).on(L.Resumed,()=>{this.registerConnectionReconcile(),this.isResuming=!1,this.log.info("Resumed signal connection",this.logContext),this.updateSubscriptions(),this.emitBufferedEvents(),this.setAndEmitConnectionState(pe.Connected)&&this.emit(O.Reconnected)}).on(L.SignalResumed,()=>{this.bufferedEvents=[],(this.state===pe.Reconnecting||this.isResuming)&&this.sendSyncState()}).on(L.Restarting,this.handleRestarting).on(L.SignalRestarted,this.handleSignalRestarted).on(L.Offline,()=>{this.setAndEmitConnectionState(pe.Reconnecting)&&this.emit(O.Reconnecting)}).on(L.DCBufferStatusChanged,(e,t)=>{this.emit(O.DCBufferStatusChanged,e,t)}).on(L.LocalTrackSubscribed,e=>{const t=this.localParticipant.getTrackPublications().find(r=>{let{trackSid:i}=r;return i===e});if(!t){this.log.warn("could not find local track subscription for subscribed event",this.logContext);return}this.localParticipant.emit(K.LocalTrackSubscribed,t),this.emitWhenConnected(O.LocalTrackSubscribed,t,this.localParticipant)}).on(L.RoomMoved,e=>{this.log.debug("room moved",e),e.room&&this.handleRoomUpdate(e.room),this.remoteParticipants.forEach((t,r)=>{this.handleParticipantDisconnected(r,t)}),this.emit(O.Moved,e.room.name,e.token),e.participant?this.handleParticipantUpdates([e.participant,...e.otherParticipants]):this.handleParticipantUpdates(e.otherParticipants)}),this.localParticipant&&this.localParticipant.setupEngine(this.engine),this.e2eeManager&&this.e2eeManager.setupEngine(this.engine))}static getLocalDevices(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return pt.getInstance().getDevices(e,t)}prepareConnection(e,t){return S(this,void 0,void 0,function*(){if(this.state===pe.Disconnected){this.log.debug("prepareConnection to ".concat(e),this.logContext);try{if(Tl(new URL(e))&&t){this.regionUrlProvider=new ed(e,t);const r=yield this.regionUrlProvider.getNextBestRegionUrl();r&&this.state===pe.Disconnected&&(this.regionUrl=r,yield fetch(Rl(r),{method:"HEAD"}),this.log.debug("prepared connection to ".concat(r),this.logContext))}else yield fetch(Rl(e),{method:"HEAD"})}catch(r){this.log.warn("could not prepare connection",Object.assign(Object.assign({},this.logContext),{error:r}))}}})}getParticipantByIdentity(e){return this.localParticipant.identity===e?this.localParticipant:this.remoteParticipants.get(e)}clearConnectionFutures(){this.connectFuture=void 0}simulateScenario(e,t){return S(this,void 0,void 0,function*(){let r=()=>{},i;switch(e){case"signal-reconnect":yield this.engine.client.handleOnClose("simulate disconnect");break;case"speaker":i=new Cn({scenario:{case:"speakerUpdate",value:3}});break;case"node-failure":i=new Cn({scenario:{case:"nodeFailure",value:!0}});break;case"server-leave":i=new Cn({scenario:{case:"serverLeave",value:!0}});break;case"migration":i=new Cn({scenario:{case:"migration",value:!0}});break;case"resume-reconnect":this.engine.failNext(),yield this.engine.client.handleOnClose("simulate resume-disconnect");break;case"disconnect-signal-on-resume":r=()=>S(this,void 0,void 0,function*(){yield this.engine.client.handleOnClose("simulate resume-disconnect")}),i=new Cn({scenario:{case:"disconnectSignalOnResume",value:!0}});break;case"disconnect-signal-on-resume-no-messages":r=()=>S(this,void 0,void 0,function*(){yield this.engine.client.handleOnClose("simulate resume-disconnect")}),i=new Cn({scenario:{case:"disconnectSignalOnResumeNoMessages",value:!0}});break;case"full-reconnect":this.engine.fullReconnectOnNext=!0,yield this.engine.client.handleOnClose("simulate full-reconnect");break;case"force-tcp":case"force-tls":i=new Cn({scenario:{case:"switchCandidateProtocol",value:e==="force-tls"?2:1}}),r=()=>S(this,void 0,void 0,function*(){const A=this.engine.client.onLeave;A&&A(new Ko({reason:An.CLIENT_INITIATED,action:Ui.RECONNECT}))});break;case"subscriber-bandwidth":if(t===void 0||typeof t!="number")throw new Error("subscriber-bandwidth requires a number as argument");i=new Cn({scenario:{case:"subscriberBandwidth",value:Wr(t)}});break;case"leave-full-reconnect":i=new Cn({scenario:{case:"leaveRequestFullReconnect",value:!0}})}i&&(yield this.engine.client.sendSimulateScenario(i),yield r())})}get canPlaybackAudio(){return this.audioEnabled}get canPlaybackVideo(){return!this.isVideoPlaybackBlocked}getActiveDevice(e){return this.localParticipant.activeDeviceMap.get(e)}switchActiveDevice(e,t){return S(this,arguments,void 0,function(r,i){var A=this;let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return function*(){var o,a,c,u,l,d,h,f;let p=!0,g=!1;const v=s?{exact:i}:i;if(r==="audioinput"){g=A.localParticipant.audioTrackPublications.size===0;const y=(o=A.getActiveDevice(r))!==null&&o!==void 0?o:A.options.audioCaptureDefaults.deviceId;A.options.audioCaptureDefaults.deviceId=v;const b=Array.from(A.localParticipant.audioTrackPublications.values()).filter(B=>B.source===P.Source.Microphone);try{p=(yield Promise.all(b.map(B=>{var w;return(w=B.audioTrack)===null||w===void 0?void 0:w.setDeviceId(v)}))).every(B=>B===!0)}catch(B){throw A.options.audioCaptureDefaults.deviceId=y,B}}else if(r==="videoinput"){g=A.localParticipant.videoTrackPublications.size===0;const y=(a=A.getActiveDevice(r))!==null&&a!==void 0?a:A.options.videoCaptureDefaults.deviceId;A.options.videoCaptureDefaults.deviceId=v;const b=Array.from(A.localParticipant.videoTrackPublications.values()).filter(B=>B.source===P.Source.Camera);try{p=(yield Promise.all(b.map(B=>{var w;return(w=B.videoTrack)===null||w===void 0?void 0:w.setDeviceId(v)}))).every(B=>B===!0)}catch(B){throw A.options.videoCaptureDefaults.deviceId=y,B}}else if(r==="audiooutput"){if(!Ul()&&!A.options.webAudioMix||A.options.webAudioMix&&A.audioContext&&!("setSinkId"in A.audioContext))throw new Error("cannot switch audio output, setSinkId not supported");A.options.webAudioMix&&(i=(c=yield pt.getInstance().normalizeDeviceId("audiooutput",i))!==null&&c!==void 0?c:""),(u=(f=A.options).audioOutput)!==null&&u!==void 0||(f.audioOutput={});const y=(l=A.getActiveDevice(r))!==null&&l!==void 0?l:A.options.audioOutput.deviceId;A.options.audioOutput.deviceId=i;try{A.options.webAudioMix&&((d=A.audioContext)===null||d===void 0||d.setSinkId(i)),yield Promise.all(Array.from(A.remoteParticipants.values()).map(b=>b.setAudioOutput({deviceId:i})))}catch(b){throw A.options.audioOutput.deviceId=y,b}}return(g||r==="audiooutput")&&(A.localParticipant.activeDeviceMap.set(r,r==="audiooutput"&&((h=A.options.audioOutput)===null||h===void 0?void 0:h.deviceId)||i),A.emit(O.ActiveDeviceChanged,r,i)),p}()})}setupLocalParticipantEvents(){this.localParticipant.on(K.ParticipantMetadataChanged,this.onLocalParticipantMetadataChanged).on(K.ParticipantNameChanged,this.onLocalParticipantNameChanged).on(K.AttributesChanged,this.onLocalAttributesChanged).on(K.TrackMuted,this.onLocalTrackMuted).on(K.TrackUnmuted,this.onLocalTrackUnmuted).on(K.LocalTrackPublished,this.onLocalTrackPublished).on(K.LocalTrackUnpublished,this.onLocalTrackUnpublished).on(K.ConnectionQualityChanged,this.onLocalConnectionQualityChanged).on(K.MediaDevicesError,this.onMediaDevicesError).on(K.AudioStreamAcquired,this.startAudio).on(K.ChatMessage,this.onLocalChatMessageSent).on(K.ParticipantPermissionsChanged,this.onLocalParticipantPermissionsChanged)}recreateEngine(){var e;(e=this.engine)===null||e===void 0||e.close(),this.engine=void 0,this.isResuming=!1,this.remoteParticipants.clear(),this.sidToIdentity.clear(),this.bufferedEvents=[],this.maybeCreateEngine()}onTrackAdded(e,t,r){if(this.state===pe.Connecting||this.state===pe.Reconnecting){const u=()=>{this.onTrackAdded(e,t,r),l()},l=()=>{this.off(O.Reconnected,u),this.off(O.Connected,u),this.off(O.Disconnected,l)};this.once(O.Reconnected,u),this.once(O.Connected,u),this.once(O.Disconnected,l);return}if(this.state===pe.Disconnected){this.log.warn("skipping incoming track after Room disconnected",this.logContext);return}if(e.readyState==="ended"){this.log.info("skipping incoming track as it already ended",this.logContext);return}const i=yF(t.id),A=i[0];let s=i[1],o=e.id;if(s&&s.startsWith("TR")&&(o=s),A===this.localParticipant.sid){this.log.warn("tried to create RemoteParticipant for local participant",this.logContext);return}const a=Array.from(this.remoteParticipants.values()).find(u=>u.sid===A);if(!a){this.log.error("Tried to add a track for a participant, that's not present. Sid: ".concat(A),this.logContext);return}let c;this.options.adaptiveStream&&(typeof this.options.adaptiveStream=="object"?c=this.options.adaptiveStream:c={}),a.addSubscribedMediaTrack(e,o,t,r,c)}handleDisconnect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1?arguments[1]:void 0;var r;if(this.clearConnectionReconcile(),this.isResuming=!1,this.bufferedEvents=[],this.transcriptionReceivedTimes.clear(),this.state!==pe.Disconnected){this.regionUrl=void 0;try{this.remoteParticipants.forEach(i=>{i.trackPublications.forEach(A=>{i.unpublishTrack(A.trackSid)})}),this.localParticipant.trackPublications.forEach(i=>{var A,s,o;i.track&&this.localParticipant.unpublishTrack(i.track,e),e?((A=i.track)===null||A===void 0||A.detach(),(s=i.track)===null||s===void 0||s.stop()):(o=i.track)===null||o===void 0||o.stopMonitor()}),this.localParticipant.off(K.ParticipantMetadataChanged,this.onLocalParticipantMetadataChanged).off(K.ParticipantNameChanged,this.onLocalParticipantNameChanged).off(K.AttributesChanged,this.onLocalAttributesChanged).off(K.TrackMuted,this.onLocalTrackMuted).off(K.TrackUnmuted,this.onLocalTrackUnmuted).off(K.LocalTrackPublished,this.onLocalTrackPublished).off(K.LocalTrackUnpublished,this.onLocalTrackUnpublished).off(K.ConnectionQualityChanged,this.onLocalConnectionQualityChanged).off(K.MediaDevicesError,this.onMediaDevicesError).off(K.AudioStreamAcquired,this.startAudio).off(K.ChatMessage,this.onLocalChatMessageSent).off(K.ParticipantPermissionsChanged,this.onLocalParticipantPermissionsChanged),this.localParticipant.trackPublications.clear(),this.localParticipant.videoTrackPublications.clear(),this.localParticipant.audioTrackPublications.clear(),this.remoteParticipants.clear(),this.sidToIdentity.clear(),this.activeSpeakers=[],this.audioContext&&typeof this.options.webAudioMix=="boolean"&&(this.audioContext.close(),this.audioContext=void 0),Ht()&&(window.removeEventListener("beforeunload",this.onPageLeave),window.removeEventListener("pagehide",this.onPageLeave),window.removeEventListener("freeze",this.onPageLeave),(r=navigator.mediaDevices)===null||r===void 0||r.removeEventListener("devicechange",this.handleDeviceChange))}finally{this.setAndEmitConnectionState(pe.Disconnected),this.emit(O.Disconnected,t)}}}handleParticipantDisconnected(e,t){var r;this.remoteParticipants.delete(e),t&&(t.trackPublications.forEach(i=>{t.unpublishTrack(i.trackSid,!0)}),this.emit(O.ParticipantDisconnected,t),t.setDisconnected(),(r=this.localParticipant)===null||r===void 0||r.handleParticipantDisconnected(t.identity))}handleStreamHeader(e,t){return S(this,void 0,void 0,function*(){var r;if(e.contentHeader.case==="byteHeader"){const i=this.byteStreamHandlers.get(e.topic);if(!i){this.log.debug("ignoring incoming byte stream due to no handler for topic",e.topic);return}let A;const s={id:e.streamId,name:(r=e.contentHeader.value.name)!==null&&r!==void 0?r:"unknown",mimeType:e.mimeType,size:e.totalLength?Number(e.totalLength):void 0,topic:e.topic,timestamp:ta(e.timestamp),attributes:e.attributes},o=new ReadableStream({start:a=>{A=a,this.byteStreamControllers.set(e.streamId,{info:s,controller:A,startTime:Date.now()})}});i(new Bx(s,o,ta(e.totalLength)),{identity:t})}else if(e.contentHeader.case==="textHeader"){const i=this.textStreamHandlers.get(e.topic);if(!i){this.log.debug("ignoring incoming text stream due to no handler for topic",e.topic);return}let A;const s={id:e.streamId,mimeType:e.mimeType,size:e.totalLength?Number(e.totalLength):void 0,topic:e.topic,timestamp:Number(e.timestamp),attributes:e.attributes},o=new ReadableStream({start:a=>{A=a,this.textStreamControllers.set(e.streamId,{info:s,controller:A,startTime:Date.now()})}});i(new Cx(s,o,ta(e.totalLength)),{identity:t})}})}handleStreamChunk(e){const t=this.byteStreamControllers.get(e.streamId);t&&e.content.length>0&&t.controller.enqueue(e);const r=this.textStreamControllers.get(e.streamId);r&&e.content.length>0&&r.controller.enqueue(e)}handleStreamTrailer(e){const t=this.textStreamControllers.get(e.streamId);t&&(t.info.attributes=Object.assign(Object.assign({},t.info.attributes),e.attributes),t.controller.close(),this.textStreamControllers.delete(e.streamId));const r=this.byteStreamControllers.get(e.streamId);r&&(r.info.attributes=Object.assign(Object.assign({},r.info.attributes),e.attributes),r.controller.close(),this.byteStreamControllers.delete(e.streamId))}acquireAudioContext(){return S(this,void 0,void 0,function*(){var e,t;if(typeof this.options.webAudioMix!="boolean"&&this.options.webAudioMix.audioContext?this.audioContext=this.options.webAudioMix.audioContext:(!this.audioContext||this.audioContext.state==="closed")&&(this.audioContext=(e=e0())!==null&&e!==void 0?e:void 0),this.options.webAudioMix&&this.remoteParticipants.forEach(i=>i.setAudioContext(this.audioContext)),this.localParticipant.setAudioContext(this.audioContext),this.audioContext&&this.audioContext.state==="suspended")try{yield Promise.race([this.audioContext.resume(),Dt(200)])}catch(i){this.log.warn("Could not resume audio context",Object.assign(Object.assign({},this.logContext),{error:i}))}const r=((t=this.audioContext)===null||t===void 0?void 0:t.state)==="running";r!==this.canPlaybackAudio&&(this.audioEnabled=r,this.emit(O.AudioPlaybackStatusChanged,r))})}createParticipant(e,t){var r;let i;return t?i=ca.fromParticipantInfo(this.engine.client,t,{loggerContextCb:()=>this.logContext,loggerName:this.options.loggerName}):i=new ca(this.engine.client,"",e,void 0,void 0,void 0,{loggerContextCb:()=>this.logContext,loggerName:this.options.loggerName}),this.options.webAudioMix&&i.setAudioContext(this.audioContext),!((r=this.options.audioOutput)===null||r===void 0)&&r.deviceId&&i.setAudioOutput(this.options.audioOutput).catch(A=>this.log.warn("Could not set audio output: ".concat(A.message),this.logContext)),i}getOrCreateParticipant(e,t){if(this.remoteParticipants.has(e)){const i=this.remoteParticipants.get(e);return t&&i.updateInfo(t)&&this.sidToIdentity.set(t.sid,t.identity),i}const r=this.createParticipant(e,t);return this.remoteParticipants.set(e,r),this.sidToIdentity.set(t.sid,t.identity),this.emitWhenConnected(O.ParticipantConnected,r),r.on(K.TrackPublished,i=>{this.emitWhenConnected(O.TrackPublished,i,r)}).on(K.TrackSubscribed,(i,A)=>{i.kind===P.Kind.Audio?(i.on(M.AudioPlaybackStarted,this.handleAudioPlaybackStarted),i.on(M.AudioPlaybackFailed,this.handleAudioPlaybackFailed)):i.kind===P.Kind.Video&&(i.on(M.VideoPlaybackFailed,this.handleVideoPlaybackFailed),i.on(M.VideoPlaybackStarted,this.handleVideoPlaybackStarted)),this.emit(O.TrackSubscribed,i,A,r)}).on(K.TrackUnpublished,i=>{this.emit(O.TrackUnpublished,i,r)}).on(K.TrackUnsubscribed,(i,A)=>{this.emit(O.TrackUnsubscribed,i,A,r)}).on(K.TrackMuted,i=>{this.emitWhenConnected(O.TrackMuted,i,r)}).on(K.TrackUnmuted,i=>{this.emitWhenConnected(O.TrackUnmuted,i,r)}).on(K.ParticipantMetadataChanged,i=>{this.emitWhenConnected(O.ParticipantMetadataChanged,i,r)}).on(K.ParticipantNameChanged,i=>{this.emitWhenConnected(O.ParticipantNameChanged,i,r)}).on(K.AttributesChanged,i=>{this.emitWhenConnected(O.ParticipantAttributesChanged,i,r)}).on(K.ConnectionQualityChanged,i=>{this.emitWhenConnected(O.ConnectionQualityChanged,i,r)}).on(K.ParticipantPermissionsChanged,i=>{this.emitWhenConnected(O.ParticipantPermissionsChanged,i,r)}).on(K.TrackSubscriptionStatusChanged,(i,A)=>{this.emitWhenConnected(O.TrackSubscriptionStatusChanged,i,A,r)}).on(K.TrackSubscriptionFailed,(i,A)=>{this.emit(O.TrackSubscriptionFailed,i,r,A)}).on(K.TrackSubscriptionPermissionChanged,(i,A)=>{this.emitWhenConnected(O.TrackSubscriptionPermissionChanged,i,A,r)}).on(K.Active,()=>{this.emitWhenConnected(O.ParticipantActive,r)}),t&&r.updateInfo(t),r}sendSyncState(){const e=Array.from(this.remoteParticipants.values()).reduce((r,i)=>(r.push(...i.getTrackPublications()),r),[]),t=this.localParticipant.getTrackPublications();this.engine.sendSyncState(e,t)}updateSubscriptions(){for(const e of this.remoteParticipants.values())for(const t of e.videoTrackPublications.values())t.isSubscribed&&xF(t)&&t.emitTrackUpdate()}getRemoteParticipantBySid(e){const t=this.sidToIdentity.get(e);if(t)return this.remoteParticipants.get(t)}registerConnectionReconcile(){this.clearConnectionReconcile();let e=0;this.connectionReconcileInterval=yt.setInterval(()=>{!this.engine||this.engine.isClosed||!this.engine.verifyTransport()?(e++,this.log.warn("detected connection state mismatch",Object.assign(Object.assign({},this.logContext),{numFailures:e,engine:this.engine?{closed:this.engine.isClosed,transportsConnected:this.engine.verifyTransport()}:void 0})),e>=3&&(this.recreateEngine(),this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,An.STATE_MISMATCH))):e=0},Px)}clearConnectionReconcile(){this.connectionReconcileInterval&&yt.clearInterval(this.connectionReconcileInterval)}setAndEmitConnectionState(e){return e===this.state?!1:(this.state=e,this.emit(O.ConnectionStateChanged,this.state),!0)}emitBufferedEvents(){this.bufferedEvents.forEach(e=>{let[t,r]=e;this.emit(t,...r)}),this.bufferedEvents=[]}emitWhenConnected(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];if(this.state===pe.Reconnecting||this.isResuming||!this.engine||this.engine.pendingReconnect)this.bufferedEvents.push([e,r]);else if(this.state===pe.Connected)return this.emit(e,...r);return!1}simulateParticipants(e){return S(this,void 0,void 0,function*(){var t,r;const i=Object.assign({audio:!0,video:!0,useRealTracks:!1},e.publish),A=Object.assign({count:9,audio:!1,video:!0,aspectRatios:[1.66,1.7,1.3]},e.participants);if(this.handleDisconnect(),this.roomInfo=new Lo({sid:"RM_SIMULATED",name:"simulated-room",emptyTimeout:0,maxParticipants:0,creationTime:Ne.parse(new Date().getTime()),metadata:"",numParticipants:1,numPublishers:1,turnPassword:"",enabledCodecs:[],activeRecording:!1}),this.localParticipant.updateInfo(new Nr({identity:"simulated-local",name:"local-name"})),this.setupLocalParticipantEvents(),this.emit(O.SignalConnected),this.emit(O.Connected),this.setAndEmitConnectionState(pe.Connected),i.video){const s=new rd(P.Kind.Video,new Ei({source:ot.CAMERA,sid:Math.floor(Math.random()*1e4).toString(),type:rn.AUDIO,name:"video-dummy"}),new oa(i.useRealTracks?(yield window.navigator.mediaDevices.getUserMedia({video:!0})).getVideoTracks()[0]:Xv(160*((t=A.aspectRatios[0])!==null&&t!==void 0?t:1),160,!0,!0),void 0,!1,{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext}),{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext});this.localParticipant.addTrackPublication(s),this.localParticipant.emit(K.LocalTrackPublished,s)}if(i.audio){const s=new rd(P.Kind.Audio,new Ei({source:ot.MICROPHONE,sid:Math.floor(Math.random()*1e4).toString(),type:rn.AUDIO}),new Aa(i.useRealTracks?(yield navigator.mediaDevices.getUserMedia({audio:!0})).getAudioTracks()[0]:xl(),void 0,!1,this.audioContext,{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext}),{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext});this.localParticipant.addTrackPublication(s),this.localParticipant.emit(K.LocalTrackPublished,s)}for(let s=0;s<A.count-1;s+=1){let o=new Nr({sid:Math.floor(Math.random()*1e4).toString(),identity:"simulated-".concat(s),state:ki.ACTIVE,tracks:[],joinedAt:Ne.parse(Date.now())});const a=this.getOrCreateParticipant(o.identity,o);if(A.video){const c=Xv(160*((r=A.aspectRatios[s%A.aspectRatios.length])!==null&&r!==void 0?r:1),160,!1,!0),u=new Ei({source:ot.CAMERA,sid:Math.floor(Math.random()*1e4).toString(),type:rn.AUDIO});a.addSubscribedMediaTrack(c,u.sid,new MediaStream([c]),new RTCRtpReceiver),o.tracks=[...o.tracks,u]}if(A.audio){const c=xl(),u=new Ei({source:ot.MICROPHONE,sid:Math.floor(Math.random()*1e4).toString(),type:rn.AUDIO});a.addSubscribedMediaTrack(c,u.sid,new MediaStream([c]),new RTCRtpReceiver),o.tracks=[...o.tracks,u]}a.updateInfo(o)}})}emit(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];if(e!==O.ActiveSpeakersChanged&&e!==O.TranscriptionReceived){const A=T0(r).filter(s=>s!==void 0);this.log.debug("room event ".concat(e),Object.assign(Object.assign({},this.logContext),{event:e,args:A}))}return super.emit(e,...r)}}Mi.cleanupRegistry=typeof FinalizationRegistry<"u"&&new FinalizationRegistry(n=>{n()});function T0(n){return n.map(e=>{if(e)return Array.isArray(e)?T0(e):typeof e=="object"?"logContext"in e?e.logContext:void 0:e})}var dn;(function(n){n[n.IDLE=0]="IDLE",n[n.RUNNING=1]="RUNNING",n[n.SKIPPED=2]="SKIPPED",n[n.SUCCESS=3]="SUCCESS",n[n.FAILED=4]="FAILED"})(dn||(dn={}));class vr extends _n.EventEmitter{constructor(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};super(),this.status=dn.IDLE,this.logs=[],this.options={},this.url=e,this.token=t,this.name=this.constructor.name,this.room=new Mi(r.roomOptions),this.connectOptions=r.connectOptions,this.options=r}run(e){return S(this,void 0,void 0,function*(){if(this.status!==dn.IDLE)throw Error("check is running already");this.setStatus(dn.RUNNING);try{yield this.perform()}catch(t){t instanceof Error&&(this.options.errorsAsWarnings?this.appendWarning(t.message):this.appendError(t.message))}return yield this.disconnect(),yield new Promise(t=>setTimeout(t,500)),this.status!==dn.SKIPPED&&this.setStatus(this.isSuccess()?dn.SUCCESS:dn.FAILED),e&&e(),this.getInfo()})}isSuccess(){return!this.logs.some(e=>e.level==="error")}connect(e){return S(this,void 0,void 0,function*(){return this.room.state===pe.Connected?this.room:(e||(e=this.url),yield this.room.connect(e,this.token,this.connectOptions),this.room)})}disconnect(){return S(this,void 0,void 0,function*(){this.room&&this.room.state!==pe.Disconnected&&(yield this.room.disconnect(),yield new Promise(e=>setTimeout(e,500)))})}skip(){this.setStatus(dn.SKIPPED)}switchProtocol(e){return S(this,void 0,void 0,function*(){let t=!1,r=!1;if(this.room.on(O.Reconnecting,()=>{t=!0}),this.room.once(O.Reconnected,()=>{r=!0}),this.room.simulateScenario("force-".concat(e)),yield new Promise(A=>setTimeout(A,1e3)),!t)return;const i=Date.now()+1e4;for(;Date.now()<i;){if(r)return;yield Dt(100)}throw new Error("Could not reconnect using ".concat(e," protocol after 10 seconds"))})}appendMessage(e){this.logs.push({level:"info",message:e}),this.emit("update",this.getInfo())}appendWarning(e){this.logs.push({level:"warning",message:e}),this.emit("update",this.getInfo())}appendError(e){this.logs.push({level:"error",message:e}),this.emit("update",this.getInfo())}setStatus(e){this.status=e,this.emit("update",this.getInfo())}get engine(){var e;return(e=this.room)===null||e===void 0?void 0:e.engine}getInfo(){return{logs:this.logs,name:this.name,status:this.status,description:this.description}}}class Ox extends vr{get description(){return"Cloud regions"}perform(){return S(this,void 0,void 0,function*(){const e=new ed(this.url,this.token);if(!e.isCloud()){this.skip();return}const t=[],r=new Set;for(let A=0;A<3;A++){const s=yield e.getNextBestRegionUrl();if(!s)break;if(r.has(s))continue;r.add(s);const o=yield this.checkCloudRegion(s);this.appendMessage("".concat(o.region," RTT: ").concat(o.rtt,"ms, duration: ").concat(o.duration,"ms")),t.push(o)}t.sort((A,s)=>(A.duration-s.duration)*.5+(A.rtt-s.rtt)*.5);const i=t[0];this.bestStats=i,this.appendMessage("best Cloud region: ".concat(i.region))})}getInfo(){const e=super.getInfo();return e.data=this.bestStats,e}checkCloudRegion(e){return S(this,void 0,void 0,function*(){var t,r;yield this.connect(e),this.options.protocol==="tcp"&&(yield this.switchProtocol("tcp"));const i=(t=this.room.serverInfo)===null||t===void 0?void 0:t.region;if(!i)throw new Error("Region not found");const A=yield this.room.localParticipant.streamText({topic:"test"}),s=1e3,a=1e6/s,c="A".repeat(s),u=Date.now();for(let f=0;f<a;f++)yield A.write(c);yield A.close();const l=Date.now(),d=yield(r=this.room.engine.pcManager)===null||r===void 0?void 0:r.publisher.getStats(),h={region:i,rtt:1e4,duration:l-u};return d==null||d.forEach(f=>{f.type==="candidate-pair"&&f.nominated&&(h.rtt=f.currentRoundTripTime*1e3)}),yield this.disconnect(),h})}}const id=1e4;class Mx extends vr{get description(){return"Connection via UDP vs TCP"}perform(){return S(this,void 0,void 0,function*(){const e=yield this.checkConnectionProtocol("udp"),t=yield this.checkConnectionProtocol("tcp");this.bestStats=e,e.qualityLimitationDurations.bandwidth-t.qualityLimitationDurations.bandwidth>.5||(e.packetsLost-t.packetsLost)/e.packetsSent>.01?(this.appendMessage("best connection quality via tcp"),this.bestStats=t):this.appendMessage("best connection quality via udp");const r=this.bestStats;this.appendMessage("upstream bitrate: ".concat((r.bitrateTotal/r.count/1e3/1e3).toFixed(2)," mbps")),this.appendMessage("RTT: ".concat((r.rttTotal/r.count*1e3).toFixed(2)," ms")),this.appendMessage("jitter: ".concat((r.jitterTotal/r.count*1e3).toFixed(2)," ms")),r.packetsLost>0&&this.appendWarning("packets lost: ".concat((r.packetsLost/r.packetsSent*100).toFixed(2),"%")),r.qualityLimitationDurations.bandwidth>1&&this.appendWarning("bandwidth limited ".concat((r.qualityLimitationDurations.bandwidth/(id/1e3)*100).toFixed(2),"%")),r.qualityLimitationDurations.cpu>0&&this.appendWarning("cpu limited ".concat((r.qualityLimitationDurations.cpu/(id/1e3)*100).toFixed(2),"%"))})}getInfo(){const e=super.getInfo();return e.data=this.bestStats,e}checkConnectionProtocol(e){return S(this,void 0,void 0,function*(){yield this.connect(),e==="tcp"?yield this.switchProtocol("tcp"):yield this.switchProtocol("udp");const t=document.createElement("canvas");t.width=1280,t.height=720;const r=t.getContext("2d");if(!r)throw new Error("Could not get canvas context");let i=0;const A=()=>{i=(i+1)%360,r.fillStyle="hsl(".concat(i,", 100%, 50%)"),r.fillRect(0,0,t.width,t.height),requestAnimationFrame(A)};A();const o=t.captureStream(30).getVideoTracks()[0],c=(yield this.room.localParticipant.publishTrack(o,{simulcast:!1,degradationPreference:"maintain-resolution",videoEncoding:{maxBitrate:2e6}})).track,u={protocol:e,packetsLost:0,packetsSent:0,qualityLimitationDurations:{},rttTotal:0,jitterTotal:0,bitrateTotal:0,count:0},l=setInterval(()=>S(this,void 0,void 0,function*(){const d=yield c.getRTCStatsReport();d==null||d.forEach(h=>{h.type==="outbound-rtp"?(u.packetsSent=h.packetsSent,u.qualityLimitationDurations=h.qualityLimitationDurations,u.bitrateTotal+=h.targetBitrate,u.count++):h.type==="remote-inbound-rtp"&&(u.packetsLost=h.packetsLost,u.rttTotal+=h.roundTripTime,u.jitterTotal+=h.jitter)})}),1e3);return yield new Promise(d=>setTimeout(d,id)),clearInterval(l),o.stop(),t.remove(),yield this.disconnect(),u})}}class Lx extends vr{get description(){return"Can publish audio"}perform(){return S(this,void 0,void 0,function*(){var e;const t=yield this.connect(),r=yield Ix();if(yield $v(r,1e3))throw new Error("unable to detect audio from microphone");this.appendMessage("detected audio from microphone"),t.localParticipant.publishTrack(r),yield new Promise(o=>setTimeout(o,3e3));const A=yield(e=r.sender)===null||e===void 0?void 0:e.getStats();if(!A)throw new Error("Could not get RTCStats");let s=0;if(A.forEach(o=>{o.type==="outbound-rtp"&&(o.kind==="audio"||!o.kind&&o.mediaType==="audio")&&(s=o.packetsSent)}),s===0)throw new Error("Could not determine packets are sent");this.appendMessage("published ".concat(s," audio packets"))})}}class Dx extends vr{get description(){return"Can publish video"}perform(){return S(this,void 0,void 0,function*(){var e;const t=yield this.connect(),r=yield Tx();yield this.checkForVideo(r.mediaStreamTrack),t.localParticipant.publishTrack(r),yield new Promise(s=>setTimeout(s,5e3));const i=yield(e=r.sender)===null||e===void 0?void 0:e.getStats();if(!i)throw new Error("Could not get RTCStats");let A=0;if(i.forEach(s=>{s.type==="outbound-rtp"&&(s.kind==="video"||!s.kind&&s.mediaType==="video")&&(A+=s.packetsSent)}),A===0)throw new Error("Could not determine packets are sent");this.appendMessage("published ".concat(A," video packets"))})}checkForVideo(e){return S(this,void 0,void 0,function*(){const t=new MediaStream;t.addTrack(e.clone());const r=document.createElement("video");r.srcObject=t,r.muted=!0,yield new Promise(i=>{r.onplay=()=>{setTimeout(()=>{var A,s,o,a;const c=document.createElement("canvas"),u=e.getSettings(),l=(s=(A=u.width)!==null&&A!==void 0?A:r.videoWidth)!==null&&s!==void 0?s:1280,d=(a=(o=u.height)!==null&&o!==void 0?o:r.videoHeight)!==null&&a!==void 0?a:720;c.width=l,c.height=d;const h=c.getContext("2d");h.drawImage(r,0,0);const p=h.getImageData(0,0,c.width,c.height).data;let g=!0;for(let v=0;v<p.length;v+=4)if(p[v]!==0||p[v+1]!==0||p[v+2]!==0){g=!1;break}g?this.appendError("camera appears to be producing only black frames"):this.appendMessage("received video frames"),i()},1e3)},r.play()}),r.remove()})}}class Hx extends vr{get description(){return"Resuming connection after interruption"}perform(){return S(this,void 0,void 0,function*(){var e;const t=yield this.connect();let r=!1,i=!1,A;const s=new Promise(c=>{setTimeout(c,5e3),A=c}),o=()=>{r=!0};t.on(O.SignalReconnecting,o).on(O.Reconnecting,o).on(O.Reconnected,()=>{i=!0,A(!0)}),(e=t.engine.client.ws)===null||e===void 0||e.close();const a=t.engine.client.onClose;if(a&&a(""),yield s,r){if(!i||t.state!==pe.Connected)throw this.appendWarning("reconnection is only possible in Redis-based configurations"),new Error("Not able to reconnect")}else throw new Error("Did not attempt to reconnect")})}}class Nx extends vr{get description(){return"Can connect via TURN"}perform(){return S(this,void 0,void 0,function*(){var e,t;const r=new Hl,i=yield r.join(this.url,this.token,{autoSubscribe:!0,maxRetries:0,e2eeEnabled:!1,websocketTimeout:15e3});let A=!1,s=!1,o=!1;for(let a of i.iceServers)for(let c of a.urls)c.startsWith("turn:")?(s=!0,o=!0):c.startsWith("turns:")&&(s=!0,o=!0,A=!0),c.startsWith("stun:")&&(o=!0);o?s&&!A&&this.appendWarning("TURN is configured server side, but TURN/TLS is unavailable."):this.appendWarning("No STUN servers configured on server side."),yield r.close(),!((t=(e=this.connectOptions)===null||e===void 0?void 0:e.rtcConfig)===null||t===void 0)&&t.iceServers||s?yield this.room.connect(this.url,this.token,{rtcConfig:{iceTransportPolicy:"relay"}}):(this.appendWarning("No TURN servers configured."),this.skip(),yield new Promise(a=>setTimeout(a,0)))})}}class Kx extends vr{get description(){return"Establishing WebRTC connection"}perform(){return S(this,void 0,void 0,function*(){let e=!1,t=!1;this.room.on(O.SignalConnected,()=>{const r=this.room.engine.client.onTrickle;this.room.engine.client.onTrickle=(i,A)=>{if(i.candidate){const s=new RTCIceCandidate(i);let o="".concat(s.protocol," ").concat(s.address,":").concat(s.port," ").concat(s.type);s.address&&(Vx(s.address)?o+=" (private)":s.protocol==="tcp"&&s.tcpType==="passive"?(e=!0,o+=" (passive)"):s.protocol==="udp"&&(t=!0)),this.appendMessage(o)}r&&r(i,A)},this.room.engine.pcManager&&(this.room.engine.pcManager.subscriber.onIceCandidateError=i=>{i instanceof RTCPeerConnectionIceErrorEvent&&this.appendWarning("error with ICE candidate: ".concat(i.errorCode," ").concat(i.errorText," ").concat(i.url))})});try{yield this.connect(),ce.info("now the room is connected")}catch(r){throw this.appendWarning("ports need to be open on firewall in order to connect."),r}e||this.appendWarning("Server is not configured for ICE/TCP"),t||this.appendWarning("No public IPv4 UDP candidates were found. Your server is likely not configured correctly")})}}function Vx(n){const e=n.split(".");if(e.length===4){if(e[0]==="10")return!0;if(e[0]==="192"&&e[1]==="168")return!0;if(e[0]==="172"){const t=parseInt(e[1],10);if(t>=16&&t<=31)return!0}}return!1}class Gx extends vr{get description(){return"Connecting to signal connection via WebSocket"}perform(){return S(this,void 0,void 0,function*(){var e,t,r;(this.url.startsWith("ws:")||this.url.startsWith("http:"))&&this.appendWarning("Server is insecure, clients may block connections to it");let i=new Hl;const A=yield i.join(this.url,this.token,{autoSubscribe:!0,maxRetries:0,e2eeEnabled:!1,websocketTimeout:15e3});this.appendMessage("Connected to server, version ".concat(A.serverVersion,".")),((e=A.serverInfo)===null||e===void 0?void 0:e.edition)===xm.Cloud&&(!((t=A.serverInfo)===null||t===void 0)&&t.region)&&this.appendMessage("LiveKit Cloud: ".concat((r=A.serverInfo)===null||r===void 0?void 0:r.region)),yield i.close()})}}class t4 extends _n.EventEmitter{constructor(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};super(),this.options={},this.checkResults=new Map,this.url=e,this.token=t,this.options=r}getNextCheckId(){const e=this.checkResults.size;return this.checkResults.set(e,{logs:[],status:dn.IDLE,name:"",description:""}),e}updateCheck(e,t){this.checkResults.set(e,t),this.emit("checkUpdate",e,t)}isSuccess(){return Array.from(this.checkResults.values()).every(e=>e.status!==dn.FAILED)}getResults(){return Array.from(this.checkResults.values())}createAndRunCheck(e){return S(this,void 0,void 0,function*(){const t=this.getNextCheckId(),r=new e(this.url,this.token,this.options),i=s=>{this.updateCheck(t,s)};r.on("update",i);const A=yield r.run();return r.off("update",i),A})}checkWebsocket(){return S(this,void 0,void 0,function*(){return this.createAndRunCheck(Gx)})}checkWebRTC(){return S(this,void 0,void 0,function*(){return this.createAndRunCheck(Kx)})}checkTURN(){return S(this,void 0,void 0,function*(){return this.createAndRunCheck(Nx)})}checkReconnect(){return S(this,void 0,void 0,function*(){return this.createAndRunCheck(Hx)})}checkPublishAudio(){return S(this,void 0,void 0,function*(){return this.createAndRunCheck(Lx)})}checkPublishVideo(){return S(this,void 0,void 0,function*(){return this.createAndRunCheck(Dx)})}checkConnectionProtocol(){return S(this,void 0,void 0,function*(){const e=yield this.createAndRunCheck(Mx);if(e.data&&"protocol"in e.data){const t=e.data;this.options.protocol=t.protocol}return e})}checkCloudRegion(){return S(this,void 0,void 0,function*(){return this.createAndRunCheck(Ox)})}}const jx=/\{[^{}]+\}/g;function Wx(){return Math.random().toString(36).slice(2,11)}function qx(n){let{baseUrl:e="",Request:t=globalThis.Request,fetch:r=globalThis.fetch,querySerializer:i,bodySerializer:A,headers:s,...o}={...n};e=Q0(e);const a=[];async function c(u,l){const{baseUrl:d,fetch:h=r,Request:f=t,headers:p,params:g={},parseAs:v="json",querySerializer:y,bodySerializer:b=A??zx,body:B,...w}=l||{};d&&(e=Q0(d));let _=typeof i=="function"?i:x0(i);y&&(_=typeof y=="function"?y:x0({...typeof i=="object"?i:{},...y}));const k=B===void 0?void 0:b(B),T=k===void 0||k instanceof FormData?{}:{"Content-Type":"application/json"},I={redirect:"follow",...o,...w,body:k,headers:Yx(T,s,p,g.header)};let x,F,Q=new t(Xx(u,{baseUrl:e,params:g,querySerializer:_}),I);for(const N in w)N in Q||(Q[N]=w[N]);if(a.length){x=Wx(),F=Object.freeze({baseUrl:e,fetch:h,parseAs:v,querySerializer:_,bodySerializer:b});for(const N of a)if(N&&typeof N=="object"&&typeof N.onRequest=="function"){const q=await N.onRequest({request:Q,schemaPath:u,params:g,options:F,id:x});if(q){if(!(q instanceof t))throw new Error("onRequest: must return new Request() when modifying the request");Q=q}}}let D=await h(Q);if(a.length)for(let N=a.length-1;N>=0;N--){const q=a[N];if(q&&typeof q=="object"&&typeof q.onResponse=="function"){const ge=await q.onResponse({request:Q,response:D,schemaPath:u,params:g,options:F,id:x});if(ge){if(!(ge instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response");D=ge}}}if(D.status===204||D.headers.get("Content-Length")==="0")return D.ok?{data:{},response:D}:{error:{},response:D};if(D.ok)return v==="stream"?{data:D.body,response:D}:{data:await D[v](),response:D};let X=await D.text();try{X=JSON.parse(X)}catch{}return{error:X,response:D}}return{GET(u,l){return c(u,{...l,method:"GET"})},PUT(u,l){return c(u,{...l,method:"PUT"})},POST(u,l){return c(u,{...l,method:"POST"})},DELETE(u,l){return c(u,{...l,method:"DELETE"})},OPTIONS(u,l){return c(u,{...l,method:"OPTIONS"})},HEAD(u,l){return c(u,{...l,method:"HEAD"})},PATCH(u,l){return c(u,{...l,method:"PATCH"})},TRACE(u,l){return c(u,{...l,method:"TRACE"})},use(...u){for(const l of u)if(l){if(typeof l!="object"||!("onRequest"in l||"onResponse"in l))throw new Error("Middleware must be an object with one of `onRequest()` or `onResponse()`");a.push(l)}},eject(...u){for(const l of u){const d=a.indexOf(l);d!==-1&&a.splice(d,1)}}}}function ua(n,e,t){if(e==null)return"";if(typeof e=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${n}=${(t==null?void 0:t.allowReserved)===!0?e:encodeURIComponent(e)}`}function I0(n,e,t){if(!e||typeof e!="object")return"";const r=[],i={simple:",",label:".",matrix:";"}[t.style]||"&";if(t.style!=="deepObject"&&t.explode===!1){for(const o in e)r.push(o,t.allowReserved===!0?e[o]:encodeURIComponent(e[o]));const s=r.join(",");switch(t.style){case"form":return`${n}=${s}`;case"label":return`.${s}`;case"matrix":return`;${n}=${s}`;default:return s}}for(const s in e){const o=t.style==="deepObject"?`${n}[${s}]`:s;r.push(ua(o,e[s],t))}const A=r.join(i);return t.style==="label"||t.style==="matrix"?`${i}${A}`:A}function F0(n,e,t){if(!Array.isArray(e))return"";if(t.explode===!1){const A={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[t.style]||",",s=(t.allowReserved===!0?e:e.map(o=>encodeURIComponent(o))).join(A);switch(t.style){case"simple":return s;case"label":return`.${s}`;case"matrix":return`;${n}=${s}`;default:return`${n}=${s}`}}const r={simple:",",label:".",matrix:";"}[t.style]||"&",i=[];for(const A of e)t.style==="simple"||t.style==="label"?i.push(t.allowReserved===!0?A:encodeURIComponent(A)):i.push(ua(n,A,t));return t.style==="label"||t.style==="matrix"?`${r}${i.join(r)}`:i.join(r)}function x0(n){return function(t){const r=[];if(t&&typeof t=="object")for(const i in t){const A=t[i];if(A!=null){if(Array.isArray(A)){if(A.length===0)continue;r.push(F0(i,A,{style:"form",explode:!0,...n==null?void 0:n.array,allowReserved:(n==null?void 0:n.allowReserved)||!1}));continue}if(typeof A=="object"){r.push(I0(i,A,{style:"deepObject",explode:!0,...n==null?void 0:n.object,allowReserved:(n==null?void 0:n.allowReserved)||!1}));continue}r.push(ua(i,A,n))}}return r.join("&")}}function Jx(n,e){let t=n;for(const r of n.match(jx)??[]){let i=r.substring(1,r.length-1),A=!1,s="simple";if(i.endsWith("*")&&(A=!0,i=i.substring(0,i.length-1)),i.startsWith(".")?(s="label",i=i.substring(1)):i.startsWith(";")&&(s="matrix",i=i.substring(1)),!e||e[i]===void 0||e[i]===null)continue;const o=e[i];if(Array.isArray(o)){t=t.replace(r,F0(i,o,{style:s,explode:A}));continue}if(typeof o=="object"){t=t.replace(r,I0(i,o,{style:s,explode:A}));continue}if(s==="matrix"){t=t.replace(r,`;${ua(i,o)}`);continue}t=t.replace(r,s==="label"?`.${encodeURIComponent(o)}`:encodeURIComponent(o))}return t}function zx(n){return n instanceof FormData?n:JSON.stringify(n)}function Xx(n,e){var i;let t=`${e.baseUrl}${n}`;(i=e.params)!=null&&i.path&&(t=Jx(t,e.params.path));let r=e.querySerializer(e.params.query??{});return r.startsWith("?")&&(r=r.substring(1)),r&&(t+=`?${r}`),t}function Yx(...n){const e=new Headers;for(const t of n){if(!t||typeof t!="object")continue;const r=t instanceof Headers?t.entries():Object.entries(t);for(const[i,A]of r)if(A===null)e.delete(i);else if(Array.isArray(A))for(const s of A)e.append(i,s);else A!==void 0&&e.set(i,A)}return e}function Q0(n){return n.endsWith("/")?n.substring(0,n.length-1):n}const R0="Onboardee-Session-Token",P0="OnboardeeSessionToken";class O0{constructor(e){this.client=qx({baseUrl:e.baseUrl,headers:e.headers,fetch:e.fetch}),this.client.use({onRequest({request:t}){if(window.localStorage){const r=window.localStorage.getItem(P0);r&&t.headers.set(R0,r)}return t},onResponse({response:t}){const r=t.headers.get(R0);return r&&window.localStorage&&window.localStorage.setItem(P0,r),t}})}setAuthToken(e){this.client.use({onRequest({request:t}){return t.headers.set("Authorization",`Bearer ${e}`),t}})}setApiToken(e){this.client.use({onRequest({request:t}){return t.headers.set("Authorization",`Token ${e}`),t}})}async getAuthUrl(e){return await this.client.GET("/api/auth/{type}",{params:{path:{type:e}}})}async getConnectUrl(e){return await this.client.GET("/api/connect/{type}",{params:{path:{type:e}}})}async logout(){return await this.client.POST("/api/logout")}async getCurrentUser(){return await this.client.GET("/api/me")}async clientInitialise(e,t={}){return await this.client.POST("/api/client/{appToken}/initialise",{params:{path:{appToken:e}},body:t})}async clientStartSession(e,t){return await this.client.POST("/api/client/{appToken}/start-session",{params:{path:{appToken:e}},body:t})}async createPresignedUploadUrl(e){return await this.client.POST("/api/files",{body:e})}async createKnowledgeBlock(e){return await this.client.POST("/api/knowledge",{body:e})}async listOnboardees(){return await this.client.GET("/api/onboardees")}async getOnboardee(e){return await this.client.GET("/api/onboardees/{id}",{params:{path:{id:e}}})}async getOnboardeeWidgetConfig(e,t){return await this.client.GET("/api/onboardees/{id}/config",{params:{path:{id:e}},signal:t})}async listPlans(){return await this.client.GET("/api/plans")}async listProducts(){return await this.client.GET("/api/products")}async getProduct(e){return await this.client.GET("/api/products/{id}",{params:{path:{id:e}}})}async getProductAnalytics(e,t,r){return await this.client.GET("/api/products/{id}/analytics",{params:{path:{id:e},query:{...t&&{start_date:t},...r&&{end_date:r}}}})}async getCourseAnalytics(e,t,r){return await this.client.GET("/api/courses/analytics",{params:{query:{...e&&{product_id:e.toString()},...t&&{start_date:t},...r&&{end_date:r}}}})}async createProduct(e){return await this.client.POST("/api/products",{body:e})}async updateProduct(e,t){return await this.client.PATCH("/api/products/{id}",{params:{path:{id:e}},body:t})}async getProductNavigationIndex(e){return await this.client.GET("/api/products/{id}/navigation-index",{params:{path:{id:e}}})}async replaceProductNavigationIndex(e,t){return await this.client.PUT("/api/products/{id}/navigation-index",{params:{path:{id:e}},body:t})}async listProductKnowledgeBlocks(e){return await this.client.GET("/api/products/{id}/knowledge-blocks",{params:{path:{id:e}}})}async createProductKnowledgeBlock(e,t){return await this.client.POST("/api/products/{id}/knowledge-blocks",{params:{path:{id:e}},body:t})}async searchProductKnowledgeBlocks(e,t,r){return await this.client.GET("/api/products/{id}/knowledge-blocks/search",{params:{path:{id:e},query:{q:t,...r&&{limit:r.toString()}}}})}async updateProductKnowledgeBlock(e,t,r){return await this.client.PATCH("/api/products/{id}/knowledge-blocks/{blockId}",{params:{path:{id:e,blockId:t}},body:r})}async deleteProductKnowledgeBlock(e,t){return await this.client.DELETE("/api/products/{id}/knowledge-blocks/{blockId}",{params:{path:{id:e,blockId:t}}})}async createPlan(e){return await this.client.POST("/api/plans",{body:e})}async getPlan(e){return await this.client.GET("/api/plans/{id}",{params:{path:{id:e}}})}async replacePlan(e,t){return await this.client.PUT("/api/plans/{id}",{params:{path:{id:e}},body:t})}async updatePlan(e,t){return await this.client.PATCH("/api/plans/{id}",{params:{path:{id:e}},body:t})}async getPlanVideoUrl(e){return await this.client.GET("/api/plans/{id}/video-url",{params:{path:{id:e}}})}async deletePlan(e){return await this.client.DELETE("/api/admin/plans/{id}",{params:{path:{id:e}}})}async publishPlanRevision(e,t){return await this.client.POST("/api/plans/{id}/publish",{params:{path:{id:e}},body:t})}async listPlanRevisions(e){return await this.client.GET("/api/plans/{id}/revisions",{params:{path:{id:e}}})}async listPlanKnowledgeBlocks(e){return await this.client.GET("/api/plans/{id}/knowledge-blocks",{params:{path:{id:e}}})}async createPlanKnowledgeBlock(e,t){return await this.client.POST("/api/plans/{id}/knowledge-blocks",{params:{path:{id:e}},body:t})}async updatePlanKnowledgeBlock(e,t,r){return await this.client.PUT("/api/plans/{id}/knowledge-blocks/{blockId}",{params:{path:{id:e,blockId:t}},body:r})}async deletePlanKnowledgeBlock(e,t){return await this.client.DELETE("/api/plans/{id}/knowledge-blocks/{blockId}",{params:{path:{id:e,blockId:t}}})}async getPlanNavigationIndex(e){return await this.client.GET("/api/plans/{id}/navigation-index",{params:{path:{id:e}}})}async replacePlanNavigationIndex(e,t){return await this.client.POST("/api/plans/{id}/navigation-index",{params:{path:{id:e}},body:t})}async getRevisionNavigationIndex(e){return await this.client.GET("/api/revisions/{id}/navigation-index",{params:{path:{id:e}}})}async replaceRevisionNavigationIndex(e,t){return await this.client.PUT("/api/revisions/{id}/navigation-index",{params:{path:{id:e}},body:t})}async getPlanFAQ(e){return await this.client.GET("/api/plans/{id}/faq",{params:{path:{id:e}}})}async getRevisionFAQ(e){return await this.client.GET("/api/revisions/{id}/faq",{params:{path:{id:e}}})}async replaceRevisionFAQ(e,t){return await this.client.PUT("/api/revisions/{id}/faq",{params:{path:{id:e}},body:t})}async listRevisionKnowledgeBlocks(e){return await this.client.GET("/api/revisions/{id}/knowledge-blocks",{params:{path:{id:e}}})}async getRevisionSteps(e){return await this.client.GET("/api/revisions/{id}/steps",{params:{path:{id:e}}})}async replaceRevisionKnowledgeBlocks(e,t){return await this.client.PUT("/api/revisions/{id}/knowledge-blocks",{params:{path:{id:e}},body:t})}async createRevisionKnowledgeBlock(e,t){return await this.client.POST("/api/revisions/{id}/knowledge-blocks",{params:{path:{id:e}},body:t})}async updateRevisionKnowledgeBlock(e,t,r){return await this.client.PUT("/api/revisions/{id}/knowledge-blocks/{blockId}",{params:{path:{id:e,blockId:t}},body:r})}async deleteRevisionKnowledgeBlock(e,t){return await this.client.DELETE("/api/revisions/{id}/knowledge-blocks/{blockId}",{params:{path:{id:e,blockId:t}}})}async listSessions(e,t){const r={token:e};return t!=null&&t.productId&&(r.product_id=t.productId),t!=null&&t.startDate&&(r.start_date=t.startDate),t!=null&&t.endDate&&(r.end_date=t.endDate),await this.client.GET("/api/sessions",{params:{query:r}})}async createSession(e){return await this.client.POST("/api/sessions",{body:e})}async getSession(e){return await this.client.GET("/api/sessions/{id}",{params:{path:{id:e}}})}async startSession(e,t){return await this.client.GET("/api/sessions/{id}/start-session",{params:{path:{id:e},query:{token:t}}})}async getSessionRecording(e){return await this.client.GET("/api/sessions/{id}/recording",{params:{path:{id:e}}})}async getSessionSummary(e){return await this.client.GET("/api/sessions/{id}/summary",{params:{path:{id:e}}})}async getSessionProductUrl(e){return await this.client.GET("/api/sessions/{id}/product-url",{params:{path:{id:e}}})}async updateSession(e,t){return await this.client.PATCH("/api/sessions/{id}",{params:{path:{id:e}},body:t})}async listUserSessions(e){const t={};return e!=null&&e.productId&&(t.product_id=e.productId),e!=null&&e.startDate&&(t.start_date=e.startDate),e!=null&&e.endDate&&(t.end_date=e.endDate),e!=null&&e.page&&(t.page=e.page),e!=null&&e.limit&&(t.limit=e.limit),e!=null&&e.courseName&&(t.course_name=e.courseName),e!=null&&e.userName&&(t.user_name=e.userName),e!=null&&e.company&&(t.company=e.company),e!=null&&e.email&&(t.email=e.email),e!=null&&e.sortBy&&(t.sort_by=e.sortBy),e!=null&&e.sortOrder&&(t.sort_order=e.sortOrder),await this.client.GET("/api/user-sessions",{params:Object.keys(t).length>0?{query:t}:void 0})}async listUserSessionsAggregate(e){const t={};return e!=null&&e.productId&&(t.product_id=e.productId),e!=null&&e.startDate&&(t.start_date=e.startDate),e!=null&&e.endDate&&(t.end_date=e.endDate),await this.client.GET("/api/user-sessions-aggregate",{params:Object.keys(t).length>0?{query:t}:void 0})}async getJoinToken(e,{clientType:t,user:r}={}){return await this.client.GET("/api/join-token",{params:{query:{token:e,...t&&{client_type:t},...r&&{user:encodeURIComponent(r)}}}})}async getSessionPlan(e){return await this.client.GET("/api/sessions/{id}/plan",{params:{path:{id:e}}})}getClient(){return this.client}}const M0="https://app.coragents.ai";class la extends Hc{constructor(e,t,r,i){super(),this.state=null,this.isPaused=!1,this.speakingState=null,this.captureScreen=null,this.sessionUuid=null,this.roomId=null,this.joinToken=null,this.roomUrl=null,this.room=null,this.agentAnalyser=null,this.userAnalyser=null,this.appToken=e,this.planId=t,this.clientType=r,this.api=i.api||new O0({baseUrl:M0}),this.identity=i.identity||null,this.roomFactory=i.roomFactory||(A=>new Mi(A)),this.captureScreen=i.captureScreen||null}async start(){this.planId,this.setState("connecting"),this.speakingStateChanged("thinking");try{const t=(await this.api.clientStartSession(this.appToken,{client_type:this.clientType,onboarding_plan:this.planId})).data;if(!(t!=null&&t.url)||!(t!=null&&t.token)||!(t!=null&&t.room)||!(t!=null&&t.session_uuid))throw new Error("Invalid room info");this.sessionUuid=t==null?void 0:t.session_uuid,this.roomId=t==null?void 0:t.room,this.joinToken=t==null?void 0:t.token,this.roomUrl=t==null?void 0:t.url,await this.joinRoom(),this.setState("connected"),this.planId,this.sessionUuid}catch(e){console.error("[obi] error starting session",{error:e}),this.setState("error")}}async joinRoom({withMicrophone:e=!1,withStateRecovery:t=!1}={}){this.room=this.roomFactory({adaptiveStream:!0,dynacast:!0}),this.room.on(O.Disconnected,r=>{if(!this.room)return;let i=null;switch(r){case 12:i="invalid-room";break}this.shutdown(i)}),this.room.on(O.TrackSubscribed,r=>{r.kind==="audio"&&(r.attach(),r.source===P.Source.Microphone&&(this.agentAnalyser&&this.agentAnalyser.disconnect(),this.agentAnalyser=this.createFFT(r.mediaStream)))}),this.room.on(O.LocalTrackPublished,r=>{r.kind==="audio"&&(this.userAnalyser&&this.userAnalyser.disconnect(),this.userAnalyser=this.createFFT(r.audioTrack.mediaStream))}),this.room.on(O.ParticipantAttributesChanged,r=>{if(!r["lk.agent.state"])return;const i=r["lk.agent.state"];switch(i){case"speaking":this.speakingStateChanged("speaking");break;case"listening":this.state!=="connected"&&this.speakingStateChanged("listening");break;case"thinking":this.speakingStateChanged("thinking");break;default:console.warn("[obi] unknown speaking state",i)}}),this.room.on(O.DataReceived,async r=>{try{const i=new TextDecoder().decode(r),A=JSON.parse(i);switch(A.status||A.request||A.type){case"course_progress":typeof A.current_step=="number"&&typeof A.total_steps=="number"&&Array.isArray(A.step_names)&&this.emit("courseProgress",{currentStep:Math.max(1,A.current_step),totalSteps:Math.max(1,A.total_steps),stepNames:A.step_names});break;case"using_tool":this.speakingStateChanged("busy");break;case"using_tool_ended":this.speakingStateChanged("speaking");break;case"prompt_user":this.setState("volume-check");break;case"mic_check":this.setState("mic-check");break;case"share_mic":this.setState("mic-share");break;case"share_screen":this.setState("screen-share");break;case"navigate":this.setState("navigate");break;default:console.warn("[obi] unknown data received",A)}}catch(i){console.error("[obi] error parsing data",i)}}),this.room.localParticipant.registerRpcMethod("mic_check",async r=>(this.sessionUuid,await this.checkMicrophone()?"ok":"error")),this.room.localParticipant.registerRpcMethod("screen_capture",async r=>{if(!this.captureScreen)return console.error("[obi] no captureScreen function provided"),"error";let i=null,A=null;try{i=await this.captureScreen()}catch(s){i=null,s=s}if(!i||A)return console.error("[obi] error capturing screen",{error:A}),"error";try{return await this.room.localParticipant.sendFile(new File([i],"screen_capture.png",{type:"image/png"}),{mimeType:"image/png",topic:"screen_capture"}),"ok"}catch(s){return console.error("[obi] error sending screen capture",{error:s}),"error"}}),await this.room.connect(this.roomUrl,this.joinToken);for(let r=0;r<9&&!(this.room.state===pe.Connected&&this.room.remoteParticipants.size>=1);r++)await new Promise(i=>setTimeout(i,1e3));if(!(this.room.state===pe.Connected&&this.room.remoteParticipants.size>=1)){console.error("[obi] room not connected",{state:this.room.state,numParticipants:this.room.remoteParticipants.size}),this.shutdown("invalid-room");return}if(e&&await this.room.localParticipant.setMicrophoneEnabled(!0),t){let r=!1;for(const i of this.room.remoteParticipants.values())i.isSpeaking&&(r=!0);r?this.speakingState="speaking":this.speakingState="listening"}}async continue(){this.sessionUuid,this.speakingStateChanged("thinking"),await this.sendData({request:"prompt_user",success:!0})}async checkMicrophone(){let e=!1;try{e=(await navigator.permissions.query({name:"microphone"})).state==="granted"}catch(t){console.error("[obi] error checking microphone permission:",t)}return e?(this.sessionUuid,await this.room.localParticipant.setMicrophoneEnabled(!0),this.isMicShared=!0):this.sessionUuid,e&&this.clientType==="sdk"&&this.setState("in-progress"),this.emit("micCheckComplete",e),e}async shareMicrophone(){this.sessionUuid,this.speakingStateChanged("thinking");let e=null,t=null;try{e=await this.room.localParticipant.setMicrophoneEnabled(!0),this.isMicShared=!0}catch(r){r=r,this.isMicShared=!1}e?this.sessionUuid:console.error("[obi] failed to share microphone",{error:t}),await this.sendData({request:"share_mic",success:!!e}),this.clientType==="sdk"&&this.setState("in-progress")}async shareMicrophoneFailed(){this.isMicShared=!1,await this.sendData({request:"share_mic",success:!1}),this.clientType==="sdk"&&this.setState("in-progress")}async shareScreen(){this.sessionUuid,this.speakingStateChanged("thinking"),await this.room.localParticipant.setScreenShareEnabled(!0,{video:{displaySurface:"window"}}),await this.sendData({request:"share_screen",success:!0}),this.setState("navigate")}async pause(){this.muteMicrophone(),this.isPaused=!0,this.emit("paused"),await this.sendData({request:"pause"}),console.log("[obi] paused session",{sessionUuid:this.sessionUuid})}async unpause(){this.unmuteMicrophone(),this.isPaused=!1,this.emit("unpaused"),await this.sendData({request:"unpause"}),console.log("[obi] unpaused session",{sessionUuid:this.sessionUuid})}muteMicrophone(){this.sessionUuid,this.room.localParticipant.getTrackPublications().forEach(e=>{var t,r;e.handleMuted(),(r=(t=e.track)==null?void 0:t.mediaStream)==null||r.getTracks().forEach(i=>i.enabled=!1)})}unmuteMicrophone(){this.sessionUuid,this.room.localParticipant.getTrackPublications().forEach(e=>{var t,r;e.handleUnmuted(),(r=(t=e.track)==null?void 0:t.mediaStream)==null||r.getTracks().forEach(i=>i.enabled=!0)})}async stop(){this.emit("stopped"),await this.shutdown()}async shutdown(e=null){if(this.room){this.sessionUuid;const t=this.room;this.room=null,await t.disconnect(),this.sessionUuid}this.sessionUuid=null,this.roomId=null,this.joinToken=null,this.roomUrl=null,this.emit("shutdown",e)}async say(e){this.speakingStateChanged("thinking"),this.isPaused&&await this.unpause(),await this.sendData({request:"say",message:e})}serialise(){return JSON.stringify({state:this.state,speakingState:this.speakingState,appToken:this.appToken,planId:this.planId,clientType:this.clientType,isPaused:this.isPaused,identity:this.identity,sessionUuid:this.sessionUuid,roomId:this.roomId,joinToken:this.joinToken,roomUrl:this.roomUrl})}audioSpectrum(){return this.speakingState==="speaking"&&this.agentAnalyser?this.normaliseSpectrum(this.agentAnalyser):this.speakingState==="listening"&&this.userAnalyser?this.normaliseSpectrum(this.userAnalyser):null}normaliseSpectrum(e){const r=e.context.sampleRate/2/e.frequencyBinCount,i=new Uint8Array(e.frequencyBinCount);e.getByteFrequencyData(i);const A=[],s=50,o=5e3,a=8,c=Math.pow(o/s,1/a);for(let u=0;u<a;u++){const l=s*Math.pow(c,u),d=s*Math.pow(c,u+1),h=Math.floor(l/r),f=Math.floor(d/r),p=Math.min(f,i.length),g=Math.min(h,p);if(g<p){const v=i.slice(g,p).reduce((y,b)=>y+b,0)/(p-g)/255;A.push(v)}else A.push(0)}return A}setState(e){this.state;const t=this.state;this.state=e,this.emit("stateChanged",e,t)}static deserialise(e,t,r,i={}){const A=JSON.parse(e),s=new la(t,A.planId,r,i);return s.state=A.state,s.speakingState=A.speakingState,s.identity=A.identity||null,s.isPaused=A.isPaused||!1,s.sessionUuid=A.sessionUuid||null,s.roomId=A.roomId||null,s.joinToken=A.joinToken||null,s.roomUrl=A.roomUrl||null,s}speakingStateChanged(e){this.speakingState;const t=this.speakingState;this.speakingState=e,this.emit("speakingStateChanged",e,t)}async sendData(e){await this.room.localParticipant.publishData(new TextEncoder().encode(JSON.stringify(e)),{reliable:!0})}createFFT(e){const t=new AudioContext,r=t.createAnalyser();return t.createMediaStreamSource(e).connect(r),r.fftSize=2048,r.smoothingTimeConstant=.6,r}}class da extends Hc{constructor(e,t,r={}){super(),this.state="loading",this.error=null,this.identity=null,this.product=null,this.plans=[],this.selectedPlan=null,this.selectedPlanUuid=null,this.showWidget=!1,this.session=null,this.captureScreen=null,this.appToken=e,this.clientType=t,this.api=r.api||new O0({baseUrl:r.apiBaseUrl||M0}),this.sessionFactory=r.sessionFactory||((i,A,s,o)=>new la(i,A,s,o)),this.captureScreen=r.captureScreen||null}async initialise(e={}){var t,r,i,A;if(!this.appToken)throw new Error("App token is required");this.setState("loading");try{const s=await this.api.clientInitialise(this.appToken,{identity:e.identity});if(this.identity=e.identity||null,this.product=((t=s.data)==null?void 0:t.product)||null,this.plans=((r=s.data)==null?void 0:r.onboarding_plans)||[],this.selectedPlan=((i=s.data)==null?void 0:i.selected_plan)||null,this.showWidget=((A=s.data)==null?void 0:A.show_widget)||!1,e.planUuid){let o=this.plans.find(a=>a.uuid===e.planUuid)||null;if(!o)try{const a=await this.api.getSessionPlan(e.planUuid);o=this.plans.find(c=>{var u;return c.uuid===((u=a.data)==null?void 0:u.plan_uuid)})||null}catch(a){console.error("[obi] error getting session plan",a)}o?(this.selectedPlan=o,this.selectedPlanUuid=e.planUuid):console.warn("[obi] plan not found",{planUuid:e.planUuid})}this.identity,this.product,this.plans,this.selectedPlan,this.showWidget}catch(s){throw this.error=s instanceof Error?s:new Error(String(s)),this.setState("error"),s}finally{this.setState("ready")}}selectPlan(e){this.selectedPlan=e,this.selectedPlanUuid=(e==null?void 0:e.uuid)||null,this.emit("planSelected",e),this.trackEvent(e?"plan_selected":"plan_cancelled")}async startSession(e,t){return await this._stopSession(),this.session=this.sessionFactory(this.appToken,e,this.clientType,{api:this.api,identity:this.identity,captureScreen:this.captureScreen}),this.prepareSession(t),this.session.start().then(()=>{this.emit("sessionStarted",this.session)}).catch(r=>{this.session=null,console.error("[obi] error starting session",r)}),this.trackEvent("session_started"),this.session}async resumeSession(e){var t,r;return this.state,(t=this.session)==null||t.state,(r=this.session)==null||r.speakingState,this.session.captureScreen=this.captureScreen,this.prepareSession(e),this.session.joinRoom({withMicrophone:!0,withStateRecovery:!0}).then(()=>{this.emit("sessionResumed",this.session)}).catch(i=>{console.error("[obi] error joining room",{error:i}),i instanceof Error&&i.message==="Room is not connected"&&this.session.stop()}),this.trackEvent("session_resumed"),this.session}prepareSession(e){if(!this.session)throw new Error("No session to prepare");return e(this.session),this.session.on("stopped",()=>{this.emit("sessionStopped")}),this.session.on("shutdown",t=>{var r,i;(i=(r=this.session)==null?void 0:r.removeAllListeners)==null||i.call(r),this.session=null,this.selectedPlan=null,this.selectedPlanUuid=null,this.emit("sessionShutdown",t)}),this.session}async stopSession(){await this._stopSession(),this.selectedPlan&&this.selectPlan(null)}async _stopSession(){this.session&&(this.trackEvent("session_stopped"),await this.session.stop(),this.session=null)}isLoading(){return this.state==="loading"}isReady(){return this.state==="ready"}serialise(){var e;return JSON.stringify({state:this.state,appToken:this.appToken,clientType:this.clientType,identity:this.identity,product:this.product,plans:this.plans,selectedPlan:this.selectedPlan,selectedPlanUuid:this.selectedPlanUuid,showWidget:this.showWidget,session:(e=this.session)==null?void 0:e.serialise()})}static deserialise(e,t,r,i={}){const A=JSON.parse(e),s=new da(t,r,i);return s.state=A.state,s.identity=A.identity||null,s.product=A.product||null,s.plans=A.plans||[],s.selectedPlan=A.selectedPlan||null,s.selectedPlanUuid=A.selectedPlanUuid||null,s.showWidget=A.showWidget||!1,A.session&&(s.session=la.deserialise(A.session,t,r,{api:s.api})),s}setState(e){const t=this.state;this.state=e,this.emit("stateChanged",e,t)}trackEvent(e,t={}){var r,i,A;this.emit("trackEvent",e,{...t,clientType:this.clientType,planId:(r=this.selectedPlan)==null?void 0:r.uuid,productId:(i=this.product)==null?void 0:i.uuid,sessionId:(A=this.session)==null?void 0:A.sessionUuid})}}var ha,$,L0,Jr,D0,H0,N0,K0,Ad,sd,od,V0,VA={},G0=[],Zx=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,GA=Array.isArray;function Nn(n,e){for(var t in e)n[t]=e[t];return n}function ad(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function cd(n,e,t){var r,i,A,s={};for(A in e)A=="key"?r=e[A]:A=="ref"?i=e[A]:s[A]=e[A];if(arguments.length>2&&(s.children=arguments.length>3?ha.call(arguments,2):t),typeof n=="function"&&n.defaultProps!=null)for(A in n.defaultProps)s[A]==null&&(s[A]=n.defaultProps[A]);return pa(n,s,r,i,null)}function pa(n,e,t,r,i){var A={type:n,props:e,key:t,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++L0,__i:-1,__u:0};return i==null&&$.vnode!=null&&$.vnode(A),A}function _t(n){return n.children}function Kn(n,e){this.props=n,this.context=e}function Li(n,e){if(e==null)return n.__?Li(n.__,n.__i+1):null;for(var t;e<n.__k.length;e++)if((t=n.__k[e])!=null&&t.__e!=null)return t.__e;return typeof n.type=="function"?Li(n):null}function j0(n){var e,t;if((n=n.__)!=null&&n.__c!=null){for(n.__e=n.__c.base=null,e=0;e<n.__k.length;e++)if((t=n.__k[e])!=null&&t.__e!=null){n.__e=n.__c.base=t.__e;break}return j0(n)}}function ud(n){(!n.__d&&(n.__d=!0)&&Jr.push(n)&&!fa.__r++||D0!=$.debounceRendering)&&((D0=$.debounceRendering)||H0)(fa)}function fa(){for(var n,e,t,r,i,A,s,o=1;Jr.length;)Jr.length>o&&Jr.sort(N0),n=Jr.shift(),o=Jr.length,n.__d&&(t=void 0,i=(r=(e=n).__v).__e,A=[],s=[],e.__P&&((t=Nn({},r)).__v=r.__v+1,$.vnode&&$.vnode(t),ld(e.__P,t,r,e.__n,e.__P.namespaceURI,32&r.__u?[i]:null,A,i??Li(r),!!(32&r.__u),s),t.__v=r.__v,t.__.__k[t.__i]=t,X0(A,t,s),t.__e!=i&&j0(t)));fa.__r=0}function W0(n,e,t,r,i,A,s,o,a,c,u){var l,d,h,f,p,g,v=r&&r.__k||G0,y=e.length;for(a=$x(t,e,v,a,y),l=0;l<y;l++)(h=t.__k[l])!=null&&(d=h.__i==-1?VA:v[h.__i]||VA,h.__i=l,g=ld(n,h,d,i,A,s,o,a,c,u),f=h.__e,h.ref&&d.ref!=h.ref&&(d.ref&&dd(d.ref,null,h),u.push(h.ref,h.__c||f,h)),p==null&&f!=null&&(p=f),4&h.__u||d.__k===h.__k?a=q0(h,a,n):typeof h.type=="function"&&g!==void 0?a=g:f&&(a=f.nextSibling),h.__u&=-7);return t.__e=p,a}function $x(n,e,t,r,i){var A,s,o,a,c,u=t.length,l=u,d=0;for(n.__k=new Array(i),A=0;A<i;A++)(s=e[A])!=null&&typeof s!="boolean"&&typeof s!="function"?(a=A+d,(s=n.__k[A]=typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?pa(null,s,null,null,null):GA(s)?pa(_t,{children:s},null,null,null):s.constructor==null&&s.__b>0?pa(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=n,s.__b=n.__b+1,o=null,(c=s.__i=eQ(s,t,a,l))!=-1&&(l--,(o=t[c])&&(o.__u|=2)),o==null||o.__v==null?(c==-1&&(i>u?d--:i<u&&d++),typeof s.type!="function"&&(s.__u|=4)):c!=a&&(c==a-1?d--:c==a+1?d++:(c>a?d--:d++,s.__u|=4))):n.__k[A]=null;if(l)for(A=0;A<u;A++)(o=t[A])!=null&&!(2&o.__u)&&(o.__e==r&&(r=Li(o)),Z0(o,o));return r}function q0(n,e,t){var r,i;if(typeof n.type=="function"){for(r=n.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=n,e=q0(r[i],e,t));return e}n.__e!=e&&(e&&n.type&&!t.contains(e)&&(e=Li(n)),t.insertBefore(n.__e,e||null),e=n.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function ga(n,e){return e=e||[],n==null||typeof n=="boolean"||(GA(n)?n.some(function(t){ga(t,e)}):e.push(n)),e}function eQ(n,e,t,r){var i,A,s=n.key,o=n.type,a=e[t];if(a===null&&n.key==null||a&&s==a.key&&o==a.type&&!(2&a.__u))return t;if(r>(a!=null&&!(2&a.__u)?1:0))for(i=t-1,A=t+1;i>=0||A<e.length;){if(i>=0){if((a=e[i])&&!(2&a.__u)&&s==a.key&&o==a.type)return i;i--}if(A<e.length){if((a=e[A])&&!(2&a.__u)&&s==a.key&&o==a.type)return A;A++}}return-1}function J0(n,e,t){e[0]=="-"?n.setProperty(e,t??""):n[e]=t==null?"":typeof t!="number"||Zx.test(e)?t:t+"px"}function ma(n,e,t,r,i){var A;e:if(e=="style")if(typeof t=="string")n.style.cssText=t;else{if(typeof r=="string"&&(n.style.cssText=r=""),r)for(e in r)t&&e in t||J0(n.style,e,"");if(t)for(e in t)r&&t[e]==r[e]||J0(n.style,e,t[e])}else if(e[0]=="o"&&e[1]=="n")A=e!=(e=e.replace(K0,"$1")),e=e.toLowerCase()in n||e=="onFocusOut"||e=="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),n.l||(n.l={}),n.l[e+A]=t,t?r?t.u=r.u:(t.u=Ad,n.addEventListener(e,A?od:sd,A)):n.removeEventListener(e,A?od:sd,A);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in n)try{n[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!="-"?n.removeAttribute(e):n.setAttribute(e,e=="popover"&&t==1?"":t))}}function z0(n){return function(e){if(this.l){var t=this.l[e.type+n];if(e.t==null)e.t=Ad++;else if(e.t<t.u)return;return t($.event?$.event(e):e)}}}function ld(n,e,t,r,i,A,s,o,a,c){var u,l,d,h,f,p,g,v,y,b,B,w,_,k,T,I,x,F=e.type;if(e.constructor!=null)return null;128&t.__u&&(a=!!(32&t.__u),A=[o=e.__e=t.__e]),(u=$.__b)&&u(e);e:if(typeof F=="function")try{if(v=e.props,y="prototype"in F&&F.prototype.render,b=(u=F.contextType)&&r[u.__c],B=u?b?b.props.value:u.__:r,t.__c?g=(l=e.__c=t.__c).__=l.__E:(y?e.__c=l=new F(v,B):(e.__c=l=new Kn(v,B),l.constructor=F,l.render=nQ),b&&b.sub(l),l.props=v,l.state||(l.state={}),l.context=B,l.__n=r,d=l.__d=!0,l.__h=[],l._sb=[]),y&&l.__s==null&&(l.__s=l.state),y&&F.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=Nn({},l.__s)),Nn(l.__s,F.getDerivedStateFromProps(v,l.__s))),h=l.props,f=l.state,l.__v=e,d)y&&F.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),y&&l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(y&&F.getDerivedStateFromProps==null&&v!==h&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(v,B),!l.__e&&l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(v,l.__s,B)===!1||e.__v==t.__v){for(e.__v!=t.__v&&(l.props=v,l.state=l.__s,l.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.some(function(Q){Q&&(Q.__=e)}),w=0;w<l._sb.length;w++)l.__h.push(l._sb[w]);l._sb=[],l.__h.length&&s.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(v,l.__s,B),y&&l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(h,f,p)})}if(l.context=B,l.props=v,l.__P=n,l.__e=!1,_=$.__r,k=0,y){for(l.state=l.__s,l.__d=!1,_&&_(e),u=l.render(l.props,l.state,l.context),T=0;T<l._sb.length;T++)l.__h.push(l._sb[T]);l._sb=[]}else do l.__d=!1,_&&_(e),u=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++k<25);l.state=l.__s,l.getChildContext!=null&&(r=Nn(Nn({},r),l.getChildContext())),y&&!d&&l.getSnapshotBeforeUpdate!=null&&(p=l.getSnapshotBeforeUpdate(h,f)),I=u,u!=null&&u.type===_t&&u.key==null&&(I=Y0(u.props.children)),o=W0(n,GA(I)?I:[I],e,t,r,i,A,s,o,a,c),l.base=e.__e,e.__u&=-161,l.__h.length&&s.push(l),g&&(l.__E=l.__=null)}catch(Q){if(e.__v=null,a||A!=null)if(Q.then){for(e.__u|=a?160:128;o&&o.nodeType==8&&o.nextSibling;)o=o.nextSibling;A[A.indexOf(o)]=null,e.__e=o}else for(x=A.length;x--;)ad(A[x]);else e.__e=t.__e,e.__k=t.__k;$.__e(Q,e,t)}else A==null&&e.__v==t.__v?(e.__k=t.__k,e.__e=t.__e):o=e.__e=tQ(t.__e,e,t,r,i,A,s,a,c);return(u=$.diffed)&&u(e),128&e.__u?void 0:o}function X0(n,e,t){for(var r=0;r<t.length;r++)dd(t[r],t[++r],t[++r]);$.__c&&$.__c(e,n),n.some(function(i){try{n=i.__h,i.__h=[],n.some(function(A){A.call(i)})}catch(A){$.__e(A,i.__v)}})}function Y0(n){return typeof n!="object"||n==null||n.__b&&n.__b>0?n:GA(n)?n.map(Y0):Nn({},n)}function tQ(n,e,t,r,i,A,s,o,a){var c,u,l,d,h,f,p,g=t.props,v=e.props,y=e.type;if(y=="svg"?i="http://www.w3.org/2000/svg":y=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),A!=null){for(c=0;c<A.length;c++)if((h=A[c])&&"setAttribute"in h==!!y&&(y?h.localName==y:h.nodeType==3)){n=h,A[c]=null;break}}if(n==null){if(y==null)return document.createTextNode(v);n=document.createElementNS(i,y,v.is&&v),o&&($.__m&&$.__m(e,A),o=!1),A=null}if(y==null)g===v||o&&n.data==v||(n.data=v);else{if(A=A&&ha.call(n.childNodes),g=t.props||VA,!o&&A!=null)for(g={},c=0;c<n.attributes.length;c++)g[(h=n.attributes[c]).name]=h.value;for(c in g)if(h=g[c],c!="children"){if(c=="dangerouslySetInnerHTML")l=h;else if(!(c in v)){if(c=="value"&&"defaultValue"in v||c=="checked"&&"defaultChecked"in v)continue;ma(n,c,null,h,i)}}for(c in v)h=v[c],c=="children"?d=h:c=="dangerouslySetInnerHTML"?u=h:c=="value"?f=h:c=="checked"?p=h:o&&typeof h!="function"||g[c]===h||ma(n,c,h,g[c],i);if(u)o||l&&(u.__html==l.__html||u.__html==n.innerHTML)||(n.innerHTML=u.__html),e.__k=[];else if(l&&(n.innerHTML=""),W0(e.type=="template"?n.content:n,GA(d)?d:[d],e,t,r,y=="foreignObject"?"http://www.w3.org/1999/xhtml":i,A,s,A?A[0]:t.__k&&Li(t,0),o,a),A!=null)for(c=A.length;c--;)ad(A[c]);o||(c="value",y=="progress"&&f==null?n.removeAttribute("value"):f!=null&&(f!==n[c]||y=="progress"&&!f||y=="option"&&f!=g[c])&&ma(n,c,f,g[c],i),c="checked",p!=null&&p!=n[c]&&ma(n,c,p,g[c],i))}return n}function dd(n,e,t){try{if(typeof n=="function"){var r=typeof n.__u=="function";r&&n.__u(),r&&e==null||(n.__u=n(e))}else n.current=e}catch(i){$.__e(i,t)}}function Z0(n,e,t){var r,i;if($.unmount&&$.unmount(n),(r=n.ref)&&(r.current&&r.current!=n.__e||dd(r,null,e)),(r=n.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(A){$.__e(A,e)}r.base=r.__P=null}if(r=n.__k)for(i=0;i<r.length;i++)r[i]&&Z0(r[i],e,t||typeof n.type!="function");t||ad(n.__e),n.__c=n.__=n.__e=void 0}function nQ(n,e,t){return this.constructor(n,t)}function rQ(n,e,t){var r,i,A,s;e==document&&(e=document.documentElement),$.__&&$.__(n,e),i=(r=typeof t=="function")?null:t&&t.__k||e.__k,A=[],s=[],ld(e,n=(!r&&t||e).__k=cd(_t,null,[n]),i||VA,VA,e.namespaceURI,!r&&t?[t]:i?null:e.firstChild?ha.call(e.childNodes):null,A,!r&&t?t:i?i.__e:e.firstChild,r,s),X0(A,n,s)}function $0(n){function e(t){var r,i;return this.getChildContext||(r=new Set,(i={})[e.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(A){this.props.value!=A.value&&r.forEach(function(s){s.__e=!0,ud(s)})},this.sub=function(A){r.add(A);var s=A.componentWillUnmount;A.componentWillUnmount=function(){r&&r.delete(A),s&&s.call(A)}}),t.children}return e.__c="__cC"+V0++,e.__=n,e.Provider=e.__l=(e.Consumer=function(t,r){return t.children(r)}).contextType=e,e}ha=G0.slice,$={__e:function(n,e,t,r){for(var i,A,s;e=e.__;)if((i=e.__c)&&!i.__)try{if((A=i.constructor)&&A.getDerivedStateFromError!=null&&(i.setState(A.getDerivedStateFromError(n)),s=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(n,r||{}),s=i.__d),s)return i.__E=i}catch(o){n=o}throw n}},L0=0,Kn.prototype.setState=function(n,e){var t;t=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Nn({},this.state),typeof n=="function"&&(n=n(Nn({},t),this.props)),n&&Nn(t,n),n!=null&&this.__v&&(e&&this._sb.push(e),ud(this))},Kn.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),ud(this))},Kn.prototype.render=_t,Jr=[],H0=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,N0=function(n,e){return n.__v.__b-e.__v.__b},fa.__r=0,K0=/(PointerCapture)$|Capture$/i,Ad=0,sd=z0(!1),od=z0(!0),V0=0;var iQ=0;function C(n,e,t,r,i,A){e||(e={});var s,o,a=e;if("ref"in a)for(o in a={},e)o=="ref"?s=e[o]:a[o]=e[o];var c={type:n,props:a,key:t,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--iQ,__i:-1,__u:0,__source:i,__self:A};if(typeof n=="function"&&(s=n.defaultProps))for(o in s)a[o]===void 0&&(a[o]=s[o]);return $.vnode&&$.vnode(c),c}var zr,Ke,hd,ey,jA=0,ty=[],nt=$,ny=nt.__b,ry=nt.__r,iy=nt.diffed,Ay=nt.__c,sy=nt.unmount,oy=nt.__;function WA(n,e){nt.__h&&nt.__h(Ke,n,jA||e),jA=0;var t=Ke.__H||(Ke.__H={__:[],__h:[]});return n>=t.__.length&&t.__.push({}),t.__[n]}function _e(n){return jA=1,AQ(uy,n)}function AQ(n,e,t){var r=WA(zr++,2);if(r.t=n,!r.__c&&(r.__=[t?t(e):uy(void 0,e),function(o){var a=r.__N?r.__N[0]:r.__[0],c=r.t(a,o);a!==c&&(r.__N=[c,r.__[1]],r.__c.setState({}))}],r.__c=Ke,!Ke.__f)){var i=function(o,a,c){if(!r.__c.__H)return!0;var u=r.__c.__H.__.filter(function(d){return!!d.__c});if(u.every(function(d){return!d.__N}))return!A||A.call(this,o,a,c);var l=r.__c.props!==o;return u.forEach(function(d){if(d.__N){var h=d.__[0];d.__=d.__N,d.__N=void 0,h!==d.__[0]&&(l=!0)}}),A&&A.call(this,o,a,c)||l};Ke.__f=!0;var A=Ke.shouldComponentUpdate,s=Ke.componentWillUpdate;Ke.componentWillUpdate=function(o,a,c){if(this.__e){var u=A;A=void 0,i(o,a,c),A=u}s&&s.call(this,o,a,c)},Ke.shouldComponentUpdate=i}return r.__N||r.__}function Nt(n,e){var t=WA(zr++,3);!nt.__s&&md(t.__H,e)&&(t.__=n,t.u=e,Ke.__H.__h.push(t))}function pd(n,e){var t=WA(zr++,4);!nt.__s&&md(t.__H,e)&&(t.__=n,t.u=e,Ke.__h.push(t))}function kn(n){return jA=5,fd(function(){return{current:n}},[])}function fd(n,e){var t=WA(zr++,7);return md(t.__H,e)&&(t.__=n(),t.__H=e,t.__h=n),t.__}function sQ(n,e){return jA=8,fd(function(){return n},e)}function ay(n){var e=Ke.context[n.__c],t=WA(zr++,9);return t.c=n,e?(t.__==null&&(t.__=!0,e.sub(Ke)),e.props.value):n.__}function oQ(){for(var n;n=ty.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(va),n.__H.__h.forEach(gd),n.__H.__h=[]}catch(e){n.__H.__h=[],nt.__e(e,n.__v)}}nt.__b=function(n){Ke=null,ny&&ny(n)},nt.__=function(n,e){n&&e.__k&&e.__k.__m&&(n.__m=e.__k.__m),oy&&oy(n,e)},nt.__r=function(n){ry&&ry(n),zr=0;var e=(Ke=n.__c).__H;e&&(hd===Ke?(e.__h=[],Ke.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.forEach(va),e.__h.forEach(gd),e.__h=[],zr=0)),hd=Ke},nt.diffed=function(n){iy&&iy(n);var e=n.__c;e&&e.__H&&(e.__H.__h.length&&(ty.push(e)!==1&&ey===nt.requestAnimationFrame||((ey=nt.requestAnimationFrame)||aQ)(oQ)),e.__H.__.forEach(function(t){t.u&&(t.__H=t.u),t.u=void 0})),hd=Ke=null},nt.__c=function(n,e){e.some(function(t){try{t.__h.forEach(va),t.__h=t.__h.filter(function(r){return!r.__||gd(r)})}catch(r){e.some(function(i){i.__h&&(i.__h=[])}),e=[],nt.__e(r,t.__v)}}),Ay&&Ay(n,e)},nt.unmount=function(n){sy&&sy(n);var e,t=n.__c;t&&t.__H&&(t.__H.__.forEach(function(r){try{va(r)}catch(i){e=i}}),t.__H=void 0,e&&nt.__e(e,t.__v))};var cy=typeof requestAnimationFrame=="function";function aQ(n){var e,t=function(){clearTimeout(r),cy&&cancelAnimationFrame(e),setTimeout(n)},r=setTimeout(t,100);cy&&(e=requestAnimationFrame(t))}function va(n){var e=Ke,t=n.__c;typeof t=="function"&&(n.__c=void 0,t()),Ke=e}function gd(n){var e=Ke;n.__c=n.__(),Ke=e}function md(n,e){return!n||n.length!==e.length||e.some(function(t,r){return t!==n[r]})}function uy(n,e){return typeof e=="function"?e(n):e}function cQ({size:n=24,color:e="#000"}){return C("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:e,"stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-x-icon lucide-x",children:[C("path",{d:"M18 6 6 18"}),C("path",{d:"m6 6 12 12"})]})}function ly({onClose:n}){return C("button",{class:"obi-button obi-close-button",onClick:n,"aria-label":"Close",type:"button",children:C(cQ,{})})}function dy({open:n=!1,children:e,onClose:t,size:r="medium"}){const i=kn(null),A=kn(null);Nt(()=>{const c=i.current;c&&(n&&!c.open?c.showModal():!n&&c.open&&(A.current="programmatic",c.close()))},[n]);const s=c=>{const u=i.current;c.target===u&&(A.current="user-initiated",u==null||u.close())},o=c=>{c.preventDefault(),A.current||(A.current="user-initiated");const u=A.current;A.current=null,t==null||t(u)},a=()=>{var c;A.current="user-initiated",(c=i.current)==null||c.close()};return Nt(()=>{const c=i.current;if(c)return c.addEventListener("click",s),c.addEventListener("close",o),()=>{c.removeEventListener("click",s),c.removeEventListener("close",o)}},[t]),C("dialog",{ref:i,className:`modal-${r}`,children:[C(ly,{onClose:a}),C("div",{class:"modal-content",children:n?typeof e=="function"?e():e:null})]})}function vd(n){const{children:e,className:t="",...r}=n;return C("div",{className:`${t} obi-panel`,...r,children:e})}function yd({className:n="",isActive:e=!1,speakingStatus:t,onClick:r,onMouseEnter:i,onMouseLeave:A,children:s}){let o=`obi-pill container ${e&&"active"}`;return t==="user-speaking"&&(o+=" user-speaking"),t==="busy"&&(o+=" busy"),C("div",{className:o,onMouseEnter:i,onMouseLeave:A,children:C("div",{className:`obi-pill pill ${n}`,onClick:r,children:s})})}function hy({className:n="",active:e,speakingStatus:t,onClick:r,onMouseEnter:i,onMouseLeave:A,children:s,...o}){const a=`obi-pill2 container ${e?"active":""} ${t==="user-speaking"?"user-speaking":""} ${n}`;return C("div",{className:a,...o,children:C("div",{className:"pill",onClick:r,onMouseEnter:i,onMouseLeave:A,children:s})})}function Xr({type:n,size:e=24}){return C("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:uQ(n)})}function uQ(n){switch(n){case"pause":return C(_t,{children:[C("rect",{x:"14",y:"3",width:"5",height:"18",rx:"1"}),C("rect",{x:"5",y:"3",width:"5",height:"18",rx:"1"})]});case"play":return C(_t,{children:C("path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z"})});case"close":return C(_t,{children:[C("path",{d:"M18 6 6 18"}),C("path",{d:"m6 6 12 12"})]});case"message":return C(_t,{children:C("path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z"})});case"minimize":return C(_t,{children:[C("path",{d:"m14 10 7-7"}),C("path",{d:"M20 10h-6V4"}),C("path",{d:"m3 21 7-7"}),C("path",{d:"M4 14h6v6"})]});case"voice":return C(_t,{children:[C("path",{d:"M2 10v3"}),C("path",{d:"M6 6v11"}),C("path",{d:"M10 3v18"}),C("path",{d:"M14 8v7"}),C("path",{d:"M18 5v13"}),C("path",{d:"M22 10v3"})]});case"open":return C(_t,{children:[C("path",{d:"M12 7v14"}),C("path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z"})]})}}const wd=$0(null);function lQ({children:n}){const e=ay(wd);if(!e)throw new Error("PopoutTarget must be used within a Popout component");const{controlledOpen:t,isOpen:r,setIsOpen:i,setAnimating:A,targetRef:s,trigger:o,onChange:a,delayMs:c}=e,u=kn(null),l=py(s,A),[d,h]=_e(!1);Nt(()=>{t!==void 0&&t!==d&&(t?p():g()),h(t)},[t]),Nt(()=>()=>{u.current&&clearTimeout(u.current)},[]);function f(){u.current&&(clearTimeout(u.current),u.current=null)}function p(){f(),c>0?u.current=setTimeout(()=>{a==null||a(!0),i(!0),u.current=null},c):(a==null||a(!0),i(!0))}function g(){f(),a==null||a(!1),i(!1)}const v=()=>{o==="click"&&(r?g():p())};function y(){o==="hover"&&p()}function b(){o==="hover"&&g()}return C("div",{ref:l,class:"target",onClick:v,onMouseEnter:y,onMouseLeave:b,children:n})}function dQ({children:n}){const e=ay(wd);if(!e)throw new Error("PopoutContent must be used within a Popout component");const{isOpen:t,animating:r,setAnimating:i,targetRef:A,contentRef:s}=e,o=py(s,i);return pd(()=>{if(t&&!r&&A.current&&s.current){const a=s.current;if(!a)return;const c=A.current;if(!c)return;const u=a.getBoundingClientRect(),l=c.getBoundingClientRect(),d=l.right-l.left;a.style.top=`${u.top-u.bottom-(8+e.offset)}px`,a.style.left=`${-(u.right-u.left-d)/2}px`}},[t,r]),t?C("div",{ref:o,class:"content",style:{opacity:r?0:1},children:n}):null}function Kt({trigger:n="click",open:e,onChange:t,children:r,delayMs:i=0,offset:A=0,className:s=""}){const[o,a]=_e(!1),[c,u]=_e(!1),l=kn(null),d=kn(null),h={controlledOpen:e,isOpen:o,setIsOpen:a,animating:c,setAnimating:u,targetRef:l,contentRef:d,trigger:n,onChange:t,delayMs:i,offset:A};return C(wd.Provider,{value:h,children:C("div",{class:`obi-popout ${s}`,children:r})})}Kt.Target=lQ,Kt.Content=dQ;function py(n,e){const t=kn(null),r=kn(null),i=kn(!0),A=sQ(s=>{if(n.current=s,!s){r.current&&(r.current.disconnect(),r.current=null),i.current=!0;return}function o(){if(i.current){i.current=!1;return}t.current?clearTimeout(t.current):e(!0),t.current=setTimeout(()=>{e(!1),t.current=null},200)}r.current=new ResizeObserver(o),r.current.observe(s,{box:"border-box"})},[]);return Nt(()=>()=>{r.current&&(r.current.disconnect(),r.current=null)},[]),A}function hn({className:n,onClick:e,type:t,disabled:r,title:i}){const A={cancel:C(Xr,{type:"close",size:16}),pause:C(Xr,{type:"pause",size:16}),play:C(Xr,{type:"play",size:16}),message:C(Xr,{type:"message",size:16}),minimize:C(Xr,{type:"minimize",size:16}),voice:C(Xr,{type:"voice",size:16}),open:C(Xr,{type:"open",size:16})}[t],s={cancel:"",pause:"",play:"",message:"",minimize:"",voice:"",open:""}[t],o=C("button",{class:`obi-button obi-round-button ${s} ${n}`,onClick:r?void 0:e,disabled:r,children:A});return i?C(Kt,{className:"obi-round-button-popout",trigger:"hover",delayMs:200,offset:9,children:[C(Kt.Target,{children:o}),C(Kt.Content,{children:C("div",{className:"obi-round-button-title",children:i})})]}):o}const fy=8,ya=8,hQ=50,pQ=.7,Di=3;function gy({getBands:n,color:e="white"}){const t=kn(null);return Nt(()=>{if(!n)return;const r=setInterval(()=>{try{const i=n();if(!t.current)return;const A=t.current.querySelectorAll(".bar"),s=i&&i.length>0?i.slice(0,ya).map(o=>{const a=Math.abs(o);return Math.min(a/pQ*fy,fy)||Di}):Array(ya).fill(Di);for(;s.length<ya;)s.push(Di);s.forEach((o,a)=>{if(o<Di&&(o=Di),A[a]){const c=o*2;A[a].style.height=`${c}px`,A[a].style.display=o>0?"block":"none"}})}catch(i){console.warn("Error updating equaliser:",i)}},hQ);return()=>{clearInterval(r)}},[n]),C("div",{className:"obi-equaliser",ref:t,children:Array.from({length:ya},(r,i)=>C("div",{className:"column",children:C("div",{className:"bar",style:{height:`${Di}px`,backgroundColor:e,display:"block"}})},i))})}function qA({className:n,children:e,onClick:t}){return t?C("button",{class:`obi-button obi-message ${n} clickable`,onClick:t,children:e}):C("div",{class:`obi-message ${n}`,children:e})}const fQ=8;function my({color:n="white"}){return C("div",{className:"obi-loading-dots",children:Array.from({length:fQ},(e,t)=>C("div",{className:"column",children:[C("div",{className:"bar",style:{backgroundColor:n,animationDelay:`${t*.15}s`}}),C("div",{className:"dot",style:{backgroundColor:n}})]},t))})}function gQ({onContinue:n,onWrapUp:e}){return C(vd,{className:"obi-exit-survey",children:C(vQ,{onContinue:n,onWrapUp:()=>{e()}})})}function mQ({onReasonSelect:n,onClose:e}){const[t,r]=_e("reason"),i=A=>{A==="other"?r("other-reason"):n(A)};return C(vd,{className:`obi-exit-survey ${t==="reason"?"obi-exit-survey-reason":""}`,children:t==="reason"?C(yQ,{onReasonSelect:i}):C(wQ,{onReasonSelect:i,onClose:e})})}function vQ({onContinue:n,onWrapUp:e}){return C("div",{className:"obi-exit-survey-container",children:[C("h2",{className:"obi-exit-survey-title",children:"Wrapping up early?"}),C("div",{className:"obi-exit-survey-options",children:[C("button",{className:"obi-button obi-exit-survey-button obi-exit-survey-button-continue",onClick:n,type:"button",children:"No, let's continue"}),C("button",{className:"obi-button obi-exit-survey-button obi-exit-survey-button-wrap-up",onClick:e,type:"button",children:"Yes, let's wrap up"})]})]})}function yQ({onReasonSelect:n}){return C("div",{className:"obi-exit-survey-container obi-exit-survey-reason-container",children:[C("div",{className:"obi-exit-survey-header",children:C("h2",{className:"obi-exit-survey-title obi-exit-survey-reason-title",children:"Quick feedback?"})}),C("div",{className:"obi-exit-survey-options obi-exit-survey-reason-options",children:[C("button",{className:"obi-button obi-exit-survey-button obi-exit-survey-reason-button",onClick:()=>n("testing"),type:"button",children:"Will do later"}),C("button",{className:"obi-button obi-exit-survey-button obi-exit-survey-reason-button",onClick:()=>n("no-time"),type:"button",children:"Can't talk right now"}),C("button",{className:"obi-button obi-exit-survey-button obi-exit-survey-reason-button",onClick:()=>n("format-mismatch"),type:"button",children:"Prefer written instructions"}),C("button",{className:"obi-button obi-exit-survey-button obi-exit-survey-reason-button",onClick:()=>n("technical-issue"),type:"button",children:"Experienced technical issues"}),C("button",{className:"obi-button obi-exit-survey-button obi-exit-survey-reason-button",onClick:()=>n("other"),type:"button",children:"Other"})]})]})}function wQ({onReasonSelect:n,onClose:e}){return C("div",{className:"obi-exit-survey-container obi-exit-survey-reason-container",children:[C("div",{className:"obi-exit-survey-header",children:[C(ly,{onClose:e}),C("h2",{className:"obi-exit-survey-title obi-exit-survey-reason-title",children:"Tell us more"})]}),C("div",{className:"obi-exit-survey-options obi-exit-survey-reason-options",children:[C("textarea",{className:"obi-exit-survey-button obi-exit-survey-reason-button",placeholder:"What's on your mind?"}),C("button",{className:"obi-button obi-exit-survey-button obi-exit-survey-button-wrap-up",onClick:()=>n("other-feedback"),type:"button",children:"Send feedback"})]})]})}function bQ(n,e){for(var t in e)n[t]=e[t];return n}function vy(n,e){for(var t in n)if(t!=="__source"&&!(t in e))return!0;for(var r in e)if(r!=="__source"&&n[r]!==e[r])return!0;return!1}function yy(n,e){this.props=n,this.context=e}(yy.prototype=new Kn).isPureReactComponent=!0,yy.prototype.shouldComponentUpdate=function(n,e){return vy(this.props,n)||vy(this.state,e)};var wy=$.__b;$.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),wy&&wy(n)};var BQ=$.__e;$.__e=function(n,e,t,r){if(n.then){for(var i,A=e;A=A.__;)if((i=A.__c)&&i.__c)return e.__e==null&&(e.__e=t.__e,e.__k=t.__k),i.__c(n,e)}BQ(n,e,t,r)};var by=$.unmount;function By(n,e,t){return n&&(n.__c&&n.__c.__H&&(n.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),n.__c.__H=null),(n=bQ({},n)).__c!=null&&(n.__c.__P===t&&(n.__c.__P=e),n.__c.__e=!0,n.__c=null),n.__k=n.__k&&n.__k.map(function(r){return By(r,e,t)})),n}function Cy(n,e,t){return n&&t&&(n.__v=null,n.__k=n.__k&&n.__k.map(function(r){return Cy(r,e,t)}),n.__c&&n.__c.__P===e&&(n.__e&&t.appendChild(n.__e),n.__c.__e=!0,n.__c.__P=t)),n}function bd(){this.__u=0,this.o=null,this.__b=null}function _y(n){var e=n.__.__c;return e&&e.__a&&e.__a(n)}function wa(){this.i=null,this.l=null}$.unmount=function(n){var e=n.__c;e&&e.__R&&e.__R(),e&&32&n.__u&&(n.type=null),by&&by(n)},(bd.prototype=new Kn).__c=function(n,e){var t=e.__c,r=this;r.o==null&&(r.o=[]),r.o.push(t);var i=_y(r.__v),A=!1,s=function(){A||(A=!0,t.__R=null,i?i(o):o())};t.__R=s;var o=function(){if(!--r.__u){if(r.state.__a){var a=r.state.__a;r.__v.__k[0]=Cy(a,a.__c.__P,a.__c.__O)}var c;for(r.setState({__a:r.__b=null});c=r.o.pop();)c.forceUpdate()}};r.__u++||32&e.__u||r.setState({__a:r.__b=r.__v.__k[0]}),n.then(s,s)},bd.prototype.componentWillUnmount=function(){this.o=[]},bd.prototype.render=function(n,e){if(this.__b){if(this.__v.__k){var t=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=By(this.__b,t,r.__O=r.__P)}this.__b=null}var i=e.__a&&cd(_t,null,n.fallback);return i&&(i.__u&=-33),[cd(_t,null,e.__a?null:n.children),i]};var Sy=function(n,e,t){if(++t[1]===t[0]&&n.l.delete(e),n.props.revealOrder&&(n.props.revealOrder[0]!=="t"||!n.l.size))for(t=n.i;t;){for(;t.length>3;)t.pop()();if(t[1]<t[0])break;n.i=t=t[2]}};(wa.prototype=new Kn).__a=function(n){var e=this,t=_y(e.__v),r=e.l.get(n);return r[0]++,function(i){var A=function(){e.props.revealOrder?(r.push(i),Sy(e,n,r)):i()};t?t(A):A()}},wa.prototype.render=function(n){this.i=null,this.l=new Map;var e=ga(n.children);n.revealOrder&&n.revealOrder[0]==="b"&&e.reverse();for(var t=e.length;t--;)this.l.set(e[t],this.i=[1,0,this.i]);return n.children},wa.prototype.componentDidUpdate=wa.prototype.componentDidMount=function(){var n=this;this.l.forEach(function(e,t){Sy(n,t,e)})};var CQ=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,_Q=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,SQ=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,kQ=/[A-Z0-9]/g,EQ=typeof document<"u",UQ=function(n){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(n)};Kn.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(n){Object.defineProperty(Kn.prototype,n,{configurable:!0,get:function(){return this["UNSAFE_"+n]},set:function(e){Object.defineProperty(this,n,{configurable:!0,writable:!0,value:e})}})});var ky=$.event;function TQ(){}function IQ(){return this.cancelBubble}function FQ(){return this.defaultPrevented}$.event=function(n){return ky&&(n=ky(n)),n.persist=TQ,n.isPropagationStopped=IQ,n.isDefaultPrevented=FQ,n.nativeEvent=n};var xQ={enumerable:!1,configurable:!0,get:function(){return this.class}},Ey=$.vnode;$.vnode=function(n){typeof n.type=="string"&&function(e){var t=e.props,r=e.type,i={},A=r.indexOf("-")===-1;for(var s in t){var o=t[s];if(!(s==="value"&&"defaultValue"in t&&o==null||EQ&&s==="children"&&r==="noscript"||s==="class"||s==="className")){var a=s.toLowerCase();s==="defaultValue"&&"value"in t&&t.value==null?s="value":s==="download"&&o===!0?o="":a==="translate"&&o==="no"?o=!1:a[0]==="o"&&a[1]==="n"?a==="ondoubleclick"?s="ondblclick":a!=="onchange"||r!=="input"&&r!=="textarea"||UQ(t.type)?a==="onfocus"?s="onfocusin":a==="onblur"?s="onfocusout":SQ.test(s)&&(s=a):a=s="oninput":A&&_Q.test(s)?s=s.replace(kQ,"-$&").toLowerCase():o===null&&(o=void 0),a==="oninput"&&i[s=a]&&(s="oninputCapture"),i[s]=o}}r=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=ga(t.children).forEach(function(c){c.props.selected=i.value.indexOf(c.props.value)!=-1})),r=="select"&&i.defaultValue!=null&&(i.value=ga(t.children).forEach(function(c){c.props.selected=i.multiple?i.defaultValue.indexOf(c.props.value)!=-1:i.defaultValue==c.props.value})),t.class&&!t.className?(i.class=t.class,Object.defineProperty(i,"className",xQ)):(t.className&&!t.class||t.class&&t.className)&&(i.class=i.className=t.className),e.props=i}(n),n.$$typeof=CQ,Ey&&Ey(n)};var Uy=$.__r;$.__r=function(n){Uy&&Uy(n),n.__c};var Ty=$.diffed;$.diffed=function(n){Ty&&Ty(n);var e=n.props,t=n.__e;t!=null&&n.type==="textarea"&&"value"in e&&e.value!==t.value&&(t.value=e.value==null?"":e.value)};function QQ(n){const{placeholder:e="Type your message...",value:t,defaultValue:r,onChange:i,onSend:A,onCancel:s,onExpand:o,isLoading:a=!1,disabled:c=!1,maxLength:u=500,children:l}=n,[d,h]=_e(t||r||""),[f,p]=_e((t||r||"").length>24),g=kn(null);pd(()=>{f&&(o==null||o(!0))},[]);const v=t!==void 0?t:d,y=w=>{const _=w.currentTarget.value;t===void 0&&h(_),i==null||i(_)},b=w=>{w.key==="Escape"&&(h(t||r||""),p(!1),s==null||s()),w.key==="Enter"&&!w.shiftKey&&v.trim()&&(w.preventDefault(),h(t||r||""),p(!1),B()),(v||"").length>=24&&!f&&(p(!0),o==null||o(!0))};Nt(()=>{g.current&&g.current.focus()},[g.current]);const B=()=>{!v.trim()||a||c||(A==null||A(v.trim()),t===void 0&&h(""))};return C("div",{className:`obi-message-input ${f?"expanded":""}`,children:[C("div",{className:"container",children:C("textarea",{ref:g,className:"field",placeholder:e,value:v,onInput:y,onKeyDown:b,disabled:c||a,maxLength:u,rows:1})}),C("div",{className:"button-container",children:[f&&C("div",{children:l}),C("button",{className:"obi-button send",onClick:B,disabled:!v.trim()||a||c,type:"button",children:C("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:C("path",{d:"M6.00016 10.6673V1.33398M6.00016 1.33398L1.3335 6.00065M6.00016 1.33398L10.6668 6.00065",stroke:"#F3F3F3","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round"})})})]})]})}function RQ(n){const{currentStep:e,totalSteps:t,stepNames:r,className:i}=n,A=Array.from({length:t},(a,c)=>({isCompleted:c<e,stepNumber:c+1})),s=r[e-1]||`Step ${e}`,o=`${e}/${t} • ${s}`;return C("div",{class:`obi-course-progress ${i||""}`,children:[C("div",{class:"obi-course-progress-steps",children:A.map((a,c)=>C("div",{class:"obi-course-progress-container",children:C("div",{class:`obi-course-progress-step ${a.isCompleted?"completed":""}`})},c))}),C("div",{class:"obi-course-progress-description",children:o})]})}function PQ(n){const{disabled:e,inPlan:t,isPaused:r}=n,[i,A]=_e(null),[s,o]=_e(n.isActive??n.defaultIsActive??!1),[a,c]=_e(!1),[u,l]=_e(n.cancelling??!1),[d,h]=_e(n.messaging??!1),[f,p]=_e(!1),[g,v]=_e(!1);pd(()=>{n.messaging!==void 0&&h(n.messaging)},[n.messaging]);function y(){o(!0),c(!1),v(!0),n.messaging!==void 0&&h(n.messaging)}function b(){}function B(){i&&(clearTimeout(i),A(null))}function w(){A(setTimeout(()=>{o(n.defaultIsActive??!1),v(!1)},400))}function _(ye){var At;p(!1),(At=n.onMessage)==null||At.call(n,ye)}function k(){h(!1),p(!1),o(!1),c(!0)}function T(){h(!1),l(!0),p(!1)}function I(){var ye;t||((ye=n.onOpen)==null||ye.call(n))}function x(){var ye;(ye=n.onMessage)==null||ye.call(n,"Okay, let's continue.")}function F(ye){var At;n.messaging===void 0&&((At=n.onMessagingChange)==null||At.call(n,ye),h(ye)),ye||p(!1)}const Q=n.isActive??((s||t)&&!a&&!e),D=Q&&t,X=Q&&t&&!f,N=n.speakingStatus==="user-speaking",q=n.speakingStatus==="thinking",ge=n.speakingStatus==="busy",Y=Q&&!t&&!u&&g,re=Q&&t&&r&&!N&&!u,xe=Q&&t&&r&&N&&!u,je=Q&&t&&!r&&N&&!u,be=Q&&t&&!r&&ge&&!u,dt=d&&N,Qe=Y||re||xe||je||u,De=400,te=Q&&t&&!f,Ze=Y?5:10;return!t&&!u?C(OQ,{...n}):!t&&u?C(MQ,{onCancelReason:ye=>{var At;o(n.defaultIsActive??!1),l(!1),(At=n.onCancelReason)==null||At.call(n,ye)},onClose:()=>{o(n.defaultIsActive??!1),l(!1)}}):C(vd,{className:`obi-widget-panel ${D?"expanded":""} ${f?"maximized":""} ${d?"messaging":""} ${ge?"tool-usage":""}`,children:[C("div",{className:`obi-widget ${Q?"active":""} ${t?"in-plan":""}`,onMouseEnter:B,onMouseLeave:w,children:[X&&C(hn,{type:"cancel",onClick:T,disabled:u,title:"Cancel session"}),X&&!r&&C(hn,{type:"pause",onClick:n.onPause,title:"Pause session"}),X&&r&&C(hn,{type:"play",onClick:n.onUnpause,title:"Unpause session"}),C(Kt,{className:"obi-widget-popout",open:Qe,trigger:null,delayMs:De,offset:Ze,children:[C(Kt.Target,{children:[dt&&C(QQ,{value:n.message,defaultValue:"Okay, let's continue.",onCancel:()=>F(!1),onSend:_,onExpand:p,children:C("div",{className:"obi-widget-buttons",children:[C(hn,{type:"cancel",onClick:T,disabled:u,title:"Cancel session"}),!r&&C(hn,{type:"pause",onClick:n.onPause,title:"Pause session"}),r&&C(hn,{type:"play",onClick:n.onUnpause,title:"Unpause session"}),C(hn,{type:d?"voice":"message",disabled:!N||n.messaging!==void 0,onClick:()=>F(!d),title:d?"Voice input":"Text input"}),C(hn,{type:"minimize",onClick:k,title:"Minimize widget"})]})}),!dt&&C(yd,{className:Q&&!t?"button":"",isActive:Q,speakingStatus:n.speakingStatus,onClick:I,onMouseEnter:y,onMouseLeave:b,children:[Q&&!t&&!be&&C("span",{className:"obi-widget-pill-text",children:"Tutorials"}),Q&&t&&be&&C("span",{className:"obi-widget-pill-text",children:"Searching knowledge ..."}),Q&&t&&!q&&!be&&C(gy,{getBands:n.spectrum}),Q&&q&&!be&&C(my,{})]})]}),C(Kt.Content,{children:C("div",{onMouseLeave:w,children:[Y&&C(qA,{onClick:I,children:"Click to see all"}),re&&C(qA,{children:"Session will pause shortly"}),xe&&C(qA,{children:"Paused"}),je&&C(qA,{onClick:x,children:"Ready to continue?"}),u&&C(gQ,{onContinue:()=>{l(!1),n.messaging!==void 0&&h(n.messaging)},onWrapUp:()=>{var ye;(ye=n.onCancel)==null||ye.call(n)}})]})})]}),X&&C(hn,{type:d?"voice":"message",disabled:!N||n.messaging!==void 0,onClick:()=>F(!d),title:d?"Voice input":"Text input"}),X&&C(hn,{type:"minimize",onClick:k,title:"Minimize widget"})]}),te&&n.courseProgress&&C("div",{className:`obi-course-progress-container ${d?"expanded":""}`,children:C(RQ,{currentStep:n.courseProgress.currentStep,totalSteps:n.courseProgress.totalSteps,stepNames:n.courseProgress.stepNames})})]})}function OQ(n){const{disabled:e}=n,[t,r]=_e(null),[i,A]=_e(n.isActive??n.defaultIsActive??!1),[s,o]=_e(!1),[a,c]=_e(n.hovered??!1);function u(){A(!0),o(!1),c(!0)}function l(){}function d(){t&&(clearTimeout(t),r(null))}function h(){i&&r(setTimeout(()=>{A(n.defaultIsActive??!1),c(!1)},400))}function f(){A(!1),o(!0)}function p(){var B;(B=n.onOpen)==null||B.call(n)}const g=n.hovered??(a&&!s),v=n.isActive??(i&&!e&&!s),y=v&&g,b=`round-button ${v?"active":""}`;return C("div",{className:"obi-widget-out-of-plan-container",children:C("div",{className:`obi-widget-out-of-plan ${g?"hover":""} ${v?"active":""}`,onMouseEnter:d,onMouseLeave:h,children:[C("div",{className:b,style:{width:"27px",height:"30px"}}),C(Kt,{className:"obi-widget-popout",open:y,trigger:null,delayMs:400,offset:5,children:[C(Kt.Target,{children:C(hy,{className:v?"button":"",active:v,onClick:p,onMouseEnter:u,onMouseLeave:l,children:v&&C("span",{className:"text",children:"Tutorials"})})}),C(Kt.Content,{children:C("div",{onMouseLeave:h,children:C(qA,{className:"message",onClick:p,children:"Click to see all"})})})]}),C(hn,{className:b,type:"minimize",onClick:f,title:"Minimize widget"})]})})}function MQ(n){return C("div",{className:"obi-widget-out-of-plan-container",children:C("div",{className:"obi-widget-out-of-plan",children:C(Kt,{className:"obi-widget-popout",open:!0,trigger:null,delayMs:100,offset:5,children:[C(Kt.Target,{children:C(hy,{active:!1})}),C(Kt.Content,{children:C(mQ,{onReasonSelect:e=>{var t;(t=n.onCancelReason)==null||t.call(n,e)},onClose:()=>{var e;(e=n.onClose)==null||e.call(n)}})})]})})})}function LQ({open:n=!1,children:e,onClose:t}){return C(dy,{open:n,onClose:t,children:C("div",{className:"tour content-area",children:n?typeof e=="function"?e():e:null})})}function Hi({title:n="",subtitle:e="",agentName:t="Obi",buttonText:r="Continue",speakingState:i=null,actionDisabled:A=!1,href:s=null,centerVisual:o,description:a,button:c,onAction:u}){const[l,d]=_e(A),[h,f]=_e(!1),[p,g]=_e(i);return Nt(()=>{h||(i==="listening"&&p!=="listening"&&l&&d(!1),i!=="listening"&&!l&&d(!0)),g(i)},[i,l]),Nt(()=>{d(A)},[A]),C("div",{className:"tour-content",children:C("div",{className:"container",children:[C("div",{className:"header",children:[C("h1",{className:"title",children:n}),C("p",{className:"subtitle",children:e})]}),C("div",{className:"visual",style:{background:"var(--obi-color-tint)"},children:o}),C("div",{className:"description",children:a}),C("div",{className:"button-container",children:c||C(s?"a":"button",{className:`action-button ${l?"disabled":""}`,onClick:()=>{l||(d(!0),f(!0),u==null||u())},disabled:l,...s?{href:s,target:"_blank",rel:"noopener noreferrer"}:{type:"button"},children:C("span",{className:"button-text",children:(()=>{switch(i){case"thinking":return"Loading...";case"speaking":return`${t} is speaking`;default:return r}})()})})})]})})}function DQ({logoUrl:n="",appName:e="App"}){const[t,r]=_e(!1),[i,A]=_e(!1),s=()=>{r(!0)},o=()=>{A(!0),r(!1)},a={container:{display:"block"},logoContainer:{width:"480px",height:"240px",borderRadius:"12px",display:"flex",alignItems:"center",justifyContent:"center",position:"relative",overflow:"hidden"},backgroundPattern:{position:"absolute",inset:0,zIndex:0,background:"#F5F5F5",backgroundImage:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='277' height='195' viewBox='0 0 277 195' fill='none'%3E%3Cpath opacity='0.4' d='M341.308 0.75C380.279 0.750001 411.872 24.3772 411.872 53.5229C411.872 82.6685 380.279 106.296 341.308 106.296H215.792C176.964 108.335 145.691 130.837 141.128 159.475V256.616C145.912 286.659 180.089 309.954 221.548 309.954H330.872C375.607 309.954 411.872 282.833 411.872 249.377V159.069C411.872 129.923 443.465 106.296 482.436 106.296C521.407 106.296 553 129.923 553 159.069V257.181C553 285.058 524.099 307.88 487.483 309.815C489.264 309.902 491.061 309.954 492.871 309.954C448.137 309.954 411.872 337.076 411.872 370.532C411.872 369.177 411.803 367.834 411.686 366.502C409.098 393.885 378.582 415.5 341.308 415.5H210.118C171.147 415.5 139.554 391.873 139.554 362.727C139.554 362.204 139.565 361.683 139.585 361.163C133.564 332.156 100.023 309.954 59.5488 309.954C61.4544 309.954 63.3441 309.9 65.2169 309.803C28.7434 307.76 -8.57239e-07 284.982 0 257.181V159.069C1.64632e-06 130.901 29.5078 107.89 66.6662 106.377C64.3207 106.224 61.9472 106.141 59.5488 106.141C100.012 106.141 133.54 83.951 139.575 54.9552C139.558 54.4793 139.554 54.0018 139.554 53.5229C139.554 24.3772 171.147 0.75 210.118 0.75H341.308Z' fill='white'/%3E%3C/svg%3E")`,backgroundRepeat:"no-repeat",backgroundPosition:"190px 60px",backgroundSize:"300px 225px"},logoWrapper:{background:"#888888",width:"120px",height:"120px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",zIndex:10,overflow:"hidden"},appLogo:{width:"120px",height:"120px",objectFit:"cover",display:n&&!t&&i?"block":"none"},placeholderLogo:{width:"60px",height:"60px",background:"rgba(255, 255, 255, 0.2)",borderRadius:"4px",display:!n||t||!i?"flex":"none",alignItems:"center",justifyContent:"center",color:"rgba(255, 255, 255, 0.8)",fontSize:"24px",fontWeight:"bold"}};return C("div",{style:a.container,children:C("div",{style:a.logoContainer,children:[C("div",{style:a.backgroundPattern}),C("div",{style:a.logoWrapper,children:[n&&C("img",{style:a.appLogo,src:n,alt:`${e} logo`,onError:s,onLoad:o}),C("div",{style:a.placeholderLogo,children:e.charAt(0).toUpperCase()})]})]})})}function HQ({session:n,speakingState:e,onAction:t}){const r=n.appName?`Navigate to ${n.appName}`:"Navigate to app",i=n.appName?`Open ${n.appName}`:"Open app",A=n.appName?`Enjoy the tutorial in ${n.appName}`:"Enjoy the tutorial";return C(Hi,{title:r,subtitle:"Click the button below to open the app",agentName:n.agentName||"Obi",buttonText:i,speakingState:e,actionDisabled:!0,href:n.url,description:A,centerVisual:C(DQ,{logoUrl:n.appLogoUrl,appName:n.appName}),onAction:t})}function Iy({className:n=""}){return C("svg",{width:"64",height:"64",viewBox:"0 0 256 256",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,children:C("path",{d:"M158.803 0L160.352 0.0399439C176.267 0.844061 188.922 13.9634 188.922 30.0311C188.922 46.6174 175.438 60.0653 158.803 60.0656H99.0263L98.9061 60.0722C78.8071 61.4795 62.6269 77.004 60.2644 96.7673L60.241 96.9704V158.93L60.2644 159.13C62.7406 179.86 80.4234 195.934 101.881 195.935H153.842C176.993 195.935 195.759 177.223 195.759 154.14V96.9138L195.799 95.3693C196.606 79.5009 209.766 66.8827 225.881 66.8827C242.515 66.8834 256 80.328 256 96.9138V159.086L255.963 160.564C255.225 175.748 243.176 187.971 228.038 189.038V189.214C207.121 190.591 190.4 207.263 189.019 228.119H188.842C187.738 243.7 174.712 256 158.803 256H96.4491C79.8147 256 66.3309 242.555 66.3302 225.969C66.3302 225.673 66.3349 225.375 66.3436 225.077H66.3503H66.3035C63.3344 206.008 47.4427 190.589 27.8321 189.231L27.8354 189.031C12.2702 187.868 0.000167669 174.905 0 159.086V96.9138L0.0367222 95.4192C0.791087 80.0787 13.0909 67.7634 28.453 66.9293C47.7697 65.3039 63.3522 50.3234 66.2969 31.4658L66.3469 31.1595L66.3369 30.85C66.3301 30.5933 66.3302 30.3238 66.3302 30.0311C66.3309 13.4454 79.8148 0.000165137 96.4491 0H158.803Z",fill:"currentColor"})})}function NQ({children:n}){const e={container:{position:"relative",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},logo:{display:"flex",width:"120px",height:"120px",justifyContent:"center",alignItems:"center",aspectRatio:"1/1",borderRadius:"8px",color:"#FFFFFF",position:"relative",overflow:"hidden",background:"var(--obi-color-primary)",boxShadow:`
48
47
  0 0 20px color-mix(in srgb, var(--obi-color-primary) 20%, transparent),
49
48
  0 0 40px color-mix(in srgb, var(--obi-color-primary) 15%, transparent),
50
49
  0 0 60px color-mix(in srgb, var(--obi-color-primary) 8%, transparent)
51
- `.replace(/\s+/g," ").trim()},logoIcon:{width:"64px",height:"64px",color:"inherit",fill:"currentColor"}};return p("div",{style:e.container,children:p("div",{style:e.logo,children:t||p(of,{className:"logo-icon"})})})}function hU({session:t,speakingState:e,onAction:A}){return p(Zt,{title:t.name,subtitle:`Voice AI Tutorial by ${t.agentName||"Obi"}`,description:t.description,agentName:t.agentName||"Obi",speakingState:e,centerVisual:p(dU,{}),onAction:A})}function fU(){const t={host:{display:"block",position:"relative",width:"100%",height:"100%"},container:{position:"relative",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},permissionDialog:{boxSizing:"border-box",display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center",padding:"16px 20px",gap:"16px",position:"absolute",width:"344px",height:"125px",left:"calc(50% - 344px/2)",top:"calc(50% - 125px/2)",background:"#FFFFFF",border:"1px solid #E5E7EB",boxShadow:"0px 10px 15px -3px rgba(0, 0, 0, 0.1), 0px 4px 6px -2px rgba(0, 0, 0, 0.05)",borderRadius:"8px"},permissionContent:{width:"100%",display:"flex",flexDirection:"column",gap:"16px"},permissionContentTop:{display:"flex",flexDirection:"row",alignItems:"center",padding:"0px",gap:"16px"},micIconContainer:{color:"var(--obi-color-text)",boxSizing:"border-box",display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",padding:"12px",gap:"8px",width:"48px",height:"48px",background:"#F9FAFB",border:"1px solid #D1D5DB",borderRadius:"6px",flex:"none",order:0,flexGrow:0},micIcon:{width:"24px",height:"24px",flex:"none",order:0,flexGrow:0},permissionText:{flex:1,height:"24px",fontFamily:"'Inter', sans-serif",fontStyle:"normal",fontWeight:500,fontSize:"16px",lineHeight:"24px",display:"flex",alignItems:"center",color:"#111827",flexGrow:1,order:1},allowButton:{alignSelf:"flex-end",boxSizing:"border-box",display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",padding:"10px 20px",gap:"8px",minWidth:"80px",height:"40px",background:"#F9FAFB",border:"1px solid #D1D5DB",borderRadius:"6px",flex:"none",order:2,flexGrow:0,cursor:"pointer",fontFamily:"'Inter', sans-serif",fontStyle:"normal",fontWeight:500,fontSize:"14px",lineHeight:"20px",color:"#374151"},cursorPointer:{position:"absolute",width:"24px",height:"24px",right:"80px",bottom:"60px",zIndex:3,animation:"pointToAllow 2s ease-in-out infinite"},cursorSvg:{width:"100%",height:"100%",filter:"drop-shadow(0px 1px 1.8px rgba(0, 0, 0, 0.65))"}};return p("div",{style:t.host,children:[p("style",{children:`
50
+ `.replace(/\s+/g," ").trim()},logoIcon:{width:"64px",height:"64px",color:"inherit",fill:"currentColor"}};return C("div",{style:e.container,children:C("div",{style:e.logo,children:n||C(Iy,{className:"logo-icon"})})})}function KQ({session:n,speakingState:e,onAction:t}){return C(Hi,{title:n.name,subtitle:`Voice AI Tutorial by ${n.agentName||"Obi"}`,description:n.description,agentName:n.agentName||"Obi",speakingState:e,centerVisual:C(NQ,{}),onAction:t})}function VQ(){const n={host:{display:"block",position:"relative",width:"100%",height:"100%"},container:{position:"relative",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},permissionDialog:{boxSizing:"border-box",display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center",padding:"16px 20px",gap:"16px",position:"absolute",width:"344px",height:"125px",left:"calc(50% - 344px/2)",top:"calc(50% - 125px/2)",background:"#FFFFFF",border:"1px solid #E5E7EB",boxShadow:"0px 10px 15px -3px rgba(0, 0, 0, 0.1), 0px 4px 6px -2px rgba(0, 0, 0, 0.05)",borderRadius:"8px"},permissionContent:{width:"100%",display:"flex",flexDirection:"column",gap:"16px"},permissionContentTop:{display:"flex",flexDirection:"row",alignItems:"center",padding:"0px",gap:"16px"},micIconContainer:{color:"var(--obi-color-text)",boxSizing:"border-box",display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",padding:"12px",gap:"8px",width:"48px",height:"48px",background:"#F9FAFB",border:"1px solid #D1D5DB",borderRadius:"6px",flex:"none",order:0,flexGrow:0},micIcon:{width:"24px",height:"24px",flex:"none",order:0,flexGrow:0},permissionText:{flex:1,height:"24px",fontFamily:"'Inter', sans-serif",fontStyle:"normal",fontWeight:500,fontSize:"16px",lineHeight:"24px",display:"flex",alignItems:"center",color:"#111827",flexGrow:1,order:1},allowButton:{alignSelf:"flex-end",boxSizing:"border-box",display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",padding:"10px 20px",gap:"8px",minWidth:"80px",height:"40px",background:"#F9FAFB",border:"1px solid #D1D5DB",borderRadius:"6px",flex:"none",order:2,flexGrow:0,cursor:"pointer",fontFamily:"'Inter', sans-serif",fontStyle:"normal",fontWeight:500,fontSize:"14px",lineHeight:"20px",color:"#374151"},cursorPointer:{position:"absolute",width:"24px",height:"24px",right:"80px",bottom:"60px",zIndex:3,animation:"pointToAllow 2s ease-in-out infinite"},cursorSvg:{width:"100%",height:"100%",filter:"drop-shadow(0px 1px 1.8px rgba(0, 0, 0, 0.65))"}};return C("div",{style:n.host,children:[C("style",{children:`
52
51
  @keyframes pointToAllow {
53
52
  0%, 100% { transform: translate(0, 0); }
54
53
  50% { transform: translate(2px, -1px); }
55
54
  }
56
- `}),p("div",{style:t.container,children:[p("div",{style:t.permissionDialog,children:p("div",{style:t.permissionContent,children:[p("div",{style:t.permissionContentTop,children:[p("div",{style:t.micIconContainer,children:p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:t.micIcon,children:[p("path",{d:"M12 19v3"}),p("path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"}),p("rect",{x:"9",y:"2",width:"6",height:"13",rx:"3"})]})}),p("div",{style:t.permissionText,children:"Use your microphone"})]}),p("button",{style:t.allowButton,children:"Allow"})]})}),p("div",{style:t.cursorPointer,children:p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:t.cursorSvg,children:[p("path",{d:"M12.586 12.586 19 19"}),p("path",{d:"M3.688 3.037a.497.497 0 0 0-.651.651l6.5 15.999a.501.501 0 0 0 .947-.062l1.569-6.083a2 2 0 0 1 1.448-1.479l6.124-1.579a.5.5 0 0 0 .063-.947z"})]})})]})]})}function gU({session:t,speakingState:e,onAction:A}){return p(Zt,{title:"Connect your microphone",subtitle:"Watch for the prompt in your browser",agentName:t.agentName||"Obi",buttonText:"Continue",speakingState:e,actionDisabled:!0,description:`${t.agentName||"Obi"} will guide you through the tutorial by talking with you.`,centerVisual:p(fU,{}),onAction:A})}function pU({}){return p("div",{style:{borderRadius:"15px",boxShadow:"0 0 20px 2px var(--obi-color-primary)",backgroundColor:"var(--obi-color-primary)",transform:"scale(1.6)"},children:p(ao,{isActive:!0,children:p(Xh,{})})})}function mU({session:t,speakingState:e,onAction:A}){return p(Zt,{title:"Can you hear me?",subtitle:`Make sure your sound is on so you can hear ${t.agentName||"Obi"}`,agentName:t.agentName||"Obi",speakingState:e,actionDisabled:!0,description:`${t.agentName||"Obi"} will guide you through the tutorial by talking with you.`,centerVisual:p(pU,{}),onAction:A})}function BU(){const t={container:{display:"flex",justifyContent:"center",alignItems:"center"},skeletonContainer:{display:"flex",flexDirection:"column",flexShrink:0,gap:"10px",alignItems:"center",padding:"20px",margin:"0 auto",background:"white",borderRadius:"12px",border:"0.569px solid #E4E4E7",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)",height:"234px",width:"344px"},headerSection:{display:"flex",position:"relative",gap:"16px",alignItems:"center",alignSelf:"stretch"},avatar:{position:"relative",background:"#F4F4F5",borderRadius:"50%",height:"55px",width:"55px",flexShrink:0,overflow:"hidden"},textLines:{display:"flex",position:"relative",flexDirection:"column",gap:"10px",alignItems:"flex-start",alignSelf:"stretch",width:"100%"},textLine:{position:"relative",borderRadius:"2px",background:"#F4F4F5",height:"18px",alignSelf:"stretch",overflow:"hidden"},contentSection:{display:"flex",position:"relative",flexDirection:"column",flexShrink:0,gap:"16px",justifyContent:"center",alignItems:"flex-start",alignSelf:"stretch",height:"62px"},contentBlock:{position:"relative",alignSelf:"stretch",borderRadius:"2px",background:"#F4F4F5",flex:"1 0 0",overflow:"hidden"},shimmer:{position:"absolute",top:0,left:"-150px",height:"100%",width:"150px",background:"linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent)",animation:"skeleton-loading 2s infinite"}};return p("div",{style:t.container,children:[p("style",{children:`
55
+ `}),C("div",{style:n.container,children:[C("div",{style:n.permissionDialog,children:C("div",{style:n.permissionContent,children:[C("div",{style:n.permissionContentTop,children:[C("div",{style:n.micIconContainer,children:C("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:n.micIcon,children:[C("path",{d:"M12 19v3"}),C("path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"}),C("rect",{x:"9",y:"2",width:"6",height:"13",rx:"3"})]})}),C("div",{style:n.permissionText,children:"Use your microphone"})]}),C("button",{style:n.allowButton,children:"Allow"})]})}),C("div",{style:n.cursorPointer,children:C("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:n.cursorSvg,children:[C("path",{d:"M12.586 12.586 19 19"}),C("path",{d:"M3.688 3.037a.497.497 0 0 0-.651.651l6.5 15.999a.501.501 0 0 0 .947-.062l1.569-6.083a2 2 0 0 1 1.448-1.479l6.124-1.579a.5.5 0 0 0 .063-.947z"})]})})]})]})}function GQ({session:n,speakingState:e,onAction:t}){return C(Hi,{title:"Connect your microphone",subtitle:"Watch for the prompt in your browser",agentName:n.agentName||"Obi",buttonText:"Continue",speakingState:e,actionDisabled:!0,description:`${n.agentName||"Obi"} will guide you through the tutorial by talking with you.`,centerVisual:C(VQ,{}),onAction:t})}function jQ({}){return C("div",{style:{borderRadius:"15px",boxShadow:"0 0 20px 2px var(--obi-color-primary)",backgroundColor:"var(--obi-color-primary)",transform:"scale(1.6)"},children:C(yd,{isActive:!0,children:C(my,{})})})}function WQ({session:n,speakingState:e,onAction:t}){return C(Hi,{title:"Can you hear me?",subtitle:`Make sure your sound is on so you can hear ${n.agentName||"Obi"}`,agentName:n.agentName||"Obi",speakingState:e,actionDisabled:!0,description:`${n.agentName||"Obi"} will guide you through the tutorial by talking with you.`,centerVisual:C(jQ,{}),onAction:t})}function qQ(){const n={container:{display:"flex",justifyContent:"center",alignItems:"center"},skeletonContainer:{display:"flex",flexDirection:"column",flexShrink:0,gap:"10px",alignItems:"center",padding:"20px",margin:"0 auto",background:"white",borderRadius:"12px",border:"0.569px solid #E4E4E7",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)",height:"234px",width:"344px"},headerSection:{display:"flex",position:"relative",gap:"16px",alignItems:"center",alignSelf:"stretch"},avatar:{position:"relative",background:"#F4F4F5",borderRadius:"50%",height:"55px",width:"55px",flexShrink:0,overflow:"hidden"},textLines:{display:"flex",position:"relative",flexDirection:"column",gap:"10px",alignItems:"flex-start",alignSelf:"stretch",width:"100%"},textLine:{position:"relative",borderRadius:"2px",background:"#F4F4F5",height:"18px",alignSelf:"stretch",overflow:"hidden"},contentSection:{display:"flex",position:"relative",flexDirection:"column",flexShrink:0,gap:"16px",justifyContent:"center",alignItems:"flex-start",alignSelf:"stretch",height:"62px"},contentBlock:{position:"relative",alignSelf:"stretch",borderRadius:"2px",background:"#F4F4F5",flex:"1 0 0",overflow:"hidden"},shimmer:{position:"absolute",top:0,left:"-150px",height:"100%",width:"150px",background:"linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent)",animation:"skeleton-loading 2s infinite"}};return C("div",{style:n.container,children:[C("style",{children:`
57
56
  @keyframes skeleton-loading {
58
57
  0% { transform: translateX(-150px); }
59
58
  50% { transform: translateX(344px); }
60
59
  100% { transform: translateX(344px); }
61
60
  }
62
- `}),p("article",{style:t.skeletonContainer,role:"status","aria-label":"Loading content",children:[p("section",{style:t.headerSection,children:[p("div",{style:t.avatar,role:"img","aria-label":"Loading avatar",children:p("div",{style:t.shimmer})}),p("div",{style:t.textLines,children:[p("div",{style:t.textLine,role:"presentation","aria-label":"Loading text line 1",children:p("div",{style:t.shimmer})}),p("div",{style:t.textLine,role:"presentation","aria-label":"Loading text line 2",children:p("div",{style:t.shimmer})})]})]}),p("section",{style:t.contentSection,children:p("div",{style:t.contentBlock,role:"presentation","aria-label":"Loading card content",children:p("div",{style:t.shimmer})})})]})]})}function vU({}){const t={host:{display:"block"},shareContainer:{width:"480px",height:"240px",borderRadius:"12px",display:"grid",placeItems:"center",overflow:"hidden",position:"relative",backgroundColor:"var(--obi-color-tint)"},controlsRow:{zIndex:10,gridRowStart:1,gridColumnStart:1,display:"flex",alignSelf:"flex-start",marginTop:"36px",alignItems:"center",gap:"8px"},monitorIconContainer:{display:"flex",height:"40px",width:"40px",aspectRatio:"1",alignItems:"center",justifyContent:"center",gap:"8px",borderRadius:"2px",border:"1px solid #E4E4E7",background:"#F8FAFC",padding:"8px"},monitorIcon:{width:"24px",height:"24px",color:"#111827"},tabSelector:{display:"flex",width:"260px",height:"40px",padding:"4px",alignItems:"center",borderRadius:"2px",background:"#E4E4E7"},tabButton:e=>({display:"flex",flex:1,alignSelf:"stretch",alignItems:"center",justifyContent:"center",gap:"10px",borderRadius:"2px",padding:"6px 12px",border:"none",cursor:"pointer",fontFamily:"'Satoshi', sans-serif",fontSize:"14px",fontWeight:500,opacity:e?1:.4,background:e?"white":"#F8FAFC",boxShadow:e?"0 1px 2px 0 rgba(0, 0, 0, 0.05)":"none"}),skeletonContainer:{marginTop:"104px",gridColumnStart:1,gridRowStart:1,alignSelf:"center"}};return p("div",{style:t.host,children:p("div",{style:t.shareContainer,children:[p("div",{style:t.controlsRow,children:[p("div",{style:t.monitorIconContainer,children:p("svg",{style:t.monitorIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[p("rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",ry:"2"}),p("line",{x1:"8",x2:"16",y1:"21",y2:"21"}),p("line",{x1:"12",x2:"12",y1:"17",y2:"21"})]})}),p("div",{style:t.tabSelector,children:[p("button",{style:t.tabButton(!1),children:"Tab"}),p("button",{style:t.tabButton(!0),children:"Window"})]})]}),p("div",{style:t.skeletonContainer,children:p(BU,{})})]})})}function CU({session:t,speakingState:e,onAction:A}){return p(Zt,{title:"Connect your screen",subtitle:"Watch for the prompt in your browser",agentName:t.agentName||"Obi",buttonText:"Share screen",speakingState:e,description:`${t.agentName||"Obi"} will guide you through ${t.appName||"the app"} by watching your screen.`,centerVisual:p(vU,{}),actionDisabled:!0,onAction:A})}function wU({spectrum:t}){return p("div",{style:{borderRadius:"15px",boxShadow:"0 0 20px 2px var(--obi-color-primary)",backgroundColor:"var(--obi-color-primary)",transform:"scale(1.6)"},children:p(ao,{isActive:!0,children:p(Jh,{getBands:t})})})}function bU({session:t,speakingState:e,spectrum:A,onAction:n}){return p(Zt,{title:"Overview",subtitle:`${t.agentName||"Obi"} will start your tutorial in a moment`,agentName:t.agentName||"Obi",speakingState:e,description:`Get ready to explore ${t.appName||"the app"} with ${t.agentName||"Obi"}.`,centerVisual:p(wU,{spectrum:A}),actionDisabled:!0,onAction:n})}function yU({id:t,name:e,description:A,duration:n=10,order:i=0,selected:r=!1,onClick:s}){return p("div",{className:`course-container ${r?"selected":""}`,onClick:()=>{s==null||s({id:t,name:e,description:A,duration:n,order:i})},children:[p("div",{className:"header-row",children:[p("h2",{className:"course-title",children:e}),p("span",{className:"duration",children:["~",n," mins"]})]}),A&&p("p",{className:"course-description",children:A})]})}function UU({courses:t=[],selectedCourseId:e=null,loading:A=!1,error:n="",onCourseSelect:i}){const[r,s]=Z(""),a=l=>{const u=l.currentTarget;s(u.value)},o=l=>{i==null||i(l)};if(A)return p("div",{className:"loading",children:"Loading..."});if(n)return p("div",{className:"error",children:n});if(!t||t.length===0)return p("div",{className:"empty",children:"No courses available"});const c=t.filter(l=>l.name.toLowerCase().includes(r.toLowerCase())||(l.description||"").toLowerCase().includes(r.toLowerCase()));return p("div",{className:"tour-select",children:[p("div",{className:"controls",children:[p("div",{className:"tabs",children:p("button",{className:"tab active",children:"All"})}),p("div",{className:"filter",children:[p("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p("path",{d:"M10.0417 8.75002H9.42087L9.20004 8.53502C9.96921 7.63585 10.4417 6.47502 10.4417 5.20835C10.4417 2.56085 8.32254 0.441681 5.67504 0.441681C3.02754 0.441681 0.908374 2.56085 0.908374 5.20835C0.908374 7.85585 3.02754 9.97502 5.67504 9.97502C6.94171 9.97502 8.10254 9.50252 9.00171 8.73335L9.22671 8.95418V9.57502L13.2167 13.5592L14.375 12.4008L10.0417 8.75002ZM5.67504 8.75002C3.72754 8.75002 2.15837 7.18085 2.15837 5.20835C2.15837 3.23585 3.72754 1.66668 5.67504 1.66668C7.62254 1.66668 9.19171 3.23585 9.19171 5.20835C9.19171 7.18085 7.62254 8.75002 5.67504 8.75002Z",fill:"#6B7280"})}),p("input",{type:"text",placeholder:"Search...",value:r,onInput:a})]})]}),p("div",{className:"course-grid",children:c.sort((l,u)=>(l.order||0)-(u.order||0)).map(l=>{const u=l.id===e;return p(yU,{id:l.id,name:l.name,description:l.description||"",duration:l.duration,order:l.order||0,selected:u,onClick:o},l.id)})})]})}function QU({open:t,courses:e=[],loading:A=!1,error:n="",agentName:i="Obi",onClose:r,onCourseSelect:s}){const[a,o]=Z(null),c=u=>{o(u)},l=()=>{a&&s&&s(a)};return p(Vh,{open:t,onClose:r,size:"large",children:p("div",{className:"tour-select-modal-container",children:[p("div",{className:"header",children:[p("div",{className:"icon",style:{color:"white"},children:p(of,{})}),p("div",{className:"title-section",children:A?p(Pe,{children:[p("div",{className:"skeleton skeleton-title"}),p("div",{className:"skeleton skeleton-subtitle"})]}):p(Pe,{children:[p("h1",{children:["Give ",i," a try!"]}),p("p",{className:"subtitle",children:["Pick a tutorial, share your screen, and ",i," will take it from there."]})]})})]}),p("div",{className:"course-list-wrapper",children:p(UU,{courses:e,selectedCourseId:(a==null?void 0:a.id)||"",loading:A,error:n,onCourseSelect:c})}),p("div",{className:"footer",children:[p("button",{className:"obi-button footer-button",onClick:l,disabled:!a,children:[p("span",{children:"Get started"}),p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",children:p("path",{d:"M3.83325 8.00065H13.1666M13.1666 8.00065L8.49992 3.33398M13.1666 8.00065L8.49992 12.6673",stroke:a?"#FAFAFA":"#999","stroke-width":"1.33","stroke-linecap":"round","stroke-linejoin":"round"})})]}),p("p",{className:"footer-text",children:"Sessions are securely recorded for quality improvement purposes."})]})]})})}function EU({session:t,sessionState:e,speakingState:A,spectrum:n,onStart:i,onContinue:r,onShareMicrophone:s,onShareScreen:a}){function o(){e==="connecting"||e==="connected"||!e?i==null||i():e==="volume-check"||e==="mic-check"?r==null||r():e==="mic-share"?s==null||s():e==="screen-share"&&(a==null||a())}return no(()=>{switch(e){case null:case"connecting":case"connected":return p(hU,{session:t,speakingState:A,onAction:o});case"volume-check":return p(mU,{session:t,speakingState:A,onAction:o});case"mic-check":return p(bU,{session:t,speakingState:A,spectrum:n,onAction:o});case"mic-share":return p(gU,{session:t,speakingState:A,onAction:o});case"screen-share":return p(CU,{session:t,speakingState:A,onAction:o});case"navigate":return p(uU,{session:t,speakingState:A,onAction:o});default:return null}},[e,A,i,r,s,a])}function SU(t){const{session:e,sessionState:A,speakingState:n,spectrum:i,onClose:r,onStart:s,onContinue:a,onShareMicrophone:o,onShareScreen:c}=t,l=(t.open??!0)&&(!A||A==="connecting"||A==="connected"||A==="volume-check"||A==="mic-check"||A==="mic-share"||A==="screen-share"||A==="navigate");return p(cU,{open:l,onClose:r,children:()=>p(EU,{session:e,sessionState:A,speakingState:n,spectrum:i,onStart:s,onContinue:a,onShareMicrophone:o,onShareScreen:c})})}function kU(t){let e=t.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"__DOUBLE_STAR__").replace(/\*/g,"[^/]*").replace(/__DOUBLE_STAR__/g,".*").replace(/\?/g,"[^/]");return new RegExp(`^${e}$`,"i")}function TU(t,e){if(!e||e.length===0)return!1;const A=t.replace(/^https?:\/\//,"").replace(/\/$/,"");return e.some(n=>{try{const i=kU(n);return i.test(A)||i.test(t)}catch(i){return console.warn(`Invalid URL pattern: ${n}`,i),!1}})}function lo(t){if(!t||t.length===0)return!1;const e=window.location.origin+window.location.pathname;return TU(e,t)}function FU(t){var C,w,y,E,F;const[e,A]=Z(!1),[n,i]=Z(!1),[r,s]=Z(null),a=IU(t.sdk,o,t.shadowHost,s);function o(S){var x;(x=a.client)!=null&&x.session||A(S)}if(!a.client)return null;const c=xU((C=a.client.product)==null?void 0:C.widget_url_blacklist);let l=a.isActive;((y=(w=a.client)==null?void 0:w.product)==null?void 0:y.name)==="Canibuild"&&(l=!0);const u=a.client.session,d=!!u,h=d&&!e;let g;switch(u==null?void 0:u.speakingState){case"listening":g="user-speaking";break;case"speaking":g="agent-speaking";break;case"thinking":g="thinking";break;case"busy":g="busy";break}const f=u==null?void 0:u.isPaused,m=a.client.state==="ready"&&l&&!c&&(a.client.selectedPlan||!((E=a.client.product)!=null&&E.widget_link_only_access)),B=h?100:62,b=()=>{var S,x,R,L,M,te;return{name:(S=a.client.selectedPlan)==null?void 0:S.name,description:(x=a.client.selectedPlan)==null?void 0:x.description,appName:(R=a.client.product)==null?void 0:R.name,appLogoUrl:((L=a.client.product)==null?void 0:L.logo_url)||"",url:(M=a.client.product)==null?void 0:M.url,agentName:((te=a.client.product)==null?void 0:te.agent_name)||"Obi"}},U={position:"fixed",top:`calc(100vh - ${B}px)`,left:"50%",transform:"translateX(-50%)",width:"max-content"};return p("div",{children:[e&&p(QU,{open:e,courses:a.client.plans.map(S=>({id:S.uuid,name:S.name,description:S.description||"",duration:S.duration||0})),loading:!1,agentName:((F=a.client.product)==null?void 0:F.agent_name)||"Obi",onCourseSelect:S=>{const x=a.client.plans.find(R=>R.uuid===S.id)||null;x&&(a.client.selectPlan(x),A(!1),i(!0))},onClose:S=>{S==="user-initiated"&&a.client.selectPlan(null),A(!1)}}),m&&p(Pe,{children:[p("div",{style:U,children:p(sU,{inPlan:d,isActive:n?!1:void 0,defaultIsActive:!0,isPaused:f,messaging:(u==null?void 0:u.isMicShared)===!1?!0:void 0,speakingStatus:g,spectrum:()=>(u==null?void 0:u.audioSpectrum())||null,courseProgress:r,onOpen:()=>{A(!0)},onCancel:()=>{var S;(S=a.client.session)==null||S.stop()},onPause:()=>{var S,x;(x=(S=a.client.session)==null?void 0:S.pause)==null||x.call(S)},onUnpause:()=>{var S,x;(x=(S=a.client.session)==null?void 0:S.unpause)==null||x.call(S)},onMessagingChange:S=>{var x,R,L,M;S?(R=(x=a.client.session)==null?void 0:x.muteMicrophone)==null||R.call(x):(M=(L=a.client.session)==null?void 0:L.unmuteMicrophone)==null||M.call(L)},onMessage:S=>{a.say(S)}})}),!!a.client.selectedPlan&&p(SU,{open:!0,session:b(),sessionState:(u==null?void 0:u.state)||null,speakingState:(u==null?void 0:u.speakingState)||null,spectrum:()=>(u==null?void 0:u.audioSpectrum())||null,onClose:S=>{S==="user-initiated"&&a.client.stopSession(),i(!1)},onStart:()=>{a.client.selectedPlanUuid&&a.startSession()},onContinue:()=>{u==null||u.continue()},onShareMicrophone:()=>{u==null||u.shareMicrophone()}})]})]})}function IU(t,e,A,n){const[i,r]=Z(0),[s,a]=Z(null);return Ge(()=>{t.on("showMenu",o=>{e(o)}),t.on("configUpdated",()=>{r(o=>o+1)})},[t]),Ge(()=>{t.client&&(t.client.session&&a(t.client.session),t.client.on("sessionStarted",o=>{a(o),r(c=>c+1)}),t.client.on("sessionStopped",()=>{a(null),r(o=>o+1)}),t.client.on("sessionShutdown",()=>{r(o=>o+1)}),t.client.on("sessionResumed",()=>{r(o=>o+1)}),t.client.on("stateChanged",()=>{var o;t.client.state==="ready"&&A.style.setProperty("--obi-color-primary",((o=t.client.product)==null?void 0:o.primary_color)||"#9500FF"),r(c=>c+1)}),t.client.on("planSelected",()=>{r(o=>o+1)}))},[t,t.client]),Ge(()=>{if(!s)return;s.on("stateChanged",()=>{r(c=>c+1)}),s.on("speakingStateChanged",()=>{r(c=>c+1)}),s.on("paused",()=>{r(c=>c+1)}),s.on("unpaused",()=>{r(c=>c+1)});const o=c=>{n(c)};return s.on&&s.on("courseProgress",o),()=>{s.off&&s.off("courseProgress",o)}},[s]),t}function xU(t){const[e,A]=Z(()=>lo(t));return Ge(()=>{A(lo(t))},[t]),Ge(()=>{_U();const n=()=>{A(lo(t))};return window.addEventListener("locationchange",n),window.addEventListener("popstate",n),window.addEventListener("hashchange",n),()=>{window.removeEventListener("locationchange",n),window.removeEventListener("popstate",n),window.removeEventListener("hashchange",n)}},[t]),e}function _U(){const t=window;if(t.__obi_history_patched)return;const{pushState:e,replaceState:A}=window.history,n=i=>function(...r){const s=i.apply(this,r);return window.dispatchEvent(new Event("locationchange")),s};window.history.pushState=n(e),window.history.replaceState=n(A),t.__obi_history_patched=!0}function PU(t){if(document.querySelector("obi-widget"))return;RU();const e=document.createElement("div");e.id="obi-host",e.style.position="fixed",e.style.zIndex="9999",document.body.appendChild(e);const A=e.attachShadow({mode:"open"}),n=document.createElement("div");n.id="obi-container",A.appendChild(n);const i=new CSSStyleSheet;i.replaceSync(Ty),A.adoptedStyleSheets=[i],Ey(p(FU,{sdk:t,shadowHost:e}),n),console.log("[obi-sdk] widget mounted")}function RU(){cf("https://fonts.cdnfonts.com/css/satoshi"),cf("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap")}function cf(t){const e=document.createElement("link");e.href=t,e.rel="stylesheet",document.head.appendChild(e)}const lf="49206C6F7665204F6269_session",uf="obi-url-params";class LU extends kr{constructor(e){super(),this.client=null,this.isActive=!1,this.primaryColour="#9500FF",this.passivePlanUuid=null,this.commandQueue=[],this._resumed=!1,this.dispatchCommand=(A,n)=>{var i,r,s,a,o;switch(A){case"update":this.updateConfig(n);break;case"startSession":if(!(n!=null&&n.planUuid)){console.warn("[obi] startSession command requires a planUuid",n);return}const c=(((i=this.client)==null?void 0:i.plans)||[]).find(l=>l.uuid===n.planUuid)||null;if(!c){console.warn("[obi] startSession command requires a valid planUuid",n);return}this.updateActive(!0),(s=(r=this.client)==null?void 0:r.selectPlan)==null||s.call(r,c);break;case"stopSession":(o=(a=this.client)==null?void 0:a.stopSession)==null||o.call(a);break;case"say":this.say(n);break;default:console.warn("[obi] unknown command",{commandType:A,args:n})}},e&&this.createClient(e),this.parsePassiveParams()}async createClient(e){if(this.client){this.client.appToken!==e&&console.warn("[obi] client already exists with different app token");return}let A=null;const n=this.load();if(n)try{A=vr.deserialise(n,e,"sdk",{apiBaseUrl:"https://app.coragents.ai",captureScreen:this.captureScreen.bind(this)}),this._resumed=!0}catch(i){console.error("[obi] error loading cached client",i)}A||(A=new vr(e,"sdk",{apiBaseUrl:"https://app.coragents.ai",captureScreen:this.captureScreen.bind(this)})),this.client=A,this.client.on("stateChanged",i=>{var r,s,a;i==="ready"&&this.updateConfig({isActive:(r=this.client)==null?void 0:r.showWidget,primaryColour:((a=(s=this.client)==null?void 0:s.product)==null?void 0:a.primary_color)||"#9500FF"})}),this.client.on("sessionStarted",()=>{this.save(),this.passivePlanUuid=null}),this.client.on("sessionStopped",()=>{localStorage.removeItem("obi-client"),this.passivePlanUuid=null}),this.client.on("sessionShutdown",i=>{i==="invalid-room"&&localStorage.removeItem("obi-client")}),this.client.session&&this.client.resumeSession(i=>{i.on("stateChanged",r=>{r!=="disconnecting"&&r!=="disconnected"&&r!=="error"&&r!=="connecting"&&this.save()}),i.on("paused",()=>{this.save()}),i.on("unpaused",()=>{this.save()})})}async initialise(e={}){this.commandQueue=e.queuedCommands||[],this._resumed?(this._resumed=!1,this.dispatchCommandQueue()):this.client?this.client.initialise({planUuid:this.passivePlanUuid||void 0}).then(()=>{this.emit("initialised"),this.dispatchCommandQueue()}).catch(A=>{console.error("[obi] error initialising client",A),this.emit("error",A)}):this.dispatchCommandQueue()}async updateConfig(e){await this.updateAppToken(e.apiKey),this.updateActive(e.isActive),this.updatePrimaryColour(e.primaryColour),await this.updateIdentity(e.user),this.updateShowMenu(e.showMenu),this.emit("configUpdated")}async updateAppToken(e){var A;e===void 0||e==((A=this.client)==null?void 0:A.appToken)||(this.passivePlanUuid,await this.createClient(e),this.client&&await this.client.initialise({planUuid:this.passivePlanUuid||void 0}).then(()=>{this.emit("initialised")}).catch(n=>{console.error("[obi] error initialising client",n),this.emit("error",n)}))}updateActive(e){e===void 0||e==this.isActive||(this.isActive=e)}updatePrimaryColour(e){e===void 0||e==this.primaryColour||(this.primaryColour=e)}async updateIdentity(e){var n;if(e===void 0||e==((n=this.client)==null?void 0:n.identity))return;let A=e?{...e,extra:{...e,...(e==null?void 0:e.extra)||{}}}:void 0;await this.client.initialise({identity:A,planUuid:this.passivePlanUuid||void 0}).then(()=>{this.emit("initialised")}).catch(i=>{console.error("[obi] error initialising client",i),this.emit("error",i)})}updateShowMenu(e){e!==void 0&&this.emit("showMenu",e)}async say(e){var A,n,i;await((i=(n=(A=this.client)==null?void 0:A.session)==null?void 0:n.say)==null?void 0:i.call(n,e))}async startSession(){await this.client.startSession(this.client.selectedPlan.uuid,e=>{e.on("stateChanged",A=>{A!=="disconnecting"&&A!=="disconnected"&&A!=="error"&&A!=="connecting"&&this.save()})})}dispatchCommandQueue(){const e=this.commandQueue;this.commandQueue=[],e.forEach(A=>{try{this.dispatchCommand(A[0],A[1]||[])}catch(n){console.error("[obi] error dispatching command",n)}})}parsePassiveParams(){if(this.passivePlanUuid){this.passivePlanUuid;return}let e={};e=JSON.parse(localStorage.getItem(uf)||"{}"),Object.keys(e).length===0&&new URLSearchParams(window.location.search).forEach((r,s)=>{e[s]=r});const A=e[lf];if(!A)return null;const n=new URL(window.location.href);n.searchParams.delete(lf),window.history.replaceState({},"",n.toString()),n.toString(),localStorage.removeItem(uf),this.passivePlanUuid=A}mountWidget(){PU(this)}async captureScreen(){return(await xv(document.documentElement,{useCORS:!0,allowTaint:!0,foreignObjectRendering:!0})).toDataURL("image/png")}save(){}load(){return localStorage.getItem("obi-client")}}async function df(t){let e;try{e=window}catch{console.warn("[obi] no window object found"),e={}}return DU({appToken:t,window:e})}async function DU({appToken:t,window:e}){var i,r;if(e.obi){console.warn("[obi] obi object already found on window, skipping");return}t||(t=(i=e==null?void 0:e.obiWidgetConfig)==null?void 0:i.apiKey);let A;try{A=((r=e.ObiSDK)==null?void 0:r.q)||[]}catch{A=[]}const n=new LU(t);return e.ObiSDK=n.dispatchCommand,await n.initialise({queuedCommands:A}),e.obi=n,n.mountWidget(),n}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{df()}):df()})();
61
+ `}),C("article",{style:n.skeletonContainer,role:"status","aria-label":"Loading content",children:[C("section",{style:n.headerSection,children:[C("div",{style:n.avatar,role:"img","aria-label":"Loading avatar",children:C("div",{style:n.shimmer})}),C("div",{style:n.textLines,children:[C("div",{style:n.textLine,role:"presentation","aria-label":"Loading text line 1",children:C("div",{style:n.shimmer})}),C("div",{style:n.textLine,role:"presentation","aria-label":"Loading text line 2",children:C("div",{style:n.shimmer})})]})]}),C("section",{style:n.contentSection,children:C("div",{style:n.contentBlock,role:"presentation","aria-label":"Loading card content",children:C("div",{style:n.shimmer})})})]})]})}function JQ({}){const n={host:{display:"block"},shareContainer:{width:"480px",height:"240px",borderRadius:"12px",display:"grid",placeItems:"center",overflow:"hidden",position:"relative",backgroundColor:"var(--obi-color-tint)"},controlsRow:{zIndex:10,gridRowStart:1,gridColumnStart:1,display:"flex",alignSelf:"flex-start",marginTop:"36px",alignItems:"center",gap:"8px"},monitorIconContainer:{display:"flex",height:"40px",width:"40px",aspectRatio:"1",alignItems:"center",justifyContent:"center",gap:"8px",borderRadius:"2px",border:"1px solid #E4E4E7",background:"#F8FAFC",padding:"8px"},monitorIcon:{width:"24px",height:"24px",color:"#111827"},tabSelector:{display:"flex",width:"260px",height:"40px",padding:"4px",alignItems:"center",borderRadius:"2px",background:"#E4E4E7"},tabButton:e=>({display:"flex",flex:1,alignSelf:"stretch",alignItems:"center",justifyContent:"center",gap:"10px",borderRadius:"2px",padding:"6px 12px",border:"none",cursor:"pointer",fontFamily:"'Satoshi', sans-serif",fontSize:"14px",fontWeight:500,opacity:e?1:.4,background:e?"white":"#F8FAFC",boxShadow:e?"0 1px 2px 0 rgba(0, 0, 0, 0.05)":"none"}),skeletonContainer:{marginTop:"104px",gridColumnStart:1,gridRowStart:1,alignSelf:"center"}};return C("div",{style:n.host,children:C("div",{style:n.shareContainer,children:[C("div",{style:n.controlsRow,children:[C("div",{style:n.monitorIconContainer,children:C("svg",{style:n.monitorIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[C("rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",ry:"2"}),C("line",{x1:"8",x2:"16",y1:"21",y2:"21"}),C("line",{x1:"12",x2:"12",y1:"17",y2:"21"})]})}),C("div",{style:n.tabSelector,children:[C("button",{style:n.tabButton(!1),children:"Tab"}),C("button",{style:n.tabButton(!0),children:"Window"})]})]}),C("div",{style:n.skeletonContainer,children:C(qQ,{})})]})})}function zQ({session:n,speakingState:e,onAction:t}){return C(Hi,{title:"Connect your screen",subtitle:"Watch for the prompt in your browser",agentName:n.agentName||"Obi",buttonText:"Share screen",speakingState:e,description:`${n.agentName||"Obi"} will guide you through ${n.appName||"the app"} by watching your screen.`,centerVisual:C(JQ,{}),actionDisabled:!0,onAction:t})}function XQ({spectrum:n}){return C("div",{style:{borderRadius:"15px",boxShadow:"0 0 20px 2px var(--obi-color-primary)",backgroundColor:"var(--obi-color-primary)",transform:"scale(1.6)"},children:C(yd,{isActive:!0,children:C(gy,{getBands:n})})})}function YQ({session:n,speakingState:e,spectrum:t,onAction:r}){return C(Hi,{title:"Overview",subtitle:`${n.agentName||"Obi"} will start your tutorial in a moment`,agentName:n.agentName||"Obi",speakingState:e,description:`Get ready to explore ${n.appName||"the app"} with ${n.agentName||"Obi"}.`,centerVisual:C(XQ,{spectrum:t}),actionDisabled:!0,onAction:r})}function ZQ({id:n,name:e,description:t,duration:r=10,order:i=0,selected:A=!1,onClick:s}){return C("div",{className:`course-container ${A?"selected":""}`,onClick:()=>{s==null||s({id:n,name:e,description:t,duration:r,order:i})},children:[C("div",{className:"header-row",children:[C("h2",{className:"course-title",children:e}),C("span",{className:"duration",children:["~",r," mins"]})]}),t&&C("p",{className:"course-description",children:t})]})}function $Q({courses:n=[],selectedCourseId:e=null,loading:t=!1,error:r="",onCourseSelect:i}){const[A,s]=_e(""),o=u=>{const l=u.currentTarget;s(l.value)},a=u=>{i==null||i(u)};if(t)return C("div",{className:"loading",children:"Loading..."});if(r)return C("div",{className:"error",children:r});if(!n||n.length===0)return C("div",{className:"empty",children:"No courses available"});const c=n.filter(u=>u.name.toLowerCase().includes(A.toLowerCase())||(u.description||"").toLowerCase().includes(A.toLowerCase()));return C("div",{className:"tour-select",children:[C("div",{className:"controls",children:[C("div",{className:"tabs",children:C("button",{className:"tab active",children:"All"})}),C("div",{className:"filter",children:[C("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:C("path",{d:"M10.0417 8.75002H9.42087L9.20004 8.53502C9.96921 7.63585 10.4417 6.47502 10.4417 5.20835C10.4417 2.56085 8.32254 0.441681 5.67504 0.441681C3.02754 0.441681 0.908374 2.56085 0.908374 5.20835C0.908374 7.85585 3.02754 9.97502 5.67504 9.97502C6.94171 9.97502 8.10254 9.50252 9.00171 8.73335L9.22671 8.95418V9.57502L13.2167 13.5592L14.375 12.4008L10.0417 8.75002ZM5.67504 8.75002C3.72754 8.75002 2.15837 7.18085 2.15837 5.20835C2.15837 3.23585 3.72754 1.66668 5.67504 1.66668C7.62254 1.66668 9.19171 3.23585 9.19171 5.20835C9.19171 7.18085 7.62254 8.75002 5.67504 8.75002Z",fill:"#6B7280"})}),C("input",{type:"text",placeholder:"Search...",value:A,onInput:o})]})]}),C("div",{className:"course-grid",children:c.sort((u,l)=>(u.order||0)-(l.order||0)).map(u=>{const l=u.id===e;return C(ZQ,{id:u.id,name:u.name,description:u.description||"",duration:u.duration,order:u.order||0,selected:l,onClick:a},u.id)})})]})}function eR({open:n,courses:e=[],loading:t=!1,error:r="",agentName:i="Obi",onClose:A,onCourseSelect:s}){const[o,a]=_e(null),c=l=>{a(l)},u=()=>{o&&s&&s(o)};return C(dy,{open:n,onClose:A,size:"large",children:C("div",{className:"tour-select-modal-container",children:[C("div",{className:"header",children:[C("div",{className:"icon",style:{color:"white"},children:C(Iy,{})}),C("div",{className:"title-section",children:t?C(_t,{children:[C("div",{className:"skeleton skeleton-title"}),C("div",{className:"skeleton skeleton-subtitle"})]}):C(_t,{children:[C("h1",{children:["Give ",i," a try!"]}),C("p",{className:"subtitle",children:["Pick a tutorial, share your screen, and ",i," will take it from there."]})]})})]}),C("div",{className:"course-list-wrapper",children:C($Q,{courses:e,selectedCourseId:(o==null?void 0:o.id)||"",loading:t,error:r,onCourseSelect:c})}),C("div",{className:"footer",children:[C("button",{className:"obi-button footer-button",onClick:u,disabled:!o,children:[C("span",{children:"Get started"}),C("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",children:C("path",{d:"M3.83325 8.00065H13.1666M13.1666 8.00065L8.49992 3.33398M13.1666 8.00065L8.49992 12.6673",stroke:o?"#FAFAFA":"#999","stroke-width":"1.33","stroke-linecap":"round","stroke-linejoin":"round"})})]}),C("p",{className:"footer-text",children:"Sessions are securely recorded for quality improvement purposes."})]})]})})}function tR({session:n,sessionState:e,speakingState:t,spectrum:r,onStart:i,onContinue:A,onShareMicrophone:s,onShareScreen:o}){function a(){e==="connecting"||e==="connected"||!e?i==null||i():e==="volume-check"||e==="mic-check"?A==null||A():e==="mic-share"?s==null||s():e==="screen-share"&&(o==null||o())}return fd(()=>{switch(e){case null:case"connecting":case"connected":return C(KQ,{session:n,speakingState:t,onAction:a});case"volume-check":return C(WQ,{session:n,speakingState:t,onAction:a});case"mic-check":return C(YQ,{session:n,speakingState:t,spectrum:r,onAction:a});case"mic-share":return C(GQ,{session:n,speakingState:t,onAction:a});case"screen-share":return C(zQ,{session:n,speakingState:t,onAction:a});case"navigate":return C(HQ,{session:n,speakingState:t,onAction:a});default:return null}},[e,t,i,A,s,o])}function nR(n){const{session:e,sessionState:t,speakingState:r,spectrum:i,onClose:A,onStart:s,onContinue:o,onShareMicrophone:a,onShareScreen:c}=n,u=(n.open??!0)&&(!t||t==="connecting"||t==="connected"||t==="volume-check"||t==="mic-check"||t==="mic-share"||t==="screen-share"||t==="navigate");return C(LQ,{open:u,onClose:A,children:()=>C(tR,{session:e,sessionState:t,speakingState:r,spectrum:i,onStart:s,onContinue:o,onShareMicrophone:a,onShareScreen:c})})}var V;if(typeof window>"u"){var Fy={hostname:""};V={crypto:{randomUUID:function(){throw Error("unsupported")}},navigator:{userAgent:"",onLine:!0},document:{createElement:function(){return{}},location:Fy,referrer:""},screen:{width:0,height:0},location:Fy,addEventListener:function(){},removeEventListener:function(){}}}else V=window;function xy(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=n[t];return r}function Qy(n,e,t,r,i,A,s){try{var o=n[A](s),a=o.value}catch(c){t(c);return}o.done?e(a):Promise.resolve(a).then(r,i)}function Bd(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var A=n.apply(e,t);function s(a){Qy(A,r,i,s,o,"next",a)}function o(a){Qy(A,r,i,s,o,"throw",a)}s(void 0)})}}function ba(n,e,t){return Ry()?ba=Reflect.construct:ba=function(r,i,A){var s=[null];s.push.apply(s,i);var o=Function.bind.apply(r,s),a=new o;return A&&zA(a,A.prototype),a},ba.apply(null,arguments)}function rR(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function wt(n,e,t){return e&&rR(n.prototype,e),n}function fe(){return fe=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},fe.apply(this,arguments)}function Cd(n){return Cd=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Cd(n)}function St(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&zA(n,e)}function ee(n,e){return e!=null&&typeof Symbol<"u"&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](n):n instanceof e}function iR(n){return Function.toString.call(n).indexOf("[native code]")!==-1}function JA(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,A;for(A=0;A<r.length;A++)i=r[A],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}function zA(n,e){return zA=Object.setPrototypeOf||function(t,r){return t.__proto__=r,t},zA(n,e)}function Ae(n){"@swc/helpers - typeof";return n&&typeof Symbol<"u"&&n.constructor===Symbol?"symbol":typeof n}function AR(n,e){if(n){if(typeof n=="string")return xy(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return xy(n,e)}}function Ba(n){var e=typeof Map=="function"?new Map:void 0;return Ba=function(t){if(t===null||!iR(t))return t;if(typeof t!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return ba(t,arguments,Cd(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),zA(r,t)},Ba(n)}function Ry(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ry=function(){return!!n})()}function W(n,e){var t=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t)return(t=t.call(n)).next.bind(t);if(Array.isArray(n)||(t=AR(n))||e){t&&(n=t);var r=0;return function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function XA(n,e){var t,r,i,A,s={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]};return A={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(A[Symbol.iterator]=function(){return this}),A;function o(c){return function(u){return a([c,u])}}function a(c){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,r&&(i=c[0]&2?r.return:c[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;switch(r=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return s.label++,{value:c[1],done:!1};case 5:s.label++,r=c[1],c=[0];continue;case 7:c=s.ops.pop(),s.trys.pop();continue;default:if(i=s.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){s=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){s.label=c[1];break}if(c[0]===6&&s.label<i[1]){s.label=i[1],i=c;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(c);break}i[2]&&s.ops.pop(),s.trys.pop();continue}c=e.call(n,s)}catch(u){c=[6,u],r=0}finally{t=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Py(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}var sR=Object.defineProperty,oR=function(n,e,t){return e in n?sR(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t},H=function(n,e,t){return oR(n,(typeof e>"u"?"undefined":Ae(e))!=="symbol"?e+"":e,t)},Oy,aR=Object.defineProperty,cR=function(n,e,t){return e in n?aR(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t},My=function(n,e,t){return cR(n,(typeof e>"u"?"undefined":Ae(e))!=="symbol"?e+"":e,t)},lt=function(n){return n[n.Document=0]="Document",n[n.DocumentType=1]="DocumentType",n[n.Element=2]="Element",n[n.Text=3]="Text",n[n.CDATA=4]="CDATA",n[n.Comment=5]="Comment",n}(lt||{}),Ly={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Dy={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ca={},uR=function(){return!!globalThis.Zone};function _d(n){if(Ca[n])return Ca[n];var e=globalThis[n],t=e.prototype,r=n in Ly?Ly[n]:void 0,i=!!(r&&r.every(function(u){var l,d;return!!((d=(l=Object.getOwnPropertyDescriptor(t,u))==null?void 0:l.get)!=null&&d.toString().includes("[native code]"))})),A=n in Dy?Dy[n]:void 0,s=!!(A&&A.every(function(u){var l;return typeof t[u]=="function"&&((l=t[u])==null?void 0:l.toString().includes("[native code]"))}));if(i&&s&&!uR())return Ca[n]=e.prototype,e.prototype;try{var o=document.createElement("iframe");document.body.appendChild(o);var a=o.contentWindow;if(!a)return e.prototype;var c=a[n].prototype;return document.body.removeChild(o),c?Ca[n]=c:t}catch{return t}}var Sd={};function yr(n,e,t){var r,i=n+"."+String(t);if(Sd[i])return Sd[i].call(e);var A=_d(n),s=(r=Object.getOwnPropertyDescriptor(A,t))==null?void 0:r.get;return s?(Sd[i]=s,s.call(e)):e[t]}var kd={};function Hy(n,e,t){var r=n+"."+String(t);if(kd[r])return kd[r].bind(e);var i=_d(n),A=i[t];return typeof A!="function"?e[t]:(kd[r]=A,A.bind(e))}function lR(n){return yr("Node",n,"childNodes")}function dR(n){return yr("Node",n,"parentNode")}function hR(n){return yr("Node",n,"parentElement")}function pR(n){return yr("Node",n,"textContent")}function fR(n,e){return Hy("Node",n,"contains")(e)}function gR(n){return Hy("Node",n,"getRootNode")()}function mR(n){return!n||!("host"in n)?null:yr("ShadowRoot",n,"host")}function vR(n){return n.styleSheets}function yR(n){return!n||!("shadowRoot"in n)?null:yr("Element",n,"shadowRoot")}function wR(n,e){return yr("Element",n,"querySelector")(e)}function bR(n,e){return yr("Element",n,"querySelectorAll")(e)}function BR(){return _d("MutationObserver").constructor}var kt={childNodes:lR,parentNode:dR,parentElement:hR,textContent:pR,contains:fR,getRootNode:gR,host:mR,styleSheets:vR,shadowRoot:yR,querySelector:wR,querySelectorAll:bR,mutationObserver:BR};function Ny(n){return n.nodeType===n.ELEMENT_NODE}function YA(n){var e=n&&"host"in n&&"mode"in n&&kt.host(n)||null;return!!(e&&"shadowRoot"in e&&kt.shadowRoot(e)===n)}function ZA(n){return Object.prototype.toString.call(n)==="[object ShadowRoot]"}function CR(n){return n.includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),n}function _R(n){var e=n.cssText;if(e.split('"').length<3)return e;var t=["@import","url("+JSON.stringify(n.href)+")"];return n.layerName===""?t.push("layer"):n.layerName&&t.push("layer("+n.layerName+")"),n.supportsText&&t.push("supports("+n.supportsText+")"),n.media.length&&t.push(n.media.mediaText),t.join(" ")+";"}function Ed(n){try{var e=n.rules||n.cssRules;if(!e)return null;var t=n.href;!t&&n.ownerNode&&n.ownerNode.ownerDocument&&(t=n.ownerNode.ownerDocument.location.href);var r=Array.from(e,function(i){return Ky(i,t)}).join("");return CR(r)}catch{return null}}function Ky(n,e){if(kR(n)){var t;try{t=Ed(n.styleSheet)||_R(n)}catch{t=n.cssText}return n.styleSheet.href?_a(t,n.styleSheet.href):t}else{var r=n.cssText;return ER(n)&&n.selectorText.includes(":")&&(r=SR(r)),e?_a(r,e):r}}function SR(n){var e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return n.replace(e,"$1\\$2")}function kR(n){return"styleSheet"in n}function ER(n){return"selectorText"in n}var Vy=function(){function n(){My(this,"idNodeMap",new Map),My(this,"nodeMetaMap",new WeakMap)}var e=n.prototype;return e.getId=function(t){var r;if(!t)return-1;var i=(r=this.getMeta(t))==null?void 0:r.id;return i??-1},e.getNode=function(t){return this.idNodeMap.get(t)||null},e.getIds=function(){return Array.from(this.idNodeMap.keys())},e.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.removeNodeFromMap=function(t){var r=this,i=this.getId(t);this.idNodeMap.delete(i),t.childNodes&&t.childNodes.forEach(function(A){return r.removeNodeFromMap(A)})},e.has=function(t){return this.idNodeMap.has(t)},e.hasNode=function(t){return this.nodeMetaMap.has(t)},e.add=function(t,r){var i=r.id;this.idNodeMap.set(i,t),this.nodeMetaMap.set(t,r)},e.replace=function(t,r){var i=this.getNode(t);if(i){var A=this.nodeMetaMap.get(i);A&&this.nodeMetaMap.set(r,A)}this.idNodeMap.set(t,r)},e.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},n}();function UR(){return new Vy}function Ud(n){var e=n.element,t=n.maskInputOptions,r=n.tagName,i=n.type,A=n.value,s=n.maskInputFn,o=A||"",a=i&&Yr(i);return(t[r.toLowerCase()]||a&&t[a])&&(s?o=s(o,e):o="*".repeat(o.length)),o}function Yr(n){return n.toLowerCase()}var Gy="__rrweb_original__";function TR(n){var e=n.getContext("2d");if(!e)return!0;for(var t=50,r=0;r<n.width;r+=t)for(var i=0;i<n.height;i+=t){var A=e.getImageData,s=Gy in A?A[Gy]:A,o=new Uint32Array(s.call(e,r,i,Math.min(t,n.width-r),Math.min(t,n.height-i)).data.buffer);if(o.some(function(a){return a!==0}))return!1}return!0}function Td(n){var e=n.type;return n.hasAttribute("data-rr-is-password")?"password":e?Yr(e):null}function jy(n,e){var t;try{t=new URL(n,e??window.location.href)}catch{return null}var r=/\.([0-9a-z]+)(?:$)/i,i=t.pathname.match(r),A;return(A=i==null?void 0:i[1])!=null?A:null}function IR(n){var e="";return n.indexOf("//")>-1?e=n.split("/").slice(0,3).join("/"):e=n.split("/")[0],e=e.split("?")[0],e}var FR=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,xR=/^(?:[a-z+]+:)?\/\//i,QR=/^www\..*/i,RR=/^(data:)([^,]*),(.*)/i;function _a(n,e){return(n||"").replace(FR,function(t,r,i,A,s,o){var a=i||s||o,c=r||A||"";if(!a)return t;if(xR.test(a)||QR.test(a)||RR.test(a))return"url("+c+a+c+")";if(a[0]==="/")return"url("+c+(IR(e)+a)+c+")";var u=e.split("/"),l=a.split("/");u.pop();for(var d=W(l),h;!(h=d()).done;){var f=h.value;f!=="."&&(f===".."?u.pop():u.push(f))}return"url("+c+u.join("/")+c+")"})}function Id(n){return n.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"")}function PR(n,e){var t=Array.from(e.childNodes),r=[];if(t.length>1&&n&&typeof n=="string"){for(var i=Id(n),A=1;A<t.length;A++)if(t[A].textContent&&typeof t[A].textContent=="string")for(var s=Id(t[A].textContent),o=3;o<s.length;o++){var a=s.substring(0,o);if(i.split(a).length===2){for(var c=i.indexOf(a),u=c;u<n.length;u++)if(Id(n.substring(0,u)).length===c){r.push(n.substring(0,u)),n=n.substring(u);break}break}}}return r.push(n),r}function OR(n,e){return PR(n,e).join("/* rr_split */")}var MR=1,LR=new RegExp("[^a-z0-9-_:]"),$A=-2;function Wy(){return MR++}function DR(n){if(ee(n,HTMLFormElement))return"form";var e=Yr(n.tagName);return LR.test(e)?"div":e}var Ni,qy,HR=/^[^ \t\n\r\u000c]+/,NR=/^[, \t\n\r\u000c]+/;function KR(n,e){if(e.trim()==="")return e;var t=0;function r(c){var u,l=c.exec(e.substring(t));return l?(u=l[0],t+=u.length,u):""}for(var i=[];r(NR),!(t>=e.length);){var A=r(HR);if(A.slice(-1)===",")A=Sa(n,A.substring(0,A.length-1)),i.push(A);else{var s="";A=Sa(n,A);for(var o=!1;;){var a=e.charAt(t);if(a===""){i.push((A+s).trim());break}else if(o)a===")"&&(o=!1);else if(a===","){t+=1,i.push((A+s).trim());break}else a==="("&&(o=!0);s+=a,t+=1}}}return i.join(", ")}var Jy=new WeakMap;function Sa(n,e){return!e||e.trim()===""?e:Fd(n,e)}function VR(n){return!!(n.tagName==="svg"||n.ownerSVGElement)}function Fd(n,e){var t=Jy.get(n);if(t||(t=n.createElement("a"),Jy.set(n,t)),!e)e="";else if(e.startsWith("blob:")||e.startsWith("data:"))return e;return t.setAttribute("href",e),t.href}function zy(n,e,t,r){return r&&(t==="src"||t==="href"&&!(e==="use"&&r[0]==="#")||t==="xlink:href"&&r[0]!=="#"||t==="background"&&(e==="table"||e==="td"||e==="th")?Sa(n,r):t==="srcset"?KR(n,r):t==="style"?_a(r,Fd(n)):e==="object"&&t==="data"?Sa(n,r):r)}function Xy(n,e,t){return(n==="video"||n==="audio")&&e==="autoplay"}function GR(n,e,t){try{if(typeof e=="string"){if(n.classList.contains(e))return!0}else for(var r=n.classList.length;r--;){var i=n.classList[r];if(e.test(i))return!0}if(t)return n.matches(t)}catch{}return!1}function ka(n,e,t){if(!n)return!1;if(n.nodeType!==n.ELEMENT_NODE)return t?ka(kt.parentNode(n),e,t):!1;for(var r=n.classList.length;r--;){var i=n.classList[r];if(e.test(i))return!0}return t?ka(kt.parentNode(n),e,t):!1}function Yy(n,e,t,r){var i;if(Ny(n)){if(i=n,!kt.childNodes(i).length)return!1}else{if(kt.parentElement(n)===null)return!1;i=kt.parentElement(n)}try{if(typeof e=="string"){if(r){if(i.closest("."+e))return!0}else if(i.classList.contains(e))return!0}else if(ka(i,e,r))return!0;if(t){if(r){if(i.closest(t))return!0}else if(i.matches(t))return!0}}catch{}return!1}function jR(n,e,t){var r=n.contentWindow;if(r){var i=!1,A;try{A=r.document.readyState}catch{return}if(A!=="complete"){var s=setTimeout(function(){i||(e(),i=!0)},t);n.addEventListener("load",function(){clearTimeout(s),i=!0,e()});return}var o="about:blank";if(r.location.href!==o||n.src===o||n.src==="")return setTimeout(e,0),n.addEventListener("load",e);n.addEventListener("load",e)}}function WR(n,e,t){var r=!1,i;try{i=n.sheet}catch{return}if(!i){var A=setTimeout(function(){r||(e(),r=!0)},t);n.addEventListener("load",function(){clearTimeout(A),r=!0,e()})}}function qR(n,e){var t=e.doc,r=e.mirror,i=e.blockClass,A=e.blockSelector,s=e.needsMask,o=e.inlineStylesheet,a=e.maskInputOptions,c=a===void 0?{}:a,u=e.maskTextFn,l=e.maskInputFn,d=e.dataURLOptions,h=d===void 0?{}:d,f=e.inlineImages,p=e.recordCanvas,g=e.keepIframeSrcFn,v=e.newlyAddedElement,y=v===void 0?!1:v,b=e.cssCaptured,B=b===void 0?!1:b,w=JR(t,r);switch(n.nodeType){case n.DOCUMENT_NODE:return n.compatMode!=="CSS1Compat"?{type:lt.Document,childNodes:[],compatMode:n.compatMode}:{type:lt.Document,childNodes:[]};case n.DOCUMENT_TYPE_NODE:return{type:lt.DocumentType,name:n.name,publicId:n.publicId,systemId:n.systemId,rootId:w};case n.ELEMENT_NODE:return XR(n,{doc:t,blockClass:i,blockSelector:A,inlineStylesheet:o,maskInputOptions:c,maskInputFn:l,dataURLOptions:h,inlineImages:f,recordCanvas:p,keepIframeSrcFn:g,newlyAddedElement:y,rootId:w});case n.TEXT_NODE:return zR(n,{doc:t,needsMask:s,maskTextFn:u,rootId:w,cssCaptured:B});case n.CDATA_SECTION_NODE:return{type:lt.CDATA,textContent:"",rootId:w};case n.COMMENT_NODE:return{type:lt.Comment,textContent:kt.textContent(n)||"",rootId:w};default:return!1}}function JR(n,e){if(e.hasNode(n)){var t=e.getId(n);return t===1?void 0:t}}function zR(n,e){var t=e.needsMask,r=e.maskTextFn,i=e.rootId,A=e.cssCaptured,s=kt.parentNode(n),o=s&&s.tagName,a="",c=o==="STYLE"?!0:void 0,u=o==="SCRIPT"?!0:void 0;return u?a="SCRIPT_PLACEHOLDER":A||(a=kt.textContent(n),c&&a&&(a=_a(a,Fd(e.doc)))),!c&&!u&&a&&t&&(a=r?r(a,kt.parentElement(n)):a.replace(/[\S]/g,"*")),{type:lt.Text,textContent:a||"",rootId:i}}function XR(n,e){for(var t=e.doc,r=e.blockClass,i=e.blockSelector,A=e.inlineStylesheet,s=e.maskInputOptions,o=s===void 0?{}:s,a=e.maskInputFn,c=e.dataURLOptions,u=c===void 0?{}:c,l=e.inlineImages,d=e.recordCanvas,h=e.keepIframeSrcFn,f=e.newlyAddedElement,p=f===void 0?!1:f,g=e.rootId,v=GR(n,r,i),y=DR(n),b={},B=n.attributes.length,w=0;w<B;w++){var _=n.attributes[w];Xy(y,_.name,_.value)||(b[_.name]=zy(t,y,Yr(_.name),_.value))}if(y==="link"&&A){var k=Array.from(t.styleSheets).find(function(Qe){return Qe.href===n.href}),T=null;k&&(T=Ed(k)),T&&(delete b.rel,delete b.href,b._cssText=T)}if(y==="style"&&n.sheet){var I=Ed(n.sheet);I&&(n.childNodes.length>1&&(I=OR(I,n)),b._cssText=I)}if(y==="input"||y==="textarea"||y==="select"){var x=n.value,F=n.checked;b.type!=="radio"&&b.type!=="checkbox"&&b.type!=="submit"&&b.type!=="button"&&x?b.value=Ud({element:n,type:Td(n),tagName:y,value:x,maskInputOptions:o,maskInputFn:a}):F&&(b.checked=F)}if(y==="option"&&(n.selected&&!o.select?b.selected=!0:delete b.selected),y==="dialog"&&n.open&&(b.rr_open_mode=n.matches("dialog:modal")?"modal":"non-modal"),y==="canvas"&&d){if(n.__context==="2d")TR(n)||(b.rr_dataURL=n.toDataURL(u.type,u.quality));else if(!("__context"in n)){var Q=n.toDataURL(u.type,u.quality),D=t.createElement("canvas");D.width=n.width,D.height=n.height;var X=D.toDataURL(u.type,u.quality);Q!==X&&(b.rr_dataURL=Q)}}if(y==="img"&&l){Ni||(Ni=t.createElement("canvas"),qy=Ni.getContext("2d"));var N=n,q=N.currentSrc||N.getAttribute("src")||"<unknown-src>",ge=N.crossOrigin,Y=function(){N.removeEventListener("load",Y);try{Ni.width=N.naturalWidth,Ni.height=N.naturalHeight,qy.drawImage(N,0,0),b.rr_dataURL=Ni.toDataURL(u.type,u.quality)}catch(Qe){if(N.crossOrigin!=="anonymous"){N.crossOrigin="anonymous",N.complete&&N.naturalWidth!==0?Y():N.addEventListener("load",Y);return}else console.warn("Cannot inline img src="+q+"! Error: "+Qe)}N.crossOrigin==="anonymous"&&(ge?b.crossOrigin=ge:N.removeAttribute("crossorigin"))};N.complete&&N.naturalWidth!==0?Y():N.addEventListener("load",Y)}if(y==="audio"||y==="video"){var re=b;re.rr_mediaState=n.paused?"paused":"played",re.rr_mediaCurrentTime=n.currentTime,re.rr_mediaPlaybackRate=n.playbackRate,re.rr_mediaMuted=n.muted,re.rr_mediaLoop=n.loop,re.rr_mediaVolume=n.volume}if(p||(n.scrollLeft&&(b.rr_scrollLeft=n.scrollLeft),n.scrollTop&&(b.rr_scrollTop=n.scrollTop)),v){var xe=n.getBoundingClientRect(),je=xe.width,be=xe.height;b={class:b.class,rr_width:""+je+"px",rr_height:""+be+"px"}}y==="iframe"&&!h(b.src)&&(n.contentDocument||(b.rr_src=b.src),delete b.src);var dt;try{customElements.get(y)&&(dt=!0)}catch{}return{type:lt.Element,tagName:y,attributes:b,childNodes:[],isSVG:VR(n)||void 0,needBlock:v,rootId:g,isCustom:dt}}function Fe(n){return n==null?"":n.toLowerCase()}function YR(n,e){return!!(e.comment&&n.type===lt.Comment||n.type===lt.Element&&(e.script&&(n.tagName==="script"||n.tagName==="link"&&(n.attributes.rel==="preload"||n.attributes.rel==="modulepreload")&&n.attributes.as==="script"||n.tagName==="link"&&n.attributes.rel==="prefetch"&&typeof n.attributes.href=="string"&&jy(n.attributes.href)==="js")||e.headFavicon&&(n.tagName==="link"&&n.attributes.rel==="shortcut icon"||n.tagName==="meta"&&(Fe(n.attributes.name).match(/^msapplication-tile(image|color)$/)||Fe(n.attributes.name)==="application-name"||Fe(n.attributes.rel)==="icon"||Fe(n.attributes.rel)==="apple-touch-icon"||Fe(n.attributes.rel)==="shortcut icon"))||n.tagName==="meta"&&(e.headMetaDescKeywords&&Fe(n.attributes.name).match(/^description|keywords$/)||e.headMetaSocial&&(Fe(n.attributes.property).match(/^(og|twitter|fb):/)||Fe(n.attributes.name).match(/^(og|twitter):/)||Fe(n.attributes.name)==="pinterest")||e.headMetaRobots&&(Fe(n.attributes.name)==="robots"||Fe(n.attributes.name)==="googlebot"||Fe(n.attributes.name)==="bingbot")||e.headMetaHttpEquiv&&n.attributes["http-equiv"]!==void 0||e.headMetaAuthorship&&(Fe(n.attributes.name)==="author"||Fe(n.attributes.name)==="generator"||Fe(n.attributes.name)==="framework"||Fe(n.attributes.name)==="publisher"||Fe(n.attributes.name)==="progid"||Fe(n.attributes.property).match(/^article:/)||Fe(n.attributes.property).match(/^product:/))||e.headMetaVerification&&(Fe(n.attributes.name)==="google-site-verification"||Fe(n.attributes.name)==="yandex-verification"||Fe(n.attributes.name)==="csrf-token"||Fe(n.attributes.name)==="p:domain_verify"||Fe(n.attributes.name)==="verify-v1"||Fe(n.attributes.name)==="verification"||Fe(n.attributes.name)==="shopify-checkout-api-token"))))}function Ki(n,e){var t=e.doc,r=e.mirror,i=e.blockClass,A=e.blockSelector,s=e.maskTextClass,o=e.maskTextSelector,a=e.skipChild,c=a===void 0?!1:a,u=e.inlineStylesheet,l=u===void 0?!0:u,d=e.maskInputOptions,h=d===void 0?{}:d,f=e.maskTextFn,p=e.maskInputFn,g=e.slimDOMOptions,v=e.dataURLOptions,y=v===void 0?{}:v,b=e.inlineImages,B=b===void 0?!1:b,w=e.recordCanvas,_=w===void 0?!1:w,k=e.onSerialize,T=e.onIframeLoad,I=e.iframeLoadTimeout,x=I===void 0?5e3:I,F=e.onStylesheetLoad,Q=e.stylesheetLoadTimeout,D=Q===void 0?5e3:Q,X=e.keepIframeSrcFn,N=X===void 0?function(){return!1}:X,q=e.newlyAddedElement,ge=q===void 0?!1:q,Y=e.cssCaptured,re=Y===void 0?!1:Y,xe=e.needsMask,je=e.preserveWhiteSpace,be=je===void 0?!0:je;if(!xe){var dt=xe===void 0;xe=Yy(n,s,o,dt)}var Qe=qR(n,{doc:t,mirror:r,blockClass:i,blockSelector:A,needsMask:xe,inlineStylesheet:l,maskInputOptions:h,maskTextFn:f,maskInputFn:p,dataURLOptions:y,inlineImages:B,recordCanvas:_,keepIframeSrcFn:N,newlyAddedElement:ge,cssCaptured:re});if(!Qe)return console.warn(n,"not serialized"),null;var De;r.hasNode(n)?De=r.getId(n):YR(Qe,g)||!be&&Qe.type===lt.Text&&!Qe.textContent.replace(/^\s+|\s+$/gm,"").length?De=$A:De=Wy();var te=Object.assign(Qe,{id:De});if(r.add(n,te),De===$A)return null;k&&k(n);var Ze=!c;if(te.type===lt.Element){Ze=Ze&&!te.needBlock,delete te.needBlock;var ye=kt.shadowRoot(n);ye&&ZA(ye)&&(te.isShadowHost=!0)}if((te.type===lt.Document||te.type===lt.Element)&&Ze){g.headWhitespace&&te.type===lt.Element&&te.tagName==="head"&&(be=!1);var At={doc:t,mirror:r,blockClass:i,blockSelector:A,needsMask:xe,maskTextClass:s,maskTextSelector:o,skipChild:c,inlineStylesheet:l,maskInputOptions:h,maskTextFn:f,maskInputFn:p,slimDOMOptions:g,dataURLOptions:y,inlineImages:B,recordCanvas:_,preserveWhiteSpace:be,onSerialize:k,onIframeLoad:T,iframeLoadTimeout:x,onStylesheetLoad:F,stylesheetLoadTimeout:D,keepIframeSrcFn:N,cssCaptured:!1};if(!(te.type===lt.Element&&te.tagName==="textarea"&&te.attributes.value!==void 0)){te.type===lt.Element&&te.attributes._cssText!==void 0&&typeof te.attributes._cssText=="string"&&(At.cssCaptured=!0);for(var Ss=W(Array.from(kt.childNodes(n))),ks;!(ks=Ss()).done;){var Ip=ks.value,Lc=Ki(Ip,At);Lc&&te.childNodes.push(Lc)}}var xr=null;if(Ny(n)&&(xr=kt.shadowRoot(n)))for(var si=W(Array.from(kt.childNodes(xr))),cA;!(cA=si()).done;){var Es=cA.value,uA=Ki(Es,At);uA&&(ZA(xr)&&(uA.isShadow=!0),te.childNodes.push(uA))}}var oi=kt.parentNode(n);return oi&&YA(oi)&&ZA(oi)&&(te.isShadow=!0),te.type===lt.Element&&te.tagName==="iframe"&&jR(n,function(){var Xn=n.contentDocument;if(Xn&&T){var ai=Ki(Xn,{doc:Xn,mirror:r,blockClass:i,blockSelector:A,needsMask:xe,maskTextClass:s,maskTextSelector:o,skipChild:!1,inlineStylesheet:l,maskInputOptions:h,maskTextFn:f,maskInputFn:p,slimDOMOptions:g,dataURLOptions:y,inlineImages:B,recordCanvas:_,preserveWhiteSpace:be,onSerialize:k,onIframeLoad:T,iframeLoadTimeout:x,onStylesheetLoad:F,stylesheetLoadTimeout:D,keepIframeSrcFn:N});ai&&T(n,ai)}},x),te.type===lt.Element&&te.tagName==="link"&&typeof te.attributes.rel=="string"&&(te.attributes.rel==="stylesheet"||te.attributes.rel==="preload"&&typeof te.attributes.href=="string"&&jy(te.attributes.href)==="css")&&WR(n,function(){if(F){var Xn=Ki(n,{doc:t,mirror:r,blockClass:i,blockSelector:A,needsMask:xe,maskTextClass:s,maskTextSelector:o,skipChild:!1,inlineStylesheet:l,maskInputOptions:h,maskTextFn:f,maskInputFn:p,slimDOMOptions:g,dataURLOptions:y,inlineImages:B,recordCanvas:_,preserveWhiteSpace:be,onSerialize:k,onIframeLoad:T,iframeLoadTimeout:x,onStylesheetLoad:F,stylesheetLoadTimeout:D,keepIframeSrcFn:N});Xn&&F(n,Xn)}},D),te}function ZR(n,e){var t=e||{},r=t.mirror,i=r===void 0?new Vy:r,A=t.blockClass,s=A===void 0?"rr-block":A,o=t.blockSelector,a=o===void 0?null:o,c=t.maskTextClass,u=c===void 0?"rr-mask":c,l=t.maskTextSelector,d=l===void 0?null:l,h=t.inlineStylesheet,f=h===void 0?!0:h,p=t.inlineImages,g=p===void 0?!1:p,v=t.recordCanvas,y=v===void 0?!1:v,b=t.maskAllInputs,B=b===void 0?!1:b,w=t.maskTextFn,_=t.maskInputFn,k=t.slimDOM,T=k===void 0?!1:k,I=t.dataURLOptions,x=t.preserveWhiteSpace,F=t.onSerialize,Q=t.onIframeLoad,D=t.iframeLoadTimeout,X=t.onStylesheetLoad,N=t.stylesheetLoadTimeout,q=t.keepIframeSrcFn,ge=q===void 0?function(){return!1}:q,Y=B===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:B===!1?{password:!0}:B,re=T===!0||T==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:T==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:T===!1?{}:T;return Ki(n,{doc:n,mirror:i,blockClass:s,blockSelector:a,maskTextClass:u,maskTextSelector:d,skipChild:!1,inlineStylesheet:f,maskInputOptions:Y,maskTextFn:w,maskInputFn:_,slimDOMOptions:re,dataURLOptions:I,inlineImages:g,recordCanvas:y,preserveWhiteSpace:x,onSerialize:F,onIframeLoad:Q,iframeLoadTimeout:D,onStylesheetLoad:X,stylesheetLoadTimeout:N,keepIframeSrcFn:ge,newlyAddedElement:!1})}function $R(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function eP(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function r(){return ee(this,r)?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}),t}var xd={exports:{}},Oe=String,Zy=function(){return{isColorSupported:!1,reset:Oe,bold:Oe,dim:Oe,italic:Oe,underline:Oe,inverse:Oe,hidden:Oe,strikethrough:Oe,black:Oe,red:Oe,green:Oe,yellow:Oe,blue:Oe,magenta:Oe,cyan:Oe,white:Oe,gray:Oe,bgBlack:Oe,bgRed:Oe,bgGreen:Oe,bgYellow:Oe,bgBlue:Oe,bgMagenta:Oe,bgCyan:Oe,bgWhite:Oe}};xd.exports=Zy(),xd.exports.createColors=Zy;var tP=xd.exports,nP={},rP=Object.freeze(Object.defineProperty({__proto__:null,default:nP},Symbol.toStringTag,{value:"Module"})),rt=eP(rP),$y=tP,ew=rt,Qd=function(n){St(e,n);function e(r,i,A,s,o,a){var c;return c=n.call(this,r)||this,c.name="CssSyntaxError",c.reason=r,o&&(c.file=o),s&&(c.source=s),a&&(c.plugin=a),typeof i<"u"&&typeof A<"u"&&(typeof i=="number"?(c.line=i,c.column=A):(c.line=i.line,c.column=i.column,c.endLine=A.line,c.endColumn=A.column)),c.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(c,e),c}var t=e.prototype;return t.setMessage=function(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason},t.showSourceCode=function(r){var i=this;if(!this.source)return"";var A=this.source;r==null&&(r=$y.isColorSupported),ew&&r&&(A=ew(A));var s=A.split(/\r?\n/),o=Math.max(this.line-3,0),a=Math.min(this.line+2,s.length),c=String(a).length,u,l;if(r){var d=$y.createColors(!0),h=d.bold,f=d.gray,p=d.red;u=function(g){return h(p(g))},l=function(g){return f(g)}}else u=l=function(g){return g};return s.slice(o,a).map(function(g,v){var y=o+1+v,b=" "+(" "+y).slice(-c)+" | ";if(y===i.line){var B=l(b.replace(/\d/g," "))+g.slice(0,i.column-1).replace(/[^\t]/g," ");return u(">")+l(b)+g+`
62
+ `+B+u("^")}return" "+l(b)+g}).join(`
63
+ `)},t.toString=function(){var r=this.showSourceCode();return r&&(r=`
64
+
65
+ `+r+`
66
+ `),this.name+": "+this.message+r},e}(Ba(Error)),Rd=Qd;Qd.default=Qd;var wr={};wr.isClean=Symbol("isClean"),wr.my=Symbol("my");var tw={after:`
67
+ `,beforeClose:`
68
+ `,beforeComment:`
69
+ `,beforeDecl:`
70
+ `,beforeOpen:" ",beforeRule:`
71
+ `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function iP(n){return n[0].toUpperCase()+n.slice(1)}var Pd=function(){function n(t){this.builder=t}var e=n.prototype;return e.atrule=function(t,r){var i="@"+t.name,A=t.params?this.rawValue(t,"params"):"";if(typeof t.raws.afterName<"u"?i+=t.raws.afterName:A&&(i+=" "),t.nodes)this.block(t,i+A);else{var s=(t.raws.between||"")+(r?";":"");this.builder(i+A+s,t)}},e.beforeAfter=function(t,r){var i;t.type==="decl"?i=this.raw(t,null,"beforeDecl"):t.type==="comment"?i=this.raw(t,null,"beforeComment"):r==="before"?i=this.raw(t,null,"beforeRule"):i=this.raw(t,null,"beforeClose");for(var A=t.parent,s=0;A&&A.type!=="root";)s+=1,A=A.parent;if(i.includes(`
72
+ `)){var o=this.raw(t,null,"indent");if(o.length)for(var a=0;a<s;a++)i+=o}return i},e.block=function(t,r){var i=this.raw(t,"between","beforeOpen");this.builder(r+i+"{",t,"start");var A;t.nodes&&t.nodes.length?(this.body(t),A=this.raw(t,"after")):A=this.raw(t,"after","emptyBody"),A&&this.builder(A),this.builder("}",t,"end")},e.body=function(t){for(var r=t.nodes.length-1;r>0&&t.nodes[r].type==="comment";)r-=1;for(var i=this.raw(t,"semicolon"),A=0;A<t.nodes.length;A++){var s=t.nodes[A],o=this.raw(s,"before");o&&this.builder(o),this.stringify(s,r!==A||i)}},e.comment=function(t){var r=this.raw(t,"left","commentLeft"),i=this.raw(t,"right","commentRight");this.builder("/*"+r+t.text+i+"*/",t)},e.decl=function(t,r){var i=this.raw(t,"between","colon"),A=t.prop+i+this.rawValue(t,"value");t.important&&(A+=t.raws.important||" !important"),r&&(A+=";"),this.builder(A,t)},e.document=function(t){this.body(t)},e.raw=function(t,r,i){var A;if(i||(i=r),r&&(A=t.raws[r],typeof A<"u"))return A;var s=t.parent;if(i==="before"&&(!s||s.type==="root"&&s.first===t||s&&s.type==="document"))return"";if(!s)return tw[i];var o=t.root();if(o.rawCache||(o.rawCache={}),typeof o.rawCache[i]<"u")return o.rawCache[i];if(i==="before"||i==="after")return this.beforeAfter(t,i);var a="raw"+iP(i);return this[a]?A=this[a](o,t):o.walk(function(c){if(A=c.raws[r],typeof A<"u")return!1}),typeof A>"u"&&(A=tw[i]),o.rawCache[i]=A,A},e.rawBeforeClose=function(t){var r;return t.walk(function(i){if(i.nodes&&i.nodes.length>0&&typeof i.raws.after<"u")return r=i.raws.after,r.includes(`
73
+ `)&&(r=r.replace(/[^\n]+$/,"")),!1}),r&&(r=r.replace(/\S/g,"")),r},e.rawBeforeComment=function(t,r){var i;return t.walkComments(function(A){if(typeof A.raws.before<"u")return i=A.raws.before,i.includes(`
74
+ `)&&(i=i.replace(/[^\n]+$/,"")),!1}),typeof i>"u"?i=this.raw(r,null,"beforeDecl"):i&&(i=i.replace(/\S/g,"")),i},e.rawBeforeDecl=function(t,r){var i;return t.walkDecls(function(A){if(typeof A.raws.before<"u")return i=A.raws.before,i.includes(`
75
+ `)&&(i=i.replace(/[^\n]+$/,"")),!1}),typeof i>"u"?i=this.raw(r,null,"beforeRule"):i&&(i=i.replace(/\S/g,"")),i},e.rawBeforeOpen=function(t){var r;return t.walk(function(i){if(i.type!=="decl"&&(r=i.raws.between,typeof r<"u"))return!1}),r},e.rawBeforeRule=function(t){var r;return t.walk(function(i){if(i.nodes&&(i.parent!==t||t.first!==i)&&typeof i.raws.before<"u")return r=i.raws.before,r.includes(`
76
+ `)&&(r=r.replace(/[^\n]+$/,"")),!1}),r&&(r=r.replace(/\S/g,"")),r},e.rawColon=function(t){var r;return t.walkDecls(function(i){if(typeof i.raws.between<"u")return r=i.raws.between.replace(/[^\s:]/g,""),!1}),r},e.rawEmptyBody=function(t){var r;return t.walk(function(i){if(i.nodes&&i.nodes.length===0&&(r=i.raws.after,typeof r<"u"))return!1}),r},e.rawIndent=function(t){if(t.raws.indent)return t.raws.indent;var r;return t.walk(function(i){var A=i.parent;if(A&&A!==t&&A.parent&&A.parent===t&&typeof i.raws.before<"u"){var s=i.raws.before.split(`
77
+ `);return r=s[s.length-1],r=r.replace(/\S/g,""),!1}}),r},e.rawSemicolon=function(t){var r;return t.walk(function(i){if(i.nodes&&i.nodes.length&&i.last.type==="decl"&&(r=i.raws.semicolon,typeof r<"u"))return!1}),r},e.rawValue=function(t,r){var i=t[r],A=t.raws[r];return A&&A.value===i?A.raw:i},e.root=function(t){this.body(t),t.raws.after&&this.builder(t.raws.after)},e.rule=function(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(t.raws.ownSemicolon,t,"end")},e.stringify=function(t,r){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,r)},n}(),nw=Pd;Pd.default=Pd;var AP=nw;function Od(n,e){var t=new AP(e);t.stringify(n)}var Ea=Od;Od.default=Od;var Ua=wr.isClean,sP=wr.my,oP=Rd,aP=nw,cP=Ea;function Md(n,e){var t=new n.constructor;for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)&&r!=="proxyCache"){var i=n[r],A=typeof i>"u"?"undefined":Ae(i);r==="parent"&&A==="object"?e&&(t[r]=e):r==="source"?t[r]=i:Array.isArray(i)?t[r]=i.map(function(s){return Md(s,t)}):(A==="object"&&i!==null&&(i=Md(i)),t[r]=i)}return t}var Ld=function(){function n(t){t===void 0&&(t={}),this.raws={},this[Ua]=!1,this[sP]=!0;for(var r in t)if(r==="nodes"){this.nodes=[];for(var i=W(t[r]),A;!(A=i()).done;){var s=A.value;typeof s.clone=="function"?this.append(s.clone()):this.append(s)}}else this[r]=t[r]}var e=n.prototype;return e.addToError=function(t){if(t.postcssNode=this,t.stack&&this.source&&/\n\s{4}at /.test(t.stack)){var r=this.source;t.stack=t.stack.replace(/\n\s{4}at /,"$&"+r.input.from+":"+r.start.line+":"+r.start.column+"$&")}return t},e.after=function(t){return this.parent.insertAfter(this,t),this},e.assign=function(t){t===void 0&&(t={});for(var r in t)this[r]=t[r];return this},e.before=function(t){return this.parent.insertBefore(this,t),this},e.cleanRaws=function(t){delete this.raws.before,delete this.raws.after,t||delete this.raws.between},e.clone=function(t){t===void 0&&(t={});var r=Md(this);for(var i in t)r[i]=t[i];return r},e.cloneAfter=function(t){t===void 0&&(t={});var r=this.clone(t);return this.parent.insertAfter(this,r),r},e.cloneBefore=function(t){t===void 0&&(t={});var r=this.clone(t);return this.parent.insertBefore(this,r),r},e.error=function(t,r){if(r===void 0&&(r={}),this.source){var i=this.rangeBy(r),A=i.end,s=i.start;return this.source.input.error(t,{column:s.column,line:s.line},{column:A.column,line:A.line},r)}return new oP(t)},e.getProxyProcessor=function(){return{get:function(t,r){return r==="proxyOf"?t:r==="root"?function(){return t.root().toProxy()}:t[r]},set:function(t,r,i){return t[r]===i||(t[r]=i,(r==="prop"||r==="value"||r==="name"||r==="params"||r==="important"||r==="text")&&t.markDirty()),!0}}},e.markDirty=function(){if(this[Ua]){this[Ua]=!1;for(var t=this;t=t.parent;)t[Ua]=!1}},e.next=function(){if(this.parent){var t=this.parent.index(this);return this.parent.nodes[t+1]}},e.positionBy=function(t,r){var i=this.source.start;if(t.index)i=this.positionInside(t.index,r);else if(t.word){r=this.toString();var A=r.indexOf(t.word);A!==-1&&(i=this.positionInside(A,r))}return i},e.positionInside=function(t,r){for(var i=r||this.toString(),A=this.source.start.column,s=this.source.start.line,o=0;o<t;o++)i[o]===`
78
+ `?(A=1,s+=1):A+=1;return{column:A,line:s}},e.prev=function(){if(this.parent){var t=this.parent.index(this);return this.parent.nodes[t-1]}},e.rangeBy=function(t){var r={column:this.source.start.column,line:this.source.start.line},i=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:r.column+1,line:r.line};if(t.word){var A=this.toString(),s=A.indexOf(t.word);s!==-1&&(r=this.positionInside(s,A),i=this.positionInside(s+t.word.length,A))}else t.start?r={column:t.start.column,line:t.start.line}:t.index&&(r=this.positionInside(t.index)),t.end?i={column:t.end.column,line:t.end.line}:typeof t.endIndex=="number"?i=this.positionInside(t.endIndex):t.index&&(i=this.positionInside(t.index+1));return(i.line<r.line||i.line===r.line&&i.column<=r.column)&&(i={column:r.column+1,line:r.line}),{end:i,start:r}},e.raw=function(t,r){var i=new aP;return i.raw(this,t,r)},e.remove=function(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this},e.replaceWith=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];if(this.parent){for(var A=this,s=!1,o=W(r),a;!(a=o()).done;){var c=a.value;c===this?s=!0:s?(this.parent.insertAfter(A,c),A=c):this.parent.insertBefore(A,c)}s||this.remove()}return this},e.root=function(){for(var t=this;t.parent&&t.parent.type!=="document";)t=t.parent;return t},e.toJSON=function(t,r){var i={},A=r==null;r=r||new Map;var s=0;for(var o in this)if(Object.prototype.hasOwnProperty.call(this,o)&&!(o==="parent"||o==="proxyCache")){var a=this[o];if(Array.isArray(a))i[o]=a.map(function(u){return(typeof u>"u"?"undefined":Ae(u))==="object"&&u.toJSON?u.toJSON(null,r):u});else if((typeof a>"u"?"undefined":Ae(a))==="object"&&a.toJSON)i[o]=a.toJSON(null,r);else if(o==="source"){var c=r.get(a.input);c==null&&(c=s,r.set(a.input,s),s++),i[o]={end:a.end,inputId:c,start:a.start}}else i[o]=a}return A&&(i.inputs=[].concat(r.keys()).map(function(u){return u.toJSON()})),i},e.toProxy=function(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache},e.toString=function(t){t===void 0&&(t=cP),t.stringify&&(t=t.stringify);var r="";return t(this,function(i){r+=i}),r},e.warn=function(t,r,i){var A={node:this};for(var s in i)A[s]=i[s];return t.warn(r,A)},wt(n,[{key:"proxyOf",get:function(){return this}}]),n}(),Ta=Ld;Ld.default=Ld;var uP=Ta,Dd=function(n){St(e,n);function e(t){var r;return t&&typeof t.value<"u"&&typeof t.value!="string"&&(t=fe({},t,{value:String(t.value)})),r=n.call(this,t)||this,r.type="decl",r}return wt(e,[{key:"variable",get:function(){return this.prop.startsWith("--")||this.prop[0]==="$"}}]),e}(uP),Ia=Dd;Dd.default=Dd;var lP="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",dP=function(n){n===void 0&&(n=21);for(var e="",t=n;t--;)e+=lP[Math.random()*64|0];return e},hP={nanoid:dP},rw=rt.SourceMapConsumer,iw=rt.SourceMapGenerator,pP=rt.existsSync,fP=rt.readFileSync,Hd=rt.dirname,gP=rt.join;function mP(n){return Buffer?Buffer.from(n,"base64").toString():window.atob(n)}var Nd=function(){function n(t,r){if(r.map!==!1){this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");var i=r.map?r.map.prev:void 0,A=this.loadMap(r.from,i);!this.mapFile&&r.from&&(this.mapFile=r.from),this.mapFile&&(this.root=Hd(this.mapFile)),A&&(this.text=A)}}var e=n.prototype;return e.consumer=function(){return this.consumerCache||(this.consumerCache=new rw(this.text)),this.consumerCache},e.decodeInline=function(t){var r=/^data:application\/json;charset=utf-?8;base64,/,i=/^data:application\/json;base64,/,A=/^data:application\/json;charset=utf-?8,/,s=/^data:application\/json,/;if(A.test(t)||s.test(t))return decodeURIComponent(t.substr(RegExp.lastMatch.length));if(r.test(t)||i.test(t))return mP(t.substr(RegExp.lastMatch.length));var o=t.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+o)},e.getAnnotationURL=function(t){return t.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()},e.isMap=function(t){return(typeof t>"u"?"undefined":Ae(t))!=="object"?!1:typeof t.mappings=="string"||typeof t._mappings=="string"||Array.isArray(t.sections)},e.loadAnnotation=function(t){var r=t.match(/\/\*\s*# sourceMappingURL=/gm);if(r){var i=t.lastIndexOf(r.pop()),A=t.indexOf("*/",i);i>-1&&A>-1&&(this.annotation=this.getAnnotationURL(t.substring(i,A)))}},e.loadFile=function(t){if(this.root=Hd(t),pP(t))return this.mapFile=t,fP(t,"utf-8").toString().trim()},e.loadMap=function(t,r){if(r===!1)return!1;if(r){if(typeof r=="string")return r;if(typeof r=="function"){var i=r(t);if(i){var A=this.loadFile(i);if(!A)throw new Error("Unable to load previous source map: "+i.toString());return A}}else{if(ee(r,rw))return iw.fromSourceMap(r).toString();if(ee(r,iw))return r.toString();if(this.isMap(r))return JSON.stringify(r);throw new Error("Unsupported previous source map format: "+r.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){var s=this.annotation;return t&&(s=gP(Hd(t),s)),this.loadFile(s)}}},e.startWith=function(t,r){return t?t.substr(0,r.length)===r:!1},e.withContent=function(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)},n}(),Aw=Nd;Nd.default=Nd;var vP=rt.SourceMapConsumer,yP=rt.SourceMapGenerator,sw=rt.fileURLToPath,Fa=rt.pathToFileURL,Kd=rt.isAbsolute,Vd=rt.resolve,wP=hP.nanoid,Gd=rt,ow=Rd,bP=Aw,jd=Symbol("fromOffsetCache"),BP=!!(vP&&yP),aw=!!(Vd&&Kd),xa=function(){function n(t,r){if(r===void 0&&(r={}),t===null||typeof t>"u"||(typeof t>"u"?"undefined":Ae(t))==="object"&&!t.toString)throw new Error("PostCSS received "+t+" instead of CSS string");if(this.css=t.toString(),this.css[0]==="\uFEFF"||this.css[0]==="￾"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,r.from&&(!aw||/^\w+:\/\//.test(r.from)||Kd(r.from)?this.file=r.from:this.file=Vd(r.from)),aw&&BP){var i=new bP(this.css,r);if(i.text){this.map=i;var A=i.consumer().file;!this.file&&A&&(this.file=this.mapResolve(A))}}this.file||(this.id="<input css "+wP(6)+">"),this.map&&(this.map.file=this.from)}var e=n.prototype;return e.error=function(t,r,i,A){A===void 0&&(A={});var s,o,a;if(r&&(typeof r>"u"?"undefined":Ae(r))==="object"){var c=r,u=i;if(typeof c.offset=="number"){var l=this.fromOffset(c.offset);r=l.line,i=l.col}else r=c.line,i=c.column;if(typeof u.offset=="number"){var d=this.fromOffset(u.offset);o=d.line,a=d.col}else o=u.line,a=u.column}else if(!i){var h=this.fromOffset(r);r=h.line,i=h.col}var f=this.origin(r,i,o,a);return f?s=new ow(t,f.endLine===void 0?f.line:{column:f.column,line:f.line},f.endLine===void 0?f.column:{column:f.endColumn,line:f.endLine},f.source,f.file,A.plugin):s=new ow(t,o===void 0?r:{column:i,line:r},o===void 0?i:{column:a,line:o},this.css,this.file,A.plugin),s.input={column:i,endColumn:a,endLine:o,line:r,source:this.css},this.file&&(Fa&&(s.input.url=Fa(this.file).toString()),s.input.file=this.file),s},e.fromOffset=function(t){var r,i;if(this[jd])i=this[jd];else{var A=this.css.split(`
79
+ `);i=new Array(A.length);for(var s=0,o=0,a=A.length;o<a;o++)i[o]=s,s+=A[o].length+1;this[jd]=i}r=i[i.length-1];var c=0;if(t>=r)c=i.length-1;else for(var u=i.length-2,l;c<u;)if(l=c+(u-c>>1),t<i[l])u=l-1;else if(t>=i[l+1])c=l+1;else{c=l;break}return{col:t-i[c]+1,line:c+1}},e.mapResolve=function(t){return/^\w+:\/\//.test(t)?t:Vd(this.map.consumer().sourceRoot||this.map.root||".",t)},e.origin=function(t,r,i,A){if(!this.map)return!1;var s=this.map.consumer(),o=s.originalPositionFor({column:r,line:t});if(!o.source)return!1;var a;typeof i=="number"&&(a=s.originalPositionFor({column:A,line:i}));var c;Kd(o.source)?c=Fa(o.source):c=new URL(o.source,this.map.consumer().sourceRoot||Fa(this.map.mapFile));var u={column:o.column,endColumn:a&&a.column,endLine:a&&a.line,line:o.line,url:c.toString()};if(c.protocol==="file:")if(sw)u.file=sw(c);else throw new Error("file: protocol is not available in this PostCSS build");var l=s.sourceContentFor(o.source);return l&&(u.source=l),u},e.toJSON=function(){for(var t={},r=0,i=["hasBOM","css","file","id"];r<i.length;r++){var A=i[r];this[A]!=null&&(t[A]=this[A])}return this.map&&(t.map=fe({},this.map),t.map.consumerCache&&(t.map.consumerCache=void 0)),t},wt(n,[{key:"from",get:function(){return this.file||this.id}}]),n}(),Qa=xa;xa.default=xa,Gd&&Gd.registerInput&&Gd.registerInput(xa);var cw=rt.SourceMapConsumer,Ra=rt.SourceMapGenerator,Pa=rt.dirname,uw=rt.relative,lw=rt.resolve,dw=rt.sep,hw=rt.pathToFileURL,CP=Qa,_P=!!(cw&&Ra),SP=!!(Pa&&lw&&uw&&dw),kP=function(){function n(t,r,i,A){this.stringify=t,this.mapOpts=i.map||{},this.root=r,this.opts=i,this.css=A,this.originalCSS=A,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}var e=n.prototype;return e.addAnnotation=function(){var t;this.isInline()?t="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?t=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?t=this.mapOpts.annotation(this.opts.to,this.root):t=this.outputFile()+".map";var r=`
80
+ `;this.css.includes(`\r
81
+ `)&&(r=`\r
82
+ `),this.css+=r+"/*# sourceMappingURL="+t+" */"},e.applyPrevMaps=function(){for(var t=W(this.previous()),r;!(r=t()).done;){var i=r.value,A=this.toUrl(this.path(i.file)),s=i.root||Pa(i.file),o=void 0;this.mapOpts.sourcesContent===!1?(o=new cw(i.text),o.sourcesContent&&(o.sourcesContent=null)):o=i.consumer(),this.map.applySourceMap(o,A,this.toUrl(this.path(s)))}},e.clearAnnotation=function(){if(this.mapOpts.annotation!==!1)if(this.root)for(var t,r=this.root.nodes.length-1;r>=0;r--)t=this.root.nodes[r],t.type==="comment"&&t.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(r);else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))},e.generate=function(){if(this.clearAnnotation(),SP&&_P&&this.isMap())return this.generateMap();var t="";return this.stringify(this.root,function(r){t+=r}),[t]},e.generateMap=function(){if(this.root)this.generateString();else if(this.previous().length===1){var t=this.previous()[0].consumer();t.file=this.outputFile(),this.map=Ra.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new Ra({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]},e.generateString=function(){var t=this;this.css="",this.map=new Ra({file:this.outputFile(),ignoreInvalidMapping:!0});var r=1,i=1,A="<no source>",s={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,a;this.stringify(this.root,function(c,u,l){if(t.css+=c,u&&l!=="end"&&(s.generated.line=r,s.generated.column=i-1,u.source&&u.source.start?(s.source=t.sourcePath(u),s.original.line=u.source.start.line,s.original.column=u.source.start.column-1,t.map.addMapping(s)):(s.source=A,s.original.line=1,s.original.column=0,t.map.addMapping(s))),o=c.match(/\n/g),o?(r+=o.length,a=c.lastIndexOf(`
83
+ `),i=c.length-a):i+=c.length,u&&l!=="start"){var d=u.parent||{raws:{}},h=u.type==="decl"||u.type==="atrule"&&!u.nodes;(!h||u!==d.last||d.raws.semicolon)&&(u.source&&u.source.end?(s.source=t.sourcePath(u),s.original.line=u.source.end.line,s.original.column=u.source.end.column-1,s.generated.line=r,s.generated.column=i-2,t.map.addMapping(s)):(s.source=A,s.original.line=1,s.original.column=0,s.generated.line=r,s.generated.column=i-1,t.map.addMapping(s)))}})},e.isAnnotation=function(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(function(t){return t.annotation}):!0},e.isInline=function(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;var t=this.mapOpts.annotation;return typeof t<"u"&&t!==!0?!1:this.previous().length?this.previous().some(function(r){return r.inline}):!0},e.isMap=function(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0},e.isSourcesContent=function(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(function(t){return t.withContent()}):!0},e.outputFile=function(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"},e.path=function(t){if(this.mapOpts.absolute||t.charCodeAt(0)===60||/^\w+:\/\//.test(t))return t;var r=this.memoizedPaths.get(t);if(r)return r;var i=this.opts.to?Pa(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(i=Pa(lw(i,this.mapOpts.annotation)));var A=uw(i,t);return this.memoizedPaths.set(t,A),A},e.previous=function(){var t=this;if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(function(i){if(i.source&&i.source.input.map){var A=i.source.input.map;t.previousMaps.includes(A)||t.previousMaps.push(A)}});else{var r=new CP(this.originalCSS,this.opts);r.map&&this.previousMaps.push(r.map)}return this.previousMaps},e.setSourcesContent=function(){var t=this,r={};if(this.root)this.root.walk(function(A){if(A.source){var s=A.source.input.from;if(s&&!r[s]){r[s]=!0;var o=t.usesFileUrls?t.toFileUrl(s):t.toUrl(t.path(s));t.map.setSourceContent(o,A.source.input.css)}}});else if(this.css){var i=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(i,this.css)}},e.sourcePath=function(t){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(t.source.input.from):this.toUrl(this.path(t.source.input.from))},e.toBase64=function(t){return Buffer?Buffer.from(t).toString("base64"):window.btoa(unescape(encodeURIComponent(t)))},e.toFileUrl=function(t){var r=this.memoizedFileURLs.get(t);if(r)return r;if(hw){var i=hw(t).toString();return this.memoizedFileURLs.set(t,i),i}else throw new Error("`map.absolute` option is not available in this PostCSS build")},e.toUrl=function(t){var r=this.memoizedURLs.get(t);if(r)return r;dw==="\\"&&(t=t.replace(/\\/g,"/"));var i=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,i),i},n}(),pw=kP,EP=Ta,Wd=function(n){St(e,n);function e(t){var r;return r=n.call(this,t)||this,r.type="comment",r}return e}(EP),Oa=Wd;Wd.default=Wd;var fw=wr.isClean,gw=wr.my,mw=Ia,vw=Oa,UP=Ta,yw,qd,Jd,ww;function bw(n){return n.map(function(e){return e.nodes&&(e.nodes=bw(e.nodes)),delete e.source,e})}function Bw(n){if(n[fw]=!1,n.proxyOf.nodes)for(var e=W(n.proxyOf.nodes),t;!(t=e()).done;){var r=t.value;Bw(r)}}var Vn=function(n){St(e,n);function e(){return n.apply(this,arguments)||this}var t=e.prototype;return t.append=function(){for(var r=arguments.length,i=new Array(r),A=0;A<r;A++)i[A]=arguments[A];for(var s=W(i),o;!(o=s()).done;)for(var a=o.value,c=this.normalize(a,this.last),u=W(c),l;!(l=u()).done;){var d=l.value;this.proxyOf.nodes.push(d)}return this.markDirty(),this},t.cleanRaws=function(r){if(n.prototype.cleanRaws.call(this,r),this.nodes)for(var i=W(this.nodes),A;!(A=i()).done;){var s=A.value;s.cleanRaws(r)}},t.each=function(r){if(this.proxyOf.nodes){for(var i=this.getIterator(),A,s;this.indexes[i]<this.proxyOf.nodes.length&&(A=this.indexes[i],s=r(this.proxyOf.nodes[A],A),s!==!1);)this.indexes[i]+=1;return delete this.indexes[i],s}},t.every=function(r){return this.nodes.every(r)},t.getIterator=function(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;var r=this.lastEach;return this.indexes[r]=0,r},t.getProxyProcessor=function(){return{get:function(r,i){return i==="proxyOf"?r:r[i]?i==="each"||typeof i=="string"&&i.startsWith("walk")?function(){for(var A=arguments.length,s=new Array(A),o=0;o<A;o++)s[o]=arguments[o];var a;return(a=r)[i].apply(a,[].concat(s.map(function(c){return typeof c=="function"?function(u,l){return c(u.toProxy(),l)}:c})))}:i==="every"||i==="some"?function(A){return r[i](function(s){for(var o=arguments.length,a=new Array(o>1?o-1:0),c=1;c<o;c++)a[c-1]=arguments[c];return A.apply(void 0,[].concat([s.toProxy()],a))})}:i==="root"?function(){return r.root().toProxy()}:i==="nodes"?r.nodes.map(function(A){return A.toProxy()}):i==="first"||i==="last"?r[i].toProxy():r[i]:r[i]},set:function(r,i,A){return r[i]===A||(r[i]=A,(i==="name"||i==="params"||i==="selector")&&r.markDirty()),!0}}},t.index=function(r){return typeof r=="number"?r:(r.proxyOf&&(r=r.proxyOf),this.proxyOf.nodes.indexOf(r))},t.insertAfter=function(r,i){var A=this.index(r),s=this.normalize(i,this.proxyOf.nodes[A]).reverse();A=this.index(r);for(var o=W(s),a;!(a=o()).done;){var c=a.value;this.proxyOf.nodes.splice(A+1,0,c)}var u;for(var l in this.indexes)u=this.indexes[l],A<u&&(this.indexes[l]=u+s.length);return this.markDirty(),this},t.insertBefore=function(r,i){var A=this.index(r),s=A===0?"prepend":!1,o=this.normalize(i,this.proxyOf.nodes[A],s).reverse();A=this.index(r);for(var a=W(o),c;!(c=a()).done;){var u=c.value;this.proxyOf.nodes.splice(A,0,u)}var l;for(var d in this.indexes)l=this.indexes[d],A<=l&&(this.indexes[d]=l+o.length);return this.markDirty(),this},t.normalize=function(r,i){var A=this;if(typeof r=="string")r=bw(yw(r).nodes);else if(typeof r>"u")r=[];else if(Array.isArray(r)){r=r.slice(0);for(var s=W(r),o;!(o=s()).done;){var a=o.value;a.parent&&a.parent.removeChild(a,"ignore")}}else if(r.type==="root"&&this.type!=="document"){r=r.nodes.slice(0);for(var c=W(r),u;!(u=c()).done;){var l=u.value;l.parent&&l.parent.removeChild(l,"ignore")}}else if(r.type)r=[r];else if(r.prop){if(typeof r.value>"u")throw new Error("Value field is missed in node creation");typeof r.value!="string"&&(r.value=String(r.value)),r=[new mw(r)]}else if(r.selector)r=[new qd(r)];else if(r.name)r=[new Jd(r)];else if(r.text)r=[new vw(r)];else throw new Error("Unknown node type in node creation");var d=r.map(function(h){return h[gw]||e.rebuild(h),h=h.proxyOf,h.parent&&h.parent.removeChild(h),h[fw]&&Bw(h),typeof h.raws.before>"u"&&i&&typeof i.raws.before<"u"&&(h.raws.before=i.raws.before.replace(/\S/g,"")),h.parent=A.proxyOf,h});return d},t.prepend=function(){for(var r=arguments.length,i=new Array(r),A=0;A<r;A++)i[A]=arguments[A];i=i.reverse();for(var s=W(i),o;!(o=s()).done;){for(var a=o.value,c=this.normalize(a,this.first,"prepend").reverse(),u=W(c),l;!(l=u()).done;){var d=l.value;this.proxyOf.nodes.unshift(d)}for(var h in this.indexes)this.indexes[h]=this.indexes[h]+c.length}return this.markDirty(),this},t.push=function(r){return r.parent=this,this.proxyOf.nodes.push(r),this},t.removeAll=function(){for(var r=W(this.proxyOf.nodes),i;!(i=r()).done;){var A=i.value;A.parent=void 0}return this.proxyOf.nodes=[],this.markDirty(),this},t.removeChild=function(r){r=this.index(r),this.proxyOf.nodes[r].parent=void 0,this.proxyOf.nodes.splice(r,1);var i;for(var A in this.indexes)i=this.indexes[A],i>=r&&(this.indexes[A]=i-1);return this.markDirty(),this},t.replaceValues=function(r,i,A){return A||(A=i,i={}),this.walkDecls(function(s){i.props&&!i.props.includes(s.prop)||i.fast&&!s.value.includes(i.fast)||(s.value=s.value.replace(r,A))}),this.markDirty(),this},t.some=function(r){return this.nodes.some(r)},t.walk=function(r){return this.each(function(i,A){var s;try{s=r(i,A)}catch(o){throw i.addToError(o)}return s!==!1&&i.walk&&(s=i.walk(r)),s})},t.walkAtRules=function(r,i){return i?ee(r,RegExp)?this.walk(function(A,s){if(A.type==="atrule"&&r.test(A.name))return i(A,s)}):this.walk(function(A,s){if(A.type==="atrule"&&A.name===r)return i(A,s)}):(i=r,this.walk(function(A,s){if(A.type==="atrule")return i(A,s)}))},t.walkComments=function(r){return this.walk(function(i,A){if(i.type==="comment")return r(i,A)})},t.walkDecls=function(r,i){return i?ee(r,RegExp)?this.walk(function(A,s){if(A.type==="decl"&&r.test(A.prop))return i(A,s)}):this.walk(function(A,s){if(A.type==="decl"&&A.prop===r)return i(A,s)}):(i=r,this.walk(function(A,s){if(A.type==="decl")return i(A,s)}))},t.walkRules=function(r,i){return i?ee(r,RegExp)?this.walk(function(A,s){if(A.type==="rule"&&r.test(A.selector))return i(A,s)}):this.walk(function(A,s){if(A.type==="rule"&&A.selector===r)return i(A,s)}):(i=r,this.walk(function(A,s){if(A.type==="rule")return i(A,s)}))},wt(e,[{key:"first",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}},{key:"last",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}]),e}(UP);Vn.registerParse=function(n){yw=n},Vn.registerRule=function(n){qd=n},Vn.registerAtRule=function(n){Jd=n},Vn.registerRoot=function(n){ww=n};var Zr=Vn;Vn.default=Vn,Vn.rebuild=function(n){n.type==="atrule"?Object.setPrototypeOf(n,Jd.prototype):n.type==="rule"?Object.setPrototypeOf(n,qd.prototype):n.type==="decl"?Object.setPrototypeOf(n,mw.prototype):n.type==="comment"?Object.setPrototypeOf(n,vw.prototype):n.type==="root"&&Object.setPrototypeOf(n,ww.prototype),n[gw]=!0,n.nodes&&n.nodes.forEach(function(e){Vn.rebuild(e)})};var TP=Zr,Cw,_w,es=function(n){St(e,n);function e(r){var i;return i=n.call(this,fe({type:"document"},r))||this,i.nodes||(i.nodes=[]),i}var t=e.prototype;return t.toResult=function(r){r===void 0&&(r={});var i=new Cw(new _w,this,r);return i.stringify()},e}(TP);es.registerLazyResult=function(n){Cw=n},es.registerProcessor=function(n){_w=n};var zd=es;es.default=es;var Sw={},kw=function(n){Sw[n]||(Sw[n]=!0,typeof console<"u"&&console.warn&&console.warn(n))},Xd=function(){function n(t,r){if(r===void 0&&(r={}),this.type="warning",this.text=t,r.node&&r.node.source){var i=r.node.rangeBy(r);this.line=i.start.line,this.column=i.start.column,this.endLine=i.end.line,this.endColumn=i.end.column}for(var A in r)this[A]=r[A]}var e=n.prototype;return e.toString=function(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text},n}(),Ew=Xd;Xd.default=Xd;var IP=Ew,Yd=function(){function n(t,r,i){this.processor=t,this.messages=[],this.root=r,this.opts=i,this.css=void 0,this.map=void 0}var e=n.prototype;return e.toString=function(){return this.css},e.warn=function(t,r){r===void 0&&(r={}),r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);var i=new IP(t,r);return this.messages.push(i),i},e.warnings=function(){return this.messages.filter(function(t){return t.type==="warning"})},wt(n,[{key:"content",get:function(){return this.css}}]),n}(),Zd=Yd;Yd.default=Yd;var $d="'".charCodeAt(0),Uw='"'.charCodeAt(0),Ma="\\".charCodeAt(0),Tw="/".charCodeAt(0),La=`
84
+ `.charCodeAt(0),ts=" ".charCodeAt(0),Da="\f".charCodeAt(0),Ha=" ".charCodeAt(0),Na="\r".charCodeAt(0),FP="[".charCodeAt(0),xP="]".charCodeAt(0),QP="(".charCodeAt(0),RP=")".charCodeAt(0),PP="{".charCodeAt(0),OP="}".charCodeAt(0),MP=";".charCodeAt(0),LP="*".charCodeAt(0),DP=":".charCodeAt(0),HP="@".charCodeAt(0),Ka=/[\t\n\f\r "#'()/;[\\\]{}]/g,Va=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,NP=/.[\r\n"'(/\\]/,Iw=/[\da-f]/i,KP=function(n,e){e===void 0&&(e={});var t=n.css.valueOf(),r=e.ignoreErrors,i,A,s,o,a,c,u,l,d,h,f=t.length,p=0,g=[],v=[];function y(){return p}function b(k){throw n.error("Unclosed "+k,p)}function B(){return v.length===0&&p>=f}function w(k){if(v.length)return v.pop();if(!(p>=f)){var T=k?k.ignoreUnclosed:!1;switch(i=t.charCodeAt(p),i){case La:case ts:case Ha:case Na:case Da:{A=p;do A+=1,i=t.charCodeAt(A);while(i===ts||i===La||i===Ha||i===Na||i===Da);h=["space",t.slice(p,A)],p=A-1;break}case FP:case xP:case PP:case OP:case DP:case MP:case RP:{var I=String.fromCharCode(i);h=[I,I,p];break}case QP:{if(l=g.length?g.pop()[1]:"",d=t.charCodeAt(p+1),l==="url"&&d!==$d&&d!==Uw&&d!==ts&&d!==La&&d!==Ha&&d!==Da&&d!==Na){A=p;do{if(c=!1,A=t.indexOf(")",A+1),A===-1)if(r||T){A=p;break}else b("bracket");for(u=A;t.charCodeAt(u-1)===Ma;)u-=1,c=!c}while(c);h=["brackets",t.slice(p,A+1),p,A],p=A}else A=t.indexOf(")",p+1),o=t.slice(p,A+1),A===-1||NP.test(o)?h=["(","(",p]:(h=["brackets",o,p,A],p=A);break}case $d:case Uw:{s=i===$d?"'":'"',A=p;do{if(c=!1,A=t.indexOf(s,A+1),A===-1)if(r||T){A=p+1;break}else b("string");for(u=A;t.charCodeAt(u-1)===Ma;)u-=1,c=!c}while(c);h=["string",t.slice(p,A+1),p,A],p=A;break}case HP:{Ka.lastIndex=p+1,Ka.test(t),Ka.lastIndex===0?A=t.length-1:A=Ka.lastIndex-2,h=["at-word",t.slice(p,A+1),p,A],p=A;break}case Ma:{for(A=p,a=!0;t.charCodeAt(A+1)===Ma;)A+=1,a=!a;if(i=t.charCodeAt(A+1),a&&i!==Tw&&i!==ts&&i!==La&&i!==Ha&&i!==Na&&i!==Da&&(A+=1,Iw.test(t.charAt(A)))){for(;Iw.test(t.charAt(A+1));)A+=1;t.charCodeAt(A+1)===ts&&(A+=1)}h=["word",t.slice(p,A+1),p,A],p=A;break}default:{i===Tw&&t.charCodeAt(p+1)===LP?(A=t.indexOf("*/",p+2)+1,A===0&&(r||T?A=t.length:b("comment")),h=["comment",t.slice(p,A+1),p,A],p=A):(Va.lastIndex=p+1,Va.test(t),Va.lastIndex===0?A=t.length-1:A=Va.lastIndex-2,h=["word",t.slice(p,A+1),p,A],g.push(h),p=A);break}}return p++,h}}function _(k){v.push(k)}return{back:_,endOfFile:B,nextToken:w,position:y}},Fw=Zr,Ga=function(n){St(e,n);function e(r){var i;return i=n.call(this,r)||this,i.type="atrule",i}var t=e.prototype;return t.append=function(){for(var r=arguments.length,i=new Array(r),A=0;A<r;A++)i[A]=arguments[A];var s;return this.proxyOf.nodes||(this.nodes=[]),(s=n.prototype.append).call.apply(s,[].concat([this],i))},t.prepend=function(){for(var r=arguments.length,i=new Array(r),A=0;A<r;A++)i[A]=arguments[A];var s;return this.proxyOf.nodes||(this.nodes=[]),(s=n.prototype.prepend).call.apply(s,[].concat([this],i))},e}(Fw),eh=Ga;Ga.default=Ga,Fw.registerAtRule(Ga);var xw=Zr,Qw,Rw,Vi=function(n){St(e,n);function e(r){var i;return i=n.call(this,r)||this,i.type="root",i.nodes||(i.nodes=[]),i}var t=e.prototype;return t.normalize=function(r,i,A){var s=n.prototype.normalize.call(this,r);if(i){if(A==="prepend")this.nodes.length>1?i.raws.before=this.nodes[1].raws.before:delete i.raws.before;else if(this.first!==i)for(var o=W(s),a;!(a=o()).done;){var c=a.value;c.raws.before=i.raws.before}}return s},t.removeChild=function(r,i){var A=this.index(r);return!i&&A===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[A].raws.before),n.prototype.removeChild.call(this,r)},t.toResult=function(r){r===void 0&&(r={});var i=new Qw(new Rw,this,r);return i.stringify()},e}(xw);Vi.registerLazyResult=function(n){Qw=n},Vi.registerProcessor=function(n){Rw=n};var ns=Vi;Vi.default=Vi,xw.registerRoot(Vi);var rs={comma:function(n){return rs.split(n,[","],!0)},space:function(n){var e=[" ",`
85
+ `," "];return rs.split(n,e)},split:function(n,e,t){for(var r=[],i="",A=!1,s=0,o=!1,a="",c=!1,u=W(n),l;!(l=u()).done;){var d=l.value;c?c=!1:d==="\\"?c=!0:o?d===a&&(o=!1):d==='"'||d==="'"?(o=!0,a=d):d==="("?s+=1:d===")"?s>0&&(s-=1):s===0&&e.includes(d)&&(A=!0),A?(i!==""&&r.push(i.trim()),i="",A=!1):i+=d}return(t||i!=="")&&r.push(i.trim()),r}},Pw=rs;rs.default=rs;var Ow=Zr,VP=Pw,ja=function(n){St(e,n);function e(t){var r;return r=n.call(this,t)||this,r.type="rule",r.nodes||(r.nodes=[]),r}return wt(e,[{key:"selectors",get:function(){return VP.comma(this.selector)},set:function(t){var r=this.selector?this.selector.match(/,\s*/):null,i=r?r[0]:","+this.raw("between","beforeOpen");this.selector=t.join(i)}}]),e}(Ow),th=ja;ja.default=ja,Ow.registerRule(ja);var GP=Ia,jP=KP,WP=Oa,qP=eh,JP=ns,Mw=th,Lw={empty:!0,space:!0};function zP(n){for(var e=n.length-1;e>=0;e--){var t=n[e],r=t[3]||t[2];if(r)return r}}var XP=function(){function n(t){this.input=t,this.root=new JP,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}var e=n.prototype;return e.atrule=function(t){var r=new qP;r.name=t[1].slice(1),r.name===""&&this.unnamedAtrule(r,t),this.init(r,t[2]);for(var i,A,s,o=!1,a=!1,c=[],u=[];!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),i=t[0],i==="("||i==="["?u.push(i==="("?")":"]"):i==="{"&&u.length>0?u.push("}"):i===u[u.length-1]&&u.pop(),u.length===0)if(i===";"){r.source.end=this.getPosition(t[2]),r.source.end.offset++,this.semicolon=!0;break}else if(i==="{"){a=!0;break}else if(i==="}"){if(c.length>0){for(s=c.length-1,A=c[s];A&&A[0]==="space";)A=c[--s];A&&(r.source.end=this.getPosition(A[3]||A[2]),r.source.end.offset++)}this.end(t);break}else c.push(t);else c.push(t);if(this.tokenizer.endOfFile()){o=!0;break}}r.raws.between=this.spacesAndCommentsFromEnd(c),c.length?(r.raws.afterName=this.spacesAndCommentsFromStart(c),this.raw(r,"params",c),o&&(t=c[c.length-1],r.source.end=this.getPosition(t[3]||t[2]),r.source.end.offset++,this.spaces=r.raws.between,r.raws.between="")):(r.raws.afterName="",r.params=""),a&&(r.nodes=[],this.current=r)},e.checkMissedSemicolon=function(t){var r=this.colon(t);if(r!==!1){for(var i=0,A,s=r-1;s>=0&&(A=t[s],!(A[0]!=="space"&&(i+=1,i===2)));s--);throw this.input.error("Missed semicolon",A[0]==="word"?A[3]+1:A[2])}},e.colon=function(t){for(var r=0,i,A,s,o=W(t.entries()),a;!(a=o()).done;){var c=a.value,u=c[0],l=c[1];if(i=l,A=i[0],A==="("&&(r+=1),A===")"&&(r-=1),r===0&&A===":")if(!s)this.doubleColon(i);else{if(s[0]==="word"&&s[1]==="progid")continue;return u}s=i}return!1},e.comment=function(t){var r=new WP;this.init(r,t[2]),r.source.end=this.getPosition(t[3]||t[2]),r.source.end.offset++;var i=t[1].slice(2,-2);if(/^\s*$/.test(i))r.text="",r.raws.left=i,r.raws.right="";else{var A=i.match(/^(\s*)([^]*\S)(\s*)$/);r.text=A[2],r.raws.left=A[1],r.raws.right=A[3]}},e.createTokenizer=function(){this.tokenizer=jP(this.input)},e.decl=function(t,r){var i=new GP;this.init(i,t[0][2]);var A=t[t.length-1];for(A[0]===";"&&(this.semicolon=!0,t.pop()),i.source.end=this.getPosition(A[3]||A[2]||zP(t)),i.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),i.raws.before+=t.shift()[1];for(i.source.start=this.getPosition(t[0][2]),i.prop="";t.length;){var s=t[0][0];if(s===":"||s==="space"||s==="comment")break;i.prop+=t.shift()[1]}i.raws.between="";for(var o;t.length;)if(o=t.shift(),o[0]===":"){i.raws.between+=o[1];break}else o[0]==="word"&&/\w/.test(o[1])&&this.unknownWord([o]),i.raws.between+=o[1];(i.prop[0]==="_"||i.prop[0]==="*")&&(i.raws.before+=i.prop[0],i.prop=i.prop.slice(1));for(var a=[],c;t.length&&(c=t[0][0],!(c!=="space"&&c!=="comment"));)a.push(t.shift());this.precheckMissedSemicolon(t);for(var u=t.length-1;u>=0;u--){if(o=t[u],o[1].toLowerCase()==="!important"){i.important=!0;var l=this.stringFrom(t,u);l=this.spacesFromEnd(t)+l,l!==" !important"&&(i.raws.important=l);break}else if(o[1].toLowerCase()==="important"){for(var d=t.slice(0),h="",f=u;f>0;f--){var p=d[f][0];if(h.trim().indexOf("!")===0&&p!=="space")break;h=d.pop()[1]+h}h.trim().indexOf("!")===0&&(i.important=!0,i.raws.important=h,t=d)}if(o[0]!=="space"&&o[0]!=="comment")break}var g=t.some(function(v){return v[0]!=="space"&&v[0]!=="comment"});g&&(i.raws.between+=a.map(function(v){return v[1]}).join(""),a=[]),this.raw(i,"value",a.concat(t),r),i.value.includes(":")&&!r&&this.checkMissedSemicolon(t)},e.doubleColon=function(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})},e.emptyRule=function(t){var r=new Mw;this.init(r,t[2]),r.selector="",r.raws.between="",this.current=r},e.end=function(t){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)},e.endFile=function(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())},e.freeSemicolon=function(t){if(this.spaces+=t[1],this.current.nodes){var r=this.current.nodes[this.current.nodes.length-1];r&&r.type==="rule"&&!r.raws.ownSemicolon&&(r.raws.ownSemicolon=this.spaces,this.spaces="")}},e.getPosition=function(t){var r=this.input.fromOffset(t);return{column:r.col,line:r.line,offset:t}},e.init=function(t,r){this.current.push(t),t.source={input:this.input,start:this.getPosition(r)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)},e.other=function(t){for(var r=!1,i=null,A=!1,s=null,o=[],a=t[1].startsWith("--"),c=[],u=t;u;){if(i=u[0],c.push(u),i==="("||i==="[")s||(s=u),o.push(i==="("?")":"]");else if(a&&A&&i==="{")s||(s=u),o.push("}");else if(o.length===0)if(i===";")if(A){this.decl(c,a);return}else break;else if(i==="{"){this.rule(c);return}else if(i==="}"){this.tokenizer.back(c.pop()),r=!0;break}else i===":"&&(A=!0);else i===o[o.length-1]&&(o.pop(),o.length===0&&(s=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(r=!0),o.length>0&&this.unclosedBracket(s),r&&A){if(!a)for(;c.length&&(u=c[c.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(c.pop());this.decl(c,a)}else this.unknownWord(c)},e.parse=function(){for(var t;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t);break}this.endFile()},e.precheckMissedSemicolon=function(){},e.raw=function(t,r,i,A){for(var s,o,a=i.length,c="",u=!0,l,d,h=0;h<a;h+=1)s=i[h],o=s[0],o==="space"&&h===a-1&&!A?u=!1:o==="comment"?(d=i[h-1]?i[h-1][0]:"empty",l=i[h+1]?i[h+1][0]:"empty",!Lw[d]&&!Lw[l]?c.slice(-1)===","?u=!1:c+=s[1]:u=!1):c+=s[1];if(!u){var f=i.reduce(function(p,g){return p+g[1]},"");t.raws[r]={raw:f,value:c}}t[r]=c},e.rule=function(t){t.pop();var r=new Mw;this.init(r,t[0][2]),r.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(r,"selector",t),this.current=r},e.spacesAndCommentsFromEnd=function(t){for(var r,i="";t.length&&(r=t[t.length-1][0],!(r!=="space"&&r!=="comment"));)i=t.pop()[1]+i;return i},e.spacesAndCommentsFromStart=function(t){for(var r,i="";t.length&&(r=t[0][0],!(r!=="space"&&r!=="comment"));)i+=t.shift()[1];return i},e.spacesFromEnd=function(t){for(var r,i="";t.length&&(r=t[t.length-1][0],r==="space");)i=t.pop()[1]+i;return i},e.stringFrom=function(t,r){for(var i="",A=r;A<t.length;A++)i+=t[A][1];return t.splice(r,t.length-r),i},e.unclosedBlock=function(){var t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)},e.unclosedBracket=function(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})},e.unexpectedClose=function(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})},e.unknownWord=function(t){throw this.input.error("Unknown word",{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})},e.unnamedAtrule=function(t,r){throw this.input.error("At-rule without name",{offset:r[2]},{offset:r[2]+r[1].length})},n}(),YP=XP,ZP=Zr,$P=YP,eO=Qa;function Wa(n,e){var t=new eO(n,e),r=new $P(t);try{r.parse()}catch(i){throw process.env.NODE_ENV!=="production"&&i.name==="CssSyntaxError"&&e&&e.from&&(/\.scss$/i.test(e.from)?i.message+=`
86
+ You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(e.from)?i.message+=`
87
+ You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(e.from)&&(i.message+=`
88
+ You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return r.root}var nh=Wa;Wa.default=Wa,ZP.registerParse(Wa);var En=wr.isClean,tO=wr.my,nO=pw,rO=Ea,iO=Zr,AO=zd,sO=kw,Dw=Zd,oO=nh,aO=ns,cO={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},uO={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},lO={Once:!0,postcssPlugin:!0,prepare:!0},Gi=0;function is(n){return(typeof n>"u"?"undefined":Ae(n))==="object"&&typeof n.then=="function"}function Hw(n){var e=!1,t=cO[n.type];return n.type==="decl"?e=n.prop.toLowerCase():n.type==="atrule"&&(e=n.name.toLowerCase()),e&&n.append?[t,t+"-"+e,Gi,t+"Exit",t+"Exit-"+e]:e?[t,t+"-"+e,t+"Exit",t+"Exit-"+e]:n.append?[t,Gi,t+"Exit"]:[t,t+"Exit"]}function Nw(n){var e;return n.type==="document"?e=["Document",Gi,"DocumentExit"]:n.type==="root"?e=["Root",Gi,"RootExit"]:e=Hw(n),{eventIndex:0,events:e,iterator:0,node:n,visitorIndex:0,visitors:[]}}function rh(n){return n[En]=!1,n.nodes&&n.nodes.forEach(function(e){return rh(e)}),n}var ih={},ji=function(){function n(t,r,i){var A=this;this.stringified=!1,this.processed=!1;var s;if((typeof r>"u"?"undefined":Ae(r))==="object"&&r!==null&&(r.type==="root"||r.type==="document"))s=rh(r);else if(ee(r,n)||ee(r,Dw))s=rh(r.root),r.map&&(typeof i.map>"u"&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=r.map);else{var o=oO;i.syntax&&(o=i.syntax.parse),i.parser&&(o=i.parser),o.parse&&(o=o.parse);try{s=o(r,i)}catch(a){this.processed=!0,this.error=a}s&&!s[tO]&&iO.rebuild(s)}this.result=new Dw(t,s,i),this.helpers=fe({},ih,{postcss:ih,result:this.result}),this.plugins=this.processor.plugins.map(function(a){return(typeof a>"u"?"undefined":Ae(a))==="object"&&a.prepare?fe({},a,a.prepare(A.result)):a})}var e=n.prototype;return e.async=function(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)},e.catch=function(t){return this.async().catch(t)},e.finally=function(t){return this.async().then(t,t)},e.getAsyncError=function(){throw new Error("Use process(css).then(cb) to work with async plugins")},e.handleError=function(t,r){var i=this.result.lastPlugin;try{if(r&&r.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin)t.plugin=i.postcssPlugin,t.setMessage();else if(i.postcssVersion&&process.env.NODE_ENV!=="production"){var A=i.postcssPlugin,s=i.postcssVersion,o=this.result.processor.version,a=s.split("."),c=o.split(".");(a[0]!==c[0]||parseInt(a[1])>parseInt(c[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+o+", but "+A+" uses "+s+". Perhaps this is the source of the error below.")}}catch(u){console&&console.error&&console.error(u)}return t},e.prepareVisitors=function(){var t=this;this.listeners={};for(var r=function(c,u,l){t.listeners[u]||(t.listeners[u]=[]),t.listeners[u].push([c,l])},i=W(this.plugins),A;!(A=i()).done;){var s=A.value;if((typeof s>"u"?"undefined":Ae(s))==="object")for(var o in s){if(!uO[o]&&/^[A-Z]/.test(o))throw new Error("Unknown event "+o+" in "+s.postcssPlugin+". Try to update PostCSS ("+this.processor.version+" now).");if(!lO[o])if(Ae(s[o])==="object")for(var a in s[o])a==="*"?r(s,o,s[o][a]):r(s,o+"-"+a.toLowerCase(),s[o][a]);else typeof s[o]=="function"&&r(s,o,s[o])}}this.hasListener=Object.keys(this.listeners).length>0},e.runAsync=function(){var t=this;return Bd(function(){var r,i,A,s,o,a,c,u,l,d,h,f;return XA(this,function(p){switch(p.label){case 0:t.plugin=0,r=0,p.label=1;case 1:if(!(r<t.plugins.length))return[3,6];if(i=t.plugins[r],A=t.runOnRoot(i),!is(A))return[3,5];p.label=2;case 2:return p.trys.push([2,4,,5]),[4,A];case 3:return p.sent(),[3,5];case 4:throw s=p.sent(),t.handleError(s);case 5:return r++,[3,1];case 6:if(t.prepareVisitors(),!t.hasListener)return[3,18];o=t.result.root,p.label=7;case 7:if(o[En])return[3,14];o[En]=!0,a=[Nw(o)],p.label=8;case 8:if(!(a.length>0))return[3,13];if(c=t.visitTick(a),!is(c))return[3,12];p.label=9;case 9:return p.trys.push([9,11,,12]),[4,c];case 10:return p.sent(),[3,12];case 11:throw u=p.sent(),l=a[a.length-1].node,t.handleError(u,l);case 12:return[3,8];case 13:return[3,7];case 14:if(!t.listeners.OnceExit)return[3,18];d=function(){var g,v,y,b,B;return XA(this,function(w){switch(w.label){case 0:g=f.value,v=g[0],y=g[1],t.result.lastPlugin=v,w.label=1;case 1:return w.trys.push([1,6,,7]),o.type!=="document"?[3,3]:(b=o.nodes.map(function(_){return y(_,t.helpers)}),[4,Promise.all(b)]);case 2:return w.sent(),[3,5];case 3:return[4,y(o,t.helpers)];case 4:w.sent(),w.label=5;case 5:return[3,7];case 6:throw B=w.sent(),t.handleError(B);case 7:return[2]}})},h=W(t.listeners.OnceExit),p.label=15;case 15:return(f=h()).done?[3,18]:[5,Py(d())];case 16:p.sent(),p.label=17;case 17:return[3,15];case 18:return t.processed=!0,[2,t.stringify()]}})})()},e.runOnRoot=function(t){var r=this;this.result.lastPlugin=t;try{if((typeof t>"u"?"undefined":Ae(t))==="object"&&t.Once){if(this.result.root.type==="document"){var i=this.result.root.nodes.map(function(A){return t.Once(A,r.helpers)});return is(i[0])?Promise.all(i):i}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(A){throw this.handleError(A)}},e.stringify=function(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();var t=this.result.opts,r=rO;t.syntax&&(r=t.syntax.stringify),t.stringifier&&(r=t.stringifier),r.stringify&&(r=r.stringify);var i=new nO(r,this.result.root,this.result.opts),A=i.generate();return this.result.css=A[0],this.result.map=A[1],this.result},e.sync=function(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(var t=W(this.plugins),r;!(r=t()).done;){var i=r.value,A=this.runOnRoot(i);if(is(A))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){for(var s=this.result.root;!s[En];)s[En]=!0,this.walkSync(s);if(this.listeners.OnceExit)if(s.type==="document")for(var o=W(s.nodes),a;!(a=o()).done;){var c=a.value;this.visitSync(this.listeners.OnceExit,c)}else this.visitSync(this.listeners.OnceExit,s)}return this.result},e.then=function(t,r){return process.env.NODE_ENV!=="production"&&("from"in this.opts||sO("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,r)},e.toString=function(){return this.css},e.visitSync=function(t,r){for(var i=W(t),A;!(A=i()).done;){var s=A.value,o=s[0],a=s[1];this.result.lastPlugin=o;var c=void 0;try{c=a(r,this.helpers)}catch(u){throw this.handleError(u,r.proxyOf)}if(r.type!=="root"&&r.type!=="document"&&!r.parent)return!0;if(is(c))throw this.getAsyncError()}},e.visitTick=function(t){var r=t[t.length-1],i=r.node,A=r.visitors;if(i.type!=="root"&&i.type!=="document"&&!i.parent){t.pop();return}if(A.length>0&&r.visitorIndex<A.length){var s=A[r.visitorIndex],o=s[0],a=s[1];r.visitorIndex+=1,r.visitorIndex===A.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=o;try{return a(i.toProxy(),this.helpers)}catch(h){throw this.handleError(h,i)}}if(r.iterator!==0){for(var c=r.iterator,u;u=i.nodes[i.indexes[c]];)if(i.indexes[c]+=1,!u[En]){u[En]=!0,t.push(Nw(u));return}r.iterator=0,delete i.indexes[c]}for(var l=r.events;r.eventIndex<l.length;){var d=l[r.eventIndex];if(r.eventIndex+=1,d===Gi){i.nodes&&i.nodes.length&&(i[En]=!0,r.iterator=i.getIterator());return}else if(this.listeners[d]){r.visitors=this.listeners[d];return}}t.pop()},e.walkSync=function(t){var r=this;t[En]=!0;for(var i=Hw(t),A=W(i),s;!(s=A()).done;){var o=s.value;if(o===Gi)t.nodes&&t.each(function(c){c[En]||r.walkSync(c)});else{var a=this.listeners[o];if(a&&this.visitSync(a,t.toProxy()))return}}},e.warnings=function(){return this.sync().warnings()},wt(n,[{key:"content",get:function(){return this.stringify().content}},{key:"css",get:function(){return this.stringify().css}},{key:"map",get:function(){return this.stringify().map}},{key:"messages",get:function(){return this.sync().messages}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){return this.sync().root}},{key:Symbol.toStringTag,get:function(){return"LazyResult"}}]),n}();ji.registerPostcss=function(n){ih=n};var Kw=ji;ji.default=ji,aO.registerLazyResult(ji),AO.registerLazyResult(ji);var dO=pw,hO=Ea,pO=kw,fO=nh,gO=Zd,Ah=function(){function n(t,r,i){r=r.toString(),this.stringified=!1,this._processor=t,this._css=r,this._opts=i,this._map=void 0;var A,s=hO;this.result=new gO(this._processor,A,this._opts),this.result.css=r;var o=this;Object.defineProperty(this.result,"root",{get:function(){return o.root}});var a=new dO(s,A,this._opts,r);if(a.isMap()){var c=a.generate(),u=c[0],l=c[1];u&&(this.result.css=u),l&&(this.result.map=l)}else a.clearAnnotation(),this.result.css=a.css}var e=n.prototype;return e.async=function(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)},e.catch=function(t){return this.async().catch(t)},e.finally=function(t){return this.async().then(t,t)},e.sync=function(){if(this.error)throw this.error;return this.result},e.then=function(t,r){return process.env.NODE_ENV!=="production"&&("from"in this._opts||pO("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,r)},e.toString=function(){return this._css},e.warnings=function(){return[]},wt(n,[{key:"content",get:function(){return this.result.css}},{key:"css",get:function(){return this.result.css}},{key:"map",get:function(){return this.result.map}},{key:"messages",get:function(){return[]}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){if(this._root)return this._root;var t,r=fO;try{t=r(this._css,this._opts)}catch(i){this.error=i}if(this.error)throw this.error;return this._root=t,t}},{key:Symbol.toStringTag,get:function(){return"NoWorkResult"}}]),n}(),mO=Ah;Ah.default=Ah;var vO=mO,yO=Kw,wO=zd,bO=ns,As=function(){function n(t){t===void 0&&(t=[]),this.version="8.4.38",this.plugins=this.normalize(t)}var e=n.prototype;return e.normalize=function(t){for(var r=[],i=W(t),A;!(A=i()).done;){var s=A.value;if(s.postcss===!0?s=s():s.postcss&&(s=s.postcss),(typeof s>"u"?"undefined":Ae(s))==="object"&&Array.isArray(s.plugins))r=r.concat(s.plugins);else if((typeof s>"u"?"undefined":Ae(s))==="object"&&s.postcssPlugin)r.push(s);else if(typeof s=="function")r.push(s);else if((typeof s>"u"?"undefined":Ae(s))==="object"&&(s.parse||s.stringify)){if(process.env.NODE_ENV!=="production")throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}else throw new Error(s+" is not a PostCSS plugin")}return r},e.process=function(t,r){return r===void 0&&(r={}),!this.plugins.length&&!r.parser&&!r.stringifier&&!r.syntax?new vO(this,t,r):new yO(this,t,r)},e.use=function(t){return this.plugins=this.plugins.concat(this.normalize([t])),this},n}(),BO=As;As.default=As,bO.registerProcessor(As),wO.registerProcessor(As);var CO=Ia,_O=Aw,SO=Oa,kO=eh,EO=Qa,UO=ns,TO=th;function ss(n,e){if(Array.isArray(n))return n.map(function(l){return ss(l)});var t=n.inputs,r=JA(n,["inputs"]);if(t){e=[];for(var i=W(t),A;!(A=i()).done;){var s=A.value,o=fe({},s,{__proto__:EO.prototype});o.map&&(o.map=fe({},o.map,{__proto__:_O.prototype})),e.push(o)}}if(r.nodes&&(r.nodes=n.nodes.map(function(l){return ss(l,e)})),r.source){var a=r.source,c=a.inputId,u=JA(a,["inputId"]);r.source=u,c!=null&&(r.source.input=e[c])}if(r.type==="root")return new UO(r);if(r.type==="decl")return new CO(r);if(r.type==="rule")return new TO(r);if(r.type==="comment")return new SO(r);if(r.type==="atrule")return new kO(r);throw new Error("Unknown node type: "+n.type)}var IO=ss;ss.default=ss;var FO=Rd,Vw=Ia,xO=Kw,QO=Zr,sh=BO,RO=Ea,PO=IO,Gw=zd,OO=Ew,jw=Oa,Ww=eh,MO=Zd,LO=Qa,DO=nh,HO=Pw,qw=th,Jw=ns,NO=Ta;function ke(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new sh(e)}ke.plugin=function(n,e){var t=!1;function r(){for(var A=arguments.length,s=new Array(A),o=0;o<A;o++)s[o]=arguments[o];console&&console.warn&&!t&&(t=!0,console.warn(n+`: postcss.plugin was deprecated. Migration guide:
89
+ https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(n+`: 里面 postcss.plugin 被弃用. 迁移指南:
90
+ https://www.w3ctech.com/topic/2226`));var a=e.apply(void 0,[].concat(s));return a.postcssPlugin=n,a.postcssVersion=new sh().version,a}var i;return Object.defineProperty(r,"postcss",{get:function(){return i||(i=r()),i}}),r.process=function(A,s,o){return ke([r(o)]).process(A,s)},r},ke.stringify=RO,ke.parse=DO,ke.fromJSON=PO,ke.list=HO,ke.comment=function(n){return new jw(n)},ke.atRule=function(n){return new Ww(n)},ke.decl=function(n){return new Vw(n)},ke.rule=function(n){return new qw(n)},ke.root=function(n){return new Jw(n)},ke.document=function(n){return new Gw(n)},ke.CssSyntaxError=FO,ke.Declaration=Vw,ke.Container=QO,ke.Processor=sh,ke.Document=Gw,ke.Comment=jw,ke.Warning=OO,ke.AtRule=Ww,ke.Result=MO,ke.Input=LO,ke.Rule=qw,ke.Root=Jw,ke.Node=NO,xO.registerPostcss(ke);var KO=ke;ke.default=ke;var Ve=$R(KO);Ve.stringify,Ve.fromJSON,Ve.plugin,Ve.parse,Ve.list,Ve.document,Ve.comment,Ve.atRule,Ve.rule,Ve.decl,Ve.root,Ve.CssSyntaxError,Ve.Declaration,Ve.Container,Ve.Processor,Ve.Document,Ve.Comment,Ve.Warning,Ve.AtRule,Ve.Result,Ve.Input,Ve.Rule,Ve.Root,Ve.Node;var VO=Object.defineProperty,GO=function(n,e,t){return e in n?VO(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t},Yt=function(n,e,t){return GO(n,(typeof e>"u"?"undefined":Ae(e))!=="symbol"?e+"":e,t)};function jO(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function WO(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function r(){return ee(this,r)?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}),t}var oh={exports:{}},Me=String,zw=function(){return{isColorSupported:!1,reset:Me,bold:Me,dim:Me,italic:Me,underline:Me,inverse:Me,hidden:Me,strikethrough:Me,black:Me,red:Me,green:Me,yellow:Me,blue:Me,magenta:Me,cyan:Me,white:Me,gray:Me,bgBlack:Me,bgRed:Me,bgGreen:Me,bgYellow:Me,bgBlue:Me,bgMagenta:Me,bgCyan:Me,bgWhite:Me}};oh.exports=zw(),oh.exports.createColors=zw;var qO=oh.exports,JO={},zO=Object.freeze(Object.defineProperty({__proto__:null,default:JO},Symbol.toStringTag,{value:"Module"})),it=WO(zO),Xw=qO,Yw=it,ah=function(n){St(e,n);function e(r,i,A,s,o,a){var c;return c=n.call(this,r)||this,c.name="CssSyntaxError",c.reason=r,o&&(c.file=o),s&&(c.source=s),a&&(c.plugin=a),typeof i<"u"&&typeof A<"u"&&(typeof i=="number"?(c.line=i,c.column=A):(c.line=i.line,c.column=i.column,c.endLine=A.line,c.endColumn=A.column)),c.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(c,e),c}var t=e.prototype;return t.setMessage=function(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason},t.showSourceCode=function(r){var i=this;if(!this.source)return"";var A=this.source;r==null&&(r=Xw.isColorSupported),Yw&&r&&(A=Yw(A));var s=A.split(/\r?\n/),o=Math.max(this.line-3,0),a=Math.min(this.line+2,s.length),c=String(a).length,u,l;if(r){var d=Xw.createColors(!0),h=d.bold,f=d.gray,p=d.red;u=function(g){return h(p(g))},l=function(g){return f(g)}}else u=l=function(g){return g};return s.slice(o,a).map(function(g,v){var y=o+1+v,b=" "+(" "+y).slice(-c)+" | ";if(y===i.line){var B=l(b.replace(/\d/g," "))+g.slice(0,i.column-1).replace(/[^\t]/g," ");return u(">")+l(b)+g+`
91
+ `+B+u("^")}return" "+l(b)+g}).join(`
92
+ `)},t.toString=function(){var r=this.showSourceCode();return r&&(r=`
93
+
94
+ `+r+`
95
+ `),this.name+": "+this.message+r},e}(Ba(Error)),ch=ah;ah.default=ah;var br={};br.isClean=Symbol("isClean"),br.my=Symbol("my");var Zw={after:`
96
+ `,beforeClose:`
97
+ `,beforeComment:`
98
+ `,beforeDecl:`
99
+ `,beforeOpen:" ",beforeRule:`
100
+ `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function XO(n){return n[0].toUpperCase()+n.slice(1)}var uh=function(){function n(t){this.builder=t}var e=n.prototype;return e.atrule=function(t,r){var i="@"+t.name,A=t.params?this.rawValue(t,"params"):"";if(typeof t.raws.afterName<"u"?i+=t.raws.afterName:A&&(i+=" "),t.nodes)this.block(t,i+A);else{var s=(t.raws.between||"")+(r?";":"");this.builder(i+A+s,t)}},e.beforeAfter=function(t,r){var i;t.type==="decl"?i=this.raw(t,null,"beforeDecl"):t.type==="comment"?i=this.raw(t,null,"beforeComment"):r==="before"?i=this.raw(t,null,"beforeRule"):i=this.raw(t,null,"beforeClose");for(var A=t.parent,s=0;A&&A.type!=="root";)s+=1,A=A.parent;if(i.includes(`
101
+ `)){var o=this.raw(t,null,"indent");if(o.length)for(var a=0;a<s;a++)i+=o}return i},e.block=function(t,r){var i=this.raw(t,"between","beforeOpen");this.builder(r+i+"{",t,"start");var A;t.nodes&&t.nodes.length?(this.body(t),A=this.raw(t,"after")):A=this.raw(t,"after","emptyBody"),A&&this.builder(A),this.builder("}",t,"end")},e.body=function(t){for(var r=t.nodes.length-1;r>0&&t.nodes[r].type==="comment";)r-=1;for(var i=this.raw(t,"semicolon"),A=0;A<t.nodes.length;A++){var s=t.nodes[A],o=this.raw(s,"before");o&&this.builder(o),this.stringify(s,r!==A||i)}},e.comment=function(t){var r=this.raw(t,"left","commentLeft"),i=this.raw(t,"right","commentRight");this.builder("/*"+r+t.text+i+"*/",t)},e.decl=function(t,r){var i=this.raw(t,"between","colon"),A=t.prop+i+this.rawValue(t,"value");t.important&&(A+=t.raws.important||" !important"),r&&(A+=";"),this.builder(A,t)},e.document=function(t){this.body(t)},e.raw=function(t,r,i){var A;if(i||(i=r),r&&(A=t.raws[r],typeof A<"u"))return A;var s=t.parent;if(i==="before"&&(!s||s.type==="root"&&s.first===t||s&&s.type==="document"))return"";if(!s)return Zw[i];var o=t.root();if(o.rawCache||(o.rawCache={}),typeof o.rawCache[i]<"u")return o.rawCache[i];if(i==="before"||i==="after")return this.beforeAfter(t,i);var a="raw"+XO(i);return this[a]?A=this[a](o,t):o.walk(function(c){if(A=c.raws[r],typeof A<"u")return!1}),typeof A>"u"&&(A=Zw[i]),o.rawCache[i]=A,A},e.rawBeforeClose=function(t){var r;return t.walk(function(i){if(i.nodes&&i.nodes.length>0&&typeof i.raws.after<"u")return r=i.raws.after,r.includes(`
102
+ `)&&(r=r.replace(/[^\n]+$/,"")),!1}),r&&(r=r.replace(/\S/g,"")),r},e.rawBeforeComment=function(t,r){var i;return t.walkComments(function(A){if(typeof A.raws.before<"u")return i=A.raws.before,i.includes(`
103
+ `)&&(i=i.replace(/[^\n]+$/,"")),!1}),typeof i>"u"?i=this.raw(r,null,"beforeDecl"):i&&(i=i.replace(/\S/g,"")),i},e.rawBeforeDecl=function(t,r){var i;return t.walkDecls(function(A){if(typeof A.raws.before<"u")return i=A.raws.before,i.includes(`
104
+ `)&&(i=i.replace(/[^\n]+$/,"")),!1}),typeof i>"u"?i=this.raw(r,null,"beforeRule"):i&&(i=i.replace(/\S/g,"")),i},e.rawBeforeOpen=function(t){var r;return t.walk(function(i){if(i.type!=="decl"&&(r=i.raws.between,typeof r<"u"))return!1}),r},e.rawBeforeRule=function(t){var r;return t.walk(function(i){if(i.nodes&&(i.parent!==t||t.first!==i)&&typeof i.raws.before<"u")return r=i.raws.before,r.includes(`
105
+ `)&&(r=r.replace(/[^\n]+$/,"")),!1}),r&&(r=r.replace(/\S/g,"")),r},e.rawColon=function(t){var r;return t.walkDecls(function(i){if(typeof i.raws.between<"u")return r=i.raws.between.replace(/[^\s:]/g,""),!1}),r},e.rawEmptyBody=function(t){var r;return t.walk(function(i){if(i.nodes&&i.nodes.length===0&&(r=i.raws.after,typeof r<"u"))return!1}),r},e.rawIndent=function(t){if(t.raws.indent)return t.raws.indent;var r;return t.walk(function(i){var A=i.parent;if(A&&A!==t&&A.parent&&A.parent===t&&typeof i.raws.before<"u"){var s=i.raws.before.split(`
106
+ `);return r=s[s.length-1],r=r.replace(/\S/g,""),!1}}),r},e.rawSemicolon=function(t){var r;return t.walk(function(i){if(i.nodes&&i.nodes.length&&i.last.type==="decl"&&(r=i.raws.semicolon,typeof r<"u"))return!1}),r},e.rawValue=function(t,r){var i=t[r],A=t.raws[r];return A&&A.value===i?A.raw:i},e.root=function(t){this.body(t),t.raws.after&&this.builder(t.raws.after)},e.rule=function(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(t.raws.ownSemicolon,t,"end")},e.stringify=function(t,r){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,r)},n}(),$w=uh;uh.default=uh;var YO=$w;function lh(n,e){var t=new YO(e);t.stringify(n)}var qa=lh;lh.default=lh;var Ja=br.isClean,ZO=br.my,$O=ch,e2=$w,t2=qa;function dh(n,e){var t=new n.constructor;for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)&&r!=="proxyCache"){var i=n[r],A=typeof i>"u"?"undefined":Ae(i);r==="parent"&&A==="object"?e&&(t[r]=e):r==="source"?t[r]=i:Array.isArray(i)?t[r]=i.map(function(s){return dh(s,t)}):(A==="object"&&i!==null&&(i=dh(i)),t[r]=i)}return t}var hh=function(){function n(t){t===void 0&&(t={}),this.raws={},this[Ja]=!1,this[ZO]=!0;for(var r in t)if(r==="nodes"){this.nodes=[];for(var i=W(t[r]),A;!(A=i()).done;){var s=A.value;typeof s.clone=="function"?this.append(s.clone()):this.append(s)}}else this[r]=t[r]}var e=n.prototype;return e.addToError=function(t){if(t.postcssNode=this,t.stack&&this.source&&/\n\s{4}at /.test(t.stack)){var r=this.source;t.stack=t.stack.replace(/\n\s{4}at /,"$&"+r.input.from+":"+r.start.line+":"+r.start.column+"$&")}return t},e.after=function(t){return this.parent.insertAfter(this,t),this},e.assign=function(t){t===void 0&&(t={});for(var r in t)this[r]=t[r];return this},e.before=function(t){return this.parent.insertBefore(this,t),this},e.cleanRaws=function(t){delete this.raws.before,delete this.raws.after,t||delete this.raws.between},e.clone=function(t){t===void 0&&(t={});var r=dh(this);for(var i in t)r[i]=t[i];return r},e.cloneAfter=function(t){t===void 0&&(t={});var r=this.clone(t);return this.parent.insertAfter(this,r),r},e.cloneBefore=function(t){t===void 0&&(t={});var r=this.clone(t);return this.parent.insertBefore(this,r),r},e.error=function(t,r){if(r===void 0&&(r={}),this.source){var i=this.rangeBy(r),A=i.end,s=i.start;return this.source.input.error(t,{column:s.column,line:s.line},{column:A.column,line:A.line},r)}return new $O(t)},e.getProxyProcessor=function(){return{get:function(t,r){return r==="proxyOf"?t:r==="root"?function(){return t.root().toProxy()}:t[r]},set:function(t,r,i){return t[r]===i||(t[r]=i,(r==="prop"||r==="value"||r==="name"||r==="params"||r==="important"||r==="text")&&t.markDirty()),!0}}},e.markDirty=function(){if(this[Ja]){this[Ja]=!1;for(var t=this;t=t.parent;)t[Ja]=!1}},e.next=function(){if(this.parent){var t=this.parent.index(this);return this.parent.nodes[t+1]}},e.positionBy=function(t,r){var i=this.source.start;if(t.index)i=this.positionInside(t.index,r);else if(t.word){r=this.toString();var A=r.indexOf(t.word);A!==-1&&(i=this.positionInside(A,r))}return i},e.positionInside=function(t,r){for(var i=r||this.toString(),A=this.source.start.column,s=this.source.start.line,o=0;o<t;o++)i[o]===`
107
+ `?(A=1,s+=1):A+=1;return{column:A,line:s}},e.prev=function(){if(this.parent){var t=this.parent.index(this);return this.parent.nodes[t-1]}},e.rangeBy=function(t){var r={column:this.source.start.column,line:this.source.start.line},i=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:r.column+1,line:r.line};if(t.word){var A=this.toString(),s=A.indexOf(t.word);s!==-1&&(r=this.positionInside(s,A),i=this.positionInside(s+t.word.length,A))}else t.start?r={column:t.start.column,line:t.start.line}:t.index&&(r=this.positionInside(t.index)),t.end?i={column:t.end.column,line:t.end.line}:typeof t.endIndex=="number"?i=this.positionInside(t.endIndex):t.index&&(i=this.positionInside(t.index+1));return(i.line<r.line||i.line===r.line&&i.column<=r.column)&&(i={column:r.column+1,line:r.line}),{end:i,start:r}},e.raw=function(t,r){var i=new e2;return i.raw(this,t,r)},e.remove=function(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this},e.replaceWith=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];if(this.parent){for(var A=this,s=!1,o=W(r),a;!(a=o()).done;){var c=a.value;c===this?s=!0:s?(this.parent.insertAfter(A,c),A=c):this.parent.insertBefore(A,c)}s||this.remove()}return this},e.root=function(){for(var t=this;t.parent&&t.parent.type!=="document";)t=t.parent;return t},e.toJSON=function(t,r){var i={},A=r==null;r=r||new Map;var s=0;for(var o in this)if(Object.prototype.hasOwnProperty.call(this,o)&&!(o==="parent"||o==="proxyCache")){var a=this[o];if(Array.isArray(a))i[o]=a.map(function(u){return(typeof u>"u"?"undefined":Ae(u))==="object"&&u.toJSON?u.toJSON(null,r):u});else if((typeof a>"u"?"undefined":Ae(a))==="object"&&a.toJSON)i[o]=a.toJSON(null,r);else if(o==="source"){var c=r.get(a.input);c==null&&(c=s,r.set(a.input,s),s++),i[o]={end:a.end,inputId:c,start:a.start}}else i[o]=a}return A&&(i.inputs=[].concat(r.keys()).map(function(u){return u.toJSON()})),i},e.toProxy=function(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache},e.toString=function(t){t===void 0&&(t=t2),t.stringify&&(t=t.stringify);var r="";return t(this,function(i){r+=i}),r},e.warn=function(t,r,i){var A={node:this};for(var s in i)A[s]=i[s];return t.warn(r,A)},wt(n,[{key:"proxyOf",get:function(){return this}}]),n}(),za=hh;hh.default=hh;var n2=za,ph=function(n){St(e,n);function e(t){var r;return t&&typeof t.value<"u"&&typeof t.value!="string"&&(t=fe({},t,{value:String(t.value)})),r=n.call(this,t)||this,r.type="decl",r}return wt(e,[{key:"variable",get:function(){return this.prop.startsWith("--")||this.prop[0]==="$"}}]),e}(n2),Xa=ph;ph.default=ph;var r2="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",i2=function(n){n===void 0&&(n=21);for(var e="",t=n;t--;)e+=r2[Math.random()*64|0];return e},A2={nanoid:i2},eb=it.SourceMapConsumer,tb=it.SourceMapGenerator,s2=it.existsSync,o2=it.readFileSync,fh=it.dirname,a2=it.join;function c2(n){return Buffer?Buffer.from(n,"base64").toString():window.atob(n)}var gh=function(){function n(t,r){if(r.map!==!1){this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");var i=r.map?r.map.prev:void 0,A=this.loadMap(r.from,i);!this.mapFile&&r.from&&(this.mapFile=r.from),this.mapFile&&(this.root=fh(this.mapFile)),A&&(this.text=A)}}var e=n.prototype;return e.consumer=function(){return this.consumerCache||(this.consumerCache=new eb(this.text)),this.consumerCache},e.decodeInline=function(t){var r=/^data:application\/json;charset=utf-?8;base64,/,i=/^data:application\/json;base64,/,A=/^data:application\/json;charset=utf-?8,/,s=/^data:application\/json,/;if(A.test(t)||s.test(t))return decodeURIComponent(t.substr(RegExp.lastMatch.length));if(r.test(t)||i.test(t))return c2(t.substr(RegExp.lastMatch.length));var o=t.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+o)},e.getAnnotationURL=function(t){return t.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()},e.isMap=function(t){return(typeof t>"u"?"undefined":Ae(t))!=="object"?!1:typeof t.mappings=="string"||typeof t._mappings=="string"||Array.isArray(t.sections)},e.loadAnnotation=function(t){var r=t.match(/\/\*\s*# sourceMappingURL=/gm);if(r){var i=t.lastIndexOf(r.pop()),A=t.indexOf("*/",i);i>-1&&A>-1&&(this.annotation=this.getAnnotationURL(t.substring(i,A)))}},e.loadFile=function(t){if(this.root=fh(t),s2(t))return this.mapFile=t,o2(t,"utf-8").toString().trim()},e.loadMap=function(t,r){if(r===!1)return!1;if(r){if(typeof r=="string")return r;if(typeof r=="function"){var i=r(t);if(i){var A=this.loadFile(i);if(!A)throw new Error("Unable to load previous source map: "+i.toString());return A}}else{if(ee(r,eb))return tb.fromSourceMap(r).toString();if(ee(r,tb))return r.toString();if(this.isMap(r))return JSON.stringify(r);throw new Error("Unsupported previous source map format: "+r.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){var s=this.annotation;return t&&(s=a2(fh(t),s)),this.loadFile(s)}}},e.startWith=function(t,r){return t?t.substr(0,r.length)===r:!1},e.withContent=function(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)},n}(),nb=gh;gh.default=gh;var u2=it.SourceMapConsumer,l2=it.SourceMapGenerator,rb=it.fileURLToPath,Ya=it.pathToFileURL,mh=it.isAbsolute,vh=it.resolve,d2=A2.nanoid,yh=it,ib=ch,h2=nb,wh=Symbol("fromOffsetCache"),p2=!!(u2&&l2),Ab=!!(vh&&mh),Za=function(){function n(t,r){if(r===void 0&&(r={}),t===null||typeof t>"u"||(typeof t>"u"?"undefined":Ae(t))==="object"&&!t.toString)throw new Error("PostCSS received "+t+" instead of CSS string");if(this.css=t.toString(),this.css[0]==="\uFEFF"||this.css[0]==="￾"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,r.from&&(!Ab||/^\w+:\/\//.test(r.from)||mh(r.from)?this.file=r.from:this.file=vh(r.from)),Ab&&p2){var i=new h2(this.css,r);if(i.text){this.map=i;var A=i.consumer().file;!this.file&&A&&(this.file=this.mapResolve(A))}}this.file||(this.id="<input css "+d2(6)+">"),this.map&&(this.map.file=this.from)}var e=n.prototype;return e.error=function(t,r,i,A){A===void 0&&(A={});var s,o,a;if(r&&(typeof r>"u"?"undefined":Ae(r))==="object"){var c=r,u=i;if(typeof c.offset=="number"){var l=this.fromOffset(c.offset);r=l.line,i=l.col}else r=c.line,i=c.column;if(typeof u.offset=="number"){var d=this.fromOffset(u.offset);o=d.line,a=d.col}else o=u.line,a=u.column}else if(!i){var h=this.fromOffset(r);r=h.line,i=h.col}var f=this.origin(r,i,o,a);return f?s=new ib(t,f.endLine===void 0?f.line:{column:f.column,line:f.line},f.endLine===void 0?f.column:{column:f.endColumn,line:f.endLine},f.source,f.file,A.plugin):s=new ib(t,o===void 0?r:{column:i,line:r},o===void 0?i:{column:a,line:o},this.css,this.file,A.plugin),s.input={column:i,endColumn:a,endLine:o,line:r,source:this.css},this.file&&(Ya&&(s.input.url=Ya(this.file).toString()),s.input.file=this.file),s},e.fromOffset=function(t){var r,i;if(this[wh])i=this[wh];else{var A=this.css.split(`
108
+ `);i=new Array(A.length);for(var s=0,o=0,a=A.length;o<a;o++)i[o]=s,s+=A[o].length+1;this[wh]=i}r=i[i.length-1];var c=0;if(t>=r)c=i.length-1;else for(var u=i.length-2,l;c<u;)if(l=c+(u-c>>1),t<i[l])u=l-1;else if(t>=i[l+1])c=l+1;else{c=l;break}return{col:t-i[c]+1,line:c+1}},e.mapResolve=function(t){return/^\w+:\/\//.test(t)?t:vh(this.map.consumer().sourceRoot||this.map.root||".",t)},e.origin=function(t,r,i,A){if(!this.map)return!1;var s=this.map.consumer(),o=s.originalPositionFor({column:r,line:t});if(!o.source)return!1;var a;typeof i=="number"&&(a=s.originalPositionFor({column:A,line:i}));var c;mh(o.source)?c=Ya(o.source):c=new URL(o.source,this.map.consumer().sourceRoot||Ya(this.map.mapFile));var u={column:o.column,endColumn:a&&a.column,endLine:a&&a.line,line:o.line,url:c.toString()};if(c.protocol==="file:")if(rb)u.file=rb(c);else throw new Error("file: protocol is not available in this PostCSS build");var l=s.sourceContentFor(o.source);return l&&(u.source=l),u},e.toJSON=function(){for(var t={},r=0,i=["hasBOM","css","file","id"];r<i.length;r++){var A=i[r];this[A]!=null&&(t[A]=this[A])}return this.map&&(t.map=fe({},this.map),t.map.consumerCache&&(t.map.consumerCache=void 0)),t},wt(n,[{key:"from",get:function(){return this.file||this.id}}]),n}(),$a=Za;Za.default=Za,yh&&yh.registerInput&&yh.registerInput(Za);var sb=it.SourceMapConsumer,ec=it.SourceMapGenerator,tc=it.dirname,ob=it.relative,ab=it.resolve,cb=it.sep,ub=it.pathToFileURL,f2=$a,g2=!!(sb&&ec),m2=!!(tc&&ab&&ob&&cb),v2=function(){function n(t,r,i,A){this.stringify=t,this.mapOpts=i.map||{},this.root=r,this.opts=i,this.css=A,this.originalCSS=A,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}var e=n.prototype;return e.addAnnotation=function(){var t;this.isInline()?t="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?t=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?t=this.mapOpts.annotation(this.opts.to,this.root):t=this.outputFile()+".map";var r=`
109
+ `;this.css.includes(`\r
110
+ `)&&(r=`\r
111
+ `),this.css+=r+"/*# sourceMappingURL="+t+" */"},e.applyPrevMaps=function(){for(var t=W(this.previous()),r;!(r=t()).done;){var i=r.value,A=this.toUrl(this.path(i.file)),s=i.root||tc(i.file),o=void 0;this.mapOpts.sourcesContent===!1?(o=new sb(i.text),o.sourcesContent&&(o.sourcesContent=null)):o=i.consumer(),this.map.applySourceMap(o,A,this.toUrl(this.path(s)))}},e.clearAnnotation=function(){if(this.mapOpts.annotation!==!1)if(this.root)for(var t,r=this.root.nodes.length-1;r>=0;r--)t=this.root.nodes[r],t.type==="comment"&&t.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(r);else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))},e.generate=function(){if(this.clearAnnotation(),m2&&g2&&this.isMap())return this.generateMap();var t="";return this.stringify(this.root,function(r){t+=r}),[t]},e.generateMap=function(){if(this.root)this.generateString();else if(this.previous().length===1){var t=this.previous()[0].consumer();t.file=this.outputFile(),this.map=ec.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new ec({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]},e.generateString=function(){var t=this;this.css="",this.map=new ec({file:this.outputFile(),ignoreInvalidMapping:!0});var r=1,i=1,A="<no source>",s={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,a;this.stringify(this.root,function(c,u,l){if(t.css+=c,u&&l!=="end"&&(s.generated.line=r,s.generated.column=i-1,u.source&&u.source.start?(s.source=t.sourcePath(u),s.original.line=u.source.start.line,s.original.column=u.source.start.column-1,t.map.addMapping(s)):(s.source=A,s.original.line=1,s.original.column=0,t.map.addMapping(s))),o=c.match(/\n/g),o?(r+=o.length,a=c.lastIndexOf(`
112
+ `),i=c.length-a):i+=c.length,u&&l!=="start"){var d=u.parent||{raws:{}},h=u.type==="decl"||u.type==="atrule"&&!u.nodes;(!h||u!==d.last||d.raws.semicolon)&&(u.source&&u.source.end?(s.source=t.sourcePath(u),s.original.line=u.source.end.line,s.original.column=u.source.end.column-1,s.generated.line=r,s.generated.column=i-2,t.map.addMapping(s)):(s.source=A,s.original.line=1,s.original.column=0,s.generated.line=r,s.generated.column=i-1,t.map.addMapping(s)))}})},e.isAnnotation=function(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(function(t){return t.annotation}):!0},e.isInline=function(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;var t=this.mapOpts.annotation;return typeof t<"u"&&t!==!0?!1:this.previous().length?this.previous().some(function(r){return r.inline}):!0},e.isMap=function(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0},e.isSourcesContent=function(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(function(t){return t.withContent()}):!0},e.outputFile=function(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"},e.path=function(t){if(this.mapOpts.absolute||t.charCodeAt(0)===60||/^\w+:\/\//.test(t))return t;var r=this.memoizedPaths.get(t);if(r)return r;var i=this.opts.to?tc(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(i=tc(ab(i,this.mapOpts.annotation)));var A=ob(i,t);return this.memoizedPaths.set(t,A),A},e.previous=function(){var t=this;if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(function(i){if(i.source&&i.source.input.map){var A=i.source.input.map;t.previousMaps.includes(A)||t.previousMaps.push(A)}});else{var r=new f2(this.originalCSS,this.opts);r.map&&this.previousMaps.push(r.map)}return this.previousMaps},e.setSourcesContent=function(){var t=this,r={};if(this.root)this.root.walk(function(A){if(A.source){var s=A.source.input.from;if(s&&!r[s]){r[s]=!0;var o=t.usesFileUrls?t.toFileUrl(s):t.toUrl(t.path(s));t.map.setSourceContent(o,A.source.input.css)}}});else if(this.css){var i=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(i,this.css)}},e.sourcePath=function(t){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(t.source.input.from):this.toUrl(this.path(t.source.input.from))},e.toBase64=function(t){return Buffer?Buffer.from(t).toString("base64"):window.btoa(unescape(encodeURIComponent(t)))},e.toFileUrl=function(t){var r=this.memoizedFileURLs.get(t);if(r)return r;if(ub){var i=ub(t).toString();return this.memoizedFileURLs.set(t,i),i}else throw new Error("`map.absolute` option is not available in this PostCSS build")},e.toUrl=function(t){var r=this.memoizedURLs.get(t);if(r)return r;cb==="\\"&&(t=t.replace(/\\/g,"/"));var i=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,i),i},n}(),lb=v2,y2=za,bh=function(n){St(e,n);function e(t){var r;return r=n.call(this,t)||this,r.type="comment",r}return e}(y2),nc=bh;bh.default=bh;var db=br.isClean,hb=br.my,pb=Xa,fb=nc,w2=za,gb,Bh,Ch,mb;function vb(n){return n.map(function(e){return e.nodes&&(e.nodes=vb(e.nodes)),delete e.source,e})}function yb(n){if(n[db]=!1,n.proxyOf.nodes)for(var e=W(n.proxyOf.nodes),t;!(t=e()).done;){var r=t.value;yb(r)}}var Gn=function(n){St(e,n);function e(){return n.apply(this,arguments)||this}var t=e.prototype;return t.append=function(){for(var r=arguments.length,i=new Array(r),A=0;A<r;A++)i[A]=arguments[A];for(var s=W(i),o;!(o=s()).done;)for(var a=o.value,c=this.normalize(a,this.last),u=W(c),l;!(l=u()).done;){var d=l.value;this.proxyOf.nodes.push(d)}return this.markDirty(),this},t.cleanRaws=function(r){if(n.prototype.cleanRaws.call(this,r),this.nodes)for(var i=W(this.nodes),A;!(A=i()).done;){var s=A.value;s.cleanRaws(r)}},t.each=function(r){if(this.proxyOf.nodes){for(var i=this.getIterator(),A,s;this.indexes[i]<this.proxyOf.nodes.length&&(A=this.indexes[i],s=r(this.proxyOf.nodes[A],A),s!==!1);)this.indexes[i]+=1;return delete this.indexes[i],s}},t.every=function(r){return this.nodes.every(r)},t.getIterator=function(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;var r=this.lastEach;return this.indexes[r]=0,r},t.getProxyProcessor=function(){return{get:function(r,i){return i==="proxyOf"?r:r[i]?i==="each"||typeof i=="string"&&i.startsWith("walk")?function(){for(var A=arguments.length,s=new Array(A),o=0;o<A;o++)s[o]=arguments[o];var a;return(a=r)[i].apply(a,[].concat(s.map(function(c){return typeof c=="function"?function(u,l){return c(u.toProxy(),l)}:c})))}:i==="every"||i==="some"?function(A){return r[i](function(s){for(var o=arguments.length,a=new Array(o>1?o-1:0),c=1;c<o;c++)a[c-1]=arguments[c];return A.apply(void 0,[].concat([s.toProxy()],a))})}:i==="root"?function(){return r.root().toProxy()}:i==="nodes"?r.nodes.map(function(A){return A.toProxy()}):i==="first"||i==="last"?r[i].toProxy():r[i]:r[i]},set:function(r,i,A){return r[i]===A||(r[i]=A,(i==="name"||i==="params"||i==="selector")&&r.markDirty()),!0}}},t.index=function(r){return typeof r=="number"?r:(r.proxyOf&&(r=r.proxyOf),this.proxyOf.nodes.indexOf(r))},t.insertAfter=function(r,i){var A=this.index(r),s=this.normalize(i,this.proxyOf.nodes[A]).reverse();A=this.index(r);for(var o=W(s),a;!(a=o()).done;){var c=a.value;this.proxyOf.nodes.splice(A+1,0,c)}var u;for(var l in this.indexes)u=this.indexes[l],A<u&&(this.indexes[l]=u+s.length);return this.markDirty(),this},t.insertBefore=function(r,i){var A=this.index(r),s=A===0?"prepend":!1,o=this.normalize(i,this.proxyOf.nodes[A],s).reverse();A=this.index(r);for(var a=W(o),c;!(c=a()).done;){var u=c.value;this.proxyOf.nodes.splice(A,0,u)}var l;for(var d in this.indexes)l=this.indexes[d],A<=l&&(this.indexes[d]=l+o.length);return this.markDirty(),this},t.normalize=function(r,i){var A=this;if(typeof r=="string")r=vb(gb(r).nodes);else if(typeof r>"u")r=[];else if(Array.isArray(r)){r=r.slice(0);for(var s=W(r),o;!(o=s()).done;){var a=o.value;a.parent&&a.parent.removeChild(a,"ignore")}}else if(r.type==="root"&&this.type!=="document"){r=r.nodes.slice(0);for(var c=W(r),u;!(u=c()).done;){var l=u.value;l.parent&&l.parent.removeChild(l,"ignore")}}else if(r.type)r=[r];else if(r.prop){if(typeof r.value>"u")throw new Error("Value field is missed in node creation");typeof r.value!="string"&&(r.value=String(r.value)),r=[new pb(r)]}else if(r.selector)r=[new Bh(r)];else if(r.name)r=[new Ch(r)];else if(r.text)r=[new fb(r)];else throw new Error("Unknown node type in node creation");var d=r.map(function(h){return h[hb]||e.rebuild(h),h=h.proxyOf,h.parent&&h.parent.removeChild(h),h[db]&&yb(h),typeof h.raws.before>"u"&&i&&typeof i.raws.before<"u"&&(h.raws.before=i.raws.before.replace(/\S/g,"")),h.parent=A.proxyOf,h});return d},t.prepend=function(){for(var r=arguments.length,i=new Array(r),A=0;A<r;A++)i[A]=arguments[A];i=i.reverse();for(var s=W(i),o;!(o=s()).done;){for(var a=o.value,c=this.normalize(a,this.first,"prepend").reverse(),u=W(c),l;!(l=u()).done;){var d=l.value;this.proxyOf.nodes.unshift(d)}for(var h in this.indexes)this.indexes[h]=this.indexes[h]+c.length}return this.markDirty(),this},t.push=function(r){return r.parent=this,this.proxyOf.nodes.push(r),this},t.removeAll=function(){for(var r=W(this.proxyOf.nodes),i;!(i=r()).done;){var A=i.value;A.parent=void 0}return this.proxyOf.nodes=[],this.markDirty(),this},t.removeChild=function(r){r=this.index(r),this.proxyOf.nodes[r].parent=void 0,this.proxyOf.nodes.splice(r,1);var i;for(var A in this.indexes)i=this.indexes[A],i>=r&&(this.indexes[A]=i-1);return this.markDirty(),this},t.replaceValues=function(r,i,A){return A||(A=i,i={}),this.walkDecls(function(s){i.props&&!i.props.includes(s.prop)||i.fast&&!s.value.includes(i.fast)||(s.value=s.value.replace(r,A))}),this.markDirty(),this},t.some=function(r){return this.nodes.some(r)},t.walk=function(r){return this.each(function(i,A){var s;try{s=r(i,A)}catch(o){throw i.addToError(o)}return s!==!1&&i.walk&&(s=i.walk(r)),s})},t.walkAtRules=function(r,i){return i?ee(r,RegExp)?this.walk(function(A,s){if(A.type==="atrule"&&r.test(A.name))return i(A,s)}):this.walk(function(A,s){if(A.type==="atrule"&&A.name===r)return i(A,s)}):(i=r,this.walk(function(A,s){if(A.type==="atrule")return i(A,s)}))},t.walkComments=function(r){return this.walk(function(i,A){if(i.type==="comment")return r(i,A)})},t.walkDecls=function(r,i){return i?ee(r,RegExp)?this.walk(function(A,s){if(A.type==="decl"&&r.test(A.prop))return i(A,s)}):this.walk(function(A,s){if(A.type==="decl"&&A.prop===r)return i(A,s)}):(i=r,this.walk(function(A,s){if(A.type==="decl")return i(A,s)}))},t.walkRules=function(r,i){return i?ee(r,RegExp)?this.walk(function(A,s){if(A.type==="rule"&&r.test(A.selector))return i(A,s)}):this.walk(function(A,s){if(A.type==="rule"&&A.selector===r)return i(A,s)}):(i=r,this.walk(function(A,s){if(A.type==="rule")return i(A,s)}))},wt(e,[{key:"first",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}},{key:"last",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}]),e}(w2);Gn.registerParse=function(n){gb=n},Gn.registerRule=function(n){Bh=n},Gn.registerAtRule=function(n){Ch=n},Gn.registerRoot=function(n){mb=n};var $r=Gn;Gn.default=Gn,Gn.rebuild=function(n){n.type==="atrule"?Object.setPrototypeOf(n,Ch.prototype):n.type==="rule"?Object.setPrototypeOf(n,Bh.prototype):n.type==="decl"?Object.setPrototypeOf(n,pb.prototype):n.type==="comment"?Object.setPrototypeOf(n,fb.prototype):n.type==="root"&&Object.setPrototypeOf(n,mb.prototype),n[hb]=!0,n.nodes&&n.nodes.forEach(function(e){Gn.rebuild(e)})};var b2=$r,wb,bb,os=function(n){St(e,n);function e(r){var i;return i=n.call(this,fe({type:"document"},r))||this,i.nodes||(i.nodes=[]),i}var t=e.prototype;return t.toResult=function(r){r===void 0&&(r={});var i=new wb(new bb,this,r);return i.stringify()},e}(b2);os.registerLazyResult=function(n){wb=n},os.registerProcessor=function(n){bb=n};var _h=os;os.default=os;var Bb={},Cb=function(n){Bb[n]||(Bb[n]=!0,typeof console<"u"&&console.warn&&console.warn(n))},Sh=function(){function n(t,r){if(r===void 0&&(r={}),this.type="warning",this.text=t,r.node&&r.node.source){var i=r.node.rangeBy(r);this.line=i.start.line,this.column=i.start.column,this.endLine=i.end.line,this.endColumn=i.end.column}for(var A in r)this[A]=r[A]}var e=n.prototype;return e.toString=function(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text},n}(),_b=Sh;Sh.default=Sh;var B2=_b,kh=function(){function n(t,r,i){this.processor=t,this.messages=[],this.root=r,this.opts=i,this.css=void 0,this.map=void 0}var e=n.prototype;return e.toString=function(){return this.css},e.warn=function(t,r){r===void 0&&(r={}),r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);var i=new B2(t,r);return this.messages.push(i),i},e.warnings=function(){return this.messages.filter(function(t){return t.type==="warning"})},wt(n,[{key:"content",get:function(){return this.css}}]),n}(),Eh=kh;kh.default=kh;var Uh="'".charCodeAt(0),Sb='"'.charCodeAt(0),rc="\\".charCodeAt(0),kb="/".charCodeAt(0),ic=`
113
+ `.charCodeAt(0),as=" ".charCodeAt(0),Ac="\f".charCodeAt(0),sc=" ".charCodeAt(0),oc="\r".charCodeAt(0),C2="[".charCodeAt(0),_2="]".charCodeAt(0),S2="(".charCodeAt(0),k2=")".charCodeAt(0),E2="{".charCodeAt(0),U2="}".charCodeAt(0),T2=";".charCodeAt(0),I2="*".charCodeAt(0),F2=":".charCodeAt(0),x2="@".charCodeAt(0),ac=/[\t\n\f\r "#'()/;[\\\]{}]/g,cc=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Q2=/.[\r\n"'(/\\]/,Eb=/[\da-f]/i,R2=function(n,e){e===void 0&&(e={});var t=n.css.valueOf(),r=e.ignoreErrors,i,A,s,o,a,c,u,l,d,h,f=t.length,p=0,g=[],v=[];function y(){return p}function b(k){throw n.error("Unclosed "+k,p)}function B(){return v.length===0&&p>=f}function w(k){if(v.length)return v.pop();if(!(p>=f)){var T=k?k.ignoreUnclosed:!1;switch(i=t.charCodeAt(p),i){case ic:case as:case sc:case oc:case Ac:{A=p;do A+=1,i=t.charCodeAt(A);while(i===as||i===ic||i===sc||i===oc||i===Ac);h=["space",t.slice(p,A)],p=A-1;break}case C2:case _2:case E2:case U2:case F2:case T2:case k2:{var I=String.fromCharCode(i);h=[I,I,p];break}case S2:{if(l=g.length?g.pop()[1]:"",d=t.charCodeAt(p+1),l==="url"&&d!==Uh&&d!==Sb&&d!==as&&d!==ic&&d!==sc&&d!==Ac&&d!==oc){A=p;do{if(c=!1,A=t.indexOf(")",A+1),A===-1)if(r||T){A=p;break}else b("bracket");for(u=A;t.charCodeAt(u-1)===rc;)u-=1,c=!c}while(c);h=["brackets",t.slice(p,A+1),p,A],p=A}else A=t.indexOf(")",p+1),o=t.slice(p,A+1),A===-1||Q2.test(o)?h=["(","(",p]:(h=["brackets",o,p,A],p=A);break}case Uh:case Sb:{s=i===Uh?"'":'"',A=p;do{if(c=!1,A=t.indexOf(s,A+1),A===-1)if(r||T){A=p+1;break}else b("string");for(u=A;t.charCodeAt(u-1)===rc;)u-=1,c=!c}while(c);h=["string",t.slice(p,A+1),p,A],p=A;break}case x2:{ac.lastIndex=p+1,ac.test(t),ac.lastIndex===0?A=t.length-1:A=ac.lastIndex-2,h=["at-word",t.slice(p,A+1),p,A],p=A;break}case rc:{for(A=p,a=!0;t.charCodeAt(A+1)===rc;)A+=1,a=!a;if(i=t.charCodeAt(A+1),a&&i!==kb&&i!==as&&i!==ic&&i!==sc&&i!==oc&&i!==Ac&&(A+=1,Eb.test(t.charAt(A)))){for(;Eb.test(t.charAt(A+1));)A+=1;t.charCodeAt(A+1)===as&&(A+=1)}h=["word",t.slice(p,A+1),p,A],p=A;break}default:{i===kb&&t.charCodeAt(p+1)===I2?(A=t.indexOf("*/",p+2)+1,A===0&&(r||T?A=t.length:b("comment")),h=["comment",t.slice(p,A+1),p,A],p=A):(cc.lastIndex=p+1,cc.test(t),cc.lastIndex===0?A=t.length-1:A=cc.lastIndex-2,h=["word",t.slice(p,A+1),p,A],g.push(h),p=A);break}}return p++,h}}function _(k){v.push(k)}return{back:_,endOfFile:B,nextToken:w,position:y}},Ub=$r,uc=function(n){St(e,n);function e(r){var i;return i=n.call(this,r)||this,i.type="atrule",i}var t=e.prototype;return t.append=function(){for(var r=arguments.length,i=new Array(r),A=0;A<r;A++)i[A]=arguments[A];var s;return this.proxyOf.nodes||(this.nodes=[]),(s=n.prototype.append).call.apply(s,[].concat([this],i))},t.prepend=function(){for(var r=arguments.length,i=new Array(r),A=0;A<r;A++)i[A]=arguments[A];var s;return this.proxyOf.nodes||(this.nodes=[]),(s=n.prototype.prepend).call.apply(s,[].concat([this],i))},e}(Ub),Th=uc;uc.default=uc,Ub.registerAtRule(uc);var Tb=$r,Ib,Fb,Wi=function(n){St(e,n);function e(r){var i;return i=n.call(this,r)||this,i.type="root",i.nodes||(i.nodes=[]),i}var t=e.prototype;return t.normalize=function(r,i,A){var s=n.prototype.normalize.call(this,r);if(i){if(A==="prepend")this.nodes.length>1?i.raws.before=this.nodes[1].raws.before:delete i.raws.before;else if(this.first!==i)for(var o=W(s),a;!(a=o()).done;){var c=a.value;c.raws.before=i.raws.before}}return s},t.removeChild=function(r,i){var A=this.index(r);return!i&&A===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[A].raws.before),n.prototype.removeChild.call(this,r)},t.toResult=function(r){r===void 0&&(r={});var i=new Ib(new Fb,this,r);return i.stringify()},e}(Tb);Wi.registerLazyResult=function(n){Ib=n},Wi.registerProcessor=function(n){Fb=n};var cs=Wi;Wi.default=Wi,Tb.registerRoot(Wi);var us={comma:function(n){return us.split(n,[","],!0)},space:function(n){var e=[" ",`
114
+ `," "];return us.split(n,e)},split:function(n,e,t){for(var r=[],i="",A=!1,s=0,o=!1,a="",c=!1,u=W(n),l;!(l=u()).done;){var d=l.value;c?c=!1:d==="\\"?c=!0:o?d===a&&(o=!1):d==='"'||d==="'"?(o=!0,a=d):d==="("?s+=1:d===")"?s>0&&(s-=1):s===0&&e.includes(d)&&(A=!0),A?(i!==""&&r.push(i.trim()),i="",A=!1):i+=d}return(t||i!=="")&&r.push(i.trim()),r}},xb=us;us.default=us;var Qb=$r,P2=xb,lc=function(n){St(e,n);function e(t){var r;return r=n.call(this,t)||this,r.type="rule",r.nodes||(r.nodes=[]),r}return wt(e,[{key:"selectors",get:function(){return P2.comma(this.selector)},set:function(t){var r=this.selector?this.selector.match(/,\s*/):null,i=r?r[0]:","+this.raw("between","beforeOpen");this.selector=t.join(i)}}]),e}(Qb),Ih=lc;lc.default=lc,Qb.registerRule(lc);var O2=Xa,M2=R2,L2=nc,D2=Th,H2=cs,Rb=Ih,Pb={empty:!0,space:!0};function N2(n){for(var e=n.length-1;e>=0;e--){var t=n[e],r=t[3]||t[2];if(r)return r}}var K2=function(){function n(t){this.input=t,this.root=new H2,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}var e=n.prototype;return e.atrule=function(t){var r=new D2;r.name=t[1].slice(1),r.name===""&&this.unnamedAtrule(r,t),this.init(r,t[2]);for(var i,A,s,o=!1,a=!1,c=[],u=[];!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),i=t[0],i==="("||i==="["?u.push(i==="("?")":"]"):i==="{"&&u.length>0?u.push("}"):i===u[u.length-1]&&u.pop(),u.length===0)if(i===";"){r.source.end=this.getPosition(t[2]),r.source.end.offset++,this.semicolon=!0;break}else if(i==="{"){a=!0;break}else if(i==="}"){if(c.length>0){for(s=c.length-1,A=c[s];A&&A[0]==="space";)A=c[--s];A&&(r.source.end=this.getPosition(A[3]||A[2]),r.source.end.offset++)}this.end(t);break}else c.push(t);else c.push(t);if(this.tokenizer.endOfFile()){o=!0;break}}r.raws.between=this.spacesAndCommentsFromEnd(c),c.length?(r.raws.afterName=this.spacesAndCommentsFromStart(c),this.raw(r,"params",c),o&&(t=c[c.length-1],r.source.end=this.getPosition(t[3]||t[2]),r.source.end.offset++,this.spaces=r.raws.between,r.raws.between="")):(r.raws.afterName="",r.params=""),a&&(r.nodes=[],this.current=r)},e.checkMissedSemicolon=function(t){var r=this.colon(t);if(r!==!1){for(var i=0,A,s=r-1;s>=0&&(A=t[s],!(A[0]!=="space"&&(i+=1,i===2)));s--);throw this.input.error("Missed semicolon",A[0]==="word"?A[3]+1:A[2])}},e.colon=function(t){for(var r=0,i,A,s,o=W(t.entries()),a;!(a=o()).done;){var c=a.value,u=c[0],l=c[1];if(i=l,A=i[0],A==="("&&(r+=1),A===")"&&(r-=1),r===0&&A===":")if(!s)this.doubleColon(i);else{if(s[0]==="word"&&s[1]==="progid")continue;return u}s=i}return!1},e.comment=function(t){var r=new L2;this.init(r,t[2]),r.source.end=this.getPosition(t[3]||t[2]),r.source.end.offset++;var i=t[1].slice(2,-2);if(/^\s*$/.test(i))r.text="",r.raws.left=i,r.raws.right="";else{var A=i.match(/^(\s*)([^]*\S)(\s*)$/);r.text=A[2],r.raws.left=A[1],r.raws.right=A[3]}},e.createTokenizer=function(){this.tokenizer=M2(this.input)},e.decl=function(t,r){var i=new O2;this.init(i,t[0][2]);var A=t[t.length-1];for(A[0]===";"&&(this.semicolon=!0,t.pop()),i.source.end=this.getPosition(A[3]||A[2]||N2(t)),i.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),i.raws.before+=t.shift()[1];for(i.source.start=this.getPosition(t[0][2]),i.prop="";t.length;){var s=t[0][0];if(s===":"||s==="space"||s==="comment")break;i.prop+=t.shift()[1]}i.raws.between="";for(var o;t.length;)if(o=t.shift(),o[0]===":"){i.raws.between+=o[1];break}else o[0]==="word"&&/\w/.test(o[1])&&this.unknownWord([o]),i.raws.between+=o[1];(i.prop[0]==="_"||i.prop[0]==="*")&&(i.raws.before+=i.prop[0],i.prop=i.prop.slice(1));for(var a=[],c;t.length&&(c=t[0][0],!(c!=="space"&&c!=="comment"));)a.push(t.shift());this.precheckMissedSemicolon(t);for(var u=t.length-1;u>=0;u--){if(o=t[u],o[1].toLowerCase()==="!important"){i.important=!0;var l=this.stringFrom(t,u);l=this.spacesFromEnd(t)+l,l!==" !important"&&(i.raws.important=l);break}else if(o[1].toLowerCase()==="important"){for(var d=t.slice(0),h="",f=u;f>0;f--){var p=d[f][0];if(h.trim().indexOf("!")===0&&p!=="space")break;h=d.pop()[1]+h}h.trim().indexOf("!")===0&&(i.important=!0,i.raws.important=h,t=d)}if(o[0]!=="space"&&o[0]!=="comment")break}var g=t.some(function(v){return v[0]!=="space"&&v[0]!=="comment"});g&&(i.raws.between+=a.map(function(v){return v[1]}).join(""),a=[]),this.raw(i,"value",a.concat(t),r),i.value.includes(":")&&!r&&this.checkMissedSemicolon(t)},e.doubleColon=function(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})},e.emptyRule=function(t){var r=new Rb;this.init(r,t[2]),r.selector="",r.raws.between="",this.current=r},e.end=function(t){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)},e.endFile=function(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())},e.freeSemicolon=function(t){if(this.spaces+=t[1],this.current.nodes){var r=this.current.nodes[this.current.nodes.length-1];r&&r.type==="rule"&&!r.raws.ownSemicolon&&(r.raws.ownSemicolon=this.spaces,this.spaces="")}},e.getPosition=function(t){var r=this.input.fromOffset(t);return{column:r.col,line:r.line,offset:t}},e.init=function(t,r){this.current.push(t),t.source={input:this.input,start:this.getPosition(r)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)},e.other=function(t){for(var r=!1,i=null,A=!1,s=null,o=[],a=t[1].startsWith("--"),c=[],u=t;u;){if(i=u[0],c.push(u),i==="("||i==="[")s||(s=u),o.push(i==="("?")":"]");else if(a&&A&&i==="{")s||(s=u),o.push("}");else if(o.length===0)if(i===";")if(A){this.decl(c,a);return}else break;else if(i==="{"){this.rule(c);return}else if(i==="}"){this.tokenizer.back(c.pop()),r=!0;break}else i===":"&&(A=!0);else i===o[o.length-1]&&(o.pop(),o.length===0&&(s=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(r=!0),o.length>0&&this.unclosedBracket(s),r&&A){if(!a)for(;c.length&&(u=c[c.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(c.pop());this.decl(c,a)}else this.unknownWord(c)},e.parse=function(){for(var t;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t);break}this.endFile()},e.precheckMissedSemicolon=function(){},e.raw=function(t,r,i,A){for(var s,o,a=i.length,c="",u=!0,l,d,h=0;h<a;h+=1)s=i[h],o=s[0],o==="space"&&h===a-1&&!A?u=!1:o==="comment"?(d=i[h-1]?i[h-1][0]:"empty",l=i[h+1]?i[h+1][0]:"empty",!Pb[d]&&!Pb[l]?c.slice(-1)===","?u=!1:c+=s[1]:u=!1):c+=s[1];if(!u){var f=i.reduce(function(p,g){return p+g[1]},"");t.raws[r]={raw:f,value:c}}t[r]=c},e.rule=function(t){t.pop();var r=new Rb;this.init(r,t[0][2]),r.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(r,"selector",t),this.current=r},e.spacesAndCommentsFromEnd=function(t){for(var r,i="";t.length&&(r=t[t.length-1][0],!(r!=="space"&&r!=="comment"));)i=t.pop()[1]+i;return i},e.spacesAndCommentsFromStart=function(t){for(var r,i="";t.length&&(r=t[0][0],!(r!=="space"&&r!=="comment"));)i+=t.shift()[1];return i},e.spacesFromEnd=function(t){for(var r,i="";t.length&&(r=t[t.length-1][0],r==="space");)i=t.pop()[1]+i;return i},e.stringFrom=function(t,r){for(var i="",A=r;A<t.length;A++)i+=t[A][1];return t.splice(r,t.length-r),i},e.unclosedBlock=function(){var t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)},e.unclosedBracket=function(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})},e.unexpectedClose=function(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})},e.unknownWord=function(t){throw this.input.error("Unknown word",{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})},e.unnamedAtrule=function(t,r){throw this.input.error("At-rule without name",{offset:r[2]},{offset:r[2]+r[1].length})},n}(),V2=K2,G2=$r,j2=V2,W2=$a;function dc(n,e){var t=new W2(n,e),r=new j2(t);try{r.parse()}catch(i){throw process.env.NODE_ENV!=="production"&&i.name==="CssSyntaxError"&&e&&e.from&&(/\.scss$/i.test(e.from)?i.message+=`
115
+ You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(e.from)?i.message+=`
116
+ You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(e.from)&&(i.message+=`
117
+ You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return r.root}var Fh=dc;dc.default=dc,G2.registerParse(dc);var Un=br.isClean,q2=br.my,J2=lb,z2=qa,X2=$r,Y2=_h,Z2=Cb,Ob=Eh,$2=Fh,eM=cs,tM={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},nM={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},rM={Once:!0,postcssPlugin:!0,prepare:!0},qi=0;function ls(n){return(typeof n>"u"?"undefined":Ae(n))==="object"&&typeof n.then=="function"}function Mb(n){var e=!1,t=tM[n.type];return n.type==="decl"?e=n.prop.toLowerCase():n.type==="atrule"&&(e=n.name.toLowerCase()),e&&n.append?[t,t+"-"+e,qi,t+"Exit",t+"Exit-"+e]:e?[t,t+"-"+e,t+"Exit",t+"Exit-"+e]:n.append?[t,qi,t+"Exit"]:[t,t+"Exit"]}function Lb(n){var e;return n.type==="document"?e=["Document",qi,"DocumentExit"]:n.type==="root"?e=["Root",qi,"RootExit"]:e=Mb(n),{eventIndex:0,events:e,iterator:0,node:n,visitorIndex:0,visitors:[]}}function xh(n){return n[Un]=!1,n.nodes&&n.nodes.forEach(function(e){return xh(e)}),n}var Qh={},Ji=function(){function n(t,r,i){var A=this;this.stringified=!1,this.processed=!1;var s;if((typeof r>"u"?"undefined":Ae(r))==="object"&&r!==null&&(r.type==="root"||r.type==="document"))s=xh(r);else if(ee(r,n)||ee(r,Ob))s=xh(r.root),r.map&&(typeof i.map>"u"&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=r.map);else{var o=$2;i.syntax&&(o=i.syntax.parse),i.parser&&(o=i.parser),o.parse&&(o=o.parse);try{s=o(r,i)}catch(a){this.processed=!0,this.error=a}s&&!s[q2]&&X2.rebuild(s)}this.result=new Ob(t,s,i),this.helpers=fe({},Qh,{postcss:Qh,result:this.result}),this.plugins=this.processor.plugins.map(function(a){return(typeof a>"u"?"undefined":Ae(a))==="object"&&a.prepare?fe({},a,a.prepare(A.result)):a})}var e=n.prototype;return e.async=function(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)},e.catch=function(t){return this.async().catch(t)},e.finally=function(t){return this.async().then(t,t)},e.getAsyncError=function(){throw new Error("Use process(css).then(cb) to work with async plugins")},e.handleError=function(t,r){var i=this.result.lastPlugin;try{if(r&&r.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin)t.plugin=i.postcssPlugin,t.setMessage();else if(i.postcssVersion&&process.env.NODE_ENV!=="production"){var A=i.postcssPlugin,s=i.postcssVersion,o=this.result.processor.version,a=s.split("."),c=o.split(".");(a[0]!==c[0]||parseInt(a[1])>parseInt(c[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+o+", but "+A+" uses "+s+". Perhaps this is the source of the error below.")}}catch(u){console&&console.error&&console.error(u)}return t},e.prepareVisitors=function(){var t=this;this.listeners={};for(var r=function(c,u,l){t.listeners[u]||(t.listeners[u]=[]),t.listeners[u].push([c,l])},i=W(this.plugins),A;!(A=i()).done;){var s=A.value;if((typeof s>"u"?"undefined":Ae(s))==="object")for(var o in s){if(!nM[o]&&/^[A-Z]/.test(o))throw new Error("Unknown event "+o+" in "+s.postcssPlugin+". Try to update PostCSS ("+this.processor.version+" now).");if(!rM[o])if(Ae(s[o])==="object")for(var a in s[o])a==="*"?r(s,o,s[o][a]):r(s,o+"-"+a.toLowerCase(),s[o][a]);else typeof s[o]=="function"&&r(s,o,s[o])}}this.hasListener=Object.keys(this.listeners).length>0},e.runAsync=function(){var t=this;return Bd(function(){var r,i,A,s,o,a,c,u,l,d,h,f;return XA(this,function(p){switch(p.label){case 0:t.plugin=0,r=0,p.label=1;case 1:if(!(r<t.plugins.length))return[3,6];if(i=t.plugins[r],A=t.runOnRoot(i),!ls(A))return[3,5];p.label=2;case 2:return p.trys.push([2,4,,5]),[4,A];case 3:return p.sent(),[3,5];case 4:throw s=p.sent(),t.handleError(s);case 5:return r++,[3,1];case 6:if(t.prepareVisitors(),!t.hasListener)return[3,18];o=t.result.root,p.label=7;case 7:if(o[Un])return[3,14];o[Un]=!0,a=[Lb(o)],p.label=8;case 8:if(!(a.length>0))return[3,13];if(c=t.visitTick(a),!ls(c))return[3,12];p.label=9;case 9:return p.trys.push([9,11,,12]),[4,c];case 10:return p.sent(),[3,12];case 11:throw u=p.sent(),l=a[a.length-1].node,t.handleError(u,l);case 12:return[3,8];case 13:return[3,7];case 14:if(!t.listeners.OnceExit)return[3,18];d=function(){var g,v,y,b,B;return XA(this,function(w){switch(w.label){case 0:g=f.value,v=g[0],y=g[1],t.result.lastPlugin=v,w.label=1;case 1:return w.trys.push([1,6,,7]),o.type!=="document"?[3,3]:(b=o.nodes.map(function(_){return y(_,t.helpers)}),[4,Promise.all(b)]);case 2:return w.sent(),[3,5];case 3:return[4,y(o,t.helpers)];case 4:w.sent(),w.label=5;case 5:return[3,7];case 6:throw B=w.sent(),t.handleError(B);case 7:return[2]}})},h=W(t.listeners.OnceExit),p.label=15;case 15:return(f=h()).done?[3,18]:[5,Py(d())];case 16:p.sent(),p.label=17;case 17:return[3,15];case 18:return t.processed=!0,[2,t.stringify()]}})})()},e.runOnRoot=function(t){var r=this;this.result.lastPlugin=t;try{if((typeof t>"u"?"undefined":Ae(t))==="object"&&t.Once){if(this.result.root.type==="document"){var i=this.result.root.nodes.map(function(A){return t.Once(A,r.helpers)});return ls(i[0])?Promise.all(i):i}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(A){throw this.handleError(A)}},e.stringify=function(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();var t=this.result.opts,r=z2;t.syntax&&(r=t.syntax.stringify),t.stringifier&&(r=t.stringifier),r.stringify&&(r=r.stringify);var i=new J2(r,this.result.root,this.result.opts),A=i.generate();return this.result.css=A[0],this.result.map=A[1],this.result},e.sync=function(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(var t=W(this.plugins),r;!(r=t()).done;){var i=r.value,A=this.runOnRoot(i);if(ls(A))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){for(var s=this.result.root;!s[Un];)s[Un]=!0,this.walkSync(s);if(this.listeners.OnceExit)if(s.type==="document")for(var o=W(s.nodes),a;!(a=o()).done;){var c=a.value;this.visitSync(this.listeners.OnceExit,c)}else this.visitSync(this.listeners.OnceExit,s)}return this.result},e.then=function(t,r){return process.env.NODE_ENV!=="production"&&("from"in this.opts||Z2("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,r)},e.toString=function(){return this.css},e.visitSync=function(t,r){for(var i=W(t),A;!(A=i()).done;){var s=A.value,o=s[0],a=s[1];this.result.lastPlugin=o;var c=void 0;try{c=a(r,this.helpers)}catch(u){throw this.handleError(u,r.proxyOf)}if(r.type!=="root"&&r.type!=="document"&&!r.parent)return!0;if(ls(c))throw this.getAsyncError()}},e.visitTick=function(t){var r=t[t.length-1],i=r.node,A=r.visitors;if(i.type!=="root"&&i.type!=="document"&&!i.parent){t.pop();return}if(A.length>0&&r.visitorIndex<A.length){var s=A[r.visitorIndex],o=s[0],a=s[1];r.visitorIndex+=1,r.visitorIndex===A.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=o;try{return a(i.toProxy(),this.helpers)}catch(h){throw this.handleError(h,i)}}if(r.iterator!==0){for(var c=r.iterator,u;u=i.nodes[i.indexes[c]];)if(i.indexes[c]+=1,!u[Un]){u[Un]=!0,t.push(Lb(u));return}r.iterator=0,delete i.indexes[c]}for(var l=r.events;r.eventIndex<l.length;){var d=l[r.eventIndex];if(r.eventIndex+=1,d===qi){i.nodes&&i.nodes.length&&(i[Un]=!0,r.iterator=i.getIterator());return}else if(this.listeners[d]){r.visitors=this.listeners[d];return}}t.pop()},e.walkSync=function(t){var r=this;t[Un]=!0;for(var i=Mb(t),A=W(i),s;!(s=A()).done;){var o=s.value;if(o===qi)t.nodes&&t.each(function(c){c[Un]||r.walkSync(c)});else{var a=this.listeners[o];if(a&&this.visitSync(a,t.toProxy()))return}}},e.warnings=function(){return this.sync().warnings()},wt(n,[{key:"content",get:function(){return this.stringify().content}},{key:"css",get:function(){return this.stringify().css}},{key:"map",get:function(){return this.stringify().map}},{key:"messages",get:function(){return this.sync().messages}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){return this.sync().root}},{key:Symbol.toStringTag,get:function(){return"LazyResult"}}]),n}();Ji.registerPostcss=function(n){Qh=n};var Db=Ji;Ji.default=Ji,eM.registerLazyResult(Ji),Y2.registerLazyResult(Ji);var iM=lb,AM=qa,sM=Cb,oM=Fh,aM=Eh,Rh=function(){function n(t,r,i){r=r.toString(),this.stringified=!1,this._processor=t,this._css=r,this._opts=i,this._map=void 0;var A,s=AM;this.result=new aM(this._processor,A,this._opts),this.result.css=r;var o=this;Object.defineProperty(this.result,"root",{get:function(){return o.root}});var a=new iM(s,A,this._opts,r);if(a.isMap()){var c=a.generate(),u=c[0],l=c[1];u&&(this.result.css=u),l&&(this.result.map=l)}else a.clearAnnotation(),this.result.css=a.css}var e=n.prototype;return e.async=function(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)},e.catch=function(t){return this.async().catch(t)},e.finally=function(t){return this.async().then(t,t)},e.sync=function(){if(this.error)throw this.error;return this.result},e.then=function(t,r){return process.env.NODE_ENV!=="production"&&("from"in this._opts||sM("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(t,r)},e.toString=function(){return this._css},e.warnings=function(){return[]},wt(n,[{key:"content",get:function(){return this.result.css}},{key:"css",get:function(){return this.result.css}},{key:"map",get:function(){return this.result.map}},{key:"messages",get:function(){return[]}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){if(this._root)return this._root;var t,r=oM;try{t=r(this._css,this._opts)}catch(i){this.error=i}if(this.error)throw this.error;return this._root=t,t}},{key:Symbol.toStringTag,get:function(){return"NoWorkResult"}}]),n}(),cM=Rh;Rh.default=Rh;var uM=cM,lM=Db,dM=_h,hM=cs,ds=function(){function n(t){t===void 0&&(t=[]),this.version="8.4.38",this.plugins=this.normalize(t)}var e=n.prototype;return e.normalize=function(t){for(var r=[],i=W(t),A;!(A=i()).done;){var s=A.value;if(s.postcss===!0?s=s():s.postcss&&(s=s.postcss),(typeof s>"u"?"undefined":Ae(s))==="object"&&Array.isArray(s.plugins))r=r.concat(s.plugins);else if((typeof s>"u"?"undefined":Ae(s))==="object"&&s.postcssPlugin)r.push(s);else if(typeof s=="function")r.push(s);else if((typeof s>"u"?"undefined":Ae(s))==="object"&&(s.parse||s.stringify)){if(process.env.NODE_ENV!=="production")throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}else throw new Error(s+" is not a PostCSS plugin")}return r},e.process=function(t,r){return r===void 0&&(r={}),!this.plugins.length&&!r.parser&&!r.stringifier&&!r.syntax?new uM(this,t,r):new lM(this,t,r)},e.use=function(t){return this.plugins=this.plugins.concat(this.normalize([t])),this},n}(),pM=ds;ds.default=ds,hM.registerProcessor(ds),dM.registerProcessor(ds);var fM=Xa,gM=nb,mM=nc,vM=Th,yM=$a,wM=cs,bM=Ih;function hs(n,e){if(Array.isArray(n))return n.map(function(l){return hs(l)});var t=n.inputs,r=JA(n,["inputs"]);if(t){e=[];for(var i=W(t),A;!(A=i()).done;){var s=A.value,o=fe({},s,{__proto__:yM.prototype});o.map&&(o.map=fe({},o.map,{__proto__:gM.prototype})),e.push(o)}}if(r.nodes&&(r.nodes=n.nodes.map(function(l){return hs(l,e)})),r.source){var a=r.source,c=a.inputId,u=JA(a,["inputId"]);r.source=u,c!=null&&(r.source.input=e[c])}if(r.type==="root")return new wM(r);if(r.type==="decl")return new fM(r);if(r.type==="rule")return new bM(r);if(r.type==="comment")return new mM(r);if(r.type==="atrule")return new vM(r);throw new Error("Unknown node type: "+n.type)}var BM=hs;hs.default=hs;var CM=ch,Hb=Xa,_M=Db,SM=$r,Ph=pM,kM=qa,EM=BM,Nb=_h,UM=_b,Kb=nc,Vb=Th,TM=Eh,IM=$a,FM=Fh,xM=xb,Gb=Ih,jb=cs,QM=za;function Ee(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new Ph(e)}Ee.plugin=function(n,e){var t=!1;function r(){for(var A=arguments.length,s=new Array(A),o=0;o<A;o++)s[o]=arguments[o];console&&console.warn&&!t&&(t=!0,console.warn(n+`: postcss.plugin was deprecated. Migration guide:
118
+ https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(n+`: 里面 postcss.plugin 被弃用. 迁移指南:
119
+ https://www.w3ctech.com/topic/2226`));var a=e.apply(void 0,[].concat(s));return a.postcssPlugin=n,a.postcssVersion=new Ph().version,a}var i;return Object.defineProperty(r,"postcss",{get:function(){return i||(i=r()),i}}),r.process=function(A,s,o){return Ee([r(o)]).process(A,s)},r},Ee.stringify=kM,Ee.parse=FM,Ee.fromJSON=EM,Ee.list=xM,Ee.comment=function(n){return new Kb(n)},Ee.atRule=function(n){return new Vb(n)},Ee.decl=function(n){return new Hb(n)},Ee.rule=function(n){return new Gb(n)},Ee.root=function(n){return new jb(n)},Ee.document=function(n){return new Nb(n)},Ee.CssSyntaxError=CM,Ee.Declaration=Hb,Ee.Container=SM,Ee.Processor=Ph,Ee.Document=Nb,Ee.Comment=Kb,Ee.Warning=UM,Ee.AtRule=Vb,Ee.Result=TM,Ee.Input=IM,Ee.Rule=Gb,Ee.Root=jb,Ee.Node=QM,_M.registerPostcss(Ee);var RM=Ee;Ee.default=Ee;var Ge=jO(RM);Ge.stringify,Ge.fromJSON,Ge.plugin,Ge.parse,Ge.list,Ge.document,Ge.comment,Ge.atRule,Ge.rule,Ge.decl,Ge.root,Ge.CssSyntaxError,Ge.Declaration,Ge.Container,Ge.Processor,Ge.Document,Ge.Comment,Ge.Warning,Ge.AtRule,Ge.Result,Ge.Input,Ge.Rule,Ge.Root,Ge.Node;var PM=function(){function n(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];Yt(this,"parentElement",null),Yt(this,"parentNode",null),Yt(this,"ownerDocument"),Yt(this,"firstChild",null),Yt(this,"lastChild",null),Yt(this,"previousSibling",null),Yt(this,"nextSibling",null),Yt(this,"ELEMENT_NODE",1),Yt(this,"TEXT_NODE",3),Yt(this,"nodeType"),Yt(this,"nodeName"),Yt(this,"RRNodeType")}var e=n.prototype;return e.contains=function(t){if(ee(t,n)){if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0}else return!1;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1},e.appendChild=function(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")},e.insertBefore=function(t,r){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")},e.removeChild=function(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")},e.toString=function(){return"RRNode"},wt(n,[{key:"childNodes",get:function(){for(var t=[],r=this.firstChild;r;)t.push(r),r=r.nextSibling;return t}}]),n}(),Wb={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},qb={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},hc={},OM=function(){return!!globalThis.Zone};function Oh(n){if(hc[n])return hc[n];var e=globalThis[n],t=e.prototype,r=n in Wb?Wb[n]:void 0,i=!!(r&&r.every(function(u){var l,d;return!!((d=(l=Object.getOwnPropertyDescriptor(t,u))==null?void 0:l.get)!=null&&d.toString().includes("[native code]"))})),A=n in qb?qb[n]:void 0,s=!!(A&&A.every(function(u){var l;return typeof t[u]=="function"&&((l=t[u])==null?void 0:l.toString().includes("[native code]"))}));if(i&&s&&!OM())return hc[n]=e.prototype,e.prototype;try{var o=document.createElement("iframe");document.body.appendChild(o);var a=o.contentWindow;if(!a)return e.prototype;var c=a[n].prototype;return document.body.removeChild(o),c?hc[n]=c:t}catch{return t}}var Mh={};function Br(n,e,t){var r,i=n+"."+String(t);if(Mh[i])return Mh[i].call(e);var A=Oh(n),s=(r=Object.getOwnPropertyDescriptor(A,t))==null?void 0:r.get;return s?(Mh[i]=s,s.call(e)):e[t]}var Lh={};function Jb(n,e,t){var r=n+"."+String(t);if(Lh[r])return Lh[r].bind(e);var i=Oh(n),A=i[t];return typeof A!="function"?e[t]:(Lh[r]=A,A.bind(e))}function MM(n){return Br("Node",n,"childNodes")}function LM(n){return Br("Node",n,"parentNode")}function DM(n){return Br("Node",n,"parentElement")}function HM(n){return Br("Node",n,"textContent")}function NM(n,e){return Jb("Node",n,"contains")(e)}function KM(n){return Jb("Node",n,"getRootNode")()}function VM(n){return!n||!("host"in n)?null:Br("ShadowRoot",n,"host")}function GM(n){return n.styleSheets}function jM(n){return!n||!("shadowRoot"in n)?null:Br("Element",n,"shadowRoot")}function WM(n,e){return Br("Element",n,"querySelector")(e)}function qM(n,e){return Br("Element",n,"querySelectorAll")(e)}function zb(){return Oh("MutationObserver").constructor}var se={childNodes:MM,parentNode:LM,parentElement:DM,textContent:HM,contains:NM,getRootNode:KM,host:VM,styleSheets:GM,shadowRoot:jM,querySelector:WM,querySelectorAll:qM,mutationObserver:zb};function Tt(n,e,t){t===void 0&&(t=document);var r={capture:!0,passive:!0};return t.addEventListener(n,e,r),function(){return t.removeEventListener(n,e,r)}}var zi=`Please stop import mirror directly. Instead of that,\r
120
+ now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
121
+ or you can use record.mirror to access the mirror instance during recording.`,Xb={map:{},getId:function(){return console.error(zi),-1},getNode:function(){return console.error(zi),null},removeNodeFromMap:function(){console.error(zi)},has:function(){return console.error(zi),!1},reset:function(){console.error(zi)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Xb=new Proxy(Xb,{get:function(n,e,t){return e==="map"&&console.error(zi),Reflect.get(n,e,t)}}));function ps(n,e,t){t===void 0&&(t={});var r=null,i=0;return function(){for(var A=arguments.length,s=new Array(A),o=0;o<A;o++)s[o]=arguments[o];var a=Date.now();!i&&t.leading===!1&&(i=a);var c=e-(a-i),u=this;c<=0||c>e?(r&&(clearTimeout(r),r=null),i=a,n.apply(u,s)):!r&&t.trailing!==!1&&(r=setTimeout(function(){i=t.leading===!1?0:Date.now(),r=null,n.apply(u,s)},c))}}function pc(n,e,t,r,i){i===void 0&&(i=window);var A=i.Object.getOwnPropertyDescriptor(n,e);return i.Object.defineProperty(n,e,r?t:{set:function(s){var o=this;setTimeout(function(){t.set.call(o,s)},0),A&&A.set&&A.set.call(this,s)}}),function(){return pc(n,e,A||{},!0)}}function Xi(n,e,t){try{if(!(e in n))return function(){};var r=n[e],i=t(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),n[e]=i,function(){n[e]=r}}catch{return function(){}}}var fc=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(fc=function(){return new Date().getTime()});function Yb(n){var e,t,r,i,A=n.document;return{left:A.scrollingElement?A.scrollingElement.scrollLeft:n.pageXOffset!==void 0?n.pageXOffset:A.documentElement.scrollLeft||(A==null?void 0:A.body)&&((e=se.parentElement(A.body))==null?void 0:e.scrollLeft)||((t=A==null?void 0:A.body)==null?void 0:t.scrollLeft)||0,top:A.scrollingElement?A.scrollingElement.scrollTop:n.pageYOffset!==void 0?n.pageYOffset:(A==null?void 0:A.documentElement.scrollTop)||(A==null?void 0:A.body)&&((r=se.parentElement(A.body))==null?void 0:r.scrollTop)||((i=A==null?void 0:A.body)==null?void 0:i.scrollTop)||0}}function Zb(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function $b(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function eB(n){if(!n)return null;var e=n.nodeType===n.ELEMENT_NODE?n:se.parentElement(n);return e}function It(n,e,t,r){if(!n)return!1;var i=eB(n);if(!i)return!1;try{if(typeof e=="string"){if(i.classList.contains(e)||r&&i.closest("."+e)!==null)return!0}else if(ka(i,e,r))return!0}catch{}return!!(t&&(i.matches(t)||r&&i.closest(t)!==null))}function JM(n,e){return e.getId(n)!==-1}function Dh(n,e,t){return n.tagName==="TITLE"&&t.headTitleMutations?!0:e.getId(n)===$A}function tB(n,e){if(YA(n))return!1;var t=e.getId(n);if(!e.has(t))return!0;var r=se.parentNode(n);return r&&r.nodeType===n.DOCUMENT_NODE?!1:r?tB(r,e):!0}function Hh(n){return!!n.changedTouches}function zM(n){n===void 0&&(n=window),"NodeList"in n&&!n.NodeList.prototype.forEach&&(n.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in n&&!n.DOMTokenList.prototype.forEach&&(n.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function nB(n,e){return!!(n.nodeName==="IFRAME"&&e.getMeta(n))}function rB(n,e){return!!(n.nodeName==="LINK"&&n.nodeType===n.ELEMENT_NODE&&n.getAttribute&&n.getAttribute("rel")==="stylesheet"&&e.getMeta(n))}function Nh(n){return n?ee(n,PM)&&"shadowRoot"in n?!!n.shadowRoot:!!se.shadowRoot(n):!1}var XM=function(){function n(){H(this,"id",1),H(this,"styleIDMap",new WeakMap),H(this,"idStyleMap",new Map)}var e=n.prototype;return e.getId=function(t){var r;return(r=this.styleIDMap.get(t))!=null?r:-1},e.has=function(t){return this.styleIDMap.has(t)},e.add=function(t,r){if(this.has(t))return this.getId(t);var i;return r===void 0?i=this.id++:i=r,this.styleIDMap.set(t,i),this.idStyleMap.set(i,t),i},e.getStyle=function(t){return this.idStyleMap.get(t)||null},e.reset=function(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1},e.generateId=function(){return this.id++},n}();function iB(n){var e,t=null;return"getRootNode"in n&&((e=se.getRootNode(n))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&se.host(se.getRootNode(n))&&(t=se.host(se.getRootNode(n))),t}function YM(n){for(var e=n,t;t=iB(e);)e=t;return e}function ZM(n){var e=n.ownerDocument;if(!e)return!1;var t=YM(n);return se.contains(e,t)}function AB(n){var e=n.ownerDocument;return e?se.contains(e,n)||ZM(n):!1}var ue=function(n){return n[n.DomContentLoaded=0]="DomContentLoaded",n[n.Load=1]="Load",n[n.FullSnapshot=2]="FullSnapshot",n[n.IncrementalSnapshot=3]="IncrementalSnapshot",n[n.Meta=4]="Meta",n[n.Custom=5]="Custom",n[n.Plugin=6]="Plugin",n}(ue||{}),z=function(n){return n[n.Mutation=0]="Mutation",n[n.MouseMove=1]="MouseMove",n[n.MouseInteraction=2]="MouseInteraction",n[n.Scroll=3]="Scroll",n[n.ViewportResize=4]="ViewportResize",n[n.Input=5]="Input",n[n.TouchMove=6]="TouchMove",n[n.MediaInteraction=7]="MediaInteraction",n[n.StyleSheetRule=8]="StyleSheetRule",n[n.CanvasMutation=9]="CanvasMutation",n[n.Font=10]="Font",n[n.Log=11]="Log",n[n.Drag=12]="Drag",n[n.StyleDeclaration=13]="StyleDeclaration",n[n.Selection=14]="Selection",n[n.AdoptedStyleSheet=15]="AdoptedStyleSheet",n[n.CustomElement=16]="CustomElement",n}(z||{}),Vt=function(n){return n[n.MouseUp=0]="MouseUp",n[n.MouseDown=1]="MouseDown",n[n.Click=2]="Click",n[n.ContextMenu=3]="ContextMenu",n[n.DblClick=4]="DblClick",n[n.Focus=5]="Focus",n[n.Blur=6]="Blur",n[n.TouchStart=7]="TouchStart",n[n.TouchMove_Departed=8]="TouchMove_Departed",n[n.TouchEnd=9]="TouchEnd",n[n.TouchCancel=10]="TouchCancel",n}(Vt||{}),jn=function(n){return n[n.Mouse=0]="Mouse",n[n.Pen=1]="Pen",n[n.Touch=2]="Touch",n}(jn||{}),Yi=function(n){return n[n["2D"]=0]="2D",n[n.WebGL=1]="WebGL",n[n.WebGL2=2]="WebGL2",n}(Yi||{}),Zi=function(n){return n[n.Play=0]="Play",n[n.Pause=1]="Pause",n[n.Seeked=2]="Seeked",n[n.VolumeChange=3]="VolumeChange",n[n.RateChange=4]="RateChange",n}(Zi||{}),sB=function(n){return n[n.Document=0]="Document",n[n.DocumentType=1]="DocumentType",n[n.Element=2]="Element",n[n.Text=3]="Text",n[n.CDATA=4]="CDATA",n[n.Comment=5]="Comment",n}(sB||{});function oB(n){return"__ln"in n}var $M=function(){function n(){H(this,"length",0),H(this,"head",null),H(this,"tail",null)}var e=n.prototype;return e.get=function(t){if(t>=this.length)throw new Error("Position outside of list range");for(var r=this.head,i=0;i<t;i++)r=(r==null?void 0:r.next)||null;return r},e.addNode=function(t){var r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&oB(t.previousSibling)){var i=t.previousSibling.__ln.next;r.next=i,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,i&&(i.previous=r)}else if(t.nextSibling&&oB(t.nextSibling)&&t.nextSibling.__ln.previous){var A=t.nextSibling.__ln.previous;r.previous=A,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,A&&(A.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;r.next===null&&(this.tail=r),this.length++},e.removeNode=function(t){var r=t.__ln;this.head&&(r.previous?(r.previous.next=r.next,r.next?r.next.previous=r.previous:this.tail=r.previous):(this.head=r.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)},n}(),aB=function(n,e){return n+"@"+e},eL=function(){function n(){var t=this;H(this,"frozen",!1),H(this,"locked",!1),H(this,"texts",[]),H(this,"attributes",[]),H(this,"attributeMap",new WeakMap),H(this,"removes",[]),H(this,"mapRemoves",[]),H(this,"movedMap",{}),H(this,"addedSet",new Set),H(this,"movedSet",new Set),H(this,"droppedSet",new Set),H(this,"removesSubTreeCache",new Set),H(this,"mutationCb"),H(this,"blockClass"),H(this,"blockSelector"),H(this,"maskTextClass"),H(this,"maskTextSelector"),H(this,"inlineStylesheet"),H(this,"maskInputOptions"),H(this,"maskTextFn"),H(this,"maskInputFn"),H(this,"keepIframeSrcFn"),H(this,"recordCanvas"),H(this,"inlineImages"),H(this,"slimDOMOptions"),H(this,"dataURLOptions"),H(this,"doc"),H(this,"mirror"),H(this,"iframeManager"),H(this,"stylesheetManager"),H(this,"shadowDomManager"),H(this,"canvasManager"),H(this,"processedNodeManager"),H(this,"unattachedDoc"),H(this,"processMutations",function(r){r.forEach(t.processMutation),t.emit()}),H(this,"emit",function(){if(!(t.frozen||t.locked)){for(var r=[],i=new Set,A=new $M,s=function(F){for(var Q=F,D=$A;D===$A;)Q=Q&&Q.nextSibling,D=Q&&t.mirror.getId(Q);return D},o=function(F){var Q=se.parentNode(F);if(!(!Q||!AB(F))){var D=!1;if(F.nodeType===Node.TEXT_NODE){var X=Q.tagName;if(X==="TEXTAREA")return;X==="STYLE"&&t.addedSet.has(Q)&&(D=!0)}var N=YA(Q)?t.mirror.getId(iB(F)):t.mirror.getId(Q),q=s(F);if(N===-1||q===-1)return A.addNode(F);var ge=Ki(F,{doc:t.doc,mirror:t.mirror,blockClass:t.blockClass,blockSelector:t.blockSelector,maskTextClass:t.maskTextClass,maskTextSelector:t.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:t.inlineStylesheet,maskInputOptions:t.maskInputOptions,maskTextFn:t.maskTextFn,maskInputFn:t.maskInputFn,slimDOMOptions:t.slimDOMOptions,dataURLOptions:t.dataURLOptions,recordCanvas:t.recordCanvas,inlineImages:t.inlineImages,onSerialize:function(Y){nB(Y,t.mirror)&&t.iframeManager.addIframe(Y),rB(Y,t.mirror)&&t.stylesheetManager.trackLinkElement(Y),Nh(F)&&t.shadowDomManager.addShadowRoot(se.shadowRoot(F),t.doc)},onIframeLoad:function(Y,re){t.iframeManager.attachIframe(Y,re),t.shadowDomManager.observeAttachShadow(Y)},onStylesheetLoad:function(Y,re){t.stylesheetManager.attachLinkElement(Y,re)},cssCaptured:D});ge&&(r.push({parentId:N,nextId:q,node:ge}),i.add(ge.id))}};t.mapRemoves.length;)t.mirror.removeNodeFromMap(t.mapRemoves.shift());for(var a=W(t.movedSet),c;!(c=a()).done;){var u=c.value;cB(t.removesSubTreeCache,u,t.mirror)&&!t.movedSet.has(se.parentNode(u))||o(u)}for(var l=W(t.addedSet),d;!(d=l()).done;){var h=d.value;!uB(t.droppedSet,h)&&!cB(t.removesSubTreeCache,h,t.mirror)||uB(t.movedSet,h)?o(h):t.droppedSet.add(h)}for(var f=null;A.length;){var p=null;if(f){var g=t.mirror.getId(se.parentNode(f.value)),v=s(f.value);g!==-1&&v!==-1&&(p=f)}if(!p)for(var y=A.tail;y;){var b=y;if(y=y.previous,b){var B=t.mirror.getId(se.parentNode(b.value)),w=s(b.value);if(w===-1)continue;if(B!==-1){p=b;break}else{var _=b.value,k=se.parentNode(_);if(k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var T=se.host(k),I=t.mirror.getId(T);if(I!==-1){p=b;break}}}}}if(!p){for(;A.head;)A.removeNode(A.head.value);break}f=p.previous,A.removeNode(p.value),o(p.value)}var x={texts:t.texts.map(function(F){var Q=F.node,D=se.parentNode(Q);return D&&D.tagName==="TEXTAREA"&&t.genTextAreaValueMutation(D),{id:t.mirror.getId(Q),value:F.value}}).filter(function(F){return!i.has(F.id)}).filter(function(F){return t.mirror.has(F.id)}),attributes:t.attributes.map(function(F){var Q=F.attributes;if(typeof Q.style=="string"){var D=JSON.stringify(F.styleDiff),X=JSON.stringify(F._unchangedStyles);D.length<Q.style.length&&(D+X).split("var(").length===Q.style.split("var(").length&&(Q.style=F.styleDiff)}return{id:t.mirror.getId(F.node),attributes:Q}}).filter(function(F){return!i.has(F.id)}).filter(function(F){return t.mirror.has(F.id)}),removes:t.removes,adds:r};!x.texts.length&&!x.attributes.length&&!x.removes.length&&!x.adds.length||(t.texts=[],t.attributes=[],t.attributeMap=new WeakMap,t.removes=[],t.addedSet=new Set,t.movedSet=new Set,t.droppedSet=new Set,t.removesSubTreeCache=new Set,t.movedMap={},t.mutationCb(x))}}),H(this,"genTextAreaValueMutation",function(r){var i=t.attributeMap.get(r);i||(i={node:r,attributes:{},styleDiff:{},_unchangedStyles:{}},t.attributes.push(i),t.attributeMap.set(r,i)),i.attributes.value=Array.from(se.childNodes(r),function(A){return se.textContent(A)||""}).join("")}),H(this,"processMutation",function(r){if(!Dh(r.target,t.mirror,t.slimDOMOptions))switch(r.type){case"characterData":{var i=se.textContent(r.target);!It(r.target,t.blockClass,t.blockSelector,!1)&&i!==r.oldValue&&t.texts.push({value:Yy(r.target,t.maskTextClass,t.maskTextSelector,!0)&&i?t.maskTextFn?t.maskTextFn(i,eB(r.target)):i.replace(/[\S]/g,"*"):i,node:r.target});break}case"attributes":{var A=r.target,s=r.attributeName,o=r.target.getAttribute(s);if(s==="value"){var a=Td(A);o=Ud({element:A,maskInputOptions:t.maskInputOptions,tagName:A.tagName,type:a,value:o,maskInputFn:t.maskInputFn})}if(It(r.target,t.blockClass,t.blockSelector,!1)||o===r.oldValue)return;var c=t.attributeMap.get(r.target);if(A.tagName==="IFRAME"&&s==="src"&&!t.keepIframeSrcFn(o))if(!A.contentDocument)s="rr_src";else return;if(c||(c={node:r.target,attributes:{},styleDiff:{},_unchangedStyles:{}},t.attributes.push(c),t.attributeMap.set(r.target,c)),s==="type"&&A.tagName==="INPUT"&&(r.oldValue||"").toLowerCase()==="password"&&A.setAttribute("data-rr-is-password","true"),!Xy(A.tagName,s))if(c.attributes[s]=zy(t.doc,Yr(A.tagName),Yr(s),o),s==="style"){if(!t.unattachedDoc)try{t.unattachedDoc=document.implementation.createHTMLDocument()}catch{t.unattachedDoc=t.doc}var u=t.unattachedDoc.createElement("span");r.oldValue&&u.setAttribute("style",r.oldValue);for(var l=W(Array.from(A.style)),d;!(d=l()).done;){var h=d.value,f=A.style.getPropertyValue(h),p=A.style.getPropertyPriority(h);f!==u.style.getPropertyValue(h)||p!==u.style.getPropertyPriority(h)?p===""?c.styleDiff[h]=f:c.styleDiff[h]=[f,p]:c._unchangedStyles[h]=[f,p]}for(var g=W(Array.from(u.style)),v;!(v=g()).done;){var y=v.value;A.style.getPropertyValue(y)===""&&(c.styleDiff[y]=!1)}}else s==="open"&&A.tagName==="DIALOG"&&(A.matches("dialog:modal")?c.attributes.rr_open_mode="modal":c.attributes.rr_open_mode="non-modal");break}case"childList":{if(It(r.target,t.blockClass,t.blockSelector,!0))return;if(r.target.tagName==="TEXTAREA"){t.genTextAreaValueMutation(r.target);return}r.addedNodes.forEach(function(b){return t.genAdds(b,r.target)}),r.removedNodes.forEach(function(b){var B=t.mirror.getId(b),w=YA(r.target)?t.mirror.getId(se.host(r.target)):t.mirror.getId(r.target);It(r.target,t.blockClass,t.blockSelector,!1)||Dh(b,t.mirror,t.slimDOMOptions)||!JM(b,t.mirror)||(t.addedSet.has(b)?(Kh(t.addedSet,b),t.droppedSet.add(b)):t.addedSet.has(r.target)&&B===-1||tB(r.target,t.mirror)||(t.movedSet.has(b)&&t.movedMap[aB(B,w)]?Kh(t.movedSet,b):(t.removes.push({parentId:w,id:B,isShadow:YA(r.target)&&ZA(r.target)?!0:void 0}),tL(b,t.removesSubTreeCache))),t.mapRemoves.push(b))});break}}}),H(this,"genAdds",function(r,i){if(!t.processedNodeManager.inOtherBuffer(r,t)&&!(t.addedSet.has(r)||t.movedSet.has(r))){if(t.mirror.hasNode(r)){if(Dh(r,t.mirror,t.slimDOMOptions))return;t.movedSet.add(r);var A=null;i&&t.mirror.hasNode(i)&&(A=t.mirror.getId(i)),A&&A!==-1&&(t.movedMap[aB(t.mirror.getId(r),A)]=!0)}else t.addedSet.add(r),t.droppedSet.delete(r);It(r,t.blockClass,t.blockSelector,!1)||(se.childNodes(r).forEach(function(s){return t.genAdds(s)}),Nh(r)&&se.childNodes(se.shadowRoot(r)).forEach(function(s){t.processedNodeManager.add(s,t),t.genAdds(s,r)}))}})}var e=n.prototype;return e.init=function(t){var r=this;["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(function(i){r[i]=t[i]})},e.freeze=function(){this.frozen=!0,this.canvasManager.freeze()},e.unfreeze=function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()},e.isFrozen=function(){return this.frozen},e.lock=function(){this.locked=!0,this.canvasManager.lock()},e.unlock=function(){this.locked=!1,this.canvasManager.unlock(),this.emit()},e.reset=function(){this.shadowDomManager.reset(),this.canvasManager.reset()},n}();function Kh(n,e){n.delete(e),se.childNodes(e).forEach(function(t){return Kh(n,t)})}function tL(n,e){for(var t=[n];t.length;){var r=t.pop();e.has(r)||(e.add(r),se.childNodes(r).forEach(function(i){return t.push(i)}))}}function cB(n,e,t){return n.size===0?!1:nL(n,e)}function nL(n,e,t){var r=se.parentNode(e);return r?n.has(r):!1}function uB(n,e){return n.size===0?!1:lB(n,e)}function lB(n,e){var t=se.parentNode(e);return t?n.has(t)?!0:lB(n,t):!1}var fs;function rL(n){fs=n}function iL(){fs=void 0}var de=function(n){if(!fs)return n;var e=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];try{return n.apply(void 0,[].concat(r))}catch(A){if(fs&&fs(A)===!0)return;throw A}};return e},ei=[];function gs(n){try{if("composedPath"in n){var e=n.composedPath();if(e.length)return e[0]}else if("path"in n&&n.path.length)return n.path[0]}catch{}return n&&n.target}function dB(n,e){var t=new eL;ei.push(t),t.init(n);var r=new(zb())(de(t.processMutations.bind(t)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function AL(n){var e=n.mousemoveCb,t=n.sampling,r=n.doc,i=n.mirror;if(t.mousemove===!1)return function(){};var A=typeof t.mousemove=="number"?t.mousemove:50,s=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,o=[],a,c=ps(de(function(d){var h=Date.now()-a;e(o.map(function(f){return f.timeOffset-=h,f}),d),o=[],a=null}),s),u=de(ps(de(function(d){var h=gs(d),f=Hh(d)?d.changedTouches[0]:d,p=f.clientX,g=f.clientY;a||(a=fc()),o.push({x:p,y:g,id:i.getId(h),timeOffset:fc()-a}),c(typeof DragEvent<"u"&&ee(d,DragEvent)?z.Drag:ee(d,MouseEvent)?z.MouseMove:z.TouchMove)}),A,{trailing:!1})),l=[Tt("mousemove",u,r),Tt("touchmove",u,r),Tt("drag",u,r)];return de(function(){l.forEach(function(d){return d()})})}function sL(n){var e=n.mouseInteractionCb,t=n.doc,r=n.mirror,i=n.blockClass,A=n.blockSelector,s=n.sampling;if(s.mouseInteraction===!1)return function(){};var o=s.mouseInteraction===!0||s.mouseInteraction===void 0?{}:s.mouseInteraction,a=[],c=null,u=function(l){return function(d){var h=gs(d);if(!It(h,i,A,!0)){var f=null,p=l;if("pointerType"in d){switch(d.pointerType){case"mouse":f=jn.Mouse;break;case"touch":f=jn.Touch;break;case"pen":f=jn.Pen;break}f===jn.Touch?Vt[l]===Vt.MouseDown?p="TouchStart":Vt[l]===Vt.MouseUp&&(p="TouchEnd"):jn.Pen}else Hh(d)&&(f=jn.Touch);f!==null?(c=f,(p.startsWith("Touch")&&f===jn.Touch||p.startsWith("Mouse")&&f===jn.Mouse)&&(f=null)):Vt[l]===Vt.Click&&(f=c,c=null);var g=Hh(d)?d.changedTouches[0]:d;if(g){var v=r.getId(h),y=g.clientX,b=g.clientY;de(e)(fe({type:Vt[p],id:v,x:y,y:b},f!==null&&{pointerType:f}))}}}};return Object.keys(Vt).filter(function(l){return Number.isNaN(Number(l))&&!l.endsWith("_Departed")&&o[l]!==!1}).forEach(function(l){var d=Yr(l),h=u(l);if(window.PointerEvent)switch(Vt[l]){case Vt.MouseDown:case Vt.MouseUp:d=d.replace("mouse","pointer");break;case Vt.TouchStart:case Vt.TouchEnd:return}a.push(Tt(d,h,t))}),de(function(){a.forEach(function(l){return l()})})}function hB(n){var e=n.scrollCb,t=n.doc,r=n.mirror,i=n.blockClass,A=n.blockSelector,s=n.sampling,o=de(ps(de(function(a){var c=gs(a);if(!(!c||It(c,i,A,!0))){var u=r.getId(c);if(c===t&&t.defaultView){var l=Yb(t.defaultView);e({id:u,x:l.left,y:l.top})}else e({id:u,x:c.scrollLeft,y:c.scrollTop})}}),s.scroll||100));return Tt("scroll",o,t)}function oL(n,e){var t=n.viewportResizeCb,r=e.win,i=-1,A=-1,s=de(ps(de(function(){var o=Zb(),a=$b();(i!==o||A!==a)&&(t({width:Number(a),height:Number(o)}),i=o,A=a)}),200));return Tt("resize",s,r)}var aL=["INPUT","TEXTAREA","SELECT"],pB=new WeakMap;function cL(n){var e=n.inputCb,t=n.doc,r=n.mirror,i=n.blockClass,A=n.blockSelector,s=n.ignoreClass,o=n.ignoreSelector,a=n.maskInputOptions,c=n.maskInputFn,u=n.sampling,l=n.userTriggeredOnInput;function d(B){var w=gs(B),_=B.isTrusted,k=w&&w.tagName;if(w&&k==="OPTION"&&(w=se.parentElement(w)),!(!w||!k||aL.indexOf(k)<0||It(w,i,A,!0))&&!(w.classList.contains(s)||o&&w.matches(o))){var T=w.value,I=!1,x=Td(w)||"";x==="radio"||x==="checkbox"?I=w.checked:(a[k.toLowerCase()]||a[x])&&(T=Ud({element:w,maskInputOptions:a,tagName:k,type:x,value:T,maskInputFn:c})),h(w,l?{text:T,isChecked:I,userTriggered:_}:{text:T,isChecked:I});var F=w.name;x==="radio"&&F&&I&&t.querySelectorAll('input[type="radio"][name="'+F+'"]').forEach(function(Q){if(Q!==w){var D=Q.value;h(Q,l?{text:D,isChecked:!I,userTriggered:!1}:{text:D,isChecked:!I})}})}}function h(B,w){var _=pB.get(B);if(!_||_.text!==w.text||_.isChecked!==w.isChecked){pB.set(B,w);var k=r.getId(B);de(e)(fe({},w,{id:k}))}}var f=u.input==="last"?["change"]:["input","change"],p=f.map(function(B){return Tt(B,de(d),t)}),g=t.defaultView;if(!g)return function(){p.forEach(function(B){return B()})};var v=g.Object.getOwnPropertyDescriptor(g.HTMLInputElement.prototype,"value"),y=[[g.HTMLInputElement.prototype,"value"],[g.HTMLInputElement.prototype,"checked"],[g.HTMLSelectElement.prototype,"value"],[g.HTMLTextAreaElement.prototype,"value"],[g.HTMLSelectElement.prototype,"selectedIndex"],[g.HTMLOptionElement.prototype,"selected"]];if(v&&v.set){var b;(b=p).push.apply(b,[].concat(y.map(function(B){return pc(B[0],B[1],{set:function(){de(d)({target:this,isTrusted:!1})}},!1,g)})))}return de(function(){p.forEach(function(B){return B()})})}function gc(n){var e=[];function t(r,i){if(mc("CSSGroupingRule")&&ee(r.parentRule,CSSGroupingRule)||mc("CSSMediaRule")&&ee(r.parentRule,CSSMediaRule)||mc("CSSSupportsRule")&&ee(r.parentRule,CSSSupportsRule)||mc("CSSConditionRule")&&ee(r.parentRule,CSSConditionRule)){var A=Array.from(r.parentRule.cssRules),s=A.indexOf(r);i.unshift(s)}else if(r.parentStyleSheet){var o=Array.from(r.parentStyleSheet.cssRules),a=o.indexOf(r);i.unshift(a)}return i}return t(n,e)}function Cr(n,e,t){var r,i;return n?(n.ownerNode?r=e.getId(n.ownerNode):i=t.getId(n),{styleId:i,id:r}):{}}function uL(n,e){var t=n.styleSheetRuleCb,r=n.mirror,i=n.stylesheetManager,A=e.win;if(!A.CSSStyleSheet||!A.CSSStyleSheet.prototype)return function(){};var s=A.CSSStyleSheet.prototype.insertRule;A.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:de(function(d,h,f){var p=f[0],g=f[1],v=Cr(h,r,i.styleMirror),y=v.id,b=v.styleId;return(y&&y!==-1||b&&b!==-1)&&t({id:y,styleId:b,adds:[{rule:p,index:g}]}),d.apply(h,f)})}),A.CSSStyleSheet.prototype.addRule=function(d,h,f){f===void 0&&(f=this.cssRules.length);var p=d+" { "+h+" }";return A.CSSStyleSheet.prototype.insertRule.apply(this,[p,f])};var o=A.CSSStyleSheet.prototype.deleteRule;A.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:de(function(d,h,f){var p=f[0],g=Cr(h,r,i.styleMirror),v=g.id,y=g.styleId;return(v&&v!==-1||y&&y!==-1)&&t({id:v,styleId:y,removes:[{index:p}]}),d.apply(h,f)})}),A.CSSStyleSheet.prototype.removeRule=function(d){return A.CSSStyleSheet.prototype.deleteRule.apply(this,[d])};var a;A.CSSStyleSheet.prototype.replace&&(a=A.CSSStyleSheet.prototype.replace,A.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:de(function(d,h,f){var p=f[0],g=Cr(h,r,i.styleMirror),v=g.id,y=g.styleId;return(v&&v!==-1||y&&y!==-1)&&t({id:v,styleId:y,replace:p}),d.apply(h,f)})}));var c;A.CSSStyleSheet.prototype.replaceSync&&(c=A.CSSStyleSheet.prototype.replaceSync,A.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:de(function(d,h,f){var p=f[0],g=Cr(h,r,i.styleMirror),v=g.id,y=g.styleId;return(v&&v!==-1||y&&y!==-1)&&t({id:v,styleId:y,replaceSync:p}),d.apply(h,f)})}));var u={};vc("CSSGroupingRule")?u.CSSGroupingRule=A.CSSGroupingRule:(vc("CSSMediaRule")&&(u.CSSMediaRule=A.CSSMediaRule),vc("CSSConditionRule")&&(u.CSSConditionRule=A.CSSConditionRule),vc("CSSSupportsRule")&&(u.CSSSupportsRule=A.CSSSupportsRule));var l={};return Object.entries(u).forEach(function(d){var h=d[0],f=d[1];l[h]={insertRule:f.prototype.insertRule,deleteRule:f.prototype.deleteRule},f.prototype.insertRule=new Proxy(l[h].insertRule,{apply:de(function(p,g,v){var y=v[0],b=v[1],B=Cr(g.parentStyleSheet,r,i.styleMirror),w=B.id,_=B.styleId;return(w&&w!==-1||_&&_!==-1)&&t({id:w,styleId:_,adds:[{rule:y,index:[].concat(gc(g),[b||0])}]}),p.apply(g,v)})}),f.prototype.deleteRule=new Proxy(l[h].deleteRule,{apply:de(function(p,g,v){var y=v[0],b=Cr(g.parentStyleSheet,r,i.styleMirror),B=b.id,w=b.styleId;return(B&&B!==-1||w&&w!==-1)&&t({id:B,styleId:w,removes:[{index:[].concat(gc(g),[y])}]}),p.apply(g,v)})})}),de(function(){A.CSSStyleSheet.prototype.insertRule=s,A.CSSStyleSheet.prototype.deleteRule=o,a&&(A.CSSStyleSheet.prototype.replace=a),c&&(A.CSSStyleSheet.prototype.replaceSync=c),Object.entries(u).forEach(function(d){var h=d[0],f=d[1];f.prototype.insertRule=l[h].insertRule,f.prototype.deleteRule=l[h].deleteRule})})}function fB(n,e){var t=n.mirror,r=n.stylesheetManager,i,A,s,o=null;e.nodeName==="#document"?o=t.getId(e):o=t.getId(se.host(e));var a=e.nodeName==="#document"?(i=e.defaultView)==null?void 0:i.Document:(s=(A=e.ownerDocument)==null?void 0:A.defaultView)==null?void 0:s.ShadowRoot,c=a!=null&&a.prototype?Object.getOwnPropertyDescriptor(a==null?void 0:a.prototype,"adoptedStyleSheets"):void 0;return o===null||o===-1||!a||!c?function(){}:(Object.defineProperty(e,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:function(){var u;return(u=c.get)==null?void 0:u.call(this)},set:function(u){var l,d=(l=c.set)==null?void 0:l.call(this,u);if(o!==null&&o!==-1)try{r.adoptStyleSheets(u,o)}catch{}return d}}),de(function(){Object.defineProperty(e,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))}function lL(n,e){var t=n.styleDeclarationCb,r=n.mirror,i=n.ignoreCSSAttributes,A=n.stylesheetManager,s=e.win,o=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:de(function(c,u,l){var d,h=l[0],f=l[1],p=l[2];if(i.has(h))return o.apply(u,[h,f,p]);var g=Cr((d=u.parentRule)==null?void 0:d.parentStyleSheet,r,A.styleMirror),v=g.id,y=g.styleId;return(v&&v!==-1||y&&y!==-1)&&t({id:v,styleId:y,set:{property:h,value:f,priority:p},index:gc(u.parentRule)}),c.apply(u,l)})});var a=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:de(function(c,u,l){var d,h=l[0];if(i.has(h))return a.apply(u,[h]);var f=Cr((d=u.parentRule)==null?void 0:d.parentStyleSheet,r,A.styleMirror),p=f.id,g=f.styleId;return(p&&p!==-1||g&&g!==-1)&&t({id:p,styleId:g,remove:{property:h},index:gc(u.parentRule)}),c.apply(u,l)})}),de(function(){s.CSSStyleDeclaration.prototype.setProperty=o,s.CSSStyleDeclaration.prototype.removeProperty=a})}function dL(n){var e=n.mediaInteractionCb,t=n.blockClass,r=n.blockSelector,i=n.mirror,A=n.sampling,s=n.doc,o=de(function(c){return ps(de(function(u){var l=gs(u);if(!(!l||It(l,t,r,!0))){var d=l.currentTime,h=l.volume,f=l.muted,p=l.playbackRate,g=l.loop;e({type:c,id:i.getId(l),currentTime:d,volume:h,muted:f,playbackRate:p,loop:g})}}),A.media||500)}),a=[Tt("play",o(Zi.Play),s),Tt("pause",o(Zi.Pause),s),Tt("seeked",o(Zi.Seeked),s),Tt("volumechange",o(Zi.VolumeChange),s),Tt("ratechange",o(Zi.RateChange),s)];return de(function(){a.forEach(function(c){return c()})})}function hL(n){var e=n.fontCb,t=n.doc,r=t.defaultView;if(!r)return function(){};var i=[],A=new WeakMap,s=r.FontFace;r.FontFace=function(a,c,u){var l=new s(a,c,u);return A.set(l,{family:a,buffer:typeof c!="string",descriptors:u,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),l};var o=Xi(t.fonts,"add",function(a){return function(c){return setTimeout(de(function(){var u=A.get(c);u&&(e(u),A.delete(c))}),0),a.apply(this,[c])}});return i.push(function(){r.FontFace=s}),i.push(o),de(function(){i.forEach(function(a){return a()})})}function pL(n){var e=n.doc,t=n.mirror,r=n.blockClass,i=n.blockSelector,A=n.selectionCb,s=!0,o=de(function(){var a=e.getSelection();if(!(!a||s&&(a!=null&&a.isCollapsed))){s=a.isCollapsed||!1;for(var c=[],u=a.rangeCount||0,l=0;l<u;l++){var d=a.getRangeAt(l),h=d.startContainer,f=d.startOffset,p=d.endContainer,g=d.endOffset,v=It(h,r,i,!0)||It(p,r,i,!0);v||c.push({start:t.getId(h),startOffset:f,end:t.getId(p),endOffset:g})}A({ranges:c})}});return o(),Tt("selectionchange",o)}function fL(n){var e=n.doc,t=n.customElementCb,r=e.defaultView;if(!r||!r.customElements)return function(){};var i=Xi(r.customElements,"define",function(A){return function(s,o,a){try{t({define:{name:s}})}catch{console.warn("Custom element callback failed for "+s)}return A.apply(this,[s,o,a])}});return i}function gL(n,e){var t=n.mutationCb,r=n.mousemoveCb,i=n.mouseInteractionCb,A=n.scrollCb,s=n.viewportResizeCb,o=n.inputCb,a=n.mediaInteractionCb,c=n.styleSheetRuleCb,u=n.styleDeclarationCb,l=n.canvasMutationCb,d=n.fontCb,h=n.selectionCb,f=n.customElementCb;n.mutationCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.mutation){var y;(y=e).mutation.apply(y,[].concat(g))}t.apply(void 0,[].concat(g))},n.mousemoveCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.mousemove){var y;(y=e).mousemove.apply(y,[].concat(g))}r.apply(void 0,[].concat(g))},n.mouseInteractionCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.mouseInteraction){var y;(y=e).mouseInteraction.apply(y,[].concat(g))}i.apply(void 0,[].concat(g))},n.scrollCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.scroll){var y;(y=e).scroll.apply(y,[].concat(g))}A.apply(void 0,[].concat(g))},n.viewportResizeCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.viewportResize){var y;(y=e).viewportResize.apply(y,[].concat(g))}s.apply(void 0,[].concat(g))},n.inputCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.input){var y;(y=e).input.apply(y,[].concat(g))}o.apply(void 0,[].concat(g))},n.mediaInteractionCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.mediaInteaction){var y;(y=e).mediaInteaction.apply(y,[].concat(g))}a.apply(void 0,[].concat(g))},n.styleSheetRuleCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.styleSheetRule){var y;(y=e).styleSheetRule.apply(y,[].concat(g))}c.apply(void 0,[].concat(g))},n.styleDeclarationCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.styleDeclaration){var y;(y=e).styleDeclaration.apply(y,[].concat(g))}u.apply(void 0,[].concat(g))},n.canvasMutationCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.canvasMutation){var y;(y=e).canvasMutation.apply(y,[].concat(g))}l.apply(void 0,[].concat(g))},n.fontCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.font){var y;(y=e).font.apply(y,[].concat(g))}d.apply(void 0,[].concat(g))},n.selectionCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.selection){var y;(y=e).selection.apply(y,[].concat(g))}h.apply(void 0,[].concat(g))},n.customElementCb=function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];if(e.customElement){var y;(y=e).customElement.apply(y,[].concat(g))}f.apply(void 0,[].concat(g))}}function mL(n,e){e===void 0&&(e={});var t=n.doc.defaultView;if(!t)return function(){};gL(n,e);var r;n.recordDOM&&(r=dB(n,n.doc));var i=AL(n),A=sL(n),s=hB(n),o=oL(n,{win:t}),a=cL(n),c=dL(n),u=function(){},l=function(){},d=function(){},h=function(){};n.recordDOM&&(u=uL(n,{win:t}),l=fB(n,n.doc),d=lL(n,{win:t}),n.collectFonts&&(h=hL(n)));for(var f=pL(n),p=fL(n),g=[],v=W(n.plugins),y;!(y=v()).done;){var b=y.value;g.push(b.observer(b.callback,t,b.options))}return de(function(){ei.forEach(function(B){return B.reset()}),r==null||r.disconnect(),i(),A(),s(),o(),a(),c(),u(),l(),d(),h(),f(),p(),g.forEach(function(B){return B()})})}function mc(n){return typeof window[n]<"u"}function vc(n){return!!(typeof window[n]<"u"&&window[n].prototype&&"insertRule"in window[n].prototype&&"deleteRule"in window[n].prototype)}for(var gB=function(){function n(t){H(this,"iframeIdToRemoteIdMap",new WeakMap),H(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}var e=n.prototype;return e.getId=function(t,r,i,A){var s=i||this.getIdToRemoteIdMap(t),o=A||this.getRemoteIdToIdMap(t),a=s.get(r);return a||(a=this.generateIdFn(),s.set(r,a),o.set(a,r)),a},e.getIds=function(t,r){var i=this,A=this.getIdToRemoteIdMap(t),s=this.getRemoteIdToIdMap(t);return r.map(function(o){return i.getId(t,o,A,s)})},e.getRemoteId=function(t,r,i){var A=i||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;var s=A.get(r);return s||-1},e.getRemoteIds=function(t,r){var i=this,A=this.getRemoteIdToIdMap(t);return r.map(function(s){return i.getRemoteId(t,s,A)})},e.reset=function(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)},e.getIdToRemoteIdMap=function(t){var r=this.iframeIdToRemoteIdMap.get(t);return r||(r=new Map,this.iframeIdToRemoteIdMap.set(t,r)),r},e.getRemoteIdToIdMap=function(t){var r=this.iframeRemoteIdToIdMap.get(t);return r||(r=new Map,this.iframeRemoteIdToIdMap.set(t,r)),r},n}(),vL=function(){function n(t){H(this,"iframes",new WeakMap),H(this,"crossOriginIframeMap",new WeakMap),H(this,"crossOriginIframeMirror",new gB(Wy)),H(this,"crossOriginIframeStyleMirror"),H(this,"crossOriginIframeRootIdMap",new WeakMap),H(this,"mirror"),H(this,"mutationCb"),H(this,"wrappedEmit"),H(this,"loadListener"),H(this,"stylesheetManager"),H(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new gB(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}var e=n.prototype;return e.addIframe=function(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)},e.addLoadListener=function(t){this.loadListener=t},e.attachIframe=function(t,r){var i,A;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((i=t.contentWindow)==null||i.addEventListener("message",this.handleMessage.bind(this))),(A=this.loadListener)==null||A.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))},e.handleMessage=function(t){var r=t;if(!(r.data.type!=="rrweb"||r.origin!==r.data.origin)){var i=t.source;if(i){var A=this.crossOriginIframeMap.get(t.source);if(A){var s=this.transformCrossOriginEvent(A,r.data.event);s&&this.wrappedEmit(s,r.data.isCheckout)}}}},e.transformCrossOriginEvent=function(t,r){var i=this,A;switch(r.type){case ue.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);var s=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,s),this.patchRootIdOnNode(r.data.node,s),{timestamp:r.timestamp,type:ue.IncrementalSnapshot,data:{source:z.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case ue.Meta:case ue.Load:case ue.DomContentLoaded:return!1;case ue.Plugin:return r;case ue.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case ue.IncrementalSnapshot:switch(r.data.source){case z.Mutation:return r.data.adds.forEach(function(o){i.replaceIds(o,t,["parentId","nextId","previousId"]),i.replaceIdOnNode(o.node,t);var a=i.crossOriginIframeRootIdMap.get(t);a&&i.patchRootIdOnNode(o.node,a)}),r.data.removes.forEach(function(o){i.replaceIds(o,t,["parentId","id"])}),r.data.attributes.forEach(function(o){i.replaceIds(o,t,["id"])}),r.data.texts.forEach(function(o){i.replaceIds(o,t,["id"])}),r;case z.Drag:case z.TouchMove:case z.MouseMove:return r.data.positions.forEach(function(o){i.replaceIds(o,t,["id"])}),r;case z.ViewportResize:return!1;case z.MediaInteraction:case z.MouseInteraction:case z.Scroll:case z.CanvasMutation:case z.Input:return this.replaceIds(r.data,t,["id"]),r;case z.StyleSheetRule:case z.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case z.Font:return r;case z.Selection:return r.data.ranges.forEach(function(o){i.replaceIds(o,t,["start","end"])}),r;case z.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(A=r.data.styles)==null||A.forEach(function(o){i.replaceStyleIds(o,t,["styleId"])}),r}}return!1},e.replace=function(t,r,i,A){for(var s=W(A),o;!(o=s()).done;){var a=o.value;!Array.isArray(r[a])&&typeof r[a]!="number"||(Array.isArray(r[a])?r[a]=t.getIds(i,r[a]):r[a]=t.getId(i,r[a]))}return r},e.replaceIds=function(t,r,i){return this.replace(this.crossOriginIframeMirror,t,r,i)},e.replaceStyleIds=function(t,r,i){return this.replace(this.crossOriginIframeStyleMirror,t,r,i)},e.replaceIdOnNode=function(t,r){var i=this;this.replaceIds(t,r,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(function(A){i.replaceIdOnNode(A,r)})},e.patchRootIdOnNode=function(t,r){var i=this;t.type!==sB.Document&&!t.rootId&&(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(function(A){i.patchRootIdOnNode(A,r)})},n}(),yL=function(){function n(t){H(this,"shadowDoms",new WeakSet),H(this,"mutationCb"),H(this,"scrollCb"),H(this,"bypassOptions"),H(this,"mirror"),H(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}var e=n.prototype;return e.init=function(){this.reset(),this.patchAttachShadow(Element,document)},e.addShadowRoot=function(t,r){var i=this;if(ZA(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var A=dB(fe({},this.bypassOptions,{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push(function(){return A.disconnect()}),this.restoreHandlers.push(hB(fe({},this.bypassOptions,{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))),setTimeout(function(){t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&i.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,i.mirror.getId(se.host(t))),i.restoreHandlers.push(fB({mirror:i.mirror,stylesheetManager:i.bypassOptions.stylesheetManager},t))},0)}},e.observeAttachShadow=function(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)},e.patchAttachShadow=function(t,r){var i=this;this.restoreHandlers.push(Xi(t.prototype,"attachShadow",function(A){return function(s){var o=A.call(this,s),a=se.shadowRoot(this);return a&&AB(this)&&i.addShadowRoot(a,r),o}}))},e.reset=function(){this.restoreHandlers.forEach(function(t){try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet},n}(),$i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",wL=typeof Uint8Array>"u"?[]:new Uint8Array(256),yc=0;yc<$i.length;yc++)wL[$i.charCodeAt(yc)]=yc;var bL=function(n){var e=new Uint8Array(n),t,r=e.length,i="";for(t=0;t<r;t+=3)i+=$i[e[t]>>2],i+=$i[(e[t]&3)<<4|e[t+1]>>4],i+=$i[(e[t+1]&15)<<2|e[t+2]>>6],i+=$i[e[t+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i},mB=new Map;function BL(n,e){var t=mB.get(n);return t||(t=new Map,mB.set(n,t)),t.has(e)||t.set(e,[]),t.get(e)}var vB=function(n,e,t){if(!(!n||!(wB(n,e)||(typeof n>"u"?"undefined":Ae(n))==="object"))){var r=n.constructor.name,i=BL(t,r),A=i.indexOf(n);return A===-1&&(A=i.length,i.push(n)),A}};function wc(n,e,t){if(ee(n,Array))return n.map(function(f){return wc(f,e,t)});if(n===null)return n;if(ee(n,Float32Array)||ee(n,Float64Array)||ee(n,Int32Array)||ee(n,Uint32Array)||ee(n,Uint8Array)||ee(n,Uint16Array)||ee(n,Int16Array)||ee(n,Int8Array)||ee(n,Uint8ClampedArray)){var r=n.constructor.name;return{rr_type:r,args:[Object.values(n)]}}else if(ee(n,ArrayBuffer)){var i=n.constructor.name,A=bL(n);return{rr_type:i,base64:A}}else if(ee(n,DataView)){var s=n.constructor.name;return{rr_type:s,args:[wc(n.buffer,e,t),n.byteOffset,n.byteLength]}}else if(ee(n,HTMLImageElement)){var o=n.constructor.name,a=n.src;return{rr_type:o,src:a}}else if(ee(n,HTMLCanvasElement)){var c="HTMLImageElement",u=n.toDataURL();return{rr_type:c,src:u}}else if(ee(n,ImageData)){var l=n.constructor.name;return{rr_type:l,args:[wc(n.data,e,t),n.width,n.height]}}else if(wB(n,e)||(typeof n>"u"?"undefined":Ae(n))==="object"){var d=n.constructor.name,h=vB(n,e,t);return{rr_type:d,index:h}}return n}var yB=function(n,e,t){return n.map(function(r){return wc(r,e,t)})},wB=function(n,e){var t=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"],r=t.filter(function(i){return typeof e[i]=="function"});return!!r.find(function(i){return ee(n,e[i])})};function CL(n,e,t,r){for(var i=function(){var c=a.value;try{if(typeof e.CanvasRenderingContext2D.prototype[c]!="function")return"continue";var u=Xi(e.CanvasRenderingContext2D.prototype,c,function(d){return function(){for(var h=this,f=arguments.length,p=new Array(f),g=0;g<f;g++)p[g]=arguments[g];return It(this.canvas,t,r,!0)||setTimeout(function(){var v=yB(p,e,h);n(h.canvas,{type:Yi["2D"],property:c,args:v})},0),d.apply(this,p)}});A.push(u)}catch{var l=pc(e.CanvasRenderingContext2D.prototype,c,{set:function(d){n(this.canvas,{type:Yi["2D"],property:c,args:[d],setter:!0})}});A.push(l)}},A=[],s=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),o=W(s),a;!(a=o()).done;)i();return function(){A.forEach(function(c){return c()})}}function _L(n){return n==="experimental-webgl"?"webgl":n}function bB(n,e,t,r){var i=[];try{var A=Xi(n.HTMLCanvasElement.prototype,"getContext",function(s){return function(o){for(var a=arguments.length,c=new Array(a>1?a-1:0),u=1;u<a;u++)c[u-1]=arguments[u];if(!It(this,e,t,!0)){var l=_L(o);if("__context"in this||(this.__context=l),r&&["webgl","webgl2"].includes(l))if(c[0]&&Ae(c[0])==="object"){var d=c[0];d.preserveDrawingBuffer||(d.preserveDrawingBuffer=!0)}else c.splice(0,1,{preserveDrawingBuffer:!0})}return s.apply(this,[].concat([o],c))}});i.push(A)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){i.forEach(function(s){return s()})}}function BB(n,e,t,r,i,A){for(var s=function(){var l=u.value;if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))return"continue";try{if(typeof n[l]!="function")return"continue";var d=Xi(n,l,function(f){return function(){for(var p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];var y=f.apply(this,g);if(vB(y,A,this),"tagName"in this.canvas&&!It(this.canvas,r,i,!0)){var b=yB(g,A,this),B={type:e,property:l,args:b};t(this.canvas,B)}return y}});o.push(d)}catch{var h=pc(n,l,{set:function(f){t(this.canvas,{type:e,property:l,args:[f],setter:!0})}});o.push(h)}},o=[],a=Object.getOwnPropertyNames(n),c=W(a),u;!(u=c()).done;)s();return o}function SL(n,e,t,r){var i,A=[];if((i=A).push.apply(i,[].concat(BB(e.WebGLRenderingContext.prototype,Yi.WebGL,n,t,r,e))),typeof e.WebGL2RenderingContext<"u"){var s;(s=A).push.apply(s,[].concat(BB(e.WebGL2RenderingContext.prototype,Yi.WebGL2,n,t,r,e)))}return function(){A.forEach(function(o){return o()})}}var CB="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",kL=function(n){return Uint8Array.from(atob(n),function(e){return e.charCodeAt(0)})},_B=typeof window<"u"&&window.Blob&&new Blob([kL(CB)],{type:"text/javascript;charset=utf-8"});function EL(n){var e;try{if(e=_B&&(window.URL||window.webkitURL).createObjectURL(_B),!e)throw"";var t=new Worker(e,{name:n==null?void 0:n.name});return t.addEventListener("error",function(){(window.URL||window.webkitURL).revokeObjectURL(e)}),t}catch{return new Worker("data:text/javascript;base64,"+CB,{name:n==null?void 0:n.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}var UL=function(){function n(t){var r=this;H(this,"pendingCanvasMutations",new Map),H(this,"rafStamps",{latestId:0,invokeId:null}),H(this,"mirror"),H(this,"mutationCb"),H(this,"resetObservers"),H(this,"frozen",!1),H(this,"locked",!1),H(this,"processMutation",function(l,d){var h=r.rafStamps.invokeId&&r.rafStamps.latestId!==r.rafStamps.invokeId;(h||!r.rafStamps.invokeId)&&(r.rafStamps.invokeId=r.rafStamps.latestId),r.pendingCanvasMutations.has(l)||r.pendingCanvasMutations.set(l,[]),r.pendingCanvasMutations.get(l).push(d)});var i=t.sampling,A=i===void 0?"all":i,s=t.win,o=t.blockClass,a=t.blockSelector,c=t.recordCanvas,u=t.dataURLOptions;this.mutationCb=t.mutationCb,this.mirror=t.mirror,c&&A==="all"&&this.initCanvasMutationObserver(s,o,a),c&&typeof A=="number"&&this.initCanvasFPSObserver(A,s,o,a,{dataURLOptions:u})}var e=n.prototype;return e.reset=function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()},e.freeze=function(){this.frozen=!0},e.unfreeze=function(){this.frozen=!1},e.lock=function(){this.locked=!0},e.unlock=function(){this.locked=!1},e.initCanvasFPSObserver=function(t,r,i,A,s){var o=this,a=bB(r,i,A,!0),c=new Map,u=new EL;u.onmessage=function(g){var v=g.data.id;if(c.set(v,!1),"base64"in g.data){var y=g.data,b=y.base64,B=y.type,w=y.width,_=y.height;o.mutationCb({id:v,type:Yi["2D"],commands:[{property:"clearRect",args:[0,0,w,_]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:b}],type:B}]},0,0]}]})}};var l=1e3/t,d=0,h,f=function(){var g=[];return r.document.querySelectorAll("canvas").forEach(function(v){It(v,i,A,!0)||g.push(v)}),g},p=function(g){if(d&&g-d<l){h=requestAnimationFrame(p);return}d=g;var v=o;f().forEach(Bd(function(y){var b,B,w,_;return XA(this,function(k){switch(k.label){case 0:return B=v.mirror.getId(y),c.get(B)?[2]:y.width===0||y.height===0?[2]:(c.set(B,!0),["webgl","webgl2"].includes(y.__context)&&(w=y.getContext(y.__context),((b=w==null?void 0:w.getContextAttributes())==null?void 0:b.preserveDrawingBuffer)===!1&&w.clear(w.COLOR_BUFFER_BIT)),[4,createImageBitmap(y)]);case 1:return _=k.sent(),u.postMessage({id:B,bitmap:_,width:y.width,height:y.height,dataURLOptions:s.dataURLOptions},[_]),[2]}})})),h=requestAnimationFrame(p)};h=requestAnimationFrame(p),this.resetObservers=function(){a(),cancelAnimationFrame(h)}},e.initCanvasMutationObserver=function(t,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var A=bB(t,r,i,!1),s=CL(this.processMutation.bind(this),t,r,i),o=SL(this.processMutation.bind(this),t,r,i);this.resetObservers=function(){A(),s(),o()}},e.startPendingCanvasMutationFlusher=function(){var t=this;requestAnimationFrame(function(){return t.flushPendingCanvasMutations()})},e.startRAFTimestamping=function(){var t=this,r=function(i){t.rafStamps.latestId=i,requestAnimationFrame(r)};requestAnimationFrame(r)},e.flushPendingCanvasMutations=function(){var t=this;this.pendingCanvasMutations.forEach(function(r,i){var A=t.mirror.getId(i);t.flushPendingCanvasMutationFor(i,A)}),requestAnimationFrame(function(){return t.flushPendingCanvasMutations()})},e.flushPendingCanvasMutationFor=function(t,r){if(!(this.frozen||this.locked)){var i=this.pendingCanvasMutations.get(t);if(!(!i||r===-1)){var A=i.map(function(o){o.type;var a=JA(o,["type"]);return a}),s=i[0].type;this.mutationCb({id:r,type:s,commands:A}),this.pendingCanvasMutations.delete(t)}}},n}(),TL=function(){function n(t){H(this,"trackedLinkElements",new WeakSet),H(this,"mutationCb"),H(this,"adoptedStyleSheetCb"),H(this,"styleMirror",new XM),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}var e=n.prototype;return e.attachLinkElement=function(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)},e.trackLinkElement=function(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))},e.adoptStyleSheets=function(t,r){var i,A=function(){var u=c.value,l=void 0;i.styleMirror.has(u)?l=i.styleMirror.getId(u):(l=i.styleMirror.add(u),o.push({styleId:l,rules:Array.from(u.rules||CSSRule,function(d,h){return{rule:Ky(d,u.href),index:h}})})),s.styleIds.push(l)};if(t.length!==0){for(var s={id:r,styleIds:[]},o=[],a=W(t),c;!(c=a()).done;)i=this,A();o.length>0&&(s.styles=o),this.adoptedStyleSheetCb(s)}},e.reset=function(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet},e.trackStylesheetInLinkElement=function(t){},n}(),IL=function(){function n(){H(this,"nodeMap",new WeakMap),H(this,"active",!1)}var e=n.prototype;return e.inOtherBuffer=function(t,r){var i=this.nodeMap.get(t);return i&&Array.from(i).some(function(A){return A!==r})},e.add=function(t,r){var i=this;this.active||(this.active=!0,requestAnimationFrame(function(){i.nodeMap=new WeakMap,i.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))},e.destroy=function(){},n}(),Ye,bc,Vh,Bc=!1;try{if(Array.from([1],function(n){return n*2})[0]!==2){var Gh=document.createElement("iframe");document.body.appendChild(Gh),Array.from=((Oy=Gh.contentWindow)==null?void 0:Oy.Array.from)||Array.from,document.body.removeChild(Gh)}}catch{}var pn=UR();function _r(n){n===void 0&&(n={});var e=n.emit,t=n.checkoutEveryNms,r=n.checkoutEveryNth,i=n.blockClass,A=i===void 0?"rr-block":i,s=n.blockSelector,o=s===void 0?null:s,a=n.ignoreClass,c=a===void 0?"rr-ignore":a,u=n.ignoreSelector,l=u===void 0?null:u,d=n.maskTextClass,h=d===void 0?"rr-mask":d,f=n.maskTextSelector,p=f===void 0?null:f,g=n.inlineStylesheet,v=g===void 0?!0:g,y=n.maskAllInputs,b=n.maskInputOptions,B=n.slimDOMOptions,w=n.maskInputFn,_=n.maskTextFn,k=n.hooks,T=n.packFn,I=n.sampling,x=I===void 0?{}:I,F=n.dataURLOptions,Q=F===void 0?{}:F,D=n.mousemoveWait,X=n.recordDOM,N=X===void 0?!0:X,q=n.recordCanvas,ge=q===void 0?!1:q,Y=n.recordCrossOriginIframes,re=Y===void 0?!1:Y,xe=n.recordAfter,je=xe===void 0?n.recordAfter==="DOMContentLoaded"?n.recordAfter:"load":xe,be=n.userTriggeredOnInput,dt=be===void 0?!1:be,Qe=n.collectFonts,De=Qe===void 0?!1:Qe,te=n.inlineImages,Ze=te===void 0?!1:te,ye=n.plugins,At=n.keepIframeSrcFn,Ss=At===void 0?function(){return!1}:At,ks=n.ignoreCSSAttributes,Ip=ks===void 0?new Set([]):ks,Lc=n.errorHandler;rL(Lc);var xr=re?window.parent===window:!0,si=!1;if(!xr)try{window.parent.document&&(si=!1)}catch{si=!0}if(xr&&!e)throw new Error("emit function is required");if(!xr&&!si)return function(){};D!==void 0&&x.mousemove===void 0&&(x.mousemove=D),pn.reset();var cA=y===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:b!==void 0?b:{password:!0},Es=B===!0||B==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:B==="all",headMetaDescKeywords:B==="all",headTitleMutations:B==="all"}:B||{};zM();var uA,oi=0,Xn=function(Te){for(var en=W(ye||[]),J;!(J=en()).done;){var We=J.value;We.eventProcessor&&(Te=We.eventProcessor(Te))}return T&&!si&&(Te=T(Te)),Te};Ye=function(Te,en){var J,We=Te;if(We.timestamp=fc(),(J=ei[0])!=null&&J.isFrozen()&&We.type!==ue.FullSnapshot&&!(We.type===ue.IncrementalSnapshot&&We.data.source===z.Mutation)&&ei.forEach(function(ZD){return ZD.unfreeze()}),xr)e==null||e(Xn(We),en);else if(si){var zD={type:"rrweb",event:Xn(We),origin:window.location.origin,isCheckout:en};window.parent.postMessage(zD,"*")}if(We.type===ue.FullSnapshot)uA=We,oi=0;else if(We.type===ue.IncrementalSnapshot){if(We.data.source===z.Mutation&&We.data.isAttachIframe)return;oi++;var XD=r&&oi>=r,YD=t&&We.timestamp-uA.timestamp>t;(XD||YD)&&bc(!0)}};for(var ai=function(Te){Ye({type:ue.IncrementalSnapshot,data:fe({source:z.Mutation},Te)})},DC=function(Te){return Ye({type:ue.IncrementalSnapshot,data:fe({source:z.Scroll},Te)})},HC=function(Te){return Ye({type:ue.IncrementalSnapshot,data:fe({source:z.CanvasMutation},Te)})},qD=function(Te){return Ye({type:ue.IncrementalSnapshot,data:fe({source:z.AdoptedStyleSheet},Te)})},ci=new TL({mutationCb:ai,adoptedStyleSheetCb:qD}),ui=new vL({mirror:pn,mutationCb:ai,stylesheetManager:ci,recordCrossOriginIframes:re,wrappedEmit:Ye}),JD=W(ye||[]),NC;!(NC=JD()).done;){var KC=NC.value;KC.getMirror&&KC.getMirror({nodeMirror:pn,crossOriginIframeMirror:ui.crossOriginIframeMirror,crossOriginIframeStyleMirror:ui.crossOriginIframeStyleMirror})}var Fp=new IL;Vh=new UL({recordCanvas:ge,mutationCb:HC,win:window,blockClass:A,blockSelector:o,mirror:pn,sampling:x.canvas,dataURLOptions:Q});var Dc=new yL({mutationCb:ai,scrollCb:DC,bypassOptions:{blockClass:A,blockSelector:o,maskTextClass:h,maskTextSelector:p,inlineStylesheet:v,maskInputOptions:cA,dataURLOptions:Q,maskTextFn:_,maskInputFn:w,recordCanvas:ge,inlineImages:Ze,sampling:x,slimDOMOptions:Es,iframeManager:ui,stylesheetManager:ci,canvasManager:Vh,keepIframeSrcFn:Ss,processedNodeManager:Fp},mirror:pn});bc=function(Te){if(Te===void 0&&(Te=!1),!!N){Ye({type:ue.Meta,data:{href:window.location.href,width:$b(),height:Zb()}},Te),ci.reset(),Dc.init(),ei.forEach(function(J){return J.lock()});var en=ZR(document,{mirror:pn,blockClass:A,blockSelector:o,maskTextClass:h,maskTextSelector:p,inlineStylesheet:v,maskAllInputs:cA,maskTextFn:_,maskInputFn:w,slimDOM:Es,dataURLOptions:Q,recordCanvas:ge,inlineImages:Ze,onSerialize:function(J){nB(J,pn)&&ui.addIframe(J),rB(J,pn)&&ci.trackLinkElement(J),Nh(J)&&Dc.addShadowRoot(se.shadowRoot(J),document)},onIframeLoad:function(J,We){ui.attachIframe(J,We),Dc.observeAttachShadow(J)},onStylesheetLoad:function(J,We){ci.attachLinkElement(J,We)},keepIframeSrcFn:Ss});if(!en)return console.warn("Failed to snapshot the document");Ye({type:ue.FullSnapshot,data:{node:en,initialOffset:Yb(window)}},Te),ei.forEach(function(J){return J.unlock()}),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ci.adoptStyleSheets(document.adoptedStyleSheets,pn.getId(document))}};try{var Us=[],VC=function(Te){var en;return de(mL)({mutationCb:ai,mousemoveCb:function(J,We){return Ye({type:ue.IncrementalSnapshot,data:{source:We,positions:J}})},mouseInteractionCb:function(J){return Ye({type:ue.IncrementalSnapshot,data:fe({source:z.MouseInteraction},J)})},scrollCb:DC,viewportResizeCb:function(J){return Ye({type:ue.IncrementalSnapshot,data:fe({source:z.ViewportResize},J)})},inputCb:function(J){return Ye({type:ue.IncrementalSnapshot,data:fe({source:z.Input},J)})},mediaInteractionCb:function(J){return Ye({type:ue.IncrementalSnapshot,data:fe({source:z.MediaInteraction},J)})},styleSheetRuleCb:function(J){return Ye({type:ue.IncrementalSnapshot,data:fe({source:z.StyleSheetRule},J)})},styleDeclarationCb:function(J){return Ye({type:ue.IncrementalSnapshot,data:fe({source:z.StyleDeclaration},J)})},canvasMutationCb:HC,fontCb:function(J){return Ye({type:ue.IncrementalSnapshot,data:fe({source:z.Font},J)})},selectionCb:function(J){Ye({type:ue.IncrementalSnapshot,data:fe({source:z.Selection},J)})},customElementCb:function(J){Ye({type:ue.IncrementalSnapshot,data:fe({source:z.CustomElement},J)})},blockClass:A,ignoreClass:c,ignoreSelector:l,maskTextClass:h,maskTextSelector:p,maskInputOptions:cA,inlineStylesheet:v,sampling:x,recordDOM:N,recordCanvas:ge,inlineImages:Ze,userTriggeredOnInput:dt,collectFonts:De,doc:Te,maskInputFn:w,maskTextFn:_,keepIframeSrcFn:Ss,blockSelector:o,slimDOMOptions:Es,dataURLOptions:Q,mirror:pn,iframeManager:ui,stylesheetManager:ci,shadowDomManager:Dc,processedNodeManager:Fp,canvasManager:Vh,ignoreCSSAttributes:Ip,plugins:((en=ye==null?void 0:ye.filter(function(J){return J.observer}))==null?void 0:en.map(function(J){return{observer:J.observer,options:J.options,callback:function(We){return Ye({type:ue.Plugin,data:{plugin:J.name,payload:We}})}}}))||[]},k)};ui.addLoadListener(function(Te){try{Us.push(VC(Te.contentDocument))}catch(en){console.warn(en)}});var xp=function(){bc(),Us.push(VC(document)),Bc=!0};return document.readyState==="interactive"||document.readyState==="complete"?xp():(Us.push(Tt("DOMContentLoaded",function(){Ye({type:ue.DomContentLoaded,data:{}}),je==="DOMContentLoaded"&&xp()})),Us.push(Tt("load",function(){Ye({type:ue.Load,data:{}}),je==="load"&&xp()},window))),function(){Us.forEach(function(Te){return Te()}),Fp.destroy(),Bc=!1,iL()}}catch(Te){console.warn(Te)}}_r.addCustomEvent=function(n,e){if(!Bc)throw new Error("please add custom event after start recording");Ye({type:ue.Custom,data:{tag:n,payload:e}})},_r.freezePage=function(){ei.forEach(function(n){return n.freeze()})},_r.takeFullSnapshot=function(n){if(!Bc)throw new Error("please take full snapshot after start recording");bc(n)},_r.mirror=pn;var SB;(function(n){n[n.NotStarted=0]="NotStarted",n[n.Running=1]="Running",n[n.Stopped=2]="Stopped"})(SB||(SB={})),_r.addCustomEvent,_r.freezePage,_r.takeFullSnapshot;var kB=V.setImmediate,Sr,jh,Wh,EB=Object.prototype.toString,FL=typeof kB<"u"?function(n){return kB(n)}:setTimeout;try{Object.defineProperty({},"x",{}),Sr=function(n,e,t,r){return Object.defineProperty(n,e,{value:t,writable:!0,configurable:r!==!1})}}catch{Sr=function(n,e,t){return n[e]=t,n}}Wh=function(){var n,e,t;function r(i,A){this.fn=i,this.self=A,this.next=void 0}return{add:function(i,A){t=new r(i,A),e?e.next=t:n=t,e=t,t=void 0},drain:function(){var i=n;for(n=e=jh=void 0;i;)i.fn.call(i.self),i=i.next}}}();function Cc(n,e){Wh.add(n,e),jh||(jh=FL(Wh.drain))}function UB(n){var e,t=typeof n;return n!==null&&(t==="object"||t==="function")&&(e=n.then),typeof e=="function"?e:!1}function qh(){for(var n=0;n<this.chain.length;n++)xL(this,this.state===1?this.chain[n].success:this.chain[n].failure,this.chain[n]);this.chain.length=0}function xL(n,e,t){var r,i;try{e===!1?t.reject(n.msg):(e===!0?r=n.msg:r=e.call(void 0,n.msg),r===t.promise?t.reject(TypeError("Promise-chain cycle")):(i=UB(r))?i.call(r,t.resolve,t.reject):t.resolve(r))}catch(A){t.reject(A)}}function TB(n){var e,t=this;if(!t.triggered){t.triggered=!0,t.def&&(t=t.def);try{(e=UB(n))?Cc(function(){var r=new FB(t);try{e.call(n,function(){TB.apply(r,arguments)},function(){ms.apply(r,arguments)})}catch(i){ms.call(r,i)}}):(t.msg=n,t.state=1,t.chain.length>0&&Cc(qh,t))}catch(r){ms.call(new FB(t),r)}}}function ms(n){var e=this;e.triggered||(e.triggered=!0,e.def&&(e=e.def),e.msg=n,e.state=2,e.chain.length>0&&Cc(qh,e))}function IB(n,e,t,r){for(var i=0;i<e.length;i++)(function(A){n.resolve(e[A]).then(function(s){t(A,s)},r)})(i)}function FB(n){this.def=n,this.triggered=!1}function QL(n){this.promise=n,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function kr(n){if(typeof n!="function")throw TypeError("Not a function");if(this.__NPO__!==0)throw TypeError("Not a promise");this.__NPO__=1;var e=new QL(this);this.then=function(t,r){var i={success:typeof t=="function"?t:!0,failure:typeof r=="function"?r:!1};return i.promise=new this.constructor(function(A,s){if(typeof A!="function"||typeof s!="function")throw TypeError("Not a function");i.resolve=A,i.reject=s}),e.chain.push(i),e.state!==0&&Cc(qh,e),i.promise},this.catch=function(t){return this.then(void 0,t)};try{n.call(void 0,function(t){TB.call(e,t)},function(t){ms.call(e,t)})}catch(t){ms.call(e,t)}}var xB=Sr({},"constructor",kr,!1);kr.prototype=xB,Sr(xB,"__NPO__",0,!1),Sr(kr,"resolve",function(n){var e=this;return n&&typeof n=="object"&&n.__NPO__===1?n:new e(function(t,r){if(typeof t!="function"||typeof r!="function")throw TypeError("Not a function");t(n)})}),Sr(kr,"reject",function(n){return new this(function(e,t){if(typeof e!="function"||typeof t!="function")throw TypeError("Not a function");t(n)})}),Sr(kr,"all",function(n){var e=this;return EB.call(n)!=="[object Array]"?e.reject(TypeError("Not an array")):n.length===0?e.resolve([]):new e(function(t,r){if(typeof t!="function"||typeof r!="function")throw TypeError("Not a function");var i=n.length,A=Array(i),s=0;IB(e,n,function(o,a){A[o]=a,++s===i&&t(A)},r)})}),Sr(kr,"race",function(n){var e=this;return EB.call(n)!=="[object Array]"?e.reject(TypeError("Not an array")):new e(function(t,r){if(typeof t!="function"||typeof r!="function")throw TypeError("Not a function");IB(e,n,function(i,A){t(A)},r)})});var we;typeof Promise<"u"&&Promise.toString().indexOf("[native code]")!==-1?we=Promise:we=kr;var fn={DEBUG:!1,LIB_VERSION:"2.68.0"},vs=24*60*60*1e3,Jh=8*1e3,_c=Array.prototype,RL=Function.prototype,QB=Object.prototype,ti=_c.slice,ys=QB.toString,Sc=QB.hasOwnProperty,at=V.console,Er=V.navigator,me=V.document,kc=V.opera,RB=V.screen,Wn=Er.userAgent,zh=RL.bind,PB=_c.forEach,OB=_c.indexOf,MB=_c.map,PL=Array.isArray,Xh={},m={trim:function(n){return n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},ve={log:function(){if(fn.DEBUG&&!m.isUndefined(at)&&at)try{at.log.apply(at,arguments)}catch{m.each(arguments,function(n){at.log(n)})}},warn:function(){if(fn.DEBUG&&!m.isUndefined(at)&&at){var n=["Mixpanel warning:"].concat(m.toArray(arguments));try{at.warn.apply(at,n)}catch{m.each(n,function(e){at.warn(e)})}}},error:function(){if(fn.DEBUG&&!m.isUndefined(at)&&at){var n=["Mixpanel error:"].concat(m.toArray(arguments));try{at.error.apply(at,n)}catch{m.each(n,function(e){at.error(e)})}}},critical:function(){if(!m.isUndefined(at)&&at){var n=["Mixpanel error:"].concat(m.toArray(arguments));try{at.error.apply(at,n)}catch{m.each(n,function(e){at.error(e)})}}}},Yh=function(n,e){return function(){return arguments[0]="["+e+"] "+arguments[0],n.apply(ve,arguments)}},ni=function(n){return{log:Yh(ve.log,n),error:Yh(ve.error,n),critical:Yh(ve.critical,n)}},Zh=function(n){return function(){try{return n.apply(this,arguments)}catch(e){ve.critical("Implementation error. Please turn on debug and contact support@mixpanel.com."),fn.DEBUG&&ve.critical(e)}}},LB=function(n){var e=n.prototype;for(var t in e)typeof e[t]=="function"&&(e[t]=Zh(e[t]))};m.bind=function(n,e){var t,r;if(zh&&n.bind===zh)return zh.apply(n,ti.call(arguments,1));if(!m.isFunction(n))throw new TypeError;return t=ti.call(arguments,2),r=function(){if(!(this instanceof r))return n.apply(e,t.concat(ti.call(arguments)));var i={};i.prototype=n.prototype;var A=new i;i.prototype=null;var s=n.apply(A,t.concat(ti.call(arguments)));return Object(s)===s?s:A},r},m.each=function(n,e,t){if(n!=null){if(PB&&n.forEach===PB)n.forEach(e,t);else if(n.length===+n.length){for(var r=0,i=n.length;r<i;r++)if(r in n&&e.call(t,n[r],r,n)===Xh)return}else for(var A in n)if(Sc.call(n,A)&&e.call(t,n[A],A,n)===Xh)return}},m.extend=function(n){return m.each(ti.call(arguments,1),function(e){for(var t in e)e[t]!==void 0&&(n[t]=e[t])}),n},m.isArray=PL||function(n){return ys.call(n)==="[object Array]"},m.isFunction=function(n){try{return/^\s*\bfunction\b/.test(n)}catch{return!1}},m.isArguments=function(n){return!!(n&&Sc.call(n,"callee"))},m.toArray=function(n){return n?n.toArray?n.toArray():m.isArray(n)||m.isArguments(n)?ti.call(n):m.values(n):[]},m.map=function(n,e,t){if(MB&&n.map===MB)return n.map(e,t);var r=[];return m.each(n,function(i){r.push(e.call(t,i))}),r},m.keys=function(n){var e=[];return n===null||m.each(n,function(t,r){e[e.length]=r}),e},m.values=function(n){var e=[];return n===null||m.each(n,function(t){e[e.length]=t}),e},m.include=function(n,e){var t=!1;return n===null?t:OB&&n.indexOf===OB?n.indexOf(e)!=-1:(m.each(n,function(r){if(t||(t=r===e))return Xh}),t)},m.includes=function(n,e){return n.indexOf(e)!==-1},m.inherit=function(n,e){return n.prototype=new e,n.prototype.constructor=n,n.superclass=e.prototype,n},m.isObject=function(n){return n===Object(n)&&!m.isArray(n)},m.isEmptyObject=function(n){if(m.isObject(n)){for(var e in n)if(Sc.call(n,e))return!1;return!0}return!1},m.isUndefined=function(n){return n===void 0},m.isString=function(n){return ys.call(n)=="[object String]"},m.isDate=function(n){return ys.call(n)=="[object Date]"},m.isNumber=function(n){return ys.call(n)=="[object Number]"},m.isElement=function(n){return!!(n&&n.nodeType===1)},m.encodeDates=function(n){return m.each(n,function(e,t){m.isDate(e)?n[t]=m.formatDate(e):m.isObject(e)&&(n[t]=m.encodeDates(e))}),n},m.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},m.formatDate=function(n){function e(t){return t<10?"0"+t:t}return n.getUTCFullYear()+"-"+e(n.getUTCMonth()+1)+"-"+e(n.getUTCDate())+"T"+e(n.getUTCHours())+":"+e(n.getUTCMinutes())+":"+e(n.getUTCSeconds())},m.strip_empty_properties=function(n){var e={};return m.each(n,function(t,r){m.isString(t)&&t.length>0&&(e[r]=t)}),e},m.truncate=function(n,e){var t;return typeof n=="string"?t=n.slice(0,e):m.isArray(n)?(t=[],m.each(n,function(r){t.push(m.truncate(r,e))})):m.isObject(n)?(t={},m.each(n,function(r,i){t[i]=m.truncate(r,e)})):t=n,t},m.JSONEncode=function(){return function(n){var e=n,t=function(i){var A=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,s={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return A.lastIndex=0,A.test(i)?'"'+i.replace(A,function(o){var a=s[o];return typeof a=="string"?a:"\\u"+("0000"+o.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+i+'"'},r=function(i,A){var s="",o=" ",a=0,c="",u="",l=0,d=s,h=[],f=A[i];switch(f&&typeof f=="object"&&typeof f.toJSON=="function"&&(f=f.toJSON(i)),typeof f){case"string":return t(f);case"number":return isFinite(f)?String(f):"null";case"boolean":case"null":return String(f);case"object":if(!f)return"null";if(s+=o,h=[],ys.apply(f)==="[object Array]"){for(l=f.length,a=0;a<l;a+=1)h[a]=r(a,f)||"null";return u=h.length===0?"[]":s?`[
122
+ `+s+h.join(`,
123
+ `+s)+`
124
+ `+d+"]":"["+h.join(",")+"]",s=d,u}for(c in f)Sc.call(f,c)&&(u=r(c,f),u&&h.push(t(c)+(s?": ":":")+u));return u=h.length===0?"{}":s?"{"+h.join(",")+d+"}":"{"+h.join(",")+"}",s=d,u}};return r("",{"":e})}}(),m.JSONDecode=function(){var n,e,t={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
125
+ `,r:"\r",t:" "},r,i=function(h){var f=new SyntaxError(h);throw f.at=n,f.text=r,f},A=function(h){return h&&h!==e&&i("Expected '"+h+"' instead of '"+e+"'"),e=r.charAt(n),n+=1,e},s=function(){var h,f="";for(e==="-"&&(f="-",A("-"));e>="0"&&e<="9";)f+=e,A();if(e===".")for(f+=".";A()&&e>="0"&&e<="9";)f+=e;if(e==="e"||e==="E")for(f+=e,A(),(e==="-"||e==="+")&&(f+=e,A());e>="0"&&e<="9";)f+=e,A();if(h=+f,!isFinite(h))i("Bad number");else return h},o=function(){var h,f,p="",g;if(e==='"')for(;A();){if(e==='"')return A(),p;if(e==="\\")if(A(),e==="u"){for(g=0,f=0;f<4&&(h=parseInt(A(),16),!!isFinite(h));f+=1)g=g*16+h;p+=String.fromCharCode(g)}else if(typeof t[e]=="string")p+=t[e];else break;else p+=e}i("Bad string")},a=function(){for(;e&&e<=" ";)A()},c=function(){switch(e){case"t":return A("t"),A("r"),A("u"),A("e"),!0;case"f":return A("f"),A("a"),A("l"),A("s"),A("e"),!1;case"n":return A("n"),A("u"),A("l"),A("l"),null}i('Unexpected "'+e+'"')},u,l=function(){var h=[];if(e==="["){if(A("["),a(),e==="]")return A("]"),h;for(;e;){if(h.push(u()),a(),e==="]")return A("]"),h;A(","),a()}}i("Bad array")},d=function(){var h,f={};if(e==="{"){if(A("{"),a(),e==="}")return A("}"),f;for(;e;){if(h=o(),a(),A(":"),Object.hasOwnProperty.call(f,h)&&i('Duplicate key "'+h+'"'),f[h]=u(),a(),e==="}")return A("}"),f;A(","),a()}}i("Bad object")};return u=function(){switch(a(),e){case"{":return d();case"[":return l();case'"':return o();case"-":return s();default:return e>="0"&&e<="9"?s():c()}},function(h){var f;return r=h,n=0,e=" ",f=u(),a(),e&&i("Syntax error"),f}}(),m.base64Encode=function(n){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",t,r,i,A,s,o,a,c,u=0,l=0,d="",h=[];if(!n)return n;n=m.utf8Encode(n);do t=n.charCodeAt(u++),r=n.charCodeAt(u++),i=n.charCodeAt(u++),c=t<<16|r<<8|i,A=c>>18&63,s=c>>12&63,o=c>>6&63,a=c&63,h[l++]=e.charAt(A)+e.charAt(s)+e.charAt(o)+e.charAt(a);while(u<n.length);switch(d=h.join(""),n.length%3){case 1:d=d.slice(0,-2)+"==";break;case 2:d=d.slice(0,-1)+"=";break}return d},m.utf8Encode=function(n){n=(n+"").replace(/\r\n/g,`
126
+ `).replace(/\r/g,`
127
+ `);var e="",t,r,i=0,A;for(t=r=0,i=n.length,A=0;A<i;A++){var s=n.charCodeAt(A),o=null;s<128?r++:s>127&&s<2048?o=String.fromCharCode(s>>6|192,s&63|128):o=String.fromCharCode(s>>12|224,s>>6&63|128,s&63|128),o!==null&&(r>t&&(e+=n.substring(t,r)),e+=o,t=r=A+1)}return r>t&&(e+=n.substring(t,n.length)),e},m.UUID=function(){try{return V.crypto.randomUUID()}catch{for(var n=new Array(36),e=0;e<36;e++)n[e]=Math.floor(Math.random()*16);return n[14]=4,n[19]=n[19]&=-5,n[19]=n[19]|=8,n[8]=n[13]=n[18]=n[23]="-",m.map(n,function(t){return t.toString(16)}).join("")}};var DB=["ahrefsbot","ahrefssiteaudit","amazonbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","facebookexternal","petalbot","pinterest","screaming frog","yahoo! slurp","yandex","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"];m.isBlockedUA=function(n){var e;for(n=n.toLowerCase(),e=0;e<DB.length;e++)if(n.indexOf(DB[e])!==-1)return!0;return!1},m.HTTPBuildQuery=function(n,e){var t,r,i=[];return m.isUndefined(e)&&(e="&"),m.each(n,function(A,s){t=encodeURIComponent(A.toString()),r=encodeURIComponent(s),i[i.length]=r+"="+t}),i.join(e)},m.getQueryParam=function(n,e){e=e.replace(/[[]/g,"\\[").replace(/[\]]/g,"\\]");var t="[\\?&]"+e+"=([^&#]*)",r=new RegExp(t),i=r.exec(n);if(i===null||i&&typeof i[1]!="string"&&i[1].length)return"";var A=i[1];try{A=decodeURIComponent(A)}catch{ve.error("Skipping decoding for malformed query param: "+A)}return A.replace(/\+/g," ")},m.cookie={get:function(n){for(var e=n+"=",t=me.cookie.split(";"),r=0;r<t.length;r++){for(var i=t[r];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(e)===0)return decodeURIComponent(i.substring(e.length,i.length))}return null},parse:function(n){var e;try{e=m.JSONDecode(m.cookie.get(n))||{}}catch{}return e},set_seconds:function(n,e,t,r,i,A,s){var o="",a="",c="";if(s)o="; domain="+s;else if(r){var u=KB(me.location.hostname);o=u?"; domain=."+u:""}if(t){var l=new Date;l.setTime(l.getTime()+t*1e3),a="; expires="+l.toGMTString()}A&&(i=!0,c="; SameSite=None"),i&&(c+="; secure"),me.cookie=n+"="+encodeURIComponent(e)+a+"; path=/"+o+c},set:function(n,e,t,r,i,A,s){var o="",a="",c="";if(s)o="; domain="+s;else if(r){var u=KB(me.location.hostname);o=u?"; domain=."+u:""}if(t){var l=new Date;l.setTime(l.getTime()+t*24*60*60*1e3),a="; expires="+l.toGMTString()}A&&(i=!0,c="; SameSite=None"),i&&(c+="; secure");var d=n+"="+encodeURIComponent(e)+a+"; path=/"+o+c;return me.cookie=d,d},remove:function(n,e,t){m.cookie.set(n,"",-1,e,!1,!1,t)}};var HB=function(n){var e=!0;try{var t="__mplss_"+tp(8),r="xyz";n.setItem(t,r),n.getItem(t)!==r&&(e=!1),n.removeItem(t)}catch{e=!1}return e},$h=null,ws=function(n,e){return $h!==null&&!e?$h:$h=HB(n||V.localStorage)},ep=null,OL=function(n,e){return ep!==null&&!e?ep:ep=HB(n||V.sessionStorage)};function NB(n,e,t){var r=function(i){ve.error(e+" error: "+i)};return{is_supported:function(i){var A=t(n,i);return A||ve.error(e+" unsupported"),A},error:r,get:function(i){try{return n.getItem(i)}catch(A){r(A)}return null},parse:function(i){try{return m.JSONDecode(n.getItem(i))||{}}catch{}return null},set:function(i,A){try{n.setItem(i,A)}catch(s){r(s)}},remove:function(i){try{n.removeItem(i)}catch(A){r(A)}}}}m.localStorage=NB(V.localStorage,"localStorage",ws),m.sessionStorage=NB(V.sessionStorage,"sessionStorage",OL),m.register_event=function(){var n=function(r,i,A,s,o){if(!r){ve.error("No valid element provided to register_event");return}if(r.addEventListener&&!s)r.addEventListener(i,A,!!o);else{var a="on"+i,c=r[a];r[a]=e(r,A,c)}};function e(r,i,A){var s=function(o){if(o=o||t(V.event),!!o){var a=!0,c,u;return m.isFunction(A)&&(c=A(o)),u=i.call(r,o),(c===!1||u===!1)&&(a=!1),a}};return s}function t(r){return r&&(r.preventDefault=t.preventDefault,r.stopPropagation=t.stopPropagation),r}return t.preventDefault=function(){this.returnValue=!1},t.stopPropagation=function(){this.cancelBubble=!0},n}();var ML=new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');m.dom_query=function(){function n(i){return i.all?i.all:i.getElementsByTagName("*")}var e=/[\t\r\n]/g;function t(i,A){var s=" "+A+" ";return(" "+i.className+" ").replace(e," ").indexOf(s)>=0}function r(i){if(!me.getElementsByTagName)return[];var A=i.split(" "),s,o,a,c,u,l,d,h,f,p,g=[me];for(l=0;l<A.length;l++){if(s=A[l].replace(/^\s+/,"").replace(/\s+$/,""),s.indexOf("#")>-1){o=s.split("#"),a=o[0];var v=o[1],y=me.getElementById(v);if(!y||a&&y.nodeName.toLowerCase()!=a)return[];g=[y];continue}if(s.indexOf(".")>-1){o=s.split("."),a=o[0];var b=o[1];for(a||(a="*"),c=[],u=0,d=0;d<g.length;d++)for(a=="*"?f=n(g[d]):f=g[d].getElementsByTagName(a),h=0;h<f.length;h++)c[u++]=f[h];for(g=[],p=0,d=0;d<c.length;d++)c[d].className&&m.isString(c[d].className)&&t(c[d],b)&&(g[p++]=c[d]);continue}var B=s.match(ML);if(B){a=B[1];var w=B[2],_=B[3],k=B[4];for(a||(a="*"),c=[],u=0,d=0;d<g.length;d++)for(a=="*"?f=n(g[d]):f=g[d].getElementsByTagName(a),h=0;h<f.length;h++)c[u++]=f[h];g=[],p=0;var T;switch(_){case"=":T=function(I){return I.getAttribute(w)==k};break;case"~":T=function(I){return I.getAttribute(w).match(new RegExp("\\b"+k+"\\b"))};break;case"|":T=function(I){return I.getAttribute(w).match(new RegExp("^"+k+"-?"))};break;case"^":T=function(I){return I.getAttribute(w).indexOf(k)===0};break;case"$":T=function(I){return I.getAttribute(w).lastIndexOf(k)==I.getAttribute(w).length-k.length};break;case"*":T=function(I){return I.getAttribute(w).indexOf(k)>-1};break;default:T=function(I){return I.getAttribute(w)}}for(g=[],p=0,d=0;d<c.length;d++)T(c[d])&&(g[p++]=c[d]);continue}for(a=s,c=[],u=0,d=0;d<g.length;d++)for(f=g[d].getElementsByTagName(a),h=0;h<f.length;h++)c[u++]=f[h];g=c}return g}return function(i){return m.isElement(i)?[i]:m.isObject(i)&&!m.isUndefined(i.length)?i:r.call(this,i)}}();var LL=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_id","utm_source_platform","utm_campaign_id","utm_creative_format","utm_marketing_tactic"],DL=["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","sccid","ttclid","twclid","wbraid"];m.info={campaignParams:function(n){var e="",t={};return m.each(LL,function(r){e=m.getQueryParam(me.URL,r),e.length?t[r]=e:n!==void 0&&(t[r]=n)}),t},clickParams:function(){var n="",e={};return m.each(DL,function(t){n=m.getQueryParam(me.URL,t),n.length&&(e[t]=n)}),e},marketingParams:function(){return m.extend(m.info.campaignParams(),m.info.clickParams())},searchEngine:function(n){return n.search("https?://(.*)google.([^/?]*)")===0?"google":n.search("https?://(.*)bing.com")===0?"bing":n.search("https?://(.*)yahoo.com")===0?"yahoo":n.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null},searchInfo:function(n){var e=m.info.searchEngine(n),t=e!="yahoo"?"q":"p",r={};if(e!==null){r.$search_engine=e;var i=m.getQueryParam(n,t);i.length&&(r.mp_keyword=i)}return r},browser:function(n,e,t){return e=e||"",t||m.includes(n," OPR/")?m.includes(n,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(n)?"BlackBerry":m.includes(n,"IEMobile")||m.includes(n,"WPDesktop")?"Internet Explorer Mobile":m.includes(n,"SamsungBrowser/")?"Samsung Internet":m.includes(n,"Edge")||m.includes(n,"Edg/")?"Microsoft Edge":m.includes(n,"FBIOS")?"Facebook Mobile":m.includes(n,"Whale/")?"Whale Browser":m.includes(n,"Chrome")?"Chrome":m.includes(n,"CriOS")?"Chrome iOS":m.includes(n,"UCWEB")||m.includes(n,"UCBrowser")?"UC Browser":m.includes(n,"FxiOS")?"Firefox iOS":m.includes(e,"Apple")?m.includes(n,"Mobile")?"Mobile Safari":"Safari":m.includes(n,"Android")?"Android Mobile":m.includes(n,"Konqueror")?"Konqueror":m.includes(n,"Firefox")?"Firefox":m.includes(n,"MSIE")||m.includes(n,"Trident/")?"Internet Explorer":m.includes(n,"Gecko")?"Mozilla":""},browserVersion:function(n,e,t){var r=m.info.browser(n,e,t),i={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/,"Whale Browser":/Whale\/(\d+(\.\d+)?)/},A=i[r];if(A===void 0)return null;var s=n.match(A);return s?parseFloat(s[s.length-2]):null},os:function(){var n=Wn;return/Windows/i.test(n)?/Phone/.test(n)||/WPDesktop/.test(n)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(n)?"iOS":/Android/.test(n)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(n)?"BlackBerry":/Mac/i.test(n)?"Mac OS X":/Linux/.test(n)?"Linux":/CrOS/.test(n)?"Chrome OS":""},device:function(n){return/Windows Phone/i.test(n)||/WPDesktop/.test(n)?"Windows Phone":/iPad/.test(n)?"iPad":/iPod/.test(n)?"iPod Touch":/iPhone/.test(n)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(n)?"BlackBerry":/Android/.test(n)?"Android":""},referringDomain:function(n){var e=n.split("/");return e.length>=3?e[2]:""},currentUrl:function(){return V.location.href},properties:function(n){return typeof n!="object"&&(n={}),m.extend(m.strip_empty_properties({$os:m.info.os(),$browser:m.info.browser(Wn,Er.vendor,kc),$referrer:me.referrer,$referring_domain:m.info.referringDomain(me.referrer),$device:m.info.device(Wn)}),{$current_url:m.info.currentUrl(),$browser_version:m.info.browserVersion(Wn,Er.vendor,kc),$screen_height:RB.height,$screen_width:RB.width,mp_lib:"web",$lib_version:fn.LIB_VERSION,$insert_id:tp(),time:m.timestamp()/1e3},m.strip_empty_properties(n))},people_properties:function(){return m.extend(m.strip_empty_properties({$os:m.info.os(),$browser:m.info.browser(Wn,Er.vendor,kc)}),{$browser_version:m.info.browserVersion(Wn,Er.vendor,kc)})},mpPageViewProperties:function(){return m.strip_empty_properties({current_page_title:me.title,current_domain:V.location.hostname,current_url_path:V.location.pathname,current_url_protocol:V.location.protocol,current_url_search:V.location.search})}};var HL=function(n,e){var t=null,r=[];return function(i){var A=this;return r.push(i),t||(t=new we(function(s){setTimeout(function(){var o=n.apply(A,[r]);t=null,r=[],s(o)},e)})),t}},tp=function(n){var e=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return n?e.substring(0,n):e},NL=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,KL=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,KB=function(n){var e=KL,t=n.split("."),r=t[t.length-1];(r.length>4||r==="com"||r==="org")&&(e=NL);var i=n.match(e);return i?i[0]:""},VL=function(){var n=V.navigator.onLine;return m.isUndefined(n)||n},Ur=function(){},eA=null,Ec=null;typeof JSON<"u"&&(eA=JSON.stringify,Ec=JSON.parse),eA=eA||m.JSONEncode,Ec=Ec||m.JSONDecode,m.info=m.info,m.info.browser=m.info.browser,m.info.browserVersion=m.info.browserVersion,m.info.device=m.info.device,m.info.properties=m.info.properties,m.isBlockedUA=m.isBlockedUA,m.isEmptyObject=m.isEmptyObject,m.isObject=m.isObject,m.JSONDecode=m.JSONDecode,m.JSONEncode=m.JSONEncode,m.toArray=m.toArray,m.NPO=kr;var GL="mixpanelBrowserDb",VB="mixpanelRecordingEvents",np="mixpanelRecordingRegistry",jL=1,WL=[VB,np],Tn=function(n){this.dbPromise=null,this.storeName=n};Tn.prototype._openDb=function(){return new we(function(n,e){var t=V.indexedDB.open(GL,jL);t.onerror=function(){e(t.error)},t.onsuccess=function(){n(t.result)},t.onupgradeneeded=function(r){var i=r.target.result;WL.forEach(function(A){i.createObjectStore(A)})}})},Tn.prototype.init=function(){return V.indexedDB?(this.dbPromise||(this.dbPromise=this._openDb()),this.dbPromise.then(function(n){return n instanceof V.IDBDatabase?we.resolve():we.reject(n)})):we.reject("indexedDB is not supported in this browser")},Tn.prototype.makeTransaction=function(n,e){var t=this.storeName,r=function(i){return new we(function(A,s){var o=i.transaction(t,n);o.oncomplete=function(){A(o)},o.onabort=o.onerror=function(){s(o.error)},e(o.objectStore(t))})};return this.dbPromise.then(r).catch((function(i){return i&&i.name==="InvalidStateError"?(this.dbPromise=this._openDb(),this.dbPromise.then(r)):we.reject(i)}).bind(this))},Tn.prototype.setItem=function(n,e){return this.makeTransaction("readwrite",function(t){t.put(e,n)})},Tn.prototype.getItem=function(n){var e;return this.makeTransaction("readonly",function(t){e=t.get(n)}).then(function(){return e.result})},Tn.prototype.removeItem=function(n){return this.makeTransaction("readwrite",function(e){e.delete(n)})},Tn.prototype.getAll=function(){var n;return this.makeTransaction("readonly",function(e){n=e.getAll()}).then(function(){return n.result})};var qL="__mp_opt_in_out_";function JL(n,e){WB(!0,n,e)}function zL(n,e){WB(!1,n,e)}function XL(n,e){return jB(n,e)==="1"}function GB(n,e){if(ZL(e))return ve.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),!0;var t=jB(n,e)==="0";return t&&ve.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),t}function Tr(n){return Ap(n,function(e){return this.get_config(e)})}function Ir(n){return Ap(n,function(e){return this._get_config(e)})}function tA(n){return Ap(n,function(e){return this._get_config(e)})}function YL(n,e){e=e||{},rp(e).remove(ip(n,e),!!e.crossSubdomainCookie,e.cookieDomain)}function rp(n){return n=n||{},n.persistenceType==="localStorage"?m.localStorage:m.cookie}function ip(n,e){return e=e||{},(e.persistencePrefix||qL)+n}function jB(n,e){return rp(e).get(ip(n,e))}function ZL(n){if(n&&n.ignoreDnt)return!1;var e=n&&n.window||V,t=e.navigator||{},r=!1;return m.each([t.doNotTrack,t.msDoNotTrack,e.doNotTrack],function(i){m.includes([!0,1,"1","yes"],i)&&(r=!0)}),r}function WB(n,e,t){if(!m.isString(e)||!e.length){ve.error("gdpr."+(n?"optIn":"optOut")+" called with an invalid token");return}t=t||{},rp(t).set(ip(e,t),n?1:0,m.isNumber(t.cookieExpiration)?t.cookieExpiration:null,!!t.crossSubdomainCookie,!!t.secureCookie,!!t.crossSiteCookie,t.cookieDomain),t.track&&n&&t.track(t.trackEventName||"$opt_in",t.trackProperties,{send_immediately:!0})}function Ap(n,e){return function(){var t=!1;try{var r=e.call(this,"token"),i=e.call(this,"ignore_dnt"),A=e.call(this,"opt_out_tracking_persistence_type"),s=e.call(this,"opt_out_tracking_cookie_prefix"),o=e.call(this,"window");r&&(t=GB(r,{ignoreDnt:i,persistenceType:A,persistencePrefix:s,window:o}))}catch(c){ve.error("Unexpected error when checking tracking opt-out status: "+c)}if(!t)return n.apply(this,arguments);var a=arguments[arguments.length-1];typeof a=="function"&&a(0)}}var $L=ni("lock"),qB=function(n,e){e=e||{},this.storageKey=n,this.storage=e.storage||V.localStorage,this.pollIntervalMS=e.pollIntervalMS||100,this.timeoutMS=e.timeoutMS||2e3,this.promiseImpl=e.promiseImpl||we};qB.prototype.withLock=function(n,e){var t=this.promiseImpl;return new t(m.bind(function(r,i){var A=e||new Date().getTime()+"|"+Math.random(),s=new Date().getTime(),o=this.storageKey,a=this.pollIntervalMS,c=this.timeoutMS,u=this.storage,l=o+":X",d=o+":Y",h=o+":Z",f=function(b){if(new Date().getTime()-s>c){$L.error("Timeout waiting for mutex on "+o+"; clearing lock. ["+A+"]"),u.removeItem(h),u.removeItem(d),v();return}setTimeout(function(){try{b()}catch(B){i(B)}},a*(Math.random()+.1))},p=function(b,B){b()?B():f(function(){p(b,B)})},g=function(){var b=u.getItem(d);return b&&b!==A?!1:(u.setItem(d,A),u.getItem(d)===A?!0:(ws(u,!0)||i(new Error("localStorage support dropped while acquiring lock")),!1))},v=function(){u.setItem(l,A),p(g,function(){if(u.getItem(l)===A){y();return}f(function(){if(u.getItem(d)!==A){v();return}p(function(){return!u.getItem(h)},y)})})},y=function(){u.setItem(h,"1");var b=function(){u.removeItem(h),u.getItem(d)===A&&u.removeItem(d),u.getItem(l)===A&&u.removeItem(l)};n().then(function(B){b(),r(B)}).catch(function(B){b(),i(B)})};try{if(ws(u,!0))v();else throw new Error("localStorage support check failed")}catch(b){i(b)}},this))};var bs=function(n){this.storage=n||V.localStorage};bs.prototype.init=function(){return we.resolve()},bs.prototype.setItem=function(n,e){return new we(m.bind(function(t,r){try{this.storage.setItem(n,eA(e))}catch(i){r(i)}t()},this))},bs.prototype.getItem=function(n){return new we(m.bind(function(e,t){var r;try{r=Ec(this.storage.getItem(n))}catch(i){t(i)}e(r)},this))},bs.prototype.removeItem=function(n){return new we(m.bind(function(e,t){try{this.storage.removeItem(n)}catch(r){t(r)}e()},this))};var JB=ni("batch"),In=function(n,e){e=e||{},this.storageKey=n,this.usePersistence=e.usePersistence,this.usePersistence&&(this.queueStorage=e.queueStorage||new bs,this.lock=new qB(n,{storage:e.sharedLockStorage||V.localStorage,timeoutMS:e.sharedLockTimeoutMS})),this.reportError=e.errorReporter||m.bind(JB.error,JB),this.pid=e.pid||null,this.memQueue=[],this.initialized=!1,e.enqueueThrottleMs?this.enqueuePersisted=HL(m.bind(this._enqueuePersisted,this),e.enqueueThrottleMs):this.enqueuePersisted=m.bind(function(t){return this._enqueuePersisted([t])},this)};In.prototype.ensureInit=function(){return this.initialized?we.resolve():this.queueStorage.init().then(m.bind(function(){this.initialized=!0},this)).catch(m.bind(function(n){this.reportError("Error initializing queue persistence. Disabling persistence",n),this.initialized=!0,this.usePersistence=!1},this))},In.prototype.enqueue=function(n,e){var t={id:tp(),flushAfter:new Date().getTime()+e*2,payload:n};return this.usePersistence?this.enqueuePersisted(t):(this.memQueue.push(t),we.resolve(!0))},In.prototype._enqueuePersisted=function(n){var e=m.bind(function(){return this.ensureInit().then(m.bind(function(){return this.readFromStorage()},this)).then(m.bind(function(t){return this.saveToStorage(t.concat(n))},this)).then(m.bind(function(t){return t&&(this.memQueue=this.memQueue.concat(n)),t},this)).catch(m.bind(function(t){return this.reportError("Error enqueueing items",t,n),!1},this))},this);return this.lock.withLock(e,this.pid).catch(m.bind(function(t){return this.reportError("Error acquiring storage lock",t),!1},this))},In.prototype.fillBatch=function(n){var e=this.memQueue.slice(0,n);return this.usePersistence&&e.length<n?this.ensureInit().then(m.bind(function(){return this.readFromStorage()},this)).then(m.bind(function(t){if(t.length){var r={};m.each(e,function(s){r[s.id]=!0});for(var i=0;i<t.length;i++){var A=t[i];if(new Date().getTime()>A.flushAfter&&!r[A.id]&&(A.orphaned=!0,e.push(A),e.length>=n))break}}return e},this)):we.resolve(e)};var zB=function(n,e){var t=[];return m.each(n,function(r){r.id&&!e[r.id]&&t.push(r)}),t};In.prototype.removeItemsByID=function(n){var e={};if(m.each(n,function(r){e[r]=!0}),this.memQueue=zB(this.memQueue,e),this.usePersistence){var t=m.bind(function(){return this.ensureInit().then(m.bind(function(){return this.readFromStorage()},this)).then(m.bind(function(r){return r=zB(r,e),this.saveToStorage(r)},this)).then(m.bind(function(){return this.readFromStorage()},this)).then(m.bind(function(r){for(var i=0;i<r.length;i++){var A=r[i];if(A.id&&e[A.id])throw new Error("Item not removed from storage")}return!0},this)).catch(m.bind(function(r){return this.reportError("Error removing items",r,n),!1},this))},this);return this.lock.withLock(t,this.pid).catch(m.bind(function(r){return this.reportError("Error acquiring storage lock",r),ws(this.lock.storage,!0)?!1:t().then(m.bind(function(i){return i||this.queueStorage.removeItem(this.storageKey).then(function(){return i})},this)).catch(m.bind(function(i){return this.reportError("Error clearing queue",i),!1},this))},this))}else return we.resolve(!0)};var XB=function(n,e){var t=[];return m.each(n,function(r){var i=r.id;if(i in e){var A=e[i];A!==null&&(r.payload=A,t.push(r))}else t.push(r)}),t};In.prototype.updatePayloads=function(n){return this.memQueue=XB(this.memQueue,n),this.usePersistence?this.lock.withLock(m.bind(function(){return this.ensureInit().then(m.bind(function(){return this.readFromStorage()},this)).then(m.bind(function(e){return e=XB(e,n),this.saveToStorage(e)},this)).catch(m.bind(function(e){return this.reportError("Error updating items",n,e),!1},this))},this),this.pid).catch(m.bind(function(e){return this.reportError("Error acquiring storage lock",e),!1},this)):we.resolve(!0)},In.prototype.readFromStorage=function(){return this.ensureInit().then(m.bind(function(){return this.queueStorage.getItem(this.storageKey)},this)).then(m.bind(function(n){return n&&(m.isArray(n)||(this.reportError("Invalid storage entry:",n),n=null)),n||[]},this)).catch(m.bind(function(n){return this.reportError("Error retrieving queue",n),[]},this))},In.prototype.saveToStorage=function(n){return this.ensureInit().then(m.bind(function(){return this.queueStorage.setItem(this.storageKey,n)},this)).then(function(){return!0}).catch(m.bind(function(e){return this.reportError("Error saving queue",e),!1},this))},In.prototype.clear=function(){return this.memQueue=[],this.usePersistence?this.ensureInit().then(m.bind(function(){return this.queueStorage.removeItem(this.storageKey)},this)):we.resolve()};var eD=10*60*1e3,Bs=ni("batch"),Zt=function(n,e){this.errorReporter=e.errorReporter,this.queue=new In(n,{errorReporter:m.bind(this.reportError,this),queueStorage:e.queueStorage,sharedLockStorage:e.sharedLockStorage,sharedLockTimeoutMS:e.sharedLockTimeoutMS,usePersistence:e.usePersistence,enqueueThrottleMs:e.enqueueThrottleMs}),this.libConfig=e.libConfig,this.sendRequest=e.sendRequestFunc,this.beforeSendHook=e.beforeSendHook,this.stopAllBatching=e.stopAllBatchingFunc,this.batchSize=this.libConfig.batch_size,this.flushInterval=this.libConfig.batch_flush_interval_ms,this.stopped=!this.libConfig.batch_autostart,this.consecutiveRemovalFailures=0,this.itemIdsSentSuccessfully={},this.flushOnlyOnInterval=e.flushOnlyOnInterval||!1,this._flushPromise=null};Zt.prototype.enqueue=function(n){return this.queue.enqueue(n,this.flushInterval)},Zt.prototype.start=function(){return this.stopped=!1,this.consecutiveRemovalFailures=0,this.flush()},Zt.prototype.stop=function(){this.stopped=!0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=null)},Zt.prototype.clear=function(){return this.queue.clear()},Zt.prototype.resetBatchSize=function(){this.batchSize=this.libConfig.batch_size},Zt.prototype.resetFlush=function(){this.scheduleFlush(this.libConfig.batch_flush_interval_ms)},Zt.prototype.scheduleFlush=function(n){this.flushInterval=n,this.stopped||(this.timeoutID=setTimeout(m.bind(function(){this.stopped||(this._flushPromise=this.flush())},this),this.flushInterval))},Zt.prototype.sendRequestPromise=function(n,e){return new we(m.bind(function(t){this.sendRequest(n,e,t)},this))},Zt.prototype.flush=function(n){if(this.requestInProgress)return Bs.log("Flush: Request already in progress"),we.resolve();this.requestInProgress=!0,n=n||{};var e=this.libConfig.batch_request_timeout_ms,t=new Date().getTime(),r=this.batchSize;return this.queue.fillBatch(r).then(m.bind(function(i){var A=i.length===r,s=[],o={};if(m.each(i,function(l){var d=l.payload;if(this.beforeSendHook&&!l.orphaned&&(d=this.beforeSendHook(d)),d){d.event&&d.properties&&(d.properties=m.extend({},d.properties,{mp_sent_by_lib_version:fn.LIB_VERSION}));var h=!0,f=l.id;f?(this.itemIdsSentSuccessfully[f]||0)>5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:l,batchSize:i.length,timesSent:this.itemIdsSentSuccessfully[f]}),h=!1):this.reportError("[dupe] found item with no ID",{item:l}),h&&s.push(d)}o[l.id]=d},this),s.length<1)return this.requestInProgress=!1,this.resetFlush(),we.resolve();var a=m.bind(function(){return this.queue.removeItemsByID(m.map(i,function(l){return l.id})).then(m.bind(function(l){return m.each(i,m.bind(function(d){var h=d.id;h?(this.itemIdsSentSuccessfully[h]=this.itemIdsSentSuccessfully[h]||0,this.itemIdsSentSuccessfully[h]++,this.itemIdsSentSuccessfully[h]>5&&this.reportError("[dupe] item ID sent too many times",{item:d,batchSize:i.length,timesSent:this.itemIdsSentSuccessfully[h]})):this.reportError("[dupe] found item with no ID while removing",{item:d})},this)),l?(this.consecutiveRemovalFailures=0,this.flushOnlyOnInterval&&!A?(this.resetFlush(),we.resolve()):this.flush()):(++this.consecutiveRemovalFailures>5?(this.reportError("Too many queue failures; disabling batching system."),this.stopAllBatching()):this.resetFlush(),we.resolve())},this))},this),c=m.bind(function(l){this.requestInProgress=!1;try{if(n.unloading)return this.queue.updatePayloads(o);if(m.isObject(l)&&l.error==="timeout"&&new Date().getTime()-t>=e)return this.reportError("Network timeout; retrying"),this.flush();if(m.isObject(l)&&(l.httpStatusCode>=500||l.httpStatusCode===429||l.httpStatusCode<=0&&!VL()||l.error==="timeout")){var d=this.flushInterval*2;return l.retryAfter&&(d=parseInt(l.retryAfter,10)*1e3||d),d=Math.min(eD,d),this.reportError("Error; retry in "+d+" ms"),this.scheduleFlush(d),we.resolve()}else if(m.isObject(l)&&l.httpStatusCode===413)if(i.length>1){var h=Math.max(1,Math.floor(r/2));return this.batchSize=Math.min(this.batchSize,h,i.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush(),we.resolve()}else return this.reportError("Single-event request too large; dropping",i),this.resetBatchSize(),a();else return a()}catch(f){this.reportError("Error handling API response",f),this.resetFlush()}},this),u={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:e};return n.unloading&&(u.transport="sendBeacon"),Bs.log("MIXPANEL REQUEST:",s),this.sendRequestPromise(s,u).then(c)},this)).catch(m.bind(function(i){this.reportError("Error flushing request queue",i),this.resetFlush()},this))},Zt.prototype.reportError=function(n,e){if(Bs.error.apply(Bs.error,arguments),this.errorReporter)try{e instanceof Error||(e=new Error(n)),this.errorReporter(n,e)}catch(t){Bs.error(t)}};var sp=function(n){var e=Date.now();return!n||e>n.maxExpires||e>n.idleExpires},tD=250,nA=ni("recorder"),YB=V.CompressionStream,nD={batch_size:1e3,batch_flush_interval_ms:10*1e3,batch_request_timeout_ms:90*1e3,batch_autostart:!0},rD=new Set([z.MouseMove,z.MouseInteraction,z.Scroll,z.ViewportResize,z.Input,z.TouchMove,z.MediaInteraction,z.Drag,z.Selection]);function iD(n){return n.type===ue.IncrementalSnapshot&&rD.has(n.data.source)}var bt=function(n){this._mixpanel=n.mixpanelInstance,this._onIdleTimeout=n.onIdleTimeout||Ur,this._onMaxLengthReached=n.onMaxLengthReached||Ur,this._onBatchSent=n.onBatchSent||Ur,this._rrwebRecord=n.rrwebRecord||null,this._stopRecording=null,this.replayId=n.replayId,this.batchStartUrl=n.batchStartUrl||null,this.replayStartUrl=n.replayStartUrl||null,this.idleExpires=n.idleExpires||null,this.maxExpires=n.maxExpires||null,this.replayStartTime=n.replayStartTime||null,this.seqNo=n.seqNo||0,this.idleTimeoutId=null,this.maxTimeoutId=null,this.recordMaxMs=vs,this.recordMinMs=0;var e=ws(n.sharedLockStorage,!0);this.batcherKey="__mprec_"+this.getConfig("name")+"_"+this.getConfig("token")+"_"+this.replayId,this.queueStorage=new Tn(VB),this.batcher=new Zt(this.batcherKey,{errorReporter:this.reportError.bind(this),flushOnlyOnInterval:!0,libConfig:nD,sendRequestFunc:this.flushEventsWithOptOut.bind(this),queueStorage:this.queueStorage,sharedLockStorage:n.sharedLockStorage,usePersistence:e,stopAllBatchingFunc:this.stopRecording.bind(this),enqueueThrottleMs:tD,sharedLockTimeoutMS:10*1e3})};bt.prototype.getUserIdInfo=function(){if(this.finalFlushUserIdInfo)return this.finalFlushUserIdInfo;var n={distinct_id:String(this._mixpanel.get_distinct_id())},e=this._mixpanel.get_property("$device_id");e&&(n.$device_id=e);var t=this._mixpanel.get_property("$user_id");return t&&(n.$user_id=t),n},bt.prototype.unloadPersistedData=function(){return this.batcher.stop(),this.batcher.flush().then((function(){return this.queueStorage.removeItem(this.batcherKey)}).bind(this))},bt.prototype.getConfig=function(n){return this._mixpanel.get_config(n)},bt.prototype.get_config=function(n){return this.getConfig(n)},bt.prototype.startRecording=function(n){if(this._rrwebRecord===null){this.reportError("rrweb record function not provided. ");return}if(this._stopRecording!==null){nA.log("Recording already in progress, skipping startRecording.");return}this.recordMaxMs=this.getConfig("record_max_ms"),this.recordMaxMs>vs&&(this.recordMaxMs=vs,nA.critical("record_max_ms cannot be greater than "+vs+"ms. Capping value.")),this.maxExpires||(this.maxExpires=new Date().getTime()+this.recordMaxMs),this.recordMinMs=this.getConfig("record_min_ms"),this.recordMinMs>Jh&&(this.recordMinMs=Jh,nA.critical("record_min_ms cannot be greater than "+Jh+"ms. Capping value.")),this.replayStartTime||(this.replayStartTime=new Date().getTime(),this.batchStartUrl=m.info.currentUrl(),this.replayStartUrl=m.info.currentUrl()),n||this.recordMinMs>0?this.batcher.stop():this.batcher.start();var e=(function(){clearTimeout(this.idleTimeoutId);var i=this.getConfig("record_idle_timeout_ms");this.idleTimeoutId=setTimeout(this._onIdleTimeout,i),this.idleExpires=new Date().getTime()+i}).bind(this);e();var t=this.getConfig("record_block_selector");(t===""||t===null)&&(t=void 0);try{this._stopRecording=this._rrwebRecord({emit:(function(i){if(this.idleExpires&&this.idleExpires<i.timestamp){this._onIdleTimeout();return}iD(i)&&(this.batcher.stopped&&new Date().getTime()-this.replayStartTime>=this.recordMinMs&&this.batcher.start(),e()),this.__enqueuePromise=this.batcher.enqueue(i)}).bind(this),blockClass:this.getConfig("record_block_class"),blockSelector:t,collectFonts:this.getConfig("record_collect_fonts"),dataURLOptions:{type:"image/webp",quality:.6},maskAllInputs:!0,maskTextClass:this.getConfig("record_mask_text_class"),maskTextSelector:this.getConfig("record_mask_text_selector"),recordCanvas:this.getConfig("record_canvas"),sampling:{canvas:15}})}catch(i){this.reportError("Unexpected error when starting rrweb recording.",i)}if(typeof this._stopRecording!="function"){this.reportError("rrweb failed to start, skipping this recording."),this._stopRecording=null,this.stopRecording();return}var r=this.maxExpires-new Date().getTime();this.maxTimeoutId=setTimeout(this._onMaxLengthReached.bind(this),r)},bt.prototype.stopRecording=function(n){if(this.finalFlushUserIdInfo=this.getUserIdInfo(),!this.isRrwebStopped()){try{this._stopRecording()}catch(t){this.reportError("Error with rrweb stopRecording",t)}this._stopRecording=null}var e;return this.batcher.stopped?e=this.batcher.clear():n||(e=this.batcher.flush()),this.batcher.stop(),clearTimeout(this.idleTimeoutId),clearTimeout(this.maxTimeoutId),e},bt.prototype.isRrwebStopped=function(){return this._stopRecording===null},bt.prototype.flushEventsWithOptOut=function(n,e,t){var r=(function(i){i===0&&(this.stopRecording(),t({error:"Tracking has been opted out, stopping recording."}))}).bind(this);this._flushEvents(n,e,t,r)},bt.prototype.serialize=function(){var n;try{n=this._mixpanel.get_tab_id()}catch(e){this.reportError("Error getting tab ID for serialization ",e),n=null}return{replayId:this.replayId,seqNo:this.seqNo,replayStartTime:this.replayStartTime,batchStartUrl:this.batchStartUrl,replayStartUrl:this.replayStartUrl,idleExpires:this.idleExpires,maxExpires:this.maxExpires,tabId:n}},bt.deserialize=function(n,e){var t=new bt(m.extend({},e,{replayId:n.replayId,batchStartUrl:n.batchStartUrl,replayStartUrl:n.replayStartUrl,idleExpires:n.idleExpires,maxExpires:n.maxExpires,replayStartTime:n.replayStartTime,seqNo:n.seqNo,sharedLockStorage:e.sharedLockStorage}));return t},bt.prototype._sendRequest=function(n,e,t,r){var i=(function(s,o){s.status===200&&this.replayId===n&&(this.seqNo++,this.batchStartUrl=m.info.currentUrl()),this._onBatchSent(),r({status:0,httpStatusCode:s.status,responseBody:o,retryAfter:s.headers.get("Retry-After")})}).bind(this),A=this._mixpanel.get_api_host&&this._mixpanel.get_api_host("record")||this.getConfig("api_host");V.fetch(A+"/"+this.getConfig("api_routes").record+"?"+new URLSearchParams(e),{method:"POST",headers:{Authorization:"Basic "+btoa(this.getConfig("token")+":"),"Content-Type":"application/octet-stream"},body:t}).then(function(s){s.json().then(function(o){i(s,o)}).catch(function(o){r({error:o})})}).catch(function(s){r({error:s,httpStatusCode:0})})},bt.prototype._flushEvents=Tr(function(n,e,t){var r=n.length;if(r>0){for(var i=this.replayId,A=1/0,s=-1/0,o=!1,a=0;a<r;a++)A=Math.min(A,n[a].timestamp),s=Math.max(s,n[a].timestamp),n[a].type===ue.FullSnapshot&&(o=!0);if(this.seqNo===0){if(!o){t({error:"First batch does not contain a full snapshot. Aborting recording."}),this.stopRecording(!0);return}this.replayStartTime=A}else this.replayStartTime||(this.reportError("Replay start time not set but seqNo is not 0. Using current batch start time as a fallback."),this.replayStartTime=A);var c=s-this.replayStartTime,u={$current_url:this.batchStartUrl,$lib_version:fn.LIB_VERSION,batch_start_time:A/1e3,mp_lib:"web",replay_id:i,replay_length_ms:c,replay_start_time:this.replayStartTime/1e3,replay_start_url:this.replayStartUrl,seq:this.seqNo},l=JSON.stringify(n);if(Object.assign(u,this.getUserIdInfo()),YB){var d=new Blob([l],{type:"application/json"}).stream(),h=d.pipeThrough(new YB("gzip"));new Response(h).blob().then((function(f){u.format="gzip",this._sendRequest(i,u,f,t)}).bind(this))}else u.format="body",this._sendRequest(i,u,l,t)}}),bt.prototype.reportError=function(n,e){nA.error.apply(nA.error,arguments);try{!e&&!(n instanceof Error)&&(n=new Error(n)),this.getConfig("error_reporter")(n,e)}catch(t){nA.error(t)}};var rA=function(n){this.idb=new Tn(np),this.errorReporter=n.errorReporter,this.mixpanelInstance=n.mixpanelInstance,this.sharedLockStorage=n.sharedLockStorage};rA.prototype.handleError=function(n){this.errorReporter("IndexedDB error: ",n)},rA.prototype.setActiveRecording=function(n){var e=n.tabId;return e?this.idb.init().then((function(){return this.idb.setItem(e,n)}).bind(this)).catch(this.handleError.bind(this)):(console.warn("No tab ID is set, cannot persist recording metadata."),we.resolve())},rA.prototype.getActiveRecording=function(){return this.idb.init().then((function(){return this.idb.getItem(this.mixpanelInstance.get_tab_id())}).bind(this)).then((function(n){return sp(n)?null:n}).bind(this)).catch(this.handleError.bind(this))},rA.prototype.clearActiveRecording=function(){return this.getActiveRecording().then((function(n){if(n)return n.maxExpires=0,this.setActiveRecording(n)}).bind(this)).catch(this.handleError.bind(this))},rA.prototype.flushInactiveRecordings=function(){return this.idb.init().then((function(){return this.idb.getAll()}).bind(this)).then((function(n){var e=n.filter(function(t){return sp(t)}).map((function(t){var r=bt.deserialize(t,{mixpanelInstance:this.mixpanelInstance,sharedLockStorage:this.sharedLockStorage});return r.unloadPersistedData().then((function(){return this.idb.removeItem(t.tabId)}).bind(this)).catch(this.handleError.bind(this))}).bind(this));return we.all(e)}).bind(this)).catch(this.handleError.bind(this))};var Cs=ni("recorder"),qn=function(n,e,t){this.mixpanelInstance=n,this.rrwebRecord=e||_r,this.sharedLockStorage=t,this.recordingRegistry=new rA({mixpanelInstance:this.mixpanelInstance,errorReporter:Cs.error,sharedLockStorage:t}),this._flushInactivePromise=this.recordingRegistry.flushInactiveRecordings(),this.activeRecording=null,this.stopRecordingInProgress=!1};qn.prototype.startRecording=function(n){if(n=n||{},this.activeRecording&&!this.activeRecording.isRrwebStopped()){Cs.log("Recording already in progress, skipping startRecording.");return}var e=(function(){Cs.log("Idle timeout reached, restarting recording."),this.resetRecording()}).bind(this),t=(function(){Cs.log("Max recording length reached, stopping recording."),this.resetRecording()}).bind(this),r=(function(){this.recordingRegistry.setActiveRecording(this.activeRecording.serialize()),this.__flushPromise=this.activeRecording.batcher._flushPromise}).bind(this),i={mixpanelInstance:this.mixpanelInstance,onBatchSent:r,onIdleTimeout:e,onMaxLengthReached:t,replayId:m.UUID(),rrwebRecord:this.rrwebRecord,sharedLockStorage:this.sharedLockStorage};return n.activeSerializedRecording?this.activeRecording=bt.deserialize(n.activeSerializedRecording,i):this.activeRecording=new bt(i),this.activeRecording.startRecording(n.shouldStopBatcher),this.recordingRegistry.setActiveRecording(this.activeRecording.serialize())},qn.prototype.stopRecording=function(){return this.stopRecordingInProgress=!0,this._stopCurrentRecording(!1,!0).then((function(){return this.recordingRegistry.clearActiveRecording()}).bind(this)).then((function(){this.stopRecordingInProgress=!1}).bind(this))},qn.prototype.pauseRecording=function(){return this._stopCurrentRecording(!1)},qn.prototype._stopCurrentRecording=function(n,e){if(this.activeRecording){var t=this.activeRecording.stopRecording(n);return e&&(this.activeRecording=null),t}return we.resolve()},qn.prototype.resumeRecording=function(n){return this.activeRecording&&this.activeRecording.isRrwebStopped()?(this.activeRecording.startRecording(!1),we.resolve(null)):this.recordingRegistry.getActiveRecording().then((function(e){return e&&!this.stopRecordingInProgress?this.startRecording({activeSerializedRecording:e}):n?this.startRecording({shouldStopBatcher:!1}):(Cs.log("No resumable recording found."),null)}).bind(this))},qn.prototype.resetRecording=function(){this.stopRecording(),this.startRecording({shouldStopBatcher:!0})},qn.prototype.getActiveReplayId=function(){return this.activeRecording&&!this.activeRecording.isRrwebStopped()?this.activeRecording.replayId:null},Object.defineProperty(qn.prototype,"replayId",{get:function(){return this.getActiveReplayId()}}),V.__mp_recorder=qn;var Uc="change",ri="click",ZB="hashchange",iA="mp_locationchange",$B="popstate",eC="scrollend",op="submit",AD=["clientX","clientY","offsetX","offsetY","pageX","pageY","screenX","screenY","x","y"],tC=["mp-include"],ap=["mp-no-track"],nC=ap.concat(["mp-sensitive"]),sD=["aria-label","aria-labelledby","aria-describedby","href","name","role","title","type"],Ft=ni("autocapture");function cp(n){for(var e={},t=rC(n).split(" "),r=0;r<t.length;r++){var i=t[r];i&&(e[i]=!0)}return e}function rC(n){switch(typeof n.className){case"string":return n.className;case"object":return n.className.baseVal||n.getAttribute("class")||"";default:return""}}function oD(n){if(n.previousElementSibling)return n.previousElementSibling;do n=n.previousSibling;while(n&&!sC(n));return n}function iC(n,e,t,r,i,A){var s={$classes:rC(n).split(" "),$tag_name:n.tagName.toLowerCase()},o=n.id;o&&(s.$id=o),dp(n,e,i,A)&&m.each(sD.concat(r),function(l){if(n.hasAttribute(l)&&!t[l]){var d=n.getAttribute(l);Tc(d)&&(s["$attr-"+l]=d)}});for(var a=1,c=1,u=n;u=oD(u);)a++,u.tagName===n.tagName&&c++;return s.$nth_child=a,s.$nth_of_type=c,s}function aD(n,e){var t=e.allowElementCallback,r=e.allowSelectors||[],i=e.blockAttrs||[],A=e.blockElementCallback,s=e.blockSelectors||[],o=e.captureTextContent||!1,a=e.captureExtraAttrs||[],c=e.capturedForHeatMap||!1,u={};m.each(i,function(w){u[w]=!0});var l=null,d=typeof n.target>"u"?n.srcElement:n.target;if(oC(d)&&(d=d.parentNode),lD(d,n)&&up(d,n,t,r)&&!lp(d,n,A,s)){for(var h=[d],f=d;f.parentNode&&!Fn(f,"body");)h.push(f.parentNode),f=f.parentNode;var p=[],g,v=!1;if(m.each(h,function(w){var _=dp(w,n,t,r);!u.href&&w.tagName.toLowerCase()==="a"&&(g=w.getAttribute("href"),g=_&&Tc(g)&&g),lp(w,n,A,s)&&(v=!0),p.push(iC(w,n,u,a,t,r))},this),!v){var y=me.documentElement;if(l={$event_type:n.type,$host:V.location.host,$pathname:V.location.pathname,$elements:p,$el_attr__href:g,$viewportHeight:Math.max(y.clientHeight,V.innerHeight||0),$viewportWidth:Math.max(y.clientWidth,V.innerWidth||0),$pageHeight:me.body.offsetHeight||0,$pageWidth:me.body.offsetWidth||0},m.each(a,function(w){if(!u[w]&&d.hasAttribute(w)){var _=d.getAttribute(w);Tc(_)&&(l["$el_attr__"+w]=_)}}),o&&(b=AC(d,n,t,r),b&&b.length&&(l.$el_text=b)),n.type===ri&&(m.each(AD,function(w){w in n&&(l["$"+w]=n[w])}),c&&(l.$captured_for_heatmap=!0),d=cD(n)),o){var b=AC(d,n,t,r);b&&b.length&&(l.$el_text=b)}if(d){if(!up(d,n,t,r)||lp(d,n,A,s))return null;var B=iC(d,n,u,a,t,r);l.$target=B,l.$el_classes=B.$classes,m.extend(l,m.strip_empty_properties({$el_id:B.$id,$el_tag_name:B.$tag_name}))}}}return l}function AC(n,e,t,r){var i="";return dp(n,e,t,r)&&n.childNodes&&n.childNodes.length&&m.each(n.childNodes,function(A){oC(A)&&A.textContent&&(i+=m.trim(A.textContent).split(/(\s+)/).filter(Tc).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))}),m.trim(i)}function cD(n){for(var e=n.target,t=n.composedPath(),r=0;r<t.length;r++){var i=t[r];if(Fn(i,"a")||Fn(i,"button")||Fn(i,"input")||Fn(i,"select")||i.getAttribute&&i.getAttribute("role")==="button"){e=i;break}if(i===e)break}return e}function up(n,e,t,r){if(t)try{if(!t(n,e))return!1}catch(s){return Ft.critical("Error while checking element in allowElementCallback",s),!1}if(!r.length)return!0;for(var i=0;i<r.length;i++){var A=r[i];try{if(n.matches(A))return!0}catch(s){Ft.critical("Error while checking selector: "+A,s)}}return!1}function lp(n,e,t,r){var i;if(t)try{if(t(n,e))return!0}catch(o){return Ft.critical("Error while checking element in blockElementCallback",o),!0}if(r&&r.length)for(i=0;i<r.length;i++){var A=r[i];try{if(n.matches(A))return!0}catch(o){Ft.critical("Error while checking selector: "+A,o)}}var s=cp(n);for(i=0;i<ap.length;i++)if(s[ap[i]])return!0;return!1}function sC(n){return n&&n.nodeType===1}function Fn(n,e){return n&&n.tagName&&n.tagName.toLowerCase()===e.toLowerCase()}function oC(n){return n&&n.nodeType===3}function uD(){try{var n=me.createElement("div");return!!n.matches}catch{return!1}}function lD(n,e){if(!n||Fn(n,"html")||!sC(n))return!1;var t=n.tagName.toLowerCase();switch(t){case"form":return e.type===op;case"input":return["button","submit"].indexOf(n.getAttribute("type"))===-1?e.type===Uc:e.type===ri;case"select":case"textarea":return e.type===Uc;default:return e.type===ri}}function dp(n,e,t,r){var i;if(!up(n,e,t,r))return!1;for(var A=n;A.parentNode&&!Fn(A,"body");A=A.parentNode){var s=cp(A);for(i=0;i<nC.length;i++)if(s[nC[i]])return!1}var o=cp(n);for(i=0;i<tC.length;i++)if(o[tC[i]])return!0;if(Fn(n,"input")||Fn(n,"select")||Fn(n,"textarea")||n.getAttribute("contenteditable")==="true")return!1;var a=n.type||"";if(typeof a=="string")switch(a.toLowerCase()){case"hidden":return!1;case"password":return!1}var c=n.name||n.id||"";if(typeof c=="string"){var u=/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i;if(u.test(c.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function Tc(n){if(n===null||m.isUndefined(n))return!1;if(typeof n=="string"){n=m.trim(n);var e=/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/;if(e.test((n||"").replace(/[- ]/g,"")))return!1;var t=/(^\d{3}-?\d{2}-?\d{4}$)/;if(t.test(n))return!1}return!0}var dD=30,hD=1e3,pD=4;function aC(){this.clicks=[]}aC.prototype.isRageClick=function(n,e,t){t=t||{};var r=t.threshold_px||dD,i=t.timeout_ms||hD,A=t.click_count||pD,s=Date.now(),o=this.clicks[this.clicks.length-1];if(o&&s-o.timestamp<i&&Math.sqrt(Math.pow(n-o.x,2)+Math.pow(e-o.y,2))<r){if(this.clicks.push({x:n,y:e,timestamp:s}),this.clicks.length>=A)return this.clicks=[],!0}else this.clicks=[{x:n,y:e,timestamp:s}];return!1};var cC="autocapture",fD="track_pageview",uC="full-url",gD="url-with-path-and-query-string",mD="url-with-path",vD="allow_element_callback",lC="allow_selectors",dC="allow_url_regexes",hC="block_attrs",pC="block_element_callback",fC="block_selectors",gC="block_url_regexes",mC="capture_extra_attrs",vC="capture_text_content",yC="scroll_capture_all",wC="scroll_depth_percent_checkpoints",Ic="click",hp="input",bC="pageview",BC="rage_click",pp="scroll",fp="submit",ft={};ft[lC]=[],ft[dC]=[],ft[hC]=[],ft[pC]=null,ft[fC]=[],ft[gC]=[],ft[mC]=[],ft[vC]=!1,ft[yC]=!1,ft[wC]=[25,50,75,100],ft[Ic]=!0,ft[hp]=!0,ft[bC]=uC,ft[BC]=!0,ft[pp]=!0,ft[fp]=!0;var Fc={$mp_autocapture:!0},CC="$mp_click",yD="$mp_input_change",_C="$mp_rage_click",wD="$mp_scroll",bD="$mp_submit",xt=function(n){this.mp=n};xt.prototype.init=function(){if(!uD()){Ft.critical("Autocapture unavailable: missing required DOM APIs");return}this.initPageviewTracking(),this.initClickTracking(),this.initInputTracking(),this.initScrollTracking(),this.initSubmitTracking(),this.initRageClickTracking()},xt.prototype.getFullConfig=function(){var n=this.mp.get_config(cC);return n?m.isObject(n)?m.extend({},ft,n):ft:{}},xt.prototype.getConfig=function(n){return this.getFullConfig()[n]},xt.prototype.currentUrlBlocked=function(){var n,e=m.info.currentUrl(),t=this.getConfig(dC)||[];if(t.length){var r=!1;for(n=0;n<t.length;n++){var i=t[n];try{if(e.match(i)){r=!0;break}}catch(s){return Ft.critical("Error while checking block URL regex: "+i,s),!0}}if(!r)return!0}var A=this.getConfig(gC)||[];if(!A||!A.length)return!1;for(n=0;n<A.length;n++)try{if(e.match(A[n]))return!0}catch(s){return Ft.critical("Error while checking block URL regex: "+A[n],s),!0}return!1},xt.prototype.pageviewTrackingConfig=function(){return this.mp.get_config(cC)?this.getConfig(bC):this.mp.get_config(fD)},xt.prototype.trackDomEvent=function(n,e){if(!this.currentUrlBlocked()){var t=this.mp.is_recording_heatmap_data()&&(e===CC&&!this.getConfig(Ic)||e===_C&&!this._getRageClickConfig()),r=aD(n,{allowElementCallback:this.getConfig(vD),allowSelectors:this.getConfig(lC),blockAttrs:this.getConfig(hC),blockElementCallback:this.getConfig(pC),blockSelectors:this.getConfig(fC),captureExtraAttrs:this.getConfig(mC),captureTextContent:this.getConfig(vC),capturedForHeatMap:t});r&&(m.extend(r,Fc),this.mp.track(e,r))}},xt.prototype._getRageClickConfig=function(){var n=this.getConfig(BC);return n?n===!0?{}:typeof n=="object"?n:{}:null},xt.prototype.initClickTracking=function(){V.removeEventListener(ri,this.listenerClick),!(!this.getConfig(Ic)&&!this.mp.get_config("record_heatmap_data"))&&(Ft.log("Initializing click tracking"),this.listenerClick=V.addEventListener(ri,(function(n){!this.getConfig(Ic)&&!this.mp.is_recording_heatmap_data()||this.trackDomEvent(n,CC)}).bind(this)))},xt.prototype.initInputTracking=function(){V.removeEventListener(Uc,this.listenerChange),this.getConfig(hp)&&(Ft.log("Initializing input tracking"),this.listenerChange=V.addEventListener(Uc,(function(n){this.getConfig(hp)&&this.trackDomEvent(n,yD)}).bind(this)))},xt.prototype.initPageviewTracking=function(){if(V.removeEventListener($B,this.listenerPopstate),V.removeEventListener(ZB,this.listenerHashchange),V.removeEventListener(iA,this.listenerLocationchange),!!this.pageviewTrackingConfig()){Ft.log("Initializing pageview tracking");var n="",e=!1;this.currentUrlBlocked()||(e=this.mp.track_pageview(Fc)),e&&(n=m.info.currentUrl()),this.listenerPopstate=V.addEventListener($B,function(){V.dispatchEvent(new Event(iA))}),this.listenerHashchange=V.addEventListener(ZB,function(){V.dispatchEvent(new Event(iA))});var t=V.history.pushState;typeof t=="function"&&(V.history.pushState=function(i,A,s){t.call(V.history,i,A,s),V.dispatchEvent(new Event(iA))});var r=V.history.replaceState;typeof r=="function"&&(V.history.replaceState=function(i,A,s){r.call(V.history,i,A,s),V.dispatchEvent(new Event(iA))}),this.listenerLocationchange=V.addEventListener(iA,Zh((function(){if(!this.currentUrlBlocked()){var i=m.info.currentUrl(),A=!1,s=i.split("#")[0].split("?")[0]!==n.split("#")[0].split("?")[0],o=this.pageviewTrackingConfig();if(o===uC?A=i!==n:o===gD?A=i.split("#")[0]!==n.split("#")[0]:o===mD&&(A=s),A){var a=this.mp.track_pageview(Fc);a&&(n=i),s&&(this.lastScrollCheckpoint=0,Ft.log("Path change: re-initializing scroll depth checkpoints"))}}}).bind(this)))}},xt.prototype.initRageClickTracking=function(){V.removeEventListener(ri,this.listenerRageClick);var n=this._getRageClickConfig();!n&&!this.mp.get_config("record_heatmap_data")||(Ft.log("Initializing rage click tracking"),this._rageClickTracker||(this._rageClickTracker=new aC),this.listenerRageClick=(function(e){var t=this._getRageClickConfig();!t&&!this.mp.is_recording_heatmap_data()||this.currentUrlBlocked()||this._rageClickTracker.isRageClick(e.pageX,e.pageY,t)&&this.trackDomEvent(e,_C)}).bind(this),V.addEventListener(ri,this.listenerRageClick))},xt.prototype.initScrollTracking=function(){V.removeEventListener(eC,this.listenerScroll),this.getConfig(pp)&&(Ft.log("Initializing scroll tracking"),this.lastScrollCheckpoint=0,this.listenerScroll=V.addEventListener(eC,Zh((function(){if(this.getConfig(pp)&&!this.currentUrlBlocked()){var n=this.getConfig(yC),e=(this.getConfig(wC)||[]).slice().sort(function(a,c){return a-c}),t=V.scrollY,r=m.extend({$scroll_top:t},Fc);try{var i=me.body.scrollHeight,A=Math.round(t/(i-V.innerHeight)*100);if(r.$scroll_height=i,r.$scroll_percentage=A,A>this.lastScrollCheckpoint)for(var s=0;s<e.length;s++){var o=e[s];A>=o&&this.lastScrollCheckpoint<o&&(r.$scroll_checkpoint=o,this.lastScrollCheckpoint=o,n=!0)}}catch(a){Ft.critical("Error while calculating scroll percentage",a)}n&&this.mp.track(wD,r)}}).bind(this))))},xt.prototype.initSubmitTracking=function(){V.removeEventListener(op,this.listenerSubmit),this.getConfig(fp)&&(Ft.log("Initializing submit tracking"),this.listenerSubmit=V.addEventListener(op,(function(n){this.getConfig(fp)&&this.trackDomEvent(n,bD)}).bind(this)))},LB(xt);var BD=V.fetch,Qt=ni("flags"),xc="flags",Qc="context",gp={};gp[Qc]={};var oe=function(n){this.getFullApiRoute=n.getFullApiRoute,this.getMpConfig=n.getConfigFunc,this.setMpConfig=n.setConfigFunc,this.getMpProperty=n.getPropertyFunc,this.track=n.trackingFunc};oe.prototype.init=function(){if(!CD()){Qt.critical("Feature Flags unavailable: missing minimum required APIs");return}this.flags=null,this.fetchFlags(),this.trackedFeatures=new Set},oe.prototype.getFullConfig=function(){var n=this.getMpConfig(xc);return n?m.isObject(n)?m.extend({},gp,n):gp:{}},oe.prototype.getConfig=function(n){return this.getFullConfig()[n]},oe.prototype.isSystemEnabled=function(){return!!this.getMpConfig(xc)},oe.prototype.updateContext=function(n,e){if(!this.isSystemEnabled())return Qt.critical("Feature Flags not enabled, cannot update context"),Promise.resolve();var t=this.getMpConfig(xc);m.isObject(t)||(t={});var r=e&&e.replace?{}:this.getConfig(Qc);return t[Qc]=m.extend({},r,n),this.setMpConfig(xc,t),this.fetchFlags()},oe.prototype.areFlagsReady=function(){return this.isSystemEnabled()||Qt.error("Feature Flags not enabled"),!!this.flags},oe.prototype.fetchFlags=function(){if(!this.isSystemEnabled())return Promise.resolve();var n=this.getMpProperty("distinct_id"),e=this.getMpProperty("$device_id");Qt.log("Fetching flags for distinct ID: "+n);var t={context:m.extend({distinct_id:n,device_id:e},this.getConfig(Qc))};return this._fetchInProgressStartTime=Date.now(),this.fetchPromise=V.fetch(this.getFullApiRoute(),{method:"POST",headers:{Authorization:"Basic "+btoa(this.getMpConfig("token")+":"),"Content-Type":"application/octet-stream"},body:JSON.stringify(t)}).then((function(r){return this.markFetchComplete(),r.json().then((function(i){var A=i.flags;if(!A)throw new Error("No flags in API response");var s=new Map;m.each(A,function(o,a){s.set(a,{key:o.variant_key,value:o.variant_value})}),this.flags=s}).bind(this)).catch((function(i){this.markFetchComplete(),Qt.error(i)}).bind(this))}).bind(this)).catch((function(r){this.markFetchComplete(),Qt.error(r)}).bind(this)),this.fetchPromise},oe.prototype.markFetchComplete=function(){if(!this._fetchInProgressStartTime){Qt.error("Fetch in progress started time not set, cannot mark fetch complete");return}this._fetchStartTime=this._fetchInProgressStartTime,this._fetchCompleteTime=Date.now(),this._fetchLatency=this._fetchCompleteTime-this._fetchStartTime,this._fetchInProgressStartTime=null},oe.prototype.getVariant=function(n,e){return this.fetchPromise?this.fetchPromise.then((function(){return this.getVariantSync(n,e)}).bind(this)).catch(function(t){return Qt.error(t),e}):new Promise(function(t){Qt.critical("Feature Flags not initialized"),t(e)})},oe.prototype.getVariantSync=function(n,e){if(!this.areFlagsReady())return Qt.log("Flags not loaded yet"),e;var t=this.flags.get(n);return t?(this.trackFeatureCheck(n,t),t):(Qt.log('No flag found: "'+n+'"'),e)},oe.prototype.getVariantValue=function(n,e){return this.getVariant(n,{value:e}).then(function(t){return t.value}).catch(function(t){return Qt.error(t),e})},oe.prototype.getFeatureData=function(n,e){return Qt.critical("mixpanel.flags.get_feature_data() is deprecated and will be removed in a future release. Use mixpanel.flags.get_variant_value() instead."),this.getVariantValue(n,e)},oe.prototype.getVariantValueSync=function(n,e){return this.getVariantSync(n,{value:e}).value},oe.prototype.isEnabled=function(n,e){return this.getVariantValue(n).then((function(){return this.isEnabledSync(n,e)}).bind(this)).catch(function(t){return Qt.error(t),e})},oe.prototype.isEnabledSync=function(n,e){e=e||!1;var t=this.getVariantValueSync(n,e);return t!==!0&&t!==!1&&(Qt.error('Feature flag "'+n+'" value: '+t+" is not a boolean; returning fallback value: "+e),t=e),t},oe.prototype.trackFeatureCheck=function(n,e){this.trackedFeatures.has(n)||(this.trackedFeatures.add(n),this.track("$experiment_started",{"Experiment name":n,"Variant name":e.key,$experiment_type:"feature_flag","Variant fetch start time":new Date(this._fetchStartTime).toISOString(),"Variant fetch complete time":new Date(this._fetchCompleteTime).toISOString(),"Variant fetch latency (ms)":this._fetchLatency}))};function CD(){return!!BD&&typeof Promise<"u"&&typeof Map<"u"&&typeof Set<"u"}LB(oe),oe.prototype.are_flags_ready=oe.prototype.areFlagsReady,oe.prototype.get_variant=oe.prototype.getVariant,oe.prototype.get_variant_sync=oe.prototype.getVariantSync,oe.prototype.get_variant_value=oe.prototype.getVariantValue,oe.prototype.get_variant_value_sync=oe.prototype.getVariantValueSync,oe.prototype.is_enabled=oe.prototype.isEnabled,oe.prototype.is_enabled_sync=oe.prototype.isEnabledSync,oe.prototype.update_context=oe.prototype.updateContext,oe.prototype.get_feature_data=oe.prototype.getFeatureData;var Jn=function(){};Jn.prototype.create_properties=function(){},Jn.prototype.event_handler=function(){},Jn.prototype.after_track_handler=function(){},Jn.prototype.init=function(n){return this.mp=n,this},Jn.prototype.track=function(n,e,t,r){var i=this,A=m.dom_query(n);if(A.length===0){ve.error("The DOM query ("+n+") returned 0 elements");return}return m.each(A,function(s){m.register_event(s,this.override_event,function(o){var a={},c=i.create_properties(t,this),u=i.mp.get_config("track_links_timeout");i.event_handler(o,this,a),window.setTimeout(i.track_callback(r,c,a,!0),u),i.mp.track(e,c,i.track_callback(r,c,a))})},this),!0},Jn.prototype.track_callback=function(n,e,t,r){r=r||!1;var i=this;return function(){t.callback_fired||(t.callback_fired=!0,!(n&&n(r,e)===!1)&&i.after_track_handler(e,t,r))}},Jn.prototype.create_properties=function(n,e){var t;return typeof n=="function"?t=n(e):t=m.extend({},n),t};var AA=function(){this.override_event="click"};m.inherit(AA,Jn),AA.prototype.create_properties=function(n,e){var t=AA.superclass.create_properties.apply(this,arguments);return e.href&&(t.url=e.href),t},AA.prototype.event_handler=function(n,e,t){t.new_tab=n.which===2||n.metaKey||n.ctrlKey||e.target==="_blank",t.href=e.href,t.new_tab||n.preventDefault()},AA.prototype.after_track_handler=function(n,e){e.new_tab||setTimeout(function(){window.location=e.href},0)};var Rc=function(){this.override_event="submit"};m.inherit(Rc,Jn),Rc.prototype.event_handler=function(n,e,t){t.element=e,n.preventDefault()},Rc.prototype.after_track_handler=function(n,e){setTimeout(function(){e.element.submit()},0)};var Fr="$set",sA="$set_once",gn="$unset",ii="$add",xn="$append",Ai="$union",zn="$remove",_D="$delete",SC={set_action:function(n,e){var t={},r={};return m.isObject(n)?m.each(n,function(i,A){this._is_reserved_property(A)||(r[A]=i)},this):r[n]=e,t[Fr]=r,t},unset_action:function(n){var e={},t=[];return m.isArray(n)||(n=[n]),m.each(n,function(r){this._is_reserved_property(r)||t.push(r)},this),e[gn]=t,e},set_once_action:function(n,e){var t={},r={};return m.isObject(n)?m.each(n,function(i,A){this._is_reserved_property(A)||(r[A]=i)},this):r[n]=e,t[sA]=r,t},union_action:function(n,e){var t={},r={};return m.isObject(n)?m.each(n,function(i,A){this._is_reserved_property(A)||(r[A]=m.isArray(i)?i:[i])},this):r[n]=m.isArray(e)?e:[e],t[Ai]=r,t},append_action:function(n,e){var t={},r={};return m.isObject(n)?m.each(n,function(i,A){this._is_reserved_property(A)||(r[A]=i)},this):r[n]=e,t[xn]=r,t},remove_action:function(n,e){var t={},r={};return m.isObject(n)?m.each(n,function(i,A){this._is_reserved_property(A)||(r[A]=i)},this):r[n]=e,t[zn]=r,t},delete_action:function(){var n={};return n[_D]="",n}},Le=function(){};m.extend(Le.prototype,SC),Le.prototype._init=function(n,e,t){this._mixpanel=n,this._group_key=e,this._group_id=t},Le.prototype.set=tA(function(n,e,t){var r=this.set_action(n,e);return m.isObject(n)&&(t=e),this._send_request(r,t)}),Le.prototype.set_once=tA(function(n,e,t){var r=this.set_once_action(n,e);return m.isObject(n)&&(t=e),this._send_request(r,t)}),Le.prototype.unset=tA(function(n,e){var t=this.unset_action(n);return this._send_request(t,e)}),Le.prototype.union=tA(function(n,e,t){m.isObject(n)&&(t=e);var r=this.union_action(n,e);return this._send_request(r,t)}),Le.prototype.delete=tA(function(n){var e=this.delete_action();return this._send_request(e,n)}),Le.prototype.remove=tA(function(n,e,t){var r=this.remove_action(n,e);return this._send_request(r,t)}),Le.prototype._send_request=function(n,e){n.$group_key=this._group_key,n.$group_id=this._group_id,n.$token=this._get_config("token");var t=m.encodeDates(n);return this._mixpanel._track_or_batch({type:"groups",data:t,endpoint:this._mixpanel.get_api_host("groups")+"/"+this._get_config("api_routes").groups,batcher:this._mixpanel.request_batchers.groups},e)},Le.prototype._is_reserved_property=function(n){return n==="$group_key"||n==="$group_id"},Le.prototype._get_config=function(n){return this._mixpanel.get_config(n)},Le.prototype.toString=function(){return this._mixpanel.toString()+".group."+this._group_key+"."+this._group_id},Le.prototype.remove=Le.prototype.remove,Le.prototype.set=Le.prototype.set,Le.prototype.set_once=Le.prototype.set_once,Le.prototype.union=Le.prototype.union,Le.prototype.unset=Le.prototype.unset,Le.prototype.toString=Le.prototype.toString;var Z=function(){};m.extend(Z.prototype,SC),Z.prototype._init=function(n){this._mixpanel=n},Z.prototype.set=Ir(function(n,e,t){var r=this.set_action(n,e);return m.isObject(n)&&(t=e),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),r[Fr]=m.extend({},m.info.people_properties(),r[Fr]),this._send_request(r,t)}),Z.prototype.set_once=Ir(function(n,e,t){var r=this.set_once_action(n,e);return m.isObject(n)&&(t=e),this._send_request(r,t)}),Z.prototype.unset=Ir(function(n,e){var t=this.unset_action(n);return this._send_request(t,e)}),Z.prototype.increment=Ir(function(n,e,t){var r={},i={};return m.isObject(n)?(m.each(n,function(A,s){if(!this._is_reserved_property(s))if(isNaN(parseFloat(A))){ve.error("Invalid increment value passed to mixpanel.people.increment - must be a number");return}else i[s]=A},this),t=e):(m.isUndefined(e)&&(e=1),i[n]=e),r[ii]=i,this._send_request(r,t)}),Z.prototype.append=Ir(function(n,e,t){m.isObject(n)&&(t=e);var r=this.append_action(n,e);return this._send_request(r,t)}),Z.prototype.remove=Ir(function(n,e,t){m.isObject(n)&&(t=e);var r=this.remove_action(n,e);return this._send_request(r,t)}),Z.prototype.union=Ir(function(n,e,t){m.isObject(n)&&(t=e);var r=this.union_action(n,e);return this._send_request(r,t)}),Z.prototype.track_charge=Ir(function(){ve.error("mixpanel.people.track_charge() is deprecated and no longer has any effect.")}),Z.prototype.clear_charges=function(n){return this.set("$transactions",[],n)},Z.prototype.delete_user=function(){if(!this._identify_called()){ve.error("mixpanel.people.delete_user() requires you to call identify() first");return}var n={$delete:this._mixpanel.get_distinct_id()};return this._send_request(n)},Z.prototype.toString=function(){return this._mixpanel.toString()+".people"},Z.prototype._send_request=function(n,e){n.$token=this._get_config("token"),n.$distinct_id=this._mixpanel.get_distinct_id();var t=this._mixpanel.get_property("$device_id"),r=this._mixpanel.get_property("$user_id"),i=this._mixpanel.get_property("$had_persisted_distinct_id");t&&(n.$device_id=t),r&&(n.$user_id=r),i&&(n.$had_persisted_distinct_id=i);var A=m.encodeDates(n);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:A,endpoint:this._mixpanel.get_api_host("people")+"/"+this._get_config("api_routes").engage,batcher:this._mixpanel.request_batchers.people},e):(this._enqueue(n),m.isUndefined(e)||(this._get_config("verbose")?e({status:-1,error:null}):e(-1)),m.truncate(A,255))},Z.prototype._get_config=function(n){return this._mixpanel.get_config(n)},Z.prototype._identify_called=function(){return this._mixpanel._flags.identify_called===!0},Z.prototype._enqueue=function(n){Fr in n?this._mixpanel.persistence._add_to_people_queue(Fr,n):sA in n?this._mixpanel.persistence._add_to_people_queue(sA,n):gn in n?this._mixpanel.persistence._add_to_people_queue(gn,n):ii in n?this._mixpanel.persistence._add_to_people_queue(ii,n):xn in n?this._mixpanel.persistence._add_to_people_queue(xn,n):zn in n?this._mixpanel.persistence._add_to_people_queue(zn,n):Ai in n?this._mixpanel.persistence._add_to_people_queue(Ai,n):ve.error("Invalid call to _enqueue():",n)},Z.prototype._flush_one_queue=function(n,e,t,r){var i=this,A=m.extend({},this._mixpanel.persistence.load_queue(n)),s=A;!m.isUndefined(A)&&m.isObject(A)&&!m.isEmptyObject(A)&&(i._mixpanel.persistence._pop_from_people_queue(n,A),i._mixpanel.persistence.save(),r&&(s=r(A)),e.call(i,s,function(o,a){o===0&&i._mixpanel.persistence._add_to_people_queue(n,A),m.isUndefined(t)||t(o,a)}))},Z.prototype._flush=function(n,e,t,r,i,A,s){var o=this;this._flush_one_queue(Fr,this.set,n),this._flush_one_queue(sA,this.set_once,r),this._flush_one_queue(gn,this.unset,A,function(g){return m.keys(g)}),this._flush_one_queue(ii,this.increment,e),this._flush_one_queue(Ai,this.union,i);var a=this._mixpanel.persistence.load_queue(xn);if(!m.isUndefined(a)&&m.isArray(a)&&a.length)for(var c,u=function(g,v){g===0&&o._mixpanel.persistence._add_to_people_queue(xn,c),m.isUndefined(t)||t(g,v)},l=a.length-1;l>=0;l--)a=this._mixpanel.persistence.load_queue(xn),c=a.pop(),o._mixpanel.persistence.save(),m.isEmptyObject(c)||o.append(c,u);var d=this._mixpanel.persistence.load_queue(zn);if(!m.isUndefined(d)&&m.isArray(d)&&d.length)for(var h,f=function(g,v){g===0&&o._mixpanel.persistence._add_to_people_queue(zn,h),m.isUndefined(s)||s(g,v)},p=d.length-1;p>=0;p--)d=this._mixpanel.persistence.load_queue(zn),h=d.pop(),o._mixpanel.persistence.save(),m.isEmptyObject(h)||o.remove(h,f)},Z.prototype._is_reserved_property=function(n){return n==="$distinct_id"||n==="$token"||n==="$device_id"||n==="$user_id"||n==="$had_persisted_distinct_id"},Z.prototype.set=Z.prototype.set,Z.prototype.set_once=Z.prototype.set_once,Z.prototype.unset=Z.prototype.unset,Z.prototype.increment=Z.prototype.increment,Z.prototype.append=Z.prototype.append,Z.prototype.remove=Z.prototype.remove,Z.prototype.union=Z.prototype.union,Z.prototype.track_charge=Z.prototype.track_charge,Z.prototype.clear_charges=Z.prototype.clear_charges,Z.prototype.delete_user=Z.prototype.delete_user,Z.prototype.toString=Z.prototype.toString;var mp="__mps",vp="__mpso",yp="__mpus",wp="__mpa",bp="__mpap",Bp="__mpr",Cp="__mpu",kC="$people_distinct_id",Pc="__alias",_s="__timers",SD=[mp,vp,yp,wp,bp,Bp,Cp,kC,Pc,_s],ne=function(n){this.props={},this.campaign_params_saved=!1,n.persistence_name?this.name="mp_"+n.persistence_name:this.name="mp_"+n.token+"_mixpanel";var e=n.persistence;e!=="cookie"&&e!=="localStorage"&&(ve.critical("Unknown persistence type "+e+"; falling back to cookie"),e=n.persistence="cookie"),e==="localStorage"&&m.localStorage.is_supported()?this.storage=m.localStorage:this.storage=m.cookie,this.load(),this.update_config(n),this.upgrade(),this.save()};ne.prototype.properties=function(){var n={};return this.load(),m.each(this.props,function(e,t){m.include(SD,t)||(n[t]=e)}),n},ne.prototype.load=function(){if(!this.disabled){var n=this.storage.parse(this.name);n&&(this.props=m.extend({},n))}},ne.prototype.upgrade=function(){var n,e;this.storage===m.localStorage?(n=m.cookie.parse(this.name),m.cookie.remove(this.name),m.cookie.remove(this.name,!0),n&&this.register_once(n)):this.storage===m.cookie&&(e=m.localStorage.parse(this.name),m.localStorage.remove(this.name),e&&this.register_once(e))},ne.prototype.save=function(){this.disabled||this.storage.set(this.name,eA(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)},ne.prototype.load_prop=function(n){return this.load(),this.props[n]},ne.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)},ne.prototype.clear=function(){this.remove(),this.props={}},ne.prototype.register_once=function(n,e,t){return m.isObject(n)?(typeof e>"u"&&(e="None"),this.expire_days=typeof t>"u"?this.default_expiry:t,this.load(),m.each(n,function(r,i){(!this.props.hasOwnProperty(i)||this.props[i]===e)&&(this.props[i]=r)},this),this.save(),!0):!1},ne.prototype.register=function(n,e){return m.isObject(n)?(this.expire_days=typeof e>"u"?this.default_expiry:e,this.load(),m.extend(this.props,n),this.save(),!0):!1},ne.prototype.unregister=function(n){this.load(),n in this.props&&(delete this.props[n],this.save())},ne.prototype.update_search_keyword=function(n){this.register(m.info.searchInfo(n))},ne.prototype.update_referrer_info=function(n){this.register_once({$initial_referrer:n||"$direct",$initial_referring_domain:m.info.referringDomain(n)||"$direct"},"")},ne.prototype.get_referrer_info=function(){return m.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})},ne.prototype.update_config=function(n){this.default_expiry=this.expire_days=n.cookie_expiration,this.set_disabled(n.disable_persistence),this.set_cookie_domain(n.cookie_domain),this.set_cross_site(n.cross_site_cookie),this.set_cross_subdomain(n.cross_subdomain_cookie),this.set_secure(n.secure_cookie)},ne.prototype.set_disabled=function(n){this.disabled=n,this.disabled?this.remove():this.save()},ne.prototype.set_cookie_domain=function(n){n!==this.cookie_domain&&(this.remove(),this.cookie_domain=n,this.save())},ne.prototype.set_cross_site=function(n){n!==this.cross_site&&(this.cross_site=n,this.remove(),this.save())},ne.prototype.set_cross_subdomain=function(n){n!==this.cross_subdomain&&(this.cross_subdomain=n,this.remove(),this.save())},ne.prototype.get_cross_subdomain=function(){return this.cross_subdomain},ne.prototype.set_secure=function(n){n!==this.secure&&(this.secure=!!n,this.remove(),this.save())},ne.prototype._add_to_people_queue=function(n,e){var t=this._get_queue_key(n),r=e[n],i=this._get_or_create_queue(Fr),A=this._get_or_create_queue(sA),s=this._get_or_create_queue(gn),o=this._get_or_create_queue(ii),a=this._get_or_create_queue(Ai),c=this._get_or_create_queue(zn,[]),u=this._get_or_create_queue(xn,[]);t===mp?(m.extend(i,r),this._pop_from_people_queue(ii,r),this._pop_from_people_queue(Ai,r),this._pop_from_people_queue(gn,r)):t===vp?(m.each(r,function(l,d){d in A||(A[d]=l)}),this._pop_from_people_queue(gn,r)):t===yp?m.each(r,function(l){m.each([i,A,o,a],function(d){l in d&&delete d[l]}),m.each(u,function(d){l in d&&delete d[l]}),s[l]=!0}):t===wp?(m.each(r,function(l,d){d in i?i[d]+=l:(d in o||(o[d]=0),o[d]+=l)},this),this._pop_from_people_queue(gn,r)):t===Cp?(m.each(r,function(l,d){m.isArray(l)&&(d in a||(a[d]=[]),m.each(l,function(h){m.include(a[d],h)||a[d].push(h)}))}),this._pop_from_people_queue(gn,r)):t===Bp?(c.push(r),this._pop_from_people_queue(xn,r)):t===bp&&(u.push(r),this._pop_from_people_queue(gn,r)),ve.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),ve.log(e),this.save()},ne.prototype._pop_from_people_queue=function(n,e){var t=this.props[this._get_queue_key(n)];m.isUndefined(t)||m.each(e,function(r,i){n===xn||n===zn?m.each(t,function(A){A[i]===r&&delete A[i]}):delete t[i]},this)},ne.prototype.load_queue=function(n){return this.load_prop(this._get_queue_key(n))},ne.prototype._get_queue_key=function(n){if(n===Fr)return mp;if(n===sA)return vp;if(n===gn)return yp;if(n===ii)return wp;if(n===xn)return bp;if(n===zn)return Bp;if(n===Ai)return Cp;ve.error("Invalid queue:",n)},ne.prototype._get_or_create_queue=function(n,e){var t=this._get_queue_key(n);return e=m.isUndefined(e)?{}:e,this.props[t]||(this.props[t]=e)},ne.prototype.set_event_timer=function(n,e){var t=this.load_prop(_s)||{};t[n]=e,this.props[_s]=t,this.save()},ne.prototype.remove_event_timer=function(n){var e=this.load_prop(_s)||{},t=e[n];return m.isUndefined(t)||(delete this.props[_s][n],this.save()),t};var _p,EC=function(n,e){throw new Error(n+" not available in this build.")},Et,UC=0,kD=1,ED=function(n){return n},$t="mixpanel",TC="base64",UD="json",Sp="$device:",oA=V.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,IC=!oA&&Wn.indexOf("MSIE")===-1&&Wn.indexOf("Mozilla")===-1,Oc=null;Er.sendBeacon&&(Oc=function(){return Er.sendBeacon.apply(Er,arguments)});var FC={track:"track/",engage:"engage/",groups:"groups/",record:"record/",flags:"flags/"},xC={api_host:"https://api-js.mixpanel.com",api_hosts:{},api_routes:FC,api_extra_query_params:{},api_method:"POST",api_transport:"XHR",api_payload_format:TC,app_host:"https://mixpanel.com",autocapture:!1,cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:Ur,flags:!1,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:Ur,mp_loader:null,track_marketing:!0,track_pageview:!1,skip_first_touch_marketing:!1,store_google:!0,stop_utm_persistence:!1,save_referrer:!0,test:!1,verbose:!1,img:!1,debug:!1,track_links_timeout:300,cookie_expiration:365,upgrade:!1,disable_persistence:!1,disable_cookie:!1,secure_cookie:!1,ip:!0,opt_out_tracking_by_default:!1,opt_out_persistence_by_default:!1,opt_out_tracking_persistence_type:"localStorage",opt_out_tracking_cookie_prefix:null,property_blacklist:[],xhr_headers:{},ignore_dnt:!1,batch_requests:!0,batch_size:50,batch_flush_interval_ms:5e3,batch_request_timeout_ms:9e4,batch_autostart:!0,hooks:{},record_block_class:new RegExp("^(mp-block|fs-exclude|amp-block|rr-block|ph-no-capture)$"),record_block_selector:"img, video, audio",record_canvas:!1,record_collect_fonts:!1,record_heatmap_data:!1,record_idle_timeout_ms:30*60*1e3,record_mask_text_class:new RegExp("^(mp-mask|fs-mask|amp-mask|rr-mask|ph-mask)$"),record_mask_text_selector:"*",record_max_ms:vs,record_min_ms:0,record_sessions_percent:0,recorder_src:"https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js"},QC=!1,E=function(){},kp=function(n,e,t){var r,i=t===$t?Et:Et[t];if(i&&_p===UC)r=i;else{if(i&&!m.isArray(i)){ve.error("You have already initialized "+t);return}r=new E}if(r._cached_groups={},r._init(n,e,t),r.people=new Z,r.people._init(r),!r.get_config("skip_first_touch_marketing")){var A=m.info.campaignParams(null),s={},o=!1;m.each(A,function(a,c){s["initial_"+c]=a,a&&(o=!0)}),o&&r.people.set_once(s)}return fn.DEBUG=fn.DEBUG||r.get_config("debug"),!m.isUndefined(i)&&m.isArray(i)&&(r._execute_array.call(r.people,i.people),r._execute_array(i)),r};E.prototype.init=function(n,e,t){if(m.isUndefined(t)){this.report_error("You must name your new library: init(token, config, name)");return}if(t===$t){this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet");return}var r=kp(n,e,t);return Et[t]=r,r._loaded(),r},E.prototype._init=function(n,e,t){e=e||{},this.__loaded=!0,this.config={};var r={};if(!("api_payload_format"in e)){var i=e.api_host||xC.api_host;i.match(/\.mixpanel\.com/)&&(r.api_payload_format=UD)}if(this.set_config(m.extend({},xC,r,e,{name:t,token:n,callback_fn:(t===$t?t:$t+"."+t)+"._jsc"})),this._jsc=Ur,this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.request_batchers={},this._batch_requests=this.get_config("batch_requests"),this._batch_requests){if(!m.localStorage.is_supported(!0)||!oA)this._batch_requests=!1,ve.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support"),m.each(this.get_batcher_configs(),function(o){ve.log("Clearing batch queue "+o.queue_key),m.localStorage.remove(o.queue_key)});else if(this.init_batchers(),Oc&&V.addEventListener){var A=m.bind(function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})},this);V.addEventListener("pagehide",function(o){o.persisted&&A()}),V.addEventListener("visibilitychange",function(){me.visibilityState==="hidden"&&A()})}}this.persistence=this.cookie=new ne(this.config),this.unpersisted_superprops={},this._gdpr_init();var s=m.UUID();this.get_distinct_id()||this.register_once({distinct_id:Sp+s,$device_id:s},""),this.flags=new oe({getFullApiRoute:m.bind(function(){return this.get_api_host("flags")+"/"+this.get_config("api_routes").flags},this),getConfigFunc:m.bind(this.get_config,this),setConfigFunc:m.bind(this.set_config,this),getPropertyFunc:m.bind(this.get_property,this),trackingFunc:m.bind(this.track,this)}),this.flags.init(),this.flags=this.flags,this.autocapture=new xt(this),this.autocapture.init(),this._init_tab_id(),this._check_and_start_session_recording()},E.prototype._init_tab_id=function(){if(m.sessionStorage.is_supported())try{var n=this.get_config("name")+"_"+this.get_config("token"),e="mp_tab_id_"+n,t="mp_gen_new_tab_id_"+n;(m.sessionStorage.get(t)||!m.sessionStorage.get(e))&&m.sessionStorage.set(e,"$tab-"+m.UUID()),m.sessionStorage.set(t,"1"),this.tab_id=m.sessionStorage.get(e),V.addEventListener("beforeunload",function(){m.sessionStorage.remove(t)})}catch(r){this.report_error("Error initializing tab id",r)}else this.report_error("Session storage is not supported, cannot keep track of unique tab ID.")},E.prototype.get_tab_id=function(){return this.tab_id||null},E.prototype._should_load_recorder=function(){var n=new Tn(np),e=this.get_tab_id();return n.init().then(function(){return n.getAll()}).then(function(t){for(var r=0;r<t.length;r++)if(sp(t[r])||t[r].tabId===e)return!0;return!1}).catch(m.bind(function(t){this.report_error("Error checking recording registry",t)},this))},E.prototype._check_and_start_session_recording=Tr(function(n){if(!V.MutationObserver){ve.critical("Browser does not support MutationObserver; skipping session recording");return}var e=m.bind(function(r){var i=m.bind(function(){this._recorder=this._recorder||new V.__mp_recorder(this),this._recorder.resumeRecording(r)},this);m.isUndefined(V.__mp_recorder)?EC(this.get_config("recorder_src"),i):i()},this),t=this.get_config("record_sessions_percent")>0&&Math.random()*100<=this.get_config("record_sessions_percent");n||t?e(!0):this._should_load_recorder().then(function(r){r&&e(!1)})}),E.prototype.start_session_recording=function(){this._check_and_start_session_recording(!0)},E.prototype.stop_session_recording=function(){return this._recorder?this._recorder.stopRecording():Promise.resolve()},E.prototype.pause_session_recording=function(){return this._recorder?this._recorder.pauseRecording():Promise.resolve()},E.prototype.resume_session_recording=function(){return this._recorder?this._recorder.resumeRecording():Promise.resolve()},E.prototype.is_recording_heatmap_data=function(){return this._get_session_replay_id()&&this.get_config("record_heatmap_data")},E.prototype.get_session_recording_properties=function(){var n={},e=this._get_session_replay_id();return e&&(n.$mp_replay_id=e),n},E.prototype.get_session_replay_url=function(){var n=null,e=this._get_session_replay_id();if(e){var t=m.HTTPBuildQuery({replay_id:e,distinct_id:this.get_distinct_id(),token:this.get_config("token")});n="https://mixpanel.com/projects/replay-redirect?"+t}return n},E.prototype._get_session_replay_id=function(){var n=null;return this._recorder&&(n=this._recorder.replayId),n||null},E.prototype.__get_recorder=function(){return this._recorder},E.prototype._loaded=function(){if(this.get_config("loaded")(this),this._set_default_superprops(),this.people.set_once(this.persistence.get_referrer_info()),this.get_config("store_google")&&this.get_config("stop_utm_persistence")){var n=m.info.campaignParams(null);m.each(n,(function(e,t){this.unregister(t)}).bind(this))}},E.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(me.referrer),this.get_config("store_google")&&!this.get_config("stop_utm_persistence")&&this.register(m.info.campaignParams()),this.get_config("save_referrer")&&this.persistence.update_referrer_info(me.referrer)},E.prototype._dom_loaded=function(){m.each(this.__dom_loaded_queue,function(n){this._track_dom.apply(this,n)},this),this.has_opted_out_tracking()||m.each(this.__request_queue,function(n){this._send_request.apply(this,n)},this),delete this.__dom_loaded_queue,delete this.__request_queue},E.prototype._track_dom=function(n,e){if(this.get_config("img"))return this.report_error("You can't use DOM tracking functions with img = true."),!1;if(!QC)return this.__dom_loaded_queue.push([n,e]),!1;var t=new n().init(this);return t.track.apply(t,e)},E.prototype._prepare_callback=function(n,e){if(m.isUndefined(n))return null;if(oA){var t=function(s){n(s,e)};return t}else{var r=this._jsc,i=""+Math.floor(Math.random()*1e8),A=this.get_config("callback_fn")+"["+i+"]";return r[i]=function(s){delete r[i],n(s,e)},A}},E.prototype._send_request=function(n,e,t,r){var i=!0;if(IC)return this.__request_queue.push(arguments),i;var A={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},s=null;!r&&(m.isFunction(t)||typeof t=="string")&&(r=t,t=null),t=m.extend(A,t||{}),oA||(t.method="GET");var o=t.method==="POST",a=Oc&&o&&t.transport.toLowerCase()==="sendbeacon",c=t.verbose;e.verbose&&(c=!0),this.get_config("test")&&(e.test=1),c&&(e.verbose=1),this.get_config("img")&&(e.img=1),oA||(r?e.callback=r:(c||this.get_config("test"))&&(e.callback="(function(){})")),e.ip=this.get_config("ip")?1:0,e._=new Date().getTime().toString(),o&&(s="data="+encodeURIComponent(e.data),delete e.data),m.extend(e,this.get_config("api_extra_query_params")),n+="?"+m.HTTPBuildQuery(e);var u=this;if("img"in e){var l=me.createElement("img");l.src=n,me.body.appendChild(l)}else if(a){try{i=Oc(n,s)}catch(v){u.report_error(v),i=!1}try{r&&r(i?1:0)}catch(v){u.report_error(v)}}else if(oA)try{var d=new XMLHttpRequest;d.open(t.method,n,!0);var h=this.get_config("xhr_headers");if(o&&(h["Content-Type"]="application/x-www-form-urlencoded"),m.each(h,function(v,y){d.setRequestHeader(y,v)}),t.timeout_ms&&typeof d.timeout<"u"){d.timeout=t.timeout_ms;var f=new Date().getTime()}d.withCredentials=!0,d.onreadystatechange=function(){if(d.readyState===4)if(d.status===200){if(r)if(c){var v;try{v=m.JSONDecode(d.responseText)}catch(B){if(u.report_error(B),t.ignore_json_errors)v=d.responseText;else return}r(v)}else r(Number(d.responseText))}else{var y;if(d.timeout&&!d.status&&new Date().getTime()-f>=d.timeout?y="timeout":y="Bad HTTP status: "+d.status+" "+d.statusText,u.report_error(y),r)if(c){var b=d.responseHeaders||{};r({status:0,httpStatusCode:d.status,error:y,retryAfter:b["Retry-After"]})}else r(0)}},d.send(s)}catch(v){u.report_error(v),i=!1}else{var p=me.createElement("script");p.type="text/javascript",p.async=!0,p.defer=!0,p.src=n;var g=me.getElementsByTagName("script")[0];g.parentNode.insertBefore(p,g)}return i},E.prototype._execute_array=function(n){var e,t=[],r=[],i=[];m.each(n,function(s){s&&(e=s[0],m.isArray(e)?i.push(s):typeof s=="function"?s.call(this):m.isArray(s)&&e==="alias"?t.push(s):m.isArray(s)&&e.indexOf("track")!==-1&&typeof this[e]=="function"?i.push(s):r.push(s))},this);var A=function(s,o){m.each(s,function(a){if(m.isArray(a[0])){var c=o;m.each(a,function(u){c=c[u[0]].apply(c,u.slice(1))})}else this[a[0]].apply(this,a.slice(1))},o)};A(t,this),A(r,this),A(i,this)},E.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events},E.prototype.get_batcher_configs=function(){var n="__mpq_"+this.get_config("token");return this._batcher_configs=this._batcher_configs||{events:{type:"events",api_name:"track",queue_key:n+"_ev"},people:{type:"people",api_name:"engage",queue_key:n+"_pp"},groups:{type:"groups",api_name:"groups",queue_key:n+"_gr"}},this._batcher_configs},E.prototype.init_batchers=function(){if(!this.are_batchers_initialized()){var n=m.bind(function(t){return new Zt(t.queue_key,{libConfig:this.config,errorReporter:this.get_config("error_reporter"),sendRequestFunc:m.bind(function(r,i,A){var s=this.get_config("api_routes");this._send_request(this.get_api_host(t.api_name)+"/"+s[t.api_name],this._encode_data_for_request(r),i,this._prepare_callback(A,r))},this),beforeSendHook:m.bind(function(r){return this._run_hook("before_send_"+t.type,r)},this),stopAllBatchingFunc:m.bind(this.stop_batch_senders,this),usePersistence:!0})},this),e=this.get_batcher_configs();this.request_batchers={events:n(e.events),people:n(e.people),groups:n(e.groups)}}this.get_config("batch_autostart")&&this.start_batch_senders()},E.prototype.start_batch_senders=function(){this._batchers_were_started=!0,this.are_batchers_initialized()&&(this._batch_requests=!0,m.each(this.request_batchers,function(n){n.start()}))},E.prototype.stop_batch_senders=function(){this._batch_requests=!1,m.each(this.request_batchers,function(n){n.stop(),n.clear()})},E.prototype.push=function(n){this._execute_array([n])},E.prototype.disable=function(n){typeof n>"u"?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(n)},E.prototype._encode_data_for_request=function(n){var e=eA(n);return this.get_config("api_payload_format")===TC&&(e=m.base64Encode(e)),{data:e}},E.prototype._track_or_batch=function(n,e){var t=m.truncate(n.data,255),r=n.endpoint,i=n.batcher,A=n.should_send_immediately,s=n.send_request_options||{};e=e||Ur;var o=!0,a=m.bind(function(){return s.skip_hooks||(t=this._run_hook("before_send_"+n.type,t)),t?(ve.log("MIXPANEL REQUEST:"),ve.log(t),this._send_request(r,this._encode_data_for_request(t),s,this._prepare_callback(e,t))):null},this);return this._batch_requests&&!A?i.enqueue(t).then(function(c){c?e(1,t):a()}):o=a(),o&&t},E.prototype.track=Tr(function(n,e,t,r){!r&&typeof t=="function"&&(r=t,t=null),t=t||{};var i=t.transport;i&&(t.transport=i);var A=t.send_immediately;if(typeof r!="function"&&(r=Ur),m.isUndefined(n)){this.report_error("No event name provided to mixpanel.track");return}if(this._event_is_disabled(n)){r(0);return}e=m.extend({},e),e.token=this.get_config("token");var s=this.persistence.remove_event_timer(n);if(!m.isUndefined(s)){var o=new Date().getTime()-s;e.$duration=parseFloat((o/1e3).toFixed(3))}this._set_default_superprops();var a=this.get_config("track_marketing")?m.info.marketingParams():{};e=m.extend({},m.info.properties({mp_loader:this.get_config("mp_loader")}),a,this.persistence.properties(),this.unpersisted_superprops,this.get_session_recording_properties(),e);var c=this.get_config("property_blacklist");m.isArray(c)?m.each(c,function(d){delete e[d]}):this.report_error("Invalid value for property_blacklist config: "+c);var u={event:n,properties:e},l=this._track_or_batch({type:"events",data:u,endpoint:this.get_api_host("events")+"/"+this.get_config("api_routes").track,batcher:this.request_batchers.events,should_send_immediately:A,send_request_options:t},r);return l}),E.prototype.set_group=Tr(function(n,e,t){m.isArray(e)||(e=[e]);var r={};return r[n]=e,this.register(r),this.people.set(n,e,t)}),E.prototype.add_group=Tr(function(n,e,t){var r=this.get_property(n),i={};return r===void 0?(i[n]=[e],this.register(i)):r.indexOf(e)===-1&&(r.push(e),i[n]=r,this.register(i)),this.people.union(n,e,t)}),E.prototype.remove_group=Tr(function(n,e,t){var r=this.get_property(n);if(r!==void 0){var i=r.indexOf(e);i>-1&&(r.splice(i,1),this.register({group_key:r})),r.length===0&&this.unregister(n)}return this.people.remove(n,e,t)}),E.prototype.track_with_groups=Tr(function(n,e,t,r){var i=m.extend({},e||{});return m.each(t,function(A,s){A!=null&&(i[s]=A)}),this.track(n,i,r)}),E.prototype._create_map_key=function(n,e){return n+"_"+JSON.stringify(e)},E.prototype._remove_group_from_cache=function(n,e){delete this._cached_groups[this._create_map_key(n,e)]},E.prototype.get_group=function(n,e){var t=this._create_map_key(n,e),r=this._cached_groups[t];return(r===void 0||r._group_key!==n||r._group_id!==e)&&(r=new Le,r._init(this,n,e),this._cached_groups[t]=r),r},E.prototype.track_pageview=Tr(function(n,e){typeof n!="object"&&(n={}),e=e||{};var t=e.event_name||"$mp_web_page_view",r=m.extend(m.info.mpPageViewProperties(),m.info.campaignParams(),m.info.clickParams()),i=m.extend({},r,n);return this.track(t,i)}),E.prototype.track_links=function(){return this._track_dom.call(this,AA,arguments)},E.prototype.track_forms=function(){return this._track_dom.call(this,Rc,arguments)},E.prototype.time_event=function(n){if(m.isUndefined(n)){this.report_error("No event name provided to mixpanel.time_event");return}this._event_is_disabled(n)||this.persistence.set_event_timer(n,new Date().getTime())};var TD={persistent:!0},Ep=function(n){var e;return m.isObject(n)?e=n:m.isUndefined(n)?e={}:e={days:n},m.extend({},TD,e)};E.prototype.register=function(n,e){var t=Ep(e);t.persistent?this.persistence.register(n,t.days):m.extend(this.unpersisted_superprops,n)},E.prototype.register_once=function(n,e,t){var r=Ep(t);r.persistent?this.persistence.register_once(n,e,r.days):(typeof e>"u"&&(e="None"),m.each(n,function(i,A){(!this.unpersisted_superprops.hasOwnProperty(A)||this.unpersisted_superprops[A]===e)&&(this.unpersisted_superprops[A]=i)},this))},E.prototype.unregister=function(n,e){e=Ep(e),e.persistent?this.persistence.unregister(n):delete this.unpersisted_superprops[n]},E.prototype._register_single=function(n,e){var t={};t[n]=e,this.register(t)},E.prototype.identify=function(n,e,t,r,i,A,s,o){var a=this.get_distinct_id();if(n&&a!==n){if(typeof n=="string"&&n.indexOf(Sp)===0)return this.report_error("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:n})}if(!this.get_property("$device_id")){var c=a;this.register_once({$had_persisted_distinct_id:!0,$device_id:c},"")}n!==a&&n!==this.get_property(Pc)&&(this.unregister(Pc),this.register({distinct_id:n})),this._flags.identify_called=!0,this.people._flush(e,t,r,i,A,s,o),n!==a&&this.track("$identify",{distinct_id:n,$anon_distinct_id:a},{skip_hooks:!0}),n!==a&&this.flags.fetchFlags()},E.prototype.reset=function(){this.stop_session_recording(),this.persistence.clear(),this._flags.identify_called=!1;var n=m.UUID();this.register_once({distinct_id:Sp+n,$device_id:n},""),this._check_and_start_session_recording()},E.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},E.prototype.alias=function(n,e){if(n===this.get_property(kC))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var t=this;return m.isUndefined(e)&&(e=this.get_distinct_id()),n!==e?(this._register_single(Pc,n),this.track("$create_alias",{alias:n,distinct_id:e},{skip_hooks:!0},function(){t.identify(n)})):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(n),-1)},E.prototype.name_tag=function(n){this._register_single("mp_name_tag",n)},E.prototype.set_config=function(n){if(m.isObject(n)){m.extend(this.config,n);var e=n.batch_size;e&&m.each(this.request_batchers,function(t){t.resetBatchSize()}),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),fn.DEBUG=fn.DEBUG||this.get_config("debug"),("autocapture"in n||"record_heatmap_data"in n)&&this.autocapture&&this.autocapture.init()}},E.prototype.get_config=function(n){return this.config[n]},E.prototype._run_hook=function(n){var e=(this.config.hooks[n]||ED).apply(this,ti.call(arguments,1));return typeof e>"u"&&(this.report_error(n+" hook did not return a value"),e=null),e},E.prototype.get_property=function(n){return this.persistence.load_prop([n])},E.prototype.get_api_host=function(n){return this.get_config("api_hosts")[n]||this.get_config("api_host")},E.prototype.toString=function(){var n=this.get_config("name");return n!==$t&&(n=$t+"."+n),n},E.prototype._event_is_disabled=function(n){return m.isBlockedUA(Wn)||this._flags.disable_all_events||m.include(this.__disabled_events,n)},E.prototype._gdpr_init=function(){var n=this.get_config("opt_out_tracking_persistence_type")==="localStorage";n&&m.localStorage.is_supported()&&(!this.has_opted_in_tracking()&&this.has_opted_in_tracking({persistence_type:"cookie"})&&this.opt_in_tracking({enable_persistence:!1}),!this.has_opted_out_tracking()&&this.has_opted_out_tracking({persistence_type:"cookie"})&&this.opt_out_tracking({clear_persistence:!1}),this.clear_opt_in_out_tracking({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_tracking()?this._gdpr_update_persistence({clear_persistence:!0}):!this.has_opted_in_tracking()&&(this.get_config("opt_out_tracking_by_default")||m.cookie.get("mp_optout"))&&(m.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))},E.prototype._gdpr_update_persistence=function(n){var e;if(n&&n.clear_persistence)e=!0;else if(n&&n.enable_persistence)e=!1;else return;!this.get_config("disable_persistence")&&this.persistence.disabled!==e&&this.persistence.set_disabled(e),e?(this.stop_batch_senders(),this.stop_session_recording()):this._batchers_were_started&&this.start_batch_senders()},E.prototype._gdpr_call_func=function(n,e){return e=m.extend({track:m.bind(this.track,this),persistence_type:this.get_config("opt_out_tracking_persistence_type"),cookie_prefix:this.get_config("opt_out_tracking_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_site_cookie:this.get_config("cross_site_cookie"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),cookie_domain:this.get_config("cookie_domain"),secure_cookie:this.get_config("secure_cookie"),ignore_dnt:this.get_config("ignore_dnt")},e),m.localStorage.is_supported()||(e.persistence_type="cookie"),n(this.get_config("token"),{track:e.track,trackEventName:e.track_event_name,trackProperties:e.track_properties,persistenceType:e.persistence_type,persistencePrefix:e.cookie_prefix,cookieDomain:e.cookie_domain,cookieExpiration:e.cookie_expiration,crossSiteCookie:e.cross_site_cookie,crossSubdomainCookie:e.cross_subdomain_cookie,secureCookie:e.secure_cookie,ignoreDnt:e.ignore_dnt})},E.prototype.opt_in_tracking=function(n){n=m.extend({enable_persistence:!0},n),this._gdpr_call_func(JL,n),this._gdpr_update_persistence(n)},E.prototype.opt_out_tracking=function(n){n=m.extend({clear_persistence:!0,delete_user:!0},n),n.delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func(zL,n),this._gdpr_update_persistence(n)},E.prototype.has_opted_in_tracking=function(n){return this._gdpr_call_func(XL,n)},E.prototype.has_opted_out_tracking=function(n){return this._gdpr_call_func(GB,n)},E.prototype.clear_opt_in_out_tracking=function(n){n=m.extend({enable_persistence:!0},n),this._gdpr_call_func(YL,n),this._gdpr_update_persistence(n)},E.prototype.report_error=function(n,e){ve.error.apply(ve.error,arguments);try{!e&&!(n instanceof Error)&&(n=new Error(n)),this.get_config("error_reporter")(n,e)}catch(t){ve.error(t)}},E.prototype.init=E.prototype.init,E.prototype.reset=E.prototype.reset,E.prototype.disable=E.prototype.disable,E.prototype.time_event=E.prototype.time_event,E.prototype.track=E.prototype.track,E.prototype.track_links=E.prototype.track_links,E.prototype.track_forms=E.prototype.track_forms,E.prototype.track_pageview=E.prototype.track_pageview,E.prototype.register=E.prototype.register,E.prototype.register_once=E.prototype.register_once,E.prototype.unregister=E.prototype.unregister,E.prototype.identify=E.prototype.identify,E.prototype.alias=E.prototype.alias,E.prototype.name_tag=E.prototype.name_tag,E.prototype.set_config=E.prototype.set_config,E.prototype.get_config=E.prototype.get_config,E.prototype.get_api_host=E.prototype.get_api_host,E.prototype.get_property=E.prototype.get_property,E.prototype.get_distinct_id=E.prototype.get_distinct_id,E.prototype.toString=E.prototype.toString,E.prototype.opt_out_tracking=E.prototype.opt_out_tracking,E.prototype.opt_in_tracking=E.prototype.opt_in_tracking,E.prototype.has_opted_out_tracking=E.prototype.has_opted_out_tracking,E.prototype.has_opted_in_tracking=E.prototype.has_opted_in_tracking,E.prototype.clear_opt_in_out_tracking=E.prototype.clear_opt_in_out_tracking,E.prototype.get_group=E.prototype.get_group,E.prototype.set_group=E.prototype.set_group,E.prototype.add_group=E.prototype.add_group,E.prototype.remove_group=E.prototype.remove_group,E.prototype.track_with_groups=E.prototype.track_with_groups,E.prototype.start_batch_senders=E.prototype.start_batch_senders,E.prototype.stop_batch_senders=E.prototype.stop_batch_senders,E.prototype.start_session_recording=E.prototype.start_session_recording,E.prototype.stop_session_recording=E.prototype.stop_session_recording,E.prototype.pause_session_recording=E.prototype.pause_session_recording,E.prototype.resume_session_recording=E.prototype.resume_session_recording,E.prototype.get_session_recording_properties=E.prototype.get_session_recording_properties,E.prototype.get_session_replay_url=E.prototype.get_session_replay_url,E.prototype.get_tab_id=E.prototype.get_tab_id,E.prototype.DEFAULT_API_ROUTES=FC,E.prototype.__get_recorder=E.prototype.__get_recorder,ne.prototype.properties=ne.prototype.properties,ne.prototype.update_search_keyword=ne.prototype.update_search_keyword,ne.prototype.update_referrer_info=ne.prototype.update_referrer_info,ne.prototype.get_cross_subdomain=ne.prototype.get_cross_subdomain,ne.prototype.clear=ne.prototype.clear;var aA={},ID=function(){m.each(aA,function(n,e){e!==$t&&(Et[e]=n)}),Et._=m},FD=function(){Et.init=function(n,e,t){if(t)return Et[t]||(Et[t]=aA[t]=kp(n,e,t),Et[t]._loaded()),Et[t];var r=Et;aA[$t]?r=aA[$t]:n&&(r=kp(n,e,$t),r._loaded(),aA[$t]=r),Et=r,_p===kD&&(V[$t]=Et),ID()}},xD=function(){function n(){n.done||(n.done=!0,QC=!0,IC=!1,m.each(aA,function(r){r._dom_loaded()}))}function e(){try{me.documentElement.doScroll("left")}catch{setTimeout(e,1);return}n()}if(me.addEventListener)me.readyState==="complete"?n():me.addEventListener("DOMContentLoaded",n,!1);else if(me.attachEvent){me.attachEvent("onreadystatechange",n);var t=!1;try{t=V.frameElement===null}catch{}me.documentElement.doScroll&&t&&e()}m.register_event(V,"load",n,!0)};function QD(n){return EC=n,_p=UC,Et=new E,FD(),Et.init(),xD(),Et}function RD(n,e){e()}var Mc=QD(RD);$0({identify:()=>{},track:()=>{},page:()=>{},reset:()=>{}});function PD(n,e={}){const t=e.instanceName||`obi_${Math.random().toString(36).slice(2)}`;Mc.init(n,{debug:e.debug===!0,track_pageview:!0,persistence:"localStorage",...e.config||{}},t);const r=Mc.get_instance?Mc.get_instance(t):Mc;return{identify:(i,A)=>{var s;try{r.identify(i),A&&((s=r==null?void 0:r.people)!=null&&s.set)&&r.people.set(A)}catch{}},track:(i,A)=>{try{r.track(i,A||{})}catch{}},page:(i,A)=>{try{r.track("Page Viewed",{name:i,...A||{}})}catch{}},reset:()=>{try{r.reset()}catch{}}}}let Up=null;function RC(){return Up||(Up=PD("d37cde23ca4b5d8c7ed30653f07f9e47"),Up)}const OD=`:root,:host{--obi-modal-padding: 48px 48px 32px;--obi-modal-background-color: #FFFFFF;--obi-modal-border-radius: 12px;--obi-modal-shadow: 0px 1px 2px rgba(0, 0, 0, .05);--obi-modal-xsmall-width: 320px;--obi-modal-xsmall-height: 240px;--obi-modal-small-width: 480px;--obi-modal-small-height: 400px;--obi-modal-medium-width: 640px;--obi-modal-medium-height: 545px;--obi-modal-large-width: 1200px;--obi-modal-large-height: 700px;--obi-font-family: "Satoshi", sans-serif;--obi-color-primary: #9500FF;--obi-color-primary-50: color-mix(in srgb, var(--obi-color-primary) 50%, white 50%);--obi-color-primary-30: color-mix(in srgb, var(--obi-color-primary) 30%, white 70%);--obi-color-tint: color-mix(in srgb, var(--obi-color-primary) 5%, white 95%);--obi-color-text: #18181B;--obi-course-color-selected: var(--obi-color-primary-50);--obi-course-color-tint: var(--obi-color-tint);--obi-course-progress-step-completed: #B3B3B3;--obi-course-progress-step-incomplete: #D9D9D9;--obi-course-progress-text-color: #757575;font-family:var(--obi-font-family);color:var(--obi-color-text)}.obi-button{font-family:var(--obi-font-family);color:var(--obi-color-text)}dialog{margin:auto;padding:0;border:none;border-radius:var(--obi-modal-border-radius);box-shadow:var(--obi-modal-shadow);background:var(--obi-modal-background-color);box-sizing:border-box}dialog>.modal-content{padding:var(--obi-modal-padding);box-sizing:border-box}dialog,dialog.modal-medium,dialog>.modal-content,dialog.modal-medium>.modal-content{width:var(--obi-modal-medium-width);min-height:var(--obi-modal-medium-height)}dialog.modal-xsmall,dialog.modal-xsmall>.modal-content{width:var(--obi-modal-xsmall-width);min-height:var(--obi-modal-xsmall-height)}dialog.modal-small,dialog.modal-small>.modal-content{width:var(--obi-modal-small-width);min-height:var(--obi-modal-small-height)}dialog.modal-large,dialog.modal-large>.modal-content{width:var(--obi-modal-large-width);min-height:var(--obi-modal-large-height)}dialog::backdrop{background:rgba(0,0,0,.5)}.tour-content{display:block;width:100%;height:100%}.tour-content .container{box-sizing:border-box;display:flex;flex-direction:column;align-items:center;padding:0;width:100%;height:100%}.tour-content .header{display:flex;flex-direction:column;align-items:center;padding:0;gap:16px;width:100%}.tour-content .title{width:100%;font-family:Satoshi,sans-serif;font-style:normal;font-weight:700;font-size:32px;line-height:90%;text-align:center;letter-spacing:-.03em;color:#18181b;margin:0}.tour-content .subtitle{width:100%;font-family:Satoshi,sans-serif;font-style:normal;font-weight:400;font-size:16px;line-height:140%;text-align:center;letter-spacing:-.01em;color:#18181b;margin:0}.tour-content .visual{width:480px;height:240px;margin-top:24px;border-radius:12px;display:flex;align-items:center;justify-content:center;position:relative}.tour-content .description{width:100%;min-height:48px;margin:24px 0 0;font-family:Satoshi,sans-serif;font-style:normal;font-weight:400;font-size:16px;line-height:140%;text-align:center;letter-spacing:-.01em;color:#18181b}.tour-content .button-container{display:flex;margin-top:24px;flex-direction:column;align-items:center;gap:16px;width:100%}.tour-content .action-button{box-sizing:border-box;display:flex;flex-direction:row;justify-content:center;align-items:center;padding:12px;gap:8px;min-width:200px;height:40px;background:#303030;border:1px solid #303030;border-radius:4px;cursor:pointer;text-decoration:none}.tour-content .action-button.disabled{opacity:.6;cursor:not-allowed}.tour-content .button-text{height:16px;font-family:Satoshi,sans-serif;font-style:normal;font-weight:400;font-size:16px;line-height:100%;color:#fbf3ff}.tour.content-area{flex:1;display:flex;flex-direction:column}.obi-close-button{position:absolute;top:24px;right:24px;width:24px;height:24px;cursor:pointer;border:none;background:none;padding:0;display:flex;align-items:center;justify-content:center;z-index:1}.obi-panel{box-sizing:border-box;padding:24px;background-color:#fff;box-shadow:0 16px 32px -4px #0000001f,0 4px 8px -2px #00000014,inset 0 1px #fff9;border-radius:12px}.obi-pill.container{width:96px;height:30px;display:flex;align-items:center;justify-content:center}.obi-pill.container .pill{display:flex;align-items:center;justify-content:center;width:48px;height:6px;opacity:.7;border-radius:3px;background-color:var(--obi-color-primary);transition:width .15s ease-in-out,height .15s ease-in-out,border-radius .15s ease-in-out}.obi-pill.container .pill.button{cursor:pointer}.obi-pill.container.user-speaking .pill{background-color:var(--obi-color-primary-30)}.obi-pill.container.active .pill{width:96px;height:30px;border-radius:15px;opacity:1}.obi-pill.container.busy,.obi-pill.container.busy .pill{width:220px}.obi-pill2.container{display:flex;align-items:center;justify-content:center}.obi-pill2.container .pill{display:flex;align-items:center;justify-content:center;width:48px;height:6px;opacity:.7;border-radius:3px;background-color:var(--obi-color-primary);transform:translateY(0);transition:width .15s ease-in-out,height .15s ease-in-out,border-radius .15s ease-in-out}.obi-pill2.container .pill.button{cursor:pointer}.obi-pill2.container:not(.active){transition:height 0s linear .15s;height:6px}.obi-pill2.container:not(.active) .pill{transform:translateY(12px);transition:transform 0s linear .15s,width .15s ease-in-out,height .15s ease-in-out,border-radius .15s ease-in-out}.obi-pill2.container.active{transition:none;height:30px}.obi-pill2.container.active .pill{transition:transform 0s,width .15s ease-in-out,height .15s ease-in-out,border-radius .15s ease-in-out;width:96px;height:30px;border-radius:15px;opacity:1}.obi-pill2.container.user-speaking .pill{background-color:var(--obi-color-primary-30)}.obi-popout{position:relative;display:inline-block}.obi-popout .obi-popout-target{cursor:pointer;display:inline-block}.obi-popout .content{position:absolute;background-color:#fff0;z-index:100;animation:popout-appear .15s ease-out}@keyframes popout-appear{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.obi-round-button-popout{z-index:600}.obi-round-button{flex:0 0 auto;display:flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:50%;padding:0;box-sizing:border-box;background-color:#fff;border:1px solid #D9D9D9;box-shadow:none}.obi-round-button:hover{cursor:pointer}.obi-round-button:disabled{box-shadow:none;background-color:#f0f0f0;color:#999;cursor:not-allowed!important;pointer-events:none}.obi-round-button-title{padding:8px 16px;border-radius:12px;background-color:#fff;color:#000;font-size:14px;font-weight:400;white-space:nowrap;box-shadow:0 4px 12px #00000026,0 2px 4px #0000001a;border:1px solid rgba(0,0,0,.08);z-index:5000;pointer-events:none;-webkit-user-select:none;user-select:none;position:relative}.obi-round-button-title:after{content:"";position:absolute;top:100%;left:50%;transform:translate(-50%);width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid white;filter:drop-shadow(0 2px 2px rgba(0,0,0,.1))}.obi-equaliser{display:flex;align-items:center;gap:2px;height:32px}.obi-equaliser .column{position:relative;display:flex;align-items:center;justify-content:center;width:5px;height:100%}.obi-equaliser .bar{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:3px;border-radius:2px;z-index:1}.obi-message{display:inline-flex;align-items:center;justify-content:center;min-width:140px;padding:0 15px;text-wrap:nowrap;font-size:16px;font-weight:400;height:30px;box-sizing:border-box;background-color:#fff;border-radius:15px;border:1px solid #D9D9D9}.obi-message.clickable{box-shadow:0 4px 6px #0000001a;cursor:pointer}.obi-loading-dots{display:flex;align-items:center;gap:2px;height:32px}.obi-loading-dots .column{position:relative;display:flex;align-items:center;justify-content:center;width:5px;height:100%}.obi-loading-dots .dot{width:3px;height:3px;border-radius:2px;position:relative;z-index:2}.obi-loading-dots .bar{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:3px;border-radius:2px;z-index:1;height:0px;animation:bounce .9s ease-in-out infinite}@keyframes bounce{0%,60%,to{height:0px}30%{height:16px}}.obi-exit-survey{position:relative;width:320px;margin:0 auto;-webkit-backdrop-filter:none;backdrop-filter:none;background:white;z-index:9999}.obi-exit-survey-container{display:flex;flex-direction:column;align-items:center;padding:0;gap:16px;width:272px;flex:none;align-self:stretch}.obi-exit-survey-header{display:flex;flex-direction:column;align-items:flex-start;padding:0;gap:4px;width:272px;flex:none;align-self:stretch}.obi-exit-survey-title{width:272px;height:22px;margin:0;font-family:Satoshi,sans-serif;font-size:16px;font-weight:600;line-height:140%;text-align:center;color:#1e1e1e;flex:none;align-self:stretch}.obi-exit-survey-subtitle{width:272px;height:20px;margin:0;font-family:Satoshi,sans-serif;font-style:normal;font-weight:400;font-size:14px;line-height:140%;text-align:center;color:#757575;flex:none;align-self:stretch}.obi-exit-survey-options{display:flex;flex-direction:column;align-items:flex-start;padding:0;gap:4px;width:272px;flex:none;align-self:stretch}.obi-exit-survey-options textarea{height:80px;resize:none;outline:none}.obi-exit-survey-button{box-sizing:border-box;display:flex;flex-direction:row;justify-content:center;align-items:center;padding:12px;gap:8px;width:272px;height:44px;border-radius:12px;cursor:pointer;font-family:Satoshi,sans-serif;font-style:normal;font-weight:400;font-size:14px;line-height:140%;flex:none;align-self:stretch;transition:all .2s ease}.obi-exit-survey-button:hover{transform:translateY(-1px);box-shadow:0 4px 8px #0000001a}.obi-exit-survey-button:active{transform:translateY(0)}.obi-exit-survey-button-continue{background:rgba(255,255,255);border:1px solid rgba(217,217,217);color:#1e1e1e}.obi-exit-survey-button-continue:hover{background:rgba(255,255,255);border-color:#d9d9d9}.obi-exit-survey-button-wrap-up{background:#303030;border:1px solid rgba(217,217,217);color:#fff;font-weight:500}.obi-exit-survey-button-wrap-up:hover{background:#404040;border-color:#d9d9d9}.obi-exit-survey-reason-button{background:rgba(255,255,255);border:1px solid rgba(217,217,217);color:#1e1e1e}.obi-exit-survey-reason-button:hover{background:rgba(255,255,255);border-color:#d9d9d9}.obi-exit-survey-reason-button-secondary{display:flex;flex-direction:row;justify-content:center;align-items:center;padding:4px 6px;gap:8px;width:272px;height:28px;border-radius:4px;cursor:pointer;border:none;background:transparent;font-family:Satoshi,sans-serif;font-style:normal;font-weight:400;font-size:14px;line-height:140%;color:#5a5a5a;flex:none;align-self:stretch;transition:all .2s ease}.obi-exit-survey-reason-button-secondary:hover{background:rgba(0,0,0,.05);color:#3a3a3a}.obi-message-input{display:inline-block;position:relative}.obi-message-input .container{width:212px;height:30px;box-sizing:border-box;background:#FFFFFF;border:1px solid var(--obi-color-primary-30);border-radius:15px;display:flex;align-items:center;flex:none;order:2;flex-grow:0;transition:height .3s ease,border-radius .3s ease;animation:expandMessageInput .2s cubic-bezier(.4,0,.2,1) 0s 1 normal both}.obi-message-input.expanded .container{height:auto;min-height:140px;border-radius:15px;align-items:flex-start;padding:8px 0;animation:expandMessageInputWide .2s cubic-bezier(.4,0,.2,1) 0s 1 normal both}.obi-message-input .field{flex:1 1 0;border:none;background:transparent;outline:none;font-family:Satoshi,sans-serif;font-style:normal;font-weight:400;font-size:14px;line-height:18px;color:#000;padding:4px 3px 0 16px;height:100%;box-sizing:border-box;min-width:0;resize:none;overflow:hidden;scrollbar-width:none;transition:padding .3s ease;animation:fadeInInputField .2s cubic-bezier(.4,0,.2,1) 0s 1 normal both}.obi-message-input.expanded .field{height:auto;min-height:120px;padding:4px 16px;overflow-y:auto;line-height:18px}.obi-message-input .field::placeholder{color:#999}.obi-message-input .field:disabled{cursor:not-allowed;opacity:.6}.obi-message-input .send{position:absolute;bottom:3px;right:4px;flex-shrink:0;width:24px;height:24px;background:var(--obi-color-primary);border:none;border-radius:9999px;display:flex;justify-content:center;align-items:center;cursor:pointer;transition:all .3s ease;color:#fff}.obi-message-input.expanded .send{width:28px;height:28px;position:relative;top:0;bottom:0;margin-right:0}.obi-message-input.expanded .button-container{display:flex;justify-content:space-between;align-items:center;width:100%;margin-top:8px}.obi-message-input .send:disabled{background:#CCCCCC;cursor:not-allowed;transform:none}.obi-message-input .container:focus-within{border-color:var(--obi-color-primary);box-shadow:0 0 0 2px #9008ff1a}@keyframes expandMessageInput{0%{width:32px}to{width:212px}}@keyframes expandMessageInputWide{0%{width:212px}to{width:340px}}@keyframes fadeInInputField{0%{opacity:0}60%{opacity:0}to{opacity:1}}.obi-course-progress{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:6px;width:100%;min-width:0;height:24px;flex:none;order:1;align-self:stretch;flex-grow:0}.obi-course-progress-steps{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:0;gap:2px;width:100%;height:6px;flex:none;order:0;align-self:stretch;flex-grow:0}.obi-course-progress-container{display:flex;flex-direction:column;justify-content:center;align-items:stretch;padding:2px 0;height:6px;flex:1;min-width:0}.obi-course-progress-step{width:100%;height:2px;background:var(--obi-course-progress-step-incomplete);border-radius:24px;flex:none;order:0;align-self:stretch;flex-grow:0}.obi-course-progress-step.completed{background:var(--obi-course-progress-step-completed)}.obi-course-progress-description{width:100%;height:14px;font-family:var(--obi-font-family);font-style:normal;font-weight:500;font-size:14px;line-height:100%;color:var(--obi-course-progress-text-color);flex:none;order:1;flex-grow:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.obi-widget-popout{z-index:400}.obi-widget-panel{display:flex;flex-direction:column;gap:8px;align-items:center;justify-content:center;min-width:222px;width:min-content;padding:12px;box-sizing:border-box;border-radius:27px;background:white;transition:background .1s ease-out .1s,box-shadow .1s ease-out .1s}.obi-widget-panel:not(.messaging){width:256px}.obi-widget-panel.tool-usage{width:384px}.obi-widget-panel:not(.expanded){background:transparent;border:none;box-shadow:none;transition:background .1s ease-out .1s,border .1s ease-out .1s,box-shadow .1s ease-out .1s}.obi-widget-panel.maximized{transform:translateY(-110px)}.obi-widget-panel .obi-widget{display:flex;align-items:center;min-width:192px;padding-left:58px;box-sizing:border-box;gap:4px}.obi-widget-panel .obi-widget.active.in-plan{padding-left:0}.obi-widget-panel .obi-widget.active.in-plan .obi-round-button{animation:fade-in-button .2s ease-out .15s both}.obi-widget-panel .obi-widget.active .obi-equaliser{animation:fade-in-equaliser .2s ease-out .15s both}@keyframes fade-in-button{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes fade-in-equaliser{0%{opacity:0}to{opacity:1}}.obi-widget-panel .obi-course-progress-container{display:none;width:100%;max-height:0;opacity:0;transform:translateY(-10px);overflow:hidden;transition:max-height .3s ease-in-out,opacity .3s ease-in-out,transform .3s ease-in-out}.obi-widget-panel:hover .obi-course-progress-container{display:block;max-width:22 0px;animation:expand-course-progress .3s ease-in-out forwards}.obi-widget-panel:hover .obi-course-progress-container.expanded{max-width:330px}@keyframes expand-course-progress{0%{max-height:0;opacity:0;transform:translateY(-10px)}to{max-height:40px;opacity:1;transform:translateY(0)}}.obi-widget-pill-text{font-size:16px;font-weight:400;color:#fff;opacity:0;animation:fade-in-pill-text .3s ease-in-out forwards}@keyframes fade-in-pill-text{0%{opacity:0}40%{opacity:0}to{opacity:1}}.obi-widget-buttons{display:flex;flex-direction:row;gap:4px}.obi-widget-out-of-plan{display:flex;align-items:center;gap:4px}.obi-widget-out-of-plan .text{font-size:16px;color:#fff;animation:fade-in-pill-text .3s ease-in-out forwards}.obi-widget-out-of-plan .round-button{display:none;animation:fade-in-button .2s ease-out .15s both}.obi-widget-out-of-plan .message{display:none}.obi-widget-out-of-plan.active:hover .round-button,.obi-widget-out-of-plan.active:hover .message,.obi-widget-out-of-plan.active.hover .round-button,.obi-widget-out-of-plan.active.hover .message{display:flex}.tour-select{display:block;font-family:Inter,sans-serif}.course-container{display:flex;padding:20px;align-items:flex-start;gap:8px;height:180px;border-radius:6px;border:1px solid rgba(0,0,0,.6);background:#fff;cursor:pointer;transition:all .2s;flex-direction:column;box-sizing:border-box;overflow:hidden}.course-container:hover{background-color:#f9fafb;border-color:#d1d5db;box-shadow:0 1px 2px #0000000d}.course-container:active{transform:scale(.98)}.course-container.selected{border-radius:6px;border:1px solid var(--obi-course-color-selected);background:var(--obi-course-color-tint)}.course-container.selected:hover{background:var(--obi-course-color-tint)}.header-row{display:flex;justify-content:space-between;align-items:flex-start;align-self:stretch;flex-shrink:0;text-align:left}.course-title{color:#000;font-family:Inter,sans-serif;font-size:20px;font-style:normal;font-weight:500;line-height:100%;letter-spacing:-.2px;margin:0}.duration{display:flex;padding:4px 12px;justify-content:center;align-items:center;gap:8px;border-radius:9999px;background:var(--obi-course-color-tint);color:#000;font-family:Inter,sans-serif;font-size:14px;font-style:normal;font-weight:500;line-height:100%;letter-spacing:-.14px;flex-shrink:0}.course-container.selected .duration{background:#fff}.course-description{flex:1 0 0;color:#0009;font-family:Inter,sans-serif;font-size:16px;font-style:normal;font-weight:400;line-height:140%;letter-spacing:-.16px;margin:0;overflow:hidden;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;text-align:left}.course-grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:4px;padding:0;flex:1 0 0;align-self:stretch;min-height:364px}.controls{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.tabs{display:flex;gap:10px}.tab{display:flex;padding:6px 12px;justify-content:center;align-items:center;align-self:stretch;border:none;background:none;cursor:pointer;font-family:Inter,sans-serif;font-size:16px;font-weight:500;color:#0006;border-bottom:2px solid transparent;transition:all .2s}.tab.active{color:#000;border-bottom:2px solid var(--obi-color-primary)}.tab:hover{color:#000}.filter{position:relative;display:flex;align-items:center;width:336px;height:40px}.filter input{color:var(--obi-color-text);caret-color:var(--obi-color-text);padding:8px 12px 8px 36px;border-radius:6px;border:1px solid rgba(0,0,0,.1);background:#fff;font-family:Inter,sans-serif;font-size:14px;line-height:20px;width:100%;height:100%;box-sizing:border-box;outline:none}.filter input:focus{outline:1px solid var(--obi-color-primary);outline-offset:-1px}.filter input::placeholder{color:#0006}.filter svg{position:absolute;left:12px;pointer-events:none}@media (max-width: 767px){.course-grid{grid-template-columns:1fr}}.loading,.error,.empty{display:flex;justify-content:center;align-items:center;margin-top:16px}.error{color:#ef4444}.tour-select-modal-container{display:flex;flex-direction:column;align-items:center;gap:24px;flex:1 0 0;align-self:stretch;font-family:Satoshi,sans-serif;color:#000;text-align:center;max-width:1200px;width:100%;min-height:600px;box-sizing:border-box}.course-list-wrapper{flex:1;overflow-y:auto;width:100%;min-height:0;max-height:424px;padding-right:3px;box-sizing:border-box}.course-list-wrapper::-webkit-scrollbar{width:3px}.course-list-wrapper::-webkit-scrollbar-track{background:transparent}.course-list-wrapper::-webkit-scrollbar-thumb{background-color:#000;border-radius:2px;min-height:20px}.course-list-wrapper::-webkit-scrollbar-thumb:hover{background-color:#333}.header{display:flex;align-items:flex-start;gap:16px;width:100%;text-align:left}.icon{display:flex;width:56px;height:56px;padding:12px;justify-content:center;align-items:center;border-radius:12px;border:1px solid var(--obi-color-primary);background:var(--obi-color-primary);box-sizing:border-box}.icon img{width:32px;height:32px;color:#fff;fill:#fff}.title-section{align-self:stretch;flex:1}.tour-select-modal-container h1{color:#18181b;font-family:Satoshi;font-size:32px;font-style:normal;font-weight:700;line-height:90%;letter-spacing:-.96px;margin:0 0 8px}.subtitle{color:#18181b;font-family:Satoshi;font-size:20px;font-style:normal;font-weight:500;line-height:90%;letter-spacing:-.6px;margin:0}.footer{display:flex;width:360px;flex-direction:column;align-items:center;gap:12px}.footer-button{display:flex;height:48px;padding:16px;justify-content:center;align-items:center;gap:8px;align-self:stretch;border-radius:6px;background:#18181b;border:none;cursor:pointer;color:#fafafa;font-family:Satoshi;font-weight:500;transition:opacity .2s ease}.footer-button:disabled{opacity:.5;cursor:not-allowed}.footer-button:not(:disabled){opacity:1}.footer-button:not(:disabled):hover{background:#27272a}.footer-text{color:#18181b;font-family:Satoshi;font-size:12px;font-style:normal;font-weight:400;line-height:100%;letter-spacing:-.12px;margin:0;text-align:center}.skeleton{background:linear-gradient(90deg,#e5e7eb 25%,#f3f4f6 50%,#e5e7eb 75%);background-size:200% 100%;animation:loading 1.5s infinite;border-radius:4px}@keyframes loading{0%{background-position:200% 0}to{background-position:-200% 0}}.skeleton-title{height:32px;width:60%;margin-bottom:12px}.skeleton-subtitle{height:20px;width:80%}
128
+ `;function MD(n){let e=n.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"__DOUBLE_STAR__").replace(/\*/g,"[^/]*").replace(/__DOUBLE_STAR__/g,".*").replace(/\?/g,"[^/]");return new RegExp(`^${e}$`,"i")}function LD(n,e){if(!e||e.length===0)return!1;const t=n.replace(/^https?:\/\//,"").replace(/\/$/,"");return e.some(r=>{try{const i=MD(r);return i.test(t)||i.test(n)}catch(i){return console.warn(`Invalid URL pattern: ${r}`,i),!1}})}function Tp(n){if(!n||n.length===0)return!1;const e=window.location.origin+window.location.pathname;return LD(e,n)}function DD(n){var B,w,_,k,T,I;const[e,t]=_e(!1),[r,i]=_e(!1),[A,s]=_e(null),o=HD(n.sdk,a,n.shadowHost,s);function a(x){var F;(F=o.client)!=null&&F.session||t(x)}if(!o.client)return null;const c=ND((B=o.client.product)==null?void 0:B.widget_url_blacklist);let u=o.isActive;((_=(w=o.client)==null?void 0:w.product)==null?void 0:_.name)==="Canibuild"&&(u=!0);const l=o.client.session,d=!!l,h=d&&!e;let f;switch(l==null?void 0:l.speakingState){case"listening":f="user-speaking";break;case"speaking":f="agent-speaking";break;case"thinking":f="thinking";break;case"busy":f="busy";break}const p=l==null?void 0:l.isPaused,g=o.client.state==="ready"&&u&&!c&&(o.client.selectedPlan||!((k=o.client.product)!=null&&k.widget_link_only_access)),v=h?100:62,y=()=>{var x,F,Q,D,X,N;return{name:(x=o.client.selectedPlan)==null?void 0:x.name,description:(F=o.client.selectedPlan)==null?void 0:F.description,appName:(Q=o.client.product)==null?void 0:Q.name,appLogoUrl:((D=o.client.product)==null?void 0:D.logo_url)||"",url:(X=o.client.product)==null?void 0:X.url,agentName:((N=o.client.product)==null?void 0:N.agent_name)||"Obi"}},b=((T=o.client.product)==null?void 0:T.widget_position)==="bottom-right"?{position:"fixed",top:`calc(100vh - ${v}px)`,right:"250px",width:"max-content",transform:"translateX(50%)"}:{position:"fixed",top:`calc(100vh - ${v}px)`,left:"50%",transform:"translateX(-50%)",width:"max-content"};return C("div",{children:[e&&C(eR,{open:e,courses:o.client.plans.map(x=>({id:x.uuid,name:x.name,description:x.description||"",duration:x.duration||0})),loading:!1,agentName:((I=o.client.product)==null?void 0:I.agent_name)||"Obi",onCourseSelect:x=>{const F=o.client.plans.find(Q=>Q.uuid===x.id)||null;F&&(o.client.selectPlan(F),t(!1),i(!0))},onClose:x=>{x==="user-initiated"&&o.client.selectPlan(null),t(!1)}}),g&&C(_t,{children:[C("div",{style:b,children:C(PQ,{inPlan:d,isActive:r?!1:void 0,defaultIsActive:!0,isPaused:p,messaging:(l==null?void 0:l.isMicShared)===!1?!0:void 0,speakingStatus:f,spectrum:()=>(l==null?void 0:l.audioSpectrum())||null,courseProgress:A,onOpen:()=>{t(!0)},onCancel:()=>{var x;(x=o.client.session)==null||x.stop()},onPause:()=>{var x,F;(F=(x=o.client.session)==null?void 0:x.pause)==null||F.call(x)},onUnpause:()=>{var x,F;(F=(x=o.client.session)==null?void 0:x.unpause)==null||F.call(x)},onMessagingChange:x=>{var F,Q,D,X;x?(Q=(F=o.client.session)==null?void 0:F.muteMicrophone)==null||Q.call(F):(X=(D=o.client.session)==null?void 0:D.unmuteMicrophone)==null||X.call(D)},onMessage:x=>{o.say(x)}})}),!!o.client.selectedPlan&&C(nR,{open:!0,session:y(),sessionState:(l==null?void 0:l.state)||null,speakingState:(l==null?void 0:l.speakingState)||null,spectrum:()=>(l==null?void 0:l.audioSpectrum())||null,onClose:x=>{x==="user-initiated"&&(o.client.session.state==="mic-share"?o.client.session.shareMicrophoneFailed():o.client.stopSession()),i(!1)},onStart:()=>{o.client.selectedPlanUuid&&o.startSession()},onContinue:()=>{l==null||l.continue()},onShareMicrophone:()=>{l==null||l.shareMicrophone()}})]})]})}function HD(n,e,t,r){const[i,A]=_e(0),[s,o]=_e(null);return Nt(()=>{n.on("showMenu",a=>{e(a)}),n.on("configUpdated",()=>{A(a=>a+1)})},[n]),Nt(()=>{n.client&&(n.client.session&&o(n.client.session),n.client.on("sessionStarted",a=>{o(a),A(c=>c+1)}),n.client.on("sessionStopped",()=>{o(null),A(a=>a+1)}),n.client.on("sessionShutdown",()=>{A(a=>a+1)}),n.client.on("sessionResumed",()=>{A(a=>a+1)}),n.client.on("stateChanged",()=>{var a;n.client.state==="ready"&&t.style.setProperty("--obi-color-primary",((a=n.client.product)==null?void 0:a.primary_color)||"#9500FF"),A(c=>c+1)}),n.client.on("planSelected",()=>{A(a=>a+1)}))},[n,n.client]),Nt(()=>{if(!s)return;s.on("stateChanged",()=>{A(c=>c+1)}),s.on("speakingStateChanged",()=>{A(c=>c+1)}),s.on("paused",()=>{A(c=>c+1)}),s.on("unpaused",()=>{A(c=>c+1)});const a=c=>{r(c)};return s.on&&s.on("courseProgress",a),()=>{s.off&&s.off("courseProgress",a)}},[s]),n}function ND(n){const[e,t]=_e(()=>Tp(n));return Nt(()=>{t(Tp(n))},[n]),Nt(()=>{KD();const r=()=>{t(Tp(n))};return window.addEventListener("locationchange",r),window.addEventListener("popstate",r),window.addEventListener("hashchange",r),()=>{window.removeEventListener("locationchange",r),window.removeEventListener("popstate",r),window.removeEventListener("hashchange",r)}},[n]),e}function KD(){const n=window;if(n.__obi_history_patched)return;const{pushState:e,replaceState:t}=window.history,r=i=>function(...A){const s=i.apply(this,A);return window.dispatchEvent(new Event("locationchange")),s};window.history.pushState=r(e),window.history.replaceState=r(t),n.__obi_history_patched=!0}function VD(n){if(document.querySelector("obi-widget"))return;GD();const e=document.createElement("div");e.id="obi-host",e.style.position="fixed",e.style.zIndex="9999",document.body.appendChild(e);const t=e.attachShadow({mode:"open"}),r=document.createElement("div");r.id="obi-container",t.appendChild(r);const i=new CSSStyleSheet;i.replaceSync(OD),t.adoptedStyleSheets=[i],rQ(C(DD,{sdk:n,shadowHost:e}),r),console.log("[obi-sdk] widget mounted")}function GD(){PC("https://fonts.cdnfonts.com/css/satoshi"),PC("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap")}function PC(n){const e=document.createElement("link");e.href=n,e.rel="stylesheet",document.head.appendChild(e)}const OC="49206C6F7665204F6269_session",MC="obi-url-params";class jD extends Hc{constructor(e){super(),this.client=null,this.isActive=!1,this.primaryColour="#9500FF",this.passivePlanUuid=null,this.commandQueue=[],this._resumed=!1,this.dispatchCommand=(t,r)=>{var i,A,s,o,a;switch(t){case"update":this.updateConfig(r);break;case"startSession":if(!(r!=null&&r.planUuid)){console.warn("[obi] startSession command requires a planUuid",r);return}const c=(((i=this.client)==null?void 0:i.plans)||[]).find(u=>u.uuid===r.planUuid)||null;if(!c){console.warn("[obi] startSession command requires a valid planUuid",r);return}this.updateActive(!0),(s=(A=this.client)==null?void 0:A.selectPlan)==null||s.call(A,c);break;case"stopSession":(a=(o=this.client)==null?void 0:o.stopSession)==null||a.call(o);break;case"say":this.say(r);break;default:console.warn("[obi] unknown command",{commandType:t,args:r})}},e&&this.createClient(e),this.parsePassiveParams()}async createClient(e){if(this.client){this.client.appToken!==e&&console.warn("[obi] client already exists with different app token");return}let t=null;const r=this.load();if(r)try{t=da.deserialise(r,e,"sdk",{apiBaseUrl:"https://app.coragents.ai",captureScreen:this.captureScreen.bind(this)}),this._resumed=!0}catch(i){console.error("[obi] error loading cached client",i)}t||(t=new da(e,"sdk",{apiBaseUrl:"https://app.coragents.ai",captureScreen:this.captureScreen.bind(this)})),this.client=t,this.client.on("stateChanged",i=>{var A,s,o;i==="ready"&&this.updateConfig({isActive:(A=this.client)==null?void 0:A.showWidget,primaryColour:((o=(s=this.client)==null?void 0:s.product)==null?void 0:o.primary_color)||"#9500FF"})}),this.client.on("sessionStarted",()=>{this.save(),this.passivePlanUuid=null}),this.client.on("sessionStopped",()=>{localStorage.removeItem("obi-client"),this.passivePlanUuid=null}),this.client.on("sessionShutdown",i=>{i==="invalid-room"&&localStorage.removeItem("obi-client")}),this.client.on("trackEvent",(i,A)=>{RC().track(i,A)}),this.client.session&&this.client.resumeSession(i=>{i.on("stateChanged",A=>{A!=="disconnecting"&&A!=="disconnected"&&A!=="error"&&A!=="connecting"&&this.save()}),i.on("paused",()=>{this.save()}),i.on("unpaused",()=>{this.save()})})}async initialise(e={}){this.commandQueue=e.queuedCommands||[],this._resumed?(this._resumed=!1,this.dispatchCommandQueue()):this.client?this.client.initialise({planUuid:this.passivePlanUuid||void 0}).then(()=>{this.emit("initialised"),this.dispatchCommandQueue()}).catch(t=>{console.error("[obi] error initialising client",t),this.emit("error",t)}):this.dispatchCommandQueue()}async updateConfig(e){await this.updateAppToken(e.apiKey),this.updateActive(e.isActive),this.updatePrimaryColour(e.primaryColour),await this.updateIdentity(e.user),this.updateShowMenu(e.showMenu),this.emit("configUpdated")}async updateAppToken(e){var t;e===void 0||e==((t=this.client)==null?void 0:t.appToken)||(this.passivePlanUuid,await this.createClient(e),this.client&&await this.client.initialise({planUuid:this.passivePlanUuid||void 0}).then(()=>{this.emit("initialised")}).catch(r=>{console.error("[obi] error initialising client",r),this.emit("error",r)}))}updateActive(e){e===void 0||e==this.isActive||(this.isActive=e)}updatePrimaryColour(e){e===void 0||e==this.primaryColour||(this.primaryColour=e)}async updateIdentity(e){var r;if(e===void 0||e==((r=this.client)==null?void 0:r.identity))return;let t=e?{...e,extra:{...e,...(e==null?void 0:e.extra)||{}}}:void 0;await this.client.initialise({identity:t,planUuid:this.passivePlanUuid||void 0}).then(()=>{this.emit("initialised")}).catch(i=>{console.error("[obi] error initialising client",i),this.emit("error",i)}),e!=null&&e.email&&RC().identify((e==null?void 0:e.email)||"",t)}updateShowMenu(e){e!==void 0&&this.emit("showMenu",e)}async say(e){var t,r,i;await((i=(r=(t=this.client)==null?void 0:t.session)==null?void 0:r.say)==null?void 0:i.call(r,e))}async startSession(){await this.client.startSession(this.client.selectedPlan.uuid,e=>{e.on("stateChanged",t=>{t!=="disconnecting"&&t!=="disconnected"&&t!=="error"&&t!=="connecting"&&this.save()})})}dispatchCommandQueue(){const e=this.commandQueue;this.commandQueue=[],e.forEach(t=>{try{this.dispatchCommand(t[0],t[1]||[])}catch(r){console.error("[obi] error dispatching command",r)}})}parsePassiveParams(){if(this.passivePlanUuid){this.passivePlanUuid;return}let e={};e=JSON.parse(localStorage.getItem(MC)||"{}"),Object.keys(e).length===0&&new URLSearchParams(window.location.search).forEach((A,s)=>{e[s]=A});const t=e[OC];if(!t)return null;const r=new URL(window.location.href);r.searchParams.delete(OC),window.history.replaceState({},"",r.toString()),r.toString(),localStorage.removeItem(MC),this.passivePlanUuid=t}mountWidget(){VD(this)}async captureScreen(){return(await cT(document.documentElement,{useCORS:!0,allowTaint:!0,foreignObjectRendering:!0})).toDataURL("image/png")}save(){}load(){return localStorage.getItem("obi-client")}}async function LC(n){let e;try{e=window}catch{console.warn("[obi] no window object found"),e={}}return WD({appToken:n,window:e})}async function WD({appToken:n,window:e}){var i,A;if(e.obi){console.warn("[obi] obi object already found on window, skipping");return}n||(n=(i=e==null?void 0:e.obiWidgetConfig)==null?void 0:i.apiKey);let t;try{t=((A=e.ObiSDK)==null?void 0:A.q)||[]}catch{t=[]}const r=new jD(n);return e.ObiSDK=r.dispatchCommand,await r.initialise({queuedCommands:t}),e.obi=r,r.mountWidget(),r}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{LC()}):LC()})();