@avaturn-live/web-sdk 0.4.2 → 0.4.4
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 +29 -29
- package/dist/main.js +1306 -1275
- package/dist/type.d.ts +1 -1
- package/package.json +2 -2
package/dist/main.cjs
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
"use strict";var
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Ba(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var pi,Jt={exports:{}},ir=function(){if(pi)return Jt.exports;pi=1;var t,e=typeof Reflect=="object"?Reflect:null,n=e&&typeof e.apply=="function"?e.apply:function(m,y,w){return Function.prototype.apply.call(m,y,w)};t=e&&typeof e.ownKeys=="function"?e.ownKeys:Object.getOwnPropertySymbols?function(m){return Object.getOwnPropertyNames(m).concat(Object.getOwnPropertySymbols(m))}:function(m){return Object.getOwnPropertyNames(m)};var r=Number.isNaN||function(m){return m!=m};function i(){i.init.call(this)}Jt.exports=i,Jt.exports.once=function(m,y){return new Promise(function(w,C){function A(x){m.removeListener(y,j),C(x)}function j(){typeof m.removeListener=="function"&&m.removeListener("error",A),w([].slice.call(arguments))}b(m,y,j,{once:!0}),y!=="error"&&function(x,R,J){typeof x.on=="function"&&b(x,"error",R,J)}(m,A,{once:!0})})},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var s=10;function a(m){if(typeof m!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof m)}function c(m){return m._maxListeners===void 0?i.defaultMaxListeners:m._maxListeners}function l(m,y,w,C){var A,j,x,R;if(a(w),(j=m._events)===void 0?(j=m._events=Object.create(null),m._eventsCount=0):(j.newListener!==void 0&&(m.emit("newListener",y,w.listener?w.listener:w),j=m._events),x=j[y]),x===void 0)x=j[y]=w,++m._eventsCount;else if(typeof x=="function"?x=j[y]=C?[w,x]:[x,w]:C?x.unshift(w):x.push(w),(A=c(m))>0&&x.length>A&&!x.warned){x.warned=!0;var J=new Error("Possible EventEmitter memory leak detected. "+x.length+" "+String(y)+" listeners added. Use emitter.setMaxListeners() to increase limit");J.name="MaxListenersExceededWarning",J.emitter=m,J.type=y,J.count=x.length,R=J,console&&console.warn&&console.warn(R)}return m}function f(){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 h(m,y,w){var C={fired:!1,wrapFn:void 0,target:m,type:y,listener:w},A=f.bind(C);return A.listener=w,C.wrapFn=A,A}function v(m,y,w){var C=m._events;if(C===void 0)return[];var A=C[y];return A===void 0?[]:typeof A=="function"?w?[A.listener||A]:[A]:w?function(j){for(var x=new Array(j.length),R=0;R<x.length;++R)x[R]=j[R].listener||j[R];return x}(A):k(A,A.length)}function E(m){var y=this._events;if(y!==void 0){var w=y[m];if(typeof w=="function")return 1;if(w!==void 0)return w.length}return 0}function k(m,y){for(var w=new Array(y),C=0;C<y;++C)w[C]=m[C];return w}function b(m,y,w,C){if(typeof m.on=="function")C.once?m.once(y,w):m.on(y,w);else{if(typeof m.addEventListener!="function")throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof m);m.addEventListener(y,function A(j){C.once&&m.removeEventListener(y,A),w(j)})}}return Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(m){if(typeof m!="number"||m<0||r(m))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+m+".");s=m}}),i.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},i.prototype.setMaxListeners=function(m){if(typeof m!="number"||m<0||r(m))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+m+".");return this._maxListeners=m,this},i.prototype.getMaxListeners=function(){return c(this)},i.prototype.emit=function(m){for(var y=[],w=1;w<arguments.length;w++)y.push(arguments[w]);var C=m==="error",A=this._events;if(A!==void 0)C=C&&A.error===void 0;else if(!C)return!1;if(C){var j;if(y.length>0&&(j=y[0]),j instanceof Error)throw j;var x=new Error("Unhandled error."+(j?" ("+j.message+")":""));throw x.context=j,x}var R=A[m];if(R===void 0)return!1;if(typeof R=="function")n(R,this,y);else{var J=R.length,X=k(R,J);for(w=0;w<J;++w)n(X[w],this,y)}return!0},i.prototype.addListener=function(m,y){return l(this,m,y,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(m,y){return l(this,m,y,!0)},i.prototype.once=function(m,y){return a(y),this.on(m,h(this,m,y)),this},i.prototype.prependOnceListener=function(m,y){return a(y),this.prependListener(m,h(this,m,y)),this},i.prototype.removeListener=function(m,y){var w,C,A,j,x;if(a(y),(C=this._events)===void 0)return this;if((w=C[m])===void 0)return this;if(w===y||w.listener===y)--this._eventsCount==0?this._events=Object.create(null):(delete C[m],C.removeListener&&this.emit("removeListener",m,w.listener||y));else if(typeof w!="function"){for(A=-1,j=w.length-1;j>=0;j--)if(w[j]===y||w[j].listener===y){x=w[j].listener,A=j;break}if(A<0)return this;A===0?w.shift():function(R,J){for(;J+1<R.length;J++)R[J]=R[J+1];R.pop()}(w,A),w.length===1&&(C[m]=w[0]),C.removeListener!==void 0&&this.emit("removeListener",m,x||y)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(m){var y,w,C;if((w=this._events)===void 0)return this;if(w.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):w[m]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete w[m]),this;if(arguments.length===0){var A,j=Object.keys(w);for(C=0;C<j.length;++C)(A=j[C])!=="removeListener"&&this.removeAllListeners(A);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(y=w[m])=="function")this.removeListener(m,y);else if(y!==void 0)for(C=y.length-1;C>=0;C--)this.removeListener(m,y[C]);return this},i.prototype.listeners=function(m){return v(this,m,!0)},i.prototype.rawListeners=function(m){return v(this,m,!1)},i.listenerCount=function(m,y){return typeof m.listenerCount=="function"?m.listenerCount(y):E.call(m,y)},i.prototype.listenerCount=E,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]},Jt.exports}(),qt=Ba(ir),mi=Object.prototype.hasOwnProperty;function gi(t,e,n){for(n of t.keys())if(se(n,e))return n}function se(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--&&se(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=gi(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=gi(e,i))||!se(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(mi.call(t,n)&&++r&&!mi.call(e,n)||!(n in e)||!se(t[n],e[n]))return!1;return Object.keys(e).length===r}}return t!=t&&e!=e}const Va={"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"},_o={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"},K={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},ie={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"},De={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class T{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=T.getVersionPrecision(e),s=T.getVersionPrecision(n);let a=Math.max(i,s),c=0;const l=T.map([e,n],f=>{const h=a-T.getVersionPrecision(f),v=f+new Array(h+1).join(".0");return T.map(v.split("."),E=>new Array(20-E.length).join("0")+E).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 Va[e]}static getBrowserTypeByAlias(e){return _o[e]||""}}const z=/version\/(\d+(\.?_?\d+)+)/i,Ja=[{test:[/googlebot/i],describe(t){const e={name:"Googlebot"},n=T.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,t)||T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/opera/i],describe(t){const e={name:"Opera"},n=T.getFirstMatch(z,t)||T.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/opr\/|opios/i],describe(t){const e={name:"Opera"},n=T.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,t)||T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/SamsungBrowser/i],describe(t){const e={name:"Samsung Internet for Android"},n=T.getFirstMatch(z,t)||T.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=T.getFirstMatch(z,t)||T.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/MZBrowser/i],describe(t){const e={name:"MZ Browser"},n=T.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,t)||T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/focus/i],describe(t){const e={name:"Focus"},n=T.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,t)||T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/swing/i],describe(t){const e={name:"Swing"},n=T.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,t)||T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/coast/i],describe(t){const e={name:"Opera Coast"},n=T.getFirstMatch(z,t)||T.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=T.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,t)||T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/yabrowser/i],describe(t){const e={name:"Yandex Browser"},n=T.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,t)||T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/ucbrowser/i],describe(t){const e={name:"UC Browser"},n=T.getFirstMatch(z,t)||T.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/Maxthon|mxios/i],describe(t){const e={name:"Maxthon"},n=T.getFirstMatch(z,t)||T.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/epiphany/i],describe(t){const e={name:"Epiphany"},n=T.getFirstMatch(z,t)||T.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/puffin/i],describe(t){const e={name:"Puffin"},n=T.getFirstMatch(z,t)||T.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/sleipnir/i],describe(t){const e={name:"Sleipnir"},n=T.getFirstMatch(z,t)||T.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=T.getFirstMatch(z,t)||T.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/micromessenger/i],describe(t){const e={name:"WeChat"},n=T.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,t)||T.getFirstMatch(z,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=T.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,t)||T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/msie|trident/i],describe(t){const e={name:"Internet Explorer"},n=T.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/\sedg\//i],describe(t){const e={name:"Microsoft Edge"},n=T.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=T.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/vivaldi/i],describe(t){const e={name:"Vivaldi"},n=T.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/seamonkey/i],describe(t){const e={name:"SeaMonkey"},n=T.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/sailfish/i],describe(t){const e={name:"Sailfish"},n=T.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=T.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/phantom/i],describe(t){const e={name:"PhantomJS"},n=T.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/slimerjs/i],describe(t){const e={name:"SlimerJS"},n=T.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=T.getFirstMatch(z,t)||T.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=T.getFirstMatch(z,t)||T.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=T.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/tizen/i],describe(t){const e={name:"Tizen"},n=T.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,t)||T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/qupzilla/i],describe(t){const e={name:"QupZilla"},n=T.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,t)||T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/firefox|iceweasel|fxios/i],describe(t){const e={name:"Firefox"},n=T.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=T.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/MiuiBrowser/i],describe(t){const e={name:"Miui"},n=T.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/chromium/i],describe(t){const e={name:"Chromium"},n=T.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,t)||T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/chrome|crios|crmo/i],describe(t){const e={name:"Chrome"},n=T.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=T.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=T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/playstation 4/i],describe(t){const e={name:"PlayStation 4"},n=T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/safari|applewebkit/i],describe(t){const e={name:"Safari"},n=T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/.*/i],describe(t){const e=t.search("\\(")!==-1?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:T.getFirstMatch(e,t),version:T.getSecondMatch(e,t)}}}];var qa=[{test:[/Roku\/DVP/],describe(t){const e=T.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,t);return{name:ie.Roku,version:e}}},{test:[/windows phone/i],describe(t){const e=T.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,t);return{name:ie.WindowsPhone,version:e}}},{test:[/windows /i],describe(t){const e=T.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,t),n=T.getWindowsVersionName(e);return{name:ie.Windows,version:e,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(t){const e={name:ie.iOS},n=T.getSecondMatch(/(Version\/)(\d[\d.]+)/,t);return n&&(e.version=n),e}},{test:[/macintosh/i],describe(t){const e=T.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,t).replace(/[_\s]/g,"."),n=T.getMacOSVersionName(e),r={name:ie.MacOS,version:e};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe(t){const e=T.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,t).replace(/[_\s]/g,".");return{name:ie.iOS,version:e}}},{test(t){const e=!t.test(/like android/i),n=t.test(/android/i);return e&&n},describe(t){const e=T.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,t),n=T.getAndroidVersionName(e),r={name:ie.Android,version:e};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe(t){const e=T.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,t),n={name:ie.WebOS};return e&&e.length&&(n.version=e),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(t){const e=T.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,t)||T.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,t)||T.getFirstMatch(/\bbb(\d+)/i,t);return{name:ie.BlackBerry,version:e}}},{test:[/bada/i],describe(t){const e=T.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,t);return{name:ie.Bada,version:e}}},{test:[/tizen/i],describe(t){const e=T.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,t);return{name:ie.Tizen,version:e}}},{test:[/linux/i],describe:()=>({name:ie.Linux})},{test:[/CrOS/],describe:()=>({name:ie.ChromeOS})},{test:[/PlayStation 4/],describe(t){const e=T.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,t);return{name:ie.PlayStation4,version:e}}}],$a=[{test:[/googlebot/i],describe:()=>({type:"bot",vendor:"Google"})},{test:[/huawei/i],describe(t){const e=T.getFirstMatch(/(can-l01)/i,t)&&"Nova",n={type:K.mobile,vendor:"Huawei"};return e&&(n.model=e),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:()=>({type:K.tablet,vendor:"Nexus"})},{test:[/ipad/i],describe:()=>({type:K.tablet,vendor:"Apple",model:"iPad"})},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:()=>({type:K.tablet,vendor:"Apple",model:"iPad"})},{test:[/kftt build/i],describe:()=>({type:K.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"})},{test:[/silk/i],describe:()=>({type:K.tablet,vendor:"Amazon"})},{test:[/tablet(?! pc)/i],describe:()=>({type:K.tablet})},{test(t){const e=t.test(/ipod|iphone/i),n=t.test(/like (ipod|iphone)/i);return e&&!n},describe(t){const e=T.getFirstMatch(/(ipod|iphone)/i,t);return{type:K.mobile,vendor:"Apple",model:e}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:()=>({type:K.mobile,vendor:"Nexus"})},{test:[/[^-]mobi/i],describe:()=>({type:K.mobile})},{test:t=>t.getBrowserName(!0)==="blackberry",describe:()=>({type:K.mobile,vendor:"BlackBerry"})},{test:t=>t.getBrowserName(!0)==="bada",describe:()=>({type:K.mobile})},{test:t=>t.getBrowserName()==="windows phone",describe:()=>({type:K.mobile,vendor:"Microsoft"})},{test(t){const e=Number(String(t.getOSVersion()).split(".")[0]);return t.getOSName(!0)==="android"&&e>=3},describe:()=>({type:K.tablet})},{test:t=>t.getOSName(!0)==="android",describe:()=>({type:K.mobile})},{test:t=>t.getOSName(!0)==="macos",describe:()=>({type:K.desktop,vendor:"Apple"})},{test:t=>t.getOSName(!0)==="windows",describe:()=>({type:K.desktop})},{test:t=>t.getOSName(!0)==="linux",describe:()=>({type:K.desktop})},{test:t=>t.getOSName(!0)==="playstation 4",describe:()=>({type:K.tv})},{test:t=>t.getOSName(!0)==="roku",describe:()=>({type:K.tv})}],za=[{test:t=>t.getBrowserName(!0)==="microsoft edge",describe(t){if(/\sedg\//i.test(t))return{name:De.Blink};const e=T.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,t);return{name:De.EdgeHTML,version:e}}},{test:[/trident/i],describe(t){const e={name:De.Trident},n=T.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:t=>t.test(/presto/i),describe(t){const e={name:De.Presto},n=T.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:De.Gecko},n=T.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/(apple)?webkit\/537\.36/i],describe:()=>({name:De.Blink})},{test:[/(apple)?webkit/i],describe(t){const e={name:De.WebKit},n=T.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}}];class vi{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=T.find(Ja,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=T.find(qa,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=T.find($a,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=T.find(za,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 T.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=T.find(a,f=>this.isOS(f));if(c){const f=this.satisfies(n[c]);if(f!==void 0)return f}const l=T.find(a,f=>this.isPlatform(f));if(l){const f=this.satisfies(n[l]);if(f!==void 0)return f}}if(s>0){const a=Object.keys(i),c=T.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=T.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(T.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))}}/*!
|
|
1
|
+
"use strict";var Ua=Object.defineProperty;var Ba=(t,e,n)=>e in t?Ua(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Q=(t,e,n)=>Ba(t,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function di(t,e){if(t==null)return{};var n,r,i=function(a,c){if(a==null)return{};var l={};for(var f in a)if({}.hasOwnProperty.call(a,f)){if(c.indexOf(f)!==-1)continue;l[f]=a[f]}return l}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)n=s[r],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function de(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function q(t){return q=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},q(t)}function _o(t){var e=function(n,r){if(q(n)!="object"||!n)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var s=i.call(n,r);if(q(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}(t,"string");return q(e)=="symbol"?e:e+""}function fi(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,_o(r.key),r)}}function fe(t,e,n){return e&&fi(t.prototype,e),n&&fi(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Sn(t,e){if(e&&(q(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}(t)}function we(t){return we=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},we(t)}function xt(t,e){return xt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},xt(t,e)}function kn(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&&xt(t,e)}function Me(t,e,n){return(e=_o(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function hi(t,e,n,r,i,s,a){try{var c=t[s](a),l=c.value}catch(f){return void n(f)}c.done?e(l):Promise.resolve(l).then(r,i)}function L(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var s=t.apply(e,n);function a(l){hi(s,r,i,a,c,"next",l)}function c(l){hi(s,r,i,a,c,"throw",l)}a(void 0)})}}function pi(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function re(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,f=[],h=!0,v=!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)&&(f.push(s.value),f.length!==r);h=!0);}catch(E){v=!0,a=E}finally{try{if(!h&&i.return!=null&&(l=i.return(),Object(l)!==l))return}finally{if(v)throw a}}return f}}(t,e)||function(n,r){if(n){if(typeof n=="string")return pi(n,r);var i={}.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)?pi(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.`)}()}function Va(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var mi,Jt={exports:{}},sr=function(){if(mi)return Jt.exports;mi=1;var t,e=typeof Reflect=="object"?Reflect:null,n=e&&typeof e.apply=="function"?e.apply:function(m,y,w){return Function.prototype.apply.call(m,y,w)};t=e&&typeof e.ownKeys=="function"?e.ownKeys:Object.getOwnPropertySymbols?function(m){return Object.getOwnPropertyNames(m).concat(Object.getOwnPropertySymbols(m))}:function(m){return Object.getOwnPropertyNames(m)};var r=Number.isNaN||function(m){return m!=m};function i(){i.init.call(this)}Jt.exports=i,Jt.exports.once=function(m,y){return new Promise(function(w,M){function A(x){m.removeListener(y,j),M(x)}function j(){typeof m.removeListener=="function"&&m.removeListener("error",A),w([].slice.call(arguments))}b(m,y,j,{once:!0}),y!=="error"&&function(x,R,J){typeof x.on=="function"&&b(x,"error",R,J)}(m,A,{once:!0})})},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var s=10;function a(m){if(typeof m!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof m)}function c(m){return m._maxListeners===void 0?i.defaultMaxListeners:m._maxListeners}function l(m,y,w,M){var A,j,x,R;if(a(w),(j=m._events)===void 0?(j=m._events=Object.create(null),m._eventsCount=0):(j.newListener!==void 0&&(m.emit("newListener",y,w.listener?w.listener:w),j=m._events),x=j[y]),x===void 0)x=j[y]=w,++m._eventsCount;else if(typeof x=="function"?x=j[y]=M?[w,x]:[x,w]:M?x.unshift(w):x.push(w),(A=c(m))>0&&x.length>A&&!x.warned){x.warned=!0;var J=new Error("Possible EventEmitter memory leak detected. "+x.length+" "+String(y)+" listeners added. Use emitter.setMaxListeners() to increase limit");J.name="MaxListenersExceededWarning",J.emitter=m,J.type=y,J.count=x.length,R=J,console&&console.warn&&console.warn(R)}return m}function f(){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 h(m,y,w){var M={fired:!1,wrapFn:void 0,target:m,type:y,listener:w},A=f.bind(M);return A.listener=w,M.wrapFn=A,A}function v(m,y,w){var M=m._events;if(M===void 0)return[];var A=M[y];return A===void 0?[]:typeof A=="function"?w?[A.listener||A]:[A]:w?function(j){for(var x=new Array(j.length),R=0;R<x.length;++R)x[R]=j[R].listener||j[R];return x}(A):k(A,A.length)}function E(m){var y=this._events;if(y!==void 0){var w=y[m];if(typeof w=="function")return 1;if(w!==void 0)return w.length}return 0}function k(m,y){for(var w=new Array(y),M=0;M<y;++M)w[M]=m[M];return w}function b(m,y,w,M){if(typeof m.on=="function")M.once?m.once(y,w):m.on(y,w);else{if(typeof m.addEventListener!="function")throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof m);m.addEventListener(y,function A(j){M.once&&m.removeEventListener(y,A),w(j)})}}return Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(m){if(typeof m!="number"||m<0||r(m))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+m+".");s=m}}),i.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},i.prototype.setMaxListeners=function(m){if(typeof m!="number"||m<0||r(m))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+m+".");return this._maxListeners=m,this},i.prototype.getMaxListeners=function(){return c(this)},i.prototype.emit=function(m){for(var y=[],w=1;w<arguments.length;w++)y.push(arguments[w]);var M=m==="error",A=this._events;if(A!==void 0)M=M&&A.error===void 0;else if(!M)return!1;if(M){var j;if(y.length>0&&(j=y[0]),j instanceof Error)throw j;var x=new Error("Unhandled error."+(j?" ("+j.message+")":""));throw x.context=j,x}var R=A[m];if(R===void 0)return!1;if(typeof R=="function")n(R,this,y);else{var J=R.length,X=k(R,J);for(w=0;w<J;++w)n(X[w],this,y)}return!0},i.prototype.addListener=function(m,y){return l(this,m,y,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(m,y){return l(this,m,y,!0)},i.prototype.once=function(m,y){return a(y),this.on(m,h(this,m,y)),this},i.prototype.prependOnceListener=function(m,y){return a(y),this.prependListener(m,h(this,m,y)),this},i.prototype.removeListener=function(m,y){var w,M,A,j,x;if(a(y),(M=this._events)===void 0)return this;if((w=M[m])===void 0)return this;if(w===y||w.listener===y)--this._eventsCount==0?this._events=Object.create(null):(delete M[m],M.removeListener&&this.emit("removeListener",m,w.listener||y));else if(typeof w!="function"){for(A=-1,j=w.length-1;j>=0;j--)if(w[j]===y||w[j].listener===y){x=w[j].listener,A=j;break}if(A<0)return this;A===0?w.shift():function(R,J){for(;J+1<R.length;J++)R[J]=R[J+1];R.pop()}(w,A),w.length===1&&(M[m]=w[0]),M.removeListener!==void 0&&this.emit("removeListener",m,x||y)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(m){var y,w,M;if((w=this._events)===void 0)return this;if(w.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):w[m]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete w[m]),this;if(arguments.length===0){var A,j=Object.keys(w);for(M=0;M<j.length;++M)(A=j[M])!=="removeListener"&&this.removeAllListeners(A);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(y=w[m])=="function")this.removeListener(m,y);else if(y!==void 0)for(M=y.length-1;M>=0;M--)this.removeListener(m,y[M]);return this},i.prototype.listeners=function(m){return v(this,m,!0)},i.prototype.rawListeners=function(m){return v(this,m,!1)},i.listenerCount=function(m,y){return typeof m.listenerCount=="function"?m.listenerCount(y):E.call(m,y)},i.prototype.listenerCount=E,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]},Jt.exports}(),qt=Va(sr),gi=Object.prototype.hasOwnProperty;function vi(t,e,n){for(n of t.keys())if(se(n,e))return n}function se(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--&&se(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=vi(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=vi(e,i))||!se(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(gi.call(t,n)&&++r&&!gi.call(e,n)||!(n in e)||!se(t[n],e[n]))return!1;return Object.keys(e).length===r}}return t!=t&&e!=e}const Ja={"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"},wo={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"},K={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},ie={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"},Ne={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class T{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=T.getVersionPrecision(e),s=T.getVersionPrecision(n);let a=Math.max(i,s),c=0;const l=T.map([e,n],f=>{const h=a-T.getVersionPrecision(f),v=f+new Array(h+1).join(".0");return T.map(v.split("."),E=>new Array(20-E.length).join("0")+E).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 Ja[e]}static getBrowserTypeByAlias(e){return wo[e]||""}}const z=/version\/(\d+(\.?_?\d+)+)/i,qa=[{test:[/googlebot/i],describe(t){const e={name:"Googlebot"},n=T.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,t)||T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/opera/i],describe(t){const e={name:"Opera"},n=T.getFirstMatch(z,t)||T.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/opr\/|opios/i],describe(t){const e={name:"Opera"},n=T.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,t)||T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/SamsungBrowser/i],describe(t){const e={name:"Samsung Internet for Android"},n=T.getFirstMatch(z,t)||T.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=T.getFirstMatch(z,t)||T.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/MZBrowser/i],describe(t){const e={name:"MZ Browser"},n=T.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,t)||T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/focus/i],describe(t){const e={name:"Focus"},n=T.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,t)||T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/swing/i],describe(t){const e={name:"Swing"},n=T.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,t)||T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/coast/i],describe(t){const e={name:"Opera Coast"},n=T.getFirstMatch(z,t)||T.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=T.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,t)||T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/yabrowser/i],describe(t){const e={name:"Yandex Browser"},n=T.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,t)||T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/ucbrowser/i],describe(t){const e={name:"UC Browser"},n=T.getFirstMatch(z,t)||T.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/Maxthon|mxios/i],describe(t){const e={name:"Maxthon"},n=T.getFirstMatch(z,t)||T.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/epiphany/i],describe(t){const e={name:"Epiphany"},n=T.getFirstMatch(z,t)||T.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/puffin/i],describe(t){const e={name:"Puffin"},n=T.getFirstMatch(z,t)||T.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/sleipnir/i],describe(t){const e={name:"Sleipnir"},n=T.getFirstMatch(z,t)||T.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=T.getFirstMatch(z,t)||T.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/micromessenger/i],describe(t){const e={name:"WeChat"},n=T.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,t)||T.getFirstMatch(z,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=T.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,t)||T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/msie|trident/i],describe(t){const e={name:"Internet Explorer"},n=T.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/\sedg\//i],describe(t){const e={name:"Microsoft Edge"},n=T.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=T.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/vivaldi/i],describe(t){const e={name:"Vivaldi"},n=T.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/seamonkey/i],describe(t){const e={name:"SeaMonkey"},n=T.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/sailfish/i],describe(t){const e={name:"Sailfish"},n=T.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=T.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/phantom/i],describe(t){const e={name:"PhantomJS"},n=T.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/slimerjs/i],describe(t){const e={name:"SlimerJS"},n=T.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=T.getFirstMatch(z,t)||T.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=T.getFirstMatch(z,t)||T.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=T.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/tizen/i],describe(t){const e={name:"Tizen"},n=T.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,t)||T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/qupzilla/i],describe(t){const e={name:"QupZilla"},n=T.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,t)||T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/firefox|iceweasel|fxios/i],describe(t){const e={name:"Firefox"},n=T.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=T.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/MiuiBrowser/i],describe(t){const e={name:"Miui"},n=T.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/chromium/i],describe(t){const e={name:"Chromium"},n=T.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,t)||T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/chrome|crios|crmo/i],describe(t){const e={name:"Chrome"},n=T.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=T.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=T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/playstation 4/i],describe(t){const e={name:"PlayStation 4"},n=T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/safari|applewebkit/i],describe(t){const e={name:"Safari"},n=T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/.*/i],describe(t){const e=t.search("\\(")!==-1?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:T.getFirstMatch(e,t),version:T.getSecondMatch(e,t)}}}];var $a=[{test:[/Roku\/DVP/],describe(t){const e=T.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,t);return{name:ie.Roku,version:e}}},{test:[/windows phone/i],describe(t){const e=T.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,t);return{name:ie.WindowsPhone,version:e}}},{test:[/windows /i],describe(t){const e=T.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,t),n=T.getWindowsVersionName(e);return{name:ie.Windows,version:e,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(t){const e={name:ie.iOS},n=T.getSecondMatch(/(Version\/)(\d[\d.]+)/,t);return n&&(e.version=n),e}},{test:[/macintosh/i],describe(t){const e=T.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,t).replace(/[_\s]/g,"."),n=T.getMacOSVersionName(e),r={name:ie.MacOS,version:e};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe(t){const e=T.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,t).replace(/[_\s]/g,".");return{name:ie.iOS,version:e}}},{test(t){const e=!t.test(/like android/i),n=t.test(/android/i);return e&&n},describe(t){const e=T.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,t),n=T.getAndroidVersionName(e),r={name:ie.Android,version:e};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe(t){const e=T.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,t),n={name:ie.WebOS};return e&&e.length&&(n.version=e),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(t){const e=T.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,t)||T.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,t)||T.getFirstMatch(/\bbb(\d+)/i,t);return{name:ie.BlackBerry,version:e}}},{test:[/bada/i],describe(t){const e=T.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,t);return{name:ie.Bada,version:e}}},{test:[/tizen/i],describe(t){const e=T.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,t);return{name:ie.Tizen,version:e}}},{test:[/linux/i],describe:()=>({name:ie.Linux})},{test:[/CrOS/],describe:()=>({name:ie.ChromeOS})},{test:[/PlayStation 4/],describe(t){const e=T.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,t);return{name:ie.PlayStation4,version:e}}}],za=[{test:[/googlebot/i],describe:()=>({type:"bot",vendor:"Google"})},{test:[/huawei/i],describe(t){const e=T.getFirstMatch(/(can-l01)/i,t)&&"Nova",n={type:K.mobile,vendor:"Huawei"};return e&&(n.model=e),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:()=>({type:K.tablet,vendor:"Nexus"})},{test:[/ipad/i],describe:()=>({type:K.tablet,vendor:"Apple",model:"iPad"})},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:()=>({type:K.tablet,vendor:"Apple",model:"iPad"})},{test:[/kftt build/i],describe:()=>({type:K.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"})},{test:[/silk/i],describe:()=>({type:K.tablet,vendor:"Amazon"})},{test:[/tablet(?! pc)/i],describe:()=>({type:K.tablet})},{test(t){const e=t.test(/ipod|iphone/i),n=t.test(/like (ipod|iphone)/i);return e&&!n},describe(t){const e=T.getFirstMatch(/(ipod|iphone)/i,t);return{type:K.mobile,vendor:"Apple",model:e}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:()=>({type:K.mobile,vendor:"Nexus"})},{test:[/[^-]mobi/i],describe:()=>({type:K.mobile})},{test:t=>t.getBrowserName(!0)==="blackberry",describe:()=>({type:K.mobile,vendor:"BlackBerry"})},{test:t=>t.getBrowserName(!0)==="bada",describe:()=>({type:K.mobile})},{test:t=>t.getBrowserName()==="windows phone",describe:()=>({type:K.mobile,vendor:"Microsoft"})},{test(t){const e=Number(String(t.getOSVersion()).split(".")[0]);return t.getOSName(!0)==="android"&&e>=3},describe:()=>({type:K.tablet})},{test:t=>t.getOSName(!0)==="android",describe:()=>({type:K.mobile})},{test:t=>t.getOSName(!0)==="macos",describe:()=>({type:K.desktop,vendor:"Apple"})},{test:t=>t.getOSName(!0)==="windows",describe:()=>({type:K.desktop})},{test:t=>t.getOSName(!0)==="linux",describe:()=>({type:K.desktop})},{test:t=>t.getOSName(!0)==="playstation 4",describe:()=>({type:K.tv})},{test:t=>t.getOSName(!0)==="roku",describe:()=>({type:K.tv})}],Ha=[{test:t=>t.getBrowserName(!0)==="microsoft edge",describe(t){if(/\sedg\//i.test(t))return{name:Ne.Blink};const e=T.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,t);return{name:Ne.EdgeHTML,version:e}}},{test:[/trident/i],describe(t){const e={name:Ne.Trident},n=T.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:t=>t.test(/presto/i),describe(t){const e={name:Ne.Presto},n=T.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:Ne.Gecko},n=T.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/(apple)?webkit\/537\.36/i],describe:()=>({name:Ne.Blink})},{test:[/(apple)?webkit/i],describe(t){const e={name:Ne.WebKit},n=T.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}}];class yi{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=T.find(qa,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=T.find($a,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=T.find(za,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=T.find(Ha,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 T.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=T.find(a,f=>this.isOS(f));if(c){const f=this.satisfies(n[c]);if(f!==void 0)return f}const l=T.find(a,f=>this.isPlatform(f));if(l){const f=this.satisfies(n[l]);if(f!==void 0)return f}}if(s>0){const a=Object.keys(i),c=T.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=T.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(T.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
3
|
* Bowser - a browser detector
|
|
4
4
|
* https://github.com/lancedikson/bowser
|
|
5
5
|
* MIT License | (c) Dustin Diaz 2012-2015
|
|
6
6
|
* MIT License | (c) Denis Demchenko 2015-2019
|
|
7
|
-
*/class
|
|
7
|
+
*/class Wa{static getParser(e,n=!1){if(typeof e!="string")throw new Error("UserAgent should be a string");return new yi(e,n)}static parse(e){return new yi(e).getResult()}static get BROWSER_MAP(){return wo}static get ENGINE_MAP(){return Ne}static get OS_MAP(){return ie}static get PLATFORMS_MAP(){return K}}function En(){return Date.now()+Math.random().toString()}function Et(){throw new Error("Method must be implemented in subclass")}function So(t,e){return e!=null&&e.proxyUrl?e.proxyUrl+(e.proxyUrl.slice(-1)==="/"?"":"/")+t.substring(8):t}function dn(t){return t!=null&&t.callObjectBundleUrlOverride?t.callObjectBundleUrlOverride:So("https://c.daily.co/call-machine/versioned/".concat("0.87.0","/static/call-machine-object-bundle.js"),t)}function fn(t){try{new URL(t)}catch{return!1}return!0}const W=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Ke="8.55.0",$=globalThis;function hn(t,e,n){const r=$,i=r.__SENTRY__=r.__SENTRY__||{},s=i[Ke]=i[Ke]||{};return s[t]||(s[t]=e())}const it=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,or=["debug","info","warn","error","log","assert","trace"],pn={};function Lt(t){if(!("console"in $))return t();const e=$.console,n={},r=Object.keys(pn);r.forEach(i=>{const s=pn[i];n[i]=e[i],e[i]=s});try{return t()}finally{r.forEach(i=>{e[i]=n[i]})}}const N=hn("logger",function(){let t=!1;const e={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return it?or.forEach(n=>{e[n]=(...r)=>{t&&Lt(()=>{$.console[n](`Sentry Logger [${n}]:`,...r)})}}):or.forEach(n=>{e[n]=()=>{}}),e}),We="?",bi=/\(error: (.*)\)/,_i=/captureMessage|captureException/;function $t(t){return t[t.length-1]||{}}const wi="<anonymous>";function Ue(t){try{return t&&typeof t=="function"&&t.name||wi}catch{return wi}}function Si(t){const e=t.exception;if(e){const n=[];try{return e.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch{return}}}const rn={},ki={};function Qe(t,e){rn[t]=rn[t]||[],rn[t].push(e)}function Xe(t,e){if(!ki[t]){ki[t]=!0;try{e()}catch(n){it&&N.error(`Error while instrumenting ${t}`,n)}}}function _e(t,e){const n=t&&rn[t];if(n)for(const r of n)try{r(e)}catch(i){it&&N.error(`Error while triggering instrumentation handler.
|
|
8
8
|
Type: ${t}
|
|
9
|
-
Name: ${
|
|
10
|
-
Error:`,i)}}let Dn=null;function Wa(){Dn=$.onerror,$.onerror=function(t,e,n,r,i){return _e("error",{column:r,error:i,line:n,msg:t,url:e}),!!Dn&&Dn.apply(this,arguments)},$.onerror.__SENTRY_INSTRUMENTED__=!0}let Nn=null;function Ga(){Nn=$.onunhandledrejection,$.onunhandledrejection=function(t){return _e("unhandledrejection",t),!Nn||Nn.apply(this,arguments)},$.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}function Tn(){return Rr($),$}function Rr(t){const e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||Ke,e[Ke]=e[Ke]||{}}const So=Object.prototype.toString;function Dr(t){switch(So.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Ze(t,Error)}}function vt(t,e){return So.call(t)===`[object ${e}]`}function ko(t){return vt(t,"ErrorEvent")}function ki(t){return vt(t,"DOMError")}function xe(t){return vt(t,"String")}function Nr(t){return typeof t=="object"&&t!==null&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function or(t){return t===null||Nr(t)||typeof t!="object"&&typeof t!="function"}function ft(t){return vt(t,"Object")}function Cn(t){return typeof Event<"u"&&Ze(t,Event)}function Mn(t){return!!(t&&t.then&&typeof t.then=="function")}function Ze(t,e){try{return t instanceof e}catch{return!1}}function Eo(t){return!(typeof t!="object"||t===null||!t.__isVue&&!t._isVue)}const Fr=$;function To(t,e={}){if(!t)return"<unknown>";try{let n=t;const r=5,i=[];let s=0,a=0;const c=" > ",l=c.length;let f;const h=Array.isArray(e)?e:e.keyAttrs,v=!Array.isArray(e)&&e.maxStringLength||80;for(;n&&s++<r&&(f=Ka(n,h),!(f==="html"||s>1&&a+i.length*l+f.length>=v));)i.push(f),a+=f.length,n=n.parentNode;return i.reverse().join(c)}catch{return"<unknown>"}}function Ka(t,e){const n=t,r=[];if(!n||!n.tagName)return"";if(Fr.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const i=e&&e.length?e.filter(a=>n.getAttribute(a)).map(a=>[a,n.getAttribute(a)]):null;if(i&&i.length)i.forEach(a=>{r.push(`[${a[0]}="${a[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const a=n.className;if(a&&xe(a)){const c=a.split(/\s+/);for(const l of c)r.push(`.${l}`)}}const s=["aria-label","type","name","title","alt"];for(const a of s){const c=n.getAttribute(a);c&&r.push(`[${a}="${c}"]`)}return r.join("")}function ut(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function Ei(t,e){if(!Array.isArray(t))return"";const n=[];for(let r=0;r<t.length;r++){const i=t[r];try{Eo(i)?n.push("[VueViewModel]"):n.push(String(i))}catch{n.push("[value cannot be serialized]")}}return n.join(e)}function Qa(t,e,n=!1){return!!xe(t)&&(vt(e,"RegExp")?e.test(t):!!xe(e)&&(n?t===e:t.includes(e)))}function zt(t,e=[],n=!1){return e.some(r=>Qa(t,r,n))}function ue(t,e,n){if(!(e in t))return;const r=t[e],i=n(r);typeof i=="function"&&Co(i,r);try{t[e]=i}catch{it&&D.log(`Failed to replace method "${e}" in object`,t)}}function et(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{it&&D.log(`Failed to add non-enumerable property "${e}" to object`,t)}}function Co(t,e){try{const n=e.prototype||{};t.prototype=e.prototype=n,et(t,"__sentry_original__",e)}catch{}}function Ur(t){return t.__sentry_original__}function Mo(t){if(Dr(t))return{message:t.message,name:t.name,stack:t.stack,...Ci(t)};if(Cn(t)){const e={type:t.type,target:Ti(t.target),currentTarget:Ti(t.currentTarget),...Ci(t)};return typeof CustomEvent<"u"&&Ze(t,CustomEvent)&&(e.detail=t.detail),e}return t}function Ti(t){try{return e=t,typeof Element<"u"&&Ze(e,Element)?To(t):Object.prototype.toString.call(t)}catch{return"<unknown>"}var e}function Ci(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 me(t){return ar(t,new Map)}function ar(t,e){if(function(n){if(!ft(n))return!1;try{const r=Object.getPrototypeOf(n).constructor.name;return!r||r==="Object"}catch{return!0}}(t)){const n=e.get(t);if(n!==void 0)return n;const r={};e.set(t,r);for(const i of Object.getOwnPropertyNames(t))t[i]!==void 0&&(r[i]=ar(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(ar(i,e))}),r}return t}function Rt(){return Date.now()/1e3}const Ie=function(){const{performance:t}=$;if(!t||!t.now)return Rt;const e=Date.now()-t.now(),n=t.timeOrigin==null?e:t.timeOrigin;return()=>(n+t.now())/1e3}();function ge(){const t=$,e=t.crypto||t.msCrypto;let n=()=>16*Math.random();try{if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");e&&e.getRandomValues&&(n=()=>{const r=new Uint8Array(1);return e.getRandomValues(r),r[0]})}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,r=>(r^(15&n())>>r/4).toString(16))}function Oo(t){return t.exception&&t.exception.values?t.exception.values[0]:void 0}function Ne(t){const{message:e,event_id:n}=t;if(e)return e;const r=Oo(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function cr(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 ht(t,e){const n=Oo(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 Mi(t){if(function(e){try{return e.__sentry_captured__}catch{}}(t))return!0;try{et(t,"__sentry_captured__",!0)}catch{}return!1}var Ae;function tt(t){return new pe(e=>{e(t)})}function mn(t){return new pe((e,n)=>{n(t)})}(()=>{const{performance:t}=$;!t||!t.now||(t.now(),t.timing&&t.timing.navigationStart)})(),function(t){t[t.PENDING=0]="PENDING",t[t.RESOLVED=1]="RESOLVED",t[t.REJECTED=2]="REJECTED"}(Ae||(Ae={}));class pe{constructor(e){pe.prototype.__init.call(this),pe.prototype.__init2.call(this),pe.prototype.__init3.call(this),pe.prototype.__init4.call(this),this._state=Ae.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(n){this._reject(n)}}then(e,n){return new pe((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 pe((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)})})}__init(){this._resolve=e=>{this._setResult(Ae.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(Ae.REJECTED,e)}}__init3(){this._setResult=(e,n)=>{this._state===Ae.PENDING&&(Mn(n)?n.then(this._resolve,this._reject):(this._state=e,this._value=n,this._executeHandlers()))}}__init4(){this._executeHandlers=()=>{if(this._state===Ae.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach(n=>{n[0]||(this._state===Ae.RESOLVED&&n[1](this._value),this._state===Ae.REJECTED&&n[2](this._value),n[0]=!0)})}}}function Xa(t){const e=Ie(),n={sid:ge(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(r){return me({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,abnormal_mechanism:r.abnormal_mechanism,attrs:{release:r.release,environment:r.environment,ip_address:r.ipAddress,user_agent:r.userAgent}})}(n)};return t&&pt(n,t),n}function pt(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||Ie(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:ge()),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)}function Oi(){return ge()}function lr(){return ge().substring(16)}function On(t,e,n=2){if(!e||typeof e!="object"||n<=0)return e;if(t&&e&&Object.keys(e).length===0)return t;const r={...t};for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=On(r[i],e[i],n-1));return r}const ur="_sentrySpan";function Ai(t,e){e?et(t,ur,e):delete t[ur]}function Pi(t){return t[ur]}class Br{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Oi(),spanId:lr()}}clone(){const e=new Br;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._requestSession=this._requestSession,e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,Ai(e,Pi(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&pt(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}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const n=typeof e=="function"?e(this):e,[r,i]=n instanceof Ue?[n.getScopeData(),n.getRequestSession()]:ft(n)?[e,e.requestSession]:[],{tags:s,extra:a,user:c,contexts:l,level:f,fingerprint:h=[],propagationContext:v}=r||{};return this._tags={...this._tags,...s},this._extra={...this._extra,...a},this._contexts={...this._contexts,...l},c&&Object.keys(c).length&&(this._user=c),f&&(this._level=f),h.length&&(this._fingerprint=h),v&&(this._propagationContext=v),i&&(this._requestSession=i),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._session=void 0,Ai(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Oi()}),this._notifyScopeListeners(),this}addBreadcrumb(e,n){const r=typeof n=="number"?n:100;if(r<=0)return this;const i={timestamp:Rt(),...e};return this._breadcrumbs.push(i),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),this._client&&this._client.recordDroppedEvent("buffer_overflow","log_item")),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}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:Pi(this)}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=On(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext={spanId:lr(),...e},this}getPropagationContext(){return this._propagationContext}captureException(e,n){const r=n&&n.event_id?n.event_id:ge();if(!this._client)return D.warn("No client configured on scope - will not capture exception!"),r;const i=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:i,...n,event_id:r},this),r}captureMessage(e,n,r){const i=r&&r.event_id?r.event_id:ge();if(!this._client)return D.warn("No client configured on scope - will not capture message!"),i;const s=new Error(e);return this._client.captureMessage(e,n,{originalException:e,syntheticException:s,...r,event_id:i},this),i}captureEvent(e,n){const r=n&&n.event_id?n.event_id:ge();return this._client?(this._client.captureEvent(e,{...n,event_id:r},this),r):(D.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}const Ue=Br;class Ya{constructor(e,n){let r,i;r=e||new Ue,i=n||new Ue,this._stack=[{scope:r}],this._isolationScope=i}withScope(e){const n=this._pushScope();let r;try{r=e(n)}catch(i){throw this._popScope(),i}return Mn(r)?r.then(i=>(this._popScope(),i),i=>{throw this._popScope(),i}):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return!(this._stack.length<=1)&&!!this._stack.pop()}}function mt(){const t=Rr(Tn());return t.stack=t.stack||new Ya(hn("defaultCurrentScope",()=>new Ue),hn("defaultIsolationScope",()=>new Ue))}function Za(t){return mt().withScope(t)}function ec(t,e){const n=mt();return n.withScope(()=>(n.getStackTop().scope=t,e(t)))}function xi(t){return mt().withScope(()=>t(mt().getIsolationScope()))}function Vr(t){const e=Rr(t);return e.acs?e.acs:{withIsolationScope:xi,withScope:Za,withSetScope:ec,withSetIsolationScope:(n,r)=>xi(r),getCurrentScope:()=>mt().getScope(),getIsolationScope:()=>mt().getIsolationScope()}}function st(){return Vr(Tn()).getCurrentScope()}function Dt(){return Vr(Tn()).getIsolationScope()}function te(){return st().getClient()}function tc(t){const e=t.getPropagationContext(),{traceId:n,spanId:r,parentSpanId:i}=e;return me({trace_id:n,span_id:r,parent_span_id:i})}function nc(t){const e=t._sentryMetrics;if(!e)return;const n={};for(const[,[r,i]]of e)(n[r]||(n[r]=[])).push(me(i));return n}const rc=/^sentry-/;function ic(t){const e=function(r){if(!(!r||!xe(r)&&!Array.isArray(r)))return Array.isArray(r)?r.reduce((i,s)=>{const a=ji(s);return Object.entries(a).forEach(([c,l])=>{i[c]=l}),i},{}):ji(r)}(t);if(!e)return;const n=Object.entries(e).reduce((r,[i,s])=>(i.match(rc)&&(r[i.slice(7)]=s),r),{});return Object.keys(n).length>0?n:void 0}function ji(t){return t.split(",").map(e=>e.split("=").map(n=>decodeURIComponent(n.trim()))).reduce((e,[n,r])=>(n&&r&&(e[n]=r),e),{})}let Ii=!1;function sc(t){const{spanId:e,traceId:n,isRemote:r}=t.spanContext();return me({parent_span_id:r?e:Jr(t).parent_span_id,span_id:r?lr():e,trace_id:n})}function Li(t){return typeof t=="number"?Ri(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?Ri(t.getTime()):Ie()}function Ri(t){return t>9999999999?t/1e3:t}function Jr(t){if(function(e){return typeof e.getSpanJSON=="function"}(t))return t.getSpanJSON();try{const{spanId:e,traceId:n}=t.spanContext();if(function(r){const i=r;return!!(i.attributes&&i.startTime&&i.name&&i.endTime&&i.status)}(t)){const{attributes:r,startTime:i,name:s,endTime:a,parentSpanId:c,status:l}=t;return me({span_id:e,trace_id:n,data:r,description:s,parent_span_id:c,start_timestamp:Li(i),timestamp:Li(a)||void 0,status:oc(l),op:r["sentry.op"],origin:r["sentry.origin"],_metrics_summary:nc(t)})}return{span_id:e,trace_id:n}}catch{return{}}}function oc(t){if(t&&t.code!==0)return t.code===1?"ok":t.message||"unknown_error"}function Ao(t){return t._sentryRootSpan||t}function ac(){Ii||(Lt(()=>{console.warn("[Sentry] Deprecation warning: Returning null from `beforeSendSpan` will be disallowed from SDK version 9.0.0 onwards. The callback will only support mutating spans. To drop certain spans, configure the respective integrations directly.")}),Ii=!0)}const qr="production";function Po(t,e){const n=e.getOptions(),{publicKey:r}=e.getDsn()||{},i=me({environment:n.environment||qr,release:n.release,public_key:r,trace_id:t});return e.emit("createDsc",i),i}function cc(t){const e=te();if(!e)return{};const n=Ao(t),r=n._frozenDsc;if(r)return r;const i=n.spanContext().traceState,s=i&&i.get("sentry.dsc"),a=s&&ic(s);if(a)return a;const c=Po(t.spanContext().traceId,e),l=Jr(n),f=l.data||{},h=f["sentry.sample_rate"];h!=null&&(c.sample_rate=`${h}`);const v=f["sentry.source"],E=l.description;return v!=="url"&&E&&(c.transaction=E),function(k){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const b=te(),m=b&&b.getOptions();return!!m&&(m.enableTracing||"tracesSampleRate"in m||"tracesSampler"in m)}()&&(c.sampled=String(function(k){const{traceFlags:b}=k.spanContext();return b===1}(n))),e.emit("createDsc",c,n),c}const lc=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function gn(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 uc(t){const e=typeof t=="string"?function(n){const r=lc.exec(n);if(!r)return void Lt(()=>{console.error(`Invalid Sentry Dsn: ${n}`)});const[i,s,a="",c="",l="",f=""]=r.slice(1);let h="",v=f;const E=v.split("/");if(E.length>1&&(h=E.slice(0,-1).join("/"),v=E.pop()),v){const k=v.match(/^\d+/);k&&(v=k[0])}return Di({host:c,pass:a,path:h,projectId:v,port:l,protocol:i,publicKey:s})}(t):Di(t);if(e&&function(n){if(!it)return!0;const{port:r,projectId:i,protocol:s}=n;return!(["protocol","publicKey","host","projectId"].find(a=>!n[a]&&(D.error(`Invalid Sentry Dsn: ${a} missing`),!0))||(i.match(/^\d+$/)?function(a){return a==="http"||a==="https"}(s)?r&&isNaN(parseInt(r,10))&&(D.error(`Invalid Sentry Dsn: Invalid port ${r}`),1):(D.error(`Invalid Sentry Dsn: Invalid protocol ${s}`),1):(D.error(`Invalid Sentry Dsn: Invalid projectId ${i}`),1)))}(e))return e}function Pe(t,e=100,n=1/0){try{return dr("",t,e,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function xo(t,e=3,n=102400){const r=Pe(t,e);return i=r,function(s){return~-encodeURI(s).split(/%..|./).length}(JSON.stringify(i))>n?xo(t,e-1,n):r;var i}function dr(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||["boolean","string"].includes(typeof e)||typeof e=="number"&&Number.isFinite(e))return e;const c=function(k,b){try{if(k==="domain"&&b&&typeof b=="object"&&b._events)return"[Domain]";if(k==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&b===global)return"[Global]";if(typeof window<"u"&&b===window)return"[Window]";if(typeof document<"u"&&b===document)return"[Document]";if(Eo(b))return"[VueViewModel]";if(ft(m=b)&&"nativeEvent"in m&&"preventDefault"in m&&"stopPropagation"in m)return"[SyntheticEvent]";if(typeof b=="number"&&!Number.isFinite(b))return`[${b}]`;if(typeof b=="function")return`[Function: ${Fe(b)}]`;if(typeof b=="symbol")return`[${String(b)}]`;if(typeof b=="bigint")return`[BigInt: ${String(b)}]`;const y=function(w){const C=Object.getPrototypeOf(w);return C?C.constructor.name:"null prototype"}(b);return/^HTML(\w*)Element$/.test(y)?`[HTMLElement: ${y}]`:`[object ${y}]`}catch(y){return`**non-serializable** (${y})`}var m}(t,e);if(!c.startsWith("[object "))return c;if(e.__sentry_skip_normalization__)return e;const l=typeof e.__sentry_override_normalization_depth__=="number"?e.__sentry_override_normalization_depth__:n;if(l===0)return c.replace("object ","");if(s(e))return"[Circular ~]";const f=e;if(f&&typeof f.toJSON=="function")try{return dr("",f.toJSON(),l-1,r,i)}catch{}const h=Array.isArray(e)?[]:{};let v=0;const E=Mo(e);for(const k in E){if(!Object.prototype.hasOwnProperty.call(E,k))continue;if(v>=r){h[k]="[MaxProperties ~]";break}const b=E[k];h[k]=dr(k,b,l-1,r,i),v++}return a(e),h}function jt(t,e=[]){return[t,e]}function dc(t,e){const[n,r]=t;return[n,[...r,e]]}function Ni(t,e){const n=t[1];for(const r of n)if(e(r,r[0].type))return!0;return!1}function fr(t){return $.__SENTRY__&&$.__SENTRY__.encodePolyfill?$.__SENTRY__.encodePolyfill(t):new TextEncoder().encode(t)}function fc(t){const[e,n]=t;let r=JSON.stringify(e);function i(s){typeof r=="string"?r=typeof s=="string"?r+s:[fr(r),s]:r.push(typeof s=="string"?fr(s):s)}for(const s of n){const[a,c]=s;if(i(`
|
|
9
|
+
Name: ${Ue(r)}
|
|
10
|
+
Error:`,i)}}let Dn=null;function Ga(){Dn=$.onerror,$.onerror=function(t,e,n,r,i){return _e("error",{column:r,error:i,line:n,msg:t,url:e}),!!Dn&&Dn.apply(this,arguments)},$.onerror.__SENTRY_INSTRUMENTED__=!0}let Nn=null;function Ka(){Nn=$.onunhandledrejection,$.onunhandledrejection=function(t){return _e("unhandledrejection",t),!Nn||Nn.apply(this,arguments)},$.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}function Tn(){return Dr($),$}function Dr(t){const e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||Ke,e[Ke]=e[Ke]||{}}const ko=Object.prototype.toString;function Nr(t){switch(ko.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Ze(t,Error)}}function vt(t,e){return ko.call(t)===`[object ${e}]`}function Eo(t){return vt(t,"ErrorEvent")}function Ei(t){return vt(t,"DOMError")}function xe(t){return vt(t,"String")}function Fr(t){return typeof t=="object"&&t!==null&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function ar(t){return t===null||Fr(t)||typeof t!="object"&&typeof t!="function"}function ft(t){return vt(t,"Object")}function Cn(t){return typeof Event<"u"&&Ze(t,Event)}function Mn(t){return!!(t&&t.then&&typeof t.then=="function")}function Ze(t,e){try{return t instanceof e}catch{return!1}}function To(t){return!(typeof t!="object"||t===null||!t.__isVue&&!t._isVue)}const Ur=$;function Co(t,e={}){if(!t)return"<unknown>";try{let n=t;const r=5,i=[];let s=0,a=0;const c=" > ",l=c.length;let f;const h=Array.isArray(e)?e:e.keyAttrs,v=!Array.isArray(e)&&e.maxStringLength||80;for(;n&&s++<r&&(f=Qa(n,h),!(f==="html"||s>1&&a+i.length*l+f.length>=v));)i.push(f),a+=f.length,n=n.parentNode;return i.reverse().join(c)}catch{return"<unknown>"}}function Qa(t,e){const n=t,r=[];if(!n||!n.tagName)return"";if(Ur.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const i=e&&e.length?e.filter(a=>n.getAttribute(a)).map(a=>[a,n.getAttribute(a)]):null;if(i&&i.length)i.forEach(a=>{r.push(`[${a[0]}="${a[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const a=n.className;if(a&&xe(a)){const c=a.split(/\s+/);for(const l of c)r.push(`.${l}`)}}const s=["aria-label","type","name","title","alt"];for(const a of s){const c=n.getAttribute(a);c&&r.push(`[${a}="${c}"]`)}return r.join("")}function ut(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function Ti(t,e){if(!Array.isArray(t))return"";const n=[];for(let r=0;r<t.length;r++){const i=t[r];try{To(i)?n.push("[VueViewModel]"):n.push(String(i))}catch{n.push("[value cannot be serialized]")}}return n.join(e)}function Xa(t,e,n=!1){return!!xe(t)&&(vt(e,"RegExp")?e.test(t):!!xe(e)&&(n?t===e:t.includes(e)))}function zt(t,e=[],n=!1){return e.some(r=>Xa(t,r,n))}function ue(t,e,n){if(!(e in t))return;const r=t[e],i=n(r);typeof i=="function"&&Mo(i,r);try{t[e]=i}catch{it&&N.log(`Failed to replace method "${e}" in object`,t)}}function et(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{it&&N.log(`Failed to add non-enumerable property "${e}" to object`,t)}}function Mo(t,e){try{const n=e.prototype||{};t.prototype=e.prototype=n,et(t,"__sentry_original__",e)}catch{}}function Br(t){return t.__sentry_original__}function Oo(t){if(Nr(t))return{message:t.message,name:t.name,stack:t.stack,...Mi(t)};if(Cn(t)){const e={type:t.type,target:Ci(t.target),currentTarget:Ci(t.currentTarget),...Mi(t)};return typeof CustomEvent<"u"&&Ze(t,CustomEvent)&&(e.detail=t.detail),e}return t}function Ci(t){try{return e=t,typeof Element<"u"&&Ze(e,Element)?Co(t):Object.prototype.toString.call(t)}catch{return"<unknown>"}var e}function Mi(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 me(t){return cr(t,new Map)}function cr(t,e){if(function(n){if(!ft(n))return!1;try{const r=Object.getPrototypeOf(n).constructor.name;return!r||r==="Object"}catch{return!0}}(t)){const n=e.get(t);if(n!==void 0)return n;const r={};e.set(t,r);for(const i of Object.getOwnPropertyNames(t))t[i]!==void 0&&(r[i]=cr(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(cr(i,e))}),r}return t}function Rt(){return Date.now()/1e3}const Ie=function(){const{performance:t}=$;if(!t||!t.now)return Rt;const e=Date.now()-t.now(),n=t.timeOrigin==null?e:t.timeOrigin;return()=>(n+t.now())/1e3}();function ge(){const t=$,e=t.crypto||t.msCrypto;let n=()=>16*Math.random();try{if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");e&&e.getRandomValues&&(n=()=>{const r=new Uint8Array(1);return e.getRandomValues(r),r[0]})}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,r=>(r^(15&n())>>r/4).toString(16))}function Ao(t){return t.exception&&t.exception.values?t.exception.values[0]:void 0}function Fe(t){const{message:e,event_id:n}=t;if(e)return e;const r=Ao(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function lr(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 ht(t,e){const n=Ao(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 Oi(t){if(function(e){try{return e.__sentry_captured__}catch{}}(t))return!0;try{et(t,"__sentry_captured__",!0)}catch{}return!1}var Ae;function tt(t){return new pe(e=>{e(t)})}function mn(t){return new pe((e,n)=>{n(t)})}(()=>{const{performance:t}=$;!t||!t.now||(t.now(),t.timing&&t.timing.navigationStart)})(),function(t){t[t.PENDING=0]="PENDING",t[t.RESOLVED=1]="RESOLVED",t[t.REJECTED=2]="REJECTED"}(Ae||(Ae={}));class pe{constructor(e){pe.prototype.__init.call(this),pe.prototype.__init2.call(this),pe.prototype.__init3.call(this),pe.prototype.__init4.call(this),this._state=Ae.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(n){this._reject(n)}}then(e,n){return new pe((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 pe((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)})})}__init(){this._resolve=e=>{this._setResult(Ae.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(Ae.REJECTED,e)}}__init3(){this._setResult=(e,n)=>{this._state===Ae.PENDING&&(Mn(n)?n.then(this._resolve,this._reject):(this._state=e,this._value=n,this._executeHandlers()))}}__init4(){this._executeHandlers=()=>{if(this._state===Ae.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach(n=>{n[0]||(this._state===Ae.RESOLVED&&n[1](this._value),this._state===Ae.REJECTED&&n[2](this._value),n[0]=!0)})}}}function Ya(t){const e=Ie(),n={sid:ge(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(r){return me({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,abnormal_mechanism:r.abnormal_mechanism,attrs:{release:r.release,environment:r.environment,ip_address:r.ipAddress,user_agent:r.userAgent}})}(n)};return t&&pt(n,t),n}function pt(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||Ie(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:ge()),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)}function Ai(){return ge()}function ur(){return ge().substring(16)}function On(t,e,n=2){if(!e||typeof e!="object"||n<=0)return e;if(t&&e&&Object.keys(e).length===0)return t;const r={...t};for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=On(r[i],e[i],n-1));return r}const dr="_sentrySpan";function Pi(t,e){e?et(t,dr,e):delete t[dr]}function xi(t){return t[dr]}class Vr{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Ai(),spanId:ur()}}clone(){const e=new Vr;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._requestSession=this._requestSession,e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,Pi(e,xi(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&pt(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}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const n=typeof e=="function"?e(this):e,[r,i]=n instanceof Be?[n.getScopeData(),n.getRequestSession()]:ft(n)?[e,e.requestSession]:[],{tags:s,extra:a,user:c,contexts:l,level:f,fingerprint:h=[],propagationContext:v}=r||{};return this._tags={...this._tags,...s},this._extra={...this._extra,...a},this._contexts={...this._contexts,...l},c&&Object.keys(c).length&&(this._user=c),f&&(this._level=f),h.length&&(this._fingerprint=h),v&&(this._propagationContext=v),i&&(this._requestSession=i),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._session=void 0,Pi(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Ai()}),this._notifyScopeListeners(),this}addBreadcrumb(e,n){const r=typeof n=="number"?n:100;if(r<=0)return this;const i={timestamp:Rt(),...e};return this._breadcrumbs.push(i),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),this._client&&this._client.recordDroppedEvent("buffer_overflow","log_item")),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}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:xi(this)}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=On(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext={spanId:ur(),...e},this}getPropagationContext(){return this._propagationContext}captureException(e,n){const r=n&&n.event_id?n.event_id:ge();if(!this._client)return N.warn("No client configured on scope - will not capture exception!"),r;const i=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:i,...n,event_id:r},this),r}captureMessage(e,n,r){const i=r&&r.event_id?r.event_id:ge();if(!this._client)return N.warn("No client configured on scope - will not capture message!"),i;const s=new Error(e);return this._client.captureMessage(e,n,{originalException:e,syntheticException:s,...r,event_id:i},this),i}captureEvent(e,n){const r=n&&n.event_id?n.event_id:ge();return this._client?(this._client.captureEvent(e,{...n,event_id:r},this),r):(N.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}const Be=Vr;class Za{constructor(e,n){let r,i;r=e||new Be,i=n||new Be,this._stack=[{scope:r}],this._isolationScope=i}withScope(e){const n=this._pushScope();let r;try{r=e(n)}catch(i){throw this._popScope(),i}return Mn(r)?r.then(i=>(this._popScope(),i),i=>{throw this._popScope(),i}):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return!(this._stack.length<=1)&&!!this._stack.pop()}}function mt(){const t=Dr(Tn());return t.stack=t.stack||new Za(hn("defaultCurrentScope",()=>new Be),hn("defaultIsolationScope",()=>new Be))}function ec(t){return mt().withScope(t)}function tc(t,e){const n=mt();return n.withScope(()=>(n.getStackTop().scope=t,e(t)))}function ji(t){return mt().withScope(()=>t(mt().getIsolationScope()))}function Jr(t){const e=Dr(t);return e.acs?e.acs:{withIsolationScope:ji,withScope:ec,withSetScope:tc,withSetIsolationScope:(n,r)=>ji(r),getCurrentScope:()=>mt().getScope(),getIsolationScope:()=>mt().getIsolationScope()}}function st(){return Jr(Tn()).getCurrentScope()}function Dt(){return Jr(Tn()).getIsolationScope()}function te(){return st().getClient()}function nc(t){const e=t.getPropagationContext(),{traceId:n,spanId:r,parentSpanId:i}=e;return me({trace_id:n,span_id:r,parent_span_id:i})}function rc(t){const e=t._sentryMetrics;if(!e)return;const n={};for(const[,[r,i]]of e)(n[r]||(n[r]=[])).push(me(i));return n}const ic=/^sentry-/;function sc(t){const e=function(r){if(!(!r||!xe(r)&&!Array.isArray(r)))return Array.isArray(r)?r.reduce((i,s)=>{const a=Ii(s);return Object.entries(a).forEach(([c,l])=>{i[c]=l}),i},{}):Ii(r)}(t);if(!e)return;const n=Object.entries(e).reduce((r,[i,s])=>(i.match(ic)&&(r[i.slice(7)]=s),r),{});return Object.keys(n).length>0?n:void 0}function Ii(t){return t.split(",").map(e=>e.split("=").map(n=>decodeURIComponent(n.trim()))).reduce((e,[n,r])=>(n&&r&&(e[n]=r),e),{})}let Li=!1;function oc(t){const{spanId:e,traceId:n,isRemote:r}=t.spanContext();return me({parent_span_id:r?e:qr(t).parent_span_id,span_id:r?ur():e,trace_id:n})}function Ri(t){return typeof t=="number"?Di(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?Di(t.getTime()):Ie()}function Di(t){return t>9999999999?t/1e3:t}function qr(t){if(function(e){return typeof e.getSpanJSON=="function"}(t))return t.getSpanJSON();try{const{spanId:e,traceId:n}=t.spanContext();if(function(r){const i=r;return!!(i.attributes&&i.startTime&&i.name&&i.endTime&&i.status)}(t)){const{attributes:r,startTime:i,name:s,endTime:a,parentSpanId:c,status:l}=t;return me({span_id:e,trace_id:n,data:r,description:s,parent_span_id:c,start_timestamp:Ri(i),timestamp:Ri(a)||void 0,status:ac(l),op:r["sentry.op"],origin:r["sentry.origin"],_metrics_summary:rc(t)})}return{span_id:e,trace_id:n}}catch{return{}}}function ac(t){if(t&&t.code!==0)return t.code===1?"ok":t.message||"unknown_error"}function Po(t){return t._sentryRootSpan||t}function cc(){Li||(Lt(()=>{console.warn("[Sentry] Deprecation warning: Returning null from `beforeSendSpan` will be disallowed from SDK version 9.0.0 onwards. The callback will only support mutating spans. To drop certain spans, configure the respective integrations directly.")}),Li=!0)}const $r="production";function xo(t,e){const n=e.getOptions(),{publicKey:r}=e.getDsn()||{},i=me({environment:n.environment||$r,release:n.release,public_key:r,trace_id:t});return e.emit("createDsc",i),i}function lc(t){const e=te();if(!e)return{};const n=Po(t),r=n._frozenDsc;if(r)return r;const i=n.spanContext().traceState,s=i&&i.get("sentry.dsc"),a=s&&sc(s);if(a)return a;const c=xo(t.spanContext().traceId,e),l=qr(n),f=l.data||{},h=f["sentry.sample_rate"];h!=null&&(c.sample_rate=`${h}`);const v=f["sentry.source"],E=l.description;return v!=="url"&&E&&(c.transaction=E),function(k){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const b=te(),m=b&&b.getOptions();return!!m&&(m.enableTracing||"tracesSampleRate"in m||"tracesSampler"in m)}()&&(c.sampled=String(function(k){const{traceFlags:b}=k.spanContext();return b===1}(n))),e.emit("createDsc",c,n),c}const uc=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function gn(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 Ni(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function dc(t){const e=typeof t=="string"?function(n){const r=uc.exec(n);if(!r)return void Lt(()=>{console.error(`Invalid Sentry Dsn: ${n}`)});const[i,s,a="",c="",l="",f=""]=r.slice(1);let h="",v=f;const E=v.split("/");if(E.length>1&&(h=E.slice(0,-1).join("/"),v=E.pop()),v){const k=v.match(/^\d+/);k&&(v=k[0])}return Ni({host:c,pass:a,path:h,projectId:v,port:l,protocol:i,publicKey:s})}(t):Ni(t);if(e&&function(n){if(!it)return!0;const{port:r,projectId:i,protocol:s}=n;return!(["protocol","publicKey","host","projectId"].find(a=>!n[a]&&(N.error(`Invalid Sentry Dsn: ${a} missing`),!0))||(i.match(/^\d+$/)?function(a){return a==="http"||a==="https"}(s)?r&&isNaN(parseInt(r,10))&&(N.error(`Invalid Sentry Dsn: Invalid port ${r}`),1):(N.error(`Invalid Sentry Dsn: Invalid protocol ${s}`),1):(N.error(`Invalid Sentry Dsn: Invalid projectId ${i}`),1)))}(e))return e}function Pe(t,e=100,n=1/0){try{return fr("",t,e,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function jo(t,e=3,n=102400){const r=Pe(t,e);return i=r,function(s){return~-encodeURI(s).split(/%..|./).length}(JSON.stringify(i))>n?jo(t,e-1,n):r;var i}function fr(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||["boolean","string"].includes(typeof e)||typeof e=="number"&&Number.isFinite(e))return e;const c=function(k,b){try{if(k==="domain"&&b&&typeof b=="object"&&b._events)return"[Domain]";if(k==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&b===global)return"[Global]";if(typeof window<"u"&&b===window)return"[Window]";if(typeof document<"u"&&b===document)return"[Document]";if(To(b))return"[VueViewModel]";if(ft(m=b)&&"nativeEvent"in m&&"preventDefault"in m&&"stopPropagation"in m)return"[SyntheticEvent]";if(typeof b=="number"&&!Number.isFinite(b))return`[${b}]`;if(typeof b=="function")return`[Function: ${Ue(b)}]`;if(typeof b=="symbol")return`[${String(b)}]`;if(typeof b=="bigint")return`[BigInt: ${String(b)}]`;const y=function(w){const M=Object.getPrototypeOf(w);return M?M.constructor.name:"null prototype"}(b);return/^HTML(\w*)Element$/.test(y)?`[HTMLElement: ${y}]`:`[object ${y}]`}catch(y){return`**non-serializable** (${y})`}var m}(t,e);if(!c.startsWith("[object "))return c;if(e.__sentry_skip_normalization__)return e;const l=typeof e.__sentry_override_normalization_depth__=="number"?e.__sentry_override_normalization_depth__:n;if(l===0)return c.replace("object ","");if(s(e))return"[Circular ~]";const f=e;if(f&&typeof f.toJSON=="function")try{return fr("",f.toJSON(),l-1,r,i)}catch{}const h=Array.isArray(e)?[]:{};let v=0;const E=Oo(e);for(const k in E){if(!Object.prototype.hasOwnProperty.call(E,k))continue;if(v>=r){h[k]="[MaxProperties ~]";break}const b=E[k];h[k]=fr(k,b,l-1,r,i),v++}return a(e),h}function jt(t,e=[]){return[t,e]}function fc(t,e){const[n,r]=t;return[n,[...r,e]]}function Fi(t,e){const n=t[1];for(const r of n)if(e(r,r[0].type))return!0;return!1}function hr(t){return $.__SENTRY__&&$.__SENTRY__.encodePolyfill?$.__SENTRY__.encodePolyfill(t):new TextEncoder().encode(t)}function hc(t){const[e,n]=t;let r=JSON.stringify(e);function i(s){typeof r=="string"?r=typeof s=="string"?r+s:[hr(r),s]:r.push(typeof s=="string"?hr(s):s)}for(const s of n){const[a,c]=s;if(i(`
|
|
11
11
|
${JSON.stringify(a)}
|
|
12
|
-
`),typeof c=="string"||c instanceof Uint8Array)i(c);else{let l;try{l=JSON.stringify(c)}catch{l=JSON.stringify(Pe(c))}i(l)}}return typeof r=="string"?r:function(s){const a=s.reduce((f,h)=>f+h.length,0),c=new Uint8Array(a);let l=0;for(const f of s)c.set(f,l),l+=f.length;return c}(r)}function hc(t){const e=typeof t.data=="string"?fr(t.data):t.data;return[me({type:"attachment",length:e.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType}),e]}const pc={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",statsd:"metric_bucket",raw_security:"security"};function Fi(t){return pc[t]}function jo(t){if(!t||!t.sdk)return;const{name:e,version:n}=t.sdk;return{name:e,version:n}}function mc(t,e,n,r){const i=jo(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,f,h){const v=c.sdkProcessingMetadata&&c.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:c.event_id,sent_at:new Date().toISOString(),...l&&{sdk:l},...!!f&&h&&{dsn:gn(h)},...v&&{trace:me({...v})}}}(t,i,r,e);return delete t.sdkProcessingMetadata,jt(a,[[{type:s},t]])}function hr(t,e,n,r=0){return new pe((i,s)=>{const a=t[r];if(e===null||typeof a!="function")i(e);else{const c=a({...e},n);W&&a.id&&c===null&&D.log(`Event processor "${a.id}" dropped event`),Mn(c)?c.then(l=>hr(t,l,n,r+1).then(i)).then(null,s):hr(t,c,n,r+1).then(i).then(null,s)}})}let Ht,Ui,Fn;function gc(t,e){const{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:s}=e;(function(a,c){const{extra:l,tags:f,user:h,contexts:v,level:E,transactionName:k}=c,b=me(l);b&&Object.keys(b).length&&(a.extra={...b,...a.extra});const m=me(f);m&&Object.keys(m).length&&(a.tags={...m,...a.tags});const y=me(h);y&&Object.keys(y).length&&(a.user={...y,...a.user});const w=me(v);w&&Object.keys(w).length&&(a.contexts={...w,...a.contexts}),E&&(a.level=E),k&&a.type!=="transaction"&&(a.transaction=k)})(t,e),r&&function(a,c){a.contexts={trace:sc(c),...a.contexts},a.sdkProcessingMetadata={dynamicSamplingContext:cc(c),...a.sdkProcessingMetadata};const l=Ao(c),f=Jr(l).description;f&&!a.transaction&&a.type==="transaction"&&(a.transaction=f)}(t,r),function(a,c){a.fingerprint=a.fingerprint?Array.isArray(a.fingerprint)?a.fingerprint:[a.fingerprint]:[],c&&(a.fingerprint=a.fingerprint.concat(c)),a.fingerprint&&!a.fingerprint.length&&delete a.fingerprint}(t,n),function(a,c){const l=[...a.breadcrumbs||[],...c];a.breadcrumbs=l.length?l:void 0}(t,i),function(a,c){a.sdkProcessingMetadata={...a.sdkProcessingMetadata,...c}}(t,s)}function Bi(t,e){const{extra:n,tags:r,user:i,contexts:s,level:a,sdkProcessingMetadata:c,breadcrumbs:l,fingerprint:f,eventProcessors:h,attachments:v,propagationContext:E,transactionName:k,span:b}=e;Wt(t,"extra",n),Wt(t,"tags",r),Wt(t,"user",i),Wt(t,"contexts",s),t.sdkProcessingMetadata=On(t.sdkProcessingMetadata,c,2),a&&(t.level=a),k&&(t.transactionName=k),b&&(t.span=b),l.length&&(t.breadcrumbs=[...t.breadcrumbs,...l]),f.length&&(t.fingerprint=[...t.fingerprint,...f]),h.length&&(t.eventProcessors=[...t.eventProcessors,...h]),v.length&&(t.attachments=[...t.attachments,...v]),t.propagationContext={...t.propagationContext,...E}}function Wt(t,e,n){t[e]=On(t[e],n,1)}function vc(t,e,n,r,i,s){const{normalizeDepth:a=3,normalizeMaxBreadth:c=1e3}=t,l={...e,event_id:e.event_id||n.event_id||ge(),timestamp:e.timestamp||Rt()},f=n.integrations||t.integrations.map(b=>b.name);(function(b,m){const{environment:y,release:w,dist:C,maxValueLength:A=250}=m;b.environment=b.environment||y||qr,!b.release&&w&&(b.release=w),!b.dist&&C&&(b.dist=C),b.message&&(b.message=ut(b.message,A));const j=b.exception&&b.exception.values&&b.exception.values[0];j&&j.value&&(j.value=ut(j.value,A));const x=b.request;x&&x.url&&(x.url=ut(x.url,A))})(l,t),function(b,m){m.length>0&&(b.sdk=b.sdk||{},b.sdk.integrations=[...b.sdk.integrations||[],...m])}(l,f),i&&i.emit("applyFrameMetadata",e),e.type===void 0&&function(b,m){const y=function(w){const C=$._sentryDebugIds;if(!C)return{};const A=Object.keys(C);return Fn&&A.length===Ui||(Ui=A.length,Fn=A.reduce((j,x)=>{Ht||(Ht={});const R=Ht[x];if(R)j[R[0]]=R[1];else{const J=w(x);for(let X=J.length-1;X>=0;X--){const Oe=J[X],ot=Oe&&Oe.filename,at=C[x];if(ot&&at){j[ot]=at,Ht[x]=[ot,at];break}}}return j},{})),Fn}(m);try{b.exception.values.forEach(w=>{w.stacktrace.frames.forEach(C=>{y&&C.filename&&(C.debug_id=y[C.filename])})})}catch{}}(l,t.stackParser);const h=function(b,m){if(!m)return b;const y=b?b.clone():new Ue;return y.update(m),y}(r,n.captureContext);n.mechanism&&ht(l,n.mechanism);const v=i?i.getEventProcessors():[],E=hn("globalScope",()=>new Ue).getScopeData();s&&Bi(E,s.getScopeData()),h&&Bi(E,h.getScopeData());const k=[...n.attachments||[],...E.attachments];return k.length&&(n.attachments=k),gc(l,E),hr([...v,...E.eventProcessors],l,n).then(b=>(b&&function(m){const y={};try{m.exception.values.forEach(C=>{C.stacktrace.frames.forEach(A=>{A.debug_id&&(A.abs_path?y[A.abs_path]=A.debug_id:A.filename&&(y[A.filename]=A.debug_id),delete A.debug_id)})})}catch{}if(Object.keys(y).length===0)return;m.debug_meta=m.debug_meta||{},m.debug_meta.images=m.debug_meta.images||[];const w=m.debug_meta.images;Object.entries(y).forEach(([C,A])=>{w.push({type:"sourcemap",code_file:C,debug_id:A})})}(b),typeof a=="number"&&a>0?function(m,y,w){if(!m)return null;const C={...m,...m.breadcrumbs&&{breadcrumbs:m.breadcrumbs.map(A=>({...A,...A.data&&{data:Pe(A.data,y,w)}}))},...m.user&&{user:Pe(m.user,y,w)},...m.contexts&&{contexts:Pe(m.contexts,y,w)},...m.extra&&{extra:Pe(m.extra,y,w)}};return m.contexts&&m.contexts.trace&&C.contexts&&(C.contexts.trace=m.contexts.trace,m.contexts.trace.data&&(C.contexts.trace.data=Pe(m.contexts.trace.data,y,w))),m.spans&&(C.spans=m.spans.map(A=>({...A,...A.data&&{data:Pe(A.data,y,w)}}))),m.contexts&&m.contexts.flags&&C.contexts&&(C.contexts.flags=Pe(m.contexts.flags,3,w)),C}(b,a,c):b))}function Vi(t,e){return st().captureEvent(t,e)}function Ji(t){const e=te(),n=Dt(),r=st(),{release:i,environment:s=qr}=e&&e.getOptions()||{},{userAgent:a}=$.navigator||{},c=Xa({release:i,environment:s,user:r.getUser()||n.getUser(),...a&&{userAgent:a},...t}),l=n.getSession();return l&&l.status==="ok"&&pt(l,{status:"exited"}),Io(),n.setSession(c),r.setSession(c),c}function Io(){const t=Dt(),e=st(),n=e.getSession()||t.getSession();n&&function(r,i){let s={};r.status==="ok"&&(s={status:"exited"}),pt(r,s)}(n),Lo(),t.setSession(),e.setSession()}function Lo(){const t=Dt(),e=st(),n=te(),r=e.getSession()||t.getSession();r&&n&&n.captureSession(r)}function qi(t=!1){t?Io():Lo()}function yc(t,e,n){return e||`${function(r){return`${function(i){const s=i.protocol?`${i.protocol}:`:"",a=i.port?`:${i.port}`:"";return`${s}//${i.host}${a}${i.path?`/${i.path}`:""}/api/`}(r)}${r.projectId}/envelope/`}(t)}?${function(r,i){const s={sentry_version:"7"};return r.publicKey&&(s.sentry_key=r.publicKey),i&&(s.sentry_client=`${i.name}/${i.version}`),new URLSearchParams(s).toString()}(t,n)}`}const $i=[];function zi(t,e){for(const n of e)n&&n.afterAllSetup&&n.afterAllSetup(t)}function Hi(t,e,n){if(n[e.name])W&&D.log(`Integration skipped because it was already installed: ${e.name}`);else{if(n[e.name]=e,$i.indexOf(e.name)===-1&&typeof e.setupOnce=="function"&&(e.setupOnce(),$i.push(e.name)),e.setup&&typeof e.setup=="function"&&e.setup(t),typeof e.preprocessEvent=="function"){const r=e.preprocessEvent.bind(e);t.on("preprocessEvent",(i,s)=>r(i,s,t))}if(typeof e.processEvent=="function"){const r=e.processEvent.bind(e),i=Object.assign((s,a)=>r(s,a,t),{id:e.name});t.addEventProcessor(i)}W&&D.log(`Integration installed: ${e.name}`)}}class be extends Error{constructor(e,n="warn"){super(e),this.message=e,this.logLevel=n}}const Wi="Not capturing exception because it's already been captured.";class bc{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=uc(e.dsn):W&&D.warn("No DSN provided, client will not send events."),this._dsn){const r=yc(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:r})}const n=["enableTracing","tracesSampleRate","tracesSampler"].find(r=>r in e&&e[r]==null);n&&Lt(()=>{console.warn(`[Sentry] Deprecation warning: \`${n}\` is set to undefined, which leads to tracing being enabled. In v9, a value of \`undefined\` will result in tracing being disabled.`)})}captureException(e,n,r){const i=ge();if(Mi(e))return W&&D.log(Wi),i;const s={event_id:i,...n};return this._process(this.eventFromException(e,s).then(a=>this._captureEvent(a,s,r))),s.event_id}captureMessage(e,n,r,i){const s={event_id:ge(),...r},a=Nr(e)?e:String(e),c=or(e)?this.eventFromMessage(a,n,s):this.eventFromException(e,s);return this._process(c.then(l=>this._captureEvent(l,s,i))),s.event_id}captureEvent(e,n,r){const i=ge();if(n&&n.originalException&&Mi(n.originalException))return W&&D.log(Wi),i;const s={event_id:i,...n},a=(e.sdkProcessingMetadata||{}).capturedSpanScope;return this._process(this._captureEvent(e,s,a||r)),s.event_id}captureSession(e){typeof e.release!="string"?W&&D.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),pt(e,{init:!1}))}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.emit("flush"),this._isClientDoneProcessing(e).then(r=>n.flush(e).then(i=>r&&i))):tt(!0)}close(e){return this.flush(e).then(n=>(this.getOptions().enabled=!1,this.emit("close"),n))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){const n=this._integrations[e.name];Hi(this,e,this._integrations),n||zi(this,[e])}sendEvent(e,n={}){this.emit("beforeSendEvent",e,n);let r=mc(e,this._dsn,this._options._metadata,this._options.tunnel);for(const s of n.attachments||[])r=dc(r,hc(s));const i=this.sendEnvelope(r);i&&i.then(s=>this.emit("afterSendEvent",e,s),null)}sendSession(e){const n=function(r,i,s,a){const c=jo(s);return jt({sent_at:new Date().toISOString(),...c&&{sdk:c},...!!a&&i&&{dsn:gn(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=typeof r=="number"?r:1,s=`${e}:${n}`;W&&D.log(`Recording outcome: "${s}"${i>1?` (${i} times)`:""}`),this._outcomes[s]=(this._outcomes[s]||0)+i}}on(e,n){const r=this._hooks[e]=this._hooks[e]||[];return r.push(n),()=>{const i=r.indexOf(n);i>-1&&r.splice(i,1)}}emit(e,...n){const r=this._hooks[e];r&&r.forEach(i=>i(...n))}sendEnvelope(e){return this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport?this._transport.send(e).then(null,n=>(W&&D.error("Error while sending envelope:",n),n)):(W&&D.error("Transport disabled"),tt({}))}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=function(n,r){const i={};return r.forEach(s=>{s&&Hi(n,s,i)}),i}(this,e),zi(this,e)}_updateSessionFromEvent(e,n){let r=n.level==="fatal",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)&&(pt(e,{...r&&{status:"crashed"},errors:e.errors||Number(i||r)}),this.captureSession(e))}_isClientDoneProcessing(e){return new pe(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._transport!==void 0}_prepareEvent(e,n,r=st(),i=Dt()){const s=this.getOptions(),a=Object.keys(this._integrations);return!n.integrations&&a.length>0&&(n.integrations=a),this.emit("preprocessEvent",e,n),e.type||i.setLastEventId(e.event_id||n.event_id),vc(s,e,n,r,this,i).then(c=>{if(c===null)return c;c.contexts={trace:tc(r),...c.contexts};const l=function(f,h){const v=h.getPropagationContext();return v.dsc||Po(v.traceId,f)}(this,r);return c.sdkProcessingMetadata={dynamicSamplingContext:l,...c.sdkProcessingMetadata},c})}_captureEvent(e,n={},r){return this._processEvent(e,n,r).then(i=>i.event_id,i=>{W&&(i instanceof be&&i.logLevel==="log"?D.log(i.message):D.warn(i))})}_processEvent(e,n,r){const i=this.getOptions(),{sampleRate:s}=i,a=Ki(e),c=Gi(e),l=e.type||"error",f=`before send for type \`${l}\``,h=s===void 0?void 0:function(k){if(typeof k=="boolean")return Number(k);const b=typeof k=="string"?parseFloat(k):k;if(!(typeof b!="number"||isNaN(b)||b<0||b>1))return b;W&&D.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(k)} of type ${JSON.stringify(typeof k)}.`)}(s);if(c&&typeof h=="number"&&Math.random()>h)return this.recordDroppedEvent("sample_rate","error",e),mn(new be(`Discarding event because it's not included in the random sample (sampling rate = ${s})`,"log"));const v=l==="replay_event"?"replay":l,E=(e.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this._prepareEvent(e,n,r,E).then(k=>{if(k===null)throw this.recordDroppedEvent("event_processor",v,e),new be("An event processor returned `null`, will not send event.","log");if(n.data&&n.data.__sentry__===!0)return k;const b=function(m,y,w,C){const{beforeSend:A,beforeSendTransaction:j,beforeSendSpan:x}=y;if(Gi(w)&&A)return A(w,C);if(Ki(w)){if(w.spans&&x){const R=[];for(const J of w.spans){const X=x(J);X?R.push(X):(ac(),m.recordDroppedEvent("before_send","span"))}w.spans=R}if(j){if(w.spans){const R=w.spans.length;w.sdkProcessingMetadata={...w.sdkProcessingMetadata,spanCountBeforeProcessing:R}}return j(w,C)}}return w}(this,i,k,n);return function(m,y){const w=`${y} must return \`null\` or a valid event.`;if(Mn(m))return m.then(C=>{if(!ft(C)&&C!==null)throw new be(w);return C},C=>{throw new be(`${y} rejected with ${C}`)});if(!ft(m)&&m!==null)throw new be(w);return m}(b,f)}).then(k=>{if(k===null){if(this.recordDroppedEvent("before_send",v,e),a){const y=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",y)}throw new be(`${f} returned \`null\`, will not send event.`,"log")}const b=r&&r.getSession();if(!a&&b&&this._updateSessionFromEvent(b,k),a){const y=(k.sdkProcessingMetadata&&k.sdkProcessingMetadata.spanCountBeforeProcessing||0)-(k.spans?k.spans.length:0);y>0&&this.recordDroppedEvent("before_send","span",y)}const m=k.transaction_info;if(a&&m&&k.transaction!==e.transaction){const y="custom";k.transaction_info={...m,source:y}}return this.sendEvent(k,n),k}).then(null,k=>{throw k instanceof be?k:(this.captureException(k,{data:{__sentry__:!0},originalException:k}),new be(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
13
|
-
Reason: ${k}`))})}_process(e){this._numProcessing++,e.then(n=>(this._numProcessing--,n),n=>(this._numProcessing--,n))}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.entries(e).map(([n,r])=>{const[i,s]=n.split(":");return{reason:i,category:s,quantity:r}})}_flushOutcomes(){W&&
|
|
14
|
-
Event: ${
|
|
15
|
-
Event: ${
|
|
16
|
-
Event: ${
|
|
17
|
-
Event: ${
|
|
18
|
-
Event: ${
|
|
19
|
-
Url: ${Gt(a)}`),!0):function(l,f){if(!f||!f.length)return!0;const h=Gt(l);return!h||zt(h,f)}(a,c.allowUrls)?!1:(W&&
|
|
20
|
-
Event: ${
|
|
21
|
-
Url: ${Gt(a)}`),!0)}(e,s)?null:e}});function Gt(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 W&&D.error(`Cannot extract url for event ${Ne(t)}`),null}}function Mc(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,f;c&&(s.exception.values=(l=pr(t,e,i,a.originalException,r,s.exception.values,c,0),f=n,l.map(h=>(h.value&&(h.value=ut(h.value,f)),h))))}function pr(t,e,n,r,i,s,a,c){if(s.length>=n+1)return s;let l=[...s];if(Ze(r[i],Error)){Zi(a,c);const f=t(e,r[i]),h=l.length;es(f,i,h,c),l=pr(t,e,n,r[i],i,[f,...l],f,h)}return Array.isArray(r.errors)&&r.errors.forEach((f,h)=>{if(Ze(f,Error)){Zi(a,c);const v=t(e,f),E=l.length;es(v,`errors[${h}]`,E,c),l=pr(t,e,n,f,i,[v,...l],v,E)}}),l}function Zi(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,...t.type==="AggregateError"&&{is_exception_group:!0},exception_id:e}}function es(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 Un(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}}function Oc(){"console"in $&&sr.forEach(function(t){t in $.console&&ue($.console,t,function(e){return pn[t]=e,function(...n){_e("console",{args:n,level:t});const r=pn[t];r&&r.apply($.console,n)}})})}function Ac(t){return t==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(t)?t:"log"}const Pc=()=>{let t;return{name:"Dedupe",processEvent(e){if(e.type)return e;try{if(function(n,r){return r?!!(function(i,s){const a=i.message,c=s.message;return!(!a&&!c||a&&!c||!a&&c||a!==c||!ns(i,s)||!ts(i,s))}(n,r)||function(i,s){const a=rs(s),c=rs(i);return!(!a||!c||a.type!==c.type||a.value!==c.value||!ns(i,s)||!ts(i,s))}(n,r)):!1}(e,t))return W&&D.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return t=e}}};function ts(t,e){let n=wi(t),r=wi(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 ns(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 rs(t){return t.exception&&t.exception.values&&t.exception.values[0]}function is(t){return t===void 0?void 0:t>=400&&t<500?"warning":t>=500?"error":void 0}const Bn=$;function mr(t){return t&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function xc(){if(typeof EdgeRuntime=="string")return!0;if(!function(){if(!("fetch"in Bn))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}())return!1;if(mr(Bn.fetch))return!0;let t=!1;const e=Bn.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=mr(n.contentWindow.fetch)),e.head.removeChild(n)}catch(n){it&&D.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return t}function jc(t,e){const n="fetch";Qe(n,t),Xe(n,()=>function(r,i=!1){i&&!xc()||ue($,"fetch",function(s){return function(...a){const c=new Error,{method:l,url:f}=function(v){if(v.length===0)return{method:"GET",url:""};if(v.length===2){const[k,b]=v;return{url:ss(k),method:gr(b,"method")?String(b.method).toUpperCase():"GET"}}const E=v[0];return{url:ss(E),method:gr(E,"method")?String(E.method).toUpperCase():"GET"}}(a),h={args:a,fetchData:{method:l,url:f},startTimestamp:1e3*Ie(),virtualError:c};return r||_e("fetch",{...h}),s.apply($,a).then(async v=>(r?r(v):_e("fetch",{...h,endTimestamp:1e3*Ie(),response:v}),v),v=>{throw _e("fetch",{...h,endTimestamp:1e3*Ie(),error:v}),Dr(v)&&v.stack===void 0&&(v.stack=c.stack,et(v,"framesToPop",1)),v})}})}(void 0,e))}function gr(t,e){return!!t&&typeof t=="object"&&!!t[e]}function ss(t){return typeof t=="string"?t:t?gr(t,"url")?t.url:t.toString?t.toString():"":""}const Kt=$,Z=$;let vr=0;function os(){return vr>0}function gt(t,e={}){if(!function(r){return typeof r=="function"}(t))return t;try{const r=t.__sentry_wrapped__;if(r)return typeof r=="function"?r:t;if(Ur(t))return t}catch{return t}const n=function(...r){try{const i=r.map(s=>gt(s,e));return t.apply(this,i)}catch(i){throw vr++,setTimeout(()=>{vr--}),function(...s){const a=Vr(Tn());if(s.length===2){const[c,l]=s;return c?a.withSetScope(c,l):a.withScope(l)}a.withScope(s[0])}(s=>{var a;s.addEventProcessor(c=>(e.mechanism&&(cr(c,void 0),ht(c,e.mechanism)),c.extra={...c.extra,arguments:r},c)),a=i,st().captureException(a,void 0)}),i}};try{for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}catch{}Co(n,t),et(t,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get:()=>t.name})}catch{}return n}const An=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function $r(t,e){const n=zr(t,e),r={type:Rc(e),value:Dc(e)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function Ic(t,e,n,r){const i=te(),s=i&&i.getOptions().normalizeDepth,a=function(f){for(const h in f)if(Object.prototype.hasOwnProperty.call(f,h)){const v=f[h];if(v instanceof Error)return v}}(e),c={__serialized__:xo(e,s)};if(a)return{exception:{values:[$r(t,a)]},extra:c};const l={exception:{values:[{type:Cn(e)?e.constructor.name:r?"UnhandledRejection":"Error",value:Nc(e,{isUnhandledRejection:r})}]},extra:c};if(n){const f=zr(t,n);f.length&&(l.exception.values[0].stacktrace={frames:f})}return l}function Vn(t,e){return{exception:{values:[$r(t,e)]}}}function zr(t,e){const n=e.stacktrace||e.stack||"",r=function(s){return s&&Lc.test(s.message)?1:0}(e),i=function(s){return typeof s.framesToPop=="number"?s.framesToPop:0}(e);try{return t(n,r,i)}catch{}return[]}const Lc=/Minified React error #\d+;/i;function Ro(t){return typeof WebAssembly<"u"&&WebAssembly.Exception!==void 0&&t instanceof WebAssembly.Exception}function Rc(t){const e=t&&t.name;return!e&&Ro(t)?t.message&&Array.isArray(t.message)&&t.message.length==2?t.message[0]:"WebAssembly.Exception":e}function Dc(t){const e=t&&t.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:Ro(t)&&Array.isArray(t.message)&&t.message.length==2?t.message[1]:e:"No error message"}function yr(t,e,n,r,i){let s;if(ko(e)&&e.error)return Vn(t,e.error);if(ki(e)||vt(e,"DOMException")){const a=e;if("stack"in e)s=Vn(t,e);else{const c=a.name||(ki(a)?"DOMError":"DOMException"),l=a.message?`${c}: ${a.message}`:c;s=br(t,l,n,r),cr(s,l)}return"code"in a&&(s.tags={...s.tags,"DOMException.code":`${a.code}`}),s}return Dr(e)?Vn(t,e):ft(e)||Cn(e)?(s=Ic(t,e,n,i),ht(s,{synthetic:!0}),s):(s=br(t,e,n,r),cr(s,`${e}`),ht(s,{synthetic:!0}),s)}function br(t,e,n,r){const i={};if(r&&n){const s=zr(t,n);s.length&&(i.exception={values:[{value:e,stacktrace:{frames:s}}]}),ht(i,{synthetic:!0})}if(Nr(e)){const{__sentry_template_string__:s,__sentry_template_values__:a}=e;return i.logentry={message:s,params:a},i}return i.message=e,i}function Nc(t,{isUnhandledRejection:e}){const n=function(i,s=40){const a=Object.keys(Mo(i));a.sort();const c=a[0];if(!c)return"[object has no keys]";if(c.length>=s)return ut(c,s);for(let l=a.length;l>0;l--){const f=a.slice(0,l).join(", ");if(!(f.length>s))return l===a.length?f:ut(f,s)}return""}(t),r=e?"promise rejection":"exception";return ko(t)?`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``:Cn(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}`}class Fc extends bc{constructor(e){const n={parentSpanIsAlwaysRootSpan:!0,...e};(function(r,i,s=[i],a="npm"){const c=r._metadata||{};c.sdk||(c.sdk={name:`sentry.javascript.${i}`,packages:s.map(l=>({name:`${a}:@sentry/${l}`,version:Ke})),version:Ke}),r._metadata=c})(n,"browser",["browser"],Z.SENTRY_SDK_SOURCE||"npm"),super(n),n.sendClientReports&&Z.document&&Z.document.addEventListener("visibilitychange",()=>{Z.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,n){return function(r,i,s,a){const c=yr(r,i,s&&s.syntheticException||void 0,a);return ht(c),c.level="error",s&&s.event_id&&(c.event_id=s.event_id),tt(c)}(this._options.stackParser,e,n,this._options.attachStacktrace)}eventFromMessage(e,n="info",r){return function(i,s,a="info",c,l){const f=br(i,s,c&&c.syntheticException||void 0,l);return f.level=a,c&&c.event_id&&(f.event_id=c.event_id),tt(f)}(this._options.stackParser,e,n,r,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled())return void(An&&D.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:gn(a)}};return jt(c,[function(f){return[{type:"user_report"},f]}(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)}}const Uc=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,oe=$;let as,Jn,qn,Qt;function Bc(){if(!oe.document)return;const t=_e.bind(null,"dom"),e=cs(t,!0);oe.document.addEventListener("click",e,!1),oe.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(n=>{const r=oe[n],i=r&&r.prototype;i&&i.hasOwnProperty&&i.hasOwnProperty("addEventListener")&&(ue(i,"addEventListener",function(s){return function(a,c,l){if(a==="click"||a=="keypress")try{const f=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},h=f[a]=f[a]||{refCount:0};if(!h.handler){const v=cs(t);h.handler=v,s.call(this,a,v,l)}h.refCount++}catch{}return s.call(this,a,c,l)}}),ue(i,"removeEventListener",function(s){return function(a,c,l){if(a==="click"||a=="keypress")try{const f=this.__sentry_instrumentation_handlers__||{},h=f[a];h&&(h.refCount--,h.refCount<=0&&(s.call(this,a,h.handler,l),h.handler=void 0,delete f[a]),Object.keys(f).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return s.call(this,a,c,l)}}))})}function cs(t,e=!1){return n=>{if(!n||n._sentryCaptured)return;const r=function(s){try{return s.target}catch{return null}}(n);if(function(s,a){return s==="keypress"&&(!a||!a.tagName||a.tagName!=="INPUT"&&a.tagName!=="TEXTAREA"&&!a.isContentEditable)}(n.type,r))return;et(n,"_sentryCaptured",!0),r&&!r._sentryId&&et(r,"_sentryId",ge());const i=n.type==="keypress"?"input":n.type;(function(s){if(s.type!==Jn)return!1;try{if(!s.target||s.target._sentryId!==qn)return!1}catch{}return!0})(n)||(t({event:n,name:i,global:e}),Jn=n.type,qn=r?r._sentryId:void 0),clearTimeout(as),as=oe.setTimeout(()=>{qn=void 0,Jn=void 0},1e3)}}function Do(t){const e="history";Qe(e,t),Xe(e,Vc)}function Vc(){if(!function(){const n=Kt.chrome,r=n&&n.app&&n.app.runtime,i="history"in Kt&&!!Kt.history.pushState&&!!Kt.history.replaceState;return!r&&i}())return;const t=oe.onpopstate;function e(n){return function(...r){const i=r.length>2?r[2]:void 0;if(i){const s=Qt,a=String(i);Qt=a,_e("history",{from:s,to:a})}return n.apply(this,r)}}oe.onpopstate=function(...n){const r=oe.location.href,i=Qt;if(Qt=r,_e("history",{from:i,to:r}),t)try{return t.apply(this,n)}catch{}},ue(oe.history,"pushState",e),ue(oe.history,"replaceState",e)}const sn={};function ls(t){sn[t]=void 0}const Mt="__sentry_xhr_v3__";function Jc(){if(!oe.XMLHttpRequest)return;const t=XMLHttpRequest.prototype;t.open=new Proxy(t.open,{apply(e,n,r){const i=new Error,s=1e3*Ie(),a=xe(r[0])?r[0].toUpperCase():void 0,c=function(f){if(xe(f))return f;try{return f.toString()}catch{}}(r[1]);if(!a||!c)return e.apply(n,r);n[Mt]={method:a,url:c,request_headers:{}},a==="POST"&&c.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const l=()=>{const f=n[Mt];if(f&&n.readyState===4){try{f.status_code=n.status}catch{}_e("xhr",{endTimestamp:1e3*Ie(),startTimestamp:s,xhr:n,virtualError:i})}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply:(f,h,v)=>(l(),f.apply(h,v))}):n.addEventListener("readystatechange",l),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(f,h,v){const[E,k]=v,b=h[Mt];return b&&xe(E)&&xe(k)&&(b.request_headers[E.toLowerCase()]=k),f.apply(h,v)}}),e.apply(n,r)}}),t.send=new Proxy(t.send,{apply(e,n,r){const i=n[Mt];return i?(r[0]!==void 0&&(i.body=r[0]),_e("xhr",{startTimestamp:1e3*Ie(),xhr:n}),e.apply(n,r)):e.apply(n,r)}})}function qc(t,e=function(n){const r=sn[n];if(r)return r;let i=oe[n];if(mr(i))return sn[n]=i.bind(oe);const s=oe.document;if(s&&typeof s.createElement=="function")try{const a=s.createElement("iframe");a.hidden=!0,s.head.appendChild(a);const c=a.contentWindow;c&&c[n]&&(i=c[n]),s.head.removeChild(a)}catch(a){Uc&&D.warn(`Could not create sandbox iframe for ${n} check, bailing to window.${n}: `,a)}return i&&(sn[n]=i.bind(oe))}("fetch")){let n=0,r=0;return Sc(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};if(!e)return ls("fetch"),mn("No fetch implementation available");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 ls("fetch"),n-=s,r--,mn(c)}})}function $n(t,e,n,r){const i={filename:t,function:e==="<anonymous>"?We:e,in_app:!0};return n!==void 0&&(i.lineno=n),r!==void 0&&(i.colno=r),i}const $c=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,zc=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Hc=/\((\S*)(?::(\d+))(?::(\d+))\)/,Wc=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Gc=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Kc=function(...t){const e=t.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,i=0)=>{const s=[],a=n.split(`
|
|
22
|
-
`);for(let c=r;c<a.length;c++){const l=a[c];if(l.length>1024)continue;const f=yi.test(l)?l.replace(yi,"$1"):l;if(!f.match(/\S*Error: /)){for(const h of e){const v=h(f);if(v){s.push(v);break}}if(s.length>=50+i)break}}return function(c){if(!c.length)return[];const l=Array.from(c);return/sentryWrapped/.test($t(l).function||"")&&l.pop(),l.reverse(),bi.test($t(l).function||"")&&(l.pop(),bi.test($t(l).function||"")&&l.pop()),l.slice(0,50).map(f=>({...f,filename:f.filename||$t(l).filename,function:f.function||We}))}(s.slice(i))}}([30,t=>{const e=$c.exec(t);if(e){const[,r,i,s]=e;return $n(r,We,+i,+s)}const n=zc.exec(t);if(n){if(n[2]&&n[2].indexOf("eval")===0){const s=Hc.exec(n[2]);s&&(n[2]=s[1],n[3]=s[2],n[4]=s[3])}const[r,i]=us(n[1]||We,n[2]);return $n(i,r,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],[50,t=>{const e=Wc.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){const i=Gc.exec(e[3]);i&&(e[1]=e[1]||"eval",e[3]=i[1],e[4]=i[2],e[5]="")}let n=e[3],r=e[1]||We;return[r,n]=us(r,n),$n(n,r,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}}]),us=(t,e)=>{const n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:We,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},ds=1024,Qc=(t={})=>{const e={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...t};return{name:"Breadcrumbs",setup(n){var r;e.console&&function(i){const s="console";Qe(s,i),Xe(s,Oc)}(function(i){return function(s){if(te()!==i)return;const a={category:"console",data:{arguments:s.args,logger:"console"},level:Ac(s.level),message:Ei(s.args," ")};if(s.level==="assert"){if(s.args[0]!==!1)return;a.message=`Assertion failed: ${Ei(s.args.slice(1)," ")||"console.assert"}`,a.data.arguments=s.args.slice(1)}Je(a,{input:s.args,level:s.level})}}(n)),e.dom&&(r=function(i,s){return function(a){if(te()!==i)return;let c,l,f=typeof s=="object"?s.serializeAttribute:void 0,h=typeof s=="object"&&typeof s.maxStringLength=="number"?s.maxStringLength:void 0;h&&h>ds&&(An&&D.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${h} was configured. Sentry will use 1024 instead.`),h=ds),typeof f=="string"&&(f=[f]);try{const E=a.event,k=function(b){return!!b&&!!b.target}(E)?E.target:E;c=To(k,{keyAttrs:f,maxStringLength:h}),l=function(b){if(!Fr.HTMLElement)return null;let m=b;for(let y=0;y<5;y++){if(!m)return null;if(m instanceof HTMLElement){if(m.dataset.sentryComponent)return m.dataset.sentryComponent;if(m.dataset.sentryElement)return m.dataset.sentryElement}m=m.parentNode}return null}(k)}catch{c="<unknown>"}if(c.length===0)return;const v={category:`ui.${a.name}`,message:c};l&&(v.data={"ui.component_name":l}),Je(v,{event:a.event,name:a.name,global:a.global})}}(n,e.dom),Qe("dom",r),Xe("dom",Bc)),e.xhr&&function(i){Qe("xhr",i),Xe("xhr",Jc)}(function(i){return function(s){if(te()!==i)return;const{startTimestamp:a,endTimestamp:c}=s,l=s.xhr[Mt];if(!a||!c||!l)return;const{method:f,url:h,status_code:v,body:E}=l,k={method:f,url:h,status_code:v},b={xhr:s.xhr,input:E,startTimestamp:a,endTimestamp:c};Je({category:"xhr",data:k,type:"http",level:is(v)},b)}}(n)),e.fetch&&jc(function(i){return function(s){if(te()!==i)return;const{startTimestamp:a,endTimestamp:c}=s;if(c&&(!s.fetchData.url.match(/sentry_key/)||s.fetchData.method!=="POST"))if(s.error)Je({category:"fetch",data:s.fetchData,level:"error",type:"http"},{data:s.error,input:s.args,startTimestamp:a,endTimestamp:c});else{const l=s.response,f={...s.fetchData,status_code:l&&l.status},h={input:s.args,response:l,startTimestamp:a,endTimestamp:c};Je({category:"fetch",data:f,type:"http",level:is(f.status_code)},h)}}}(n)),e.history&&Do(function(i){return function(s){if(te()!==i)return;let a=s.from,c=s.to;const l=Un(Z.location.href);let f=a?Un(a):void 0;const h=Un(c);f&&f.path||(f=l),l.protocol===h.protocol&&l.host===h.host&&(c=h.relative),l.protocol===f.protocol&&l.host===f.host&&(a=f.relative),Je({category:"navigation",data:{from:a,to:c}})}}(n)),e.sentry&&n.on("beforeSendEvent",function(i){return function(s){te()===i&&Je({category:"sentry."+(s.type==="transaction"?"transaction":"event"),event_id:s.event_id,level:s.level,message:Ne(s)},{event:s})}}(n))}}},Xc=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],Yc=(t={})=>{const e={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...t};return{name:"BrowserApiErrors",setupOnce(){e.setTimeout&&ue(Z,"setTimeout",fs),e.setInterval&&ue(Z,"setInterval",fs),e.requestAnimationFrame&&ue(Z,"requestAnimationFrame",Zc),e.XMLHttpRequest&&"XMLHttpRequest"in Z&&ue(XMLHttpRequest.prototype,"send",el);const n=e.eventTarget;n&&(Array.isArray(n)?n:Xc).forEach(tl)}}};function fs(t){return function(...e){const n=e[0];return e[0]=gt(n,{mechanism:{data:{function:Fe(t)},handled:!1,type:"instrument"}}),t.apply(this,e)}}function Zc(t){return function(e){return t.apply(this,[gt(e,{mechanism:{data:{function:"requestAnimationFrame",handler:Fe(t)},handled:!1,type:"instrument"}})])}}function el(t){return function(...e){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(r=>{r in n&&typeof n[r]=="function"&&ue(n,r,function(i){const s={mechanism:{data:{function:r,handler:Fe(i)},handled:!1,type:"instrument"}},a=Ur(i);return a&&(s.mechanism.data.handler=Fe(a)),gt(i,s)})}),t.apply(this,e)}}function tl(t){const e=Z[t],n=e&&e.prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(ue(n,"addEventListener",function(r){return function(i,s,a){try{typeof s.handleEvent=="function"&&(s.handleEvent=gt(s.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Fe(s),target:t},handled:!1,type:"instrument"}}))}catch{}return r.apply(this,[i,gt(s,{mechanism:{data:{function:"addEventListener",handler:Fe(s),target:t},handled:!1,type:"instrument"}}),a])}}),ue(n,"removeEventListener",function(r){return function(i,s,a){try{const c=s.__sentry_wrapped__;c&&r.call(this,i,c,a)}catch{}return r.call(this,i,s,a)}}))}const nl=()=>({name:"BrowserSession",setupOnce(){Z.document!==void 0?(Ji({ignoreDuration:!0}),qi(),Do(({from:t,to:e})=>{t!==void 0&&t!==e&&(Ji({ignoreDuration:!0}),qi())})):An&&D.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.")}}),rl=(t={})=>{const e={onerror:!0,onunhandledrejection:!0,...t};return{name:"GlobalHandlers",setupOnce(){Error.stackTraceLimit=50},setup(n){e.onerror&&(function(r){(function(i){const s="error";Qe(s,i),Xe(s,Wa)})(i=>{const{stackParser:s,attachStacktrace:a}=ps();if(te()!==r||os())return;const{msg:c,url:l,line:f,column:h,error:v}=i,E=function(k,b,m,y){const w=k.exception=k.exception||{},C=w.values=w.values||[],A=C[0]=C[0]||{},j=A.stacktrace=A.stacktrace||{},x=j.frames=j.frames||[],R=y,J=m,X=xe(b)&&b.length>0?b:function(){try{return Fr.document.location.href}catch{return""}}();return x.length===0&&x.push({colno:R,filename:X,function:We,in_app:!0,lineno:J}),k}(yr(s,v||c,void 0,a,!1),l,f,h);E.level="error",Vi(E,{originalException:v,mechanism:{handled:!1,type:"onerror"}})})}(n),hs("onerror")),e.onunhandledrejection&&(function(r){(function(i){const s="unhandledrejection";Qe(s,i),Xe(s,Ga)})(i=>{const{stackParser:s,attachStacktrace:a}=ps();if(te()!==r||os())return;const c=function(f){if(or(f))return f;try{if("reason"in f)return f.reason;if("detail"in f&&"reason"in f.detail)return f.detail.reason}catch{}return f}(i),l=or(c)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(c)}`}]}}:yr(s,c,void 0,a,!0);l.level="error",Vi(l,{originalException:c,mechanism:{handled:!1,type:"onunhandledrejection"}})})}(n),hs("onunhandledrejection"))}}};function hs(t){An&&D.log(`Global Handler attached: ${t}`)}function ps(){const t=te();return t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}const il=()=>({name:"HttpContext",preprocessEvent(t){if(!Z.navigator&&!Z.location&&!Z.document)return;const e=t.request&&t.request.url||Z.location&&Z.location.href,{referrer:n}=Z.document||{},{userAgent:r}=Z.navigator||{},i={...t.request&&t.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},s={...t.request,...e&&{url:e},headers:i};t.request=s}}),sl=(t={})=>{const e=t.limit||5,n=t.key||"cause";return{name:"LinkedErrors",preprocessEvent(r,i,s){const a=s.getOptions();Mc($r,a.stackParser,a.maxValueLength,n,e,r,i)}}};var ms="new",gs="loading",vs="loaded",_r="joining-meeting",He="joined-meeting",qe="left-meeting",Le="error",ol="playable",zn="unknown",al="full",cl="base",ys="no-room",ll="end-of-life",ul="connection-error",dl="iframe-ready-for-launch-config",fl="iframe-launch-config",hl="theme-updated",pl="loading",ml="load-attempt-failed",bs="loaded",gl="started-camera",vl="camera-error",yl="joining-meeting",bl="joined-meeting",_l="left-meeting",wl="participant-joined",Sl="participant-updated",kl="participant-left",El="participant-counts-updated",Tl="access-state-updated",Cl="meeting-session-summary-updated",Ml="meeting-session-state-updated",Ol="waiting-participant-added",Al="waiting-participant-updated",Pl="waiting-participant-removed",xl="track-started",jl="track-stopped",Il="transcription-started",Ll="transcription-stopped",Rl="transcription-error",_s="recording-started",ws="recording-stopped",Dl="recording-stats",Nl="recording-error",Fl="recording-upload-completed",Ul="recording-data",Bl="app-message",Vl="transcription-message",Jl="remote-media-player-started",ql="remote-media-player-updated",$l="remote-media-player-stopped",zl="local-screen-share-started",Hl="local-screen-share-stopped",Wl="local-screen-share-canceled",Gl="active-speaker-change",Kl="active-speaker-mode-change",Ql="network-quality-change",Xl="network-connection",Yl="cpu-load-change",Zl="face-counts-updated",Xt="fullscreen",Yt="exited-fullscreen",eu="live-streaming-started",tu="live-streaming-updated",nu="live-streaming-stopped",ru="live-streaming-error",iu="lang-updated",su="receive-settings-updated",Ss="input-settings-updated",ks="nonfatal-error",Es="error",Hn=4096,Ts=102400,Wn="iframe-call-message",Cs="local-screen-start",Ms="daily-method-update-live-streaming-endpoints",Zt="transmit-log",je="daily-custom-track",on={NONE:"none",BGBLUR:"background-blur",BGIMAGE:"background-image",FACE_DETECTION:"face-detection"},No={NONE:"none",NOISE_CANCELLATION:"noise-cancellation"},wr={PLAY:"play",PAUSE:"pause"},Gn=["jpg","png","jpeg"],ou="add-endpoints",au="remove-endpoints",Os="sip-call-transfer";function ve(){return!V()&&typeof window<"u"&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:""}function V(){return typeof navigator<"u"&&navigator.product&&navigator.product==="ReactNative"}function Fo(){return navigator&&navigator.mediaDevices&&navigator.mediaDevices.getUserMedia}function cu(){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}(nt(),vn())||V())}function As(){if(V()||!document)return!1;var t=document.createElement("iframe");return!!t.requestFullscreen||!!t.webkitRequestFullscreen}var Sr="none",lu="software",uu="hardware",du=function(){try{var t,e=document.createElement("canvas"),n=!1;(t=e.getContext("webgl2",{failIfMajorPerformanceCaveat:!0}))||(n=!0,t=e.getContext("webgl2"));var r=t!=null;return e.remove(),r?n?lu:uu:Sr}catch{return Sr}}();function Uo(){var t=arguments.length>0&&arguments[0]!==void 0&&arguments[0];return!V()&&du!==Sr&&(t?function(){return xs()?!1:["Chrome","Firefox"].includes(nt())}():function(){if(xs())return!1;var e=nt();if(e==="Safari"){var n=Wr();if(n.major<15||n.major===15&&n.minor<4)return!1}return e==="Chrome"?Hr().major>=77:e==="Firefox"?Gr().major>=97:["Chrome","Firefox","Safari"].includes(e)}())}function Bo(){if(V()||Vo()||typeof AudioWorkletNode>"u")return!1;switch(nt()){case"Chrome":case"Firefox":return!0;case"Safari":var t=vn();return t.major>17||t.major===17&&t.minor>=4}return!1}function Ps(){return Fo()&&!function(){var t,e=nt();if(!ve())return!0;switch(e){case"Chrome":return(t=Hr()).major&&t.major>0&&t.major<75;case"Firefox":return(t=Gr()).major<91;case"Safari":return(t=Wr()).major<13||t.major===13&&t.minor<1;default:return!0}}()}function Vo(){return ve().match(/Linux; Android/)}function xs(){var t,e=ve(),n=e.match(/Mac/)&&(!V()&&typeof window<"u"&&(t=window)!==null&&t!==void 0&&(t=t.navigator)!==null&&t!==void 0&&t.maxTouchPoints?window.navigator.maxTouchPoints:0)>=5;return!!(e.match(/Mobi/)||e.match(/Android/)||n)||!!ve().match(/DailyAnd\//)||void 0}function nt(){if(typeof window<"u"){var t=ve();return Jo()?"Safari":t.indexOf("Edge")>-1?"Edge":t.match(/Chrome\//)?"Chrome":t.indexOf("Safari")>-1||qo()?"Safari":t.indexOf("Firefox")>-1?"Firefox":t.indexOf("MSIE")>-1||t.indexOf(".NET")>-1?"IE":"Unknown Browser"}}function vn(){switch(nt()){case"Chrome":return Hr();case"Safari":return Wr();case"Firefox":return Gr();case"Edge":return function(){var t=0,e=0;if(typeof window<"u"){var n=ve().match(/Edge\/(\d+).(\d+)/);if(n)try{t=parseInt(n[1]),e=parseInt(n[2])}catch{}}return{major:t,minor:e}}()}}function Hr(){var t=0,e=0,n=0,r=0,i=!1;if(typeof window<"u"){var s=ve(),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 Jo(){return!!ve().match(/iPad|iPhone|iPod/i)&&Fo()}function qo(){return ve().indexOf("AppleWebKit/605.1.15")>-1}function Wr(){var t=0,e=0,n=0;if(typeof window<"u"){var r=ve().match(/Version\/(\d+).(\d+)(.(\d+))?/);if(r)try{t=parseInt(r[1]),e=parseInt(r[2]),n=parseInt(r[4])}catch{}else(Jo()||qo())&&(t=14,e=0,n=3)}return{major:t,minor:e,point:n}}function Gr(){var t=0,e=0;if(typeof window<"u"){var n=ve().match(/Firefox\/(\d+).(\d+)/);if(n)try{t=parseInt(n[1]),e=parseInt(n[2])}catch{}}return{major:t,minor:e}}var $o=function(){return fe(function t(){de(this,t)},[{key:"addListenerForMessagesFromCallMachine",value:function(t,e,n){Et()}},{key:"addListenerForMessagesFromDailyJs",value:function(t,e,n){Et()}},{key:"sendMessageToCallMachine",value:function(t,e,n,r){Et()}},{key:"sendMessageToDailyJs",value:function(t,e){Et()}},{key:"removeListener",value:function(t){Et()}}])}();function js(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 Kn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?js(Object(n),!0).forEach(function(r){Me(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):js(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function zo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(zo=function(){return!!t})()}var fu=function(){function t(){var e,n,r,i;return de(this,t),n=this,r=we(r=t),(e=Sn(n,zo()?Reflect.construct(r,[],we(n).constructor):r.apply(n,i)))._wrappedListeners={},e._messageCallbacks={},e}return kn(t,$o),fe(t,[{key:"addListenerForMessagesFromCallMachine",value:function(e,n,r){var i=this,s=function(a){if(a.data&&a.data.what==="iframe-call-message"&&(!a.data.callClientId||a.data.callClientId===n)&&(!a.data.from||a.data.from!=="module")){var c=Kn({},a.data);if(delete c.from,c.callbackStamp&&i._messageCallbacks[c.callbackStamp]){var l=c.callbackStamp;i._messageCallbacks[l].call(r,c),delete i._messageCallbacks[l]}delete c.what,delete c.callbackStamp,e.call(r,c)}};this._wrappedListeners[e]=s,window.addEventListener("message",s)}},{key:"addListenerForMessagesFromDailyJs",value:function(e,n,r){var i=function(s){var a;if(!(!s.data||s.data.what!==Wn||!s.data.action||s.data.from&&s.data.from!=="module"||s.data.callClientId&&n&&s.data.callClientId!==n||s!=null&&(a=s.data)!==null&&a!==void 0&&a.callFrameId)){var c=s.data;e.call(r,c)}};this._wrappedListeners[e]=i,window.addEventListener("message",i)}},{key:"sendMessageToCallMachine",value:function(e,n,r,i){if(!r)throw new Error("undefined callClientId. Are you trying to use a DailyCall instance previously destroyed?");var s=Kn({},e);if(s.what=Wn,s.from="module",s.callClientId=r,n){var a=En();this._messageCallbacks[a]=n,s.callbackStamp=a}var c=i?i.contentWindow:window,l=this._callMachineTargetOrigin(i);l&&c.postMessage(s,l)}},{key:"sendMessageToDailyJs",value:function(e,n){e.what=Wn,e.callClientId=n,e.from="embedded",window.postMessage(e,this._targetOriginFromWindowLocation())}},{key:"removeListener",value:function(e){var n=this._wrappedListeners[e];n&&(window.removeEventListener("message",n),delete this._wrappedListeners[e])}},{key:"forwardPackagedMessageToCallMachine",value:function(e,n,r){var i=Kn({},e);i.callClientId=r;var s=n?n.contentWindow:window,a=this._callMachineTargetOrigin(n);a&&s.postMessage(i,a)}},{key:"addListenerForPackagedMessagesFromCallMachine",value:function(e,n){var r=function(i){if(i.data&&i.data.what==="iframe-call-message"&&(!i.data.callClientId||i.data.callClientId===n)&&(!i.data.from||i.data.from!=="module")){var s=i.data;e(s)}};return this._wrappedListeners[e]=r,window.addEventListener("message",r),e}},{key:"removeListenerForPackagedMessagesFromCallMachine",value:function(e){var n=this._wrappedListeners[e];n&&(window.removeEventListener("message",n),delete this._wrappedListeners[e])}},{key:"_callMachineTargetOrigin",value:function(e){return e?e.src?new URL(e.src).origin:void 0:this._targetOriginFromWindowLocation()}},{key:"_targetOriginFromWindowLocation",value:function(){return window.location.protocol==="file:"?"*":window.location.origin}}])}();function Is(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 Ho(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ho=function(){return!!t})()}var hu=function(){function t(){var e,n,r,i;return de(this,t),n=this,r=we(r=t),e=Sn(n,Ho()?Reflect.construct(r,[],we(n).constructor):r.apply(n,i)),global.callMachineToDailyJsEmitter=global.callMachineToDailyJsEmitter||new ir.EventEmitter,global.dailyJsToCallMachineEmitter=global.dailyJsToCallMachineEmitter||new ir.EventEmitter,e._wrappedListeners={},e._messageCallbacks={},e}return kn(t,$o),fe(t,[{key:"addListenerForMessagesFromCallMachine",value:function(e,n,r){this._addListener(e,global.callMachineToDailyJsEmitter,n,r,"received call machine message")}},{key:"addListenerForMessagesFromDailyJs",value:function(e,n,r){this._addListener(e,global.dailyJsToCallMachineEmitter,n,r,"received daily-js message")}},{key:"sendMessageToCallMachine",value:function(e,n,r){this._sendMessage(e,global.dailyJsToCallMachineEmitter,r,n,"sending message to call machine")}},{key:"sendMessageToDailyJs",value:function(e,n){this._sendMessage(e,global.callMachineToDailyJsEmitter,n,null,"sending message to daily-js")}},{key:"removeListener",value:function(e){var n=this._wrappedListeners[e];n&&(global.callMachineToDailyJsEmitter.removeListener("message",n),global.dailyJsToCallMachineEmitter.removeListener("message",n),delete this._wrappedListeners[e])}},{key:"_addListener",value:function(e,n,r,i,s){var a=this,c=function(l){if(l.callClientId===r){if(l.callbackStamp&&a._messageCallbacks[l.callbackStamp]){var f=l.callbackStamp;a._messageCallbacks[f].call(i,l),delete a._messageCallbacks[f]}e.call(i,l)}};this._wrappedListeners[e]=c,n.addListener("message",c)}},{key:"_sendMessage",value:function(e,n,r,i,s){var a=function(l){for(var f=1;f<arguments.length;f++){var h=arguments[f]!=null?arguments[f]:{};f%2?Is(Object(h),!0).forEach(function(v){Me(l,v,h[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(h)):Is(Object(h)).forEach(function(v){Object.defineProperty(l,v,Object.getOwnPropertyDescriptor(h,v))})}return l}({},e);if(a.callClientId=r,i){var c=En();this._messageCallbacks[c]=i,a.callbackStamp=c}n.emit("message",a)}}])}(),kr="replace",Er="shallow-merge",Ls=[kr,Er],pu=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.data,r=e.mergeStrategy,i=r===void 0?kr:r;de(this,t),t._validateMergeStrategy(i),t._validateData(n,i),this.mergeStrategy=i,this.data=n}return fe(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===Er}},{key:"_validateMergeStrategy",value:function(e){if(!Ls.includes(e))throw Error("Unrecognized mergeStrategy provided. Options are: [".concat(Ls,"]"))}},{key:"_validateData",value:function(e,n){if(!function(c){if(c==null||q(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===kr){var i=JSON.parse(r);se(i,e)||console.warn("The meeting session data provided will be modified when serialized.",i,e)}else if(n===Er){for(var s in e)if(Object.hasOwnProperty.call(e,s)&&e[s]!==void 0){var a=JSON.parse(JSON.stringify(e[s]));se(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>Ts)throw Error("Meeting session data is too large (".concat(r.length," characters). Maximum size suppported is ").concat(Ts,"."))}}])}();function Wo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Wo=function(){return!!t})()}function Tr(t){var e=typeof Map=="function"?new Map:void 0;return Tr=function(n){if(n===null||!function(i){try{return Function.toString.call(i).indexOf("[native code]")!==-1}catch{return typeof i=="function"}}(n))return n;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,r)}function r(){return function(i,s,a){if(Wo())return Reflect.construct.apply(null,arguments);var c=[null];c.push.apply(c,s);var l=new(i.bind.apply(i,c));return a&&xt(l,a.prototype),l}(n,arguments,we(this).constructor)}return r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),xt(r,n)},Tr(t)}function Go(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Go=function(){return!!t})()}function Rs(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 mu=function(){return fe(function t(e){de(this,t),this._currentLoad=null,this._callClientId=e},[{key:"load",value:function(){var t,e=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;if(this.loaded)return window._daily.instances[this._callClientId].callMachine.reset(),void r(!0);t=this._callClientId,window._daily.pendings.push(t),this._currentLoad&&this._currentLoad.cancel(),this._currentLoad=new gu(n,function(){r(!1)},function(s,a){a||Rs(e._callClientId),i(s,a)}),this._currentLoad.start()}},{key:"cancel",value:function(){this._currentLoad&&this._currentLoad.cancel(),Rs(this._callClientId)}},{key:"loaded",get:function(){return this._currentLoad&&this._currentLoad.succeeded}}])}(),gu=function(){return fe(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;de(this,t),this._attemptsRemaining=3,this._currentAttempt=null,this._dailyConfig=e,this._successCallback=n,this._failureCallback=r},[{key:"start",value:function(){var t=this;if(!this._currentAttempt){var e=function(n){t._currentAttempt.cancelled||(t._attemptsRemaining--,t._failureCallback(n,t._attemptsRemaining>0),t._attemptsRemaining<=0||setTimeout(function(){t._currentAttempt.cancelled||(t._currentAttempt=new Ds(t._dailyConfig,t._successCallback,e),t._currentAttempt.start())},3e3))};this._currentAttempt=new Ds(this._dailyConfig,this._successCallback,e),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}}])}(),Qn=function(){function t(){return de(this,t),e=this,r=arguments,n=we(n=t),Sn(e,Go()?Reflect.construct(n,r||[],we(e).constructor):n.apply(e,r));var e,n,r}return kn(t,Tr(Error)),fe(t)}(),yn=2e4,Ds=function(){return fe(function e(n,r,i){de(this,e),this._loadAttemptImpl=V()||!n.avoidEval?new vu(n,r,i):new yu(n,r,i)},[{key:"start",value:(t=L(function*(){return this._loadAttemptImpl.start()}),function(){return t.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}}]);var t}(),vu=function(){return fe(function i(s,a,c){de(this,i),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},[{key:"start",value:(r=L(function*(){var i=dn(this._dailyConfig);!(yield this._tryLoadFromIOSCache(i))&&this._loadFromNetwork(i)}),function(){return r.apply(this,arguments)})},{key:"cancel",value:function(){clearTimeout(this._networkTimeout),this.cancelled=!0}},{key:"_tryLoadFromIOSCache",value:(n=L(function*(i){if(!this._iosCache)return!1;try{var s=yield this._iosCache.get(i);return!!this.cancelled||!!s&&(s.code?(Function('"use strict";'+s.code)(),this.succeeded=!0,this._successCallback(),!0):(this._refetchHeaders=s.refetchHeaders,!1))}catch{return!1}}),function(i){return n.apply(this,arguments)})},{key:"_loadFromNetwork",value:(e=L(function*(i){var s=this;this._networkTimeout=setTimeout(function(){s._networkTimedOut=!0,s._failureCallback({msg:"Timed out (>".concat(yn," ms) when loading call object bundle ").concat(i),type:"timeout"})},yn);try{var a=this._refetchHeaders?{headers:this._refetchHeaders}:{},c=yield fetch(i,a);if(clearTimeout(this._networkTimeout),this.cancelled||this._networkTimedOut)throw new Qn;var l=yield this._getBundleCodeFromResponse(i,c);if(this.cancelled)throw new Qn;Function('"use strict";'+l)(),this._iosCache&&this._iosCache.set(i,l,c.headers),this.succeeded=!0,this._successCallback()}catch(f){if(clearTimeout(this._networkTimeout),f instanceof Qn||this.cancelled||this._networkTimedOut)return;this._failureCallback({msg:"Failed to load call object bundle ".concat(i,": ").concat(f),type:f.message})}}),function(i){return e.apply(this,arguments)})},{key:"_getBundleCodeFromResponse",value:(t=L(function*(i,s){if(s.ok)return yield s.text();if(this._iosCache&&s.status===304)return(yield this._iosCache.renew(i,s.headers)).code;throw new Error("Received ".concat(s.status," response"))}),function(i,s){return t.apply(this,arguments)})}]);var t,e,n,r}(),yu=function(){return fe(function t(e,n,r){de(this,t),this.cancelled=!1,this.succeeded=!1,this._dailyConfig=e,this._successCallback=n,this._failureCallback=r,this._attemptId=En(),this._networkTimeout=null,this._scriptElement=null},[{key:"start",value:function(){window._dailyCallMachineLoadWaitlist||(window._dailyCallMachineLoadWaitlist=new Set);var t=dn(this._dailyConfig);(typeof document>"u"?"undefined":q(document))==="object"?this._startLoading(t):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(t){var e=this;this._signUpForCallMachineLoadWaitlist(),this._networkTimeout=setTimeout(function(){e._stopLoading(),e._failureCallback({msg:"Timed out (>".concat(yn," ms) when loading call object bundle ").concat(t),type:"timeout"})},yn);var n=document.getElementsByTagName("head")[0],r=document.createElement("script");this._scriptElement=r,r.onload=function(){e._stopLoading(),e.succeeded=!0,e._successCallback()},r.onerror=function(i){e._stopLoading(),e._failureCallback({msg:"Failed to load call object bundle ".concat(i.target.src),type:i.message})},r.src=t,n.appendChild(r)}},{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)}}])}(),en=function(t,e,n){return _u(t.local,e,n)===!0},bu=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]},lt=function(t,e,n,r){var i=wu(t,e,n,r);return i&&i.pendingTrack},_u=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)},wu=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]},Su=function(t,e){var n=t.local.public.customTracks;if(n&&n[e])return n[e].track};function Ns(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],f=s==="cam"?l:"screen".concat(l.charAt(0).toUpperCase()+l.slice(1)),h=t.tracks[f];if(h){var v=t.local?bu(n,s,l):lt(n,t.session_id,s,l);h.state==="playable"&&(h.track=v),h.persistentTrack=v}}}function Fs(t,e){try{var n=e.getState();for(var r in t.tracks)if(!ku(r)){var i=t.tracks[r].kind;if(i){var s=t.tracks[r];if(s){var a=t.local?Su(n,r):lt(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 ku(t){return["video","audio","screenVideo","screenAudio"].includes(t)}function Us(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&&en(r,t.session_id,"cam-audio")){var a=lt(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&&en(r,t.session_id,"cam-video")){var c=lt(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&&en(r,t.session_id,"screen-audio")){var l=lt(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&&en(r,t.session_id,"screen-video")){var f=lt(r,t.session_id,"screen","video");f&&(e&&e.screenVideoTrack&&e.screenVideoTrack.id===f.id?t.screenVideoTrack=f:f.muted||(t.screenVideoTrack=f))}t.screenVideoTrack||t.screenAudioTrack||(t.screen=!1)}catch(h){console.error("unexpected error matching up tracks",h)}}}function Eu(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(l,f){if(l){if(typeof l=="string")return Bs(l,f);var h={}.toString.call(l).slice(8,-1);return h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set"?Array.from(l):h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h)?Bs(l,f):void 0}}(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.
|
|
23
|
-
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 Bs(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var Te=new Map,dt=null;function
|
|
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 Vs(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var Ce=new Map,At=null;function Cu(t){Ko()?function(e){Te.has(e)||(Te.set(e,{}),navigator.mediaDevices.enumerateDevices().then(function(n){Te.has(e)&&(Te.get(e).lastDevicesString=JSON.stringify(n),dt||(dt=function(){var r=L(function*(){var i,s=yield navigator.mediaDevices.enumerateDevices(),a=Eu(Te.keys());try{for(a.s();!(i=a.n()).done;){var c=i.value,l=JSON.stringify(s);l!==Te.get(c).lastDevicesString&&(Te.get(c).lastDevicesString=l,c(s))}}catch(f){a.e(f)}finally{a.f()}});return function(){return r.apply(this,arguments)}}(),navigator.mediaDevices.addEventListener("devicechange",dt)))}).catch(function(){}))}(t):function(e){Ce.has(e)||(Ce.set(e,{}),navigator.mediaDevices.enumerateDevices().then(function(n){Ce.has(e)&&(Ce.get(e).lastDevicesString=JSON.stringify(n),At||(At=setInterval(L(function*(){var r,i=yield navigator.mediaDevices.enumerateDevices(),s=Tu(Ce.keys());try{for(s.s();!(r=s.n()).done;){var a=r.value,c=JSON.stringify(i);c!==Ce.get(a).lastDevicesString&&(Ce.get(a).lastDevicesString=c,a(i))}}catch(l){s.e(l)}finally{s.f()}}),3e3)))}))}(t)}function Mu(t){Ko()?function(e){Te.has(e)&&(Te.delete(e),Te.size===0&&dt&&(navigator.mediaDevices.removeEventListener("devicechange",dt),dt=null))}(t):function(e){Ce.has(e)&&(Ce.delete(e),Ce.size===0&&At&&(clearInterval(At),At=null))}(t)}function Ko(){var t;return V()||((t=navigator.mediaDevices)===null||t===void 0?void 0:t.ondevicechange)!==void 0}var Ou=new Set;function Au(t,e){return t&&t.readyState==="live"&&!function(n,r){return n.muted&&!Ou.has(n.id)}(t)}function Js(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 Re(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Js(Object(n),!0).forEach(function(r){Me(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Js(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var Ot=Object.freeze({VIDEO:"video",AUDIO:"audio",SCREEN_VIDEO:"screenVideo",SCREEN_AUDIO:"screenAudio",CUSTOM_VIDEO:"customVideo",CUSTOM_AUDIO:"customAudio"}),Pu=Object.freeze({PARTICIPANTS:"participants",STREAMING:"streaming",TRANSCRIPTION:"transcription"}),Pt=Object.values(Ot),qs=["v","a","sv","sa","cv","ca"];Object.freeze(Pt.reduce(function(t,e,n){return t[e]=qs[n],t},{})),Object.freeze(qs.reduce(function(t,e,n){return t[e]=Pt[n],t},{}));var xu=[Ot.VIDEO,Ot.AUDIO,Ot.SCREEN_VIDEO,Ot.SCREEN_AUDIO],$s=Object.values(Pu),zs=["p","s","t"];Object.freeze($s.reduce(function(t,e,n){return t[e]=zs[n],t},{})),Object.freeze(zs.reduce(function(t,e,n){return t[e]=$s[n],t},{}));var Qo=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.base,r=e.byUserId,i=e.byParticipantId;de(this,t),this.base=n,this.byUserId=r,this.byParticipantId=i}return fe(t,[{key:"clone",value:function(){var e=new t;if(this.base instanceof ee?e.base=this.base.clone():e.base=this.base,this.byUserId!==void 0)for(var n in e.byUserId={},this.byUserId){var r=this.byUserId[n];e.byUserId[n]=r instanceof ee?r.clone():r}if(this.byParticipantId!==void 0)for(var i in e.byParticipantId={},this.byParticipantId){var s=this.byParticipantId[i];e.byParticipantId[i]=s instanceof ee?s.clone():s}return e}},{key:"toJSONObject",value:function(){var e={};if(typeof this.base=="boolean"?e.base=this.base:this.base instanceof ee&&(e.base=this.base.toJSONObject()),this.byUserId!==void 0)for(var n in e.byUserId={},this.byUserId){var r=this.byUserId[n];e.byUserId[n]=r instanceof ee?r.toJSONObject():r}if(this.byParticipantId!==void 0)for(var i in e.byParticipantId={},this.byParticipantId){var s=this.byParticipantId[i];e.byParticipantId[i]=s instanceof ee?s.toJSONObject():s}return e}},{key:"toMinifiedJSONObject",value:function(){var e={};if(this.base!==void 0&&(typeof this.base=="boolean"?e.b=this.base:e.b=this.base.toMinifiedJSONObject()),this.byUserId!==void 0)for(var n in e.u={},this.byUserId){var r=this.byUserId[n];e.u[n]=typeof r=="boolean"?r:r.toMinifiedJSONObject()}if(this.byParticipantId!==void 0)for(var i in e.p={},this.byParticipantId){var s=this.byParticipantId[i];e.p[i]=typeof s=="boolean"?s:s.toMinifiedJSONObject()}return e}},{key:"normalize",value:function(){return this.base instanceof ee&&(this.base=this.base.normalize()),this.byUserId&&(this.byUserId=Object.fromEntries(Object.entries(this.byUserId).map(function(e){var n=re(e,2),r=n[0],i=n[1];return[r,i instanceof ee?i.normalize():i]}))),this.byParticipantId&&(this.byParticipantId=Object.fromEntries(Object.entries(this.byParticipantId).map(function(e){var n=re(e,2),r=n[0],i=n[1];return[r,i instanceof ee?i.normalize():i]}))),this}}],[{key:"fromJSONObject",value:function(e){var n,r,i;if(e.base!==void 0&&(n=typeof e.base=="boolean"?e.base:ee.fromJSONObject(e.base)),e.byUserId!==void 0)for(var s in r={},e.byUserId){var a=e.byUserId[s];r[s]=typeof a=="boolean"?a:ee.fromJSONObject(a)}if(e.byParticipantId!==void 0)for(var c in i={},e.byParticipantId){var l=e.byParticipantId[c];i[c]=typeof l=="boolean"?l:ee.fromJSONObject(l)}return new t({base:n,byUserId:r,byParticipantId:i})}},{key:"fromMinifiedJSONObject",value:function(e){var n,r,i;if(e.b!==void 0&&(n=typeof e.b=="boolean"?e.b:ee.fromMinifiedJSONObject(e.b)),e.u!==void 0)for(var s in r={},e.u){var a=e.u[s];r[s]=typeof a=="boolean"?a:ee.fromMinifiedJSONObject(a)}if(e.p!==void 0)for(var c in i={},e.p){var l=e.p[c];i[c]=typeof l=="boolean"?l:ee.fromMinifiedJSONObject(l)}return new t({base:n,byUserId:r,byParticipantId:i})}},{key:"validateJSONObject",value:function(e){if(q(e)!=="object")return[!1,"canReceive must be an object"];for(var n=["base","byUserId","byParticipantId"],r=0,i=Object.keys(e);r<i.length;r++){var s=i[r];if(!n.includes(s))return[!1,"canReceive can only contain keys (".concat(n.join(", "),")")];if(s==="base"){var a=re(ee.validateJSONObject(e.base,!0),2),c=a[0],l=a[1];if(!c)return[!1,l]}else{if(q(e[s])!=="object")return[!1,"invalid (non-object) value for field '".concat(s,"' in canReceive")];for(var f=0,h=Object.values(e[s]);f<h.length;f++){var v=h[f],E=re(ee.validateJSONObject(v),2),k=E[0],b=E[1];if(!k)return[!1,b]}}}return[!0]}}])}(),ee=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.video,r=e.audio,i=e.screenVideo,s=e.screenAudio,a=e.customVideo,c=e.customAudio;de(this,t),this.video=n,this.audio=r,this.screenVideo=i,this.screenAudio=s,this.customVideo=a,this.customAudio=c}return fe(t,[{key:"clone",value:function(){var e=new t;return this.video!==void 0&&(e.video=this.video),this.audio!==void 0&&(e.audio=this.audio),this.screenVideo!==void 0&&(e.screenVideo=this.screenVideo),this.screenAudio!==void 0&&(e.screenAudio=this.screenAudio),this.customVideo!==void 0&&(e.customVideo=Re({},this.customVideo)),this.customAudio!==void 0&&(e.customAudio=Re({},this.customAudio)),e}},{key:"toJSONObject",value:function(){var e={};return this.video!==void 0&&(e.video=this.video),this.audio!==void 0&&(e.audio=this.audio),this.screenVideo!==void 0&&(e.screenVideo=this.screenVideo),this.screenAudio!==void 0&&(e.screenAudio=this.screenAudio),this.customVideo!==void 0&&(e.customVideo=Re({},this.customVideo)),this.customAudio!==void 0&&(e.customAudio=Re({},this.customAudio)),e}},{key:"toMinifiedJSONObject",value:function(){var e={};return this.video!==void 0&&(e.v=this.video),this.audio!==void 0&&(e.a=this.audio),this.screenVideo!==void 0&&(e.sv=this.screenVideo),this.screenAudio!==void 0&&(e.sa=this.screenAudio),this.customVideo!==void 0&&(e.cv=Re({},this.customVideo)),this.customAudio!==void 0&&(e.ca=Re({},this.customAudio)),e}},{key:"normalize",value:function(){function e(n,r){return n&&Object.keys(n).length===1&&n["*"]===r}return!(this.video!==!0||this.audio!==!0||this.screenVideo!==!0||this.screenAudio!==!0||!e(this.customVideo,!0)||!e(this.customAudio,!0))||(this.video!==!1||this.audio!==!1||this.screenVideo!==!1||this.screenAudio!==!1||!e(this.customVideo,!1)||!e(this.customAudio,!1))&&this}}],[{key:"fromBoolean",value:function(e){return new t({video:e,audio:e,screenVideo:e,screenAudio:e,customVideo:{"*":e},customAudio:{"*":e}})}},{key:"fromJSONObject",value:function(e){return new t({video:e.video,audio:e.audio,screenVideo:e.screenVideo,screenAudio:e.screenAudio,customVideo:e.customVideo!==void 0?Re({},e.customVideo):void 0,customAudio:e.customAudio!==void 0?Re({},e.customAudio):void 0})}},{key:"fromMinifiedJSONObject",value:function(e){return new t({video:e.v,audio:e.a,screenVideo:e.sv,screenAudio:e.sa,customVideo:e.cv,customAudio:e.ca})}},{key:"validateJSONObject",value:function(e,n){if(typeof e=="boolean")return[!0];if(q(e)!=="object")return[!1,"invalid (non-object, non-boolean) value in canReceive"];for(var r=Object.keys(e),i=0,s=r;i<s.length;i++){var a=s[i];if(!Pt.includes(a))return[!1,"invalid media type '".concat(a,"' in canReceive")];if(xu.includes(a)){if(typeof e[a]!="boolean")return[!1,"invalid (non-boolean) value for media type '".concat(a,"' in canReceive")]}else{if(q(e[a])!=="object")return[!1,"invalid (non-object) value for media type '".concat(a,"' in canReceive")];for(var c=0,l=Object.values(e[a]);c<l.length;c++)if(typeof l[c]!="boolean")return[!1,"invalid (non-boolean) value for entry within '".concat(a,"' in canReceive")];if(n&&e[a]["*"]===void 0)return[!1,`canReceive "base" permission must specify "*" as an entry within '`.concat(a,"'")]}}return n&&r.length!==Pt.length?[!1,'canReceive "base" permission must specify all media types: '.concat(Pt.join(", ")," (or be set to a boolean shorthand)")]:[!0]}}])}(),ju=["result"],Iu=["preserveIframe"];function Hs(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 I(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Hs(Object(n),!0).forEach(function(r){Me(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Hs(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Xo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Xo=function(){return!!t})()}function Ws(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(l,f){if(l){if(typeof l=="string")return Gs(l,f);var h={}.toString.call(l).slice(8,-1);return h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set"?Array.from(l):h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h)?Gs(l,f):void 0}}(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 Gs(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var $e={},Ks="video",Lu="voice",Qs=V()?{data:{}}:{data:{},topology:"none"},Xs={present:0,hidden:0},Yo={maxBitrate:{min:1e5,max:25e5},maxFramerate:{min:1,max:30},scaleResolutionDownBy:{min:1,max:8}},Xn=Object.keys(Yo),Ys=["state","volume","simulcastEncodings"],Zs={androidInCallNotification:{title:"string",subtitle:"string",iconName:"string",disableForCustomOverride:"boolean"},disableAutoDeviceManagement:{audio:"boolean",video:"boolean"}},bn={id:{iconPath:"string",iconPathDarkMode:"string",label:"string",tooltip:"string",visualState:"'default' | 'sidebar-open' | 'active'"}},Cr={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"}},ze={customIntegrations:{validate:oa,help:ia()},customTrayButtons:{validate:sa,help:"customTrayButtons should be a dictionary of the type ".concat(JSON.stringify(bn))},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 aa(t,Zs)},help:"reactNativeConfig should look like ".concat(JSON.stringify(Zs),", all fields optional")},lang:{validate:function(t){return["da","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: da, 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 Zo(t),!0}catch(e){return console.error(e),!1}},help:"invalid userData type provided"},startVideoOff:!0,startAudioOff:!0,allowLocalVideo:!0,allowLocalAudio:!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){if(typeof t=="boolean")return e._preloadCache.allowLocalVideo=t,!0;var n;if(t instanceof MediaStreamTrack)e._sharedTracks.videoTrack=t,n={customTrack:je};else{if(delete e._sharedTracks.videoTrack,typeof t!="string")return console.error("videoSource must be a MediaStreamTrack, boolean, or a string"),!1;n={deviceId:t}}return e._updatePreloadCacheInputSettings({video:{settings:n}},!1),!0}},audioSource:{validate:function(t,e){if(typeof t=="boolean")return e._preloadCache.allowLocalAudio=t,!0;var n;if(t instanceof MediaStreamTrack)e._sharedTracks.audioTrack=t,n={customTrack:je};else{if(delete e._sharedTracks.audioTrack,typeof t!="string")return console.error("audioSource must be a MediaStreamTrack, boolean, or a string"),!1;n={deviceId:t}}return e._updatePreloadCacheInputSettings({audio:{settings:n}},!1),!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 q(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 ea(t,{allowAllParticipantsKey:!1})},help:ra({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!!ta(t)&&(e._inputSettings||(e._inputSettings={}),na(t,(n=e.properties)===null||n===void 0?void 0:n.dailyConfig,e._sharedTracks),e._updatePreloadCacheInputSettings(t,!0),!0)},help:Mr()},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},tn={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)||!V()&&t==="avatar")return!0;var r=["audio","video","screenAudio","screenVideo","rmpAudio","rmpVideo"],i=function(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),f=!n.includes(s[c]);if(l||f)return!1}return!0};return i(t)},help:"setSubscribedTracks cannot be used when setSubscribeToTracksAutomatically is enabled, and should be of the form: "+"true".concat(V()?"":" | '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=re(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=Ws(s);try{for(l.s();!(a=l.n()).done;){var f=a.value;if(!c.includes(f))return!1}}catch(w){l.e(w)}finally{l.f()}}else if(typeof s!="boolean")return!1;(s instanceof Array||Array.isArray(s))&&(t.canSend=new Set(s));break;case"canReceive":var h=re(Qo.validateJSONObject(s),2),v=h[0],E=h[1];if(!v)return console.error(E),!1;break;case"canAdmin":if(s instanceof Set||s instanceof Array||Array.isArray(s)){var k,b=["participants","streaming","transcription"],m=Ws(s);try{for(m.s();!(k=m.n()).done;){var y=k.value;if(!b.includes(y))return!1}}catch(w){m.e(w)}finally{m.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, canReceive, 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). canReceive must be an object specifying base, byUserId, and/or byParticipantId fields (see documentation for more details). canAdmin can be a boolean or an Array or Set of admin types (participants, streaming, transcription)."}};Promise.any||(Promise.any=function(){var t=L(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 Ru=function(){function t(o){var d,u,p,g,S,M,O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(de(this,t),p=this,g=we(g=t),Me(u=Sn(p,Xo()?Reflect.construct(g,[],we(p).constructor):g.apply(p,S)),"startListeningForDeviceChanges",function(){Cu(u.handleDeviceChange)}),Me(u,"stopListeningForDeviceChanges",function(){Mu(u.handleDeviceChange)}),Me(u,"handleDeviceChange",function(F){F=F.map(function(B){return JSON.parse(JSON.stringify(B))}),u.emitDailyJSEvent({action:"available-devices-updated",availableDevices:F})}),Me(u,"handleNativeAppStateChange",function(){var F=L(function*(B){if(B==="destroyed")return console.warn("App has been destroyed before leaving the meeting. Cleaning up all the resources!"),void(yield u.destroy());var ke=B==="active";u.disableReactNativeAutoDeviceManagement("video")||(ke?u.camUnmutedBeforeLosingNativeActiveState&&u.setLocalVideo(!0):(u.camUnmutedBeforeLosingNativeActiveState=u.localVideo(),u.camUnmutedBeforeLosingNativeActiveState&&u.setLocalVideo(!1)))});return function(B){return F.apply(this,arguments)}}()),Me(u,"handleNativeAudioFocusChange",function(F){u.disableReactNativeAutoDeviceManagement("audio")||(u._hasNativeAudioFocus=F,u.toggleParticipantAudioBasedOnNativeAudioFocus(),u._hasNativeAudioFocus?u.micUnmutedBeforeLosingNativeAudioFocus&&u.setLocalAudio(!0):(u.micUnmutedBeforeLosingNativeAudioFocus=u.localAudio(),u.setLocalAudio(!1)))}),Me(u,"handleNativeSystemScreenCaptureStop",function(){u.stopScreenShare()}),u.strictMode=O.strictMode===void 0||O.strictMode,u.allowMultipleCallInstances=(d=O.allowMultipleCallInstances)!==null&&d!==void 0&&d,Object.keys($e).length&&(u._logDuplicateInstanceAttempt(),!u.allowMultipleCallInstances)){if(u.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:{}}),u.callClientId=En(),$e[(M=u).callClientId]=M,window._daily.instances[u.callClientId]={},u._sharedTracks={},window._daily.instances[u.callClientId].tracks=u._sharedTracks,O.dailyJsVersion=t.version(),u._iframe=o,u._callObjectMode=O.layout==="none"&&!u._iframe,u._preloadCache={subscribeToTracksAutomatically:!0,outputDeviceId:null,inputSettings:null,sendSettings:null,videoTrackForNetworkConnectivityTest:null,videoTrackForConnectionQualityTest:null},O.showLocalVideo!==void 0?u._callObjectMode?console.error("showLocalVideo is not available in call object mode"):u._showLocalVideo=!!O.showLocalVideo:u._showLocalVideo=!0,O.showParticipantsBar!==void 0?u._callObjectMode?console.error("showParticipantsBar is not available in call object mode"):u._showParticipantsBar=!!O.showParticipantsBar:u._showParticipantsBar=!0,O.customIntegrations!==void 0?u._callObjectMode?console.error("customIntegrations is not available in call object mode"):u._customIntegrations=O.customIntegrations:u._customIntegrations={},O.customTrayButtons!==void 0?u._callObjectMode?console.error("customTrayButtons is not available in call object mode"):u._customTrayButtons=O.customTrayButtons:u._customTrayButtons={},O.activeSpeakerMode!==void 0?u._callObjectMode?console.error("activeSpeakerMode is not available in call object mode"):u._activeSpeakerMode=!!O.activeSpeakerMode:u._activeSpeakerMode=!1,O.receiveSettings?u._callObjectMode?u._receiveSettings=O.receiveSettings:console.error("receiveSettings is only available in call object mode"):u._receiveSettings={},u.validateProperties(O),u.properties=I({},O),u._inputSettings||(u._inputSettings={}),u._callObjectLoader=u._callObjectMode?new mu(u.callClientId):null,u._callState=ms,u._isPreparingToJoin=!1,u._accessState={access:zn},u._meetingSessionSummary={},u._finalSummaryOfPrevSession={},u._meetingSessionState=er(Qs,u._callObjectMode),u._nativeInCallAudioMode=Ks,u._participants={},u._isScreenSharing=!1,u._participantCounts=Xs,u._rmpPlayerState={},u._waitingParticipants={},u._network={threshold:"good",quality:100,networkState:"unknown",stats:{}},u._activeSpeaker={},u._localAudioLevel=0,u._isLocalAudioLevelObserverRunning=!1,u._remoteParticipantsAudioLevel={},u._isRemoteParticipantsAudioLevelObserverRunning=!1,u._maxAppMessageSize=Hn,u._messageChannel=V()?new hu:new fu,u._iframe&&(u._iframe.requestFullscreen?u._iframe.addEventListener("fullscreenchange",function(){document.fullscreenElement===u._iframe?(u.emitDailyJSEvent({action:Xt}),u.sendMessageToCallMachine({action:Xt})):(u.emitDailyJSEvent({action:Yt}),u.sendMessageToCallMachine({action:Yt}))}):u._iframe.webkitRequestFullscreen&&u._iframe.addEventListener("webkitfullscreenchange",function(){document.webkitFullscreenElement===u._iframe?(u.emitDailyJSEvent({action:Xt}),u.sendMessageToCallMachine({action:Xt})):(u.emitDailyJSEvent({action:Yt}),u.sendMessageToCallMachine({action:Yt}))})),V()){var P=u.nativeUtils();P.addAudioFocusChangeListener&&P.removeAudioFocusChangeListener&&P.addAppStateChangeListener&&P.removeAppStateChangeListener&&P.addSystemScreenCaptureStopListener&&P.removeSystemScreenCaptureStopListener||console.warn("expected (add|remove)(AudioFocusChange|AppActiveStateChange|SystemScreenCaptureStop)Listener to be available in React Native"),u._hasNativeAudioFocus=!0,P.addAudioFocusChangeListener(u.handleNativeAudioFocusChange),P.addAppStateChangeListener(u.handleNativeAppStateChange),P.addSystemScreenCaptureStopListener(u.handleNativeSystemScreenCaptureStop)}return u._callObjectMode&&u.startListeningForDeviceChanges(),u._messageChannel.addListenerForMessagesFromCallMachine(u.handleMessageFromCallMachine,u.callClientId,u),u}return kn(t,qt),fe(t,[{key:"destroy",value:(ci=L(function*(){var o;try{yield this.leave()}catch{}var d=this._iframe;if(d){var u=d.parentElement;u&&u.removeChild(d)}if(this._messageChannel.removeListener(this.handleMessageFromCallMachine),V()){var p=this.nativeUtils();p.removeAudioFocusChangeListener(this.handleNativeAudioFocusChange),p.removeAppStateChangeListener(this.handleNativeAppStateChange),p.removeSystemScreenCaptureStopListener(this.handleNativeSystemScreenCaptureStop)}this._callObjectMode&&this.stopListeningForDeviceChanges(),this.resetMeetingDependentVars(),this._destroyed=!0,this.emitDailyJSEvent({action:"call-instance-destroyed"}),delete $e[this.callClientId],!((o=window)===null||o===void 0||(o=o._daily)===null||o===void 0)&&o.instances&&delete window._daily.instances[this.callClientId],this.strictMode&&(this.callClientId=void 0)}),function(){return ci.apply(this,arguments)})},{key:"isDestroyed",value:function(){return!!this._destroyed}},{key:"loadCss",value:function(o){var d=o.bodyClass,u=o.cssFile,p=o.cssText;return U(),this.sendMessageToCallMachine({action:"load-css",cssFile:this.absoluteUrl(u),bodyClass:d,cssText:p}),this}},{key:"iframe",value:function(){return U(),this._iframe}},{key:"meetingState",value:function(){return this._callState}},{key:"accessState",value:function(){return ye(this._callObjectMode,"accessState()"),this._accessState}},{key:"participants",value:function(){return this._participants}},{key:"participantCounts",value:function(){return this._participantCounts}},{key:"waitingParticipants",value:function(){return ye(this._callObjectMode,"waitingParticipants()"),this._waitingParticipants}},{key:"validateParticipantProperties",value:function(o,d){for(var u in d){if(!tn[u])throw new Error("unrecognized updateParticipant property ".concat(u));if(tn[u].validate&&!tn[u].validate(d[u],this,this._participants[o]))throw new Error(tn[u].help)}}},{key:"updateParticipant",value:function(o,d){return this._participants.local&&this._participants.local.session_id===o&&(o="local"),o&&d&&(this.validateParticipantProperties(o,d),this.sendMessageToCallMachine({action:"update-participant",id:o,properties:d})),this}},{key:"updateParticipants",value:function(o){var d=this._participants.local&&this._participants.local.session_id;for(var u in o)u===d&&(u="local"),u&&o[u]&&this.validateParticipantProperties(u,o[u]);return this.sendMessageToCallMachine({action:"update-participants",participants:o}),this}},{key:"updateWaitingParticipant",value:(ai=L(function*(){var o=this,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(ye(this._callObjectMode,"updateWaitingParticipant()"),H(this._callState,"updateWaitingParticipant()"),typeof d!="string"||q(u)!=="object")throw new Error("updateWaitingParticipant() must take an id string and a updates object");return new Promise(function(p,g){o.sendMessageToCallMachine({action:"daily-method-update-waiting-participant",id:d,updates:u},function(S){S.error&&g(S.error),S.id||g(new Error("unknown error in updateWaitingParticipant()")),p({id:S.id})})})}),function(){return ai.apply(this,arguments)})},{key:"updateWaitingParticipants",value:(oi=L(function*(){var o=this,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ye(this._callObjectMode,"updateWaitingParticipants()"),H(this._callState,"updateWaitingParticipants()"),q(d)!=="object")throw new Error("updateWaitingParticipants() must take a mapping between ids and update objects");return new Promise(function(u,p){o.sendMessageToCallMachine({action:"daily-method-update-waiting-participants",updatesById:d},function(g){g.error&&p(g.error),g.ids||p(new Error("unknown error in updateWaitingParticipants()")),u({ids:g.ids})})})}),function(){return oi.apply(this,arguments)})},{key:"requestAccess",value:(si=L(function*(){var o=this,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},u=d.access,p=u===void 0?{level:al}:u,g=d.name,S=g===void 0?"":g;return ye(this._callObjectMode,"requestAccess()"),H(this._callState,"requestAccess()"),new Promise(function(M,O){o.sendMessageToCallMachine({action:"daily-method-request-access",access:p,name:S},function(P){P.error&&O(P.error),P.access||O(new Error("unknown error in requestAccess()")),M({access:P.access,granted:P.granted})})})}),function(){return si.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 d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return"forceDiscardTrack"in d&&(V()?(console.warn("forceDiscardTrack option not supported in React Native; ignoring"),d={}):o&&(console.warn("forceDiscardTrack option only supported when calling setLocalAudio(false); ignoring"),d={})),this.sendMessageToCallMachine({action:"local-audio",state:o,options:d}),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:"_setAllowLocalAudio",value:function(o){if(this._preloadCache.allowLocalAudio=o,this._callMachineInitialized)return this.sendMessageToCallMachine({action:"set-allow-local-audio",state:o}),this}},{key:"_setAllowLocalVideo",value:function(o){if(this._preloadCache.allowLocalVideo=o,this._callMachineInitialized)return this.sendMessageToCallMachine({action:"set-allow-local-video",state:o}),this}},{key:"getReceiveSettings",value:(ii=L(function*(o){var d=this,u=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).showInheritedValues,p=u!==void 0&&u;if(ye(this._callObjectMode,"getReceiveSettings()"),!this._callMachineInitialized)return this._receiveSettings;switch(q(o)){case"string":return new Promise(function(g){d.sendMessageToCallMachine({action:"get-single-participant-receive-settings",id:o,showInheritedValues:p},function(S){g(S.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 ii.apply(this,arguments)})},{key:"updateReceiveSettings",value:(ri=L(function*(o){var d=this;if(ye(this._callObjectMode,"updateReceiveSettings()"),!ea(o,{allowAllParticipantsKey:!0}))throw new Error(ra({allowAllParticipantsKey:!0}));return H(this._callState,"updateReceiveSettings()","To specify receive settings earlier, use the receiveSettings config property."),new Promise(function(u){d.sendMessageToCallMachine({action:"update-receive-settings",receiveSettings:o},function(p){u({receiveSettings:p.receiveSettings})})})}),function(o){return ri.apply(this,arguments)})},{key:"_prepInputSettingsForSharing",value:function(o,d){if(o){var u={};if(o.audio){var p,g,S;o.audio.settings&&(!Object.keys(o.audio.settings).length&&d||(u.audio={settings:I({},o.audio.settings)})),d&&(p=u.audio)!==null&&p!==void 0&&(p=p.settings)!==null&&p!==void 0&&p.customTrack&&(u.audio.settings={customTrack:this._sharedTracks.audioTrack});var M=((g=o.audio.processor)===null||g===void 0?void 0:g.type)==="none"&&((S=o.audio.processor)===null||S===void 0?void 0:S._isDefaultWhenNone);if(o.audio.processor&&!M){var O=I({},o.audio.processor);delete O._isDefaultWhenNone,u.audio=I(I({},u.audio),{},{processor:O})}}if(o.video){var P,F,B;o.video.settings&&(!Object.keys(o.video.settings).length&&d||(u.video={settings:I({},o.video.settings)})),d&&(P=u.video)!==null&&P!==void 0&&(P=P.settings)!==null&&P!==void 0&&P.customTrack&&(u.video.settings={customTrack:this._sharedTracks.videoTrack});var ke=((F=o.video.processor)===null||F===void 0?void 0:F.type)==="none"&&((B=o.video.processor)===null||B===void 0?void 0:B._isDefaultWhenNone);if(o.video.processor&&!ke){var Be=I({},o.video.processor);delete Be._isDefaultWhenNone,u.video=I(I({},u.video),{},{processor:Be})}}return u}}},{key:"getInputSettings",value:function(){var o=this;return U(),new Promise(function(d){d(o._getInputSettings())})}},{key:"_getInputSettings",value:function(){var o,d,u,p,g,S,M={processor:{type:"none",_isDefaultWhenNone:!0}};this._inputSettings?(o=((u=this._inputSettings)===null||u===void 0?void 0:u.video)||M,d=((p=this._inputSettings)===null||p===void 0?void 0:p.audio)||M):(o=((g=this._preloadCache)===null||g===void 0||(g=g.inputSettings)===null||g===void 0?void 0:g.video)||M,d=((S=this._preloadCache)===null||S===void 0||(S=S.inputSettings)===null||S===void 0?void 0:S.audio)||M);var O={audio:d,video:o};return this._prepInputSettingsForSharing(O,!0)}},{key:"_updatePreloadCacheInputSettings",value:function(o,d){var u=this._inputSettings||{},p={};if(o.video){var g,S,M;p.video={},o.video.settings?(p.video.settings={},d||o.video.settings.customTrack||(M=u.video)===null||M===void 0||!M.settings?p.video.settings=o.video.settings:p.video.settings=I(I({},u.video.settings),o.video.settings),Object.keys(p.video.settings).length||delete p.video.settings):(g=u.video)!==null&&g!==void 0&&g.settings&&(p.video.settings=u.video.settings),o.video.processor?p.video.processor=o.video.processor:(S=u.video)!==null&&S!==void 0&&S.processor&&(p.video.processor=u.video.processor)}else u.video&&(p.video=u.video);if(o.audio){var O,P,F;p.audio={},o.audio.settings?(p.audio.settings={},d||o.audio.settings.customTrack||(F=u.audio)===null||F===void 0||!F.settings?p.audio.settings=o.audio.settings:p.audio.settings=I(I({},u.audio.settings),o.audio.settings),Object.keys(p.audio.settings).length||delete p.audio.settings):(O=u.audio)!==null&&O!==void 0&&O.settings&&(p.audio.settings=u.audio.settings),o.audio.processor?p.audio.processor=o.audio.processor:(P=u.audio)!==null&&P!==void 0&&P.processor&&(p.audio.processor=u.audio.processor)}else u.audio&&(p.audio=u.audio);this._maybeUpdateInputSettings(p)}},{key:"_devicesFromInputSettings",value:function(o){var d,u,p=(o==null||(d=o.video)===null||d===void 0||(d=d.settings)===null||d===void 0?void 0:d.deviceId)||null,g=(o==null||(u=o.audio)===null||u===void 0||(u=u.settings)===null||u===void 0?void 0:u.deviceId)||null,S=this._preloadCache.outputDeviceId||null;return{camera:p?{deviceId:p}:{},mic:g?{deviceId:g}:{},speaker:S?{deviceId:S}:{}}}},{key:"updateInputSettings",value:(ni=L(function*(o){var d=this;return U(),ta(o)?o.video||o.audio?(na(o,this.properties.dailyConfig,this._sharedTracks),this._callObjectMode&&!this._callMachineInitialized?(this._updatePreloadCacheInputSettings(o,!0),this._getInputSettings()):new Promise(function(u,p){d.sendMessageToCallMachine({action:"update-input-settings",inputSettings:o},function(g){if(g.error)p(g.error);else{if(g.returnPreloadCache)return d._updatePreloadCacheInputSettings(o,!0),void u(d._getInputSettings());d._maybeUpdateInputSettings(g.inputSettings),u(d._prepInputSettingsForSharing(g.inputSettings,!0))}})})):this._getInputSettings():(console.error(Mr()),Promise.reject(Mr()))}),function(o){return ni.apply(this,arguments)})},{key:"setBandwidth",value:function(o){var d=o.kbs,u=o.trackConstraints;if(U(),this._callMachineInitialized)return this.sendMessageToCallMachine({action:"set-bandwidth",kbs:d,trackConstraints:u}),this}},{key:"getDailyLang",value:function(){var o=this;if(U(),this._callMachineInitialized)return new Promise(function(d){o.sendMessageToCallMachine({action:"get-daily-lang"},function(u){delete u.action,delete u.callbackStamp,d(u)})})}},{key:"setDailyLang",value:function(o){return U(),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[qe,Le].includes(this._callState)?this._finalSummaryOfPrevSession:this._meetingSessionSummary}},{key:"getMeetingSession",value:(ti=L(function*(){var o=this;return console.warn("getMeetingSession() is deprecated: use meetingSessionSummary(), which will return immediately"),H(this._callState,"getMeetingSession()"),new Promise(function(d){o.sendMessageToCallMachine({action:"get-meeting-session"},function(u){delete u.action,delete u.callbackStamp,d(u)})})}),function(){return ti.apply(this,arguments)})},{key:"meetingSessionState",value:function(){return H(this._callState,"meetingSessionState"),this._meetingSessionState}},{key:"setMeetingSessionData",value:function(o){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"replace";ye(this._callObjectMode,"setMeetingSessionData()"),H(this._callState,"setMeetingSessionData");try{(function(u,p){new pu({data:u,mergeStrategy:p})})(o,d)}catch(u){throw console.error(u),u}try{this.sendMessageToCallMachine({action:"set-session-data",data:o,mergeStrategy:d})}catch(u){throw new Error("Error setting meeting session data: ".concat(u))}}},{key:"setUserName",value:function(o,d){var u=this;return this.properties.userName=o,new Promise(function(p){u.sendMessageToCallMachine({action:"set-user-name",name:o??"",thisMeetingOnly:V()||!!d&&!!d.thisMeetingOnly},function(g){delete g.action,delete g.callbackStamp,p(g)})})}},{key:"setUserData",value:(ei=L(function*(o){var d=this;try{Zo(o)}catch(u){throw console.error(u),u}if(this.properties.userData=o,this._callMachineInitialized)return new Promise(function(u){try{d.sendMessageToCallMachine({action:"set-user-data",userData:o},function(p){delete p.action,delete p.callbackStamp,u(p)})}catch(p){throw new Error("Error setting user data: ".concat(p))}})}),function(o){return ei.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 d=this;if(typeof AudioWorkletNode>"u"&&!V())throw new Error("startLocalAudioLevelObserver() is not supported on this browser");if(this.validateAudioLevelInterval(o),this._callMachineInitialized)return this._isLocalAudioLevelObserverRunning=!0,new Promise(function(u,p){d.sendMessageToCallMachine({action:"start-local-audio-level-observer",interval:o},function(g){d._isLocalAudioLevelObserverRunning=!g.error,g.error?p({error:g.error}):u()})});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 d=this;if(this.validateAudioLevelInterval(o),this._callMachineInitialized)return this._isRemoteParticipantsAudioLevelObserverRunning=!0,new Promise(function(u,p){d.sendMessageToCallMachine({action:"start-remote-participants-audio-level-observer",interval:o},function(g){d._isRemoteParticipantsAudioLevelObserverRunning=!g.error,g.error?p({error:g.error}):u()})});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:(Zr=L(function*(){var o=this,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ye(this._callObjectMode,"startCamera()"),Yn(this._callState,this._isPreparingToJoin,"startCamera()","Did you mean to use setLocalAudio() and/or setLocalVideo() instead?"),this.needsLoad())try{yield this.load(d)}catch(u){return Promise.reject(u)}else{if(this._didPreAuth){if(d.url&&d.url!==this.properties.url)return console.error("url in startCamera() is different than the one used in preAuth()"),Promise.reject();if(d.token&&d.token!==this.properties.token)return console.error("token in startCamera() is different than the one used in preAuth()"),Promise.reject()}this.validateProperties(d),this.properties=I(I({},this.properties),d)}return new Promise(function(u){o._preloadCache.inputSettings=o._prepInputSettingsForSharing(o._inputSettings,!1),o.sendMessageToCallMachine({action:"start-camera",properties:ct(o.properties,o.callClientId),preloadCache:ct(o._preloadCache,o.callClientId)},function(p){u({camera:p.camera,mic:p.mic,speaker:p.speaker})})})}),function(){return Zr.apply(this,arguments)})},{key:"validateCustomTrack",value:function(o,d,u){if(u&&u.length>50)throw new Error("Custom track `trackName` must not be more than 50 characters");if(d&&d!=="music"&&d!=="speech"&&!(d instanceof Object))throw new Error("Custom track `mode` must be either `music` | `speech` | `DailyMicAudioModeSettings` or `undefined`");if(u&&["cam-audio","cam-video","screen-video","screen-audio","rmpAudio","rmpVideo","customVideoDefaults"].includes(u))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,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{track,mode,trackName,ignoreAudioLevel};return U(),H(this._callState,"startCustomTrack()"),this.validateCustomTrack(d.track,d.mode,d.trackName),new Promise(function(u,p){o._sharedTracks.customTrack=d.track,d.track=je,o.sendMessageToCallMachine({action:"start-custom-track",properties:d},function(g){g.error?p({error:g.error}):u(g.mediaTag)})})}},{key:"stopCustomTrack",value:function(o){var d=this;return U(),H(this._callState,"stopCustomTrack()"),new Promise(function(u){d.sendMessageToCallMachine({action:"stop-custom-track",mediaTag:o},function(p){u(p.mediaTag)})})}},{key:"setCamera",value:function(o){var d=this;return Tt(),nn(this._callMachineInitialized,"setCamera()"),new Promise(function(u){d.sendMessageToCallMachine({action:"set-camera",cameraDeviceId:o},function(p){u({device:p.device})})})}},{key:"setAudioDevice",value:(Yr=L(function*(o){return Tt(),this.nativeUtils().setAudioDevice(o),{deviceId:yield this.nativeUtils().getAudioDevice()}}),function(o){return Yr.apply(this,arguments)})},{key:"cycleCamera",value:function(){var o=this,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new Promise(function(u){o.sendMessageToCallMachine({action:"cycle-camera",properties:d},function(p){u({device:p.device})})})}},{key:"cycleMic",value:function(){var o=this;return U(),new Promise(function(d){o.sendMessageToCallMachine({action:"cycle-mic"},function(u){d({device:u.device})})})}},{key:"getCameraFacingMode",value:function(){var o=this;return Tt(),new Promise(function(d){o.sendMessageToCallMachine({action:"get-camera-facing-mode"},function(u){d(u.facingMode)})})}},{key:"setInputDevicesAsync",value:(at=L(function*(o){var d=this,u=o.audioDeviceId,p=o.videoDeviceId,g=o.audioSource,S=o.videoSource;if(U(),g!==void 0&&(u=g),S!==void 0&&(p=S),typeof u=="boolean"&&(this._setAllowLocalAudio(u),u=void 0),typeof p=="boolean"&&(this._setAllowLocalVideo(p),p=void 0),!u&&!p)return yield this.getInputDevices();var M={};return u&&(u instanceof MediaStreamTrack?(this._sharedTracks.audioTrack=u,u=je,M.audio={settings:{customTrack:u}}):(delete this._sharedTracks.audioTrack,M.audio={settings:{deviceId:u}})),p&&(p instanceof MediaStreamTrack?(this._sharedTracks.videoTrack=p,p=je,M.video={settings:{customTrack:p}}):(delete this._sharedTracks.videoTrack,M.video={settings:{deviceId:p}})),this._callObjectMode&&this.needsLoad()?(this._updatePreloadCacheInputSettings(M,!1),this._devicesFromInputSettings(this._inputSettings)):new Promise(function(O){d.sendMessageToCallMachine({action:"set-input-devices",audioDeviceId:u,videoDeviceId:p},function(P){if(delete P.action,delete P.callbackStamp,P.returnPreloadCache)return d._updatePreloadCacheInputSettings(M,!1),void O(d._devicesFromInputSettings(d._inputSettings));O(P)})})}),function(o){return at.apply(this,arguments)})},{key:"setOutputDeviceAsync",value:(ot=L(function*(o){var d=this,u=o.outputDeviceId;return U(),u&&(this._preloadCache.outputDeviceId=u),this._callObjectMode&&this.needsLoad()?this._devicesFromInputSettings(this._inputSettings):new Promise(function(p){d.sendMessageToCallMachine({action:"set-output-device",outputDeviceId:u},function(g){delete g.action,delete g.callbackStamp,g.returnPreloadCache?p(d._devicesFromInputSettings(d._inputSettings)):p(g)})})}),function(o){return ot.apply(this,arguments)})},{key:"getInputDevices",value:(Oe=L(function*(){var o=this;return this._callObjectMode&&this.needsLoad()?this._devicesFromInputSettings(this._inputSettings):new Promise(function(d){o.sendMessageToCallMachine({action:"get-input-devices"},function(u){u.returnPreloadCache?d(o._devicesFromInputSettings(o._inputSettings)):d({camera:u.camera,mic:u.mic,speaker:u.speaker})})})}),function(){return Oe.apply(this,arguments)})},{key:"nativeInCallAudioMode",value:function(){return Tt(),this._nativeInCallAudioMode}},{key:"setNativeInCallAudioMode",value:function(o){if(Tt(),[Ks,Lu].includes(o)){if(o!==this._nativeInCallAudioMode)return this._nativeInCallAudioMode=o,!this.disableReactNativeAutoDeviceManagement("audio")&&an(this._callState,this._isPreparingToJoin)&&this.nativeUtils().setAudioMode(this._nativeInCallAudioMode),this}else console.error("invalid in-call audio mode specified: ",o)}},{key:"preAuth",value:(X=L(function*(){var o=this,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ye(this._callObjectMode,"preAuth()"),Yn(this._callState,this._isPreparingToJoin,"preAuth()"),this.needsLoad()&&(yield this.load(d)),!d.url)throw new Error("preAuth() requires at least a url to be provided");return this.validateProperties(d),this.properties=I(I({},this.properties),d),new Promise(function(u,p){o._preloadCache.inputSettings=o._prepInputSettingsForSharing(o._inputSettings,!1),o.sendMessageToCallMachine({action:"daily-method-preauth",properties:ct(o.properties,o.callClientId),preloadCache:ct(o._preloadCache,o.callClientId)},function(g){return g.error?p(g.error):g.access?(o._didPreAuth=!0,void u({access:g.access})):p(new Error("unknown error in preAuth()"))})})}),function(){return X.apply(this,arguments)})},{key:"load",value:(J=L(function*(o){var d=this;if(this.needsLoad()){if(this._destroyed&&(this._logUseAfterDestroy(),this.strictMode))throw new Error("Use after destroy");if(o&&(this.validateProperties(o),this.properties=I(I({},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(gs),this.emitDailyJSEvent({action:pl}),this._callObjectMode?new Promise(function(u,p){d._callObjectLoader.cancel();var g=Date.now();d._callObjectLoader.load(d.properties.dailyConfig,function(S){d._bundleLoadTime=S?"no-op":Date.now()-g,d._updateCallState(vs),S&&d.emitDailyJSEvent({action:bs}),u()},function(S,M){if(d.emitDailyJSEvent({action:ml}),!M){d._updateCallState(Le),d.resetMeetingDependentVars();var O={action:Es,errorMsg:S.msg,error:{type:"connection-error",msg:"Failed to load call object bundle.",details:{on:"load",sourceError:S,bundleUrl:dn(d.properties.dailyConfig)}}};d._maybeSendToSentry(O),d.emitDailyJSEvent(O),p(S.msg)}})}):(this._iframe.src=wo(this.assembleMeetingUrl(),this.properties.dailyConfig),new Promise(function(u,p){d._loadedCallback=function(g){d._callState!==Le?(d._updateCallState(vs),(d.properties.cssFile||d.properties.cssText)&&d.loadCss(d.properties),u()):p(g)}}))}}),function(o){return J.apply(this,arguments)})},{key:"join",value:(R=L(function*(){var o=this,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this._testCallInProgress&&this.stopTestCallQuality();var u=!1;if(this.needsLoad()){this.updateIsPreparingToJoin(!0);try{yield this.load(d)}catch(p){return this.updateIsPreparingToJoin(!1),Promise.reject(p)}}else{if(u=!(!this.properties.cssFile&&!this.properties.cssText),this._didPreAuth){if(d.url&&d.url!==this.properties.url)return console.error("url in join() is different than the one used in preAuth()"),this.updateIsPreparingToJoin(!1),Promise.reject();if(d.token&&d.token!==this.properties.token)return console.error("token in join() is different than the one used in preAuth()"),this.updateIsPreparingToJoin(!1),Promise.reject()}if(d.url&&!this._callObjectMode&&d.url&&d.url!==this.properties.url)return console.error("url in join() is different than the one used in load() (".concat(this.properties.url," -> ").concat(d.url,")")),this.updateIsPreparingToJoin(!1),Promise.reject();this.validateProperties(d),this.properties=I(I({},this.properties),d)}return d.showLocalVideo!==void 0&&(this._callObjectMode?console.error("showLocalVideo is not available in callObject mode"):this._showLocalVideo=!!d.showLocalVideo),d.showParticipantsBar!==void 0&&(this._callObjectMode?console.error("showParticipantsBar is not available in callObject mode"):this._showParticipantsBar=!!d.showParticipantsBar),this._callState===He||this._callState===_r?(console.warn("already joined meeting, call leave() before joining again"),void this.updateIsPreparingToJoin(!1)):(this._updateCallState(_r,!1),this.emitDailyJSEvent({action:yl}),this._preloadCache.inputSettings=this._prepInputSettingsForSharing(this._inputSettings||{},!1),this.sendMessageToCallMachine({action:"join-meeting",properties:ct(this.properties,this.callClientId),preloadCache:ct(this._preloadCache,this.callClientId)}),new Promise(function(p,g){o._joinedCallback=function(S,M){if(o._callState!==Le){if(o._updateCallState(He),S)for(var O in S){if(o._callObjectMode){var P=o._callMachine().store;Ns(S[O],P),Fs(S[O],P),Us(S[O],o._participants[O],P)}o._participants[O]=I({},S[O]),o.toggleParticipantAudioBasedOnNativeAudioFocus()}u&&o.loadCss(o.properties),p(S)}else g(M)}}))}),function(){return R.apply(this,arguments)})},{key:"leave",value:(x=L(function*(){var o=this;return this._testCallInProgress&&this.stopTestCallQuality(),new Promise(function(d){o._callState===qe||o._callState===Le?d():o._callObjectLoader&&!o._callObjectLoader.loaded?(o._callObjectLoader.cancel(),o._updateCallState(qe),o.resetMeetingDependentVars(),o.emitDailyJSEvent({action:qe}),d()):(o._resolveLeave=d,o.sendMessageToCallMachine({action:"leave-meeting"}))})}),function(){return x.apply(this,arguments)})},{key:"startScreenShare",value:(j=L(function*(){var o=this,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(nn(this._callMachineInitialized,"startScreenShare()"),d.screenVideoSendSettings&&this._validateVideoSendSettings("screenVideo",d.screenVideoSendSettings),d.mediaStream&&(this._sharedTracks.screenMediaStream=d.mediaStream,d.mediaStream=je),typeof DailyNativeUtils<"u"&&DailyNativeUtils.isIOS!==void 0&&DailyNativeUtils.isIOS){var u=this.nativeUtils();if(yield u.isScreenBeingCaptured())return void this.emitDailyJSEvent({action:ks,type:"screen-share-error",errorMsg:"Could not start the screen sharing. The screen is already been captured!"});u.setSystemScreenCaptureStartCallback(function(){u.setSystemScreenCaptureStartCallback(null),o.sendMessageToCallMachine({action:Cs,captureOptions:d})}),u.presentSystemScreenCapturePrompt()}else this.sendMessageToCallMachine({action:Cs,captureOptions:d})}),function(){return j.apply(this,arguments)})},{key:"stopScreenShare",value:function(){nn(this._callMachineInitialized,"stopScreenShare()"),this.sendMessageToCallMachine({action:"local-screen-stop"})}},{key:"startRecording",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},d=o.type;if(d&&d!=="cloud"&&d!=="raw-tracks"&&d!=="local")throw new Error("invalid type: ".concat(d,", allowed values 'cloud', 'raw-tracks', or 'local'"));this.sendMessageToCallMachine(I({action:"local-recording-start"},o))}},{key:"updateRecording",value:function(o){var d=o.layout,u=d===void 0?{preset:"default"}:d,p=o.instanceId;this.sendMessageToCallMachine({action:"daily-method-update-recording",layout:u,instanceId:p})}},{key:"stopRecording",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(I({action:"local-recording-stop"},o))}},{key:"startLiveStreaming",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(I({action:"daily-method-start-live-streaming"},o))}},{key:"updateLiveStreaming",value:function(o){var d=o.layout,u=d===void 0?{preset:"default"}:d,p=o.instanceId;this.sendMessageToCallMachine({action:"daily-method-update-live-streaming",layout:u,instanceId:p})}},{key:"addLiveStreamingEndpoints",value:function(o){var d=o.endpoints,u=o.instanceId;this.sendMessageToCallMachine({action:Ms,endpointsOp:ou,endpoints:d,instanceId:u})}},{key:"removeLiveStreamingEndpoints",value:function(o){var d=o.endpoints,u=o.instanceId;this.sendMessageToCallMachine({action:Ms,endpointsOp:au,endpoints:d,instanceId:u})}},{key:"stopLiveStreaming",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(I({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."),Vo()&&o.noAutoDefaultDeviceChange&&console.warn("noAutoDefaultDeviceChange is not supported on Android, and will be ignored.")}},{key:"validateSimulcastEncodings",value:function(o){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,u=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(!ro(o.length,1,3))throw new Error("encodings must be an Array with between 1 to ".concat(3," layers"));for(var p=0;p<o.length;p++){var g=o[p];for(var S in this._validateEncodingLayerHasValidProperties(g),g)if(Xn.includes(S)){if(typeof g[S]!="number")throw new Error("".concat(S," must be a number"));if(d){var M=d[S],O=M.min,P=M.max;if(!ro(g[S],O,P))throw new Error("".concat(S," value not in range. valid range: ").concat(O," to ").concat(P))}}else if(!["active","scalabilityMode"].includes(S))throw new Error("Invalid key ".concat(S,", valid keys are:")+Object.values(Xn));if(u&&!g.hasOwnProperty("maxBitrate"))throw new Error("maxBitrate is not specified")}}}},{key:"startRemoteMediaPlayer",value:(A=L(function*(o){var d=this,u=o.url,p=o.settings,g=p===void 0?{state:wr.PLAY}:p;try{(function(S){if(typeof S!="string")throw new Error('url parameter must be "string" type')})(u),no(g),function(S){for(var M in S)if(!Ys.includes(M))throw new Error("Invalid key ".concat(M,", valid keys are: ").concat(Ys));S.simulcastEncodings&&this.validateSimulcastEncodings(S.simulcastEncodings,Yo,!0)}(g)}catch(S){throw console.error("invalid argument Error: ".concat(S)),console.error(`startRemoteMediaPlayer arguments must be of the form:
|
|
12
|
+
`),typeof c=="string"||c instanceof Uint8Array)i(c);else{let l;try{l=JSON.stringify(c)}catch{l=JSON.stringify(Pe(c))}i(l)}}return typeof r=="string"?r:function(s){const a=s.reduce((f,h)=>f+h.length,0),c=new Uint8Array(a);let l=0;for(const f of s)c.set(f,l),l+=f.length;return c}(r)}function pc(t){const e=typeof t.data=="string"?hr(t.data):t.data;return[me({type:"attachment",length:e.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType}),e]}const mc={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",statsd:"metric_bucket",raw_security:"security"};function Ui(t){return mc[t]}function Io(t){if(!t||!t.sdk)return;const{name:e,version:n}=t.sdk;return{name:e,version:n}}function gc(t,e,n,r){const i=Io(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,f,h){const v=c.sdkProcessingMetadata&&c.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:c.event_id,sent_at:new Date().toISOString(),...l&&{sdk:l},...!!f&&h&&{dsn:gn(h)},...v&&{trace:me({...v})}}}(t,i,r,e);return delete t.sdkProcessingMetadata,jt(a,[[{type:s},t]])}function pr(t,e,n,r=0){return new pe((i,s)=>{const a=t[r];if(e===null||typeof a!="function")i(e);else{const c=a({...e},n);W&&a.id&&c===null&&N.log(`Event processor "${a.id}" dropped event`),Mn(c)?c.then(l=>pr(t,l,n,r+1).then(i)).then(null,s):pr(t,c,n,r+1).then(i).then(null,s)}})}let Ht,Bi,Fn;function vc(t,e){const{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:s}=e;(function(a,c){const{extra:l,tags:f,user:h,contexts:v,level:E,transactionName:k}=c,b=me(l);b&&Object.keys(b).length&&(a.extra={...b,...a.extra});const m=me(f);m&&Object.keys(m).length&&(a.tags={...m,...a.tags});const y=me(h);y&&Object.keys(y).length&&(a.user={...y,...a.user});const w=me(v);w&&Object.keys(w).length&&(a.contexts={...w,...a.contexts}),E&&(a.level=E),k&&a.type!=="transaction"&&(a.transaction=k)})(t,e),r&&function(a,c){a.contexts={trace:oc(c),...a.contexts},a.sdkProcessingMetadata={dynamicSamplingContext:lc(c),...a.sdkProcessingMetadata};const l=Po(c),f=qr(l).description;f&&!a.transaction&&a.type==="transaction"&&(a.transaction=f)}(t,r),function(a,c){a.fingerprint=a.fingerprint?Array.isArray(a.fingerprint)?a.fingerprint:[a.fingerprint]:[],c&&(a.fingerprint=a.fingerprint.concat(c)),a.fingerprint&&!a.fingerprint.length&&delete a.fingerprint}(t,n),function(a,c){const l=[...a.breadcrumbs||[],...c];a.breadcrumbs=l.length?l:void 0}(t,i),function(a,c){a.sdkProcessingMetadata={...a.sdkProcessingMetadata,...c}}(t,s)}function Vi(t,e){const{extra:n,tags:r,user:i,contexts:s,level:a,sdkProcessingMetadata:c,breadcrumbs:l,fingerprint:f,eventProcessors:h,attachments:v,propagationContext:E,transactionName:k,span:b}=e;Wt(t,"extra",n),Wt(t,"tags",r),Wt(t,"user",i),Wt(t,"contexts",s),t.sdkProcessingMetadata=On(t.sdkProcessingMetadata,c,2),a&&(t.level=a),k&&(t.transactionName=k),b&&(t.span=b),l.length&&(t.breadcrumbs=[...t.breadcrumbs,...l]),f.length&&(t.fingerprint=[...t.fingerprint,...f]),h.length&&(t.eventProcessors=[...t.eventProcessors,...h]),v.length&&(t.attachments=[...t.attachments,...v]),t.propagationContext={...t.propagationContext,...E}}function Wt(t,e,n){t[e]=On(t[e],n,1)}function yc(t,e,n,r,i,s){const{normalizeDepth:a=3,normalizeMaxBreadth:c=1e3}=t,l={...e,event_id:e.event_id||n.event_id||ge(),timestamp:e.timestamp||Rt()},f=n.integrations||t.integrations.map(b=>b.name);(function(b,m){const{environment:y,release:w,dist:M,maxValueLength:A=250}=m;b.environment=b.environment||y||$r,!b.release&&w&&(b.release=w),!b.dist&&M&&(b.dist=M),b.message&&(b.message=ut(b.message,A));const j=b.exception&&b.exception.values&&b.exception.values[0];j&&j.value&&(j.value=ut(j.value,A));const x=b.request;x&&x.url&&(x.url=ut(x.url,A))})(l,t),function(b,m){m.length>0&&(b.sdk=b.sdk||{},b.sdk.integrations=[...b.sdk.integrations||[],...m])}(l,f),i&&i.emit("applyFrameMetadata",e),e.type===void 0&&function(b,m){const y=function(w){const M=$._sentryDebugIds;if(!M)return{};const A=Object.keys(M);return Fn&&A.length===Bi||(Bi=A.length,Fn=A.reduce((j,x)=>{Ht||(Ht={});const R=Ht[x];if(R)j[R[0]]=R[1];else{const J=w(x);for(let X=J.length-1;X>=0;X--){const Oe=J[X],ot=Oe&&Oe.filename,at=M[x];if(ot&&at){j[ot]=at,Ht[x]=[ot,at];break}}}return j},{})),Fn}(m);try{b.exception.values.forEach(w=>{w.stacktrace.frames.forEach(M=>{y&&M.filename&&(M.debug_id=y[M.filename])})})}catch{}}(l,t.stackParser);const h=function(b,m){if(!m)return b;const y=b?b.clone():new Be;return y.update(m),y}(r,n.captureContext);n.mechanism&&ht(l,n.mechanism);const v=i?i.getEventProcessors():[],E=hn("globalScope",()=>new Be).getScopeData();s&&Vi(E,s.getScopeData()),h&&Vi(E,h.getScopeData());const k=[...n.attachments||[],...E.attachments];return k.length&&(n.attachments=k),vc(l,E),pr([...v,...E.eventProcessors],l,n).then(b=>(b&&function(m){const y={};try{m.exception.values.forEach(M=>{M.stacktrace.frames.forEach(A=>{A.debug_id&&(A.abs_path?y[A.abs_path]=A.debug_id:A.filename&&(y[A.filename]=A.debug_id),delete A.debug_id)})})}catch{}if(Object.keys(y).length===0)return;m.debug_meta=m.debug_meta||{},m.debug_meta.images=m.debug_meta.images||[];const w=m.debug_meta.images;Object.entries(y).forEach(([M,A])=>{w.push({type:"sourcemap",code_file:M,debug_id:A})})}(b),typeof a=="number"&&a>0?function(m,y,w){if(!m)return null;const M={...m,...m.breadcrumbs&&{breadcrumbs:m.breadcrumbs.map(A=>({...A,...A.data&&{data:Pe(A.data,y,w)}}))},...m.user&&{user:Pe(m.user,y,w)},...m.contexts&&{contexts:Pe(m.contexts,y,w)},...m.extra&&{extra:Pe(m.extra,y,w)}};return m.contexts&&m.contexts.trace&&M.contexts&&(M.contexts.trace=m.contexts.trace,m.contexts.trace.data&&(M.contexts.trace.data=Pe(m.contexts.trace.data,y,w))),m.spans&&(M.spans=m.spans.map(A=>({...A,...A.data&&{data:Pe(A.data,y,w)}}))),m.contexts&&m.contexts.flags&&M.contexts&&(M.contexts.flags=Pe(m.contexts.flags,3,w)),M}(b,a,c):b))}function Ji(t,e){return st().captureEvent(t,e)}function qi(t){const e=te(),n=Dt(),r=st(),{release:i,environment:s=$r}=e&&e.getOptions()||{},{userAgent:a}=$.navigator||{},c=Ya({release:i,environment:s,user:r.getUser()||n.getUser(),...a&&{userAgent:a},...t}),l=n.getSession();return l&&l.status==="ok"&&pt(l,{status:"exited"}),Lo(),n.setSession(c),r.setSession(c),c}function Lo(){const t=Dt(),e=st(),n=e.getSession()||t.getSession();n&&function(r,i){let s={};r.status==="ok"&&(s={status:"exited"}),pt(r,s)}(n),Ro(),t.setSession(),e.setSession()}function Ro(){const t=Dt(),e=st(),n=te(),r=e.getSession()||t.getSession();r&&n&&n.captureSession(r)}function $i(t=!1){t?Lo():Ro()}function bc(t,e,n){return e||`${function(r){return`${function(i){const s=i.protocol?`${i.protocol}:`:"",a=i.port?`:${i.port}`:"";return`${s}//${i.host}${a}${i.path?`/${i.path}`:""}/api/`}(r)}${r.projectId}/envelope/`}(t)}?${function(r,i){const s={sentry_version:"7"};return r.publicKey&&(s.sentry_key=r.publicKey),i&&(s.sentry_client=`${i.name}/${i.version}`),new URLSearchParams(s).toString()}(t,n)}`}const zi=[];function Hi(t,e){for(const n of e)n&&n.afterAllSetup&&n.afterAllSetup(t)}function Wi(t,e,n){if(n[e.name])W&&N.log(`Integration skipped because it was already installed: ${e.name}`);else{if(n[e.name]=e,zi.indexOf(e.name)===-1&&typeof e.setupOnce=="function"&&(e.setupOnce(),zi.push(e.name)),e.setup&&typeof e.setup=="function"&&e.setup(t),typeof e.preprocessEvent=="function"){const r=e.preprocessEvent.bind(e);t.on("preprocessEvent",(i,s)=>r(i,s,t))}if(typeof e.processEvent=="function"){const r=e.processEvent.bind(e),i=Object.assign((s,a)=>r(s,a,t),{id:e.name});t.addEventProcessor(i)}W&&N.log(`Integration installed: ${e.name}`)}}class be extends Error{constructor(e,n="warn"){super(e),this.message=e,this.logLevel=n}}const Gi="Not capturing exception because it's already been captured.";class _c{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=dc(e.dsn):W&&N.warn("No DSN provided, client will not send events."),this._dsn){const r=bc(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:r})}const n=["enableTracing","tracesSampleRate","tracesSampler"].find(r=>r in e&&e[r]==null);n&&Lt(()=>{console.warn(`[Sentry] Deprecation warning: \`${n}\` is set to undefined, which leads to tracing being enabled. In v9, a value of \`undefined\` will result in tracing being disabled.`)})}captureException(e,n,r){const i=ge();if(Oi(e))return W&&N.log(Gi),i;const s={event_id:i,...n};return this._process(this.eventFromException(e,s).then(a=>this._captureEvent(a,s,r))),s.event_id}captureMessage(e,n,r,i){const s={event_id:ge(),...r},a=Fr(e)?e:String(e),c=ar(e)?this.eventFromMessage(a,n,s):this.eventFromException(e,s);return this._process(c.then(l=>this._captureEvent(l,s,i))),s.event_id}captureEvent(e,n,r){const i=ge();if(n&&n.originalException&&Oi(n.originalException))return W&&N.log(Gi),i;const s={event_id:i,...n},a=(e.sdkProcessingMetadata||{}).capturedSpanScope;return this._process(this._captureEvent(e,s,a||r)),s.event_id}captureSession(e){typeof e.release!="string"?W&&N.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),pt(e,{init:!1}))}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.emit("flush"),this._isClientDoneProcessing(e).then(r=>n.flush(e).then(i=>r&&i))):tt(!0)}close(e){return this.flush(e).then(n=>(this.getOptions().enabled=!1,this.emit("close"),n))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){const n=this._integrations[e.name];Wi(this,e,this._integrations),n||Hi(this,[e])}sendEvent(e,n={}){this.emit("beforeSendEvent",e,n);let r=gc(e,this._dsn,this._options._metadata,this._options.tunnel);for(const s of n.attachments||[])r=fc(r,pc(s));const i=this.sendEnvelope(r);i&&i.then(s=>this.emit("afterSendEvent",e,s),null)}sendSession(e){const n=function(r,i,s,a){const c=Io(s);return jt({sent_at:new Date().toISOString(),...c&&{sdk:c},...!!a&&i&&{dsn:gn(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=typeof r=="number"?r:1,s=`${e}:${n}`;W&&N.log(`Recording outcome: "${s}"${i>1?` (${i} times)`:""}`),this._outcomes[s]=(this._outcomes[s]||0)+i}}on(e,n){const r=this._hooks[e]=this._hooks[e]||[];return r.push(n),()=>{const i=r.indexOf(n);i>-1&&r.splice(i,1)}}emit(e,...n){const r=this._hooks[e];r&&r.forEach(i=>i(...n))}sendEnvelope(e){return this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport?this._transport.send(e).then(null,n=>(W&&N.error("Error while sending envelope:",n),n)):(W&&N.error("Transport disabled"),tt({}))}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=function(n,r){const i={};return r.forEach(s=>{s&&Wi(n,s,i)}),i}(this,e),Hi(this,e)}_updateSessionFromEvent(e,n){let r=n.level==="fatal",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)&&(pt(e,{...r&&{status:"crashed"},errors:e.errors||Number(i||r)}),this.captureSession(e))}_isClientDoneProcessing(e){return new pe(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._transport!==void 0}_prepareEvent(e,n,r=st(),i=Dt()){const s=this.getOptions(),a=Object.keys(this._integrations);return!n.integrations&&a.length>0&&(n.integrations=a),this.emit("preprocessEvent",e,n),e.type||i.setLastEventId(e.event_id||n.event_id),yc(s,e,n,r,this,i).then(c=>{if(c===null)return c;c.contexts={trace:nc(r),...c.contexts};const l=function(f,h){const v=h.getPropagationContext();return v.dsc||xo(v.traceId,f)}(this,r);return c.sdkProcessingMetadata={dynamicSamplingContext:l,...c.sdkProcessingMetadata},c})}_captureEvent(e,n={},r){return this._processEvent(e,n,r).then(i=>i.event_id,i=>{W&&(i instanceof be&&i.logLevel==="log"?N.log(i.message):N.warn(i))})}_processEvent(e,n,r){const i=this.getOptions(),{sampleRate:s}=i,a=Qi(e),c=Ki(e),l=e.type||"error",f=`before send for type \`${l}\``,h=s===void 0?void 0:function(k){if(typeof k=="boolean")return Number(k);const b=typeof k=="string"?parseFloat(k):k;if(!(typeof b!="number"||isNaN(b)||b<0||b>1))return b;W&&N.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(k)} of type ${JSON.stringify(typeof k)}.`)}(s);if(c&&typeof h=="number"&&Math.random()>h)return this.recordDroppedEvent("sample_rate","error",e),mn(new be(`Discarding event because it's not included in the random sample (sampling rate = ${s})`,"log"));const v=l==="replay_event"?"replay":l,E=(e.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this._prepareEvent(e,n,r,E).then(k=>{if(k===null)throw this.recordDroppedEvent("event_processor",v,e),new be("An event processor returned `null`, will not send event.","log");if(n.data&&n.data.__sentry__===!0)return k;const b=function(m,y,w,M){const{beforeSend:A,beforeSendTransaction:j,beforeSendSpan:x}=y;if(Ki(w)&&A)return A(w,M);if(Qi(w)){if(w.spans&&x){const R=[];for(const J of w.spans){const X=x(J);X?R.push(X):(cc(),m.recordDroppedEvent("before_send","span"))}w.spans=R}if(j){if(w.spans){const R=w.spans.length;w.sdkProcessingMetadata={...w.sdkProcessingMetadata,spanCountBeforeProcessing:R}}return j(w,M)}}return w}(this,i,k,n);return function(m,y){const w=`${y} must return \`null\` or a valid event.`;if(Mn(m))return m.then(M=>{if(!ft(M)&&M!==null)throw new be(w);return M},M=>{throw new be(`${y} rejected with ${M}`)});if(!ft(m)&&m!==null)throw new be(w);return m}(b,f)}).then(k=>{if(k===null){if(this.recordDroppedEvent("before_send",v,e),a){const y=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",y)}throw new be(`${f} returned \`null\`, will not send event.`,"log")}const b=r&&r.getSession();if(!a&&b&&this._updateSessionFromEvent(b,k),a){const y=(k.sdkProcessingMetadata&&k.sdkProcessingMetadata.spanCountBeforeProcessing||0)-(k.spans?k.spans.length:0);y>0&&this.recordDroppedEvent("before_send","span",y)}const m=k.transaction_info;if(a&&m&&k.transaction!==e.transaction){const y="custom";k.transaction_info={...m,source:y}}return this.sendEvent(k,n),k}).then(null,k=>{throw k instanceof be?k:(this.captureException(k,{data:{__sentry__:!0},originalException:k}),new be(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
13
|
+
Reason: ${k}`))})}_process(e){this._numProcessing++,e.then(n=>(this._numProcessing--,n),n=>(this._numProcessing--,n))}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.entries(e).map(([n,r])=>{const[i,s]=n.split(":");return{reason:i,category:s,quantity:r}})}_flushOutcomes(){W&&N.log("Flushing outcomes...");const e=this._clearOutcomes();if(e.length===0)return void(W&&N.log("No outcomes to send"));if(!this._dsn)return void(W&&N.log("No dsn provided, will not send outcomes"));W&&N.log("Sending outcomes:",e);const n=(r=e,jt((i=this._options.tunnel&&gn(this._dsn))?{dsn:i}:{},[[{type:"client_report"},{timestamp:s||Rt(),discarded_events:r}]]));var r,i,s;this.sendEnvelope(n)}}function Ki(t){return t.type===void 0}function Qi(t){return t.type==="transaction"}function wc(t){const e=[];function n(r){return e.splice(e.indexOf(r),1)[0]||Promise.resolve(void 0)}return{$:e,add:function(r){if(!(t===void 0||e.length<t))return mn(new be("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 pe((i,s)=>{let a=e.length;if(!a)return i(!0);const c=setTimeout(()=>{r&&r>0&&i(!1)},r);e.forEach(l=>{tt(l).then(()=>{--a||(clearTimeout(c),i(!0))},s)})})}}}function Sc(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,f,,,h]=c.split(":",5),v=parseInt(l,10),E=1e3*(isNaN(v)?60:v);if(f)for(const k of f.split(";"))k==="metric_bucket"&&h&&!h.split(";").includes("custom")||(i[k]=r+E);else i.all=r+E}else a?i.all=r+function(c,l=Date.now()){const f=parseInt(`${c}`,10);if(!isNaN(f))return 1e3*f;const h=Date.parse(`${c}`);return isNaN(h)?6e4:h-l}(a,r):e===429&&(i.all=r+6e4);return i}function kc(t,e,n=wc(t.bufferSize||64)){let r={};return{send:function(i){const s=[];if(Fi(i,(l,f)=>{const h=Ui(f);if(function(v,E,k=Date.now()){return function(b,m){return b[m]||b.all||0}(v,E)>k}(r,h)){const v=Xi(l,f);t.recordDroppedEvent("ratelimit_backoff",h,v)}else s.push(l)}),s.length===0)return tt({});const a=jt(i[0],s),c=l=>{Fi(a,(f,h)=>{const v=Xi(f,h);t.recordDroppedEvent(l,Ui(h),v)})};return n.add(()=>e({body:hc(a)}).then(l=>(l.statusCode!==void 0&&(l.statusCode<200||l.statusCode>=300)&&W&&N.warn(`Sentry responded with status code ${l.statusCode} to sent event.`),r=Sc(r,l),l),l=>{throw c("network_error"),l})).then(l=>l,l=>{if(l instanceof be)return W&&N.error("Skipped sending event because buffer is full."),c("queue_overflow"),tt({});throw l})},flush:i=>n.drain(i)}}function Xi(t,e){if(e==="event"||e==="transaction")return Array.isArray(t)?t[1]:void 0}const Ec=100;function qe(t,e){const n=te(),r=Dt();if(!n)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:s=Ec}=n.getOptions();if(s<=0)return;const a={timestamp:Rt(),...t},c=i?Lt(()=>i(a,e)):a;c!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",c,e),r.addBreadcrumb(c,s))}let Yi;const Zi=new WeakMap,Tc=()=>({name:"FunctionToString",setupOnce(){Yi=Function.prototype.toString;try{Function.prototype.toString=function(...t){const e=Br(this),n=Zi.has(te())&&e!==void 0?e:this;return Yi.apply(n,t)}}catch{}},setup(t){Zi.set(t,!0)}}),Cc=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,"undefined is not an object (evaluating 'a.L')",`can't redefine non-configurable property "solana"`,"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler",/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/],Mc=(t={})=>({name:"InboundFilters",processEvent(e,n,r){const i=r.getOptions(),s=function(a={},c={}){return{allowUrls:[...a.allowUrls||[],...c.allowUrls||[]],denyUrls:[...a.denyUrls||[],...c.denyUrls||[]],ignoreErrors:[...a.ignoreErrors||[],...c.ignoreErrors||[],...a.disableErrorDefaults?[]:Cc],ignoreTransactions:[...a.ignoreTransactions||[],...c.ignoreTransactions||[]],ignoreInternal:a.ignoreInternal===void 0||a.ignoreInternal}}(t,i);return function(a,c){return c.ignoreInternal&&function(l){try{return l.exception.values[0].type==="SentryError"}catch{}return!1}(a)?(W&&N.warn(`Event dropped due to being internal Sentry Error.
|
|
14
|
+
Event: ${Fe(a)}`),!0):function(l,f){return l.type||!f||!f.length?!1:function(h){const v=[];h.message&&v.push(h.message);let E;try{E=h.exception.values[h.exception.values.length-1]}catch{}return E&&E.value&&(v.push(E.value),E.type&&v.push(`${E.type}: ${E.value}`)),v}(l).some(h=>zt(h,f))}(a,c.ignoreErrors)?(W&&N.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
15
|
+
Event: ${Fe(a)}`),!0):function(l){return l.type||!l.exception||!l.exception.values||l.exception.values.length===0?!1:!l.message&&!l.exception.values.some(f=>f.stacktrace||f.type&&f.type!=="Error"||f.value)}(a)?(W&&N.warn(`Event dropped due to not having an error message, error type or stacktrace.
|
|
16
|
+
Event: ${Fe(a)}`),!0):function(l,f){if(l.type!=="transaction"||!f||!f.length)return!1;const h=l.transaction;return!!h&&zt(h,f)}(a,c.ignoreTransactions)?(W&&N.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
17
|
+
Event: ${Fe(a)}`),!0):function(l,f){if(!f||!f.length)return!1;const h=Gt(l);return!!h&&zt(h,f)}(a,c.denyUrls)?(W&&N.warn(`Event dropped due to being matched by \`denyUrls\` option.
|
|
18
|
+
Event: ${Fe(a)}.
|
|
19
|
+
Url: ${Gt(a)}`),!0):function(l,f){if(!f||!f.length)return!0;const h=Gt(l);return!h||zt(h,f)}(a,c.allowUrls)?!1:(W&&N.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
20
|
+
Event: ${Fe(a)}.
|
|
21
|
+
Url: ${Gt(a)}`),!0)}(e,s)?null:e}});function Gt(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 W&&N.error(`Cannot extract url for event ${Fe(t)}`),null}}function Oc(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,f;c&&(s.exception.values=(l=mr(t,e,i,a.originalException,r,s.exception.values,c,0),f=n,l.map(h=>(h.value&&(h.value=ut(h.value,f)),h))))}function mr(t,e,n,r,i,s,a,c){if(s.length>=n+1)return s;let l=[...s];if(Ze(r[i],Error)){es(a,c);const f=t(e,r[i]),h=l.length;ts(f,i,h,c),l=mr(t,e,n,r[i],i,[f,...l],f,h)}return Array.isArray(r.errors)&&r.errors.forEach((f,h)=>{if(Ze(f,Error)){es(a,c);const v=t(e,f),E=l.length;ts(v,`errors[${h}]`,E,c),l=mr(t,e,n,f,i,[v,...l],v,E)}}),l}function es(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,...t.type==="AggregateError"&&{is_exception_group:!0},exception_id:e}}function ts(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 Un(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}}function Ac(){"console"in $&&or.forEach(function(t){t in $.console&&ue($.console,t,function(e){return pn[t]=e,function(...n){_e("console",{args:n,level:t});const r=pn[t];r&&r.apply($.console,n)}})})}function Pc(t){return t==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(t)?t:"log"}const xc=()=>{let t;return{name:"Dedupe",processEvent(e){if(e.type)return e;try{if(function(n,r){return r?!!(function(i,s){const a=i.message,c=s.message;return!(!a&&!c||a&&!c||!a&&c||a!==c||!rs(i,s)||!ns(i,s))}(n,r)||function(i,s){const a=is(s),c=is(i);return!(!a||!c||a.type!==c.type||a.value!==c.value||!rs(i,s)||!ns(i,s))}(n,r)):!1}(e,t))return W&&N.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return t=e}}};function ns(t,e){let n=Si(t),r=Si(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 rs(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 is(t){return t.exception&&t.exception.values&&t.exception.values[0]}function ss(t){return t===void 0?void 0:t>=400&&t<500?"warning":t>=500?"error":void 0}const Bn=$;function gr(t){return t&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function jc(){if(typeof EdgeRuntime=="string")return!0;if(!function(){if(!("fetch"in Bn))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}())return!1;if(gr(Bn.fetch))return!0;let t=!1;const e=Bn.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=gr(n.contentWindow.fetch)),e.head.removeChild(n)}catch(n){it&&N.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return t}function Ic(t,e){const n="fetch";Qe(n,t),Xe(n,()=>function(r,i=!1){i&&!jc()||ue($,"fetch",function(s){return function(...a){const c=new Error,{method:l,url:f}=function(v){if(v.length===0)return{method:"GET",url:""};if(v.length===2){const[k,b]=v;return{url:os(k),method:vr(b,"method")?String(b.method).toUpperCase():"GET"}}const E=v[0];return{url:os(E),method:vr(E,"method")?String(E.method).toUpperCase():"GET"}}(a),h={args:a,fetchData:{method:l,url:f},startTimestamp:1e3*Ie(),virtualError:c};return r||_e("fetch",{...h}),s.apply($,a).then(async v=>(r?r(v):_e("fetch",{...h,endTimestamp:1e3*Ie(),response:v}),v),v=>{throw _e("fetch",{...h,endTimestamp:1e3*Ie(),error:v}),Nr(v)&&v.stack===void 0&&(v.stack=c.stack,et(v,"framesToPop",1)),v})}})}(void 0,e))}function vr(t,e){return!!t&&typeof t=="object"&&!!t[e]}function os(t){return typeof t=="string"?t:t?vr(t,"url")?t.url:t.toString?t.toString():"":""}const Kt=$,Z=$;let yr=0;function as(){return yr>0}function gt(t,e={}){if(!function(r){return typeof r=="function"}(t))return t;try{const r=t.__sentry_wrapped__;if(r)return typeof r=="function"?r:t;if(Br(t))return t}catch{return t}const n=function(...r){try{const i=r.map(s=>gt(s,e));return t.apply(this,i)}catch(i){throw yr++,setTimeout(()=>{yr--}),function(...s){const a=Jr(Tn());if(s.length===2){const[c,l]=s;return c?a.withSetScope(c,l):a.withScope(l)}a.withScope(s[0])}(s=>{var a;s.addEventProcessor(c=>(e.mechanism&&(lr(c,void 0),ht(c,e.mechanism)),c.extra={...c.extra,arguments:r},c)),a=i,st().captureException(a,void 0)}),i}};try{for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}catch{}Mo(n,t),et(t,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get:()=>t.name})}catch{}return n}const An=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function zr(t,e){const n=Hr(t,e),r={type:Dc(e),value:Nc(e)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function Lc(t,e,n,r){const i=te(),s=i&&i.getOptions().normalizeDepth,a=function(f){for(const h in f)if(Object.prototype.hasOwnProperty.call(f,h)){const v=f[h];if(v instanceof Error)return v}}(e),c={__serialized__:jo(e,s)};if(a)return{exception:{values:[zr(t,a)]},extra:c};const l={exception:{values:[{type:Cn(e)?e.constructor.name:r?"UnhandledRejection":"Error",value:Fc(e,{isUnhandledRejection:r})}]},extra:c};if(n){const f=Hr(t,n);f.length&&(l.exception.values[0].stacktrace={frames:f})}return l}function Vn(t,e){return{exception:{values:[zr(t,e)]}}}function Hr(t,e){const n=e.stacktrace||e.stack||"",r=function(s){return s&&Rc.test(s.message)?1:0}(e),i=function(s){return typeof s.framesToPop=="number"?s.framesToPop:0}(e);try{return t(n,r,i)}catch{}return[]}const Rc=/Minified React error #\d+;/i;function Do(t){return typeof WebAssembly<"u"&&WebAssembly.Exception!==void 0&&t instanceof WebAssembly.Exception}function Dc(t){const e=t&&t.name;return!e&&Do(t)?t.message&&Array.isArray(t.message)&&t.message.length==2?t.message[0]:"WebAssembly.Exception":e}function Nc(t){const e=t&&t.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:Do(t)&&Array.isArray(t.message)&&t.message.length==2?t.message[1]:e:"No error message"}function br(t,e,n,r,i){let s;if(Eo(e)&&e.error)return Vn(t,e.error);if(Ei(e)||vt(e,"DOMException")){const a=e;if("stack"in e)s=Vn(t,e);else{const c=a.name||(Ei(a)?"DOMError":"DOMException"),l=a.message?`${c}: ${a.message}`:c;s=_r(t,l,n,r),lr(s,l)}return"code"in a&&(s.tags={...s.tags,"DOMException.code":`${a.code}`}),s}return Nr(e)?Vn(t,e):ft(e)||Cn(e)?(s=Lc(t,e,n,i),ht(s,{synthetic:!0}),s):(s=_r(t,e,n,r),lr(s,`${e}`),ht(s,{synthetic:!0}),s)}function _r(t,e,n,r){const i={};if(r&&n){const s=Hr(t,n);s.length&&(i.exception={values:[{value:e,stacktrace:{frames:s}}]}),ht(i,{synthetic:!0})}if(Fr(e)){const{__sentry_template_string__:s,__sentry_template_values__:a}=e;return i.logentry={message:s,params:a},i}return i.message=e,i}function Fc(t,{isUnhandledRejection:e}){const n=function(i,s=40){const a=Object.keys(Oo(i));a.sort();const c=a[0];if(!c)return"[object has no keys]";if(c.length>=s)return ut(c,s);for(let l=a.length;l>0;l--){const f=a.slice(0,l).join(", ");if(!(f.length>s))return l===a.length?f:ut(f,s)}return""}(t),r=e?"promise rejection":"exception";return Eo(t)?`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``:Cn(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}`}class Uc extends _c{constructor(e){const n={parentSpanIsAlwaysRootSpan:!0,...e};(function(r,i,s=[i],a="npm"){const c=r._metadata||{};c.sdk||(c.sdk={name:`sentry.javascript.${i}`,packages:s.map(l=>({name:`${a}:@sentry/${l}`,version:Ke})),version:Ke}),r._metadata=c})(n,"browser",["browser"],Z.SENTRY_SDK_SOURCE||"npm"),super(n),n.sendClientReports&&Z.document&&Z.document.addEventListener("visibilitychange",()=>{Z.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,n){return function(r,i,s,a){const c=br(r,i,s&&s.syntheticException||void 0,a);return ht(c),c.level="error",s&&s.event_id&&(c.event_id=s.event_id),tt(c)}(this._options.stackParser,e,n,this._options.attachStacktrace)}eventFromMessage(e,n="info",r){return function(i,s,a="info",c,l){const f=_r(i,s,c&&c.syntheticException||void 0,l);return f.level=a,c&&c.event_id&&(f.event_id=c.event_id),tt(f)}(this._options.stackParser,e,n,r,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled())return void(An&&N.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:gn(a)}};return jt(c,[function(f){return[{type:"user_report"},f]}(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)}}const Bc=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,oe=$;let cs,Jn,qn,Qt;function Vc(){if(!oe.document)return;const t=_e.bind(null,"dom"),e=ls(t,!0);oe.document.addEventListener("click",e,!1),oe.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(n=>{const r=oe[n],i=r&&r.prototype;i&&i.hasOwnProperty&&i.hasOwnProperty("addEventListener")&&(ue(i,"addEventListener",function(s){return function(a,c,l){if(a==="click"||a=="keypress")try{const f=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},h=f[a]=f[a]||{refCount:0};if(!h.handler){const v=ls(t);h.handler=v,s.call(this,a,v,l)}h.refCount++}catch{}return s.call(this,a,c,l)}}),ue(i,"removeEventListener",function(s){return function(a,c,l){if(a==="click"||a=="keypress")try{const f=this.__sentry_instrumentation_handlers__||{},h=f[a];h&&(h.refCount--,h.refCount<=0&&(s.call(this,a,h.handler,l),h.handler=void 0,delete f[a]),Object.keys(f).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return s.call(this,a,c,l)}}))})}function ls(t,e=!1){return n=>{if(!n||n._sentryCaptured)return;const r=function(s){try{return s.target}catch{return null}}(n);if(function(s,a){return s==="keypress"&&(!a||!a.tagName||a.tagName!=="INPUT"&&a.tagName!=="TEXTAREA"&&!a.isContentEditable)}(n.type,r))return;et(n,"_sentryCaptured",!0),r&&!r._sentryId&&et(r,"_sentryId",ge());const i=n.type==="keypress"?"input":n.type;(function(s){if(s.type!==Jn)return!1;try{if(!s.target||s.target._sentryId!==qn)return!1}catch{}return!0})(n)||(t({event:n,name:i,global:e}),Jn=n.type,qn=r?r._sentryId:void 0),clearTimeout(cs),cs=oe.setTimeout(()=>{qn=void 0,Jn=void 0},1e3)}}function No(t){const e="history";Qe(e,t),Xe(e,Jc)}function Jc(){if(!function(){const n=Kt.chrome,r=n&&n.app&&n.app.runtime,i="history"in Kt&&!!Kt.history.pushState&&!!Kt.history.replaceState;return!r&&i}())return;const t=oe.onpopstate;function e(n){return function(...r){const i=r.length>2?r[2]:void 0;if(i){const s=Qt,a=String(i);Qt=a,_e("history",{from:s,to:a})}return n.apply(this,r)}}oe.onpopstate=function(...n){const r=oe.location.href,i=Qt;if(Qt=r,_e("history",{from:i,to:r}),t)try{return t.apply(this,n)}catch{}},ue(oe.history,"pushState",e),ue(oe.history,"replaceState",e)}const sn={};function us(t){sn[t]=void 0}const Mt="__sentry_xhr_v3__";function qc(){if(!oe.XMLHttpRequest)return;const t=XMLHttpRequest.prototype;t.open=new Proxy(t.open,{apply(e,n,r){const i=new Error,s=1e3*Ie(),a=xe(r[0])?r[0].toUpperCase():void 0,c=function(f){if(xe(f))return f;try{return f.toString()}catch{}}(r[1]);if(!a||!c)return e.apply(n,r);n[Mt]={method:a,url:c,request_headers:{}},a==="POST"&&c.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const l=()=>{const f=n[Mt];if(f&&n.readyState===4){try{f.status_code=n.status}catch{}_e("xhr",{endTimestamp:1e3*Ie(),startTimestamp:s,xhr:n,virtualError:i})}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply:(f,h,v)=>(l(),f.apply(h,v))}):n.addEventListener("readystatechange",l),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(f,h,v){const[E,k]=v,b=h[Mt];return b&&xe(E)&&xe(k)&&(b.request_headers[E.toLowerCase()]=k),f.apply(h,v)}}),e.apply(n,r)}}),t.send=new Proxy(t.send,{apply(e,n,r){const i=n[Mt];return i?(r[0]!==void 0&&(i.body=r[0]),_e("xhr",{startTimestamp:1e3*Ie(),xhr:n}),e.apply(n,r)):e.apply(n,r)}})}function $c(t,e=function(n){const r=sn[n];if(r)return r;let i=oe[n];if(gr(i))return sn[n]=i.bind(oe);const s=oe.document;if(s&&typeof s.createElement=="function")try{const a=s.createElement("iframe");a.hidden=!0,s.head.appendChild(a);const c=a.contentWindow;c&&c[n]&&(i=c[n]),s.head.removeChild(a)}catch(a){Bc&&N.warn(`Could not create sandbox iframe for ${n} check, bailing to window.${n}: `,a)}return i&&(sn[n]=i.bind(oe))}("fetch")){let n=0,r=0;return kc(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};if(!e)return us("fetch"),mn("No fetch implementation available");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 us("fetch"),n-=s,r--,mn(c)}})}function $n(t,e,n,r){const i={filename:t,function:e==="<anonymous>"?We:e,in_app:!0};return n!==void 0&&(i.lineno=n),r!==void 0&&(i.colno=r),i}const zc=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Hc=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Wc=/\((\S*)(?::(\d+))(?::(\d+))\)/,Gc=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Kc=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Qc=function(...t){const e=t.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,i=0)=>{const s=[],a=n.split(`
|
|
22
|
+
`);for(let c=r;c<a.length;c++){const l=a[c];if(l.length>1024)continue;const f=bi.test(l)?l.replace(bi,"$1"):l;if(!f.match(/\S*Error: /)){for(const h of e){const v=h(f);if(v){s.push(v);break}}if(s.length>=50+i)break}}return function(c){if(!c.length)return[];const l=Array.from(c);return/sentryWrapped/.test($t(l).function||"")&&l.pop(),l.reverse(),_i.test($t(l).function||"")&&(l.pop(),_i.test($t(l).function||"")&&l.pop()),l.slice(0,50).map(f=>({...f,filename:f.filename||$t(l).filename,function:f.function||We}))}(s.slice(i))}}([30,t=>{const e=zc.exec(t);if(e){const[,r,i,s]=e;return $n(r,We,+i,+s)}const n=Hc.exec(t);if(n){if(n[2]&&n[2].indexOf("eval")===0){const s=Wc.exec(n[2]);s&&(n[2]=s[1],n[3]=s[2],n[4]=s[3])}const[r,i]=ds(n[1]||We,n[2]);return $n(i,r,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],[50,t=>{const e=Gc.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){const i=Kc.exec(e[3]);i&&(e[1]=e[1]||"eval",e[3]=i[1],e[4]=i[2],e[5]="")}let n=e[3],r=e[1]||We;return[r,n]=ds(r,n),$n(n,r,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}}]),ds=(t,e)=>{const n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:We,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},fs=1024,Xc=(t={})=>{const e={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...t};return{name:"Breadcrumbs",setup(n){var r;e.console&&function(i){const s="console";Qe(s,i),Xe(s,Ac)}(function(i){return function(s){if(te()!==i)return;const a={category:"console",data:{arguments:s.args,logger:"console"},level:Pc(s.level),message:Ti(s.args," ")};if(s.level==="assert"){if(s.args[0]!==!1)return;a.message=`Assertion failed: ${Ti(s.args.slice(1)," ")||"console.assert"}`,a.data.arguments=s.args.slice(1)}qe(a,{input:s.args,level:s.level})}}(n)),e.dom&&(r=function(i,s){return function(a){if(te()!==i)return;let c,l,f=typeof s=="object"?s.serializeAttribute:void 0,h=typeof s=="object"&&typeof s.maxStringLength=="number"?s.maxStringLength:void 0;h&&h>fs&&(An&&N.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${h} was configured. Sentry will use 1024 instead.`),h=fs),typeof f=="string"&&(f=[f]);try{const E=a.event,k=function(b){return!!b&&!!b.target}(E)?E.target:E;c=Co(k,{keyAttrs:f,maxStringLength:h}),l=function(b){if(!Ur.HTMLElement)return null;let m=b;for(let y=0;y<5;y++){if(!m)return null;if(m instanceof HTMLElement){if(m.dataset.sentryComponent)return m.dataset.sentryComponent;if(m.dataset.sentryElement)return m.dataset.sentryElement}m=m.parentNode}return null}(k)}catch{c="<unknown>"}if(c.length===0)return;const v={category:`ui.${a.name}`,message:c};l&&(v.data={"ui.component_name":l}),qe(v,{event:a.event,name:a.name,global:a.global})}}(n,e.dom),Qe("dom",r),Xe("dom",Vc)),e.xhr&&function(i){Qe("xhr",i),Xe("xhr",qc)}(function(i){return function(s){if(te()!==i)return;const{startTimestamp:a,endTimestamp:c}=s,l=s.xhr[Mt];if(!a||!c||!l)return;const{method:f,url:h,status_code:v,body:E}=l,k={method:f,url:h,status_code:v},b={xhr:s.xhr,input:E,startTimestamp:a,endTimestamp:c};qe({category:"xhr",data:k,type:"http",level:ss(v)},b)}}(n)),e.fetch&&Ic(function(i){return function(s){if(te()!==i)return;const{startTimestamp:a,endTimestamp:c}=s;if(c&&(!s.fetchData.url.match(/sentry_key/)||s.fetchData.method!=="POST"))if(s.error)qe({category:"fetch",data:s.fetchData,level:"error",type:"http"},{data:s.error,input:s.args,startTimestamp:a,endTimestamp:c});else{const l=s.response,f={...s.fetchData,status_code:l&&l.status},h={input:s.args,response:l,startTimestamp:a,endTimestamp:c};qe({category:"fetch",data:f,type:"http",level:ss(f.status_code)},h)}}}(n)),e.history&&No(function(i){return function(s){if(te()!==i)return;let a=s.from,c=s.to;const l=Un(Z.location.href);let f=a?Un(a):void 0;const h=Un(c);f&&f.path||(f=l),l.protocol===h.protocol&&l.host===h.host&&(c=h.relative),l.protocol===f.protocol&&l.host===f.host&&(a=f.relative),qe({category:"navigation",data:{from:a,to:c}})}}(n)),e.sentry&&n.on("beforeSendEvent",function(i){return function(s){te()===i&&qe({category:"sentry."+(s.type==="transaction"?"transaction":"event"),event_id:s.event_id,level:s.level,message:Fe(s)},{event:s})}}(n))}}},Yc=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],Zc=(t={})=>{const e={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...t};return{name:"BrowserApiErrors",setupOnce(){e.setTimeout&&ue(Z,"setTimeout",hs),e.setInterval&&ue(Z,"setInterval",hs),e.requestAnimationFrame&&ue(Z,"requestAnimationFrame",el),e.XMLHttpRequest&&"XMLHttpRequest"in Z&&ue(XMLHttpRequest.prototype,"send",tl);const n=e.eventTarget;n&&(Array.isArray(n)?n:Yc).forEach(nl)}}};function hs(t){return function(...e){const n=e[0];return e[0]=gt(n,{mechanism:{data:{function:Ue(t)},handled:!1,type:"instrument"}}),t.apply(this,e)}}function el(t){return function(e){return t.apply(this,[gt(e,{mechanism:{data:{function:"requestAnimationFrame",handler:Ue(t)},handled:!1,type:"instrument"}})])}}function tl(t){return function(...e){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(r=>{r in n&&typeof n[r]=="function"&&ue(n,r,function(i){const s={mechanism:{data:{function:r,handler:Ue(i)},handled:!1,type:"instrument"}},a=Br(i);return a&&(s.mechanism.data.handler=Ue(a)),gt(i,s)})}),t.apply(this,e)}}function nl(t){const e=Z[t],n=e&&e.prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(ue(n,"addEventListener",function(r){return function(i,s,a){try{typeof s.handleEvent=="function"&&(s.handleEvent=gt(s.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Ue(s),target:t},handled:!1,type:"instrument"}}))}catch{}return r.apply(this,[i,gt(s,{mechanism:{data:{function:"addEventListener",handler:Ue(s),target:t},handled:!1,type:"instrument"}}),a])}}),ue(n,"removeEventListener",function(r){return function(i,s,a){try{const c=s.__sentry_wrapped__;c&&r.call(this,i,c,a)}catch{}return r.call(this,i,s,a)}}))}const rl=()=>({name:"BrowserSession",setupOnce(){Z.document!==void 0?(qi({ignoreDuration:!0}),$i(),No(({from:t,to:e})=>{t!==void 0&&t!==e&&(qi({ignoreDuration:!0}),$i())})):An&&N.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.")}}),il=(t={})=>{const e={onerror:!0,onunhandledrejection:!0,...t};return{name:"GlobalHandlers",setupOnce(){Error.stackTraceLimit=50},setup(n){e.onerror&&(function(r){(function(i){const s="error";Qe(s,i),Xe(s,Ga)})(i=>{const{stackParser:s,attachStacktrace:a}=ms();if(te()!==r||as())return;const{msg:c,url:l,line:f,column:h,error:v}=i,E=function(k,b,m,y){const w=k.exception=k.exception||{},M=w.values=w.values||[],A=M[0]=M[0]||{},j=A.stacktrace=A.stacktrace||{},x=j.frames=j.frames||[],R=y,J=m,X=xe(b)&&b.length>0?b:function(){try{return Ur.document.location.href}catch{return""}}();return x.length===0&&x.push({colno:R,filename:X,function:We,in_app:!0,lineno:J}),k}(br(s,v||c,void 0,a,!1),l,f,h);E.level="error",Ji(E,{originalException:v,mechanism:{handled:!1,type:"onerror"}})})}(n),ps("onerror")),e.onunhandledrejection&&(function(r){(function(i){const s="unhandledrejection";Qe(s,i),Xe(s,Ka)})(i=>{const{stackParser:s,attachStacktrace:a}=ms();if(te()!==r||as())return;const c=function(f){if(ar(f))return f;try{if("reason"in f)return f.reason;if("detail"in f&&"reason"in f.detail)return f.detail.reason}catch{}return f}(i),l=ar(c)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(c)}`}]}}:br(s,c,void 0,a,!0);l.level="error",Ji(l,{originalException:c,mechanism:{handled:!1,type:"onunhandledrejection"}})})}(n),ps("onunhandledrejection"))}}};function ps(t){An&&N.log(`Global Handler attached: ${t}`)}function ms(){const t=te();return t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}const sl=()=>({name:"HttpContext",preprocessEvent(t){if(!Z.navigator&&!Z.location&&!Z.document)return;const e=t.request&&t.request.url||Z.location&&Z.location.href,{referrer:n}=Z.document||{},{userAgent:r}=Z.navigator||{},i={...t.request&&t.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},s={...t.request,...e&&{url:e},headers:i};t.request=s}}),ol=(t={})=>{const e=t.limit||5,n=t.key||"cause";return{name:"LinkedErrors",preprocessEvent(r,i,s){const a=s.getOptions();Oc(zr,a.stackParser,a.maxValueLength,n,e,r,i)}}};var gs="new",vs="loading",ys="loaded",wr="joining-meeting",He="joined-meeting",Le="left-meeting",Re="error",al="playable",zn="unknown",cl="full",ll="base",bs="no-room",ul="end-of-life",dl="connection-error",fl="iframe-ready-for-launch-config",hl="iframe-launch-config",pl="theme-updated",ml="loading",gl="load-attempt-failed",_s="loaded",vl="started-camera",yl="camera-error",bl="joining-meeting",_l="joined-meeting",wl="left-meeting",Sl="participant-joined",kl="participant-updated",El="participant-left",Tl="participant-counts-updated",Cl="access-state-updated",Ml="meeting-session-summary-updated",Ol="meeting-session-state-updated",Al="waiting-participant-added",Pl="waiting-participant-updated",xl="waiting-participant-removed",jl="track-started",Il="track-stopped",Ll="transcription-started",Rl="transcription-stopped",Dl="transcription-error",ws="recording-started",Ss="recording-stopped",Nl="recording-stats",Fl="recording-error",Ul="recording-upload-completed",Bl="recording-data",Vl="app-message",Jl="transcription-message",ql="remote-media-player-started",$l="remote-media-player-updated",zl="remote-media-player-stopped",Hl="local-screen-share-started",Wl="local-screen-share-stopped",Gl="local-screen-share-canceled",Kl="active-speaker-change",Ql="active-speaker-mode-change",Xl="network-quality-change",Yl="network-connection",Zl="cpu-load-change",eu="face-counts-updated",Xt="fullscreen",Yt="exited-fullscreen",tu="live-streaming-started",nu="live-streaming-updated",ru="live-streaming-stopped",iu="live-streaming-error",su="lang-updated",ou="receive-settings-updated",ks="input-settings-updated",Es="nonfatal-error",Ts="error",Hn=4096,Cs=102400,Wn="iframe-call-message",Ms="local-screen-start",Os="daily-method-update-live-streaming-endpoints",Zt="transmit-log",je="daily-custom-track",on={NONE:"none",BGBLUR:"background-blur",BGIMAGE:"background-image",FACE_DETECTION:"face-detection"},Fo={NONE:"none",NOISE_CANCELLATION:"noise-cancellation"},Sr={PLAY:"play",PAUSE:"pause"},Gn=["jpg","png","jpeg"],au="add-endpoints",cu="remove-endpoints",As="sip-call-transfer";function ve(){return!B()&&typeof window<"u"&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:""}function B(){return typeof navigator<"u"&&navigator.product&&navigator.product==="ReactNative"}function Uo(){return navigator&&navigator.mediaDevices&&navigator.mediaDevices.getUserMedia}function lu(){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}(nt(),vn())||B())}function Ps(){if(B()||!document)return!1;var t=document.createElement("iframe");return!!t.requestFullscreen||!!t.webkitRequestFullscreen}var kr="none",uu="software",du="hardware",fu=function(){try{var t,e=document.createElement("canvas"),n=!1;(t=e.getContext("webgl2",{failIfMajorPerformanceCaveat:!0}))||(n=!0,t=e.getContext("webgl2"));var r=t!=null;return e.remove(),r?n?uu:du:kr}catch{return kr}}();function Bo(){var t=arguments.length>0&&arguments[0]!==void 0&&arguments[0];return!B()&&fu!==kr&&(t?function(){return xs()?!1:["Chrome","Firefox"].includes(nt())}():function(){if(xs())return!1;var e=nt();if(e==="Safari"){var n=Gr();if(n.major<15||n.major===15&&n.minor<4)return!1}return e==="Chrome"?Wr().major>=77:e==="Firefox"?Kr().major>=97:["Chrome","Firefox","Safari"].includes(e)}())}function Vo(){if(B()||Jo()||typeof AudioWorkletNode>"u")return!1;switch(nt()){case"Chrome":case"Firefox":return!0;case"Safari":var t=vn();return t.major>17||t.major===17&&t.minor>=4}return!1}function Kn(){return Uo()&&typeof MediaStreamTrack<"u"&&!function(){var t,e=nt();if(!ve())return!0;switch(e){case"Chrome":return(t=Wr()).major&&t.major>0&&t.major<75;case"Firefox":return(t=Kr()).major<91;case"Safari":return(t=Gr()).major<13||t.major===13&&t.minor<1;default:return!0}}()}function Jo(){return ve().match(/Linux; Android/)}function xs(){var t,e=ve(),n=e.match(/Mac/)&&(!B()&&typeof window<"u"&&(t=window)!==null&&t!==void 0&&(t=t.navigator)!==null&&t!==void 0&&t.maxTouchPoints?window.navigator.maxTouchPoints:0)>=5;return!!(e.match(/Mobi/)||e.match(/Android/)||n)||!!ve().match(/DailyAnd\//)||void 0}function nt(){if(typeof window<"u"){var t=ve();return qo()?"Safari":t.indexOf("Edge")>-1?"Edge":t.match(/Chrome\//)?"Chrome":t.indexOf("Safari")>-1||$o()?"Safari":t.indexOf("Firefox")>-1?"Firefox":t.indexOf("MSIE")>-1||t.indexOf(".NET")>-1?"IE":"Unknown Browser"}}function vn(){switch(nt()){case"Chrome":return Wr();case"Safari":return Gr();case"Firefox":return Kr();case"Edge":return function(){var t=0,e=0;if(typeof window<"u"){var n=ve().match(/Edge\/(\d+).(\d+)/);if(n)try{t=parseInt(n[1]),e=parseInt(n[2])}catch{}}return{major:t,minor:e}}()}}function Wr(){var t=0,e=0,n=0,r=0,i=!1;if(typeof window<"u"){var s=ve(),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 qo(){return!!ve().match(/iPad|iPhone|iPod/i)&&Uo()}function $o(){return ve().indexOf("AppleWebKit/605.1.15")>-1}function Gr(){var t=0,e=0,n=0;if(typeof window<"u"){var r=ve().match(/Version\/(\d+).(\d+)(.(\d+))?/);if(r)try{t=parseInt(r[1]),e=parseInt(r[2]),n=parseInt(r[4])}catch{}else(qo()||$o())&&(t=14,e=0,n=3)}return{major:t,minor:e,point:n}}function Kr(){var t=0,e=0;if(typeof window<"u"){var n=ve().match(/Firefox\/(\d+).(\d+)/);if(n)try{t=parseInt(n[1]),e=parseInt(n[2])}catch{}}return{major:t,minor:e}}var zo=function(){return fe(function t(){de(this,t)},[{key:"addListenerForMessagesFromCallMachine",value:function(t,e,n){Et()}},{key:"addListenerForMessagesFromDailyJs",value:function(t,e,n){Et()}},{key:"sendMessageToCallMachine",value:function(t,e,n,r){Et()}},{key:"sendMessageToDailyJs",value:function(t,e){Et()}},{key:"removeListener",value:function(t){Et()}}])}();function js(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 Qn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?js(Object(n),!0).forEach(function(r){Me(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):js(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Ho(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ho=function(){return!!t})()}var hu=function(){function t(){var e,n,r,i;return de(this,t),n=this,r=we(r=t),(e=Sn(n,Ho()?Reflect.construct(r,[],we(n).constructor):r.apply(n,i)))._wrappedListeners={},e._messageCallbacks={},e}return kn(t,zo),fe(t,[{key:"addListenerForMessagesFromCallMachine",value:function(e,n,r){var i=this,s=function(a){if(a.data&&a.data.what==="iframe-call-message"&&(!a.data.callClientId||a.data.callClientId===n)&&(!a.data.from||a.data.from!=="module")){var c=Qn({},a.data);if(delete c.from,c.callbackStamp&&i._messageCallbacks[c.callbackStamp]){var l=c.callbackStamp;i._messageCallbacks[l].call(r,c),delete i._messageCallbacks[l]}delete c.what,delete c.callbackStamp,e.call(r,c)}};this._wrappedListeners[e]=s,window.addEventListener("message",s)}},{key:"addListenerForMessagesFromDailyJs",value:function(e,n,r){var i=function(s){var a;if(!(!s.data||s.data.what!==Wn||!s.data.action||s.data.from&&s.data.from!=="module"||s.data.callClientId&&n&&s.data.callClientId!==n||s!=null&&(a=s.data)!==null&&a!==void 0&&a.callFrameId)){var c=s.data;e.call(r,c)}};this._wrappedListeners[e]=i,window.addEventListener("message",i)}},{key:"sendMessageToCallMachine",value:function(e,n,r,i){if(!r)throw new Error("undefined callClientId. Are you trying to use a DailyCall instance previously destroyed?");var s=Qn({},e);if(s.what=Wn,s.from="module",s.callClientId=r,n){var a=En();this._messageCallbacks[a]=n,s.callbackStamp=a}var c=i?i.contentWindow:window,l=this._callMachineTargetOrigin(i);l&&c.postMessage(s,l)}},{key:"sendMessageToDailyJs",value:function(e,n){e.what=Wn,e.callClientId=n,e.from="embedded",window.postMessage(e,this._targetOriginFromWindowLocation())}},{key:"removeListener",value:function(e){var n=this._wrappedListeners[e];n&&(window.removeEventListener("message",n),delete this._wrappedListeners[e])}},{key:"forwardPackagedMessageToCallMachine",value:function(e,n,r){var i=Qn({},e);i.callClientId=r;var s=n?n.contentWindow:window,a=this._callMachineTargetOrigin(n);a&&s.postMessage(i,a)}},{key:"addListenerForPackagedMessagesFromCallMachine",value:function(e,n){var r=function(i){if(i.data&&i.data.what==="iframe-call-message"&&(!i.data.callClientId||i.data.callClientId===n)&&(!i.data.from||i.data.from!=="module")){var s=i.data;e(s)}};return this._wrappedListeners[e]=r,window.addEventListener("message",r),e}},{key:"removeListenerForPackagedMessagesFromCallMachine",value:function(e){var n=this._wrappedListeners[e];n&&(window.removeEventListener("message",n),delete this._wrappedListeners[e])}},{key:"_callMachineTargetOrigin",value:function(e){return e?e.src?new URL(e.src).origin:void 0:this._targetOriginFromWindowLocation()}},{key:"_targetOriginFromWindowLocation",value:function(){return window.location.protocol==="file:"?"*":window.location.origin}}])}();function Is(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 Wo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Wo=function(){return!!t})()}var pu=function(){function t(){var e,n,r,i;return de(this,t),n=this,r=we(r=t),e=Sn(n,Wo()?Reflect.construct(r,[],we(n).constructor):r.apply(n,i)),global.callMachineToDailyJsEmitter=global.callMachineToDailyJsEmitter||new sr.EventEmitter,global.dailyJsToCallMachineEmitter=global.dailyJsToCallMachineEmitter||new sr.EventEmitter,e._wrappedListeners={},e._messageCallbacks={},e}return kn(t,zo),fe(t,[{key:"addListenerForMessagesFromCallMachine",value:function(e,n,r){this._addListener(e,global.callMachineToDailyJsEmitter,n,r,"received call machine message")}},{key:"addListenerForMessagesFromDailyJs",value:function(e,n,r){this._addListener(e,global.dailyJsToCallMachineEmitter,n,r,"received daily-js message")}},{key:"sendMessageToCallMachine",value:function(e,n,r){this._sendMessage(e,global.dailyJsToCallMachineEmitter,r,n,"sending message to call machine")}},{key:"sendMessageToDailyJs",value:function(e,n){this._sendMessage(e,global.callMachineToDailyJsEmitter,n,null,"sending message to daily-js")}},{key:"removeListener",value:function(e){var n=this._wrappedListeners[e];n&&(global.callMachineToDailyJsEmitter.removeListener("message",n),global.dailyJsToCallMachineEmitter.removeListener("message",n),delete this._wrappedListeners[e])}},{key:"_addListener",value:function(e,n,r,i,s){var a=this,c=function(l){if(l.callClientId===r){if(l.callbackStamp&&a._messageCallbacks[l.callbackStamp]){var f=l.callbackStamp;a._messageCallbacks[f].call(i,l),delete a._messageCallbacks[f]}e.call(i,l)}};this._wrappedListeners[e]=c,n.addListener("message",c)}},{key:"_sendMessage",value:function(e,n,r,i,s){var a=function(l){for(var f=1;f<arguments.length;f++){var h=arguments[f]!=null?arguments[f]:{};f%2?Is(Object(h),!0).forEach(function(v){Me(l,v,h[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(h)):Is(Object(h)).forEach(function(v){Object.defineProperty(l,v,Object.getOwnPropertyDescriptor(h,v))})}return l}({},e);if(a.callClientId=r,i){var c=En();this._messageCallbacks[c]=i,a.callbackStamp=c}n.emit("message",a)}}])}(),Er="replace",Tr="shallow-merge",Ls=[Er,Tr],mu=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.data,r=e.mergeStrategy,i=r===void 0?Er:r;de(this,t),t._validateMergeStrategy(i),t._validateData(n,i),this.mergeStrategy=i,this.data=n}return fe(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===Tr}},{key:"_validateMergeStrategy",value:function(e){if(!Ls.includes(e))throw Error("Unrecognized mergeStrategy provided. Options are: [".concat(Ls,"]"))}},{key:"_validateData",value:function(e,n){if(!function(c){if(c==null||q(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===Er){var i=JSON.parse(r);se(i,e)||console.warn("The meeting session data provided will be modified when serialized.",i,e)}else if(n===Tr){for(var s in e)if(Object.hasOwnProperty.call(e,s)&&e[s]!==void 0){var a=JSON.parse(JSON.stringify(e[s]));se(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>Cs)throw Error("Meeting session data is too large (".concat(r.length," characters). Maximum size suppported is ").concat(Cs,"."))}}])}();function Go(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Go=function(){return!!t})()}function Cr(t){var e=typeof Map=="function"?new Map:void 0;return Cr=function(n){if(n===null||!function(i){try{return Function.toString.call(i).indexOf("[native code]")!==-1}catch{return typeof i=="function"}}(n))return n;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,r)}function r(){return function(i,s,a){if(Go())return Reflect.construct.apply(null,arguments);var c=[null];c.push.apply(c,s);var l=new(i.bind.apply(i,c));return a&&xt(l,a.prototype),l}(n,arguments,we(this).constructor)}return r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),xt(r,n)},Cr(t)}function Ko(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ko=function(){return!!t})()}function Rs(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 gu=function(){return fe(function t(e){de(this,t),this._currentLoad=null,this._callClientId=e},[{key:"load",value:function(){var t,e=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;if(this.loaded)return window._daily.instances[this._callClientId].callMachine.reset(),void r(!0);t=this._callClientId,window._daily.pendings.push(t),this._currentLoad&&this._currentLoad.cancel(),this._currentLoad=new vu(n,function(){r(!1)},function(s,a){a||Rs(e._callClientId),i(s,a)}),this._currentLoad.start()}},{key:"cancel",value:function(){this._currentLoad&&this._currentLoad.cancel(),Rs(this._callClientId)}},{key:"loaded",get:function(){return this._currentLoad&&this._currentLoad.succeeded}}])}(),vu=function(){return fe(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;de(this,t),this._attemptsRemaining=3,this._currentAttempt=null,this._dailyConfig=e,this._successCallback=n,this._failureCallback=r},[{key:"start",value:function(){var t=this;if(!this._currentAttempt){var e=function(n){t._currentAttempt.cancelled||(t._attemptsRemaining--,t._failureCallback(n,t._attemptsRemaining>0),t._attemptsRemaining<=0||setTimeout(function(){t._currentAttempt.cancelled||(t._currentAttempt=new Ds(t._dailyConfig,t._successCallback,e),t._currentAttempt.start())},3e3))};this._currentAttempt=new Ds(this._dailyConfig,this._successCallback,e),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}}])}(),Xn=function(){function t(){return de(this,t),e=this,r=arguments,n=we(n=t),Sn(e,Ko()?Reflect.construct(n,r||[],we(e).constructor):n.apply(e,r));var e,n,r}return kn(t,Cr(Error)),fe(t)}(),yn=2e4,Ds=function(){return fe(function e(n,r,i){de(this,e),this._loadAttemptImpl=B()||!n.avoidEval?new yu(n,r,i):new bu(n,r,i)},[{key:"start",value:(t=L(function*(){return this._loadAttemptImpl.start()}),function(){return t.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}}]);var t}(),yu=function(){return fe(function i(s,a,c){de(this,i),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},[{key:"start",value:(r=L(function*(){var i=dn(this._dailyConfig);!(yield this._tryLoadFromIOSCache(i))&&this._loadFromNetwork(i)}),function(){return r.apply(this,arguments)})},{key:"cancel",value:function(){clearTimeout(this._networkTimeout),this.cancelled=!0}},{key:"_tryLoadFromIOSCache",value:(n=L(function*(i){if(!this._iosCache)return!1;try{var s=yield this._iosCache.get(i);return!!this.cancelled||!!s&&(s.code?(Function('"use strict";'+s.code)(),this.succeeded=!0,this._successCallback(),!0):(this._refetchHeaders=s.refetchHeaders,!1))}catch{return!1}}),function(i){return n.apply(this,arguments)})},{key:"_loadFromNetwork",value:(e=L(function*(i){var s=this;this._networkTimeout=setTimeout(function(){s._networkTimedOut=!0,s._failureCallback({msg:"Timed out (>".concat(yn," ms) when loading call object bundle ").concat(i),type:"timeout"})},yn);try{var a=this._refetchHeaders?{headers:this._refetchHeaders}:{},c=yield fetch(i,a);if(clearTimeout(this._networkTimeout),this.cancelled||this._networkTimedOut)throw new Xn;var l=yield this._getBundleCodeFromResponse(i,c);if(this.cancelled)throw new Xn;Function('"use strict";'+l)(),this._iosCache&&this._iosCache.set(i,l,c.headers),this.succeeded=!0,this._successCallback()}catch(f){if(clearTimeout(this._networkTimeout),f instanceof Xn||this.cancelled||this._networkTimedOut)return;this._failureCallback({msg:"Failed to load call object bundle ".concat(i,": ").concat(f),type:f.message})}}),function(i){return e.apply(this,arguments)})},{key:"_getBundleCodeFromResponse",value:(t=L(function*(i,s){if(s.ok)return yield s.text();if(this._iosCache&&s.status===304)return(yield this._iosCache.renew(i,s.headers)).code;throw new Error("Received ".concat(s.status," response"))}),function(i,s){return t.apply(this,arguments)})}]);var t,e,n,r}(),bu=function(){return fe(function t(e,n,r){de(this,t),this.cancelled=!1,this.succeeded=!1,this._dailyConfig=e,this._successCallback=n,this._failureCallback=r,this._attemptId=En(),this._networkTimeout=null,this._scriptElement=null},[{key:"start",value:function(){window._dailyCallMachineLoadWaitlist||(window._dailyCallMachineLoadWaitlist=new Set);var t=dn(this._dailyConfig);(typeof document>"u"?"undefined":q(document))==="object"?this._startLoading(t):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(t){var e=this;this._signUpForCallMachineLoadWaitlist(),this._networkTimeout=setTimeout(function(){e._stopLoading(),e._failureCallback({msg:"Timed out (>".concat(yn," ms) when loading call object bundle ").concat(t),type:"timeout"})},yn);var n=document.getElementsByTagName("head")[0],r=document.createElement("script");this._scriptElement=r,r.onload=function(){e._stopLoading(),e.succeeded=!0,e._successCallback()},r.onerror=function(i){e._stopLoading(),e._failureCallback({msg:"Failed to load call object bundle ".concat(i.target.src),type:i.message})},r.src=t,n.appendChild(r)}},{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)}}])}(),en=function(t,e,n){return wu(t.local,e,n)===!0},_u=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]},lt=function(t,e,n,r){var i=Su(t,e,n,r);return i&&i.pendingTrack},wu=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)},Su=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]},ku=function(t,e){var n=t.local.public.customTracks;if(n&&n[e])return n[e].track};function Ns(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],f=s==="cam"?l:"screen".concat(l.charAt(0).toUpperCase()+l.slice(1)),h=t.tracks[f];if(h){var v=t.local?_u(n,s,l):lt(n,t.session_id,s,l);h.state==="playable"&&(h.track=v),h.persistentTrack=v}}}function Fs(t,e){try{var n=e.getState();for(var r in t.tracks)if(!Eu(r)){var i=t.tracks[r].kind;if(i){var s=t.tracks[r];if(s){var a=t.local?ku(n,r):lt(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 Eu(t){return["video","audio","screenVideo","screenAudio"].includes(t)}function Us(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&&en(r,t.session_id,"cam-audio")){var a=lt(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&&en(r,t.session_id,"cam-video")){var c=lt(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&&en(r,t.session_id,"screen-audio")){var l=lt(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&&en(r,t.session_id,"screen-video")){var f=lt(r,t.session_id,"screen","video");f&&(e&&e.screenVideoTrack&&e.screenVideoTrack.id===f.id?t.screenVideoTrack=f:f.muted||(t.screenVideoTrack=f))}t.screenVideoTrack||t.screenAudioTrack||(t.screen=!1)}catch(h){console.error("unexpected error matching up tracks",h)}}}function Tu(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(l,f){if(l){if(typeof l=="string")return Bs(l,f);var h={}.toString.call(l).slice(8,-1);return h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set"?Array.from(l):h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h)?Bs(l,f):void 0}}(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.
|
|
23
|
+
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 Bs(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var Te=new Map,dt=null;function Cu(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(l,f){if(l){if(typeof l=="string")return Vs(l,f);var h={}.toString.call(l).slice(8,-1);return h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set"?Array.from(l):h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h)?Vs(l,f):void 0}}(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 Vs(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var Ce=new Map,At=null;function Mu(t){Qo()?function(e){Te.has(e)||(Te.set(e,{}),navigator.mediaDevices.enumerateDevices().then(function(n){Te.has(e)&&(Te.get(e).lastDevicesString=JSON.stringify(n),dt||(dt=function(){var r=L(function*(){var i,s=yield navigator.mediaDevices.enumerateDevices(),a=Tu(Te.keys());try{for(a.s();!(i=a.n()).done;){var c=i.value,l=JSON.stringify(s);l!==Te.get(c).lastDevicesString&&(Te.get(c).lastDevicesString=l,c(s))}}catch(f){a.e(f)}finally{a.f()}});return function(){return r.apply(this,arguments)}}(),navigator.mediaDevices.addEventListener("devicechange",dt)))}).catch(function(){}))}(t):function(e){Ce.has(e)||(Ce.set(e,{}),navigator.mediaDevices.enumerateDevices().then(function(n){Ce.has(e)&&(Ce.get(e).lastDevicesString=JSON.stringify(n),At||(At=setInterval(L(function*(){var r,i=yield navigator.mediaDevices.enumerateDevices(),s=Cu(Ce.keys());try{for(s.s();!(r=s.n()).done;){var a=r.value,c=JSON.stringify(i);c!==Ce.get(a).lastDevicesString&&(Ce.get(a).lastDevicesString=c,a(i))}}catch(l){s.e(l)}finally{s.f()}}),3e3)))}))}(t)}function Ou(t){Qo()?function(e){Te.has(e)&&(Te.delete(e),Te.size===0&&dt&&(navigator.mediaDevices.removeEventListener("devicechange",dt),dt=null))}(t):function(e){Ce.has(e)&&(Ce.delete(e),Ce.size===0&&At&&(clearInterval(At),At=null))}(t)}function Qo(){var t;return B()||((t=navigator.mediaDevices)===null||t===void 0?void 0:t.ondevicechange)!==void 0}var Au=new Set;function Pu(t,e){return t&&t.readyState==="live"&&!function(n,r){return n.muted&&!Au.has(n.id)}(t)}function Js(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 De(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Js(Object(n),!0).forEach(function(r){Me(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Js(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var Ot=Object.freeze({VIDEO:"video",AUDIO:"audio",SCREEN_VIDEO:"screenVideo",SCREEN_AUDIO:"screenAudio",CUSTOM_VIDEO:"customVideo",CUSTOM_AUDIO:"customAudio"}),xu=Object.freeze({PARTICIPANTS:"participants",STREAMING:"streaming",TRANSCRIPTION:"transcription"}),Pt=Object.values(Ot),qs=["v","a","sv","sa","cv","ca"];Object.freeze(Pt.reduce(function(t,e,n){return t[e]=qs[n],t},{})),Object.freeze(qs.reduce(function(t,e,n){return t[e]=Pt[n],t},{}));var ju=[Ot.VIDEO,Ot.AUDIO,Ot.SCREEN_VIDEO,Ot.SCREEN_AUDIO],$s=Object.values(xu),zs=["p","s","t"];Object.freeze($s.reduce(function(t,e,n){return t[e]=zs[n],t},{})),Object.freeze(zs.reduce(function(t,e,n){return t[e]=$s[n],t},{}));var Xo=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.base,r=e.byUserId,i=e.byParticipantId;de(this,t),this.base=n,this.byUserId=r,this.byParticipantId=i}return fe(t,[{key:"clone",value:function(){var e=new t;if(this.base instanceof ee?e.base=this.base.clone():e.base=this.base,this.byUserId!==void 0)for(var n in e.byUserId={},this.byUserId){var r=this.byUserId[n];e.byUserId[n]=r instanceof ee?r.clone():r}if(this.byParticipantId!==void 0)for(var i in e.byParticipantId={},this.byParticipantId){var s=this.byParticipantId[i];e.byParticipantId[i]=s instanceof ee?s.clone():s}return e}},{key:"toJSONObject",value:function(){var e={};if(typeof this.base=="boolean"?e.base=this.base:this.base instanceof ee&&(e.base=this.base.toJSONObject()),this.byUserId!==void 0)for(var n in e.byUserId={},this.byUserId){var r=this.byUserId[n];e.byUserId[n]=r instanceof ee?r.toJSONObject():r}if(this.byParticipantId!==void 0)for(var i in e.byParticipantId={},this.byParticipantId){var s=this.byParticipantId[i];e.byParticipantId[i]=s instanceof ee?s.toJSONObject():s}return e}},{key:"toMinifiedJSONObject",value:function(){var e={};if(this.base!==void 0&&(typeof this.base=="boolean"?e.b=this.base:e.b=this.base.toMinifiedJSONObject()),this.byUserId!==void 0)for(var n in e.u={},this.byUserId){var r=this.byUserId[n];e.u[n]=typeof r=="boolean"?r:r.toMinifiedJSONObject()}if(this.byParticipantId!==void 0)for(var i in e.p={},this.byParticipantId){var s=this.byParticipantId[i];e.p[i]=typeof s=="boolean"?s:s.toMinifiedJSONObject()}return e}},{key:"normalize",value:function(){return this.base instanceof ee&&(this.base=this.base.normalize()),this.byUserId&&(this.byUserId=Object.fromEntries(Object.entries(this.byUserId).map(function(e){var n=re(e,2),r=n[0],i=n[1];return[r,i instanceof ee?i.normalize():i]}))),this.byParticipantId&&(this.byParticipantId=Object.fromEntries(Object.entries(this.byParticipantId).map(function(e){var n=re(e,2),r=n[0],i=n[1];return[r,i instanceof ee?i.normalize():i]}))),this}}],[{key:"fromJSONObject",value:function(e){var n,r,i;if(e.base!==void 0&&(n=typeof e.base=="boolean"?e.base:ee.fromJSONObject(e.base)),e.byUserId!==void 0)for(var s in r={},e.byUserId){var a=e.byUserId[s];r[s]=typeof a=="boolean"?a:ee.fromJSONObject(a)}if(e.byParticipantId!==void 0)for(var c in i={},e.byParticipantId){var l=e.byParticipantId[c];i[c]=typeof l=="boolean"?l:ee.fromJSONObject(l)}return new t({base:n,byUserId:r,byParticipantId:i})}},{key:"fromMinifiedJSONObject",value:function(e){var n,r,i;if(e.b!==void 0&&(n=typeof e.b=="boolean"?e.b:ee.fromMinifiedJSONObject(e.b)),e.u!==void 0)for(var s in r={},e.u){var a=e.u[s];r[s]=typeof a=="boolean"?a:ee.fromMinifiedJSONObject(a)}if(e.p!==void 0)for(var c in i={},e.p){var l=e.p[c];i[c]=typeof l=="boolean"?l:ee.fromMinifiedJSONObject(l)}return new t({base:n,byUserId:r,byParticipantId:i})}},{key:"validateJSONObject",value:function(e){if(q(e)!=="object")return[!1,"canReceive must be an object"];for(var n=["base","byUserId","byParticipantId"],r=0,i=Object.keys(e);r<i.length;r++){var s=i[r];if(!n.includes(s))return[!1,"canReceive can only contain keys (".concat(n.join(", "),")")];if(s==="base"){var a=re(ee.validateJSONObject(e.base,!0),2),c=a[0],l=a[1];if(!c)return[!1,l]}else{if(q(e[s])!=="object")return[!1,"invalid (non-object) value for field '".concat(s,"' in canReceive")];for(var f=0,h=Object.values(e[s]);f<h.length;f++){var v=h[f],E=re(ee.validateJSONObject(v),2),k=E[0],b=E[1];if(!k)return[!1,b]}}}return[!0]}}])}(),ee=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.video,r=e.audio,i=e.screenVideo,s=e.screenAudio,a=e.customVideo,c=e.customAudio;de(this,t),this.video=n,this.audio=r,this.screenVideo=i,this.screenAudio=s,this.customVideo=a,this.customAudio=c}return fe(t,[{key:"clone",value:function(){var e=new t;return this.video!==void 0&&(e.video=this.video),this.audio!==void 0&&(e.audio=this.audio),this.screenVideo!==void 0&&(e.screenVideo=this.screenVideo),this.screenAudio!==void 0&&(e.screenAudio=this.screenAudio),this.customVideo!==void 0&&(e.customVideo=De({},this.customVideo)),this.customAudio!==void 0&&(e.customAudio=De({},this.customAudio)),e}},{key:"toJSONObject",value:function(){var e={};return this.video!==void 0&&(e.video=this.video),this.audio!==void 0&&(e.audio=this.audio),this.screenVideo!==void 0&&(e.screenVideo=this.screenVideo),this.screenAudio!==void 0&&(e.screenAudio=this.screenAudio),this.customVideo!==void 0&&(e.customVideo=De({},this.customVideo)),this.customAudio!==void 0&&(e.customAudio=De({},this.customAudio)),e}},{key:"toMinifiedJSONObject",value:function(){var e={};return this.video!==void 0&&(e.v=this.video),this.audio!==void 0&&(e.a=this.audio),this.screenVideo!==void 0&&(e.sv=this.screenVideo),this.screenAudio!==void 0&&(e.sa=this.screenAudio),this.customVideo!==void 0&&(e.cv=De({},this.customVideo)),this.customAudio!==void 0&&(e.ca=De({},this.customAudio)),e}},{key:"normalize",value:function(){function e(n,r){return n&&Object.keys(n).length===1&&n["*"]===r}return!(this.video!==!0||this.audio!==!0||this.screenVideo!==!0||this.screenAudio!==!0||!e(this.customVideo,!0)||!e(this.customAudio,!0))||(this.video!==!1||this.audio!==!1||this.screenVideo!==!1||this.screenAudio!==!1||!e(this.customVideo,!1)||!e(this.customAudio,!1))&&this}}],[{key:"fromBoolean",value:function(e){return new t({video:e,audio:e,screenVideo:e,screenAudio:e,customVideo:{"*":e},customAudio:{"*":e}})}},{key:"fromJSONObject",value:function(e){return new t({video:e.video,audio:e.audio,screenVideo:e.screenVideo,screenAudio:e.screenAudio,customVideo:e.customVideo!==void 0?De({},e.customVideo):void 0,customAudio:e.customAudio!==void 0?De({},e.customAudio):void 0})}},{key:"fromMinifiedJSONObject",value:function(e){return new t({video:e.v,audio:e.a,screenVideo:e.sv,screenAudio:e.sa,customVideo:e.cv,customAudio:e.ca})}},{key:"validateJSONObject",value:function(e,n){if(typeof e=="boolean")return[!0];if(q(e)!=="object")return[!1,"invalid (non-object, non-boolean) value in canReceive"];for(var r=Object.keys(e),i=0,s=r;i<s.length;i++){var a=s[i];if(!Pt.includes(a))return[!1,"invalid media type '".concat(a,"' in canReceive")];if(ju.includes(a)){if(typeof e[a]!="boolean")return[!1,"invalid (non-boolean) value for media type '".concat(a,"' in canReceive")]}else{if(q(e[a])!=="object")return[!1,"invalid (non-object) value for media type '".concat(a,"' in canReceive")];for(var c=0,l=Object.values(e[a]);c<l.length;c++)if(typeof l[c]!="boolean")return[!1,"invalid (non-boolean) value for entry within '".concat(a,"' in canReceive")];if(n&&e[a]["*"]===void 0)return[!1,`canReceive "base" permission must specify "*" as an entry within '`.concat(a,"'")]}}return n&&r.length!==Pt.length?[!1,'canReceive "base" permission must specify all media types: '.concat(Pt.join(", ")," (or be set to a boolean shorthand)")]:[!0]}}])}(),Iu=["result"],Lu=["preserveIframe"];function Hs(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 I(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Hs(Object(n),!0).forEach(function(r){Me(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Hs(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Yo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Yo=function(){return!!t})()}function Ws(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(l,f){if(l){if(typeof l=="string")return Gs(l,f);var h={}.toString.call(l).slice(8,-1);return h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set"?Array.from(l):h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h)?Gs(l,f):void 0}}(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 Gs(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var $e={},Ks="video",Ru="voice",Qs=B()?{data:{}}:{data:{},topology:"none"},Xs={present:0,hidden:0},Zo={maxBitrate:{min:1e5,max:25e5},maxFramerate:{min:1,max:30},scaleResolutionDownBy:{min:1,max:8}},Yn=Object.keys(Zo),Ys=["state","volume","simulcastEncodings"],Zs={androidInCallNotification:{title:"string",subtitle:"string",iconName:"string",disableForCustomOverride:"boolean"},disableAutoDeviceManagement:{audio:"boolean",video:"boolean"}},bn={id:{iconPath:"string",iconPathDarkMode:"string",label:"string",tooltip:"string",visualState:"'default' | 'sidebar-open' | 'active'"}},Mr={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"}},ze={customIntegrations:{validate:aa,help:sa()},customTrayButtons:{validate:oa,help:"customTrayButtons should be a dictionary of the type ".concat(JSON.stringify(bn))},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 ca(t,Zs)},help:"reactNativeConfig should look like ".concat(JSON.stringify(Zs),", all fields optional")},lang:{validate:function(t){return["da","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: da, 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 ea(t),!0}catch(e){return console.error(e),!1}},help:"invalid userData type provided"},startVideoOff:!0,startAudioOff:!0,allowLocalVideo:!0,allowLocalAudio:!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){if(typeof t=="boolean")return e._preloadCache.allowLocalVideo=t,!0;var n;if(t instanceof MediaStreamTrack)e._sharedTracks.videoTrack=t,n={customTrack:je};else{if(delete e._sharedTracks.videoTrack,typeof t!="string")return console.error("videoSource must be a MediaStreamTrack, boolean, or a string"),!1;n={deviceId:t}}return e._updatePreloadCacheInputSettings({video:{settings:n}},!1),!0}},audioSource:{validate:function(t,e){if(typeof t=="boolean")return e._preloadCache.allowLocalAudio=t,!0;var n;if(t instanceof MediaStreamTrack)e._sharedTracks.audioTrack=t,n={customTrack:je};else{if(delete e._sharedTracks.audioTrack,typeof t!="string")return console.error("audioSource must be a MediaStreamTrack, boolean, or a string"),!1;n={deviceId:t}}return e._updatePreloadCacheInputSettings({audio:{settings:n}},!1),!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 q(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 ta(t,{allowAllParticipantsKey:!1})},help:ia({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!!na(t)&&(e._inputSettings||(e._inputSettings={}),ra(t,(n=e.properties)===null||n===void 0?void 0:n.dailyConfig,e._sharedTracks),e._updatePreloadCacheInputSettings(t,!0),!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},tn={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)||!B()&&t==="avatar")return!0;var r=["audio","video","screenAudio","screenVideo","rmpAudio","rmpVideo"],i=function(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),f=!n.includes(s[c]);if(l||f)return!1}return!0};return i(t)},help:"setSubscribedTracks cannot be used when setSubscribeToTracksAutomatically is enabled, and should be of the form: "+"true".concat(B()?"":" | '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=re(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=Ws(s);try{for(l.s();!(a=l.n()).done;){var f=a.value;if(!c.includes(f))return!1}}catch(w){l.e(w)}finally{l.f()}}else if(typeof s!="boolean")return!1;(s instanceof Array||Array.isArray(s))&&(t.canSend=new Set(s));break;case"canReceive":var h=re(Xo.validateJSONObject(s),2),v=h[0],E=h[1];if(!v)return console.error(E),!1;break;case"canAdmin":if(s instanceof Set||s instanceof Array||Array.isArray(s)){var k,b=["participants","streaming","transcription"],m=Ws(s);try{for(m.s();!(k=m.n()).done;){var y=k.value;if(!b.includes(y))return!1}}catch(w){m.e(w)}finally{m.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, canReceive, 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). canReceive must be an object specifying base, byUserId, and/or byParticipantId fields (see documentation for more details). canAdmin can be a boolean or an Array or Set of admin types (participants, streaming, transcription)."}};Promise.any||(Promise.any=function(){var t=L(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 Du=function(){function t(o){var d,u,p,g,S,C,O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(de(this,t),p=this,g=we(g=t),Me(u=Sn(p,Yo()?Reflect.construct(g,[],we(p).constructor):g.apply(p,S)),"startListeningForDeviceChanges",function(){Mu(u.handleDeviceChange)}),Me(u,"stopListeningForDeviceChanges",function(){Ou(u.handleDeviceChange)}),Me(u,"handleDeviceChange",function(D){D=D.map(function(V){return JSON.parse(JSON.stringify(V))}),u.emitDailyJSEvent({action:"available-devices-updated",availableDevices:D})}),Me(u,"handleNativeAppStateChange",function(){var D=L(function*(V){if(V==="destroyed")return console.warn("App has been destroyed before leaving the meeting. Cleaning up all the resources!"),void(yield u.destroy());var ke=V==="active";u.disableReactNativeAutoDeviceManagement("video")||(ke?u.camUnmutedBeforeLosingNativeActiveState&&u.setLocalVideo(!0):(u.camUnmutedBeforeLosingNativeActiveState=u.localVideo(),u.camUnmutedBeforeLosingNativeActiveState&&u.setLocalVideo(!1)))});return function(V){return D.apply(this,arguments)}}()),Me(u,"handleNativeAudioFocusChange",function(D){u.disableReactNativeAutoDeviceManagement("audio")||(u._hasNativeAudioFocus=D,u.toggleParticipantAudioBasedOnNativeAudioFocus(),u._hasNativeAudioFocus?u.micUnmutedBeforeLosingNativeAudioFocus&&u.setLocalAudio(!0):(u.micUnmutedBeforeLosingNativeAudioFocus=u.localAudio(),u.setLocalAudio(!1)))}),Me(u,"handleNativeSystemScreenCaptureStop",function(){u.stopScreenShare()}),!Kn()&&!B())throw new Error("WebRTC not supported or suppressed");if(u.strictMode=O.strictMode===void 0||O.strictMode,u.allowMultipleCallInstances=(d=O.allowMultipleCallInstances)!==null&&d!==void 0&&d,Object.keys($e).length&&(u._logDuplicateInstanceAttempt(),!u.allowMultipleCallInstances)){if(u.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:{}}),u.callClientId=En(),$e[(C=u).callClientId]=C,window._daily.instances[u.callClientId]={},u._sharedTracks={},window._daily.instances[u.callClientId].tracks=u._sharedTracks,O.dailyJsVersion=t.version(),u._iframe=o,u._callObjectMode=O.layout==="none"&&!u._iframe,u._preloadCache={subscribeToTracksAutomatically:!0,outputDeviceId:null,inputSettings:null,sendSettings:null,videoTrackForNetworkConnectivityTest:null,videoTrackForConnectionQualityTest:null},O.showLocalVideo!==void 0?u._callObjectMode?console.error("showLocalVideo is not available in call object mode"):u._showLocalVideo=!!O.showLocalVideo:u._showLocalVideo=!0,O.showParticipantsBar!==void 0?u._callObjectMode?console.error("showParticipantsBar is not available in call object mode"):u._showParticipantsBar=!!O.showParticipantsBar:u._showParticipantsBar=!0,O.customIntegrations!==void 0?u._callObjectMode?console.error("customIntegrations is not available in call object mode"):u._customIntegrations=O.customIntegrations:u._customIntegrations={},O.customTrayButtons!==void 0?u._callObjectMode?console.error("customTrayButtons is not available in call object mode"):u._customTrayButtons=O.customTrayButtons:u._customTrayButtons={},O.activeSpeakerMode!==void 0?u._callObjectMode?console.error("activeSpeakerMode is not available in call object mode"):u._activeSpeakerMode=!!O.activeSpeakerMode:u._activeSpeakerMode=!1,O.receiveSettings?u._callObjectMode?u._receiveSettings=O.receiveSettings:console.error("receiveSettings is only available in call object mode"):u._receiveSettings={},u.validateProperties(O),u.properties=I({},O),u._inputSettings||(u._inputSettings={}),u._callObjectLoader=u._callObjectMode?new gu(u.callClientId):null,u._callState=gs,u._isPreparingToJoin=!1,u._accessState={access:zn},u._meetingSessionSummary={},u._finalSummaryOfPrevSession={},u._meetingSessionState=tr(Qs,u._callObjectMode),u._nativeInCallAudioMode=Ks,u._participants={},u._isScreenSharing=!1,u._participantCounts=Xs,u._rmpPlayerState={},u._waitingParticipants={},u._network={threshold:"good",quality:100,networkState:"unknown",stats:{}},u._activeSpeaker={},u._localAudioLevel=0,u._isLocalAudioLevelObserverRunning=!1,u._remoteParticipantsAudioLevel={},u._isRemoteParticipantsAudioLevelObserverRunning=!1,u._maxAppMessageSize=Hn,u._messageChannel=B()?new pu:new hu,u._iframe&&(u._iframe.requestFullscreen?u._iframe.addEventListener("fullscreenchange",function(){document.fullscreenElement===u._iframe?(u.emitDailyJSEvent({action:Xt}),u.sendMessageToCallMachine({action:Xt})):(u.emitDailyJSEvent({action:Yt}),u.sendMessageToCallMachine({action:Yt}))}):u._iframe.webkitRequestFullscreen&&u._iframe.addEventListener("webkitfullscreenchange",function(){document.webkitFullscreenElement===u._iframe?(u.emitDailyJSEvent({action:Xt}),u.sendMessageToCallMachine({action:Xt})):(u.emitDailyJSEvent({action:Yt}),u.sendMessageToCallMachine({action:Yt}))})),B()){var P=u.nativeUtils();P.addAudioFocusChangeListener&&P.removeAudioFocusChangeListener&&P.addAppStateChangeListener&&P.removeAppStateChangeListener&&P.addSystemScreenCaptureStopListener&&P.removeSystemScreenCaptureStopListener||console.warn("expected (add|remove)(AudioFocusChange|AppActiveStateChange|SystemScreenCaptureStop)Listener to be available in React Native"),u._hasNativeAudioFocus=!0,P.addAudioFocusChangeListener(u.handleNativeAudioFocusChange),P.addAppStateChangeListener(u.handleNativeAppStateChange),P.addSystemScreenCaptureStopListener(u.handleNativeSystemScreenCaptureStop)}return u._callObjectMode&&u.startListeningForDeviceChanges(),u._messageChannel.addListenerForMessagesFromCallMachine(u.handleMessageFromCallMachine,u.callClientId,u),u}return kn(t,qt),fe(t,[{key:"destroy",value:(li=L(function*(){var o;try{yield this.leave()}catch{}var d=this._iframe;if(d){var u=d.parentElement;u&&u.removeChild(d)}if(this._messageChannel.removeListener(this.handleMessageFromCallMachine),B()){var p=this.nativeUtils();p.removeAudioFocusChangeListener(this.handleNativeAudioFocusChange),p.removeAppStateChangeListener(this.handleNativeAppStateChange),p.removeSystemScreenCaptureStopListener(this.handleNativeSystemScreenCaptureStop)}this._callObjectMode&&this.stopListeningForDeviceChanges(),this.resetMeetingDependentVars(),this._destroyed=!0,this.emitDailyJSEvent({action:"call-instance-destroyed"}),delete $e[this.callClientId],!((o=window)===null||o===void 0||(o=o._daily)===null||o===void 0)&&o.instances&&delete window._daily.instances[this.callClientId],this.strictMode&&(this.callClientId=void 0)}),function(){return li.apply(this,arguments)})},{key:"isDestroyed",value:function(){return!!this._destroyed}},{key:"loadCss",value:function(o){var d=o.bodyClass,u=o.cssFile,p=o.cssText;return U(),this.sendMessageToCallMachine({action:"load-css",cssFile:this.absoluteUrl(u),bodyClass:d,cssText:p}),this}},{key:"iframe",value:function(){return U(),this._iframe}},{key:"meetingState",value:function(){return this._callState}},{key:"accessState",value:function(){return ye(this._callObjectMode,"accessState()"),this._accessState}},{key:"participants",value:function(){return this._participants}},{key:"participantCounts",value:function(){return this._participantCounts}},{key:"waitingParticipants",value:function(){return ye(this._callObjectMode,"waitingParticipants()"),this._waitingParticipants}},{key:"validateParticipantProperties",value:function(o,d){for(var u in d){if(!tn[u])throw new Error("unrecognized updateParticipant property ".concat(u));if(tn[u].validate&&!tn[u].validate(d[u],this,this._participants[o]))throw new Error(tn[u].help)}}},{key:"updateParticipant",value:function(o,d){return this._participants.local&&this._participants.local.session_id===o&&(o="local"),o&&d&&(this.validateParticipantProperties(o,d),this.sendMessageToCallMachine({action:"update-participant",id:o,properties:d})),this}},{key:"updateParticipants",value:function(o){var d=this._participants.local&&this._participants.local.session_id;for(var u in o)u===d&&(u="local"),u&&o[u]&&this.validateParticipantProperties(u,o[u]);return this.sendMessageToCallMachine({action:"update-participants",participants:o}),this}},{key:"updateWaitingParticipant",value:(ci=L(function*(){var o=this,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(ye(this._callObjectMode,"updateWaitingParticipant()"),H(this._callState,"updateWaitingParticipant()"),typeof d!="string"||q(u)!=="object")throw new Error("updateWaitingParticipant() must take an id string and a updates object");return new Promise(function(p,g){o.sendMessageToCallMachine({action:"daily-method-update-waiting-participant",id:d,updates:u},function(S){S.error&&g(S.error),S.id||g(new Error("unknown error in updateWaitingParticipant()")),p({id:S.id})})})}),function(){return ci.apply(this,arguments)})},{key:"updateWaitingParticipants",value:(ai=L(function*(){var o=this,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ye(this._callObjectMode,"updateWaitingParticipants()"),H(this._callState,"updateWaitingParticipants()"),q(d)!=="object")throw new Error("updateWaitingParticipants() must take a mapping between ids and update objects");return new Promise(function(u,p){o.sendMessageToCallMachine({action:"daily-method-update-waiting-participants",updatesById:d},function(g){g.error&&p(g.error),g.ids||p(new Error("unknown error in updateWaitingParticipants()")),u({ids:g.ids})})})}),function(){return ai.apply(this,arguments)})},{key:"requestAccess",value:(oi=L(function*(){var o=this,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},u=d.access,p=u===void 0?{level:cl}:u,g=d.name,S=g===void 0?"":g;return ye(this._callObjectMode,"requestAccess()"),H(this._callState,"requestAccess()"),new Promise(function(C,O){o.sendMessageToCallMachine({action:"daily-method-request-access",access:p,name:S},function(P){P.error&&O(P.error),P.access||O(new Error("unknown error in requestAccess()")),C({access:P.access,granted:P.granted})})})}),function(){return oi.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 d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return"forceDiscardTrack"in d&&(B()?(console.warn("forceDiscardTrack option not supported in React Native; ignoring"),d={}):o&&(console.warn("forceDiscardTrack option only supported when calling setLocalAudio(false); ignoring"),d={})),this.sendMessageToCallMachine({action:"local-audio",state:o,options:d}),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:"_setAllowLocalAudio",value:function(o){if(this._preloadCache.allowLocalAudio=o,this._callMachineInitialized)return this.sendMessageToCallMachine({action:"set-allow-local-audio",state:o}),this}},{key:"_setAllowLocalVideo",value:function(o){if(this._preloadCache.allowLocalVideo=o,this._callMachineInitialized)return this.sendMessageToCallMachine({action:"set-allow-local-video",state:o}),this}},{key:"getReceiveSettings",value:(si=L(function*(o){var d=this,u=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).showInheritedValues,p=u!==void 0&&u;if(ye(this._callObjectMode,"getReceiveSettings()"),!this._callMachineInitialized)return this._receiveSettings;switch(q(o)){case"string":return new Promise(function(g){d.sendMessageToCallMachine({action:"get-single-participant-receive-settings",id:o,showInheritedValues:p},function(S){g(S.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 si.apply(this,arguments)})},{key:"updateReceiveSettings",value:(ii=L(function*(o){var d=this;if(ye(this._callObjectMode,"updateReceiveSettings()"),!ta(o,{allowAllParticipantsKey:!0}))throw new Error(ia({allowAllParticipantsKey:!0}));return H(this._callState,"updateReceiveSettings()","To specify receive settings earlier, use the receiveSettings config property."),new Promise(function(u){d.sendMessageToCallMachine({action:"update-receive-settings",receiveSettings:o},function(p){u({receiveSettings:p.receiveSettings})})})}),function(o){return ii.apply(this,arguments)})},{key:"_prepInputSettingsForSharing",value:function(o,d){if(o){var u={};if(o.audio){var p,g,S;o.audio.settings&&(!Object.keys(o.audio.settings).length&&d||(u.audio={settings:I({},o.audio.settings)})),d&&(p=u.audio)!==null&&p!==void 0&&(p=p.settings)!==null&&p!==void 0&&p.customTrack&&(u.audio.settings={customTrack:this._sharedTracks.audioTrack});var C=((g=o.audio.processor)===null||g===void 0?void 0:g.type)==="none"&&((S=o.audio.processor)===null||S===void 0?void 0:S._isDefaultWhenNone);if(o.audio.processor&&!C){var O=I({},o.audio.processor);delete O._isDefaultWhenNone,u.audio=I(I({},u.audio),{},{processor:O})}}if(o.video){var P,D,V;o.video.settings&&(!Object.keys(o.video.settings).length&&d||(u.video={settings:I({},o.video.settings)})),d&&(P=u.video)!==null&&P!==void 0&&(P=P.settings)!==null&&P!==void 0&&P.customTrack&&(u.video.settings={customTrack:this._sharedTracks.videoTrack});var ke=((D=o.video.processor)===null||D===void 0?void 0:D.type)==="none"&&((V=o.video.processor)===null||V===void 0?void 0:V._isDefaultWhenNone);if(o.video.processor&&!ke){var Ve=I({},o.video.processor);delete Ve._isDefaultWhenNone,u.video=I(I({},u.video),{},{processor:Ve})}}return u}}},{key:"getInputSettings",value:function(){var o=this;return U(),new Promise(function(d){d(o._getInputSettings())})}},{key:"_getInputSettings",value:function(){var o,d,u,p,g,S,C={processor:{type:"none",_isDefaultWhenNone:!0}};this._inputSettings?(o=((u=this._inputSettings)===null||u===void 0?void 0:u.video)||C,d=((p=this._inputSettings)===null||p===void 0?void 0:p.audio)||C):(o=((g=this._preloadCache)===null||g===void 0||(g=g.inputSettings)===null||g===void 0?void 0:g.video)||C,d=((S=this._preloadCache)===null||S===void 0||(S=S.inputSettings)===null||S===void 0?void 0:S.audio)||C);var O={audio:d,video:o};return this._prepInputSettingsForSharing(O,!0)}},{key:"_updatePreloadCacheInputSettings",value:function(o,d){var u=this._inputSettings||{},p={};if(o.video){var g,S,C;p.video={},o.video.settings?(p.video.settings={},d||o.video.settings.customTrack||(C=u.video)===null||C===void 0||!C.settings?p.video.settings=o.video.settings:p.video.settings=I(I({},u.video.settings),o.video.settings),Object.keys(p.video.settings).length||delete p.video.settings):(g=u.video)!==null&&g!==void 0&&g.settings&&(p.video.settings=u.video.settings),o.video.processor?p.video.processor=o.video.processor:(S=u.video)!==null&&S!==void 0&&S.processor&&(p.video.processor=u.video.processor)}else u.video&&(p.video=u.video);if(o.audio){var O,P,D;p.audio={},o.audio.settings?(p.audio.settings={},d||o.audio.settings.customTrack||(D=u.audio)===null||D===void 0||!D.settings?p.audio.settings=o.audio.settings:p.audio.settings=I(I({},u.audio.settings),o.audio.settings),Object.keys(p.audio.settings).length||delete p.audio.settings):(O=u.audio)!==null&&O!==void 0&&O.settings&&(p.audio.settings=u.audio.settings),o.audio.processor?p.audio.processor=o.audio.processor:(P=u.audio)!==null&&P!==void 0&&P.processor&&(p.audio.processor=u.audio.processor)}else u.audio&&(p.audio=u.audio);this._maybeUpdateInputSettings(p)}},{key:"_devicesFromInputSettings",value:function(o){var d,u,p=(o==null||(d=o.video)===null||d===void 0||(d=d.settings)===null||d===void 0?void 0:d.deviceId)||null,g=(o==null||(u=o.audio)===null||u===void 0||(u=u.settings)===null||u===void 0?void 0:u.deviceId)||null,S=this._preloadCache.outputDeviceId||null;return{camera:p?{deviceId:p}:{},mic:g?{deviceId:g}:{},speaker:S?{deviceId:S}:{}}}},{key:"updateInputSettings",value:(ri=L(function*(o){var d=this;return U(),na(o)?o.video||o.audio?(ra(o,this.properties.dailyConfig,this._sharedTracks),this._callObjectMode&&!this._callMachineInitialized?(this._updatePreloadCacheInputSettings(o,!0),this._getInputSettings()):new Promise(function(u,p){d.sendMessageToCallMachine({action:"update-input-settings",inputSettings:o},function(g){if(g.error)p(g.error);else{if(g.returnPreloadCache)return d._updatePreloadCacheInputSettings(o,!0),void u(d._getInputSettings());d._maybeUpdateInputSettings(g.inputSettings),u(d._prepInputSettingsForSharing(g.inputSettings,!0))}})})):this._getInputSettings():(console.error(Or()),Promise.reject(Or()))}),function(o){return ri.apply(this,arguments)})},{key:"setBandwidth",value:function(o){var d=o.kbs,u=o.trackConstraints;if(U(),this._callMachineInitialized)return this.sendMessageToCallMachine({action:"set-bandwidth",kbs:d,trackConstraints:u}),this}},{key:"getDailyLang",value:function(){var o=this;if(U(),this._callMachineInitialized)return new Promise(function(d){o.sendMessageToCallMachine({action:"get-daily-lang"},function(u){delete u.action,delete u.callbackStamp,d(u)})})}},{key:"setDailyLang",value:function(o){return U(),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[Le,Re].includes(this._callState)?this._finalSummaryOfPrevSession:this._meetingSessionSummary}},{key:"getMeetingSession",value:(ni=L(function*(){var o=this;return console.warn("getMeetingSession() is deprecated: use meetingSessionSummary(), which will return immediately"),H(this._callState,"getMeetingSession()"),new Promise(function(d){o.sendMessageToCallMachine({action:"get-meeting-session"},function(u){delete u.action,delete u.callbackStamp,d(u)})})}),function(){return ni.apply(this,arguments)})},{key:"meetingSessionState",value:function(){return H(this._callState,"meetingSessionState"),this._meetingSessionState}},{key:"setMeetingSessionData",value:function(o){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"replace";ye(this._callObjectMode,"setMeetingSessionData()"),H(this._callState,"setMeetingSessionData");try{(function(u,p){new mu({data:u,mergeStrategy:p})})(o,d)}catch(u){throw console.error(u),u}try{this.sendMessageToCallMachine({action:"set-session-data",data:o,mergeStrategy:d})}catch(u){throw new Error("Error setting meeting session data: ".concat(u))}}},{key:"setUserName",value:function(o,d){var u=this;return this.properties.userName=o,new Promise(function(p){u.sendMessageToCallMachine({action:"set-user-name",name:o??"",thisMeetingOnly:B()||!!d&&!!d.thisMeetingOnly},function(g){delete g.action,delete g.callbackStamp,p(g)})})}},{key:"setUserData",value:(ti=L(function*(o){var d=this;try{ea(o)}catch(u){throw console.error(u),u}if(this.properties.userData=o,this._callMachineInitialized)return new Promise(function(u){try{d.sendMessageToCallMachine({action:"set-user-data",userData:o},function(p){delete p.action,delete p.callbackStamp,u(p)})}catch(p){throw new Error("Error setting user data: ".concat(p))}})}),function(o){return ti.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 d=this;if(typeof AudioWorkletNode>"u"&&!B())throw new Error("startLocalAudioLevelObserver() is not supported on this browser");if(this.validateAudioLevelInterval(o),this._callMachineInitialized)return this._isLocalAudioLevelObserverRunning=!0,new Promise(function(u,p){d.sendMessageToCallMachine({action:"start-local-audio-level-observer",interval:o},function(g){d._isLocalAudioLevelObserverRunning=!g.error,g.error?p({error:g.error}):u()})});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 d=this;if(this.validateAudioLevelInterval(o),this._callMachineInitialized)return this._isRemoteParticipantsAudioLevelObserverRunning=!0,new Promise(function(u,p){d.sendMessageToCallMachine({action:"start-remote-participants-audio-level-observer",interval:o},function(g){d._isRemoteParticipantsAudioLevelObserverRunning=!g.error,g.error?p({error:g.error}):u()})});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:(ei=L(function*(){var o=this,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ye(this._callObjectMode,"startCamera()"),Zn(this._callState,this._isPreparingToJoin,"startCamera()","Did you mean to use setLocalAudio() and/or setLocalVideo() instead?"),this.needsLoad())try{yield this.load(d)}catch(u){return Promise.reject(u)}else{if(this._didPreAuth){if(d.url&&d.url!==this.properties.url)return console.error("url in startCamera() is different than the one used in preAuth()"),Promise.reject();if(d.token&&d.token!==this.properties.token)return console.error("token in startCamera() is different than the one used in preAuth()"),Promise.reject()}this.validateProperties(d),this.properties=I(I({},this.properties),d)}return new Promise(function(u,p){o._preloadCache.inputSettings=o._prepInputSettingsForSharing(o._inputSettings,!1),o.sendMessageToCallMachine({action:"start-camera",properties:ct(o.properties,o.callClientId),preloadCache:ct(o._preloadCache,o.callClientId)},function(g){g.error?p(g.error):u({camera:g.camera,mic:g.mic,speaker:g.speaker})})})}),function(){return ei.apply(this,arguments)})},{key:"validateCustomTrack",value:function(o,d,u){if(u&&u.length>50)throw new Error("Custom track `trackName` must not be more than 50 characters");if(d&&d!=="music"&&d!=="speech"&&!(d instanceof Object))throw new Error("Custom track `mode` must be either `music` | `speech` | `DailyMicAudioModeSettings` or `undefined`");if(u&&["cam-audio","cam-video","screen-video","screen-audio","rmpAudio","rmpVideo","customVideoDefaults"].includes(u))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,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{track,mode,trackName,ignoreAudioLevel};return U(),H(this._callState,"startCustomTrack()"),this.validateCustomTrack(d.track,d.mode,d.trackName),new Promise(function(u,p){o._sharedTracks.customTrack=d.track,d.track=je,o.sendMessageToCallMachine({action:"start-custom-track",properties:d},function(g){g.error?p({error:g.error}):u(g.mediaTag)})})}},{key:"stopCustomTrack",value:function(o){var d=this;return U(),H(this._callState,"stopCustomTrack()"),new Promise(function(u){d.sendMessageToCallMachine({action:"stop-custom-track",mediaTag:o},function(p){u(p.mediaTag)})})}},{key:"setCamera",value:function(o){var d=this;return Tt(),nn(this._callMachineInitialized,"setCamera()"),new Promise(function(u){d.sendMessageToCallMachine({action:"set-camera",cameraDeviceId:o},function(p){u({device:p.device})})})}},{key:"setAudioDevice",value:(Zr=L(function*(o){return Tt(),this.nativeUtils().setAudioDevice(o),{deviceId:yield this.nativeUtils().getAudioDevice()}}),function(o){return Zr.apply(this,arguments)})},{key:"cycleCamera",value:function(){var o=this,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new Promise(function(u){o.sendMessageToCallMachine({action:"cycle-camera",properties:d},function(p){u({device:p.device})})})}},{key:"cycleMic",value:function(){var o=this;return U(),new Promise(function(d){o.sendMessageToCallMachine({action:"cycle-mic"},function(u){d({device:u.device})})})}},{key:"getCameraFacingMode",value:function(){var o=this;return Tt(),new Promise(function(d){o.sendMessageToCallMachine({action:"get-camera-facing-mode"},function(u){d(u.facingMode)})})}},{key:"setInputDevicesAsync",value:(at=L(function*(o){var d=this,u=o.audioDeviceId,p=o.videoDeviceId,g=o.audioSource,S=o.videoSource;if(U(),g!==void 0&&(u=g),S!==void 0&&(p=S),typeof u=="boolean"&&(this._setAllowLocalAudio(u),u=void 0),typeof p=="boolean"&&(this._setAllowLocalVideo(p),p=void 0),!u&&!p)return yield this.getInputDevices();var C={};return u&&(u instanceof MediaStreamTrack?(this._sharedTracks.audioTrack=u,u=je,C.audio={settings:{customTrack:u}}):(delete this._sharedTracks.audioTrack,C.audio={settings:{deviceId:u}})),p&&(p instanceof MediaStreamTrack?(this._sharedTracks.videoTrack=p,p=je,C.video={settings:{customTrack:p}}):(delete this._sharedTracks.videoTrack,C.video={settings:{deviceId:p}})),this._callObjectMode&&this.needsLoad()?(this._updatePreloadCacheInputSettings(C,!1),this._devicesFromInputSettings(this._inputSettings)):new Promise(function(O){d.sendMessageToCallMachine({action:"set-input-devices",audioDeviceId:u,videoDeviceId:p},function(P){if(delete P.action,delete P.callbackStamp,P.returnPreloadCache)return d._updatePreloadCacheInputSettings(C,!1),void O(d._devicesFromInputSettings(d._inputSettings));O(P)})})}),function(o){return at.apply(this,arguments)})},{key:"setOutputDeviceAsync",value:(ot=L(function*(o){var d=this,u=o.outputDeviceId;if(U(),!u||typeof u!="string")throw new Error("outputDeviceId must be provided and must be a valid device id");return this._preloadCache.outputDeviceId=u,this._callObjectMode&&this.needsLoad()?this._devicesFromInputSettings(this._inputSettings):new Promise(function(p,g){d.sendMessageToCallMachine({action:"set-output-device",outputDeviceId:u},function(S){if(delete S.action,delete S.callbackStamp,S.error){var C=new Error(S.error.message);return C.type=S.error.type,void g(C)}S.returnPreloadCache?p(d._devicesFromInputSettings(d._inputSettings)):p(S)})})}),function(o){return ot.apply(this,arguments)})},{key:"getInputDevices",value:(Oe=L(function*(){var o=this;return this._callObjectMode&&this.needsLoad()?this._devicesFromInputSettings(this._inputSettings):new Promise(function(d){o.sendMessageToCallMachine({action:"get-input-devices"},function(u){u.returnPreloadCache?d(o._devicesFromInputSettings(o._inputSettings)):d({camera:u.camera,mic:u.mic,speaker:u.speaker})})})}),function(){return Oe.apply(this,arguments)})},{key:"nativeInCallAudioMode",value:function(){return Tt(),this._nativeInCallAudioMode}},{key:"setNativeInCallAudioMode",value:function(o){if(Tt(),[Ks,Ru].includes(o)){if(o!==this._nativeInCallAudioMode)return this._nativeInCallAudioMode=o,!this.disableReactNativeAutoDeviceManagement("audio")&&an(this._callState,this._isPreparingToJoin)&&this.nativeUtils().setAudioMode(this._nativeInCallAudioMode),this}else console.error("invalid in-call audio mode specified: ",o)}},{key:"preAuth",value:(X=L(function*(){var o=this,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ye(this._callObjectMode,"preAuth()"),Zn(this._callState,this._isPreparingToJoin,"preAuth()"),this.needsLoad()&&(yield this.load(d)),!d.url)throw new Error("preAuth() requires at least a url to be provided");return this.validateProperties(d),this.properties=I(I({},this.properties),d),new Promise(function(u,p){o._preloadCache.inputSettings=o._prepInputSettingsForSharing(o._inputSettings,!1),o.sendMessageToCallMachine({action:"daily-method-preauth",properties:ct(o.properties,o.callClientId),preloadCache:ct(o._preloadCache,o.callClientId)},function(g){return g.error?p(g.error):g.access?(o._didPreAuth=!0,void u({access:g.access})):p(new Error("unknown error in preAuth()"))})})}),function(){return X.apply(this,arguments)})},{key:"load",value:(J=L(function*(o){var d=this;if(this.needsLoad()){if(this._destroyed&&(this._logUseAfterDestroy(),this.strictMode))throw new Error("Use after destroy");if(o&&(this.validateProperties(o),this.properties=I(I({},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(vs),this.emitDailyJSEvent({action:ml}),this._callObjectMode?new Promise(function(u,p){d._callObjectLoader.cancel();var g=Date.now();d._callObjectLoader.load(d.properties.dailyConfig,function(S){d._bundleLoadTime=S?"no-op":Date.now()-g,d._updateCallState(ys),S&&d.emitDailyJSEvent({action:_s}),u()},function(S,C){if(d.emitDailyJSEvent({action:gl}),!C){d._updateCallState(Re),d.resetMeetingDependentVars();var O={action:Ts,errorMsg:S.msg,error:{type:"connection-error",msg:"Failed to load call object bundle.",details:{on:"load",sourceError:S,bundleUrl:dn(d.properties.dailyConfig)}}};d._maybeSendToSentry(O),d.emitDailyJSEvent(O),p(S.msg)}})}):(this._iframe.src=So(this.assembleMeetingUrl(),this.properties.dailyConfig),new Promise(function(u,p){d._loadedCallback=function(g){d._callState!==Re?(d._updateCallState(ys),(d.properties.cssFile||d.properties.cssText)&&d.loadCss(d.properties),u()):p(g)}}))}}),function(o){return J.apply(this,arguments)})},{key:"join",value:(R=L(function*(){var o=this,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(this._testCallInProgress&&this.stopTestCallQuality(),!d.url&&!this.properties.url){var u="No room URL has been provided";return console.error(u),Promise.reject(new Error(u))}var p=!1;if(this.needsLoad()){this.updateIsPreparingToJoin(!0);try{yield this.load(d)}catch(g){return this.updateIsPreparingToJoin(!1),Promise.reject(g)}}else{if(p=!(!this.properties.cssFile&&!this.properties.cssText),this._didPreAuth){if(d.url&&d.url!==this.properties.url)return console.error("url in join() is different than the one used in preAuth()"),this.updateIsPreparingToJoin(!1),Promise.reject();if(d.token&&d.token!==this.properties.token)return console.error("token in join() is different than the one used in preAuth()"),this.updateIsPreparingToJoin(!1),Promise.reject()}if(d.url&&!this._callObjectMode&&d.url&&d.url!==this.properties.url)return console.error("url in join() is different than the one used in load() (".concat(this.properties.url," -> ").concat(d.url,")")),this.updateIsPreparingToJoin(!1),Promise.reject();this.validateProperties(d),this.properties=I(I({},this.properties),d)}return d.showLocalVideo!==void 0&&(this._callObjectMode?console.error("showLocalVideo is not available in callObject mode"):this._showLocalVideo=!!d.showLocalVideo),d.showParticipantsBar!==void 0&&(this._callObjectMode?console.error("showParticipantsBar is not available in callObject mode"):this._showParticipantsBar=!!d.showParticipantsBar),this._callState===He||this._callState===wr?(console.warn("already joined meeting, call leave() before joining again"),void this.updateIsPreparingToJoin(!1)):(this._updateCallState(wr,!1),this.emitDailyJSEvent({action:bl}),this._preloadCache.inputSettings=this._prepInputSettingsForSharing(this._inputSettings||{},!1),this.sendMessageToCallMachine({action:"join-meeting",properties:ct(this.properties,this.callClientId),preloadCache:ct(this._preloadCache,this.callClientId)},function(g){g.error&&o._joinedCallback&&(o._joinedCallback(null,g.error),o._joinedCallback=null)}),new Promise(function(g,S){o._joinedCallback=function(C,O){if(o._callState!==Re){if(O)return o._updateCallState(Le),void S(O);if(o._updateCallState(He),C)for(var P in C){if(o._callObjectMode){var D=o._callMachine().store;Ns(C[P],D),Fs(C[P],D),Us(C[P],o._participants[P],D)}o._participants[P]=I({},C[P]),o.toggleParticipantAudioBasedOnNativeAudioFocus()}p&&o.loadCss(o.properties),g(C)}else S(O)}}))}),function(){return R.apply(this,arguments)})},{key:"leave",value:(x=L(function*(){var o=this;return this._testCallInProgress&&this.stopTestCallQuality(),new Promise(function(d){o._callState===Le||o._callState===Re?d():o._callObjectLoader&&!o._callObjectLoader.loaded?(o._callObjectLoader.cancel(),o._updateCallState(Le),o.resetMeetingDependentVars(),o.emitDailyJSEvent({action:Le}),d()):(o._resolveLeave=d,o.sendMessageToCallMachine({action:"leave-meeting"}))})}),function(){return x.apply(this,arguments)})},{key:"startScreenShare",value:(j=L(function*(){var o=this,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(nn(this._callMachineInitialized,"startScreenShare()"),d.screenVideoSendSettings&&this._validateVideoSendSettings("screenVideo",d.screenVideoSendSettings),d.mediaStream&&(this._sharedTracks.screenMediaStream=d.mediaStream,d.mediaStream=je),typeof DailyNativeUtils<"u"&&DailyNativeUtils.isIOS!==void 0&&DailyNativeUtils.isIOS){var u=this.nativeUtils();if(yield u.isScreenBeingCaptured())return void this.emitDailyJSEvent({action:Es,type:"screen-share-error",errorMsg:"Could not start the screen sharing. The screen is already been captured!"});u.setSystemScreenCaptureStartCallback(function(){u.setSystemScreenCaptureStartCallback(null),o.sendMessageToCallMachine({action:Ms,captureOptions:d})}),u.presentSystemScreenCapturePrompt()}else this.sendMessageToCallMachine({action:Ms,captureOptions:d})}),function(){return j.apply(this,arguments)})},{key:"stopScreenShare",value:function(){nn(this._callMachineInitialized,"stopScreenShare()"),this.sendMessageToCallMachine({action:"local-screen-stop"})}},{key:"startRecording",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},d=o.type;if(d&&d!=="cloud"&&d!=="cloud-audio-only"&&d!=="raw-tracks"&&d!=="local")throw new Error("invalid type: ".concat(d,", allowed values 'cloud', 'cloud-audio-only', 'raw-tracks', or 'local'"));this.sendMessageToCallMachine(I({action:"local-recording-start"},o))}},{key:"updateRecording",value:function(o){var d=o.layout,u=d===void 0?{preset:"default"}:d,p=o.instanceId;this.sendMessageToCallMachine({action:"daily-method-update-recording",layout:u,instanceId:p})}},{key:"stopRecording",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(I({action:"local-recording-stop"},o))}},{key:"startLiveStreaming",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(I({action:"daily-method-start-live-streaming"},o))}},{key:"updateLiveStreaming",value:function(o){var d=o.layout,u=d===void 0?{preset:"default"}:d,p=o.instanceId;this.sendMessageToCallMachine({action:"daily-method-update-live-streaming",layout:u,instanceId:p})}},{key:"addLiveStreamingEndpoints",value:function(o){var d=o.endpoints,u=o.instanceId;this.sendMessageToCallMachine({action:Os,endpointsOp:au,endpoints:d,instanceId:u})}},{key:"removeLiveStreamingEndpoints",value:function(o){var d=o.endpoints,u=o.instanceId;this.sendMessageToCallMachine({action:Os,endpointsOp:cu,endpoints:d,instanceId:u})}},{key:"stopLiveStreaming",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(I({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."),Jo()&&o.noAutoDefaultDeviceChange&&console.warn("noAutoDefaultDeviceChange is not supported on Android, and will be ignored.")}},{key:"validateSimulcastEncodings",value:function(o){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,u=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(!io(o.length,1,3))throw new Error("encodings must be an Array with between 1 to ".concat(3," layers"));for(var p=0;p<o.length;p++){var g=o[p];for(var S in this._validateEncodingLayerHasValidProperties(g),g)if(Yn.includes(S)){if(typeof g[S]!="number")throw new Error("".concat(S," must be a number"));if(d){var C=d[S],O=C.min,P=C.max;if(!io(g[S],O,P))throw new Error("".concat(S," value not in range. valid range: ").concat(O," to ").concat(P))}}else if(!["active","scalabilityMode"].includes(S))throw new Error("Invalid key ".concat(S,", valid keys are:")+Object.values(Yn));if(u&&!g.hasOwnProperty("maxBitrate"))throw new Error("maxBitrate is not specified")}}}},{key:"startRemoteMediaPlayer",value:(A=L(function*(o){var d=this,u=o.url,p=o.settings,g=p===void 0?{state:Sr.PLAY}:p;try{(function(S){if(typeof S!="string")throw new Error('url parameter must be "string" type')})(u),ro(g),function(S){for(var C in S)if(!Ys.includes(C))throw new Error("Invalid key ".concat(C,", valid keys are: ").concat(Ys));S.simulcastEncodings&&this.validateSimulcastEncodings(S.simulcastEncodings,Zo,!0)}(g)}catch(S){throw console.error("invalid argument Error: ".concat(S)),console.error(`startRemoteMediaPlayer arguments must be of the form:
|
|
26
26
|
{ url: "playback url",
|
|
27
27
|
settings?:
|
|
28
|
-
{state: "play"|"pause", simulcastEncodings?: [{}] } }`),S}return new Promise(function(S,
|
|
28
|
+
{state: "play"|"pause", simulcastEncodings?: [{}] } }`),S}return new Promise(function(S,C){d.sendMessageToCallMachine({action:"daily-method-start-remote-media-player",url:u,settings:g},function(O){O.error?C({error:O.error,errorMsg:O.errorMsg}):S({session_id:O.session_id,remoteMediaPlayerState:{state:O.state,settings:O.settings}})})})}),function(o){return A.apply(this,arguments)})},{key:"stopRemoteMediaPlayer",value:(M=L(function*(o){var d=this;if(typeof o!="string")throw new Error(" remotePlayerID must be of type string");return new Promise(function(u,p){d.sendMessageToCallMachine({action:"daily-method-stop-remote-media-player",session_id:o},function(g){g.error?p({error:g.error,errorMsg:g.errorMsg}):u()})})}),function(o){return M.apply(this,arguments)})},{key:"updateRemoteMediaPlayer",value:(w=L(function*(o){var d=this,u=o.session_id,p=o.settings;try{ro(p)}catch(g){throw console.error("invalid argument Error: ".concat(g)),console.error(`updateRemoteMediaPlayer arguments must be of the form:
|
|
29
29
|
session_id: "participant session",
|
|
30
|
-
{ settings?: {state: "play"|"pause"} }`),g}return new Promise(function(g,S){d.sendMessageToCallMachine({action:"daily-method-update-remote-media-player",session_id:u,settings:p},function(M){M.error?S({error:M.error,errorMsg:M.errorMsg}):g({session_id:M.session_id,remoteMediaPlayerState:{state:M.state,settings:M.settings}})})})}),function(o){return w.apply(this,arguments)})},{key:"startTranscription",value:function(o){H(this._callState,"startTranscription()"),this.sendMessageToCallMachine(I({action:"daily-method-start-transcription"},o))}},{key:"updateTranscription",value:function(o){if(H(this._callState,"updateTranscription()"),!o)throw new Error("updateTranscription Error: options is mandatory");if(q(o)!=="object")throw new Error("updateTranscription Error: options must be object type");if(o.participants&&!Array.isArray(o.participants))throw new Error("updateTranscription Error: participants must be an array");this.sendMessageToCallMachine(I({action:"daily-method-update-transcription"},o))}},{key:"stopTranscription",value:function(o){if(H(this._callState,"stopTranscription()"),o&&q(o)!=="object")throw new Error("stopTranscription Error: options must be object type");if(o&&!o.instanceId)throw new Error('"instanceId" not provided');this.sendMessageToCallMachine(I({action:"daily-method-stop-transcription"},o))}},{key:"startDialOut",value:(y=L(function*(o){var d=this;H(this._callState,"startDialOut()");var u=function(M){if(M){if(!Array.isArray(M))throw new Error("Error starting dial out: audio codec must be an array");if(M.length<=0)throw new Error("Error starting dial out: audio codec array specified but empty");M.forEach(function(O){if(typeof O!="string")throw new Error("Error starting dial out: audio codec must be a string");if(O!=="OPUS"&&O!=="PCMU"&&O!=="PCMA"&&O!=="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(M){if(M&&(u(M.audio),M.video)){if(!Array.isArray(M.video))throw new Error("Error starting dial out: video codec must be an array");if(M.video.length<=0)throw new Error("Error starting dial out: video codec array specified but empty");M.video.forEach(function(O){if(typeof O!="string")throw new Error("Error starting dial out: video codec must be a string");if(O!=="H264"&&O!=="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&&u(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")}if(o.userId){if(typeof o.userId!="string")throw new Error("Error starting dial out: userId must be a string");if(o.userId.length>36)throw new Error("Error starting dial out: userId length must be less than or equal to 36")}if(o.permissions&&o.permissions.canReceive){var p=re(Qo.validateJSONObject(o.permissions.canReceive),2),g=p[0],S=p[1];if(!g)throw new Error(S)}return new Promise(function(M,O){d.sendMessageToCallMachine(I({action:"dialout-start"},o),function(P){P.error?O(P.error):M(P)})})}),function(o){return y.apply(this,arguments)})},{key:"stopDialOut",value:function(o){var d=this;return H(this._callState,"stopDialOut()"),new Promise(function(u,p){d.sendMessageToCallMachine(I({action:"dialout-stop"},o),function(g){g.error?p(g.error):u(g)})})}},{key:"sipCallTransfer",value:(m=L(function*(o){var d=this;if(H(this._callState,"sipCallTransfer()"),!o)throw new Error("sipCallTransfer() requires a sessionId and toEndPoint");return o.useSipRefer=!1,to(o,"sipCallTransfer"),new Promise(function(u,p){d.sendMessageToCallMachine(I({action:Os},o),function(g){g.error?p(g.error):u(g)})})}),function(o){return m.apply(this,arguments)})},{key:"sipRefer",value:(b=L(function*(o){var d=this;if(H(this._callState,"sipRefer()"),!o)throw new Error("sessionId and toEndPoint are mandatory parameter");return o.useSipRefer=!0,to(o,"sipRefer"),new Promise(function(u,p){d.sendMessageToCallMachine(I({action:Os},o),function(g){g.error?p(g.error):u(g)})})}),function(o){return b.apply(this,arguments)})},{key:"sendDTMF",value:(k=L(function*(o){var d=this;return H(this._callState,"sendDTMF()"),function(u){var p=u.sessionId,g=u.tones;if(!p||!g)throw new Error("sessionId and tones are mandatory parameter");if(typeof p!="string"||typeof g!="string")throw new Error("sessionId and tones should be of string type");if(g.length>20)throw new Error("tones string must be upto 20 characters");var S=/[^0-9A-D*#]/g,M=g.match(S);if(M&&M[0])throw new Error("".concat(M[0]," is not valid DTMF tone"))}(o),new Promise(function(u,p){d.sendMessageToCallMachine(I({action:"send-dtmf"},o),function(g){g.error?p(g.error):u(g)})})}),function(o){return k.apply(this,arguments)})},{key:"getNetworkStats",value:function(){var o=this;return this._callState!==He?Promise.resolve(I({stats:{latest:{}}},this._network)):new Promise(function(d){o.sendMessageToCallMachine({action:"get-calc-stats"},function(u){d(I(I({},o._network),{},{stats:u.stats}))})})}},{key:"testWebsocketConnectivity",value:(E=L(function*(){var o=this;if(Zn(this._testCallInProgress,"testWebsocketConnectivity()"),this.needsLoad())try{yield this.load()}catch(d){return Promise.reject(d)}return new Promise(function(d,u){o.sendMessageToCallMachine({action:"test-websocket-connectivity"},function(p){p.error?u(p.error):d(p.results)})})}),function(){return E.apply(this,arguments)})},{key:"abortTestWebsocketConnectivity",value:function(){this.sendMessageToCallMachine({action:"abort-test-websocket-connectivity"})}},{key:"_validateVideoTrackForNetworkTests",value:function(o){return o?o instanceof MediaStreamTrack?!!Au(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:(v=L(function*(){var o=this;U(),ye(this._callObjectMode,"testCallQuality()"),nn(this._callMachineInitialized,"testCallQuality()",null,!0),Yn(this._callState,this._isPreparingToJoin,"testCallQuality()");var d=this._testCallAlreadyInProgress,u=function(g){d||(o._testCallInProgress=g)};if(u(!0),this.needsLoad())try{var p=this._callState;yield this.load(),this._callState=p}catch(g){return u(!1),Promise.reject(g)}return new Promise(function(g){o.sendMessageToCallMachine({action:"test-call-quality",dailyJsVersion:o.properties.dailyJsVersion},function(S){var M=S.results,O=M.result,P=ui(M,ju);if(O==="failed"){var F,B=I({},P);(F=P.error)!==null&&F!==void 0&&F.details?(P.error.details=JSON.parse(P.error.details),B.error=I(I({},B.error),{},{details:I({},B.error.details)}),B.error.details.duringTest="testCallQuality"):(B.error=B.error?I({},B.error):{},B.error.details={duringTest:"testCallQuality"}),o._maybeSendToSentry(B)}u(!1),g(I({result:O},P))})})}),function(){return v.apply(this,arguments)})},{key:"stopTestCallQuality",value:function(){this.sendMessageToCallMachine({action:"stop-test-call-quality"})}},{key:"testConnectionQuality",value:(h=L(function*(o){var d;V()?(console.warn("testConnectionQuality() is deprecated: use testPeerToPeerCallQuality() instead"),d=yield this.testPeerToPeerCallQuality(o)):(console.warn("testConnectionQuality() is deprecated: use testCallQuality() instead"),d=yield this.testCallQuality());var u={result:d.result,secondsElapsed:d.secondsElapsed};return d.data&&(u.data={maxRTT:d.data.maxRoundTripTime,packetLoss:d.data.avgRecvPacketLoss}),u}),function(o){return h.apply(this,arguments)})},{key:"testPeerToPeerCallQuality",value:(f=L(function*(o){var d=this;if(Zn(this._testCallInProgress,"testPeerToPeerCallQuality()"),this.needsLoad())try{yield this.load()}catch(g){return Promise.reject(g)}var u=o.videoTrack,p=o.duration;if(!this._validateVideoTrackForNetworkTests(u))throw new Error("Video track error");return this._sharedTracks.videoTrackForConnectionQualityTest=u,new Promise(function(g,S){d.sendMessageToCallMachine({action:"test-p2p-call-quality",duration:p},function(M){M.error?S(M.error):g(M.results)})})}),function(o){return f.apply(this,arguments)})},{key:"stopTestConnectionQuality",value:function(){V()?(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=L(function*(o){var d=this;if(Zn(this._testCallInProgress,"testNetworkConnectivity()"),this.needsLoad())try{yield this.load()}catch(u){return Promise.reject(u)}if(!this._validateVideoTrackForNetworkTests(o))throw new Error("Video track error");return this._sharedTracks.videoTrackForNetworkConnectivityTest=o,new Promise(function(u,p){d.sendMessageToCallMachine({action:"test-network-connectivity"},function(g){g.error?p(g.error):u(g.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(d){o._callState===He?o.sendMessageToCallMachine({action:"get-cpu-load-stats"},function(u){d(u.cpuStats)}):d({cpuLoadState:void 0,cpuLoadStateReason:void 0,stats:{}})})}},{key:"_validateEncodingLayerHasValidProperties",value:function(o){var d;if(!(((d=Object.keys(o))===null||d===void 0?void 0:d.length)>0))throw new Error("Empty encoding is not allowed. At least one of these valid keys should be specified:"+Object.values(Xn))}},{key:"_validateVideoSendSettings",value:function(o,d){var u=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"],p="Video send settings should be either an object or one of the supported presets: ".concat(u.join());if(typeof d=="string"){if(!u.includes(d))throw new Error(p)}else{if(q(d)!=="object")throw new Error(p);if(!d.maxQuality&&!d.encodings&&d.allowAdaptiveLayers===void 0)throw new Error("Video send settings must contain at least maxQuality, allowAdaptiveLayers or encodings attribute");if(d.maxQuality&&["low","medium","high"].indexOf(d.maxQuality)===-1)throw new Error("maxQuality must be either low, medium or high");if(d.encodings){var g=!1;switch(Object.keys(d.encodings).length){case 1:g=!d.encodings.low;break;case 2:g=!d.encodings.low||!d.encodings.medium;break;case 3:g=!d.encodings.low||!d.encodings.medium||!d.encodings.high;break;default:g=!0}if(g)throw new Error("Encodings must be defined as: low, low and medium, or low, medium and high.");d.encodings.low&&this._validateEncodingLayerHasValidProperties(d.encodings.low),d.encodings.medium&&this._validateEncodingLayerHasValidProperties(d.encodings.medium),d.encodings.high&&this._validateEncodingLayerHasValidProperties(d.encodings.high)}}}},{key:"validateUpdateSendSettings",value:function(o){var d=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(u){var p=re(u,2),g=p[0],S=p[1];d._validateVideoSendSettings(g,S)})}},{key:"updateSendSettings",value:function(o){var d=this;return this.validateUpdateSendSettings(o),this.needsLoad()?(this._preloadCache.sendSettings=o,{sendSettings:this._preloadCache.sendSettings}):new Promise(function(u,p){d.sendMessageToCallMachine({action:"update-send-settings",sendSettings:o},function(g){g.error?p(g.error):u(g.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 U(),this._activeSpeaker}},{key:"setActiveSpeakerMode",value:function(o){return U(),this.sendMessageToCallMachine({action:"set-active-speaker-mode",enabled:o}),this}},{key:"activeSpeakerMode",value:function(){return U(),this._activeSpeakerMode}},{key:"subscribeToTracksAutomatically",value:function(){return this._preloadCache.subscribeToTracksAutomatically}},{key:"setSubscribeToTracksAutomatically",value:function(o){return H(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=L(function*(){var o=this;if(this._callObjectMode){var d=yield navigator.mediaDevices.enumerateDevices();return nt()==="Firefox"&&vn().major>115&&vn().major<123&&(d=d.filter(function(u){return u.kind!=="audiooutput"})),{devices:d.map(function(u){var p=JSON.parse(JSON.stringify(u));if(!V()&&u.kind==="videoinput"&&u.getCapabilities){var g,S=u.getCapabilities();p.facing=(S==null||(g=S.facingMode)===null||g===void 0?void 0:g.length)>=1?S.facingMode[0]:void 0}return p})}}return new Promise(function(u){o.sendMessageToCallMachine({action:"enumerate-devices"},function(p){u({devices:p.devices})})})}),function(){return c.apply(this,arguments)})},{key:"sendAppMessage",value:function(o){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"*";if(H(this._callState,"sendAppMessage()"),JSON.stringify(o).length>this._maxAppMessageSize)throw new Error("Message data too large. Max size is "+this._maxAppMessageSize);return this.sendMessageToCallMachine({action:"app-msg",data:o,to:d}),this}},{key:"addFakeParticipant",value:function(o){return U(),H(this._callState,"addFakeParticipant()"),this.sendMessageToCallMachine(I({action:"add-fake-participant"},o)),this}},{key:"setShowNamesMode",value:function(o){return le(this._callObjectMode,"setShowNamesMode()"),U(),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 le(this._callObjectMode,"setShowLocalVideo()"),U(),H(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 le(this._callObjectMode,"showLocalVideo()"),U(),this._showLocalVideo}},{key:"setShowParticipantsBar",value:function(){var o=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];return le(this._callObjectMode,"setShowParticipantsBar()"),U(),H(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 le(this._callObjectMode,"showParticipantsBar()"),U(),this._showParticipantsBar}},{key:"customIntegrations",value:function(){return U(),le(this._callObjectMode,"customIntegrations()"),this._customIntegrations}},{key:"setCustomIntegrations",value:function(o){return U(),le(this._callObjectMode,"setCustomIntegrations()"),H(this._callState,"setCustomIntegrations()"),oa(o)?(this.sendMessageToCallMachine({action:"set-custom-integrations",integrations:o}),this._customIntegrations=o,this):this}},{key:"startCustomIntegrations",value:function(o){var d=this;if(U(),le(this._callObjectMode,"startCustomIntegrations()"),H(this._callState,"startCustomIntegrations()"),Array.isArray(o)&&o.some(function(g){return typeof g!="string"})||!Array.isArray(o)&&typeof o!="string")return console.error("startCustomIntegrations() only accepts string | string[]"),this;var u=typeof o=="string"?[o]:o,p=u.filter(function(g){return!(g in d._customIntegrations)});return p.length?(console.error(`Can't find custom integration(s): "`.concat(p.join(", "),'"')),this):(this.sendMessageToCallMachine({action:"start-custom-integrations",ids:u}),this)}},{key:"stopCustomIntegrations",value:function(o){var d=this;if(U(),le(this._callObjectMode,"stopCustomIntegrations()"),H(this._callState,"stopCustomIntegrations()"),Array.isArray(o)&&o.some(function(g){return typeof g!="string"})||!Array.isArray(o)&&typeof o!="string")return console.error("stopCustomIntegrations() only accepts string | string[]"),this;var u=typeof o=="string"?[o]:o,p=u.filter(function(g){return!(g in d._customIntegrations)});return p.length?(console.error(`Can't find custom integration(s): "`.concat(p.join(", "),'"')),this):(this.sendMessageToCallMachine({action:"stop-custom-integrations",ids:u}),this)}},{key:"customTrayButtons",value:function(){return le(this._callObjectMode,"customTrayButtons()"),U(),this._customTrayButtons}},{key:"updateCustomTrayButtons",value:function(o){return le(this._callObjectMode,"updateCustomTrayButtons()"),U(),H(this._callState,"updateCustomTrayButtons()"),sa(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(bn))),this)}},{key:"theme",value:function(){return le(this._callObjectMode,"theme()"),this.properties.theme}},{key:"setTheme",value:function(o){var d=this;return le(this._callObjectMode,"setTheme()"),new Promise(function(u,p){try{d.validateProperties({theme:o}),d.properties.theme=I({},o),d.sendMessageToCallMachine({action:"set-theme",theme:d.properties.theme});try{d.emitDailyJSEvent({action:hl,theme:d.properties.theme})}catch(g){console.log("could not emit 'theme-updated'",g)}u(d.properties.theme)}catch(g){p(g)}})}},{key:"requestFullscreen",value:(a=L(function*(){if(U(),this._iframe&&!document.fullscreenElement&&As())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(){U(),document.fullscreenElement?document.exitFullscreen():document.webkitFullscreenElement&&document.webkitExitFullscreen()}},{key:"getSidebarView",value:(s=L(function*(){var o=this;return this._callObjectMode?(console.error("getSidebarView is not available in callObject mode"),Promise.resolve(null)):new Promise(function(d){o.sendMessageToCallMachine({action:"get-sidebar-view"},function(u){d(u.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=L(function*(){var o=this,d=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).includeRoomConfigDefaults,u=d===void 0||d;return this._accessState.access===zn||this.needsLoad()?this.properties.url?{roomUrlPendingJoin:this.properties.url}:null:new Promise(function(p){o.sendMessageToCallMachine({action:"lib-room-info",includeRoomConfigDefaults:u},function(g){delete g.action,delete g.callbackStamp,p(g)})})}),function(){return i.apply(this,arguments)})},{key:"geo",value:(r=L(function*(){try{var o=yield fetch("https://gs.daily.co/_ks_/x-swsl/:");return{current:(yield o.json()).geo}}catch(d){return console.error("geo lookup failed",d),{current:""}}}),function(){return r.apply(this,arguments)})},{key:"setNetworkTopology",value:(n=L(function*(o){var d=this;return U(),H(this._callState,"setNetworkTopology()"),new Promise(function(u,p){d.sendMessageToCallMachine({action:"set-network-topology",opts:o},function(g){g.error?p({error:g.error}):u({workerId:g.workerId})})})}),function(o){return n.apply(this,arguments)})},{key:"getNetworkTopology",value:(e=L(function*(){var o=this;return new Promise(function(d,u){o.needsLoad()&&d({topology:"none"}),o.sendMessageToCallMachine({action:"get-network-topology"},function(p){p.error?u({error:p.error}):d({topology:p.topology})})})}),function(){return e.apply(this,arguments)})},{key:"setPlayNewParticipantSound",value:function(o){if(U(),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,d){return qt.prototype.on.call(this,o,d)}},{key:"once",value:function(o,d){return qt.prototype.once.call(this,o,d)}},{key:"off",value:function(o,d){return qt.prototype.off.call(this,o,d)}},{key:"validateProperties",value:function(o){var d,u;if(o!=null&&(d=o.dailyConfig)!==null&&d!==void 0&&d.userMediaAudioConstraints){var p,g;V()||console.warn("userMediaAudioConstraints is deprecated. You can override constraints with inputSettings.audio.settings, found in DailyCallOptions.");var S=o.inputSettings||{};S.audio=((p=o.inputSettings)===null||p===void 0?void 0:p.audio)||{},S.audio.settings=((g=o.inputSettings)===null||g===void 0||(g=g.audio)===null||g===void 0?void 0:g.settings)||{},S.audio.settings=I(I({},S.audio.settings),o.dailyConfig.userMediaAudioConstraints),o.inputSettings=S,delete o.dailyConfig.userMediaAudioConstraints}if(o!=null&&(u=o.dailyConfig)!==null&&u!==void 0&&u.userMediaVideoConstraints){var M,O;V()||console.warn("userMediaVideoConstraints is deprecated. You can override constraints with inputSettings.video.settings, found in DailyCallOptions.");var P=o.inputSettings||{};P.video=((M=o.inputSettings)===null||M===void 0?void 0:M.video)||{},P.video.settings=((O=o.inputSettings)===null||O===void 0||(O=O.video)===null||O===void 0?void 0:O.settings)||{},P.video.settings=I(I({},P.video.settings),o.dailyConfig.userMediaVideoConstraints),o.inputSettings=P,delete o.dailyConfig.userMediaVideoConstraints}for(var F in o){if(!ze[F])throw new Error("unrecognized property '".concat(F,"'"));if(ze[F].validate&&!ze[F].validate(o[F],this))throw new Error("property '".concat(F,"': ").concat(ze[F].help))}}},{key:"assembleMeetingUrl",value:function(){var o,d,u=I(I({},this.properties),{},{emb:this.callClientId,embHref:encodeURIComponent(window.location.href),proxy:(o=this.properties.dailyConfig)!==null&&o!==void 0&&o.proxyUrl?encodeURIComponent((d=this.properties.dailyConfig)===null||d===void 0?void 0:d.proxyUrl):void 0}),p=u.url.match(/\?/)?"&":"?";return u.url+p+Object.keys(ze).filter(function(g){return ze[g].queryString&&u[g]!==void 0}).map(function(g){return"".concat(ze[g].queryString,"=").concat(u[g])}).join("&")}},{key:"needsLoad",value:function(){return[ms,gs,qe,Le].includes(this._callState)}},{key:"sendMessageToCallMachine",value:function(o,d){if(this._destroyed&&(this._logUseAfterDestroy(),this.strictMode))throw new Error("Use after destroy");this._messageChannel.sendMessageToCallMachine(o,d,this.callClientId,this._iframe)}},{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 dl:this.sendMessageToCallMachine(I({action:fl},this.properties));break;case"call-machine-initialized":this._callMachineInitialized=!0;var d={action:Zt,level:"log",code:1011,stats:{event:"bundle load",time:this._bundleLoadTime==="no-op"?0:this._bundleLoadTime,preLoaded:this._bundleLoadTime==="no-op",url:dn(this.properties.dailyConfig)}};this.sendMessageToCallMachine(d),this._delayDuplicateInstanceLog&&this._logDuplicateInstanceAttempt();break;case bs:this._loadedCallback&&(this._loadedCallback(),this._loadedCallback=null),this.emitDailyJSEvent(o);break;case bl:var u,p=I({},o);delete p.internal,this._maxAppMessageSize=((u=o.internal)===null||u===void 0?void 0:u._maxAppMessageSize)||Hn,this._joinedCallback&&(this._joinedCallback(o.participants),this._joinedCallback=null),this.emitDailyJSEvent(p);break;case wl:case Sl:if(this._callState===qe)return;if(o.participant&&o.participant.session_id){var g=o.participant.local?"local":o.participant.session_id;if(this._callObjectMode){var S=this._callMachine().store;Ns(o.participant,S),Fs(o.participant,S),Us(o.participant,this._participants[g],S)}try{this.maybeParticipantTracksStopped(this._participants[g],o.participant),this.maybeParticipantTracksStarted(this._participants[g],o.participant),this.maybeEventRecordingStopped(this._participants[g],o.participant),this.maybeEventRecordingStarted(this._participants[g],o.participant)}catch(Na){console.error("track events error",Na)}this.compareEqualForParticipantUpdateEvent(o.participant,this._participants[g])||(this._participants[g]=I({},o.participant),this.toggleParticipantAudioBasedOnNativeAudioFocus(),this.emitDailyJSEvent(o))}break;case kl: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 El:se(this._participantCounts,o.participantCounts)||(this._participantCounts=o.participantCounts,this.emitDailyJSEvent(o));break;case Tl:var O={access:o.access};o.awaitingAccess&&(O.awaitingAccess=o.awaitingAccess),se(this._accessState,O)||(this._accessState=O,this.emitDailyJSEvent(o));break;case Cl:if(o.meetingSession){this._meetingSessionSummary=o.meetingSession,this.emitDailyJSEvent(o);var P=I(I({},o),{},{action:"meeting-session-updated"});this.emitDailyJSEvent(P)}break;case Es:var F;this._iframe&&!o.preserveIframe&&(this._iframe.src=""),this._updateCallState(Le),this.resetMeetingDependentVars(),this._loadedCallback&&(this._loadedCallback(o.errorMsg),this._loadedCallback=null),o.preserveIframe;var B=ui(o,Iu);B!=null&&(F=B.error)!==null&&F!==void 0&&F.details&&(B.error.details=JSON.parse(B.error.details)),this._maybeSendToSentry(o),this._joinedCallback&&(this._joinedCallback(null,B),this._joinedCallback=null),this.emitDailyJSEvent(B);break;case _l:this._callState!==Le&&this._updateCallState(qe),this.resetMeetingDependentVars(),this._resolveLeave&&(this._resolveLeave(),this._resolveLeave=null),this.emitDailyJSEvent(o);break;case"selected-devices-updated":o.devices&&this.emitDailyJSEvent(o);break;case Ql:var ke=o.state,Be=o.threshold,_t=o.quality,Y=ke.state,he=ke.reasons;Y===this._network.networkState&&se(he,this._network.networkStateReasons)&&Be===this._network.threshold&&_t===this._network.quality||(this._network.networkState=Y,this._network.networkStateReasons=he,this._network.quality=_t,this._network.threshold=Be,o.networkState=Y,he.length&&(o.networkStateReasons=he),delete o.state,this.emitDailyJSEvent(o));break;case Yl:o&&o.cpuLoadState&&this.emitDailyJSEvent(o);break;case Zl:o&&o.faceCounts!==void 0&&this.emitDailyJSEvent(o);break;case Gl:var Ve=o.activeSpeaker;this._activeSpeaker.peerId!==Ve.peerId&&(this._activeSpeaker.peerId=Ve.peerId,this.emitDailyJSEvent({action:o.action,activeSpeaker:this._activeSpeaker}));break;case"show-local-video-changed":if(this._callObjectMode)return;var wt=o.show;this._showLocalVideo=wt,this.emitDailyJSEvent({action:o.action,show:wt});break;case Kl:var Vt=o.enabled;this._activeSpeakerMode!==Vt&&(this._activeSpeakerMode=Vt,this.emitDailyJSEvent({action:o.action,enabled:this._activeSpeakerMode}));break;case Ol:case Al:case Pl:this._waitingParticipants=o.allWaitingParticipants,this.emitDailyJSEvent({action:o.action,participant:o.participant});break;case su:se(this._receiveSettings,o.receiveSettings)||(this._receiveSettings=o.receiveSettings,this.emitDailyJSEvent({action:o.action,receiveSettings:o.receiveSettings}));break;case Ss:this._maybeUpdateInputSettings(o.inputSettings);break;case"send-settings-updated":se(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 Jl:var St=o.session_id;this._rmpPlayerState[St]=o.playerState,this.emitDailyJSEvent(o);break;case $l:delete this._rmpPlayerState[o.session_id],this.emitDailyJSEvent(o);break;case ql:var kt=o.session_id,li=this._rmpPlayerState[kt];li&&this.compareEqualForRMPUpdateEvent(li,o.remoteMediaPlayerState)||(this._rmpPlayerState[kt]=o.remoteMediaPlayerState,this.emitDailyJSEvent(o));break;case"custom-button-click":case"sidebar-view-changed":this.emitDailyJSEvent(o);break;case Ml:var Da=this._meetingSessionState.topology!==(o.meetingSessionState&&o.meetingSessionState.topology);this._meetingSessionState=er(o.meetingSessionState,this._callObjectMode),(this._callObjectMode||Da)&&this.emitDailyJSEvent(o);break;case zl:this._isScreenSharing=!0,this.emitDailyJSEvent(o);break;case Hl:case Wl:this._isScreenSharing=!1,this.emitDailyJSEvent(o);break;case _s:case ws:case Dl:case Nl:case Fl:case Il:case Ll:case Rl:case gl:case vl:case Bl:case Vl:case"test-completed":case Xl:case Ul:case eu:case tu:case nu:case ru:case ks:case iu: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,d){var u="record";o&&(d.local||d[u]!==!1||o[u]===d[u]||this.emitDailyJSEvent({action:ws}))}},{key:"maybeEventRecordingStarted",value:function(o,d){var u="record";o&&(d.local||d[u]!==!0||o[u]===d[u]||this.emitDailyJSEvent({action:_s}))}},{key:"_trackStatePlayable",value:function(o){return!(!o||o.state!==ol)}},{key:"_trackChanged",value:function(o,d){return(o==null?void 0:o.id)!==(d==null?void 0:d.id)}},{key:"maybeEventTrackStopped",value:function(o,d,u){var p,g,S=(p=d==null?void 0:d.tracks[o])!==null&&p!==void 0?p:null,M=(g=u==null?void 0:u.tracks[o])!==null&&g!==void 0?g:null,O=S==null?void 0:S.track;if(O){var P=this._trackStatePlayable(S),F=this._trackStatePlayable(M),B=this._trackChanged(O,M==null?void 0:M.track);P&&(F&&!B||this.emitDailyJSEvent({action:jl,track:O,participant:u??d,type:o}))}}},{key:"maybeEventTrackStarted",value:function(o,d,u){var p,g,S=(p=d==null?void 0:d.tracks[o])!==null&&p!==void 0?p:null,M=(g=u==null?void 0:u.tracks[o])!==null&&g!==void 0?g:null,O=M==null?void 0:M.track;if(O){var P=this._trackStatePlayable(S),F=this._trackStatePlayable(M),B=this._trackChanged(S==null?void 0:S.track,O);F&&(P&&!B||this.emitDailyJSEvent({action:xl,track:O,participant:u,type:o}))}}},{key:"maybeParticipantTracksStopped",value:function(o,d){if(o)for(var u in o.tracks)this.maybeEventTrackStopped(u,o,d)}},{key:"maybeParticipantTracksStarted",value:function(o,d){if(d)for(var u in d.tracks)this.maybeEventTrackStarted(u,o,d)}},{key:"compareEqualForRMPUpdateEvent",value:function(o,d){var u,p;return o.state===d.state&&((u=o.settings)===null||u===void 0?void 0:u.volume)===((p=d.settings)===null||p===void 0?void 0:p.volume)}},{key:"emitDailyJSEvent",value:function(o){try{o.callClientId=this.callClientId,this.emit(o.action,o)}catch(d){console.log("could not emit",o,d)}}},{key:"compareEqualForParticipantUpdateEvent",value:function(o,d){return!!se(o,d)&&(!o.videoTrack||!d.videoTrack||o.videoTrack.id===d.videoTrack.id&&o.videoTrack.muted===d.videoTrack.muted&&o.videoTrack.enabled===d.videoTrack.enabled)&&(!o.audioTrack||!d.audioTrack||o.audioTrack.id===d.audioTrack.id&&o.audioTrack.muted===d.audioTrack.muted&&o.audioTrack.enabled===d.audioTrack.enabled)}},{key:"nativeUtils",value:function(){return V()?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 d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._isPreparingToJoin;if(o!==this._callState||d!==this._isPreparingToJoin){var u=this._callState,p=this._isPreparingToJoin;this._callState=o,this._isPreparingToJoin=d;var g=this._callState===He;this.updateShowAndroidOngoingMeetingNotification(g);var S=an(u,p),M=an(this._callState,this._isPreparingToJoin);S!==M&&(this.updateKeepDeviceAwake(M),this.updateDeviceAudioMode(M),this.updateNoOpRecordingEnsuringBackgroundContinuity(M))}}},{key:"resetMeetingDependentVars",value:function(){this._participants={},this._participantCounts=Xs,this._waitingParticipants={},this._activeSpeaker={},this._activeSpeakerMode=!1,this._didPreAuth=!1,this._accessState={access:zn},this._finalSummaryOfPrevSession=this._meetingSessionSummary,this._meetingSessionSummary={},this._meetingSessionState=er(Qs,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._maxAppMessageSize=Hn,this._callMachineInitialized=!1,this._bundleLoadTime=void 0,this._preloadCache}},{key:"updateKeepDeviceAwake",value:function(o){V()&&this.nativeUtils().setKeepDeviceAwake(o,this.callClientId)}},{key:"updateDeviceAudioMode",value:function(o){if(V()&&!this.disableReactNativeAutoDeviceManagement("audio")){var d=o?this._nativeInCallAudioMode:"idle";this.nativeUtils().setAudioMode(d)}}},{key:"updateShowAndroidOngoingMeetingNotification",value:function(o){if(V()&&this.nativeUtils().setShowOngoingMeetingNotification){var d,u,p,g;if(this.properties.reactNativeConfig&&this.properties.reactNativeConfig.androidInCallNotification){var S=this.properties.reactNativeConfig.androidInCallNotification;d=S.title,u=S.subtitle,p=S.iconName,g=S.disableForCustomOverride}g&&(o=!1),this.nativeUtils().setShowOngoingMeetingNotification(o,d,u,p,this.callClientId)}}},{key:"updateNoOpRecordingEnsuringBackgroundContinuity",value:function(o){V()&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity(o)}},{key:"toggleParticipantAudioBasedOnNativeAudioFocus",value:function(){var o;if(V()){var d=(o=this._callMachine())===null||o===void 0||(o=o.store)===null||o===void 0?void 0:o.getState();for(var u in d==null?void 0:d.streams){var p=d.streams[u];p&&p.pendingTrack&&p.pendingTrack.kind==="audio"&&(p.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 d=document.createElement("a");return d.href=o,d.href}}},{key:"sayHello",value:function(){var o="hello, world.";return console.log(o),o}},{key:"_logUseAfterDestroy",value:function(){var o=Object.values($e)[0];if(this.needsLoad())if(o&&!o.needsLoad()){var d={action:Zt,level:"error",code:this.strictMode?9995:9997};o.sendMessageToCallMachine(d)}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 u={action:Zt,level:"error",code:this.strictMode?9995:9997};this._messageChannel.sendMessageToCallMachine(u,null,this.callClientId,this._iframe)}}},{key:"_logDuplicateInstanceAttempt",value:function(){for(var o=0,d=Object.values($e);o<d.length;o++){var u=d[o];u._callMachineInitialized?(u.sendMessageToCallMachine({action:Zt,level:"warn",code:this.allowMultipleCallInstances?9993:9992}),u._delayDuplicateInstanceLog=!1):u._delayDuplicateInstanceLog=!0}}},{key:"_maybeSendToSentry",value:function(o){var d,u,p,g;if(!((d=o.error)!==null&&d!==void 0&&d.type&&(![ul,ll,ys].includes(o.error.type)||o.error.type===ys&&o.error.msg.includes("deleted")))){var S=(u=this.properties)!==null&&u!==void 0&&u.url?new URL(this.properties.url):void 0,M="production";S&&S.host.includes(".staging.daily")&&(M="staging");var O,P,F,B,ke,Be=function(St){const kt=[Cc(),Ec(),Yc(),Qc(),rl(),sl(),Pc(),il()];return St.autoSessionTracking!==!1&&kt.push(nl()),kt}({}).filter(function(St){return!["BrowserApiErrors","Breadcrumbs","GlobalHandlers"].includes(St.name)}),_t=new Fc({dsn:"https://f10f1c81e5d44a4098416c0867a8b740@o77906.ingest.sentry.io/168844",transport:qc,stackParser:Kc,integrations:Be,environment:M}),Y=new Ue;if(Y.setClient(_t),_t.init(),this.session_id&&Y.setExtra("sessionId",this.session_id),this.properties){var he=I({},this.properties);he.userName=he.userName?"[Filtered]":void 0,he.userData=he.userData?"[Filtered]":void 0,he.token=he.token?"[Filtered]":void 0,Y.setExtra("properties",he)}if(S){var Ve=S.searchParams.get("domain");if(!Ve){var wt=S.host.match(/(.*?)\./);Ve=wt&&wt[1]||""}Ve&&Y.setTag("domain",Ve)}o.error&&(Y.setTag("fatalErrorType",o.error.type),Y.setExtra("errorDetails",o.error.details),!((O=o.error.details)===null||O===void 0)&&O.uri&&Y.setTag("serverAddress",o.error.details.uri),!((P=o.error.details)===null||P===void 0)&&P.workerGroup&&Y.setTag("workerGroup",o.error.details.workerGroup),!((F=o.error.details)===null||F===void 0)&&F.geoGroup&&Y.setTag("geoGroup",o.error.details.geoGroup),!((B=o.error.details)===null||B===void 0)&&B.on&&Y.setTag("connectionAttempt",o.error.details.on),(ke=o.error.details)!==null&&ke!==void 0&&ke.bundleUrl&&(Y.setTag("bundleUrl",o.error.details.bundleUrl),Y.setTag("bundleError",o.error.details.sourceError.type))),Y.setTags({callMode:this._callObjectMode?V()?"reactNative":(p=this.properties)!==null&&p!==void 0&&(p=p.dailyConfig)!==null&&p!==void 0&&(p=p.callMode)!==null&&p!==void 0&&p.includes("prebuilt")?this.properties.dailyConfig.callMode:"custom":"prebuilt-frame",version:t.version()});var Vt=((g=o.error)===null||g===void 0?void 0:g.msg)||o.errorMsg;Y.captureException(new Error(Vt))}}},{key:"_callMachine",value:function(){var o;return(o=window._daily)===null||o===void 0||(o=o.instances)===null||o===void 0||(o=o[this.callClientId])===null||o===void 0?void 0:o.callMachine}},{key:"_maybeUpdateInputSettings",value:function(o){if(!se(this._inputSettings,o)){var d=this._getInputSettings();this._inputSettings=o;var u=this._getInputSettings();se(d,u)||this.emitDailyJSEvent({action:Ss,inputSettings:u})}}}],[{key:"supportedBrowser",value:function(){if(V())return{supported:!0,mobile:!0,name:"React Native",version:null,supportsScreenShare:!0,supportsSfu:!0,supportsVideoProcessing:!1,supportsAudioProcessing:!1};var o=Ha.getParser(ve());return{supported:!!Ps(),mobile:o.getPlatformType()==="mobile",name:o.getBrowserName(),version:o.getBrowserVersion(),supportsFullscreen:!!As(),supportsScreenShare:!!cu(),supportsSfu:!!Ps(),supportsVideoProcessing:Uo(),supportsAudioProcessing:Bo()}}},{key:"version",value:function(){return"0.81.0"}},{key:"createCallObject",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return o.layout="none",new t(null,o)}},{key:"wrap",value:function(o){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(U(),!o||!o.contentWindow||typeof o.src!="string")throw new Error("DailyIframe::Wrap needs an iframe-like first argument");return d.layout||(d.customLayout?d.layout="custom-v1":d.layout="browser"),new t(o,d)}},{key:"createFrame",value:function(o,d){var u,p;U(),o&&d?(u=o,p=d):o&&o.append?(u=o,p={}):(u=document.body,p=o||{});var g=p.iframeStyle;g||(g=u===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 S=document.createElement("iframe");window.navigator&&window.navigator.userAgent.match(/Chrome\/61\./)?S.allow="microphone, camera":S.allow="microphone; camera; autoplay; display-capture; screen-wake-lock",S.style.visibility="hidden",u.appendChild(S),S.style.visibility=null,Object.keys(g).forEach(function(M){return S.style[M]=g[M]}),p.layout||(p.customLayout?p.layout="custom-v1":p.layout="browser");try{return new t(S,p)}catch(M){throw u.removeChild(S),M}}},{key:"createTransparentFrame",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};U();var d=document.createElement("iframe");return d.allow="microphone; camera; autoplay",d.style.cssText=`
|
|
30
|
+
{ settings?: {state: "play"|"pause"} }`),g}return new Promise(function(g,S){d.sendMessageToCallMachine({action:"daily-method-update-remote-media-player",session_id:u,settings:p},function(C){C.error?S({error:C.error,errorMsg:C.errorMsg}):g({session_id:C.session_id,remoteMediaPlayerState:{state:C.state,settings:C.settings}})})})}),function(o){return w.apply(this,arguments)})},{key:"startTranscription",value:function(o){H(this._callState,"startTranscription()"),this.sendMessageToCallMachine(I({action:"daily-method-start-transcription"},o))}},{key:"updateTranscription",value:function(o){if(H(this._callState,"updateTranscription()"),!o)throw new Error("updateTranscription Error: options is mandatory");if(q(o)!=="object")throw new Error("updateTranscription Error: options must be object type");if(o.participants&&!Array.isArray(o.participants))throw new Error("updateTranscription Error: participants must be an array");this.sendMessageToCallMachine(I({action:"daily-method-update-transcription"},o))}},{key:"stopTranscription",value:function(o){if(H(this._callState,"stopTranscription()"),o&&q(o)!=="object")throw new Error("stopTranscription Error: options must be object type");if(o&&!o.instanceId)throw new Error('"instanceId" not provided');this.sendMessageToCallMachine(I({action:"daily-method-stop-transcription"},o))}},{key:"startDialOut",value:(y=L(function*(o){var d=this;H(this._callState,"startDialOut()");var u=function(C){if(C){if(!Array.isArray(C))throw new Error("Error starting dial out: audio codec must be an array");if(C.length<=0)throw new Error("Error starting dial out: audio codec array specified but empty");C.forEach(function(O){if(typeof O!="string")throw new Error("Error starting dial out: audio codec must be a string");if(O!=="OPUS"&&O!=="PCMU"&&O!=="PCMA"&&O!=="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(C){if(C&&(u(C.audio),C.video)){if(!Array.isArray(C.video))throw new Error("Error starting dial out: video codec must be an array");if(C.video.length<=0)throw new Error("Error starting dial out: video codec array specified but empty");C.video.forEach(function(O){if(typeof O!="string")throw new Error("Error starting dial out: video codec must be a string");if(O!=="H264"&&O!=="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&&u(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")}if(o.userId){if(typeof o.userId!="string")throw new Error("Error starting dial out: userId must be a string");if(o.userId.length>36)throw new Error("Error starting dial out: userId length must be less than or equal to 36")}if(eo(o),o.permissions&&o.permissions.canReceive){var p=re(Xo.validateJSONObject(o.permissions.canReceive),2),g=p[0],S=p[1];if(!g)throw new Error(S)}if(o.provider){if(o.provider!=="daily")throw new Error("Error: provider can be set only to 'daily', got: ".concat(o.provider));if(o.phoneNumber)throw new Error("Error starting dial out: provider valid only for sipUri, not phoneNumber");console.warn("(pre-beta) provider=daily is currently in pre-beta, things might break!")}return new Promise(function(C,O){d.sendMessageToCallMachine(I({action:"dialout-start"},o),function(P){P.error?O(P.error):C(P)})})}),function(o){return y.apply(this,arguments)})},{key:"stopDialOut",value:function(o){var d=this;return H(this._callState,"stopDialOut()"),new Promise(function(u,p){d.sendMessageToCallMachine(I({action:"dialout-stop"},o),function(g){g.error?p(g.error):u(g)})})}},{key:"sipCallTransfer",value:(m=L(function*(o){var d=this;if(H(this._callState,"sipCallTransfer()"),!o)throw new Error("sipCallTransfer() requires a sessionId and toEndPoint");return o.useSipRefer=!1,no(o,"sipCallTransfer"),eo(o),new Promise(function(u,p){d.sendMessageToCallMachine(I({action:As},o),function(g){g.error?p(g.error):u(g)})})}),function(o){return m.apply(this,arguments)})},{key:"sipRefer",value:(b=L(function*(o){var d=this;if(H(this._callState,"sipRefer()"),!o)throw new Error("sessionId and toEndPoint are mandatory parameter");return o.useSipRefer=!0,no(o,"sipRefer"),new Promise(function(u,p){d.sendMessageToCallMachine(I({action:As},o),function(g){g.error?p(g.error):u(g)})})}),function(o){return b.apply(this,arguments)})},{key:"sendDTMF",value:(k=L(function*(o){var d=this;return H(this._callState,"sendDTMF()"),function(u){var p=u.sessionId,g=u.tones;if(!p||!g)throw new Error("sessionId and tones are mandatory parameter");if(typeof p!="string"||typeof g!="string")throw new Error("sessionId and tones should be of string type");if(g.length>20)throw new Error("tones string must be upto 20 characters");var S=/[^0-9A-D*#]/g,C=g.match(S);if(C&&C[0])throw new Error("".concat(C[0]," is not valid DTMF tone"))}(o),new Promise(function(u,p){d.sendMessageToCallMachine(I({action:"send-dtmf"},o),function(g){g.error?p(g.error):u(g)})})}),function(o){return k.apply(this,arguments)})},{key:"getNetworkStats",value:function(){var o=this;return this._callState!==He?Promise.resolve(I({stats:{latest:{}}},this._network)):new Promise(function(d){o.sendMessageToCallMachine({action:"get-calc-stats"},function(u){d(I(I({},o._network),{},{stats:u.stats}))})})}},{key:"testWebsocketConnectivity",value:(E=L(function*(){var o=this;if(er(this._testCallInProgress,"testWebsocketConnectivity()"),this.needsLoad())try{yield this.load()}catch(d){return Promise.reject(d)}return new Promise(function(d,u){o.sendMessageToCallMachine({action:"test-websocket-connectivity"},function(p){p.error?u(p.error):d(p.results)})})}),function(){return E.apply(this,arguments)})},{key:"abortTestWebsocketConnectivity",value:function(){this.sendMessageToCallMachine({action:"abort-test-websocket-connectivity"})}},{key:"_validateVideoTrackForNetworkTests",value:function(o){return o?o instanceof MediaStreamTrack?!!Pu(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:(v=L(function*(){var o=this;U(),ye(this._callObjectMode,"testCallQuality()"),nn(this._callMachineInitialized,"testCallQuality()",null,!0),Zn(this._callState,this._isPreparingToJoin,"testCallQuality()");var d=this._testCallAlreadyInProgress,u=function(g){d||(o._testCallInProgress=g)};if(u(!0),this.needsLoad())try{var p=this._callState;yield this.load(),this._callState=p}catch(g){return u(!1),Promise.reject(g)}return new Promise(function(g){o.sendMessageToCallMachine({action:"test-call-quality",dailyJsVersion:o.properties.dailyJsVersion},function(S){var C=S.results,O=C.result,P=di(C,Iu);if(O==="failed"){var D,V=I({},P);(D=P.error)!==null&&D!==void 0&&D.details?(P.error.details=JSON.parse(P.error.details),V.error=I(I({},V.error),{},{details:I({},V.error.details)}),V.error.details.duringTest="testCallQuality"):(V.error=V.error?I({},V.error):{},V.error.details={duringTest:"testCallQuality"}),o._maybeSendToSentry(V)}u(!1),g(I({result:O},P))})})}),function(){return v.apply(this,arguments)})},{key:"stopTestCallQuality",value:function(){this.sendMessageToCallMachine({action:"stop-test-call-quality"})}},{key:"testConnectionQuality",value:(h=L(function*(o){var d;B()?(console.warn("testConnectionQuality() is deprecated: use testPeerToPeerCallQuality() instead"),d=yield this.testPeerToPeerCallQuality(o)):(console.warn("testConnectionQuality() is deprecated: use testCallQuality() instead"),d=yield this.testCallQuality());var u={result:d.result,secondsElapsed:d.secondsElapsed};return d.data&&(u.data={maxRTT:d.data.maxRoundTripTime,packetLoss:d.data.avgRecvPacketLoss}),u}),function(o){return h.apply(this,arguments)})},{key:"testPeerToPeerCallQuality",value:(f=L(function*(o){var d=this;if(er(this._testCallInProgress,"testPeerToPeerCallQuality()"),this.needsLoad())try{yield this.load()}catch(g){return Promise.reject(g)}var u=o.videoTrack,p=o.duration;if(!this._validateVideoTrackForNetworkTests(u))throw new Error("Video track error");return this._sharedTracks.videoTrackForConnectionQualityTest=u,new Promise(function(g,S){d.sendMessageToCallMachine({action:"test-p2p-call-quality",duration:p},function(C){C.error?S(C.error):g(C.results)})})}),function(o){return f.apply(this,arguments)})},{key:"stopTestConnectionQuality",value:function(){B()?(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=L(function*(o){var d=this;if(er(this._testCallInProgress,"testNetworkConnectivity()"),this.needsLoad())try{yield this.load()}catch(u){return Promise.reject(u)}if(!this._validateVideoTrackForNetworkTests(o))throw new Error("Video track error");return this._sharedTracks.videoTrackForNetworkConnectivityTest=o,new Promise(function(u,p){d.sendMessageToCallMachine({action:"test-network-connectivity"},function(g){g.error?p(g.error):u(g.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(d){o._callState===He?o.sendMessageToCallMachine({action:"get-cpu-load-stats"},function(u){d(u.cpuStats)}):d({cpuLoadState:void 0,cpuLoadStateReason:void 0,stats:{}})})}},{key:"_validateEncodingLayerHasValidProperties",value:function(o){var d;if(!(((d=Object.keys(o))===null||d===void 0?void 0:d.length)>0))throw new Error("Empty encoding is not allowed. At least one of these valid keys should be specified:"+Object.values(Yn))}},{key:"_validateVideoSendSettings",value:function(o,d){var u=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"],p="Video send settings should be either an object or one of the supported presets: ".concat(u.join());if(typeof d=="string"){if(!u.includes(d))throw new Error(p)}else{if(q(d)!=="object")throw new Error(p);if(!d.maxQuality&&!d.encodings&&d.allowAdaptiveLayers===void 0)throw new Error("Video send settings must contain at least maxQuality, allowAdaptiveLayers or encodings attribute");if(d.maxQuality&&["low","medium","high"].indexOf(d.maxQuality)===-1)throw new Error("maxQuality must be either low, medium or high");if(d.encodings){var g=!1;switch(Object.keys(d.encodings).length){case 1:g=!d.encodings.low;break;case 2:g=!d.encodings.low||!d.encodings.medium;break;case 3:g=!d.encodings.low||!d.encodings.medium||!d.encodings.high;break;default:g=!0}if(g)throw new Error("Encodings must be defined as: low, low and medium, or low, medium and high.");d.encodings.low&&this._validateEncodingLayerHasValidProperties(d.encodings.low),d.encodings.medium&&this._validateEncodingLayerHasValidProperties(d.encodings.medium),d.encodings.high&&this._validateEncodingLayerHasValidProperties(d.encodings.high)}}}},{key:"validateUpdateSendSettings",value:function(o){var d=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(u){var p=re(u,2),g=p[0],S=p[1];d._validateVideoSendSettings(g,S)})}},{key:"updateSendSettings",value:function(o){var d=this;return this.validateUpdateSendSettings(o),this.needsLoad()?(this._preloadCache.sendSettings=o,{sendSettings:this._preloadCache.sendSettings}):new Promise(function(u,p){d.sendMessageToCallMachine({action:"update-send-settings",sendSettings:o},function(g){g.error?p(g.error):u(g.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 U(),this._activeSpeaker}},{key:"setActiveSpeakerMode",value:function(o){return U(),this.sendMessageToCallMachine({action:"set-active-speaker-mode",enabled:o}),this}},{key:"activeSpeakerMode",value:function(){return U(),this._activeSpeakerMode}},{key:"subscribeToTracksAutomatically",value:function(){return this._preloadCache.subscribeToTracksAutomatically}},{key:"setSubscribeToTracksAutomatically",value:function(o){return H(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=L(function*(){var o=this;if(this._callObjectMode){var d=yield navigator.mediaDevices.enumerateDevices();return nt()==="Firefox"&&vn().major>115&&vn().major<123&&(d=d.filter(function(u){return u.kind!=="audiooutput"})),{devices:d.map(function(u){var p=JSON.parse(JSON.stringify(u));if(!B()&&u.kind==="videoinput"&&u.getCapabilities){var g,S=u.getCapabilities();p.facing=(S==null||(g=S.facingMode)===null||g===void 0?void 0:g.length)>=1?S.facingMode[0]:void 0}return p})}}return new Promise(function(u){o.sendMessageToCallMachine({action:"enumerate-devices"},function(p){u({devices:p.devices})})})}),function(){return c.apply(this,arguments)})},{key:"sendAppMessage",value:function(o){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"*";if(H(this._callState,"sendAppMessage()"),JSON.stringify(o).length>this._maxAppMessageSize)throw new Error("Message data too large. Max size is "+this._maxAppMessageSize);return this.sendMessageToCallMachine({action:"app-msg",data:o,to:d}),this}},{key:"addFakeParticipant",value:function(o){return U(),H(this._callState,"addFakeParticipant()"),this.sendMessageToCallMachine(I({action:"add-fake-participant"},o)),this}},{key:"setShowNamesMode",value:function(o){return le(this._callObjectMode,"setShowNamesMode()"),U(),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 le(this._callObjectMode,"setShowLocalVideo()"),U(),H(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 le(this._callObjectMode,"showLocalVideo()"),U(),this._showLocalVideo}},{key:"setShowParticipantsBar",value:function(){var o=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];return le(this._callObjectMode,"setShowParticipantsBar()"),U(),H(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 le(this._callObjectMode,"showParticipantsBar()"),U(),this._showParticipantsBar}},{key:"customIntegrations",value:function(){return U(),le(this._callObjectMode,"customIntegrations()"),this._customIntegrations}},{key:"setCustomIntegrations",value:function(o){return U(),le(this._callObjectMode,"setCustomIntegrations()"),H(this._callState,"setCustomIntegrations()"),aa(o)?(this.sendMessageToCallMachine({action:"set-custom-integrations",integrations:o}),this._customIntegrations=o,this):this}},{key:"startCustomIntegrations",value:function(o){var d=this;if(U(),le(this._callObjectMode,"startCustomIntegrations()"),H(this._callState,"startCustomIntegrations()"),Array.isArray(o)&&o.some(function(g){return typeof g!="string"})||!Array.isArray(o)&&typeof o!="string")return console.error("startCustomIntegrations() only accepts string | string[]"),this;var u=typeof o=="string"?[o]:o,p=u.filter(function(g){return!(g in d._customIntegrations)});return p.length?(console.error(`Can't find custom integration(s): "`.concat(p.join(", "),'"')),this):(this.sendMessageToCallMachine({action:"start-custom-integrations",ids:u}),this)}},{key:"stopCustomIntegrations",value:function(o){var d=this;if(U(),le(this._callObjectMode,"stopCustomIntegrations()"),H(this._callState,"stopCustomIntegrations()"),Array.isArray(o)&&o.some(function(g){return typeof g!="string"})||!Array.isArray(o)&&typeof o!="string")return console.error("stopCustomIntegrations() only accepts string | string[]"),this;var u=typeof o=="string"?[o]:o,p=u.filter(function(g){return!(g in d._customIntegrations)});return p.length?(console.error(`Can't find custom integration(s): "`.concat(p.join(", "),'"')),this):(this.sendMessageToCallMachine({action:"stop-custom-integrations",ids:u}),this)}},{key:"customTrayButtons",value:function(){return le(this._callObjectMode,"customTrayButtons()"),U(),this._customTrayButtons}},{key:"updateCustomTrayButtons",value:function(o){return le(this._callObjectMode,"updateCustomTrayButtons()"),U(),H(this._callState,"updateCustomTrayButtons()"),oa(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(bn))),this)}},{key:"theme",value:function(){return le(this._callObjectMode,"theme()"),this.properties.theme}},{key:"setTheme",value:function(o){var d=this;return le(this._callObjectMode,"setTheme()"),new Promise(function(u,p){try{d.validateProperties({theme:o}),d.properties.theme=I({},o),d.sendMessageToCallMachine({action:"set-theme",theme:d.properties.theme});try{d.emitDailyJSEvent({action:pl,theme:d.properties.theme})}catch(g){console.log("could not emit 'theme-updated'",g)}u(d.properties.theme)}catch(g){p(g)}})}},{key:"requestFullscreen",value:(a=L(function*(){if(U(),this._iframe&&!document.fullscreenElement&&Ps())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(){U(),document.fullscreenElement?document.exitFullscreen():document.webkitFullscreenElement&&document.webkitExitFullscreen()}},{key:"getSidebarView",value:(s=L(function*(){var o=this;return this._callObjectMode?(console.error("getSidebarView is not available in callObject mode"),Promise.resolve(null)):new Promise(function(d){o.sendMessageToCallMachine({action:"get-sidebar-view"},function(u){d(u.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=L(function*(){var o=this,d=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).includeRoomConfigDefaults,u=d===void 0||d;return this._accessState.access===zn||this.needsLoad()?this.properties.url?{roomUrlPendingJoin:this.properties.url}:null:new Promise(function(p){o.sendMessageToCallMachine({action:"lib-room-info",includeRoomConfigDefaults:u},function(g){delete g.action,delete g.callbackStamp,p(g)})})}),function(){return i.apply(this,arguments)})},{key:"geo",value:(r=L(function*(){try{var o=yield fetch("https://gs.daily.co/_ks_/x-swsl/:");return{current:(yield o.json()).geo}}catch(d){return console.error("geo lookup failed",d),{current:""}}}),function(){return r.apply(this,arguments)})},{key:"setNetworkTopology",value:(n=L(function*(o){var d=this;return U(),H(this._callState,"setNetworkTopology()"),new Promise(function(u,p){d.sendMessageToCallMachine({action:"set-network-topology",opts:o},function(g){g.error?p({error:g.error}):u({workerId:g.workerId})})})}),function(o){return n.apply(this,arguments)})},{key:"getNetworkTopology",value:(e=L(function*(){var o=this;return new Promise(function(d,u){o.needsLoad()&&d({topology:"none"}),o.sendMessageToCallMachine({action:"get-network-topology"},function(p){p.error?u({error:p.error}):d({topology:p.topology})})})}),function(){return e.apply(this,arguments)})},{key:"setPlayNewParticipantSound",value:function(o){if(U(),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,d){return qt.prototype.on.call(this,o,d)}},{key:"once",value:function(o,d){return qt.prototype.once.call(this,o,d)}},{key:"off",value:function(o,d){return qt.prototype.off.call(this,o,d)}},{key:"validateProperties",value:function(o){var d,u;if(o!=null&&(d=o.dailyConfig)!==null&&d!==void 0&&d.userMediaAudioConstraints){var p,g;B()||console.warn("userMediaAudioConstraints is deprecated. You can override constraints with inputSettings.audio.settings, found in DailyCallOptions.");var S=o.inputSettings||{};S.audio=((p=o.inputSettings)===null||p===void 0?void 0:p.audio)||{},S.audio.settings=((g=o.inputSettings)===null||g===void 0||(g=g.audio)===null||g===void 0?void 0:g.settings)||{},S.audio.settings=I(I({},S.audio.settings),o.dailyConfig.userMediaAudioConstraints),o.inputSettings=S,delete o.dailyConfig.userMediaAudioConstraints}if(o!=null&&(u=o.dailyConfig)!==null&&u!==void 0&&u.userMediaVideoConstraints){var C,O;B()||console.warn("userMediaVideoConstraints is deprecated. You can override constraints with inputSettings.video.settings, found in DailyCallOptions.");var P=o.inputSettings||{};P.video=((C=o.inputSettings)===null||C===void 0?void 0:C.video)||{},P.video.settings=((O=o.inputSettings)===null||O===void 0||(O=O.video)===null||O===void 0?void 0:O.settings)||{},P.video.settings=I(I({},P.video.settings),o.dailyConfig.userMediaVideoConstraints),o.inputSettings=P,delete o.dailyConfig.userMediaVideoConstraints}for(var D in o)if(ze[D]){if(ze[D].validate&&!ze[D].validate(o[D],this))throw new Error("property '".concat(D,"': ").concat(ze[D].help))}else console.warn("Ignoring unrecognized property '".concat(D,"'")),delete o[D]}},{key:"assembleMeetingUrl",value:function(){var o,d,u=I(I({},this.properties),{},{emb:this.callClientId,embHref:encodeURIComponent(window.location.href),proxy:(o=this.properties.dailyConfig)!==null&&o!==void 0&&o.proxyUrl?encodeURIComponent((d=this.properties.dailyConfig)===null||d===void 0?void 0:d.proxyUrl):void 0}),p=u.url.match(/\?/)?"&":"?";return u.url+p+Object.keys(ze).filter(function(g){return ze[g].queryString&&u[g]!==void 0}).map(function(g){return"".concat(ze[g].queryString,"=").concat(u[g])}).join("&")}},{key:"needsLoad",value:function(){return[gs,vs,Le,Re].includes(this._callState)}},{key:"sendMessageToCallMachine",value:function(o,d){if(this._destroyed&&(this._logUseAfterDestroy(),this.strictMode))throw new Error("Use after destroy");this._messageChannel.sendMessageToCallMachine(o,d,this.callClientId,this._iframe)}},{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 fl:this.sendMessageToCallMachine(I({action:hl},this.properties));break;case"call-machine-initialized":this._callMachineInitialized=!0;var d={action:Zt,level:"log",code:1011,stats:{event:"bundle load",time:this._bundleLoadTime==="no-op"?0:this._bundleLoadTime,preLoaded:this._bundleLoadTime==="no-op",url:dn(this.properties.dailyConfig)}};this.sendMessageToCallMachine(d),this._delayDuplicateInstanceLog&&this._logDuplicateInstanceAttempt();break;case _s:this._loadedCallback&&(this._loadedCallback(),this._loadedCallback=null),this.emitDailyJSEvent(o);break;case _l:var u,p=I({},o);delete p.internal,this._maxAppMessageSize=((u=o.internal)===null||u===void 0?void 0:u._maxAppMessageSize)||Hn,this._joinedCallback&&(this._joinedCallback(o.participants),this._joinedCallback=null),this.emitDailyJSEvent(p);break;case Sl:case kl:if(this._callState===Le)return;if(o.participant&&o.participant.session_id){var g=o.participant.local?"local":o.participant.session_id;if(this._callObjectMode){var S=this._callMachine().store;Ns(o.participant,S),Fs(o.participant,S),Us(o.participant,this._participants[g],S)}try{this.maybeParticipantTracksStopped(this._participants[g],o.participant),this.maybeParticipantTracksStarted(this._participants[g],o.participant),this.maybeEventRecordingStopped(this._participants[g],o.participant),this.maybeEventRecordingStarted(this._participants[g],o.participant)}catch(Fa){console.error("track events error",Fa)}this.compareEqualForParticipantUpdateEvent(o.participant,this._participants[g])||(this._participants[g]=I({},o.participant),this.toggleParticipantAudioBasedOnNativeAudioFocus(),this.emitDailyJSEvent(o))}break;case El:if(o.participant&&o.participant.session_id){var C=this._participants[o.participant.session_id];C&&this.maybeParticipantTracksStopped(C,null),delete this._participants[o.participant.session_id],this.emitDailyJSEvent(o)}break;case Tl:se(this._participantCounts,o.participantCounts)||(this._participantCounts=o.participantCounts,this.emitDailyJSEvent(o));break;case Cl:var O={access:o.access};o.awaitingAccess&&(O.awaitingAccess=o.awaitingAccess),se(this._accessState,O)||(this._accessState=O,this.emitDailyJSEvent(o));break;case Ml:if(o.meetingSession){this._meetingSessionSummary=o.meetingSession,this.emitDailyJSEvent(o);var P=I(I({},o),{},{action:"meeting-session-updated"});this.emitDailyJSEvent(P)}break;case Ts:var D;this._iframe&&!o.preserveIframe&&(this._iframe.src=""),this._updateCallState(Re),this.resetMeetingDependentVars(),this._loadedCallback&&(this._loadedCallback(o.errorMsg),this._loadedCallback=null),o.preserveIframe;var V=di(o,Lu);V!=null&&(D=V.error)!==null&&D!==void 0&&D.details&&(V.error.details=JSON.parse(V.error.details)),this._maybeSendToSentry(o),this._joinedCallback&&(this._joinedCallback(null,V),this._joinedCallback=null),this.emitDailyJSEvent(V);break;case wl:this._callState!==Re&&this._updateCallState(Le),this.resetMeetingDependentVars(),this._resolveLeave&&(this._resolveLeave(),this._resolveLeave=null),this.emitDailyJSEvent(o);break;case"selected-devices-updated":o.devices&&this.emitDailyJSEvent(o);break;case Xl:var ke=o.state,Ve=o.threshold,_t=o.quality,Y=ke.state,he=ke.reasons;Y===this._network.networkState&&se(he,this._network.networkStateReasons)&&Ve===this._network.threshold&&_t===this._network.quality||(this._network.networkState=Y,this._network.networkStateReasons=he,this._network.quality=_t,this._network.threshold=Ve,o.networkState=Y,he.length&&(o.networkStateReasons=he),delete o.state,this.emitDailyJSEvent(o));break;case Zl:o&&o.cpuLoadState&&this.emitDailyJSEvent(o);break;case eu:o&&o.faceCounts!==void 0&&this.emitDailyJSEvent(o);break;case Kl:var Je=o.activeSpeaker;this._activeSpeaker.peerId!==Je.peerId&&(this._activeSpeaker.peerId=Je.peerId,this.emitDailyJSEvent({action:o.action,activeSpeaker:this._activeSpeaker}));break;case"show-local-video-changed":if(this._callObjectMode)return;var wt=o.show;this._showLocalVideo=wt,this.emitDailyJSEvent({action:o.action,show:wt});break;case Ql:var Vt=o.enabled;this._activeSpeakerMode!==Vt&&(this._activeSpeakerMode=Vt,this.emitDailyJSEvent({action:o.action,enabled:this._activeSpeakerMode}));break;case Al:case Pl:case xl:this._waitingParticipants=o.allWaitingParticipants,this.emitDailyJSEvent({action:o.action,participant:o.participant});break;case ou:se(this._receiveSettings,o.receiveSettings)||(this._receiveSettings=o.receiveSettings,this.emitDailyJSEvent({action:o.action,receiveSettings:o.receiveSettings}));break;case ks:this._maybeUpdateInputSettings(o.inputSettings);break;case"send-settings-updated":se(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 ql:var St=o.session_id;this._rmpPlayerState[St]=o.playerState,this.emitDailyJSEvent(o);break;case zl:delete this._rmpPlayerState[o.session_id],this.emitDailyJSEvent(o);break;case $l:var kt=o.session_id,ui=this._rmpPlayerState[kt];ui&&this.compareEqualForRMPUpdateEvent(ui,o.remoteMediaPlayerState)||(this._rmpPlayerState[kt]=o.remoteMediaPlayerState,this.emitDailyJSEvent(o));break;case"custom-button-click":case"sidebar-view-changed":case"pip-started":case"pip-stopped":this.emitDailyJSEvent(o);break;case Ol:var Na=this._meetingSessionState.topology!==(o.meetingSessionState&&o.meetingSessionState.topology);this._meetingSessionState=tr(o.meetingSessionState,this._callObjectMode),(this._callObjectMode||Na)&&this.emitDailyJSEvent(o);break;case Hl:this._isScreenSharing=!0,this.emitDailyJSEvent(o);break;case Wl:case Gl:this._isScreenSharing=!1,this.emitDailyJSEvent(o);break;case ws:case Ss:case Nl:case Fl:case Ul:case Ll:case Rl:case Dl:case vl:case yl:case Vl:case Jl:case"test-completed":case Yl:case Bl:case tu:case nu:case ru:case iu:case Es:case su: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,d){var u="record";o&&(d.local||d[u]!==!1||o[u]===d[u]||this.emitDailyJSEvent({action:Ss}))}},{key:"maybeEventRecordingStarted",value:function(o,d){var u="record";o&&(d.local||d[u]!==!0||o[u]===d[u]||this.emitDailyJSEvent({action:ws}))}},{key:"_trackStatePlayable",value:function(o){return!(!o||o.state!==al)}},{key:"_trackChanged",value:function(o,d){return(o==null?void 0:o.id)!==(d==null?void 0:d.id)}},{key:"maybeEventTrackStopped",value:function(o,d,u){var p,g,S=(p=d==null?void 0:d.tracks[o])!==null&&p!==void 0?p:null,C=(g=u==null?void 0:u.tracks[o])!==null&&g!==void 0?g:null,O=S==null?void 0:S.track;if(O){var P=this._trackStatePlayable(S),D=this._trackStatePlayable(C),V=this._trackChanged(O,C==null?void 0:C.track);P&&(D&&!V||this.emitDailyJSEvent({action:Il,track:O,participant:u??d,type:o}))}}},{key:"maybeEventTrackStarted",value:function(o,d,u){var p,g,S=(p=d==null?void 0:d.tracks[o])!==null&&p!==void 0?p:null,C=(g=u==null?void 0:u.tracks[o])!==null&&g!==void 0?g:null,O=C==null?void 0:C.track;if(O){var P=this._trackStatePlayable(S),D=this._trackStatePlayable(C),V=this._trackChanged(S==null?void 0:S.track,O);D&&(P&&!V||this.emitDailyJSEvent({action:jl,track:O,participant:u,type:o}))}}},{key:"maybeParticipantTracksStopped",value:function(o,d){if(o)for(var u in o.tracks)this.maybeEventTrackStopped(u,o,d)}},{key:"maybeParticipantTracksStarted",value:function(o,d){if(d)for(var u in d.tracks)this.maybeEventTrackStarted(u,o,d)}},{key:"compareEqualForRMPUpdateEvent",value:function(o,d){var u,p;return o.state===d.state&&((u=o.settings)===null||u===void 0?void 0:u.volume)===((p=d.settings)===null||p===void 0?void 0:p.volume)}},{key:"emitDailyJSEvent",value:function(o){try{o.callClientId=this.callClientId,this.emit(o.action,o)}catch(d){console.log("could not emit",o,d)}}},{key:"compareEqualForParticipantUpdateEvent",value:function(o,d){return!!se(o,d)&&(!o.videoTrack||!d.videoTrack||o.videoTrack.id===d.videoTrack.id&&o.videoTrack.muted===d.videoTrack.muted&&o.videoTrack.enabled===d.videoTrack.enabled)&&(!o.audioTrack||!d.audioTrack||o.audioTrack.id===d.audioTrack.id&&o.audioTrack.muted===d.audioTrack.muted&&o.audioTrack.enabled===d.audioTrack.enabled)}},{key:"nativeUtils",value:function(){return B()?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 d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._isPreparingToJoin;if(o!==this._callState||d!==this._isPreparingToJoin){var u=this._callState,p=this._isPreparingToJoin;this._callState=o,this._isPreparingToJoin=d;var g=this._callState===He;this.updateShowAndroidOngoingMeetingNotification(g);var S=an(u,p),C=an(this._callState,this._isPreparingToJoin);S!==C&&(this.updateKeepDeviceAwake(C),this.updateDeviceAudioMode(C),this.updateNoOpRecordingEnsuringBackgroundContinuity(C))}}},{key:"resetMeetingDependentVars",value:function(){this._participants={},this._participantCounts=Xs,this._waitingParticipants={},this._activeSpeaker={},this._activeSpeakerMode=!1,this._didPreAuth=!1,this._accessState={access:zn},this._finalSummaryOfPrevSession=this._meetingSessionSummary,this._meetingSessionSummary={},this._meetingSessionState=tr(Qs,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._maxAppMessageSize=Hn,this._callMachineInitialized=!1,this._bundleLoadTime=void 0,this._preloadCache}},{key:"updateKeepDeviceAwake",value:function(o){B()&&this.nativeUtils().setKeepDeviceAwake(o,this.callClientId)}},{key:"updateDeviceAudioMode",value:function(o){if(B()&&!this.disableReactNativeAutoDeviceManagement("audio")){var d=o?this._nativeInCallAudioMode:"idle";this.nativeUtils().setAudioMode(d)}}},{key:"updateShowAndroidOngoingMeetingNotification",value:function(o){if(B()&&this.nativeUtils().setShowOngoingMeetingNotification){var d,u,p,g;if(this.properties.reactNativeConfig&&this.properties.reactNativeConfig.androidInCallNotification){var S=this.properties.reactNativeConfig.androidInCallNotification;d=S.title,u=S.subtitle,p=S.iconName,g=S.disableForCustomOverride}g&&(o=!1),this.nativeUtils().setShowOngoingMeetingNotification(o,d,u,p,this.callClientId)}}},{key:"updateNoOpRecordingEnsuringBackgroundContinuity",value:function(o){B()&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity(o)}},{key:"toggleParticipantAudioBasedOnNativeAudioFocus",value:function(){var o;if(B()){var d=(o=this._callMachine())===null||o===void 0||(o=o.store)===null||o===void 0?void 0:o.getState();for(var u in d==null?void 0:d.streams){var p=d.streams[u];p&&p.pendingTrack&&p.pendingTrack.kind==="audio"&&(p.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 d=document.createElement("a");return d.href=o,d.href}}},{key:"sayHello",value:function(){var o="hello, world.";return console.log(o),o}},{key:"_logUseAfterDestroy",value:function(){var o=Object.values($e)[0];if(this.needsLoad())if(o&&!o.needsLoad()){var d={action:Zt,level:"error",code:this.strictMode?9995:9997};o.sendMessageToCallMachine(d)}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 u={action:Zt,level:"error",code:this.strictMode?9995:9997};this._messageChannel.sendMessageToCallMachine(u,null,this.callClientId,this._iframe)}}},{key:"_logDuplicateInstanceAttempt",value:function(){for(var o=0,d=Object.values($e);o<d.length;o++){var u=d[o];u._callMachineInitialized?(u.sendMessageToCallMachine({action:Zt,level:"warn",code:this.allowMultipleCallInstances?9993:9992}),u._delayDuplicateInstanceLog=!1):u._delayDuplicateInstanceLog=!0}}},{key:"_maybeSendToSentry",value:function(o){var d,u,p,g;if(!((d=o.error)!==null&&d!==void 0&&d.type&&(![dl,ul,bs].includes(o.error.type)||o.error.type===bs&&o.error.msg.includes("deleted")))){var S=(u=this.properties)!==null&&u!==void 0&&u.url?new URL(this.properties.url):void 0,C="production";S&&S.host.includes(".staging.daily")&&(C="staging");var O,P,D,V,ke,Ve=function(St){const kt=[Mc(),Tc(),Zc(),Xc(),il(),ol(),xc(),sl()];return St.autoSessionTracking!==!1&&kt.push(rl()),kt}({}).filter(function(St){return!["BrowserApiErrors","Breadcrumbs","GlobalHandlers"].includes(St.name)}),_t=new Uc({dsn:"https://f10f1c81e5d44a4098416c0867a8b740@o77906.ingest.sentry.io/168844",transport:$c,stackParser:Qc,integrations:Ve,environment:C}),Y=new Be;if(Y.setClient(_t),_t.init(),this.session_id&&Y.setExtra("sessionId",this.session_id),this.properties){var he=I({},this.properties);he.userName=he.userName?"[Filtered]":void 0,he.userData=he.userData?"[Filtered]":void 0,he.token=he.token?"[Filtered]":void 0,Y.setExtra("properties",he)}if(S){var Je=S.searchParams.get("domain");if(!Je){var wt=S.host.match(/(.*?)\./);Je=wt&&wt[1]||""}Je&&Y.setTag("domain",Je)}o.error&&(Y.setTag("fatalErrorType",o.error.type),Y.setExtra("errorDetails",o.error.details),!((O=o.error.details)===null||O===void 0)&&O.uri&&Y.setTag("serverAddress",o.error.details.uri),!((P=o.error.details)===null||P===void 0)&&P.workerGroup&&Y.setTag("workerGroup",o.error.details.workerGroup),!((D=o.error.details)===null||D===void 0)&&D.geoGroup&&Y.setTag("geoGroup",o.error.details.geoGroup),!((V=o.error.details)===null||V===void 0)&&V.on&&Y.setTag("connectionAttempt",o.error.details.on),(ke=o.error.details)!==null&&ke!==void 0&&ke.bundleUrl&&(Y.setTag("bundleUrl",o.error.details.bundleUrl),Y.setTag("bundleError",o.error.details.sourceError.type))),Y.setTags({callMode:this._callObjectMode?B()?"reactNative":(p=this.properties)!==null&&p!==void 0&&(p=p.dailyConfig)!==null&&p!==void 0&&(p=p.callMode)!==null&&p!==void 0&&p.includes("prebuilt")?this.properties.dailyConfig.callMode:"custom":"prebuilt-frame",version:t.version()});var Vt=((g=o.error)===null||g===void 0?void 0:g.msg)||o.errorMsg;Y.captureException(new Error(Vt))}}},{key:"_callMachine",value:function(){var o;return(o=window._daily)===null||o===void 0||(o=o.instances)===null||o===void 0||(o=o[this.callClientId])===null||o===void 0?void 0:o.callMachine}},{key:"_maybeUpdateInputSettings",value:function(o){if(!se(this._inputSettings,o)){var d=this._getInputSettings();this._inputSettings=o;var u=this._getInputSettings();se(d,u)||this.emitDailyJSEvent({action:ks,inputSettings:u})}}}],[{key:"supportedBrowser",value:function(){if(B())return{supported:!0,mobile:!0,name:"React Native",version:null,supportsScreenShare:!0,supportsSfu:!0,supportsVideoProcessing:!1,supportsAudioProcessing:!1};var o=Wa.getParser(ve());return{supported:!!Kn(),mobile:o.getPlatformType()==="mobile",name:o.getBrowserName(),version:o.getBrowserVersion(),supportsFullscreen:!!Ps(),supportsScreenShare:!!lu(),supportsSfu:!!Kn(),supportsVideoProcessing:Bo(),supportsAudioProcessing:Vo()}}},{key:"version",value:function(){return"0.87.0"}},{key:"createCallObject",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return o.layout="none",new t(null,o)}},{key:"wrap",value:function(o){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(U(),!o||!o.contentWindow||typeof o.src!="string")throw new Error("DailyIframe::Wrap needs an iframe-like first argument");return d.layout||(d.customLayout?d.layout="custom-v1":d.layout="browser"),new t(o,d)}},{key:"createFrame",value:function(o,d){var u,p;U(),o&&d?(u=o,p=d):o&&o.append?(u=o,p={}):(u=document.body,p=o||{});var g=p.iframeStyle;g||(g=u===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 S=document.createElement("iframe");window.navigator&&window.navigator.userAgent.match(/Chrome\/61\./)?S.allow="microphone, camera":S.allow="microphone; camera; autoplay; display-capture; screen-wake-lock; compute-pressure;",S.style.visibility="hidden",u.appendChild(S),S.style.visibility=null,Object.keys(g).forEach(function(C){return S.style[C]=g[C]}),p.layout||(p.customLayout?p.layout="custom-v1":p.layout="browser");try{return new t(S,p)}catch(C){throw u.removeChild(S),C}}},{key:"createTransparentFrame",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};U();var d=document.createElement("iframe");return d.allow="microphone; camera; autoplay",d.style.cssText=`
|
|
31
31
|
position: fixed;
|
|
32
32
|
top: 0;
|
|
33
33
|
left: 0;
|
|
@@ -35,12 +35,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
35
35
|
height: 100%;
|
|
36
36
|
border: 0;
|
|
37
37
|
pointer-events: none;
|
|
38
|
-
`,document.body.appendChild(d),o.layout||(o.layout="custom-v1"),t.wrap(d,o)}},{key:"getCallInstance",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0;return o?$e[o]:Object.values($e)[0]}}]);var e,n,r,i,s,a,c,l,f,h,v,E,k,b,m,y,w,C,A,j,x,R,J,X,Oe,ot,at,Yr,Zr,ei,ti,ni,ri,ii,si,oi,ai,ci}();function ct(t,e){var n={};for(var r in t)if(t[r]instanceof MediaStreamTrack)console.warn("MediaStreamTrack found in props or cache.",r),n[r]=je;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 H(t){var e=arguments.length>2?arguments[2]:void 0;if(t!==He){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 an(t,e){return[_r,He].includes(t)||e}function Yn(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(an(t,e)){var i="".concat(n," not supported after joining a meeting.");throw r&&(i+=" ".concat(r)),console.error(i),new Error(i)}}function nn(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 Zn(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 ye(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 le(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 U(){if(V())throw new Error("This daily-js method is not currently supported in React Native")}function Tt(){if(!V())throw new Error("This daily-js method is only supported in React Native")}function Zo(t){if(t===void 0)return!0;var e;if(typeof t=="string")e=t;else try{e=JSON.stringify(t),se(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 ea(t,e){for(var n=e.allowAllParticipantsKey,r=function(v){var E=["local"];return n||E.push("*"),v&&!E.includes(v)},i=function(v){return!!(v.layer===void 0||Number.isInteger(v.layer)&&v.layer>=0||v.layer==="inherit")},s=function(v){return!!v&&!(v.video&&!i(v.video))&&!(v.screenVideo&&!i(v.screenVideo))},a=0,c=Object.entries(t);a<c.length;a++){var l=re(c[a],2),f=l[0],h=l[1];if(!r(f)||!s(h))return!1}return!0}function ta(t){if(q(t)!=="object")return!1;for(var e=0,n=Object.entries(t);e<n.length;e++){var r=re(n[e],2),i=r[0],s=r[1];switch(i){case"video":if(q(s)!=="object")return!1;for(var a=0,c=Object.entries(s);a<c.length;a++){var l=re(c[a],2),f=l[0],h=l[1];switch(f){case"processor":if(!Nu(h))return!1;break;case"settings":if(!eo(h))return!1;break;default:return!1}}break;case"audio":if(q(s)!=="object")return!1;for(var v=0,E=Object.entries(s);v<E.length;v++){var k=re(E[v],2),b=k[0],m=k[1];switch(b){case"processor":if(!Du(m))return!1;break;case"settings":if(!eo(m))return!1;break;default:return!1}}break;default:return!1}}return!0}function na(t,e,n){var r,i=[];t.video&&t.video.processor&&(Uo((r=e==null?void 0:e.useLegacyVideoProcessor)!==null&&r!==void 0&&r)||(t.video.settings?delete t.video.processor:delete t.video,i.push("video"))),t.audio&&t.audio.processor&&(Bo()||(t.audio.settings?delete t.audio.processor:delete t.audio,i.push("audio"))),i.length>0&&console.error("Ignoring settings for browser- or platform-unsupported input processor(s): ".concat(i.join(", "))),t.audio&&t.audio.settings&&(t.audio.settings.customTrack?(n.audioTrack=t.audio.settings.customTrack,t.audio.settings={customTrack:je}):delete n.audioTrack),t.video&&t.video.settings&&(t.video.settings.customTrack?(n.videoTrack=t.video.settings.customTrack,t.video.settings={customTrack:je}):delete n.videoTrack)}function Du(t){if(V())return console.warn("Video processing is not yet supported in React Native"),!1;var e=["type"];return!!t&&q(t)==="object"&&(Object.keys(t).filter(function(n){return!e.includes(n)}).forEach(function(n){console.warn("invalid key inputSettings -> audio -> processor : ".concat(n)),delete t[n]}),!!function(n){return typeof n!="string"?!1:Object.values(No).includes(n)?!0:(console.error("inputSettings audio processor type invalid"),!1)}(t.type))}function Nu(t){if(V())return console.warn("Video processing is not yet supported in React Native"),!1;var e=["type","config"];return!t||q(t)!=="object"||!function(n){return typeof n!="string"?!1:Object.values(on).includes(n)?!0:(console.error("inputSettings video processor type invalid"),!1)}(t.type)||t.config&&(q(t.config)!=="object"||!function(n,r){var i=Object.keys(r);if(i.length===0)return!0;var s="invalid object in inputSettings -> video -> processor -> config";switch(n){case on.BGBLUR:return i.length>1||i[0]!=="strength"?(console.error(s),!1):!(typeof r.strength!="number"||r.strength<=0||r.strength>1||isNaN(r.strength))||(console.error("".concat(s,"; expected: {0 < strength <= 1}, got: ").concat(r.strength)),!1);case on.BGIMAGE:return!(r.source!==void 0&&!function(a){if(a.source==="default")return a.type="default",!0;if(a.source instanceof ArrayBuffer)return!0;if(fn(a.source))return a.type="url",!!function(f){var h=new URL(f),v=h.pathname;if(h.protocol==="data:")try{var E=v.substring(v.indexOf(":")+1,v.indexOf(";")).split("/")[1];return Gn.includes(E)}catch(b){return console.error("failed to deduce blob content type",b),!1}var k=v.split(".").at(-1).toLowerCase().trim();return Gn.includes(k)}(a.source)||(console.error("invalid image type; supported types: [".concat(Gn.join(", "),"]")),!1);return c=a.source,l=Number(c),isNaN(l)||!Number.isInteger(l)||l<=0||l>10?(console.error("invalid image selection; must be an int, > 0, <= ".concat(10)),!1):(a.type="daily-preselect",!0);var c,l}(r));default:return!0}}(t.type,t.config))?!1:(Object.keys(t).filter(function(n){return!e.includes(n)}).forEach(function(n){console.warn("invalid key inputSettings -> video -> processor : ".concat(n)),delete t[n]}),!0)}function eo(t){return q(t)==="object"&&(!t.customTrack||t.customTrack instanceof MediaStreamTrack)}function Mr(){var t=Object.values(on).join(" | "),e=Object.values(No).join(" | ");return"inputSettings must be of the form: { video?: { processor?: { type: [ ".concat(t," ], config?: {} } }, audio?: { processor: {type: [ ").concat(e," ] } } }")}function ra(t){var e=t.allowAllParticipantsKey;return"receiveSettings must be of the form { [<remote participant id> | ".concat(cl).concat(e?' | "'.concat("*",'"'):"","]: ")+'{ [video: [{ layer: [<non-negative integer> | "inherit"] } | "inherit"]], [screenVideo: [{ layer: [<non-negative integer> | "inherit"] } | "inherit"]] }}}'}function ia(){return"customIntegrations should be an object of type ".concat(JSON.stringify(Cr),".")}function sa(t){if(t&&q(t)!=="object"||Array.isArray(t))return console.error("customTrayButtons should be an Object of the type ".concat(JSON.stringify(bn),".")),!1;if(t)for(var e=0,n=Object.entries(t);e<n.length;e++)for(var r=re(n[e],1)[0],i=0,s=Object.entries(t[r]);i<s.length;i++){var a=re(s[i],2),c=a[0],l=a[1],f=bn.id[c];if(!f)return console.error("customTrayButton does not support key ".concat(c)),!1;switch(c){case"iconPath":case"iconPathDarkMode":if(!fn(l))return console.error("customTrayButton ".concat(c," should be a url.")),!1;break;case"visualState":if(!["default","sidebar-open","active"].includes(l))return console.error("customTrayButton ".concat(c," should be ").concat(f,". Got: ").concat(l)),!1;break;default:if(q(l)!==f)return console.error("customTrayButton ".concat(c," should be a ").concat(f,".")),!1}}return!0}function oa(t){if(!t||t&&q(t)!=="object"||Array.isArray(t))return console.error(ia()),!1;for(var e=function(v){return"".concat(v," should be ").concat(Cr.id[v])},n=function(v,E){return console.error("customIntegration ".concat(v,": ").concat(E))},r=0,i=Object.entries(t);r<i.length;r++){var s=re(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=re(c[a],2),f=l[0],h=l[1];switch(f){case"allow":case"csp":case"name":case"referrerPolicy":case"sandbox":if(typeof h!="string")return n(s,e(f)),!1;break;case"iconURL":if(!fn(h))return n(s,"".concat(f," should be a url")),!1;break;case"src":if("srcdoc"in t[s])return n(s,"cannot have both src and srcdoc"),!1;if(!fn(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(f)),!1;break;case"location":if(!["main","sidebar"].includes(h))return n(s,e(f)),!1;break;case"controlledBy":if(h!=="*"&&h!=="owners"&&(!Array.isArray(h)||h.some(function(v){return typeof v!="string"})))return n(s,e(f)),!1;break;case"shared":if((!Array.isArray(h)||h.some(function(v){return typeof v!="string"}))&&h!=="owners"&&typeof h!="boolean")return n(s,e(f)),!1;break;default:if(!Cr.id[f])return console.error("customIntegration does not support key ".concat(f)),!1}}}return!0}function aa(t,e){if(e===void 0)return!1;switch(q(e)){case"string":return q(t)===e;case"object":if(q(t)!=="object")return!1;for(var n in t)if(!aa(t[n],e[n]))return!1;return!0;default:return!1}}function to(t,e){var n=t.sessionId,r=t.toEndPoint,i=t.callerId,s=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(s&&!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 "+"'));if(i&&typeof i!="string")throw new Error("callerId must be of type string");if(i&&!r.startsWith("+"))throw new Error("callerId is only valid when transferring to a PSTN number")}function no(t){if(q(t)!=="object")throw new Error('RemoteMediaPlayerSettings: must be "object" type');if(t.state&&!Object.values(wr).includes(t.state))throw new Error("Invalid value for RemoteMediaPlayerSettings.state, valid values are: "+JSON.stringify(wr));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 ro(t,e,n){return!(typeof t!="number"||t<e||t>n)}function er(t,e){return t&&!e&&delete t.data,t}function ca(t,e){return function(){return t.apply(e,arguments)}}const{toString:Fu}=Object.prototype,{getPrototypeOf:Kr}=Object,{iterator:Pn,toStringTag:la}=Symbol,xn=(t=>e=>{const n=Fu.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Se=t=>(t=t.toLowerCase(),e=>xn(e)===t),jn=t=>e=>typeof e===t,{isArray:yt}=Array,It=jn("undefined");function Nt(t){return t!==null&&!It(t)&&t.constructor!==null&&!It(t.constructor)&&ae(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const ua=Se("ArrayBuffer");function Uu(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&ua(t.buffer),e}const Bu=jn("string"),ae=jn("function"),da=jn("number"),Ft=t=>t!==null&&typeof t=="object",Vu=t=>t===!0||t===!1,cn=t=>{if(xn(t)!=="object")return!1;const e=Kr(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(la in t)&&!(Pn in t)},Ju=t=>{if(!Ft(t)||Nt(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},qu=Se("Date"),$u=Se("File"),zu=Se("Blob"),Hu=Se("FileList"),Wu=t=>Ft(t)&&ae(t.pipe),Gu=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||ae(t.append)&&((e=xn(t))==="formdata"||e==="object"&&ae(t.toString)&&t.toString()==="[object FormData]"))},Ku=Se("URLSearchParams"),[Qu,Xu,Yu,Zu]=["ReadableStream","Request","Response","Headers"].map(Se),ed=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ut(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,i;if(typeof t!="object"&&(t=[t]),yt(t))for(r=0,i=t.length;r<i;r++)e.call(null,t[r],r,t);else{if(Nt(t))return;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 fa(t,e){if(Nt(t))return null;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 Ge=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ha=t=>!It(t)&&t!==Ge;function Or(){const{caseless:t}=ha(this)&&this||{},e={},n=(r,i)=>{const s=t&&fa(e,i)||i;cn(e[s])&&cn(r)?e[s]=Or(e[s],r):cn(r)?e[s]=Or({},r):yt(r)?e[s]=r.slice():e[s]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&Ut(arguments[r],n);return e}const td=(t,e,n,{allOwnKeys:r}={})=>(Ut(e,(i,s)=>{n&&ae(i)?t[s]=ca(i,n):t[s]=i},{allOwnKeys:r}),t),nd=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),rd=(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)},id=(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&&Kr(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},sd=(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},od=t=>{if(!t)return null;if(yt(t))return t;let e=t.length;if(!da(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},ad=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Kr(Uint8Array)),cd=(t,e)=>{const r=(t&&t[Pn]).call(t);let i;for(;(i=r.next())&&!i.done;){const s=i.value;e.call(t,s[0],s[1])}},ld=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},ud=Se("HTMLFormElement"),dd=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),io=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),fd=Se("RegExp"),pa=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};Ut(n,(i,s)=>{let a;(a=e(i,s,t))!==!1&&(r[s]=a||i)}),Object.defineProperties(t,r)},hd=t=>{pa(t,(e,n)=>{if(ae(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(ae(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+"'")})}})},pd=(t,e)=>{const n={},r=i=>{i.forEach(s=>{n[s]=!0})};return yt(t)?r(t):r(String(t).split(e)),n},md=()=>{},gd=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function vd(t){return!!(t&&ae(t.append)&&t[la]==="FormData"&&t[Pn])}const yd=t=>{const e=new Array(10),n=(r,i)=>{if(Ft(r)){if(e.indexOf(r)>=0)return;if(Nt(r))return r;if(!("toJSON"in r)){e[i]=r;const s=yt(r)?[]:{};return Ut(r,(a,c)=>{const l=n(a,i+1);!It(l)&&(s[c]=l)}),e[i]=void 0,s}}return r};return n(t,0)},bd=Se("AsyncFunction"),_d=t=>t&&(Ft(t)||ae(t))&&ae(t.then)&&ae(t.catch),ma=((t,e)=>t?setImmediate:e?((n,r)=>(Ge.addEventListener("message",({source:i,data:s})=>{i===Ge&&s===n&&r.length&&r.shift()()},!1),i=>{r.push(i),Ge.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",ae(Ge.postMessage)),wd=typeof queueMicrotask<"u"?queueMicrotask.bind(Ge):typeof process<"u"&&process.nextTick||ma,Sd=t=>t!=null&&ae(t[Pn]),_={isArray:yt,isArrayBuffer:ua,isBuffer:Nt,isFormData:Gu,isArrayBufferView:Uu,isString:Bu,isNumber:da,isBoolean:Vu,isObject:Ft,isPlainObject:cn,isEmptyObject:Ju,isReadableStream:Qu,isRequest:Xu,isResponse:Yu,isHeaders:Zu,isUndefined:It,isDate:qu,isFile:$u,isBlob:zu,isRegExp:fd,isFunction:ae,isStream:Wu,isURLSearchParams:Ku,isTypedArray:ad,isFileList:Hu,forEach:Ut,merge:Or,extend:td,trim:ed,stripBOM:nd,inherits:rd,toFlatObject:id,kindOf:xn,kindOfTest:Se,endsWith:sd,toArray:od,forEachEntry:cd,matchAll:ld,isHTMLForm:ud,hasOwnProperty:io,hasOwnProp:io,reduceDescriptors:pa,freezeMethods:hd,toObjectSet:pd,toCamelCase:dd,noop:md,toFiniteNumber:gd,findKey:fa,global:Ge,isContextDefined:ha,isSpecCompliantForm:vd,toJSONObject:yd,isAsyncFn:bd,isThenable:_d,setImmediate:ma,asap:wd,isIterable:Sd};function N(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,this.status=i.status?i.status:null)}_.inherits(N,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:_.toJSONObject(this.config),code:this.code,status:this.status}}});const ga=N.prototype,va={};["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=>{va[t]={value:t}});Object.defineProperties(N,va);Object.defineProperty(ga,"isAxiosError",{value:!0});N.from=(t,e,n,r,i,s)=>{const a=Object.create(ga);return _.toFlatObject(t,a,function(l){return l!==Error.prototype},c=>c!=="isAxiosError"),N.call(a,t.message,e,n,r,i),a.cause=t,a.name=t.name,s&&Object.assign(a,s),a};const kd=null;function Ar(t){return _.isPlainObject(t)||_.isArray(t)}function ya(t){return _.endsWith(t,"[]")?t.slice(0,-2):t}function so(t,e,n){return t?t.concat(e).map(function(i,s){return i=ya(i),!n&&s?"["+i+"]":i}).join(n?".":""):e}function Ed(t){return _.isArray(t)&&!t.some(Ar)}const Td=_.toFlatObject(_,{},null,function(e){return/^is[A-Z]/.test(e)});function In(t,e,n){if(!_.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=_.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!_.isUndefined(y[m])});const r=n.metaTokens,i=n.visitor||h,s=n.dots,a=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&_.isSpecCompliantForm(e);if(!_.isFunction(i))throw new TypeError("visitor must be a function");function f(b){if(b===null)return"";if(_.isDate(b))return b.toISOString();if(_.isBoolean(b))return b.toString();if(!l&&_.isBlob(b))throw new N("Blob is not supported. Use a Buffer instead.");return _.isArrayBuffer(b)||_.isTypedArray(b)?l&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function h(b,m,y){let w=b;if(b&&!y&&typeof b=="object"){if(_.endsWith(m,"{}"))m=r?m:m.slice(0,-2),b=JSON.stringify(b);else if(_.isArray(b)&&Ed(b)||(_.isFileList(b)||_.endsWith(m,"[]"))&&(w=_.toArray(b)))return m=ya(m),w.forEach(function(A,j){!(_.isUndefined(A)||A===null)&&e.append(a===!0?so([m],j,s):a===null?m:m+"[]",f(A))}),!1}return Ar(b)?!0:(e.append(so(y,m,s),f(b)),!1)}const v=[],E=Object.assign(Td,{defaultVisitor:h,convertValue:f,isVisitable:Ar});function k(b,m){if(!_.isUndefined(b)){if(v.indexOf(b)!==-1)throw Error("Circular reference detected in "+m.join("."));v.push(b),_.forEach(b,function(w,C){(!(_.isUndefined(w)||w===null)&&i.call(e,w,_.isString(C)?C.trim():C,m,E))===!0&&k(w,m?m.concat(C):[C])}),v.pop()}}if(!_.isObject(t))throw new TypeError("data must be an object");return k(t),e}function oo(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function Qr(t,e){this._pairs=[],t&&In(t,this,e)}const ba=Qr.prototype;ba.append=function(e,n){this._pairs.push([e,n])};ba.toString=function(e){const n=e?function(r){return e.call(this,r,oo)}:oo;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function Cd(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function _a(t,e,n){if(!e)return t;const r=n&&n.encode||Cd;_.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let s;if(i?s=i(e,n):s=_.isURLSearchParams(e)?e.toString():new Qr(e,n).toString(r),s){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class ao{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){_.forEach(this.handlers,function(r){r!==null&&e(r)})}}const wa={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Md=typeof URLSearchParams<"u"?URLSearchParams:Qr,Od=typeof FormData<"u"?FormData:null,Ad=typeof Blob<"u"?Blob:null,Pd={isBrowser:!0,classes:{URLSearchParams:Md,FormData:Od,Blob:Ad},protocols:["http","https","file","blob","url","data"]},Xr=typeof window<"u"&&typeof document<"u",Pr=typeof navigator=="object"&&navigator||void 0,xd=Xr&&(!Pr||["ReactNative","NativeScript","NS"].indexOf(Pr.product)<0),jd=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Id=Xr&&window.location.href||"http://localhost",Ld=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Xr,hasStandardBrowserEnv:xd,hasStandardBrowserWebWorkerEnv:jd,navigator:Pr,origin:Id},Symbol.toStringTag,{value:"Module"})),ne={...Ld,...Pd};function Rd(t,e){return In(t,new ne.classes.URLSearchParams,{visitor:function(n,r,i,s){return ne.isNode&&_.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...e})}function Dd(t){return _.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Nd(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 Sa(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&&_.isArray(i)?i.length:a,l?(_.hasOwnProp(i,a)?i[a]=[i[a],r]:i[a]=r,!c):((!i[a]||!_.isObject(i[a]))&&(i[a]=[]),e(n,r,i[a],s)&&_.isArray(i[a])&&(i[a]=Nd(i[a])),!c)}if(_.isFormData(t)&&_.isFunction(t.entries)){const n={};return _.forEachEntry(t,(r,i)=>{e(Dd(r),i,n,0)}),n}return null}function Fd(t,e,n){if(_.isString(t))try{return(e||JSON.parse)(t),_.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const Bt={transitional:wa,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,s=_.isObject(e);if(s&&_.isHTMLForm(e)&&(e=new FormData(e)),_.isFormData(e))return i?JSON.stringify(Sa(e)):e;if(_.isArrayBuffer(e)||_.isBuffer(e)||_.isStream(e)||_.isFile(e)||_.isBlob(e)||_.isReadableStream(e))return e;if(_.isArrayBufferView(e))return e.buffer;if(_.isURLSearchParams(e))return 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 Rd(e,this.formSerializer).toString();if((c=_.isFileList(e))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return In(c?{"files[]":e}:e,l&&new l,this.formSerializer)}}return s||i?(n.setContentType("application/json",!1),Fd(e)):e}],transformResponse:[function(e){const n=this.transitional||Bt.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(_.isResponse(e)||_.isReadableStream(e))return e;if(e&&_.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"?N.from(c,N.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:ne.classes.FormData,Blob:ne.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};_.forEach(["delete","get","head","post","put","patch"],t=>{Bt.headers[t]={}});const Ud=_.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"]),Bd=t=>{const e={};let n,r,i;return t&&t.split(`
|
|
39
|
-
`).forEach(function(a){i=a.indexOf(":"),n=a.substring(0,i).trim().toLowerCase(),r=a.substring(i+1).trim(),!(!n||e[n]&&
|
|
40
|
-
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[co]=this[co]={accessors:{}}).accessors,i=this.prototype;function s(a){const c=Ct(a);r[c]||($d(i,a),r[c]=!0)}return _.isArray(e)?e.forEach(s):s(e),this}};ce.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);_.reduceDescriptors(ce.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});_.freezeMethods(ce);function nr(t,e){const n=this||Bt,r=e||n,i=ce.from(r.headers);let s=r.data;return _.forEach(t,function(c){s=c.call(n,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function ka(t){return!!(t&&t.__CANCEL__)}function bt(t,e,n){N.call(this,t??"canceled",N.ERR_CANCELED,e,n),this.name="CanceledError"}_.inherits(bt,N,{__CANCEL__:!0});function Ea(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new N("Request failed with status code "+n.status,[N.ERR_BAD_REQUEST,N.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function zd(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Hd(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 f=Date.now(),h=r[s];a||(a=f),n[i]=l,r[i]=f;let v=s,E=0;for(;v!==i;)E+=n[v++],v=v%t;if(i=(i+1)%t,i===s&&(s=(s+1)%t),f-a<e)return;const k=h&&f-h;return k?Math.round(E*1e3/k):void 0}}function Wd(t,e){let n=0,r=1e3/e,i,s;const a=(f,h=Date.now())=>{n=h,i=null,s&&(clearTimeout(s),s=null),t(...f)};return[(...f)=>{const h=Date.now(),v=h-n;v>=r?a(f,h):(i=f,s||(s=setTimeout(()=>{s=null,a(i)},r-v)))},()=>i&&a(i)]}const _n=(t,e,n=3)=>{let r=0;const i=Hd(50,250);return Wd(s=>{const a=s.loaded,c=s.lengthComputable?s.total:void 0,l=a-r,f=i(l),h=a<=c;r=a;const v={loaded:a,total:c,progress:c?a/c:void 0,bytes:l,rate:f||void 0,estimated:f&&c&&h?(c-a)/f:void 0,event:s,lengthComputable:c!=null,[e?"download":"upload"]:!0};t(v)},n)},lo=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},uo=t=>(...e)=>_.asap(()=>t(...e)),Gd=ne.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,ne.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(ne.origin),ne.navigator&&/(msie|trident)/i.test(ne.navigator.userAgent)):()=>!0,Kd=ne.hasStandardBrowserEnv?{write(t,e,n,r,i,s){const a=[t+"="+encodeURIComponent(e)];_.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),_.isString(r)&&a.push("path="+r),_.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 Qd(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Xd(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Ta(t,e,n){let r=!Qd(e);return t&&(r||n==!1)?Xd(t,e):e}const fo=t=>t instanceof ce?{...t}:t;function rt(t,e){e=e||{};const n={};function r(f,h,v,E){return _.isPlainObject(f)&&_.isPlainObject(h)?_.merge.call({caseless:E},f,h):_.isPlainObject(h)?_.merge({},h):_.isArray(h)?h.slice():h}function i(f,h,v,E){if(_.isUndefined(h)){if(!_.isUndefined(f))return r(void 0,f,v,E)}else return r(f,h,v,E)}function s(f,h){if(!_.isUndefined(h))return r(void 0,h)}function a(f,h){if(_.isUndefined(h)){if(!_.isUndefined(f))return r(void 0,f)}else return r(void 0,h)}function c(f,h,v){if(v in e)return r(f,h);if(v in t)return r(void 0,f)}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:(f,h,v)=>i(fo(f),fo(h),v,!0)};return _.forEach(Object.keys({...t,...e}),function(h){const v=l[h]||i,E=v(t[h],e[h],h);_.isUndefined(E)&&v!==c||(n[h]=E)}),n}const Ca=t=>{const e=rt({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:s,headers:a,auth:c}=e;e.headers=a=ce.from(a),e.url=_a(Ta(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let l;if(_.isFormData(n)){if(ne.hasStandardBrowserEnv||ne.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((l=a.getContentType())!==!1){const[f,...h]=l?l.split(";").map(v=>v.trim()).filter(Boolean):[];a.setContentType([f||"multipart/form-data",...h].join("; "))}}if(ne.hasStandardBrowserEnv&&(r&&_.isFunction(r)&&(r=r(e)),r||r!==!1&&Gd(e.url))){const f=i&&s&&Kd.read(s);f&&a.set(i,f)}return e},Yd=typeof XMLHttpRequest<"u",Zd=Yd&&function(t){return new Promise(function(n,r){const i=Ca(t);let s=i.data;const a=ce.from(i.headers).normalize();let{responseType:c,onUploadProgress:l,onDownloadProgress:f}=i,h,v,E,k,b;function m(){k&&k(),b&&b(),i.cancelToken&&i.cancelToken.unsubscribe(h),i.signal&&i.signal.removeEventListener("abort",h)}let y=new XMLHttpRequest;y.open(i.method.toUpperCase(),i.url,!0),y.timeout=i.timeout;function w(){if(!y)return;const A=ce.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),x={data:!c||c==="text"||c==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:A,config:t,request:y};Ea(function(J){n(J),m()},function(J){r(J),m()},x),y=null}"onloadend"in y?y.onloadend=w:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(w)},y.onabort=function(){y&&(r(new N("Request aborted",N.ECONNABORTED,t,y)),y=null)},y.onerror=function(){r(new N("Network Error",N.ERR_NETWORK,t,y)),y=null},y.ontimeout=function(){let j=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const x=i.transitional||wa;i.timeoutErrorMessage&&(j=i.timeoutErrorMessage),r(new N(j,x.clarifyTimeoutError?N.ETIMEDOUT:N.ECONNABORTED,t,y)),y=null},s===void 0&&a.setContentType(null),"setRequestHeader"in y&&_.forEach(a.toJSON(),function(j,x){y.setRequestHeader(x,j)}),_.isUndefined(i.withCredentials)||(y.withCredentials=!!i.withCredentials),c&&c!=="json"&&(y.responseType=i.responseType),f&&([E,b]=_n(f,!0),y.addEventListener("progress",E)),l&&y.upload&&([v,k]=_n(l),y.upload.addEventListener("progress",v),y.upload.addEventListener("loadend",k)),(i.cancelToken||i.signal)&&(h=A=>{y&&(r(!A||A.type?new bt(null,t,y):A),y.abort(),y=null)},i.cancelToken&&i.cancelToken.subscribe(h),i.signal&&(i.signal.aborted?h():i.signal.addEventListener("abort",h)));const C=zd(i.url);if(C&&ne.protocols.indexOf(C)===-1){r(new N("Unsupported protocol "+C+":",N.ERR_BAD_REQUEST,t));return}y.send(s||null)})},ef=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,i;const s=function(f){if(!i){i=!0,c();const h=f instanceof Error?f:this.reason;r.abort(h instanceof N?h:new bt(h instanceof Error?h.message:h))}};let a=e&&setTimeout(()=>{a=null,s(new N(`timeout ${e} of ms exceeded`,N.ETIMEDOUT))},e);const c=()=>{t&&(a&&clearTimeout(a),a=null,t.forEach(f=>{f.unsubscribe?f.unsubscribe(s):f.removeEventListener("abort",s)}),t=null)};t.forEach(f=>f.addEventListener("abort",s));const{signal:l}=r;return l.unsubscribe=()=>_.asap(c),l}},tf=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let r=0,i;for(;r<n;)i=r+e,yield t.slice(r,i),r=i},nf=async function*(t,e){for await(const n of rf(t))yield*tf(n,e)},rf=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:r}=await e.read();if(n)break;yield r}}finally{await e.cancel()}},ho=(t,e,n,r)=>{const i=nf(t,e);let s=0,a,c=l=>{a||(a=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:f,value:h}=await i.next();if(f){c(),l.close();return}let v=h.byteLength;if(n){let E=s+=v;n(E)}l.enqueue(new Uint8Array(h))}catch(f){throw c(f),f}},cancel(l){return c(l),i.return()}},{highWaterMark:2})},Ln=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Ma=Ln&&typeof ReadableStream=="function",sf=Ln&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),Oa=(t,...e)=>{try{return!!t(...e)}catch{return!1}},of=Ma&&Oa(()=>{let t=!1;const e=new Request(ne.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),po=64*1024,xr=Ma&&Oa(()=>_.isReadableStream(new Response("").body)),wn={stream:xr&&(t=>t.body)};Ln&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!wn[e]&&(wn[e]=_.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new N(`Response type '${e}' is not supported`,N.ERR_NOT_SUPPORT,r)})})})(new Response);const af=async t=>{if(t==null)return 0;if(_.isBlob(t))return t.size;if(_.isSpecCompliantForm(t))return(await new Request(ne.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(_.isArrayBufferView(t)||_.isArrayBuffer(t))return t.byteLength;if(_.isURLSearchParams(t)&&(t=t+""),_.isString(t))return(await sf(t)).byteLength},cf=async(t,e)=>{const n=_.toFiniteNumber(t.getContentLength());return n??af(e)},lf=Ln&&(async t=>{let{url:e,method:n,data:r,signal:i,cancelToken:s,timeout:a,onDownloadProgress:c,onUploadProgress:l,responseType:f,headers:h,withCredentials:v="same-origin",fetchOptions:E}=Ca(t);f=f?(f+"").toLowerCase():"text";let k=ef([i,s&&s.toAbortSignal()],a),b;const m=k&&k.unsubscribe&&(()=>{k.unsubscribe()});let y;try{if(l&&of&&n!=="get"&&n!=="head"&&(y=await cf(h,r))!==0){let x=new Request(e,{method:"POST",body:r,duplex:"half"}),R;if(_.isFormData(r)&&(R=x.headers.get("content-type"))&&h.setContentType(R),x.body){const[J,X]=lo(y,_n(uo(l)));r=ho(x.body,po,J,X)}}_.isString(v)||(v=v?"include":"omit");const w="credentials"in Request.prototype;b=new Request(e,{...E,signal:k,method:n.toUpperCase(),headers:h.normalize().toJSON(),body:r,duplex:"half",credentials:w?v:void 0});let C=await fetch(b,E);const A=xr&&(f==="stream"||f==="response");if(xr&&(c||A&&m)){const x={};["status","statusText","headers"].forEach(Oe=>{x[Oe]=C[Oe]});const R=_.toFiniteNumber(C.headers.get("content-length")),[J,X]=c&&lo(R,_n(uo(c),!0))||[];C=new Response(ho(C.body,po,J,()=>{X&&X(),m&&m()}),x)}f=f||"text";let j=await wn[_.findKey(wn,f)||"text"](C,t);return!A&&m&&m(),await new Promise((x,R)=>{Ea(x,R,{data:j,headers:ce.from(C.headers),status:C.status,statusText:C.statusText,config:t,request:b})})}catch(w){throw m&&m(),w&&w.name==="TypeError"&&/Load failed|fetch/i.test(w.message)?Object.assign(new N("Network Error",N.ERR_NETWORK,t,b),{cause:w.cause||w}):N.from(w,w&&w.code,t,b)}}),jr={http:kd,xhr:Zd,fetch:lf};_.forEach(jr,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const mo=t=>`- ${t}`,uf=t=>_.isFunction(t)||t===null||t===!1,Aa={getAdapter:t=>{t=_.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,!uf(n)&&(r=jr[(a=String(n)).toLowerCase()],r===void 0))throw new N(`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 :
|
|
41
|
-
`+s.map(
|
|
42
|
-
`):" "+
|
|
43
|
-
`+s):r.stack=s}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=rt(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&un.assertOptions(r,{silentJSONParsing:Ee.transitional(Ee.boolean),forcedJSONParsing:Ee.transitional(Ee.boolean),clarifyTimeoutError:Ee.transitional(Ee.boolean)},!1),i!=null&&(_.isFunction(i)?n.paramsSerializer={serialize:i}:un.assertOptions(i,{encode:Ee.function,serialize:Ee.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),un.assertOptions(n,{baseUrl:Ee.spelling("baseURL"),withXsrfToken:Ee.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=s&&_.merge(s.common,s[n.method]);s&&_.forEach(["delete","get","head","post","put","patch","common"],b=>{delete s[b]}),n.headers=ce.concat(a,s);const c=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(l=l&&m.synchronous,c.unshift(m.fulfilled,m.rejected))});const f=[];this.interceptors.response.forEach(function(m){f.push(m.fulfilled,m.rejected)});let h,v=0,E;if(!l){const b=[
|
|
38
|
+
`,document.body.appendChild(d),o.layout||(o.layout="custom-v1"),t.wrap(d,o)}},{key:"getCallInstance",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0;return o?$e[o]:Object.values($e)[0]}}]);var e,n,r,i,s,a,c,l,f,h,v,E,k,b,m,y,w,M,A,j,x,R,J,X,Oe,ot,at,Zr,ei,ti,ni,ri,ii,si,oi,ai,ci,li}();function eo(t){if(t.extension){if(typeof t.extension!="string")throw new Error("Error starting dial out: extension must be a string");if(t.extension.length>20)throw new Error("Error starting dial out: extension length must be less than or equal to 20")}if(t.waitBeforeExtensionDialSec){if(typeof t.waitBeforeExtensionDialSec!="number")throw new Error("Error starting dial out: waitBeforeExtensionDialSec must be a number");if(t.waitBeforeExtensionDialSec>60)throw new Error("Error starting dial out: waitBeforeExtensionDialSec must be less than or equal to 60");if(!t.extension)throw new Error("Error starting dial out: waitBeforeExtensionDialSec requires a phoneNumber and extension")}}function ct(t,e){var n={};for(var r in t)if(t[r]instanceof MediaStreamTrack)console.warn("MediaStreamTrack found in props or cache.",r),n[r]=je;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 H(t){var e=arguments.length>2?arguments[2]:void 0;if(t!==He){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 an(t,e){return[wr,He].includes(t)||e}function Zn(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(an(t,e)){var i="".concat(n," not supported after joining a meeting.");throw r&&(i+=" ".concat(r)),console.error(i),new Error(i)}}function nn(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 er(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 ye(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 le(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 U(){if(B())throw new Error("This daily-js method is not currently supported in React Native")}function Tt(){if(!B())throw new Error("This daily-js method is only supported in React Native")}function ea(t){if(t===void 0)return!0;var e;if(typeof t=="string")e=t;else try{e=JSON.stringify(t),se(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 ta(t,e){for(var n=e.allowAllParticipantsKey,r=function(v){var E=["local"];return n||E.push("*"),v&&!E.includes(v)},i=function(v){return!!(v.layer===void 0||Number.isInteger(v.layer)&&v.layer>=0||v.layer==="inherit")},s=function(v){return!!v&&!(v.video&&!i(v.video))&&!(v.screenVideo&&!i(v.screenVideo))},a=0,c=Object.entries(t);a<c.length;a++){var l=re(c[a],2),f=l[0],h=l[1];if(!r(f)||!s(h))return!1}return!0}function na(t){if(q(t)!=="object")return!1;for(var e=0,n=Object.entries(t);e<n.length;e++){var r=re(n[e],2),i=r[0],s=r[1];switch(i){case"video":if(q(s)!=="object")return!1;for(var a=0,c=Object.entries(s);a<c.length;a++){var l=re(c[a],2),f=l[0],h=l[1];switch(f){case"processor":if(!Fu(h))return!1;break;case"settings":if(!to(h))return!1;break;default:return!1}}break;case"audio":if(q(s)!=="object")return!1;for(var v=0,E=Object.entries(s);v<E.length;v++){var k=re(E[v],2),b=k[0],m=k[1];switch(b){case"processor":if(!Nu(m))return!1;break;case"settings":if(!to(m))return!1;break;default:return!1}}break;default:return!1}}return!0}function ra(t,e,n){var r,i=[];t.video&&t.video.processor&&(Bo((r=e==null?void 0:e.useLegacyVideoProcessor)!==null&&r!==void 0&&r)||(t.video.settings?delete t.video.processor:delete t.video,i.push("video"))),t.audio&&t.audio.processor&&(Vo()||(t.audio.settings?delete t.audio.processor:delete t.audio,i.push("audio"))),i.length>0&&console.error("Ignoring settings for browser- or platform-unsupported input processor(s): ".concat(i.join(", "))),t.audio&&t.audio.settings&&(t.audio.settings.customTrack?(n.audioTrack=t.audio.settings.customTrack,t.audio.settings={customTrack:je}):delete n.audioTrack),t.video&&t.video.settings&&(t.video.settings.customTrack?(n.videoTrack=t.video.settings.customTrack,t.video.settings={customTrack:je}):delete n.videoTrack)}function Nu(t){if(B())return console.warn("Video processing is not yet supported in React Native"),!1;var e=["type"];return!!t&&q(t)==="object"&&(Object.keys(t).filter(function(n){return!e.includes(n)}).forEach(function(n){console.warn("invalid key inputSettings -> audio -> processor : ".concat(n)),delete t[n]}),!!function(n){return typeof n!="string"?!1:Object.values(Fo).includes(n)?!0:(console.error("inputSettings audio processor type invalid"),!1)}(t.type))}function Fu(t){if(B())return console.warn("Video processing is not yet supported in React Native"),!1;var e=["type","config"];return!t||q(t)!=="object"||!function(n){return typeof n!="string"?!1:Object.values(on).includes(n)?!0:(console.error("inputSettings video processor type invalid"),!1)}(t.type)||t.config&&(q(t.config)!=="object"||!function(n,r){var i=Object.keys(r);if(i.length===0)return!0;var s="invalid object in inputSettings -> video -> processor -> config";switch(n){case on.BGBLUR:return i.length>1||i[0]!=="strength"?(console.error(s),!1):!(typeof r.strength!="number"||r.strength<=0||r.strength>1||isNaN(r.strength))||(console.error("".concat(s,"; expected: {0 < strength <= 1}, got: ").concat(r.strength)),!1);case on.BGIMAGE:return!(r.source!==void 0&&!function(a){if(a.source==="default")return a.type="default",!0;if(a.source instanceof ArrayBuffer)return!0;if(fn(a.source))return a.type="url",!!function(f){var h=new URL(f),v=h.pathname;if(h.protocol==="data:")try{var E=v.substring(v.indexOf(":")+1,v.indexOf(";")).split("/")[1];return Gn.includes(E)}catch(b){return console.error("failed to deduce blob content type",b),!1}var k=v.split(".").at(-1).toLowerCase().trim();return Gn.includes(k)}(a.source)||(console.error("invalid image type; supported types: [".concat(Gn.join(", "),"]")),!1);return c=a.source,l=Number(c),isNaN(l)||!Number.isInteger(l)||l<=0||l>10?(console.error("invalid image selection; must be an int, > 0, <= ".concat(10)),!1):(a.type="daily-preselect",!0);var c,l}(r));default:return!0}}(t.type,t.config))?!1:(Object.keys(t).filter(function(n){return!e.includes(n)}).forEach(function(n){console.warn("invalid key inputSettings -> video -> processor : ".concat(n)),delete t[n]}),!0)}function to(t){return q(t)==="object"&&(!t.customTrack||t.customTrack instanceof MediaStreamTrack)}function Or(){var t=Object.values(on).join(" | "),e=Object.values(Fo).join(" | ");return"inputSettings must be of the form: { video?: { processor?: { type: [ ".concat(t," ], config?: {} } }, audio?: { processor: {type: [ ").concat(e," ] } } }")}function ia(t){var e=t.allowAllParticipantsKey;return"receiveSettings must be of the form { [<remote participant id> | ".concat(ll).concat(e?' | "'.concat("*",'"'):"","]: ")+'{ [video: [{ layer: [<non-negative integer> | "inherit"] } | "inherit"]], [screenVideo: [{ layer: [<non-negative integer> | "inherit"] } | "inherit"]] }}}'}function sa(){return"customIntegrations should be an object of type ".concat(JSON.stringify(Mr),".")}function oa(t){if(t&&q(t)!=="object"||Array.isArray(t))return console.error("customTrayButtons should be an Object of the type ".concat(JSON.stringify(bn),".")),!1;if(t)for(var e=0,n=Object.entries(t);e<n.length;e++)for(var r=re(n[e],1)[0],i=0,s=Object.entries(t[r]);i<s.length;i++){var a=re(s[i],2),c=a[0],l=a[1],f=bn.id[c];if(!f)return console.error("customTrayButton does not support key ".concat(c)),!1;switch(c){case"iconPath":case"iconPathDarkMode":if(!fn(l))return console.error("customTrayButton ".concat(c," should be a url.")),!1;break;case"visualState":if(!["default","sidebar-open","active"].includes(l))return console.error("customTrayButton ".concat(c," should be ").concat(f,". Got: ").concat(l)),!1;break;default:if(q(l)!==f)return console.error("customTrayButton ".concat(c," should be a ").concat(f,".")),!1}}return!0}function aa(t){if(!t||t&&q(t)!=="object"||Array.isArray(t))return console.error(sa()),!1;for(var e=function(v){return"".concat(v," should be ").concat(Mr.id[v])},n=function(v,E){return console.error("customIntegration ".concat(v,": ").concat(E))},r=0,i=Object.entries(t);r<i.length;r++){var s=re(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=re(c[a],2),f=l[0],h=l[1];switch(f){case"allow":case"csp":case"name":case"referrerPolicy":case"sandbox":if(typeof h!="string")return n(s,e(f)),!1;break;case"iconURL":if(!fn(h))return n(s,"".concat(f," should be a url")),!1;break;case"src":if("srcdoc"in t[s])return n(s,"cannot have both src and srcdoc"),!1;if(!fn(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(f)),!1;break;case"location":if(!["main","sidebar"].includes(h))return n(s,e(f)),!1;break;case"controlledBy":if(h!=="*"&&h!=="owners"&&(!Array.isArray(h)||h.some(function(v){return typeof v!="string"})))return n(s,e(f)),!1;break;case"shared":if((!Array.isArray(h)||h.some(function(v){return typeof v!="string"}))&&h!=="owners"&&typeof h!="boolean")return n(s,e(f)),!1;break;default:if(!Mr.id[f])return console.error("customIntegration does not support key ".concat(f)),!1}}}return!0}function ca(t,e){if(e===void 0)return!1;switch(q(e)){case"string":return q(t)===e;case"object":if(q(t)!=="object")return!1;for(var n in t)if(!ca(t[n],e[n]))return!1;return!0;default:return!1}}function no(t,e){var n=t.sessionId,r=t.toEndPoint,i=t.callerId,s=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(s&&!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 "+"'));if(i&&typeof i!="string")throw new Error("callerId must be of type string");if(i&&!r.startsWith("+"))throw new Error("callerId is only valid when transferring to a PSTN number")}function ro(t){if(q(t)!=="object")throw new Error('RemoteMediaPlayerSettings: must be "object" type');if(t.state&&!Object.values(Sr).includes(t.state))throw new Error("Invalid value for RemoteMediaPlayerSettings.state, valid values are: "+JSON.stringify(Sr));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 io(t,e,n){return!(typeof t!="number"||t<e||t>n)}function tr(t,e){return t&&!e&&delete t.data,t}function la(t,e){return function(){return t.apply(e,arguments)}}const{toString:Uu}=Object.prototype,{getPrototypeOf:Qr}=Object,{iterator:Pn,toStringTag:ua}=Symbol,xn=(t=>e=>{const n=Uu.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Se=t=>(t=t.toLowerCase(),e=>xn(e)===t),jn=t=>e=>typeof e===t,{isArray:yt}=Array,It=jn("undefined");function Nt(t){return t!==null&&!It(t)&&t.constructor!==null&&!It(t.constructor)&&ae(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const da=Se("ArrayBuffer");function Bu(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&da(t.buffer),e}const Vu=jn("string"),ae=jn("function"),fa=jn("number"),Ft=t=>t!==null&&typeof t=="object",Ju=t=>t===!0||t===!1,cn=t=>{if(xn(t)!=="object")return!1;const e=Qr(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(ua in t)&&!(Pn in t)},qu=t=>{if(!Ft(t)||Nt(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},$u=Se("Date"),zu=Se("File"),Hu=Se("Blob"),Wu=Se("FileList"),Gu=t=>Ft(t)&&ae(t.pipe),Ku=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||ae(t.append)&&((e=xn(t))==="formdata"||e==="object"&&ae(t.toString)&&t.toString()==="[object FormData]"))},Qu=Se("URLSearchParams"),[Xu,Yu,Zu,ed]=["ReadableStream","Request","Response","Headers"].map(Se),td=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ut(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,i;if(typeof t!="object"&&(t=[t]),yt(t))for(r=0,i=t.length;r<i;r++)e.call(null,t[r],r,t);else{if(Nt(t))return;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 ha(t,e){if(Nt(t))return null;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 Ge=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,pa=t=>!It(t)&&t!==Ge;function Ar(){const{caseless:t}=pa(this)&&this||{},e={},n=(r,i)=>{const s=t&&ha(e,i)||i;cn(e[s])&&cn(r)?e[s]=Ar(e[s],r):cn(r)?e[s]=Ar({},r):yt(r)?e[s]=r.slice():e[s]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&Ut(arguments[r],n);return e}const nd=(t,e,n,{allOwnKeys:r}={})=>(Ut(e,(i,s)=>{n&&ae(i)?t[s]=la(i,n):t[s]=i},{allOwnKeys:r}),t),rd=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),id=(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)},sd=(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&&Qr(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},od=(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},ad=t=>{if(!t)return null;if(yt(t))return t;let e=t.length;if(!fa(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},cd=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Qr(Uint8Array)),ld=(t,e)=>{const r=(t&&t[Pn]).call(t);let i;for(;(i=r.next())&&!i.done;){const s=i.value;e.call(t,s[0],s[1])}},ud=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},dd=Se("HTMLFormElement"),fd=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),so=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),hd=Se("RegExp"),ma=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};Ut(n,(i,s)=>{let a;(a=e(i,s,t))!==!1&&(r[s]=a||i)}),Object.defineProperties(t,r)},pd=t=>{ma(t,(e,n)=>{if(ae(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(ae(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+"'")})}})},md=(t,e)=>{const n={},r=i=>{i.forEach(s=>{n[s]=!0})};return yt(t)?r(t):r(String(t).split(e)),n},gd=()=>{},vd=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function yd(t){return!!(t&&ae(t.append)&&t[ua]==="FormData"&&t[Pn])}const bd=t=>{const e=new Array(10),n=(r,i)=>{if(Ft(r)){if(e.indexOf(r)>=0)return;if(Nt(r))return r;if(!("toJSON"in r)){e[i]=r;const s=yt(r)?[]:{};return Ut(r,(a,c)=>{const l=n(a,i+1);!It(l)&&(s[c]=l)}),e[i]=void 0,s}}return r};return n(t,0)},_d=Se("AsyncFunction"),wd=t=>t&&(Ft(t)||ae(t))&&ae(t.then)&&ae(t.catch),ga=((t,e)=>t?setImmediate:e?((n,r)=>(Ge.addEventListener("message",({source:i,data:s})=>{i===Ge&&s===n&&r.length&&r.shift()()},!1),i=>{r.push(i),Ge.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",ae(Ge.postMessage)),Sd=typeof queueMicrotask<"u"?queueMicrotask.bind(Ge):typeof process<"u"&&process.nextTick||ga,kd=t=>t!=null&&ae(t[Pn]),_={isArray:yt,isArrayBuffer:da,isBuffer:Nt,isFormData:Ku,isArrayBufferView:Bu,isString:Vu,isNumber:fa,isBoolean:Ju,isObject:Ft,isPlainObject:cn,isEmptyObject:qu,isReadableStream:Xu,isRequest:Yu,isResponse:Zu,isHeaders:ed,isUndefined:It,isDate:$u,isFile:zu,isBlob:Hu,isRegExp:hd,isFunction:ae,isStream:Gu,isURLSearchParams:Qu,isTypedArray:cd,isFileList:Wu,forEach:Ut,merge:Ar,extend:nd,trim:td,stripBOM:rd,inherits:id,toFlatObject:sd,kindOf:xn,kindOfTest:Se,endsWith:od,toArray:ad,forEachEntry:ld,matchAll:ud,isHTMLForm:dd,hasOwnProperty:so,hasOwnProp:so,reduceDescriptors:ma,freezeMethods:pd,toObjectSet:md,toCamelCase:fd,noop:gd,toFiniteNumber:vd,findKey:ha,global:Ge,isContextDefined:pa,isSpecCompliantForm:yd,toJSONObject:bd,isAsyncFn:_d,isThenable:wd,setImmediate:ga,asap:Sd,isIterable:kd};function F(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,this.status=i.status?i.status:null)}_.inherits(F,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:_.toJSONObject(this.config),code:this.code,status:this.status}}});const va=F.prototype,ya={};["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=>{ya[t]={value:t}});Object.defineProperties(F,ya);Object.defineProperty(va,"isAxiosError",{value:!0});F.from=(t,e,n,r,i,s)=>{const a=Object.create(va);return _.toFlatObject(t,a,function(l){return l!==Error.prototype},c=>c!=="isAxiosError"),F.call(a,t.message,e,n,r,i),a.cause=t,a.name=t.name,s&&Object.assign(a,s),a};const Ed=null;function Pr(t){return _.isPlainObject(t)||_.isArray(t)}function ba(t){return _.endsWith(t,"[]")?t.slice(0,-2):t}function oo(t,e,n){return t?t.concat(e).map(function(i,s){return i=ba(i),!n&&s?"["+i+"]":i}).join(n?".":""):e}function Td(t){return _.isArray(t)&&!t.some(Pr)}const Cd=_.toFlatObject(_,{},null,function(e){return/^is[A-Z]/.test(e)});function In(t,e,n){if(!_.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=_.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!_.isUndefined(y[m])});const r=n.metaTokens,i=n.visitor||h,s=n.dots,a=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&_.isSpecCompliantForm(e);if(!_.isFunction(i))throw new TypeError("visitor must be a function");function f(b){if(b===null)return"";if(_.isDate(b))return b.toISOString();if(_.isBoolean(b))return b.toString();if(!l&&_.isBlob(b))throw new F("Blob is not supported. Use a Buffer instead.");return _.isArrayBuffer(b)||_.isTypedArray(b)?l&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function h(b,m,y){let w=b;if(b&&!y&&typeof b=="object"){if(_.endsWith(m,"{}"))m=r?m:m.slice(0,-2),b=JSON.stringify(b);else if(_.isArray(b)&&Td(b)||(_.isFileList(b)||_.endsWith(m,"[]"))&&(w=_.toArray(b)))return m=ba(m),w.forEach(function(A,j){!(_.isUndefined(A)||A===null)&&e.append(a===!0?oo([m],j,s):a===null?m:m+"[]",f(A))}),!1}return Pr(b)?!0:(e.append(oo(y,m,s),f(b)),!1)}const v=[],E=Object.assign(Cd,{defaultVisitor:h,convertValue:f,isVisitable:Pr});function k(b,m){if(!_.isUndefined(b)){if(v.indexOf(b)!==-1)throw Error("Circular reference detected in "+m.join("."));v.push(b),_.forEach(b,function(w,M){(!(_.isUndefined(w)||w===null)&&i.call(e,w,_.isString(M)?M.trim():M,m,E))===!0&&k(w,m?m.concat(M):[M])}),v.pop()}}if(!_.isObject(t))throw new TypeError("data must be an object");return k(t),e}function ao(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function Xr(t,e){this._pairs=[],t&&In(t,this,e)}const _a=Xr.prototype;_a.append=function(e,n){this._pairs.push([e,n])};_a.toString=function(e){const n=e?function(r){return e.call(this,r,ao)}:ao;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function Md(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function wa(t,e,n){if(!e)return t;const r=n&&n.encode||Md;_.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let s;if(i?s=i(e,n):s=_.isURLSearchParams(e)?e.toString():new Xr(e,n).toString(r),s){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class co{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){_.forEach(this.handlers,function(r){r!==null&&e(r)})}}const Sa={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Od=typeof URLSearchParams<"u"?URLSearchParams:Xr,Ad=typeof FormData<"u"?FormData:null,Pd=typeof Blob<"u"?Blob:null,xd={isBrowser:!0,classes:{URLSearchParams:Od,FormData:Ad,Blob:Pd},protocols:["http","https","file","blob","url","data"]},Yr=typeof window<"u"&&typeof document<"u",xr=typeof navigator=="object"&&navigator||void 0,jd=Yr&&(!xr||["ReactNative","NativeScript","NS"].indexOf(xr.product)<0),Id=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Ld=Yr&&window.location.href||"http://localhost",Rd=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Yr,hasStandardBrowserEnv:jd,hasStandardBrowserWebWorkerEnv:Id,navigator:xr,origin:Ld},Symbol.toStringTag,{value:"Module"})),ne={...Rd,...xd};function Dd(t,e){return In(t,new ne.classes.URLSearchParams,{visitor:function(n,r,i,s){return ne.isNode&&_.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...e})}function Nd(t){return _.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Fd(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 ka(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&&_.isArray(i)?i.length:a,l?(_.hasOwnProp(i,a)?i[a]=[i[a],r]:i[a]=r,!c):((!i[a]||!_.isObject(i[a]))&&(i[a]=[]),e(n,r,i[a],s)&&_.isArray(i[a])&&(i[a]=Fd(i[a])),!c)}if(_.isFormData(t)&&_.isFunction(t.entries)){const n={};return _.forEachEntry(t,(r,i)=>{e(Nd(r),i,n,0)}),n}return null}function Ud(t,e,n){if(_.isString(t))try{return(e||JSON.parse)(t),_.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const Bt={transitional:Sa,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,s=_.isObject(e);if(s&&_.isHTMLForm(e)&&(e=new FormData(e)),_.isFormData(e))return i?JSON.stringify(ka(e)):e;if(_.isArrayBuffer(e)||_.isBuffer(e)||_.isStream(e)||_.isFile(e)||_.isBlob(e)||_.isReadableStream(e))return e;if(_.isArrayBufferView(e))return e.buffer;if(_.isURLSearchParams(e))return 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 Dd(e,this.formSerializer).toString();if((c=_.isFileList(e))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return In(c?{"files[]":e}:e,l&&new l,this.formSerializer)}}return s||i?(n.setContentType("application/json",!1),Ud(e)):e}],transformResponse:[function(e){const n=this.transitional||Bt.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(_.isResponse(e)||_.isReadableStream(e))return e;if(e&&_.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"?F.from(c,F.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:ne.classes.FormData,Blob:ne.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};_.forEach(["delete","get","head","post","put","patch"],t=>{Bt.headers[t]={}});const Bd=_.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"]),Vd=t=>{const e={};let n,r,i;return t&&t.split(`
|
|
39
|
+
`).forEach(function(a){i=a.indexOf(":"),n=a.substring(0,i).trim().toLowerCase(),r=a.substring(i+1).trim(),!(!n||e[n]&&Bd[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},lo=Symbol("internals");function Ct(t){return t&&String(t).trim().toLowerCase()}function ln(t){return t===!1||t==null?t:_.isArray(t)?t.map(ln):String(t)}function Jd(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 qd=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function nr(t,e,n,r,i){if(_.isFunction(r))return r.call(this,e,n);if(i&&(e=n),!!_.isString(e)){if(_.isString(r))return e.indexOf(r)!==-1;if(_.isRegExp(r))return r.test(e)}}function $d(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function zd(t,e){const n=_.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})})}let ce=class{constructor(e){e&&this.set(e)}set(e,n,r){const i=this;function s(c,l,f){const h=Ct(l);if(!h)throw new Error("header name must be a non-empty string");const v=_.findKey(i,h);(!v||i[v]===void 0||f===!0||f===void 0&&i[v]!==!1)&&(i[v||l]=ln(c))}const a=(c,l)=>_.forEach(c,(f,h)=>s(f,h,l));if(_.isPlainObject(e)||e instanceof this.constructor)a(e,n);else if(_.isString(e)&&(e=e.trim())&&!qd(e))a(Vd(e),n);else if(_.isObject(e)&&_.isIterable(e)){let c={},l,f;for(const h of e){if(!_.isArray(h))throw TypeError("Object iterator must return a key-value pair");c[f=h[0]]=(l=c[f])?_.isArray(l)?[...l,h[1]]:[l,h[1]]:h[1]}a(c,n)}else e!=null&&s(n,e,r);return this}get(e,n){if(e=Ct(e),e){const r=_.findKey(this,e);if(r){const i=this[r];if(!n)return i;if(n===!0)return Jd(i);if(_.isFunction(n))return n.call(this,i,r);if(_.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=Ct(e),e){const r=_.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||nr(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let i=!1;function s(a){if(a=Ct(a),a){const c=_.findKey(r,a);c&&(!n||nr(r,r[c],c,n))&&(delete r[c],i=!0)}}return _.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||nr(this,this[s],s,e,!0))&&(delete this[s],i=!0)}return i}normalize(e){const n=this,r={};return _.forEach(this,(i,s)=>{const a=_.findKey(r,s);if(a){n[a]=ln(i),delete n[s];return}const c=e?$d(s):String(s).trim();c!==s&&delete n[s],n[c]=ln(i),r[c]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return _.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=e&&_.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(`
|
|
40
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[lo]=this[lo]={accessors:{}}).accessors,i=this.prototype;function s(a){const c=Ct(a);r[c]||(zd(i,a),r[c]=!0)}return _.isArray(e)?e.forEach(s):s(e),this}};ce.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);_.reduceDescriptors(ce.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});_.freezeMethods(ce);function rr(t,e){const n=this||Bt,r=e||n,i=ce.from(r.headers);let s=r.data;return _.forEach(t,function(c){s=c.call(n,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function Ea(t){return!!(t&&t.__CANCEL__)}function bt(t,e,n){F.call(this,t??"canceled",F.ERR_CANCELED,e,n),this.name="CanceledError"}_.inherits(bt,F,{__CANCEL__:!0});function Ta(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new F("Request failed with status code "+n.status,[F.ERR_BAD_REQUEST,F.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Hd(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Wd(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 f=Date.now(),h=r[s];a||(a=f),n[i]=l,r[i]=f;let v=s,E=0;for(;v!==i;)E+=n[v++],v=v%t;if(i=(i+1)%t,i===s&&(s=(s+1)%t),f-a<e)return;const k=h&&f-h;return k?Math.round(E*1e3/k):void 0}}function Gd(t,e){let n=0,r=1e3/e,i,s;const a=(f,h=Date.now())=>{n=h,i=null,s&&(clearTimeout(s),s=null),t(...f)};return[(...f)=>{const h=Date.now(),v=h-n;v>=r?a(f,h):(i=f,s||(s=setTimeout(()=>{s=null,a(i)},r-v)))},()=>i&&a(i)]}const _n=(t,e,n=3)=>{let r=0;const i=Wd(50,250);return Gd(s=>{const a=s.loaded,c=s.lengthComputable?s.total:void 0,l=a-r,f=i(l),h=a<=c;r=a;const v={loaded:a,total:c,progress:c?a/c:void 0,bytes:l,rate:f||void 0,estimated:f&&c&&h?(c-a)/f:void 0,event:s,lengthComputable:c!=null,[e?"download":"upload"]:!0};t(v)},n)},uo=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},fo=t=>(...e)=>_.asap(()=>t(...e)),Kd=ne.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,ne.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(ne.origin),ne.navigator&&/(msie|trident)/i.test(ne.navigator.userAgent)):()=>!0,Qd=ne.hasStandardBrowserEnv?{write(t,e,n,r,i,s){const a=[t+"="+encodeURIComponent(e)];_.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),_.isString(r)&&a.push("path="+r),_.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 Xd(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Yd(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Ca(t,e,n){let r=!Xd(e);return t&&(r||n==!1)?Yd(t,e):e}const ho=t=>t instanceof ce?{...t}:t;function rt(t,e){e=e||{};const n={};function r(f,h,v,E){return _.isPlainObject(f)&&_.isPlainObject(h)?_.merge.call({caseless:E},f,h):_.isPlainObject(h)?_.merge({},h):_.isArray(h)?h.slice():h}function i(f,h,v,E){if(_.isUndefined(h)){if(!_.isUndefined(f))return r(void 0,f,v,E)}else return r(f,h,v,E)}function s(f,h){if(!_.isUndefined(h))return r(void 0,h)}function a(f,h){if(_.isUndefined(h)){if(!_.isUndefined(f))return r(void 0,f)}else return r(void 0,h)}function c(f,h,v){if(v in e)return r(f,h);if(v in t)return r(void 0,f)}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:(f,h,v)=>i(ho(f),ho(h),v,!0)};return _.forEach(Object.keys({...t,...e}),function(h){const v=l[h]||i,E=v(t[h],e[h],h);_.isUndefined(E)&&v!==c||(n[h]=E)}),n}const Ma=t=>{const e=rt({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:s,headers:a,auth:c}=e;e.headers=a=ce.from(a),e.url=wa(Ca(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let l;if(_.isFormData(n)){if(ne.hasStandardBrowserEnv||ne.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((l=a.getContentType())!==!1){const[f,...h]=l?l.split(";").map(v=>v.trim()).filter(Boolean):[];a.setContentType([f||"multipart/form-data",...h].join("; "))}}if(ne.hasStandardBrowserEnv&&(r&&_.isFunction(r)&&(r=r(e)),r||r!==!1&&Kd(e.url))){const f=i&&s&&Qd.read(s);f&&a.set(i,f)}return e},Zd=typeof XMLHttpRequest<"u",ef=Zd&&function(t){return new Promise(function(n,r){const i=Ma(t);let s=i.data;const a=ce.from(i.headers).normalize();let{responseType:c,onUploadProgress:l,onDownloadProgress:f}=i,h,v,E,k,b;function m(){k&&k(),b&&b(),i.cancelToken&&i.cancelToken.unsubscribe(h),i.signal&&i.signal.removeEventListener("abort",h)}let y=new XMLHttpRequest;y.open(i.method.toUpperCase(),i.url,!0),y.timeout=i.timeout;function w(){if(!y)return;const A=ce.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),x={data:!c||c==="text"||c==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:A,config:t,request:y};Ta(function(J){n(J),m()},function(J){r(J),m()},x),y=null}"onloadend"in y?y.onloadend=w:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(w)},y.onabort=function(){y&&(r(new F("Request aborted",F.ECONNABORTED,t,y)),y=null)},y.onerror=function(){r(new F("Network Error",F.ERR_NETWORK,t,y)),y=null},y.ontimeout=function(){let j=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const x=i.transitional||Sa;i.timeoutErrorMessage&&(j=i.timeoutErrorMessage),r(new F(j,x.clarifyTimeoutError?F.ETIMEDOUT:F.ECONNABORTED,t,y)),y=null},s===void 0&&a.setContentType(null),"setRequestHeader"in y&&_.forEach(a.toJSON(),function(j,x){y.setRequestHeader(x,j)}),_.isUndefined(i.withCredentials)||(y.withCredentials=!!i.withCredentials),c&&c!=="json"&&(y.responseType=i.responseType),f&&([E,b]=_n(f,!0),y.addEventListener("progress",E)),l&&y.upload&&([v,k]=_n(l),y.upload.addEventListener("progress",v),y.upload.addEventListener("loadend",k)),(i.cancelToken||i.signal)&&(h=A=>{y&&(r(!A||A.type?new bt(null,t,y):A),y.abort(),y=null)},i.cancelToken&&i.cancelToken.subscribe(h),i.signal&&(i.signal.aborted?h():i.signal.addEventListener("abort",h)));const M=Hd(i.url);if(M&&ne.protocols.indexOf(M)===-1){r(new F("Unsupported protocol "+M+":",F.ERR_BAD_REQUEST,t));return}y.send(s||null)})},tf=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,i;const s=function(f){if(!i){i=!0,c();const h=f instanceof Error?f:this.reason;r.abort(h instanceof F?h:new bt(h instanceof Error?h.message:h))}};let a=e&&setTimeout(()=>{a=null,s(new F(`timeout ${e} of ms exceeded`,F.ETIMEDOUT))},e);const c=()=>{t&&(a&&clearTimeout(a),a=null,t.forEach(f=>{f.unsubscribe?f.unsubscribe(s):f.removeEventListener("abort",s)}),t=null)};t.forEach(f=>f.addEventListener("abort",s));const{signal:l}=r;return l.unsubscribe=()=>_.asap(c),l}},nf=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let r=0,i;for(;r<n;)i=r+e,yield t.slice(r,i),r=i},rf=async function*(t,e){for await(const n of sf(t))yield*nf(n,e)},sf=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:r}=await e.read();if(n)break;yield r}}finally{await e.cancel()}},po=(t,e,n,r)=>{const i=rf(t,e);let s=0,a,c=l=>{a||(a=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:f,value:h}=await i.next();if(f){c(),l.close();return}let v=h.byteLength;if(n){let E=s+=v;n(E)}l.enqueue(new Uint8Array(h))}catch(f){throw c(f),f}},cancel(l){return c(l),i.return()}},{highWaterMark:2})},Ln=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Oa=Ln&&typeof ReadableStream=="function",of=Ln&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),Aa=(t,...e)=>{try{return!!t(...e)}catch{return!1}},af=Oa&&Aa(()=>{let t=!1;const e=new Request(ne.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),mo=64*1024,jr=Oa&&Aa(()=>_.isReadableStream(new Response("").body)),wn={stream:jr&&(t=>t.body)};Ln&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!wn[e]&&(wn[e]=_.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new F(`Response type '${e}' is not supported`,F.ERR_NOT_SUPPORT,r)})})})(new Response);const cf=async t=>{if(t==null)return 0;if(_.isBlob(t))return t.size;if(_.isSpecCompliantForm(t))return(await new Request(ne.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(_.isArrayBufferView(t)||_.isArrayBuffer(t))return t.byteLength;if(_.isURLSearchParams(t)&&(t=t+""),_.isString(t))return(await of(t)).byteLength},lf=async(t,e)=>{const n=_.toFiniteNumber(t.getContentLength());return n??cf(e)},uf=Ln&&(async t=>{let{url:e,method:n,data:r,signal:i,cancelToken:s,timeout:a,onDownloadProgress:c,onUploadProgress:l,responseType:f,headers:h,withCredentials:v="same-origin",fetchOptions:E}=Ma(t);f=f?(f+"").toLowerCase():"text";let k=tf([i,s&&s.toAbortSignal()],a),b;const m=k&&k.unsubscribe&&(()=>{k.unsubscribe()});let y;try{if(l&&af&&n!=="get"&&n!=="head"&&(y=await lf(h,r))!==0){let x=new Request(e,{method:"POST",body:r,duplex:"half"}),R;if(_.isFormData(r)&&(R=x.headers.get("content-type"))&&h.setContentType(R),x.body){const[J,X]=uo(y,_n(fo(l)));r=po(x.body,mo,J,X)}}_.isString(v)||(v=v?"include":"omit");const w="credentials"in Request.prototype;b=new Request(e,{...E,signal:k,method:n.toUpperCase(),headers:h.normalize().toJSON(),body:r,duplex:"half",credentials:w?v:void 0});let M=await fetch(b,E);const A=jr&&(f==="stream"||f==="response");if(jr&&(c||A&&m)){const x={};["status","statusText","headers"].forEach(Oe=>{x[Oe]=M[Oe]});const R=_.toFiniteNumber(M.headers.get("content-length")),[J,X]=c&&uo(R,_n(fo(c),!0))||[];M=new Response(po(M.body,mo,J,()=>{X&&X(),m&&m()}),x)}f=f||"text";let j=await wn[_.findKey(wn,f)||"text"](M,t);return!A&&m&&m(),await new Promise((x,R)=>{Ta(x,R,{data:j,headers:ce.from(M.headers),status:M.status,statusText:M.statusText,config:t,request:b})})}catch(w){throw m&&m(),w&&w.name==="TypeError"&&/Load failed|fetch/i.test(w.message)?Object.assign(new F("Network Error",F.ERR_NETWORK,t,b),{cause:w.cause||w}):F.from(w,w&&w.code,t,b)}}),Ir={http:Ed,xhr:ef,fetch:uf};_.forEach(Ir,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const go=t=>`- ${t}`,df=t=>_.isFunction(t)||t===null||t===!1,Pa={getAdapter:t=>{t=_.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,!df(n)&&(r=Ir[(a=String(n)).toLowerCase()],r===void 0))throw new F(`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 :
|
|
41
|
+
`+s.map(go).join(`
|
|
42
|
+
`):" "+go(s[0]):"as no adapter specified";throw new F("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:Ir};function ir(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new bt(null,t)}function vo(t){return ir(t),t.headers=ce.from(t.headers),t.data=rr.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Pa.getAdapter(t.adapter||Bt.adapter)(t).then(function(r){return ir(t),r.data=rr.call(t,t.transformResponse,r),r.headers=ce.from(r.headers),r},function(r){return Ea(r)||(ir(t),r&&r.response&&(r.response.data=rr.call(t,t.transformResponse,r.response),r.response.headers=ce.from(r.response.headers))),Promise.reject(r)})}const xa="1.11.0",Rn={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Rn[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const yo={};Rn.transitional=function(e,n,r){function i(s,a){return"[Axios v"+xa+"] Transitional option '"+s+"'"+a+(r?". "+r:"")}return(s,a,c)=>{if(e===!1)throw new F(i(a," has been removed"+(n?" in "+n:"")),F.ERR_DEPRECATED);return n&&!yo[a]&&(yo[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}};Rn.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function ff(t,e,n){if(typeof t!="object")throw new F("options must be an object",F.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 F("option "+s+" must be "+l,F.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new F("Unknown option "+s,F.ERR_BAD_OPTION)}}const un={assertOptions:ff,validators:Rn},Ee=un.validators;let Ye=class{constructor(e){this.defaults=e||{},this.interceptors={request:new co,response:new co}}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+=`
|
|
43
|
+
`+s):r.stack=s}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=rt(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&un.assertOptions(r,{silentJSONParsing:Ee.transitional(Ee.boolean),forcedJSONParsing:Ee.transitional(Ee.boolean),clarifyTimeoutError:Ee.transitional(Ee.boolean)},!1),i!=null&&(_.isFunction(i)?n.paramsSerializer={serialize:i}:un.assertOptions(i,{encode:Ee.function,serialize:Ee.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),un.assertOptions(n,{baseUrl:Ee.spelling("baseURL"),withXsrfToken:Ee.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=s&&_.merge(s.common,s[n.method]);s&&_.forEach(["delete","get","head","post","put","patch","common"],b=>{delete s[b]}),n.headers=ce.concat(a,s);const c=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(l=l&&m.synchronous,c.unshift(m.fulfilled,m.rejected))});const f=[];this.interceptors.response.forEach(function(m){f.push(m.fulfilled,m.rejected)});let h,v=0,E;if(!l){const b=[vo.bind(this),void 0];for(b.unshift(...c),b.push(...f),E=b.length,h=Promise.resolve(n);v<E;)h=h.then(b[v++],b[v++]);return h}E=c.length;let k=n;for(v=0;v<E;){const b=c[v++],m=c[v++];try{k=b(k)}catch(y){m.call(this,y);break}}try{h=vo.call(this,k)}catch(b){return Promise.reject(b)}for(v=0,E=f.length;v<E;)h=h.then(f[v++],f[v++]);return h}getUri(e){e=rt(this.defaults,e);const n=Ca(e.baseURL,e.url,e.allowAbsoluteUrls);return wa(n,e.params,e.paramsSerializer)}};_.forEach(["delete","get","head","options"],function(e){Ye.prototype[e]=function(n,r){return this.request(rt(r||{},{method:e,url:n,data:(r||{}).data}))}});_.forEach(["post","put","patch"],function(e){function n(r){return function(s,a,c){return this.request(rt(c||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}Ye.prototype[e]=n(),Ye.prototype[e+"Form"]=n(!0)});let hf=class ja{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 bt(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)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new ja(function(i){e=i}),cancel:e}}};function pf(t){return function(n){return t.apply(null,n)}}function mf(t){return _.isObject(t)&&t.isAxiosError===!0}const Lr={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(Lr).forEach(([t,e])=>{Lr[e]=t});function Ia(t){const e=new Ye(t),n=la(Ye.prototype.request,e);return _.extend(n,Ye.prototype,e,{allOwnKeys:!0}),_.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return Ia(rt(t,i))},n}const G=Ia(Bt);G.Axios=Ye;G.CanceledError=bt;G.CancelToken=hf;G.isCancel=Ea;G.VERSION=xa;G.toFormData=In;G.AxiosError=F;G.Cancel=G.CanceledError;G.all=function(e){return Promise.all(e)};G.spread=pf;G.isAxiosError=mf;G.mergeConfig=rt;G.AxiosHeaders=ce;G.formToJSON=t=>ka(_.isHTMLForm(t)?new FormData(t):t);G.getAdapter=Pa.getAdapter;G.HttpStatusCode=Lr;G.default=G;const{Axios:Cf,AxiosError:Mf,CanceledError:Of,isCancel:Af,CancelToken:Pf,VERSION:xf,all:jf,Cancel:If,isAxiosError:Lf,spread:Rf,toFormData:Df,AxiosHeaders:Nf,HttpStatusCode:Ff,formToJSON:Uf,getAdapter:Bf,mergeConfig:Vf}=G,gf=`
|
|
44
44
|
precision mediump float;
|
|
45
45
|
|
|
46
46
|
// our textures
|
|
@@ -62,7 +62,7 @@ void main() {
|
|
|
62
62
|
|
|
63
63
|
gl_FragColor = vec4(color.rgb * mix(alpha, 1.0, u_premultipliedAlpha), alpha);
|
|
64
64
|
}
|
|
65
|
-
`,
|
|
65
|
+
`,vf=`
|
|
66
66
|
precision mediump float;
|
|
67
67
|
attribute vec2 a_position;
|
|
68
68
|
uniform mat3 u_matrix;
|
|
@@ -75,4 +75,4 @@ void main() {
|
|
|
75
75
|
// the same data for our texcoords.
|
|
76
76
|
v_texCoord = a_position;
|
|
77
77
|
}
|
|
78
|
-
`;function
|
|
78
|
+
`;function bo(t,e,n){const r=t.createShader(n);if(!r)throw Error("Unable to create shader");if(t.shaderSource(r,e),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS)){const i=t.getShaderInfoLog(r);throw t.deleteShader(r),Error(i||"unknown error")}return r}function yf(t,e){const n=t.createProgram();if(!n)throw Error("Unable to create program");for(const r of e)t.attachShader(n,r);if(t.linkProgram(n),!t.getProgramParameter(n,t.LINK_STATUS)){const r=t.getProgramInfoLog(n);throw t.deleteProgram(n),Error(r||"unknown error")}return n}const La=new WeakMap;function bf(t){const e={antialias:!1,powerPreference:"low-power",depth:!1,premultipliedAlpha:!0},n=t.getContext("webgl2",e)??t.getContext("webgl",e);if(!n)throw Error("Couldn't create GL context");const r=bo(n,gf,n.FRAGMENT_SHADER),i=bo(n,vf,n.VERTEX_SHADER),s=yf(n,[r,i]);n.useProgram(s);const a=n.getAttribLocation(s,"a_position"),c=n.getUniformLocation(s,"u_frame");n.uniform1i(c,0);const l=n.getUniformLocation(s,"u_matrix");La.set(n,n.getUniformLocation(s,"u_premultipliedAlpha")),_f(n);const f=n.createBuffer(),h=new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]);n.bindBuffer(n.ARRAY_BUFFER,f),n.bufferData(n.ARRAY_BUFFER,h,n.STATIC_DRAW),n.enableVertexAttribArray(a),n.vertexAttribPointer(a,2,n.FLOAT,!1,0,0),n.uniformMatrix3fv(l,!1,[2,0,0,0,-2,0,-1,1,1]);const v=n.createTexture();return n.bindTexture(n.TEXTURE_2D,v),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST),n}function _f(t,e){t.uniform1f(La.get(t),0)}function wf(t,e){const n=t.canvas,r=e.videoWidth,i=Math.floor(e.videoHeight/2);(n.width!==r||n.height!==i)&&(n.width=r,n.height=i,t.viewport(0,0,r,i)),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e),t.drawArrays(t.TRIANGLES,0,6)}var Rr;(function(t){t.Send="conversation_engine.external.message.send"})(Rr||(Rr={}));const Ra="https://api.avaturn.live";class Da{constructor(e,n){Q(this,"inited",!1);Q(this,"mediaStream");Q(this,"session_id","");Q(this,"sessionData",null);Q(this,"uiConfig",{background:{transparent:!0}});Q(this,"config");Q(this,"shadow",null);Q(this,"frameHandle",0);Q(this,"rootElement");Q(this,"abortController");Q(this,"timeout",0);Q(this,"keepAlive",!1);Q(this,"fetcher");Q(this,"call");Q(this,"handlers",{});if(typeof window>"u")throw new Error("Unfortunately, SDK only works on the client side.");const[r,i]=this.parseConfig(e,n),{apiHost:s=Ra,sessionToken:a,preloadBundle:c,preconnect:l,keepAlive:f}=this.config=r;this.rootElement=i,this.abortController=new AbortController,this.fetcher=G.create({baseURL:`${s}/_sdk/v0`,headers:{"X-Session-Token":a},signal:this.abortController.signal}),this.keepAlive=!!f,this.mediaStream=new MediaStream,l&&this.fetcher.post("/sessions/start_stream")}parseConfig(e,n){try{let r,i;if(e instanceof HTMLElement){if(r=e,!n)throw new Error("Options are required when providing a DOM element.");i=n}else i=e;return typeof i.immediatelyJoin>"u"&&(i.immediatelyJoin=!0),typeof i.audioSource>"u"&&(i.audioSource=!1),[i,r]}catch{throw new Error("Filed to parse configuration object. Bad configuration!")}}dispatch(e,n){var r,i,s;(r=this.handlers[e])==null||r.forEach(a=>a(n)),this.handlers.event&&((i=this.handlers.event)==null?void 0:i.length)>0&&((s=this.handlers.event)==null||s.forEach(a=>a({event:e,value:n})))}drawUI(){if(!this.rootElement||!this.inited)return;if(!this.shadow){const a=document.createElement("div");a.style.width="100%",a.style.height="100%",a.style.position="relative",a.style.overflow="hidden",this.rootElement.appendChild(a),this.shadow=a.attachShadow({mode:"closed"})}const e=this.shadow;this.shadow.innerHTML="";const n=document.createElement("video");if(n.srcObject=this.mediaStream,n.autoplay=!0,n.style.position="absolute",n.style.opacity="0",n.style.objectFit="cover",n.style.pointerEvents="none",n.playsInline=!0,e.appendChild(n),!this.uiConfig.background.transparent){n.style.width="100%",n.style.height="100%",n.style.opacity="1",n.style.pointerEvents="all";return}const r=document.createElement("canvas");r.style.width="100%",r.style.height="100%",r.style.objectFit="cover",e.appendChild(r);const i=bf(r),s=()=>{wf(i,n),this.frameHandle=requestAnimationFrame(s)};s()}startIdleTimeout(){this.timeout=setTimeout(()=>{var e;(e=this.handlers.idle)==null||e.forEach(n=>n({data:null})),this.keepAlive||(console.info("[SDK_IDLE]: Stream was terminated due to inactivity"),this.dispose())},5*60*1e3)}restartIdleTimeout(){clearTimeout(this.timeout),this.startIdleTimeout()}updateConfig(){this.call.sendAppMessage({type:Rr.Send,data:{prompt_update:!0}})}toggleLocalAudio(e){const n=this.call.localAudio();this.call.setLocalAudio(e||!n)}setOutputDevice(e){if(!this.call)throw new Error("Session not initialized");return!e.outputDeviceId||typeof e.outputDeviceId!="string"?this.call.getInputDevices():this.call.setOutputDeviceAsync({outputDeviceId:e.outputDeviceId})}setInputDevices(e){return this.call.setInputDevicesAsync(e)}requestMediaDevices(){return this.call.enumerateDevices()}async cancelAllTasks(){const{data:e}=await this.fetcher.post("/sessions/cancel_all_speech_tasks");return e}async patchConfig(e){await this.fetcher.patch("/sessions/config",e)}async changeVoice(e){await this.patchConfig({conversation_engine:{type:"text-echo",tts:e}})}applyEventHandlers(e){return new Promise((n,r)=>{var a,c;const i=e!=null&&e.timeout&&e.timeout>0?e==null?void 0:e.timeout:3e4,s=e!=null&&e.timeout?setTimeout(()=>r("Connection timeout"),i):null;(a=this.call)==null||a.on("participant-updated",({participant:l})=>{var v,E;if(l.local&&(this.dispatch("local_audio_change",this.call.localAudio()),this.dispatch("local_mic_state_change",l.tracks.audio.state)),!l.owner)return;this.config.immediatelyJoin||n();const{video:f,audio:h}=l.tracks;f.persistentTrack&&(this.mediaStream.getVideoTracks().forEach(k=>this.mediaStream.removeTrack(k)),(v=this.mediaStream)==null||v.addTrack(f.persistentTrack)),h.persistentTrack&&(this.mediaStream.getAudioTracks().forEach(k=>this.mediaStream.removeTrack(k)),(E=this.mediaStream)==null||E.addTrack(h.persistentTrack)),s&&clearTimeout(s),f.persistentTrack&&(this.inited=!0,this.drawUI(),n())}),this.call.on("error",l=>{console.error("[SKD_ERROR]: ",l)}),(c=this.call)==null||c.on("app-message",({data:l})=>{var f;this.restartIdleTimeout(),l.type&&((f=this.handlers[l.type])==null||f.forEach(h=>h(l)))})})}attachDOMNode(e){cancelAnimationFrame(this.frameHandle),this.rootElement&&(this.rootElement.innerHTML=""),this.rootElement=e,this.shadow=null,this.drawUI()}async init(e){if(this.inited)return;this.call=Du.createCallObject({subscribeToTracksAutomatically:!0,videoSource:!1,audioSource:this.config.audioSource,dailyConfig:{avoidEval:!0}}),this.config.preloadBundle&&this.call.load(),this.startIdleTimeout();const{data:n}=await this.fetcher.get("/sessions");return this.session_id=n.id,this.sessionData=n,this.uiConfig.background.transparent=n.session_config.uses_stacked_alpha,!this.abortController.signal.aborted&&this.config.immediatelyJoin&&(console.log("join"),await this.join()),this.applyEventHandlers(e)}async join(e){if(!this.sessionData)throw new Error("Session not initialized");await this.call.join({token:this.sessionData.limited_access_token,url:this.sessionData.room_url,...e}).catch(n=>{console.log("join err: ",n)})}async task(e){if(!this.session_id)throw new Error("It seems that the session is not initialized.");this.restartIdleTimeout();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))}async dispose(){this.inited=!1,this.mediaStream=new MediaStream,this.timeout&&clearTimeout(this.timeout),this.frameHandle&&cancelAnimationFrame(this.frameHandle),await this.call.destroy(),this.abortController.abort(),this.abortController=new AbortController,this.fetcher.defaults.signal=this.abortController.signal}}class Sf extends Da{constructor(n){super(n);Q(this,"assistantSessionToken","");Q(this,"assistantFetcher");Q(this,"sessionToken","");this.assistantSessionToken=n.assistantSessionToken,this.sessionToken=n.sessionToken,this.assistantFetcher=G.create({baseURL:`${n.apiHost||Ra}/`,headers:{Authorization:`Bearer ${n.assistantSessionToken}`},signal:this.abortController.signal})}async task(n,r){if(!this.session_id)throw new Error("It seems that the session is not initialized.");this.restartIdleTimeout();const{data:i}=await this.assistantFetcher.post("/assistants/tasks",{text:n});return i}async dispose(){var n;this.inited=!1,this.mediaStream=new MediaStream,this.timeout&&clearTimeout(this.timeout),this.frameHandle&&cancelAnimationFrame(this.frameHandle),await((n=this.call)==null?void 0:n.destroy()),await this.assistantFetcher.delete("/assistants/sessions"),this.abortController.abort(),this.abortController=new AbortController,this.fetcher.defaults.signal=this.abortController.signal,this.assistantFetcher.defaults.signal=this.abortController.signal}}exports.AvaturnAssistantHead=Sf;exports.AvaturnHead=Da;
|