@avaturn-live/web-sdk 0.3.0 → 0.3.2
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 +30 -31
- package/dist/main.js +4624 -4112
- package/package.json +2 -2
package/dist/main.cjs
CHANGED
|
@@ -1,34 +1,33 @@
|
|
|
1
|
-
"use strict";var
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}var Bs,Ee={},ia={get exports(){return Ee},set exports(t){Ee=t}},Ze=typeof Reflect=="object"?Reflect:null,Kr=Ze&&typeof Ze.apply=="function"?Ze.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};Bs=Ze&&typeof Ze.ownKeys=="function"?Ze.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var Qr=Number.isNaN||function(t){return t!=t};function j(){j.init.call(this)}ia.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))}ri(t,e,s,{once:!0}),e!=="error"&&function(a,c,l){typeof a.on=="function"&&ri(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 Xr=10;function zt(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function Fs(t){return t._maxListeners===void 0?j.defaultMaxListeners:t._maxListeners}function Zr(t,e,n,r){var i,s,a,c;if(zt(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=Fs(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 sa(){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 ei(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=sa.bind(r);return i.listener=n,r.wrapFn=i,i}function ti(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):Us(i,i.length)}function ni(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 Us(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}function ri(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 Xr},set:function(t){if(typeof t!="number"||t<0||Qr(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Xr=t}}),j.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},j.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||Qr(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},j.prototype.getMaxListeners=function(){return Fs(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")Kr(c,this,e);else{var l=c.length,p=Us(c,l);for(n=0;n<l;++n)Kr(p[n],this,e)}return!0},j.prototype.addListener=function(t,e){return Zr(this,t,e,!1)},j.prototype.on=j.prototype.addListener,j.prototype.prependListener=function(t,e){return Zr(this,t,e,!0)},j.prototype.once=function(t,e){return zt(e),this.on(t,ei(this,t,e)),this},j.prototype.prependOnceListener=function(t,e){return zt(e),this.prependListener(t,ei(this,t,e)),this},j.prototype.removeListener=function(t,e){var n,r,i,s,a;if(zt(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 ti(this,t,!0)},j.prototype.rawListeners=function(t){return ti(this,t,!1)},j.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):ni.call(t,e)},j.prototype.listenerCount=ni,j.prototype.eventNames=function(){return this._eventsCount>0?Bs(this._events):[]};var ii=Object.prototype.hasOwnProperty;function si(t,e,n){for(n of t.keys())if(X(n,e))return n}function X(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--&&X(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=si(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=si(e,i))||!X(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(ii.call(t,n)&&++r&&!ii.call(e,n)||!(n in e)||!X(t[n],e[n]))return!1;return Object.keys(e).length===r}}return t!=t&&e!=e}const oa={"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"},qs={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"},K={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 oa[e]}static getBrowserTypeByAlias(e){return qs[e]||""}}const I=/version\/(\d+(\.?_?\d+)+)/i,aa=[{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 ca=[{test:[/Roku\/DVP/],describe(t){const e=S.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,t);return{name:K.Roku,version:e}}},{test:[/windows phone/i],describe(t){const e=S.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,t);return{name:K.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:K.Windows,version:e,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(t){const e={name:K.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:K.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:K.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:K.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:K.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:K.BlackBerry,version:e}}},{test:[/bada/i],describe(t){const e=S.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,t);return{name:K.Bada,version:e}}},{test:[/tizen/i],describe(t){const e=S.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,t);return{name:K.Tizen,version:e}}},{test:[/linux/i],describe:()=>({name:K.Linux})},{test:[/CrOS/],describe:()=>({name:K.ChromeOS})},{test:[/PlayStation 4/],describe(t){const e=S.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,t);return{name:K.PlayStation4,version:e}}}],la=[{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})}],ua=[{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 oi{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(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.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(ca,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(la,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(ua,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))}}/*!
|
|
1
|
+
"use strict";var Fa=Object.defineProperty;var Ua=(t,e,n)=>e in t?Fa(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Q=(t,e,n)=>Ua(t,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function ui(t,e){if(t==null)return{};var n,r,i=function(a,c){if(a==null)return{};var l={};for(var f in a)if({}.hasOwnProperty.call(a,f)){if(c.indexOf(f)!==-1)continue;l[f]=a[f]}return l}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)n=s[r],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function de(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function q(t){return q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},q(t)}function bo(t){var e=function(n,r){if(q(n)!="object"||!n)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var s=i.call(n,r);if(q(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}(t,"string");return q(e)=="symbol"?e:e+""}function di(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,bo(r.key),r)}}function fe(t,e,n){return e&&di(t.prototype,e),n&&di(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Sn(t,e){if(e&&(q(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}(t)}function we(t){return we=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},we(t)}function jt(t,e){return jt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},jt(t,e)}function kn(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&jt(t,e)}function Me(t,e,n){return(e=bo(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fi(t,e,n,r,i,s,a){try{var c=t[s](a),l=c.value}catch(f){return void n(f)}c.done?e(l):Promise.resolve(l).then(r,i)}function L(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var s=t.apply(e,n);function a(l){fi(s,r,i,a,c,"next",l)}function c(l){fi(s,r,i,a,c,"throw",l)}a(void 0)})}}function hi(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function re(t,e){return function(n){if(Array.isArray(n))return n}(t)||function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var s,a,c,l,f=[],h=!0,v=!1;try{if(c=(i=i.call(n)).next,r===0){if(Object(i)!==i)return;h=!1}else for(;!(h=(s=c.call(i)).done)&&(f.push(s.value),f.length!==r);h=!0);}catch(k){v=!0,a=k}finally{try{if(!h&&i.return!=null&&(l=i.return(),Object(l)!==l))return}finally{if(v)throw a}}return f}}(t,e)||function(n,r){if(n){if(typeof n=="string")return hi(n,r);var i={}.toString.call(n).slice(8,-1);return i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set"?Array.from(n):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?hi(n,r):void 0}}(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Ba(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var pi,Jt={exports:{}},ir=function(){if(pi)return Jt.exports;pi=1;var t,e=typeof Reflect=="object"?Reflect:null,n=e&&typeof e.apply=="function"?e.apply:function(m,b,w){return Function.prototype.apply.call(m,b,w)};t=e&&typeof e.ownKeys=="function"?e.ownKeys:Object.getOwnPropertySymbols?function(m){return Object.getOwnPropertyNames(m).concat(Object.getOwnPropertySymbols(m))}:function(m){return Object.getOwnPropertyNames(m)};var r=Number.isNaN||function(m){return m!=m};function i(){i.init.call(this)}Jt.exports=i,Jt.exports.once=function(m,b){return new Promise(function(w,C){function A(j){m.removeListener(b,x),C(j)}function x(){typeof m.removeListener=="function"&&m.removeListener("error",A),w([].slice.call(arguments))}y(m,b,x,{once:!0}),b!=="error"&&function(j,R,J){typeof j.on=="function"&&y(j,"error",R,J)}(m,A,{once:!0})})},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var s=10;function a(m){if(typeof m!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof m)}function c(m){return m._maxListeners===void 0?i.defaultMaxListeners:m._maxListeners}function l(m,b,w,C){var A,x,j,R;if(a(w),(x=m._events)===void 0?(x=m._events=Object.create(null),m._eventsCount=0):(x.newListener!==void 0&&(m.emit("newListener",b,w.listener?w.listener:w),x=m._events),j=x[b]),j===void 0)j=x[b]=w,++m._eventsCount;else if(typeof j=="function"?j=x[b]=C?[w,j]:[j,w]:C?j.unshift(w):j.push(w),(A=c(m))>0&&j.length>A&&!j.warned){j.warned=!0;var J=new Error("Possible EventEmitter memory leak detected. "+j.length+" "+String(b)+" listeners added. Use emitter.setMaxListeners() to increase limit");J.name="MaxListenersExceededWarning",J.emitter=m,J.type=b,J.count=j.length,R=J,console&&console.warn&&console.warn(R)}return m}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(m,b,w){var C={fired:!1,wrapFn:void 0,target:m,type:b,listener:w},A=f.bind(C);return A.listener=w,C.wrapFn=A,A}function v(m,b,w){var C=m._events;if(C===void 0)return[];var A=C[b];return A===void 0?[]:typeof A=="function"?w?[A.listener||A]:[A]:w?function(x){for(var j=new Array(x.length),R=0;R<j.length;++R)j[R]=x[R].listener||x[R];return j}(A):E(A,A.length)}function k(m){var b=this._events;if(b!==void 0){var w=b[m];if(typeof w=="function")return 1;if(w!==void 0)return w.length}return 0}function E(m,b){for(var w=new Array(b),C=0;C<b;++C)w[C]=m[C];return w}function y(m,b,w,C){if(typeof m.on=="function")C.once?m.once(b,w):m.on(b,w);else{if(typeof m.addEventListener!="function")throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof m);m.addEventListener(b,function A(x){C.once&&m.removeEventListener(b,A),w(x)})}}return Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(m){if(typeof m!="number"||m<0||r(m))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+m+".");s=m}}),i.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(m){if(typeof m!="number"||m<0||r(m))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+m+".");return this._maxListeners=m,this},i.prototype.getMaxListeners=function(){return c(this)},i.prototype.emit=function(m){for(var b=[],w=1;w<arguments.length;w++)b.push(arguments[w]);var C=m==="error",A=this._events;if(A!==void 0)C=C&&A.error===void 0;else if(!C)return!1;if(C){var x;if(b.length>0&&(x=b[0]),x instanceof Error)throw x;var j=new Error("Unhandled error."+(x?" ("+x.message+")":""));throw j.context=x,j}var R=A[m];if(R===void 0)return!1;if(typeof R=="function")n(R,this,b);else{var J=R.length,X=E(R,J);for(w=0;w<J;++w)n(X[w],this,b)}return!0},i.prototype.addListener=function(m,b){return l(this,m,b,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(m,b){return l(this,m,b,!0)},i.prototype.once=function(m,b){return a(b),this.on(m,h(this,m,b)),this},i.prototype.prependOnceListener=function(m,b){return a(b),this.prependListener(m,h(this,m,b)),this},i.prototype.removeListener=function(m,b){var w,C,A,x,j;if(a(b),(C=this._events)===void 0)return this;if((w=C[m])===void 0)return this;if(w===b||w.listener===b)--this._eventsCount==0?this._events=Object.create(null):(delete C[m],C.removeListener&&this.emit("removeListener",m,w.listener||b));else if(typeof w!="function"){for(A=-1,x=w.length-1;x>=0;x--)if(w[x]===b||w[x].listener===b){j=w[x].listener,A=x;break}if(A<0)return this;A===0?w.shift():function(R,J){for(;J+1<R.length;J++)R[J]=R[J+1];R.pop()}(w,A),w.length===1&&(C[m]=w[0]),C.removeListener!==void 0&&this.emit("removeListener",m,j||b)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(m){var b,w,C;if((w=this._events)===void 0)return this;if(w.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):w[m]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete w[m]),this;if(arguments.length===0){var A,x=Object.keys(w);for(C=0;C<x.length;++C)(A=x[C])!=="removeListener"&&this.removeAllListeners(A);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(b=w[m])=="function")this.removeListener(m,b);else if(b!==void 0)for(C=b.length-1;C>=0;C--)this.removeListener(m,b[C]);return this},i.prototype.listeners=function(m){return v(this,m,!0)},i.prototype.rawListeners=function(m){return v(this,m,!1)},i.listenerCount=function(m,b){return typeof m.listenerCount=="function"?m.listenerCount(b):k.call(m,b)},i.prototype.listenerCount=k,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]},Jt.exports}(),qt=Ba(ir),mi=Object.prototype.hasOwnProperty;function gi(t,e,n){for(n of t.keys())if(se(n,e))return n}function se(t,e){var n,r,i;if(t===e)return!0;if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return t.toString()===e.toString();if(n===Array){if((r=t.length)===e.length)for(;r--&&se(t[r],e[r]););return r===-1}if(n===Set){if(t.size!==e.size)return!1;for(r of t)if((i=r)&&typeof i=="object"&&!(i=gi(e,i))||!e.has(i))return!1;return!0}if(n===Map){if(t.size!==e.size)return!1;for(r of t)if((i=r[0])&&typeof i=="object"&&!(i=gi(e,i))||!se(r[1],e.get(i)))return!1;return!0}if(n===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(n===DataView){if((r=t.byteLength)===e.byteLength)for(;r--&&t.getInt8(r)===e.getInt8(r););return r===-1}if(ArrayBuffer.isView(t)){if((r=t.byteLength)===e.byteLength)for(;r--&&t[r]===e[r];);return r===-1}if(!n||typeof t=="object"){for(n in r=0,t)if(mi.call(t,n)&&++r&&!mi.call(e,n)||!(n in e)||!se(t[n],e[n]))return!1;return Object.keys(e).length===r}}return t!=t&&e!=e}const Va={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},_o={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},K={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},ie={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},De={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class T{static getFirstMatch(e,n){const r=n.match(e);return r&&r.length>0&&r[1]||""}static getSecondMatch(e,n){const r=n.match(e);return r&&r.length>1&&r[2]||""}static matchAndReturnConst(e,n,r){if(e.test(n))return r}static getWindowsVersionName(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(e){const n=e.split(".").splice(0,2).map(r=>parseInt(r,10)||0);if(n.push(0),n[0]===10)switch(n[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}}static getAndroidVersionName(e){const n=e.split(".").splice(0,2).map(r=>parseInt(r,10)||0);if(n.push(0),!(n[0]===1&&n[1]<5))return n[0]===1&&n[1]<6?"Cupcake":n[0]===1&&n[1]>=6?"Donut":n[0]===2&&n[1]<2?"Eclair":n[0]===2&&n[1]===2?"Froyo":n[0]===2&&n[1]>2?"Gingerbread":n[0]===3?"Honeycomb":n[0]===4&&n[1]<1?"Ice Cream Sandwich":n[0]===4&&n[1]<4?"Jelly Bean":n[0]===4&&n[1]>=4?"KitKat":n[0]===5?"Lollipop":n[0]===6?"Marshmallow":n[0]===7?"Nougat":n[0]===8?"Oreo":n[0]===9?"Pie":void 0}static getVersionPrecision(e){return e.split(".").length}static compareVersions(e,n,r=!1){const i=T.getVersionPrecision(e),s=T.getVersionPrecision(n);let a=Math.max(i,s),c=0;const l=T.map([e,n],f=>{const h=a-T.getVersionPrecision(f),v=f+new Array(h+1).join(".0");return T.map(v.split("."),k=>new Array(20-k.length).join("0")+k).reverse()});for(r&&(c=a-Math.min(i,s)),a-=1;a>=c;){if(l[0][a]>l[1][a])return 1;if(l[0][a]===l[1][a]){if(a===c)return 0;a-=1}else if(l[0][a]<l[1][a])return-1}}static map(e,n){const r=[];let i;if(Array.prototype.map)return Array.prototype.map.call(e,n);for(i=0;i<e.length;i+=1)r.push(n(e[i]));return r}static find(e,n){let r,i;if(Array.prototype.find)return Array.prototype.find.call(e,n);for(r=0,i=e.length;r<i;r+=1){const s=e[r];if(n(s,r))return s}}static assign(e,...n){const r=e;let i,s;if(Object.assign)return Object.assign(e,...n);for(i=0,s=n.length;i<s;i+=1){const a=n[i];typeof a=="object"&&a!==null&&Object.keys(a).forEach(c=>{r[c]=a[c]})}return e}static getBrowserAlias(e){return Va[e]}static getBrowserTypeByAlias(e){return _o[e]||""}}const z=/version\/(\d+(\.?_?\d+)+)/i,Ja=[{test:[/googlebot/i],describe(t){const e={name:"Googlebot"},n=T.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,t)||T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/opera/i],describe(t){const e={name:"Opera"},n=T.getFirstMatch(z,t)||T.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/opr\/|opios/i],describe(t){const e={name:"Opera"},n=T.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,t)||T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/SamsungBrowser/i],describe(t){const e={name:"Samsung Internet for Android"},n=T.getFirstMatch(z,t)||T.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/Whale/i],describe(t){const e={name:"NAVER Whale Browser"},n=T.getFirstMatch(z,t)||T.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/MZBrowser/i],describe(t){const e={name:"MZ Browser"},n=T.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,t)||T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/focus/i],describe(t){const e={name:"Focus"},n=T.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,t)||T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/swing/i],describe(t){const e={name:"Swing"},n=T.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,t)||T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/coast/i],describe(t){const e={name:"Opera Coast"},n=T.getFirstMatch(z,t)||T.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(t){const e={name:"Opera Touch"},n=T.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,t)||T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/yabrowser/i],describe(t){const e={name:"Yandex Browser"},n=T.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,t)||T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/ucbrowser/i],describe(t){const e={name:"UC Browser"},n=T.getFirstMatch(z,t)||T.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/Maxthon|mxios/i],describe(t){const e={name:"Maxthon"},n=T.getFirstMatch(z,t)||T.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/epiphany/i],describe(t){const e={name:"Epiphany"},n=T.getFirstMatch(z,t)||T.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/puffin/i],describe(t){const e={name:"Puffin"},n=T.getFirstMatch(z,t)||T.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/sleipnir/i],describe(t){const e={name:"Sleipnir"},n=T.getFirstMatch(z,t)||T.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/k-meleon/i],describe(t){const e={name:"K-Meleon"},n=T.getFirstMatch(z,t)||T.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/micromessenger/i],describe(t){const e={name:"WeChat"},n=T.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,t)||T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/qqbrowser/i],describe(t){const e={name:/qqbrowserlite/i.test(t)?"QQ Browser Lite":"QQ Browser"},n=T.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,t)||T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/msie|trident/i],describe(t){const e={name:"Internet Explorer"},n=T.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/\sedg\//i],describe(t){const e={name:"Microsoft Edge"},n=T.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/edg([ea]|ios)/i],describe(t){const e={name:"Microsoft Edge"},n=T.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/vivaldi/i],describe(t){const e={name:"Vivaldi"},n=T.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/seamonkey/i],describe(t){const e={name:"SeaMonkey"},n=T.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/sailfish/i],describe(t){const e={name:"Sailfish"},n=T.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,t);return n&&(e.version=n),e}},{test:[/silk/i],describe(t){const e={name:"Amazon Silk"},n=T.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/phantom/i],describe(t){const e={name:"PhantomJS"},n=T.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/slimerjs/i],describe(t){const e={name:"SlimerJS"},n=T.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(t){const e={name:"BlackBerry"},n=T.getFirstMatch(z,t)||T.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/(web|hpw)[o0]s/i],describe(t){const e={name:"WebOS Browser"},n=T.getFirstMatch(z,t)||T.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/bada/i],describe(t){const e={name:"Bada"},n=T.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/tizen/i],describe(t){const e={name:"Tizen"},n=T.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,t)||T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/qupzilla/i],describe(t){const e={name:"QupZilla"},n=T.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,t)||T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/firefox|iceweasel|fxios/i],describe(t){const e={name:"Firefox"},n=T.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/electron/i],describe(t){const e={name:"Electron"},n=T.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/MiuiBrowser/i],describe(t){const e={name:"Miui"},n=T.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/chromium/i],describe(t){const e={name:"Chromium"},n=T.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,t)||T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/chrome|crios|crmo/i],describe(t){const e={name:"Chrome"},n=T.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/GSA/i],describe(t){const e={name:"Google Search"},n=T.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test(t){const e=!t.test(/like android/i),n=t.test(/android/i);return e&&n},describe(t){const e={name:"Android Browser"},n=T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/playstation 4/i],describe(t){const e={name:"PlayStation 4"},n=T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/safari|applewebkit/i],describe(t){const e={name:"Safari"},n=T.getFirstMatch(z,t);return n&&(e.version=n),e}},{test:[/.*/i],describe(t){const e=t.search("\\(")!==-1?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:T.getFirstMatch(e,t),version:T.getSecondMatch(e,t)}}}];var qa=[{test:[/Roku\/DVP/],describe(t){const e=T.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,t);return{name:ie.Roku,version:e}}},{test:[/windows phone/i],describe(t){const e=T.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,t);return{name:ie.WindowsPhone,version:e}}},{test:[/windows /i],describe(t){const e=T.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,t),n=T.getWindowsVersionName(e);return{name:ie.Windows,version:e,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(t){const e={name:ie.iOS},n=T.getSecondMatch(/(Version\/)(\d[\d.]+)/,t);return n&&(e.version=n),e}},{test:[/macintosh/i],describe(t){const e=T.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,t).replace(/[_\s]/g,"."),n=T.getMacOSVersionName(e),r={name:ie.MacOS,version:e};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe(t){const e=T.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,t).replace(/[_\s]/g,".");return{name:ie.iOS,version:e}}},{test(t){const e=!t.test(/like android/i),n=t.test(/android/i);return e&&n},describe(t){const e=T.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,t),n=T.getAndroidVersionName(e),r={name:ie.Android,version:e};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe(t){const e=T.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,t),n={name:ie.WebOS};return e&&e.length&&(n.version=e),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(t){const e=T.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,t)||T.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,t)||T.getFirstMatch(/\bbb(\d+)/i,t);return{name:ie.BlackBerry,version:e}}},{test:[/bada/i],describe(t){const e=T.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,t);return{name:ie.Bada,version:e}}},{test:[/tizen/i],describe(t){const e=T.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,t);return{name:ie.Tizen,version:e}}},{test:[/linux/i],describe:()=>({name:ie.Linux})},{test:[/CrOS/],describe:()=>({name:ie.ChromeOS})},{test:[/PlayStation 4/],describe(t){const e=T.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,t);return{name:ie.PlayStation4,version:e}}}],$a=[{test:[/googlebot/i],describe:()=>({type:"bot",vendor:"Google"})},{test:[/huawei/i],describe(t){const e=T.getFirstMatch(/(can-l01)/i,t)&&"Nova",n={type:K.mobile,vendor:"Huawei"};return e&&(n.model=e),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:()=>({type:K.tablet,vendor:"Nexus"})},{test:[/ipad/i],describe:()=>({type:K.tablet,vendor:"Apple",model:"iPad"})},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:()=>({type:K.tablet,vendor:"Apple",model:"iPad"})},{test:[/kftt build/i],describe:()=>({type:K.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"})},{test:[/silk/i],describe:()=>({type:K.tablet,vendor:"Amazon"})},{test:[/tablet(?! pc)/i],describe:()=>({type:K.tablet})},{test(t){const e=t.test(/ipod|iphone/i),n=t.test(/like (ipod|iphone)/i);return e&&!n},describe(t){const e=T.getFirstMatch(/(ipod|iphone)/i,t);return{type:K.mobile,vendor:"Apple",model:e}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:()=>({type:K.mobile,vendor:"Nexus"})},{test:[/[^-]mobi/i],describe:()=>({type:K.mobile})},{test:t=>t.getBrowserName(!0)==="blackberry",describe:()=>({type:K.mobile,vendor:"BlackBerry"})},{test:t=>t.getBrowserName(!0)==="bada",describe:()=>({type:K.mobile})},{test:t=>t.getBrowserName()==="windows phone",describe:()=>({type:K.mobile,vendor:"Microsoft"})},{test(t){const e=Number(String(t.getOSVersion()).split(".")[0]);return t.getOSName(!0)==="android"&&e>=3},describe:()=>({type:K.tablet})},{test:t=>t.getOSName(!0)==="android",describe:()=>({type:K.mobile})},{test:t=>t.getOSName(!0)==="macos",describe:()=>({type:K.desktop,vendor:"Apple"})},{test:t=>t.getOSName(!0)==="windows",describe:()=>({type:K.desktop})},{test:t=>t.getOSName(!0)==="linux",describe:()=>({type:K.desktop})},{test:t=>t.getOSName(!0)==="playstation 4",describe:()=>({type:K.tv})},{test:t=>t.getOSName(!0)==="roku",describe:()=>({type:K.tv})}],za=[{test:t=>t.getBrowserName(!0)==="microsoft edge",describe(t){if(/\sedg\//i.test(t))return{name:De.Blink};const e=T.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,t);return{name:De.EdgeHTML,version:e}}},{test:[/trident/i],describe(t){const e={name:De.Trident},n=T.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:t=>t.test(/presto/i),describe(t){const e={name:De.Presto},n=T.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test(t){const e=t.test(/gecko/i),n=t.test(/like gecko/i);return e&&!n},describe(t){const e={name:De.Gecko},n=T.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/(apple)?webkit\/537\.36/i],describe:()=>({name:De.Blink})},{test:[/(apple)?webkit/i],describe(t){const e={name:De.WebKit},n=T.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}}];class vi{constructor(e,n=!1){if(e==null||e==="")throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},n!==!0&&this.parse()}getUA(){return this._ua}test(e){return e.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const e=T.find(Ja,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.browser=e.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const e=T.find(qa,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.os=e.describe(this.getUA())),this.parsedResult.os}getOSName(e){const{name:n}=this.getOS();return e?String(n).toLowerCase()||"":n||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(e=!1){const{type:n}=this.getPlatform();return e?String(n).toLowerCase()||"":n||""}parsePlatform(){this.parsedResult.platform={};const e=T.find($a,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.platform=e.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const e=T.find(za,n=>{if(typeof n.test=="function")return n.test(this);if(n.test instanceof Array)return n.test.some(r=>this.test(r));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.engine=e.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return T.assign({},this.parsedResult)}satisfies(e){const n={};let r=0;const i={};let s=0;if(Object.keys(e).forEach(a=>{const c=e[a];typeof c=="string"?(i[a]=c,s+=1):typeof c=="object"&&(n[a]=c,r+=1)}),r>0){const a=Object.keys(n),c=T.find(a,f=>this.isOS(f));if(c){const f=this.satisfies(n[c]);if(f!==void 0)return f}const l=T.find(a,f=>this.isPlatform(f));if(l){const f=this.satisfies(n[l]);if(f!==void 0)return f}}if(s>0){const a=Object.keys(i),c=T.find(a,l=>this.isBrowser(l,!0));if(c!==void 0)return this.compareVersion(i[c])}}isBrowser(e,n=!1){const r=this.getBrowserName().toLowerCase();let i=e.toLowerCase();const s=T.getBrowserTypeByAlias(i);return n&&s&&(i=s.toLowerCase()),i===r}compareVersion(e){let n=[0],r=e,i=!1;const s=this.getBrowserVersion();if(typeof s=="string")return e[0]===">"||e[0]==="<"?(r=e.substr(1),e[1]==="="?(i=!0,r=e.substr(2)):n=[],e[0]===">"?n.push(1):n.push(-1)):e[0]==="="?r=e.substr(1):e[0]==="~"&&(i=!0,r=e.substr(1)),n.indexOf(T.compareVersions(s,r,i))>-1}isOS(e){return this.getOSName(!0)===String(e).toLowerCase()}isPlatform(e){return this.getPlatformType(!0)===String(e).toLowerCase()}isEngine(e){return this.getEngineName(!0)===String(e).toLowerCase()}is(e,n=!1){return this.isBrowser(e,n)||this.isOS(e)||this.isPlatform(e)}some(e=[]){return e.some(n=>this.is(n))}}/*!
|
|
3
3
|
* Bowser - a browser detector
|
|
4
4
|
* https://github.com/lancedikson/bowser
|
|
5
5
|
* MIT License | (c) Dustin Diaz 2012-2015
|
|
6
6
|
* MIT License | (c) Denis Demchenko 2015-2019
|
|
7
|
-
*/class da{static getParser(e,n=!1){if(typeof e!="string")throw new Error("UserAgent should be a string");return new oi(e,n)}static parse(e){return new oi(e).getResult()}static get BROWSER_MAP(){return qs}static get ENGINE_MAP(){return Oe}static get OS_MAP(){return K}static get PLATFORMS_MAP(){return V}}function dn(){return Date.now()+Math.random().toString()}function pt(){throw new Error("Method must be implemented in subclass")}function Js(t,e){return e!=null&&e.proxyUrl?e.proxyUrl+(e.proxyUrl.slice(-1)==="/"?"":"/")+t.substring(8):t}function Xt(t){return t!=null&&t.callObjectBundleUrlOverride?t.callObjectBundleUrlOverride:Js("https://c.daily.co/call-machine/versioned/".concat("0.68.0","/static/call-machine-object-bundle.js"),t)}function St(t){try{new URL(t)}catch{return!1}return!0}const Vs=Object.prototype.toString;function $s(t){switch(Vs.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return He(t,Error)}}function lt(t,e){return Vs.call(t)===`[object ${e}]`}function mr(t){return lt(t,"ErrorEvent")}function ai(t){return lt(t,"DOMError")}function Ge(t){return lt(t,"String")}function Gs(t){return t===null||typeof t!="object"&&typeof t!="function"}function ot(t){return lt(t,"Object")}function Zt(t){return typeof Event<"u"&&He(t,Event)}function gr(t){return!!(t&&t.then&&typeof t.then=="function")}function He(t,e){try{return t instanceof e}catch{return!1}}function et(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function ci(t,e){if(!Array.isArray(t))return"";const n=[];for(let r=0;r<t.length;r++){const i=t[r];try{n.push(String(i))}catch{n.push("[value cannot be serialized]")}}return n.join(e)}function ha(t,e,n=!1){return!!Ge(t)&&(lt(e,"RegExp")?e.test(t):!!Ge(e)&&(n?t===e:t.includes(e)))}function Dt(t,e=[],n=!1){return e.some(r=>ha(t,r,n))}function pa(t,e,n=250,r,i,s,a){if(!(s.exception&&s.exception.values&&a&&He(a.originalException,Error)))return;const c=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;var l,p;c&&(s.exception.values=(l=Fn(t,e,i,a.originalException,r,s.exception.values,c,0),p=n,l.map(h=>(h.value&&(h.value=et(h.value,p)),h))))}function Fn(t,e,n,r,i,s,a,c){if(s.length>=n+1)return s;let l=[...s];if(He(r[i],Error)){li(a,c);const p=t(e,r[i]),h=l.length;ui(p,i,h,c),l=Fn(t,e,n,r[i],i,[p,...l],p,h)}return Array.isArray(r.errors)&&r.errors.forEach((p,h)=>{if(He(p,Error)){li(a,c);const f=t(e,p),_=l.length;ui(f,`errors[${h}]`,_,c),l=Fn(t,e,n,p,i,[f,...l],f,_)}}),l}function li(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,is_exception_group:!0,exception_id:e}}function ui(t,e,n,r){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,type:"chained",source:e,exception_id:n,parent_id:r}}function Lt(t){return t&&t.Math==Math?t:void 0}const ie=typeof globalThis=="object"&&Lt(globalThis)||typeof window=="object"&&Lt(window)||typeof self=="object"&&Lt(self)||typeof global=="object"&&Lt(global)||function(){return this}()||{};function At(){return ie}function vr(t,e,n){const r=n||ie,i=r.__SENTRY__=r.__SENTRY__||{};return i[t]||(i[t]=e())}const fa=At(),ma=80;function Un(t,e={}){try{let n=t;const r=5,i=[];let s=0,a=0;const c=" > ",l=c.length;let p;const h=Array.isArray(e)?e:e.keyAttrs,f=!Array.isArray(e)&&e.maxStringLength||ma;for(;n&&s++<r&&(p=ga(n,h),!(p==="html"||s>1&&a+i.length*l+p.length>=f));)i.push(p),a+=p.length,n=n.parentNode;return i.reverse().join(c)}catch{return"<unknown>"}}function ga(t,e){const n=t,r=[];let i,s,a,c,l;if(!n||!n.tagName)return"";r.push(n.tagName.toLowerCase());const p=e&&e.length?e.filter(f=>n.getAttribute(f)).map(f=>[f,n.getAttribute(f)]):null;if(p&&p.length)p.forEach(f=>{r.push(`[${f[0]}="${f[1]}"]`)});else if(n.id&&r.push(`#${n.id}`),i=n.className,i&&Ge(i))for(s=i.split(/\s+/),l=0;l<s.length;l++)r.push(`.${s[l]}`);const h=["aria-label","type","name","title","alt"];for(l=0;l<h.length;l++)a=h[l],c=n.getAttribute(a),c&&r.push(`[${a}="${c}"]`);return r.join("")}const en=["debug","info","warn","error","log","assert","trace"];function Hs(t){if(!("console"in ie))return t();const e=ie.console,n={};en.forEach(r=>{const i=e[r]&&e[r].__sentry_original__;r in e&&i&&(n[r]=e[r],e[r]=i)});try{return t()}finally{Object.keys(n).forEach(r=>{e[r]=n[r]})}}function di(){let t=!1;const e={enable:()=>{t=!0},disable:()=>{t=!1}};return typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?en.forEach(n=>{e[n]=(...r)=>{t&&Hs(()=>{ie.console[n](`Sentry Logger [${n}]:`,...r)})}}):en.forEach(n=>{e[n]=()=>{}}),e}let R;R=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?vr("logger",di):di();const va=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function tn(t,e=!1){const{host:n,path:r,pass:i,port:s,projectId:a,protocol:c,publicKey:l}=t;return`${c}://${l}${e&&i?`:${i}`:""}@${n}${s?`:${s}`:""}/${r&&`${r}/`}${a}`}function hi(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function ya(t){const e=typeof t=="string"?function(n){const r=va.exec(n);if(!r)return void console.error(`Invalid Sentry Dsn: ${n}`);const[i,s,a="",c,l="",p]=r.slice(1);let h="",f=p;const _=f.split("/");if(_.length>1&&(h=_.slice(0,-1).join("/"),f=_.pop()),f){const k=f.match(/^\d+/);k&&(f=k[0])}return hi({host:c,pass:a,path:h,projectId:f,port:l,protocol:i,publicKey:s})}(t):hi(t);if(e&&function(n){if(typeof __SENTRY_DEBUG__<"u"&&!__SENTRY_DEBUG__)return!0;const{port:r,projectId:i,protocol:s}=n;return!(["protocol","publicKey","host","projectId"].find(a=>!n[a]&&(R.error(`Invalid Sentry Dsn: ${a} missing`),!0))||(i.match(/^\d+$/)?function(a){return a==="http"||a==="https"}(s)?r&&isNaN(parseInt(r,10))&&(R.error(`Invalid Sentry Dsn: Invalid port ${r}`),1):(R.error(`Invalid Sentry Dsn: Invalid protocol ${s}`),1):(R.error(`Invalid Sentry Dsn: Invalid projectId ${i}`),1)))}(e))return e}class le extends Error{constructor(e,n="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=n}}function z(t,e,n){if(!(e in t))return;const r=t[e],i=n(r);if(typeof i=="function")try{zs(i,r)}catch{}t[e]=i}function yr(t,e,n){Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}function zs(t,e){const n=e.prototype||{};t.prototype=e.prototype=n,yr(t,"__sentry_original__",e)}function _r(t){return t.__sentry_original__}function Ws(t){if($s(t))return{message:t.message,name:t.name,stack:t.stack,...fi(t)};if(Zt(t)){const e={type:t.type,target:pi(t.target),currentTarget:pi(t.currentTarget),...fi(t)};return typeof CustomEvent<"u"&&He(t,CustomEvent)&&(e.detail=t.detail),e}return t}function pi(t){try{return e=t,typeof Element<"u"&&He(e,Element)?Un(t):Object.prototype.toString.call(t)}catch{return"<unknown>"}var e}function fi(t){if(typeof t=="object"&&t!==null){const e={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}return{}}function hn(t){return qn(t,new Map)}function qn(t,e){if(ot(t)){const n=e.get(t);if(n!==void 0)return n;const r={};e.set(t,r);for(const i of Object.keys(t))t[i]!==void 0&&(r[i]=qn(t[i],e));return r}if(Array.isArray(t)){const n=e.get(t);if(n!==void 0)return n;const r=[];return e.set(t,r),t.forEach(i=>{r.push(qn(i,e))}),r}return t}const mi="<anonymous>";function Le(t){try{return t&&typeof t=="function"&&t.name||mi}catch{return mi}}const wn=At();function Jn(t){return t&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function _a(){if(!function(){if(!("fetch"in wn))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}())return!1;if(Jn(wn.fetch))return!0;let t=!1;const e=wn.document;if(e&&typeof e.createElement=="function")try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(t=Jn(n.contentWindow.fetch)),e.head.removeChild(n)}catch(n){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return t}const Nt=At(),J=At(),vt="__sentry_xhr_v2__",_t={},gi={};function ba(t){if(!gi[t])switch(gi[t]=!0,t){case"console":(function(){"console"in J&&en.forEach(function(e){e in J.console&&z(J.console,e,function(n){return function(...r){ae("console",{args:r,level:e}),n&&n.apply(J.console,r)}})})})();break;case"dom":(function(){if(!("document"in J))return;const e=ae.bind(null,"dom"),n=yi(e,!0);J.document.addEventListener("click",n,!1),J.document.addEventListener("keypress",n,!1),["EventTarget","Node"].forEach(r=>{const i=J[r]&&J[r].prototype;i&&i.hasOwnProperty&&i.hasOwnProperty("addEventListener")&&(z(i,"addEventListener",function(s){return function(a,c,l){if(a==="click"||a=="keypress")try{const p=this,h=p.__sentry_instrumentation_handlers__=p.__sentry_instrumentation_handlers__||{},f=h[a]=h[a]||{refCount:0};if(!f.handler){const _=yi(e);f.handler=_,s.call(this,a,_,l)}f.refCount++}catch{}return s.call(this,a,c,l)}}),z(i,"removeEventListener",function(s){return function(a,c,l){if(a==="click"||a=="keypress")try{const p=this,h=p.__sentry_instrumentation_handlers__||{},f=h[a];f&&(f.refCount--,f.refCount<=0&&(s.call(this,a,f.handler,l),f.handler=void 0,delete h[a]),Object.keys(h).length===0&&delete p.__sentry_instrumentation_handlers__)}catch{}return s.call(this,a,c,l)}}))})})();break;case"xhr":(function(){if(!("XMLHttpRequest"in J))return;const e=XMLHttpRequest.prototype;z(e,"open",function(n){return function(...r){const i=r[1],s=this[vt]={method:Ge(r[0])?r[0].toUpperCase():r[0],url:r[1],request_headers:{}};Ge(i)&&s.method==="POST"&&i.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const a=()=>{const c=this[vt];if(c&&this.readyState===4){try{c.status_code=this.status}catch{}ae("xhr",{args:r,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:this})}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?z(this,"onreadystatechange",function(c){return function(...l){return a(),c.apply(this,l)}}):this.addEventListener("readystatechange",a),z(this,"setRequestHeader",function(c){return function(...l){const[p,h]=l,f=this[vt];return f&&(f.request_headers[p.toLowerCase()]=h),c.apply(this,l)}}),n.apply(this,r)}}),z(e,"send",function(n){return function(...r){const i=this[vt];return i&&r[0]!==void 0&&(i.body=r[0]),ae("xhr",{args:r,startTimestamp:Date.now(),xhr:this}),n.apply(this,r)}})})();break;case"fetch":(function(){_a()&&z(J,"fetch",function(e){return function(...n){const{method:r,url:i}=function(a){if(a.length===0)return{method:"GET",url:""};if(a.length===2){const[l,p]=a;return{url:vi(l),method:Vn(p,"method")?String(p.method).toUpperCase():"GET"}}const c=a[0];return{url:vi(c),method:Vn(c,"method")?String(c.method).toUpperCase():"GET"}}(n),s={args:n,fetchData:{method:r,url:i},startTimestamp:Date.now()};return ae("fetch",{...s}),e.apply(J,n).then(a=>(ae("fetch",{...s,endTimestamp:Date.now(),response:a}),a),a=>{throw ae("fetch",{...s,endTimestamp:Date.now(),error:a}),a})}})})();break;case"history":(function(){if(!function(){const r=Nt.chrome,i=r&&r.app&&r.app.runtime,s="history"in Nt&&!!Nt.history.pushState&&!!Nt.history.replaceState;return!i&&s}())return;const e=J.onpopstate;function n(r){return function(...i){const s=i.length>2?i[2]:void 0;if(s){const a=jt,c=String(s);jt=c,ae("history",{from:a,to:c})}return r.apply(this,i)}}J.onpopstate=function(...r){const i=J.location.href,s=jt;if(jt=i,ae("history",{from:s,to:i}),e)try{return e.apply(this,r)}catch{}},z(J.history,"pushState",n),z(J.history,"replaceState",n)})();break;case"error":Bt=J.onerror,J.onerror=function(e,n,r,i,s){return ae("error",{column:i,error:s,line:r,msg:e,url:n}),!(!Bt||Bt.__SENTRY_LOADER__)&&Bt.apply(this,arguments)},J.onerror.__SENTRY_INSTRUMENTED__=!0;break;case"unhandledrejection":Ft=J.onunhandledrejection,J.onunhandledrejection=function(e){return ae("unhandledrejection",e),!(Ft&&!Ft.__SENTRY_LOADER__)||Ft.apply(this,arguments)},J.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0;break;default:return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn("unknown instrumentation type:",t))}}function Ue(t,e){_t[t]=_t[t]||[],_t[t].push(e),ba(t)}function ae(t,e){if(t&&_t[t])for(const n of _t[t]||[])try{n(e)}catch(r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.error(`Error while triggering instrumentation handler.
|
|
7
|
+
*/class Ha{static getParser(e,n=!1){if(typeof e!="string")throw new Error("UserAgent should be a string");return new vi(e,n)}static parse(e){return new vi(e).getResult()}static get BROWSER_MAP(){return _o}static get ENGINE_MAP(){return De}static get OS_MAP(){return ie}static get PLATFORMS_MAP(){return K}}function En(){return Date.now()+Math.random().toString()}function Et(){throw new Error("Method must be implemented in subclass")}function wo(t,e){return e!=null&&e.proxyUrl?e.proxyUrl+(e.proxyUrl.slice(-1)==="/"?"":"/")+t.substring(8):t}function dn(t){return t!=null&&t.callObjectBundleUrlOverride?t.callObjectBundleUrlOverride:wo("https://c.daily.co/call-machine/versioned/".concat("0.81.0","/static/call-machine-object-bundle.js"),t)}function fn(t){try{new URL(t)}catch{return!1}return!0}const W=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Ke="8.55.0",$=globalThis;function hn(t,e,n){const r=$,i=r.__SENTRY__=r.__SENTRY__||{},s=i[Ke]=i[Ke]||{};return s[t]||(s[t]=e())}const it=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,sr=["debug","info","warn","error","log","assert","trace"],pn={};function Lt(t){if(!("console"in $))return t();const e=$.console,n={},r=Object.keys(pn);r.forEach(i=>{const s=pn[i];n[i]=e[i],e[i]=s});try{return t()}finally{r.forEach(i=>{e[i]=n[i]})}}const D=hn("logger",function(){let t=!1;const e={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return it?sr.forEach(n=>{e[n]=(...r)=>{t&&Lt(()=>{$.console[n](`Sentry Logger [${n}]:`,...r)})}}):sr.forEach(n=>{e[n]=()=>{}}),e}),We="?",yi=/\(error: (.*)\)/,bi=/captureMessage|captureException/;function $t(t){return t[t.length-1]||{}}const _i="<anonymous>";function Fe(t){try{return t&&typeof t=="function"&&t.name||_i}catch{return _i}}function wi(t){const e=t.exception;if(e){const n=[];try{return e.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch{return}}}const rn={},Si={};function Qe(t,e){rn[t]=rn[t]||[],rn[t].push(e)}function Xe(t,e){if(!Si[t]){Si[t]=!0;try{e()}catch(n){it&&D.error(`Error while instrumenting ${t}`,n)}}}function _e(t,e){const n=t&&rn[t];if(n)for(const r of n)try{r(e)}catch(i){it&&D.error(`Error while triggering instrumentation handler.
|
|
8
8
|
Type: ${t}
|
|
9
|
-
Name: ${
|
|
10
|
-
Error:`,r)}}function Vn(t,e){return!!t&&typeof t=="object"&&!!t[e]}function vi(t){return typeof t=="string"?t:t?Vn(t,"url")?t.url:t.toString?t.toString():"":""}let jt;const wa=1e3;let It,Sn;function yi(t,e=!1){return n=>{if(!n||Sn===n||function(i){if(i.type!=="keypress")return!1;try{const s=i.target;if(!s||!s.tagName)return!0;if(s.tagName==="INPUT"||s.tagName==="TEXTAREA"||s.isContentEditable)return!1}catch{}return!0}(n))return;const r=n.type==="keypress"?"input":n.type;(It===void 0||function(i,s){if(!i||i.type!==s.type)return!0;try{if(i.target!==s.target)return!0}catch{}return!1}(Sn,n))&&(t({event:n,name:r,global:e}),Sn=n),clearTimeout(It),It=J.setTimeout(()=>{It=void 0},wa)}}let Bt=null,Ft=null;function xe(){const t=ie,e=t.crypto||t.msCrypto;if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");const n=e&&e.getRandomValues?()=>e.getRandomValues(new Uint8Array(1))[0]:()=>16*Math.random();return("10000000100040008000"+1e11).replace(/[018]/g,r=>(r^(15&n())>>r/4).toString(16))}function Ys(t){return t.exception&&t.exception.values?t.exception.values[0]:void 0}function Pe(t){const{message:e,event_id:n}=t;if(e)return e;const r=Ys(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function $n(t,e,n){const r=t.exception=t.exception||{},i=r.values=r.values||[],s=i[0]=i[0]||{};s.value||(s.value=e||""),s.type||(s.type="Error")}function kt(t,e){const n=Ys(t);if(!n)return;const r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...e},e&&"data"in e){const i={...r&&r.data,...e.data};n.mechanism.data=i}}function _i(t){if(t&&t.__sentry_captured__)return!0;try{yr(t,"__sentry_captured__",!0)}catch{}return!1}function Re(t,e=100,n=1/0){try{return Gn("",t,e,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Ks(t,e=3,n=102400){const r=Re(t,e);return i=r,function(s){return~-encodeURI(s).split(/%..|./).length}(JSON.stringify(i))>n?Ks(t,e-1,n):r;var i}function Gn(t,e,n=1/0,r=1/0,i=function(){const s=typeof WeakSet=="function",a=s?new WeakSet:[];return[function(c){if(s)return!!a.has(c)||(a.add(c),!1);for(let l=0;l<a.length;l++)if(a[l]===c)return!0;return a.push(c),!1},function(c){if(s)a.delete(c);else for(let l=0;l<a.length;l++)if(a[l]===c){a.splice(l,1);break}}]}()){const[s,a]=i;if(e==null||["number","boolean","string"].includes(typeof e)&&(typeof(c=e)!="number"||c==c))return e;var c;const l=function(y,w){try{if(y==="domain"&&w&&typeof w=="object"&&w._events)return"[Domain]";if(y==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&w===global)return"[Global]";if(typeof window<"u"&&w===window)return"[Window]";if(typeof document<"u"&&w===document)return"[Document]";if(function(M){return ot(M)&&"nativeEvent"in M&&"preventDefault"in M&&"stopPropagation"in M}(w))return"[SyntheticEvent]";if(typeof w=="number"&&w!=w)return"[NaN]";if(typeof w=="function")return`[Function: ${Le(w)}]`;if(typeof w=="symbol")return`[${String(w)}]`;if(typeof w=="bigint")return`[BigInt: ${String(w)}]`;const T=function(M){const B=Object.getPrototypeOf(M);return B?B.constructor.name:"null prototype"}(w);return/^HTML(\w*)Element$/.test(T)?`[HTMLElement: ${T}]`:`[object ${T}]`}catch(T){return`**non-serializable** (${T})`}}(t,e);if(!l.startsWith("[object "))return l;if(e.__sentry_skip_normalization__)return e;const p=typeof e.__sentry_override_normalization_depth__=="number"?e.__sentry_override_normalization_depth__:n;if(p===0)return l.replace("object ","");if(s(e))return"[Circular ~]";const h=e;if(h&&typeof h.toJSON=="function")try{return Gn("",h.toJSON(),p-1,r,i)}catch{}const f=Array.isArray(e)?[]:{};let _=0;const k=Ws(e);for(const y in k){if(!Object.prototype.hasOwnProperty.call(k,y))continue;if(_>=r){f[y]="[MaxProperties ~]";break}const w=k[y];f[y]=Gn(y,w,p-1,r,i),_++}return a(e),f}var ke;function ze(t){return new Q(e=>{e(t)})}function nn(t){return new Q((e,n)=>{n(t)})}(function(t){t[t.PENDING=0]="PENDING",t[t.RESOLVED=1]="RESOLVED",t[t.REJECTED=2]="REJECTED"})(ke||(ke={}));class Q{__init(){this._state=ke.PENDING}__init2(){this._handlers=[]}constructor(e){Q.prototype.__init.call(this),Q.prototype.__init2.call(this),Q.prototype.__init3.call(this),Q.prototype.__init4.call(this),Q.prototype.__init5.call(this),Q.prototype.__init6.call(this);try{e(this._resolve,this._reject)}catch(n){this._reject(n)}}then(e,n){return new Q((r,i)=>{this._handlers.push([!1,s=>{if(e)try{r(e(s))}catch(a){i(a)}else r(s)},s=>{if(n)try{r(n(s))}catch(a){i(a)}else i(s)}]),this._executeHandlers()})}catch(e){return this.then(n=>n,e)}finally(e){return new Q((n,r)=>{let i,s;return this.then(a=>{s=!1,i=a,e&&e()},a=>{s=!0,i=a,e&&e()}).then(()=>{s?r(i):n(i)})})}__init3(){this._resolve=e=>{this._setResult(ke.RESOLVED,e)}}__init4(){this._reject=e=>{this._setResult(ke.REJECTED,e)}}__init5(){this._setResult=(e,n)=>{this._state===ke.PENDING&&(gr(n)?n.then(this._resolve,this._reject):(this._state=e,this._value=n,this._executeHandlers()))}}__init6(){this._executeHandlers=()=>{if(this._state===ke.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach(n=>{n[0]||(this._state===ke.RESOLVED&&n[1](this._value),this._state===ke.REJECTED&&n[2](this._value),n[0]=!0)})}}}function Sa(t){const e=[];function n(r){return e.splice(e.indexOf(r),1)[0]}return{$:e,add:function(r){if(!(t===void 0||e.length<t))return nn(new le("Not adding Promise because buffer limit was reached."));const i=r();return e.indexOf(i)===-1&&e.push(i),i.then(()=>n(i)).then(null,()=>n(i).then(null,()=>{})),i},drain:function(r){return new Q((i,s)=>{let a=e.length;if(!a)return i(!0);const c=setTimeout(()=>{r&&r>0&&i(!1)},r);e.forEach(l=>{ze(l).then(()=>{--a||(clearTimeout(c),i(!0))},s)})})}}}function kn(t){if(!t)return{};const e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};const n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:n,hash:r,relative:e[5]+n+r}}const ka=["fatal","error","warning","log","info","debug"],Qs=At(),Hn={nowSeconds:()=>Date.now()/1e3},En=typeof __SENTRY_BROWSER_BUNDLE__<"u"&&__SENTRY_BROWSER_BUNDLE__||Object.prototype.toString.call(typeof process<"u"?process:0)!=="[object process]"?function(){const{performance:t}=Qs;if(!(!t||!t.now))return{now:()=>t.now(),timeOrigin:Date.now()-t.now()}}():function(){try{return(t=module,e="perf_hooks",t.require(e)).performance}catch{return}var t,e}(),bi=En===void 0?Hn:{nowSeconds:()=>(En.timeOrigin+En.now())/1e3},pn=Hn.nowSeconds.bind(Hn),Xs=bi.nowSeconds.bind(bi);function Et(t,e=[]){return[t,e]}function Ea(t,e){const[n,r]=t;return[n,[...r,e]]}function wi(t,e){const n=t[1];for(const r of n)if(e(r,r[0].type))return!0;return!1}function zn(t,e){return(e||new TextEncoder).encode(t)}function Ta(t,e){const[n,r]=t;let i=JSON.stringify(n);function s(a){typeof i=="string"?i=typeof a=="string"?i+a:[zn(i,e),a]:i.push(typeof a=="string"?zn(a,e):a)}for(const a of r){const[c,l]=a;if(s(`
|
|
11
|
-
${JSON.stringify(
|
|
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 Ca(t,e){const n=typeof t.data=="string"?zn(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}=Qs;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 Ma={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 Si(t){return Ma[t]}function Zs(t){if(!t||!t.sdk)return;const{name:e,version:n}=t.sdk;return{name:e,version:n}}const Oa=6e4;function Aa(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)?Oa:h-l}(a,r):e===429&&(i.all=r+6e4);return i}const br="production";function Pa(t){const e=Xs(),n={sid:xe(),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||Xs(),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:xe()),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=ki()}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=ki(),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([...eo(),...this._eventProcessors],e,n)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}_notifyEventProcessors(e,n,r,i=0){return new Q((s,a)=>{const c=e[i];if(n===null||typeof c!="function")s(n);else{const l=c({...n},r);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&c.id&&l===null&&R.log(`Event processor "${c.id}" dropped event`),gr(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 eo(){return vr("globalEventProcessors",()=>[])}function to(t){eo().push(t)}function ki(){return{traceId:xe(),spanId:xe().substring(16),sampled:!1}}const no=4,Ra=100;class wr{constructor(e,n=new Je,r=no){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:xe(),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:xe(),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:xe();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=Ra}=i.getOptions&&i.getOptions()||{};if(a<=0)return;const c={timestamp:pn(),...e},l=s?Hs(()=>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=Ei(this);try{e(this)}finally{Ei(n)}}getIntegration(e){const n=this.getClient();if(!n)return null;try{return n.getIntegration(e)}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,n){const r=this._callExtensionMethod("startTransaction",e,n);return typeof __SENTRY_DEBUG__<"u"&&!__SENTRY_DEBUG__||r||console.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
|
|
13
|
-
Sentry.
|
|
14
|
-
|
|
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=br}=r&&r.getOptions()||{},{userAgent:a}=ie.navigator||{},c=Pa({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 Ei(t){const e=rn(),n=Wn(e);return ro(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&&!Wn(e).isOlderThan(no)||ro(e,new wr);var n;return Wn(e)}(t)}function Wn(t){return vr("hub",()=>new wr,t)}function ro(t,e){return t?((t.__SENTRY__=t.__SENTRY__||{}).hub=e,!0):!1}const xa="7";function Da(t,e){return n={sentry_key:t.publicKey,sentry_version:xa,...e&&{sentry_client:`${e.name}/${e.version}`}},Object.keys(n).map(r=>`${encodeURIComponent(r)}=${encodeURIComponent(n[r])}`).join("&");var n}function La(t,e,n,r){const i=Zs(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 Ti=[];function Ci(t,e){e[t.name]=t,Ti.indexOf(t.name)===-1&&(t.setupOnce(to,te),Ti.push(t.name),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log(`Integration installed: ${t.name}`))}function Na(t,e,n,r){const{normalizeDepth:i=3,normalizeMaxBreadth:s=1e3}=t,a={...e,event_id:e.event_id||n.event_id||xe(),timestamp:e.timestamp||pn()},c=n.integrations||t.integrations.map(h=>h.name);(function(h,f){const{environment:_,release:k,dist:y,maxValueLength:w=250}=f;"environment"in h||(h.environment="environment"in f?_:br),h.release===void 0&&k!==void 0&&(h.release=k),h.dist===void 0&&y!==void 0&&(h.dist=y),h.message&&(h.message=et(h.message,w));const T=h.exception&&h.exception.values&&h.exception.values[0];T&&T.value&&(T.value=et(T.value,w));const M=h.request;M&&M.url&&(M.url=et(M.url,w))})(a,t),function(h,f){f.length>0&&(h.sdk=h.sdk||{},h.sdk.integrations=[...h.sdk.integrations||[],...f])}(a,c),e.type===void 0&&function(h,f){const _=ie._sentryDebugIds;if(!_)return;let k;const y=Mi.get(f);y?k=y:(k=new Map,Mi.set(f,k));const w=Object.keys(_).reduce((T,M)=>{let B;const L=k.get(M);L?B=L:(B=f(M),k.set(M,B));for(let 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=w[M.filename])})})}catch{}}(a,t.stackParser);let l=r;n.captureContext&&(l=Je.clone(l).update(n.captureContext));let p=ze(a);if(l){if(l.getAttachments){const h=[...n.attachments||[],...l.getAttachments()];h.length&&(n.attachments=h)}p=l.applyToEvent(a,n)}return p.then(h=>(h&&function(f){const _={};try{f.exception.values.forEach(y=>{y.stacktrace.frames.forEach(w=>{w.debug_id&&(w.abs_path?_[w.abs_path]=w.debug_id:w.filename&&(_[w.filename]=w.debug_id),delete w.debug_id)})})}catch{}if(Object.keys(_).length===0)return;f.debug_meta=f.debug_meta||{},f.debug_meta.images=f.debug_meta.images||[];const k=f.debug_meta.images;Object.keys(_).forEach(y=>{k.push({type:"sourcemap",code_file:y,debug_id:_[y]})})}(h),typeof i=="number"&&i>0?function(f,_,k){if(!f)return null;const y={...f,...f.breadcrumbs&&{breadcrumbs:f.breadcrumbs.map(w=>({...w,...w.data&&{data:Re(w.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&&y.contexts&&(y.contexts.trace=f.contexts.trace,f.contexts.trace.data&&(y.contexts.trace.data=Re(f.contexts.trace.data,_,k))),f.spans&&(y.spans=f.spans.map(w=>(w.data&&(w.data=Re(w.data,_,k)),w))),y}(h,i,s):h))}const Mi=new WeakMap,Oi="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=ya(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)}?${Da(r,a)}`}(this._dsn,e);this._transport=e.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:n})}}captureException(e,n,r){if(_i(e))return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log(Oi));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=Gs(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&&_i(n.originalException))return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log(Oi));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)):ze(!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&&Ci(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){Ci(e,this._integrations)}sendEvent(e,n={}){if(this._dsn){let r=La(e,this._dsn,this._options._metadata,this._options.tunnel);for(const s of n.attachments||[])r=Ea(r,Ca(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=Zs(s);return Et({sent_at:new Date().toISOString(),...c&&{sdk:c},...!!a&&{dsn:tn(i)}},["aggregates"in r?[{type:"sessions"},r]:[{type:"session"},r.toJSON()]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(n)}}recordDroppedEvent(e,n,r){if(this._options.sendClientReports){const i=`${e}:${n}`;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.log(`Adding outcome: "${i}"`),this._outcomes[i]=this._outcomes[i]+1||1}}on(e,n){this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(n)}emit(e,...n){this._hooks[e]&&this._hooks[e].forEach(r=>r(...n))}_updateSessionFromEvent(e,n){let r=!1,i=!1;const s=n.exception&&n.exception.values;if(s){i=!0;for(const c of s){const l=c.mechanism;if(l&&l.handled===!1){r=!0;break}}}const a=e.status==="ok";(a&&e.errors===0||a&&r)&&(at(e,{...r&&{status:"crashed"},errors:e.errors||Number(i||r)}),this.captureSession(e))}_isClientDoneProcessing(e){return new Q(n=>{let r=0;const i=setInterval(()=>{this._numProcessing==0?(clearInterval(i),n(!0)):(r+=1,e&&r>=e&&(clearInterval(i),n(!1)))},1)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._dsn!==void 0}_prepareEvent(e,n,r){const i=this.getOptions(),s=Object.keys(this._integrations);return!n.integrations&&s.length>0&&(n.integrations=s),Na(i,e,n,r).then(a=>{if(a===null)return a;const{propagationContext:c}=a.sdkProcessingMetadata||{};if(!(a.contexts&&a.contexts.trace)&&c){const{traceId:l,spanId:p,parentSpanId:h,dsc:f}=c;a.contexts={trace:{trace_id:l,span_id:p,parent_span_id:h},...a.contexts};const _=f||function(k,y,w){const T=y.getOptions(),{publicKey:M}=y.getDsn()||{},{segment:B}=w&&w.getUser()||{},L=hn({environment:T.environment||br,release:T.release,user_segment:B,public_key:M,trace_id:k});return y.emit&&y.emit("createDsc",L),L}(l,this,r);a.sdkProcessingMetadata={dynamicSamplingContext:_,...a.sdkProcessingMetadata}}return a})}_captureEvent(e,n={},r){return this._processEvent(e,n,r).then(i=>i.event_id,i=>{if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){const s=i;s.logLevel==="log"?R.log(s.message):R.warn(s)}})}_processEvent(e,n,r){const i=this.getOptions(),{sampleRate:s}=i;if(!this._isEnabled())return nn(new le("SDK not enabled, will not capture event.","log"));const a=Pi(e),c=Ai(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,y,w){const{beforeSend:T,beforeSendTransaction:M}=k;return Ai(y)&&T?T(y,w):Pi(y)&&M?M(y,w):y}(i,f,n);return function(k,y){const w=`${y} must return \`null\` or a valid event.`;if(gr(k))return k.then(T=>{if(!ot(T)&&T!==null)throw new le(w);return T},T=>{throw new le(`${y} rejected with ${T}`)});if(!ot(k)&&k!==null)throw new le(w);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 y="custom";f.transaction_info={...k,source:y}}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
|
-
|
|
17
|
-
Event: ${
|
|
18
|
-
Event: ${
|
|
19
|
-
|
|
20
|
-
Event: ${
|
|
21
|
-
Url: ${Ut(h)}`),!0):function(_,k){if(!k||!k.length)return!0;const y=Ut(_);return!y||Dt(y,k)}(h,f.allowUrls)?!1:((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
22
|
-
Event: ${Pe(h)}.
|
|
23
|
-
Url: ${Ut(h)}`),!0)}(i,p)?null:i}}return i};r.id=this.name,e(r)}}function Ut(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch{}return e?function(n=[]){for(let r=n.length-1;r>=0;r--){const i=n[r];if(i&&i.filename!=="<anonymous>"&&i.filename!=="[native code]")return i.filename||null}return null}(e):null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&R.error(`Cannot extract url for event ${Pe(t)}`),null}}tt.__initStatic();var Ua=Object.freeze({__proto__:null,FunctionToString:Tt,InboundFilters:tt});const F=ie;let Yn=0;function io(){return Yn>0}function ct(t,e={},n){if(typeof t!="function")return t;try{const i=t.__sentry_wrapped__;if(i)return i;if(_r(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 Yn++,setTimeout(()=>{Yn--}),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{}zs(r,t),yr(t,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get:()=>t.name})}catch{}return r}function so(t,e){const n=Sr(t,e),r={type:e&&e.name,value:Ja(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:[so(t,e)]}}}function Sr(t,e){const n=e.stacktrace||e.stack||"",r=function(i){if(i){if(typeof i.framesToPop=="number")return i.framesToPop;if(qa.test(i.message))return 1}return 0}(e);try{return t(n,r)}catch{}return[]}const qa=/Minified React error #\d+;/i;function Ja(t){const e=t&&t.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:e:"No error message"}function kr(t,e,n,r,i){let s;if(mr(e)&&e.error)return Tn(t,e.error);if(ai(e)||lt(e,"DOMException")){const a=e;if("stack"in e)s=Tn(t,e);else{const c=a.name||(ai(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 $s(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:Va(c,{isUnhandledRejection:p})}]},extra:{__serialized__:Ks(c,f)}};if(l){const k=Sr(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=Sr(t,n);s.length&&(i.exception={values:[{value:e,stacktrace:{frames:s}}]})}return i}function Va(t,{isUnhandledRejection:e}){const n=function(i,s=40){const a=Object.keys(Ws(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 mr(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 Li=1024,oo="Breadcrumbs";class Ct{static __initStatic(){this.id=oo}__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",$a),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>Li&&((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=Li),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",Ga),this.options.fetch&&Ue("fetch",Ha),this.options.history&&Ue("history",za)}addSentryBreadcrumb(e){this.options.sentry&&te().addBreadcrumb({category:"sentry."+(e.type==="transaction"?"transaction":"event"),event_id:e.event_id,level:e.level,message:Pe(e)},{event:e})}}function $a(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":ka.includes(n)?n:"log"),message:ci(t.args," ")};var n;if(t.level==="assert"){if(t.args[0]!==!1)return;e.message=`Assertion failed: ${ci(t.args.slice(1)," ")||"console.assert"}`,e.data.arguments=t.args.slice(1)}te().addBreadcrumb(e,{input:t.args,level:t.level})}function Ga(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 Ha(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 za(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 Wa 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:xi}],version:xi},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=kr(r,i,s&&s.syntheticException||void 0,a);return kt(c),c.level="error",s&&s.event_id&&(c.event_id=s.event_id),ze(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),ze(p)}(this._options.stackParser,e,n,r,this._options.attachStacktrace)}sendEvent(e,n){const r=this.getIntegrationById(oo);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 Ya(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 Ia(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 De{static __initStatic(){this.id="GlobalHandlers"}__init(){this.name=De.id}__init2(){this._installFunc={onerror:Ka,onunhandledrejection:Qa}}constructor(e){De.prototype.__init.call(this),De.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 Ka(){Ue("error",t=>{const[e,n,r]=co();if(!e.getIntegration(De))return;const{msg:i,url:s,line:a,column:c,error:l}=t;if(io()||l&&l.__sentry_own_request__)return;const p=l===void 0&&Ge(i)?function(h,f,_,k){const y=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let w=mr(h)?h.message:h,T="Error";const M=w.match(y);return M&&(T=M[1],w=M[2]),Ni({exception:{values:[{type:T,value:w}]}},f,_,k)}(i,s,a,c):Ni(kr(n,l||i,void 0,r,!1),s,a,c);p.level="error",ao(e,l,p,"onerror")})}function Qa(){Ue("unhandledrejection",t=>{const[e,n,r]=co();if(!e.getIntegration(De))return;let i=t;try{"reason"in t?i=t.reason:"detail"in t&&"reason"in t.detail&&(i=t.detail.reason)}catch{}if(io()||i&&i.__sentry_own_request__)return!0;const s=Gs(i)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(i)}`}]}}:kr(n,i,void 0,r,!0);s.level="error",ao(e,i,s,"onunhandledrejection")})}function Ni(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 fa.document.location.href}catch{return""}}();return l.length===0&&l.push({colno:p,filename:f,function:"?",in_app:!0,lineno:h}),t}function ao(t,e,n,r){kt(n,{handled:!1,type:r}),t.captureEvent(n,{originalException:e})}function co(){const t=te(),e=t.getClient(),n=e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[t,n.stackParser,n.attachStacktrace]}De.__initStatic();const Xa=["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",ji),this._options.setInterval&&z(F,"setInterval",ji),this._options.requestAnimationFrame&&z(F,"requestAnimationFrame",Za),this._options.XMLHttpRequest&&"XMLHttpRequest"in F&&z(XMLHttpRequest.prototype,"send",ec);const e=this._options.eventTarget;e&&(Array.isArray(e)?e:Xa).forEach(tc)}}function ji(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 Za(t){return function(e){return t.apply(this,[ct(e,{mechanism:{data:{function:"requestAnimationFrame",handler:Le(t)},handled:!0,type:"instrument"}})])}}function ec(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=_r(i);return a&&(s.mechanism.data.handler=Le(a)),ct(i,s)})}),t.apply(this,e)}}function tc(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 pa(so,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(){to(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||!Bi(l,p)||!Ii(l,p))}(a,c)||function(l,p){const h=Fi(p),f=Fi(l);return!(!h||!f||h.type!==f.type||h.value!==f.value||!Bi(l,p)||!Ii(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 Ii(t,e){let n=Ui(t),r=Ui(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 Bi(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 Fi(t){return t.exception&&t.exception.values&&t.exception.values[0]}function Ui(t){const e=t.exception;if(e)try{return e.values[0].stacktrace.frames}catch{return}}it.__initStatic();var nc=Object.freeze({__proto__:null,Breadcrumbs:Ct,Dedupe:it,GlobalHandlers:De,HttpContext:rt,LinkedErrors:nt,TryCatch:Mt});let lo={};F.Sentry&&F.Sentry.Integrations&&(lo=F.Sentry.Integrations);const qi={...lo,...Ua,...nc};var Ji="new",Vi="loading",$i="loaded",Qn="joining-meeting",Qe="joined-meeting",Ie="left-meeting",Ce="error",Cn="unknown",rc="full",ic="base",sc="*",oc="iframe-ready-for-launch-config",ac="iframe-launch-config",cc="theme-updated",lc="loading",uc="load-attempt-failed",Gi="loaded",dc="started-camera",hc="camera-error",pc="joining-meeting",fc="joined-meeting",mc="left-meeting",gc="participant-joined",vc="participant-updated",yc="participant-left",_c="participant-counts-updated",bc="access-state-updated",wc="meeting-session-summary-updated",Sc="meeting-session-state-updated",kc="waiting-participant-added",Ec="waiting-participant-updated",Tc="waiting-participant-removed",Cc="track-started",Mc="track-stopped",Oc="transcription-started",Ac="transcription-stopped",Pc="transcription-error",Hi="recording-started",zi="recording-stopped",Rc="recording-stats",xc="recording-error",Dc="recording-upload-completed",Lc="recording-data",Nc="app-message",jc="transcription-message",Ic="remote-media-player-started",Bc="remote-media-player-updated",Fc="remote-media-player-stopped",Uc="local-screen-share-started",qc="local-screen-share-stopped",Jc="local-screen-share-canceled",Vc="active-speaker-change",$c="active-speaker-mode-change",Gc="network-quality-change",Hc="network-connection",zc="cpu-load-change",Wc="face-counts-updated",qt="fullscreen",Jt="exited-fullscreen",Yc="live-streaming-started",Kc="live-streaming-updated",Qc="live-streaming-stopped",Xc="live-streaming-error",Zc="lang-updated",el="receive-settings-updated",tl="input-settings-updated",Wi="nonfatal-error",Yi="error",Ki=102400,Mn="iframe-call-message",Qi="local-screen-start",Xi="daily-method-update-live-streaming-endpoints",Vt="transmit-log",yt="daily-custom-track",Wt={NONE:"none",BGBLUR:"background-blur",BGIMAGE:"background-image",FACE_DETECTION:"face-detection"},uo={NONE:"none",NOISE_CANCELLATION:"noise-cancellation"},Xn={PLAY:"play",PAUSE:"pause"},Zi=10,On=["jpg","png","jpeg"],nl="add-endpoints",rl="remove-endpoints",es="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 ho(){return navigator&&navigator.mediaDevices&&navigator.mediaDevices.getUserMedia}function il(){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}(We(),er())||N())}function ts(){if(N()||!document)return!1;var t=document.createElement("iframe");return!!t.requestFullscreen||!!t.webkitRequestFullscreen}var sl=function(){try{var t=document.createElement("canvas"),e=t.getContext("webgl2")!=null;return t.remove(),e}catch{return!1}}();function po(){var t=arguments.length>0&&arguments[0]!==void 0&&arguments[0];return!N()&&!!sl&&(t?function(){return Zn()?!1:["Chrome","Firefox"].includes(We())}():function(){if(Zn())return!1;var e=We();if(e==="Safari"){var n=Tr();if(n.major<15||n.major===15&&n.minor<4)return!1}return e==="Chrome"?Er().major>=77:e==="Firefox"?Cr().major>=97:["Chrome","Firefox","Safari"].includes(e)}())}var ol=["Chrome","Firefox"];function fo(){return!N()&&!Zn()&&typeof AudioWorkletNode<"u"&&ol.includes(We())}function ns(){return ho()&&!function(){var t,e=We();if(!he())return!0;switch(e){case"Chrome":return(t=Er()).major&&t.major>0&&t.major<75;case"Firefox":return(t=Cr()).major<91;case"Safari":return(t=Tr()).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 We(){if(typeof window<"u"){var t=he();return mo()?"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(We()){case"Chrome":return Er();case"Safari":return Tr();case"Firefox":return Cr();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 Er(){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 mo(){return!!he().match(/iPad|iPhone|iPod/i)&&ho()}function Tr(){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 mo()&&(t=14,e=0,n=3)}return{major:t,minor:e,point:n}}function Cr(){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 go=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 rs(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 An(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?rs(Object(n),!0).forEach(function(r){Ae(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):rs(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function al(t){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var n,r=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 cl=function(t){ln(n,go);var e=al(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=An({},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=An({},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=An({},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 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)}}var ul=function(t){ln(n,go);var e=ll(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",is=[tr,nr],dl=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(!is.includes(e))throw Error("Unrecognized mergeStrategy provided. Options are: [".concat(is,"]"))}},{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);X(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]));X(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>Ki)throw Error("Meeting session data is too large (".concat(r.length," characters). Maximum size suppported is ").concat(Ki,"."))}}]),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 hl(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 ss(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 pl=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 fl(r,function(){i(!1)},function(a,c){c||ss(n._callClientId),s(a,c)}),this._currentLoad.start()}},{key:"cancel",value:function(){this._currentLoad&&this._currentLoad.cancel(),ss(this._callClientId)}},{key:"loaded",get:function(){return this._currentLoad&&this._currentLoad.succeeded}}]),t}(),fl=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 os(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 os(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}(),Pn=function(t){ln(n,ir(Error));var e=hl(n);function n(){return pe(this,n),e.apply(this,arguments)}return fe(n)}(),sn=2e4,os=function(){function t(n,r,i){pe(this,t),this._loadAttemptImpl=N()||!n.avoidEval?new ml(n,r,i):new gl(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}(),ml=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 Pn;var p=yield this._getBundleCodeFromResponse(s,l);if(this.cancelled)throw new Pn;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 Pn||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}(),gl=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 yl(t.local,e,n)===!0},vl=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=_l(t,e,n,r);return i&&i.pendingTrack},yl=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)},_l=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]},bl=function(t,e){var n=t.local.public.customTracks;if(n&&n[e])return n[e].track};function as(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?vl(n,s,l):Xe(n,t.session_id,s,l);h.state==="playable"&&(h.track=f),h.persistentTrack=f}}}function cs(t,e){try{var n=e.getState();for(var r in t.tracks)if(!wl(r)){var i=t.tracks[r].kind;if(i){var s=t.tracks[r];if(s){var a=t.local?bl(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 wl(t){return["video","audio","screenVideo","screenAudio"].includes(t)}function ls(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 Sl(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.
|
|
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 us(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var ve=new Map,st=null;function kl(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 ds(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 ds(l,p)}}(t))||e){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
25
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,a=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var l=n.next();return a=l.done,l},e:function(l){c=!0,s=l},f:function(){try{a||n.return==null||n.return()}finally{if(c)throw s}}}}function ds(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,El=3e3;function Tl(t){vo()?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=Sl(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=kl(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()}}),El)))}))}(t)}function Cl(t){vo()?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 vo(){return N()||navigator.mediaDevices.ondevicechange!==void 0}var Ml=new Set;function Ol(t,e){return t&&t.readyState==="live"&&!function(n,r){return n.muted&&!Ml.has(n.id)}(t)}var Al=["result"],Pl=["preserveIframe"];function hs(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function A(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?hs(Object(n),!0).forEach(function(r){Ae(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):hs(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Rl(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 ps(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 fs(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 fs(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 fs(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={},ms="video",xl="voice",gs=N()?{data:{}}:{data:{},topology:"none"},vs={present:0,hidden:0},yo={maxBitrate:{min:1e5,max:25e5},maxFramerate:{min:1,max:30},scaleResolutionDownBy:{min:1,max:8}},Rn=Object.keys(yo),ys=["state","volume","simulcastEncodings"],_s={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:Co,help:Eo()},customTrayButtons:{validate:To,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 Mo(t,_s)},help:"reactNativeConfig should look like ".concat(JSON.stringify(_s),", 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 _o(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 bo(t,{allowAllParticipantsKey:!1})},help:ko({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!!wo(t)&&(e._preloadCache.inputSettings||(e._preloadCache.inputSettings={}),So(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=ps(s);try{for(l.s();!(a=l.n()).done;){var p=a.value;if(!c.includes(p))return!1}}catch(y){l.e(y)}finally{l.f()}}else if(typeof s!="boolean")return!1;(s instanceof Array||Array.isArray(s))&&(t.canSend=new Set(s));break;case"canAdmin":if(s instanceof Set||s instanceof Array||Array.isArray(s)){var h,f=["participants","streaming","transcription"],_=ps(s);try{for(_.s();!(h=_.n()).done;){var k=h.value;if(!f.includes(k))return!1}}catch(y){_.e(y)}finally{_.f()}}else if(typeof s!="boolean")return!1;(s instanceof Array||Array.isArray(s))&&(t.canAdmin=new Set(s));break;default:return!1}}return!0},help:"updatePermissions can take hasPresence, canSend, and canAdmin permissions. hasPresence must be a boolean. canSend can be a boolean or an Array or Set of media types (video, audio, screenVideo, screenAudio, customVideo, customAudio). canAdmin can be a boolean or an Array or Set of admin types (participants, streaming, transcription)."}};Promise.any||(Promise.any=function(){var t=O(function*(e){return new Promise(function(n,r){var i=[];e.forEach(function(s){return Promise.resolve(s).then(function(a){n(a)}).catch(function(a){i.push(a),i.length===e.length&&r(i)})})})});return function(e){return t.apply(this,arguments)}}());var Dl=function(t){ln(re,Ee);var e,n,r,i,s,a,c,l,p,h,f,_,k,y,w,T,M,B,L,ne,Ne,oe,_e,ht,xr,Dr,Lr,Nr,jr,Ir,Br,Fr,Ur,qr,Jr,Vr,$r,Gr,ea=Rl(re);function re(o){var u,d,g,m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(pe(this,re),Ae(Se(d=ea.call(this)),"startListeningForDeviceChanges",function(){Tl(d.handleDeviceChange)}),Ae(Se(d),"stopListeningForDeviceChanges",function(){Cl(d.handleDeviceChange)}),Ae(Se(d),"handleDeviceChange",function(E){E=E.map(function(C){return JSON.parse(JSON.stringify(C))}),d.emitDailyJSEvent({action:"available-devices-updated",availableDevices:E})}),Ae(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 x=C==="active";d.disableReactNativeAutoDeviceManagement("video")||(x?d.camUnmutedBeforeLosingNativeActiveState&&d.setLocalVideo(!0):(d.camUnmutedBeforeLosingNativeActiveState=d.localVideo(),d.camUnmutedBeforeLosingNativeActiveState&&d.setLocalVideo(!1)))});return function(C){return E.apply(this,arguments)}}()),Ae(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)))}),Ae(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=A({},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 pl(d.callClientId):null,d._callState=Ji,d._isPreparingToJoin=!1,d._accessState={access:Cn},d._meetingSessionSummary={},d._finalSummaryOfPrevSession={},d._meetingSessionState=Ln(gs,d._callObjectMode),d._nativeInCallAudioMode=ms,d._participants={},d._isScreenSharing=!1,d._participantCounts=vs,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 ul:new cl,d._iframe&&(d._iframe.requestFullscreen?d._iframe.addEventListener("fullscreenchange",function(){document.fullscreenElement===d._iframe?(d.emitDailyJSEvent({action:qt}),d.sendMessageToCallMachine({action:qt})):(d.emitDailyJSEvent({action:Jt}),d.sendMessageToCallMachine({action:Jt}))}):d._iframe.webkitRequestFullscreen&&d._iframe.addEventListener("webkitfullscreenchange",function(){document.webkitFullscreenElement===d._iframe?(d.emitDailyJSEvent({action:qt}),d.sendMessageToCallMachine({action:qt})):(d.emitDailyJSEvent({action:Jt}),d.sendMessageToCallMachine({action:Jt}))})),N()){var b=d.nativeUtils();b.addAudioFocusChangeListener&&b.removeAudioFocusChangeListener&&b.addAppStateChangeListener&&b.removeAppStateChangeListener&&b.addSystemScreenCaptureStopListener&&b.removeSystemScreenCaptureStopListener||console.warn("expected (add|remove)(AudioFocusChange|AppActiveStateChange|SystemScreenCaptureStop)Listener to be available in React Native"),d._hasNativeAudioFocus=!0,b.addAudioFocusChangeListener(d.handleNativeAudioFocusChange),b.addAppStateChangeListener(d.handleNativeAppStateChange),b.addSystemScreenCaptureStopListener(d.handleNativeSystemScreenCaptureStop)}return d._callObjectMode&&d.startListeningForDeviceChanges(),d._messageChannel.addListenerForMessagesFromCallMachine(d.handleMessageFromCallMachine,d.callClientId,Se(d)),d}return fe(re,[{key:"destroy",value:(Gr=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 Gr.apply(this,arguments)})},{key:"isDestroyed",value:function(){return!!this._destroyed}},{key:"loadCss",value:function(o){var u=o.bodyClass,d=o.cssFile,g=o.cssText;return D(),this.sendMessageToCallMachine({action:"load-css",cssFile:this.absoluteUrl(d),bodyClass:u,cssText:g}),this}},{key:"iframe",value:function(){return D(),this._iframe}},{key:"meetingState",value:function(){return this._callState}},{key:"accessState",value:function(){return 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:($r=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(b){b.error&&m(b.error),b.id||m(new Error("unknown error in updateWaitingParticipant()")),g({id:b.id})})})}),function(){return $r.apply(this,arguments)})},{key:"updateWaitingParticipants",value:(Vr=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 Vr.apply(this,arguments)})},{key:"requestAccess",value:(Jr=O(function*(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},d=u.access,g=d===void 0?{level:rc}:d,m=u.name,b=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:b},function(x){x.error&&C(x.error),x.access||C(new Error("unknown error in requestAccess()")),E({access:x.access,granted:x.granted})})})}),function(){return Jr.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:(qr=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(b){m(b.receiveSettings)})});case"undefined":return this._receiveSettings;default:throw new Error('first argument to getReceiveSettings() must be a participant id (or "base"), or there should be no arguments')}}),function(o){return qr.apply(this,arguments)})},{key:"updateReceiveSettings",value:(Ur=O(function*(o){var u=this;if(ce(this._callObjectMode,"updateReceiveSettings()"),!bo(o,{allowAllParticipantsKey:!0}))throw new Error(ko({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 Ur.apply(this,arguments)})},{key:"_prepInputSettingsToPresentToUser",value:function(o){var u,d,g,m,b,E,C,x;if(o){var W={},H=((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&&!H){var be=A({},o.audio.processor);delete be._isDefaultWhenNone,W.audio=A(A({},o.audio),{},{processor:be})}var Te=((b=o.video)===null||b===void 0||(E=b.processor)===null||E===void 0?void 0:E.type)==="none"&&((C=o.video)===null||C===void 0||(x=C.processor)===null||x===void 0?void 0:x._isDefaultWhenNone);if(o.video&&!Te){var we=A({},o.video.processor);delete we._isDefaultWhenNone,W.video=A(A({},o.video),{},{processor:we})}return W}}},{key:"getInputSettings",value:function(){var o=this;return D(),new Promise(function(u){u(o._getInputSettings())})}},{key:"_getInputSettings",value:function(){var o,u,d,g,m,b,E,C,x={processor:{type:"none",_isDefaultWhenNone:!0}};this._inputSettings?(o=((d=this._inputSettings)===null||d===void 0?void 0:d.video)||x,u=((g=this._inputSettings)===null||g===void 0?void 0:g.audio)||x):(o=((m=this._preloadCache)===null||m===void 0||(b=m.inputSettings)===null||b===void 0?void 0:b.video)||x,u=((E=this._preloadCache)===null||E===void 0||(C=E.inputSettings)===null||C===void 0?void 0:C.audio)||x);var W={audio:u,video:o};return this._prepInputSettingsToPresentToUser(W)}},{key:"updateInputSettings",value:(Fr=O(function*(o){var u=this;return D(),wo(o)?(o&&(this._preloadCache.inputSettings||(this._preloadCache.inputSettings={}),So(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 Fr.apply(this,arguments)})},{key:"setBandwidth",value:function(o){var u=o.kbs,d=o.trackConstraints;if(D(),this._callMachineInitialized)return this.sendMessageToCallMachine({action:"set-bandwidth",kbs:u,trackConstraints:d}),this}},{key:"getDailyLang",value:function(){var o=this;if(D(),this._callMachineInitialized)return new Promise(function(u){o.sendMessageToCallMachine({action:"get-daily-lang"},function(d){delete d.action,delete d.callbackStamp,u(d)})})}},{key:"setDailyLang",value:function(o){return D(),this.sendMessageToCallMachine({action:"set-daily-lang",lang:o}),this}},{key:"setProxyUrl",value:function(o){return this.sendMessageToCallMachine({action:"set-proxy-url",proxyUrl:o}),this}},{key:"setIceConfig",value:function(o){return this.sendMessageToCallMachine({action:"set-ice-config",iceConfig:o}),this}},{key:"meetingSessionSummary",value:function(){return[Ie,Ce].includes(this._callState)?this._finalSummaryOfPrevSession:this._meetingSessionSummary}},{key:"getMeetingSession",value:(Br=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 Br.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 dl({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:(Ir=O(function*(o){var u=this;try{_o(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 Ir.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:(jr=O(function*(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ce(this._callObjectMode,"startCamera()"),xn(this._callState,this._isPreparingToJoin,"startCamera()","Did you mean to use setLocalAudio() and/or setLocalVideo() instead?"),this.needsLoad())try{yield this.load(u)}catch(d){return Promise.reject(d)}else{if(this._didPreAuth){if(u.url&&u.url!==this.properties.url)return console.error("url in startCamera() is different than the one used in preAuth()"),Promise.reject();if(u.token&&u.token!==this.properties.token)return console.error("token in startCamera() is different than the one used in preAuth()"),Promise.reject()}this.validateProperties(u),this.properties=A(A({},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 jr.apply(this,arguments)})},{key:"validateCustomTrack",value:function(o,u,d){if(d&&d.length>50)throw new Error("Custom track `trackName` must not be more than 50 characters");if(u&&u!=="music"&&u!=="speech"&&!(u instanceof Object))throw new Error("Custom track `mode` must be either `music` | `speech` | `DailyMicAudioModeSettings` or `undefined`");if(d&&["cam-audio","cam-video","screen-video","screen-audio","rmpAudio","rmpVideo","customVideoDefaults"].includes(d))throw new Error("Custom track `trackName` must not match a track name already used by daily: cam-audio, cam-video, customVideoDefaults, screen-video, screen-audio, rmpAudio, rmpVideo");if(!(o instanceof MediaStreamTrack))throw new Error("Custom tracks provided must be instances of MediaStreamTrack")}},{key:"startCustomTrack",value:function(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{track,mode,trackName};return D(),q(this._callState,"startCustomTrack()"),this.validateCustomTrack(u.track,u.mode,u.trackName),new Promise(function(d,g){o._sharedTracks.customTrack=u.track,u.track=yt,o.sendMessageToCallMachine({action:"start-custom-track",properties:u},function(m){m.error?g({error:m.error}):d(m.mediaTag)})})}},{key:"stopCustomTrack",value:function(o){var u=this;return D(),q(this._callState,"stopCustomTrack()"),new Promise(function(d){u.sendMessageToCallMachine({action:"stop-custom-track",mediaTag:o},function(g){d(g.mediaTag)})})}},{key:"setCamera",value:function(o){var u=this;return mt(),Ht(this._callMachineInitialized,"setCamera()"),new Promise(function(d){u.sendMessageToCallMachine({action:"set-camera",cameraDeviceId:o},function(g){d({device:g.device})})})}},{key:"setAudioDevice",value:(Nr=O(function*(o){return mt(),this.nativeUtils().setAudioDevice(o),{deviceId:yield this.nativeUtils().getAudioDevice()}}),function(o){return Nr.apply(this,arguments)})},{key:"cycleCamera",value:function(){var o=this,u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new Promise(function(d){o.sendMessageToCallMachine({action:"cycle-camera",properties:u},function(g){d({device:g.device})})})}},{key:"cycleMic",value:function(){var o=this;return D(),new Promise(function(u){o.sendMessageToCallMachine({action:"cycle-mic"},function(d){u({device:d.device})})})}},{key:"getCameraFacingMode",value:function(){var o=this;return mt(),new Promise(function(u){o.sendMessageToCallMachine({action:"get-camera-facing-mode"},function(d){u(d.facingMode)})})}},{key:"setInputDevicesAsync",value:(Lr=O(function*(o){var u=this,d=o.audioDeviceId,g=o.videoDeviceId,m=o.audioSource,b=o.videoSource;return D(),m!==void 0&&(d=m),b!==void 0&&(g=b),d&&(this._preloadCache.audioDeviceId=d,this._sharedTracks.audioDeviceId=d),g&&(this._preloadCache.videoDeviceId=g,this._sharedTracks.videoDeviceId=g),this._callObjectMode&&this.needsLoad()?{camera:{deviceId:this._preloadCache.videoDeviceId},mic:{deviceId:this._preloadCache.audioDeviceId},speaker:{deviceId:this._preloadCache.outputDeviceId}}:(d instanceof MediaStreamTrack&&(d=yt),g instanceof MediaStreamTrack&&(g=yt),new Promise(function(E){u.sendMessageToCallMachine({action:"set-input-devices",audioDeviceId:d,videoDeviceId:g},function(C){delete C.action,delete C.callbackStamp,C.returnPreloadCache?E({camera:{deviceId:u._preloadCache.videoDeviceId},mic:{deviceId:u._preloadCache.audioDeviceId},speaker:{deviceId:u._preloadCache.outputDeviceId}}):E(C)})}))}),function(o){return Lr.apply(this,arguments)})},{key:"setOutputDeviceAsync",value:(Dr=O(function*(o){var u=this,d=o.outputDeviceId;return D(),d&&(this._preloadCache.outputDeviceId=d),this._callObjectMode&&this.needsLoad()?{camera:{deviceId:this._preloadCache.videoDeviceId},mic:{deviceId:this._preloadCache.audioDeviceId},speaker:{deviceId:this._preloadCache.outputDeviceId}}:new Promise(function(g){u.sendMessageToCallMachine({action:"set-output-device",outputDeviceId:d},function(m){delete m.action,delete m.callbackStamp,m.returnPreloadCache?g({camera:{deviceId:u._preloadCache.videoDeviceId},mic:{deviceId:u._preloadCache.audioDeviceId},speaker:{deviceId:u._preloadCache.outputDeviceId}}):g(m)})})}),function(o){return Dr.apply(this,arguments)})},{key:"getInputDevices",value:(xr=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 xr.apply(this,arguments)})},{key:"nativeInCallAudioMode",value:function(){return mt(),this._nativeInCallAudioMode}},{key:"setNativeInCallAudioMode",value:function(o){if(mt(),[ms,xl].includes(o)){if(o!==this._nativeInCallAudioMode)return this._nativeInCallAudioMode=o,!this.disableReactNativeAutoDeviceManagement("audio")&&Yt(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()"),xn(this._callState,this._isPreparingToJoin,"preAuth()"),this.needsLoad()&&(yield this.load(u)),!u.url)throw new Error("preAuth() requires at least a url to be provided");return this.validateProperties(u),this.properties=A(A({},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=A(A({},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(Vi),this.emitDailyJSEvent({action:lc}),this._callObjectMode?new Promise(function(d,g){u._callObjectLoader.cancel();var m=Date.now();u._callObjectLoader.load(u.properties.dailyConfig,function(b){u._bundleLoadTime=b?"no-op":Date.now()-m,u._updateCallState($i),b&&u.emitDailyJSEvent({action:Gi}),d()},function(b,E){if(u.emitDailyJSEvent({action:uc}),!E){u._updateCallState(Ce),u.resetMeetingDependentVars();var C={action:Yi,errorMsg:b.msg,error:{type:"connection-error",msg:"Failed to load call object bundle.",details:{on:"load",sourceError:b,bundleUrl:Xt(u.properties.dailyConfig)}}};u._maybeSendToSentry(C),u.emitDailyJSEvent(C),g(b.msg)}})}):(this._iframe.src=Js(this.assembleMeetingUrl(),this.properties.dailyConfig),new Promise(function(d,g){u._loadedCallback=function(m){u._callState!==Ce?(u._updateCallState($i),(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=A(A({},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:pc}),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(b,E){if(o._callState!==Ce){if(o._updateCallState(Qe),b)for(var C in b){if(o._callObjectMode){var x=o._callMachine().store;as(b[C],x),cs(b[C],x),ls(b[C],o._participants[C],x)}o._participants[C]=A({},b[C]),o.toggleParticipantAudioBasedOnNativeAudioFocus()}d&&o.loadCss(o.properties),g(b)}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(Ht(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:Wi,type:"screen-share-error",errorMsg:"Could not start the screen sharing. The screen is already been captured!"});d.setSystemScreenCaptureStartCallback(function(){d.setSystemScreenCaptureStartCallback(null),o.sendMessageToCallMachine({action:Qi,captureOptions:u})}),d.presentSystemScreenCapturePrompt()}else this.sendMessageToCallMachine({action:Qi,captureOptions:u})}),function(){return ne.apply(this,arguments)})},{key:"stopScreenShare",value:function(){Ht(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(A({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(A({action:"local-recording-stop"},o))}},{key:"startLiveStreaming",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(A({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:Xi,endpointsOp:nl,endpoints:u,instanceId:d})}},{key:"removeLiveStreamingEndpoints",value:function(o){var u=o.endpoints,d=o.instanceId;this.sendMessageToCallMachine({action:Xi,endpointsOp:rl,endpoints:u,instanceId:d})}},{key:"stopLiveStreaming",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(A({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(!Ss(o.length,1,3))throw new Error("encodings must be an Array with between 1 to ".concat(3," layers"));for(var g=0;g<o.length;g++){var m=o[g];for(var b in this._validateEncodingLayerHasValidProperties(m),m)if(Rn.includes(b)){if(typeof m[b]!="number")throw new Error("".concat(b," must be a number"));if(u){var E=u[b],C=E.min,x=E.max;if(!Ss(m[b],C,x))throw new Error("".concat(b," value not in range. valid range: ").concat(C," to ").concat(x))}}else if(!["active","scalabilityMode"].includes(b))throw new Error("Invalid key ".concat(b,", valid keys are:")+Object.values(Rn));if(d&&!m.hasOwnProperty("maxBitrate"))throw new Error("maxBitrate is not specified")}}}},{key:"startRemoteMediaPlayer",value:(L=O(function*(o){var u=this,d=o.url,g=o.settings,m=g===void 0?{state:Xn.PLAY}:g;try{(function(b){if(typeof b!="string")throw new Error('url parameter must be "string" type')})(d),ws(m),function(b){for(var E in b)if(!ys.includes(E))throw new Error("Invalid key ".concat(E,", valid keys are: ").concat(ys));b.simulcastEncodings&&this.validateSimulcastEncodings(b.simulcastEncodings,yo,!0)}(m)}catch(b){throw console.error("invalid argument Error: ".concat(b)),console.error(`startRemoteMediaPlayer arguments must be of the form:
|
|
9
|
+
Name: ${Fe(r)}
|
|
10
|
+
Error:`,i)}}let Dn=null;function Wa(){Dn=$.onerror,$.onerror=function(t,e,n,r,i){return _e("error",{column:r,error:i,line:n,msg:t,url:e}),!!Dn&&Dn.apply(this,arguments)},$.onerror.__SENTRY_INSTRUMENTED__=!0}let Nn=null;function Ga(){Nn=$.onunhandledrejection,$.onunhandledrejection=function(t){return _e("unhandledrejection",t),!Nn||Nn.apply(this,arguments)},$.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}function Tn(){return Rr($),$}function Rr(t){const e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||Ke,e[Ke]=e[Ke]||{}}const So=Object.prototype.toString;function Dr(t){switch(So.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Ze(t,Error)}}function vt(t,e){return So.call(t)===`[object ${e}]`}function ko(t){return vt(t,"ErrorEvent")}function ki(t){return vt(t,"DOMError")}function je(t){return vt(t,"String")}function Nr(t){return typeof t=="object"&&t!==null&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function or(t){return t===null||Nr(t)||typeof t!="object"&&typeof t!="function"}function ft(t){return vt(t,"Object")}function Cn(t){return typeof Event<"u"&&Ze(t,Event)}function Mn(t){return!!(t&&t.then&&typeof t.then=="function")}function Ze(t,e){try{return t instanceof e}catch{return!1}}function Eo(t){return!(typeof t!="object"||t===null||!t.__isVue&&!t._isVue)}const Fr=$;function To(t,e={}){if(!t)return"<unknown>";try{let n=t;const r=5,i=[];let s=0,a=0;const c=" > ",l=c.length;let f;const h=Array.isArray(e)?e:e.keyAttrs,v=!Array.isArray(e)&&e.maxStringLength||80;for(;n&&s++<r&&(f=Ka(n,h),!(f==="html"||s>1&&a+i.length*l+f.length>=v));)i.push(f),a+=f.length,n=n.parentNode;return i.reverse().join(c)}catch{return"<unknown>"}}function Ka(t,e){const n=t,r=[];if(!n||!n.tagName)return"";if(Fr.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const i=e&&e.length?e.filter(a=>n.getAttribute(a)).map(a=>[a,n.getAttribute(a)]):null;if(i&&i.length)i.forEach(a=>{r.push(`[${a[0]}="${a[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const a=n.className;if(a&&je(a)){const c=a.split(/\s+/);for(const l of c)r.push(`.${l}`)}}const s=["aria-label","type","name","title","alt"];for(const a of s){const c=n.getAttribute(a);c&&r.push(`[${a}="${c}"]`)}return r.join("")}function ut(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function Ei(t,e){if(!Array.isArray(t))return"";const n=[];for(let r=0;r<t.length;r++){const i=t[r];try{Eo(i)?n.push("[VueViewModel]"):n.push(String(i))}catch{n.push("[value cannot be serialized]")}}return n.join(e)}function Qa(t,e,n=!1){return!!je(t)&&(vt(e,"RegExp")?e.test(t):!!je(e)&&(n?t===e:t.includes(e)))}function zt(t,e=[],n=!1){return e.some(r=>Qa(t,r,n))}function ue(t,e,n){if(!(e in t))return;const r=t[e],i=n(r);typeof i=="function"&&Co(i,r);try{t[e]=i}catch{it&&D.log(`Failed to replace method "${e}" in object`,t)}}function et(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{it&&D.log(`Failed to add non-enumerable property "${e}" to object`,t)}}function Co(t,e){try{const n=e.prototype||{};t.prototype=e.prototype=n,et(t,"__sentry_original__",e)}catch{}}function Ur(t){return t.__sentry_original__}function Mo(t){if(Dr(t))return{message:t.message,name:t.name,stack:t.stack,...Ci(t)};if(Cn(t)){const e={type:t.type,target:Ti(t.target),currentTarget:Ti(t.currentTarget),...Ci(t)};return typeof CustomEvent<"u"&&Ze(t,CustomEvent)&&(e.detail=t.detail),e}return t}function Ti(t){try{return e=t,typeof Element<"u"&&Ze(e,Element)?To(t):Object.prototype.toString.call(t)}catch{return"<unknown>"}var e}function Ci(t){if(typeof t=="object"&&t!==null){const e={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}return{}}function me(t){return ar(t,new Map)}function ar(t,e){if(function(n){if(!ft(n))return!1;try{const r=Object.getPrototypeOf(n).constructor.name;return!r||r==="Object"}catch{return!0}}(t)){const n=e.get(t);if(n!==void 0)return n;const r={};e.set(t,r);for(const i of Object.getOwnPropertyNames(t))t[i]!==void 0&&(r[i]=ar(t[i],e));return r}if(Array.isArray(t)){const n=e.get(t);if(n!==void 0)return n;const r=[];return e.set(t,r),t.forEach(i=>{r.push(ar(i,e))}),r}return t}function Rt(){return Date.now()/1e3}const Ie=function(){const{performance:t}=$;if(!t||!t.now)return Rt;const e=Date.now()-t.now(),n=t.timeOrigin==null?e:t.timeOrigin;return()=>(n+t.now())/1e3}();function ge(){const t=$,e=t.crypto||t.msCrypto;let n=()=>16*Math.random();try{if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");e&&e.getRandomValues&&(n=()=>{const r=new Uint8Array(1);return e.getRandomValues(r),r[0]})}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,r=>(r^(15&n())>>r/4).toString(16))}function Oo(t){return t.exception&&t.exception.values?t.exception.values[0]:void 0}function Ne(t){const{message:e,event_id:n}=t;if(e)return e;const r=Oo(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function cr(t,e,n){const r=t.exception=t.exception||{},i=r.values=r.values||[],s=i[0]=i[0]||{};s.value||(s.value=e||""),s.type||(s.type="Error")}function ht(t,e){const n=Oo(t);if(!n)return;const r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...e},e&&"data"in e){const i={...r&&r.data,...e.data};n.mechanism.data=i}}function Mi(t){if(function(e){try{return e.__sentry_captured__}catch{}}(t))return!0;try{et(t,"__sentry_captured__",!0)}catch{}return!1}var Ae;function tt(t){return new pe(e=>{e(t)})}function mn(t){return new pe((e,n)=>{n(t)})}(()=>{const{performance:t}=$;!t||!t.now||(t.now(),t.timing&&t.timing.navigationStart)})(),function(t){t[t.PENDING=0]="PENDING",t[t.RESOLVED=1]="RESOLVED",t[t.REJECTED=2]="REJECTED"}(Ae||(Ae={}));class pe{constructor(e){pe.prototype.__init.call(this),pe.prototype.__init2.call(this),pe.prototype.__init3.call(this),pe.prototype.__init4.call(this),this._state=Ae.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(n){this._reject(n)}}then(e,n){return new pe((r,i)=>{this._handlers.push([!1,s=>{if(e)try{r(e(s))}catch(a){i(a)}else r(s)},s=>{if(n)try{r(n(s))}catch(a){i(a)}else i(s)}]),this._executeHandlers()})}catch(e){return this.then(n=>n,e)}finally(e){return new pe((n,r)=>{let i,s;return this.then(a=>{s=!1,i=a,e&&e()},a=>{s=!0,i=a,e&&e()}).then(()=>{s?r(i):n(i)})})}__init(){this._resolve=e=>{this._setResult(Ae.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(Ae.REJECTED,e)}}__init3(){this._setResult=(e,n)=>{this._state===Ae.PENDING&&(Mn(n)?n.then(this._resolve,this._reject):(this._state=e,this._value=n,this._executeHandlers()))}}__init4(){this._executeHandlers=()=>{if(this._state===Ae.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach(n=>{n[0]||(this._state===Ae.RESOLVED&&n[1](this._value),this._state===Ae.REJECTED&&n[2](this._value),n[0]=!0)})}}}function Xa(t){const e=Ie(),n={sid:ge(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(r){return me({sid:`${r.sid}`,init:r.init,started:new Date(1e3*r.started).toISOString(),timestamp:new Date(1e3*r.timestamp).toISOString(),status:r.status,errors:r.errors,did:typeof r.did=="number"||typeof r.did=="string"?`${r.did}`:void 0,duration:r.duration,abnormal_mechanism:r.abnormal_mechanism,attrs:{release:r.release,environment:r.environment,ip_address:r.ipAddress,user_agent:r.userAgent}})}(n)};return t&&pt(n,t),n}function pt(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),t.did||e.did||(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||Ie(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:ge()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{const n=t.timestamp-t.started;t.duration=n>=0?n:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}function Oi(){return ge()}function lr(){return ge().substring(16)}function On(t,e,n=2){if(!e||typeof e!="object"||n<=0)return e;if(t&&e&&Object.keys(e).length===0)return t;const r={...t};for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=On(r[i],e[i],n-1));return r}const ur="_sentrySpan";function Ai(t,e){e?et(t,ur,e):delete t[ur]}function Pi(t){return t[ur]}class Br{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Oi(),spanId:lr()}}clone(){const e=new Br;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._requestSession=this._requestSession,e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,Ai(e,Pi(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&pt(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,n){return this._tags={...this._tags,[e]:n},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,n){return this._extra={...this._extra,[e]:n},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,n){return n===null?delete this._contexts[e]:this._contexts[e]=n,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const n=typeof e=="function"?e(this):e,[r,i]=n instanceof Ue?[n.getScopeData(),n.getRequestSession()]:ft(n)?[e,e.requestSession]:[],{tags:s,extra:a,user:c,contexts:l,level:f,fingerprint:h=[],propagationContext:v}=r||{};return this._tags={...this._tags,...s},this._extra={...this._extra,...a},this._contexts={...this._contexts,...l},c&&Object.keys(c).length&&(this._user=c),f&&(this._level=f),h.length&&(this._fingerprint=h),v&&(this._propagationContext=v),i&&(this._requestSession=i),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._session=void 0,Ai(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Oi()}),this._notifyScopeListeners(),this}addBreadcrumb(e,n){const r=typeof n=="number"?n:100;if(r<=0)return this;const i={timestamp:Rt(),...e};return this._breadcrumbs.push(i),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),this._client&&this._client.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:Pi(this)}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=On(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext={spanId:lr(),...e},this}getPropagationContext(){return this._propagationContext}captureException(e,n){const r=n&&n.event_id?n.event_id:ge();if(!this._client)return D.warn("No client configured on scope - will not capture exception!"),r;const i=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:i,...n,event_id:r},this),r}captureMessage(e,n,r){const i=r&&r.event_id?r.event_id:ge();if(!this._client)return D.warn("No client configured on scope - will not capture message!"),i;const s=new Error(e);return this._client.captureMessage(e,n,{originalException:e,syntheticException:s,...r,event_id:i},this),i}captureEvent(e,n){const r=n&&n.event_id?n.event_id:ge();return this._client?(this._client.captureEvent(e,{...n,event_id:r},this),r):(D.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}const Ue=Br;class Ya{constructor(e,n){let r,i;r=e||new Ue,i=n||new Ue,this._stack=[{scope:r}],this._isolationScope=i}withScope(e){const n=this._pushScope();let r;try{r=e(n)}catch(i){throw this._popScope(),i}return Mn(r)?r.then(i=>(this._popScope(),i),i=>{throw this._popScope(),i}):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return!(this._stack.length<=1)&&!!this._stack.pop()}}function mt(){const t=Rr(Tn());return t.stack=t.stack||new Ya(hn("defaultCurrentScope",()=>new Ue),hn("defaultIsolationScope",()=>new Ue))}function Za(t){return mt().withScope(t)}function ec(t,e){const n=mt();return n.withScope(()=>(n.getStackTop().scope=t,e(t)))}function ji(t){return mt().withScope(()=>t(mt().getIsolationScope()))}function Vr(t){const e=Rr(t);return e.acs?e.acs:{withIsolationScope:ji,withScope:Za,withSetScope:ec,withSetIsolationScope:(n,r)=>ji(r),getCurrentScope:()=>mt().getScope(),getIsolationScope:()=>mt().getIsolationScope()}}function st(){return Vr(Tn()).getCurrentScope()}function Dt(){return Vr(Tn()).getIsolationScope()}function te(){return st().getClient()}function tc(t){const e=t.getPropagationContext(),{traceId:n,spanId:r,parentSpanId:i}=e;return me({trace_id:n,span_id:r,parent_span_id:i})}function nc(t){const e=t._sentryMetrics;if(!e)return;const n={};for(const[,[r,i]]of e)(n[r]||(n[r]=[])).push(me(i));return n}const rc=/^sentry-/;function ic(t){const e=function(r){if(!(!r||!je(r)&&!Array.isArray(r)))return Array.isArray(r)?r.reduce((i,s)=>{const a=xi(s);return Object.entries(a).forEach(([c,l])=>{i[c]=l}),i},{}):xi(r)}(t);if(!e)return;const n=Object.entries(e).reduce((r,[i,s])=>(i.match(rc)&&(r[i.slice(7)]=s),r),{});return Object.keys(n).length>0?n:void 0}function xi(t){return t.split(",").map(e=>e.split("=").map(n=>decodeURIComponent(n.trim()))).reduce((e,[n,r])=>(n&&r&&(e[n]=r),e),{})}let Ii=!1;function sc(t){const{spanId:e,traceId:n,isRemote:r}=t.spanContext();return me({parent_span_id:r?e:Jr(t).parent_span_id,span_id:r?lr():e,trace_id:n})}function Li(t){return typeof t=="number"?Ri(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?Ri(t.getTime()):Ie()}function Ri(t){return t>9999999999?t/1e3:t}function Jr(t){if(function(e){return typeof e.getSpanJSON=="function"}(t))return t.getSpanJSON();try{const{spanId:e,traceId:n}=t.spanContext();if(function(r){const i=r;return!!(i.attributes&&i.startTime&&i.name&&i.endTime&&i.status)}(t)){const{attributes:r,startTime:i,name:s,endTime:a,parentSpanId:c,status:l}=t;return me({span_id:e,trace_id:n,data:r,description:s,parent_span_id:c,start_timestamp:Li(i),timestamp:Li(a)||void 0,status:oc(l),op:r["sentry.op"],origin:r["sentry.origin"],_metrics_summary:nc(t)})}return{span_id:e,trace_id:n}}catch{return{}}}function oc(t){if(t&&t.code!==0)return t.code===1?"ok":t.message||"unknown_error"}function Ao(t){return t._sentryRootSpan||t}function ac(){Ii||(Lt(()=>{console.warn("[Sentry] Deprecation warning: Returning null from `beforeSendSpan` will be disallowed from SDK version 9.0.0 onwards. The callback will only support mutating spans. To drop certain spans, configure the respective integrations directly.")}),Ii=!0)}const qr="production";function Po(t,e){const n=e.getOptions(),{publicKey:r}=e.getDsn()||{},i=me({environment:n.environment||qr,release:n.release,public_key:r,trace_id:t});return e.emit("createDsc",i),i}function cc(t){const e=te();if(!e)return{};const n=Ao(t),r=n._frozenDsc;if(r)return r;const i=n.spanContext().traceState,s=i&&i.get("sentry.dsc"),a=s&&ic(s);if(a)return a;const c=Po(t.spanContext().traceId,e),l=Jr(n),f=l.data||{},h=f["sentry.sample_rate"];h!=null&&(c.sample_rate=`${h}`);const v=f["sentry.source"],k=l.description;return v!=="url"&&k&&(c.transaction=k),function(E){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const y=te(),m=y&&y.getOptions();return!!m&&(m.enableTracing||"tracesSampleRate"in m||"tracesSampler"in m)}()&&(c.sampled=String(function(E){const{traceFlags:y}=E.spanContext();return y===1}(n))),e.emit("createDsc",c,n),c}const lc=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function gn(t,e=!1){const{host:n,path:r,pass:i,port:s,projectId:a,protocol:c,publicKey:l}=t;return`${c}://${l}${e&&i?`:${i}`:""}@${n}${s?`:${s}`:""}/${r&&`${r}/`}${a}`}function Di(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function uc(t){const e=typeof t=="string"?function(n){const r=lc.exec(n);if(!r)return void Lt(()=>{console.error(`Invalid Sentry Dsn: ${n}`)});const[i,s,a="",c="",l="",f=""]=r.slice(1);let h="",v=f;const k=v.split("/");if(k.length>1&&(h=k.slice(0,-1).join("/"),v=k.pop()),v){const E=v.match(/^\d+/);E&&(v=E[0])}return Di({host:c,pass:a,path:h,projectId:v,port:l,protocol:i,publicKey:s})}(t):Di(t);if(e&&function(n){if(!it)return!0;const{port:r,projectId:i,protocol:s}=n;return!(["protocol","publicKey","host","projectId"].find(a=>!n[a]&&(D.error(`Invalid Sentry Dsn: ${a} missing`),!0))||(i.match(/^\d+$/)?function(a){return a==="http"||a==="https"}(s)?r&&isNaN(parseInt(r,10))&&(D.error(`Invalid Sentry Dsn: Invalid port ${r}`),1):(D.error(`Invalid Sentry Dsn: Invalid protocol ${s}`),1):(D.error(`Invalid Sentry Dsn: Invalid projectId ${i}`),1)))}(e))return e}function Pe(t,e=100,n=1/0){try{return dr("",t,e,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function jo(t,e=3,n=102400){const r=Pe(t,e);return i=r,function(s){return~-encodeURI(s).split(/%..|./).length}(JSON.stringify(i))>n?jo(t,e-1,n):r;var i}function dr(t,e,n=1/0,r=1/0,i=function(){const s=typeof WeakSet=="function",a=s?new WeakSet:[];return[function(c){if(s)return!!a.has(c)||(a.add(c),!1);for(let l=0;l<a.length;l++)if(a[l]===c)return!0;return a.push(c),!1},function(c){if(s)a.delete(c);else for(let l=0;l<a.length;l++)if(a[l]===c){a.splice(l,1);break}}]}()){const[s,a]=i;if(e==null||["boolean","string"].includes(typeof e)||typeof e=="number"&&Number.isFinite(e))return e;const c=function(E,y){try{if(E==="domain"&&y&&typeof y=="object"&&y._events)return"[Domain]";if(E==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&y===global)return"[Global]";if(typeof window<"u"&&y===window)return"[Window]";if(typeof document<"u"&&y===document)return"[Document]";if(Eo(y))return"[VueViewModel]";if(ft(m=y)&&"nativeEvent"in m&&"preventDefault"in m&&"stopPropagation"in m)return"[SyntheticEvent]";if(typeof y=="number"&&!Number.isFinite(y))return`[${y}]`;if(typeof y=="function")return`[Function: ${Fe(y)}]`;if(typeof y=="symbol")return`[${String(y)}]`;if(typeof y=="bigint")return`[BigInt: ${String(y)}]`;const b=function(w){const C=Object.getPrototypeOf(w);return C?C.constructor.name:"null prototype"}(y);return/^HTML(\w*)Element$/.test(b)?`[HTMLElement: ${b}]`:`[object ${b}]`}catch(b){return`**non-serializable** (${b})`}var m}(t,e);if(!c.startsWith("[object "))return c;if(e.__sentry_skip_normalization__)return e;const l=typeof e.__sentry_override_normalization_depth__=="number"?e.__sentry_override_normalization_depth__:n;if(l===0)return c.replace("object ","");if(s(e))return"[Circular ~]";const f=e;if(f&&typeof f.toJSON=="function")try{return dr("",f.toJSON(),l-1,r,i)}catch{}const h=Array.isArray(e)?[]:{};let v=0;const k=Mo(e);for(const E in k){if(!Object.prototype.hasOwnProperty.call(k,E))continue;if(v>=r){h[E]="[MaxProperties ~]";break}const y=k[E];h[E]=dr(E,y,l-1,r,i),v++}return a(e),h}function xt(t,e=[]){return[t,e]}function dc(t,e){const[n,r]=t;return[n,[...r,e]]}function Ni(t,e){const n=t[1];for(const r of n)if(e(r,r[0].type))return!0;return!1}function fr(t){return $.__SENTRY__&&$.__SENTRY__.encodePolyfill?$.__SENTRY__.encodePolyfill(t):new TextEncoder().encode(t)}function fc(t){const[e,n]=t;let r=JSON.stringify(e);function i(s){typeof r=="string"?r=typeof s=="string"?r+s:[fr(r),s]:r.push(typeof s=="string"?fr(s):s)}for(const s of n){const[a,c]=s;if(i(`
|
|
11
|
+
${JSON.stringify(a)}
|
|
12
|
+
`),typeof c=="string"||c instanceof Uint8Array)i(c);else{let l;try{l=JSON.stringify(c)}catch{l=JSON.stringify(Pe(c))}i(l)}}return typeof r=="string"?r:function(s){const a=s.reduce((f,h)=>f+h.length,0),c=new Uint8Array(a);let l=0;for(const f of s)c.set(f,l),l+=f.length;return c}(r)}function hc(t){const e=typeof t.data=="string"?fr(t.data):t.data;return[me({type:"attachment",length:e.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType}),e]}const pc={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",statsd:"metric_bucket",raw_security:"security"};function Fi(t){return pc[t]}function xo(t){if(!t||!t.sdk)return;const{name:e,version:n}=t.sdk;return{name:e,version:n}}function mc(t,e,n,r){const i=xo(n),s=t.type&&t.type!=="replay_event"?t.type:"event";(function(c,l){l&&(c.sdk=c.sdk||{},c.sdk.name=c.sdk.name||l.name,c.sdk.version=c.sdk.version||l.version,c.sdk.integrations=[...c.sdk.integrations||[],...l.integrations||[]],c.sdk.packages=[...c.sdk.packages||[],...l.packages||[]])})(t,n&&n.sdk);const a=function(c,l,f,h){const v=c.sdkProcessingMetadata&&c.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:c.event_id,sent_at:new Date().toISOString(),...l&&{sdk:l},...!!f&&h&&{dsn:gn(h)},...v&&{trace:me({...v})}}}(t,i,r,e);return delete t.sdkProcessingMetadata,xt(a,[[{type:s},t]])}function hr(t,e,n,r=0){return new pe((i,s)=>{const a=t[r];if(e===null||typeof a!="function")i(e);else{const c=a({...e},n);W&&a.id&&c===null&&D.log(`Event processor "${a.id}" dropped event`),Mn(c)?c.then(l=>hr(t,l,n,r+1).then(i)).then(null,s):hr(t,c,n,r+1).then(i).then(null,s)}})}let Ht,Ui,Fn;function gc(t,e){const{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:s}=e;(function(a,c){const{extra:l,tags:f,user:h,contexts:v,level:k,transactionName:E}=c,y=me(l);y&&Object.keys(y).length&&(a.extra={...y,...a.extra});const m=me(f);m&&Object.keys(m).length&&(a.tags={...m,...a.tags});const b=me(h);b&&Object.keys(b).length&&(a.user={...b,...a.user});const w=me(v);w&&Object.keys(w).length&&(a.contexts={...w,...a.contexts}),k&&(a.level=k),E&&a.type!=="transaction"&&(a.transaction=E)})(t,e),r&&function(a,c){a.contexts={trace:sc(c),...a.contexts},a.sdkProcessingMetadata={dynamicSamplingContext:cc(c),...a.sdkProcessingMetadata};const l=Ao(c),f=Jr(l).description;f&&!a.transaction&&a.type==="transaction"&&(a.transaction=f)}(t,r),function(a,c){a.fingerprint=a.fingerprint?Array.isArray(a.fingerprint)?a.fingerprint:[a.fingerprint]:[],c&&(a.fingerprint=a.fingerprint.concat(c)),a.fingerprint&&!a.fingerprint.length&&delete a.fingerprint}(t,n),function(a,c){const l=[...a.breadcrumbs||[],...c];a.breadcrumbs=l.length?l:void 0}(t,i),function(a,c){a.sdkProcessingMetadata={...a.sdkProcessingMetadata,...c}}(t,s)}function Bi(t,e){const{extra:n,tags:r,user:i,contexts:s,level:a,sdkProcessingMetadata:c,breadcrumbs:l,fingerprint:f,eventProcessors:h,attachments:v,propagationContext:k,transactionName:E,span:y}=e;Wt(t,"extra",n),Wt(t,"tags",r),Wt(t,"user",i),Wt(t,"contexts",s),t.sdkProcessingMetadata=On(t.sdkProcessingMetadata,c,2),a&&(t.level=a),E&&(t.transactionName=E),y&&(t.span=y),l.length&&(t.breadcrumbs=[...t.breadcrumbs,...l]),f.length&&(t.fingerprint=[...t.fingerprint,...f]),h.length&&(t.eventProcessors=[...t.eventProcessors,...h]),v.length&&(t.attachments=[...t.attachments,...v]),t.propagationContext={...t.propagationContext,...k}}function Wt(t,e,n){t[e]=On(t[e],n,1)}function vc(t,e,n,r,i,s){const{normalizeDepth:a=3,normalizeMaxBreadth:c=1e3}=t,l={...e,event_id:e.event_id||n.event_id||ge(),timestamp:e.timestamp||Rt()},f=n.integrations||t.integrations.map(y=>y.name);(function(y,m){const{environment:b,release:w,dist:C,maxValueLength:A=250}=m;y.environment=y.environment||b||qr,!y.release&&w&&(y.release=w),!y.dist&&C&&(y.dist=C),y.message&&(y.message=ut(y.message,A));const x=y.exception&&y.exception.values&&y.exception.values[0];x&&x.value&&(x.value=ut(x.value,A));const j=y.request;j&&j.url&&(j.url=ut(j.url,A))})(l,t),function(y,m){m.length>0&&(y.sdk=y.sdk||{},y.sdk.integrations=[...y.sdk.integrations||[],...m])}(l,f),i&&i.emit("applyFrameMetadata",e),e.type===void 0&&function(y,m){const b=function(w){const C=$._sentryDebugIds;if(!C)return{};const A=Object.keys(C);return Fn&&A.length===Ui||(Ui=A.length,Fn=A.reduce((x,j)=>{Ht||(Ht={});const R=Ht[j];if(R)x[R[0]]=R[1];else{const J=w(j);for(let X=J.length-1;X>=0;X--){const Oe=J[X],ot=Oe&&Oe.filename,at=C[j];if(ot&&at){x[ot]=at,Ht[j]=[ot,at];break}}}return x},{})),Fn}(m);try{y.exception.values.forEach(w=>{w.stacktrace.frames.forEach(C=>{b&&C.filename&&(C.debug_id=b[C.filename])})})}catch{}}(l,t.stackParser);const h=function(y,m){if(!m)return y;const b=y?y.clone():new Ue;return b.update(m),b}(r,n.captureContext);n.mechanism&&ht(l,n.mechanism);const v=i?i.getEventProcessors():[],k=hn("globalScope",()=>new Ue).getScopeData();s&&Bi(k,s.getScopeData()),h&&Bi(k,h.getScopeData());const E=[...n.attachments||[],...k.attachments];return E.length&&(n.attachments=E),gc(l,k),hr([...v,...k.eventProcessors],l,n).then(y=>(y&&function(m){const b={};try{m.exception.values.forEach(C=>{C.stacktrace.frames.forEach(A=>{A.debug_id&&(A.abs_path?b[A.abs_path]=A.debug_id:A.filename&&(b[A.filename]=A.debug_id),delete A.debug_id)})})}catch{}if(Object.keys(b).length===0)return;m.debug_meta=m.debug_meta||{},m.debug_meta.images=m.debug_meta.images||[];const w=m.debug_meta.images;Object.entries(b).forEach(([C,A])=>{w.push({type:"sourcemap",code_file:C,debug_id:A})})}(y),typeof a=="number"&&a>0?function(m,b,w){if(!m)return null;const C={...m,...m.breadcrumbs&&{breadcrumbs:m.breadcrumbs.map(A=>({...A,...A.data&&{data:Pe(A.data,b,w)}}))},...m.user&&{user:Pe(m.user,b,w)},...m.contexts&&{contexts:Pe(m.contexts,b,w)},...m.extra&&{extra:Pe(m.extra,b,w)}};return m.contexts&&m.contexts.trace&&C.contexts&&(C.contexts.trace=m.contexts.trace,m.contexts.trace.data&&(C.contexts.trace.data=Pe(m.contexts.trace.data,b,w))),m.spans&&(C.spans=m.spans.map(A=>({...A,...A.data&&{data:Pe(A.data,b,w)}}))),m.contexts&&m.contexts.flags&&C.contexts&&(C.contexts.flags=Pe(m.contexts.flags,3,w)),C}(y,a,c):y))}function Vi(t,e){return st().captureEvent(t,e)}function Ji(t){const e=te(),n=Dt(),r=st(),{release:i,environment:s=qr}=e&&e.getOptions()||{},{userAgent:a}=$.navigator||{},c=Xa({release:i,environment:s,user:r.getUser()||n.getUser(),...a&&{userAgent:a},...t}),l=n.getSession();return l&&l.status==="ok"&&pt(l,{status:"exited"}),Io(),n.setSession(c),r.setSession(c),c}function Io(){const t=Dt(),e=st(),n=e.getSession()||t.getSession();n&&function(r,i){let s={};r.status==="ok"&&(s={status:"exited"}),pt(r,s)}(n),Lo(),t.setSession(),e.setSession()}function Lo(){const t=Dt(),e=st(),n=te(),r=e.getSession()||t.getSession();r&&n&&n.captureSession(r)}function qi(t=!1){t?Io():Lo()}function yc(t,e,n){return e||`${function(r){return`${function(i){const s=i.protocol?`${i.protocol}:`:"",a=i.port?`:${i.port}`:"";return`${s}//${i.host}${a}${i.path?`/${i.path}`:""}/api/`}(r)}${r.projectId}/envelope/`}(t)}?${function(r,i){const s={sentry_version:"7"};return r.publicKey&&(s.sentry_key=r.publicKey),i&&(s.sentry_client=`${i.name}/${i.version}`),new URLSearchParams(s).toString()}(t,n)}`}const $i=[];function zi(t,e){for(const n of e)n&&n.afterAllSetup&&n.afterAllSetup(t)}function Hi(t,e,n){if(n[e.name])W&&D.log(`Integration skipped because it was already installed: ${e.name}`);else{if(n[e.name]=e,$i.indexOf(e.name)===-1&&typeof e.setupOnce=="function"&&(e.setupOnce(),$i.push(e.name)),e.setup&&typeof e.setup=="function"&&e.setup(t),typeof e.preprocessEvent=="function"){const r=e.preprocessEvent.bind(e);t.on("preprocessEvent",(i,s)=>r(i,s,t))}if(typeof e.processEvent=="function"){const r=e.processEvent.bind(e),i=Object.assign((s,a)=>r(s,a,t),{id:e.name});t.addEventProcessor(i)}W&&D.log(`Integration installed: ${e.name}`)}}class be extends Error{constructor(e,n="warn"){super(e),this.message=e,this.logLevel=n}}const Wi="Not capturing exception because it's already been captured.";class bc{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=uc(e.dsn):W&&D.warn("No DSN provided, client will not send events."),this._dsn){const r=yc(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:r})}const n=["enableTracing","tracesSampleRate","tracesSampler"].find(r=>r in e&&e[r]==null);n&&Lt(()=>{console.warn(`[Sentry] Deprecation warning: \`${n}\` is set to undefined, which leads to tracing being enabled. In v9, a value of \`undefined\` will result in tracing being disabled.`)})}captureException(e,n,r){const i=ge();if(Mi(e))return W&&D.log(Wi),i;const s={event_id:i,...n};return this._process(this.eventFromException(e,s).then(a=>this._captureEvent(a,s,r))),s.event_id}captureMessage(e,n,r,i){const s={event_id:ge(),...r},a=Nr(e)?e:String(e),c=or(e)?this.eventFromMessage(a,n,s):this.eventFromException(e,s);return this._process(c.then(l=>this._captureEvent(l,s,i))),s.event_id}captureEvent(e,n,r){const i=ge();if(n&&n.originalException&&Mi(n.originalException))return W&&D.log(Wi),i;const s={event_id:i,...n},a=(e.sdkProcessingMetadata||{}).capturedSpanScope;return this._process(this._captureEvent(e,s,a||r)),s.event_id}captureSession(e){typeof e.release!="string"?W&&D.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),pt(e,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){const n=this._transport;return n?(this.emit("flush"),this._isClientDoneProcessing(e).then(r=>n.flush(e).then(i=>r&&i))):tt(!0)}close(e){return this.flush(e).then(n=>(this.getOptions().enabled=!1,this.emit("close"),n))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){const n=this._integrations[e.name];Hi(this,e,this._integrations),n||zi(this,[e])}sendEvent(e,n={}){this.emit("beforeSendEvent",e,n);let r=mc(e,this._dsn,this._options._metadata,this._options.tunnel);for(const s of n.attachments||[])r=dc(r,hc(s));const i=this.sendEnvelope(r);i&&i.then(s=>this.emit("afterSendEvent",e,s),null)}sendSession(e){const n=function(r,i,s,a){const c=xo(s);return xt({sent_at:new Date().toISOString(),...c&&{sdk:c},...!!a&&i&&{dsn:gn(i)}},["aggregates"in r?[{type:"sessions"},r]:[{type:"session"},r.toJSON()]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(n)}recordDroppedEvent(e,n,r){if(this._options.sendClientReports){const i=typeof r=="number"?r:1,s=`${e}:${n}`;W&&D.log(`Recording outcome: "${s}"${i>1?` (${i} times)`:""}`),this._outcomes[s]=(this._outcomes[s]||0)+i}}on(e,n){const r=this._hooks[e]=this._hooks[e]||[];return r.push(n),()=>{const i=r.indexOf(n);i>-1&&r.splice(i,1)}}emit(e,...n){const r=this._hooks[e];r&&r.forEach(i=>i(...n))}sendEnvelope(e){return this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport?this._transport.send(e).then(null,n=>(W&&D.error("Error while sending envelope:",n),n)):(W&&D.error("Transport disabled"),tt({}))}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=function(n,r){const i={};return r.forEach(s=>{s&&Hi(n,s,i)}),i}(this,e),zi(this,e)}_updateSessionFromEvent(e,n){let r=n.level==="fatal",i=!1;const s=n.exception&&n.exception.values;if(s){i=!0;for(const c of s){const l=c.mechanism;if(l&&l.handled===!1){r=!0;break}}}const a=e.status==="ok";(a&&e.errors===0||a&&r)&&(pt(e,{...r&&{status:"crashed"},errors:e.errors||Number(i||r)}),this.captureSession(e))}_isClientDoneProcessing(e){return new pe(n=>{let r=0;const i=setInterval(()=>{this._numProcessing==0?(clearInterval(i),n(!0)):(r+=1,e&&r>=e&&(clearInterval(i),n(!1)))},1)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,n,r=st(),i=Dt()){const s=this.getOptions(),a=Object.keys(this._integrations);return!n.integrations&&a.length>0&&(n.integrations=a),this.emit("preprocessEvent",e,n),e.type||i.setLastEventId(e.event_id||n.event_id),vc(s,e,n,r,this,i).then(c=>{if(c===null)return c;c.contexts={trace:tc(r),...c.contexts};const l=function(f,h){const v=h.getPropagationContext();return v.dsc||Po(v.traceId,f)}(this,r);return c.sdkProcessingMetadata={dynamicSamplingContext:l,...c.sdkProcessingMetadata},c})}_captureEvent(e,n={},r){return this._processEvent(e,n,r).then(i=>i.event_id,i=>{W&&(i instanceof be&&i.logLevel==="log"?D.log(i.message):D.warn(i))})}_processEvent(e,n,r){const i=this.getOptions(),{sampleRate:s}=i,a=Ki(e),c=Gi(e),l=e.type||"error",f=`before send for type \`${l}\``,h=s===void 0?void 0:function(E){if(typeof E=="boolean")return Number(E);const y=typeof E=="string"?parseFloat(E):E;if(!(typeof y!="number"||isNaN(y)||y<0||y>1))return y;W&&D.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(E)} of type ${JSON.stringify(typeof E)}.`)}(s);if(c&&typeof h=="number"&&Math.random()>h)return this.recordDroppedEvent("sample_rate","error",e),mn(new be(`Discarding event because it's not included in the random sample (sampling rate = ${s})`,"log"));const v=l==="replay_event"?"replay":l,k=(e.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this._prepareEvent(e,n,r,k).then(E=>{if(E===null)throw this.recordDroppedEvent("event_processor",v,e),new be("An event processor returned `null`, will not send event.","log");if(n.data&&n.data.__sentry__===!0)return E;const y=function(m,b,w,C){const{beforeSend:A,beforeSendTransaction:x,beforeSendSpan:j}=b;if(Gi(w)&&A)return A(w,C);if(Ki(w)){if(w.spans&&j){const R=[];for(const J of w.spans){const X=j(J);X?R.push(X):(ac(),m.recordDroppedEvent("before_send","span"))}w.spans=R}if(x){if(w.spans){const R=w.spans.length;w.sdkProcessingMetadata={...w.sdkProcessingMetadata,spanCountBeforeProcessing:R}}return x(w,C)}}return w}(this,i,E,n);return function(m,b){const w=`${b} must return \`null\` or a valid event.`;if(Mn(m))return m.then(C=>{if(!ft(C)&&C!==null)throw new be(w);return C},C=>{throw new be(`${b} rejected with ${C}`)});if(!ft(m)&&m!==null)throw new be(w);return m}(y,f)}).then(E=>{if(E===null){if(this.recordDroppedEvent("before_send",v,e),a){const b=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",b)}throw new be(`${f} returned \`null\`, will not send event.`,"log")}const y=r&&r.getSession();if(!a&&y&&this._updateSessionFromEvent(y,E),a){const b=(E.sdkProcessingMetadata&&E.sdkProcessingMetadata.spanCountBeforeProcessing||0)-(E.spans?E.spans.length:0);b>0&&this.recordDroppedEvent("before_send","span",b)}const m=E.transaction_info;if(a&&m&&E.transaction!==e.transaction){const b="custom";E.transaction_info={...m,source:b}}return this.sendEvent(E,n),E}).then(null,E=>{throw E instanceof be?E:(this.captureException(E,{data:{__sentry__:!0},originalException:E}),new be(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
13
|
+
Reason: ${E}`))})}_process(e){this._numProcessing++,e.then(n=>(this._numProcessing--,n),n=>(this._numProcessing--,n))}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.entries(e).map(([n,r])=>{const[i,s]=n.split(":");return{reason:i,category:s,quantity:r}})}_flushOutcomes(){W&&D.log("Flushing outcomes...");const e=this._clearOutcomes();if(e.length===0)return void(W&&D.log("No outcomes to send"));if(!this._dsn)return void(W&&D.log("No dsn provided, will not send outcomes"));W&&D.log("Sending outcomes:",e);const n=(r=e,xt((i=this._options.tunnel&&gn(this._dsn))?{dsn:i}:{},[[{type:"client_report"},{timestamp:s||Rt(),discarded_events:r}]]));var r,i,s;this.sendEnvelope(n)}}function Gi(t){return t.type===void 0}function Ki(t){return t.type==="transaction"}function _c(t){const e=[];function n(r){return e.splice(e.indexOf(r),1)[0]||Promise.resolve(void 0)}return{$:e,add:function(r){if(!(t===void 0||e.length<t))return mn(new be("Not adding Promise because buffer limit was reached."));const i=r();return e.indexOf(i)===-1&&e.push(i),i.then(()=>n(i)).then(null,()=>n(i).then(null,()=>{})),i},drain:function(r){return new pe((i,s)=>{let a=e.length;if(!a)return i(!0);const c=setTimeout(()=>{r&&r>0&&i(!1)},r);e.forEach(l=>{tt(l).then(()=>{--a||(clearTimeout(c),i(!0))},s)})})}}}function wc(t,{statusCode:e,headers:n},r=Date.now()){const i={...t},s=n&&n["x-sentry-rate-limits"],a=n&&n["retry-after"];if(s)for(const c of s.trim().split(",")){const[l,f,,,h]=c.split(":",5),v=parseInt(l,10),k=1e3*(isNaN(v)?60:v);if(f)for(const E of f.split(";"))E==="metric_bucket"&&h&&!h.split(";").includes("custom")||(i[E]=r+k);else i.all=r+k}else a?i.all=r+function(c,l=Date.now()){const f=parseInt(`${c}`,10);if(!isNaN(f))return 1e3*f;const h=Date.parse(`${c}`);return isNaN(h)?6e4:h-l}(a,r):e===429&&(i.all=r+6e4);return i}function Sc(t,e,n=_c(t.bufferSize||64)){let r={};return{send:function(i){const s=[];if(Ni(i,(l,f)=>{const h=Fi(f);if(function(v,k,E=Date.now()){return function(y,m){return y[m]||y.all||0}(v,k)>E}(r,h)){const v=Qi(l,f);t.recordDroppedEvent("ratelimit_backoff",h,v)}else s.push(l)}),s.length===0)return tt({});const a=xt(i[0],s),c=l=>{Ni(a,(f,h)=>{const v=Qi(f,h);t.recordDroppedEvent(l,Fi(h),v)})};return n.add(()=>e({body:fc(a)}).then(l=>(l.statusCode!==void 0&&(l.statusCode<200||l.statusCode>=300)&&W&&D.warn(`Sentry responded with status code ${l.statusCode} to sent event.`),r=wc(r,l),l),l=>{throw c("network_error"),l})).then(l=>l,l=>{if(l instanceof be)return W&&D.error("Skipped sending event because buffer is full."),c("queue_overflow"),tt({});throw l})},flush:i=>n.drain(i)}}function Qi(t,e){if(e==="event"||e==="transaction")return Array.isArray(t)?t[1]:void 0}const kc=100;function Je(t,e){const n=te(),r=Dt();if(!n)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:s=kc}=n.getOptions();if(s<=0)return;const a={timestamp:Rt(),...t},c=i?Lt(()=>i(a,e)):a;c!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",c,e),r.addBreadcrumb(c,s))}let Xi;const Yi=new WeakMap,Ec=()=>({name:"FunctionToString",setupOnce(){Xi=Function.prototype.toString;try{Function.prototype.toString=function(...t){const e=Ur(this),n=Yi.has(te())&&e!==void 0?e:this;return Xi.apply(n,t)}}catch{}},setup(t){Yi.set(t,!0)}}),Tc=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,"undefined is not an object (evaluating 'a.L')",`can't redefine non-configurable property "solana"`,"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler",/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/],Cc=(t={})=>({name:"InboundFilters",processEvent(e,n,r){const i=r.getOptions(),s=function(a={},c={}){return{allowUrls:[...a.allowUrls||[],...c.allowUrls||[]],denyUrls:[...a.denyUrls||[],...c.denyUrls||[]],ignoreErrors:[...a.ignoreErrors||[],...c.ignoreErrors||[],...a.disableErrorDefaults?[]:Tc],ignoreTransactions:[...a.ignoreTransactions||[],...c.ignoreTransactions||[]],ignoreInternal:a.ignoreInternal===void 0||a.ignoreInternal}}(t,i);return function(a,c){return c.ignoreInternal&&function(l){try{return l.exception.values[0].type==="SentryError"}catch{}return!1}(a)?(W&&D.warn(`Event dropped due to being internal Sentry Error.
|
|
14
|
+
Event: ${Ne(a)}`),!0):function(l,f){return l.type||!f||!f.length?!1:function(h){const v=[];h.message&&v.push(h.message);let k;try{k=h.exception.values[h.exception.values.length-1]}catch{}return k&&k.value&&(v.push(k.value),k.type&&v.push(`${k.type}: ${k.value}`)),v}(l).some(h=>zt(h,f))}(a,c.ignoreErrors)?(W&&D.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
15
|
+
Event: ${Ne(a)}`),!0):function(l){return l.type||!l.exception||!l.exception.values||l.exception.values.length===0?!1:!l.message&&!l.exception.values.some(f=>f.stacktrace||f.type&&f.type!=="Error"||f.value)}(a)?(W&&D.warn(`Event dropped due to not having an error message, error type or stacktrace.
|
|
16
|
+
Event: ${Ne(a)}`),!0):function(l,f){if(l.type!=="transaction"||!f||!f.length)return!1;const h=l.transaction;return!!h&&zt(h,f)}(a,c.ignoreTransactions)?(W&&D.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
17
|
+
Event: ${Ne(a)}`),!0):function(l,f){if(!f||!f.length)return!1;const h=Gt(l);return!!h&&zt(h,f)}(a,c.denyUrls)?(W&&D.warn(`Event dropped due to being matched by \`denyUrls\` option.
|
|
18
|
+
Event: ${Ne(a)}.
|
|
19
|
+
Url: ${Gt(a)}`),!0):function(l,f){if(!f||!f.length)return!0;const h=Gt(l);return!h||zt(h,f)}(a,c.allowUrls)?!1:(W&&D.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
20
|
+
Event: ${Ne(a)}.
|
|
21
|
+
Url: ${Gt(a)}`),!0)}(e,s)?null:e}});function Gt(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch{}return e?function(n=[]){for(let r=n.length-1;r>=0;r--){const i=n[r];if(i&&i.filename!=="<anonymous>"&&i.filename!=="[native code]")return i.filename||null}return null}(e):null}catch{return W&&D.error(`Cannot extract url for event ${Ne(t)}`),null}}function Mc(t,e,n=250,r,i,s,a){if(!(s.exception&&s.exception.values&&a&&Ze(a.originalException,Error)))return;const c=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;var l,f;c&&(s.exception.values=(l=pr(t,e,i,a.originalException,r,s.exception.values,c,0),f=n,l.map(h=>(h.value&&(h.value=ut(h.value,f)),h))))}function pr(t,e,n,r,i,s,a,c){if(s.length>=n+1)return s;let l=[...s];if(Ze(r[i],Error)){Zi(a,c);const f=t(e,r[i]),h=l.length;es(f,i,h,c),l=pr(t,e,n,r[i],i,[f,...l],f,h)}return Array.isArray(r.errors)&&r.errors.forEach((f,h)=>{if(Ze(f,Error)){Zi(a,c);const v=t(e,f),k=l.length;es(v,`errors[${h}]`,k,c),l=pr(t,e,n,f,i,[v,...l],v,k)}}),l}function Zi(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,...t.type==="AggregateError"&&{is_exception_group:!0},exception_id:e}}function es(t,e,n,r){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,type:"chained",source:e,exception_id:n,parent_id:r}}function Un(t){if(!t)return{};const e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};const n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:n,hash:r,relative:e[5]+n+r}}function Oc(){"console"in $&&sr.forEach(function(t){t in $.console&&ue($.console,t,function(e){return pn[t]=e,function(...n){_e("console",{args:n,level:t});const r=pn[t];r&&r.apply($.console,n)}})})}function Ac(t){return t==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(t)?t:"log"}const Pc=()=>{let t;return{name:"Dedupe",processEvent(e){if(e.type)return e;try{if(function(n,r){return r?!!(function(i,s){const a=i.message,c=s.message;return!(!a&&!c||a&&!c||!a&&c||a!==c||!ns(i,s)||!ts(i,s))}(n,r)||function(i,s){const a=rs(s),c=rs(i);return!(!a||!c||a.type!==c.type||a.value!==c.value||!ns(i,s)||!ts(i,s))}(n,r)):!1}(e,t))return W&&D.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return t=e}}};function ts(t,e){let n=wi(t),r=wi(e);if(!n&&!r)return!0;if(n&&!r||!n&&r||r.length!==n.length)return!1;for(let i=0;i<r.length;i++){const s=r[i],a=n[i];if(s.filename!==a.filename||s.lineno!==a.lineno||s.colno!==a.colno||s.function!==a.function)return!1}return!0}function ns(t,e){let n=t.fingerprint,r=e.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return n.join("")===r.join("")}catch{return!1}}function rs(t){return t.exception&&t.exception.values&&t.exception.values[0]}function is(t){return t===void 0?void 0:t>=400&&t<500?"warning":t>=500?"error":void 0}const Bn=$;function mr(t){return t&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function jc(){if(typeof EdgeRuntime=="string")return!0;if(!function(){if(!("fetch"in Bn))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}())return!1;if(mr(Bn.fetch))return!0;let t=!1;const e=Bn.document;if(e&&typeof e.createElement=="function")try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(t=mr(n.contentWindow.fetch)),e.head.removeChild(n)}catch(n){it&&D.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return t}function xc(t,e){const n="fetch";Qe(n,t),Xe(n,()=>function(r,i=!1){i&&!jc()||ue($,"fetch",function(s){return function(...a){const c=new Error,{method:l,url:f}=function(v){if(v.length===0)return{method:"GET",url:""};if(v.length===2){const[E,y]=v;return{url:ss(E),method:gr(y,"method")?String(y.method).toUpperCase():"GET"}}const k=v[0];return{url:ss(k),method:gr(k,"method")?String(k.method).toUpperCase():"GET"}}(a),h={args:a,fetchData:{method:l,url:f},startTimestamp:1e3*Ie(),virtualError:c};return r||_e("fetch",{...h}),s.apply($,a).then(async v=>(r?r(v):_e("fetch",{...h,endTimestamp:1e3*Ie(),response:v}),v),v=>{throw _e("fetch",{...h,endTimestamp:1e3*Ie(),error:v}),Dr(v)&&v.stack===void 0&&(v.stack=c.stack,et(v,"framesToPop",1)),v})}})}(void 0,e))}function gr(t,e){return!!t&&typeof t=="object"&&!!t[e]}function ss(t){return typeof t=="string"?t:t?gr(t,"url")?t.url:t.toString?t.toString():"":""}const Kt=$,Z=$;let vr=0;function os(){return vr>0}function gt(t,e={}){if(!function(r){return typeof r=="function"}(t))return t;try{const r=t.__sentry_wrapped__;if(r)return typeof r=="function"?r:t;if(Ur(t))return t}catch{return t}const n=function(...r){try{const i=r.map(s=>gt(s,e));return t.apply(this,i)}catch(i){throw vr++,setTimeout(()=>{vr--}),function(...s){const a=Vr(Tn());if(s.length===2){const[c,l]=s;return c?a.withSetScope(c,l):a.withScope(l)}a.withScope(s[0])}(s=>{var a;s.addEventProcessor(c=>(e.mechanism&&(cr(c,void 0),ht(c,e.mechanism)),c.extra={...c.extra,arguments:r},c)),a=i,st().captureException(a,void 0)}),i}};try{for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}catch{}Co(n,t),et(t,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get:()=>t.name})}catch{}return n}const An=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function $r(t,e){const n=zr(t,e),r={type:Rc(e),value:Dc(e)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function Ic(t,e,n,r){const i=te(),s=i&&i.getOptions().normalizeDepth,a=function(f){for(const h in f)if(Object.prototype.hasOwnProperty.call(f,h)){const v=f[h];if(v instanceof Error)return v}}(e),c={__serialized__:jo(e,s)};if(a)return{exception:{values:[$r(t,a)]},extra:c};const l={exception:{values:[{type:Cn(e)?e.constructor.name:r?"UnhandledRejection":"Error",value:Nc(e,{isUnhandledRejection:r})}]},extra:c};if(n){const f=zr(t,n);f.length&&(l.exception.values[0].stacktrace={frames:f})}return l}function Vn(t,e){return{exception:{values:[$r(t,e)]}}}function zr(t,e){const n=e.stacktrace||e.stack||"",r=function(s){return s&&Lc.test(s.message)?1:0}(e),i=function(s){return typeof s.framesToPop=="number"?s.framesToPop:0}(e);try{return t(n,r,i)}catch{}return[]}const Lc=/Minified React error #\d+;/i;function Ro(t){return typeof WebAssembly<"u"&&WebAssembly.Exception!==void 0&&t instanceof WebAssembly.Exception}function Rc(t){const e=t&&t.name;return!e&&Ro(t)?t.message&&Array.isArray(t.message)&&t.message.length==2?t.message[0]:"WebAssembly.Exception":e}function Dc(t){const e=t&&t.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:Ro(t)&&Array.isArray(t.message)&&t.message.length==2?t.message[1]:e:"No error message"}function yr(t,e,n,r,i){let s;if(ko(e)&&e.error)return Vn(t,e.error);if(ki(e)||vt(e,"DOMException")){const a=e;if("stack"in e)s=Vn(t,e);else{const c=a.name||(ki(a)?"DOMError":"DOMException"),l=a.message?`${c}: ${a.message}`:c;s=br(t,l,n,r),cr(s,l)}return"code"in a&&(s.tags={...s.tags,"DOMException.code":`${a.code}`}),s}return Dr(e)?Vn(t,e):ft(e)||Cn(e)?(s=Ic(t,e,n,i),ht(s,{synthetic:!0}),s):(s=br(t,e,n,r),cr(s,`${e}`),ht(s,{synthetic:!0}),s)}function br(t,e,n,r){const i={};if(r&&n){const s=zr(t,n);s.length&&(i.exception={values:[{value:e,stacktrace:{frames:s}}]}),ht(i,{synthetic:!0})}if(Nr(e)){const{__sentry_template_string__:s,__sentry_template_values__:a}=e;return i.logentry={message:s,params:a},i}return i.message=e,i}function Nc(t,{isUnhandledRejection:e}){const n=function(i,s=40){const a=Object.keys(Mo(i));a.sort();const c=a[0];if(!c)return"[object has no keys]";if(c.length>=s)return ut(c,s);for(let l=a.length;l>0;l--){const f=a.slice(0,l).join(", ");if(!(f.length>s))return l===a.length?f:ut(f,s)}return""}(t),r=e?"promise rejection":"exception";return ko(t)?`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``:Cn(t)?`Event \`${function(i){try{const s=Object.getPrototypeOf(i);return s?s.constructor.name:void 0}catch{}}(t)}\` (type=${t.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}class Fc extends bc{constructor(e){const n={parentSpanIsAlwaysRootSpan:!0,...e};(function(r,i,s=[i],a="npm"){const c=r._metadata||{};c.sdk||(c.sdk={name:`sentry.javascript.${i}`,packages:s.map(l=>({name:`${a}:@sentry/${l}`,version:Ke})),version:Ke}),r._metadata=c})(n,"browser",["browser"],Z.SENTRY_SDK_SOURCE||"npm"),super(n),n.sendClientReports&&Z.document&&Z.document.addEventListener("visibilitychange",()=>{Z.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,n){return function(r,i,s,a){const c=yr(r,i,s&&s.syntheticException||void 0,a);return ht(c),c.level="error",s&&s.event_id&&(c.event_id=s.event_id),tt(c)}(this._options.stackParser,e,n,this._options.attachStacktrace)}eventFromMessage(e,n="info",r){return function(i,s,a="info",c,l){const f=br(i,s,c&&c.syntheticException||void 0,l);return f.level=a,c&&c.event_id&&(f.event_id=c.event_id),tt(f)}(this._options.stackParser,e,n,r,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled())return void(An&&D.warn("SDK not enabled, will not capture user feedback."));const n=function(r,{metadata:i,tunnel:s,dsn:a}){const c={event_id:r.event_id,sent_at:new Date().toISOString(),...i&&i.sdk&&{sdk:{name:i.sdk.name,version:i.sdk.version}},...!!s&&!!a&&{dsn:gn(a)}};return xt(c,[function(f){return[{type:"user_report"},f]}(r)])}(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this.sendEnvelope(n)}_prepareEvent(e,n,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,n,r)}}const Uc=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,oe=$;let as,Jn,qn,Qt;function Bc(){if(!oe.document)return;const t=_e.bind(null,"dom"),e=cs(t,!0);oe.document.addEventListener("click",e,!1),oe.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(n=>{const r=oe[n],i=r&&r.prototype;i&&i.hasOwnProperty&&i.hasOwnProperty("addEventListener")&&(ue(i,"addEventListener",function(s){return function(a,c,l){if(a==="click"||a=="keypress")try{const f=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},h=f[a]=f[a]||{refCount:0};if(!h.handler){const v=cs(t);h.handler=v,s.call(this,a,v,l)}h.refCount++}catch{}return s.call(this,a,c,l)}}),ue(i,"removeEventListener",function(s){return function(a,c,l){if(a==="click"||a=="keypress")try{const f=this.__sentry_instrumentation_handlers__||{},h=f[a];h&&(h.refCount--,h.refCount<=0&&(s.call(this,a,h.handler,l),h.handler=void 0,delete f[a]),Object.keys(f).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return s.call(this,a,c,l)}}))})}function cs(t,e=!1){return n=>{if(!n||n._sentryCaptured)return;const r=function(s){try{return s.target}catch{return null}}(n);if(function(s,a){return s==="keypress"&&(!a||!a.tagName||a.tagName!=="INPUT"&&a.tagName!=="TEXTAREA"&&!a.isContentEditable)}(n.type,r))return;et(n,"_sentryCaptured",!0),r&&!r._sentryId&&et(r,"_sentryId",ge());const i=n.type==="keypress"?"input":n.type;(function(s){if(s.type!==Jn)return!1;try{if(!s.target||s.target._sentryId!==qn)return!1}catch{}return!0})(n)||(t({event:n,name:i,global:e}),Jn=n.type,qn=r?r._sentryId:void 0),clearTimeout(as),as=oe.setTimeout(()=>{qn=void 0,Jn=void 0},1e3)}}function Do(t){const e="history";Qe(e,t),Xe(e,Vc)}function Vc(){if(!function(){const n=Kt.chrome,r=n&&n.app&&n.app.runtime,i="history"in Kt&&!!Kt.history.pushState&&!!Kt.history.replaceState;return!r&&i}())return;const t=oe.onpopstate;function e(n){return function(...r){const i=r.length>2?r[2]:void 0;if(i){const s=Qt,a=String(i);Qt=a,_e("history",{from:s,to:a})}return n.apply(this,r)}}oe.onpopstate=function(...n){const r=oe.location.href,i=Qt;if(Qt=r,_e("history",{from:i,to:r}),t)try{return t.apply(this,n)}catch{}},ue(oe.history,"pushState",e),ue(oe.history,"replaceState",e)}const sn={};function ls(t){sn[t]=void 0}const Mt="__sentry_xhr_v3__";function Jc(){if(!oe.XMLHttpRequest)return;const t=XMLHttpRequest.prototype;t.open=new Proxy(t.open,{apply(e,n,r){const i=new Error,s=1e3*Ie(),a=je(r[0])?r[0].toUpperCase():void 0,c=function(f){if(je(f))return f;try{return f.toString()}catch{}}(r[1]);if(!a||!c)return e.apply(n,r);n[Mt]={method:a,url:c,request_headers:{}},a==="POST"&&c.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const l=()=>{const f=n[Mt];if(f&&n.readyState===4){try{f.status_code=n.status}catch{}_e("xhr",{endTimestamp:1e3*Ie(),startTimestamp:s,xhr:n,virtualError:i})}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply:(f,h,v)=>(l(),f.apply(h,v))}):n.addEventListener("readystatechange",l),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(f,h,v){const[k,E]=v,y=h[Mt];return y&&je(k)&&je(E)&&(y.request_headers[k.toLowerCase()]=E),f.apply(h,v)}}),e.apply(n,r)}}),t.send=new Proxy(t.send,{apply(e,n,r){const i=n[Mt];return i?(r[0]!==void 0&&(i.body=r[0]),_e("xhr",{startTimestamp:1e3*Ie(),xhr:n}),e.apply(n,r)):e.apply(n,r)}})}function qc(t,e=function(n){const r=sn[n];if(r)return r;let i=oe[n];if(mr(i))return sn[n]=i.bind(oe);const s=oe.document;if(s&&typeof s.createElement=="function")try{const a=s.createElement("iframe");a.hidden=!0,s.head.appendChild(a);const c=a.contentWindow;c&&c[n]&&(i=c[n]),s.head.removeChild(a)}catch(a){Uc&&D.warn(`Could not create sandbox iframe for ${n} check, bailing to window.${n}: `,a)}return i&&(sn[n]=i.bind(oe))}("fetch")){let n=0,r=0;return Sc(t,function(i){const s=i.body.length;n+=s,r++;const a={body:i.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:n<=6e4&&r<15,...t.fetchOptions};if(!e)return ls("fetch"),mn("No fetch implementation available");try{return e(t.url,a).then(c=>(n-=s,r--,{statusCode:c.status,headers:{"x-sentry-rate-limits":c.headers.get("X-Sentry-Rate-Limits"),"retry-after":c.headers.get("Retry-After")}}))}catch(c){return ls("fetch"),n-=s,r--,mn(c)}})}function $n(t,e,n,r){const i={filename:t,function:e==="<anonymous>"?We:e,in_app:!0};return n!==void 0&&(i.lineno=n),r!==void 0&&(i.colno=r),i}const $c=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,zc=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Hc=/\((\S*)(?::(\d+))(?::(\d+))\)/,Wc=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Gc=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Kc=function(...t){const e=t.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,i=0)=>{const s=[],a=n.split(`
|
|
22
|
+
`);for(let c=r;c<a.length;c++){const l=a[c];if(l.length>1024)continue;const f=yi.test(l)?l.replace(yi,"$1"):l;if(!f.match(/\S*Error: /)){for(const h of e){const v=h(f);if(v){s.push(v);break}}if(s.length>=50+i)break}}return function(c){if(!c.length)return[];const l=Array.from(c);return/sentryWrapped/.test($t(l).function||"")&&l.pop(),l.reverse(),bi.test($t(l).function||"")&&(l.pop(),bi.test($t(l).function||"")&&l.pop()),l.slice(0,50).map(f=>({...f,filename:f.filename||$t(l).filename,function:f.function||We}))}(s.slice(i))}}([30,t=>{const e=$c.exec(t);if(e){const[,r,i,s]=e;return $n(r,We,+i,+s)}const n=zc.exec(t);if(n){if(n[2]&&n[2].indexOf("eval")===0){const s=Hc.exec(n[2]);s&&(n[2]=s[1],n[3]=s[2],n[4]=s[3])}const[r,i]=us(n[1]||We,n[2]);return $n(i,r,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],[50,t=>{const e=Wc.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){const i=Gc.exec(e[3]);i&&(e[1]=e[1]||"eval",e[3]=i[1],e[4]=i[2],e[5]="")}let n=e[3],r=e[1]||We;return[r,n]=us(r,n),$n(n,r,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}}]),us=(t,e)=>{const n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:We,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},ds=1024,Qc=(t={})=>{const e={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...t};return{name:"Breadcrumbs",setup(n){var r;e.console&&function(i){const s="console";Qe(s,i),Xe(s,Oc)}(function(i){return function(s){if(te()!==i)return;const a={category:"console",data:{arguments:s.args,logger:"console"},level:Ac(s.level),message:Ei(s.args," ")};if(s.level==="assert"){if(s.args[0]!==!1)return;a.message=`Assertion failed: ${Ei(s.args.slice(1)," ")||"console.assert"}`,a.data.arguments=s.args.slice(1)}Je(a,{input:s.args,level:s.level})}}(n)),e.dom&&(r=function(i,s){return function(a){if(te()!==i)return;let c,l,f=typeof s=="object"?s.serializeAttribute:void 0,h=typeof s=="object"&&typeof s.maxStringLength=="number"?s.maxStringLength:void 0;h&&h>ds&&(An&&D.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${h} was configured. Sentry will use 1024 instead.`),h=ds),typeof f=="string"&&(f=[f]);try{const k=a.event,E=function(y){return!!y&&!!y.target}(k)?k.target:k;c=To(E,{keyAttrs:f,maxStringLength:h}),l=function(y){if(!Fr.HTMLElement)return null;let m=y;for(let b=0;b<5;b++){if(!m)return null;if(m instanceof HTMLElement){if(m.dataset.sentryComponent)return m.dataset.sentryComponent;if(m.dataset.sentryElement)return m.dataset.sentryElement}m=m.parentNode}return null}(E)}catch{c="<unknown>"}if(c.length===0)return;const v={category:`ui.${a.name}`,message:c};l&&(v.data={"ui.component_name":l}),Je(v,{event:a.event,name:a.name,global:a.global})}}(n,e.dom),Qe("dom",r),Xe("dom",Bc)),e.xhr&&function(i){Qe("xhr",i),Xe("xhr",Jc)}(function(i){return function(s){if(te()!==i)return;const{startTimestamp:a,endTimestamp:c}=s,l=s.xhr[Mt];if(!a||!c||!l)return;const{method:f,url:h,status_code:v,body:k}=l,E={method:f,url:h,status_code:v},y={xhr:s.xhr,input:k,startTimestamp:a,endTimestamp:c};Je({category:"xhr",data:E,type:"http",level:is(v)},y)}}(n)),e.fetch&&xc(function(i){return function(s){if(te()!==i)return;const{startTimestamp:a,endTimestamp:c}=s;if(c&&(!s.fetchData.url.match(/sentry_key/)||s.fetchData.method!=="POST"))if(s.error)Je({category:"fetch",data:s.fetchData,level:"error",type:"http"},{data:s.error,input:s.args,startTimestamp:a,endTimestamp:c});else{const l=s.response,f={...s.fetchData,status_code:l&&l.status},h={input:s.args,response:l,startTimestamp:a,endTimestamp:c};Je({category:"fetch",data:f,type:"http",level:is(f.status_code)},h)}}}(n)),e.history&&Do(function(i){return function(s){if(te()!==i)return;let a=s.from,c=s.to;const l=Un(Z.location.href);let f=a?Un(a):void 0;const h=Un(c);f&&f.path||(f=l),l.protocol===h.protocol&&l.host===h.host&&(c=h.relative),l.protocol===f.protocol&&l.host===f.host&&(a=f.relative),Je({category:"navigation",data:{from:a,to:c}})}}(n)),e.sentry&&n.on("beforeSendEvent",function(i){return function(s){te()===i&&Je({category:"sentry."+(s.type==="transaction"?"transaction":"event"),event_id:s.event_id,level:s.level,message:Ne(s)},{event:s})}}(n))}}},Xc=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],Yc=(t={})=>{const e={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...t};return{name:"BrowserApiErrors",setupOnce(){e.setTimeout&&ue(Z,"setTimeout",fs),e.setInterval&&ue(Z,"setInterval",fs),e.requestAnimationFrame&&ue(Z,"requestAnimationFrame",Zc),e.XMLHttpRequest&&"XMLHttpRequest"in Z&&ue(XMLHttpRequest.prototype,"send",el);const n=e.eventTarget;n&&(Array.isArray(n)?n:Xc).forEach(tl)}}};function fs(t){return function(...e){const n=e[0];return e[0]=gt(n,{mechanism:{data:{function:Fe(t)},handled:!1,type:"instrument"}}),t.apply(this,e)}}function Zc(t){return function(e){return t.apply(this,[gt(e,{mechanism:{data:{function:"requestAnimationFrame",handler:Fe(t)},handled:!1,type:"instrument"}})])}}function el(t){return function(...e){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(r=>{r in n&&typeof n[r]=="function"&&ue(n,r,function(i){const s={mechanism:{data:{function:r,handler:Fe(i)},handled:!1,type:"instrument"}},a=Ur(i);return a&&(s.mechanism.data.handler=Fe(a)),gt(i,s)})}),t.apply(this,e)}}function tl(t){const e=Z[t],n=e&&e.prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(ue(n,"addEventListener",function(r){return function(i,s,a){try{typeof s.handleEvent=="function"&&(s.handleEvent=gt(s.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Fe(s),target:t},handled:!1,type:"instrument"}}))}catch{}return r.apply(this,[i,gt(s,{mechanism:{data:{function:"addEventListener",handler:Fe(s),target:t},handled:!1,type:"instrument"}}),a])}}),ue(n,"removeEventListener",function(r){return function(i,s,a){try{const c=s.__sentry_wrapped__;c&&r.call(this,i,c,a)}catch{}return r.call(this,i,s,a)}}))}const nl=()=>({name:"BrowserSession",setupOnce(){Z.document!==void 0?(Ji({ignoreDuration:!0}),qi(),Do(({from:t,to:e})=>{t!==void 0&&t!==e&&(Ji({ignoreDuration:!0}),qi())})):An&&D.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.")}}),rl=(t={})=>{const e={onerror:!0,onunhandledrejection:!0,...t};return{name:"GlobalHandlers",setupOnce(){Error.stackTraceLimit=50},setup(n){e.onerror&&(function(r){(function(i){const s="error";Qe(s,i),Xe(s,Wa)})(i=>{const{stackParser:s,attachStacktrace:a}=ps();if(te()!==r||os())return;const{msg:c,url:l,line:f,column:h,error:v}=i,k=function(E,y,m,b){const w=E.exception=E.exception||{},C=w.values=w.values||[],A=C[0]=C[0]||{},x=A.stacktrace=A.stacktrace||{},j=x.frames=x.frames||[],R=b,J=m,X=je(y)&&y.length>0?y:function(){try{return Fr.document.location.href}catch{return""}}();return j.length===0&&j.push({colno:R,filename:X,function:We,in_app:!0,lineno:J}),E}(yr(s,v||c,void 0,a,!1),l,f,h);k.level="error",Vi(k,{originalException:v,mechanism:{handled:!1,type:"onerror"}})})}(n),hs("onerror")),e.onunhandledrejection&&(function(r){(function(i){const s="unhandledrejection";Qe(s,i),Xe(s,Ga)})(i=>{const{stackParser:s,attachStacktrace:a}=ps();if(te()!==r||os())return;const c=function(f){if(or(f))return f;try{if("reason"in f)return f.reason;if("detail"in f&&"reason"in f.detail)return f.detail.reason}catch{}return f}(i),l=or(c)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(c)}`}]}}:yr(s,c,void 0,a,!0);l.level="error",Vi(l,{originalException:c,mechanism:{handled:!1,type:"onunhandledrejection"}})})}(n),hs("onunhandledrejection"))}}};function hs(t){An&&D.log(`Global Handler attached: ${t}`)}function ps(){const t=te();return t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}const il=()=>({name:"HttpContext",preprocessEvent(t){if(!Z.navigator&&!Z.location&&!Z.document)return;const e=t.request&&t.request.url||Z.location&&Z.location.href,{referrer:n}=Z.document||{},{userAgent:r}=Z.navigator||{},i={...t.request&&t.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},s={...t.request,...e&&{url:e},headers:i};t.request=s}}),sl=(t={})=>{const e=t.limit||5,n=t.key||"cause";return{name:"LinkedErrors",preprocessEvent(r,i,s){const a=s.getOptions();Mc($r,a.stackParser,a.maxValueLength,n,e,r,i)}}};var ms="new",gs="loading",vs="loaded",_r="joining-meeting",He="joined-meeting",qe="left-meeting",Le="error",ol="playable",zn="unknown",al="full",cl="base",ys="no-room",ll="end-of-life",ul="connection-error",dl="iframe-ready-for-launch-config",fl="iframe-launch-config",hl="theme-updated",pl="loading",ml="load-attempt-failed",bs="loaded",gl="started-camera",vl="camera-error",yl="joining-meeting",bl="joined-meeting",_l="left-meeting",wl="participant-joined",Sl="participant-updated",kl="participant-left",El="participant-counts-updated",Tl="access-state-updated",Cl="meeting-session-summary-updated",Ml="meeting-session-state-updated",Ol="waiting-participant-added",Al="waiting-participant-updated",Pl="waiting-participant-removed",jl="track-started",xl="track-stopped",Il="transcription-started",Ll="transcription-stopped",Rl="transcription-error",_s="recording-started",ws="recording-stopped",Dl="recording-stats",Nl="recording-error",Fl="recording-upload-completed",Ul="recording-data",Bl="app-message",Vl="transcription-message",Jl="remote-media-player-started",ql="remote-media-player-updated",$l="remote-media-player-stopped",zl="local-screen-share-started",Hl="local-screen-share-stopped",Wl="local-screen-share-canceled",Gl="active-speaker-change",Kl="active-speaker-mode-change",Ql="network-quality-change",Xl="network-connection",Yl="cpu-load-change",Zl="face-counts-updated",Xt="fullscreen",Yt="exited-fullscreen",eu="live-streaming-started",tu="live-streaming-updated",nu="live-streaming-stopped",ru="live-streaming-error",iu="lang-updated",su="receive-settings-updated",Ss="input-settings-updated",ks="nonfatal-error",Es="error",Hn=4096,Ts=102400,Wn="iframe-call-message",Cs="local-screen-start",Ms="daily-method-update-live-streaming-endpoints",Zt="transmit-log",xe="daily-custom-track",on={NONE:"none",BGBLUR:"background-blur",BGIMAGE:"background-image",FACE_DETECTION:"face-detection"},No={NONE:"none",NOISE_CANCELLATION:"noise-cancellation"},wr={PLAY:"play",PAUSE:"pause"},Gn=["jpg","png","jpeg"],ou="add-endpoints",au="remove-endpoints",Os="sip-call-transfer";function ve(){return!V()&&typeof window<"u"&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:""}function V(){return typeof navigator<"u"&&navigator.product&&navigator.product==="ReactNative"}function Fo(){return navigator&&navigator.mediaDevices&&navigator.mediaDevices.getUserMedia}function cu(){return!!(navigator&&navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia)&&(function(t,e){if(!t||!e)return!0;switch(t){case"Chrome":return e.major>=75;case"Safari":return RTCRtpTransceiver.prototype.hasOwnProperty("currentDirection")&&!(e.major===13&&e.minor===0&&e.point===0);case"Firefox":return e.major>=67}return!0}(nt(),vn())||V())}function As(){if(V()||!document)return!1;var t=document.createElement("iframe");return!!t.requestFullscreen||!!t.webkitRequestFullscreen}var Sr="none",lu="software",uu="hardware",du=function(){try{var t,e=document.createElement("canvas"),n=!1;(t=e.getContext("webgl2",{failIfMajorPerformanceCaveat:!0}))||(n=!0,t=e.getContext("webgl2"));var r=t!=null;return e.remove(),r?n?lu:uu:Sr}catch{return Sr}}();function Uo(){var t=arguments.length>0&&arguments[0]!==void 0&&arguments[0];return!V()&&du!==Sr&&(t?function(){return js()?!1:["Chrome","Firefox"].includes(nt())}():function(){if(js())return!1;var e=nt();if(e==="Safari"){var n=Wr();if(n.major<15||n.major===15&&n.minor<4)return!1}return e==="Chrome"?Hr().major>=77:e==="Firefox"?Gr().major>=97:["Chrome","Firefox","Safari"].includes(e)}())}function Bo(){if(V()||Vo()||typeof AudioWorkletNode>"u")return!1;switch(nt()){case"Chrome":case"Firefox":return!0;case"Safari":var t=vn();return t.major>17||t.major===17&&t.minor>=4}return!1}function Ps(){return Fo()&&!function(){var t,e=nt();if(!ve())return!0;switch(e){case"Chrome":return(t=Hr()).major&&t.major>0&&t.major<75;case"Firefox":return(t=Gr()).major<91;case"Safari":return(t=Wr()).major<13||t.major===13&&t.minor<1;default:return!0}}()}function Vo(){return ve().match(/Linux; Android/)}function js(){var t,e=ve(),n=e.match(/Mac/)&&(!V()&&typeof window<"u"&&(t=window)!==null&&t!==void 0&&(t=t.navigator)!==null&&t!==void 0&&t.maxTouchPoints?window.navigator.maxTouchPoints:0)>=5;return!!(e.match(/Mobi/)||e.match(/Android/)||n)||!!ve().match(/DailyAnd\//)||void 0}function nt(){if(typeof window<"u"){var t=ve();return Jo()?"Safari":t.indexOf("Edge")>-1?"Edge":t.match(/Chrome\//)?"Chrome":t.indexOf("Safari")>-1||qo()?"Safari":t.indexOf("Firefox")>-1?"Firefox":t.indexOf("MSIE")>-1||t.indexOf(".NET")>-1?"IE":"Unknown Browser"}}function vn(){switch(nt()){case"Chrome":return Hr();case"Safari":return Wr();case"Firefox":return Gr();case"Edge":return function(){var t=0,e=0;if(typeof window<"u"){var n=ve().match(/Edge\/(\d+).(\d+)/);if(n)try{t=parseInt(n[1]),e=parseInt(n[2])}catch{}}return{major:t,minor:e}}()}}function Hr(){var t=0,e=0,n=0,r=0,i=!1;if(typeof window<"u"){var s=ve(),a=s.match(/Chrome\/(\d+).(\d+).(\d+).(\d+)/);if(a)try{t=parseInt(a[1]),e=parseInt(a[2]),n=parseInt(a[3]),r=parseInt(a[4]),i=s.indexOf("OPR/")>-1}catch{}}return{major:t,minor:e,build:n,patch:r,opera:i}}function Jo(){return!!ve().match(/iPad|iPhone|iPod/i)&&Fo()}function qo(){return ve().indexOf("AppleWebKit/605.1.15")>-1}function Wr(){var t=0,e=0,n=0;if(typeof window<"u"){var r=ve().match(/Version\/(\d+).(\d+)(.(\d+))?/);if(r)try{t=parseInt(r[1]),e=parseInt(r[2]),n=parseInt(r[4])}catch{}else(Jo()||qo())&&(t=14,e=0,n=3)}return{major:t,minor:e,point:n}}function Gr(){var t=0,e=0;if(typeof window<"u"){var n=ve().match(/Firefox\/(\d+).(\d+)/);if(n)try{t=parseInt(n[1]),e=parseInt(n[2])}catch{}}return{major:t,minor:e}}var $o=function(){return fe(function t(){de(this,t)},[{key:"addListenerForMessagesFromCallMachine",value:function(t,e,n){Et()}},{key:"addListenerForMessagesFromDailyJs",value:function(t,e,n){Et()}},{key:"sendMessageToCallMachine",value:function(t,e,n,r){Et()}},{key:"sendMessageToDailyJs",value:function(t,e){Et()}},{key:"removeListener",value:function(t){Et()}}])}();function xs(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Kn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?xs(Object(n),!0).forEach(function(r){Me(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):xs(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function zo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(zo=function(){return!!t})()}var fu=function(){function t(){var e,n,r,i;return de(this,t),n=this,r=we(r=t),(e=Sn(n,zo()?Reflect.construct(r,[],we(n).constructor):r.apply(n,i)))._wrappedListeners={},e._messageCallbacks={},e}return kn(t,$o),fe(t,[{key:"addListenerForMessagesFromCallMachine",value:function(e,n,r){var i=this,s=function(a){if(a.data&&a.data.what==="iframe-call-message"&&(!a.data.callClientId||a.data.callClientId===n)&&(!a.data.from||a.data.from!=="module")){var c=Kn({},a.data);if(delete c.from,c.callbackStamp&&i._messageCallbacks[c.callbackStamp]){var l=c.callbackStamp;i._messageCallbacks[l].call(r,c),delete i._messageCallbacks[l]}delete c.what,delete c.callbackStamp,e.call(r,c)}};this._wrappedListeners[e]=s,window.addEventListener("message",s)}},{key:"addListenerForMessagesFromDailyJs",value:function(e,n,r){var i=function(s){var a;if(!(!s.data||s.data.what!==Wn||!s.data.action||s.data.from&&s.data.from!=="module"||s.data.callClientId&&n&&s.data.callClientId!==n||s!=null&&(a=s.data)!==null&&a!==void 0&&a.callFrameId)){var c=s.data;e.call(r,c)}};this._wrappedListeners[e]=i,window.addEventListener("message",i)}},{key:"sendMessageToCallMachine",value:function(e,n,r,i){if(!r)throw new Error("undefined callClientId. Are you trying to use a DailyCall instance previously destroyed?");var s=Kn({},e);if(s.what=Wn,s.from="module",s.callClientId=r,n){var a=En();this._messageCallbacks[a]=n,s.callbackStamp=a}var c=i?i.contentWindow:window,l=this._callMachineTargetOrigin(i);l&&c.postMessage(s,l)}},{key:"sendMessageToDailyJs",value:function(e,n){e.what=Wn,e.callClientId=n,e.from="embedded",window.postMessage(e,this._targetOriginFromWindowLocation())}},{key:"removeListener",value:function(e){var n=this._wrappedListeners[e];n&&(window.removeEventListener("message",n),delete this._wrappedListeners[e])}},{key:"forwardPackagedMessageToCallMachine",value:function(e,n,r){var i=Kn({},e);i.callClientId=r;var s=n?n.contentWindow:window,a=this._callMachineTargetOrigin(n);a&&s.postMessage(i,a)}},{key:"addListenerForPackagedMessagesFromCallMachine",value:function(e,n){var r=function(i){if(i.data&&i.data.what==="iframe-call-message"&&(!i.data.callClientId||i.data.callClientId===n)&&(!i.data.from||i.data.from!=="module")){var s=i.data;e(s)}};return this._wrappedListeners[e]=r,window.addEventListener("message",r),e}},{key:"removeListenerForPackagedMessagesFromCallMachine",value:function(e){var n=this._wrappedListeners[e];n&&(window.removeEventListener("message",n),delete this._wrappedListeners[e])}},{key:"_callMachineTargetOrigin",value:function(e){return e?e.src?new URL(e.src).origin:void 0:this._targetOriginFromWindowLocation()}},{key:"_targetOriginFromWindowLocation",value:function(){return window.location.protocol==="file:"?"*":window.location.origin}}])}();function Is(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Ho(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ho=function(){return!!t})()}var hu=function(){function t(){var e,n,r,i;return de(this,t),n=this,r=we(r=t),e=Sn(n,Ho()?Reflect.construct(r,[],we(n).constructor):r.apply(n,i)),global.callMachineToDailyJsEmitter=global.callMachineToDailyJsEmitter||new ir.EventEmitter,global.dailyJsToCallMachineEmitter=global.dailyJsToCallMachineEmitter||new ir.EventEmitter,e._wrappedListeners={},e._messageCallbacks={},e}return kn(t,$o),fe(t,[{key:"addListenerForMessagesFromCallMachine",value:function(e,n,r){this._addListener(e,global.callMachineToDailyJsEmitter,n,r,"received call machine message")}},{key:"addListenerForMessagesFromDailyJs",value:function(e,n,r){this._addListener(e,global.dailyJsToCallMachineEmitter,n,r,"received daily-js message")}},{key:"sendMessageToCallMachine",value:function(e,n,r){this._sendMessage(e,global.dailyJsToCallMachineEmitter,r,n,"sending message to call machine")}},{key:"sendMessageToDailyJs",value:function(e,n){this._sendMessage(e,global.callMachineToDailyJsEmitter,n,null,"sending message to daily-js")}},{key:"removeListener",value:function(e){var n=this._wrappedListeners[e];n&&(global.callMachineToDailyJsEmitter.removeListener("message",n),global.dailyJsToCallMachineEmitter.removeListener("message",n),delete this._wrappedListeners[e])}},{key:"_addListener",value:function(e,n,r,i,s){var a=this,c=function(l){if(l.callClientId===r){if(l.callbackStamp&&a._messageCallbacks[l.callbackStamp]){var f=l.callbackStamp;a._messageCallbacks[f].call(i,l),delete a._messageCallbacks[f]}e.call(i,l)}};this._wrappedListeners[e]=c,n.addListener("message",c)}},{key:"_sendMessage",value:function(e,n,r,i,s){var a=function(l){for(var f=1;f<arguments.length;f++){var h=arguments[f]!=null?arguments[f]:{};f%2?Is(Object(h),!0).forEach(function(v){Me(l,v,h[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(h)):Is(Object(h)).forEach(function(v){Object.defineProperty(l,v,Object.getOwnPropertyDescriptor(h,v))})}return l}({},e);if(a.callClientId=r,i){var c=En();this._messageCallbacks[c]=i,a.callbackStamp=c}n.emit("message",a)}}])}(),kr="replace",Er="shallow-merge",Ls=[kr,Er],pu=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.data,r=e.mergeStrategy,i=r===void 0?kr:r;de(this,t),t._validateMergeStrategy(i),t._validateData(n,i),this.mergeStrategy=i,this.data=n}return fe(t,[{key:"isNoOp",value:function(){return t.isNoOpUpdate(this.data,this.mergeStrategy)}}],[{key:"isNoOpUpdate",value:function(e,n){return Object.keys(e).length===0&&n===Er}},{key:"_validateMergeStrategy",value:function(e){if(!Ls.includes(e))throw Error("Unrecognized mergeStrategy provided. Options are: [".concat(Ls,"]"))}},{key:"_validateData",value:function(e,n){if(!function(c){if(c==null||q(c)!=="object")return!1;var l=Object.getPrototypeOf(c);return l==null||l===Object.prototype}(e))throw Error("Meeting session data must be a plain (map-like) object");var r;try{if(r=JSON.stringify(e),n===kr){var i=JSON.parse(r);se(i,e)||console.warn("The meeting session data provided will be modified when serialized.",i,e)}else if(n===Er){for(var s in e)if(Object.hasOwnProperty.call(e,s)&&e[s]!==void 0){var a=JSON.parse(JSON.stringify(e[s]));se(e[s],a)||console.warn("At least one key in the meeting session data provided will be modified when serialized.",a,e[s])}}}catch(c){throw Error("Meeting session data must be serializable to JSON: ".concat(c))}if(r.length>Ts)throw Error("Meeting session data is too large (".concat(r.length," characters). Maximum size suppported is ").concat(Ts,"."))}}])}();function Wo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Wo=function(){return!!t})()}function Tr(t){var e=typeof Map=="function"?new Map:void 0;return Tr=function(n){if(n===null||!function(i){try{return Function.toString.call(i).indexOf("[native code]")!==-1}catch{return typeof i=="function"}}(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(n))return e.get(n);e.set(n,r)}function r(){return function(i,s,a){if(Wo())return Reflect.construct.apply(null,arguments);var c=[null];c.push.apply(c,s);var l=new(i.bind.apply(i,c));return a&&jt(l,a.prototype),l}(n,arguments,we(this).constructor)}return r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),jt(r,n)},Tr(t)}function Go(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Go=function(){return!!t})()}function Rs(t){var e,n=(e=window._daily)===null||e===void 0?void 0:e.pendings;if(n){var r=n.indexOf(t);r!==-1&&n.splice(r,1)}}var mu=function(){return fe(function t(e){de(this,t),this._currentLoad=null,this._callClientId=e},[{key:"load",value:function(){var t,e=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;if(this.loaded)return window._daily.instances[this._callClientId].callMachine.reset(),void r(!0);t=this._callClientId,window._daily.pendings.push(t),this._currentLoad&&this._currentLoad.cancel(),this._currentLoad=new gu(n,function(){r(!1)},function(s,a){a||Rs(e._callClientId),i(s,a)}),this._currentLoad.start()}},{key:"cancel",value:function(){this._currentLoad&&this._currentLoad.cancel(),Rs(this._callClientId)}},{key:"loaded",get:function(){return this._currentLoad&&this._currentLoad.succeeded}}])}(),gu=function(){return fe(function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;de(this,t),this._attemptsRemaining=3,this._currentAttempt=null,this._dailyConfig=e,this._successCallback=n,this._failureCallback=r},[{key:"start",value:function(){var t=this;if(!this._currentAttempt){var e=function(n){t._currentAttempt.cancelled||(t._attemptsRemaining--,t._failureCallback(n,t._attemptsRemaining>0),t._attemptsRemaining<=0||setTimeout(function(){t._currentAttempt.cancelled||(t._currentAttempt=new Ds(t._dailyConfig,t._successCallback,e),t._currentAttempt.start())},3e3))};this._currentAttempt=new Ds(this._dailyConfig,this._successCallback,e),this._currentAttempt.start()}}},{key:"cancel",value:function(){this._currentAttempt&&this._currentAttempt.cancel()}},{key:"cancelled",get:function(){return this._currentAttempt&&this._currentAttempt.cancelled}},{key:"succeeded",get:function(){return this._currentAttempt&&this._currentAttempt.succeeded}}])}(),Qn=function(){function t(){return de(this,t),e=this,r=arguments,n=we(n=t),Sn(e,Go()?Reflect.construct(n,r||[],we(e).constructor):n.apply(e,r));var e,n,r}return kn(t,Tr(Error)),fe(t)}(),yn=2e4,Ds=function(){return fe(function e(n,r,i){de(this,e),this._loadAttemptImpl=V()||!n.avoidEval?new vu(n,r,i):new yu(n,r,i)},[{key:"start",value:(t=L(function*(){return this._loadAttemptImpl.start()}),function(){return t.apply(this,arguments)})},{key:"cancel",value:function(){this._loadAttemptImpl.cancel()}},{key:"cancelled",get:function(){return this._loadAttemptImpl.cancelled}},{key:"succeeded",get:function(){return this._loadAttemptImpl.succeeded}}]);var t}(),vu=function(){return fe(function i(s,a,c){de(this,i),this.cancelled=!1,this.succeeded=!1,this._networkTimedOut=!1,this._networkTimeout=null,this._iosCache=typeof iOSCallObjectBundleCache<"u"&&iOSCallObjectBundleCache,this._refetchHeaders=null,this._dailyConfig=s,this._successCallback=a,this._failureCallback=c},[{key:"start",value:(r=L(function*(){var i=dn(this._dailyConfig);!(yield this._tryLoadFromIOSCache(i))&&this._loadFromNetwork(i)}),function(){return r.apply(this,arguments)})},{key:"cancel",value:function(){clearTimeout(this._networkTimeout),this.cancelled=!0}},{key:"_tryLoadFromIOSCache",value:(n=L(function*(i){if(!this._iosCache)return!1;try{var s=yield this._iosCache.get(i);return!!this.cancelled||!!s&&(s.code?(Function('"use strict";'+s.code)(),this.succeeded=!0,this._successCallback(),!0):(this._refetchHeaders=s.refetchHeaders,!1))}catch{return!1}}),function(i){return n.apply(this,arguments)})},{key:"_loadFromNetwork",value:(e=L(function*(i){var s=this;this._networkTimeout=setTimeout(function(){s._networkTimedOut=!0,s._failureCallback({msg:"Timed out (>".concat(yn," ms) when loading call object bundle ").concat(i),type:"timeout"})},yn);try{var a=this._refetchHeaders?{headers:this._refetchHeaders}:{},c=yield fetch(i,a);if(clearTimeout(this._networkTimeout),this.cancelled||this._networkTimedOut)throw new Qn;var l=yield this._getBundleCodeFromResponse(i,c);if(this.cancelled)throw new Qn;Function('"use strict";'+l)(),this._iosCache&&this._iosCache.set(i,l,c.headers),this.succeeded=!0,this._successCallback()}catch(f){if(clearTimeout(this._networkTimeout),f instanceof Qn||this.cancelled||this._networkTimedOut)return;this._failureCallback({msg:"Failed to load call object bundle ".concat(i,": ").concat(f),type:f.message})}}),function(i){return e.apply(this,arguments)})},{key:"_getBundleCodeFromResponse",value:(t=L(function*(i,s){if(s.ok)return yield s.text();if(this._iosCache&&s.status===304)return(yield this._iosCache.renew(i,s.headers)).code;throw new Error("Received ".concat(s.status," response"))}),function(i,s){return t.apply(this,arguments)})}]);var t,e,n,r}(),yu=function(){return fe(function t(e,n,r){de(this,t),this.cancelled=!1,this.succeeded=!1,this._dailyConfig=e,this._successCallback=n,this._failureCallback=r,this._attemptId=En(),this._networkTimeout=null,this._scriptElement=null},[{key:"start",value:function(){window._dailyCallMachineLoadWaitlist||(window._dailyCallMachineLoadWaitlist=new Set);var t=dn(this._dailyConfig);(typeof document>"u"?"undefined":q(document))==="object"?this._startLoading(t):this._failureCallback({msg:"Call object bundle must be loaded in a DOM/web context",type:"missing context"})}},{key:"cancel",value:function(){this._stopLoading(),this.cancelled=!0}},{key:"_startLoading",value:function(t){var e=this;this._signUpForCallMachineLoadWaitlist(),this._networkTimeout=setTimeout(function(){e._stopLoading(),e._failureCallback({msg:"Timed out (>".concat(yn," ms) when loading call object bundle ").concat(t),type:"timeout"})},yn);var n=document.getElementsByTagName("head")[0],r=document.createElement("script");this._scriptElement=r,r.onload=function(){e._stopLoading(),e.succeeded=!0,e._successCallback()},r.onerror=function(i){e._stopLoading(),e._failureCallback({msg:"Failed to load call object bundle ".concat(i.target.src),type:i.message})},r.src=t,n.appendChild(r)}},{key:"_stopLoading",value:function(){this._withdrawFromCallMachineLoadWaitlist(),clearTimeout(this._networkTimeout),this._scriptElement&&(this._scriptElement.onload=null,this._scriptElement.onerror=null)}},{key:"_signUpForCallMachineLoadWaitlist",value:function(){window._dailyCallMachineLoadWaitlist.add(this._attemptId)}},{key:"_withdrawFromCallMachineLoadWaitlist",value:function(){window._dailyCallMachineLoadWaitlist.delete(this._attemptId)}}])}(),en=function(t,e,n){return _u(t.local,e,n)===!0},bu=function(t,e,n){return t.local.streams&&t.local.streams[e]&&t.local.streams[e].stream&&t.local.streams[e].stream["get".concat(n==="video"?"Video":"Audio","Tracks")]()[0]},lt=function(t,e,n,r){var i=wu(t,e,n,r);return i&&i.pendingTrack},_u=function(t,e,n){if(!t)return!1;var r=function(s){switch(s){case"avatar":return!0;case"staged":return s;default:return!!s}},i=t.public.subscribedTracks;return i&&i[e]?["cam-audio","cam-video","screen-video","screen-audio","rmpAudio","rmpVideo"].indexOf(n)===-1&&i[e].custom?[!0,"staged"].includes(i[e].custom)?r(i[e].custom):r(i[e].custom[n]):r(i[e][n]):!i||r(i.ALL)},wu=function(t,e,n,r){var i=Object.values(t.streams||{}).filter(function(s){return s.participantId===e&&s.type===n&&s.pendingTrack&&s.pendingTrack.kind===r}).sort(function(s,a){return new Date(a.starttime)-new Date(s.starttime)});return i&&i[0]},Su=function(t,e){var n=t.local.public.customTracks;if(n&&n[e])return n[e].track};function Ns(t,e){for(var n=e.getState(),r=0,i=["cam","screen"];r<i.length;r++)for(var s=i[r],a=0,c=["video","audio"];a<c.length;a++){var l=c[a],f=s==="cam"?l:"screen".concat(l.charAt(0).toUpperCase()+l.slice(1)),h=t.tracks[f];if(h){var v=t.local?bu(n,s,l):lt(n,t.session_id,s,l);h.state==="playable"&&(h.track=v),h.persistentTrack=v}}}function Fs(t,e){try{var n=e.getState();for(var r in t.tracks)if(!ku(r)){var i=t.tracks[r].kind;if(i){var s=t.tracks[r];if(s){var a=t.local?Su(n,r):lt(n,t.session_id,r,i);s.state==="playable"&&(t.tracks[r].track=a),s.persistentTrack=a}}else console.error("unknown type for custom track")}}catch(c){console.error(c)}}function ku(t){return["video","audio","screenVideo","screenAudio"].includes(t)}function Us(t,e,n){var r=n.getState();if(t.local){if(t.audio)try{t.audioTrack=r.local.streams.cam.stream.getAudioTracks()[0],t.audioTrack||(t.audio=!1)}catch{}if(t.video)try{t.videoTrack=r.local.streams.cam.stream.getVideoTracks()[0],t.videoTrack||(t.video=!1)}catch{}if(t.screen)try{t.screenVideoTrack=r.local.streams.screen.stream.getVideoTracks()[0],t.screenAudioTrack=r.local.streams.screen.stream.getAudioTracks()[0],t.screenVideoTrack||t.screenAudioTrack||(t.screen=!1)}catch{}}else{var i=!0;try{var s=r.participants[t.session_id];s&&s.public&&s.public.rtcType&&s.public.rtcType.impl==="peer-to-peer"&&s.private&&!["connected","completed"].includes(s.private.peeringState)&&(i=!1)}catch(h){console.error(h)}if(!i)return t.audio=!1,t.audioTrack=!1,t.video=!1,t.videoTrack=!1,t.screen=!1,void(t.screenTrack=!1);try{if(r.streams,t.audio&&en(r,t.session_id,"cam-audio")){var a=lt(r,t.session_id,"cam","audio");a&&(e&&e.audioTrack&&e.audioTrack.id===a.id?t.audioTrack=a:a.muted||(t.audioTrack=a)),t.audioTrack||(t.audio=!1)}if(t.video&&en(r,t.session_id,"cam-video")){var c=lt(r,t.session_id,"cam","video");c&&(e&&e.videoTrack&&e.videoTrack.id===c.id?t.videoTrack=c:c.muted||(t.videoTrack=c)),t.videoTrack||(t.video=!1)}if(t.screen&&en(r,t.session_id,"screen-audio")){var l=lt(r,t.session_id,"screen","audio");l&&(e&&e.screenAudioTrack&&e.screenAudioTrack.id===l.id?t.screenAudioTrack=l:l.muted||(t.screenAudioTrack=l))}if(t.screen&&en(r,t.session_id,"screen-video")){var f=lt(r,t.session_id,"screen","video");f&&(e&&e.screenVideoTrack&&e.screenVideoTrack.id===f.id?t.screenVideoTrack=f:f.muted||(t.screenVideoTrack=f))}t.screenVideoTrack||t.screenAudioTrack||(t.screen=!1)}catch(h){console.error("unexpected error matching up tracks",h)}}}function Eu(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(l,f){if(l){if(typeof l=="string")return Bs(l,f);var h={}.toString.call(l).slice(8,-1);return h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set"?Array.from(l):h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h)?Bs(l,f):void 0}}(t))||e){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
23
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,a=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var l=n.next();return a=l.done,l},e:function(l){c=!0,s=l},f:function(){try{a||n.return==null||n.return()}finally{if(c)throw s}}}}function Bs(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var Te=new Map,dt=null;function Tu(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(l,f){if(l){if(typeof l=="string")return Vs(l,f);var h={}.toString.call(l).slice(8,-1);return h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set"?Array.from(l):h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h)?Vs(l,f):void 0}}(t))||e){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
24
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,a=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var l=n.next();return a=l.done,l},e:function(l){c=!0,s=l},f:function(){try{a||n.return==null||n.return()}finally{if(c)throw s}}}}function Vs(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var Ce=new Map,At=null;function Cu(t){Ko()?function(e){Te.has(e)||(Te.set(e,{}),navigator.mediaDevices.enumerateDevices().then(function(n){Te.has(e)&&(Te.get(e).lastDevicesString=JSON.stringify(n),dt||(dt=function(){var r=L(function*(){var i,s=yield navigator.mediaDevices.enumerateDevices(),a=Eu(Te.keys());try{for(a.s();!(i=a.n()).done;){var c=i.value,l=JSON.stringify(s);l!==Te.get(c).lastDevicesString&&(Te.get(c).lastDevicesString=l,c(s))}}catch(f){a.e(f)}finally{a.f()}});return function(){return r.apply(this,arguments)}}(),navigator.mediaDevices.addEventListener("devicechange",dt)))}).catch(function(){}))}(t):function(e){Ce.has(e)||(Ce.set(e,{}),navigator.mediaDevices.enumerateDevices().then(function(n){Ce.has(e)&&(Ce.get(e).lastDevicesString=JSON.stringify(n),At||(At=setInterval(L(function*(){var r,i=yield navigator.mediaDevices.enumerateDevices(),s=Tu(Ce.keys());try{for(s.s();!(r=s.n()).done;){var a=r.value,c=JSON.stringify(i);c!==Ce.get(a).lastDevicesString&&(Ce.get(a).lastDevicesString=c,a(i))}}catch(l){s.e(l)}finally{s.f()}}),3e3)))}))}(t)}function Mu(t){Ko()?function(e){Te.has(e)&&(Te.delete(e),Te.size===0&&dt&&(navigator.mediaDevices.removeEventListener("devicechange",dt),dt=null))}(t):function(e){Ce.has(e)&&(Ce.delete(e),Ce.size===0&&At&&(clearInterval(At),At=null))}(t)}function Ko(){var t;return V()||((t=navigator.mediaDevices)===null||t===void 0?void 0:t.ondevicechange)!==void 0}var Ou=new Set;function Au(t,e){return t&&t.readyState==="live"&&!function(n,r){return n.muted&&!Ou.has(n.id)}(t)}function Js(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Re(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Js(Object(n),!0).forEach(function(r){Me(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Js(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var Ot=Object.freeze({VIDEO:"video",AUDIO:"audio",SCREEN_VIDEO:"screenVideo",SCREEN_AUDIO:"screenAudio",CUSTOM_VIDEO:"customVideo",CUSTOM_AUDIO:"customAudio"}),Pu=Object.freeze({PARTICIPANTS:"participants",STREAMING:"streaming",TRANSCRIPTION:"transcription"}),Pt=Object.values(Ot),qs=["v","a","sv","sa","cv","ca"];Object.freeze(Pt.reduce(function(t,e,n){return t[e]=qs[n],t},{})),Object.freeze(qs.reduce(function(t,e,n){return t[e]=Pt[n],t},{}));var ju=[Ot.VIDEO,Ot.AUDIO,Ot.SCREEN_VIDEO,Ot.SCREEN_AUDIO],$s=Object.values(Pu),zs=["p","s","t"];Object.freeze($s.reduce(function(t,e,n){return t[e]=zs[n],t},{})),Object.freeze(zs.reduce(function(t,e,n){return t[e]=$s[n],t},{}));var Qo=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.base,r=e.byUserId,i=e.byParticipantId;de(this,t),this.base=n,this.byUserId=r,this.byParticipantId=i}return fe(t,[{key:"clone",value:function(){var e=new t;if(this.base instanceof ee?e.base=this.base.clone():e.base=this.base,this.byUserId!==void 0)for(var n in e.byUserId={},this.byUserId){var r=this.byUserId[n];e.byUserId[n]=r instanceof ee?r.clone():r}if(this.byParticipantId!==void 0)for(var i in e.byParticipantId={},this.byParticipantId){var s=this.byParticipantId[i];e.byParticipantId[i]=s instanceof ee?s.clone():s}return e}},{key:"toJSONObject",value:function(){var e={};if(typeof this.base=="boolean"?e.base=this.base:this.base instanceof ee&&(e.base=this.base.toJSONObject()),this.byUserId!==void 0)for(var n in e.byUserId={},this.byUserId){var r=this.byUserId[n];e.byUserId[n]=r instanceof ee?r.toJSONObject():r}if(this.byParticipantId!==void 0)for(var i in e.byParticipantId={},this.byParticipantId){var s=this.byParticipantId[i];e.byParticipantId[i]=s instanceof ee?s.toJSONObject():s}return e}},{key:"toMinifiedJSONObject",value:function(){var e={};if(this.base!==void 0&&(typeof this.base=="boolean"?e.b=this.base:e.b=this.base.toMinifiedJSONObject()),this.byUserId!==void 0)for(var n in e.u={},this.byUserId){var r=this.byUserId[n];e.u[n]=typeof r=="boolean"?r:r.toMinifiedJSONObject()}if(this.byParticipantId!==void 0)for(var i in e.p={},this.byParticipantId){var s=this.byParticipantId[i];e.p[i]=typeof s=="boolean"?s:s.toMinifiedJSONObject()}return e}},{key:"normalize",value:function(){return this.base instanceof ee&&(this.base=this.base.normalize()),this.byUserId&&(this.byUserId=Object.fromEntries(Object.entries(this.byUserId).map(function(e){var n=re(e,2),r=n[0],i=n[1];return[r,i instanceof ee?i.normalize():i]}))),this.byParticipantId&&(this.byParticipantId=Object.fromEntries(Object.entries(this.byParticipantId).map(function(e){var n=re(e,2),r=n[0],i=n[1];return[r,i instanceof ee?i.normalize():i]}))),this}}],[{key:"fromJSONObject",value:function(e){var n,r,i;if(e.base!==void 0&&(n=typeof e.base=="boolean"?e.base:ee.fromJSONObject(e.base)),e.byUserId!==void 0)for(var s in r={},e.byUserId){var a=e.byUserId[s];r[s]=typeof a=="boolean"?a:ee.fromJSONObject(a)}if(e.byParticipantId!==void 0)for(var c in i={},e.byParticipantId){var l=e.byParticipantId[c];i[c]=typeof l=="boolean"?l:ee.fromJSONObject(l)}return new t({base:n,byUserId:r,byParticipantId:i})}},{key:"fromMinifiedJSONObject",value:function(e){var n,r,i;if(e.b!==void 0&&(n=typeof e.b=="boolean"?e.b:ee.fromMinifiedJSONObject(e.b)),e.u!==void 0)for(var s in r={},e.u){var a=e.u[s];r[s]=typeof a=="boolean"?a:ee.fromMinifiedJSONObject(a)}if(e.p!==void 0)for(var c in i={},e.p){var l=e.p[c];i[c]=typeof l=="boolean"?l:ee.fromMinifiedJSONObject(l)}return new t({base:n,byUserId:r,byParticipantId:i})}},{key:"validateJSONObject",value:function(e){if(q(e)!=="object")return[!1,"canReceive must be an object"];for(var n=["base","byUserId","byParticipantId"],r=0,i=Object.keys(e);r<i.length;r++){var s=i[r];if(!n.includes(s))return[!1,"canReceive can only contain keys (".concat(n.join(", "),")")];if(s==="base"){var a=re(ee.validateJSONObject(e.base,!0),2),c=a[0],l=a[1];if(!c)return[!1,l]}else{if(q(e[s])!=="object")return[!1,"invalid (non-object) value for field '".concat(s,"' in canReceive")];for(var f=0,h=Object.values(e[s]);f<h.length;f++){var v=h[f],k=re(ee.validateJSONObject(v),2),E=k[0],y=k[1];if(!E)return[!1,y]}}}return[!0]}}])}(),ee=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.video,r=e.audio,i=e.screenVideo,s=e.screenAudio,a=e.customVideo,c=e.customAudio;de(this,t),this.video=n,this.audio=r,this.screenVideo=i,this.screenAudio=s,this.customVideo=a,this.customAudio=c}return fe(t,[{key:"clone",value:function(){var e=new t;return this.video!==void 0&&(e.video=this.video),this.audio!==void 0&&(e.audio=this.audio),this.screenVideo!==void 0&&(e.screenVideo=this.screenVideo),this.screenAudio!==void 0&&(e.screenAudio=this.screenAudio),this.customVideo!==void 0&&(e.customVideo=Re({},this.customVideo)),this.customAudio!==void 0&&(e.customAudio=Re({},this.customAudio)),e}},{key:"toJSONObject",value:function(){var e={};return this.video!==void 0&&(e.video=this.video),this.audio!==void 0&&(e.audio=this.audio),this.screenVideo!==void 0&&(e.screenVideo=this.screenVideo),this.screenAudio!==void 0&&(e.screenAudio=this.screenAudio),this.customVideo!==void 0&&(e.customVideo=Re({},this.customVideo)),this.customAudio!==void 0&&(e.customAudio=Re({},this.customAudio)),e}},{key:"toMinifiedJSONObject",value:function(){var e={};return this.video!==void 0&&(e.v=this.video),this.audio!==void 0&&(e.a=this.audio),this.screenVideo!==void 0&&(e.sv=this.screenVideo),this.screenAudio!==void 0&&(e.sa=this.screenAudio),this.customVideo!==void 0&&(e.cv=Re({},this.customVideo)),this.customAudio!==void 0&&(e.ca=Re({},this.customAudio)),e}},{key:"normalize",value:function(){function e(n,r){return n&&Object.keys(n).length===1&&n["*"]===r}return!(this.video!==!0||this.audio!==!0||this.screenVideo!==!0||this.screenAudio!==!0||!e(this.customVideo,!0)||!e(this.customAudio,!0))||(this.video!==!1||this.audio!==!1||this.screenVideo!==!1||this.screenAudio!==!1||!e(this.customVideo,!1)||!e(this.customAudio,!1))&&this}}],[{key:"fromBoolean",value:function(e){return new t({video:e,audio:e,screenVideo:e,screenAudio:e,customVideo:{"*":e},customAudio:{"*":e}})}},{key:"fromJSONObject",value:function(e){return new t({video:e.video,audio:e.audio,screenVideo:e.screenVideo,screenAudio:e.screenAudio,customVideo:e.customVideo!==void 0?Re({},e.customVideo):void 0,customAudio:e.customAudio!==void 0?Re({},e.customAudio):void 0})}},{key:"fromMinifiedJSONObject",value:function(e){return new t({video:e.v,audio:e.a,screenVideo:e.sv,screenAudio:e.sa,customVideo:e.cv,customAudio:e.ca})}},{key:"validateJSONObject",value:function(e,n){if(typeof e=="boolean")return[!0];if(q(e)!=="object")return[!1,"invalid (non-object, non-boolean) value in canReceive"];for(var r=Object.keys(e),i=0,s=r;i<s.length;i++){var a=s[i];if(!Pt.includes(a))return[!1,"invalid media type '".concat(a,"' in canReceive")];if(ju.includes(a)){if(typeof e[a]!="boolean")return[!1,"invalid (non-boolean) value for media type '".concat(a,"' in canReceive")]}else{if(q(e[a])!=="object")return[!1,"invalid (non-object) value for media type '".concat(a,"' in canReceive")];for(var c=0,l=Object.values(e[a]);c<l.length;c++)if(typeof l[c]!="boolean")return[!1,"invalid (non-boolean) value for entry within '".concat(a,"' in canReceive")];if(n&&e[a]["*"]===void 0)return[!1,`canReceive "base" permission must specify "*" as an entry within '`.concat(a,"'")]}}return n&&r.length!==Pt.length?[!1,'canReceive "base" permission must specify all media types: '.concat(Pt.join(", ")," (or be set to a boolean shorthand)")]:[!0]}}])}(),xu=["result"],Iu=["preserveIframe"];function Hs(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function I(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Hs(Object(n),!0).forEach(function(r){Me(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Hs(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Xo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Xo=function(){return!!t})()}function Ws(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(l,f){if(l){if(typeof l=="string")return Gs(l,f);var h={}.toString.call(l).slice(8,-1);return h==="Object"&&l.constructor&&(h=l.constructor.name),h==="Map"||h==="Set"?Array.from(l):h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h)?Gs(l,f):void 0}}(t))||e){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
25
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,a=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var l=n.next();return a=l.done,l},e:function(l){c=!0,s=l},f:function(){try{a||n.return==null||n.return()}finally{if(c)throw s}}}}function Gs(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var $e={},Ks="video",Lu="voice",Qs=V()?{data:{}}:{data:{},topology:"none"},Xs={present:0,hidden:0},Yo={maxBitrate:{min:1e5,max:25e5},maxFramerate:{min:1,max:30},scaleResolutionDownBy:{min:1,max:8}},Xn=Object.keys(Yo),Ys=["state","volume","simulcastEncodings"],Zs={androidInCallNotification:{title:"string",subtitle:"string",iconName:"string",disableForCustomOverride:"boolean"},disableAutoDeviceManagement:{audio:"boolean",video:"boolean"}},bn={id:{iconPath:"string",iconPathDarkMode:"string",label:"string",tooltip:"string",visualState:"'default' | 'sidebar-open' | 'active'"}},Cr={id:{allow:"string",controlledBy:"'*' | 'owners' | string[]",csp:"string",iconURL:"string",label:"string",loading:"'eager' | 'lazy'",location:"'main' | 'sidebar'",name:"string",referrerPolicy:"string",sandbox:"string",src:"string",srcdoc:"string",shared:"string[] | 'owners' | boolean"}},ze={customIntegrations:{validate:oa,help:ia()},customTrayButtons:{validate:sa,help:"customTrayButtons should be a dictionary of the type ".concat(JSON.stringify(bn))},url:{validate:function(t){return typeof t=="string"},help:"url should be a string"},baseUrl:{validate:function(t){return typeof t=="string"},help:"baseUrl should be a string"},token:{validate:function(t){return typeof t=="string"},help:"token should be a string",queryString:"t"},dailyConfig:{validate:function(t,e){try{return e.validateDailyConfig(t),!0}catch(n){console.error("Failed to validate dailyConfig",n)}return!1},help:"Unsupported dailyConfig. Check error logs for detailed info."},reactNativeConfig:{validate:function(t){return aa(t,Zs)},help:"reactNativeConfig should look like ".concat(JSON.stringify(Zs),", all fields optional")},lang:{validate:function(t){return["da","de","en-us","en","es","fi","fr","it","jp","ka","nl","no","pl","pt","pt-BR","ru","sv","tr","user"].includes(t)},help:"language not supported. Options are: da, de, en-us, en, es, fi, fr, it, jp, ka, nl, no, pl, pt, pt-BR, ru, sv, tr, user"},userName:!0,userData:{validate:function(t){try{return Zo(t),!0}catch(e){return console.error(e),!1}},help:"invalid userData type provided"},startVideoOff:!0,startAudioOff:!0,allowLocalVideo:!0,allowLocalAudio:!0,activeSpeakerMode:!0,showLeaveButton:!0,showLocalVideo:!0,showParticipantsBar:!0,showFullscreenButton:!0,showUserNameChangeUI:!0,iframeStyle:!0,customLayout:!0,cssFile:!0,cssText:!0,bodyClass:!0,videoSource:{validate:function(t,e){if(typeof t=="boolean")return e._preloadCache.allowLocalVideo=t,!0;var n;if(t instanceof MediaStreamTrack)e._sharedTracks.videoTrack=t,n={customTrack:xe};else{if(delete e._sharedTracks.videoTrack,typeof t!="string")return console.error("videoSource must be a MediaStreamTrack, boolean, or a string"),!1;n={deviceId:t}}return e._updatePreloadCacheInputSettings({video:{settings:n}},!1),!0}},audioSource:{validate:function(t,e){if(typeof t=="boolean")return e._preloadCache.allowLocalAudio=t,!0;var n;if(t instanceof MediaStreamTrack)e._sharedTracks.audioTrack=t,n={customTrack:xe};else{if(delete e._sharedTracks.audioTrack,typeof t!="string")return console.error("audioSource must be a MediaStreamTrack, boolean, or a string"),!1;n={deviceId:t}}return e._updatePreloadCacheInputSettings({audio:{settings:n}},!1),!0}},subscribeToTracksAutomatically:{validate:function(t,e){return e._preloadCache.subscribeToTracksAutomatically=t,!0}},theme:{validate:function(t){var e=["accent","accentText","background","backgroundAccent","baseText","border","mainAreaBg","mainAreaBgAccent","mainAreaText","supportiveText"],n=function(r){for(var i=0,s=Object.keys(r);i<s.length;i++){var a=s[i];if(!e.includes(a))return console.error('unsupported color "'.concat(a,'". Valid colors: ').concat(e.join(", "))),!1;if(!r[a].match(/^#[0-9a-f]{6}|#[0-9a-f]{3}$/i))return console.error("".concat(a,' theme color should be provided in valid hex color format. Received: "').concat(r[a],'"')),!1}return!0};return q(t)==="object"&&("light"in t&&"dark"in t||"colors"in t)?"light"in t&&"dark"in t?"colors"in t.light?"colors"in t.dark?n(t.light.colors)&&n(t.dark.colors):(console.error('Dark theme is missing "colors" property.',t),!1):(console.error('Light theme is missing "colors" property.',t),!1):n(t.colors):(console.error('Theme must contain either both "light" and "dark" properties, or "colors".',t),!1)},help:"unsupported theme configuration. Check error logs for detailed info."},layoutConfig:{validate:function(t){if("grid"in t){var e=t.grid;if("maxTilesPerPage"in e){if(!Number.isInteger(e.maxTilesPerPage))return console.error("grid.maxTilesPerPage should be an integer. You passed ".concat(e.maxTilesPerPage,".")),!1;if(e.maxTilesPerPage>49)return console.error("grid.maxTilesPerPage can't be larger than 49 without sacrificing browser performance. Please contact us at https://www.daily.co/contact to talk about your use case."),!1}if("minTilesPerPage"in e){if(!Number.isInteger(e.minTilesPerPage))return console.error("grid.minTilesPerPage should be an integer. You passed ".concat(e.minTilesPerPage,".")),!1;if(e.minTilesPerPage<1)return console.error("grid.minTilesPerPage can't be lower than 1."),!1;if("maxTilesPerPage"in e&&e.minTilesPerPage>e.maxTilesPerPage)return console.error("grid.minTilesPerPage can't be higher than grid.maxTilesPerPage."),!1}}return!0},help:"unsupported layoutConfig. Check error logs for detailed info."},receiveSettings:{validate:function(t){return ea(t,{allowAllParticipantsKey:!1})},help:ra({allowAllParticipantsKey:!1})},sendSettings:{validate:function(t,e){return!!function(n,r){try{return r.validateUpdateSendSettings(n),!0}catch(i){return console.error("Failed to validate send settings",i),!1}}(t,e)&&(e._preloadCache.sendSettings=t,!0)},help:"Invalid sendSettings provided. Check error logs for detailed info."},inputSettings:{validate:function(t,e){var n;return!!ta(t)&&(e._inputSettings||(e._inputSettings={}),na(t,(n=e.properties)===null||n===void 0?void 0:n.dailyConfig,e._sharedTracks),e._updatePreloadCacheInputSettings(t,!0),!0)},help:Mr()},layout:{validate:function(t){return t==="custom-v1"||t==="browser"||t==="none"},help:'layout may only be set to "custom-v1"',queryString:"layout"},emb:{queryString:"emb"},embHref:{queryString:"embHref"},dailyJsVersion:{queryString:"dailyJsVersion"},proxy:{queryString:"proxy"},strictMode:!0,allowMultipleCallInstances:!0},tn={styles:{validate:function(t){for(var e in t)if(e!=="cam"&&e!=="screen")return!1;if(t.cam){for(var n in t.cam)if(n!=="div"&&n!=="video")return!1}if(t.screen){for(var r in t.screen)if(r!=="div"&&r!=="video")return!1}return!0},help:"styles format should be a subset of: { cam: {div: {}, video: {}}, screen: {div: {}, video: {}} }"},setSubscribedTracks:{validate:function(t,e){if(e._preloadCache.subscribeToTracksAutomatically)return!1;var n=[!0,!1,"staged"];if(n.includes(t)||!V()&&t==="avatar")return!0;var r=["audio","video","screenAudio","screenVideo","rmpAudio","rmpVideo"],i=function(s){var a=arguments.length>1&&arguments[1]!==void 0&&arguments[1];for(var c in s)if(c==="custom"){if(!n.includes(s[c])&&!i(s[c],!0))return!1}else{var l=!a&&!r.includes(c),f=!n.includes(s[c]);if(l||f)return!1}return!0};return i(t)},help:"setSubscribedTracks cannot be used when setSubscribeToTracksAutomatically is enabled, and should be of the form: "+"true".concat(V()?"":" | 'avatar'"," | false | 'staged' | { [audio: true|false|'staged'], [video: true|false|'staged'], [screenAudio: true|false|'staged'], [screenVideo: true|false|'staged'] }")},setAudio:!0,setVideo:!0,setScreenShare:{validate:function(t){return t===!1},help:"setScreenShare must be false, as it's only meant for stopping remote participants' screen shares"},eject:!0,updatePermissions:{validate:function(t){for(var e=0,n=Object.entries(t);e<n.length;e++){var r=re(n[e],2),i=r[0],s=r[1];switch(i){case"hasPresence":if(typeof s!="boolean")return!1;break;case"canSend":if(s instanceof Set||s instanceof Array||Array.isArray(s)){var a,c=["video","audio","screenVideo","screenAudio","customVideo","customAudio"],l=Ws(s);try{for(l.s();!(a=l.n()).done;){var f=a.value;if(!c.includes(f))return!1}}catch(w){l.e(w)}finally{l.f()}}else if(typeof s!="boolean")return!1;(s instanceof Array||Array.isArray(s))&&(t.canSend=new Set(s));break;case"canReceive":var h=re(Qo.validateJSONObject(s),2),v=h[0],k=h[1];if(!v)return console.error(k),!1;break;case"canAdmin":if(s instanceof Set||s instanceof Array||Array.isArray(s)){var E,y=["participants","streaming","transcription"],m=Ws(s);try{for(m.s();!(E=m.n()).done;){var b=E.value;if(!y.includes(b))return!1}}catch(w){m.e(w)}finally{m.f()}}else if(typeof s!="boolean")return!1;(s instanceof Array||Array.isArray(s))&&(t.canAdmin=new Set(s));break;default:return!1}}return!0},help:"updatePermissions can take hasPresence, canSend, canReceive, and canAdmin permissions. hasPresence must be a boolean. canSend can be a boolean or an Array or Set of media types (video, audio, screenVideo, screenAudio, customVideo, customAudio). canReceive must be an object specifying base, byUserId, and/or byParticipantId fields (see documentation for more details). canAdmin can be a boolean or an Array or Set of admin types (participants, streaming, transcription)."}};Promise.any||(Promise.any=function(){var t=L(function*(e){return new Promise(function(n,r){var i=[];e.forEach(function(s){return Promise.resolve(s).then(function(a){n(a)}).catch(function(a){i.push(a),i.length===e.length&&r(i)})})})});return function(e){return t.apply(this,arguments)}}());var Ru=function(){function t(o){var d,u,p,g,S,M,O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(de(this,t),p=this,g=we(g=t),Me(u=Sn(p,Xo()?Reflect.construct(g,[],we(p).constructor):g.apply(p,S)),"startListeningForDeviceChanges",function(){Cu(u.handleDeviceChange)}),Me(u,"stopListeningForDeviceChanges",function(){Mu(u.handleDeviceChange)}),Me(u,"handleDeviceChange",function(F){F=F.map(function(B){return JSON.parse(JSON.stringify(B))}),u.emitDailyJSEvent({action:"available-devices-updated",availableDevices:F})}),Me(u,"handleNativeAppStateChange",function(){var F=L(function*(B){if(B==="destroyed")return console.warn("App has been destroyed before leaving the meeting. Cleaning up all the resources!"),void(yield u.destroy());var ke=B==="active";u.disableReactNativeAutoDeviceManagement("video")||(ke?u.camUnmutedBeforeLosingNativeActiveState&&u.setLocalVideo(!0):(u.camUnmutedBeforeLosingNativeActiveState=u.localVideo(),u.camUnmutedBeforeLosingNativeActiveState&&u.setLocalVideo(!1)))});return function(B){return F.apply(this,arguments)}}()),Me(u,"handleNativeAudioFocusChange",function(F){u.disableReactNativeAutoDeviceManagement("audio")||(u._hasNativeAudioFocus=F,u.toggleParticipantAudioBasedOnNativeAudioFocus(),u._hasNativeAudioFocus?u.micUnmutedBeforeLosingNativeAudioFocus&&u.setLocalAudio(!0):(u.micUnmutedBeforeLosingNativeAudioFocus=u.localAudio(),u.setLocalAudio(!1)))}),Me(u,"handleNativeSystemScreenCaptureStop",function(){u.stopScreenShare()}),u.strictMode=O.strictMode===void 0||O.strictMode,u.allowMultipleCallInstances=(d=O.allowMultipleCallInstances)!==null&&d!==void 0&&d,Object.keys($e).length&&(u._logDuplicateInstanceAttempt(),!u.allowMultipleCallInstances)){if(u.strictMode)throw new Error("Duplicate DailyIframe instances are not allowed");console.warn("Using strictMode: false to allow multiple call instances is now deprecated. Set `allowMultipleCallInstances: true`")}if(window._daily||(window._daily={pendings:[],instances:{}}),u.callClientId=En(),$e[(M=u).callClientId]=M,window._daily.instances[u.callClientId]={},u._sharedTracks={},window._daily.instances[u.callClientId].tracks=u._sharedTracks,O.dailyJsVersion=t.version(),u._iframe=o,u._callObjectMode=O.layout==="none"&&!u._iframe,u._preloadCache={subscribeToTracksAutomatically:!0,outputDeviceId:null,inputSettings:null,sendSettings:null,videoTrackForNetworkConnectivityTest:null,videoTrackForConnectionQualityTest:null},O.showLocalVideo!==void 0?u._callObjectMode?console.error("showLocalVideo is not available in call object mode"):u._showLocalVideo=!!O.showLocalVideo:u._showLocalVideo=!0,O.showParticipantsBar!==void 0?u._callObjectMode?console.error("showParticipantsBar is not available in call object mode"):u._showParticipantsBar=!!O.showParticipantsBar:u._showParticipantsBar=!0,O.customIntegrations!==void 0?u._callObjectMode?console.error("customIntegrations is not available in call object mode"):u._customIntegrations=O.customIntegrations:u._customIntegrations={},O.customTrayButtons!==void 0?u._callObjectMode?console.error("customTrayButtons is not available in call object mode"):u._customTrayButtons=O.customTrayButtons:u._customTrayButtons={},O.activeSpeakerMode!==void 0?u._callObjectMode?console.error("activeSpeakerMode is not available in call object mode"):u._activeSpeakerMode=!!O.activeSpeakerMode:u._activeSpeakerMode=!1,O.receiveSettings?u._callObjectMode?u._receiveSettings=O.receiveSettings:console.error("receiveSettings is only available in call object mode"):u._receiveSettings={},u.validateProperties(O),u.properties=I({},O),u._inputSettings||(u._inputSettings={}),u._callObjectLoader=u._callObjectMode?new mu(u.callClientId):null,u._callState=ms,u._isPreparingToJoin=!1,u._accessState={access:zn},u._meetingSessionSummary={},u._finalSummaryOfPrevSession={},u._meetingSessionState=er(Qs,u._callObjectMode),u._nativeInCallAudioMode=Ks,u._participants={},u._isScreenSharing=!1,u._participantCounts=Xs,u._rmpPlayerState={},u._waitingParticipants={},u._network={threshold:"good",quality:100,networkState:"unknown",stats:{}},u._activeSpeaker={},u._localAudioLevel=0,u._isLocalAudioLevelObserverRunning=!1,u._remoteParticipantsAudioLevel={},u._isRemoteParticipantsAudioLevelObserverRunning=!1,u._maxAppMessageSize=Hn,u._messageChannel=V()?new hu:new fu,u._iframe&&(u._iframe.requestFullscreen?u._iframe.addEventListener("fullscreenchange",function(){document.fullscreenElement===u._iframe?(u.emitDailyJSEvent({action:Xt}),u.sendMessageToCallMachine({action:Xt})):(u.emitDailyJSEvent({action:Yt}),u.sendMessageToCallMachine({action:Yt}))}):u._iframe.webkitRequestFullscreen&&u._iframe.addEventListener("webkitfullscreenchange",function(){document.webkitFullscreenElement===u._iframe?(u.emitDailyJSEvent({action:Xt}),u.sendMessageToCallMachine({action:Xt})):(u.emitDailyJSEvent({action:Yt}),u.sendMessageToCallMachine({action:Yt}))})),V()){var P=u.nativeUtils();P.addAudioFocusChangeListener&&P.removeAudioFocusChangeListener&&P.addAppStateChangeListener&&P.removeAppStateChangeListener&&P.addSystemScreenCaptureStopListener&&P.removeSystemScreenCaptureStopListener||console.warn("expected (add|remove)(AudioFocusChange|AppActiveStateChange|SystemScreenCaptureStop)Listener to be available in React Native"),u._hasNativeAudioFocus=!0,P.addAudioFocusChangeListener(u.handleNativeAudioFocusChange),P.addAppStateChangeListener(u.handleNativeAppStateChange),P.addSystemScreenCaptureStopListener(u.handleNativeSystemScreenCaptureStop)}return u._callObjectMode&&u.startListeningForDeviceChanges(),u._messageChannel.addListenerForMessagesFromCallMachine(u.handleMessageFromCallMachine,u.callClientId,u),u}return kn(t,qt),fe(t,[{key:"destroy",value:(ci=L(function*(){var o;try{yield this.leave()}catch{}var d=this._iframe;if(d){var u=d.parentElement;u&&u.removeChild(d)}if(this._messageChannel.removeListener(this.handleMessageFromCallMachine),V()){var p=this.nativeUtils();p.removeAudioFocusChangeListener(this.handleNativeAudioFocusChange),p.removeAppStateChangeListener(this.handleNativeAppStateChange),p.removeSystemScreenCaptureStopListener(this.handleNativeSystemScreenCaptureStop)}this._callObjectMode&&this.stopListeningForDeviceChanges(),this.resetMeetingDependentVars(),this._destroyed=!0,this.emitDailyJSEvent({action:"call-instance-destroyed"}),delete $e[this.callClientId],!((o=window)===null||o===void 0||(o=o._daily)===null||o===void 0)&&o.instances&&delete window._daily.instances[this.callClientId],this.strictMode&&(this.callClientId=void 0)}),function(){return ci.apply(this,arguments)})},{key:"isDestroyed",value:function(){return!!this._destroyed}},{key:"loadCss",value:function(o){var d=o.bodyClass,u=o.cssFile,p=o.cssText;return U(),this.sendMessageToCallMachine({action:"load-css",cssFile:this.absoluteUrl(u),bodyClass:d,cssText:p}),this}},{key:"iframe",value:function(){return U(),this._iframe}},{key:"meetingState",value:function(){return this._callState}},{key:"accessState",value:function(){return ye(this._callObjectMode,"accessState()"),this._accessState}},{key:"participants",value:function(){return this._participants}},{key:"participantCounts",value:function(){return this._participantCounts}},{key:"waitingParticipants",value:function(){return ye(this._callObjectMode,"waitingParticipants()"),this._waitingParticipants}},{key:"validateParticipantProperties",value:function(o,d){for(var u in d){if(!tn[u])throw new Error("unrecognized updateParticipant property ".concat(u));if(tn[u].validate&&!tn[u].validate(d[u],this,this._participants[o]))throw new Error(tn[u].help)}}},{key:"updateParticipant",value:function(o,d){return this._participants.local&&this._participants.local.session_id===o&&(o="local"),o&&d&&(this.validateParticipantProperties(o,d),this.sendMessageToCallMachine({action:"update-participant",id:o,properties:d})),this}},{key:"updateParticipants",value:function(o){var d=this._participants.local&&this._participants.local.session_id;for(var u in o)u===d&&(u="local"),u&&o[u]&&this.validateParticipantProperties(u,o[u]);return this.sendMessageToCallMachine({action:"update-participants",participants:o}),this}},{key:"updateWaitingParticipant",value:(ai=L(function*(){var o=this,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(ye(this._callObjectMode,"updateWaitingParticipant()"),H(this._callState,"updateWaitingParticipant()"),typeof d!="string"||q(u)!=="object")throw new Error("updateWaitingParticipant() must take an id string and a updates object");return new Promise(function(p,g){o.sendMessageToCallMachine({action:"daily-method-update-waiting-participant",id:d,updates:u},function(S){S.error&&g(S.error),S.id||g(new Error("unknown error in updateWaitingParticipant()")),p({id:S.id})})})}),function(){return ai.apply(this,arguments)})},{key:"updateWaitingParticipants",value:(oi=L(function*(){var o=this,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ye(this._callObjectMode,"updateWaitingParticipants()"),H(this._callState,"updateWaitingParticipants()"),q(d)!=="object")throw new Error("updateWaitingParticipants() must take a mapping between ids and update objects");return new Promise(function(u,p){o.sendMessageToCallMachine({action:"daily-method-update-waiting-participants",updatesById:d},function(g){g.error&&p(g.error),g.ids||p(new Error("unknown error in updateWaitingParticipants()")),u({ids:g.ids})})})}),function(){return oi.apply(this,arguments)})},{key:"requestAccess",value:(si=L(function*(){var o=this,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},u=d.access,p=u===void 0?{level:al}:u,g=d.name,S=g===void 0?"":g;return ye(this._callObjectMode,"requestAccess()"),H(this._callState,"requestAccess()"),new Promise(function(M,O){o.sendMessageToCallMachine({action:"daily-method-request-access",access:p,name:S},function(P){P.error&&O(P.error),P.access||O(new Error("unknown error in requestAccess()")),M({access:P.access,granted:P.granted})})})}),function(){return si.apply(this,arguments)})},{key:"localAudio",value:function(){return this._participants.local?!["blocked","off"].includes(this._participants.local.tracks.audio.state):null}},{key:"localVideo",value:function(){return this._participants.local?!["blocked","off"].includes(this._participants.local.tracks.video.state):null}},{key:"setLocalAudio",value:function(o){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return"forceDiscardTrack"in d&&(V()?(console.warn("forceDiscardTrack option not supported in React Native; ignoring"),d={}):o&&(console.warn("forceDiscardTrack option only supported when calling setLocalAudio(false); ignoring"),d={})),this.sendMessageToCallMachine({action:"local-audio",state:o,options:d}),this}},{key:"localScreenAudio",value:function(){return this._participants.local?!["blocked","off"].includes(this._participants.local.tracks.screenAudio.state):null}},{key:"localScreenVideo",value:function(){return this._participants.local?!["blocked","off"].includes(this._participants.local.tracks.screenVideo.state):null}},{key:"updateScreenShare",value:function(o){if(this._isScreenSharing)return this.sendMessageToCallMachine({action:"local-screen-update",options:o}),this;console.warn("There is no screen share in progress. Try calling startScreenShare first.")}},{key:"setLocalVideo",value:function(o){return this.sendMessageToCallMachine({action:"local-video",state:o}),this}},{key:"_setAllowLocalAudio",value:function(o){if(this._preloadCache.allowLocalAudio=o,this._callMachineInitialized)return this.sendMessageToCallMachine({action:"set-allow-local-audio",state:o}),this}},{key:"_setAllowLocalVideo",value:function(o){if(this._preloadCache.allowLocalVideo=o,this._callMachineInitialized)return this.sendMessageToCallMachine({action:"set-allow-local-video",state:o}),this}},{key:"getReceiveSettings",value:(ii=L(function*(o){var d=this,u=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).showInheritedValues,p=u!==void 0&&u;if(ye(this._callObjectMode,"getReceiveSettings()"),!this._callMachineInitialized)return this._receiveSettings;switch(q(o)){case"string":return new Promise(function(g){d.sendMessageToCallMachine({action:"get-single-participant-receive-settings",id:o,showInheritedValues:p},function(S){g(S.receiveSettings)})});case"undefined":return this._receiveSettings;default:throw new Error('first argument to getReceiveSettings() must be a participant id (or "base"), or there should be no arguments')}}),function(o){return ii.apply(this,arguments)})},{key:"updateReceiveSettings",value:(ri=L(function*(o){var d=this;if(ye(this._callObjectMode,"updateReceiveSettings()"),!ea(o,{allowAllParticipantsKey:!0}))throw new Error(ra({allowAllParticipantsKey:!0}));return H(this._callState,"updateReceiveSettings()","To specify receive settings earlier, use the receiveSettings config property."),new Promise(function(u){d.sendMessageToCallMachine({action:"update-receive-settings",receiveSettings:o},function(p){u({receiveSettings:p.receiveSettings})})})}),function(o){return ri.apply(this,arguments)})},{key:"_prepInputSettingsForSharing",value:function(o,d){if(o){var u={};if(o.audio){var p,g,S;o.audio.settings&&(!Object.keys(o.audio.settings).length&&d||(u.audio={settings:I({},o.audio.settings)})),d&&(p=u.audio)!==null&&p!==void 0&&(p=p.settings)!==null&&p!==void 0&&p.customTrack&&(u.audio.settings={customTrack:this._sharedTracks.audioTrack});var M=((g=o.audio.processor)===null||g===void 0?void 0:g.type)==="none"&&((S=o.audio.processor)===null||S===void 0?void 0:S._isDefaultWhenNone);if(o.audio.processor&&!M){var O=I({},o.audio.processor);delete O._isDefaultWhenNone,u.audio=I(I({},u.audio),{},{processor:O})}}if(o.video){var P,F,B;o.video.settings&&(!Object.keys(o.video.settings).length&&d||(u.video={settings:I({},o.video.settings)})),d&&(P=u.video)!==null&&P!==void 0&&(P=P.settings)!==null&&P!==void 0&&P.customTrack&&(u.video.settings={customTrack:this._sharedTracks.videoTrack});var ke=((F=o.video.processor)===null||F===void 0?void 0:F.type)==="none"&&((B=o.video.processor)===null||B===void 0?void 0:B._isDefaultWhenNone);if(o.video.processor&&!ke){var Be=I({},o.video.processor);delete Be._isDefaultWhenNone,u.video=I(I({},u.video),{},{processor:Be})}}return u}}},{key:"getInputSettings",value:function(){var o=this;return U(),new Promise(function(d){d(o._getInputSettings())})}},{key:"_getInputSettings",value:function(){var o,d,u,p,g,S,M={processor:{type:"none",_isDefaultWhenNone:!0}};this._inputSettings?(o=((u=this._inputSettings)===null||u===void 0?void 0:u.video)||M,d=((p=this._inputSettings)===null||p===void 0?void 0:p.audio)||M):(o=((g=this._preloadCache)===null||g===void 0||(g=g.inputSettings)===null||g===void 0?void 0:g.video)||M,d=((S=this._preloadCache)===null||S===void 0||(S=S.inputSettings)===null||S===void 0?void 0:S.audio)||M);var O={audio:d,video:o};return this._prepInputSettingsForSharing(O,!0)}},{key:"_updatePreloadCacheInputSettings",value:function(o,d){var u=this._inputSettings||{},p={};if(o.video){var g,S,M;p.video={},o.video.settings?(p.video.settings={},d||o.video.settings.customTrack||(M=u.video)===null||M===void 0||!M.settings?p.video.settings=o.video.settings:p.video.settings=I(I({},u.video.settings),o.video.settings),Object.keys(p.video.settings).length||delete p.video.settings):(g=u.video)!==null&&g!==void 0&&g.settings&&(p.video.settings=u.video.settings),o.video.processor?p.video.processor=o.video.processor:(S=u.video)!==null&&S!==void 0&&S.processor&&(p.video.processor=u.video.processor)}else u.video&&(p.video=u.video);if(o.audio){var O,P,F;p.audio={},o.audio.settings?(p.audio.settings={},d||o.audio.settings.customTrack||(F=u.audio)===null||F===void 0||!F.settings?p.audio.settings=o.audio.settings:p.audio.settings=I(I({},u.audio.settings),o.audio.settings),Object.keys(p.audio.settings).length||delete p.audio.settings):(O=u.audio)!==null&&O!==void 0&&O.settings&&(p.audio.settings=u.audio.settings),o.audio.processor?p.audio.processor=o.audio.processor:(P=u.audio)!==null&&P!==void 0&&P.processor&&(p.audio.processor=u.audio.processor)}else u.audio&&(p.audio=u.audio);this._maybeUpdateInputSettings(p)}},{key:"_devicesFromInputSettings",value:function(o){var d,u,p=(o==null||(d=o.video)===null||d===void 0||(d=d.settings)===null||d===void 0?void 0:d.deviceId)||null,g=(o==null||(u=o.audio)===null||u===void 0||(u=u.settings)===null||u===void 0?void 0:u.deviceId)||null,S=this._preloadCache.outputDeviceId||null;return{camera:p?{deviceId:p}:{},mic:g?{deviceId:g}:{},speaker:S?{deviceId:S}:{}}}},{key:"updateInputSettings",value:(ni=L(function*(o){var d=this;return U(),ta(o)?o.video||o.audio?(na(o,this.properties.dailyConfig,this._sharedTracks),this._callObjectMode&&!this._callMachineInitialized?(this._updatePreloadCacheInputSettings(o,!0),this._getInputSettings()):new Promise(function(u,p){d.sendMessageToCallMachine({action:"update-input-settings",inputSettings:o},function(g){if(g.error)p(g.error);else{if(g.returnPreloadCache)return d._updatePreloadCacheInputSettings(o,!0),void u(d._getInputSettings());d._maybeUpdateInputSettings(g.inputSettings),u(d._prepInputSettingsForSharing(g.inputSettings,!0))}})})):this._getInputSettings():(console.error(Mr()),Promise.reject(Mr()))}),function(o){return ni.apply(this,arguments)})},{key:"setBandwidth",value:function(o){var d=o.kbs,u=o.trackConstraints;if(U(),this._callMachineInitialized)return this.sendMessageToCallMachine({action:"set-bandwidth",kbs:d,trackConstraints:u}),this}},{key:"getDailyLang",value:function(){var o=this;if(U(),this._callMachineInitialized)return new Promise(function(d){o.sendMessageToCallMachine({action:"get-daily-lang"},function(u){delete u.action,delete u.callbackStamp,d(u)})})}},{key:"setDailyLang",value:function(o){return U(),this.sendMessageToCallMachine({action:"set-daily-lang",lang:o}),this}},{key:"setProxyUrl",value:function(o){return this.sendMessageToCallMachine({action:"set-proxy-url",proxyUrl:o}),this}},{key:"setIceConfig",value:function(o){return this.sendMessageToCallMachine({action:"set-ice-config",iceConfig:o}),this}},{key:"meetingSessionSummary",value:function(){return[qe,Le].includes(this._callState)?this._finalSummaryOfPrevSession:this._meetingSessionSummary}},{key:"getMeetingSession",value:(ti=L(function*(){var o=this;return console.warn("getMeetingSession() is deprecated: use meetingSessionSummary(), which will return immediately"),H(this._callState,"getMeetingSession()"),new Promise(function(d){o.sendMessageToCallMachine({action:"get-meeting-session"},function(u){delete u.action,delete u.callbackStamp,d(u)})})}),function(){return ti.apply(this,arguments)})},{key:"meetingSessionState",value:function(){return H(this._callState,"meetingSessionState"),this._meetingSessionState}},{key:"setMeetingSessionData",value:function(o){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"replace";ye(this._callObjectMode,"setMeetingSessionData()"),H(this._callState,"setMeetingSessionData");try{(function(u,p){new pu({data:u,mergeStrategy:p})})(o,d)}catch(u){throw console.error(u),u}try{this.sendMessageToCallMachine({action:"set-session-data",data:o,mergeStrategy:d})}catch(u){throw new Error("Error setting meeting session data: ".concat(u))}}},{key:"setUserName",value:function(o,d){var u=this;return this.properties.userName=o,new Promise(function(p){u.sendMessageToCallMachine({action:"set-user-name",name:o??"",thisMeetingOnly:V()||!!d&&!!d.thisMeetingOnly},function(g){delete g.action,delete g.callbackStamp,p(g)})})}},{key:"setUserData",value:(ei=L(function*(o){var d=this;try{Zo(o)}catch(u){throw console.error(u),u}if(this.properties.userData=o,this._callMachineInitialized)return new Promise(function(u){try{d.sendMessageToCallMachine({action:"set-user-data",userData:o},function(p){delete p.action,delete p.callbackStamp,u(p)})}catch(p){throw new Error("Error setting user data: ".concat(p))}})}),function(o){return ei.apply(this,arguments)})},{key:"validateAudioLevelInterval",value:function(o){if(o&&(o<100||typeof o!="number"))throw new Error("The interval must be a number greater than or equal to 100 milliseconds.")}},{key:"startLocalAudioLevelObserver",value:function(o){var d=this;if(typeof AudioWorkletNode>"u"&&!V())throw new Error("startLocalAudioLevelObserver() is not supported on this browser");if(this.validateAudioLevelInterval(o),this._callMachineInitialized)return this._isLocalAudioLevelObserverRunning=!0,new Promise(function(u,p){d.sendMessageToCallMachine({action:"start-local-audio-level-observer",interval:o},function(g){d._isLocalAudioLevelObserverRunning=!g.error,g.error?p({error:g.error}):u()})});this._preloadCache.localAudioLevelObserver={enabled:!0,interval:o}}},{key:"isLocalAudioLevelObserverRunning",value:function(){return this._isLocalAudioLevelObserverRunning}},{key:"stopLocalAudioLevelObserver",value:function(){this._preloadCache.localAudioLevelObserver=null,this._localAudioLevel=0,this._isLocalAudioLevelObserverRunning=!1,this.sendMessageToCallMachine({action:"stop-local-audio-level-observer"})}},{key:"startRemoteParticipantsAudioLevelObserver",value:function(o){var d=this;if(this.validateAudioLevelInterval(o),this._callMachineInitialized)return this._isRemoteParticipantsAudioLevelObserverRunning=!0,new Promise(function(u,p){d.sendMessageToCallMachine({action:"start-remote-participants-audio-level-observer",interval:o},function(g){d._isRemoteParticipantsAudioLevelObserverRunning=!g.error,g.error?p({error:g.error}):u()})});this._preloadCache.remoteParticipantsAudioLevelObserver={enabled:!0,interval:o}}},{key:"isRemoteParticipantsAudioLevelObserverRunning",value:function(){return this._isRemoteParticipantsAudioLevelObserverRunning}},{key:"stopRemoteParticipantsAudioLevelObserver",value:function(){this._preloadCache.remoteParticipantsAudioLevelObserver=null,this._remoteParticipantsAudioLevel={},this._isRemoteParticipantsAudioLevelObserverRunning=!1,this.sendMessageToCallMachine({action:"stop-remote-participants-audio-level-observer"})}},{key:"startCamera",value:(Zr=L(function*(){var o=this,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ye(this._callObjectMode,"startCamera()"),Yn(this._callState,this._isPreparingToJoin,"startCamera()","Did you mean to use setLocalAudio() and/or setLocalVideo() instead?"),this.needsLoad())try{yield this.load(d)}catch(u){return Promise.reject(u)}else{if(this._didPreAuth){if(d.url&&d.url!==this.properties.url)return console.error("url in startCamera() is different than the one used in preAuth()"),Promise.reject();if(d.token&&d.token!==this.properties.token)return console.error("token in startCamera() is different than the one used in preAuth()"),Promise.reject()}this.validateProperties(d),this.properties=I(I({},this.properties),d)}return new Promise(function(u){o._preloadCache.inputSettings=o._prepInputSettingsForSharing(o._inputSettings,!1),o.sendMessageToCallMachine({action:"start-camera",properties:ct(o.properties,o.callClientId),preloadCache:ct(o._preloadCache,o.callClientId)},function(p){u({camera:p.camera,mic:p.mic,speaker:p.speaker})})})}),function(){return Zr.apply(this,arguments)})},{key:"validateCustomTrack",value:function(o,d,u){if(u&&u.length>50)throw new Error("Custom track `trackName` must not be more than 50 characters");if(d&&d!=="music"&&d!=="speech"&&!(d instanceof Object))throw new Error("Custom track `mode` must be either `music` | `speech` | `DailyMicAudioModeSettings` or `undefined`");if(u&&["cam-audio","cam-video","screen-video","screen-audio","rmpAudio","rmpVideo","customVideoDefaults"].includes(u))throw new Error("Custom track `trackName` must not match a track name already used by daily: cam-audio, cam-video, customVideoDefaults, screen-video, screen-audio, rmpAudio, rmpVideo");if(!(o instanceof MediaStreamTrack))throw new Error("Custom tracks provided must be instances of MediaStreamTrack")}},{key:"startCustomTrack",value:function(){var o=this,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{track,mode,trackName,ignoreAudioLevel};return U(),H(this._callState,"startCustomTrack()"),this.validateCustomTrack(d.track,d.mode,d.trackName),new Promise(function(u,p){o._sharedTracks.customTrack=d.track,d.track=xe,o.sendMessageToCallMachine({action:"start-custom-track",properties:d},function(g){g.error?p({error:g.error}):u(g.mediaTag)})})}},{key:"stopCustomTrack",value:function(o){var d=this;return U(),H(this._callState,"stopCustomTrack()"),new Promise(function(u){d.sendMessageToCallMachine({action:"stop-custom-track",mediaTag:o},function(p){u(p.mediaTag)})})}},{key:"setCamera",value:function(o){var d=this;return Tt(),nn(this._callMachineInitialized,"setCamera()"),new Promise(function(u){d.sendMessageToCallMachine({action:"set-camera",cameraDeviceId:o},function(p){u({device:p.device})})})}},{key:"setAudioDevice",value:(Yr=L(function*(o){return Tt(),this.nativeUtils().setAudioDevice(o),{deviceId:yield this.nativeUtils().getAudioDevice()}}),function(o){return Yr.apply(this,arguments)})},{key:"cycleCamera",value:function(){var o=this,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new Promise(function(u){o.sendMessageToCallMachine({action:"cycle-camera",properties:d},function(p){u({device:p.device})})})}},{key:"cycleMic",value:function(){var o=this;return U(),new Promise(function(d){o.sendMessageToCallMachine({action:"cycle-mic"},function(u){d({device:u.device})})})}},{key:"getCameraFacingMode",value:function(){var o=this;return Tt(),new Promise(function(d){o.sendMessageToCallMachine({action:"get-camera-facing-mode"},function(u){d(u.facingMode)})})}},{key:"setInputDevicesAsync",value:(at=L(function*(o){var d=this,u=o.audioDeviceId,p=o.videoDeviceId,g=o.audioSource,S=o.videoSource;if(U(),g!==void 0&&(u=g),S!==void 0&&(p=S),typeof u=="boolean"&&(this._setAllowLocalAudio(u),u=void 0),typeof p=="boolean"&&(this._setAllowLocalVideo(p),p=void 0),!u&&!p)return yield this.getInputDevices();var M={};return u&&(u instanceof MediaStreamTrack?(this._sharedTracks.audioTrack=u,u=xe,M.audio={settings:{customTrack:u}}):(delete this._sharedTracks.audioTrack,M.audio={settings:{deviceId:u}})),p&&(p instanceof MediaStreamTrack?(this._sharedTracks.videoTrack=p,p=xe,M.video={settings:{customTrack:p}}):(delete this._sharedTracks.videoTrack,M.video={settings:{deviceId:p}})),this._callObjectMode&&this.needsLoad()?(this._updatePreloadCacheInputSettings(M,!1),this._devicesFromInputSettings(this._inputSettings)):new Promise(function(O){d.sendMessageToCallMachine({action:"set-input-devices",audioDeviceId:u,videoDeviceId:p},function(P){if(delete P.action,delete P.callbackStamp,P.returnPreloadCache)return d._updatePreloadCacheInputSettings(M,!1),void O(d._devicesFromInputSettings(d._inputSettings));O(P)})})}),function(o){return at.apply(this,arguments)})},{key:"setOutputDeviceAsync",value:(ot=L(function*(o){var d=this,u=o.outputDeviceId;return U(),u&&(this._preloadCache.outputDeviceId=u),this._callObjectMode&&this.needsLoad()?this._devicesFromInputSettings(this._inputSettings):new Promise(function(p){d.sendMessageToCallMachine({action:"set-output-device",outputDeviceId:u},function(g){delete g.action,delete g.callbackStamp,g.returnPreloadCache?p(d._devicesFromInputSettings(d._inputSettings)):p(g)})})}),function(o){return ot.apply(this,arguments)})},{key:"getInputDevices",value:(Oe=L(function*(){var o=this;return this._callObjectMode&&this.needsLoad()?this._devicesFromInputSettings(this._inputSettings):new Promise(function(d){o.sendMessageToCallMachine({action:"get-input-devices"},function(u){u.returnPreloadCache?d(o._devicesFromInputSettings(o._inputSettings)):d({camera:u.camera,mic:u.mic,speaker:u.speaker})})})}),function(){return Oe.apply(this,arguments)})},{key:"nativeInCallAudioMode",value:function(){return Tt(),this._nativeInCallAudioMode}},{key:"setNativeInCallAudioMode",value:function(o){if(Tt(),[Ks,Lu].includes(o)){if(o!==this._nativeInCallAudioMode)return this._nativeInCallAudioMode=o,!this.disableReactNativeAutoDeviceManagement("audio")&&an(this._callState,this._isPreparingToJoin)&&this.nativeUtils().setAudioMode(this._nativeInCallAudioMode),this}else console.error("invalid in-call audio mode specified: ",o)}},{key:"preAuth",value:(X=L(function*(){var o=this,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ye(this._callObjectMode,"preAuth()"),Yn(this._callState,this._isPreparingToJoin,"preAuth()"),this.needsLoad()&&(yield this.load(d)),!d.url)throw new Error("preAuth() requires at least a url to be provided");return this.validateProperties(d),this.properties=I(I({},this.properties),d),new Promise(function(u,p){o._preloadCache.inputSettings=o._prepInputSettingsForSharing(o._inputSettings,!1),o.sendMessageToCallMachine({action:"daily-method-preauth",properties:ct(o.properties,o.callClientId),preloadCache:ct(o._preloadCache,o.callClientId)},function(g){return g.error?p(g.error):g.access?(o._didPreAuth=!0,void u({access:g.access})):p(new Error("unknown error in preAuth()"))})})}),function(){return X.apply(this,arguments)})},{key:"load",value:(J=L(function*(o){var d=this;if(this.needsLoad()){if(this._destroyed&&(this._logUseAfterDestroy(),this.strictMode))throw new Error("Use after destroy");if(o&&(this.validateProperties(o),this.properties=I(I({},this.properties),o)),!this._callObjectMode&&!this.properties.url)throw new Error("can't load iframe meeting because url property isn't set");return this._updateCallState(gs),this.emitDailyJSEvent({action:pl}),this._callObjectMode?new Promise(function(u,p){d._callObjectLoader.cancel();var g=Date.now();d._callObjectLoader.load(d.properties.dailyConfig,function(S){d._bundleLoadTime=S?"no-op":Date.now()-g,d._updateCallState(vs),S&&d.emitDailyJSEvent({action:bs}),u()},function(S,M){if(d.emitDailyJSEvent({action:ml}),!M){d._updateCallState(Le),d.resetMeetingDependentVars();var O={action:Es,errorMsg:S.msg,error:{type:"connection-error",msg:"Failed to load call object bundle.",details:{on:"load",sourceError:S,bundleUrl:dn(d.properties.dailyConfig)}}};d._maybeSendToSentry(O),d.emitDailyJSEvent(O),p(S.msg)}})}):(this._iframe.src=wo(this.assembleMeetingUrl(),this.properties.dailyConfig),new Promise(function(u,p){d._loadedCallback=function(g){d._callState!==Le?(d._updateCallState(vs),(d.properties.cssFile||d.properties.cssText)&&d.loadCss(d.properties),u()):p(g)}}))}}),function(o){return J.apply(this,arguments)})},{key:"join",value:(R=L(function*(){var o=this,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this._testCallInProgress&&this.stopTestCallQuality();var u=!1;if(this.needsLoad()){this.updateIsPreparingToJoin(!0);try{yield this.load(d)}catch(p){return this.updateIsPreparingToJoin(!1),Promise.reject(p)}}else{if(u=!(!this.properties.cssFile&&!this.properties.cssText),this._didPreAuth){if(d.url&&d.url!==this.properties.url)return console.error("url in join() is different than the one used in preAuth()"),this.updateIsPreparingToJoin(!1),Promise.reject();if(d.token&&d.token!==this.properties.token)return console.error("token in join() is different than the one used in preAuth()"),this.updateIsPreparingToJoin(!1),Promise.reject()}if(d.url&&!this._callObjectMode&&d.url&&d.url!==this.properties.url)return console.error("url in join() is different than the one used in load() (".concat(this.properties.url," -> ").concat(d.url,")")),this.updateIsPreparingToJoin(!1),Promise.reject();this.validateProperties(d),this.properties=I(I({},this.properties),d)}return d.showLocalVideo!==void 0&&(this._callObjectMode?console.error("showLocalVideo is not available in callObject mode"):this._showLocalVideo=!!d.showLocalVideo),d.showParticipantsBar!==void 0&&(this._callObjectMode?console.error("showParticipantsBar is not available in callObject mode"):this._showParticipantsBar=!!d.showParticipantsBar),this._callState===He||this._callState===_r?(console.warn("already joined meeting, call leave() before joining again"),void this.updateIsPreparingToJoin(!1)):(this._updateCallState(_r,!1),this.emitDailyJSEvent({action:yl}),this._preloadCache.inputSettings=this._prepInputSettingsForSharing(this._inputSettings||{},!1),this.sendMessageToCallMachine({action:"join-meeting",properties:ct(this.properties,this.callClientId),preloadCache:ct(this._preloadCache,this.callClientId)}),new Promise(function(p,g){o._joinedCallback=function(S,M){if(o._callState!==Le){if(o._updateCallState(He),S)for(var O in S){if(o._callObjectMode){var P=o._callMachine().store;Ns(S[O],P),Fs(S[O],P),Us(S[O],o._participants[O],P)}o._participants[O]=I({},S[O]),o.toggleParticipantAudioBasedOnNativeAudioFocus()}u&&o.loadCss(o.properties),p(S)}else g(M)}}))}),function(){return R.apply(this,arguments)})},{key:"leave",value:(j=L(function*(){var o=this;return this._testCallInProgress&&this.stopTestCallQuality(),new Promise(function(d){o._callState===qe||o._callState===Le?d():o._callObjectLoader&&!o._callObjectLoader.loaded?(o._callObjectLoader.cancel(),o._updateCallState(qe),o.resetMeetingDependentVars(),o.emitDailyJSEvent({action:qe}),d()):(o._resolveLeave=d,o.sendMessageToCallMachine({action:"leave-meeting"}))})}),function(){return j.apply(this,arguments)})},{key:"startScreenShare",value:(x=L(function*(){var o=this,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(nn(this._callMachineInitialized,"startScreenShare()"),d.screenVideoSendSettings&&this._validateVideoSendSettings("screenVideo",d.screenVideoSendSettings),d.mediaStream&&(this._sharedTracks.screenMediaStream=d.mediaStream,d.mediaStream=xe),typeof DailyNativeUtils<"u"&&DailyNativeUtils.isIOS!==void 0&&DailyNativeUtils.isIOS){var u=this.nativeUtils();if(yield u.isScreenBeingCaptured())return void this.emitDailyJSEvent({action:ks,type:"screen-share-error",errorMsg:"Could not start the screen sharing. The screen is already been captured!"});u.setSystemScreenCaptureStartCallback(function(){u.setSystemScreenCaptureStartCallback(null),o.sendMessageToCallMachine({action:Cs,captureOptions:d})}),u.presentSystemScreenCapturePrompt()}else this.sendMessageToCallMachine({action:Cs,captureOptions:d})}),function(){return x.apply(this,arguments)})},{key:"stopScreenShare",value:function(){nn(this._callMachineInitialized,"stopScreenShare()"),this.sendMessageToCallMachine({action:"local-screen-stop"})}},{key:"startRecording",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},d=o.type;if(d&&d!=="cloud"&&d!=="raw-tracks"&&d!=="local")throw new Error("invalid type: ".concat(d,", allowed values 'cloud', 'raw-tracks', or 'local'"));this.sendMessageToCallMachine(I({action:"local-recording-start"},o))}},{key:"updateRecording",value:function(o){var d=o.layout,u=d===void 0?{preset:"default"}:d,p=o.instanceId;this.sendMessageToCallMachine({action:"daily-method-update-recording",layout:u,instanceId:p})}},{key:"stopRecording",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(I({action:"local-recording-stop"},o))}},{key:"startLiveStreaming",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(I({action:"daily-method-start-live-streaming"},o))}},{key:"updateLiveStreaming",value:function(o){var d=o.layout,u=d===void 0?{preset:"default"}:d,p=o.instanceId;this.sendMessageToCallMachine({action:"daily-method-update-live-streaming",layout:u,instanceId:p})}},{key:"addLiveStreamingEndpoints",value:function(o){var d=o.endpoints,u=o.instanceId;this.sendMessageToCallMachine({action:Ms,endpointsOp:ou,endpoints:d,instanceId:u})}},{key:"removeLiveStreamingEndpoints",value:function(o){var d=o.endpoints,u=o.instanceId;this.sendMessageToCallMachine({action:Ms,endpointsOp:au,endpoints:d,instanceId:u})}},{key:"stopLiveStreaming",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(I({action:"daily-method-stop-live-streaming"},o))}},{key:"validateDailyConfig",value:function(o){o.camSimulcastEncodings&&(console.warn("camSimulcastEncodings is deprecated. Use sendSettings, found in DailyCallOptions, to provide camera simulcast settings."),this.validateSimulcastEncodings(o.camSimulcastEncodings)),o.screenSimulcastEncodings&&console.warn("screenSimulcastEncodings is deprecated. Use sendSettings, found in DailyCallOptions, to provide screen simulcast settings."),Vo()&&o.noAutoDefaultDeviceChange&&console.warn("noAutoDefaultDeviceChange is not supported on Android, and will be ignored.")}},{key:"validateSimulcastEncodings",value:function(o){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,u=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(o){if(!(o instanceof Array||Array.isArray(o)))throw new Error("encodings must be an Array");if(!ro(o.length,1,3))throw new Error("encodings must be an Array with between 1 to ".concat(3," layers"));for(var p=0;p<o.length;p++){var g=o[p];for(var S in this._validateEncodingLayerHasValidProperties(g),g)if(Xn.includes(S)){if(typeof g[S]!="number")throw new Error("".concat(S," must be a number"));if(d){var M=d[S],O=M.min,P=M.max;if(!ro(g[S],O,P))throw new Error("".concat(S," value not in range. valid range: ").concat(O," to ").concat(P))}}else if(!["active","scalabilityMode"].includes(S))throw new Error("Invalid key ".concat(S,", valid keys are:")+Object.values(Xn));if(u&&!g.hasOwnProperty("maxBitrate"))throw new Error("maxBitrate is not specified")}}}},{key:"startRemoteMediaPlayer",value:(A=L(function*(o){var d=this,u=o.url,p=o.settings,g=p===void 0?{state:wr.PLAY}:p;try{(function(S){if(typeof S!="string")throw new Error('url parameter must be "string" type')})(u),no(g),function(S){for(var M in S)if(!Ys.includes(M))throw new Error("Invalid key ".concat(M,", valid keys are: ").concat(Ys));S.simulcastEncodings&&this.validateSimulcastEncodings(S.simulcastEncodings,Yo,!0)}(g)}catch(S){throw console.error("invalid argument Error: ".concat(S)),console.error(`startRemoteMediaPlayer arguments must be of the form:
|
|
27
26
|
{ url: "playback url",
|
|
28
27
|
settings?:
|
|
29
|
-
{state: "play"|"pause", simulcastEncodings?: [{}] } }`),
|
|
28
|
+
{state: "play"|"pause", simulcastEncodings?: [{}] } }`),S}return new Promise(function(S,M){d.sendMessageToCallMachine({action:"daily-method-start-remote-media-player",url:u,settings:g},function(O){O.error?M({error:O.error,errorMsg:O.errorMsg}):S({session_id:O.session_id,remoteMediaPlayerState:{state:O.state,settings:O.settings}})})})}),function(o){return A.apply(this,arguments)})},{key:"stopRemoteMediaPlayer",value:(C=L(function*(o){var d=this;if(typeof o!="string")throw new Error(" remotePlayerID must be of type string");return new Promise(function(u,p){d.sendMessageToCallMachine({action:"daily-method-stop-remote-media-player",session_id:o},function(g){g.error?p({error:g.error,errorMsg:g.errorMsg}):u()})})}),function(o){return C.apply(this,arguments)})},{key:"updateRemoteMediaPlayer",value:(w=L(function*(o){var d=this,u=o.session_id,p=o.settings;try{no(p)}catch(g){throw console.error("invalid argument Error: ".concat(g)),console.error(`updateRemoteMediaPlayer arguments must be of the form:
|
|
30
29
|
session_id: "participant session",
|
|
31
|
-
{ settings?: {state: "play"|"pause"} }`),m}return new Promise(function(m,b){u.sendMessageToCallMachine({action:"daily-method-update-remote-media-player",session_id:d,settings:g},function(E){E.error?b({error:E.error,errorMsg:E.errorMsg}):m({session_id:E.session_id,remoteMediaPlayerState:{state:E.state,settings:E.settings}})})})}),function(o){return M.apply(this,arguments)})},{key:"startTranscription",value:function(o){this.sendMessageToCallMachine(A({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(A({action:"dialout-start"},o),function(b){b.error?m(b.error):g(b)})})}),function(o){return T.apply(this,arguments)})},{key:"stopDialOut",value:function(o){var u=this;return q(this._callState,"stopDialOut()"),new Promise(function(d,g){u.sendMessageToCallMachine(A({action:"dialout-stop"},o),function(m){m.error?g(m.error):d(m)})})}},{key:"sipCallTransfer",value:(w=O(function*(o){var u=this;if(q(this._callState,"sipCallTransfer()"),!o)throw new Error("sipCallTransfer() requires a sessionId and toEndPoint");return o.useSipRefer=!1,bs(o,"sipCallTransfer"),new Promise(function(d,g){u.sendMessageToCallMachine(A({action:es},o),function(m){m.error?g(m.error):d(m)})})}),function(o){return w.apply(this,arguments)})},{key:"sipRefer",value:(y=O(function*(o){var u=this;if(q(this._callState,"sipRefer()"),!o)throw new Error("sessionId and toEndPoint are mandatory parameter");return o.useSipRefer=!0,bs(o,"sipRefer"),new Promise(function(d,g){u.sendMessageToCallMachine(A({action:es},o),function(m){m.error?g(m.error):d(m)})})}),function(o){return y.apply(this,arguments)})},{key:"sendDTMF",value:(k=O(function*(o){var u=this;return q(this._callState,"sendDTMF()"),function(d){var g=d.sessionId,m=d.tones;if(!g||!m)throw new Error("sessionId and tones are mandatory parameter");if(typeof g!="string"||typeof m!="string")throw new Error("sessionId and tones should be of string type");if(m.length>20)throw new Error("tones string must be upto 20 characters");var b=/[^0-9A-D*#]/g,E=m.match(b);if(E&&E[0])throw new Error("".concat(E[0]," is not valid DTMF tone"))}(o),new Promise(function(d,g){u.sendMessageToCallMachine(A({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(A({stats:d.stats},o._network))})})}},{key:"testWebsocketConnectivity",value:(_=O(function*(){var o=this;if(Dn(this._testCallInProgress,"testWebsocketConnectivity()"),this.needsLoad())try{yield this.load()}catch(u){return Promise.reject(u)}return new Promise(function(u,d){o.sendMessageToCallMachine({action:"test-websocket-connectivity"},function(g){g.error?d(g.error):u(g.results)})})}),function(){return _.apply(this,arguments)})},{key:"abortTestWebsocketConnectivity",value:function(){this.sendMessageToCallMachine({action:"abort-test-websocket-connectivity"})}},{key:"_validateVideoTrackForNetworkTests",value:function(o){return o?o instanceof MediaStreamTrack?!!Ol(o)||(console.error("Video track is not playable. This test needs a live video track."),!1):(console.error("Video track needs to be of type `MediaStreamTrack`."),!1):(console.error("Missing video track. You must provide a video track in order to run this test."),!1)}},{key:"testCallQuality",value:(f=O(function*(){var o=this;D(),ce(this._callObjectMode,"testCallQuality()"),Ht(this._callMachineInitialized,"testCallQuality()",null,!0),xn(this._callState,this._isPreparingToJoin,"testCallQuality()");var u=this._testCallAlreadyInProgress,d=function(m){u||(o._testCallInProgress=m)};if(d(!0),this.needsLoad())try{var g=this._callState;yield this.load(),this._callState=g}catch(m){return d(!1),Promise.reject(m)}return new Promise(function(m){o.sendMessageToCallMachine({action:"test-call-quality",dailyJsVersion:o.properties.dailyJsVersion},function(b){var E=b.results,C=E.result,x=Hr(E,Al);if(C==="failed"){var W,H=A({},x);(W=x.error)!==null&&W!==void 0&&W.details?(x.error.details=JSON.parse(x.error.details),H.error=A(A({},H.error),{},{details:A({},H.error.details)}),H.error.details.duringTest="testCallQuality"):(H.error=H.error?A({},H.error):{},H.error.details={duringTest:"testCallQuality"}),o._maybeSendToSentry(H)}d(!1),m(A({result:C},x))})})}),function(){return f.apply(this,arguments)})},{key:"stopTestCallQuality",value:function(){this.sendMessageToCallMachine({action:"stop-test-call-quality"})}},{key:"testConnectionQuality",value:(h=O(function*(o){var u;N()?(console.warn("testConnectionQuality() is deprecated: use testPeerToPeerCallQuality() instead"),u=yield this.testPeerToPeerCallQuality(o)):(console.warn("testConnectionQuality() is deprecated: use testCallQuality() instead"),u=yield this.testCallQuality());var d={result:u.result,secondsElapsed:u.secondsElapsed};return u.data&&(d.data={maxRTT:u.data.maxRoundTripTime,packetLoss:u.data.avgRecvPacketLoss}),d}),function(o){return h.apply(this,arguments)})},{key:"testPeerToPeerCallQuality",value:(p=O(function*(o){var u=this;if(Dn(this._testCallInProgress,"testPeerToPeerCallQuality()"),this.needsLoad())try{yield this.load()}catch(m){return Promise.reject(m)}var d=o.videoTrack,g=o.duration;if(!this._validateVideoTrackForNetworkTests(d))throw new Error("Video track error");return this._sharedTracks.videoTrackForConnectionQualityTest=d,new Promise(function(m,b){u.sendMessageToCallMachine({action:"test-p2p-call-quality",duration:g},function(E){E.error?b(E.error):m(E.results)})})}),function(o){return p.apply(this,arguments)})},{key:"stopTestConnectionQuality",value:function(){N()?(console.warn("stopTestConnectionQuality() is deprecated: use testPeerToPeerCallQuality() and stopTestPeerToPeerCallQuality() instead"),this.stopTestPeerToPeerCallQuality()):(console.warn("stopTestConnectionQuality() is deprecated: use testCallQuality() and stopTestCallQuality() instead"),this.stopTestCallQuality())}},{key:"stopTestPeerToPeerCallQuality",value:function(){this.sendMessageToCallMachine({action:"stop-test-p2p-call-quality"})}},{key:"testNetworkConnectivity",value:(l=O(function*(o){var u=this;if(Dn(this._testCallInProgress,"testNetworkConnectivity()"),this.needsLoad())try{yield this.load()}catch(d){return Promise.reject(d)}if(!this._validateVideoTrackForNetworkTests(o))throw new Error("Video track error");return this._sharedTracks.videoTrackForNetworkConnectivityTest=o,new Promise(function(d,g){u.sendMessageToCallMachine({action:"test-network-connectivity"},function(m){m.error?g(m.error):d(m.results)})})}),function(o){return l.apply(this,arguments)})},{key:"abortTestNetworkConnectivity",value:function(){this.sendMessageToCallMachine({action:"abort-test-network-connectivity"})}},{key:"getCpuLoadStats",value:function(){var o=this;return new Promise(function(u){o._callState===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],b=g[1];u._validateVideoSendSettings(m,b)})}},{key:"updateSendSettings",value:function(o){var u=this;return this.validateUpdateSendSettings(o),this.needsLoad()?(this._preloadCache.sendSettings=o,{sendSettings:this._preloadCache.sendSettings}):new Promise(function(d,g){u.sendMessageToCallMachine({action:"update-send-settings",sendSettings:o},function(m){m.error?g(m.error):d(m.sendSettings)})})}},{key:"getSendSettings",value:function(){return this._sendSettings||this._preloadCache.sendSettings}},{key:"getLocalAudioLevel",value:function(){return this._localAudioLevel}},{key:"getRemoteParticipantsAudioLevel",value:function(){return this._remoteParticipantsAudioLevel}},{key:"getActiveSpeaker",value:function(){return D(),this._activeSpeaker}},{key:"setActiveSpeakerMode",value:function(o){return D(),this.sendMessageToCallMachine({action:"set-active-speaker-mode",enabled:o}),this}},{key:"activeSpeakerMode",value:function(){return D(),this._activeSpeakerMode}},{key:"subscribeToTracksAutomatically",value:function(){return this._preloadCache.subscribeToTracksAutomatically}},{key:"setSubscribeToTracksAutomatically",value:function(o){return q(this._callState,"setSubscribeToTracksAutomatically()","Use the subscribeToTracksAutomatically configuration property."),this._preloadCache.subscribeToTracksAutomatically=o,this.sendMessageToCallMachine({action:"daily-method-subscribe-to-tracks-automatically",enabled:o}),this}},{key:"enumerateDevices",value:(c=O(function*(){var o=this;if(this._callObjectMode){var u=yield navigator.mediaDevices.enumerateDevices();return We()==="Firefox"&&er().major>115&&er().major<123&&(u=u.filter(function(d){return d.kind!=="audiooutput"})),{devices:u.map(function(d){var g=JSON.parse(JSON.stringify(d));if(!N()&&d.kind==="videoinput"&&d.getCapabilities){var m,b=d.getCapabilities();g.facing=(b==null||(m=b.facingMode)===null||m===void 0?void 0:m.length)>=1?b.facingMode[0]:void 0}return g})}}return new Promise(function(d){o.sendMessageToCallMachine({action:"enumerate-devices"},function(g){d({devices:g.devices})})})}),function(){return c.apply(this,arguments)})},{key:"sendAppMessage",value:function(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"*";if(q(this._callState,"sendAppMessage()"),JSON.stringify(o).length>4096)throw new Error("Message data too large. Max size is 4096");return this.sendMessageToCallMachine({action:"app-msg",data:o,to:u}),this}},{key:"addFakeParticipant",value:function(o){return D(),q(this._callState,"addFakeParticipant()"),this.sendMessageToCallMachine(A({action:"add-fake-participant"},o)),this}},{key:"setShowNamesMode",value:function(o){return ee(this._callObjectMode,"setShowNamesMode()"),D(),o&&o!=="always"&&o!=="never"?(console.error('setShowNamesMode argument should be "always", "never", or false'),this):(this.sendMessageToCallMachine({action:"set-show-names",mode:o}),this)}},{key:"setShowLocalVideo",value:function(){var o=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];return ee(this._callObjectMode,"setShowLocalVideo()"),D(),q(this._callState,"setShowLocalVideo()"),typeof o!="boolean"?(console.error("setShowLocalVideo only accepts a boolean value"),this):(this.sendMessageToCallMachine({action:"set-show-local-video",show:o}),this._showLocalVideo=o,this)}},{key:"showLocalVideo",value:function(){return ee(this._callObjectMode,"showLocalVideo()"),D(),this._showLocalVideo}},{key:"setShowParticipantsBar",value:function(){var o=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];return ee(this._callObjectMode,"setShowParticipantsBar()"),D(),q(this._callState,"setShowParticipantsBar()"),typeof o!="boolean"?(console.error("setShowParticipantsBar only accepts a boolean value"),this):(this.sendMessageToCallMachine({action:"set-show-participants-bar",show:o}),this._showParticipantsBar=o,this)}},{key:"showParticipantsBar",value:function(){return ee(this._callObjectMode,"showParticipantsBar()"),D(),this._showParticipantsBar}},{key:"customIntegrations",value:function(){return D(),ee(this._callObjectMode,"customIntegrations()"),this._customIntegrations}},{key:"setCustomIntegrations",value:function(o){return D(),ee(this._callObjectMode,"setCustomIntegrations()"),q(this._callState,"setCustomIntegrations()"),Co(o)?(this.sendMessageToCallMachine({action:"set-custom-integrations",integrations:o}),this._customIntegrations=o,this):this}},{key:"startCustomIntegrations",value:function(o){var u=this;if(D(),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(D(),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()"),D(),this._customTrayButtons}},{key:"updateCustomTrayButtons",value:function(o){return ee(this._callObjectMode,"updateCustomTrayButtons()"),D(),q(this._callState,"updateCustomTrayButtons()"),To(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=A({},o),u.sendMessageToCallMachine({action:"set-theme",theme:u.properties.theme});try{u.emitDailyJSEvent({action:cc,theme:u.properties.theme})}catch(m){console.log("could not emit 'theme-updated'",m)}d(u.properties.theme)}catch(m){g(m)}})}},{key:"requestFullscreen",value:(a=O(function*(){if(D(),this._iframe&&!document.fullscreenElement&&ts())try{(yield this._iframe.requestFullscreen)?this._iframe.requestFullscreen():this._iframe.webkitRequestFullscreen()}catch(o){console.log("could not make video call fullscreen",o)}}),function(){return a.apply(this,arguments)})},{key:"exitFullscreen",value:function(){D(),document.fullscreenElement?document.exitFullscreen():document.webkitFullscreenElement&&document.webkitExitFullscreen()}},{key:"getSidebarView",value:(s=O(function*(){var o=this;return this._callObjectMode?(console.error("getSidebarView is not available in callObject mode"),Promise.resolve(null)):new Promise(function(u){o.sendMessageToCallMachine({action:"get-sidebar-view"},function(d){u(d.view)})})}),function(){return s.apply(this,arguments)})},{key:"setSidebarView",value:function(o){return this._callObjectMode?(console.error("setSidebarView is not available in callObject mode"),this):(this.sendMessageToCallMachine({action:"set-sidebar-view",view:o}),this)}},{key:"room",value:(i=O(function*(){var o=this,u=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).includeRoomConfigDefaults,d=u===void 0||u;return this._accessState.access===Cn||this.needsLoad()?this.properties.url?{roomUrlPendingJoin:this.properties.url}:null:new Promise(function(g){o.sendMessageToCallMachine({action:"lib-room-info",includeRoomConfigDefaults:d},function(m){delete m.action,delete m.callbackStamp,g(m)})})}),function(){return i.apply(this,arguments)})},{key:"geo",value:(r=O(function*(){try{var o=yield fetch("https://gs.daily.co/_ks_/x-swsl/:");return{current:(yield o.json()).geo}}catch(u){return console.error("geo lookup failed",u),{current:""}}}),function(){return r.apply(this,arguments)})},{key:"setNetworkTopology",value:(n=O(function*(o){var u=this;return D(),q(this._callState,"setNetworkTopology()"),new Promise(function(d,g){u.sendMessageToCallMachine({action:"set-network-topology",opts:o},function(m){m.error?g({error:m.error}):d({workerId:m.workerId})})})}),function(o){return n.apply(this,arguments)})},{key:"getNetworkTopology",value:(e=O(function*(){var o=this;return new Promise(function(u,d){o.needsLoad()&&u({topology:"none"}),o.sendMessageToCallMachine({action:"get-network-topology"},function(g){g.error?d({error:g.error}):u({topology:g.topology})})})}),function(){return e.apply(this,arguments)})},{key:"setPlayNewParticipantSound",value:function(o){if(D(),typeof o!="number"&&o!==!0&&o!==!1)throw new Error("argument to setShouldPlayNewParticipantSound should be true, false, or a number, but is ".concat(o));this.sendMessageToCallMachine({action:"daily-method-set-play-ding",arg:o})}},{key:"on",value:function(o,u){return 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=A(A({},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[Ji,Vi,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 oc:this.sendMessageToCallMachine(A({action:ac},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 Gi:this._loadedCallback&&(this._loadedCallback(),this._loadedCallback=null),this.emitDailyJSEvent(o);break;case fc:this._joinedCallback&&(this._joinedCallback(o.participants),this._joinedCallback=null),this.emitDailyJSEvent(o);break;case gc:case vc: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;as(o.participant,g),cs(o.participant,g),ls(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]=A({},o.participant),this.toggleParticipantAudioBasedOnNativeAudioFocus(),this.emitDailyJSEvent(o))}break;case yc: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 _c:X(this._participantCounts,o.participantCounts)||(this._participantCounts=o.participantCounts,this.emitDailyJSEvent(o));break;case bc:var b={access:o.access};o.awaitingAccess&&(b.awaitingAccess=o.awaitingAccess),X(this._accessState,b)||(this._accessState=b,this.emitDailyJSEvent(o));break;case wc:if(o.meetingSession){this._meetingSessionSummary=o.meetingSession,this.emitDailyJSEvent(o);var E=A(A({},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 x=Hr(o,Pl);x!=null&&(C=x.error)!==null&&C!==void 0&&C.details&&(x.error.details=JSON.parse(x.error.details)),this._maybeSendToSentry(o),this._joinedCallback&&(this._joinedCallback(null,x),this._joinedCallback=null),this.emitDailyJSEvent(x);break;case mc: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 Gc:var W=o.threshold,H=o.quality;W===this._network.threshold&&H===this._network.quality||(this._network.quality=H,this._network.threshold=W,this.emitDailyJSEvent(o));break;case zc:o&&o.cpuLoadState&&this.emitDailyJSEvent(o);break;case Wc:o&&o.faceCounts!==void 0&&this.emitDailyJSEvent(o);break;case Vc: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 $c:var we=o.enabled;this._activeSpeakerMode!==we&&(this._activeSpeakerMode=we,this.emitDailyJSEvent({action:o.action,enabled:this._activeSpeakerMode}));break;case kc:case Ec:case Tc:this._waitingParticipants=o.allWaitingParticipants,this.emitDailyJSEvent({action:o.action,participant:o.participant});break;case el:X(this._receiveSettings,o.receiveSettings)||(this._receiveSettings=o.receiveSettings,this.emitDailyJSEvent({action:o.action,receiveSettings:o.receiveSettings}));break;case tl:if(!X(this._inputSettings,o.inputSettings)){var _n=this._getInputSettings();this._inputSettings=o.inputSettings,this._preloadCache.inputSettings={},X(_n,this._getInputSettings())||this.emitDailyJSEvent({action:o.action,inputSettings:this._getInputSettings()})}break;case"send-settings-updated":X(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 Ic:var Y=o.session_id;this._rmpPlayerState[Y]=o.playerState,this.emitDailyJSEvent(o);break;case Fc:delete this._rmpPlayerState[o.session_id],this.emitDailyJSEvent(o);break;case Bc: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 Sc:var xt=this._meetingSessionState.topology!==(o.meetingSessionState&&o.meetingSessionState.topology);this._meetingSessionState=Ln(o.meetingSessionState,this._callObjectMode),(this._callObjectMode||xt)&&this.emitDailyJSEvent(o);break;case Uc:this._isScreenSharing=!0,this.emitDailyJSEvent(o);break;case qc:case Jc:this._isScreenSharing=!1,this.emitDailyJSEvent(o);break;case Hi:case zi:case Rc:case xc:case Dc:case Oc:case Ac:case Pc:case dc:case hc:case Nc:case jc:case Hc:case Lc:case Yc:case Kc:case Qc:case Xc:case Wi:case Zc: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:Hi}))}},{key:"maybeEventTrackStopped",value:function(o,u,d,g){o&&(o.readyState!=="ended"&&u&&o.id===u.id||this.emitDailyJSEvent({action:Mc,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:Cc,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!!X(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=Yt(d,g),b=Yt(this._callState,this._isPreparingToJoin);m!==b&&(this.updateKeepDeviceAwake(b),this.updateDeviceAudioMode(b),this.updateShowAndroidOngoingMeetingNotification(b),this.updateNoOpRecordingEnsuringBackgroundContinuity(b))}}},{key:"resetMeetingDependentVars",value:function(){this._participants={},this._participantCounts=vs,this._waitingParticipants={},this._activeSpeaker={},this._activeSpeakerMode=!1,this._didPreAuth=!1,this._accessState={access:Cn},this._finalSummaryOfPrevSession=this._meetingSessionSummary,this._meetingSessionSummary={},this._meetingSessionState=Ln(gs,this._callObjectMode),this._isScreenSharing=!1,this._receiveSettings={},this._inputSettings=void 0,this._sendSettings={},this._localAudioLevel=0,this._isLocalAudioLevelObserverRunning=!1,this._remoteParticipantsAudioLevel={},this._isRemoteParticipantsAudioLevelObserverRunning=!1,this._callMachineInitialized=!1,this._bundleLoadTime=void 0,this._preloadCache}},{key:"updateKeepDeviceAwake",value:function(o){N()&&this.nativeUtils().setKeepDeviceAwake(o,this.callClientId)}},{key:"updateDeviceAudioMode",value:function(o){if(N()&&!this.disableReactNativeAutoDeviceManagement("audio")){var u=o?this._nativeInCallAudioMode:"idle";this.nativeUtils().setAudioMode(u)}}},{key:"updateShowAndroidOngoingMeetingNotification",value:function(o){if(N()&&this.nativeUtils().setShowOngoingMeetingNotification){var u,d,g,m;if(this.properties.reactNativeConfig&&this.properties.reactNativeConfig.androidInCallNotification){var b=this.properties.reactNativeConfig.androidInCallNotification;u=b.title,d=b.subtitle,g=b.iconName,m=b.disableForCustomOverride}m&&(o=!1),this.nativeUtils().setShowOngoingMeetingNotification(o,u,d,g,this.callClientId)}}},{key:"updateNoOpRecordingEnsuringBackgroundContinuity",value:function(o){N()&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity(o)}},{key:"toggleParticipantAudioBasedOnNativeAudioFocus",value:function(){var o,u;if(N()){var d=(o=this._callMachine())===null||o===void 0||(u=o.store)===null||u===void 0?void 0:u.getState();for(var g in d==null?void 0:d.streams){var m=d.streams[g];m&&m.pendingTrack&&m.pendingTrack.kind==="audio"&&(m.pendingTrack.enabled=this._hasNativeAudioFocus)}}}},{key:"disableReactNativeAutoDeviceManagement",value:function(o){return this.properties.reactNativeConfig&&this.properties.reactNativeConfig.disableAutoDeviceManagement&&this.properties.reactNativeConfig.disableAutoDeviceManagement[o]}},{key:"absoluteUrl",value:function(o){if(o!==void 0){var u=document.createElement("a");return u.href=o,u.href}}},{key:"sayHello",value:function(){var o="hello, world.";return console.log(o),o}},{key:"_logUseAfterDestroy",value:function(){var o=Object.values(Be)[0];if(this.needsLoad())if(o&&!o.needsLoad()){var u={action:Vt,level:"error",code:this.strictMode?9995:9997};o.sendMessageToCallMachine(u)}else this.strictMode||console.error("You are are attempting to use a call instance that was previously destroyed, which is unsupported. Please remove `strictMode: false` from your constructor properties to enable strict mode to track down and fix this unsupported usage.");else{var d={action:Vt,level:"error",code:this.strictMode?9995:9997};this._messageChannel.sendMessageToCallMachine(d,null,this._iframe,this.callClientId)}}},{key:"_logDuplicateInstanceAttempt",value:function(){var o=Object.values(Be)[0],u=o._callMachineInitialized?o:this._callMachineInitialized?this:void 0;u?(u.sendMessageToCallMachine({action:Vt,level:"warn",code:this.allowMultipleCallInstances?9993:9992}),this._delayDuplicateInstanceLog=!1):(this._delayDuplicateInstanceLog=!0,o._delayDuplicateInstanceLog=!0)}},{key:"_maybeSendToSentry",value:function(o){var u,d,g,m,b,E;if(!((u=o.error)!==null&&u!==void 0&&u.type&&!["connection-error","end-of-life","no-room"].includes(o.error.type))){var C=(d=this.properties)!==null&&d!==void 0&&d.url?new URL(this.properties.url):void 0,x="production";C&&C.host.includes(".staging.daily")&&(x="staging");var W,H,be,Te,we,_n=new Wa({dsn:"https://f10f1c81e5d44a4098416c0867a8b740@o77906.ingest.sentry.io/168844",transport:Ya,integrations:[new qi.GlobalHandlers({onunhandledrejection:!1}),new qi.HttpContext],environment:x}),Y=new wr(_n,void 0,re.version());if(this.session_id&&Y.setExtra("sessionId",this.session_id),this.properties){var ge=A({},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 xt=C.host.match(/(.*?)\./);je=xt&&xt[1]||""}je&&Y.setTag("domain",je)}o.error&&(Y.setTag("fatalErrorType",o.error.type),Y.setExtra("errorDetails",o.error.details),!((W=o.error.details)===null||W===void 0)&&W.uri&&Y.setTag("serverAddress",o.error.details.uri),!((H=o.error.details)===null||H===void 0)&&H.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&&(b=m.callMode)!==null&&b!==void 0&&b.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(ta){ta.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=da.getParser(he());return{supported:!!ns(),mobile:o.getPlatformType()==="mobile",name:o.getBrowserName(),version:o.getBrowserVersion(),supportsFullscreen:!!ts(),supportsScreenShare:!!il(),supportsSfu:!!ns(),supportsVideoProcessing:po(),supportsAudioProcessing:fo()}}},{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(D(),!o||!o.contentWindow||typeof o.src!="string")throw new Error("DailyIframe::Wrap needs an iframe-like first argument");return u.layout||(u.customLayout?u.layout="custom-v1":u.layout="browser"),new re(o,u)}},{key:"createFrame",value:function(o,u){var d,g;D(),o&&u?(d=o,g=u):o&&o.append?(d=o,g={}):(d=document.body,g=o||{});var m=g.iframeStyle;m||(m=d===document.body?{position:"fixed",border:"1px solid black",backgroundColor:"white",width:"375px",height:"450px",right:"1em",bottom:"1em"}:{border:0,width:"100%",height:"100%"});var b=document.createElement("iframe");window.navigator&&window.navigator.userAgent.match(/Chrome\/61\./)?b.allow="microphone, camera":b.allow="microphone; camera; autoplay; display-capture; screen-wake-lock",b.style.visibility="hidden",d.appendChild(b),b.style.visibility=null,Object.keys(m).forEach(function(E){return b.style[E]=m[E]}),g.layout||(g.customLayout?g.layout="custom-v1":g.layout="browser");try{return new re(b,g)}catch(E){throw d.removeChild(b),E}}},{key:"createTransparentFrame",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};D();var u=document.createElement("iframe");return u.allow="microphone; camera; autoplay",u.style.cssText=`
|
|
30
|
+
{ settings?: {state: "play"|"pause"} }`),g}return new Promise(function(g,S){d.sendMessageToCallMachine({action:"daily-method-update-remote-media-player",session_id:u,settings:p},function(M){M.error?S({error:M.error,errorMsg:M.errorMsg}):g({session_id:M.session_id,remoteMediaPlayerState:{state:M.state,settings:M.settings}})})})}),function(o){return w.apply(this,arguments)})},{key:"startTranscription",value:function(o){H(this._callState,"startTranscription()"),this.sendMessageToCallMachine(I({action:"daily-method-start-transcription"},o))}},{key:"updateTranscription",value:function(o){if(H(this._callState,"updateTranscription()"),!o)throw new Error("updateTranscription Error: options is mandatory");if(q(o)!=="object")throw new Error("updateTranscription Error: options must be object type");if(o.participants&&!Array.isArray(o.participants))throw new Error("updateTranscription Error: participants must be an array");this.sendMessageToCallMachine(I({action:"daily-method-update-transcription"},o))}},{key:"stopTranscription",value:function(o){if(H(this._callState,"stopTranscription()"),o&&q(o)!=="object")throw new Error("stopTranscription Error: options must be object type");if(o&&!o.instanceId)throw new Error('"instanceId" not provided');this.sendMessageToCallMachine(I({action:"daily-method-stop-transcription"},o))}},{key:"startDialOut",value:(b=L(function*(o){var d=this;H(this._callState,"startDialOut()");var u=function(M){if(M){if(!Array.isArray(M))throw new Error("Error starting dial out: audio codec must be an array");if(M.length<=0)throw new Error("Error starting dial out: audio codec array specified but empty");M.forEach(function(O){if(typeof O!="string")throw new Error("Error starting dial out: audio codec must be a string");if(O!=="OPUS"&&O!=="PCMU"&&O!=="PCMA"&&O!=="G722")throw new Error("Error starting dial out: audio codec must be one of OPUS, PCMU, PCMA, G722")})}};if(!o.sipUri&&!o.phoneNumber)throw new Error("Error starting dial out: either a sip uri or phone number must be provided");if(o.sipUri&&o.phoneNumber)throw new Error("Error starting dial out: only one of sip uri or phone number must be provided");if(o.sipUri){if(typeof o.sipUri!="string")throw new Error("Error starting dial out: sipUri must be a string");if(!o.sipUri.startsWith("sip:"))throw new Error("Error starting dial out: Invalid SIP URI, must start with 'sip:'");if(o.video&&typeof o.video!="boolean")throw new Error("Error starting dial out: video must be a boolean value");(function(M){if(M&&(u(M.audio),M.video)){if(!Array.isArray(M.video))throw new Error("Error starting dial out: video codec must be an array");if(M.video.length<=0)throw new Error("Error starting dial out: video codec array specified but empty");M.video.forEach(function(O){if(typeof O!="string")throw new Error("Error starting dial out: video codec must be a string");if(O!=="H264"&&O!=="VP8")throw new Error("Error starting dial out: video codec must be H264 or VP8")})}})(o.codecs)}if(o.phoneNumber){if(typeof o.phoneNumber!="string")throw new Error("Error starting dial out: phoneNumber must be a string");if(!/^\+\d{1,}$/.test(o.phoneNumber))throw new Error("Error starting dial out: Invalid phone number, must be valid phone number as per E.164");o.codecs&&u(o.codecs.audio)}if(o.callerId){if(typeof o.callerId!="string")throw new Error("Error starting dial out: callerId must be a string");if(o.sipUri)throw new Error("Error starting dial out: callerId not allowed with sipUri")}if(o.displayName){if(typeof o.displayName!="string")throw new Error("Error starting dial out: displayName must be a string");if(o.displayName.length>=200)throw new Error("Error starting dial out: displayName length must be less than 200")}if(o.userId){if(typeof o.userId!="string")throw new Error("Error starting dial out: userId must be a string");if(o.userId.length>36)throw new Error("Error starting dial out: userId length must be less than or equal to 36")}if(o.permissions&&o.permissions.canReceive){var p=re(Qo.validateJSONObject(o.permissions.canReceive),2),g=p[0],S=p[1];if(!g)throw new Error(S)}return new Promise(function(M,O){d.sendMessageToCallMachine(I({action:"dialout-start"},o),function(P){P.error?O(P.error):M(P)})})}),function(o){return b.apply(this,arguments)})},{key:"stopDialOut",value:function(o){var d=this;return H(this._callState,"stopDialOut()"),new Promise(function(u,p){d.sendMessageToCallMachine(I({action:"dialout-stop"},o),function(g){g.error?p(g.error):u(g)})})}},{key:"sipCallTransfer",value:(m=L(function*(o){var d=this;if(H(this._callState,"sipCallTransfer()"),!o)throw new Error("sipCallTransfer() requires a sessionId and toEndPoint");return o.useSipRefer=!1,to(o,"sipCallTransfer"),new Promise(function(u,p){d.sendMessageToCallMachine(I({action:Os},o),function(g){g.error?p(g.error):u(g)})})}),function(o){return m.apply(this,arguments)})},{key:"sipRefer",value:(y=L(function*(o){var d=this;if(H(this._callState,"sipRefer()"),!o)throw new Error("sessionId and toEndPoint are mandatory parameter");return o.useSipRefer=!0,to(o,"sipRefer"),new Promise(function(u,p){d.sendMessageToCallMachine(I({action:Os},o),function(g){g.error?p(g.error):u(g)})})}),function(o){return y.apply(this,arguments)})},{key:"sendDTMF",value:(E=L(function*(o){var d=this;return H(this._callState,"sendDTMF()"),function(u){var p=u.sessionId,g=u.tones;if(!p||!g)throw new Error("sessionId and tones are mandatory parameter");if(typeof p!="string"||typeof g!="string")throw new Error("sessionId and tones should be of string type");if(g.length>20)throw new Error("tones string must be upto 20 characters");var S=/[^0-9A-D*#]/g,M=g.match(S);if(M&&M[0])throw new Error("".concat(M[0]," is not valid DTMF tone"))}(o),new Promise(function(u,p){d.sendMessageToCallMachine(I({action:"send-dtmf"},o),function(g){g.error?p(g.error):u(g)})})}),function(o){return E.apply(this,arguments)})},{key:"getNetworkStats",value:function(){var o=this;return this._callState!==He?Promise.resolve(I({stats:{latest:{}}},this._network)):new Promise(function(d){o.sendMessageToCallMachine({action:"get-calc-stats"},function(u){d(I(I({},o._network),{},{stats:u.stats}))})})}},{key:"testWebsocketConnectivity",value:(k=L(function*(){var o=this;if(Zn(this._testCallInProgress,"testWebsocketConnectivity()"),this.needsLoad())try{yield this.load()}catch(d){return Promise.reject(d)}return new Promise(function(d,u){o.sendMessageToCallMachine({action:"test-websocket-connectivity"},function(p){p.error?u(p.error):d(p.results)})})}),function(){return k.apply(this,arguments)})},{key:"abortTestWebsocketConnectivity",value:function(){this.sendMessageToCallMachine({action:"abort-test-websocket-connectivity"})}},{key:"_validateVideoTrackForNetworkTests",value:function(o){return o?o instanceof MediaStreamTrack?!!Au(o)||(console.error("Video track is not playable. This test needs a live video track."),!1):(console.error("Video track needs to be of type `MediaStreamTrack`."),!1):(console.error("Missing video track. You must provide a video track in order to run this test."),!1)}},{key:"testCallQuality",value:(v=L(function*(){var o=this;U(),ye(this._callObjectMode,"testCallQuality()"),nn(this._callMachineInitialized,"testCallQuality()",null,!0),Yn(this._callState,this._isPreparingToJoin,"testCallQuality()");var d=this._testCallAlreadyInProgress,u=function(g){d||(o._testCallInProgress=g)};if(u(!0),this.needsLoad())try{var p=this._callState;yield this.load(),this._callState=p}catch(g){return u(!1),Promise.reject(g)}return new Promise(function(g){o.sendMessageToCallMachine({action:"test-call-quality",dailyJsVersion:o.properties.dailyJsVersion},function(S){var M=S.results,O=M.result,P=ui(M,xu);if(O==="failed"){var F,B=I({},P);(F=P.error)!==null&&F!==void 0&&F.details?(P.error.details=JSON.parse(P.error.details),B.error=I(I({},B.error),{},{details:I({},B.error.details)}),B.error.details.duringTest="testCallQuality"):(B.error=B.error?I({},B.error):{},B.error.details={duringTest:"testCallQuality"}),o._maybeSendToSentry(B)}u(!1),g(I({result:O},P))})})}),function(){return v.apply(this,arguments)})},{key:"stopTestCallQuality",value:function(){this.sendMessageToCallMachine({action:"stop-test-call-quality"})}},{key:"testConnectionQuality",value:(h=L(function*(o){var d;V()?(console.warn("testConnectionQuality() is deprecated: use testPeerToPeerCallQuality() instead"),d=yield this.testPeerToPeerCallQuality(o)):(console.warn("testConnectionQuality() is deprecated: use testCallQuality() instead"),d=yield this.testCallQuality());var u={result:d.result,secondsElapsed:d.secondsElapsed};return d.data&&(u.data={maxRTT:d.data.maxRoundTripTime,packetLoss:d.data.avgRecvPacketLoss}),u}),function(o){return h.apply(this,arguments)})},{key:"testPeerToPeerCallQuality",value:(f=L(function*(o){var d=this;if(Zn(this._testCallInProgress,"testPeerToPeerCallQuality()"),this.needsLoad())try{yield this.load()}catch(g){return Promise.reject(g)}var u=o.videoTrack,p=o.duration;if(!this._validateVideoTrackForNetworkTests(u))throw new Error("Video track error");return this._sharedTracks.videoTrackForConnectionQualityTest=u,new Promise(function(g,S){d.sendMessageToCallMachine({action:"test-p2p-call-quality",duration:p},function(M){M.error?S(M.error):g(M.results)})})}),function(o){return f.apply(this,arguments)})},{key:"stopTestConnectionQuality",value:function(){V()?(console.warn("stopTestConnectionQuality() is deprecated: use testPeerToPeerCallQuality() and stopTestPeerToPeerCallQuality() instead"),this.stopTestPeerToPeerCallQuality()):(console.warn("stopTestConnectionQuality() is deprecated: use testCallQuality() and stopTestCallQuality() instead"),this.stopTestCallQuality())}},{key:"stopTestPeerToPeerCallQuality",value:function(){this.sendMessageToCallMachine({action:"stop-test-p2p-call-quality"})}},{key:"testNetworkConnectivity",value:(l=L(function*(o){var d=this;if(Zn(this._testCallInProgress,"testNetworkConnectivity()"),this.needsLoad())try{yield this.load()}catch(u){return Promise.reject(u)}if(!this._validateVideoTrackForNetworkTests(o))throw new Error("Video track error");return this._sharedTracks.videoTrackForNetworkConnectivityTest=o,new Promise(function(u,p){d.sendMessageToCallMachine({action:"test-network-connectivity"},function(g){g.error?p(g.error):u(g.results)})})}),function(o){return l.apply(this,arguments)})},{key:"abortTestNetworkConnectivity",value:function(){this.sendMessageToCallMachine({action:"abort-test-network-connectivity"})}},{key:"getCpuLoadStats",value:function(){var o=this;return new Promise(function(d){o._callState===He?o.sendMessageToCallMachine({action:"get-cpu-load-stats"},function(u){d(u.cpuStats)}):d({cpuLoadState:void 0,cpuLoadStateReason:void 0,stats:{}})})}},{key:"_validateEncodingLayerHasValidProperties",value:function(o){var d;if(!(((d=Object.keys(o))===null||d===void 0?void 0:d.length)>0))throw new Error("Empty encoding is not allowed. At least one of these valid keys should be specified:"+Object.values(Xn))}},{key:"_validateVideoSendSettings",value:function(o,d){var u=o==="screenVideo"?["default-screen-video","detail-optimized","motion-optimized","motion-and-detail-balanced"]:["default-video","bandwidth-optimized","bandwidth-and-quality-balanced","quality-optimized","adaptive-2-layers","adaptive-3-layers"],p="Video send settings should be either an object or one of the supported presets: ".concat(u.join());if(typeof d=="string"){if(!u.includes(d))throw new Error(p)}else{if(q(d)!=="object")throw new Error(p);if(!d.maxQuality&&!d.encodings&&d.allowAdaptiveLayers===void 0)throw new Error("Video send settings must contain at least maxQuality, allowAdaptiveLayers or encodings attribute");if(d.maxQuality&&["low","medium","high"].indexOf(d.maxQuality)===-1)throw new Error("maxQuality must be either low, medium or high");if(d.encodings){var g=!1;switch(Object.keys(d.encodings).length){case 1:g=!d.encodings.low;break;case 2:g=!d.encodings.low||!d.encodings.medium;break;case 3:g=!d.encodings.low||!d.encodings.medium||!d.encodings.high;break;default:g=!0}if(g)throw new Error("Encodings must be defined as: low, low and medium, or low, medium and high.");d.encodings.low&&this._validateEncodingLayerHasValidProperties(d.encodings.low),d.encodings.medium&&this._validateEncodingLayerHasValidProperties(d.encodings.medium),d.encodings.high&&this._validateEncodingLayerHasValidProperties(d.encodings.high)}}}},{key:"validateUpdateSendSettings",value:function(o){var d=this;if(!o||Object.keys(o).length===0)throw new Error("Send settings must contain at least information for one track!");Object.entries(o).forEach(function(u){var p=re(u,2),g=p[0],S=p[1];d._validateVideoSendSettings(g,S)})}},{key:"updateSendSettings",value:function(o){var d=this;return this.validateUpdateSendSettings(o),this.needsLoad()?(this._preloadCache.sendSettings=o,{sendSettings:this._preloadCache.sendSettings}):new Promise(function(u,p){d.sendMessageToCallMachine({action:"update-send-settings",sendSettings:o},function(g){g.error?p(g.error):u(g.sendSettings)})})}},{key:"getSendSettings",value:function(){return this._sendSettings||this._preloadCache.sendSettings}},{key:"getLocalAudioLevel",value:function(){return this._localAudioLevel}},{key:"getRemoteParticipantsAudioLevel",value:function(){return this._remoteParticipantsAudioLevel}},{key:"getActiveSpeaker",value:function(){return U(),this._activeSpeaker}},{key:"setActiveSpeakerMode",value:function(o){return U(),this.sendMessageToCallMachine({action:"set-active-speaker-mode",enabled:o}),this}},{key:"activeSpeakerMode",value:function(){return U(),this._activeSpeakerMode}},{key:"subscribeToTracksAutomatically",value:function(){return this._preloadCache.subscribeToTracksAutomatically}},{key:"setSubscribeToTracksAutomatically",value:function(o){return H(this._callState,"setSubscribeToTracksAutomatically()","Use the subscribeToTracksAutomatically configuration property."),this._preloadCache.subscribeToTracksAutomatically=o,this.sendMessageToCallMachine({action:"daily-method-subscribe-to-tracks-automatically",enabled:o}),this}},{key:"enumerateDevices",value:(c=L(function*(){var o=this;if(this._callObjectMode){var d=yield navigator.mediaDevices.enumerateDevices();return nt()==="Firefox"&&vn().major>115&&vn().major<123&&(d=d.filter(function(u){return u.kind!=="audiooutput"})),{devices:d.map(function(u){var p=JSON.parse(JSON.stringify(u));if(!V()&&u.kind==="videoinput"&&u.getCapabilities){var g,S=u.getCapabilities();p.facing=(S==null||(g=S.facingMode)===null||g===void 0?void 0:g.length)>=1?S.facingMode[0]:void 0}return p})}}return new Promise(function(u){o.sendMessageToCallMachine({action:"enumerate-devices"},function(p){u({devices:p.devices})})})}),function(){return c.apply(this,arguments)})},{key:"sendAppMessage",value:function(o){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"*";if(H(this._callState,"sendAppMessage()"),JSON.stringify(o).length>this._maxAppMessageSize)throw new Error("Message data too large. Max size is "+this._maxAppMessageSize);return this.sendMessageToCallMachine({action:"app-msg",data:o,to:d}),this}},{key:"addFakeParticipant",value:function(o){return U(),H(this._callState,"addFakeParticipant()"),this.sendMessageToCallMachine(I({action:"add-fake-participant"},o)),this}},{key:"setShowNamesMode",value:function(o){return le(this._callObjectMode,"setShowNamesMode()"),U(),o&&o!=="always"&&o!=="never"?(console.error('setShowNamesMode argument should be "always", "never", or false'),this):(this.sendMessageToCallMachine({action:"set-show-names",mode:o}),this)}},{key:"setShowLocalVideo",value:function(){var o=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];return le(this._callObjectMode,"setShowLocalVideo()"),U(),H(this._callState,"setShowLocalVideo()"),typeof o!="boolean"?(console.error("setShowLocalVideo only accepts a boolean value"),this):(this.sendMessageToCallMachine({action:"set-show-local-video",show:o}),this._showLocalVideo=o,this)}},{key:"showLocalVideo",value:function(){return le(this._callObjectMode,"showLocalVideo()"),U(),this._showLocalVideo}},{key:"setShowParticipantsBar",value:function(){var o=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];return le(this._callObjectMode,"setShowParticipantsBar()"),U(),H(this._callState,"setShowParticipantsBar()"),typeof o!="boolean"?(console.error("setShowParticipantsBar only accepts a boolean value"),this):(this.sendMessageToCallMachine({action:"set-show-participants-bar",show:o}),this._showParticipantsBar=o,this)}},{key:"showParticipantsBar",value:function(){return le(this._callObjectMode,"showParticipantsBar()"),U(),this._showParticipantsBar}},{key:"customIntegrations",value:function(){return U(),le(this._callObjectMode,"customIntegrations()"),this._customIntegrations}},{key:"setCustomIntegrations",value:function(o){return U(),le(this._callObjectMode,"setCustomIntegrations()"),H(this._callState,"setCustomIntegrations()"),oa(o)?(this.sendMessageToCallMachine({action:"set-custom-integrations",integrations:o}),this._customIntegrations=o,this):this}},{key:"startCustomIntegrations",value:function(o){var d=this;if(U(),le(this._callObjectMode,"startCustomIntegrations()"),H(this._callState,"startCustomIntegrations()"),Array.isArray(o)&&o.some(function(g){return typeof g!="string"})||!Array.isArray(o)&&typeof o!="string")return console.error("startCustomIntegrations() only accepts string | string[]"),this;var u=typeof o=="string"?[o]:o,p=u.filter(function(g){return!(g in d._customIntegrations)});return p.length?(console.error(`Can't find custom integration(s): "`.concat(p.join(", "),'"')),this):(this.sendMessageToCallMachine({action:"start-custom-integrations",ids:u}),this)}},{key:"stopCustomIntegrations",value:function(o){var d=this;if(U(),le(this._callObjectMode,"stopCustomIntegrations()"),H(this._callState,"stopCustomIntegrations()"),Array.isArray(o)&&o.some(function(g){return typeof g!="string"})||!Array.isArray(o)&&typeof o!="string")return console.error("stopCustomIntegrations() only accepts string | string[]"),this;var u=typeof o=="string"?[o]:o,p=u.filter(function(g){return!(g in d._customIntegrations)});return p.length?(console.error(`Can't find custom integration(s): "`.concat(p.join(", "),'"')),this):(this.sendMessageToCallMachine({action:"stop-custom-integrations",ids:u}),this)}},{key:"customTrayButtons",value:function(){return le(this._callObjectMode,"customTrayButtons()"),U(),this._customTrayButtons}},{key:"updateCustomTrayButtons",value:function(o){return le(this._callObjectMode,"updateCustomTrayButtons()"),U(),H(this._callState,"updateCustomTrayButtons()"),sa(o)?(this.sendMessageToCallMachine({action:"update-custom-tray-buttons",btns:o}),this._customTrayButtons=o,this):(console.error("updateCustomTrayButtons only accepts a dictionary of the type ".concat(JSON.stringify(bn))),this)}},{key:"theme",value:function(){return le(this._callObjectMode,"theme()"),this.properties.theme}},{key:"setTheme",value:function(o){var d=this;return le(this._callObjectMode,"setTheme()"),new Promise(function(u,p){try{d.validateProperties({theme:o}),d.properties.theme=I({},o),d.sendMessageToCallMachine({action:"set-theme",theme:d.properties.theme});try{d.emitDailyJSEvent({action:hl,theme:d.properties.theme})}catch(g){console.log("could not emit 'theme-updated'",g)}u(d.properties.theme)}catch(g){p(g)}})}},{key:"requestFullscreen",value:(a=L(function*(){if(U(),this._iframe&&!document.fullscreenElement&&As())try{(yield this._iframe.requestFullscreen)?this._iframe.requestFullscreen():this._iframe.webkitRequestFullscreen()}catch(o){console.log("could not make video call fullscreen",o)}}),function(){return a.apply(this,arguments)})},{key:"exitFullscreen",value:function(){U(),document.fullscreenElement?document.exitFullscreen():document.webkitFullscreenElement&&document.webkitExitFullscreen()}},{key:"getSidebarView",value:(s=L(function*(){var o=this;return this._callObjectMode?(console.error("getSidebarView is not available in callObject mode"),Promise.resolve(null)):new Promise(function(d){o.sendMessageToCallMachine({action:"get-sidebar-view"},function(u){d(u.view)})})}),function(){return s.apply(this,arguments)})},{key:"setSidebarView",value:function(o){return this._callObjectMode?(console.error("setSidebarView is not available in callObject mode"),this):(this.sendMessageToCallMachine({action:"set-sidebar-view",view:o}),this)}},{key:"room",value:(i=L(function*(){var o=this,d=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).includeRoomConfigDefaults,u=d===void 0||d;return this._accessState.access===zn||this.needsLoad()?this.properties.url?{roomUrlPendingJoin:this.properties.url}:null:new Promise(function(p){o.sendMessageToCallMachine({action:"lib-room-info",includeRoomConfigDefaults:u},function(g){delete g.action,delete g.callbackStamp,p(g)})})}),function(){return i.apply(this,arguments)})},{key:"geo",value:(r=L(function*(){try{var o=yield fetch("https://gs.daily.co/_ks_/x-swsl/:");return{current:(yield o.json()).geo}}catch(d){return console.error("geo lookup failed",d),{current:""}}}),function(){return r.apply(this,arguments)})},{key:"setNetworkTopology",value:(n=L(function*(o){var d=this;return U(),H(this._callState,"setNetworkTopology()"),new Promise(function(u,p){d.sendMessageToCallMachine({action:"set-network-topology",opts:o},function(g){g.error?p({error:g.error}):u({workerId:g.workerId})})})}),function(o){return n.apply(this,arguments)})},{key:"getNetworkTopology",value:(e=L(function*(){var o=this;return new Promise(function(d,u){o.needsLoad()&&d({topology:"none"}),o.sendMessageToCallMachine({action:"get-network-topology"},function(p){p.error?u({error:p.error}):d({topology:p.topology})})})}),function(){return e.apply(this,arguments)})},{key:"setPlayNewParticipantSound",value:function(o){if(U(),typeof o!="number"&&o!==!0&&o!==!1)throw new Error("argument to setShouldPlayNewParticipantSound should be true, false, or a number, but is ".concat(o));this.sendMessageToCallMachine({action:"daily-method-set-play-ding",arg:o})}},{key:"on",value:function(o,d){return qt.prototype.on.call(this,o,d)}},{key:"once",value:function(o,d){return qt.prototype.once.call(this,o,d)}},{key:"off",value:function(o,d){return qt.prototype.off.call(this,o,d)}},{key:"validateProperties",value:function(o){var d,u;if(o!=null&&(d=o.dailyConfig)!==null&&d!==void 0&&d.userMediaAudioConstraints){var p,g;V()||console.warn("userMediaAudioConstraints is deprecated. You can override constraints with inputSettings.audio.settings, found in DailyCallOptions.");var S=o.inputSettings||{};S.audio=((p=o.inputSettings)===null||p===void 0?void 0:p.audio)||{},S.audio.settings=((g=o.inputSettings)===null||g===void 0||(g=g.audio)===null||g===void 0?void 0:g.settings)||{},S.audio.settings=I(I({},S.audio.settings),o.dailyConfig.userMediaAudioConstraints),o.inputSettings=S,delete o.dailyConfig.userMediaAudioConstraints}if(o!=null&&(u=o.dailyConfig)!==null&&u!==void 0&&u.userMediaVideoConstraints){var M,O;V()||console.warn("userMediaVideoConstraints is deprecated. You can override constraints with inputSettings.video.settings, found in DailyCallOptions.");var P=o.inputSettings||{};P.video=((M=o.inputSettings)===null||M===void 0?void 0:M.video)||{},P.video.settings=((O=o.inputSettings)===null||O===void 0||(O=O.video)===null||O===void 0?void 0:O.settings)||{},P.video.settings=I(I({},P.video.settings),o.dailyConfig.userMediaVideoConstraints),o.inputSettings=P,delete o.dailyConfig.userMediaVideoConstraints}for(var F in o){if(!ze[F])throw new Error("unrecognized property '".concat(F,"'"));if(ze[F].validate&&!ze[F].validate(o[F],this))throw new Error("property '".concat(F,"': ").concat(ze[F].help))}}},{key:"assembleMeetingUrl",value:function(){var o,d,u=I(I({},this.properties),{},{emb:this.callClientId,embHref:encodeURIComponent(window.location.href),proxy:(o=this.properties.dailyConfig)!==null&&o!==void 0&&o.proxyUrl?encodeURIComponent((d=this.properties.dailyConfig)===null||d===void 0?void 0:d.proxyUrl):void 0}),p=u.url.match(/\?/)?"&":"?";return u.url+p+Object.keys(ze).filter(function(g){return ze[g].queryString&&u[g]!==void 0}).map(function(g){return"".concat(ze[g].queryString,"=").concat(u[g])}).join("&")}},{key:"needsLoad",value:function(){return[ms,gs,qe,Le].includes(this._callState)}},{key:"sendMessageToCallMachine",value:function(o,d){if(this._destroyed&&(this._logUseAfterDestroy(),this.strictMode))throw new Error("Use after destroy");this._messageChannel.sendMessageToCallMachine(o,d,this.callClientId,this._iframe)}},{key:"forwardPackagedMessageToCallMachine",value:function(o){this._messageChannel.forwardPackagedMessageToCallMachine(o,this._iframe,this.callClientId)}},{key:"addListenerForPackagedMessagesFromCallMachine",value:function(o){return this._messageChannel.addListenerForPackagedMessagesFromCallMachine(o,this.callClientId)}},{key:"removeListenerForPackagedMessagesFromCallMachine",value:function(o){this._messageChannel.removeListenerForPackagedMessagesFromCallMachine(o)}},{key:"handleMessageFromCallMachine",value:function(o){switch(o.action){case dl:this.sendMessageToCallMachine(I({action:fl},this.properties));break;case"call-machine-initialized":this._callMachineInitialized=!0;var d={action:Zt,level:"log",code:1011,stats:{event:"bundle load",time:this._bundleLoadTime==="no-op"?0:this._bundleLoadTime,preLoaded:this._bundleLoadTime==="no-op",url:dn(this.properties.dailyConfig)}};this.sendMessageToCallMachine(d),this._delayDuplicateInstanceLog&&this._logDuplicateInstanceAttempt();break;case bs:this._loadedCallback&&(this._loadedCallback(),this._loadedCallback=null),this.emitDailyJSEvent(o);break;case bl:var u,p=I({},o);delete p.internal,this._maxAppMessageSize=((u=o.internal)===null||u===void 0?void 0:u._maxAppMessageSize)||Hn,this._joinedCallback&&(this._joinedCallback(o.participants),this._joinedCallback=null),this.emitDailyJSEvent(p);break;case wl:case Sl:if(this._callState===qe)return;if(o.participant&&o.participant.session_id){var g=o.participant.local?"local":o.participant.session_id;if(this._callObjectMode){var S=this._callMachine().store;Ns(o.participant,S),Fs(o.participant,S),Us(o.participant,this._participants[g],S)}try{this.maybeParticipantTracksStopped(this._participants[g],o.participant),this.maybeParticipantTracksStarted(this._participants[g],o.participant),this.maybeEventRecordingStopped(this._participants[g],o.participant),this.maybeEventRecordingStarted(this._participants[g],o.participant)}catch(Na){console.error("track events error",Na)}this.compareEqualForParticipantUpdateEvent(o.participant,this._participants[g])||(this._participants[g]=I({},o.participant),this.toggleParticipantAudioBasedOnNativeAudioFocus(),this.emitDailyJSEvent(o))}break;case kl:if(o.participant&&o.participant.session_id){var M=this._participants[o.participant.session_id];M&&this.maybeParticipantTracksStopped(M,null),delete this._participants[o.participant.session_id],this.emitDailyJSEvent(o)}break;case El:se(this._participantCounts,o.participantCounts)||(this._participantCounts=o.participantCounts,this.emitDailyJSEvent(o));break;case Tl:var O={access:o.access};o.awaitingAccess&&(O.awaitingAccess=o.awaitingAccess),se(this._accessState,O)||(this._accessState=O,this.emitDailyJSEvent(o));break;case Cl:if(o.meetingSession){this._meetingSessionSummary=o.meetingSession,this.emitDailyJSEvent(o);var P=I(I({},o),{},{action:"meeting-session-updated"});this.emitDailyJSEvent(P)}break;case Es:var F;this._iframe&&!o.preserveIframe&&(this._iframe.src=""),this._updateCallState(Le),this.resetMeetingDependentVars(),this._loadedCallback&&(this._loadedCallback(o.errorMsg),this._loadedCallback=null),o.preserveIframe;var B=ui(o,Iu);B!=null&&(F=B.error)!==null&&F!==void 0&&F.details&&(B.error.details=JSON.parse(B.error.details)),this._maybeSendToSentry(o),this._joinedCallback&&(this._joinedCallback(null,B),this._joinedCallback=null),this.emitDailyJSEvent(B);break;case _l:this._callState!==Le&&this._updateCallState(qe),this.resetMeetingDependentVars(),this._resolveLeave&&(this._resolveLeave(),this._resolveLeave=null),this.emitDailyJSEvent(o);break;case"selected-devices-updated":o.devices&&this.emitDailyJSEvent(o);break;case Ql:var ke=o.state,Be=o.threshold,_t=o.quality,Y=ke.state,he=ke.reasons;Y===this._network.networkState&&se(he,this._network.networkStateReasons)&&Be===this._network.threshold&&_t===this._network.quality||(this._network.networkState=Y,this._network.networkStateReasons=he,this._network.quality=_t,this._network.threshold=Be,o.networkState=Y,he.length&&(o.networkStateReasons=he),delete o.state,this.emitDailyJSEvent(o));break;case Yl:o&&o.cpuLoadState&&this.emitDailyJSEvent(o);break;case Zl:o&&o.faceCounts!==void 0&&this.emitDailyJSEvent(o);break;case Gl:var Ve=o.activeSpeaker;this._activeSpeaker.peerId!==Ve.peerId&&(this._activeSpeaker.peerId=Ve.peerId,this.emitDailyJSEvent({action:o.action,activeSpeaker:this._activeSpeaker}));break;case"show-local-video-changed":if(this._callObjectMode)return;var wt=o.show;this._showLocalVideo=wt,this.emitDailyJSEvent({action:o.action,show:wt});break;case Kl:var Vt=o.enabled;this._activeSpeakerMode!==Vt&&(this._activeSpeakerMode=Vt,this.emitDailyJSEvent({action:o.action,enabled:this._activeSpeakerMode}));break;case Ol:case Al:case Pl:this._waitingParticipants=o.allWaitingParticipants,this.emitDailyJSEvent({action:o.action,participant:o.participant});break;case su:se(this._receiveSettings,o.receiveSettings)||(this._receiveSettings=o.receiveSettings,this.emitDailyJSEvent({action:o.action,receiveSettings:o.receiveSettings}));break;case Ss:this._maybeUpdateInputSettings(o.inputSettings);break;case"send-settings-updated":se(this._sendSettings,o.sendSettings)||(this._sendSettings=o.sendSettings,this._preloadCache.sendSettings=null,this.emitDailyJSEvent({action:o.action,sendSettings:o.sendSettings}));break;case"local-audio-level":this._localAudioLevel=o.audioLevel,this._preloadCache.localAudioLevelObserver=null,this.emitDailyJSEvent(o);break;case"remote-participants-audio-level":this._remoteParticipantsAudioLevel=o.participantsAudioLevel,this._preloadCache.remoteParticipantsAudioLevelObserver=null,this.emitDailyJSEvent(o);break;case Jl:var St=o.session_id;this._rmpPlayerState[St]=o.playerState,this.emitDailyJSEvent(o);break;case $l:delete this._rmpPlayerState[o.session_id],this.emitDailyJSEvent(o);break;case ql:var kt=o.session_id,li=this._rmpPlayerState[kt];li&&this.compareEqualForRMPUpdateEvent(li,o.remoteMediaPlayerState)||(this._rmpPlayerState[kt]=o.remoteMediaPlayerState,this.emitDailyJSEvent(o));break;case"custom-button-click":case"sidebar-view-changed":this.emitDailyJSEvent(o);break;case Ml:var Da=this._meetingSessionState.topology!==(o.meetingSessionState&&o.meetingSessionState.topology);this._meetingSessionState=er(o.meetingSessionState,this._callObjectMode),(this._callObjectMode||Da)&&this.emitDailyJSEvent(o);break;case zl:this._isScreenSharing=!0,this.emitDailyJSEvent(o);break;case Hl:case Wl:this._isScreenSharing=!1,this.emitDailyJSEvent(o);break;case _s:case ws:case Dl:case Nl:case Fl:case Il:case Ll:case Rl:case gl:case vl:case Bl:case Vl:case"test-completed":case Xl:case Ul:case eu:case tu:case nu:case ru:case ks:case iu:case"dialin-ready":case"dialin-connected":case"dialin-error":case"dialin-stopped":case"dialin-warning":case"dialout-connected":case"dialout-answered":case"dialout-error":case"dialout-stopped":case"dialout-warning":this.emitDailyJSEvent(o);break;case"request-fullscreen":this.requestFullscreen();break;case"request-exit-fullscreen":this.exitFullscreen()}}},{key:"maybeEventRecordingStopped",value:function(o,d){var u="record";o&&(d.local||d[u]!==!1||o[u]===d[u]||this.emitDailyJSEvent({action:ws}))}},{key:"maybeEventRecordingStarted",value:function(o,d){var u="record";o&&(d.local||d[u]!==!0||o[u]===d[u]||this.emitDailyJSEvent({action:_s}))}},{key:"_trackStatePlayable",value:function(o){return!(!o||o.state!==ol)}},{key:"_trackChanged",value:function(o,d){return(o==null?void 0:o.id)!==(d==null?void 0:d.id)}},{key:"maybeEventTrackStopped",value:function(o,d,u){var p,g,S=(p=d==null?void 0:d.tracks[o])!==null&&p!==void 0?p:null,M=(g=u==null?void 0:u.tracks[o])!==null&&g!==void 0?g:null,O=S==null?void 0:S.track;if(O){var P=this._trackStatePlayable(S),F=this._trackStatePlayable(M),B=this._trackChanged(O,M==null?void 0:M.track);P&&(F&&!B||this.emitDailyJSEvent({action:xl,track:O,participant:u??d,type:o}))}}},{key:"maybeEventTrackStarted",value:function(o,d,u){var p,g,S=(p=d==null?void 0:d.tracks[o])!==null&&p!==void 0?p:null,M=(g=u==null?void 0:u.tracks[o])!==null&&g!==void 0?g:null,O=M==null?void 0:M.track;if(O){var P=this._trackStatePlayable(S),F=this._trackStatePlayable(M),B=this._trackChanged(S==null?void 0:S.track,O);F&&(P&&!B||this.emitDailyJSEvent({action:jl,track:O,participant:u,type:o}))}}},{key:"maybeParticipantTracksStopped",value:function(o,d){if(o)for(var u in o.tracks)this.maybeEventTrackStopped(u,o,d)}},{key:"maybeParticipantTracksStarted",value:function(o,d){if(d)for(var u in d.tracks)this.maybeEventTrackStarted(u,o,d)}},{key:"compareEqualForRMPUpdateEvent",value:function(o,d){var u,p;return o.state===d.state&&((u=o.settings)===null||u===void 0?void 0:u.volume)===((p=d.settings)===null||p===void 0?void 0:p.volume)}},{key:"emitDailyJSEvent",value:function(o){try{o.callClientId=this.callClientId,this.emit(o.action,o)}catch(d){console.log("could not emit",o,d)}}},{key:"compareEqualForParticipantUpdateEvent",value:function(o,d){return!!se(o,d)&&(!o.videoTrack||!d.videoTrack||o.videoTrack.id===d.videoTrack.id&&o.videoTrack.muted===d.videoTrack.muted&&o.videoTrack.enabled===d.videoTrack.enabled)&&(!o.audioTrack||!d.audioTrack||o.audioTrack.id===d.audioTrack.id&&o.audioTrack.muted===d.audioTrack.muted&&o.audioTrack.enabled===d.audioTrack.enabled)}},{key:"nativeUtils",value:function(){return V()?typeof DailyNativeUtils>"u"?(console.warn("in React Native, DailyNativeUtils is expected to be available"),null):DailyNativeUtils:null}},{key:"updateIsPreparingToJoin",value:function(o){this._updateCallState(this._callState,o)}},{key:"_updateCallState",value:function(o){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._isPreparingToJoin;if(o!==this._callState||d!==this._isPreparingToJoin){var u=this._callState,p=this._isPreparingToJoin;this._callState=o,this._isPreparingToJoin=d;var g=this._callState===He;this.updateShowAndroidOngoingMeetingNotification(g);var S=an(u,p),M=an(this._callState,this._isPreparingToJoin);S!==M&&(this.updateKeepDeviceAwake(M),this.updateDeviceAudioMode(M),this.updateNoOpRecordingEnsuringBackgroundContinuity(M))}}},{key:"resetMeetingDependentVars",value:function(){this._participants={},this._participantCounts=Xs,this._waitingParticipants={},this._activeSpeaker={},this._activeSpeakerMode=!1,this._didPreAuth=!1,this._accessState={access:zn},this._finalSummaryOfPrevSession=this._meetingSessionSummary,this._meetingSessionSummary={},this._meetingSessionState=er(Qs,this._callObjectMode),this._isScreenSharing=!1,this._receiveSettings={},this._inputSettings=void 0,this._sendSettings={},this._localAudioLevel=0,this._isLocalAudioLevelObserverRunning=!1,this._remoteParticipantsAudioLevel={},this._isRemoteParticipantsAudioLevelObserverRunning=!1,this._maxAppMessageSize=Hn,this._callMachineInitialized=!1,this._bundleLoadTime=void 0,this._preloadCache}},{key:"updateKeepDeviceAwake",value:function(o){V()&&this.nativeUtils().setKeepDeviceAwake(o,this.callClientId)}},{key:"updateDeviceAudioMode",value:function(o){if(V()&&!this.disableReactNativeAutoDeviceManagement("audio")){var d=o?this._nativeInCallAudioMode:"idle";this.nativeUtils().setAudioMode(d)}}},{key:"updateShowAndroidOngoingMeetingNotification",value:function(o){if(V()&&this.nativeUtils().setShowOngoingMeetingNotification){var d,u,p,g;if(this.properties.reactNativeConfig&&this.properties.reactNativeConfig.androidInCallNotification){var S=this.properties.reactNativeConfig.androidInCallNotification;d=S.title,u=S.subtitle,p=S.iconName,g=S.disableForCustomOverride}g&&(o=!1),this.nativeUtils().setShowOngoingMeetingNotification(o,d,u,p,this.callClientId)}}},{key:"updateNoOpRecordingEnsuringBackgroundContinuity",value:function(o){V()&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity(o)}},{key:"toggleParticipantAudioBasedOnNativeAudioFocus",value:function(){var o;if(V()){var d=(o=this._callMachine())===null||o===void 0||(o=o.store)===null||o===void 0?void 0:o.getState();for(var u in d==null?void 0:d.streams){var p=d.streams[u];p&&p.pendingTrack&&p.pendingTrack.kind==="audio"&&(p.pendingTrack.enabled=this._hasNativeAudioFocus)}}}},{key:"disableReactNativeAutoDeviceManagement",value:function(o){return this.properties.reactNativeConfig&&this.properties.reactNativeConfig.disableAutoDeviceManagement&&this.properties.reactNativeConfig.disableAutoDeviceManagement[o]}},{key:"absoluteUrl",value:function(o){if(o!==void 0){var d=document.createElement("a");return d.href=o,d.href}}},{key:"sayHello",value:function(){var o="hello, world.";return console.log(o),o}},{key:"_logUseAfterDestroy",value:function(){var o=Object.values($e)[0];if(this.needsLoad())if(o&&!o.needsLoad()){var d={action:Zt,level:"error",code:this.strictMode?9995:9997};o.sendMessageToCallMachine(d)}else this.strictMode||console.error("You are are attempting to use a call instance that was previously destroyed, which is unsupported. Please remove `strictMode: false` from your constructor properties to enable strict mode to track down and fix this unsupported usage.");else{var u={action:Zt,level:"error",code:this.strictMode?9995:9997};this._messageChannel.sendMessageToCallMachine(u,null,this.callClientId,this._iframe)}}},{key:"_logDuplicateInstanceAttempt",value:function(){for(var o=0,d=Object.values($e);o<d.length;o++){var u=d[o];u._callMachineInitialized?(u.sendMessageToCallMachine({action:Zt,level:"warn",code:this.allowMultipleCallInstances?9993:9992}),u._delayDuplicateInstanceLog=!1):u._delayDuplicateInstanceLog=!0}}},{key:"_maybeSendToSentry",value:function(o){var d,u,p,g;if(!((d=o.error)!==null&&d!==void 0&&d.type&&(![ul,ll,ys].includes(o.error.type)||o.error.type===ys&&o.error.msg.includes("deleted")))){var S=(u=this.properties)!==null&&u!==void 0&&u.url?new URL(this.properties.url):void 0,M="production";S&&S.host.includes(".staging.daily")&&(M="staging");var O,P,F,B,ke,Be=function(St){const kt=[Cc(),Ec(),Yc(),Qc(),rl(),sl(),Pc(),il()];return St.autoSessionTracking!==!1&&kt.push(nl()),kt}({}).filter(function(St){return!["BrowserApiErrors","Breadcrumbs","GlobalHandlers"].includes(St.name)}),_t=new Fc({dsn:"https://f10f1c81e5d44a4098416c0867a8b740@o77906.ingest.sentry.io/168844",transport:qc,stackParser:Kc,integrations:Be,environment:M}),Y=new Ue;if(Y.setClient(_t),_t.init(),this.session_id&&Y.setExtra("sessionId",this.session_id),this.properties){var he=I({},this.properties);he.userName=he.userName?"[Filtered]":void 0,he.userData=he.userData?"[Filtered]":void 0,he.token=he.token?"[Filtered]":void 0,Y.setExtra("properties",he)}if(S){var Ve=S.searchParams.get("domain");if(!Ve){var wt=S.host.match(/(.*?)\./);Ve=wt&&wt[1]||""}Ve&&Y.setTag("domain",Ve)}o.error&&(Y.setTag("fatalErrorType",o.error.type),Y.setExtra("errorDetails",o.error.details),!((O=o.error.details)===null||O===void 0)&&O.uri&&Y.setTag("serverAddress",o.error.details.uri),!((P=o.error.details)===null||P===void 0)&&P.workerGroup&&Y.setTag("workerGroup",o.error.details.workerGroup),!((F=o.error.details)===null||F===void 0)&&F.geoGroup&&Y.setTag("geoGroup",o.error.details.geoGroup),!((B=o.error.details)===null||B===void 0)&&B.on&&Y.setTag("connectionAttempt",o.error.details.on),(ke=o.error.details)!==null&&ke!==void 0&&ke.bundleUrl&&(Y.setTag("bundleUrl",o.error.details.bundleUrl),Y.setTag("bundleError",o.error.details.sourceError.type))),Y.setTags({callMode:this._callObjectMode?V()?"reactNative":(p=this.properties)!==null&&p!==void 0&&(p=p.dailyConfig)!==null&&p!==void 0&&(p=p.callMode)!==null&&p!==void 0&&p.includes("prebuilt")?this.properties.dailyConfig.callMode:"custom":"prebuilt-frame",version:t.version()});var Vt=((g=o.error)===null||g===void 0?void 0:g.msg)||o.errorMsg;Y.captureException(new Error(Vt))}}},{key:"_callMachine",value:function(){var o;return(o=window._daily)===null||o===void 0||(o=o.instances)===null||o===void 0||(o=o[this.callClientId])===null||o===void 0?void 0:o.callMachine}},{key:"_maybeUpdateInputSettings",value:function(o){if(!se(this._inputSettings,o)){var d=this._getInputSettings();this._inputSettings=o;var u=this._getInputSettings();se(d,u)||this.emitDailyJSEvent({action:Ss,inputSettings:u})}}}],[{key:"supportedBrowser",value:function(){if(V())return{supported:!0,mobile:!0,name:"React Native",version:null,supportsScreenShare:!0,supportsSfu:!0,supportsVideoProcessing:!1,supportsAudioProcessing:!1};var o=Ha.getParser(ve());return{supported:!!Ps(),mobile:o.getPlatformType()==="mobile",name:o.getBrowserName(),version:o.getBrowserVersion(),supportsFullscreen:!!As(),supportsScreenShare:!!cu(),supportsSfu:!!Ps(),supportsVideoProcessing:Uo(),supportsAudioProcessing:Bo()}}},{key:"version",value:function(){return"0.81.0"}},{key:"createCallObject",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return o.layout="none",new t(null,o)}},{key:"wrap",value:function(o){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(U(),!o||!o.contentWindow||typeof o.src!="string")throw new Error("DailyIframe::Wrap needs an iframe-like first argument");return d.layout||(d.customLayout?d.layout="custom-v1":d.layout="browser"),new t(o,d)}},{key:"createFrame",value:function(o,d){var u,p;U(),o&&d?(u=o,p=d):o&&o.append?(u=o,p={}):(u=document.body,p=o||{});var g=p.iframeStyle;g||(g=u===document.body?{position:"fixed",border:"1px solid black",backgroundColor:"white",width:"375px",height:"450px",right:"1em",bottom:"1em"}:{border:0,width:"100%",height:"100%"});var S=document.createElement("iframe");window.navigator&&window.navigator.userAgent.match(/Chrome\/61\./)?S.allow="microphone, camera":S.allow="microphone; camera; autoplay; display-capture; screen-wake-lock",S.style.visibility="hidden",u.appendChild(S),S.style.visibility=null,Object.keys(g).forEach(function(M){return S.style[M]=g[M]}),p.layout||(p.customLayout?p.layout="custom-v1":p.layout="browser");try{return new t(S,p)}catch(M){throw u.removeChild(S),M}}},{key:"createTransparentFrame",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};U();var d=document.createElement("iframe");return d.allow="microphone; camera; autoplay",d.style.cssText=`
|
|
32
31
|
position: fixed;
|
|
33
32
|
top: 0;
|
|
34
33
|
left: 0;
|
|
@@ -36,12 +35,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
36
35
|
height: 100%;
|
|
37
36
|
border: 0;
|
|
38
37
|
pointer-events: none;
|
|
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 Yt(t,e){return[Qn,Qe].includes(t)||e}function xn(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"This daily-js method",r=arguments.length>3?arguments[3]:void 0;if(Yt(t,e)){var i="".concat(n," not supported after joining a meeting.");throw r&&(i+=" ".concat(r)),console.error(i),new Error(i)}}function Ht(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method",n=arguments.length>2?arguments[2]:void 0;if(!t){var r="".concat(e,arguments.length>3&&arguments[3]!==void 0&&arguments[3]?" requires preAuth() or startCamera() to initialize call state.":" requires preAuth(), startCamera(), or join() to initialize call state.");throw n&&(r+=" ".concat(n)),console.error(r),new Error(r)}}function Dn(t){if(t){var e="A pre-call quality test is in progress. Please try ".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method"," again once testing has completed. Use stopTestCallQuality() to end it early.");throw console.error(e),new Error(e)}}function 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 D(){if(N())throw new Error("This daily-js method is not currently supported in React Native")}function mt(){if(!N())throw new Error("This daily-js method is only supported in React Native")}function _o(t){if(t===void 0)return!0;var e;if(typeof t=="string")e=t;else try{e=JSON.stringify(t),X(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 bo(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 wo(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(Wt).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 Wt.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 Wt.BGIMAGE:return!(c.source!==void 0&&!function(h){if(h.source==="default")return h.type="default",!0;if(h.source instanceof ArrayBuffer)return!0;if(St(h.source))return h.type="url",!!function(k){var y=new URL(k),w=y.pathname;if(y.protocol==="data:")try{var T=w.substring(w.indexOf(":")+1,w.indexOf(";")).split("/")[1];return On.includes(T)}catch(B){return console.error("failed to deduce blob content type",B),!1}var M=w.split(".").at(-1).toLowerCase().trim();return On.includes(M)}(h.source)||(console.error("invalid image type; supported types: [".concat(On.join(", "),"]")),!1);return f=h.source,_=Number(f),isNaN(_)||!Number.isInteger(_)||_<=0||_>Zi?(console.error("invalid image selection; must be an int, > 0, <= ".concat(Zi)),!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(uo).includes(e)&&(console.error("inputSettings audio processor type invalid"),1)))));var e,n,r}function So(t,e){var n,r=[];t.video&&!po((n=e==null?void 0:e.useLegacyVideoProcessor)!==null&&n!==void 0&&n)&&(delete t.video,r.push("video")),t.audio&&!fo()&&(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(Wt).join(" | "),e=Object.values(uo).join(" | ");return"inputSettings must be of the form: { video?: { processor: { type: [ ".concat(t," ], config?: {} } }, audio?: { processor: {type: [ ").concat(e," ] } } }")}function ko(t){var e=t.allowAllParticipantsKey;return"receiveSettings must be of the form { [<remote participant id> | ".concat(ic).concat(e?' | "'.concat(sc,'"'):"","]: ")+'{ [video: [{ layer: [<non-negative integer> | "inherit"] } | "inherit"]], [screenVideo: [{ layer: [<non-negative integer> | "inherit"] } | "inherit"]] }}}'}function Eo(){return"customIntegrations should be an object of type ".concat(JSON.stringify(sr),".")}function To(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 Co(t){if(!t||t&&U(t)!=="object"||Array.isArray(t))return console.error(Eo()),!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 Mo(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(!Mo(t[n],e[n]))return!1;return!0;default:return!1}}function bs(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 ws(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 Ss(t,e,n){return!(typeof t!="number"||t<e||t>n)}function Ln(t,e){return t&&!e&&delete t.data,t}function Oo(t,e){return function(){return t.apply(e,arguments)}}const{toString:Ll}=Object.prototype,{getPrototypeOf:Mr}=Object,fn=(t=>e=>{const n=Ll.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 Nl(t){return t!==null&&!Ot(t)&&t.constructor!==null&&!Ot(t.constructor)&&se(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Ao=me("ArrayBuffer");function jl(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Ao(t.buffer),e}const Il=mn("string"),se=mn("function"),Po=mn("number"),gn=t=>t!==null&&typeof t=="object",Bl=t=>t===!0||t===!1,Kt=t=>{if(fn(t)!=="object")return!1;const e=Mr(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},Fl=me("Date"),Ul=me("File"),ql=me("Blob"),Jl=me("FileList"),Vl=t=>gn(t)&&se(t.pipe),$l=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]"))},Gl=me("URLSearchParams"),[Hl,zl,Wl,Yl]=["ReadableStream","Request","Response","Headers"].map(me),Kl=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Pt(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 Ro(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 xo=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Do=t=>!Ot(t)&&t!==xo;function ar(){const{caseless:t}=Do(this)&&this||{},e={},n=(r,i)=>{const s=t&&Ro(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]&&Pt(arguments[r],n);return e}const Ql=(t,e,n,{allOwnKeys:r}={})=>(Pt(e,(i,s)=>{n&&se(i)?t[s]=Oo(i,n):t[s]=i},{allOwnKeys:r}),t),Xl=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Zl=(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)},eu=(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&&Mr(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},tu=(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},nu=t=>{if(!t)return null;if(ut(t))return t;let e=t.length;if(!Po(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},ru=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Mr(Uint8Array)),iu=(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])}},su=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},ou=me("HTMLFormElement"),au=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),ks=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),cu=me("RegExp"),Lo=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};Pt(n,(i,s)=>{let a;(a=e(i,s,t))!==!1&&(r[s]=a||i)}),Object.defineProperties(t,r)},lu=t=>{Lo(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+"'")})}})},uu=(t,e)=>{const n={},r=i=>{i.forEach(s=>{n[s]=!0})};return ut(t)?r(t):r(String(t).split(e)),n},du=()=>{},hu=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e,Nn="abcdefghijklmnopqrstuvwxyz",Es="0123456789",No={DIGIT:Es,ALPHA:Nn,ALPHA_DIGIT:Nn+Nn.toUpperCase()+Es},pu=(t=16,e=No.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n};function fu(t){return!!(t&&se(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const mu=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 Pt(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)},gu=me("AsyncFunction"),vu=t=>t&&(gn(t)||se(t))&&se(t.then)&&se(t.catch),v={isArray:ut,isArrayBuffer:Ao,isBuffer:Nl,isFormData:$l,isArrayBufferView:jl,isString:Il,isNumber:Po,isBoolean:Bl,isObject:gn,isPlainObject:Kt,isReadableStream:Hl,isRequest:zl,isResponse:Wl,isHeaders:Yl,isUndefined:Ot,isDate:Fl,isFile:Ul,isBlob:ql,isRegExp:cu,isFunction:se,isStream:Vl,isURLSearchParams:Gl,isTypedArray:ru,isFileList:Jl,forEach:Pt,merge:ar,extend:Ql,trim:Kl,stripBOM:Xl,inherits:Zl,toFlatObject:eu,kindOf:fn,kindOfTest:me,endsWith:tu,toArray:nu,forEachEntry:iu,matchAll:su,isHTMLForm:ou,hasOwnProperty:ks,hasOwnProp:ks,reduceDescriptors:Lo,freezeMethods:lu,toObjectSet:uu,toCamelCase:au,noop:du,toFiniteNumber:hu,findKey:Ro,global:xo,isContextDefined:Do,ALPHABET:No,generateString:pu,isSpecCompliantForm:fu,toJSONObject:mu,isAsyncFn:gu,isThenable:vu};function P(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}v.inherits(P,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:v.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const jo=P.prototype,Io={};["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=>{Io[t]={value:t}});Object.defineProperties(P,Io);Object.defineProperty(jo,"isAxiosError",{value:!0});P.from=(t,e,n,r,i,s)=>{const a=Object.create(jo);return v.toFlatObject(t,a,function(l){return l!==Error.prototype},c=>c!=="isAxiosError"),P.call(a,t.message,e,n,r,i),a.cause=t,a.name=t.name,s&&Object.assign(a,s),a};const yu=null;function cr(t){return v.isPlainObject(t)||v.isArray(t)}function Bo(t){return v.endsWith(t,"[]")?t.slice(0,-2):t}function Ts(t,e,n){return t?t.concat(e).map(function(i,s){return i=Bo(i),!n&&s?"["+i+"]":i}).join(n?".":""):e}function _u(t){return v.isArray(t)&&!t.some(cr)}const bu=v.toFlatObject(v,{},null,function(e){return/^is[A-Z]/.test(e)});function vn(t,e,n){if(!v.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=v.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,T){return!v.isUndefined(T[w])});const r=n.metaTokens,i=n.visitor||h,s=n.dots,a=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&v.isSpecCompliantForm(e);if(!v.isFunction(i))throw new TypeError("visitor must be a function");function p(y){if(y===null)return"";if(v.isDate(y))return y.toISOString();if(!l&&v.isBlob(y))throw new P("Blob is not supported. Use a Buffer instead.");return v.isArrayBuffer(y)||v.isTypedArray(y)?l&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function h(y,w,T){let M=y;if(y&&!T&&typeof y=="object"){if(v.endsWith(w,"{}"))w=r?w:w.slice(0,-2),y=JSON.stringify(y);else if(v.isArray(y)&&_u(y)||(v.isFileList(y)||v.endsWith(w,"[]"))&&(M=v.toArray(y)))return w=Bo(w),M.forEach(function(L,ne){!(v.isUndefined(L)||L===null)&&e.append(a===!0?Ts([w],ne,s):a===null?w:w+"[]",p(L))}),!1}return cr(y)?!0:(e.append(Ts(T,w,s),p(y)),!1)}const f=[],_=Object.assign(bu,{defaultVisitor:h,convertValue:p,isVisitable:cr});function k(y,w){if(!v.isUndefined(y)){if(f.indexOf(y)!==-1)throw Error("Circular reference detected in "+w.join("."));f.push(y),v.forEach(y,function(M,B){(!(v.isUndefined(M)||M===null)&&i.call(e,M,v.isString(B)?B.trim():B,w,_))===!0&&k(M,w?w.concat(B):[B])}),f.pop()}}if(!v.isObject(t))throw new TypeError("data must be an object");return k(t),e}function Cs(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function Or(t,e){this._pairs=[],t&&vn(t,this,e)}const Fo=Or.prototype;Fo.append=function(e,n){this._pairs.push([e,n])};Fo.toString=function(e){const n=e?function(r){return e.call(this,r,Cs)}:Cs;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function wu(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Uo(t,e,n){if(!e)return t;const r=n&&n.encode||wu,i=n&&n.serialize;let s;if(i?s=i(e,n):s=v.isURLSearchParams(e)?e.toString():new Or(e,n).toString(r),s){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class Ms{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){v.forEach(this.handlers,function(r){r!==null&&e(r)})}}const qo={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Su=typeof URLSearchParams<"u"?URLSearchParams:Or,ku=typeof FormData<"u"?FormData:null,Eu=typeof Blob<"u"?Blob:null,Tu={isBrowser:!0,classes:{URLSearchParams:Su,FormData:ku,Blob:Eu},protocols:["http","https","file","blob","url","data"]},Ar=typeof window<"u"&&typeof document<"u",Cu=(t=>Ar&&["ReactNative","NativeScript","NS"].indexOf(t)<0)(typeof navigator<"u"&&navigator.product),Mu=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Ou=Ar&&window.location.href||"http://localhost",Au=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ar,hasStandardBrowserEnv:Cu,hasStandardBrowserWebWorkerEnv:Mu,origin:Ou},Symbol.toStringTag,{value:"Module"})),ue={...Au,...Tu};function Pu(t,e){return vn(t,new ue.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,s){return ue.isNode&&v.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function Ru(t){return v.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function xu(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 Jo(t){function e(n,r,i,s){let a=n[s++];if(a==="__proto__")return!0;const c=Number.isFinite(+a),l=s>=n.length;return a=!a&&v.isArray(i)?i.length:a,l?(v.hasOwnProp(i,a)?i[a]=[i[a],r]:i[a]=r,!c):((!i[a]||!v.isObject(i[a]))&&(i[a]=[]),e(n,r,i[a],s)&&v.isArray(i[a])&&(i[a]=xu(i[a])),!c)}if(v.isFormData(t)&&v.isFunction(t.entries)){const n={};return v.forEachEntry(t,(r,i)=>{e(Ru(r),i,n,0)}),n}return null}function Du(t,e,n){if(v.isString(t))try{return(e||JSON.parse)(t),v.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const Rt={transitional:qo,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,s=v.isObject(e);if(s&&v.isHTMLForm(e)&&(e=new FormData(e)),v.isFormData(e))return i?JSON.stringify(Jo(e)):e;if(v.isArrayBuffer(e)||v.isBuffer(e)||v.isStream(e)||v.isFile(e)||v.isBlob(e)||v.isReadableStream(e))return e;if(v.isArrayBufferView(e))return e.buffer;if(v.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let c;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Pu(e,this.formSerializer).toString();if((c=v.isFileList(e))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return vn(c?{"files[]":e}:e,l&&new l,this.formSerializer)}}return s||i?(n.setContentType("application/json",!1),Du(e)):e}],transformResponse:[function(e){const n=this.transitional||Rt.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(v.isResponse(e)||v.isReadableStream(e))return e;if(e&&v.isString(e)&&(r&&!this.responseType||i)){const a=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(c){if(a)throw c.name==="SyntaxError"?P.from(c,P.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}}};v.forEach(["delete","get","head","post","put","patch"],t=>{Rt.headers[t]={}});const Lu=v.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Nu=t=>{const e={};let n,r,i;return t&&t.split(`
|
|
40
|
-
`).forEach(function(a){i=a.indexOf(":"),n=a.substring(0,i).trim().toLowerCase(),r=a.substring(i+1).trim(),!(!n||e[n]&&
|
|
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[Os]=this[Os]={accessors:{}}).accessors,i=this.prototype;function s(a){const c=gt(a);r[c]||(Fu(i,a),r[c]=!0)}return v.isArray(e)?e.forEach(s):s(e),this}}Z.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);v.reduceDescriptors(Z.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});v.freezeMethods(Z);function In(t,e){const n=this||Rt,r=e||n,i=Z.from(r.headers);let s=r.data;return v.forEach(t,function(c){s=c.call(n,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function Vo(t){return!!(t&&t.__CANCEL__)}function dt(t,e,n){P.call(this,t??"canceled",P.ERR_CANCELED,e,n),this.name="CanceledError"}v.inherits(dt,P,{__CANCEL__:!0});function $o(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new P("Request failed with status code "+n.status,[P.ERR_BAD_REQUEST,P.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Uu(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function qu(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 Ju(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=qu(50,250);return Ju(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)},Vu=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=v.isString(a)?i(a):a;return c.protocol===r.protocol&&c.host===r.host}}():function(){return function(){return!0}}(),$u=ue.hasStandardBrowserEnv?{write(t,e,n,r,i,s){const a=[t+"="+encodeURIComponent(e)];v.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),v.isString(r)&&a.push("path="+r),v.isString(i)&&a.push("domain="+i),s===!0&&a.push("secure"),document.cookie=a.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Gu(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Hu(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Go(t,e){return t&&!Gu(e)?Hu(t,e):e}const As=t=>t instanceof Z?{...t}:t;function Ye(t,e){e=e||{};const n={};function r(p,h,f){return v.isPlainObject(p)&&v.isPlainObject(h)?v.merge.call({caseless:f},p,h):v.isPlainObject(h)?v.merge({},h):v.isArray(h)?h.slice():h}function i(p,h,f){if(v.isUndefined(h)){if(!v.isUndefined(p))return r(void 0,p,f)}else return r(p,h,f)}function s(p,h){if(!v.isUndefined(h))return r(void 0,h)}function a(p,h){if(v.isUndefined(h)){if(!v.isUndefined(p))return r(void 0,p)}else return r(void 0,h)}function c(p,h,f){if(f in e)return r(p,h);if(f in t)return r(void 0,p)}const l={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c,headers:(p,h)=>i(As(p),As(h),!0)};return v.forEach(Object.keys(Object.assign({},t,e)),function(h){const f=l[h]||i,_=f(t[h],e[h],h);v.isUndefined(_)&&f!==c||(n[h]=_)}),n}const Ho=t=>{const e=Ye({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:s,headers:a,auth:c}=e;e.headers=a=Z.from(a),e.url=Uo(Go(e.baseURL,e.url),t.params,t.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let l;if(v.isFormData(n)){if(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&&v.isFunction(r)&&(r=r(e)),r||r!==!1&&Vu(e.url))){const p=i&&s&&$u.read(s);p&&a.set(i,p)}return e},zu=typeof XMLHttpRequest<"u",Wu=zu&&function(t){return new Promise(function(n,r){const i=Ho(t);let s=i.data;const a=Z.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=Z.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),w={data:!c||c==="text"||c==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:k,config:t,request:h};$o(function(M){n(M),p()},function(M){r(M),p()},w),h=null}"onloadend"in h?h.onloadend=f:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(f)},h.onabort=function(){h&&(r(new P("Request aborted",P.ECONNABORTED,i,h)),h=null)},h.onerror=function(){r(new P("Network Error",P.ERR_NETWORK,i,h)),h=null},h.ontimeout=function(){let y=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const w=i.transitional||qo;i.timeoutErrorMessage&&(y=i.timeoutErrorMessage),r(new P(y,w.clarifyTimeoutError?P.ETIMEDOUT:P.ECONNABORTED,i,h)),h=null},s===void 0&&a.setContentType(null),"setRequestHeader"in h&&v.forEach(a.toJSON(),function(y,w){h.setRequestHeader(w,y)}),v.isUndefined(i.withCredentials)||(h.withCredentials=!!i.withCredentials),c&&c!=="json"&&(h.responseType=i.responseType),typeof i.onDownloadProgress=="function"&&h.addEventListener("progress",an(i.onDownloadProgress,!0)),typeof i.onUploadProgress=="function"&&h.upload&&h.upload.addEventListener("progress",an(i.onUploadProgress)),(i.cancelToken||i.signal)&&(l=k=>{h&&(r(!k||k.type?new dt(null,t,h):k),h.abort(),h=null)},i.cancelToken&&i.cancelToken.subscribe(l),i.signal&&(i.signal.aborted?l():i.signal.addEventListener("abort",l)));const _=Uu(i.url);if(_&&ue.protocols.indexOf(_)===-1){r(new P("Unsupported protocol "+_+":",P.ERR_BAD_REQUEST,t));return}h.send(s||null)})},Yu=(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 P?p:new dt(p instanceof Error?p.message:p))}};let s=e&&setTimeout(()=>{i(new P(`timeout ${e} of ms exceeded`,P.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}]},Ku=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},Qu=async function*(t,e,n){for await(const r of t)yield*Ku(ArrayBuffer.isView(r)?r:await n(String(r)),e)},Ps=(t,e,n,r,i)=>{const s=Qu(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})},Rs=(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",zo=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())),Xu=zo&&(()=>{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})(),xs=64*1024,ur=zo&&!!(()=>{try{return v.isReadableStream(new Response("").body)}catch{}})(),cn={stream:ur&&(t=>t.body)};yn&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!cn[e]&&(cn[e]=v.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new P(`Response type '${e}' is not supported`,P.ERR_NOT_SUPPORT,r)})})})(new Response);const Zu=async t=>{if(t==null)return 0;if(v.isBlob(t))return t.size;if(v.isSpecCompliantForm(t))return(await new Request(t).arrayBuffer()).byteLength;if(v.isArrayBufferView(t))return t.byteLength;if(v.isURLSearchParams(t)&&(t=t+""),v.isString(t))return(await lr(t)).byteLength},ed=async(t,e)=>{const n=v.toFiniteNumber(t.getContentLength());return n??Zu(e)},td=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:_}=Ho(t);p=p?(p+"").toLowerCase():"text";let[k,y]=i||s||a?Yu([i,s],a):[],w,T;const M=()=>{!w&&setTimeout(()=>{k&&k.unsubscribe()}),w=!0};let B;try{if(l&&Xu&&n!=="get"&&n!=="head"&&(B=await ed(h,r))!==0){let oe=new Request(e,{method:"POST",body:r,duplex:"half"}),_e;v.isFormData(r)&&(_e=oe.headers.get("content-type"))&&h.setContentType(_e),oe.body&&(r=Ps(oe.body,xs,Rs(B,an(l)),null,lr))}v.isString(f)||(f=f?"cors":"omit"),T=new Request(e,{..._,signal:k,method:n.toUpperCase(),headers:h.normalize().toJSON(),body:r,duplex:"half",withCredentials:f});let L=await fetch(T);const ne=ur&&(p==="stream"||p==="response");if(ur&&(c||ne)){const oe={};["status","statusText","headers"].forEach(ht=>{oe[ht]=L[ht]});const _e=v.toFiniteNumber(L.headers.get("content-length"));L=new Response(Ps(L.body,xs,c&&Rs(_e,an(c,!0)),ne&&M,lr),oe)}p=p||"text";let Ne=await cn[v.findKey(cn,p)||"text"](L,t);return!ne&&M(),y&&y(),await new Promise((oe,_e)=>{$o(oe,_e,{data:Ne,headers:Z.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 P("Network Error",P.ERR_NETWORK,t,T),{cause:L.cause||L}):P.from(L,L&&L.code,t,T)}}),dr={http:yu,xhr:Wu,fetch:td};v.forEach(dr,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Ds=t=>`- ${t}`,nd=t=>v.isFunction(t)||t===null||t===!1,Wo={getAdapter:t=>{t=v.isArray(t)?t:[t];const{length:e}=t;let n,r;const i={};for(let s=0;s<e;s++){n=t[s];let a;if(r=n,!nd(n)&&(r=dr[(a=String(n)).toLowerCase()],r===void 0))throw new P(`Unknown adapter '${a}'`);if(r)break;i[a||"#"+s]=r}if(!r){const s=Object.entries(i).map(([c,l])=>`adapter ${c} `+(l===!1?"is not supported by the environment":"is not available in the build"));let a=e?s.length>1?`since :
|
|
42
|
-
`+s.map(
|
|
43
|
-
`):" "+
|
|
44
|
-
`+s):r.stack=s}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=
|
|
38
|
+
`,document.body.appendChild(d),o.layout||(o.layout="custom-v1"),t.wrap(d,o)}},{key:"getCallInstance",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0;return o?$e[o]:Object.values($e)[0]}}]);var e,n,r,i,s,a,c,l,f,h,v,k,E,y,m,b,w,C,A,x,j,R,J,X,Oe,ot,at,Yr,Zr,ei,ti,ni,ri,ii,si,oi,ai,ci}();function ct(t,e){var n={};for(var r in t)if(t[r]instanceof MediaStreamTrack)console.warn("MediaStreamTrack found in props or cache.",r),n[r]=xe;else if(r==="dailyConfig"){if(t[r].modifyLocalSdpHook){var i=window._daily.instances[e].customCallbacks||{};i.modifyLocalSdpHook=t[r].modifyLocalSdpHook,window._daily.instances[e].customCallbacks=i,delete t[r].modifyLocalSdpHook}if(t[r].modifyRemoteSdpHook){var s=window._daily.instances[e].customCallbacks||{};s.modifyRemoteSdpHook=t[r].modifyRemoteSdpHook,window._daily.instances[e].customCallbacks=s,delete t[r].modifyRemoteSdpHook}n[r]=t[r]}else n[r]=t[r];return n}function H(t){var e=arguments.length>2?arguments[2]:void 0;if(t!==He){var n="".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method"," only supported after join.");throw e&&(n+=" ".concat(e)),console.error(n),new Error(n)}}function an(t,e){return[_r,He].includes(t)||e}function Yn(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"This daily-js method",r=arguments.length>3?arguments[3]:void 0;if(an(t,e)){var i="".concat(n," not supported after joining a meeting.");throw r&&(i+=" ".concat(r)),console.error(i),new Error(i)}}function nn(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method",n=arguments.length>2?arguments[2]:void 0;if(!t){var r="".concat(e,arguments.length>3&&arguments[3]!==void 0&&arguments[3]?" requires preAuth() or startCamera() to initialize call state.":" requires preAuth(), startCamera(), or join() to initialize call state.");throw n&&(r+=" ".concat(n)),console.error(r),new Error(r)}}function Zn(t){if(t){var e="A pre-call quality test is in progress. Please try ".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method"," again once testing has completed. Use stopTestCallQuality() to end it early.");throw console.error(e),new Error(e)}}function ye(t){if(!t){var e="".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method"," is only supported on custom callObject instances");throw console.error(e),new Error(e)}}function le(t){if(t){var e="".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method"," is only supported as part of Daily's Prebuilt");throw console.error(e),new Error(e)}}function U(){if(V())throw new Error("This daily-js method is not currently supported in React Native")}function Tt(){if(!V())throw new Error("This daily-js method is only supported in React Native")}function Zo(t){if(t===void 0)return!0;var e;if(typeof t=="string")e=t;else try{e=JSON.stringify(t),se(JSON.parse(e),t)||console.warn("The userData provided will be modified when serialized.")}catch(n){throw Error("userData must be serializable to JSON: ".concat(n))}if(e.length>4096)throw Error("userData is too large (".concat(e.length," characters). Maximum size suppported is ").concat(4096,"."));return!0}function ea(t,e){for(var n=e.allowAllParticipantsKey,r=function(v){var k=["local"];return n||k.push("*"),v&&!k.includes(v)},i=function(v){return!!(v.layer===void 0||Number.isInteger(v.layer)&&v.layer>=0||v.layer==="inherit")},s=function(v){return!!v&&!(v.video&&!i(v.video))&&!(v.screenVideo&&!i(v.screenVideo))},a=0,c=Object.entries(t);a<c.length;a++){var l=re(c[a],2),f=l[0],h=l[1];if(!r(f)||!s(h))return!1}return!0}function ta(t){if(q(t)!=="object")return!1;for(var e=0,n=Object.entries(t);e<n.length;e++){var r=re(n[e],2),i=r[0],s=r[1];switch(i){case"video":if(q(s)!=="object")return!1;for(var a=0,c=Object.entries(s);a<c.length;a++){var l=re(c[a],2),f=l[0],h=l[1];switch(f){case"processor":if(!Nu(h))return!1;break;case"settings":if(!eo(h))return!1;break;default:return!1}}break;case"audio":if(q(s)!=="object")return!1;for(var v=0,k=Object.entries(s);v<k.length;v++){var E=re(k[v],2),y=E[0],m=E[1];switch(y){case"processor":if(!Du(m))return!1;break;case"settings":if(!eo(m))return!1;break;default:return!1}}break;default:return!1}}return!0}function na(t,e,n){var r,i=[];t.video&&t.video.processor&&(Uo((r=e==null?void 0:e.useLegacyVideoProcessor)!==null&&r!==void 0&&r)||(t.video.settings?delete t.video.processor:delete t.video,i.push("video"))),t.audio&&t.audio.processor&&(Bo()||(t.audio.settings?delete t.audio.processor:delete t.audio,i.push("audio"))),i.length>0&&console.error("Ignoring settings for browser- or platform-unsupported input processor(s): ".concat(i.join(", "))),t.audio&&t.audio.settings&&(t.audio.settings.customTrack?(n.audioTrack=t.audio.settings.customTrack,t.audio.settings={customTrack:xe}):delete n.audioTrack),t.video&&t.video.settings&&(t.video.settings.customTrack?(n.videoTrack=t.video.settings.customTrack,t.video.settings={customTrack:xe}):delete n.videoTrack)}function Du(t){if(V())return console.warn("Video processing is not yet supported in React Native"),!1;var e=["type"];return!!t&&q(t)==="object"&&(Object.keys(t).filter(function(n){return!e.includes(n)}).forEach(function(n){console.warn("invalid key inputSettings -> audio -> processor : ".concat(n)),delete t[n]}),!!function(n){return typeof n!="string"?!1:Object.values(No).includes(n)?!0:(console.error("inputSettings audio processor type invalid"),!1)}(t.type))}function Nu(t){if(V())return console.warn("Video processing is not yet supported in React Native"),!1;var e=["type","config"];return!t||q(t)!=="object"||!function(n){return typeof n!="string"?!1:Object.values(on).includes(n)?!0:(console.error("inputSettings video processor type invalid"),!1)}(t.type)||t.config&&(q(t.config)!=="object"||!function(n,r){var i=Object.keys(r);if(i.length===0)return!0;var s="invalid object in inputSettings -> video -> processor -> config";switch(n){case on.BGBLUR:return i.length>1||i[0]!=="strength"?(console.error(s),!1):!(typeof r.strength!="number"||r.strength<=0||r.strength>1||isNaN(r.strength))||(console.error("".concat(s,"; expected: {0 < strength <= 1}, got: ").concat(r.strength)),!1);case on.BGIMAGE:return!(r.source!==void 0&&!function(a){if(a.source==="default")return a.type="default",!0;if(a.source instanceof ArrayBuffer)return!0;if(fn(a.source))return a.type="url",!!function(f){var h=new URL(f),v=h.pathname;if(h.protocol==="data:")try{var k=v.substring(v.indexOf(":")+1,v.indexOf(";")).split("/")[1];return Gn.includes(k)}catch(y){return console.error("failed to deduce blob content type",y),!1}var E=v.split(".").at(-1).toLowerCase().trim();return Gn.includes(E)}(a.source)||(console.error("invalid image type; supported types: [".concat(Gn.join(", "),"]")),!1);return c=a.source,l=Number(c),isNaN(l)||!Number.isInteger(l)||l<=0||l>10?(console.error("invalid image selection; must be an int, > 0, <= ".concat(10)),!1):(a.type="daily-preselect",!0);var c,l}(r));default:return!0}}(t.type,t.config))?!1:(Object.keys(t).filter(function(n){return!e.includes(n)}).forEach(function(n){console.warn("invalid key inputSettings -> video -> processor : ".concat(n)),delete t[n]}),!0)}function eo(t){return q(t)==="object"&&(!t.customTrack||t.customTrack instanceof MediaStreamTrack)}function Mr(){var t=Object.values(on).join(" | "),e=Object.values(No).join(" | ");return"inputSettings must be of the form: { video?: { processor?: { type: [ ".concat(t," ], config?: {} } }, audio?: { processor: {type: [ ").concat(e," ] } } }")}function ra(t){var e=t.allowAllParticipantsKey;return"receiveSettings must be of the form { [<remote participant id> | ".concat(cl).concat(e?' | "'.concat("*",'"'):"","]: ")+'{ [video: [{ layer: [<non-negative integer> | "inherit"] } | "inherit"]], [screenVideo: [{ layer: [<non-negative integer> | "inherit"] } | "inherit"]] }}}'}function ia(){return"customIntegrations should be an object of type ".concat(JSON.stringify(Cr),".")}function sa(t){if(t&&q(t)!=="object"||Array.isArray(t))return console.error("customTrayButtons should be an Object of the type ".concat(JSON.stringify(bn),".")),!1;if(t)for(var e=0,n=Object.entries(t);e<n.length;e++)for(var r=re(n[e],1)[0],i=0,s=Object.entries(t[r]);i<s.length;i++){var a=re(s[i],2),c=a[0],l=a[1],f=bn.id[c];if(!f)return console.error("customTrayButton does not support key ".concat(c)),!1;switch(c){case"iconPath":case"iconPathDarkMode":if(!fn(l))return console.error("customTrayButton ".concat(c," should be a url.")),!1;break;case"visualState":if(!["default","sidebar-open","active"].includes(l))return console.error("customTrayButton ".concat(c," should be ").concat(f,". Got: ").concat(l)),!1;break;default:if(q(l)!==f)return console.error("customTrayButton ".concat(c," should be a ").concat(f,".")),!1}}return!0}function oa(t){if(!t||t&&q(t)!=="object"||Array.isArray(t))return console.error(ia()),!1;for(var e=function(v){return"".concat(v," should be ").concat(Cr.id[v])},n=function(v,k){return console.error("customIntegration ".concat(v,": ").concat(k))},r=0,i=Object.entries(t);r<i.length;r++){var s=re(i[r],1)[0];if(!("label"in t[s]))return n(s,"label is required"),!1;if(!("location"in t[s]))return n(s,"location is required"),!1;if(!("src"in t[s])&&!("srcdoc"in t[s]))return n(s,"src or srcdoc is required"),!1;for(var a=0,c=Object.entries(t[s]);a<c.length;a++){var l=re(c[a],2),f=l[0],h=l[1];switch(f){case"allow":case"csp":case"name":case"referrerPolicy":case"sandbox":if(typeof h!="string")return n(s,e(f)),!1;break;case"iconURL":if(!fn(h))return n(s,"".concat(f," should be a url")),!1;break;case"src":if("srcdoc"in t[s])return n(s,"cannot have both src and srcdoc"),!1;if(!fn(h))return n(s,'src "'.concat(h,'" is not a valid URL')),!1;break;case"srcdoc":if("src"in t[s])return n(s,"cannot have both src and srcdoc"),!1;if(typeof h!="string")return n(s,e(f)),!1;break;case"location":if(!["main","sidebar"].includes(h))return n(s,e(f)),!1;break;case"controlledBy":if(h!=="*"&&h!=="owners"&&(!Array.isArray(h)||h.some(function(v){return typeof v!="string"})))return n(s,e(f)),!1;break;case"shared":if((!Array.isArray(h)||h.some(function(v){return typeof v!="string"}))&&h!=="owners"&&typeof h!="boolean")return n(s,e(f)),!1;break;default:if(!Cr.id[f])return console.error("customIntegration does not support key ".concat(f)),!1}}}return!0}function aa(t,e){if(e===void 0)return!1;switch(q(e)){case"string":return q(t)===e;case"object":if(q(t)!=="object")return!1;for(var n in t)if(!aa(t[n],e[n]))return!1;return!0;default:return!1}}function to(t,e){var n=t.sessionId,r=t.toEndPoint,i=t.callerId,s=t.useSipRefer;if(!n||!r)throw new Error("".concat(e,"() requires a sessionId and toEndPoint"));if(typeof n!="string"||typeof r!="string")throw new Error("Invalid paramater: sessionId and toEndPoint must be of type string");if(s&&!r.startsWith("sip:"))throw new Error('"toEndPoint" must be a "sip" address');if(!r.startsWith("sip:")&&!r.startsWith("+"))throw new Error("toEndPoint: ".concat(r,' must starts with either "sip:" or "+"'));if(i&&typeof i!="string")throw new Error("callerId must be of type string");if(i&&!r.startsWith("+"))throw new Error("callerId is only valid when transferring to a PSTN number")}function no(t){if(q(t)!=="object")throw new Error('RemoteMediaPlayerSettings: must be "object" type');if(t.state&&!Object.values(wr).includes(t.state))throw new Error("Invalid value for RemoteMediaPlayerSettings.state, valid values are: "+JSON.stringify(wr));if(t.volume){if(typeof t.volume!="number")throw new Error('RemoteMediaPlayerSettings.volume: must be "number" type');if(t.volume<0||t.volume>2)throw new Error("RemoteMediaPlayerSettings.volume: must be between 0.0 - 2.0")}}function ro(t,e,n){return!(typeof t!="number"||t<e||t>n)}function er(t,e){return t&&!e&&delete t.data,t}function ca(t,e){return function(){return t.apply(e,arguments)}}const{toString:Fu}=Object.prototype,{getPrototypeOf:Kr}=Object,{iterator:Pn,toStringTag:la}=Symbol,jn=(t=>e=>{const n=Fu.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Se=t=>(t=t.toLowerCase(),e=>jn(e)===t),xn=t=>e=>typeof e===t,{isArray:yt}=Array,It=xn("undefined");function Nt(t){return t!==null&&!It(t)&&t.constructor!==null&&!It(t.constructor)&&ae(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const ua=Se("ArrayBuffer");function Uu(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&ua(t.buffer),e}const Bu=xn("string"),ae=xn("function"),da=xn("number"),Ft=t=>t!==null&&typeof t=="object",Vu=t=>t===!0||t===!1,cn=t=>{if(jn(t)!=="object")return!1;const e=Kr(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(la in t)&&!(Pn in t)},Ju=t=>{if(!Ft(t)||Nt(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},qu=Se("Date"),$u=Se("File"),zu=Se("Blob"),Hu=Se("FileList"),Wu=t=>Ft(t)&&ae(t.pipe),Gu=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||ae(t.append)&&((e=jn(t))==="formdata"||e==="object"&&ae(t.toString)&&t.toString()==="[object FormData]"))},Ku=Se("URLSearchParams"),[Qu,Xu,Yu,Zu]=["ReadableStream","Request","Response","Headers"].map(Se),ed=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ut(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,i;if(typeof t!="object"&&(t=[t]),yt(t))for(r=0,i=t.length;r<i;r++)e.call(null,t[r],r,t);else{if(Nt(t))return;const s=n?Object.getOwnPropertyNames(t):Object.keys(t),a=s.length;let c;for(r=0;r<a;r++)c=s[r],e.call(null,t[c],c,t)}}function fa(t,e){if(Nt(t))return null;e=e.toLowerCase();const n=Object.keys(t);let r=n.length,i;for(;r-- >0;)if(i=n[r],e===i.toLowerCase())return i;return null}const Ge=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ha=t=>!It(t)&&t!==Ge;function Or(){const{caseless:t}=ha(this)&&this||{},e={},n=(r,i)=>{const s=t&&fa(e,i)||i;cn(e[s])&&cn(r)?e[s]=Or(e[s],r):cn(r)?e[s]=Or({},r):yt(r)?e[s]=r.slice():e[s]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&Ut(arguments[r],n);return e}const td=(t,e,n,{allOwnKeys:r}={})=>(Ut(e,(i,s)=>{n&&ae(i)?t[s]=ca(i,n):t[s]=i},{allOwnKeys:r}),t),nd=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),rd=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},id=(t,e,n,r)=>{let i,s,a;const c={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),s=i.length;s-- >0;)a=i[s],(!r||r(a,t,e))&&!c[a]&&(e[a]=t[a],c[a]=!0);t=n!==!1&&Kr(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},sd=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},od=t=>{if(!t)return null;if(yt(t))return t;let e=t.length;if(!da(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},ad=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Kr(Uint8Array)),cd=(t,e)=>{const r=(t&&t[Pn]).call(t);let i;for(;(i=r.next())&&!i.done;){const s=i.value;e.call(t,s[0],s[1])}},ld=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},ud=Se("HTMLFormElement"),dd=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),io=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),fd=Se("RegExp"),pa=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};Ut(n,(i,s)=>{let a;(a=e(i,s,t))!==!1&&(r[s]=a||i)}),Object.defineProperties(t,r)},hd=t=>{pa(t,(e,n)=>{if(ae(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(ae(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},pd=(t,e)=>{const n={},r=i=>{i.forEach(s=>{n[s]=!0})};return yt(t)?r(t):r(String(t).split(e)),n},md=()=>{},gd=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function vd(t){return!!(t&&ae(t.append)&&t[la]==="FormData"&&t[Pn])}const yd=t=>{const e=new Array(10),n=(r,i)=>{if(Ft(r)){if(e.indexOf(r)>=0)return;if(Nt(r))return r;if(!("toJSON"in r)){e[i]=r;const s=yt(r)?[]:{};return Ut(r,(a,c)=>{const l=n(a,i+1);!It(l)&&(s[c]=l)}),e[i]=void 0,s}}return r};return n(t,0)},bd=Se("AsyncFunction"),_d=t=>t&&(Ft(t)||ae(t))&&ae(t.then)&&ae(t.catch),ma=((t,e)=>t?setImmediate:e?((n,r)=>(Ge.addEventListener("message",({source:i,data:s})=>{i===Ge&&s===n&&r.length&&r.shift()()},!1),i=>{r.push(i),Ge.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",ae(Ge.postMessage)),wd=typeof queueMicrotask<"u"?queueMicrotask.bind(Ge):typeof process<"u"&&process.nextTick||ma,Sd=t=>t!=null&&ae(t[Pn]),_={isArray:yt,isArrayBuffer:ua,isBuffer:Nt,isFormData:Gu,isArrayBufferView:Uu,isString:Bu,isNumber:da,isBoolean:Vu,isObject:Ft,isPlainObject:cn,isEmptyObject:Ju,isReadableStream:Qu,isRequest:Xu,isResponse:Yu,isHeaders:Zu,isUndefined:It,isDate:qu,isFile:$u,isBlob:zu,isRegExp:fd,isFunction:ae,isStream:Wu,isURLSearchParams:Ku,isTypedArray:ad,isFileList:Hu,forEach:Ut,merge:Or,extend:td,trim:ed,stripBOM:nd,inherits:rd,toFlatObject:id,kindOf:jn,kindOfTest:Se,endsWith:sd,toArray:od,forEachEntry:cd,matchAll:ld,isHTMLForm:ud,hasOwnProperty:io,hasOwnProp:io,reduceDescriptors:pa,freezeMethods:hd,toObjectSet:pd,toCamelCase:dd,noop:md,toFiniteNumber:gd,findKey:fa,global:Ge,isContextDefined:ha,isSpecCompliantForm:vd,toJSONObject:yd,isAsyncFn:bd,isThenable:_d,setImmediate:ma,asap:wd,isIterable:Sd};function N(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}_.inherits(N,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:_.toJSONObject(this.config),code:this.code,status:this.status}}});const ga=N.prototype,va={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{va[t]={value:t}});Object.defineProperties(N,va);Object.defineProperty(ga,"isAxiosError",{value:!0});N.from=(t,e,n,r,i,s)=>{const a=Object.create(ga);return _.toFlatObject(t,a,function(l){return l!==Error.prototype},c=>c!=="isAxiosError"),N.call(a,t.message,e,n,r,i),a.cause=t,a.name=t.name,s&&Object.assign(a,s),a};const kd=null;function Ar(t){return _.isPlainObject(t)||_.isArray(t)}function ya(t){return _.endsWith(t,"[]")?t.slice(0,-2):t}function so(t,e,n){return t?t.concat(e).map(function(i,s){return i=ya(i),!n&&s?"["+i+"]":i}).join(n?".":""):e}function Ed(t){return _.isArray(t)&&!t.some(Ar)}const Td=_.toFlatObject(_,{},null,function(e){return/^is[A-Z]/.test(e)});function In(t,e,n){if(!_.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=_.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,b){return!_.isUndefined(b[m])});const r=n.metaTokens,i=n.visitor||h,s=n.dots,a=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&_.isSpecCompliantForm(e);if(!_.isFunction(i))throw new TypeError("visitor must be a function");function f(y){if(y===null)return"";if(_.isDate(y))return y.toISOString();if(_.isBoolean(y))return y.toString();if(!l&&_.isBlob(y))throw new N("Blob is not supported. Use a Buffer instead.");return _.isArrayBuffer(y)||_.isTypedArray(y)?l&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function h(y,m,b){let w=y;if(y&&!b&&typeof y=="object"){if(_.endsWith(m,"{}"))m=r?m:m.slice(0,-2),y=JSON.stringify(y);else if(_.isArray(y)&&Ed(y)||(_.isFileList(y)||_.endsWith(m,"[]"))&&(w=_.toArray(y)))return m=ya(m),w.forEach(function(A,x){!(_.isUndefined(A)||A===null)&&e.append(a===!0?so([m],x,s):a===null?m:m+"[]",f(A))}),!1}return Ar(y)?!0:(e.append(so(b,m,s),f(y)),!1)}const v=[],k=Object.assign(Td,{defaultVisitor:h,convertValue:f,isVisitable:Ar});function E(y,m){if(!_.isUndefined(y)){if(v.indexOf(y)!==-1)throw Error("Circular reference detected in "+m.join("."));v.push(y),_.forEach(y,function(w,C){(!(_.isUndefined(w)||w===null)&&i.call(e,w,_.isString(C)?C.trim():C,m,k))===!0&&E(w,m?m.concat(C):[C])}),v.pop()}}if(!_.isObject(t))throw new TypeError("data must be an object");return E(t),e}function oo(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function Qr(t,e){this._pairs=[],t&&In(t,this,e)}const ba=Qr.prototype;ba.append=function(e,n){this._pairs.push([e,n])};ba.toString=function(e){const n=e?function(r){return e.call(this,r,oo)}:oo;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function Cd(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function _a(t,e,n){if(!e)return t;const r=n&&n.encode||Cd;_.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let s;if(i?s=i(e,n):s=_.isURLSearchParams(e)?e.toString():new Qr(e,n).toString(r),s){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class ao{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){_.forEach(this.handlers,function(r){r!==null&&e(r)})}}const wa={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Md=typeof URLSearchParams<"u"?URLSearchParams:Qr,Od=typeof FormData<"u"?FormData:null,Ad=typeof Blob<"u"?Blob:null,Pd={isBrowser:!0,classes:{URLSearchParams:Md,FormData:Od,Blob:Ad},protocols:["http","https","file","blob","url","data"]},Xr=typeof window<"u"&&typeof document<"u",Pr=typeof navigator=="object"&&navigator||void 0,jd=Xr&&(!Pr||["ReactNative","NativeScript","NS"].indexOf(Pr.product)<0),xd=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Id=Xr&&window.location.href||"http://localhost",Ld=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Xr,hasStandardBrowserEnv:jd,hasStandardBrowserWebWorkerEnv:xd,navigator:Pr,origin:Id},Symbol.toStringTag,{value:"Module"})),ne={...Ld,...Pd};function Rd(t,e){return In(t,new ne.classes.URLSearchParams,{visitor:function(n,r,i,s){return ne.isNode&&_.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...e})}function Dd(t){return _.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Nd(t){const e={},n=Object.keys(t);let r;const i=n.length;let s;for(r=0;r<i;r++)s=n[r],e[s]=t[s];return e}function Sa(t){function e(n,r,i,s){let a=n[s++];if(a==="__proto__")return!0;const c=Number.isFinite(+a),l=s>=n.length;return a=!a&&_.isArray(i)?i.length:a,l?(_.hasOwnProp(i,a)?i[a]=[i[a],r]:i[a]=r,!c):((!i[a]||!_.isObject(i[a]))&&(i[a]=[]),e(n,r,i[a],s)&&_.isArray(i[a])&&(i[a]=Nd(i[a])),!c)}if(_.isFormData(t)&&_.isFunction(t.entries)){const n={};return _.forEachEntry(t,(r,i)=>{e(Dd(r),i,n,0)}),n}return null}function Fd(t,e,n){if(_.isString(t))try{return(e||JSON.parse)(t),_.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const Bt={transitional:wa,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,s=_.isObject(e);if(s&&_.isHTMLForm(e)&&(e=new FormData(e)),_.isFormData(e))return i?JSON.stringify(Sa(e)):e;if(_.isArrayBuffer(e)||_.isBuffer(e)||_.isStream(e)||_.isFile(e)||_.isBlob(e)||_.isReadableStream(e))return e;if(_.isArrayBufferView(e))return e.buffer;if(_.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let c;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Rd(e,this.formSerializer).toString();if((c=_.isFileList(e))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return In(c?{"files[]":e}:e,l&&new l,this.formSerializer)}}return s||i?(n.setContentType("application/json",!1),Fd(e)):e}],transformResponse:[function(e){const n=this.transitional||Bt.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(_.isResponse(e)||_.isReadableStream(e))return e;if(e&&_.isString(e)&&(r&&!this.responseType||i)){const a=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(c){if(a)throw c.name==="SyntaxError"?N.from(c,N.ERR_BAD_RESPONSE,this,null,this.response):c}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ne.classes.FormData,Blob:ne.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};_.forEach(["delete","get","head","post","put","patch"],t=>{Bt.headers[t]={}});const Ud=_.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Bd=t=>{const e={};let n,r,i;return t&&t.split(`
|
|
39
|
+
`).forEach(function(a){i=a.indexOf(":"),n=a.substring(0,i).trim().toLowerCase(),r=a.substring(i+1).trim(),!(!n||e[n]&&Ud[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},co=Symbol("internals");function Ct(t){return t&&String(t).trim().toLowerCase()}function ln(t){return t===!1||t==null?t:_.isArray(t)?t.map(ln):String(t)}function Vd(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 Jd=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function tr(t,e,n,r,i){if(_.isFunction(r))return r.call(this,e,n);if(i&&(e=n),!!_.isString(e)){if(_.isString(r))return e.indexOf(r)!==-1;if(_.isRegExp(r))return r.test(e)}}function qd(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function $d(t,e){const n=_.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(i,s,a){return this[r].call(this,e,i,s,a)},configurable:!0})})}let ce=class{constructor(e){e&&this.set(e)}set(e,n,r){const i=this;function s(c,l,f){const h=Ct(l);if(!h)throw new Error("header name must be a non-empty string");const v=_.findKey(i,h);(!v||i[v]===void 0||f===!0||f===void 0&&i[v]!==!1)&&(i[v||l]=ln(c))}const a=(c,l)=>_.forEach(c,(f,h)=>s(f,h,l));if(_.isPlainObject(e)||e instanceof this.constructor)a(e,n);else if(_.isString(e)&&(e=e.trim())&&!Jd(e))a(Bd(e),n);else if(_.isObject(e)&&_.isIterable(e)){let c={},l,f;for(const h of e){if(!_.isArray(h))throw TypeError("Object iterator must return a key-value pair");c[f=h[0]]=(l=c[f])?_.isArray(l)?[...l,h[1]]:[l,h[1]]:h[1]}a(c,n)}else e!=null&&s(n,e,r);return this}get(e,n){if(e=Ct(e),e){const r=_.findKey(this,e);if(r){const i=this[r];if(!n)return i;if(n===!0)return Vd(i);if(_.isFunction(n))return n.call(this,i,r);if(_.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=Ct(e),e){const r=_.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||tr(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let i=!1;function s(a){if(a=Ct(a),a){const c=_.findKey(r,a);c&&(!n||tr(r,r[c],c,n))&&(delete r[c],i=!0)}}return _.isArray(e)?e.forEach(s):s(e),i}clear(e){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const s=n[r];(!e||tr(this,this[s],s,e,!0))&&(delete this[s],i=!0)}return i}normalize(e){const n=this,r={};return _.forEach(this,(i,s)=>{const a=_.findKey(r,s);if(a){n[a]=ln(i),delete n[s];return}const c=e?qd(s):String(s).trim();c!==s&&delete n[s],n[c]=ln(i),r[c]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return _.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=e&&_.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
|
|
40
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[co]=this[co]={accessors:{}}).accessors,i=this.prototype;function s(a){const c=Ct(a);r[c]||($d(i,a),r[c]=!0)}return _.isArray(e)?e.forEach(s):s(e),this}};ce.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);_.reduceDescriptors(ce.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});_.freezeMethods(ce);function nr(t,e){const n=this||Bt,r=e||n,i=ce.from(r.headers);let s=r.data;return _.forEach(t,function(c){s=c.call(n,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function ka(t){return!!(t&&t.__CANCEL__)}function bt(t,e,n){N.call(this,t??"canceled",N.ERR_CANCELED,e,n),this.name="CanceledError"}_.inherits(bt,N,{__CANCEL__:!0});function Ea(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new N("Request failed with status code "+n.status,[N.ERR_BAD_REQUEST,N.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function zd(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Hd(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i=0,s=0,a;return e=e!==void 0?e:1e3,function(l){const f=Date.now(),h=r[s];a||(a=f),n[i]=l,r[i]=f;let v=s,k=0;for(;v!==i;)k+=n[v++],v=v%t;if(i=(i+1)%t,i===s&&(s=(s+1)%t),f-a<e)return;const E=h&&f-h;return E?Math.round(k*1e3/E):void 0}}function Wd(t,e){let n=0,r=1e3/e,i,s;const a=(f,h=Date.now())=>{n=h,i=null,s&&(clearTimeout(s),s=null),t(...f)};return[(...f)=>{const h=Date.now(),v=h-n;v>=r?a(f,h):(i=f,s||(s=setTimeout(()=>{s=null,a(i)},r-v)))},()=>i&&a(i)]}const _n=(t,e,n=3)=>{let r=0;const i=Hd(50,250);return Wd(s=>{const a=s.loaded,c=s.lengthComputable?s.total:void 0,l=a-r,f=i(l),h=a<=c;r=a;const v={loaded:a,total:c,progress:c?a/c:void 0,bytes:l,rate:f||void 0,estimated:f&&c&&h?(c-a)/f:void 0,event:s,lengthComputable:c!=null,[e?"download":"upload"]:!0};t(v)},n)},lo=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},uo=t=>(...e)=>_.asap(()=>t(...e)),Gd=ne.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,ne.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(ne.origin),ne.navigator&&/(msie|trident)/i.test(ne.navigator.userAgent)):()=>!0,Kd=ne.hasStandardBrowserEnv?{write(t,e,n,r,i,s){const a=[t+"="+encodeURIComponent(e)];_.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),_.isString(r)&&a.push("path="+r),_.isString(i)&&a.push("domain="+i),s===!0&&a.push("secure"),document.cookie=a.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Qd(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Xd(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Ta(t,e,n){let r=!Qd(e);return t&&(r||n==!1)?Xd(t,e):e}const fo=t=>t instanceof ce?{...t}:t;function rt(t,e){e=e||{};const n={};function r(f,h,v,k){return _.isPlainObject(f)&&_.isPlainObject(h)?_.merge.call({caseless:k},f,h):_.isPlainObject(h)?_.merge({},h):_.isArray(h)?h.slice():h}function i(f,h,v,k){if(_.isUndefined(h)){if(!_.isUndefined(f))return r(void 0,f,v,k)}else return r(f,h,v,k)}function s(f,h){if(!_.isUndefined(h))return r(void 0,h)}function a(f,h){if(_.isUndefined(h)){if(!_.isUndefined(f))return r(void 0,f)}else return r(void 0,h)}function c(f,h,v){if(v in e)return r(f,h);if(v in t)return r(void 0,f)}const l={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c,headers:(f,h,v)=>i(fo(f),fo(h),v,!0)};return _.forEach(Object.keys({...t,...e}),function(h){const v=l[h]||i,k=v(t[h],e[h],h);_.isUndefined(k)&&v!==c||(n[h]=k)}),n}const Ca=t=>{const e=rt({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:s,headers:a,auth:c}=e;e.headers=a=ce.from(a),e.url=_a(Ta(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let l;if(_.isFormData(n)){if(ne.hasStandardBrowserEnv||ne.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((l=a.getContentType())!==!1){const[f,...h]=l?l.split(";").map(v=>v.trim()).filter(Boolean):[];a.setContentType([f||"multipart/form-data",...h].join("; "))}}if(ne.hasStandardBrowserEnv&&(r&&_.isFunction(r)&&(r=r(e)),r||r!==!1&&Gd(e.url))){const f=i&&s&&Kd.read(s);f&&a.set(i,f)}return e},Yd=typeof XMLHttpRequest<"u",Zd=Yd&&function(t){return new Promise(function(n,r){const i=Ca(t);let s=i.data;const a=ce.from(i.headers).normalize();let{responseType:c,onUploadProgress:l,onDownloadProgress:f}=i,h,v,k,E,y;function m(){E&&E(),y&&y(),i.cancelToken&&i.cancelToken.unsubscribe(h),i.signal&&i.signal.removeEventListener("abort",h)}let b=new XMLHttpRequest;b.open(i.method.toUpperCase(),i.url,!0),b.timeout=i.timeout;function w(){if(!b)return;const A=ce.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),j={data:!c||c==="text"||c==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:A,config:t,request:b};Ea(function(J){n(J),m()},function(J){r(J),m()},j),b=null}"onloadend"in b?b.onloadend=w:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(w)},b.onabort=function(){b&&(r(new N("Request aborted",N.ECONNABORTED,t,b)),b=null)},b.onerror=function(){r(new N("Network Error",N.ERR_NETWORK,t,b)),b=null},b.ontimeout=function(){let x=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const j=i.transitional||wa;i.timeoutErrorMessage&&(x=i.timeoutErrorMessage),r(new N(x,j.clarifyTimeoutError?N.ETIMEDOUT:N.ECONNABORTED,t,b)),b=null},s===void 0&&a.setContentType(null),"setRequestHeader"in b&&_.forEach(a.toJSON(),function(x,j){b.setRequestHeader(j,x)}),_.isUndefined(i.withCredentials)||(b.withCredentials=!!i.withCredentials),c&&c!=="json"&&(b.responseType=i.responseType),f&&([k,y]=_n(f,!0),b.addEventListener("progress",k)),l&&b.upload&&([v,E]=_n(l),b.upload.addEventListener("progress",v),b.upload.addEventListener("loadend",E)),(i.cancelToken||i.signal)&&(h=A=>{b&&(r(!A||A.type?new bt(null,t,b):A),b.abort(),b=null)},i.cancelToken&&i.cancelToken.subscribe(h),i.signal&&(i.signal.aborted?h():i.signal.addEventListener("abort",h)));const C=zd(i.url);if(C&&ne.protocols.indexOf(C)===-1){r(new N("Unsupported protocol "+C+":",N.ERR_BAD_REQUEST,t));return}b.send(s||null)})},ef=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,i;const s=function(f){if(!i){i=!0,c();const h=f instanceof Error?f:this.reason;r.abort(h instanceof N?h:new bt(h instanceof Error?h.message:h))}};let a=e&&setTimeout(()=>{a=null,s(new N(`timeout ${e} of ms exceeded`,N.ETIMEDOUT))},e);const c=()=>{t&&(a&&clearTimeout(a),a=null,t.forEach(f=>{f.unsubscribe?f.unsubscribe(s):f.removeEventListener("abort",s)}),t=null)};t.forEach(f=>f.addEventListener("abort",s));const{signal:l}=r;return l.unsubscribe=()=>_.asap(c),l}},tf=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let r=0,i;for(;r<n;)i=r+e,yield t.slice(r,i),r=i},nf=async function*(t,e){for await(const n of rf(t))yield*tf(n,e)},rf=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:r}=await e.read();if(n)break;yield r}}finally{await e.cancel()}},ho=(t,e,n,r)=>{const i=nf(t,e);let s=0,a,c=l=>{a||(a=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:f,value:h}=await i.next();if(f){c(),l.close();return}let v=h.byteLength;if(n){let k=s+=v;n(k)}l.enqueue(new Uint8Array(h))}catch(f){throw c(f),f}},cancel(l){return c(l),i.return()}},{highWaterMark:2})},Ln=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Ma=Ln&&typeof ReadableStream=="function",sf=Ln&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),Oa=(t,...e)=>{try{return!!t(...e)}catch{return!1}},of=Ma&&Oa(()=>{let t=!1;const e=new Request(ne.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),po=64*1024,jr=Ma&&Oa(()=>_.isReadableStream(new Response("").body)),wn={stream:jr&&(t=>t.body)};Ln&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!wn[e]&&(wn[e]=_.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new N(`Response type '${e}' is not supported`,N.ERR_NOT_SUPPORT,r)})})})(new Response);const af=async t=>{if(t==null)return 0;if(_.isBlob(t))return t.size;if(_.isSpecCompliantForm(t))return(await new Request(ne.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(_.isArrayBufferView(t)||_.isArrayBuffer(t))return t.byteLength;if(_.isURLSearchParams(t)&&(t=t+""),_.isString(t))return(await sf(t)).byteLength},cf=async(t,e)=>{const n=_.toFiniteNumber(t.getContentLength());return n??af(e)},lf=Ln&&(async t=>{let{url:e,method:n,data:r,signal:i,cancelToken:s,timeout:a,onDownloadProgress:c,onUploadProgress:l,responseType:f,headers:h,withCredentials:v="same-origin",fetchOptions:k}=Ca(t);f=f?(f+"").toLowerCase():"text";let E=ef([i,s&&s.toAbortSignal()],a),y;const m=E&&E.unsubscribe&&(()=>{E.unsubscribe()});let b;try{if(l&&of&&n!=="get"&&n!=="head"&&(b=await cf(h,r))!==0){let j=new Request(e,{method:"POST",body:r,duplex:"half"}),R;if(_.isFormData(r)&&(R=j.headers.get("content-type"))&&h.setContentType(R),j.body){const[J,X]=lo(b,_n(uo(l)));r=ho(j.body,po,J,X)}}_.isString(v)||(v=v?"include":"omit");const w="credentials"in Request.prototype;y=new Request(e,{...k,signal:E,method:n.toUpperCase(),headers:h.normalize().toJSON(),body:r,duplex:"half",credentials:w?v:void 0});let C=await fetch(y,k);const A=jr&&(f==="stream"||f==="response");if(jr&&(c||A&&m)){const j={};["status","statusText","headers"].forEach(Oe=>{j[Oe]=C[Oe]});const R=_.toFiniteNumber(C.headers.get("content-length")),[J,X]=c&&lo(R,_n(uo(c),!0))||[];C=new Response(ho(C.body,po,J,()=>{X&&X(),m&&m()}),j)}f=f||"text";let x=await wn[_.findKey(wn,f)||"text"](C,t);return!A&&m&&m(),await new Promise((j,R)=>{Ea(j,R,{data:x,headers:ce.from(C.headers),status:C.status,statusText:C.statusText,config:t,request:y})})}catch(w){throw m&&m(),w&&w.name==="TypeError"&&/Load failed|fetch/i.test(w.message)?Object.assign(new N("Network Error",N.ERR_NETWORK,t,y),{cause:w.cause||w}):N.from(w,w&&w.code,t,y)}}),xr={http:kd,xhr:Zd,fetch:lf};_.forEach(xr,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const mo=t=>`- ${t}`,uf=t=>_.isFunction(t)||t===null||t===!1,Aa={getAdapter:t=>{t=_.isArray(t)?t:[t];const{length:e}=t;let n,r;const i={};for(let s=0;s<e;s++){n=t[s];let a;if(r=n,!uf(n)&&(r=xr[(a=String(n)).toLowerCase()],r===void 0))throw new N(`Unknown adapter '${a}'`);if(r)break;i[a||"#"+s]=r}if(!r){const s=Object.entries(i).map(([c,l])=>`adapter ${c} `+(l===!1?"is not supported by the environment":"is not available in the build"));let a=e?s.length>1?`since :
|
|
41
|
+
`+s.map(mo).join(`
|
|
42
|
+
`):" "+mo(s[0]):"as no adapter specified";throw new N("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:xr};function rr(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new bt(null,t)}function go(t){return rr(t),t.headers=ce.from(t.headers),t.data=nr.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Aa.getAdapter(t.adapter||Bt.adapter)(t).then(function(r){return rr(t),r.data=nr.call(t,t.transformResponse,r),r.headers=ce.from(r.headers),r},function(r){return ka(r)||(rr(t),r&&r.response&&(r.response.data=nr.call(t,t.transformResponse,r.response),r.response.headers=ce.from(r.response.headers))),Promise.reject(r)})}const Pa="1.11.0",Rn={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Rn[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const vo={};Rn.transitional=function(e,n,r){function i(s,a){return"[Axios v"+Pa+"] Transitional option '"+s+"'"+a+(r?". "+r:"")}return(s,a,c)=>{if(e===!1)throw new N(i(a," has been removed"+(n?" in "+n:"")),N.ERR_DEPRECATED);return n&&!vo[a]&&(vo[a]=!0,console.warn(i(a," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(s,a,c):!0}};Rn.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function df(t,e,n){if(typeof t!="object")throw new N("options must be an object",N.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 N("option "+s+" must be "+l,N.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new N("Unknown option "+s,N.ERR_BAD_OPTION)}}const un={assertOptions:df,validators:Rn},Ee=un.validators;let Ye=class{constructor(e){this.defaults=e||{},this.interceptors={request:new ao,response:new ao}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const s=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
43
|
+
`+s):r.stack=s}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=rt(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&un.assertOptions(r,{silentJSONParsing:Ee.transitional(Ee.boolean),forcedJSONParsing:Ee.transitional(Ee.boolean),clarifyTimeoutError:Ee.transitional(Ee.boolean)},!1),i!=null&&(_.isFunction(i)?n.paramsSerializer={serialize:i}:un.assertOptions(i,{encode:Ee.function,serialize:Ee.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),un.assertOptions(n,{baseUrl:Ee.spelling("baseURL"),withXsrfToken:Ee.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=s&&_.merge(s.common,s[n.method]);s&&_.forEach(["delete","get","head","post","put","patch","common"],y=>{delete s[y]}),n.headers=ce.concat(a,s);const c=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(l=l&&m.synchronous,c.unshift(m.fulfilled,m.rejected))});const f=[];this.interceptors.response.forEach(function(m){f.push(m.fulfilled,m.rejected)});let h,v=0,k;if(!l){const y=[go.bind(this),void 0];for(y.unshift(...c),y.push(...f),k=y.length,h=Promise.resolve(n);v<k;)h=h.then(y[v++],y[v++]);return h}k=c.length;let E=n;for(v=0;v<k;){const y=c[v++],m=c[v++];try{E=y(E)}catch(b){m.call(this,b);break}}try{h=go.call(this,E)}catch(y){return Promise.reject(y)}for(v=0,k=f.length;v<k;)h=h.then(f[v++],f[v++]);return h}getUri(e){e=rt(this.defaults,e);const n=Ta(e.baseURL,e.url,e.allowAbsoluteUrls);return _a(n,e.params,e.paramsSerializer)}};_.forEach(["delete","get","head","options"],function(e){Ye.prototype[e]=function(n,r){return this.request(rt(r||{},{method:e,url:n,data:(r||{}).data}))}});_.forEach(["post","put","patch"],function(e){function n(r){return function(s,a,c){return this.request(rt(c||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}Ye.prototype[e]=n(),Ye.prototype[e+"Form"]=n(!0)});let ff=class ja{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(i=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const a=new Promise(c=>{r.subscribe(c),s=c}).then(i);return a.cancel=function(){r.unsubscribe(s)},a},e(function(s,a,c){r.reason||(r.reason=new bt(s,a,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new ja(function(i){e=i}),cancel:e}}};function hf(t){return function(n){return t.apply(null,n)}}function pf(t){return _.isObject(t)&&t.isAxiosError===!0}const Ir={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(Ir).forEach(([t,e])=>{Ir[e]=t});function xa(t){const e=new Ye(t),n=ca(Ye.prototype.request,e);return _.extend(n,Ye.prototype,e,{allOwnKeys:!0}),_.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return xa(rt(t,i))},n}const G=xa(Bt);G.Axios=Ye;G.CanceledError=bt;G.CancelToken=ff;G.isCancel=ka;G.VERSION=Pa;G.toFormData=In;G.AxiosError=N;G.Cancel=G.CanceledError;G.all=function(e){return Promise.all(e)};G.spread=hf;G.isAxiosError=pf;G.mergeConfig=rt;G.AxiosHeaders=ce;G.formToJSON=t=>Sa(_.isHTMLForm(t)?new FormData(t):t);G.getAdapter=Aa.getAdapter;G.HttpStatusCode=Ir;G.default=G;const{Axios:Tf,AxiosError:Cf,CanceledError:Mf,isCancel:Of,CancelToken:Af,VERSION:Pf,all:jf,Cancel:xf,isAxiosError:If,spread:Lf,toFormData:Rf,AxiosHeaders:Df,HttpStatusCode:Nf,formToJSON:Ff,getAdapter:Uf,mergeConfig:Bf}=G,mf=`
|
|
45
44
|
precision mediump float;
|
|
46
45
|
|
|
47
46
|
// our textures
|
|
@@ -63,7 +62,7 @@ void main() {
|
|
|
63
62
|
|
|
64
63
|
gl_FragColor = vec4(color.rgb * mix(alpha, 1.0, u_premultipliedAlpha), alpha);
|
|
65
64
|
}
|
|
66
|
-
`,
|
|
65
|
+
`,gf=`
|
|
67
66
|
precision mediump float;
|
|
68
67
|
attribute vec2 a_position;
|
|
69
68
|
uniform mat3 u_matrix;
|
|
@@ -76,4 +75,4 @@ void main() {
|
|
|
76
75
|
// the same data for our texcoords.
|
|
77
76
|
v_texCoord = a_position;
|
|
78
77
|
}
|
|
79
|
-
`;function
|
|
78
|
+
`;function yo(t,e,n){const r=t.createShader(n);if(!r)throw Error("Unable to create shader");if(t.shaderSource(r,e),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS)){const i=t.getShaderInfoLog(r);throw t.deleteShader(r),Error(i||"unknown error")}return r}function vf(t,e){const n=t.createProgram();if(!n)throw Error("Unable to create program");for(const r of e)t.attachShader(n,r);if(t.linkProgram(n),!t.getProgramParameter(n,t.LINK_STATUS)){const r=t.getProgramInfoLog(n);throw t.deleteProgram(n),Error(r||"unknown error")}return n}const Ia=new WeakMap;function yf(t){const e={antialias:!1,powerPreference:"low-power",depth:!1,premultipliedAlpha:!0},n=t.getContext("webgl2",e)??t.getContext("webgl",e);if(!n)throw Error("Couldn't create GL context");const r=yo(n,mf,n.FRAGMENT_SHADER),i=yo(n,gf,n.VERTEX_SHADER),s=vf(n,[r,i]);n.useProgram(s);const a=n.getAttribLocation(s,"a_position"),c=n.getUniformLocation(s,"u_frame");n.uniform1i(c,0);const l=n.getUniformLocation(s,"u_matrix");Ia.set(n,n.getUniformLocation(s,"u_premultipliedAlpha")),bf(n);const f=n.createBuffer(),h=new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]);n.bindBuffer(n.ARRAY_BUFFER,f),n.bufferData(n.ARRAY_BUFFER,h,n.STATIC_DRAW),n.enableVertexAttribArray(a),n.vertexAttribPointer(a,2,n.FLOAT,!1,0,0),n.uniformMatrix3fv(l,!1,[2,0,0,0,-2,0,-1,1,1]);const v=n.createTexture();return n.bindTexture(n.TEXTURE_2D,v),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST),n}function bf(t,e){t.uniform1f(Ia.get(t),0)}function _f(t,e){const n=t.canvas,r=e.videoWidth,i=Math.floor(e.videoHeight/2);(n.width!==r||n.height!==i)&&(n.width=r,n.height=i,t.viewport(0,0,r,i)),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e),t.drawArrays(t.TRIANGLES,0,6)}var Lr;(function(t){t.Send="conversation_engine.external.message.send"})(Lr||(Lr={}));const La="https://api.avaturn.live";class Ra{constructor(e,n){Q(this,"inited",!1);Q(this,"mediaStream");Q(this,"session_id","");Q(this,"sessionData",null);Q(this,"uiConfig",{background:{transparent:!0}});Q(this,"config");Q(this,"shadow",null);Q(this,"frameHandle",0);Q(this,"rootElement");Q(this,"abortController");Q(this,"timeout",0);Q(this,"keepAlive",!1);Q(this,"fetcher");Q(this,"call");Q(this,"handlers",{});if(typeof window>"u")throw new Error("Unfortunately, SDK only works on the client side.");const[r,i]=this.parseConfig(e,n),{apiHost:s=La,sessionToken:a,preloadBundle:c,preconnect:l,keepAlive:f}=this.config=r;this.rootElement=i,this.abortController=new AbortController,this.fetcher=G.create({baseURL:`${s}/_sdk/v0`,headers:{"X-Session-Token":a},signal:this.abortController.signal}),this.keepAlive=!!f,this.mediaStream=new MediaStream,l&&this.fetcher.post("/sessions/start_stream")}parseConfig(e,n){try{let r,i;if(e instanceof HTMLElement){if(r=e,!n)throw new Error("Options are required when providing a DOM element.");i=n}else i=e;return typeof i.immediatelyJoin>"u"&&(i.immediatelyJoin=!0),typeof i.audioSource>"u"&&(i.audioSource=!1),[i,r]}catch{throw new Error("Filed to parse configuration object. Bad configuration!")}}dispatch(e,n){var r;(r=this.handlers[e])==null||r.forEach(i=>i(n))}drawUI(){if(!this.rootElement||!this.inited)return;if(!this.shadow){const a=document.createElement("div");a.style.width="100%",a.style.height="100%",a.style.position="relative",a.style.overflow="hidden",this.rootElement.appendChild(a),this.shadow=a.attachShadow({mode:"closed"})}const e=this.shadow;this.shadow.innerHTML="";const n=document.createElement("video");if(n.srcObject=this.mediaStream,n.autoplay=!0,n.style.position="absolute",n.style.opacity="0",n.style.objectFit="cover",n.style.pointerEvents="none",n.playsInline=!0,e.appendChild(n),!this.uiConfig.background.transparent){n.style.width="100%",n.style.height="100%",n.style.opacity="1",n.style.pointerEvents="all";return}const r=document.createElement("canvas");r.style.width="100%",r.style.height="100%",r.style.objectFit="cover",e.appendChild(r);const i=yf(r),s=()=>{_f(i,n),this.frameHandle=requestAnimationFrame(s)};s()}startIdleTimeout(){this.timeout=setTimeout(()=>{var e;(e=this.handlers.idle)==null||e.forEach(n=>n({data:null})),this.keepAlive||(console.info("[SDK_IDLE]: Stream was terminated due to inactivity"),this.dispose())},5*60*1e3)}restartIdleTimeout(){clearTimeout(this.timeout),this.startIdleTimeout()}updateConfig(){this.call.sendAppMessage({type:Lr.Send,data:{prompt_update:!0}})}toggleLocalAudio(){const e=this.call.localAudio();this.call.setLocalAudio(!e),this.dispatch("local_audio_change",!e)}setOutputDevice(e){if(!this.call)throw new Error("Session not initialized");return this.call.setOutputDeviceAsync(e)}setInputDevices(e){return this.call.setInputDevicesAsync(e)}requestMediaDevices(){return this.call.enumerateDevices()}async cancelAllTasks(){const{data:e}=await this.fetcher.post("/sessions/cancel_all_speech_tasks");return e}async patchConfig(e){await this.fetcher.patch("/sessions/config",e)}async changeVoice(e){await this.patchConfig({conversation_engine:{type:"text-echo",tts:e}})}applyEventHandlers(e){return new Promise((n,r)=>{var a,c,l;const i=e!=null&&e.timeout&&e.timeout>0?e==null?void 0:e.timeout:3e4,s=e!=null&&e.timeout?setTimeout(()=>r("Connection timeout"),i):null;(a=this.call)==null||a.on("participant-joined",f=>{console.log("prtcs-join: ",f)}),(c=this.call)==null||c.on("participant-updated",({participant:f})=>{var k,E;if(console.log("prtcp: ",f),!f.owner)return;this.dispatch("local_audio_change",this.call.localAudio());const{video:h,audio:v}=f.tracks;h.persistentTrack&&(this.mediaStream.getVideoTracks().forEach(y=>this.mediaStream.removeTrack(y)),(k=this.mediaStream)==null||k.addTrack(h.persistentTrack)),v.persistentTrack&&(this.mediaStream.getAudioTracks().forEach(y=>this.mediaStream.removeTrack(y)),(E=this.mediaStream)==null||E.addTrack(v.persistentTrack)),s&&clearTimeout(s),h.persistentTrack&&(this.inited=!0,this.drawUI(),n())}),this.call.on("error",f=>{console.error("[SKD_ERROR]: ",f)}),(l=this.call)==null||l.on("app-message",({data:f})=>{var h;this.restartIdleTimeout(),f.type&&((h=this.handlers[f.type])==null||h.forEach(v=>v(f)))})})}attachDOMNode(e){cancelAnimationFrame(this.frameHandle),this.rootElement&&(this.rootElement.innerHTML=""),this.rootElement=e,this.shadow=null,this.drawUI()}async init(e){if(this.inited)return;this.call=Ru.createCallObject({subscribeToTracksAutomatically:!0,videoSource:!1,audioSource:this.config.audioSource,dailyConfig:{avoidEval:!0}}),this.config.preloadBundle&&this.call.load(),this.startIdleTimeout();const{data:n}=await this.fetcher.get("/sessions");return this.session_id=n.id,this.sessionData=n,this.uiConfig.background.transparent=n.session_config.uses_stacked_alpha,!this.abortController.signal.aborted&&this.config.immediatelyJoin&&await this.join(),this.applyEventHandlers(e)}async join(){if(!this.sessionData)throw new Error("Session not initialized");await this.call.join({token:this.sessionData.limited_access_token,url:this.sessionData.room_url}),this.call.setLocalAudio(this.config.audioSource||!1)}async task(e){if(!this.session_id)throw new Error("It seems that the session is not initialized.");this.restartIdleTimeout();const{data:n}=await this.fetcher.post("/sessions/tasks",{text:e});return n}on(e,n){this.handlers[e]||(this.handlers[e]=[]),this.handlers[e].push(n)}off(e,n){this.handlers[e]&&(this.handlers[e]=this.handlers[e].filter(r=>r!==n))}async dispose(){this.inited=!1,this.mediaStream=new MediaStream,this.timeout&&clearTimeout(this.timeout),this.frameHandle&&cancelAnimationFrame(this.frameHandle),await this.call.destroy(),this.abortController.abort(),this.abortController=new AbortController,this.fetcher.defaults.signal=this.abortController.signal}}class wf extends Ra{constructor(n){super(n);Q(this,"assistantSessionToken","");Q(this,"assistantFetcher");Q(this,"sessionToken","");this.assistantSessionToken=n.assistantSessionToken,this.sessionToken=n.sessionToken,this.assistantFetcher=G.create({baseURL:`${n.apiHost||La}/`,headers:{Authorization:`Bearer ${n.assistantSessionToken}`},signal:this.abortController.signal})}async task(n,r){if(!this.session_id)throw new Error("It seems that the session is not initialized.");this.restartIdleTimeout();const{data:i}=await this.assistantFetcher.post("/assistants/tasks",{text:n});return i}async dispose(){var n;this.inited=!1,this.mediaStream=new MediaStream,this.timeout&&clearTimeout(this.timeout),this.frameHandle&&cancelAnimationFrame(this.frameHandle),await((n=this.call)==null?void 0:n.destroy()),await this.assistantFetcher.delete("/assistants/sessions"),this.abortController.abort(),this.abortController=new AbortController,this.fetcher.defaults.signal=this.abortController.signal,this.assistantFetcher.defaults.signal=this.abortController.signal}}exports.AvaturnAssistantHead=wf;exports.AvaturnHead=Ra;
|