@avaturn-live/web-sdk 0.0.21 → 0.0.22
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 +8 -8
- package/dist/main.d.ts +7 -0
- package/dist/main.js +79 -70
- package/dist/type.d.ts +22 -0
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Zo=Object.defineProperty;var ea=(t,e,n)=>e in t?Zo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var
|
|
1
|
+
"use strict";var Zo=Object.defineProperty;var ea=(t,e,n)=>e in t?Zo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Z=(t,e,n)=>ea(t,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function Gr(t,e){if(t==null)return{};var n,r,i=function(a,c){if(a==null)return{};var l,p,h={},f=Object.keys(a);for(p=0;p<f.length;p++)l=f[p],c.indexOf(l)>=0||(h[l]=a[l]);return h}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)n=s[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function pe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function U(t){return U=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},U(t)}function Ns(t){var e=function(n,r){if(U(n)!=="object"||n===null)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var s=i.call(n,r||"default");if(U(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(n)}(t,"string");return U(e)==="symbol"?e:String(e)}function zr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ns(r.key),r)}}function fe(t,e,n){return e&&zr(t.prototype,e),n&&zr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Se(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function wt(t,e){return wt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},wt(t,e)}function ln(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&wt(t,e)}function un(t,e){if(e&&(U(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Se(t)}function de(t){return de=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},de(t)}function Pe(t,e,n){return(e=Ns(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Hr(t,e,n,r,i,s,a){try{var c=t[s](a),l=c.value}catch(p){return void n(p)}c.done?e(l):Promise.resolve(l).then(r,i)}function O(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var s=t.apply(e,n);function a(l){Hr(s,r,i,a,c,"next",l)}function c(l){Hr(s,r,i,a,c,"throw",l)}a(void 0)})}}function Yr(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function $e(t,e){return function(n){if(Array.isArray(n))return n}(t)||function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var s,a,c,l,p=[],h=!0,f=!1;try{if(c=(i=i.call(n)).next,r===0){if(Object(i)!==i)return;h=!1}else for(;!(h=(s=c.call(i)).done)&&(p.push(s.value),p.length!==r);h=!0);}catch(_){f=!0,a=_}finally{try{if(!h&&i.return!=null&&(l=i.return(),Object(l)!==l))return}finally{if(f)throw a}}return p}}(t,e)||function(n,r){if(n){if(typeof n=="string")return Yr(n,r);var i=Object.prototype.toString.call(n).slice(8,-1);return i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set"?Array.from(n):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Yr(n,r):void 0}}(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}var js,Ee={},ta={get exports(){return Ee},set exports(t){Ee=t}},Ze=typeof Reflect=="object"?Reflect:null,Wr=Ze&&typeof Ze.apply=="function"?Ze.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};js=Ze&&typeof Ze.ownKeys=="function"?Ze.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var Kr=Number.isNaN||function(t){return t!=t};function j(){j.init.call(this)}ta.exports=j,Ee.once=function(t,e){return new Promise(function(n,r){function i(a){t.removeListener(e,s),r(a)}function s(){typeof t.removeListener=="function"&&t.removeListener("error",i),n([].slice.call(arguments))}ni(t,e,s,{once:!0}),e!=="error"&&function(a,c,l){typeof a.on=="function"&&ni(a,"error",c,l)}(t,i,{once:!0})})},j.EventEmitter=j,j.prototype._events=void 0,j.prototype._eventsCount=0,j.prototype._maxListeners=void 0;var Qr=10;function Ht(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function Is(t){return t._maxListeners===void 0?j.defaultMaxListeners:t._maxListeners}function Xr(t,e,n,r){var i,s,a,c;if(Ht(n),(s=t._events)===void 0?(s=t._events=Object.create(null),t._eventsCount=0):(s.newListener!==void 0&&(t.emit("newListener",e,n.listener?n.listener:n),s=t._events),a=s[e]),a===void 0)a=s[e]=n,++t._eventsCount;else if(typeof a=="function"?a=s[e]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(i=Is(t))>0&&a.length>i&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=a.length,c=l,console&&console.warn&&console.warn(c)}return t}function na(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Zr(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=na.bind(r);return i.listener=n,r.wrapFn=i,i}function ei(t,e,n){var r=t._events;if(r===void 0)return[];var i=r[e];return i===void 0?[]:typeof i=="function"?n?[i.listener||i]:[i]:n?function(s){for(var a=new Array(s.length),c=0;c<a.length;++c)a[c]=s[c].listener||s[c];return a}(i):Bs(i,i.length)}function ti(t){var e=this._events;if(e!==void 0){var n=e[t];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}function Bs(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}function ni(t,e,n,r){if(typeof t.on=="function")r.once?t.once(e,n):t.on(e,n);else{if(typeof t.addEventListener!="function")throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,function i(s){r.once&&t.removeEventListener(e,i),n(s)})}}Object.defineProperty(j,"defaultMaxListeners",{enumerable:!0,get:function(){return Qr},set:function(t){if(typeof t!="number"||t<0||Kr(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Qr=t}}),j.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},j.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||Kr(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},j.prototype.getMaxListeners=function(){return Is(this)},j.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var r=t==="error",i=this._events;if(i!==void 0)r=r&&i.error===void 0;else if(!r)return!1;if(r){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=i[t];if(c===void 0)return!1;if(typeof c=="function")Wr(c,this,e);else{var l=c.length,p=Bs(c,l);for(n=0;n<l;++n)Wr(p[n],this,e)}return!0},j.prototype.addListener=function(t,e){return Xr(this,t,e,!1)},j.prototype.on=j.prototype.addListener,j.prototype.prependListener=function(t,e){return Xr(this,t,e,!0)},j.prototype.once=function(t,e){return Ht(e),this.on(t,Zr(this,t,e)),this},j.prototype.prependOnceListener=function(t,e){return Ht(e),this.prependListener(t,Zr(this,t,e)),this},j.prototype.removeListener=function(t,e){var n,r,i,s,a;if(Ht(e),(r=this._events)===void 0)return this;if((n=r[t])===void 0)return this;if(n===e||n.listener===e)--this._eventsCount==0?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if(typeof n!="function"){for(i=-1,s=n.length-1;s>=0;s--)if(n[s]===e||n[s].listener===e){a=n[s].listener,i=s;break}if(i<0)return this;i===0?n.shift():function(c,l){for(;l+1<c.length;l++)c[l]=c[l+1];c.pop()}(n,i),n.length===1&&(r[t]=n[0]),r.removeListener!==void 0&&this.emit("removeListener",t,a||e)}return this},j.prototype.off=j.prototype.removeListener,j.prototype.removeAllListeners=function(t){var e,n,r;if((n=this._events)===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[t]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete n[t]),this;if(arguments.length===0){var i,s=Object.keys(n);for(r=0;r<s.length;++r)(i=s[r])!=="removeListener"&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(e=n[t])=="function")this.removeListener(t,e);else if(e!==void 0)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},j.prototype.listeners=function(t){return ei(this,t,!0)},j.prototype.rawListeners=function(t){return ei(this,t,!1)},j.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):ti.call(t,e)},j.prototype.listenerCount=ti,j.prototype.eventNames=function(){return this._eventsCount>0?js(this._events):[]};var ri=Object.prototype.hasOwnProperty;function ii(t,e,n){for(n of t.keys())if(Q(n,e))return n}function Q(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--&&Q(t[r],e[r]););return r===-1}if(n===Set){if(t.size!==e.size)return!1;for(r of t)if((i=r)&&typeof i=="object"&&!(i=ii(e,i))||!e.has(i))return!1;return!0}if(n===Map){if(t.size!==e.size)return!1;for(r of t)if((i=r[0])&&typeof i=="object"&&!(i=ii(e,i))||!Q(r[1],e.get(i)))return!1;return!0}if(n===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(n===DataView){if((r=t.byteLength)===e.byteLength)for(;r--&&t.getInt8(r)===e.getInt8(r););return r===-1}if(ArrayBuffer.isView(t)){if((r=t.byteLength)===e.byteLength)for(;r--&&t[r]===e[r];);return r===-1}if(!n||typeof t=="object"){for(n in r=0,t)if(ri.call(t,n)&&++r&&!ri.call(e,n)||!(n in e)||!Q(t[n],e[n]))return!1;return Object.keys(e).length===r}}return t!=t&&e!=e}const ra={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},Fs={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},V={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},W={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},Oe={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class S{static getFirstMatch(e,n){const r=n.match(e);return r&&r.length>0&&r[1]||""}static getSecondMatch(e,n){const r=n.match(e);return r&&r.length>1&&r[2]||""}static matchAndReturnConst(e,n,r){if(e.test(n))return r}static getWindowsVersionName(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(e){const n=e.split(".").splice(0,2).map(r=>parseInt(r,10)||0);if(n.push(0),n[0]===10)switch(n[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}}static getAndroidVersionName(e){const n=e.split(".").splice(0,2).map(r=>parseInt(r,10)||0);if(n.push(0),!(n[0]===1&&n[1]<5))return n[0]===1&&n[1]<6?"Cupcake":n[0]===1&&n[1]>=6?"Donut":n[0]===2&&n[1]<2?"Eclair":n[0]===2&&n[1]===2?"Froyo":n[0]===2&&n[1]>2?"Gingerbread":n[0]===3?"Honeycomb":n[0]===4&&n[1]<1?"Ice Cream Sandwich":n[0]===4&&n[1]<4?"Jelly Bean":n[0]===4&&n[1]>=4?"KitKat":n[0]===5?"Lollipop":n[0]===6?"Marshmallow":n[0]===7?"Nougat":n[0]===8?"Oreo":n[0]===9?"Pie":void 0}static getVersionPrecision(e){return e.split(".").length}static compareVersions(e,n,r=!1){const i=S.getVersionPrecision(e),s=S.getVersionPrecision(n);let a=Math.max(i,s),c=0;const l=S.map([e,n],p=>{const h=a-S.getVersionPrecision(p),f=p+new Array(h+1).join(".0");return S.map(f.split("."),_=>new Array(20-_.length).join("0")+_).reverse()});for(r&&(c=a-Math.min(i,s)),a-=1;a>=c;){if(l[0][a]>l[1][a])return 1;if(l[0][a]===l[1][a]){if(a===c)return 0;a-=1}else if(l[0][a]<l[1][a])return-1}}static map(e,n){const r=[];let i;if(Array.prototype.map)return Array.prototype.map.call(e,n);for(i=0;i<e.length;i+=1)r.push(n(e[i]));return r}static find(e,n){let r,i;if(Array.prototype.find)return Array.prototype.find.call(e,n);for(r=0,i=e.length;r<i;r+=1){const s=e[r];if(n(s,r))return s}}static assign(e,...n){const r=e;let i,s;if(Object.assign)return Object.assign(e,...n);for(i=0,s=n.length;i<s;i+=1){const a=n[i];typeof a=="object"&&a!==null&&Object.keys(a).forEach(c=>{r[c]=a[c]})}return e}static getBrowserAlias(e){return ra[e]}static getBrowserTypeByAlias(e){return Fs[e]||""}}const I=/version\/(\d+(\.?_?\d+)+)/i,ia=[{test:[/googlebot/i],describe(t){const e={name:"Googlebot"},n=S.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/opera/i],describe(t){const e={name:"Opera"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/opr\/|opios/i],describe(t){const e={name:"Opera"},n=S.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/SamsungBrowser/i],describe(t){const e={name:"Samsung Internet for Android"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/Whale/i],describe(t){const e={name:"NAVER Whale Browser"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/MZBrowser/i],describe(t){const e={name:"MZ Browser"},n=S.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/focus/i],describe(t){const e={name:"Focus"},n=S.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/swing/i],describe(t){const e={name:"Swing"},n=S.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/coast/i],describe(t){const e={name:"Opera Coast"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(t){const e={name:"Opera Touch"},n=S.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/yabrowser/i],describe(t){const e={name:"Yandex Browser"},n=S.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/ucbrowser/i],describe(t){const e={name:"UC Browser"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/Maxthon|mxios/i],describe(t){const e={name:"Maxthon"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/epiphany/i],describe(t){const e={name:"Epiphany"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/puffin/i],describe(t){const e={name:"Puffin"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/sleipnir/i],describe(t){const e={name:"Sleipnir"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/k-meleon/i],describe(t){const e={name:"K-Meleon"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/micromessenger/i],describe(t){const e={name:"WeChat"},n=S.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/qqbrowser/i],describe(t){const e={name:/qqbrowserlite/i.test(t)?"QQ Browser Lite":"QQ Browser"},n=S.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/msie|trident/i],describe(t){const e={name:"Internet Explorer"},n=S.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/\sedg\//i],describe(t){const e={name:"Microsoft Edge"},n=S.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/edg([ea]|ios)/i],describe(t){const e={name:"Microsoft Edge"},n=S.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/vivaldi/i],describe(t){const e={name:"Vivaldi"},n=S.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/seamonkey/i],describe(t){const e={name:"SeaMonkey"},n=S.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/sailfish/i],describe(t){const e={name:"Sailfish"},n=S.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,t);return n&&(e.version=n),e}},{test:[/silk/i],describe(t){const e={name:"Amazon Silk"},n=S.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/phantom/i],describe(t){const e={name:"PhantomJS"},n=S.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/slimerjs/i],describe(t){const e={name:"SlimerJS"},n=S.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(t){const e={name:"BlackBerry"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/(web|hpw)[o0]s/i],describe(t){const e={name:"WebOS Browser"},n=S.getFirstMatch(I,t)||S.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/bada/i],describe(t){const e={name:"Bada"},n=S.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/tizen/i],describe(t){const e={name:"Tizen"},n=S.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/qupzilla/i],describe(t){const e={name:"QupZilla"},n=S.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/firefox|iceweasel|fxios/i],describe(t){const e={name:"Firefox"},n=S.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/electron/i],describe(t){const e={name:"Electron"},n=S.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/MiuiBrowser/i],describe(t){const e={name:"Miui"},n=S.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/chromium/i],describe(t){const e={name:"Chromium"},n=S.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,t)||S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/chrome|crios|crmo/i],describe(t){const e={name:"Chrome"},n=S.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/GSA/i],describe(t){const e={name:"Google Search"},n=S.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test(t){const e=!t.test(/like android/i),n=t.test(/android/i);return e&&n},describe(t){const e={name:"Android Browser"},n=S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/playstation 4/i],describe(t){const e={name:"PlayStation 4"},n=S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/safari|applewebkit/i],describe(t){const e={name:"Safari"},n=S.getFirstMatch(I,t);return n&&(e.version=n),e}},{test:[/.*/i],describe(t){const e=t.search("\\(")!==-1?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:S.getFirstMatch(e,t),version:S.getSecondMatch(e,t)}}}];var sa=[{test:[/Roku\/DVP/],describe(t){const e=S.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,t);return{name:W.Roku,version:e}}},{test:[/windows phone/i],describe(t){const e=S.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,t);return{name:W.WindowsPhone,version:e}}},{test:[/windows /i],describe(t){const e=S.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,t),n=S.getWindowsVersionName(e);return{name:W.Windows,version:e,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(t){const e={name:W.iOS},n=S.getSecondMatch(/(Version\/)(\d[\d.]+)/,t);return n&&(e.version=n),e}},{test:[/macintosh/i],describe(t){const e=S.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,t).replace(/[_\s]/g,"."),n=S.getMacOSVersionName(e),r={name:W.MacOS,version:e};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe(t){const e=S.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,t).replace(/[_\s]/g,".");return{name:W.iOS,version:e}}},{test(t){const e=!t.test(/like android/i),n=t.test(/android/i);return e&&n},describe(t){const e=S.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,t),n=S.getAndroidVersionName(e),r={name:W.Android,version:e};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe(t){const e=S.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,t),n={name:W.WebOS};return e&&e.length&&(n.version=e),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(t){const e=S.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,t)||S.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,t)||S.getFirstMatch(/\bbb(\d+)/i,t);return{name:W.BlackBerry,version:e}}},{test:[/bada/i],describe(t){const e=S.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,t);return{name:W.Bada,version:e}}},{test:[/tizen/i],describe(t){const e=S.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,t);return{name:W.Tizen,version:e}}},{test:[/linux/i],describe:()=>({name:W.Linux})},{test:[/CrOS/],describe:()=>({name:W.ChromeOS})},{test:[/PlayStation 4/],describe(t){const e=S.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,t);return{name:W.PlayStation4,version:e}}}],oa=[{test:[/googlebot/i],describe:()=>({type:"bot",vendor:"Google"})},{test:[/huawei/i],describe(t){const e=S.getFirstMatch(/(can-l01)/i,t)&&"Nova",n={type:V.mobile,vendor:"Huawei"};return e&&(n.model=e),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:()=>({type:V.tablet,vendor:"Nexus"})},{test:[/ipad/i],describe:()=>({type:V.tablet,vendor:"Apple",model:"iPad"})},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:()=>({type:V.tablet,vendor:"Apple",model:"iPad"})},{test:[/kftt build/i],describe:()=>({type:V.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"})},{test:[/silk/i],describe:()=>({type:V.tablet,vendor:"Amazon"})},{test:[/tablet(?! pc)/i],describe:()=>({type:V.tablet})},{test(t){const e=t.test(/ipod|iphone/i),n=t.test(/like (ipod|iphone)/i);return e&&!n},describe(t){const e=S.getFirstMatch(/(ipod|iphone)/i,t);return{type:V.mobile,vendor:"Apple",model:e}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:()=>({type:V.mobile,vendor:"Nexus"})},{test:[/[^-]mobi/i],describe:()=>({type:V.mobile})},{test:t=>t.getBrowserName(!0)==="blackberry",describe:()=>({type:V.mobile,vendor:"BlackBerry"})},{test:t=>t.getBrowserName(!0)==="bada",describe:()=>({type:V.mobile})},{test:t=>t.getBrowserName()==="windows phone",describe:()=>({type:V.mobile,vendor:"Microsoft"})},{test(t){const e=Number(String(t.getOSVersion()).split(".")[0]);return t.getOSName(!0)==="android"&&e>=3},describe:()=>({type:V.tablet})},{test:t=>t.getOSName(!0)==="android",describe:()=>({type:V.mobile})},{test:t=>t.getOSName(!0)==="macos",describe:()=>({type:V.desktop,vendor:"Apple"})},{test:t=>t.getOSName(!0)==="windows",describe:()=>({type:V.desktop})},{test:t=>t.getOSName(!0)==="linux",describe:()=>({type:V.desktop})},{test:t=>t.getOSName(!0)==="playstation 4",describe:()=>({type:V.tv})},{test:t=>t.getOSName(!0)==="roku",describe:()=>({type:V.tv})}],aa=[{test:t=>t.getBrowserName(!0)==="microsoft edge",describe(t){if(/\sedg\//i.test(t))return{name:Oe.Blink};const e=S.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,t);return{name:Oe.EdgeHTML,version:e}}},{test:[/trident/i],describe(t){const e={name:Oe.Trident},n=S.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:t=>t.test(/presto/i),describe(t){const e={name:Oe.Presto},n=S.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test(t){const e=t.test(/gecko/i),n=t.test(/like gecko/i);return e&&!n},describe(t){const e={name:Oe.Gecko},n=S.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/(apple)?webkit\/537\.36/i],describe:()=>({name:Oe.Blink})},{test:[/(apple)?webkit/i],describe(t){const e={name:Oe.WebKit},n=S.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}}];class si{constructor(e,n=!1){if(e==null||e==="")throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},n!==!0&&this.parse()}getUA(){return this._ua}test(e){return e.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const e=S.find(ia,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.browser=e.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const e=S.find(sa,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.os=e.describe(this.getUA())),this.parsedResult.os}getOSName(e){const{name:n}=this.getOS();return e?String(n).toLowerCase()||"":n||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(e=!1){const{type:n}=this.getPlatform();return e?String(n).toLowerCase()||"":n||""}parsePlatform(){this.parsedResult.platform={};const e=S.find(oa,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.platform=e.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const e=S.find(aa,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.engine=e.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return S.assign({},this.parsedResult)}satisfies(e){const n={};let r=0;const i={};let s=0;if(Object.keys(e).forEach(a=>{const c=e[a];typeof c=="string"?(i[a]=c,s+=1):typeof c=="object"&&(n[a]=c,r+=1)}),r>0){const a=Object.keys(n),c=S.find(a,p=>this.isOS(p));if(c){const p=this.satisfies(n[c]);if(p!==void 0)return p}const l=S.find(a,p=>this.isPlatform(p));if(l){const p=this.satisfies(n[l]);if(p!==void 0)return p}}if(s>0){const a=Object.keys(i),c=S.find(a,l=>this.isBrowser(l,!0));if(c!==void 0)return this.compareVersion(i[c])}}isBrowser(e,n=!1){const r=this.getBrowserName().toLowerCase();let i=e.toLowerCase();const s=S.getBrowserTypeByAlias(i);return n&&s&&(i=s.toLowerCase()),i===r}compareVersion(e){let n=[0],r=e,i=!1;const s=this.getBrowserVersion();if(typeof s=="string")return e[0]===">"||e[0]==="<"?(r=e.substr(1),e[1]==="="?(i=!0,r=e.substr(2)):n=[],e[0]===">"?n.push(1):n.push(-1)):e[0]==="="?r=e.substr(1):e[0]==="~"&&(i=!0,r=e.substr(1)),n.indexOf(S.compareVersions(s,r,i))>-1}isOS(e){return this.getOSName(!0)===String(e).toLowerCase()}isPlatform(e){return this.getPlatformType(!0)===String(e).toLowerCase()}isEngine(e){return this.getEngineName(!0)===String(e).toLowerCase()}is(e,n=!1){return this.isBrowser(e,n)||this.isOS(e)||this.isPlatform(e)}some(e=[]){return e.some(n=>this.is(n))}}/*!
|
|
3
3
|
* Bowser - a browser detector
|
|
4
4
|
* https://github.com/lancedikson/bowser
|
|
@@ -12,7 +12,7 @@ ${JSON.stringify(c)}
|
|
|
12
12
|
`),typeof l=="string"||l instanceof Uint8Array)s(l);else{let p;try{p=JSON.stringify(l)}catch{p=JSON.stringify(Re(l))}s(p)}}return typeof i=="string"?i:function(a){const c=a.reduce((h,f)=>h+f.length,0),l=new Uint8Array(c);let p=0;for(const h of a)l.set(h,p),p+=h.length;return l}(i)}function ka(t,e){const n=typeof t.data=="string"?Hn(t.data,e):t.data;return[hn({type:"attachment",length:n.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType}),n]}(()=>{const{performance:t}=Ws;if(!t||!t.now)return;const e=36e5,n=t.now(),r=Date.now(),i=t.timeOrigin?Math.abs(t.timeOrigin+n-r):e,s=i<e,a=t.timing&&t.timing.navigationStart,c=typeof a=="number"?Math.abs(a+n-r):e;(s||c<e)&&i<=c&&t.timeOrigin})();const Ea={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor"};function wi(t){return Ea[t]}function Qs(t){if(!t||!t.sdk)return;const{name:e,version:n}=t.sdk;return{name:e,version:n}}const Ta=6e4;function Ca(t,{statusCode:e,headers:n},r=Date.now()){const i={...t},s=n&&n["x-sentry-rate-limits"],a=n&&n["retry-after"];if(s)for(const c of s.trim().split(",")){const[l,p]=c.split(":",2),h=parseInt(l,10),f=1e3*(isNaN(h)?60:h);if(p)for(const _ of p.split(";"))i[_]=r+f;else i.all=r+f}else a?i.all=r+function(c,l=Date.now()){const p=parseInt(`${c}`,10);if(!isNaN(p))return 1e3*p;const h=Date.parse(`${c}`);return isNaN(h)?Ta:h-l}(a,r):e===429&&(i.all=r+6e4);return i}const _r="production";function Ma(t){const e=Ks(),n={sid:De(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(r){return hn({sid:`${r.sid}`,init:r.init,started:new Date(1e3*r.started).toISOString(),timestamp:new Date(1e3*r.timestamp).toISOString(),status:r.status,errors:r.errors,did:typeof r.did=="number"||typeof r.did=="string"?`${r.did}`:void 0,duration:r.duration,attrs:{release:r.release,environment:r.environment,ip_address:r.ipAddress,user_agent:r.userAgent}})}(n)};return t&&at(n,t),n}function at(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),t.did||e.did||(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||Ks(),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:De()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{const n=t.timestamp-t.started;t.duration=n>=0?n:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}class Je{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=Si()}static clone(e){const n=new Je;return e&&(n._breadcrumbs=[...e._breadcrumbs],n._tags={...e._tags},n._extra={...e._extra},n._contexts={...e._contexts},n._user=e._user,n._level=e._level,n._span=e._span,n._session=e._session,n._transactionName=e._transactionName,n._fingerprint=e._fingerprint,n._eventProcessors=[...e._eventProcessors],n._requestSession=e._requestSession,n._attachments=[...e._attachments],n._sdkProcessingMetadata={...e._sdkProcessingMetadata},n._propagationContext={...e._propagationContext}),n}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{},this._session&&at(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,n){return this._tags={...this._tags,[e]:n},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,n){return this._extra={...this._extra,[e]:n},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,n){return n===null?delete this._contexts[e]:this._contexts[e]=n,this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const e=this.getSpan();return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;if(typeof e=="function"){const n=e(this);return n instanceof Je?n:this}return e instanceof Je?(this._tags={...this._tags,...e._tags},this._extra={...this._extra,...e._extra},this._contexts={...this._contexts,...e._contexts},e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession),e._propagationContext&&(this._propagationContext=e._propagationContext)):ot(e)&&(this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession),e.propagationContext&&(this._propagationContext=e.propagationContext)),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=Si(),this}addBreadcrumb(e,n){const r=typeof n=="number"?n:100;if(r<=0)return this;const i={timestamp:pn(),...e};return this._breadcrumbs=[...this._breadcrumbs,i].slice(-r),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(e,n={}){if(this._extra&&Object.keys(this._extra).length&&(e.extra={...this._extra,...e.extra}),this._tags&&Object.keys(this._tags).length&&(e.tags={...this._tags,...e.tags}),this._user&&Object.keys(this._user).length&&(e.user={...this._user,...e.user}),this._contexts&&Object.keys(this._contexts).length&&(e.contexts={...this._contexts,...e.contexts}),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts={trace:this._span.getTraceContext(),...e.contexts};const r=this._span.transaction;if(r){e.sdkProcessingMetadata={dynamicSamplingContext:r.getDynamicSamplingContext(),...e.sdkProcessingMetadata};const i=r.name;i&&(e.tags={transaction:i,...e.tags})}}return this._applyFingerprint(e),e.breadcrumbs=[...e.breadcrumbs||[],...this._breadcrumbs],e.breadcrumbs=e.breadcrumbs.length>0?e.breadcrumbs:void 0,e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...this._sdkProcessingMetadata,propagationContext:this._propagationContext},this._notifyEventProcessors([...Xs(),...this._eventProcessors],e,n)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}_notifyEventProcessors(e,n,r,i=0){return new K((s,a)=>{const c=e[i];if(n===null||typeof c!="function")s(n);else{const l=c({...n},r);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&c.id&&l===null&&R.log(`Event processor "${c.id}" dropped event`),mr(l)?l.then(p=>this._notifyEventProcessors(e,p,r,i+1).then(s)).then(null,a):this._notifyEventProcessors(e,l,r,i+1).then(s).then(null,a)}})}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}_applyFingerprint(e){var n;e.fingerprint=e.fingerprint?(n=e.fingerprint,Array.isArray(n)?n:[n]):[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}}function Xs(){return gr("globalEventProcessors",()=>[])}function Zs(t){Xs().push(t)}function Si(){return{traceId:De(),spanId:De().substring(16),sampled:!1}}const eo=4,Oa=100;class br{constructor(e,n=new Je,r=eo){this._version=r,this._stack=[{scope:n}],e&&this.bindClient(e)}isOlderThan(e){return this._version<e}bindClient(e){this.getStackTop().client=e,e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){const e=Je.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return!(this.getStack().length<=1)&&!!this.getStack().pop()}withScope(e){const n=this.pushScope();try{e(n)}finally{this.popScope()}}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,n){const r=this._lastEventId=n&&n.event_id?n.event_id:De(),i=new Error("Sentry syntheticException");return this._withClient((s,a)=>{s.captureException(e,{originalException:e,syntheticException:i,...n,event_id:r},a)}),r}captureMessage(e,n,r){const i=this._lastEventId=r&&r.event_id?r.event_id:De(),s=new Error(e);return this._withClient((a,c)=>{a.captureMessage(e,n,{originalException:e,syntheticException:s,...r,event_id:i},c)}),i}captureEvent(e,n){const r=n&&n.event_id?n.event_id:De();return e.type||(this._lastEventId=r),this._withClient((i,s)=>{i.captureEvent(e,{...n,event_id:r},s)}),r}lastEventId(){return this._lastEventId}addBreadcrumb(e,n){const{scope:r,client:i}=this.getStackTop();if(!i)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:a=Oa}=i.getOptions&&i.getOptions()||{};if(a<=0)return;const c={timestamp:pn(),...e},l=s?$s(()=>s(c,n)):c;l!==null&&(i.emit&&i.emit("beforeAddBreadcrumb",l,n),r.addBreadcrumb(l,a))}setUser(e){this.getScope().setUser(e)}setTags(e){this.getScope().setTags(e)}setExtras(e){this.getScope().setExtras(e)}setTag(e,n){this.getScope().setTag(e,n)}setExtra(e,n){this.getScope().setExtra(e,n)}setContext(e,n){this.getScope().setContext(e,n)}configureScope(e){const{scope:n,client:r}=this.getStackTop();r&&e(n)}run(e){const n=ki(this);try{e(this)}finally{ki(n)}}getIntegration(e){const n=this.getClient();if(!n)return null;try{return n.getIntegration(e)}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,n){const r=this._callExtensionMethod("startTransaction",e,n);return typeof __SENTRY_DEBUG__<"u"&&!__SENTRY_DEBUG__||r||console.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
|
|
13
13
|
Sentry.addTracingExtensions();
|
|
14
14
|
Sentry.init({...});
|
|
15
|
-
`),r}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){const e=this.getStackTop().scope,n=e.getSession();n&&function(r,i){let s={};r.status==="ok"&&(s={status:"exited"}),at(r,s)}(n),this._sendSessionUpdate(),e.setSession()}startSession(e){const{scope:n,client:r}=this.getStackTop(),{release:i,environment:s=_r}=r&&r.getOptions()||{},{userAgent:a}=ie.navigator||{},c=Ma({release:i,environment:s,user:n.getUser(),...a&&{userAgent:a},...e}),l=n.getSession&&n.getSession();return l&&l.status==="ok"&&at(l,{status:"exited"}),this.endSession(),n.setSession(c),c}shouldSendDefaultPii(){const e=this.getClient(),n=e&&e.getOptions();return!!(n&&n.sendDefaultPii)}_sendSessionUpdate(){const{scope:e,client:n}=this.getStackTop(),r=e.getSession();r&&n&&n.captureSession&&n.captureSession(r)}_withClient(e){const{scope:n,client:r}=this.getStackTop();r&&e(r,n)}_callExtensionMethod(e,...n){const r=rn().__SENTRY__;if(r&&r.extensions&&typeof r.extensions[e]=="function")return r.extensions[e].apply(this,n);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function rn(){return ie.__SENTRY__=ie.__SENTRY__||{extensions:{},hub:void 0},ie}function ki(t){const e=rn(),n=Yn(e);return to(e,t),n}function ee(){const t=rn();if(t.__SENTRY__&&t.__SENTRY__.acs){const e=t.__SENTRY__.acs.getCurrentHub();if(e)return e}return function(e=rn()){n=e,n&&n.__SENTRY__&&n.__SENTRY__.hub&&!Yn(e).isOlderThan(eo)||to(e,new br);var n;return Yn(e)}(t)}function Yn(t){return gr("hub",()=>new br,t)}function to(t,e){return t?((t.__SENTRY__=t.__SENTRY__||{}).hub=e,!0):!1}const Pa="7";function Aa(t,e){return n={sentry_key:t.publicKey,sentry_version:Pa,...e&&{sentry_client:`${e.name}/${e.version}`}},Object.keys(n).map(r=>`${encodeURIComponent(r)}=${encodeURIComponent(n[r])}`).join("&");var n}function Ra(t,e,n,r){const i=Qs(n),s=t.type&&t.type!=="replay_event"?t.type:"event";(function(c,l){l&&(c.sdk=c.sdk||{},c.sdk.name=c.sdk.name||l.name,c.sdk.version=c.sdk.version||l.version,c.sdk.integrations=[...c.sdk.integrations||[],...l.integrations||[]],c.sdk.packages=[...c.sdk.packages||[],...l.packages||[]])})(t,n&&n.sdk);const a=function(c,l,p,h){const f=c.sdkProcessingMetadata&&c.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:c.event_id,sent_at:new Date().toISOString(),...l&&{sdk:l},...!!p&&{dsn:tn(h)},...f&&{trace:hn({...f})}}}(t,i,r,e);return delete t.sdkProcessingMetadata,Et(a,[[{type:s},t]])}const Ei=[];function Ti(t,e){e[t.name]=t,Ei.indexOf(t.name)===-1&&(t.setupOnce(Zs,ee),Ei.push(t.name),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log(`Integration installed: ${t.name}`))}function Da(t,e,n,r){const{normalizeDepth:i=3,normalizeMaxBreadth:s=1e3}=t,a={...e,event_id:e.event_id||n.event_id||De(),timestamp:e.timestamp||pn()},c=n.integrations||t.integrations.map(h=>h.name);(function(h,f){const{environment:_,release:k,dist:v,maxValueLength:b=250}=f;"environment"in h||(h.environment="environment"in f?_:_r),h.release===void 0&&k!==void 0&&(h.release=k),h.dist===void 0&&v!==void 0&&(h.dist=v),h.message&&(h.message=et(h.message,b));const T=h.exception&&h.exception.values&&h.exception.values[0];T&&T.value&&(T.value=et(T.value,b));const M=h.request;M&&M.url&&(M.url=et(M.url,b))})(a,t),function(h,f){f.length>0&&(h.sdk=h.sdk||{},h.sdk.integrations=[...h.sdk.integrations||[],...f])}(a,c),e.type===void 0&&function(h,f){const _=ie._sentryDebugIds;if(!_)return;let k;const v=Ci.get(f);v?k=v:(k=new Map,Ci.set(f,k));const b=Object.keys(_).reduce((T,M)=>{let B;const L=k.get(M);L?B=L:(B=f(M),k.set(M,B));for(let te=B.length-1;te>=0;te--){const Ne=B[te];if(Ne.filename){T[Ne.filename]=_[M];break}}return T},{});try{h.exception.values.forEach(T=>{T.stacktrace.frames.forEach(M=>{M.filename&&(M.debug_id=b[M.filename])})})}catch{}}(a,t.stackParser);let l=r;n.captureContext&&(l=Je.clone(l).update(n.captureContext));let p=He(a);if(l){if(l.getAttachments){const h=[...n.attachments||[],...l.getAttachments()];h.length&&(n.attachments=h)}p=l.applyToEvent(a,n)}return p.then(h=>(h&&function(f){const _={};try{f.exception.values.forEach(v=>{v.stacktrace.frames.forEach(b=>{b.debug_id&&(b.abs_path?_[b.abs_path]=b.debug_id:b.filename&&(_[b.filename]=b.debug_id),delete b.debug_id)})})}catch{}if(Object.keys(_).length===0)return;f.debug_meta=f.debug_meta||{},f.debug_meta.images=f.debug_meta.images||[];const k=f.debug_meta.images;Object.keys(_).forEach(v=>{k.push({type:"sourcemap",code_file:v,debug_id:_[v]})})}(h),typeof i=="number"&&i>0?function(f,_,k){if(!f)return null;const v={...f,...f.breadcrumbs&&{breadcrumbs:f.breadcrumbs.map(b=>({...b,...b.data&&{data:Re(b.data,_,k)}}))},...f.user&&{user:Re(f.user,_,k)},...f.contexts&&{contexts:Re(f.contexts,_,k)},...f.extra&&{extra:Re(f.extra,_,k)}};return f.contexts&&f.contexts.trace&&v.contexts&&(v.contexts.trace=f.contexts.trace,f.contexts.trace.data&&(v.contexts.trace.data=Re(f.contexts.trace.data,_,k))),f.spans&&(v.spans=f.spans.map(b=>(b.data&&(b.data=Re(b.data,_,k)),b))),v}(h,i,s):h))}const Ci=new WeakMap,Mi="Not capturing exception because it's already been captured.";class qe{__init(){this._integrations={}}__init2(){this._integrationsInitialized=!1}__init3(){this._numProcessing=0}__init4(){this._outcomes={}}__init5(){this._hooks={}}constructor(e){if(qe.prototype.__init.call(this),qe.prototype.__init2.call(this),qe.prototype.__init3.call(this),qe.prototype.__init4.call(this),qe.prototype.__init5.call(this),this._options=e,e.dsn?this._dsn=ma(e.dsn):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn("No DSN provided, client will not do anything."),this._dsn){const n=function(r,i={}){const s=typeof i=="string"?i:i.tunnel,a=typeof i!="string"&&i._metadata?i._metadata.sdk:void 0;return s||`${function(c){return`${function(l){const p=l.protocol?`${l.protocol}:`:"",h=l.port?`:${l.port}`:"";return`${p}//${l.host}${h}${l.path?`/${l.path}`:""}/api/`}(c)}${c.projectId}/envelope/`}(r)}?${Aa(r,a)}`}(this._dsn,e);this._transport=e.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:n})}}captureException(e,n,r){if(yi(e))return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log(Mi));let i=n&&n.event_id;return this._process(this.eventFromException(e,n).then(s=>this._captureEvent(s,n,r)).then(s=>{i=s})),i}captureMessage(e,n,r,i){let s=r&&r.event_id;const a=Vs(e)?this.eventFromMessage(String(e),n,r):this.eventFromException(e,r);return this._process(a.then(c=>this._captureEvent(c,r,i)).then(c=>{s=c})),s}captureEvent(e,n,r){if(n&&n.originalException&&yi(n.originalException))return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log(Mi));let i=n&&n.event_id;return this._process(this._captureEvent(e,n,r).then(s=>{i=s})),i}captureSession(e){this._isEnabled()?typeof e.release!="string"?(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),at(e,{init:!1})):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn("SDK not enabled, will not capture session.")}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){const n=this._transport;return n?this._isClientDoneProcessing(e).then(r=>n.flush(e).then(i=>r&&i)):He(!0)}close(e){return this.flush(e).then(n=>(this.getOptions().enabled=!1,n))}setupIntegrations(){this._isEnabled()&&!this._integrationsInitialized&&(this._integrations=function(e){const n={};return e.forEach(r=>{r&&Ti(r,n)}),n}(this._options.integrations),this._integrationsInitialized=!0)}getIntegrationById(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){Ti(e,this._integrations)}sendEvent(e,n={}){if(this._dsn){let r=Ra(e,this._dsn,this._options._metadata,this._options.tunnel);for(const s of n.attachments||[])r=wa(r,ka(s,this._options.transportOptions&&this._options.transportOptions.textEncoder));const i=this._sendEnvelope(r);i&&i.then(s=>this.emit("afterSendEvent",e,s),null)}}sendSession(e){if(this._dsn){const n=function(r,i,s,a){const c=Qs(s);return Et({sent_at:new Date().toISOString(),...c&&{sdk:c},...!!a&&{dsn:tn(i)}},["aggregates"in r?[{type:"sessions"},r]:[{type:"session"},r.toJSON()]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(n)}}recordDroppedEvent(e,n,r){if(this._options.sendClientReports){const i=`${e}:${n}`;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log(`Adding outcome: "${i}"`),this._outcomes[i]=this._outcomes[i]+1||1}}on(e,n){this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(n)}emit(e,...n){this._hooks[e]&&this._hooks[e].forEach(r=>r(...n))}_updateSessionFromEvent(e,n){let r=!1,i=!1;const s=n.exception&&n.exception.values;if(s){i=!0;for(const c of s){const l=c.mechanism;if(l&&l.handled===!1){r=!0;break}}}const a=e.status==="ok";(a&&e.errors===0||a&&r)&&(at(e,{...r&&{status:"crashed"},errors:e.errors||Number(i||r)}),this.captureSession(e))}_isClientDoneProcessing(e){return new K(n=>{let r=0;const i=setInterval(()=>{this._numProcessing==0?(clearInterval(i),n(!0)):(r+=1,e&&r>=e&&(clearInterval(i),n(!1)))},1)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._dsn!==void 0}_prepareEvent(e,n,r){const i=this.getOptions(),s=Object.keys(this._integrations);return!n.integrations&&s.length>0&&(n.integrations=s),Da(i,e,n,r).then(a=>{if(a===null)return a;const{propagationContext:c}=a.sdkProcessingMetadata||{};if(!(a.contexts&&a.contexts.trace)&&c){const{traceId:l,spanId:p,parentSpanId:h,dsc:f}=c;a.contexts={trace:{trace_id:l,span_id:p,parent_span_id:h},...a.contexts};const _=f||function(k,v,b){const T=v.getOptions(),{publicKey:M}=v.getDsn()||{},{segment:B}=b&&b.getUser()||{},L=hn({environment:T.environment||_r,release:T.release,user_segment:B,public_key:M,trace_id:k});return v.emit&&v.emit("createDsc",L),L}(l,this,r);a.sdkProcessingMetadata={dynamicSamplingContext:_,...a.sdkProcessingMetadata}}return a})}_captureEvent(e,n={},r){return this._processEvent(e,n,r).then(i=>i.event_id,i=>{if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){const s=i;s.logLevel==="log"?R.log(s.message):R.warn(s)}})}_processEvent(e,n,r){const i=this.getOptions(),{sampleRate:s}=i;if(!this._isEnabled())return nn(new le("SDK not enabled, will not capture event.","log"));const a=Pi(e),c=Oi(e),l=e.type||"error",p=`before send for type \`${l}\``;if(c&&typeof s=="number"&&Math.random()>s)return this.recordDroppedEvent("sample_rate","error",e),nn(new le(`Discarding event because it's not included in the random sample (sampling rate = ${s})`,"log"));const h=l==="replay_event"?"replay":l;return this._prepareEvent(e,n,r).then(f=>{if(f===null)throw this.recordDroppedEvent("event_processor",h,e),new le("An event processor returned `null`, will not send event.","log");if(n.data&&n.data.__sentry__===!0)return f;const _=function(k,v,b){const{beforeSend:T,beforeSendTransaction:M}=k;return Oi(v)&&T?T(v,b):Pi(v)&&M?M(v,b):v}(i,f,n);return function(k,v){const b=`${v} must return \`null\` or a valid event.`;if(mr(k))return k.then(T=>{if(!ot(T)&&T!==null)throw new le(b);return T},T=>{throw new le(`${v} rejected with ${T}`)});if(!ot(k)&&k!==null)throw new le(b);return k}(_,p)}).then(f=>{if(f===null)throw this.recordDroppedEvent("before_send",h,e),new le(`${p} returned \`null\`, will not send event.`,"log");const _=r&&r.getSession();!a&&_&&this._updateSessionFromEvent(_,f);const k=f.transaction_info;if(a&&k&&f.transaction!==e.transaction){const v="custom";f.transaction_info={...k,source:v}}return this.sendEvent(f,n),f}).then(null,f=>{throw f instanceof le?f:(this.captureException(f,{data:{__sentry__:!0},originalException:f}),new le(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
15
|
+
`),r}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){const e=this.getStackTop().scope,n=e.getSession();n&&function(r,i){let s={};r.status==="ok"&&(s={status:"exited"}),at(r,s)}(n),this._sendSessionUpdate(),e.setSession()}startSession(e){const{scope:n,client:r}=this.getStackTop(),{release:i,environment:s=_r}=r&&r.getOptions()||{},{userAgent:a}=ie.navigator||{},c=Ma({release:i,environment:s,user:n.getUser(),...a&&{userAgent:a},...e}),l=n.getSession&&n.getSession();return l&&l.status==="ok"&&at(l,{status:"exited"}),this.endSession(),n.setSession(c),c}shouldSendDefaultPii(){const e=this.getClient(),n=e&&e.getOptions();return!!(n&&n.sendDefaultPii)}_sendSessionUpdate(){const{scope:e,client:n}=this.getStackTop(),r=e.getSession();r&&n&&n.captureSession&&n.captureSession(r)}_withClient(e){const{scope:n,client:r}=this.getStackTop();r&&e(r,n)}_callExtensionMethod(e,...n){const r=rn().__SENTRY__;if(r&&r.extensions&&typeof r.extensions[e]=="function")return r.extensions[e].apply(this,n);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function rn(){return ie.__SENTRY__=ie.__SENTRY__||{extensions:{},hub:void 0},ie}function ki(t){const e=rn(),n=Yn(e);return to(e,t),n}function te(){const t=rn();if(t.__SENTRY__&&t.__SENTRY__.acs){const e=t.__SENTRY__.acs.getCurrentHub();if(e)return e}return function(e=rn()){n=e,n&&n.__SENTRY__&&n.__SENTRY__.hub&&!Yn(e).isOlderThan(eo)||to(e,new br);var n;return Yn(e)}(t)}function Yn(t){return gr("hub",()=>new br,t)}function to(t,e){return t?((t.__SENTRY__=t.__SENTRY__||{}).hub=e,!0):!1}const Pa="7";function Aa(t,e){return n={sentry_key:t.publicKey,sentry_version:Pa,...e&&{sentry_client:`${e.name}/${e.version}`}},Object.keys(n).map(r=>`${encodeURIComponent(r)}=${encodeURIComponent(n[r])}`).join("&");var n}function Ra(t,e,n,r){const i=Qs(n),s=t.type&&t.type!=="replay_event"?t.type:"event";(function(c,l){l&&(c.sdk=c.sdk||{},c.sdk.name=c.sdk.name||l.name,c.sdk.version=c.sdk.version||l.version,c.sdk.integrations=[...c.sdk.integrations||[],...l.integrations||[]],c.sdk.packages=[...c.sdk.packages||[],...l.packages||[]])})(t,n&&n.sdk);const a=function(c,l,p,h){const f=c.sdkProcessingMetadata&&c.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:c.event_id,sent_at:new Date().toISOString(),...l&&{sdk:l},...!!p&&{dsn:tn(h)},...f&&{trace:hn({...f})}}}(t,i,r,e);return delete t.sdkProcessingMetadata,Et(a,[[{type:s},t]])}const Ei=[];function Ti(t,e){e[t.name]=t,Ei.indexOf(t.name)===-1&&(t.setupOnce(Zs,te),Ei.push(t.name),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log(`Integration installed: ${t.name}`))}function Da(t,e,n,r){const{normalizeDepth:i=3,normalizeMaxBreadth:s=1e3}=t,a={...e,event_id:e.event_id||n.event_id||De(),timestamp:e.timestamp||pn()},c=n.integrations||t.integrations.map(h=>h.name);(function(h,f){const{environment:_,release:k,dist:v,maxValueLength:b=250}=f;"environment"in h||(h.environment="environment"in f?_:_r),h.release===void 0&&k!==void 0&&(h.release=k),h.dist===void 0&&v!==void 0&&(h.dist=v),h.message&&(h.message=et(h.message,b));const T=h.exception&&h.exception.values&&h.exception.values[0];T&&T.value&&(T.value=et(T.value,b));const M=h.request;M&&M.url&&(M.url=et(M.url,b))})(a,t),function(h,f){f.length>0&&(h.sdk=h.sdk||{},h.sdk.integrations=[...h.sdk.integrations||[],...f])}(a,c),e.type===void 0&&function(h,f){const _=ie._sentryDebugIds;if(!_)return;let k;const v=Ci.get(f);v?k=v:(k=new Map,Ci.set(f,k));const b=Object.keys(_).reduce((T,M)=>{let B;const L=k.get(M);L?B=L:(B=f(M),k.set(M,B));for(let ne=B.length-1;ne>=0;ne--){const Ne=B[ne];if(Ne.filename){T[Ne.filename]=_[M];break}}return T},{});try{h.exception.values.forEach(T=>{T.stacktrace.frames.forEach(M=>{M.filename&&(M.debug_id=b[M.filename])})})}catch{}}(a,t.stackParser);let l=r;n.captureContext&&(l=Je.clone(l).update(n.captureContext));let p=He(a);if(l){if(l.getAttachments){const h=[...n.attachments||[],...l.getAttachments()];h.length&&(n.attachments=h)}p=l.applyToEvent(a,n)}return p.then(h=>(h&&function(f){const _={};try{f.exception.values.forEach(v=>{v.stacktrace.frames.forEach(b=>{b.debug_id&&(b.abs_path?_[b.abs_path]=b.debug_id:b.filename&&(_[b.filename]=b.debug_id),delete b.debug_id)})})}catch{}if(Object.keys(_).length===0)return;f.debug_meta=f.debug_meta||{},f.debug_meta.images=f.debug_meta.images||[];const k=f.debug_meta.images;Object.keys(_).forEach(v=>{k.push({type:"sourcemap",code_file:v,debug_id:_[v]})})}(h),typeof i=="number"&&i>0?function(f,_,k){if(!f)return null;const v={...f,...f.breadcrumbs&&{breadcrumbs:f.breadcrumbs.map(b=>({...b,...b.data&&{data:Re(b.data,_,k)}}))},...f.user&&{user:Re(f.user,_,k)},...f.contexts&&{contexts:Re(f.contexts,_,k)},...f.extra&&{extra:Re(f.extra,_,k)}};return f.contexts&&f.contexts.trace&&v.contexts&&(v.contexts.trace=f.contexts.trace,f.contexts.trace.data&&(v.contexts.trace.data=Re(f.contexts.trace.data,_,k))),f.spans&&(v.spans=f.spans.map(b=>(b.data&&(b.data=Re(b.data,_,k)),b))),v}(h,i,s):h))}const Ci=new WeakMap,Mi="Not capturing exception because it's already been captured.";class qe{__init(){this._integrations={}}__init2(){this._integrationsInitialized=!1}__init3(){this._numProcessing=0}__init4(){this._outcomes={}}__init5(){this._hooks={}}constructor(e){if(qe.prototype.__init.call(this),qe.prototype.__init2.call(this),qe.prototype.__init3.call(this),qe.prototype.__init4.call(this),qe.prototype.__init5.call(this),this._options=e,e.dsn?this._dsn=ma(e.dsn):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn("No DSN provided, client will not do anything."),this._dsn){const n=function(r,i={}){const s=typeof i=="string"?i:i.tunnel,a=typeof i!="string"&&i._metadata?i._metadata.sdk:void 0;return s||`${function(c){return`${function(l){const p=l.protocol?`${l.protocol}:`:"",h=l.port?`:${l.port}`:"";return`${p}//${l.host}${h}${l.path?`/${l.path}`:""}/api/`}(c)}${c.projectId}/envelope/`}(r)}?${Aa(r,a)}`}(this._dsn,e);this._transport=e.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:n})}}captureException(e,n,r){if(yi(e))return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log(Mi));let i=n&&n.event_id;return this._process(this.eventFromException(e,n).then(s=>this._captureEvent(s,n,r)).then(s=>{i=s})),i}captureMessage(e,n,r,i){let s=r&&r.event_id;const a=Vs(e)?this.eventFromMessage(String(e),n,r):this.eventFromException(e,r);return this._process(a.then(c=>this._captureEvent(c,r,i)).then(c=>{s=c})),s}captureEvent(e,n,r){if(n&&n.originalException&&yi(n.originalException))return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log(Mi));let i=n&&n.event_id;return this._process(this._captureEvent(e,n,r).then(s=>{i=s})),i}captureSession(e){this._isEnabled()?typeof e.release!="string"?(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),at(e,{init:!1})):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn("SDK not enabled, will not capture session.")}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){const n=this._transport;return n?this._isClientDoneProcessing(e).then(r=>n.flush(e).then(i=>r&&i)):He(!0)}close(e){return this.flush(e).then(n=>(this.getOptions().enabled=!1,n))}setupIntegrations(){this._isEnabled()&&!this._integrationsInitialized&&(this._integrations=function(e){const n={};return e.forEach(r=>{r&&Ti(r,n)}),n}(this._options.integrations),this._integrationsInitialized=!0)}getIntegrationById(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){Ti(e,this._integrations)}sendEvent(e,n={}){if(this._dsn){let r=Ra(e,this._dsn,this._options._metadata,this._options.tunnel);for(const s of n.attachments||[])r=wa(r,ka(s,this._options.transportOptions&&this._options.transportOptions.textEncoder));const i=this._sendEnvelope(r);i&&i.then(s=>this.emit("afterSendEvent",e,s),null)}}sendSession(e){if(this._dsn){const n=function(r,i,s,a){const c=Qs(s);return Et({sent_at:new Date().toISOString(),...c&&{sdk:c},...!!a&&{dsn:tn(i)}},["aggregates"in r?[{type:"sessions"},r]:[{type:"session"},r.toJSON()]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(n)}}recordDroppedEvent(e,n,r){if(this._options.sendClientReports){const i=`${e}:${n}`;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log(`Adding outcome: "${i}"`),this._outcomes[i]=this._outcomes[i]+1||1}}on(e,n){this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(n)}emit(e,...n){this._hooks[e]&&this._hooks[e].forEach(r=>r(...n))}_updateSessionFromEvent(e,n){let r=!1,i=!1;const s=n.exception&&n.exception.values;if(s){i=!0;for(const c of s){const l=c.mechanism;if(l&&l.handled===!1){r=!0;break}}}const a=e.status==="ok";(a&&e.errors===0||a&&r)&&(at(e,{...r&&{status:"crashed"},errors:e.errors||Number(i||r)}),this.captureSession(e))}_isClientDoneProcessing(e){return new K(n=>{let r=0;const i=setInterval(()=>{this._numProcessing==0?(clearInterval(i),n(!0)):(r+=1,e&&r>=e&&(clearInterval(i),n(!1)))},1)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._dsn!==void 0}_prepareEvent(e,n,r){const i=this.getOptions(),s=Object.keys(this._integrations);return!n.integrations&&s.length>0&&(n.integrations=s),Da(i,e,n,r).then(a=>{if(a===null)return a;const{propagationContext:c}=a.sdkProcessingMetadata||{};if(!(a.contexts&&a.contexts.trace)&&c){const{traceId:l,spanId:p,parentSpanId:h,dsc:f}=c;a.contexts={trace:{trace_id:l,span_id:p,parent_span_id:h},...a.contexts};const _=f||function(k,v,b){const T=v.getOptions(),{publicKey:M}=v.getDsn()||{},{segment:B}=b&&b.getUser()||{},L=hn({environment:T.environment||_r,release:T.release,user_segment:B,public_key:M,trace_id:k});return v.emit&&v.emit("createDsc",L),L}(l,this,r);a.sdkProcessingMetadata={dynamicSamplingContext:_,...a.sdkProcessingMetadata}}return a})}_captureEvent(e,n={},r){return this._processEvent(e,n,r).then(i=>i.event_id,i=>{if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){const s=i;s.logLevel==="log"?R.log(s.message):R.warn(s)}})}_processEvent(e,n,r){const i=this.getOptions(),{sampleRate:s}=i;if(!this._isEnabled())return nn(new le("SDK not enabled, will not capture event.","log"));const a=Pi(e),c=Oi(e),l=e.type||"error",p=`before send for type \`${l}\``;if(c&&typeof s=="number"&&Math.random()>s)return this.recordDroppedEvent("sample_rate","error",e),nn(new le(`Discarding event because it's not included in the random sample (sampling rate = ${s})`,"log"));const h=l==="replay_event"?"replay":l;return this._prepareEvent(e,n,r).then(f=>{if(f===null)throw this.recordDroppedEvent("event_processor",h,e),new le("An event processor returned `null`, will not send event.","log");if(n.data&&n.data.__sentry__===!0)return f;const _=function(k,v,b){const{beforeSend:T,beforeSendTransaction:M}=k;return Oi(v)&&T?T(v,b):Pi(v)&&M?M(v,b):v}(i,f,n);return function(k,v){const b=`${v} must return \`null\` or a valid event.`;if(mr(k))return k.then(T=>{if(!ot(T)&&T!==null)throw new le(b);return T},T=>{throw new le(`${v} rejected with ${T}`)});if(!ot(k)&&k!==null)throw new le(b);return k}(_,p)}).then(f=>{if(f===null)throw this.recordDroppedEvent("before_send",h,e),new le(`${p} returned \`null\`, will not send event.`,"log");const _=r&&r.getSession();!a&&_&&this._updateSessionFromEvent(_,f);const k=f.transaction_info;if(a&&k&&f.transaction!==e.transaction){const v="custom";f.transaction_info={...k,source:v}}return this.sendEvent(f,n),f}).then(null,f=>{throw f instanceof le?f:(this.captureException(f,{data:{__sentry__:!0},originalException:f}),new le(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
16
16
|
Reason: ${f}`))})}_process(e){this._numProcessing++,e.then(n=>(this._numProcessing--,n),n=>(this._numProcessing--,n))}_sendEnvelope(e){if(this._transport&&this._dsn)return this.emit("beforeEnvelope",e),this._transport.send(e).then(null,n=>{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.error("Error while sending event:",n)});(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.error("Transport disabled")}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.keys(e).map(n=>{const[r,i]=n.split(":");return{reason:r,category:i,quantity:e[n]}})}}function Oi(t){return t.type===void 0}function Pi(t){return t.type==="transaction"}const xa=30;function La(t,e,n=_a(t.bufferSize||xa)){let r={};function i(s){const a=[];if(bi(s,(p,h)=>{const f=wi(h);if(function(_,k,v=Date.now()){return function(b,T){return b[T]||b.all||0}(_,k)>v}(r,f)){const _=Ai(p,h);t.recordDroppedEvent("ratelimit_backoff",f,_)}else a.push(p)}),a.length===0)return He();const c=Et(s[0],a),l=p=>{bi(c,(h,f)=>{const _=Ai(h,f);t.recordDroppedEvent(p,wi(f),_)})};return n.add(()=>e({body:Sa(c,t.textEncoder)}).then(p=>(p.statusCode!==void 0&&(p.statusCode<200||p.statusCode>=300)&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn(`Sentry responded with status code ${p.statusCode} to sent event.`),r=Ca(r,p),p),p=>{throw l("network_error"),p})).then(p=>p,p=>{if(p instanceof le)return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.error("Skipped sending event because buffer is full."),l("queue_overflow"),He();throw p})}return i.__sentry__baseTransport__=!0,{send:i,flush:s=>n.drain(s)}}function Ai(t,e){if(e==="event"||e==="transaction")return Array.isArray(t)?t[1]:void 0}const Ri="7.60.1";let Di;class Tt{constructor(){Tt.prototype.__init.call(this)}static __initStatic(){this.id="FunctionToString"}__init(){this.name=Tt.id}setupOnce(){Di=Function.prototype.toString;try{Function.prototype.toString=function(...e){const n=yr(this)||this;return Di.apply(n,e)}}catch{}}}Tt.__initStatic();const Na=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],ja=[/^.*healthcheck.*$/,/^.*healthy.*$/,/^.*live.*$/,/^.*ready.*$/,/^.*heartbeat.*$/,/^.*\/health$/,/^.*\/healthz$/];class tt{static __initStatic(){this.id="InboundFilters"}__init(){this.name=tt.id}constructor(e={}){this._options=e,tt.prototype.__init.call(this)}setupOnce(e,n){const r=i=>{const s=n();if(s){const a=s.getIntegration(tt);if(a){const c=s.getClient(),l=c?c.getOptions():{},p=function(h={},f={}){return{allowUrls:[...h.allowUrls||[],...f.allowUrls||[]],denyUrls:[...h.denyUrls||[],...f.denyUrls||[]],ignoreErrors:[...h.ignoreErrors||[],...f.ignoreErrors||[],...h.disableErrorDefaults?[]:Na],ignoreTransactions:[...h.ignoreTransactions||[],...f.ignoreTransactions||[],...h.disableTransactionDefaults?[]:ja],ignoreInternal:h.ignoreInternal===void 0||h.ignoreInternal}}(a._options,l);return function(h,f){return f.ignoreInternal&&function(_){try{return _.exception.values[0].type==="SentryError"}catch{}return!1}(h)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn(`Event dropped due to being internal Sentry Error.
|
|
17
17
|
Event: ${Ae(h)}`),!0):function(_,k){return _.type||!k||!k.length?!1:function(v){if(v.message)return[v.message];if(v.exception){const{values:b}=v.exception;try{const{type:T="",value:M=""}=b&&b[b.length-1]||{};return[`${M}`,`${T}: ${M}`]}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.error(`Cannot extract message for event ${Ae(v)}`),[]}}return[]}(_).some(v=>xt(v,k))}(h,f.ignoreErrors)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
18
18
|
Event: ${Ae(h)}`),!0):function(_,k){if(_.type!=="transaction"||!k||!k.length)return!1;const v=_.transaction;return!!v&&xt(v,k)}(h,f.ignoreTransactions)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
@@ -20,15 +20,15 @@ Event: ${Ae(h)}`),!0):function(_,k){if(!k||!k.length)return!1;const v=Ut(_);retu
|
|
|
20
20
|
Event: ${Ae(h)}.
|
|
21
21
|
Url: ${Ut(h)}`),!0):function(_,k){if(!k||!k.length)return!0;const v=Ut(_);return!v||xt(v,k)}(h,f.allowUrls)?!1:((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
22
22
|
Event: ${Ae(h)}.
|
|
23
|
-
Url: ${Ut(h)}`),!0)}(i,p)?null:i}}return i};r.id=this.name,e(r)}}function Ut(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch{}return e?function(n=[]){for(let r=n.length-1;r>=0;r--){const i=n[r];if(i&&i.filename!=="<anonymous>"&&i.filename!=="[native code]")return i.filename||null}return null}(e):null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.error(`Cannot extract url for event ${Ae(t)}`),null}}tt.__initStatic();var Ia=Object.freeze({__proto__:null,FunctionToString:Tt,InboundFilters:tt});const F=ie;let Wn=0;function no(){return Wn>0}function ct(t,e={},n){if(typeof t!="function")return t;try{const i=t.__sentry_wrapped__;if(i)return i;if(yr(t))return t}catch{return t}const r=function(){const i=Array.prototype.slice.call(arguments);try{n&&typeof n=="function"&&n.apply(this,arguments);const a=i.map(c=>ct(c,e));return t.apply(this,a)}catch(a){throw Wn++,setTimeout(()=>{Wn--}),s=c=>{var l,p;c.addEventProcessor(h=>(e.mechanism&&($n(h,void 0),kt(h,e.mechanism)),h.extra={...h.extra,arguments:i},h)),l=a,ee().captureException(l,{captureContext:p})},ee().withScope(s),a}var s};try{for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}catch{}Gs(r,t),vr(t,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get:()=>t.name})}catch{}return r}function ro(t,e){const n=wr(t,e),r={type:e&&e.name,value:Fa(e)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function Tn(t,e){return{exception:{values:[ro(t,e)]}}}function wr(t,e){const n=e.stacktrace||e.stack||"",r=function(i){if(i){if(typeof i.framesToPop=="number")return i.framesToPop;if(Ba.test(i.message))return 1}return 0}(e);try{return t(n,r)}catch{}return[]}const Ba=/Minified React error #\d+;/i;function Fa(t){const e=t&&t.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:e:"No error message"}function Sr(t,e,n,r,i){let s;if(fr(e)&&e.error)return Tn(t,e.error);if(oi(e)||lt(e,"DOMException")){const a=e;if("stack"in e)s=Tn(t,e);else{const c=a.name||(oi(a)?"DOMError":"DOMException"),l=a.message?`${c}: ${a.message}`:c;s=Kn(t,l,n,r),$n(s,l)}return"code"in a&&(s.tags={...s.tags,"DOMException.code":`${a.code}`}),s}return Js(e)?Tn(t,e):ot(e)||Zt(e)?(s=function(a,c,l,p){const h=ee().getClient(),f=h&&h.getOptions().normalizeDepth,_={exception:{values:[{type:Zt(c)?c.constructor.name:p?"UnhandledRejection":"Error",value:Ua(c,{isUnhandledRejection:p})}]},extra:{__serialized__:Ys(c,f)}};if(l){const k=wr(a,l);k.length&&(_.exception.values[0].stacktrace={frames:k})}return _}(t,e,n,i),kt(s,{synthetic:!0}),s):(s=Kn(t,e,n,r),$n(s,`${e}`),kt(s,{synthetic:!0}),s)}function Kn(t,e,n,r){const i={message:e};if(r&&n){const s=wr(t,n);s.length&&(i.exception={values:[{value:e,stacktrace:{frames:s}}]})}return i}function Ua(t,{isUnhandledRejection:e}){const n=function(i,s=40){const a=Object.keys(zs(i));if(a.sort(),!a.length)return"[object has no keys]";if(a[0].length>=s)return et(a[0],s);for(let c=a.length;c>0;c--){const l=a.slice(0,c).join(", ");if(!(l.length>s))return c===a.length?l:et(l,s)}return""}(t),r=e?"promise rejection":"exception";return fr(t)?`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``:Zt(t)?`Event \`${function(i){try{const s=Object.getPrototypeOf(i);return s?s.constructor.name:void 0}catch{}}(t)}\` (type=${t.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}const xi=1024,io="Breadcrumbs";class Ct{static __initStatic(){this.id=io}__init(){this.name=Ct.id}constructor(e){Ct.prototype.__init.call(this),this.options={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e}}setupOnce(){this.options.console&&Ue("console",qa),this.options.dom&&Ue("dom",function(e){function n(r){let i,s=typeof e=="object"?e.serializeAttribute:void 0,a=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;a&&a>xi&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${a} was configured. Sentry will use 1024 instead.`),a=xi),typeof s=="string"&&(s=[s]);try{const c=r.event;i=function(l){return!!l&&!!l.target}(c)?Un(c.target,{keyAttrs:s,maxStringLength:a}):Un(c,{keyAttrs:s,maxStringLength:a})}catch{i="<unknown>"}i.length!==0&&ee().addBreadcrumb({category:`ui.${r.name}`,message:i},{event:r.event,name:r.name,global:r.global})}return n}(this.options.dom)),this.options.xhr&&Ue("xhr",Ja),this.options.fetch&&Ue("fetch",Va),this.options.history&&Ue("history",$a)}addSentryBreadcrumb(e){this.options.sentry&&ee().addBreadcrumb({category:"sentry."+(e.type==="transaction"?"transaction":"event"),event_id:e.event_id,level:e.level,message:Ae(e)},{event:e})}}function qa(t){for(let r=0;r<t.args.length;r++)if(t.args[r]==="ref=Ref<"){t.args[r+1]="viewRef";break}const e={category:"console",data:{arguments:t.args,logger:"console"},level:(n=t.level,n==="warn"?"warning":ba.includes(n)?n:"log"),message:ai(t.args," ")};var n;if(t.level==="assert"){if(t.args[0]!==!1)return;e.message=`Assertion failed: ${ai(t.args.slice(1)," ")||"console.assert"}`,e.data.arguments=t.args.slice(1)}ee().addBreadcrumb(e,{input:t.args,level:t.level})}function Ja(t){const{startTimestamp:e,endTimestamp:n}=t,r=t.xhr[vt];if(!e||!n||!r)return;const{method:i,url:s,status_code:a,body:c}=r,l={method:i,url:s,status_code:a},p={xhr:t.xhr,input:c,startTimestamp:e,endTimestamp:n};ee().addBreadcrumb({category:"xhr",data:l,type:"http"},p)}function Va(t){const{startTimestamp:e,endTimestamp:n}=t;if(n&&(!t.fetchData.url.match(/sentry_key/)||t.fetchData.method!=="POST"))if(t.error){const r=t.fetchData,i={data:t.error,input:t.args,startTimestamp:e,endTimestamp:n};ee().addBreadcrumb({category:"fetch",data:r,level:"error",type:"http"},i)}else{const r={...t.fetchData,status_code:t.response&&t.response.status},i={input:t.args,response:t.response,startTimestamp:e,endTimestamp:n};ee().addBreadcrumb({category:"fetch",data:r,type:"http"},i)}}function $a(t){let e=t.from,n=t.to;const r=kn(F.location.href);let i=kn(e);const s=kn(n);i.path||(i=r),r.protocol===s.protocol&&r.host===s.host&&(n=s.relative),r.protocol===i.protocol&&r.host===i.host&&(e=i.relative),ee().addBreadcrumb({category:"navigation",data:{from:e,to:n}})}Ct.__initStatic();class Ga extends qe{constructor(e){const n=F.SENTRY_SDK_SOURCE||"npm";e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:`${n}:@sentry/browser`,version:Ri}],version:Ri},super(e),e.sendClientReports&&F.document&&F.document.addEventListener("visibilitychange",()=>{F.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,n){return function(r,i,s,a){const c=Sr(r,i,s&&s.syntheticException||void 0,a);return kt(c),c.level="error",s&&s.event_id&&(c.event_id=s.event_id),He(c)}(this._options.stackParser,e,n,this._options.attachStacktrace)}eventFromMessage(e,n="info",r){return function(i,s,a="info",c,l){const p=Kn(i,s,c&&c.syntheticException||void 0,l);return p.level=a,c&&c.event_id&&(p.event_id=c.event_id),He(p)}(this._options.stackParser,e,n,r,this._options.attachStacktrace)}sendEvent(e,n){const r=this.getIntegrationById(io);r&&r.addSentryBreadcrumb&&r.addSentryBreadcrumb(e),super.sendEvent(e,n)}captureUserFeedback(e){if(!this._isEnabled())return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn("SDK not enabled, will not capture user feedback."));const n=function(r,{metadata:i,tunnel:s,dsn:a}){const c={event_id:r.event_id,sent_at:new Date().toISOString(),...i&&i.sdk&&{sdk:{name:i.sdk.name,version:i.sdk.version}},...!!s&&!!a&&{dsn:tn(a)}};return Et(c,[function(p){return[{type:"user_report"},p]}(r)])}(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(n)}_prepareEvent(e,n,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,n,r)}_flushOutcomes(){const e=this._clearOutcomes();if(e.length===0)return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log("No outcomes to send"));if(!this._dsn)return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log("No dsn provided, will not send outcomes"));(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log("Sending outcomes:",e);const n=(r=e,Et((i=this._options.tunnel&&tn(this._dsn))?{dsn:i}:{},[[{type:"client_report"},{timestamp:s||pn(),discarded_events:r}]]));var r,i,s;this._sendEnvelope(n)}}let ft;function za(t,e=function(){if(ft)return ft;if(Jn(F.fetch))return ft=F.fetch.bind(F);const n=F.document;let r=F.fetch;if(n&&typeof n.createElement=="function")try{const i=n.createElement("iframe");i.hidden=!0,n.head.appendChild(i);const s=i.contentWindow;s&&s.fetch&&(r=s.fetch),n.head.removeChild(i)}catch(i){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",i)}return ft=r.bind(F)}()){let n=0,r=0;return La(t,function(i){const s=i.body.length;n+=s,r++;const a={body:i.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:n<=6e4&&r<15,...t.fetchOptions};try{return e(t.url,a).then(c=>(n-=s,r--,{statusCode:c.status,headers:{"x-sentry-rate-limits":c.headers.get("X-Sentry-Rate-Limits"),"retry-after":c.headers.get("Retry-After")}}))}catch(c){return ft=void 0,n-=s,r--,nn(c)}})}class xe{static __initStatic(){this.id="GlobalHandlers"}__init(){this.name=xe.id}__init2(){this._installFunc={onerror:Ha,onunhandledrejection:Ya}}constructor(e){xe.prototype.__init.call(this),xe.prototype.__init2.call(this),this._options={onerror:!0,onunhandledrejection:!0,...e}}setupOnce(){Error.stackTraceLimit=50;const e=this._options;for(const r in e){const i=this._installFunc[r];i&&e[r]&&(n=r,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log(`Global Handler attached: ${n}`),i(),this._installFunc[r]=void 0)}var n}}function Ha(){Ue("error",t=>{const[e,n,r]=oo();if(!e.getIntegration(xe))return;const{msg:i,url:s,line:a,column:c,error:l}=t;if(no()||l&&l.__sentry_own_request__)return;const p=l===void 0&&Ge(i)?function(h,f,_,k){const v=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let b=fr(h)?h.message:h,T="Error";const M=b.match(v);return M&&(T=M[1],b=M[2]),Li({exception:{values:[{type:T,value:b}]}},f,_,k)}(i,s,a,c):Li(Sr(n,l||i,void 0,r,!1),s,a,c);p.level="error",so(e,l,p,"onerror")})}function Ya(){Ue("unhandledrejection",t=>{const[e,n,r]=oo();if(!e.getIntegration(xe))return;let i=t;try{"reason"in t?i=t.reason:"detail"in t&&"reason"in t.detail&&(i=t.detail.reason)}catch{}if(no()||i&&i.__sentry_own_request__)return!0;const s=Vs(i)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(i)}`}]}}:Sr(n,i,void 0,r,!0);s.level="error",so(e,i,s,"onunhandledrejection")})}function Li(t,e,n,r){const i=t.exception=t.exception||{},s=i.values=i.values||[],a=s[0]=s[0]||{},c=a.stacktrace=a.stacktrace||{},l=c.frames=c.frames||[],p=isNaN(parseInt(r,10))?void 0:r,h=isNaN(parseInt(n,10))?void 0:n,f=Ge(e)&&e.length>0?e:function(){try{return da.document.location.href}catch{return""}}();return l.length===0&&l.push({colno:p,filename:f,function:"?",in_app:!0,lineno:h}),t}function so(t,e,n,r){kt(n,{handled:!1,type:r}),t.captureEvent(n,{originalException:e})}function oo(){const t=ee(),e=t.getClient(),n=e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[t,n.stackParser,n.attachStacktrace]}xe.__initStatic();const Wa=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"];class Mt{static __initStatic(){this.id="TryCatch"}__init(){this.name=Mt.id}constructor(e){Mt.prototype.__init.call(this),this._options={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e}}setupOnce(){this._options.setTimeout&&z(F,"setTimeout",Ni),this._options.setInterval&&z(F,"setInterval",Ni),this._options.requestAnimationFrame&&z(F,"requestAnimationFrame",Ka),this._options.XMLHttpRequest&&"XMLHttpRequest"in F&&z(XMLHttpRequest.prototype,"send",Qa);const e=this._options.eventTarget;e&&(Array.isArray(e)?e:Wa).forEach(Xa)}}function Ni(t){return function(...e){const n=e[0];return e[0]=ct(n,{mechanism:{data:{function:Le(t)},handled:!0,type:"instrument"}}),t.apply(this,e)}}function Ka(t){return function(e){return t.apply(this,[ct(e,{mechanism:{data:{function:"requestAnimationFrame",handler:Le(t)},handled:!0,type:"instrument"}})])}}function Qa(t){return function(...e){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(r=>{r in n&&typeof n[r]=="function"&&z(n,r,function(i){const s={mechanism:{data:{function:r,handler:Le(i)},handled:!0,type:"instrument"}},a=yr(i);return a&&(s.mechanism.data.handler=Le(a)),ct(i,s)})}),t.apply(this,e)}}function Xa(t){const e=F,n=e[t]&&e[t].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(z(n,"addEventListener",function(r){return function(i,s,a){try{typeof s.handleEvent=="function"&&(s.handleEvent=ct(s.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Le(s),target:t},handled:!0,type:"instrument"}}))}catch{}return r.apply(this,[i,ct(s,{mechanism:{data:{function:"addEventListener",handler:Le(s),target:t},handled:!0,type:"instrument"}}),a])}}),z(n,"removeEventListener",function(r){return function(i,s,a){const c=s;try{const l=c&&c.__sentry_wrapped__;l&&r.call(this,i,l,a)}catch{}return r.call(this,i,c,a)}}))}Mt.__initStatic();class nt{static __initStatic(){this.id="LinkedErrors"}__init(){this.name=nt.id}constructor(e={}){nt.prototype.__init.call(this),this._key=e.key||"cause",this._limit=e.limit||5}setupOnce(e,n){e((r,i)=>{const s=n(),a=s.getClient(),c=s.getIntegration(nt);if(!a||!c)return r;const l=a.getOptions();return ua(ro,l.stackParser,l.maxValueLength,c._key,c._limit,r,i),r})}}nt.__initStatic();class rt{constructor(){rt.prototype.__init.call(this)}static __initStatic(){this.id="HttpContext"}__init(){this.name=rt.id}setupOnce(){Zs(e=>{if(ee().getIntegration(rt)){if(!F.navigator&&!F.location&&!F.document)return e;const n=e.request&&e.request.url||F.location&&F.location.href,{referrer:r}=F.document||{},{userAgent:i}=F.navigator||{},s={...e.request&&e.request.headers,...r&&{Referer:r},...i&&{"User-Agent":i}},a={...e.request,...n&&{url:n},headers:s};return{...e,request:a}}return e})}}rt.__initStatic();class it{constructor(){it.prototype.__init.call(this)}static __initStatic(){this.id="Dedupe"}__init(){this.name=it.id}setupOnce(e,n){const r=i=>{if(i.type)return i;const s=n().getIntegration(it);if(s){try{if(function(a,c){return c?!!(function(l,p){const h=l.message,f=p.message;return!(!h&&!f||h&&!f||!h&&f||h!==f||!Ii(l,p)||!ji(l,p))}(a,c)||function(l,p){const h=Bi(p),f=Bi(l);return!(!h||!f||h.type!==f.type||h.value!==f.value||!Ii(l,p)||!ji(l,p))}(a,c)):!1}(i,s._previousEvent))return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{return s._previousEvent=i}return s._previousEvent=i}return i};r.id=this.name,e(r)}}function ji(t,e){let n=Fi(t),r=Fi(e);if(!n&&!r)return!0;if(n&&!r||!n&&r||r.length!==n.length)return!1;for(let i=0;i<r.length;i++){const s=r[i],a=n[i];if(s.filename!==a.filename||s.lineno!==a.lineno||s.colno!==a.colno||s.function!==a.function)return!1}return!0}function Ii(t,e){let n=t.fingerprint,r=e.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return n.join("")===r.join("")}catch{return!1}}function Bi(t){return t.exception&&t.exception.values&&t.exception.values[0]}function Fi(t){const e=t.exception;if(e)try{return e.values[0].stacktrace.frames}catch{return}}it.__initStatic();var Za=Object.freeze({__proto__:null,Breadcrumbs:Ct,Dedupe:it,GlobalHandlers:xe,HttpContext:rt,LinkedErrors:nt,TryCatch:Mt});let ao={};F.Sentry&&F.Sentry.Integrations&&(ao=F.Sentry.Integrations);const Ui={...ao,...Ia,...Za};var qi="new",Ji="loading",Vi="loaded",Qn="joining-meeting",Qe="joined-meeting",Ie="left-meeting",Ce="error",Cn="unknown",ec="full",tc="base",nc="*",rc="iframe-ready-for-launch-config",ic="iframe-launch-config",sc="theme-updated",oc="loading",ac="load-attempt-failed",$i="loaded",cc="started-camera",lc="camera-error",uc="joining-meeting",dc="joined-meeting",hc="left-meeting",pc="participant-joined",fc="participant-updated",mc="participant-left",gc="participant-counts-updated",vc="access-state-updated",yc="meeting-session-summary-updated",_c="meeting-session-state-updated",bc="waiting-participant-added",wc="waiting-participant-updated",Sc="waiting-participant-removed",kc="track-started",Ec="track-stopped",Tc="transcription-started",Cc="transcription-stopped",Mc="transcription-error",Gi="recording-started",zi="recording-stopped",Oc="recording-stats",Pc="recording-error",Ac="recording-upload-completed",Rc="recording-data",Dc="app-message",xc="transcription-message",Lc="remote-media-player-started",Nc="remote-media-player-updated",jc="remote-media-player-stopped",Ic="local-screen-share-started",Bc="local-screen-share-stopped",Fc="local-screen-share-canceled",Uc="active-speaker-change",qc="active-speaker-mode-change",Jc="network-quality-change",Vc="network-connection",$c="cpu-load-change",Gc="face-counts-updated",qt="fullscreen",Jt="exited-fullscreen",zc="live-streaming-started",Hc="live-streaming-updated",Yc="live-streaming-stopped",Wc="live-streaming-error",Kc="lang-updated",Qc="receive-settings-updated",Xc="input-settings-updated",Hi="nonfatal-error",Yi="error",Wi=102400,Mn="iframe-call-message",Ki="local-screen-start",Qi="daily-method-update-live-streaming-endpoints",Vt="transmit-log",yt="daily-custom-track",Yt={NONE:"none",BGBLUR:"background-blur",BGIMAGE:"background-image",FACE_DETECTION:"face-detection"},co={NONE:"none",NOISE_CANCELLATION:"noise-cancellation"},Xn={PLAY:"play",PAUSE:"pause"},Xi=10,On=["jpg","png","jpeg"],Zc="add-endpoints",el="remove-endpoints",Zi="sip-call-transfer";function he(){return!N()&&typeof window<"u"&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:""}function N(){return typeof navigator<"u"&&navigator.product&&navigator.product==="ReactNative"}function lo(){return navigator&&navigator.mediaDevices&&navigator.mediaDevices.getUserMedia}function tl(){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}(Ye(),er())||N())}function es(){if(N()||!document)return!1;var t=document.createElement("iframe");return!!t.requestFullscreen||!!t.webkitRequestFullscreen}var nl=function(){try{var t=document.createElement("canvas"),e=t.getContext("webgl2")!=null;return t.remove(),e}catch{return!1}}();function uo(){var t=arguments.length>0&&arguments[0]!==void 0&&arguments[0];return!N()&&!!nl&&(t?function(){return Zn()?!1:["Chrome","Firefox"].includes(Ye())}():function(){if(Zn())return!1;var e=Ye();if(e==="Safari"){var n=Er();if(n.major<15||n.major===15&&n.minor<4)return!1}return e==="Chrome"?kr().major>=77:e==="Firefox"?Tr().major>=97:["Chrome","Firefox","Safari"].includes(e)}())}var rl=["Chrome","Firefox"];function ho(){return!N()&&!Zn()&&typeof AudioWorkletNode<"u"&&rl.includes(Ye())}function ts(){return lo()&&!function(){var t,e=Ye();if(!he())return!0;switch(e){case"Chrome":return(t=kr()).major&&t.major>0&&t.major<75;case"Firefox":return(t=Tr()).major<91;case"Safari":return(t=Er()).major<13||t.major===13&&t.minor<1;default:return!0}}()}function Zn(){var t,e,n=he(),r=n.match(/Mac/)&&(!N()&&typeof window<"u"&&(t=window)!==null&&t!==void 0&&(e=t.navigator)!==null&&e!==void 0&&e.maxTouchPoints?window.navigator.maxTouchPoints:0)>=5;return!!(n.match(/Mobi/)||n.match(/Android/)||r)||!!he().match(/DailyAnd\//)||void 0}function Ye(){if(typeof window<"u"){var t=he();return po()?"Safari":t.indexOf("Edge")>-1?"Edge":t.match(/Chrome\//)?"Chrome":t.indexOf("Safari")>-1?"Safari":t.indexOf("Firefox")>-1?"Firefox":t.indexOf("MSIE")>-1||t.indexOf(".NET")>-1?"IE":"Unknown Browser"}}function er(){switch(Ye()){case"Chrome":return kr();case"Safari":return Er();case"Firefox":return Tr();case"Edge":return function(){var t=0,e=0;if(typeof window<"u"){var n=he().match(/Edge\/(\d+).(\d+)/);if(n)try{t=parseInt(n[1]),e=parseInt(n[2])}catch{}}return{major:t,minor:e}}()}}function kr(){var t=0,e=0,n=0,r=0,i=!1;if(typeof window<"u"){var s=he(),a=s.match(/Chrome\/(\d+).(\d+).(\d+).(\d+)/);if(a)try{t=parseInt(a[1]),e=parseInt(a[2]),n=parseInt(a[3]),r=parseInt(a[4]),i=s.indexOf("OPR/")>-1}catch{}}return{major:t,minor:e,build:n,patch:r,opera:i}}function po(){return!!he().match(/iPad|iPhone|iPod/i)&&lo()}function Er(){var t=0,e=0,n=0;if(typeof window<"u"){var r=he().match(/Version\/(\d+).(\d+)(.(\d+))?/);if(r)try{t=parseInt(r[1]),e=parseInt(r[2]),n=parseInt(r[4])}catch{}else po()&&(t=14,e=0,n=3)}return{major:t,minor:e,point:n}}function Tr(){var t=0,e=0;if(typeof window<"u"){var n=he().match(/Firefox\/(\d+).(\d+)/);if(n)try{t=parseInt(n[1]),e=parseInt(n[2])}catch{}}return{major:t,minor:e}}var fo=function(){function t(){pe(this,t)}return fe(t,[{key:"addListenerForMessagesFromCallMachine",value:function(e,n,r){pt()}},{key:"addListenerForMessagesFromDailyJs",value:function(e,n,r){pt()}},{key:"sendMessageToCallMachine",value:function(e,n,r,i){pt()}},{key:"sendMessageToDailyJs",value:function(e,n){pt()}},{key:"removeListener",value:function(e){pt()}}]),t}();function ns(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Pn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ns(Object(n),!0).forEach(function(r){Pe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ns(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function il(t){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var n,r=de(t);if(e){var i=de(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return un(this,n)}}var sl=function(t){ln(n,fo);var e=il(n);function n(){var r;return pe(this,n),(r=e.call(this))._wrappedListeners={},r._messageCallbacks={},r}return fe(n,[{key:"addListenerForMessagesFromCallMachine",value:function(r,i,s){var a=this,c=function(l){if(l.data&&l.data.what==="iframe-call-message"&&(!l.data.callClientId||l.data.callClientId===i)&&(!l.data.from||l.data.from!=="module")){var p=Pn({},l.data);if(delete p.from,p.callbackStamp&&a._messageCallbacks[p.callbackStamp]){var h=p.callbackStamp;a._messageCallbacks[h].call(s,p),delete a._messageCallbacks[h]}delete p.what,delete p.callbackStamp,r.call(s,p)}};this._wrappedListeners[r]=c,window.addEventListener("message",c)}},{key:"addListenerForMessagesFromDailyJs",value:function(r,i,s){var a=function(c){var l;if(!(!c.data||c.data.what!==Mn||!c.data.action||c.data.from&&c.data.from!=="module"||c.data.callClientId&&i&&c.data.callClientId!==i||c!=null&&(l=c.data)!==null&&l!==void 0&&l.callFrameId)){var p=c.data;r.call(s,p)}};this._wrappedListeners[r]=a,window.addEventListener("message",a)}},{key:"sendMessageToCallMachine",value:function(r,i,s,a){if(!a)throw new Error("undefined callClientId. Are you trying to use a DailyCall instance previously destroyed?");var c=Pn({},r);if(c.what=Mn,c.from="module",c.callClientId=a,i){var l=dn();this._messageCallbacks[l]=i,c.callbackStamp=l}var p=s?s.contentWindow:window,h=this._callMachineTargetOrigin(s);h&&p.postMessage(c,h)}},{key:"sendMessageToDailyJs",value:function(r,i){r.what=Mn,r.callClientId=i,r.from="embedded",window.postMessage(r,this._targetOriginFromWindowLocation())}},{key:"removeListener",value:function(r){var i=this._wrappedListeners[r];i&&(window.removeEventListener("message",i),delete this._wrappedListeners[r])}},{key:"forwardPackagedMessageToCallMachine",value:function(r,i,s){var a=Pn({},r);a.callClientId=s;var c=i?i.contentWindow:window,l=this._callMachineTargetOrigin(i);l&&c.postMessage(a,l)}},{key:"addListenerForPackagedMessagesFromCallMachine",value:function(r,i){var s=function(a){if(a.data&&a.data.what==="iframe-call-message"&&(!a.data.callClientId||a.data.callClientId===i)&&(!a.data.from||a.data.from!=="module")){var c=a.data;r(c)}};return this._wrappedListeners[r]=s,window.addEventListener("message",s),r}},{key:"removeListenerForPackagedMessagesFromCallMachine",value:function(r){var i=this._wrappedListeners[r];i&&(window.removeEventListener("message",i),delete this._wrappedListeners[r])}},{key:"_callMachineTargetOrigin",value:function(r){return r?r.src?new URL(r.src).origin:void 0:this._targetOriginFromWindowLocation()}},{key:"_targetOriginFromWindowLocation",value:function(){return window.location.protocol==="file:"?"*":window.location.origin}}]),n}();function ol(t){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var n,r=de(t);if(e){var i=de(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return un(this,n)}}var al=function(t){ln(n,fo);var e=ol(n);function n(){var r;return pe(this,n),r=e.call(this),global.callMachineToDailyJsEmitter=global.callMachineToDailyJsEmitter||new Ee.EventEmitter,global.dailyJsToCallMachineEmitter=global.dailyJsToCallMachineEmitter||new Ee.EventEmitter,r._wrappedListeners={},r._messageCallbacks={},r}return fe(n,[{key:"addListenerForMessagesFromCallMachine",value:function(r,i,s){this._addListener(r,global.callMachineToDailyJsEmitter,s,"received call machine message")}},{key:"addListenerForMessagesFromDailyJs",value:function(r,i,s){this._addListener(r,global.dailyJsToCallMachineEmitter,s,"received daily-js message")}},{key:"sendMessageToCallMachine",value:function(r,i){this._sendMessage(r,global.dailyJsToCallMachineEmitter,"sending message to call machine",i)}},{key:"sendMessageToDailyJs",value:function(r){this._sendMessage(r,global.callMachineToDailyJsEmitter,"sending message to daily-js")}},{key:"removeListener",value:function(r){var i=this._wrappedListeners[r];i&&(global.callMachineToDailyJsEmitter.removeListener("message",i),global.dailyJsToCallMachineEmitter.removeListener("message",i),delete this._wrappedListeners[r])}},{key:"_addListener",value:function(r,i,s,a){var c=this,l=function(p){if(p.callbackStamp&&c._messageCallbacks[p.callbackStamp]){var h=p.callbackStamp;c._messageCallbacks[h].call(s,p),delete c._messageCallbacks[h]}r.call(s,p)};this._wrappedListeners[r]=l,i.addListener("message",l)}},{key:"_sendMessage",value:function(r,i,s,a){if(a){var c=dn();this._messageCallbacks[c]=a,r.callbackStamp=c}i.emit("message",r)}}]),n}(),tr="replace",nr="shallow-merge",rs=[tr,nr],cl=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.data,r=e.mergeStrategy,i=r===void 0?tr:r;pe(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===nr}},{key:"_validateMergeStrategy",value:function(e){if(!rs.includes(e))throw Error("Unrecognized mergeStrategy provided. Options are: [".concat(rs,"]"))}},{key:"_validateData",value:function(e,n){if(!function(c){if(c==null||U(c)!=="object")return!1;var l=Object.getPrototypeOf(c);return l==null||l===Object.prototype}(e))throw Error("Meeting session data must be a plain (map-like) object");var r;try{if(r=JSON.stringify(e),n===tr){var i=JSON.parse(r);Q(i,e)||console.warn("The meeting session data provided will be modified when serialized.",i,e)}else if(n===nr){for(var s in e)if(Object.hasOwnProperty.call(e,s)&&e[s]!==void 0){var a=JSON.parse(JSON.stringify(e[s]));Q(e[s],a)||console.warn("At least one key in the meeting session data provided will be modified when serialized.",a,e[s])}}}catch(c){throw Error("Meeting session data must be serializable to JSON: ".concat(c))}if(r.length>Wi)throw Error("Meeting session data is too large (".concat(r.length," characters). Maximum size suppported is ").concat(Wi,"."))}}]),t}();function rr(t,e,n){return rr=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}()?Reflect.construct.bind():function(r,i,s){var a=[null];a.push.apply(a,i);var c=new(Function.bind.apply(r,a));return s&&wt(c,s.prototype),c},rr.apply(null,arguments)}function ir(t){var e=typeof Map=="function"?new Map:void 0;return ir=function(n){if(n===null||(r=n,Function.toString.call(r).indexOf("[native code]")===-1))return n;var r;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return rr(n,arguments,de(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),wt(i,n)},ir(t)}function ll(t){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var n,r=de(t);if(e){var i=de(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return un(this,n)}}function is(t){var e,n=(e=window._daily)===null||e===void 0?void 0:e.pendings;if(n){var r=n.indexOf(t);r!==-1&&n.splice(r,1)}}var ul=function(){function t(e){pe(this,t),this._currentLoad=null,this._callClientId=e}return fe(t,[{key:"load",value:function(){var e,n=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0,s=arguments.length>2?arguments[2]:void 0;if(this.loaded)return window._daily.instances[this._callClientId].callMachine.reset(),void i(!0);e=this._callClientId,window._daily.pendings.push(e),this._currentLoad&&this._currentLoad.cancel(),this._currentLoad=new dl(r,function(){i(!1)},function(a,c){c||is(n._callClientId),s(a,c)}),this._currentLoad.start()}},{key:"cancel",value:function(){this._currentLoad&&this._currentLoad.cancel(),is(this._callClientId)}},{key:"loaded",get:function(){return this._currentLoad&&this._currentLoad.succeeded}}]),t}(),dl=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;pe(this,t),this._attemptsRemaining=3,this._currentAttempt=null,this._dailyConfig=e,this._successCallback=n,this._failureCallback=r}return fe(t,[{key:"start",value:function(){var e=this;this._currentAttempt||(this._currentAttempt=new ss(this._dailyConfig,this._successCallback,function n(r){e._currentAttempt.cancelled||(e._attemptsRemaining--,e._failureCallback(r,e._attemptsRemaining>0),e._attemptsRemaining<=0||setTimeout(function(){e._currentAttempt.cancelled||(e._currentAttempt=new ss(e._dailyConfig,e._successCallback,n),e._currentAttempt.start())},3e3))}),this._currentAttempt.start())}},{key:"cancel",value:function(){this._currentAttempt&&this._currentAttempt.cancel()}},{key:"cancelled",get:function(){return this._currentAttempt&&this._currentAttempt.cancelled}},{key:"succeeded",get:function(){return this._currentAttempt&&this._currentAttempt.succeeded}}]),t}(),An=function(t){ln(n,ir(Error));var e=ll(n);function n(){return pe(this,n),e.apply(this,arguments)}return fe(n)}(),sn=2e4,ss=function(){function t(n,r,i){pe(this,t),this._loadAttemptImpl=N()||!n.avoidEval?new hl(n,r,i):new pl(n,r,i)}var e;return fe(t,[{key:"start",value:(e=O(function*(){return this._loadAttemptImpl.start()}),function(){return e.apply(this,arguments)})},{key:"cancel",value:function(){this._loadAttemptImpl.cancel()}},{key:"cancelled",get:function(){return this._loadAttemptImpl.cancelled}},{key:"succeeded",get:function(){return this._loadAttemptImpl.succeeded}}]),t}(),hl=function(){function t(s,a,c){pe(this,t),this.cancelled=!1,this.succeeded=!1,this._networkTimedOut=!1,this._networkTimeout=null,this._iosCache=typeof iOSCallObjectBundleCache<"u"&&iOSCallObjectBundleCache,this._refetchHeaders=null,this._dailyConfig=s,this._successCallback=a,this._failureCallback=c}var e,n,r,i;return fe(t,[{key:"start",value:(i=O(function*(){var s=Xt(this._dailyConfig);!(yield this._tryLoadFromIOSCache(s))&&this._loadFromNetwork(s)}),function(){return i.apply(this,arguments)})},{key:"cancel",value:function(){clearTimeout(this._networkTimeout),this.cancelled=!0}},{key:"_tryLoadFromIOSCache",value:(r=O(function*(s){if(!this._iosCache)return!1;try{var a=yield this._iosCache.get(s);return!!this.cancelled||!!a&&(a.code?(Function('"use strict";'+a.code)(),this.succeeded=!0,this._successCallback(),!0):(this._refetchHeaders=a.refetchHeaders,!1))}catch{return!1}}),function(s){return r.apply(this,arguments)})},{key:"_loadFromNetwork",value:(n=O(function*(s){var a=this;this._networkTimeout=setTimeout(function(){a._networkTimedOut=!0,a._failureCallback({msg:"Timed out (>".concat(sn," ms) when loading call object bundle ").concat(s),type:"timeout"})},sn);try{var c=this._refetchHeaders?{headers:this._refetchHeaders}:{},l=yield fetch(s,c);if(clearTimeout(this._networkTimeout),this.cancelled||this._networkTimedOut)throw new An;var p=yield this._getBundleCodeFromResponse(s,l);if(this.cancelled)throw new An;Function('"use strict";'+p)(),this._iosCache&&this._iosCache.set(s,p,l.headers),this.succeeded=!0,this._successCallback()}catch(h){if(clearTimeout(this._networkTimeout),h instanceof An||this.cancelled||this._networkTimedOut)return;this._failureCallback({msg:"Failed to load call object bundle ".concat(s,": ").concat(h),type:h.message})}}),function(s){return n.apply(this,arguments)})},{key:"_getBundleCodeFromResponse",value:(e=O(function*(s,a){if(a.ok)return yield a.text();if(this._iosCache&&a.status===304)return(yield this._iosCache.renew(s,a.headers)).code;throw new Error("Received ".concat(a.status," response"))}),function(s,a){return e.apply(this,arguments)})}]),t}(),pl=function(){function t(e,n,r){pe(this,t),this.cancelled=!1,this.succeeded=!1,this._dailyConfig=e,this._successCallback=n,this._failureCallback=r,this._attemptId=dn(),this._networkTimeout=null,this._scriptElement=null}return fe(t,[{key:"start",value:function(){window._dailyCallMachineLoadWaitlist||(window._dailyCallMachineLoadWaitlist=new Set);var e=Xt(this._dailyConfig);(typeof document>"u"?"undefined":U(document))==="object"?this._startLoading(e):this._failureCallback({msg:"Call object bundle must be loaded in a DOM/web context",type:"missing context"})}},{key:"cancel",value:function(){this._stopLoading(),this.cancelled=!0}},{key:"_startLoading",value:function(e){var n=this;this._signUpForCallMachineLoadWaitlist(),this._networkTimeout=setTimeout(function(){n._stopLoading(),n._failureCallback({msg:"Timed out (>".concat(sn," ms) when loading call object bundle ").concat(e),type:"timeout"})},sn);var r=document.getElementsByTagName("head")[0],i=document.createElement("script");this._scriptElement=i,i.onload=function(){n._stopLoading(),n.succeeded=!0,n._successCallback()},i.onerror=function(s){n._stopLoading(),n._failureCallback({msg:"Failed to load call object bundle ".concat(s.target.src),type:s.message})},i.src=e,r.appendChild(i)}},{key:"_stopLoading",value:function(){this._withdrawFromCallMachineLoadWaitlist(),clearTimeout(this._networkTimeout),this._scriptElement&&(this._scriptElement.onload=null,this._scriptElement.onerror=null)}},{key:"_signUpForCallMachineLoadWaitlist",value:function(){window._dailyCallMachineLoadWaitlist.add(this._attemptId)}},{key:"_withdrawFromCallMachineLoadWaitlist",value:function(){window._dailyCallMachineLoadWaitlist.delete(this._attemptId)}}]),t}(),$t=function(t,e,n){return ml(t.local,e,n)===!0},fl=function(t,e,n){return t.local.streams&&t.local.streams[e]&&t.local.streams[e].stream&&t.local.streams[e].stream["get".concat(n==="video"?"Video":"Audio","Tracks")]()[0]},Xe=function(t,e,n,r){var i=gl(t,e,n,r);return i&&i.pendingTrack},ml=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)},gl=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]},vl=function(t,e){var n=t.local.public.customTracks;if(n&&n[e])return n[e].track};function os(t,e){for(var n=e.getState(),r=0,i=["cam","screen"];r<i.length;r++)for(var s=i[r],a=0,c=["video","audio"];a<c.length;a++){var l=c[a],p=s==="cam"?l:"screen".concat(l.charAt(0).toUpperCase()+l.slice(1)),h=t.tracks[p];if(h){var f=t.local?fl(n,s,l):Xe(n,t.session_id,s,l);h.state==="playable"&&(h.track=f),h.persistentTrack=f}}}function as(t,e){try{var n=e.getState();for(var r in t.tracks)if(!yl(r)){var i=t.tracks[r].kind;if(i){var s=t.tracks[r];if(s){var a=t.local?vl(n,r):Xe(n,t.session_id,r,i);s.state==="playable"&&(t.tracks[r].track=a),s.persistentTrack=a}}else console.error("unknown type for custom track")}}catch(c){console.error(c)}}function yl(t){return["video","audio","screenVideo","screenAudio"].includes(t)}function cs(t,e,n){var r=n.getState();if(t.local){if(t.audio)try{t.audioTrack=r.local.streams.cam.stream.getAudioTracks()[0],t.audioTrack||(t.audio=!1)}catch{}if(t.video)try{t.videoTrack=r.local.streams.cam.stream.getVideoTracks()[0],t.videoTrack||(t.video=!1)}catch{}if(t.screen)try{t.screenVideoTrack=r.local.streams.screen.stream.getVideoTracks()[0],t.screenAudioTrack=r.local.streams.screen.stream.getAudioTracks()[0],t.screenVideoTrack||t.screenAudioTrack||(t.screen=!1)}catch{}}else{var i=!0;try{var s=r.participants[t.session_id];s&&s.public&&s.public.rtcType&&s.public.rtcType.impl==="peer-to-peer"&&s.private&&!["connected","completed"].includes(s.private.peeringState)&&(i=!1)}catch(h){console.error(h)}if(!i)return t.audio=!1,t.audioTrack=!1,t.video=!1,t.videoTrack=!1,t.screen=!1,void(t.screenTrack=!1);try{if(r.streams,t.audio&&$t(r,t.session_id,"cam-audio")){var a=Xe(r,t.session_id,"cam","audio");a&&(e&&e.audioTrack&&e.audioTrack.id===a.id?t.audioTrack=a:a.muted||(t.audioTrack=a)),t.audioTrack||(t.audio=!1)}if(t.video&&$t(r,t.session_id,"cam-video")){var c=Xe(r,t.session_id,"cam","video");c&&(e&&e.videoTrack&&e.videoTrack.id===c.id?t.videoTrack=c:c.muted||(t.videoTrack=c)),t.videoTrack||(t.video=!1)}if(t.screen&&$t(r,t.session_id,"screen-audio")){var l=Xe(r,t.session_id,"screen","audio");l&&(e&&e.screenAudioTrack&&e.screenAudioTrack.id===l.id?t.screenAudioTrack=l:l.muted||(t.screenAudioTrack=l))}if(t.screen&&$t(r,t.session_id,"screen-video")){var p=Xe(r,t.session_id,"screen","video");p&&(e&&e.screenVideoTrack&&e.screenVideoTrack.id===p.id?t.screenVideoTrack=p:p.muted||(t.screenVideoTrack=p))}t.screenVideoTrack||t.screenAudioTrack||(t.screen=!1)}catch(h){console.error("unexpected error matching up tracks",h)}}}function _l(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(l,p){if(l){if(typeof l=="string")return ls(l,p);var h=Object.prototype.toString.call(l).slice(8,-1);if(h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set")return Array.from(l);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return ls(l,p)}}(t))||e){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
23
|
+
Url: ${Ut(h)}`),!0)}(i,p)?null:i}}return i};r.id=this.name,e(r)}}function Ut(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch{}return e?function(n=[]){for(let r=n.length-1;r>=0;r--){const i=n[r];if(i&&i.filename!=="<anonymous>"&&i.filename!=="[native code]")return i.filename||null}return null}(e):null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.error(`Cannot extract url for event ${Ae(t)}`),null}}tt.__initStatic();var Ia=Object.freeze({__proto__:null,FunctionToString:Tt,InboundFilters:tt});const F=ie;let Wn=0;function no(){return Wn>0}function ct(t,e={},n){if(typeof t!="function")return t;try{const i=t.__sentry_wrapped__;if(i)return i;if(yr(t))return t}catch{return t}const r=function(){const i=Array.prototype.slice.call(arguments);try{n&&typeof n=="function"&&n.apply(this,arguments);const a=i.map(c=>ct(c,e));return t.apply(this,a)}catch(a){throw Wn++,setTimeout(()=>{Wn--}),s=c=>{var l,p;c.addEventProcessor(h=>(e.mechanism&&($n(h,void 0),kt(h,e.mechanism)),h.extra={...h.extra,arguments:i},h)),l=a,te().captureException(l,{captureContext:p})},te().withScope(s),a}var s};try{for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}catch{}Gs(r,t),vr(t,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get:()=>t.name})}catch{}return r}function ro(t,e){const n=wr(t,e),r={type:e&&e.name,value:Fa(e)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function Tn(t,e){return{exception:{values:[ro(t,e)]}}}function wr(t,e){const n=e.stacktrace||e.stack||"",r=function(i){if(i){if(typeof i.framesToPop=="number")return i.framesToPop;if(Ba.test(i.message))return 1}return 0}(e);try{return t(n,r)}catch{}return[]}const Ba=/Minified React error #\d+;/i;function Fa(t){const e=t&&t.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:e:"No error message"}function Sr(t,e,n,r,i){let s;if(fr(e)&&e.error)return Tn(t,e.error);if(oi(e)||lt(e,"DOMException")){const a=e;if("stack"in e)s=Tn(t,e);else{const c=a.name||(oi(a)?"DOMError":"DOMException"),l=a.message?`${c}: ${a.message}`:c;s=Kn(t,l,n,r),$n(s,l)}return"code"in a&&(s.tags={...s.tags,"DOMException.code":`${a.code}`}),s}return Js(e)?Tn(t,e):ot(e)||Zt(e)?(s=function(a,c,l,p){const h=te().getClient(),f=h&&h.getOptions().normalizeDepth,_={exception:{values:[{type:Zt(c)?c.constructor.name:p?"UnhandledRejection":"Error",value:Ua(c,{isUnhandledRejection:p})}]},extra:{__serialized__:Ys(c,f)}};if(l){const k=wr(a,l);k.length&&(_.exception.values[0].stacktrace={frames:k})}return _}(t,e,n,i),kt(s,{synthetic:!0}),s):(s=Kn(t,e,n,r),$n(s,`${e}`),kt(s,{synthetic:!0}),s)}function Kn(t,e,n,r){const i={message:e};if(r&&n){const s=wr(t,n);s.length&&(i.exception={values:[{value:e,stacktrace:{frames:s}}]})}return i}function Ua(t,{isUnhandledRejection:e}){const n=function(i,s=40){const a=Object.keys(zs(i));if(a.sort(),!a.length)return"[object has no keys]";if(a[0].length>=s)return et(a[0],s);for(let c=a.length;c>0;c--){const l=a.slice(0,c).join(", ");if(!(l.length>s))return c===a.length?l:et(l,s)}return""}(t),r=e?"promise rejection":"exception";return fr(t)?`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``:Zt(t)?`Event \`${function(i){try{const s=Object.getPrototypeOf(i);return s?s.constructor.name:void 0}catch{}}(t)}\` (type=${t.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}const xi=1024,io="Breadcrumbs";class Ct{static __initStatic(){this.id=io}__init(){this.name=Ct.id}constructor(e){Ct.prototype.__init.call(this),this.options={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e}}setupOnce(){this.options.console&&Ue("console",qa),this.options.dom&&Ue("dom",function(e){function n(r){let i,s=typeof e=="object"?e.serializeAttribute:void 0,a=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;a&&a>xi&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${a} was configured. Sentry will use 1024 instead.`),a=xi),typeof s=="string"&&(s=[s]);try{const c=r.event;i=function(l){return!!l&&!!l.target}(c)?Un(c.target,{keyAttrs:s,maxStringLength:a}):Un(c,{keyAttrs:s,maxStringLength:a})}catch{i="<unknown>"}i.length!==0&&te().addBreadcrumb({category:`ui.${r.name}`,message:i},{event:r.event,name:r.name,global:r.global})}return n}(this.options.dom)),this.options.xhr&&Ue("xhr",Ja),this.options.fetch&&Ue("fetch",Va),this.options.history&&Ue("history",$a)}addSentryBreadcrumb(e){this.options.sentry&&te().addBreadcrumb({category:"sentry."+(e.type==="transaction"?"transaction":"event"),event_id:e.event_id,level:e.level,message:Ae(e)},{event:e})}}function qa(t){for(let r=0;r<t.args.length;r++)if(t.args[r]==="ref=Ref<"){t.args[r+1]="viewRef";break}const e={category:"console",data:{arguments:t.args,logger:"console"},level:(n=t.level,n==="warn"?"warning":ba.includes(n)?n:"log"),message:ai(t.args," ")};var n;if(t.level==="assert"){if(t.args[0]!==!1)return;e.message=`Assertion failed: ${ai(t.args.slice(1)," ")||"console.assert"}`,e.data.arguments=t.args.slice(1)}te().addBreadcrumb(e,{input:t.args,level:t.level})}function Ja(t){const{startTimestamp:e,endTimestamp:n}=t,r=t.xhr[vt];if(!e||!n||!r)return;const{method:i,url:s,status_code:a,body:c}=r,l={method:i,url:s,status_code:a},p={xhr:t.xhr,input:c,startTimestamp:e,endTimestamp:n};te().addBreadcrumb({category:"xhr",data:l,type:"http"},p)}function Va(t){const{startTimestamp:e,endTimestamp:n}=t;if(n&&(!t.fetchData.url.match(/sentry_key/)||t.fetchData.method!=="POST"))if(t.error){const r=t.fetchData,i={data:t.error,input:t.args,startTimestamp:e,endTimestamp:n};te().addBreadcrumb({category:"fetch",data:r,level:"error",type:"http"},i)}else{const r={...t.fetchData,status_code:t.response&&t.response.status},i={input:t.args,response:t.response,startTimestamp:e,endTimestamp:n};te().addBreadcrumb({category:"fetch",data:r,type:"http"},i)}}function $a(t){let e=t.from,n=t.to;const r=kn(F.location.href);let i=kn(e);const s=kn(n);i.path||(i=r),r.protocol===s.protocol&&r.host===s.host&&(n=s.relative),r.protocol===i.protocol&&r.host===i.host&&(e=i.relative),te().addBreadcrumb({category:"navigation",data:{from:e,to:n}})}Ct.__initStatic();class Ga extends qe{constructor(e){const n=F.SENTRY_SDK_SOURCE||"npm";e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:`${n}:@sentry/browser`,version:Ri}],version:Ri},super(e),e.sendClientReports&&F.document&&F.document.addEventListener("visibilitychange",()=>{F.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,n){return function(r,i,s,a){const c=Sr(r,i,s&&s.syntheticException||void 0,a);return kt(c),c.level="error",s&&s.event_id&&(c.event_id=s.event_id),He(c)}(this._options.stackParser,e,n,this._options.attachStacktrace)}eventFromMessage(e,n="info",r){return function(i,s,a="info",c,l){const p=Kn(i,s,c&&c.syntheticException||void 0,l);return p.level=a,c&&c.event_id&&(p.event_id=c.event_id),He(p)}(this._options.stackParser,e,n,r,this._options.attachStacktrace)}sendEvent(e,n){const r=this.getIntegrationById(io);r&&r.addSentryBreadcrumb&&r.addSentryBreadcrumb(e),super.sendEvent(e,n)}captureUserFeedback(e){if(!this._isEnabled())return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn("SDK not enabled, will not capture user feedback."));const n=function(r,{metadata:i,tunnel:s,dsn:a}){const c={event_id:r.event_id,sent_at:new Date().toISOString(),...i&&i.sdk&&{sdk:{name:i.sdk.name,version:i.sdk.version}},...!!s&&!!a&&{dsn:tn(a)}};return Et(c,[function(p){return[{type:"user_report"},p]}(r)])}(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(n)}_prepareEvent(e,n,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,n,r)}_flushOutcomes(){const e=this._clearOutcomes();if(e.length===0)return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log("No outcomes to send"));if(!this._dsn)return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log("No dsn provided, will not send outcomes"));(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log("Sending outcomes:",e);const n=(r=e,Et((i=this._options.tunnel&&tn(this._dsn))?{dsn:i}:{},[[{type:"client_report"},{timestamp:s||pn(),discarded_events:r}]]));var r,i,s;this._sendEnvelope(n)}}let ft;function za(t,e=function(){if(ft)return ft;if(Jn(F.fetch))return ft=F.fetch.bind(F);const n=F.document;let r=F.fetch;if(n&&typeof n.createElement=="function")try{const i=n.createElement("iframe");i.hidden=!0,n.head.appendChild(i);const s=i.contentWindow;s&&s.fetch&&(r=s.fetch),n.head.removeChild(i)}catch(i){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",i)}return ft=r.bind(F)}()){let n=0,r=0;return La(t,function(i){const s=i.body.length;n+=s,r++;const a={body:i.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:n<=6e4&&r<15,...t.fetchOptions};try{return e(t.url,a).then(c=>(n-=s,r--,{statusCode:c.status,headers:{"x-sentry-rate-limits":c.headers.get("X-Sentry-Rate-Limits"),"retry-after":c.headers.get("Retry-After")}}))}catch(c){return ft=void 0,n-=s,r--,nn(c)}})}class xe{static __initStatic(){this.id="GlobalHandlers"}__init(){this.name=xe.id}__init2(){this._installFunc={onerror:Ha,onunhandledrejection:Ya}}constructor(e){xe.prototype.__init.call(this),xe.prototype.__init2.call(this),this._options={onerror:!0,onunhandledrejection:!0,...e}}setupOnce(){Error.stackTraceLimit=50;const e=this._options;for(const r in e){const i=this._installFunc[r];i&&e[r]&&(n=r,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log(`Global Handler attached: ${n}`),i(),this._installFunc[r]=void 0)}var n}}function Ha(){Ue("error",t=>{const[e,n,r]=oo();if(!e.getIntegration(xe))return;const{msg:i,url:s,line:a,column:c,error:l}=t;if(no()||l&&l.__sentry_own_request__)return;const p=l===void 0&&Ge(i)?function(h,f,_,k){const v=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let b=fr(h)?h.message:h,T="Error";const M=b.match(v);return M&&(T=M[1],b=M[2]),Li({exception:{values:[{type:T,value:b}]}},f,_,k)}(i,s,a,c):Li(Sr(n,l||i,void 0,r,!1),s,a,c);p.level="error",so(e,l,p,"onerror")})}function Ya(){Ue("unhandledrejection",t=>{const[e,n,r]=oo();if(!e.getIntegration(xe))return;let i=t;try{"reason"in t?i=t.reason:"detail"in t&&"reason"in t.detail&&(i=t.detail.reason)}catch{}if(no()||i&&i.__sentry_own_request__)return!0;const s=Vs(i)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(i)}`}]}}:Sr(n,i,void 0,r,!0);s.level="error",so(e,i,s,"onunhandledrejection")})}function Li(t,e,n,r){const i=t.exception=t.exception||{},s=i.values=i.values||[],a=s[0]=s[0]||{},c=a.stacktrace=a.stacktrace||{},l=c.frames=c.frames||[],p=isNaN(parseInt(r,10))?void 0:r,h=isNaN(parseInt(n,10))?void 0:n,f=Ge(e)&&e.length>0?e:function(){try{return da.document.location.href}catch{return""}}();return l.length===0&&l.push({colno:p,filename:f,function:"?",in_app:!0,lineno:h}),t}function so(t,e,n,r){kt(n,{handled:!1,type:r}),t.captureEvent(n,{originalException:e})}function oo(){const t=te(),e=t.getClient(),n=e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[t,n.stackParser,n.attachStacktrace]}xe.__initStatic();const Wa=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"];class Mt{static __initStatic(){this.id="TryCatch"}__init(){this.name=Mt.id}constructor(e){Mt.prototype.__init.call(this),this._options={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e}}setupOnce(){this._options.setTimeout&&z(F,"setTimeout",Ni),this._options.setInterval&&z(F,"setInterval",Ni),this._options.requestAnimationFrame&&z(F,"requestAnimationFrame",Ka),this._options.XMLHttpRequest&&"XMLHttpRequest"in F&&z(XMLHttpRequest.prototype,"send",Qa);const e=this._options.eventTarget;e&&(Array.isArray(e)?e:Wa).forEach(Xa)}}function Ni(t){return function(...e){const n=e[0];return e[0]=ct(n,{mechanism:{data:{function:Le(t)},handled:!0,type:"instrument"}}),t.apply(this,e)}}function Ka(t){return function(e){return t.apply(this,[ct(e,{mechanism:{data:{function:"requestAnimationFrame",handler:Le(t)},handled:!0,type:"instrument"}})])}}function Qa(t){return function(...e){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(r=>{r in n&&typeof n[r]=="function"&&z(n,r,function(i){const s={mechanism:{data:{function:r,handler:Le(i)},handled:!0,type:"instrument"}},a=yr(i);return a&&(s.mechanism.data.handler=Le(a)),ct(i,s)})}),t.apply(this,e)}}function Xa(t){const e=F,n=e[t]&&e[t].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(z(n,"addEventListener",function(r){return function(i,s,a){try{typeof s.handleEvent=="function"&&(s.handleEvent=ct(s.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Le(s),target:t},handled:!0,type:"instrument"}}))}catch{}return r.apply(this,[i,ct(s,{mechanism:{data:{function:"addEventListener",handler:Le(s),target:t},handled:!0,type:"instrument"}}),a])}}),z(n,"removeEventListener",function(r){return function(i,s,a){const c=s;try{const l=c&&c.__sentry_wrapped__;l&&r.call(this,i,l,a)}catch{}return r.call(this,i,c,a)}}))}Mt.__initStatic();class nt{static __initStatic(){this.id="LinkedErrors"}__init(){this.name=nt.id}constructor(e={}){nt.prototype.__init.call(this),this._key=e.key||"cause",this._limit=e.limit||5}setupOnce(e,n){e((r,i)=>{const s=n(),a=s.getClient(),c=s.getIntegration(nt);if(!a||!c)return r;const l=a.getOptions();return ua(ro,l.stackParser,l.maxValueLength,c._key,c._limit,r,i),r})}}nt.__initStatic();class rt{constructor(){rt.prototype.__init.call(this)}static __initStatic(){this.id="HttpContext"}__init(){this.name=rt.id}setupOnce(){Zs(e=>{if(te().getIntegration(rt)){if(!F.navigator&&!F.location&&!F.document)return e;const n=e.request&&e.request.url||F.location&&F.location.href,{referrer:r}=F.document||{},{userAgent:i}=F.navigator||{},s={...e.request&&e.request.headers,...r&&{Referer:r},...i&&{"User-Agent":i}},a={...e.request,...n&&{url:n},headers:s};return{...e,request:a}}return e})}}rt.__initStatic();class it{constructor(){it.prototype.__init.call(this)}static __initStatic(){this.id="Dedupe"}__init(){this.name=it.id}setupOnce(e,n){const r=i=>{if(i.type)return i;const s=n().getIntegration(it);if(s){try{if(function(a,c){return c?!!(function(l,p){const h=l.message,f=p.message;return!(!h&&!f||h&&!f||!h&&f||h!==f||!Ii(l,p)||!ji(l,p))}(a,c)||function(l,p){const h=Bi(p),f=Bi(l);return!(!h||!f||h.type!==f.type||h.value!==f.value||!Ii(l,p)||!ji(l,p))}(a,c)):!1}(i,s._previousEvent))return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{return s._previousEvent=i}return s._previousEvent=i}return i};r.id=this.name,e(r)}}function ji(t,e){let n=Fi(t),r=Fi(e);if(!n&&!r)return!0;if(n&&!r||!n&&r||r.length!==n.length)return!1;for(let i=0;i<r.length;i++){const s=r[i],a=n[i];if(s.filename!==a.filename||s.lineno!==a.lineno||s.colno!==a.colno||s.function!==a.function)return!1}return!0}function Ii(t,e){let n=t.fingerprint,r=e.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return n.join("")===r.join("")}catch{return!1}}function Bi(t){return t.exception&&t.exception.values&&t.exception.values[0]}function Fi(t){const e=t.exception;if(e)try{return e.values[0].stacktrace.frames}catch{return}}it.__initStatic();var Za=Object.freeze({__proto__:null,Breadcrumbs:Ct,Dedupe:it,GlobalHandlers:xe,HttpContext:rt,LinkedErrors:nt,TryCatch:Mt});let ao={};F.Sentry&&F.Sentry.Integrations&&(ao=F.Sentry.Integrations);const Ui={...ao,...Ia,...Za};var qi="new",Ji="loading",Vi="loaded",Qn="joining-meeting",Qe="joined-meeting",Ie="left-meeting",Ce="error",Cn="unknown",ec="full",tc="base",nc="*",rc="iframe-ready-for-launch-config",ic="iframe-launch-config",sc="theme-updated",oc="loading",ac="load-attempt-failed",$i="loaded",cc="started-camera",lc="camera-error",uc="joining-meeting",dc="joined-meeting",hc="left-meeting",pc="participant-joined",fc="participant-updated",mc="participant-left",gc="participant-counts-updated",vc="access-state-updated",yc="meeting-session-summary-updated",_c="meeting-session-state-updated",bc="waiting-participant-added",wc="waiting-participant-updated",Sc="waiting-participant-removed",kc="track-started",Ec="track-stopped",Tc="transcription-started",Cc="transcription-stopped",Mc="transcription-error",Gi="recording-started",zi="recording-stopped",Oc="recording-stats",Pc="recording-error",Ac="recording-upload-completed",Rc="recording-data",Dc="app-message",xc="transcription-message",Lc="remote-media-player-started",Nc="remote-media-player-updated",jc="remote-media-player-stopped",Ic="local-screen-share-started",Bc="local-screen-share-stopped",Fc="local-screen-share-canceled",Uc="active-speaker-change",qc="active-speaker-mode-change",Jc="network-quality-change",Vc="network-connection",$c="cpu-load-change",Gc="face-counts-updated",qt="fullscreen",Jt="exited-fullscreen",zc="live-streaming-started",Hc="live-streaming-updated",Yc="live-streaming-stopped",Wc="live-streaming-error",Kc="lang-updated",Qc="receive-settings-updated",Xc="input-settings-updated",Hi="nonfatal-error",Yi="error",Wi=102400,Mn="iframe-call-message",Ki="local-screen-start",Qi="daily-method-update-live-streaming-endpoints",Vt="transmit-log",yt="daily-custom-track",Yt={NONE:"none",BGBLUR:"background-blur",BGIMAGE:"background-image",FACE_DETECTION:"face-detection"},co={NONE:"none",NOISE_CANCELLATION:"noise-cancellation"},Xn={PLAY:"play",PAUSE:"pause"},Xi=10,On=["jpg","png","jpeg"],Zc="add-endpoints",el="remove-endpoints",Zi="sip-call-transfer";function he(){return!N()&&typeof window<"u"&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:""}function N(){return typeof navigator<"u"&&navigator.product&&navigator.product==="ReactNative"}function lo(){return navigator&&navigator.mediaDevices&&navigator.mediaDevices.getUserMedia}function tl(){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}(Ye(),er())||N())}function es(){if(N()||!document)return!1;var t=document.createElement("iframe");return!!t.requestFullscreen||!!t.webkitRequestFullscreen}var nl=function(){try{var t=document.createElement("canvas"),e=t.getContext("webgl2")!=null;return t.remove(),e}catch{return!1}}();function uo(){var t=arguments.length>0&&arguments[0]!==void 0&&arguments[0];return!N()&&!!nl&&(t?function(){return Zn()?!1:["Chrome","Firefox"].includes(Ye())}():function(){if(Zn())return!1;var e=Ye();if(e==="Safari"){var n=Er();if(n.major<15||n.major===15&&n.minor<4)return!1}return e==="Chrome"?kr().major>=77:e==="Firefox"?Tr().major>=97:["Chrome","Firefox","Safari"].includes(e)}())}var rl=["Chrome","Firefox"];function ho(){return!N()&&!Zn()&&typeof AudioWorkletNode<"u"&&rl.includes(Ye())}function ts(){return lo()&&!function(){var t,e=Ye();if(!he())return!0;switch(e){case"Chrome":return(t=kr()).major&&t.major>0&&t.major<75;case"Firefox":return(t=Tr()).major<91;case"Safari":return(t=Er()).major<13||t.major===13&&t.minor<1;default:return!0}}()}function Zn(){var t,e,n=he(),r=n.match(/Mac/)&&(!N()&&typeof window<"u"&&(t=window)!==null&&t!==void 0&&(e=t.navigator)!==null&&e!==void 0&&e.maxTouchPoints?window.navigator.maxTouchPoints:0)>=5;return!!(n.match(/Mobi/)||n.match(/Android/)||r)||!!he().match(/DailyAnd\//)||void 0}function Ye(){if(typeof window<"u"){var t=he();return po()?"Safari":t.indexOf("Edge")>-1?"Edge":t.match(/Chrome\//)?"Chrome":t.indexOf("Safari")>-1?"Safari":t.indexOf("Firefox")>-1?"Firefox":t.indexOf("MSIE")>-1||t.indexOf(".NET")>-1?"IE":"Unknown Browser"}}function er(){switch(Ye()){case"Chrome":return kr();case"Safari":return Er();case"Firefox":return Tr();case"Edge":return function(){var t=0,e=0;if(typeof window<"u"){var n=he().match(/Edge\/(\d+).(\d+)/);if(n)try{t=parseInt(n[1]),e=parseInt(n[2])}catch{}}return{major:t,minor:e}}()}}function kr(){var t=0,e=0,n=0,r=0,i=!1;if(typeof window<"u"){var s=he(),a=s.match(/Chrome\/(\d+).(\d+).(\d+).(\d+)/);if(a)try{t=parseInt(a[1]),e=parseInt(a[2]),n=parseInt(a[3]),r=parseInt(a[4]),i=s.indexOf("OPR/")>-1}catch{}}return{major:t,minor:e,build:n,patch:r,opera:i}}function po(){return!!he().match(/iPad|iPhone|iPod/i)&&lo()}function Er(){var t=0,e=0,n=0;if(typeof window<"u"){var r=he().match(/Version\/(\d+).(\d+)(.(\d+))?/);if(r)try{t=parseInt(r[1]),e=parseInt(r[2]),n=parseInt(r[4])}catch{}else po()&&(t=14,e=0,n=3)}return{major:t,minor:e,point:n}}function Tr(){var t=0,e=0;if(typeof window<"u"){var n=he().match(/Firefox\/(\d+).(\d+)/);if(n)try{t=parseInt(n[1]),e=parseInt(n[2])}catch{}}return{major:t,minor:e}}var fo=function(){function t(){pe(this,t)}return fe(t,[{key:"addListenerForMessagesFromCallMachine",value:function(e,n,r){pt()}},{key:"addListenerForMessagesFromDailyJs",value:function(e,n,r){pt()}},{key:"sendMessageToCallMachine",value:function(e,n,r,i){pt()}},{key:"sendMessageToDailyJs",value:function(e,n){pt()}},{key:"removeListener",value:function(e){pt()}}]),t}();function ns(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Pn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ns(Object(n),!0).forEach(function(r){Pe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ns(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function il(t){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var n,r=de(t);if(e){var i=de(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return un(this,n)}}var sl=function(t){ln(n,fo);var e=il(n);function n(){var r;return pe(this,n),(r=e.call(this))._wrappedListeners={},r._messageCallbacks={},r}return fe(n,[{key:"addListenerForMessagesFromCallMachine",value:function(r,i,s){var a=this,c=function(l){if(l.data&&l.data.what==="iframe-call-message"&&(!l.data.callClientId||l.data.callClientId===i)&&(!l.data.from||l.data.from!=="module")){var p=Pn({},l.data);if(delete p.from,p.callbackStamp&&a._messageCallbacks[p.callbackStamp]){var h=p.callbackStamp;a._messageCallbacks[h].call(s,p),delete a._messageCallbacks[h]}delete p.what,delete p.callbackStamp,r.call(s,p)}};this._wrappedListeners[r]=c,window.addEventListener("message",c)}},{key:"addListenerForMessagesFromDailyJs",value:function(r,i,s){var a=function(c){var l;if(!(!c.data||c.data.what!==Mn||!c.data.action||c.data.from&&c.data.from!=="module"||c.data.callClientId&&i&&c.data.callClientId!==i||c!=null&&(l=c.data)!==null&&l!==void 0&&l.callFrameId)){var p=c.data;r.call(s,p)}};this._wrappedListeners[r]=a,window.addEventListener("message",a)}},{key:"sendMessageToCallMachine",value:function(r,i,s,a){if(!a)throw new Error("undefined callClientId. Are you trying to use a DailyCall instance previously destroyed?");var c=Pn({},r);if(c.what=Mn,c.from="module",c.callClientId=a,i){var l=dn();this._messageCallbacks[l]=i,c.callbackStamp=l}var p=s?s.contentWindow:window,h=this._callMachineTargetOrigin(s);h&&p.postMessage(c,h)}},{key:"sendMessageToDailyJs",value:function(r,i){r.what=Mn,r.callClientId=i,r.from="embedded",window.postMessage(r,this._targetOriginFromWindowLocation())}},{key:"removeListener",value:function(r){var i=this._wrappedListeners[r];i&&(window.removeEventListener("message",i),delete this._wrappedListeners[r])}},{key:"forwardPackagedMessageToCallMachine",value:function(r,i,s){var a=Pn({},r);a.callClientId=s;var c=i?i.contentWindow:window,l=this._callMachineTargetOrigin(i);l&&c.postMessage(a,l)}},{key:"addListenerForPackagedMessagesFromCallMachine",value:function(r,i){var s=function(a){if(a.data&&a.data.what==="iframe-call-message"&&(!a.data.callClientId||a.data.callClientId===i)&&(!a.data.from||a.data.from!=="module")){var c=a.data;r(c)}};return this._wrappedListeners[r]=s,window.addEventListener("message",s),r}},{key:"removeListenerForPackagedMessagesFromCallMachine",value:function(r){var i=this._wrappedListeners[r];i&&(window.removeEventListener("message",i),delete this._wrappedListeners[r])}},{key:"_callMachineTargetOrigin",value:function(r){return r?r.src?new URL(r.src).origin:void 0:this._targetOriginFromWindowLocation()}},{key:"_targetOriginFromWindowLocation",value:function(){return window.location.protocol==="file:"?"*":window.location.origin}}]),n}();function ol(t){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var n,r=de(t);if(e){var i=de(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return un(this,n)}}var al=function(t){ln(n,fo);var e=ol(n);function n(){var r;return pe(this,n),r=e.call(this),global.callMachineToDailyJsEmitter=global.callMachineToDailyJsEmitter||new Ee.EventEmitter,global.dailyJsToCallMachineEmitter=global.dailyJsToCallMachineEmitter||new Ee.EventEmitter,r._wrappedListeners={},r._messageCallbacks={},r}return fe(n,[{key:"addListenerForMessagesFromCallMachine",value:function(r,i,s){this._addListener(r,global.callMachineToDailyJsEmitter,s,"received call machine message")}},{key:"addListenerForMessagesFromDailyJs",value:function(r,i,s){this._addListener(r,global.dailyJsToCallMachineEmitter,s,"received daily-js message")}},{key:"sendMessageToCallMachine",value:function(r,i){this._sendMessage(r,global.dailyJsToCallMachineEmitter,"sending message to call machine",i)}},{key:"sendMessageToDailyJs",value:function(r){this._sendMessage(r,global.callMachineToDailyJsEmitter,"sending message to daily-js")}},{key:"removeListener",value:function(r){var i=this._wrappedListeners[r];i&&(global.callMachineToDailyJsEmitter.removeListener("message",i),global.dailyJsToCallMachineEmitter.removeListener("message",i),delete this._wrappedListeners[r])}},{key:"_addListener",value:function(r,i,s,a){var c=this,l=function(p){if(p.callbackStamp&&c._messageCallbacks[p.callbackStamp]){var h=p.callbackStamp;c._messageCallbacks[h].call(s,p),delete c._messageCallbacks[h]}r.call(s,p)};this._wrappedListeners[r]=l,i.addListener("message",l)}},{key:"_sendMessage",value:function(r,i,s,a){if(a){var c=dn();this._messageCallbacks[c]=a,r.callbackStamp=c}i.emit("message",r)}}]),n}(),tr="replace",nr="shallow-merge",rs=[tr,nr],cl=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.data,r=e.mergeStrategy,i=r===void 0?tr:r;pe(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===nr}},{key:"_validateMergeStrategy",value:function(e){if(!rs.includes(e))throw Error("Unrecognized mergeStrategy provided. Options are: [".concat(rs,"]"))}},{key:"_validateData",value:function(e,n){if(!function(c){if(c==null||U(c)!=="object")return!1;var l=Object.getPrototypeOf(c);return l==null||l===Object.prototype}(e))throw Error("Meeting session data must be a plain (map-like) object");var r;try{if(r=JSON.stringify(e),n===tr){var i=JSON.parse(r);Q(i,e)||console.warn("The meeting session data provided will be modified when serialized.",i,e)}else if(n===nr){for(var s in e)if(Object.hasOwnProperty.call(e,s)&&e[s]!==void 0){var a=JSON.parse(JSON.stringify(e[s]));Q(e[s],a)||console.warn("At least one key in the meeting session data provided will be modified when serialized.",a,e[s])}}}catch(c){throw Error("Meeting session data must be serializable to JSON: ".concat(c))}if(r.length>Wi)throw Error("Meeting session data is too large (".concat(r.length," characters). Maximum size suppported is ").concat(Wi,"."))}}]),t}();function rr(t,e,n){return rr=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}()?Reflect.construct.bind():function(r,i,s){var a=[null];a.push.apply(a,i);var c=new(Function.bind.apply(r,a));return s&&wt(c,s.prototype),c},rr.apply(null,arguments)}function ir(t){var e=typeof Map=="function"?new Map:void 0;return ir=function(n){if(n===null||(r=n,Function.toString.call(r).indexOf("[native code]")===-1))return n;var r;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return rr(n,arguments,de(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),wt(i,n)},ir(t)}function ll(t){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var n,r=de(t);if(e){var i=de(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return un(this,n)}}function is(t){var e,n=(e=window._daily)===null||e===void 0?void 0:e.pendings;if(n){var r=n.indexOf(t);r!==-1&&n.splice(r,1)}}var ul=function(){function t(e){pe(this,t),this._currentLoad=null,this._callClientId=e}return fe(t,[{key:"load",value:function(){var e,n=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0,s=arguments.length>2?arguments[2]:void 0;if(this.loaded)return window._daily.instances[this._callClientId].callMachine.reset(),void i(!0);e=this._callClientId,window._daily.pendings.push(e),this._currentLoad&&this._currentLoad.cancel(),this._currentLoad=new dl(r,function(){i(!1)},function(a,c){c||is(n._callClientId),s(a,c)}),this._currentLoad.start()}},{key:"cancel",value:function(){this._currentLoad&&this._currentLoad.cancel(),is(this._callClientId)}},{key:"loaded",get:function(){return this._currentLoad&&this._currentLoad.succeeded}}]),t}(),dl=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;pe(this,t),this._attemptsRemaining=3,this._currentAttempt=null,this._dailyConfig=e,this._successCallback=n,this._failureCallback=r}return fe(t,[{key:"start",value:function(){var e=this;this._currentAttempt||(this._currentAttempt=new ss(this._dailyConfig,this._successCallback,function n(r){e._currentAttempt.cancelled||(e._attemptsRemaining--,e._failureCallback(r,e._attemptsRemaining>0),e._attemptsRemaining<=0||setTimeout(function(){e._currentAttempt.cancelled||(e._currentAttempt=new ss(e._dailyConfig,e._successCallback,n),e._currentAttempt.start())},3e3))}),this._currentAttempt.start())}},{key:"cancel",value:function(){this._currentAttempt&&this._currentAttempt.cancel()}},{key:"cancelled",get:function(){return this._currentAttempt&&this._currentAttempt.cancelled}},{key:"succeeded",get:function(){return this._currentAttempt&&this._currentAttempt.succeeded}}]),t}(),An=function(t){ln(n,ir(Error));var e=ll(n);function n(){return pe(this,n),e.apply(this,arguments)}return fe(n)}(),sn=2e4,ss=function(){function t(n,r,i){pe(this,t),this._loadAttemptImpl=N()||!n.avoidEval?new hl(n,r,i):new pl(n,r,i)}var e;return fe(t,[{key:"start",value:(e=O(function*(){return this._loadAttemptImpl.start()}),function(){return e.apply(this,arguments)})},{key:"cancel",value:function(){this._loadAttemptImpl.cancel()}},{key:"cancelled",get:function(){return this._loadAttemptImpl.cancelled}},{key:"succeeded",get:function(){return this._loadAttemptImpl.succeeded}}]),t}(),hl=function(){function t(s,a,c){pe(this,t),this.cancelled=!1,this.succeeded=!1,this._networkTimedOut=!1,this._networkTimeout=null,this._iosCache=typeof iOSCallObjectBundleCache<"u"&&iOSCallObjectBundleCache,this._refetchHeaders=null,this._dailyConfig=s,this._successCallback=a,this._failureCallback=c}var e,n,r,i;return fe(t,[{key:"start",value:(i=O(function*(){var s=Xt(this._dailyConfig);!(yield this._tryLoadFromIOSCache(s))&&this._loadFromNetwork(s)}),function(){return i.apply(this,arguments)})},{key:"cancel",value:function(){clearTimeout(this._networkTimeout),this.cancelled=!0}},{key:"_tryLoadFromIOSCache",value:(r=O(function*(s){if(!this._iosCache)return!1;try{var a=yield this._iosCache.get(s);return!!this.cancelled||!!a&&(a.code?(Function('"use strict";'+a.code)(),this.succeeded=!0,this._successCallback(),!0):(this._refetchHeaders=a.refetchHeaders,!1))}catch{return!1}}),function(s){return r.apply(this,arguments)})},{key:"_loadFromNetwork",value:(n=O(function*(s){var a=this;this._networkTimeout=setTimeout(function(){a._networkTimedOut=!0,a._failureCallback({msg:"Timed out (>".concat(sn," ms) when loading call object bundle ").concat(s),type:"timeout"})},sn);try{var c=this._refetchHeaders?{headers:this._refetchHeaders}:{},l=yield fetch(s,c);if(clearTimeout(this._networkTimeout),this.cancelled||this._networkTimedOut)throw new An;var p=yield this._getBundleCodeFromResponse(s,l);if(this.cancelled)throw new An;Function('"use strict";'+p)(),this._iosCache&&this._iosCache.set(s,p,l.headers),this.succeeded=!0,this._successCallback()}catch(h){if(clearTimeout(this._networkTimeout),h instanceof An||this.cancelled||this._networkTimedOut)return;this._failureCallback({msg:"Failed to load call object bundle ".concat(s,": ").concat(h),type:h.message})}}),function(s){return n.apply(this,arguments)})},{key:"_getBundleCodeFromResponse",value:(e=O(function*(s,a){if(a.ok)return yield a.text();if(this._iosCache&&a.status===304)return(yield this._iosCache.renew(s,a.headers)).code;throw new Error("Received ".concat(a.status," response"))}),function(s,a){return e.apply(this,arguments)})}]),t}(),pl=function(){function t(e,n,r){pe(this,t),this.cancelled=!1,this.succeeded=!1,this._dailyConfig=e,this._successCallback=n,this._failureCallback=r,this._attemptId=dn(),this._networkTimeout=null,this._scriptElement=null}return fe(t,[{key:"start",value:function(){window._dailyCallMachineLoadWaitlist||(window._dailyCallMachineLoadWaitlist=new Set);var e=Xt(this._dailyConfig);(typeof document>"u"?"undefined":U(document))==="object"?this._startLoading(e):this._failureCallback({msg:"Call object bundle must be loaded in a DOM/web context",type:"missing context"})}},{key:"cancel",value:function(){this._stopLoading(),this.cancelled=!0}},{key:"_startLoading",value:function(e){var n=this;this._signUpForCallMachineLoadWaitlist(),this._networkTimeout=setTimeout(function(){n._stopLoading(),n._failureCallback({msg:"Timed out (>".concat(sn," ms) when loading call object bundle ").concat(e),type:"timeout"})},sn);var r=document.getElementsByTagName("head")[0],i=document.createElement("script");this._scriptElement=i,i.onload=function(){n._stopLoading(),n.succeeded=!0,n._successCallback()},i.onerror=function(s){n._stopLoading(),n._failureCallback({msg:"Failed to load call object bundle ".concat(s.target.src),type:s.message})},i.src=e,r.appendChild(i)}},{key:"_stopLoading",value:function(){this._withdrawFromCallMachineLoadWaitlist(),clearTimeout(this._networkTimeout),this._scriptElement&&(this._scriptElement.onload=null,this._scriptElement.onerror=null)}},{key:"_signUpForCallMachineLoadWaitlist",value:function(){window._dailyCallMachineLoadWaitlist.add(this._attemptId)}},{key:"_withdrawFromCallMachineLoadWaitlist",value:function(){window._dailyCallMachineLoadWaitlist.delete(this._attemptId)}}]),t}(),$t=function(t,e,n){return ml(t.local,e,n)===!0},fl=function(t,e,n){return t.local.streams&&t.local.streams[e]&&t.local.streams[e].stream&&t.local.streams[e].stream["get".concat(n==="video"?"Video":"Audio","Tracks")]()[0]},Xe=function(t,e,n,r){var i=gl(t,e,n,r);return i&&i.pendingTrack},ml=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)},gl=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]},vl=function(t,e){var n=t.local.public.customTracks;if(n&&n[e])return n[e].track};function os(t,e){for(var n=e.getState(),r=0,i=["cam","screen"];r<i.length;r++)for(var s=i[r],a=0,c=["video","audio"];a<c.length;a++){var l=c[a],p=s==="cam"?l:"screen".concat(l.charAt(0).toUpperCase()+l.slice(1)),h=t.tracks[p];if(h){var f=t.local?fl(n,s,l):Xe(n,t.session_id,s,l);h.state==="playable"&&(h.track=f),h.persistentTrack=f}}}function as(t,e){try{var n=e.getState();for(var r in t.tracks)if(!yl(r)){var i=t.tracks[r].kind;if(i){var s=t.tracks[r];if(s){var a=t.local?vl(n,r):Xe(n,t.session_id,r,i);s.state==="playable"&&(t.tracks[r].track=a),s.persistentTrack=a}}else console.error("unknown type for custom track")}}catch(c){console.error(c)}}function yl(t){return["video","audio","screenVideo","screenAudio"].includes(t)}function cs(t,e,n){var r=n.getState();if(t.local){if(t.audio)try{t.audioTrack=r.local.streams.cam.stream.getAudioTracks()[0],t.audioTrack||(t.audio=!1)}catch{}if(t.video)try{t.videoTrack=r.local.streams.cam.stream.getVideoTracks()[0],t.videoTrack||(t.video=!1)}catch{}if(t.screen)try{t.screenVideoTrack=r.local.streams.screen.stream.getVideoTracks()[0],t.screenAudioTrack=r.local.streams.screen.stream.getAudioTracks()[0],t.screenVideoTrack||t.screenAudioTrack||(t.screen=!1)}catch{}}else{var i=!0;try{var s=r.participants[t.session_id];s&&s.public&&s.public.rtcType&&s.public.rtcType.impl==="peer-to-peer"&&s.private&&!["connected","completed"].includes(s.private.peeringState)&&(i=!1)}catch(h){console.error(h)}if(!i)return t.audio=!1,t.audioTrack=!1,t.video=!1,t.videoTrack=!1,t.screen=!1,void(t.screenTrack=!1);try{if(r.streams,t.audio&&$t(r,t.session_id,"cam-audio")){var a=Xe(r,t.session_id,"cam","audio");a&&(e&&e.audioTrack&&e.audioTrack.id===a.id?t.audioTrack=a:a.muted||(t.audioTrack=a)),t.audioTrack||(t.audio=!1)}if(t.video&&$t(r,t.session_id,"cam-video")){var c=Xe(r,t.session_id,"cam","video");c&&(e&&e.videoTrack&&e.videoTrack.id===c.id?t.videoTrack=c:c.muted||(t.videoTrack=c)),t.videoTrack||(t.video=!1)}if(t.screen&&$t(r,t.session_id,"screen-audio")){var l=Xe(r,t.session_id,"screen","audio");l&&(e&&e.screenAudioTrack&&e.screenAudioTrack.id===l.id?t.screenAudioTrack=l:l.muted||(t.screenAudioTrack=l))}if(t.screen&&$t(r,t.session_id,"screen-video")){var p=Xe(r,t.session_id,"screen","video");p&&(e&&e.screenVideoTrack&&e.screenVideoTrack.id===p.id?t.screenVideoTrack=p:p.muted||(t.screenVideoTrack=p))}t.screenVideoTrack||t.screenAudioTrack||(t.screen=!1)}catch(h){console.error("unexpected error matching up tracks",h)}}}function _l(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(l,p){if(l){if(typeof l=="string")return ls(l,p);var h=Object.prototype.toString.call(l).slice(8,-1);if(h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set")return Array.from(l);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return ls(l,p)}}(t))||e){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
24
24
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,a=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var l=n.next();return a=l.done,l},e:function(l){c=!0,s=l},f:function(){try{a||n.return==null||n.return()}finally{if(c)throw s}}}}function ls(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var ve=new Map,st=null;function bl(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(l,p){if(l){if(typeof l=="string")return us(l,p);var h=Object.prototype.toString.call(l).slice(8,-1);if(h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set")return Array.from(l);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return us(l,p)}}(t))||e){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
25
25
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,a=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var l=n.next();return a=l.done,l},e:function(l){c=!0,s=l},f:function(){try{a||n.return==null||n.return()}finally{if(c)throw s}}}}function us(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var ye=new Map,bt=null,wl=3e3;function Sl(t){mo()?function(e){ve.has(e)||(ve.set(e,{}),navigator.mediaDevices.enumerateDevices().then(function(n){ve.has(e)&&(ve.get(e).lastDevicesString=JSON.stringify(n),st||(st=function(){var r=O(function*(){var i,s=yield navigator.mediaDevices.enumerateDevices(),a=_l(ve.keys());try{for(a.s();!(i=a.n()).done;){var c=i.value,l=JSON.stringify(s);l!==ve.get(c).lastDevicesString&&(ve.get(c).lastDevicesString=l,c(s))}}catch(p){a.e(p)}finally{a.f()}});return function(){return r.apply(this,arguments)}}(),navigator.mediaDevices.addEventListener("devicechange",st)))}).catch(function(){}))}(t):function(e){ye.has(e)||(ye.set(e,{}),navigator.mediaDevices.enumerateDevices().then(function(n){ye.has(e)&&(ye.get(e).lastDevicesString=JSON.stringify(n),bt||(bt=setInterval(O(function*(){var r,i=yield navigator.mediaDevices.enumerateDevices(),s=bl(ye.keys());try{for(s.s();!(r=s.n()).done;){var a=r.value,c=JSON.stringify(i);c!==ye.get(a).lastDevicesString&&(ye.get(a).lastDevicesString=c,a(i))}}catch(l){s.e(l)}finally{s.f()}}),wl)))}))}(t)}function kl(t){mo()?function(e){ve.has(e)&&(ve.delete(e),ve.size===0&&st&&(navigator.mediaDevices.removeEventListener("devicechange",st),st=null))}(t):function(e){ye.has(e)&&(ye.delete(e),ye.size===0&&bt&&(clearInterval(bt),bt=null))}(t)}function mo(){return N()||navigator.mediaDevices.ondevicechange!==void 0}var El=new Set;function Tl(t,e){return t&&t.readyState==="live"&&!function(n,r){return n.muted&&!El.has(n.id)}(t)}var Cl=["result"],Ml=["preserveIframe"];function ds(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function P(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ds(Object(n),!0).forEach(function(r){Pe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ds(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Ol(t){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var n,r=de(t);if(e){var i=de(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return un(this,n)}}function hs(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(l,p){if(l){if(typeof l=="string")return ps(l,p);var h=Object.prototype.toString.call(l).slice(8,-1);if(h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set")return Array.from(l);if(h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return ps(l,p)}}(t))||e){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
26
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,a=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var l=n.next();return a=l.done,l},e:function(l){c=!0,s=l},f:function(){try{a||n.return==null||n.return()}finally{if(c)throw s}}}}function ps(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Be={},fs="video",Pl="voice",ms=N()?{data:{}}:{data:{},topology:"none"},gs={present:0,hidden:0},go={maxBitrate:{min:1e5,max:25e5},maxFramerate:{min:1,max:30},scaleResolutionDownBy:{min:1,max:8}},Rn=Object.keys(go),vs=["state","volume","simulcastEncodings"],ys={androidInCallNotification:{title:"string",subtitle:"string",iconName:"string",disableForCustomOverride:"boolean"},disableAutoDeviceManagement:{audio:"boolean",video:"boolean"}},on={id:{iconPath:"string",iconPathDarkMode:"string",label:"string",tooltip:"string"}},sr={id:{allow:"string",controlledBy:"'*' | 'owners' | string[]",csp:"string",iconURL:"string",label:"string",loading:"'eager' | 'lazy'",location:"'main' | 'sidebar'",name:"string",referrerPolicy:"string",sandbox:"string",src:"string",srcdoc:"string",shared:"string[] | 'owners' | boolean"}},Fe={customIntegrations:{validate:Eo,help:So()},customTrayButtons:{validate:ko,help:"customTrayButtons should be a dictionary of the type ".concat(JSON.stringify(on))},url:{validate:function(t){return typeof t=="string"},help:"url should be a string"},baseUrl:{validate:function(t){return typeof t=="string"},help:"baseUrl should be a string"},token:{validate:function(t){return typeof t=="string"},help:"token should be a string",queryString:"t"},dailyConfig:{validate:function(t,e){try{return e.validateDailyConfig(t),!0}catch(n){console.error("Failed to validate dailyConfig",n)}return!1},help:"Unsupported dailyConfig. Check error logs for detailed info."},reactNativeConfig:{validate:function(t){return To(t,ys)},help:"reactNativeConfig should look like ".concat(JSON.stringify(ys),", all fields optional")},lang:{validate:function(t){return["de","en-us","en","es","fi","fr","it","jp","ka","nl","no","pl","pt","pt-BR","ru","sv","tr","user"].includes(t)},help:"language not supported. Options are: de, en-us, en, es, fi, fr, it, jp, ka, nl, no, pl, pt, pt-BR, ru, sv, tr, user"},userName:!0,userData:{validate:function(t){try{return vo(t),!0}catch(e){return console.error(e),!1}},help:"invalid userData type provided"},startVideoOff:!0,startAudioOff:!0,activeSpeakerMode:!0,showLeaveButton:!0,showLocalVideo:!0,showParticipantsBar:!0,showFullscreenButton:!0,showUserNameChangeUI:!0,iframeStyle:!0,customLayout:!0,cssFile:!0,cssText:!0,bodyClass:!0,videoSource:{validate:function(t,e){return t instanceof MediaStreamTrack&&(e._sharedTracks.videoDeviceId=t),e._preloadCache.videoDeviceId=t,!0}},audioSource:{validate:function(t,e){return t instanceof MediaStreamTrack&&(e._sharedTracks.audioDeviceId=t),e._preloadCache.audioDeviceId=t,!0}},subscribeToTracksAutomatically:{validate:function(t,e){return e._preloadCache.subscribeToTracksAutomatically=t,!0}},theme:{validate:function(t){var e=["accent","accentText","background","backgroundAccent","baseText","border","mainAreaBg","mainAreaBgAccent","mainAreaText","supportiveText"],n=function(r){for(var i=0,s=Object.keys(r);i<s.length;i++){var a=s[i];if(!e.includes(a))return console.error('unsupported color "'.concat(a,'". Valid colors: ').concat(e.join(", "))),!1;if(!r[a].match(/^#[0-9a-f]{6}|#[0-9a-f]{3}$/i))return console.error("".concat(a,' theme color should be provided in valid hex color format. Received: "').concat(r[a],'"')),!1}return!0};return U(t)==="object"&&("light"in t&&"dark"in t||"colors"in t)?"light"in t&&"dark"in t?"colors"in t.light?"colors"in t.dark?n(t.light.colors)&&n(t.dark.colors):(console.error('Dark theme is missing "colors" property.',t),!1):(console.error('Light theme is missing "colors" property.',t),!1):n(t.colors):(console.error('Theme must contain either both "light" and "dark" properties, or "colors".',t),!1)},help:"unsupported theme configuration. Check error logs for detailed info."},layoutConfig:{validate:function(t){if("grid"in t){var e=t.grid;if("maxTilesPerPage"in e){if(!Number.isInteger(e.maxTilesPerPage))return console.error("grid.maxTilesPerPage should be an integer. You passed ".concat(e.maxTilesPerPage,".")),!1;if(e.maxTilesPerPage>49)return console.error("grid.maxTilesPerPage can't be larger than 49 without sacrificing browser performance. Please contact us at https://www.daily.co/contact to talk about your use case."),!1}if("minTilesPerPage"in e){if(!Number.isInteger(e.minTilesPerPage))return console.error("grid.minTilesPerPage should be an integer. You passed ".concat(e.minTilesPerPage,".")),!1;if(e.minTilesPerPage<1)return console.error("grid.minTilesPerPage can't be lower than 1."),!1;if("maxTilesPerPage"in e&&e.minTilesPerPage>e.maxTilesPerPage)return console.error("grid.minTilesPerPage can't be higher than grid.maxTilesPerPage."),!1}}return!0},help:"unsupported layoutConfig. Check error logs for detailed info."},receiveSettings:{validate:function(t){return yo(t,{allowAllParticipantsKey:!1})},help:wo({allowAllParticipantsKey:!1})},sendSettings:{validate:function(t,e){return!!function(n,r){try{return r.validateUpdateSendSettings(n),!0}catch(i){return console.error("Failed to validate send settings",i),!1}}(t,e)&&(e._preloadCache.sendSettings=t,!0)},help:"Invalid sendSettings provided. Check error logs for detailed info."},inputSettings:{validate:function(t,e){var n;return!!_o(t)&&(e._preloadCache.inputSettings||(e._preloadCache.inputSettings={}),bo(t,(n=e.properties)===null||n===void 0?void 0:n.dailyConfig),t.audio&&(e._preloadCache.inputSettings.audio=t.audio),t.video&&(e._preloadCache.inputSettings.video=t.video),!0)},help:or()},layout:{validate:function(t){return t==="custom-v1"||t==="browser"||t==="none"},help:'layout may only be set to "custom-v1"',queryString:"layout"},emb:{queryString:"emb"},embHref:{queryString:"embHref"},dailyJsVersion:{queryString:"dailyJsVersion"},proxy:{queryString:"proxy"},strictMode:!0,allowMultipleCallInstances:!0},Gt={styles:{validate:function(t){for(var e in t)if(e!=="cam"&&e!=="screen")return!1;if(t.cam){for(var n in t.cam)if(n!=="div"&&n!=="video")return!1}if(t.screen){for(var r in t.screen)if(r!=="div"&&r!=="video")return!1}return!0},help:"styles format should be a subset of: { cam: {div: {}, video: {}}, screen: {div: {}, video: {}} }"},setSubscribedTracks:{validate:function(t,e){if(e._preloadCache.subscribeToTracksAutomatically)return!1;var n=[!0,!1,"staged"];if(n.includes(t)||!N()&&t==="avatar")return!0;var r=["audio","video","screenAudio","screenVideo","rmpAudio","rmpVideo"];return function i(s){var a=arguments.length>1&&arguments[1]!==void 0&&arguments[1];for(var c in s)if(c==="custom"){if(!n.includes(s[c])&&!i(s[c],!0))return!1}else{var l=!a&&!r.includes(c),p=!n.includes(s[c]);if(l||p)return!1}return!0}(t)},help:"setSubscribedTracks cannot be used when setSubscribeToTracksAutomatically is enabled, and should be of the form: "+"true".concat(N()?"":" | 'avatar'"," | false | 'staged' | { [audio: true|false|'staged'], [video: true|false|'staged'], [screenAudio: true|false|'staged'], [screenVideo: true|false|'staged'] }")},setAudio:!0,setVideo:!0,setScreenShare:{validate:function(t){return t===!1},help:"setScreenShare must be false, as it's only meant for stopping remote participants' screen shares"},eject:!0,updatePermissions:{validate:function(t){for(var e=0,n=Object.entries(t);e<n.length;e++){var r=$e(n[e],2),i=r[0],s=r[1];switch(i){case"hasPresence":if(typeof s!="boolean")return!1;break;case"canSend":if(s instanceof Set||s instanceof Array||Array.isArray(s)){var a,c=["video","audio","screenVideo","screenAudio","customVideo","customAudio"],l=hs(s);try{for(l.s();!(a=l.n()).done;){var p=a.value;if(!c.includes(p))return!1}}catch(v){l.e(v)}finally{l.f()}}else if(typeof s!="boolean")return!1;(s instanceof Array||Array.isArray(s))&&(t.canSend=new Set(s));break;case"canAdmin":if(s instanceof Set||s instanceof Array||Array.isArray(s)){var h,f=["participants","streaming","transcription"],_=hs(s);try{for(_.s();!(h=_.n()).done;){var k=h.value;if(!f.includes(k))return!1}}catch(v){_.e(v)}finally{_.f()}}else if(typeof s!="boolean")return!1;(s instanceof Array||Array.isArray(s))&&(t.canAdmin=new Set(s));break;default:return!1}}return!0},help:"updatePermissions can take hasPresence, canSend, and canAdmin permissions. hasPresence must be a boolean. canSend can be a boolean or an Array or Set of media types (video, audio, screenVideo, screenAudio, customVideo, customAudio). canAdmin can be a boolean or an Array or Set of admin types (participants, streaming, transcription)."}};Promise.any||(Promise.any=function(){var t=O(function*(e){return new Promise(function(n,r){var i=[];e.forEach(function(s){return Promise.resolve(s).then(function(a){n(a)}).catch(function(a){i.push(a),i.length===e.length&&r(i)})})})});return function(e){return t.apply(this,arguments)}}());var Al=function(t){ln(ne,Ee);var e,n,r,i,s,a,c,l,p,h,f,_,k,v,b,T,M,B,L,te,Ne,oe,_e,ht,Rr,Dr,xr,Lr,Nr,jr,Ir,Br,Fr,Ur,qr,Jr,Vr,$r,Qo=Ol(ne);function ne(o){var u,d,g,m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(pe(this,ne),Pe(Se(d=Qo.call(this)),"startListeningForDeviceChanges",function(){Sl(d.handleDeviceChange)}),Pe(Se(d),"stopListeningForDeviceChanges",function(){kl(d.handleDeviceChange)}),Pe(Se(d),"handleDeviceChange",function(E){E=E.map(function(C){return JSON.parse(JSON.stringify(C))}),d.emitDailyJSEvent({action:"available-devices-updated",availableDevices:E})}),Pe(Se(d),"handleNativeAppStateChange",function(){var E=O(function*(C){if(C==="destroyed")return console.warn("App has been destroyed before leaving the meeting. Cleaning up all the resources!"),void(yield d.destroy());var D=C==="active";d.disableReactNativeAutoDeviceManagement("video")||(D?d.camUnmutedBeforeLosingNativeActiveState&&d.setLocalVideo(!0):(d.camUnmutedBeforeLosingNativeActiveState=d.localVideo(),d.camUnmutedBeforeLosingNativeActiveState&&d.setLocalVideo(!1)))});return function(C){return E.apply(this,arguments)}}()),Pe(Se(d),"handleNativeAudioFocusChange",function(E){d.disableReactNativeAutoDeviceManagement("audio")||(d._hasNativeAudioFocus=E,d.toggleParticipantAudioBasedOnNativeAudioFocus(),d._hasNativeAudioFocus?d.micUnmutedBeforeLosingNativeAudioFocus&&d.setLocalAudio(!0):(d.micUnmutedBeforeLosingNativeAudioFocus=d.localAudio(),d.setLocalAudio(!1)))}),Pe(Se(d),"handleNativeSystemScreenCaptureStop",function(){d.stopScreenShare()}),d.strictMode=m.strictMode===void 0||m.strictMode,d.allowMultipleCallInstances=(u=m.allowMultipleCallInstances)!==null&&u!==void 0&&u,Object.keys(Be).length&&(d._logDuplicateInstanceAttempt(),!d.allowMultipleCallInstances)){if(d.strictMode)throw new Error("Duplicate DailyIframe instances are not allowed");console.warn("Using strictMode: false to allow multiple call instances is now deprecated. Set `allowMultipleCallInstances: true`")}if(window._daily||(window._daily={pendings:[],instances:{}}),d.callClientId=dn(),g=Se(d),Be[g.callClientId]=g,window._daily.instances[d.callClientId]={},d._sharedTracks={},window._daily.instances[d.callClientId].tracks=d._sharedTracks,m.dailyJsVersion=ne.version(),d._iframe=o,d._callObjectMode=m.layout==="none"&&!d._iframe,d._preloadCache={subscribeToTracksAutomatically:!0,audioDeviceId:null,videoDeviceId:null,outputDeviceId:null,inputSettings:null,sendSettings:null,videoTrackForNetworkConnectivityTest:null,videoTrackForConnectionQualityTest:null},m.showLocalVideo!==void 0?d._callObjectMode?console.error("showLocalVideo is not available in call object mode"):d._showLocalVideo=!!m.showLocalVideo:d._showLocalVideo=!0,m.showParticipantsBar!==void 0?d._callObjectMode?console.error("showParticipantsBar is not available in call object mode"):d._showParticipantsBar=!!m.showParticipantsBar:d._showParticipantsBar=!0,m.customIntegrations!==void 0?d._callObjectMode?console.error("customIntegrations is not available in call object mode"):d._customIntegrations=m.customIntegrations:d._customIntegrations={},m.customTrayButtons!==void 0?d._callObjectMode?console.error("customTrayButtons is not available in call object mode"):d._customTrayButtons=m.customTrayButtons:d._customTrayButtons={},m.activeSpeakerMode!==void 0?d._callObjectMode?console.error("activeSpeakerMode is not available in call object mode"):d._activeSpeakerMode=!!m.activeSpeakerMode:d._activeSpeakerMode=!1,m.receiveSettings?d._callObjectMode?d._receiveSettings=m.receiveSettings:console.error("receiveSettings is only available in call object mode"):d._receiveSettings={},d.validateProperties(m),d.properties=P({},m),d._preloadCache.inputSettings||(d._preloadCache.inputSettings={}),m.inputSettings&&m.inputSettings.audio&&(d._preloadCache.inputSettings.audio=m.inputSettings.audio),m.inputSettings&&m.inputSettings.video&&(d._preloadCache.inputSettings.video=m.inputSettings.video),d._callObjectLoader=d._callObjectMode?new ul(d.callClientId):null,d._callState=qi,d._isPreparingToJoin=!1,d._accessState={access:Cn},d._meetingSessionSummary={},d._finalSummaryOfPrevSession={},d._meetingSessionState=Ln(ms,d._callObjectMode),d._nativeInCallAudioMode=fs,d._participants={},d._isScreenSharing=!1,d._participantCounts=gs,d._rmpPlayerState={},d._waitingParticipants={},d._network={threshold:"good",quality:100},d._activeSpeaker={},d._localAudioLevel=0,d._isLocalAudioLevelObserverRunning=!1,d._remoteParticipantsAudioLevel={},d._isRemoteParticipantsAudioLevelObserverRunning=!1,d._messageChannel=N()?new al:new sl,d._iframe&&(d._iframe.requestFullscreen?d._iframe.addEventListener("fullscreenchange",function(){document.fullscreenElement===d._iframe?(d.emitDailyJSEvent({action:qt}),d.sendMessageToCallMachine({action:qt})):(d.emitDailyJSEvent({action:Jt}),d.sendMessageToCallMachine({action:Jt}))}):d._iframe.webkitRequestFullscreen&&d._iframe.addEventListener("webkitfullscreenchange",function(){document.webkitFullscreenElement===d._iframe?(d.emitDailyJSEvent({action:qt}),d.sendMessageToCallMachine({action:qt})):(d.emitDailyJSEvent({action:Jt}),d.sendMessageToCallMachine({action:Jt}))})),N()){var w=d.nativeUtils();w.addAudioFocusChangeListener&&w.removeAudioFocusChangeListener&&w.addAppStateChangeListener&&w.removeAppStateChangeListener&&w.addSystemScreenCaptureStopListener&&w.removeSystemScreenCaptureStopListener||console.warn("expected (add|remove)(AudioFocusChange|AppActiveStateChange|SystemScreenCaptureStop)Listener to be available in React Native"),d._hasNativeAudioFocus=!0,w.addAudioFocusChangeListener(d.handleNativeAudioFocusChange),w.addAppStateChangeListener(d.handleNativeAppStateChange),w.addSystemScreenCaptureStopListener(d.handleNativeSystemScreenCaptureStop)}return d._callObjectMode&&d.startListeningForDeviceChanges(),d._messageChannel.addListenerForMessagesFromCallMachine(d.handleMessageFromCallMachine,d.callClientId,Se(d)),d}return fe(ne,[{key:"destroy",value:($r=O(function*(){var o,u;try{yield this.leave()}catch{}var d=this._iframe;if(d){var g=d.parentElement;g&&g.removeChild(d)}if(this._messageChannel.removeListener(this.handleMessageFromCallMachine),N()){var m=this.nativeUtils();m.removeAudioFocusChangeListener(this.handleNativeAudioFocusChange),m.removeAppStateChangeListener(this.handleNativeAppStateChange),m.removeSystemScreenCaptureStopListener(this.handleNativeSystemScreenCaptureStop)}this._callObjectMode&&this.stopListeningForDeviceChanges(),this.resetMeetingDependentVars(),this._destroyed=!0,this.emitDailyJSEvent({action:"call-instance-destroyed"}),delete Be[this.callClientId],!((o=window)===null||o===void 0||(u=o._daily)===null||u===void 0)&&u.instances&&delete window._daily.instances[this.callClientId],this.strictMode&&(this.callClientId=void 0)}),function(){return $r.apply(this,arguments)})},{key:"isDestroyed",value:function(){return!!this._destroyed}},{key:"loadCss",value:function(o){var u=o.bodyClass,d=o.cssFile,g=o.cssText;return x(),this.sendMessageToCallMachine({action:"load-css",cssFile:this.absoluteUrl(d),bodyClass:u,cssText:g}),this}},{key:"iframe",value:function(){return x(),this._iframe}},{key:"meetingState",value:function(){return this._callState}},{key:"accessState",value:function(){return ce(this._callObjectMode,"accessState()"),this._accessState}},{key:"participants",value:function(){return this._participants}},{key:"participantCounts",value:function(){return this._participantCounts}},{key:"waitingParticipants",value:function(){return ce(this._callObjectMode,"waitingParticipants()"),this._waitingParticipants}},{key:"validateParticipantProperties",value:function(o,u){for(var d in u){if(!Gt[d])throw new Error("unrecognized updateParticipant property ".concat(d));if(Gt[d].validate&&!Gt[d].validate(u[d],this,this._participants[o]))throw new Error(Gt[d].help)}}},{key:"updateParticipant",value:function(o,u){return this._participants.local&&this._participants.local.session_id===o&&(o="local"),o&&u&&(this.validateParticipantProperties(o,u),this.sendMessageToCallMachine({action:"update-participant",id:o,properties:u})),this}},{key:"updateParticipants",value:function(o){var u=this._participants.local&&this._participants.local.session_id;for(var d in o)d===u&&(d="local"),d&&o[d]&&this.validateParticipantProperties(d,o[d]);return this.sendMessageToCallMachine({action:"update-participants",participants:o}),this}},{key:"updateWaitingParticipant",value:(Vr=O(function*(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(ce(this._callObjectMode,"updateWaitingParticipant()"),q(this._callState,"updateWaitingParticipant()"),typeof u!="string"||U(d)!=="object")throw new Error("updateWaitingParticipant() must take an id string and a updates object");return new Promise(function(g,m){o.sendMessageToCallMachine({action:"daily-method-update-waiting-participant",id:u,updates:d},function(w){w.error&&m(w.error),w.id||m(new Error("unknown error in updateWaitingParticipant()")),g({id:w.id})})})}),function(){return Vr.apply(this,arguments)})},{key:"updateWaitingParticipants",value:(Jr=O(function*(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ce(this._callObjectMode,"updateWaitingParticipants()"),q(this._callState,"updateWaitingParticipants()"),U(u)!=="object")throw new Error("updateWaitingParticipants() must take a mapping between ids and update objects");return new Promise(function(d,g){o.sendMessageToCallMachine({action:"daily-method-update-waiting-participants",updatesById:u},function(m){m.error&&g(m.error),m.ids||g(new Error("unknown error in updateWaitingParticipants()")),d({ids:m.ids})})})}),function(){return Jr.apply(this,arguments)})},{key:"requestAccess",value:(qr=O(function*(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},d=u.access,g=d===void 0?{level:ec}:d,m=u.name,w=m===void 0?"":m;return ce(this._callObjectMode,"requestAccess()"),q(this._callState,"requestAccess()"),new Promise(function(E,C){o.sendMessageToCallMachine({action:"daily-method-request-access",access:g,name:w},function(D){D.error&&C(D.error),D.access||C(new Error("unknown error in requestAccess()")),E({access:D.access,granted:D.granted})})})}),function(){return qr.apply(this,arguments)})},{key:"localAudio",value:function(){return this._participants.local?!["blocked","off"].includes(this._participants.local.tracks.audio.state):null}},{key:"localVideo",value:function(){return this._participants.local?!["blocked","off"].includes(this._participants.local.tracks.video.state):null}},{key:"setLocalAudio",value:function(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return"forceDiscardTrack"in u&&(N()?(console.warn("forceDiscardTrack option not supported in React Native; ignoring"),u={}):o&&(console.warn("forceDiscardTrack option only supported when calling setLocalAudio(false); ignoring"),u={})),this.sendMessageToCallMachine({action:"local-audio",state:o,options:u}),this}},{key:"localScreenAudio",value:function(){return this._participants.local?!["blocked","off"].includes(this._participants.local.tracks.screenAudio.state):null}},{key:"localScreenVideo",value:function(){return this._participants.local?!["blocked","off"].includes(this._participants.local.tracks.screenVideo.state):null}},{key:"updateScreenShare",value:function(o){if(this._isScreenSharing)return this.sendMessageToCallMachine({action:"local-screen-update",options:o}),this;console.warn("There is no screen share in progress. Try calling startScreenShare first.")}},{key:"setLocalVideo",value:function(o){return this.sendMessageToCallMachine({action:"local-video",state:o}),this}},{key:"getReceiveSettings",value:(Ur=O(function*(o){var u=this,d=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).showInheritedValues,g=d!==void 0&&d;if(ce(this._callObjectMode,"getReceiveSettings()"),!this._callMachineInitialized)return this._receiveSettings;switch(U(o)){case"string":return new Promise(function(m){u.sendMessageToCallMachine({action:"get-single-participant-receive-settings",id:o,showInheritedValues:g},function(w){m(w.receiveSettings)})});case"undefined":return this._receiveSettings;default:throw new Error('first argument to getReceiveSettings() must be a participant id (or "base"), or there should be no arguments')}}),function(o){return Ur.apply(this,arguments)})},{key:"updateReceiveSettings",value:(Fr=O(function*(o){var u=this;if(ce(this._callObjectMode,"updateReceiveSettings()"),!yo(o,{allowAllParticipantsKey:!0}))throw new Error(wo({allowAllParticipantsKey:!0}));return q(this._callState,"updateReceiveSettings()","To specify receive settings earlier, use the receiveSettings config property."),new Promise(function(d){u.sendMessageToCallMachine({action:"update-receive-settings",receiveSettings:o},function(g){d({receiveSettings:g.receiveSettings})})})}),function(o){return Fr.apply(this,arguments)})},{key:"_prepInputSettingsToPresentToUser",value:function(o){var u,d,g,m,w,E,C,D;if(o){var H={},G=((u=o.audio)===null||u===void 0||(d=u.processor)===null||d===void 0?void 0:d.type)==="none"&&((g=o.audio)===null||g===void 0||(m=g.processor)===null||m===void 0?void 0:m._isDefaultWhenNone);if(o.audio&&!G){var be=P({},o.audio.processor);delete be._isDefaultWhenNone,H.audio=P(P({},o.audio),{},{processor:be})}var Te=((w=o.video)===null||w===void 0||(E=w.processor)===null||E===void 0?void 0:E.type)==="none"&&((C=o.video)===null||C===void 0||(D=C.processor)===null||D===void 0?void 0:D._isDefaultWhenNone);if(o.video&&!Te){var we=P({},o.video.processor);delete we._isDefaultWhenNone,H.video=P(P({},o.video),{},{processor:we})}return H}}},{key:"getInputSettings",value:function(){var o=this;return x(),new Promise(function(u){u(o._getInputSettings())})}},{key:"_getInputSettings",value:function(){var o,u,d,g,m,w,E,C,D={processor:{type:"none",_isDefaultWhenNone:!0}};this._inputSettings?(o=((d=this._inputSettings)===null||d===void 0?void 0:d.video)||D,u=((g=this._inputSettings)===null||g===void 0?void 0:g.audio)||D):(o=((m=this._preloadCache)===null||m===void 0||(w=m.inputSettings)===null||w===void 0?void 0:w.video)||D,u=((E=this._preloadCache)===null||E===void 0||(C=E.inputSettings)===null||C===void 0?void 0:C.audio)||D);var H={audio:u,video:o};return this._prepInputSettingsToPresentToUser(H)}},{key:"updateInputSettings",value:(Br=O(function*(o){var u=this;return x(),_o(o)?(o&&(this._preloadCache.inputSettings||(this._preloadCache.inputSettings={}),bo(o,this.properties.dailyConfig),o.audio&&(this._preloadCache.inputSettings.audio=o.audio),o.video&&(this._preloadCache.inputSettings.video=o.video)),o.video||o.audio?this._callObjectMode&&!this._callMachineInitialized?this._getInputSettings():new Promise(function(d,g){u.sendMessageToCallMachine({action:"update-input-settings",inputSettings:o},function(m){m.error?g(m.error):d({inputSettings:u._prepInputSettingsToPresentToUser(m.inputSettings)})})}):this._getInputSettings()):(console.error(or()),Promise.reject(or()))}),function(o){return Br.apply(this,arguments)})},{key:"setBandwidth",value:function(o){var u=o.kbs,d=o.trackConstraints;if(x(),this._callMachineInitialized)return this.sendMessageToCallMachine({action:"set-bandwidth",kbs:u,trackConstraints:d}),this}},{key:"getDailyLang",value:function(){var o=this;if(x(),this._callMachineInitialized)return new Promise(function(u){o.sendMessageToCallMachine({action:"get-daily-lang"},function(d){delete d.action,delete d.callbackStamp,u(d)})})}},{key:"setDailyLang",value:function(o){return x(),this.sendMessageToCallMachine({action:"set-daily-lang",lang:o}),this}},{key:"setProxyUrl",value:function(o){return this.sendMessageToCallMachine({action:"set-proxy-url",proxyUrl:o}),this}},{key:"setIceConfig",value:function(o){return this.sendMessageToCallMachine({action:"set-ice-config",iceConfig:o}),this}},{key:"meetingSessionSummary",value:function(){return[Ie,Ce].includes(this._callState)?this._finalSummaryOfPrevSession:this._meetingSessionSummary}},{key:"getMeetingSession",value:(Ir=O(function*(){var o=this;return console.warn("getMeetingSession() is deprecated: use meetingSessionSummary(), which will return immediately"),q(this._callState,"getMeetingSession()"),new Promise(function(u){o.sendMessageToCallMachine({action:"get-meeting-session"},function(d){delete d.action,delete d.callbackStamp,u(d)})})}),function(){return Ir.apply(this,arguments)})},{key:"meetingSessionState",value:function(){return q(this._callState,"meetingSessionState"),this._meetingSessionState}},{key:"setMeetingSessionData",value:function(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"replace";ce(this._callObjectMode,"setMeetingSessionData()"),q(this._callState,"setMeetingSessionData");try{(function(d,g){new cl({data:d,mergeStrategy:g})})(o,u)}catch(d){throw console.error(d),d}try{this.sendMessageToCallMachine({action:"set-session-data",data:o,mergeStrategy:u})}catch(d){throw new Error("Error setting meeting session data: ".concat(d))}}},{key:"setUserName",value:function(o,u){var d=this;return this.properties.userName=o,new Promise(function(g){d.sendMessageToCallMachine({action:"set-user-name",name:o??"",thisMeetingOnly:N()||!!u&&!!u.thisMeetingOnly},function(m){delete m.action,delete m.callbackStamp,g(m)})})}},{key:"setUserData",value:(jr=O(function*(o){var u=this;try{vo(o)}catch(d){throw console.error(d),d}if(this.properties.userData=o,this._callMachineInitialized)return new Promise(function(d){try{u.sendMessageToCallMachine({action:"set-user-data",userData:o},function(g){delete g.action,delete g.callbackStamp,d(g)})}catch(g){throw new Error("Error setting user data: ".concat(g))}})}),function(o){return jr.apply(this,arguments)})},{key:"validateAudioLevelInterval",value:function(o){if(o&&(o<100||typeof o!="number"))throw new Error("The interval must be a number greater than or equal to 100 milliseconds.")}},{key:"startLocalAudioLevelObserver",value:function(o){var u=this;if(typeof AudioWorkletNode>"u"&&!N())throw new Error("startLocalAudioLevelObserver() is not supported on this browser");if(this.validateAudioLevelInterval(o),this._callMachineInitialized)return this._isLocalAudioLevelObserverRunning=!0,new Promise(function(d,g){u.sendMessageToCallMachine({action:"start-local-audio-level-observer",interval:o},function(m){u._isLocalAudioLevelObserverRunning=!m.error,m.error?g({error:m.error}):d()})});this._preloadCache.localAudioLevelObserver={enabled:!0,interval:o}}},{key:"isLocalAudioLevelObserverRunning",value:function(){return this._isLocalAudioLevelObserverRunning}},{key:"stopLocalAudioLevelObserver",value:function(){this._preloadCache.localAudioLevelObserver=null,this._localAudioLevel=0,this._isLocalAudioLevelObserverRunning=!1,this.sendMessageToCallMachine({action:"stop-local-audio-level-observer"})}},{key:"startRemoteParticipantsAudioLevelObserver",value:function(o){var u=this;if(this.validateAudioLevelInterval(o),this._callMachineInitialized)return this._isRemoteParticipantsAudioLevelObserverRunning=!0,new Promise(function(d,g){u.sendMessageToCallMachine({action:"start-remote-participants-audio-level-observer",interval:o},function(m){u._isRemoteParticipantsAudioLevelObserverRunning=!m.error,m.error?g({error:m.error}):d()})});this._preloadCache.remoteParticipantsAudioLevelObserver={enabled:!0,interval:o}}},{key:"isRemoteParticipantsAudioLevelObserverRunning",value:function(){return this._isRemoteParticipantsAudioLevelObserverRunning}},{key:"stopRemoteParticipantsAudioLevelObserver",value:function(){this._preloadCache.remoteParticipantsAudioLevelObserver=null,this._remoteParticipantsAudioLevel={},this._isRemoteParticipantsAudioLevelObserverRunning=!1,this.sendMessageToCallMachine({action:"stop-remote-participants-audio-level-observer"})}},{key:"startCamera",value:(Nr=O(function*(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ce(this._callObjectMode,"startCamera()"),Dn(this._callState,this._isPreparingToJoin,"startCamera()","Did you mean to use setLocalAudio() and/or setLocalVideo() instead?"),this.needsLoad())try{yield this.load(u)}catch(d){return Promise.reject(d)}else{if(this._didPreAuth){if(u.url&&u.url!==this.properties.url)return console.error("url in startCamera() is different than the one used in preAuth()"),Promise.reject();if(u.token&&u.token!==this.properties.token)return console.error("token in startCamera() is different than the one used in preAuth()"),Promise.reject()}this.validateProperties(u),this.properties=P(P({},this.properties),u)}return new Promise(function(d){o.sendMessageToCallMachine({action:"start-camera",properties:Ke(o.properties,o.callClientId),preloadCache:Ke(o._preloadCache,o.callClientId)},function(g){delete g.action,delete g.callbackStamp,d(g)})})}),function(){return Nr.apply(this,arguments)})},{key:"validateCustomTrack",value:function(o,u,d){if(d&&d.length>50)throw new Error("Custom track `trackName` must not be more than 50 characters");if(u&&u!=="music"&&u!=="speech"&&!(u instanceof Object))throw new Error("Custom track `mode` must be either `music` | `speech` | `DailyMicAudioModeSettings` or `undefined`");if(d&&["cam-audio","cam-video","screen-video","screen-audio","rmpAudio","rmpVideo","customVideoDefaults"].includes(d))throw new Error("Custom track `trackName` must not match a track name already used by daily: cam-audio, cam-video, customVideoDefaults, screen-video, screen-audio, rmpAudio, rmpVideo");if(!(o instanceof MediaStreamTrack))throw new Error("Custom tracks provided must be instances of MediaStreamTrack")}},{key:"startCustomTrack",value:function(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{track,mode,trackName};return x(),q(this._callState,"startCustomTrack()"),this.validateCustomTrack(u.track,u.mode,u.trackName),new Promise(function(d,g){o._sharedTracks.customTrack=u.track,u.track=yt,o.sendMessageToCallMachine({action:"start-custom-track",properties:u},function(m){m.error?g({error:m.error}):d(m.mediaTag)})})}},{key:"stopCustomTrack",value:function(o){var u=this;return x(),q(this._callState,"stopCustomTrack()"),new Promise(function(d){u.sendMessageToCallMachine({action:"stop-custom-track",mediaTag:o},function(g){d(g.mediaTag)})})}},{key:"setCamera",value:function(o){var u=this;return mt(),zt(this._callMachineInitialized,"setCamera()"),new Promise(function(d){u.sendMessageToCallMachine({action:"set-camera",cameraDeviceId:o},function(g){d({device:g.device})})})}},{key:"setAudioDevice",value:(Lr=O(function*(o){return mt(),this.nativeUtils().setAudioDevice(o),{deviceId:yield this.nativeUtils().getAudioDevice()}}),function(o){return Lr.apply(this,arguments)})},{key:"cycleCamera",value:function(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new Promise(function(d){o.sendMessageToCallMachine({action:"cycle-camera",properties:u},function(g){d({device:g.device})})})}},{key:"cycleMic",value:function(){var o=this;return x(),new Promise(function(u){o.sendMessageToCallMachine({action:"cycle-mic"},function(d){u({device:d.device})})})}},{key:"getCameraFacingMode",value:function(){var o=this;return mt(),new Promise(function(u){o.sendMessageToCallMachine({action:"get-camera-facing-mode"},function(d){u(d.facingMode)})})}},{key:"setInputDevicesAsync",value:(xr=O(function*(o){var u=this,d=o.audioDeviceId,g=o.videoDeviceId,m=o.audioSource,w=o.videoSource;return x(),m!==void 0&&(d=m),w!==void 0&&(g=w),d&&(this._preloadCache.audioDeviceId=d,this._sharedTracks.audioDeviceId=d),g&&(this._preloadCache.videoDeviceId=g,this._sharedTracks.videoDeviceId=g),this._callObjectMode&&this.needsLoad()?{camera:{deviceId:this._preloadCache.videoDeviceId},mic:{deviceId:this._preloadCache.audioDeviceId},speaker:{deviceId:this._preloadCache.outputDeviceId}}:(d instanceof MediaStreamTrack&&(d=yt),g instanceof MediaStreamTrack&&(g=yt),new Promise(function(E){u.sendMessageToCallMachine({action:"set-input-devices",audioDeviceId:d,videoDeviceId:g},function(C){delete C.action,delete C.callbackStamp,C.returnPreloadCache?E({camera:{deviceId:u._preloadCache.videoDeviceId},mic:{deviceId:u._preloadCache.audioDeviceId},speaker:{deviceId:u._preloadCache.outputDeviceId}}):E(C)})}))}),function(o){return xr.apply(this,arguments)})},{key:"setOutputDeviceAsync",value:(Dr=O(function*(o){var u=this,d=o.outputDeviceId;return x(),d&&(this._preloadCache.outputDeviceId=d),this._callObjectMode&&this.needsLoad()?{camera:{deviceId:this._preloadCache.videoDeviceId},mic:{deviceId:this._preloadCache.audioDeviceId},speaker:{deviceId:this._preloadCache.outputDeviceId}}:new Promise(function(g){u.sendMessageToCallMachine({action:"set-output-device",outputDeviceId:d},function(m){delete m.action,delete m.callbackStamp,m.returnPreloadCache?g({camera:{deviceId:u._preloadCache.videoDeviceId},mic:{deviceId:u._preloadCache.audioDeviceId},speaker:{deviceId:u._preloadCache.outputDeviceId}}):g(m)})})}),function(o){return Dr.apply(this,arguments)})},{key:"getInputDevices",value:(Rr=O(function*(){var o=this;return this._callObjectMode&&this.needsLoad()?{camera:{deviceId:this._preloadCache.videoDeviceId},mic:{deviceId:this._preloadCache.audioDeviceId},speaker:{deviceId:this._preloadCache.outputDeviceId}}:new Promise(function(u){o.sendMessageToCallMachine({action:"get-input-devices"},function(d){delete d.action,delete d.callbackStamp,d.returnPreloadCache?u({camera:{deviceId:o._preloadCache.videoDeviceId},mic:{deviceId:o._preloadCache.audioDeviceId},speaker:{deviceId:o._preloadCache.outputDeviceId}}):u(d)})})}),function(){return Rr.apply(this,arguments)})},{key:"nativeInCallAudioMode",value:function(){return mt(),this._nativeInCallAudioMode}},{key:"setNativeInCallAudioMode",value:function(o){if(mt(),[fs,Pl].includes(o)){if(o!==this._nativeInCallAudioMode)return this._nativeInCallAudioMode=o,!this.disableReactNativeAutoDeviceManagement("audio")&&Wt(this._callState,this._isPreparingToJoin)&&this.nativeUtils().setAudioMode(this._nativeInCallAudioMode),this}else console.error("invalid in-call audio mode specified: ",o)}},{key:"preAuth",value:(ht=O(function*(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ce(this._callObjectMode,"preAuth()"),Dn(this._callState,this._isPreparingToJoin,"preAuth()"),this.needsLoad()&&(yield this.load(u)),!u.url)throw new Error("preAuth() requires at least a url to be provided");return this.validateProperties(u),this.properties=P(P({},this.properties),u),new Promise(function(d,g){o.sendMessageToCallMachine({action:"daily-method-preauth",properties:Ke(o.properties,o.callClientId),preloadCache:Ke(o._preloadCache,o.callClientId)},function(m){return m.error?g(m.error):m.access?(o._didPreAuth=!0,void d({access:m.access})):g(new Error("unknown error in preAuth()"))})})}),function(){return ht.apply(this,arguments)})},{key:"load",value:(_e=O(function*(o){var u=this;if(this.needsLoad()){if(this._destroyed&&(this._logUseAfterDestroy(),this.strictMode))throw new Error("Use after destroy");if(o&&(this.validateProperties(o),this.properties=P(P({},this.properties),o)),!this._callObjectMode&&!this.properties.url)throw new Error("can't load iframe meeting because url property isn't set");return this._updateCallState(Ji),this.emitDailyJSEvent({action:oc}),this._callObjectMode?new Promise(function(d,g){u._callObjectLoader.cancel();var m=Date.now();u._callObjectLoader.load(u.properties.dailyConfig,function(w){u._bundleLoadTime=w?"no-op":Date.now()-m,u._updateCallState(Vi),w&&u.emitDailyJSEvent({action:$i}),d()},function(w,E){if(u.emitDailyJSEvent({action:ac}),!E){u._updateCallState(Ce),u.resetMeetingDependentVars();var C={action:Yi,errorMsg:w.msg,error:{type:"connection-error",msg:"Failed to load call object bundle.",details:{on:"load",sourceError:w,bundleUrl:Xt(u.properties.dailyConfig)}}};u._maybeSendToSentry(C),u.emitDailyJSEvent(C),g(w.msg)}})}):(this._iframe.src=Us(this.assembleMeetingUrl(),this.properties.dailyConfig),new Promise(function(d,g){u._loadedCallback=function(m){u._callState!==Ce?(u._updateCallState(Vi),(u.properties.cssFile||u.properties.cssText)&&u.loadCss(u.properties),d()):g(m)}}))}}),function(o){return _e.apply(this,arguments)})},{key:"join",value:(oe=O(function*(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this._testCallInProgress&&this.stopTestCallQuality();var d=!1;if(this.needsLoad()){this.updateIsPreparingToJoin(!0);try{yield this.load(u)}catch(g){return this.updateIsPreparingToJoin(!1),Promise.reject(g)}}else{if(d=!(!this.properties.cssFile&&!this.properties.cssText),this._didPreAuth){if(u.url&&u.url!==this.properties.url)return console.error("url in join() is different than the one used in preAuth()"),this.updateIsPreparingToJoin(!1),Promise.reject();if(u.token&&u.token!==this.properties.token)return console.error("token in join() is different than the one used in preAuth()"),this.updateIsPreparingToJoin(!1),Promise.reject()}if(u.url&&!this._callObjectMode&&u.url&&u.url!==this.properties.url)return console.error("url in join() is different than the one used in load() (".concat(this.properties.url," -> ").concat(u.url,")")),this.updateIsPreparingToJoin(!1),Promise.reject();this.validateProperties(u),this.properties=P(P({},this.properties),u)}return u.showLocalVideo!==void 0&&(this._callObjectMode?console.error("showLocalVideo is not available in callObject mode"):this._showLocalVideo=!!u.showLocalVideo),u.showParticipantsBar!==void 0&&(this._callObjectMode?console.error("showParticipantsBar is not available in callObject mode"):this._showParticipantsBar=!!u.showParticipantsBar),this._callState===Qe||this._callState===Qn?(console.warn("already joined meeting, call leave() before joining again"),void this.updateIsPreparingToJoin(!1)):(this._updateCallState(Qn,!1),this.emitDailyJSEvent({action:uc}),this._preloadCache.inputSettings||(this._preloadCache.inputSettings={}),u.inputSettings&&u.inputSettings.audio&&(this._preloadCache.inputSettings.audio=u.inputSettings.audio),u.inputSettings&&u.inputSettings.video&&(this._preloadCache.inputSettings.video=u.inputSettings.video),this.sendMessageToCallMachine({action:"join-meeting",properties:Ke(this.properties,this.callClientId),preloadCache:Ke(this._preloadCache,this.callClientId)}),new Promise(function(g,m){o._joinedCallback=function(w,E){if(o._callState!==Ce){if(o._updateCallState(Qe),w)for(var C in w){if(o._callObjectMode){var D=o._callMachine().store;os(w[C],D),as(w[C],D),cs(w[C],o._participants[C],D)}o._participants[C]=P({},w[C]),o.toggleParticipantAudioBasedOnNativeAudioFocus()}d&&o.loadCss(o.properties),g(w)}else m(E)}}))}),function(){return oe.apply(this,arguments)})},{key:"leave",value:(Ne=O(function*(){var o=this;return this._testCallInProgress&&this.stopTestCallQuality(),new Promise(function(u){o._callState===Ie||o._callState===Ce?u():o._callObjectLoader&&!o._callObjectLoader.loaded?(o._callObjectLoader.cancel(),o._updateCallState(Ie),o.resetMeetingDependentVars(),o.emitDailyJSEvent({action:Ie}),u()):(o._resolveLeave=u,o.sendMessageToCallMachine({action:"leave-meeting"}))})}),function(){return Ne.apply(this,arguments)})},{key:"startScreenShare",value:(te=O(function*(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(zt(this._callMachineInitialized,"startScreenShare()"),u.screenVideoSendSettings&&this._validateVideoSendSettings("screenVideo",u.screenVideoSendSettings),u.mediaStream&&(this._sharedTracks.screenMediaStream=u.mediaStream,u.mediaStream=yt),typeof DailyNativeUtils<"u"&&DailyNativeUtils.isIOS!==void 0&&DailyNativeUtils.isIOS){var d=this.nativeUtils();if(yield d.isScreenBeingCaptured())return void this.emitDailyJSEvent({action:Hi,type:"screen-share-error",errorMsg:"Could not start the screen sharing. The screen is already been captured!"});d.setSystemScreenCaptureStartCallback(function(){d.setSystemScreenCaptureStartCallback(null),o.sendMessageToCallMachine({action:Ki,captureOptions:u})}),d.presentSystemScreenCapturePrompt()}else this.sendMessageToCallMachine({action:Ki,captureOptions:u})}),function(){return te.apply(this,arguments)})},{key:"stopScreenShare",value:function(){zt(this._callMachineInitialized,"stopScreenShare()"),this.sendMessageToCallMachine({action:"local-screen-stop"})}},{key:"startRecording",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(P({action:"local-recording-start"},o))}},{key:"updateRecording",value:function(o){var u=o.layout,d=u===void 0?{preset:"default"}:u,g=o.instanceId;this.sendMessageToCallMachine({action:"daily-method-update-recording",layout:d,instanceId:g})}},{key:"stopRecording",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(P({action:"local-recording-stop"},o))}},{key:"startLiveStreaming",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(P({action:"daily-method-start-live-streaming"},o))}},{key:"updateLiveStreaming",value:function(o){var u=o.layout,d=u===void 0?{preset:"default"}:u,g=o.instanceId;this.sendMessageToCallMachine({action:"daily-method-update-live-streaming",layout:d,instanceId:g})}},{key:"addLiveStreamingEndpoints",value:function(o){var u=o.endpoints,d=o.instanceId;this.sendMessageToCallMachine({action:Qi,endpointsOp:Zc,endpoints:u,instanceId:d})}},{key:"removeLiveStreamingEndpoints",value:function(o){var u=o.endpoints,d=o.instanceId;this.sendMessageToCallMachine({action:Qi,endpointsOp:el,endpoints:u,instanceId:d})}},{key:"stopLiveStreaming",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(P({action:"daily-method-stop-live-streaming"},o))}},{key:"validateDailyConfig",value:function(o){o.camSimulcastEncodings&&(console.warn("camSimulcastEncodings is deprecated. Use sendSettings, found in DailyCallOptions, to provide camera simulcast settings."),this.validateSimulcastEncodings(o.camSimulcastEncodings)),o.screenSimulcastEncodings&&console.warn("screenSimulcastEncodings is deprecated. Use sendSettings, found in DailyCallOptions, to provide screen simulcast settings."),he().match(/Linux; Android/)&&o.noAutoDefaultDeviceChange&&console.warn("noAutoDefaultDeviceChange is not supported on Android, and will be ignored.")}},{key:"validateSimulcastEncodings",value:function(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,d=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(o){if(!(o instanceof Array||Array.isArray(o)))throw new Error("encodings must be an Array");if(!ws(o.length,1,3))throw new Error("encodings must be an Array with between 1 to ".concat(3," layers"));for(var g=0;g<o.length;g++){var m=o[g];for(var w in this._validateEncodingLayerHasValidProperties(m),m)if(Rn.includes(w)){if(typeof m[w]!="number")throw new Error("".concat(w," must be a number"));if(u){var E=u[w],C=E.min,D=E.max;if(!ws(m[w],C,D))throw new Error("".concat(w," value not in range. valid range: ").concat(C," to ").concat(D))}}else if(!["active","scalabilityMode"].includes(w))throw new Error("Invalid key ".concat(w,", valid keys are:")+Object.values(Rn));if(d&&!m.hasOwnProperty("maxBitrate"))throw new Error("maxBitrate is not specified")}}}},{key:"startRemoteMediaPlayer",value:(L=O(function*(o){var u=this,d=o.url,g=o.settings,m=g===void 0?{state:Xn.PLAY}:g;try{(function(w){if(typeof w!="string")throw new Error('url parameter must be "string" type')})(d),bs(m),function(w){for(var E in w)if(!vs.includes(E))throw new Error("Invalid key ".concat(E,", valid keys are: ").concat(vs));w.simulcastEncodings&&this.validateSimulcastEncodings(w.simulcastEncodings,go,!0)}(m)}catch(w){throw console.error("invalid argument Error: ".concat(w)),console.error(`startRemoteMediaPlayer arguments must be of the form:
|
|
26
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,a=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var l=n.next();return a=l.done,l},e:function(l){c=!0,s=l},f:function(){try{a||n.return==null||n.return()}finally{if(c)throw s}}}}function ps(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Be={},fs="video",Pl="voice",ms=N()?{data:{}}:{data:{},topology:"none"},gs={present:0,hidden:0},go={maxBitrate:{min:1e5,max:25e5},maxFramerate:{min:1,max:30},scaleResolutionDownBy:{min:1,max:8}},Rn=Object.keys(go),vs=["state","volume","simulcastEncodings"],ys={androidInCallNotification:{title:"string",subtitle:"string",iconName:"string",disableForCustomOverride:"boolean"},disableAutoDeviceManagement:{audio:"boolean",video:"boolean"}},on={id:{iconPath:"string",iconPathDarkMode:"string",label:"string",tooltip:"string"}},sr={id:{allow:"string",controlledBy:"'*' | 'owners' | string[]",csp:"string",iconURL:"string",label:"string",loading:"'eager' | 'lazy'",location:"'main' | 'sidebar'",name:"string",referrerPolicy:"string",sandbox:"string",src:"string",srcdoc:"string",shared:"string[] | 'owners' | boolean"}},Fe={customIntegrations:{validate:Eo,help:So()},customTrayButtons:{validate:ko,help:"customTrayButtons should be a dictionary of the type ".concat(JSON.stringify(on))},url:{validate:function(t){return typeof t=="string"},help:"url should be a string"},baseUrl:{validate:function(t){return typeof t=="string"},help:"baseUrl should be a string"},token:{validate:function(t){return typeof t=="string"},help:"token should be a string",queryString:"t"},dailyConfig:{validate:function(t,e){try{return e.validateDailyConfig(t),!0}catch(n){console.error("Failed to validate dailyConfig",n)}return!1},help:"Unsupported dailyConfig. Check error logs for detailed info."},reactNativeConfig:{validate:function(t){return To(t,ys)},help:"reactNativeConfig should look like ".concat(JSON.stringify(ys),", all fields optional")},lang:{validate:function(t){return["de","en-us","en","es","fi","fr","it","jp","ka","nl","no","pl","pt","pt-BR","ru","sv","tr","user"].includes(t)},help:"language not supported. Options are: de, en-us, en, es, fi, fr, it, jp, ka, nl, no, pl, pt, pt-BR, ru, sv, tr, user"},userName:!0,userData:{validate:function(t){try{return vo(t),!0}catch(e){return console.error(e),!1}},help:"invalid userData type provided"},startVideoOff:!0,startAudioOff:!0,activeSpeakerMode:!0,showLeaveButton:!0,showLocalVideo:!0,showParticipantsBar:!0,showFullscreenButton:!0,showUserNameChangeUI:!0,iframeStyle:!0,customLayout:!0,cssFile:!0,cssText:!0,bodyClass:!0,videoSource:{validate:function(t,e){return t instanceof MediaStreamTrack&&(e._sharedTracks.videoDeviceId=t),e._preloadCache.videoDeviceId=t,!0}},audioSource:{validate:function(t,e){return t instanceof MediaStreamTrack&&(e._sharedTracks.audioDeviceId=t),e._preloadCache.audioDeviceId=t,!0}},subscribeToTracksAutomatically:{validate:function(t,e){return e._preloadCache.subscribeToTracksAutomatically=t,!0}},theme:{validate:function(t){var e=["accent","accentText","background","backgroundAccent","baseText","border","mainAreaBg","mainAreaBgAccent","mainAreaText","supportiveText"],n=function(r){for(var i=0,s=Object.keys(r);i<s.length;i++){var a=s[i];if(!e.includes(a))return console.error('unsupported color "'.concat(a,'". Valid colors: ').concat(e.join(", "))),!1;if(!r[a].match(/^#[0-9a-f]{6}|#[0-9a-f]{3}$/i))return console.error("".concat(a,' theme color should be provided in valid hex color format. Received: "').concat(r[a],'"')),!1}return!0};return U(t)==="object"&&("light"in t&&"dark"in t||"colors"in t)?"light"in t&&"dark"in t?"colors"in t.light?"colors"in t.dark?n(t.light.colors)&&n(t.dark.colors):(console.error('Dark theme is missing "colors" property.',t),!1):(console.error('Light theme is missing "colors" property.',t),!1):n(t.colors):(console.error('Theme must contain either both "light" and "dark" properties, or "colors".',t),!1)},help:"unsupported theme configuration. Check error logs for detailed info."},layoutConfig:{validate:function(t){if("grid"in t){var e=t.grid;if("maxTilesPerPage"in e){if(!Number.isInteger(e.maxTilesPerPage))return console.error("grid.maxTilesPerPage should be an integer. You passed ".concat(e.maxTilesPerPage,".")),!1;if(e.maxTilesPerPage>49)return console.error("grid.maxTilesPerPage can't be larger than 49 without sacrificing browser performance. Please contact us at https://www.daily.co/contact to talk about your use case."),!1}if("minTilesPerPage"in e){if(!Number.isInteger(e.minTilesPerPage))return console.error("grid.minTilesPerPage should be an integer. You passed ".concat(e.minTilesPerPage,".")),!1;if(e.minTilesPerPage<1)return console.error("grid.minTilesPerPage can't be lower than 1."),!1;if("maxTilesPerPage"in e&&e.minTilesPerPage>e.maxTilesPerPage)return console.error("grid.minTilesPerPage can't be higher than grid.maxTilesPerPage."),!1}}return!0},help:"unsupported layoutConfig. Check error logs for detailed info."},receiveSettings:{validate:function(t){return yo(t,{allowAllParticipantsKey:!1})},help:wo({allowAllParticipantsKey:!1})},sendSettings:{validate:function(t,e){return!!function(n,r){try{return r.validateUpdateSendSettings(n),!0}catch(i){return console.error("Failed to validate send settings",i),!1}}(t,e)&&(e._preloadCache.sendSettings=t,!0)},help:"Invalid sendSettings provided. Check error logs for detailed info."},inputSettings:{validate:function(t,e){var n;return!!_o(t)&&(e._preloadCache.inputSettings||(e._preloadCache.inputSettings={}),bo(t,(n=e.properties)===null||n===void 0?void 0:n.dailyConfig),t.audio&&(e._preloadCache.inputSettings.audio=t.audio),t.video&&(e._preloadCache.inputSettings.video=t.video),!0)},help:or()},layout:{validate:function(t){return t==="custom-v1"||t==="browser"||t==="none"},help:'layout may only be set to "custom-v1"',queryString:"layout"},emb:{queryString:"emb"},embHref:{queryString:"embHref"},dailyJsVersion:{queryString:"dailyJsVersion"},proxy:{queryString:"proxy"},strictMode:!0,allowMultipleCallInstances:!0},Gt={styles:{validate:function(t){for(var e in t)if(e!=="cam"&&e!=="screen")return!1;if(t.cam){for(var n in t.cam)if(n!=="div"&&n!=="video")return!1}if(t.screen){for(var r in t.screen)if(r!=="div"&&r!=="video")return!1}return!0},help:"styles format should be a subset of: { cam: {div: {}, video: {}}, screen: {div: {}, video: {}} }"},setSubscribedTracks:{validate:function(t,e){if(e._preloadCache.subscribeToTracksAutomatically)return!1;var n=[!0,!1,"staged"];if(n.includes(t)||!N()&&t==="avatar")return!0;var r=["audio","video","screenAudio","screenVideo","rmpAudio","rmpVideo"];return function i(s){var a=arguments.length>1&&arguments[1]!==void 0&&arguments[1];for(var c in s)if(c==="custom"){if(!n.includes(s[c])&&!i(s[c],!0))return!1}else{var l=!a&&!r.includes(c),p=!n.includes(s[c]);if(l||p)return!1}return!0}(t)},help:"setSubscribedTracks cannot be used when setSubscribeToTracksAutomatically is enabled, and should be of the form: "+"true".concat(N()?"":" | 'avatar'"," | false | 'staged' | { [audio: true|false|'staged'], [video: true|false|'staged'], [screenAudio: true|false|'staged'], [screenVideo: true|false|'staged'] }")},setAudio:!0,setVideo:!0,setScreenShare:{validate:function(t){return t===!1},help:"setScreenShare must be false, as it's only meant for stopping remote participants' screen shares"},eject:!0,updatePermissions:{validate:function(t){for(var e=0,n=Object.entries(t);e<n.length;e++){var r=$e(n[e],2),i=r[0],s=r[1];switch(i){case"hasPresence":if(typeof s!="boolean")return!1;break;case"canSend":if(s instanceof Set||s instanceof Array||Array.isArray(s)){var a,c=["video","audio","screenVideo","screenAudio","customVideo","customAudio"],l=hs(s);try{for(l.s();!(a=l.n()).done;){var p=a.value;if(!c.includes(p))return!1}}catch(v){l.e(v)}finally{l.f()}}else if(typeof s!="boolean")return!1;(s instanceof Array||Array.isArray(s))&&(t.canSend=new Set(s));break;case"canAdmin":if(s instanceof Set||s instanceof Array||Array.isArray(s)){var h,f=["participants","streaming","transcription"],_=hs(s);try{for(_.s();!(h=_.n()).done;){var k=h.value;if(!f.includes(k))return!1}}catch(v){_.e(v)}finally{_.f()}}else if(typeof s!="boolean")return!1;(s instanceof Array||Array.isArray(s))&&(t.canAdmin=new Set(s));break;default:return!1}}return!0},help:"updatePermissions can take hasPresence, canSend, and canAdmin permissions. hasPresence must be a boolean. canSend can be a boolean or an Array or Set of media types (video, audio, screenVideo, screenAudio, customVideo, customAudio). canAdmin can be a boolean or an Array or Set of admin types (participants, streaming, transcription)."}};Promise.any||(Promise.any=function(){var t=O(function*(e){return new Promise(function(n,r){var i=[];e.forEach(function(s){return Promise.resolve(s).then(function(a){n(a)}).catch(function(a){i.push(a),i.length===e.length&&r(i)})})})});return function(e){return t.apply(this,arguments)}}());var Al=function(t){ln(re,Ee);var e,n,r,i,s,a,c,l,p,h,f,_,k,v,b,T,M,B,L,ne,Ne,oe,_e,ht,Rr,Dr,xr,Lr,Nr,jr,Ir,Br,Fr,Ur,qr,Jr,Vr,$r,Qo=Ol(re);function re(o){var u,d,g,m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(pe(this,re),Pe(Se(d=Qo.call(this)),"startListeningForDeviceChanges",function(){Sl(d.handleDeviceChange)}),Pe(Se(d),"stopListeningForDeviceChanges",function(){kl(d.handleDeviceChange)}),Pe(Se(d),"handleDeviceChange",function(E){E=E.map(function(C){return JSON.parse(JSON.stringify(C))}),d.emitDailyJSEvent({action:"available-devices-updated",availableDevices:E})}),Pe(Se(d),"handleNativeAppStateChange",function(){var E=O(function*(C){if(C==="destroyed")return console.warn("App has been destroyed before leaving the meeting. Cleaning up all the resources!"),void(yield d.destroy());var D=C==="active";d.disableReactNativeAutoDeviceManagement("video")||(D?d.camUnmutedBeforeLosingNativeActiveState&&d.setLocalVideo(!0):(d.camUnmutedBeforeLosingNativeActiveState=d.localVideo(),d.camUnmutedBeforeLosingNativeActiveState&&d.setLocalVideo(!1)))});return function(C){return E.apply(this,arguments)}}()),Pe(Se(d),"handleNativeAudioFocusChange",function(E){d.disableReactNativeAutoDeviceManagement("audio")||(d._hasNativeAudioFocus=E,d.toggleParticipantAudioBasedOnNativeAudioFocus(),d._hasNativeAudioFocus?d.micUnmutedBeforeLosingNativeAudioFocus&&d.setLocalAudio(!0):(d.micUnmutedBeforeLosingNativeAudioFocus=d.localAudio(),d.setLocalAudio(!1)))}),Pe(Se(d),"handleNativeSystemScreenCaptureStop",function(){d.stopScreenShare()}),d.strictMode=m.strictMode===void 0||m.strictMode,d.allowMultipleCallInstances=(u=m.allowMultipleCallInstances)!==null&&u!==void 0&&u,Object.keys(Be).length&&(d._logDuplicateInstanceAttempt(),!d.allowMultipleCallInstances)){if(d.strictMode)throw new Error("Duplicate DailyIframe instances are not allowed");console.warn("Using strictMode: false to allow multiple call instances is now deprecated. Set `allowMultipleCallInstances: true`")}if(window._daily||(window._daily={pendings:[],instances:{}}),d.callClientId=dn(),g=Se(d),Be[g.callClientId]=g,window._daily.instances[d.callClientId]={},d._sharedTracks={},window._daily.instances[d.callClientId].tracks=d._sharedTracks,m.dailyJsVersion=re.version(),d._iframe=o,d._callObjectMode=m.layout==="none"&&!d._iframe,d._preloadCache={subscribeToTracksAutomatically:!0,audioDeviceId:null,videoDeviceId:null,outputDeviceId:null,inputSettings:null,sendSettings:null,videoTrackForNetworkConnectivityTest:null,videoTrackForConnectionQualityTest:null},m.showLocalVideo!==void 0?d._callObjectMode?console.error("showLocalVideo is not available in call object mode"):d._showLocalVideo=!!m.showLocalVideo:d._showLocalVideo=!0,m.showParticipantsBar!==void 0?d._callObjectMode?console.error("showParticipantsBar is not available in call object mode"):d._showParticipantsBar=!!m.showParticipantsBar:d._showParticipantsBar=!0,m.customIntegrations!==void 0?d._callObjectMode?console.error("customIntegrations is not available in call object mode"):d._customIntegrations=m.customIntegrations:d._customIntegrations={},m.customTrayButtons!==void 0?d._callObjectMode?console.error("customTrayButtons is not available in call object mode"):d._customTrayButtons=m.customTrayButtons:d._customTrayButtons={},m.activeSpeakerMode!==void 0?d._callObjectMode?console.error("activeSpeakerMode is not available in call object mode"):d._activeSpeakerMode=!!m.activeSpeakerMode:d._activeSpeakerMode=!1,m.receiveSettings?d._callObjectMode?d._receiveSettings=m.receiveSettings:console.error("receiveSettings is only available in call object mode"):d._receiveSettings={},d.validateProperties(m),d.properties=P({},m),d._preloadCache.inputSettings||(d._preloadCache.inputSettings={}),m.inputSettings&&m.inputSettings.audio&&(d._preloadCache.inputSettings.audio=m.inputSettings.audio),m.inputSettings&&m.inputSettings.video&&(d._preloadCache.inputSettings.video=m.inputSettings.video),d._callObjectLoader=d._callObjectMode?new ul(d.callClientId):null,d._callState=qi,d._isPreparingToJoin=!1,d._accessState={access:Cn},d._meetingSessionSummary={},d._finalSummaryOfPrevSession={},d._meetingSessionState=Ln(ms,d._callObjectMode),d._nativeInCallAudioMode=fs,d._participants={},d._isScreenSharing=!1,d._participantCounts=gs,d._rmpPlayerState={},d._waitingParticipants={},d._network={threshold:"good",quality:100},d._activeSpeaker={},d._localAudioLevel=0,d._isLocalAudioLevelObserverRunning=!1,d._remoteParticipantsAudioLevel={},d._isRemoteParticipantsAudioLevelObserverRunning=!1,d._messageChannel=N()?new al:new sl,d._iframe&&(d._iframe.requestFullscreen?d._iframe.addEventListener("fullscreenchange",function(){document.fullscreenElement===d._iframe?(d.emitDailyJSEvent({action:qt}),d.sendMessageToCallMachine({action:qt})):(d.emitDailyJSEvent({action:Jt}),d.sendMessageToCallMachine({action:Jt}))}):d._iframe.webkitRequestFullscreen&&d._iframe.addEventListener("webkitfullscreenchange",function(){document.webkitFullscreenElement===d._iframe?(d.emitDailyJSEvent({action:qt}),d.sendMessageToCallMachine({action:qt})):(d.emitDailyJSEvent({action:Jt}),d.sendMessageToCallMachine({action:Jt}))})),N()){var w=d.nativeUtils();w.addAudioFocusChangeListener&&w.removeAudioFocusChangeListener&&w.addAppStateChangeListener&&w.removeAppStateChangeListener&&w.addSystemScreenCaptureStopListener&&w.removeSystemScreenCaptureStopListener||console.warn("expected (add|remove)(AudioFocusChange|AppActiveStateChange|SystemScreenCaptureStop)Listener to be available in React Native"),d._hasNativeAudioFocus=!0,w.addAudioFocusChangeListener(d.handleNativeAudioFocusChange),w.addAppStateChangeListener(d.handleNativeAppStateChange),w.addSystemScreenCaptureStopListener(d.handleNativeSystemScreenCaptureStop)}return d._callObjectMode&&d.startListeningForDeviceChanges(),d._messageChannel.addListenerForMessagesFromCallMachine(d.handleMessageFromCallMachine,d.callClientId,Se(d)),d}return fe(re,[{key:"destroy",value:($r=O(function*(){var o,u;try{yield this.leave()}catch{}var d=this._iframe;if(d){var g=d.parentElement;g&&g.removeChild(d)}if(this._messageChannel.removeListener(this.handleMessageFromCallMachine),N()){var m=this.nativeUtils();m.removeAudioFocusChangeListener(this.handleNativeAudioFocusChange),m.removeAppStateChangeListener(this.handleNativeAppStateChange),m.removeSystemScreenCaptureStopListener(this.handleNativeSystemScreenCaptureStop)}this._callObjectMode&&this.stopListeningForDeviceChanges(),this.resetMeetingDependentVars(),this._destroyed=!0,this.emitDailyJSEvent({action:"call-instance-destroyed"}),delete Be[this.callClientId],!((o=window)===null||o===void 0||(u=o._daily)===null||u===void 0)&&u.instances&&delete window._daily.instances[this.callClientId],this.strictMode&&(this.callClientId=void 0)}),function(){return $r.apply(this,arguments)})},{key:"isDestroyed",value:function(){return!!this._destroyed}},{key:"loadCss",value:function(o){var u=o.bodyClass,d=o.cssFile,g=o.cssText;return x(),this.sendMessageToCallMachine({action:"load-css",cssFile:this.absoluteUrl(d),bodyClass:u,cssText:g}),this}},{key:"iframe",value:function(){return x(),this._iframe}},{key:"meetingState",value:function(){return this._callState}},{key:"accessState",value:function(){return ce(this._callObjectMode,"accessState()"),this._accessState}},{key:"participants",value:function(){return this._participants}},{key:"participantCounts",value:function(){return this._participantCounts}},{key:"waitingParticipants",value:function(){return ce(this._callObjectMode,"waitingParticipants()"),this._waitingParticipants}},{key:"validateParticipantProperties",value:function(o,u){for(var d in u){if(!Gt[d])throw new Error("unrecognized updateParticipant property ".concat(d));if(Gt[d].validate&&!Gt[d].validate(u[d],this,this._participants[o]))throw new Error(Gt[d].help)}}},{key:"updateParticipant",value:function(o,u){return this._participants.local&&this._participants.local.session_id===o&&(o="local"),o&&u&&(this.validateParticipantProperties(o,u),this.sendMessageToCallMachine({action:"update-participant",id:o,properties:u})),this}},{key:"updateParticipants",value:function(o){var u=this._participants.local&&this._participants.local.session_id;for(var d in o)d===u&&(d="local"),d&&o[d]&&this.validateParticipantProperties(d,o[d]);return this.sendMessageToCallMachine({action:"update-participants",participants:o}),this}},{key:"updateWaitingParticipant",value:(Vr=O(function*(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(ce(this._callObjectMode,"updateWaitingParticipant()"),q(this._callState,"updateWaitingParticipant()"),typeof u!="string"||U(d)!=="object")throw new Error("updateWaitingParticipant() must take an id string and a updates object");return new Promise(function(g,m){o.sendMessageToCallMachine({action:"daily-method-update-waiting-participant",id:u,updates:d},function(w){w.error&&m(w.error),w.id||m(new Error("unknown error in updateWaitingParticipant()")),g({id:w.id})})})}),function(){return Vr.apply(this,arguments)})},{key:"updateWaitingParticipants",value:(Jr=O(function*(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ce(this._callObjectMode,"updateWaitingParticipants()"),q(this._callState,"updateWaitingParticipants()"),U(u)!=="object")throw new Error("updateWaitingParticipants() must take a mapping between ids and update objects");return new Promise(function(d,g){o.sendMessageToCallMachine({action:"daily-method-update-waiting-participants",updatesById:u},function(m){m.error&&g(m.error),m.ids||g(new Error("unknown error in updateWaitingParticipants()")),d({ids:m.ids})})})}),function(){return Jr.apply(this,arguments)})},{key:"requestAccess",value:(qr=O(function*(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},d=u.access,g=d===void 0?{level:ec}:d,m=u.name,w=m===void 0?"":m;return ce(this._callObjectMode,"requestAccess()"),q(this._callState,"requestAccess()"),new Promise(function(E,C){o.sendMessageToCallMachine({action:"daily-method-request-access",access:g,name:w},function(D){D.error&&C(D.error),D.access||C(new Error("unknown error in requestAccess()")),E({access:D.access,granted:D.granted})})})}),function(){return qr.apply(this,arguments)})},{key:"localAudio",value:function(){return this._participants.local?!["blocked","off"].includes(this._participants.local.tracks.audio.state):null}},{key:"localVideo",value:function(){return this._participants.local?!["blocked","off"].includes(this._participants.local.tracks.video.state):null}},{key:"setLocalAudio",value:function(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return"forceDiscardTrack"in u&&(N()?(console.warn("forceDiscardTrack option not supported in React Native; ignoring"),u={}):o&&(console.warn("forceDiscardTrack option only supported when calling setLocalAudio(false); ignoring"),u={})),this.sendMessageToCallMachine({action:"local-audio",state:o,options:u}),this}},{key:"localScreenAudio",value:function(){return this._participants.local?!["blocked","off"].includes(this._participants.local.tracks.screenAudio.state):null}},{key:"localScreenVideo",value:function(){return this._participants.local?!["blocked","off"].includes(this._participants.local.tracks.screenVideo.state):null}},{key:"updateScreenShare",value:function(o){if(this._isScreenSharing)return this.sendMessageToCallMachine({action:"local-screen-update",options:o}),this;console.warn("There is no screen share in progress. Try calling startScreenShare first.")}},{key:"setLocalVideo",value:function(o){return this.sendMessageToCallMachine({action:"local-video",state:o}),this}},{key:"getReceiveSettings",value:(Ur=O(function*(o){var u=this,d=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).showInheritedValues,g=d!==void 0&&d;if(ce(this._callObjectMode,"getReceiveSettings()"),!this._callMachineInitialized)return this._receiveSettings;switch(U(o)){case"string":return new Promise(function(m){u.sendMessageToCallMachine({action:"get-single-participant-receive-settings",id:o,showInheritedValues:g},function(w){m(w.receiveSettings)})});case"undefined":return this._receiveSettings;default:throw new Error('first argument to getReceiveSettings() must be a participant id (or "base"), or there should be no arguments')}}),function(o){return Ur.apply(this,arguments)})},{key:"updateReceiveSettings",value:(Fr=O(function*(o){var u=this;if(ce(this._callObjectMode,"updateReceiveSettings()"),!yo(o,{allowAllParticipantsKey:!0}))throw new Error(wo({allowAllParticipantsKey:!0}));return q(this._callState,"updateReceiveSettings()","To specify receive settings earlier, use the receiveSettings config property."),new Promise(function(d){u.sendMessageToCallMachine({action:"update-receive-settings",receiveSettings:o},function(g){d({receiveSettings:g.receiveSettings})})})}),function(o){return Fr.apply(this,arguments)})},{key:"_prepInputSettingsToPresentToUser",value:function(o){var u,d,g,m,w,E,C,D;if(o){var H={},G=((u=o.audio)===null||u===void 0||(d=u.processor)===null||d===void 0?void 0:d.type)==="none"&&((g=o.audio)===null||g===void 0||(m=g.processor)===null||m===void 0?void 0:m._isDefaultWhenNone);if(o.audio&&!G){var be=P({},o.audio.processor);delete be._isDefaultWhenNone,H.audio=P(P({},o.audio),{},{processor:be})}var Te=((w=o.video)===null||w===void 0||(E=w.processor)===null||E===void 0?void 0:E.type)==="none"&&((C=o.video)===null||C===void 0||(D=C.processor)===null||D===void 0?void 0:D._isDefaultWhenNone);if(o.video&&!Te){var we=P({},o.video.processor);delete we._isDefaultWhenNone,H.video=P(P({},o.video),{},{processor:we})}return H}}},{key:"getInputSettings",value:function(){var o=this;return x(),new Promise(function(u){u(o._getInputSettings())})}},{key:"_getInputSettings",value:function(){var o,u,d,g,m,w,E,C,D={processor:{type:"none",_isDefaultWhenNone:!0}};this._inputSettings?(o=((d=this._inputSettings)===null||d===void 0?void 0:d.video)||D,u=((g=this._inputSettings)===null||g===void 0?void 0:g.audio)||D):(o=((m=this._preloadCache)===null||m===void 0||(w=m.inputSettings)===null||w===void 0?void 0:w.video)||D,u=((E=this._preloadCache)===null||E===void 0||(C=E.inputSettings)===null||C===void 0?void 0:C.audio)||D);var H={audio:u,video:o};return this._prepInputSettingsToPresentToUser(H)}},{key:"updateInputSettings",value:(Br=O(function*(o){var u=this;return x(),_o(o)?(o&&(this._preloadCache.inputSettings||(this._preloadCache.inputSettings={}),bo(o,this.properties.dailyConfig),o.audio&&(this._preloadCache.inputSettings.audio=o.audio),o.video&&(this._preloadCache.inputSettings.video=o.video)),o.video||o.audio?this._callObjectMode&&!this._callMachineInitialized?this._getInputSettings():new Promise(function(d,g){u.sendMessageToCallMachine({action:"update-input-settings",inputSettings:o},function(m){m.error?g(m.error):d({inputSettings:u._prepInputSettingsToPresentToUser(m.inputSettings)})})}):this._getInputSettings()):(console.error(or()),Promise.reject(or()))}),function(o){return Br.apply(this,arguments)})},{key:"setBandwidth",value:function(o){var u=o.kbs,d=o.trackConstraints;if(x(),this._callMachineInitialized)return this.sendMessageToCallMachine({action:"set-bandwidth",kbs:u,trackConstraints:d}),this}},{key:"getDailyLang",value:function(){var o=this;if(x(),this._callMachineInitialized)return new Promise(function(u){o.sendMessageToCallMachine({action:"get-daily-lang"},function(d){delete d.action,delete d.callbackStamp,u(d)})})}},{key:"setDailyLang",value:function(o){return x(),this.sendMessageToCallMachine({action:"set-daily-lang",lang:o}),this}},{key:"setProxyUrl",value:function(o){return this.sendMessageToCallMachine({action:"set-proxy-url",proxyUrl:o}),this}},{key:"setIceConfig",value:function(o){return this.sendMessageToCallMachine({action:"set-ice-config",iceConfig:o}),this}},{key:"meetingSessionSummary",value:function(){return[Ie,Ce].includes(this._callState)?this._finalSummaryOfPrevSession:this._meetingSessionSummary}},{key:"getMeetingSession",value:(Ir=O(function*(){var o=this;return console.warn("getMeetingSession() is deprecated: use meetingSessionSummary(), which will return immediately"),q(this._callState,"getMeetingSession()"),new Promise(function(u){o.sendMessageToCallMachine({action:"get-meeting-session"},function(d){delete d.action,delete d.callbackStamp,u(d)})})}),function(){return Ir.apply(this,arguments)})},{key:"meetingSessionState",value:function(){return q(this._callState,"meetingSessionState"),this._meetingSessionState}},{key:"setMeetingSessionData",value:function(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"replace";ce(this._callObjectMode,"setMeetingSessionData()"),q(this._callState,"setMeetingSessionData");try{(function(d,g){new cl({data:d,mergeStrategy:g})})(o,u)}catch(d){throw console.error(d),d}try{this.sendMessageToCallMachine({action:"set-session-data",data:o,mergeStrategy:u})}catch(d){throw new Error("Error setting meeting session data: ".concat(d))}}},{key:"setUserName",value:function(o,u){var d=this;return this.properties.userName=o,new Promise(function(g){d.sendMessageToCallMachine({action:"set-user-name",name:o??"",thisMeetingOnly:N()||!!u&&!!u.thisMeetingOnly},function(m){delete m.action,delete m.callbackStamp,g(m)})})}},{key:"setUserData",value:(jr=O(function*(o){var u=this;try{vo(o)}catch(d){throw console.error(d),d}if(this.properties.userData=o,this._callMachineInitialized)return new Promise(function(d){try{u.sendMessageToCallMachine({action:"set-user-data",userData:o},function(g){delete g.action,delete g.callbackStamp,d(g)})}catch(g){throw new Error("Error setting user data: ".concat(g))}})}),function(o){return jr.apply(this,arguments)})},{key:"validateAudioLevelInterval",value:function(o){if(o&&(o<100||typeof o!="number"))throw new Error("The interval must be a number greater than or equal to 100 milliseconds.")}},{key:"startLocalAudioLevelObserver",value:function(o){var u=this;if(typeof AudioWorkletNode>"u"&&!N())throw new Error("startLocalAudioLevelObserver() is not supported on this browser");if(this.validateAudioLevelInterval(o),this._callMachineInitialized)return this._isLocalAudioLevelObserverRunning=!0,new Promise(function(d,g){u.sendMessageToCallMachine({action:"start-local-audio-level-observer",interval:o},function(m){u._isLocalAudioLevelObserverRunning=!m.error,m.error?g({error:m.error}):d()})});this._preloadCache.localAudioLevelObserver={enabled:!0,interval:o}}},{key:"isLocalAudioLevelObserverRunning",value:function(){return this._isLocalAudioLevelObserverRunning}},{key:"stopLocalAudioLevelObserver",value:function(){this._preloadCache.localAudioLevelObserver=null,this._localAudioLevel=0,this._isLocalAudioLevelObserverRunning=!1,this.sendMessageToCallMachine({action:"stop-local-audio-level-observer"})}},{key:"startRemoteParticipantsAudioLevelObserver",value:function(o){var u=this;if(this.validateAudioLevelInterval(o),this._callMachineInitialized)return this._isRemoteParticipantsAudioLevelObserverRunning=!0,new Promise(function(d,g){u.sendMessageToCallMachine({action:"start-remote-participants-audio-level-observer",interval:o},function(m){u._isRemoteParticipantsAudioLevelObserverRunning=!m.error,m.error?g({error:m.error}):d()})});this._preloadCache.remoteParticipantsAudioLevelObserver={enabled:!0,interval:o}}},{key:"isRemoteParticipantsAudioLevelObserverRunning",value:function(){return this._isRemoteParticipantsAudioLevelObserverRunning}},{key:"stopRemoteParticipantsAudioLevelObserver",value:function(){this._preloadCache.remoteParticipantsAudioLevelObserver=null,this._remoteParticipantsAudioLevel={},this._isRemoteParticipantsAudioLevelObserverRunning=!1,this.sendMessageToCallMachine({action:"stop-remote-participants-audio-level-observer"})}},{key:"startCamera",value:(Nr=O(function*(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ce(this._callObjectMode,"startCamera()"),Dn(this._callState,this._isPreparingToJoin,"startCamera()","Did you mean to use setLocalAudio() and/or setLocalVideo() instead?"),this.needsLoad())try{yield this.load(u)}catch(d){return Promise.reject(d)}else{if(this._didPreAuth){if(u.url&&u.url!==this.properties.url)return console.error("url in startCamera() is different than the one used in preAuth()"),Promise.reject();if(u.token&&u.token!==this.properties.token)return console.error("token in startCamera() is different than the one used in preAuth()"),Promise.reject()}this.validateProperties(u),this.properties=P(P({},this.properties),u)}return new Promise(function(d){o.sendMessageToCallMachine({action:"start-camera",properties:Ke(o.properties,o.callClientId),preloadCache:Ke(o._preloadCache,o.callClientId)},function(g){delete g.action,delete g.callbackStamp,d(g)})})}),function(){return Nr.apply(this,arguments)})},{key:"validateCustomTrack",value:function(o,u,d){if(d&&d.length>50)throw new Error("Custom track `trackName` must not be more than 50 characters");if(u&&u!=="music"&&u!=="speech"&&!(u instanceof Object))throw new Error("Custom track `mode` must be either `music` | `speech` | `DailyMicAudioModeSettings` or `undefined`");if(d&&["cam-audio","cam-video","screen-video","screen-audio","rmpAudio","rmpVideo","customVideoDefaults"].includes(d))throw new Error("Custom track `trackName` must not match a track name already used by daily: cam-audio, cam-video, customVideoDefaults, screen-video, screen-audio, rmpAudio, rmpVideo");if(!(o instanceof MediaStreamTrack))throw new Error("Custom tracks provided must be instances of MediaStreamTrack")}},{key:"startCustomTrack",value:function(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{track,mode,trackName};return x(),q(this._callState,"startCustomTrack()"),this.validateCustomTrack(u.track,u.mode,u.trackName),new Promise(function(d,g){o._sharedTracks.customTrack=u.track,u.track=yt,o.sendMessageToCallMachine({action:"start-custom-track",properties:u},function(m){m.error?g({error:m.error}):d(m.mediaTag)})})}},{key:"stopCustomTrack",value:function(o){var u=this;return x(),q(this._callState,"stopCustomTrack()"),new Promise(function(d){u.sendMessageToCallMachine({action:"stop-custom-track",mediaTag:o},function(g){d(g.mediaTag)})})}},{key:"setCamera",value:function(o){var u=this;return mt(),zt(this._callMachineInitialized,"setCamera()"),new Promise(function(d){u.sendMessageToCallMachine({action:"set-camera",cameraDeviceId:o},function(g){d({device:g.device})})})}},{key:"setAudioDevice",value:(Lr=O(function*(o){return mt(),this.nativeUtils().setAudioDevice(o),{deviceId:yield this.nativeUtils().getAudioDevice()}}),function(o){return Lr.apply(this,arguments)})},{key:"cycleCamera",value:function(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new Promise(function(d){o.sendMessageToCallMachine({action:"cycle-camera",properties:u},function(g){d({device:g.device})})})}},{key:"cycleMic",value:function(){var o=this;return x(),new Promise(function(u){o.sendMessageToCallMachine({action:"cycle-mic"},function(d){u({device:d.device})})})}},{key:"getCameraFacingMode",value:function(){var o=this;return mt(),new Promise(function(u){o.sendMessageToCallMachine({action:"get-camera-facing-mode"},function(d){u(d.facingMode)})})}},{key:"setInputDevicesAsync",value:(xr=O(function*(o){var u=this,d=o.audioDeviceId,g=o.videoDeviceId,m=o.audioSource,w=o.videoSource;return x(),m!==void 0&&(d=m),w!==void 0&&(g=w),d&&(this._preloadCache.audioDeviceId=d,this._sharedTracks.audioDeviceId=d),g&&(this._preloadCache.videoDeviceId=g,this._sharedTracks.videoDeviceId=g),this._callObjectMode&&this.needsLoad()?{camera:{deviceId:this._preloadCache.videoDeviceId},mic:{deviceId:this._preloadCache.audioDeviceId},speaker:{deviceId:this._preloadCache.outputDeviceId}}:(d instanceof MediaStreamTrack&&(d=yt),g instanceof MediaStreamTrack&&(g=yt),new Promise(function(E){u.sendMessageToCallMachine({action:"set-input-devices",audioDeviceId:d,videoDeviceId:g},function(C){delete C.action,delete C.callbackStamp,C.returnPreloadCache?E({camera:{deviceId:u._preloadCache.videoDeviceId},mic:{deviceId:u._preloadCache.audioDeviceId},speaker:{deviceId:u._preloadCache.outputDeviceId}}):E(C)})}))}),function(o){return xr.apply(this,arguments)})},{key:"setOutputDeviceAsync",value:(Dr=O(function*(o){var u=this,d=o.outputDeviceId;return x(),d&&(this._preloadCache.outputDeviceId=d),this._callObjectMode&&this.needsLoad()?{camera:{deviceId:this._preloadCache.videoDeviceId},mic:{deviceId:this._preloadCache.audioDeviceId},speaker:{deviceId:this._preloadCache.outputDeviceId}}:new Promise(function(g){u.sendMessageToCallMachine({action:"set-output-device",outputDeviceId:d},function(m){delete m.action,delete m.callbackStamp,m.returnPreloadCache?g({camera:{deviceId:u._preloadCache.videoDeviceId},mic:{deviceId:u._preloadCache.audioDeviceId},speaker:{deviceId:u._preloadCache.outputDeviceId}}):g(m)})})}),function(o){return Dr.apply(this,arguments)})},{key:"getInputDevices",value:(Rr=O(function*(){var o=this;return this._callObjectMode&&this.needsLoad()?{camera:{deviceId:this._preloadCache.videoDeviceId},mic:{deviceId:this._preloadCache.audioDeviceId},speaker:{deviceId:this._preloadCache.outputDeviceId}}:new Promise(function(u){o.sendMessageToCallMachine({action:"get-input-devices"},function(d){delete d.action,delete d.callbackStamp,d.returnPreloadCache?u({camera:{deviceId:o._preloadCache.videoDeviceId},mic:{deviceId:o._preloadCache.audioDeviceId},speaker:{deviceId:o._preloadCache.outputDeviceId}}):u(d)})})}),function(){return Rr.apply(this,arguments)})},{key:"nativeInCallAudioMode",value:function(){return mt(),this._nativeInCallAudioMode}},{key:"setNativeInCallAudioMode",value:function(o){if(mt(),[fs,Pl].includes(o)){if(o!==this._nativeInCallAudioMode)return this._nativeInCallAudioMode=o,!this.disableReactNativeAutoDeviceManagement("audio")&&Wt(this._callState,this._isPreparingToJoin)&&this.nativeUtils().setAudioMode(this._nativeInCallAudioMode),this}else console.error("invalid in-call audio mode specified: ",o)}},{key:"preAuth",value:(ht=O(function*(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ce(this._callObjectMode,"preAuth()"),Dn(this._callState,this._isPreparingToJoin,"preAuth()"),this.needsLoad()&&(yield this.load(u)),!u.url)throw new Error("preAuth() requires at least a url to be provided");return this.validateProperties(u),this.properties=P(P({},this.properties),u),new Promise(function(d,g){o.sendMessageToCallMachine({action:"daily-method-preauth",properties:Ke(o.properties,o.callClientId),preloadCache:Ke(o._preloadCache,o.callClientId)},function(m){return m.error?g(m.error):m.access?(o._didPreAuth=!0,void d({access:m.access})):g(new Error("unknown error in preAuth()"))})})}),function(){return ht.apply(this,arguments)})},{key:"load",value:(_e=O(function*(o){var u=this;if(this.needsLoad()){if(this._destroyed&&(this._logUseAfterDestroy(),this.strictMode))throw new Error("Use after destroy");if(o&&(this.validateProperties(o),this.properties=P(P({},this.properties),o)),!this._callObjectMode&&!this.properties.url)throw new Error("can't load iframe meeting because url property isn't set");return this._updateCallState(Ji),this.emitDailyJSEvent({action:oc}),this._callObjectMode?new Promise(function(d,g){u._callObjectLoader.cancel();var m=Date.now();u._callObjectLoader.load(u.properties.dailyConfig,function(w){u._bundleLoadTime=w?"no-op":Date.now()-m,u._updateCallState(Vi),w&&u.emitDailyJSEvent({action:$i}),d()},function(w,E){if(u.emitDailyJSEvent({action:ac}),!E){u._updateCallState(Ce),u.resetMeetingDependentVars();var C={action:Yi,errorMsg:w.msg,error:{type:"connection-error",msg:"Failed to load call object bundle.",details:{on:"load",sourceError:w,bundleUrl:Xt(u.properties.dailyConfig)}}};u._maybeSendToSentry(C),u.emitDailyJSEvent(C),g(w.msg)}})}):(this._iframe.src=Us(this.assembleMeetingUrl(),this.properties.dailyConfig),new Promise(function(d,g){u._loadedCallback=function(m){u._callState!==Ce?(u._updateCallState(Vi),(u.properties.cssFile||u.properties.cssText)&&u.loadCss(u.properties),d()):g(m)}}))}}),function(o){return _e.apply(this,arguments)})},{key:"join",value:(oe=O(function*(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this._testCallInProgress&&this.stopTestCallQuality();var d=!1;if(this.needsLoad()){this.updateIsPreparingToJoin(!0);try{yield this.load(u)}catch(g){return this.updateIsPreparingToJoin(!1),Promise.reject(g)}}else{if(d=!(!this.properties.cssFile&&!this.properties.cssText),this._didPreAuth){if(u.url&&u.url!==this.properties.url)return console.error("url in join() is different than the one used in preAuth()"),this.updateIsPreparingToJoin(!1),Promise.reject();if(u.token&&u.token!==this.properties.token)return console.error("token in join() is different than the one used in preAuth()"),this.updateIsPreparingToJoin(!1),Promise.reject()}if(u.url&&!this._callObjectMode&&u.url&&u.url!==this.properties.url)return console.error("url in join() is different than the one used in load() (".concat(this.properties.url," -> ").concat(u.url,")")),this.updateIsPreparingToJoin(!1),Promise.reject();this.validateProperties(u),this.properties=P(P({},this.properties),u)}return u.showLocalVideo!==void 0&&(this._callObjectMode?console.error("showLocalVideo is not available in callObject mode"):this._showLocalVideo=!!u.showLocalVideo),u.showParticipantsBar!==void 0&&(this._callObjectMode?console.error("showParticipantsBar is not available in callObject mode"):this._showParticipantsBar=!!u.showParticipantsBar),this._callState===Qe||this._callState===Qn?(console.warn("already joined meeting, call leave() before joining again"),void this.updateIsPreparingToJoin(!1)):(this._updateCallState(Qn,!1),this.emitDailyJSEvent({action:uc}),this._preloadCache.inputSettings||(this._preloadCache.inputSettings={}),u.inputSettings&&u.inputSettings.audio&&(this._preloadCache.inputSettings.audio=u.inputSettings.audio),u.inputSettings&&u.inputSettings.video&&(this._preloadCache.inputSettings.video=u.inputSettings.video),this.sendMessageToCallMachine({action:"join-meeting",properties:Ke(this.properties,this.callClientId),preloadCache:Ke(this._preloadCache,this.callClientId)}),new Promise(function(g,m){o._joinedCallback=function(w,E){if(o._callState!==Ce){if(o._updateCallState(Qe),w)for(var C in w){if(o._callObjectMode){var D=o._callMachine().store;os(w[C],D),as(w[C],D),cs(w[C],o._participants[C],D)}o._participants[C]=P({},w[C]),o.toggleParticipantAudioBasedOnNativeAudioFocus()}d&&o.loadCss(o.properties),g(w)}else m(E)}}))}),function(){return oe.apply(this,arguments)})},{key:"leave",value:(Ne=O(function*(){var o=this;return this._testCallInProgress&&this.stopTestCallQuality(),new Promise(function(u){o._callState===Ie||o._callState===Ce?u():o._callObjectLoader&&!o._callObjectLoader.loaded?(o._callObjectLoader.cancel(),o._updateCallState(Ie),o.resetMeetingDependentVars(),o.emitDailyJSEvent({action:Ie}),u()):(o._resolveLeave=u,o.sendMessageToCallMachine({action:"leave-meeting"}))})}),function(){return Ne.apply(this,arguments)})},{key:"startScreenShare",value:(ne=O(function*(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(zt(this._callMachineInitialized,"startScreenShare()"),u.screenVideoSendSettings&&this._validateVideoSendSettings("screenVideo",u.screenVideoSendSettings),u.mediaStream&&(this._sharedTracks.screenMediaStream=u.mediaStream,u.mediaStream=yt),typeof DailyNativeUtils<"u"&&DailyNativeUtils.isIOS!==void 0&&DailyNativeUtils.isIOS){var d=this.nativeUtils();if(yield d.isScreenBeingCaptured())return void this.emitDailyJSEvent({action:Hi,type:"screen-share-error",errorMsg:"Could not start the screen sharing. The screen is already been captured!"});d.setSystemScreenCaptureStartCallback(function(){d.setSystemScreenCaptureStartCallback(null),o.sendMessageToCallMachine({action:Ki,captureOptions:u})}),d.presentSystemScreenCapturePrompt()}else this.sendMessageToCallMachine({action:Ki,captureOptions:u})}),function(){return ne.apply(this,arguments)})},{key:"stopScreenShare",value:function(){zt(this._callMachineInitialized,"stopScreenShare()"),this.sendMessageToCallMachine({action:"local-screen-stop"})}},{key:"startRecording",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(P({action:"local-recording-start"},o))}},{key:"updateRecording",value:function(o){var u=o.layout,d=u===void 0?{preset:"default"}:u,g=o.instanceId;this.sendMessageToCallMachine({action:"daily-method-update-recording",layout:d,instanceId:g})}},{key:"stopRecording",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(P({action:"local-recording-stop"},o))}},{key:"startLiveStreaming",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(P({action:"daily-method-start-live-streaming"},o))}},{key:"updateLiveStreaming",value:function(o){var u=o.layout,d=u===void 0?{preset:"default"}:u,g=o.instanceId;this.sendMessageToCallMachine({action:"daily-method-update-live-streaming",layout:d,instanceId:g})}},{key:"addLiveStreamingEndpoints",value:function(o){var u=o.endpoints,d=o.instanceId;this.sendMessageToCallMachine({action:Qi,endpointsOp:Zc,endpoints:u,instanceId:d})}},{key:"removeLiveStreamingEndpoints",value:function(o){var u=o.endpoints,d=o.instanceId;this.sendMessageToCallMachine({action:Qi,endpointsOp:el,endpoints:u,instanceId:d})}},{key:"stopLiveStreaming",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(P({action:"daily-method-stop-live-streaming"},o))}},{key:"validateDailyConfig",value:function(o){o.camSimulcastEncodings&&(console.warn("camSimulcastEncodings is deprecated. Use sendSettings, found in DailyCallOptions, to provide camera simulcast settings."),this.validateSimulcastEncodings(o.camSimulcastEncodings)),o.screenSimulcastEncodings&&console.warn("screenSimulcastEncodings is deprecated. Use sendSettings, found in DailyCallOptions, to provide screen simulcast settings."),he().match(/Linux; Android/)&&o.noAutoDefaultDeviceChange&&console.warn("noAutoDefaultDeviceChange is not supported on Android, and will be ignored.")}},{key:"validateSimulcastEncodings",value:function(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,d=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(o){if(!(o instanceof Array||Array.isArray(o)))throw new Error("encodings must be an Array");if(!ws(o.length,1,3))throw new Error("encodings must be an Array with between 1 to ".concat(3," layers"));for(var g=0;g<o.length;g++){var m=o[g];for(var w in this._validateEncodingLayerHasValidProperties(m),m)if(Rn.includes(w)){if(typeof m[w]!="number")throw new Error("".concat(w," must be a number"));if(u){var E=u[w],C=E.min,D=E.max;if(!ws(m[w],C,D))throw new Error("".concat(w," value not in range. valid range: ").concat(C," to ").concat(D))}}else if(!["active","scalabilityMode"].includes(w))throw new Error("Invalid key ".concat(w,", valid keys are:")+Object.values(Rn));if(d&&!m.hasOwnProperty("maxBitrate"))throw new Error("maxBitrate is not specified")}}}},{key:"startRemoteMediaPlayer",value:(L=O(function*(o){var u=this,d=o.url,g=o.settings,m=g===void 0?{state:Xn.PLAY}:g;try{(function(w){if(typeof w!="string")throw new Error('url parameter must be "string" type')})(d),bs(m),function(w){for(var E in w)if(!vs.includes(E))throw new Error("Invalid key ".concat(E,", valid keys are: ").concat(vs));w.simulcastEncodings&&this.validateSimulcastEncodings(w.simulcastEncodings,go,!0)}(m)}catch(w){throw console.error("invalid argument Error: ".concat(w)),console.error(`startRemoteMediaPlayer arguments must be of the form:
|
|
27
27
|
{ url: "playback url",
|
|
28
28
|
settings?:
|
|
29
29
|
{state: "play"|"pause", simulcastEncodings?: [{}] } }`),w}return new Promise(function(w,E){u.sendMessageToCallMachine({action:"daily-method-start-remote-media-player",url:d,settings:m},function(C){C.error?E({error:C.error,errorMsg:C.errorMsg}):w({session_id:C.session_id,remoteMediaPlayerState:{state:C.state,settings:C.settings}})})})}),function(o){return L.apply(this,arguments)})},{key:"stopRemoteMediaPlayer",value:(B=O(function*(o){var u=this;if(typeof o!="string")throw new Error(" remotePlayerID must be of type string");return new Promise(function(d,g){u.sendMessageToCallMachine({action:"daily-method-stop-remote-media-player",session_id:o},function(m){m.error?g({error:m.error,errorMsg:m.errorMsg}):d()})})}),function(o){return B.apply(this,arguments)})},{key:"updateRemoteMediaPlayer",value:(M=O(function*(o){var u=this,d=o.session_id,g=o.settings;try{bs(g)}catch(m){throw console.error("invalid argument Error: ".concat(m)),console.error(`updateRemoteMediaPlayer arguments must be of the form:
|
|
30
30
|
session_id: "participant session",
|
|
31
|
-
{ settings?: {state: "play"|"pause"} }`),m}return new Promise(function(m,w){u.sendMessageToCallMachine({action:"daily-method-update-remote-media-player",session_id:d,settings:g},function(E){E.error?w({error:E.error,errorMsg:E.errorMsg}):m({session_id:E.session_id,remoteMediaPlayerState:{state:E.state,settings:E.settings}})})})}),function(o){return M.apply(this,arguments)})},{key:"startTranscription",value:function(o){this.sendMessageToCallMachine(P({action:"daily-method-start-transcription"},o))}},{key:"stopTranscription",value:function(){this.sendMessageToCallMachine({action:"daily-method-stop-transcription"})}},{key:"startDialOut",value:(T=O(function*(o){var u=this;q(this._callState,"startDialOut()");var d=function(g){if(g){if(!Array.isArray(g))throw new Error("Error starting dial out: audio codec must be an array");if(g.length<=0)throw new Error("Error starting dial out: audio codec array specified but empty");g.forEach(function(m){if(typeof m!="string")throw new Error("Error starting dial out: audio codec must be a string");if(m!=="OPUS"&&m!=="PCMU"&&m!=="PCMA"&&m!=="G722")throw new Error("Error starting dial out: audio codec must be one of OPUS, PCMU, PCMA, G722")})}};if(!o.sipUri&&!o.phoneNumber)throw new Error("Error starting dial out: either a sip uri or phone number must be provided");if(o.sipUri&&o.phoneNumber)throw new Error("Error starting dial out: only one of sip uri or phone number must be provided");if(o.sipUri){if(typeof o.sipUri!="string")throw new Error("Error starting dial out: sipUri must be a string");if(!o.sipUri.startsWith("sip:"))throw new Error("Error starting dial out: Invalid SIP URI, must start with 'sip:'");if(o.video&&typeof o.video!="boolean")throw new Error("Error starting dial out: video must be a boolean value");(function(g){if(g&&(d(g.audio),g.video)){if(!Array.isArray(g.video))throw new Error("Error starting dial out: video codec must be an array");if(g.video.length<=0)throw new Error("Error starting dial out: video codec array specified but empty");g.video.forEach(function(m){if(typeof m!="string")throw new Error("Error starting dial out: video codec must be a string");if(m!=="H264"&&m!=="VP8")throw new Error("Error starting dial out: video codec must be H264 or VP8")})}})(o.codecs)}if(o.phoneNumber){if(typeof o.phoneNumber!="string")throw new Error("Error starting dial out: phoneNumber must be a string");if(!/^\+\d{1,}$/.test(o.phoneNumber))throw new Error("Error starting dial out: Invalid phone number, must be valid phone number as per E.164");o.codecs&&d(o.codecs.audio)}if(o.callerId){if(typeof o.callerId!="string")throw new Error("Error starting dial out: callerId must be a string");if(o.sipUri)throw new Error("Error starting dial out: callerId not allowed with sipUri")}if(o.displayName){if(typeof o.displayName!="string")throw new Error("Error starting dial out: displayName must be a string");if(o.displayName.length>=200)throw new Error("Error starting dial out: displayName length must be less than 200")}return new Promise(function(g,m){u.sendMessageToCallMachine(P({action:"dialout-start"},o),function(w){w.error?m(w.error):g(w)})})}),function(o){return T.apply(this,arguments)})},{key:"stopDialOut",value:function(o){var u=this;return q(this._callState,"stopDialOut()"),new Promise(function(d,g){u.sendMessageToCallMachine(P({action:"dialout-stop"},o),function(m){m.error?g(m.error):d(m)})})}},{key:"sipCallTransfer",value:(b=O(function*(o){var u=this;if(q(this._callState,"sipCallTransfer()"),!o)throw new Error("sipCallTransfer() requires a sessionId and toEndPoint");return o.useSipRefer=!1,_s(o,"sipCallTransfer"),new Promise(function(d,g){u.sendMessageToCallMachine(P({action:Zi},o),function(m){m.error?g(m.error):d(m)})})}),function(o){return b.apply(this,arguments)})},{key:"sipRefer",value:(v=O(function*(o){var u=this;if(q(this._callState,"sipRefer()"),!o)throw new Error("sessionId and toEndPoint are mandatory parameter");return o.useSipRefer=!0,_s(o,"sipRefer"),new Promise(function(d,g){u.sendMessageToCallMachine(P({action:Zi},o),function(m){m.error?g(m.error):d(m)})})}),function(o){return v.apply(this,arguments)})},{key:"sendDTMF",value:(k=O(function*(o){var u=this;return q(this._callState,"sendDTMF()"),function(d){var g=d.sessionId,m=d.tones;if(!g||!m)throw new Error("sessionId and tones are mandatory parameter");if(typeof g!="string"||typeof m!="string")throw new Error("sessionId and tones should be of string type");if(m.length>20)throw new Error("tones string must be upto 20 characters");var w=/[^0-9A-D*#]/g,E=m.match(w);if(E&&E[0])throw new Error("".concat(E[0]," is not valid DTMF tone"))}(o),new Promise(function(d,g){u.sendMessageToCallMachine(P({action:"send-dtmf"},o),function(m){m.error?g(m.error):d(m)})})}),function(o){return k.apply(this,arguments)})},{key:"getNetworkStats",value:function(){var o=this;return this._callState!==Qe?{stats:{latest:{}}}:new Promise(function(u){o.sendMessageToCallMachine({action:"get-calc-stats"},function(d){u(P({stats:d.stats},o._network))})})}},{key:"testWebsocketConnectivity",value:(_=O(function*(){var o=this;if(xn(this._testCallInProgress,"testWebsocketConnectivity()"),this.needsLoad())try{yield this.load()}catch(u){return Promise.reject(u)}return new Promise(function(u,d){o.sendMessageToCallMachine({action:"test-websocket-connectivity"},function(g){g.error?d(g.error):u(g.results)})})}),function(){return _.apply(this,arguments)})},{key:"abortTestWebsocketConnectivity",value:function(){this.sendMessageToCallMachine({action:"abort-test-websocket-connectivity"})}},{key:"_validateVideoTrackForNetworkTests",value:function(o){return o?o instanceof MediaStreamTrack?!!Tl(o)||(console.error("Video track is not playable. This test needs a live video track."),!1):(console.error("Video track needs to be of type `MediaStreamTrack`."),!1):(console.error("Missing video track. You must provide a video track in order to run this test."),!1)}},{key:"testCallQuality",value:(f=O(function*(){var o=this;x(),ce(this._callObjectMode,"testCallQuality()"),zt(this._callMachineInitialized,"testCallQuality()",null,!0),Dn(this._callState,this._isPreparingToJoin,"testCallQuality()");var u=this._testCallAlreadyInProgress,d=function(m){u||(o._testCallInProgress=m)};if(d(!0),this.needsLoad())try{var g=this._callState;yield this.load(),this._callState=g}catch(m){return d(!1),Promise.reject(m)}return new Promise(function(m){o.sendMessageToCallMachine({action:"test-call-quality",dailyJsVersion:o.properties.dailyJsVersion},function(w){var E=w.results,C=E.result,D=Gr(E,Cl);if(C==="failed"){var H,G=P({},D);(H=D.error)!==null&&H!==void 0&&H.details?(D.error.details=JSON.parse(D.error.details),G.error=P(P({},G.error),{},{details:P({},G.error.details)}),G.error.details.duringTest="testCallQuality"):(G.error=G.error?P({},G.error):{},G.error.details={duringTest:"testCallQuality"}),o._maybeSendToSentry(G)}d(!1),m(P({result:C},D))})})}),function(){return f.apply(this,arguments)})},{key:"stopTestCallQuality",value:function(){this.sendMessageToCallMachine({action:"stop-test-call-quality"})}},{key:"testConnectionQuality",value:(h=O(function*(o){var u;N()?(console.warn("testConnectionQuality() is deprecated: use testPeerToPeerCallQuality() instead"),u=yield this.testPeerToPeerCallQuality(o)):(console.warn("testConnectionQuality() is deprecated: use testCallQuality() instead"),u=yield this.testCallQuality());var d={result:u.result,secondsElapsed:u.secondsElapsed};return u.data&&(d.data={maxRTT:u.data.maxRoundTripTime,packetLoss:u.data.avgRecvPacketLoss}),d}),function(o){return h.apply(this,arguments)})},{key:"testPeerToPeerCallQuality",value:(p=O(function*(o){var u=this;if(xn(this._testCallInProgress,"testPeerToPeerCallQuality()"),this.needsLoad())try{yield this.load()}catch(m){return Promise.reject(m)}var d=o.videoTrack,g=o.duration;if(!this._validateVideoTrackForNetworkTests(d))throw new Error("Video track error");return this._sharedTracks.videoTrackForConnectionQualityTest=d,new Promise(function(m,w){u.sendMessageToCallMachine({action:"test-p2p-call-quality",duration:g},function(E){E.error?w(E.error):m(E.results)})})}),function(o){return p.apply(this,arguments)})},{key:"stopTestConnectionQuality",value:function(){N()?(console.warn("stopTestConnectionQuality() is deprecated: use testPeerToPeerCallQuality() and stopTestPeerToPeerCallQuality() instead"),this.stopTestPeerToPeerCallQuality()):(console.warn("stopTestConnectionQuality() is deprecated: use testCallQuality() and stopTestCallQuality() instead"),this.stopTestCallQuality())}},{key:"stopTestPeerToPeerCallQuality",value:function(){this.sendMessageToCallMachine({action:"stop-test-p2p-call-quality"})}},{key:"testNetworkConnectivity",value:(l=O(function*(o){var u=this;if(xn(this._testCallInProgress,"testNetworkConnectivity()"),this.needsLoad())try{yield this.load()}catch(d){return Promise.reject(d)}if(!this._validateVideoTrackForNetworkTests(o))throw new Error("Video track error");return this._sharedTracks.videoTrackForNetworkConnectivityTest=o,new Promise(function(d,g){u.sendMessageToCallMachine({action:"test-network-connectivity"},function(m){m.error?g(m.error):d(m.results)})})}),function(o){return l.apply(this,arguments)})},{key:"abortTestNetworkConnectivity",value:function(){this.sendMessageToCallMachine({action:"abort-test-network-connectivity"})}},{key:"getCpuLoadStats",value:function(){var o=this;return new Promise(function(u){o._callState===Qe?o.sendMessageToCallMachine({action:"get-cpu-load-stats"},function(d){u(d.cpuStats)}):u({cpuLoadState:void 0,cpuLoadStateReason:void 0,stats:{}})})}},{key:"_validateEncodingLayerHasValidProperties",value:function(o){var u;if(!(((u=Object.keys(o))===null||u===void 0?void 0:u.length)>0))throw new Error("Empty encoding is not allowed. At least one of these valid keys should be specified:"+Object.values(Rn))}},{key:"_validateVideoSendSettings",value:function(o,u){var d=o==="screenVideo"?["default-screen-video","detail-optimized","motion-optimized","motion-and-detail-balanced"]:["default-video","bandwidth-optimized","bandwidth-and-quality-balanced","quality-optimized","adaptive-2-layers","adaptive-3-layers"],g="Video send settings should be either an object or one of the supported presets: ".concat(d.join());if(typeof u=="string"){if(!d.includes(u))throw new Error(g)}else{if(U(u)!=="object")throw new Error(g);if(!u.maxQuality&&!u.encodings&&u.allowAdaptiveLayers===void 0)throw new Error("Video send settings must contain at least maxQuality, allowAdaptiveLayers or encodings attribute");if(u.maxQuality&&["low","medium","high"].indexOf(u.maxQuality)===-1)throw new Error("maxQuality must be either low, medium or high");if(u.encodings){var m=!1;switch(Object.keys(u.encodings).length){case 1:m=!u.encodings.low;break;case 2:m=!u.encodings.low||!u.encodings.medium;break;case 3:m=!u.encodings.low||!u.encodings.medium||!u.encodings.high;break;default:m=!0}if(m)throw new Error("Encodings must be defined as: low, low and medium, or low, medium and high.");u.encodings.low&&this._validateEncodingLayerHasValidProperties(u.encodings.low),u.encodings.medium&&this._validateEncodingLayerHasValidProperties(u.encodings.medium),u.encodings.high&&this._validateEncodingLayerHasValidProperties(u.encodings.high)}}}},{key:"validateUpdateSendSettings",value:function(o){var u=this;if(!o||Object.keys(o).length===0)throw new Error("Send settings must contain at least information for one track!");Object.entries(o).forEach(function(d){var g=$e(d,2),m=g[0],w=g[1];u._validateVideoSendSettings(m,w)})}},{key:"updateSendSettings",value:function(o){var u=this;return this.validateUpdateSendSettings(o),this.needsLoad()?(this._preloadCache.sendSettings=o,{sendSettings:this._preloadCache.sendSettings}):new Promise(function(d,g){u.sendMessageToCallMachine({action:"update-send-settings",sendSettings:o},function(m){m.error?g(m.error):d(m.sendSettings)})})}},{key:"getSendSettings",value:function(){return this._sendSettings||this._preloadCache.sendSettings}},{key:"getLocalAudioLevel",value:function(){return this._localAudioLevel}},{key:"getRemoteParticipantsAudioLevel",value:function(){return this._remoteParticipantsAudioLevel}},{key:"getActiveSpeaker",value:function(){return x(),this._activeSpeaker}},{key:"setActiveSpeakerMode",value:function(o){return x(),this.sendMessageToCallMachine({action:"set-active-speaker-mode",enabled:o}),this}},{key:"activeSpeakerMode",value:function(){return x(),this._activeSpeakerMode}},{key:"subscribeToTracksAutomatically",value:function(){return this._preloadCache.subscribeToTracksAutomatically}},{key:"setSubscribeToTracksAutomatically",value:function(o){return q(this._callState,"setSubscribeToTracksAutomatically()","Use the subscribeToTracksAutomatically configuration property."),this._preloadCache.subscribeToTracksAutomatically=o,this.sendMessageToCallMachine({action:"daily-method-subscribe-to-tracks-automatically",enabled:o}),this}},{key:"enumerateDevices",value:(c=O(function*(){var o=this;if(this._callObjectMode){var u=yield navigator.mediaDevices.enumerateDevices();return Ye()==="Firefox"&&er().major>115&&er().major<123&&(u=u.filter(function(d){return d.kind!=="audiooutput"})),{devices:u.map(function(d){var g=JSON.parse(JSON.stringify(d));if(!N()&&d.kind==="videoinput"&&d.getCapabilities){var m,w=d.getCapabilities();g.facing=(w==null||(m=w.facingMode)===null||m===void 0?void 0:m.length)>=1?w.facingMode[0]:void 0}return g})}}return new Promise(function(d){o.sendMessageToCallMachine({action:"enumerate-devices"},function(g){d({devices:g.devices})})})}),function(){return c.apply(this,arguments)})},{key:"sendAppMessage",value:function(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"*";if(q(this._callState,"sendAppMessage()"),JSON.stringify(o).length>4096)throw new Error("Message data too large. Max size is 4096");return this.sendMessageToCallMachine({action:"app-msg",data:o,to:u}),this}},{key:"addFakeParticipant",value:function(o){return x(),q(this._callState,"addFakeParticipant()"),this.sendMessageToCallMachine(P({action:"add-fake-participant"},o)),this}},{key:"setShowNamesMode",value:function(o){return Z(this._callObjectMode,"setShowNamesMode()"),x(),o&&o!=="always"&&o!=="never"?(console.error('setShowNamesMode argument should be "always", "never", or false'),this):(this.sendMessageToCallMachine({action:"set-show-names",mode:o}),this)}},{key:"setShowLocalVideo",value:function(){var o=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];return Z(this._callObjectMode,"setShowLocalVideo()"),x(),q(this._callState,"setShowLocalVideo()"),typeof o!="boolean"?(console.error("setShowLocalVideo only accepts a boolean value"),this):(this.sendMessageToCallMachine({action:"set-show-local-video",show:o}),this._showLocalVideo=o,this)}},{key:"showLocalVideo",value:function(){return Z(this._callObjectMode,"showLocalVideo()"),x(),this._showLocalVideo}},{key:"setShowParticipantsBar",value:function(){var o=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];return Z(this._callObjectMode,"setShowParticipantsBar()"),x(),q(this._callState,"setShowParticipantsBar()"),typeof o!="boolean"?(console.error("setShowParticipantsBar only accepts a boolean value"),this):(this.sendMessageToCallMachine({action:"set-show-participants-bar",show:o}),this._showParticipantsBar=o,this)}},{key:"showParticipantsBar",value:function(){return Z(this._callObjectMode,"showParticipantsBar()"),x(),this._showParticipantsBar}},{key:"customIntegrations",value:function(){return x(),Z(this._callObjectMode,"customIntegrations()"),this._customIntegrations}},{key:"setCustomIntegrations",value:function(o){return x(),Z(this._callObjectMode,"setCustomIntegrations()"),q(this._callState,"setCustomIntegrations()"),Eo(o)?(this.sendMessageToCallMachine({action:"set-custom-integrations",integrations:o}),this._customIntegrations=o,this):this}},{key:"startCustomIntegrations",value:function(o){var u=this;if(x(),Z(this._callObjectMode,"startCustomIntegrations()"),q(this._callState,"startCustomIntegrations()"),Array.isArray(o)&&o.some(function(m){return typeof m!="string"})||!Array.isArray(o)&&typeof o!="string")return console.error("startCustomIntegrations() only accepts string | string[]"),this;var d=typeof o=="string"?[o]:o,g=d.filter(function(m){return!(m in u._customIntegrations)});return g.length?(console.error(`Can't find custom integration(s): "`.concat(g.join(", "),'"')),this):(this.sendMessageToCallMachine({action:"start-custom-integrations",ids:d}),this)}},{key:"stopCustomIntegrations",value:function(o){var u=this;if(x(),Z(this._callObjectMode,"stopCustomIntegrations()"),q(this._callState,"stopCustomIntegrations()"),Array.isArray(o)&&o.some(function(m){return typeof m!="string"})||!Array.isArray(o)&&typeof o!="string")return console.error("stopCustomIntegrations() only accepts string | string[]"),this;var d=typeof o=="string"?[o]:o,g=d.filter(function(m){return!(m in u._customIntegrations)});return g.length?(console.error(`Can't find custom integration(s): "`.concat(g.join(", "),'"')),this):(this.sendMessageToCallMachine({action:"stop-custom-integrations",ids:d}),this)}},{key:"customTrayButtons",value:function(){return Z(this._callObjectMode,"customTrayButtons()"),x(),this._customTrayButtons}},{key:"updateCustomTrayButtons",value:function(o){return Z(this._callObjectMode,"updateCustomTrayButtons()"),x(),q(this._callState,"updateCustomTrayButtons()"),ko(o)?(this.sendMessageToCallMachine({action:"update-custom-tray-buttons",btns:o}),this._customTrayButtons=o,this):(console.error("updateCustomTrayButtons only accepts a dictionary of the type ".concat(JSON.stringify(on))),this)}},{key:"theme",value:function(){return Z(this._callObjectMode,"theme()"),this.properties.theme}},{key:"setTheme",value:function(o){var u=this;return Z(this._callObjectMode,"setTheme()"),new Promise(function(d,g){try{u.validateProperties({theme:o}),u.properties.theme=P({},o),u.sendMessageToCallMachine({action:"set-theme",theme:u.properties.theme});try{u.emitDailyJSEvent({action:sc,theme:u.properties.theme})}catch(m){console.log("could not emit 'theme-updated'",m)}d(u.properties.theme)}catch(m){g(m)}})}},{key:"requestFullscreen",value:(a=O(function*(){if(x(),this._iframe&&!document.fullscreenElement&&es())try{(yield this._iframe.requestFullscreen)?this._iframe.requestFullscreen():this._iframe.webkitRequestFullscreen()}catch(o){console.log("could not make video call fullscreen",o)}}),function(){return a.apply(this,arguments)})},{key:"exitFullscreen",value:function(){x(),document.fullscreenElement?document.exitFullscreen():document.webkitFullscreenElement&&document.webkitExitFullscreen()}},{key:"getSidebarView",value:(s=O(function*(){var o=this;return this._callObjectMode?(console.error("getSidebarView is not available in callObject mode"),Promise.resolve(null)):new Promise(function(u){o.sendMessageToCallMachine({action:"get-sidebar-view"},function(d){u(d.view)})})}),function(){return s.apply(this,arguments)})},{key:"setSidebarView",value:function(o){return this._callObjectMode?(console.error("setSidebarView is not available in callObject mode"),this):(this.sendMessageToCallMachine({action:"set-sidebar-view",view:o}),this)}},{key:"room",value:(i=O(function*(){var o=this,u=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).includeRoomConfigDefaults,d=u===void 0||u;return this._accessState.access===Cn||this.needsLoad()?this.properties.url?{roomUrlPendingJoin:this.properties.url}:null:new Promise(function(g){o.sendMessageToCallMachine({action:"lib-room-info",includeRoomConfigDefaults:d},function(m){delete m.action,delete m.callbackStamp,g(m)})})}),function(){return i.apply(this,arguments)})},{key:"geo",value:(r=O(function*(){try{var o=yield fetch("https://gs.daily.co/_ks_/x-swsl/:");return{current:(yield o.json()).geo}}catch(u){return console.error("geo lookup failed",u),{current:""}}}),function(){return r.apply(this,arguments)})},{key:"setNetworkTopology",value:(n=O(function*(o){var u=this;return x(),q(this._callState,"setNetworkTopology()"),new Promise(function(d,g){u.sendMessageToCallMachine({action:"set-network-topology",opts:o},function(m){m.error?g({error:m.error}):d({workerId:m.workerId})})})}),function(o){return n.apply(this,arguments)})},{key:"getNetworkTopology",value:(e=O(function*(){var o=this;return new Promise(function(u,d){o.needsLoad()&&u({topology:"none"}),o.sendMessageToCallMachine({action:"get-network-topology"},function(g){g.error?d({error:g.error}):u({topology:g.topology})})})}),function(){return e.apply(this,arguments)})},{key:"setPlayNewParticipantSound",value:function(o){if(x(),typeof o!="number"&&o!==!0&&o!==!1)throw new Error("argument to setShouldPlayNewParticipantSound should be true, false, or a number, but is ".concat(o));this.sendMessageToCallMachine({action:"daily-method-set-play-ding",arg:o})}},{key:"on",value:function(o,u){return Ee.prototype.on.call(this,o,u)}},{key:"once",value:function(o,u){return Ee.prototype.once.call(this,o,u)}},{key:"off",value:function(o,u){return Ee.prototype.off.call(this,o,u)}},{key:"validateProperties",value:function(o){for(var u in o){if(!Fe[u])throw new Error("unrecognized property '".concat(u,"'"));if(Fe[u].validate&&!Fe[u].validate(o[u],this))throw new Error("property '".concat(u,"': ").concat(Fe[u].help))}}},{key:"assembleMeetingUrl",value:function(){var o,u,d=P(P({},this.properties),{},{emb:this.callClientId,embHref:encodeURIComponent(window.location.href),proxy:(o=this.properties.dailyConfig)!==null&&o!==void 0&&o.proxyUrl?encodeURIComponent((u=this.properties.dailyConfig)===null||u===void 0?void 0:u.proxyUrl):void 0}),g=d.url.match(/\?/)?"&":"?";return d.url+g+Object.keys(Fe).filter(function(m){return Fe[m].queryString&&d[m]!==void 0}).map(function(m){return"".concat(Fe[m].queryString,"=").concat(d[m])}).join("&")}},{key:"needsLoad",value:function(){return[qi,Ji,Ie,Ce].includes(this._callState)}},{key:"sendMessageToCallMachine",value:function(o,u){if(this._destroyed&&(this._logUseAfterDestroy(),this.strictMode))throw new Error("Use after destroy");this._messageChannel.sendMessageToCallMachine(o,u,this._iframe,this.callClientId)}},{key:"forwardPackagedMessageToCallMachine",value:function(o){this._messageChannel.forwardPackagedMessageToCallMachine(o,this._iframe,this.callClientId)}},{key:"addListenerForPackagedMessagesFromCallMachine",value:function(o){return this._messageChannel.addListenerForPackagedMessagesFromCallMachine(o,this.callClientId)}},{key:"removeListenerForPackagedMessagesFromCallMachine",value:function(o){this._messageChannel.removeListenerForPackagedMessagesFromCallMachine(o)}},{key:"handleMessageFromCallMachine",value:function(o){switch(o.action){case rc:this.sendMessageToCallMachine(P({action:ic},this.properties));break;case"call-machine-initialized":this._callMachineInitialized=!0;var u={action:Vt,level:"log",code:1011,stats:{event:"bundle load",time:this._bundleLoadTime==="no-op"?0:this._bundleLoadTime,preLoaded:this._bundleLoadTime==="no-op",url:Xt(this.properties.dailyConfig)}};this.sendMessageToCallMachine(u),this._delayDuplicateInstanceLog&&this._logDuplicateInstanceAttempt();break;case $i:this._loadedCallback&&(this._loadedCallback(),this._loadedCallback=null),this.emitDailyJSEvent(o);break;case dc:this._joinedCallback&&(this._joinedCallback(o.participants),this._joinedCallback=null),this.emitDailyJSEvent(o);break;case pc:case fc:if(this._callState===Ie)return;if(o.participant&&o.participant.session_id){var d=o.participant.local?"local":o.participant.session_id;if(this._callObjectMode){var g=this._callMachine().store;os(o.participant,g),as(o.participant,g),cs(o.participant,this._participants[d],g)}try{this.maybeParticipantTracksStopped(this._participants[d],o.participant),this.maybeParticipantTracksStarted(this._participants[d],o.participant),this.maybeEventRecordingStopped(this._participants[d],o.participant),this.maybeEventRecordingStarted(this._participants[d],o.participant)}catch(bn){console.error("track events error",bn)}this.compareEqualForParticipantUpdateEvent(o.participant,this._participants[d])||(this._participants[d]=P({},o.participant),this.toggleParticipantAudioBasedOnNativeAudioFocus(),this.emitDailyJSEvent(o))}break;case mc: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 gc:Q(this._participantCounts,o.participantCounts)||(this._participantCounts=o.participantCounts,this.emitDailyJSEvent(o));break;case vc:var w={access:o.access};o.awaitingAccess&&(w.awaitingAccess=o.awaitingAccess),Q(this._accessState,w)||(this._accessState=w,this.emitDailyJSEvent(o));break;case yc:if(o.meetingSession){this._meetingSessionSummary=o.meetingSession,this.emitDailyJSEvent(o);var E=P(P({},o),{},{action:"meeting-session-updated"});this.emitDailyJSEvent(E)}break;case Yi:var C;this._iframe&&!o.preserveIframe&&(this._iframe.src=""),this._updateCallState(Ce),this.resetMeetingDependentVars(),this._loadedCallback&&(this._loadedCallback(o.errorMsg),this._loadedCallback=null),o.preserveIframe;var D=Gr(o,Ml);D!=null&&(C=D.error)!==null&&C!==void 0&&C.details&&(D.error.details=JSON.parse(D.error.details)),this._maybeSendToSentry(o),this._joinedCallback&&(this._joinedCallback(null,D),this._joinedCallback=null),this.emitDailyJSEvent(D);break;case hc:this._callState!==Ce&&this._updateCallState(Ie),this.resetMeetingDependentVars(),this._resolveLeave&&(this._resolveLeave(),this._resolveLeave=null),this.emitDailyJSEvent(o);break;case"selected-devices-updated":o.devices&&this.emitDailyJSEvent(o);break;case Jc:var H=o.threshold,G=o.quality;H===this._network.threshold&&G===this._network.quality||(this._network.quality=G,this._network.threshold=H,this.emitDailyJSEvent(o));break;case $c:o&&o.cpuLoadState&&this.emitDailyJSEvent(o);break;case Gc:o&&o.faceCounts!==void 0&&this.emitDailyJSEvent(o);break;case Uc:var be=o.activeSpeaker;this._activeSpeaker.peerId!==be.peerId&&(this._activeSpeaker.peerId=be.peerId,this.emitDailyJSEvent({action:o.action,activeSpeaker:this._activeSpeaker}));break;case"show-local-video-changed":if(this._callObjectMode)return;var Te=o.show;this._showLocalVideo=Te,this.emitDailyJSEvent({action:o.action,show:Te});break;case qc:var we=o.enabled;this._activeSpeakerMode!==we&&(this._activeSpeakerMode=we,this.emitDailyJSEvent({action:o.action,enabled:this._activeSpeakerMode}));break;case bc:case wc:case Sc:this._waitingParticipants=o.allWaitingParticipants,this.emitDailyJSEvent({action:o.action,participant:o.participant});break;case Qc:Q(this._receiveSettings,o.receiveSettings)||(this._receiveSettings=o.receiveSettings,this.emitDailyJSEvent({action:o.action,receiveSettings:o.receiveSettings}));break;case Xc:if(!Q(this._inputSettings,o.inputSettings)){var _n=this._getInputSettings();this._inputSettings=o.inputSettings,this._preloadCache.inputSettings={},Q(_n,this._getInputSettings())||this.emitDailyJSEvent({action:o.action,inputSettings:this._getInputSettings()})}break;case"send-settings-updated":Q(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 Lc:var Y=o.session_id;this._rmpPlayerState[Y]=o.playerState,this.emitDailyJSEvent(o);break;case jc:delete this._rmpPlayerState[o.session_id],this.emitDailyJSEvent(o);break;case Nc:var ge=o.session_id,je=this._rmpPlayerState[ge];je&&this.compareEqualForRMPUpdateEvent(je,o.remoteMediaPlayerState)||(this._rmpPlayerState[ge]=o.remoteMediaPlayerState,this.emitDailyJSEvent(o));break;case"custom-button-click":case"sidebar-view-changed":this.emitDailyJSEvent(o);break;case _c:var Dt=this._meetingSessionState.topology!==(o.meetingSessionState&&o.meetingSessionState.topology);this._meetingSessionState=Ln(o.meetingSessionState,this._callObjectMode),(this._callObjectMode||Dt)&&this.emitDailyJSEvent(o);break;case Ic:this._isScreenSharing=!0,this.emitDailyJSEvent(o);break;case Bc:case Fc:this._isScreenSharing=!1,this.emitDailyJSEvent(o);break;case Gi:case zi:case Oc:case Pc:case Ac:case Tc:case Cc:case Mc:case cc:case lc:case Dc:case xc:case Vc:case Rc:case zc:case Hc:case Yc:case Wc:case Hi:case Kc:case"dialin-ready":case"dialin-connected":case"dialin-error":case"dialin-stopped":case"dialin-warning":case"dialout-connected":case"dialout-answered":case"dialout-error":case"dialout-stopped":case"dialout-warning":this.emitDailyJSEvent(o);break;case"request-fullscreen":this.requestFullscreen();break;case"request-exit-fullscreen":this.exitFullscreen()}}},{key:"maybeEventRecordingStopped",value:function(o,u){var d="record";o&&(u.local||u[d]!==!1||o[d]===u[d]||this.emitDailyJSEvent({action:zi}))}},{key:"maybeEventRecordingStarted",value:function(o,u){var d="record";o&&(u.local||u[d]!==!0||o[d]===u[d]||this.emitDailyJSEvent({action:Gi}))}},{key:"maybeEventTrackStopped",value:function(o,u,d,g){o&&(o.readyState!=="ended"&&u&&o.id===u.id||this.emitDailyJSEvent({action:Ec,track:o,participant:d,type:g}))}},{key:"maybeEventTrackStarted",value:function(o,u,d,g){u&&(o&&o.readyState!=="ended"&&u.id===o.id||this.emitDailyJSEvent({action:kc,track:u,participant:d,type:g}))}},{key:"maybeParticipantTracksStopped",value:function(o,u){if(o)for(var d in o.tracks)this.maybeEventTrackStopped(o.tracks[d].track,u&&u.tracks[d]?u.tracks[d].track:null,u,d)}},{key:"maybeParticipantTracksStarted",value:function(o,u){if(u)for(var d in u.tracks)this.maybeEventTrackStarted(o&&o.tracks[d]?o.tracks[d].track:null,u.tracks[d].track,u,d)}},{key:"compareEqualForRMPUpdateEvent",value:function(o,u){var d,g;return o.state===u.state&&((d=o.settings)===null||d===void 0?void 0:d.volume)===((g=u.settings)===null||g===void 0?void 0:g.volume)}},{key:"emitDailyJSEvent",value:function(o){try{o.callClientId=this.callClientId,this.emit(o.action,o)}catch(u){console.log("could not emit",o,u)}}},{key:"compareEqualForParticipantUpdateEvent",value:function(o,u){return!!Q(o,u)&&(!o.videoTrack||!u.videoTrack||o.videoTrack.id===u.videoTrack.id&&o.videoTrack.muted===u.videoTrack.muted&&o.videoTrack.enabled===u.videoTrack.enabled)&&(!o.audioTrack||!u.audioTrack||o.audioTrack.id===u.audioTrack.id&&o.audioTrack.muted===u.audioTrack.muted&&o.audioTrack.enabled===u.audioTrack.enabled)}},{key:"nativeUtils",value:function(){return N()?typeof DailyNativeUtils>"u"?(console.warn("in React Native, DailyNativeUtils is expected to be available"),null):DailyNativeUtils:null}},{key:"updateIsPreparingToJoin",value:function(o){this._updateCallState(this._callState,o)}},{key:"_updateCallState",value:function(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._isPreparingToJoin;if(o!==this._callState||u!==this._isPreparingToJoin){var d=this._callState,g=this._isPreparingToJoin;this._callState=o,this._isPreparingToJoin=u;var m=Wt(d,g),w=Wt(this._callState,this._isPreparingToJoin);m!==w&&(this.updateKeepDeviceAwake(w),this.updateDeviceAudioMode(w),this.updateShowAndroidOngoingMeetingNotification(w),this.updateNoOpRecordingEnsuringBackgroundContinuity(w))}}},{key:"resetMeetingDependentVars",value:function(){this._participants={},this._participantCounts=gs,this._waitingParticipants={},this._activeSpeaker={},this._activeSpeakerMode=!1,this._didPreAuth=!1,this._accessState={access:Cn},this._finalSummaryOfPrevSession=this._meetingSessionSummary,this._meetingSessionSummary={},this._meetingSessionState=Ln(ms,this._callObjectMode),this._isScreenSharing=!1,this._receiveSettings={},this._inputSettings=void 0,this._sendSettings={},this._localAudioLevel=0,this._isLocalAudioLevelObserverRunning=!1,this._remoteParticipantsAudioLevel={},this._isRemoteParticipantsAudioLevelObserverRunning=!1,this._callMachineInitialized=!1,this._bundleLoadTime=void 0,this._preloadCache}},{key:"updateKeepDeviceAwake",value:function(o){N()&&this.nativeUtils().setKeepDeviceAwake(o,this.callClientId)}},{key:"updateDeviceAudioMode",value:function(o){if(N()&&!this.disableReactNativeAutoDeviceManagement("audio")){var u=o?this._nativeInCallAudioMode:"idle";this.nativeUtils().setAudioMode(u)}}},{key:"updateShowAndroidOngoingMeetingNotification",value:function(o){if(N()&&this.nativeUtils().setShowOngoingMeetingNotification){var u,d,g,m;if(this.properties.reactNativeConfig&&this.properties.reactNativeConfig.androidInCallNotification){var w=this.properties.reactNativeConfig.androidInCallNotification;u=w.title,d=w.subtitle,g=w.iconName,m=w.disableForCustomOverride}m&&(o=!1),this.nativeUtils().setShowOngoingMeetingNotification(o,u,d,g,this.callClientId)}}},{key:"updateNoOpRecordingEnsuringBackgroundContinuity",value:function(o){N()&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity(o)}},{key:"toggleParticipantAudioBasedOnNativeAudioFocus",value:function(){var o,u;if(N()){var d=(o=this._callMachine())===null||o===void 0||(u=o.store)===null||u===void 0?void 0:u.getState();for(var g in d==null?void 0:d.streams){var m=d.streams[g];m&&m.pendingTrack&&m.pendingTrack.kind==="audio"&&(m.pendingTrack.enabled=this._hasNativeAudioFocus)}}}},{key:"disableReactNativeAutoDeviceManagement",value:function(o){return this.properties.reactNativeConfig&&this.properties.reactNativeConfig.disableAutoDeviceManagement&&this.properties.reactNativeConfig.disableAutoDeviceManagement[o]}},{key:"absoluteUrl",value:function(o){if(o!==void 0){var u=document.createElement("a");return u.href=o,u.href}}},{key:"sayHello",value:function(){var o="hello, world.";return console.log(o),o}},{key:"_logUseAfterDestroy",value:function(){var o=Object.values(Be)[0];if(this.needsLoad())if(o&&!o.needsLoad()){var u={action:Vt,level:"error",code:this.strictMode?9995:9997};o.sendMessageToCallMachine(u)}else this.strictMode||console.error("You are are attempting to use a call instance that was previously destroyed, which is unsupported. Please remove `strictMode: false` from your constructor properties to enable strict mode to track down and fix this unsupported usage.");else{var d={action:Vt,level:"error",code:this.strictMode?9995:9997};this._messageChannel.sendMessageToCallMachine(d,null,this._iframe,this.callClientId)}}},{key:"_logDuplicateInstanceAttempt",value:function(){var o=Object.values(Be)[0],u=o._callMachineInitialized?o:this._callMachineInitialized?this:void 0;u?(u.sendMessageToCallMachine({action:Vt,level:"warn",code:this.allowMultipleCallInstances?9993:9992}),this._delayDuplicateInstanceLog=!1):(this._delayDuplicateInstanceLog=!0,o._delayDuplicateInstanceLog=!0)}},{key:"_maybeSendToSentry",value:function(o){var u,d,g,m,w,E;if(!((u=o.error)!==null&&u!==void 0&&u.type&&!["connection-error","end-of-life","no-room"].includes(o.error.type))){var C=(d=this.properties)!==null&&d!==void 0&&d.url?new URL(this.properties.url):void 0,D="production";C&&C.host.includes(".staging.daily")&&(D="staging");var H,G,be,Te,we,_n=new Ga({dsn:"https://f10f1c81e5d44a4098416c0867a8b740@o77906.ingest.sentry.io/168844",transport:za,integrations:[new Ui.GlobalHandlers({onunhandledrejection:!1}),new Ui.HttpContext],environment:D}),Y=new br(_n,void 0,ne.version());if(this.session_id&&Y.setExtra("sessionId",this.session_id),this.properties){var ge=P({},this.properties);ge.userName=ge.userName?"[Filtered]":void 0,ge.userData=ge.userData?"[Filtered]":void 0,ge.token=ge.token?"[Filtered]":void 0,Y.setExtra("properties",ge)}if(C){var je=C.searchParams.get("domain");if(!je){var Dt=C.host.match(/(.*?)\./);je=Dt&&Dt[1]||""}je&&Y.setTag("domain",je)}o.error&&(Y.setTag("fatalErrorType",o.error.type),Y.setExtra("errorDetails",o.error.details),!((H=o.error.details)===null||H===void 0)&&H.uri&&Y.setTag("serverAddress",o.error.details.uri),!((G=o.error.details)===null||G===void 0)&&G.workerGroup&&Y.setTag("workerGroup",o.error.details.workerGroup),!((be=o.error.details)===null||be===void 0)&&be.geoGroup&&Y.setTag("geoGroup",o.error.details.geoGroup),!((Te=o.error.details)===null||Te===void 0)&&Te.on&&Y.setTag("connectionAttempt",o.error.details.on),(we=o.error.details)!==null&&we!==void 0&&we.bundleUrl&&(Y.setTag("bundleUrl",o.error.details.bundleUrl),Y.setTag("bundleError",o.error.details.sourceError.type))),Y.setTags({callMode:this._callObjectMode?N()?"reactNative":(g=this.properties)!==null&&g!==void 0&&(m=g.dailyConfig)!==null&&m!==void 0&&(w=m.callMode)!==null&&w!==void 0&&w.includes("prebuilt")?this.properties.dailyConfig.callMode:"custom":"prebuilt-frame",version:ne.version()});var bn=((E=o.error)===null||E===void 0?void 0:E.msg)||o.errorMsg;Y.run(function(Xo){Xo.captureException(new Error(bn))})}}},{key:"_callMachine",value:function(){var o,u,d;return(o=window._daily)===null||o===void 0||(u=o.instances)===null||u===void 0||(d=u[this.callClientId])===null||d===void 0?void 0:d.callMachine}}],[{key:"supportedBrowser",value:function(){if(N())return{supported:!0,mobile:!0,name:"React Native",version:null,supportsScreenShare:!0,supportsSfu:!0,supportsVideoProcessing:!1,supportsAudioProcessing:!1};var o=ca.getParser(he());return{supported:!!ts(),mobile:o.getPlatformType()==="mobile",name:o.getBrowserName(),version:o.getBrowserVersion(),supportsFullscreen:!!es(),supportsScreenShare:!!tl(),supportsSfu:!!ts(),supportsVideoProcessing:uo(),supportsAudioProcessing:ho()}}},{key:"version",value:function(){return"0.68.0"}},{key:"createCallObject",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return o.layout="none",new ne(null,o)}},{key:"wrap",value:function(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(x(),!o||!o.contentWindow||typeof o.src!="string")throw new Error("DailyIframe::Wrap needs an iframe-like first argument");return u.layout||(u.customLayout?u.layout="custom-v1":u.layout="browser"),new ne(o,u)}},{key:"createFrame",value:function(o,u){var d,g;x(),o&&u?(d=o,g=u):o&&o.append?(d=o,g={}):(d=document.body,g=o||{});var m=g.iframeStyle;m||(m=d===document.body?{position:"fixed",border:"1px solid black",backgroundColor:"white",width:"375px",height:"450px",right:"1em",bottom:"1em"}:{border:0,width:"100%",height:"100%"});var w=document.createElement("iframe");window.navigator&&window.navigator.userAgent.match(/Chrome\/61\./)?w.allow="microphone, camera":w.allow="microphone; camera; autoplay; display-capture; screen-wake-lock",w.style.visibility="hidden",d.appendChild(w),w.style.visibility=null,Object.keys(m).forEach(function(E){return w.style[E]=m[E]}),g.layout||(g.customLayout?g.layout="custom-v1":g.layout="browser");try{return new ne(w,g)}catch(E){throw d.removeChild(w),E}}},{key:"createTransparentFrame",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};x();var u=document.createElement("iframe");return u.allow="microphone; camera; autoplay",u.style.cssText=`
|
|
31
|
+
{ settings?: {state: "play"|"pause"} }`),m}return new Promise(function(m,w){u.sendMessageToCallMachine({action:"daily-method-update-remote-media-player",session_id:d,settings:g},function(E){E.error?w({error:E.error,errorMsg:E.errorMsg}):m({session_id:E.session_id,remoteMediaPlayerState:{state:E.state,settings:E.settings}})})})}),function(o){return M.apply(this,arguments)})},{key:"startTranscription",value:function(o){this.sendMessageToCallMachine(P({action:"daily-method-start-transcription"},o))}},{key:"stopTranscription",value:function(){this.sendMessageToCallMachine({action:"daily-method-stop-transcription"})}},{key:"startDialOut",value:(T=O(function*(o){var u=this;q(this._callState,"startDialOut()");var d=function(g){if(g){if(!Array.isArray(g))throw new Error("Error starting dial out: audio codec must be an array");if(g.length<=0)throw new Error("Error starting dial out: audio codec array specified but empty");g.forEach(function(m){if(typeof m!="string")throw new Error("Error starting dial out: audio codec must be a string");if(m!=="OPUS"&&m!=="PCMU"&&m!=="PCMA"&&m!=="G722")throw new Error("Error starting dial out: audio codec must be one of OPUS, PCMU, PCMA, G722")})}};if(!o.sipUri&&!o.phoneNumber)throw new Error("Error starting dial out: either a sip uri or phone number must be provided");if(o.sipUri&&o.phoneNumber)throw new Error("Error starting dial out: only one of sip uri or phone number must be provided");if(o.sipUri){if(typeof o.sipUri!="string")throw new Error("Error starting dial out: sipUri must be a string");if(!o.sipUri.startsWith("sip:"))throw new Error("Error starting dial out: Invalid SIP URI, must start with 'sip:'");if(o.video&&typeof o.video!="boolean")throw new Error("Error starting dial out: video must be a boolean value");(function(g){if(g&&(d(g.audio),g.video)){if(!Array.isArray(g.video))throw new Error("Error starting dial out: video codec must be an array");if(g.video.length<=0)throw new Error("Error starting dial out: video codec array specified but empty");g.video.forEach(function(m){if(typeof m!="string")throw new Error("Error starting dial out: video codec must be a string");if(m!=="H264"&&m!=="VP8")throw new Error("Error starting dial out: video codec must be H264 or VP8")})}})(o.codecs)}if(o.phoneNumber){if(typeof o.phoneNumber!="string")throw new Error("Error starting dial out: phoneNumber must be a string");if(!/^\+\d{1,}$/.test(o.phoneNumber))throw new Error("Error starting dial out: Invalid phone number, must be valid phone number as per E.164");o.codecs&&d(o.codecs.audio)}if(o.callerId){if(typeof o.callerId!="string")throw new Error("Error starting dial out: callerId must be a string");if(o.sipUri)throw new Error("Error starting dial out: callerId not allowed with sipUri")}if(o.displayName){if(typeof o.displayName!="string")throw new Error("Error starting dial out: displayName must be a string");if(o.displayName.length>=200)throw new Error("Error starting dial out: displayName length must be less than 200")}return new Promise(function(g,m){u.sendMessageToCallMachine(P({action:"dialout-start"},o),function(w){w.error?m(w.error):g(w)})})}),function(o){return T.apply(this,arguments)})},{key:"stopDialOut",value:function(o){var u=this;return q(this._callState,"stopDialOut()"),new Promise(function(d,g){u.sendMessageToCallMachine(P({action:"dialout-stop"},o),function(m){m.error?g(m.error):d(m)})})}},{key:"sipCallTransfer",value:(b=O(function*(o){var u=this;if(q(this._callState,"sipCallTransfer()"),!o)throw new Error("sipCallTransfer() requires a sessionId and toEndPoint");return o.useSipRefer=!1,_s(o,"sipCallTransfer"),new Promise(function(d,g){u.sendMessageToCallMachine(P({action:Zi},o),function(m){m.error?g(m.error):d(m)})})}),function(o){return b.apply(this,arguments)})},{key:"sipRefer",value:(v=O(function*(o){var u=this;if(q(this._callState,"sipRefer()"),!o)throw new Error("sessionId and toEndPoint are mandatory parameter");return o.useSipRefer=!0,_s(o,"sipRefer"),new Promise(function(d,g){u.sendMessageToCallMachine(P({action:Zi},o),function(m){m.error?g(m.error):d(m)})})}),function(o){return v.apply(this,arguments)})},{key:"sendDTMF",value:(k=O(function*(o){var u=this;return q(this._callState,"sendDTMF()"),function(d){var g=d.sessionId,m=d.tones;if(!g||!m)throw new Error("sessionId and tones are mandatory parameter");if(typeof g!="string"||typeof m!="string")throw new Error("sessionId and tones should be of string type");if(m.length>20)throw new Error("tones string must be upto 20 characters");var w=/[^0-9A-D*#]/g,E=m.match(w);if(E&&E[0])throw new Error("".concat(E[0]," is not valid DTMF tone"))}(o),new Promise(function(d,g){u.sendMessageToCallMachine(P({action:"send-dtmf"},o),function(m){m.error?g(m.error):d(m)})})}),function(o){return k.apply(this,arguments)})},{key:"getNetworkStats",value:function(){var o=this;return this._callState!==Qe?{stats:{latest:{}}}:new Promise(function(u){o.sendMessageToCallMachine({action:"get-calc-stats"},function(d){u(P({stats:d.stats},o._network))})})}},{key:"testWebsocketConnectivity",value:(_=O(function*(){var o=this;if(xn(this._testCallInProgress,"testWebsocketConnectivity()"),this.needsLoad())try{yield this.load()}catch(u){return Promise.reject(u)}return new Promise(function(u,d){o.sendMessageToCallMachine({action:"test-websocket-connectivity"},function(g){g.error?d(g.error):u(g.results)})})}),function(){return _.apply(this,arguments)})},{key:"abortTestWebsocketConnectivity",value:function(){this.sendMessageToCallMachine({action:"abort-test-websocket-connectivity"})}},{key:"_validateVideoTrackForNetworkTests",value:function(o){return o?o instanceof MediaStreamTrack?!!Tl(o)||(console.error("Video track is not playable. This test needs a live video track."),!1):(console.error("Video track needs to be of type `MediaStreamTrack`."),!1):(console.error("Missing video track. You must provide a video track in order to run this test."),!1)}},{key:"testCallQuality",value:(f=O(function*(){var o=this;x(),ce(this._callObjectMode,"testCallQuality()"),zt(this._callMachineInitialized,"testCallQuality()",null,!0),Dn(this._callState,this._isPreparingToJoin,"testCallQuality()");var u=this._testCallAlreadyInProgress,d=function(m){u||(o._testCallInProgress=m)};if(d(!0),this.needsLoad())try{var g=this._callState;yield this.load(),this._callState=g}catch(m){return d(!1),Promise.reject(m)}return new Promise(function(m){o.sendMessageToCallMachine({action:"test-call-quality",dailyJsVersion:o.properties.dailyJsVersion},function(w){var E=w.results,C=E.result,D=Gr(E,Cl);if(C==="failed"){var H,G=P({},D);(H=D.error)!==null&&H!==void 0&&H.details?(D.error.details=JSON.parse(D.error.details),G.error=P(P({},G.error),{},{details:P({},G.error.details)}),G.error.details.duringTest="testCallQuality"):(G.error=G.error?P({},G.error):{},G.error.details={duringTest:"testCallQuality"}),o._maybeSendToSentry(G)}d(!1),m(P({result:C},D))})})}),function(){return f.apply(this,arguments)})},{key:"stopTestCallQuality",value:function(){this.sendMessageToCallMachine({action:"stop-test-call-quality"})}},{key:"testConnectionQuality",value:(h=O(function*(o){var u;N()?(console.warn("testConnectionQuality() is deprecated: use testPeerToPeerCallQuality() instead"),u=yield this.testPeerToPeerCallQuality(o)):(console.warn("testConnectionQuality() is deprecated: use testCallQuality() instead"),u=yield this.testCallQuality());var d={result:u.result,secondsElapsed:u.secondsElapsed};return u.data&&(d.data={maxRTT:u.data.maxRoundTripTime,packetLoss:u.data.avgRecvPacketLoss}),d}),function(o){return h.apply(this,arguments)})},{key:"testPeerToPeerCallQuality",value:(p=O(function*(o){var u=this;if(xn(this._testCallInProgress,"testPeerToPeerCallQuality()"),this.needsLoad())try{yield this.load()}catch(m){return Promise.reject(m)}var d=o.videoTrack,g=o.duration;if(!this._validateVideoTrackForNetworkTests(d))throw new Error("Video track error");return this._sharedTracks.videoTrackForConnectionQualityTest=d,new Promise(function(m,w){u.sendMessageToCallMachine({action:"test-p2p-call-quality",duration:g},function(E){E.error?w(E.error):m(E.results)})})}),function(o){return p.apply(this,arguments)})},{key:"stopTestConnectionQuality",value:function(){N()?(console.warn("stopTestConnectionQuality() is deprecated: use testPeerToPeerCallQuality() and stopTestPeerToPeerCallQuality() instead"),this.stopTestPeerToPeerCallQuality()):(console.warn("stopTestConnectionQuality() is deprecated: use testCallQuality() and stopTestCallQuality() instead"),this.stopTestCallQuality())}},{key:"stopTestPeerToPeerCallQuality",value:function(){this.sendMessageToCallMachine({action:"stop-test-p2p-call-quality"})}},{key:"testNetworkConnectivity",value:(l=O(function*(o){var u=this;if(xn(this._testCallInProgress,"testNetworkConnectivity()"),this.needsLoad())try{yield this.load()}catch(d){return Promise.reject(d)}if(!this._validateVideoTrackForNetworkTests(o))throw new Error("Video track error");return this._sharedTracks.videoTrackForNetworkConnectivityTest=o,new Promise(function(d,g){u.sendMessageToCallMachine({action:"test-network-connectivity"},function(m){m.error?g(m.error):d(m.results)})})}),function(o){return l.apply(this,arguments)})},{key:"abortTestNetworkConnectivity",value:function(){this.sendMessageToCallMachine({action:"abort-test-network-connectivity"})}},{key:"getCpuLoadStats",value:function(){var o=this;return new Promise(function(u){o._callState===Qe?o.sendMessageToCallMachine({action:"get-cpu-load-stats"},function(d){u(d.cpuStats)}):u({cpuLoadState:void 0,cpuLoadStateReason:void 0,stats:{}})})}},{key:"_validateEncodingLayerHasValidProperties",value:function(o){var u;if(!(((u=Object.keys(o))===null||u===void 0?void 0:u.length)>0))throw new Error("Empty encoding is not allowed. At least one of these valid keys should be specified:"+Object.values(Rn))}},{key:"_validateVideoSendSettings",value:function(o,u){var d=o==="screenVideo"?["default-screen-video","detail-optimized","motion-optimized","motion-and-detail-balanced"]:["default-video","bandwidth-optimized","bandwidth-and-quality-balanced","quality-optimized","adaptive-2-layers","adaptive-3-layers"],g="Video send settings should be either an object or one of the supported presets: ".concat(d.join());if(typeof u=="string"){if(!d.includes(u))throw new Error(g)}else{if(U(u)!=="object")throw new Error(g);if(!u.maxQuality&&!u.encodings&&u.allowAdaptiveLayers===void 0)throw new Error("Video send settings must contain at least maxQuality, allowAdaptiveLayers or encodings attribute");if(u.maxQuality&&["low","medium","high"].indexOf(u.maxQuality)===-1)throw new Error("maxQuality must be either low, medium or high");if(u.encodings){var m=!1;switch(Object.keys(u.encodings).length){case 1:m=!u.encodings.low;break;case 2:m=!u.encodings.low||!u.encodings.medium;break;case 3:m=!u.encodings.low||!u.encodings.medium||!u.encodings.high;break;default:m=!0}if(m)throw new Error("Encodings must be defined as: low, low and medium, or low, medium and high.");u.encodings.low&&this._validateEncodingLayerHasValidProperties(u.encodings.low),u.encodings.medium&&this._validateEncodingLayerHasValidProperties(u.encodings.medium),u.encodings.high&&this._validateEncodingLayerHasValidProperties(u.encodings.high)}}}},{key:"validateUpdateSendSettings",value:function(o){var u=this;if(!o||Object.keys(o).length===0)throw new Error("Send settings must contain at least information for one track!");Object.entries(o).forEach(function(d){var g=$e(d,2),m=g[0],w=g[1];u._validateVideoSendSettings(m,w)})}},{key:"updateSendSettings",value:function(o){var u=this;return this.validateUpdateSendSettings(o),this.needsLoad()?(this._preloadCache.sendSettings=o,{sendSettings:this._preloadCache.sendSettings}):new Promise(function(d,g){u.sendMessageToCallMachine({action:"update-send-settings",sendSettings:o},function(m){m.error?g(m.error):d(m.sendSettings)})})}},{key:"getSendSettings",value:function(){return this._sendSettings||this._preloadCache.sendSettings}},{key:"getLocalAudioLevel",value:function(){return this._localAudioLevel}},{key:"getRemoteParticipantsAudioLevel",value:function(){return this._remoteParticipantsAudioLevel}},{key:"getActiveSpeaker",value:function(){return x(),this._activeSpeaker}},{key:"setActiveSpeakerMode",value:function(o){return x(),this.sendMessageToCallMachine({action:"set-active-speaker-mode",enabled:o}),this}},{key:"activeSpeakerMode",value:function(){return x(),this._activeSpeakerMode}},{key:"subscribeToTracksAutomatically",value:function(){return this._preloadCache.subscribeToTracksAutomatically}},{key:"setSubscribeToTracksAutomatically",value:function(o){return q(this._callState,"setSubscribeToTracksAutomatically()","Use the subscribeToTracksAutomatically configuration property."),this._preloadCache.subscribeToTracksAutomatically=o,this.sendMessageToCallMachine({action:"daily-method-subscribe-to-tracks-automatically",enabled:o}),this}},{key:"enumerateDevices",value:(c=O(function*(){var o=this;if(this._callObjectMode){var u=yield navigator.mediaDevices.enumerateDevices();return Ye()==="Firefox"&&er().major>115&&er().major<123&&(u=u.filter(function(d){return d.kind!=="audiooutput"})),{devices:u.map(function(d){var g=JSON.parse(JSON.stringify(d));if(!N()&&d.kind==="videoinput"&&d.getCapabilities){var m,w=d.getCapabilities();g.facing=(w==null||(m=w.facingMode)===null||m===void 0?void 0:m.length)>=1?w.facingMode[0]:void 0}return g})}}return new Promise(function(d){o.sendMessageToCallMachine({action:"enumerate-devices"},function(g){d({devices:g.devices})})})}),function(){return c.apply(this,arguments)})},{key:"sendAppMessage",value:function(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"*";if(q(this._callState,"sendAppMessage()"),JSON.stringify(o).length>4096)throw new Error("Message data too large. Max size is 4096");return this.sendMessageToCallMachine({action:"app-msg",data:o,to:u}),this}},{key:"addFakeParticipant",value:function(o){return x(),q(this._callState,"addFakeParticipant()"),this.sendMessageToCallMachine(P({action:"add-fake-participant"},o)),this}},{key:"setShowNamesMode",value:function(o){return ee(this._callObjectMode,"setShowNamesMode()"),x(),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 ee(this._callObjectMode,"setShowLocalVideo()"),x(),q(this._callState,"setShowLocalVideo()"),typeof o!="boolean"?(console.error("setShowLocalVideo only accepts a boolean value"),this):(this.sendMessageToCallMachine({action:"set-show-local-video",show:o}),this._showLocalVideo=o,this)}},{key:"showLocalVideo",value:function(){return ee(this._callObjectMode,"showLocalVideo()"),x(),this._showLocalVideo}},{key:"setShowParticipantsBar",value:function(){var o=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];return ee(this._callObjectMode,"setShowParticipantsBar()"),x(),q(this._callState,"setShowParticipantsBar()"),typeof o!="boolean"?(console.error("setShowParticipantsBar only accepts a boolean value"),this):(this.sendMessageToCallMachine({action:"set-show-participants-bar",show:o}),this._showParticipantsBar=o,this)}},{key:"showParticipantsBar",value:function(){return ee(this._callObjectMode,"showParticipantsBar()"),x(),this._showParticipantsBar}},{key:"customIntegrations",value:function(){return x(),ee(this._callObjectMode,"customIntegrations()"),this._customIntegrations}},{key:"setCustomIntegrations",value:function(o){return x(),ee(this._callObjectMode,"setCustomIntegrations()"),q(this._callState,"setCustomIntegrations()"),Eo(o)?(this.sendMessageToCallMachine({action:"set-custom-integrations",integrations:o}),this._customIntegrations=o,this):this}},{key:"startCustomIntegrations",value:function(o){var u=this;if(x(),ee(this._callObjectMode,"startCustomIntegrations()"),q(this._callState,"startCustomIntegrations()"),Array.isArray(o)&&o.some(function(m){return typeof m!="string"})||!Array.isArray(o)&&typeof o!="string")return console.error("startCustomIntegrations() only accepts string | string[]"),this;var d=typeof o=="string"?[o]:o,g=d.filter(function(m){return!(m in u._customIntegrations)});return g.length?(console.error(`Can't find custom integration(s): "`.concat(g.join(", "),'"')),this):(this.sendMessageToCallMachine({action:"start-custom-integrations",ids:d}),this)}},{key:"stopCustomIntegrations",value:function(o){var u=this;if(x(),ee(this._callObjectMode,"stopCustomIntegrations()"),q(this._callState,"stopCustomIntegrations()"),Array.isArray(o)&&o.some(function(m){return typeof m!="string"})||!Array.isArray(o)&&typeof o!="string")return console.error("stopCustomIntegrations() only accepts string | string[]"),this;var d=typeof o=="string"?[o]:o,g=d.filter(function(m){return!(m in u._customIntegrations)});return g.length?(console.error(`Can't find custom integration(s): "`.concat(g.join(", "),'"')),this):(this.sendMessageToCallMachine({action:"stop-custom-integrations",ids:d}),this)}},{key:"customTrayButtons",value:function(){return ee(this._callObjectMode,"customTrayButtons()"),x(),this._customTrayButtons}},{key:"updateCustomTrayButtons",value:function(o){return ee(this._callObjectMode,"updateCustomTrayButtons()"),x(),q(this._callState,"updateCustomTrayButtons()"),ko(o)?(this.sendMessageToCallMachine({action:"update-custom-tray-buttons",btns:o}),this._customTrayButtons=o,this):(console.error("updateCustomTrayButtons only accepts a dictionary of the type ".concat(JSON.stringify(on))),this)}},{key:"theme",value:function(){return ee(this._callObjectMode,"theme()"),this.properties.theme}},{key:"setTheme",value:function(o){var u=this;return ee(this._callObjectMode,"setTheme()"),new Promise(function(d,g){try{u.validateProperties({theme:o}),u.properties.theme=P({},o),u.sendMessageToCallMachine({action:"set-theme",theme:u.properties.theme});try{u.emitDailyJSEvent({action:sc,theme:u.properties.theme})}catch(m){console.log("could not emit 'theme-updated'",m)}d(u.properties.theme)}catch(m){g(m)}})}},{key:"requestFullscreen",value:(a=O(function*(){if(x(),this._iframe&&!document.fullscreenElement&&es())try{(yield this._iframe.requestFullscreen)?this._iframe.requestFullscreen():this._iframe.webkitRequestFullscreen()}catch(o){console.log("could not make video call fullscreen",o)}}),function(){return a.apply(this,arguments)})},{key:"exitFullscreen",value:function(){x(),document.fullscreenElement?document.exitFullscreen():document.webkitFullscreenElement&&document.webkitExitFullscreen()}},{key:"getSidebarView",value:(s=O(function*(){var o=this;return this._callObjectMode?(console.error("getSidebarView is not available in callObject mode"),Promise.resolve(null)):new Promise(function(u){o.sendMessageToCallMachine({action:"get-sidebar-view"},function(d){u(d.view)})})}),function(){return s.apply(this,arguments)})},{key:"setSidebarView",value:function(o){return this._callObjectMode?(console.error("setSidebarView is not available in callObject mode"),this):(this.sendMessageToCallMachine({action:"set-sidebar-view",view:o}),this)}},{key:"room",value:(i=O(function*(){var o=this,u=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).includeRoomConfigDefaults,d=u===void 0||u;return this._accessState.access===Cn||this.needsLoad()?this.properties.url?{roomUrlPendingJoin:this.properties.url}:null:new Promise(function(g){o.sendMessageToCallMachine({action:"lib-room-info",includeRoomConfigDefaults:d},function(m){delete m.action,delete m.callbackStamp,g(m)})})}),function(){return i.apply(this,arguments)})},{key:"geo",value:(r=O(function*(){try{var o=yield fetch("https://gs.daily.co/_ks_/x-swsl/:");return{current:(yield o.json()).geo}}catch(u){return console.error("geo lookup failed",u),{current:""}}}),function(){return r.apply(this,arguments)})},{key:"setNetworkTopology",value:(n=O(function*(o){var u=this;return x(),q(this._callState,"setNetworkTopology()"),new Promise(function(d,g){u.sendMessageToCallMachine({action:"set-network-topology",opts:o},function(m){m.error?g({error:m.error}):d({workerId:m.workerId})})})}),function(o){return n.apply(this,arguments)})},{key:"getNetworkTopology",value:(e=O(function*(){var o=this;return new Promise(function(u,d){o.needsLoad()&&u({topology:"none"}),o.sendMessageToCallMachine({action:"get-network-topology"},function(g){g.error?d({error:g.error}):u({topology:g.topology})})})}),function(){return e.apply(this,arguments)})},{key:"setPlayNewParticipantSound",value:function(o){if(x(),typeof o!="number"&&o!==!0&&o!==!1)throw new Error("argument to setShouldPlayNewParticipantSound should be true, false, or a number, but is ".concat(o));this.sendMessageToCallMachine({action:"daily-method-set-play-ding",arg:o})}},{key:"on",value:function(o,u){return Ee.prototype.on.call(this,o,u)}},{key:"once",value:function(o,u){return Ee.prototype.once.call(this,o,u)}},{key:"off",value:function(o,u){return Ee.prototype.off.call(this,o,u)}},{key:"validateProperties",value:function(o){for(var u in o){if(!Fe[u])throw new Error("unrecognized property '".concat(u,"'"));if(Fe[u].validate&&!Fe[u].validate(o[u],this))throw new Error("property '".concat(u,"': ").concat(Fe[u].help))}}},{key:"assembleMeetingUrl",value:function(){var o,u,d=P(P({},this.properties),{},{emb:this.callClientId,embHref:encodeURIComponent(window.location.href),proxy:(o=this.properties.dailyConfig)!==null&&o!==void 0&&o.proxyUrl?encodeURIComponent((u=this.properties.dailyConfig)===null||u===void 0?void 0:u.proxyUrl):void 0}),g=d.url.match(/\?/)?"&":"?";return d.url+g+Object.keys(Fe).filter(function(m){return Fe[m].queryString&&d[m]!==void 0}).map(function(m){return"".concat(Fe[m].queryString,"=").concat(d[m])}).join("&")}},{key:"needsLoad",value:function(){return[qi,Ji,Ie,Ce].includes(this._callState)}},{key:"sendMessageToCallMachine",value:function(o,u){if(this._destroyed&&(this._logUseAfterDestroy(),this.strictMode))throw new Error("Use after destroy");this._messageChannel.sendMessageToCallMachine(o,u,this._iframe,this.callClientId)}},{key:"forwardPackagedMessageToCallMachine",value:function(o){this._messageChannel.forwardPackagedMessageToCallMachine(o,this._iframe,this.callClientId)}},{key:"addListenerForPackagedMessagesFromCallMachine",value:function(o){return this._messageChannel.addListenerForPackagedMessagesFromCallMachine(o,this.callClientId)}},{key:"removeListenerForPackagedMessagesFromCallMachine",value:function(o){this._messageChannel.removeListenerForPackagedMessagesFromCallMachine(o)}},{key:"handleMessageFromCallMachine",value:function(o){switch(o.action){case rc:this.sendMessageToCallMachine(P({action:ic},this.properties));break;case"call-machine-initialized":this._callMachineInitialized=!0;var u={action:Vt,level:"log",code:1011,stats:{event:"bundle load",time:this._bundleLoadTime==="no-op"?0:this._bundleLoadTime,preLoaded:this._bundleLoadTime==="no-op",url:Xt(this.properties.dailyConfig)}};this.sendMessageToCallMachine(u),this._delayDuplicateInstanceLog&&this._logDuplicateInstanceAttempt();break;case $i:this._loadedCallback&&(this._loadedCallback(),this._loadedCallback=null),this.emitDailyJSEvent(o);break;case dc:this._joinedCallback&&(this._joinedCallback(o.participants),this._joinedCallback=null),this.emitDailyJSEvent(o);break;case pc:case fc:if(this._callState===Ie)return;if(o.participant&&o.participant.session_id){var d=o.participant.local?"local":o.participant.session_id;if(this._callObjectMode){var g=this._callMachine().store;os(o.participant,g),as(o.participant,g),cs(o.participant,this._participants[d],g)}try{this.maybeParticipantTracksStopped(this._participants[d],o.participant),this.maybeParticipantTracksStarted(this._participants[d],o.participant),this.maybeEventRecordingStopped(this._participants[d],o.participant),this.maybeEventRecordingStarted(this._participants[d],o.participant)}catch(bn){console.error("track events error",bn)}this.compareEqualForParticipantUpdateEvent(o.participant,this._participants[d])||(this._participants[d]=P({},o.participant),this.toggleParticipantAudioBasedOnNativeAudioFocus(),this.emitDailyJSEvent(o))}break;case mc: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 gc:Q(this._participantCounts,o.participantCounts)||(this._participantCounts=o.participantCounts,this.emitDailyJSEvent(o));break;case vc:var w={access:o.access};o.awaitingAccess&&(w.awaitingAccess=o.awaitingAccess),Q(this._accessState,w)||(this._accessState=w,this.emitDailyJSEvent(o));break;case yc:if(o.meetingSession){this._meetingSessionSummary=o.meetingSession,this.emitDailyJSEvent(o);var E=P(P({},o),{},{action:"meeting-session-updated"});this.emitDailyJSEvent(E)}break;case Yi:var C;this._iframe&&!o.preserveIframe&&(this._iframe.src=""),this._updateCallState(Ce),this.resetMeetingDependentVars(),this._loadedCallback&&(this._loadedCallback(o.errorMsg),this._loadedCallback=null),o.preserveIframe;var D=Gr(o,Ml);D!=null&&(C=D.error)!==null&&C!==void 0&&C.details&&(D.error.details=JSON.parse(D.error.details)),this._maybeSendToSentry(o),this._joinedCallback&&(this._joinedCallback(null,D),this._joinedCallback=null),this.emitDailyJSEvent(D);break;case hc:this._callState!==Ce&&this._updateCallState(Ie),this.resetMeetingDependentVars(),this._resolveLeave&&(this._resolveLeave(),this._resolveLeave=null),this.emitDailyJSEvent(o);break;case"selected-devices-updated":o.devices&&this.emitDailyJSEvent(o);break;case Jc:var H=o.threshold,G=o.quality;H===this._network.threshold&&G===this._network.quality||(this._network.quality=G,this._network.threshold=H,this.emitDailyJSEvent(o));break;case $c:o&&o.cpuLoadState&&this.emitDailyJSEvent(o);break;case Gc:o&&o.faceCounts!==void 0&&this.emitDailyJSEvent(o);break;case Uc:var be=o.activeSpeaker;this._activeSpeaker.peerId!==be.peerId&&(this._activeSpeaker.peerId=be.peerId,this.emitDailyJSEvent({action:o.action,activeSpeaker:this._activeSpeaker}));break;case"show-local-video-changed":if(this._callObjectMode)return;var Te=o.show;this._showLocalVideo=Te,this.emitDailyJSEvent({action:o.action,show:Te});break;case qc:var we=o.enabled;this._activeSpeakerMode!==we&&(this._activeSpeakerMode=we,this.emitDailyJSEvent({action:o.action,enabled:this._activeSpeakerMode}));break;case bc:case wc:case Sc:this._waitingParticipants=o.allWaitingParticipants,this.emitDailyJSEvent({action:o.action,participant:o.participant});break;case Qc:Q(this._receiveSettings,o.receiveSettings)||(this._receiveSettings=o.receiveSettings,this.emitDailyJSEvent({action:o.action,receiveSettings:o.receiveSettings}));break;case Xc:if(!Q(this._inputSettings,o.inputSettings)){var _n=this._getInputSettings();this._inputSettings=o.inputSettings,this._preloadCache.inputSettings={},Q(_n,this._getInputSettings())||this.emitDailyJSEvent({action:o.action,inputSettings:this._getInputSettings()})}break;case"send-settings-updated":Q(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 Lc:var Y=o.session_id;this._rmpPlayerState[Y]=o.playerState,this.emitDailyJSEvent(o);break;case jc:delete this._rmpPlayerState[o.session_id],this.emitDailyJSEvent(o);break;case Nc:var ge=o.session_id,je=this._rmpPlayerState[ge];je&&this.compareEqualForRMPUpdateEvent(je,o.remoteMediaPlayerState)||(this._rmpPlayerState[ge]=o.remoteMediaPlayerState,this.emitDailyJSEvent(o));break;case"custom-button-click":case"sidebar-view-changed":this.emitDailyJSEvent(o);break;case _c:var Dt=this._meetingSessionState.topology!==(o.meetingSessionState&&o.meetingSessionState.topology);this._meetingSessionState=Ln(o.meetingSessionState,this._callObjectMode),(this._callObjectMode||Dt)&&this.emitDailyJSEvent(o);break;case Ic:this._isScreenSharing=!0,this.emitDailyJSEvent(o);break;case Bc:case Fc:this._isScreenSharing=!1,this.emitDailyJSEvent(o);break;case Gi:case zi:case Oc:case Pc:case Ac:case Tc:case Cc:case Mc:case cc:case lc:case Dc:case xc:case Vc:case Rc:case zc:case Hc:case Yc:case Wc:case Hi:case Kc:case"dialin-ready":case"dialin-connected":case"dialin-error":case"dialin-stopped":case"dialin-warning":case"dialout-connected":case"dialout-answered":case"dialout-error":case"dialout-stopped":case"dialout-warning":this.emitDailyJSEvent(o);break;case"request-fullscreen":this.requestFullscreen();break;case"request-exit-fullscreen":this.exitFullscreen()}}},{key:"maybeEventRecordingStopped",value:function(o,u){var d="record";o&&(u.local||u[d]!==!1||o[d]===u[d]||this.emitDailyJSEvent({action:zi}))}},{key:"maybeEventRecordingStarted",value:function(o,u){var d="record";o&&(u.local||u[d]!==!0||o[d]===u[d]||this.emitDailyJSEvent({action:Gi}))}},{key:"maybeEventTrackStopped",value:function(o,u,d,g){o&&(o.readyState!=="ended"&&u&&o.id===u.id||this.emitDailyJSEvent({action:Ec,track:o,participant:d,type:g}))}},{key:"maybeEventTrackStarted",value:function(o,u,d,g){u&&(o&&o.readyState!=="ended"&&u.id===o.id||this.emitDailyJSEvent({action:kc,track:u,participant:d,type:g}))}},{key:"maybeParticipantTracksStopped",value:function(o,u){if(o)for(var d in o.tracks)this.maybeEventTrackStopped(o.tracks[d].track,u&&u.tracks[d]?u.tracks[d].track:null,u,d)}},{key:"maybeParticipantTracksStarted",value:function(o,u){if(u)for(var d in u.tracks)this.maybeEventTrackStarted(o&&o.tracks[d]?o.tracks[d].track:null,u.tracks[d].track,u,d)}},{key:"compareEqualForRMPUpdateEvent",value:function(o,u){var d,g;return o.state===u.state&&((d=o.settings)===null||d===void 0?void 0:d.volume)===((g=u.settings)===null||g===void 0?void 0:g.volume)}},{key:"emitDailyJSEvent",value:function(o){try{o.callClientId=this.callClientId,this.emit(o.action,o)}catch(u){console.log("could not emit",o,u)}}},{key:"compareEqualForParticipantUpdateEvent",value:function(o,u){return!!Q(o,u)&&(!o.videoTrack||!u.videoTrack||o.videoTrack.id===u.videoTrack.id&&o.videoTrack.muted===u.videoTrack.muted&&o.videoTrack.enabled===u.videoTrack.enabled)&&(!o.audioTrack||!u.audioTrack||o.audioTrack.id===u.audioTrack.id&&o.audioTrack.muted===u.audioTrack.muted&&o.audioTrack.enabled===u.audioTrack.enabled)}},{key:"nativeUtils",value:function(){return N()?typeof DailyNativeUtils>"u"?(console.warn("in React Native, DailyNativeUtils is expected to be available"),null):DailyNativeUtils:null}},{key:"updateIsPreparingToJoin",value:function(o){this._updateCallState(this._callState,o)}},{key:"_updateCallState",value:function(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._isPreparingToJoin;if(o!==this._callState||u!==this._isPreparingToJoin){var d=this._callState,g=this._isPreparingToJoin;this._callState=o,this._isPreparingToJoin=u;var m=Wt(d,g),w=Wt(this._callState,this._isPreparingToJoin);m!==w&&(this.updateKeepDeviceAwake(w),this.updateDeviceAudioMode(w),this.updateShowAndroidOngoingMeetingNotification(w),this.updateNoOpRecordingEnsuringBackgroundContinuity(w))}}},{key:"resetMeetingDependentVars",value:function(){this._participants={},this._participantCounts=gs,this._waitingParticipants={},this._activeSpeaker={},this._activeSpeakerMode=!1,this._didPreAuth=!1,this._accessState={access:Cn},this._finalSummaryOfPrevSession=this._meetingSessionSummary,this._meetingSessionSummary={},this._meetingSessionState=Ln(ms,this._callObjectMode),this._isScreenSharing=!1,this._receiveSettings={},this._inputSettings=void 0,this._sendSettings={},this._localAudioLevel=0,this._isLocalAudioLevelObserverRunning=!1,this._remoteParticipantsAudioLevel={},this._isRemoteParticipantsAudioLevelObserverRunning=!1,this._callMachineInitialized=!1,this._bundleLoadTime=void 0,this._preloadCache}},{key:"updateKeepDeviceAwake",value:function(o){N()&&this.nativeUtils().setKeepDeviceAwake(o,this.callClientId)}},{key:"updateDeviceAudioMode",value:function(o){if(N()&&!this.disableReactNativeAutoDeviceManagement("audio")){var u=o?this._nativeInCallAudioMode:"idle";this.nativeUtils().setAudioMode(u)}}},{key:"updateShowAndroidOngoingMeetingNotification",value:function(o){if(N()&&this.nativeUtils().setShowOngoingMeetingNotification){var u,d,g,m;if(this.properties.reactNativeConfig&&this.properties.reactNativeConfig.androidInCallNotification){var w=this.properties.reactNativeConfig.androidInCallNotification;u=w.title,d=w.subtitle,g=w.iconName,m=w.disableForCustomOverride}m&&(o=!1),this.nativeUtils().setShowOngoingMeetingNotification(o,u,d,g,this.callClientId)}}},{key:"updateNoOpRecordingEnsuringBackgroundContinuity",value:function(o){N()&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity(o)}},{key:"toggleParticipantAudioBasedOnNativeAudioFocus",value:function(){var o,u;if(N()){var d=(o=this._callMachine())===null||o===void 0||(u=o.store)===null||u===void 0?void 0:u.getState();for(var g in d==null?void 0:d.streams){var m=d.streams[g];m&&m.pendingTrack&&m.pendingTrack.kind==="audio"&&(m.pendingTrack.enabled=this._hasNativeAudioFocus)}}}},{key:"disableReactNativeAutoDeviceManagement",value:function(o){return this.properties.reactNativeConfig&&this.properties.reactNativeConfig.disableAutoDeviceManagement&&this.properties.reactNativeConfig.disableAutoDeviceManagement[o]}},{key:"absoluteUrl",value:function(o){if(o!==void 0){var u=document.createElement("a");return u.href=o,u.href}}},{key:"sayHello",value:function(){var o="hello, world.";return console.log(o),o}},{key:"_logUseAfterDestroy",value:function(){var o=Object.values(Be)[0];if(this.needsLoad())if(o&&!o.needsLoad()){var u={action:Vt,level:"error",code:this.strictMode?9995:9997};o.sendMessageToCallMachine(u)}else this.strictMode||console.error("You are are attempting to use a call instance that was previously destroyed, which is unsupported. Please remove `strictMode: false` from your constructor properties to enable strict mode to track down and fix this unsupported usage.");else{var d={action:Vt,level:"error",code:this.strictMode?9995:9997};this._messageChannel.sendMessageToCallMachine(d,null,this._iframe,this.callClientId)}}},{key:"_logDuplicateInstanceAttempt",value:function(){var o=Object.values(Be)[0],u=o._callMachineInitialized?o:this._callMachineInitialized?this:void 0;u?(u.sendMessageToCallMachine({action:Vt,level:"warn",code:this.allowMultipleCallInstances?9993:9992}),this._delayDuplicateInstanceLog=!1):(this._delayDuplicateInstanceLog=!0,o._delayDuplicateInstanceLog=!0)}},{key:"_maybeSendToSentry",value:function(o){var u,d,g,m,w,E;if(!((u=o.error)!==null&&u!==void 0&&u.type&&!["connection-error","end-of-life","no-room"].includes(o.error.type))){var C=(d=this.properties)!==null&&d!==void 0&&d.url?new URL(this.properties.url):void 0,D="production";C&&C.host.includes(".staging.daily")&&(D="staging");var H,G,be,Te,we,_n=new Ga({dsn:"https://f10f1c81e5d44a4098416c0867a8b740@o77906.ingest.sentry.io/168844",transport:za,integrations:[new Ui.GlobalHandlers({onunhandledrejection:!1}),new Ui.HttpContext],environment:D}),Y=new br(_n,void 0,re.version());if(this.session_id&&Y.setExtra("sessionId",this.session_id),this.properties){var ge=P({},this.properties);ge.userName=ge.userName?"[Filtered]":void 0,ge.userData=ge.userData?"[Filtered]":void 0,ge.token=ge.token?"[Filtered]":void 0,Y.setExtra("properties",ge)}if(C){var je=C.searchParams.get("domain");if(!je){var Dt=C.host.match(/(.*?)\./);je=Dt&&Dt[1]||""}je&&Y.setTag("domain",je)}o.error&&(Y.setTag("fatalErrorType",o.error.type),Y.setExtra("errorDetails",o.error.details),!((H=o.error.details)===null||H===void 0)&&H.uri&&Y.setTag("serverAddress",o.error.details.uri),!((G=o.error.details)===null||G===void 0)&&G.workerGroup&&Y.setTag("workerGroup",o.error.details.workerGroup),!((be=o.error.details)===null||be===void 0)&&be.geoGroup&&Y.setTag("geoGroup",o.error.details.geoGroup),!((Te=o.error.details)===null||Te===void 0)&&Te.on&&Y.setTag("connectionAttempt",o.error.details.on),(we=o.error.details)!==null&&we!==void 0&&we.bundleUrl&&(Y.setTag("bundleUrl",o.error.details.bundleUrl),Y.setTag("bundleError",o.error.details.sourceError.type))),Y.setTags({callMode:this._callObjectMode?N()?"reactNative":(g=this.properties)!==null&&g!==void 0&&(m=g.dailyConfig)!==null&&m!==void 0&&(w=m.callMode)!==null&&w!==void 0&&w.includes("prebuilt")?this.properties.dailyConfig.callMode:"custom":"prebuilt-frame",version:re.version()});var bn=((E=o.error)===null||E===void 0?void 0:E.msg)||o.errorMsg;Y.run(function(Xo){Xo.captureException(new Error(bn))})}}},{key:"_callMachine",value:function(){var o,u,d;return(o=window._daily)===null||o===void 0||(u=o.instances)===null||u===void 0||(d=u[this.callClientId])===null||d===void 0?void 0:d.callMachine}}],[{key:"supportedBrowser",value:function(){if(N())return{supported:!0,mobile:!0,name:"React Native",version:null,supportsScreenShare:!0,supportsSfu:!0,supportsVideoProcessing:!1,supportsAudioProcessing:!1};var o=ca.getParser(he());return{supported:!!ts(),mobile:o.getPlatformType()==="mobile",name:o.getBrowserName(),version:o.getBrowserVersion(),supportsFullscreen:!!es(),supportsScreenShare:!!tl(),supportsSfu:!!ts(),supportsVideoProcessing:uo(),supportsAudioProcessing:ho()}}},{key:"version",value:function(){return"0.68.0"}},{key:"createCallObject",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return o.layout="none",new re(null,o)}},{key:"wrap",value:function(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(x(),!o||!o.contentWindow||typeof o.src!="string")throw new Error("DailyIframe::Wrap needs an iframe-like first argument");return u.layout||(u.customLayout?u.layout="custom-v1":u.layout="browser"),new re(o,u)}},{key:"createFrame",value:function(o,u){var d,g;x(),o&&u?(d=o,g=u):o&&o.append?(d=o,g={}):(d=document.body,g=o||{});var m=g.iframeStyle;m||(m=d===document.body?{position:"fixed",border:"1px solid black",backgroundColor:"white",width:"375px",height:"450px",right:"1em",bottom:"1em"}:{border:0,width:"100%",height:"100%"});var w=document.createElement("iframe");window.navigator&&window.navigator.userAgent.match(/Chrome\/61\./)?w.allow="microphone, camera":w.allow="microphone; camera; autoplay; display-capture; screen-wake-lock",w.style.visibility="hidden",d.appendChild(w),w.style.visibility=null,Object.keys(m).forEach(function(E){return w.style[E]=m[E]}),g.layout||(g.customLayout?g.layout="custom-v1":g.layout="browser");try{return new re(w,g)}catch(E){throw d.removeChild(w),E}}},{key:"createTransparentFrame",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};x();var u=document.createElement("iframe");return u.allow="microphone; camera; autoplay",u.style.cssText=`
|
|
32
32
|
position: fixed;
|
|
33
33
|
top: 0;
|
|
34
34
|
left: 0;
|
|
@@ -36,9 +36,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
36
36
|
height: 100%;
|
|
37
37
|
border: 0;
|
|
38
38
|
pointer-events: none;
|
|
39
|
-
`,document.body.appendChild(u),o.layout||(o.layout="custom-v1"),ne.wrap(u,o)}},{key:"getCallInstance",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0;return o?Be[o]:Object.values(Be)[0]}}]),ne}();function Ke(t,e){var n={};for(var r in t)if(t[r]instanceof MediaStreamTrack)n[r]=yt;else if(r==="dailyConfig"){if(t[r].modifyLocalSdpHook){var i=window._daily.instances[e].customCallbacks||{};i.modifyLocalSdpHook=t[r].modifyLocalSdpHook,window._daily.instances[e].customCallbacks=i,delete t[r].modifyLocalSdpHook}if(t[r].modifyRemoteSdpHook){var s=window._daily.instances[e].customCallbacks||{};s.modifyRemoteSdpHook=t[r].modifyRemoteSdpHook,window._daily.instances[e].customCallbacks=s,delete t[r].modifyRemoteSdpHook}n[r]=t[r]}else n[r]=t[r];return n}function q(t){var e=arguments.length>2?arguments[2]:void 0;if(t!==Qe){var n="".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method"," only supported after join.");throw e&&(n+=" ".concat(e)),console.error(n),new Error(n)}}function Wt(t,e){return[Qn,Qe].includes(t)||e}function Dn(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"This daily-js method",r=arguments.length>3?arguments[3]:void 0;if(Wt(t,e)){var i="".concat(n," not supported after joining a meeting.");throw r&&(i+=" ".concat(r)),console.error(i),new Error(i)}}function zt(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method",n=arguments.length>2?arguments[2]:void 0;if(!t){var r="".concat(e,arguments.length>3&&arguments[3]!==void 0&&arguments[3]?" requires preAuth() or startCamera() to initialize call state.":" requires preAuth(), startCamera(), or join() to initialize call state.");throw n&&(r+=" ".concat(n)),console.error(r),new Error(r)}}function xn(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 ce(t){if(!t){var e="".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method"," is only supported on custom callObject instances");throw console.error(e),new Error(e)}}function Z(t){if(t){var e="".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method"," is only supported as part of Daily's Prebuilt");throw console.error(e),new Error(e)}}function x(){if(N())throw new Error("This daily-js method is not currently supported in React Native")}function mt(){if(!N())throw new Error("This daily-js method is only supported in React Native")}function vo(t){if(t===void 0)return!0;var e;if(typeof t=="string")e=t;else try{e=JSON.stringify(t),Q(JSON.parse(e),t)||console.warn("The userData provided will be modified when serialized.")}catch(n){throw Error("userData must be serializable to JSON: ".concat(n))}if(e.length>4096)throw Error("userData is too large (".concat(e.length," characters). Maximum size suppported is ").concat(4096,"."));return!0}function yo(t,e){for(var n=e.allowAllParticipantsKey,r=function(f){var _=["local"];return n||_.push("*"),f&&!_.includes(f)},i=function(f){return!!(f.layer===void 0||Number.isInteger(f.layer)&&f.layer>=0||f.layer==="inherit")},s=function(f){return!!f&&!(f.video&&!i(f.video))&&!(f.screenVideo&&!i(f.screenVideo))},a=0,c=Object.entries(t);a<c.length;a++){var l=$e(c[a],2),p=l[0],h=l[1];if(!r(p)||!s(h))return!1}return!0}function _o(t){return U(t)==="object"&&!(t.video&&(U(t.video)!=="object"||!function(i){var s=["type","config"];return!i||U(i)!=="object"||!function(a){return typeof a!="string"?!1:Object.values(Yt).includes(a)?!0:(console.error("inputSettings video processor type invalid"),!1)}(i.type)||i.config&&(U(i.config)!=="object"||!function(a,c){var l=Object.keys(c);if(l.length===0)return!0;var p="invalid object in inputSettings -> video -> processor -> config";switch(a){case Yt.BGBLUR:return l.length>1||l[0]!=="strength"?(console.error(p),!1):!(typeof c.strength!="number"||c.strength<=0||c.strength>1||isNaN(c.strength))||(console.error("".concat(p,"; expected: {0 < strength <= 1}, got: ").concat(c.strength)),!1);case Yt.BGIMAGE:return!(c.source!==void 0&&!function(h){if(h.source==="default")return h.type="default",!0;if(h.source instanceof ArrayBuffer)return!0;if(St(h.source))return h.type="url",!!function(k){var v=new URL(k),b=v.pathname;if(v.protocol==="data:")try{var T=b.substring(b.indexOf(":")+1,b.indexOf(";")).split("/")[1];return On.includes(T)}catch(B){return console.error("failed to deduce blob content type",B),!1}var M=b.split(".").at(-1).toLowerCase().trim();return On.includes(M)}(h.source)||(console.error("invalid image type; supported types: [".concat(On.join(", "),"]")),!1);return f=h.source,_=Number(f),isNaN(_)||!Number.isInteger(_)||_<=0||_>Xi?(console.error("invalid image selection; must be an int, > 0, <= ".concat(Xi)),!1):(h.type="daily-preselect",!0);var f,_}(c));default:return!0}}(i.type,i.config))?!1:(Object.keys(i).filter(function(a){return!s.includes(a)}).forEach(function(a){console.warn("invalid key inputSettings -> video -> processor : ".concat(a)),delete i[a]}),!0)}(t.video.processor)))&&!(t.audio&&(U(t.audio)!=="object"||(n=t.audio.processor,r=["type"],!n||U(n)!=="object"||(Object.keys(n).filter(function(i){return!r.includes(i)}).forEach(function(i){console.warn("invalid key inputSettings -> audio -> processor : ".concat(i)),delete n[i]}),e=n.type,typeof e!="string"||!Object.values(co).includes(e)&&(console.error("inputSettings audio processor type invalid"),1)))));var e,n,r}function bo(t,e){var n,r=[];t.video&&!uo((n=e==null?void 0:e.useLegacyVideoProcessor)!==null&&n!==void 0&&n)&&(delete t.video,r.push("video")),t.audio&&!ho()&&(delete t.audio,r.push("audio")),r.length>0&&console.error("Ignoring settings for browser- or platform-unsupported input processor(s): ".concat(r.join(", ")))}function or(){var t=Object.values(Yt).join(" | "),e=Object.values(co).join(" | ");return"inputSettings must be of the form: { video?: { processor: { type: [ ".concat(t," ], config?: {} } }, audio?: { processor: {type: [ ").concat(e," ] } } }")}function wo(t){var e=t.allowAllParticipantsKey;return"receiveSettings must be of the form { [<remote participant id> | ".concat(tc).concat(e?' | "'.concat(nc,'"'):"","]: ")+'{ [video: [{ layer: [<non-negative integer> | "inherit"] } | "inherit"]], [screenVideo: [{ layer: [<non-negative integer> | "inherit"] } | "inherit"]] }}}'}function So(){return"customIntegrations should be an object of type ".concat(JSON.stringify(sr),".")}function ko(t){if(t&&U(t)!=="object"||Array.isArray(t))return console.error("customTrayButtons should be an Object of the type ".concat(JSON.stringify(on),".")),!1;if(t)for(var e=0,n=Object.entries(t);e<n.length;e++)for(var r=$e(n[e],1)[0],i=0,s=Object.entries(t[r]);i<s.length;i++){var a=$e(s[i],2),c=a[0],l=a[1];if(c==="iconPath"&&!St(l)||c==="iconPathDarkMode"&&!St(l))return console.error("customTrayButton ".concat(c," should be a url.")),!1;var p=on.id[c];if(!p)return console.error("customTrayButton does not support key ".concat(c)),!1;if(U(l)!==p)return console.error("customTrayButton ".concat(c," should be a ").concat(p,".")),!1}return!0}function Eo(t){if(!t||t&&U(t)!=="object"||Array.isArray(t))return console.error(So()),!1;for(var e=function(f){return"".concat(f," should be ").concat(sr.id[f])},n=function(f,_){return console.error("customIntegration ".concat(f,": ").concat(_))},r=0,i=Object.entries(t);r<i.length;r++){var s=$e(i[r],1)[0];if(!("label"in t[s]))return n(s,"label is required"),!1;if(!("location"in t[s]))return n(s,"location is required"),!1;if(!("src"in t[s])&&!("srcdoc"in t[s]))return n(s,"src or srcdoc is required"),!1;for(var a=0,c=Object.entries(t[s]);a<c.length;a++){var l=$e(c[a],2),p=l[0],h=l[1];switch(p){case"allow":case"csp":case"name":case"referrerPolicy":case"sandbox":if(typeof h!="string")return n(s,e(p)),!1;break;case"iconURL":if(!St(h))return n(s,"".concat(p," should be a url")),!1;break;case"src":if("srcdoc"in t[s])return n(s,"cannot have both src and srcdoc"),!1;if(!St(h))return n(s,'src "'.concat(h,'" is not a valid URL')),!1;break;case"srcdoc":if("src"in t[s])return n(s,"cannot have both src and srcdoc"),!1;if(typeof h!="string")return n(s,e(p)),!1;break;case"location":if(!["main","sidebar"].includes(h))return n(s,e(p)),!1;break;case"controlledBy":if(h!=="*"&&h!=="owners"&&(!Array.isArray(h)||h.some(function(f){return typeof f!="string"})))return n(s,e(p)),!1;break;case"shared":if((!Array.isArray(h)||h.some(function(f){return typeof f!="string"}))&&h!=="owners"&&typeof h!="boolean")return n(s,e(p)),!1;break;default:if(!sr.id[p])return console.error("customIntegration does not support key ".concat(p)),!1}}}return!0}function To(t,e){if(e===void 0)return!1;switch(U(e)){case"string":return U(t)===e;case"object":if(U(t)!=="object")return!1;for(var n in t)if(!To(t[n],e[n]))return!1;return!0;default:return!1}}function _s(t,e){var n=t.sessionId,r=t.toEndPoint,i=t.useSipRefer;if(!n||!r)throw new Error("".concat(e,"() requires a sessionId and toEndPoint"));if(typeof n!="string"||typeof r!="string")throw new Error("Invalid paramater: sessionId and toEndPoint must be of type string");if(i&&!r.startsWith("sip:"))throw new Error('"toEndPoint" must be a "sip" address');if(!r.startsWith("sip:")&&!r.startsWith("+"))throw new Error("toEndPoint: ".concat(r,' must starts with either "sip:" or "+"'))}function bs(t){if(U(t)!=="object")throw new Error('RemoteMediaPlayerSettings: must be "object" type');if(t.state&&!Object.values(Xn).includes(t.state))throw new Error("Invalid value for RemoteMediaPlayerSettings.state, valid values are: "+JSON.stringify(Xn));if(t.volume){if(typeof t.volume!="number")throw new Error('RemoteMediaPlayerSettings.volume: must be "number" type');if(t.volume<0||t.volume>2)throw new Error("RemoteMediaPlayerSettings.volume: must be between 0.0 - 2.0")}}function ws(t,e,n){return!(typeof t!="number"||t<e||t>n)}function Ln(t,e){return t&&!e&&delete t.data,t}function Co(t,e){return function(){return t.apply(e,arguments)}}const{toString:Rl}=Object.prototype,{getPrototypeOf:Cr}=Object,fn=(t=>e=>{const n=Rl.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),me=t=>(t=t.toLowerCase(),e=>fn(e)===t),mn=t=>e=>typeof e===t,{isArray:ut}=Array,Ot=mn("undefined");function Dl(t){return t!==null&&!Ot(t)&&t.constructor!==null&&!Ot(t.constructor)&&se(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Mo=me("ArrayBuffer");function xl(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Mo(t.buffer),e}const Ll=mn("string"),se=mn("function"),Oo=mn("number"),gn=t=>t!==null&&typeof t=="object",Nl=t=>t===!0||t===!1,Kt=t=>{if(fn(t)!=="object")return!1;const e=Cr(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},jl=me("Date"),Il=me("File"),Bl=me("Blob"),Fl=me("FileList"),Ul=t=>gn(t)&&se(t.pipe),ql=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||se(t.append)&&((e=fn(t))==="formdata"||e==="object"&&se(t.toString)&&t.toString()==="[object FormData]"))},Jl=me("URLSearchParams"),[Vl,$l,Gl,zl]=["ReadableStream","Request","Response","Headers"].map(me),Hl=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function At(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,i;if(typeof t!="object"&&(t=[t]),ut(t))for(r=0,i=t.length;r<i;r++)e.call(null,t[r],r,t);else{const s=n?Object.getOwnPropertyNames(t):Object.keys(t),a=s.length;let c;for(r=0;r<a;r++)c=s[r],e.call(null,t[c],c,t)}}function Po(t,e){e=e.toLowerCase();const n=Object.keys(t);let r=n.length,i;for(;r-- >0;)if(i=n[r],e===i.toLowerCase())return i;return null}const Ao=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ro=t=>!Ot(t)&&t!==Ao;function ar(){const{caseless:t}=Ro(this)&&this||{},e={},n=(r,i)=>{const s=t&&Po(e,i)||i;Kt(e[s])&&Kt(r)?e[s]=ar(e[s],r):Kt(r)?e[s]=ar({},r):ut(r)?e[s]=r.slice():e[s]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&At(arguments[r],n);return e}const Yl=(t,e,n,{allOwnKeys:r}={})=>(At(e,(i,s)=>{n&&se(i)?t[s]=Co(i,n):t[s]=i},{allOwnKeys:r}),t),Wl=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Kl=(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)},Ql=(t,e,n,r)=>{let i,s,a;const c={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),s=i.length;s-- >0;)a=i[s],(!r||r(a,t,e))&&!c[a]&&(e[a]=t[a],c[a]=!0);t=n!==!1&&Cr(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},Xl=(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},Zl=t=>{if(!t)return null;if(ut(t))return t;let e=t.length;if(!Oo(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},eu=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Cr(Uint8Array)),tu=(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let i;for(;(i=r.next())&&!i.done;){const s=i.value;e.call(t,s[0],s[1])}},nu=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},ru=me("HTMLFormElement"),iu=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),Ss=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),su=me("RegExp"),Do=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};At(n,(i,s)=>{let a;(a=e(i,s,t))!==!1&&(r[s]=a||i)}),Object.defineProperties(t,r)},ou=t=>{Do(t,(e,n)=>{if(se(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(se(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+"'")})}})},au=(t,e)=>{const n={},r=i=>{i.forEach(s=>{n[s]=!0})};return ut(t)?r(t):r(String(t).split(e)),n},cu=()=>{},lu=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e,Nn="abcdefghijklmnopqrstuvwxyz",ks="0123456789",xo={DIGIT:ks,ALPHA:Nn,ALPHA_DIGIT:Nn+Nn.toUpperCase()+ks},uu=(t=16,e=xo.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n};function du(t){return!!(t&&se(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const hu=t=>{const e=new Array(10),n=(r,i)=>{if(gn(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[i]=r;const s=ut(r)?[]:{};return At(r,(a,c)=>{const l=n(a,i+1);!Ot(l)&&(s[c]=l)}),e[i]=void 0,s}}return r};return n(t,0)},pu=me("AsyncFunction"),fu=t=>t&&(gn(t)||se(t))&&se(t.then)&&se(t.catch),y={isArray:ut,isArrayBuffer:Mo,isBuffer:Dl,isFormData:ql,isArrayBufferView:xl,isString:Ll,isNumber:Oo,isBoolean:Nl,isObject:gn,isPlainObject:Kt,isReadableStream:Vl,isRequest:$l,isResponse:Gl,isHeaders:zl,isUndefined:Ot,isDate:jl,isFile:Il,isBlob:Bl,isRegExp:su,isFunction:se,isStream:Ul,isURLSearchParams:Jl,isTypedArray:eu,isFileList:Fl,forEach:At,merge:ar,extend:Yl,trim:Hl,stripBOM:Wl,inherits:Kl,toFlatObject:Ql,kindOf:fn,kindOfTest:me,endsWith:Xl,toArray:Zl,forEachEntry:tu,matchAll:nu,isHTMLForm:ru,hasOwnProperty:Ss,hasOwnProp:Ss,reduceDescriptors:Do,freezeMethods:ou,toObjectSet:au,toCamelCase:iu,noop:cu,toFiniteNumber:lu,findKey:Po,global:Ao,isContextDefined:Ro,ALPHABET:xo,generateString:uu,isSpecCompliantForm:du,toJSONObject:hu,isAsyncFn:pu,isThenable:fu};function A(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}y.inherits(A,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:y.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Lo=A.prototype,No={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{No[t]={value:t}});Object.defineProperties(A,No);Object.defineProperty(Lo,"isAxiosError",{value:!0});A.from=(t,e,n,r,i,s)=>{const a=Object.create(Lo);return y.toFlatObject(t,a,function(l){return l!==Error.prototype},c=>c!=="isAxiosError"),A.call(a,t.message,e,n,r,i),a.cause=t,a.name=t.name,s&&Object.assign(a,s),a};const mu=null;function cr(t){return y.isPlainObject(t)||y.isArray(t)}function jo(t){return y.endsWith(t,"[]")?t.slice(0,-2):t}function Es(t,e,n){return t?t.concat(e).map(function(i,s){return i=jo(i),!n&&s?"["+i+"]":i}).join(n?".":""):e}function gu(t){return y.isArray(t)&&!t.some(cr)}const vu=y.toFlatObject(y,{},null,function(e){return/^is[A-Z]/.test(e)});function vn(t,e,n){if(!y.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=y.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,T){return!y.isUndefined(T[b])});const r=n.metaTokens,i=n.visitor||h,s=n.dots,a=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&y.isSpecCompliantForm(e);if(!y.isFunction(i))throw new TypeError("visitor must be a function");function p(v){if(v===null)return"";if(y.isDate(v))return v.toISOString();if(!l&&y.isBlob(v))throw new A("Blob is not supported. Use a Buffer instead.");return y.isArrayBuffer(v)||y.isTypedArray(v)?l&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function h(v,b,T){let M=v;if(v&&!T&&typeof v=="object"){if(y.endsWith(b,"{}"))b=r?b:b.slice(0,-2),v=JSON.stringify(v);else if(y.isArray(v)&&gu(v)||(y.isFileList(v)||y.endsWith(b,"[]"))&&(M=y.toArray(v)))return b=jo(b),M.forEach(function(L,te){!(y.isUndefined(L)||L===null)&&e.append(a===!0?Es([b],te,s):a===null?b:b+"[]",p(L))}),!1}return cr(v)?!0:(e.append(Es(T,b,s),p(v)),!1)}const f=[],_=Object.assign(vu,{defaultVisitor:h,convertValue:p,isVisitable:cr});function k(v,b){if(!y.isUndefined(v)){if(f.indexOf(v)!==-1)throw Error("Circular reference detected in "+b.join("."));f.push(v),y.forEach(v,function(M,B){(!(y.isUndefined(M)||M===null)&&i.call(e,M,y.isString(B)?B.trim():B,b,_))===!0&&k(M,b?b.concat(B):[B])}),f.pop()}}if(!y.isObject(t))throw new TypeError("data must be an object");return k(t),e}function Ts(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function Mr(t,e){this._pairs=[],t&&vn(t,this,e)}const Io=Mr.prototype;Io.append=function(e,n){this._pairs.push([e,n])};Io.toString=function(e){const n=e?function(r){return e.call(this,r,Ts)}:Ts;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function yu(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Bo(t,e,n){if(!e)return t;const r=n&&n.encode||yu,i=n&&n.serialize;let s;if(i?s=i(e,n):s=y.isURLSearchParams(e)?e.toString():new Mr(e,n).toString(r),s){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class Cs{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){y.forEach(this.handlers,function(r){r!==null&&e(r)})}}const Fo={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},_u=typeof URLSearchParams<"u"?URLSearchParams:Mr,bu=typeof FormData<"u"?FormData:null,wu=typeof Blob<"u"?Blob:null,Su={isBrowser:!0,classes:{URLSearchParams:_u,FormData:bu,Blob:wu},protocols:["http","https","file","blob","url","data"]},Or=typeof window<"u"&&typeof document<"u",ku=(t=>Or&&["ReactNative","NativeScript","NS"].indexOf(t)<0)(typeof navigator<"u"&&navigator.product),Eu=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Tu=Or&&window.location.href||"http://localhost",Cu=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Or,hasStandardBrowserEnv:ku,hasStandardBrowserWebWorkerEnv:Eu,origin:Tu},Symbol.toStringTag,{value:"Module"})),ue={...Cu,...Su};function Mu(t,e){return vn(t,new ue.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,s){return ue.isNode&&y.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function Ou(t){return y.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Pu(t){const e={},n=Object.keys(t);let r;const i=n.length;let s;for(r=0;r<i;r++)s=n[r],e[s]=t[s];return e}function Uo(t){function e(n,r,i,s){let a=n[s++];if(a==="__proto__")return!0;const c=Number.isFinite(+a),l=s>=n.length;return a=!a&&y.isArray(i)?i.length:a,l?(y.hasOwnProp(i,a)?i[a]=[i[a],r]:i[a]=r,!c):((!i[a]||!y.isObject(i[a]))&&(i[a]=[]),e(n,r,i[a],s)&&y.isArray(i[a])&&(i[a]=Pu(i[a])),!c)}if(y.isFormData(t)&&y.isFunction(t.entries)){const n={};return y.forEachEntry(t,(r,i)=>{e(Ou(r),i,n,0)}),n}return null}function Au(t,e,n){if(y.isString(t))try{return(e||JSON.parse)(t),y.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const Rt={transitional:Fo,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,s=y.isObject(e);if(s&&y.isHTMLForm(e)&&(e=new FormData(e)),y.isFormData(e))return i?JSON.stringify(Uo(e)):e;if(y.isArrayBuffer(e)||y.isBuffer(e)||y.isStream(e)||y.isFile(e)||y.isBlob(e)||y.isReadableStream(e))return e;if(y.isArrayBufferView(e))return e.buffer;if(y.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 Mu(e,this.formSerializer).toString();if((c=y.isFileList(e))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return vn(c?{"files[]":e}:e,l&&new l,this.formSerializer)}}return s||i?(n.setContentType("application/json",!1),Au(e)):e}],transformResponse:[function(e){const n=this.transitional||Rt.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(y.isResponse(e)||y.isReadableStream(e))return e;if(e&&y.isString(e)&&(r&&!this.responseType||i)){const a=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(c){if(a)throw c.name==="SyntaxError"?A.from(c,A.ERR_BAD_RESPONSE,this,null,this.response):c}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ue.classes.FormData,Blob:ue.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};y.forEach(["delete","get","head","post","put","patch"],t=>{Rt.headers[t]={}});const Ru=y.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"]),Du=t=>{const e={};let n,r,i;return t&&t.split(`
|
|
39
|
+
`,document.body.appendChild(u),o.layout||(o.layout="custom-v1"),re.wrap(u,o)}},{key:"getCallInstance",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0;return o?Be[o]:Object.values(Be)[0]}}]),re}();function Ke(t,e){var n={};for(var r in t)if(t[r]instanceof MediaStreamTrack)n[r]=yt;else if(r==="dailyConfig"){if(t[r].modifyLocalSdpHook){var i=window._daily.instances[e].customCallbacks||{};i.modifyLocalSdpHook=t[r].modifyLocalSdpHook,window._daily.instances[e].customCallbacks=i,delete t[r].modifyLocalSdpHook}if(t[r].modifyRemoteSdpHook){var s=window._daily.instances[e].customCallbacks||{};s.modifyRemoteSdpHook=t[r].modifyRemoteSdpHook,window._daily.instances[e].customCallbacks=s,delete t[r].modifyRemoteSdpHook}n[r]=t[r]}else n[r]=t[r];return n}function q(t){var e=arguments.length>2?arguments[2]:void 0;if(t!==Qe){var n="".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method"," only supported after join.");throw e&&(n+=" ".concat(e)),console.error(n),new Error(n)}}function Wt(t,e){return[Qn,Qe].includes(t)||e}function Dn(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"This daily-js method",r=arguments.length>3?arguments[3]:void 0;if(Wt(t,e)){var i="".concat(n," not supported after joining a meeting.");throw r&&(i+=" ".concat(r)),console.error(i),new Error(i)}}function zt(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method",n=arguments.length>2?arguments[2]:void 0;if(!t){var r="".concat(e,arguments.length>3&&arguments[3]!==void 0&&arguments[3]?" requires preAuth() or startCamera() to initialize call state.":" requires preAuth(), startCamera(), or join() to initialize call state.");throw n&&(r+=" ".concat(n)),console.error(r),new Error(r)}}function xn(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 ce(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 ee(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 x(){if(N())throw new Error("This daily-js method is not currently supported in React Native")}function mt(){if(!N())throw new Error("This daily-js method is only supported in React Native")}function vo(t){if(t===void 0)return!0;var e;if(typeof t=="string")e=t;else try{e=JSON.stringify(t),Q(JSON.parse(e),t)||console.warn("The userData provided will be modified when serialized.")}catch(n){throw Error("userData must be serializable to JSON: ".concat(n))}if(e.length>4096)throw Error("userData is too large (".concat(e.length," characters). Maximum size suppported is ").concat(4096,"."));return!0}function yo(t,e){for(var n=e.allowAllParticipantsKey,r=function(f){var _=["local"];return n||_.push("*"),f&&!_.includes(f)},i=function(f){return!!(f.layer===void 0||Number.isInteger(f.layer)&&f.layer>=0||f.layer==="inherit")},s=function(f){return!!f&&!(f.video&&!i(f.video))&&!(f.screenVideo&&!i(f.screenVideo))},a=0,c=Object.entries(t);a<c.length;a++){var l=$e(c[a],2),p=l[0],h=l[1];if(!r(p)||!s(h))return!1}return!0}function _o(t){return U(t)==="object"&&!(t.video&&(U(t.video)!=="object"||!function(i){var s=["type","config"];return!i||U(i)!=="object"||!function(a){return typeof a!="string"?!1:Object.values(Yt).includes(a)?!0:(console.error("inputSettings video processor type invalid"),!1)}(i.type)||i.config&&(U(i.config)!=="object"||!function(a,c){var l=Object.keys(c);if(l.length===0)return!0;var p="invalid object in inputSettings -> video -> processor -> config";switch(a){case Yt.BGBLUR:return l.length>1||l[0]!=="strength"?(console.error(p),!1):!(typeof c.strength!="number"||c.strength<=0||c.strength>1||isNaN(c.strength))||(console.error("".concat(p,"; expected: {0 < strength <= 1}, got: ").concat(c.strength)),!1);case Yt.BGIMAGE:return!(c.source!==void 0&&!function(h){if(h.source==="default")return h.type="default",!0;if(h.source instanceof ArrayBuffer)return!0;if(St(h.source))return h.type="url",!!function(k){var v=new URL(k),b=v.pathname;if(v.protocol==="data:")try{var T=b.substring(b.indexOf(":")+1,b.indexOf(";")).split("/")[1];return On.includes(T)}catch(B){return console.error("failed to deduce blob content type",B),!1}var M=b.split(".").at(-1).toLowerCase().trim();return On.includes(M)}(h.source)||(console.error("invalid image type; supported types: [".concat(On.join(", "),"]")),!1);return f=h.source,_=Number(f),isNaN(_)||!Number.isInteger(_)||_<=0||_>Xi?(console.error("invalid image selection; must be an int, > 0, <= ".concat(Xi)),!1):(h.type="daily-preselect",!0);var f,_}(c));default:return!0}}(i.type,i.config))?!1:(Object.keys(i).filter(function(a){return!s.includes(a)}).forEach(function(a){console.warn("invalid key inputSettings -> video -> processor : ".concat(a)),delete i[a]}),!0)}(t.video.processor)))&&!(t.audio&&(U(t.audio)!=="object"||(n=t.audio.processor,r=["type"],!n||U(n)!=="object"||(Object.keys(n).filter(function(i){return!r.includes(i)}).forEach(function(i){console.warn("invalid key inputSettings -> audio -> processor : ".concat(i)),delete n[i]}),e=n.type,typeof e!="string"||!Object.values(co).includes(e)&&(console.error("inputSettings audio processor type invalid"),1)))));var e,n,r}function bo(t,e){var n,r=[];t.video&&!uo((n=e==null?void 0:e.useLegacyVideoProcessor)!==null&&n!==void 0&&n)&&(delete t.video,r.push("video")),t.audio&&!ho()&&(delete t.audio,r.push("audio")),r.length>0&&console.error("Ignoring settings for browser- or platform-unsupported input processor(s): ".concat(r.join(", ")))}function or(){var t=Object.values(Yt).join(" | "),e=Object.values(co).join(" | ");return"inputSettings must be of the form: { video?: { processor: { type: [ ".concat(t," ], config?: {} } }, audio?: { processor: {type: [ ").concat(e," ] } } }")}function wo(t){var e=t.allowAllParticipantsKey;return"receiveSettings must be of the form { [<remote participant id> | ".concat(tc).concat(e?' | "'.concat(nc,'"'):"","]: ")+'{ [video: [{ layer: [<non-negative integer> | "inherit"] } | "inherit"]], [screenVideo: [{ layer: [<non-negative integer> | "inherit"] } | "inherit"]] }}}'}function So(){return"customIntegrations should be an object of type ".concat(JSON.stringify(sr),".")}function ko(t){if(t&&U(t)!=="object"||Array.isArray(t))return console.error("customTrayButtons should be an Object of the type ".concat(JSON.stringify(on),".")),!1;if(t)for(var e=0,n=Object.entries(t);e<n.length;e++)for(var r=$e(n[e],1)[0],i=0,s=Object.entries(t[r]);i<s.length;i++){var a=$e(s[i],2),c=a[0],l=a[1];if(c==="iconPath"&&!St(l)||c==="iconPathDarkMode"&&!St(l))return console.error("customTrayButton ".concat(c," should be a url.")),!1;var p=on.id[c];if(!p)return console.error("customTrayButton does not support key ".concat(c)),!1;if(U(l)!==p)return console.error("customTrayButton ".concat(c," should be a ").concat(p,".")),!1}return!0}function Eo(t){if(!t||t&&U(t)!=="object"||Array.isArray(t))return console.error(So()),!1;for(var e=function(f){return"".concat(f," should be ").concat(sr.id[f])},n=function(f,_){return console.error("customIntegration ".concat(f,": ").concat(_))},r=0,i=Object.entries(t);r<i.length;r++){var s=$e(i[r],1)[0];if(!("label"in t[s]))return n(s,"label is required"),!1;if(!("location"in t[s]))return n(s,"location is required"),!1;if(!("src"in t[s])&&!("srcdoc"in t[s]))return n(s,"src or srcdoc is required"),!1;for(var a=0,c=Object.entries(t[s]);a<c.length;a++){var l=$e(c[a],2),p=l[0],h=l[1];switch(p){case"allow":case"csp":case"name":case"referrerPolicy":case"sandbox":if(typeof h!="string")return n(s,e(p)),!1;break;case"iconURL":if(!St(h))return n(s,"".concat(p," should be a url")),!1;break;case"src":if("srcdoc"in t[s])return n(s,"cannot have both src and srcdoc"),!1;if(!St(h))return n(s,'src "'.concat(h,'" is not a valid URL')),!1;break;case"srcdoc":if("src"in t[s])return n(s,"cannot have both src and srcdoc"),!1;if(typeof h!="string")return n(s,e(p)),!1;break;case"location":if(!["main","sidebar"].includes(h))return n(s,e(p)),!1;break;case"controlledBy":if(h!=="*"&&h!=="owners"&&(!Array.isArray(h)||h.some(function(f){return typeof f!="string"})))return n(s,e(p)),!1;break;case"shared":if((!Array.isArray(h)||h.some(function(f){return typeof f!="string"}))&&h!=="owners"&&typeof h!="boolean")return n(s,e(p)),!1;break;default:if(!sr.id[p])return console.error("customIntegration does not support key ".concat(p)),!1}}}return!0}function To(t,e){if(e===void 0)return!1;switch(U(e)){case"string":return U(t)===e;case"object":if(U(t)!=="object")return!1;for(var n in t)if(!To(t[n],e[n]))return!1;return!0;default:return!1}}function _s(t,e){var n=t.sessionId,r=t.toEndPoint,i=t.useSipRefer;if(!n||!r)throw new Error("".concat(e,"() requires a sessionId and toEndPoint"));if(typeof n!="string"||typeof r!="string")throw new Error("Invalid paramater: sessionId and toEndPoint must be of type string");if(i&&!r.startsWith("sip:"))throw new Error('"toEndPoint" must be a "sip" address');if(!r.startsWith("sip:")&&!r.startsWith("+"))throw new Error("toEndPoint: ".concat(r,' must starts with either "sip:" or "+"'))}function bs(t){if(U(t)!=="object")throw new Error('RemoteMediaPlayerSettings: must be "object" type');if(t.state&&!Object.values(Xn).includes(t.state))throw new Error("Invalid value for RemoteMediaPlayerSettings.state, valid values are: "+JSON.stringify(Xn));if(t.volume){if(typeof t.volume!="number")throw new Error('RemoteMediaPlayerSettings.volume: must be "number" type');if(t.volume<0||t.volume>2)throw new Error("RemoteMediaPlayerSettings.volume: must be between 0.0 - 2.0")}}function ws(t,e,n){return!(typeof t!="number"||t<e||t>n)}function Ln(t,e){return t&&!e&&delete t.data,t}function Co(t,e){return function(){return t.apply(e,arguments)}}const{toString:Rl}=Object.prototype,{getPrototypeOf:Cr}=Object,fn=(t=>e=>{const n=Rl.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),me=t=>(t=t.toLowerCase(),e=>fn(e)===t),mn=t=>e=>typeof e===t,{isArray:ut}=Array,Ot=mn("undefined");function Dl(t){return t!==null&&!Ot(t)&&t.constructor!==null&&!Ot(t.constructor)&&se(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Mo=me("ArrayBuffer");function xl(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Mo(t.buffer),e}const Ll=mn("string"),se=mn("function"),Oo=mn("number"),gn=t=>t!==null&&typeof t=="object",Nl=t=>t===!0||t===!1,Kt=t=>{if(fn(t)!=="object")return!1;const e=Cr(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},jl=me("Date"),Il=me("File"),Bl=me("Blob"),Fl=me("FileList"),Ul=t=>gn(t)&&se(t.pipe),ql=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||se(t.append)&&((e=fn(t))==="formdata"||e==="object"&&se(t.toString)&&t.toString()==="[object FormData]"))},Jl=me("URLSearchParams"),[Vl,$l,Gl,zl]=["ReadableStream","Request","Response","Headers"].map(me),Hl=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function At(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,i;if(typeof t!="object"&&(t=[t]),ut(t))for(r=0,i=t.length;r<i;r++)e.call(null,t[r],r,t);else{const s=n?Object.getOwnPropertyNames(t):Object.keys(t),a=s.length;let c;for(r=0;r<a;r++)c=s[r],e.call(null,t[c],c,t)}}function Po(t,e){e=e.toLowerCase();const n=Object.keys(t);let r=n.length,i;for(;r-- >0;)if(i=n[r],e===i.toLowerCase())return i;return null}const Ao=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ro=t=>!Ot(t)&&t!==Ao;function ar(){const{caseless:t}=Ro(this)&&this||{},e={},n=(r,i)=>{const s=t&&Po(e,i)||i;Kt(e[s])&&Kt(r)?e[s]=ar(e[s],r):Kt(r)?e[s]=ar({},r):ut(r)?e[s]=r.slice():e[s]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&At(arguments[r],n);return e}const Yl=(t,e,n,{allOwnKeys:r}={})=>(At(e,(i,s)=>{n&&se(i)?t[s]=Co(i,n):t[s]=i},{allOwnKeys:r}),t),Wl=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Kl=(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)},Ql=(t,e,n,r)=>{let i,s,a;const c={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),s=i.length;s-- >0;)a=i[s],(!r||r(a,t,e))&&!c[a]&&(e[a]=t[a],c[a]=!0);t=n!==!1&&Cr(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},Xl=(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},Zl=t=>{if(!t)return null;if(ut(t))return t;let e=t.length;if(!Oo(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},eu=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Cr(Uint8Array)),tu=(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let i;for(;(i=r.next())&&!i.done;){const s=i.value;e.call(t,s[0],s[1])}},nu=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},ru=me("HTMLFormElement"),iu=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),Ss=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),su=me("RegExp"),Do=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};At(n,(i,s)=>{let a;(a=e(i,s,t))!==!1&&(r[s]=a||i)}),Object.defineProperties(t,r)},ou=t=>{Do(t,(e,n)=>{if(se(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(se(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+"'")})}})},au=(t,e)=>{const n={},r=i=>{i.forEach(s=>{n[s]=!0})};return ut(t)?r(t):r(String(t).split(e)),n},cu=()=>{},lu=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e,Nn="abcdefghijklmnopqrstuvwxyz",ks="0123456789",xo={DIGIT:ks,ALPHA:Nn,ALPHA_DIGIT:Nn+Nn.toUpperCase()+ks},uu=(t=16,e=xo.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n};function du(t){return!!(t&&se(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const hu=t=>{const e=new Array(10),n=(r,i)=>{if(gn(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[i]=r;const s=ut(r)?[]:{};return At(r,(a,c)=>{const l=n(a,i+1);!Ot(l)&&(s[c]=l)}),e[i]=void 0,s}}return r};return n(t,0)},pu=me("AsyncFunction"),fu=t=>t&&(gn(t)||se(t))&&se(t.then)&&se(t.catch),y={isArray:ut,isArrayBuffer:Mo,isBuffer:Dl,isFormData:ql,isArrayBufferView:xl,isString:Ll,isNumber:Oo,isBoolean:Nl,isObject:gn,isPlainObject:Kt,isReadableStream:Vl,isRequest:$l,isResponse:Gl,isHeaders:zl,isUndefined:Ot,isDate:jl,isFile:Il,isBlob:Bl,isRegExp:su,isFunction:se,isStream:Ul,isURLSearchParams:Jl,isTypedArray:eu,isFileList:Fl,forEach:At,merge:ar,extend:Yl,trim:Hl,stripBOM:Wl,inherits:Kl,toFlatObject:Ql,kindOf:fn,kindOfTest:me,endsWith:Xl,toArray:Zl,forEachEntry:tu,matchAll:nu,isHTMLForm:ru,hasOwnProperty:Ss,hasOwnProp:Ss,reduceDescriptors:Do,freezeMethods:ou,toObjectSet:au,toCamelCase:iu,noop:cu,toFiniteNumber:lu,findKey:Po,global:Ao,isContextDefined:Ro,ALPHABET:xo,generateString:uu,isSpecCompliantForm:du,toJSONObject:hu,isAsyncFn:pu,isThenable:fu};function A(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}y.inherits(A,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:y.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Lo=A.prototype,No={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{No[t]={value:t}});Object.defineProperties(A,No);Object.defineProperty(Lo,"isAxiosError",{value:!0});A.from=(t,e,n,r,i,s)=>{const a=Object.create(Lo);return y.toFlatObject(t,a,function(l){return l!==Error.prototype},c=>c!=="isAxiosError"),A.call(a,t.message,e,n,r,i),a.cause=t,a.name=t.name,s&&Object.assign(a,s),a};const mu=null;function cr(t){return y.isPlainObject(t)||y.isArray(t)}function jo(t){return y.endsWith(t,"[]")?t.slice(0,-2):t}function Es(t,e,n){return t?t.concat(e).map(function(i,s){return i=jo(i),!n&&s?"["+i+"]":i}).join(n?".":""):e}function gu(t){return y.isArray(t)&&!t.some(cr)}const vu=y.toFlatObject(y,{},null,function(e){return/^is[A-Z]/.test(e)});function vn(t,e,n){if(!y.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=y.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,T){return!y.isUndefined(T[b])});const r=n.metaTokens,i=n.visitor||h,s=n.dots,a=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&y.isSpecCompliantForm(e);if(!y.isFunction(i))throw new TypeError("visitor must be a function");function p(v){if(v===null)return"";if(y.isDate(v))return v.toISOString();if(!l&&y.isBlob(v))throw new A("Blob is not supported. Use a Buffer instead.");return y.isArrayBuffer(v)||y.isTypedArray(v)?l&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function h(v,b,T){let M=v;if(v&&!T&&typeof v=="object"){if(y.endsWith(b,"{}"))b=r?b:b.slice(0,-2),v=JSON.stringify(v);else if(y.isArray(v)&&gu(v)||(y.isFileList(v)||y.endsWith(b,"[]"))&&(M=y.toArray(v)))return b=jo(b),M.forEach(function(L,ne){!(y.isUndefined(L)||L===null)&&e.append(a===!0?Es([b],ne,s):a===null?b:b+"[]",p(L))}),!1}return cr(v)?!0:(e.append(Es(T,b,s),p(v)),!1)}const f=[],_=Object.assign(vu,{defaultVisitor:h,convertValue:p,isVisitable:cr});function k(v,b){if(!y.isUndefined(v)){if(f.indexOf(v)!==-1)throw Error("Circular reference detected in "+b.join("."));f.push(v),y.forEach(v,function(M,B){(!(y.isUndefined(M)||M===null)&&i.call(e,M,y.isString(B)?B.trim():B,b,_))===!0&&k(M,b?b.concat(B):[B])}),f.pop()}}if(!y.isObject(t))throw new TypeError("data must be an object");return k(t),e}function Ts(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function Mr(t,e){this._pairs=[],t&&vn(t,this,e)}const Io=Mr.prototype;Io.append=function(e,n){this._pairs.push([e,n])};Io.toString=function(e){const n=e?function(r){return e.call(this,r,Ts)}:Ts;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function yu(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Bo(t,e,n){if(!e)return t;const r=n&&n.encode||yu,i=n&&n.serialize;let s;if(i?s=i(e,n):s=y.isURLSearchParams(e)?e.toString():new Mr(e,n).toString(r),s){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class Cs{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){y.forEach(this.handlers,function(r){r!==null&&e(r)})}}const Fo={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},_u=typeof URLSearchParams<"u"?URLSearchParams:Mr,bu=typeof FormData<"u"?FormData:null,wu=typeof Blob<"u"?Blob:null,Su={isBrowser:!0,classes:{URLSearchParams:_u,FormData:bu,Blob:wu},protocols:["http","https","file","blob","url","data"]},Or=typeof window<"u"&&typeof document<"u",ku=(t=>Or&&["ReactNative","NativeScript","NS"].indexOf(t)<0)(typeof navigator<"u"&&navigator.product),Eu=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Tu=Or&&window.location.href||"http://localhost",Cu=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Or,hasStandardBrowserEnv:ku,hasStandardBrowserWebWorkerEnv:Eu,origin:Tu},Symbol.toStringTag,{value:"Module"})),ue={...Cu,...Su};function Mu(t,e){return vn(t,new ue.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,s){return ue.isNode&&y.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function Ou(t){return y.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Pu(t){const e={},n=Object.keys(t);let r;const i=n.length;let s;for(r=0;r<i;r++)s=n[r],e[s]=t[s];return e}function Uo(t){function e(n,r,i,s){let a=n[s++];if(a==="__proto__")return!0;const c=Number.isFinite(+a),l=s>=n.length;return a=!a&&y.isArray(i)?i.length:a,l?(y.hasOwnProp(i,a)?i[a]=[i[a],r]:i[a]=r,!c):((!i[a]||!y.isObject(i[a]))&&(i[a]=[]),e(n,r,i[a],s)&&y.isArray(i[a])&&(i[a]=Pu(i[a])),!c)}if(y.isFormData(t)&&y.isFunction(t.entries)){const n={};return y.forEachEntry(t,(r,i)=>{e(Ou(r),i,n,0)}),n}return null}function Au(t,e,n){if(y.isString(t))try{return(e||JSON.parse)(t),y.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const Rt={transitional:Fo,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,s=y.isObject(e);if(s&&y.isHTMLForm(e)&&(e=new FormData(e)),y.isFormData(e))return i?JSON.stringify(Uo(e)):e;if(y.isArrayBuffer(e)||y.isBuffer(e)||y.isStream(e)||y.isFile(e)||y.isBlob(e)||y.isReadableStream(e))return e;if(y.isArrayBufferView(e))return e.buffer;if(y.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 Mu(e,this.formSerializer).toString();if((c=y.isFileList(e))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return vn(c?{"files[]":e}:e,l&&new l,this.formSerializer)}}return s||i?(n.setContentType("application/json",!1),Au(e)):e}],transformResponse:[function(e){const n=this.transitional||Rt.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(y.isResponse(e)||y.isReadableStream(e))return e;if(e&&y.isString(e)&&(r&&!this.responseType||i)){const a=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(c){if(a)throw c.name==="SyntaxError"?A.from(c,A.ERR_BAD_RESPONSE,this,null,this.response):c}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ue.classes.FormData,Blob:ue.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};y.forEach(["delete","get","head","post","put","patch"],t=>{Rt.headers[t]={}});const Ru=y.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"]),Du=t=>{const e={};let n,r,i;return t&&t.split(`
|
|
40
40
|
`).forEach(function(a){i=a.indexOf(":"),n=a.substring(0,i).trim().toLowerCase(),r=a.substring(i+1).trim(),!(!n||e[n]&&Ru[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},Ms=Symbol("internals");function gt(t){return t&&String(t).trim().toLowerCase()}function Qt(t){return t===!1||t==null?t:y.isArray(t)?t.map(Qt):String(t)}function xu(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 Lu=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function jn(t,e,n,r,i){if(y.isFunction(r))return r.call(this,e,n);if(i&&(e=n),!!y.isString(e)){if(y.isString(r))return e.indexOf(r)!==-1;if(y.isRegExp(r))return r.test(e)}}function Nu(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function ju(t,e){const n=y.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(i,s,a){return this[r].call(this,e,i,s,a)},configurable:!0})})}class X{constructor(e){e&&this.set(e)}set(e,n,r){const i=this;function s(c,l,p){const h=gt(l);if(!h)throw new Error("header name must be a non-empty string");const f=y.findKey(i,h);(!f||i[f]===void 0||p===!0||p===void 0&&i[f]!==!1)&&(i[f||l]=Qt(c))}const a=(c,l)=>y.forEach(c,(p,h)=>s(p,h,l));if(y.isPlainObject(e)||e instanceof this.constructor)a(e,n);else if(y.isString(e)&&(e=e.trim())&&!Lu(e))a(Du(e),n);else if(y.isHeaders(e))for(const[c,l]of e.entries())s(l,c,r);else e!=null&&s(n,e,r);return this}get(e,n){if(e=gt(e),e){const r=y.findKey(this,e);if(r){const i=this[r];if(!n)return i;if(n===!0)return xu(i);if(y.isFunction(n))return n.call(this,i,r);if(y.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=gt(e),e){const r=y.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||jn(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let i=!1;function s(a){if(a=gt(a),a){const c=y.findKey(r,a);c&&(!n||jn(r,r[c],c,n))&&(delete r[c],i=!0)}}return y.isArray(e)?e.forEach(s):s(e),i}clear(e){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const s=n[r];(!e||jn(this,this[s],s,e,!0))&&(delete this[s],i=!0)}return i}normalize(e){const n=this,r={};return y.forEach(this,(i,s)=>{const a=y.findKey(r,s);if(a){n[a]=Qt(i),delete n[s];return}const c=e?Nu(s):String(s).trim();c!==s&&delete n[s],n[c]=Qt(i),r[c]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return y.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=e&&y.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
|
|
41
|
-
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[Ms]=this[Ms]={accessors:{}}).accessors,i=this.prototype;function s(a){const c=gt(a);r[c]||(ju(i,a),r[c]=!0)}return y.isArray(e)?e.forEach(s):s(e),this}}X.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);y.reduceDescriptors(X.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});y.freezeMethods(X);function In(t,e){const n=this||Rt,r=e||n,i=X.from(r.headers);let s=r.data;return y.forEach(t,function(c){s=c.call(n,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function qo(t){return!!(t&&t.__CANCEL__)}function dt(t,e,n){A.call(this,t??"canceled",A.ERR_CANCELED,e,n),this.name="CanceledError"}y.inherits(dt,A,{__CANCEL__:!0});function Jo(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new A("Request failed with status code "+n.status,[A.ERR_BAD_REQUEST,A.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Iu(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Bu(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i=0,s=0,a;return e=e!==void 0?e:1e3,function(l){const p=Date.now(),h=r[s];a||(a=p),n[i]=l,r[i]=p;let f=s,_=0;for(;f!==i;)_+=n[f++],f=f%t;if(i=(i+1)%t,i===s&&(s=(s+1)%t),p-a<e)return;const k=h&&p-h;return k?Math.round(_*1e3/k):void 0}}function Fu(t,e){let n=0;const r=1e3/e;let i=null;return function(){const a=this===!0,c=Date.now();if(a||c-n>r)return i&&(clearTimeout(i),i=null),n=c,t.apply(null,arguments);i||(i=setTimeout(()=>(i=null,n=Date.now(),t.apply(null,arguments)),r-(c-n)))}}const an=(t,e,n=3)=>{let r=0;const i=Bu(50,250);return Fu(s=>{const a=s.loaded,c=s.lengthComputable?s.total:void 0,l=a-r,p=i(l),h=a<=c;r=a;const f={loaded:a,total:c,progress:c?a/c:void 0,bytes:l,rate:p||void 0,estimated:p&&c&&h?(c-a)/p:void 0,event:s,lengthComputable:c!=null};f[e?"download":"upload"]=!0,t(f)},n)},Uu=ue.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function i(s){let a=s;return e&&(n.setAttribute("href",a),a=n.href),n.setAttribute("href",a),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(a){const c=y.isString(a)?i(a):a;return c.protocol===r.protocol&&c.host===r.host}}():function(){return function(){return!0}}(),qu=ue.hasStandardBrowserEnv?{write(t,e,n,r,i,s){const a=[t+"="+encodeURIComponent(e)];y.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),y.isString(r)&&a.push("path="+r),y.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 Ju(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Vu(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Vo(t,e){return t&&!Ju(e)?Vu(t,e):e}const Os=t=>t instanceof X?{...t}:t;function We(t,e){e=e||{};const n={};function r(p,h,f){return y.isPlainObject(p)&&y.isPlainObject(h)?y.merge.call({caseless:f},p,h):y.isPlainObject(h)?y.merge({},h):y.isArray(h)?h.slice():h}function i(p,h,f){if(y.isUndefined(h)){if(!y.isUndefined(p))return r(void 0,p,f)}else return r(p,h,f)}function s(p,h){if(!y.isUndefined(h))return r(void 0,h)}function a(p,h){if(y.isUndefined(h)){if(!y.isUndefined(p))return r(void 0,p)}else return r(void 0,h)}function c(p,h,f){if(f in e)return r(p,h);if(f in t)return r(void 0,p)}const l={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c,headers:(p,h)=>i(Os(p),Os(h),!0)};return y.forEach(Object.keys(Object.assign({},t,e)),function(h){const f=l[h]||i,_=f(t[h],e[h],h);y.isUndefined(_)&&f!==c||(n[h]=_)}),n}const $o=t=>{const e=We({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:s,headers:a,auth:c}=e;e.headers=a=X.from(a),e.url=Bo(Vo(e.baseURL,e.url),t.params,t.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let l;if(y.isFormData(n)){if(ue.hasStandardBrowserEnv||ue.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((l=a.getContentType())!==!1){const[p,...h]=l?l.split(";").map(f=>f.trim()).filter(Boolean):[];a.setContentType([p||"multipart/form-data",...h].join("; "))}}if(ue.hasStandardBrowserEnv&&(r&&y.isFunction(r)&&(r=r(e)),r||r!==!1&&Uu(e.url))){const p=i&&s&&qu.read(s);p&&a.set(i,p)}return e},$u=typeof XMLHttpRequest<"u",Gu=$u&&function(t){return new Promise(function(n,r){const i=$o(t);let s=i.data;const a=X.from(i.headers).normalize();let{responseType:c}=i,l;function p(){i.cancelToken&&i.cancelToken.unsubscribe(l),i.signal&&i.signal.removeEventListener("abort",l)}let h=new XMLHttpRequest;h.open(i.method.toUpperCase(),i.url,!0),h.timeout=i.timeout;function f(){if(!h)return;const k=X.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),b={data:!c||c==="text"||c==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:k,config:t,request:h};Jo(function(M){n(M),p()},function(M){r(M),p()},b),h=null}"onloadend"in h?h.onloadend=f:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(f)},h.onabort=function(){h&&(r(new A("Request aborted",A.ECONNABORTED,i,h)),h=null)},h.onerror=function(){r(new A("Network Error",A.ERR_NETWORK,i,h)),h=null},h.ontimeout=function(){let v=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const b=i.transitional||Fo;i.timeoutErrorMessage&&(v=i.timeoutErrorMessage),r(new A(v,b.clarifyTimeoutError?A.ETIMEDOUT:A.ECONNABORTED,i,h)),h=null},s===void 0&&a.setContentType(null),"setRequestHeader"in h&&y.forEach(a.toJSON(),function(v,b){h.setRequestHeader(b,v)}),y.isUndefined(i.withCredentials)||(h.withCredentials=!!i.withCredentials),c&&c!=="json"&&(h.responseType=i.responseType),typeof i.onDownloadProgress=="function"&&h.addEventListener("progress",an(i.onDownloadProgress,!0)),typeof i.onUploadProgress=="function"&&h.upload&&h.upload.addEventListener("progress",an(i.onUploadProgress)),(i.cancelToken||i.signal)&&(l=k=>{h&&(r(!k||k.type?new dt(null,t,h):k),h.abort(),h=null)},i.cancelToken&&i.cancelToken.subscribe(l),i.signal&&(i.signal.aborted?l():i.signal.addEventListener("abort",l)));const _=Iu(i.url);if(_&&ue.protocols.indexOf(_)===-1){r(new A("Unsupported protocol "+_+":",A.ERR_BAD_REQUEST,t));return}h.send(s||null)})},zu=(t,e)=>{let n=new AbortController,r;const i=function(l){if(!r){r=!0,a();const p=l instanceof Error?l:this.reason;n.abort(p instanceof A?p:new dt(p instanceof Error?p.message:p))}};let s=e&&setTimeout(()=>{i(new A(`timeout ${e} of ms exceeded`,A.ETIMEDOUT))},e);const a=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(l=>{l&&(l.removeEventListener?l.removeEventListener("abort",i):l.unsubscribe(i))}),t=null)};t.forEach(l=>l&&l.addEventListener&&l.addEventListener("abort",i));const{signal:c}=n;return c.unsubscribe=a,[c,()=>{s&&clearTimeout(s),s=null}]},Hu=function*(t,e){let n=t.byteLength;if(!e||n<e){yield t;return}let r=0,i;for(;r<n;)i=r+e,yield t.slice(r,i),r=i},Yu=async function*(t,e,n){for await(const r of t)yield*Hu(ArrayBuffer.isView(r)?r:await n(String(r)),e)},Ps=(t,e,n,r,i)=>{const s=Yu(t,e,i);let a=0;return new ReadableStream({type:"bytes",async pull(c){const{done:l,value:p}=await s.next();if(l){c.close(),r();return}let h=p.byteLength;n&&n(a+=h),c.enqueue(new Uint8Array(p))},cancel(c){return r(c),s.return()}},{highWaterMark:2})},As=(t,e)=>{const n=t!=null;return r=>setTimeout(()=>e({lengthComputable:n,total:t,loaded:r}))},yn=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Go=yn&&typeof ReadableStream=="function",lr=yn&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),Wu=Go&&(()=>{let t=!1;const e=new Request(ue.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e})(),Rs=64*1024,ur=Go&&!!(()=>{try{return y.isReadableStream(new Response("").body)}catch{}})(),cn={stream:ur&&(t=>t.body)};yn&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!cn[e]&&(cn[e]=y.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new A(`Response type '${e}' is not supported`,A.ERR_NOT_SUPPORT,r)})})})(new Response);const Ku=async t=>{if(t==null)return 0;if(y.isBlob(t))return t.size;if(y.isSpecCompliantForm(t))return(await new Request(t).arrayBuffer()).byteLength;if(y.isArrayBufferView(t))return t.byteLength;if(y.isURLSearchParams(t)&&(t=t+""),y.isString(t))return(await lr(t)).byteLength},Qu=async(t,e)=>{const n=y.toFiniteNumber(t.getContentLength());return n??Ku(e)},Xu=yn&&(async t=>{let{url:e,method:n,data:r,signal:i,cancelToken:s,timeout:a,onDownloadProgress:c,onUploadProgress:l,responseType:p,headers:h,withCredentials:f="same-origin",fetchOptions:_}=$o(t);p=p?(p+"").toLowerCase():"text";let[k,v]=i||s||a?zu([i,s],a):[],b,T;const M=()=>{!b&&setTimeout(()=>{k&&k.unsubscribe()}),b=!0};let B;try{if(l&&Wu&&n!=="get"&&n!=="head"&&(B=await Qu(h,r))!==0){let oe=new Request(e,{method:"POST",body:r,duplex:"half"}),_e;y.isFormData(r)&&(_e=oe.headers.get("content-type"))&&h.setContentType(_e),oe.body&&(r=Ps(oe.body,Rs,As(B,an(l)),null,lr))}y.isString(f)||(f=f?"cors":"omit"),T=new Request(e,{..._,signal:k,method:n.toUpperCase(),headers:h.normalize().toJSON(),body:r,duplex:"half",withCredentials:f});let L=await fetch(T);const te=ur&&(p==="stream"||p==="response");if(ur&&(c||te)){const oe={};["status","statusText","headers"].forEach(ht=>{oe[ht]=L[ht]});const _e=y.toFiniteNumber(L.headers.get("content-length"));L=new Response(Ps(L.body,Rs,c&&As(_e,an(c,!0)),te&&M,lr),oe)}p=p||"text";let Ne=await cn[y.findKey(cn,p)||"text"](L,t);return!te&&M(),v&&v(),await new Promise((oe,_e)=>{Jo(oe,_e,{data:Ne,headers:X.from(L.headers),status:L.status,statusText:L.statusText,config:t,request:T})})}catch(L){throw M(),L&&L.name==="TypeError"&&/fetch/i.test(L.message)?Object.assign(new A("Network Error",A.ERR_NETWORK,t,T),{cause:L.cause||L}):A.from(L,L&&L.code,t,T)}}),dr={http:mu,xhr:Gu,fetch:Xu};y.forEach(dr,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Ds=t=>`- ${t}`,Zu=t=>y.isFunction(t)||t===null||t===!1,zo={getAdapter:t=>{t=y.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,!Zu(n)&&(r=dr[(a=String(n)).toLowerCase()],r===void 0))throw new A(`Unknown adapter '${a}'`);if(r)break;i[a||"#"+s]=r}if(!r){const s=Object.entries(i).map(([c,l])=>`adapter ${c} `+(l===!1?"is not supported by the environment":"is not available in the build"));let a=e?s.length>1?`since :
|
|
41
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[Ms]=this[Ms]={accessors:{}}).accessors,i=this.prototype;function s(a){const c=gt(a);r[c]||(ju(i,a),r[c]=!0)}return y.isArray(e)?e.forEach(s):s(e),this}}X.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);y.reduceDescriptors(X.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});y.freezeMethods(X);function In(t,e){const n=this||Rt,r=e||n,i=X.from(r.headers);let s=r.data;return y.forEach(t,function(c){s=c.call(n,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function qo(t){return!!(t&&t.__CANCEL__)}function dt(t,e,n){A.call(this,t??"canceled",A.ERR_CANCELED,e,n),this.name="CanceledError"}y.inherits(dt,A,{__CANCEL__:!0});function Jo(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new A("Request failed with status code "+n.status,[A.ERR_BAD_REQUEST,A.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Iu(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Bu(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i=0,s=0,a;return e=e!==void 0?e:1e3,function(l){const p=Date.now(),h=r[s];a||(a=p),n[i]=l,r[i]=p;let f=s,_=0;for(;f!==i;)_+=n[f++],f=f%t;if(i=(i+1)%t,i===s&&(s=(s+1)%t),p-a<e)return;const k=h&&p-h;return k?Math.round(_*1e3/k):void 0}}function Fu(t,e){let n=0;const r=1e3/e;let i=null;return function(){const a=this===!0,c=Date.now();if(a||c-n>r)return i&&(clearTimeout(i),i=null),n=c,t.apply(null,arguments);i||(i=setTimeout(()=>(i=null,n=Date.now(),t.apply(null,arguments)),r-(c-n)))}}const an=(t,e,n=3)=>{let r=0;const i=Bu(50,250);return Fu(s=>{const a=s.loaded,c=s.lengthComputable?s.total:void 0,l=a-r,p=i(l),h=a<=c;r=a;const f={loaded:a,total:c,progress:c?a/c:void 0,bytes:l,rate:p||void 0,estimated:p&&c&&h?(c-a)/p:void 0,event:s,lengthComputable:c!=null};f[e?"download":"upload"]=!0,t(f)},n)},Uu=ue.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function i(s){let a=s;return e&&(n.setAttribute("href",a),a=n.href),n.setAttribute("href",a),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(a){const c=y.isString(a)?i(a):a;return c.protocol===r.protocol&&c.host===r.host}}():function(){return function(){return!0}}(),qu=ue.hasStandardBrowserEnv?{write(t,e,n,r,i,s){const a=[t+"="+encodeURIComponent(e)];y.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),y.isString(r)&&a.push("path="+r),y.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 Ju(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Vu(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Vo(t,e){return t&&!Ju(e)?Vu(t,e):e}const Os=t=>t instanceof X?{...t}:t;function We(t,e){e=e||{};const n={};function r(p,h,f){return y.isPlainObject(p)&&y.isPlainObject(h)?y.merge.call({caseless:f},p,h):y.isPlainObject(h)?y.merge({},h):y.isArray(h)?h.slice():h}function i(p,h,f){if(y.isUndefined(h)){if(!y.isUndefined(p))return r(void 0,p,f)}else return r(p,h,f)}function s(p,h){if(!y.isUndefined(h))return r(void 0,h)}function a(p,h){if(y.isUndefined(h)){if(!y.isUndefined(p))return r(void 0,p)}else return r(void 0,h)}function c(p,h,f){if(f in e)return r(p,h);if(f in t)return r(void 0,p)}const l={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c,headers:(p,h)=>i(Os(p),Os(h),!0)};return y.forEach(Object.keys(Object.assign({},t,e)),function(h){const f=l[h]||i,_=f(t[h],e[h],h);y.isUndefined(_)&&f!==c||(n[h]=_)}),n}const $o=t=>{const e=We({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:s,headers:a,auth:c}=e;e.headers=a=X.from(a),e.url=Bo(Vo(e.baseURL,e.url),t.params,t.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let l;if(y.isFormData(n)){if(ue.hasStandardBrowserEnv||ue.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((l=a.getContentType())!==!1){const[p,...h]=l?l.split(";").map(f=>f.trim()).filter(Boolean):[];a.setContentType([p||"multipart/form-data",...h].join("; "))}}if(ue.hasStandardBrowserEnv&&(r&&y.isFunction(r)&&(r=r(e)),r||r!==!1&&Uu(e.url))){const p=i&&s&&qu.read(s);p&&a.set(i,p)}return e},$u=typeof XMLHttpRequest<"u",Gu=$u&&function(t){return new Promise(function(n,r){const i=$o(t);let s=i.data;const a=X.from(i.headers).normalize();let{responseType:c}=i,l;function p(){i.cancelToken&&i.cancelToken.unsubscribe(l),i.signal&&i.signal.removeEventListener("abort",l)}let h=new XMLHttpRequest;h.open(i.method.toUpperCase(),i.url,!0),h.timeout=i.timeout;function f(){if(!h)return;const k=X.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),b={data:!c||c==="text"||c==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:k,config:t,request:h};Jo(function(M){n(M),p()},function(M){r(M),p()},b),h=null}"onloadend"in h?h.onloadend=f:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(f)},h.onabort=function(){h&&(r(new A("Request aborted",A.ECONNABORTED,i,h)),h=null)},h.onerror=function(){r(new A("Network Error",A.ERR_NETWORK,i,h)),h=null},h.ontimeout=function(){let v=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const b=i.transitional||Fo;i.timeoutErrorMessage&&(v=i.timeoutErrorMessage),r(new A(v,b.clarifyTimeoutError?A.ETIMEDOUT:A.ECONNABORTED,i,h)),h=null},s===void 0&&a.setContentType(null),"setRequestHeader"in h&&y.forEach(a.toJSON(),function(v,b){h.setRequestHeader(b,v)}),y.isUndefined(i.withCredentials)||(h.withCredentials=!!i.withCredentials),c&&c!=="json"&&(h.responseType=i.responseType),typeof i.onDownloadProgress=="function"&&h.addEventListener("progress",an(i.onDownloadProgress,!0)),typeof i.onUploadProgress=="function"&&h.upload&&h.upload.addEventListener("progress",an(i.onUploadProgress)),(i.cancelToken||i.signal)&&(l=k=>{h&&(r(!k||k.type?new dt(null,t,h):k),h.abort(),h=null)},i.cancelToken&&i.cancelToken.subscribe(l),i.signal&&(i.signal.aborted?l():i.signal.addEventListener("abort",l)));const _=Iu(i.url);if(_&&ue.protocols.indexOf(_)===-1){r(new A("Unsupported protocol "+_+":",A.ERR_BAD_REQUEST,t));return}h.send(s||null)})},zu=(t,e)=>{let n=new AbortController,r;const i=function(l){if(!r){r=!0,a();const p=l instanceof Error?l:this.reason;n.abort(p instanceof A?p:new dt(p instanceof Error?p.message:p))}};let s=e&&setTimeout(()=>{i(new A(`timeout ${e} of ms exceeded`,A.ETIMEDOUT))},e);const a=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(l=>{l&&(l.removeEventListener?l.removeEventListener("abort",i):l.unsubscribe(i))}),t=null)};t.forEach(l=>l&&l.addEventListener&&l.addEventListener("abort",i));const{signal:c}=n;return c.unsubscribe=a,[c,()=>{s&&clearTimeout(s),s=null}]},Hu=function*(t,e){let n=t.byteLength;if(!e||n<e){yield t;return}let r=0,i;for(;r<n;)i=r+e,yield t.slice(r,i),r=i},Yu=async function*(t,e,n){for await(const r of t)yield*Hu(ArrayBuffer.isView(r)?r:await n(String(r)),e)},Ps=(t,e,n,r,i)=>{const s=Yu(t,e,i);let a=0;return new ReadableStream({type:"bytes",async pull(c){const{done:l,value:p}=await s.next();if(l){c.close(),r();return}let h=p.byteLength;n&&n(a+=h),c.enqueue(new Uint8Array(p))},cancel(c){return r(c),s.return()}},{highWaterMark:2})},As=(t,e)=>{const n=t!=null;return r=>setTimeout(()=>e({lengthComputable:n,total:t,loaded:r}))},yn=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Go=yn&&typeof ReadableStream=="function",lr=yn&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),Wu=Go&&(()=>{let t=!1;const e=new Request(ue.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e})(),Rs=64*1024,ur=Go&&!!(()=>{try{return y.isReadableStream(new Response("").body)}catch{}})(),cn={stream:ur&&(t=>t.body)};yn&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!cn[e]&&(cn[e]=y.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new A(`Response type '${e}' is not supported`,A.ERR_NOT_SUPPORT,r)})})})(new Response);const Ku=async t=>{if(t==null)return 0;if(y.isBlob(t))return t.size;if(y.isSpecCompliantForm(t))return(await new Request(t).arrayBuffer()).byteLength;if(y.isArrayBufferView(t))return t.byteLength;if(y.isURLSearchParams(t)&&(t=t+""),y.isString(t))return(await lr(t)).byteLength},Qu=async(t,e)=>{const n=y.toFiniteNumber(t.getContentLength());return n??Ku(e)},Xu=yn&&(async t=>{let{url:e,method:n,data:r,signal:i,cancelToken:s,timeout:a,onDownloadProgress:c,onUploadProgress:l,responseType:p,headers:h,withCredentials:f="same-origin",fetchOptions:_}=$o(t);p=p?(p+"").toLowerCase():"text";let[k,v]=i||s||a?zu([i,s],a):[],b,T;const M=()=>{!b&&setTimeout(()=>{k&&k.unsubscribe()}),b=!0};let B;try{if(l&&Wu&&n!=="get"&&n!=="head"&&(B=await Qu(h,r))!==0){let oe=new Request(e,{method:"POST",body:r,duplex:"half"}),_e;y.isFormData(r)&&(_e=oe.headers.get("content-type"))&&h.setContentType(_e),oe.body&&(r=Ps(oe.body,Rs,As(B,an(l)),null,lr))}y.isString(f)||(f=f?"cors":"omit"),T=new Request(e,{..._,signal:k,method:n.toUpperCase(),headers:h.normalize().toJSON(),body:r,duplex:"half",withCredentials:f});let L=await fetch(T);const ne=ur&&(p==="stream"||p==="response");if(ur&&(c||ne)){const oe={};["status","statusText","headers"].forEach(ht=>{oe[ht]=L[ht]});const _e=y.toFiniteNumber(L.headers.get("content-length"));L=new Response(Ps(L.body,Rs,c&&As(_e,an(c,!0)),ne&&M,lr),oe)}p=p||"text";let Ne=await cn[y.findKey(cn,p)||"text"](L,t);return!ne&&M(),v&&v(),await new Promise((oe,_e)=>{Jo(oe,_e,{data:Ne,headers:X.from(L.headers),status:L.status,statusText:L.statusText,config:t,request:T})})}catch(L){throw M(),L&&L.name==="TypeError"&&/fetch/i.test(L.message)?Object.assign(new A("Network Error",A.ERR_NETWORK,t,T),{cause:L.cause||L}):A.from(L,L&&L.code,t,T)}}),dr={http:mu,xhr:Gu,fetch:Xu};y.forEach(dr,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Ds=t=>`- ${t}`,Zu=t=>y.isFunction(t)||t===null||t===!1,zo={getAdapter:t=>{t=y.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,!Zu(n)&&(r=dr[(a=String(n)).toLowerCase()],r===void 0))throw new A(`Unknown adapter '${a}'`);if(r)break;i[a||"#"+s]=r}if(!r){const s=Object.entries(i).map(([c,l])=>`adapter ${c} `+(l===!1?"is not supported by the environment":"is not available in the build"));let a=e?s.length>1?`since :
|
|
42
42
|
`+s.map(Ds).join(`
|
|
43
43
|
`):" "+Ds(s[0]):"as no adapter specified";throw new A("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:dr};function Bn(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new dt(null,t)}function xs(t){return Bn(t),t.headers=X.from(t.headers),t.data=In.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),zo.getAdapter(t.adapter||Rt.adapter)(t).then(function(r){return Bn(t),r.data=In.call(t,t.transformResponse,r),r.headers=X.from(r.headers),r},function(r){return qo(r)||(Bn(t),r&&r.response&&(r.response.data=In.call(t,t.transformResponse,r.response),r.response.headers=X.from(r.response.headers))),Promise.reject(r)})}const Ho="1.7.2",Pr={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Pr[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const Ls={};Pr.transitional=function(e,n,r){function i(s,a){return"[Axios v"+Ho+"] Transitional option '"+s+"'"+a+(r?". "+r:"")}return(s,a,c)=>{if(e===!1)throw new A(i(a," has been removed"+(n?" in "+n:"")),A.ERR_DEPRECATED);return n&&!Ls[a]&&(Ls[a]=!0,console.warn(i(a," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(s,a,c):!0}};function ed(t,e,n){if(typeof t!="object")throw new A("options must be an object",A.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const s=r[i],a=e[s];if(a){const c=t[s],l=c===void 0||a(c,s,t);if(l!==!0)throw new A("option "+s+" must be "+l,A.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new A("Unknown option "+s,A.ERR_BAD_OPTION)}}const hr={assertOptions:ed,validators:Pr},Me=hr.validators;class Ve{constructor(e){this.defaults=e,this.interceptors={request:new Cs,response:new Cs}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const s=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
44
|
-
`+s):r.stack=s}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=We(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&hr.assertOptions(r,{silentJSONParsing:Me.transitional(Me.boolean),forcedJSONParsing:Me.transitional(Me.boolean),clarifyTimeoutError:Me.transitional(Me.boolean)},!1),i!=null&&(y.isFunction(i)?n.paramsSerializer={serialize:i}:hr.assertOptions(i,{encode:Me.function,serialize:Me.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=s&&y.merge(s.common,s[n.method]);s&&y.forEach(["delete","get","head","post","put","patch","common"],v=>{delete s[v]}),n.headers=X.concat(a,s);const c=[];let l=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(n)===!1||(l=l&&b.synchronous,c.unshift(b.fulfilled,b.rejected))});const p=[];this.interceptors.response.forEach(function(b){p.push(b.fulfilled,b.rejected)});let h,f=0,_;if(!l){const v=[xs.bind(this),void 0];for(v.unshift.apply(v,c),v.push.apply(v,p),_=v.length,h=Promise.resolve(n);f<_;)h=h.then(v[f++],v[f++]);return h}_=c.length;let k=n;for(f=0;f<_;){const v=c[f++],b=c[f++];try{k=v(k)}catch(T){b.call(this,T);break}}try{h=xs.call(this,k)}catch(v){return Promise.reject(v)}for(f=0,_=p.length;f<_;)h=h.then(p[f++],p[f++]);return h}getUri(e){e=We(this.defaults,e);const n=Vo(e.baseURL,e.url);return Bo(n,e.params,e.paramsSerializer)}}y.forEach(["delete","get","head","options"],function(e){Ve.prototype[e]=function(n,r){return this.request(We(r||{},{method:e,url:n,data:(r||{}).data}))}});y.forEach(["post","put","patch"],function(e){function n(r){return function(s,a,c){return this.request(We(c||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}Ve.prototype[e]=n(),Ve.prototype[e+"Form"]=n(!0)});class Ar{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(i=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const a=new Promise(c=>{r.subscribe(c),s=c}).then(i);return a.cancel=function(){r.unsubscribe(s)},a},e(function(s,a,c){r.reason||(r.reason=new dt(s,a,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}static source(){let e;return{token:new Ar(function(i){e=i}),cancel:e}}}function td(t){return function(n){return t.apply(null,n)}}function nd(t){return y.isObject(t)&&t.isAxiosError===!0}const pr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(pr).forEach(([t,e])=>{pr[e]=t});function Yo(t){const e=new Ve(t),n=Co(Ve.prototype.request,e);return y.extend(n,Ve.prototype,e,{allOwnKeys:!0}),y.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return Yo(We(t,i))},n}const $=Yo(Rt);$.Axios=Ve;$.CanceledError=dt;$.CancelToken=Ar;$.isCancel=qo;$.VERSION=Ho;$.toFormData=vn;$.AxiosError=A;$.Cancel=$.CanceledError;$.all=function(e){return Promise.all(e)};$.spread=td;$.isAxiosError=nd;$.mergeConfig=We;$.AxiosHeaders=X;$.formToJSON=t=>Uo(y.isHTMLForm(t)?new FormData(t):t);$.getAdapter=zo.getAdapter;$.HttpStatusCode=pr;$.default=$;const Wo="https://api.avaturn.live";class Ko{constructor({apiHost:e=Wo,sessionToken:n,preloadBundle:r,preconnect:i,keepAlive:s}){
|
|
44
|
+
`+s):r.stack=s}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=We(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&hr.assertOptions(r,{silentJSONParsing:Me.transitional(Me.boolean),forcedJSONParsing:Me.transitional(Me.boolean),clarifyTimeoutError:Me.transitional(Me.boolean)},!1),i!=null&&(y.isFunction(i)?n.paramsSerializer={serialize:i}:hr.assertOptions(i,{encode:Me.function,serialize:Me.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=s&&y.merge(s.common,s[n.method]);s&&y.forEach(["delete","get","head","post","put","patch","common"],v=>{delete s[v]}),n.headers=X.concat(a,s);const c=[];let l=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(n)===!1||(l=l&&b.synchronous,c.unshift(b.fulfilled,b.rejected))});const p=[];this.interceptors.response.forEach(function(b){p.push(b.fulfilled,b.rejected)});let h,f=0,_;if(!l){const v=[xs.bind(this),void 0];for(v.unshift.apply(v,c),v.push.apply(v,p),_=v.length,h=Promise.resolve(n);f<_;)h=h.then(v[f++],v[f++]);return h}_=c.length;let k=n;for(f=0;f<_;){const v=c[f++],b=c[f++];try{k=v(k)}catch(T){b.call(this,T);break}}try{h=xs.call(this,k)}catch(v){return Promise.reject(v)}for(f=0,_=p.length;f<_;)h=h.then(p[f++],p[f++]);return h}getUri(e){e=We(this.defaults,e);const n=Vo(e.baseURL,e.url);return Bo(n,e.params,e.paramsSerializer)}}y.forEach(["delete","get","head","options"],function(e){Ve.prototype[e]=function(n,r){return this.request(We(r||{},{method:e,url:n,data:(r||{}).data}))}});y.forEach(["post","put","patch"],function(e){function n(r){return function(s,a,c){return this.request(We(c||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}Ve.prototype[e]=n(),Ve.prototype[e+"Form"]=n(!0)});class Ar{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(i=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const a=new Promise(c=>{r.subscribe(c),s=c}).then(i);return a.cancel=function(){r.unsubscribe(s)},a},e(function(s,a,c){r.reason||(r.reason=new dt(s,a,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}static source(){let e;return{token:new Ar(function(i){e=i}),cancel:e}}}function td(t){return function(n){return t.apply(null,n)}}function nd(t){return y.isObject(t)&&t.isAxiosError===!0}const pr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(pr).forEach(([t,e])=>{pr[e]=t});function Yo(t){const e=new Ve(t),n=Co(Ve.prototype.request,e);return y.extend(n,Ve.prototype,e,{allOwnKeys:!0}),y.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return Yo(We(t,i))},n}const $=Yo(Rt);$.Axios=Ve;$.CanceledError=dt;$.CancelToken=Ar;$.isCancel=qo;$.VERSION=Ho;$.toFormData=vn;$.AxiosError=A;$.Cancel=$.CanceledError;$.all=function(e){return Promise.all(e)};$.spread=td;$.isAxiosError=nd;$.mergeConfig=We;$.AxiosHeaders=X;$.formToJSON=t=>Uo(y.isHTMLForm(t)?new FormData(t):t);$.getAdapter=zo.getAdapter;$.HttpStatusCode=pr;$.default=$;const Wo="https://api.avaturn.live";class Ko{constructor({apiHost:e=Wo,sessionToken:n,preloadBundle:r,preconnect:i,keepAlive:s}){Z(this,"inited",!1);Z(this,"mediaStream");Z(this,"session_id","");Z(this,"abortController");Z(this,"timeout",0);Z(this,"keepAlive",!1);Z(this,"fetcher");Z(this,"call");Z(this,"handlers",{});if(typeof window>"u")throw new Error("Unfortunately, SDK only works on the client side.");this.abortController=new AbortController,this.fetcher=$.create({baseURL:`${e}/_sdk/v0`,headers:{"X-Session-Token":n},signal:this.abortController.signal}),this.keepAlive=!!s,this.mediaStream=new MediaStream,this.call=Al.createCallObject({videoSource:!1,audioSource:!1,dailyConfig:{avoidEval:!0}}),r&&this.call.load(),i&&this.fetcher.post("/sessions/start_stream")}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()}async init(e){if(this.inited)return;this.startIdleTimeout();const{data:n}=await this.fetcher.get("/sessions");return this.session_id=n.id,this.abortController.signal.aborted||await this.call.join({token:n.limited_access_token,url:n.room_url}),new Promise((r,i)=>{var c,l;const s=e!=null&&e.timeout&&e.timeout>0?e==null?void 0:e.timeout:3e4,a=e!=null&&e.timeout?setTimeout(()=>i("Connection timeout"),s):null;(c=this.call)==null||c.on("participant-updated",({participant:p})=>{var _,k;if(!p.owner)return;const{video:h,audio:f}=p.tracks;h.persistentTrack&&(this.mediaStream.getVideoTracks().forEach(v=>this.mediaStream.removeTrack(v)),(_=this.mediaStream)==null||_.addTrack(h.persistentTrack)),f.persistentTrack&&(this.mediaStream.getAudioTracks().forEach(v=>this.mediaStream.removeTrack(v)),(k=this.mediaStream)==null||k.addTrack(f.persistentTrack)),a&&clearTimeout(a),h.persistentTrack&&(this.inited=!0,r(null))}),this.call.on("error",p=>{console.error("[SKD_ERROR]: ",p)}),(l=this.call)==null||l.on("app-message",({data:p})=>{var h;p.type&&((h=this.handlers[p.type])==null||h.forEach(f=>f(p)))})})}async task(e){if(!this.session_id)throw new Error("It seems that the session is not initialized.");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(){var e;this.inited=!1,this.mediaStream=new MediaStream,this.inited=!1,this.timeout&&clearTimeout(this.timeout),await((e=this.call)==null?void 0:e.destroy()),this.abortController.abort()}}class rd extends Ko{constructor(n){super(n);Z(this,"assistantSessionToken","");Z(this,"assistantFetcher");Z(this,"sessionToken","");this.assistantSessionToken=n.assistantSessionToken,this.sessionToken=n.sessionToken,this.assistantFetcher=$.create({baseURL:`${n.apiHost||Wo}/`,headers:{Authorization:`Bearer ${n.assistantSessionToken}`},signal:this.abortController.signal})}async init(n){if(this.inited)return;this.startIdleTimeout();const{data:r}=await this.fetcher.get("/sessions");return this.session_id=r.id,await this.call.join({token:r.limited_access_token,url:r.room_url}),new Promise((i,s)=>{var l,p;const a=n!=null&&n.timeout&&n.timeout>0?n==null?void 0:n.timeout:3e4,c=n!=null&&n.timeout?setTimeout(()=>s("Connection timeout"),a):null;(l=this.call)==null||l.on("participant-updated",({participant:h})=>{var k,v;if(!h.owner)return;const{video:f,audio:_}=h.tracks;f.persistentTrack&&(this.mediaStream.getVideoTracks().forEach(b=>this.mediaStream.removeTrack(b)),(k=this.mediaStream)==null||k.addTrack(f.persistentTrack)),_.persistentTrack&&(this.mediaStream.getAudioTracks().forEach(b=>this.mediaStream.removeTrack(b)),(v=this.mediaStream)==null||v.addTrack(_.persistentTrack)),c&&clearTimeout(c),f.persistentTrack&&(this.inited=!0,i(null))}),this.call.on("error",h=>{console.error("[SKD_ERROR]: ",h)}),(p=this.call)==null||p.on("app-message",({data:h})=>{var f;h.type&&((f=this.handlers[h.type])==null||f.forEach(_=>_(h)))})})}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),await((n=this.call)==null?void 0:n.destroy()),await this.assistantFetcher.delete("/assistants/sessions"),this.abortController.abort()}}exports.AvaturnAssistantHead=rd;exports.AvaturnHead=Ko;
|