@avaturn-live/web-sdk 0.0.7

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/main.cjs ADDED
@@ -0,0 +1,44 @@
1
+ "use strict";var Ko=Object.defineProperty;var Xo=(t,e,n)=>e in t?Ko(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var je=(t,e,n)=>Xo(t,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function Gr(t,e){if(t==null)return{};var n,r,i=function(a,c){if(a==null)return{};var l,p,h={},f=Object.keys(a);for(p=0;p<f.length;p++)l=f[p],c.indexOf(l)>=0||(h[l]=a[l]);return h}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)n=s[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function he(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function U(t){return U=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},U(t)}function Ns(t){var e=function(n,r){if(U(n)!=="object"||n===null)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var s=i.call(n,r||"default");if(U(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(n)}(t,"string");return U(e)==="symbol"?e:String(e)}function zr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ns(r.key),r)}}function pe(t,e,n){return e&&zr(t.prototype,e),n&&zr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function we(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function wt(t,e){return wt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},wt(t,e)}function ln(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&wt(t,e)}function un(t,e){if(e&&(U(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return we(t)}function ue(t){return ue=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ue(t)}function Oe(t,e,n){return(e=Ns(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Yr(t,e,n,r,i,s,a){try{var c=t[s](a),l=c.value}catch(p){return void n(p)}c.done?e(l):Promise.resolve(l).then(r,i)}function O(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var s=t.apply(e,n);function a(l){Yr(s,r,i,a,c,"next",l)}function c(l){Yr(s,r,i,a,c,"throw",l)}a(void 0)})}}function Hr(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function $e(t,e){return function(n){if(Array.isArray(n))return n}(t)||function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var s,a,c,l,p=[],h=!0,f=!1;try{if(c=(i=i.call(n)).next,r===0){if(Object(i)!==i)return;h=!1}else for(;!(h=(s=c.call(i)).done)&&(p.push(s.value),p.length!==r);h=!0);}catch(_){f=!0,a=_}finally{try{if(!h&&i.return!=null&&(l=i.return(),Object(l)!==l))return}finally{if(f)throw a}}return p}}(t,e)||function(n,r){if(n){if(typeof n=="string")return Hr(n,r);var i=Object.prototype.toString.call(n).slice(8,-1);return i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set"?Array.from(n):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Hr(n,r):void 0}}(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}var js,ke={},Zo={get exports(){return ke},set exports(t){ke=t}},Ze=typeof Reflect=="object"?Reflect:null,Wr=Ze&&typeof Ze.apply=="function"?Ze.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};js=Ze&&typeof Ze.ownKeys=="function"?Ze.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var Qr=Number.isNaN||function(t){return t!=t};function j(){j.init.call(this)}Zo.exports=j,ke.once=function(t,e){return new Promise(function(n,r){function i(a){t.removeListener(e,s),r(a)}function s(){typeof t.removeListener=="function"&&t.removeListener("error",i),n([].slice.call(arguments))}ni(t,e,s,{once:!0}),e!=="error"&&function(a,c,l){typeof a.on=="function"&&ni(a,"error",c,l)}(t,i,{once:!0})})},j.EventEmitter=j,j.prototype._events=void 0,j.prototype._eventsCount=0,j.prototype._maxListeners=void 0;var Kr=10;function Yt(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function Is(t){return t._maxListeners===void 0?j.defaultMaxListeners:t._maxListeners}function Xr(t,e,n,r){var i,s,a,c;if(Yt(n),(s=t._events)===void 0?(s=t._events=Object.create(null),t._eventsCount=0):(s.newListener!==void 0&&(t.emit("newListener",e,n.listener?n.listener:n),s=t._events),a=s[e]),a===void 0)a=s[e]=n,++t._eventsCount;else if(typeof a=="function"?a=s[e]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(i=Is(t))>0&&a.length>i&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=a.length,c=l,console&&console.warn&&console.warn(c)}return t}function ea(){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 Zr(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=ea.bind(r);return i.listener=n,r.wrapFn=i,i}function ei(t,e,n){var r=t._events;if(r===void 0)return[];var i=r[e];return i===void 0?[]:typeof i=="function"?n?[i.listener||i]:[i]:n?function(s){for(var a=new Array(s.length),c=0;c<a.length;++c)a[c]=s[c].listener||s[c];return a}(i):Bs(i,i.length)}function ti(t){var e=this._events;if(e!==void 0){var n=e[t];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}function Bs(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}function ni(t,e,n,r){if(typeof t.on=="function")r.once?t.once(e,n):t.on(e,n);else{if(typeof t.addEventListener!="function")throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,function i(s){r.once&&t.removeEventListener(e,i),n(s)})}}Object.defineProperty(j,"defaultMaxListeners",{enumerable:!0,get:function(){return Kr},set:function(t){if(typeof t!="number"||t<0||Qr(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Kr=t}}),j.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},j.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||Qr(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},j.prototype.getMaxListeners=function(){return Is(this)},j.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var r=t==="error",i=this._events;if(i!==void 0)r=r&&i.error===void 0;else if(!r)return!1;if(r){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=i[t];if(c===void 0)return!1;if(typeof c=="function")Wr(c,this,e);else{var l=c.length,p=Bs(c,l);for(n=0;n<l;++n)Wr(p[n],this,e)}return!0},j.prototype.addListener=function(t,e){return Xr(this,t,e,!1)},j.prototype.on=j.prototype.addListener,j.prototype.prependListener=function(t,e){return Xr(this,t,e,!0)},j.prototype.once=function(t,e){return Yt(e),this.on(t,Zr(this,t,e)),this},j.prototype.prependOnceListener=function(t,e){return Yt(e),this.prependListener(t,Zr(this,t,e)),this},j.prototype.removeListener=function(t,e){var n,r,i,s,a;if(Yt(e),(r=this._events)===void 0)return this;if((n=r[t])===void 0)return this;if(n===e||n.listener===e)--this._eventsCount==0?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if(typeof n!="function"){for(i=-1,s=n.length-1;s>=0;s--)if(n[s]===e||n[s].listener===e){a=n[s].listener,i=s;break}if(i<0)return this;i===0?n.shift():function(c,l){for(;l+1<c.length;l++)c[l]=c[l+1];c.pop()}(n,i),n.length===1&&(r[t]=n[0]),r.removeListener!==void 0&&this.emit("removeListener",t,a||e)}return this},j.prototype.off=j.prototype.removeListener,j.prototype.removeAllListeners=function(t){var e,n,r;if((n=this._events)===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[t]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete n[t]),this;if(arguments.length===0){var i,s=Object.keys(n);for(r=0;r<s.length;++r)(i=s[r])!=="removeListener"&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(e=n[t])=="function")this.removeListener(t,e);else if(e!==void 0)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},j.prototype.listeners=function(t){return ei(this,t,!0)},j.prototype.rawListeners=function(t){return ei(this,t,!1)},j.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):ti.call(t,e)},j.prototype.listenerCount=ti,j.prototype.eventNames=function(){return this._eventsCount>0?js(this._events):[]};var ri=Object.prototype.hasOwnProperty;function ii(t,e,n){for(n of t.keys())if(K(n,e))return n}function K(t,e){var n,r,i;if(t===e)return!0;if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return t.toString()===e.toString();if(n===Array){if((r=t.length)===e.length)for(;r--&&K(t[r],e[r]););return r===-1}if(n===Set){if(t.size!==e.size)return!1;for(r of t)if((i=r)&&typeof i=="object"&&!(i=ii(e,i))||!e.has(i))return!1;return!0}if(n===Map){if(t.size!==e.size)return!1;for(r of t)if((i=r[0])&&typeof i=="object"&&!(i=ii(e,i))||!K(r[1],e.get(i)))return!1;return!0}if(n===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(n===DataView){if((r=t.byteLength)===e.byteLength)for(;r--&&t.getInt8(r)===e.getInt8(r););return r===-1}if(ArrayBuffer.isView(t)){if((r=t.byteLength)===e.byteLength)for(;r--&&t[r]===e[r];);return r===-1}if(!n||typeof t=="object"){for(n in r=0,t)if(ri.call(t,n)&&++r&&!ri.call(e,n)||!(n in e)||!K(t[n],e[n]))return!1;return Object.keys(e).length===r}}return t!=t&&e!=e}const ta={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},Fs={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},V={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},W={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},Me={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class S{static getFirstMatch(e,n){const r=n.match(e);return r&&r.length>0&&r[1]||""}static getSecondMatch(e,n){const r=n.match(e);return r&&r.length>1&&r[2]||""}static matchAndReturnConst(e,n,r){if(e.test(n))return r}static getWindowsVersionName(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(e){const n=e.split(".").splice(0,2).map(r=>parseInt(r,10)||0);if(n.push(0),n[0]===10)switch(n[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}}static getAndroidVersionName(e){const n=e.split(".").splice(0,2).map(r=>parseInt(r,10)||0);if(n.push(0),!(n[0]===1&&n[1]<5))return n[0]===1&&n[1]<6?"Cupcake":n[0]===1&&n[1]>=6?"Donut":n[0]===2&&n[1]<2?"Eclair":n[0]===2&&n[1]===2?"Froyo":n[0]===2&&n[1]>2?"Gingerbread":n[0]===3?"Honeycomb":n[0]===4&&n[1]<1?"Ice Cream Sandwich":n[0]===4&&n[1]<4?"Jelly Bean":n[0]===4&&n[1]>=4?"KitKat":n[0]===5?"Lollipop":n[0]===6?"Marshmallow":n[0]===7?"Nougat":n[0]===8?"Oreo":n[0]===9?"Pie":void 0}static getVersionPrecision(e){return e.split(".").length}static compareVersions(e,n,r=!1){const i=S.getVersionPrecision(e),s=S.getVersionPrecision(n);let a=Math.max(i,s),c=0;const l=S.map([e,n],p=>{const h=a-S.getVersionPrecision(p),f=p+new Array(h+1).join(".0");return S.map(f.split("."),_=>new Array(20-_.length).join("0")+_).reverse()});for(r&&(c=a-Math.min(i,s)),a-=1;a>=c;){if(l[0][a]>l[1][a])return 1;if(l[0][a]===l[1][a]){if(a===c)return 0;a-=1}else if(l[0][a]<l[1][a])return-1}}static map(e,n){const r=[];let i;if(Array.prototype.map)return Array.prototype.map.call(e,n);for(i=0;i<e.length;i+=1)r.push(n(e[i]));return r}static find(e,n){let r,i;if(Array.prototype.find)return Array.prototype.find.call(e,n);for(r=0,i=e.length;r<i;r+=1){const s=e[r];if(n(s,r))return s}}static assign(e,...n){const r=e;let i,s;if(Object.assign)return Object.assign(e,...n);for(i=0,s=n.length;i<s;i+=1){const a=n[i];typeof a=="object"&&a!==null&&Object.keys(a).forEach(c=>{r[c]=a[c]})}return e}static getBrowserAlias(e){return ta[e]}static getBrowserTypeByAlias(e){return Fs[e]||""}}const I=/version\/(\d+(\.?_?\d+)+)/i,na=[{test:[/googlebot/i],describe(t){const e={name:"Googlebot"},n=S.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/opera/i],describe(t){const e={name:"Opera"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/opr\/|opios/i],describe(t){const e={name:"Opera"},n=S.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/SamsungBrowser/i],describe(t){const e={name:"Samsung Internet for Android"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/Whale/i],describe(t){const e={name:"NAVER Whale Browser"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/MZBrowser/i],describe(t){const e={name:"MZ Browser"},n=S.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/focus/i],describe(t){const e={name:"Focus"},n=S.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/swing/i],describe(t){const e={name:"Swing"},n=S.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/coast/i],describe(t){const e={name:"Opera Coast"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(t){const e={name:"Opera Touch"},n=S.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/yabrowser/i],describe(t){const e={name:"Yandex Browser"},n=S.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/ucbrowser/i],describe(t){const e={name:"UC Browser"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/Maxthon|mxios/i],describe(t){const e={name:"Maxthon"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/epiphany/i],describe(t){const e={name:"Epiphany"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/puffin/i],describe(t){const e={name:"Puffin"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/sleipnir/i],describe(t){const e={name:"Sleipnir"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/k-meleon/i],describe(t){const e={name:"K-Meleon"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/micromessenger/i],describe(t){const e={name:"WeChat"},n=S.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/qqbrowser/i],describe(t){const e={name:/qqbrowserlite/i.test(t)?"QQ Browser Lite":"QQ Browser"},n=S.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/msie|trident/i],describe(t){const e={name:"Internet Explorer"},n=S.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/\sedg\//i],describe(t){const e={name:"Microsoft Edge"},n=S.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/edg([ea]|ios)/i],describe(t){const e={name:"Microsoft Edge"},n=S.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/vivaldi/i],describe(t){const e={name:"Vivaldi"},n=S.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/seamonkey/i],describe(t){const e={name:"SeaMonkey"},n=S.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/sailfish/i],describe(t){const e={name:"Sailfish"},n=S.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,t);return n&&(e.version=n),e}},{test:[/silk/i],describe(t){const e={name:"Amazon Silk"},n=S.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/phantom/i],describe(t){const e={name:"PhantomJS"},n=S.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/slimerjs/i],describe(t){const e={name:"SlimerJS"},n=S.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(t){const e={name:"BlackBerry"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/(web|hpw)[o0]s/i],describe(t){const e={name:"WebOS Browser"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/bada/i],describe(t){const e={name:"Bada"},n=S.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/tizen/i],describe(t){const e={name:"Tizen"},n=S.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/qupzilla/i],describe(t){const e={name:"QupZilla"},n=S.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/firefox|iceweasel|fxios/i],describe(t){const e={name:"Firefox"},n=S.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/electron/i],describe(t){const e={name:"Electron"},n=S.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/MiuiBrowser/i],describe(t){const e={name:"Miui"},n=S.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/chromium/i],describe(t){const e={name:"Chromium"},n=S.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/chrome|crios|crmo/i],describe(t){const e={name:"Chrome"},n=S.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/GSA/i],describe(t){const e={name:"Google Search"},n=S.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test(t){const e=!t.test(/like android/i),n=t.test(/android/i);return e&&n},describe(t){const e={name:"Android Browser"},n=S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/playstation 4/i],describe(t){const e={name:"PlayStation 4"},n=S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/safari|applewebkit/i],describe(t){const e={name:"Safari"},n=S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/.*/i],describe(t){const e=t.search("\\(")!==-1?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:S.getFirstMatch(e,t),version:S.getSecondMatch(e,t)}}}];var ra=[{test:[/Roku\/DVP/],describe(t){const e=S.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,t);return{name:W.Roku,version:e}}},{test:[/windows phone/i],describe(t){const e=S.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,t);return{name:W.WindowsPhone,version:e}}},{test:[/windows /i],describe(t){const e=S.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,t),n=S.getWindowsVersionName(e);return{name:W.Windows,version:e,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(t){const e={name:W.iOS},n=S.getSecondMatch(/(Version\/)(\d[\d.]+)/,t);return n&&(e.version=n),e}},{test:[/macintosh/i],describe(t){const e=S.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,t).replace(/[_\s]/g,"."),n=S.getMacOSVersionName(e),r={name:W.MacOS,version:e};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe(t){const e=S.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,t).replace(/[_\s]/g,".");return{name:W.iOS,version:e}}},{test(t){const e=!t.test(/like android/i),n=t.test(/android/i);return e&&n},describe(t){const e=S.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,t),n=S.getAndroidVersionName(e),r={name:W.Android,version:e};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe(t){const e=S.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,t),n={name:W.WebOS};return e&&e.length&&(n.version=e),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(t){const e=S.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,t)||S.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,t)||S.getFirstMatch(/\bbb(\d+)/i,t);return{name:W.BlackBerry,version:e}}},{test:[/bada/i],describe(t){const e=S.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,t);return{name:W.Bada,version:e}}},{test:[/tizen/i],describe(t){const e=S.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,t);return{name:W.Tizen,version:e}}},{test:[/linux/i],describe:()=>({name:W.Linux})},{test:[/CrOS/],describe:()=>({name:W.ChromeOS})},{test:[/PlayStation 4/],describe(t){const e=S.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,t);return{name:W.PlayStation4,version:e}}}],ia=[{test:[/googlebot/i],describe:()=>({type:"bot",vendor:"Google"})},{test:[/huawei/i],describe(t){const e=S.getFirstMatch(/(can-l01)/i,t)&&"Nova",n={type:V.mobile,vendor:"Huawei"};return e&&(n.model=e),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:()=>({type:V.tablet,vendor:"Nexus"})},{test:[/ipad/i],describe:()=>({type:V.tablet,vendor:"Apple",model:"iPad"})},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:()=>({type:V.tablet,vendor:"Apple",model:"iPad"})},{test:[/kftt build/i],describe:()=>({type:V.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"})},{test:[/silk/i],describe:()=>({type:V.tablet,vendor:"Amazon"})},{test:[/tablet(?! pc)/i],describe:()=>({type:V.tablet})},{test(t){const e=t.test(/ipod|iphone/i),n=t.test(/like (ipod|iphone)/i);return e&&!n},describe(t){const e=S.getFirstMatch(/(ipod|iphone)/i,t);return{type:V.mobile,vendor:"Apple",model:e}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:()=>({type:V.mobile,vendor:"Nexus"})},{test:[/[^-]mobi/i],describe:()=>({type:V.mobile})},{test:t=>t.getBrowserName(!0)==="blackberry",describe:()=>({type:V.mobile,vendor:"BlackBerry"})},{test:t=>t.getBrowserName(!0)==="bada",describe:()=>({type:V.mobile})},{test:t=>t.getBrowserName()==="windows phone",describe:()=>({type:V.mobile,vendor:"Microsoft"})},{test(t){const e=Number(String(t.getOSVersion()).split(".")[0]);return t.getOSName(!0)==="android"&&e>=3},describe:()=>({type:V.tablet})},{test:t=>t.getOSName(!0)==="android",describe:()=>({type:V.mobile})},{test:t=>t.getOSName(!0)==="macos",describe:()=>({type:V.desktop,vendor:"Apple"})},{test:t=>t.getOSName(!0)==="windows",describe:()=>({type:V.desktop})},{test:t=>t.getOSName(!0)==="linux",describe:()=>({type:V.desktop})},{test:t=>t.getOSName(!0)==="playstation 4",describe:()=>({type:V.tv})},{test:t=>t.getOSName(!0)==="roku",describe:()=>({type:V.tv})}],sa=[{test:t=>t.getBrowserName(!0)==="microsoft edge",describe(t){if(/\sedg\//i.test(t))return{name:Me.Blink};const e=S.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,t);return{name:Me.EdgeHTML,version:e}}},{test:[/trident/i],describe(t){const e={name:Me.Trident},n=S.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:t=>t.test(/presto/i),describe(t){const e={name:Me.Presto},n=S.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test(t){const e=t.test(/gecko/i),n=t.test(/like gecko/i);return e&&!n},describe(t){const e={name:Me.Gecko},n=S.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/(apple)?webkit\/537\.36/i],describe:()=>({name:Me.Blink})},{test:[/(apple)?webkit/i],describe(t){const e={name:Me.WebKit},n=S.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}}];class si{constructor(e,n=!1){if(e==null||e==="")throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},n!==!0&&this.parse()}getUA(){return this._ua}test(e){return e.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const e=S.find(na,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.browser=e.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const e=S.find(ra,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.os=e.describe(this.getUA())),this.parsedResult.os}getOSName(e){const{name:n}=this.getOS();return e?String(n).toLowerCase()||"":n||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(e=!1){const{type:n}=this.getPlatform();return e?String(n).toLowerCase()||"":n||""}parsePlatform(){this.parsedResult.platform={};const e=S.find(ia,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.platform=e.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const e=S.find(sa,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.engine=e.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return S.assign({},this.parsedResult)}satisfies(e){const n={};let r=0;const i={};let s=0;if(Object.keys(e).forEach(a=>{const c=e[a];typeof c=="string"?(i[a]=c,s+=1):typeof c=="object"&&(n[a]=c,r+=1)}),r>0){const a=Object.keys(n),c=S.find(a,p=>this.isOS(p));if(c){const p=this.satisfies(n[c]);if(p!==void 0)return p}const l=S.find(a,p=>this.isPlatform(p));if(l){const p=this.satisfies(n[l]);if(p!==void 0)return p}}if(s>0){const a=Object.keys(i),c=S.find(a,l=>this.isBrowser(l,!0));if(c!==void 0)return this.compareVersion(i[c])}}isBrowser(e,n=!1){const r=this.getBrowserName().toLowerCase();let i=e.toLowerCase();const s=S.getBrowserTypeByAlias(i);return n&&s&&(i=s.toLowerCase()),i===r}compareVersion(e){let n=[0],r=e,i=!1;const s=this.getBrowserVersion();if(typeof s=="string")return e[0]===">"||e[0]==="<"?(r=e.substr(1),e[1]==="="?(i=!0,r=e.substr(2)):n=[],e[0]===">"?n.push(1):n.push(-1)):e[0]==="="?r=e.substr(1):e[0]==="~"&&(i=!0,r=e.substr(1)),n.indexOf(S.compareVersions(s,r,i))>-1}isOS(e){return this.getOSName(!0)===String(e).toLowerCase()}isPlatform(e){return this.getPlatformType(!0)===String(e).toLowerCase()}isEngine(e){return this.getEngineName(!0)===String(e).toLowerCase()}is(e,n=!1){return this.isBrowser(e,n)||this.isOS(e)||this.isPlatform(e)}some(e=[]){return e.some(n=>this.is(n))}}/*!
3
+ * Bowser - a browser detector
4
+ * https://github.com/lancedikson/bowser
5
+ * MIT License | (c) Dustin Diaz 2012-2015
6
+ * MIT License | (c) Denis Demchenko 2015-2019
7
+ */class oa{static getParser(e,n=!1){if(typeof e!="string")throw new Error("UserAgent should be a string");return new si(e,n)}static parse(e){return new si(e).getResult()}static get BROWSER_MAP(){return Fs}static get ENGINE_MAP(){return Me}static get OS_MAP(){return W}static get PLATFORMS_MAP(){return V}}function dn(){return Date.now()+Math.random().toString()}function pt(){throw new Error("Method must be implemented in subclass")}function Us(t,e){return e!=null&&e.proxyUrl?e.proxyUrl+(e.proxyUrl.slice(-1)==="/"?"":"/")+t.substring(8):t}function Xt(t){return t!=null&&t.callObjectBundleUrlOverride?t.callObjectBundleUrlOverride:Us("https://c.daily.co/call-machine/versioned/".concat("0.68.0","/static/call-machine-object-bundle.js"),t)}function St(t){try{new URL(t)}catch{return!1}return!0}const qs=Object.prototype.toString;function Js(t){switch(qs.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return ze(t,Error)}}function lt(t,e){return qs.call(t)===`[object ${e}]`}function fr(t){return lt(t,"ErrorEvent")}function oi(t){return lt(t,"DOMError")}function Ge(t){return lt(t,"String")}function Vs(t){return t===null||typeof t!="object"&&typeof t!="function"}function ot(t){return lt(t,"Object")}function Zt(t){return typeof Event<"u"&&ze(t,Event)}function mr(t){return!!(t&&t.then&&typeof t.then=="function")}function ze(t,e){try{return t instanceof e}catch{return!1}}function et(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function ai(t,e){if(!Array.isArray(t))return"";const n=[];for(let r=0;r<t.length;r++){const i=t[r];try{n.push(String(i))}catch{n.push("[value cannot be serialized]")}}return n.join(e)}function aa(t,e,n=!1){return!!Ge(t)&&(lt(e,"RegExp")?e.test(t):!!Ge(e)&&(n?t===e:t.includes(e)))}function Dt(t,e=[],n=!1){return e.some(r=>aa(t,r,n))}function ca(t,e,n=250,r,i,s,a){if(!(s.exception&&s.exception.values&&a&&ze(a.originalException,Error)))return;const c=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;var l,p;c&&(s.exception.values=(l=Fn(t,e,i,a.originalException,r,s.exception.values,c,0),p=n,l.map(h=>(h.value&&(h.value=et(h.value,p)),h))))}function Fn(t,e,n,r,i,s,a,c){if(s.length>=n+1)return s;let l=[...s];if(ze(r[i],Error)){ci(a,c);const p=t(e,r[i]),h=l.length;li(p,i,h,c),l=Fn(t,e,n,r[i],i,[p,...l],p,h)}return Array.isArray(r.errors)&&r.errors.forEach((p,h)=>{if(ze(p,Error)){ci(a,c);const f=t(e,p),_=l.length;li(f,`errors[${h}]`,_,c),l=Fn(t,e,n,p,i,[f,...l],f,_)}}),l}function ci(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,is_exception_group:!0,exception_id:e}}function li(t,e,n,r){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,type:"chained",source:e,exception_id:n,parent_id:r}}function Lt(t){return t&&t.Math==Math?t:void 0}const re=typeof globalThis=="object"&&Lt(globalThis)||typeof window=="object"&&Lt(window)||typeof self=="object"&&Lt(self)||typeof global=="object"&&Lt(global)||function(){return this}()||{};function Pt(){return re}function gr(t,e,n){const r=n||re,i=r.__SENTRY__=r.__SENTRY__||{};return i[t]||(i[t]=e())}const la=Pt(),ua=80;function Un(t,e={}){try{let n=t;const r=5,i=[];let s=0,a=0;const c=" > ",l=c.length;let p;const h=Array.isArray(e)?e:e.keyAttrs,f=!Array.isArray(e)&&e.maxStringLength||ua;for(;n&&s++<r&&(p=da(n,h),!(p==="html"||s>1&&a+i.length*l+p.length>=f));)i.push(p),a+=p.length,n=n.parentNode;return i.reverse().join(c)}catch{return"<unknown>"}}function da(t,e){const n=t,r=[];let i,s,a,c,l;if(!n||!n.tagName)return"";r.push(n.tagName.toLowerCase());const p=e&&e.length?e.filter(f=>n.getAttribute(f)).map(f=>[f,n.getAttribute(f)]):null;if(p&&p.length)p.forEach(f=>{r.push(`[${f[0]}="${f[1]}"]`)});else if(n.id&&r.push(`#${n.id}`),i=n.className,i&&Ge(i))for(s=i.split(/\s+/),l=0;l<s.length;l++)r.push(`.${s[l]}`);const h=["aria-label","type","name","title","alt"];for(l=0;l<h.length;l++)a=h[l],c=n.getAttribute(a),c&&r.push(`[${a}="${c}"]`);return r.join("")}const en=["debug","info","warn","error","log","assert","trace"];function $s(t){if(!("console"in re))return t();const e=re.console,n={};en.forEach(r=>{const i=e[r]&&e[r].__sentry_original__;r in e&&i&&(n[r]=e[r],e[r]=i)});try{return t()}finally{Object.keys(n).forEach(r=>{e[r]=n[r]})}}function ui(){let t=!1;const e={enable:()=>{t=!0},disable:()=>{t=!1}};return typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?en.forEach(n=>{e[n]=(...r)=>{t&&$s(()=>{re.console[n](`Sentry Logger [${n}]:`,...r)})}}):en.forEach(n=>{e[n]=()=>{}}),e}let R;R=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?gr("logger",ui):ui();const ha=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function tn(t,e=!1){const{host:n,path:r,pass:i,port:s,projectId:a,protocol:c,publicKey:l}=t;return`${c}://${l}${e&&i?`:${i}`:""}@${n}${s?`:${s}`:""}/${r&&`${r}/`}${a}`}function di(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function pa(t){const e=typeof t=="string"?function(n){const r=ha.exec(n);if(!r)return void console.error(`Invalid Sentry Dsn: ${n}`);const[i,s,a="",c,l="",p]=r.slice(1);let h="",f=p;const _=f.split("/");if(_.length>1&&(h=_.slice(0,-1).join("/"),f=_.pop()),f){const k=f.match(/^\d+/);k&&(f=k[0])}return di({host:c,pass:a,path:h,projectId:f,port:l,protocol:i,publicKey:s})}(t):di(t);if(e&&function(n){if(typeof __SENTRY_DEBUG__<"u"&&!__SENTRY_DEBUG__)return!0;const{port:r,projectId:i,protocol:s}=n;return!(["protocol","publicKey","host","projectId"].find(a=>!n[a]&&(R.error(`Invalid Sentry Dsn: ${a} missing`),!0))||(i.match(/^\d+$/)?function(a){return a==="http"||a==="https"}(s)?r&&isNaN(parseInt(r,10))&&(R.error(`Invalid Sentry Dsn: Invalid port ${r}`),1):(R.error(`Invalid Sentry Dsn: Invalid protocol ${s}`),1):(R.error(`Invalid Sentry Dsn: Invalid projectId ${i}`),1)))}(e))return e}class ce extends Error{constructor(e,n="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=n}}function z(t,e,n){if(!(e in t))return;const r=t[e],i=n(r);if(typeof i=="function")try{Gs(i,r)}catch{}t[e]=i}function vr(t,e,n){Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}function Gs(t,e){const n=e.prototype||{};t.prototype=e.prototype=n,vr(t,"__sentry_original__",e)}function yr(t){return t.__sentry_original__}function zs(t){if(Js(t))return{message:t.message,name:t.name,stack:t.stack,...pi(t)};if(Zt(t)){const e={type:t.type,target:hi(t.target),currentTarget:hi(t.currentTarget),...pi(t)};return typeof CustomEvent<"u"&&ze(t,CustomEvent)&&(e.detail=t.detail),e}return t}function hi(t){try{return e=t,typeof Element<"u"&&ze(e,Element)?Un(t):Object.prototype.toString.call(t)}catch{return"<unknown>"}var e}function pi(t){if(typeof t=="object"&&t!==null){const e={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}return{}}function hn(t){return qn(t,new Map)}function qn(t,e){if(ot(t)){const n=e.get(t);if(n!==void 0)return n;const r={};e.set(t,r);for(const i of Object.keys(t))t[i]!==void 0&&(r[i]=qn(t[i],e));return r}if(Array.isArray(t)){const n=e.get(t);if(n!==void 0)return n;const r=[];return e.set(t,r),t.forEach(i=>{r.push(qn(i,e))}),r}return t}const fi="<anonymous>";function De(t){try{return t&&typeof t=="function"&&t.name||fi}catch{return fi}}const wn=Pt();function Jn(t){return t&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function fa(){if(!function(){if(!("fetch"in wn))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}())return!1;if(Jn(wn.fetch))return!0;let t=!1;const e=wn.document;if(e&&typeof e.createElement=="function")try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(t=Jn(n.contentWindow.fetch)),e.head.removeChild(n)}catch(n){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return t}const Nt=Pt(),J=Pt(),vt="__sentry_xhr_v2__",_t={},mi={};function ma(t){if(!mi[t])switch(mi[t]=!0,t){case"console":(function(){"console"in J&&en.forEach(function(e){e in J.console&&z(J.console,e,function(n){return function(...r){oe("console",{args:r,level:e}),n&&n.apply(J.console,r)}})})})();break;case"dom":(function(){if(!("document"in J))return;const e=oe.bind(null,"dom"),n=vi(e,!0);J.document.addEventListener("click",n,!1),J.document.addEventListener("keypress",n,!1),["EventTarget","Node"].forEach(r=>{const i=J[r]&&J[r].prototype;i&&i.hasOwnProperty&&i.hasOwnProperty("addEventListener")&&(z(i,"addEventListener",function(s){return function(a,c,l){if(a==="click"||a=="keypress")try{const p=this,h=p.__sentry_instrumentation_handlers__=p.__sentry_instrumentation_handlers__||{},f=h[a]=h[a]||{refCount:0};if(!f.handler){const _=vi(e);f.handler=_,s.call(this,a,_,l)}f.refCount++}catch{}return s.call(this,a,c,l)}}),z(i,"removeEventListener",function(s){return function(a,c,l){if(a==="click"||a=="keypress")try{const p=this,h=p.__sentry_instrumentation_handlers__||{},f=h[a];f&&(f.refCount--,f.refCount<=0&&(s.call(this,a,f.handler,l),f.handler=void 0,delete h[a]),Object.keys(h).length===0&&delete p.__sentry_instrumentation_handlers__)}catch{}return s.call(this,a,c,l)}}))})})();break;case"xhr":(function(){if(!("XMLHttpRequest"in J))return;const e=XMLHttpRequest.prototype;z(e,"open",function(n){return function(...r){const i=r[1],s=this[vt]={method:Ge(r[0])?r[0].toUpperCase():r[0],url:r[1],request_headers:{}};Ge(i)&&s.method==="POST"&&i.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const a=()=>{const c=this[vt];if(c&&this.readyState===4){try{c.status_code=this.status}catch{}oe("xhr",{args:r,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:this})}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?z(this,"onreadystatechange",function(c){return function(...l){return a(),c.apply(this,l)}}):this.addEventListener("readystatechange",a),z(this,"setRequestHeader",function(c){return function(...l){const[p,h]=l,f=this[vt];return f&&(f.request_headers[p.toLowerCase()]=h),c.apply(this,l)}}),n.apply(this,r)}}),z(e,"send",function(n){return function(...r){const i=this[vt];return i&&r[0]!==void 0&&(i.body=r[0]),oe("xhr",{args:r,startTimestamp:Date.now(),xhr:this}),n.apply(this,r)}})})();break;case"fetch":(function(){fa()&&z(J,"fetch",function(e){return function(...n){const{method:r,url:i}=function(a){if(a.length===0)return{method:"GET",url:""};if(a.length===2){const[l,p]=a;return{url:gi(l),method:Vn(p,"method")?String(p.method).toUpperCase():"GET"}}const c=a[0];return{url:gi(c),method:Vn(c,"method")?String(c.method).toUpperCase():"GET"}}(n),s={args:n,fetchData:{method:r,url:i},startTimestamp:Date.now()};return oe("fetch",{...s}),e.apply(J,n).then(a=>(oe("fetch",{...s,endTimestamp:Date.now(),response:a}),a),a=>{throw oe("fetch",{...s,endTimestamp:Date.now(),error:a}),a})}})})();break;case"history":(function(){if(!function(){const r=Nt.chrome,i=r&&r.app&&r.app.runtime,s="history"in Nt&&!!Nt.history.pushState&&!!Nt.history.replaceState;return!i&&s}())return;const e=J.onpopstate;function n(r){return function(...i){const s=i.length>2?i[2]:void 0;if(s){const a=jt,c=String(s);jt=c,oe("history",{from:a,to:c})}return r.apply(this,i)}}J.onpopstate=function(...r){const i=J.location.href,s=jt;if(jt=i,oe("history",{from:s,to:i}),e)try{return e.apply(this,r)}catch{}},z(J.history,"pushState",n),z(J.history,"replaceState",n)})();break;case"error":Bt=J.onerror,J.onerror=function(e,n,r,i,s){return oe("error",{column:i,error:s,line:r,msg:e,url:n}),!(!Bt||Bt.__SENTRY_LOADER__)&&Bt.apply(this,arguments)},J.onerror.__SENTRY_INSTRUMENTED__=!0;break;case"unhandledrejection":Ft=J.onunhandledrejection,J.onunhandledrejection=function(e){return oe("unhandledrejection",e),!(Ft&&!Ft.__SENTRY_LOADER__)||Ft.apply(this,arguments)},J.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0;break;default:return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn("unknown instrumentation type:",t))}}function Ue(t,e){_t[t]=_t[t]||[],_t[t].push(e),ma(t)}function oe(t,e){if(t&&_t[t])for(const n of _t[t]||[])try{n(e)}catch(r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.error(`Error while triggering instrumentation handler.
8
+ Type: ${t}
9
+ Name: ${De(n)}
10
+ Error:`,r)}}function Vn(t,e){return!!t&&typeof t=="object"&&!!t[e]}function gi(t){return typeof t=="string"?t:t?Vn(t,"url")?t.url:t.toString?t.toString():"":""}let jt;const ga=1e3;let It,Sn;function vi(t,e=!1){return n=>{if(!n||Sn===n||function(i){if(i.type!=="keypress")return!1;try{const s=i.target;if(!s||!s.tagName)return!0;if(s.tagName==="INPUT"||s.tagName==="TEXTAREA"||s.isContentEditable)return!1}catch{}return!0}(n))return;const r=n.type==="keypress"?"input":n.type;(It===void 0||function(i,s){if(!i||i.type!==s.type)return!0;try{if(i.target!==s.target)return!0}catch{}return!1}(Sn,n))&&(t({event:n,name:r,global:e}),Sn=n),clearTimeout(It),It=J.setTimeout(()=>{It=void 0},ga)}}let Bt=null,Ft=null;function Re(){const t=re,e=t.crypto||t.msCrypto;if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");const n=e&&e.getRandomValues?()=>e.getRandomValues(new Uint8Array(1))[0]:()=>16*Math.random();return("10000000100040008000"+1e11).replace(/[018]/g,r=>(r^(15&n())>>r/4).toString(16))}function Ys(t){return t.exception&&t.exception.values?t.exception.values[0]:void 0}function Pe(t){const{message:e,event_id:n}=t;if(e)return e;const r=Ys(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function $n(t,e,n){const r=t.exception=t.exception||{},i=r.values=r.values||[],s=i[0]=i[0]||{};s.value||(s.value=e||""),s.type||(s.type="Error")}function kt(t,e){const n=Ys(t);if(!n)return;const r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...e},e&&"data"in e){const i={...r&&r.data,...e.data};n.mechanism.data=i}}function yi(t){if(t&&t.__sentry_captured__)return!0;try{vr(t,"__sentry_captured__",!0)}catch{}return!1}function Ae(t,e=100,n=1/0){try{return Gn("",t,e,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Hs(t,e=3,n=102400){const r=Ae(t,e);return i=r,function(s){return~-encodeURI(s).split(/%..|./).length}(JSON.stringify(i))>n?Hs(t,e-1,n):r;var i}function Gn(t,e,n=1/0,r=1/0,i=function(){const s=typeof WeakSet=="function",a=s?new WeakSet:[];return[function(c){if(s)return!!a.has(c)||(a.add(c),!1);for(let l=0;l<a.length;l++)if(a[l]===c)return!0;return a.push(c),!1},function(c){if(s)a.delete(c);else for(let l=0;l<a.length;l++)if(a[l]===c){a.splice(l,1);break}}]}()){const[s,a]=i;if(e==null||["number","boolean","string"].includes(typeof e)&&(typeof(c=e)!="number"||c==c))return e;var c;const l=function(y,w){try{if(y==="domain"&&w&&typeof w=="object"&&w._events)return"[Domain]";if(y==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&w===global)return"[Global]";if(typeof window<"u"&&w===window)return"[Window]";if(typeof document<"u"&&w===document)return"[Document]";if(function(M){return ot(M)&&"nativeEvent"in M&&"preventDefault"in M&&"stopPropagation"in M}(w))return"[SyntheticEvent]";if(typeof w=="number"&&w!=w)return"[NaN]";if(typeof w=="function")return`[Function: ${De(w)}]`;if(typeof w=="symbol")return`[${String(w)}]`;if(typeof w=="bigint")return`[BigInt: ${String(w)}]`;const T=function(M){const B=Object.getPrototypeOf(M);return B?B.constructor.name:"null prototype"}(w);return/^HTML(\w*)Element$/.test(T)?`[HTMLElement: ${T}]`:`[object ${T}]`}catch(T){return`**non-serializable** (${T})`}}(t,e);if(!l.startsWith("[object "))return l;if(e.__sentry_skip_normalization__)return e;const p=typeof e.__sentry_override_normalization_depth__=="number"?e.__sentry_override_normalization_depth__:n;if(p===0)return l.replace("object ","");if(s(e))return"[Circular ~]";const h=e;if(h&&typeof h.toJSON=="function")try{return Gn("",h.toJSON(),p-1,r,i)}catch{}const f=Array.isArray(e)?[]:{};let _=0;const k=zs(e);for(const y in k){if(!Object.prototype.hasOwnProperty.call(k,y))continue;if(_>=r){f[y]="[MaxProperties ~]";break}const w=k[y];f[y]=Gn(y,w,p-1,r,i),_++}return a(e),f}var Se;function Ye(t){return new Q(e=>{e(t)})}function nn(t){return new Q((e,n)=>{n(t)})}(function(t){t[t.PENDING=0]="PENDING",t[t.RESOLVED=1]="RESOLVED",t[t.REJECTED=2]="REJECTED"})(Se||(Se={}));class Q{__init(){this._state=Se.PENDING}__init2(){this._handlers=[]}constructor(e){Q.prototype.__init.call(this),Q.prototype.__init2.call(this),Q.prototype.__init3.call(this),Q.prototype.__init4.call(this),Q.prototype.__init5.call(this),Q.prototype.__init6.call(this);try{e(this._resolve,this._reject)}catch(n){this._reject(n)}}then(e,n){return new Q((r,i)=>{this._handlers.push([!1,s=>{if(e)try{r(e(s))}catch(a){i(a)}else r(s)},s=>{if(n)try{r(n(s))}catch(a){i(a)}else i(s)}]),this._executeHandlers()})}catch(e){return this.then(n=>n,e)}finally(e){return new Q((n,r)=>{let i,s;return this.then(a=>{s=!1,i=a,e&&e()},a=>{s=!0,i=a,e&&e()}).then(()=>{s?r(i):n(i)})})}__init3(){this._resolve=e=>{this._setResult(Se.RESOLVED,e)}}__init4(){this._reject=e=>{this._setResult(Se.REJECTED,e)}}__init5(){this._setResult=(e,n)=>{this._state===Se.PENDING&&(mr(n)?n.then(this._resolve,this._reject):(this._state=e,this._value=n,this._executeHandlers()))}}__init6(){this._executeHandlers=()=>{if(this._state===Se.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach(n=>{n[0]||(this._state===Se.RESOLVED&&n[1](this._value),this._state===Se.REJECTED&&n[2](this._value),n[0]=!0)})}}}function va(t){const e=[];function n(r){return e.splice(e.indexOf(r),1)[0]}return{$:e,add:function(r){if(!(t===void 0||e.length<t))return nn(new ce("Not adding Promise because buffer limit was reached."));const i=r();return e.indexOf(i)===-1&&e.push(i),i.then(()=>n(i)).then(null,()=>n(i).then(null,()=>{})),i},drain:function(r){return new Q((i,s)=>{let a=e.length;if(!a)return i(!0);const c=setTimeout(()=>{r&&r>0&&i(!1)},r);e.forEach(l=>{Ye(l).then(()=>{--a||(clearTimeout(c),i(!0))},s)})})}}}function kn(t){if(!t)return{};const e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};const n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:n,hash:r,relative:e[5]+n+r}}const ya=["fatal","error","warning","log","info","debug"],Ws=Pt(),zn={nowSeconds:()=>Date.now()/1e3},En=typeof __SENTRY_BROWSER_BUNDLE__<"u"&&__SENTRY_BROWSER_BUNDLE__||Object.prototype.toString.call(typeof process<"u"?process:0)!=="[object process]"?function(){const{performance:t}=Ws;if(!(!t||!t.now))return{now:()=>t.now(),timeOrigin:Date.now()-t.now()}}():function(){try{return(t=module,e="perf_hooks",t.require(e)).performance}catch{return}var t,e}(),_i=En===void 0?zn:{nowSeconds:()=>(En.timeOrigin+En.now())/1e3},pn=zn.nowSeconds.bind(zn),Qs=_i.nowSeconds.bind(_i);function Et(t,e=[]){return[t,e]}function _a(t,e){const[n,r]=t;return[n,[...r,e]]}function bi(t,e){const n=t[1];for(const r of n)if(e(r,r[0].type))return!0;return!1}function Yn(t,e){return(e||new TextEncoder).encode(t)}function ba(t,e){const[n,r]=t;let i=JSON.stringify(n);function s(a){typeof i=="string"?i=typeof a=="string"?i+a:[Yn(i,e),a]:i.push(typeof a=="string"?Yn(a,e):a)}for(const a of r){const[c,l]=a;if(s(`
11
+ ${JSON.stringify(c)}
12
+ `),typeof l=="string"||l instanceof Uint8Array)s(l);else{let p;try{p=JSON.stringify(l)}catch{p=JSON.stringify(Ae(l))}s(p)}}return typeof i=="string"?i:function(a){const c=a.reduce((h,f)=>h+f.length,0),l=new Uint8Array(c);let p=0;for(const h of a)l.set(h,p),p+=h.length;return l}(i)}function wa(t,e){const n=typeof t.data=="string"?Yn(t.data,e):t.data;return[hn({type:"attachment",length:n.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType}),n]}(()=>{const{performance:t}=Ws;if(!t||!t.now)return;const e=36e5,n=t.now(),r=Date.now(),i=t.timeOrigin?Math.abs(t.timeOrigin+n-r):e,s=i<e,a=t.timing&&t.timing.navigationStart,c=typeof a=="number"?Math.abs(a+n-r):e;(s||c<e)&&i<=c&&t.timeOrigin})();const Sa={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor"};function wi(t){return Sa[t]}function Ks(t){if(!t||!t.sdk)return;const{name:e,version:n}=t.sdk;return{name:e,version:n}}const ka=6e4;function Ea(t,{statusCode:e,headers:n},r=Date.now()){const i={...t},s=n&&n["x-sentry-rate-limits"],a=n&&n["retry-after"];if(s)for(const c of s.trim().split(",")){const[l,p]=c.split(":",2),h=parseInt(l,10),f=1e3*(isNaN(h)?60:h);if(p)for(const _ of p.split(";"))i[_]=r+f;else i.all=r+f}else a?i.all=r+function(c,l=Date.now()){const p=parseInt(`${c}`,10);if(!isNaN(p))return 1e3*p;const h=Date.parse(`${c}`);return isNaN(h)?ka:h-l}(a,r):e===429&&(i.all=r+6e4);return i}const _r="production";function Ta(t){const e=Qs(),n={sid:Re(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(r){return hn({sid:`${r.sid}`,init:r.init,started:new Date(1e3*r.started).toISOString(),timestamp:new Date(1e3*r.timestamp).toISOString(),status:r.status,errors:r.errors,did:typeof r.did=="number"||typeof r.did=="string"?`${r.did}`:void 0,duration:r.duration,attrs:{release:r.release,environment:r.environment,ip_address:r.ipAddress,user_agent:r.userAgent}})}(n)};return t&&at(n,t),n}function at(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),t.did||e.did||(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||Qs(),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:Re()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{const n=t.timestamp-t.started;t.duration=n>=0?n:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}class Je{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=Si()}static clone(e){const n=new Je;return e&&(n._breadcrumbs=[...e._breadcrumbs],n._tags={...e._tags},n._extra={...e._extra},n._contexts={...e._contexts},n._user=e._user,n._level=e._level,n._span=e._span,n._session=e._session,n._transactionName=e._transactionName,n._fingerprint=e._fingerprint,n._eventProcessors=[...e._eventProcessors],n._requestSession=e._requestSession,n._attachments=[...e._attachments],n._sdkProcessingMetadata={...e._sdkProcessingMetadata},n._propagationContext={...e._propagationContext}),n}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{},this._session&&at(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,n){return this._tags={...this._tags,[e]:n},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,n){return this._extra={...this._extra,[e]:n},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,n){return n===null?delete this._contexts[e]:this._contexts[e]=n,this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const e=this.getSpan();return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;if(typeof e=="function"){const n=e(this);return n instanceof Je?n:this}return e instanceof Je?(this._tags={...this._tags,...e._tags},this._extra={...this._extra,...e._extra},this._contexts={...this._contexts,...e._contexts},e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession),e._propagationContext&&(this._propagationContext=e._propagationContext)):ot(e)&&(this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession),e.propagationContext&&(this._propagationContext=e.propagationContext)),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=Si(),this}addBreadcrumb(e,n){const r=typeof n=="number"?n:100;if(r<=0)return this;const i={timestamp:pn(),...e};return this._breadcrumbs=[...this._breadcrumbs,i].slice(-r),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(e,n={}){if(this._extra&&Object.keys(this._extra).length&&(e.extra={...this._extra,...e.extra}),this._tags&&Object.keys(this._tags).length&&(e.tags={...this._tags,...e.tags}),this._user&&Object.keys(this._user).length&&(e.user={...this._user,...e.user}),this._contexts&&Object.keys(this._contexts).length&&(e.contexts={...this._contexts,...e.contexts}),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts={trace:this._span.getTraceContext(),...e.contexts};const r=this._span.transaction;if(r){e.sdkProcessingMetadata={dynamicSamplingContext:r.getDynamicSamplingContext(),...e.sdkProcessingMetadata};const i=r.name;i&&(e.tags={transaction:i,...e.tags})}}return this._applyFingerprint(e),e.breadcrumbs=[...e.breadcrumbs||[],...this._breadcrumbs],e.breadcrumbs=e.breadcrumbs.length>0?e.breadcrumbs:void 0,e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...this._sdkProcessingMetadata,propagationContext:this._propagationContext},this._notifyEventProcessors([...Xs(),...this._eventProcessors],e,n)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}_notifyEventProcessors(e,n,r,i=0){return new Q((s,a)=>{const c=e[i];if(n===null||typeof c!="function")s(n);else{const l=c({...n},r);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&c.id&&l===null&&R.log(`Event processor "${c.id}" dropped event`),mr(l)?l.then(p=>this._notifyEventProcessors(e,p,r,i+1).then(s)).then(null,a):this._notifyEventProcessors(e,l,r,i+1).then(s).then(null,a)}})}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}_applyFingerprint(e){var n;e.fingerprint=e.fingerprint?(n=e.fingerprint,Array.isArray(n)?n:[n]):[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}}function Xs(){return gr("globalEventProcessors",()=>[])}function Zs(t){Xs().push(t)}function Si(){return{traceId:Re(),spanId:Re().substring(16),sampled:!1}}const eo=4,Ca=100;class br{constructor(e,n=new Je,r=eo){this._version=r,this._stack=[{scope:n}],e&&this.bindClient(e)}isOlderThan(e){return this._version<e}bindClient(e){this.getStackTop().client=e,e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){const e=Je.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return!(this.getStack().length<=1)&&!!this.getStack().pop()}withScope(e){const n=this.pushScope();try{e(n)}finally{this.popScope()}}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,n){const r=this._lastEventId=n&&n.event_id?n.event_id:Re(),i=new Error("Sentry syntheticException");return this._withClient((s,a)=>{s.captureException(e,{originalException:e,syntheticException:i,...n,event_id:r},a)}),r}captureMessage(e,n,r){const i=this._lastEventId=r&&r.event_id?r.event_id:Re(),s=new Error(e);return this._withClient((a,c)=>{a.captureMessage(e,n,{originalException:e,syntheticException:s,...r,event_id:i},c)}),i}captureEvent(e,n){const r=n&&n.event_id?n.event_id:Re();return e.type||(this._lastEventId=r),this._withClient((i,s)=>{i.captureEvent(e,{...n,event_id:r},s)}),r}lastEventId(){return this._lastEventId}addBreadcrumb(e,n){const{scope:r,client:i}=this.getStackTop();if(!i)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:a=Ca}=i.getOptions&&i.getOptions()||{};if(a<=0)return;const c={timestamp:pn(),...e},l=s?$s(()=>s(c,n)):c;l!==null&&(i.emit&&i.emit("beforeAddBreadcrumb",l,n),r.addBreadcrumb(l,a))}setUser(e){this.getScope().setUser(e)}setTags(e){this.getScope().setTags(e)}setExtras(e){this.getScope().setExtras(e)}setTag(e,n){this.getScope().setTag(e,n)}setExtra(e,n){this.getScope().setExtra(e,n)}setContext(e,n){this.getScope().setContext(e,n)}configureScope(e){const{scope:n,client:r}=this.getStackTop();r&&e(n)}run(e){const n=ki(this);try{e(this)}finally{ki(n)}}getIntegration(e){const n=this.getClient();if(!n)return null;try{return n.getIntegration(e)}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,n){const r=this._callExtensionMethod("startTransaction",e,n);return typeof __SENTRY_DEBUG__<"u"&&!__SENTRY_DEBUG__||r||console.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
13
+ Sentry.addTracingExtensions();
14
+ Sentry.init({...});
15
+ `),r}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){const e=this.getStackTop().scope,n=e.getSession();n&&function(r,i){let s={};r.status==="ok"&&(s={status:"exited"}),at(r,s)}(n),this._sendSessionUpdate(),e.setSession()}startSession(e){const{scope:n,client:r}=this.getStackTop(),{release:i,environment:s=_r}=r&&r.getOptions()||{},{userAgent:a}=re.navigator||{},c=Ta({release:i,environment:s,user:n.getUser(),...a&&{userAgent:a},...e}),l=n.getSession&&n.getSession();return l&&l.status==="ok"&&at(l,{status:"exited"}),this.endSession(),n.setSession(c),c}shouldSendDefaultPii(){const e=this.getClient(),n=e&&e.getOptions();return!!(n&&n.sendDefaultPii)}_sendSessionUpdate(){const{scope:e,client:n}=this.getStackTop(),r=e.getSession();r&&n&&n.captureSession&&n.captureSession(r)}_withClient(e){const{scope:n,client:r}=this.getStackTop();r&&e(r,n)}_callExtensionMethod(e,...n){const r=rn().__SENTRY__;if(r&&r.extensions&&typeof r.extensions[e]=="function")return r.extensions[e].apply(this,n);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function rn(){return re.__SENTRY__=re.__SENTRY__||{extensions:{},hub:void 0},re}function ki(t){const e=rn(),n=Hn(e);return to(e,t),n}function ee(){const t=rn();if(t.__SENTRY__&&t.__SENTRY__.acs){const e=t.__SENTRY__.acs.getCurrentHub();if(e)return e}return function(e=rn()){n=e,n&&n.__SENTRY__&&n.__SENTRY__.hub&&!Hn(e).isOlderThan(eo)||to(e,new br);var n;return Hn(e)}(t)}function Hn(t){return gr("hub",()=>new br,t)}function to(t,e){return t?((t.__SENTRY__=t.__SENTRY__||{}).hub=e,!0):!1}const Ma="7";function Oa(t,e){return n={sentry_key:t.publicKey,sentry_version:Ma,...e&&{sentry_client:`${e.name}/${e.version}`}},Object.keys(n).map(r=>`${encodeURIComponent(r)}=${encodeURIComponent(n[r])}`).join("&");var n}function Pa(t,e,n,r){const i=Ks(n),s=t.type&&t.type!=="replay_event"?t.type:"event";(function(c,l){l&&(c.sdk=c.sdk||{},c.sdk.name=c.sdk.name||l.name,c.sdk.version=c.sdk.version||l.version,c.sdk.integrations=[...c.sdk.integrations||[],...l.integrations||[]],c.sdk.packages=[...c.sdk.packages||[],...l.packages||[]])})(t,n&&n.sdk);const a=function(c,l,p,h){const f=c.sdkProcessingMetadata&&c.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:c.event_id,sent_at:new Date().toISOString(),...l&&{sdk:l},...!!p&&{dsn:tn(h)},...f&&{trace:hn({...f})}}}(t,i,r,e);return delete t.sdkProcessingMetadata,Et(a,[[{type:s},t]])}const Ei=[];function Ti(t,e){e[t.name]=t,Ei.indexOf(t.name)===-1&&(t.setupOnce(Zs,ee),Ei.push(t.name),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log(`Integration installed: ${t.name}`))}function Aa(t,e,n,r){const{normalizeDepth:i=3,normalizeMaxBreadth:s=1e3}=t,a={...e,event_id:e.event_id||n.event_id||Re(),timestamp:e.timestamp||pn()},c=n.integrations||t.integrations.map(h=>h.name);(function(h,f){const{environment:_,release:k,dist:y,maxValueLength:w=250}=f;"environment"in h||(h.environment="environment"in f?_:_r),h.release===void 0&&k!==void 0&&(h.release=k),h.dist===void 0&&y!==void 0&&(h.dist=y),h.message&&(h.message=et(h.message,w));const T=h.exception&&h.exception.values&&h.exception.values[0];T&&T.value&&(T.value=et(T.value,w));const M=h.request;M&&M.url&&(M.url=et(M.url,w))})(a,t),function(h,f){f.length>0&&(h.sdk=h.sdk||{},h.sdk.integrations=[...h.sdk.integrations||[],...f])}(a,c),e.type===void 0&&function(h,f){const _=re._sentryDebugIds;if(!_)return;let k;const y=Ci.get(f);y?k=y:(k=new Map,Ci.set(f,k));const w=Object.keys(_).reduce((T,M)=>{let B;const L=k.get(M);L?B=L:(B=f(M),k.set(M,B));for(let te=B.length-1;te>=0;te--){const Le=B[te];if(Le.filename){T[Le.filename]=_[M];break}}return T},{});try{h.exception.values.forEach(T=>{T.stacktrace.frames.forEach(M=>{M.filename&&(M.debug_id=w[M.filename])})})}catch{}}(a,t.stackParser);let l=r;n.captureContext&&(l=Je.clone(l).update(n.captureContext));let p=Ye(a);if(l){if(l.getAttachments){const h=[...n.attachments||[],...l.getAttachments()];h.length&&(n.attachments=h)}p=l.applyToEvent(a,n)}return p.then(h=>(h&&function(f){const _={};try{f.exception.values.forEach(y=>{y.stacktrace.frames.forEach(w=>{w.debug_id&&(w.abs_path?_[w.abs_path]=w.debug_id:w.filename&&(_[w.filename]=w.debug_id),delete w.debug_id)})})}catch{}if(Object.keys(_).length===0)return;f.debug_meta=f.debug_meta||{},f.debug_meta.images=f.debug_meta.images||[];const k=f.debug_meta.images;Object.keys(_).forEach(y=>{k.push({type:"sourcemap",code_file:y,debug_id:_[y]})})}(h),typeof i=="number"&&i>0?function(f,_,k){if(!f)return null;const y={...f,...f.breadcrumbs&&{breadcrumbs:f.breadcrumbs.map(w=>({...w,...w.data&&{data:Ae(w.data,_,k)}}))},...f.user&&{user:Ae(f.user,_,k)},...f.contexts&&{contexts:Ae(f.contexts,_,k)},...f.extra&&{extra:Ae(f.extra,_,k)}};return f.contexts&&f.contexts.trace&&y.contexts&&(y.contexts.trace=f.contexts.trace,f.contexts.trace.data&&(y.contexts.trace.data=Ae(f.contexts.trace.data,_,k))),f.spans&&(y.spans=f.spans.map(w=>(w.data&&(w.data=Ae(w.data,_,k)),w))),y}(h,i,s):h))}const Ci=new WeakMap,Mi="Not capturing exception because it's already been captured.";class qe{__init(){this._integrations={}}__init2(){this._integrationsInitialized=!1}__init3(){this._numProcessing=0}__init4(){this._outcomes={}}__init5(){this._hooks={}}constructor(e){if(qe.prototype.__init.call(this),qe.prototype.__init2.call(this),qe.prototype.__init3.call(this),qe.prototype.__init4.call(this),qe.prototype.__init5.call(this),this._options=e,e.dsn?this._dsn=pa(e.dsn):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn("No DSN provided, client will not do anything."),this._dsn){const n=function(r,i={}){const s=typeof i=="string"?i:i.tunnel,a=typeof i!="string"&&i._metadata?i._metadata.sdk:void 0;return s||`${function(c){return`${function(l){const p=l.protocol?`${l.protocol}:`:"",h=l.port?`:${l.port}`:"";return`${p}//${l.host}${h}${l.path?`/${l.path}`:""}/api/`}(c)}${c.projectId}/envelope/`}(r)}?${Oa(r,a)}`}(this._dsn,e);this._transport=e.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:n})}}captureException(e,n,r){if(yi(e))return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log(Mi));let i=n&&n.event_id;return this._process(this.eventFromException(e,n).then(s=>this._captureEvent(s,n,r)).then(s=>{i=s})),i}captureMessage(e,n,r,i){let s=r&&r.event_id;const a=Vs(e)?this.eventFromMessage(String(e),n,r):this.eventFromException(e,r);return this._process(a.then(c=>this._captureEvent(c,r,i)).then(c=>{s=c})),s}captureEvent(e,n,r){if(n&&n.originalException&&yi(n.originalException))return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log(Mi));let i=n&&n.event_id;return this._process(this._captureEvent(e,n,r).then(s=>{i=s})),i}captureSession(e){this._isEnabled()?typeof e.release!="string"?(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),at(e,{init:!1})):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn("SDK not enabled, will not capture session.")}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){const n=this._transport;return n?this._isClientDoneProcessing(e).then(r=>n.flush(e).then(i=>r&&i)):Ye(!0)}close(e){return this.flush(e).then(n=>(this.getOptions().enabled=!1,n))}setupIntegrations(){this._isEnabled()&&!this._integrationsInitialized&&(this._integrations=function(e){const n={};return e.forEach(r=>{r&&Ti(r,n)}),n}(this._options.integrations),this._integrationsInitialized=!0)}getIntegrationById(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){Ti(e,this._integrations)}sendEvent(e,n={}){if(this._dsn){let r=Pa(e,this._dsn,this._options._metadata,this._options.tunnel);for(const s of n.attachments||[])r=_a(r,wa(s,this._options.transportOptions&&this._options.transportOptions.textEncoder));const i=this._sendEnvelope(r);i&&i.then(s=>this.emit("afterSendEvent",e,s),null)}}sendSession(e){if(this._dsn){const n=function(r,i,s,a){const c=Ks(s);return Et({sent_at:new Date().toISOString(),...c&&{sdk:c},...!!a&&{dsn:tn(i)}},["aggregates"in r?[{type:"sessions"},r]:[{type:"session"},r.toJSON()]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(n)}}recordDroppedEvent(e,n,r){if(this._options.sendClientReports){const i=`${e}:${n}`;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log(`Adding outcome: "${i}"`),this._outcomes[i]=this._outcomes[i]+1||1}}on(e,n){this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(n)}emit(e,...n){this._hooks[e]&&this._hooks[e].forEach(r=>r(...n))}_updateSessionFromEvent(e,n){let r=!1,i=!1;const s=n.exception&&n.exception.values;if(s){i=!0;for(const c of s){const l=c.mechanism;if(l&&l.handled===!1){r=!0;break}}}const a=e.status==="ok";(a&&e.errors===0||a&&r)&&(at(e,{...r&&{status:"crashed"},errors:e.errors||Number(i||r)}),this.captureSession(e))}_isClientDoneProcessing(e){return new Q(n=>{let r=0;const i=setInterval(()=>{this._numProcessing==0?(clearInterval(i),n(!0)):(r+=1,e&&r>=e&&(clearInterval(i),n(!1)))},1)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._dsn!==void 0}_prepareEvent(e,n,r){const i=this.getOptions(),s=Object.keys(this._integrations);return!n.integrations&&s.length>0&&(n.integrations=s),Aa(i,e,n,r).then(a=>{if(a===null)return a;const{propagationContext:c}=a.sdkProcessingMetadata||{};if(!(a.contexts&&a.contexts.trace)&&c){const{traceId:l,spanId:p,parentSpanId:h,dsc:f}=c;a.contexts={trace:{trace_id:l,span_id:p,parent_span_id:h},...a.contexts};const _=f||function(k,y,w){const T=y.getOptions(),{publicKey:M}=y.getDsn()||{},{segment:B}=w&&w.getUser()||{},L=hn({environment:T.environment||_r,release:T.release,user_segment:B,public_key:M,trace_id:k});return y.emit&&y.emit("createDsc",L),L}(l,this,r);a.sdkProcessingMetadata={dynamicSamplingContext:_,...a.sdkProcessingMetadata}}return a})}_captureEvent(e,n={},r){return this._processEvent(e,n,r).then(i=>i.event_id,i=>{if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){const s=i;s.logLevel==="log"?R.log(s.message):R.warn(s)}})}_processEvent(e,n,r){const i=this.getOptions(),{sampleRate:s}=i;if(!this._isEnabled())return nn(new ce("SDK not enabled, will not capture event.","log"));const a=Pi(e),c=Oi(e),l=e.type||"error",p=`before send for type \`${l}\``;if(c&&typeof s=="number"&&Math.random()>s)return this.recordDroppedEvent("sample_rate","error",e),nn(new ce(`Discarding event because it's not included in the random sample (sampling rate = ${s})`,"log"));const h=l==="replay_event"?"replay":l;return this._prepareEvent(e,n,r).then(f=>{if(f===null)throw this.recordDroppedEvent("event_processor",h,e),new ce("An event processor returned `null`, will not send event.","log");if(n.data&&n.data.__sentry__===!0)return f;const _=function(k,y,w){const{beforeSend:T,beforeSendTransaction:M}=k;return Oi(y)&&T?T(y,w):Pi(y)&&M?M(y,w):y}(i,f,n);return function(k,y){const w=`${y} must return \`null\` or a valid event.`;if(mr(k))return k.then(T=>{if(!ot(T)&&T!==null)throw new ce(w);return T},T=>{throw new ce(`${y} rejected with ${T}`)});if(!ot(k)&&k!==null)throw new ce(w);return k}(_,p)}).then(f=>{if(f===null)throw this.recordDroppedEvent("before_send",h,e),new ce(`${p} returned \`null\`, will not send event.`,"log");const _=r&&r.getSession();!a&&_&&this._updateSessionFromEvent(_,f);const k=f.transaction_info;if(a&&k&&f.transaction!==e.transaction){const y="custom";f.transaction_info={...k,source:y}}return this.sendEvent(f,n),f}).then(null,f=>{throw f instanceof ce?f:(this.captureException(f,{data:{__sentry__:!0},originalException:f}),new ce(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
16
+ Reason: ${f}`))})}_process(e){this._numProcessing++,e.then(n=>(this._numProcessing--,n),n=>(this._numProcessing--,n))}_sendEnvelope(e){if(this._transport&&this._dsn)return this.emit("beforeEnvelope",e),this._transport.send(e).then(null,n=>{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.error("Error while sending event:",n)});(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.error("Transport disabled")}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.keys(e).map(n=>{const[r,i]=n.split(":");return{reason:r,category:i,quantity:e[n]}})}}function Oi(t){return t.type===void 0}function Pi(t){return t.type==="transaction"}const Ra=30;function xa(t,e,n=va(t.bufferSize||Ra)){let r={};function i(s){const a=[];if(bi(s,(p,h)=>{const f=wi(h);if(function(_,k,y=Date.now()){return function(w,T){return w[T]||w.all||0}(_,k)>y}(r,f)){const _=Ai(p,h);t.recordDroppedEvent("ratelimit_backoff",f,_)}else a.push(p)}),a.length===0)return Ye();const c=Et(s[0],a),l=p=>{bi(c,(h,f)=>{const _=Ai(h,f);t.recordDroppedEvent(p,wi(f),_)})};return n.add(()=>e({body:ba(c,t.textEncoder)}).then(p=>(p.statusCode!==void 0&&(p.statusCode<200||p.statusCode>=300)&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn(`Sentry responded with status code ${p.statusCode} to sent event.`),r=Ea(r,p),p),p=>{throw l("network_error"),p})).then(p=>p,p=>{if(p instanceof ce)return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.error("Skipped sending event because buffer is full."),l("queue_overflow"),Ye();throw p})}return i.__sentry__baseTransport__=!0,{send:i,flush:s=>n.drain(s)}}function Ai(t,e){if(e==="event"||e==="transaction")return Array.isArray(t)?t[1]:void 0}const Ri="7.60.1";let xi;class Tt{constructor(){Tt.prototype.__init.call(this)}static __initStatic(){this.id="FunctionToString"}__init(){this.name=Tt.id}setupOnce(){xi=Function.prototype.toString;try{Function.prototype.toString=function(...e){const n=yr(this)||this;return xi.apply(n,e)}}catch{}}}Tt.__initStatic();const Da=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],La=[/^.*healthcheck.*$/,/^.*healthy.*$/,/^.*live.*$/,/^.*ready.*$/,/^.*heartbeat.*$/,/^.*\/health$/,/^.*\/healthz$/];class tt{static __initStatic(){this.id="InboundFilters"}__init(){this.name=tt.id}constructor(e={}){this._options=e,tt.prototype.__init.call(this)}setupOnce(e,n){const r=i=>{const s=n();if(s){const a=s.getIntegration(tt);if(a){const c=s.getClient(),l=c?c.getOptions():{},p=function(h={},f={}){return{allowUrls:[...h.allowUrls||[],...f.allowUrls||[]],denyUrls:[...h.denyUrls||[],...f.denyUrls||[]],ignoreErrors:[...h.ignoreErrors||[],...f.ignoreErrors||[],...h.disableErrorDefaults?[]:Da],ignoreTransactions:[...h.ignoreTransactions||[],...f.ignoreTransactions||[],...h.disableTransactionDefaults?[]:La],ignoreInternal:h.ignoreInternal===void 0||h.ignoreInternal}}(a._options,l);return function(h,f){return f.ignoreInternal&&function(_){try{return _.exception.values[0].type==="SentryError"}catch{}return!1}(h)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn(`Event dropped due to being internal Sentry Error.
17
+ Event: ${Pe(h)}`),!0):function(_,k){return _.type||!k||!k.length?!1:function(y){if(y.message)return[y.message];if(y.exception){const{values:w}=y.exception;try{const{type:T="",value:M=""}=w&&w[w.length-1]||{};return[`${M}`,`${T}: ${M}`]}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.error(`Cannot extract message for event ${Pe(y)}`),[]}}return[]}(_).some(y=>Dt(y,k))}(h,f.ignoreErrors)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
18
+ Event: ${Pe(h)}`),!0):function(_,k){if(_.type!=="transaction"||!k||!k.length)return!1;const y=_.transaction;return!!y&&Dt(y,k)}(h,f.ignoreTransactions)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
19
+ Event: ${Pe(h)}`),!0):function(_,k){if(!k||!k.length)return!1;const y=Ut(_);return!!y&&Dt(y,k)}(h,f.denyUrls)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn(`Event dropped due to being matched by \`denyUrls\` option.
20
+ Event: ${Pe(h)}.
21
+ Url: ${Ut(h)}`),!0):function(_,k){if(!k||!k.length)return!0;const y=Ut(_);return!y||Dt(y,k)}(h,f.allowUrls)?!1:((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn(`Event dropped due to not being matched by \`allowUrls\` option.
22
+ Event: ${Pe(h)}.
23
+ Url: ${Ut(h)}`),!0)}(i,p)?null:i}}return i};r.id=this.name,e(r)}}function Ut(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch{}return e?function(n=[]){for(let r=n.length-1;r>=0;r--){const i=n[r];if(i&&i.filename!=="<anonymous>"&&i.filename!=="[native code]")return i.filename||null}return null}(e):null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.error(`Cannot extract url for event ${Pe(t)}`),null}}tt.__initStatic();var Na=Object.freeze({__proto__:null,FunctionToString:Tt,InboundFilters:tt});const F=re;let Wn=0;function no(){return Wn>0}function ct(t,e={},n){if(typeof t!="function")return t;try{const i=t.__sentry_wrapped__;if(i)return i;if(yr(t))return t}catch{return t}const r=function(){const i=Array.prototype.slice.call(arguments);try{n&&typeof n=="function"&&n.apply(this,arguments);const a=i.map(c=>ct(c,e));return t.apply(this,a)}catch(a){throw Wn++,setTimeout(()=>{Wn--}),s=c=>{var l,p;c.addEventProcessor(h=>(e.mechanism&&($n(h,void 0),kt(h,e.mechanism)),h.extra={...h.extra,arguments:i},h)),l=a,ee().captureException(l,{captureContext:p})},ee().withScope(s),a}var s};try{for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}catch{}Gs(r,t),vr(t,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get:()=>t.name})}catch{}return r}function ro(t,e){const n=wr(t,e),r={type:e&&e.name,value:Ia(e)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function Tn(t,e){return{exception:{values:[ro(t,e)]}}}function wr(t,e){const n=e.stacktrace||e.stack||"",r=function(i){if(i){if(typeof i.framesToPop=="number")return i.framesToPop;if(ja.test(i.message))return 1}return 0}(e);try{return t(n,r)}catch{}return[]}const ja=/Minified React error #\d+;/i;function Ia(t){const e=t&&t.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:e:"No error message"}function Sr(t,e,n,r,i){let s;if(fr(e)&&e.error)return Tn(t,e.error);if(oi(e)||lt(e,"DOMException")){const a=e;if("stack"in e)s=Tn(t,e);else{const c=a.name||(oi(a)?"DOMError":"DOMException"),l=a.message?`${c}: ${a.message}`:c;s=Qn(t,l,n,r),$n(s,l)}return"code"in a&&(s.tags={...s.tags,"DOMException.code":`${a.code}`}),s}return Js(e)?Tn(t,e):ot(e)||Zt(e)?(s=function(a,c,l,p){const h=ee().getClient(),f=h&&h.getOptions().normalizeDepth,_={exception:{values:[{type:Zt(c)?c.constructor.name:p?"UnhandledRejection":"Error",value:Ba(c,{isUnhandledRejection:p})}]},extra:{__serialized__:Hs(c,f)}};if(l){const k=wr(a,l);k.length&&(_.exception.values[0].stacktrace={frames:k})}return _}(t,e,n,i),kt(s,{synthetic:!0}),s):(s=Qn(t,e,n,r),$n(s,`${e}`),kt(s,{synthetic:!0}),s)}function Qn(t,e,n,r){const i={message:e};if(r&&n){const s=wr(t,n);s.length&&(i.exception={values:[{value:e,stacktrace:{frames:s}}]})}return i}function Ba(t,{isUnhandledRejection:e}){const n=function(i,s=40){const a=Object.keys(zs(i));if(a.sort(),!a.length)return"[object has no keys]";if(a[0].length>=s)return et(a[0],s);for(let c=a.length;c>0;c--){const l=a.slice(0,c).join(", ");if(!(l.length>s))return c===a.length?l:et(l,s)}return""}(t),r=e?"promise rejection":"exception";return fr(t)?`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``:Zt(t)?`Event \`${function(i){try{const s=Object.getPrototypeOf(i);return s?s.constructor.name:void 0}catch{}}(t)}\` (type=${t.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}const Di=1024,io="Breadcrumbs";class Ct{static __initStatic(){this.id=io}__init(){this.name=Ct.id}constructor(e){Ct.prototype.__init.call(this),this.options={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e}}setupOnce(){this.options.console&&Ue("console",Fa),this.options.dom&&Ue("dom",function(e){function n(r){let i,s=typeof e=="object"?e.serializeAttribute:void 0,a=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;a&&a>Di&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${a} was configured. Sentry will use 1024 instead.`),a=Di),typeof s=="string"&&(s=[s]);try{const c=r.event;i=function(l){return!!l&&!!l.target}(c)?Un(c.target,{keyAttrs:s,maxStringLength:a}):Un(c,{keyAttrs:s,maxStringLength:a})}catch{i="<unknown>"}i.length!==0&&ee().addBreadcrumb({category:`ui.${r.name}`,message:i},{event:r.event,name:r.name,global:r.global})}return n}(this.options.dom)),this.options.xhr&&Ue("xhr",Ua),this.options.fetch&&Ue("fetch",qa),this.options.history&&Ue("history",Ja)}addSentryBreadcrumb(e){this.options.sentry&&ee().addBreadcrumb({category:"sentry."+(e.type==="transaction"?"transaction":"event"),event_id:e.event_id,level:e.level,message:Pe(e)},{event:e})}}function Fa(t){for(let r=0;r<t.args.length;r++)if(t.args[r]==="ref=Ref<"){t.args[r+1]="viewRef";break}const e={category:"console",data:{arguments:t.args,logger:"console"},level:(n=t.level,n==="warn"?"warning":ya.includes(n)?n:"log"),message:ai(t.args," ")};var n;if(t.level==="assert"){if(t.args[0]!==!1)return;e.message=`Assertion failed: ${ai(t.args.slice(1)," ")||"console.assert"}`,e.data.arguments=t.args.slice(1)}ee().addBreadcrumb(e,{input:t.args,level:t.level})}function Ua(t){const{startTimestamp:e,endTimestamp:n}=t,r=t.xhr[vt];if(!e||!n||!r)return;const{method:i,url:s,status_code:a,body:c}=r,l={method:i,url:s,status_code:a},p={xhr:t.xhr,input:c,startTimestamp:e,endTimestamp:n};ee().addBreadcrumb({category:"xhr",data:l,type:"http"},p)}function qa(t){const{startTimestamp:e,endTimestamp:n}=t;if(n&&(!t.fetchData.url.match(/sentry_key/)||t.fetchData.method!=="POST"))if(t.error){const r=t.fetchData,i={data:t.error,input:t.args,startTimestamp:e,endTimestamp:n};ee().addBreadcrumb({category:"fetch",data:r,level:"error",type:"http"},i)}else{const r={...t.fetchData,status_code:t.response&&t.response.status},i={input:t.args,response:t.response,startTimestamp:e,endTimestamp:n};ee().addBreadcrumb({category:"fetch",data:r,type:"http"},i)}}function Ja(t){let e=t.from,n=t.to;const r=kn(F.location.href);let i=kn(e);const s=kn(n);i.path||(i=r),r.protocol===s.protocol&&r.host===s.host&&(n=s.relative),r.protocol===i.protocol&&r.host===i.host&&(e=i.relative),ee().addBreadcrumb({category:"navigation",data:{from:e,to:n}})}Ct.__initStatic();class Va extends qe{constructor(e){const n=F.SENTRY_SDK_SOURCE||"npm";e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:`${n}:@sentry/browser`,version:Ri}],version:Ri},super(e),e.sendClientReports&&F.document&&F.document.addEventListener("visibilitychange",()=>{F.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,n){return function(r,i,s,a){const c=Sr(r,i,s&&s.syntheticException||void 0,a);return kt(c),c.level="error",s&&s.event_id&&(c.event_id=s.event_id),Ye(c)}(this._options.stackParser,e,n,this._options.attachStacktrace)}eventFromMessage(e,n="info",r){return function(i,s,a="info",c,l){const p=Qn(i,s,c&&c.syntheticException||void 0,l);return p.level=a,c&&c.event_id&&(p.event_id=c.event_id),Ye(p)}(this._options.stackParser,e,n,r,this._options.attachStacktrace)}sendEvent(e,n){const r=this.getIntegrationById(io);r&&r.addSentryBreadcrumb&&r.addSentryBreadcrumb(e),super.sendEvent(e,n)}captureUserFeedback(e){if(!this._isEnabled())return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn("SDK not enabled, will not capture user feedback."));const n=function(r,{metadata:i,tunnel:s,dsn:a}){const c={event_id:r.event_id,sent_at:new Date().toISOString(),...i&&i.sdk&&{sdk:{name:i.sdk.name,version:i.sdk.version}},...!!s&&!!a&&{dsn:tn(a)}};return Et(c,[function(p){return[{type:"user_report"},p]}(r)])}(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(n)}_prepareEvent(e,n,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,n,r)}_flushOutcomes(){const e=this._clearOutcomes();if(e.length===0)return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log("No outcomes to send"));if(!this._dsn)return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log("No dsn provided, will not send outcomes"));(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log("Sending outcomes:",e);const n=(r=e,Et((i=this._options.tunnel&&tn(this._dsn))?{dsn:i}:{},[[{type:"client_report"},{timestamp:s||pn(),discarded_events:r}]]));var r,i,s;this._sendEnvelope(n)}}let ft;function $a(t,e=function(){if(ft)return ft;if(Jn(F.fetch))return ft=F.fetch.bind(F);const n=F.document;let r=F.fetch;if(n&&typeof n.createElement=="function")try{const i=n.createElement("iframe");i.hidden=!0,n.head.appendChild(i);const s=i.contentWindow;s&&s.fetch&&(r=s.fetch),n.head.removeChild(i)}catch(i){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",i)}return ft=r.bind(F)}()){let n=0,r=0;return xa(t,function(i){const s=i.body.length;n+=s,r++;const a={body:i.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:n<=6e4&&r<15,...t.fetchOptions};try{return e(t.url,a).then(c=>(n-=s,r--,{statusCode:c.status,headers:{"x-sentry-rate-limits":c.headers.get("X-Sentry-Rate-Limits"),"retry-after":c.headers.get("Retry-After")}}))}catch(c){return ft=void 0,n-=s,r--,nn(c)}})}class xe{static __initStatic(){this.id="GlobalHandlers"}__init(){this.name=xe.id}__init2(){this._installFunc={onerror:Ga,onunhandledrejection:za}}constructor(e){xe.prototype.__init.call(this),xe.prototype.__init2.call(this),this._options={onerror:!0,onunhandledrejection:!0,...e}}setupOnce(){Error.stackTraceLimit=50;const e=this._options;for(const r in e){const i=this._installFunc[r];i&&e[r]&&(n=r,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log(`Global Handler attached: ${n}`),i(),this._installFunc[r]=void 0)}var n}}function Ga(){Ue("error",t=>{const[e,n,r]=oo();if(!e.getIntegration(xe))return;const{msg:i,url:s,line:a,column:c,error:l}=t;if(no()||l&&l.__sentry_own_request__)return;const p=l===void 0&&Ge(i)?function(h,f,_,k){const y=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let w=fr(h)?h.message:h,T="Error";const M=w.match(y);return M&&(T=M[1],w=M[2]),Li({exception:{values:[{type:T,value:w}]}},f,_,k)}(i,s,a,c):Li(Sr(n,l||i,void 0,r,!1),s,a,c);p.level="error",so(e,l,p,"onerror")})}function za(){Ue("unhandledrejection",t=>{const[e,n,r]=oo();if(!e.getIntegration(xe))return;let i=t;try{"reason"in t?i=t.reason:"detail"in t&&"reason"in t.detail&&(i=t.detail.reason)}catch{}if(no()||i&&i.__sentry_own_request__)return!0;const s=Vs(i)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(i)}`}]}}:Sr(n,i,void 0,r,!0);s.level="error",so(e,i,s,"onunhandledrejection")})}function Li(t,e,n,r){const i=t.exception=t.exception||{},s=i.values=i.values||[],a=s[0]=s[0]||{},c=a.stacktrace=a.stacktrace||{},l=c.frames=c.frames||[],p=isNaN(parseInt(r,10))?void 0:r,h=isNaN(parseInt(n,10))?void 0:n,f=Ge(e)&&e.length>0?e:function(){try{return la.document.location.href}catch{return""}}();return l.length===0&&l.push({colno:p,filename:f,function:"?",in_app:!0,lineno:h}),t}function so(t,e,n,r){kt(n,{handled:!1,type:r}),t.captureEvent(n,{originalException:e})}function oo(){const t=ee(),e=t.getClient(),n=e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[t,n.stackParser,n.attachStacktrace]}xe.__initStatic();const Ya=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"];class Mt{static __initStatic(){this.id="TryCatch"}__init(){this.name=Mt.id}constructor(e){Mt.prototype.__init.call(this),this._options={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e}}setupOnce(){this._options.setTimeout&&z(F,"setTimeout",Ni),this._options.setInterval&&z(F,"setInterval",Ni),this._options.requestAnimationFrame&&z(F,"requestAnimationFrame",Ha),this._options.XMLHttpRequest&&"XMLHttpRequest"in F&&z(XMLHttpRequest.prototype,"send",Wa);const e=this._options.eventTarget;e&&(Array.isArray(e)?e:Ya).forEach(Qa)}}function Ni(t){return function(...e){const n=e[0];return e[0]=ct(n,{mechanism:{data:{function:De(t)},handled:!0,type:"instrument"}}),t.apply(this,e)}}function Ha(t){return function(e){return t.apply(this,[ct(e,{mechanism:{data:{function:"requestAnimationFrame",handler:De(t)},handled:!0,type:"instrument"}})])}}function Wa(t){return function(...e){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(r=>{r in n&&typeof n[r]=="function"&&z(n,r,function(i){const s={mechanism:{data:{function:r,handler:De(i)},handled:!0,type:"instrument"}},a=yr(i);return a&&(s.mechanism.data.handler=De(a)),ct(i,s)})}),t.apply(this,e)}}function Qa(t){const e=F,n=e[t]&&e[t].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(z(n,"addEventListener",function(r){return function(i,s,a){try{typeof s.handleEvent=="function"&&(s.handleEvent=ct(s.handleEvent,{mechanism:{data:{function:"handleEvent",handler:De(s),target:t},handled:!0,type:"instrument"}}))}catch{}return r.apply(this,[i,ct(s,{mechanism:{data:{function:"addEventListener",handler:De(s),target:t},handled:!0,type:"instrument"}}),a])}}),z(n,"removeEventListener",function(r){return function(i,s,a){const c=s;try{const l=c&&c.__sentry_wrapped__;l&&r.call(this,i,l,a)}catch{}return r.call(this,i,c,a)}}))}Mt.__initStatic();class nt{static __initStatic(){this.id="LinkedErrors"}__init(){this.name=nt.id}constructor(e={}){nt.prototype.__init.call(this),this._key=e.key||"cause",this._limit=e.limit||5}setupOnce(e,n){e((r,i)=>{const s=n(),a=s.getClient(),c=s.getIntegration(nt);if(!a||!c)return r;const l=a.getOptions();return ca(ro,l.stackParser,l.maxValueLength,c._key,c._limit,r,i),r})}}nt.__initStatic();class rt{constructor(){rt.prototype.__init.call(this)}static __initStatic(){this.id="HttpContext"}__init(){this.name=rt.id}setupOnce(){Zs(e=>{if(ee().getIntegration(rt)){if(!F.navigator&&!F.location&&!F.document)return e;const n=e.request&&e.request.url||F.location&&F.location.href,{referrer:r}=F.document||{},{userAgent:i}=F.navigator||{},s={...e.request&&e.request.headers,...r&&{Referer:r},...i&&{"User-Agent":i}},a={...e.request,...n&&{url:n},headers:s};return{...e,request:a}}return e})}}rt.__initStatic();class it{constructor(){it.prototype.__init.call(this)}static __initStatic(){this.id="Dedupe"}__init(){this.name=it.id}setupOnce(e,n){const r=i=>{if(i.type)return i;const s=n().getIntegration(it);if(s){try{if(function(a,c){return c?!!(function(l,p){const h=l.message,f=p.message;return!(!h&&!f||h&&!f||!h&&f||h!==f||!Ii(l,p)||!ji(l,p))}(a,c)||function(l,p){const h=Bi(p),f=Bi(l);return!(!h||!f||h.type!==f.type||h.value!==f.value||!Ii(l,p)||!ji(l,p))}(a,c)):!1}(i,s._previousEvent))return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{return s._previousEvent=i}return s._previousEvent=i}return i};r.id=this.name,e(r)}}function ji(t,e){let n=Fi(t),r=Fi(e);if(!n&&!r)return!0;if(n&&!r||!n&&r||r.length!==n.length)return!1;for(let i=0;i<r.length;i++){const s=r[i],a=n[i];if(s.filename!==a.filename||s.lineno!==a.lineno||s.colno!==a.colno||s.function!==a.function)return!1}return!0}function Ii(t,e){let n=t.fingerprint,r=e.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return n.join("")===r.join("")}catch{return!1}}function Bi(t){return t.exception&&t.exception.values&&t.exception.values[0]}function Fi(t){const e=t.exception;if(e)try{return e.values[0].stacktrace.frames}catch{return}}it.__initStatic();var Ka=Object.freeze({__proto__:null,Breadcrumbs:Ct,Dedupe:it,GlobalHandlers:xe,HttpContext:rt,LinkedErrors:nt,TryCatch:Mt});let ao={};F.Sentry&&F.Sentry.Integrations&&(ao=F.Sentry.Integrations);const Ui={...ao,...Na,...Ka};var qi="new",Ji="loading",Vi="loaded",Kn="joining-meeting",Ke="joined-meeting",Ie="left-meeting",Te="error",Cn="unknown",Xa="full",Za="base",ec="*",tc="iframe-ready-for-launch-config",nc="iframe-launch-config",rc="theme-updated",ic="loading",sc="load-attempt-failed",$i="loaded",oc="started-camera",ac="camera-error",cc="joining-meeting",lc="joined-meeting",uc="left-meeting",dc="participant-joined",hc="participant-updated",pc="participant-left",fc="participant-counts-updated",mc="access-state-updated",gc="meeting-session-summary-updated",vc="meeting-session-state-updated",yc="waiting-participant-added",_c="waiting-participant-updated",bc="waiting-participant-removed",wc="track-started",Sc="track-stopped",kc="transcription-started",Ec="transcription-stopped",Tc="transcription-error",Gi="recording-started",zi="recording-stopped",Cc="recording-stats",Mc="recording-error",Oc="recording-upload-completed",Pc="recording-data",Ac="app-message",Rc="transcription-message",xc="remote-media-player-started",Dc="remote-media-player-updated",Lc="remote-media-player-stopped",Nc="local-screen-share-started",jc="local-screen-share-stopped",Ic="local-screen-share-canceled",Bc="active-speaker-change",Fc="active-speaker-mode-change",Uc="network-quality-change",qc="network-connection",Jc="cpu-load-change",Vc="face-counts-updated",qt="fullscreen",Jt="exited-fullscreen",$c="live-streaming-started",Gc="live-streaming-updated",zc="live-streaming-stopped",Yc="live-streaming-error",Hc="lang-updated",Wc="receive-settings-updated",Qc="input-settings-updated",Yi="nonfatal-error",Hi="error",Wi=102400,Mn="iframe-call-message",Qi="local-screen-start",Ki="daily-method-update-live-streaming-endpoints",Vt="transmit-log",yt="daily-custom-track",Ht={NONE:"none",BGBLUR:"background-blur",BGIMAGE:"background-image",FACE_DETECTION:"face-detection"},co={NONE:"none",NOISE_CANCELLATION:"noise-cancellation"},Xn={PLAY:"play",PAUSE:"pause"},Xi=10,On=["jpg","png","jpeg"],Kc="add-endpoints",Xc="remove-endpoints",Zi="sip-call-transfer";function de(){return!N()&&typeof window<"u"&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:""}function N(){return typeof navigator<"u"&&navigator.product&&navigator.product==="ReactNative"}function lo(){return navigator&&navigator.mediaDevices&&navigator.mediaDevices.getUserMedia}function Zc(){return!!(navigator&&navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia)&&(function(t,e){if(!t||!e)return!0;switch(t){case"Chrome":return e.major>=75;case"Safari":return RTCRtpTransceiver.prototype.hasOwnProperty("currentDirection")&&!(e.major===13&&e.minor===0&&e.point===0);case"Firefox":return e.major>=67}return!0}(He(),er())||N())}function es(){if(N()||!document)return!1;var t=document.createElement("iframe");return!!t.requestFullscreen||!!t.webkitRequestFullscreen}var el=function(){try{var t=document.createElement("canvas"),e=t.getContext("webgl2")!=null;return t.remove(),e}catch{return!1}}();function uo(){var t=arguments.length>0&&arguments[0]!==void 0&&arguments[0];return!N()&&!!el&&(t?function(){return Zn()?!1:["Chrome","Firefox"].includes(He())}():function(){if(Zn())return!1;var e=He();if(e==="Safari"){var n=Er();if(n.major<15||n.major===15&&n.minor<4)return!1}return e==="Chrome"?kr().major>=77:e==="Firefox"?Tr().major>=97:["Chrome","Firefox","Safari"].includes(e)}())}var tl=["Chrome","Firefox"];function ho(){return!N()&&!Zn()&&typeof AudioWorkletNode<"u"&&tl.includes(He())}function ts(){return lo()&&!function(){var t,e=He();if(!de())return!0;switch(e){case"Chrome":return(t=kr()).major&&t.major>0&&t.major<75;case"Firefox":return(t=Tr()).major<91;case"Safari":return(t=Er()).major<13||t.major===13&&t.minor<1;default:return!0}}()}function Zn(){var t,e,n=de(),r=n.match(/Mac/)&&(!N()&&typeof window<"u"&&(t=window)!==null&&t!==void 0&&(e=t.navigator)!==null&&e!==void 0&&e.maxTouchPoints?window.navigator.maxTouchPoints:0)>=5;return!!(n.match(/Mobi/)||n.match(/Android/)||r)||!!de().match(/DailyAnd\//)||void 0}function He(){if(typeof window<"u"){var t=de();return po()?"Safari":t.indexOf("Edge")>-1?"Edge":t.match(/Chrome\//)?"Chrome":t.indexOf("Safari")>-1?"Safari":t.indexOf("Firefox")>-1?"Firefox":t.indexOf("MSIE")>-1||t.indexOf(".NET")>-1?"IE":"Unknown Browser"}}function er(){switch(He()){case"Chrome":return kr();case"Safari":return Er();case"Firefox":return Tr();case"Edge":return function(){var t=0,e=0;if(typeof window<"u"){var n=de().match(/Edge\/(\d+).(\d+)/);if(n)try{t=parseInt(n[1]),e=parseInt(n[2])}catch{}}return{major:t,minor:e}}()}}function kr(){var t=0,e=0,n=0,r=0,i=!1;if(typeof window<"u"){var s=de(),a=s.match(/Chrome\/(\d+).(\d+).(\d+).(\d+)/);if(a)try{t=parseInt(a[1]),e=parseInt(a[2]),n=parseInt(a[3]),r=parseInt(a[4]),i=s.indexOf("OPR/")>-1}catch{}}return{major:t,minor:e,build:n,patch:r,opera:i}}function po(){return!!de().match(/iPad|iPhone|iPod/i)&&lo()}function Er(){var t=0,e=0,n=0;if(typeof window<"u"){var r=de().match(/Version\/(\d+).(\d+)(.(\d+))?/);if(r)try{t=parseInt(r[1]),e=parseInt(r[2]),n=parseInt(r[4])}catch{}else po()&&(t=14,e=0,n=3)}return{major:t,minor:e,point:n}}function Tr(){var t=0,e=0;if(typeof window<"u"){var n=de().match(/Firefox\/(\d+).(\d+)/);if(n)try{t=parseInt(n[1]),e=parseInt(n[2])}catch{}}return{major:t,minor:e}}var fo=function(){function t(){he(this,t)}return pe(t,[{key:"addListenerForMessagesFromCallMachine",value:function(e,n,r){pt()}},{key:"addListenerForMessagesFromDailyJs",value:function(e,n,r){pt()}},{key:"sendMessageToCallMachine",value:function(e,n,r,i){pt()}},{key:"sendMessageToDailyJs",value:function(e,n){pt()}},{key:"removeListener",value:function(e){pt()}}]),t}();function ns(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Pn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ns(Object(n),!0).forEach(function(r){Oe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ns(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function nl(t){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var n,r=ue(t);if(e){var i=ue(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return un(this,n)}}var rl=function(t){ln(n,fo);var e=nl(n);function n(){var r;return he(this,n),(r=e.call(this))._wrappedListeners={},r._messageCallbacks={},r}return pe(n,[{key:"addListenerForMessagesFromCallMachine",value:function(r,i,s){var a=this,c=function(l){if(l.data&&l.data.what==="iframe-call-message"&&(!l.data.callClientId||l.data.callClientId===i)&&(!l.data.from||l.data.from!=="module")){var p=Pn({},l.data);if(delete p.from,p.callbackStamp&&a._messageCallbacks[p.callbackStamp]){var h=p.callbackStamp;a._messageCallbacks[h].call(s,p),delete a._messageCallbacks[h]}delete p.what,delete p.callbackStamp,r.call(s,p)}};this._wrappedListeners[r]=c,window.addEventListener("message",c)}},{key:"addListenerForMessagesFromDailyJs",value:function(r,i,s){var a=function(c){var l;if(!(!c.data||c.data.what!==Mn||!c.data.action||c.data.from&&c.data.from!=="module"||c.data.callClientId&&i&&c.data.callClientId!==i||c!=null&&(l=c.data)!==null&&l!==void 0&&l.callFrameId)){var p=c.data;r.call(s,p)}};this._wrappedListeners[r]=a,window.addEventListener("message",a)}},{key:"sendMessageToCallMachine",value:function(r,i,s,a){if(!a)throw new Error("undefined callClientId. Are you trying to use a DailyCall instance previously destroyed?");var c=Pn({},r);if(c.what=Mn,c.from="module",c.callClientId=a,i){var l=dn();this._messageCallbacks[l]=i,c.callbackStamp=l}var p=s?s.contentWindow:window,h=this._callMachineTargetOrigin(s);h&&p.postMessage(c,h)}},{key:"sendMessageToDailyJs",value:function(r,i){r.what=Mn,r.callClientId=i,r.from="embedded",window.postMessage(r,this._targetOriginFromWindowLocation())}},{key:"removeListener",value:function(r){var i=this._wrappedListeners[r];i&&(window.removeEventListener("message",i),delete this._wrappedListeners[r])}},{key:"forwardPackagedMessageToCallMachine",value:function(r,i,s){var a=Pn({},r);a.callClientId=s;var c=i?i.contentWindow:window,l=this._callMachineTargetOrigin(i);l&&c.postMessage(a,l)}},{key:"addListenerForPackagedMessagesFromCallMachine",value:function(r,i){var s=function(a){if(a.data&&a.data.what==="iframe-call-message"&&(!a.data.callClientId||a.data.callClientId===i)&&(!a.data.from||a.data.from!=="module")){var c=a.data;r(c)}};return this._wrappedListeners[r]=s,window.addEventListener("message",s),r}},{key:"removeListenerForPackagedMessagesFromCallMachine",value:function(r){var i=this._wrappedListeners[r];i&&(window.removeEventListener("message",i),delete this._wrappedListeners[r])}},{key:"_callMachineTargetOrigin",value:function(r){return r?r.src?new URL(r.src).origin:void 0:this._targetOriginFromWindowLocation()}},{key:"_targetOriginFromWindowLocation",value:function(){return window.location.protocol==="file:"?"*":window.location.origin}}]),n}();function il(t){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var n,r=ue(t);if(e){var i=ue(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return un(this,n)}}var sl=function(t){ln(n,fo);var e=il(n);function n(){var r;return he(this,n),r=e.call(this),global.callMachineToDailyJsEmitter=global.callMachineToDailyJsEmitter||new ke.EventEmitter,global.dailyJsToCallMachineEmitter=global.dailyJsToCallMachineEmitter||new ke.EventEmitter,r._wrappedListeners={},r._messageCallbacks={},r}return pe(n,[{key:"addListenerForMessagesFromCallMachine",value:function(r,i,s){this._addListener(r,global.callMachineToDailyJsEmitter,s,"received call machine message")}},{key:"addListenerForMessagesFromDailyJs",value:function(r,i,s){this._addListener(r,global.dailyJsToCallMachineEmitter,s,"received daily-js message")}},{key:"sendMessageToCallMachine",value:function(r,i){this._sendMessage(r,global.dailyJsToCallMachineEmitter,"sending message to call machine",i)}},{key:"sendMessageToDailyJs",value:function(r){this._sendMessage(r,global.callMachineToDailyJsEmitter,"sending message to daily-js")}},{key:"removeListener",value:function(r){var i=this._wrappedListeners[r];i&&(global.callMachineToDailyJsEmitter.removeListener("message",i),global.dailyJsToCallMachineEmitter.removeListener("message",i),delete this._wrappedListeners[r])}},{key:"_addListener",value:function(r,i,s,a){var c=this,l=function(p){if(p.callbackStamp&&c._messageCallbacks[p.callbackStamp]){var h=p.callbackStamp;c._messageCallbacks[h].call(s,p),delete c._messageCallbacks[h]}r.call(s,p)};this._wrappedListeners[r]=l,i.addListener("message",l)}},{key:"_sendMessage",value:function(r,i,s,a){if(a){var c=dn();this._messageCallbacks[c]=a,r.callbackStamp=c}i.emit("message",r)}}]),n}(),tr="replace",nr="shallow-merge",rs=[tr,nr],ol=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.data,r=e.mergeStrategy,i=r===void 0?tr:r;he(this,t),t._validateMergeStrategy(i),t._validateData(n,i),this.mergeStrategy=i,this.data=n}return pe(t,[{key:"isNoOp",value:function(){return t.isNoOpUpdate(this.data,this.mergeStrategy)}}],[{key:"isNoOpUpdate",value:function(e,n){return Object.keys(e).length===0&&n===nr}},{key:"_validateMergeStrategy",value:function(e){if(!rs.includes(e))throw Error("Unrecognized mergeStrategy provided. Options are: [".concat(rs,"]"))}},{key:"_validateData",value:function(e,n){if(!function(c){if(c==null||U(c)!=="object")return!1;var l=Object.getPrototypeOf(c);return l==null||l===Object.prototype}(e))throw Error("Meeting session data must be a plain (map-like) object");var r;try{if(r=JSON.stringify(e),n===tr){var i=JSON.parse(r);K(i,e)||console.warn("The meeting session data provided will be modified when serialized.",i,e)}else if(n===nr){for(var s in e)if(Object.hasOwnProperty.call(e,s)&&e[s]!==void 0){var a=JSON.parse(JSON.stringify(e[s]));K(e[s],a)||console.warn("At least one key in the meeting session data provided will be modified when serialized.",a,e[s])}}}catch(c){throw Error("Meeting session data must be serializable to JSON: ".concat(c))}if(r.length>Wi)throw Error("Meeting session data is too large (".concat(r.length," characters). Maximum size suppported is ").concat(Wi,"."))}}]),t}();function rr(t,e,n){return rr=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}()?Reflect.construct.bind():function(r,i,s){var a=[null];a.push.apply(a,i);var c=new(Function.bind.apply(r,a));return s&&wt(c,s.prototype),c},rr.apply(null,arguments)}function ir(t){var e=typeof Map=="function"?new Map:void 0;return ir=function(n){if(n===null||(r=n,Function.toString.call(r).indexOf("[native code]")===-1))return n;var r;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return rr(n,arguments,ue(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),wt(i,n)},ir(t)}function al(t){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var n,r=ue(t);if(e){var i=ue(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return un(this,n)}}function is(t){var e,n=(e=window._daily)===null||e===void 0?void 0:e.pendings;if(n){var r=n.indexOf(t);r!==-1&&n.splice(r,1)}}var cl=function(){function t(e){he(this,t),this._currentLoad=null,this._callClientId=e}return pe(t,[{key:"load",value:function(){var e,n=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0,s=arguments.length>2?arguments[2]:void 0;if(this.loaded)return window._daily.instances[this._callClientId].callMachine.reset(),void i(!0);e=this._callClientId,window._daily.pendings.push(e),this._currentLoad&&this._currentLoad.cancel(),this._currentLoad=new ll(r,function(){i(!1)},function(a,c){c||is(n._callClientId),s(a,c)}),this._currentLoad.start()}},{key:"cancel",value:function(){this._currentLoad&&this._currentLoad.cancel(),is(this._callClientId)}},{key:"loaded",get:function(){return this._currentLoad&&this._currentLoad.succeeded}}]),t}(),ll=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;he(this,t),this._attemptsRemaining=3,this._currentAttempt=null,this._dailyConfig=e,this._successCallback=n,this._failureCallback=r}return pe(t,[{key:"start",value:function(){var e=this;this._currentAttempt||(this._currentAttempt=new ss(this._dailyConfig,this._successCallback,function n(r){e._currentAttempt.cancelled||(e._attemptsRemaining--,e._failureCallback(r,e._attemptsRemaining>0),e._attemptsRemaining<=0||setTimeout(function(){e._currentAttempt.cancelled||(e._currentAttempt=new ss(e._dailyConfig,e._successCallback,n),e._currentAttempt.start())},3e3))}),this._currentAttempt.start())}},{key:"cancel",value:function(){this._currentAttempt&&this._currentAttempt.cancel()}},{key:"cancelled",get:function(){return this._currentAttempt&&this._currentAttempt.cancelled}},{key:"succeeded",get:function(){return this._currentAttempt&&this._currentAttempt.succeeded}}]),t}(),An=function(t){ln(n,ir(Error));var e=al(n);function n(){return he(this,n),e.apply(this,arguments)}return pe(n)}(),sn=2e4,ss=function(){function t(n,r,i){he(this,t),this._loadAttemptImpl=N()||!n.avoidEval?new ul(n,r,i):new dl(n,r,i)}var e;return pe(t,[{key:"start",value:(e=O(function*(){return this._loadAttemptImpl.start()}),function(){return e.apply(this,arguments)})},{key:"cancel",value:function(){this._loadAttemptImpl.cancel()}},{key:"cancelled",get:function(){return this._loadAttemptImpl.cancelled}},{key:"succeeded",get:function(){return this._loadAttemptImpl.succeeded}}]),t}(),ul=function(){function t(s,a,c){he(this,t),this.cancelled=!1,this.succeeded=!1,this._networkTimedOut=!1,this._networkTimeout=null,this._iosCache=typeof iOSCallObjectBundleCache<"u"&&iOSCallObjectBundleCache,this._refetchHeaders=null,this._dailyConfig=s,this._successCallback=a,this._failureCallback=c}var e,n,r,i;return pe(t,[{key:"start",value:(i=O(function*(){var s=Xt(this._dailyConfig);!(yield this._tryLoadFromIOSCache(s))&&this._loadFromNetwork(s)}),function(){return i.apply(this,arguments)})},{key:"cancel",value:function(){clearTimeout(this._networkTimeout),this.cancelled=!0}},{key:"_tryLoadFromIOSCache",value:(r=O(function*(s){if(!this._iosCache)return!1;try{var a=yield this._iosCache.get(s);return!!this.cancelled||!!a&&(a.code?(Function('"use strict";'+a.code)(),this.succeeded=!0,this._successCallback(),!0):(this._refetchHeaders=a.refetchHeaders,!1))}catch{return!1}}),function(s){return r.apply(this,arguments)})},{key:"_loadFromNetwork",value:(n=O(function*(s){var a=this;this._networkTimeout=setTimeout(function(){a._networkTimedOut=!0,a._failureCallback({msg:"Timed out (>".concat(sn," ms) when loading call object bundle ").concat(s),type:"timeout"})},sn);try{var c=this._refetchHeaders?{headers:this._refetchHeaders}:{},l=yield fetch(s,c);if(clearTimeout(this._networkTimeout),this.cancelled||this._networkTimedOut)throw new An;var p=yield this._getBundleCodeFromResponse(s,l);if(this.cancelled)throw new An;Function('"use strict";'+p)(),this._iosCache&&this._iosCache.set(s,p,l.headers),this.succeeded=!0,this._successCallback()}catch(h){if(clearTimeout(this._networkTimeout),h instanceof An||this.cancelled||this._networkTimedOut)return;this._failureCallback({msg:"Failed to load call object bundle ".concat(s,": ").concat(h),type:h.message})}}),function(s){return n.apply(this,arguments)})},{key:"_getBundleCodeFromResponse",value:(e=O(function*(s,a){if(a.ok)return yield a.text();if(this._iosCache&&a.status===304)return(yield this._iosCache.renew(s,a.headers)).code;throw new Error("Received ".concat(a.status," response"))}),function(s,a){return e.apply(this,arguments)})}]),t}(),dl=function(){function t(e,n,r){he(this,t),this.cancelled=!1,this.succeeded=!1,this._dailyConfig=e,this._successCallback=n,this._failureCallback=r,this._attemptId=dn(),this._networkTimeout=null,this._scriptElement=null}return pe(t,[{key:"start",value:function(){window._dailyCallMachineLoadWaitlist||(window._dailyCallMachineLoadWaitlist=new Set);var e=Xt(this._dailyConfig);(typeof document>"u"?"undefined":U(document))==="object"?this._startLoading(e):this._failureCallback({msg:"Call object bundle must be loaded in a DOM/web context",type:"missing context"})}},{key:"cancel",value:function(){this._stopLoading(),this.cancelled=!0}},{key:"_startLoading",value:function(e){var n=this;this._signUpForCallMachineLoadWaitlist(),this._networkTimeout=setTimeout(function(){n._stopLoading(),n._failureCallback({msg:"Timed out (>".concat(sn," ms) when loading call object bundle ").concat(e),type:"timeout"})},sn);var r=document.getElementsByTagName("head")[0],i=document.createElement("script");this._scriptElement=i,i.onload=function(){n._stopLoading(),n.succeeded=!0,n._successCallback()},i.onerror=function(s){n._stopLoading(),n._failureCallback({msg:"Failed to load call object bundle ".concat(s.target.src),type:s.message})},i.src=e,r.appendChild(i)}},{key:"_stopLoading",value:function(){this._withdrawFromCallMachineLoadWaitlist(),clearTimeout(this._networkTimeout),this._scriptElement&&(this._scriptElement.onload=null,this._scriptElement.onerror=null)}},{key:"_signUpForCallMachineLoadWaitlist",value:function(){window._dailyCallMachineLoadWaitlist.add(this._attemptId)}},{key:"_withdrawFromCallMachineLoadWaitlist",value:function(){window._dailyCallMachineLoadWaitlist.delete(this._attemptId)}}]),t}(),$t=function(t,e,n){return pl(t.local,e,n)===!0},hl=function(t,e,n){return t.local.streams&&t.local.streams[e]&&t.local.streams[e].stream&&t.local.streams[e].stream["get".concat(n==="video"?"Video":"Audio","Tracks")]()[0]},Xe=function(t,e,n,r){var i=fl(t,e,n,r);return i&&i.pendingTrack},pl=function(t,e,n){if(!t)return!1;var r=function(s){switch(s){case"avatar":return!0;case"staged":return s;default:return!!s}},i=t.public.subscribedTracks;return i&&i[e]?["cam-audio","cam-video","screen-video","screen-audio","rmpAudio","rmpVideo"].indexOf(n)===-1&&i[e].custom?[!0,"staged"].includes(i[e].custom)?r(i[e].custom):r(i[e].custom[n]):r(i[e][n]):!i||r(i.ALL)},fl=function(t,e,n,r){var i=Object.values(t.streams||{}).filter(function(s){return s.participantId===e&&s.type===n&&s.pendingTrack&&s.pendingTrack.kind===r}).sort(function(s,a){return new Date(a.starttime)-new Date(s.starttime)});return i&&i[0]},ml=function(t,e){var n=t.local.public.customTracks;if(n&&n[e])return n[e].track};function os(t,e){for(var n=e.getState(),r=0,i=["cam","screen"];r<i.length;r++)for(var s=i[r],a=0,c=["video","audio"];a<c.length;a++){var l=c[a],p=s==="cam"?l:"screen".concat(l.charAt(0).toUpperCase()+l.slice(1)),h=t.tracks[p];if(h){var f=t.local?hl(n,s,l):Xe(n,t.session_id,s,l);h.state==="playable"&&(h.track=f),h.persistentTrack=f}}}function as(t,e){try{var n=e.getState();for(var r in t.tracks)if(!gl(r)){var i=t.tracks[r].kind;if(i){var s=t.tracks[r];if(s){var a=t.local?ml(n,r):Xe(n,t.session_id,r,i);s.state==="playable"&&(t.tracks[r].track=a),s.persistentTrack=a}}else console.error("unknown type for custom track")}}catch(c){console.error(c)}}function gl(t){return["video","audio","screenVideo","screenAudio"].includes(t)}function cs(t,e,n){var r=n.getState();if(t.local){if(t.audio)try{t.audioTrack=r.local.streams.cam.stream.getAudioTracks()[0],t.audioTrack||(t.audio=!1)}catch{}if(t.video)try{t.videoTrack=r.local.streams.cam.stream.getVideoTracks()[0],t.videoTrack||(t.video=!1)}catch{}if(t.screen)try{t.screenVideoTrack=r.local.streams.screen.stream.getVideoTracks()[0],t.screenAudioTrack=r.local.streams.screen.stream.getAudioTracks()[0],t.screenVideoTrack||t.screenAudioTrack||(t.screen=!1)}catch{}}else{var i=!0;try{var s=r.participants[t.session_id];s&&s.public&&s.public.rtcType&&s.public.rtcType.impl==="peer-to-peer"&&s.private&&!["connected","completed"].includes(s.private.peeringState)&&(i=!1)}catch(h){console.error(h)}if(!i)return t.audio=!1,t.audioTrack=!1,t.video=!1,t.videoTrack=!1,t.screen=!1,void(t.screenTrack=!1);try{if(r.streams,t.audio&&$t(r,t.session_id,"cam-audio")){var a=Xe(r,t.session_id,"cam","audio");a&&(e&&e.audioTrack&&e.audioTrack.id===a.id?t.audioTrack=a:a.muted||(t.audioTrack=a)),t.audioTrack||(t.audio=!1)}if(t.video&&$t(r,t.session_id,"cam-video")){var c=Xe(r,t.session_id,"cam","video");c&&(e&&e.videoTrack&&e.videoTrack.id===c.id?t.videoTrack=c:c.muted||(t.videoTrack=c)),t.videoTrack||(t.video=!1)}if(t.screen&&$t(r,t.session_id,"screen-audio")){var l=Xe(r,t.session_id,"screen","audio");l&&(e&&e.screenAudioTrack&&e.screenAudioTrack.id===l.id?t.screenAudioTrack=l:l.muted||(t.screenAudioTrack=l))}if(t.screen&&$t(r,t.session_id,"screen-video")){var p=Xe(r,t.session_id,"screen","video");p&&(e&&e.screenVideoTrack&&e.screenVideoTrack.id===p.id?t.screenVideoTrack=p:p.muted||(t.screenVideoTrack=p))}t.screenVideoTrack||t.screenAudioTrack||(t.screen=!1)}catch(h){console.error("unexpected error matching up tracks",h)}}}function vl(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(l,p){if(l){if(typeof l=="string")return ls(l,p);var h=Object.prototype.toString.call(l).slice(8,-1);if(h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set")return Array.from(l);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return ls(l,p)}}(t))||e){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
24
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,a=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var l=n.next();return a=l.done,l},e:function(l){c=!0,s=l},f:function(){try{a||n.return==null||n.return()}finally{if(c)throw s}}}}function ls(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var ge=new Map,st=null;function yl(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(l,p){if(l){if(typeof l=="string")return us(l,p);var h=Object.prototype.toString.call(l).slice(8,-1);if(h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set")return Array.from(l);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return us(l,p)}}(t))||e){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
25
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,a=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var l=n.next();return a=l.done,l},e:function(l){c=!0,s=l},f:function(){try{a||n.return==null||n.return()}finally{if(c)throw s}}}}function us(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var ve=new Map,bt=null,_l=3e3;function bl(t){mo()?function(e){ge.has(e)||(ge.set(e,{}),navigator.mediaDevices.enumerateDevices().then(function(n){ge.has(e)&&(ge.get(e).lastDevicesString=JSON.stringify(n),st||(st=function(){var r=O(function*(){var i,s=yield navigator.mediaDevices.enumerateDevices(),a=vl(ge.keys());try{for(a.s();!(i=a.n()).done;){var c=i.value,l=JSON.stringify(s);l!==ge.get(c).lastDevicesString&&(ge.get(c).lastDevicesString=l,c(s))}}catch(p){a.e(p)}finally{a.f()}});return function(){return r.apply(this,arguments)}}(),navigator.mediaDevices.addEventListener("devicechange",st)))}).catch(function(){}))}(t):function(e){ve.has(e)||(ve.set(e,{}),navigator.mediaDevices.enumerateDevices().then(function(n){ve.has(e)&&(ve.get(e).lastDevicesString=JSON.stringify(n),bt||(bt=setInterval(O(function*(){var r,i=yield navigator.mediaDevices.enumerateDevices(),s=yl(ve.keys());try{for(s.s();!(r=s.n()).done;){var a=r.value,c=JSON.stringify(i);c!==ve.get(a).lastDevicesString&&(ve.get(a).lastDevicesString=c,a(i))}}catch(l){s.e(l)}finally{s.f()}}),_l)))}))}(t)}function wl(t){mo()?function(e){ge.has(e)&&(ge.delete(e),ge.size===0&&st&&(navigator.mediaDevices.removeEventListener("devicechange",st),st=null))}(t):function(e){ve.has(e)&&(ve.delete(e),ve.size===0&&bt&&(clearInterval(bt),bt=null))}(t)}function mo(){return N()||navigator.mediaDevices.ondevicechange!==void 0}var Sl=new Set;function kl(t,e){return t&&t.readyState==="live"&&!function(n,r){return n.muted&&!Sl.has(n.id)}(t)}var El=["result"],Tl=["preserveIframe"];function ds(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function P(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ds(Object(n),!0).forEach(function(r){Oe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ds(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Cl(t){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var n,r=ue(t);if(e){var i=ue(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return un(this,n)}}function hs(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(l,p){if(l){if(typeof l=="string")return ps(l,p);var h=Object.prototype.toString.call(l).slice(8,-1);if(h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set")return Array.from(l);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return ps(l,p)}}(t))||e){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
26
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,a=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var l=n.next();return a=l.done,l},e:function(l){c=!0,s=l},f:function(){try{a||n.return==null||n.return()}finally{if(c)throw s}}}}function ps(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Be={},fs="video",Ml="voice",ms=N()?{data:{}}:{data:{},topology:"none"},gs={present:0,hidden:0},go={maxBitrate:{min:1e5,max:25e5},maxFramerate:{min:1,max:30},scaleResolutionDownBy:{min:1,max:8}},Rn=Object.keys(go),vs=["state","volume","simulcastEncodings"],ys={androidInCallNotification:{title:"string",subtitle:"string",iconName:"string",disableForCustomOverride:"boolean"},disableAutoDeviceManagement:{audio:"boolean",video:"boolean"}},on={id:{iconPath:"string",iconPathDarkMode:"string",label:"string",tooltip:"string"}},sr={id:{allow:"string",controlledBy:"'*' | 'owners' | string[]",csp:"string",iconURL:"string",label:"string",loading:"'eager' | 'lazy'",location:"'main' | 'sidebar'",name:"string",referrerPolicy:"string",sandbox:"string",src:"string",srcdoc:"string",shared:"string[] | 'owners' | boolean"}},Fe={customIntegrations:{validate:Eo,help:So()},customTrayButtons:{validate:ko,help:"customTrayButtons should be a dictionary of the type ".concat(JSON.stringify(on))},url:{validate:function(t){return typeof t=="string"},help:"url should be a string"},baseUrl:{validate:function(t){return typeof t=="string"},help:"baseUrl should be a string"},token:{validate:function(t){return typeof t=="string"},help:"token should be a string",queryString:"t"},dailyConfig:{validate:function(t,e){try{return e.validateDailyConfig(t),!0}catch(n){console.error("Failed to validate dailyConfig",n)}return!1},help:"Unsupported dailyConfig. Check error logs for detailed info."},reactNativeConfig:{validate:function(t){return To(t,ys)},help:"reactNativeConfig should look like ".concat(JSON.stringify(ys),", all fields optional")},lang:{validate:function(t){return["de","en-us","en","es","fi","fr","it","jp","ka","nl","no","pl","pt","pt-BR","ru","sv","tr","user"].includes(t)},help:"language not supported. Options are: de, en-us, en, es, fi, fr, it, jp, ka, nl, no, pl, pt, pt-BR, ru, sv, tr, user"},userName:!0,userData:{validate:function(t){try{return vo(t),!0}catch(e){return console.error(e),!1}},help:"invalid userData type provided"},startVideoOff:!0,startAudioOff:!0,activeSpeakerMode:!0,showLeaveButton:!0,showLocalVideo:!0,showParticipantsBar:!0,showFullscreenButton:!0,showUserNameChangeUI:!0,iframeStyle:!0,customLayout:!0,cssFile:!0,cssText:!0,bodyClass:!0,videoSource:{validate:function(t,e){return t instanceof MediaStreamTrack&&(e._sharedTracks.videoDeviceId=t),e._preloadCache.videoDeviceId=t,!0}},audioSource:{validate:function(t,e){return t instanceof MediaStreamTrack&&(e._sharedTracks.audioDeviceId=t),e._preloadCache.audioDeviceId=t,!0}},subscribeToTracksAutomatically:{validate:function(t,e){return e._preloadCache.subscribeToTracksAutomatically=t,!0}},theme:{validate:function(t){var e=["accent","accentText","background","backgroundAccent","baseText","border","mainAreaBg","mainAreaBgAccent","mainAreaText","supportiveText"],n=function(r){for(var i=0,s=Object.keys(r);i<s.length;i++){var a=s[i];if(!e.includes(a))return console.error('unsupported color "'.concat(a,'". Valid colors: ').concat(e.join(", "))),!1;if(!r[a].match(/^#[0-9a-f]{6}|#[0-9a-f]{3}$/i))return console.error("".concat(a,' theme color should be provided in valid hex color format. Received: "').concat(r[a],'"')),!1}return!0};return U(t)==="object"&&("light"in t&&"dark"in t||"colors"in t)?"light"in t&&"dark"in t?"colors"in t.light?"colors"in t.dark?n(t.light.colors)&&n(t.dark.colors):(console.error('Dark theme is missing "colors" property.',t),!1):(console.error('Light theme is missing "colors" property.',t),!1):n(t.colors):(console.error('Theme must contain either both "light" and "dark" properties, or "colors".',t),!1)},help:"unsupported theme configuration. Check error logs for detailed info."},layoutConfig:{validate:function(t){if("grid"in t){var e=t.grid;if("maxTilesPerPage"in e){if(!Number.isInteger(e.maxTilesPerPage))return console.error("grid.maxTilesPerPage should be an integer. You passed ".concat(e.maxTilesPerPage,".")),!1;if(e.maxTilesPerPage>49)return console.error("grid.maxTilesPerPage can't be larger than 49 without sacrificing browser performance. Please contact us at https://www.daily.co/contact to talk about your use case."),!1}if("minTilesPerPage"in e){if(!Number.isInteger(e.minTilesPerPage))return console.error("grid.minTilesPerPage should be an integer. You passed ".concat(e.minTilesPerPage,".")),!1;if(e.minTilesPerPage<1)return console.error("grid.minTilesPerPage can't be lower than 1."),!1;if("maxTilesPerPage"in e&&e.minTilesPerPage>e.maxTilesPerPage)return console.error("grid.minTilesPerPage can't be higher than grid.maxTilesPerPage."),!1}}return!0},help:"unsupported layoutConfig. Check error logs for detailed info."},receiveSettings:{validate:function(t){return yo(t,{allowAllParticipantsKey:!1})},help:wo({allowAllParticipantsKey:!1})},sendSettings:{validate:function(t,e){return!!function(n,r){try{return r.validateUpdateSendSettings(n),!0}catch(i){return console.error("Failed to validate send settings",i),!1}}(t,e)&&(e._preloadCache.sendSettings=t,!0)},help:"Invalid sendSettings provided. Check error logs for detailed info."},inputSettings:{validate:function(t,e){var n;return!!_o(t)&&(e._preloadCache.inputSettings||(e._preloadCache.inputSettings={}),bo(t,(n=e.properties)===null||n===void 0?void 0:n.dailyConfig),t.audio&&(e._preloadCache.inputSettings.audio=t.audio),t.video&&(e._preloadCache.inputSettings.video=t.video),!0)},help:or()},layout:{validate:function(t){return t==="custom-v1"||t==="browser"||t==="none"},help:'layout may only be set to "custom-v1"',queryString:"layout"},emb:{queryString:"emb"},embHref:{queryString:"embHref"},dailyJsVersion:{queryString:"dailyJsVersion"},proxy:{queryString:"proxy"},strictMode:!0,allowMultipleCallInstances:!0},Gt={styles:{validate:function(t){for(var e in t)if(e!=="cam"&&e!=="screen")return!1;if(t.cam){for(var n in t.cam)if(n!=="div"&&n!=="video")return!1}if(t.screen){for(var r in t.screen)if(r!=="div"&&r!=="video")return!1}return!0},help:"styles format should be a subset of: { cam: {div: {}, video: {}}, screen: {div: {}, video: {}} }"},setSubscribedTracks:{validate:function(t,e){if(e._preloadCache.subscribeToTracksAutomatically)return!1;var n=[!0,!1,"staged"];if(n.includes(t)||!N()&&t==="avatar")return!0;var r=["audio","video","screenAudio","screenVideo","rmpAudio","rmpVideo"];return function i(s){var a=arguments.length>1&&arguments[1]!==void 0&&arguments[1];for(var c in s)if(c==="custom"){if(!n.includes(s[c])&&!i(s[c],!0))return!1}else{var l=!a&&!r.includes(c),p=!n.includes(s[c]);if(l||p)return!1}return!0}(t)},help:"setSubscribedTracks cannot be used when setSubscribeToTracksAutomatically is enabled, and should be of the form: "+"true".concat(N()?"":" | 'avatar'"," | false | 'staged' | { [audio: true|false|'staged'], [video: true|false|'staged'], [screenAudio: true|false|'staged'], [screenVideo: true|false|'staged'] }")},setAudio:!0,setVideo:!0,setScreenShare:{validate:function(t){return t===!1},help:"setScreenShare must be false, as it's only meant for stopping remote participants' screen shares"},eject:!0,updatePermissions:{validate:function(t){for(var e=0,n=Object.entries(t);e<n.length;e++){var r=$e(n[e],2),i=r[0],s=r[1];switch(i){case"hasPresence":if(typeof s!="boolean")return!1;break;case"canSend":if(s instanceof Set||s instanceof Array||Array.isArray(s)){var a,c=["video","audio","screenVideo","screenAudio","customVideo","customAudio"],l=hs(s);try{for(l.s();!(a=l.n()).done;){var p=a.value;if(!c.includes(p))return!1}}catch(y){l.e(y)}finally{l.f()}}else if(typeof s!="boolean")return!1;(s instanceof Array||Array.isArray(s))&&(t.canSend=new Set(s));break;case"canAdmin":if(s instanceof Set||s instanceof Array||Array.isArray(s)){var h,f=["participants","streaming","transcription"],_=hs(s);try{for(_.s();!(h=_.n()).done;){var k=h.value;if(!f.includes(k))return!1}}catch(y){_.e(y)}finally{_.f()}}else if(typeof s!="boolean")return!1;(s instanceof Array||Array.isArray(s))&&(t.canAdmin=new Set(s));break;default:return!1}}return!0},help:"updatePermissions can take hasPresence, canSend, and canAdmin permissions. hasPresence must be a boolean. canSend can be a boolean or an Array or Set of media types (video, audio, screenVideo, screenAudio, customVideo, customAudio). canAdmin can be a boolean or an Array or Set of admin types (participants, streaming, transcription)."}};Promise.any||(Promise.any=function(){var t=O(function*(e){return new Promise(function(n,r){var i=[];e.forEach(function(s){return Promise.resolve(s).then(function(a){n(a)}).catch(function(a){i.push(a),i.length===e.length&&r(i)})})})});return function(e){return t.apply(this,arguments)}}());var Ol=function(t){ln(ne,ke);var e,n,r,i,s,a,c,l,p,h,f,_,k,y,w,T,M,B,L,te,Le,se,ye,ht,Rr,xr,Dr,Lr,Nr,jr,Ir,Br,Fr,Ur,qr,Jr,Vr,$r,Wo=Cl(ne);function ne(o){var u,d,g,m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(he(this,ne),Oe(we(d=Wo.call(this)),"startListeningForDeviceChanges",function(){bl(d.handleDeviceChange)}),Oe(we(d),"stopListeningForDeviceChanges",function(){wl(d.handleDeviceChange)}),Oe(we(d),"handleDeviceChange",function(E){E=E.map(function(C){return JSON.parse(JSON.stringify(C))}),d.emitDailyJSEvent({action:"available-devices-updated",availableDevices:E})}),Oe(we(d),"handleNativeAppStateChange",function(){var E=O(function*(C){if(C==="destroyed")return console.warn("App has been destroyed before leaving the meeting. Cleaning up all the resources!"),void(yield d.destroy());var x=C==="active";d.disableReactNativeAutoDeviceManagement("video")||(x?d.camUnmutedBeforeLosingNativeActiveState&&d.setLocalVideo(!0):(d.camUnmutedBeforeLosingNativeActiveState=d.localVideo(),d.camUnmutedBeforeLosingNativeActiveState&&d.setLocalVideo(!1)))});return function(C){return E.apply(this,arguments)}}()),Oe(we(d),"handleNativeAudioFocusChange",function(E){d.disableReactNativeAutoDeviceManagement("audio")||(d._hasNativeAudioFocus=E,d.toggleParticipantAudioBasedOnNativeAudioFocus(),d._hasNativeAudioFocus?d.micUnmutedBeforeLosingNativeAudioFocus&&d.setLocalAudio(!0):(d.micUnmutedBeforeLosingNativeAudioFocus=d.localAudio(),d.setLocalAudio(!1)))}),Oe(we(d),"handleNativeSystemScreenCaptureStop",function(){d.stopScreenShare()}),d.strictMode=m.strictMode===void 0||m.strictMode,d.allowMultipleCallInstances=(u=m.allowMultipleCallInstances)!==null&&u!==void 0&&u,Object.keys(Be).length&&(d._logDuplicateInstanceAttempt(),!d.allowMultipleCallInstances)){if(d.strictMode)throw new Error("Duplicate DailyIframe instances are not allowed");console.warn("Using strictMode: false to allow multiple call instances is now deprecated. Set `allowMultipleCallInstances: true`")}if(window._daily||(window._daily={pendings:[],instances:{}}),d.callClientId=dn(),g=we(d),Be[g.callClientId]=g,window._daily.instances[d.callClientId]={},d._sharedTracks={},window._daily.instances[d.callClientId].tracks=d._sharedTracks,m.dailyJsVersion=ne.version(),d._iframe=o,d._callObjectMode=m.layout==="none"&&!d._iframe,d._preloadCache={subscribeToTracksAutomatically:!0,audioDeviceId:null,videoDeviceId:null,outputDeviceId:null,inputSettings:null,sendSettings:null,videoTrackForNetworkConnectivityTest:null,videoTrackForConnectionQualityTest:null},m.showLocalVideo!==void 0?d._callObjectMode?console.error("showLocalVideo is not available in call object mode"):d._showLocalVideo=!!m.showLocalVideo:d._showLocalVideo=!0,m.showParticipantsBar!==void 0?d._callObjectMode?console.error("showParticipantsBar is not available in call object mode"):d._showParticipantsBar=!!m.showParticipantsBar:d._showParticipantsBar=!0,m.customIntegrations!==void 0?d._callObjectMode?console.error("customIntegrations is not available in call object mode"):d._customIntegrations=m.customIntegrations:d._customIntegrations={},m.customTrayButtons!==void 0?d._callObjectMode?console.error("customTrayButtons is not available in call object mode"):d._customTrayButtons=m.customTrayButtons:d._customTrayButtons={},m.activeSpeakerMode!==void 0?d._callObjectMode?console.error("activeSpeakerMode is not available in call object mode"):d._activeSpeakerMode=!!m.activeSpeakerMode:d._activeSpeakerMode=!1,m.receiveSettings?d._callObjectMode?d._receiveSettings=m.receiveSettings:console.error("receiveSettings is only available in call object mode"):d._receiveSettings={},d.validateProperties(m),d.properties=P({},m),d._preloadCache.inputSettings||(d._preloadCache.inputSettings={}),m.inputSettings&&m.inputSettings.audio&&(d._preloadCache.inputSettings.audio=m.inputSettings.audio),m.inputSettings&&m.inputSettings.video&&(d._preloadCache.inputSettings.video=m.inputSettings.video),d._callObjectLoader=d._callObjectMode?new cl(d.callClientId):null,d._callState=qi,d._isPreparingToJoin=!1,d._accessState={access:Cn},d._meetingSessionSummary={},d._finalSummaryOfPrevSession={},d._meetingSessionState=Ln(ms,d._callObjectMode),d._nativeInCallAudioMode=fs,d._participants={},d._isScreenSharing=!1,d._participantCounts=gs,d._rmpPlayerState={},d._waitingParticipants={},d._network={threshold:"good",quality:100},d._activeSpeaker={},d._localAudioLevel=0,d._isLocalAudioLevelObserverRunning=!1,d._remoteParticipantsAudioLevel={},d._isRemoteParticipantsAudioLevelObserverRunning=!1,d._messageChannel=N()?new sl:new rl,d._iframe&&(d._iframe.requestFullscreen?d._iframe.addEventListener("fullscreenchange",function(){document.fullscreenElement===d._iframe?(d.emitDailyJSEvent({action:qt}),d.sendMessageToCallMachine({action:qt})):(d.emitDailyJSEvent({action:Jt}),d.sendMessageToCallMachine({action:Jt}))}):d._iframe.webkitRequestFullscreen&&d._iframe.addEventListener("webkitfullscreenchange",function(){document.webkitFullscreenElement===d._iframe?(d.emitDailyJSEvent({action:qt}),d.sendMessageToCallMachine({action:qt})):(d.emitDailyJSEvent({action:Jt}),d.sendMessageToCallMachine({action:Jt}))})),N()){var b=d.nativeUtils();b.addAudioFocusChangeListener&&b.removeAudioFocusChangeListener&&b.addAppStateChangeListener&&b.removeAppStateChangeListener&&b.addSystemScreenCaptureStopListener&&b.removeSystemScreenCaptureStopListener||console.warn("expected (add|remove)(AudioFocusChange|AppActiveStateChange|SystemScreenCaptureStop)Listener to be available in React Native"),d._hasNativeAudioFocus=!0,b.addAudioFocusChangeListener(d.handleNativeAudioFocusChange),b.addAppStateChangeListener(d.handleNativeAppStateChange),b.addSystemScreenCaptureStopListener(d.handleNativeSystemScreenCaptureStop)}return d._callObjectMode&&d.startListeningForDeviceChanges(),d._messageChannel.addListenerForMessagesFromCallMachine(d.handleMessageFromCallMachine,d.callClientId,we(d)),d}return pe(ne,[{key:"destroy",value:($r=O(function*(){var o,u;try{yield this.leave()}catch{}var d=this._iframe;if(d){var g=d.parentElement;g&&g.removeChild(d)}if(this._messageChannel.removeListener(this.handleMessageFromCallMachine),N()){var m=this.nativeUtils();m.removeAudioFocusChangeListener(this.handleNativeAudioFocusChange),m.removeAppStateChangeListener(this.handleNativeAppStateChange),m.removeSystemScreenCaptureStopListener(this.handleNativeSystemScreenCaptureStop)}this._callObjectMode&&this.stopListeningForDeviceChanges(),this.resetMeetingDependentVars(),this._destroyed=!0,this.emitDailyJSEvent({action:"call-instance-destroyed"}),delete Be[this.callClientId],!((o=window)===null||o===void 0||(u=o._daily)===null||u===void 0)&&u.instances&&delete window._daily.instances[this.callClientId],this.strictMode&&(this.callClientId=void 0)}),function(){return $r.apply(this,arguments)})},{key:"isDestroyed",value:function(){return!!this._destroyed}},{key:"loadCss",value:function(o){var u=o.bodyClass,d=o.cssFile,g=o.cssText;return D(),this.sendMessageToCallMachine({action:"load-css",cssFile:this.absoluteUrl(d),bodyClass:u,cssText:g}),this}},{key:"iframe",value:function(){return D(),this._iframe}},{key:"meetingState",value:function(){return this._callState}},{key:"accessState",value:function(){return ae(this._callObjectMode,"accessState()"),this._accessState}},{key:"participants",value:function(){return this._participants}},{key:"participantCounts",value:function(){return this._participantCounts}},{key:"waitingParticipants",value:function(){return ae(this._callObjectMode,"waitingParticipants()"),this._waitingParticipants}},{key:"validateParticipantProperties",value:function(o,u){for(var d in u){if(!Gt[d])throw new Error("unrecognized updateParticipant property ".concat(d));if(Gt[d].validate&&!Gt[d].validate(u[d],this,this._participants[o]))throw new Error(Gt[d].help)}}},{key:"updateParticipant",value:function(o,u){return this._participants.local&&this._participants.local.session_id===o&&(o="local"),o&&u&&(this.validateParticipantProperties(o,u),this.sendMessageToCallMachine({action:"update-participant",id:o,properties:u})),this}},{key:"updateParticipants",value:function(o){var u=this._participants.local&&this._participants.local.session_id;for(var d in o)d===u&&(d="local"),d&&o[d]&&this.validateParticipantProperties(d,o[d]);return this.sendMessageToCallMachine({action:"update-participants",participants:o}),this}},{key:"updateWaitingParticipant",value:(Vr=O(function*(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(ae(this._callObjectMode,"updateWaitingParticipant()"),q(this._callState,"updateWaitingParticipant()"),typeof u!="string"||U(d)!=="object")throw new Error("updateWaitingParticipant() must take an id string and a updates object");return new Promise(function(g,m){o.sendMessageToCallMachine({action:"daily-method-update-waiting-participant",id:u,updates:d},function(b){b.error&&m(b.error),b.id||m(new Error("unknown error in updateWaitingParticipant()")),g({id:b.id})})})}),function(){return Vr.apply(this,arguments)})},{key:"updateWaitingParticipants",value:(Jr=O(function*(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ae(this._callObjectMode,"updateWaitingParticipants()"),q(this._callState,"updateWaitingParticipants()"),U(u)!=="object")throw new Error("updateWaitingParticipants() must take a mapping between ids and update objects");return new Promise(function(d,g){o.sendMessageToCallMachine({action:"daily-method-update-waiting-participants",updatesById:u},function(m){m.error&&g(m.error),m.ids||g(new Error("unknown error in updateWaitingParticipants()")),d({ids:m.ids})})})}),function(){return Jr.apply(this,arguments)})},{key:"requestAccess",value:(qr=O(function*(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},d=u.access,g=d===void 0?{level:Xa}:d,m=u.name,b=m===void 0?"":m;return ae(this._callObjectMode,"requestAccess()"),q(this._callState,"requestAccess()"),new Promise(function(E,C){o.sendMessageToCallMachine({action:"daily-method-request-access",access:g,name:b},function(x){x.error&&C(x.error),x.access||C(new Error("unknown error in requestAccess()")),E({access:x.access,granted:x.granted})})})}),function(){return qr.apply(this,arguments)})},{key:"localAudio",value:function(){return this._participants.local?!["blocked","off"].includes(this._participants.local.tracks.audio.state):null}},{key:"localVideo",value:function(){return this._participants.local?!["blocked","off"].includes(this._participants.local.tracks.video.state):null}},{key:"setLocalAudio",value:function(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return"forceDiscardTrack"in u&&(N()?(console.warn("forceDiscardTrack option not supported in React Native; ignoring"),u={}):o&&(console.warn("forceDiscardTrack option only supported when calling setLocalAudio(false); ignoring"),u={})),this.sendMessageToCallMachine({action:"local-audio",state:o,options:u}),this}},{key:"localScreenAudio",value:function(){return this._participants.local?!["blocked","off"].includes(this._participants.local.tracks.screenAudio.state):null}},{key:"localScreenVideo",value:function(){return this._participants.local?!["blocked","off"].includes(this._participants.local.tracks.screenVideo.state):null}},{key:"updateScreenShare",value:function(o){if(this._isScreenSharing)return this.sendMessageToCallMachine({action:"local-screen-update",options:o}),this;console.warn("There is no screen share in progress. Try calling startScreenShare first.")}},{key:"setLocalVideo",value:function(o){return this.sendMessageToCallMachine({action:"local-video",state:o}),this}},{key:"getReceiveSettings",value:(Ur=O(function*(o){var u=this,d=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).showInheritedValues,g=d!==void 0&&d;if(ae(this._callObjectMode,"getReceiveSettings()"),!this._callMachineInitialized)return this._receiveSettings;switch(U(o)){case"string":return new Promise(function(m){u.sendMessageToCallMachine({action:"get-single-participant-receive-settings",id:o,showInheritedValues:g},function(b){m(b.receiveSettings)})});case"undefined":return this._receiveSettings;default:throw new Error('first argument to getReceiveSettings() must be a participant id (or "base"), or there should be no arguments')}}),function(o){return Ur.apply(this,arguments)})},{key:"updateReceiveSettings",value:(Fr=O(function*(o){var u=this;if(ae(this._callObjectMode,"updateReceiveSettings()"),!yo(o,{allowAllParticipantsKey:!0}))throw new Error(wo({allowAllParticipantsKey:!0}));return q(this._callState,"updateReceiveSettings()","To specify receive settings earlier, use the receiveSettings config property."),new Promise(function(d){u.sendMessageToCallMachine({action:"update-receive-settings",receiveSettings:o},function(g){d({receiveSettings:g.receiveSettings})})})}),function(o){return Fr.apply(this,arguments)})},{key:"_prepInputSettingsToPresentToUser",value:function(o){var u,d,g,m,b,E,C,x;if(o){var Y={},G=((u=o.audio)===null||u===void 0||(d=u.processor)===null||d===void 0?void 0:d.type)==="none"&&((g=o.audio)===null||g===void 0||(m=g.processor)===null||m===void 0?void 0:m._isDefaultWhenNone);if(o.audio&&!G){var _e=P({},o.audio.processor);delete _e._isDefaultWhenNone,Y.audio=P(P({},o.audio),{},{processor:_e})}var Ee=((b=o.video)===null||b===void 0||(E=b.processor)===null||E===void 0?void 0:E.type)==="none"&&((C=o.video)===null||C===void 0||(x=C.processor)===null||x===void 0?void 0:x._isDefaultWhenNone);if(o.video&&!Ee){var be=P({},o.video.processor);delete be._isDefaultWhenNone,Y.video=P(P({},o.video),{},{processor:be})}return Y}}},{key:"getInputSettings",value:function(){var o=this;return D(),new Promise(function(u){u(o._getInputSettings())})}},{key:"_getInputSettings",value:function(){var o,u,d,g,m,b,E,C,x={processor:{type:"none",_isDefaultWhenNone:!0}};this._inputSettings?(o=((d=this._inputSettings)===null||d===void 0?void 0:d.video)||x,u=((g=this._inputSettings)===null||g===void 0?void 0:g.audio)||x):(o=((m=this._preloadCache)===null||m===void 0||(b=m.inputSettings)===null||b===void 0?void 0:b.video)||x,u=((E=this._preloadCache)===null||E===void 0||(C=E.inputSettings)===null||C===void 0?void 0:C.audio)||x);var Y={audio:u,video:o};return this._prepInputSettingsToPresentToUser(Y)}},{key:"updateInputSettings",value:(Br=O(function*(o){var u=this;return D(),_o(o)?(o&&(this._preloadCache.inputSettings||(this._preloadCache.inputSettings={}),bo(o,this.properties.dailyConfig),o.audio&&(this._preloadCache.inputSettings.audio=o.audio),o.video&&(this._preloadCache.inputSettings.video=o.video)),o.video||o.audio?this._callObjectMode&&!this._callMachineInitialized?this._getInputSettings():new Promise(function(d,g){u.sendMessageToCallMachine({action:"update-input-settings",inputSettings:o},function(m){m.error?g(m.error):d({inputSettings:u._prepInputSettingsToPresentToUser(m.inputSettings)})})}):this._getInputSettings()):(console.error(or()),Promise.reject(or()))}),function(o){return Br.apply(this,arguments)})},{key:"setBandwidth",value:function(o){var u=o.kbs,d=o.trackConstraints;if(D(),this._callMachineInitialized)return this.sendMessageToCallMachine({action:"set-bandwidth",kbs:u,trackConstraints:d}),this}},{key:"getDailyLang",value:function(){var o=this;if(D(),this._callMachineInitialized)return new Promise(function(u){o.sendMessageToCallMachine({action:"get-daily-lang"},function(d){delete d.action,delete d.callbackStamp,u(d)})})}},{key:"setDailyLang",value:function(o){return D(),this.sendMessageToCallMachine({action:"set-daily-lang",lang:o}),this}},{key:"setProxyUrl",value:function(o){return this.sendMessageToCallMachine({action:"set-proxy-url",proxyUrl:o}),this}},{key:"setIceConfig",value:function(o){return this.sendMessageToCallMachine({action:"set-ice-config",iceConfig:o}),this}},{key:"meetingSessionSummary",value:function(){return[Ie,Te].includes(this._callState)?this._finalSummaryOfPrevSession:this._meetingSessionSummary}},{key:"getMeetingSession",value:(Ir=O(function*(){var o=this;return console.warn("getMeetingSession() is deprecated: use meetingSessionSummary(), which will return immediately"),q(this._callState,"getMeetingSession()"),new Promise(function(u){o.sendMessageToCallMachine({action:"get-meeting-session"},function(d){delete d.action,delete d.callbackStamp,u(d)})})}),function(){return Ir.apply(this,arguments)})},{key:"meetingSessionState",value:function(){return q(this._callState,"meetingSessionState"),this._meetingSessionState}},{key:"setMeetingSessionData",value:function(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"replace";ae(this._callObjectMode,"setMeetingSessionData()"),q(this._callState,"setMeetingSessionData");try{(function(d,g){new ol({data:d,mergeStrategy:g})})(o,u)}catch(d){throw console.error(d),d}try{this.sendMessageToCallMachine({action:"set-session-data",data:o,mergeStrategy:u})}catch(d){throw new Error("Error setting meeting session data: ".concat(d))}}},{key:"setUserName",value:function(o,u){var d=this;return this.properties.userName=o,new Promise(function(g){d.sendMessageToCallMachine({action:"set-user-name",name:o??"",thisMeetingOnly:N()||!!u&&!!u.thisMeetingOnly},function(m){delete m.action,delete m.callbackStamp,g(m)})})}},{key:"setUserData",value:(jr=O(function*(o){var u=this;try{vo(o)}catch(d){throw console.error(d),d}if(this.properties.userData=o,this._callMachineInitialized)return new Promise(function(d){try{u.sendMessageToCallMachine({action:"set-user-data",userData:o},function(g){delete g.action,delete g.callbackStamp,d(g)})}catch(g){throw new Error("Error setting user data: ".concat(g))}})}),function(o){return jr.apply(this,arguments)})},{key:"validateAudioLevelInterval",value:function(o){if(o&&(o<100||typeof o!="number"))throw new Error("The interval must be a number greater than or equal to 100 milliseconds.")}},{key:"startLocalAudioLevelObserver",value:function(o){var u=this;if(typeof AudioWorkletNode>"u"&&!N())throw new Error("startLocalAudioLevelObserver() is not supported on this browser");if(this.validateAudioLevelInterval(o),this._callMachineInitialized)return this._isLocalAudioLevelObserverRunning=!0,new Promise(function(d,g){u.sendMessageToCallMachine({action:"start-local-audio-level-observer",interval:o},function(m){u._isLocalAudioLevelObserverRunning=!m.error,m.error?g({error:m.error}):d()})});this._preloadCache.localAudioLevelObserver={enabled:!0,interval:o}}},{key:"isLocalAudioLevelObserverRunning",value:function(){return this._isLocalAudioLevelObserverRunning}},{key:"stopLocalAudioLevelObserver",value:function(){this._preloadCache.localAudioLevelObserver=null,this._localAudioLevel=0,this._isLocalAudioLevelObserverRunning=!1,this.sendMessageToCallMachine({action:"stop-local-audio-level-observer"})}},{key:"startRemoteParticipantsAudioLevelObserver",value:function(o){var u=this;if(this.validateAudioLevelInterval(o),this._callMachineInitialized)return this._isRemoteParticipantsAudioLevelObserverRunning=!0,new Promise(function(d,g){u.sendMessageToCallMachine({action:"start-remote-participants-audio-level-observer",interval:o},function(m){u._isRemoteParticipantsAudioLevelObserverRunning=!m.error,m.error?g({error:m.error}):d()})});this._preloadCache.remoteParticipantsAudioLevelObserver={enabled:!0,interval:o}}},{key:"isRemoteParticipantsAudioLevelObserverRunning",value:function(){return this._isRemoteParticipantsAudioLevelObserverRunning}},{key:"stopRemoteParticipantsAudioLevelObserver",value:function(){this._preloadCache.remoteParticipantsAudioLevelObserver=null,this._remoteParticipantsAudioLevel={},this._isRemoteParticipantsAudioLevelObserverRunning=!1,this.sendMessageToCallMachine({action:"stop-remote-participants-audio-level-observer"})}},{key:"startCamera",value:(Nr=O(function*(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ae(this._callObjectMode,"startCamera()"),xn(this._callState,this._isPreparingToJoin,"startCamera()","Did you mean to use setLocalAudio() and/or setLocalVideo() instead?"),this.needsLoad())try{yield this.load(u)}catch(d){return Promise.reject(d)}else{if(this._didPreAuth){if(u.url&&u.url!==this.properties.url)return console.error("url in startCamera() is different than the one used in preAuth()"),Promise.reject();if(u.token&&u.token!==this.properties.token)return console.error("token in startCamera() is different than the one used in preAuth()"),Promise.reject()}this.validateProperties(u),this.properties=P(P({},this.properties),u)}return new Promise(function(d){o.sendMessageToCallMachine({action:"start-camera",properties:Qe(o.properties,o.callClientId),preloadCache:Qe(o._preloadCache,o.callClientId)},function(g){delete g.action,delete g.callbackStamp,d(g)})})}),function(){return Nr.apply(this,arguments)})},{key:"validateCustomTrack",value:function(o,u,d){if(d&&d.length>50)throw new Error("Custom track `trackName` must not be more than 50 characters");if(u&&u!=="music"&&u!=="speech"&&!(u instanceof Object))throw new Error("Custom track `mode` must be either `music` | `speech` | `DailyMicAudioModeSettings` or `undefined`");if(d&&["cam-audio","cam-video","screen-video","screen-audio","rmpAudio","rmpVideo","customVideoDefaults"].includes(d))throw new Error("Custom track `trackName` must not match a track name already used by daily: cam-audio, cam-video, customVideoDefaults, screen-video, screen-audio, rmpAudio, rmpVideo");if(!(o instanceof MediaStreamTrack))throw new Error("Custom tracks provided must be instances of MediaStreamTrack")}},{key:"startCustomTrack",value:function(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{track,mode,trackName};return D(),q(this._callState,"startCustomTrack()"),this.validateCustomTrack(u.track,u.mode,u.trackName),new Promise(function(d,g){o._sharedTracks.customTrack=u.track,u.track=yt,o.sendMessageToCallMachine({action:"start-custom-track",properties:u},function(m){m.error?g({error:m.error}):d(m.mediaTag)})})}},{key:"stopCustomTrack",value:function(o){var u=this;return D(),q(this._callState,"stopCustomTrack()"),new Promise(function(d){u.sendMessageToCallMachine({action:"stop-custom-track",mediaTag:o},function(g){d(g.mediaTag)})})}},{key:"setCamera",value:function(o){var u=this;return mt(),zt(this._callMachineInitialized,"setCamera()"),new Promise(function(d){u.sendMessageToCallMachine({action:"set-camera",cameraDeviceId:o},function(g){d({device:g.device})})})}},{key:"setAudioDevice",value:(Lr=O(function*(o){return mt(),this.nativeUtils().setAudioDevice(o),{deviceId:yield this.nativeUtils().getAudioDevice()}}),function(o){return Lr.apply(this,arguments)})},{key:"cycleCamera",value:function(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new Promise(function(d){o.sendMessageToCallMachine({action:"cycle-camera",properties:u},function(g){d({device:g.device})})})}},{key:"cycleMic",value:function(){var o=this;return D(),new Promise(function(u){o.sendMessageToCallMachine({action:"cycle-mic"},function(d){u({device:d.device})})})}},{key:"getCameraFacingMode",value:function(){var o=this;return mt(),new Promise(function(u){o.sendMessageToCallMachine({action:"get-camera-facing-mode"},function(d){u(d.facingMode)})})}},{key:"setInputDevicesAsync",value:(Dr=O(function*(o){var u=this,d=o.audioDeviceId,g=o.videoDeviceId,m=o.audioSource,b=o.videoSource;return D(),m!==void 0&&(d=m),b!==void 0&&(g=b),d&&(this._preloadCache.audioDeviceId=d,this._sharedTracks.audioDeviceId=d),g&&(this._preloadCache.videoDeviceId=g,this._sharedTracks.videoDeviceId=g),this._callObjectMode&&this.needsLoad()?{camera:{deviceId:this._preloadCache.videoDeviceId},mic:{deviceId:this._preloadCache.audioDeviceId},speaker:{deviceId:this._preloadCache.outputDeviceId}}:(d instanceof MediaStreamTrack&&(d=yt),g instanceof MediaStreamTrack&&(g=yt),new Promise(function(E){u.sendMessageToCallMachine({action:"set-input-devices",audioDeviceId:d,videoDeviceId:g},function(C){delete C.action,delete C.callbackStamp,C.returnPreloadCache?E({camera:{deviceId:u._preloadCache.videoDeviceId},mic:{deviceId:u._preloadCache.audioDeviceId},speaker:{deviceId:u._preloadCache.outputDeviceId}}):E(C)})}))}),function(o){return Dr.apply(this,arguments)})},{key:"setOutputDeviceAsync",value:(xr=O(function*(o){var u=this,d=o.outputDeviceId;return D(),d&&(this._preloadCache.outputDeviceId=d),this._callObjectMode&&this.needsLoad()?{camera:{deviceId:this._preloadCache.videoDeviceId},mic:{deviceId:this._preloadCache.audioDeviceId},speaker:{deviceId:this._preloadCache.outputDeviceId}}:new Promise(function(g){u.sendMessageToCallMachine({action:"set-output-device",outputDeviceId:d},function(m){delete m.action,delete m.callbackStamp,m.returnPreloadCache?g({camera:{deviceId:u._preloadCache.videoDeviceId},mic:{deviceId:u._preloadCache.audioDeviceId},speaker:{deviceId:u._preloadCache.outputDeviceId}}):g(m)})})}),function(o){return xr.apply(this,arguments)})},{key:"getInputDevices",value:(Rr=O(function*(){var o=this;return this._callObjectMode&&this.needsLoad()?{camera:{deviceId:this._preloadCache.videoDeviceId},mic:{deviceId:this._preloadCache.audioDeviceId},speaker:{deviceId:this._preloadCache.outputDeviceId}}:new Promise(function(u){o.sendMessageToCallMachine({action:"get-input-devices"},function(d){delete d.action,delete d.callbackStamp,d.returnPreloadCache?u({camera:{deviceId:o._preloadCache.videoDeviceId},mic:{deviceId:o._preloadCache.audioDeviceId},speaker:{deviceId:o._preloadCache.outputDeviceId}}):u(d)})})}),function(){return Rr.apply(this,arguments)})},{key:"nativeInCallAudioMode",value:function(){return mt(),this._nativeInCallAudioMode}},{key:"setNativeInCallAudioMode",value:function(o){if(mt(),[fs,Ml].includes(o)){if(o!==this._nativeInCallAudioMode)return this._nativeInCallAudioMode=o,!this.disableReactNativeAutoDeviceManagement("audio")&&Wt(this._callState,this._isPreparingToJoin)&&this.nativeUtils().setAudioMode(this._nativeInCallAudioMode),this}else console.error("invalid in-call audio mode specified: ",o)}},{key:"preAuth",value:(ht=O(function*(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ae(this._callObjectMode,"preAuth()"),xn(this._callState,this._isPreparingToJoin,"preAuth()"),this.needsLoad()&&(yield this.load(u)),!u.url)throw new Error("preAuth() requires at least a url to be provided");return this.validateProperties(u),this.properties=P(P({},this.properties),u),new Promise(function(d,g){o.sendMessageToCallMachine({action:"daily-method-preauth",properties:Qe(o.properties,o.callClientId),preloadCache:Qe(o._preloadCache,o.callClientId)},function(m){return m.error?g(m.error):m.access?(o._didPreAuth=!0,void d({access:m.access})):g(new Error("unknown error in preAuth()"))})})}),function(){return ht.apply(this,arguments)})},{key:"load",value:(ye=O(function*(o){var u=this;if(this.needsLoad()){if(this._destroyed&&(this._logUseAfterDestroy(),this.strictMode))throw new Error("Use after destroy");if(o&&(this.validateProperties(o),this.properties=P(P({},this.properties),o)),!this._callObjectMode&&!this.properties.url)throw new Error("can't load iframe meeting because url property isn't set");return this._updateCallState(Ji),this.emitDailyJSEvent({action:ic}),this._callObjectMode?new Promise(function(d,g){u._callObjectLoader.cancel();var m=Date.now();u._callObjectLoader.load(u.properties.dailyConfig,function(b){u._bundleLoadTime=b?"no-op":Date.now()-m,u._updateCallState(Vi),b&&u.emitDailyJSEvent({action:$i}),d()},function(b,E){if(u.emitDailyJSEvent({action:sc}),!E){u._updateCallState(Te),u.resetMeetingDependentVars();var C={action:Hi,errorMsg:b.msg,error:{type:"connection-error",msg:"Failed to load call object bundle.",details:{on:"load",sourceError:b,bundleUrl:Xt(u.properties.dailyConfig)}}};u._maybeSendToSentry(C),u.emitDailyJSEvent(C),g(b.msg)}})}):(this._iframe.src=Us(this.assembleMeetingUrl(),this.properties.dailyConfig),new Promise(function(d,g){u._loadedCallback=function(m){u._callState!==Te?(u._updateCallState(Vi),(u.properties.cssFile||u.properties.cssText)&&u.loadCss(u.properties),d()):g(m)}}))}}),function(o){return ye.apply(this,arguments)})},{key:"join",value:(se=O(function*(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this._testCallInProgress&&this.stopTestCallQuality();var d=!1;if(this.needsLoad()){this.updateIsPreparingToJoin(!0);try{yield this.load(u)}catch(g){return this.updateIsPreparingToJoin(!1),Promise.reject(g)}}else{if(d=!(!this.properties.cssFile&&!this.properties.cssText),this._didPreAuth){if(u.url&&u.url!==this.properties.url)return console.error("url in join() is different than the one used in preAuth()"),this.updateIsPreparingToJoin(!1),Promise.reject();if(u.token&&u.token!==this.properties.token)return console.error("token in join() is different than the one used in preAuth()"),this.updateIsPreparingToJoin(!1),Promise.reject()}if(u.url&&!this._callObjectMode&&u.url&&u.url!==this.properties.url)return console.error("url in join() is different than the one used in load() (".concat(this.properties.url," -> ").concat(u.url,")")),this.updateIsPreparingToJoin(!1),Promise.reject();this.validateProperties(u),this.properties=P(P({},this.properties),u)}return u.showLocalVideo!==void 0&&(this._callObjectMode?console.error("showLocalVideo is not available in callObject mode"):this._showLocalVideo=!!u.showLocalVideo),u.showParticipantsBar!==void 0&&(this._callObjectMode?console.error("showParticipantsBar is not available in callObject mode"):this._showParticipantsBar=!!u.showParticipantsBar),this._callState===Ke||this._callState===Kn?(console.warn("already joined meeting, call leave() before joining again"),void this.updateIsPreparingToJoin(!1)):(this._updateCallState(Kn,!1),this.emitDailyJSEvent({action:cc}),this._preloadCache.inputSettings||(this._preloadCache.inputSettings={}),u.inputSettings&&u.inputSettings.audio&&(this._preloadCache.inputSettings.audio=u.inputSettings.audio),u.inputSettings&&u.inputSettings.video&&(this._preloadCache.inputSettings.video=u.inputSettings.video),this.sendMessageToCallMachine({action:"join-meeting",properties:Qe(this.properties,this.callClientId),preloadCache:Qe(this._preloadCache,this.callClientId)}),new Promise(function(g,m){o._joinedCallback=function(b,E){if(o._callState!==Te){if(o._updateCallState(Ke),b)for(var C in b){if(o._callObjectMode){var x=o._callMachine().store;os(b[C],x),as(b[C],x),cs(b[C],o._participants[C],x)}o._participants[C]=P({},b[C]),o.toggleParticipantAudioBasedOnNativeAudioFocus()}d&&o.loadCss(o.properties),g(b)}else m(E)}}))}),function(){return se.apply(this,arguments)})},{key:"leave",value:(Le=O(function*(){var o=this;return this._testCallInProgress&&this.stopTestCallQuality(),new Promise(function(u){o._callState===Ie||o._callState===Te?u():o._callObjectLoader&&!o._callObjectLoader.loaded?(o._callObjectLoader.cancel(),o._updateCallState(Ie),o.resetMeetingDependentVars(),o.emitDailyJSEvent({action:Ie}),u()):(o._resolveLeave=u,o.sendMessageToCallMachine({action:"leave-meeting"}))})}),function(){return Le.apply(this,arguments)})},{key:"startScreenShare",value:(te=O(function*(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(zt(this._callMachineInitialized,"startScreenShare()"),u.screenVideoSendSettings&&this._validateVideoSendSettings("screenVideo",u.screenVideoSendSettings),u.mediaStream&&(this._sharedTracks.screenMediaStream=u.mediaStream,u.mediaStream=yt),typeof DailyNativeUtils<"u"&&DailyNativeUtils.isIOS!==void 0&&DailyNativeUtils.isIOS){var d=this.nativeUtils();if(yield d.isScreenBeingCaptured())return void this.emitDailyJSEvent({action:Yi,type:"screen-share-error",errorMsg:"Could not start the screen sharing. The screen is already been captured!"});d.setSystemScreenCaptureStartCallback(function(){d.setSystemScreenCaptureStartCallback(null),o.sendMessageToCallMachine({action:Qi,captureOptions:u})}),d.presentSystemScreenCapturePrompt()}else this.sendMessageToCallMachine({action:Qi,captureOptions:u})}),function(){return te.apply(this,arguments)})},{key:"stopScreenShare",value:function(){zt(this._callMachineInitialized,"stopScreenShare()"),this.sendMessageToCallMachine({action:"local-screen-stop"})}},{key:"startRecording",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(P({action:"local-recording-start"},o))}},{key:"updateRecording",value:function(o){var u=o.layout,d=u===void 0?{preset:"default"}:u,g=o.instanceId;this.sendMessageToCallMachine({action:"daily-method-update-recording",layout:d,instanceId:g})}},{key:"stopRecording",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(P({action:"local-recording-stop"},o))}},{key:"startLiveStreaming",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(P({action:"daily-method-start-live-streaming"},o))}},{key:"updateLiveStreaming",value:function(o){var u=o.layout,d=u===void 0?{preset:"default"}:u,g=o.instanceId;this.sendMessageToCallMachine({action:"daily-method-update-live-streaming",layout:d,instanceId:g})}},{key:"addLiveStreamingEndpoints",value:function(o){var u=o.endpoints,d=o.instanceId;this.sendMessageToCallMachine({action:Ki,endpointsOp:Kc,endpoints:u,instanceId:d})}},{key:"removeLiveStreamingEndpoints",value:function(o){var u=o.endpoints,d=o.instanceId;this.sendMessageToCallMachine({action:Ki,endpointsOp:Xc,endpoints:u,instanceId:d})}},{key:"stopLiveStreaming",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(P({action:"daily-method-stop-live-streaming"},o))}},{key:"validateDailyConfig",value:function(o){o.camSimulcastEncodings&&(console.warn("camSimulcastEncodings is deprecated. Use sendSettings, found in DailyCallOptions, to provide camera simulcast settings."),this.validateSimulcastEncodings(o.camSimulcastEncodings)),o.screenSimulcastEncodings&&console.warn("screenSimulcastEncodings is deprecated. Use sendSettings, found in DailyCallOptions, to provide screen simulcast settings."),de().match(/Linux; Android/)&&o.noAutoDefaultDeviceChange&&console.warn("noAutoDefaultDeviceChange is not supported on Android, and will be ignored.")}},{key:"validateSimulcastEncodings",value:function(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,d=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(o){if(!(o instanceof Array||Array.isArray(o)))throw new Error("encodings must be an Array");if(!ws(o.length,1,3))throw new Error("encodings must be an Array with between 1 to ".concat(3," layers"));for(var g=0;g<o.length;g++){var m=o[g];for(var b in this._validateEncodingLayerHasValidProperties(m),m)if(Rn.includes(b)){if(typeof m[b]!="number")throw new Error("".concat(b," must be a number"));if(u){var E=u[b],C=E.min,x=E.max;if(!ws(m[b],C,x))throw new Error("".concat(b," value not in range. valid range: ").concat(C," to ").concat(x))}}else if(!["active","scalabilityMode"].includes(b))throw new Error("Invalid key ".concat(b,", valid keys are:")+Object.values(Rn));if(d&&!m.hasOwnProperty("maxBitrate"))throw new Error("maxBitrate is not specified")}}}},{key:"startRemoteMediaPlayer",value:(L=O(function*(o){var u=this,d=o.url,g=o.settings,m=g===void 0?{state:Xn.PLAY}:g;try{(function(b){if(typeof b!="string")throw new Error('url parameter must be "string" type')})(d),bs(m),function(b){for(var E in b)if(!vs.includes(E))throw new Error("Invalid key ".concat(E,", valid keys are: ").concat(vs));b.simulcastEncodings&&this.validateSimulcastEncodings(b.simulcastEncodings,go,!0)}(m)}catch(b){throw console.error("invalid argument Error: ".concat(b)),console.error(`startRemoteMediaPlayer arguments must be of the form:
27
+ { url: "playback url",
28
+ settings?:
29
+ {state: "play"|"pause", simulcastEncodings?: [{}] } }`),b}return new Promise(function(b,E){u.sendMessageToCallMachine({action:"daily-method-start-remote-media-player",url:d,settings:m},function(C){C.error?E({error:C.error,errorMsg:C.errorMsg}):b({session_id:C.session_id,remoteMediaPlayerState:{state:C.state,settings:C.settings}})})})}),function(o){return L.apply(this,arguments)})},{key:"stopRemoteMediaPlayer",value:(B=O(function*(o){var u=this;if(typeof o!="string")throw new Error(" remotePlayerID must be of type string");return new Promise(function(d,g){u.sendMessageToCallMachine({action:"daily-method-stop-remote-media-player",session_id:o},function(m){m.error?g({error:m.error,errorMsg:m.errorMsg}):d()})})}),function(o){return B.apply(this,arguments)})},{key:"updateRemoteMediaPlayer",value:(M=O(function*(o){var u=this,d=o.session_id,g=o.settings;try{bs(g)}catch(m){throw console.error("invalid argument Error: ".concat(m)),console.error(`updateRemoteMediaPlayer arguments must be of the form:
30
+ session_id: "participant session",
31
+ { settings?: {state: "play"|"pause"} }`),m}return new Promise(function(m,b){u.sendMessageToCallMachine({action:"daily-method-update-remote-media-player",session_id:d,settings:g},function(E){E.error?b({error:E.error,errorMsg:E.errorMsg}):m({session_id:E.session_id,remoteMediaPlayerState:{state:E.state,settings:E.settings}})})})}),function(o){return M.apply(this,arguments)})},{key:"startTranscription",value:function(o){this.sendMessageToCallMachine(P({action:"daily-method-start-transcription"},o))}},{key:"stopTranscription",value:function(){this.sendMessageToCallMachine({action:"daily-method-stop-transcription"})}},{key:"startDialOut",value:(T=O(function*(o){var u=this;q(this._callState,"startDialOut()");var d=function(g){if(g){if(!Array.isArray(g))throw new Error("Error starting dial out: audio codec must be an array");if(g.length<=0)throw new Error("Error starting dial out: audio codec array specified but empty");g.forEach(function(m){if(typeof m!="string")throw new Error("Error starting dial out: audio codec must be a string");if(m!=="OPUS"&&m!=="PCMU"&&m!=="PCMA"&&m!=="G722")throw new Error("Error starting dial out: audio codec must be one of OPUS, PCMU, PCMA, G722")})}};if(!o.sipUri&&!o.phoneNumber)throw new Error("Error starting dial out: either a sip uri or phone number must be provided");if(o.sipUri&&o.phoneNumber)throw new Error("Error starting dial out: only one of sip uri or phone number must be provided");if(o.sipUri){if(typeof o.sipUri!="string")throw new Error("Error starting dial out: sipUri must be a string");if(!o.sipUri.startsWith("sip:"))throw new Error("Error starting dial out: Invalid SIP URI, must start with 'sip:'");if(o.video&&typeof o.video!="boolean")throw new Error("Error starting dial out: video must be a boolean value");(function(g){if(g&&(d(g.audio),g.video)){if(!Array.isArray(g.video))throw new Error("Error starting dial out: video codec must be an array");if(g.video.length<=0)throw new Error("Error starting dial out: video codec array specified but empty");g.video.forEach(function(m){if(typeof m!="string")throw new Error("Error starting dial out: video codec must be a string");if(m!=="H264"&&m!=="VP8")throw new Error("Error starting dial out: video codec must be H264 or VP8")})}})(o.codecs)}if(o.phoneNumber){if(typeof o.phoneNumber!="string")throw new Error("Error starting dial out: phoneNumber must be a string");if(!/^\+\d{1,}$/.test(o.phoneNumber))throw new Error("Error starting dial out: Invalid phone number, must be valid phone number as per E.164");o.codecs&&d(o.codecs.audio)}if(o.callerId){if(typeof o.callerId!="string")throw new Error("Error starting dial out: callerId must be a string");if(o.sipUri)throw new Error("Error starting dial out: callerId not allowed with sipUri")}if(o.displayName){if(typeof o.displayName!="string")throw new Error("Error starting dial out: displayName must be a string");if(o.displayName.length>=200)throw new Error("Error starting dial out: displayName length must be less than 200")}return new Promise(function(g,m){u.sendMessageToCallMachine(P({action:"dialout-start"},o),function(b){b.error?m(b.error):g(b)})})}),function(o){return T.apply(this,arguments)})},{key:"stopDialOut",value:function(o){var u=this;return q(this._callState,"stopDialOut()"),new Promise(function(d,g){u.sendMessageToCallMachine(P({action:"dialout-stop"},o),function(m){m.error?g(m.error):d(m)})})}},{key:"sipCallTransfer",value:(w=O(function*(o){var u=this;if(q(this._callState,"sipCallTransfer()"),!o)throw new Error("sipCallTransfer() requires a sessionId and toEndPoint");return o.useSipRefer=!1,_s(o,"sipCallTransfer"),new Promise(function(d,g){u.sendMessageToCallMachine(P({action:Zi},o),function(m){m.error?g(m.error):d(m)})})}),function(o){return w.apply(this,arguments)})},{key:"sipRefer",value:(y=O(function*(o){var u=this;if(q(this._callState,"sipRefer()"),!o)throw new Error("sessionId and toEndPoint are mandatory parameter");return o.useSipRefer=!0,_s(o,"sipRefer"),new Promise(function(d,g){u.sendMessageToCallMachine(P({action:Zi},o),function(m){m.error?g(m.error):d(m)})})}),function(o){return y.apply(this,arguments)})},{key:"sendDTMF",value:(k=O(function*(o){var u=this;return q(this._callState,"sendDTMF()"),function(d){var g=d.sessionId,m=d.tones;if(!g||!m)throw new Error("sessionId and tones are mandatory parameter");if(typeof g!="string"||typeof m!="string")throw new Error("sessionId and tones should be of string type");if(m.length>20)throw new Error("tones string must be upto 20 characters");var b=/[^0-9A-D*#]/g,E=m.match(b);if(E&&E[0])throw new Error("".concat(E[0]," is not valid DTMF tone"))}(o),new Promise(function(d,g){u.sendMessageToCallMachine(P({action:"send-dtmf"},o),function(m){m.error?g(m.error):d(m)})})}),function(o){return k.apply(this,arguments)})},{key:"getNetworkStats",value:function(){var o=this;return this._callState!==Ke?{stats:{latest:{}}}:new Promise(function(u){o.sendMessageToCallMachine({action:"get-calc-stats"},function(d){u(P({stats:d.stats},o._network))})})}},{key:"testWebsocketConnectivity",value:(_=O(function*(){var o=this;if(Dn(this._testCallInProgress,"testWebsocketConnectivity()"),this.needsLoad())try{yield this.load()}catch(u){return Promise.reject(u)}return new Promise(function(u,d){o.sendMessageToCallMachine({action:"test-websocket-connectivity"},function(g){g.error?d(g.error):u(g.results)})})}),function(){return _.apply(this,arguments)})},{key:"abortTestWebsocketConnectivity",value:function(){this.sendMessageToCallMachine({action:"abort-test-websocket-connectivity"})}},{key:"_validateVideoTrackForNetworkTests",value:function(o){return o?o instanceof MediaStreamTrack?!!kl(o)||(console.error("Video track is not playable. This test needs a live video track."),!1):(console.error("Video track needs to be of type `MediaStreamTrack`."),!1):(console.error("Missing video track. You must provide a video track in order to run this test."),!1)}},{key:"testCallQuality",value:(f=O(function*(){var o=this;D(),ae(this._callObjectMode,"testCallQuality()"),zt(this._callMachineInitialized,"testCallQuality()",null,!0),xn(this._callState,this._isPreparingToJoin,"testCallQuality()");var u=this._testCallAlreadyInProgress,d=function(m){u||(o._testCallInProgress=m)};if(d(!0),this.needsLoad())try{var g=this._callState;yield this.load(),this._callState=g}catch(m){return d(!1),Promise.reject(m)}return new Promise(function(m){o.sendMessageToCallMachine({action:"test-call-quality",dailyJsVersion:o.properties.dailyJsVersion},function(b){var E=b.results,C=E.result,x=Gr(E,El);if(C==="failed"){var Y,G=P({},x);(Y=x.error)!==null&&Y!==void 0&&Y.details?(x.error.details=JSON.parse(x.error.details),G.error=P(P({},G.error),{},{details:P({},G.error.details)}),G.error.details.duringTest="testCallQuality"):(G.error=G.error?P({},G.error):{},G.error.details={duringTest:"testCallQuality"}),o._maybeSendToSentry(G)}d(!1),m(P({result:C},x))})})}),function(){return f.apply(this,arguments)})},{key:"stopTestCallQuality",value:function(){this.sendMessageToCallMachine({action:"stop-test-call-quality"})}},{key:"testConnectionQuality",value:(h=O(function*(o){var u;N()?(console.warn("testConnectionQuality() is deprecated: use testPeerToPeerCallQuality() instead"),u=yield this.testPeerToPeerCallQuality(o)):(console.warn("testConnectionQuality() is deprecated: use testCallQuality() instead"),u=yield this.testCallQuality());var d={result:u.result,secondsElapsed:u.secondsElapsed};return u.data&&(d.data={maxRTT:u.data.maxRoundTripTime,packetLoss:u.data.avgRecvPacketLoss}),d}),function(o){return h.apply(this,arguments)})},{key:"testPeerToPeerCallQuality",value:(p=O(function*(o){var u=this;if(Dn(this._testCallInProgress,"testPeerToPeerCallQuality()"),this.needsLoad())try{yield this.load()}catch(m){return Promise.reject(m)}var d=o.videoTrack,g=o.duration;if(!this._validateVideoTrackForNetworkTests(d))throw new Error("Video track error");return this._sharedTracks.videoTrackForConnectionQualityTest=d,new Promise(function(m,b){u.sendMessageToCallMachine({action:"test-p2p-call-quality",duration:g},function(E){E.error?b(E.error):m(E.results)})})}),function(o){return p.apply(this,arguments)})},{key:"stopTestConnectionQuality",value:function(){N()?(console.warn("stopTestConnectionQuality() is deprecated: use testPeerToPeerCallQuality() and stopTestPeerToPeerCallQuality() instead"),this.stopTestPeerToPeerCallQuality()):(console.warn("stopTestConnectionQuality() is deprecated: use testCallQuality() and stopTestCallQuality() instead"),this.stopTestCallQuality())}},{key:"stopTestPeerToPeerCallQuality",value:function(){this.sendMessageToCallMachine({action:"stop-test-p2p-call-quality"})}},{key:"testNetworkConnectivity",value:(l=O(function*(o){var u=this;if(Dn(this._testCallInProgress,"testNetworkConnectivity()"),this.needsLoad())try{yield this.load()}catch(d){return Promise.reject(d)}if(!this._validateVideoTrackForNetworkTests(o))throw new Error("Video track error");return this._sharedTracks.videoTrackForNetworkConnectivityTest=o,new Promise(function(d,g){u.sendMessageToCallMachine({action:"test-network-connectivity"},function(m){m.error?g(m.error):d(m.results)})})}),function(o){return l.apply(this,arguments)})},{key:"abortTestNetworkConnectivity",value:function(){this.sendMessageToCallMachine({action:"abort-test-network-connectivity"})}},{key:"getCpuLoadStats",value:function(){var o=this;return new Promise(function(u){o._callState===Ke?o.sendMessageToCallMachine({action:"get-cpu-load-stats"},function(d){u(d.cpuStats)}):u({cpuLoadState:void 0,cpuLoadStateReason:void 0,stats:{}})})}},{key:"_validateEncodingLayerHasValidProperties",value:function(o){var u;if(!(((u=Object.keys(o))===null||u===void 0?void 0:u.length)>0))throw new Error("Empty encoding is not allowed. At least one of these valid keys should be specified:"+Object.values(Rn))}},{key:"_validateVideoSendSettings",value:function(o,u){var d=o==="screenVideo"?["default-screen-video","detail-optimized","motion-optimized","motion-and-detail-balanced"]:["default-video","bandwidth-optimized","bandwidth-and-quality-balanced","quality-optimized","adaptive-2-layers","adaptive-3-layers"],g="Video send settings should be either an object or one of the supported presets: ".concat(d.join());if(typeof u=="string"){if(!d.includes(u))throw new Error(g)}else{if(U(u)!=="object")throw new Error(g);if(!u.maxQuality&&!u.encodings&&u.allowAdaptiveLayers===void 0)throw new Error("Video send settings must contain at least maxQuality, allowAdaptiveLayers or encodings attribute");if(u.maxQuality&&["low","medium","high"].indexOf(u.maxQuality)===-1)throw new Error("maxQuality must be either low, medium or high");if(u.encodings){var m=!1;switch(Object.keys(u.encodings).length){case 1:m=!u.encodings.low;break;case 2:m=!u.encodings.low||!u.encodings.medium;break;case 3:m=!u.encodings.low||!u.encodings.medium||!u.encodings.high;break;default:m=!0}if(m)throw new Error("Encodings must be defined as: low, low and medium, or low, medium and high.");u.encodings.low&&this._validateEncodingLayerHasValidProperties(u.encodings.low),u.encodings.medium&&this._validateEncodingLayerHasValidProperties(u.encodings.medium),u.encodings.high&&this._validateEncodingLayerHasValidProperties(u.encodings.high)}}}},{key:"validateUpdateSendSettings",value:function(o){var u=this;if(!o||Object.keys(o).length===0)throw new Error("Send settings must contain at least information for one track!");Object.entries(o).forEach(function(d){var g=$e(d,2),m=g[0],b=g[1];u._validateVideoSendSettings(m,b)})}},{key:"updateSendSettings",value:function(o){var u=this;return this.validateUpdateSendSettings(o),this.needsLoad()?(this._preloadCache.sendSettings=o,{sendSettings:this._preloadCache.sendSettings}):new Promise(function(d,g){u.sendMessageToCallMachine({action:"update-send-settings",sendSettings:o},function(m){m.error?g(m.error):d(m.sendSettings)})})}},{key:"getSendSettings",value:function(){return this._sendSettings||this._preloadCache.sendSettings}},{key:"getLocalAudioLevel",value:function(){return this._localAudioLevel}},{key:"getRemoteParticipantsAudioLevel",value:function(){return this._remoteParticipantsAudioLevel}},{key:"getActiveSpeaker",value:function(){return D(),this._activeSpeaker}},{key:"setActiveSpeakerMode",value:function(o){return D(),this.sendMessageToCallMachine({action:"set-active-speaker-mode",enabled:o}),this}},{key:"activeSpeakerMode",value:function(){return D(),this._activeSpeakerMode}},{key:"subscribeToTracksAutomatically",value:function(){return this._preloadCache.subscribeToTracksAutomatically}},{key:"setSubscribeToTracksAutomatically",value:function(o){return q(this._callState,"setSubscribeToTracksAutomatically()","Use the subscribeToTracksAutomatically configuration property."),this._preloadCache.subscribeToTracksAutomatically=o,this.sendMessageToCallMachine({action:"daily-method-subscribe-to-tracks-automatically",enabled:o}),this}},{key:"enumerateDevices",value:(c=O(function*(){var o=this;if(this._callObjectMode){var u=yield navigator.mediaDevices.enumerateDevices();return He()==="Firefox"&&er().major>115&&er().major<123&&(u=u.filter(function(d){return d.kind!=="audiooutput"})),{devices:u.map(function(d){var g=JSON.parse(JSON.stringify(d));if(!N()&&d.kind==="videoinput"&&d.getCapabilities){var m,b=d.getCapabilities();g.facing=(b==null||(m=b.facingMode)===null||m===void 0?void 0:m.length)>=1?b.facingMode[0]:void 0}return g})}}return new Promise(function(d){o.sendMessageToCallMachine({action:"enumerate-devices"},function(g){d({devices:g.devices})})})}),function(){return c.apply(this,arguments)})},{key:"sendAppMessage",value:function(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"*";if(q(this._callState,"sendAppMessage()"),JSON.stringify(o).length>4096)throw new Error("Message data too large. Max size is 4096");return this.sendMessageToCallMachine({action:"app-msg",data:o,to:u}),this}},{key:"addFakeParticipant",value:function(o){return D(),q(this._callState,"addFakeParticipant()"),this.sendMessageToCallMachine(P({action:"add-fake-participant"},o)),this}},{key:"setShowNamesMode",value:function(o){return Z(this._callObjectMode,"setShowNamesMode()"),D(),o&&o!=="always"&&o!=="never"?(console.error('setShowNamesMode argument should be "always", "never", or false'),this):(this.sendMessageToCallMachine({action:"set-show-names",mode:o}),this)}},{key:"setShowLocalVideo",value:function(){var o=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];return Z(this._callObjectMode,"setShowLocalVideo()"),D(),q(this._callState,"setShowLocalVideo()"),typeof o!="boolean"?(console.error("setShowLocalVideo only accepts a boolean value"),this):(this.sendMessageToCallMachine({action:"set-show-local-video",show:o}),this._showLocalVideo=o,this)}},{key:"showLocalVideo",value:function(){return Z(this._callObjectMode,"showLocalVideo()"),D(),this._showLocalVideo}},{key:"setShowParticipantsBar",value:function(){var o=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];return Z(this._callObjectMode,"setShowParticipantsBar()"),D(),q(this._callState,"setShowParticipantsBar()"),typeof o!="boolean"?(console.error("setShowParticipantsBar only accepts a boolean value"),this):(this.sendMessageToCallMachine({action:"set-show-participants-bar",show:o}),this._showParticipantsBar=o,this)}},{key:"showParticipantsBar",value:function(){return Z(this._callObjectMode,"showParticipantsBar()"),D(),this._showParticipantsBar}},{key:"customIntegrations",value:function(){return D(),Z(this._callObjectMode,"customIntegrations()"),this._customIntegrations}},{key:"setCustomIntegrations",value:function(o){return D(),Z(this._callObjectMode,"setCustomIntegrations()"),q(this._callState,"setCustomIntegrations()"),Eo(o)?(this.sendMessageToCallMachine({action:"set-custom-integrations",integrations:o}),this._customIntegrations=o,this):this}},{key:"startCustomIntegrations",value:function(o){var u=this;if(D(),Z(this._callObjectMode,"startCustomIntegrations()"),q(this._callState,"startCustomIntegrations()"),Array.isArray(o)&&o.some(function(m){return typeof m!="string"})||!Array.isArray(o)&&typeof o!="string")return console.error("startCustomIntegrations() only accepts string | string[]"),this;var d=typeof o=="string"?[o]:o,g=d.filter(function(m){return!(m in u._customIntegrations)});return g.length?(console.error(`Can't find custom integration(s): "`.concat(g.join(", "),'"')),this):(this.sendMessageToCallMachine({action:"start-custom-integrations",ids:d}),this)}},{key:"stopCustomIntegrations",value:function(o){var u=this;if(D(),Z(this._callObjectMode,"stopCustomIntegrations()"),q(this._callState,"stopCustomIntegrations()"),Array.isArray(o)&&o.some(function(m){return typeof m!="string"})||!Array.isArray(o)&&typeof o!="string")return console.error("stopCustomIntegrations() only accepts string | string[]"),this;var d=typeof o=="string"?[o]:o,g=d.filter(function(m){return!(m in u._customIntegrations)});return g.length?(console.error(`Can't find custom integration(s): "`.concat(g.join(", "),'"')),this):(this.sendMessageToCallMachine({action:"stop-custom-integrations",ids:d}),this)}},{key:"customTrayButtons",value:function(){return Z(this._callObjectMode,"customTrayButtons()"),D(),this._customTrayButtons}},{key:"updateCustomTrayButtons",value:function(o){return Z(this._callObjectMode,"updateCustomTrayButtons()"),D(),q(this._callState,"updateCustomTrayButtons()"),ko(o)?(this.sendMessageToCallMachine({action:"update-custom-tray-buttons",btns:o}),this._customTrayButtons=o,this):(console.error("updateCustomTrayButtons only accepts a dictionary of the type ".concat(JSON.stringify(on))),this)}},{key:"theme",value:function(){return Z(this._callObjectMode,"theme()"),this.properties.theme}},{key:"setTheme",value:function(o){var u=this;return Z(this._callObjectMode,"setTheme()"),new Promise(function(d,g){try{u.validateProperties({theme:o}),u.properties.theme=P({},o),u.sendMessageToCallMachine({action:"set-theme",theme:u.properties.theme});try{u.emitDailyJSEvent({action:rc,theme:u.properties.theme})}catch(m){console.log("could not emit 'theme-updated'",m)}d(u.properties.theme)}catch(m){g(m)}})}},{key:"requestFullscreen",value:(a=O(function*(){if(D(),this._iframe&&!document.fullscreenElement&&es())try{(yield this._iframe.requestFullscreen)?this._iframe.requestFullscreen():this._iframe.webkitRequestFullscreen()}catch(o){console.log("could not make video call fullscreen",o)}}),function(){return a.apply(this,arguments)})},{key:"exitFullscreen",value:function(){D(),document.fullscreenElement?document.exitFullscreen():document.webkitFullscreenElement&&document.webkitExitFullscreen()}},{key:"getSidebarView",value:(s=O(function*(){var o=this;return this._callObjectMode?(console.error("getSidebarView is not available in callObject mode"),Promise.resolve(null)):new Promise(function(u){o.sendMessageToCallMachine({action:"get-sidebar-view"},function(d){u(d.view)})})}),function(){return s.apply(this,arguments)})},{key:"setSidebarView",value:function(o){return this._callObjectMode?(console.error("setSidebarView is not available in callObject mode"),this):(this.sendMessageToCallMachine({action:"set-sidebar-view",view:o}),this)}},{key:"room",value:(i=O(function*(){var o=this,u=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).includeRoomConfigDefaults,d=u===void 0||u;return this._accessState.access===Cn||this.needsLoad()?this.properties.url?{roomUrlPendingJoin:this.properties.url}:null:new Promise(function(g){o.sendMessageToCallMachine({action:"lib-room-info",includeRoomConfigDefaults:d},function(m){delete m.action,delete m.callbackStamp,g(m)})})}),function(){return i.apply(this,arguments)})},{key:"geo",value:(r=O(function*(){try{var o=yield fetch("https://gs.daily.co/_ks_/x-swsl/:");return{current:(yield o.json()).geo}}catch(u){return console.error("geo lookup failed",u),{current:""}}}),function(){return r.apply(this,arguments)})},{key:"setNetworkTopology",value:(n=O(function*(o){var u=this;return D(),q(this._callState,"setNetworkTopology()"),new Promise(function(d,g){u.sendMessageToCallMachine({action:"set-network-topology",opts:o},function(m){m.error?g({error:m.error}):d({workerId:m.workerId})})})}),function(o){return n.apply(this,arguments)})},{key:"getNetworkTopology",value:(e=O(function*(){var o=this;return new Promise(function(u,d){o.needsLoad()&&u({topology:"none"}),o.sendMessageToCallMachine({action:"get-network-topology"},function(g){g.error?d({error:g.error}):u({topology:g.topology})})})}),function(){return e.apply(this,arguments)})},{key:"setPlayNewParticipantSound",value:function(o){if(D(),typeof o!="number"&&o!==!0&&o!==!1)throw new Error("argument to setShouldPlayNewParticipantSound should be true, false, or a number, but is ".concat(o));this.sendMessageToCallMachine({action:"daily-method-set-play-ding",arg:o})}},{key:"on",value:function(o,u){return ke.prototype.on.call(this,o,u)}},{key:"once",value:function(o,u){return ke.prototype.once.call(this,o,u)}},{key:"off",value:function(o,u){return ke.prototype.off.call(this,o,u)}},{key:"validateProperties",value:function(o){for(var u in o){if(!Fe[u])throw new Error("unrecognized property '".concat(u,"'"));if(Fe[u].validate&&!Fe[u].validate(o[u],this))throw new Error("property '".concat(u,"': ").concat(Fe[u].help))}}},{key:"assembleMeetingUrl",value:function(){var o,u,d=P(P({},this.properties),{},{emb:this.callClientId,embHref:encodeURIComponent(window.location.href),proxy:(o=this.properties.dailyConfig)!==null&&o!==void 0&&o.proxyUrl?encodeURIComponent((u=this.properties.dailyConfig)===null||u===void 0?void 0:u.proxyUrl):void 0}),g=d.url.match(/\?/)?"&":"?";return d.url+g+Object.keys(Fe).filter(function(m){return Fe[m].queryString&&d[m]!==void 0}).map(function(m){return"".concat(Fe[m].queryString,"=").concat(d[m])}).join("&")}},{key:"needsLoad",value:function(){return[qi,Ji,Ie,Te].includes(this._callState)}},{key:"sendMessageToCallMachine",value:function(o,u){if(this._destroyed&&(this._logUseAfterDestroy(),this.strictMode))throw new Error("Use after destroy");this._messageChannel.sendMessageToCallMachine(o,u,this._iframe,this.callClientId)}},{key:"forwardPackagedMessageToCallMachine",value:function(o){this._messageChannel.forwardPackagedMessageToCallMachine(o,this._iframe,this.callClientId)}},{key:"addListenerForPackagedMessagesFromCallMachine",value:function(o){return this._messageChannel.addListenerForPackagedMessagesFromCallMachine(o,this.callClientId)}},{key:"removeListenerForPackagedMessagesFromCallMachine",value:function(o){this._messageChannel.removeListenerForPackagedMessagesFromCallMachine(o)}},{key:"handleMessageFromCallMachine",value:function(o){switch(o.action){case tc:this.sendMessageToCallMachine(P({action:nc},this.properties));break;case"call-machine-initialized":this._callMachineInitialized=!0;var u={action:Vt,level:"log",code:1011,stats:{event:"bundle load",time:this._bundleLoadTime==="no-op"?0:this._bundleLoadTime,preLoaded:this._bundleLoadTime==="no-op",url:Xt(this.properties.dailyConfig)}};this.sendMessageToCallMachine(u),this._delayDuplicateInstanceLog&&this._logDuplicateInstanceAttempt();break;case $i:this._loadedCallback&&(this._loadedCallback(),this._loadedCallback=null),this.emitDailyJSEvent(o);break;case lc:this._joinedCallback&&(this._joinedCallback(o.participants),this._joinedCallback=null),this.emitDailyJSEvent(o);break;case dc:case hc:if(this._callState===Ie)return;if(o.participant&&o.participant.session_id){var d=o.participant.local?"local":o.participant.session_id;if(this._callObjectMode){var g=this._callMachine().store;os(o.participant,g),as(o.participant,g),cs(o.participant,this._participants[d],g)}try{this.maybeParticipantTracksStopped(this._participants[d],o.participant),this.maybeParticipantTracksStarted(this._participants[d],o.participant),this.maybeEventRecordingStopped(this._participants[d],o.participant),this.maybeEventRecordingStarted(this._participants[d],o.participant)}catch(bn){console.error("track events error",bn)}this.compareEqualForParticipantUpdateEvent(o.participant,this._participants[d])||(this._participants[d]=P({},o.participant),this.toggleParticipantAudioBasedOnNativeAudioFocus(),this.emitDailyJSEvent(o))}break;case pc:if(o.participant&&o.participant.session_id){var m=this._participants[o.participant.session_id];m&&this.maybeParticipantTracksStopped(m,null),delete this._participants[o.participant.session_id],this.emitDailyJSEvent(o)}break;case fc:K(this._participantCounts,o.participantCounts)||(this._participantCounts=o.participantCounts,this.emitDailyJSEvent(o));break;case mc:var b={access:o.access};o.awaitingAccess&&(b.awaitingAccess=o.awaitingAccess),K(this._accessState,b)||(this._accessState=b,this.emitDailyJSEvent(o));break;case gc:if(o.meetingSession){this._meetingSessionSummary=o.meetingSession,this.emitDailyJSEvent(o);var E=P(P({},o),{},{action:"meeting-session-updated"});this.emitDailyJSEvent(E)}break;case Hi:var C;this._iframe&&!o.preserveIframe&&(this._iframe.src=""),this._updateCallState(Te),this.resetMeetingDependentVars(),this._loadedCallback&&(this._loadedCallback(o.errorMsg),this._loadedCallback=null),o.preserveIframe;var x=Gr(o,Tl);x!=null&&(C=x.error)!==null&&C!==void 0&&C.details&&(x.error.details=JSON.parse(x.error.details)),this._maybeSendToSentry(o),this._joinedCallback&&(this._joinedCallback(null,x),this._joinedCallback=null),this.emitDailyJSEvent(x);break;case uc:this._callState!==Te&&this._updateCallState(Ie),this.resetMeetingDependentVars(),this._resolveLeave&&(this._resolveLeave(),this._resolveLeave=null),this.emitDailyJSEvent(o);break;case"selected-devices-updated":o.devices&&this.emitDailyJSEvent(o);break;case Uc:var Y=o.threshold,G=o.quality;Y===this._network.threshold&&G===this._network.quality||(this._network.quality=G,this._network.threshold=Y,this.emitDailyJSEvent(o));break;case Jc:o&&o.cpuLoadState&&this.emitDailyJSEvent(o);break;case Vc:o&&o.faceCounts!==void 0&&this.emitDailyJSEvent(o);break;case Bc:var _e=o.activeSpeaker;this._activeSpeaker.peerId!==_e.peerId&&(this._activeSpeaker.peerId=_e.peerId,this.emitDailyJSEvent({action:o.action,activeSpeaker:this._activeSpeaker}));break;case"show-local-video-changed":if(this._callObjectMode)return;var Ee=o.show;this._showLocalVideo=Ee,this.emitDailyJSEvent({action:o.action,show:Ee});break;case Fc:var be=o.enabled;this._activeSpeakerMode!==be&&(this._activeSpeakerMode=be,this.emitDailyJSEvent({action:o.action,enabled:this._activeSpeakerMode}));break;case yc:case _c:case bc:this._waitingParticipants=o.allWaitingParticipants,this.emitDailyJSEvent({action:o.action,participant:o.participant});break;case Wc:K(this._receiveSettings,o.receiveSettings)||(this._receiveSettings=o.receiveSettings,this.emitDailyJSEvent({action:o.action,receiveSettings:o.receiveSettings}));break;case Qc:if(!K(this._inputSettings,o.inputSettings)){var _n=this._getInputSettings();this._inputSettings=o.inputSettings,this._preloadCache.inputSettings={},K(_n,this._getInputSettings())||this.emitDailyJSEvent({action:o.action,inputSettings:this._getInputSettings()})}break;case"send-settings-updated":K(this._sendSettings,o.sendSettings)||(this._sendSettings=o.sendSettings,this._preloadCache.sendSettings=null,this.emitDailyJSEvent({action:o.action,sendSettings:o.sendSettings}));break;case"local-audio-level":this._localAudioLevel=o.audioLevel,this._preloadCache.localAudioLevelObserver=null,this.emitDailyJSEvent(o);break;case"remote-participants-audio-level":this._remoteParticipantsAudioLevel=o.participantsAudioLevel,this._preloadCache.remoteParticipantsAudioLevelObserver=null,this.emitDailyJSEvent(o);break;case xc:var H=o.session_id;this._rmpPlayerState[H]=o.playerState,this.emitDailyJSEvent(o);break;case Lc:delete this._rmpPlayerState[o.session_id],this.emitDailyJSEvent(o);break;case Dc:var me=o.session_id,Ne=this._rmpPlayerState[me];Ne&&this.compareEqualForRMPUpdateEvent(Ne,o.remoteMediaPlayerState)||(this._rmpPlayerState[me]=o.remoteMediaPlayerState,this.emitDailyJSEvent(o));break;case"custom-button-click":case"sidebar-view-changed":this.emitDailyJSEvent(o);break;case vc:var xt=this._meetingSessionState.topology!==(o.meetingSessionState&&o.meetingSessionState.topology);this._meetingSessionState=Ln(o.meetingSessionState,this._callObjectMode),(this._callObjectMode||xt)&&this.emitDailyJSEvent(o);break;case Nc:this._isScreenSharing=!0,this.emitDailyJSEvent(o);break;case jc:case Ic:this._isScreenSharing=!1,this.emitDailyJSEvent(o);break;case Gi:case zi:case Cc:case Mc:case Oc:case kc:case Ec:case Tc:case oc:case ac:case Ac:case Rc:case qc:case Pc:case $c:case Gc:case zc:case Yc:case Yi:case Hc:case"dialin-ready":case"dialin-connected":case"dialin-error":case"dialin-stopped":case"dialin-warning":case"dialout-connected":case"dialout-answered":case"dialout-error":case"dialout-stopped":case"dialout-warning":this.emitDailyJSEvent(o);break;case"request-fullscreen":this.requestFullscreen();break;case"request-exit-fullscreen":this.exitFullscreen()}}},{key:"maybeEventRecordingStopped",value:function(o,u){var d="record";o&&(u.local||u[d]!==!1||o[d]===u[d]||this.emitDailyJSEvent({action:zi}))}},{key:"maybeEventRecordingStarted",value:function(o,u){var d="record";o&&(u.local||u[d]!==!0||o[d]===u[d]||this.emitDailyJSEvent({action:Gi}))}},{key:"maybeEventTrackStopped",value:function(o,u,d,g){o&&(o.readyState!=="ended"&&u&&o.id===u.id||this.emitDailyJSEvent({action:Sc,track:o,participant:d,type:g}))}},{key:"maybeEventTrackStarted",value:function(o,u,d,g){u&&(o&&o.readyState!=="ended"&&u.id===o.id||this.emitDailyJSEvent({action:wc,track:u,participant:d,type:g}))}},{key:"maybeParticipantTracksStopped",value:function(o,u){if(o)for(var d in o.tracks)this.maybeEventTrackStopped(o.tracks[d].track,u&&u.tracks[d]?u.tracks[d].track:null,u,d)}},{key:"maybeParticipantTracksStarted",value:function(o,u){if(u)for(var d in u.tracks)this.maybeEventTrackStarted(o&&o.tracks[d]?o.tracks[d].track:null,u.tracks[d].track,u,d)}},{key:"compareEqualForRMPUpdateEvent",value:function(o,u){var d,g;return o.state===u.state&&((d=o.settings)===null||d===void 0?void 0:d.volume)===((g=u.settings)===null||g===void 0?void 0:g.volume)}},{key:"emitDailyJSEvent",value:function(o){try{o.callClientId=this.callClientId,this.emit(o.action,o)}catch(u){console.log("could not emit",o,u)}}},{key:"compareEqualForParticipantUpdateEvent",value:function(o,u){return!!K(o,u)&&(!o.videoTrack||!u.videoTrack||o.videoTrack.id===u.videoTrack.id&&o.videoTrack.muted===u.videoTrack.muted&&o.videoTrack.enabled===u.videoTrack.enabled)&&(!o.audioTrack||!u.audioTrack||o.audioTrack.id===u.audioTrack.id&&o.audioTrack.muted===u.audioTrack.muted&&o.audioTrack.enabled===u.audioTrack.enabled)}},{key:"nativeUtils",value:function(){return N()?typeof DailyNativeUtils>"u"?(console.warn("in React Native, DailyNativeUtils is expected to be available"),null):DailyNativeUtils:null}},{key:"updateIsPreparingToJoin",value:function(o){this._updateCallState(this._callState,o)}},{key:"_updateCallState",value:function(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._isPreparingToJoin;if(o!==this._callState||u!==this._isPreparingToJoin){var d=this._callState,g=this._isPreparingToJoin;this._callState=o,this._isPreparingToJoin=u;var m=Wt(d,g),b=Wt(this._callState,this._isPreparingToJoin);m!==b&&(this.updateKeepDeviceAwake(b),this.updateDeviceAudioMode(b),this.updateShowAndroidOngoingMeetingNotification(b),this.updateNoOpRecordingEnsuringBackgroundContinuity(b))}}},{key:"resetMeetingDependentVars",value:function(){this._participants={},this._participantCounts=gs,this._waitingParticipants={},this._activeSpeaker={},this._activeSpeakerMode=!1,this._didPreAuth=!1,this._accessState={access:Cn},this._finalSummaryOfPrevSession=this._meetingSessionSummary,this._meetingSessionSummary={},this._meetingSessionState=Ln(ms,this._callObjectMode),this._isScreenSharing=!1,this._receiveSettings={},this._inputSettings=void 0,this._sendSettings={},this._localAudioLevel=0,this._isLocalAudioLevelObserverRunning=!1,this._remoteParticipantsAudioLevel={},this._isRemoteParticipantsAudioLevelObserverRunning=!1,this._callMachineInitialized=!1,this._bundleLoadTime=void 0,this._preloadCache}},{key:"updateKeepDeviceAwake",value:function(o){N()&&this.nativeUtils().setKeepDeviceAwake(o,this.callClientId)}},{key:"updateDeviceAudioMode",value:function(o){if(N()&&!this.disableReactNativeAutoDeviceManagement("audio")){var u=o?this._nativeInCallAudioMode:"idle";this.nativeUtils().setAudioMode(u)}}},{key:"updateShowAndroidOngoingMeetingNotification",value:function(o){if(N()&&this.nativeUtils().setShowOngoingMeetingNotification){var u,d,g,m;if(this.properties.reactNativeConfig&&this.properties.reactNativeConfig.androidInCallNotification){var b=this.properties.reactNativeConfig.androidInCallNotification;u=b.title,d=b.subtitle,g=b.iconName,m=b.disableForCustomOverride}m&&(o=!1),this.nativeUtils().setShowOngoingMeetingNotification(o,u,d,g,this.callClientId)}}},{key:"updateNoOpRecordingEnsuringBackgroundContinuity",value:function(o){N()&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity(o)}},{key:"toggleParticipantAudioBasedOnNativeAudioFocus",value:function(){var o,u;if(N()){var d=(o=this._callMachine())===null||o===void 0||(u=o.store)===null||u===void 0?void 0:u.getState();for(var g in d==null?void 0:d.streams){var m=d.streams[g];m&&m.pendingTrack&&m.pendingTrack.kind==="audio"&&(m.pendingTrack.enabled=this._hasNativeAudioFocus)}}}},{key:"disableReactNativeAutoDeviceManagement",value:function(o){return this.properties.reactNativeConfig&&this.properties.reactNativeConfig.disableAutoDeviceManagement&&this.properties.reactNativeConfig.disableAutoDeviceManagement[o]}},{key:"absoluteUrl",value:function(o){if(o!==void 0){var u=document.createElement("a");return u.href=o,u.href}}},{key:"sayHello",value:function(){var o="hello, world.";return console.log(o),o}},{key:"_logUseAfterDestroy",value:function(){var o=Object.values(Be)[0];if(this.needsLoad())if(o&&!o.needsLoad()){var u={action:Vt,level:"error",code:this.strictMode?9995:9997};o.sendMessageToCallMachine(u)}else this.strictMode||console.error("You are are attempting to use a call instance that was previously destroyed, which is unsupported. Please remove `strictMode: false` from your constructor properties to enable strict mode to track down and fix this unsupported usage.");else{var d={action:Vt,level:"error",code:this.strictMode?9995:9997};this._messageChannel.sendMessageToCallMachine(d,null,this._iframe,this.callClientId)}}},{key:"_logDuplicateInstanceAttempt",value:function(){var o=Object.values(Be)[0],u=o._callMachineInitialized?o:this._callMachineInitialized?this:void 0;u?(u.sendMessageToCallMachine({action:Vt,level:"warn",code:this.allowMultipleCallInstances?9993:9992}),this._delayDuplicateInstanceLog=!1):(this._delayDuplicateInstanceLog=!0,o._delayDuplicateInstanceLog=!0)}},{key:"_maybeSendToSentry",value:function(o){var u,d,g,m,b,E;if(!((u=o.error)!==null&&u!==void 0&&u.type&&!["connection-error","end-of-life","no-room"].includes(o.error.type))){var C=(d=this.properties)!==null&&d!==void 0&&d.url?new URL(this.properties.url):void 0,x="production";C&&C.host.includes(".staging.daily")&&(x="staging");var Y,G,_e,Ee,be,_n=new Va({dsn:"https://f10f1c81e5d44a4098416c0867a8b740@o77906.ingest.sentry.io/168844",transport:$a,integrations:[new Ui.GlobalHandlers({onunhandledrejection:!1}),new Ui.HttpContext],environment:x}),H=new br(_n,void 0,ne.version());if(this.session_id&&H.setExtra("sessionId",this.session_id),this.properties){var me=P({},this.properties);me.userName=me.userName?"[Filtered]":void 0,me.userData=me.userData?"[Filtered]":void 0,me.token=me.token?"[Filtered]":void 0,H.setExtra("properties",me)}if(C){var Ne=C.searchParams.get("domain");if(!Ne){var xt=C.host.match(/(.*?)\./);Ne=xt&&xt[1]||""}Ne&&H.setTag("domain",Ne)}o.error&&(H.setTag("fatalErrorType",o.error.type),H.setExtra("errorDetails",o.error.details),!((Y=o.error.details)===null||Y===void 0)&&Y.uri&&H.setTag("serverAddress",o.error.details.uri),!((G=o.error.details)===null||G===void 0)&&G.workerGroup&&H.setTag("workerGroup",o.error.details.workerGroup),!((_e=o.error.details)===null||_e===void 0)&&_e.geoGroup&&H.setTag("geoGroup",o.error.details.geoGroup),!((Ee=o.error.details)===null||Ee===void 0)&&Ee.on&&H.setTag("connectionAttempt",o.error.details.on),(be=o.error.details)!==null&&be!==void 0&&be.bundleUrl&&(H.setTag("bundleUrl",o.error.details.bundleUrl),H.setTag("bundleError",o.error.details.sourceError.type))),H.setTags({callMode:this._callObjectMode?N()?"reactNative":(g=this.properties)!==null&&g!==void 0&&(m=g.dailyConfig)!==null&&m!==void 0&&(b=m.callMode)!==null&&b!==void 0&&b.includes("prebuilt")?this.properties.dailyConfig.callMode:"custom":"prebuilt-frame",version:ne.version()});var bn=((E=o.error)===null||E===void 0?void 0:E.msg)||o.errorMsg;H.run(function(Qo){Qo.captureException(new Error(bn))})}}},{key:"_callMachine",value:function(){var o,u,d;return(o=window._daily)===null||o===void 0||(u=o.instances)===null||u===void 0||(d=u[this.callClientId])===null||d===void 0?void 0:d.callMachine}}],[{key:"supportedBrowser",value:function(){if(N())return{supported:!0,mobile:!0,name:"React Native",version:null,supportsScreenShare:!0,supportsSfu:!0,supportsVideoProcessing:!1,supportsAudioProcessing:!1};var o=oa.getParser(de());return{supported:!!ts(),mobile:o.getPlatformType()==="mobile",name:o.getBrowserName(),version:o.getBrowserVersion(),supportsFullscreen:!!es(),supportsScreenShare:!!Zc(),supportsSfu:!!ts(),supportsVideoProcessing:uo(),supportsAudioProcessing:ho()}}},{key:"version",value:function(){return"0.68.0"}},{key:"createCallObject",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return o.layout="none",new ne(null,o)}},{key:"wrap",value:function(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(D(),!o||!o.contentWindow||typeof o.src!="string")throw new Error("DailyIframe::Wrap needs an iframe-like first argument");return u.layout||(u.customLayout?u.layout="custom-v1":u.layout="browser"),new ne(o,u)}},{key:"createFrame",value:function(o,u){var d,g;D(),o&&u?(d=o,g=u):o&&o.append?(d=o,g={}):(d=document.body,g=o||{});var m=g.iframeStyle;m||(m=d===document.body?{position:"fixed",border:"1px solid black",backgroundColor:"white",width:"375px",height:"450px",right:"1em",bottom:"1em"}:{border:0,width:"100%",height:"100%"});var b=document.createElement("iframe");window.navigator&&window.navigator.userAgent.match(/Chrome\/61\./)?b.allow="microphone, camera":b.allow="microphone; camera; autoplay; display-capture; screen-wake-lock",b.style.visibility="hidden",d.appendChild(b),b.style.visibility=null,Object.keys(m).forEach(function(E){return b.style[E]=m[E]}),g.layout||(g.customLayout?g.layout="custom-v1":g.layout="browser");try{return new ne(b,g)}catch(E){throw d.removeChild(b),E}}},{key:"createTransparentFrame",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};D();var u=document.createElement("iframe");return u.allow="microphone; camera; autoplay",u.style.cssText=`
32
+ position: fixed;
33
+ top: 0;
34
+ left: 0;
35
+ width: 100%;
36
+ height: 100%;
37
+ border: 0;
38
+ pointer-events: none;
39
+ `,document.body.appendChild(u),o.layout||(o.layout="custom-v1"),ne.wrap(u,o)}},{key:"getCallInstance",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0;return o?Be[o]:Object.values(Be)[0]}}]),ne}();function Qe(t,e){var n={};for(var r in t)if(t[r]instanceof MediaStreamTrack)n[r]=yt;else if(r==="dailyConfig"){if(t[r].modifyLocalSdpHook){var i=window._daily.instances[e].customCallbacks||{};i.modifyLocalSdpHook=t[r].modifyLocalSdpHook,window._daily.instances[e].customCallbacks=i,delete t[r].modifyLocalSdpHook}if(t[r].modifyRemoteSdpHook){var s=window._daily.instances[e].customCallbacks||{};s.modifyRemoteSdpHook=t[r].modifyRemoteSdpHook,window._daily.instances[e].customCallbacks=s,delete t[r].modifyRemoteSdpHook}n[r]=t[r]}else n[r]=t[r];return n}function q(t){var e=arguments.length>2?arguments[2]:void 0;if(t!==Ke){var n="".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method"," only supported after join.");throw e&&(n+=" ".concat(e)),console.error(n),new Error(n)}}function Wt(t,e){return[Kn,Ke].includes(t)||e}function xn(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"This daily-js method",r=arguments.length>3?arguments[3]:void 0;if(Wt(t,e)){var i="".concat(n," not supported after joining a meeting.");throw r&&(i+=" ".concat(r)),console.error(i),new Error(i)}}function zt(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method",n=arguments.length>2?arguments[2]:void 0;if(!t){var r="".concat(e,arguments.length>3&&arguments[3]!==void 0&&arguments[3]?" requires preAuth() or startCamera() to initialize call state.":" requires preAuth(), startCamera(), or join() to initialize call state.");throw n&&(r+=" ".concat(n)),console.error(r),new Error(r)}}function Dn(t){if(t){var e="A pre-call quality test is in progress. Please try ".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method"," again once testing has completed. Use stopTestCallQuality() to end it early.");throw console.error(e),new Error(e)}}function ae(t){if(!t){var e="".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method"," is only supported on custom callObject instances");throw console.error(e),new Error(e)}}function Z(t){if(t){var e="".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method"," is only supported as part of Daily's Prebuilt");throw console.error(e),new Error(e)}}function D(){if(N())throw new Error("This daily-js method is not currently supported in React Native")}function mt(){if(!N())throw new Error("This daily-js method is only supported in React Native")}function vo(t){if(t===void 0)return!0;var e;if(typeof t=="string")e=t;else try{e=JSON.stringify(t),K(JSON.parse(e),t)||console.warn("The userData provided will be modified when serialized.")}catch(n){throw Error("userData must be serializable to JSON: ".concat(n))}if(e.length>4096)throw Error("userData is too large (".concat(e.length," characters). Maximum size suppported is ").concat(4096,"."));return!0}function yo(t,e){for(var n=e.allowAllParticipantsKey,r=function(f){var _=["local"];return n||_.push("*"),f&&!_.includes(f)},i=function(f){return!!(f.layer===void 0||Number.isInteger(f.layer)&&f.layer>=0||f.layer==="inherit")},s=function(f){return!!f&&!(f.video&&!i(f.video))&&!(f.screenVideo&&!i(f.screenVideo))},a=0,c=Object.entries(t);a<c.length;a++){var l=$e(c[a],2),p=l[0],h=l[1];if(!r(p)||!s(h))return!1}return!0}function _o(t){return U(t)==="object"&&!(t.video&&(U(t.video)!=="object"||!function(i){var s=["type","config"];return!i||U(i)!=="object"||!function(a){return typeof a!="string"?!1:Object.values(Ht).includes(a)?!0:(console.error("inputSettings video processor type invalid"),!1)}(i.type)||i.config&&(U(i.config)!=="object"||!function(a,c){var l=Object.keys(c);if(l.length===0)return!0;var p="invalid object in inputSettings -> video -> processor -> config";switch(a){case Ht.BGBLUR:return l.length>1||l[0]!=="strength"?(console.error(p),!1):!(typeof c.strength!="number"||c.strength<=0||c.strength>1||isNaN(c.strength))||(console.error("".concat(p,"; expected: {0 < strength <= 1}, got: ").concat(c.strength)),!1);case Ht.BGIMAGE:return!(c.source!==void 0&&!function(h){if(h.source==="default")return h.type="default",!0;if(h.source instanceof ArrayBuffer)return!0;if(St(h.source))return h.type="url",!!function(k){var y=new URL(k),w=y.pathname;if(y.protocol==="data:")try{var T=w.substring(w.indexOf(":")+1,w.indexOf(";")).split("/")[1];return On.includes(T)}catch(B){return console.error("failed to deduce blob content type",B),!1}var M=w.split(".").at(-1).toLowerCase().trim();return On.includes(M)}(h.source)||(console.error("invalid image type; supported types: [".concat(On.join(", "),"]")),!1);return f=h.source,_=Number(f),isNaN(_)||!Number.isInteger(_)||_<=0||_>Xi?(console.error("invalid image selection; must be an int, > 0, <= ".concat(Xi)),!1):(h.type="daily-preselect",!0);var f,_}(c));default:return!0}}(i.type,i.config))?!1:(Object.keys(i).filter(function(a){return!s.includes(a)}).forEach(function(a){console.warn("invalid key inputSettings -> video -> processor : ".concat(a)),delete i[a]}),!0)}(t.video.processor)))&&!(t.audio&&(U(t.audio)!=="object"||(n=t.audio.processor,r=["type"],!n||U(n)!=="object"||(Object.keys(n).filter(function(i){return!r.includes(i)}).forEach(function(i){console.warn("invalid key inputSettings -> audio -> processor : ".concat(i)),delete n[i]}),e=n.type,typeof e!="string"||!Object.values(co).includes(e)&&(console.error("inputSettings audio processor type invalid"),1)))));var e,n,r}function bo(t,e){var n,r=[];t.video&&!uo((n=e==null?void 0:e.useLegacyVideoProcessor)!==null&&n!==void 0&&n)&&(delete t.video,r.push("video")),t.audio&&!ho()&&(delete t.audio,r.push("audio")),r.length>0&&console.error("Ignoring settings for browser- or platform-unsupported input processor(s): ".concat(r.join(", ")))}function or(){var t=Object.values(Ht).join(" | "),e=Object.values(co).join(" | ");return"inputSettings must be of the form: { video?: { processor: { type: [ ".concat(t," ], config?: {} } }, audio?: { processor: {type: [ ").concat(e," ] } } }")}function wo(t){var e=t.allowAllParticipantsKey;return"receiveSettings must be of the form { [<remote participant id> | ".concat(Za).concat(e?' | "'.concat(ec,'"'):"","]: ")+'{ [video: [{ layer: [<non-negative integer> | "inherit"] } | "inherit"]], [screenVideo: [{ layer: [<non-negative integer> | "inherit"] } | "inherit"]] }}}'}function So(){return"customIntegrations should be an object of type ".concat(JSON.stringify(sr),".")}function ko(t){if(t&&U(t)!=="object"||Array.isArray(t))return console.error("customTrayButtons should be an Object of the type ".concat(JSON.stringify(on),".")),!1;if(t)for(var e=0,n=Object.entries(t);e<n.length;e++)for(var r=$e(n[e],1)[0],i=0,s=Object.entries(t[r]);i<s.length;i++){var a=$e(s[i],2),c=a[0],l=a[1];if(c==="iconPath"&&!St(l)||c==="iconPathDarkMode"&&!St(l))return console.error("customTrayButton ".concat(c," should be a url.")),!1;var p=on.id[c];if(!p)return console.error("customTrayButton does not support key ".concat(c)),!1;if(U(l)!==p)return console.error("customTrayButton ".concat(c," should be a ").concat(p,".")),!1}return!0}function Eo(t){if(!t||t&&U(t)!=="object"||Array.isArray(t))return console.error(So()),!1;for(var e=function(f){return"".concat(f," should be ").concat(sr.id[f])},n=function(f,_){return console.error("customIntegration ".concat(f,": ").concat(_))},r=0,i=Object.entries(t);r<i.length;r++){var s=$e(i[r],1)[0];if(!("label"in t[s]))return n(s,"label is required"),!1;if(!("location"in t[s]))return n(s,"location is required"),!1;if(!("src"in t[s])&&!("srcdoc"in t[s]))return n(s,"src or srcdoc is required"),!1;for(var a=0,c=Object.entries(t[s]);a<c.length;a++){var l=$e(c[a],2),p=l[0],h=l[1];switch(p){case"allow":case"csp":case"name":case"referrerPolicy":case"sandbox":if(typeof h!="string")return n(s,e(p)),!1;break;case"iconURL":if(!St(h))return n(s,"".concat(p," should be a url")),!1;break;case"src":if("srcdoc"in t[s])return n(s,"cannot have both src and srcdoc"),!1;if(!St(h))return n(s,'src "'.concat(h,'" is not a valid URL')),!1;break;case"srcdoc":if("src"in t[s])return n(s,"cannot have both src and srcdoc"),!1;if(typeof h!="string")return n(s,e(p)),!1;break;case"location":if(!["main","sidebar"].includes(h))return n(s,e(p)),!1;break;case"controlledBy":if(h!=="*"&&h!=="owners"&&(!Array.isArray(h)||h.some(function(f){return typeof f!="string"})))return n(s,e(p)),!1;break;case"shared":if((!Array.isArray(h)||h.some(function(f){return typeof f!="string"}))&&h!=="owners"&&typeof h!="boolean")return n(s,e(p)),!1;break;default:if(!sr.id[p])return console.error("customIntegration does not support key ".concat(p)),!1}}}return!0}function To(t,e){if(e===void 0)return!1;switch(U(e)){case"string":return U(t)===e;case"object":if(U(t)!=="object")return!1;for(var n in t)if(!To(t[n],e[n]))return!1;return!0;default:return!1}}function _s(t,e){var n=t.sessionId,r=t.toEndPoint,i=t.useSipRefer;if(!n||!r)throw new Error("".concat(e,"() requires a sessionId and toEndPoint"));if(typeof n!="string"||typeof r!="string")throw new Error("Invalid paramater: sessionId and toEndPoint must be of type string");if(i&&!r.startsWith("sip:"))throw new Error('"toEndPoint" must be a "sip" address');if(!r.startsWith("sip:")&&!r.startsWith("+"))throw new Error("toEndPoint: ".concat(r,' must starts with either "sip:" or "+"'))}function bs(t){if(U(t)!=="object")throw new Error('RemoteMediaPlayerSettings: must be "object" type');if(t.state&&!Object.values(Xn).includes(t.state))throw new Error("Invalid value for RemoteMediaPlayerSettings.state, valid values are: "+JSON.stringify(Xn));if(t.volume){if(typeof t.volume!="number")throw new Error('RemoteMediaPlayerSettings.volume: must be "number" type');if(t.volume<0||t.volume>2)throw new Error("RemoteMediaPlayerSettings.volume: must be between 0.0 - 2.0")}}function ws(t,e,n){return!(typeof t!="number"||t<e||t>n)}function Ln(t,e){return t&&!e&&delete t.data,t}function Co(t,e){return function(){return t.apply(e,arguments)}}const{toString:Pl}=Object.prototype,{getPrototypeOf:Cr}=Object,fn=(t=>e=>{const n=Pl.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),fe=t=>(t=t.toLowerCase(),e=>fn(e)===t),mn=t=>e=>typeof e===t,{isArray:ut}=Array,Ot=mn("undefined");function Al(t){return t!==null&&!Ot(t)&&t.constructor!==null&&!Ot(t.constructor)&&ie(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Mo=fe("ArrayBuffer");function Rl(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Mo(t.buffer),e}const xl=mn("string"),ie=mn("function"),Oo=mn("number"),gn=t=>t!==null&&typeof t=="object",Dl=t=>t===!0||t===!1,Qt=t=>{if(fn(t)!=="object")return!1;const e=Cr(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},Ll=fe("Date"),Nl=fe("File"),jl=fe("Blob"),Il=fe("FileList"),Bl=t=>gn(t)&&ie(t.pipe),Fl=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||ie(t.append)&&((e=fn(t))==="formdata"||e==="object"&&ie(t.toString)&&t.toString()==="[object FormData]"))},Ul=fe("URLSearchParams"),[ql,Jl,Vl,$l]=["ReadableStream","Request","Response","Headers"].map(fe),Gl=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function At(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,i;if(typeof t!="object"&&(t=[t]),ut(t))for(r=0,i=t.length;r<i;r++)e.call(null,t[r],r,t);else{const s=n?Object.getOwnPropertyNames(t):Object.keys(t),a=s.length;let c;for(r=0;r<a;r++)c=s[r],e.call(null,t[c],c,t)}}function Po(t,e){e=e.toLowerCase();const n=Object.keys(t);let r=n.length,i;for(;r-- >0;)if(i=n[r],e===i.toLowerCase())return i;return null}const Ao=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ro=t=>!Ot(t)&&t!==Ao;function ar(){const{caseless:t}=Ro(this)&&this||{},e={},n=(r,i)=>{const s=t&&Po(e,i)||i;Qt(e[s])&&Qt(r)?e[s]=ar(e[s],r):Qt(r)?e[s]=ar({},r):ut(r)?e[s]=r.slice():e[s]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&At(arguments[r],n);return e}const zl=(t,e,n,{allOwnKeys:r}={})=>(At(e,(i,s)=>{n&&ie(i)?t[s]=Co(i,n):t[s]=i},{allOwnKeys:r}),t),Yl=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Hl=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},Wl=(t,e,n,r)=>{let i,s,a;const c={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),s=i.length;s-- >0;)a=i[s],(!r||r(a,t,e))&&!c[a]&&(e[a]=t[a],c[a]=!0);t=n!==!1&&Cr(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},Ql=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},Kl=t=>{if(!t)return null;if(ut(t))return t;let e=t.length;if(!Oo(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},Xl=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Cr(Uint8Array)),Zl=(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let i;for(;(i=r.next())&&!i.done;){const s=i.value;e.call(t,s[0],s[1])}},eu=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},tu=fe("HTMLFormElement"),nu=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),Ss=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),ru=fe("RegExp"),xo=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};At(n,(i,s)=>{let a;(a=e(i,s,t))!==!1&&(r[s]=a||i)}),Object.defineProperties(t,r)},iu=t=>{xo(t,(e,n)=>{if(ie(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(ie(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},su=(t,e)=>{const n={},r=i=>{i.forEach(s=>{n[s]=!0})};return ut(t)?r(t):r(String(t).split(e)),n},ou=()=>{},au=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e,Nn="abcdefghijklmnopqrstuvwxyz",ks="0123456789",Do={DIGIT:ks,ALPHA:Nn,ALPHA_DIGIT:Nn+Nn.toUpperCase()+ks},cu=(t=16,e=Do.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n};function lu(t){return!!(t&&ie(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const uu=t=>{const e=new Array(10),n=(r,i)=>{if(gn(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[i]=r;const s=ut(r)?[]:{};return At(r,(a,c)=>{const l=n(a,i+1);!Ot(l)&&(s[c]=l)}),e[i]=void 0,s}}return r};return n(t,0)},du=fe("AsyncFunction"),hu=t=>t&&(gn(t)||ie(t))&&ie(t.then)&&ie(t.catch),v={isArray:ut,isArrayBuffer:Mo,isBuffer:Al,isFormData:Fl,isArrayBufferView:Rl,isString:xl,isNumber:Oo,isBoolean:Dl,isObject:gn,isPlainObject:Qt,isReadableStream:ql,isRequest:Jl,isResponse:Vl,isHeaders:$l,isUndefined:Ot,isDate:Ll,isFile:Nl,isBlob:jl,isRegExp:ru,isFunction:ie,isStream:Bl,isURLSearchParams:Ul,isTypedArray:Xl,isFileList:Il,forEach:At,merge:ar,extend:zl,trim:Gl,stripBOM:Yl,inherits:Hl,toFlatObject:Wl,kindOf:fn,kindOfTest:fe,endsWith:Ql,toArray:Kl,forEachEntry:Zl,matchAll:eu,isHTMLForm:tu,hasOwnProperty:Ss,hasOwnProp:Ss,reduceDescriptors:xo,freezeMethods:iu,toObjectSet:su,toCamelCase:nu,noop:ou,toFiniteNumber:au,findKey:Po,global:Ao,isContextDefined:Ro,ALPHABET:Do,generateString:cu,isSpecCompliantForm:lu,toJSONObject:uu,isAsyncFn:du,isThenable:hu};function A(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}v.inherits(A,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:v.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Lo=A.prototype,No={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{No[t]={value:t}});Object.defineProperties(A,No);Object.defineProperty(Lo,"isAxiosError",{value:!0});A.from=(t,e,n,r,i,s)=>{const a=Object.create(Lo);return v.toFlatObject(t,a,function(l){return l!==Error.prototype},c=>c!=="isAxiosError"),A.call(a,t.message,e,n,r,i),a.cause=t,a.name=t.name,s&&Object.assign(a,s),a};const pu=null;function cr(t){return v.isPlainObject(t)||v.isArray(t)}function jo(t){return v.endsWith(t,"[]")?t.slice(0,-2):t}function Es(t,e,n){return t?t.concat(e).map(function(i,s){return i=jo(i),!n&&s?"["+i+"]":i}).join(n?".":""):e}function fu(t){return v.isArray(t)&&!t.some(cr)}const mu=v.toFlatObject(v,{},null,function(e){return/^is[A-Z]/.test(e)});function vn(t,e,n){if(!v.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=v.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,T){return!v.isUndefined(T[w])});const r=n.metaTokens,i=n.visitor||h,s=n.dots,a=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&v.isSpecCompliantForm(e);if(!v.isFunction(i))throw new TypeError("visitor must be a function");function p(y){if(y===null)return"";if(v.isDate(y))return y.toISOString();if(!l&&v.isBlob(y))throw new A("Blob is not supported. Use a Buffer instead.");return v.isArrayBuffer(y)||v.isTypedArray(y)?l&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function h(y,w,T){let M=y;if(y&&!T&&typeof y=="object"){if(v.endsWith(w,"{}"))w=r?w:w.slice(0,-2),y=JSON.stringify(y);else if(v.isArray(y)&&fu(y)||(v.isFileList(y)||v.endsWith(w,"[]"))&&(M=v.toArray(y)))return w=jo(w),M.forEach(function(L,te){!(v.isUndefined(L)||L===null)&&e.append(a===!0?Es([w],te,s):a===null?w:w+"[]",p(L))}),!1}return cr(y)?!0:(e.append(Es(T,w,s),p(y)),!1)}const f=[],_=Object.assign(mu,{defaultVisitor:h,convertValue:p,isVisitable:cr});function k(y,w){if(!v.isUndefined(y)){if(f.indexOf(y)!==-1)throw Error("Circular reference detected in "+w.join("."));f.push(y),v.forEach(y,function(M,B){(!(v.isUndefined(M)||M===null)&&i.call(e,M,v.isString(B)?B.trim():B,w,_))===!0&&k(M,w?w.concat(B):[B])}),f.pop()}}if(!v.isObject(t))throw new TypeError("data must be an object");return k(t),e}function Ts(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function Mr(t,e){this._pairs=[],t&&vn(t,this,e)}const Io=Mr.prototype;Io.append=function(e,n){this._pairs.push([e,n])};Io.toString=function(e){const n=e?function(r){return e.call(this,r,Ts)}:Ts;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function gu(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Bo(t,e,n){if(!e)return t;const r=n&&n.encode||gu,i=n&&n.serialize;let s;if(i?s=i(e,n):s=v.isURLSearchParams(e)?e.toString():new Mr(e,n).toString(r),s){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class Cs{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){v.forEach(this.handlers,function(r){r!==null&&e(r)})}}const Fo={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},vu=typeof URLSearchParams<"u"?URLSearchParams:Mr,yu=typeof FormData<"u"?FormData:null,_u=typeof Blob<"u"?Blob:null,bu={isBrowser:!0,classes:{URLSearchParams:vu,FormData:yu,Blob:_u},protocols:["http","https","file","blob","url","data"]},Or=typeof window<"u"&&typeof document<"u",wu=(t=>Or&&["ReactNative","NativeScript","NS"].indexOf(t)<0)(typeof navigator<"u"&&navigator.product),Su=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",ku=Or&&window.location.href||"http://localhost",Eu=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Or,hasStandardBrowserEnv:wu,hasStandardBrowserWebWorkerEnv:Su,origin:ku},Symbol.toStringTag,{value:"Module"})),le={...Eu,...bu};function Tu(t,e){return vn(t,new le.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,s){return le.isNode&&v.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function Cu(t){return v.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Mu(t){const e={},n=Object.keys(t);let r;const i=n.length;let s;for(r=0;r<i;r++)s=n[r],e[s]=t[s];return e}function Uo(t){function e(n,r,i,s){let a=n[s++];if(a==="__proto__")return!0;const c=Number.isFinite(+a),l=s>=n.length;return a=!a&&v.isArray(i)?i.length:a,l?(v.hasOwnProp(i,a)?i[a]=[i[a],r]:i[a]=r,!c):((!i[a]||!v.isObject(i[a]))&&(i[a]=[]),e(n,r,i[a],s)&&v.isArray(i[a])&&(i[a]=Mu(i[a])),!c)}if(v.isFormData(t)&&v.isFunction(t.entries)){const n={};return v.forEachEntry(t,(r,i)=>{e(Cu(r),i,n,0)}),n}return null}function Ou(t,e,n){if(v.isString(t))try{return(e||JSON.parse)(t),v.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const Rt={transitional:Fo,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,s=v.isObject(e);if(s&&v.isHTMLForm(e)&&(e=new FormData(e)),v.isFormData(e))return i?JSON.stringify(Uo(e)):e;if(v.isArrayBuffer(e)||v.isBuffer(e)||v.isStream(e)||v.isFile(e)||v.isBlob(e)||v.isReadableStream(e))return e;if(v.isArrayBufferView(e))return e.buffer;if(v.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let c;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Tu(e,this.formSerializer).toString();if((c=v.isFileList(e))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return vn(c?{"files[]":e}:e,l&&new l,this.formSerializer)}}return s||i?(n.setContentType("application/json",!1),Ou(e)):e}],transformResponse:[function(e){const n=this.transitional||Rt.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(v.isResponse(e)||v.isReadableStream(e))return e;if(e&&v.isString(e)&&(r&&!this.responseType||i)){const a=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(c){if(a)throw c.name==="SyntaxError"?A.from(c,A.ERR_BAD_RESPONSE,this,null,this.response):c}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:le.classes.FormData,Blob:le.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};v.forEach(["delete","get","head","post","put","patch"],t=>{Rt.headers[t]={}});const Pu=v.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Au=t=>{const e={};let n,r,i;return t&&t.split(`
40
+ `).forEach(function(a){i=a.indexOf(":"),n=a.substring(0,i).trim().toLowerCase(),r=a.substring(i+1).trim(),!(!n||e[n]&&Pu[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},Ms=Symbol("internals");function gt(t){return t&&String(t).trim().toLowerCase()}function Kt(t){return t===!1||t==null?t:v.isArray(t)?t.map(Kt):String(t)}function Ru(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const xu=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function jn(t,e,n,r,i){if(v.isFunction(r))return r.call(this,e,n);if(i&&(e=n),!!v.isString(e)){if(v.isString(r))return e.indexOf(r)!==-1;if(v.isRegExp(r))return r.test(e)}}function Du(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function Lu(t,e){const n=v.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(i,s,a){return this[r].call(this,e,i,s,a)},configurable:!0})})}class X{constructor(e){e&&this.set(e)}set(e,n,r){const i=this;function s(c,l,p){const h=gt(l);if(!h)throw new Error("header name must be a non-empty string");const f=v.findKey(i,h);(!f||i[f]===void 0||p===!0||p===void 0&&i[f]!==!1)&&(i[f||l]=Kt(c))}const a=(c,l)=>v.forEach(c,(p,h)=>s(p,h,l));if(v.isPlainObject(e)||e instanceof this.constructor)a(e,n);else if(v.isString(e)&&(e=e.trim())&&!xu(e))a(Au(e),n);else if(v.isHeaders(e))for(const[c,l]of e.entries())s(l,c,r);else e!=null&&s(n,e,r);return this}get(e,n){if(e=gt(e),e){const r=v.findKey(this,e);if(r){const i=this[r];if(!n)return i;if(n===!0)return Ru(i);if(v.isFunction(n))return n.call(this,i,r);if(v.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=gt(e),e){const r=v.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||jn(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let i=!1;function s(a){if(a=gt(a),a){const c=v.findKey(r,a);c&&(!n||jn(r,r[c],c,n))&&(delete r[c],i=!0)}}return v.isArray(e)?e.forEach(s):s(e),i}clear(e){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const s=n[r];(!e||jn(this,this[s],s,e,!0))&&(delete this[s],i=!0)}return i}normalize(e){const n=this,r={};return v.forEach(this,(i,s)=>{const a=v.findKey(r,s);if(a){n[a]=Kt(i),delete n[s];return}const c=e?Du(s):String(s).trim();c!==s&&delete n[s],n[c]=Kt(i),r[c]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return v.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=e&&v.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
41
+ `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[Ms]=this[Ms]={accessors:{}}).accessors,i=this.prototype;function s(a){const c=gt(a);r[c]||(Lu(i,a),r[c]=!0)}return v.isArray(e)?e.forEach(s):s(e),this}}X.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);v.reduceDescriptors(X.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});v.freezeMethods(X);function In(t,e){const n=this||Rt,r=e||n,i=X.from(r.headers);let s=r.data;return v.forEach(t,function(c){s=c.call(n,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function qo(t){return!!(t&&t.__CANCEL__)}function dt(t,e,n){A.call(this,t??"canceled",A.ERR_CANCELED,e,n),this.name="CanceledError"}v.inherits(dt,A,{__CANCEL__:!0});function Jo(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new A("Request failed with status code "+n.status,[A.ERR_BAD_REQUEST,A.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Nu(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function ju(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i=0,s=0,a;return e=e!==void 0?e:1e3,function(l){const p=Date.now(),h=r[s];a||(a=p),n[i]=l,r[i]=p;let f=s,_=0;for(;f!==i;)_+=n[f++],f=f%t;if(i=(i+1)%t,i===s&&(s=(s+1)%t),p-a<e)return;const k=h&&p-h;return k?Math.round(_*1e3/k):void 0}}function Iu(t,e){let n=0;const r=1e3/e;let i=null;return function(){const a=this===!0,c=Date.now();if(a||c-n>r)return i&&(clearTimeout(i),i=null),n=c,t.apply(null,arguments);i||(i=setTimeout(()=>(i=null,n=Date.now(),t.apply(null,arguments)),r-(c-n)))}}const an=(t,e,n=3)=>{let r=0;const i=ju(50,250);return Iu(s=>{const a=s.loaded,c=s.lengthComputable?s.total:void 0,l=a-r,p=i(l),h=a<=c;r=a;const f={loaded:a,total:c,progress:c?a/c:void 0,bytes:l,rate:p||void 0,estimated:p&&c&&h?(c-a)/p:void 0,event:s,lengthComputable:c!=null};f[e?"download":"upload"]=!0,t(f)},n)},Bu=le.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function i(s){let a=s;return e&&(n.setAttribute("href",a),a=n.href),n.setAttribute("href",a),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(a){const c=v.isString(a)?i(a):a;return c.protocol===r.protocol&&c.host===r.host}}():function(){return function(){return!0}}(),Fu=le.hasStandardBrowserEnv?{write(t,e,n,r,i,s){const a=[t+"="+encodeURIComponent(e)];v.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),v.isString(r)&&a.push("path="+r),v.isString(i)&&a.push("domain="+i),s===!0&&a.push("secure"),document.cookie=a.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Uu(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function qu(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Vo(t,e){return t&&!Uu(e)?qu(t,e):e}const Os=t=>t instanceof X?{...t}:t;function We(t,e){e=e||{};const n={};function r(p,h,f){return v.isPlainObject(p)&&v.isPlainObject(h)?v.merge.call({caseless:f},p,h):v.isPlainObject(h)?v.merge({},h):v.isArray(h)?h.slice():h}function i(p,h,f){if(v.isUndefined(h)){if(!v.isUndefined(p))return r(void 0,p,f)}else return r(p,h,f)}function s(p,h){if(!v.isUndefined(h))return r(void 0,h)}function a(p,h){if(v.isUndefined(h)){if(!v.isUndefined(p))return r(void 0,p)}else return r(void 0,h)}function c(p,h,f){if(f in e)return r(p,h);if(f in t)return r(void 0,p)}const l={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c,headers:(p,h)=>i(Os(p),Os(h),!0)};return v.forEach(Object.keys(Object.assign({},t,e)),function(h){const f=l[h]||i,_=f(t[h],e[h],h);v.isUndefined(_)&&f!==c||(n[h]=_)}),n}const $o=t=>{const e=We({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:s,headers:a,auth:c}=e;e.headers=a=X.from(a),e.url=Bo(Vo(e.baseURL,e.url),t.params,t.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let l;if(v.isFormData(n)){if(le.hasStandardBrowserEnv||le.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((l=a.getContentType())!==!1){const[p,...h]=l?l.split(";").map(f=>f.trim()).filter(Boolean):[];a.setContentType([p||"multipart/form-data",...h].join("; "))}}if(le.hasStandardBrowserEnv&&(r&&v.isFunction(r)&&(r=r(e)),r||r!==!1&&Bu(e.url))){const p=i&&s&&Fu.read(s);p&&a.set(i,p)}return e},Ju=typeof XMLHttpRequest<"u",Vu=Ju&&function(t){return new Promise(function(n,r){const i=$o(t);let s=i.data;const a=X.from(i.headers).normalize();let{responseType:c}=i,l;function p(){i.cancelToken&&i.cancelToken.unsubscribe(l),i.signal&&i.signal.removeEventListener("abort",l)}let h=new XMLHttpRequest;h.open(i.method.toUpperCase(),i.url,!0),h.timeout=i.timeout;function f(){if(!h)return;const k=X.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),w={data:!c||c==="text"||c==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:k,config:t,request:h};Jo(function(M){n(M),p()},function(M){r(M),p()},w),h=null}"onloadend"in h?h.onloadend=f:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(f)},h.onabort=function(){h&&(r(new A("Request aborted",A.ECONNABORTED,i,h)),h=null)},h.onerror=function(){r(new A("Network Error",A.ERR_NETWORK,i,h)),h=null},h.ontimeout=function(){let y=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const w=i.transitional||Fo;i.timeoutErrorMessage&&(y=i.timeoutErrorMessage),r(new A(y,w.clarifyTimeoutError?A.ETIMEDOUT:A.ECONNABORTED,i,h)),h=null},s===void 0&&a.setContentType(null),"setRequestHeader"in h&&v.forEach(a.toJSON(),function(y,w){h.setRequestHeader(w,y)}),v.isUndefined(i.withCredentials)||(h.withCredentials=!!i.withCredentials),c&&c!=="json"&&(h.responseType=i.responseType),typeof i.onDownloadProgress=="function"&&h.addEventListener("progress",an(i.onDownloadProgress,!0)),typeof i.onUploadProgress=="function"&&h.upload&&h.upload.addEventListener("progress",an(i.onUploadProgress)),(i.cancelToken||i.signal)&&(l=k=>{h&&(r(!k||k.type?new dt(null,t,h):k),h.abort(),h=null)},i.cancelToken&&i.cancelToken.subscribe(l),i.signal&&(i.signal.aborted?l():i.signal.addEventListener("abort",l)));const _=Nu(i.url);if(_&&le.protocols.indexOf(_)===-1){r(new A("Unsupported protocol "+_+":",A.ERR_BAD_REQUEST,t));return}h.send(s||null)})},$u=(t,e)=>{let n=new AbortController,r;const i=function(l){if(!r){r=!0,a();const p=l instanceof Error?l:this.reason;n.abort(p instanceof A?p:new dt(p instanceof Error?p.message:p))}};let s=e&&setTimeout(()=>{i(new A(`timeout ${e} of ms exceeded`,A.ETIMEDOUT))},e);const a=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(l=>{l&&(l.removeEventListener?l.removeEventListener("abort",i):l.unsubscribe(i))}),t=null)};t.forEach(l=>l&&l.addEventListener&&l.addEventListener("abort",i));const{signal:c}=n;return c.unsubscribe=a,[c,()=>{s&&clearTimeout(s),s=null}]},Gu=function*(t,e){let n=t.byteLength;if(!e||n<e){yield t;return}let r=0,i;for(;r<n;)i=r+e,yield t.slice(r,i),r=i},zu=async function*(t,e,n){for await(const r of t)yield*Gu(ArrayBuffer.isView(r)?r:await n(String(r)),e)},Ps=(t,e,n,r,i)=>{const s=zu(t,e,i);let a=0;return new ReadableStream({type:"bytes",async pull(c){const{done:l,value:p}=await s.next();if(l){c.close(),r();return}let h=p.byteLength;n&&n(a+=h),c.enqueue(new Uint8Array(p))},cancel(c){return r(c),s.return()}},{highWaterMark:2})},As=(t,e)=>{const n=t!=null;return r=>setTimeout(()=>e({lengthComputable:n,total:t,loaded:r}))},yn=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Go=yn&&typeof ReadableStream=="function",lr=yn&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),Yu=Go&&(()=>{let t=!1;const e=new Request(le.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e})(),Rs=64*1024,ur=Go&&!!(()=>{try{return v.isReadableStream(new Response("").body)}catch{}})(),cn={stream:ur&&(t=>t.body)};yn&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!cn[e]&&(cn[e]=v.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new A(`Response type '${e}' is not supported`,A.ERR_NOT_SUPPORT,r)})})})(new Response);const Hu=async t=>{if(t==null)return 0;if(v.isBlob(t))return t.size;if(v.isSpecCompliantForm(t))return(await new Request(t).arrayBuffer()).byteLength;if(v.isArrayBufferView(t))return t.byteLength;if(v.isURLSearchParams(t)&&(t=t+""),v.isString(t))return(await lr(t)).byteLength},Wu=async(t,e)=>{const n=v.toFiniteNumber(t.getContentLength());return n??Hu(e)},Qu=yn&&(async t=>{let{url:e,method:n,data:r,signal:i,cancelToken:s,timeout:a,onDownloadProgress:c,onUploadProgress:l,responseType:p,headers:h,withCredentials:f="same-origin",fetchOptions:_}=$o(t);p=p?(p+"").toLowerCase():"text";let[k,y]=i||s||a?$u([i,s],a):[],w,T;const M=()=>{!w&&setTimeout(()=>{k&&k.unsubscribe()}),w=!0};let B;try{if(l&&Yu&&n!=="get"&&n!=="head"&&(B=await Wu(h,r))!==0){let se=new Request(e,{method:"POST",body:r,duplex:"half"}),ye;v.isFormData(r)&&(ye=se.headers.get("content-type"))&&h.setContentType(ye),se.body&&(r=Ps(se.body,Rs,As(B,an(l)),null,lr))}v.isString(f)||(f=f?"cors":"omit"),T=new Request(e,{..._,signal:k,method:n.toUpperCase(),headers:h.normalize().toJSON(),body:r,duplex:"half",withCredentials:f});let L=await fetch(T);const te=ur&&(p==="stream"||p==="response");if(ur&&(c||te)){const se={};["status","statusText","headers"].forEach(ht=>{se[ht]=L[ht]});const ye=v.toFiniteNumber(L.headers.get("content-length"));L=new Response(Ps(L.body,Rs,c&&As(ye,an(c,!0)),te&&M,lr),se)}p=p||"text";let Le=await cn[v.findKey(cn,p)||"text"](L,t);return!te&&M(),y&&y(),await new Promise((se,ye)=>{Jo(se,ye,{data:Le,headers:X.from(L.headers),status:L.status,statusText:L.statusText,config:t,request:T})})}catch(L){throw M(),L&&L.name==="TypeError"&&/fetch/i.test(L.message)?Object.assign(new A("Network Error",A.ERR_NETWORK,t,T),{cause:L.cause||L}):A.from(L,L&&L.code,t,T)}}),dr={http:pu,xhr:Vu,fetch:Qu};v.forEach(dr,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const xs=t=>`- ${t}`,Ku=t=>v.isFunction(t)||t===null||t===!1,zo={getAdapter:t=>{t=v.isArray(t)?t:[t];const{length:e}=t;let n,r;const i={};for(let s=0;s<e;s++){n=t[s];let a;if(r=n,!Ku(n)&&(r=dr[(a=String(n)).toLowerCase()],r===void 0))throw new A(`Unknown adapter '${a}'`);if(r)break;i[a||"#"+s]=r}if(!r){const s=Object.entries(i).map(([c,l])=>`adapter ${c} `+(l===!1?"is not supported by the environment":"is not available in the build"));let a=e?s.length>1?`since :
42
+ `+s.map(xs).join(`
43
+ `):" "+xs(s[0]):"as no adapter specified";throw new A("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:dr};function Bn(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new dt(null,t)}function Ds(t){return Bn(t),t.headers=X.from(t.headers),t.data=In.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),zo.getAdapter(t.adapter||Rt.adapter)(t).then(function(r){return Bn(t),r.data=In.call(t,t.transformResponse,r),r.headers=X.from(r.headers),r},function(r){return qo(r)||(Bn(t),r&&r.response&&(r.response.data=In.call(t,t.transformResponse,r.response),r.response.headers=X.from(r.response.headers))),Promise.reject(r)})}const Yo="1.7.2",Pr={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Pr[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const Ls={};Pr.transitional=function(e,n,r){function i(s,a){return"[Axios v"+Yo+"] Transitional option '"+s+"'"+a+(r?". "+r:"")}return(s,a,c)=>{if(e===!1)throw new A(i(a," has been removed"+(n?" in "+n:"")),A.ERR_DEPRECATED);return n&&!Ls[a]&&(Ls[a]=!0,console.warn(i(a," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(s,a,c):!0}};function Xu(t,e,n){if(typeof t!="object")throw new A("options must be an object",A.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const s=r[i],a=e[s];if(a){const c=t[s],l=c===void 0||a(c,s,t);if(l!==!0)throw new A("option "+s+" must be "+l,A.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new A("Unknown option "+s,A.ERR_BAD_OPTION)}}const hr={assertOptions:Xu,validators:Pr},Ce=hr.validators;class Ve{constructor(e){this.defaults=e,this.interceptors={request:new Cs,response:new Cs}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const s=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
44
+ `+s):r.stack=s}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=We(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&hr.assertOptions(r,{silentJSONParsing:Ce.transitional(Ce.boolean),forcedJSONParsing:Ce.transitional(Ce.boolean),clarifyTimeoutError:Ce.transitional(Ce.boolean)},!1),i!=null&&(v.isFunction(i)?n.paramsSerializer={serialize:i}:hr.assertOptions(i,{encode:Ce.function,serialize:Ce.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=s&&v.merge(s.common,s[n.method]);s&&v.forEach(["delete","get","head","post","put","patch","common"],y=>{delete s[y]}),n.headers=X.concat(a,s);const c=[];let l=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(n)===!1||(l=l&&w.synchronous,c.unshift(w.fulfilled,w.rejected))});const p=[];this.interceptors.response.forEach(function(w){p.push(w.fulfilled,w.rejected)});let h,f=0,_;if(!l){const y=[Ds.bind(this),void 0];for(y.unshift.apply(y,c),y.push.apply(y,p),_=y.length,h=Promise.resolve(n);f<_;)h=h.then(y[f++],y[f++]);return h}_=c.length;let k=n;for(f=0;f<_;){const y=c[f++],w=c[f++];try{k=y(k)}catch(T){w.call(this,T);break}}try{h=Ds.call(this,k)}catch(y){return Promise.reject(y)}for(f=0,_=p.length;f<_;)h=h.then(p[f++],p[f++]);return h}getUri(e){e=We(this.defaults,e);const n=Vo(e.baseURL,e.url);return Bo(n,e.params,e.paramsSerializer)}}v.forEach(["delete","get","head","options"],function(e){Ve.prototype[e]=function(n,r){return this.request(We(r||{},{method:e,url:n,data:(r||{}).data}))}});v.forEach(["post","put","patch"],function(e){function n(r){return function(s,a,c){return this.request(We(c||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}Ve.prototype[e]=n(),Ve.prototype[e+"Form"]=n(!0)});class Ar{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(i=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const a=new Promise(c=>{r.subscribe(c),s=c}).then(i);return a.cancel=function(){r.unsubscribe(s)},a},e(function(s,a,c){r.reason||(r.reason=new dt(s,a,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}static source(){let e;return{token:new Ar(function(i){e=i}),cancel:e}}}function Zu(t){return function(n){return t.apply(null,n)}}function ed(t){return v.isObject(t)&&t.isAxiosError===!0}const pr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(pr).forEach(([t,e])=>{pr[e]=t});function Ho(t){const e=new Ve(t),n=Co(Ve.prototype.request,e);return v.extend(n,Ve.prototype,e,{allOwnKeys:!0}),v.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return Ho(We(t,i))},n}const $=Ho(Rt);$.Axios=Ve;$.CanceledError=dt;$.CancelToken=Ar;$.isCancel=qo;$.VERSION=Yo;$.toFormData=vn;$.AxiosError=A;$.Cancel=$.CanceledError;$.all=function(e){return Promise.all(e)};$.spread=Zu;$.isAxiosError=ed;$.mergeConfig=We;$.AxiosHeaders=X;$.formToJSON=t=>Uo(v.isHTMLForm(t)?new FormData(t):t);$.getAdapter=zo.getAdapter;$.HttpStatusCode=pr;$.default=$;const td="https://api.thead-staging.nc.in3d.io";class nd{constructor(e){je(this,"inited",!1);je(this,"mediaStream");je(this,"session_id","");je(this,"fetcher");je(this,"call",null);je(this,"handlers",{});if(typeof window>"u")throw new Error("Unfortunately, SDK only works on the client side.");this.fetcher=$.create({baseURL:`${td}/_sdk/v0`,headers:{"X-Session-Token":e}}),this.mediaStream=new MediaStream}async init(e){if(this.inited)return;this.call=Ol.createCallObject({videoSource:!1,audioSource:!1});const{data:n}=await this.fetcher.get("/sessions");return this.session_id=n.id,await this.call.join({token:n.limited_access_token,url:n.room_url}),this.inited=!0,new Promise((r,i)=>{var c,l;const s=e!=null&&e.timeout&&e.timeout>0?e==null?void 0:e.timeout:3e4,a=setTimeout(i,s);(c=this.call)==null||c.on("participant-updated",({participant:p})=>{var _,k;if(!p.owner)return;const{video:h,audio:f}=p.tracks;h.persistentTrack&&((_=this.mediaStream)==null||_.addTrack(h.persistentTrack)),f.persistentTrack&&((k=this.mediaStream)==null||k.addTrack(f.persistentTrack)),console.log("pr: ",p),clearTimeout(a),r(null)}),(l=this.call)==null||l.on("app-message",({data:p})=>{var h;p.type&&((h=this.handlers[p.type])==null||h.forEach(f=>f(p)))})})}async task(e){if(!this.session_id)throw new Error("It seems that the session is not initialized.");const{data:n}=await this.fetcher.post("/sessions/tasks",{text:e});return n}on(e,n){this.handlers[e]||(this.handlers[e]=[]),this.handlers[e].push(n)}off(e,n){this.handlers[e]&&(this.handlers[e]=this.handlers[e].filter(r=>r!==n))}dispose(){var e;(e=this.call)==null||e.destroy(),this.session_id&&this.fetcher.delete(`/sessions/${this.session_id}`)}}exports.AvaturnHead=nd;