var Hy=Object.defineProperty;var Gy=(r,n,i)=>n in r?Hy(r,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):r[n]=i;var Pn=(r,n,i)=>Gy(r,typeof n!="symbol"?n+"":n,i);(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))a(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const p of c.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&a(p)}).observe(document,{childList:!0,subtree:!0});function i(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function a(l){if(l.ep)return;l.ep=!0;const c=i(l);fetch(l.href,c)}})();var Wa=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Pc(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Eu={exports:{}},ho={},Cu={exports:{}},Te={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Rp;function qy(){if(Rp)return Te;Rp=1;var r=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),p=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),_=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),S=Symbol.iterator;function T(x){return x===null||typeof x!="object"?null:(x=S&&x[S]||x["@@iterator"],typeof x=="function"?x:null)}var M={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},L=Object.assign,O={};function R(x,$,ge){this.props=x,this.context=$,this.refs=O,this.updater=ge||M}R.prototype.isReactComponent={},R.prototype.setState=function(x,$){if(typeof x!="object"&&typeof x!="function"&&x!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,x,$,"setState")},R.prototype.forceUpdate=function(x){this.updater.enqueueForceUpdate(this,x,"forceUpdate")};function W(){}W.prototype=R.prototype;function ne(x,$,ge){this.props=x,this.context=$,this.refs=O,this.updater=ge||M}var K=ne.prototype=new W;K.constructor=ne,L(K,R.prototype),K.isPureReactComponent=!0;var G=Array.isArray,N=Object.prototype.hasOwnProperty,I={current:null},F={key:!0,ref:!0,__self:!0,__source:!0};function z(x,$,ge){var fe,d={},m=null,g=null;if($!=null)for(fe in $.ref!==void 0&&(g=$.ref),$.key!==void 0&&(m=""+$.key),$)N.call($,fe)&&!F.hasOwnProperty(fe)&&(d[fe]=$[fe]);var C=arguments.length-2;if(C===1)d.children=ge;else if(1>>1,$=Z[x];if(0>>1;xl(d,q))m<$&&0>l(g,d)?(Z[x]=g,Z[m]=q,x=m):(Z[x]=d,Z[fe]=q,x=fe);else if(m<$&&0>l(g,q))Z[x]=g,Z[m]=q,x=m;else break e}}return re}function l(Z,re){var q=Z.sortIndex-re.sortIndex;return q!==0?q:Z.id-re.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;r.unstable_now=function(){return c.now()}}else{var p=Date,v=p.now();r.unstable_now=function(){return p.now()-v}}var h=[],_=[],w=1,S=null,T=3,M=!1,L=!1,O=!1,R=typeof setTimeout=="function"?setTimeout:null,W=typeof clearTimeout=="function"?clearTimeout:null,ne=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function K(Z){for(var re=i(_);re!==null;){if(re.callback===null)a(_);else if(re.startTime<=Z)a(_),re.sortIndex=re.expirationTime,n(h,re);else break;re=i(_)}}function G(Z){if(O=!1,K(Z),!L)if(i(h)!==null)L=!0,Le(N);else{var re=i(_);re!==null&&Ee(G,re.startTime-Z)}}function N(Z,re){L=!1,O&&(O=!1,W(z),z=-1),M=!0;var q=T;try{for(K(re),S=i(h);S!==null&&(!(S.expirationTime>re)||Z&&!pe());){var x=S.callback;if(typeof x=="function"){S.callback=null,T=S.priorityLevel;var $=x(S.expirationTime<=re);re=r.unstable_now(),typeof $=="function"?S.callback=$:S===i(h)&&a(h),K(re)}else a(h);S=i(h)}if(S!==null)var ge=!0;else{var fe=i(_);fe!==null&&Ee(G,fe.startTime-re),ge=!1}return ge}finally{S=null,T=q,M=!1}}var I=!1,F=null,z=-1,X=5,te=-1;function pe(){return!(r.unstable_now()-teZ||125x?(Z.sortIndex=q,n(_,Z),i(h)===null&&Z===i(_)&&(O?(W(z),z=-1):O=!0,Ee(G,q-x))):(Z.sortIndex=$,n(h,Z),L||M||(L=!0,Le(N))),Z},r.unstable_shouldYield=pe,r.unstable_wrapCallback=function(Z){var re=T;return function(){var q=T;T=re;try{return Z.apply(this,arguments)}finally{T=q}}}}(Mu)),Mu}var zp;function Xy(){return zp||(zp=1,Tu.exports=Ky()),Tu.exports}/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var $p;function Zy(){if($p)return Ot;$p=1;var r=xc(),n=Xy();function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,o=1;o"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,_=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,w={},S={};function T(e){return h.call(S,e)?!0:h.call(w,e)?!1:_.test(e)?S[e]=!0:(w[e]=!0,!1)}function M(e,t,o,s){if(o!==null&&o.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return s?!1:o!==null?!o.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function L(e,t,o,s){if(t===null||typeof t>"u"||M(e,t,o,s))return!0;if(s)return!1;if(o!==null)switch(o.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function O(e,t,o,s,u,f,y){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=s,this.attributeNamespace=u,this.mustUseProperty=o,this.propertyName=e,this.type=t,this.sanitizeURL=f,this.removeEmptyString=y}var R={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){R[e]=new O(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];R[t]=new O(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){R[e]=new O(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){R[e]=new O(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){R[e]=new O(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){R[e]=new O(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){R[e]=new O(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){R[e]=new O(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){R[e]=new O(e,5,!1,e.toLowerCase(),null,!1,!1)});var W=/[\-:]([a-z])/g;function ne(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(W,ne);R[t]=new O(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(W,ne);R[t]=new O(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(W,ne);R[t]=new O(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){R[e]=new O(e,1,!1,e.toLowerCase(),null,!1,!1)}),R.xlinkHref=new O("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){R[e]=new O(e,1,!1,e.toLowerCase(),null,!0,!0)});function K(e,t,o,s){var u=R.hasOwnProperty(t)?R[t]:null;(u!==null?u.type!==0:s||!(2E||u[y]!==f[E]){var b=` `+u[y].replace(" at new "," at ");return e.displayName&&b.includes("")&&(b=b.replace("",e.displayName)),b}while(1<=y&&0<=E);break}}}finally{ge=!1,Error.prepareStackTrace=o}return(e=e?e.displayName||e.name:"")?$(e):""}function d(e){switch(e.tag){case 5:return $(e.type);case 16:return $("Lazy");case 13:return $("Suspense");case 19:return $("SuspenseList");case 0:case 2:case 15:return e=fe(e.type,!1),e;case 11:return e=fe(e.type.render,!1),e;case 1:return e=fe(e.type,!0),e;default:return""}}function m(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case F:return"Fragment";case I:return"Portal";case X:return"Profiler";case z:return"StrictMode";case Y:return"Suspense";case he:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case pe:return(e.displayName||"Context")+".Consumer";case te:return(e._context.displayName||"Context")+".Provider";case ae:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ke:return t=e.displayName||null,t!==null?t:m(e.type)||"Memo";case Le:t=e._payload,e=e._init;try{return m(e(t))}catch{}}return null}function g(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return m(t);case 8:return t===z?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function C(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function k(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function U(e){var t=k(e)?"checked":"value",o=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),s=""+e[t];if(!e.hasOwnProperty(t)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var u=o.get,f=o.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(y){s=""+y,f.call(this,y)}}),Object.defineProperty(e,t,{enumerable:o.enumerable}),{getValue:function(){return s},setValue:function(y){s=""+y},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ie(e){e._valueTracker||(e._valueTracker=U(e))}function de(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var o=t.getValue(),s="";return e&&(s=k(e)?e.checked?"true":"false":e.value),e=s,e!==o?(t.setValue(e),!0):!1}function be(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ze(e,t){var o=t.checked;return q({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:o??e._wrapperState.initialChecked})}function Ve(e,t){var o=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;o=C(t.value!=null?t.value:o),e._wrapperState={initialChecked:s,initialValue:o,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Ut(e,t){t=t.checked,t!=null&&K(e,"checked",t,!1)}function Bt(e,t){Ut(e,t);var o=C(t.value),s=t.type;if(o!=null)s==="number"?(o===0&&e.value===""||e.value!=o)&&(e.value=""+o):e.value!==""+o&&(e.value=""+o);else if(s==="submit"||s==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?An(e,t.type,o):t.hasOwnProperty("defaultValue")&&An(e,t.type,C(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function zt(e,t,o){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var s=t.type;if(!(s!=="submit"&&s!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,o||t===e.value||(e.value=t),e.defaultValue=t}o=e.name,o!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,o!==""&&(e.name=o)}function An(e,t,o){(t!=="number"||be(e.ownerDocument)!==e)&&(o==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+o&&(e.defaultValue=""+o))}var Ke=Array.isArray;function vt(e,t,o,s){if(e=e.options,t){t={};for(var u=0;u"+t.valueOf().toString()+"",t=Ro.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function xi(e,t){if(t){var o=e.firstChild;if(o&&o===e.lastChild&&o.nodeType===3){o.nodeValue=t;return}}e.textContent=t}var Oi={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Qm=["Webkit","ms","Moz","O"];Object.keys(Oi).forEach(function(e){Qm.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Oi[t]=Oi[e]})});function Qc(e,t,o){return t==null||typeof t=="boolean"||t===""?"":o||typeof t!="number"||t===0||Oi.hasOwnProperty(e)&&Oi[e]?(""+t).trim():t+"px"}function Kc(e,t){e=e.style;for(var o in t)if(t.hasOwnProperty(o)){var s=o.indexOf("--")===0,u=Qc(o,t[o],s);o==="float"&&(o="cssFloat"),s?e.setProperty(o,u):e[o]=u}}var Km=q({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function js(e,t){if(t){if(Km[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(i(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(i(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(i(61))}if(t.style!=null&&typeof t.style!="object")throw Error(i(62))}}function Rs(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ns=null;function Fs(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Us=null,Br=null,zr=null;function Xc(e){if(e=Xi(e)){if(typeof Us!="function")throw Error(i(280));var t=e.stateNode;t&&(t=oa(t),Us(e.stateNode,e.type,t))}}function Zc(e){Br?zr?zr.push(e):zr=[e]:Br=e}function ed(){if(Br){var e=Br,t=zr;if(zr=Br=null,Xc(e),t)for(e=0;e>>=0,e===0?32:31-(lg(e)/ug|0)|0}var zo=64,$o=4194304;function Ai(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Vo(e,t){var o=e.pendingLanes;if(o===0)return 0;var s=0,u=e.suspendedLanes,f=e.pingedLanes,y=o&268435455;if(y!==0){var E=y&~u;E!==0?s=Ai(E):(f&=y,f!==0&&(s=Ai(f)))}else y=o&~u,y!==0?s=Ai(y):f!==0&&(s=Ai(f));if(s===0)return 0;if(t!==0&&t!==s&&!(t&u)&&(u=s&-s,f=t&-t,u>=f||u===16&&(f&4194240)!==0))return t;if(s&4&&(s|=o&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=s;0o;o++)t.push(e);return t}function ji(e,t,o){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Kt(t),e[t]=o}function pg(e,t){var o=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var s=e.eventTimes;for(e=e.expirationTimes;0=Vi),Pd=" ",xd=!1;function Od(e,t){switch(e){case"keyup":return zg.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ld(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Wr=!1;function Vg(e,t){switch(e){case"compositionend":return Ld(t);case"keypress":return t.which!==32?null:(xd=!0,Pd);case"textInput":return e=t.data,e===Pd&&xd?null:e;default:return null}}function Wg(e,t){if(Wr)return e==="compositionend"||!rl&&Od(e,t)?(e=kd(),qo=Ks=Bn=null,Wr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:o,offset:t-e};e=s}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=Fd(o)}}function Bd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Bd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function zd(){for(var e=window,t=be();t instanceof e.HTMLIFrameElement;){try{var o=typeof t.contentWindow.location.href=="string"}catch{o=!1}if(o)e=t.contentWindow;else break;t=be(e.document)}return t}function al(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Zg(e){var t=zd(),o=e.focusedElem,s=e.selectionRange;if(t!==o&&o&&o.ownerDocument&&Bd(o.ownerDocument.documentElement,o)){if(s!==null&&al(o)){if(t=s.start,e=s.end,e===void 0&&(e=t),"selectionStart"in o)o.selectionStart=t,o.selectionEnd=Math.min(e,o.value.length);else if(e=(t=o.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var u=o.textContent.length,f=Math.min(s.start,u);s=s.end===void 0?f:Math.min(s.end,u),!e.extend&&f>s&&(u=s,s=f,f=u),u=Ud(o,f);var y=Ud(o,s);u&&y&&(e.rangeCount!==1||e.anchorNode!==u.node||e.anchorOffset!==u.offset||e.focusNode!==y.node||e.focusOffset!==y.offset)&&(t=t.createRange(),t.setStart(u.node,u.offset),e.removeAllRanges(),f>s?(e.addRange(t),e.extend(y.node,y.offset)):(t.setEnd(y.node,y.offset),e.addRange(t)))}}for(t=[],e=o;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o=document.documentMode,Jr=null,sl=null,Gi=null,ll=!1;function $d(e,t,o){var s=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;ll||Jr==null||Jr!==be(s)||(s=Jr,"selectionStart"in s&&al(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Gi&&Hi(Gi,s)||(Gi=s,s=na(sl,"onSelect"),0Qr||(e.current=wl[Qr],wl[Qr]=null,Qr--)}function ze(e,t){Qr++,wl[Qr]=e.current,e.current=t}var Wn={},mt=Vn(Wn),bt=Vn(!1),fr=Wn;function Kr(e,t){var o=e.type.contextTypes;if(!o)return Wn;var s=e.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===t)return s.__reactInternalMemoizedMaskedChildContext;var u={},f;for(f in o)u[f]=t[f];return s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=u),u}function Tt(e){return e=e.childContextTypes,e!=null}function aa(){Je(bt),Je(mt)}function rf(e,t,o){if(mt.current!==Wn)throw Error(i(168));ze(mt,t),ze(bt,o)}function of(e,t,o){var s=e.stateNode;if(t=t.childContextTypes,typeof s.getChildContext!="function")return o;s=s.getChildContext();for(var u in s)if(!(u in t))throw Error(i(108,g(e)||"Unknown",u));return q({},o,s)}function sa(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Wn,fr=mt.current,ze(mt,e),ze(bt,bt.current),!0}function af(e,t,o){var s=e.stateNode;if(!s)throw Error(i(169));o?(e=of(e,t,fr),s.__reactInternalMemoizedMergedChildContext=e,Je(bt),Je(mt),ze(mt,e)):Je(bt),ze(bt,o)}var Sn=null,la=!1,Sl=!1;function sf(e){Sn===null?Sn=[e]:Sn.push(e)}function dy(e){la=!0,sf(e)}function Jn(){if(!Sl&&Sn!==null){Sl=!0;var e=0,t=Re;try{var o=Sn;for(Re=1;e>=y,u-=y,kn=1<<32-Kt(t)+u|o<ye?(dt=me,me=null):dt=me.sibling;var De=J(D,me,A[ye],ee);if(De===null){me===null&&(me=dt);break}e&&me&&De.alternate===null&&t(D,me),P=f(De,P,ye),ve===null?ce=De:ve.sibling=De,ve=De,me=dt}if(ye===A.length)return o(D,me),Ge&&hr(D,ye),ce;if(me===null){for(;yeye?(dt=me,me=null):dt=me.sibling;var er=J(D,me,De.value,ee);if(er===null){me===null&&(me=dt);break}e&&me&&er.alternate===null&&t(D,me),P=f(er,P,ye),ve===null?ce=er:ve.sibling=er,ve=er,me=dt}if(De.done)return o(D,me),Ge&&hr(D,ye),ce;if(me===null){for(;!De.done;ye++,De=A.next())De=Q(D,De.value,ee),De!==null&&(P=f(De,P,ye),ve===null?ce=De:ve.sibling=De,ve=De);return Ge&&hr(D,ye),ce}for(me=s(D,me);!De.done;ye++,De=A.next())De=oe(me,D,ye,De.value,ee),De!==null&&(e&&De.alternate!==null&&me.delete(De.key===null?ye:De.key),P=f(De,P,ye),ve===null?ce=De:ve.sibling=De,ve=De);return e&&me.forEach(function(Jy){return t(D,Jy)}),Ge&&hr(D,ye),ce}function tt(D,P,A,ee){if(typeof A=="object"&&A!==null&&A.type===F&&A.key===null&&(A=A.props.children),typeof A=="object"&&A!==null){switch(A.$$typeof){case N:e:{for(var ce=A.key,ve=P;ve!==null;){if(ve.key===ce){if(ce=A.type,ce===F){if(ve.tag===7){o(D,ve.sibling),P=u(ve,A.props.children),P.return=D,D=P;break e}}else if(ve.elementType===ce||typeof ce=="object"&&ce!==null&&ce.$$typeof===Le&&pf(ce)===ve.type){o(D,ve.sibling),P=u(ve,A.props),P.ref=Zi(D,ve,A),P.return=D,D=P;break e}o(D,ve);break}else t(D,ve);ve=ve.sibling}A.type===F?(P=kr(A.props.children,D.mode,ee,A.key),P.return=D,D=P):(ee=Ra(A.type,A.key,A.props,null,D.mode,ee),ee.ref=Zi(D,P,A),ee.return=D,D=ee)}return y(D);case I:e:{for(ve=A.key;P!==null;){if(P.key===ve)if(P.tag===4&&P.stateNode.containerInfo===A.containerInfo&&P.stateNode.implementation===A.implementation){o(D,P.sibling),P=u(P,A.children||[]),P.return=D,D=P;break e}else{o(D,P);break}else t(D,P);P=P.sibling}P=yu(A,D.mode,ee),P.return=D,D=P}return y(D);case Le:return ve=A._init,tt(D,P,ve(A._payload),ee)}if(Ke(A))return le(D,P,A,ee);if(re(A))return ue(D,P,A,ee);fa(D,A)}return typeof A=="string"&&A!==""||typeof A=="number"?(A=""+A,P!==null&&P.tag===6?(o(D,P.sibling),P=u(P,A),P.return=D,D=P):(o(D,P),P=gu(A,D.mode,ee),P.return=D,D=P),y(D)):o(D,P)}return tt}var ti=hf(!0),vf=hf(!1),pa=Vn(null),ha=null,ni=null,Ml=null;function Pl(){Ml=ni=ha=null}function xl(e){var t=pa.current;Je(pa),e._currentValue=t}function Ol(e,t,o){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===o)break;e=e.return}}function ri(e,t){ha=e,Ml=ni=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Mt=!0),e.firstContext=null)}function Wt(e){var t=e._currentValue;if(Ml!==e)if(e={context:e,memoizedValue:t,next:null},ni===null){if(ha===null)throw Error(i(308));ni=e,ha.dependencies={lanes:0,firstContext:e}}else ni=ni.next=e;return t}var vr=null;function Ll(e){vr===null?vr=[e]:vr.push(e)}function mf(e,t,o,s){var u=t.interleaved;return u===null?(o.next=o,Ll(t)):(o.next=u.next,u.next=o),t.interleaved=o,Cn(e,s)}function Cn(e,t){e.lanes|=t;var o=e.alternate;for(o!==null&&(o.lanes|=t),o=e,e=e.return;e!==null;)e.childLanes|=t,o=e.alternate,o!==null&&(o.childLanes|=t),o=e,e=e.return;return o.tag===3?o.stateNode:null}var Hn=!1;function Dl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function gf(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function bn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Gn(e,t,o){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,Oe&2){var u=s.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),s.pending=t,Cn(e,o)}return u=s.interleaved,u===null?(t.next=t,Ll(s)):(t.next=u.next,u.next=t),s.interleaved=t,Cn(e,o)}function va(e,t,o){if(t=t.updateQueue,t!==null&&(t=t.shared,(o&4194240)!==0)){var s=t.lanes;s&=e.pendingLanes,o|=s,t.lanes=o,Hs(e,o)}}function yf(e,t){var o=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,o===s)){var u=null,f=null;if(o=o.firstBaseUpdate,o!==null){do{var y={eventTime:o.eventTime,lane:o.lane,tag:o.tag,payload:o.payload,callback:o.callback,next:null};f===null?u=f=y:f=f.next=y,o=o.next}while(o!==null);f===null?u=f=t:f=f.next=t}else u=f=t;o={baseState:s.baseState,firstBaseUpdate:u,lastBaseUpdate:f,shared:s.shared,effects:s.effects},e.updateQueue=o;return}e=o.lastBaseUpdate,e===null?o.firstBaseUpdate=t:e.next=t,o.lastBaseUpdate=t}function ma(e,t,o,s){var u=e.updateQueue;Hn=!1;var f=u.firstBaseUpdate,y=u.lastBaseUpdate,E=u.shared.pending;if(E!==null){u.shared.pending=null;var b=E,j=b.next;b.next=null,y===null?f=j:y.next=j,y=b;var H=e.alternate;H!==null&&(H=H.updateQueue,E=H.lastBaseUpdate,E!==y&&(E===null?H.firstBaseUpdate=j:E.next=j,H.lastBaseUpdate=b))}if(f!==null){var Q=u.baseState;y=0,H=j=b=null,E=f;do{var J=E.lane,oe=E.eventTime;if((s&J)===J){H!==null&&(H=H.next={eventTime:oe,lane:0,tag:E.tag,payload:E.payload,callback:E.callback,next:null});e:{var le=e,ue=E;switch(J=t,oe=o,ue.tag){case 1:if(le=ue.payload,typeof le=="function"){Q=le.call(oe,Q,J);break e}Q=le;break e;case 3:le.flags=le.flags&-65537|128;case 0:if(le=ue.payload,J=typeof le=="function"?le.call(oe,Q,J):le,J==null)break e;Q=q({},Q,J);break e;case 2:Hn=!0}}E.callback!==null&&E.lane!==0&&(e.flags|=64,J=u.effects,J===null?u.effects=[E]:J.push(E))}else oe={eventTime:oe,lane:J,tag:E.tag,payload:E.payload,callback:E.callback,next:null},H===null?(j=H=oe,b=Q):H=H.next=oe,y|=J;if(E=E.next,E===null){if(E=u.shared.pending,E===null)break;J=E,E=J.next,J.next=null,u.lastBaseUpdate=J,u.shared.pending=null}}while(!0);if(H===null&&(b=Q),u.baseState=b,u.firstBaseUpdate=j,u.lastBaseUpdate=H,t=u.shared.interleaved,t!==null){u=t;do y|=u.lane,u=u.next;while(u!==t)}else f===null&&(u.shared.lanes=0);yr|=y,e.lanes=y,e.memoizedState=Q}}function _f(e,t,o){if(e=t.effects,t.effects=null,e!==null)for(t=0;to?o:4,e(!0);var s=Nl.transition;Nl.transition={};try{e(!1),t()}finally{Re=o,Nl.transition=s}}function Ff(){return Jt().memoizedState}function vy(e,t,o){var s=Kn(e);if(o={lane:s,action:o,hasEagerState:!1,eagerState:null,next:null},Uf(e))Bf(t,o);else if(o=mf(e,t,o,s),o!==null){var u=Et();rn(o,e,s,u),zf(o,t,s)}}function my(e,t,o){var s=Kn(e),u={lane:s,action:o,hasEagerState:!1,eagerState:null,next:null};if(Uf(e))Bf(t,u);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var y=t.lastRenderedState,E=f(y,o);if(u.hasEagerState=!0,u.eagerState=E,Xt(E,y)){var b=t.interleaved;b===null?(u.next=u,Ll(t)):(u.next=b.next,b.next=u),t.interleaved=u;return}}catch{}finally{}o=mf(e,t,u,s),o!==null&&(u=Et(),rn(o,e,s,u),zf(o,t,s))}}function Uf(e){var t=e.alternate;return e===Qe||t!==null&&t===Qe}function Bf(e,t){ro=_a=!0;var o=e.pending;o===null?t.next=t:(t.next=o.next,o.next=t),e.pending=t}function zf(e,t,o){if(o&4194240){var s=t.lanes;s&=e.pendingLanes,o|=s,t.lanes=o,Hs(e,o)}}var ka={readContext:Wt,useCallback:gt,useContext:gt,useEffect:gt,useImperativeHandle:gt,useInsertionEffect:gt,useLayoutEffect:gt,useMemo:gt,useReducer:gt,useRef:gt,useState:gt,useDebugValue:gt,useDeferredValue:gt,useTransition:gt,useMutableSource:gt,useSyncExternalStore:gt,useId:gt,unstable_isNewReconciler:!1},gy={readContext:Wt,useCallback:function(e,t){return mn().memoizedState=[e,t===void 0?null:t],e},useContext:Wt,useEffect:Of,useImperativeHandle:function(e,t,o){return o=o!=null?o.concat([e]):null,wa(4194308,4,If.bind(null,t,e),o)},useLayoutEffect:function(e,t){return wa(4194308,4,e,t)},useInsertionEffect:function(e,t){return wa(4,2,e,t)},useMemo:function(e,t){var o=mn();return t=t===void 0?null:t,e=e(),o.memoizedState=[e,t],e},useReducer:function(e,t,o){var s=mn();return t=o!==void 0?o(t):t,s.memoizedState=s.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},s.queue=e,e=e.dispatch=vy.bind(null,Qe,e),[s.memoizedState,e]},useRef:function(e){var t=mn();return e={current:e},t.memoizedState=e},useState:Pf,useDebugValue:Wl,useDeferredValue:function(e){return mn().memoizedState=e},useTransition:function(){var e=Pf(!1),t=e[0];return e=hy.bind(null,e[1]),mn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,o){var s=Qe,u=mn();if(Ge){if(o===void 0)throw Error(i(407));o=o()}else{if(o=t(),ct===null)throw Error(i(349));gr&30||Ef(s,t,o)}u.memoizedState=o;var f={value:o,getSnapshot:t};return u.queue=f,Of(bf.bind(null,s,f,e),[e]),s.flags|=2048,ao(9,Cf.bind(null,s,f,o,t),void 0,null),o},useId:function(){var e=mn(),t=ct.identifierPrefix;if(Ge){var o=En,s=kn;o=(s&~(1<<32-Kt(s)-1)).toString(32)+o,t=":"+t+"R"+o,o=io++,0<\/script>",e=e.removeChild(e.firstChild)):typeof s.is=="string"?e=y.createElement(o,{is:s.is}):(e=y.createElement(o),o==="select"&&(y=e,s.multiple?y.multiple=!0:s.size&&(y.size=s.size))):e=y.createElementNS(e,o),e[hn]=t,e[Ki]=s,sp(e,t,!1,!1),t.stateNode=e;e:{switch(y=Rs(o,s),o){case"dialog":We("cancel",e),We("close",e),u=s;break;case"iframe":case"object":case"embed":We("load",e),u=s;break;case"video":case"audio":for(u=0;uli&&(t.flags|=128,s=!0,so(f,!1),t.lanes=4194304)}else{if(!s)if(e=ga(y),e!==null){if(t.flags|=128,s=!0,o=e.updateQueue,o!==null&&(t.updateQueue=o,t.flags|=4),so(f,!0),f.tail===null&&f.tailMode==="hidden"&&!y.alternate&&!Ge)return yt(t),null}else 2*et()-f.renderingStartTime>li&&o!==1073741824&&(t.flags|=128,s=!0,so(f,!1),t.lanes=4194304);f.isBackwards?(y.sibling=t.child,t.child=y):(o=f.last,o!==null?o.sibling=y:t.child=y,f.last=y)}return f.tail!==null?(t=f.tail,f.rendering=t,f.tail=t.sibling,f.renderingStartTime=et(),t.sibling=null,o=Ye.current,ze(Ye,s?o&1|2:o&1),t):(yt(t),null);case 22:case 23:return hu(),s=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==s&&(t.flags|=8192),s&&t.mode&1?Rt&1073741824&&(yt(t),t.subtreeFlags&6&&(t.flags|=8192)):yt(t),null;case 24:return null;case 25:return null}throw Error(i(156,t.tag))}function by(e,t){switch(El(t),t.tag){case 1:return Tt(t.type)&&aa(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ii(),Je(bt),Je(mt),Rl(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Al(t),null;case 13:if(Je(Ye),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ei()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Je(Ye),null;case 4:return ii(),null;case 10:return xl(t.type._context),null;case 22:case 23:return hu(),null;case 24:return null;default:return null}}var Ta=!1,_t=!1,Ty=typeof WeakSet=="function"?WeakSet:Set,se=null;function ai(e,t){var o=e.ref;if(o!==null)if(typeof o=="function")try{o(null)}catch(s){Xe(e,t,s)}else o.current=null}function nu(e,t,o){try{o()}catch(s){Xe(e,t,s)}}var cp=!1;function My(e,t){if(hl=Ho,e=zd(),al(e)){if("selectionStart"in e)var o={start:e.selectionStart,end:e.selectionEnd};else e:{o=(o=e.ownerDocument)&&o.defaultView||window;var s=o.getSelection&&o.getSelection();if(s&&s.rangeCount!==0){o=s.anchorNode;var u=s.anchorOffset,f=s.focusNode;s=s.focusOffset;try{o.nodeType,f.nodeType}catch{o=null;break e}var y=0,E=-1,b=-1,j=0,H=0,Q=e,J=null;t:for(;;){for(var oe;Q!==o||u!==0&&Q.nodeType!==3||(E=y+u),Q!==f||s!==0&&Q.nodeType!==3||(b=y+s),Q.nodeType===3&&(y+=Q.nodeValue.length),(oe=Q.firstChild)!==null;)J=Q,Q=oe;for(;;){if(Q===e)break t;if(J===o&&++j===u&&(E=y),J===f&&++H===s&&(b=y),(oe=Q.nextSibling)!==null)break;Q=J,J=Q.parentNode}Q=oe}o=E===-1||b===-1?null:{start:E,end:b}}else o=null}o=o||{start:0,end:0}}else o=null;for(vl={focusedElem:e,selectionRange:o},Ho=!1,se=t;se!==null;)if(t=se,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,se=e;else for(;se!==null;){t=se;try{var le=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(le!==null){var ue=le.memoizedProps,tt=le.memoizedState,D=t.stateNode,P=D.getSnapshotBeforeUpdate(t.elementType===t.type?ue:en(t.type,ue),tt);D.__reactInternalSnapshotBeforeUpdate=P}break;case 3:var A=t.stateNode.containerInfo;A.nodeType===1?A.textContent="":A.nodeType===9&&A.documentElement&&A.removeChild(A.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(ee){Xe(t,t.return,ee)}if(e=t.sibling,e!==null){e.return=t.return,se=e;break}se=t.return}return le=cp,cp=!1,le}function lo(e,t,o){var s=t.updateQueue;if(s=s!==null?s.lastEffect:null,s!==null){var u=s=s.next;do{if((u.tag&e)===e){var f=u.destroy;u.destroy=void 0,f!==void 0&&nu(t,o,f)}u=u.next}while(u!==s)}}function Ma(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var o=t=t.next;do{if((o.tag&e)===e){var s=o.create;o.destroy=s()}o=o.next}while(o!==t)}}function ru(e){var t=e.ref;if(t!==null){var o=e.stateNode;switch(e.tag){case 5:e=o;break;default:e=o}typeof t=="function"?t(e):t.current=e}}function dp(e){var t=e.alternate;t!==null&&(e.alternate=null,dp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[hn],delete t[Ki],delete t[_l],delete t[uy],delete t[cy])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function fp(e){return e.tag===5||e.tag===3||e.tag===4}function pp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||fp(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function iu(e,t,o){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?o.nodeType===8?o.parentNode.insertBefore(e,t):o.insertBefore(e,t):(o.nodeType===8?(t=o.parentNode,t.insertBefore(e,o)):(t=o,t.appendChild(e)),o=o._reactRootContainer,o!=null||t.onclick!==null||(t.onclick=ia));else if(s!==4&&(e=e.child,e!==null))for(iu(e,t,o),e=e.sibling;e!==null;)iu(e,t,o),e=e.sibling}function ou(e,t,o){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?o.insertBefore(e,t):o.appendChild(e);else if(s!==4&&(e=e.child,e!==null))for(ou(e,t,o),e=e.sibling;e!==null;)ou(e,t,o),e=e.sibling}var ft=null,tn=!1;function qn(e,t,o){for(o=o.child;o!==null;)hp(e,t,o),o=o.sibling}function hp(e,t,o){if(pn&&typeof pn.onCommitFiberUnmount=="function")try{pn.onCommitFiberUnmount(Bo,o)}catch{}switch(o.tag){case 5:_t||ai(o,t);case 6:var s=ft,u=tn;ft=null,qn(e,t,o),ft=s,tn=u,ft!==null&&(tn?(e=ft,o=o.stateNode,e.nodeType===8?e.parentNode.removeChild(o):e.removeChild(o)):ft.removeChild(o.stateNode));break;case 18:ft!==null&&(tn?(e=ft,o=o.stateNode,e.nodeType===8?yl(e.parentNode,o):e.nodeType===1&&yl(e,o),Bi(e)):yl(ft,o.stateNode));break;case 4:s=ft,u=tn,ft=o.stateNode.containerInfo,tn=!0,qn(e,t,o),ft=s,tn=u;break;case 0:case 11:case 14:case 15:if(!_t&&(s=o.updateQueue,s!==null&&(s=s.lastEffect,s!==null))){u=s=s.next;do{var f=u,y=f.destroy;f=f.tag,y!==void 0&&(f&2||f&4)&&nu(o,t,y),u=u.next}while(u!==s)}qn(e,t,o);break;case 1:if(!_t&&(ai(o,t),s=o.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=o.memoizedProps,s.state=o.memoizedState,s.componentWillUnmount()}catch(E){Xe(o,t,E)}qn(e,t,o);break;case 21:qn(e,t,o);break;case 22:o.mode&1?(_t=(s=_t)||o.memoizedState!==null,qn(e,t,o),_t=s):qn(e,t,o);break;default:qn(e,t,o)}}function vp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var o=e.stateNode;o===null&&(o=e.stateNode=new Ty),t.forEach(function(s){var u=Ry.bind(null,e,s);o.has(s)||(o.add(s),s.then(u,u))})}}function nn(e,t){var o=t.deletions;if(o!==null)for(var s=0;su&&(u=y),s&=~f}if(s=u,s=et()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*xy(s/1960))-s,10e?16:e,Qn===null)var s=!1;else{if(e=Qn,Qn=null,Da=0,Oe&6)throw Error(i(331));var u=Oe;for(Oe|=4,se=e.current;se!==null;){var f=se,y=f.child;if(se.flags&16){var E=f.deletions;if(E!==null){for(var b=0;bet()-lu?wr(e,0):su|=o),xt(e,t)}function Pp(e,t){t===0&&(e.mode&1?(t=$o,$o<<=1,!($o&130023424)&&($o=4194304)):t=1);var o=Et();e=Cn(e,t),e!==null&&(ji(e,t,o),xt(e,o))}function jy(e){var t=e.memoizedState,o=0;t!==null&&(o=t.retryLane),Pp(e,o)}function Ry(e,t){var o=0;switch(e.tag){case 13:var s=e.stateNode,u=e.memoizedState;u!==null&&(o=u.retryLane);break;case 19:s=e.stateNode;break;default:throw Error(i(314))}s!==null&&s.delete(t),Pp(e,o)}var xp;xp=function(e,t,o){if(e!==null)if(e.memoizedProps!==t.pendingProps||bt.current)Mt=!0;else{if(!(e.lanes&o)&&!(t.flags&128))return Mt=!1,Ey(e,t,o);Mt=!!(e.flags&131072)}else Mt=!1,Ge&&t.flags&1048576&&lf(t,ca,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;ba(e,t),e=t.pendingProps;var u=Kr(t,mt.current);ri(t,o),u=Ul(null,t,s,e,u,o);var f=Bl();return t.flags|=1,typeof u=="object"&&u!==null&&typeof u.render=="function"&&u.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Tt(s)?(f=!0,sa(t)):f=!1,t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,Dl(t),u.updater=Ea,t.stateNode=u,u._reactInternals=t,Hl(t,s,e,o),t=Ql(null,t,s,!0,f,o)):(t.tag=0,Ge&&f&&kl(t),kt(null,t,u,o),t=t.child),t;case 16:s=t.elementType;e:{switch(ba(e,t),e=t.pendingProps,u=s._init,s=u(s._payload),t.type=s,u=t.tag=Fy(s),e=en(s,e),u){case 0:t=Yl(null,t,s,e,o);break e;case 1:t=tp(null,t,s,e,o);break e;case 11:t=Qf(null,t,s,e,o);break e;case 14:t=Kf(null,t,s,en(s.type,e),o);break e}throw Error(i(306,s,""))}return t;case 0:return s=t.type,u=t.pendingProps,u=t.elementType===s?u:en(s,u),Yl(e,t,s,u,o);case 1:return s=t.type,u=t.pendingProps,u=t.elementType===s?u:en(s,u),tp(e,t,s,u,o);case 3:e:{if(np(t),e===null)throw Error(i(387));s=t.pendingProps,f=t.memoizedState,u=f.element,gf(e,t),ma(t,s,null,o);var y=t.memoizedState;if(s=y.element,f.isDehydrated)if(f={element:s,isDehydrated:!1,cache:y.cache,pendingSuspenseBoundaries:y.pendingSuspenseBoundaries,transitions:y.transitions},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){u=oi(Error(i(423)),t),t=rp(e,t,s,o,u);break e}else if(s!==u){u=oi(Error(i(424)),t),t=rp(e,t,s,o,u);break e}else for(jt=$n(t.stateNode.containerInfo.firstChild),At=t,Ge=!0,Zt=null,o=vf(t,null,s,o),t.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(ei(),s===u){t=Tn(e,t,o);break e}kt(e,t,s,o)}t=t.child}return t;case 5:return wf(t),e===null&&bl(t),s=t.type,u=t.pendingProps,f=e!==null?e.memoizedProps:null,y=u.children,ml(s,u)?y=null:f!==null&&ml(s,f)&&(t.flags|=32),ep(e,t),kt(e,t,y,o),t.child;case 6:return e===null&&bl(t),null;case 13:return ip(e,t,o);case 4:return Il(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=ti(t,null,s,o):kt(e,t,s,o),t.child;case 11:return s=t.type,u=t.pendingProps,u=t.elementType===s?u:en(s,u),Qf(e,t,s,u,o);case 7:return kt(e,t,t.pendingProps,o),t.child;case 8:return kt(e,t,t.pendingProps.children,o),t.child;case 12:return kt(e,t,t.pendingProps.children,o),t.child;case 10:e:{if(s=t.type._context,u=t.pendingProps,f=t.memoizedProps,y=u.value,ze(pa,s._currentValue),s._currentValue=y,f!==null)if(Xt(f.value,y)){if(f.children===u.children&&!bt.current){t=Tn(e,t,o);break e}}else for(f=t.child,f!==null&&(f.return=t);f!==null;){var E=f.dependencies;if(E!==null){y=f.child;for(var b=E.firstContext;b!==null;){if(b.context===s){if(f.tag===1){b=bn(-1,o&-o),b.tag=2;var j=f.updateQueue;if(j!==null){j=j.shared;var H=j.pending;H===null?b.next=b:(b.next=H.next,H.next=b),j.pending=b}}f.lanes|=o,b=f.alternate,b!==null&&(b.lanes|=o),Ol(f.return,o,t),E.lanes|=o;break}b=b.next}}else if(f.tag===10)y=f.type===t.type?null:f.child;else if(f.tag===18){if(y=f.return,y===null)throw Error(i(341));y.lanes|=o,E=y.alternate,E!==null&&(E.lanes|=o),Ol(y,o,t),y=f.sibling}else y=f.child;if(y!==null)y.return=f;else for(y=f;y!==null;){if(y===t){y=null;break}if(f=y.sibling,f!==null){f.return=y.return,y=f;break}y=y.return}f=y}kt(e,t,u.children,o),t=t.child}return t;case 9:return u=t.type,s=t.pendingProps.children,ri(t,o),u=Wt(u),s=s(u),t.flags|=1,kt(e,t,s,o),t.child;case 14:return s=t.type,u=en(s,t.pendingProps),u=en(s.type,u),Kf(e,t,s,u,o);case 15:return Xf(e,t,t.type,t.pendingProps,o);case 17:return s=t.type,u=t.pendingProps,u=t.elementType===s?u:en(s,u),ba(e,t),t.tag=1,Tt(s)?(e=!0,sa(t)):e=!1,ri(t,o),Vf(t,s,u),Hl(t,s,u,o),Ql(null,t,s,!0,e,o);case 19:return ap(e,t,o);case 22:return Zf(e,t,o)}throw Error(i(156,t.tag))};function Op(e,t){return ld(e,t)}function Ny(e,t,o,s){this.tag=e,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Gt(e,t,o,s){return new Ny(e,t,o,s)}function mu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Fy(e){if(typeof e=="function")return mu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ae)return 11;if(e===ke)return 14}return 2}function Zn(e,t){var o=e.alternate;return o===null?(o=Gt(e.tag,t,e.key,e.mode),o.elementType=e.elementType,o.type=e.type,o.stateNode=e.stateNode,o.alternate=e,e.alternate=o):(o.pendingProps=t,o.type=e.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=e.flags&14680064,o.childLanes=e.childLanes,o.lanes=e.lanes,o.child=e.child,o.memoizedProps=e.memoizedProps,o.memoizedState=e.memoizedState,o.updateQueue=e.updateQueue,t=e.dependencies,o.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},o.sibling=e.sibling,o.index=e.index,o.ref=e.ref,o}function Ra(e,t,o,s,u,f){var y=2;if(s=e,typeof e=="function")mu(e)&&(y=1);else if(typeof e=="string")y=5;else e:switch(e){case F:return kr(o.children,u,f,t);case z:y=8,u|=8;break;case X:return e=Gt(12,o,t,u|2),e.elementType=X,e.lanes=f,e;case Y:return e=Gt(13,o,t,u),e.elementType=Y,e.lanes=f,e;case he:return e=Gt(19,o,t,u),e.elementType=he,e.lanes=f,e;case Ee:return Na(o,u,f,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case te:y=10;break e;case pe:y=9;break e;case ae:y=11;break e;case ke:y=14;break e;case Le:y=16,s=null;break e}throw Error(i(130,e==null?e:typeof e,""))}return t=Gt(y,o,t,u),t.elementType=e,t.type=s,t.lanes=f,t}function kr(e,t,o,s){return e=Gt(7,e,s,t),e.lanes=o,e}function Na(e,t,o,s){return e=Gt(22,e,s,t),e.elementType=Ee,e.lanes=o,e.stateNode={isHidden:!1},e}function gu(e,t,o){return e=Gt(6,e,null,t),e.lanes=o,e}function yu(e,t,o){return t=Gt(4,e.children!==null?e.children:[],e.key,t),t.lanes=o,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Uy(e,t,o,s,u){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Js(0),this.expirationTimes=Js(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Js(0),this.identifierPrefix=s,this.onRecoverableError=u,this.mutableSourceEagerHydrationData=null}function _u(e,t,o,s,u,f,y,E,b){return e=new Uy(e,t,o,E,b),t===1?(t=1,f===!0&&(t|=8)):t=0,f=Gt(3,null,null,t),e.current=f,f.stateNode=e,f.memoizedState={element:s,isDehydrated:o,cache:null,transitions:null,pendingSuspenseBoundaries:null},Dl(f),e}function By(e,t,o){var s=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(n){console.error(n)}}return r(),bu.exports=Zy(),bu.exports}var Wp;function t_(){if(Wp)return Ja;Wp=1;var r=e_();return Ja.createRoot=r.createRoot,Ja.hydrateRoot=r.hydrateRoot,Ja}var n_=t_();const r_=Pc(n_);function Jp(r,n){if(r==null)return{};var i,a,l=function(p,v){if(p==null)return{};var h,_,w={},S=Object.keys(p);for(_=0;_=0||(w[h]=p[h]);return w}(r,n);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(r,i)&&(l[i]=r[i])}return l}function cn(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}function Fe(r){return Fe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Fe(r)}function Dv(r){var n=function(i,a){if(Fe(i)!=="object"||i===null)return i;var l=i[Symbol.toPrimitive];if(l!==void 0){var c=l.call(i,a||"default");if(Fe(c)!=="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(i)}(r,"string");return Fe(n)==="symbol"?n:String(n)}function Hp(r,n){for(var i=0;ir.length)&&(n=r.length);for(var i=0,a=new Array(n);i0&&p.length>l&&!p.warned){p.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+p.length+" "+String(n)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=r,h.type=n,h.count=p.length,v=h,console&&console.warn&&console.warn(v)}return r}function o_(){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 Zp(r,n,i){var a={fired:!1,wrapFn:void 0,target:r,type:n,listener:i},l=o_.bind(a);return l.listener=i,a.wrapFn=l,l}function eh(r,n,i){var a=r._events;if(a===void 0)return[];var l=a[n];return l===void 0?[]:typeof l=="function"?i?[l.listener||l]:[l]:i?function(c){for(var p=new Array(c.length),v=0;v0&&(c=n[0]),c instanceof Error)throw c;var p=new Error("Unhandled error."+(c?" ("+c.message+")":""));throw p.context=c,p}var v=l[r];if(v===void 0)return!1;if(typeof v=="function")Yp(v,this,n);else{var h=v.length,_=jv(v,h);for(i=0;i=0;c--)if(i[c]===n||i[c].listener===n){p=i[c].listener,l=c;break}if(l<0)return this;l===0?i.shift():function(v,h){for(;h+1=0;a--)this.removeListener(r,n[a]);return this},Ne.prototype.listeners=function(r){return eh(this,r,!0)},Ne.prototype.rawListeners=function(r){return eh(this,r,!1)},Ne.listenerCount=function(r,n){return typeof r.listenerCount=="function"?r.listenerCount(n):th.call(r,n)},Ne.prototype.listenerCount=th,Ne.prototype.eventNames=function(){return this._eventsCount>0?Iv(this._events):[]};var rh=Object.prototype.hasOwnProperty;function ih(r,n,i){for(i of r.keys())if(Dt(i,n))return i}function Dt(r,n){var i,a,l;if(r===n)return!0;if(r&&n&&(i=r.constructor)===n.constructor){if(i===Date)return r.getTime()===n.getTime();if(i===RegExp)return r.toString()===n.toString();if(i===Array){if((a=r.length)===n.length)for(;a--&&Dt(r[a],n[a]););return a===-1}if(i===Set){if(r.size!==n.size)return!1;for(a of r)if((l=a)&&typeof l=="object"&&!(l=ih(n,l))||!n.has(l))return!1;return!0}if(i===Map){if(r.size!==n.size)return!1;for(a of r)if((l=a[0])&&typeof l=="object"&&!(l=ih(n,l))||!Dt(a[1],n.get(l)))return!1;return!0}if(i===ArrayBuffer)r=new Uint8Array(r),n=new Uint8Array(n);else if(i===DataView){if((a=r.byteLength)===n.byteLength)for(;a--&&r.getInt8(a)===n.getInt8(a););return a===-1}if(ArrayBuffer.isView(r)){if((a=r.byteLength)===n.byteLength)for(;a--&&r[a]===n[a];);return a===-1}if(!i||typeof r=="object"){for(i in a=0,r)if(rh.call(r,i)&&++a&&!rh.call(n,i)||!(i in n)||!Dt(r[i],n[i]))return!1;return Object.keys(n).length===a}}return r!=r&&n!=n}const a_={"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"},Rv={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"},nt={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},Ct={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"},rr={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class V{static getFirstMatch(n,i){const a=i.match(n);return a&&a.length>0&&a[1]||""}static getSecondMatch(n,i){const a=i.match(n);return a&&a.length>1&&a[2]||""}static matchAndReturnConst(n,i,a){if(n.test(i))return a}static getWindowsVersionName(n){switch(n){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(n){const i=n.split(".").splice(0,2).map(a=>parseInt(a,10)||0);if(i.push(0),i[0]===10)switch(i[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(n){const i=n.split(".").splice(0,2).map(a=>parseInt(a,10)||0);if(i.push(0),!(i[0]===1&&i[1]<5))return i[0]===1&&i[1]<6?"Cupcake":i[0]===1&&i[1]>=6?"Donut":i[0]===2&&i[1]<2?"Eclair":i[0]===2&&i[1]===2?"Froyo":i[0]===2&&i[1]>2?"Gingerbread":i[0]===3?"Honeycomb":i[0]===4&&i[1]<1?"Ice Cream Sandwich":i[0]===4&&i[1]<4?"Jelly Bean":i[0]===4&&i[1]>=4?"KitKat":i[0]===5?"Lollipop":i[0]===6?"Marshmallow":i[0]===7?"Nougat":i[0]===8?"Oreo":i[0]===9?"Pie":void 0}static getVersionPrecision(n){return n.split(".").length}static compareVersions(n,i,a=!1){const l=V.getVersionPrecision(n),c=V.getVersionPrecision(i);let p=Math.max(l,c),v=0;const h=V.map([n,i],_=>{const w=p-V.getVersionPrecision(_),S=_+new Array(w+1).join(".0");return V.map(S.split("."),T=>new Array(20-T.length).join("0")+T).reverse()});for(a&&(v=p-Math.min(l,c)),p-=1;p>=v;){if(h[0][p]>h[1][p])return 1;if(h[0][p]===h[1][p]){if(p===v)return 0;p-=1}else if(h[0][p]{a[v]=p[v]})}return n}static getBrowserAlias(n){return a_[n]}static getBrowserTypeByAlias(n){return Rv[n]||""}}const Ue=/version\/(\d+(\.?_?\d+)+)/i,s_=[{test:[/googlebot/i],describe(r){const n={name:"Googlebot"},i=V.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,r)||V.getFirstMatch(Ue,r);return i&&(n.version=i),n}},{test:[/opera/i],describe(r){const n={name:"Opera"},i=V.getFirstMatch(Ue,r)||V.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/opr\/|opios/i],describe(r){const n={name:"Opera"},i=V.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,r)||V.getFirstMatch(Ue,r);return i&&(n.version=i),n}},{test:[/SamsungBrowser/i],describe(r){const n={name:"Samsung Internet for Android"},i=V.getFirstMatch(Ue,r)||V.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/Whale/i],describe(r){const n={name:"NAVER Whale Browser"},i=V.getFirstMatch(Ue,r)||V.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/MZBrowser/i],describe(r){const n={name:"MZ Browser"},i=V.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,r)||V.getFirstMatch(Ue,r);return i&&(n.version=i),n}},{test:[/focus/i],describe(r){const n={name:"Focus"},i=V.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,r)||V.getFirstMatch(Ue,r);return i&&(n.version=i),n}},{test:[/swing/i],describe(r){const n={name:"Swing"},i=V.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,r)||V.getFirstMatch(Ue,r);return i&&(n.version=i),n}},{test:[/coast/i],describe(r){const n={name:"Opera Coast"},i=V.getFirstMatch(Ue,r)||V.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(r){const n={name:"Opera Touch"},i=V.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,r)||V.getFirstMatch(Ue,r);return i&&(n.version=i),n}},{test:[/yabrowser/i],describe(r){const n={name:"Yandex Browser"},i=V.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,r)||V.getFirstMatch(Ue,r);return i&&(n.version=i),n}},{test:[/ucbrowser/i],describe(r){const n={name:"UC Browser"},i=V.getFirstMatch(Ue,r)||V.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/Maxthon|mxios/i],describe(r){const n={name:"Maxthon"},i=V.getFirstMatch(Ue,r)||V.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/epiphany/i],describe(r){const n={name:"Epiphany"},i=V.getFirstMatch(Ue,r)||V.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/puffin/i],describe(r){const n={name:"Puffin"},i=V.getFirstMatch(Ue,r)||V.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/sleipnir/i],describe(r){const n={name:"Sleipnir"},i=V.getFirstMatch(Ue,r)||V.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/k-meleon/i],describe(r){const n={name:"K-Meleon"},i=V.getFirstMatch(Ue,r)||V.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/micromessenger/i],describe(r){const n={name:"WeChat"},i=V.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,r)||V.getFirstMatch(Ue,r);return i&&(n.version=i),n}},{test:[/qqbrowser/i],describe(r){const n={name:/qqbrowserlite/i.test(r)?"QQ Browser Lite":"QQ Browser"},i=V.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,r)||V.getFirstMatch(Ue,r);return i&&(n.version=i),n}},{test:[/msie|trident/i],describe(r){const n={name:"Internet Explorer"},i=V.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/\sedg\//i],describe(r){const n={name:"Microsoft Edge"},i=V.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/edg([ea]|ios)/i],describe(r){const n={name:"Microsoft Edge"},i=V.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/vivaldi/i],describe(r){const n={name:"Vivaldi"},i=V.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/seamonkey/i],describe(r){const n={name:"SeaMonkey"},i=V.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/sailfish/i],describe(r){const n={name:"Sailfish"},i=V.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,r);return i&&(n.version=i),n}},{test:[/silk/i],describe(r){const n={name:"Amazon Silk"},i=V.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/phantom/i],describe(r){const n={name:"PhantomJS"},i=V.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/slimerjs/i],describe(r){const n={name:"SlimerJS"},i=V.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(r){const n={name:"BlackBerry"},i=V.getFirstMatch(Ue,r)||V.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/(web|hpw)[o0]s/i],describe(r){const n={name:"WebOS Browser"},i=V.getFirstMatch(Ue,r)||V.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/bada/i],describe(r){const n={name:"Bada"},i=V.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/tizen/i],describe(r){const n={name:"Tizen"},i=V.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,r)||V.getFirstMatch(Ue,r);return i&&(n.version=i),n}},{test:[/qupzilla/i],describe(r){const n={name:"QupZilla"},i=V.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,r)||V.getFirstMatch(Ue,r);return i&&(n.version=i),n}},{test:[/firefox|iceweasel|fxios/i],describe(r){const n={name:"Firefox"},i=V.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/electron/i],describe(r){const n={name:"Electron"},i=V.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/MiuiBrowser/i],describe(r){const n={name:"Miui"},i=V.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/chromium/i],describe(r){const n={name:"Chromium"},i=V.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,r)||V.getFirstMatch(Ue,r);return i&&(n.version=i),n}},{test:[/chrome|crios|crmo/i],describe(r){const n={name:"Chrome"},i=V.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/GSA/i],describe(r){const n={name:"Google Search"},i=V.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test(r){const n=!r.test(/like android/i),i=r.test(/android/i);return n&&i},describe(r){const n={name:"Android Browser"},i=V.getFirstMatch(Ue,r);return i&&(n.version=i),n}},{test:[/playstation 4/i],describe(r){const n={name:"PlayStation 4"},i=V.getFirstMatch(Ue,r);return i&&(n.version=i),n}},{test:[/safari|applewebkit/i],describe(r){const n={name:"Safari"},i=V.getFirstMatch(Ue,r);return i&&(n.version=i),n}},{test:[/.*/i],describe(r){const n=r.search("\\(")!==-1?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:V.getFirstMatch(n,r),version:V.getSecondMatch(n,r)}}}];var l_=[{test:[/Roku\/DVP/],describe(r){const n=V.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,r);return{name:Ct.Roku,version:n}}},{test:[/windows phone/i],describe(r){const n=V.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,r);return{name:Ct.WindowsPhone,version:n}}},{test:[/windows /i],describe(r){const n=V.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,r),i=V.getWindowsVersionName(n);return{name:Ct.Windows,version:n,versionName:i}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(r){const n={name:Ct.iOS},i=V.getSecondMatch(/(Version\/)(\d[\d.]+)/,r);return i&&(n.version=i),n}},{test:[/macintosh/i],describe(r){const n=V.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,r).replace(/[_\s]/g,"."),i=V.getMacOSVersionName(n),a={name:Ct.MacOS,version:n};return i&&(a.versionName=i),a}},{test:[/(ipod|iphone|ipad)/i],describe(r){const n=V.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,r).replace(/[_\s]/g,".");return{name:Ct.iOS,version:n}}},{test(r){const n=!r.test(/like android/i),i=r.test(/android/i);return n&&i},describe(r){const n=V.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,r),i=V.getAndroidVersionName(n),a={name:Ct.Android,version:n};return i&&(a.versionName=i),a}},{test:[/(web|hpw)[o0]s/i],describe(r){const n=V.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,r),i={name:Ct.WebOS};return n&&n.length&&(i.version=n),i}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(r){const n=V.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,r)||V.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,r)||V.getFirstMatch(/\bbb(\d+)/i,r);return{name:Ct.BlackBerry,version:n}}},{test:[/bada/i],describe(r){const n=V.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,r);return{name:Ct.Bada,version:n}}},{test:[/tizen/i],describe(r){const n=V.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,r);return{name:Ct.Tizen,version:n}}},{test:[/linux/i],describe:()=>({name:Ct.Linux})},{test:[/CrOS/],describe:()=>({name:Ct.ChromeOS})},{test:[/PlayStation 4/],describe(r){const n=V.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,r);return{name:Ct.PlayStation4,version:n}}}],u_=[{test:[/googlebot/i],describe:()=>({type:"bot",vendor:"Google"})},{test:[/huawei/i],describe(r){const n=V.getFirstMatch(/(can-l01)/i,r)&&"Nova",i={type:nt.mobile,vendor:"Huawei"};return n&&(i.model=n),i}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:()=>({type:nt.tablet,vendor:"Nexus"})},{test:[/ipad/i],describe:()=>({type:nt.tablet,vendor:"Apple",model:"iPad"})},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:()=>({type:nt.tablet,vendor:"Apple",model:"iPad"})},{test:[/kftt build/i],describe:()=>({type:nt.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"})},{test:[/silk/i],describe:()=>({type:nt.tablet,vendor:"Amazon"})},{test:[/tablet(?! pc)/i],describe:()=>({type:nt.tablet})},{test(r){const n=r.test(/ipod|iphone/i),i=r.test(/like (ipod|iphone)/i);return n&&!i},describe(r){const n=V.getFirstMatch(/(ipod|iphone)/i,r);return{type:nt.mobile,vendor:"Apple",model:n}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:()=>({type:nt.mobile,vendor:"Nexus"})},{test:[/[^-]mobi/i],describe:()=>({type:nt.mobile})},{test:r=>r.getBrowserName(!0)==="blackberry",describe:()=>({type:nt.mobile,vendor:"BlackBerry"})},{test:r=>r.getBrowserName(!0)==="bada",describe:()=>({type:nt.mobile})},{test:r=>r.getBrowserName()==="windows phone",describe:()=>({type:nt.mobile,vendor:"Microsoft"})},{test(r){const n=Number(String(r.getOSVersion()).split(".")[0]);return r.getOSName(!0)==="android"&&n>=3},describe:()=>({type:nt.tablet})},{test:r=>r.getOSName(!0)==="android",describe:()=>({type:nt.mobile})},{test:r=>r.getOSName(!0)==="macos",describe:()=>({type:nt.desktop,vendor:"Apple"})},{test:r=>r.getOSName(!0)==="windows",describe:()=>({type:nt.desktop})},{test:r=>r.getOSName(!0)==="linux",describe:()=>({type:nt.desktop})},{test:r=>r.getOSName(!0)==="playstation 4",describe:()=>({type:nt.tv})},{test:r=>r.getOSName(!0)==="roku",describe:()=>({type:nt.tv})}],c_=[{test:r=>r.getBrowserName(!0)==="microsoft edge",describe(r){if(/\sedg\//i.test(r))return{name:rr.Blink};const n=V.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,r);return{name:rr.EdgeHTML,version:n}}},{test:[/trident/i],describe(r){const n={name:rr.Trident},i=V.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:r=>r.test(/presto/i),describe(r){const n={name:rr.Presto},i=V.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test(r){const n=r.test(/gecko/i),i=r.test(/like gecko/i);return n&&!i},describe(r){const n={name:rr.Gecko},i=V.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}},{test:[/(apple)?webkit\/537\.36/i],describe:()=>({name:rr.Blink})},{test:[/(apple)?webkit/i],describe(r){const n={name:rr.WebKit},i=V.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,r);return i&&(n.version=i),n}}];class oh{constructor(n,i=!1){if(n==null||n==="")throw new Error("UserAgent parameter can't be empty");this._ua=n,this.parsedResult={},i!==!0&&this.parse()}getUA(){return this._ua}test(n){return n.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const n=V.find(s_,i=>{if(typeof i.test=="function")return i.test(this);if(i.test instanceof Array)return i.test.some(a=>this.test(a));throw new Error("Browser's test function is not valid")});return n&&(this.parsedResult.browser=n.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(n){return n?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 n=V.find(l_,i=>{if(typeof i.test=="function")return i.test(this);if(i.test instanceof Array)return i.test.some(a=>this.test(a));throw new Error("Browser's test function is not valid")});return n&&(this.parsedResult.os=n.describe(this.getUA())),this.parsedResult.os}getOSName(n){const{name:i}=this.getOS();return n?String(i).toLowerCase()||"":i||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(n=!1){const{type:i}=this.getPlatform();return n?String(i).toLowerCase()||"":i||""}parsePlatform(){this.parsedResult.platform={};const n=V.find(u_,i=>{if(typeof i.test=="function")return i.test(this);if(i.test instanceof Array)return i.test.some(a=>this.test(a));throw new Error("Browser's test function is not valid")});return n&&(this.parsedResult.platform=n.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(n){return n?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const n=V.find(c_,i=>{if(typeof i.test=="function")return i.test(this);if(i.test instanceof Array)return i.test.some(a=>this.test(a));throw new Error("Browser's test function is not valid")});return n&&(this.parsedResult.engine=n.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return V.assign({},this.parsedResult)}satisfies(n){const i={};let a=0;const l={};let c=0;if(Object.keys(n).forEach(p=>{const v=n[p];typeof v=="string"?(l[p]=v,c+=1):typeof v=="object"&&(i[p]=v,a+=1)}),a>0){const p=Object.keys(i),v=V.find(p,_=>this.isOS(_));if(v){const _=this.satisfies(i[v]);if(_!==void 0)return _}const h=V.find(p,_=>this.isPlatform(_));if(h){const _=this.satisfies(i[h]);if(_!==void 0)return _}}if(c>0){const p=Object.keys(l),v=V.find(p,h=>this.isBrowser(h,!0));if(v!==void 0)return this.compareVersion(l[v])}}isBrowser(n,i=!1){const a=this.getBrowserName().toLowerCase();let l=n.toLowerCase();const c=V.getBrowserTypeByAlias(l);return i&&c&&(l=c.toLowerCase()),l===a}compareVersion(n){let i=[0],a=n,l=!1;const c=this.getBrowserVersion();if(typeof c=="string")return n[0]===">"||n[0]==="<"?(a=n.substr(1),n[1]==="="?(l=!0,a=n.substr(2)):i=[],n[0]===">"?i.push(1):i.push(-1)):n[0]==="="?a=n.substr(1):n[0]==="~"&&(l=!0,a=n.substr(1)),i.indexOf(V.compareVersions(c,a,l))>-1}isOS(n){return this.getOSName(!0)===String(n).toLowerCase()}isPlatform(n){return this.getPlatformType(!0)===String(n).toLowerCase()}isEngine(n){return this.getEngineName(!0)===String(n).toLowerCase()}is(n,i=!1){return this.isBrowser(n,i)||this.isOS(n)||this.isPlatform(n)}some(n=[]){return n.some(i=>this.is(i))}}/*! * Bowser - a browser detector * https://github.com/lancedikson/bowser * MIT License | (c) Dustin Diaz 2012-2015 * MIT License | (c) Denis Demchenko 2015-2019 */class d_{static getParser(n,i=!1){if(typeof n!="string")throw new Error("UserAgent should be a string");return new oh(n,i)}static parse(n){return new oh(n).getResult()}static get BROWSER_MAP(){return Rv}static get ENGINE_MAP(){return rr}static get OS_MAP(){return Ct}static get PLATFORMS_MAP(){return nt}}function xs(){return Date.now()+Math.random().toString()}function vo(){throw new Error("Method must be implemented in subclass")}function Nv(r,n){return n!=null&&n.proxyUrl?n.proxyUrl+(n.proxyUrl.slice(-1)==="/"?"":"/")+r.substring(8):r}function ps(r){return r!=null&&r.callObjectBundleUrlOverride?r.callObjectBundleUrlOverride:Nv("https://c.daily.co/call-machine/versioned/".concat("0.72.2","/static/call-machine-object-bundle.js"),r)}function Po(r){try{new URL(r)}catch{return!1}return!0}const Fv=Object.prototype.toString;function Uv(r){switch(Fv.call(r)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return Ar(r,Error)}}function Pi(r,n){return Fv.call(r)===`[object ${n}]`}function Oc(r){return Pi(r,"ErrorEvent")}function ah(r){return Pi(r,"DOMError")}function Ir(r){return Pi(r,"String")}function Bv(r){return r===null||typeof r!="object"&&typeof r!="function"}function Ci(r){return Pi(r,"Object")}function hs(r){return typeof Event<"u"&&Ar(r,Event)}function Lc(r){return!!(r&&r.then&&typeof r.then=="function")}function Ar(r,n){try{return r instanceof n}catch{return!1}}function yi(r,n=0){return typeof r!="string"||n===0||r.length<=n?r:`${r.slice(0,n)}...`}function sh(r,n){if(!Array.isArray(r))return"";const i=[];for(let a=0;af_(r,a,i))}function p_(r,n,i=250,a,l,c,p){if(!(c.exception&&c.exception.values&&p&&Ar(p.originalException,Error)))return;const v=c.exception.values.length>0?c.exception.values[c.exception.values.length-1]:void 0;var h,_;v&&(c.exception.values=(h=Ku(r,n,l,p.originalException,a,c.exception.values,v,0),_=i,h.map(w=>(w.value&&(w.value=yi(w.value,_)),w))))}function Ku(r,n,i,a,l,c,p,v){if(c.length>=i+1)return c;let h=[...c];if(Ar(a[l],Error)){lh(p,v);const _=r(n,a[l]),w=h.length;uh(_,l,w,v),h=Ku(r,n,i,a[l],l,[_,...h],_,w)}return Array.isArray(a.errors)&&a.errors.forEach((_,w)=>{if(Ar(_,Error)){lh(p,v);const S=r(n,_),T=h.length;uh(S,`errors[${w}]`,T,v),h=Ku(r,n,i,_,l,[S,...h],S,T)}}),h}function lh(r,n){r.mechanism=r.mechanism||{type:"generic",handled:!0},r.mechanism={...r.mechanism,is_exception_group:!0,exception_id:n}}function uh(r,n,i,a){r.mechanism=r.mechanism||{type:"generic",handled:!0},r.mechanism={...r.mechanism,type:"chained",source:n,exception_id:i,parent_id:a}}function Ga(r){return r&&r.Math==Math?r:void 0}const Yt=typeof globalThis=="object"&&Ga(globalThis)||typeof window=="object"&&Ga(window)||typeof self=="object"&&Ga(self)||typeof global=="object"&&Ga(global)||function(){return this}()||{};function Ao(){return Yt}function Dc(r,n,i){const a=i||Yt,l=a.__SENTRY__=a.__SENTRY__||{};return l[r]||(l[r]=n())}const h_=Ao(),v_=80;function Xu(r,n={}){try{let i=r;const a=5,l=[];let c=0,p=0;const v=" > ",h=v.length;let _;const w=Array.isArray(n)?n:n.keyAttrs,S=!Array.isArray(n)&&n.maxStringLength||v_;for(;i&&c++1&&p+l.length*h+_.length>=S));)l.push(_),p+=_.length,i=i.parentNode;return l.reverse().join(v)}catch{return""}}function m_(r,n){const i=r,a=[];let l,c,p,v,h;if(!i||!i.tagName)return"";a.push(i.tagName.toLowerCase());const _=n&&n.length?n.filter(S=>i.getAttribute(S)).map(S=>[S,i.getAttribute(S)]):null;if(_&&_.length)_.forEach(S=>{a.push(`[${S[0]}="${S[1]}"]`)});else if(i.id&&a.push(`#${i.id}`),l=i.className,l&&Ir(l))for(c=l.split(/\s+/),h=0;h{const l=n[a]&&n[a].__sentry_original__;a in n&&l&&(i[a]=n[a],n[a]=l)});try{return r()}finally{Object.keys(i).forEach(a=>{n[a]=i[a]})}}function ch(){let r=!1;const n={enable:()=>{r=!0},disable:()=>{r=!1}};return typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?vs.forEach(i=>{n[i]=(...a)=>{r&&zv(()=>{Yt.console[i](`Sentry Logger [${i}]:`,...a)})}}):vs.forEach(i=>{n[i]=()=>{}}),n}let Ce;Ce=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?Dc("logger",ch):ch();const g_=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function ms(r,n=!1){const{host:i,path:a,pass:l,port:c,projectId:p,protocol:v,publicKey:h}=r;return`${v}://${h}${n&&l?`:${l}`:""}@${i}${c?`:${c}`:""}/${a&&`${a}/`}${p}`}function dh(r){return{protocol:r.protocol,publicKey:r.publicKey||"",pass:r.pass||"",host:r.host,port:r.port||"",path:r.path||"",projectId:r.projectId}}function y_(r){const n=typeof r=="string"?function(i){const a=g_.exec(i);if(!a)return void console.error(`Invalid Sentry Dsn: ${i}`);const[l,c,p="",v,h="",_]=a.slice(1);let w="",S=_;const T=S.split("/");if(T.length>1&&(w=T.slice(0,-1).join("/"),S=T.pop()),S){const M=S.match(/^\d+/);M&&(S=M[0])}return dh({host:v,pass:p,path:w,projectId:S,port:h,protocol:l,publicKey:c})}(r):dh(r);if(n&&function(i){if(typeof __SENTRY_DEBUG__<"u"&&!__SENTRY_DEBUG__)return!0;const{port:a,projectId:l,protocol:c}=i;return!(["protocol","publicKey","host","projectId"].find(p=>!i[p]&&(Ce.error(`Invalid Sentry Dsn: ${p} missing`),!0))||(l.match(/^\d+$/)?function(p){return p==="http"||p==="https"}(c)?a&&isNaN(parseInt(a,10))&&(Ce.error(`Invalid Sentry Dsn: Invalid port ${a}`),1):(Ce.error(`Invalid Sentry Dsn: Invalid protocol ${c}`),1):(Ce.error(`Invalid Sentry Dsn: Invalid projectId ${l}`),1)))}(n))return n}class sn extends Error{constructor(n,i="warn"){super(n),this.message=n,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=i}}function ht(r,n,i){if(!(n in r))return;const a=r[n],l=i(a);if(typeof l=="function")try{$v(l,a)}catch{}r[n]=l}function Ic(r,n,i){Object.defineProperty(r,n,{value:i,writable:!0,configurable:!0})}function $v(r,n){const i=n.prototype||{};r.prototype=n.prototype=i,Ic(r,"__sentry_original__",n)}function Ac(r){return r.__sentry_original__}function Vv(r){if(Uv(r))return{message:r.message,name:r.name,stack:r.stack,...ph(r)};if(hs(r)){const n={type:r.type,target:fh(r.target),currentTarget:fh(r.currentTarget),...ph(r)};return typeof CustomEvent<"u"&&Ar(r,CustomEvent)&&(n.detail=r.detail),n}return r}function fh(r){try{return n=r,typeof Element<"u"&&Ar(n,Element)?Xu(r):Object.prototype.toString.call(r)}catch{return""}var n}function ph(r){if(typeof r=="object"&&r!==null){const n={};for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i]);return n}return{}}function Os(r){return Zu(r,new Map)}function Zu(r,n){if(Ci(r)){const i=n.get(r);if(i!==void 0)return i;const a={};n.set(r,a);for(const l of Object.keys(r))r[l]!==void 0&&(a[l]=Zu(r[l],n));return a}if(Array.isArray(r)){const i=n.get(r);if(i!==void 0)return i;const a=[];return n.set(r,a),r.forEach(l=>{a.push(Zu(l,n))}),a}return r}const hh="";function lr(r){try{return r&&typeof r=="function"&&r.name||hh}catch{return hh}}const Pu=Ao();function ec(r){return r&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(r.toString())}function __(){if(!function(){if(!("fetch"in Pu))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}())return!1;if(ec(Pu.fetch))return!0;let r=!1;const n=Pu.document;if(n&&typeof n.createElement=="function")try{const i=n.createElement("iframe");i.hidden=!0,n.head.appendChild(i),i.contentWindow&&i.contentWindow.fetch&&(r=ec(i.contentWindow.fetch)),n.head.removeChild(i)}catch(i){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ce.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",i)}return r}const qa=Ao(),qe=Ao(),_o="__sentry_xhr_v2__",Co={},vh={};function w_(r){if(!vh[r])switch(vh[r]=!0,r){case"console":(function(){"console"in qe&&vs.forEach(function(n){n in qe.console&&ht(qe.console,n,function(i){return function(...a){on("console",{args:a,level:n}),i&&i.apply(qe.console,a)}})})})();break;case"dom":(function(){if(!("document"in qe))return;const n=on.bind(null,"dom"),i=gh(n,!0);qe.document.addEventListener("click",i,!1),qe.document.addEventListener("keypress",i,!1),["EventTarget","Node"].forEach(a=>{const l=qe[a]&&qe[a].prototype;l&&l.hasOwnProperty&&l.hasOwnProperty("addEventListener")&&(ht(l,"addEventListener",function(c){return function(p,v,h){if(p==="click"||p=="keypress")try{const _=this,w=_.__sentry_instrumentation_handlers__=_.__sentry_instrumentation_handlers__||{},S=w[p]=w[p]||{refCount:0};if(!S.handler){const T=gh(n);S.handler=T,c.call(this,p,T,h)}S.refCount++}catch{}return c.call(this,p,v,h)}}),ht(l,"removeEventListener",function(c){return function(p,v,h){if(p==="click"||p=="keypress")try{const _=this,w=_.__sentry_instrumentation_handlers__||{},S=w[p];S&&(S.refCount--,S.refCount<=0&&(c.call(this,p,S.handler,h),S.handler=void 0,delete w[p]),Object.keys(w).length===0&&delete _.__sentry_instrumentation_handlers__)}catch{}return c.call(this,p,v,h)}}))})})();break;case"xhr":(function(){if(!("XMLHttpRequest"in qe))return;const n=XMLHttpRequest.prototype;ht(n,"open",function(i){return function(...a){const l=a[1],c=this[_o]={method:Ir(a[0])?a[0].toUpperCase():a[0],url:a[1],request_headers:{}};Ir(l)&&c.method==="POST"&&l.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const p=()=>{const v=this[_o];if(v&&this.readyState===4){try{v.status_code=this.status}catch{}on("xhr",{args:a,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:this})}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?ht(this,"onreadystatechange",function(v){return function(...h){return p(),v.apply(this,h)}}):this.addEventListener("readystatechange",p),ht(this,"setRequestHeader",function(v){return function(...h){const[_,w]=h,S=this[_o];return S&&(S.request_headers[_.toLowerCase()]=w),v.apply(this,h)}}),i.apply(this,a)}}),ht(n,"send",function(i){return function(...a){const l=this[_o];return l&&a[0]!==void 0&&(l.body=a[0]),on("xhr",{args:a,startTimestamp:Date.now(),xhr:this}),i.apply(this,a)}})})();break;case"fetch":(function(){__()&&ht(qe,"fetch",function(n){return function(...i){const{method:a,url:l}=function(p){if(p.length===0)return{method:"GET",url:""};if(p.length===2){const[h,_]=p;return{url:mh(h),method:tc(_,"method")?String(_.method).toUpperCase():"GET"}}const v=p[0];return{url:mh(v),method:tc(v,"method")?String(v.method).toUpperCase():"GET"}}(i),c={args:i,fetchData:{method:a,url:l},startTimestamp:Date.now()};return on("fetch",{...c}),n.apply(qe,i).then(p=>(on("fetch",{...c,endTimestamp:Date.now(),response:p}),p),p=>{throw on("fetch",{...c,endTimestamp:Date.now(),error:p}),p})}})})();break;case"history":(function(){if(!function(){const a=qa.chrome,l=a&&a.app&&a.app.runtime,c="history"in qa&&!!qa.history.pushState&&!!qa.history.replaceState;return!l&&c}())return;const n=qe.onpopstate;function i(a){return function(...l){const c=l.length>2?l[2]:void 0;if(c){const p=Ya,v=String(c);Ya=v,on("history",{from:p,to:v})}return a.apply(this,l)}}qe.onpopstate=function(...a){const l=qe.location.href,c=Ya;if(Ya=l,on("history",{from:c,to:l}),n)try{return n.apply(this,a)}catch{}},ht(qe.history,"pushState",i),ht(qe.history,"replaceState",i)})();break;case"error":Ka=qe.onerror,qe.onerror=function(n,i,a,l,c){return on("error",{column:l,error:c,line:a,msg:n,url:i}),!(!Ka||Ka.__SENTRY_LOADER__)&&Ka.apply(this,arguments)},qe.onerror.__SENTRY_INSTRUMENTED__=!0;break;case"unhandledrejection":Xa=qe.onunhandledrejection,qe.onunhandledrejection=function(n){return on("unhandledrejection",n),!(Xa&&!Xa.__SENTRY_LOADER__)||Xa.apply(this,arguments)},qe.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0;break;default:return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ce.warn("unknown instrumentation type:",r))}}function Pr(r,n){Co[r]=Co[r]||[],Co[r].push(n),w_(r)}function on(r,n){if(r&&Co[r])for(const i of Co[r]||[])try{i(n)}catch(a){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ce.error(`Error while triggering instrumentation handler. Type: ${r} Name: ${lr(i)} Error:`,a)}}function tc(r,n){return!!r&&typeof r=="object"&&!!r[n]}function mh(r){return typeof r=="string"?r:r?tc(r,"url")?r.url:r.toString?r.toString():"":""}let Ya;const S_=1e3;let Qa,xu;function gh(r,n=!1){return i=>{if(!i||xu===i||function(l){if(l.type!=="keypress")return!1;try{const c=l.target;if(!c||!c.tagName)return!0;if(c.tagName==="INPUT"||c.tagName==="TEXTAREA"||c.isContentEditable)return!1}catch{}return!0}(i))return;const a=i.type==="keypress"?"input":i.type;(Qa===void 0||function(l,c){if(!l||l.type!==c.type)return!0;try{if(l.target!==c.target)return!0}catch{}return!1}(xu,i))&&(r({event:i,name:a,global:n}),xu=i),clearTimeout(Qa),Qa=qe.setTimeout(()=>{Qa=void 0},S_)}}let Ka=null,Xa=null;function ar(){const r=Yt,n=r.crypto||r.msCrypto;if(n&&n.randomUUID)return n.randomUUID().replace(/-/g,"");const i=n&&n.getRandomValues?()=>n.getRandomValues(new Uint8Array(1))[0]:()=>16*Math.random();return("10000000100040008000"+1e11).replace(/[018]/g,a=>(a^(15&i())>>a/4).toString(16))}function Wv(r){return r.exception&&r.exception.values?r.exception.values[0]:void 0}function ir(r){const{message:n,event_id:i}=r;if(n)return n;const a=Wv(r);return a?a.type&&a.value?`${a.type}: ${a.value}`:a.type||a.value||i||"":i||""}function nc(r,n,i){const a=r.exception=r.exception||{},l=a.values=a.values||[],c=l[0]=l[0]||{};c.value||(c.value=n||""),c.type||(c.type="Error")}function xo(r,n){const i=Wv(r);if(!i)return;const a=i.mechanism;if(i.mechanism={type:"generic",handled:!0,...a,...n},n&&"data"in n){const l={...a&&a.data,...n.data};i.mechanism.data=l}}function yh(r){if(r&&r.__sentry_captured__)return!0;try{Ic(r,"__sentry_captured__",!0)}catch{}return!1}function or(r,n=100,i=1/0){try{return rc("",r,n,i)}catch(a){return{ERROR:`**non-serializable** (${a})`}}}function Jv(r,n=3,i=102400){const a=or(r,n);return l=a,function(c){return~-encodeURI(c).split(/%..|./).length}(JSON.stringify(l))>i?Jv(r,n-1,i):a;var l}function rc(r,n,i=1/0,a=1/0,l=function(){const c=typeof WeakSet=="function",p=c?new WeakSet:[];return[function(v){if(c)return!!p.has(v)||(p.add(v),!1);for(let h=0;h=a){S[L]="[MaxProperties ~]";break}const O=M[L];S[L]=rc(L,O,_-1,a,l),T++}return p(n),S}var On;function jr(r){return new Lt(n=>{n(r)})}function gs(r){return new Lt((n,i)=>{i(r)})}(function(r){r[r.PENDING=0]="PENDING",r[r.RESOLVED=1]="RESOLVED",r[r.REJECTED=2]="REJECTED"})(On||(On={}));class Lt{__init(){this._state=On.PENDING}__init2(){this._handlers=[]}constructor(n){Lt.prototype.__init.call(this),Lt.prototype.__init2.call(this),Lt.prototype.__init3.call(this),Lt.prototype.__init4.call(this),Lt.prototype.__init5.call(this),Lt.prototype.__init6.call(this);try{n(this._resolve,this._reject)}catch(i){this._reject(i)}}then(n,i){return new Lt((a,l)=>{this._handlers.push([!1,c=>{if(n)try{a(n(c))}catch(p){l(p)}else a(c)},c=>{if(i)try{a(i(c))}catch(p){l(p)}else l(c)}]),this._executeHandlers()})}catch(n){return this.then(i=>i,n)}finally(n){return new Lt((i,a)=>{let l,c;return this.then(p=>{c=!1,l=p,n&&n()},p=>{c=!0,l=p,n&&n()}).then(()=>{c?a(l):i(l)})})}__init3(){this._resolve=n=>{this._setResult(On.RESOLVED,n)}}__init4(){this._reject=n=>{this._setResult(On.REJECTED,n)}}__init5(){this._setResult=(n,i)=>{this._state===On.PENDING&&(Lc(i)?i.then(this._resolve,this._reject):(this._state=n,this._value=i,this._executeHandlers()))}}__init6(){this._executeHandlers=()=>{if(this._state===On.PENDING)return;const n=this._handlers.slice();this._handlers=[],n.forEach(i=>{i[0]||(this._state===On.RESOLVED&&i[1](this._value),this._state===On.REJECTED&&i[2](this._value),i[0]=!0)})}}}function k_(r){const n=[];function i(a){return n.splice(n.indexOf(a),1)[0]}return{$:n,add:function(a){if(!(r===void 0||n.lengthi(l)).then(null,()=>i(l).then(null,()=>{})),l},drain:function(a){return new Lt((l,c)=>{let p=n.length;if(!p)return l(!0);const v=setTimeout(()=>{a&&a>0&&l(!1)},a);n.forEach(h=>{jr(h).then(()=>{--p||(clearTimeout(v),l(!0))},c)})})}}}function Ou(r){if(!r)return{};const n=r.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!n)return{};const i=n[6]||"",a=n[8]||"";return{host:n[4],path:n[5],protocol:n[2],search:i,hash:a,relative:n[5]+i+a}}const E_=["fatal","error","warning","log","info","debug"],Hv=Ao(),ic={nowSeconds:()=>Date.now()/1e3},Lu=typeof __SENTRY_BROWSER_BUNDLE__<"u"&&__SENTRY_BROWSER_BUNDLE__||Object.prototype.toString.call(typeof process<"u"?process:0)!=="[object process]"?function(){const{performance:r}=Hv;if(!(!r||!r.now))return{now:()=>r.now(),timeOrigin:Date.now()-r.now()}}():function(){try{return(r=module,n="perf_hooks",r.require(n)).performance}catch{return}var r,n}(),_h=Lu===void 0?ic:{nowSeconds:()=>(Lu.timeOrigin+Lu.now())/1e3},Ls=ic.nowSeconds.bind(ic),Gv=_h.nowSeconds.bind(_h);function Oo(r,n=[]){return[r,n]}function C_(r,n){const[i,a]=r;return[i,[...a,n]]}function wh(r,n){const i=r[1];for(const a of i)if(n(a,a[0].type))return!0;return!1}function oc(r,n){return(n||new TextEncoder).encode(r)}function b_(r,n){const[i,a]=r;let l=JSON.stringify(i);function c(p){typeof l=="string"?l=typeof p=="string"?l+p:[oc(l,n),p]:l.push(typeof p=="string"?oc(p,n):p)}for(const p of a){const[v,h]=p;if(c(` ${JSON.stringify(v)} `),typeof h=="string"||h instanceof Uint8Array)c(h);else{let _;try{_=JSON.stringify(h)}catch{_=JSON.stringify(or(h))}c(_)}}return typeof l=="string"?l:function(p){const v=p.reduce((w,S)=>w+S.length,0),h=new Uint8Array(v);let _=0;for(const w of p)h.set(w,_),_+=w.length;return h}(l)}function T_(r,n){const i=typeof r.data=="string"?oc(r.data,n):r.data;return[Os({type:"attachment",length:i.length,filename:r.filename,content_type:r.contentType,attachment_type:r.attachmentType}),i]}(()=>{const{performance:r}=Hv;if(!r||!r.now)return;const n=36e5,i=r.now(),a=Date.now(),l=r.timeOrigin?Math.abs(r.timeOrigin+i-a):n,c=lfunction(a){return Os({sid:`${a.sid}`,init:a.init,started:new Date(1e3*a.started).toISOString(),timestamp:new Date(1e3*a.timestamp).toISOString(),status:a.status,errors:a.errors,did:typeof a.did=="number"||typeof a.did=="string"?`${a.did}`:void 0,duration:a.duration,attrs:{release:a.release,environment:a.environment,ip_address:a.ipAddress,user_agent:a.userAgent}})}(i)};return r&&bi(i,r),i}function bi(r,n={}){if(n.user&&(!r.ipAddress&&n.user.ip_address&&(r.ipAddress=n.user.ip_address),r.did||n.did||(r.did=n.user.id||n.user.email||n.user.username)),r.timestamp=n.timestamp||Gv(),n.ignoreDuration&&(r.ignoreDuration=n.ignoreDuration),n.sid&&(r.sid=n.sid.length===32?n.sid:ar()),n.init!==void 0&&(r.init=n.init),!r.did&&n.did&&(r.did=`${n.did}`),typeof n.started=="number"&&(r.started=n.started),r.ignoreDuration)r.duration=void 0;else if(typeof n.duration=="number")r.duration=n.duration;else{const i=r.timestamp-r.started;r.duration=i>=0?i:0}n.release&&(r.release=n.release),n.environment&&(r.environment=n.environment),!r.ipAddress&&n.ipAddress&&(r.ipAddress=n.ipAddress),!r.userAgent&&n.userAgent&&(r.userAgent=n.userAgent),typeof n.errors=="number"&&(r.errors=n.errors),n.status&&(r.status=n.status)}class Lr{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=kh()}static clone(n){const i=new Lr;return n&&(i._breadcrumbs=[...n._breadcrumbs],i._tags={...n._tags},i._extra={...n._extra},i._contexts={...n._contexts},i._user=n._user,i._level=n._level,i._span=n._span,i._session=n._session,i._transactionName=n._transactionName,i._fingerprint=n._fingerprint,i._eventProcessors=[...n._eventProcessors],i._requestSession=n._requestSession,i._attachments=[...n._attachments],i._sdkProcessingMetadata={...n._sdkProcessingMetadata},i._propagationContext={...n._propagationContext}),i}addScopeListener(n){this._scopeListeners.push(n)}addEventProcessor(n){return this._eventProcessors.push(n),this}setUser(n){return this._user=n||{},this._session&&bi(this._session,{user:n}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(n){return this._requestSession=n,this}setTags(n){return this._tags={...this._tags,...n},this._notifyScopeListeners(),this}setTag(n,i){return this._tags={...this._tags,[n]:i},this._notifyScopeListeners(),this}setExtras(n){return this._extra={...this._extra,...n},this._notifyScopeListeners(),this}setExtra(n,i){return this._extra={...this._extra,[n]:i},this._notifyScopeListeners(),this}setFingerprint(n){return this._fingerprint=n,this._notifyScopeListeners(),this}setLevel(n){return this._level=n,this._notifyScopeListeners(),this}setTransactionName(n){return this._transactionName=n,this._notifyScopeListeners(),this}setContext(n,i){return i===null?delete this._contexts[n]:this._contexts[n]=i,this._notifyScopeListeners(),this}setSpan(n){return this._span=n,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const n=this.getSpan();return n&&n.transaction}setSession(n){return n?this._session=n:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(n){if(!n)return this;if(typeof n=="function"){const i=n(this);return i instanceof Lr?i:this}return n instanceof Lr?(this._tags={...this._tags,...n._tags},this._extra={...this._extra,...n._extra},this._contexts={...this._contexts,...n._contexts},n._user&&Object.keys(n._user).length&&(this._user=n._user),n._level&&(this._level=n._level),n._fingerprint&&(this._fingerprint=n._fingerprint),n._requestSession&&(this._requestSession=n._requestSession),n._propagationContext&&(this._propagationContext=n._propagationContext)):Ci(n)&&(this._tags={...this._tags,...n.tags},this._extra={...this._extra,...n.extra},this._contexts={...this._contexts,...n.contexts},n.user&&(this._user=n.user),n.level&&(this._level=n.level),n.fingerprint&&(this._fingerprint=n.fingerprint),n.requestSession&&(this._requestSession=n.requestSession),n.propagationContext&&(this._propagationContext=n.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=kh(),this}addBreadcrumb(n,i){const a=typeof i=="number"?i:100;if(a<=0)return this;const l={timestamp:Ls(),...n};return this._breadcrumbs=[...this._breadcrumbs,l].slice(-a),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(n){return this._attachments.push(n),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(n,i={}){if(this._extra&&Object.keys(this._extra).length&&(n.extra={...this._extra,...n.extra}),this._tags&&Object.keys(this._tags).length&&(n.tags={...this._tags,...n.tags}),this._user&&Object.keys(this._user).length&&(n.user={...this._user,...n.user}),this._contexts&&Object.keys(this._contexts).length&&(n.contexts={...this._contexts,...n.contexts}),this._level&&(n.level=this._level),this._transactionName&&(n.transaction=this._transactionName),this._span){n.contexts={trace:this._span.getTraceContext(),...n.contexts};const a=this._span.transaction;if(a){n.sdkProcessingMetadata={dynamicSamplingContext:a.getDynamicSamplingContext(),...n.sdkProcessingMetadata};const l=a.name;l&&(n.tags={transaction:l,...n.tags})}}return this._applyFingerprint(n),n.breadcrumbs=[...n.breadcrumbs||[],...this._breadcrumbs],n.breadcrumbs=n.breadcrumbs.length>0?n.breadcrumbs:void 0,n.sdkProcessingMetadata={...n.sdkProcessingMetadata,...this._sdkProcessingMetadata,propagationContext:this._propagationContext},this._notifyEventProcessors([...Yv(),...this._eventProcessors],n,i)}setSDKProcessingMetadata(n){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...n},this}setPropagationContext(n){return this._propagationContext=n,this}getPropagationContext(){return this._propagationContext}_notifyEventProcessors(n,i,a,l=0){return new Lt((c,p)=>{const v=n[l];if(i===null||typeof v!="function")c(i);else{const h=v({...i},a);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&v.id&&h===null&&Ce.log(`Event processor "${v.id}" dropped event`),Lc(h)?h.then(_=>this._notifyEventProcessors(n,_,a,l+1).then(c)).then(null,p):this._notifyEventProcessors(n,h,a,l+1).then(c).then(null,p)}})}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(n=>{n(this)}),this._notifyingListeners=!1)}_applyFingerprint(n){var i;n.fingerprint=n.fingerprint?(i=n.fingerprint,Array.isArray(i)?i:[i]):[],this._fingerprint&&(n.fingerprint=n.fingerprint.concat(this._fingerprint)),n.fingerprint&&!n.fingerprint.length&&delete n.fingerprint}}function Yv(){return Dc("globalEventProcessors",()=>[])}function Qv(r){Yv().push(r)}function kh(){return{traceId:ar(),spanId:ar().substring(16),sampled:!1}}const Kv=4,L_=100;class Rc{constructor(n,i=new Lr,a=Kv){this._version=a,this._stack=[{scope:i}],n&&this.bindClient(n)}isOlderThan(n){return this._version{c.captureException(n,{originalException:n,syntheticException:l,...i,event_id:a},p)}),a}captureMessage(n,i,a){const l=this._lastEventId=a&&a.event_id?a.event_id:ar(),c=new Error(n);return this._withClient((p,v)=>{p.captureMessage(n,i,{originalException:n,syntheticException:c,...a,event_id:l},v)}),l}captureEvent(n,i){const a=i&&i.event_id?i.event_id:ar();return n.type||(this._lastEventId=a),this._withClient((l,c)=>{l.captureEvent(n,{...i,event_id:a},c)}),a}lastEventId(){return this._lastEventId}addBreadcrumb(n,i){const{scope:a,client:l}=this.getStackTop();if(!l)return;const{beforeBreadcrumb:c=null,maxBreadcrumbs:p=L_}=l.getOptions&&l.getOptions()||{};if(p<=0)return;const v={timestamp:Ls(),...n},h=c?zv(()=>c(v,i)):v;h!==null&&(l.emit&&l.emit("beforeAddBreadcrumb",h,i),a.addBreadcrumb(h,p))}setUser(n){this.getScope().setUser(n)}setTags(n){this.getScope().setTags(n)}setExtras(n){this.getScope().setExtras(n)}setTag(n,i){this.getScope().setTag(n,i)}setExtra(n,i){this.getScope().setExtra(n,i)}setContext(n,i){this.getScope().setContext(n,i)}configureScope(n){const{scope:i,client:a}=this.getStackTop();a&&n(i)}run(n){const i=Eh(this);try{n(this)}finally{Eh(i)}}getIntegration(n){const i=this.getClient();if(!i)return null;try{return i.getIntegration(n)}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ce.warn(`Cannot retrieve integration ${n.id} from the current Hub`),null}}startTransaction(n,i){const a=this._callExtensionMethod("startTransaction",n,i);return typeof __SENTRY_DEBUG__<"u"&&!__SENTRY_DEBUG__||a||console.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init': Sentry.addTracingExtensions(); Sentry.init({...}); `),a}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(n=!1){if(n)return this.endSession();this._sendSessionUpdate()}endSession(){const n=this.getStackTop().scope,i=n.getSession();i&&function(a,l){let c={};a.status==="ok"&&(c={status:"exited"}),bi(a,c)}(i),this._sendSessionUpdate(),n.setSession()}startSession(n){const{scope:i,client:a}=this.getStackTop(),{release:l,environment:c=jc}=a&&a.getOptions()||{},{userAgent:p}=Yt.navigator||{},v=O_({release:l,environment:c,user:i.getUser(),...p&&{userAgent:p},...n}),h=i.getSession&&i.getSession();return h&&h.status==="ok"&&bi(h,{status:"exited"}),this.endSession(),i.setSession(v),v}shouldSendDefaultPii(){const n=this.getClient(),i=n&&n.getOptions();return!!(i&&i.sendDefaultPii)}_sendSessionUpdate(){const{scope:n,client:i}=this.getStackTop(),a=n.getSession();a&&i&&i.captureSession&&i.captureSession(a)}_withClient(n){const{scope:i,client:a}=this.getStackTop();a&&n(a,i)}_callExtensionMethod(n,...i){const a=ys().__SENTRY__;if(a&&a.extensions&&typeof a.extensions[n]=="function")return a.extensions[n].apply(this,i);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ce.warn(`Extension method ${n} couldn't be found, doing nothing.`)}}function ys(){return Yt.__SENTRY__=Yt.__SENTRY__||{extensions:{},hub:void 0},Yt}function Eh(r){const n=ys(),i=ac(n);return Xv(n,r),i}function Ft(){const r=ys();if(r.__SENTRY__&&r.__SENTRY__.acs){const n=r.__SENTRY__.acs.getCurrentHub();if(n)return n}return function(n=ys()){i=n,i&&i.__SENTRY__&&i.__SENTRY__.hub&&!ac(n).isOlderThan(Kv)||Xv(n,new Rc);var i;return ac(n)}(r)}function ac(r){return Dc("hub",()=>new Rc,r)}function Xv(r,n){return r?((r.__SENTRY__=r.__SENTRY__||{}).hub=n,!0):!1}const D_="7";function I_(r,n){return i={sentry_key:r.publicKey,sentry_version:D_,...n&&{sentry_client:`${n.name}/${n.version}`}},Object.keys(i).map(a=>`${encodeURIComponent(a)}=${encodeURIComponent(i[a])}`).join("&");var i}function A_(r,n,i,a){const l=qv(i),c=r.type&&r.type!=="replay_event"?r.type:"event";(function(v,h){h&&(v.sdk=v.sdk||{},v.sdk.name=v.sdk.name||h.name,v.sdk.version=v.sdk.version||h.version,v.sdk.integrations=[...v.sdk.integrations||[],...h.integrations||[]],v.sdk.packages=[...v.sdk.packages||[],...h.packages||[]])})(r,i&&i.sdk);const p=function(v,h,_,w){const S=v.sdkProcessingMetadata&&v.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:v.event_id,sent_at:new Date().toISOString(),...h&&{sdk:h},...!!_&&{dsn:ms(w)},...S&&{trace:Os({...S})}}}(r,l,a,n);return delete r.sdkProcessingMetadata,Oo(p,[[{type:c},r]])}const Ch=[];function bh(r,n){n[r.name]=r,Ch.indexOf(r.name)===-1&&(r.setupOnce(Qv,Ft),Ch.push(r.name),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ce.log(`Integration installed: ${r.name}`))}function j_(r,n,i,a){const{normalizeDepth:l=3,normalizeMaxBreadth:c=1e3}=r,p={...n,event_id:n.event_id||i.event_id||ar(),timestamp:n.timestamp||Ls()},v=i.integrations||r.integrations.map(w=>w.name);(function(w,S){const{environment:T,release:M,dist:L,maxValueLength:O=250}=S;"environment"in w||(w.environment="environment"in S?T:jc),w.release===void 0&&M!==void 0&&(w.release=M),w.dist===void 0&&L!==void 0&&(w.dist=L),w.message&&(w.message=yi(w.message,O));const R=w.exception&&w.exception.values&&w.exception.values[0];R&&R.value&&(R.value=yi(R.value,O));const W=w.request;W&&W.url&&(W.url=yi(W.url,O))})(p,r),function(w,S){S.length>0&&(w.sdk=w.sdk||{},w.sdk.integrations=[...w.sdk.integrations||[],...S])}(p,v),n.type===void 0&&function(w,S){const T=Yt._sentryDebugIds;if(!T)return;let M;const L=Th.get(S);L?M=L:(M=new Map,Th.set(S,M));const O=Object.keys(T).reduce((R,W)=>{let ne;const K=M.get(W);K?ne=K:(ne=S(W),M.set(W,ne));for(let G=ne.length-1;G>=0;G--){const N=ne[G];if(N.filename){R[N.filename]=T[W];break}}return R},{});try{w.exception.values.forEach(R=>{R.stacktrace.frames.forEach(W=>{W.filename&&(W.debug_id=O[W.filename])})})}catch{}}(p,r.stackParser);let h=a;i.captureContext&&(h=Lr.clone(h).update(i.captureContext));let _=jr(p);if(h){if(h.getAttachments){const w=[...i.attachments||[],...h.getAttachments()];w.length&&(i.attachments=w)}_=h.applyToEvent(p,i)}return _.then(w=>(w&&function(S){const T={};try{S.exception.values.forEach(L=>{L.stacktrace.frames.forEach(O=>{O.debug_id&&(O.abs_path?T[O.abs_path]=O.debug_id:O.filename&&(T[O.filename]=O.debug_id),delete O.debug_id)})})}catch{}if(Object.keys(T).length===0)return;S.debug_meta=S.debug_meta||{},S.debug_meta.images=S.debug_meta.images||[];const M=S.debug_meta.images;Object.keys(T).forEach(L=>{M.push({type:"sourcemap",code_file:L,debug_id:T[L]})})}(w),typeof l=="number"&&l>0?function(S,T,M){if(!S)return null;const L={...S,...S.breadcrumbs&&{breadcrumbs:S.breadcrumbs.map(O=>({...O,...O.data&&{data:or(O.data,T,M)}}))},...S.user&&{user:or(S.user,T,M)},...S.contexts&&{contexts:or(S.contexts,T,M)},...S.extra&&{extra:or(S.extra,T,M)}};return S.contexts&&S.contexts.trace&&L.contexts&&(L.contexts.trace=S.contexts.trace,S.contexts.trace.data&&(L.contexts.trace.data=or(S.contexts.trace.data,T,M))),S.spans&&(L.spans=S.spans.map(O=>(O.data&&(O.data=or(O.data,T,M)),O))),L}(w,l,c):w))}const Th=new WeakMap,Mh="Not capturing exception because it's already been captured.";class xr{__init(){this._integrations={}}__init2(){this._integrationsInitialized=!1}__init3(){this._numProcessing=0}__init4(){this._outcomes={}}__init5(){this._hooks={}}constructor(n){if(xr.prototype.__init.call(this),xr.prototype.__init2.call(this),xr.prototype.__init3.call(this),xr.prototype.__init4.call(this),xr.prototype.__init5.call(this),this._options=n,n.dsn?this._dsn=y_(n.dsn):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ce.warn("No DSN provided, client will not do anything."),this._dsn){const i=function(a,l={}){const c=typeof l=="string"?l:l.tunnel,p=typeof l!="string"&&l._metadata?l._metadata.sdk:void 0;return c||`${function(v){return`${function(h){const _=h.protocol?`${h.protocol}:`:"",w=h.port?`:${h.port}`:"";return`${_}//${h.host}${w}${h.path?`/${h.path}`:""}/api/`}(v)}${v.projectId}/envelope/`}(a)}?${I_(a,p)}`}(this._dsn,n);this._transport=n.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...n.transportOptions,url:i})}}captureException(n,i,a){if(yh(n))return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ce.log(Mh));let l=i&&i.event_id;return this._process(this.eventFromException(n,i).then(c=>this._captureEvent(c,i,a)).then(c=>{l=c})),l}captureMessage(n,i,a,l){let c=a&&a.event_id;const p=Bv(n)?this.eventFromMessage(String(n),i,a):this.eventFromException(n,a);return this._process(p.then(v=>this._captureEvent(v,a,l)).then(v=>{c=v})),c}captureEvent(n,i,a){if(i&&i.originalException&&yh(i.originalException))return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ce.log(Mh));let l=i&&i.event_id;return this._process(this._captureEvent(n,i,a).then(c=>{l=c})),l}captureSession(n){this._isEnabled()?typeof n.release!="string"?(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ce.warn("Discarded session because of missing or non-string release"):(this.sendSession(n),bi(n,{init:!1})):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ce.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(n){const i=this._transport;return i?this._isClientDoneProcessing(n).then(a=>i.flush(n).then(l=>a&&l)):jr(!0)}close(n){return this.flush(n).then(i=>(this.getOptions().enabled=!1,i))}setupIntegrations(){this._isEnabled()&&!this._integrationsInitialized&&(this._integrations=function(n){const i={};return n.forEach(a=>{a&&bh(a,i)}),i}(this._options.integrations),this._integrationsInitialized=!0)}getIntegrationById(n){return this._integrations[n]}getIntegration(n){try{return this._integrations[n.id]||null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ce.warn(`Cannot retrieve integration ${n.id} from the current Client`),null}}addIntegration(n){bh(n,this._integrations)}sendEvent(n,i={}){if(this._dsn){let a=A_(n,this._dsn,this._options._metadata,this._options.tunnel);for(const c of i.attachments||[])a=C_(a,T_(c,this._options.transportOptions&&this._options.transportOptions.textEncoder));const l=this._sendEnvelope(a);l&&l.then(c=>this.emit("afterSendEvent",n,c),null)}}sendSession(n){if(this._dsn){const i=function(a,l,c,p){const v=qv(c);return Oo({sent_at:new Date().toISOString(),...v&&{sdk:v},...!!p&&{dsn:ms(l)}},["aggregates"in a?[{type:"sessions"},a]:[{type:"session"},a.toJSON()]])}(n,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(i)}}recordDroppedEvent(n,i,a){if(this._options.sendClientReports){const l=`${n}:${i}`;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ce.log(`Adding outcome: "${l}"`),this._outcomes[l]=this._outcomes[l]+1||1}}on(n,i){this._hooks[n]||(this._hooks[n]=[]),this._hooks[n].push(i)}emit(n,...i){this._hooks[n]&&this._hooks[n].forEach(a=>a(...i))}_updateSessionFromEvent(n,i){let a=!1,l=!1;const c=i.exception&&i.exception.values;if(c){l=!0;for(const v of c){const h=v.mechanism;if(h&&h.handled===!1){a=!0;break}}}const p=n.status==="ok";(p&&n.errors===0||p&&a)&&(bi(n,{...a&&{status:"crashed"},errors:n.errors||Number(l||a)}),this.captureSession(n))}_isClientDoneProcessing(n){return new Lt(i=>{let a=0;const l=setInterval(()=>{this._numProcessing==0?(clearInterval(l),i(!0)):(a+=1,n&&a>=n&&(clearInterval(l),i(!1)))},1)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._dsn!==void 0}_prepareEvent(n,i,a){const l=this.getOptions(),c=Object.keys(this._integrations);return!i.integrations&&c.length>0&&(i.integrations=c),j_(l,n,i,a).then(p=>{if(p===null)return p;const{propagationContext:v}=p.sdkProcessingMetadata||{};if(!(p.contexts&&p.contexts.trace)&&v){const{traceId:h,spanId:_,parentSpanId:w,dsc:S}=v;p.contexts={trace:{trace_id:h,span_id:_,parent_span_id:w},...p.contexts};const T=S||function(M,L,O){const R=L.getOptions(),{publicKey:W}=L.getDsn()||{},{segment:ne}=O&&O.getUser()||{},K=Os({environment:R.environment||jc,release:R.release,user_segment:ne,public_key:W,trace_id:M});return L.emit&&L.emit("createDsc",K),K}(h,this,a);p.sdkProcessingMetadata={dynamicSamplingContext:T,...p.sdkProcessingMetadata}}return p})}_captureEvent(n,i={},a){return this._processEvent(n,i,a).then(l=>l.event_id,l=>{if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){const c=l;c.logLevel==="log"?Ce.log(c.message):Ce.warn(c)}})}_processEvent(n,i,a){const l=this.getOptions(),{sampleRate:c}=l;if(!this._isEnabled())return gs(new sn("SDK not enabled, will not capture event.","log"));const p=xh(n),v=Ph(n),h=n.type||"error",_=`before send for type \`${h}\``;if(v&&typeof c=="number"&&Math.random()>c)return this.recordDroppedEvent("sample_rate","error",n),gs(new sn(`Discarding event because it's not included in the random sample (sampling rate = ${c})`,"log"));const w=h==="replay_event"?"replay":h;return this._prepareEvent(n,i,a).then(S=>{if(S===null)throw this.recordDroppedEvent("event_processor",w,n),new sn("An event processor returned `null`, will not send event.","log");if(i.data&&i.data.__sentry__===!0)return S;const T=function(M,L,O){const{beforeSend:R,beforeSendTransaction:W}=M;return Ph(L)&&R?R(L,O):xh(L)&&W?W(L,O):L}(l,S,i);return function(M,L){const O=`${L} must return \`null\` or a valid event.`;if(Lc(M))return M.then(R=>{if(!Ci(R)&&R!==null)throw new sn(O);return R},R=>{throw new sn(`${L} rejected with ${R}`)});if(!Ci(M)&&M!==null)throw new sn(O);return M}(T,_)}).then(S=>{if(S===null)throw this.recordDroppedEvent("before_send",w,n),new sn(`${_} returned \`null\`, will not send event.`,"log");const T=a&&a.getSession();!p&&T&&this._updateSessionFromEvent(T,S);const M=S.transaction_info;if(p&&M&&S.transaction!==n.transaction){const L="custom";S.transaction_info={...M,source:L}}return this.sendEvent(S,i),S}).then(null,S=>{throw S instanceof sn?S:(this.captureException(S,{data:{__sentry__:!0},originalException:S}),new sn(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event. Reason: ${S}`))})}_process(n){this._numProcessing++,n.then(i=>(this._numProcessing--,i),i=>(this._numProcessing--,i))}_sendEnvelope(n){if(this._transport&&this._dsn)return this.emit("beforeEnvelope",n),this._transport.send(n).then(null,i=>{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ce.error("Error while sending event:",i)});(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ce.error("Transport disabled")}_clearOutcomes(){const n=this._outcomes;return this._outcomes={},Object.keys(n).map(i=>{const[a,l]=i.split(":");return{reason:a,category:l,quantity:n[i]}})}}function Ph(r){return r.type===void 0}function xh(r){return r.type==="transaction"}const R_=30;function N_(r,n,i=k_(r.bufferSize||R_)){let a={};function l(c){const p=[];if(wh(c,(_,w)=>{const S=Sh(w);if(function(T,M,L=Date.now()){return function(O,R){return O[R]||O.all||0}(T,M)>L}(a,S)){const T=Oh(_,w);r.recordDroppedEvent("ratelimit_backoff",S,T)}else p.push(_)}),p.length===0)return jr();const v=Oo(c[0],p),h=_=>{wh(v,(w,S)=>{const T=Oh(w,S);r.recordDroppedEvent(_,Sh(S),T)})};return i.add(()=>n({body:b_(v,r.textEncoder)}).then(_=>(_.statusCode!==void 0&&(_.statusCode<200||_.statusCode>=300)&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ce.warn(`Sentry responded with status code ${_.statusCode} to sent event.`),a=x_(a,_),_),_=>{throw h("network_error"),_})).then(_=>_,_=>{if(_ instanceof sn)return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ce.error("Skipped sending event because buffer is full."),h("queue_overflow"),jr();throw _})}return l.__sentry__baseTransport__=!0,{send:l,flush:c=>i.drain(c)}}function Oh(r,n){if(n==="event"||n==="transaction")return Array.isArray(r)?r[1]:void 0}const Lh="7.60.1";let Dh;class Lo{constructor(){Lo.prototype.__init.call(this)}static __initStatic(){this.id="FunctionToString"}__init(){this.name=Lo.id}setupOnce(){Dh=Function.prototype.toString;try{Function.prototype.toString=function(...n){const i=Ac(this)||this;return Dh.apply(i,n)}}catch{}}}Lo.__initStatic();const F_=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],U_=[/^.*healthcheck.*$/,/^.*healthy.*$/,/^.*live.*$/,/^.*ready.*$/,/^.*heartbeat.*$/,/^.*\/health$/,/^.*\/healthz$/];class _i{static __initStatic(){this.id="InboundFilters"}__init(){this.name=_i.id}constructor(n={}){this._options=n,_i.prototype.__init.call(this)}setupOnce(n,i){const a=l=>{const c=i();if(c){const p=c.getIntegration(_i);if(p){const v=c.getClient(),h=v?v.getOptions():{},_=function(w={},S={}){return{allowUrls:[...w.allowUrls||[],...S.allowUrls||[]],denyUrls:[...w.denyUrls||[],...S.denyUrls||[]],ignoreErrors:[...w.ignoreErrors||[],...S.ignoreErrors||[],...w.disableErrorDefaults?[]:F_],ignoreTransactions:[...w.ignoreTransactions||[],...S.ignoreTransactions||[],...w.disableTransactionDefaults?[]:U_],ignoreInternal:w.ignoreInternal===void 0||w.ignoreInternal}}(p._options,h);return function(w,S){return S.ignoreInternal&&function(T){try{return T.exception.values[0].type==="SentryError"}catch{}return!1}(w)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ce.warn(`Event dropped due to being internal Sentry Error. Event: ${ir(w)}`),!0):function(T,M){return T.type||!M||!M.length?!1:function(L){if(L.message)return[L.message];if(L.exception){const{values:O}=L.exception;try{const{type:R="",value:W=""}=O&&O[O.length-1]||{};return[`${W}`,`${R}: ${W}`]}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ce.error(`Cannot extract message for event ${ir(L)}`),[]}}return[]}(T).some(L=>Ha(L,M))}(w,S.ignoreErrors)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ce.warn(`Event dropped due to being matched by \`ignoreErrors\` option. Event: ${ir(w)}`),!0):function(T,M){if(T.type!=="transaction"||!M||!M.length)return!1;const L=T.transaction;return!!L&&Ha(L,M)}(w,S.ignoreTransactions)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ce.warn(`Event dropped due to being matched by \`ignoreTransactions\` option. Event: ${ir(w)}`),!0):function(T,M){if(!M||!M.length)return!1;const L=Za(T);return!!L&&Ha(L,M)}(w,S.denyUrls)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ce.warn(`Event dropped due to being matched by \`denyUrls\` option. Event: ${ir(w)}. Url: ${Za(w)}`),!0):function(T,M){if(!M||!M.length)return!0;const L=Za(T);return!L||Ha(L,M)}(w,S.allowUrls)?!1:((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ce.warn(`Event dropped due to not being matched by \`allowUrls\` option. Event: ${ir(w)}. Url: ${Za(w)}`),!0)}(l,_)?null:l}}return l};a.id=this.name,n(a)}}function Za(r){try{let n;try{n=r.exception.values[0].stacktrace.frames}catch{}return n?function(i=[]){for(let a=i.length-1;a>=0;a--){const l=i[a];if(l&&l.filename!==""&&l.filename!=="[native code]")return l.filename||null}return null}(n):null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ce.error(`Cannot extract url for event ${ir(r)}`),null}}_i.__initStatic();var B_=Object.freeze({__proto__:null,FunctionToString:Lo,InboundFilters:_i});const $e=Yt;let sc=0;function Zv(){return sc>0}function Ti(r,n={},i){if(typeof r!="function")return r;try{const l=r.__sentry_wrapped__;if(l)return l;if(Ac(r))return r}catch{return r}const a=function(){const l=Array.prototype.slice.call(arguments);try{i&&typeof i=="function"&&i.apply(this,arguments);const p=l.map(v=>Ti(v,n));return r.apply(this,p)}catch(p){throw sc++,setTimeout(()=>{sc--}),c=v=>{var h,_;v.addEventProcessor(w=>(n.mechanism&&(nc(w,void 0),xo(w,n.mechanism)),w.extra={...w.extra,arguments:l},w)),h=p,Ft().captureException(h,{captureContext:_})},Ft().withScope(c),p}var c};try{for(const l in r)Object.prototype.hasOwnProperty.call(r,l)&&(a[l]=r[l])}catch{}$v(a,r),Ic(r,"__sentry_wrapped__",a);try{Object.getOwnPropertyDescriptor(a,"name").configurable&&Object.defineProperty(a,"name",{get:()=>r.name})}catch{}return a}function em(r,n){const i=Nc(r,n),a={type:n&&n.name,value:$_(n)};return i.length&&(a.stacktrace={frames:i}),a.type===void 0&&a.value===""&&(a.value="Unrecoverable error caught"),a}function Du(r,n){return{exception:{values:[em(r,n)]}}}function Nc(r,n){const i=n.stacktrace||n.stack||"",a=function(l){if(l){if(typeof l.framesToPop=="number")return l.framesToPop;if(z_.test(l.message))return 1}return 0}(n);try{return r(i,a)}catch{}return[]}const z_=/Minified React error #\d+;/i;function $_(r){const n=r&&r.message;return n?n.error&&typeof n.error.message=="string"?n.error.message:n:"No error message"}function Fc(r,n,i,a,l){let c;if(Oc(n)&&n.error)return Du(r,n.error);if(ah(n)||Pi(n,"DOMException")){const p=n;if("stack"in n)c=Du(r,n);else{const v=p.name||(ah(p)?"DOMError":"DOMException"),h=p.message?`${v}: ${p.message}`:v;c=lc(r,h,i,a),nc(c,h)}return"code"in p&&(c.tags={...c.tags,"DOMException.code":`${p.code}`}),c}return Uv(n)?Du(r,n):Ci(n)||hs(n)?(c=function(p,v,h,_){const w=Ft().getClient(),S=w&&w.getOptions().normalizeDepth,T={exception:{values:[{type:hs(v)?v.constructor.name:_?"UnhandledRejection":"Error",value:V_(v,{isUnhandledRejection:_})}]},extra:{__serialized__:Jv(v,S)}};if(h){const M=Nc(p,h);M.length&&(T.exception.values[0].stacktrace={frames:M})}return T}(r,n,i,l),xo(c,{synthetic:!0}),c):(c=lc(r,n,i,a),nc(c,`${n}`),xo(c,{synthetic:!0}),c)}function lc(r,n,i,a){const l={message:n};if(a&&i){const c=Nc(r,i);c.length&&(l.exception={values:[{value:n,stacktrace:{frames:c}}]})}return l}function V_(r,{isUnhandledRejection:n}){const i=function(l,c=40){const p=Object.keys(Vv(l));if(p.sort(),!p.length)return"[object has no keys]";if(p[0].length>=c)return yi(p[0],c);for(let v=p.length;v>0;v--){const h=p.slice(0,v).join(", ");if(!(h.length>c))return v===p.length?h:yi(h,c)}return""}(r),a=n?"promise rejection":"exception";return Oc(r)?`Event \`ErrorEvent\` captured as ${a} with message \`${r.message}\``:hs(r)?`Event \`${function(l){try{const c=Object.getPrototypeOf(l);return c?c.constructor.name:void 0}catch{}}(r)}\` (type=${r.type}) captured as ${a}`:`Object captured as ${a} with keys: ${i}`}const Ih=1024,tm="Breadcrumbs";class Do{static __initStatic(){this.id=tm}__init(){this.name=Do.id}constructor(n){Do.prototype.__init.call(this),this.options={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...n}}setupOnce(){this.options.console&&Pr("console",W_),this.options.dom&&Pr("dom",function(n){function i(a){let l,c=typeof n=="object"?n.serializeAttribute:void 0,p=typeof n=="object"&&typeof n.maxStringLength=="number"?n.maxStringLength:void 0;p&&p>Ih&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ce.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${p} was configured. Sentry will use 1024 instead.`),p=Ih),typeof c=="string"&&(c=[c]);try{const v=a.event;l=function(h){return!!h&&!!h.target}(v)?Xu(v.target,{keyAttrs:c,maxStringLength:p}):Xu(v,{keyAttrs:c,maxStringLength:p})}catch{l=""}l.length!==0&&Ft().addBreadcrumb({category:`ui.${a.name}`,message:l},{event:a.event,name:a.name,global:a.global})}return i}(this.options.dom)),this.options.xhr&&Pr("xhr",J_),this.options.fetch&&Pr("fetch",H_),this.options.history&&Pr("history",G_)}addSentryBreadcrumb(n){this.options.sentry&&Ft().addBreadcrumb({category:"sentry."+(n.type==="transaction"?"transaction":"event"),event_id:n.event_id,level:n.level,message:ir(n)},{event:n})}}function W_(r){for(let a=0;a{$e.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(n,i){return function(a,l,c,p){const v=Fc(a,l,c&&c.syntheticException||void 0,p);return xo(v),v.level="error",c&&c.event_id&&(v.event_id=c.event_id),jr(v)}(this._options.stackParser,n,i,this._options.attachStacktrace)}eventFromMessage(n,i="info",a){return function(l,c,p="info",v,h){const _=lc(l,c,v&&v.syntheticException||void 0,h);return _.level=p,v&&v.event_id&&(_.event_id=v.event_id),jr(_)}(this._options.stackParser,n,i,a,this._options.attachStacktrace)}sendEvent(n,i){const a=this.getIntegrationById(tm);a&&a.addSentryBreadcrumb&&a.addSentryBreadcrumb(n),super.sendEvent(n,i)}captureUserFeedback(n){if(!this._isEnabled())return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ce.warn("SDK not enabled, will not capture user feedback."));const i=function(a,{metadata:l,tunnel:c,dsn:p}){const v={event_id:a.event_id,sent_at:new Date().toISOString(),...l&&l.sdk&&{sdk:{name:l.sdk.name,version:l.sdk.version}},...!!c&&!!p&&{dsn:ms(p)}};return Oo(v,[function(_){return[{type:"user_report"},_]}(a)])}(n,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(i)}_prepareEvent(n,i,a){return n.platform=n.platform||"javascript",super._prepareEvent(n,i,a)}_flushOutcomes(){const n=this._clearOutcomes();if(n.length===0)return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ce.log("No outcomes to send"));if(!this._dsn)return void((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ce.log("No dsn provided, will not send outcomes"));(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ce.log("Sending outcomes:",n);const i=(a=n,Oo((l=this._options.tunnel&&ms(this._dsn))?{dsn:l}:{},[[{type:"client_report"},{timestamp:c||Ls(),discarded_events:a}]]));var a,l,c;this._sendEnvelope(i)}}let mo;function Y_(r,n=function(){if(mo)return mo;if(ec($e.fetch))return mo=$e.fetch.bind($e);const i=$e.document;let a=$e.fetch;if(i&&typeof i.createElement=="function")try{const l=i.createElement("iframe");l.hidden=!0,i.head.appendChild(l);const c=l.contentWindow;c&&c.fetch&&(a=c.fetch),i.head.removeChild(l)}catch(l){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ce.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",l)}return mo=a.bind($e)}()){let i=0,a=0;return N_(r,function(l){const c=l.body.length;i+=c,a++;const p={body:l.body,method:"POST",referrerPolicy:"origin",headers:r.headers,keepalive:i<=6e4&&a<15,...r.fetchOptions};try{return n(r.url,p).then(v=>(i-=c,a--,{statusCode:v.status,headers:{"x-sentry-rate-limits":v.headers.get("X-Sentry-Rate-Limits"),"retry-after":v.headers.get("Retry-After")}}))}catch(v){return mo=void 0,i-=c,a--,gs(v)}})}class sr{static __initStatic(){this.id="GlobalHandlers"}__init(){this.name=sr.id}__init2(){this._installFunc={onerror:Q_,onunhandledrejection:K_}}constructor(n){sr.prototype.__init.call(this),sr.prototype.__init2.call(this),this._options={onerror:!0,onunhandledrejection:!0,...n}}setupOnce(){Error.stackTraceLimit=50;const n=this._options;for(const a in n){const l=this._installFunc[a];l&&n[a]&&(i=a,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ce.log(`Global Handler attached: ${i}`),l(),this._installFunc[a]=void 0)}var i}}function Q_(){Pr("error",r=>{const[n,i,a]=rm();if(!n.getIntegration(sr))return;const{msg:l,url:c,line:p,column:v,error:h}=r;if(Zv()||h&&h.__sentry_own_request__)return;const _=h===void 0&&Ir(l)?function(w,S,T,M){const L=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let O=Oc(w)?w.message:w,R="Error";const W=O.match(L);return W&&(R=W[1],O=W[2]),Ah({exception:{values:[{type:R,value:O}]}},S,T,M)}(l,c,p,v):Ah(Fc(i,h||l,void 0,a,!1),c,p,v);_.level="error",nm(n,h,_,"onerror")})}function K_(){Pr("unhandledrejection",r=>{const[n,i,a]=rm();if(!n.getIntegration(sr))return;let l=r;try{"reason"in r?l=r.reason:"detail"in r&&"reason"in r.detail&&(l=r.detail.reason)}catch{}if(Zv()||l&&l.__sentry_own_request__)return!0;const c=Bv(l)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(l)}`}]}}:Fc(i,l,void 0,a,!0);c.level="error",nm(n,l,c,"onunhandledrejection")})}function Ah(r,n,i,a){const l=r.exception=r.exception||{},c=l.values=l.values||[],p=c[0]=c[0]||{},v=p.stacktrace=p.stacktrace||{},h=v.frames=v.frames||[],_=isNaN(parseInt(a,10))?void 0:a,w=isNaN(parseInt(i,10))?void 0:i,S=Ir(n)&&n.length>0?n:function(){try{return h_.document.location.href}catch{return""}}();return h.length===0&&h.push({colno:_,filename:S,function:"?",in_app:!0,lineno:w}),r}function nm(r,n,i,a){xo(i,{handled:!1,type:a}),r.captureEvent(i,{originalException:n})}function rm(){const r=Ft(),n=r.getClient(),i=n&&n.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[r,i.stackParser,i.attachStacktrace]}sr.__initStatic();const X_=["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 Io{static __initStatic(){this.id="TryCatch"}__init(){this.name=Io.id}constructor(n){Io.prototype.__init.call(this),this._options={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...n}}setupOnce(){this._options.setTimeout&&ht($e,"setTimeout",jh),this._options.setInterval&&ht($e,"setInterval",jh),this._options.requestAnimationFrame&&ht($e,"requestAnimationFrame",Z_),this._options.XMLHttpRequest&&"XMLHttpRequest"in $e&&ht(XMLHttpRequest.prototype,"send",e0);const n=this._options.eventTarget;n&&(Array.isArray(n)?n:X_).forEach(t0)}}function jh(r){return function(...n){const i=n[0];return n[0]=Ti(i,{mechanism:{data:{function:lr(r)},handled:!0,type:"instrument"}}),r.apply(this,n)}}function Z_(r){return function(n){return r.apply(this,[Ti(n,{mechanism:{data:{function:"requestAnimationFrame",handler:lr(r)},handled:!0,type:"instrument"}})])}}function e0(r){return function(...n){const i=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(a=>{a in i&&typeof i[a]=="function"&&ht(i,a,function(l){const c={mechanism:{data:{function:a,handler:lr(l)},handled:!0,type:"instrument"}},p=Ac(l);return p&&(c.mechanism.data.handler=lr(p)),Ti(l,c)})}),r.apply(this,n)}}function t0(r){const n=$e,i=n[r]&&n[r].prototype;i&&i.hasOwnProperty&&i.hasOwnProperty("addEventListener")&&(ht(i,"addEventListener",function(a){return function(l,c,p){try{typeof c.handleEvent=="function"&&(c.handleEvent=Ti(c.handleEvent,{mechanism:{data:{function:"handleEvent",handler:lr(c),target:r},handled:!0,type:"instrument"}}))}catch{}return a.apply(this,[l,Ti(c,{mechanism:{data:{function:"addEventListener",handler:lr(c),target:r},handled:!0,type:"instrument"}}),p])}}),ht(i,"removeEventListener",function(a){return function(l,c,p){const v=c;try{const h=v&&v.__sentry_wrapped__;h&&a.call(this,l,h,p)}catch{}return a.call(this,l,v,p)}}))}Io.__initStatic();class wi{static __initStatic(){this.id="LinkedErrors"}__init(){this.name=wi.id}constructor(n={}){wi.prototype.__init.call(this),this._key=n.key||"cause",this._limit=n.limit||5}setupOnce(n,i){n((a,l)=>{const c=i(),p=c.getClient(),v=c.getIntegration(wi);if(!p||!v)return a;const h=p.getOptions();return p_(em,h.stackParser,h.maxValueLength,v._key,v._limit,a,l),a})}}wi.__initStatic();class Si{constructor(){Si.prototype.__init.call(this)}static __initStatic(){this.id="HttpContext"}__init(){this.name=Si.id}setupOnce(){Qv(n=>{if(Ft().getIntegration(Si)){if(!$e.navigator&&!$e.location&&!$e.document)return n;const i=n.request&&n.request.url||$e.location&&$e.location.href,{referrer:a}=$e.document||{},{userAgent:l}=$e.navigator||{},c={...n.request&&n.request.headers,...a&&{Referer:a},...l&&{"User-Agent":l}},p={...n.request,...i&&{url:i},headers:c};return{...n,request:p}}return n})}}Si.__initStatic();class ki{constructor(){ki.prototype.__init.call(this)}static __initStatic(){this.id="Dedupe"}__init(){this.name=ki.id}setupOnce(n,i){const a=l=>{if(l.type)return l;const c=i().getIntegration(ki);if(c){try{if(function(p,v){return v?!!(function(h,_){const w=h.message,S=_.message;return!(!w&&!S||w&&!S||!w&&S||w!==S||!Nh(h,_)||!Rh(h,_))}(p,v)||function(h,_){const w=Fh(_),S=Fh(h);return!(!w||!S||w.type!==S.type||w.value!==S.value||!Nh(h,_)||!Rh(h,_))}(p,v)):!1}(l,c._previousEvent))return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ce.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{return c._previousEvent=l}return c._previousEvent=l}return l};a.id=this.name,n(a)}}function Rh(r,n){let i=Uh(r),a=Uh(n);if(!i&&!a)return!0;if(i&&!a||!i&&a||a.length!==i.length)return!1;for(let l=0;l=75;case"Safari":return RTCRtpTransceiver.prototype.hasOwnProperty("currentDirection")&&!(n.major===13&&n.minor===0&&n.point===0);case"Firefox":return n.major>=67}return!0}(Rr(),_s())||Ae())}function ev(){if(Ae()||!document)return!1;var r=document.createElement("iframe");return!!r.requestFullscreen||!!r.webkitRequestFullscreen}var ow=function(){try{var r=document.createElement("canvas"),n=r.getContext("webgl2")!=null;return r.remove(),n}catch{return!1}}();function sm(){var r=arguments.length>0&&arguments[0]!==void 0&&arguments[0];return!Ae()&&!!ow&&(r?function(){return nv()?!1:["Chrome","Firefox"].includes(Rr())}():function(){if(nv())return!1;var n=Rr();if(n==="Safari"){var i=Bc();if(i.major<15||i.major===15&&i.minor<4)return!1}return n==="Chrome"?Uc().major>=77:n==="Firefox"?zc().major>=97:["Chrome","Firefox","Safari"].includes(n)}())}function lm(){if(Ae()||um()||typeof AudioWorkletNode>"u")return!1;switch(Rr()){case"Chrome":case"Firefox":return!0;case"Safari":return _s().major>=17}return!1}function tv(){return am()&&!function(){var r,n=Rr();if(!Qt())return!0;switch(n){case"Chrome":return(r=Uc()).major&&r.major>0&&r.major<75;case"Firefox":return(r=zc()).major<91;case"Safari":return(r=Bc()).major<13||r.major===13&&r.minor<1;default:return!0}}()}function um(){return Qt().match(/Linux; Android/)}function nv(){var r,n,i=Qt(),a=i.match(/Mac/)&&(!Ae()&&typeof window<"u"&&(r=window)!==null&&r!==void 0&&(n=r.navigator)!==null&&n!==void 0&&n.maxTouchPoints?window.navigator.maxTouchPoints:0)>=5;return!!(i.match(/Mobi/)||i.match(/Android/)||a)||!!Qt().match(/DailyAnd\//)||void 0}function Rr(){if(typeof window<"u"){var r=Qt();return cm()?"Safari":r.indexOf("Edge")>-1?"Edge":r.match(/Chrome\//)?"Chrome":r.indexOf("Safari")>-1||dm()?"Safari":r.indexOf("Firefox")>-1?"Firefox":r.indexOf("MSIE")>-1||r.indexOf(".NET")>-1?"IE":"Unknown Browser"}}function _s(){switch(Rr()){case"Chrome":return Uc();case"Safari":return Bc();case"Firefox":return zc();case"Edge":return function(){var r=0,n=0;if(typeof window<"u"){var i=Qt().match(/Edge\/(\d+).(\d+)/);if(i)try{r=parseInt(i[1]),n=parseInt(i[2])}catch{}}return{major:r,minor:n}}()}}function Uc(){var r=0,n=0,i=0,a=0,l=!1;if(typeof window<"u"){var c=Qt(),p=c.match(/Chrome\/(\d+).(\d+).(\d+).(\d+)/);if(p)try{r=parseInt(p[1]),n=parseInt(p[2]),i=parseInt(p[3]),a=parseInt(p[4]),l=c.indexOf("OPR/")>-1}catch{}}return{major:r,minor:n,build:i,patch:a,opera:l}}function cm(){return!!Qt().match(/iPad|iPhone|iPod/i)&&am()}function dm(){return Qt().indexOf("AppleWebKit/605.1.15")>-1}function Bc(){var r=0,n=0,i=0;if(typeof window<"u"){var a=Qt().match(/Version\/(\d+).(\d+)(.(\d+))?/);if(a)try{r=parseInt(a[1]),n=parseInt(a[2]),i=parseInt(a[4])}catch{}else(cm()||dm())&&(r=14,n=0,i=3)}return{major:r,minor:n,point:i}}function zc(){var r=0,n=0;if(typeof window<"u"){var i=Qt().match(/Firefox\/(\d+).(\d+)/);if(i)try{r=parseInt(i[1]),n=parseInt(i[2])}catch{}}return{major:r,minor:n}}var fm=function(){function r(){cn(this,r)}return dn(r,[{key:"addListenerForMessagesFromCallMachine",value:function(n,i,a){vo()}},{key:"addListenerForMessagesFromDailyJs",value:function(n,i,a){vo()}},{key:"sendMessageToCallMachine",value:function(n,i,a,l){vo()}},{key:"sendMessageToDailyJs",value:function(n,i){vo()}},{key:"removeListener",value:function(n){vo()}}]),r}();function rv(r,n){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);n&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(r,l).enumerable})),i.push.apply(i,a)}return i}function Nu(r){for(var n=1;n"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 i,a=un(r);if(n){var l=un(this).constructor;i=Reflect.construct(a,arguments,l)}else i=a.apply(this,arguments);return Ps(this,i)}}var sw=function(r){Ms(i,fm);var n=aw(i);function i(){var a;return cn(this,i),(a=n.call(this))._wrappedListeners={},a._messageCallbacks={},a}return dn(i,[{key:"addListenerForMessagesFromCallMachine",value:function(a,l,c){var p=this,v=function(h){if(h.data&&h.data.what==="iframe-call-message"&&(!h.data.callClientId||h.data.callClientId===l)&&(!h.data.from||h.data.from!=="module")){var _=Nu({},h.data);if(delete _.from,_.callbackStamp&&p._messageCallbacks[_.callbackStamp]){var w=_.callbackStamp;p._messageCallbacks[w].call(c,_),delete p._messageCallbacks[w]}delete _.what,delete _.callbackStamp,a.call(c,_)}};this._wrappedListeners[a]=v,window.addEventListener("message",v)}},{key:"addListenerForMessagesFromDailyJs",value:function(a,l,c){var p=function(v){var h;if(!(!v.data||v.data.what!==ju||!v.data.action||v.data.from&&v.data.from!=="module"||v.data.callClientId&&l&&v.data.callClientId!==l||v!=null&&(h=v.data)!==null&&h!==void 0&&h.callFrameId)){var _=v.data;a.call(c,_)}};this._wrappedListeners[a]=p,window.addEventListener("message",p)}},{key:"sendMessageToCallMachine",value:function(a,l,c,p){if(!c)throw new Error("undefined callClientId. Are you trying to use a DailyCall instance previously destroyed?");var v=Nu({},a);if(v.what=ju,v.from="module",v.callClientId=c,l){var h=xs();this._messageCallbacks[h]=l,v.callbackStamp=h}var _=p?p.contentWindow:window,w=this._callMachineTargetOrigin(p);w&&_.postMessage(v,w)}},{key:"sendMessageToDailyJs",value:function(a,l){a.what=ju,a.callClientId=l,a.from="embedded",window.postMessage(a,this._targetOriginFromWindowLocation())}},{key:"removeListener",value:function(a){var l=this._wrappedListeners[a];l&&(window.removeEventListener("message",l),delete this._wrappedListeners[a])}},{key:"forwardPackagedMessageToCallMachine",value:function(a,l,c){var p=Nu({},a);p.callClientId=c;var v=l?l.contentWindow:window,h=this._callMachineTargetOrigin(l);h&&v.postMessage(p,h)}},{key:"addListenerForPackagedMessagesFromCallMachine",value:function(a,l){var c=function(p){if(p.data&&p.data.what==="iframe-call-message"&&(!p.data.callClientId||p.data.callClientId===l)&&(!p.data.from||p.data.from!=="module")){var v=p.data;a(v)}};return this._wrappedListeners[a]=c,window.addEventListener("message",c),a}},{key:"removeListenerForPackagedMessagesFromCallMachine",value:function(a){var l=this._wrappedListeners[a];l&&(window.removeEventListener("message",l),delete this._wrappedListeners[a])}},{key:"_callMachineTargetOrigin",value:function(a){return a?a.src?new URL(a.src).origin:void 0:this._targetOriginFromWindowLocation()}},{key:"_targetOriginFromWindowLocation",value:function(){return window.location.protocol==="file:"?"*":window.location.origin}}]),i}();function iv(r,n){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);n&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(r,l).enumerable})),i.push.apply(i,a)}return i}function lw(r){var n=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 i,a=un(r);if(n){var l=un(this).constructor;i=Reflect.construct(a,arguments,l)}else i=a.apply(this,arguments);return Ps(this,i)}}var uw=function(r){Ms(i,fm);var n=lw(i);function i(){var a;return cn(this,i),a=n.call(this),global.callMachineToDailyJsEmitter=global.callMachineToDailyJsEmitter||new In.EventEmitter,global.dailyJsToCallMachineEmitter=global.dailyJsToCallMachineEmitter||new In.EventEmitter,a._wrappedListeners={},a._messageCallbacks={},a}return dn(i,[{key:"addListenerForMessagesFromCallMachine",value:function(a,l,c){this._addListener(a,global.callMachineToDailyJsEmitter,l,c,"received call machine message")}},{key:"addListenerForMessagesFromDailyJs",value:function(a,l,c){this._addListener(a,global.dailyJsToCallMachineEmitter,l,c,"received daily-js message")}},{key:"sendMessageToCallMachine",value:function(a,l,c){this._sendMessage(a,global.dailyJsToCallMachineEmitter,c,l,"sending message to call machine")}},{key:"sendMessageToDailyJs",value:function(a,l){this._sendMessage(a,global.callMachineToDailyJsEmitter,l,null,"sending message to daily-js")}},{key:"removeListener",value:function(a){var l=this._wrappedListeners[a];l&&(global.callMachineToDailyJsEmitter.removeListener("message",l),global.dailyJsToCallMachineEmitter.removeListener("message",l),delete this._wrappedListeners[a])}},{key:"_addListener",value:function(a,l,c,p,v){var h=this,_=function(w){if(w.callClientId===c){if(w.callbackStamp&&h._messageCallbacks[w.callbackStamp]){var S=w.callbackStamp;h._messageCallbacks[S].call(p,w),delete h._messageCallbacks[S]}a.call(p,w)}};this._wrappedListeners[a]=_,l.addListener("message",_)}},{key:"_sendMessage",value:function(a,l,c,p,v){var h=function(w){for(var S=1;S0&&arguments[0]!==void 0?arguments[0]:{},i=n.data,a=n.mergeStrategy,l=a===void 0?dc:a;cn(this,r),r._validateMergeStrategy(l),r._validateData(i,l),this.mergeStrategy=l,this.data=i}return dn(r,[{key:"isNoOp",value:function(){return r.isNoOpUpdate(this.data,this.mergeStrategy)}}],[{key:"isNoOpUpdate",value:function(n,i){return Object.keys(n).length===0&&i===fc}},{key:"_validateMergeStrategy",value:function(n){if(!ov.includes(n))throw Error("Unrecognized mergeStrategy provided. Options are: [".concat(ov,"]"))}},{key:"_validateData",value:function(n,i){if(!function(v){if(v==null||Fe(v)!=="object")return!1;var h=Object.getPrototypeOf(v);return h==null||h===Object.prototype}(n))throw Error("Meeting session data must be a plain (map-like) object");var a;try{if(a=JSON.stringify(n),i===dc){var l=JSON.parse(a);Dt(l,n)||console.warn("The meeting session data provided will be modified when serialized.",l,n)}else if(i===fc){for(var c in n)if(Object.hasOwnProperty.call(n,c)&&n[c]!==void 0){var p=JSON.parse(JSON.stringify(n[c]));Dt(n[c],p)||console.warn("At least one key in the meeting session data provided will be modified when serialized.",p,n[c])}}}catch(v){throw Error("Meeting session data must be serializable to JSON: ".concat(v))}if(a.length>Yh)throw Error("Meeting session data is too large (".concat(a.length," characters). Maximum size suppported is ").concat(Yh,"."))}}]),r}();function pc(r,n,i){return pc=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(a,l,c){var p=[null];p.push.apply(p,l);var v=new(Function.bind.apply(a,p));return c&&Mo(v,c.prototype),v},pc.apply(null,arguments)}function hc(r){var n=typeof Map=="function"?new Map:void 0;return hc=function(i){if(i===null||(a=i,Function.toString.call(a).indexOf("[native code]")===-1))return i;var a;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(n!==void 0){if(n.has(i))return n.get(i);n.set(i,l)}function l(){return pc(i,arguments,un(this).constructor)}return l.prototype=Object.create(i.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),Mo(l,i)},hc(r)}function dw(r){var n=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 i,a=un(r);if(n){var l=un(this).constructor;i=Reflect.construct(a,arguments,l)}else i=a.apply(this,arguments);return Ps(this,i)}}function av(r){var n,i=(n=window._daily)===null||n===void 0?void 0:n.pendings;if(i){var a=i.indexOf(r);a!==-1&&i.splice(a,1)}}var fw=function(){function r(n){cn(this,r),this._currentLoad=null,this._callClientId=n}return dn(r,[{key:"load",value:function(){var n,i=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=arguments.length>1?arguments[1]:void 0,c=arguments.length>2?arguments[2]:void 0;if(this.loaded)return window._daily.instances[this._callClientId].callMachine.reset(),void l(!0);n=this._callClientId,window._daily.pendings.push(n),this._currentLoad&&this._currentLoad.cancel(),this._currentLoad=new pw(a,function(){l(!1)},function(p,v){v||av(i._callClientId),c(p,v)}),this._currentLoad.start()}},{key:"cancel",value:function(){this._currentLoad&&this._currentLoad.cancel(),av(this._callClientId)}},{key:"loaded",get:function(){return this._currentLoad&&this._currentLoad.succeeded}}]),r}(),pw=function(){function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0,a=arguments.length>2?arguments[2]:void 0;cn(this,r),this._attemptsRemaining=3,this._currentAttempt=null,this._dailyConfig=n,this._successCallback=i,this._failureCallback=a}return dn(r,[{key:"start",value:function(){var n=this;this._currentAttempt||(this._currentAttempt=new sv(this._dailyConfig,this._successCallback,function i(a){n._currentAttempt.cancelled||(n._attemptsRemaining--,n._failureCallback(a,n._attemptsRemaining>0),n._attemptsRemaining<=0||setTimeout(function(){n._currentAttempt.cancelled||(n._currentAttempt=new sv(n._dailyConfig,n._successCallback,i),n._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}}]),r}(),Fu=function(r){Ms(i,hc(Error));var n=dw(i);function i(){return cn(this,i),n.apply(this,arguments)}return dn(i)}(),ws=2e4,sv=function(){function r(i,a,l){cn(this,r),this._loadAttemptImpl=Ae()||!i.avoidEval?new hw(i,a,l):new vw(i,a,l)}var n;return dn(r,[{key:"start",value:(n=_e(function*(){return this._loadAttemptImpl.start()}),function(){return n.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}}]),r}(),hw=function(){function r(c,p,v){cn(this,r),this.cancelled=!1,this.succeeded=!1,this._networkTimedOut=!1,this._networkTimeout=null,this._iosCache=typeof iOSCallObjectBundleCache<"u"&&iOSCallObjectBundleCache,this._refetchHeaders=null,this._dailyConfig=c,this._successCallback=p,this._failureCallback=v}var n,i,a,l;return dn(r,[{key:"start",value:(l=_e(function*(){var c=ps(this._dailyConfig);!(yield this._tryLoadFromIOSCache(c))&&this._loadFromNetwork(c)}),function(){return l.apply(this,arguments)})},{key:"cancel",value:function(){clearTimeout(this._networkTimeout),this.cancelled=!0}},{key:"_tryLoadFromIOSCache",value:(a=_e(function*(c){if(!this._iosCache)return!1;try{var p=yield this._iosCache.get(c);return!!this.cancelled||!!p&&(p.code?(Function('"use strict";'+p.code)(),this.succeeded=!0,this._successCallback(),!0):(this._refetchHeaders=p.refetchHeaders,!1))}catch{return!1}}),function(c){return a.apply(this,arguments)})},{key:"_loadFromNetwork",value:(i=_e(function*(c){var p=this;this._networkTimeout=setTimeout(function(){p._networkTimedOut=!0,p._failureCallback({msg:"Timed out (>".concat(ws," ms) when loading call object bundle ").concat(c),type:"timeout"})},ws);try{var v=this._refetchHeaders?{headers:this._refetchHeaders}:{},h=yield fetch(c,v);if(clearTimeout(this._networkTimeout),this.cancelled||this._networkTimedOut)throw new Fu;var _=yield this._getBundleCodeFromResponse(c,h);if(this.cancelled)throw new Fu;Function('"use strict";'+_)(),this._iosCache&&this._iosCache.set(c,_,h.headers),this.succeeded=!0,this._successCallback()}catch(w){if(clearTimeout(this._networkTimeout),w instanceof Fu||this.cancelled||this._networkTimedOut)return;this._failureCallback({msg:"Failed to load call object bundle ".concat(c,": ").concat(w),type:w.message})}}),function(c){return i.apply(this,arguments)})},{key:"_getBundleCodeFromResponse",value:(n=_e(function*(c,p){if(p.ok)return yield p.text();if(this._iosCache&&p.status===304)return(yield this._iosCache.renew(c,p.headers)).code;throw new Error("Received ".concat(p.status," response"))}),function(c,p){return n.apply(this,arguments)})}]),r}(),vw=function(){function r(n,i,a){cn(this,r),this.cancelled=!1,this.succeeded=!1,this._dailyConfig=n,this._successCallback=i,this._failureCallback=a,this._attemptId=xs(),this._networkTimeout=null,this._scriptElement=null}return dn(r,[{key:"start",value:function(){window._dailyCallMachineLoadWaitlist||(window._dailyCallMachineLoadWaitlist=new Set);var n=ps(this._dailyConfig);(typeof document>"u"?"undefined":Fe(document))==="object"?this._startLoading(n):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(n){var i=this;this._signUpForCallMachineLoadWaitlist(),this._networkTimeout=setTimeout(function(){i._stopLoading(),i._failureCallback({msg:"Timed out (>".concat(ws," ms) when loading call object bundle ").concat(n),type:"timeout"})},ws);var a=document.getElementsByTagName("head")[0],l=document.createElement("script");this._scriptElement=l,l.onload=function(){i._stopLoading(),i.succeeded=!0,i._successCallback()},l.onerror=function(c){i._stopLoading(),i._failureCallback({msg:"Failed to load call object bundle ".concat(c.target.src),type:c.message})},l.src=n,a.appendChild(l)}},{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)}}]),r}(),rs=function(r,n,i){return gw(r.local,n,i)===!0},mw=function(r,n,i){return r.local.streams&&r.local.streams[n]&&r.local.streams[n].stream&&r.local.streams[n].stream["get".concat(i==="video"?"Video":"Audio","Tracks")]()[0]},mi=function(r,n,i,a){var l=yw(r,n,i,a);return l&&l.pendingTrack},gw=function(r,n,i){if(!r)return!1;var a=function(c){switch(c){case"avatar":return!0;case"staged":return c;default:return!!c}},l=r.public.subscribedTracks;return l&&l[n]?["cam-audio","cam-video","screen-video","screen-audio","rmpAudio","rmpVideo"].indexOf(i)===-1&&l[n].custom?[!0,"staged"].includes(l[n].custom)?a(l[n].custom):a(l[n].custom[i]):a(l[n][i]):!l||a(l.ALL)},yw=function(r,n,i,a){var l=Object.values(r.streams||{}).filter(function(c){return c.participantId===n&&c.type===i&&c.pendingTrack&&c.pendingTrack.kind===a}).sort(function(c,p){return new Date(p.starttime)-new Date(c.starttime)});return l&&l[0]},_w=function(r,n){var i=r.local.public.customTracks;if(i&&i[n])return i[n].track};function lv(r,n){for(var i=n.getState(),a=0,l=["cam","screen"];a=r.length?{done:!0}:{done:!1,value:r[a++]}},e:function(h){throw h},f:l}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var c,p=!0,v=!1;return{s:function(){i=i.call(r)},n:function(){var h=i.next();return p=h.done,h},e:function(h){v=!0,c=h},f:function(){try{p||i.return==null||i.return()}finally{if(v)throw c}}}}function dv(r,n){(n==null||n>r.length)&&(n=r.length);for(var i=0,a=new Array(n);i=r.length?{done:!0}:{done:!1,value:r[a++]}},e:function(h){throw h},f:l}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var c,p=!0,v=!1;return{s:function(){i=i.call(r)},n:function(){var h=i.next();return p=h.done,h},e:function(h){v=!0,c=h},f:function(){try{p||i.return==null||i.return()}finally{if(v)throw c}}}}function fv(r,n){(n==null||n>r.length)&&(n=r.length);for(var i=0,a=new Array(n);i"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 i,a=un(r);if(n){var l=un(this).constructor;i=Reflect.construct(a,arguments,l)}else i=a.apply(this,arguments);return Ps(this,i)}}function hv(r,n){var i=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!i){if(Array.isArray(r)||(i=function(h,_){if(h){if(typeof h=="string")return vv(h,_);var w=Object.prototype.toString.call(h).slice(8,-1);if(w==="Object"&&h.constructor&&(w=h.constructor.name),w==="Map"||w==="Set")return Array.from(h);if(w==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(w))return vv(h,_)}}(r))||n){i&&(r=i);var a=0,l=function(){};return{s:l,n:function(){return a>=r.length?{done:!0}:{done:!1,value:r[a++]}},e:function(h){throw h},f:l}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var c,p=!0,v=!1;return{s:function(){i=i.call(r)},n:function(){var h=i.next();return p=h.done,h},e:function(h){v=!0,c=h},f:function(){try{p||i.return==null||i.return()}finally{if(v)throw c}}}}function vv(r,n){(n==null||n>r.length)&&(n=r.length);for(var i=0,a=new Array(n);i49)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 n){if(!Number.isInteger(n.minTilesPerPage))return console.error("grid.minTilesPerPage should be an integer. You passed ".concat(n.minTilesPerPage,".")),!1;if(n.minTilesPerPage<1)return console.error("grid.minTilesPerPage can't be lower than 1."),!1;if("maxTilesPerPage"in n&&n.minTilesPerPage>n.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(r){return mm(r,{allowAllParticipantsKey:!1})},help:_m({allowAllParticipantsKey:!1})},sendSettings:{validate:function(r,n){return!!function(i,a){try{return a.validateUpdateSendSettings(i),!0}catch(l){return console.error("Failed to validate send settings",l),!1}}(r,n)&&(n._preloadCache.sendSettings=r,!0)},help:"Invalid sendSettings provided. Check error logs for detailed info."},inputSettings:{validate:function(r,n){var i;return!!gm(r)&&(n._preloadCache.inputSettings||(n._preloadCache.inputSettings={}),ym(r,(i=n.properties)===null||i===void 0?void 0:i.dailyConfig),r.audio&&(n._preloadCache.inputSettings.audio=r.audio),r.video&&(n._preloadCache.inputSettings.video=r.video),!0)},help:mc()},layout:{validate:function(r){return r==="custom-v1"||r==="browser"||r==="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},is={styles:{validate:function(r){for(var n in r)if(n!=="cam"&&n!=="screen")return!1;if(r.cam){for(var i in r.cam)if(i!=="div"&&i!=="video")return!1}if(r.screen){for(var a in r.screen)if(a!=="div"&&a!=="video")return!1}return!0},help:"styles format should be a subset of: { cam: {div: {}, video: {}}, screen: {div: {}, video: {}} }"},setSubscribedTracks:{validate:function(r,n){if(n._preloadCache.subscribeToTracksAutomatically)return!1;var i=[!0,!1,"staged"];if(i.includes(r)||!Ae()&&r==="avatar")return!0;var a=["audio","video","screenAudio","screenVideo","rmpAudio","rmpVideo"];return function l(c){var p=arguments.length>1&&arguments[1]!==void 0&&arguments[1];for(var v in c)if(v==="custom"){if(!i.includes(c[v])&&!l(c[v],!0))return!1}else{var h=!p&&!a.includes(v),_=!i.includes(c[v]);if(h||_)return!1}return!0}(r)},help:"setSubscribedTracks cannot be used when setSubscribeToTracksAutomatically is enabled, and should be of the form: "+"true".concat(Ae()?"":" | '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(r){return r===!1},help:"setScreenShare must be false, as it's only meant for stopping remote participants' screen shares"},eject:!0,updatePermissions:{validate:function(r){for(var n=0,i=Object.entries(r);n1&&arguments[1]!==void 0?arguments[1]:{};if(cn(this,fe),Dn(xn(g=ge.call(this)),"startListeningForDeviceChanges",function(){Cw(g.handleDeviceChange)}),Dn(xn(g),"stopListeningForDeviceChanges",function(){bw(g.handleDeviceChange)}),Dn(xn(g),"handleDeviceChange",function(ie){ie=ie.map(function(de){return JSON.parse(JSON.stringify(de))}),g.emitDailyJSEvent({action:"available-devices-updated",availableDevices:ie})}),Dn(xn(g),"handleNativeAppStateChange",function(){var ie=_e(function*(de){if(de==="destroyed")return console.warn("App has been destroyed before leaving the meeting. Cleaning up all the resources!"),void(yield g.destroy());var be=de==="active";g.disableReactNativeAutoDeviceManagement("video")||(be?g.camUnmutedBeforeLosingNativeActiveState&&g.setLocalVideo(!0):(g.camUnmutedBeforeLosingNativeActiveState=g.localVideo(),g.camUnmutedBeforeLosingNativeActiveState&&g.setLocalVideo(!1)))});return function(de){return ie.apply(this,arguments)}}()),Dn(xn(g),"handleNativeAudioFocusChange",function(ie){g.disableReactNativeAutoDeviceManagement("audio")||(g._hasNativeAudioFocus=ie,g.toggleParticipantAudioBasedOnNativeAudioFocus(),g._hasNativeAudioFocus?g.micUnmutedBeforeLosingNativeAudioFocus&&g.setLocalAudio(!0):(g.micUnmutedBeforeLosingNativeAudioFocus=g.localAudio(),g.setLocalAudio(!1)))}),Dn(xn(g),"handleNativeSystemScreenCaptureStop",function(){g.stopScreenShare()}),g.strictMode=k.strictMode===void 0||k.strictMode,g.allowMultipleCallInstances=(m=k.allowMultipleCallInstances)!==null&&m!==void 0&&m,Object.keys(Cr).length&&(g._logDuplicateInstanceAttempt(),!g.allowMultipleCallInstances)){if(g.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:{}}),g.callClientId=xs(),C=xn(g),Cr[C.callClientId]=C,window._daily.instances[g.callClientId]={},g._sharedTracks={},window._daily.instances[g.callClientId].tracks=g._sharedTracks,k.dailyJsVersion=fe.version(),g._iframe=d,g._callObjectMode=k.layout==="none"&&!g._iframe,g._preloadCache={subscribeToTracksAutomatically:!0,audioDeviceId:null,videoDeviceId:null,outputDeviceId:null,inputSettings:null,sendSettings:null,videoTrackForNetworkConnectivityTest:null,videoTrackForConnectionQualityTest:null},k.showLocalVideo!==void 0?g._callObjectMode?console.error("showLocalVideo is not available in call object mode"):g._showLocalVideo=!!k.showLocalVideo:g._showLocalVideo=!0,k.showParticipantsBar!==void 0?g._callObjectMode?console.error("showParticipantsBar is not available in call object mode"):g._showParticipantsBar=!!k.showParticipantsBar:g._showParticipantsBar=!0,k.customIntegrations!==void 0?g._callObjectMode?console.error("customIntegrations is not available in call object mode"):g._customIntegrations=k.customIntegrations:g._customIntegrations={},k.customTrayButtons!==void 0?g._callObjectMode?console.error("customTrayButtons is not available in call object mode"):g._customTrayButtons=k.customTrayButtons:g._customTrayButtons={},k.activeSpeakerMode!==void 0?g._callObjectMode?console.error("activeSpeakerMode is not available in call object mode"):g._activeSpeakerMode=!!k.activeSpeakerMode:g._activeSpeakerMode=!1,k.receiveSettings?g._callObjectMode?g._receiveSettings=k.receiveSettings:console.error("receiveSettings is only available in call object mode"):g._receiveSettings={},g.validateProperties(k),g.properties=we({},k),g._preloadCache.inputSettings||(g._preloadCache.inputSettings={}),k.inputSettings&&k.inputSettings.audio&&(g._preloadCache.inputSettings.audio=k.inputSettings.audio),k.inputSettings&&k.inputSettings.video&&(g._preloadCache.inputSettings.video=k.inputSettings.video),g._callObjectLoader=g._callObjectMode?new fw(g.callClientId):null,g._callState=zh,g._isPreparingToJoin=!1,g._accessState={access:Iu},g._meetingSessionSummary={},g._finalSummaryOfPrevSession={},g._meetingSessionState=$u(gv,g._callObjectMode),g._nativeInCallAudioMode=mv,g._participants={},g._isScreenSharing=!1,g._participantCounts=yv,g._rmpPlayerState={},g._waitingParticipants={},g._network={threshold:"good",quality:100},g._activeSpeaker={},g._localAudioLevel=0,g._isLocalAudioLevelObserverRunning=!1,g._remoteParticipantsAudioLevel={},g._isRemoteParticipantsAudioLevelObserverRunning=!1,g._maxAppMessageSize=Au,g._messageChannel=Ae()?new uw:new sw,g._iframe&&(g._iframe.requestFullscreen?g._iframe.addEventListener("fullscreenchange",function(){document.fullscreenElement===g._iframe?(g.emitDailyJSEvent({action:es}),g.sendMessageToCallMachine({action:es})):(g.emitDailyJSEvent({action:ts}),g.sendMessageToCallMachine({action:ts}))}):g._iframe.webkitRequestFullscreen&&g._iframe.addEventListener("webkitfullscreenchange",function(){document.webkitFullscreenElement===g._iframe?(g.emitDailyJSEvent({action:es}),g.sendMessageToCallMachine({action:es})):(g.emitDailyJSEvent({action:ts}),g.sendMessageToCallMachine({action:ts}))})),Ae()){var U=g.nativeUtils();U.addAudioFocusChangeListener&&U.removeAudioFocusChangeListener&&U.addAppStateChangeListener&&U.removeAppStateChangeListener&&U.addSystemScreenCaptureStopListener&&U.removeSystemScreenCaptureStopListener||console.warn("expected (add|remove)(AudioFocusChange|AppActiveStateChange|SystemScreenCaptureStop)Listener to be available in React Native"),g._hasNativeAudioFocus=!0,U.addAudioFocusChangeListener(g.handleNativeAudioFocusChange),U.addAppStateChangeListener(g.handleNativeAppStateChange),U.addSystemScreenCaptureStopListener(g.handleNativeSystemScreenCaptureStop)}return g._callObjectMode&&g.startListeningForDeviceChanges(),g._messageChannel.addListenerForMessagesFromCallMachine(g.handleMessageFromCallMachine,g.callClientId,xn(g)),g}return dn(fe,[{key:"destroy",value:($=_e(function*(){var d,m;try{yield this.leave()}catch{}var g=this._iframe;if(g){var C=g.parentElement;C&&C.removeChild(g)}if(this._messageChannel.removeListener(this.handleMessageFromCallMachine),Ae()){var k=this.nativeUtils();k.removeAudioFocusChangeListener(this.handleNativeAudioFocusChange),k.removeAppStateChangeListener(this.handleNativeAppStateChange),k.removeSystemScreenCaptureStopListener(this.handleNativeSystemScreenCaptureStop)}this._callObjectMode&&this.stopListeningForDeviceChanges(),this.resetMeetingDependentVars(),this._destroyed=!0,this.emitDailyJSEvent({action:"call-instance-destroyed"}),delete Cr[this.callClientId],!((d=window)===null||d===void 0||(m=d._daily)===null||m===void 0)&&m.instances&&delete window._daily.instances[this.callClientId],this.strictMode&&(this.callClientId=void 0)}),function(){return $.apply(this,arguments)})},{key:"isDestroyed",value:function(){return!!this._destroyed}},{key:"loadCss",value:function(d){var m=d.bodyClass,g=d.cssFile,C=d.cssText;return Pe(),this.sendMessageToCallMachine({action:"load-css",cssFile:this.absoluteUrl(g),bodyClass:m,cssText:C}),this}},{key:"iframe",value:function(){return Pe(),this._iframe}},{key:"meetingState",value:function(){return this._callState}},{key:"accessState",value:function(){return an(this._callObjectMode,"accessState()"),this._accessState}},{key:"participants",value:function(){return this._participants}},{key:"participantCounts",value:function(){return this._participantCounts}},{key:"waitingParticipants",value:function(){return an(this._callObjectMode,"waitingParticipants()"),this._waitingParticipants}},{key:"validateParticipantProperties",value:function(d,m){for(var g in m){if(!is[g])throw new Error("unrecognized updateParticipant property ".concat(g));if(is[g].validate&&!is[g].validate(m[g],this,this._participants[d]))throw new Error(is[g].help)}}},{key:"updateParticipant",value:function(d,m){return this._participants.local&&this._participants.local.session_id===d&&(d="local"),d&&m&&(this.validateParticipantProperties(d,m),this.sendMessageToCallMachine({action:"update-participant",id:d,properties:m})),this}},{key:"updateParticipants",value:function(d){var m=this._participants.local&&this._participants.local.session_id;for(var g in d)g===m&&(g="local"),g&&d[g]&&this.validateParticipantProperties(g,d[g]);return this.sendMessageToCallMachine({action:"update-participants",participants:d}),this}},{key:"updateWaitingParticipant",value:(x=_e(function*(){var d=this,m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(an(this._callObjectMode,"updateWaitingParticipant()"),Be(this._callState,"updateWaitingParticipant()"),typeof m!="string"||Fe(g)!=="object")throw new Error("updateWaitingParticipant() must take an id string and a updates object");return new Promise(function(C,k){d.sendMessageToCallMachine({action:"daily-method-update-waiting-participant",id:m,updates:g},function(U){U.error&&k(U.error),U.id||k(new Error("unknown error in updateWaitingParticipant()")),C({id:U.id})})})}),function(){return x.apply(this,arguments)})},{key:"updateWaitingParticipants",value:(q=_e(function*(){var d=this,m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(an(this._callObjectMode,"updateWaitingParticipants()"),Be(this._callState,"updateWaitingParticipants()"),Fe(m)!=="object")throw new Error("updateWaitingParticipants() must take a mapping between ids and update objects");return new Promise(function(g,C){d.sendMessageToCallMachine({action:"daily-method-update-waiting-participants",updatesById:m},function(k){k.error&&C(k.error),k.ids||C(new Error("unknown error in updateWaitingParticipants()")),g({ids:k.ids})})})}),function(){return q.apply(this,arguments)})},{key:"requestAccess",value:(re=_e(function*(){var d=this,m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},g=m.access,C=g===void 0?{level:r0}:g,k=m.name,U=k===void 0?"":k;return an(this._callObjectMode,"requestAccess()"),Be(this._callState,"requestAccess()"),new Promise(function(ie,de){d.sendMessageToCallMachine({action:"daily-method-request-access",access:C,name:U},function(be){be.error&&de(be.error),be.access||de(new Error("unknown error in requestAccess()")),ie({access:be.access,granted:be.granted})})})}),function(){return re.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(d){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return"forceDiscardTrack"in m&&(Ae()?(console.warn("forceDiscardTrack option not supported in React Native; ignoring"),m={}):d&&(console.warn("forceDiscardTrack option only supported when calling setLocalAudio(false); ignoring"),m={})),this.sendMessageToCallMachine({action:"local-audio",state:d,options:m}),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(d){if(this._isScreenSharing)return this.sendMessageToCallMachine({action:"local-screen-update",options:d}),this;console.warn("There is no screen share in progress. Try calling startScreenShare first.")}},{key:"setLocalVideo",value:function(d){return this.sendMessageToCallMachine({action:"local-video",state:d}),this}},{key:"getReceiveSettings",value:(Z=_e(function*(d){var m=this,g=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).showInheritedValues,C=g!==void 0&&g;if(an(this._callObjectMode,"getReceiveSettings()"),!this._callMachineInitialized)return this._receiveSettings;switch(Fe(d)){case"string":return new Promise(function(k){m.sendMessageToCallMachine({action:"get-single-participant-receive-settings",id:d,showInheritedValues:C},function(U){k(U.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(d){return Z.apply(this,arguments)})},{key:"updateReceiveSettings",value:(Ee=_e(function*(d){var m=this;if(an(this._callObjectMode,"updateReceiveSettings()"),!mm(d,{allowAllParticipantsKey:!0}))throw new Error(_m({allowAllParticipantsKey:!0}));return Be(this._callState,"updateReceiveSettings()","To specify receive settings earlier, use the receiveSettings config property."),new Promise(function(g){m.sendMessageToCallMachine({action:"update-receive-settings",receiveSettings:d},function(C){g({receiveSettings:C.receiveSettings})})})}),function(d){return Ee.apply(this,arguments)})},{key:"_prepInputSettingsToPresentToUser",value:function(d){var m,g,C,k,U,ie,de,be;if(d){var Ze={},Ve=((m=d.audio)===null||m===void 0||(g=m.processor)===null||g===void 0?void 0:g.type)==="none"&&((C=d.audio)===null||C===void 0||(k=C.processor)===null||k===void 0?void 0:k._isDefaultWhenNone);if(d.audio&&!Ve){var Ut=we({},d.audio.processor);delete Ut._isDefaultWhenNone,Ze.audio=we(we({},d.audio),{},{processor:Ut})}var Bt=((U=d.video)===null||U===void 0||(ie=U.processor)===null||ie===void 0?void 0:ie.type)==="none"&&((de=d.video)===null||de===void 0||(be=de.processor)===null||be===void 0?void 0:be._isDefaultWhenNone);if(d.video&&!Bt){var zt=we({},d.video.processor);delete zt._isDefaultWhenNone,Ze.video=we(we({},d.video),{},{processor:zt})}return Ze}}},{key:"getInputSettings",value:function(){var d=this;return Pe(),new Promise(function(m){m(d._getInputSettings())})}},{key:"_getInputSettings",value:function(){var d,m,g,C,k,U,ie,de,be={processor:{type:"none",_isDefaultWhenNone:!0}};this._inputSettings?(d=((g=this._inputSettings)===null||g===void 0?void 0:g.video)||be,m=((C=this._inputSettings)===null||C===void 0?void 0:C.audio)||be):(d=((k=this._preloadCache)===null||k===void 0||(U=k.inputSettings)===null||U===void 0?void 0:U.video)||be,m=((ie=this._preloadCache)===null||ie===void 0||(de=ie.inputSettings)===null||de===void 0?void 0:de.audio)||be);var Ze={audio:m,video:d};return this._prepInputSettingsToPresentToUser(Ze)}},{key:"updateInputSettings",value:(Le=_e(function*(d){var m=this;return Pe(),gm(d)?(d&&(this._preloadCache.inputSettings||(this._preloadCache.inputSettings={}),ym(d,this.properties.dailyConfig),d.audio&&(this._preloadCache.inputSettings.audio=d.audio),d.video&&(this._preloadCache.inputSettings.video=d.video)),d.video||d.audio?this._callObjectMode&&!this._callMachineInitialized?this._getInputSettings():new Promise(function(g,C){m.sendMessageToCallMachine({action:"update-input-settings",inputSettings:d},function(k){k.error?C(k.error):g({inputSettings:m._prepInputSettingsToPresentToUser(k.inputSettings)})})}):this._getInputSettings()):(console.error(mc()),Promise.reject(mc()))}),function(d){return Le.apply(this,arguments)})},{key:"setBandwidth",value:function(d){var m=d.kbs,g=d.trackConstraints;if(Pe(),this._callMachineInitialized)return this.sendMessageToCallMachine({action:"set-bandwidth",kbs:m,trackConstraints:g}),this}},{key:"getDailyLang",value:function(){var d=this;if(Pe(),this._callMachineInitialized)return new Promise(function(m){d.sendMessageToCallMachine({action:"get-daily-lang"},function(g){delete g.action,delete g.callbackStamp,m(g)})})}},{key:"setDailyLang",value:function(d){return Pe(),this.sendMessageToCallMachine({action:"set-daily-lang",lang:d}),this}},{key:"setProxyUrl",value:function(d){return this.sendMessageToCallMachine({action:"set-proxy-url",proxyUrl:d}),this}},{key:"setIceConfig",value:function(d){return this.sendMessageToCallMachine({action:"set-ice-config",iceConfig:d}),this}},{key:"meetingSessionSummary",value:function(){return[Er,tr].includes(this._callState)?this._finalSummaryOfPrevSession:this._meetingSessionSummary}},{key:"getMeetingSession",value:(ke=_e(function*(){var d=this;return console.warn("getMeetingSession() is deprecated: use meetingSessionSummary(), which will return immediately"),Be(this._callState,"getMeetingSession()"),new Promise(function(m){d.sendMessageToCallMachine({action:"get-meeting-session"},function(g){delete g.action,delete g.callbackStamp,m(g)})})}),function(){return ke.apply(this,arguments)})},{key:"meetingSessionState",value:function(){return Be(this._callState,"meetingSessionState"),this._meetingSessionState}},{key:"setMeetingSessionData",value:function(d){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"replace";an(this._callObjectMode,"setMeetingSessionData()"),Be(this._callState,"setMeetingSessionData");try{(function(g,C){new cw({data:g,mergeStrategy:C})})(d,m)}catch(g){throw console.error(g),g}try{this.sendMessageToCallMachine({action:"set-session-data",data:d,mergeStrategy:m})}catch(g){throw new Error("Error setting meeting session data: ".concat(g))}}},{key:"setUserName",value:function(d,m){var g=this;return this.properties.userName=d,new Promise(function(C){g.sendMessageToCallMachine({action:"set-user-name",name:d??"",thisMeetingOnly:Ae()||!!m&&!!m.thisMeetingOnly},function(k){delete k.action,delete k.callbackStamp,C(k)})})}},{key:"setUserData",value:(he=_e(function*(d){var m=this;try{vm(d)}catch(g){throw console.error(g),g}if(this.properties.userData=d,this._callMachineInitialized)return new Promise(function(g){try{m.sendMessageToCallMachine({action:"set-user-data",userData:d},function(C){delete C.action,delete C.callbackStamp,g(C)})}catch(C){throw new Error("Error setting user data: ".concat(C))}})}),function(d){return he.apply(this,arguments)})},{key:"validateAudioLevelInterval",value:function(d){if(d&&(d<100||typeof d!="number"))throw new Error("The interval must be a number greater than or equal to 100 milliseconds.")}},{key:"startLocalAudioLevelObserver",value:function(d){var m=this;if(typeof AudioWorkletNode>"u"&&!Ae())throw new Error("startLocalAudioLevelObserver() is not supported on this browser");if(this.validateAudioLevelInterval(d),this._callMachineInitialized)return this._isLocalAudioLevelObserverRunning=!0,new Promise(function(g,C){m.sendMessageToCallMachine({action:"start-local-audio-level-observer",interval:d},function(k){m._isLocalAudioLevelObserverRunning=!k.error,k.error?C({error:k.error}):g()})});this._preloadCache.localAudioLevelObserver={enabled:!0,interval:d}}},{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(d){var m=this;if(this.validateAudioLevelInterval(d),this._callMachineInitialized)return this._isRemoteParticipantsAudioLevelObserverRunning=!0,new Promise(function(g,C){m.sendMessageToCallMachine({action:"start-remote-participants-audio-level-observer",interval:d},function(k){m._isRemoteParticipantsAudioLevelObserverRunning=!k.error,k.error?C({error:k.error}):g()})});this._preloadCache.remoteParticipantsAudioLevelObserver={enabled:!0,interval:d}}},{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:(Y=_e(function*(){var d=this,m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(an(this._callObjectMode,"startCamera()"),Bu(this._callState,this._isPreparingToJoin,"startCamera()","Did you mean to use setLocalAudio() and/or setLocalVideo() instead?"),this.needsLoad())try{yield this.load(m)}catch(g){return Promise.reject(g)}else{if(this._didPreAuth){if(m.url&&m.url!==this.properties.url)return console.error("url in startCamera() is different than the one used in preAuth()"),Promise.reject();if(m.token&&m.token!==this.properties.token)return console.error("token in startCamera() is different than the one used in preAuth()"),Promise.reject()}this.validateProperties(m),this.properties=we(we({},this.properties),m)}return new Promise(function(g){d.sendMessageToCallMachine({action:"start-camera",properties:ci(d.properties,d.callClientId),preloadCache:ci(d._preloadCache,d.callClientId)},function(C){delete C.action,delete C.callbackStamp,g(C)})})}),function(){return Y.apply(this,arguments)})},{key:"validateCustomTrack",value:function(d,m,g){if(g&&g.length>50)throw new Error("Custom track `trackName` must not be more than 50 characters");if(m&&m!=="music"&&m!=="speech"&&!(m instanceof Object))throw new Error("Custom track `mode` must be either `music` | `speech` | `DailyMicAudioModeSettings` or `undefined`");if(g&&["cam-audio","cam-video","screen-video","screen-audio","rmpAudio","rmpVideo","customVideoDefaults"].includes(g))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(!(d instanceof MediaStreamTrack))throw new Error("Custom tracks provided must be instances of MediaStreamTrack")}},{key:"startCustomTrack",value:function(){var d=this,m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{track,mode,trackName};return Pe(),Be(this._callState,"startCustomTrack()"),this.validateCustomTrack(m.track,m.mode,m.trackName),new Promise(function(g,C){d._sharedTracks.customTrack=m.track,m.track=wo,d.sendMessageToCallMachine({action:"start-custom-track",properties:m},function(k){k.error?C({error:k.error}):g(k.mediaTag)})})}},{key:"stopCustomTrack",value:function(d){var m=this;return Pe(),Be(this._callState,"stopCustomTrack()"),new Promise(function(g){m.sendMessageToCallMachine({action:"stop-custom-track",mediaTag:d},function(C){g(C.mediaTag)})})}},{key:"setCamera",value:function(d){var m=this;return go(),os(this._callMachineInitialized,"setCamera()"),new Promise(function(g){m.sendMessageToCallMachine({action:"set-camera",cameraDeviceId:d},function(C){g({device:C.device})})})}},{key:"setAudioDevice",value:(ae=_e(function*(d){return go(),this.nativeUtils().setAudioDevice(d),{deviceId:yield this.nativeUtils().getAudioDevice()}}),function(d){return ae.apply(this,arguments)})},{key:"cycleCamera",value:function(){var d=this,m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new Promise(function(g){d.sendMessageToCallMachine({action:"cycle-camera",properties:m},function(C){g({device:C.device})})})}},{key:"cycleMic",value:function(){var d=this;return Pe(),new Promise(function(m){d.sendMessageToCallMachine({action:"cycle-mic"},function(g){m({device:g.device})})})}},{key:"getCameraFacingMode",value:function(){var d=this;return go(),new Promise(function(m){d.sendMessageToCallMachine({action:"get-camera-facing-mode"},function(g){m(g.facingMode)})})}},{key:"setInputDevicesAsync",value:(pe=_e(function*(d){var m=this,g=d.audioDeviceId,C=d.videoDeviceId,k=d.audioSource,U=d.videoSource;return Pe(),k!==void 0&&(g=k),U!==void 0&&(C=U),g&&(this._preloadCache.audioDeviceId=g,this._sharedTracks.audioDeviceId=g),C&&(this._preloadCache.videoDeviceId=C,this._sharedTracks.videoDeviceId=C),this._callObjectMode&&this.needsLoad()?{camera:{deviceId:this._preloadCache.videoDeviceId},mic:{deviceId:this._preloadCache.audioDeviceId},speaker:{deviceId:this._preloadCache.outputDeviceId}}:(g instanceof MediaStreamTrack&&(g=wo),C instanceof MediaStreamTrack&&(C=wo),new Promise(function(ie){m.sendMessageToCallMachine({action:"set-input-devices",audioDeviceId:g,videoDeviceId:C},function(de){delete de.action,delete de.callbackStamp,de.returnPreloadCache?ie({camera:{deviceId:m._preloadCache.videoDeviceId},mic:{deviceId:m._preloadCache.audioDeviceId},speaker:{deviceId:m._preloadCache.outputDeviceId}}):ie(de)})}))}),function(d){return pe.apply(this,arguments)})},{key:"setOutputDeviceAsync",value:(te=_e(function*(d){var m=this,g=d.outputDeviceId;return Pe(),g&&(this._preloadCache.outputDeviceId=g),this._callObjectMode&&this.needsLoad()?{camera:{deviceId:this._preloadCache.videoDeviceId},mic:{deviceId:this._preloadCache.audioDeviceId},speaker:{deviceId:this._preloadCache.outputDeviceId}}:new Promise(function(C){m.sendMessageToCallMachine({action:"set-output-device",outputDeviceId:g},function(k){delete k.action,delete k.callbackStamp,k.returnPreloadCache?C({camera:{deviceId:m._preloadCache.videoDeviceId},mic:{deviceId:m._preloadCache.audioDeviceId},speaker:{deviceId:m._preloadCache.outputDeviceId}}):C(k)})})}),function(d){return te.apply(this,arguments)})},{key:"getInputDevices",value:(X=_e(function*(){var d=this;return this._callObjectMode&&this.needsLoad()?{camera:{deviceId:this._preloadCache.videoDeviceId},mic:{deviceId:this._preloadCache.audioDeviceId},speaker:{deviceId:this._preloadCache.outputDeviceId}}:new Promise(function(m){d.sendMessageToCallMachine({action:"get-input-devices"},function(g){delete g.action,delete g.callbackStamp,g.returnPreloadCache?m({camera:{deviceId:d._preloadCache.videoDeviceId},mic:{deviceId:d._preloadCache.audioDeviceId},speaker:{deviceId:d._preloadCache.outputDeviceId}}):m(g)})})}),function(){return X.apply(this,arguments)})},{key:"nativeInCallAudioMode",value:function(){return go(),this._nativeInCallAudioMode}},{key:"setNativeInCallAudioMode",value:function(d){if(go(),[mv,Lw].includes(d)){if(d!==this._nativeInCallAudioMode)return this._nativeInCallAudioMode=d,!this.disableReactNativeAutoDeviceManagement("audio")&&us(this._callState,this._isPreparingToJoin)&&this.nativeUtils().setAudioMode(this._nativeInCallAudioMode),this}else console.error("invalid in-call audio mode specified: ",d)}},{key:"preAuth",value:(z=_e(function*(){var d=this,m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(an(this._callObjectMode,"preAuth()"),Bu(this._callState,this._isPreparingToJoin,"preAuth()"),this.needsLoad()&&(yield this.load(m)),!m.url)throw new Error("preAuth() requires at least a url to be provided");return this.validateProperties(m),this.properties=we(we({},this.properties),m),new Promise(function(g,C){d.sendMessageToCallMachine({action:"daily-method-preauth",properties:ci(d.properties,d.callClientId),preloadCache:ci(d._preloadCache,d.callClientId)},function(k){return k.error?C(k.error):k.access?(d._didPreAuth=!0,void g({access:k.access})):C(new Error("unknown error in preAuth()"))})})}),function(){return z.apply(this,arguments)})},{key:"load",value:(F=_e(function*(d){var m=this;if(this.needsLoad()){if(this._destroyed&&(this._logUseAfterDestroy(),this.strictMode))throw new Error("Use after destroy");if(d&&(this.validateProperties(d),this.properties=we(we({},this.properties),d)),!this._callObjectMode&&!this.properties.url)throw new Error("can't load iframe meeting because url property isn't set");return this._updateCallState($h),this.emitDailyJSEvent({action:u0}),this._callObjectMode?new Promise(function(g,C){m._callObjectLoader.cancel();var k=Date.now();m._callObjectLoader.load(m.properties.dailyConfig,function(U){m._bundleLoadTime=U?"no-op":Date.now()-k,m._updateCallState(Vh),U&&m.emitDailyJSEvent({action:Wh}),g()},function(U,ie){if(m.emitDailyJSEvent({action:c0}),!ie){m._updateCallState(tr),m.resetMeetingDependentVars();var de={action:qh,errorMsg:U.msg,error:{type:"connection-error",msg:"Failed to load call object bundle.",details:{on:"load",sourceError:U,bundleUrl:ps(m.properties.dailyConfig)}}};m._maybeSendToSentry(de),m.emitDailyJSEvent(de),C(U.msg)}})}):(this._iframe.src=Nv(this.assembleMeetingUrl(),this.properties.dailyConfig),new Promise(function(g,C){m._loadedCallback=function(k){m._callState!==tr?(m._updateCallState(Vh),(m.properties.cssFile||m.properties.cssText)&&m.loadCss(m.properties),g()):C(k)}}))}}),function(d){return F.apply(this,arguments)})},{key:"join",value:(I=_e(function*(){var d=this,m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this._testCallInProgress&&this.stopTestCallQuality();var g=!1;if(this.needsLoad()){this.updateIsPreparingToJoin(!0);try{yield this.load(m)}catch(C){return this.updateIsPreparingToJoin(!1),Promise.reject(C)}}else{if(g=!(!this.properties.cssFile&&!this.properties.cssText),this._didPreAuth){if(m.url&&m.url!==this.properties.url)return console.error("url in join() is different than the one used in preAuth()"),this.updateIsPreparingToJoin(!1),Promise.reject();if(m.token&&m.token!==this.properties.token)return console.error("token in join() is different than the one used in preAuth()"),this.updateIsPreparingToJoin(!1),Promise.reject()}if(m.url&&!this._callObjectMode&&m.url&&m.url!==this.properties.url)return console.error("url in join() is different than the one used in load() (".concat(this.properties.url," -> ").concat(m.url,")")),this.updateIsPreparingToJoin(!1),Promise.reject();this.validateProperties(m),this.properties=we(we({},this.properties),m)}return m.showLocalVideo!==void 0&&(this._callObjectMode?console.error("showLocalVideo is not available in callObject mode"):this._showLocalVideo=!!m.showLocalVideo),m.showParticipantsBar!==void 0&&(this._callObjectMode?console.error("showParticipantsBar is not available in callObject mode"):this._showParticipantsBar=!!m.showParticipantsBar),this._callState===vi||this._callState===uc?(console.warn("already joined meeting, call leave() before joining again"),void this.updateIsPreparingToJoin(!1)):(this._updateCallState(uc,!1),this.emitDailyJSEvent({action:p0}),this._preloadCache.inputSettings||(this._preloadCache.inputSettings={}),m.inputSettings&&m.inputSettings.audio&&(this._preloadCache.inputSettings.audio=m.inputSettings.audio),m.inputSettings&&m.inputSettings.video&&(this._preloadCache.inputSettings.video=m.inputSettings.video),this.sendMessageToCallMachine({action:"join-meeting",properties:ci(this.properties,this.callClientId),preloadCache:ci(this._preloadCache,this.callClientId)}),new Promise(function(C,k){d._joinedCallback=function(U,ie){if(d._callState!==tr){if(d._updateCallState(vi),U)for(var de in U){if(d._callObjectMode){var be=d._callMachine().store;lv(U[de],be),uv(U[de],be),cv(U[de],d._participants[de],be)}d._participants[de]=we({},U[de]),d.toggleParticipantAudioBasedOnNativeAudioFocus()}g&&d.loadCss(d.properties),C(U)}else k(ie)}}))}),function(){return I.apply(this,arguments)})},{key:"leave",value:(N=_e(function*(){var d=this;return this._testCallInProgress&&this.stopTestCallQuality(),new Promise(function(m){d._callState===Er||d._callState===tr?m():d._callObjectLoader&&!d._callObjectLoader.loaded?(d._callObjectLoader.cancel(),d._updateCallState(Er),d.resetMeetingDependentVars(),d.emitDailyJSEvent({action:Er}),m()):(d._resolveLeave=m,d.sendMessageToCallMachine({action:"leave-meeting"}))})}),function(){return N.apply(this,arguments)})},{key:"startScreenShare",value:(G=_e(function*(){var d=this,m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(os(this._callMachineInitialized,"startScreenShare()"),m.screenVideoSendSettings&&this._validateVideoSendSettings("screenVideo",m.screenVideoSendSettings),m.mediaStream&&(this._sharedTracks.screenMediaStream=m.mediaStream,m.mediaStream=wo),typeof DailyNativeUtils<"u"&&DailyNativeUtils.isIOS!==void 0&&DailyNativeUtils.isIOS){var g=this.nativeUtils();if(yield g.isScreenBeingCaptured())return void this.emitDailyJSEvent({action:Gh,type:"screen-share-error",errorMsg:"Could not start the screen sharing. The screen is already been captured!"});g.setSystemScreenCaptureStartCallback(function(){g.setSystemScreenCaptureStartCallback(null),d.sendMessageToCallMachine({action:Qh,captureOptions:m})}),g.presentSystemScreenCapturePrompt()}else this.sendMessageToCallMachine({action:Qh,captureOptions:m})}),function(){return G.apply(this,arguments)})},{key:"stopScreenShare",value:function(){os(this._callMachineInitialized,"stopScreenShare()"),this.sendMessageToCallMachine({action:"local-screen-stop"})}},{key:"startRecording",value:function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(we({action:"local-recording-start"},d))}},{key:"updateRecording",value:function(d){var m=d.layout,g=m===void 0?{preset:"default"}:m,C=d.instanceId;this.sendMessageToCallMachine({action:"daily-method-update-recording",layout:g,instanceId:C})}},{key:"stopRecording",value:function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(we({action:"local-recording-stop"},d))}},{key:"startLiveStreaming",value:function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(we({action:"daily-method-start-live-streaming"},d))}},{key:"updateLiveStreaming",value:function(d){var m=d.layout,g=m===void 0?{preset:"default"}:m,C=d.instanceId;this.sendMessageToCallMachine({action:"daily-method-update-live-streaming",layout:g,instanceId:C})}},{key:"addLiveStreamingEndpoints",value:function(d){var m=d.endpoints,g=d.instanceId;this.sendMessageToCallMachine({action:Kh,endpointsOp:nw,endpoints:m,instanceId:g})}},{key:"removeLiveStreamingEndpoints",value:function(d){var m=d.endpoints,g=d.instanceId;this.sendMessageToCallMachine({action:Kh,endpointsOp:rw,endpoints:m,instanceId:g})}},{key:"stopLiveStreaming",value:function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.sendMessageToCallMachine(we({action:"daily-method-stop-live-streaming"},d))}},{key:"validateDailyConfig",value:function(d){d.camSimulcastEncodings&&(console.warn("camSimulcastEncodings is deprecated. Use sendSettings, found in DailyCallOptions, to provide camera simulcast settings."),this.validateSimulcastEncodings(d.camSimulcastEncodings)),d.screenSimulcastEncodings&&console.warn("screenSimulcastEncodings is deprecated. Use sendSettings, found in DailyCallOptions, to provide screen simulcast settings."),um()&&d.noAutoDefaultDeviceChange&&console.warn("noAutoDefaultDeviceChange is not supported on Android, and will be ignored.")}},{key:"validateSimulcastEncodings",value:function(d){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,g=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(d){if(!(d instanceof Array||Array.isArray(d)))throw new Error("encodings must be an Array");if(!Ev(d.length,1,3))throw new Error("encodings must be an Array with between 1 to ".concat(3," layers"));for(var C=0;C=200)throw new Error("Error starting dial out: displayName length must be less than 200")}if(d.userId){if(typeof d.userId!="string")throw new Error("Error starting dial out: userId must be a string");if(d.userId.length>36)throw new Error("Error starting dial out: userId length must be less than or equal to 36")}return new Promise(function(C,k){m.sendMessageToCallMachine(we({action:"dialout-start"},d),function(U){U.error?k(U.error):C(U)})})}),function(d){return R.apply(this,arguments)})},{key:"stopDialOut",value:function(d){var m=this;return Be(this._callState,"stopDialOut()"),new Promise(function(g,C){m.sendMessageToCallMachine(we({action:"dialout-stop"},d),function(k){k.error?C(k.error):g(k)})})}},{key:"sipCallTransfer",value:(O=_e(function*(d){var m=this;if(Be(this._callState,"sipCallTransfer()"),!d)throw new Error("sipCallTransfer() requires a sessionId and toEndPoint");return d.useSipRefer=!1,Sv(d,"sipCallTransfer"),new Promise(function(g,C){m.sendMessageToCallMachine(we({action:Zh},d),function(k){k.error?C(k.error):g(k)})})}),function(d){return O.apply(this,arguments)})},{key:"sipRefer",value:(L=_e(function*(d){var m=this;if(Be(this._callState,"sipRefer()"),!d)throw new Error("sessionId and toEndPoint are mandatory parameter");return d.useSipRefer=!0,Sv(d,"sipRefer"),new Promise(function(g,C){m.sendMessageToCallMachine(we({action:Zh},d),function(k){k.error?C(k.error):g(k)})})}),function(d){return L.apply(this,arguments)})},{key:"sendDTMF",value:(M=_e(function*(d){var m=this;return Be(this._callState,"sendDTMF()"),function(g){var C=g.sessionId,k=g.tones;if(!C||!k)throw new Error("sessionId and tones are mandatory parameter");if(typeof C!="string"||typeof k!="string")throw new Error("sessionId and tones should be of string type");if(k.length>20)throw new Error("tones string must be upto 20 characters");var U=/[^0-9A-D*#]/g,ie=k.match(U);if(ie&&ie[0])throw new Error("".concat(ie[0]," is not valid DTMF tone"))}(d),new Promise(function(g,C){m.sendMessageToCallMachine(we({action:"send-dtmf"},d),function(k){k.error?C(k.error):g(k)})})}),function(d){return M.apply(this,arguments)})},{key:"getNetworkStats",value:function(){var d=this;return this._callState!==vi?{stats:{latest:{}}}:new Promise(function(m){d.sendMessageToCallMachine({action:"get-calc-stats"},function(g){m(we({stats:g.stats},d._network))})})}},{key:"testWebsocketConnectivity",value:(T=_e(function*(){var d=this;if(zu(this._testCallInProgress,"testWebsocketConnectivity()"),this.needsLoad())try{yield this.load()}catch(m){return Promise.reject(m)}return new Promise(function(m,g){d.sendMessageToCallMachine({action:"test-websocket-connectivity"},function(C){C.error?g(C.error):m(C.results)})})}),function(){return T.apply(this,arguments)})},{key:"abortTestWebsocketConnectivity",value:function(){this.sendMessageToCallMachine({action:"abort-test-websocket-connectivity"})}},{key:"_validateVideoTrackForNetworkTests",value:function(d){return d?d instanceof MediaStreamTrack?!!Mw(d)||(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:(S=_e(function*(){var d=this;Pe(),an(this._callObjectMode,"testCallQuality()"),os(this._callMachineInitialized,"testCallQuality()",null,!0),Bu(this._callState,this._isPreparingToJoin,"testCallQuality()");var m=this._testCallAlreadyInProgress,g=function(k){m||(d._testCallInProgress=k)};if(g(!0),this.needsLoad())try{var C=this._callState;yield this.load(),this._callState=C}catch(k){return g(!1),Promise.reject(k)}return new Promise(function(k){d.sendMessageToCallMachine({action:"test-call-quality",dailyJsVersion:d.properties.dailyJsVersion},function(U){var ie=U.results,de=ie.result,be=Jp(ie,Pw);if(de==="failed"){var Ze,Ve=we({},be);(Ze=be.error)!==null&&Ze!==void 0&&Ze.details?(be.error.details=JSON.parse(be.error.details),Ve.error=we(we({},Ve.error),{},{details:we({},Ve.error.details)}),Ve.error.details.duringTest="testCallQuality"):(Ve.error=Ve.error?we({},Ve.error):{},Ve.error.details={duringTest:"testCallQuality"}),d._maybeSendToSentry(Ve)}g(!1),k(we({result:de},be))})})}),function(){return S.apply(this,arguments)})},{key:"stopTestCallQuality",value:function(){this.sendMessageToCallMachine({action:"stop-test-call-quality"})}},{key:"testConnectionQuality",value:(w=_e(function*(d){var m;Ae()?(console.warn("testConnectionQuality() is deprecated: use testPeerToPeerCallQuality() instead"),m=yield this.testPeerToPeerCallQuality(d)):(console.warn("testConnectionQuality() is deprecated: use testCallQuality() instead"),m=yield this.testCallQuality());var g={result:m.result,secondsElapsed:m.secondsElapsed};return m.data&&(g.data={maxRTT:m.data.maxRoundTripTime,packetLoss:m.data.avgRecvPacketLoss}),g}),function(d){return w.apply(this,arguments)})},{key:"testPeerToPeerCallQuality",value:(_=_e(function*(d){var m=this;if(zu(this._testCallInProgress,"testPeerToPeerCallQuality()"),this.needsLoad())try{yield this.load()}catch(k){return Promise.reject(k)}var g=d.videoTrack,C=d.duration;if(!this._validateVideoTrackForNetworkTests(g))throw new Error("Video track error");return this._sharedTracks.videoTrackForConnectionQualityTest=g,new Promise(function(k,U){m.sendMessageToCallMachine({action:"test-p2p-call-quality",duration:C},function(ie){ie.error?U(ie.error):k(ie.results)})})}),function(d){return _.apply(this,arguments)})},{key:"stopTestConnectionQuality",value:function(){Ae()?(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:(h=_e(function*(d){var m=this;if(zu(this._testCallInProgress,"testNetworkConnectivity()"),this.needsLoad())try{yield this.load()}catch(g){return Promise.reject(g)}if(!this._validateVideoTrackForNetworkTests(d))throw new Error("Video track error");return this._sharedTracks.videoTrackForNetworkConnectivityTest=d,new Promise(function(g,C){m.sendMessageToCallMachine({action:"test-network-connectivity"},function(k){k.error?C(k.error):g(k.results)})})}),function(d){return h.apply(this,arguments)})},{key:"abortTestNetworkConnectivity",value:function(){this.sendMessageToCallMachine({action:"abort-test-network-connectivity"})}},{key:"getCpuLoadStats",value:function(){var d=this;return new Promise(function(m){d._callState===vi?d.sendMessageToCallMachine({action:"get-cpu-load-stats"},function(g){m(g.cpuStats)}):m({cpuLoadState:void 0,cpuLoadStateReason:void 0,stats:{}})})}},{key:"_validateEncodingLayerHasValidProperties",value:function(d){var m;if(!(((m=Object.keys(d))===null||m===void 0?void 0:m.length)>0))throw new Error("Empty encoding is not allowed. At least one of these valid keys should be specified:"+Object.values(Uu))}},{key:"_validateVideoSendSettings",value:function(d,m){var g=d==="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"],C="Video send settings should be either an object or one of the supported presets: ".concat(g.join());if(typeof m=="string"){if(!g.includes(m))throw new Error(C)}else{if(Fe(m)!=="object")throw new Error(C);if(!m.maxQuality&&!m.encodings&&m.allowAdaptiveLayers===void 0)throw new Error("Video send settings must contain at least maxQuality, allowAdaptiveLayers or encodings attribute");if(m.maxQuality&&["low","medium","high"].indexOf(m.maxQuality)===-1)throw new Error("maxQuality must be either low, medium or high");if(m.encodings){var k=!1;switch(Object.keys(m.encodings).length){case 1:k=!m.encodings.low;break;case 2:k=!m.encodings.low||!m.encodings.medium;break;case 3:k=!m.encodings.low||!m.encodings.medium||!m.encodings.high;break;default:k=!0}if(k)throw new Error("Encodings must be defined as: low, low and medium, or low, medium and high.");m.encodings.low&&this._validateEncodingLayerHasValidProperties(m.encodings.low),m.encodings.medium&&this._validateEncodingLayerHasValidProperties(m.encodings.medium),m.encodings.high&&this._validateEncodingLayerHasValidProperties(m.encodings.high)}}}},{key:"validateUpdateSendSettings",value:function(d){var m=this;if(!d||Object.keys(d).length===0)throw new Error("Send settings must contain at least information for one track!");Object.entries(d).forEach(function(g){var C=Dr(g,2),k=C[0],U=C[1];m._validateVideoSendSettings(k,U)})}},{key:"updateSendSettings",value:function(d){var m=this;return this.validateUpdateSendSettings(d),this.needsLoad()?(this._preloadCache.sendSettings=d,{sendSettings:this._preloadCache.sendSettings}):new Promise(function(g,C){m.sendMessageToCallMachine({action:"update-send-settings",sendSettings:d},function(k){k.error?C(k.error):g(k.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 Pe(),this._activeSpeaker}},{key:"setActiveSpeakerMode",value:function(d){return Pe(),this.sendMessageToCallMachine({action:"set-active-speaker-mode",enabled:d}),this}},{key:"activeSpeakerMode",value:function(){return Pe(),this._activeSpeakerMode}},{key:"subscribeToTracksAutomatically",value:function(){return this._preloadCache.subscribeToTracksAutomatically}},{key:"setSubscribeToTracksAutomatically",value:function(d){return Be(this._callState,"setSubscribeToTracksAutomatically()","Use the subscribeToTracksAutomatically configuration property."),this._preloadCache.subscribeToTracksAutomatically=d,this.sendMessageToCallMachine({action:"daily-method-subscribe-to-tracks-automatically",enabled:d}),this}},{key:"enumerateDevices",value:(v=_e(function*(){var d=this;if(this._callObjectMode){var m=yield navigator.mediaDevices.enumerateDevices();return Rr()==="Firefox"&&_s().major>115&&_s().major<123&&(m=m.filter(function(g){return g.kind!=="audiooutput"})),{devices:m.map(function(g){var C=JSON.parse(JSON.stringify(g));if(!Ae()&&g.kind==="videoinput"&&g.getCapabilities){var k,U=g.getCapabilities();C.facing=(U==null||(k=U.facingMode)===null||k===void 0?void 0:k.length)>=1?U.facingMode[0]:void 0}return C})}}return new Promise(function(g){d.sendMessageToCallMachine({action:"enumerate-devices"},function(C){g({devices:C.devices})})})}),function(){return v.apply(this,arguments)})},{key:"sendAppMessage",value:function(d){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"*";if(Be(this._callState,"sendAppMessage()"),JSON.stringify(d).length>this._maxAppMessageSize)throw new Error("Message data too large. Max size is "+this._maxAppMessageSize);return this.sendMessageToCallMachine({action:"app-msg",data:d,to:m}),this}},{key:"addFakeParticipant",value:function(d){return Pe(),Be(this._callState,"addFakeParticipant()"),this.sendMessageToCallMachine(we({action:"add-fake-participant"},d)),this}},{key:"setShowNamesMode",value:function(d){return Nt(this._callObjectMode,"setShowNamesMode()"),Pe(),d&&d!=="always"&&d!=="never"?(console.error('setShowNamesMode argument should be "always", "never", or false'),this):(this.sendMessageToCallMachine({action:"set-show-names",mode:d}),this)}},{key:"setShowLocalVideo",value:function(){var d=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];return Nt(this._callObjectMode,"setShowLocalVideo()"),Pe(),Be(this._callState,"setShowLocalVideo()"),typeof d!="boolean"?(console.error("setShowLocalVideo only accepts a boolean value"),this):(this.sendMessageToCallMachine({action:"set-show-local-video",show:d}),this._showLocalVideo=d,this)}},{key:"showLocalVideo",value:function(){return Nt(this._callObjectMode,"showLocalVideo()"),Pe(),this._showLocalVideo}},{key:"setShowParticipantsBar",value:function(){var d=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];return Nt(this._callObjectMode,"setShowParticipantsBar()"),Pe(),Be(this._callState,"setShowParticipantsBar()"),typeof d!="boolean"?(console.error("setShowParticipantsBar only accepts a boolean value"),this):(this.sendMessageToCallMachine({action:"set-show-participants-bar",show:d}),this._showParticipantsBar=d,this)}},{key:"showParticipantsBar",value:function(){return Nt(this._callObjectMode,"showParticipantsBar()"),Pe(),this._showParticipantsBar}},{key:"customIntegrations",value:function(){return Pe(),Nt(this._callObjectMode,"customIntegrations()"),this._customIntegrations}},{key:"setCustomIntegrations",value:function(d){return Pe(),Nt(this._callObjectMode,"setCustomIntegrations()"),Be(this._callState,"setCustomIntegrations()"),km(d)?(this.sendMessageToCallMachine({action:"set-custom-integrations",integrations:d}),this._customIntegrations=d,this):this}},{key:"startCustomIntegrations",value:function(d){var m=this;if(Pe(),Nt(this._callObjectMode,"startCustomIntegrations()"),Be(this._callState,"startCustomIntegrations()"),Array.isArray(d)&&d.some(function(k){return typeof k!="string"})||!Array.isArray(d)&&typeof d!="string")return console.error("startCustomIntegrations() only accepts string | string[]"),this;var g=typeof d=="string"?[d]:d,C=g.filter(function(k){return!(k in m._customIntegrations)});return C.length?(console.error(`Can't find custom integration(s): "`.concat(C.join(", "),'"')),this):(this.sendMessageToCallMachine({action:"start-custom-integrations",ids:g}),this)}},{key:"stopCustomIntegrations",value:function(d){var m=this;if(Pe(),Nt(this._callObjectMode,"stopCustomIntegrations()"),Be(this._callState,"stopCustomIntegrations()"),Array.isArray(d)&&d.some(function(k){return typeof k!="string"})||!Array.isArray(d)&&typeof d!="string")return console.error("stopCustomIntegrations() only accepts string | string[]"),this;var g=typeof d=="string"?[d]:d,C=g.filter(function(k){return!(k in m._customIntegrations)});return C.length?(console.error(`Can't find custom integration(s): "`.concat(C.join(", "),'"')),this):(this.sendMessageToCallMachine({action:"stop-custom-integrations",ids:g}),this)}},{key:"customTrayButtons",value:function(){return Nt(this._callObjectMode,"customTrayButtons()"),Pe(),this._customTrayButtons}},{key:"updateCustomTrayButtons",value:function(d){return Nt(this._callObjectMode,"updateCustomTrayButtons()"),Pe(),Be(this._callState,"updateCustomTrayButtons()"),Sm(d)?(this.sendMessageToCallMachine({action:"update-custom-tray-buttons",btns:d}),this._customTrayButtons=d,this):(console.error("updateCustomTrayButtons only accepts a dictionary of the type ".concat(JSON.stringify(Ss))),this)}},{key:"theme",value:function(){return Nt(this._callObjectMode,"theme()"),this.properties.theme}},{key:"setTheme",value:function(d){var m=this;return Nt(this._callObjectMode,"setTheme()"),new Promise(function(g,C){try{m.validateProperties({theme:d}),m.properties.theme=we({},d),m.sendMessageToCallMachine({action:"set-theme",theme:m.properties.theme});try{m.emitDailyJSEvent({action:l0,theme:m.properties.theme})}catch(k){console.log("could not emit 'theme-updated'",k)}g(m.properties.theme)}catch(k){C(k)}})}},{key:"requestFullscreen",value:(p=_e(function*(){if(Pe(),this._iframe&&!document.fullscreenElement&&ev())try{(yield this._iframe.requestFullscreen)?this._iframe.requestFullscreen():this._iframe.webkitRequestFullscreen()}catch(d){console.log("could not make video call fullscreen",d)}}),function(){return p.apply(this,arguments)})},{key:"exitFullscreen",value:function(){Pe(),document.fullscreenElement?document.exitFullscreen():document.webkitFullscreenElement&&document.webkitExitFullscreen()}},{key:"getSidebarView",value:(c=_e(function*(){var d=this;return this._callObjectMode?(console.error("getSidebarView is not available in callObject mode"),Promise.resolve(null)):new Promise(function(m){d.sendMessageToCallMachine({action:"get-sidebar-view"},function(g){m(g.view)})})}),function(){return c.apply(this,arguments)})},{key:"setSidebarView",value:function(d){return this._callObjectMode?(console.error("setSidebarView is not available in callObject mode"),this):(this.sendMessageToCallMachine({action:"set-sidebar-view",view:d}),this)}},{key:"room",value:(l=_e(function*(){var d=this,m=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).includeRoomConfigDefaults,g=m===void 0||m;return this._accessState.access===Iu||this.needsLoad()?this.properties.url?{roomUrlPendingJoin:this.properties.url}:null:new Promise(function(C){d.sendMessageToCallMachine({action:"lib-room-info",includeRoomConfigDefaults:g},function(k){delete k.action,delete k.callbackStamp,C(k)})})}),function(){return l.apply(this,arguments)})},{key:"geo",value:(a=_e(function*(){try{var d=yield fetch("https://gs.daily.co/_ks_/x-swsl/:");return{current:(yield d.json()).geo}}catch(m){return console.error("geo lookup failed",m),{current:""}}}),function(){return a.apply(this,arguments)})},{key:"setNetworkTopology",value:(i=_e(function*(d){var m=this;return Pe(),Be(this._callState,"setNetworkTopology()"),new Promise(function(g,C){m.sendMessageToCallMachine({action:"set-network-topology",opts:d},function(k){k.error?C({error:k.error}):g({workerId:k.workerId})})})}),function(d){return i.apply(this,arguments)})},{key:"getNetworkTopology",value:(n=_e(function*(){var d=this;return new Promise(function(m,g){d.needsLoad()&&m({topology:"none"}),d.sendMessageToCallMachine({action:"get-network-topology"},function(C){C.error?g({error:C.error}):m({topology:C.topology})})})}),function(){return n.apply(this,arguments)})},{key:"setPlayNewParticipantSound",value:function(d){if(Pe(),typeof d!="number"&&d!==!0&&d!==!1)throw new Error("argument to setShouldPlayNewParticipantSound should be true, false, or a number, but is ".concat(d));this.sendMessageToCallMachine({action:"daily-method-set-play-ding",arg:d})}},{key:"on",value:function(d,m){return In.prototype.on.call(this,d,m)}},{key:"once",value:function(d,m){return In.prototype.once.call(this,d,m)}},{key:"off",value:function(d,m){return In.prototype.off.call(this,d,m)}},{key:"validateProperties",value:function(d){for(var m in d){if(!br[m])throw new Error("unrecognized property '".concat(m,"'"));if(br[m].validate&&!br[m].validate(d[m],this))throw new Error("property '".concat(m,"': ").concat(br[m].help))}}},{key:"assembleMeetingUrl",value:function(){var d,m,g=we(we({},this.properties),{},{emb:this.callClientId,embHref:encodeURIComponent(window.location.href),proxy:(d=this.properties.dailyConfig)!==null&&d!==void 0&&d.proxyUrl?encodeURIComponent((m=this.properties.dailyConfig)===null||m===void 0?void 0:m.proxyUrl):void 0}),C=g.url.match(/\?/)?"&":"?";return g.url+C+Object.keys(br).filter(function(k){return br[k].queryString&&g[k]!==void 0}).map(function(k){return"".concat(br[k].queryString,"=").concat(g[k])}).join("&")}},{key:"needsLoad",value:function(){return[zh,$h,Er,tr].includes(this._callState)}},{key:"sendMessageToCallMachine",value:function(d,m){if(this._destroyed&&(this._logUseAfterDestroy(),this.strictMode))throw new Error("Use after destroy");this._messageChannel.sendMessageToCallMachine(d,m,this.callClientId,this._iframe)}},{key:"forwardPackagedMessageToCallMachine",value:function(d){this._messageChannel.forwardPackagedMessageToCallMachine(d,this._iframe,this.callClientId)}},{key:"addListenerForPackagedMessagesFromCallMachine",value:function(d){return this._messageChannel.addListenerForPackagedMessagesFromCallMachine(d,this.callClientId)}},{key:"removeListenerForPackagedMessagesFromCallMachine",value:function(d){this._messageChannel.removeListenerForPackagedMessagesFromCallMachine(d)}},{key:"handleMessageFromCallMachine",value:function(d){switch(d.action){case a0:this.sendMessageToCallMachine(we({action:s0},this.properties));break;case"call-machine-initialized":this._callMachineInitialized=!0;var m={action:ns,level:"log",code:1011,stats:{event:"bundle load",time:this._bundleLoadTime==="no-op"?0:this._bundleLoadTime,preLoaded:this._bundleLoadTime==="no-op",url:ps(this.properties.dailyConfig)}};this.sendMessageToCallMachine(m),this._delayDuplicateInstanceLog&&this._logDuplicateInstanceAttempt();break;case Wh:this._loadedCallback&&(this._loadedCallback(),this._loadedCallback=null),this.emitDailyJSEvent(d);break;case h0:var g,C=we({},d);delete C.internal,this._maxAppMessageSize=((g=d.internal)===null||g===void 0?void 0:g._maxAppMessageSize)||Au,this._joinedCallback&&(this._joinedCallback(d.participants),this._joinedCallback=null),this.emitDailyJSEvent(C);break;case m0:case g0:if(this._callState===Er)return;if(d.participant&&d.participant.session_id){var k=d.participant.local?"local":d.participant.session_id;if(this._callObjectMode){var U=this._callMachine().store;lv(d.participant,U),uv(d.participant,U),cv(d.participant,this._participants[k],U)}try{this.maybeParticipantTracksStopped(this._participants[k],d.participant),this.maybeParticipantTracksStarted(this._participants[k],d.participant),this.maybeEventRecordingStopped(this._participants[k],d.participant),this.maybeEventRecordingStarted(this._participants[k],d.participant)}catch(jo){console.error("track events error",jo)}this.compareEqualForParticipantUpdateEvent(d.participant,this._participants[k])||(this._participants[k]=we({},d.participant),this.toggleParticipantAudioBasedOnNativeAudioFocus(),this.emitDailyJSEvent(d))}break;case y0:if(d.participant&&d.participant.session_id){var ie=this._participants[d.participant.session_id];ie&&this.maybeParticipantTracksStopped(ie,null),delete this._participants[d.participant.session_id],this.emitDailyJSEvent(d)}break;case _0:Dt(this._participantCounts,d.participantCounts)||(this._participantCounts=d.participantCounts,this.emitDailyJSEvent(d));break;case w0:var de={access:d.access};d.awaitingAccess&&(de.awaitingAccess=d.awaitingAccess),Dt(this._accessState,de)||(this._accessState=de,this.emitDailyJSEvent(d));break;case S0:if(d.meetingSession){this._meetingSessionSummary=d.meetingSession,this.emitDailyJSEvent(d);var be=we(we({},d),{},{action:"meeting-session-updated"});this.emitDailyJSEvent(be)}break;case qh:var Ze;this._iframe&&!d.preserveIframe&&(this._iframe.src=""),this._updateCallState(tr),this.resetMeetingDependentVars(),this._loadedCallback&&(this._loadedCallback(d.errorMsg),this._loadedCallback=null),d.preserveIframe;var Ve=Jp(d,xw);Ve!=null&&(Ze=Ve.error)!==null&&Ze!==void 0&&Ze.details&&(Ve.error.details=JSON.parse(Ve.error.details)),this._maybeSendToSentry(d),this._joinedCallback&&(this._joinedCallback(null,Ve),this._joinedCallback=null),this.emitDailyJSEvent(Ve);break;case v0:this._callState!==tr&&this._updateCallState(Er),this.resetMeetingDependentVars(),this._resolveLeave&&(this._resolveLeave(),this._resolveLeave=null),this.emitDailyJSEvent(d);break;case"selected-devices-updated":d.devices&&this.emitDailyJSEvent(d);break;case J0:var Ut=d.threshold,Bt=d.quality;Ut===this._network.threshold&&Bt===this._network.quality||(this._network.quality=Bt,this._network.threshold=Ut,this.emitDailyJSEvent(d));break;case G0:d&&d.cpuLoadState&&this.emitDailyJSEvent(d);break;case q0:d&&d.faceCounts!==void 0&&this.emitDailyJSEvent(d);break;case V0:var zt=d.activeSpeaker;this._activeSpeaker.peerId!==zt.peerId&&(this._activeSpeaker.peerId=zt.peerId,this.emitDailyJSEvent({action:d.action,activeSpeaker:this._activeSpeaker}));break;case"show-local-video-changed":if(this._callObjectMode)return;var An=d.show;this._showLocalVideo=An,this.emitDailyJSEvent({action:d.action,show:An});break;case W0:var Ke=d.enabled;this._activeSpeakerMode!==Ke&&(this._activeSpeakerMode=Ke,this.emitDailyJSEvent({action:d.action,enabled:this._activeSpeakerMode}));break;case E0:case C0:case b0:this._waitingParticipants=d.allWaitingParticipants,this.emitDailyJSEvent({action:d.action,participant:d.participant});break;case ew:Dt(this._receiveSettings,d.receiveSettings)||(this._receiveSettings=d.receiveSettings,this.emitDailyJSEvent({action:d.action,receiveSettings:d.receiveSettings}));break;case tw:if(!Dt(this._inputSettings,d.inputSettings)){var vt=this._getInputSettings();this._inputSettings=d.inputSettings,this._preloadCache.inputSettings={},Dt(vt,this._getInputSettings())||this.emitDailyJSEvent({action:d.action,inputSettings:this._getInputSettings()})}break;case"send-settings-updated":Dt(this._sendSettings,d.sendSettings)||(this._sendSettings=d.sendSettings,this._preloadCache.sendSettings=null,this.emitDailyJSEvent({action:d.action,sendSettings:d.sendSettings}));break;case"local-audio-level":this._localAudioLevel=d.audioLevel,this._preloadCache.localAudioLevelObserver=null,this.emitDailyJSEvent(d);break;case"remote-participants-audio-level":this._remoteParticipantsAudioLevel=d.participantsAudioLevel,this._preloadCache.remoteParticipantsAudioLevelObserver=null,this.emitDailyJSEvent(d);break;case N0:var fn=d.session_id;this._rmpPlayerState[fn]=d.playerState,this.emitDailyJSEvent(d);break;case U0:delete this._rmpPlayerState[d.session_id],this.emitDailyJSEvent(d);break;case F0:var jn=d.session_id,ur=this._rmpPlayerState[jn];ur&&this.compareEqualForRMPUpdateEvent(ur,d.remoteMediaPlayerState)||(this._rmpPlayerState[jn]=d.remoteMediaPlayerState,this.emitDailyJSEvent(d));break;case"custom-button-click":case"sidebar-view-changed":this.emitDailyJSEvent(d);break;case k0:var Ur=this._meetingSessionState.topology!==(d.meetingSessionState&&d.meetingSessionState.topology);this._meetingSessionState=$u(d.meetingSessionState,this._callObjectMode),(this._callObjectMode||Ur)&&this.emitDailyJSEvent(d);break;case B0:this._isScreenSharing=!0,this.emitDailyJSEvent(d);break;case z0:case $0:this._isScreenSharing=!1,this.emitDailyJSEvent(d);break;case Jh:case Hh:case L0:case D0:case I0:case P0:case x0:case O0:case d0:case f0:case j0:case R0:case"test-completed":case H0:case A0:case Y0:case Q0:case K0:case X0:case Gh:case Z0: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(d);break;case"request-fullscreen":this.requestFullscreen();break;case"request-exit-fullscreen":this.exitFullscreen()}}},{key:"maybeEventRecordingStopped",value:function(d,m){var g="record";d&&(m.local||m[g]!==!1||d[g]===m[g]||this.emitDailyJSEvent({action:Hh}))}},{key:"maybeEventRecordingStarted",value:function(d,m){var g="record";d&&(m.local||m[g]!==!0||d[g]===m[g]||this.emitDailyJSEvent({action:Jh}))}},{key:"maybeEventTrackStopped",value:function(d,m,g,C){d&&(d.readyState!=="ended"&&m&&d.id===m.id||this.emitDailyJSEvent({action:M0,track:d,participant:g,type:C}))}},{key:"maybeEventTrackStarted",value:function(d,m,g,C){m&&(d&&d.readyState!=="ended"&&m.id===d.id||this.emitDailyJSEvent({action:T0,track:m,participant:g,type:C}))}},{key:"maybeParticipantTracksStopped",value:function(d,m){if(d)for(var g in d.tracks)this.maybeEventTrackStopped(d.tracks[g].track,m&&m.tracks[g]?m.tracks[g].track:null,m,g)}},{key:"maybeParticipantTracksStarted",value:function(d,m){if(m)for(var g in m.tracks)this.maybeEventTrackStarted(d&&d.tracks[g]?d.tracks[g].track:null,m.tracks[g].track,m,g)}},{key:"compareEqualForRMPUpdateEvent",value:function(d,m){var g,C;return d.state===m.state&&((g=d.settings)===null||g===void 0?void 0:g.volume)===((C=m.settings)===null||C===void 0?void 0:C.volume)}},{key:"emitDailyJSEvent",value:function(d){try{d.callClientId=this.callClientId,this.emit(d.action,d)}catch(m){console.log("could not emit",d,m)}}},{key:"compareEqualForParticipantUpdateEvent",value:function(d,m){return!!Dt(d,m)&&(!d.videoTrack||!m.videoTrack||d.videoTrack.id===m.videoTrack.id&&d.videoTrack.muted===m.videoTrack.muted&&d.videoTrack.enabled===m.videoTrack.enabled)&&(!d.audioTrack||!m.audioTrack||d.audioTrack.id===m.audioTrack.id&&d.audioTrack.muted===m.audioTrack.muted&&d.audioTrack.enabled===m.audioTrack.enabled)}},{key:"nativeUtils",value:function(){return Ae()?typeof DailyNativeUtils>"u"?(console.warn("in React Native, DailyNativeUtils is expected to be available"),null):DailyNativeUtils:null}},{key:"updateIsPreparingToJoin",value:function(d){this._updateCallState(this._callState,d)}},{key:"_updateCallState",value:function(d){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._isPreparingToJoin;if(d!==this._callState||m!==this._isPreparingToJoin){var g=this._callState,C=this._isPreparingToJoin;this._callState=d,this._isPreparingToJoin=m;var k=us(g,C),U=us(this._callState,this._isPreparingToJoin);k!==U&&(this.updateKeepDeviceAwake(U),this.updateDeviceAudioMode(U),this.updateShowAndroidOngoingMeetingNotification(U),this.updateNoOpRecordingEnsuringBackgroundContinuity(U))}}},{key:"resetMeetingDependentVars",value:function(){this._participants={},this._participantCounts=yv,this._waitingParticipants={},this._activeSpeaker={},this._activeSpeakerMode=!1,this._didPreAuth=!1,this._accessState={access:Iu},this._finalSummaryOfPrevSession=this._meetingSessionSummary,this._meetingSessionSummary={},this._meetingSessionState=$u(gv,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=Au,this._callMachineInitialized=!1,this._bundleLoadTime=void 0,this._preloadCache}},{key:"updateKeepDeviceAwake",value:function(d){Ae()&&this.nativeUtils().setKeepDeviceAwake(d,this.callClientId)}},{key:"updateDeviceAudioMode",value:function(d){if(Ae()&&!this.disableReactNativeAutoDeviceManagement("audio")){var m=d?this._nativeInCallAudioMode:"idle";this.nativeUtils().setAudioMode(m)}}},{key:"updateShowAndroidOngoingMeetingNotification",value:function(d){if(Ae()&&this.nativeUtils().setShowOngoingMeetingNotification){var m,g,C,k;if(this.properties.reactNativeConfig&&this.properties.reactNativeConfig.androidInCallNotification){var U=this.properties.reactNativeConfig.androidInCallNotification;m=U.title,g=U.subtitle,C=U.iconName,k=U.disableForCustomOverride}k&&(d=!1),this.nativeUtils().setShowOngoingMeetingNotification(d,m,g,C,this.callClientId)}}},{key:"updateNoOpRecordingEnsuringBackgroundContinuity",value:function(d){Ae()&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity&&this.nativeUtils().enableNoOpRecordingEnsuringBackgroundContinuity(d)}},{key:"toggleParticipantAudioBasedOnNativeAudioFocus",value:function(){var d,m;if(Ae()){var g=(d=this._callMachine())===null||d===void 0||(m=d.store)===null||m===void 0?void 0:m.getState();for(var C in g==null?void 0:g.streams){var k=g.streams[C];k&&k.pendingTrack&&k.pendingTrack.kind==="audio"&&(k.pendingTrack.enabled=this._hasNativeAudioFocus)}}}},{key:"disableReactNativeAutoDeviceManagement",value:function(d){return this.properties.reactNativeConfig&&this.properties.reactNativeConfig.disableAutoDeviceManagement&&this.properties.reactNativeConfig.disableAutoDeviceManagement[d]}},{key:"absoluteUrl",value:function(d){if(d!==void 0){var m=document.createElement("a");return m.href=d,m.href}}},{key:"sayHello",value:function(){var d="hello, world.";return console.log(d),d}},{key:"_logUseAfterDestroy",value:function(){var d=Object.values(Cr)[0];if(this.needsLoad())if(d&&!d.needsLoad()){var m={action:ns,level:"error",code:this.strictMode?9995:9997};d.sendMessageToCallMachine(m)}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 g={action:ns,level:"error",code:this.strictMode?9995:9997};this._messageChannel.sendMessageToCallMachine(g,null,this.callClientId,this._iframe)}}},{key:"_logDuplicateInstanceAttempt",value:function(){for(var d=0,m=Object.values(Cr);d0&&arguments[0]!==void 0?arguments[0]:{};return d.layout="none",new fe(null,d)}},{key:"wrap",value:function(d){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Pe(),!d||!d.contentWindow||typeof d.src!="string")throw new Error("DailyIframe::Wrap needs an iframe-like first argument");return m.layout||(m.customLayout?m.layout="custom-v1":m.layout="browser"),new fe(d,m)}},{key:"createFrame",value:function(d,m){var g,C;Pe(),d&&m?(g=d,C=m):d&&d.append?(g=d,C={}):(g=document.body,C=d||{});var k=C.iframeStyle;k||(k=g===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 U=document.createElement("iframe");window.navigator&&window.navigator.userAgent.match(/Chrome\/61\./)?U.allow="microphone, camera":U.allow="microphone; camera; autoplay; display-capture; screen-wake-lock",U.style.visibility="hidden",g.appendChild(U),U.style.visibility=null,Object.keys(k).forEach(function(ie){return U.style[ie]=k[ie]}),C.layout||(C.customLayout?C.layout="custom-v1":C.layout="browser");try{return new fe(U,C)}catch(ie){throw g.removeChild(U),ie}}},{key:"createTransparentFrame",value:function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Pe();var m=document.createElement("iframe");return m.allow="microphone; camera; autoplay",m.style.cssText=` position: fixed; top: 0; left: 0; width: 100%; height: 100%; border: 0; pointer-events: none; `,document.body.appendChild(m),d.layout||(d.layout="custom-v1"),fe.wrap(m,d)}},{key:"getCallInstance",value:function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0;return d?Cr[d]:Object.values(Cr)[0]}}]),fe}();function ci(r,n){var i={};for(var a in r)if(r[a]instanceof MediaStreamTrack)i[a]=wo;else if(a==="dailyConfig"){if(r[a].modifyLocalSdpHook){var l=window._daily.instances[n].customCallbacks||{};l.modifyLocalSdpHook=r[a].modifyLocalSdpHook,window._daily.instances[n].customCallbacks=l,delete r[a].modifyLocalSdpHook}if(r[a].modifyRemoteSdpHook){var c=window._daily.instances[n].customCallbacks||{};c.modifyRemoteSdpHook=r[a].modifyRemoteSdpHook,window._daily.instances[n].customCallbacks=c,delete r[a].modifyRemoteSdpHook}i[a]=r[a]}else i[a]=r[a];return i}function Be(r){var n=arguments.length>2?arguments[2]:void 0;if(r!==vi){var i="".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method"," only supported after join.");throw n&&(i+=" ".concat(n)),console.error(i),new Error(i)}}function us(r,n){return[uc,vi].includes(r)||n}function Bu(r,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"This daily-js method",a=arguments.length>3?arguments[3]:void 0;if(us(r,n)){var l="".concat(i," not supported after joining a meeting.");throw a&&(l+=" ".concat(a)),console.error(l),new Error(l)}}function os(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method",i=arguments.length>2?arguments[2]:void 0;if(!r){var a="".concat(n,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 i&&(a+=" ".concat(i)),console.error(a),new Error(a)}}function zu(r){if(r){var n="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(n),new Error(n)}}function an(r){if(!r){var n="".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"This daily-js method"," is only supported on custom callObject instances");throw console.error(n),new Error(n)}}function Nt(r){if(r){var n="".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(n),new Error(n)}}function Pe(){if(Ae())throw new Error("This daily-js method is not currently supported in React Native")}function go(){if(!Ae())throw new Error("This daily-js method is only supported in React Native")}function vm(r){if(r===void 0)return!0;var n;if(typeof r=="string")n=r;else try{n=JSON.stringify(r),Dt(JSON.parse(n),r)||console.warn("The userData provided will be modified when serialized.")}catch(i){throw Error("userData must be serializable to JSON: ".concat(i))}if(n.length>4096)throw Error("userData is too large (".concat(n.length," characters). Maximum size suppported is ").concat(4096,"."));return!0}function mm(r,n){for(var i=n.allowAllParticipantsKey,a=function(S){var T=["local"];return i||T.push("*"),S&&!T.includes(S)},l=function(S){return!!(S.layer===void 0||Number.isInteger(S.layer)&&S.layer>=0||S.layer==="inherit")},c=function(S){return!!S&&!(S.video&&!l(S.video))&&!(S.screenVideo&&!l(S.screenVideo))},p=0,v=Object.entries(r);p1||h[0]!=="strength"?(console.error(_),!1):!(typeof v.strength!="number"||v.strength<=0||v.strength>1||isNaN(v.strength))||(console.error("".concat(_,"; expected: {0 < strength <= 1}, got: ").concat(v.strength)),!1);case ls.BGIMAGE:return!(v.source!==void 0&&!function(w){if(w.source==="default")return w.type="default",!0;if(w.source instanceof ArrayBuffer)return!0;if(Po(w.source))return w.type="url",!!function(M){var L=new URL(M),O=L.pathname;if(L.protocol==="data:")try{var R=O.substring(O.indexOf(":")+1,O.indexOf(";")).split("/")[1];return Ru.includes(R)}catch(ne){return console.error("failed to deduce blob content type",ne),!1}var W=O.split(".").at(-1).toLowerCase().trim();return Ru.includes(W)}(w.source)||(console.error("invalid image type; supported types: [".concat(Ru.join(", "),"]")),!1);return S=w.source,T=Number(S),isNaN(T)||!Number.isInteger(T)||T<=0||T>Xh?(console.error("invalid image selection; must be an int, > 0, <= ".concat(Xh)),!1):(w.type="daily-preselect",!0);var S,T}(v));default:return!0}}(l.type,l.config))?!1:(Object.keys(l).filter(function(p){return!c.includes(p)}).forEach(function(p){console.warn("invalid key inputSettings -> video -> processor : ".concat(p)),delete l[p]}),!0)}(r.video.processor)))&&!(r.audio&&(Fe(r.audio)!=="object"||(i=r.audio.processor,a=["type"],!i||Fe(i)!=="object"||(Object.keys(i).filter(function(l){return!a.includes(l)}).forEach(function(l){console.warn("invalid key inputSettings -> audio -> processor : ".concat(l)),delete i[l]}),n=i.type,typeof n!="string"||!Object.values(om).includes(n)&&(console.error("inputSettings audio processor type invalid"),1)))));var n,i,a}function ym(r,n){var i,a=[];r.video&&!sm((i=n==null?void 0:n.useLegacyVideoProcessor)!==null&&i!==void 0&&i)&&(delete r.video,a.push("video")),r.audio&&!lm()&&(delete r.audio,a.push("audio")),a.length>0&&console.error("Ignoring settings for browser- or platform-unsupported input processor(s): ".concat(a.join(", ")))}function mc(){var r=Object.values(ls).join(" | "),n=Object.values(om).join(" | ");return"inputSettings must be of the form: { video?: { processor: { type: [ ".concat(r," ], config?: {} } }, audio?: { processor: {type: [ ").concat(n," ] } } }")}function _m(r){var n=r.allowAllParticipantsKey;return"receiveSettings must be of the form { [ | ".concat(i0).concat(n?' | "'.concat(o0,'"'):"","]: ")+'{ [video: [{ layer: [ | "inherit"] } | "inherit"]], [screenVideo: [{ layer: [ | "inherit"] } | "inherit"]] }}}'}function wm(){return"customIntegrations should be an object of type ".concat(JSON.stringify(vc),".")}function Sm(r){if(r&&Fe(r)!=="object"||Array.isArray(r))return console.error("customTrayButtons should be an Object of the type ".concat(JSON.stringify(Ss),".")),!1;if(r)for(var n=0,i=Object.entries(r);n2)throw new Error("RemoteMediaPlayerSettings.volume: must be between 0.0 - 2.0")}}function Ev(r,n,i){return!(typeof r!="number"||ri)}function $u(r,n){return r&&!n&&delete r.data,r}class Dw{log(n,i,...a){const l=this.formatMessage(i);switch(n){case"info":console.info(l,...a);break;case"warn":console.warn(l,...a);break;case"error":console.error(l,...a);break;default:console.log(l,...a);break}}info(n,...i){this.log("info",n,...i)}warn(n,...i){this.log("warn",n,...i)}error(n,...i){this.log("error",n,...i)}formatMessage(n){return typeof n=="string"?n:JSON.stringify(n)}}const wt=new Dw,Iw="https://hackathon-test.fly.dev";class Aw{constructor(n){Pn(this,"apiUrl");this.apiUrl=n}async fetchWithOptionalAuth(n,i={},a){const l={...i.headers};a&&(l.Authorization=`Bearer ${a}`);const c=await fetch(n,{...i,headers:l});if(console.log("[ApiClient] Response:",c),!c.ok)throw new Error(`HTTP error! status: ${c.status} ${c.statusText}`);return c.json()}async connectToAi(){const n=this.apiUrl+"/get_daily_url_token";try{const i=await this.fetchWithOptionalAuth(n,{method:"GET",headers:{"Content-Type":"application/json"}}),a=i.daily_url,l=i.daily_token;return wt.info("Response from connect to ai:",i),{daily_url:a,daily_token:l}}catch(i){throw wt.error("Failed to connect to ai:",i),i}}async connectToAiPool(n,i){const a=this.apiUrl+"/connect";return await this.fetchWithOptionalAuth(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({daily_room_url:n,daily_token:i})})}}const Cv=new Aw(Iw),Ln=class Ln{constructor(n={}){Pn(this,"dailyCall",null);Pn(this,"state","idle");Pn(this,"dailyUrl");Pn(this,"dailyToken");Pn(this,"localJoined",!1);Pn(this,"aiJoined",!1);this.callbacks=n,Ln.activeInstance&&Ln.activeInstance.disconnect(),Ln.activeInstance=this}static cleanup(){Ln.activeInstance&&(Ln.activeInstance.disconnect(),Ln.activeInstance=null)}async init(){throw new Error("Not implemented")}async connect(){this.setState("connecting");try{const n=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},video:!1}),i=await Cv.connectToAi();if(this.dailyUrl=i.daily_url,this.dailyToken=i.daily_token,!this.dailyUrl||!this.dailyToken)throw new Error("Failed to get daily_url or daily_token");this.dailyCall&&(await this.dailyCall.leave(),await this.dailyCall.destroy(),this.dailyCall=null),this.dailyCall=So.createCallObject({url:this.dailyUrl,token:this.dailyToken,audioSource:n.getAudioTracks()[0],subscribeToTracksAutomatically:!0}),this.setupDailyEvents(this.dailyCall),await this.dailyCall.join(),await this.dailyCall.setLocalAudio(!0);const a=this.dailyCall.participants(),l=Object.keys(a).length;console.log("[TransportClient] participantCount:",l),l<=1?(wt.info("[TransportClient] No other participants found, connecting AI"),await Cv.connectToAiPool(this.dailyUrl,this.dailyToken)):wt.info("[TransportClient] Other participants found, skipping AI connection")}catch(n){throw wt.error("[TransportClient] connect failed:",n),this.setState("error",n.message),n}}startScreenShare(){if(this.dailyCall)try{this.dailyCall.startScreenShare(),wt.info("[TransportClient] Screen share started successfully")}catch(n){if(n instanceof Error&&n.name==="NotAllowedError")wt.info("[TransportClient] User denied screen share permission");else throw n}}async stopScreenShare(){this.dailyCall&&this.dailyCall.stopScreenShare()}disconnect(){try{this.dailyCall&&(this.dailyCall.leave(),this.dailyCall.destroy(),this.dailyCall=null),this.localJoined=!1,this.aiJoined=!1,this.dailyUrl=void 0,this.dailyToken=void 0,this.setState("disconnected")}catch(n){wt.error("[TransportClient] error on disconnect:",n)}}sendAppMessage(n){if(!this.dailyCall){wt.warn("[TransportClient] can't send message - dailyCall null");return}const i=JSON.stringify(n);this.dailyCall.sendAppMessage(i)}maybeSetConnectedState(){this.localJoined&&this.aiJoined&&(this.setState("connected"),wt.info("[TransportClient] AI is connected!"))}setupDailyEvents(n){n.on("joined-meeting",()=>{wt.info("[TransportClient] local user joined meeting"),this.localJoined=!0,this.maybeSetConnectedState()}),n.on("participant-joined",i=>{var l,c;const a=i.participant;wt.info("[TransportClient] participant joined:",a,a.user_name),console.log("[TransportClient] participants:",n.participants()),a.local||this.isAiParticipant(a)&&(wt.info("[TransportClient] recognized AI participant joined:",a.user_name),this.aiJoined=!0,this.maybeSetConnectedState()),(c=(l=this.callbacks).onParticipantJoined)==null||c.call(l,a)}),n.on("participant-left",i=>{var l,c;const a=i.participant;wt.info("[TransportClient] participant left:",a,a.user_name),this.isAiParticipant(a)&&(this.aiJoined=!1),(c=(l=this.callbacks).onParticipantLeft)==null||c.call(l,a)}),n.on("track-started",i=>{var c,p,v,h,_,w;const{participant:a,track:l}=i;a&&l&&(console.log("[TransportClient] track-started",a,l.kind,"is local:",a.local),l.kind==="audio"?(p=(c=this.callbacks).onAudioTrackStarted)==null||p.call(c,a,l):l.kind==="video"&&((h=(v=this.callbacks).onVideoTrackStarted)==null||h.call(v,a,l)),(w=(_=this.callbacks).onTrackStarted)==null||w.call(_,a,l))}),n.on("track-stopped",i=>{var c,p,v,h,_,w;const{participant:a,track:l}=i;a&&l&&(console.log("[TransportClient] track-stopped",a,l.kind,"is local:",a.local),l.kind==="audio"?(p=(c=this.callbacks).onAudioTrackStopped)==null||p.call(c,a,l):l.kind==="video"&&((h=(v=this.callbacks).onVideoTrackStopped)==null||h.call(v,a,l)),(w=(_=this.callbacks).onTrackStopped)==null||w.call(_,a,l))}),n.on("app-message",i=>{var c,p;const{data:a,fromId:l}=i;(p=(c=this.callbacks).onCustomMessage)==null||p.call(c,a,l)}),n.on("error",i=>{wt.error("[TransportClient] daily error:",i.errorMsg),this.setState("error",i.errorMsg)}),n.on("local-screen-share-started",i=>{wt.info("[TransportClient] Screen share started:",i)})}isAiParticipant(n){return n.user_name}setState(n,i){var a,l;this.state=n,(l=(a=this.callbacks).onStateChange)==null||l.call(a,n,i)}getState(){return this.state}};Pn(Ln,"activeInstance",null);let gc=Ln;const qt={BASE_URL:"./",DEV:!1,MODE:"production",PROD:!0,SSR:!1};let jw=0;function Ie(r,n){const i=`atom${++jw}`,a={toString(){return(qt?"production":void 0)!=="production"&&this.debugLabel?i+":"+this.debugLabel:i}};return typeof r=="function"?a.read=r:(a.init=r,a.read=Rw,a.write=Nw),n&&(a.write=n),a}function Rw(r){return r(this)}function Nw(r,n,i){return n(this,typeof i=="function"?i(r(this)):i)}const bv=(r,n)=>r.unstable_is?r.unstable_is(n):n===r,Vu=r=>"init"in r,Wu=r=>!!r.write,ks=new WeakMap,yc=r=>{var n;return _c(r)&&!((n=ks.get(r))!=null&&n[1])},Fw=(r,n)=>{const i=ks.get(r);if(i)i[1]=!0,i[0].forEach(a=>a(n));else if((qt?"production":void 0)!=="production")throw new Error("[Bug] cancelable promise not found")},Uw=r=>{if(ks.has(r))return;const n=[new Set,!1];ks.set(r,n);const i=()=>{n[1]=!0};r.then(i,i),r.onCancel=a=>{n[0].add(a)}},_c=r=>typeof(r==null?void 0:r.then)=="function",Tv=r=>"v"in r||"e"in r,as=r=>{if("e"in r)throw r.e;if((qt?"production":void 0)!=="production"&&!("v"in r))throw new Error("[Bug] atom state is not initialized");return r.v},Cm=(r,n,i)=>{i.p.has(r)||(i.p.add(r),n.then(()=>{i.p.delete(r)},()=>{i.p.delete(r)}))},Mv=(r,n,i,a,l)=>{var c;if((qt?"production":void 0)!=="production"&&a===n)throw new Error("[Bug] atom cannot depend on itself");i.d.set(a,l.n),yc(i.v)&&Cm(n,i.v,l),(c=l.m)==null||c.t.add(n),r&&Bw(r,a,n)},di=()=>[new Map,new Map,new Set],Ju=(r,n,i)=>{r[0].has(n)||r[0].set(n,new Set),r[1].set(n,i)},Bw=(r,n,i)=>{const a=r[0].get(n);a&&a.add(i)},zw=(r,n)=>r[0].get(n),Pv=(r,n)=>{r[2].add(n)},nr=r=>{let n,i=!1;const a=l=>{try{l()}catch(c){i||(n=c,i=!0)}};for(;r[1].size||r[2].size;){r[0].clear();const l=new Set(r[1].values());r[1].clear();const c=new Set(r[2]);r[2].clear(),l.forEach(p=>{var v;return(v=p.m)==null?void 0:v.l.forEach(a)}),c.forEach(a)}if(i)throw n},bm=(...[r,n,i,a])=>{let l;(qt?"production":void 0)!=="production"&&(l=new Set);const c=(K,G,N)=>{const I="v"in G,F=G.v,z=yc(G.v)?G.v:null;if(_c(N)){Uw(N);for(const X of G.d.keys())Cm(K,N,r(X));G.v=N,delete G.e}else G.v=N,delete G.e;(!I||!Object.is(F,G.v))&&(++G.n,z&&Fw(z,N))},p=(K,G,N)=>{var I;const F=r(G);if(Tv(F)&&(F.m&&!(N!=null&&N.has(G))||Array.from(F.d).every(([Y,he])=>p(K,Y,N).n===he)))return F;F.d.clear();let z=!0;const X=Y=>{if(bv(G,Y)){const ke=r(Y);if(!Tv(ke))if(Vu(Y))c(Y,ke,Y.init);else throw new Error("no atom init");return as(ke)}const he=p(K,Y,N);try{return as(he)}finally{if(z)Mv(K,G,F,Y,he);else{const ke=di();Mv(ke,G,F,Y,he),M(ke,G,F),nr(ke)}}};let te,pe;const ae={get signal(){return te||(te=new AbortController),te.signal},get setSelf(){return(qt?"production":void 0)!=="production"&&!Wu(G)&&console.warn("setSelf function cannot be used with read-only atom"),!pe&&Wu(G)&&(pe=(...Y)=>{if((qt?"production":void 0)!=="production"&&z&&console.warn("setSelf function cannot be called in sync"),!z)return T(G,...Y)}),pe}};try{const Y=n(G,X,ae);if(c(G,F,Y),_c(Y)){(I=Y.onCancel)==null||I.call(Y,()=>te==null?void 0:te.abort());const he=()=>{if(F.m){const ke=di();M(ke,G,F),nr(ke)}};Y.then(he,he)}return F}catch(Y){return delete F.v,F.e=Y,++F.n,F}finally{z=!1}},v=K=>as(p(void 0,K)),h=(K,G,N)=>{var I,F;const z=new Map;for(const X of((I=N.m)==null?void 0:I.t)||[])z.set(X,r(X));for(const X of N.p)z.set(X,r(X));return(F=zw(K,G))==null||F.forEach(X=>{z.set(X,r(X))}),z};function _(K,G,N){const I=[],F=new Set,z=new Set,X=[[G,N]];for(;X.length>0;){const[te,pe]=X[X.length-1];if(z.has(te)){X.pop();continue}if(F.has(te)){I.push([te,pe,pe.n]),z.add(te),X.pop();continue}F.add(te);for(const[ae,Y]of h(K,te,pe))te!==ae&&!F.has(ae)&&X.push([ae,Y])}return[I,z]}const w=(K,G,N)=>{const[I,F]=_(K,G,N),z=new Set([G]);for(let X=I.length-1;X>=0;--X){const[te,pe,ae]=I[X];let Y=!1;for(const he of pe.d.keys())if(he!==te&&z.has(he)){Y=!0;break}Y&&(p(K,te,F),M(K,te,pe),ae!==pe.n&&(Ju(K,te,pe),z.add(te))),F.delete(te)}},S=(K,G,...N)=>{let I=!0;const F=X=>as(p(K,X)),z=(X,...te)=>{const pe=r(X);try{if(bv(G,X)){if(!Vu(X))throw new Error("atom not writable");const ae=pe.n,Y=te[0];c(X,pe,Y),M(K,X,pe),ae!==pe.n&&(Ju(K,X,pe),w(K,X,pe));return}else return S(K,X,...te)}finally{I||nr(K)}};try{return i(G,F,z,...N)}finally{I=!1}},T=(K,...G)=>{const N=di();try{return S(N,K,...G)}finally{nr(N)}},M=(K,G,N)=>{if(N.m&&!yc(N.v)){for(const I of N.d.keys())N.m.d.has(I)||(L(K,I,r(I)).t.add(G),N.m.d.add(I));for(const I of N.m.d||[])if(!N.d.has(I)){N.m.d.delete(I);const F=O(K,I,r(I));F==null||F.t.delete(G)}}},L=(K,G,N)=>{if(!N.m){p(K,G);for(const I of N.d.keys())L(K,I,r(I)).t.add(G);if(N.m={l:new Set,d:new Set(N.d.keys()),t:new Set},(qt?"production":void 0)!=="production"&&l.add(G),Wu(G)){const I=N.m;let F;const z=(X,te)=>{let pe=!0;F=(...ae)=>{try{return S(X,G,...ae)}finally{pe||nr(X)}};try{return te()}finally{pe=!1}};Pv(K,()=>{const X=z(K,()=>a(G,(...te)=>F(...te)));X&&(I.u=te=>z(te,X))})}}return N.m},O=(K,G,N)=>{if(N.m&&!N.m.l.size&&!Array.from(N.m.t).some(I=>{var F;return(F=r(I).m)==null?void 0:F.d.has(G)})){const I=N.m.u;I&&Pv(K,()=>I(K)),delete N.m,(qt?"production":void 0)!=="production"&&l.delete(G);for(const F of N.d.keys()){const z=O(K,F,r(F));z==null||z.t.delete(G)}return}return N.m},ne={get:v,set:T,sub:(K,G)=>{const N=di(),I=r(K),z=L(N,K,I).l;return z.add(G),nr(N),()=>{z.delete(G);const X=di();O(X,K,I),nr(X)}},unstable_derive:K=>bm(...K(r,n,i,a))};return(qt?"production":void 0)!=="production"&&Object.assign(ne,{dev4_get_internal_weak_map:()=>({get:G=>{const N=r(G);if(N.n!==0)return N}}),dev4_get_mounted_atoms:()=>l,dev4_restore_atoms:G=>{const N=di();for(const[I,F]of G)if(Vu(I)){const z=r(I),X=z.n;c(I,z,F),M(N,I,z),X!==z.n&&(Ju(N,I,z),w(N,I,z))}nr(N)}}),ne},Tm=()=>{const r=new WeakMap;return bm(i=>{if((qt?"production":void 0)!=="production"&&!i)throw new Error("Atom is undefined or null");let a=r.get(i);return a||(a={d:new Map,p:new Set,n:0},r.set(i,a)),a},(i,...a)=>i.read(...a),(i,...a)=>i.write(...a),(i,...a)=>{var l;return(l=i.onMount)==null?void 0:l.call(i,...a)})};let yo;const $w=()=>(yo||(yo=Tm(),(qt?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=yo),globalThis.__JOTAI_DEFAULT_STORE__!==yo&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),yo),Vw={BASE_URL:"./",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function Ds(r,n){let i=null;const a=new Map,l=new Set,c=v=>{let h;if(h=a.get(v),h!==void 0)if(i!=null&&i(h[1],v))c.remove(v);else return h[0];const _=r(v);return a.set(v,[_,Date.now()]),p("CREATE",v,_),_};function p(v,h,_){for(const w of l)w({type:v,param:h,atom:_})}return c.unstable_listen=v=>(l.add(v),()=>{l.delete(v)}),c.getParams=()=>a.keys(),c.remove=v=>{{if(!a.has(v))return;const[h]=a.get(v);a.delete(v),p("REMOVE",v,h)}},c.setShouldRemove=v=>{if(i=v,!!i)for(const[h,[_,w]]of a)i(w,h)&&(a.delete(h),p("REMOVE",h,_))},c}const Ww=r=>typeof(r==null?void 0:r.then)=="function";function Jw(r=()=>{try{return window.localStorage}catch(i){(Vw?"production":void 0)!=="production"&&typeof window<"u"&&console.warn(i);return}},n){var i;let a,l;const c={getItem:(h,_)=>{var w,S;const T=L=>{if(L=L||"",a!==L){try{l=JSON.parse(L,n==null?void 0:n.reviver)}catch{return _}a=L}return l},M=(S=(w=r())==null?void 0:w.getItem(h))!=null?S:null;return Ww(M)?M.then(T):T(M)},setItem:(h,_)=>{var w;return(w=r())==null?void 0:w.setItem(h,JSON.stringify(_,void 0))},removeItem:h=>{var _;return(_=r())==null?void 0:_.removeItem(h)}},p=h=>(_,w,S)=>h(_,T=>{let M;try{M=JSON.parse(T||"")}catch{M=S}w(M)});let v;try{v=(i=r())==null?void 0:i.subscribe}catch{}return!v&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(v=(h,_)=>{if(!(r()instanceof window.Storage))return()=>{};const w=S=>{S.storageArea===r()&&S.key===h&&_(S.newValue)};return window.addEventListener("storage",w),()=>{window.removeEventListener("storage",w)}}),v&&(c.subscribe=p(v)),c}Jw();const Mm={BASE_URL:"./",DEV:!1,MODE:"production",PROD:!0,SSR:!1},Pm=B.createContext(void 0),xm=r=>B.useContext(Pm)||$w(),Hw=({children:r,store:n})=>{const i=B.useRef();return!n&&!i.current&&(i.current=Tm()),B.createElement(Pm.Provider,{value:n||i.current},r)},Om=r=>typeof(r==null?void 0:r.then)=="function",Gw=r=>{r.status="pending",r.then(n=>{r.status="fulfilled",r.value=n},n=>{r.status="rejected",r.reason=n})},qw=xe.use||(r=>{if(r.status==="pending")throw r;if(r.status==="fulfilled")return r.value;throw r.status==="rejected"?r.reason:(Gw(r),r)}),Hu=new WeakMap,Yw=r=>{let n=Hu.get(r);return n||(n=new Promise((i,a)=>{let l=r;const c=h=>_=>{l===h&&i(_)},p=h=>_=>{l===h&&a(_)},v=h=>{"onCancel"in h&&typeof h.onCancel=="function"&&h.onCancel(_=>{if((Mm?"production":void 0)!=="production"&&_===h)throw new Error("[Bug] p is not updated even after cancelation");Om(_)?(Hu.set(_,n),l=_,_.then(c(_),p(_)),v(_)):i(_)})};r.then(c(r),p(r)),v(r)}),Hu.set(r,n)),n};function Nr(r,n){const i=xm(),[[a,l,c],p]=B.useReducer(_=>{const w=i.get(r);return Object.is(_[0],w)&&_[1]===i&&_[2]===r?_:[w,i,r]},void 0,()=>[i.get(r),i,r]);let v=a;if((l!==i||c!==r)&&(p(),v=i.get(r)),B.useEffect(()=>{const _=i.sub(r,()=>{p()});return p(),_},[i,r,void 0]),B.useDebugValue(v),Om(v)){const _=Yw(v);return qw(_)}return v}function Qw(r,n){const i=xm();return B.useCallback((...l)=>{if((Mm?"production":void 0)!=="production"&&!("write"in r))throw new Error("not writable atom");return i.set(r,...l)},[i,r])}function Me(r,n){const i=B.useMemo(()=>Ie(null,(a,l,...c)=>r(a,l,...c)),[r]);return Qw(i)}var Gu,xv;function Kw(){if(xv)return Gu;xv=1;var r="Expected a function",n=NaN,i="[object Symbol]",a=/^\s+|\s+$/g,l=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,p=/^0o[0-7]+$/i,v=parseInt,h=typeof Wa=="object"&&Wa&&Wa.Object===Object&&Wa,_=typeof self=="object"&&self&&self.Object===Object&&self,w=h||_||Function("return this")(),S=Object.prototype,T=S.toString,M=Math.max,L=Math.min,O=function(){return w.Date.now()};function R(I,F,z){var X,te,pe,ae,Y,he,ke=0,Le=!1,Ee=!1,Z=!0;if(typeof I!="function")throw new TypeError(r);F=N(F)||0,ne(z)&&(Le=!!z.leading,Ee="maxWait"in z,pe=Ee?M(N(z.maxWait)||0,F):pe,Z="trailing"in z?!!z.trailing:Z);function re(C){var k=X,U=te;return X=te=void 0,ke=C,ae=I.apply(U,k),ae}function q(C){return ke=C,Y=setTimeout(ge,F),Le?re(C):ae}function x(C){var k=C-he,U=C-ke,ie=F-k;return Ee?L(ie,pe-U):ie}function $(C){var k=C-he,U=C-ke;return he===void 0||k>=F||k<0||Ee&&U>=pe}function ge(){var C=O();if($(C))return fe(C);Y=setTimeout(ge,x(C))}function fe(C){return Y=void 0,Z&&X?re(C):(X=te=void 0,ae)}function d(){Y!==void 0&&clearTimeout(Y),ke=0,X=he=te=Y=void 0}function m(){return Y===void 0?ae:fe(O())}function g(){var C=O(),k=$(C);if(X=arguments,te=this,he=C,k){if(Y===void 0)return q(he);if(Ee)return Y=setTimeout(ge,F),re(he)}return Y===void 0&&(Y=setTimeout(ge,F)),ae}return g.cancel=d,g.flush=m,g}function W(I,F,z){var X=!0,te=!0;if(typeof I!="function")throw new TypeError(r);return ne(z)&&(X="leading"in z?!!z.leading:X,te="trailing"in z?!!z.trailing:te),R(I,F,{leading:X,maxWait:F,trailing:te})}function ne(I){var F=typeof I;return!!I&&(F=="object"||F=="function")}function K(I){return!!I&&typeof I=="object"}function G(I){return typeof I=="symbol"||K(I)&&T.call(I)==i}function N(I){if(typeof I=="number")return I;if(G(I))return n;if(ne(I)){var F=typeof I.valueOf=="function"?I.valueOf():I;I=ne(F)?F+"":F}if(typeof I!="string")return I===0?I:+I;I=I.replace(a,"");var z=c.test(I);return z||p.test(I)?v(I.slice(2),z?2:8):l.test(I)?n:+I}return Gu=W,Gu}var Xw=Kw();const Zw=Pc(Xw);function Ov(r,n,i,a,l,c,p){try{var v=r[c](p),h=v.value}catch(_){i(_);return}v.done?n(h):Promise.resolve(h).then(a,l)}function Mi(r){return function(){var n=this,i=arguments;return new Promise(function(a,l){var c=r.apply(n,i);function p(h){Ov(c,a,l,p,v,"next",h)}function v(h){Ov(c,a,l,p,v,"throw",h)}p(void 0)})}}function rt(){return rt=Object.assign?Object.assign.bind():function(r){for(var n=1;n=0)&&(i[l]=r[l]);return i}function eS(r,n){if(r){if(typeof r=="string")return Lv(r,n);var i=Object.prototype.toString.call(r).slice(8,-1);if(i==="Object"&&r.constructor&&(i=r.constructor.name),i==="Map"||i==="Set")return Array.from(r);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Lv(r,n)}}function Lv(r,n){(n==null||n>r.length)&&(n=r.length);for(var i=0,a=new Array(n);i=r.length?{done:!0}:{done:!1,value:r[a++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Dm=B.createContext(null),Fr=function(){var n=B.useContext(Dm);return B.useDebugValue(n),n},Vc=B.createContext({on:function(){},off:function(){}}),tS=-1,wc=function(){return tS--},nS=1,Sc=function(){return nS++},Se=function(n,i,a){a===void 0&&(a=!1);var l=B.useContext(Vc),c=l.off,p=l.on,v=B.useState(!1),h=v[0],_=v[1],w=B.useRef(0),S=B.useMemo(function(){return a?wc():Sc()},[a]);B.useEffect(function(){if(!(!n||h)){if(w.current>1e5){console.error(`useDailyEvent called with potentially non-memoized event callback or due to too many re-renders. Memoize using useCallback to avoid re-render loop or reduce the amount of state transitions the callback depends on. Passed callback for '`+n+"' event is NOT registered.",i),_(!0);return}w.current++;var T=setTimeout(function(){w.current=0},50);return p(n,i,S),function(){clearTimeout(T),c(n,S)}}},[i,n,S,h,c,p]),B.useDebugValue({event:n,eventId:S,isBlocked:h,callback:i})};function ln(r,n){if(r===n)return!0;if(Array.isArray(r)&&Array.isArray(n)){if(r.length!==n.length)return!1;for(var i=0;iw)return 1;if(_=0)return ae[Le]=z,[].concat(ae);var Ee=te.filter(function(q){return ae.includes(q.session_id)&&q.session_id!==R}).sort(function(q,x){var $,ge,fe=($=I(St(q.session_id,"last_active")))!=null?$:new Date("1970-01-01"),d=(ge=I(St(x.session_id,"last_active")))!=null?ge:new Date("1970-01-01");return fe>d?1:fe"u"||typeof((S=navigator)==null||(T=S.mediaDevices)==null?void 0:T.enumerateDevices)>"u"){h(st,"not-supported"),h(lt,"not-supported");return}if(a)try{var M=yield a.enumerateDevices(),L=M.devices,O=L.filter(function(z){return z.kind==="videoinput"&&z.deviceId!==""}),R=L.filter(function(z){return z.kind==="audioinput"&&z.deviceId!==""}),W=L.filter(function(z){return z.kind==="audiooutput"&&z.deviceId!==""}),ne=yield a.getInputDevices(),K=ne.camera,G=ne.mic,N=ne.speaker,I=function(X,te,pe){var ae,Y;return{device:te,selected:"deviceId"in X&&te.deviceId===X.deviceId,state:(ae=(Y=pe.find(function(he){return he.device.deviceId===te.deviceId}))==null?void 0:Y.state)!=null?ae:"granted"}},F=function(X,te){return X.device.deviceId==="default"?-1:te.device.deviceId==="default"?1:X.device.labelte.device.label?1:0};h(ds,function(z){return O.filter(Boolean).map(function(X){return I(K,X,z)}).sort(F)}),h(fs,function(z){return R.filter(Boolean).map(function(X){return I(G,X,z)}).sort(F)}),h(Wm,function(z){return W.filter(Boolean).map(function(X){return I(N,X,z)}).sort(F)})}catch{h(st,"not-supported"),h(lt,"not-supported")}});return function(v,h){return p.apply(this,arguments)}}(),[a])),c=Me(B.useCallback(function(){var p=Mi(function*(v,h){var _,w,S,T,M,L,O,R,W,ne,K,G,N,I;if(a){var F=v(st),z=v(lt),X=a.participants();if(X.local){var te=X.local.tracks,pe="prompt",ae="prompt";if(navigator.permissions)try{var Y=yield navigator.permissions.query({name:"camera"});pe=Y.state;var he=yield navigator.permissions.query({name:"microphone"});ae=he.state}catch{}var ke=pe==="prompt"&&["idle","pending"].includes(F)&&te.video.state==="interrupted"&&!te.video.persistentTrack,Le=["idle","pending"].includes(F)&&!te.video.persistentTrack&&!!((_=te.video.off)!=null&&_.byUser),Ee=ae==="prompt"&&["idle","pending"].includes(z)&&te.audio.state==="interrupted"&&!te.audio.persistentTrack,Z=["idle","pending"].includes(z)&&!te.audio.persistentTrack&&!!((w=te.audio.off)!=null&&w.byUser);(S=te.audio)!=null&&(T=S.blocked)!=null&&T.byDeviceInUse?(h(lt,"in-use"),h(fs,function(re){return re.map(function(q){return q.selected?rt({},q,{state:"in-use"}):q})})):(M=te.audio)!=null&&(L=M.blocked)!=null&&L.byDeviceMissing?h(lt,"not-found"):(O=te.audio)!=null&&(R=O.blocked)!=null&&R.byPermissions||ae==="denied"?h(lt,"blocked"):Ee?h(lt,"pending"):Z?h(lt,"idle"):(h(lt,"granted"),h(fs,function(re){return re.map(function(q){return q.selected?rt({},q,{state:"granted"}):q})})),(W=te.video)!=null&&(ne=W.blocked)!=null&&ne.byDeviceInUse?(h(st,"in-use"),h(ds,function(re){return re.map(function(q){return q.selected?rt({},q,{state:"in-use"}):q})})):(K=te.video)!=null&&(G=K.blocked)!=null&&G.byDeviceMissing?h(st,"not-found"):(N=te.video)!=null&&(I=N.blocked)!=null&&I.byPermissions||pe==="denied"?h(st,"blocked"):ke?h(st,"pending"):Le?h(st,"idle"):(h(st,"granted"),h(ds,function(re){return re.map(function(q){return q.selected?rt({},q,{state:"granted"}):q})})),l()}}});return function(v,h){return p.apply(this,arguments)}}(),[a,l]));return Se("participant-updated",B.useCallback(function(p){p.participant.local&&c()},[c])),Se("available-devices-updated",l),Se("selected-devices-updated",l),Se("camera-error",Me(B.useCallback(function(p,v,h){var _,w,S,T,M,L,O;switch(v(Jm,h.error),(_=h.error)==null?void 0:_.type){case"cam-in-use":v(st,"in-use");break;case"mic-in-use":v(lt,"in-use");break;case"cam-mic-in-use":v(st,"in-use"),v(lt,"in-use");break;case"not-found":(w=h.error)!=null&&w.missingMedia.includes("video")&&v(st,"not-found"),(S=h.error)!=null&&S.missingMedia.includes("audio")&&v(lt,"not-found");break;case"permissions":(T=h.error)!=null&&T.blockedMedia.includes("video")&&v(st,"blocked"),(M=h.error)!=null&&M.blockedMedia.includes("audio")&&v(lt,"blocked");break;case"constraints":((L=h.error)==null?void 0:L.reason)==="invalid"?(v(st,"constraints-invalid"),v(lt,"constraints-invalid")):((O=h.error)==null?void 0:O.reason)==="none-specified"&&(v(st,"constraints-none-specified"),v(lt,"constraints-none-specified"));break;case"undefined-mediadevices":v(st,"undefined-mediadevices"),v(lt,"undefined-mediadevices");break;case"unknown":default:v(st,"unknown"),v(lt,"unknown");break}},[]))),Se("started-camera",Me(B.useCallback(function(p,v){v(st,"granted"),v(lt,"granted"),c()},[c]))),xe.createElement(vS.Provider,{value:{refreshDevices:l}},i)},ko=Ie({errorMsg:void 0,isLiveStreaming:!1,layout:void 0});ko.debugLabel=je("live-streaming");var gS=function(n){var i=n.children;return Se("live-streaming-started",Me(B.useCallback(function(a,l,c){l(ko,{isLiveStreaming:!0,layout:c==null?void 0:c.layout})},[]))),Se("live-streaming-stopped",Me(B.useCallback(function(a,l){l(ko,function(c){return rt({},c,{isLiveStreaming:!1,layout:void 0})})},[]))),Se("live-streaming-error",Me(B.useCallback(function(a,l,c){l(ko,function(p){return rt({},p,{errorMsg:c.errorMsg})})},[]))),Se("left-meeting",Me(B.useCallback(function(a,l){l(ko,{errorMsg:void 0,isLiveStreaming:!1,layout:void 0})},[]))),xe.createElement(xe.Fragment,null,i)},Ts=Ie("new");Ts.debugLabel=je("meeting-state");var Ec=Ie(null);Ec.debugLabel=je("meeting-error");var Cc=Ie(null);Cc.debugLabel=je("non-fatal-error");var Eo=Ie({data:void 0,topology:"none"});Eo.debugLabel=je("meeting-session-data");var yS=function(n){var i=n.children,a=Fr(),l=Me(B.useCallback(function(p,v){if(a){var h=a.meetingState();return v(Ts,h),h}},[a]));Se("loading",l),Se("loaded",l),Se("joining-meeting",l),Se("joined-meeting",l),Se("left-meeting",l),Se("error",Me(B.useCallback(function(p,v,h){v(Ec,h),l()},[l]))),Se("nonfatal-error",Me(B.useCallback(function(p,v,h){v(Cc,h)},[])));var c=Me(B.useCallback(function(p,v){a&&v(Eo,a.meetingSessionState())},[a]));return Se("joined-meeting",c),Se("meeting-session-state-updated",Me(B.useCallback(function(p,v,h){v(Eo,h.meetingSessionState)},[]))),Se("left-meeting",Me(B.useCallback(function(p,v){v(Eo,{data:void 0,topology:"none"})},[]))),Se("call-instance-destroyed",Me(B.useCallback(function(p,v){v(Ts,"new"),v(Ec,null),v(Cc,null),v(Eo,{data:void 0,topology:"none"})},[]))),xe.createElement(xe.Fragment,null,i)},pi=Ie("none");pi.debugLabel=je("topology");var bc=Ie(100);bc.debugLabel=je("network-quality");var Tc=Ie("good");Tc.debugLabel=je("network-threshold");var _S=function(n){var i=n.children,a=Fr(),l=Nr(pi),c=Me(B.useCallback(function(){var p=Mi(function*(v,h){if(a){var _=yield a.getNetworkTopology();!_||(_==null?void 0:_.topology)==="none"||h(pi,_.topology)}});return function(v,h){return p.apply(this,arguments)}}(),[a]));return Se("joined-meeting",c),Se("network-connection",Me(B.useCallback(function(p,v,h){switch(h.event){case"connected":h.type==="peer-to-peer"&&v(pi,"peer"),h.type==="sfu"&&v(pi,"sfu");break}},[]))),Se("network-quality-change",Me(B.useCallback(function(p,v,h){v(bc,function(_){return _!==h.quality?h.quality:_}),v(Tc,function(_){return _!==h.threshold?h.threshold:_})},[]))),Se("left-meeting",Me(B.useCallback(function(p,v){v(pi,"none"),v(bc,100),v(Tc,"good")},[]))),B.useEffect(function(){!a||l!=="none"||c()},[a,c,l]),xe.createElement(xe.Fragment,null,i)},Mr=Ie({isLocalParticipantRecorded:!1,isRecording:!1});Mr.debugLabel=je("recording-state");var wS=function(n){var i=n.children,a=Is(),l=Bm({filter:"record"}),c=Me(B.useCallback(function(p,v,h,_){var w=p(Mr),S={isLocalParticipantRecorded:w.isLocalParticipantRecorded,isRecording:w.isRecording,local:w.local,type:w.type},T={isLocalParticipantRecorded:(S==null?void 0:S.type)==="local"||!(S!=null&&S.type)?h:S.isLocalParticipantRecorded,isRecording:(S==null?void 0:S.type)==="local"||!(S!=null&&S.type)?h:S.isRecording,local:((S==null?void 0:S.type)==="local"||!(S!=null&&S.type))&&h?_:S==null?void 0:S.local,type:h?"local":w==null?void 0:w.type};ln(S,T)||v(Mr,rt({},S,T))},[]));return B.useEffect(function(){var p=l.length>0,v=l.includes(a||"local");c(p,v)},[a,c,l]),Se("recording-started",Me(B.useCallback(function(p,v,h){var _=!0;switch(h.type){case"cloud-beta":case"cloud":{var w;a&&((w=h.layout)==null?void 0:w.preset)==="single-participant"&&h.layout.session_id!==a&&(_=!1);break}}v(Mr,{error:!1,isLocalParticipantRecorded:_,isRecording:!0,layout:h==null?void 0:h.layout,local:h==null?void 0:h.local,recordingId:h==null?void 0:h.recordingId,recordingStartedDate:new Date,startedBy:h==null?void 0:h.startedBy,type:h==null?void 0:h.type})},[a]))),Se("recording-stopped",Me(B.useCallback(function(p,v){v(Mr,function(h){return rt({},h,{isLocalParticipantRecorded:!1,isRecording:!1})})},[]))),Se("recording-error",Me(B.useCallback(function(p,v){v(Mr,function(h){return rt({},h,{error:!0,isLocalParticipantRecorded:!1,isRecording:!1})})},[]))),Se("left-meeting",Me(B.useCallback(function(p,v){v(Mr,{isLocalParticipantRecorded:!1,isRecording:!1})},[]))),xe.createElement(xe.Fragment,null,i)},SS=function(){var n=Nr(Ts);return B.useDebugValue(n),n},Mc=Ie(null);Mc.debugLabel=je("room-state");var kS=function(n){var i=n.children,a=Fr(),l=SS(),c=Me(B.useCallback(function(){var p=Mi(function*(v,h){if(!(!a||l==="left-meeting")){var _=yield a.room();return _&&"id"in _&&h(Mc,_),_}});return function(v,h){return p.apply(this,arguments)}}(),[a,l]));return Se("access-state-updated",c),Se("left-meeting",Me(B.useCallback(function(p,v){return function(){v(Mc,null)}},[]))),xe.createElement(xe.Fragment,null,i)},hi=Ie({isTranscribing:!1,model:"general",language:"en",transcriptions:[]});hi.debugLabel=je("transcription-state");var ES=function(n){var i=n.children;return Se("transcription-started",Me(B.useCallback(function(a,l,c){l(hi,{error:!1,transcriptionStartDate:new Date,isTranscribing:!0,transcriptions:[],endpointing:c.endpointing,extra:c.extra,includeRawResponse:c.includeRawResponse,instanceId:c.instanceId,language:c.language,model:c.model,profanity_filter:c.profanity_filter,punctuate:c.punctuate,redact:c.redact,startedBy:c.startedBy,tier:c.tier})},[]))),Se("transcription-stopped",Me(B.useCallback(function(a,l,c){l(hi,function(p){return rt({},p,{updatedBy:c.updatedBy,isTranscribing:!1})})},[]))),Se("transcription-error",Me(B.useCallback(function(a,l){l(hi,function(c){return rt({},c,{error:!0,isTranscribing:!1})})},[]))),Se("left-meeting",Me(B.useCallback(function(a,l){l(hi,function(c){return rt({},c,{isTranscribing:!1})})},[]))),Se("app-message",Me(B.useCallback(function(a,l,c){(c==null?void 0:c.fromId)==="transcription"&&l(hi,function(p){return rt({},p,{isTranscribing:!0,transcriptions:[].concat(p.transcriptions,[c.data])})})},[]))),xe.createElement(xe.Fragment,null,i)},Hm={},Gm=function(){return!0},CS={options:Hm,shouldCreateInstance:Gm},bS=function(n,i){var a=i===void 0?CS:i,l=a.parentElRef,c=a.options,p=c===void 0?Hm:c,v=a.shouldCreateInstance,h=v===void 0?Gm:v,_=B.useState(null),w=_[0],S=_[1],T=B.useRef();return B.useEffect(function(){if(!h())return;function M(W){return L.apply(this,arguments)}function L(){return L=Mi(function*(W){yield W.destroy()}),L.apply(this,arguments)}var O=function(){setTimeout(function(){return S(null)},0)},R=So.getCallInstance();if(!w&&R&&!R.isDestroyed()){R.once("call-instance-destroyed",O),S(R);return}if(w){ln(T.current,p)||M(w);return}if(!R||R.isDestroyed()){switch(n){case"callFrame":R=l!=null&&l.current?So.createFrame(l.current,rt({},p)):So.createFrame(rt({},p));break;case"callObject":R=So.createCallObject(rt({},p));break}T.current=p}S(R),R.once("call-instance-destroyed",O)},[w,p,l,h,n]),w},TS=function(n){return bS("callObject",n)},MS=["children","jotaiStore"],PS=function(n){var i=n.children,a=n.jotaiStore,l=$c(n,MS),c=B.useRef({}),p=B.useCallback(function(L){var O,R;if("action"in L)for(var W=L.action,ne=Array.from((O=(R=c.current)==null?void 0:R[W])!=null?O:[]),K=ne.filter(function(te){var pe=te[0];return pe<0}),G=ne.filter(function(te){var pe=te[0];return pe>0}),N=[].concat(K,G),I=Lm(N),F;!(F=I()).done;){var z=F.value,X=z[1];X(L)}},[]),v=B.useCallback(function(L){L&&Object.keys(c.current).forEach(function(O){L.off(O,p),L.isDestroyed()||L.on(O,p)})},[p]),h="callObject"in l?l.callObject:null,_=B.useMemo(function(){return"callObject"in l?{}:l},[l]),w=TS({options:_,shouldCreateInstance:B.useCallback(function(){return!("callObject"in l)},[l])}),S=h??w;B.useEffect(function(){S&&v(S)},[S,v]);var T=B.useCallback(function(L,O,R){var W;if(c.current[L]||(c.current[L]=new Map,S&&(S.off(L,p),S.isDestroyed()||S.on(L,p))),!((W=c.current[L])!=null&&W.has(R))){var ne;(ne=c.current[L])==null||ne.set(R,O)}},[S,p]),M=B.useCallback(function(L,O){var R,W;(R=c.current[L])==null||R.delete(O),((W=c.current[L])==null?void 0:W.size)===0&&(S==null||S.off(L,p),delete c.current[L])},[S,p]);return xe.createElement(Hw,{store:a},xe.createElement(Dm.Provider,{value:S},xe.createElement(Vc.Provider,{value:{on:T,off:M}},xe.createElement(kS,null,xe.createElement(yS,null,xe.createElement(_S,null,xe.createElement(sS,null,xe.createElement(wS,null,xe.createElement(gS,null,xe.createElement(ES,null,xe.createElement(mS,null,i)))))))))))},xS=Ie({state:"low",reason:"none"});xS.debugLabel=je("cpu-load");var OS=Ie(null);OS.debugLabel=je("input-settings");var LS=Ie({hidden:0,present:0});LS.debugLabel=je("participant-counts");var DS=Ie(null);DS.debugLabel=je("send-settings");const qm=B.createContext(null),IS=({children:r})=>{var L;const n=B.useRef(null),[i,a]=B.useState("idle"),[l,c]=B.useState([]),[p,v]=B.useState([]),h=B.useRef(null),_=B.useRef(new Map),w=async()=>{if(i==="connecting"||i==="connected"){console.log("[TransportProvider] Already connecting or connected");return}const O=new gc({onStateChange:(R,W)=>{console.log("[TransportProvider] onStateChange =>",R,W),a(R)},onParticipantJoined:R=>{console.log("[TransportProvider] participant joined:",R),v(W=>[...W,{username:R.user_name,id:R.session_id}])},onParticipantLeft:R=>{console.log("[TransportProvider] participant left:",R),v(W=>W.filter(ne=>ne.id!==R.session_id))},onCustomMessage:(R,W)=>{console.log("[TransportProvider] onCustomMessage =>",R,W),c(ne=>[...ne,{from:W??"unknown",data:R,time:Date.now()}])}});n.current=O;try{await O.connect()}catch(R){console.error("[TransportProvider] connectToAi error:",R)}},S=async()=>{var O,R;console.log("[TransportProvider] Disconnecting AI transport"),(O=n.current)!=null&&O.dailyCall&&(await n.current.dailyCall.leave(),await n.current.dailyCall.destroy()),(R=n.current)==null||R.disconnect(),n.current=null,a("disconnected"),c([]),v([]),_.current.forEach(W=>W.disconnect()),_.current.clear(),h.current&&(h.current.close(),h.current=null)},T=O=>{if(!n.current){console.warn("[TransportProvider] transportRef is null, cannot send");return}console.log("[TransportProvider] sendMessage =>",O),n.current.sendAppMessage(O)},M=async()=>{if(!n.current){console.warn("[TransportProvider] transportRef is null, cannot start screen share");return}await n.current.startScreenShare()};return B.useEffect(()=>()=>{var O,R;console.log("[TransportProvider] unmount => disconnecting AI"),(O=n.current)!=null&&O.dailyCall&&(n.current.dailyCall.leave(),n.current.dailyCall.destroy()),(R=n.current)==null||R.disconnect(),n.current=null,a("disconnected"),_.current.forEach(W=>W.disconnect()),_.current.clear(),h.current&&(h.current.close(),h.current=null)},[]),He.jsxs(PS,{callObject:((L=n.current)==null?void 0:L.dailyCall)||null,children:[He.jsx(Vm,{}),He.jsx(qm.Provider,{value:{connectToAi:w,disconnectAi:S,sendMessage:T,aiState:i,messages:l,startScreenShare:M,participants:p},children:r})]})},qc=()=>{const r=B.useContext(qm);if(!r)throw new Error("useTransport must be used within a TransportProvider");return r};function Ym(){const{connectToAi:r,disconnectAi:n,aiState:i}=qc(),a=["connected","ready"].includes(i),l=async()=>{try{a?await n():await r()}catch(c){console.error("Connection error:",c)}};return He.jsx("div",{className:"controls",children:He.jsx("button",{className:a?"disconnect-btn":"connect-btn",onClick:l,disabled:["connecting","disconnecting"].includes(i),children:a?"Disconnect":"Connect"})})}function AS(){const{participants:r}=qc();console.log("transportParticipants",r);const n=r.length>0?[...r,{id:"local",username:"You (Local)"}]:[{id:"unknown",username:"Waiting for participants..."}];return He.jsxs("div",{className:"participants-container",children:[He.jsx("h3",{children:"Connected Participants"}),He.jsx("div",{className:"participants-grid",children:n.map(i=>He.jsx("div",{className:"participant-box",children:He.jsx("span",{children:i.username})},i.id))})]})}const jS=""+new URL("landingpage-qapTo-5y.png",import.meta.url).href,RS=()=>He.jsxs("div",{className:"landing-container",children:[He.jsx("div",{className:"logo",children:He.jsx("img",{src:jS,alt:"RIZZTRAL",className:"logo-image"})}),He.jsx("div",{className:"connect-wrapper",children:He.jsx(Ym,{})})]});function NS(){const{aiState:r}=qc(),n=["connected","ready"].includes(r);return He.jsx("div",{className:"app",children:n?He.jsxs(He.Fragment,{children:[He.jsx(Ym,{}),He.jsx(AS,{})]}):He.jsx(RS,{})})}function FS(){return He.jsx(IS,{children:He.jsx(NS,{})})}r_.createRoot(document.getElementById("root")).render(He.jsx(xe.StrictMode,{children:He.jsx(FS,{})}));