obi-sdk 0.18.27 → 0.18.28
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 +10 -10
- package/dist/obi-sdk.standalone.iife.js +10 -10
- package/package.json +1 -1
|
@@ -2,12 +2,12 @@
|
|
|
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 Hc=function(n,e){return Hc=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])},Hc(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");Hc(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Nc=function(){return Nc=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},Nc.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},Pp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",qC=typeof Uint8Array>"u"?[]:new Uint8Array(256),xs=0;xs<Pp.length;xs++)qC[Pp.charCodeAt(xs)]=xs;for(var Op="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",lA=typeof Uint8Array>"u"?[]:new Uint8Array(256),Qs=0;Qs<Op.length;Qs++)lA[Op.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,Kc=6+5,Vc=2,YC=Kc-Qr,Mp=65536>>Qr,ZC=1<<Qr,Gc=ZC-1,$C=1024>>Qr,e_=Mp+$C,t_=e_,n_=32,r_=t_+n_,i_=65536>>Kc,A_=1<<YC,s_=A_-1,Lp=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=Lp(i,A/2,r[4]/2),o=r[5]===2?Lp(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<<Vc)+(e&Gc),this.data[t];if(e<=65535)return t=this.index[Mp+(e-55296>>Qr)],t=(t<<Vc)+(e&Gc),this.data[t];if(e<this.highStart)return t=r_-i_+(e>>Kc),t=this.index[t],t+=e>>Qr&s_,t=this.index[t],t=(t<<Vc)+(e&Gc),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},n}(),Dp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u_=typeof Uint8Array>"u"?[]:new Uint8Array(256),Rs=0;Rs<Dp.length;Rs++)u_[Dp.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==",Hp=50,d_=1,Np=2,Kp=3,h_=4,p_=5,Vp=7,Gp=8,jp=9,Yn=10,jc=11,Wp=12,Wc=13,f_=14,dA=15,qc=16,Ps=17,hA=18,g_=19,qp=20,Jc=21,pA=22,zc=23,li=24,Gt=25,fA=26,gA=27,di=28,m_=29,Rr=30,v_=31,Os=32,Ms=33,Xc=34,Yc=35,Zc=36,mA=37,$c=38,Ls=39,Ds=40,eu=41,Jp=42,y_=43,w_=[9001,65288],zp="!",ie="×",Hs="÷",tu=a_(l_),Rn=[Rr,Zc],nu=[d_,Np,Kp,p_],Xp=[Yn,Gp],Yp=[gA,fA],b_=nu.concat(Xp),Zp=[$c,Ls,Ds,Xc,Yc],B_=[dA,Wc],C_=function(n,e){e===void 0&&(e="strict");var t=[],r=[],i=[];return n.forEach(function(A,s){var o=tu.get(A);if(o>Hp?(i.push(!0),o-=Hp):i.push(!1),["normal","auto","loose"].indexOf(e)!==-1&&[8208,8211,12316,12448].indexOf(A)!==-1)return r.push(s),t.push(qc);if(o===h_||o===jc){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"?Jc:mA);if(o===Jp||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]},ru=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},$p=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===Np&&u===Kp)return ie;if(nu.indexOf(a)!==-1)return zp;if(nu.indexOf(u)!==-1||Xp.indexOf(u)!==-1)return ie;if($p(A,e)===Gp)return Hs;if(tu.get(n[A])===jc||(a===Os||a===Ms)&&tu.get(n[o])===jc||a===Vp||u===Vp||a===jp||[Yn,Wc,dA].indexOf(a)===-1&&u===jp||[Ps,hA,g_,li,di].indexOf(u)!==-1||$p(A,e)===pA||ru(zc,pA,A,e)||ru([Ps,hA],Jc,A,e)||ru(Wp,Wp,A,e))return ie;if(a===Yn)return Hs;if(a===zc||u===zc)return ie;if(u===qc||a===qc)return Hs;if([Wc,dA,Jc].indexOf(u)!==-1||a===f_||c===Zc&&B_.indexOf(a)!==-1||a===di&&u===Zc||u===qp||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&&Yp.indexOf(u)!==-1||Yp.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($c===a&&[$c,Ls,Xc,Yc].indexOf(u)!==-1||[Ls,Xc].indexOf(a)!==-1&&[Ls,Ds].indexOf(u)!==-1||[Ds,Yc].indexOf(a)!==-1&&u===Ds||Zp.indexOf(a)!==-1&&[qp,fA].indexOf(u)!==-1||Zp.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===eu&&u===eu){for(var h=t[A],f=1;h>0&&(h--,e[h]===eu);)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,Jp].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===zp,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,ef=8,Ns=10,tf=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,nf=124,j_=126,W_=128,rf=65533,iu=42,Pr=43,q_=44,J_=58,z_=59,BA=46,X_=0,Y_=8,Z_=11,$_=14,eS=31,tS=127,mn=-1,Af=48,sf=97,of=101,nS=102,rS=117,iS=122,af=65,cf=69,uf=70,AS=85,sS=90,Ct=function(n){return n>=Af&&n<=57},oS=function(n){return n>=55296&&n<=57343},hi=function(n){return Ct(n)||n>=af&&n<=uf||n>=sf&&n<=nS},aS=function(n){return n>=sf&&n<=iS},cS=function(n){return n>=af&&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_},lf=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))},Au=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]===cf||n[e]===of)&&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},su={type:32},df=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!==su;)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(lf(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 iu:if(this.peekCodePoint(0)===wA)return this.consumeCodePoint(),_S;break;case Pr:if(Au(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(Au(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(Au(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case tf:if(this.peekCodePoint(0)===iu)for(this.consumeCodePoint();;){var u=this.consumeCodePoint();if(u===iu&&(u=this.consumeCodePoint(),u===tf))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 nf:if(this.peekCodePoint(0)===wA)return this.consumeCodePoint(),wS;if(this.peekCodePoint(0)===nf)return this.consumeCodePoint(),yS;break;case j_:if(this.peekCodePoint(0)===wA)return this.consumeCodePoint(),bS;break;case mn:return su}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?Af:a})),16),A=parseInt($e.apply(void 0,e.map(function(a){return a===js?uf: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=ef;Ct(this.peekCodePoint(0));)e.push(this.consumeCodePoint());r=this.peekCodePoint(0),i=this.peekCodePoint(1);var A=this.peekCodePoint(2);if((r===cf||r===of)&&((i===Pr||i===Rt)&&Ct(A)||Ct(i)))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=ef;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?rf:r}return e===mn?rf:e},n.prototype.consumeName=function(){for(var e="";;){var t=this.consumeCodePoint();if(lf(t))e+=$e(t);else if(Zn(t,this.peekCodePoint(0)))e+=$e(this.consumeEscapedCodePoint());else return this.reconsumeCodePoint(t),e}},n}(),hf=function(){function n(e){this._tokens=e}return n.create=function(e){var t=new df;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"?su: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},ou=function(n,e){return ae(n)&&n.value===e},pf=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)},ff=function(n){return n.length>1?[n[0],n[1]]:[n[0]]},mt={type:17,number:0,flags:vA},au={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},gf="deg",mf="grad",vf="rad",yf="turn",Xs={name:"angle",parse:function(n,e){if(e.type===15)switch(e.unit){case gf:return Math.PI*e.number/180;case mf:return Math.PI/200*e.number;case vf:return e.number;case yf:return Math.PI*2*e.number}throw new Error("Unsupported angle type")}},wf=function(n){return n.type===15&&(n.unit===gf||n.unit===mf||n.unit===vf||n.unit===yf)},bf=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))},cu=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 cu([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=Sf(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=_f(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]},Cf=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=Ef([r,i,A]);return yn(o[0]*255,o[1]*255,o[2]*255,i===0?1:s)},_f=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]},Sf=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]},kf=function(n){return Pt([1.0479297925449969,.022946870601609652,-.05019226628920524,.02962780877005599,.9904344267538799,-.017073799063418826,-.009243040646204504,.015055191490298152,.7518742814281371],n)},uu=function(n){return Pt([.955473421488075,-.02309845494876471,.06325924320057072,-.0283697093338637,1.0099953980813041,.021041441191917323,.012314014864481998,-.020507649298898964,1.330365926242124],n)},lu=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},Ef=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=lu(A,i,e+1/3),o=lu(A,i,e),a=lu(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 uu([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=hu([i/255,A/255,s/255]),a=du([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=hu([i/255,A/255,s/255]),f=du([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=hu(Ef([r,i,A])),a=du([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=_f(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=Sf(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 uu([n[0],n[1],n[2]])},Uf=function(n){return n},qS=function(n){var e=kf([n[0],n[2],n[3]]),t=e[0],r=e[1],i=e[2];return[t,r,i,n[3]]},Tf=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)},du=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})},hu=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 cu([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 uu(uk([e[0],e[1],e[2]]))},fk=function(n){var e=hk(lk(kf([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,If=.018053968510807,mk=function(n){return n.map(function(e){return e<If*4.5?e/4.5:Math.pow((e+no-1)/no,1/.45)})},vk=function(n){return n.map(function(e){return e>=If?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=Ff(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}},Ff=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]},xf=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=Qf[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=Ff(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=Qf[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])}},Qf={srgb:PS,"srgb-linear":cu,"display-p3":rk,"a98-rgb":ck,"prophoto-rgb":gk,xyz:Tf,"xyz-d50":JS,"xyz-d65":Tf,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:Uf,"xyz-d50":qS,"xyz-d65":Uf,rec2020:Bk},Ek={hsl:Cf,hsla:Cf,rgb:xf,rgba:xf,lch:DS,oklch:LS,oklab:MS,lab:OS,color:_k},pi=function(n,e){return ir.parse(n,hf.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}},Rf=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)},Pf=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=Pf(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=Pf(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=bf(i);return}else if(wf(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=bf(i);return}else if(wf(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}},Of="closest-side",Mf="farthest-side",Lf="closest-corner",Df="farthest-corner",Hf="circle",Nf="ellipse",Kf="cover",Vf="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(au),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 Hf:return t=0,!1;case Nf:return t=1,!1;case"at":return c=!0,!1;case Of:return r=0,!1;case Kf:case Mf:return r=1,!1;case Vf:case Lf:return r=2,!1;case Df: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(au),!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 Hf:return t=0,!1;case Nf:return t=1,!1;case Vf:case Of:return r=0,!1;case Mf:return r=1,!1;case Lf:return r=2,!1;case Kf:case Df: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},pu={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=Gf[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||!!Gf[n.name])}var Gf={"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 pu.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(ff)}},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 ff(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},jf=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:pu.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}}},fu={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&&ou(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},Wf={type:16,number:50,flags:vA},OE=[Wf,Wf],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")}},qf={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(pf),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(pf),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 qf.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}},Jf=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&&ou(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];ou(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,fu,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}(),zf=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 df,i=t!==null&&typeof t<"u"?t.toString():e.initialValue;r.write(i);var A=new hf(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 pu.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 qf.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}},gu=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,gu(t,3),this.styles=new sU(e,window.getComputedStyle(t,null)),Iu(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),gu(t,4)&&(this.flags|=16)}return n}(),uU="AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=",Xf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",kA=typeof Uint8Array>"u"?[]:new Uint8Array(256),po=0;po<Xf.length;po++)kA[Xf.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,mu=6+5,vu=2,pU=mu-Lr,Yf=65536>>Lr,fU=1<<Lr,yu=fU-1,gU=1024>>Lr,mU=Yf+gU,vU=mU,yU=32,wU=vU+yU,bU=65536>>mu,BU=1<<pU,CU=BU-1,Zf=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=Zf(i,A/2,r[4]/2),o=r[5]===2?Zf(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<<vu)+(e&yu),this.data[t];if(e<=65535)return t=this.index[Yf+(e-55296>>Lr)],t=(t<<vu)+(e&yu),this.data[t];if(e<this.highStart)return t=wU-bU+(e>>mu),t=this.index[t],t+=e>>Lr&CU,t=this.index[t],t=(t<<vu)+(e&yu),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},n}(),$f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",EU=typeof Uint8Array>"u"?[]:new Uint8Array(256),fo=0;fo<$f.length;fo++)EU[$f.charCodeAt(fo)]=fo;var UU=1,wu=2,bu=3,eg=4,tg=5,TU=7,ng=8,Bu=9,Cu=10,rg=11,ig=12,Ag=13,sg=14,_u=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="×",Su="÷",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===wu&&s===bu)return qt;if(A===wu||A===bu||A===eg||s===wu||s===bu||s===eg)return Su;if(A===ng&&[ng,Bu,rg,ig].indexOf(s)!==-1||(A===rg||A===Bu)&&(s===Bu||s===Cu)||(A===ig||A===Cu)&&s===Cu||s===Ag||s===tg||s===TU||A===UU)return qt;if(A===Ag&&s===sg){for(;i===tg;)i=e[--r];if(i===sg)return qt}if(A===_u&&s===_u){for(var o=0;i===_u;)o++,i=e[--r];if(o%2===0)return qt}return Su},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"?"👨".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},og=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=ku(t,t,0,0,i);return r.fillStyle="red",r.fillRect(0,0,t,t),ag(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"),og(a)?ag(ku(t,t,0,0,c)):Promise.reject(!1)}).then(function(o){return r.drawImage(o,0,0),og(r.getImageData(0,0,t,t).data)}).catch(function(){return!1})},ku=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},ag=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=cg(r,s,o.length).getClientRects();if(a.length>1){var c=Eu(o),u=0;c.forEach(function(d){A.push(new EA(d,Qn.fromDOMRectList(n,cg(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},cg=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},Eu=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?Eu(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},ug=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),lg=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),dg=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),hg=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),Uu=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",pg=707406591,Tu=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),fg=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),gg=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),mg=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=yg(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,wg(i)&&i.data.length>0)t.textNodes.push(new zU(n,i,t.styles));else if(gi(i))if(kg(i)&&i.assignedNodes)i.assignedNodes().forEach(function(o){return vo(n,o,t,r)});else{var s=vg(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)&&!bg(i)&&!bo(i)&&vo(n,i,s,r))}},vg=function(n,e){return xu(e)?new ug(n,e):Bg(e)?new lg(n,e):bg(e)?new dg(n,e):o1(e)?new hg(n,e):a1(e)?new Uu(n,e):c1(e)?new Tu(n,e):bo(e)?new fg(n,e):wo(e)?new gg(n,e):_g(e)?new mg(n,e):new bn(n,e)},yg=function(n,e){var t=vg(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()||Fu(n)&&t.styles.isTransparent()},s1=function(n){return n.isPositioned()||n.isFloating()},wg=function(n){return n.nodeType===Node.TEXT_NODE},gi=function(n){return n.nodeType===Node.ELEMENT_NODE},Iu=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"},bg=function(n){return n.tagName==="svg"},Fu=function(n){return n.tagName==="BODY"},Bg=function(n){return n.tagName==="CANVAS"},Cg=function(n){return n.tagName==="VIDEO"},xu=function(n){return n.tagName==="IMG"},_g=function(n){return n.tagName==="IFRAME"},Sg=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"},kg=function(n){return n.tagName==="SLOT"},Eg=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}(),Ug={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"]},Tg={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},Ig=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?"-":"")+(Ig(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 Ig(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},Fg="十百千萬",xg="拾佰仟萬",Qg="マイナス",Qu="마이너스",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,Ug,3,r).toLowerCase();case 7:return mi(n,1,3999,Ug,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,Tg,3,r);case 35:return mi(n,1,9999,Tg,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,"零一二三四五六七八九",Fg,"負",i,Ar|sr|UA);case 47:return Pn(n,"零壹貳參肆伍陸柒捌玖",xg,"負",i,vi|Ar|sr|UA);case 42:return Pn(n,"零一二三四五六七八九",Fg,"负",i,Ar|sr|UA);case 41:return Pn(n,"零壹贰叁肆伍陆柒捌玖",xg,"负",i,vi|Ar|sr|UA);case 26:return Pn(n,"〇一二三四五六七八九","十百千万",Qg,i,0);case 25:return Pn(n,"零壱弐参四伍六七八九","拾百千万",Qg,i,vi|Ar|sr);case 31:return Pn(n,"영일이삼사오육칠팔구","십백천만",Qu,A,vi|Ar|sr);case 33:return Pn(n,"零一二三四五六七八九","十百千萬",Qu,A,0);case 32:return Pn(n,"零壹貳參四五六七八九","拾百千",Qu,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)}},Rg="data-html2canvas-ignore",Pg=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(gu(e,2),Bg(e))return this.createCanvasClone(e);if(Cg(e))return this.createVideoClone(e);if(Sg(e))return this.createStyleClone(e);var t=e.cloneNode(!1);return xu(t)&&(xu(e)&&e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=""),t.loading==="lazy"&&(t.loading="eager")),Eg(t)?this.createCustomElementClone(t):t},n.prototype.createCustomElementClone=function(e){var t=document.createElement("html2canvascustomelement");return Ru(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(Rg)&&(typeof this.options.ignoreElements!="function"||!this.options.ignoreElements(t)))&&(!this.options.copyStyles||!gi(t)||!Sg(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)&&kg(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(wg(e))return document.createTextNode(e.data);if(!e.ownerDocument)return e.cloneNode(!1);var r=e.ownerDocument.defaultView;if(r&&gi(e)&&(Iu(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&&Iu(i)&&(this.clonedReferenceElement=i),Fu(i)&&S1(i);var a=this.counters.parse(new zf(this.context,A)),c=this.resolvePseudoContent(e,i,s,IA.BEFORE);Eg(e)&&(t=!0),Cg(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))&&!_g(e)||t)&&Ru(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 zf(this.context,r));var a=new oU(this.context,r),c=o.createElement("html2canvaspseudoelement");Ru(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)?fu.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)?fu.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(Jf(a.quotes,A.quoteDepth++,!0)));break;case"close-quote":c.appendChild(o.createTextNode(Jf(a.quotes,--A.quoteDepth,!1)));break;default:c.appendChild(o.createTextNode(l.value))}}),c.className="".concat(Pu," ").concat(Ou);var u=i===IA.BEFORE?" ".concat(Pu):" ".concat(Ou);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(Rg,"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"],Ru=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",Pu="___html2canvas___pseudoelement_before",Ou="___html2canvas___pseudoelement_after",Og=`{
|
|
5
|
+
*/var Hc=function(n,e){return Hc=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])},Hc(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");Hc(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Nc=function(){return Nc=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},Nc.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},Pp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",qC=typeof Uint8Array>"u"?[]:new Uint8Array(256),xs=0;xs<Pp.length;xs++)qC[Pp.charCodeAt(xs)]=xs;for(var Op="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",lA=typeof Uint8Array>"u"?[]:new Uint8Array(256),Qs=0;Qs<Op.length;Qs++)lA[Op.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,Kc=6+5,Vc=2,YC=Kc-Qr,Mp=65536>>Qr,ZC=1<<Qr,Gc=ZC-1,$C=1024>>Qr,e_=Mp+$C,t_=e_,n_=32,r_=t_+n_,i_=65536>>Kc,A_=1<<YC,s_=A_-1,Lp=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=Lp(i,A/2,r[4]/2),o=r[5]===2?Lp(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<<Vc)+(e&Gc),this.data[t];if(e<=65535)return t=this.index[Mp+(e-55296>>Qr)],t=(t<<Vc)+(e&Gc),this.data[t];if(e<this.highStart)return t=r_-i_+(e>>Kc),t=this.index[t],t+=e>>Qr&s_,t=this.index[t],t=(t<<Vc)+(e&Gc),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},n}(),Dp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u_=typeof Uint8Array>"u"?[]:new Uint8Array(256),Rs=0;Rs<Dp.length;Rs++)u_[Dp.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==",Hp=50,d_=1,Np=2,Kp=3,h_=4,p_=5,Vp=7,Gp=8,jp=9,Yn=10,jc=11,Wp=12,Wc=13,f_=14,dA=15,qc=16,Ps=17,hA=18,g_=19,qp=20,Jc=21,pA=22,zc=23,li=24,Gt=25,fA=26,gA=27,di=28,m_=29,Rr=30,v_=31,Os=32,Ms=33,Xc=34,Yc=35,Zc=36,mA=37,$c=38,Ls=39,Ds=40,eu=41,Jp=42,y_=43,w_=[9001,65288],zp="!",ie="×",Hs="÷",tu=a_(l_),Rn=[Rr,Zc],nu=[d_,Np,Kp,p_],Xp=[Yn,Gp],Yp=[gA,fA],b_=nu.concat(Xp),Zp=[$c,Ls,Ds,Xc,Yc],B_=[dA,Wc],C_=function(n,e){e===void 0&&(e="strict");var t=[],r=[],i=[];return n.forEach(function(A,s){var o=tu.get(A);if(o>Hp?(i.push(!0),o-=Hp):i.push(!1),["normal","auto","loose"].indexOf(e)!==-1&&[8208,8211,12316,12448].indexOf(A)!==-1)return r.push(s),t.push(qc);if(o===h_||o===jc){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"?Jc:mA);if(o===Jp||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]},ru=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},$p=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===Np&&u===Kp)return ie;if(nu.indexOf(a)!==-1)return zp;if(nu.indexOf(u)!==-1||Xp.indexOf(u)!==-1)return ie;if($p(A,e)===Gp)return Hs;if(tu.get(n[A])===jc||(a===Os||a===Ms)&&tu.get(n[o])===jc||a===Vp||u===Vp||a===jp||[Yn,Wc,dA].indexOf(a)===-1&&u===jp||[Ps,hA,g_,li,di].indexOf(u)!==-1||$p(A,e)===pA||ru(zc,pA,A,e)||ru([Ps,hA],Jc,A,e)||ru(Wp,Wp,A,e))return ie;if(a===Yn)return Hs;if(a===zc||u===zc)return ie;if(u===qc||a===qc)return Hs;if([Wc,dA,Jc].indexOf(u)!==-1||a===f_||c===Zc&&B_.indexOf(a)!==-1||a===di&&u===Zc||u===qp||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&&Yp.indexOf(u)!==-1||Yp.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($c===a&&[$c,Ls,Xc,Yc].indexOf(u)!==-1||[Ls,Xc].indexOf(a)!==-1&&[Ls,Ds].indexOf(u)!==-1||[Ds,Yc].indexOf(a)!==-1&&u===Ds||Zp.indexOf(a)!==-1&&[qp,fA].indexOf(u)!==-1||Zp.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===eu&&u===eu){for(var h=t[A],f=1;h>0&&(h--,e[h]===eu);)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,Jp].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===zp,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,ef=8,Ns=10,tf=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,nf=124,j_=126,W_=128,rf=65533,iu=42,Pr=43,q_=44,J_=58,z_=59,BA=46,X_=0,Y_=8,Z_=11,$_=14,eS=31,tS=127,mn=-1,Af=48,sf=97,of=101,nS=102,rS=117,iS=122,af=65,cf=69,uf=70,AS=85,sS=90,Ct=function(n){return n>=Af&&n<=57},oS=function(n){return n>=55296&&n<=57343},hi=function(n){return Ct(n)||n>=af&&n<=uf||n>=sf&&n<=nS},aS=function(n){return n>=sf&&n<=iS},cS=function(n){return n>=af&&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_},lf=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))},Au=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]===cf||n[e]===of)&&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},su={type:32},df=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!==su;)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(lf(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 iu:if(this.peekCodePoint(0)===wA)return this.consumeCodePoint(),_S;break;case Pr:if(Au(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(Au(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(Au(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case tf:if(this.peekCodePoint(0)===iu)for(this.consumeCodePoint();;){var u=this.consumeCodePoint();if(u===iu&&(u=this.consumeCodePoint(),u===tf))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 nf:if(this.peekCodePoint(0)===wA)return this.consumeCodePoint(),wS;if(this.peekCodePoint(0)===nf)return this.consumeCodePoint(),yS;break;case j_:if(this.peekCodePoint(0)===wA)return this.consumeCodePoint(),bS;break;case mn:return su}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?Af:a})),16),A=parseInt($e.apply(void 0,e.map(function(a){return a===js?uf: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=ef;Ct(this.peekCodePoint(0));)e.push(this.consumeCodePoint());r=this.peekCodePoint(0),i=this.peekCodePoint(1);var A=this.peekCodePoint(2);if((r===cf||r===of)&&((i===Pr||i===Rt)&&Ct(A)||Ct(i)))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=ef;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?rf:r}return e===mn?rf:e},n.prototype.consumeName=function(){for(var e="";;){var t=this.consumeCodePoint();if(lf(t))e+=$e(t);else if(Zn(t,this.peekCodePoint(0)))e+=$e(this.consumeEscapedCodePoint());else return this.reconsumeCodePoint(t),e}},n}(),hf=function(){function n(e){this._tokens=e}return n.create=function(e){var t=new df;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"?su: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},ou=function(n,e){return ae(n)&&n.value===e},pf=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)},ff=function(n){return n.length>1?[n[0],n[1]]:[n[0]]},mt={type:17,number:0,flags:vA},au={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},gf="deg",mf="grad",vf="rad",yf="turn",Xs={name:"angle",parse:function(n,e){if(e.type===15)switch(e.unit){case gf:return Math.PI*e.number/180;case mf:return Math.PI/200*e.number;case vf:return e.number;case yf:return Math.PI*2*e.number}throw new Error("Unsupported angle type")}},wf=function(n){return n.type===15&&(n.unit===gf||n.unit===mf||n.unit===vf||n.unit===yf)},bf=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))},cu=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 cu([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=Sf(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=_f(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]},Cf=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=Ef([r,i,A]);return yn(o[0]*255,o[1]*255,o[2]*255,i===0?1:s)},_f=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]},Sf=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]},kf=function(n){return Pt([1.0479297925449969,.022946870601609652,-.05019226628920524,.02962780877005599,.9904344267538799,-.017073799063418826,-.009243040646204504,.015055191490298152,.7518742814281371],n)},uu=function(n){return Pt([.955473421488075,-.02309845494876471,.06325924320057072,-.0283697093338637,1.0099953980813041,.021041441191917323,.012314014864481998,-.020507649298898964,1.330365926242124],n)},lu=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},Ef=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=lu(A,i,e+1/3),o=lu(A,i,e),a=lu(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 uu([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=hu([i/255,A/255,s/255]),a=du([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=hu([i/255,A/255,s/255]),f=du([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=hu(Ef([r,i,A])),a=du([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=_f(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=Sf(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 uu([n[0],n[1],n[2]])},Uf=function(n){return n},qS=function(n){var e=kf([n[0],n[2],n[3]]),t=e[0],r=e[1],i=e[2];return[t,r,i,n[3]]},Tf=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)},du=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})},hu=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 cu([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 uu(uk([e[0],e[1],e[2]]))},fk=function(n){var e=hk(lk(kf([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,If=.018053968510807,mk=function(n){return n.map(function(e){return e<If*4.5?e/4.5:Math.pow((e+no-1)/no,1/.45)})},vk=function(n){return n.map(function(e){return e>=If?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=Ff(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}},Ff=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]},xf=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=Qf[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=Ff(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=Qf[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 F=_(n,f),x=k(F),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])}},Qf={srgb:PS,"srgb-linear":cu,"display-p3":rk,"a98-rgb":ck,"prophoto-rgb":gk,xyz:Tf,"xyz-d50":JS,"xyz-d65":Tf,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:Uf,"xyz-d50":qS,"xyz-d65":Uf,rec2020:Bk},Ek={hsl:Cf,hsla:Cf,rgb:xf,rgba:xf,lch:DS,oklch:LS,oklab:MS,lab:OS,color:_k},pi=function(n,e){return ir.parse(n,hf.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}},Rf=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)},Pf=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=Pf(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=Pf(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=bf(i);return}else if(wf(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=bf(i);return}else if(wf(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}},Of="closest-side",Mf="farthest-side",Lf="closest-corner",Df="farthest-corner",Hf="circle",Nf="ellipse",Kf="cover",Vf="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(au),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 Hf:return t=0,!1;case Nf:return t=1,!1;case"at":return c=!0,!1;case Of:return r=0,!1;case Kf:case Mf:return r=1,!1;case Vf:case Lf:return r=2,!1;case Df: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(au),!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 Hf:return t=0,!1;case Nf:return t=1,!1;case Vf:case Of:return r=0,!1;case Mf:return r=1,!1;case Lf:return r=2,!1;case Kf:case Df: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},pu={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=Gf[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||!!Gf[n.name])}var Gf={"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 pu.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(ff)}},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 ff(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},jf=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:pu.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}}},fu={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&&ou(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},Wf={type:16,number:50,flags:vA},OE=[Wf,Wf],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")}},qf={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(pf),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(pf),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 qf.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}},Jf=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&&ou(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];ou(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,fu,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}(),zf=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 df,i=t!==null&&typeof t<"u"?t.toString():e.initialValue;r.write(i);var A=new hf(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 pu.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 qf.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}},gu=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,gu(t,3),this.styles=new sU(e,window.getComputedStyle(t,null)),Iu(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),gu(t,4)&&(this.flags|=16)}return n}(),uU="AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=",Xf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",kA=typeof Uint8Array>"u"?[]:new Uint8Array(256),po=0;po<Xf.length;po++)kA[Xf.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,mu=6+5,vu=2,pU=mu-Lr,Yf=65536>>Lr,fU=1<<Lr,yu=fU-1,gU=1024>>Lr,mU=Yf+gU,vU=mU,yU=32,wU=vU+yU,bU=65536>>mu,BU=1<<pU,CU=BU-1,Zf=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=Zf(i,A/2,r[4]/2),o=r[5]===2?Zf(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<<vu)+(e&yu),this.data[t];if(e<=65535)return t=this.index[Yf+(e-55296>>Lr)],t=(t<<vu)+(e&yu),this.data[t];if(e<this.highStart)return t=wU-bU+(e>>mu),t=this.index[t],t+=e>>Lr&CU,t=this.index[t],t=(t<<vu)+(e&yu),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},n}(),$f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",EU=typeof Uint8Array>"u"?[]:new Uint8Array(256),fo=0;fo<$f.length;fo++)EU[$f.charCodeAt(fo)]=fo;var UU=1,wu=2,bu=3,eg=4,tg=5,TU=7,ng=8,Bu=9,Cu=10,rg=11,ig=12,Ag=13,sg=14,_u=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="×",Su="÷",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===wu&&s===bu)return qt;if(A===wu||A===bu||A===eg||s===wu||s===bu||s===eg)return Su;if(A===ng&&[ng,Bu,rg,ig].indexOf(s)!==-1||(A===rg||A===Bu)&&(s===Bu||s===Cu)||(A===ig||A===Cu)&&s===Cu||s===Ag||s===tg||s===TU||A===UU)return qt;if(A===Ag&&s===sg){for(;i===tg;)i=e[--r];if(i===sg)return qt}if(A===_u&&s===_u){for(var o=0;i===_u;)o++,i=e[--r];if(o%2===0)return qt}return Su},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"?"👨".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},og=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=ku(t,t,0,0,i);return r.fillStyle="red",r.fillRect(0,0,t,t),ag(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"),og(a)?ag(ku(t,t,0,0,c)):Promise.reject(!1)}).then(function(o){return r.drawImage(o,0,0),og(r.getImageData(0,0,t,t).data)}).catch(function(){return!1})},ku=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},ag=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=cg(r,s,o.length).getClientRects();if(a.length>1){var c=Eu(o),u=0;c.forEach(function(d){A.push(new EA(d,Qn.fromDOMRectList(n,cg(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},cg=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},Eu=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?Eu(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},ug=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),lg=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),dg=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),hg=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),Uu=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",pg=707406591,Tu=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),fg=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),gg=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),mg=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=yg(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,wg(i)&&i.data.length>0)t.textNodes.push(new zU(n,i,t.styles));else if(gi(i))if(kg(i)&&i.assignedNodes)i.assignedNodes().forEach(function(o){return vo(n,o,t,r)});else{var s=vg(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)&&!bg(i)&&!bo(i)&&vo(n,i,s,r))}},vg=function(n,e){return xu(e)?new ug(n,e):Bg(e)?new lg(n,e):bg(e)?new dg(n,e):o1(e)?new hg(n,e):a1(e)?new Uu(n,e):c1(e)?new Tu(n,e):bo(e)?new fg(n,e):wo(e)?new gg(n,e):_g(e)?new mg(n,e):new bn(n,e)},yg=function(n,e){var t=vg(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()||Fu(n)&&t.styles.isTransparent()},s1=function(n){return n.isPositioned()||n.isFloating()},wg=function(n){return n.nodeType===Node.TEXT_NODE},gi=function(n){return n.nodeType===Node.ELEMENT_NODE},Iu=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"},bg=function(n){return n.tagName==="svg"},Fu=function(n){return n.tagName==="BODY"},Bg=function(n){return n.tagName==="CANVAS"},Cg=function(n){return n.tagName==="VIDEO"},xu=function(n){return n.tagName==="IMG"},_g=function(n){return n.tagName==="IFRAME"},Sg=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"},kg=function(n){return n.tagName==="SLOT"},Eg=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}(),Ug={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"]},Tg={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},Ig=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?"-":"")+(Ig(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 Ig(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},Fg="十百千萬",xg="拾佰仟萬",Qg="マイナス",Qu="마이너스",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,Ug,3,r).toLowerCase();case 7:return mi(n,1,3999,Ug,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,Tg,3,r);case 35:return mi(n,1,9999,Tg,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,"零一二三四五六七八九",Fg,"負",i,Ar|sr|UA);case 47:return Pn(n,"零壹貳參肆伍陸柒捌玖",xg,"負",i,vi|Ar|sr|UA);case 42:return Pn(n,"零一二三四五六七八九",Fg,"负",i,Ar|sr|UA);case 41:return Pn(n,"零壹贰叁肆伍陆柒捌玖",xg,"负",i,vi|Ar|sr|UA);case 26:return Pn(n,"〇一二三四五六七八九","十百千万",Qg,i,0);case 25:return Pn(n,"零壱弐参四伍六七八九","拾百千万",Qg,i,vi|Ar|sr);case 31:return Pn(n,"영일이삼사오육칠팔구","십백천만",Qu,A,vi|Ar|sr);case 33:return Pn(n,"零一二三四五六七八九","十百千萬",Qu,A,0);case 32:return Pn(n,"零壹貳參四五六七八九","拾百千",Qu,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)}},Rg="data-html2canvas-ignore",Pg=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(gu(e,2),Bg(e))return this.createCanvasClone(e);if(Cg(e))return this.createVideoClone(e);if(Sg(e))return this.createStyleClone(e);var t=e.cloneNode(!1);return xu(t)&&(xu(e)&&e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=""),t.loading==="lazy"&&(t.loading="eager")),Eg(t)?this.createCustomElementClone(t):t},n.prototype.createCustomElementClone=function(e){var t=document.createElement("html2canvascustomelement");return Ru(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(Rg)&&(typeof this.options.ignoreElements!="function"||!this.options.ignoreElements(t)))&&(!this.options.copyStyles||!gi(t)||!Sg(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)&&kg(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(wg(e))return document.createTextNode(e.data);if(!e.ownerDocument)return e.cloneNode(!1);var r=e.ownerDocument.defaultView;if(r&&gi(e)&&(Iu(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&&Iu(i)&&(this.clonedReferenceElement=i),Fu(i)&&S1(i);var a=this.counters.parse(new zf(this.context,A)),c=this.resolvePseudoContent(e,i,s,IA.BEFORE);Eg(e)&&(t=!0),Cg(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))&&!_g(e)||t)&&Ru(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 zf(this.context,r));var a=new oU(this.context,r),c=o.createElement("html2canvaspseudoelement");Ru(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)?fu.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)?fu.parse(A.context,g.value):3,k=B&&B.type===0?B.value:"",T=w.map(function(I){return TA(I,_,!1)}).join(k);c.appendChild(o.createTextNode(T))}}}else if(l.type===20)switch(l.value){case"open-quote":c.appendChild(o.createTextNode(Jf(a.quotes,A.quoteDepth++,!0)));break;case"close-quote":c.appendChild(o.createTextNode(Jf(a.quotes,--A.quoteDepth,!1)));break;default:c.appendChild(o.createTextNode(l.value))}}),c.className="".concat(Pu," ").concat(Ou);var u=i===IA.BEFORE?" ".concat(Pu):" ".concat(Ou);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(Rg,"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"],Ru=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",Pu="___html2canvas___pseudoelement_before",Ou="___html2canvas___pseudoelement_after",Og=`{
|
|
6
6
|
content: "" !important;
|
|
7
7
|
display: none !important;
|
|
8
8
|
}`,S1=function(n){k1(n,".".concat(Pu).concat(C1).concat(Og,`
|
|
9
|
-
.`).concat(Ou).concat(_1).concat(Og))},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)},Mu=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)||(Du(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,Mu.isSameOrigin)];case 1:return r=a.sent(),[3,3];case 2:r=Mu.isSameOrigin(e),a.label=3;case 3:return t=r,i=!Lu(e)&&this._options.useCORS===!0&&vt.SUPPORT_CORS_IMAGES&&!t,A=!Lu(e)&&!t&&!Du(e)&&typeof this._options.proxy=="string"&&vt.SUPPORT_CORS_XHR&&!i,!t&&this._options.allowTaint===!1&&!Lu(e)&&!Du(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)},Lu=function(n){return F1.test(n)},Q1=function(n){return I1.test(n)},Du=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},Mg=function(n){return n.type===1},H1=function(n){return n.type===2},Lg=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})},Dg=function(){function n(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return n}(),Hg=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);Lg(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!Mg(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);Lg(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}(),Hu=function(n,e,t,r){n.container.elements.forEach(function(i){var A=ct(i.flags,4),s=ct(i.flags,2),o=new Hg(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 Dg(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);Hu(o,u,A?u:t,a)}else i.styles.isInlineLevel()?e.inlineLevel.push(o):e.nonInlineLevel.push(o),Hu(o,e,t,a);ct(i.flags,8)&&Ng(i,a)})},Ng=function(n,e){for(var t=n instanceof Uu?n.start:1,r=n instanceof Uu?n.reversed:!1,i=0;i<e.length;i++){var A=e[i];A.container instanceof hg&&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 Hg(n,null),t=new Dg(e),r=[];return Hu(e,t,t,r),Ng(e.container,r),t},Kg=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},Vg=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):Vg(e)},q1=function(n,e){return n===0?e.bounds:n===2?Eo(e):Vg(e)},Nu=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",Gg="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(Gg)),r.appendChild(A),r.appendChild(i);var o=i.offsetTop-A.offsetTop+2;r.removeChild(A),r.appendChild(this._document.createTextNode(Gg)),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}(),jg=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)),Mg(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=Eu(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 ug))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 lg&&this.renderReplacedElement(r,i,r.canvas),!(r instanceof dg))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 mg&&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 Tu&&(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(pg),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(pg),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,jf(A.lineHeight,A.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new EA(t.listValue,_),A.letterSpacing,jf(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=Nu(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=Nu(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,_),Rf(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=Nu(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?[au]: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),Rf(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(Kg(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=Kg(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}(jg),eT=function(n){return n instanceof gg||n instanceof fg?!0:n instanceof Tu&&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=ku(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}(jg),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"&&Mu.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=Nc({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 Pg(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=Fu(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"),_=yg(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)&&(Pg.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,Wg=(n,e,t)=>pT(n,typeof e!="symbol"?e+"":e,t);let Ot=class{constructor(){Wg(this,"_locking"),Wg(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 Ku(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 qg(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 Jg=Symbol("@bufbuild/protobuf/enum-type");function wT(n){const e=n[Jg];return Je(e,"missing enum type on enum object"),e}function zg(n,e,t,r){n[Jg]=Xg(e,t.map(i=>({no:i.no,name:i.name,localName:n[i.no]})))}function Xg(n,e,t){const r=Object.create(null),i=Object.create(null),A=[];for(const s of e){const o=Yg(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=Yg(i);r[A.localName]=A.no,r[A.no]=A.localName}return zg(r,n,e),r}function Yg(n){return"localName"in n?n:Object.assign(Object.assign({},n),{localName:n.name})}class Vu{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 Vu),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 Gu(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 Zg(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?em(r,i):ju(r,i)}function _T(n,e){let t=ju(n,e);const r=t.hi&2147483648;r&&(t=em(t.lo,t.hi));const i=$g(t.lo,t.hi);return r?"-"+i:i}function $g(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()+tm(s)+tm(A)}function ST(n,e){return{lo:n>>>0,hi:e>>>0}}function ju(n,e){return{lo:n|0,hi:e|0}}function em(n,e){return e=~e,n?n=~n+1:e+=1,ju(n,e)}const tm=n=>{const e=String(n);return"0000000".slice(e.length)+e};function nm(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),Zg(i)},uEnc(i){return typeof i!="string"&&(i=i.toString()),r(i),Zg(i)},dec(i,A){return _T(i,A)},uDec(i,A){return $g(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 rm(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(Ku(e);e>127;)this.buf.push(e&127|128),e=e>>>7;return this.buf.push(e),this}int32(e){return To(e),nm(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){qg(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){Ku(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,nm(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 Gu(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 Gu(i,A,this.buf),this}uint64(e){let t=Ne.uEnc(e);return Gu(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 im(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 Am={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){om(e,n);const r=e.runtime.bin.makeReadOptions(t),i=xT(n.getType().runtime.bin.listUnknownFields(n),e.field),[A,s]=im(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){om(e,n);const i=e.runtime.bin.makeReadOptions(r),A=e.runtime.bin.makeWriteOptions(r);if(sm(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 sm(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 om(n,e){Je(n.extendee.typeName==e.getType().typeName,"extension ".concat(n.typeName," can only be applied to message ").concat(n.extendee.typeName))}function am(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:!rm(n.T,e[t]);case"message":return e[t]!==void 0;case"map":return Object.keys(e[t]).length>0}}function cm(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(Vu.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 um(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 lm={ignoreUnknownFields:!1},dm={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0};function PT(n){return n?Object.assign(Object.assign({},lm),n):lm}function OT(n){return n?Object.assign(Object.assign({},dm),n):dm}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)}hm(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]=im(u);hm(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(!am(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=pm(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&&sm(n,o)){const a=QT(n,o,e),c=pm(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||rm(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 hm(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=Wu(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=Wu(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=Wu(t.T,e,r.ignoreUnknownFields,!1);switch(a){case xo:cm(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:cm(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&&qg(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?Ku(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 Am.dec(e)}throw new Error}function Wu(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 pm(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()]=qu(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(qu(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 qu(n.T,e,t.enumAsInteger);case"message":return um(n.T,e).toJson(t)}}function qu(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),Am.enc(e)}}const Ci=Symbol("@bufbuild/protobuf/unknown-fields"),fm={readUnknownFields:!0,readerFactory:n=>new TT(n)},gm={writeUnknownFields:!0,writerFactory:()=>new UT};function HT(n){return n?Object.assign(Object.assign({},fm),n):fm}function NT(n){return n?Object.assign(Object.assign({},gm),n):gm}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}mm(n,e,c,a,r)}if(i&&(a!=tt.EndGroup||o!==t))throw new Error("invalid end group tag")},readField:mm,writeMessage(n,e,t){const r=n.getType();for(const i of r.fields.byNumber()){if(!am(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];vm(i,A,e,t)}return t.writeUnknownFields&&this.writeUnknownFields(n,e),e},writeField(n,e,t,r){e!==void 0&&vm(n,e,t,r)}}}function mm(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 vm(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)ym(t,r,n,s)}else ym(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 ym(n,e,t,r){const i=um(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]=wm(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]=wm(e);for(let A=0;A<r.length;A++)n[i](r[A]);n.join()}function wm(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:zg,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:Xg,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 bm(n,e){const t=Bm(n);return e?t:tI(eI(t))}function XT(n){return bm(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"]),Cm=n=>"".concat(n,"$"),eI=n=>$T.has(n)?Cm(n):n,tI=n=>ZT.has(n)?Cm(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=bm(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 Vu{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}]),_m=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:Mm}]),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:Mm},{no:19,name:"audio_features",kind:"enum",T:U.getEnumType(sn),repeated:!0},{no:20,name:"backup_codec_policy",kind:"enum",T:U.getEnumType(_m)}]),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:km,oneof:"value"},{no:3,name:"speaker",kind:"message",T:dI,oneof:"value"},{no:6,name:"sip_dtmf",kind:"message",T:Em,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:Ju,oneof:"value"},{no:10,name:"rpc_request",kind:"message",T:Um,oneof:"value"},{no:11,name:"rpc_ack",kind:"message",T:Tm,oneof:"value"},{no:12,name:"rpc_response",kind:"message",T:Im,oneof:"value"},{no:13,name:"stream_header",kind:"message",T:Xu,oneof:"value"},{no:14,name:"stream_chunk",kind:"message",T:Yu,oneof:"value"},{no:15,name:"stream_trailer",kind:"message",T:Zu,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:Sm,repeated:!0}]),Sm=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}]),km=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}]),Em=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}]),Ju=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}]),Um=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}]),Tm=U.makeMessageType("livekit.RpcAck",()=>[{no:1,name:"request_id",kind:"scalar",T:9}]),Im=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:Fm,oneof:"value"}]),Fm=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}]),xm=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(Qm)},{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}]),Qm=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(Rm)},{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}]),Rm=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"}]),Pm=U.makeMessageType("livekit.ClientConfiguration",()=>[{no:1,name:"video",kind:"message",T:Om},{no:2,name:"screen",kind:"message",T:Om},{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)}]),Om=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}]),Mm=U.makeMessageType("livekit.TimedVersion",()=>[{no:1,name:"unix_micro",kind:"scalar",T:3},{no:2,name:"ticks",kind:"scalar",T:5}]),zu=U.makeEnum("livekit.DataStream.OperationType",[{no:0,name:"CREATE"},{no:1,name:"UPDATE"},{no:2,name:"DELETE"},{no:3,name:"REACTION"}]),Lm=U.makeMessageType("livekit.DataStream.TextHeader",()=>[{no:1,name:"operation_type",kind:"enum",T:U.getEnumType(zu)},{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"}),Dm=U.makeMessageType("livekit.DataStream.ByteHeader",()=>[{no:1,name:"name",kind:"scalar",T:9}],{localName:"DataStream_ByteHeader"}),Xu=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:Lm,oneof:"content_header"},{no:10,name:"byte_header",kind:"message",T:Dm,oneof:"content_header"}],{localName:"DataStream_Header"}),Yu=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"}),Zu=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"}]),$u=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:nl,oneof:"message"},{no:4,name:"add_track",kind:"message",T:tl,oneof:"message"},{no:5,name:"mute",kind:"message",T:rl,oneof:"message"},{no:6,name:"subscription",kind:"message",T:No,oneof:"message"},{no:7,name:"track_setting",kind:"message",T:Nm,oneof:"message"},{no:8,name:"leave",kind:"message",T:Ko,oneof:"message"},{no:10,name:"update_layers",kind:"message",T:Vm,oneof:"message"},{no:11,name:"subscription_permission",kind:"message",T:qm,oneof:"message"},{no:12,name:"sync_state",kind:"message",T:Jm,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:Gm,oneof:"message"},{no:16,name:"ping_req",kind:"message",T:Xm,oneof:"message"},{no:17,name:"update_audio_track",kind:"message",T:Km,oneof:"message"},{no:18,name:"update_video_track",kind:"message",T:_I,oneof:"message"}]),Hm=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:nl,oneof:"message"},{no:5,name:"update",kind:"message",T:CI,oneof:"message"},{no:6,name:"track_published",kind:"message",T:il,oneof:"message"},{no:8,name:"leave",kind:"message",T:Ko,oneof:"message"},{no:9,name:"mute",kind:"message",T:rl,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"}]),el=U.makeMessageType("livekit.SimulcastCodec",()=>[{no:1,name:"codec",kind:"scalar",T:9},{no:2,name:"cid",kind:"scalar",T:9}]),tl=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:el,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(_m)},{no:17,name:"audio_features",kind:"enum",T:U.getEnumType(sn),repeated:!0}]),nl=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}]),rl=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:jm,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:Pm},{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:jm,repeated:!0},{no:2,name:"client_configuration",kind:"message",T:Pm}]),il=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:xm,repeated:!0}]),Nm=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}]),Km=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"}]),Vm=U.makeMessageType("livekit.UpdateVideoLayers",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"layers",kind:"message",T:Kr,repeated:!0}]),Gm=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}]),jm=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:Sm,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($u)}]),II=U.makeMessageType("livekit.StreamStateUpdate",()=>[{no:1,name:"stream_states",kind:"message",T:TI,repeated:!0}]),Al=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:Al,repeated:!0}]),xI=U.makeMessageType("livekit.SubscribedQualityUpdate",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"subscribed_qualities",kind:"message",T:Al,repeated:!0},{no:3,name:"subscribed_codecs",kind:"message",T:FI,repeated:!0}]),Wm=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}]),qm=U.makeMessageType("livekit.SubscriptionPermission",()=>[{no:1,name:"all_participants",kind:"scalar",T:8},{no:2,name:"track_permissions",kind:"message",T:Wm,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}]),Jm=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:il,repeated:!0},{no:4,name:"data_channels",kind:"message",T:zm,repeated:!0},{no:5,name:"offer",kind:"message",T:Vr},{no:6,name:"track_sids_disabled",kind:"scalar",T:9,repeated:!0}]),zm=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"}]),Xm=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(sl)},{no:3,name:"message",kind:"scalar",T:9}]),sl=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,Ym;function VI(){return Ym||(Ym=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(),ol;(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"})(ol||(ol={}));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(ol.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 Zm(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 Zm=="function"?Zm(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:{}},$m;function JI(){if($m)return jo.exports;$m=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 ev=!0,tv=!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."):(ev=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."):(tv=!n,"adapter.js deprecation warnings "+(n?"disabled":"enabled"))}function nv(){if(typeof window=="object"){if(ev)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function al(n,e){tv&&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 rv(n){return Object.prototype.toString.call(n)==="[object Object]"}function iv(n){return rv(n)?Object.keys(n).reduce(function(e,t){const r=rv(n[t]),i=r?iv(n[t]):n[t],A=r&&!Object.keys(i).length;return i===void 0||A?e:Object.assign(e,{[t]:i})},{}):n}function cl(n,e,t){!e||t.has(e.id)||(t.set(e.id,e),Object.keys(e).forEach(r=>{r.endsWith("Id")?cl(n,n.get(e[r]),t):r.endsWith("Ids")&&e[r].forEach(i=>{cl(n,n.get(i),t)})}))}function Av(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&&cl(n,o,i)})}),i}const sv=nv;function ov(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),sv("chrome: "+JSON.stringify(o)),a(o)})}o.video=r(o.video)}return sv("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 av(n){n.MediaStream=n.MediaStream||n.webkitMediaStream}function cv(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 uv(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 lv(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=>Av(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=>Av(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 dv(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 hv(n,e){if(!n.RTCPeerConnection)return;if(n.RTCPeerConnection.prototype.addTrack&&e.version>=65)return dv(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 ul(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 pv(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 fv=Object.freeze({__proto__:null,fixNegotiationNeeded:pv,shimAddTrackRemoveTrack:hv,shimAddTrackRemoveTrackWithNative:dv,shimGetSendersWithDtmf:uv,shimGetUserMedia:ov,shimMediaStream:av,shimOnTrack:cv,shimPeerConnection:ul,shimSenderReceiverGetStats:lv});function gv(n,e){const t=n&&n.navigator,r=n&&n.MediaStreamTrack;if(t.getUserMedia=function(i,A,s){al("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 mv(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 ll(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 vv(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 yv(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 wv(n){!n.RTCPeerConnection||"removeStream"in n.RTCPeerConnection.prototype||(n.RTCPeerConnection.prototype.removeStream=function(t){al("removeStream","removeTrack"),this.getSenders().forEach(r=>{r.track&&t.getTracks().includes(r.track)&&this.removeTrack(r)})})}function bv(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 Cv(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 _v(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 Sv(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 kv=Object.freeze({__proto__:null,shimAddTransceiver:Bv,shimCreateAnswer:Sv,shimCreateOffer:_v,shimGetDisplayMedia:ZI,shimGetParameters:Cv,shimGetUserMedia:gv,shimOnTrack:mv,shimPeerConnection:ll,shimRTCDataChannel:bv,shimReceiverGetStats:yv,shimRemoveStream:wv,shimSenderGetStats:vv});function Ev(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 Uv(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 Tv(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 Iv(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(Fv(i))}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=(function(r,i,A){e.mediaDevices.getUserMedia(r).then(i,A)}).bind(e))}function Fv(n){return n&&n.video!==void 0?Object.assign({},n,{video:iv(n.video)}):n}function xv(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?(al("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 Qv(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 Rv(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 Pv(n){typeof n!="object"||n.AudioContext||(n.AudioContext=n.webkitAudioContext)}var Ov=Object.freeze({__proto__:null,shimAudioContext:Pv,shimCallbacksAPI:Tv,shimConstraints:Fv,shimCreateOfferLegacy:Rv,shimGetUserMedia:Iv,shimLocalStreamsAPI:Ev,shimRTCIceServerUrls:xv,shimRemoteStreamsAPI:Uv,shimTrackEventTransceiver:Qv}),dl={exports:{}},Mv;function $I(){return Mv||(Mv=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(`
|
|
9
|
+
.`).concat(Ou).concat(_1).concat(Og))},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)},Mu=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)||(Du(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,Mu.isSameOrigin)];case 1:return r=a.sent(),[3,3];case 2:r=Mu.isSameOrigin(e),a.label=3;case 3:return t=r,i=!Lu(e)&&this._options.useCORS===!0&&vt.SUPPORT_CORS_IMAGES&&!t,A=!Lu(e)&&!t&&!Du(e)&&typeof this._options.proxy=="string"&&vt.SUPPORT_CORS_XHR&&!i,!t&&this._options.allowTaint===!1&&!Lu(e)&&!Du(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)},Lu=function(n){return F1.test(n)},Q1=function(n){return I1.test(n)},Du=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,F=t.borderLeftWidth,x=Se(t.paddingTop,e.bounds.width),I=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+F/3,r.top+_/3,A-F/3,s-_/3,Be.TOP_LEFT):new G(r.left+F/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+F/3,r.top+w,f-F/3,p-T/3,Be.BOTTOM_LEFT):new G(r.left+F/3,r.top+r.height-T/3),this.topLeftBorderDoubleInnerBox=A>0||s>0?He(r.left+F*2/3,r.top+_*2/3,A-F*2/3,s-_*2/3,Be.TOP_LEFT):new G(r.left+F*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+F*2/3,r.top+w,f-F*2/3,p-T*2/3,Be.BOTTOM_LEFT):new G(r.left+F*2/3,r.top+r.height-T*2/3),this.topLeftBorderStroke=A>0||s>0?He(r.left+F/2,r.top+_/2,A-F/2,s-_/2,Be.TOP_LEFT):new G(r.left+F/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+F/2,r.top+w,f-F/2,p-T/2,Be.BOTTOM_LEFT):new G(r.left+F/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+F,r.top+_,Math.max(0,A-F),Math.max(0,s-_),Be.TOP_LEFT):new G(r.left+F,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-F),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+F,r.top+Math.min(w,r.height-T),Math.max(0,f-F),Math.max(0,p-T),Be.BOTTOM_LEFT):new G(r.left+F,r.top+r.height-T),this.topLeftContentBox=A>0||s>0?He(r.left+F+D,r.top+_+x,Math.max(0,A-(F+D)),Math.max(0,s-(_+x)),Be.TOP_LEFT):new G(r.left+F+D,r.top+_+x),this.topRightContentBox=a>0||c>0?He(r.left+Math.min(y,r.width+F+D),r.top+_+x,y>r.width+F+D?0:a-F+D,c-(_+x),Be.TOP_RIGHT):new G(r.left+r.width-(k+I),r.top+_+x),this.bottomRightContentBox=l>0||d>0?He(r.left+Math.min(B,r.width-(F+D)),r.top+Math.min(b,r.height+_+x),Math.max(0,l-(k+I)),d-(T+Q),Be.BOTTOM_RIGHT):new G(r.left+r.width-(k+I),r.top+r.height-(T+Q)),this.bottomLeftContentBox=f>0||p>0?He(r.left+F+D,r.top+w,Math.max(0,f-(F+D)),p-(T+Q),Be.BOTTOM_LEFT):new G(r.left+F+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},Mg=function(n){return n.type===1},H1=function(n){return n.type===2},Lg=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})},Dg=function(){function n(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return n}(),Hg=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);Lg(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!Mg(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);Lg(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}(),Hu=function(n,e,t,r){n.container.elements.forEach(function(i){var A=ct(i.flags,4),s=ct(i.flags,2),o=new Hg(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 Dg(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);Hu(o,u,A?u:t,a)}else i.styles.isInlineLevel()?e.inlineLevel.push(o):e.nonInlineLevel.push(o),Hu(o,e,t,a);ct(i.flags,8)&&Ng(i,a)})},Ng=function(n,e){for(var t=n instanceof Uu?n.start:1,r=n instanceof Uu?n.reversed:!1,i=0;i<e.length;i++){var A=e[i];A.container instanceof hg&&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 Hg(n,null),t=new Dg(e),r=[];return Hu(e,t,t,r),Ng(e.container,r),t},Kg=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},Vg=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):Vg(e)},q1=function(n,e){return n===0?e.bounds:n===2?Eo(e):Vg(e)},Nu=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",Gg="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(Gg)),r.appendChild(A),r.appendChild(i);var o=i.offsetTop-A.offsetTop+2;r.removeChild(A),r.appendChild(this._document.createTextNode(Gg)),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}(),jg=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)),Mg(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=Eu(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 ug))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 lg&&this.renderReplacedElement(r,i,r.canvas),!(r instanceof dg))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 mg&&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 Tu&&(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(pg),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(pg),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,jf(A.lineHeight,A.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new EA(t.listValue,_),A.letterSpacing,jf(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,F,x,I,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=Nu(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=Nu(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"),F=T.createLinearGradient(b,w,B,_),Rf(u.stops,y||1).forEach(function(At){return F.addColorStop(At.stop,ht(At.color))}),T.fillStyle=F,T.fillRect(0,0,N,q),N>0&&q>0&&(x=A.ctx.createPattern(k,"repeat"),A.renderRepeat(Q,x,Y,re))):Mk(u)&&(I=Nu(t,r,[null,null,null]),Q=I[0],D=I[1],X=I[2],N=I[3],q=I[4],ge=u.position.length===0?[au]: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),Rf(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(Kg(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=Kg(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}(jg),eT=function(n){return n instanceof gg||n instanceof fg?!0:n instanceof Tu&&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=ku(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}(jg),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"&&Mu.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,F,x,I,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:(F=e.imageTimeout)!==null&&F!==void 0?F:15e3,proxy:e.proxy,useCORS:(x=e.useCORS)!==null&&x!==void 0?x:!1,customIsSameOrigin:e.customIsSameOrigin},A=Nc({logging:(I=e.logging)!==null&&I!==void 0?I:!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 Pg(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=Fu(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"),_=yg(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)&&(Pg.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,Wg=(n,e,t)=>pT(n,typeof e!="symbol"?e+"":e,t);let Ot=class{constructor(){Wg(this,"_locking"),Wg(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 Ku(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 qg(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 Jg=Symbol("@bufbuild/protobuf/enum-type");function wT(n){const e=n[Jg];return Je(e,"missing enum type on enum object"),e}function zg(n,e,t,r){n[Jg]=Xg(e,t.map(i=>({no:i.no,name:i.name,localName:n[i.no]})))}function Xg(n,e,t){const r=Object.create(null),i=Object.create(null),A=[];for(const s of e){const o=Yg(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=Yg(i);r[A.localName]=A.no,r[A.no]=A.localName}return zg(r,n,e),r}function Yg(n){return"localName"in n?n:Object.assign(Object.assign({},n),{localName:n.name})}class Vu{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 Vu),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 Gu(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 Zg(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?em(r,i):ju(r,i)}function _T(n,e){let t=ju(n,e);const r=t.hi&2147483648;r&&(t=em(t.lo,t.hi));const i=$g(t.lo,t.hi);return r?"-"+i:i}function $g(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()+tm(s)+tm(A)}function ST(n,e){return{lo:n>>>0,hi:e>>>0}}function ju(n,e){return{lo:n|0,hi:e|0}}function em(n,e){return e=~e,n?n=~n+1:e+=1,ju(n,e)}const tm=n=>{const e=String(n);return"0000000".slice(e.length)+e};function nm(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),Zg(i)},uEnc(i){return typeof i!="string"&&(i=i.toString()),r(i),Zg(i)},dec(i,A){return _T(i,A)},uDec(i,A){return $g(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 rm(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(Ku(e);e>127;)this.buf.push(e&127|128),e=e>>>7;return this.buf.push(e),this}int32(e){return To(e),nm(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){qg(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){Ku(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,nm(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 Gu(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 Gu(i,A,this.buf),this}uint64(e){let t=Ne.uEnc(e);return Gu(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 im(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 Am={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){om(e,n);const r=e.runtime.bin.makeReadOptions(t),i=xT(n.getType().runtime.bin.listUnknownFields(n),e.field),[A,s]=im(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){om(e,n);const i=e.runtime.bin.makeReadOptions(r),A=e.runtime.bin.makeWriteOptions(r);if(sm(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 sm(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 om(n,e){Je(n.extendee.typeName==e.getType().typeName,"extension ".concat(n.typeName," can only be applied to message ").concat(n.extendee.typeName))}function am(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:!rm(n.T,e[t]);case"message":return e[t]!==void 0;case"map":return Object.keys(e[t]).length>0}}function cm(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(Vu.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 um(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 lm={ignoreUnknownFields:!1},dm={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0};function PT(n){return n?Object.assign(Object.assign({},lm),n):lm}function OT(n){return n?Object.assign(Object.assign({},dm),n):dm}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)}hm(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]=im(u);hm(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(!am(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=pm(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&&sm(n,o)){const a=QT(n,o,e),c=pm(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||rm(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 hm(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=Wu(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=Wu(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=Wu(t.T,e,r.ignoreUnknownFields,!1);switch(a){case xo:cm(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:cm(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&&qg(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?Ku(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 Am.dec(e)}throw new Error}function Wu(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 pm(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()]=qu(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(qu(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 qu(n.T,e,t.enumAsInteger);case"message":return um(n.T,e).toJson(t)}}function qu(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),Am.enc(e)}}const Ci=Symbol("@bufbuild/protobuf/unknown-fields"),fm={readUnknownFields:!0,readerFactory:n=>new TT(n)},gm={writeUnknownFields:!0,writerFactory:()=>new UT};function HT(n){return n?Object.assign(Object.assign({},fm),n):fm}function NT(n){return n?Object.assign(Object.assign({},gm),n):gm}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}mm(n,e,c,a,r)}if(i&&(a!=tt.EndGroup||o!==t))throw new Error("invalid end group tag")},readField:mm,writeMessage(n,e,t){const r=n.getType();for(const i of r.fields.byNumber()){if(!am(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];vm(i,A,e,t)}return t.writeUnknownFields&&this.writeUnknownFields(n,e),e},writeField(n,e,t,r){e!==void 0&&vm(n,e,t,r)}}}function mm(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 vm(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)ym(t,r,n,s)}else ym(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 ym(n,e,t,r){const i=um(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]=wm(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]=wm(e);for(let A=0;A<r.length;A++)n[i](r[A]);n.join()}function wm(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:zg,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:Xg,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 bm(n,e){const t=Bm(n);return e?t:tI(eI(t))}function XT(n){return bm(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"]),Cm=n=>"".concat(n,"$"),eI=n=>$T.has(n)?Cm(n):n,tI=n=>ZT.has(n)?Cm(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=bm(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 Vu{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}]),_m=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:Mm}]),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:Mm},{no:19,name:"audio_features",kind:"enum",T:U.getEnumType(sn),repeated:!0},{no:20,name:"backup_codec_policy",kind:"enum",T:U.getEnumType(_m)}]),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:km,oneof:"value"},{no:3,name:"speaker",kind:"message",T:dI,oneof:"value"},{no:6,name:"sip_dtmf",kind:"message",T:Em,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:Ju,oneof:"value"},{no:10,name:"rpc_request",kind:"message",T:Um,oneof:"value"},{no:11,name:"rpc_ack",kind:"message",T:Tm,oneof:"value"},{no:12,name:"rpc_response",kind:"message",T:Im,oneof:"value"},{no:13,name:"stream_header",kind:"message",T:Xu,oneof:"value"},{no:14,name:"stream_chunk",kind:"message",T:Yu,oneof:"value"},{no:15,name:"stream_trailer",kind:"message",T:Zu,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:Sm,repeated:!0}]),Sm=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}]),km=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}]),Em=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}]),Ju=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}]),Um=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}]),Tm=U.makeMessageType("livekit.RpcAck",()=>[{no:1,name:"request_id",kind:"scalar",T:9}]),Im=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:Fm,oneof:"value"}]),Fm=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}]),xm=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(Qm)},{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}]),Qm=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(Rm)},{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}]),Rm=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"}]),Pm=U.makeMessageType("livekit.ClientConfiguration",()=>[{no:1,name:"video",kind:"message",T:Om},{no:2,name:"screen",kind:"message",T:Om},{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)}]),Om=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}]),Mm=U.makeMessageType("livekit.TimedVersion",()=>[{no:1,name:"unix_micro",kind:"scalar",T:3},{no:2,name:"ticks",kind:"scalar",T:5}]),zu=U.makeEnum("livekit.DataStream.OperationType",[{no:0,name:"CREATE"},{no:1,name:"UPDATE"},{no:2,name:"DELETE"},{no:3,name:"REACTION"}]),Lm=U.makeMessageType("livekit.DataStream.TextHeader",()=>[{no:1,name:"operation_type",kind:"enum",T:U.getEnumType(zu)},{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"}),Dm=U.makeMessageType("livekit.DataStream.ByteHeader",()=>[{no:1,name:"name",kind:"scalar",T:9}],{localName:"DataStream_ByteHeader"}),Xu=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:Lm,oneof:"content_header"},{no:10,name:"byte_header",kind:"message",T:Dm,oneof:"content_header"}],{localName:"DataStream_Header"}),Yu=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"}),Zu=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"}]),$u=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:nl,oneof:"message"},{no:4,name:"add_track",kind:"message",T:tl,oneof:"message"},{no:5,name:"mute",kind:"message",T:rl,oneof:"message"},{no:6,name:"subscription",kind:"message",T:No,oneof:"message"},{no:7,name:"track_setting",kind:"message",T:Nm,oneof:"message"},{no:8,name:"leave",kind:"message",T:Ko,oneof:"message"},{no:10,name:"update_layers",kind:"message",T:Vm,oneof:"message"},{no:11,name:"subscription_permission",kind:"message",T:qm,oneof:"message"},{no:12,name:"sync_state",kind:"message",T:Jm,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:Gm,oneof:"message"},{no:16,name:"ping_req",kind:"message",T:Xm,oneof:"message"},{no:17,name:"update_audio_track",kind:"message",T:Km,oneof:"message"},{no:18,name:"update_video_track",kind:"message",T:_I,oneof:"message"}]),Hm=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:nl,oneof:"message"},{no:5,name:"update",kind:"message",T:CI,oneof:"message"},{no:6,name:"track_published",kind:"message",T:il,oneof:"message"},{no:8,name:"leave",kind:"message",T:Ko,oneof:"message"},{no:9,name:"mute",kind:"message",T:rl,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"}]),el=U.makeMessageType("livekit.SimulcastCodec",()=>[{no:1,name:"codec",kind:"scalar",T:9},{no:2,name:"cid",kind:"scalar",T:9}]),tl=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:el,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(_m)},{no:17,name:"audio_features",kind:"enum",T:U.getEnumType(sn),repeated:!0}]),nl=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}]),rl=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:jm,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:Pm},{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:jm,repeated:!0},{no:2,name:"client_configuration",kind:"message",T:Pm}]),il=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:xm,repeated:!0}]),Nm=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}]),Km=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"}]),Vm=U.makeMessageType("livekit.UpdateVideoLayers",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"layers",kind:"message",T:Kr,repeated:!0}]),Gm=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}]),jm=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:Sm,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($u)}]),II=U.makeMessageType("livekit.StreamStateUpdate",()=>[{no:1,name:"stream_states",kind:"message",T:TI,repeated:!0}]),Al=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:Al,repeated:!0}]),xI=U.makeMessageType("livekit.SubscribedQualityUpdate",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"subscribed_qualities",kind:"message",T:Al,repeated:!0},{no:3,name:"subscribed_codecs",kind:"message",T:FI,repeated:!0}]),Wm=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}]),qm=U.makeMessageType("livekit.SubscriptionPermission",()=>[{no:1,name:"all_participants",kind:"scalar",T:8},{no:2,name:"track_permissions",kind:"message",T:Wm,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}]),Jm=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:il,repeated:!0},{no:4,name:"data_channels",kind:"message",T:zm,repeated:!0},{no:5,name:"offer",kind:"message",T:Vr},{no:6,name:"track_sids_disabled",kind:"scalar",T:9,repeated:!0}]),zm=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"}]),Xm=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(sl)},{no:3,name:"message",kind:"scalar",T:9}]),sl=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,Ym;function VI(){return Ym||(Ym=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 _(I){var Q=(i[I]||"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 I;if(!(typeof window===t||!w)){try{I=window.localStorage[w]}catch{}if(typeof I===t)try{var Q=window.document.cookie,D=encodeURIComponent(w),X=Q.indexOf(D+"=");X!==-1&&(I=/^([^;]+)/.exec(Q.slice(X+D.length+1))[1])}catch{}return v.levels[I]===void 0&&(I=void 0),I}}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 F(I){var Q=I;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: "+I)}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(I,Q){return B=F(I),Q!==!1&&_(B),u.call(v)},v.setDefaultLevel=function(I){b=F(I),k()||v.setLevel(I,!1)},v.resetLevel=function(){B=null,T(),u.call(v)},v.enableAll=function(I){v.setLevel(v.levels.TRACE,I)},v.disableAll=function(I){v.setLevel(v.levels.SILENT,I)},v.rebuild=function(){if(s!==v&&(y=F(s.getLevel())),u.call(v),s===v)for(var I in A)A[I].rebuild()},y=F(s?s.getLevel():"WARN");var x=k();x!=null&&(B=F(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(),ol;(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"})(ol||(ol={}));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(ol.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 Zm(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 Zm=="function"?Zm(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:{}},$m;function JI(){if($m)return jo.exports;$m=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",F=this._events;if(F!==void 0)T=T&&F.error===void 0;else if(!T)return!1;if(T){var x;if(_.length>0&&(x=_[0]),x instanceof Error)throw x;var I=new Error("Unhandled error."+(x?" ("+x.message+")":""));throw I.context=x,I}var Q=F[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,F,x;if(o(_),F=B._events,F===void 0?(F=B._events=Object.create(null),B._eventsCount=0):(F.newListener!==void 0&&(B.emit("newListener",w,_.listener?_.listener:_),F=B._events),x=F[w]),x===void 0)x=F[w]=_,++B._eventsCount;else if(typeof x=="function"?x=F[w]=k?[_,x]:[x,_]:k?x.unshift(_):x.push(_),T=a(B),T>0&&x.length>T&&!x.warned){x.warned=!0;var I=new Error("Possible EventEmitter memory leak detected. "+x.length+" "+String(w)+" listeners added. Use emitter.setMaxListeners() to increase limit");I.name="MaxListenersExceededWarning",I.emitter=B,I.type=w,I.count=x.length,r(I)}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,F,x,I;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(F=-1,x=k.length-1;x>=0;x--)if(k[x]===_||k[x].listener===_){I=k[x].listener,F=x;break}if(F<0)return this;F===0?k.shift():p(k,F),k.length===1&&(T[w]=k[0]),T.removeListener!==void 0&&this.emit("removeListener",w,I||_)}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 F=Object.keys(k),x;for(T=0;T<F.length;++T)x=F[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,F),k(x)}function F(){typeof B.removeListener=="function"&&B.removeListener("error",T),_([].slice.call(arguments))}b(B,w,F,{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(F){k.once&&B.removeEventListener(w,T),_(F)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof B)}return jo.exports}var _n=JI();let ev=!0,tv=!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."):(ev=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."):(tv=!n,"adapter.js deprecation warnings "+(n?"disabled":"enabled"))}function nv(){if(typeof window=="object"){if(ev)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function al(n,e){tv&&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 rv(n){return Object.prototype.toString.call(n)==="[object Object]"}function iv(n){return rv(n)?Object.keys(n).reduce(function(e,t){const r=rv(n[t]),i=r?iv(n[t]):n[t],A=r&&!Object.keys(i).length;return i===void 0||A?e:Object.assign(e,{[t]:i})},{}):n}function cl(n,e,t){!e||t.has(e.id)||(t.set(e.id,e),Object.keys(e).forEach(r=>{r.endsWith("Id")?cl(n,n.get(e[r]),t):r.endsWith("Ids")&&e[r].forEach(i=>{cl(n,n.get(i),t)})}))}function Av(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&&cl(n,o,i)})}),i}const sv=nv;function ov(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),sv("chrome: "+JSON.stringify(o)),a(o)})}o.video=r(o.video)}return sv("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 av(n){n.MediaStream=n.MediaStream||n.webkitMediaStream}function cv(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 uv(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 lv(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=>Av(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=>Av(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 dv(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 hv(n,e){if(!n.RTCPeerConnection)return;if(n.RTCPeerConnection.prototype.addTrack&&e.version>=65)return dv(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 ul(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 pv(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 fv=Object.freeze({__proto__:null,fixNegotiationNeeded:pv,shimAddTrackRemoveTrack:hv,shimAddTrackRemoveTrackWithNative:dv,shimGetSendersWithDtmf:uv,shimGetUserMedia:ov,shimMediaStream:av,shimOnTrack:cv,shimPeerConnection:ul,shimSenderReceiverGetStats:lv});function gv(n,e){const t=n&&n.navigator,r=n&&n.MediaStreamTrack;if(t.getUserMedia=function(i,A,s){al("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 mv(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 ll(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 vv(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 yv(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 wv(n){!n.RTCPeerConnection||"removeStream"in n.RTCPeerConnection.prototype||(n.RTCPeerConnection.prototype.removeStream=function(t){al("removeStream","removeTrack"),this.getSenders().forEach(r=>{r.track&&t.getTracks().includes(r.track)&&this.removeTrack(r)})})}function bv(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 Cv(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 _v(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 Sv(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 kv=Object.freeze({__proto__:null,shimAddTransceiver:Bv,shimCreateAnswer:Sv,shimCreateOffer:_v,shimGetDisplayMedia:ZI,shimGetParameters:Cv,shimGetUserMedia:gv,shimOnTrack:mv,shimPeerConnection:ll,shimRTCDataChannel:bv,shimReceiverGetStats:yv,shimRemoveStream:wv,shimSenderGetStats:vv});function Ev(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 Uv(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 Tv(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 Iv(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(Fv(i))}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=(function(r,i,A){e.mediaDevices.getUserMedia(r).then(i,A)}).bind(e))}function Fv(n){return n&&n.video!==void 0?Object.assign({},n,{video:iv(n.video)}):n}function xv(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?(al("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 Qv(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 Rv(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 Pv(n){typeof n!="object"||n.AudioContext||(n.AudioContext=n.webkitAudioContext)}var Ov=Object.freeze({__proto__:null,shimAudioContext:Pv,shimCallbacksAPI:Tv,shimConstraints:Fv,shimCreateOfferLegacy:Rv,shimGetUserMedia:Iv,shimLocalStreamsAPI:Ev,shimRTCIceServerUrls:xv,shimRemoteStreamsAPI:Uv,shimTrackEventTransceiver:Qv}),dl={exports:{}},Mv;function $I(){return Mv||(Mv=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
11
|
`).map(r=>r.trim())},e.splitSections=function(t){return t.split(`
|
|
12
12
|
m=`).map((i,A)=>(A>0?"m="+i:i).trim()+`\r
|
|
13
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
|
|
@@ -43,7 +43,7 @@ a=extmap-allow-mixed`)!==-1){const A=i.sdp.split(`
|
|
|
43
43
|
`).filter(s=>s.trim()!=="a=extmap-allow-mixed").join(`
|
|
44
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:fl,shimAddIceCandidateNullOrEmpty:Xo,shimConnectionState:pl,shimMaxMessageSize:Jo,shimParameterlessSetLocalDescription:Yo,shimRTCIceCandidate:qo,shimRTCIceCandidateRelayProtocol:hl,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=nv,r=YI(n),i={browserDetails:r,commonShim:tF,extractVersion:Wo,disableLog:zI,disableWarnings:XI,sdp:eF};switch(r.browser){case"chrome":if(!fv||!ul||!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=fv,Xo(n,r),Yo(n),ov(n,r),av(n),ul(n,r),cv(n),hv(n,r),uv(n),lv(n),pv(n,r),qo(n),hl(n),pl(n),Jo(n,r),zo(n),fl(n,r);break;case"firefox":if(!kv||!ll||!e.shimFirefox)return t("Firefox shim is not included in this adapter release."),i;t("adapter.js shimming firefox."),i.browserShim=kv,Xo(n,r),Yo(n),gv(n,r),ll(n,r),mv(n),wv(n),vv(n),yv(n),bv(n),Bv(n),Cv(n),_v(n),Sv(n),qo(n),pl(n),Jo(n,r),zo(n);break;case"safari":if(!Ov||!e.shimSafari)return t("Safari shim is not included in this adapter release."),i;t("adapter.js shimming safari."),i.browserShim=Ov,Xo(n,r),Yo(n),xv(n),Rv(n),Tv(n),Ev(n),Uv(n),Qv(n),Iv(n),Pv(n),qo(n),hl(n),Jo(n,r),zo(n),fl(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 Dv;(function(n){n.KeyRatcheted="keyRatcheted"})(Dv||(Dv={}));var lr;(function(n){n.ParticipantEncryptionStatusChanged="participantEncryptionStatusChanged",n.EncryptionError="encryptionError"})(lr||(lr={}));var Hv;(function(n){n.Error="cryptorError"})(Hv||(Hv={}));function AF(){return sF()||gl()}function gl(){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 ml 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 vl extends dr{constructor(e){super(13,e??"unable to negotiate"),this.name="NegotiationError"}}class yl extends dr{constructor(e,t){super(15,e),this.name="PublishTrackError",this.status=t}}class Nv extends dr{constructor(e,t){super(15,e),this.reason=t,this.reasonName=typeof t=="string"?t:sl[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 Kv;(function(n){n[n.InvalidKey=0]="InvalidKey",n[n.MissingKey=1]="MissingKey",n[n.InternalError=2]="InternalError"})(Kv||(Kv={}));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 wl;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(wl===void 0||e){const r=uF.find(i=>{let{test:A}=i;return A.test(t)});wl=r==null?void 0:r.describe(t)}return wl}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 $u.ACTIVE:return r.Active;case $u.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 Vv;(function(n){n[n.PREFER_REGRESSION=0]="PREFER_REGRESSION",n[n.SIMULCAST=1]="SIMULCAST",n[n.REGRESSION=2]="REGRESSION"})(Vv||(Vv={}));var Bl;(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}})(Bl||(Bl={}));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)},Cl={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)},_l={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="|",Gv="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 Sl(){return"addTransceiver"in RTCPeerConnection.prototype}function kl(){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 El(n){return document?(n||(n=document.createElement("audio")),"setSinkId"in n):!1}function BF(){return typeof RTCPeerConnection>"u"?!1:Sl()||kl()}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 jv(){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 Ul(n){return n.hostname.endsWith(".livekit.cloud")||n.hostname.endsWith(".livekit.run")}function Wv(){if(global&&global.LiveKitReactNativeGlobal)return global.LiveKitReactNativeGlobal}function qv(){if(!Sn())return;let n=Wv();if(n)return n.platform}function Jv(){if(Ht())return window.devicePixelRatio;if(Sn()){let n=Wv();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 Tl=null;const zv=()=>(Tl||(Tl=new ResizeObserver(SF)),Tl);let Il=null;const Xv=()=>(Il||(Il=new IntersectionObserver(kF,{root:null,rootMargin:"0px"})),Il);function EF(){var n;const e=new gI({sdk:Rm.JS,protocol:hF,version:dF});return Sn()&&(e.os=(n=qv())!==null&&n!==void 0?n:""),e}function Yv(){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 Fl(){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 xl{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 Ql(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 Zv(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 Rl(n){return!!n&&!n.isLocal}function xF(n){return!!n&&!n.isLocal}function Pl(n){return Rl(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 $v(n,e,t){var r,i,A,s;const{optionsWithoutProcessor:o,audioProcessor:a,videoProcessor:c}=r0(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&&(Ol(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&&(Ol(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 Ol(n,e){return Object.keys(e).forEach(t=>{n[t]===void 0&&(n[t]=e[t])}),n}function Ml(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":Ol(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 e0(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=t0();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 t0(){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 n0(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 il({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 r0(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 ml("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(gl()){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(gl()){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 Ll="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!==Ll)return t;const i=yield this.getDevices(e),A=i.find(o=>o.deviceId===Ll);if(!A){ce.warn("could not reliably determine default device");return}const s=i.find(o=>o.deviceId!==Ll&&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)}),i0(t,"rtc")}function GF(n){const e=new URL(Ql(n));return i0(e,"validate")}function jF(n){return n.endsWith("/")?n:"".concat(n,"/")}function i0(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 Dl{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=Hm.fromJson(B,{ignoreUnknownFields:!0})}else if(p.data instanceof ArrayBuffer)b=Hm.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 nl({candidateInit:JSON.stringify(e),target:t})})}sendMuteTrack(e,t){return this.sendRequest({case:"mute",value:new rl({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 Gm({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 Vm({trackSid:e,layers:t})})}sendUpdateSubscriptionPermissions(e,t){return this.sendRequest({case:"subscriptionPermission",value:new qm({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 Xm({timestamp:Ne.parse(Date.now()),rtt:Ne.parse(this.rtt)})})])}sendUpdateLocalAudioTrack(e,t){return this.sendRequest({case:"updateAudioTrack",value:new Km({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=A0(i.value);this.onAnswer&&this.onAnswer(s)}else if(i.case==="offer"){const s=A0(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 A0(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={},Hl={},Nl={exports:{}},s0;function Kl(){if(s0)return Nl.exports;s0=1;var n=Nl.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")})}),Nl.exports}var o0;function zF(){return o0||(o0=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=Kl(),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}})})}}(Hl)),Hl}var Vl,a0;function XF(){if(a0)return Vl;a0=1;var n=Kl(),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 Vl=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
|
-
`},Vl}var c0;function YF(){if(c0)return un;c0=1;var n=zF(),e=XF(),t=Kl();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 Gl(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 u0 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=Gl(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=>{d0(A),A.type==="audio"?l0(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=>{d0(i),i.type==="audio"&&l0(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 vl(A)}})}ensureVideoDDExtensionForSVC(e,t){var r,i;if(!((r=e.ext)===null||r===void 0?void 0:r.some(s=>s.uri===Gv))){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:Gv})}}}function l0(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 d0(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 jl="vp8",tx={audioPreset:Bl.music,dtx:!0,red:!0,forceStereo:!1,simulcast:!0,screenShareEncoding:_l.h1080fps15.encoding,stopMicTrackOnMute:!1,videoCodec:jl,backupCodec:!0},h0={deviceId:{ideal:"default"},autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0,voiceIsolation:!0},p0={deviceId:{ideal:"default"},resolution:LA.h720.resolution},nx={adaptiveStream:!1,dynacast:!1,stopLocalTrackOnUnpublish:!0,reconnectPolicy:new WI,disconnectOnPageLeave:!0,webAudioMix:!1},Wl={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=Wl.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 u0(e,r),this.subscriber=new u0(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=g0(t,Xe.MAX_MESSAGE_BYTES),this.data=r?g0(r,Xe.MAX_DATA_BYTES):void 0}static fromProto(e){return new Xe(e.code,e.message,e.data)}toProto(){return new Fm({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 f0=15360;function ql(n){return new TextEncoder().encode(n).length}function g0(n,e){if(ql(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 Jl=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 m0 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=Gl(()=>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),jv()&&(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 ml("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 m0{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=Ml({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()},Jl)))}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 e0(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(Cl),ax=Object.values(_l),cx=[LA.h180,LA.h360],ux=[Cl.h180,Cl.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)}),zl=["q","h","f"];function Xl(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:zl[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=y0(r==null?void 0:r.screenShareSimulcastLayers))!==null&&i!==void 0?i:v0(n,l):d=(A=y0(r==null?void 0:r.videoSimulcastLayers))!==null&&A!==void 0?A:v0(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 Yl(e,t,[f,h,l],u);if(p>=480)return Yl(e,t,[f,l],u)}return Yl(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),Xl(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 v0(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 Yl(n,e,t,r){const i=[];if(t.forEach((A,s)=>{if(s>=zl.length)return;const o=Math.min(n,e),c={rid:zl[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()&&qv()==="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 y0(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 m0{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()},Jl))}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 Al({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=Ml({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 w0(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 w0(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),jv()&&this.isInBackground&&this.source===P.Source.Camera&&(this._mediaStreamTrack.enabled=!1)})}}function w0(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=b0(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 b0(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=b0((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 C0="_lossy",_0="_reliable",mx=2*1e3,Zl="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=Wl.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===_0)A.reliableDCSub=s;else if(s.label===C0)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===Zl&&(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 Dl(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(Zl);break;case Ui.RESUME:this.handleDisconnect(Zl)}}}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(C0,{ordered:!1,maxRetransmits:0}),this.reliableDC=this.pcManager.createPublisherDataChannel(_0,{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(Sl())return yield this.createTransceiverRTCRtpSender(e,t,r);if(kl())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(Sl())return this.createSimulcastTransceiverSender(e,t,r,i);if(kl())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 Im({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 Tm({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 vl("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 vl&&(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 Jm({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 zm({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 $l{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 Ul(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 S0{get info(){return this._info}constructor(e,t,r){this.reader=t,this.totalByteSize=r,this._info=e,this.bytesReceived=0}}class Bx extends S0{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 S0{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 k0{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 k0{}class Sx extends k0{}class E0 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(),Jl)),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 E0{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(El(t))return t.setSinkId(e)}))})}attach(e){const t=this.attachedElements.length===0;return e?super.attach(e):e=super.attach(),this.sinkId&&El(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 ed=100;class Ex extends E0{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=Gl(()=>{this.updateDimensions()},ed),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<ed){yt.setTimeout(()=>{this.updateVisibility()},ed);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"?Jv():t||(Jv()>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??td(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=td(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,Xv().observe(this.element),zv().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=Xv())===null||e===void 0||e.unobserve(this.element),(t=zv())===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?td(n,(t=window.documentPictureInPicture)===null||t===void 0?void 0:t.window):!1}function td(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 nd 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}=r0(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=$v(A,h0,p0),c=Ml(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 U0 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 xl,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 Wm({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 T0=15e3;class Qx extends U0{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 xl)},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!==sl.OK&&u.reject(new Nv(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 Nv("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=$v(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 ml("getDisplayMedia not supported");e.resolution===void 0&&!CF()&&(e.resolution=_l.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 yl("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 yl("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 yl("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=jl),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 tl({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 el({codec:p,cid:e.mediaStreamTrack.id})],t.backupCodec===!0&&(t.backupCodec={codec:jl}),t.backupCodec&&p!==t.backupCodec.codec&&g.encryption===jt.NONE&&(this.roomOptions.dynacast||(this.roomOptions.dynacast=!0),g.simulcastCodecs.push(new el({codec:t.backupCodec.codec,cid:""})))),v=Xl(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=Xl(e.source===P.Source.ScreenShare,g.width,g.height,t))}yield y()}const B=new nd(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 tl({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 km({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 Em({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 Ju(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 Ju(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 Xu({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 Lm({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"?zu.UPDATE:zu.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,T0)){yield u.engine.waitForBufferStatusLow(he.RELIABLE);const g=new Yu({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 Zu({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 Xu({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 Dm({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+T0);yield f.waitForBufferStatusLow(he.RELIABLE);const _=new Lt({destinationIdentities:a,value:{case:"streamChunk",value:new Yu({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 Zu({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(ql(s)>f0){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 Um({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 xm({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||(Pl(this.track)&&(this.videoDimensions=e),this.currentVideoQuality=void 0,this.emitTrackUpdate()))}setVideoFPS(e){this.isManualOperationAllowed()&&Pl(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 Pl(this.track)&&this.track.isAdaptiveStream}emitTrackUpdate(){const e=new Nm({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 U0{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)&&Rl(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)&&Rl(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),Ul(new URL(s))&&(this.regionUrlProvider===void 0?this.regionUrlProvider=new $l(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,Zv(b)),f(b))}else{let B=An.UNKNOWN_REASON;b instanceof Ie&&(B=Zv(b)),this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,B),f(b)}}}),d=this.regionUrl;return this.regionUrl=void 0,this.connectFuture=new xl((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({},Wl),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=Fl();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=n0(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=n0(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({},h0),e==null?void 0:e.audioCaptureDefaults),this.options.videoCaptureDefaults=Object.assign(Object.assign({},p0),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});ql(u)>f0?(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(Ul(new URL(e))&&t){this.regionUrlProvider=new $l(e,t);const r=yield this.regionUrlProvider.getNextBestRegionUrl();r&&this.state===pe.Disconnected&&(this.regionUrl=r,yield fetch(Ql(r),{method:"HEAD"}),this.log.debug("prepared connection to ".concat(r),this.logContext))}else yield fetch(Ql(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(!El()&&!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=t0())!==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 nd(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]:Yv(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 nd(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]:Fl(),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=Yv(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=Fl(),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=I0(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 I0(n){return n.map(e=>{if(e)return Array.isArray(e)?I0(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 $l(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 rd=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/(rd/1e3)*100).toFixed(2),"%")),r.qualityLimitationDurations.cpu>0&&this.appendWarning("cpu limited ".concat((r.qualityLimitationDurations.cpu/(rd/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,rd)),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 e0(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 Dl,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 Dl;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)===Qm.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=R0(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=R0(d));let _=typeof i=="function"?i:Q0(i);y&&(_=typeof y=="function"?y:Q0({...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 F0(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 x0(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 Q0(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(x0(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(F0(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,x0(i,o,{style:s,explode:A}));continue}if(typeof o=="object"){t=t.replace(r,F0(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 R0(n){return n.endsWith("/")?n.substring(0,n.length-1):n}const P0="Onboardee-Session-Token",O0="OnboardeeSessionToken";class M0{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(O0);r&&t.headers.set(P0,r)}return t},onResponse({response:t}){const r=t.headers.get(P0);return r&&window.localStorage&&window.localStorage.setItem(O0,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,i){return await this.client.GET("/api/products/{id}/analytics",{params:{path:{id:e},query:{...t&&{start_date:t},...r&&{end_date:r},...i&&{course_id:i}}}})}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 getPlanAnalytics(e,t,r){return await this.client.GET("/api/plans/{id}/analytics",{params:{path:{id:e},query:{...t&&{start_date:t},...r&&{end_date:r}}}})}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.courseId&&(t.course_id=e.courseId),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.courseId&&(t.course_id=e.courseId),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 L0="https://app.coragents.ai";class la extends Dc{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 M0({baseUrl:L0}),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 id extends Dc{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 M0({baseUrl:r.apiBaseUrl||L0}),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(),serialisedAt:new Date().toISOString()})}static deserialise(e,t,r,i={}){const A=JSON.parse(e),s=new id(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 da,$,D0,Jr,H0,N0,K0,V0,Ad,sd,od,G0,VA={},j0=[],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?da.call(arguments,2):t),typeof n=="function"&&n.defaultProps!=null)for(A in n.defaultProps)s[A]==null&&(s[A]=n.defaultProps[A]);return ha(n,s,r,i,null)}function ha(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??++D0,__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 W0(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 W0(n)}}function ud(n){(!n.__d&&(n.__d=!0)&&Jr.push(n)&&!pa.__r++||H0!=$.debounceRendering)&&((H0=$.debounceRendering)||N0)(pa)}function pa(){for(var n,e,t,r,i,A,s,o=1;Jr.length;)Jr.length>o&&Jr.sort(K0),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,Y0(A,t,s),t.__e!=i&&W0(t)));pa.__r=0}function q0(n,e,t,r,i,A,s,o,a,c,u){var l,d,h,f,p,g,v=r&&r.__k||j0,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=J0(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?ha(null,s,null,null,null):GA(s)?ha(_t,{children:s},null,null,null):s.constructor==null&&s.__b>0?ha(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)),$0(o,o));return r}function J0(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=J0(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 fa(n,e){return e=e||[],n==null||typeof n=="boolean"||(GA(n)?n.some(function(t){fa(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 z0(n,e,t){e[0]=="-"?n.setProperty(e,t??""):n[e]=t==null?"":typeof t!="number"||Zx.test(e)?t:t+"px"}function ga(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||z0(n.style,e,"");if(t)for(e in t)r&&t[e]==r[e]||z0(n.style,e,t[e])}else if(e[0]=="o"&&e[1]=="n")A=e!=(e=e.replace(V0,"$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 X0(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=Z0(u.props.children)),o=q0(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 Y0(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 Z0(n){return typeof n!="object"||n==null||n.__b&&n.__b>0?n:GA(n)?n.map(Z0):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&&da.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;ga(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||ga(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=""),q0(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])&&ga(n,c,f,g[c],i),c="checked",p!=null&&p!=n[c]&&ga(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 $0(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]&&$0(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?da.call(e.childNodes):null,A,!r&&t?t:i?i.__e:e.firstChild,r,s),Y0(A,n,s)}function ey(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"+G0++,e.__=n,e.Provider=e.__l=(e.Consumer=function(t,r){return t.children(r)}).contextType=e,e}da=j0.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}},D0=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=[],N0=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,K0=function(n,e){return n.__v.__b-e.__v.__b},pa.__r=0,V0=/(PointerCapture)$|Capture$/i,Ad=0,sd=X0(!1),od=X0(!0),G0=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,ty,jA=0,ny=[],nt=$,ry=nt.__b,iy=nt.__r,Ay=nt.diffed,sy=nt.__c,oy=nt.unmount,ay=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(ly,n)}function AQ(n,e,t){var r=WA(zr++,2);if(r.t=n,!r.__c&&(r.__=[t?t(e):ly(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 cy(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=ny.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(ma),n.__H.__h.forEach(gd),n.__H.__h=[]}catch(e){n.__H.__h=[],nt.__e(e,n.__v)}}nt.__b=function(n){Ke=null,ry&&ry(n)},nt.__=function(n,e){n&&e.__k&&e.__k.__m&&(n.__m=e.__k.__m),ay&&ay(n,e)},nt.__r=function(n){iy&&iy(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(ma),e.__h.forEach(gd),e.__h=[],zr=0)),hd=Ke},nt.diffed=function(n){Ay&&Ay(n);var e=n.__c;e&&e.__H&&(e.__H.__h.length&&(ny.push(e)!==1&&ty===nt.requestAnimationFrame||((ty=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(ma),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)}}),sy&&sy(n,e)},nt.unmount=function(n){oy&&oy(n);var e,t=n.__c;t&&t.__H&&(t.__H.__.forEach(function(r){try{ma(r)}catch(i){e=i}}),t.__H=void 0,e&&nt.__e(e,t.__v))};var uy=typeof requestAnimationFrame=="function";function aQ(n){var e,t=function(){clearTimeout(r),uy&&cancelAnimationFrame(e),setTimeout(n)},r=setTimeout(t,100);uy&&(e=requestAnimationFrame(t))}function ma(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 ly(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 dy({onClose:n}){return C("button",{class:"obi-button obi-close-button",onClick:n,"aria-label":"Close",type:"button",children:C(cQ,{})})}function hy({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(dy,{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 py({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=ey(null);function lQ({children:n}){const e=cy(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=fy(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=cy(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=fy(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 fy(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 gy=8,va=8,hQ=50,pQ=.7,Di=3;function my({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,va).map(o=>{const a=Math.abs(o);return Math.min(a/pQ*gy,gy)||Di}):Array(va).fill(Di);for(;s.length<va;)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:va},(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 vy({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(dy,{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 yy(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 wy(n,e){this.props=n,this.context=e}(wy.prototype=new Kn).isPureReactComponent=!0,wy.prototype.shouldComponentUpdate=function(n,e){return yy(this.props,n)||yy(this.state,e)};var by=$.__b;$.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),by&&by(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 Cy(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 Cy(r,e,t)})),n}function _y(n,e,t){return n&&t&&(n.__v=null,n.__k=n.__k&&n.__k.map(function(r){return _y(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 Sy(n){var e=n.__.__c;return e&&e.__a&&e.__a(n)}function ya(){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=Sy(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]=_y(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]=Cy(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 ky=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]}};(ya.prototype=new Kn).__a=function(n){var e=this,t=Sy(e.__v),r=e.l.get(n);return r[0]++,function(i){var A=function(){e.props.revealOrder?(r.push(i),ky(e,n,r)):i()};t?t(A):A()}},ya.prototype.render=function(n){this.i=null,this.l=new Map;var e=fa(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},ya.prototype.componentDidUpdate=ya.prototype.componentDidMount=function(){var n=this;this.l.forEach(function(e,t){ky(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 Ey=$.event;function TQ(){}function IQ(){return this.cancelBubble}function FQ(){return this.defaultPrevented}$.event=function(n){return Ey&&(n=Ey(n)),n.persist=TQ,n.isPropagationStopped=IQ,n.isDefaultPrevented=FQ,n.nativeEvent=n};var xQ={enumerable:!1,configurable:!0,get:function(){return this.class}},Uy=$.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=fa(t.children).forEach(function(c){c.props.selected=i.value.indexOf(c.props.value)!=-1})),r=="select"&&i.defaultValue!=null&&(i.value=fa(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,Uy&&Uy(n)};var Ty=$.__r;$.__r=function(n){Ty&&Ty(n),n.__c};var Iy=$.diffed;$.diffed=function(n){Iy&&Iy(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(my,{getBands:n.spectrum}),Q&&q&&!be&&C(vy,{})]})]}),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(py,{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(py,{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(hy,{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 Fy({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:`
|
|
46
|
+
`},Vl}var c0;function YF(){if(c0)return un;c0=1;var n=zF(),e=XF(),t=Kl();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 Gl(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 u0 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=Gl(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=>{d0(A),A.type==="audio"?l0(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=>{d0(i),i.type==="audio"&&l0(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 vl(A)}})}ensureVideoDDExtensionForSVC(e,t){var r,i;if(!((r=e.ext)===null||r===void 0?void 0:r.some(s=>s.uri===Gv))){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:Gv})}}}function l0(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 d0(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 jl="vp8",tx={audioPreset:Bl.music,dtx:!0,red:!0,forceStereo:!1,simulcast:!0,screenShareEncoding:_l.h1080fps15.encoding,stopMicTrackOnMute:!1,videoCodec:jl,backupCodec:!0},h0={deviceId:{ideal:"default"},autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0,voiceIsolation:!0},p0={deviceId:{ideal:"default"},resolution:LA.h720.resolution},nx={adaptiveStream:!1,dynacast:!1,stopLocalTrackOnUnpublish:!0,reconnectPolicy:new WI,disconnectOnPageLeave:!0,webAudioMix:!1},Wl={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=Wl.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 u0(e,r),this.subscriber=new u0(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=g0(t,Xe.MAX_MESSAGE_BYTES),this.data=r?g0(r,Xe.MAX_DATA_BYTES):void 0}static fromProto(e){return new Xe(e.code,e.message,e.data)}toProto(){return new Fm({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 f0=15360;function ql(n){return new TextEncoder().encode(n).length}function g0(n,e){if(ql(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 Jl=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 m0 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=Gl(()=>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),jv()&&(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 ml("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 m0{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=Ml({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()},Jl)))}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 e0(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(Cl),ax=Object.values(_l),cx=[LA.h180,LA.h360],ux=[Cl.h180,Cl.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)}),zl=["q","h","f"];function Xl(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:zl[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=y0(r==null?void 0:r.screenShareSimulcastLayers))!==null&&i!==void 0?i:v0(n,l):d=(A=y0(r==null?void 0:r.videoSimulcastLayers))!==null&&A!==void 0?A:v0(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 Yl(e,t,[f,h,l],u);if(p>=480)return Yl(e,t,[f,l],u)}return Yl(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),Xl(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 v0(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 Yl(n,e,t,r){const i=[];if(t.forEach((A,s)=>{if(s>=zl.length)return;const o=Math.min(n,e),c={rid:zl[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()&&qv()==="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 y0(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 m0{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()},Jl))}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 Al({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=Ml({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 w0(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 w0(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),jv()&&this.isInBackground&&this.source===P.Source.Camera&&(this._mediaStreamTrack.enabled=!1)})}}function w0(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=b0(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 b0(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=b0((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 C0="_lossy",_0="_reliable",mx=2*1e3,Zl="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=Wl.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===_0)A.reliableDCSub=s;else if(s.label===C0)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===Zl&&(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 Dl(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(Zl);break;case Ui.RESUME:this.handleDisconnect(Zl)}}}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(C0,{ordered:!1,maxRetransmits:0}),this.reliableDC=this.pcManager.createPublisherDataChannel(_0,{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(Sl())return yield this.createTransceiverRTCRtpSender(e,t,r);if(kl())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(Sl())return this.createSimulcastTransceiverSender(e,t,r,i);if(kl())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 Im({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 Tm({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 vl("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 vl&&(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 Jm({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 zm({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 $l{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 Ul(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 S0{get info(){return this._info}constructor(e,t,r){this.reader=t,this.totalByteSize=r,this._info=e,this.bytesReceived=0}}class Bx extends S0{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 S0{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 k0{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 k0{}class Sx extends k0{}class E0 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(),Jl)),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 E0{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(El(t))return t.setSinkId(e)}))})}attach(e){const t=this.attachedElements.length===0;return e?super.attach(e):e=super.attach(),this.sinkId&&El(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 ed=100;class Ex extends E0{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=Gl(()=>{this.updateDimensions()},ed),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<ed){yt.setTimeout(()=>{this.updateVisibility()},ed);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"?Jv():t||(Jv()>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??td(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=td(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,Xv().observe(this.element),zv().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=Xv())===null||e===void 0||e.unobserve(this.element),(t=zv())===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?td(n,(t=window.documentPictureInPicture)===null||t===void 0?void 0:t.window):!1}function td(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 nd 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}=r0(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=$v(A,h0,p0),c=Ml(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 U0 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 xl,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 Wm({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 T0=15e3;class Qx extends U0{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 xl)},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!==sl.OK&&u.reject(new Nv(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 Nv("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=$v(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 ml("getDisplayMedia not supported");e.resolution===void 0&&!CF()&&(e.resolution=_l.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 yl("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 yl("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 yl("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=jl),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 tl({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 el({codec:p,cid:e.mediaStreamTrack.id})],t.backupCodec===!0&&(t.backupCodec={codec:jl}),t.backupCodec&&p!==t.backupCodec.codec&&g.encryption===jt.NONE&&(this.roomOptions.dynacast||(this.roomOptions.dynacast=!0),g.simulcastCodecs.push(new el({codec:t.backupCodec.codec,cid:""})))),v=Xl(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 F of this.engine.pcManager.publisher.getTransceivers())if(F.sender===e.sender){T=F;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=Xl(e.source===P.Source.ScreenShare,g.width,g.height,t))}yield y()}const B=new nd(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 tl({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 km({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 Em({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 Ju(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 Ju(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 Xu({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 Lm({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"?zu.UPDATE:zu.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,T0)){yield u.engine.waitForBufferStatusLow(he.RELIABLE);const g=new Yu({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 Zu({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 Xu({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 Dm({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+T0);yield f.waitForBufferStatusLow(he.RELIABLE);const _=new Lt({destinationIdentities:a,value:{case:"streamChunk",value:new Yu({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 Zu({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(ql(s)>f0){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 Um({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 xm({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||(Pl(this.track)&&(this.videoDimensions=e),this.currentVideoQuality=void 0,this.emitTrackUpdate()))}setVideoFPS(e){this.isManualOperationAllowed()&&Pl(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 Pl(this.track)&&this.track.isAdaptiveStream}emitTrackUpdate(){const e=new Nm({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 U0{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)&&Rl(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)&&Rl(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),Ul(new URL(s))&&(this.regionUrlProvider===void 0?this.regionUrlProvider=new $l(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,Zv(b)),f(b))}else{let B=An.UNKNOWN_REASON;b instanceof Ie&&(B=Zv(b)),this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,B),f(b)}}}),d=this.regionUrl;return this.regionUrl=void 0,this.connectFuture=new xl((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({},Wl),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=Fl();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=n0(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=n0(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({},h0),e==null?void 0:e.audioCaptureDefaults),this.options.videoCaptureDefaults=Object.assign(Object.assign({},p0),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});ql(u)>f0?(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(Ul(new URL(e))&&t){this.regionUrlProvider=new $l(e,t);const r=yield this.regionUrlProvider.getNextBestRegionUrl();r&&this.state===pe.Disconnected&&(this.regionUrl=r,yield fetch(Ql(r),{method:"HEAD"}),this.log.debug("prepared connection to ".concat(r),this.logContext))}else yield fetch(Ql(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(!El()&&!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=t0())!==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 nd(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]:Yv(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 nd(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]:Fl(),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=Yv(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=Fl(),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=I0(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 I0(n){return n.map(e=>{if(e)return Array.isArray(e)?I0(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 $l(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 rd=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/(rd/1e3)*100).toFixed(2),"%")),r.qualityLimitationDurations.cpu>0&&this.appendWarning("cpu limited ".concat((r.qualityLimitationDurations.cpu/(rd/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,rd)),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 e0(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 Dl,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 Dl;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)===Qm.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=R0(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=R0(d));let _=typeof i=="function"?i:Q0(i);y&&(_=typeof y=="function"?y:Q0({...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"},F={redirect:"follow",...o,...w,body:k,headers:Yx(T,s,p,g.header)};let x,I,Q=new t(Xx(u,{baseUrl:e,params:g,querySerializer:_}),F);for(const N in w)N in Q||(Q[N]=w[N]);if(a.length){x=Wx(),I=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:I,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:I,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 F0(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 x0(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 Q0(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(x0(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(F0(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,x0(i,o,{style:s,explode:A}));continue}if(typeof o=="object"){t=t.replace(r,F0(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 R0(n){return n.endsWith("/")?n.substring(0,n.length-1):n}const P0="Onboardee-Session-Token",O0="OnboardeeSessionToken";class M0{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(O0);r&&t.headers.set(P0,r)}return t},onResponse({response:t}){const r=t.headers.get(P0);return r&&window.localStorage&&window.localStorage.setItem(O0,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,i){return await this.client.GET("/api/products/{id}/analytics",{params:{path:{id:e},query:{...t&&{start_date:t},...r&&{end_date:r},...i&&{course_id:i}}}})}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 getPlanAnalytics(e,t,r){return await this.client.GET("/api/plans/{id}/analytics",{params:{path:{id:e},query:{...t&&{start_date:t},...r&&{end_date:r}}}})}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.courseId&&(t.course_id=e.courseId),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.courseId&&(t.course_id=e.courseId),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 L0="https://app.coragents.ai";class la extends Dc{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 M0({baseUrl:L0}),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 id extends Dc{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 M0({baseUrl:r.apiBaseUrl||L0}),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(),serialisedAt:new Date().toISOString()})}static deserialise(e,t,r,i={}){const A=JSON.parse(e),s=new id(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 da,$,D0,Jr,H0,N0,K0,V0,Ad,sd,od,G0,VA={},j0=[],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?da.call(arguments,2):t),typeof n=="function"&&n.defaultProps!=null)for(A in n.defaultProps)s[A]==null&&(s[A]=n.defaultProps[A]);return ha(n,s,r,i,null)}function ha(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??++D0,__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 W0(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 W0(n)}}function ud(n){(!n.__d&&(n.__d=!0)&&Jr.push(n)&&!pa.__r++||H0!=$.debounceRendering)&&((H0=$.debounceRendering)||N0)(pa)}function pa(){for(var n,e,t,r,i,A,s,o=1;Jr.length;)Jr.length>o&&Jr.sort(K0),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,Y0(A,t,s),t.__e!=i&&W0(t)));pa.__r=0}function q0(n,e,t,r,i,A,s,o,a,c,u){var l,d,h,f,p,g,v=r&&r.__k||j0,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=J0(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?ha(null,s,null,null,null):GA(s)?ha(_t,{children:s},null,null,null):s.constructor==null&&s.__b>0?ha(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)),$0(o,o));return r}function J0(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=J0(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 fa(n,e){return e=e||[],n==null||typeof n=="boolean"||(GA(n)?n.some(function(t){fa(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 z0(n,e,t){e[0]=="-"?n.setProperty(e,t??""):n[e]=t==null?"":typeof t!="number"||Zx.test(e)?t:t+"px"}function ga(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||z0(n.style,e,"");if(t)for(e in t)r&&t[e]==r[e]||z0(n.style,e,t[e])}else if(e[0]=="o"&&e[1]=="n")A=e!=(e=e.replace(V0,"$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 X0(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,F,x,I=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 I=="function")try{if(v=e.props,y="prototype"in I&&I.prototype.render,b=(u=I.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 I(v,B):(e.__c=l=new Kn(v,B),l.constructor=I,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&&I.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=Nn({},l.__s)),Nn(l.__s,I.getDerivedStateFromProps(v,l.__s))),h=l.props,f=l.state,l.__v=e,d)y&&I.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),y&&l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(y&&I.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)),F=u,u!=null&&u.type===_t&&u.key==null&&(F=Z0(u.props.children)),o=q0(n,GA(F)?F:[F],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 Y0(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 Z0(n){return typeof n!="object"||n==null||n.__b&&n.__b>0?n:GA(n)?n.map(Z0):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&&da.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;ga(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||ga(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=""),q0(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])&&ga(n,c,f,g[c],i),c="checked",p!=null&&p!=n[c]&&ga(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 $0(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]&&$0(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?da.call(e.childNodes):null,A,!r&&t?t:i?i.__e:e.firstChild,r,s),Y0(A,n,s)}function ey(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"+G0++,e.__=n,e.Provider=e.__l=(e.Consumer=function(t,r){return t.children(r)}).contextType=e,e}da=j0.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}},D0=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=[],N0=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,K0=function(n,e){return n.__v.__b-e.__v.__b},pa.__r=0,V0=/(PointerCapture)$|Capture$/i,Ad=0,sd=X0(!1),od=X0(!0),G0=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,ty,jA=0,ny=[],nt=$,ry=nt.__b,iy=nt.__r,Ay=nt.diffed,sy=nt.__c,oy=nt.unmount,ay=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(ly,n)}function AQ(n,e,t){var r=WA(zr++,2);if(r.t=n,!r.__c&&(r.__=[t?t(e):ly(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 cy(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=ny.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(ma),n.__H.__h.forEach(gd),n.__H.__h=[]}catch(e){n.__H.__h=[],nt.__e(e,n.__v)}}nt.__b=function(n){Ke=null,ry&&ry(n)},nt.__=function(n,e){n&&e.__k&&e.__k.__m&&(n.__m=e.__k.__m),ay&&ay(n,e)},nt.__r=function(n){iy&&iy(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(ma),e.__h.forEach(gd),e.__h=[],zr=0)),hd=Ke},nt.diffed=function(n){Ay&&Ay(n);var e=n.__c;e&&e.__H&&(e.__H.__h.length&&(ny.push(e)!==1&&ty===nt.requestAnimationFrame||((ty=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(ma),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)}}),sy&&sy(n,e)},nt.unmount=function(n){oy&&oy(n);var e,t=n.__c;t&&t.__H&&(t.__H.__.forEach(function(r){try{ma(r)}catch(i){e=i}}),t.__H=void 0,e&&nt.__e(e,t.__v))};var uy=typeof requestAnimationFrame=="function";function aQ(n){var e,t=function(){clearTimeout(r),uy&&cancelAnimationFrame(e),setTimeout(n)},r=setTimeout(t,100);uy&&(e=requestAnimationFrame(t))}function ma(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 ly(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 dy({onClose:n}){return C("button",{class:"obi-button obi-close-button",onClick:n,"aria-label":"Close",type:"button",children:C(cQ,{})})}function hy({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(dy,{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 py({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=ey(null);function lQ({children:n}){const e=cy(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=fy(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=cy(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=fy(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 fy(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 gy=8,va=8,hQ=50,pQ=.7,Di=3;function my({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,va).map(o=>{const a=Math.abs(o);return Math.min(a/pQ*gy,gy)||Di}):Array(va).fill(Di);for(;s.length<va;)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:va},(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 vy({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(dy,{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 yy(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 wy(n,e){this.props=n,this.context=e}(wy.prototype=new Kn).isPureReactComponent=!0,wy.prototype.shouldComponentUpdate=function(n,e){return yy(this.props,n)||yy(this.state,e)};var by=$.__b;$.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),by&&by(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 Cy(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 Cy(r,e,t)})),n}function _y(n,e,t){return n&&t&&(n.__v=null,n.__k=n.__k&&n.__k.map(function(r){return _y(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 Sy(n){var e=n.__.__c;return e&&e.__a&&e.__a(n)}function ya(){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=Sy(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]=_y(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]=Cy(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 ky=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]}};(ya.prototype=new Kn).__a=function(n){var e=this,t=Sy(e.__v),r=e.l.get(n);return r[0]++,function(i){var A=function(){e.props.revealOrder?(r.push(i),ky(e,n,r)):i()};t?t(A):A()}},ya.prototype.render=function(n){this.i=null,this.l=new Map;var e=fa(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},ya.prototype.componentDidUpdate=ya.prototype.componentDidMount=function(){var n=this;this.l.forEach(function(e,t){ky(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 Ey=$.event;function TQ(){}function IQ(){return this.cancelBubble}function FQ(){return this.defaultPrevented}$.event=function(n){return Ey&&(n=Ey(n)),n.persist=TQ,n.isPropagationStopped=IQ,n.isDefaultPrevented=FQ,n.nativeEvent=n};var xQ={enumerable:!1,configurable:!0,get:function(){return this.class}},Uy=$.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=fa(t.children).forEach(function(c){c.props.selected=i.value.indexOf(c.props.value)!=-1})),r=="select"&&i.defaultValue!=null&&(i.value=fa(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,Uy&&Uy(n)};var Ty=$.__r;$.__r=function(n){Ty&&Ty(n),n.__c};var Iy=$.diffed;$.diffed=function(n){Iy&&Iy(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 F(){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 I(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:()=>I(!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:()=>I(!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:F,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(my,{getBands:n.spectrum}),Q&&q&&!be&&C(vy,{})]})]}),C(Kt.Content,{children:C("div",{onMouseLeave:w,children:[Y&&C(qA,{onClick:F,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:()=>I(!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(py,{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(py,{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(hy,{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 Fy({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:`
|
|
47
47
|
0 0 20px color-mix(in srgb, var(--obi-color-primary) 20%, transparent),
|
|
48
48
|
0 0 40px color-mix(in srgb, var(--obi-color-primary) 15%, transparent),
|
|
49
49
|
0 0 60px color-mix(in srgb, var(--obi-color-primary) 8%, transparent)
|
|
@@ -58,7 +58,7 @@ a=extmap-allow-mixed`)!==-1){const A=i.sdp.split(`
|
|
|
58
58
|
50% { transform: translateX(344px); }
|
|
59
59
|
100% { transform: translateX(344px); }
|
|
60
60
|
}
|
|
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(my,{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(hy,{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(Fy,{})}),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 xy={hostname:""};V={crypto:{randomUUID:function(){throw Error("unsupported")}},navigator:{userAgent:"",onLine:!0},document:{createElement:function(){return{}},location:xy,referrer:""},screen:{width:0,height:0},location:xy,addEventListener:function(){},removeEventListener:function(){}}}else V=window;function Qy(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 Ry(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){Ry(A,r,i,s,o,"next",a)}function o(a){Ry(A,r,i,s,o,"throw",a)}s(void 0)})}}function wa(n,e,t){return Py()?wa=Reflect.construct:wa=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},wa.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 Qy(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 Qy(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 wa(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 Py(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Py=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 Oy(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)},My,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},Ly=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||{}),Dy={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Hy={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ba={},uR=function(){return!!globalThis.Zone};function _d(n){if(Ba[n])return Ba[n];var e=globalThis[n],t=e.prototype,r=n in Dy?Dy[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 Hy?Hy[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 Ba[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?Ba[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 Ny(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 Ny("Node",n,"contains")(e)}function gR(n){return Ny("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 Ky(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 Vy(i,t)}).join("");return CR(r)}catch{return null}}function Vy(n,e){if(kR(n)){var t;try{t=Ed(n.styleSheet)||_R(n)}catch{t=n.cssText}return n.styleSheet.href?Ca(t,n.styleSheet.href):t}else{var r=n.cssText;return ER(n)&&n.selectorText.includes(":")&&(r=SR(r)),e?Ca(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 Gy=function(){function n(){Ly(this,"idNodeMap",new Map),Ly(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 Gy}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 jy="__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=jy in A?A[jy]: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 Wy(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 Ca(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 qy(){return MR++}function DR(n){if(ee(n,HTMLFormElement))return"form";var e=Yr(n.tagName);return LR.test(e)?"div":e}var Ni,Jy,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=_a(n,A.substring(0,A.length-1)),i.push(A);else{var s="";A=_a(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 zy=new WeakMap;function _a(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=zy.get(n);if(t||(t=n.createElement("a"),zy.set(n,t)),!e)e="";else if(e.startsWith("blob:")||e.startsWith("data:"))return e;return t.setAttribute("href",e),t.href}function Xy(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")?_a(n,r):t==="srcset"?KR(n,r):t==="style"?Ca(r,Fd(n)):e==="object"&&t==="data"?_a(n,r):r)}function Yy(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 Sa(n,e,t){if(!n)return!1;if(n.nodeType!==n.ELEMENT_NODE)return t?Sa(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?Sa(kt.parentNode(n),e,t):!1}function Zy(n,e,t,r){var i;if(Ky(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(Sa(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=Ca(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];Yy(y,_.name,_.value)||(b[_.name]=Xy(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"),Jy=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,Jy.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"&&Wy(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=Zy(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=qy();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 Fp=ks.value,Mc=Ki(Fp,At);Mc&&te.childNodes.push(Mc)}}var xr=null;if(Ky(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"&&Wy(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 Gy: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,$y=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=$y(),xd.exports.createColors=$y;var tP=xd.exports,nP={},rP=Object.freeze(Object.defineProperty({__proto__:null,default:nP},Symbol.toStringTag,{value:"Module"})),rt=eP(rP),ew=tP,tw=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=ew.isColorSupported),tw&&r&&(A=tw(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=ew.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+`
|
|
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(my,{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(hy,{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(Fy,{})}),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 xy={hostname:""};V={crypto:{randomUUID:function(){throw Error("unsupported")}},navigator:{userAgent:"",onLine:!0},document:{createElement:function(){return{}},location:xy,referrer:""},screen:{width:0,height:0},location:xy,addEventListener:function(){},removeEventListener:function(){}}}else V=window;function Qy(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 Ry(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){Ry(A,r,i,s,o,"next",a)}function o(a){Ry(A,r,i,s,o,"throw",a)}s(void 0)})}}function wa(n,e,t){return Py()?wa=Reflect.construct:wa=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},wa.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 Qy(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 Qy(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 wa(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 Py(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Py=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 Oy(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)},My,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},Ly=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||{}),Dy={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Hy={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ba={},uR=function(){return!!globalThis.Zone};function _d(n){if(Ba[n])return Ba[n];var e=globalThis[n],t=e.prototype,r=n in Dy?Dy[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 Hy?Hy[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 Ba[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?Ba[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 Ny(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 Ny("Node",n,"contains")(e)}function gR(n){return Ny("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 Ky(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 Vy(i,t)}).join("");return CR(r)}catch{return null}}function Vy(n,e){if(kR(n)){var t;try{t=Ed(n.styleSheet)||_R(n)}catch{t=n.cssText}return n.styleSheet.href?Ca(t,n.styleSheet.href):t}else{var r=n.cssText;return ER(n)&&n.selectorText.includes(":")&&(r=SR(r)),e?Ca(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 Gy=function(){function n(){Ly(this,"idNodeMap",new Map),Ly(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 Gy}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 jy="__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=jy in A?A[jy]: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 Wy(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 Ca(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 qy(){return MR++}function DR(n){if(ee(n,HTMLFormElement))return"form";var e=Yr(n.tagName);return LR.test(e)?"div":e}var Ni,Jy,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=_a(n,A.substring(0,A.length-1)),i.push(A);else{var s="";A=_a(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 zy=new WeakMap;function _a(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=zy.get(n);if(t||(t=n.createElement("a"),zy.set(n,t)),!e)e="";else if(e.startsWith("blob:")||e.startsWith("data:"))return e;return t.setAttribute("href",e),t.href}function Xy(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")?_a(n,r):t==="srcset"?KR(n,r):t==="style"?Ca(r,Fd(n)):e==="object"&&t==="data"?_a(n,r):r)}function Yy(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 Sa(n,e,t){if(!n)return!1;if(n.nodeType!==n.ELEMENT_NODE)return t?Sa(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?Sa(kt.parentNode(n),e,t):!1}function Zy(n,e,t,r){var i;if(Ky(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(Sa(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=Ca(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];Yy(y,_.name,_.value)||(b[_.name]=Xy(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 F=Ed(n.sheet);F&&(n.childNodes.length>1&&(F=OR(F,n)),b._cssText=F)}if(y==="input"||y==="textarea"||y==="select"){var x=n.value,I=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}):I&&(b.checked=I)}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"),Jy=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,Jy.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"&&Wy(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,F=e.iframeLoadTimeout,x=F===void 0?5e3:F,I=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=Zy(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=qy();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:I,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 Fp=ks.value,Mc=Ki(Fp,At);Mc&&te.childNodes.push(Mc)}}var xr=null;if(Ky(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:I,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"&&Wy(te.attributes.href)==="css")&&WR(n,function(){if(I){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:I,stylesheetLoadTimeout:D,keepIframeSrcFn:N});Xn&&I(n,Xn)}},D),te}function ZR(n,e){var t=e||{},r=t.mirror,i=r===void 0?new Gy: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,F=t.dataURLOptions,x=t.preserveWhiteSpace,I=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:F,inlineImages:g,recordCanvas:y,preserveWhiteSpace:x,onSerialize:I,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,$y=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=$y(),xd.exports.createColors=$y;var tP=xd.exports,nP={},rP=Object.freeze(Object.defineProperty({__proto__:null,default:nP},Symbol.toStringTag,{value:"Module"})),rt=eP(rP),ew=tP,tw=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=ew.isColorSupported),tw&&r&&(A=tw(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=ew.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
62
|
`+B+u("^")}return" "+l(b)+g}).join(`
|
|
63
63
|
`)},t.toString=function(){var r=this.showSourceCode();return r&&(r=`
|
|
64
64
|
|
|
@@ -81,7 +81,7 @@ a=extmap-allow-mixed`)!==-1){const A=i.sdp.split(`
|
|
|
81
81
|
`)&&(r=`\r
|
|
82
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||Ra(i.file),o=void 0;this.mapOpts.sourcesContent===!1?(o=new uw(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=Qa.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new Qa({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 Qa({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
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?Ra(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(i=Ra(dw(i,this.mapOpts.annotation)));var A=lw(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(pw){var i=pw(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;hw==="\\"&&(t=t.replace(/\\/g,"/"));var i=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,i),i},n}(),fw=kP,EP=Ua,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),Pa=Wd;Wd.default=Wd;var gw=wr.isClean,mw=wr.my,vw=Ta,yw=Pa,UP=Ua,ww,qd,Jd,bw;function Bw(n){return n.map(function(e){return e.nodes&&(e.nodes=Bw(e.nodes)),delete e.source,e})}function Cw(n){if(n[gw]=!1,n.proxyOf.nodes)for(var e=W(n.proxyOf.nodes),t;!(t=e()).done;){var r=t.value;Cw(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(ww(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 vw(r)]}else if(r.selector)r=[new qd(r)];else if(r.name)r=[new Jd(r)];else if(r.text)r=[new yw(r)];else throw new Error("Unknown node type in node creation");var d=r.map(function(h){return h[mw]||e.rebuild(h),h=h.proxyOf,h.parent&&h.parent.removeChild(h),h[gw]&&Cw(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){ww=n},Vn.registerRule=function(n){qd=n},Vn.registerAtRule=function(n){Jd=n},Vn.registerRoot=function(n){bw=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,vw.prototype):n.type==="comment"?Object.setPrototypeOf(n,yw.prototype):n.type==="root"&&Object.setPrototypeOf(n,bw.prototype),n[mw]=!0,n.nodes&&n.nodes.forEach(function(e){Vn.rebuild(e)})};var TP=Zr,_w,Sw,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 _w(new Sw,this,r);return i.stringify()},e}(TP);es.registerLazyResult=function(n){_w=n},es.registerProcessor=function(n){Sw=n};var zd=es;es.default=es;var kw={},Ew=function(n){kw[n]||(kw[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}(),Uw=Xd;Xd.default=Xd;var IP=Uw,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),Tw='"'.charCodeAt(0),Oa="\\".charCodeAt(0),Iw="/".charCodeAt(0),Ma=`
|
|
84
|
-
`.charCodeAt(0),ts=" ".charCodeAt(0),La="\f".charCodeAt(0),Da=" ".charCodeAt(0),Ha="\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),Na=/[\t\n\f\r "#'()/;[\\\]{}]/g,Ka=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,NP=/.[\r\n"'(/\\]/,Fw=/[\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 Ma:case ts:case Da:case Ha:case La:{A=p;do A+=1,i=t.charCodeAt(A);while(i===ts||i===Ma||i===Da||i===Ha||i===La);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
|
|
84
|
+
`.charCodeAt(0),ts=" ".charCodeAt(0),La="\f".charCodeAt(0),Da=" ".charCodeAt(0),Ha="\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),Na=/[\t\n\f\r "#'()/;[\\\]{}]/g,Ka=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,NP=/.[\r\n"'(/\\]/,Fw=/[\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 Ma:case ts:case Da:case Ha:case La:{A=p;do A+=1,i=t.charCodeAt(A);while(i===ts||i===Ma||i===Da||i===Ha||i===La);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 F=String.fromCharCode(i);h=[F,F,p];break}case QP:{if(l=g.length?g.pop()[1]:"",d=t.charCodeAt(p+1),l==="url"&&d!==$d&&d!==Tw&&d!==ts&&d!==Ma&&d!==Da&&d!==La&&d!==Ha){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)===Oa;)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 Tw:{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)===Oa;)u-=1,c=!c}while(c);h=["string",t.slice(p,A+1),p,A],p=A;break}case HP:{Na.lastIndex=p+1,Na.test(t),Na.lastIndex===0?A=t.length-1:A=Na.lastIndex-2,h=["at-word",t.slice(p,A+1),p,A],p=A;break}case Oa:{for(A=p,a=!0;t.charCodeAt(A+1)===Oa;)A+=1,a=!a;if(i=t.charCodeAt(A+1),a&&i!==Iw&&i!==ts&&i!==Ma&&i!==Da&&i!==Ha&&i!==La&&(A+=1,Fw.test(t.charAt(A)))){for(;Fw.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===Iw&&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):(Ka.lastIndex=p+1,Ka.test(t),Ka.lastIndex===0?A=t.length-1:A=Ka.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}},xw=Zr,Va=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}(xw),eh=Va;Va.default=Va,xw.registerAtRule(Va);var Qw=Zr,Rw,Pw,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 Rw(new Pw,this,r);return i.stringify()},e}(Qw);Vi.registerLazyResult=function(n){Rw=n},Vi.registerProcessor=function(n){Pw=n};var ns=Vi;Vi.default=Vi,Qw.registerRoot(Vi);var rs={comma:function(n){return rs.split(n,[","],!0)},space:function(n){var e=[" ",`
|
|
85
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}},Ow=rs;rs.default=rs;var Mw=Zr,VP=Ow,Ga=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}(Mw),th=Ga;Ga.default=Ga,Mw.registerRule(Ga);var GP=Ta,jP=KP,WP=Pa,qP=eh,JP=ns,Lw=th,Dw={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 Lw;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",!Dw[d]&&!Dw[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 Lw;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=xa;function ja(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
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
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+=`
|
|
@@ -110,7 +110,7 @@ https://www.w3ctech.com/topic/2226`));var a=e.apply(void 0,[].concat(s));return
|
|
|
110
110
|
`)&&(r=`\r
|
|
111
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||ec(i.file),o=void 0;this.mapOpts.sourcesContent===!1?(o=new ob(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=$a.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new $a({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 $a({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
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?ec(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(i=ec(cb(i,this.mapOpts.annotation)));var A=ab(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(lb){var i=lb(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;ub==="\\"&&(t=t.replace(/\\/g,"/"));var i=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,i),i},n}(),db=v2,y2=Ja,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),tc=bh;bh.default=bh;var hb=br.isClean,pb=br.my,fb=za,gb=tc,w2=Ja,mb,Bh,Ch,vb;function yb(n){return n.map(function(e){return e.nodes&&(e.nodes=yb(e.nodes)),delete e.source,e})}function wb(n){if(n[hb]=!1,n.proxyOf.nodes)for(var e=W(n.proxyOf.nodes),t;!(t=e()).done;){var r=t.value;wb(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=yb(mb(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 fb(r)]}else if(r.selector)r=[new Bh(r)];else if(r.name)r=[new Ch(r)];else if(r.text)r=[new gb(r)];else throw new Error("Unknown node type in node creation");var d=r.map(function(h){return h[pb]||e.rebuild(h),h=h.proxyOf,h.parent&&h.parent.removeChild(h),h[hb]&&wb(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){mb=n},Gn.registerRule=function(n){Bh=n},Gn.registerAtRule=function(n){Ch=n},Gn.registerRoot=function(n){vb=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,fb.prototype):n.type==="comment"?Object.setPrototypeOf(n,gb.prototype):n.type==="root"&&Object.setPrototypeOf(n,vb.prototype),n[pb]=!0,n.nodes&&n.nodes.forEach(function(e){Gn.rebuild(e)})};var b2=$r,bb,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 bb(new Bb,this,r);return i.stringify()},e}(b2);os.registerLazyResult=function(n){bb=n},os.registerProcessor=function(n){Bb=n};var _h=os;os.default=os;var Cb={},_b=function(n){Cb[n]||(Cb[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}(),Sb=Sh;Sh.default=Sh;var B2=Sb,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),kb='"'.charCodeAt(0),nc="\\".charCodeAt(0),Eb="/".charCodeAt(0),rc=`
|
|
113
|
-
`.charCodeAt(0),as=" ".charCodeAt(0),ic="\f".charCodeAt(0),Ac=" ".charCodeAt(0),sc="\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),oc=/[\t\n\f\r "#'()/;[\\\]{}]/g,ac=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Q2=/.[\r\n"'(/\\]/,Ub=/[\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 rc:case as:case Ac:case sc:case ic:{A=p;do A+=1,i=t.charCodeAt(A);while(i===as||i===rc||i===Ac||i===sc||i===ic);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
|
|
113
|
+
`.charCodeAt(0),as=" ".charCodeAt(0),ic="\f".charCodeAt(0),Ac=" ".charCodeAt(0),sc="\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),oc=/[\t\n\f\r "#'()/;[\\\]{}]/g,ac=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Q2=/.[\r\n"'(/\\]/,Ub=/[\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 rc:case as:case Ac:case sc:case ic:{A=p;do A+=1,i=t.charCodeAt(A);while(i===as||i===rc||i===Ac||i===sc||i===ic);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 F=String.fromCharCode(i);h=[F,F,p];break}case S2:{if(l=g.length?g.pop()[1]:"",d=t.charCodeAt(p+1),l==="url"&&d!==Uh&&d!==kb&&d!==as&&d!==rc&&d!==Ac&&d!==ic&&d!==sc){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)===nc;)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 kb:{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)===nc;)u-=1,c=!c}while(c);h=["string",t.slice(p,A+1),p,A],p=A;break}case x2:{oc.lastIndex=p+1,oc.test(t),oc.lastIndex===0?A=t.length-1:A=oc.lastIndex-2,h=["at-word",t.slice(p,A+1),p,A],p=A;break}case nc:{for(A=p,a=!0;t.charCodeAt(A+1)===nc;)A+=1,a=!a;if(i=t.charCodeAt(A+1),a&&i!==Eb&&i!==as&&i!==rc&&i!==Ac&&i!==sc&&i!==ic&&(A+=1,Ub.test(t.charAt(A)))){for(;Ub.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===Eb&&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):(ac.lastIndex=p+1,ac.test(t),ac.lastIndex===0?A=t.length-1:A=ac.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}},Tb=$r,cc=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}(Tb),Th=cc;cc.default=cc,Tb.registerAtRule(cc);var Ib=$r,Fb,xb,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 Fb(new xb,this,r);return i.stringify()},e}(Ib);Wi.registerLazyResult=function(n){Fb=n},Wi.registerProcessor=function(n){xb=n};var cs=Wi;Wi.default=Wi,Ib.registerRoot(Wi);var us={comma:function(n){return us.split(n,[","],!0)},space:function(n){var e=[" ",`
|
|
114
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}},Qb=us;us.default=us;var Rb=$r,P2=Qb,uc=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}(Rb),Ih=uc;uc.default=uc,Rb.registerRule(uc);var O2=za,M2=R2,L2=tc,D2=Th,H2=cs,Pb=Ih,Ob={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 Pb;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",!Ob[d]&&!Ob[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 Pb;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=Za;function lc(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
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
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+=`
|
|
@@ -118,11 +118,11 @@ You tried to parse Less with the standard CSS parser; try again with the postcss
|
|
|
118
118
|
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(n+`: 里面 postcss.plugin 被弃用. 迁移指南:
|
|
119
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 Vb(n)},Ee.atRule=function(n){return new Gb(n)},Ee.decl=function(n){return new Nb(n)},Ee.rule=function(n){return new jb(n)},Ee.root=function(n){return new Wb(n)},Ee.document=function(n){return new Kb(n)},Ee.CssSyntaxError=CM,Ee.Declaration=Nb,Ee.Container=SM,Ee.Processor=Ph,Ee.Document=Kb,Ee.Comment=Vb,Ee.Warning=UM,Ee.AtRule=Gb,Ee.Result=TM,Ee.Input=IM,Ee.Rule=jb,Ee.Root=Wb,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}(),qb={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Jb={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},dc={},OM=function(){return!!globalThis.Zone};function Oh(n){if(dc[n])return dc[n];var e=globalThis[n],t=e.prototype,r=n in qb?qb[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 Jb?Jb[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 dc[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?dc[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 zb(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 zb("Node",n,"contains")(e)}function KM(n){return zb("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 Xb(){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:Xb};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
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.`,Yb={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&&(Yb=new Proxy(Yb,{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 hc(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 hc(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 pc=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(pc=function(){return new Date().getTime()});function Zb(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 $b(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function eB(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function tB(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=tB(n);if(!i)return!1;try{if(typeof e=="string"){if(i.classList.contains(e)||r&&i.closest("."+e)!==null)return!0}else if(Sa(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 nB(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?nB(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 rB(n,e){return!!(n.nodeName==="IFRAME"&&e.getMeta(n))}function iB(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 AB(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=AB(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 sB(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||{}),oB=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}(oB||{});function aB(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&&aB(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&&aB(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}(),cB=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||!sB(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(AB(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){rB(Y,t.mirror)&&t.iframeManager.addIframe(Y),iB(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;uB(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;!lB(t.droppedSet,h)&&!uB(t.removesSubTreeCache,h,t.mirror)||lB(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:Zy(r.target,t.maskTextClass,t.maskTextSelector,!0)&&i?t.maskTextFn?t.maskTextFn(i,tB(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"),!Yy(A.tagName,s))if(c.attributes[s]=Xy(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||nB(r.target,t.mirror)||(t.movedSet.has(b)&&t.movedMap[cB(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[cB(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 uB(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 lB(n,e){return n.size===0?!1:dB(n,e)}function dB(n,e){var t=se.parentNode(e);return t?n.has(t)?!0:dB(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 hB(n,e){var t=new eL;ei.push(t),t.init(n);var r=new(Xb())(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=pc()),o.push({x:p,y:g,id:i.getId(h),timeOffset:pc()-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 pB(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=Zb(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=$b(),a=eB();(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"],fB=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 _=fB.get(B);if(!_||_.text!==w.text||_.isChecked!==w.isChecked){fB.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 hc(B[0],B[1],{set:function(){de(d)({target:this,isTrusted:!1})}},!1,g)})))}return de(function(){p.forEach(function(B){return B()})})}function fc(n){var e=[];function t(r,i){if(gc("CSSGroupingRule")&&ee(r.parentRule,CSSGroupingRule)||gc("CSSMediaRule")&&ee(r.parentRule,CSSMediaRule)||gc("CSSSupportsRule")&&ee(r.parentRule,CSSSupportsRule)||gc("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={};mc("CSSGroupingRule")?u.CSSGroupingRule=A.CSSGroupingRule:(mc("CSSMediaRule")&&(u.CSSMediaRule=A.CSSMediaRule),mc("CSSConditionRule")&&(u.CSSConditionRule=A.CSSConditionRule),mc("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(fc(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(fc(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 gB(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:fc(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:fc(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=hB(n,n.doc));var i=AL(n),A=sL(n),s=pB(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=gB(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 gc(n){return typeof window[n]<"u"}function mc(n){return!!(typeof window[n]<"u"&&window[n].prototype&&"insertRule"in window[n].prototype&&"deleteRule"in window[n].prototype)}for(var mB=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 mB(qy)),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 mB(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!==oB.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=hB(fe({},this.bypassOptions,{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push(function(){return A.disconnect()}),this.restoreHandlers.push(pB(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(gB({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&&sB(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),vc=0;vc<$i.length;vc++)wL[$i.charCodeAt(vc)]=vc;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},vB=new Map;function BL(n,e){var t=vB.get(n);return t||(t=new Map,vB.set(n,t)),t.has(e)||t.set(e,[]),t.get(e)}var yB=function(n,e,t){if(!(!n||!(bB(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 yc(n,e,t){if(ee(n,Array))return n.map(function(f){return yc(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:[yc(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:[yc(n.data,e,t),n.width,n.height]}}else if(bB(n,e)||(typeof n>"u"?"undefined":Ae(n))==="object"){var d=n.constructor.name,h=yB(n,e,t);return{rr_type:d,index:h}}return n}var wB=function(n,e,t){return n.map(function(r){return yc(r,e,t)})},bB=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=wB(p,e,h);n(h.canvas,{type:Yi["2D"],property:c,args:v})},0),d.apply(this,p)}});A.push(u)}catch{var l=hc(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 CB(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(yB(y,A,this),"tagName"in this.canvas&&!It(this.canvas,r,i,!0)){var b=wB(g,A,this),B={type:e,property:l,args:b};t(this.canvas,B)}return y}});o.push(d)}catch{var h=hc(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(CB(e.WebGLRenderingContext.prototype,Yi.WebGL,n,t,r,e))),typeof e.WebGL2RenderingContext<"u"){var s;(s=A).push.apply(s,[].concat(CB(e.WebGL2RenderingContext.prototype,Yi.WebGL2,n,t,r,e)))}return function(){A.forEach(function(o){return o()})}}var _B="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",kL=function(n){return Uint8Array.from(atob(n),function(e){return e.charCodeAt(0)})},SB=typeof window<"u"&&window.Blob&&new Blob([kL(_B)],{type:"text/javascript;charset=utf-8"});function EL(n){var e;try{if(e=SB&&(window.URL||window.webkitURL).createObjectURL(SB),!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,"+_B,{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:Vy(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,wc,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=((My=Gh.contentWindow)==null?void 0:My.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,Fp=ks===void 0?new Set([]):ks,Mc=n.errorHandler;rL(Mc);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=pc(),(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)&&wc(!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 xp=new IL;Vh=new UL({recordCanvas:ge,mutationCb:HC,win:window,blockClass:A,blockSelector:o,mirror:pn,sampling:x.canvas,dataURLOptions:Q});var Lc=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:xp},mirror:pn});wc=function(Te){if(Te===void 0&&(Te=!1),!!N){Ye({type:ue.Meta,data:{href:window.location.href,width:eB(),height:$b()}},Te),ci.reset(),Lc.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){rB(J,pn)&&ui.addIframe(J),iB(J,pn)&&ci.trackLinkElement(J),Nh(J)&&Lc.addShadowRoot(se.shadowRoot(J),document)},onIframeLoad:function(J,We){ui.attachIframe(J,We),Lc.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:Zb(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:Lc,processedNodeManager:xp,canvasManager:Vh,ignoreCSSAttributes:Fp,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 Qp=function(){wc(),Us.push(VC(document)),bc=!0};return document.readyState==="interactive"||document.readyState==="complete"?Qp():(Us.push(Tt("DOMContentLoaded",function(){Ye({type:ue.DomContentLoaded,data:{}}),je==="DOMContentLoaded"&&Qp()})),Us.push(Tt("load",function(){Ye({type:ue.Load,data:{}}),je==="load"&&Qp()},window))),function(){Us.forEach(function(Te){return Te()}),xp.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");wc(n)},_r.mirror=pn;var kB;(function(n){n[n.NotStarted=0]="NotStarted",n[n.Running=1]="Running",n[n.Stopped=2]="Stopped"})(kB||(kB={})),_r.addCustomEvent,_r.freezePage,_r.takeFullSnapshot;var EB=V.setImmediate,Sr,jh,Wh,UB=Object.prototype.toString,FL=typeof EB<"u"?function(n){return EB(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 Bc(n,e){Wh.add(n,e),jh||(jh=FL(Wh.drain))}function TB(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=TB(r))?i.call(r,t.resolve,t.reject):t.resolve(r))}catch(A){t.reject(A)}}function IB(n){var e,t=this;if(!t.triggered){t.triggered=!0,t.def&&(t=t.def);try{(e=TB(n))?Bc(function(){var r=new xB(t);try{e.call(n,function(){IB.apply(r,arguments)},function(){ms.apply(r,arguments)})}catch(i){ms.call(r,i)}}):(t.msg=n,t.state=1,t.chain.length>0&&Bc(qh,t))}catch(r){ms.call(new xB(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&&Bc(qh,e))}function FB(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 xB(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&&Bc(qh,e),i.promise},this.catch=function(t){return this.then(void 0,t)};try{n.call(void 0,function(t){IB.call(e,t)},function(t){ms.call(e,t)})}catch(t){ms.call(e,t)}}var QB=Sr({},"constructor",kr,!1);kr.prototype=QB,Sr(QB,"__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 UB.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;FB(e,n,function(o,a){A[o]=a,++s===i&&t(A)},r)})}),Sr(kr,"race",function(n){var e=this;return UB.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");FB(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,Cc=Array.prototype,RL=Function.prototype,RB=Object.prototype,ti=Cc.slice,ys=RB.toString,_c=RB.hasOwnProperty,at=V.console,Er=V.navigator,me=V.document,Sc=V.opera,PB=V.screen,Wn=Er.userAgent,zh=RL.bind,OB=Cc.forEach,MB=Cc.indexOf,LB=Cc.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)}}},DB=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(OB&&n.forEach===OB)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(_c.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&&_c.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(LB&&n.map===LB)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:MB&&n.indexOf===MB?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(_c.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?`[
|
|
121
|
+
or you can use record.mirror to access the mirror instance during recording.`,Yb={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&&(Yb=new Proxy(Yb,{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 hc(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 hc(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 pc=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(pc=function(){return new Date().getTime()});function Zb(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 $b(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function eB(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function tB(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=tB(n);if(!i)return!1;try{if(typeof e=="string"){if(i.classList.contains(e)||r&&i.closest("."+e)!==null)return!0}else if(Sa(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 nB(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?nB(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 rB(n,e){return!!(n.nodeName==="IFRAME"&&e.getMeta(n))}function iB(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 AB(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=AB(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 sB(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||{}),oB=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}(oB||{});function aB(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&&aB(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&&aB(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}(),cB=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(I){for(var Q=I,D=$A;D===$A;)Q=Q&&Q.nextSibling,D=Q&&t.mirror.getId(Q);return D},o=function(I){var Q=se.parentNode(I);if(!(!Q||!sB(I))){var D=!1;if(I.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(AB(I)):t.mirror.getId(Q),q=s(I);if(N===-1||q===-1)return A.addNode(I);var ge=Ki(I,{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){rB(Y,t.mirror)&&t.iframeManager.addIframe(Y),iB(Y,t.mirror)&&t.stylesheetManager.trackLinkElement(Y),Nh(I)&&t.shadowDomManager.addShadowRoot(se.shadowRoot(I),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;uB(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;!lB(t.droppedSet,h)&&!uB(t.removesSubTreeCache,h,t.mirror)||lB(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),F=t.mirror.getId(T);if(F!==-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(I){var Q=I.node,D=se.parentNode(Q);return D&&D.tagName==="TEXTAREA"&&t.genTextAreaValueMutation(D),{id:t.mirror.getId(Q),value:I.value}}).filter(function(I){return!i.has(I.id)}).filter(function(I){return t.mirror.has(I.id)}),attributes:t.attributes.map(function(I){var Q=I.attributes;if(typeof Q.style=="string"){var D=JSON.stringify(I.styleDiff),X=JSON.stringify(I._unchangedStyles);D.length<Q.style.length&&(D+X).split("var(").length===Q.style.split("var(").length&&(Q.style=I.styleDiff)}return{id:t.mirror.getId(I.node),attributes:Q}}).filter(function(I){return!i.has(I.id)}).filter(function(I){return t.mirror.has(I.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:Zy(r.target,t.maskTextClass,t.maskTextSelector,!0)&&i?t.maskTextFn?t.maskTextFn(i,tB(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"),!Yy(A.tagName,s))if(c.attributes[s]=Xy(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||nB(r.target,t.mirror)||(t.movedSet.has(b)&&t.movedMap[cB(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[cB(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 uB(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 lB(n,e){return n.size===0?!1:dB(n,e)}function dB(n,e){var t=se.parentNode(e);return t?n.has(t)?!0:dB(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 hB(n,e){var t=new eL;ei.push(t),t.init(n);var r=new(Xb())(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=pc()),o.push({x:p,y:g,id:i.getId(h),timeOffset:pc()-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 pB(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=Zb(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=$b(),a=eB();(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"],fB=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,F=!1,x=Td(w)||"";x==="radio"||x==="checkbox"?F=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:F,userTriggered:_}:{text:T,isChecked:F});var I=w.name;x==="radio"&&I&&F&&t.querySelectorAll('input[type="radio"][name="'+I+'"]').forEach(function(Q){if(Q!==w){var D=Q.value;h(Q,l?{text:D,isChecked:!F,userTriggered:!1}:{text:D,isChecked:!F})}})}}function h(B,w){var _=fB.get(B);if(!_||_.text!==w.text||_.isChecked!==w.isChecked){fB.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 hc(B[0],B[1],{set:function(){de(d)({target:this,isTrusted:!1})}},!1,g)})))}return de(function(){p.forEach(function(B){return B()})})}function fc(n){var e=[];function t(r,i){if(gc("CSSGroupingRule")&&ee(r.parentRule,CSSGroupingRule)||gc("CSSMediaRule")&&ee(r.parentRule,CSSMediaRule)||gc("CSSSupportsRule")&&ee(r.parentRule,CSSSupportsRule)||gc("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={};mc("CSSGroupingRule")?u.CSSGroupingRule=A.CSSGroupingRule:(mc("CSSMediaRule")&&(u.CSSMediaRule=A.CSSMediaRule),mc("CSSConditionRule")&&(u.CSSConditionRule=A.CSSConditionRule),mc("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(fc(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(fc(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 gB(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:fc(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:fc(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=hB(n,n.doc));var i=AL(n),A=sL(n),s=pB(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=gB(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 gc(n){return typeof window[n]<"u"}function mc(n){return!!(typeof window[n]<"u"&&window[n].prototype&&"insertRule"in window[n].prototype&&"deleteRule"in window[n].prototype)}for(var mB=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 mB(qy)),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 mB(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!==oB.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=hB(fe({},this.bypassOptions,{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push(function(){return A.disconnect()}),this.restoreHandlers.push(pB(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(gB({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&&sB(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),vc=0;vc<$i.length;vc++)wL[$i.charCodeAt(vc)]=vc;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},vB=new Map;function BL(n,e){var t=vB.get(n);return t||(t=new Map,vB.set(n,t)),t.has(e)||t.set(e,[]),t.get(e)}var yB=function(n,e,t){if(!(!n||!(bB(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 yc(n,e,t){if(ee(n,Array))return n.map(function(f){return yc(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:[yc(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:[yc(n.data,e,t),n.width,n.height]}}else if(bB(n,e)||(typeof n>"u"?"undefined":Ae(n))==="object"){var d=n.constructor.name,h=yB(n,e,t);return{rr_type:d,index:h}}return n}var wB=function(n,e,t){return n.map(function(r){return yc(r,e,t)})},bB=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=wB(p,e,h);n(h.canvas,{type:Yi["2D"],property:c,args:v})},0),d.apply(this,p)}});A.push(u)}catch{var l=hc(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 CB(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(yB(y,A,this),"tagName"in this.canvas&&!It(this.canvas,r,i,!0)){var b=wB(g,A,this),B={type:e,property:l,args:b};t(this.canvas,B)}return y}});o.push(d)}catch{var h=hc(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(CB(e.WebGLRenderingContext.prototype,Yi.WebGL,n,t,r,e))),typeof e.WebGL2RenderingContext<"u"){var s;(s=A).push.apply(s,[].concat(CB(e.WebGL2RenderingContext.prototype,Yi.WebGL2,n,t,r,e)))}return function(){A.forEach(function(o){return o()})}}var _B="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",kL=function(n){return Uint8Array.from(atob(n),function(e){return e.charCodeAt(0)})},SB=typeof window<"u"&&window.Blob&&new Blob([kL(_B)],{type:"text/javascript;charset=utf-8"});function EL(n){var e;try{if(e=SB&&(window.URL||window.webkitURL).createObjectURL(SB),!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,"+_B,{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:Vy(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,wc,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=((My=Gh.contentWindow)==null?void 0:My.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,F=n.sampling,x=F===void 0?{}:F,I=n.dataURLOptions,Q=I===void 0?{}:I,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,Fp=ks===void 0?new Set([]):ks,Mc=n.errorHandler;rL(Mc);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=pc(),(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)&&wc(!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 xp=new IL;Vh=new UL({recordCanvas:ge,mutationCb:HC,win:window,blockClass:A,blockSelector:o,mirror:pn,sampling:x.canvas,dataURLOptions:Q});var Lc=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:xp},mirror:pn});wc=function(Te){if(Te===void 0&&(Te=!1),!!N){Ye({type:ue.Meta,data:{href:window.location.href,width:eB(),height:$b()}},Te),ci.reset(),Lc.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){rB(J,pn)&&ui.addIframe(J),iB(J,pn)&&ci.trackLinkElement(J),Nh(J)&&Lc.addShadowRoot(se.shadowRoot(J),document)},onIframeLoad:function(J,We){ui.attachIframe(J,We),Lc.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:Zb(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:Lc,processedNodeManager:xp,canvasManager:Vh,ignoreCSSAttributes:Fp,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 Qp=function(){wc(),Us.push(VC(document)),bc=!0};return document.readyState==="interactive"||document.readyState==="complete"?Qp():(Us.push(Tt("DOMContentLoaded",function(){Ye({type:ue.DomContentLoaded,data:{}}),je==="DOMContentLoaded"&&Qp()})),Us.push(Tt("load",function(){Ye({type:ue.Load,data:{}}),je==="load"&&Qp()},window))),function(){Us.forEach(function(Te){return Te()}),xp.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");wc(n)},_r.mirror=pn;var kB;(function(n){n[n.NotStarted=0]="NotStarted",n[n.Running=1]="Running",n[n.Stopped=2]="Stopped"})(kB||(kB={})),_r.addCustomEvent,_r.freezePage,_r.takeFullSnapshot;var EB=V.setImmediate,Sr,jh,Wh,UB=Object.prototype.toString,FL=typeof EB<"u"?function(n){return EB(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 Bc(n,e){Wh.add(n,e),jh||(jh=FL(Wh.drain))}function TB(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=TB(r))?i.call(r,t.resolve,t.reject):t.resolve(r))}catch(A){t.reject(A)}}function IB(n){var e,t=this;if(!t.triggered){t.triggered=!0,t.def&&(t=t.def);try{(e=TB(n))?Bc(function(){var r=new xB(t);try{e.call(n,function(){IB.apply(r,arguments)},function(){ms.apply(r,arguments)})}catch(i){ms.call(r,i)}}):(t.msg=n,t.state=1,t.chain.length>0&&Bc(qh,t))}catch(r){ms.call(new xB(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&&Bc(qh,e))}function FB(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 xB(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&&Bc(qh,e),i.promise},this.catch=function(t){return this.then(void 0,t)};try{n.call(void 0,function(t){IB.call(e,t)},function(t){ms.call(e,t)})}catch(t){ms.call(e,t)}}var QB=Sr({},"constructor",kr,!1);kr.prototype=QB,Sr(QB,"__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 UB.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;FB(e,n,function(o,a){A[o]=a,++s===i&&t(A)},r)})}),Sr(kr,"race",function(n){var e=this;return UB.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");FB(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,Cc=Array.prototype,RL=Function.prototype,RB=Object.prototype,ti=Cc.slice,ys=RB.toString,_c=RB.hasOwnProperty,at=V.console,Er=V.navigator,me=V.document,Sc=V.opera,PB=V.screen,Wn=Er.userAgent,zh=RL.bind,OB=Cc.forEach,MB=Cc.indexOf,LB=Cc.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)}}},DB=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(OB&&n.forEach===OB)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(_c.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&&_c.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(LB&&n.map===LB)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:MB&&n.indexOf===MB?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(_c.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
122
|
`+s+h.join(`,
|
|
123
123
|
`+s)+`
|
|
124
124
|
`+d+"]":"["+h.join(",")+"]",s=d,u}for(c in f)_c.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
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
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 HB=["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<HB.length;e++)if(n.indexOf(HB[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=VB(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=VB(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 NB=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=NB(n||V.localStorage)},ep=null,OL=function(n,e){return ep!==null&&!e?ep:ep=NB(n||V.sessionStorage)};function KB(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=KB(V.localStorage,"localStorage",ws),m.sessionStorage=KB(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,Sc),$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,Sc),$screen_height:PB.height,$screen_width:PB.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,Sc)}),{$browser_version:m.info.browserVersion(Wn,Er.vendor,Sc)})},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,VB=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,kc=null;typeof JSON<"u"&&(eA=JSON.stringify,kc=JSON.parse),eA=eA||m.JSONEncode,kc=kc||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",GB="mixpanelRecordingEvents",np="mixpanelRecordingRegistry",jL=1,WL=[GB,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){qB(!0,n,e)}function zL(n,e){qB(!1,n,e)}function XL(n,e){return WB(n,e)==="1"}function jB(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=WB(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 WB(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 qB(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=jB(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"),JB=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};JB.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=kc(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 zB=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 JB(n,{storage:e.sharedLockStorage||V.localStorage,timeoutMS:e.sharedLockTimeoutMS})),this.reportError=e.errorReporter||m.bind(zB.error,zB),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 XB=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=XB(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=XB(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 YB=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=YB(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=YB(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"),ZB=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(GB),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()),ZB){var d=new Blob([l],{type:"application/json"}).stream(),h=d.pipeThrough(new ZB("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 Ec="change",ri="click",$B="hashchange",iA="mp_locationchange",eC="popstate",tC="scrollend",op="submit",AD=["clientX","clientY","offsetX","offsetY","pageX","pageY","screenX","screenY","x","y"],nC=["mp-include"],ap=["mp-no-track"],rC=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=iC(n).split(" "),r=0;r<t.length;r++){var i=t[r];i&&(e[i]=!0)}return e}function iC(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&&!oC(n));return n}function AC(n,e,t,r,i,A){var s={$classes:iC(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);Uc(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(aC(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=_&&Uc(g)&&g),lp(w,n,A,s)&&(v=!0),p.push(AC(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);Uc(_)&&(l["$el_attr__"+w]=_)}}),o&&(b=sC(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=sC(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=AC(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 sC(n,e,t,r){var i="";return dp(n,e,t,r)&&n.childNodes&&n.childNodes.length&&m.each(n.childNodes,function(A){aC(A)&&A.textContent&&(i+=m.trim(A.textContent).split(/(\s+)/).filter(Uc).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 oC(n){return n&&n.nodeType===1}function Fn(n,e){return n&&n.tagName&&n.tagName.toLowerCase()===e.toLowerCase()}function aC(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")||!oC(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===Ec:e.type===ri;case"select":case"textarea":return e.type===Ec;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<rC.length;i++)if(s[rC[i]])return!1}var o=cp(n);for(i=0;i<nC.length;i++)if(o[nC[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 Uc(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 cC(){this.clicks=[]}cC.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 uC="autocapture",fD="track_pageview",lC="full-url",gD="url-with-path-and-query-string",mD="url-with-path",vD="allow_element_callback",dC="allow_selectors",hC="allow_url_regexes",pC="block_attrs",fC="block_element_callback",gC="block_selectors",mC="block_url_regexes",vC="capture_extra_attrs",yC="capture_text_content",wC="scroll_capture_all",bC="scroll_depth_percent_checkpoints",Tc="click",hp="input",BC="pageview",CC="rage_click",pp="scroll",fp="submit",ft={};ft[dC]=[],ft[hC]=[],ft[pC]=[],ft[fC]=null,ft[gC]=[],ft[mC]=[],ft[vC]=[],ft[yC]=!1,ft[wC]=!1,ft[bC]=[25,50,75,100],ft[Tc]=!0,ft[hp]=!0,ft[BC]=lC,ft[CC]=!0,ft[pp]=!0,ft[fp]=!0;var Ic={$mp_autocapture:!0},_C="$mp_click",yD="$mp_input_change",SC="$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(uC);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(hC)||[];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(mC)||[];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(uC)?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===_C&&!this.getConfig(Tc)||e===SC&&!this._getRageClickConfig()),r=aD(n,{allowElementCallback:this.getConfig(vD),allowSelectors:this.getConfig(dC),blockAttrs:this.getConfig(pC),blockElementCallback:this.getConfig(fC),blockSelectors:this.getConfig(gC),captureExtraAttrs:this.getConfig(vC),captureTextContent:this.getConfig(yC),capturedForHeatMap:t});r&&(m.extend(r,Ic),this.mp.track(e,r))}},xt.prototype._getRageClickConfig=function(){var n=this.getConfig(CC);return n?n===!0?{}:typeof n=="object"?n:{}:null},xt.prototype.initClickTracking=function(){V.removeEventListener(ri,this.listenerClick),!(!this.getConfig(Tc)&&!this.mp.get_config("record_heatmap_data"))&&(Ft.log("Initializing click tracking"),this.listenerClick=V.addEventListener(ri,(function(n){!this.getConfig(Tc)&&!this.mp.is_recording_heatmap_data()||this.trackDomEvent(n,_C)}).bind(this)))},xt.prototype.initInputTracking=function(){V.removeEventListener(Ec,this.listenerChange),this.getConfig(hp)&&(Ft.log("Initializing input tracking"),this.listenerChange=V.addEventListener(Ec,(function(n){this.getConfig(hp)&&this.trackDomEvent(n,yD)}).bind(this)))},xt.prototype.initPageviewTracking=function(){if(V.removeEventListener(eC,this.listenerPopstate),V.removeEventListener($B,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(Ic)),e&&(n=m.info.currentUrl()),this.listenerPopstate=V.addEventListener(eC,function(){V.dispatchEvent(new Event(iA))}),this.listenerHashchange=V.addEventListener($B,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===lC?A=i!==n:o===gD?A=i.split("#")[0]!==n.split("#")[0]:o===mD&&(A=s),A){var a=this.mp.track_pageview(Ic);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 cC),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,SC)}).bind(this),V.addEventListener(ri,this.listenerRageClick))},xt.prototype.initScrollTracking=function(){V.removeEventListener(tC,this.listenerScroll),this.getConfig(pp)&&(Ft.log("Initializing scroll tracking"),this.lastScrollCheckpoint=0,this.listenerScroll=V.addEventListener(tC,Zh((function(){if(this.getConfig(pp)&&!this.currentUrlBlocked()){var n=this.getConfig(wC),e=(this.getConfig(bC)||[]).slice().sort(function(a,c){return a-c}),t=V.scrollY,r=m.extend({$scroll_top:t},Ic);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)))},DB(xt);var BD=V.fetch,Qt=ni("flags"),Fc="flags",xc="context",gp={};gp[xc]={};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(Fc);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(Fc)},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(Fc);m.isObject(t)||(t={});var r=e&&e.replace?{}:this.getConfig(xc);return t[xc]=m.extend({},r,n),this.setMpConfig(Fc,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(xc))};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"}DB(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 Qc=function(){this.override_event="submit"};m.inherit(Qc,Jn),Qc.prototype.event_handler=function(n,e,t){t.element=e,n.preventDefault()},Qc.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",kC={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,kC),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,kC),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",EC="$people_distinct_id",Rc="__alias",_s="__timers",SD=[mp,vp,yp,wp,bp,Bp,Cp,EC,Rc,_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,UC=function(n,e){throw new Error(n+" not available in this build.")},Et,TC=0,kD=1,ED=function(n){return n},$t="mixpanel",IC="base64",UD="json",Sp="$device:",oA=V.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,FC=!oA&&Wn.indexOf("MSIE")===-1&&Wn.indexOf("Mozilla")===-1,Pc=null;Er.sendBeacon&&(Pc=function(){return Er.sendBeacon.apply(Er,arguments)});var xC={track:"track/",engage:"engage/",groups:"groups/",record:"record/",flags:"flags/"},QC={api_host:"https://api-js.mixpanel.com",api_hosts:{},api_routes:xC,api_extra_query_params:{},api_method:"POST",api_transport:"XHR",api_payload_format:IC,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"},RC=!1,E=function(){},kp=function(n,e,t){var r,i=t===$t?Et:Et[t];if(i&&_p===TC)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||QC.api_host;i.match(/\.mixpanel\.com/)&&(r.api_payload_format=UD)}if(this.set_config(m.extend({},QC,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(),Pc&&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)?UC(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(!RC)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(FC)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=Pc&&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=Pc(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")===IC&&(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,Qc,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(Rc)&&(this.unregister(Rc),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(EC))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(Rc,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(jB,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=xC,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,RC=!0,FC=!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 UC=n,_p=TC,Et=new E,FD(),Et.init(),xD(),Et}function RD(n,e){e()}var Oc=QD(RD);ey({identify:()=>{},track:()=>{},page:()=>{},reset:()=>{}});function PD(n,e={}){const t=e.instanceName||`obi_${Math.random().toString(36).slice(2)}`;Oc.init(n,{debug:e.debug===!0,track_pageview:!0,persistence:"localStorage",...e.config||{}},t);const r=Oc.get_instance?Oc.get_instance(t):Oc;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 Tp(){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 Ip(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(()=>Ip(n));return Nt(()=>{t(Ip(n))},[n]),Nt(()=>{KD();const r=()=>{t(Ip(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 Dc{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){const i=JSON.parse(r);if(i.serialisedAt){const A=new Date(i.serialisedAt);new Date().getTime()-A.getTime()<1e3*10&&Tp().track("page_reload")}}t||(t=new id(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)=>{Tp().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&&Tp().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(){var e;localStorage.setItem("obi-client",((e=this.client)==null?void 0:e.serialise())||"")}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()})();
|
|
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 HB=["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<HB.length;e++)if(n.indexOf(HB[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=VB(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=VB(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 NB=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=NB(n||V.localStorage)},ep=null,OL=function(n,e){return ep!==null&&!e?ep:ep=NB(n||V.sessionStorage)};function KB(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=KB(V.localStorage,"localStorage",ws),m.sessionStorage=KB(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(F){return F.getAttribute(w)==k};break;case"~":T=function(F){return F.getAttribute(w).match(new RegExp("\\b"+k+"\\b"))};break;case"|":T=function(F){return F.getAttribute(w).match(new RegExp("^"+k+"-?"))};break;case"^":T=function(F){return F.getAttribute(w).indexOf(k)===0};break;case"$":T=function(F){return F.getAttribute(w).lastIndexOf(k)==F.getAttribute(w).length-k.length};break;case"*":T=function(F){return F.getAttribute(w).indexOf(k)>-1};break;default:T=function(F){return F.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,Sc),$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,Sc),$screen_height:PB.height,$screen_width:PB.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,Sc)}),{$browser_version:m.info.browserVersion(Wn,Er.vendor,Sc)})},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,VB=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,kc=null;typeof JSON<"u"&&(eA=JSON.stringify,kc=JSON.parse),eA=eA||m.JSONEncode,kc=kc||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",GB="mixpanelRecordingEvents",np="mixpanelRecordingRegistry",jL=1,WL=[GB,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){qB(!0,n,e)}function zL(n,e){qB(!1,n,e)}function XL(n,e){return WB(n,e)==="1"}function jB(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=WB(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 WB(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 qB(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=jB(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"),JB=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};JB.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=kc(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 zB=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 JB(n,{storage:e.sharedLockStorage||V.localStorage,timeoutMS:e.sharedLockTimeoutMS})),this.reportError=e.errorReporter||m.bind(zB.error,zB),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 XB=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=XB(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=XB(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 YB=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=YB(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=YB(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"),ZB=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(GB),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()),ZB){var d=new Blob([l],{type:"application/json"}).stream(),h=d.pipeThrough(new ZB("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 Ec="change",ri="click",$B="hashchange",iA="mp_locationchange",eC="popstate",tC="scrollend",op="submit",AD=["clientX","clientY","offsetX","offsetY","pageX","pageY","screenX","screenY","x","y"],nC=["mp-include"],ap=["mp-no-track"],rC=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=iC(n).split(" "),r=0;r<t.length;r++){var i=t[r];i&&(e[i]=!0)}return e}function iC(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&&!oC(n));return n}function AC(n,e,t,r,i,A){var s={$classes:iC(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);Uc(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(aC(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=_&&Uc(g)&&g),lp(w,n,A,s)&&(v=!0),p.push(AC(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);Uc(_)&&(l["$el_attr__"+w]=_)}}),o&&(b=sC(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=sC(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=AC(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 sC(n,e,t,r){var i="";return dp(n,e,t,r)&&n.childNodes&&n.childNodes.length&&m.each(n.childNodes,function(A){aC(A)&&A.textContent&&(i+=m.trim(A.textContent).split(/(\s+)/).filter(Uc).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 oC(n){return n&&n.nodeType===1}function Fn(n,e){return n&&n.tagName&&n.tagName.toLowerCase()===e.toLowerCase()}function aC(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")||!oC(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===Ec:e.type===ri;case"select":case"textarea":return e.type===Ec;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<rC.length;i++)if(s[rC[i]])return!1}var o=cp(n);for(i=0;i<nC.length;i++)if(o[nC[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 Uc(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 cC(){this.clicks=[]}cC.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 uC="autocapture",fD="track_pageview",lC="full-url",gD="url-with-path-and-query-string",mD="url-with-path",vD="allow_element_callback",dC="allow_selectors",hC="allow_url_regexes",pC="block_attrs",fC="block_element_callback",gC="block_selectors",mC="block_url_regexes",vC="capture_extra_attrs",yC="capture_text_content",wC="scroll_capture_all",bC="scroll_depth_percent_checkpoints",Tc="click",hp="input",BC="pageview",CC="rage_click",pp="scroll",fp="submit",ft={};ft[dC]=[],ft[hC]=[],ft[pC]=[],ft[fC]=null,ft[gC]=[],ft[mC]=[],ft[vC]=[],ft[yC]=!1,ft[wC]=!1,ft[bC]=[25,50,75,100],ft[Tc]=!0,ft[hp]=!0,ft[BC]=lC,ft[CC]=!0,ft[pp]=!0,ft[fp]=!0;var Ic={$mp_autocapture:!0},_C="$mp_click",yD="$mp_input_change",SC="$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(uC);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(hC)||[];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(mC)||[];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(uC)?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===_C&&!this.getConfig(Tc)||e===SC&&!this._getRageClickConfig()),r=aD(n,{allowElementCallback:this.getConfig(vD),allowSelectors:this.getConfig(dC),blockAttrs:this.getConfig(pC),blockElementCallback:this.getConfig(fC),blockSelectors:this.getConfig(gC),captureExtraAttrs:this.getConfig(vC),captureTextContent:this.getConfig(yC),capturedForHeatMap:t});r&&(m.extend(r,Ic),this.mp.track(e,r))}},xt.prototype._getRageClickConfig=function(){var n=this.getConfig(CC);return n?n===!0?{}:typeof n=="object"?n:{}:null},xt.prototype.initClickTracking=function(){V.removeEventListener(ri,this.listenerClick),!(!this.getConfig(Tc)&&!this.mp.get_config("record_heatmap_data"))&&(Ft.log("Initializing click tracking"),this.listenerClick=V.addEventListener(ri,(function(n){!this.getConfig(Tc)&&!this.mp.is_recording_heatmap_data()||this.trackDomEvent(n,_C)}).bind(this)))},xt.prototype.initInputTracking=function(){V.removeEventListener(Ec,this.listenerChange),this.getConfig(hp)&&(Ft.log("Initializing input tracking"),this.listenerChange=V.addEventListener(Ec,(function(n){this.getConfig(hp)&&this.trackDomEvent(n,yD)}).bind(this)))},xt.prototype.initPageviewTracking=function(){if(V.removeEventListener(eC,this.listenerPopstate),V.removeEventListener($B,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(Ic)),e&&(n=m.info.currentUrl()),this.listenerPopstate=V.addEventListener(eC,function(){V.dispatchEvent(new Event(iA))}),this.listenerHashchange=V.addEventListener($B,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===lC?A=i!==n:o===gD?A=i.split("#")[0]!==n.split("#")[0]:o===mD&&(A=s),A){var a=this.mp.track_pageview(Ic);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 cC),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,SC)}).bind(this),V.addEventListener(ri,this.listenerRageClick))},xt.prototype.initScrollTracking=function(){V.removeEventListener(tC,this.listenerScroll),this.getConfig(pp)&&(Ft.log("Initializing scroll tracking"),this.lastScrollCheckpoint=0,this.listenerScroll=V.addEventListener(tC,Zh((function(){if(this.getConfig(pp)&&!this.currentUrlBlocked()){var n=this.getConfig(wC),e=(this.getConfig(bC)||[]).slice().sort(function(a,c){return a-c}),t=V.scrollY,r=m.extend({$scroll_top:t},Ic);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)))},DB(xt);var BD=V.fetch,Qt=ni("flags"),Fc="flags",xc="context",gp={};gp[xc]={};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(Fc);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(Fc)},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(Fc);m.isObject(t)||(t={});var r=e&&e.replace?{}:this.getConfig(xc);return t[xc]=m.extend({},r,n),this.setMpConfig(Fc,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(xc))};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"}DB(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 Qc=function(){this.override_event="submit"};m.inherit(Qc,Jn),Qc.prototype.event_handler=function(n,e,t){t.element=e,n.preventDefault()},Qc.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",kC={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,kC),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,kC),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",EC="$people_distinct_id",Rc="__alias",_s="__timers",SD=[mp,vp,yp,wp,bp,Bp,Cp,EC,Rc,_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,UC=function(n,e){throw new Error(n+" not available in this build.")},Et,TC=0,kD=1,ED=function(n){return n},$t="mixpanel",IC="base64",UD="json",Sp="$device:",oA=V.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,FC=!oA&&Wn.indexOf("MSIE")===-1&&Wn.indexOf("Mozilla")===-1,Pc=null;Er.sendBeacon&&(Pc=function(){return Er.sendBeacon.apply(Er,arguments)});var xC={track:"track/",engage:"engage/",groups:"groups/",record:"record/",flags:"flags/"},QC={api_host:"https://api-js.mixpanel.com",api_hosts:{},api_routes:xC,api_extra_query_params:{},api_method:"POST",api_transport:"XHR",api_payload_format:IC,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"},RC=!1,E=function(){},kp=function(n,e,t){var r,i=t===$t?Et:Et[t];if(i&&_p===TC)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||QC.api_host;i.match(/\.mixpanel\.com/)&&(r.api_payload_format=UD)}if(this.set_config(m.extend({},QC,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(),Pc&&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)?UC(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(!RC)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(FC)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=Pc&&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=Pc(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")===IC&&(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,Qc,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(Rc)&&(this.unregister(Rc),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(EC))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(Rc,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(jB,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=xC,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,RC=!0,FC=!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 UC=n,_p=TC,Et=new E,FD(),Et.init(),xD(),Et}function RD(n,e){e()}var Oc=QD(RD);ey({identify:()=>{},track:()=>{},page:()=>{},reset:()=>{}});function PD(n,e={}){const t=e.instanceName||`obi_${Math.random().toString(36).slice(2)}`;Oc.init(n,{debug:e.debug===!0,track_pageview:!0,persistence:"localStorage",...e.config||{}},t);const r=Oc.get_instance?Oc.get_instance(t):Oc[t];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 Tp(){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 Ip(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,F;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 I;(I=o.client)!=null&&I.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,I,Q,D,X,N;return{name:(x=o.client.selectedPlan)==null?void 0:x.name,description:(I=o.client.selectedPlan)==null?void 0:I.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:((F=o.client.product)==null?void 0:F.agent_name)||"Obi",onCourseSelect:x=>{const I=o.client.plans.find(Q=>Q.uuid===x.id)||null;I&&(o.client.selectPlan(I),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,I;(I=(x=o.client.session)==null?void 0:x.pause)==null||I.call(x)},onUnpause:()=>{var x,I;(I=(x=o.client.session)==null?void 0:x.unpause)==null||I.call(x)},onMessagingChange:x=>{var I,Q,D,X;x?(Q=(I=o.client.session)==null?void 0:I.muteMicrophone)==null||Q.call(I):(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=>{var I,Q;x==="user-initiated"&&(((I=o.client.session)==null?void 0:I.state)==="mic-share"?(Q=o.client.session)==null||Q.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(()=>Ip(n));return Nt(()=>{t(Ip(n))},[n]),Nt(()=>{KD();const r=()=>{t(Ip(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 Dc{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){const i=JSON.parse(r);if(i.serialisedAt){const A=new Date(i.serialisedAt);new Date().getTime()-A.getTime()<1e3*10&&Tp().track("page_reload")}}t||(t=new id(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)=>{Tp().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&&Tp().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(){var e;localStorage.setItem("obi-client",((e=this.client)==null?void 0:e.serialise())||"")}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()})();
|